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