@cllbk/ghl
Version:
A public Node.js compatible SDK for working with HighLevel's (GHL's) Version 2 API.
1,372 lines (1,321 loc) • 117 kB
text/typescript
import {
SearchFilter,
SearchFilterConfig,
SearchSort,
SuccessDeleteDTO,
} from "./_global";
/**
* Objects represent entities in the CRM system, such as Contacts, Companies, or Custom Objects.
* Objects serve as a foundation for organising and managing data.
*
* Custom Objects:
* Unlike Standard objects, Custom Objects allow users to define and structure their own data models.
* Custom Objects offer flexibility by enabling users to specify:
* Name of the Object
* Fields and Field Types (e.g., single line text)
* Searchable Properties (fields that can be indexed for searching)
*
* Primary Display Property (the main identifier used for displaying the record)
*/
export namespace Objects {
/**
* Records: Records are instances of an object.
* Each record contains specific data according to the schema defined in its parent object.
*/
export namespace Records {
/**
* MonetaryValue: Represents a monetary value in a specific currency.
* It includes:
* - currency: The currency of the monetary value, currently only "default" is supported.
* - value: The numerical value of the monetary amount.
* @typedef {Object} MonetaryValue
* @memberof Objects.Records
* @example
* ```ts
* {
* currency: "default",
* value: 100
* }
* ```
*
* @property {string} currency - The currency of the monetary value, currently only "default" is supported.
* @property {number} value - The numerical value of the monetary amount.
*/
type MonetaryValue = {
currency: "default"; // Currently only "default" is supported, which is the location's currency.
value: number; // The monetary value in the specified currency.
};
/**
* FileValue: Represents a file associated with a record.
* It includes:
* - url: The URL of the file.
* @typedef {Object} FileValue
* @memberof Objects.Records
* @example
* ```ts
* {
* url: "https://example.com/file.pdf"
* }
* ```
*
* @property {string} url - The URL of the file.
* @example
* ```ts
* {
* url: "https://example.com/file.pdf"
* }
* ```
*/
type FileValue = {
/** url: The URL of the file.
* @property {string} url - The URL of the file.
*/
url: string; // The URL of the file.
};
/**
* RecordProperties: Represents the properties of a record.
* It can be of various types, including:
* - string
* - number
* - boolean
* - Date
* - string[]
* - MonetaryValue (for currency fields)
* - FileValue (for file fields)
* - null
*
* @typedef {string | number | boolean | Date | string[] | MonetaryValue | FileValue | null} RecordProperties
*/
type RecordProperties =
| string
| number
| boolean
| Date
| string[]
| MonetaryValue
| FileValue
| null;
/**
* CreateParams: The structure of the parameters when creating a new record.
*
* @requires schemaKey: The ID of the object to which the record belongs.
* @memberof Objects.Records
* @example
* ```ts
* const params: Objects.Records.CreateParams = {
* schemaKey: 'abcdef1234567890'
* };
* ```
*
* @property {string} schemaKey - The ID of the object to which the record belongs.
* @example 'abcdef1234567890'
*/
export type CreateParams = {
/**
* objectId: The ID of the object to which the record belongs.
* @type {string}
* @example 'abcdef1234567890'
*/
schemaKey: string;
};
/**
* UpdateBody: The structure of the request body when creating a new record.
* It includes the location ID, owners, followers, and properties of the record.
*
* @memberof Objects.Records* @example
* ```ts
* const params: Objects.Records.UpdateBody = {
* owners: ['1a2b3c4d5e6f7g8h9i0j'],
* followers: ['BqTwX8QFwXzpegMve9EQ', '9NkT25Vor1v4aQatFsv2'],
* properties: {
* "customer_number": 1424, - Number Field
* "ticket_name": "Customer not able login", - Single Line, Multi Line field
* "phone_number": "+917000000000", - Phone Field
* "money": { - Currency Field
* "currency": "default", - Only "default" supported today (Location's currency).
* "value": 100 - Support for more currencies coming soon!!!
* },
* "type_of_ticket": "option_1_internal_key", - Dropdown Single Select Field Or Radio Field
* "section_of_app": ["contacts", "smartlist"], - Dropdown Multiple Select Field and Checkbox Field
* "recieved_on": "2024-07-11", - Date Picker Field
* "my_files": [ - Files type Field
* {
* "url": "---url_of_file---"
* }
* ],
* // For Text Box List options:
* "my_textbox_list_key.label_1_key": "Value 1",
* "my_textbox_list_key.label_2_key": "Value 2"
* }
* };
* ```
*
* @property {string[]} owners - Array of one Owner (User) ID
* @example '1a2b3c4d5e6f7g8h9i0j'
*
* @property {string[]} followers - Array of one or more Follower (User) IDs
* @example ['BqTwX8QFwXzpegMve9EQ', '9NkT25Vor1v4aQatFsv2']
*
* @property {RecordProperties} properties - The properties of the object.
* @example '
* properties: {
* "customer_number": 1424, - Number Field
* "ticket_name": "Customer not able login", - Single Line, Multi Line field
* "phone_number": "+917000000000", - Phone Field
* "money": { - Currency Field
* "currency": "default", - Only "default" supported today (Location's currency).
* "value": 100 - Support for more currencies coming soon!!!
* },
* "type_of_ticket": "option_1_internal_key", - Dropdown Single Select Field Or Radio Field
* "section_of_app": ["contacts", "smartlist"], - Dropdown Multiple Select Field and Checkbox Field
* "recieved_on": "2024-07-11", - Date Picker Field
* "my_files": [ - Files type Field
* {
* "url": "---url_of_file---"
* }
* ],
* // For Text Box List options:
* "my_textbox_list_key.label_1_key": "Value 1",
* "my_textbox_list_key.label_2_key": "Value 2"
* }'
*/
export type UpdateBody = {
/**
* owners: Array of one Owner (User) ID
* @type {string[]}
* @example ['1a2b3c4d5e6f7g8h9i0j']
*/
owners: string[];
/**
* followers: Array of one or more Follower (User) IDs
* @type {string[]}
* @example ['BqTwX8QFwXzpegMve9EQ', '9NkT25Vor1v4aQatFsv2']
*/
followers: string[];
/**
* properties: The properties of the object.
* @type {Record<string, RecordProperties>}
* @example
* ```ts
* properties: {
* "customer_number": 1424, // Number Field
* "ticket_name": "Customer not able login", // Single Line, Multi Line field
* "phone_number": "+917000000000", // Phone Field
* "money": { // Currency Field
* "currency": "default", // Only "default" supported today (Location's currency).
* "value": 100 // Support for more currencies coming soon!!!
* },
* "type_of_ticket": "option_1_internal_key", // Dropdown Single Select Field Or Radio Field
* "section_of_app": ["contacts", "smartlist"], // Dropdown Multiple Select Field and Checkbox Field
* "recieved_on": "2024-07-11", // Date Picker Field
* "my_files": [ // Files type Field
* {
* "url": "---url_of_file---"
* }
* ],
* // For Text Box List options:
* "my_textbox_list_key.label_1_key": "Value 1",
* "my_textbox_list_key.label_2_key": "Value 2"
* }
* ```
*/
properties: Record<string, RecordProperties>;
};
/**
* CreateBody: The structure of the request body when creating a new record.
* It includes the location ID, owners, followers, and properties of the record.
*
* @requires locationId: The ID of the location where the record is created.
* @memberof Objects.Records* @example
* ```ts
* const params: Objects.Records.CreateBody = {
* locationId: '502goXVW3lIExEQPOnd3',
* owners: ['1a2b3c4d5e6f7g8h9i0j'],
* followers: ['BqTwX8QFwXzpegMve9EQ', '9NkT25Vor1v4aQatFsv2'],
* properties: {
* "customer_number": 1424, - Number Field
* "ticket_name": "Customer not able login", - Single Line, Multi Line field
* "phone_number": "+917000000000", - Phone Field
* "money": { - Currency Field
* "currency": "default", - Only "default" supported today (Location's currency).
* "value": 100 - Support for more currencies coming soon!!!
* },
* "type_of_ticket": "option_1_internal_key", - Dropdown Single Select Field Or Radio Field
* "section_of_app": ["contacts", "smartlist"], - Dropdown Multiple Select Field and Checkbox Field
* "recieved_on": "2024-07-11", - Date Picker Field
* "my_files": [ - Files type Field
* {
* "url": "---url_of_file---"
* }
* ],
* // For Text Box List options:
* "my_textbox_list_key.label_1_key": "Value 1",
* "my_textbox_list_key.label_2_key": "Value 2"
* }
* };
* ```
*
* @property {string} locationId - The location ID of the object.
* @example '502goXVW3lIExEQPOnd3'
*
* @property {string[]} owners - Array of one Owner (User) ID
* @example '1a2b3c4d5e6f7g8h9i0j'
*
* @property {string[]} followers - Array of one or more Follower (User) IDs
* @example ['BqTwX8QFwXzpegMve9EQ', '9NkT25Vor1v4aQatFsv2']
*
* @property {RecordProperties} properties - The properties of the object.
* @example '
* properties: {
* "customer_number": 1424, - Number Field
* "ticket_name": "Customer not able login", - Single Line, Multi Line field
* "phone_number": "+917000000000", - Phone Field
* "money": { - Currency Field
* "currency": "default", - Only "default" supported today (Location's currency).
* "value": 100 - Support for more currencies coming soon!!!
* },
* "type_of_ticket": "option_1_internal_key", - Dropdown Single Select Field Or Radio Field
* "section_of_app": ["contacts", "smartlist"], - Dropdown Multiple Select Field and Checkbox Field
* "recieved_on": "2024-07-11", - Date Picker Field
* "my_files": [ - Files type Field
* {
* "url": "---url_of_file---"
* }
* ],
* // For Text Box List options:
* "my_textbox_list_key.label_1_key": "Value 1",
* "my_textbox_list_key.label_2_key": "Value 2"
* }'
*/
export type CreateBody = UpdateBody & {
/**
* locationId: The location ID of the object.
* @type {string}
* @example '502goXVW3lIExEQPOnd3'
*/
locationId: string;
};
/**
* UpdateParams: The structure of the parameters when updating a record.
*
* @requires recordId: The ID of the record to be updated.
* @requires objectId: The ID of the object to which the record belongs.
* @requires locationId: The ID of the location where the record is updated.
* @memberof Objects.Records
* @example
* ```ts
* const params: Objects.Records.UpdateParams = {
* recordId: '1234567890abcdef',
* objectId: 'abcdef1234567890',
* locationId: '502goXVW3lIExEQPOnd3'
* };
* ```
*
* @property {string} recordId - The ID of the record to be updated.
* @example '1234567890abcdef'
*
* @property {string} objectId - The ID of the object to which the record belongs.
* @example 'abcdef1234567890'
*
* @property {string} locationId - The ID of the location where the record is updated.
* @example '502goXVW3lIExEQPOnd3'
*/
export type UpdateParams = {
/**
* recordId: The ID of the record to be updated.
* @type {string}
* @example '1234567890abcdef'
*/
recordId: string;
/**
* objectId: The ID of the object to which the record belongs.
* @type {string}
* @example 'abcdef1234567890'
*/
objectId: string;
/**
* locationId: The ID of the location where the record is updated.
* @type {string}
* @example '502goXVW3lIExEQPOnd3'
*/
locationId: string;
};
/**
* SearchParams: The structure of the parameters when searching for records.
*
* @requires schemaKey: The key of the object schema to search within.
* @memberof Objects.Records
* @example
* ```ts
* const params: Objects.Records.SearchParams = {
* schemaKey: '632c34b4c9b7da3358ac9891'
* };
* ```
*
* @property {string} schemaKey - The key of the object schema to search within.
* @example '632c34b4c9b7da3358ac9891'
*/
export type SearchParams = {
/**
* schemaKey: The key of the object schema to search within.
* @type {string}
* @example '632c34b4c9b7da3358ac9891'
*/
schemaKey: string;
};
/**
* SearchBody: The structure of the request body when searching for records.
* It includes the location ID, page number, page limit, query, searchAfter, filters, and sort options.
*
* @memberof Objects.Records
* @example
* ```ts
* const params: Objects.Records.SearchBody = {
* locationId: '502goXVW3lIExEQPOnd3',
* page: 1,
* pageLimit: 20,
* query: 'customer',
* searchAfter: ['1234567890abcdef', 1622547800000],
* filters: [
* {
* field: 'customer_number',
* operator: 'equals',
* value: 1424
* },
* {
* field: 'type_of_ticket',
* operator: 'in',
* value: ['option_1_internal_key', 'option_2_internal_key']
* }
* ],
* sort: [
* {
* field: 'recieved_on',
* direction: 'desc'
* }
* ]
* };
* ```
*
* @property {string} locationId - The ID of the location where the search is performed.
* @example '502goXVW3lIExEQPOnd3'
*
* @property {number} page - The page number for pagination.
* @example 1
*
* @property {number} pageLimit - The number of records per page.
* @example 20
*
* @property {string} [query] - The search query string to filter records.
* @example 'customer'
*
* @property {Array<string | number>} [searchAfter] - An array of values to use for pagination, typically the last record's ID and timestamp.
* @example ['1234567890abcdef', 1622547800000]
*
* @property {Array<SearchFilter | SearchFilterConfig>} [filters] - An array of filters to apply to the search.
* @example
* ```ts
* [
* {
* field: 'customer_number',
* operator: 'equals',
* value: 1424
* },
* {
* field: 'type_of_ticket',
* operator: 'in',
* value: ['option_1_internal_key', 'option_2_internal_key']
* }
* ]
* ```
*/
export type SearchBody = {
/**
* locationId: The ID of the location where the search is performed.
*
* @type {string}
* @example '502goXVW3lIExEQPOnd3'
*/
locationId: string;
/**
* page: The page number for pagination.
*
* @type {number}
* @example 1
*/
page: number;
/**
* pageLimit: The number of records per page.
*
* @type {number}
* @example 20
*/
pageLimit: number;
/**
* query: The search query string to filter records.
*
* @type {string}
* @example 'customer'
*/
query?: string;
/**
* searchAfter: An array of values to use for pagination, typically the last record's ID and timestamp.
*
* @type {Array<string | number>}
* @example ['1234567890abcdef', 1622547800000]
*/
searchAfter?: Array<string | number>;
/**
* filters: An array of filters to apply to the search.
* @type {Array<SearchFilter | SearchFilterConfig>}
* @example
* ```ts
* [
* {
* field: 'customer_number',
* operator: 'equals',
* value: 1424
* },
* {
* field: 'type_of_ticket',
* operator: 'in',
* value: ['option_1_internal_key', 'option_2_internal_key']
* }
* ]
* ```
*/
filters?: Array<SearchFilter | SearchFilterConfig>;
/**
* sort: An array of sort options to apply to the search results.
* @type {Array<SearchSort>}
* @example
* ```ts
* [
* {
* field: 'recieved_on',
* direction: 'desc'
* }
* ]
* ```
*/
sort?: SearchSort[];
};
/**
* GetParams: The structure of the parameters when retrieving a record.
* @requires id: The ID of the record to be retrieved.
* @requires schemaKey: The key of the object schema to which the record belongs.
* @memberof Objects.Records
* @example
* ```ts
* const params: Objects.Records.GetParams = {
* id: '1234567890abcdef',
* schemaKey: '632c34b4c9b7da3358ac9891'
* };
* ```
*
* @property {string} id - The ID of the record to be retrieved.
* @example '1234567890abcdef'
*
* @property {string} schemaKey - The key of the object schema to which the record belongs.
* @example '632c34b4c9b7da3358ac9891'
*/
export type GetParams = {
/**
* id: The ID of the record to be retrieved.
*
* @type {string}
* @example '1234567890abcdef'
*/
id: string;
/**
* schemaKey: The key of the object schema to which the record belongs.
*
* @type {string}
* @example '632c34b4c9b7da3358ac9891'
*/
schemaKey: string;
};
/**
* DeleteParams: The structure of the parameters when deleting a record.
*
* @requires id: The ID of the record to be deleted.
* @requires schemaKey: The key of the object schema to which the record belongs.
* @memberof Objects.Records
* @example
* ```ts
* const params: Objects.Records.DeleteParams = {
* id: '1234567890abcdef',
* schemaKey: '632c34b4c9b7da3358ac9891'
* };
* ```
*
* @property {string} id - The ID of the record to be deleted.
* @example '1234567890abcdef'
*
* @property {string} schemaKey - The key of the object schema to which the record belongs.
* @example '632c34b4c9b7da3358ac9891'
*/
export type DeleteParams = {
/**
* id: The ID of the record to be deleted.
* @type {string}
* @example '1234567890abcdef'
*/
id: string;
/**
* schemaKey: The key of the object schema to which the record belongs.
* @type {string}
* @example '632c34b4c9b7da3358ac9891'
*/
schemaKey: string;
};
/**
* RecordDTO: The structure of a record data transfer object (DTO).
* It includes the record's ID, object ID, location ID, owners, followers, properties, and timestamps for when the record was added and last updated.
*
* @memberof Objects.Records
* @example
* ```ts
* const record: Objects.Records.RecordDTO = {
* id: '1234567890abcdef',
* objectId: 'abcdef1234567890',
* locationId: '502goXVW3lIExEQPOnd3',
* owner: ['1a2b3c4d5e6f7g8h9i0j'],
* followers: ['BqTwX8QFwXzpegMve9EQ', '9NkT25Vor1v4aQatFsv2'],
* properties: {
* "customer_number": 1424, // Number Field
* "ticket_name": "Customer not able login", // Single Line, Multi Line field
* "phone_number": "+917000000000", // Phone Field
* "money": { // Currency Field
* "currency": "default", // Only "default" supported today (Location's currency).
* "value": 100 // Support for more currencies coming soon!!!
* },
* "type_of_ticket": "option_1_internal_key", // Dropdown Single Select Field Or Radio Field
* "section_of_app": ["contacts", "smartlist"], // Dropdown Multiple Select Field and Checkbox Field
* "recieved_on": "2024-07-11", // Date Picker Field
* "my_files": [ // Files type Field
* {
* "url": "---url_of_file---"
* }
* ],
* // For Text Box List options:
* "my_textbox_list_key.label_1_key": "Value 1",
* "my_textbox_list_key.label_2_key": "Value 2"
* },
* dateAdded: '2024-07-11T10:00:00Z',
* dateUpdated: '2024-07-11T10:00:00Z'
* };
* ```
*
* @property {string} id - The unique identifier of the record.
* @example '1234567890abcdef'
*
* @property {string} objectId - The ID of the object to which the record belongs.
* @example 'abcdef1234567890'
*
* @property {string} locationId - The ID of the location where the record is stored.
* @example '502goXVW3lIExEQPOnd3'
*
* @property {string[]} owner - Array of User IDs who own the record.
* @example ['1a2b3c4d5e6f7g8h9i0j']
*
* @property {string[]} followers - Array of User IDs who follow the record.
* @example ['BqTwX8QFwXzpegMve9EQ', '9NkT25Vor1v4aQatFsv2']
*
* @property {Record<string, RecordProperties>} properties - The properties of the record, where each key is a field name and the value is the field value.
* @example
* ```ts
* properties: {
* "customer_number": 1424, // Number Field
* "ticket_name": "Customer not able login", // Single Line, Multi Line field
* "phone_number": "+917000000000", // Phone Field
* "money": { // Currency Field
* "currency": "default", // Only "default" supported today (Location's currency).
* "value": 100 // Support for more currencies coming soon!!!
* },
* "type_of_ticket": "option_1_internal_key", // Dropdown Single Select Field Or Radio Field
* "section_of_app": ["contacts", "smartlist"], // Dropdown Multiple Select Field and Checkbox Field
* "recieved_on": "2024-07-11", // Date Picker Field
* "my_files": [ // Files type Field
* {
* "url": "---url_of_file---"
* }
* ],
* // For Text Box List options:
* "my_textbox_list_key.label_1_key": "Value 1",
* "my_textbox_list_key.label_2_key": "Value 2"
* }
* ```
*
* @property {string} dateAdded - The date and time when the record was added, in ISO 8601 format.
* @example '2024-07-11T10:00:00Z'
*
* @property {string} dateUpdated - The date and time when the record was last updated, in ISO 8601 format.
* @example '2024-07-11T10:00:00Z'
*/
export type RecordDTO = {
/**
* id: The unique identifier of the record.
* @type {string}
* @example '1234567890abcdef'
*/
id: string;
/**
* objectId: The ID of the object to which the record belongs.
* @type {string}
* @example 'abcdef1234567890'
*/
objectId: string;
/**
* locationId: The ID of the location where the record is stored.
* @type {string}
* @example '502goXVW3lIExEQPOnd3'
*/
locationId: string;
/**
* owner: Array of User IDs who own the record.
* @type {string[]}
* @example ['1a2b3c4d5e6f7g8h9i0j']
*/
owner: string[];
/**
* followers: Array of User IDs who follow the record.
* @type {string[]}
* @example ['BqTwX8QFwXzpegMve9EQ', '9NkT25Vor1v4aQatFsv2']
*/
followers: string[];
/**
* properties: The properties of the record, where each key is a field name and the value is the field value.
* @type {Record<string, RecordProperties>}
* @example
* ```ts
* properties: {
* "customer_number": 1424, // Number Field
* "ticket_name": "Customer not able login", // Single Line, Multi Line field
* "phone_number": "+917000000000", // Phone Field
* "money": { // Currency Field
* "currency": "default", // Only "default" supported today (Location's currency).
* "value": 100 // Support for more currencies coming soon!!!
* },
* "type_of_ticket": "option_1_internal_key", // Dropdown Single Select Field Or Radio Field
* "section_of_app": ["contacts", "smartlist"], // Dropdown Multiple Select Field and Checkbox Field
* "recieved_on": "2024-07-11", // Date Picker Field
* "my_files": [ // Files type Field
* {
* "url": "---url_of_file---"
* }
* ],
* // For Text Box List options:
* "my_textbox_list_key.label_1_key": "Value 1",
* "my_textbox_list_key.label_2_key": "Value 2"
* }
* ```
*/
properties: Record<string, RecordProperties>;
/**
* dateAdded: The date and time when the record was added, in ISO 8601 format.
* @type {string}
* @example '2024-07-11T10:00:00Z'
*/
dateAdded: string;
/**
* dateUpdated: The date and time when the record was last updated, in ISO 8601 format.
* @type {string}
* @example '2024-07-11T10:00:00Z'
*/
dateUpdated: string;
};
/**
* SearchResponse: The structure of the search result for records.
*
* @memberof Objects.Records
* @example
* ```ts
* const response: Objects.Records.SearchResponse = {
* records: [
* {
* id: '1234567890abcdef',
* objectId: 'abcdef1234567890',
* locationId: '502goXVW3lIExEQPOnd3',
* owner: ['1a2b3c4d5e6f7g8h9i0j'],
* followers: ['BqTwX8QFwXzpegMve9EQ', '9NkT25Vor1v4aQatFsv2'],
* properties: {
* "customer_number": 1424, // Number Field
* "ticket_name": "Customer not able login", // Single Line, Multi Line field
* "phone_number": "+917000000000", // Phone Field
* "money": { // Currency Field
* "currency": "default", // Only "default" supported today (Location's currency).
* "value": 100 // Support for more currencies coming soon!!!
* },
* "type_of_ticket": "option_1_internal_key", // Dropdown Single Select Field Or Radio Field
* "section_of_app": ["contacts", "smartlist"], // Dropdown Multiple Select Field and Checkbox Field
* "recieved_on": "2024-07-11", // Date Picker Field
* "my_files": [ // Files type Field
* {
* "url": "---url_of_file---"
* }
* ],
* // For Text Box List options:
* "my_textbox_list_key.label_1_key": "Value 1",
* "my_textbox_list_key.label_2_key": "Value 2"
* },
* dateAdded: '2024-07-11T10:00:00Z',
* dateUpdated: '2024-07-11T10:00:00Z'
* };
* ];
* ```
*
* @property {RecordDTO[]} records - An array of records that match the search criteria.
* @example
* ```ts
* records: [
* {
* id: '1234567890abcdef',
* objectId: 'abcdef1234567890',
* locationId: '502goXVW3lIExEQPOnd3',
* owner: ['1a2b3c4d5e6f7g8h9i0j'],
* followers: ['BqTwX8QFwXzpegMve9EQ', '9NkT25Vor1v4aQatFsv2'],
* properties: {
* "customer_number": 1424, // Number Field
* "ticket_name": "Customer not able login", // Single Line, Multi Line field
* "phone_number": "+917000000000", // Phone Field
* "money": { // Currency Field
* "currency": "default", // Only "default" supported today (Location's currency).
* "value": 100 // Support for more currencies coming soon!!!
* },
* "type_of_ticket": "option_1_internal_key", // Dropdown Single Select Field Or Radio Field
* "section_of_app": ["contacts", "smartlist"], // Dropdown Multiple Select Field and Checkbox Field
* "recieved_on": "2024-07-11", // Date Picker Field
* "my_files": [ // Files type Field
* {
* "url": "---url_of_file---"
* }
* ],
* // For Text Box List options:
* "my_textbox_list_key.label_1_key": "Value 1",
* "my_textbox_list_key.label_2_key": "Value 2"
* },
* dateAdded: '2024-07-11T10:00:00Z',
* dateUpdated: '2024-07-11T10:00:00Z'
* };
* ];
* ```
*/
export type SearchResponse = {
records: RecordDTO[];
};
/**
* GetResponse: The structure of the response when retrieving a record.
* @memberof Objects.Records
* @example
* ```ts
* const response: Objects.Records.GetResponse = {
* record: {
* id: '1234567890abcdef',
* objectId: 'abcdef1234567890',
* locationId: '502goXVW3lIExEQPOnd3',
* owner: ['1a2b3c4d5e6f7g8h9i0j'],
* followers: ['BqTwX8QFwXzpegMve9EQ', '9NkT25Vor1v4aQatFsv2'],
* properties: {
* "customer_number": 1424, // Number Field
* "ticket_name": "Customer not able login", // Single Line, Multi Line field
* "phone_number": "+917000000000", // Phone Field
* "money": { // Currency Field
* "currency": "default", // Only "default" supported today (Location's currency).
* "value": 100 // Support for more currencies coming soon!!!
* },
* "type_of_ticket": "option_1_internal_key", // Dropdown Single Select Field Or Radio Field
* "section_of_app": ["contacts", "smartlist"], // Dropdown Multiple Select Field and Checkbox Field
* "recieved_on": "2024-07-11", // Date Picker Field
* "my_files": [ // Files type Field
* {
* "url": "---url_of_file---"
* }
* ],
* // For Text Box List options:
* "my_textbox_list_key.label_1_key": "Value 1",
* "my_textbox_list_key.label_2_key": "Value 2"
* },
* dateAdded: '2024-07-11T10:00:00Z',
* dateUpdated: '2024-07-11T10:00:00Z'
* };
* };
* ```
*
* @property {RecordDTO} record - The record that was retrieved.
* @example
* ```ts
* record: {
* id: '1234567890abcdef',
* objectId: 'abcdef1234567890',
* locationId: '502goXVW3lIExEQPOnd3',
* owner: ['1a2b3c4d5e6f7g8h9i0j'],
* followers: ['BqTwX8QFwXzpegMve9EQ', '9NkT25Vor1v4aQatFsv2'],
* properties: {
* "customer_number": 1424, // Number Field
* "ticket_name": "Customer not able login", // Single Line, Multi Line field
* "phone_number": "+917000000000", // Phone Field
* "money": { // Currency Field
* "currency": "default", // Only "default" supported today (Location's currency).
* "value": 100 // Support for more currencies coming soon!!!
* },
* "type_of_ticket": "option_1_internal_key", // Dropdown Single Select Field Or Radio Field
* "section_of_app": ["contacts", "smartlist"], // Dropdown Multiple Select Field and Checkbox Field
* "recieved_on": "2024-07-11", // Date Picker Field
* "my_files": [ // Files type Field
* {
* "url": "---url_of_file---"
* }
* ],
* // For Text Box List options:
* "my_textbox_list_key.label_1_key": "Value 1",
* "my_textbox_list_key.label_2_key": "Value 2"
* },
* dateAdded: '2024-07-11T10:00:00Z',
* dateUpdated: '2024-07-11T10:00:00Z'
* };
* ```
*/
export type GetResponse = {
/**
* record: The record that was retrieved.
* @type {RecordDTO}
* @example
* ```ts
* record: {
* id: '1234567890abcdef',
* objectId: 'abcdef1234567890',
* locationId: '502goXVW3lIExEQPOnd3',
* owner: ['1a2b3c4d5e6f7g8h9i0j'],
* followers: ['BqTwX8QFwXzpegMve9EQ', '9NkT25Vor1v4aQatFsv2'],
* properties: {
* "customer_number": 1424, // Number Field
* "ticket_name": "Customer not able login", // Single Line, Multi Line field
* "phone_number": "+917000000000", // Phone Field
* "money": { // Currency Field
* "currency": "default", // Only "default" supported today (Location's currency).
* "value": 100 // Support for more currencies coming soon!!!
* },
* "type_of_ticket": "option_1_internal_key", // Dropdown Single Select Field Or Radio Field
* "section_of_app": ["contacts", "smartlist"], // Dropdown Multiple Select Field and Checkbox Field
* "recieved_on": "2024-07-11", // Date Picker Field
* "my_files": [ // Files type Field
* {
* "url": "---url_of_file---"
* }
* ],
* // For Text Box List options:
* "my_textbox_list_key.label_1_key": "Value 1",
* "my_textbox_list_key.label_2_key": "Value 2"
* },
* dateAdded: '2024-07-11T10:00:00Z',
* dateUpdated: '2024-07-11T10:00:00Z'
* };
* ```
*/
record: RecordDTO;
};
/**
* CreateResponse: The structure of the response when retrieving a record.
* @memberof Objects.Records
* @example
* ```ts
* const response: Objects.Records.CreateResponse = {
* record: {
* id: '1234567890abcdef',
* objectId: 'abcdef1234567890',
* locationId: '502goXVW3lIExEQPOnd3',
* owner: ['1a2b3c4d5e6f7g8h9i0j'],
* followers: ['BqTwX8QFwXzpegMve9EQ', '9NkT25Vor1v4aQatFsv2'],
* properties: {
* "customer_number": 1424, // Number Field
* "ticket_name": "Customer not able login", // Single Line, Multi Line field
* "phone_number": "+917000000000", // Phone Field
* "money": { // Currency Field
* "currency": "default", // Only "default" supported today (Location's currency).
* "value": 100 // Support for more currencies coming soon!!!
* },
* "type_of_ticket": "option_1_internal_key", // Dropdown Single Select Field Or Radio Field
* "section_of_app": ["contacts", "smartlist"], // Dropdown Multiple Select Field and Checkbox Field
* "recieved_on": "2024-07-11", // Date Picker Field
* "my_files": [ // Files type Field
* {
* "url": "---url_of_file---"
* }
* ],
* // For Text Box List options:
* "my_textbox_list_key.label_1_key": "Value 1",
* "my_textbox_list_key.label_2_key": "Value 2"
* },
* dateAdded: '2024-07-11T10:00:00Z',
* dateUpdated: '2024-07-11T10:00:00Z'
* };
* };
* ```
*
* @property {RecordDTO} record - The record that was retrieved.
* @example
* ```ts
* record: {
* id: '1234567890abcdef',
* objectId: 'abcdef1234567890',
* locationId: '502goXVW3lIExEQPOnd3',
* owner: ['1a2b3c4d5e6f7g8h9i0j'],
* followers: ['BqTwX8QFwXzpegMve9EQ', '9NkT25Vor1v4aQatFsv2'],
* properties: {
* "customer_number": 1424, // Number Field
* "ticket_name": "Customer not able login", // Single Line, Multi Line field
* "phone_number": "+917000000000", // Phone Field
* "money": { // Currency Field
* "currency": "default", // Only "default" supported today (Location's currency).
* "value": 100 // Support for more currencies coming soon!!!
* },
* "type_of_ticket": "option_1_internal_key", // Dropdown Single Select Field Or Radio Field
* "section_of_app": ["contacts", "smartlist"], // Dropdown Multiple Select Field and Checkbox Field
* "recieved_on": "2024-07-11", // Date Picker Field
* "my_files": [ // Files type Field
* {
* "url": "---url_of_file---"
* }
* ],
* // For Text Box List options:
* "my_textbox_list_key.label_1_key": "Value 1",
* "my_textbox_list_key.label_2_key": "Value 2"
* },
* dateAdded: '2024-07-11T10:00:00Z',
* dateUpdated: '2024-07-11T10:00:00Z'
* };
* ```
*/
export type CreateResponse = GetResponse;
/**
* UpdateResponse: The structure of the response when retrieving a record.
* @memberof Objects.Records
* @example
* ```ts
* const response: Objects.Records.UpdateResponse = {
* record: {
* id: '1234567890abcdef',
* objectId: 'abcdef1234567890',
* locationId: '502goXVW3lIExEQPOnd3',
* owner: ['1a2b3c4d5e6f7g8h9i0j'],
* followers: ['BqTwX8QFwXzpegMve9EQ', '9NkT25Vor1v4aQatFsv2'],
* properties: {
* "customer_number": 1424, // Number Field
* "ticket_name": "Customer not able login", // Single Line, Multi Line field
* "phone_number": "+917000000000", // Phone Field
* "money": { // Currency Field
* "currency": "default", // Only "default" supported today (Location's currency).
* "value": 100 // Support for more currencies coming soon!!!
* },
* "type_of_ticket": "option_1_internal_key", // Dropdown Single Select Field Or Radio Field
* "section_of_app": ["contacts", "smartlist"], // Dropdown Multiple Select Field and Checkbox Field
* "recieved_on": "2024-07-11", // Date Picker Field
* "my_files": [ // Files type Field
* {
* "url": "---url_of_file---"
* }
* ],
* // For Text Box List options:
* "my_textbox_list_key.label_1_key": "Value 1",
* "my_textbox_list_key.label_2_key": "Value 2"
* },
* dateAdded: '2024-07-11T10:00:00Z',
* dateUpdated: '2024-07-11T10:00:00Z'
* };
* };
* ```
*
* @property {RecordDTO} record - The record that was retrieved.
* @example
* ```ts
* record: {
* id: '1234567890abcdef',
* objectId: 'abcdef1234567890',
* locationId: '502goXVW3lIExEQPOnd3',
* owner: ['1a2b3c4d5e6f7g8h9i0j'],
* followers: ['BqTwX8QFwXzpegMve9EQ', '9NkT25Vor1v4aQatFsv2'],
* properties: {
* "customer_number": 1424, // Number Field
* "ticket_name": "Customer not able login", // Single Line, Multi Line field
* "phone_number": "+917000000000", // Phone Field
* "money": { // Currency Field
* "currency": "default", // Only "default" supported today (Location's currency).
* "value": 100 // Support for more currencies coming soon!!!
* },
* "type_of_ticket": "option_1_internal_key", // Dropdown Single Select Field Or Radio Field
* "section_of_app": ["contacts", "smartlist"], // Dropdown Multiple Select Field and Checkbox Field
* "recieved_on": "2024-07-11", // Date Picker Field
* "my_files": [ // Files type Field
* {
* "url": "---url_of_file---"
* }
* ],
* // For Text Box List options:
* "my_textbox_list_key.label_1_key": "Value 1",
* "my_textbox_list_key.label_2_key": "Value 2"
* },
* dateAdded: '2024-07-11T10:00:00Z',
* dateUpdated: '2024-07-11T10:00:00Z'
* };
* ```
*/
export type UpdateResponse = GetResponse;
/**
* DeleteResponse: The structure of the response when deleting a record.
*
* @memberof Objects.Records
* @example
* ```ts
* const response: Objects.Records.DeleteResponse = {
* id: '1234567890abcdef',
* success: true,
* };
* ```
*
* @property {boolean} success - Indicates whether the deletion was successful.
* @example true
*
* @property {string} id - The ID of the record that was deleted.
* @example '1234567890abcdef'
*/
export type DeleteResponse = SuccessDeleteDTO & {
/**
* id: The ID of the record that was deleted.
* @type {string}
* @example '1234567890abcdef'
*/
id: string;
};
}
/**
* An Association represents a connection between two records in the system.
* It is used to establish a meaningful link between different entities such as contacts and custom objects.
* The purpose of an association is to categorize how two objects are related to each other and to provide labels that define their relationship.
*/
export namespace Associations {
/**
* A Relation specifies how two associated records are conceptually linked.
* Unlike an association, which simply establishes a connection, a relation defines the meaning behind the connection.
*/
export namespace Relations {
/**
* GetQueryObject: The structure of the response when retrieving relations for a specific record.
*
* @memberof Objects.Associations.Relations
* @requires locationId: The ID of the location where the relations are stored.
* @requires limit: The maximum number of relations to retrieve.
* @requires skip: The number of relations to skip before starting to collect the result set.
*
* @example
* ```ts
* const params: Objects.Associations.Relations.GetParams = {
* recordId: '632c34b4c9b7da3358ac9891',
* locationId: '502goXVW3lIExEQPOnd3',
* limit: "100",
* skip: "0"
* };
* ```
*
* @property {string} locationId - The ID of the location where the relation is stored.
* @example '502goXVW3lIExEQPOnd3'
*
* @property {string} limit - The maximum number of relations to retrieve.
* @example "100"
*
* @property {string} skip - The number of relations to skip before starting to collect the result set.
* @example "0"
*
* @property {string[]} [associationIds] - An optional array of association IDs to filter the relations.
* @example ['assoc1', 'assoc2']
*/
export type GetQueryObject = {
/**
* locationId: The ID of the location where the relation is stored.
*
* @type {string}
* @example '502goXVW3lIExEQPOnd3'
*/
locationId: string;
/**
* limit: The maximum number of relations to retrieve.
*
* @type {string}
* @example "100"
*/
limit: string;
/**
* skip: The number of relations to skip before starting to collect the result set.
*
* @type {string}
* @example "0"
*/
skip: string;
/**
* associationIds: An optional array of association IDs to filter the relations.
*
* @type {string[]}
* @example ['assoc1', 'assoc2']
*/
associationIds?: string[];
};
/**
* GetParams: The structure of the response when retrieving relations for a specific record.
*
* @memberof Objects.Associations.Relations
* @requires recordId: The ID of the record for which relations are being retrieved.
* @requires locationId: The ID of the location where the relations are stored.
* @requires limit: The maximum number of relations to retrieve.
* @requires skip: The number of relations to skip before starting to collect the result set.
*
* @example
* ```ts
* const params: Objects.Associations.Relations.GetParams = {
* recordId: '632c34b4c9b7da3358ac9891',
* locationId: '502goXVW3lIExEQPOnd3',
* limit: "100",
* skip: "0"
* };
* ```
*
* @property {string} recordId - The ID of the record for which relations are being retrieved.
* @example '632c34b4c9b7da3358ac9891'
*
* @property {string} locationId - The ID of the location where the relation is stored.
* @example '502goXVW3lIExEQPOnd3'
*
* @property {string} limit - The maximum number of relations to retrieve.
* @example "100"
*
* @property {string} skip - The number of relations to skip before starting to collect the result set.
* @example "0"
*
* @property {string[]} [associationIds] - An optional array of association IDs to filter the relations.
* @example ['assoc1', 'assoc2']
*/
export type GetParams = GetQueryObject & {
/**
* recordId: The ID of the record for which relations are being retrieved.
*
* @type {string}
* @example '632c34b4c9b7da3358ac9891'
*/
recordId: string;
};
/**
* CreateBody: The structure of the request body when creating a relation.
*
* @memberof Objects.Associations.Relations
* @requires recordId: The ID of the record for which the relation is being created.
* @requires locationId: The ID of the location where the relation is stored.
* @requires associationId: The ID of the association to which the relation belongs.
* @requires firstRecordId: The ID of the first record in the relation.
* @requires secondRecordId: The ID of the second record in the relation.
*
* @example
* ```ts
* const body: Objects.Associations.Relations.CreateBody = {
* recordId: '632c34b4c9b7da3358ac9891',
* locationId: '502goXVW3lIExEQPOnd3',
* associationId: '1234567890abcdef',
* firstRecordId: 'abcdef1234567890',
* secondRecordId: 'fedcba0987654321'
* };
* ```
*
* @property {string} recordId - The ID of the record for which the relation is being created.
* @example '632c34b4c9b7da3358ac9891'
*
* @property {string} locationId - The ID of the location where the relation is stored.
* @example '502goXVW3lIExEQPOnd3'
*
* @property {string} associationId - The ID of the association to which the relation belongs.
* @example '1234567890abcdef'
*
* @property {string} firstRecordId - The ID of the first record in the relation.
* @example 'abcdef1234567890'
*
* @property {string} secondRecordId - The ID of the second record in the relation.
* @example 'fedcba0987654321'
*/
export type CreateBody = {
/**
* recordId: The ID of the record for which the relation is being created.
*
* @type {string}
* @example '632c34b4c9b7da3358ac9891'
*/
recordId: string;
/**
* locationId: The ID of the location where the relation is stored.
*
* @type {string}
* @example '502goXVW3lIExEQPOnd3'
*/
locationId: string;
/**
* associationId: The ID of the association to which the relation belongs.
*
* @type {string}
* @example '1234567890abcdef'
*/
associationId: string;
/**
* firstRecordId: The ID of the first record in the relation.
*
* @type {string}
* @example 'abcdef1234567890'
*/
firstRecordId: string;
/**
* secondRecordId: The ID of the second record in the relation.
*
* @type {string}
* @example 'fedcba0987654321'
*/
secondRecordId: string;
};
/**
* DeleteParams: The structure of the parameters when deleting a relation.
*
* @memberof Objects.Associations.Relations
* @requires relationId: The ID of the relation to be deleted.
* @requires locationId: The ID of the location where the relation is stored.
*
* @example
* ```ts
* const params: Objects.Associations.Relations.DeleteParams = {
* relationId: '1234567890abcdef',
* locationId: '502goXVW3lIExEQPOnd3'
* };
* ```
*
* @property {string} relationId - The ID of the relation to be deleted.
* @example '1234567890abcdef'
*
* @property {string} locationId - The ID of the location where the relation is stored.
* @example '502goXVW3lIExEQPOnd3'
*/
export type DeleteParams = {
/**
* relationId: The ID of the relation to be deleted.
*
* @type {string}
* @example '1234567890abcdef'
*/
relationId: string;
/**
* locationId: The ID of the location where the relation is stored.
*
* @type {string}
* @example '502goXVW3lIExEQPOnd3'
*/
locationId: string;
};
/**
* RelationDTO: The structure of a relation data type object (DTO).
*
* @memberof Objects.Associations.Relations
* @requires id: The unique identifier of the relation.
* @requires firstObjectKey: The internal key of the first object in the relation.
* @requires firstReco