@apideck/unify 0.40.0 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +4 -4
  3. package/lib/config.js +4 -4
  4. package/package.json +6 -2
  5. package/src/__tests__/activities.test.ts +1141 -0
  6. package/src/__tests__/agedcreditors.test.ts +280 -0
  7. package/src/__tests__/ageddebtors.test.ts +280 -0
  8. package/src/__tests__/apideckcompanies.test.ts +1082 -0
  9. package/src/__tests__/apideckcustomers.test.ts +364 -0
  10. package/src/__tests__/apideckdepartments.test.ts +497 -0
  11. package/src/__tests__/apiresources.test.ts +62 -0
  12. package/src/__tests__/apis.test.ts +216 -0
  13. package/src/__tests__/applicants.test.ts +1445 -0
  14. package/src/__tests__/applications.test.ts +515 -0
  15. package/src/__tests__/assertions.ts +13 -0
  16. package/src/__tests__/attachments.test.ts +371 -0
  17. package/src/__tests__/balancesheet.test.ts +453 -0
  18. package/src/__tests__/bankaccounts.test.ts +324 -0
  19. package/src/__tests__/bankfeedaccounts.test.ts +343 -0
  20. package/src/__tests__/bankfeedstatements.test.ts +408 -0
  21. package/src/__tests__/billpayments.test.ts +1031 -0
  22. package/src/__tests__/bills.test.ts +1630 -0
  23. package/src/__tests__/categories.test.ts +127 -0
  24. package/src/__tests__/collections.test.ts +120 -0
  25. package/src/__tests__/collectiontags.test.ts +68 -0
  26. package/src/__tests__/collectionticketcomments.test.ts +501 -0
  27. package/src/__tests__/collectiontickets.test.ts +627 -0
  28. package/src/__tests__/collectionusers.test.ts +126 -0
  29. package/src/__tests__/companies.test.ts +1642 -0
  30. package/src/__tests__/companyinfo.test.ts +219 -0
  31. package/src/__tests__/connectionconsent.test.ts +89 -0
  32. package/src/__tests__/connectionconsents.test.ts +31 -0
  33. package/src/__tests__/connectioncustommappings.test.ts +69 -0
  34. package/src/__tests__/connections.test.ts +2127 -0
  35. package/src/__tests__/connectionsettings.test.ts +687 -0
  36. package/src/__tests__/connectordocs.test.ts +29 -0
  37. package/src/__tests__/connectors.test.ts +753 -0
  38. package/src/__tests__/consumerrequestcounts.test.ts +42 -0
  39. package/src/__tests__/consumers.test.ts +523 -0
  40. package/src/__tests__/contacts.test.ts +1421 -0
  41. package/src/__tests__/createcallback.test.ts +36 -0
  42. package/src/__tests__/creditnotes.test.ts +2040 -0
  43. package/src/__tests__/customers.test.ts +1600 -0
  44. package/src/__tests__/customfields.test.ts +52 -0
  45. package/src/__tests__/custommappings.test.ts +65 -0
  46. package/src/__tests__/customobjects.test.ts +408 -0
  47. package/src/__tests__/customobjectschemas.test.ts +734 -0
  48. package/src/__tests__/departments.test.ts +529 -0
  49. package/src/__tests__/drivegroups.test.ts +496 -0
  50. package/src/__tests__/drives.test.ts +487 -0
  51. package/src/__tests__/employeepayrolls.test.ts +491 -0
  52. package/src/__tests__/employees.test.ts +2968 -0
  53. package/src/__tests__/employeeschedules.test.ts +457 -0
  54. package/src/__tests__/eventlogs.test.ts +158 -0
  55. package/src/__tests__/expensecategories.test.ts +324 -0
  56. package/src/__tests__/expensereports.test.ts +634 -0
  57. package/src/__tests__/expenses.test.ts +867 -0
  58. package/src/__tests__/files.test.ts +506 -0
  59. package/src/__tests__/files.ts +56 -0
  60. package/src/__tests__/folders.test.ts +390 -0
  61. package/src/__tests__/invoiceitems.test.ts +855 -0
  62. package/src/__tests__/invoices.test.ts +2173 -0
  63. package/src/__tests__/jobs.test.ts +1150 -0
  64. package/src/__tests__/journalentries.test.ts +1542 -0
  65. package/src/__tests__/leads.test.ts +1341 -0
  66. package/src/__tests__/ledgeraccounts.test.ts +829 -0
  67. package/src/__tests__/locations.test.ts +856 -0
  68. package/src/__tests__/logs.test.ts +137 -0
  69. package/src/__tests__/messages.test.ts +588 -0
  70. package/src/__tests__/notes.test.ts +523 -0
  71. package/src/__tests__/opportunities.test.ts +718 -0
  72. package/src/__tests__/orders.test.ts +854 -0
  73. package/src/__tests__/payments.test.ts +867 -0
  74. package/src/__tests__/payrolls.test.ts +485 -0
  75. package/src/__tests__/pipelines.test.ts +574 -0
  76. package/src/__tests__/products.test.ts +509 -0
  77. package/src/__tests__/profitandloss.test.ts +223 -0
  78. package/src/__tests__/projects.test.ts +480 -0
  79. package/src/__tests__/proxy.test.ts +41 -0
  80. package/src/__tests__/purchaseorders.test.ts +2139 -0
  81. package/src/__tests__/quotes.test.ts +678 -0
  82. package/src/__tests__/refunds.test.ts +812 -0
  83. package/src/__tests__/sessions.test.ts +72 -0
  84. package/src/__tests__/sharedlinks.test.ts +511 -0
  85. package/src/__tests__/stores.test.ts +41 -0
  86. package/src/__tests__/subsidiaries.test.ts +496 -0
  87. package/src/__tests__/suppliers.test.ts +1574 -0
  88. package/src/__tests__/taxrates.test.ts +701 -0
  89. package/src/__tests__/testclient.ts +48 -0
  90. package/src/__tests__/timeoffrequests.test.ts +588 -0
  91. package/src/__tests__/trackingcategories.test.ts +515 -0
  92. package/src/__tests__/uploadsessions.test.ts +221 -0
  93. package/src/__tests__/users.test.ts +1020 -0
  94. package/src/__tests__/validateconnection.test.ts +34 -0
  95. package/src/__tests__/webhooks.test.ts +254 -0
  96. package/src/lib/config.ts +4 -4
