@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,1150 @@
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("Jobs Ats Jobs All", async () => {
10
+ const testHttpClient = createTestHTTPClient("ats.jobsAll");
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.jobs.list({
19
+ consumerId: "test-consumer",
20
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
21
+ serviceId: "salesforce",
22
+ passThrough: {
23
+ "search": "San Francisco",
24
+ },
25
+ fields: "id,updated_at",
26
+ });
27
+ expect(result.httpMeta.response.status).toBe(200);
28
+ expect(result.getJobsResponse).toBeDefined();
29
+ expect(result.getJobsResponse).toEqual({
30
+ statusCode: 200,
31
+ status: "OK",
32
+ service: "lever",
33
+ resource: "Jobs",
34
+ operation: "all",
35
+ data: [
36
+ {
37
+ id: "12345",
38
+ slug: "ceo",
39
+ title: "CEO",
40
+ sequence: 3,
41
+ visibility: "internal",
42
+ status: "completed",
43
+ code: "123-OC",
44
+ language: "EN",
45
+ employmentTerms: "full-time",
46
+ experience: "Director/ Vice President",
47
+ location: "San Francisco",
48
+ remote: true,
49
+ requisitionId: "abc123",
50
+ department: {
51
+ id: "12345",
52
+ parentId: "22345",
53
+ name: "R&D",
54
+ code: "2",
55
+ description: "R&D",
56
+ updatedBy: "12345",
57
+ createdBy: "12345",
58
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
59
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
60
+ passThrough: [
61
+ {
62
+ serviceId: "<id>",
63
+ extendPaths: [
64
+ {
65
+ path: "$.nested.property",
66
+ value: {
67
+ "TaxClassificationRef": {
68
+ "value": "EUC-99990201-V1-00020000",
69
+ },
70
+ },
71
+ },
72
+ {
73
+ path: "$.nested.property",
74
+ value: {
75
+ "TaxClassificationRef": {
76
+ "value": "EUC-99990201-V1-00020000",
77
+ },
78
+ },
79
+ },
80
+ {
81
+ path: "$.nested.property",
82
+ value: {
83
+ "TaxClassificationRef": {
84
+ "value": "EUC-99990201-V1-00020000",
85
+ },
86
+ },
87
+ },
88
+ ],
89
+ },
90
+ {
91
+ serviceId: "<id>",
92
+ extendPaths: [
93
+ {
94
+ path: "$.nested.property",
95
+ value: {
96
+ "TaxClassificationRef": {
97
+ "value": "EUC-99990201-V1-00020000",
98
+ },
99
+ },
100
+ },
101
+ ],
102
+ },
103
+ ],
104
+ },
105
+ branch: {
106
+ id: "123",
107
+ name: "HQ NY",
108
+ },
109
+ recruiters: [
110
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
111
+ ],
112
+ hiringManagers: [
113
+ "123456",
114
+ ],
115
+ followers: [
116
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
117
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
118
+ ],
119
+ description: "A description",
120
+ blocks: [
121
+ {
122
+ title: "string",
123
+ content: "string",
124
+ },
125
+ ],
126
+ closing: "The closing section of the job description",
127
+ closingDate: new Date("2020-10-30"),
128
+ salary: {
129
+ min: 8000,
130
+ max: 10000,
131
+ currency: "USD",
132
+ interval: "year",
133
+ },
134
+ links: [
135
+ {
136
+ type: "job_portal",
137
+ url: "https://app.intercom.io/contacts/12345",
138
+ },
139
+ ],
140
+ confidential: false,
141
+ availableToEmployees: false,
142
+ tags: [
143
+ "New",
144
+ ],
145
+ addresses: [
146
+ {
147
+ id: "123",
148
+ type: "primary",
149
+ string: "25 Spring Street, Blackburn, VIC 3130",
150
+ name: "HQ US",
151
+ line1: "Main street",
152
+ line2: "apt #",
153
+ line3: "Suite #",
154
+ line4: "delivery instructions",
155
+ streetNumber: "25",
156
+ city: "San Francisco",
157
+ state: "CA",
158
+ postalCode: "94104",
159
+ country: "US",
160
+ latitude: "40.759211",
161
+ longitude: "-73.984638",
162
+ county: "Santa Clara",
163
+ contactName: "Elon Musk",
164
+ salutation: "Mr",
165
+ phoneNumber: "111-111-1111",
166
+ fax: "122-111-1111",
167
+ email: "elon@musk.com",
168
+ website: "https://elonmusk.com",
169
+ notes: "Address notes or delivery instructions.",
170
+ rowVersion: "1-12345",
171
+ },
172
+ ],
173
+ customFields: [
174
+ {
175
+ id: "2389328923893298",
176
+ name: "employee_level",
177
+ description: "Employee Level",
178
+ value: {},
179
+ },
180
+ {
181
+ id: "2389328923893298",
182
+ name: "employee_level",
183
+ description: "Employee Level",
184
+ value: "Uses Salesforce and Marketo",
185
+ },
186
+ ],
187
+ deleted: true,
188
+ ownerId: "54321",
189
+ publishedAt: new Date("2020-09-30T07:43:32.000Z"),
190
+ updatedBy: "12345",
191
+ createdBy: "12345",
192
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
193
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
194
+ },
195
+ {
196
+ id: "12345",
197
+ slug: "ceo",
198
+ title: "CEO",
199
+ sequence: 3,
200
+ visibility: "internal",
201
+ status: "completed",
202
+ code: "123-OC",
203
+ language: "EN",
204
+ employmentTerms: "full-time",
205
+ experience: "Director/ Vice President",
206
+ location: "San Francisco",
207
+ remote: true,
208
+ requisitionId: "abc123",
209
+ department: {
210
+ id: "12345",
211
+ parentId: "22345",
212
+ name: "R&D",
213
+ code: "2",
214
+ description: "R&D",
215
+ updatedBy: "12345",
216
+ createdBy: "12345",
217
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
218
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
219
+ passThrough: [
220
+ {
221
+ serviceId: "<id>",
222
+ extendPaths: [
223
+ {
224
+ path: "$.nested.property",
225
+ value: {
226
+ "TaxClassificationRef": {
227
+ "value": "EUC-99990201-V1-00020000",
228
+ },
229
+ },
230
+ },
231
+ ],
232
+ },
233
+ {
234
+ serviceId: "<id>",
235
+ extendPaths: [
236
+ {
237
+ path: "$.nested.property",
238
+ value: {
239
+ "TaxClassificationRef": {
240
+ "value": "EUC-99990201-V1-00020000",
241
+ },
242
+ },
243
+ },
244
+ ],
245
+ },
246
+ {
247
+ serviceId: "<id>",
248
+ extendPaths: [
249
+ {
250
+ path: "$.nested.property",
251
+ value: {
252
+ "TaxClassificationRef": {
253
+ "value": "EUC-99990201-V1-00020000",
254
+ },
255
+ },
256
+ },
257
+ {
258
+ path: "$.nested.property",
259
+ value: {
260
+ "TaxClassificationRef": {
261
+ "value": "EUC-99990201-V1-00020000",
262
+ },
263
+ },
264
+ },
265
+ {
266
+ path: "$.nested.property",
267
+ value: {
268
+ "TaxClassificationRef": {
269
+ "value": "EUC-99990201-V1-00020000",
270
+ },
271
+ },
272
+ },
273
+ ],
274
+ },
275
+ ],
276
+ },
277
+ branch: {
278
+ id: "123",
279
+ name: "HQ NY",
280
+ },
281
+ recruiters: [
282
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
283
+ ],
284
+ hiringManagers: [
285
+ "123456",
286
+ ],
287
+ followers: [
288
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
289
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
290
+ ],
291
+ description: "A description",
292
+ blocks: [
293
+ {
294
+ title: "string",
295
+ content: "string",
296
+ },
297
+ ],
298
+ closing: "The closing section of the job description",
299
+ closingDate: new Date("2020-10-30"),
300
+ salary: {
301
+ min: 8000,
302
+ max: 10000,
303
+ currency: "USD",
304
+ interval: "year",
305
+ },
306
+ links: [
307
+ {
308
+ type: "job_portal",
309
+ url: "https://app.intercom.io/contacts/12345",
310
+ },
311
+ {
312
+ type: "job_portal",
313
+ url: "https://app.intercom.io/contacts/12345",
314
+ },
315
+ ],
316
+ confidential: false,
317
+ availableToEmployees: false,
318
+ tags: [
319
+ "New",
320
+ ],
321
+ addresses: [
322
+ {
323
+ id: "123",
324
+ type: "primary",
325
+ string: "25 Spring Street, Blackburn, VIC 3130",
326
+ name: "HQ US",
327
+ line1: "Main street",
328
+ line2: "apt #",
329
+ line3: "Suite #",
330
+ line4: "delivery instructions",
331
+ streetNumber: "25",
332
+ city: "San Francisco",
333
+ state: "CA",
334
+ postalCode: "94104",
335
+ country: "US",
336
+ latitude: "40.759211",
337
+ longitude: "-73.984638",
338
+ county: "Santa Clara",
339
+ contactName: "Elon Musk",
340
+ salutation: "Mr",
341
+ phoneNumber: "111-111-1111",
342
+ fax: "122-111-1111",
343
+ email: "elon@musk.com",
344
+ website: "https://elonmusk.com",
345
+ notes: "Address notes or delivery instructions.",
346
+ rowVersion: "1-12345",
347
+ },
348
+ {
349
+ id: "123",
350
+ type: "primary",
351
+ string: "25 Spring Street, Blackburn, VIC 3130",
352
+ name: "HQ US",
353
+ line1: "Main street",
354
+ line2: "apt #",
355
+ line3: "Suite #",
356
+ line4: "delivery instructions",
357
+ streetNumber: "25",
358
+ city: "San Francisco",
359
+ state: "CA",
360
+ postalCode: "94104",
361
+ country: "US",
362
+ latitude: "40.759211",
363
+ longitude: "-73.984638",
364
+ county: "Santa Clara",
365
+ contactName: "Elon Musk",
366
+ salutation: "Mr",
367
+ phoneNumber: "111-111-1111",
368
+ fax: "122-111-1111",
369
+ email: "elon@musk.com",
370
+ website: "https://elonmusk.com",
371
+ notes: "Address notes or delivery instructions.",
372
+ rowVersion: "1-12345",
373
+ },
374
+ ],
375
+ customFields: [
376
+ {
377
+ id: "2389328923893298",
378
+ name: "employee_level",
379
+ description: "Employee Level",
380
+ value: "Uses Salesforce and Marketo",
381
+ },
382
+ ],
383
+ deleted: true,
384
+ ownerId: "54321",
385
+ publishedAt: new Date("2020-09-30T07:43:32.000Z"),
386
+ updatedBy: "12345",
387
+ createdBy: "12345",
388
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
389
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
390
+ },
391
+ {
392
+ id: "12345",
393
+ slug: "ceo",
394
+ title: "CEO",
395
+ sequence: 3,
396
+ visibility: "internal",
397
+ status: "completed",
398
+ code: "123-OC",
399
+ language: "EN",
400
+ employmentTerms: "full-time",
401
+ experience: "Director/ Vice President",
402
+ location: "San Francisco",
403
+ remote: true,
404
+ requisitionId: "abc123",
405
+ department: {
406
+ id: "12345",
407
+ parentId: "22345",
408
+ name: "R&D",
409
+ code: "2",
410
+ description: "R&D",
411
+ updatedBy: "12345",
412
+ createdBy: "12345",
413
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
414
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
415
+ passThrough: [
416
+ {
417
+ serviceId: "<id>",
418
+ extendPaths: [
419
+ {
420
+ path: "$.nested.property",
421
+ value: {
422
+ "TaxClassificationRef": {
423
+ "value": "EUC-99990201-V1-00020000",
424
+ },
425
+ },
426
+ },
427
+ {
428
+ path: "$.nested.property",
429
+ value: {
430
+ "TaxClassificationRef": {
431
+ "value": "EUC-99990201-V1-00020000",
432
+ },
433
+ },
434
+ },
435
+ ],
436
+ },
437
+ {
438
+ serviceId: "<id>",
439
+ extendPaths: [
440
+ {
441
+ path: "$.nested.property",
442
+ value: {
443
+ "TaxClassificationRef": {
444
+ "value": "EUC-99990201-V1-00020000",
445
+ },
446
+ },
447
+ },
448
+ ],
449
+ },
450
+ ],
451
+ },
452
+ branch: {
453
+ id: "123",
454
+ name: "HQ NY",
455
+ },
456
+ recruiters: [
457
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
458
+ ],
459
+ hiringManagers: [
460
+ "123456",
461
+ ],
462
+ followers: [
463
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
464
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
465
+ ],
466
+ description: "A description",
467
+ blocks: [
468
+ {
469
+ title: "string",
470
+ content: "string",
471
+ },
472
+ ],
473
+ closing: "The closing section of the job description",
474
+ closingDate: new Date("2020-10-30"),
475
+ salary: {
476
+ min: 8000,
477
+ max: 10000,
478
+ currency: "USD",
479
+ interval: "year",
480
+ },
481
+ links: [
482
+ {
483
+ type: "job_portal",
484
+ url: "https://app.intercom.io/contacts/12345",
485
+ },
486
+ {
487
+ type: "job_portal",
488
+ url: "https://app.intercom.io/contacts/12345",
489
+ },
490
+ {
491
+ type: "job_portal",
492
+ url: "https://app.intercom.io/contacts/12345",
493
+ },
494
+ ],
495
+ confidential: false,
496
+ availableToEmployees: false,
497
+ tags: [
498
+ "New",
499
+ ],
500
+ addresses: [
501
+ {
502
+ id: "123",
503
+ type: "primary",
504
+ string: "25 Spring Street, Blackburn, VIC 3130",
505
+ name: "HQ US",
506
+ line1: "Main street",
507
+ line2: "apt #",
508
+ line3: "Suite #",
509
+ line4: "delivery instructions",
510
+ streetNumber: "25",
511
+ city: "San Francisco",
512
+ state: "CA",
513
+ postalCode: "94104",
514
+ country: "US",
515
+ latitude: "40.759211",
516
+ longitude: "-73.984638",
517
+ county: "Santa Clara",
518
+ contactName: "Elon Musk",
519
+ salutation: "Mr",
520
+ phoneNumber: "111-111-1111",
521
+ fax: "122-111-1111",
522
+ email: "elon@musk.com",
523
+ website: "https://elonmusk.com",
524
+ notes: "Address notes or delivery instructions.",
525
+ rowVersion: "1-12345",
526
+ },
527
+ {
528
+ id: "123",
529
+ type: "primary",
530
+ string: "25 Spring Street, Blackburn, VIC 3130",
531
+ name: "HQ US",
532
+ line1: "Main street",
533
+ line2: "apt #",
534
+ line3: "Suite #",
535
+ line4: "delivery instructions",
536
+ streetNumber: "25",
537
+ city: "San Francisco",
538
+ state: "CA",
539
+ postalCode: "94104",
540
+ country: "US",
541
+ latitude: "40.759211",
542
+ longitude: "-73.984638",
543
+ county: "Santa Clara",
544
+ contactName: "Elon Musk",
545
+ salutation: "Mr",
546
+ phoneNumber: "111-111-1111",
547
+ fax: "122-111-1111",
548
+ email: "elon@musk.com",
549
+ website: "https://elonmusk.com",
550
+ notes: "Address notes or delivery instructions.",
551
+ rowVersion: "1-12345",
552
+ },
553
+ ],
554
+ customFields: [
555
+ {
556
+ id: "2389328923893298",
557
+ name: "employee_level",
558
+ description: "Employee Level",
559
+ value: true,
560
+ },
561
+ {
562
+ id: "2389328923893298",
563
+ name: "employee_level",
564
+ description: "Employee Level",
565
+ value: "Uses Salesforce and Marketo",
566
+ },
567
+ {
568
+ id: "2389328923893298",
569
+ name: "employee_level",
570
+ description: "Employee Level",
571
+ value: 10,
572
+ },
573
+ ],
574
+ deleted: true,
575
+ ownerId: "54321",
576
+ publishedAt: new Date("2020-09-30T07:43:32.000Z"),
577
+ updatedBy: "12345",
578
+ createdBy: "12345",
579
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
580
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
581
+ },
582
+ ],
583
+ meta: {
584
+ itemsOnPage: 50,
585
+ cursors: {
586
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
587
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
588
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
589
+ },
590
+ },
591
+ links: {
592
+ previous:
593
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
594
+ current: "https://unify.apideck.com/crm/companies",
595
+ next:
596
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
597
+ },
598
+ });
599
+ });
600
+
601
+ test("Jobs Ats Jobs One", async () => {
602
+ const testHttpClient = createTestHTTPClient("ats.jobsOne");
603
+
604
+ const apideck = new Apideck({
605
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
606
+ httpClient: testHttpClient,
607
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
608
+ });
609
+
610
+ const result = await apideck.ats.jobs.get({
611
+ id: "<id>",
612
+ consumerId: "test-consumer",
613
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
614
+ serviceId: "salesforce",
615
+ fields: "id,updated_at",
616
+ });
617
+ expect(result.httpMeta.response.status).toBe(200);
618
+ expect(result.getJobResponse).toBeDefined();
619
+ expect(result.getJobResponse).toEqual({
620
+ statusCode: 200,
621
+ status: "OK",
622
+ service: "lever",
623
+ resource: "Jobs",
624
+ operation: "one",
625
+ data: {
626
+ id: "12345",
627
+ slug: "ceo",
628
+ title: "CEO",
629
+ sequence: 3,
630
+ visibility: "internal",
631
+ status: "completed",
632
+ code: "123-OC",
633
+ language: "EN",
634
+ employmentTerms: "full-time",
635
+ experience: "Director/ Vice President",
636
+ location: "San Francisco",
637
+ remote: true,
638
+ requisitionId: "abc123",
639
+ department: {
640
+ id: "12345",
641
+ parentId: "22345",
642
+ name: "R&D",
643
+ code: "2",
644
+ description: "R&D",
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
+ },
671
+ {
672
+ serviceId: "<id>",
673
+ extendPaths: [
674
+ {
675
+ path: "$.nested.property",
676
+ value: {
677
+ "TaxClassificationRef": {
678
+ "value": "EUC-99990201-V1-00020000",
679
+ },
680
+ },
681
+ },
682
+ {
683
+ path: "$.nested.property",
684
+ value: {
685
+ "TaxClassificationRef": {
686
+ "value": "EUC-99990201-V1-00020000",
687
+ },
688
+ },
689
+ },
690
+ ],
691
+ },
692
+ {
693
+ serviceId: "<id>",
694
+ extendPaths: [
695
+ {
696
+ path: "$.nested.property",
697
+ value: {
698
+ "TaxClassificationRef": {
699
+ "value": "EUC-99990201-V1-00020000",
700
+ },
701
+ },
702
+ },
703
+ {
704
+ path: "$.nested.property",
705
+ value: {
706
+ "TaxClassificationRef": {
707
+ "value": "EUC-99990201-V1-00020000",
708
+ },
709
+ },
710
+ },
711
+ ],
712
+ },
713
+ ],
714
+ },
715
+ branch: {
716
+ id: "123",
717
+ name: "HQ NY",
718
+ },
719
+ recruiters: [
720
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
721
+ ],
722
+ hiringManagers: [
723
+ "123456",
724
+ ],
725
+ followers: [
726
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
727
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
728
+ ],
729
+ description: "A description",
730
+ blocks: [
731
+ {
732
+ title: "string",
733
+ content: "string",
734
+ },
735
+ ],
736
+ closing: "The closing section of the job description",
737
+ closingDate: new Date("2020-10-30"),
738
+ salary: {
739
+ min: 8000,
740
+ max: 10000,
741
+ currency: "USD",
742
+ interval: "year",
743
+ },
744
+ links: [
745
+ {
746
+ type: "job_portal",
747
+ url: "https://app.intercom.io/contacts/12345",
748
+ },
749
+ {
750
+ type: "job_portal",
751
+ url: "https://app.intercom.io/contacts/12345",
752
+ },
753
+ {
754
+ type: "job_portal",
755
+ url: "https://app.intercom.io/contacts/12345",
756
+ },
757
+ ],
758
+ confidential: false,
759
+ availableToEmployees: false,
760
+ tags: [
761
+ "New",
762
+ ],
763
+ addresses: [
764
+ {
765
+ id: "123",
766
+ type: "primary",
767
+ string: "25 Spring Street, Blackburn, VIC 3130",
768
+ name: "HQ US",
769
+ line1: "Main street",
770
+ line2: "apt #",
771
+ line3: "Suite #",
772
+ line4: "delivery instructions",
773
+ streetNumber: "25",
774
+ city: "San Francisco",
775
+ state: "CA",
776
+ postalCode: "94104",
777
+ country: "US",
778
+ latitude: "40.759211",
779
+ longitude: "-73.984638",
780
+ county: "Santa Clara",
781
+ contactName: "Elon Musk",
782
+ salutation: "Mr",
783
+ phoneNumber: "111-111-1111",
784
+ fax: "122-111-1111",
785
+ email: "elon@musk.com",
786
+ website: "https://elonmusk.com",
787
+ notes: "Address notes or delivery instructions.",
788
+ rowVersion: "1-12345",
789
+ },
790
+ {
791
+ id: "123",
792
+ type: "primary",
793
+ string: "25 Spring Street, Blackburn, VIC 3130",
794
+ name: "HQ US",
795
+ line1: "Main street",
796
+ line2: "apt #",
797
+ line3: "Suite #",
798
+ line4: "delivery instructions",
799
+ streetNumber: "25",
800
+ city: "San Francisco",
801
+ state: "CA",
802
+ postalCode: "94104",
803
+ country: "US",
804
+ latitude: "40.759211",
805
+ longitude: "-73.984638",
806
+ county: "Santa Clara",
807
+ contactName: "Elon Musk",
808
+ salutation: "Mr",
809
+ phoneNumber: "111-111-1111",
810
+ fax: "122-111-1111",
811
+ email: "elon@musk.com",
812
+ website: "https://elonmusk.com",
813
+ notes: "Address notes or delivery instructions.",
814
+ rowVersion: "1-12345",
815
+ },
816
+ ],
817
+ customFields: [
818
+ {
819
+ id: "2389328923893298",
820
+ name: "employee_level",
821
+ description: "Employee Level",
822
+ value: 10,
823
+ },
824
+ {
825
+ id: "2389328923893298",
826
+ name: "employee_level",
827
+ description: "Employee Level",
828
+ value: 10,
829
+ },
830
+ ],
831
+ deleted: true,
832
+ ownerId: "54321",
833
+ publishedAt: new Date("2020-09-30T07:43:32.000Z"),
834
+ updatedBy: "12345",
835
+ createdBy: "12345",
836
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
837
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
838
+ },
839
+ });
840
+ });
841
+
842
+ test("Jobs Ats Jobs Add", async () => {
843
+ const testHttpClient = createTestHTTPClient("ats.jobsAdd");
844
+
845
+ const apideck = new Apideck({
846
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
847
+ httpClient: testHttpClient,
848
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
849
+ });
850
+
851
+ const result = await apideck.ats.jobs.create({
852
+ consumerId: "test-consumer",
853
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
854
+ serviceId: "salesforce",
855
+ job: {
856
+ slug: "ceo",
857
+ title: "CEO",
858
+ sequence: 3,
859
+ visibility: "internal",
860
+ status: "completed",
861
+ code: "123-OC",
862
+ language: "EN",
863
+ employmentTerms: "full-time",
864
+ experience: "Director/ Vice President",
865
+ location: "San Francisco",
866
+ remote: true,
867
+ requisitionId: "abc123",
868
+ department: {
869
+ name: "R&D",
870
+ code: "2",
871
+ description: "R&D",
872
+ passThrough: [
873
+ {
874
+ serviceId: "<id>",
875
+ extendPaths: [
876
+ {
877
+ path: "$.nested.property",
878
+ value: {
879
+ "TaxClassificationRef": {
880
+ "value": "EUC-99990201-V1-00020000",
881
+ },
882
+ },
883
+ },
884
+ ],
885
+ },
886
+ ],
887
+ },
888
+ branch: {
889
+ name: "HQ NY",
890
+ },
891
+ recruiters: [
892
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
893
+ ],
894
+ hiringManagers: [
895
+ "123456",
896
+ ],
897
+ followers: [
898
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
899
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
900
+ ],
901
+ description: "A description",
902
+ blocks: [
903
+ {
904
+ title: "string",
905
+ content: "string",
906
+ },
907
+ ],
908
+ closing: "The closing section of the job description",
909
+ closingDate: new Date("2020-10-30"),
910
+ salary: {
911
+ min: 8000,
912
+ max: 10000,
913
+ currency: "USD",
914
+ interval: "year",
915
+ },
916
+ links: [
917
+ {
918
+ type: "job_portal",
919
+ url: "https://app.intercom.io/contacts/12345",
920
+ },
921
+ ],
922
+ confidential: false,
923
+ availableToEmployees: false,
924
+ tags: [
925
+ "New",
926
+ ],
927
+ addresses: [
928
+ {
929
+ id: "123",
930
+ type: "primary",
931
+ string: "25 Spring Street, Blackburn, VIC 3130",
932
+ name: "HQ US",
933
+ line1: "Main street",
934
+ line2: "apt #",
935
+ line3: "Suite #",
936
+ line4: "delivery instructions",
937
+ line5: "Attention: Finance Dept",
938
+ streetNumber: "25",
939
+ city: "San Francisco",
940
+ state: "CA",
941
+ postalCode: "94104",
942
+ country: "US",
943
+ latitude: "40.759211",
944
+ longitude: "-73.984638",
945
+ county: "Santa Clara",
946
+ contactName: "Elon Musk",
947
+ salutation: "Mr",
948
+ phoneNumber: "111-111-1111",
949
+ fax: "122-111-1111",
950
+ email: "elon@musk.com",
951
+ website: "https://elonmusk.com",
952
+ notes: "Address notes or delivery instructions.",
953
+ rowVersion: "1-12345",
954
+ },
955
+ ],
956
+ customFields: [
957
+ {
958
+ id: "2389328923893298",
959
+ name: "employee_level",
960
+ description: "Employee Level",
961
+ value: "Uses Salesforce and Marketo",
962
+ },
963
+ ],
964
+ deleted: true,
965
+ ownerId: "54321",
966
+ },
967
+ });
968
+ expect(result.httpMeta.response.status).toBe(201);
969
+ expect(result.createJobResponse).toBeDefined();
970
+ expect(result.createJobResponse).toEqual({
971
+ statusCode: 200,
972
+ status: "OK",
973
+ service: "sage-hr",
974
+ resource: "Jobs",
975
+ operation: "add",
976
+ data: {
977
+ id: "12345",
978
+ },
979
+ });
980
+ });
981
+
982
+ test("Jobs Ats Jobs Update", async () => {
983
+ const testHttpClient = createTestHTTPClient("ats.jobsUpdate");
984
+
985
+ const apideck = new Apideck({
986
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
987
+ httpClient: testHttpClient,
988
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
989
+ });
990
+
991
+ const result = await apideck.ats.jobs.update({
992
+ id: "<id>",
993
+ consumerId: "test-consumer",
994
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
995
+ serviceId: "salesforce",
996
+ job: {
997
+ slug: "ceo",
998
+ title: "CEO",
999
+ sequence: 3,
1000
+ visibility: "internal",
1001
+ status: "completed",
1002
+ code: "123-OC",
1003
+ language: "EN",
1004
+ employmentTerms: "full-time",
1005
+ experience: "Director/ Vice President",
1006
+ location: "San Francisco",
1007
+ remote: true,
1008
+ requisitionId: "abc123",
1009
+ department: {
1010
+ name: "R&D",
1011
+ code: "2",
1012
+ description: "R&D",
1013
+ passThrough: [
1014
+ {
1015
+ serviceId: "<id>",
1016
+ extendPaths: [
1017
+ {
1018
+ path: "$.nested.property",
1019
+ value: {
1020
+ "TaxClassificationRef": {
1021
+ "value": "EUC-99990201-V1-00020000",
1022
+ },
1023
+ },
1024
+ },
1025
+ ],
1026
+ },
1027
+ ],
1028
+ },
1029
+ branch: {
1030
+ name: "HQ NY",
1031
+ },
1032
+ recruiters: [
1033
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
1034
+ ],
1035
+ hiringManagers: [
1036
+ "123456",
1037
+ ],
1038
+ followers: [
1039
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
1040
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
1041
+ ],
1042
+ description: "A description",
1043
+ blocks: [
1044
+ {
1045
+ title: "string",
1046
+ content: "string",
1047
+ },
1048
+ ],
1049
+ closing: "The closing section of the job description",
1050
+ closingDate: new Date("2020-10-30"),
1051
+ salary: {
1052
+ min: 8000,
1053
+ max: 10000,
1054
+ currency: "USD",
1055
+ interval: "year",
1056
+ },
1057
+ links: [
1058
+ {
1059
+ type: "job_portal",
1060
+ url: "https://app.intercom.io/contacts/12345",
1061
+ },
1062
+ ],
1063
+ confidential: false,
1064
+ availableToEmployees: false,
1065
+ tags: [
1066
+ "New",
1067
+ ],
1068
+ addresses: [
1069
+ {
1070
+ id: "123",
1071
+ type: "primary",
1072
+ string: "25 Spring Street, Blackburn, VIC 3130",
1073
+ name: "HQ US",
1074
+ line1: "Main street",
1075
+ line2: "apt #",
1076
+ line3: "Suite #",
1077
+ line4: "delivery instructions",
1078
+ line5: "Attention: Finance Dept",
1079
+ streetNumber: "25",
1080
+ city: "San Francisco",
1081
+ state: "CA",
1082
+ postalCode: "94104",
1083
+ country: "US",
1084
+ latitude: "40.759211",
1085
+ longitude: "-73.984638",
1086
+ county: "Santa Clara",
1087
+ contactName: "Elon Musk",
1088
+ salutation: "Mr",
1089
+ phoneNumber: "111-111-1111",
1090
+ fax: "122-111-1111",
1091
+ email: "elon@musk.com",
1092
+ website: "https://elonmusk.com",
1093
+ notes: "Address notes or delivery instructions.",
1094
+ rowVersion: "1-12345",
1095
+ },
1096
+ ],
1097
+ customFields: [
1098
+ {
1099
+ id: "2389328923893298",
1100
+ name: "employee_level",
1101
+ description: "Employee Level",
1102
+ value: "Uses Salesforce and Marketo",
1103
+ },
1104
+ ],
1105
+ deleted: true,
1106
+ ownerId: "54321",
1107
+ },
1108
+ });
1109
+ expect(result.httpMeta.response.status).toBe(200);
1110
+ expect(result.updateJobResponse).toBeDefined();
1111
+ expect(result.updateJobResponse).toEqual({
1112
+ statusCode: 200,
1113
+ status: "OK",
1114
+ service: "sage-hr",
1115
+ resource: "Jobs",
1116
+ operation: "update",
1117
+ data: {
1118
+ id: "12345",
1119
+ },
1120
+ });
1121
+ });
1122
+
1123
+ test("Jobs Ats Jobs Delete", async () => {
1124
+ const testHttpClient = createTestHTTPClient("ats.jobsDelete");
1125
+
1126
+ const apideck = new Apideck({
1127
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1128
+ httpClient: testHttpClient,
1129
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
1130
+ });
1131
+
1132
+ const result = await apideck.ats.jobs.delete({
1133
+ id: "<id>",
1134
+ consumerId: "test-consumer",
1135
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
1136
+ serviceId: "salesforce",
1137
+ });
1138
+ expect(result.httpMeta.response.status).toBe(200);
1139
+ expect(result.deleteJobResponse).toBeDefined();
1140
+ expect(result.deleteJobResponse).toEqual({
1141
+ statusCode: 200,
1142
+ status: "OK",
1143
+ service: "sage-hr",
1144
+ resource: "Jobs",
1145
+ operation: "delete",
1146
+ data: {
1147
+ id: "12345",
1148
+ },
1149
+ });
1150
+ });