@apideck/unify 0.23.0 → 0.23.1

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 (93) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +3 -3
  3. package/lib/config.js +3 -3
  4. package/models/components/note.d.ts +5 -0
  5. package/models/components/note.d.ts.map +1 -1
  6. package/models/components/note.js +4 -0
  7. package/models/components/note.js.map +1 -1
  8. package/models/components/noteinput.d.ts +5 -0
  9. package/models/components/noteinput.d.ts.map +1 -1
  10. package/models/components/noteinput.js +4 -0
  11. package/models/components/noteinput.js.map +1 -1
  12. package/package.json +5 -1
  13. package/src/__tests__/activities.test.ts +783 -0
  14. package/src/__tests__/agedcreditors.test.ts +279 -0
  15. package/src/__tests__/ageddebtors.test.ts +279 -0
  16. package/src/__tests__/apideckcompanies.test.ts +712 -0
  17. package/src/__tests__/apideckcustomers.test.ts +360 -0
  18. package/src/__tests__/apideckdepartments.test.ts +319 -0
  19. package/src/__tests__/apiresources.test.ts +61 -0
  20. package/src/__tests__/apis.test.ts +214 -0
  21. package/src/__tests__/applicants.test.ts +976 -0
  22. package/src/__tests__/applications.test.ts +329 -0
  23. package/src/__tests__/assertions.ts +13 -0
  24. package/src/__tests__/attachments.test.ts +363 -0
  25. package/src/__tests__/balancesheet.test.ts +451 -0
  26. package/src/__tests__/billpayments.test.ts +666 -0
  27. package/src/__tests__/bills.test.ts +1133 -0
  28. package/src/__tests__/collections.test.ts +115 -0
  29. package/src/__tests__/collectiontags.test.ts +66 -0
  30. package/src/__tests__/collectionticketcomments.test.ts +318 -0
  31. package/src/__tests__/collectiontickets.test.ts +436 -0
  32. package/src/__tests__/collectionusers.test.ts +122 -0
  33. package/src/__tests__/companies.test.ts +1059 -0
  34. package/src/__tests__/companyinfo.test.ts +218 -0
  35. package/src/__tests__/connectioncustommappings.test.ts +67 -0
  36. package/src/__tests__/connections.test.ts +1713 -0
  37. package/src/__tests__/connectionsettings.test.ts +280 -0
  38. package/src/__tests__/connectordocs.test.ts +28 -0
  39. package/src/__tests__/connectors.test.ts +751 -0
  40. package/src/__tests__/consumerrequestcounts.test.ts +41 -0
  41. package/src/__tests__/consumers.test.ts +517 -0
  42. package/src/__tests__/contacts.test.ts +957 -0
  43. package/src/__tests__/createcallback.test.ts +34 -0
  44. package/src/__tests__/creditnotes.test.ts +1362 -0
  45. package/src/__tests__/customers.test.ts +1089 -0
  46. package/src/__tests__/customfields.test.ts +50 -0
  47. package/src/__tests__/custommappings.test.ts +63 -0
  48. package/src/__tests__/departments.test.ts +359 -0
  49. package/src/__tests__/drivegroups.test.ts +318 -0
  50. package/src/__tests__/drives.test.ts +311 -0
  51. package/src/__tests__/employeepayrolls.test.ts +487 -0
  52. package/src/__tests__/employees.test.ts +1682 -0
  53. package/src/__tests__/employeeschedules.test.ts +456 -0
  54. package/src/__tests__/eventlogs.test.ts +157 -0
  55. package/src/__tests__/expenses.test.ts +566 -0
  56. package/src/__tests__/files.test.ts +392 -0
  57. package/src/__tests__/files.ts +56 -0
  58. package/src/__tests__/folders.test.ts +103 -0
  59. package/src/__tests__/invoiceitems.test.ts +586 -0
  60. package/src/__tests__/invoices.test.ts +1561 -0
  61. package/src/__tests__/jobs.test.ts +837 -0
  62. package/src/__tests__/journalentries.test.ts +1053 -0
  63. package/src/__tests__/leads.test.ts +897 -0
  64. package/src/__tests__/ledgeraccounts.test.ts +594 -0
  65. package/src/__tests__/locations.test.ts +561 -0
  66. package/src/__tests__/logs.test.ts +135 -0
  67. package/src/__tests__/messages.test.ts +396 -0
  68. package/src/__tests__/mockserver/README.md +52 -0
  69. package/src/__tests__/notes.test.ts +335 -0
  70. package/src/__tests__/opportunities.test.ts +503 -0
  71. package/src/__tests__/orders.test.ts +849 -0
  72. package/src/__tests__/payments.test.ts +557 -0
  73. package/src/__tests__/payrolls.test.ts +481 -0
  74. package/src/__tests__/pipelines.test.ts +383 -0
  75. package/src/__tests__/products.test.ts +505 -0
  76. package/src/__tests__/profitandloss.test.ts +221 -0
  77. package/src/__tests__/purchaseorders.test.ts +1464 -0
  78. package/src/__tests__/sessions.test.ts +70 -0
  79. package/src/__tests__/sharedlinks.test.ts +331 -0
  80. package/src/__tests__/stores.test.ts +39 -0
  81. package/src/__tests__/subsidiaries.test.ts +316 -0
  82. package/src/__tests__/suppliers.test.ts +1071 -0
  83. package/src/__tests__/taxrates.test.ts +472 -0
  84. package/src/__tests__/testclient.ts +48 -0
  85. package/src/__tests__/timeoffrequests.test.ts +381 -0
  86. package/src/__tests__/trackingcategories.test.ts +329 -0
  87. package/src/__tests__/uploadsessions.test.ts +142 -0
  88. package/src/__tests__/users.test.ts +667 -0
  89. package/src/__tests__/validateconnection.test.ts +32 -0
  90. package/src/__tests__/webhooks.test.ts +248 -0
  91. package/src/lib/config.ts +3 -3
  92. package/src/models/components/note.ts +9 -0
  93. package/src/models/components/noteinput.ts +9 -0
