@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,574 +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("Pipelines Crm Pipelines All", async () => {
10
- const testHttpClient = createTestHTTPClient("crm.pipelinesAll");
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.crm.pipelines.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.getPipelinesResponse).toBeDefined();
29
- expect(result.getPipelinesResponse).toEqual({
30
- statusCode: 200,
31
- status: "OK",
32
- service: "zoho-crm",
33
- resource: "pipelines",
34
- operation: "all",
35
- data: [
36
- {
37
- id: "default",
38
- name: "Sales Pipeline",
39
- currency: "USD",
40
- archived: false,
41
- active: false,
42
- displayOrder: 1,
43
- winProbabilityEnabled: true,
44
- stages: [
45
- {
46
- id: "contractsent",
47
- name: "Contract Sent",
48
- value: "CONTRACT_SENT",
49
- winProbability: 50,
50
- displayOrder: 1,
51
- },
52
- {
53
- id: "contractsent",
54
- name: "Contract Sent",
55
- value: "CONTRACT_SENT",
56
- winProbability: 50,
57
- displayOrder: 1,
58
- },
59
- ],
60
- updatedAt: new Date("2020-09-30T07:43:32.000Z"),
61
- createdAt: new Date("2020-09-30T07:43:32.000Z"),
62
- passThrough: [
63
- {
64
- serviceId: "<id>",
65
- extendPaths: [
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
- serviceId: "<id>",
91
- extendPaths: [
92
- {
93
- path: "$.nested.property",
94
- value: {
95
- "TaxClassificationRef": {
96
- "value": "EUC-99990201-V1-00020000",
97
- },
98
- },
99
- },
100
- ],
101
- },
102
- ],
103
- },
104
- {
105
- id: "default",
106
- name: "Sales Pipeline",
107
- currency: "USD",
108
- archived: false,
109
- active: false,
110
- displayOrder: 1,
111
- winProbabilityEnabled: true,
112
- stages: [
113
- {
114
- id: "contractsent",
115
- name: "Contract Sent",
116
- value: "CONTRACT_SENT",
117
- winProbability: 50,
118
- displayOrder: 1,
119
- },
120
- {
121
- id: "contractsent",
122
- name: "Contract Sent",
123
- value: "CONTRACT_SENT",
124
- winProbability: 50,
125
- displayOrder: 1,
126
- },
127
- ],
128
- updatedAt: new Date("2020-09-30T07:43:32.000Z"),
129
- createdAt: new Date("2020-09-30T07:43:32.000Z"),
130
- passThrough: [
131
- {
132
- serviceId: "<id>",
133
- extendPaths: [
134
- {
135
- path: "$.nested.property",
136
- value: {
137
- "TaxClassificationRef": {
138
- "value": "EUC-99990201-V1-00020000",
139
- },
140
- },
141
- },
142
- ],
143
- },
144
- {
145
- serviceId: "<id>",
146
- extendPaths: [
147
- {
148
- path: "$.nested.property",
149
- value: {
150
- "TaxClassificationRef": {
151
- "value": "EUC-99990201-V1-00020000",
152
- },
153
- },
154
- },
155
- {
156
- path: "$.nested.property",
157
- value: {
158
- "TaxClassificationRef": {
159
- "value": "EUC-99990201-V1-00020000",
160
- },
161
- },
162
- },
163
- {
164
- path: "$.nested.property",
165
- value: {
166
- "TaxClassificationRef": {
167
- "value": "EUC-99990201-V1-00020000",
168
- },
169
- },
170
- },
171
- ],
172
- },
173
- ],
174
- },
175
- {
176
- id: "default",
177
- name: "Sales Pipeline",
178
- currency: "USD",
179
- archived: false,
180
- active: false,
181
- displayOrder: 1,
182
- winProbabilityEnabled: true,
183
- stages: [
184
- {
185
- id: "contractsent",
186
- name: "Contract Sent",
187
- value: "CONTRACT_SENT",
188
- winProbability: 50,
189
- displayOrder: 1,
190
- },
191
- ],
192
- updatedAt: new Date("2020-09-30T07:43:32.000Z"),
193
- createdAt: new Date("2020-09-30T07:43:32.000Z"),
194
- passThrough: [
195
- {
196
- serviceId: "<id>",
197
- extendPaths: [
198
- {
199
- path: "$.nested.property",
200
- value: {
201
- "TaxClassificationRef": {
202
- "value": "EUC-99990201-V1-00020000",
203
- },
204
- },
205
- },
206
- {
207
- path: "$.nested.property",
208
- value: {
209
- "TaxClassificationRef": {
210
- "value": "EUC-99990201-V1-00020000",
211
- },
212
- },
213
- },
214
- {
215
- path: "$.nested.property",
216
- value: {
217
- "TaxClassificationRef": {
218
- "value": "EUC-99990201-V1-00020000",
219
- },
220
- },
221
- },
222
- ],
223
- },
224
- ],
225
- },
226
- ],
227
- meta: {
228
- itemsOnPage: 50,
229
- cursors: {
230
- previous: "em9oby1jcm06OnBhZ2U6OjE=",
231
- current: "em9oby1jcm06OnBhZ2U6OjI=",
232
- next: "em9oby1jcm06OnBhZ2U6OjM=",
233
- },
234
- },
235
- links: {
236
- previous:
237
- "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
238
- current: "https://unify.apideck.com/crm/companies",
239
- next:
240
- "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
241
- },
242
- });
243
- });
244
-
245
- test("Pipelines Crm Pipelines Add", async () => {
246
- const testHttpClient = createTestHTTPClient("crm.pipelinesAdd");
247
-
248
- const apideck = new Apideck({
249
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
250
- httpClient: testHttpClient,
251
- apiKey: process.env["APIDECK_API_KEY"] ?? "value",
252
- });
253
-
254
- const result = await apideck.crm.pipelines.create({
255
- consumerId: "test-consumer",
256
- appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
257
- serviceId: "salesforce",
258
- pipeline: {
259
- id: "default",
260
- name: "Sales Pipeline",
261
- currency: "USD",
262
- archived: false,
263
- active: false,
264
- displayOrder: 1,
265
- winProbabilityEnabled: true,
266
- stages: [
267
- {
268
- name: "Contract Sent",
269
- value: "CONTRACT_SENT",
270
- winProbability: 50,
271
- displayOrder: 1,
272
- },
273
- {
274
- name: "Contract Sent",
275
- value: "CONTRACT_SENT",
276
- winProbability: 50,
277
- displayOrder: 1,
278
- },
279
- ],
280
- passThrough: [
281
- {
282
- serviceId: "<id>",
283
- extendPaths: [
284
- {
285
- path: "$.nested.property",
286
- value: {
287
- "TaxClassificationRef": {
288
- "value": "EUC-99990201-V1-00020000",
289
- },
290
- },
291
- },
292
- {
293
- path: "$.nested.property",
294
- value: {
295
- "TaxClassificationRef": {
296
- "value": "EUC-99990201-V1-00020000",
297
- },
298
- },
299
- },
300
- ],
301
- },
302
- {
303
- serviceId: "<id>",
304
- extendPaths: [
305
- {
306
- path: "$.nested.property",
307
- value: {
308
- "TaxClassificationRef": {
309
- "value": "EUC-99990201-V1-00020000",
310
- },
311
- },
312
- },
313
- ],
314
- },
315
- ],
316
- },
317
- });
318
- expect(result.httpMeta.response.status).toBe(201);
319
- expect(result.createPipelineResponse).toBeDefined();
320
- expect(result.createPipelineResponse).toEqual({
321
- statusCode: 200,
322
- status: "OK",
323
- service: "zoho-crm",
324
- resource: "pipelines",
325
- operation: "add",
326
- data: {
327
- id: "12345",
328
- },
329
- });
330
- });
331
-
332
- test("Pipelines Crm Pipelines One", async () => {
333
- const testHttpClient = createTestHTTPClient("crm.pipelinesOne");
334
-
335
- const apideck = new Apideck({
336
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
337
- httpClient: testHttpClient,
338
- apiKey: process.env["APIDECK_API_KEY"] ?? "value",
339
- });
340
-
341
- const result = await apideck.crm.pipelines.get({
342
- id: "<id>",
343
- consumerId: "test-consumer",
344
- appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
345
- serviceId: "salesforce",
346
- fields: "id,updated_at",
347
- });
348
- expect(result.httpMeta.response.status).toBe(200);
349
- expect(result.getPipelineResponse).toBeDefined();
350
- expect(result.getPipelineResponse).toEqual({
351
- statusCode: 200,
352
- status: "OK",
353
- service: "zoho-crm",
354
- resource: "pipelines",
355
- operation: "one",
356
- data: {
357
- id: "default",
358
- name: "Sales Pipeline",
359
- currency: "USD",
360
- archived: false,
361
- active: false,
362
- displayOrder: 1,
363
- winProbabilityEnabled: true,
364
- stages: [
365
- {
366
- id: "contractsent",
367
- name: "Contract Sent",
368
- value: "CONTRACT_SENT",
369
- winProbability: 50,
370
- displayOrder: 1,
371
- },
372
- {
373
- id: "contractsent",
374
- name: "Contract Sent",
375
- value: "CONTRACT_SENT",
376
- winProbability: 50,
377
- displayOrder: 1,
378
- },
379
- {
380
- id: "contractsent",
381
- name: "Contract Sent",
382
- value: "CONTRACT_SENT",
383
- winProbability: 50,
384
- displayOrder: 1,
385
- },
386
- ],
387
- updatedAt: new Date("2020-09-30T07:43:32.000Z"),
388
- createdAt: new Date("2020-09-30T07:43:32.000Z"),
389
- passThrough: [
390
- {
391
- serviceId: "<id>",
392
- extendPaths: [
393
- {
394
- path: "$.nested.property",
395
- value: {
396
- "TaxClassificationRef": {
397
- "value": "EUC-99990201-V1-00020000",
398
- },
399
- },
400
- },
401
- {
402
- path: "$.nested.property",
403
- value: {
404
- "TaxClassificationRef": {
405
- "value": "EUC-99990201-V1-00020000",
406
- },
407
- },
408
- },
409
- ],
410
- },
411
- {
412
- serviceId: "<id>",
413
- extendPaths: [
414
- {
415
- path: "$.nested.property",
416
- value: {
417
- "TaxClassificationRef": {
418
- "value": "EUC-99990201-V1-00020000",
419
- },
420
- },
421
- },
422
- {
423
- path: "$.nested.property",
424
- value: {
425
- "TaxClassificationRef": {
426
- "value": "EUC-99990201-V1-00020000",
427
- },
428
- },
429
- },
430
- ],
431
- },
432
- ],
433
- },
434
- });
435
- });
436
-
437
- test("Pipelines Crm Pipelines Update", async () => {
438
- const testHttpClient = createTestHTTPClient("crm.pipelinesUpdate");
439
-
440
- const apideck = new Apideck({
441
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
442
- httpClient: testHttpClient,
443
- apiKey: process.env["APIDECK_API_KEY"] ?? "value",
444
- });
445
-
446
- const result = await apideck.crm.pipelines.update({
447
- id: "<id>",
448
- consumerId: "test-consumer",
449
- appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
450
- serviceId: "salesforce",
451
- pipeline: {
452
- id: "default",
453
- name: "Sales Pipeline",
454
- currency: "USD",
455
- archived: false,
456
- active: false,
457
- displayOrder: 1,
458
- winProbabilityEnabled: true,
459
- stages: [
460
- {
461
- name: "Contract Sent",
462
- value: "CONTRACT_SENT",
463
- winProbability: 50,
464
- displayOrder: 1,
465
- },
466
- {
467
- name: "Contract Sent",
468
- value: "CONTRACT_SENT",
469
- winProbability: 50,
470
- displayOrder: 1,
471
- },
472
- {
473
- name: "Contract Sent",
474
- value: "CONTRACT_SENT",
475
- winProbability: 50,
476
- displayOrder: 1,
477
- },
478
- ],
479
- passThrough: [
480
- {
481
- serviceId: "<id>",
482
- extendPaths: [
483
- {
484
- path: "$.nested.property",
485
- value: {
486
- "TaxClassificationRef": {
487
- "value": "EUC-99990201-V1-00020000",
488
- },
489
- },
490
- },
491
- {
492
- path: "$.nested.property",
493
- value: {
494
- "TaxClassificationRef": {
495
- "value": "EUC-99990201-V1-00020000",
496
- },
497
- },
498
- },
499
- ],
500
- },
501
- {
502
- serviceId: "<id>",
503
- extendPaths: [
504
- {
505
- path: "$.nested.property",
506
- value: {
507
- "TaxClassificationRef": {
508
- "value": "EUC-99990201-V1-00020000",
509
- },
510
- },
511
- },
512
- {
513
- path: "$.nested.property",
514
- value: {
515
- "TaxClassificationRef": {
516
- "value": "EUC-99990201-V1-00020000",
517
- },
518
- },
519
- },
520
- {
521
- path: "$.nested.property",
522
- value: {
523
- "TaxClassificationRef": {
524
- "value": "EUC-99990201-V1-00020000",
525
- },
526
- },
527
- },
528
- ],
529
- },
530
- ],
531
- },
532
- });
533
- expect(result.httpMeta.response.status).toBe(200);
534
- expect(result.updatePipelineResponse).toBeDefined();
535
- expect(result.updatePipelineResponse).toEqual({
536
- statusCode: 200,
537
- status: "OK",
538
- service: "zoho-crm",
539
- resource: "pipelines",
540
- operation: "update",
541
- data: {
542
- id: "12345",
543
- },
544
- });
545
- });
546
-
547
- test("Pipelines Crm Pipelines Delete", async () => {
548
- const testHttpClient = createTestHTTPClient("crm.pipelinesDelete");
549
-
550
- const apideck = new Apideck({
551
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
552
- httpClient: testHttpClient,
553
- apiKey: process.env["APIDECK_API_KEY"] ?? "value",
554
- });
555
-
556
- const result = await apideck.crm.pipelines.delete({
557
- id: "<id>",
558
- consumerId: "test-consumer",
559
- appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
560
- serviceId: "salesforce",
561
- });
562
- expect(result.httpMeta.response.status).toBe(200);
563
- expect(result.deletePipelineResponse).toBeDefined();
564
- expect(result.deletePipelineResponse).toEqual({
565
- statusCode: 200,
566
- status: "OK",
567
- service: "zoho-crm",
568
- resource: "companies",
569
- operation: "delete",
570
- data: {
571
- id: "12345",
572
- },
573
- });
574
- });