@@ -0,0 +1,1445 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { expect, test } from "vitest";
6
+ import { Apideck } from "../index.js";
7
+ import { createTestHTTPClient } from "./testclient.js";
8
+
9
+ test("Applicants Ats Applicants All", async () => {
10
+ const testHttpClient = createTestHTTPClient("ats.applicantsAll");
11
+
12
+ const apideck = new Apideck({
13
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
14
+ httpClient: testHttpClient,
15
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
16
+ });
17
+
18
+ const result = await apideck.ats.applicants.list({
19
+ consumerId: "test-consumer",
20
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
21
+ serviceId: "salesforce",
22
+ filter: {
23
+ jobId: "1234",
24
+ },
25
+ passThrough: {
26
+ "search": "San Francisco",
27
+ },
28
+ fields: "id,updated_at",
29
+ });
30
+ expect(result.httpMeta.response.status).toBe(200);
31
+ expect(result.getApplicantsResponse).toBeDefined();
32
+ expect(result.getApplicantsResponse).toEqual({
33
+ statusCode: 200,
34
+ status: "OK",
35
+ service: "lever",
36
+ resource: "Applicants",
37
+ operation: "all",
38
+ data: [
39
+ {
40
+ id: "12345",
41
+ name: "Elon Musk",
42
+ firstName: "Elon",
43
+ lastName: "Musk",
44
+ middleName: "D.",
45
+ initials: "EM",
46
+ birthday: new Date("2000-08-12"),
47
+ coverLetter:
48
+ "I submit this application to express my sincere interest in the API developer position. In the previous role, I was responsible for leadership and ...",
49
+ jobUrl: "https://democompany.recruitee.com/o/example-talent-pool",
50
+ photoUrl: "https://unavatar.io/elon-musk",
51
+ headline: "PepsiCo, Inc, Central Perk",
52
+ title: "CEO",
53
+ emails: [
54
+ {
55
+ id: "123",
56
+ email: "elon@musk.com",
57
+ type: "primary",
58
+ },
59
+ {
60
+ id: "123",
61
+ email: "elon@musk.com",
62
+ type: "primary",
63
+ },
64
+ ],
65
+ customFields: [
66
+ {
67
+ id: "2389328923893298",
68
+ name: "employee_level",
69
+ description: "Employee Level",
70
+ value: 10,
71
+ },
72
+ {
73
+ id: "2389328923893298",
74
+ name: "employee_level",
75
+ description: "Employee Level",
76
+ value: 10,
77
+ },
78
+ {
79
+ id: "2389328923893298",
80
+ name: "employee_level",
81
+ description: "Employee Level",
82
+ value: "Uses Salesforce and Marketo",
83
+ },
84
+ ],
85
+ phoneNumbers: [
86
+ {
87
+ id: "12345",
88
+ countryCode: "1",
89
+ areaCode: "323",
90
+ number: "111-111-1111",
91
+ extension: "105",
92
+ type: "primary",
93
+ },
94
+ {
95
+ id: "12345",
96
+ countryCode: "1",
97
+ areaCode: "323",
98
+ number: "111-111-1111",
99
+ extension: "105",
100
+ type: "primary",
101
+ },
102
+ ],
103
+ addresses: [
104
+ {
105
+ id: "123",
106
+ type: "primary",
107
+ string: "25 Spring Street, Blackburn, VIC 3130",
108
+ name: "HQ US",
109
+ line1: "Main street",
110
+ line2: "apt #",
111
+ line3: "Suite #",
112
+ line4: "delivery instructions",
113
+ streetNumber: "25",
114
+ city: "San Francisco",
115
+ state: "CA",
116
+ postalCode: "94104",
117
+ country: "US",
118
+ latitude: "40.759211",
119
+ longitude: "-73.984638",
120
+ county: "Santa Clara",
121
+ contactName: "Elon Musk",
122
+ salutation: "Mr",
123
+ phoneNumber: "111-111-1111",
124
+ fax: "122-111-1111",
125
+ email: "elon@musk.com",
126
+ website: "https://elonmusk.com",
127
+ notes: "Address notes or delivery instructions.",
128
+ rowVersion: "1-12345",
129
+ },
130
+ {
131
+ id: "123",
132
+ type: "primary",
133
+ string: "25 Spring Street, Blackburn, VIC 3130",
134
+ name: "HQ US",
135
+ line1: "Main street",
136
+ line2: "apt #",
137
+ line3: "Suite #",
138
+ line4: "delivery instructions",
139
+ streetNumber: "25",
140
+ city: "San Francisco",
141
+ state: "CA",
142
+ postalCode: "94104",
143
+ country: "US",
144
+ latitude: "40.759211",
145
+ longitude: "-73.984638",
146
+ county: "Santa Clara",
147
+ contactName: "Elon Musk",
148
+ salutation: "Mr",
149
+ phoneNumber: "111-111-1111",
150
+ fax: "122-111-1111",
151
+ email: "elon@musk.com",
152
+ website: "https://elonmusk.com",
153
+ notes: "Address notes or delivery instructions.",
154
+ rowVersion: "1-12345",
155
+ },
156
+ ],
157
+ websites: [
158
+ {
159
+ id: "12345",
160
+ url: "http://example.com",
161
+ type: "primary",
162
+ },
163
+ ],
164
+ socialLinks: [
165
+ {
166
+ id: "12345",
167
+ url: "https://www.twitter.com/apideck",
168
+ type: "twitter",
169
+ },
170
+ {
171
+ id: "12345",
172
+ url: "https://www.twitter.com/apideck",
173
+ type: "twitter",
174
+ },
175
+ {
176
+ id: "12345",
177
+ url: "https://www.twitter.com/apideck",
178
+ type: "twitter",
179
+ },
180
+ ],
181
+ stageId: "12345",
182
+ recruiterId: "12345",
183
+ coordinatorId: "12345",
184
+ applicationIds: [
185
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
186
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
187
+ ],
188
+ applications: [
189
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
190
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
191
+ ],
192
+ followers: [
193
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
194
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
195
+ ],
196
+ sources: [
197
+ "Job site",
198
+ ],
199
+ sourceId: "12345",
200
+ confidential: false,
201
+ anonymized: true,
202
+ tags: [
203
+ "New",
204
+ ],
205
+ archived: false,
206
+ lastInteractionAt: new Date("2020-09-30T07:43:32.000Z"),
207
+ ownerId: "54321",
208
+ sourcedBy: "12345",
209
+ cvUrl:
210
+ "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",
211
+ recordUrl: "https://app.intercom.io/contacts/12345",
212
+ rejectedAt: new Date("2020-09-30T07:43:32.000Z"),
213
+ deleted: true,
214
+ deletedBy: "12345",
215
+ deletedAt: new Date("2020-09-30T07:43:32.000Z"),
216
+ updatedBy: "12345",
217
+ createdBy: "12345",
218
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
219
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
220
+ passThrough: [
221
+ {
222
+ serviceId: "<id>",
223
+ extendPaths: [
224
+ {
225
+ path: "$.nested.property",
226
+ value: {
227
+ "TaxClassificationRef": {
228
+ "value": "EUC-99990201-V1-00020000",
229
+ },
230
+ },
231
+ },
232
+ ],
233
+ },
234
+ ],
235
+ },
236
+ {
237
+ id: "12345",
238
+ name: "Elon Musk",
239
+ firstName: "Elon",
240
+ lastName: "Musk",
241
+ middleName: "D.",
242
+ initials: "EM",
243
+ birthday: new Date("2000-08-12"),
244
+ coverLetter:
245
+ "I submit this application to express my sincere interest in the API developer position. In the previous role, I was responsible for leadership and ...",
246
+ jobUrl: "https://democompany.recruitee.com/o/example-talent-pool",
247
+ photoUrl: "https://unavatar.io/elon-musk",
248
+ headline: "PepsiCo, Inc, Central Perk",
249
+ title: "CEO",
250
+ emails: [
251
+ {
252
+ id: "123",
253
+ email: "elon@musk.com",
254
+ type: "primary",
255
+ },
256
+ {
257
+ id: "123",
258
+ email: "elon@musk.com",
259
+ type: "primary",
260
+ },
261
+ {
262
+ id: "123",
263
+ email: "elon@musk.com",
264
+ type: "primary",
265
+ },
266
+ ],
267
+ customFields: [
268
+ {
269
+ id: "2389328923893298",
270
+ name: "employee_level",
271
+ description: "Employee Level",
272
+ value: {},
273
+ },
274
+ {
275
+ id: "2389328923893298",
276
+ name: "employee_level",
277
+ description: "Employee Level",
278
+ value: "Uses Salesforce and Marketo",
279
+ },
280
+ ],
281
+ phoneNumbers: [
282
+ {
283
+ id: "12345",
284
+ countryCode: "1",
285
+ areaCode: "323",
286
+ number: "111-111-1111",
287
+ extension: "105",
288
+ type: "primary",
289
+ },
290
+ ],
291
+ addresses: [
292
+ {
293
+ id: "123",
294
+ type: "primary",
295
+ string: "25 Spring Street, Blackburn, VIC 3130",
296
+ name: "HQ US",
297
+ line1: "Main street",
298
+ line2: "apt #",
299
+ line3: "Suite #",
300
+ line4: "delivery instructions",
301
+ streetNumber: "25",
302
+ city: "San Francisco",
303
+ state: "CA",
304
+ postalCode: "94104",
305
+ country: "US",
306
+ latitude: "40.759211",
307
+ longitude: "-73.984638",
308
+ county: "Santa Clara",
309
+ contactName: "Elon Musk",
310
+ salutation: "Mr",
311
+ phoneNumber: "111-111-1111",
312
+ fax: "122-111-1111",
313
+ email: "elon@musk.com",
314
+ website: "https://elonmusk.com",
315
+ notes: "Address notes or delivery instructions.",
316
+ rowVersion: "1-12345",
317
+ },
318
+ {
319
+ id: "123",
320
+ type: "primary",
321
+ string: "25 Spring Street, Blackburn, VIC 3130",
322
+ name: "HQ US",
323
+ line1: "Main street",
324
+ line2: "apt #",
325
+ line3: "Suite #",
326
+ line4: "delivery instructions",
327
+ streetNumber: "25",
328
+ city: "San Francisco",
329
+ state: "CA",
330
+ postalCode: "94104",
331
+ country: "US",
332
+ latitude: "40.759211",
333
+ longitude: "-73.984638",
334
+ county: "Santa Clara",
335
+ contactName: "Elon Musk",
336
+ salutation: "Mr",
337
+ phoneNumber: "111-111-1111",
338
+ fax: "122-111-1111",
339
+ email: "elon@musk.com",
340
+ website: "https://elonmusk.com",
341
+ notes: "Address notes or delivery instructions.",
342
+ rowVersion: "1-12345",
343
+ },
344
+ ],
345
+ websites: [
346
+ {
347
+ id: "12345",
348
+ url: "http://example.com",
349
+ type: "primary",
350
+ },
351
+ {
352
+ id: "12345",
353
+ url: "http://example.com",
354
+ type: "primary",
355
+ },
356
+ ],
357
+ socialLinks: [
358
+ {
359
+ id: "12345",
360
+ url: "https://www.twitter.com/apideck",
361
+ type: "twitter",
362
+ },
363
+ ],
364
+ stageId: "12345",
365
+ recruiterId: "12345",
366
+ coordinatorId: "12345",
367
+ applicationIds: [
368
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
369
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
370
+ ],
371
+ applications: [
372
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
373
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
374
+ ],
375
+ followers: [
376
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
377
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
378
+ ],
379
+ sources: [
380
+ "Job site",
381
+ ],
382
+ sourceId: "12345",
383
+ confidential: false,
384
+ anonymized: true,
385
+ tags: [
386
+ "New",
387
+ ],
388
+ archived: false,
389
+ lastInteractionAt: new Date("2020-09-30T07:43:32.000Z"),
390
+ ownerId: "54321",
391
+ sourcedBy: "12345",
392
+ cvUrl:
393
+ "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",
394
+ recordUrl: "https://app.intercom.io/contacts/12345",
395
+ rejectedAt: new Date("2020-09-30T07:43:32.000Z"),
396
+ deleted: true,
397
+ deletedBy: "12345",
398
+ deletedAt: new Date("2020-09-30T07:43:32.000Z"),
399
+ updatedBy: "12345",
400
+ createdBy: "12345",
401
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
402
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
403
+ passThrough: [
404
+ {
405
+ serviceId: "<id>",
406
+ extendPaths: [
407
+ {
408
+ path: "$.nested.property",
409
+ value: {
410
+ "TaxClassificationRef": {
411
+ "value": "EUC-99990201-V1-00020000",
412
+ },
413
+ },
414
+ },
415
+ {
416
+ path: "$.nested.property",
417
+ value: {
418
+ "TaxClassificationRef": {
419
+ "value": "EUC-99990201-V1-00020000",
420
+ },
421
+ },
422
+ },
423
+ ],
424
+ },
425
+ {
426
+ serviceId: "<id>",
427
+ extendPaths: [
428
+ {
429
+ path: "$.nested.property",
430
+ value: {
431
+ "TaxClassificationRef": {
432
+ "value": "EUC-99990201-V1-00020000",
433
+ },
434
+ },
435
+ },
436
+ {
437
+ path: "$.nested.property",
438
+ value: {
439
+ "TaxClassificationRef": {
440
+ "value": "EUC-99990201-V1-00020000",
441
+ },
442
+ },
443
+ },
444
+ {
445
+ path: "$.nested.property",
446
+ value: {
447
+ "TaxClassificationRef": {
448
+ "value": "EUC-99990201-V1-00020000",
449
+ },
450
+ },
451
+ },
452
+ ],
453
+ },
454
+ {
455
+ serviceId: "<id>",
456
+ extendPaths: [
457
+ {
458
+ path: "$.nested.property",
459
+ value: {
460
+ "TaxClassificationRef": {
461
+ "value": "EUC-99990201-V1-00020000",
462
+ },
463
+ },
464
+ },
465
+ {
466
+ path: "$.nested.property",
467
+ value: {
468
+ "TaxClassificationRef": {
469
+ "value": "EUC-99990201-V1-00020000",
470
+ },
471
+ },
472
+ },
473
+ ],
474
+ },
475
+ ],
476
+ },
477
+ {
478
+ id: "12345",
479
+ name: "Elon Musk",
480
+ firstName: "Elon",
481
+ lastName: "Musk",
482
+ middleName: "D.",
483
+ initials: "EM",
484
+ birthday: new Date("2000-08-12"),
485
+ coverLetter:
486
+ "I submit this application to express my sincere interest in the API developer position. In the previous role, I was responsible for leadership and ...",
487
+ jobUrl: "https://democompany.recruitee.com/o/example-talent-pool",
488
+ photoUrl: "https://unavatar.io/elon-musk",
489
+ headline: "PepsiCo, Inc, Central Perk",
490
+ title: "CEO",
491
+ emails: [
492
+ {
493
+ id: "123",
494
+ email: "elon@musk.com",
495
+ type: "primary",
496
+ },
497
+ ],
498
+ customFields: [
499
+ {
500
+ id: "2389328923893298",
501
+ name: "employee_level",
502
+ description: "Employee Level",
503
+ value: {},
504
+ },
505
+ ],
506
+ phoneNumbers: [
507
+ {
508
+ id: "12345",
509
+ countryCode: "1",
510
+ areaCode: "323",
511
+ number: "111-111-1111",
512
+ extension: "105",
513
+ type: "primary",
514
+ },
515
+ {
516
+ id: "12345",
517
+ countryCode: "1",
518
+ areaCode: "323",
519
+ number: "111-111-1111",
520
+ extension: "105",
521
+ type: "primary",
522
+ },
523
+ {
524
+ id: "12345",
525
+ countryCode: "1",
526
+ areaCode: "323",
527
+ number: "111-111-1111",
528
+ extension: "105",
529
+ type: "primary",
530
+ },
531
+ ],
532
+ addresses: [
533
+ {
534
+ id: "123",
535
+ type: "primary",
536
+ string: "25 Spring Street, Blackburn, VIC 3130",
537
+ name: "HQ US",
538
+ line1: "Main street",
539
+ line2: "apt #",
540
+ line3: "Suite #",
541
+ line4: "delivery instructions",
542
+ streetNumber: "25",
543
+ city: "San Francisco",
544
+ state: "CA",
545
+ postalCode: "94104",
546
+ country: "US",
547
+ latitude: "40.759211",
548
+ longitude: "-73.984638",
549
+ county: "Santa Clara",
550
+ contactName: "Elon Musk",
551
+ salutation: "Mr",
552
+ phoneNumber: "111-111-1111",
553
+ fax: "122-111-1111",
554
+ email: "elon@musk.com",
555
+ website: "https://elonmusk.com",
556
+ notes: "Address notes or delivery instructions.",
557
+ rowVersion: "1-12345",
558
+ },
559
+ {
560
+ id: "123",
561
+ type: "primary",
562
+ string: "25 Spring Street, Blackburn, VIC 3130",
563
+ name: "HQ US",
564
+ line1: "Main street",
565
+ line2: "apt #",
566
+ line3: "Suite #",
567
+ line4: "delivery instructions",
568
+ streetNumber: "25",
569
+ city: "San Francisco",
570
+ state: "CA",
571
+ postalCode: "94104",
572
+ country: "US",
573
+ latitude: "40.759211",
574
+ longitude: "-73.984638",
575
+ county: "Santa Clara",
576
+ contactName: "Elon Musk",
577
+ salutation: "Mr",
578
+ phoneNumber: "111-111-1111",
579
+ fax: "122-111-1111",
580
+ email: "elon@musk.com",
581
+ website: "https://elonmusk.com",
582
+ notes: "Address notes or delivery instructions.",
583
+ rowVersion: "1-12345",
584
+ },
585
+ ],
586
+ websites: [
587
+ {
588
+ id: "12345",
589
+ url: "http://example.com",
590
+ type: "primary",
591
+ },
592
+ {
593
+ id: "12345",
594
+ url: "http://example.com",
595
+ type: "primary",
596
+ },
597
+ {
598
+ id: "12345",
599
+ url: "http://example.com",
600
+ type: "primary",
601
+ },
602
+ ],
603
+ socialLinks: [
604
+ {
605
+ id: "12345",
606
+ url: "https://www.twitter.com/apideck",
607
+ type: "twitter",
608
+ },
609
+ ],
610
+ stageId: "12345",
611
+ recruiterId: "12345",
612
+ coordinatorId: "12345",
613
+ applicationIds: [
614
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
615
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
616
+ ],
617
+ applications: [
618
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
619
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
620
+ ],
621
+ followers: [
622
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
623
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
624
+ ],
625
+ sources: [
626
+ "Job site",
627
+ ],
628
+ sourceId: "12345",
629
+ confidential: false,
630
+ anonymized: true,
631
+ tags: [
632
+ "New",
633
+ ],
634
+ archived: false,
635
+ lastInteractionAt: new Date("2020-09-30T07:43:32.000Z"),
636
+ ownerId: "54321",
637
+ sourcedBy: "12345",
638
+ cvUrl:
639
+ "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",
640
+ recordUrl: "https://app.intercom.io/contacts/12345",
641
+ rejectedAt: new Date("2020-09-30T07:43:32.000Z"),
642
+ deleted: true,
643
+ deletedBy: "12345",
644
+ deletedAt: new Date("2020-09-30T07:43:32.000Z"),
645
+ updatedBy: "12345",
646
+ createdBy: "12345",
647
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
648
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
649
+ passThrough: [
650
+ {
651
+ serviceId: "<id>",
652
+ extendPaths: [
653
+ {
654
+ path: "$.nested.property",
655
+ value: {
656
+ "TaxClassificationRef": {
657
+ "value": "EUC-99990201-V1-00020000",
658
+ },
659
+ },
660
+ },
661
+ {
662
+ path: "$.nested.property",
663
+ value: {
664
+ "TaxClassificationRef": {
665
+ "value": "EUC-99990201-V1-00020000",
666
+ },
667
+ },
668
+ },
669
+ {
670
+ path: "$.nested.property",
671
+ value: {
672
+ "TaxClassificationRef": {
673
+ "value": "EUC-99990201-V1-00020000",
674
+ },
675
+ },
676
+ },
677
+ ],
678
+ },
679
+ ],
680
+ },
681
+ ],
682
+ meta: {
683
+ itemsOnPage: 50,
684
+ cursors: {
685
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
686
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
687
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
688
+ },
689
+ },
690
+ links: {
691
+ previous:
692
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
693
+ current: "https://unify.apideck.com/crm/companies",
694
+ next:
695
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
696
+ },
697
+ });
698
+ });
699
+
700
+ test("Applicants Ats Applicants Add", async () => {
701
+ const testHttpClient = createTestHTTPClient("ats.applicantsAdd");
702
+
703
+ const apideck = new Apideck({
704
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
705
+ httpClient: testHttpClient,
706
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
707
+ });
708
+
709
+ const result = await apideck.ats.applicants.create({
710
+ consumerId: "test-consumer",
711
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
712
+ serviceId: "salesforce",
713
+ applicant: {
714
+ name: "Elon Musk",
715
+ firstName: "Elon",
716
+ lastName: "Musk",
717
+ middleName: "D.",
718
+ initials: "EM",
719
+ birthday: new Date("2000-08-12"),
720
+ coverLetter:
721
+ "I submit this application to express my sincere interest in the API developer position. In the previous role, I was responsible for leadership and ...",
722
+ photoUrl: "https://unavatar.io/elon-musk",
723
+ headline: "PepsiCo, Inc, Central Perk",
724
+ title: "CEO",
725
+ emails: [
726
+ {
727
+ id: "123",
728
+ email: "elon@musk.com",
729
+ type: "primary",
730
+ },
731
+ {
732
+ id: "123",
733
+ email: "elon@musk.com",
734
+ type: "primary",
735
+ },
736
+ ],
737
+ customFields: [
738
+ {
739
+ id: "2389328923893298",
740
+ name: "employee_level",
741
+ description: "Employee Level",
742
+ value: true,
743
+ },
744
+ {
745
+ id: "2389328923893298",
746
+ name: "employee_level",
747
+ description: "Employee Level",
748
+ value: "Uses Salesforce and Marketo",
749
+ },
750
+ ],
751
+ phoneNumbers: [
752
+ {
753
+ id: "12345",
754
+ countryCode: "1",
755
+ areaCode: "323",
756
+ number: "111-111-1111",
757
+ extension: "105",
758
+ type: "primary",
759
+ },
760
+ ],
761
+ addresses: [
762
+ {
763
+ id: "123",
764
+ type: "primary",
765
+ string: "25 Spring Street, Blackburn, VIC 3130",
766
+ name: "HQ US",
767
+ line1: "Main street",
768
+ line2: "apt #",
769
+ line3: "Suite #",
770
+ line4: "delivery instructions",
771
+ streetNumber: "25",
772
+ city: "San Francisco",
773
+ state: "CA",
774
+ postalCode: "94104",
775
+ country: "US",
776
+ latitude: "40.759211",
777
+ longitude: "-73.984638",
778
+ county: "Santa Clara",
779
+ contactName: "Elon Musk",
780
+ salutation: "Mr",
781
+ phoneNumber: "111-111-1111",
782
+ fax: "122-111-1111",
783
+ email: "elon@musk.com",
784
+ website: "https://elonmusk.com",
785
+ notes: "Address notes or delivery instructions.",
786
+ rowVersion: "1-12345",
787
+ },
788
+ {
789
+ id: "123",
790
+ type: "primary",
791
+ string: "25 Spring Street, Blackburn, VIC 3130",
792
+ name: "HQ US",
793
+ line1: "Main street",
794
+ line2: "apt #",
795
+ line3: "Suite #",
796
+ line4: "delivery instructions",
797
+ streetNumber: "25",
798
+ city: "San Francisco",
799
+ state: "CA",
800
+ postalCode: "94104",
801
+ country: "US",
802
+ latitude: "40.759211",
803
+ longitude: "-73.984638",
804
+ county: "Santa Clara",
805
+ contactName: "Elon Musk",
806
+ salutation: "Mr",
807
+ phoneNumber: "111-111-1111",
808
+ fax: "122-111-1111",
809
+ email: "elon@musk.com",
810
+ website: "https://elonmusk.com",
811
+ notes: "Address notes or delivery instructions.",
812
+ rowVersion: "1-12345",
813
+ },
814
+ {
815
+ id: "123",
816
+ type: "primary",
817
+ string: "25 Spring Street, Blackburn, VIC 3130",
818
+ name: "HQ US",
819
+ line1: "Main street",
820
+ line2: "apt #",
821
+ line3: "Suite #",
822
+ line4: "delivery instructions",
823
+ streetNumber: "25",
824
+ city: "San Francisco",
825
+ state: "CA",
826
+ postalCode: "94104",
827
+ country: "US",
828
+ latitude: "40.759211",
829
+ longitude: "-73.984638",
830
+ county: "Santa Clara",
831
+ contactName: "Elon Musk",
832
+ salutation: "Mr",
833
+ phoneNumber: "111-111-1111",
834
+ fax: "122-111-1111",
835
+ email: "elon@musk.com",
836
+ website: "https://elonmusk.com",
837
+ notes: "Address notes or delivery instructions.",
838
+ rowVersion: "1-12345",
839
+ },
840
+ ],
841
+ websites: [
842
+ {
843
+ id: "12345",
844
+ url: "http://example.com",
845
+ type: "primary",
846
+ },
847
+ {
848
+ id: "12345",
849
+ url: "http://example.com",
850
+ type: "primary",
851
+ },
852
+ {
853
+ id: "12345",
854
+ url: "http://example.com",
855
+ type: "primary",
856
+ },
857
+ ],
858
+ socialLinks: [
859
+ {
860
+ id: "12345",
861
+ url: "https://www.twitter.com/apideck",
862
+ type: "twitter",
863
+ },
864
+ ],
865
+ stageId: "12345",
866
+ recruiterId: "12345",
867
+ coordinatorId: "12345",
868
+ applicationIds: [
869
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
870
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
871
+ ],
872
+ applications: [
873
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
874
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
875
+ ],
876
+ followers: [
877
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
878
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
879
+ ],
880
+ sources: [
881
+ "Job site",
882
+ ],
883
+ confidential: false,
884
+ anonymized: true,
885
+ tags: [
886
+ "New",
887
+ ],
888
+ archived: false,
889
+ ownerId: "54321",
890
+ recordUrl: "https://app.intercom.io/contacts/12345",
891
+ deleted: true,
892
+ passThrough: [
893
+ {
894
+ serviceId: "<id>",
895
+ extendPaths: [
896
+ {
897
+ path: "$.nested.property",
898
+ value: {
899
+ "TaxClassificationRef": {
900
+ "value": "EUC-99990201-V1-00020000",
901
+ },
902
+ },
903
+ },
904
+ ],
905
+ },
906
+ ],
907
+ },
908
+ });
909
+ expect(result.httpMeta.response.status).toBe(201);
910
+ expect(result.createApplicantResponse).toBeDefined();
911
+ expect(result.createApplicantResponse).toEqual({
912
+ statusCode: 200,
913
+ status: "OK",
914
+ service: "lever",
915
+ resource: "Applicants",
916
+ operation: "add",
917
+ data: {
918
+ id: "12345",
919
+ },
920
+ });
921
+ });
922
+
923
+ test("Applicants Ats Applicants One", async () => {
924
+ const testHttpClient = createTestHTTPClient("ats.applicantsOne");
925
+
926
+ const apideck = new Apideck({
927
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
928
+ httpClient: testHttpClient,
929
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
930
+ });
931
+
932
+ const result = await apideck.ats.applicants.get({
933
+ id: "<id>",
934
+ consumerId: "test-consumer",
935
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
936
+ serviceId: "salesforce",
937
+ fields: "id,updated_at",
938
+ });
939
+ expect(result.httpMeta.response.status).toBe(200);
940
+ expect(result.getApplicantResponse).toBeDefined();
941
+ expect(result.getApplicantResponse).toEqual({
942
+ statusCode: 200,
943
+ status: "OK",
944
+ service: "lever",
945
+ resource: "Applicants",
946
+ operation: "one",
947
+ data: {
948
+ id: "12345",
949
+ name: "Elon Musk",
950
+ firstName: "Elon",
951
+ lastName: "Musk",
952
+ middleName: "D.",
953
+ initials: "EM",
954
+ birthday: new Date("2000-08-12"),
955
+ coverLetter:
956
+ "I submit this application to express my sincere interest in the API developer position. In the previous role, I was responsible for leadership and ...",
957
+ jobUrl: "https://democompany.recruitee.com/o/example-talent-pool",
958
+ photoUrl: "https://unavatar.io/elon-musk",
959
+ headline: "PepsiCo, Inc, Central Perk",
960
+ title: "CEO",
961
+ emails: [
962
+ {
963
+ id: "123",
964
+ email: "elon@musk.com",
965
+ type: "primary",
966
+ },
967
+ {
968
+ id: "123",
969
+ email: "elon@musk.com",
970
+ type: "primary",
971
+ },
972
+ {
973
+ id: "123",
974
+ email: "elon@musk.com",
975
+ type: "primary",
976
+ },
977
+ ],
978
+ customFields: [
979
+ {
980
+ id: "2389328923893298",
981
+ name: "employee_level",
982
+ description: "Employee Level",
983
+ value: {},
984
+ },
985
+ {
986
+ id: "2389328923893298",
987
+ name: "employee_level",
988
+ description: "Employee Level",
989
+ value: {},
990
+ },
991
+ ],
992
+ phoneNumbers: [
993
+ {
994
+ id: "12345",
995
+ countryCode: "1",
996
+ areaCode: "323",
997
+ number: "111-111-1111",
998
+ extension: "105",
999
+ type: "primary",
1000
+ },
1001
+ {
1002
+ id: "12345",
1003
+ countryCode: "1",
1004
+ areaCode: "323",
1005
+ number: "111-111-1111",
1006
+ extension: "105",
1007
+ type: "primary",
1008
+ },
1009
+ {
1010
+ id: "12345",
1011
+ countryCode: "1",
1012
+ areaCode: "323",
1013
+ number: "111-111-1111",
1014
+ extension: "105",
1015
+ type: "primary",
1016
+ },
1017
+ ],
1018
+ addresses: [
1019
+ {
1020
+ id: "123",
1021
+ type: "primary",
1022
+ string: "25 Spring Street, Blackburn, VIC 3130",
1023
+ name: "HQ US",
1024
+ line1: "Main street",
1025
+ line2: "apt #",
1026
+ line3: "Suite #",
1027
+ line4: "delivery instructions",
1028
+ streetNumber: "25",
1029
+ city: "San Francisco",
1030
+ state: "CA",
1031
+ postalCode: "94104",
1032
+ country: "US",
1033
+ latitude: "40.759211",
1034
+ longitude: "-73.984638",
1035
+ county: "Santa Clara",
1036
+ contactName: "Elon Musk",
1037
+ salutation: "Mr",
1038
+ phoneNumber: "111-111-1111",
1039
+ fax: "122-111-1111",
1040
+ email: "elon@musk.com",
1041
+ website: "https://elonmusk.com",
1042
+ notes: "Address notes or delivery instructions.",
1043
+ rowVersion: "1-12345",
1044
+ },
1045
+ {
1046
+ id: "123",
1047
+ type: "primary",
1048
+ string: "25 Spring Street, Blackburn, VIC 3130",
1049
+ name: "HQ US",
1050
+ line1: "Main street",
1051
+ line2: "apt #",
1052
+ line3: "Suite #",
1053
+ line4: "delivery instructions",
1054
+ streetNumber: "25",
1055
+ city: "San Francisco",
1056
+ state: "CA",
1057
+ postalCode: "94104",
1058
+ country: "US",
1059
+ latitude: "40.759211",
1060
+ longitude: "-73.984638",
1061
+ county: "Santa Clara",
1062
+ contactName: "Elon Musk",
1063
+ salutation: "Mr",
1064
+ phoneNumber: "111-111-1111",
1065
+ fax: "122-111-1111",
1066
+ email: "elon@musk.com",
1067
+ website: "https://elonmusk.com",
1068
+ notes: "Address notes or delivery instructions.",
1069
+ rowVersion: "1-12345",
1070
+ },
1071
+ ],
1072
+ websites: [
1073
+ {
1074
+ id: "12345",
1075
+ url: "http://example.com",
1076
+ type: "primary",
1077
+ },
1078
+ {
1079
+ id: "12345",
1080
+ url: "http://example.com",
1081
+ type: "primary",
1082
+ },
1083
+ ],
1084
+ socialLinks: [
1085
+ {
1086
+ id: "12345",
1087
+ url: "https://www.twitter.com/apideck",
1088
+ type: "twitter",
1089
+ },
1090
+ ],
1091
+ stageId: "12345",
1092
+ recruiterId: "12345",
1093
+ coordinatorId: "12345",
1094
+ applicationIds: [
1095
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
1096
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
1097
+ ],
1098
+ applications: [
1099
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
1100
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
1101
+ ],
1102
+ followers: [
1103
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
1104
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
1105
+ ],
1106
+ sources: [
1107
+ "Job site",
1108
+ ],
1109
+ sourceId: "12345",
1110
+ confidential: false,
1111
+ anonymized: true,
1112
+ tags: [
1113
+ "New",
1114
+ ],
1115
+ archived: false,
1116
+ lastInteractionAt: new Date("2020-09-30T07:43:32.000Z"),
1117
+ ownerId: "54321",
1118
+ sourcedBy: "12345",
1119
+ cvUrl:
1120
+ "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",
1121
+ recordUrl: "https://app.intercom.io/contacts/12345",
1122
+ rejectedAt: new Date("2020-09-30T07:43:32.000Z"),
1123
+ deleted: true,
1124
+ deletedBy: "12345",
1125
+ deletedAt: new Date("2020-09-30T07:43:32.000Z"),
1126
+ updatedBy: "12345",
1127
+ createdBy: "12345",
1128
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
1129
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
1130
+ passThrough: [
1131
+ {
1132
+ serviceId: "<id>",
1133
+ extendPaths: [
1134
+ {
1135
+ path: "$.nested.property",
1136
+ value: {
1137
+ "TaxClassificationRef": {
1138
+ "value": "EUC-99990201-V1-00020000",
1139
+ },
1140
+ },
1141
+ },
1142
+ {
1143
+ path: "$.nested.property",
1144
+ value: {
1145
+ "TaxClassificationRef": {
1146
+ "value": "EUC-99990201-V1-00020000",
1147
+ },
1148
+ },
1149
+ },
1150
+ {
1151
+ path: "$.nested.property",
1152
+ value: {
1153
+ "TaxClassificationRef": {
1154
+ "value": "EUC-99990201-V1-00020000",
1155
+ },
1156
+ },
1157
+ },
1158
+ ],
1159
+ },
1160
+ ],
1161
+ },
1162
+ });
1163
+ });
1164
+
1165
+ test("Applicants Ats Applicants Update", async () => {
1166
+ const testHttpClient = createTestHTTPClient("ats.applicantsUpdate");
1167
+
1168
+ const apideck = new Apideck({
1169
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1170
+ httpClient: testHttpClient,
1171
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
1172
+ });
1173
+
1174
+ const result = await apideck.ats.applicants.update({
1175
+ id: "<id>",
1176
+ consumerId: "test-consumer",
1177
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
1178
+ serviceId: "salesforce",
1179
+ applicant: {
1180
+ name: "Elon Musk",
1181
+ firstName: "Elon",
1182
+ lastName: "Musk",
1183
+ middleName: "D.",
1184
+ initials: "EM",
1185
+ birthday: new Date("2000-08-12"),
1186
+ coverLetter:
1187
+ "I submit this application to express my sincere interest in the API developer position. In the previous role, I was responsible for leadership and ...",
1188
+ photoUrl: "https://unavatar.io/elon-musk",
1189
+ headline: "PepsiCo, Inc, Central Perk",
1190
+ title: "CEO",
1191
+ emails: [
1192
+ {
1193
+ id: "123",
1194
+ email: "elon@musk.com",
1195
+ type: "primary",
1196
+ },
1197
+ {
1198
+ id: "123",
1199
+ email: "elon@musk.com",
1200
+ type: "primary",
1201
+ },
1202
+ {
1203
+ id: "123",
1204
+ email: "elon@musk.com",
1205
+ type: "primary",
1206
+ },
1207
+ ],
1208
+ customFields: [
1209
+ {
1210
+ id: "2389328923893298",
1211
+ name: "employee_level",
1212
+ description: "Employee Level",
1213
+ value: true,
1214
+ },
1215
+ {
1216
+ id: "2389328923893298",
1217
+ name: "employee_level",
1218
+ description: "Employee Level",
1219
+ value: {
1220
+ "0": {},
1221
+ "1": {},
1222
+ },
1223
+ },
1224
+ ],
1225
+ phoneNumbers: [
1226
+ {
1227
+ id: "12345",
1228
+ countryCode: "1",
1229
+ areaCode: "323",
1230
+ number: "111-111-1111",
1231
+ extension: "105",
1232
+ type: "primary",
1233
+ },
1234
+ {
1235
+ id: "12345",
1236
+ countryCode: "1",
1237
+ areaCode: "323",
1238
+ number: "111-111-1111",
1239
+ extension: "105",
1240
+ type: "primary",
1241
+ },
1242
+ ],
1243
+ addresses: [
1244
+ {
1245
+ id: "123",
1246
+ type: "primary",
1247
+ string: "25 Spring Street, Blackburn, VIC 3130",
1248
+ name: "HQ US",
1249
+ line1: "Main street",
1250
+ line2: "apt #",
1251
+ line3: "Suite #",
1252
+ line4: "delivery instructions",
1253
+ streetNumber: "25",
1254
+ city: "San Francisco",
1255
+ state: "CA",
1256
+ postalCode: "94104",
1257
+ country: "US",
1258
+ latitude: "40.759211",
1259
+ longitude: "-73.984638",
1260
+ county: "Santa Clara",
1261
+ contactName: "Elon Musk",
1262
+ salutation: "Mr",
1263
+ phoneNumber: "111-111-1111",
1264
+ fax: "122-111-1111",
1265
+ email: "elon@musk.com",
1266
+ website: "https://elonmusk.com",
1267
+ notes: "Address notes or delivery instructions.",
1268
+ rowVersion: "1-12345",
1269
+ },
1270
+ {
1271
+ id: "123",
1272
+ type: "primary",
1273
+ string: "25 Spring Street, Blackburn, VIC 3130",
1274
+ name: "HQ US",
1275
+ line1: "Main street",
1276
+ line2: "apt #",
1277
+ line3: "Suite #",
1278
+ line4: "delivery instructions",
1279
+ streetNumber: "25",
1280
+ city: "San Francisco",
1281
+ state: "CA",
1282
+ postalCode: "94104",
1283
+ country: "US",
1284
+ latitude: "40.759211",
1285
+ longitude: "-73.984638",
1286
+ county: "Santa Clara",
1287
+ contactName: "Elon Musk",
1288
+ salutation: "Mr",
1289
+ phoneNumber: "111-111-1111",
1290
+ fax: "122-111-1111",
1291
+ email: "elon@musk.com",
1292
+ website: "https://elonmusk.com",
1293
+ notes: "Address notes or delivery instructions.",
1294
+ rowVersion: "1-12345",
1295
+ },
1296
+ {
1297
+ id: "123",
1298
+ type: "primary",
1299
+ string: "25 Spring Street, Blackburn, VIC 3130",
1300
+ name: "HQ US",
1301
+ line1: "Main street",
1302
+ line2: "apt #",
1303
+ line3: "Suite #",
1304
+ line4: "delivery instructions",
1305
+ streetNumber: "25",
1306
+ city: "San Francisco",
1307
+ state: "CA",
1308
+ postalCode: "94104",
1309
+ country: "US",
1310
+ latitude: "40.759211",
1311
+ longitude: "-73.984638",
1312
+ county: "Santa Clara",
1313
+ contactName: "Elon Musk",
1314
+ salutation: "Mr",
1315
+ phoneNumber: "111-111-1111",
1316
+ fax: "122-111-1111",
1317
+ email: "elon@musk.com",
1318
+ website: "https://elonmusk.com",
1319
+ notes: "Address notes or delivery instructions.",
1320
+ rowVersion: "1-12345",
1321
+ },
1322
+ ],
1323
+ websites: [
1324
+ {
1325
+ id: "12345",
1326
+ url: "http://example.com",
1327
+ type: "primary",
1328
+ },
1329
+ ],
1330
+ socialLinks: [
1331
+ {
1332
+ id: "12345",
1333
+ url: "https://www.twitter.com/apideck",
1334
+ type: "twitter",
1335
+ },
1336
+ {
1337
+ id: "12345",
1338
+ url: "https://www.twitter.com/apideck",
1339
+ type: "twitter",
1340
+ },
1341
+ {
1342
+ id: "12345",
1343
+ url: "https://www.twitter.com/apideck",
1344
+ type: "twitter",
1345
+ },
1346
+ ],
1347
+ stageId: "12345",
1348
+ recruiterId: "12345",
1349
+ coordinatorId: "12345",
1350
+ applicationIds: [
1351
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
1352
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
1353
+ ],
1354
+ applications: [
1355
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
1356
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
1357
+ ],
1358
+ followers: [
1359
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
1360
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
1361
+ ],
1362
+ sources: [
1363
+ "Job site",
1364
+ ],
1365
+ confidential: false,
1366
+ anonymized: true,
1367
+ tags: [
1368
+ "New",
1369
+ ],
1370
+ archived: false,
1371
+ ownerId: "54321",
1372
+ recordUrl: "https://app.intercom.io/contacts/12345",
1373
+ deleted: true,
1374
+ passThrough: [
1375
+ {
1376
+ serviceId: "<id>",
1377
+ extendPaths: [
1378
+ {
1379
+ path: "$.nested.property",
1380
+ value: {
1381
+ "TaxClassificationRef": {
1382
+ "value": "EUC-99990201-V1-00020000",
1383
+ },
1384
+ },
1385
+ },
1386
+ ],
1387
+ },
1388
+ {
1389
+ serviceId: "<id>",
1390
+ extendPaths: [
1391
+ {
1392
+ path: "$.nested.property",
1393
+ value: {
1394
+ "TaxClassificationRef": {
1395
+ "value": "EUC-99990201-V1-00020000",
1396
+ },
1397
+ },
1398
+ },
1399
+ ],
1400
+ },
1401
+ ],
1402
+ },
1403
+ });
1404
+ expect(result.httpMeta.response.status).toBe(200);
1405
+ expect(result.updateApplicantResponse).toBeDefined();
1406
+ expect(result.updateApplicantResponse).toEqual({
1407
+ statusCode: 200,
1408
+ status: "OK",
1409
+ service: "lever",
1410
+ resource: "Applicants",
1411
+ operation: "update",
1412
+ data: {
1413
+ id: "12345",
1414
+ },
1415
+ });
1416
+ });
1417
+
1418
+ test("Applicants Ats Applicants Delete", async () => {
1419
+ const testHttpClient = createTestHTTPClient("ats.applicantsDelete");
1420
+
1421
+ const apideck = new Apideck({
1422
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1423
+ httpClient: testHttpClient,
1424
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
1425
+ });
1426
+
1427
+ const result = await apideck.ats.applicants.delete({
1428
+ id: "<id>",
1429
+ consumerId: "test-consumer",
1430
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
1431
+ serviceId: "salesforce",
1432
+ });
1433
+ expect(result.httpMeta.response.status).toBe(200);
1434
+ expect(result.deleteApplicantResponse).toBeDefined();
1435
+ expect(result.deleteApplicantResponse).toEqual({
1436
+ statusCode: 200,
1437
+ status: "OK",
1438
+ service: "lever",
1439
+ resource: "Applicants",
1440
+ operation: "delete",
1441
+ data: {
1442
+ id: "12345",
1443
+ },
1444
+ });
1445
+ });