@@ -0,0 +1,1682 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { assert, expect, it, test } from "vitest";
6
+ import { Apideck } from "../index.js";
7
+ import { RFCDate } from "../types/index.js";
8
+ import { createTestHTTPClient } from "./testclient.js";
9
+
10
+ test("Employees Hris Employees All", async () => {
11
+ const testHttpClient = createTestHTTPClient("hris.employeesAll");
12
+
13
+ const apideck = new Apideck({
14
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
15
+ httpClient: testHttpClient,
16
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
17
+ });
18
+
19
+ const result = await apideck.hris.employees.list({
20
+ serviceId: "salesforce",
21
+ filter: {
22
+ companyId: "1234",
23
+ email: "elon@tesla.com",
24
+ firstName: "Elon",
25
+ title: "Manager",
26
+ lastName: "Musk",
27
+ managerId: "1234",
28
+ employmentStatus: "active",
29
+ employeeNumber: "123456-AB",
30
+ departmentId: "1234",
31
+ city: "San Francisco",
32
+ country: "US",
33
+ },
34
+ sort: {
35
+ by: "created_at",
36
+ },
37
+ passThrough: {
38
+ "search": "San Francisco",
39
+ },
40
+ fields: "id,updated_at",
41
+ });
42
+ expect(result.httpMeta.response.status).toBe(200);
43
+ expect(result.getEmployeesResponse).toBeDefined();
44
+ expect(result.getEmployeesResponse).toEqual({
45
+ statusCode: 200,
46
+ status: "OK",
47
+ service: "sage-hr",
48
+ resource: "Employees",
49
+ operation: "all",
50
+ data: [
51
+ {
52
+ id: "12345",
53
+ downstreamId: "12345",
54
+ firstName: "Elon",
55
+ lastName: "Musk",
56
+ middleName: "D.",
57
+ displayName: "Technoking",
58
+ preferredName: "Elon Musk",
59
+ initials: "EM",
60
+ salutation: "Mr",
61
+ title: "CEO",
62
+ maritalStatus: "married",
63
+ partner: {
64
+ id: "12345",
65
+ firstName: "Elon",
66
+ lastName: "Musk",
67
+ middleName: "D.",
68
+ gender: "male",
69
+ initials: "EM",
70
+ birthday: new RFCDate("2000-08-12"),
71
+ deceasedOn: new RFCDate("2000-08-12"),
72
+ },
73
+ division: "Europe",
74
+ divisionId: "12345",
75
+ departmentId: "12345",
76
+ departmentName: "12345",
77
+ team: {
78
+ id: "1234",
79
+ name: "Full Stack Engineers",
80
+ },
81
+ companyId: "23456",
82
+ companyName: "SpaceX",
83
+ employmentStartDate: "2021-10-26",
84
+ employmentEndDate: "2028-10-26",
85
+ leavingReason: "resigned",
86
+ employeeNumber: "123456-AB",
87
+ employmentStatus: "active",
88
+ ethnicity: "African American",
89
+ manager: {
90
+ id: "12345",
91
+ name: "Elon Musk",
92
+ firstName: "Elon",
93
+ lastName: "Musk",
94
+ email: "elon@musk.com",
95
+ employmentStatus: "active",
96
+ },
97
+ directReports: [
98
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
99
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
100
+ ],
101
+ socialSecurityNumber: "123456789",
102
+ birthday: new RFCDate("2000-08-12"),
103
+ deceasedOn: new RFCDate("2000-08-12"),
104
+ countryOfBirth: "US",
105
+ description: "A description",
106
+ gender: "male",
107
+ pronouns: "she,her",
108
+ preferredLanguage: "EN",
109
+ languages: [
110
+ "EN",
111
+ ],
112
+ nationalities: [
113
+ "US",
114
+ ],
115
+ photoUrl: "https://unavatar.io/elon-musk",
116
+ timezone: "Europe/London",
117
+ source: "lever",
118
+ sourceId: "12345",
119
+ recordUrl: "https://app.intercom.io/contacts/12345",
120
+ jobs: [
121
+ {
122
+ id: "12345",
123
+ employeeId: "12345",
124
+ title: "CEO",
125
+ role: "Sales",
126
+ startDate: new RFCDate("2020-08-12"),
127
+ endDate: new RFCDate("2020-08-12"),
128
+ compensationRate: 72000,
129
+ currency: "USD",
130
+ paymentUnit: "year",
131
+ hiredAt: new RFCDate("2020-08-12"),
132
+ isPrimary: true,
133
+ isManager: true,
134
+ status: "active",
135
+ location: {
136
+ id: "123",
137
+ type: "primary",
138
+ string: "25 Spring Street, Blackburn, VIC 3130",
139
+ name: "HQ US",
140
+ line1: "Main street",
141
+ line2: "apt #",
142
+ line3: "Suite #",
143
+ line4: "delivery instructions",
144
+ streetNumber: "25",
145
+ city: "San Francisco",
146
+ state: "CA",
147
+ postalCode: "94104",
148
+ country: "US",
149
+ latitude: "40.759211",
150
+ longitude: "-73.984638",
151
+ county: "Santa Clara",
152
+ contactName: "Elon Musk",
153
+ salutation: "Mr",
154
+ phoneNumber: "111-111-1111",
155
+ fax: "122-111-1111",
156
+ email: "elon@musk.com",
157
+ website: "https://elonmusk.com",
158
+ notes: "Address notes or delivery instructions.",
159
+ rowVersion: "1-12345",
160
+ },
161
+ },
162
+ {
163
+ id: "12345",
164
+ employeeId: "12345",
165
+ title: "CEO",
166
+ role: "Sales",
167
+ startDate: new RFCDate("2020-08-12"),
168
+ endDate: new RFCDate("2020-08-12"),
169
+ compensationRate: 72000,
170
+ currency: "USD",
171
+ paymentUnit: "year",
172
+ hiredAt: new RFCDate("2020-08-12"),
173
+ isPrimary: true,
174
+ isManager: true,
175
+ status: "active",
176
+ location: {
177
+ id: "123",
178
+ type: "primary",
179
+ string: "25 Spring Street, Blackburn, VIC 3130",
180
+ name: "HQ US",
181
+ line1: "Main street",
182
+ line2: "apt #",
183
+ line3: "Suite #",
184
+ line4: "delivery instructions",
185
+ streetNumber: "25",
186
+ city: "San Francisco",
187
+ state: "CA",
188
+ postalCode: "94104",
189
+ country: "US",
190
+ latitude: "40.759211",
191
+ longitude: "-73.984638",
192
+ county: "Santa Clara",
193
+ contactName: "Elon Musk",
194
+ salutation: "Mr",
195
+ phoneNumber: "111-111-1111",
196
+ fax: "122-111-1111",
197
+ email: "elon@musk.com",
198
+ website: "https://elonmusk.com",
199
+ notes: "Address notes or delivery instructions.",
200
+ rowVersion: "1-12345",
201
+ },
202
+ },
203
+ ],
204
+ compensations: [
205
+ {
206
+ id: "3404301363494309004",
207
+ jobId: "3490439050957906679",
208
+ rate: 50,
209
+ paymentUnit: "hour",
210
+ flsaStatus: "nonexempt",
211
+ effectiveDate: "2021-06-11",
212
+ },
213
+ ],
214
+ worksRemote: true,
215
+ addresses: [
216
+ {
217
+ id: "123",
218
+ type: "primary",
219
+ string: "25 Spring Street, Blackburn, VIC 3130",
220
+ name: "HQ US",
221
+ line1: "Main street",
222
+ line2: "apt #",
223
+ line3: "Suite #",
224
+ line4: "delivery instructions",
225
+ streetNumber: "25",
226
+ city: "San Francisco",
227
+ state: "CA",
228
+ postalCode: "94104",
229
+ country: "US",
230
+ latitude: "40.759211",
231
+ longitude: "-73.984638",
232
+ county: "Santa Clara",
233
+ contactName: "Elon Musk",
234
+ salutation: "Mr",
235
+ phoneNumber: "111-111-1111",
236
+ fax: "122-111-1111",
237
+ email: "elon@musk.com",
238
+ website: "https://elonmusk.com",
239
+ notes: "Address notes or delivery instructions.",
240
+ rowVersion: "1-12345",
241
+ },
242
+ {
243
+ id: "123",
244
+ type: "primary",
245
+ string: "25 Spring Street, Blackburn, VIC 3130",
246
+ name: "HQ US",
247
+ line1: "Main street",
248
+ line2: "apt #",
249
+ line3: "Suite #",
250
+ line4: "delivery instructions",
251
+ streetNumber: "25",
252
+ city: "San Francisco",
253
+ state: "CA",
254
+ postalCode: "94104",
255
+ country: "US",
256
+ latitude: "40.759211",
257
+ longitude: "-73.984638",
258
+ county: "Santa Clara",
259
+ contactName: "Elon Musk",
260
+ salutation: "Mr",
261
+ phoneNumber: "111-111-1111",
262
+ fax: "122-111-1111",
263
+ email: "elon@musk.com",
264
+ website: "https://elonmusk.com",
265
+ notes: "Address notes or delivery instructions.",
266
+ rowVersion: "1-12345",
267
+ },
268
+ {
269
+ id: "123",
270
+ type: "primary",
271
+ string: "25 Spring Street, Blackburn, VIC 3130",
272
+ name: "HQ US",
273
+ line1: "Main street",
274
+ line2: "apt #",
275
+ line3: "Suite #",
276
+ line4: "delivery instructions",
277
+ streetNumber: "25",
278
+ city: "San Francisco",
279
+ state: "CA",
280
+ postalCode: "94104",
281
+ country: "US",
282
+ latitude: "40.759211",
283
+ longitude: "-73.984638",
284
+ county: "Santa Clara",
285
+ contactName: "Elon Musk",
286
+ salutation: "Mr",
287
+ phoneNumber: "111-111-1111",
288
+ fax: "122-111-1111",
289
+ email: "elon@musk.com",
290
+ website: "https://elonmusk.com",
291
+ notes: "Address notes or delivery instructions.",
292
+ rowVersion: "1-12345",
293
+ },
294
+ ],
295
+ phoneNumbers: [
296
+ {
297
+ id: "12345",
298
+ countryCode: "1",
299
+ areaCode: "323",
300
+ number: "111-111-1111",
301
+ extension: "105",
302
+ type: "primary",
303
+ },
304
+ ],
305
+ emails: [
306
+ {
307
+ id: "123",
308
+ email: "elon@musk.com",
309
+ type: "primary",
310
+ },
311
+ ],
312
+ customFields: [
313
+ {
314
+ id: "2389328923893298",
315
+ name: "employee_level",
316
+ description: "Employee Level",
317
+ value: {},
318
+ },
319
+ ],
320
+ socialLinks: [
321
+ {
322
+ id: "12345",
323
+ url: "https://www.twitter.com/apideck",
324
+ type: "twitter",
325
+ },
326
+ {
327
+ id: "12345",
328
+ url: "https://www.twitter.com/apideck",
329
+ type: "twitter",
330
+ },
331
+ ],
332
+ bankAccounts: [
333
+ {
334
+ bankName: "Monzo",
335
+ accountNumber: "123465",
336
+ accountName: "SPACEX LLC",
337
+ accountType: "credit_card",
338
+ iban: "CH2989144532982975332",
339
+ bic: "AUDSCHGGXXX",
340
+ routingNumber: "012345678",
341
+ bsbNumber: "062-001",
342
+ branchIdentifier: "001",
343
+ bankCode: "BNH",
344
+ currency: "USD",
345
+ },
346
+ ],
347
+ taxCode: "1111",
348
+ taxId: "234-32-0000",
349
+ dietaryPreference: "Veggie",
350
+ foodAllergies: [
351
+ "No allergies",
352
+ ],
353
+ probationPeriod: {
354
+ startDate: new RFCDate("2021-10-01"),
355
+ endDate: new RFCDate("2021-11-28"),
356
+ },
357
+ tags: [
358
+ "New",
359
+ ],
360
+ rowVersion: "1-12345",
361
+ deleted: true,
362
+ updatedBy: "12345",
363
+ createdBy: "12345",
364
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
365
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
366
+ passThrough: [
367
+ {
368
+ serviceId: "<id>",
369
+ extendPaths: [
370
+ {
371
+ path: "$.nested.property",
372
+ value: {
373
+ "TaxClassificationRef": {
374
+ "value": "EUC-99990201-V1-00020000",
375
+ },
376
+ },
377
+ },
378
+ ],
379
+ },
380
+ {
381
+ serviceId: "<id>",
382
+ extendPaths: [
383
+ {
384
+ path: "$.nested.property",
385
+ value: {
386
+ "TaxClassificationRef": {
387
+ "value": "EUC-99990201-V1-00020000",
388
+ },
389
+ },
390
+ },
391
+ ],
392
+ },
393
+ {
394
+ serviceId: "<id>",
395
+ extendPaths: [
396
+ {
397
+ path: "$.nested.property",
398
+ value: {
399
+ "TaxClassificationRef": {
400
+ "value": "EUC-99990201-V1-00020000",
401
+ },
402
+ },
403
+ },
404
+ {
405
+ path: "$.nested.property",
406
+ value: {
407
+ "TaxClassificationRef": {
408
+ "value": "EUC-99990201-V1-00020000",
409
+ },
410
+ },
411
+ },
412
+ {
413
+ path: "$.nested.property",
414
+ value: {
415
+ "TaxClassificationRef": {
416
+ "value": "EUC-99990201-V1-00020000",
417
+ },
418
+ },
419
+ },
420
+ ],
421
+ },
422
+ ],
423
+ },
424
+ {
425
+ id: "12345",
426
+ downstreamId: "12345",
427
+ firstName: "Elon",
428
+ lastName: "Musk",
429
+ middleName: "D.",
430
+ displayName: "Technoking",
431
+ preferredName: "Elon Musk",
432
+ initials: "EM",
433
+ salutation: "Mr",
434
+ title: "CEO",
435
+ maritalStatus: "married",
436
+ partner: {
437
+ id: "12345",
438
+ firstName: "Elon",
439
+ lastName: "Musk",
440
+ middleName: "D.",
441
+ gender: "male",
442
+ initials: "EM",
443
+ birthday: new RFCDate("2000-08-12"),
444
+ deceasedOn: new RFCDate("2000-08-12"),
445
+ },
446
+ division: "Europe",
447
+ divisionId: "12345",
448
+ departmentId: "12345",
449
+ departmentName: "12345",
450
+ team: {
451
+ id: "1234",
452
+ name: "Full Stack Engineers",
453
+ },
454
+ companyId: "23456",
455
+ companyName: "SpaceX",
456
+ employmentStartDate: "2021-10-26",
457
+ employmentEndDate: "2028-10-26",
458
+ leavingReason: "resigned",
459
+ employeeNumber: "123456-AB",
460
+ employmentStatus: "active",
461
+ ethnicity: "African American",
462
+ manager: {
463
+ id: "12345",
464
+ name: "Elon Musk",
465
+ firstName: "Elon",
466
+ lastName: "Musk",
467
+ email: "elon@musk.com",
468
+ employmentStatus: "active",
469
+ },
470
+ directReports: [
471
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
472
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
473
+ ],
474
+ socialSecurityNumber: "123456789",
475
+ birthday: new RFCDate("2000-08-12"),
476
+ deceasedOn: new RFCDate("2000-08-12"),
477
+ countryOfBirth: "US",
478
+ description: "A description",
479
+ gender: "male",
480
+ pronouns: "she,her",
481
+ preferredLanguage: "EN",
482
+ languages: [
483
+ "EN",
484
+ ],
485
+ nationalities: [
486
+ "US",
487
+ ],
488
+ photoUrl: "https://unavatar.io/elon-musk",
489
+ timezone: "Europe/London",
490
+ source: "lever",
491
+ sourceId: "12345",
492
+ recordUrl: "https://app.intercom.io/contacts/12345",
493
+ jobs: [
494
+ {
495
+ id: "12345",
496
+ employeeId: "12345",
497
+ title: "CEO",
498
+ role: "Sales",
499
+ startDate: new RFCDate("2020-08-12"),
500
+ endDate: new RFCDate("2020-08-12"),
501
+ compensationRate: 72000,
502
+ currency: "USD",
503
+ paymentUnit: "year",
504
+ hiredAt: new RFCDate("2020-08-12"),
505
+ isPrimary: true,
506
+ isManager: true,
507
+ status: "active",
508
+ location: {
509
+ id: "123",
510
+ type: "primary",
511
+ string: "25 Spring Street, Blackburn, VIC 3130",
512
+ name: "HQ US",
513
+ line1: "Main street",
514
+ line2: "apt #",
515
+ line3: "Suite #",
516
+ line4: "delivery instructions",
517
+ streetNumber: "25",
518
+ city: "San Francisco",
519
+ state: "CA",
520
+ postalCode: "94104",
521
+ country: "US",
522
+ latitude: "40.759211",
523
+ longitude: "-73.984638",
524
+ county: "Santa Clara",
525
+ contactName: "Elon Musk",
526
+ salutation: "Mr",
527
+ phoneNumber: "111-111-1111",
528
+ fax: "122-111-1111",
529
+ email: "elon@musk.com",
530
+ website: "https://elonmusk.com",
531
+ notes: "Address notes or delivery instructions.",
532
+ rowVersion: "1-12345",
533
+ },
534
+ },
535
+ {
536
+ id: "12345",
537
+ employeeId: "12345",
538
+ title: "CEO",
539
+ role: "Sales",
540
+ startDate: new RFCDate("2020-08-12"),
541
+ endDate: new RFCDate("2020-08-12"),
542
+ compensationRate: 72000,
543
+ currency: "USD",
544
+ paymentUnit: "year",
545
+ hiredAt: new RFCDate("2020-08-12"),
546
+ isPrimary: true,
547
+ isManager: true,
548
+ status: "active",
549
+ location: {
550
+ id: "123",
551
+ type: "primary",
552
+ string: "25 Spring Street, Blackburn, VIC 3130",
553
+ name: "HQ US",
554
+ line1: "Main street",
555
+ line2: "apt #",
556
+ line3: "Suite #",
557
+ line4: "delivery instructions",
558
+ streetNumber: "25",
559
+ city: "San Francisco",
560
+ state: "CA",
561
+ postalCode: "94104",
562
+ country: "US",
563
+ latitude: "40.759211",
564
+ longitude: "-73.984638",
565
+ county: "Santa Clara",
566
+ contactName: "Elon Musk",
567
+ salutation: "Mr",
568
+ phoneNumber: "111-111-1111",
569
+ fax: "122-111-1111",
570
+ email: "elon@musk.com",
571
+ website: "https://elonmusk.com",
572
+ notes: "Address notes or delivery instructions.",
573
+ rowVersion: "1-12345",
574
+ },
575
+ },
576
+ ],
577
+ compensations: [
578
+ {
579
+ id: "3404301363494309004",
580
+ jobId: "3490439050957906679",
581
+ rate: 50,
582
+ paymentUnit: "hour",
583
+ flsaStatus: "nonexempt",
584
+ effectiveDate: "2021-06-11",
585
+ },
586
+ ],
587
+ worksRemote: true,
588
+ addresses: [
589
+ {
590
+ id: "123",
591
+ type: "primary",
592
+ string: "25 Spring Street, Blackburn, VIC 3130",
593
+ name: "HQ US",
594
+ line1: "Main street",
595
+ line2: "apt #",
596
+ line3: "Suite #",
597
+ line4: "delivery instructions",
598
+ streetNumber: "25",
599
+ city: "San Francisco",
600
+ state: "CA",
601
+ postalCode: "94104",
602
+ country: "US",
603
+ latitude: "40.759211",
604
+ longitude: "-73.984638",
605
+ county: "Santa Clara",
606
+ contactName: "Elon Musk",
607
+ salutation: "Mr",
608
+ phoneNumber: "111-111-1111",
609
+ fax: "122-111-1111",
610
+ email: "elon@musk.com",
611
+ website: "https://elonmusk.com",
612
+ notes: "Address notes or delivery instructions.",
613
+ rowVersion: "1-12345",
614
+ },
615
+ {
616
+ id: "123",
617
+ type: "primary",
618
+ string: "25 Spring Street, Blackburn, VIC 3130",
619
+ name: "HQ US",
620
+ line1: "Main street",
621
+ line2: "apt #",
622
+ line3: "Suite #",
623
+ line4: "delivery instructions",
624
+ streetNumber: "25",
625
+ city: "San Francisco",
626
+ state: "CA",
627
+ postalCode: "94104",
628
+ country: "US",
629
+ latitude: "40.759211",
630
+ longitude: "-73.984638",
631
+ county: "Santa Clara",
632
+ contactName: "Elon Musk",
633
+ salutation: "Mr",
634
+ phoneNumber: "111-111-1111",
635
+ fax: "122-111-1111",
636
+ email: "elon@musk.com",
637
+ website: "https://elonmusk.com",
638
+ notes: "Address notes or delivery instructions.",
639
+ rowVersion: "1-12345",
640
+ },
641
+ ],
642
+ phoneNumbers: [
643
+ {
644
+ id: "12345",
645
+ countryCode: "1",
646
+ areaCode: "323",
647
+ number: "111-111-1111",
648
+ extension: "105",
649
+ type: "primary",
650
+ },
651
+ ],
652
+ emails: [
653
+ {
654
+ id: "123",
655
+ email: "elon@musk.com",
656
+ type: "primary",
657
+ },
658
+ ],
659
+ customFields: [
660
+ {
661
+ id: "2389328923893298",
662
+ name: "employee_level",
663
+ description: "Employee Level",
664
+ value: true,
665
+ },
666
+ {
667
+ id: "2389328923893298",
668
+ name: "employee_level",
669
+ description: "Employee Level",
670
+ value: "Uses Salesforce and Marketo",
671
+ },
672
+ ],
673
+ socialLinks: [
674
+ {
675
+ id: "12345",
676
+ url: "https://www.twitter.com/apideck",
677
+ type: "twitter",
678
+ },
679
+ {
680
+ id: "12345",
681
+ url: "https://www.twitter.com/apideck",
682
+ type: "twitter",
683
+ },
684
+ {
685
+ id: "12345",
686
+ url: "https://www.twitter.com/apideck",
687
+ type: "twitter",
688
+ },
689
+ ],
690
+ bankAccounts: [
691
+ {
692
+ bankName: "Monzo",
693
+ accountNumber: "123465",
694
+ accountName: "SPACEX LLC",
695
+ accountType: "credit_card",
696
+ iban: "CH2989144532982975332",
697
+ bic: "AUDSCHGGXXX",
698
+ routingNumber: "012345678",
699
+ bsbNumber: "062-001",
700
+ branchIdentifier: "001",
701
+ bankCode: "BNH",
702
+ currency: "USD",
703
+ },
704
+ {
705
+ bankName: "Monzo",
706
+ accountNumber: "123465",
707
+ accountName: "SPACEX LLC",
708
+ accountType: "credit_card",
709
+ iban: "CH2989144532982975332",
710
+ bic: "AUDSCHGGXXX",
711
+ routingNumber: "012345678",
712
+ bsbNumber: "062-001",
713
+ branchIdentifier: "001",
714
+ bankCode: "BNH",
715
+ currency: "USD",
716
+ },
717
+ ],
718
+ taxCode: "1111",
719
+ taxId: "234-32-0000",
720
+ dietaryPreference: "Veggie",
721
+ foodAllergies: [
722
+ "No allergies",
723
+ ],
724
+ probationPeriod: {
725
+ startDate: new RFCDate("2021-10-01"),
726
+ endDate: new RFCDate("2021-11-28"),
727
+ },
728
+ tags: [
729
+ "New",
730
+ ],
731
+ rowVersion: "1-12345",
732
+ deleted: true,
733
+ updatedBy: "12345",
734
+ createdBy: "12345",
735
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
736
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
737
+ passThrough: [
738
+ {
739
+ serviceId: "<id>",
740
+ extendPaths: [
741
+ {
742
+ path: "$.nested.property",
743
+ value: {
744
+ "TaxClassificationRef": {
745
+ "value": "EUC-99990201-V1-00020000",
746
+ },
747
+ },
748
+ },
749
+ {
750
+ path: "$.nested.property",
751
+ value: {
752
+ "TaxClassificationRef": {
753
+ "value": "EUC-99990201-V1-00020000",
754
+ },
755
+ },
756
+ },
757
+ ],
758
+ },
759
+ {
760
+ serviceId: "<id>",
761
+ extendPaths: [
762
+ {
763
+ path: "$.nested.property",
764
+ value: {
765
+ "TaxClassificationRef": {
766
+ "value": "EUC-99990201-V1-00020000",
767
+ },
768
+ },
769
+ },
770
+ ],
771
+ },
772
+ {
773
+ serviceId: "<id>",
774
+ extendPaths: [
775
+ {
776
+ path: "$.nested.property",
777
+ value: {
778
+ "TaxClassificationRef": {
779
+ "value": "EUC-99990201-V1-00020000",
780
+ },
781
+ },
782
+ },
783
+ ],
784
+ },
785
+ ],
786
+ },
787
+ {
788
+ id: "12345",
789
+ downstreamId: "12345",
790
+ firstName: "Elon",
791
+ lastName: "Musk",
792
+ middleName: "D.",
793
+ displayName: "Technoking",
794
+ preferredName: "Elon Musk",
795
+ initials: "EM",
796
+ salutation: "Mr",
797
+ title: "CEO",
798
+ maritalStatus: "married",
799
+ partner: {
800
+ id: "12345",
801
+ firstName: "Elon",
802
+ lastName: "Musk",
803
+ middleName: "D.",
804
+ gender: "male",
805
+ initials: "EM",
806
+ birthday: new RFCDate("2000-08-12"),
807
+ deceasedOn: new RFCDate("2000-08-12"),
808
+ },
809
+ division: "Europe",
810
+ divisionId: "12345",
811
+ departmentId: "12345",
812
+ departmentName: "12345",
813
+ team: {
814
+ id: "1234",
815
+ name: "Full Stack Engineers",
816
+ },
817
+ companyId: "23456",
818
+ companyName: "SpaceX",
819
+ employmentStartDate: "2021-10-26",
820
+ employmentEndDate: "2028-10-26",
821
+ leavingReason: "resigned",
822
+ employeeNumber: "123456-AB",
823
+ employmentStatus: "active",
824
+ ethnicity: "African American",
825
+ manager: {
826
+ id: "12345",
827
+ name: "Elon Musk",
828
+ firstName: "Elon",
829
+ lastName: "Musk",
830
+ email: "elon@musk.com",
831
+ employmentStatus: "active",
832
+ },
833
+ directReports: [
834
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
835
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
836
+ ],
837
+ socialSecurityNumber: "123456789",
838
+ birthday: new RFCDate("2000-08-12"),
839
+ deceasedOn: new RFCDate("2000-08-12"),
840
+ countryOfBirth: "US",
841
+ description: "A description",
842
+ gender: "male",
843
+ pronouns: "she,her",
844
+ preferredLanguage: "EN",
845
+ languages: [
846
+ "EN",
847
+ ],
848
+ nationalities: [
849
+ "US",
850
+ ],
851
+ photoUrl: "https://unavatar.io/elon-musk",
852
+ timezone: "Europe/London",
853
+ source: "lever",
854
+ sourceId: "12345",
855
+ recordUrl: "https://app.intercom.io/contacts/12345",
856
+ jobs: [
857
+ {
858
+ id: "12345",
859
+ employeeId: "12345",
860
+ title: "CEO",
861
+ role: "Sales",
862
+ startDate: new RFCDate("2020-08-12"),
863
+ endDate: new RFCDate("2020-08-12"),
864
+ compensationRate: 72000,
865
+ currency: "USD",
866
+ paymentUnit: "year",
867
+ hiredAt: new RFCDate("2020-08-12"),
868
+ isPrimary: true,
869
+ isManager: true,
870
+ status: "active",
871
+ location: {
872
+ id: "123",
873
+ type: "primary",
874
+ string: "25 Spring Street, Blackburn, VIC 3130",
875
+ name: "HQ US",
876
+ line1: "Main street",
877
+ line2: "apt #",
878
+ line3: "Suite #",
879
+ line4: "delivery instructions",
880
+ streetNumber: "25",
881
+ city: "San Francisco",
882
+ state: "CA",
883
+ postalCode: "94104",
884
+ country: "US",
885
+ latitude: "40.759211",
886
+ longitude: "-73.984638",
887
+ county: "Santa Clara",
888
+ contactName: "Elon Musk",
889
+ salutation: "Mr",
890
+ phoneNumber: "111-111-1111",
891
+ fax: "122-111-1111",
892
+ email: "elon@musk.com",
893
+ website: "https://elonmusk.com",
894
+ notes: "Address notes or delivery instructions.",
895
+ rowVersion: "1-12345",
896
+ },
897
+ },
898
+ {
899
+ id: "12345",
900
+ employeeId: "12345",
901
+ title: "CEO",
902
+ role: "Sales",
903
+ startDate: new RFCDate("2020-08-12"),
904
+ endDate: new RFCDate("2020-08-12"),
905
+ compensationRate: 72000,
906
+ currency: "USD",
907
+ paymentUnit: "year",
908
+ hiredAt: new RFCDate("2020-08-12"),
909
+ isPrimary: true,
910
+ isManager: true,
911
+ status: "active",
912
+ location: {
913
+ id: "123",
914
+ type: "primary",
915
+ string: "25 Spring Street, Blackburn, VIC 3130",
916
+ name: "HQ US",
917
+ line1: "Main street",
918
+ line2: "apt #",
919
+ line3: "Suite #",
920
+ line4: "delivery instructions",
921
+ streetNumber: "25",
922
+ city: "San Francisco",
923
+ state: "CA",
924
+ postalCode: "94104",
925
+ country: "US",
926
+ latitude: "40.759211",
927
+ longitude: "-73.984638",
928
+ county: "Santa Clara",
929
+ contactName: "Elon Musk",
930
+ salutation: "Mr",
931
+ phoneNumber: "111-111-1111",
932
+ fax: "122-111-1111",
933
+ email: "elon@musk.com",
934
+ website: "https://elonmusk.com",
935
+ notes: "Address notes or delivery instructions.",
936
+ rowVersion: "1-12345",
937
+ },
938
+ },
939
+ {
940
+ id: "12345",
941
+ employeeId: "12345",
942
+ title: "CEO",
943
+ role: "Sales",
944
+ startDate: new RFCDate("2020-08-12"),
945
+ endDate: new RFCDate("2020-08-12"),
946
+ compensationRate: 72000,
947
+ currency: "USD",
948
+ paymentUnit: "year",
949
+ hiredAt: new RFCDate("2020-08-12"),
950
+ isPrimary: true,
951
+ isManager: true,
952
+ status: "active",
953
+ location: {
954
+ id: "123",
955
+ type: "primary",
956
+ string: "25 Spring Street, Blackburn, VIC 3130",
957
+ name: "HQ US",
958
+ line1: "Main street",
959
+ line2: "apt #",
960
+ line3: "Suite #",
961
+ line4: "delivery instructions",
962
+ streetNumber: "25",
963
+ city: "San Francisco",
964
+ state: "CA",
965
+ postalCode: "94104",
966
+ country: "US",
967
+ latitude: "40.759211",
968
+ longitude: "-73.984638",
969
+ county: "Santa Clara",
970
+ contactName: "Elon Musk",
971
+ salutation: "Mr",
972
+ phoneNumber: "111-111-1111",
973
+ fax: "122-111-1111",
974
+ email: "elon@musk.com",
975
+ website: "https://elonmusk.com",
976
+ notes: "Address notes or delivery instructions.",
977
+ rowVersion: "1-12345",
978
+ },
979
+ },
980
+ ],
981
+ compensations: [
982
+ {
983
+ id: "3404301363494309004",
984
+ jobId: "3490439050957906679",
985
+ rate: 50,
986
+ paymentUnit: "hour",
987
+ flsaStatus: "nonexempt",
988
+ effectiveDate: "2021-06-11",
989
+ },
990
+ ],
991
+ worksRemote: true,
992
+ addresses: [
993
+ {
994
+ id: "123",
995
+ type: "primary",
996
+ string: "25 Spring Street, Blackburn, VIC 3130",
997
+ name: "HQ US",
998
+ line1: "Main street",
999
+ line2: "apt #",
1000
+ line3: "Suite #",
1001
+ line4: "delivery instructions",
1002
+ streetNumber: "25",
1003
+ city: "San Francisco",
1004
+ state: "CA",
1005
+ postalCode: "94104",
1006
+ country: "US",
1007
+ latitude: "40.759211",
1008
+ longitude: "-73.984638",
1009
+ county: "Santa Clara",
1010
+ contactName: "Elon Musk",
1011
+ salutation: "Mr",
1012
+ phoneNumber: "111-111-1111",
1013
+ fax: "122-111-1111",
1014
+ email: "elon@musk.com",
1015
+ website: "https://elonmusk.com",
1016
+ notes: "Address notes or delivery instructions.",
1017
+ rowVersion: "1-12345",
1018
+ },
1019
+ ],
1020
+ phoneNumbers: [
1021
+ {
1022
+ id: "12345",
1023
+ countryCode: "1",
1024
+ areaCode: "323",
1025
+ number: "111-111-1111",
1026
+ extension: "105",
1027
+ type: "primary",
1028
+ },
1029
+ {
1030
+ id: "12345",
1031
+ countryCode: "1",
1032
+ areaCode: "323",
1033
+ number: "111-111-1111",
1034
+ extension: "105",
1035
+ type: "primary",
1036
+ },
1037
+ {
1038
+ id: "12345",
1039
+ countryCode: "1",
1040
+ areaCode: "323",
1041
+ number: "111-111-1111",
1042
+ extension: "105",
1043
+ type: "primary",
1044
+ },
1045
+ ],
1046
+ emails: [
1047
+ {
1048
+ id: "123",
1049
+ email: "elon@musk.com",
1050
+ type: "primary",
1051
+ },
1052
+ {
1053
+ id: "123",
1054
+ email: "elon@musk.com",
1055
+ type: "primary",
1056
+ },
1057
+ ],
1058
+ customFields: [
1059
+ {
1060
+ id: "2389328923893298",
1061
+ name: "employee_level",
1062
+ description: "Employee Level",
1063
+ value: 10,
1064
+ },
1065
+ {
1066
+ id: "2389328923893298",
1067
+ name: "employee_level",
1068
+ description: "Employee Level",
1069
+ value: "Uses Salesforce and Marketo",
1070
+ },
1071
+ {
1072
+ id: "2389328923893298",
1073
+ name: "employee_level",
1074
+ description: "Employee Level",
1075
+ value: {},
1076
+ },
1077
+ ],
1078
+ socialLinks: [
1079
+ {
1080
+ id: "12345",
1081
+ url: "https://www.twitter.com/apideck",
1082
+ type: "twitter",
1083
+ },
1084
+ {
1085
+ id: "12345",
1086
+ url: "https://www.twitter.com/apideck",
1087
+ type: "twitter",
1088
+ },
1089
+ ],
1090
+ bankAccounts: [
1091
+ {
1092
+ bankName: "Monzo",
1093
+ accountNumber: "123465",
1094
+ accountName: "SPACEX LLC",
1095
+ accountType: "credit_card",
1096
+ iban: "CH2989144532982975332",
1097
+ bic: "AUDSCHGGXXX",
1098
+ routingNumber: "012345678",
1099
+ bsbNumber: "062-001",
1100
+ branchIdentifier: "001",
1101
+ bankCode: "BNH",
1102
+ currency: "USD",
1103
+ },
1104
+ {
1105
+ bankName: "Monzo",
1106
+ accountNumber: "123465",
1107
+ accountName: "SPACEX LLC",
1108
+ accountType: "credit_card",
1109
+ iban: "CH2989144532982975332",
1110
+ bic: "AUDSCHGGXXX",
1111
+ routingNumber: "012345678",
1112
+ bsbNumber: "062-001",
1113
+ branchIdentifier: "001",
1114
+ bankCode: "BNH",
1115
+ currency: "USD",
1116
+ },
1117
+ ],
1118
+ taxCode: "1111",
1119
+ taxId: "234-32-0000",
1120
+ dietaryPreference: "Veggie",
1121
+ foodAllergies: [
1122
+ "No allergies",
1123
+ ],
1124
+ probationPeriod: {
1125
+ startDate: new RFCDate("2021-10-01"),
1126
+ endDate: new RFCDate("2021-11-28"),
1127
+ },
1128
+ tags: [
1129
+ "New",
1130
+ ],
1131
+ rowVersion: "1-12345",
1132
+ deleted: true,
1133
+ updatedBy: "12345",
1134
+ createdBy: "12345",
1135
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
1136
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
1137
+ passThrough: [
1138
+ {
1139
+ serviceId: "<id>",
1140
+ extendPaths: [
1141
+ {
1142
+ path: "$.nested.property",
1143
+ value: {
1144
+ "TaxClassificationRef": {
1145
+ "value": "EUC-99990201-V1-00020000",
1146
+ },
1147
+ },
1148
+ },
1149
+ {
1150
+ path: "$.nested.property",
1151
+ value: {
1152
+ "TaxClassificationRef": {
1153
+ "value": "EUC-99990201-V1-00020000",
1154
+ },
1155
+ },
1156
+ },
1157
+ ],
1158
+ },
1159
+ {
1160
+ serviceId: "<id>",
1161
+ extendPaths: [
1162
+ {
1163
+ path: "$.nested.property",
1164
+ value: {
1165
+ "TaxClassificationRef": {
1166
+ "value": "EUC-99990201-V1-00020000",
1167
+ },
1168
+ },
1169
+ },
1170
+ ],
1171
+ },
1172
+ ],
1173
+ },
1174
+ ],
1175
+ meta: {
1176
+ itemsOnPage: 50,
1177
+ cursors: {
1178
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
1179
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
1180
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
1181
+ },
1182
+ },
1183
+ links: {
1184
+ previous:
1185
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
1186
+ current: "https://unify.apideck.com/crm/companies",
1187
+ next:
1188
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
1189
+ },
1190
+ });
1191
+ });
1192
+
1193
+ it.skip("Employees Hris Employees Add", async () => {
1194
+ assert.fail(
1195
+ "incomplete test found please make sure to address the following errors: [`workflow step hris.employeesAdd.test referencing operation hris.employeesAdd with expression in requestBody with type not currently supported`, `workflow step hris.employeesAdd.test referencing operation hris.employeesAdd with expression in requestBody with type not currently supported`, `workflow step hris.employeesAdd.test referencing operation hris.employeesAdd with expression in requestBody with type not currently supported`]",
1196
+ );
1197
+ });
1198
+
1199
+ test("Employees Hris Employees One", async () => {
1200
+ const testHttpClient = createTestHTTPClient("hris.employeesOne");
1201
+
1202
+ const apideck = new Apideck({
1203
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1204
+ httpClient: testHttpClient,
1205
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
1206
+ });
1207
+
1208
+ const result = await apideck.hris.employees.get({
1209
+ id: "<id>",
1210
+ serviceId: "salesforce",
1211
+ fields: "id,updated_at",
1212
+ filter: {
1213
+ companyId: "1234",
1214
+ },
1215
+ passThrough: {
1216
+ "search": "San Francisco",
1217
+ },
1218
+ });
1219
+ expect(result.httpMeta.response.status).toBe(200);
1220
+ expect(result.getEmployeeResponse).toBeDefined();
1221
+ expect(result.getEmployeeResponse).toEqual({
1222
+ statusCode: 200,
1223
+ status: "OK",
1224
+ service: "sage-hr",
1225
+ resource: "Employees",
1226
+ operation: "one",
1227
+ data: {
1228
+ id: "12345",
1229
+ downstreamId: "12345",
1230
+ firstName: "Elon",
1231
+ lastName: "Musk",
1232
+ middleName: "D.",
1233
+ displayName: "Technoking",
1234
+ preferredName: "Elon Musk",
1235
+ initials: "EM",
1236
+ salutation: "Mr",
1237
+ title: "CEO",
1238
+ maritalStatus: "married",
1239
+ partner: {
1240
+ id: "12345",
1241
+ firstName: "Elon",
1242
+ lastName: "Musk",
1243
+ middleName: "D.",
1244
+ gender: "male",
1245
+ initials: "EM",
1246
+ birthday: new RFCDate("2000-08-12"),
1247
+ deceasedOn: new RFCDate("2000-08-12"),
1248
+ },
1249
+ division: "Europe",
1250
+ divisionId: "12345",
1251
+ departmentId: "12345",
1252
+ departmentName: "12345",
1253
+ team: {
1254
+ id: "1234",
1255
+ name: "Full Stack Engineers",
1256
+ },
1257
+ companyId: "23456",
1258
+ companyName: "SpaceX",
1259
+ employmentStartDate: "2021-10-26",
1260
+ employmentEndDate: "2028-10-26",
1261
+ leavingReason: "resigned",
1262
+ employeeNumber: "123456-AB",
1263
+ employmentStatus: "active",
1264
+ ethnicity: "African American",
1265
+ manager: {
1266
+ id: "12345",
1267
+ name: "Elon Musk",
1268
+ firstName: "Elon",
1269
+ lastName: "Musk",
1270
+ email: "elon@musk.com",
1271
+ employmentStatus: "active",
1272
+ },
1273
+ directReports: [
1274
+ "a0d636c6-43b3-4bde-8c70-85b707d992f4",
1275
+ "a98lfd96-43b3-4bde-8c70-85b707d992e6",
1276
+ ],
1277
+ socialSecurityNumber: "123456789",
1278
+ birthday: new RFCDate("2000-08-12"),
1279
+ deceasedOn: new RFCDate("2000-08-12"),
1280
+ countryOfBirth: "US",
1281
+ description: "A description",
1282
+ gender: "male",
1283
+ pronouns: "she,her",
1284
+ preferredLanguage: "EN",
1285
+ languages: [
1286
+ "EN",
1287
+ ],
1288
+ nationalities: [
1289
+ "US",
1290
+ ],
1291
+ photoUrl: "https://unavatar.io/elon-musk",
1292
+ timezone: "Europe/London",
1293
+ source: "lever",
1294
+ sourceId: "12345",
1295
+ recordUrl: "https://app.intercom.io/contacts/12345",
1296
+ jobs: [
1297
+ {
1298
+ id: "12345",
1299
+ employeeId: "12345",
1300
+ title: "CEO",
1301
+ role: "Sales",
1302
+ startDate: new RFCDate("2020-08-12"),
1303
+ endDate: new RFCDate("2020-08-12"),
1304
+ compensationRate: 72000,
1305
+ currency: "USD",
1306
+ paymentUnit: "year",
1307
+ hiredAt: new RFCDate("2020-08-12"),
1308
+ isPrimary: true,
1309
+ isManager: true,
1310
+ status: "active",
1311
+ location: {
1312
+ id: "123",
1313
+ type: "primary",
1314
+ string: "25 Spring Street, Blackburn, VIC 3130",
1315
+ name: "HQ US",
1316
+ line1: "Main street",
1317
+ line2: "apt #",
1318
+ line3: "Suite #",
1319
+ line4: "delivery instructions",
1320
+ streetNumber: "25",
1321
+ city: "San Francisco",
1322
+ state: "CA",
1323
+ postalCode: "94104",
1324
+ country: "US",
1325
+ latitude: "40.759211",
1326
+ longitude: "-73.984638",
1327
+ county: "Santa Clara",
1328
+ contactName: "Elon Musk",
1329
+ salutation: "Mr",
1330
+ phoneNumber: "111-111-1111",
1331
+ fax: "122-111-1111",
1332
+ email: "elon@musk.com",
1333
+ website: "https://elonmusk.com",
1334
+ notes: "Address notes or delivery instructions.",
1335
+ rowVersion: "1-12345",
1336
+ },
1337
+ },
1338
+ {
1339
+ id: "12345",
1340
+ employeeId: "12345",
1341
+ title: "CEO",
1342
+ role: "Sales",
1343
+ startDate: new RFCDate("2020-08-12"),
1344
+ endDate: new RFCDate("2020-08-12"),
1345
+ compensationRate: 72000,
1346
+ currency: "USD",
1347
+ paymentUnit: "year",
1348
+ hiredAt: new RFCDate("2020-08-12"),
1349
+ isPrimary: true,
1350
+ isManager: true,
1351
+ status: "active",
1352
+ location: {
1353
+ id: "123",
1354
+ type: "primary",
1355
+ string: "25 Spring Street, Blackburn, VIC 3130",
1356
+ name: "HQ US",
1357
+ line1: "Main street",
1358
+ line2: "apt #",
1359
+ line3: "Suite #",
1360
+ line4: "delivery instructions",
1361
+ streetNumber: "25",
1362
+ city: "San Francisco",
1363
+ state: "CA",
1364
+ postalCode: "94104",
1365
+ country: "US",
1366
+ latitude: "40.759211",
1367
+ longitude: "-73.984638",
1368
+ county: "Santa Clara",
1369
+ contactName: "Elon Musk",
1370
+ salutation: "Mr",
1371
+ phoneNumber: "111-111-1111",
1372
+ fax: "122-111-1111",
1373
+ email: "elon@musk.com",
1374
+ website: "https://elonmusk.com",
1375
+ notes: "Address notes or delivery instructions.",
1376
+ rowVersion: "1-12345",
1377
+ },
1378
+ },
1379
+ {
1380
+ id: "12345",
1381
+ employeeId: "12345",
1382
+ title: "CEO",
1383
+ role: "Sales",
1384
+ startDate: new RFCDate("2020-08-12"),
1385
+ endDate: new RFCDate("2020-08-12"),
1386
+ compensationRate: 72000,
1387
+ currency: "USD",
1388
+ paymentUnit: "year",
1389
+ hiredAt: new RFCDate("2020-08-12"),
1390
+ isPrimary: true,
1391
+ isManager: true,
1392
+ status: "active",
1393
+ location: {
1394
+ id: "123",
1395
+ type: "primary",
1396
+ string: "25 Spring Street, Blackburn, VIC 3130",
1397
+ name: "HQ US",
1398
+ line1: "Main street",
1399
+ line2: "apt #",
1400
+ line3: "Suite #",
1401
+ line4: "delivery instructions",
1402
+ streetNumber: "25",
1403
+ city: "San Francisco",
1404
+ state: "CA",
1405
+ postalCode: "94104",
1406
+ country: "US",
1407
+ latitude: "40.759211",
1408
+ longitude: "-73.984638",
1409
+ county: "Santa Clara",
1410
+ contactName: "Elon Musk",
1411
+ salutation: "Mr",
1412
+ phoneNumber: "111-111-1111",
1413
+ fax: "122-111-1111",
1414
+ email: "elon@musk.com",
1415
+ website: "https://elonmusk.com",
1416
+ notes: "Address notes or delivery instructions.",
1417
+ rowVersion: "1-12345",
1418
+ },
1419
+ },
1420
+ ],
1421
+ compensations: [
1422
+ {
1423
+ id: "3404301363494309004",
1424
+ jobId: "3490439050957906679",
1425
+ rate: 50,
1426
+ paymentUnit: "hour",
1427
+ flsaStatus: "nonexempt",
1428
+ effectiveDate: "2021-06-11",
1429
+ },
1430
+ ],
1431
+ worksRemote: true,
1432
+ addresses: [
1433
+ {
1434
+ id: "123",
1435
+ type: "primary",
1436
+ string: "25 Spring Street, Blackburn, VIC 3130",
1437
+ name: "HQ US",
1438
+ line1: "Main street",
1439
+ line2: "apt #",
1440
+ line3: "Suite #",
1441
+ line4: "delivery instructions",
1442
+ streetNumber: "25",
1443
+ city: "San Francisco",
1444
+ state: "CA",
1445
+ postalCode: "94104",
1446
+ country: "US",
1447
+ latitude: "40.759211",
1448
+ longitude: "-73.984638",
1449
+ county: "Santa Clara",
1450
+ contactName: "Elon Musk",
1451
+ salutation: "Mr",
1452
+ phoneNumber: "111-111-1111",
1453
+ fax: "122-111-1111",
1454
+ email: "elon@musk.com",
1455
+ website: "https://elonmusk.com",
1456
+ notes: "Address notes or delivery instructions.",
1457
+ rowVersion: "1-12345",
1458
+ },
1459
+ {
1460
+ id: "123",
1461
+ type: "primary",
1462
+ string: "25 Spring Street, Blackburn, VIC 3130",
1463
+ name: "HQ US",
1464
+ line1: "Main street",
1465
+ line2: "apt #",
1466
+ line3: "Suite #",
1467
+ line4: "delivery instructions",
1468
+ streetNumber: "25",
1469
+ city: "San Francisco",
1470
+ state: "CA",
1471
+ postalCode: "94104",
1472
+ country: "US",
1473
+ latitude: "40.759211",
1474
+ longitude: "-73.984638",
1475
+ county: "Santa Clara",
1476
+ contactName: "Elon Musk",
1477
+ salutation: "Mr",
1478
+ phoneNumber: "111-111-1111",
1479
+ fax: "122-111-1111",
1480
+ email: "elon@musk.com",
1481
+ website: "https://elonmusk.com",
1482
+ notes: "Address notes or delivery instructions.",
1483
+ rowVersion: "1-12345",
1484
+ },
1485
+ ],
1486
+ phoneNumbers: [
1487
+ {
1488
+ id: "12345",
1489
+ countryCode: "1",
1490
+ areaCode: "323",
1491
+ number: "111-111-1111",
1492
+ extension: "105",
1493
+ type: "primary",
1494
+ },
1495
+ {
1496
+ id: "12345",
1497
+ countryCode: "1",
1498
+ areaCode: "323",
1499
+ number: "111-111-1111",
1500
+ extension: "105",
1501
+ type: "primary",
1502
+ },
1503
+ ],
1504
+ emails: [
1505
+ {
1506
+ id: "123",
1507
+ email: "elon@musk.com",
1508
+ type: "primary",
1509
+ },
1510
+ {
1511
+ id: "123",
1512
+ email: "elon@musk.com",
1513
+ type: "primary",
1514
+ },
1515
+ ],
1516
+ customFields: [
1517
+ {
1518
+ id: "2389328923893298",
1519
+ name: "employee_level",
1520
+ description: "Employee Level",
1521
+ value: true,
1522
+ },
1523
+ {
1524
+ id: "2389328923893298",
1525
+ name: "employee_level",
1526
+ description: "Employee Level",
1527
+ value: true,
1528
+ },
1529
+ {
1530
+ id: "2389328923893298",
1531
+ name: "employee_level",
1532
+ description: "Employee Level",
1533
+ value: 10,
1534
+ },
1535
+ ],
1536
+ socialLinks: [
1537
+ {
1538
+ id: "12345",
1539
+ url: "https://www.twitter.com/apideck",
1540
+ type: "twitter",
1541
+ },
1542
+ ],
1543
+ bankAccounts: [
1544
+ {
1545
+ bankName: "Monzo",
1546
+ accountNumber: "123465",
1547
+ accountName: "SPACEX LLC",
1548
+ accountType: "credit_card",
1549
+ iban: "CH2989144532982975332",
1550
+ bic: "AUDSCHGGXXX",
1551
+ routingNumber: "012345678",
1552
+ bsbNumber: "062-001",
1553
+ branchIdentifier: "001",
1554
+ bankCode: "BNH",
1555
+ currency: "USD",
1556
+ },
1557
+ {
1558
+ bankName: "Monzo",
1559
+ accountNumber: "123465",
1560
+ accountName: "SPACEX LLC",
1561
+ accountType: "credit_card",
1562
+ iban: "CH2989144532982975332",
1563
+ bic: "AUDSCHGGXXX",
1564
+ routingNumber: "012345678",
1565
+ bsbNumber: "062-001",
1566
+ branchIdentifier: "001",
1567
+ bankCode: "BNH",
1568
+ currency: "USD",
1569
+ },
1570
+ {
1571
+ bankName: "Monzo",
1572
+ accountNumber: "123465",
1573
+ accountName: "SPACEX LLC",
1574
+ accountType: "credit_card",
1575
+ iban: "CH2989144532982975332",
1576
+ bic: "AUDSCHGGXXX",
1577
+ routingNumber: "012345678",
1578
+ bsbNumber: "062-001",
1579
+ branchIdentifier: "001",
1580
+ bankCode: "BNH",
1581
+ currency: "USD",
1582
+ },
1583
+ ],
1584
+ taxCode: "1111",
1585
+ taxId: "234-32-0000",
1586
+ dietaryPreference: "Veggie",
1587
+ foodAllergies: [
1588
+ "No allergies",
1589
+ ],
1590
+ probationPeriod: {
1591
+ startDate: new RFCDate("2021-10-01"),
1592
+ endDate: new RFCDate("2021-11-28"),
1593
+ },
1594
+ tags: [
1595
+ "New",
1596
+ ],
1597
+ rowVersion: "1-12345",
1598
+ deleted: true,
1599
+ updatedBy: "12345",
1600
+ createdBy: "12345",
1601
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
1602
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
1603
+ passThrough: [
1604
+ {
1605
+ serviceId: "<id>",
1606
+ extendPaths: [
1607
+ {
1608
+ path: "$.nested.property",
1609
+ value: {
1610
+ "TaxClassificationRef": {
1611
+ "value": "EUC-99990201-V1-00020000",
1612
+ },
1613
+ },
1614
+ },
1615
+ {
1616
+ path: "$.nested.property",
1617
+ value: {
1618
+ "TaxClassificationRef": {
1619
+ "value": "EUC-99990201-V1-00020000",
1620
+ },
1621
+ },
1622
+ },
1623
+ {
1624
+ path: "$.nested.property",
1625
+ value: {
1626
+ "TaxClassificationRef": {
1627
+ "value": "EUC-99990201-V1-00020000",
1628
+ },
1629
+ },
1630
+ },
1631
+ ],
1632
+ },
1633
+ {
1634
+ serviceId: "<id>",
1635
+ extendPaths: [
1636
+ {
1637
+ path: "$.nested.property",
1638
+ value: {
1639
+ "TaxClassificationRef": {
1640
+ "value": "EUC-99990201-V1-00020000",
1641
+ },
1642
+ },
1643
+ },
1644
+ ],
1645
+ },
1646
+ ],
1647
+ },
1648
+ });
1649
+ });
1650
+
1651
+ it.skip("Employees Hris Employees Update", async () => {
1652
+ assert.fail(
1653
+ "incomplete test found please make sure to address the following errors: [`workflow step hris.employeesUpdate.test referencing operation hris.employeesUpdate with expression in requestBody with type not currently supported`]",
1654
+ );
1655
+ });
1656
+
1657
+ test("Employees Hris Employees Delete", async () => {
1658
+ const testHttpClient = createTestHTTPClient("hris.employeesDelete");
1659
+
1660
+ const apideck = new Apideck({
1661
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1662
+ httpClient: testHttpClient,
1663
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
1664
+ });
1665
+
1666
+ const result = await apideck.hris.employees.delete({
1667
+ id: "<id>",
1668
+ serviceId: "salesforce",
1669
+ });
1670
+ expect(result.httpMeta.response.status).toBe(200);
1671
+ expect(result.deleteEmployeeResponse).toBeDefined();
1672
+ expect(result.deleteEmployeeResponse).toEqual({
1673
+ statusCode: 200,
1674
+ status: "OK",
1675
+ service: "sage-hr",
1676
+ resource: "Employees",
1677
+ operation: "delete",
1678
+ data: {
1679
+ id: "12345",
1680
+ },
1681
+ });
1682
+ });