@apideck/unify 0.39.7 → 0.40.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 (102) 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/lib/config.js.map +1 -1
  5. package/lib/encodings.d.ts +1 -0
  6. package/lib/encodings.d.ts.map +1 -1
  7. package/lib/encodings.js +7 -0
  8. package/lib/encodings.js.map +1 -1
  9. package/package.json +2 -6
  10. package/src/lib/config.ts +4 -4
  11. package/src/lib/encodings.ts +9 -0
  12. package/src/__tests__/activities.test.ts +0 -1141
  13. package/src/__tests__/agedcreditors.test.ts +0 -280
  14. package/src/__tests__/ageddebtors.test.ts +0 -280
  15. package/src/__tests__/apideckcompanies.test.ts +0 -1082
  16. package/src/__tests__/apideckcustomers.test.ts +0 -364
  17. package/src/__tests__/apideckdepartments.test.ts +0 -497
  18. package/src/__tests__/apiresources.test.ts +0 -62
  19. package/src/__tests__/apis.test.ts +0 -216
  20. package/src/__tests__/applicants.test.ts +0 -1445
  21. package/src/__tests__/applications.test.ts +0 -515
  22. package/src/__tests__/assertions.ts +0 -13
  23. package/src/__tests__/attachments.test.ts +0 -371
  24. package/src/__tests__/balancesheet.test.ts +0 -453
  25. package/src/__tests__/bankaccounts.test.ts +0 -324
  26. package/src/__tests__/bankfeedaccounts.test.ts +0 -343
  27. package/src/__tests__/bankfeedstatements.test.ts +0 -408
  28. package/src/__tests__/billpayments.test.ts +0 -1031
  29. package/src/__tests__/bills.test.ts +0 -1630
  30. package/src/__tests__/categories.test.ts +0 -127
  31. package/src/__tests__/collections.test.ts +0 -120
  32. package/src/__tests__/collectiontags.test.ts +0 -68
  33. package/src/__tests__/collectionticketcomments.test.ts +0 -501
  34. package/src/__tests__/collectiontickets.test.ts +0 -627
  35. package/src/__tests__/collectionusers.test.ts +0 -126
  36. package/src/__tests__/companies.test.ts +0 -1642
  37. package/src/__tests__/companyinfo.test.ts +0 -219
  38. package/src/__tests__/connectionconsent.test.ts +0 -89
  39. package/src/__tests__/connectionconsents.test.ts +0 -31
  40. package/src/__tests__/connectioncustommappings.test.ts +0 -69
  41. package/src/__tests__/connections.test.ts +0 -2127
  42. package/src/__tests__/connectionsettings.test.ts +0 -687
  43. package/src/__tests__/connectordocs.test.ts +0 -29
  44. package/src/__tests__/connectors.test.ts +0 -753
  45. package/src/__tests__/consumerrequestcounts.test.ts +0 -42
  46. package/src/__tests__/consumers.test.ts +0 -523
  47. package/src/__tests__/contacts.test.ts +0 -1421
  48. package/src/__tests__/createcallback.test.ts +0 -36
  49. package/src/__tests__/creditnotes.test.ts +0 -2040
  50. package/src/__tests__/customers.test.ts +0 -1600
  51. package/src/__tests__/customfields.test.ts +0 -52
  52. package/src/__tests__/custommappings.test.ts +0 -65
  53. package/src/__tests__/customobjects.test.ts +0 -408
  54. package/src/__tests__/customobjectschemas.test.ts +0 -734
  55. package/src/__tests__/departments.test.ts +0 -529
  56. package/src/__tests__/drivegroups.test.ts +0 -496
  57. package/src/__tests__/drives.test.ts +0 -487
  58. package/src/__tests__/employeepayrolls.test.ts +0 -491
  59. package/src/__tests__/employees.test.ts +0 -2968
  60. package/src/__tests__/employeeschedules.test.ts +0 -457
  61. package/src/__tests__/eventlogs.test.ts +0 -158
  62. package/src/__tests__/expensecategories.test.ts +0 -324
  63. package/src/__tests__/expensereports.test.ts +0 -634
  64. package/src/__tests__/expenses.test.ts +0 -867
  65. package/src/__tests__/files.test.ts +0 -506
  66. package/src/__tests__/files.ts +0 -56
  67. package/src/__tests__/folders.test.ts +0 -390
  68. package/src/__tests__/invoiceitems.test.ts +0 -855
  69. package/src/__tests__/invoices.test.ts +0 -2173
  70. package/src/__tests__/jobs.test.ts +0 -1150
  71. package/src/__tests__/journalentries.test.ts +0 -1542
  72. package/src/__tests__/leads.test.ts +0 -1341
  73. package/src/__tests__/ledgeraccounts.test.ts +0 -829
  74. package/src/__tests__/locations.test.ts +0 -856
  75. package/src/__tests__/logs.test.ts +0 -137
  76. package/src/__tests__/messages.test.ts +0 -588
  77. package/src/__tests__/notes.test.ts +0 -523
  78. package/src/__tests__/opportunities.test.ts +0 -718
  79. package/src/__tests__/orders.test.ts +0 -854
  80. package/src/__tests__/payments.test.ts +0 -867
  81. package/src/__tests__/payrolls.test.ts +0 -485
  82. package/src/__tests__/pipelines.test.ts +0 -574
  83. package/src/__tests__/products.test.ts +0 -509
  84. package/src/__tests__/profitandloss.test.ts +0 -223
  85. package/src/__tests__/projects.test.ts +0 -480
  86. package/src/__tests__/proxy.test.ts +0 -41
  87. package/src/__tests__/purchaseorders.test.ts +0 -2139
  88. package/src/__tests__/quotes.test.ts +0 -678
  89. package/src/__tests__/refunds.test.ts +0 -812
  90. package/src/__tests__/sessions.test.ts +0 -72
  91. package/src/__tests__/sharedlinks.test.ts +0 -511
  92. package/src/__tests__/stores.test.ts +0 -41
  93. package/src/__tests__/subsidiaries.test.ts +0 -496
  94. package/src/__tests__/suppliers.test.ts +0 -1574
  95. package/src/__tests__/taxrates.test.ts +0 -701
  96. package/src/__tests__/testclient.ts +0 -48
  97. package/src/__tests__/timeoffrequests.test.ts +0 -588
  98. package/src/__tests__/trackingcategories.test.ts +0 -515
  99. package/src/__tests__/uploadsessions.test.ts +0 -221
  100. package/src/__tests__/users.test.ts +0 -1020
  101. package/src/__tests__/validateconnection.test.ts +0 -34
  102. package/src/__tests__/webhooks.test.ts +0 -254
