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