@apideck/unify 0.39.6 → 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,487 +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("Drives File Storage Drives All", async () => {
10
- const testHttpClient = createTestHTTPClient("fileStorage.drivesAll");
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.fileStorage.drives.list({
19
- consumerId: "test-consumer",
20
- appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
21
- serviceId: "salesforce",
22
- filter: {
23
- groupId: "1234",
24
- },
25
- fields: "id,updated_at",
26
- });
27
- expect(result.httpMeta.response.status).toBe(200);
28
- expect(result.getDrivesResponse).toBeDefined();
29
- expect(result.getDrivesResponse).toEqual({
30
- statusCode: 200,
31
- status: "OK",
32
- service: "google-drive",
33
- resource: "Drives",
34
- operation: "all",
35
- data: [
36
- {
37
- id: "12345",
38
- name: "Project Resources",
39
- description: "A description",
40
- updatedBy: "12345",
41
- createdBy: "12345",
42
- updatedAt: new Date("2020-09-30T07:43:32.000Z"),
43
- createdAt: new Date("2020-09-30T07:43:32.000Z"),
44
- passThrough: [
45
- {
46
- serviceId: "<id>",
47
- extendPaths: [
48
- {
49
- path: "$.nested.property",
50
- value: {
51
- "TaxClassificationRef": {
52
- "value": "EUC-99990201-V1-00020000",
53
- },
54
- },
55
- },
56
- {
57
- path: "$.nested.property",
58
- value: {
59
- "TaxClassificationRef": {
60
- "value": "EUC-99990201-V1-00020000",
61
- },
62
- },
63
- },
64
- {
65
- path: "$.nested.property",
66
- value: {
67
- "TaxClassificationRef": {
68
- "value": "EUC-99990201-V1-00020000",
69
- },
70
- },
71
- },
72
- ],
73
- },
74
- {
75
- serviceId: "<id>",
76
- extendPaths: [
77
- {
78
- path: "$.nested.property",
79
- value: {
80
- "TaxClassificationRef": {
81
- "value": "EUC-99990201-V1-00020000",
82
- },
83
- },
84
- },
85
- ],
86
- },
87
- ],
88
- },
89
- {
90
- id: "12345",
91
- name: "Project Resources",
92
- description: "A description",
93
- updatedBy: "12345",
94
- createdBy: "12345",
95
- updatedAt: new Date("2020-09-30T07:43:32.000Z"),
96
- createdAt: new Date("2020-09-30T07:43:32.000Z"),
97
- passThrough: [
98
- {
99
- serviceId: "<id>",
100
- extendPaths: [
101
- {
102
- path: "$.nested.property",
103
- value: {
104
- "TaxClassificationRef": {
105
- "value": "EUC-99990201-V1-00020000",
106
- },
107
- },
108
- },
109
- ],
110
- },
111
- ],
112
- },
113
- {
114
- id: "12345",
115
- name: "Project Resources",
116
- description: "A description",
117
- updatedBy: "12345",
118
- createdBy: "12345",
119
- updatedAt: new Date("2020-09-30T07:43:32.000Z"),
120
- createdAt: new Date("2020-09-30T07:43:32.000Z"),
121
- passThrough: [
122
- {
123
- serviceId: "<id>",
124
- extendPaths: [
125
- {
126
- path: "$.nested.property",
127
- value: {
128
- "TaxClassificationRef": {
129
- "value": "EUC-99990201-V1-00020000",
130
- },
131
- },
132
- },
133
- {
134
- path: "$.nested.property",
135
- value: {
136
- "TaxClassificationRef": {
137
- "value": "EUC-99990201-V1-00020000",
138
- },
139
- },
140
- },
141
- ],
142
- },
143
- {
144
- serviceId: "<id>",
145
- extendPaths: [
146
- {
147
- path: "$.nested.property",
148
- value: {
149
- "TaxClassificationRef": {
150
- "value": "EUC-99990201-V1-00020000",
151
- },
152
- },
153
- },
154
- ],
155
- },
156
- ],
157
- },
158
- ],
159
- meta: {
160
- itemsOnPage: 50,
161
- cursors: {
162
- previous: "em9oby1jcm06OnBhZ2U6OjE=",
163
- current: "em9oby1jcm06OnBhZ2U6OjI=",
164
- next: "em9oby1jcm06OnBhZ2U6OjM=",
165
- },
166
- },
167
- links: {
168
- previous:
169
- "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
170
- current: "https://unify.apideck.com/crm/companies",
171
- next:
172
- "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
173
- },
174
- });
175
- });
176
-
177
- test("Drives File Storage Drives Add", async () => {
178
- const testHttpClient = createTestHTTPClient("fileStorage.drivesAdd");
179
-
180
- const apideck = new Apideck({
181
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
182
- httpClient: testHttpClient,
183
- apiKey: process.env["APIDECK_API_KEY"] ?? "value",
184
- });
185
-
186
- const result = await apideck.fileStorage.drives.create({
187
- consumerId: "test-consumer",
188
- appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
189
- serviceId: "salesforce",
190
- drive: {
191
- name: "Project Resources",
192
- description: "A description",
193
- passThrough: [
194
- {
195
- serviceId: "<id>",
196
- extendPaths: [
197
- {
198
- path: "$.nested.property",
199
- value: {
200
- "TaxClassificationRef": {
201
- "value": "EUC-99990201-V1-00020000",
202
- },
203
- },
204
- },
205
- {
206
- path: "$.nested.property",
207
- value: {
208
- "TaxClassificationRef": {
209
- "value": "EUC-99990201-V1-00020000",
210
- },
211
- },
212
- },
213
- ],
214
- },
215
- {
216
- serviceId: "<id>",
217
- extendPaths: [
218
- {
219
- path: "$.nested.property",
220
- value: {
221
- "TaxClassificationRef": {
222
- "value": "EUC-99990201-V1-00020000",
223
- },
224
- },
225
- },
226
- {
227
- path: "$.nested.property",
228
- value: {
229
- "TaxClassificationRef": {
230
- "value": "EUC-99990201-V1-00020000",
231
- },
232
- },
233
- },
234
- ],
235
- },
236
- ],
237
- },
238
- });
239
- expect(result.httpMeta.response.status).toBe(201);
240
- expect(result.createDriveResponse).toBeDefined();
241
- expect(result.createDriveResponse).toEqual({
242
- statusCode: 200,
243
- status: "OK",
244
- service: "google-drive",
245
- resource: "Drives",
246
- operation: "add",
247
- data: {
248
- id: "12345",
249
- },
250
- });
251
- });
252
-
253
- test("Drives File Storage Drives One", async () => {
254
- const testHttpClient = createTestHTTPClient("fileStorage.drivesOne");
255
-
256
- const apideck = new Apideck({
257
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
258
- httpClient: testHttpClient,
259
- apiKey: process.env["APIDECK_API_KEY"] ?? "value",
260
- });
261
-
262
- const result = await apideck.fileStorage.drives.get({
263
- id: "<id>",
264
- consumerId: "test-consumer",
265
- appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
266
- serviceId: "salesforce",
267
- fields: "id,updated_at",
268
- });
269
- expect(result.httpMeta.response.status).toBe(200);
270
- expect(result.getDriveResponse).toBeDefined();
271
- expect(result.getDriveResponse).toEqual({
272
- statusCode: 200,
273
- status: "OK",
274
- service: "google-drive",
275
- resource: "Drives",
276
- operation: "one",
277
- data: {
278
- id: "12345",
279
- name: "Project Resources",
280
- description: "A description",
281
- updatedBy: "12345",
282
- createdBy: "12345",
283
- updatedAt: new Date("2020-09-30T07:43:32.000Z"),
284
- createdAt: new Date("2020-09-30T07:43:32.000Z"),
285
- passThrough: [
286
- {
287
- serviceId: "<id>",
288
- extendPaths: [
289
- {
290
- path: "$.nested.property",
291
- value: {
292
- "TaxClassificationRef": {
293
- "value": "EUC-99990201-V1-00020000",
294
- },
295
- },
296
- },
297
- {
298
- path: "$.nested.property",
299
- value: {
300
- "TaxClassificationRef": {
301
- "value": "EUC-99990201-V1-00020000",
302
- },
303
- },
304
- },
305
- ],
306
- },
307
- {
308
- serviceId: "<id>",
309
- extendPaths: [
310
- {
311
- path: "$.nested.property",
312
- value: {
313
- "TaxClassificationRef": {
314
- "value": "EUC-99990201-V1-00020000",
315
- },
316
- },
317
- },
318
- {
319
- path: "$.nested.property",
320
- value: {
321
- "TaxClassificationRef": {
322
- "value": "EUC-99990201-V1-00020000",
323
- },
324
- },
325
- },
326
- ],
327
- },
328
- {
329
- serviceId: "<id>",
330
- extendPaths: [
331
- {
332
- path: "$.nested.property",
333
- value: {
334
- "TaxClassificationRef": {
335
- "value": "EUC-99990201-V1-00020000",
336
- },
337
- },
338
- },
339
- {
340
- path: "$.nested.property",
341
- value: {
342
- "TaxClassificationRef": {
343
- "value": "EUC-99990201-V1-00020000",
344
- },
345
- },
346
- },
347
- ],
348
- },
349
- ],
350
- },
351
- });
352
- });
353
-
354
- test("Drives File Storage Drives Update", async () => {
355
- const testHttpClient = createTestHTTPClient("fileStorage.drivesUpdate");
356
-
357
- const apideck = new Apideck({
358
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
359
- httpClient: testHttpClient,
360
- apiKey: process.env["APIDECK_API_KEY"] ?? "value",
361
- });
362
-
363
- const result = await apideck.fileStorage.drives.update({
364
- id: "<id>",
365
- consumerId: "test-consumer",
366
- appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
367
- serviceId: "salesforce",
368
- drive: {
369
- name: "Project Resources",
370
- description: "A description",
371
- passThrough: [
372
- {
373
- serviceId: "<id>",
374
- extendPaths: [
375
- {
376
- path: "$.nested.property",
377
- value: {
378
- "TaxClassificationRef": {
379
- "value": "EUC-99990201-V1-00020000",
380
- },
381
- },
382
- },
383
- {
384
- path: "$.nested.property",
385
- value: {
386
- "TaxClassificationRef": {
387
- "value": "EUC-99990201-V1-00020000",
388
- },
389
- },
390
- },
391
- ],
392
- },
393
- {
394
- serviceId: "<id>",
395
- extendPaths: [
396
- {
397
- path: "$.nested.property",
398
- value: {
399
- "TaxClassificationRef": {
400
- "value": "EUC-99990201-V1-00020000",
401
- },
402
- },
403
- },
404
- {
405
- path: "$.nested.property",
406
- value: {
407
- "TaxClassificationRef": {
408
- "value": "EUC-99990201-V1-00020000",
409
- },
410
- },
411
- },
412
- ],
413
- },
414
- {
415
- serviceId: "<id>",
416
- extendPaths: [
417
- {
418
- path: "$.nested.property",
419
- value: {
420
- "TaxClassificationRef": {
421
- "value": "EUC-99990201-V1-00020000",
422
- },
423
- },
424
- },
425
- {
426
- path: "$.nested.property",
427
- value: {
428
- "TaxClassificationRef": {
429
- "value": "EUC-99990201-V1-00020000",
430
- },
431
- },
432
- },
433
- {
434
- path: "$.nested.property",
435
- value: {
436
- "TaxClassificationRef": {
437
- "value": "EUC-99990201-V1-00020000",
438
- },
439
- },
440
- },
441
- ],
442
- },
443
- ],
444
- },
445
- });
446
- expect(result.httpMeta.response.status).toBe(200);
447
- expect(result.updateDriveResponse).toBeDefined();
448
- expect(result.updateDriveResponse).toEqual({
449
- statusCode: 200,
450
- status: "OK",
451
- service: "google-drive",
452
- resource: "Drives",
453
- operation: "update",
454
- data: {
455
- id: "12345",
456
- },
457
- });
458
- });
459
-
460
- test("Drives File Storage Drives Delete", async () => {
461
- const testHttpClient = createTestHTTPClient("fileStorage.drivesDelete");
462
-
463
- const apideck = new Apideck({
464
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
465
- httpClient: testHttpClient,
466
- apiKey: process.env["APIDECK_API_KEY"] ?? "value",
467
- });
468
-
469
- const result = await apideck.fileStorage.drives.delete({
470
- id: "<id>",
471
- consumerId: "test-consumer",
472
- appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
473
- serviceId: "salesforce",
474
- });
475
- expect(result.httpMeta.response.status).toBe(200);
476
- expect(result.deleteDriveResponse).toBeDefined();
477
- expect(result.deleteDriveResponse).toEqual({
478
- statusCode: 200,
479
- status: "OK",
480
- service: "google-drive",
481
- resource: "Drives",
482
- operation: "delete",
483
- data: {
484
- id: "12345",
485
- },
486
- });
487
- });