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