UNPKG

n8n-nodes-tiny-erp-api-v2

Version:

Custom nodes for Tiny ERP integration with n8n, including AI tools for AI Agent workflows

45 lines (44 loc) 1.6 kB
import { IExecuteFunctions } from 'n8n-workflow'; export interface TinyErpCredentials { token: string; } interface RateLimitInfo { limit: number; remaining: number; resetTime: number; } export declare class TinyErpApi { private static limiterMap; private static batchLimiterMap; private static cacheMap; private credentials; private executeFunctions; private limiter; private batchLimiter; private lastRateLimitInfo; constructor(executeFunctions: IExecuteFunctions, credentials: TinyErpCredentials); private retryWithBackoff; private getCacheKey; private getFromCache; private setCache; private updateRateLimiterFromHeaders; private isBatchOperation; private isCacheableEndpoint; private rawRequest; makeRequest(endpoint: string, method?: string, data?: Record<string, unknown>): Promise<any>; getProducts(params?: Record<string, unknown>): Promise<any>; getOrderData(orderNumber: string): Promise<any>; getUserData(params?: Record<string, unknown>): Promise<any>; getProductStock(productId: string): Promise<any>; createProduct(productData: Record<string, unknown>): Promise<any>; createProductsBatch(productsData: Record<string, unknown>[]): Promise<any[]>; updateStock(stockData: Record<string, unknown>): Promise<any>; updateStockBatch(stockDataArray: Record<string, unknown>[]): Promise<any[]>; getRateLimitInfo(): RateLimitInfo | null; static clearCache(): void; static getCacheStats(): { size: number; entries: string[]; }; } export {};