import type { IDataObject, IExecuteFunctions, IHookFunctions, IHttpRequestMethods, ILoadOptionsFunctions } from 'n8n-workflow'; import { type IRetryConfig } from './utils/retry'; /** * Make an authenticated request to Twenty CRM API */ export declare function twentyCrmApiRequest(this: IExecuteFunctions | ILoadOptionsFunctions | IHookFunctions, method: IHttpRequestMethods, endpoint: string, body?: IDataObject, qs?: IDataObject): Promise; /** * Make an authenticated request to Twenty CRM API with automatic retry on transient errors */ export declare function twentyCrmApiRequestWithRetry(this: IExecuteFunctions | ILoadOptionsFunctions | IHookFunctions, method: IHttpRequestMethods, endpoint: string, body?: IDataObject, qs?: IDataObject, retryConfig?: Partial): Promise; /** * Make an authenticated request and return all items (handles pagination) * Twenty CRM uses cursor-based pagination with startingAfter parameter */ export declare function twentyCrmApiRequestAllItems(this: IExecuteFunctions, method: IHttpRequestMethods, endpoint: string, body?: IDataObject, qs?: IDataObject): Promise; /** * Search across multiple object types */ export declare function twentyCrmSearchRecords(this: IExecuteFunctions, query: string, objectTypes: string[], limit?: number): Promise; /** * Build filter query string for Twenty CRM API * Twenty CRM expects filters in format: ?filter=fieldName[operator]:value * Multiple filters (AND): ?filter=field1[eq]:value1,field2[eq]:value2 * Multiple values (OR): ?filter=field[in]:[value_1,value_2] * Example: ?filter=n0SalesStage[eq]:COMMUNICATED * Example with OR: ?filter=n0SalesStage[in]:[COMMUNICATED,COLD] */ export declare function buildFilterQuery(filters: IDataObject): IDataObject; /** * Clean undefined/null values from object (for request body) */ export declare function cleanObject(obj: IDataObject): IDataObject; /** * Transform custom fields - auto-detect URLs and convert to Links objects * This handles custom fields like 'drive', 'audit', etc. that are Links type */ export declare function transformCustomFields(fields: IDataObject): IDataObject; /** * Extract and transform custom fields from UI parameter * Auto-detects URLs and converts them to Links objects */ export declare function extractCustomFields(customFieldsUi: IDataObject): IDataObject; /** * Transform a simple URL string to Twenty CRM Links object format */ export declare function toLinkObject(url: string | undefined): IDataObject | undefined; /** * Transform company fields to Twenty CRM API format * Converts simple strings to complex objects where needed */ export declare function transformCompanyFields(fields: IDataObject): IDataObject; /** * Transform person fields to Twenty CRM API format * Twenty CRM expects: name: {firstName, lastName}, emails: {primaryEmail}, phones: {primaryPhoneNumber} */ export declare function transformPersonFields(fields: IDataObject): IDataObject; /** * Transform note fields to Twenty CRM API format * Note: Twenty CRM notes don't have a 'body' field - only 'title' and 'position' */ export declare function transformNoteFields(fields: IDataObject): IDataObject; /** * Transform opportunity fields to Twenty CRM API format * Twenty CRM expects amount as Currency object: {amountMicros, currencyCode} */ export declare function transformOpportunityFields(fields: IDataObject): IDataObject; /** * Transform task fields to Twenty CRM API format * Note: Twenty CRM tasks API doesn't support 'body' field */ export declare function transformTaskFields(fields: IDataObject): IDataObject; /** * Get endpoint for a resource */ export declare function getResourceEndpoint(resource: string): string; /** * Find record by field value (for upsert operations) */ export declare function findRecordByField(this: IExecuteFunctions, resource: string, fieldName: string, fieldValue: string): Promise; /** * Perform bulk operation (create, update, or delete multiple records) */ export declare function bulkOperation(this: IExecuteFunctions, operation: 'create' | 'update' | 'delete', resource: string, items: IDataObject[]): Promise;