@apideck/unify 0.23.0 → 0.23.1

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 (93) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +3 -3
  3. package/lib/config.js +3 -3
  4. package/models/components/note.d.ts +5 -0
  5. package/models/components/note.d.ts.map +1 -1
  6. package/models/components/note.js +4 -0
  7. package/models/components/note.js.map +1 -1
  8. package/models/components/noteinput.d.ts +5 -0
  9. package/models/components/noteinput.d.ts.map +1 -1
  10. package/models/components/noteinput.js +4 -0
  11. package/models/components/noteinput.js.map +1 -1
  12. package/package.json +5 -1
  13. package/src/__tests__/activities.test.ts +783 -0
  14. package/src/__tests__/agedcreditors.test.ts +279 -0
  15. package/src/__tests__/ageddebtors.test.ts +279 -0
  16. package/src/__tests__/apideckcompanies.test.ts +712 -0
  17. package/src/__tests__/apideckcustomers.test.ts +360 -0
  18. package/src/__tests__/apideckdepartments.test.ts +319 -0
  19. package/src/__tests__/apiresources.test.ts +61 -0
  20. package/src/__tests__/apis.test.ts +214 -0
  21. package/src/__tests__/applicants.test.ts +976 -0
  22. package/src/__tests__/applications.test.ts +329 -0
  23. package/src/__tests__/assertions.ts +13 -0
  24. package/src/__tests__/attachments.test.ts +363 -0
  25. package/src/__tests__/balancesheet.test.ts +451 -0
  26. package/src/__tests__/billpayments.test.ts +666 -0
  27. package/src/__tests__/bills.test.ts +1133 -0
  28. package/src/__tests__/collections.test.ts +115 -0
  29. package/src/__tests__/collectiontags.test.ts +66 -0
  30. package/src/__tests__/collectionticketcomments.test.ts +318 -0
  31. package/src/__tests__/collectiontickets.test.ts +436 -0
  32. package/src/__tests__/collectionusers.test.ts +122 -0
  33. package/src/__tests__/companies.test.ts +1059 -0
  34. package/src/__tests__/companyinfo.test.ts +218 -0
  35. package/src/__tests__/connectioncustommappings.test.ts +67 -0
  36. package/src/__tests__/connections.test.ts +1713 -0
  37. package/src/__tests__/connectionsettings.test.ts +280 -0
  38. package/src/__tests__/connectordocs.test.ts +28 -0
  39. package/src/__tests__/connectors.test.ts +751 -0
  40. package/src/__tests__/consumerrequestcounts.test.ts +41 -0
  41. package/src/__tests__/consumers.test.ts +517 -0
  42. package/src/__tests__/contacts.test.ts +957 -0
  43. package/src/__tests__/createcallback.test.ts +34 -0
  44. package/src/__tests__/creditnotes.test.ts +1362 -0
  45. package/src/__tests__/customers.test.ts +1089 -0
  46. package/src/__tests__/customfields.test.ts +50 -0
  47. package/src/__tests__/custommappings.test.ts +63 -0
  48. package/src/__tests__/departments.test.ts +359 -0
  49. package/src/__tests__/drivegroups.test.ts +318 -0
  50. package/src/__tests__/drives.test.ts +311 -0
  51. package/src/__tests__/employeepayrolls.test.ts +487 -0
  52. package/src/__tests__/employees.test.ts +1682 -0
  53. package/src/__tests__/employeeschedules.test.ts +456 -0
  54. package/src/__tests__/eventlogs.test.ts +157 -0
  55. package/src/__tests__/expenses.test.ts +566 -0
  56. package/src/__tests__/files.test.ts +392 -0
  57. package/src/__tests__/files.ts +56 -0
  58. package/src/__tests__/folders.test.ts +103 -0
  59. package/src/__tests__/invoiceitems.test.ts +586 -0
  60. package/src/__tests__/invoices.test.ts +1561 -0
  61. package/src/__tests__/jobs.test.ts +837 -0
  62. package/src/__tests__/journalentries.test.ts +1053 -0
  63. package/src/__tests__/leads.test.ts +897 -0
  64. package/src/__tests__/ledgeraccounts.test.ts +594 -0
  65. package/src/__tests__/locations.test.ts +561 -0
  66. package/src/__tests__/logs.test.ts +135 -0
  67. package/src/__tests__/messages.test.ts +396 -0
  68. package/src/__tests__/mockserver/README.md +52 -0
  69. package/src/__tests__/notes.test.ts +335 -0
  70. package/src/__tests__/opportunities.test.ts +503 -0
  71. package/src/__tests__/orders.test.ts +849 -0
  72. package/src/__tests__/payments.test.ts +557 -0
  73. package/src/__tests__/payrolls.test.ts +481 -0
  74. package/src/__tests__/pipelines.test.ts +383 -0
  75. package/src/__tests__/products.test.ts +505 -0
  76. package/src/__tests__/profitandloss.test.ts +221 -0
  77. package/src/__tests__/purchaseorders.test.ts +1464 -0
  78. package/src/__tests__/sessions.test.ts +70 -0
  79. package/src/__tests__/sharedlinks.test.ts +331 -0
  80. package/src/__tests__/stores.test.ts +39 -0
  81. package/src/__tests__/subsidiaries.test.ts +316 -0
  82. package/src/__tests__/suppliers.test.ts +1071 -0
  83. package/src/__tests__/taxrates.test.ts +472 -0
  84. package/src/__tests__/testclient.ts +48 -0
  85. package/src/__tests__/timeoffrequests.test.ts +381 -0
  86. package/src/__tests__/trackingcategories.test.ts +329 -0
  87. package/src/__tests__/uploadsessions.test.ts +142 -0
  88. package/src/__tests__/users.test.ts +667 -0
  89. package/src/__tests__/validateconnection.test.ts +32 -0
  90. package/src/__tests__/webhooks.test.ts +248 -0
  91. package/src/lib/config.ts +3 -3
  92. package/src/models/components/note.ts +9 -0
  93. package/src/models/components/noteinput.ts +9 -0
