/* * 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("Applicants Ats Applicants All", async () => { const testHttpClient = createTestHTTPClient("ats.applicantsAll"); 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.ats.applicants.list({ consumerId: "test-consumer", appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", serviceId: "salesforce", filter: { jobId: "1234", }, passThrough: { "search": "San Francisco", }, fields: "id,updated_at", }); expect(result.httpMeta.response.status).toBe(200); expect(result.getApplicantsResponse).toBeDefined(); expect(result.getApplicantsResponse).toEqual({ statusCode: 200, status: "OK", service: "lever", resource: "Applicants", operation: "all", data: [ { id: "12345", name: "Elon Musk", firstName: "Elon", lastName: "Musk", middleName: "D.", initials: "EM", birthday: new Date("2000-08-12"), coverLetter: "I submit this application to express my sincere interest in the API developer position. In the previous role, I was responsible for leadership and ...", jobUrl: "https://democompany.recruitee.com/o/example-talent-pool", photoUrl: "https://unavatar.io/elon-musk", headline: "PepsiCo, Inc, Central Perk", title: "CEO", emails: [ { id: "123", email: "elon@musk.com", type: "primary", }, { id: "123", email: "elon@musk.com", type: "primary", }, ], customFields: [ { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: 10, }, { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: 10, }, { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: "Uses Salesforce and Marketo", }, ], 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", }, ], 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", }, ], websites: [ { id: "12345", url: "http://example.com", type: "primary", }, ], 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", }, ], stageId: "12345", recruiterId: "12345", coordinatorId: "12345", applicationIds: [ "a0d636c6-43b3-4bde-8c70-85b707d992f4", "a98lfd96-43b3-4bde-8c70-85b707d992e6", ], applications: [ "a0d636c6-43b3-4bde-8c70-85b707d992f4", "a98lfd96-43b3-4bde-8c70-85b707d992e6", ], followers: [ "a0d636c6-43b3-4bde-8c70-85b707d992f4", "a98lfd96-43b3-4bde-8c70-85b707d992e6", ], sources: [ "Job site", ], sourceId: "12345", confidential: false, anonymized: true, tags: [ "New", ], archived: false, lastInteractionAt: new Date("2020-09-30T07:43:32.000Z"), ownerId: "54321", sourcedBy: "12345", cvUrl: "https://recruitee-main.s3.eu-central-1.amazonaws.com/candidates/36615291/pdf_cv_38swhu4w42k1.pdf?response-content-disposition=inline&response-content-type=application%2Fpdf&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAQYHB7CA5RLR4Y3ON%2F20220514%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20220514T235654Z&X-Amz-Expires=36000&X-Amz-SignedHeaders=host&X-Amz-Signature=72c0621f5976db75b54de487eb821a8e73480d7f2a6a4a9713ab997944b0561f", recordUrl: "https://app.intercom.io/contacts/12345", rejectedAt: new Date("2020-09-30T07:43:32.000Z"), deleted: true, deletedBy: "12345", deletedAt: new Date("2020-09-30T07:43:32.000Z"), updatedBy: "12345", createdBy: "12345", updatedAt: new Date("2020-09-30T07:43:32.000Z"), createdAt: new Date("2020-09-30T07:43:32.000Z"), passThrough: [ { serviceId: "", extendPaths: [ { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, ], }, ], }, { id: "12345", name: "Elon Musk", firstName: "Elon", lastName: "Musk", middleName: "D.", initials: "EM", birthday: new Date("2000-08-12"), coverLetter: "I submit this application to express my sincere interest in the API developer position. In the previous role, I was responsible for leadership and ...", jobUrl: "https://democompany.recruitee.com/o/example-talent-pool", photoUrl: "https://unavatar.io/elon-musk", headline: "PepsiCo, Inc, Central Perk", title: "CEO", 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", }, ], customFields: [ { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: {}, }, { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: "Uses Salesforce and Marketo", }, ], phoneNumbers: [ { id: "12345", countryCode: "1", areaCode: "323", number: "111-111-1111", extension: "105", 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", }, ], websites: [ { id: "12345", url: "http://example.com", type: "primary", }, { id: "12345", url: "http://example.com", type: "primary", }, ], socialLinks: [ { id: "12345", url: "https://www.twitter.com/apideck", type: "twitter", }, ], stageId: "12345", recruiterId: "12345", coordinatorId: "12345", applicationIds: [ "a0d636c6-43b3-4bde-8c70-85b707d992f4", "a98lfd96-43b3-4bde-8c70-85b707d992e6", ], applications: [ "a0d636c6-43b3-4bde-8c70-85b707d992f4", "a98lfd96-43b3-4bde-8c70-85b707d992e6", ], followers: [ "a0d636c6-43b3-4bde-8c70-85b707d992f4", "a98lfd96-43b3-4bde-8c70-85b707d992e6", ], sources: [ "Job site", ], sourceId: "12345", confidential: false, anonymized: true, tags: [ "New", ], archived: false, lastInteractionAt: new Date("2020-09-30T07:43:32.000Z"), ownerId: "54321", sourcedBy: "12345", cvUrl: "https://recruitee-main.s3.eu-central-1.amazonaws.com/candidates/36615291/pdf_cv_38swhu4w42k1.pdf?response-content-disposition=inline&response-content-type=application%2Fpdf&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAQYHB7CA5RLR4Y3ON%2F20220514%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20220514T235654Z&X-Amz-Expires=36000&X-Amz-SignedHeaders=host&X-Amz-Signature=72c0621f5976db75b54de487eb821a8e73480d7f2a6a4a9713ab997944b0561f", recordUrl: "https://app.intercom.io/contacts/12345", rejectedAt: new Date("2020-09-30T07:43:32.000Z"), deleted: true, deletedBy: "12345", deletedAt: new Date("2020-09-30T07:43:32.000Z"), updatedBy: "12345", createdBy: "12345", updatedAt: new Date("2020-09-30T07:43:32.000Z"), createdAt: new Date("2020-09-30T07:43:32.000Z"), 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", }, }, }, { 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", }, }, }, ], }, ], }, { id: "12345", name: "Elon Musk", firstName: "Elon", lastName: "Musk", middleName: "D.", initials: "EM", birthday: new Date("2000-08-12"), coverLetter: "I submit this application to express my sincere interest in the API developer position. In the previous role, I was responsible for leadership and ...", jobUrl: "https://democompany.recruitee.com/o/example-talent-pool", photoUrl: "https://unavatar.io/elon-musk", headline: "PepsiCo, Inc, Central Perk", title: "CEO", emails: [ { id: "123", email: "elon@musk.com", type: "primary", }, ], customFields: [ { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: {}, }, ], 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", }, ], 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", }, ], 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", }, ], socialLinks: [ { id: "12345", url: "https://www.twitter.com/apideck", type: "twitter", }, ], stageId: "12345", recruiterId: "12345", coordinatorId: "12345", applicationIds: [ "a0d636c6-43b3-4bde-8c70-85b707d992f4", "a98lfd96-43b3-4bde-8c70-85b707d992e6", ], applications: [ "a0d636c6-43b3-4bde-8c70-85b707d992f4", "a98lfd96-43b3-4bde-8c70-85b707d992e6", ], followers: [ "a0d636c6-43b3-4bde-8c70-85b707d992f4", "a98lfd96-43b3-4bde-8c70-85b707d992e6", ], sources: [ "Job site", ], sourceId: "12345", confidential: false, anonymized: true, tags: [ "New", ], archived: false, lastInteractionAt: new Date("2020-09-30T07:43:32.000Z"), ownerId: "54321", sourcedBy: "12345", cvUrl: "https://recruitee-main.s3.eu-central-1.amazonaws.com/candidates/36615291/pdf_cv_38swhu4w42k1.pdf?response-content-disposition=inline&response-content-type=application%2Fpdf&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAQYHB7CA5RLR4Y3ON%2F20220514%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20220514T235654Z&X-Amz-Expires=36000&X-Amz-SignedHeaders=host&X-Amz-Signature=72c0621f5976db75b54de487eb821a8e73480d7f2a6a4a9713ab997944b0561f", recordUrl: "https://app.intercom.io/contacts/12345", rejectedAt: new Date("2020-09-30T07:43:32.000Z"), deleted: true, deletedBy: "12345", deletedAt: new Date("2020-09-30T07:43:32.000Z"), updatedBy: "12345", createdBy: "12345", updatedAt: new Date("2020-09-30T07:43:32.000Z"), createdAt: new Date("2020-09-30T07:43:32.000Z"), 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", }, }, }, ], }, ], }, ], 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("Applicants Ats Applicants Add", async () => { const testHttpClient = createTestHTTPClient("ats.applicantsAdd"); 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.ats.applicants.create({ consumerId: "test-consumer", appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", serviceId: "salesforce", applicant: { name: "Elon Musk", firstName: "Elon", lastName: "Musk", middleName: "D.", initials: "EM", birthday: new Date("2000-08-12"), coverLetter: "I submit this application to express my sincere interest in the API developer position. In the previous role, I was responsible for leadership and ...", photoUrl: "https://unavatar.io/elon-musk", headline: "PepsiCo, Inc, Central Perk", title: "CEO", emails: [ { id: "123", email: "elon@musk.com", type: "primary", }, { id: "123", email: "elon@musk.com", type: "primary", }, ], customFields: [ { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: true, }, { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: "Uses Salesforce and Marketo", }, ], phoneNumbers: [ { id: "12345", countryCode: "1", areaCode: "323", number: "111-111-1111", extension: "105", 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", }, ], 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", }, ], socialLinks: [ { id: "12345", url: "https://www.twitter.com/apideck", type: "twitter", }, ], stageId: "12345", recruiterId: "12345", coordinatorId: "12345", applicationIds: [ "a0d636c6-43b3-4bde-8c70-85b707d992f4", "a98lfd96-43b3-4bde-8c70-85b707d992e6", ], applications: [ "a0d636c6-43b3-4bde-8c70-85b707d992f4", "a98lfd96-43b3-4bde-8c70-85b707d992e6", ], followers: [ "a0d636c6-43b3-4bde-8c70-85b707d992f4", "a98lfd96-43b3-4bde-8c70-85b707d992e6", ], sources: [ "Job site", ], confidential: false, anonymized: true, tags: [ "New", ], archived: false, ownerId: "54321", recordUrl: "https://app.intercom.io/contacts/12345", deleted: true, passThrough: [ { serviceId: "", extendPaths: [ { path: "$.nested.property", value: { "TaxClassificationRef": { "value": "EUC-99990201-V1-00020000", }, }, }, ], }, ], }, }); expect(result.httpMeta.response.status).toBe(201); expect(result.createApplicantResponse).toBeDefined(); expect(result.createApplicantResponse).toEqual({ statusCode: 200, status: "OK", service: "lever", resource: "Applicants", operation: "add", data: { id: "12345", }, }); }); test("Applicants Ats Applicants One", async () => { const testHttpClient = createTestHTTPClient("ats.applicantsOne"); 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.ats.applicants.get({ id: "", consumerId: "test-consumer", appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", serviceId: "salesforce", fields: "id,updated_at", }); expect(result.httpMeta.response.status).toBe(200); expect(result.getApplicantResponse).toBeDefined(); expect(result.getApplicantResponse).toEqual({ statusCode: 200, status: "OK", service: "lever", resource: "Applicants", operation: "one", data: { id: "12345", name: "Elon Musk", firstName: "Elon", lastName: "Musk", middleName: "D.", initials: "EM", birthday: new Date("2000-08-12"), coverLetter: "I submit this application to express my sincere interest in the API developer position. In the previous role, I was responsible for leadership and ...", jobUrl: "https://democompany.recruitee.com/o/example-talent-pool", photoUrl: "https://unavatar.io/elon-musk", headline: "PepsiCo, Inc, Central Perk", title: "CEO", 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", }, ], customFields: [ { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: {}, }, { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: {}, }, ], 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", }, ], 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", }, ], websites: [ { id: "12345", url: "http://example.com", type: "primary", }, { id: "12345", url: "http://example.com", type: "primary", }, ], socialLinks: [ { id: "12345", url: "https://www.twitter.com/apideck", type: "twitter", }, ], stageId: "12345", recruiterId: "12345", coordinatorId: "12345", applicationIds: [ "a0d636c6-43b3-4bde-8c70-85b707d992f4", "a98lfd96-43b3-4bde-8c70-85b707d992e6", ], applications: [ "a0d636c6-43b3-4bde-8c70-85b707d992f4", "a98lfd96-43b3-4bde-8c70-85b707d992e6", ], followers: [ "a0d636c6-43b3-4bde-8c70-85b707d992f4", "a98lfd96-43b3-4bde-8c70-85b707d992e6", ], sources: [ "Job site", ], sourceId: "12345", confidential: false, anonymized: true, tags: [ "New", ], archived: false, lastInteractionAt: new Date("2020-09-30T07:43:32.000Z"), ownerId: "54321", sourcedBy: "12345", cvUrl: "https://recruitee-main.s3.eu-central-1.amazonaws.com/candidates/36615291/pdf_cv_38swhu4w42k1.pdf?response-content-disposition=inline&response-content-type=application%2Fpdf&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAQYHB7CA5RLR4Y3ON%2F20220514%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20220514T235654Z&X-Amz-Expires=36000&X-Amz-SignedHeaders=host&X-Amz-Signature=72c0621f5976db75b54de487eb821a8e73480d7f2a6a4a9713ab997944b0561f", recordUrl: "https://app.intercom.io/contacts/12345", rejectedAt: new Date("2020-09-30T07:43:32.000Z"), deleted: true, deletedBy: "12345", deletedAt: new Date("2020-09-30T07:43:32.000Z"), updatedBy: "12345", createdBy: "12345", updatedAt: new Date("2020-09-30T07:43:32.000Z"), createdAt: new Date("2020-09-30T07:43:32.000Z"), 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("Applicants Ats Applicants Update", async () => { const testHttpClient = createTestHTTPClient("ats.applicantsUpdate"); 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.ats.applicants.update({ id: "", consumerId: "test-consumer", appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", serviceId: "salesforce", applicant: { name: "Elon Musk", firstName: "Elon", lastName: "Musk", middleName: "D.", initials: "EM", birthday: new Date("2000-08-12"), coverLetter: "I submit this application to express my sincere interest in the API developer position. In the previous role, I was responsible for leadership and ...", photoUrl: "https://unavatar.io/elon-musk", headline: "PepsiCo, Inc, Central Perk", title: "CEO", 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", }, ], customFields: [ { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: true, }, { id: "2389328923893298", name: "employee_level", description: "Employee Level", value: { "0": {}, "1": {}, }, }, ], 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", }, ], 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", }, ], websites: [ { id: "12345", url: "http://example.com", type: "primary", }, ], 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", }, ], stageId: "12345", recruiterId: "12345", coordinatorId: "12345", applicationIds: [ "a0d636c6-43b3-4bde-8c70-85b707d992f4", "a98lfd96-43b3-4bde-8c70-85b707d992e6", ], applications: [ "a0d636c6-43b3-4bde-8c70-85b707d992f4", "a98lfd96-43b3-4bde-8c70-85b707d992e6", ], followers: [ "a0d636c6-43b3-4bde-8c70-85b707d992f4", "a98lfd96-43b3-4bde-8c70-85b707d992e6", ], sources: [ "Job site", ], confidential: false, anonymized: true, tags: [ "New", ], archived: false, ownerId: "54321", recordUrl: "https://app.intercom.io/contacts/12345", deleted: true, 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", }, }, }, ], }, ], }, }); expect(result.httpMeta.response.status).toBe(200); expect(result.updateApplicantResponse).toBeDefined(); expect(result.updateApplicantResponse).toEqual({ statusCode: 200, status: "OK", service: "lever", resource: "Applicants", operation: "update", data: { id: "12345", }, }); }); test("Applicants Ats Applicants Delete", async () => { const testHttpClient = createTestHTTPClient("ats.applicantsDelete"); 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.ats.applicants.delete({ id: "", consumerId: "test-consumer", appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", serviceId: "salesforce", }); expect(result.httpMeta.response.status).toBe(200); expect(result.deleteApplicantResponse).toBeDefined(); expect(result.deleteApplicantResponse).toEqual({ statusCode: 200, status: "OK", service: "lever", resource: "Applicants", operation: "delete", data: { id: "12345", }, }); });