n8n-nodes-close-crm
Version:
N8N community node for Close CRM integration with comprehensive lead, opportunity, task, note, call management, and enhanced triggers for workflow automation
228 lines (227 loc) • 7.98 kB
TypeScript
import type { INodeProperties, INodePropertyOptions } from 'n8n-workflow';
/**
* Custom field interface based on Close CRM API response
*/
interface CustomField {
id: string;
name: string;
type: 'choices' | 'text' | 'richtextarea' | 'number' | 'date' | 'datetime' | 'user' | 'contact';
accepts_multiple_values: boolean;
choices?: string[];
}
/**
* Custom Fields UI sections for Create operation
*/
export declare const customFieldsCreateSections: INodeProperties[];
/**
* Custom Fields UI sections for Update operation (same structure as create)
*/
export declare const customFieldsUpdateSections: INodeProperties[];
/**
* Load options methods for the new custom fields implementation
*/
export declare const customFieldsLoadMethods: {
/**
* Get cached custom fields with workspace isolation
*/
getCachedCustomFields(context: any): Promise<CustomField[]>;
/**
* Get cached users with workspace isolation
*/
getCachedUsers(context: any): Promise<INodePropertyOptions[]>;
/**
* Get text fields
*/
getTextFields(context: any): Promise<INodePropertyOptions[]>;
/**
* Get number fields
*/
getNumberFields(context: any): Promise<INodePropertyOptions[]>;
/**
* Get date fields (includes both date and datetime)
*/
getDateFields(context: any): Promise<INodePropertyOptions[]>;
/**
* Get single choice fields
*/
getChoiceSingleFields(context: any): Promise<INodePropertyOptions[]>;
/**
* Get multiple choice fields
*/
getChoiceMultipleFields(context: any): Promise<INodePropertyOptions[]>;
/**
* Get single user fields
*/
getUserSingleFields(context: any): Promise<INodePropertyOptions[]>;
/**
* Get multiple user fields
*/
getUserMultipleFields(context: any): Promise<INodePropertyOptions[]>;
/**
* Get single contact fields
*/
getContactSingleFields(context: any): Promise<INodePropertyOptions[]>;
/**
* Get multiple contact fields
*/
getContactMultipleFields(context: any): Promise<INodePropertyOptions[]>;
/**
* Get all choice values from all choice fields
* This is used as a workaround since loadOptionsDependsOn doesn't work in fixedCollections
* It tries to filter based on the selected fieldId if possible
*/
getAllChoiceValues(context: any): Promise<INodePropertyOptions[]>;
/**
* Get choices/options for a specific field (handles choice fields)
* NOTE: This method doesn't work in fixedCollections due to n8n limitations
*/
getFieldChoices(context: any): Promise<INodePropertyOptions[]>;
/**
* Get fields filtered by the selected field type (legacy method)
*/
getFieldsByType(context: any): Promise<INodePropertyOptions[]>;
/**
* Filter fields by type and cardinality (legacy method)
*/
filterFieldsByType(fields: CustomField[], type: string, multiple?: boolean): INodePropertyOptions[];
/**
* Get choices for a specific field (legacy method)
*/
getChoicesForField(fields: CustomField[], fieldId: string): INodePropertyOptions[];
/**
* Expose users as loadOptions method for UI dropdowns
*/
getUsers(context: any): Promise<INodePropertyOptions[]>;
/**
* Get cached contact custom fields with workspace isolation
*/
getCachedContactCustomFields(context: any): Promise<CustomField[]>;
/**
* Get contact text fields
*/
getContactTextFields(context: any): Promise<INodePropertyOptions[]>;
/**
* Get contact number fields
*/
getContactNumberFields(context: any): Promise<INodePropertyOptions[]>;
/**
* Get contact date fields (includes both date and datetime)
*/
getContactDateFields(context: any): Promise<INodePropertyOptions[]>;
/**
* Get contact single choice fields
*/
getContactSingleChoiceFields(context: any): Promise<INodePropertyOptions[]>;
/**
* Get contact multiple choice fields
*/
getContactMultipleChoiceFields(context: any): Promise<INodePropertyOptions[]>;
/**
* Get all contact choice values from all choice fields
*/
getContactAllChoiceValues(context: any): Promise<INodePropertyOptions[]>;
/**
* Get contact single user fields
*/
getContactSingleUserFields(context: any): Promise<INodePropertyOptions[]>;
/**
* Get contact multiple user fields
*/
getContactMultipleUserFields(context: any): Promise<INodePropertyOptions[]>;
};
/**
* Validation functions for custom field values
*/
export declare const customFieldValidators: {
/**
* Validate text field value
*/
validateText(value: any): string | null;
/**
* Validate number field value
*/
validateNumber(value: any): string | null;
/**
* Validate date field value
*/
validateDate(value: any): string | null;
/**
* Validate choice field value
*/
validateChoice(value: any, field: CustomField): string | null;
/**
* Validate user field value
*/
validateUser(value: any, field: CustomField): string | null;
/**
* Validate contact field value
*/
validateContact(value: any, field: CustomField): string | null;
};
/**
* Utility function to construct custom field payload
*/
export declare function constructCustomFieldsPayload(customFieldsData: any, fields: CustomField[]): Record<string, any>;
/**
* Utility function to construct contact custom field payload
*/
export declare function constructContactCustomFieldsPayload(contactData: any, fields: CustomField[]): Record<string, any>;
/**
* Get cached custom activity custom fields with workspace isolation
* Custom activity fields are fetched for a specific custom activity type
*/
export declare function getCachedCustomActivityCustomFields(context: any, customActivityTypeId?: string): Promise<CustomField[]>;
/**
* Custom Activity Custom Fields UI sections for Create operation
*/
export declare const customActivityCustomFieldsCreateSections: INodeProperties[];
/**
* Custom Activity Custom Fields UI sections for Update operation
*/
export declare const customActivityCustomFieldsUpdateSections: INodeProperties[];
/**
* Load methods for Custom Activity custom fields
*/
export declare const customActivityCustomFieldsLoadMethods: {
/**
* Get Custom Activity text fields
*/
getCustomActivityTextFields(context: any): Promise<INodePropertyOptions[]>;
/**
* Get Custom Activity rich text fields
*/
getCustomActivityRichTextFields(context: any): Promise<INodePropertyOptions[]>;
/**
* Get Custom Activity number fields
*/
getCustomActivityNumberFields(context: any): Promise<INodePropertyOptions[]>;
/**
* Get Custom Activity date fields (includes both date and datetime)
*/
getCustomActivityDateFields(context: any): Promise<INodePropertyOptions[]>;
/**
* Get Custom Activity single choice fields
*/
getCustomActivitySingleChoiceFields(context: any): Promise<INodePropertyOptions[]>;
/**
* Get Custom Activity multiple choice fields
*/
getCustomActivityMultipleChoiceFields(context: any): Promise<INodePropertyOptions[]>;
/**
* Get all choice values from all Custom Activity choice fields
*/
getCustomActivityAllChoiceValues(context: any): Promise<INodePropertyOptions[]>;
/**
* Get Custom Activity single user fields
*/
getCustomActivitySingleUserFields(context: any): Promise<INodePropertyOptions[]>;
/**
* Get Custom Activity multiple user fields
*/
getCustomActivityMultipleUserFields(context: any): Promise<INodePropertyOptions[]>;
};
/**
* Utility function to construct Custom Activity custom field payload
*/
export declare function constructCustomActivityCustomFieldsPayload(customActivityData: any, fields: CustomField[]): Record<string, any>;
export {};