@@ -1,529 +0,0 @@
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("Departments Accounting Departments All", async () => {
10
- const testHttpClient = createTestHTTPClient("accounting.departmentsAll");
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.accounting.departments.list({
19
- consumerId: "test-consumer",
20
- appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
21
- serviceId: "salesforce",
22
- fields: "id,updated_at",
23
- filter: {
24
- subsidiary: "1",
25
- },
26
- });
27
- expect(result.httpMeta.response.status).toBe(200);
28
- expect(result.getAccountingDepartmentsResponse).toBeDefined();
29
- expect(result.getAccountingDepartmentsResponse).toEqual({
30
- statusCode: 200,
31
- status: "OK",
32
- service: "xero",
33
- resource: "subsidiaries",
34
- operation: "all",
35
- data: [
36
- {
37
- id: "12345",
38
- parentId: "12345",
39
- name: "Sales",
40
- status: "active",
41
- subsidiaries: [
42
- {
43
- id: "12345",
44
- name: "SpaceX",
45
- },
46
- {
47
- id: "12345",
48
- name: "SpaceX",
49
- },
50
- ],
51
- rowVersion: "1-12345",
52
- updatedBy: "12345",
53
- createdBy: "12345",
54
- updatedAt: new Date("2020-09-30T07:43:32.000Z"),
55
- createdAt: new Date("2020-09-30T07:43:32.000Z"),
56
- passThrough: [
57
- {
58
- serviceId: "<id>",
59
- extendPaths: [
60
- {
61
- path: "$.nested.property",
62
- value: {
63
- "TaxClassificationRef": {
64
- "value": "EUC-99990201-V1-00020000",
65
- },
66
- },
67
- },
68
- ],
69
- },
70
- {
71
- serviceId: "<id>",
72
- extendPaths: [
73
- {
74
- path: "$.nested.property",
75
- value: {
76
- "TaxClassificationRef": {
77
- "value": "EUC-99990201-V1-00020000",
78
- },
79
- },
80
- },
81
- ],
82
- },
83
- {
84
- serviceId: "<id>",
85
- extendPaths: [
86
- {
87
- path: "$.nested.property",
88
- value: {
89
- "TaxClassificationRef": {
90
- "value": "EUC-99990201-V1-00020000",
91
- },
92
- },
93
- },
94
- ],
95
- },
96
- ],
97
- },
98
- {
99
- id: "12345",
100
- parentId: "12345",
101
- name: "Sales",
102
- status: "active",
103
- subsidiaries: [
104
- {
105
- id: "12345",
106
- name: "SpaceX",
107
- },
108
- {
109
- id: "12345",
110
- name: "SpaceX",
111
- },
112
- ],
113
- rowVersion: "1-12345",
114
- updatedBy: "12345",
115
- createdBy: "12345",
116
- updatedAt: new Date("2020-09-30T07:43:32.000Z"),
117
- createdAt: new Date("2020-09-30T07:43:32.000Z"),
118
- passThrough: [
119
- {
120
- serviceId: "<id>",
121
- extendPaths: [
122
- {
123
- path: "$.nested.property",
124
- value: {
125
- "TaxClassificationRef": {
126
- "value": "EUC-99990201-V1-00020000",
127
- },
128
- },
129
- },
130
- ],
131
- },
132
- {
133
- serviceId: "<id>",
134
- extendPaths: [
135
- {
136
- path: "$.nested.property",
137
- value: {
138
- "TaxClassificationRef": {
139
- "value": "EUC-99990201-V1-00020000",
140
- },
141
- },
142
- },
143
- {
144
- path: "$.nested.property",
145
- value: {
146
- "TaxClassificationRef": {
147
- "value": "EUC-99990201-V1-00020000",
148
- },
149
- },
150
- },
151
- {
152
- path: "$.nested.property",
153
- value: {
154
- "TaxClassificationRef": {
155
- "value": "EUC-99990201-V1-00020000",
156
- },
157
- },
158
- },
159
- ],
160
- },
161
- ],
162
- },
163
- {
164
- id: "12345",
165
- parentId: "12345",
166
- name: "Sales",
167
- status: "active",
168
- subsidiaries: [
169
- {
170
- id: "12345",
171
- name: "SpaceX",
172
- },
173
- ],
174
- rowVersion: "1-12345",
175
- updatedBy: "12345",
176
- createdBy: "12345",
177
- updatedAt: new Date("2020-09-30T07:43:32.000Z"),
178
- createdAt: new Date("2020-09-30T07:43:32.000Z"),
179
- passThrough: [
180
- {
181
- serviceId: "<id>",
182
- extendPaths: [
183
- {
184
- path: "$.nested.property",
185
- value: {
186
- "TaxClassificationRef": {
187
- "value": "EUC-99990201-V1-00020000",
188
- },
189
- },
190
- },
191
- {
192
- path: "$.nested.property",
193
- value: {
194
- "TaxClassificationRef": {
195
- "value": "EUC-99990201-V1-00020000",
196
- },
197
- },
198
- },
199
- {
200
- path: "$.nested.property",
201
- value: {
202
- "TaxClassificationRef": {
203
- "value": "EUC-99990201-V1-00020000",
204
- },
205
- },
206
- },
207
- ],
208
- },
209
- ],
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("Departments Accounting Departments Add", async () => {
231
- const testHttpClient = createTestHTTPClient("accounting.departmentsAdd");
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.accounting.departments.create({
240
- consumerId: "test-consumer",
241
- appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
242
- serviceId: "salesforce",
243
- accountingDepartment: {
244
- parentId: "12345",
245
- name: "Sales",
246
- status: "active",
247
- subsidiaries: [
248
- {
249
- name: "SpaceX",
250
- },
251
- {
252
- name: "SpaceX",
253
- },
254
- ],
255
- rowVersion: "1-12345",
256
- passThrough: [
257
- {
258
- serviceId: "<id>",
259
- extendPaths: [
260
- {
261
- path: "$.nested.property",
262
- value: {
263
- "TaxClassificationRef": {
264
- "value": "EUC-99990201-V1-00020000",
265
- },
266
- },
267
- },
268
- {
269
- path: "$.nested.property",
270
- value: {
271
- "TaxClassificationRef": {
272
- "value": "EUC-99990201-V1-00020000",
273
- },
274
- },
275
- },
276
- ],
277
- },
278
- {
279
- serviceId: "<id>",
280
- extendPaths: [
281
- {
282
- path: "$.nested.property",
283
- value: {
284
- "TaxClassificationRef": {
285
- "value": "EUC-99990201-V1-00020000",
286
- },
287
- },
288
- },
289
- ],
290
- },
291
- ],
292
- },
293
- });
294
- expect(result.httpMeta.response.status).toBe(201);
295
- expect(result.createAccountingDepartmentResponse).toBeDefined();
296
- expect(result.createAccountingDepartmentResponse).toEqual({
297
- statusCode: 200,
298
- status: "OK",
299
- service: "quickbooks",
300
- resource: "departments",
301
- operation: "add",
302
- data: {
303
- id: "12345",
304
- },
305
- });
306
- });
307
-
308
- test("Departments Accounting Departments One", async () => {
309
- const testHttpClient = createTestHTTPClient("accounting.departmentsOne");
310
-
311
- const apideck = new Apideck({
312
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
313
- httpClient: testHttpClient,
314
- apiKey: process.env["APIDECK_API_KEY"] ?? "value",
315
- });
316
-
317
- const result = await apideck.accounting.departments.get({
318
- id: "<id>",
319
- consumerId: "test-consumer",
320
- appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
321
- serviceId: "salesforce",
322
- fields: "id,updated_at",
323
- });
324
- expect(result.httpMeta.response.status).toBe(200);
325
- expect(result.getAccountingDepartmentResponse).toBeDefined();
326
- expect(result.getAccountingDepartmentResponse).toEqual({
327
- statusCode: 200,
328
- status: "OK",
329
- service: "xero",
330
- resource: "subsidiaries",
331
- operation: "one",
332
- data: {
333
- id: "12345",
334
- parentId: "12345",
335
- name: "Sales",
336
- status: "active",
337
- subsidiaries: [
338
- {
339
- id: "12345",
340
- name: "SpaceX",
341
- },
342
- {
343
- id: "12345",
344
- name: "SpaceX",
345
- },
346
- {
347
- id: "12345",
348
- name: "SpaceX",
349
- },
350
- ],
351
- rowVersion: "1-12345",
352
- updatedBy: "12345",
353
- createdBy: "12345",
354
- updatedAt: new Date("2020-09-30T07:43:32.000Z"),
355
- createdAt: new Date("2020-09-30T07:43:32.000Z"),
356
- passThrough: [
357
- {
358
- serviceId: "<id>",
359
- extendPaths: [
360
- {
361
- path: "$.nested.property",
362
- value: {
363
- "TaxClassificationRef": {
364
- "value": "EUC-99990201-V1-00020000",
365
- },
366
- },
367
- },
368
- {
369
- path: "$.nested.property",
370
- value: {
371
- "TaxClassificationRef": {
372
- "value": "EUC-99990201-V1-00020000",
373
- },
374
- },
375
- },
376
- ],
377
- },
378
- {
379
- serviceId: "<id>",
380
- extendPaths: [
381
- {
382
- path: "$.nested.property",
383
- value: {
384
- "TaxClassificationRef": {
385
- "value": "EUC-99990201-V1-00020000",
386
- },
387
- },
388
- },
389
- {
390
- path: "$.nested.property",
391
- value: {
392
- "TaxClassificationRef": {
393
- "value": "EUC-99990201-V1-00020000",
394
- },
395
- },
396
- },
397
- ],
398
- },
399
- ],
400
- },
401
- });
402
- });
403
-
404
- test("Departments Accounting Departments Update", async () => {
405
- const testHttpClient = createTestHTTPClient("accounting.departmentsUpdate");
406
-
407
- const apideck = new Apideck({
408
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
409
- httpClient: testHttpClient,
410
- apiKey: process.env["APIDECK_API_KEY"] ?? "value",
411
- });
412
-
413
- const result = await apideck.accounting.departments.update({
414
- id: "<id>",
415
- consumerId: "test-consumer",
416
- appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
417
- serviceId: "salesforce",
418
- accountingDepartment: {
419
- parentId: "12345",
420
- name: "Sales",
421
- status: "active",
422
- subsidiaries: [
423
- {
424
- name: "SpaceX",
425
- },
426
- {
427
- name: "SpaceX",
428
- },
429
- {
430
- name: "SpaceX",
431
- },
432
- ],
433
- rowVersion: "1-12345",
434
- passThrough: [
435
- {
436
- serviceId: "<id>",
437
- extendPaths: [
438
- {
439
- path: "$.nested.property",
440
- value: {
441
- "TaxClassificationRef": {
442
- "value": "EUC-99990201-V1-00020000",
443
- },
444
- },
445
- },
446
- {
447
- path: "$.nested.property",
448
- value: {
449
- "TaxClassificationRef": {
450
- "value": "EUC-99990201-V1-00020000",
451
- },
452
- },
453
- },
454
- ],
455
- },
456
- {
457
- serviceId: "<id>",
458
- extendPaths: [
459
- {
460
- path: "$.nested.property",
461
- value: {
462
- "TaxClassificationRef": {
463
- "value": "EUC-99990201-V1-00020000",
464
- },
465
- },
466
- },
467
- {
468
- path: "$.nested.property",
469
- value: {
470
- "TaxClassificationRef": {
471
- "value": "EUC-99990201-V1-00020000",
472
- },
473
- },
474
- },
475
- {
476
- path: "$.nested.property",
477
- value: {
478
- "TaxClassificationRef": {
479
- "value": "EUC-99990201-V1-00020000",
480
- },
481
- },
482
- },
483
- ],
484
- },
485
- ],
486
- },
487
- });
488
- expect(result.httpMeta.response.status).toBe(200);
489
- expect(result.updateAccountingDepartmentResponse).toBeDefined();
490
- expect(result.updateAccountingDepartmentResponse).toEqual({
491
- statusCode: 200,
492
- status: "OK",
493
- service: "quickbooks",
494
- resource: "departments",
495
- operation: "update",
496
- data: {
497
- id: "12345",
498
- },
499
- });
500
- });
501
-
502
- test("Departments Accounting Departments Delete", async () => {
503
- const testHttpClient = createTestHTTPClient("accounting.departmentsDelete");
504
-
505
- const apideck = new Apideck({
506
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
507
- httpClient: testHttpClient,
508
- apiKey: process.env["APIDECK_API_KEY"] ?? "value",
509
- });
510
-
511
- const result = await apideck.accounting.departments.delete({
512
- id: "<id>",
513
- consumerId: "test-consumer",
514
- appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
515
- serviceId: "salesforce",
516
- });
517
- expect(result.httpMeta.response.status).toBe(200);
518
- expect(result.deleteAccountingDepartmentResponse).toBeDefined();
519
- expect(result.deleteAccountingDepartmentResponse).toEqual({
520
- statusCode: 200,
521
- status: "OK",
522
- service: "quickbooks",
523
- resource: "departments",
524
- operation: "delete",
525
- data: {
526
- id: "12345",
527
- },
528
- });
529
- });