/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { expect, test } from "vitest"; import { Apideck } from "../index.js"; import { createTestHTTPClient } from "./testclient.js"; test("Contacts Crm Contacts All", async () => { const testHttpClient = createTestHTTPClient("crm.contactsAll"); const apideck = new Apideck({ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080", httpClient: testHttpClient, apiKey: process.env["APIDECK_API_KEY"] ?? "value", }); const result = await apideck.crm.contacts.list({ consumerId: "test-consumer", appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", serviceId: "salesforce", filter: { firstName: "Elon", lastName: "Musk", email: "elon@tesla.com", companyId: "12345", ownerId: "12345", }, sort: { by: "created_at", direction: "desc", }, passThrough: { "search": "San Francisco", }, fields: "id,updated_at", }); expect(result.httpMeta.response.status).toBe(200); expect(result.getContactsResponse).toBeDefined(); expect(result.getContactsResponse).toEqual({ statusCode: 200, status: "OK", service: "zoho-crm", resource: "contacts", operation: "all", data: [ { id: "12345", name: "Elon Musk", ownerId: "54321", type: "personal", companyId: "23456", companyName: "23456", leadId: "34567", firstName: "Elon", middleName: "D.", lastName: "Musk", prefix: "Mr.", suffix: "PhD", title: "CEO", department: "Engineering", language: "EN", gender: "female", birthday: "2000-08-12", photoUrl: "https://unavatar.io/elon-musk", leadSource: "Cold Call", fax: "+12129876543", description: "Internal champion", currentBalance: 10.5, status: "open", active: true, websites: [ { id: "12345", url: "http://example.com", type: "primary", }, { id: "12345", url: "http://example.com", type: "primary", }, ], addresses: [ { id: "123", type: "primary", string: "25 Spring Street, Blackburn, VIC 3130", name: "HQ US", line1: "Main street", line2: "apt #", line3: "Suite #", line4: "delivery instructions", streetNumber: "25", city: "San Francisco", state: "CA", postalCode: "94104", country: "US", latitude: "40.759211", longitude: "-73.984638", county: "Santa Clara", contactName: "Elon Musk", salutation: "Mr", phoneNumber: "111-111-1111", fax: "122-111-1111", email: "elon@musk.com", website: "https://elonmusk.com", notes: "Address notes or delivery instructions.", rowVersion: "1-12345", }, { id: "123", type: "primary", string: "25 Spring Street, Blackburn, VIC 3130", name: "HQ US", line1: "Main street", line2: "apt #", line3: "Suite #", line4: "delivery instructions", streetNumber: "25", city: "San Francisco", state: "CA", postalCode: "94104", country: "US", latitude: "40.759211", longitude: "-73.984638", county: "Santa Clara", contactName: "Elon Musk", salutation: "Mr", phoneNumber: "111-111-1111", fax: "122-111-1111", email: "elon@musk.com", website: "https://elonmusk.com", notes: "Address notes or delivery instructions.", rowVersion: "1-12345", }, { id: "123", type: "primary", string: "25 Spring Street, Blackburn, VIC 3130", name: "HQ US", line1: "Main street", line2: "apt #", line3: "Suite #", line4: "delivery instructions", streetNumber: "25", city: "San Francisco", state: "CA", postalCode: "94104", country: "US", latitude: "40.759211", longitude: "-73.984638", county: "Santa Clara", contactName: "Elon Musk", salutation: "Mr", phoneNumber: "111-111-1111", fax: "122-111-1111", email: "elon@musk.com", website: "https://elonmusk.com", notes: "Address notes or delivery instructions.", rowVersion: "1-12345", }, ], socialLinks: [ { id: "12345", url: "https://www.twitter.com/apideck", type: "twitter", }, ], phoneNumbers: [ { id: "12345", countryCode: "1", areaCode: "323", number: "111-111-1111", extension: "105", type: "primary", }, ], emails: [ { id: "123", email: "elon@musk.com", type: "primary", }, ], emailDomain: "gmail.com", customFields: [ { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: {}, }, { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: "Uses Salesforce and Marketo", }, ], tags: [ "New", ], firstCallAt: new Date("2020-09-30T07:43:32.000Z"), firstEmailAt: new Date("2020-09-30T07:43:32.000Z"), lastActivityAt: new Date("2020-09-30T07:43:32.000Z"), updatedAt: new Date("2017-08-12T20:43:21.291Z"), createdAt: new Date("2017-08-12T20:43:21.291Z"), opportunityIds: [ "12345", ], passThrough: [ { serviceId: "", extendPaths: [ { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, ], }, { serviceId: "", extendPaths: [ { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, ], }, { serviceId: "", extendPaths: [ { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, ], }, ], }, { id: "12345", name: "Elon Musk", ownerId: "54321", type: "personal", companyId: "23456", companyName: "23456", leadId: "34567", firstName: "Elon", middleName: "D.", lastName: "Musk", prefix: "Mr.", suffix: "PhD", title: "CEO", department: "Engineering", language: "EN", gender: "female", birthday: "2000-08-12", photoUrl: "https://unavatar.io/elon-musk", leadSource: "Cold Call", fax: "+12129876543", description: "Internal champion", currentBalance: 10.5, status: "open", active: true, websites: [ { id: "12345", url: "http://example.com", type: "primary", }, { id: "12345", url: "http://example.com", type: "primary", }, ], addresses: [ { id: "123", type: "primary", string: "25 Spring Street, Blackburn, VIC 3130", name: "HQ US", line1: "Main street", line2: "apt #", line3: "Suite #", line4: "delivery instructions", streetNumber: "25", city: "San Francisco", state: "CA", postalCode: "94104", country: "US", latitude: "40.759211", longitude: "-73.984638", county: "Santa Clara", contactName: "Elon Musk", salutation: "Mr", phoneNumber: "111-111-1111", fax: "122-111-1111", email: "elon@musk.com", website: "https://elonmusk.com", notes: "Address notes or delivery instructions.", rowVersion: "1-12345", }, { id: "123", type: "primary", string: "25 Spring Street, Blackburn, VIC 3130", name: "HQ US", line1: "Main street", line2: "apt #", line3: "Suite #", line4: "delivery instructions", streetNumber: "25", city: "San Francisco", state: "CA", postalCode: "94104", country: "US", latitude: "40.759211", longitude: "-73.984638", county: "Santa Clara", contactName: "Elon Musk", salutation: "Mr", phoneNumber: "111-111-1111", fax: "122-111-1111", email: "elon@musk.com", website: "https://elonmusk.com", notes: "Address notes or delivery instructions.", rowVersion: "1-12345", }, ], socialLinks: [ { id: "12345", url: "https://www.twitter.com/apideck", type: "twitter", }, ], phoneNumbers: [ { id: "12345", countryCode: "1", areaCode: "323", number: "111-111-1111", extension: "105", type: "primary", }, ], emails: [ { id: "123", email: "elon@musk.com", type: "primary", }, { id: "123", email: "elon@musk.com", type: "primary", }, ], emailDomain: "gmail.com", customFields: [ { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: "Uses Salesforce and Marketo", }, { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: { "0": {}, "1": {}, }, }, ], tags: [ "New", ], firstCallAt: new Date("2020-09-30T07:43:32.000Z"), firstEmailAt: new Date("2020-09-30T07:43:32.000Z"), lastActivityAt: new Date("2020-09-30T07:43:32.000Z"), updatedAt: new Date("2017-08-12T20:43:21.291Z"), createdAt: new Date("2017-08-12T20:43:21.291Z"), opportunityIds: [ "12345", ], passThrough: [ { serviceId: "", extendPaths: [ { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, ], }, { serviceId: "", extendPaths: [ { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, ], }, { serviceId: "", extendPaths: [ { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, ], }, ], }, { id: "12345", name: "Elon Musk", ownerId: "54321", type: "personal", companyId: "23456", companyName: "23456", leadId: "34567", firstName: "Elon", middleName: "D.", lastName: "Musk", prefix: "Mr.", suffix: "PhD", title: "CEO", department: "Engineering", language: "EN", gender: "female", birthday: "2000-08-12", photoUrl: "https://unavatar.io/elon-musk", leadSource: "Cold Call", fax: "+12129876543", description: "Internal champion", currentBalance: 10.5, status: "open", active: true, websites: [ { id: "12345", url: "http://example.com", type: "primary", }, { id: "12345", url: "http://example.com", type: "primary", }, { id: "12345", url: "http://example.com", type: "primary", }, ], addresses: [ { id: "123", type: "primary", string: "25 Spring Street, Blackburn, VIC 3130", name: "HQ US", line1: "Main street", line2: "apt #", line3: "Suite #", line4: "delivery instructions", streetNumber: "25", city: "San Francisco", state: "CA", postalCode: "94104", country: "US", latitude: "40.759211", longitude: "-73.984638", county: "Santa Clara", contactName: "Elon Musk", salutation: "Mr", phoneNumber: "111-111-1111", fax: "122-111-1111", email: "elon@musk.com", website: "https://elonmusk.com", notes: "Address notes or delivery instructions.", rowVersion: "1-12345", }, ], socialLinks: [ { id: "12345", url: "https://www.twitter.com/apideck", type: "twitter", }, { id: "12345", url: "https://www.twitter.com/apideck", type: "twitter", }, { id: "12345", url: "https://www.twitter.com/apideck", type: "twitter", }, ], phoneNumbers: [ { id: "12345", countryCode: "1", areaCode: "323", number: "111-111-1111", extension: "105", type: "primary", }, { id: "12345", countryCode: "1", areaCode: "323", number: "111-111-1111", extension: "105", type: "primary", }, ], emails: [ { id: "123", email: "elon@musk.com", type: "primary", }, { id: "123", email: "elon@musk.com", type: "primary", }, { id: "123", email: "elon@musk.com", type: "primary", }, ], emailDomain: "gmail.com", customFields: [ { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: "Uses Salesforce and Marketo", }, ], tags: [ "New", ], firstCallAt: new Date("2020-09-30T07:43:32.000Z"), firstEmailAt: new Date("2020-09-30T07:43:32.000Z"), lastActivityAt: new Date("2020-09-30T07:43:32.000Z"), updatedAt: new Date("2017-08-12T20:43:21.291Z"), createdAt: new Date("2017-08-12T20:43:21.291Z"), opportunityIds: [ "12345", ], passThrough: [ { serviceId: "", extendPaths: [ { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, ], }, { serviceId: "", extendPaths: [ { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, ], }, { serviceId: "", extendPaths: [ { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, ], }, ], }, ], meta: { itemsOnPage: 50, cursors: { previous: "em9oby1jcm06OnBhZ2U6OjE=", current: "em9oby1jcm06OnBhZ2U6OjI=", next: "em9oby1jcm06OnBhZ2U6OjM=", }, }, links: { previous: "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D", current: "https://unify.apideck.com/crm/companies", next: "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM", }, }); }); test("Contacts Crm Contacts Add", async () => { const testHttpClient = createTestHTTPClient("crm.contactsAdd"); const apideck = new Apideck({ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080", httpClient: testHttpClient, apiKey: process.env["APIDECK_API_KEY"] ?? "value", }); const result = await apideck.crm.contacts.create({ consumerId: "test-consumer", appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", serviceId: "salesforce", contact: { name: "Elon Musk", ownerId: "54321", type: "personal", companyId: "23456", companyName: "23456", leadId: "34567", firstName: "Elon", middleName: "D.", lastName: "Musk", prefix: "Mr.", suffix: "PhD", title: "CEO", department: "Engineering", language: "EN", gender: "female", birthday: "2000-08-12", photoUrl: "https://unavatar.io/elon-musk", leadSource: "Cold Call", fax: "+12129876543", description: "Internal champion", currentBalance: 10.5, status: "open", active: true, websites: [ { id: "12345", url: "http://example.com", type: "primary", }, { id: "12345", url: "http://example.com", type: "primary", }, ], addresses: [ { id: "123", type: "primary", string: "25 Spring Street, Blackburn, VIC 3130", name: "HQ US", line1: "Main street", line2: "apt #", line3: "Suite #", line4: "delivery instructions", streetNumber: "25", city: "San Francisco", state: "CA", postalCode: "94104", country: "US", latitude: "40.759211", longitude: "-73.984638", county: "Santa Clara", contactName: "Elon Musk", salutation: "Mr", phoneNumber: "111-111-1111", fax: "122-111-1111", email: "elon@musk.com", website: "https://elonmusk.com", notes: "Address notes or delivery instructions.", rowVersion: "1-12345", }, { id: "123", type: "primary", string: "25 Spring Street, Blackburn, VIC 3130", name: "HQ US", line1: "Main street", line2: "apt #", line3: "Suite #", line4: "delivery instructions", streetNumber: "25", city: "San Francisco", state: "CA", postalCode: "94104", country: "US", latitude: "40.759211", longitude: "-73.984638", county: "Santa Clara", contactName: "Elon Musk", salutation: "Mr", phoneNumber: "111-111-1111", fax: "122-111-1111", email: "elon@musk.com", website: "https://elonmusk.com", notes: "Address notes or delivery instructions.", rowVersion: "1-12345", }, ], socialLinks: [ { id: "12345", url: "https://www.twitter.com/apideck", type: "twitter", }, { id: "12345", url: "https://www.twitter.com/apideck", type: "twitter", }, ], phoneNumbers: [ { id: "12345", countryCode: "1", areaCode: "323", number: "111-111-1111", extension: "105", type: "primary", }, ], emails: [ { id: "123", email: "elon@musk.com", type: "primary", }, ], emailDomain: "gmail.com", customFields: [ { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: {}, }, { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: 10, }, { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: "Uses Salesforce and Marketo", }, ], tags: [ "New", ], opportunityIds: [ "12345", ], passThrough: [ { serviceId: "", extendPaths: [ { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, ], }, { serviceId: "", extendPaths: [ { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, ], }, { serviceId: "", extendPaths: [ { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, ], }, ], }, }); expect(result.httpMeta.response.status).toBe(201); expect(result.createContactResponse).toBeDefined(); expect(result.createContactResponse).toEqual({ statusCode: 200, status: "OK", service: "zoho-crm", resource: "contacts", operation: "add", data: { id: "12345", }, }); }); test("Contacts Crm Contacts One", async () => { const testHttpClient = createTestHTTPClient("crm.contactsOne"); const apideck = new Apideck({ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080", httpClient: testHttpClient, apiKey: process.env["APIDECK_API_KEY"] ?? "value", }); const result = await apideck.crm.contacts.get({ id: "", consumerId: "test-consumer", appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", serviceId: "salesforce", fields: "id,updated_at", filter: { firstName: "Elon", lastName: "Musk", email: "elon@tesla.com", companyId: "12345", ownerId: "12345", }, }); expect(result.httpMeta.response.status).toBe(200); expect(result.getContactResponse).toBeDefined(); expect(result.getContactResponse).toEqual({ statusCode: 200, status: "OK", service: "zoho-crm", resource: "companies", operation: "one", data: { id: "12345", name: "Elon Musk", ownerId: "54321", type: "personal", companyId: "23456", companyName: "23456", leadId: "34567", firstName: "Elon", middleName: "D.", lastName: "Musk", prefix: "Mr.", suffix: "PhD", title: "CEO", department: "Engineering", language: "EN", gender: "female", birthday: "2000-08-12", photoUrl: "https://unavatar.io/elon-musk", leadSource: "Cold Call", fax: "+12129876543", description: "Internal champion", currentBalance: 10.5, status: "open", active: true, websites: [ { id: "12345", url: "http://example.com", type: "primary", }, { id: "12345", url: "http://example.com", type: "primary", }, { id: "12345", url: "http://example.com", type: "primary", }, ], addresses: [ { id: "123", type: "primary", string: "25 Spring Street, Blackburn, VIC 3130", name: "HQ US", line1: "Main street", line2: "apt #", line3: "Suite #", line4: "delivery instructions", streetNumber: "25", city: "San Francisco", state: "CA", postalCode: "94104", country: "US", latitude: "40.759211", longitude: "-73.984638", county: "Santa Clara", contactName: "Elon Musk", salutation: "Mr", phoneNumber: "111-111-1111", fax: "122-111-1111", email: "elon@musk.com", website: "https://elonmusk.com", notes: "Address notes or delivery instructions.", rowVersion: "1-12345", }, { id: "123", type: "primary", string: "25 Spring Street, Blackburn, VIC 3130", name: "HQ US", line1: "Main street", line2: "apt #", line3: "Suite #", line4: "delivery instructions", streetNumber: "25", city: "San Francisco", state: "CA", postalCode: "94104", country: "US", latitude: "40.759211", longitude: "-73.984638", county: "Santa Clara", contactName: "Elon Musk", salutation: "Mr", phoneNumber: "111-111-1111", fax: "122-111-1111", email: "elon@musk.com", website: "https://elonmusk.com", notes: "Address notes or delivery instructions.", rowVersion: "1-12345", }, ], socialLinks: [ { id: "12345", url: "https://www.twitter.com/apideck", type: "twitter", }, { id: "12345", url: "https://www.twitter.com/apideck", type: "twitter", }, ], phoneNumbers: [ { id: "12345", countryCode: "1", areaCode: "323", number: "111-111-1111", extension: "105", type: "primary", }, { id: "12345", countryCode: "1", areaCode: "323", number: "111-111-1111", extension: "105", type: "primary", }, ], emails: [ { id: "123", email: "elon@musk.com", type: "primary", }, { id: "123", email: "elon@musk.com", type: "primary", }, { id: "123", email: "elon@musk.com", type: "primary", }, ], emailDomain: "gmail.com", customFields: [ { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: true, }, { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: 10, }, ], tags: [ "New", ], firstCallAt: new Date("2020-09-30T07:43:32.000Z"), firstEmailAt: new Date("2020-09-30T07:43:32.000Z"), lastActivityAt: new Date("2020-09-30T07:43:32.000Z"), updatedAt: new Date("2017-08-12T20:43:21.291Z"), createdAt: new Date("2017-08-12T20:43:21.291Z"), opportunityIds: [ "12345", ], passThrough: [ { serviceId: "", extendPaths: [ { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, ], }, ], }, }); }); test("Contacts Crm Contacts Update", async () => { const testHttpClient = createTestHTTPClient("crm.contactsUpdate"); const apideck = new Apideck({ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080", httpClient: testHttpClient, apiKey: process.env["APIDECK_API_KEY"] ?? "value", }); const result = await apideck.crm.contacts.update({ id: "", consumerId: "test-consumer", appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", serviceId: "salesforce", contact: { name: "Elon Musk", ownerId: "54321", type: "personal", companyId: "23456", companyName: "23456", leadId: "34567", firstName: "Elon", middleName: "D.", lastName: "Musk", prefix: "Mr.", suffix: "PhD", title: "CEO", department: "Engineering", language: "EN", gender: "female", birthday: "2000-08-12", photoUrl: "https://unavatar.io/elon-musk", leadSource: "Cold Call", fax: "+12129876543", description: "Internal champion", currentBalance: 10.5, status: "open", active: true, websites: [ { id: "12345", url: "http://example.com", type: "primary", }, { id: "12345", url: "http://example.com", type: "primary", }, { id: "12345", url: "http://example.com", type: "primary", }, ], addresses: [ { id: "123", type: "primary", string: "25 Spring Street, Blackburn, VIC 3130", name: "HQ US", line1: "Main street", line2: "apt #", line3: "Suite #", line4: "delivery instructions", streetNumber: "25", city: "San Francisco", state: "CA", postalCode: "94104", country: "US", latitude: "40.759211", longitude: "-73.984638", county: "Santa Clara", contactName: "Elon Musk", salutation: "Mr", phoneNumber: "111-111-1111", fax: "122-111-1111", email: "elon@musk.com", website: "https://elonmusk.com", notes: "Address notes or delivery instructions.", rowVersion: "1-12345", }, { id: "123", type: "primary", string: "25 Spring Street, Blackburn, VIC 3130", name: "HQ US", line1: "Main street", line2: "apt #", line3: "Suite #", line4: "delivery instructions", streetNumber: "25", city: "San Francisco", state: "CA", postalCode: "94104", country: "US", latitude: "40.759211", longitude: "-73.984638", county: "Santa Clara", contactName: "Elon Musk", salutation: "Mr", phoneNumber: "111-111-1111", fax: "122-111-1111", email: "elon@musk.com", website: "https://elonmusk.com", notes: "Address notes or delivery instructions.", rowVersion: "1-12345", }, ], socialLinks: [ { id: "12345", url: "https://www.twitter.com/apideck", type: "twitter", }, { id: "12345", url: "https://www.twitter.com/apideck", type: "twitter", }, ], phoneNumbers: [ { id: "12345", countryCode: "1", areaCode: "323", number: "111-111-1111", extension: "105", type: "primary", }, { id: "12345", countryCode: "1", areaCode: "323", number: "111-111-1111", extension: "105", type: "primary", }, { id: "12345", countryCode: "1", areaCode: "323", number: "111-111-1111", extension: "105", type: "primary", }, ], emails: [ { id: "123", email: "elon@musk.com", type: "primary", }, { id: "123", email: "elon@musk.com", type: "primary", }, ], emailDomain: "gmail.com", customFields: [ { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: {}, }, { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: { "0": {}, }, }, ], tags: [ "New", ], opportunityIds: [ "12345", ], passThrough: [ { serviceId: "", extendPaths: [ { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, ], }, ], }, }); expect(result.httpMeta.response.status).toBe(200); expect(result.updateContactResponse).toBeDefined(); expect(result.updateContactResponse).toEqual({ statusCode: 200, status: "OK", service: "zoho-crm", resource: "contacts", operation: "update", data: { id: "12345", }, }); }); test("Contacts Crm Contacts Delete", async () => { const testHttpClient = createTestHTTPClient("crm.contactsDelete"); const apideck = new Apideck({ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080", httpClient: testHttpClient, apiKey: process.env["APIDECK_API_KEY"] ?? "value", }); const result = await apideck.crm.contacts.delete({ id: "", consumerId: "test-consumer", appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", serviceId: "salesforce", }); expect(result.httpMeta.response.status).toBe(200); expect(result.deleteContactResponse).toBeDefined(); expect(result.deleteContactResponse).toEqual({ statusCode: 200, status: "OK", service: "zoho-crm", resource: "contacts", operation: "delete", data: { id: "12345", }, }); });