@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,523 +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("Notes Crm Notes All", async () => {
10
- const testHttpClient = createTestHTTPClient("crm.notesAll");
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.notes.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.getNotesResponse).toBeDefined();
29
- expect(result.getNotesResponse).toEqual({
30
- statusCode: 200,
31
- status: "OK",
32
- service: "zoho-crm",
33
- resource: "notes",
34
- operation: "all",
35
- data: [
36
- {
37
- id: "12345",
38
- title: "Meeting Notes",
39
- content: "Office hours are 9AM-6PM",
40
- ownerId: "12345",
41
- contactId: "12345",
42
- companyId: "12345",
43
- opportunityId: "12345",
44
- leadId: "12345",
45
- active: true,
46
- updatedBy: "12345",
47
- createdBy: "12345",
48
- updatedAt: "2020-09-30T07:43:32.000Z",
49
- createdAt: "2020-09-30T07:43:32.000Z",
50
- passThrough: [
51
- {
52
- serviceId: "<id>",
53
- extendPaths: [
54
- {
55
- path: "$.nested.property",
56
- value: {
57
- "TaxClassificationRef": {
58
- "value": "EUC-99990201-V1-00020000",
59
- },
60
- },
61
- },
62
- {
63
- path: "$.nested.property",
64
- value: {
65
- "TaxClassificationRef": {
66
- "value": "EUC-99990201-V1-00020000",
67
- },
68
- },
69
- },
70
- {
71
- path: "$.nested.property",
72
- value: {
73
- "TaxClassificationRef": {
74
- "value": "EUC-99990201-V1-00020000",
75
- },
76
- },
77
- },
78
- ],
79
- },
80
- {
81
- serviceId: "<id>",
82
- extendPaths: [
83
- {
84
- path: "$.nested.property",
85
- value: {
86
- "TaxClassificationRef": {
87
- "value": "EUC-99990201-V1-00020000",
88
- },
89
- },
90
- },
91
- ],
92
- },
93
- ],
94
- },
95
- {
96
- id: "12345",
97
- title: "Meeting Notes",
98
- content: "Office hours are 9AM-6PM",
99
- ownerId: "12345",
100
- contactId: "12345",
101
- companyId: "12345",
102
- opportunityId: "12345",
103
- leadId: "12345",
104
- active: true,
105
- updatedBy: "12345",
106
- createdBy: "12345",
107
- updatedAt: "2020-09-30T07:43:32.000Z",
108
- createdAt: "2020-09-30T07:43:32.000Z",
109
- passThrough: [
110
- {
111
- serviceId: "<id>",
112
- extendPaths: [
113
- {
114
- path: "$.nested.property",
115
- value: {
116
- "TaxClassificationRef": {
117
- "value": "EUC-99990201-V1-00020000",
118
- },
119
- },
120
- },
121
- ],
122
- },
123
- ],
124
- },
125
- {
126
- id: "12345",
127
- title: "Meeting Notes",
128
- content: "Office hours are 9AM-6PM",
129
- ownerId: "12345",
130
- contactId: "12345",
131
- companyId: "12345",
132
- opportunityId: "12345",
133
- leadId: "12345",
134
- active: true,
135
- updatedBy: "12345",
136
- createdBy: "12345",
137
- updatedAt: "2020-09-30T07:43:32.000Z",
138
- createdAt: "2020-09-30T07:43:32.000Z",
139
- passThrough: [
140
- {
141
- serviceId: "<id>",
142
- extendPaths: [
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
- serviceId: "<id>",
163
- extendPaths: [
164
- {
165
- path: "$.nested.property",
166
- value: {
167
- "TaxClassificationRef": {
168
- "value": "EUC-99990201-V1-00020000",
169
- },
170
- },
171
- },
172
- ],
173
- },
174
- ],
175
- },
176
- ],
177
- meta: {
178
- itemsOnPage: 50,
179
- cursors: {
180
- previous: "em9oby1jcm06OnBhZ2U6OjE=",
181
- current: "em9oby1jcm06OnBhZ2U6OjI=",
182
- next: "em9oby1jcm06OnBhZ2U6OjM=",
183
- },
184
- },
185
- links: {
186
- previous:
187
- "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
188
- current: "https://unify.apideck.com/crm/companies",
189
- next:
190
- "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
191
- },
192
- });
193
- });
194
-
195
- test("Notes Crm Notes Add", async () => {
196
- const testHttpClient = createTestHTTPClient("crm.notesAdd");
197
-
198
- const apideck = new Apideck({
199
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
200
- httpClient: testHttpClient,
201
- apiKey: process.env["APIDECK_API_KEY"] ?? "value",
202
- });
203
-
204
- const result = await apideck.crm.notes.create({
205
- consumerId: "test-consumer",
206
- appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
207
- serviceId: "salesforce",
208
- note: {
209
- title: "Meeting Notes",
210
- content: "Office hours are 9AM-6PM",
211
- ownerId: "12345",
212
- contactId: "12345",
213
- companyId: "12345",
214
- opportunityId: "12345",
215
- leadId: "12345",
216
- active: true,
217
- passThrough: [
218
- {
219
- serviceId: "<id>",
220
- extendPaths: [
221
- {
222
- path: "$.nested.property",
223
- value: {
224
- "TaxClassificationRef": {
225
- "value": "EUC-99990201-V1-00020000",
226
- },
227
- },
228
- },
229
- {
230
- path: "$.nested.property",
231
- value: {
232
- "TaxClassificationRef": {
233
- "value": "EUC-99990201-V1-00020000",
234
- },
235
- },
236
- },
237
- ],
238
- },
239
- {
240
- serviceId: "<id>",
241
- extendPaths: [
242
- {
243
- path: "$.nested.property",
244
- value: {
245
- "TaxClassificationRef": {
246
- "value": "EUC-99990201-V1-00020000",
247
- },
248
- },
249
- },
250
- {
251
- path: "$.nested.property",
252
- value: {
253
- "TaxClassificationRef": {
254
- "value": "EUC-99990201-V1-00020000",
255
- },
256
- },
257
- },
258
- ],
259
- },
260
- ],
261
- },
262
- });
263
- expect(result.httpMeta.response.status).toBe(201);
264
- expect(result.createNoteResponse).toBeDefined();
265
- expect(result.createNoteResponse).toEqual({
266
- statusCode: 200,
267
- status: "OK",
268
- service: "zoho-crm",
269
- resource: "notes",
270
- operation: "add",
271
- data: {
272
- id: "12345",
273
- },
274
- });
275
- });
276
-
277
- test("Notes Crm Notes One", async () => {
278
- const testHttpClient = createTestHTTPClient("crm.notesOne");
279
-
280
- const apideck = new Apideck({
281
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
282
- httpClient: testHttpClient,
283
- apiKey: process.env["APIDECK_API_KEY"] ?? "value",
284
- });
285
-
286
- const result = await apideck.crm.notes.get({
287
- id: "<id>",
288
- consumerId: "test-consumer",
289
- appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
290
- serviceId: "salesforce",
291
- fields: "id,updated_at",
292
- });
293
- expect(result.httpMeta.response.status).toBe(200);
294
- expect(result.getNoteResponse).toBeDefined();
295
- expect(result.getNoteResponse).toEqual({
296
- statusCode: 200,
297
- status: "OK",
298
- service: "zoho-crm",
299
- resource: "notes",
300
- operation: "one",
301
- data: {
302
- id: "12345",
303
- title: "Meeting Notes",
304
- content: "Office hours are 9AM-6PM",
305
- ownerId: "12345",
306
- contactId: "12345",
307
- companyId: "12345",
308
- opportunityId: "12345",
309
- leadId: "12345",
310
- active: true,
311
- updatedBy: "12345",
312
- createdBy: "12345",
313
- updatedAt: "2020-09-30T07:43:32.000Z",
314
- createdAt: "2020-09-30T07:43:32.000Z",
315
- passThrough: [
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
- serviceId: "<id>",
360
- extendPaths: [
361
- {
362
- path: "$.nested.property",
363
- value: {
364
- "TaxClassificationRef": {
365
- "value": "EUC-99990201-V1-00020000",
366
- },
367
- },
368
- },
369
- {
370
- path: "$.nested.property",
371
- value: {
372
- "TaxClassificationRef": {
373
- "value": "EUC-99990201-V1-00020000",
374
- },
375
- },
376
- },
377
- ],
378
- },
379
- ],
380
- },
381
- });
382
- });
383
-
384
- test("Notes Crm Notes Update", async () => {
385
- const testHttpClient = createTestHTTPClient("crm.notesUpdate");
386
-
387
- const apideck = new Apideck({
388
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
389
- httpClient: testHttpClient,
390
- apiKey: process.env["APIDECK_API_KEY"] ?? "value",
391
- });
392
-
393
- const result = await apideck.crm.notes.update({
394
- id: "<id>",
395
- consumerId: "test-consumer",
396
- appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
397
- serviceId: "salesforce",
398
- note: {
399
- title: "Meeting Notes",
400
- content: "Office hours are 9AM-6PM",
401
- ownerId: "12345",
402
- contactId: "12345",
403
- companyId: "12345",
404
- opportunityId: "12345",
405
- leadId: "12345",
406
- active: true,
407
- passThrough: [
408
- {
409
- serviceId: "<id>",
410
- extendPaths: [
411
- {
412
- path: "$.nested.property",
413
- value: {
414
- "TaxClassificationRef": {
415
- "value": "EUC-99990201-V1-00020000",
416
- },
417
- },
418
- },
419
- {
420
- path: "$.nested.property",
421
- value: {
422
- "TaxClassificationRef": {
423
- "value": "EUC-99990201-V1-00020000",
424
- },
425
- },
426
- },
427
- ],
428
- },
429
- {
430
- serviceId: "<id>",
431
- extendPaths: [
432
- {
433
- path: "$.nested.property",
434
- value: {
435
- "TaxClassificationRef": {
436
- "value": "EUC-99990201-V1-00020000",
437
- },
438
- },
439
- },
440
- {
441
- path: "$.nested.property",
442
- value: {
443
- "TaxClassificationRef": {
444
- "value": "EUC-99990201-V1-00020000",
445
- },
446
- },
447
- },
448
- ],
449
- },
450
- {
451
- serviceId: "<id>",
452
- extendPaths: [
453
- {
454
- path: "$.nested.property",
455
- value: {
456
- "TaxClassificationRef": {
457
- "value": "EUC-99990201-V1-00020000",
458
- },
459
- },
460
- },
461
- {
462
- path: "$.nested.property",
463
- value: {
464
- "TaxClassificationRef": {
465
- "value": "EUC-99990201-V1-00020000",
466
- },
467
- },
468
- },
469
- {
470
- path: "$.nested.property",
471
- value: {
472
- "TaxClassificationRef": {
473
- "value": "EUC-99990201-V1-00020000",
474
- },
475
- },
476
- },
477
- ],
478
- },
479
- ],
480
- },
481
- });
482
- expect(result.httpMeta.response.status).toBe(200);
483
- expect(result.updateNoteResponse).toBeDefined();
484
- expect(result.updateNoteResponse).toEqual({
485
- statusCode: 200,
486
- status: "OK",
487
- service: "zoho-crm",
488
- resource: "notes",
489
- operation: "update",
490
- data: {
491
- id: "12345",
492
- },
493
- });
494
- });
495
-
496
- test("Notes Crm Notes Delete", async () => {
497
- const testHttpClient = createTestHTTPClient("crm.notesDelete");
498
-
499
- const apideck = new Apideck({
500
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
501
- httpClient: testHttpClient,
502
- apiKey: process.env["APIDECK_API_KEY"] ?? "value",
503
- });
504
-
505
- const result = await apideck.crm.notes.delete({
506
- id: "<id>",
507
- consumerId: "test-consumer",
508
- appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
509
- serviceId: "salesforce",
510
- });
511
- expect(result.httpMeta.response.status).toBe(200);
512
- expect(result.deleteNoteResponse).toBeDefined();
513
- expect(result.deleteNoteResponse).toEqual({
514
- statusCode: 200,
515
- status: "OK",
516
- service: "zoho-crm",
517
- resource: "notes",
518
- operation: "delete",
519
- data: {
520
- id: "12345",
521
- },
522
- });
523
- });