UNPKG

cecon-interfaces

Version:
76 lines (75 loc) 2.1 kB
import { IN8nChatApiCallback } from '../interfaces/i-chat-api-callback'; export declare class N8nChatApiCallbackEntity implements IN8nChatApiCallback { callApi: boolean; callbackId: string; apiUrl: string; method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; headers: { authorization?: string; contentType?: string; userAgent?: string; customHeaders?: Record<string, string>; }; payload?: { userData?: { userId: string; name?: string; phone?: string; email?: string; }; formData?: Record<string, any>; contextData?: { sessionId: string; messageId: string; platform: string; timestamp: Date; }; customPayload?: any; }; requestConfig?: { timeout?: number; retryAttempts?: number; retryDelay?: number; validateSSL?: boolean; }; responseHandling?: { autoResponse: boolean; successMessage?: string; errorMessage?: string; responseTemplate?: string; }; metadata?: { action: string; description?: string; requiredFields?: string[]; workflow?: { workflowId: string; nodeId: string; stepName: string; }; }; conditions?: { requireAllFields?: boolean; customValidations?: Array<{ field: string; rule: 'required' | 'email' | 'phone' | 'date' | 'regex'; value?: string; message?: string; }>; }; webhook?: { url: string; method: 'POST' | 'PUT'; notifyOnSuccess?: boolean; notifyOnError?: boolean; }; constructor(data?: Partial<IN8nChatApiCallback>); /** * Valida se o callback está configurado corretamente para execução */ isValid(): boolean; /** * Valida se todas as condições são atendidas para executar a API */ canExecute(formData?: Record<string, any>): boolean; }