@@ -0,0 +1,505 @@
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("Products Ecommerce Products All", async () => {
10
+ const testHttpClient = createTestHTTPClient("ecommerce.productsAll");
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.ecommerce.products.list({
19
+ serviceId: "salesforce",
20
+ passThrough: {
21
+ "search": "San Francisco",
22
+ },
23
+ fields: "id,updated_at",
24
+ });
25
+ expect(result.httpMeta.response.status).toBe(200);
26
+ expect(result.getProductsResponse).toBeDefined();
27
+ expect(result.getProductsResponse).toEqual({
28
+ statusCode: 200,
29
+ status: "OK",
30
+ service: "shopify",
31
+ resource: "products",
32
+ operation: "all",
33
+ data: [
34
+ {
35
+ id: "12345",
36
+ name: "MacBook Pro",
37
+ description:
38
+ "Powerful and portable, the MacBook Pro is perfect for professionals and creatives.",
39
+ status: "active",
40
+ price: "1999.99",
41
+ sku: "MBP123",
42
+ inventoryQuantity: "10",
43
+ images: [
44
+ {
45
+ id: "12345",
46
+ url: "https://example.com/macbook-pro.jpg",
47
+ },
48
+ {
49
+ id: "12345",
50
+ url: "https://example.com/macbook-pro.jpg",
51
+ },
52
+ ],
53
+ weight: "1.25",
54
+ weightUnit: "lb",
55
+ options: [
56
+ {
57
+ id: "1",
58
+ name: "Color",
59
+ values: [
60
+ "Red",
61
+ ],
62
+ },
63
+ {
64
+ id: "1",
65
+ name: "Color",
66
+ values: [
67
+ "Red",
68
+ ],
69
+ },
70
+ {
71
+ id: "1",
72
+ name: "Color",
73
+ values: [
74
+ "Red",
75
+ ],
76
+ },
77
+ ],
78
+ variants: [
79
+ {
80
+ id: "1",
81
+ name: "Midnight 16inch MacBook Pro",
82
+ price: "1999.99",
83
+ sku: "MBP123-16GB-SILVER-13",
84
+ inventoryQuantity: "5",
85
+ weight: "1.25",
86
+ weightUnit: "lb",
87
+ options: [
88
+ {
89
+ id: "1",
90
+ name: "Color",
91
+ value: "Silver",
92
+ },
93
+ ],
94
+ images: [
95
+ {
96
+ id: "12345",
97
+ url: "https://example.com/macbook-pro.jpg",
98
+ },
99
+ ],
100
+ },
101
+ ],
102
+ tags: [
103
+ "Apple",
104
+ ],
105
+ categories: [
106
+ {
107
+ id: "12345",
108
+ name: "Laptops",
109
+ },
110
+ {
111
+ id: "12345",
112
+ name: "Laptops",
113
+ },
114
+ ],
115
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
116
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
117
+ },
118
+ {
119
+ id: "12345",
120
+ name: "MacBook Pro",
121
+ description:
122
+ "Powerful and portable, the MacBook Pro is perfect for professionals and creatives.",
123
+ status: "active",
124
+ price: "1999.99",
125
+ sku: "MBP123",
126
+ inventoryQuantity: "10",
127
+ images: [
128
+ {
129
+ id: "12345",
130
+ url: "https://example.com/macbook-pro.jpg",
131
+ },
132
+ {
133
+ id: "12345",
134
+ url: "https://example.com/macbook-pro.jpg",
135
+ },
136
+ ],
137
+ weight: "1.25",
138
+ weightUnit: "lb",
139
+ options: [
140
+ {
141
+ id: "1",
142
+ name: "Color",
143
+ values: [
144
+ "Red",
145
+ ],
146
+ },
147
+ ],
148
+ variants: [
149
+ {
150
+ id: "1",
151
+ name: "Midnight 16inch MacBook Pro",
152
+ price: "1999.99",
153
+ sku: "MBP123-16GB-SILVER-13",
154
+ inventoryQuantity: "5",
155
+ weight: "1.25",
156
+ weightUnit: "lb",
157
+ options: [
158
+ {
159
+ id: "1",
160
+ name: "Color",
161
+ value: "Silver",
162
+ },
163
+ ],
164
+ images: [
165
+ {
166
+ id: "12345",
167
+ url: "https://example.com/macbook-pro.jpg",
168
+ },
169
+ ],
170
+ },
171
+ {
172
+ id: "1",
173
+ name: "Midnight 16inch MacBook Pro",
174
+ price: "1999.99",
175
+ sku: "MBP123-16GB-SILVER-13",
176
+ inventoryQuantity: "5",
177
+ weight: "1.25",
178
+ weightUnit: "lb",
179
+ options: [
180
+ {
181
+ id: "1",
182
+ name: "Color",
183
+ value: "Silver",
184
+ },
185
+ {
186
+ id: "1",
187
+ name: "Color",
188
+ value: "Silver",
189
+ },
190
+ {
191
+ id: "1",
192
+ name: "Color",
193
+ value: "Silver",
194
+ },
195
+ ],
196
+ images: [
197
+ {
198
+ id: "12345",
199
+ url: "https://example.com/macbook-pro.jpg",
200
+ },
201
+ {
202
+ id: "12345",
203
+ url: "https://example.com/macbook-pro.jpg",
204
+ },
205
+ ],
206
+ },
207
+ {
208
+ id: "1",
209
+ name: "Midnight 16inch MacBook Pro",
210
+ price: "1999.99",
211
+ sku: "MBP123-16GB-SILVER-13",
212
+ inventoryQuantity: "5",
213
+ weight: "1.25",
214
+ weightUnit: "lb",
215
+ options: [
216
+ {
217
+ id: "1",
218
+ name: "Color",
219
+ value: "Silver",
220
+ },
221
+ {
222
+ id: "1",
223
+ name: "Color",
224
+ value: "Silver",
225
+ },
226
+ ],
227
+ images: [
228
+ {
229
+ id: "12345",
230
+ url: "https://example.com/macbook-pro.jpg",
231
+ },
232
+ ],
233
+ },
234
+ ],
235
+ tags: [
236
+ "Apple",
237
+ ],
238
+ categories: [
239
+ {
240
+ id: "12345",
241
+ name: "Laptops",
242
+ },
243
+ ],
244
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
245
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
246
+ },
247
+ {
248
+ id: "12345",
249
+ name: "MacBook Pro",
250
+ description:
251
+ "Powerful and portable, the MacBook Pro is perfect for professionals and creatives.",
252
+ status: "active",
253
+ price: "1999.99",
254
+ sku: "MBP123",
255
+ inventoryQuantity: "10",
256
+ images: [
257
+ {
258
+ id: "12345",
259
+ url: "https://example.com/macbook-pro.jpg",
260
+ },
261
+ {
262
+ id: "12345",
263
+ url: "https://example.com/macbook-pro.jpg",
264
+ },
265
+ ],
266
+ weight: "1.25",
267
+ weightUnit: "lb",
268
+ options: [
269
+ {
270
+ id: "1",
271
+ name: "Color",
272
+ values: [
273
+ "Red",
274
+ ],
275
+ },
276
+ {
277
+ id: "1",
278
+ name: "Color",
279
+ values: [
280
+ "Red",
281
+ ],
282
+ },
283
+ ],
284
+ variants: [
285
+ {
286
+ id: "1",
287
+ name: "Midnight 16inch MacBook Pro",
288
+ price: "1999.99",
289
+ sku: "MBP123-16GB-SILVER-13",
290
+ inventoryQuantity: "5",
291
+ weight: "1.25",
292
+ weightUnit: "lb",
293
+ options: [
294
+ {
295
+ id: "1",
296
+ name: "Color",
297
+ value: "Silver",
298
+ },
299
+ {
300
+ id: "1",
301
+ name: "Color",
302
+ value: "Silver",
303
+ },
304
+ {
305
+ id: "1",
306
+ name: "Color",
307
+ value: "Silver",
308
+ },
309
+ ],
310
+ images: [
311
+ {
312
+ id: "12345",
313
+ url: "https://example.com/macbook-pro.jpg",
314
+ },
315
+ {
316
+ id: "12345",
317
+ url: "https://example.com/macbook-pro.jpg",
318
+ },
319
+ ],
320
+ },
321
+ ],
322
+ tags: [
323
+ "Apple",
324
+ ],
325
+ categories: [
326
+ {
327
+ id: "12345",
328
+ name: "Laptops",
329
+ },
330
+ {
331
+ id: "12345",
332
+ name: "Laptops",
333
+ },
334
+ {
335
+ id: "12345",
336
+ name: "Laptops",
337
+ },
338
+ ],
339
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
340
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
341
+ },
342
+ ],
343
+ meta: {
344
+ itemsOnPage: 50,
345
+ cursors: {
346
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
347
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
348
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
349
+ },
350
+ },
351
+ links: {
352
+ previous:
353
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
354
+ current: "https://unify.apideck.com/crm/companies",
355
+ next:
356
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
357
+ },
358
+ });
359
+ });
360
+
361
+ test("Products Ecommerce Products One", async () => {
362
+ const testHttpClient = createTestHTTPClient("ecommerce.productsOne");
363
+
364
+ const apideck = new Apideck({
365
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
366
+ httpClient: testHttpClient,
367
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
368
+ });
369
+
370
+ const result = await apideck.ecommerce.products.get({
371
+ id: "<id>",
372
+ serviceId: "salesforce",
373
+ fields: "id,updated_at",
374
+ });
375
+ expect(result.httpMeta.response.status).toBe(200);
376
+ expect(result.getProductResponse).toBeDefined();
377
+ expect(result.getProductResponse).toEqual({
378
+ statusCode: 200,
379
+ status: "OK",
380
+ service: "shopify",
381
+ resource: "products",
382
+ operation: "one",
383
+ data: {
384
+ id: "12345",
385
+ name: "MacBook Pro",
386
+ description:
387
+ "Powerful and portable, the MacBook Pro is perfect for professionals and creatives.",
388
+ status: "active",
389
+ price: "1999.99",
390
+ sku: "MBP123",
391
+ inventoryQuantity: "10",
392
+ images: [
393
+ {
394
+ id: "12345",
395
+ url: "https://example.com/macbook-pro.jpg",
396
+ },
397
+ {
398
+ id: "12345",
399
+ url: "https://example.com/macbook-pro.jpg",
400
+ },
401
+ {
402
+ id: "12345",
403
+ url: "https://example.com/macbook-pro.jpg",
404
+ },
405
+ ],
406
+ weight: "1.25",
407
+ weightUnit: "lb",
408
+ options: [
409
+ {
410
+ id: "1",
411
+ name: "Color",
412
+ values: [
413
+ "Red",
414
+ ],
415
+ },
416
+ {
417
+ id: "1",
418
+ name: "Color",
419
+ values: [
420
+ "Red",
421
+ ],
422
+ },
423
+ ],
424
+ variants: [
425
+ {
426
+ id: "1",
427
+ name: "Midnight 16inch MacBook Pro",
428
+ price: "1999.99",
429
+ sku: "MBP123-16GB-SILVER-13",
430
+ inventoryQuantity: "5",
431
+ weight: "1.25",
432
+ weightUnit: "lb",
433
+ options: [
434
+ {
435
+ id: "1",
436
+ name: "Color",
437
+ value: "Silver",
438
+ },
439
+ {
440
+ id: "1",
441
+ name: "Color",
442
+ value: "Silver",
443
+ },
444
+ ],
445
+ images: [
446
+ {
447
+ id: "12345",
448
+ url: "https://example.com/macbook-pro.jpg",
449
+ },
450
+ {
451
+ id: "12345",
452
+ url: "https://example.com/macbook-pro.jpg",
453
+ },
454
+ {
455
+ id: "12345",
456
+ url: "https://example.com/macbook-pro.jpg",
457
+ },
458
+ ],
459
+ },
460
+ {
461
+ id: "1",
462
+ name: "Midnight 16inch MacBook Pro",
463
+ price: "1999.99",
464
+ sku: "MBP123-16GB-SILVER-13",
465
+ inventoryQuantity: "5",
466
+ weight: "1.25",
467
+ weightUnit: "lb",
468
+ options: [
469
+ {
470
+ id: "1",
471
+ name: "Color",
472
+ value: "Silver",
473
+ },
474
+ {
475
+ id: "1",
476
+ name: "Color",
477
+ value: "Silver",
478
+ },
479
+ ],
480
+ images: [
481
+ {
482
+ id: "12345",
483
+ url: "https://example.com/macbook-pro.jpg",
484
+ },
485
+ {
486
+ id: "12345",
487
+ url: "https://example.com/macbook-pro.jpg",
488
+ },
489
+ ],
490
+ },
491
+ ],
492
+ tags: [
493
+ "Apple",
494
+ ],
495
+ categories: [
496
+ {
497
+ id: "12345",
498
+ name: "Laptops",
499
+ },
500
+ ],
501
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
502
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
503
+ },
504
+ });
505
+ });