@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,485 @@
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("Payrolls Hris Payrolls All", async () => {
10
+ const testHttpClient = createTestHTTPClient("hris.payrollsAll");
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.payrolls.list({
19
+ consumerId: "test-consumer",
20
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
21
+ serviceId: "salesforce",
22
+ filter: {
23
+ startDate: "2022-04-08",
24
+ endDate: "2022-04-21",
25
+ },
26
+ passThrough: {
27
+ "search": "San Francisco",
28
+ },
29
+ fields: "id,updated_at",
30
+ });
31
+ expect(result.httpMeta.response.status).toBe(200);
32
+ expect(result.getPayrollsResponse).toBeDefined();
33
+ expect(result.getPayrollsResponse).toEqual({
34
+ statusCode: 200,
35
+ status: "OK",
36
+ service: "sage-hr",
37
+ resource: "Employees",
38
+ operation: "all",
39
+ data: [
40
+ {
41
+ id: "12345",
42
+ companyId: "23456",
43
+ processed: false,
44
+ processedDate: "2022-04-08",
45
+ checkDate: "2022-04-08",
46
+ startDate: "2022-04-08",
47
+ endDate: "2022-04-21",
48
+ totals: {
49
+ companyDebit: 27992.49,
50
+ taxDebit: 8655.32,
51
+ checkAmount: 27966.23,
52
+ netPay: 19337.17,
53
+ grossPay: 27966.23,
54
+ employerTaxes: 2038.93,
55
+ employeeTaxes: 6616.39,
56
+ employerBenefitContributions: 0,
57
+ employeeBenefitDeductions: 0,
58
+ },
59
+ compensations: [
60
+ {
61
+ employeeId: "12345",
62
+ netPay: 2199.93,
63
+ grossPay: 3000,
64
+ taxes: [
65
+ {
66
+ name: "CA State Income Tax",
67
+ employer: false,
68
+ amount: 1.97,
69
+ },
70
+ {
71
+ name: "CA State Income Tax",
72
+ employer: false,
73
+ amount: 1.97,
74
+ },
75
+ {
76
+ name: "CA State Income Tax",
77
+ employer: false,
78
+ amount: 1.97,
79
+ },
80
+ ],
81
+ deductions: [
82
+ {
83
+ name: "Company Car",
84
+ amount: 10.97,
85
+ },
86
+ ],
87
+ benefits: [
88
+ {
89
+ name: "Health Insurance",
90
+ employeeDeduction: 142.94,
91
+ employerContribution: 141.14,
92
+ },
93
+ ],
94
+ },
95
+ {
96
+ employeeId: "12345",
97
+ netPay: 2199.93,
98
+ grossPay: 3000,
99
+ taxes: [
100
+ {
101
+ name: "CA State Income Tax",
102
+ employer: false,
103
+ amount: 1.97,
104
+ },
105
+ ],
106
+ deductions: [
107
+ {
108
+ name: "Company Car",
109
+ amount: 10.97,
110
+ },
111
+ {
112
+ name: "Company Car",
113
+ amount: 10.97,
114
+ },
115
+ ],
116
+ benefits: [
117
+ {
118
+ name: "Health Insurance",
119
+ employeeDeduction: 142.94,
120
+ employerContribution: 141.14,
121
+ },
122
+ {
123
+ name: "Health Insurance",
124
+ employeeDeduction: 142.94,
125
+ employerContribution: 141.14,
126
+ },
127
+ ],
128
+ },
129
+ ],
130
+ },
131
+ {
132
+ id: "12345",
133
+ companyId: "23456",
134
+ processed: false,
135
+ processedDate: "2022-04-08",
136
+ checkDate: "2022-04-08",
137
+ startDate: "2022-04-08",
138
+ endDate: "2022-04-21",
139
+ totals: {
140
+ companyDebit: 27992.49,
141
+ taxDebit: 8655.32,
142
+ checkAmount: 27966.23,
143
+ netPay: 19337.17,
144
+ grossPay: 27966.23,
145
+ employerTaxes: 2038.93,
146
+ employeeTaxes: 6616.39,
147
+ employerBenefitContributions: 0,
148
+ employeeBenefitDeductions: 0,
149
+ },
150
+ compensations: [
151
+ {
152
+ employeeId: "12345",
153
+ netPay: 2199.93,
154
+ grossPay: 3000,
155
+ taxes: [
156
+ {
157
+ name: "CA State Income Tax",
158
+ employer: false,
159
+ amount: 1.97,
160
+ },
161
+ {
162
+ name: "CA State Income Tax",
163
+ employer: false,
164
+ amount: 1.97,
165
+ },
166
+ {
167
+ name: "CA State Income Tax",
168
+ employer: false,
169
+ amount: 1.97,
170
+ },
171
+ ],
172
+ deductions: [
173
+ {
174
+ name: "Company Car",
175
+ amount: 10.97,
176
+ },
177
+ ],
178
+ benefits: [
179
+ {
180
+ name: "Health Insurance",
181
+ employeeDeduction: 142.94,
182
+ employerContribution: 141.14,
183
+ },
184
+ ],
185
+ },
186
+ ],
187
+ },
188
+ {
189
+ id: "12345",
190
+ companyId: "23456",
191
+ processed: false,
192
+ processedDate: "2022-04-08",
193
+ checkDate: "2022-04-08",
194
+ startDate: "2022-04-08",
195
+ endDate: "2022-04-21",
196
+ totals: {
197
+ companyDebit: 27992.49,
198
+ taxDebit: 8655.32,
199
+ checkAmount: 27966.23,
200
+ netPay: 19337.17,
201
+ grossPay: 27966.23,
202
+ employerTaxes: 2038.93,
203
+ employeeTaxes: 6616.39,
204
+ employerBenefitContributions: 0,
205
+ employeeBenefitDeductions: 0,
206
+ },
207
+ compensations: [
208
+ {
209
+ employeeId: "12345",
210
+ netPay: 2199.93,
211
+ grossPay: 3000,
212
+ taxes: [
213
+ {
214
+ name: "CA State Income Tax",
215
+ employer: false,
216
+ amount: 1.97,
217
+ },
218
+ {
219
+ name: "CA State Income Tax",
220
+ employer: false,
221
+ amount: 1.97,
222
+ },
223
+ ],
224
+ deductions: [
225
+ {
226
+ name: "Company Car",
227
+ amount: 10.97,
228
+ },
229
+ {
230
+ name: "Company Car",
231
+ amount: 10.97,
232
+ },
233
+ ],
234
+ benefits: [
235
+ {
236
+ name: "Health Insurance",
237
+ employeeDeduction: 142.94,
238
+ employerContribution: 141.14,
239
+ },
240
+ ],
241
+ },
242
+ {
243
+ employeeId: "12345",
244
+ netPay: 2199.93,
245
+ grossPay: 3000,
246
+ taxes: [
247
+ {
248
+ name: "CA State Income Tax",
249
+ employer: false,
250
+ amount: 1.97,
251
+ },
252
+ ],
253
+ deductions: [
254
+ {
255
+ name: "Company Car",
256
+ amount: 10.97,
257
+ },
258
+ {
259
+ name: "Company Car",
260
+ amount: 10.97,
261
+ },
262
+ ],
263
+ benefits: [
264
+ {
265
+ name: "Health Insurance",
266
+ employeeDeduction: 142.94,
267
+ employerContribution: 141.14,
268
+ },
269
+ {
270
+ name: "Health Insurance",
271
+ employeeDeduction: 142.94,
272
+ employerContribution: 141.14,
273
+ },
274
+ ],
275
+ },
276
+ {
277
+ employeeId: "12345",
278
+ netPay: 2199.93,
279
+ grossPay: 3000,
280
+ taxes: [
281
+ {
282
+ name: "CA State Income Tax",
283
+ employer: false,
284
+ amount: 1.97,
285
+ },
286
+ ],
287
+ deductions: [
288
+ {
289
+ name: "Company Car",
290
+ amount: 10.97,
291
+ },
292
+ {
293
+ name: "Company Car",
294
+ amount: 10.97,
295
+ },
296
+ {
297
+ name: "Company Car",
298
+ amount: 10.97,
299
+ },
300
+ ],
301
+ benefits: [
302
+ {
303
+ name: "Health Insurance",
304
+ employeeDeduction: 142.94,
305
+ employerContribution: 141.14,
306
+ },
307
+ {
308
+ name: "Health Insurance",
309
+ employeeDeduction: 142.94,
310
+ employerContribution: 141.14,
311
+ },
312
+ ],
313
+ },
314
+ ],
315
+ },
316
+ ],
317
+ });
318
+ });
319
+
320
+ test("Payrolls Hris Payrolls One", async () => {
321
+ const testHttpClient = createTestHTTPClient("hris.payrollsOne");
322
+
323
+ const apideck = new Apideck({
324
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
325
+ httpClient: testHttpClient,
326
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
327
+ });
328
+
329
+ const result = await apideck.hris.payrolls.get({
330
+ payrollId: "<id>",
331
+ consumerId: "test-consumer",
332
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
333
+ serviceId: "salesforce",
334
+ fields: "id,updated_at",
335
+ });
336
+ expect(result.httpMeta.response.status).toBe(200);
337
+ expect(result.getPayrollResponse).toBeDefined();
338
+ expect(result.getPayrollResponse).toEqual({
339
+ statusCode: 200,
340
+ status: "OK",
341
+ service: "undefined",
342
+ resource: "Companies",
343
+ operation: "one",
344
+ data: {
345
+ id: "12345",
346
+ companyId: "23456",
347
+ processed: false,
348
+ processedDate: "2022-04-08",
349
+ checkDate: "2022-04-08",
350
+ startDate: "2022-04-08",
351
+ endDate: "2022-04-21",
352
+ totals: {
353
+ companyDebit: 27992.49,
354
+ taxDebit: 8655.32,
355
+ checkAmount: 27966.23,
356
+ netPay: 19337.17,
357
+ grossPay: 27966.23,
358
+ employerTaxes: 2038.93,
359
+ employeeTaxes: 6616.39,
360
+ employerBenefitContributions: 0,
361
+ employeeBenefitDeductions: 0,
362
+ },
363
+ compensations: [
364
+ {
365
+ employeeId: "12345",
366
+ netPay: 2199.93,
367
+ grossPay: 3000,
368
+ taxes: [
369
+ {
370
+ name: "CA State Income Tax",
371
+ employer: false,
372
+ amount: 1.97,
373
+ },
374
+ {
375
+ name: "CA State Income Tax",
376
+ employer: false,
377
+ amount: 1.97,
378
+ },
379
+ ],
380
+ deductions: [
381
+ {
382
+ name: "Company Car",
383
+ amount: 10.97,
384
+ },
385
+ {
386
+ name: "Company Car",
387
+ amount: 10.97,
388
+ },
389
+ ],
390
+ benefits: [
391
+ {
392
+ name: "Health Insurance",
393
+ employeeDeduction: 142.94,
394
+ employerContribution: 141.14,
395
+ },
396
+ {
397
+ name: "Health Insurance",
398
+ employeeDeduction: 142.94,
399
+ employerContribution: 141.14,
400
+ },
401
+ ],
402
+ },
403
+ {
404
+ employeeId: "12345",
405
+ netPay: 2199.93,
406
+ grossPay: 3000,
407
+ taxes: [
408
+ {
409
+ name: "CA State Income Tax",
410
+ employer: false,
411
+ amount: 1.97,
412
+ },
413
+ {
414
+ name: "CA State Income Tax",
415
+ employer: false,
416
+ amount: 1.97,
417
+ },
418
+ {
419
+ name: "CA State Income Tax",
420
+ employer: false,
421
+ amount: 1.97,
422
+ },
423
+ ],
424
+ deductions: [
425
+ {
426
+ name: "Company Car",
427
+ amount: 10.97,
428
+ },
429
+ {
430
+ name: "Company Car",
431
+ amount: 10.97,
432
+ },
433
+ ],
434
+ benefits: [
435
+ {
436
+ name: "Health Insurance",
437
+ employeeDeduction: 142.94,
438
+ employerContribution: 141.14,
439
+ },
440
+ {
441
+ name: "Health Insurance",
442
+ employeeDeduction: 142.94,
443
+ employerContribution: 141.14,
444
+ },
445
+ ],
446
+ },
447
+ {
448
+ employeeId: "12345",
449
+ netPay: 2199.93,
450
+ grossPay: 3000,
451
+ taxes: [
452
+ {
453
+ name: "CA State Income Tax",
454
+ employer: false,
455
+ amount: 1.97,
456
+ },
457
+ ],
458
+ deductions: [
459
+ {
460
+ name: "Company Car",
461
+ amount: 10.97,
462
+ },
463
+ ],
464
+ benefits: [
465
+ {
466
+ name: "Health Insurance",
467
+ employeeDeduction: 142.94,
468
+ employerContribution: 141.14,
469
+ },
470
+ {
471
+ name: "Health Insurance",
472
+ employeeDeduction: 142.94,
473
+ employerContribution: 141.14,
474
+ },
475
+ {
476
+ name: "Health Insurance",
477
+ employeeDeduction: 142.94,
478
+ employerContribution: 141.14,
479
+ },
480
+ ],
481
+ },
482
+ ],
483
+ },
484
+ });
485
+ });