@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,48 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { getRandomValues } from "crypto";
6
+ import { HTTPClient } from "../lib/http.js";
7
+
8
+ export function createTestHTTPClient(testName: string): HTTPClient {
9
+ const httpClient = new HTTPClient({
10
+ fetcher: (request: URL | RequestInfo) => {
11
+ return fetch(request);
12
+ },
13
+ });
14
+
15
+ const testInstanceId = genTestId();
16
+
17
+ httpClient.addHook("beforeRequest", (request: Request) => {
18
+ const nextRequest = new Request(request, {
19
+ signal: request.signal || AbortSignal.timeout(5000),
20
+ });
21
+
22
+ nextRequest.headers.set("x-speakeasy-test-name", testName);
23
+ nextRequest.headers.set("x-speakeasy-test-instance-id", testInstanceId);
24
+
25
+ return nextRequest;
26
+ });
27
+
28
+ return httpClient;
29
+ }
30
+
31
+ function genTestId(): string {
32
+ const b = new Uint8Array(16);
33
+ getRandomValues(b);
34
+
35
+ return `${buf2hex(b.slice(0, 4))}-${buf2hex(b.slice(4, 6))}-${
36
+ buf2hex(
37
+ b.slice(6, 8),
38
+ )
39
+ }-${buf2hex(b.slice(8, 10))}-${buf2hex(b.slice(10))}`;
40
+ }
41
+
42
+ // Helper function to convert buffer to hex string
43
+ function buf2hex(buffer: Uint8Array): string {
44
+ return [...buffer]
45
+ .map((x) => x.toString(16).padStart(2, "0"))
46
+ .join("")
47
+ .toUpperCase();
48
+ }
@@ -0,0 +1,588 @@
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("Timeoffrequests Hris Time Off Requests All", async () => {
10
+ const testHttpClient = createTestHTTPClient("hris.timeOffRequestsAll");
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.hris.timeOffRequests.list({
19
+ consumerId: "test-consumer",
20
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
21
+ serviceId: "salesforce",
22
+ filter: {
23
+ startDate: "2022-04-08",
24
+ endDate: "2022-04-21",
25
+ updatedSince: "2020-09-30T07:43:32.000Z",
26
+ employeeId: "1234",
27
+ timeOffRequestStatus: "approved",
28
+ companyId: "1234",
29
+ },
30
+ passThrough: {
31
+ "search": "San Francisco",
32
+ },
33
+ fields: "id,updated_at",
34
+ });
35
+ expect(result.httpMeta.response.status).toBe(200);
36
+ expect(result.getTimeOffRequestsResponse).toBeDefined();
37
+ expect(result.getTimeOffRequestsResponse).toEqual({
38
+ statusCode: 200,
39
+ status: "OK",
40
+ service: "bamboohr",
41
+ resource: "time-off-requests",
42
+ operation: "all",
43
+ data: [
44
+ {
45
+ id: "12345",
46
+ employeeId: "12345",
47
+ policyId: "12345",
48
+ status: "approved",
49
+ description: "Enjoying some sun.",
50
+ startDate: "2022-04-01",
51
+ endDate: "2022-04-01",
52
+ requestDate: "2022-03-21",
53
+ requestType: "vacation",
54
+ approvalDate: "2022-03-21",
55
+ units: "hours",
56
+ amount: 3.5,
57
+ dayPart: "morning",
58
+ notes: {
59
+ employee: "Relaxing on the beach for a few hours.",
60
+ manager: "Enjoy!",
61
+ },
62
+ updatedBy: "12345",
63
+ createdBy: "12345",
64
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
65
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
66
+ passThrough: [
67
+ {
68
+ serviceId: "<id>",
69
+ extendPaths: [
70
+ {
71
+ path: "$.nested.property",
72
+ value: {
73
+ "TaxClassificationRef": {
74
+ "value": "EUC-99990201-V1-00020000",
75
+ },
76
+ },
77
+ },
78
+ {
79
+ path: "$.nested.property",
80
+ value: {
81
+ "TaxClassificationRef": {
82
+ "value": "EUC-99990201-V1-00020000",
83
+ },
84
+ },
85
+ },
86
+ {
87
+ path: "$.nested.property",
88
+ value: {
89
+ "TaxClassificationRef": {
90
+ "value": "EUC-99990201-V1-00020000",
91
+ },
92
+ },
93
+ },
94
+ ],
95
+ },
96
+ {
97
+ serviceId: "<id>",
98
+ extendPaths: [
99
+ {
100
+ path: "$.nested.property",
101
+ value: {
102
+ "TaxClassificationRef": {
103
+ "value": "EUC-99990201-V1-00020000",
104
+ },
105
+ },
106
+ },
107
+ ],
108
+ },
109
+ ],
110
+ policyType: "sick",
111
+ },
112
+ {
113
+ id: "12345",
114
+ employeeId: "12345",
115
+ policyId: "12345",
116
+ status: "approved",
117
+ description: "Enjoying some sun.",
118
+ startDate: "2022-04-01",
119
+ endDate: "2022-04-01",
120
+ requestDate: "2022-03-21",
121
+ requestType: "vacation",
122
+ approvalDate: "2022-03-21",
123
+ units: "hours",
124
+ amount: 3.5,
125
+ dayPart: "morning",
126
+ notes: {
127
+ employee: "Relaxing on the beach for a few hours.",
128
+ manager: "Enjoy!",
129
+ },
130
+ updatedBy: "12345",
131
+ createdBy: "12345",
132
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
133
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
134
+ passThrough: [
135
+ {
136
+ serviceId: "<id>",
137
+ extendPaths: [
138
+ {
139
+ path: "$.nested.property",
140
+ value: {
141
+ "TaxClassificationRef": {
142
+ "value": "EUC-99990201-V1-00020000",
143
+ },
144
+ },
145
+ },
146
+ ],
147
+ },
148
+ ],
149
+ policyType: "sick",
150
+ },
151
+ {
152
+ id: "12345",
153
+ employeeId: "12345",
154
+ policyId: "12345",
155
+ status: "approved",
156
+ description: "Enjoying some sun.",
157
+ startDate: "2022-04-01",
158
+ endDate: "2022-04-01",
159
+ requestDate: "2022-03-21",
160
+ requestType: "vacation",
161
+ approvalDate: "2022-03-21",
162
+ units: "hours",
163
+ amount: 3.5,
164
+ dayPart: "morning",
165
+ notes: {
166
+ employee: "Relaxing on the beach for a few hours.",
167
+ manager: "Enjoy!",
168
+ },
169
+ updatedBy: "12345",
170
+ createdBy: "12345",
171
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
172
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
173
+ passThrough: [
174
+ {
175
+ serviceId: "<id>",
176
+ extendPaths: [
177
+ {
178
+ path: "$.nested.property",
179
+ value: {
180
+ "TaxClassificationRef": {
181
+ "value": "EUC-99990201-V1-00020000",
182
+ },
183
+ },
184
+ },
185
+ {
186
+ path: "$.nested.property",
187
+ value: {
188
+ "TaxClassificationRef": {
189
+ "value": "EUC-99990201-V1-00020000",
190
+ },
191
+ },
192
+ },
193
+ ],
194
+ },
195
+ {
196
+ serviceId: "<id>",
197
+ extendPaths: [
198
+ {
199
+ path: "$.nested.property",
200
+ value: {
201
+ "TaxClassificationRef": {
202
+ "value": "EUC-99990201-V1-00020000",
203
+ },
204
+ },
205
+ },
206
+ ],
207
+ },
208
+ ],
209
+ policyType: "sick",
210
+ },
211
+ ],
212
+ meta: {
213
+ itemsOnPage: 50,
214
+ cursors: {
215
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
216
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
217
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
218
+ },
219
+ },
220
+ links: {
221
+ previous:
222
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
223
+ current: "https://unify.apideck.com/crm/companies",
224
+ next:
225
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
226
+ },
227
+ });
228
+ });
229
+
230
+ test("Timeoffrequests Hris Time Off Requests Add", async () => {
231
+ const testHttpClient = createTestHTTPClient("hris.timeOffRequestsAdd");
232
+
233
+ const apideck = new Apideck({
234
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
235
+ httpClient: testHttpClient,
236
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
237
+ });
238
+
239
+ const result = await apideck.hris.timeOffRequests.create({
240
+ consumerId: "test-consumer",
241
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
242
+ serviceId: "salesforce",
243
+ timeOffRequest: {
244
+ employeeId: "12345",
245
+ policyId: "12345",
246
+ status: "approved",
247
+ description: "Enjoying some sun.",
248
+ startDate: "2022-04-01",
249
+ endDate: "2022-04-01",
250
+ requestDate: "2022-03-21",
251
+ requestType: "vacation",
252
+ approvalDate: "2022-03-21",
253
+ units: "hours",
254
+ amount: 3.5,
255
+ dayPart: "morning",
256
+ notes: {
257
+ employee: "Relaxing on the beach for a few hours.",
258
+ manager: "Enjoy!",
259
+ },
260
+ passThrough: [
261
+ {
262
+ serviceId: "<id>",
263
+ extendPaths: [
264
+ {
265
+ path: "$.nested.property",
266
+ value: {
267
+ "TaxClassificationRef": {
268
+ "value": "EUC-99990201-V1-00020000",
269
+ },
270
+ },
271
+ },
272
+ {
273
+ path: "$.nested.property",
274
+ value: {
275
+ "TaxClassificationRef": {
276
+ "value": "EUC-99990201-V1-00020000",
277
+ },
278
+ },
279
+ },
280
+ ],
281
+ },
282
+ {
283
+ serviceId: "<id>",
284
+ extendPaths: [
285
+ {
286
+ path: "$.nested.property",
287
+ value: {
288
+ "TaxClassificationRef": {
289
+ "value": "EUC-99990201-V1-00020000",
290
+ },
291
+ },
292
+ },
293
+ {
294
+ path: "$.nested.property",
295
+ value: {
296
+ "TaxClassificationRef": {
297
+ "value": "EUC-99990201-V1-00020000",
298
+ },
299
+ },
300
+ },
301
+ ],
302
+ },
303
+ ],
304
+ policyType: "sick",
305
+ },
306
+ });
307
+ expect(result.httpMeta.response.status).toBe(201);
308
+ expect(result.createTimeOffRequestResponse).toBeDefined();
309
+ expect(result.createTimeOffRequestResponse).toEqual({
310
+ statusCode: 200,
311
+ status: "OK",
312
+ service: "bamboohr",
313
+ resource: "time-off-requests",
314
+ operation: "add",
315
+ data: {
316
+ id: "12345",
317
+ },
318
+ });
319
+ });
320
+
321
+ test("Timeoffrequests Hris Time Off Requests One", async () => {
322
+ const testHttpClient = createTestHTTPClient("hris.timeOffRequestsOne");
323
+
324
+ const apideck = new Apideck({
325
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
326
+ httpClient: testHttpClient,
327
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
328
+ });
329
+
330
+ const result = await apideck.hris.timeOffRequests.get({
331
+ id: "<id>",
332
+ consumerId: "test-consumer",
333
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
334
+ serviceId: "salesforce",
335
+ fields: "id,updated_at",
336
+ employeeId: "<id>",
337
+ });
338
+ expect(result.httpMeta.response.status).toBe(200);
339
+ expect(result.getTimeOffRequestResponse).toBeDefined();
340
+ expect(result.getTimeOffRequestResponse).toEqual({
341
+ statusCode: 200,
342
+ status: "OK",
343
+ service: "bamboohr",
344
+ resource: "time-off-requests",
345
+ operation: "one",
346
+ data: {
347
+ id: "12345",
348
+ employeeId: "12345",
349
+ policyId: "12345",
350
+ status: "approved",
351
+ description: "Enjoying some sun.",
352
+ startDate: "2022-04-01",
353
+ endDate: "2022-04-01",
354
+ requestDate: "2022-03-21",
355
+ requestType: "vacation",
356
+ approvalDate: "2022-03-21",
357
+ units: "hours",
358
+ amount: 3.5,
359
+ dayPart: "morning",
360
+ notes: {
361
+ employee: "Relaxing on the beach for a few hours.",
362
+ manager: "Enjoy!",
363
+ },
364
+ updatedBy: "12345",
365
+ createdBy: "12345",
366
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
367
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
368
+ passThrough: [
369
+ {
370
+ serviceId: "<id>",
371
+ extendPaths: [
372
+ {
373
+ path: "$.nested.property",
374
+ value: {
375
+ "TaxClassificationRef": {
376
+ "value": "EUC-99990201-V1-00020000",
377
+ },
378
+ },
379
+ },
380
+ {
381
+ path: "$.nested.property",
382
+ value: {
383
+ "TaxClassificationRef": {
384
+ "value": "EUC-99990201-V1-00020000",
385
+ },
386
+ },
387
+ },
388
+ ],
389
+ },
390
+ {
391
+ serviceId: "<id>",
392
+ extendPaths: [
393
+ {
394
+ path: "$.nested.property",
395
+ value: {
396
+ "TaxClassificationRef": {
397
+ "value": "EUC-99990201-V1-00020000",
398
+ },
399
+ },
400
+ },
401
+ {
402
+ path: "$.nested.property",
403
+ value: {
404
+ "TaxClassificationRef": {
405
+ "value": "EUC-99990201-V1-00020000",
406
+ },
407
+ },
408
+ },
409
+ ],
410
+ },
411
+ {
412
+ serviceId: "<id>",
413
+ extendPaths: [
414
+ {
415
+ path: "$.nested.property",
416
+ value: {
417
+ "TaxClassificationRef": {
418
+ "value": "EUC-99990201-V1-00020000",
419
+ },
420
+ },
421
+ },
422
+ {
423
+ path: "$.nested.property",
424
+ value: {
425
+ "TaxClassificationRef": {
426
+ "value": "EUC-99990201-V1-00020000",
427
+ },
428
+ },
429
+ },
430
+ ],
431
+ },
432
+ ],
433
+ policyType: "sick",
434
+ },
435
+ });
436
+ });
437
+
438
+ test("Timeoffrequests Hris Time Off Requests Update", async () => {
439
+ const testHttpClient = createTestHTTPClient("hris.timeOffRequestsUpdate");
440
+
441
+ const apideck = new Apideck({
442
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
443
+ httpClient: testHttpClient,
444
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
445
+ });
446
+
447
+ const result = await apideck.hris.timeOffRequests.update({
448
+ id: "<id>",
449
+ consumerId: "test-consumer",
450
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
451
+ serviceId: "salesforce",
452
+ employeeId: "<id>",
453
+ timeOffRequest: {
454
+ employeeId: "12345",
455
+ policyId: "12345",
456
+ status: "approved",
457
+ description: "Enjoying some sun.",
458
+ startDate: "2022-04-01",
459
+ endDate: "2022-04-01",
460
+ requestDate: "2022-03-21",
461
+ requestType: "vacation",
462
+ approvalDate: "2022-03-21",
463
+ units: "hours",
464
+ amount: 3.5,
465
+ dayPart: "morning",
466
+ notes: {
467
+ employee: "Relaxing on the beach for a few hours.",
468
+ manager: "Enjoy!",
469
+ },
470
+ passThrough: [
471
+ {
472
+ serviceId: "<id>",
473
+ extendPaths: [
474
+ {
475
+ path: "$.nested.property",
476
+ value: {
477
+ "TaxClassificationRef": {
478
+ "value": "EUC-99990201-V1-00020000",
479
+ },
480
+ },
481
+ },
482
+ {
483
+ path: "$.nested.property",
484
+ value: {
485
+ "TaxClassificationRef": {
486
+ "value": "EUC-99990201-V1-00020000",
487
+ },
488
+ },
489
+ },
490
+ ],
491
+ },
492
+ {
493
+ serviceId: "<id>",
494
+ extendPaths: [
495
+ {
496
+ path: "$.nested.property",
497
+ value: {
498
+ "TaxClassificationRef": {
499
+ "value": "EUC-99990201-V1-00020000",
500
+ },
501
+ },
502
+ },
503
+ {
504
+ path: "$.nested.property",
505
+ value: {
506
+ "TaxClassificationRef": {
507
+ "value": "EUC-99990201-V1-00020000",
508
+ },
509
+ },
510
+ },
511
+ ],
512
+ },
513
+ {
514
+ serviceId: "<id>",
515
+ extendPaths: [
516
+ {
517
+ path: "$.nested.property",
518
+ value: {
519
+ "TaxClassificationRef": {
520
+ "value": "EUC-99990201-V1-00020000",
521
+ },
522
+ },
523
+ },
524
+ {
525
+ path: "$.nested.property",
526
+ value: {
527
+ "TaxClassificationRef": {
528
+ "value": "EUC-99990201-V1-00020000",
529
+ },
530
+ },
531
+ },
532
+ {
533
+ path: "$.nested.property",
534
+ value: {
535
+ "TaxClassificationRef": {
536
+ "value": "EUC-99990201-V1-00020000",
537
+ },
538
+ },
539
+ },
540
+ ],
541
+ },
542
+ ],
543
+ policyType: "sick",
544
+ },
545
+ });
546
+ expect(result.httpMeta.response.status).toBe(200);
547
+ expect(result.updateTimeOffRequestResponse).toBeDefined();
548
+ expect(result.updateTimeOffRequestResponse).toEqual({
549
+ statusCode: 200,
550
+ status: "OK",
551
+ service: "bamboohr",
552
+ resource: "time-off-requests",
553
+ operation: "update",
554
+ data: {
555
+ id: "12345",
556
+ },
557
+ });
558
+ });
559
+
560
+ test("Timeoffrequests Hris Time Off Requests Delete", async () => {
561
+ const testHttpClient = createTestHTTPClient("hris.timeOffRequestsDelete");
562
+
563
+ const apideck = new Apideck({
564
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
565
+ httpClient: testHttpClient,
566
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
567
+ });
568
+
569
+ const result = await apideck.hris.timeOffRequests.delete({
570
+ id: "<id>",
571
+ consumerId: "test-consumer",
572
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
573
+ serviceId: "salesforce",
574
+ employeeId: "<id>",
575
+ });
576
+ expect(result.httpMeta.response.status).toBe(200);
577
+ expect(result.deleteTimeOffRequestResponse).toBeDefined();
578
+ expect(result.deleteTimeOffRequestResponse).toEqual({
579
+ statusCode: 200,
580
+ status: "OK",
581
+ service: "bamboohr",
582
+ resource: "time-off-requests",
583
+ operation: "delete",
584
+ data: {
585
+ id: "12345",
586
+ },
587
+ });
588
+ });