diff --git a/flows.yaml b/flows.yaml index f65aee5d..fb9535dc 100644 --- a/flows.yaml +++ b/flows.yaml @@ -3764,13 +3764,14 @@ integrations: actions: fetch-fields: description: > - Fetch available task fields. If the input is not specified then it - defaults back to "Task" + Fetch available task fields, child relationships and validation rules. + If the input is not specified then it defaults back to "Task" Data Validation: Parses all incoming data with Zod. Does not fail on parsing error will instead log parse error and return result. scopes: offline_access,api input: SalesforceEntity + version: 1.0.0 output: SalesforceFieldSchema endpoint: GET /salesforce/fetch-fields syncs: @@ -3778,28 +3779,33 @@ integrations: runs: every hour description: | Fetches a list of accounts from salesforce - output: SalesforceAccount + output: Account sync_type: incremental + version: 1.0.0 endpoint: GET /salesforce/accounts contacts: runs: every hour description: | Fetches a list of contacts from salesforce - output: SalesforceContact + output: Contact sync_type: incremental + version: 1.0.0 endpoint: GET /salesforce/contacts deals: runs: every hour description: | Fetches a list of deals from salesforce - output: SalesforceDeal + output: Deal sync_type: incremental + version: 1.0.0 endpoint: GET /salesforce/deals articles: runs: every day description: | Fetches a list of articles from salesforce - output: SalesforceArticle + output: Article + input: SalesforceMetadata + version: 1.0.0 auto_start: false sync_type: incremental endpoint: GET /salesforce/articles @@ -3807,66 +3813,69 @@ integrations: runs: every day description: | Fetches a list of tickets from salesforce - output: SalesforceTicket + output: Ticket sync_type: incremental + version: 1.0.0 endpoint: GET /salesforce/tickets models: - SalesforceAccount: + Account: id: string name: string - website: string - description: string - no_employees: number + website: string | null + description: string | null + no_employees: number | null last_modified_date: string - SalesforceContact: + Contact: id: string - first_name: string + first_name: string | null last_name: string - email: string - account_id: string + email: string | null + account_id: string | null last_modified_date: string - SalesforceDeal: + Deal: id: string name: string - amount: number + amount: number | null stage: string account_id: string last_modified_date: string - SalesforceArticle: + Article: id: string title: string content: string last_modified_date: string - SalesforceTicket: + Ticket: id: string case_number: string subject: string | null - account_id: string + account_id: string | null account_name: string | null - contact_id: string + contact_id: string | null contact_name: string | null owner_id: string owner_name: string | null priority: string status: string description: string | null - type: string + type: string | null created_date: string - closed_date: string - origin: string + closed_date: string | null + origin: string | null is_closed: boolean is_escalated: boolean - conversation: - id: string - body: string - created_date: string - created_by: string + conversation: Conversation[] last_modified_date: string + Conversation: + id: string + body: string + created_date: string + created_by: string SalesforceEntity: name: string SalesforceFieldSchema: fields: Field[] childRelationships: ChildField[] + validationRules: ValidationRule[] NestedFieldSchema: fields: Field[] Field: @@ -3887,6 +3896,13 @@ integrations: method: string url: string code: string + SalesforceMetadata: + customFields: string[] + ValidationRule: + id: string + name: string + errorConditionFormula: string + errorMessage: string sharepoint-online: actions: list-sites: diff --git a/integrations/calendly/mocks/nango/get/proxy/event_types.json b/integrations/calendly/mocks/nango/get/proxy/event_types/event-types.json similarity index 100% rename from integrations/calendly/mocks/nango/get/proxy/event_types.json rename to integrations/calendly/mocks/nango/get/proxy/event_types/event-types.json diff --git a/integrations/calendly/mocks/nango/get/proxy/scheduled_events/05559332-7490-4e69-807c-f0373703a08d/invitees.json b/integrations/calendly/mocks/nango/get/proxy/scheduled_events/05559332-7490-4e69-807c-f0373703a08d/invitees/event-invitees.json similarity index 100% rename from integrations/calendly/mocks/nango/get/proxy/scheduled_events/05559332-7490-4e69-807c-f0373703a08d/invitees.json rename to integrations/calendly/mocks/nango/get/proxy/scheduled_events/05559332-7490-4e69-807c-f0373703a08d/invitees/event-invitees.json diff --git a/integrations/calendly/mocks/nango/get/proxy/scheduled_events/0aafdb96-9a9d-46bb-b667-72e0d38c6d1f/invitees.json b/integrations/calendly/mocks/nango/get/proxy/scheduled_events/0aafdb96-9a9d-46bb-b667-72e0d38c6d1f/invitees/event-invitees.json similarity index 100% rename from integrations/calendly/mocks/nango/get/proxy/scheduled_events/0aafdb96-9a9d-46bb-b667-72e0d38c6d1f/invitees.json rename to integrations/calendly/mocks/nango/get/proxy/scheduled_events/0aafdb96-9a9d-46bb-b667-72e0d38c6d1f/invitees/event-invitees.json diff --git a/integrations/calendly/mocks/nango/get/proxy/scheduled_events/29413570-8d98-4001-a340-38abdd2a5d39/invitees.json b/integrations/calendly/mocks/nango/get/proxy/scheduled_events/29413570-8d98-4001-a340-38abdd2a5d39/invitees/event-invitees.json similarity index 100% rename from integrations/calendly/mocks/nango/get/proxy/scheduled_events/29413570-8d98-4001-a340-38abdd2a5d39/invitees.json rename to integrations/calendly/mocks/nango/get/proxy/scheduled_events/29413570-8d98-4001-a340-38abdd2a5d39/invitees/event-invitees.json diff --git a/integrations/calendly/mocks/nango/get/proxy/scheduled_events/74f1d379-72e8-40fb-a790-3620a56ce275/invitees.json b/integrations/calendly/mocks/nango/get/proxy/scheduled_events/74f1d379-72e8-40fb-a790-3620a56ce275/invitees/event-invitees.json similarity index 100% rename from integrations/calendly/mocks/nango/get/proxy/scheduled_events/74f1d379-72e8-40fb-a790-3620a56ce275/invitees.json rename to integrations/calendly/mocks/nango/get/proxy/scheduled_events/74f1d379-72e8-40fb-a790-3620a56ce275/invitees/event-invitees.json diff --git a/integrations/calendly/mocks/nango/get/proxy/scheduled_events/7ab23fe1-3047-4a16-9325-93a19e73cb42/invitees.json b/integrations/calendly/mocks/nango/get/proxy/scheduled_events/7ab23fe1-3047-4a16-9325-93a19e73cb42/invitees/event-invitees.json similarity index 100% rename from integrations/calendly/mocks/nango/get/proxy/scheduled_events/7ab23fe1-3047-4a16-9325-93a19e73cb42/invitees.json rename to integrations/calendly/mocks/nango/get/proxy/scheduled_events/7ab23fe1-3047-4a16-9325-93a19e73cb42/invitees/event-invitees.json diff --git a/integrations/calendly/mocks/nango/get/proxy/scheduled_events/c51384f5-3327-48b9-9859-0ede73c260db/invitees.json b/integrations/calendly/mocks/nango/get/proxy/scheduled_events/c51384f5-3327-48b9-9859-0ede73c260db/invitees/event-invitees.json similarity index 100% rename from integrations/calendly/mocks/nango/get/proxy/scheduled_events/c51384f5-3327-48b9-9859-0ede73c260db/invitees.json rename to integrations/calendly/mocks/nango/get/proxy/scheduled_events/c51384f5-3327-48b9-9859-0ede73c260db/invitees/event-invitees.json diff --git a/integrations/calendly/mocks/nango/get/proxy/scheduled_events.json b/integrations/calendly/mocks/nango/get/proxy/scheduled_events/event-invitees.json similarity index 100% rename from integrations/calendly/mocks/nango/get/proxy/scheduled_events.json rename to integrations/calendly/mocks/nango/get/proxy/scheduled_events/event-invitees.json diff --git a/integrations/calendly/mocks/nango/get/proxy/scheduled_events/events.json b/integrations/calendly/mocks/nango/get/proxy/scheduled_events/events.json new file mode 100644 index 00000000..78817d6f --- /dev/null +++ b/integrations/calendly/mocks/nango/get/proxy/scheduled_events/events.json @@ -0,0 +1,243 @@ +{ + "collection": [ + { + "calendar_event": { + "external_id": "ubq3hdhf4o13b6npm01vt3nd58", + "kind": "google" + }, + "created_at": "2023-05-23T19:44:04.692300Z", + "end_time": "2023-05-25T18:30:00.000000Z", + "event_guests": [], + "event_memberships": [ + { + "buffered_end_time": "2023-05-25T18:30:00.000000Z", + "buffered_start_time": "2023-05-25T18:00:00.000000Z", + "user": "https://api.calendly.com/users/111", + "user_email": "myname@nango.dev", + "user_name": "MockName LastName" + } + ], + "event_type": "https://api.calendly.com/event_types/707093d8-ed80-463b-b341-ee56cc339c75", + "invitees_counter": { + "active": 1, + "limit": 1, + "total": 1 + }, + "location": { + "join_url": "https://calendly.com/events/0aafdb96-9a9d-46bb-b667-72e0d38c6d1f/google_meet", + "status": "pushed", + "type": "google_conference" + }, + "meeting_notes_html": null, + "meeting_notes_plain": null, + "name": "30 Minute Meeting", + "start_time": "2023-05-25T18:00:00.000000Z", + "status": "active", + "updated_at": "2023-05-23T19:44:05.964741Z", + "uri": "https://api.calendly.com/scheduled_events/0aafdb96-9a9d-46bb-b667-72e0d38c6d1f" + }, + { + "calendar_event": { + "external_id": "46fbbct95c26r6bd31hcl22g74", + "kind": "google" + }, + "cancellation": { + "canceled_by": "MockName LastName", + "canceler_type": "host", + "created_at": "2023-06-01T17:42:02.351705Z", + "reason": null + }, + "created_at": "2023-05-31T17:22:51.361772Z", + "end_time": "2023-06-01T18:30:00.000000Z", + "event_guests": [], + "event_memberships": [ + { + "buffered_end_time": "2023-06-01T18:30:00.000000Z", + "buffered_start_time": "2023-06-01T18:00:00.000000Z", + "user": "https://api.calendly.com/users/111", + "user_email": "myname@nango.dev", + "user_name": "MockName LastName" + } + ], + "event_type": "https://api.calendly.com/event_types/707093d8-ed80-463b-b341-ee56cc339c75", + "invitees_counter": { + "active": 0, + "limit": 1, + "total": 1 + }, + "location": { + "join_url": "https://calendly.com/events/74f1d379-72e8-40fb-a790-3620a56ce275/google_meet", + "status": "pushed", + "type": "google_conference" + }, + "meeting_notes_html": null, + "meeting_notes_plain": null, + "name": "30 Minute Meeting", + "start_time": "2023-06-01T18:00:00.000000Z", + "status": "canceled", + "updated_at": "2023-06-01T17:42:03.360731Z", + "uri": "https://api.calendly.com/scheduled_events/74f1d379-72e8-40fb-a790-3620a56ce275" + }, + { + "calendar_event": { + "external_id": "n1la9g0vli7o26rcum22fuh33g", + "kind": "google" + }, + "created_at": "2023-06-09T18:20:00.862980Z", + "end_time": "2023-06-12T18:00:00.000000Z", + "event_guests": [], + "event_memberships": [ + { + "buffered_end_time": "2023-06-12T18:00:00.000000Z", + "buffered_start_time": "2023-06-12T17:30:00.000000Z", + "user": "https://api.calendly.com/users/111", + "user_email": "myname@nango.dev", + "user_name": "MockName LastName" + } + ], + "event_type": "https://api.calendly.com/event_types/707093d8-ed80-463b-b341-ee56cc339c75", + "invitees_counter": { + "active": 1, + "limit": 1, + "total": 1 + }, + "location": { + "join_url": "https://calendly.com/events/7ab23fe1-3047-4a16-9325-93a19e73cb42/google_meet", + "status": "pushed", + "type": "google_conference" + }, + "meeting_notes_html": null, + "meeting_notes_plain": null, + "name": "30 Minute Meeting", + "start_time": "2023-06-12T17:30:00.000000Z", + "status": "active", + "updated_at": "2023-06-09T18:20:02.249423Z", + "uri": "https://api.calendly.com/scheduled_events/7ab23fe1-3047-4a16-9325-93a19e73cb42" + }, + { + "calendar_event": { + "external_id": "gh4l0r650bqsamfo31qtqr7vl0", + "kind": "google" + }, + "cancellation": { + "canceled_by": "Ben Fake", + "canceler_type": "invitee", + "created_at": "2023-07-21T16:47:30.220527Z", + "reason": "A team member is not available on tuesday. " + }, + "created_at": "2023-07-21T16:37:03.581120Z", + "end_time": "2023-07-25T11:30:00.000000Z", + "event_guests": [], + "event_memberships": [ + { + "buffered_end_time": "2023-07-25T11:30:00.000000Z", + "buffered_start_time": "2023-07-25T11:00:00.000000Z", + "user": "https://api.calendly.com/users/111", + "user_email": "myname@nango.dev", + "user_name": "MockName LastName" + } + ], + "event_type": "https://api.calendly.com/event_types/707093d8-ed80-463b-b341-ee56cc339c75", + "invitees_counter": { + "active": 0, + "limit": 1, + "total": 1 + }, + "location": { + "join_url": "https://calendly.com/events/05559332-7490-4e69-807c-f0373703a08d/google_meet", + "status": "pushed", + "type": "google_conference" + }, + "meeting_notes_html": null, + "meeting_notes_plain": null, + "name": "30 Minute Meeting", + "start_time": "2023-07-25T11:00:00.000000Z", + "status": "canceled", + "updated_at": "2023-07-21T16:47:30.249298Z", + "uri": "https://api.calendly.com/scheduled_events/05559332-7490-4e69-807c-f0373703a08d" + }, + { + "calendar_event": { + "external_id": "gh4l0r650bqsamfo31qtqr7vl0", + "kind": "google" + }, + "created_at": "2023-07-21T16:47:30.268433Z", + "end_time": "2023-07-27T12:00:00.000000Z", + "event_guests": [ + { + "created_at": "2023-07-21T16:37:03.664257Z", + "email": "foo@gmail.com", + "updated_at": "2023-07-21T16:47:30.382496Z" + }, + { + "created_at": "2023-07-21T16:37:03.661876Z", + "email": "goo@gmail.com", + "updated_at": "2023-07-21T16:47:30.377146Z" + } + ], + "event_memberships": [ + { + "buffered_end_time": "2023-07-27T12:00:00.000000Z", + "buffered_start_time": "2023-07-27T11:30:00.000000Z", + "user": "https://api.calendly.com/users/111", + "user_email": "myname@nango.dev", + "user_name": "MockName LastName" + } + ], + "event_type": "https://api.calendly.com/event_types/707093d8-ed80-463b-b341-ee56cc339c75", + "invitees_counter": { + "active": 1, + "limit": 1, + "total": 1 + }, + "location": { + "join_url": "https://calendly.com/events/c51384f5-3327-48b9-9859-0ede73c260db/google_meet", + "status": "pushed", + "type": "google_conference" + }, + "meeting_notes_html": null, + "meeting_notes_plain": null, + "name": "30 Minute Meeting", + "start_time": "2023-07-27T11:30:00.000000Z", + "status": "active", + "updated_at": "2023-07-21T16:47:32.670115Z", + "uri": "https://api.calendly.com/scheduled_events/c51384f5-3327-48b9-9859-0ede73c260db" + }, + { + "calendar_event": { + "external_id": "5bon88uitburikb91nd2i4lkto", + "kind": "google" + }, + "created_at": "2023-07-28T17:29:45.938468Z", + "end_time": "2023-08-03T18:00:00.000000Z", + "event_guests": [], + "event_memberships": [ + { + "buffered_end_time": "2023-08-03T18:00:00.000000Z", + "buffered_start_time": "2023-08-03T17:30:00.000000Z", + "user": "https://api.calendly.com/users/111", + "user_email": "myname@nango.dev", + "user_name": "MockName LastName" + } + ], + "event_type": "https://api.calendly.com/event_types/707093d8-ed80-463b-b341-ee56cc339c75", + "invitees_counter": { + "active": 1, + "limit": 1, + "total": 1 + }, + "location": { + "join_url": "https://calendly.com/events/29413570-8d98-4001-a340-38abdd2a5d39/google_meet", + "status": "pushed", + "type": "google_conference" + }, + "meeting_notes_html": null, + "meeting_notes_plain": null, + "name": "30 Minute Meeting", + "start_time": "2023-08-03T17:30:00.000000Z", + "status": "active", + "updated_at": "2023-07-28T17:29:48.203524Z", + "uri": "https://api.calendly.com/scheduled_events/29413570-8d98-4001-a340-38abdd2a5d39" + } + ] +} diff --git a/integrations/salesforce/actions/fetch-fields.ts b/integrations/salesforce/actions/fetch-fields.ts index bfd8bc94..7cef53f1 100644 --- a/integrations/salesforce/actions/fetch-fields.ts +++ b/integrations/salesforce/actions/fetch-fields.ts @@ -1,33 +1,61 @@ -import type { NangoAction, SalesforceFieldSchema, ProxyConfiguration, ActionResponseError, ChildField, Field, SalesforceEntity } from '../../models'; -import { fieldSchema, childFieldSchema } from '../schema.zod.js'; +import type { + NangoAction, + SalesforceFieldSchema, + ProxyConfiguration, + ActionResponseError, + ChildField, + Field, + SalesforceEntity, + ValidationRule +} from '../../models'; +import { fieldSchema, childFieldSchema, validationRuleSchema } from '../schema.zod.js'; +import type { DescribeSObjectResult, SalesForceField, ChildRelationship, ValidationRecord, ValidationRuleResponse } from '../types'; /** - * This action fetches the available objects for a given organization in Salesforce. + * This action retrieves the available properties of a custom object, including fields, child relationships, and validation rules, for a given organization in Salesforce. * https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_sobject_describe.htm - * @param nango - The NangoAction object - * @returns SalesforceFieldSchema - The fields for the object + * https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_validationrule.htm + * + * @param nango - The NangoAction instance used for making API requests. + * @param input - SalesforceEntity defining the object to describe + * @returns A promise that resolves to a SalesforceFieldSchema object containing: fields, child relationships, and validation rules for the object */ export default async function runAction(nango: NangoAction, input: SalesforceEntity): Promise { try { const entity = input?.name || 'Task'; - const proxyConfig: ProxyConfiguration = { + + const proxyConfigFields: ProxyConfiguration = { endpoint: `/services/data/v60.0/sobjects/${entity}/describe`, - retries: 5 + retries: 10 }; - const response = await nango.get(proxyConfig); + const proxyConfigValidationIds: ProxyConfiguration = { + endpoint: `/services/data/v60.0/tooling/query`, + retries: 10, + params: { + q: `SELECT Id, ValidationName FROM ValidationRule WHERE EntityDefinition.QualifiedApiName='${entity}'` + } + }; - const { data } = response; - const { fields, childRelationships } = data; + // Parallelize both requests as we won't get rate limited in here. + const [fieldsResponse, validationResponse] = await Promise.all([ + nango.get(proxyConfigFields), + nango.get(proxyConfigValidationIds) + ]); - const fieldResults = mapFields({ fields }); - const childRelationshipsResults = mapChildRelationships({ - relationships: childRelationships - }); + const { fields, childRelationships } = fieldsResponse.data; + const validationRulesIds = validationResponse.data.records; + + const validationRulesData: ValidationRecord[] = await fetchValidationRuleMetadata(nango, validationRulesIds); + + const fieldResults = mapFields(fields); + const childRelationshipsResults = mapChildRelationships(childRelationships); + const validationRulesResults = mapValidationRules(validationRulesData); return { fields: fieldResults, - childRelationships: childRelationshipsResults + childRelationships: childRelationshipsResults, + validationRules: validationRulesResults }; } catch (error: unknown) { const errorResponse = error as Record; @@ -45,44 +73,86 @@ export default async function runAction(nango: NangoAction, input: SalesforceEnt } /** - * Maps the fields from the Salesforce API response to the Field schema - * @param fields - The unverified data returned from the Salesforce API - * @param nango - The NangoAction object - * @returns The mapped fields and a boolean indicating if the mapping was successful + * Fetches metadata for multiple validation rules from the Salesforce Tooling API. + * Note: The maximum number of active validation rules per object is limited to 500, + * and this limit can vary based on the Salesforce edition. + * For more details, refer to the Salesforce documentation: + * https://help.salesforce.com/s/articleView?id=000383591&type=1 + * + * @param nango - The NangoAction instance used for making API requests. + * @param validationRulesIds - An array of objects containing the IDs and names of the validation rules. + * @returns A promise that resolves to an array of ValidationRecord objects with metadata for each validation rule. */ -function mapFields({ fields }: { fields: Field[] }): Field[] { - const validatedFields: Field[] = []; - for (const field of fields) { - const resultData = field; - const parsedField = fieldSchema.parse({ - name: resultData['name'], - label: resultData['label'], - type: resultData['type'], - referenceTo: resultData['referenceTo'], - relationshipName: resultData['relationshipName'] - }); +async function fetchValidationRuleMetadata(nango: NangoAction, validationRulesIds: { Id: string; ValidationName: string }[]): Promise { + const metadataFetchPromises: Promise[] = validationRulesIds.map((rule) => + nango + .get({ + endpoint: `/services/data/v60.0/tooling/query`, + retries: 10, + params: { + q: `SELECT Id, ValidationName, Metadata FROM ValidationRule WHERE Id='${rule.Id}'` + } + }) + .then((response: { data: ValidationRuleResponse }) => { + const record = response.data.records[0]; + if (record) { + return { ...record, ValidationName: rule.ValidationName }; + } + throw new nango.ActionError({ + message: `Validation rule with ID ${rule.Id} not found.` + }); + }) + ); - validatedFields.push(parsedField); - } + const settledResults = await Promise.allSettled(metadataFetchPromises); - return validatedFields; + return settledResults.filter((result) => result.status === 'fulfilled').map((result) => (result as PromiseFulfilledResult).value); } /** - * Maps the child relationships from the Salesforce API response to the ChildField schema - * @param relationships - The unverified data returned from the Salesforce API - * @returns The mapped child relationships and a boolean indicating if the mapping was successful + * Maps the fields from the Salesforce API response to the Field schema. + * @param fields - Array of fields from Salesforce + * @returns An array of mapped validation rules conforming to the Field schema. */ -function mapChildRelationships({ relationships }: { relationships: Record[] }): ChildField[] { - const validatedRelationships: ChildField[] = []; - for (const relationship of relationships) { - const resultData = relationship; - const parsedChildField = childFieldSchema.parse({ - object: resultData['childSObject'], - field: resultData['field'], - relationshipName: resultData['relationshipName'] - }); - validatedRelationships.push(parsedChildField); - } - return validatedRelationships; +function mapFields(fields: SalesForceField[]): Field[] { + return fields.map((field) => + fieldSchema.parse({ + name: field.name, + label: field.label, + type: field.type, + referenceTo: field.referenceTo, + relationshipName: field.relationshipName + }) + ); +} + +/** + * Maps child relationships from Salesforce API to the ChildField schema. + * @param relationships - Array of child relationships from Salesforce + * @returns An array of mapped child relationships conforming to the ChildField schema. + */ +function mapChildRelationships(relationships: ChildRelationship[]): ChildField[] { + return relationships.map((relationship) => + childFieldSchema.parse({ + object: relationship.childSObject, + field: relationship.field, + relationshipName: relationship.relationshipName + }) + ); +} + +/** + * Maps validation rules from Salesforce Tooling API response to the ValidationRule schema. + * @param validationRules - Array of validation rules from Salesforce Tooling API + * @returns An array of mapped validation rules conforming to the ValidationRule schema. + */ +function mapValidationRules(validationRules: ValidationRecord[]): ValidationRule[] { + return validationRules.map((rule) => + validationRuleSchema.parse({ + id: rule.Id, + name: rule.ValidationName, + errorConditionFormula: rule.Metadata.errorConditionFormula, + errorMessage: rule.Metadata.errorMessage + }) + ); } diff --git a/integrations/salesforce/mocks/accounts/batchDelete.json b/integrations/salesforce/mocks/accounts/batchDelete.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/integrations/salesforce/mocks/accounts/batchDelete.json @@ -0,0 +1 @@ +[] diff --git a/integrations/salesforce/mocks/accounts/batchSave.json b/integrations/salesforce/mocks/accounts/batchSave.json new file mode 100644 index 00000000..5794bf55 --- /dev/null +++ b/integrations/salesforce/mocks/accounts/batchSave.json @@ -0,0 +1,42 @@ +[ + { + "id": "001J9000006PvbyIAC", + "name": "Acme Corporation", + "website": "www.acme.com", + "description": null, + "no_employees": null, + "last_modified_date": "2024-09-27T10:54:17.000Z" + }, + { + "id": "001J9000006PvbzIAC", + "name": "Global Industries", + "website": "www.globalind.com", + "description": null, + "no_employees": null, + "last_modified_date": "2024-09-27T10:54:17.000Z" + }, + { + "id": "001J9000006Pvc0IAC", + "name": "Tech Solutions Inc.", + "website": "www.techsolutions.com", + "description": null, + "no_employees": null, + "last_modified_date": "2024-09-27T10:54:17.000Z" + }, + { + "id": "001J9000006Pvc1IAC", + "name": "Innovate LLC", + "website": "www.innovate.com", + "description": null, + "no_employees": null, + "last_modified_date": "2024-09-27T10:54:17.000Z" + }, + { + "id": "001J9000006Pvc2IAC", + "name": "Green Energy Co.", + "website": "www.greenenergy.com", + "description": null, + "no_employees": null, + "last_modified_date": "2024-09-27T10:54:17.000Z" + } +] diff --git a/integrations/salesforce/mocks/articles/batchDelete.json b/integrations/salesforce/mocks/articles/batchDelete.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/integrations/salesforce/mocks/articles/batchDelete.json @@ -0,0 +1 @@ +[] diff --git a/integrations/salesforce/mocks/articles/batchSave.json b/integrations/salesforce/mocks/articles/batchSave.json new file mode 100644 index 00000000..b5c63721 --- /dev/null +++ b/integrations/salesforce/mocks/articles/batchSave.json @@ -0,0 +1,8 @@ +[ + { + "id": "ka0J90000008QKLIA2", + "title": "Sample Knowledge Article", + "content": "Field: ValidationStatus\nPending", + "last_modified_date": "2024-09-20T11:42:50.000Z" + } +] diff --git a/integrations/salesforce/mocks/contacts/batchDelete.json b/integrations/salesforce/mocks/contacts/batchDelete.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/integrations/salesforce/mocks/contacts/batchDelete.json @@ -0,0 +1 @@ +[] diff --git a/integrations/salesforce/mocks/contacts/batchSave.json b/integrations/salesforce/mocks/contacts/batchSave.json new file mode 100644 index 00000000..5c3a9351 --- /dev/null +++ b/integrations/salesforce/mocks/contacts/batchSave.json @@ -0,0 +1,42 @@ +[ + { + "id": "003J9000004ogjXIAQ", + "first_name": "John", + "last_name": "Doe", + "email": "john.doe@example.com", + "account_id": null, + "last_modified_date": "2024-09-27T10:39:01.000Z" + }, + { + "id": "003J9000004ogjYIAQ", + "first_name": "Jane", + "last_name": "Smith", + "email": "jane.smith@example.com", + "account_id": null, + "last_modified_date": "2024-09-27T10:39:01.000Z" + }, + { + "id": "003J9000004ogjZIAQ", + "first_name": "Emily", + "last_name": "Johnson", + "email": "emily.johnson@example.com", + "account_id": null, + "last_modified_date": "2024-09-27T10:39:01.000Z" + }, + { + "id": "003J9000004ogjaIAA", + "first_name": "Michael", + "last_name": "Williams", + "email": "michael.williams@example.com", + "account_id": null, + "last_modified_date": "2024-09-27T10:39:01.000Z" + }, + { + "id": "003J9000004ogjbIAA", + "first_name": "Sarah", + "last_name": "Brown", + "email": "sarah.brown@example.com", + "account_id": null, + "last_modified_date": "2024-09-27T10:39:01.000Z" + } +] diff --git a/integrations/salesforce/mocks/deals/batchDelete.json b/integrations/salesforce/mocks/deals/batchDelete.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/integrations/salesforce/mocks/deals/batchDelete.json @@ -0,0 +1 @@ +[] diff --git a/integrations/salesforce/mocks/deals/batchSave.json b/integrations/salesforce/mocks/deals/batchSave.json new file mode 100644 index 00000000..17cc27c7 --- /dev/null +++ b/integrations/salesforce/mocks/deals/batchSave.json @@ -0,0 +1,50 @@ +[ + { + "id": "006J90000040Wd4IAE", + "name": "New Business", + "amount": 10000, + "stage": "Qualify", + "account_id": "001J9000006PvbyIAC", + "last_modified_date": "2024-09-27T15:05:36.000Z" + }, + { + "id": "006J90000040WeLIAU", + "name": "New Business", + "amount": 120000, + "stage": "Qualify", + "account_id": "001J9000006Pvc2IAC", + "last_modified_date": "2024-09-27T15:06:53.000Z" + }, + { + "id": "006J90000040WdcIAE", + "name": "New Business", + "amount": 13000, + "stage": "Closed Won", + "account_id": "001J9000006PvbyIAC", + "last_modified_date": "2024-09-27T15:06:14.000Z" + }, + { + "id": "006J90000040WddIAE", + "name": "StartUp", + "amount": null, + "stage": "Closed Lost", + "account_id": "001J9000006Pvc2IAC", + "last_modified_date": "2024-09-27T15:07:12.000Z" + }, + { + "id": "006J90000040WdNIAU", + "name": "New Business", + "amount": 13000, + "stage": "Propose", + "account_id": "001J9000006PvbyIAC", + "last_modified_date": "2024-09-27T15:05:55.000Z" + }, + { + "id": "006J90000040WdOIAU", + "name": "New Business", + "amount": 12000, + "stage": "Negotiate", + "account_id": "001J9000006PvbyIAC", + "last_modified_date": "2024-09-27T15:06:26.000Z" + } +] diff --git a/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/query.json b/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/query.json new file mode 100644 index 00000000..6a3e627f --- /dev/null +++ b/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/query.json @@ -0,0 +1,243 @@ +{ + "totalSize": 4, + "done": true, + "records": [ + { + "attributes": { + "type": "Case", + "url": "/services/data/v60.0/sobjects/Case/500J9000005duskIAA" + }, + "Id": "500J9000005duskIAA", + "CaseNumber": "00001004", + "Subject": null, + "AccountId": "001J9000006Pvc2IAC", + "Account": { + "attributes": { + "type": "Account", + "url": "/services/data/v60.0/sobjects/Account/001J9000006Pvc2IAC" + }, + "Name": "Green Energy Co." + }, + "ContactId": "003J9000004ogjZIAQ", + "Contact": { + "attributes": { + "type": "Contact", + "url": "/services/data/v60.0/sobjects/Contact/003J9000004ogjZIAQ" + }, + "Name": "Emily Johnson" + }, + "OwnerId": "005J9000000MUOuIAO", + "Owner": { + "attributes": { + "type": "Name", + "url": "/services/data/v60.0/sobjects/User/005J9000000MUOuIAO" + }, + "Name": "Hassan Wari" + }, + "Priority": "High", + "Status": "Waiting on Customer", + "Description": null, + "Type": null, + "CreatedDate": "2024-09-27T15:18:19.000+0000", + "ClosedDate": null, + "Origin": "Phone", + "IsClosed": false, + "IsEscalated": false, + "LastModifiedDate": "2024-09-27T15:18:19.000+0000", + "CaseComments": null + }, + { + "attributes": { + "type": "Case", + "url": "/services/data/v60.0/sobjects/Case/500J9000005dutsIAA" + }, + "Id": "500J9000005dutsIAA", + "CaseNumber": "00001006", + "Subject": null, + "AccountId": null, + "Account": null, + "ContactId": null, + "Contact": null, + "OwnerId": "005J9000000MUOuIAO", + "Owner": { + "attributes": { + "type": "Name", + "url": "/services/data/v60.0/sobjects/User/005J9000000MUOuIAO" + }, + "Name": "Hassan Wari" + }, + "Priority": "Low", + "Status": "Closed", + "Description": null, + "Type": null, + "CreatedDate": "2024-09-27T15:19:53.000+0000", + "ClosedDate": "2024-09-27T15:19:53.000+0000", + "Origin": "Web", + "IsClosed": true, + "IsEscalated": false, + "LastModifiedDate": "2024-09-27T15:19:53.000+0000", + "CaseComments": { + "totalSize": 5, + "done": true, + "records": [ + { + "attributes": { + "type": "CaseComment", + "url": "/services/data/v60.0/sobjects/CaseComment/00aJ9000000BQJHIA4" + }, + "Id": "00aJ9000000BQJHIA4", + "CommentBody": "Dummy test in here\r\n sample", + "CreatedDate": "2024-09-27T15:57:15.000+0000", + "CreatedBy": { + "attributes": { + "type": "Name", + "url": "/services/data/v60.0/sobjects/User/005J9000000MUOuIAO" + }, + "Name": "Hassan Wari" + } + }, + { + "attributes": { + "type": "CaseComment", + "url": "/services/data/v60.0/sobjects/CaseComment/00aJ9000000BQJ7IAO" + }, + "Id": "00aJ9000000BQJ7IAO", + "CommentBody": "Another test 3", + "CreatedDate": "2024-09-27T15:56:56.000+0000", + "CreatedBy": { + "attributes": { + "type": "Name", + "url": "/services/data/v60.0/sobjects/User/005J9000000MUOuIAO" + }, + "Name": "Hassan Wari" + } + }, + { + "attributes": { + "type": "CaseComment", + "url": "/services/data/v60.0/sobjects/CaseComment/00aJ9000000BQIYIA4" + }, + "Id": "00aJ9000000BQIYIA4", + "CommentBody": "Sample body", + "CreatedDate": "2024-09-27T15:23:50.000+0000", + "CreatedBy": { + "attributes": { + "type": "Name", + "url": "/services/data/v60.0/sobjects/User/005J9000000MUOuIAO" + }, + "Name": "Hassan Wari" + } + }, + { + "attributes": { + "type": "CaseComment", + "url": "/services/data/v60.0/sobjects/CaseComment/00aJ9000000BQJCIA4" + }, + "Id": "00aJ9000000BQJCIA4", + "CommentBody": "Test 4 another one", + "CreatedDate": "2024-09-27T15:57:04.000+0000", + "CreatedBy": { + "attributes": { + "type": "Name", + "url": "/services/data/v60.0/sobjects/User/005J9000000MUOuIAO" + }, + "Name": "Hassan Wari" + } + }, + { + "attributes": { + "type": "CaseComment", + "url": "/services/data/v60.0/sobjects/CaseComment/00aJ9000000BQJ2IAO" + }, + "Id": "00aJ9000000BQJ2IAO", + "CommentBody": "Another test 2", + "CreatedDate": "2024-09-27T15:56:47.000+0000", + "CreatedBy": { + "attributes": { + "type": "Name", + "url": "/services/data/v60.0/sobjects/User/005J9000000MUOuIAO" + }, + "Name": "Hassan Wari" + } + } + ] + } + }, + { + "attributes": { + "type": "Case", + "url": "/services/data/v60.0/sobjects/Case/500J9000005dusQIAQ" + }, + "Id": "500J9000005dusQIAQ", + "CaseNumber": "00001003", + "Subject": "Important Case to begin working on", + "AccountId": "001J9000006PvbyIAC", + "Account": { + "attributes": { + "type": "Account", + "url": "/services/data/v60.0/sobjects/Account/001J9000006PvbyIAC" + }, + "Name": "Acme Corporation" + }, + "ContactId": "003J9000004ogjXIAQ", + "Contact": { + "attributes": { + "type": "Contact", + "url": "/services/data/v60.0/sobjects/Contact/003J9000004ogjXIAQ" + }, + "Name": "John Doe" + }, + "OwnerId": "005J9000000MUOuIAO", + "Owner": { + "attributes": { + "type": "Name", + "url": "/services/data/v60.0/sobjects/User/005J9000000MUOuIAO" + }, + "Name": "Hassan Wari" + }, + "Priority": "Medium", + "Status": "Working", + "Description": "This is an example of a simple case to work on", + "Type": null, + "CreatedDate": "2024-09-27T15:17:56.000+0000", + "ClosedDate": null, + "Origin": "Email", + "IsClosed": false, + "IsEscalated": false, + "LastModifiedDate": "2024-09-27T15:17:56.000+0000", + "CaseComments": null + }, + { + "attributes": { + "type": "Case", + "url": "/services/data/v60.0/sobjects/Case/500J9000005dutOIAQ" + }, + "Id": "500J9000005dutOIAQ", + "CaseNumber": "00001005", + "Subject": null, + "AccountId": null, + "Account": null, + "ContactId": null, + "Contact": null, + "OwnerId": "005J9000000MUOuIAO", + "Owner": { + "attributes": { + "type": "Name", + "url": "/services/data/v60.0/sobjects/User/005J9000000MUOuIAO" + }, + "Name": "Hassan Wari" + }, + "Priority": "Medium", + "Status": "New", + "Description": null, + "Type": null, + "CreatedDate": "2024-09-27T15:19:17.000+0000", + "ClosedDate": null, + "Origin": null, + "IsClosed": false, + "IsEscalated": false, + "LastModifiedDate": "2024-09-27T15:19:17.000+0000", + "CaseComments": null + } + ] +} diff --git a/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/query/accounts.json b/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/query/accounts.json new file mode 100644 index 00000000..7eec3a90 --- /dev/null +++ b/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/query/accounts.json @@ -0,0 +1,66 @@ +{ + "totalSize": 5, + "done": true, + "records": [ + { + "attributes": { + "type": "Account", + "url": "/services/data/v60.0/sobjects/Account/001J9000006PvbyIAC" + }, + "Id": "001J9000006PvbyIAC", + "Name": "Acme Corporation", + "Website": "www.acme.com", + "Description": null, + "NumberOfEmployees": null, + "LastModifiedDate": "2024-09-27T10:54:17.000+0000" + }, + { + "attributes": { + "type": "Account", + "url": "/services/data/v60.0/sobjects/Account/001J9000006PvbzIAC" + }, + "Id": "001J9000006PvbzIAC", + "Name": "Global Industries", + "Website": "www.globalind.com", + "Description": null, + "NumberOfEmployees": null, + "LastModifiedDate": "2024-09-27T10:54:17.000+0000" + }, + { + "attributes": { + "type": "Account", + "url": "/services/data/v60.0/sobjects/Account/001J9000006Pvc0IAC" + }, + "Id": "001J9000006Pvc0IAC", + "Name": "Tech Solutions Inc.", + "Website": "www.techsolutions.com", + "Description": null, + "NumberOfEmployees": null, + "LastModifiedDate": "2024-09-27T10:54:17.000+0000" + }, + { + "attributes": { + "type": "Account", + "url": "/services/data/v60.0/sobjects/Account/001J9000006Pvc1IAC" + }, + "Id": "001J9000006Pvc1IAC", + "Name": "Innovate LLC", + "Website": "www.innovate.com", + "Description": null, + "NumberOfEmployees": null, + "LastModifiedDate": "2024-09-27T10:54:17.000+0000" + }, + { + "attributes": { + "type": "Account", + "url": "/services/data/v60.0/sobjects/Account/001J9000006Pvc2IAC" + }, + "Id": "001J9000006Pvc2IAC", + "Name": "Green Energy Co.", + "Website": "www.greenenergy.com", + "Description": null, + "NumberOfEmployees": null, + "LastModifiedDate": "2024-09-27T10:54:17.000+0000" + } + ] +} diff --git a/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/query/articles.json b/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/query/articles.json new file mode 100644 index 00000000..808185c8 --- /dev/null +++ b/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/query/articles.json @@ -0,0 +1,16 @@ +{ + "totalSize": 1, + "done": true, + "records": [ + { + "attributes": { + "type": "Knowledge__kav", + "url": "/services/data/v60.0/sobjects/Knowledge__kav/ka0J90000008QKLIA2" + }, + "Id": "ka0J90000008QKLIA2", + "Title": "Sample Knowledge Article", + "ValidationStatus": "Pending", + "LastModifiedDate": "2024-09-20T11:42:50.000+0000" + } + ] +} diff --git a/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/query/contacts.json b/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/query/contacts.json new file mode 100644 index 00000000..9a080d14 --- /dev/null +++ b/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/query/contacts.json @@ -0,0 +1,66 @@ +{ + "totalSize": 5, + "done": true, + "records": [ + { + "attributes": { + "type": "Contact", + "url": "/services/data/v60.0/sobjects/Contact/003J9000004ogjXIAQ" + }, + "Id": "003J9000004ogjXIAQ", + "FirstName": "John", + "LastName": "Doe", + "Email": "john.doe@example.com", + "AccountId": null, + "LastModifiedDate": "2024-09-27T10:39:01.000+0000" + }, + { + "attributes": { + "type": "Contact", + "url": "/services/data/v60.0/sobjects/Contact/003J9000004ogjYIAQ" + }, + "Id": "003J9000004ogjYIAQ", + "FirstName": "Jane", + "LastName": "Smith", + "Email": "jane.smith@example.com", + "AccountId": null, + "LastModifiedDate": "2024-09-27T10:39:01.000+0000" + }, + { + "attributes": { + "type": "Contact", + "url": "/services/data/v60.0/sobjects/Contact/003J9000004ogjZIAQ" + }, + "Id": "003J9000004ogjZIAQ", + "FirstName": "Emily", + "LastName": "Johnson", + "Email": "emily.johnson@example.com", + "AccountId": null, + "LastModifiedDate": "2024-09-27T10:39:01.000+0000" + }, + { + "attributes": { + "type": "Contact", + "url": "/services/data/v60.0/sobjects/Contact/003J9000004ogjaIAA" + }, + "Id": "003J9000004ogjaIAA", + "FirstName": "Michael", + "LastName": "Williams", + "Email": "michael.williams@example.com", + "AccountId": null, + "LastModifiedDate": "2024-09-27T10:39:01.000+0000" + }, + { + "attributes": { + "type": "Contact", + "url": "/services/data/v60.0/sobjects/Contact/003J9000004ogjbIAA" + }, + "Id": "003J9000004ogjbIAA", + "FirstName": "Sarah", + "LastName": "Brown", + "Email": "sarah.brown@example.com", + "AccountId": null, + "LastModifiedDate": "2024-09-27T10:39:01.000+0000" + } + ] +} diff --git a/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/query/deals.json b/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/query/deals.json new file mode 100644 index 00000000..e9d961fa --- /dev/null +++ b/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/query/deals.json @@ -0,0 +1,78 @@ +{ + "totalSize": 6, + "done": true, + "records": [ + { + "attributes": { + "type": "Opportunity", + "url": "/services/data/v60.0/sobjects/Opportunity/006J90000040Wd4IAE" + }, + "Id": "006J90000040Wd4IAE", + "Name": "New Business", + "Amount": 10000, + "StageName": "Qualify", + "AccountId": "001J9000006PvbyIAC", + "LastModifiedDate": "2024-09-27T15:05:36.000+0000" + }, + { + "attributes": { + "type": "Opportunity", + "url": "/services/data/v60.0/sobjects/Opportunity/006J90000040WeLIAU" + }, + "Id": "006J90000040WeLIAU", + "Name": "New Business", + "Amount": 120000, + "StageName": "Qualify", + "AccountId": "001J9000006Pvc2IAC", + "LastModifiedDate": "2024-09-27T15:06:53.000+0000" + }, + { + "attributes": { + "type": "Opportunity", + "url": "/services/data/v60.0/sobjects/Opportunity/006J90000040WdcIAE" + }, + "Id": "006J90000040WdcIAE", + "Name": "New Business", + "Amount": 13000, + "StageName": "Closed Won", + "AccountId": "001J9000006PvbyIAC", + "LastModifiedDate": "2024-09-27T15:06:14.000+0000" + }, + { + "attributes": { + "type": "Opportunity", + "url": "/services/data/v60.0/sobjects/Opportunity/006J90000040WddIAE" + }, + "Id": "006J90000040WddIAE", + "Name": "StartUp", + "Amount": null, + "StageName": "Closed Lost", + "AccountId": "001J9000006Pvc2IAC", + "LastModifiedDate": "2024-09-27T15:07:12.000+0000" + }, + { + "attributes": { + "type": "Opportunity", + "url": "/services/data/v60.0/sobjects/Opportunity/006J90000040WdNIAU" + }, + "Id": "006J90000040WdNIAU", + "Name": "New Business", + "Amount": 13000, + "StageName": "Propose", + "AccountId": "001J9000006PvbyIAC", + "LastModifiedDate": "2024-09-27T15:05:55.000+0000" + }, + { + "attributes": { + "type": "Opportunity", + "url": "/services/data/v60.0/sobjects/Opportunity/006J90000040WdOIAU" + }, + "Id": "006J90000040WdOIAU", + "Name": "New Business", + "Amount": 12000, + "StageName": "Negotiate", + "AccountId": "001J9000006PvbyIAC", + "LastModifiedDate": "2024-09-27T15:06:26.000+0000" + } + ] +} diff --git a/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/query/tickets.json b/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/query/tickets.json new file mode 100644 index 00000000..49c6e73e --- /dev/null +++ b/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/query/tickets.json @@ -0,0 +1,243 @@ +{ + "totalSize": 4, + "done": true, + "records": [ + { + "attributes": { + "type": "Case", + "url": "/services/data/v60.0/sobjects/Case/500J9000005duskIAA" + }, + "Id": "500J9000005duskIAA", + "CaseNumber": "00001004", + "Subject": null, + "AccountId": "001J9000006Pvc2IAC", + "Account": { + "attributes": { + "type": "Account", + "url": "/services/data/v60.0/sobjects/Account/001J9000006Pvc2IAC" + }, + "Name": "Green Energy Co." + }, + "ContactId": "003J9000004ogjZIAQ", + "Contact": { + "attributes": { + "type": "Contact", + "url": "/services/data/v60.0/sobjects/Contact/003J9000004ogjZIAQ" + }, + "Name": "Emily Johnson" + }, + "OwnerId": "005J9000000MUOuIAO", + "Owner": { + "attributes": { + "type": "Name", + "url": "/services/data/v60.0/sobjects/User/005J9000000MUOuIAO" + }, + "Name": "Hassan Wari" + }, + "Priority": "High", + "Status": "Waiting on Customer", + "Description": null, + "Type": null, + "CreatedDate": "2024-09-27T15:18:19.000+0000", + "ClosedDate": null, + "Origin": "Phone", + "IsClosed": false, + "IsEscalated": false, + "LastModifiedDate": "2024-09-27T15:18:19.000+0000", + "CaseComments": null + }, + { + "attributes": { + "type": "Case", + "url": "/services/data/v60.0/sobjects/Case/500J9000005dutsIAA" + }, + "Id": "500J9000005dutsIAA", + "CaseNumber": "00001006", + "Subject": null, + "AccountId": null, + "Account": null, + "ContactId": null, + "Contact": null, + "OwnerId": "005J9000000MUOuIAO", + "Owner": { + "attributes": { + "type": "Name", + "url": "/services/data/v60.0/sobjects/User/005J9000000MUOuIAO" + }, + "Name": "Hassan Wari" + }, + "Priority": "Low", + "Status": "Closed", + "Description": null, + "Type": null, + "CreatedDate": "2024-09-27T15:19:53.000+0000", + "ClosedDate": "2024-09-27T15:19:53.000+0000", + "Origin": "Web", + "IsClosed": true, + "IsEscalated": false, + "LastModifiedDate": "2024-09-27T15:19:53.000+0000", + "CaseComments": { + "totalSize": 5, + "done": true, + "records": [ + { + "attributes": { + "type": "CaseComment", + "url": "/services/data/v60.0/sobjects/CaseComment/00aJ9000000BQJHIA4" + }, + "Id": "00aJ9000000BQJHIA4", + "CommentBody": "Dummy test in here\r\n sample", + "CreatedDate": "2024-09-27T15:57:15.000+0000", + "CreatedBy": { + "attributes": { + "type": "Name", + "url": "/services/data/v60.0/sobjects/User/005J9000000MUOuIAO" + }, + "Name": "Hassan Wari" + } + }, + { + "attributes": { + "type": "CaseComment", + "url": "/services/data/v60.0/sobjects/CaseComment/00aJ9000000BQJ7IAO" + }, + "Id": "00aJ9000000BQJ7IAO", + "CommentBody": "Another test 3", + "CreatedDate": "2024-09-27T15:56:56.000+0000", + "CreatedBy": { + "attributes": { + "type": "Name", + "url": "/services/data/v60.0/sobjects/User/005J9000000MUOuIAO" + }, + "Name": "Hassan Wari" + } + }, + { + "attributes": { + "type": "CaseComment", + "url": "/services/data/v60.0/sobjects/CaseComment/00aJ9000000BQJCIA4" + }, + "Id": "00aJ9000000BQJCIA4", + "CommentBody": "Test 4 another one", + "CreatedDate": "2024-09-27T15:57:04.000+0000", + "CreatedBy": { + "attributes": { + "type": "Name", + "url": "/services/data/v60.0/sobjects/User/005J9000000MUOuIAO" + }, + "Name": "Hassan Wari" + } + }, + { + "attributes": { + "type": "CaseComment", + "url": "/services/data/v60.0/sobjects/CaseComment/00aJ9000000BQJ2IAO" + }, + "Id": "00aJ9000000BQJ2IAO", + "CommentBody": "Another test 2", + "CreatedDate": "2024-09-27T15:56:47.000+0000", + "CreatedBy": { + "attributes": { + "type": "Name", + "url": "/services/data/v60.0/sobjects/User/005J9000000MUOuIAO" + }, + "Name": "Hassan Wari" + } + }, + { + "attributes": { + "type": "CaseComment", + "url": "/services/data/v60.0/sobjects/CaseComment/00aJ9000000BQIYIA4" + }, + "Id": "00aJ9000000BQIYIA4", + "CommentBody": "Sample body", + "CreatedDate": "2024-09-27T15:23:50.000+0000", + "CreatedBy": { + "attributes": { + "type": "Name", + "url": "/services/data/v60.0/sobjects/User/005J9000000MUOuIAO" + }, + "Name": "Hassan Wari" + } + } + ] + } + }, + { + "attributes": { + "type": "Case", + "url": "/services/data/v60.0/sobjects/Case/500J9000005dusQIAQ" + }, + "Id": "500J9000005dusQIAQ", + "CaseNumber": "00001003", + "Subject": "Important Case to begin working on", + "AccountId": "001J9000006PvbyIAC", + "Account": { + "attributes": { + "type": "Account", + "url": "/services/data/v60.0/sobjects/Account/001J9000006PvbyIAC" + }, + "Name": "Acme Corporation" + }, + "ContactId": "003J9000004ogjXIAQ", + "Contact": { + "attributes": { + "type": "Contact", + "url": "/services/data/v60.0/sobjects/Contact/003J9000004ogjXIAQ" + }, + "Name": "John Doe" + }, + "OwnerId": "005J9000000MUOuIAO", + "Owner": { + "attributes": { + "type": "Name", + "url": "/services/data/v60.0/sobjects/User/005J9000000MUOuIAO" + }, + "Name": "Hassan Wari" + }, + "Priority": "Medium", + "Status": "Working", + "Description": "This is an example of a simple case to work on", + "Type": null, + "CreatedDate": "2024-09-27T15:17:56.000+0000", + "ClosedDate": null, + "Origin": "Email", + "IsClosed": false, + "IsEscalated": false, + "LastModifiedDate": "2024-09-27T15:17:56.000+0000", + "CaseComments": null + }, + { + "attributes": { + "type": "Case", + "url": "/services/data/v60.0/sobjects/Case/500J9000005dutOIAQ" + }, + "Id": "500J9000005dutOIAQ", + "CaseNumber": "00001005", + "Subject": null, + "AccountId": null, + "Account": null, + "ContactId": null, + "Contact": null, + "OwnerId": "005J9000000MUOuIAO", + "Owner": { + "attributes": { + "type": "Name", + "url": "/services/data/v60.0/sobjects/User/005J9000000MUOuIAO" + }, + "Name": "Hassan Wari" + }, + "Priority": "Medium", + "Status": "New", + "Description": null, + "Type": null, + "CreatedDate": "2024-09-27T15:19:17.000+0000", + "ClosedDate": null, + "Origin": null, + "IsClosed": false, + "IsEscalated": false, + "LastModifiedDate": "2024-09-27T15:19:17.000+0000", + "CaseComments": null + } + ] +} diff --git a/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/sobjects/Knowledge__kav/describe.json b/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/sobjects/Knowledge__kav/describe.json new file mode 100644 index 00000000..4aad53d1 --- /dev/null +++ b/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/sobjects/Knowledge__kav/describe.json @@ -0,0 +1,2785 @@ +{ + "actionOverrides": [], + "activateable": false, + "associateEntityType": null, + "associateParentEntity": null, + "childRelationships": [ + { + "cascadeDelete": true, + "childSObject": "AttachedContentDocument", + "deprecatedAndHidden": false, + "field": "LinkedEntityId", + "junctionIdListNames": [], + "junctionReferenceTo": [], + "relationshipName": "AttachedContentDocuments", + "restrictedDelete": false + }, + { + "cascadeDelete": true, + "childSObject": "AttachedContentNote", + "deprecatedAndHidden": false, + "field": "LinkedEntityId", + "junctionIdListNames": [], + "junctionReferenceTo": [], + "relationshipName": "AttachedContentNotes", + "restrictedDelete": false + }, + { + "cascadeDelete": false, + "childSObject": "CaseArticle", + "deprecatedAndHidden": false, + "field": "KnowledgeArticleVersionId", + "junctionIdListNames": [], + "junctionReferenceTo": [], + "relationshipName": "CaseArticles", + "restrictedDelete": false + }, + { + "cascadeDelete": true, + "childSObject": "CombinedAttachment", + "deprecatedAndHidden": false, + "field": "ParentId", + "junctionIdListNames": [], + "junctionReferenceTo": [], + "relationshipName": "CombinedAttachments", + "restrictedDelete": false + }, + { + "cascadeDelete": true, + "childSObject": "ContentDocumentLink", + "deprecatedAndHidden": false, + "field": "LinkedEntityId", + "junctionIdListNames": [], + "junctionReferenceTo": [], + "relationshipName": "ContentDocumentLinks", + "restrictedDelete": false + }, + { + "cascadeDelete": false, + "childSObject": "ContentDocumentLinkChangeEvent", + "deprecatedAndHidden": false, + "field": "LinkedEntityId", + "junctionIdListNames": [], + "junctionReferenceTo": [], + "relationshipName": null, + "restrictedDelete": false + }, + { + "cascadeDelete": false, + "childSObject": "ContentVersion", + "deprecatedAndHidden": false, + "field": "FirstPublishLocationId", + "junctionIdListNames": [], + "junctionReferenceTo": [], + "relationshipName": null, + "restrictedDelete": false + }, + { + "cascadeDelete": false, + "childSObject": "ContentVersionChangeEvent", + "deprecatedAndHidden": false, + "field": "FirstPublishLocationId", + "junctionIdListNames": [], + "junctionReferenceTo": [], + "relationshipName": null, + "restrictedDelete": false + }, + { + "cascadeDelete": true, + "childSObject": "Knowledge__DataCategorySelection", + "deprecatedAndHidden": false, + "field": "ParentId", + "junctionIdListNames": [], + "junctionReferenceTo": [], + "relationshipName": "DataCategorySelections", + "restrictedDelete": false + }, + { + "cascadeDelete": true, + "childSObject": "Knowledge__Share", + "deprecatedAndHidden": false, + "field": "ParentId", + "junctionIdListNames": [], + "junctionReferenceTo": [], + "relationshipName": "Shares", + "restrictedDelete": false + }, + { + "cascadeDelete": true, + "childSObject": "LinkedArticle", + "deprecatedAndHidden": false, + "field": "KnowledgeArticleVersionId", + "junctionIdListNames": [], + "junctionReferenceTo": [], + "relationshipName": "LinkedArticles", + "restrictedDelete": false + }, + { + "cascadeDelete": true, + "childSObject": "ProcessInstance", + "deprecatedAndHidden": false, + "field": "TargetObjectId", + "junctionIdListNames": [], + "junctionReferenceTo": [], + "relationshipName": "ProcessInstances", + "restrictedDelete": false + }, + { + "cascadeDelete": false, + "childSObject": "ProcessInstanceChangeEvent", + "deprecatedAndHidden": false, + "field": "TargetObjectId", + "junctionIdListNames": [], + "junctionReferenceTo": [], + "relationshipName": null, + "restrictedDelete": false + }, + { + "cascadeDelete": false, + "childSObject": "ProcessInstanceHistory", + "deprecatedAndHidden": false, + "field": "TargetObjectId", + "junctionIdListNames": [], + "junctionReferenceTo": [], + "relationshipName": "ProcessSteps", + "restrictedDelete": false + }, + { + "cascadeDelete": false, + "childSObject": "SearchActivity", + "deprecatedAndHidden": false, + "field": "ClickedRecordId", + "junctionIdListNames": [], + "junctionReferenceTo": [], + "relationshipName": null, + "restrictedDelete": false + }, + { + "cascadeDelete": true, + "childSObject": "SearchPromotionRule", + "deprecatedAndHidden": false, + "field": "PromotedEntityId", + "junctionIdListNames": [], + "junctionReferenceTo": [], + "relationshipName": "SearchPromotionRules", + "restrictedDelete": false + } + ], + "compactLayoutable": true, + "createable": true, + "custom": true, + "customSetting": false, + "deepCloneable": false, + "defaultImplementation": null, + "deletable": false, + "deprecatedAndHidden": false, + "extendedBy": null, + "extendsInterfaces": null, + "feedEnabled": false, + "fields": [ + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 18, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": true, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": true, + "inlineHelpText": null, + "label": "Knowledge Article Version ID", + "length": 18, + "mask": null, + "maskType": null, + "name": "Id", + "nameField": false, + "namePointing": false, + "nillable": false, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "tns:ID", + "sortable": true, + "type": "id", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 18, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Knowledge Article ID", + "length": 18, + "mask": null, + "maskType": null, + "name": "KnowledgeArticleId", + "nameField": false, + "namePointing": false, + "nillable": false, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": ["Knowledge__ka"], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "tns:ID", + "sortable": true, + "type": "reference", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 18, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": true, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": true, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Owner ID", + "length": 18, + "mask": null, + "maskType": null, + "name": "OwnerId", + "nameField": false, + "namePointing": true, + "nillable": false, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": true, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": ["Group", "User"], + "relationshipName": "Owner", + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "tns:ID", + "sortable": true, + "type": "reference", + "unique": false, + "updateable": true, + "writeRequiresMasterRead": false + }, + { + "aggregatable": false, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 0, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": false, + "defaultValueFormula": null, + "defaultedOnCreate": true, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Is Deleted", + "length": 0, + "mask": null, + "maskType": null, + "name": "IsDeleted", + "nameField": false, + "namePointing": false, + "nillable": false, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:boolean", + "sortable": true, + "type": "boolean", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 765, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": true, + "custom": false, + "defaultValue": "Not Validated", + "defaultValueFormula": null, + "defaultedOnCreate": true, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Validation Status", + "length": 255, + "mask": null, + "maskType": null, + "name": "ValidationStatus", + "nameField": false, + "namePointing": false, + "nillable": false, + "permissionable": false, + "picklistValues": [ + { + "active": true, + "defaultValue": true, + "label": "Not Validated", + "validFor": null, + "value": "Not Validated" + }, + { + "active": true, + "defaultValue": false, + "label": "Validated", + "validFor": null, + "value": "Validated" + } + ], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:string", + "sortable": false, + "type": "picklist", + "unique": false, + "updateable": true, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 120, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": "Draft", + "defaultValueFormula": null, + "defaultedOnCreate": true, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Publication Status", + "length": 40, + "mask": null, + "maskType": null, + "name": "PublishStatus", + "nameField": false, + "namePointing": false, + "nillable": false, + "permissionable": false, + "picklistValues": [ + { + "active": true, + "defaultValue": true, + "label": "Draft", + "validFor": null, + "value": "Draft" + }, + { + "active": true, + "defaultValue": false, + "label": "Published", + "validFor": null, + "value": "Online" + }, + { + "active": true, + "defaultValue": false, + "label": "Archived", + "validFor": null, + "value": "Archived" + } + ], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": true, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:string", + "sortable": true, + "type": "picklist", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 0, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 6, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": false, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Version Number", + "length": 0, + "mask": null, + "maskType": null, + "name": "VersionNumber", + "nameField": false, + "namePointing": false, + "nillable": false, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:int", + "sortable": true, + "type": "int", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": false, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 0, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": false, + "defaultValueFormula": null, + "defaultedOnCreate": true, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Is Latest Version", + "length": 0, + "mask": null, + "maskType": null, + "name": "IsLatestVersion", + "nameField": false, + "namePointing": false, + "nillable": false, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:boolean", + "sortable": true, + "type": "boolean", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": false, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 0, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": true, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Visible In Internal App", + "length": 0, + "mask": null, + "maskType": null, + "name": "IsVisibleInApp", + "nameField": false, + "namePointing": false, + "nillable": false, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:boolean", + "sortable": true, + "type": "boolean", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": false, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 0, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": true, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": true, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Visible In Public Knowledge Base", + "length": 0, + "mask": null, + "maskType": null, + "name": "IsVisibleInPkb", + "nameField": false, + "namePointing": false, + "nillable": false, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:boolean", + "sortable": true, + "type": "boolean", + "unique": false, + "updateable": true, + "writeRequiresMasterRead": false + }, + { + "aggregatable": false, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 0, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": true, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": true, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Visible to Customer", + "length": 0, + "mask": null, + "maskType": null, + "name": "IsVisibleInCsp", + "nameField": false, + "namePointing": false, + "nillable": false, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:boolean", + "sortable": true, + "type": "boolean", + "unique": false, + "updateable": true, + "writeRequiresMasterRead": false + }, + { + "aggregatable": false, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 0, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": true, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": true, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Visible to Partner", + "length": 0, + "mask": null, + "maskType": null, + "name": "IsVisibleInPrm", + "nameField": false, + "namePointing": false, + "nillable": false, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:boolean", + "sortable": true, + "type": "boolean", + "unique": false, + "updateable": true, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 0, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": true, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": false, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Created Date", + "length": 0, + "mask": null, + "maskType": null, + "name": "CreatedDate", + "nameField": false, + "namePointing": false, + "nillable": false, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:dateTime", + "sortable": true, + "type": "datetime", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 18, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": true, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Created By ID", + "length": 18, + "mask": null, + "maskType": null, + "name": "CreatedById", + "nameField": false, + "namePointing": false, + "nillable": false, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": ["User"], + "relationshipName": "CreatedBy", + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "tns:ID", + "sortable": true, + "type": "reference", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 0, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": true, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": false, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Last Modified Date", + "length": 0, + "mask": null, + "maskType": null, + "name": "LastModifiedDate", + "nameField": false, + "namePointing": false, + "nillable": false, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:dateTime", + "sortable": true, + "type": "datetime", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 18, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": true, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Last Modified By ID", + "length": 18, + "mask": null, + "maskType": null, + "name": "LastModifiedById", + "nameField": false, + "namePointing": false, + "nillable": false, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": ["User"], + "relationshipName": "LastModifiedBy", + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "tns:ID", + "sortable": true, + "type": "reference", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 0, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": true, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": false, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "System Modstamp", + "length": 0, + "mask": null, + "maskType": null, + "name": "SystemModstamp", + "nameField": false, + "namePointing": false, + "nillable": false, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:dateTime", + "sortable": true, + "type": "datetime", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 120, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": true, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Language", + "length": 40, + "mask": null, + "maskType": null, + "name": "Language", + "nameField": false, + "namePointing": false, + "nillable": false, + "permissionable": false, + "picklistValues": [ + { + "active": true, + "defaultValue": false, + "label": "English", + "validFor": null, + "value": "en_US" + } + ], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": true, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:string", + "sortable": true, + "type": "picklist", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 765, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": true, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": true, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": true, + "inlineHelpText": null, + "label": "Title", + "length": 255, + "mask": null, + "maskType": null, + "name": "Title", + "nameField": true, + "namePointing": false, + "nillable": false, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:string", + "sortable": true, + "type": "string", + "unique": false, + "updateable": true, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 765, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": true, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": true, + "inlineHelpText": null, + "label": "URL Name", + "length": 255, + "mask": null, + "maskType": null, + "name": "UrlName", + "nameField": false, + "namePointing": false, + "nillable": false, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:string", + "sortable": true, + "type": "string", + "unique": false, + "updateable": true, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 0, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": false, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Archived Date", + "length": 0, + "mask": null, + "maskType": null, + "name": "ArchivedDate", + "nameField": false, + "namePointing": false, + "nillable": true, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:dateTime", + "sortable": true, + "type": "datetime", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 18, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "User ID", + "length": 18, + "mask": null, + "maskType": null, + "name": "ArchivedById", + "nameField": false, + "namePointing": false, + "nillable": true, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": ["User"], + "relationshipName": "ArchivedBy", + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": true, + "soapType": "tns:ID", + "sortable": true, + "type": "reference", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 3000, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": true, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": "plaintextarea", + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": false, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": "Briefly describe the article. The summary is used in search results to help users find relevant articles. You can improve the accuracy of search results by including phrases that your customers use to describe this issue or topic.", + "label": "Summary", + "length": 1000, + "mask": null, + "maskType": null, + "name": "Summary", + "nameField": false, + "namePointing": false, + "nillable": true, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:string", + "sortable": true, + "type": "textarea", + "unique": false, + "updateable": true, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 0, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": true, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": false, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": "Determine when the knowledge article must next be reviewed for accuracy.", + "label": "Next Review Date", + "length": 0, + "mask": null, + "maskType": null, + "name": "NextReviewDate", + "nameField": false, + "namePointing": false, + "nillable": true, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:dateTime", + "sortable": true, + "type": "datetime", + "unique": false, + "updateable": true, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 300, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Large Language Model", + "length": 100, + "mask": null, + "maskType": null, + "name": "LargeLanguageModel", + "nameField": false, + "namePointing": false, + "nillable": true, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:string", + "sortable": true, + "type": "string", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": true, + "byteLength": 90, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": true, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": false, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Article Number", + "length": 30, + "mask": null, + "maskType": null, + "name": "ArticleNumber", + "nameField": false, + "namePointing": false, + "nillable": false, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:string", + "sortable": true, + "type": "string", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 0, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": false, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "First Published Date", + "length": 0, + "mask": null, + "maskType": null, + "name": "FirstPublishedDate", + "nameField": false, + "namePointing": false, + "nillable": true, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:dateTime", + "sortable": true, + "type": "datetime", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 0, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": false, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Last Published Date", + "length": 0, + "mask": null, + "maskType": null, + "name": "LastPublishedDate", + "nameField": false, + "namePointing": false, + "nillable": true, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:dateTime", + "sortable": true, + "type": "datetime", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 18, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "User ID", + "length": 18, + "mask": null, + "maskType": null, + "name": "ArticleArchivedById", + "nameField": false, + "namePointing": false, + "nillable": true, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": ["User"], + "relationshipName": "ArticleArchivedBy", + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "tns:ID", + "sortable": true, + "type": "reference", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 0, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": false, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Article Archived Date", + "length": 0, + "mask": null, + "maskType": null, + "name": "ArticleArchivedDate", + "nameField": false, + "namePointing": false, + "nillable": true, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:dateTime", + "sortable": true, + "type": "datetime", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 0, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 9, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Article Case Association Count", + "length": 0, + "mask": null, + "maskType": null, + "name": "ArticleCaseAttachCount", + "nameField": false, + "namePointing": false, + "nillable": true, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:int", + "sortable": true, + "type": "int", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 18, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "User ID", + "length": 18, + "mask": null, + "maskType": null, + "name": "ArticleCreatedById", + "nameField": false, + "namePointing": false, + "nillable": true, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": ["User"], + "relationshipName": "ArticleCreatedBy", + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "tns:ID", + "sortable": true, + "type": "reference", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 0, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": false, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Article Created Date", + "length": 0, + "mask": null, + "maskType": null, + "name": "ArticleCreatedDate", + "nameField": false, + "namePointing": false, + "nillable": true, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:dateTime", + "sortable": true, + "type": "datetime", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 120, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Article Primary Language", + "length": 40, + "mask": null, + "maskType": null, + "name": "ArticleMasterLanguage", + "nameField": false, + "namePointing": false, + "nillable": true, + "permissionable": false, + "picklistValues": [ + { + "active": true, + "defaultValue": false, + "label": "English", + "validFor": null, + "value": "en_US" + } + ], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": true, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:string", + "sortable": true, + "type": "picklist", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 0, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 9, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Article Total View Count", + "length": 0, + "mask": null, + "maskType": null, + "name": "ArticleTotalViewCount", + "nameField": false, + "namePointing": false, + "nillable": true, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:int", + "sortable": true, + "type": "int", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 18, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Source", + "length": 18, + "mask": null, + "maskType": null, + "name": "SourceId", + "nameField": false, + "namePointing": false, + "nillable": true, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": true, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": ["Case"], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "tns:ID", + "sortable": true, + "type": "reference", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 18, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Assigned To", + "length": 18, + "mask": null, + "maskType": null, + "name": "AssignedToId", + "nameField": false, + "namePointing": true, + "nillable": true, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": true, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": ["Group", "User"], + "relationshipName": "AssignedTo", + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": true, + "soapType": "tns:ID", + "sortable": true, + "type": "reference", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 18, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "User ID", + "length": 18, + "mask": null, + "maskType": null, + "name": "AssignedById", + "nameField": false, + "namePointing": false, + "nillable": true, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": ["User"], + "relationshipName": "AssignedBy", + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": true, + "soapType": "tns:ID", + "sortable": true, + "type": "reference", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 0, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": false, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Assignment Date", + "length": 0, + "mask": null, + "maskType": null, + "name": "AssignmentDate", + "nameField": false, + "namePointing": false, + "nillable": true, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:dateTime", + "sortable": true, + "type": "datetime", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 0, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": false, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Assignment Due Date", + "length": 0, + "mask": null, + "maskType": null, + "name": "AssignmentDueDate", + "nameField": false, + "namePointing": false, + "nillable": true, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:dateTime", + "sortable": true, + "type": "datetime", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 3000, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": "plaintextarea", + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": false, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Assignment Note", + "length": 1000, + "mask": null, + "maskType": null, + "name": "AssignmentNote", + "nameField": false, + "namePointing": false, + "nillable": true, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:string", + "sortable": true, + "type": "textarea", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + }, + { + "aggregatable": true, + "aiPredictionField": false, + "autoNumber": false, + "byteLength": 45, + "calculated": false, + "calculatedFormula": null, + "cascadeDelete": false, + "caseSensitive": false, + "compoundFieldName": null, + "controllerName": null, + "createable": false, + "custom": false, + "defaultValue": null, + "defaultValueFormula": null, + "defaultedOnCreate": false, + "dependentPicklist": false, + "deprecatedAndHidden": false, + "digits": 0, + "displayLocationInDecimal": false, + "encrypted": false, + "externalId": false, + "extraTypeInfo": null, + "filterable": true, + "filteredLookupInfo": null, + "formulaTreatNullNumberAsZero": false, + "groupable": true, + "highScaleNumber": false, + "htmlFormatted": false, + "idLookup": false, + "inlineHelpText": null, + "label": "Mapping info between old Article Version and migrated Article Version", + "length": 15, + "mask": null, + "maskType": null, + "name": "MigratedToFromArticleVersion", + "nameField": false, + "namePointing": false, + "nillable": true, + "permissionable": false, + "picklistValues": [], + "polymorphicForeignKey": false, + "precision": 0, + "queryByDistance": false, + "referenceTargetField": null, + "referenceTo": [], + "relationshipName": null, + "relationshipOrder": null, + "restrictedDelete": false, + "restrictedPicklist": false, + "scale": 0, + "searchPrefilterable": false, + "soapType": "xsd:string", + "sortable": true, + "type": "string", + "unique": false, + "updateable": false, + "writeRequiresMasterRead": false + } + ], + "hasSubtypes": false, + "implementedBy": null, + "implementsInterfaces": null, + "isInterface": false, + "isSubtype": false, + "keyPrefix": "ka0", + "label": "Knowledge", + "labelPlural": "Knowledge", + "layoutable": true, + "listviewable": null, + "lookupLayoutable": null, + "mergeable": false, + "mruEnabled": true, + "name": "Knowledge__kav", + "namedLayoutInfos": [], + "networkScopeFieldName": null, + "queryable": true, + "recordTypeInfos": [ + { + "active": true, + "available": true, + "defaultRecordTypeMapping": true, + "developerName": "Master", + "master": true, + "name": "Master", + "recordTypeId": "012000000000000AAA", + "urls": { + "layout": "/services/data/v60.0/sobjects/Knowledge__kav/describe/layouts/012000000000000AAA" + } + } + ], + "replicateable": false, + "retrieveable": true, + "searchLayoutable": true, + "searchable": true, + "sobjectDescribeOption": "FULL", + "supportedScopes": [ + { + "label": "All knowledge", + "name": "everything" + }, + { + "label": "My knowledge", + "name": "mine" + }, + { + "label": "Queue owned knowledge", + "name": "queue_owned" + }, + { + "label": "My team's knowledge", + "name": "team" + }, + { + "label": "User owned knowledge", + "name": "user_owned" + } + ], + "triggerable": false, + "undeletable": false, + "updateable": true, + "urls": { + "compactLayouts": "/services/data/v60.0/sobjects/Knowledge__kav/describe/compactLayouts", + "rowTemplate": "/services/data/v60.0/sobjects/Knowledge__kav/{ID}", + "approvalLayouts": "/services/data/v60.0/sobjects/Knowledge__kav/describe/approvalLayouts", + "uiDetailTemplate": "https://computing-site-3783.my.salesforce.com/{ID}", + "uiEditTemplate": "https://computing-site-3783.my.salesforce.com/{ID}/e", + "describe": "/services/data/v60.0/sobjects/Knowledge__kav/describe", + "uiNewRecord": "https://computing-site-3783.my.salesforce.com/ka0/e", + "quickActions": "/services/data/v60.0/sobjects/Knowledge__kav/quickActions", + "layouts": "/services/data/v60.0/sobjects/Knowledge__kav/describe/layouts", + "sobject": "/services/data/v60.0/sobjects/Knowledge__kav" + } +} diff --git a/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/tooling/query.json b/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/tooling/query.json new file mode 100644 index 00000000..fa6092bc --- /dev/null +++ b/integrations/salesforce/mocks/nango/get/proxy/services/data/v60.0/tooling/query.json @@ -0,0 +1,26 @@ +{ + "size": 1, + "totalSize": 1, + "done": true, + "queryLocator": null, + "entityTypeName": "ValidationRule", + "records": [ + { + "attributes": { + "type": "ValidationRule", + "url": "/services/data/v60.0/tooling/sobjects/ValidationRule/03dJ900000001ojIAA" + }, + "Id": "03dJ900000001ojIAA", + "ValidationName": "Validation_2", + "Metadata": { + "description": "Another example of the validation", + "errorConditionFormula": "ISBLANK(Title)", + "errorDisplayField": null, + "errorMessage": "We need this validation", + "shouldEvaluateOnClient": null, + "urls": null, + "active": true + } + } + ] +} diff --git a/integrations/salesforce/mocks/nango/getConnection.json b/integrations/salesforce/mocks/nango/getConnection.json new file mode 100644 index 00000000..132e74b7 --- /dev/null +++ b/integrations/salesforce/mocks/nango/getConnection.json @@ -0,0 +1,8 @@ +{ + "metadata": { + "customFields": ["ValidationStatus"] + }, + "connection_config": { + "instance_url": "https://computing-site-3783.my.salesforce.com" + } +} diff --git a/integrations/salesforce/mocks/nango/getMetadata.json b/integrations/salesforce/mocks/nango/getMetadata.json new file mode 100644 index 00000000..4dbb5fce --- /dev/null +++ b/integrations/salesforce/mocks/nango/getMetadata.json @@ -0,0 +1,3 @@ +{ + "customFields": ["ValidationStatus"] +} diff --git a/integrations/salesforce/mocks/tickets/batchDelete.json b/integrations/salesforce/mocks/tickets/batchDelete.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/integrations/salesforce/mocks/tickets/batchDelete.json @@ -0,0 +1 @@ +[] diff --git a/integrations/salesforce/mocks/tickets/batchSave.json b/integrations/salesforce/mocks/tickets/batchSave.json new file mode 100644 index 00000000..34f0f1f0 --- /dev/null +++ b/integrations/salesforce/mocks/tickets/batchSave.json @@ -0,0 +1,121 @@ +[ + { + "id": "500J9000005duskIAA", + "case_number": "00001004", + "subject": null, + "account_id": "001J9000006Pvc2IAC", + "account_name": "Green Energy Co.", + "contact_id": "003J9000004ogjZIAQ", + "contact_name": "Emily Johnson", + "owner_id": "005J9000000MUOuIAO", + "owner_name": "Hassan Wari", + "priority": "High", + "status": "Waiting on Customer", + "description": null, + "type": null, + "created_date": "2024-09-27T15:18:19.000Z", + "closed_date": null, + "origin": "Phone", + "is_closed": false, + "is_escalated": false, + "conversation": [], + "last_modified_date": "2024-09-27T15:18:19.000Z" + }, + { + "id": "500J9000005dutsIAA", + "case_number": "00001006", + "subject": null, + "account_id": null, + "account_name": null, + "contact_id": null, + "contact_name": null, + "owner_id": "005J9000000MUOuIAO", + "owner_name": "Hassan Wari", + "priority": "Low", + "status": "Closed", + "description": null, + "type": null, + "created_date": "2024-09-27T15:19:53.000Z", + "closed_date": "2024-09-27T15:19:53.000Z", + "origin": "Web", + "is_closed": true, + "is_escalated": false, + "conversation": [ + { + "id": "00aJ9000000BQJHIA4", + "body": "Dummy test in here\r\n sample", + "created_date": "2024-09-27T15:57:15.000Z", + "created_by": "Hassan Wari" + }, + { + "id": "00aJ9000000BQJ7IAO", + "body": "Another test 3", + "created_date": "2024-09-27T15:56:56.000Z", + "created_by": "Hassan Wari" + }, + { + "id": "00aJ9000000BQJCIA4", + "body": "Test 4 another one", + "created_date": "2024-09-27T15:57:04.000Z", + "created_by": "Hassan Wari" + }, + { + "id": "00aJ9000000BQJ2IAO", + "body": "Another test 2", + "created_date": "2024-09-27T15:56:47.000Z", + "created_by": "Hassan Wari" + }, + { + "id": "00aJ9000000BQIYIA4", + "body": "Sample body", + "created_date": "2024-09-27T15:23:50.000Z", + "created_by": "Hassan Wari" + } + ], + "last_modified_date": "2024-09-27T15:19:53.000Z" + }, + { + "id": "500J9000005dusQIAQ", + "case_number": "00001003", + "subject": "Important Case to begin working on", + "account_id": "001J9000006PvbyIAC", + "account_name": "Acme Corporation", + "contact_id": "003J9000004ogjXIAQ", + "contact_name": "John Doe", + "owner_id": "005J9000000MUOuIAO", + "owner_name": "Hassan Wari", + "priority": "Medium", + "status": "Working", + "description": "This is an example of a simple case to work on", + "type": null, + "created_date": "2024-09-27T15:17:56.000Z", + "closed_date": null, + "origin": "Email", + "is_closed": false, + "is_escalated": false, + "conversation": [], + "last_modified_date": "2024-09-27T15:17:56.000Z" + }, + { + "id": "500J9000005dutOIAQ", + "case_number": "00001005", + "subject": null, + "account_id": null, + "account_name": null, + "contact_id": null, + "contact_name": null, + "owner_id": "005J9000000MUOuIAO", + "owner_name": "Hassan Wari", + "priority": "Medium", + "status": "New", + "description": null, + "type": null, + "created_date": "2024-09-27T15:19:17.000Z", + "closed_date": null, + "origin": null, + "is_closed": false, + "is_escalated": false, + "conversation": [], + "last_modified_date": "2024-09-27T15:19:17.000Z" + } +] diff --git a/integrations/salesforce/nango.yaml b/integrations/salesforce/nango.yaml index 08086b43..7f78113f 100644 --- a/integrations/salesforce/nango.yaml +++ b/integrations/salesforce/nango.yaml @@ -3,10 +3,11 @@ integrations: actions: fetch-fields: description: | - Fetch available task fields. If the input is not specified then it defaults back to "Task" + Fetch available task fields, child relationships and validation rules. If the input is not specified then it defaults back to "Task" Data Validation: Parses all incoming data with Zod. Does not fail on parsing error will instead log parse error and return result. scopes: offline_access,api input: SalesforceEntity + version: 1.0.0 output: SalesforceFieldSchema endpoint: GET /salesforce/fetch-fields syncs: @@ -14,28 +15,33 @@ integrations: runs: every hour description: | Fetches a list of accounts from salesforce - output: SalesforceAccount + output: Account sync_type: incremental + version: 1.0.0 endpoint: GET /salesforce/accounts contacts: runs: every hour description: | Fetches a list of contacts from salesforce - output: SalesforceContact + output: Contact sync_type: incremental + version: 1.0.0 endpoint: GET /salesforce/contacts deals: runs: every hour description: | Fetches a list of deals from salesforce - output: SalesforceDeal + output: Deal sync_type: incremental + version: 1.0.0 endpoint: GET /salesforce/deals articles: runs: every day description: | Fetches a list of articles from salesforce - output: SalesforceArticle + output: Article + input: SalesforceMetadata + version: 1.0.0 auto_start: false sync_type: incremental endpoint: GET /salesforce/articles @@ -43,66 +49,69 @@ integrations: runs: every day description: | Fetches a list of tickets from salesforce - output: SalesforceTicket + output: Ticket sync_type: incremental + version: 1.0.0 endpoint: GET /salesforce/tickets models: - SalesforceAccount: + Account: id: string name: string - website: string - description: string - no_employees: number + website: string | null + description: string | null + no_employees: number | null last_modified_date: string - SalesforceContact: + Contact: id: string - first_name: string + first_name: string | null last_name: string - email: string - account_id: string + email: string | null + account_id: string | null last_modified_date: string - SalesforceDeal: + Deal: id: string name: string - amount: number + amount: number | null stage: string account_id: string last_modified_date: string - SalesforceArticle: + Article: id: string title: string content: string last_modified_date: string - SalesforceTicket: + Ticket: id: string case_number: string subject: string | null - account_id: string + account_id: string | null account_name: string | null - contact_id: string + contact_id: string | null contact_name: string | null owner_id: string owner_name: string | null priority: string status: string description: string | null - type: string + type: string | null created_date: string - closed_date: string - origin: string + closed_date: string | null + origin: string | null is_closed: boolean is_escalated: boolean - conversation: - id: string - body: string - created_date: string - created_by: string + conversation: Conversation[] last_modified_date: string + Conversation: + id: string + body: string + created_date: string + created_by: string SalesforceEntity: name: string SalesforceFieldSchema: __extends: NestedFieldSchema childRelationships: ChildField[] + validationRules: ValidationRule[] NestedFieldSchema: fields: Field[] Field: @@ -123,3 +132,10 @@ models: method: string url: string code: string + SalesforceMetadata: + customFields: string[] + ValidationRule: + id: string + name: string + errorConditionFormula: string + errorMessage: string diff --git a/integrations/salesforce/schema.zod.ts b/integrations/salesforce/schema.zod.ts index af1b3544..ed2124dc 100644 --- a/integrations/salesforce/schema.zod.ts +++ b/integrations/salesforce/schema.zod.ts @@ -102,3 +102,10 @@ export const actionResponseErrorSchema = z.object({ message: z.string(), details: actionResponseErrorDetailsSchema.optional() }); + +export const validationRuleSchema = z.object({ + id: z.string(), + name: z.string(), + errorConditionFormula: z.string(), + errorMessage: z.string() +}); diff --git a/integrations/salesforce/syncs/accounts.ts b/integrations/salesforce/syncs/accounts.ts index d33cf653..c043422e 100644 --- a/integrations/salesforce/syncs/accounts.ts +++ b/integrations/salesforce/syncs/accounts.ts @@ -1,4 +1,5 @@ -import type { NangoSync, SalesforceAccount, ProxyConfiguration } from '../../models'; +import type { NangoSync, Account, ProxyConfiguration } from '../../models'; +import type { SalesforceAccount } from '../types'; export default async function fetchData(nango: NangoSync) { const query = buildQuery(nango.lastSyncDate); @@ -26,7 +27,7 @@ function buildQuery(lastSyncDate?: Date): string { } async function fetchAndSaveRecords(nango: NangoSync, query: string) { - const endpoint = '/services/data/v53.0/query'; + const endpoint = '/services/data/v60.0/query'; const proxyConfig: ProxyConfiguration = { endpoint, @@ -42,19 +43,17 @@ async function fetchAndSaveRecords(nango: NangoSync, query: string) { for await (const records of nango.paginate(proxyConfig)) { const mappedRecords = mapAccounts(records); - await nango.batchSave(mappedRecords, 'SalesforceAccount'); + await nango.batchSave(mappedRecords, 'Account'); } } -function mapAccounts(records: any[]): SalesforceAccount[] { - return records.map((record: any) => { - return { - id: record.Id as string, - name: record.Name, - website: record.Website, - description: record.Description, - no_employees: record.NumberOfEmployees, - last_modified_date: record.LastModifiedDate - }; - }); +function mapAccounts(records: SalesforceAccount[]): Account[] { + return records.map(({ Id, Name, Website, Description, NumberOfEmployees, LastModifiedDate }: SalesforceAccount) => ({ + id: Id, + name: Name, + website: Website, + description: Description, + no_employees: NumberOfEmployees, + last_modified_date: new Date(LastModifiedDate).toISOString() + })); } diff --git a/integrations/salesforce/syncs/articles.ts b/integrations/salesforce/syncs/articles.ts index 2539d9aa..f587313e 100644 --- a/integrations/salesforce/syncs/articles.ts +++ b/integrations/salesforce/syncs/articles.ts @@ -1,11 +1,8 @@ -import type { NangoSync, SalesforceArticle, ProxyConfiguration } from '../../models'; - -interface Metadata { - customFields: string[]; -} +import type { NangoSync, Article, ProxyConfiguration, SalesforceMetadata } from '../../models'; +import type { SalesforceArticle } from '../types'; export default async function fetchData(nango: NangoSync) { - const metadata = await nango.getMetadata(); + const metadata = await nango.getMetadata(); if (!metadata.customFields) { throw new Error('An array of custom fields are required'); @@ -33,7 +30,7 @@ function buildQuery(customFields: string[], lastSyncDate?: Date): string { } async function fetchAndSaveRecords(nango: NangoSync, query: string, customFields: string[]) { - const endpoint = '/services/data/v53.0/query'; + const endpoint = '/services/data/v60.0/query'; const proxyConfig: ProxyConfiguration = { endpoint, @@ -49,17 +46,19 @@ async function fetchAndSaveRecords(nango: NangoSync, query: string, customFields for await (const records of nango.paginate(proxyConfig)) { const mappedRecords = mapRecords(records, customFields); - await nango.batchSave(mappedRecords, 'SalesforceArticle'); + await nango.batchSave(mappedRecords, 'Article'); } } -function mapRecords(records: any[], customFields: string[]): SalesforceArticle[] { - return records.map((record: any) => { +function mapRecords(records: SalesforceArticle[], customFields: string[]): Article[] { + return records.map(({ Id, Title, LastModifiedDate, ...rest }: Record) => { + const content = customFields.map((field) => `Field: ${field}\n${rest[field] ?? 'N/A'}`).join('\n'); + return { - id: record.Id as string, - title: record.Name, - content: customFields.map((field: string) => `Field: ${field}\n${record[field]}`).join('\n'), - last_modified_date: record.LastModifiedDate + id: Id, + title: Title, + content, + last_modified_date: new Date(LastModifiedDate).toISOString() }; }); } diff --git a/integrations/salesforce/syncs/contacts.ts b/integrations/salesforce/syncs/contacts.ts index 54154d71..7f0a5f26 100644 --- a/integrations/salesforce/syncs/contacts.ts +++ b/integrations/salesforce/syncs/contacts.ts @@ -1,4 +1,5 @@ -import type { NangoSync, SalesforceContact, ProxyConfiguration } from '../../models'; +import type { NangoSync, Contact, ProxyConfiguration } from '../../models'; +import type { SalesforceContact } from '../types'; export default async function fetchData(nango: NangoSync) { const query = buildQuery(nango.lastSyncDate); @@ -26,7 +27,7 @@ function buildQuery(lastSyncDate?: Date): string { } async function fetchAndSaveRecords(nango: NangoSync, query: string) { - const endpoint = '/services/data/v53.0/query'; + const endpoint = '/services/data/v60.0/query'; const proxyConfig: ProxyConfiguration = { endpoint, @@ -42,19 +43,17 @@ async function fetchAndSaveRecords(nango: NangoSync, query: string) { for await (const records of nango.paginate(proxyConfig)) { const mappedRecords = mapContacts(records); - await nango.batchSave(mappedRecords, 'SalesforceContact'); + await nango.batchSave(mappedRecords, 'Contact'); } } -function mapContacts(records: any[]): SalesforceContact[] { - return records.map((record: any) => { - return { - id: record.Id as string, - first_name: record.FirstName, - last_name: record.LastName, - email: record.Email, - account_id: record.AccountId, - last_modified_date: record.LastModifiedDate - }; - }); +function mapContacts(records: SalesforceContact[]): Contact[] { + return records.map(({ Id, FirstName, LastName, Email, AccountId, LastModifiedDate }: SalesforceContact) => ({ + id: Id, + first_name: FirstName, + last_name: LastName, + email: Email, + account_id: AccountId, + last_modified_date: new Date(LastModifiedDate).toISOString() + })); } diff --git a/integrations/salesforce/syncs/deals.ts b/integrations/salesforce/syncs/deals.ts index f524ba72..6bc99bce 100644 --- a/integrations/salesforce/syncs/deals.ts +++ b/integrations/salesforce/syncs/deals.ts @@ -1,4 +1,5 @@ -import type { NangoSync, SalesforceDeal, ProxyConfiguration } from '../../models'; +import type { NangoSync, Deal, ProxyConfiguration } from '../../models'; +import type { SalesforceDeal } from '../types'; export default async function fetchData(nango: NangoSync) { const query = buildQuery(nango.lastSyncDate); @@ -26,7 +27,7 @@ function buildQuery(lastSyncDate?: Date): string { } async function fetchAndSaveRecords(nango: NangoSync, query: string) { - const endpoint = '/services/data/v53.0/query'; + const endpoint = '/services/data/v60.0/query'; const proxyConfig: ProxyConfiguration = { endpoint, @@ -42,19 +43,17 @@ async function fetchAndSaveRecords(nango: NangoSync, query: string) { for await (const records of nango.paginate(proxyConfig)) { const mappedRecords = mapDeals(records); - await nango.batchSave(mappedRecords, 'SalesforceDeal'); + await nango.batchSave(mappedRecords, 'Deal'); } } -function mapDeals(records: any[]): SalesforceDeal[] { - return records.map((record: any) => { - return { - id: record.Id as string, - name: record.Name, - amount: record.Amount, - stage: record.StageName, - account_id: record.AccountId, - last_modified_date: record.LastModifiedDate - }; - }); +function mapDeals(records: SalesforceDeal[]): Deal[] { + return records.map(({ Id, Name, Amount, StageName, AccountId, LastModifiedDate }: SalesforceDeal) => ({ + id: Id, + name: Name, + amount: Amount, + stage: StageName, + account_id: AccountId, + last_modified_date: new Date(LastModifiedDate).toISOString() + })); } diff --git a/integrations/salesforce/syncs/tickets.ts b/integrations/salesforce/syncs/tickets.ts index 02c3522a..35b7815d 100644 --- a/integrations/salesforce/syncs/tickets.ts +++ b/integrations/salesforce/syncs/tickets.ts @@ -1,4 +1,5 @@ -import type { NangoSync, SalesforceTicket, ProxyConfiguration } from '../../models'; +import type { NangoSync, Ticket, ProxyConfiguration } from '../../models'; +import type { SalesforceTicket, CaseComment } from '../types'; export default async function fetchData(nango: NangoSync) { const query = buildQuery(nango.lastSyncDate); @@ -40,7 +41,7 @@ function buildQuery(lastSyncDate?: Date): string { } async function fetchAndSaveTickets(nango: NangoSync, query: string) { - const endpoint = '/services/data/v53.0/query'; + const endpoint = '/services/data/v60.0/query'; const proxyConfig: ProxyConfiguration = { endpoint, @@ -54,41 +55,41 @@ async function fetchAndSaveTickets(nango: NangoSync, query: string) { }; for await (const records of nango.paginate(proxyConfig)) { - const mappedRecords = mapDeals(records); + const mappedRecords = mapTickets(records); - await nango.batchSave(mappedRecords, 'SalesforceTicket'); + await nango.batchSave(mappedRecords, 'Ticket'); } } -function mapDeals(records: any[]): SalesforceTicket[] { - return records.map((record: any) => { - const salesforceTicket: SalesforceTicket = { - id: record.Id as string, +function mapTickets(records: SalesforceTicket[]): Ticket[] { + return records.map((record: SalesforceTicket) => { + const salesforceTicket: Ticket = { + id: record.Id, case_number: record.CaseNumber, subject: record.Subject, account_id: record.AccountId, - account_name: record.Account?.Name || null, + account_name: record.Account?.Name ?? null, contact_id: record.ContactId, - contact_name: record.Contact?.Name || null, + contact_name: record.Contact?.Name ?? null, owner_id: record.OwnerId, - owner_name: record.Owner?.Name || null, + owner_name: record.Owner.Name, priority: record.Priority, status: record.Status, description: record.Description, type: record.Type, - created_date: record.CreatedDate, - closed_date: record.ClosedDate, + created_date: new Date(record.CreatedDate).toISOString(), + closed_date: record.ClosedDate ? new Date(record.ClosedDate).toISOString() : null, origin: record.Origin, is_closed: record.IsClosed, is_escalated: record.IsEscalated, conversation: - record.CaseComments?.records.map((comment: any) => ({ + record.CaseComments?.records.map((comment: CaseComment) => ({ id: comment.Id, body: comment.CommentBody, - created_date: comment.CreatedDate, + created_date: new Date(comment.CreatedDate).toISOString(), created_by: comment.CreatedBy.Name })) || [], - last_modified_date: record.LastModifiedDate + last_modified_date: new Date(record.LastModifiedDate).toISOString() }; return salesforceTicket; diff --git a/integrations/salesforce/tests/salesforce-accounts.test.ts b/integrations/salesforce/tests/salesforce-accounts.test.ts new file mode 100644 index 00000000..c8e576eb --- /dev/null +++ b/integrations/salesforce/tests/salesforce-accounts.test.ts @@ -0,0 +1,27 @@ +import { vi, expect, it, describe } from "vitest"; +import type { NangoSync } from "../models.js"; + +import fetchData from "../syncs/accounts.js"; + +describe("salesforce accounts tests", () => { + const nangoMock = new global.vitest.NangoSyncMock({ + dirname: __dirname, + name: "accounts", + Model: "Account" + }); + it("should get, map correctly the data and batchSave the result", async () => { + await fetchData(nangoMock); + + const batchSaveData = await nangoMock.getBatchSaveData(); + expect(nangoMock.batchSave).toHaveBeenCalledWith(batchSaveData, "Account"); + }); + + it('should get, map correctly the data and batchDelete the result', async () => { + await fetchData(nangoMock); + + const batchDeleteData = await nangoMock.getBatchDeleteData(); + if (batchDeleteData && batchDeleteData.length > 0) { + expect(nangoMock.batchDelete).toHaveBeenCalledWith(batchDeleteData, "Account"); + } + }); +}); diff --git a/integrations/salesforce/tests/salesforce-articles.test.ts b/integrations/salesforce/tests/salesforce-articles.test.ts new file mode 100644 index 00000000..890f4d22 --- /dev/null +++ b/integrations/salesforce/tests/salesforce-articles.test.ts @@ -0,0 +1,27 @@ +import { vi, expect, it, describe } from "vitest"; +import type { NangoSync } from "../models.js"; + +import fetchData from "../syncs/articles.js"; + +describe("salesforce articles tests", () => { + const nangoMock = new global.vitest.NangoSyncMock({ + dirname: __dirname, + name: "articles", + Model: "Article" + }); + it("should get, map correctly the data and batchSave the result", async () => { + await fetchData(nangoMock); + + const batchSaveData = await nangoMock.getBatchSaveData(); + expect(nangoMock.batchSave).toHaveBeenCalledWith(batchSaveData, "Article"); + }); + + it('should get, map correctly the data and batchDelete the result', async () => { + await fetchData(nangoMock); + + const batchDeleteData = await nangoMock.getBatchDeleteData(); + if (batchDeleteData && batchDeleteData.length > 0) { + expect(nangoMock.batchDelete).toHaveBeenCalledWith(batchDeleteData, "Article"); + } + }); +}); diff --git a/integrations/salesforce/tests/salesforce-contacts.test.ts b/integrations/salesforce/tests/salesforce-contacts.test.ts new file mode 100644 index 00000000..3c27d8a6 --- /dev/null +++ b/integrations/salesforce/tests/salesforce-contacts.test.ts @@ -0,0 +1,27 @@ +import { vi, expect, it, describe } from "vitest"; +import type { NangoSync } from "../models.js"; + +import fetchData from "../syncs/contacts.js"; + +describe("salesforce contacts tests", () => { + const nangoMock = new global.vitest.NangoSyncMock({ + dirname: __dirname, + name: "contacts", + Model: "Contact" + }); + it("should get, map correctly the data and batchSave the result", async () => { + await fetchData(nangoMock); + + const batchSaveData = await nangoMock.getBatchSaveData(); + expect(nangoMock.batchSave).toHaveBeenCalledWith(batchSaveData, "Contact"); + }); + + it('should get, map correctly the data and batchDelete the result', async () => { + await fetchData(nangoMock); + + const batchDeleteData = await nangoMock.getBatchDeleteData(); + if (batchDeleteData && batchDeleteData.length > 0) { + expect(nangoMock.batchDelete).toHaveBeenCalledWith(batchDeleteData, "Contact"); + } + }); +}); diff --git a/integrations/salesforce/tests/salesforce-deals.test.ts b/integrations/salesforce/tests/salesforce-deals.test.ts new file mode 100644 index 00000000..4482600f --- /dev/null +++ b/integrations/salesforce/tests/salesforce-deals.test.ts @@ -0,0 +1,27 @@ +import { vi, expect, it, describe } from "vitest"; +import type { NangoSync } from "../models.js"; + +import fetchData from "../syncs/deals.js"; + +describe("salesforce deals tests", () => { + const nangoMock = new global.vitest.NangoSyncMock({ + dirname: __dirname, + name: "deals", + Model: "Deal" + }); + it("should get, map correctly the data and batchSave the result", async () => { + await fetchData(nangoMock); + + const batchSaveData = await nangoMock.getBatchSaveData(); + expect(nangoMock.batchSave).toHaveBeenCalledWith(batchSaveData, "Deal"); + }); + + it('should get, map correctly the data and batchDelete the result', async () => { + await fetchData(nangoMock); + + const batchDeleteData = await nangoMock.getBatchDeleteData(); + if (batchDeleteData && batchDeleteData.length > 0) { + expect(nangoMock.batchDelete).toHaveBeenCalledWith(batchDeleteData, "Deal"); + } + }); +}); diff --git a/integrations/salesforce/tests/salesforce-tickets.test.ts b/integrations/salesforce/tests/salesforce-tickets.test.ts new file mode 100644 index 00000000..2ac68800 --- /dev/null +++ b/integrations/salesforce/tests/salesforce-tickets.test.ts @@ -0,0 +1,27 @@ +import { vi, expect, it, describe } from "vitest"; +import type { NangoSync } from "../models.js"; + +import fetchData from "../syncs/tickets.js"; + +describe("salesforce tickets tests", () => { + const nangoMock = new global.vitest.NangoSyncMock({ + dirname: __dirname, + name: "tickets", + Model: "Ticket" + }); + it("should get, map correctly the data and batchSave the result", async () => { + await fetchData(nangoMock); + + const batchSaveData = await nangoMock.getBatchSaveData(); + expect(nangoMock.batchSave).toHaveBeenCalledWith(batchSaveData, "Ticket"); + }); + + it('should get, map correctly the data and batchDelete the result', async () => { + await fetchData(nangoMock); + + const batchDeleteData = await nangoMock.getBatchDeleteData(); + if (batchDeleteData && batchDeleteData.length > 0) { + expect(nangoMock.batchDelete).toHaveBeenCalledWith(batchDeleteData, "Ticket"); + } + }); +}); diff --git a/integrations/salesforce/types.ts b/integrations/salesforce/types.ts new file mode 100644 index 00000000..8a28110a --- /dev/null +++ b/integrations/salesforce/types.ts @@ -0,0 +1,267 @@ +export interface DescribeSObjectResult { + actionOverrides: ActionOverride[]; + activateable: boolean; + associateEntityType: string | null; + associateParentEntity: string | null; + childRelationships: ChildRelationship[]; + compactLayoutable: boolean; + createable: boolean; + custom: boolean; + customSetting: boolean; + dataTranslationEnabled?: boolean; + deepCloneable: boolean; + defaultImplementation: string | null; + deletable: boolean; + deprecatedAndHidden: boolean; + extendedBy: string | null; + extendsInterfaces: string | null; + feedEnabled: boolean; + fields: SalesForceField[]; + hasSubtypes?: boolean; + implementedBy: string; + implementsInterfaces: string | null; + isInterface: boolean; + keyPrefix: string; + label: string; + labelPlural: string; + layoutable: boolean; + mergeable: boolean; + mruEnabled: boolean; + name: string; + namedLayoutInfos: NamedLayoutInfo[]; + networkScopeFieldName: string | null; + queryable: boolean; + recordTypeInfos: RecordTypeInfo[]; + replicateable: boolean; + retrieveable: boolean; + searchable: boolean; + searchLayoutable: boolean; + supportedScopes: ScopeInfo; + triggerable: boolean; + undeletable: boolean; + updateable: boolean; + urlDetail: string; + urlEdit: string; + urlNew: string; +} + +interface ActionOverride { + formFactor: string; + isAvailableInTouch: boolean; + name: string; + pageId: string; + url: string | null; +} + +export interface ChildRelationship { + cascadeDelete: boolean; + childSObject: string; + deprecatedAndHidden: boolean; + field: string; + junctionIdListNames: string[]; + junctionReferenceTo: string[]; + relationshipName: string | null; + restrictedDelete: boolean; +} + +export interface SalesForceField { + aggregatable: boolean; + aiPredictionField?: boolean; + cascadeDelete?: boolean; + autoNumber: boolean; + byteLength: number; + calculated: boolean; + caseSensitive: boolean; + controllerName: string; + createable: boolean; + custom: boolean; + dataTranslationEnabled: boolean; + defaultedOnCreate: boolean; + defaultValueFormula: string | null; + dependentPicklist: boolean; + deprecatedAndHidden: boolean; + digits: number; + displayLocationInDecimal: boolean; + encrypted: boolean; + extraTypeInfo: string | null; + filterable: boolean; + filteredLookupInfo: FilteredLookupInfo | null; + formula?: string; + groupable: boolean; + highScaleNumber: boolean; + htmlFormatted: boolean; + idLookup: boolean; + inlineHelpText: string | null; + label: string; + length: number; + mask: string | null; + maskType: string | null; + name: string; + nameField: boolean; + namePointing: boolean; + nillable: boolean; + permissionable: boolean; + picklistValues: PicklistEntry[]; + polymorphicForeignKey: boolean; + precision: number; + relationshipName: string | null; + relationshipOrder: number | null; + referenceTargetField: string | null; + referenceTo: string[]; + restrictedPicklist: boolean; + scale: number; + searchPrefilterable: boolean; + soapType: string; + sortable: boolean; + type: string; + unique: boolean; + updateable: boolean; + writeRequiresMasterRead: boolean; +} + +interface FilteredLookupInfo { + controllingFields: string[]; + dependent: boolean; + optionalFilter: boolean; +} +interface PicklistEntry { + active: boolean; + validFor: Uint8Array | null; + defaultValue: boolean; + label: string; + value: string; +} + +interface NamedLayoutInfo { + name: string; +} + +interface RecordTypeInfo { + available: boolean; + defaultRecordTypeMapping: boolean; + developerName: string; + master: boolean; + name: string; + recordTypeId: string; +} + +interface ScopeInfo { + label: string; + name: string; +} + +interface Metadata { + description: string; + errorConditionFormula: string; + errorDisplayField: string; + errorMessage: string; + shouldEvaluateOnClient: boolean; + urls: string; + active: boolean; +} + +interface Attributes { + type: string; + url: string; +} + +export interface ValidationRecord { + attributes: Attributes; + Id: string; + ValidationName: string; + Metadata: Metadata; +} + +export interface ValidationRuleResponse { + size: number; + totalSize: number; + done: boolean; + queryLocator: string | null; + entityTypeName: string; + records: ValidationRecord[]; +} + +export interface SalesforceAccount { + attributes: Attributes; + Id: string; + Name: string; + Website: string | null; + Description: string | null; + NumberOfEmployees: number | null; + LastModifiedDate: string; +} + +export interface SalesforceContact { + attributes: Attributes; + Id: string; + FirstName: string; + LastName: string; + Email: string; + AccountId: string | null; + LastModifiedDate: string; +} + +export interface SalesforceArticle { + Id: string; + Title: string; + LastModifiedDate: string; + [key: string]: any; +} + +export interface SalesforceDeal { + attributes: Attributes; + Id: string; + Name: string; + Amount: number | null; + StageName: string; + AccountId: string; + LastModifiedDate: string; +} + +interface Attributes { + type: string; + url: string; +} + +interface NamedEntity { + attributes: Attributes; + Name: string; +} + +interface Comments { + totalSize: number; + done: boolean; + records: CaseComment[]; +} + +export interface CaseComment { + attributes: Attributes; + Id: string; + CommentBody: string; + CreatedDate: string; + CreatedBy: NamedEntity; +} + +export interface SalesforceTicket { + attributes: Attributes; + Id: string; + CaseNumber: string; + Subject: string | null; + AccountId: string | null; + Account: NamedEntity | null; + ContactId: string | null; + Contact: NamedEntity | null; + OwnerId: string; + Owner: NamedEntity; + Priority: string; + Status: string; + Description: string | null; + Type: string | null; + CreatedDate: string; + ClosedDate: string | null; + Origin: string | null; + IsClosed: boolean; + IsEscalated: boolean; + LastModifiedDate: string; + CaseComments: Comments | null; +} diff --git a/integrations/xero/mocks/nango/get/proxy/api.xro/2.0/Accounts.json b/integrations/xero/mocks/nango/get/proxy/api.xro/2.0/Accounts/accounts.json similarity index 100% rename from integrations/xero/mocks/nango/get/proxy/api.xro/2.0/Accounts.json rename to integrations/xero/mocks/nango/get/proxy/api.xro/2.0/Accounts/accounts.json diff --git a/integrations/xero/mocks/nango/get/proxy/api.xro/2.0/Contacts.json b/integrations/xero/mocks/nango/get/proxy/api.xro/2.0/Contacts/contacts.json similarity index 100% rename from integrations/xero/mocks/nango/get/proxy/api.xro/2.0/Contacts.json rename to integrations/xero/mocks/nango/get/proxy/api.xro/2.0/Contacts/contacts.json diff --git a/integrations/xero/mocks/nango/get/proxy/api.xro/2.0/Invoices.json b/integrations/xero/mocks/nango/get/proxy/api.xro/2.0/Invoices/invoices.json similarity index 100% rename from integrations/xero/mocks/nango/get/proxy/api.xro/2.0/Invoices.json rename to integrations/xero/mocks/nango/get/proxy/api.xro/2.0/Invoices/invoices.json diff --git a/integrations/xero/mocks/nango/get/proxy/api.xro/2.0/Items.json b/integrations/xero/mocks/nango/get/proxy/api.xro/2.0/Items/items.json similarity index 100% rename from integrations/xero/mocks/nango/get/proxy/api.xro/2.0/Items.json rename to integrations/xero/mocks/nango/get/proxy/api.xro/2.0/Items/items.json diff --git a/integrations/xero/mocks/nango/get/proxy/api.xro/2.0/Payments.json b/integrations/xero/mocks/nango/get/proxy/api.xro/2.0/Payments/payments.json similarity index 100% rename from integrations/xero/mocks/nango/get/proxy/api.xro/2.0/Payments.json rename to integrations/xero/mocks/nango/get/proxy/api.xro/2.0/Payments/payments.json diff --git a/vitest.setup.ts b/vitest.setup.ts index 9a05bbd8..e42f742e 100644 --- a/vitest.setup.ts +++ b/vitest.setup.ts @@ -71,7 +71,7 @@ export class NangoSyncMock { private async *getProxyPaginateData(args: any) { const { endpoint: rawEndpoint, method = 'get', paginate } = args; const endpoint = rawEndpoint.startsWith('/') ? rawEndpoint.slice(1) : rawEndpoint; - const data = await this.getMockFile(`nango/${method.toLowerCase()}/proxy/${endpoint}`); + const data = await this.getMockFile(`nango/${method.toLowerCase()}/proxy/${endpoint}/${this.name}`); if (Array.isArray(data)) { yield data; @@ -90,7 +90,7 @@ export class NangoSyncMock { private async proxyGetData(args: any) { const { endpoint: rawEndpoint } = args; const endpoint = rawEndpoint.startsWith('/') ? rawEndpoint.slice(1) : rawEndpoint; - const data = await this.getMockFile(`nango/get/proxy/${endpoint}`); + const data = await this.getMockFile(`nango/get/proxy/${endpoint}/${this.name}`); return { data }; } @@ -98,7 +98,7 @@ export class NangoSyncMock { private async proxyPostData(args: any) { const { endpoint: rawEndpoint } = args; const endpoint = rawEndpoint.startsWith('/') ? rawEndpoint.slice(1) : rawEndpoint; - const data = await this.getMockFile(`nango/post/proxy/${endpoint}`); + const data = await this.getMockFile(`nango/post/proxy/${endpoint}/${this.name}`); return { data }; } @@ -106,7 +106,7 @@ export class NangoSyncMock { private async proxyPatchData(args: any) { const { endpoint: rawEndpoint } = args; const endpoint = rawEndpoint.startsWith('/') ? rawEndpoint.slice(1) : rawEndpoint; - const data = await this.getMockFile(`nango/patch/proxy/${endpoint}`); + const data = await this.getMockFile(`nango/patch/proxy/${endpoint}/${this.name}`); return { data }; } @@ -114,7 +114,7 @@ export class NangoSyncMock { private async proxyPutData(args: any) { const { endpoint: rawEndpoint } = args; const endpoint = rawEndpoint.startsWith('/') ? rawEndpoint.slice(1) : rawEndpoint; - const data = await this.getMockFile(`nango/put/proxy/${endpoint}`); + const data = await this.getMockFile(`nango/put/proxy/${endpoint}/${this.name}`); return { data }; } @@ -122,7 +122,7 @@ export class NangoSyncMock { private async proxyDeleteData(args: any) { const { endpoint: rawEndpoint } = args; const endpoint = rawEndpoint.startsWith('/') ? rawEndpoint.slice(1) : rawEndpoint; - const data = await this.getMockFile(`nango/delete/proxy/${endpoint}`); + const data = await this.getMockFile(`nango/delete/proxy/${endpoint}/${this.name}`); return { data }; }