n8n-nodes-base
Version:
Base nodes of n8n
163 lines • 6.14 kB
TypeScript
import type { IExecuteFunctions, IHookFunctions, IDataObject, ILoadOptionsFunctions, IHttpRequestMethods } from 'n8n-workflow';
import type { AllFields, CamelCaseResource, GetAllFilterOptions, NameType, ProductDetails, ResourceItems, SnakeCaseResource } from './types';
export declare function throwOnErrorStatus(this: IExecuteFunctions | IHookFunctions | ILoadOptionsFunctions, responseData: {
data?: Array<{
status: string;
message: string;
}>;
}): void;
export declare function zohoApiRequest(this: IExecuteFunctions | IHookFunctions | ILoadOptionsFunctions, method: IHttpRequestMethods, endpoint: string, body?: IDataObject, qs?: IDataObject, uri?: string): Promise<any>;
/**
* Make an authenticated API request to Zoho CRM API and return all items.
*/
export declare function zohoApiRequestAllItems(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, method: IHttpRequestMethods, endpoint: string, body?: IDataObject, qs?: IDataObject): Promise<IDataObject[]>;
/**
* Handle a Zoho CRM API listing by returning all items or up to a limit.
*/
export declare function handleListing(this: IExecuteFunctions, method: IHttpRequestMethods, endpoint: string, body?: IDataObject, qs?: IDataObject): Promise<IDataObject[]>;
export declare function throwOnEmptyUpdate(this: IExecuteFunctions, resource: CamelCaseResource): void;
export declare function throwOnMissingProducts(this: IExecuteFunctions, resource: CamelCaseResource, productDetails: ProductDetails): void;
/**
* Place a product ID at a nested position in a product details field.
*/
export declare const adjustProductDetails: (productDetails: ProductDetails, operation?: string) => {
product: {
id: string;
};
quantity: number;
}[];
/**
* Place a product ID at a nested position in a product details field.
*
* Only for updating products from Invoice, Purchase Order, Quote, and Sales Order.
*/
export declare const adjustProductDetailsOnUpdate: (allFields: AllFields) => AllFields | {
product: {
id: string;
};
quantity: number;
}[];
export declare const adjustAccountPayload: (...args: any[]) => any;
export declare const adjustContactPayload: (...args: any[]) => any;
export declare const adjustDealPayload: (allFields: AllFields) => {
[key: string]: IDataObject | import("n8n-workflow").GenericValue | import("n8n-workflow").GenericValue[] | IDataObject[];
Date_of_Birth?: string | undefined;
Closing_Date?: string | undefined;
Due_Date?: string | undefined;
Invoice_Date?: string | undefined;
PO_Date?: string | undefined;
Valid_Till?: string | undefined;
Address?: {
address_fields: {
[key: string]: string;
};
} | undefined;
Billing_Address?: {
address_fields: {
[key: string]: string;
};
} | undefined;
Mailing_Address?: {
address_fields: {
[key: string]: string;
};
} | undefined;
Shipping_Address?: {
address_fields: {
[key: string]: string;
};
} | undefined;
Other_Address?: {
address_fields: {
[key: string]: string;
};
} | undefined;
Account?: {
subfields: {
id: string;
name: string;
};
};
accountId?: string | undefined;
contactId?: string | undefined;
dealId?: string | undefined;
Product_Details?: ProductDetails;
};
export declare const adjustInvoicePayload: (...args: any[]) => any;
export declare const adjustInvoicePayloadOnUpdate: (...args: any[]) => any;
export declare const adjustLeadPayload: (...args: any[]) => any;
export declare const adjustPurchaseOrderPayload: (...args: any[]) => any;
export declare const adjustQuotePayload: (...args: any[]) => any;
export declare const adjustSalesOrderPayload: (...args: any[]) => any;
export declare const adjustVendorPayload: (...args: any[]) => any;
export declare const adjustProductPayload: (allFields: AllFields) => {
[key: string]: IDataObject | import("n8n-workflow").GenericValue | import("n8n-workflow").GenericValue[] | IDataObject[];
Date_of_Birth?: string | undefined;
Closing_Date?: string | undefined;
Due_Date?: string | undefined;
Invoice_Date?: string | undefined;
PO_Date?: string | undefined;
Valid_Till?: string | undefined;
Address?: {
address_fields: {
[key: string]: string;
};
} | undefined;
Billing_Address?: {
address_fields: {
[key: string]: string;
};
} | undefined;
Mailing_Address?: {
address_fields: {
[key: string]: string;
};
} | undefined;
Shipping_Address?: {
address_fields: {
[key: string]: string;
};
} | undefined;
Other_Address?: {
address_fields: {
[key: string]: string;
};
} | undefined;
Account?: {
subfields: {
id: string;
name: string;
};
};
accountId?: string | undefined;
contactId?: string | undefined;
dealId?: string | undefined;
Product_Details?: ProductDetails;
};
/**
* Convert items in a Zoho CRM API response into n8n load options.
*/
export declare const toLoadOptions: (items: ResourceItems, nameProperty: NameType) => {
name: string;
value: string;
}[];
export declare function getModuleName(resource: string): string;
/**
* Retrieve all fields for a resource, sorted alphabetically.
*/
export declare function getFields(this: ILoadOptionsFunctions, resource: SnakeCaseResource, { onlyCustom }?: {
onlyCustom: boolean;
}): Promise<{
name: string;
value: string;
}[]>;
export declare const capitalizeInitial: (str: string) => string;
export declare function getPicklistOptions(this: ILoadOptionsFunctions, resource: string, targetField: string): Promise<{
name: string;
value: string;
}[]>;
/**
* Add filter options to a query string object.
*/
export declare const addGetAllFilterOptions: (qs: IDataObject, options: GetAllFilterOptions) => void;
//# sourceMappingURL=GenericFunctions.d.ts.map