@apideck/unify 0.40.0 → 0.41.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 (96) 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/package.json +6 -2
  5. package/src/__tests__/activities.test.ts +1141 -0
  6. package/src/__tests__/agedcreditors.test.ts +280 -0
  7. package/src/__tests__/ageddebtors.test.ts +280 -0
  8. package/src/__tests__/apideckcompanies.test.ts +1082 -0
  9. package/src/__tests__/apideckcustomers.test.ts +364 -0
  10. package/src/__tests__/apideckdepartments.test.ts +497 -0
  11. package/src/__tests__/apiresources.test.ts +62 -0
  12. package/src/__tests__/apis.test.ts +216 -0
  13. package/src/__tests__/applicants.test.ts +1445 -0
  14. package/src/__tests__/applications.test.ts +515 -0
  15. package/src/__tests__/assertions.ts +13 -0
  16. package/src/__tests__/attachments.test.ts +371 -0
  17. package/src/__tests__/balancesheet.test.ts +453 -0
  18. package/src/__tests__/bankaccounts.test.ts +324 -0
  19. package/src/__tests__/bankfeedaccounts.test.ts +343 -0
  20. package/src/__tests__/bankfeedstatements.test.ts +408 -0
  21. package/src/__tests__/billpayments.test.ts +1031 -0
  22. package/src/__tests__/bills.test.ts +1630 -0
  23. package/src/__tests__/categories.test.ts +127 -0
  24. package/src/__tests__/collections.test.ts +120 -0
  25. package/src/__tests__/collectiontags.test.ts +68 -0
  26. package/src/__tests__/collectionticketcomments.test.ts +501 -0
  27. package/src/__tests__/collectiontickets.test.ts +627 -0
  28. package/src/__tests__/collectionusers.test.ts +126 -0
  29. package/src/__tests__/companies.test.ts +1642 -0
  30. package/src/__tests__/companyinfo.test.ts +219 -0
  31. package/src/__tests__/connectionconsent.test.ts +89 -0
  32. package/src/__tests__/connectionconsents.test.ts +31 -0
  33. package/src/__tests__/connectioncustommappings.test.ts +69 -0
  34. package/src/__tests__/connections.test.ts +2127 -0
  35. package/src/__tests__/connectionsettings.test.ts +687 -0
  36. package/src/__tests__/connectordocs.test.ts +29 -0
  37. package/src/__tests__/connectors.test.ts +753 -0
  38. package/src/__tests__/consumerrequestcounts.test.ts +42 -0
  39. package/src/__tests__/consumers.test.ts +523 -0
  40. package/src/__tests__/contacts.test.ts +1421 -0
  41. package/src/__tests__/createcallback.test.ts +36 -0
  42. package/src/__tests__/creditnotes.test.ts +2040 -0
  43. package/src/__tests__/customers.test.ts +1600 -0
  44. package/src/__tests__/customfields.test.ts +52 -0
  45. package/src/__tests__/custommappings.test.ts +65 -0
  46. package/src/__tests__/customobjects.test.ts +408 -0
  47. package/src/__tests__/customobjectschemas.test.ts +734 -0
  48. package/src/__tests__/departments.test.ts +529 -0
  49. package/src/__tests__/drivegroups.test.ts +496 -0
  50. package/src/__tests__/drives.test.ts +487 -0
  51. package/src/__tests__/employeepayrolls.test.ts +491 -0
  52. package/src/__tests__/employees.test.ts +2968 -0
  53. package/src/__tests__/employeeschedules.test.ts +457 -0
  54. package/src/__tests__/eventlogs.test.ts +158 -0
  55. package/src/__tests__/expensecategories.test.ts +324 -0
  56. package/src/__tests__/expensereports.test.ts +634 -0
  57. package/src/__tests__/expenses.test.ts +867 -0
  58. package/src/__tests__/files.test.ts +506 -0
  59. package/src/__tests__/files.ts +56 -0
  60. package/src/__tests__/folders.test.ts +390 -0
  61. package/src/__tests__/invoiceitems.test.ts +855 -0
  62. package/src/__tests__/invoices.test.ts +2173 -0
  63. package/src/__tests__/jobs.test.ts +1150 -0
  64. package/src/__tests__/journalentries.test.ts +1542 -0
  65. package/src/__tests__/leads.test.ts +1341 -0
  66. package/src/__tests__/ledgeraccounts.test.ts +829 -0
  67. package/src/__tests__/locations.test.ts +856 -0
  68. package/src/__tests__/logs.test.ts +137 -0
  69. package/src/__tests__/messages.test.ts +588 -0
  70. package/src/__tests__/notes.test.ts +523 -0
  71. package/src/__tests__/opportunities.test.ts +718 -0
  72. package/src/__tests__/orders.test.ts +854 -0
  73. package/src/__tests__/payments.test.ts +867 -0
  74. package/src/__tests__/payrolls.test.ts +485 -0
  75. package/src/__tests__/pipelines.test.ts +574 -0
  76. package/src/__tests__/products.test.ts +509 -0
  77. package/src/__tests__/profitandloss.test.ts +223 -0
  78. package/src/__tests__/projects.test.ts +480 -0
  79. package/src/__tests__/proxy.test.ts +41 -0
  80. package/src/__tests__/purchaseorders.test.ts +2139 -0
  81. package/src/__tests__/quotes.test.ts +678 -0
  82. package/src/__tests__/refunds.test.ts +812 -0
  83. package/src/__tests__/sessions.test.ts +72 -0
  84. package/src/__tests__/sharedlinks.test.ts +511 -0
  85. package/src/__tests__/stores.test.ts +41 -0
  86. package/src/__tests__/subsidiaries.test.ts +496 -0
  87. package/src/__tests__/suppliers.test.ts +1574 -0
  88. package/src/__tests__/taxrates.test.ts +701 -0
  89. package/src/__tests__/testclient.ts +48 -0
  90. package/src/__tests__/timeoffrequests.test.ts +588 -0
  91. package/src/__tests__/trackingcategories.test.ts +515 -0
  92. package/src/__tests__/uploadsessions.test.ts +221 -0
  93. package/src/__tests__/users.test.ts +1020 -0
  94. package/src/__tests__/validateconnection.test.ts +34 -0
  95. package/src/__tests__/webhooks.test.ts +254 -0
  96. package/src/lib/config.ts +4 -4
@@ -0,0 +1,52 @@
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("Customfields Vault Custom Fields All", async () => {
10
+ const testHttpClient = createTestHTTPClient("vault.customFieldsAll");
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.vault.customFields.list({
19
+ consumerId: "test-consumer",
20
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
21
+ unifiedApi: "crm",
22
+ serviceId: "pipedrive",
23
+ resource: "leads",
24
+ resourceId: "1234",
25
+ });
26
+ expect(result.httpMeta.response.status).toBe(200);
27
+ expect(result.getCustomFieldsResponse).toBeDefined();
28
+ expect(result.getCustomFieldsResponse).toEqual({
29
+ statusCode: 200,
30
+ status: "OK",
31
+ data: [
32
+ {
33
+ id: "123456",
34
+ name: "SSN",
35
+ description: "Employee Level",
36
+ value: "495172776",
37
+ },
38
+ {
39
+ id: "123456",
40
+ name: "SSN",
41
+ description: "Employee Level",
42
+ value: "495172776",
43
+ },
44
+ {
45
+ id: "123456",
46
+ name: "SSN",
47
+ description: "Employee Level",
48
+ value: "495172776",
49
+ },
50
+ ],
51
+ });
52
+ });
@@ -0,0 +1,65 @@
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("Custommappings Vault Custom Mappings All", async () => {
10
+ const testHttpClient = createTestHTTPClient("vault.customMappingsAll");
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.vault.customMappings.list({
19
+ consumerId: "test-consumer",
20
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
21
+ unifiedApi: "crm",
22
+ serviceId: "pipedrive",
23
+ });
24
+ expect(result.httpMeta.response.status).toBe(200);
25
+ expect(result.getCustomMappingsResponse).toBeDefined();
26
+ expect(result.getCustomMappingsResponse).toEqual({
27
+ statusCode: 200,
28
+ status: "OK",
29
+ data: [
30
+ {
31
+ id: "hris+employees+first_aid_training",
32
+ label: "First Aid Training",
33
+ description: "First Aid Training completed after 2019-01-01",
34
+ value: "$.root.training.first_aid",
35
+ key: "first_aid_training",
36
+ required: false,
37
+ customField: true,
38
+ consumerId: "test_user_id",
39
+ example: "Some value",
40
+ },
41
+ {
42
+ id: "hris+employees+first_aid_training",
43
+ label: "First Aid Training",
44
+ description: "First Aid Training completed after 2019-01-01",
45
+ value: "$.root.training.first_aid",
46
+ key: "first_aid_training",
47
+ required: false,
48
+ customField: true,
49
+ consumerId: "test_user_id",
50
+ example: "Some value",
51
+ },
52
+ {
53
+ id: "hris+employees+first_aid_training",
54
+ label: "First Aid Training",
55
+ description: "First Aid Training completed after 2019-01-01",
56
+ value: "$.root.training.first_aid",
57
+ key: "first_aid_training",
58
+ required: false,
59
+ customField: true,
60
+ consumerId: "test_user_id",
61
+ example: "Some value",
62
+ },
63
+ ],
64
+ });
65
+ });
@@ -0,0 +1,408 @@
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("Customobjects Crm Custom Objects All", async () => {
10
+ const testHttpClient = createTestHTTPClient("crm.customObjectsAll");
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.customObjects.list({
19
+ consumerId: "test-consumer",
20
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
21
+ serviceId: "salesforce",
22
+ passThrough: {
23
+ "search": "San Francisco",
24
+ },
25
+ fields: "id,updated_at",
26
+ objectId: "<id>",
27
+ });
28
+ expect(result.httpMeta.response.status).toBe(200);
29
+ expect(result.getCustomObjectsResponse).toBeDefined();
30
+ expect(result.getCustomObjectsResponse).toEqual({
31
+ statusCode: 200,
32
+ status: "OK",
33
+ service: "zoho-crm",
34
+ resource: "custom-objects",
35
+ operation: "all",
36
+ data: [
37
+ {
38
+ id: "co_12345",
39
+ ownerId: "user_12345",
40
+ name: "project",
41
+ fields: [
42
+ {
43
+ name: "name",
44
+ value: "string",
45
+ },
46
+ ],
47
+ updatedBy: "user_12345",
48
+ createdBy: "user_12345",
49
+ updatedAt: "2020-09-30T07:43:32.000Z",
50
+ createdAt: "2020-09-30T07:43:32.000Z",
51
+ passThrough: [
52
+ {
53
+ serviceId: "<id>",
54
+ extendPaths: [
55
+ {
56
+ path: "$.nested.property",
57
+ value: {
58
+ "TaxClassificationRef": {
59
+ "value": "EUC-99990201-V1-00020000",
60
+ },
61
+ },
62
+ },
63
+ ],
64
+ },
65
+ ],
66
+ },
67
+ {
68
+ id: "co_12345",
69
+ ownerId: "user_12345",
70
+ name: "project",
71
+ fields: [
72
+ {
73
+ name: "name",
74
+ value: "string",
75
+ },
76
+ ],
77
+ updatedBy: "user_12345",
78
+ createdBy: "user_12345",
79
+ updatedAt: "2020-09-30T07:43:32.000Z",
80
+ createdAt: "2020-09-30T07:43:32.000Z",
81
+ passThrough: [
82
+ {
83
+ serviceId: "<id>",
84
+ extendPaths: [
85
+ {
86
+ path: "$.nested.property",
87
+ value: {
88
+ "TaxClassificationRef": {
89
+ "value": "EUC-99990201-V1-00020000",
90
+ },
91
+ },
92
+ },
93
+ ],
94
+ },
95
+ ],
96
+ },
97
+ {
98
+ id: "co_12345",
99
+ ownerId: "user_12345",
100
+ name: "project",
101
+ fields: [
102
+ {
103
+ name: "name",
104
+ value: "string",
105
+ },
106
+ ],
107
+ updatedBy: "user_12345",
108
+ createdBy: "user_12345",
109
+ updatedAt: "2020-09-30T07:43:32.000Z",
110
+ createdAt: "2020-09-30T07:43:32.000Z",
111
+ passThrough: [
112
+ {
113
+ serviceId: "<id>",
114
+ extendPaths: [
115
+ {
116
+ path: "$.nested.property",
117
+ value: {
118
+ "TaxClassificationRef": {
119
+ "value": "EUC-99990201-V1-00020000",
120
+ },
121
+ },
122
+ },
123
+ ],
124
+ },
125
+ ],
126
+ },
127
+ ],
128
+ meta: {
129
+ itemsOnPage: 50,
130
+ cursors: {
131
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
132
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
133
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
134
+ },
135
+ },
136
+ links: {
137
+ previous:
138
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
139
+ current: "https://unify.apideck.com/crm/companies",
140
+ next:
141
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
142
+ },
143
+ });
144
+ });
145
+
146
+ test("Customobjects Crm Custom Objects Add", async () => {
147
+ const testHttpClient = createTestHTTPClient("crm.customObjectsAdd");
148
+
149
+ const apideck = new Apideck({
150
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
151
+ httpClient: testHttpClient,
152
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
153
+ });
154
+
155
+ const result = await apideck.crm.customObjects.create({
156
+ consumerId: "test-consumer",
157
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
158
+ serviceId: "salesforce",
159
+ objectId: "<id>",
160
+ customObject: {
161
+ name: "project",
162
+ fields: [
163
+ {
164
+ name: "name",
165
+ value: "string",
166
+ },
167
+ {
168
+ name: "name",
169
+ value: "string",
170
+ },
171
+ {
172
+ name: "name",
173
+ value: "string",
174
+ },
175
+ ],
176
+ passThrough: [
177
+ {
178
+ serviceId: "<id>",
179
+ extendPaths: [
180
+ {
181
+ path: "$.nested.property",
182
+ value: {
183
+ "TaxClassificationRef": {
184
+ "value": "EUC-99990201-V1-00020000",
185
+ },
186
+ },
187
+ },
188
+ ],
189
+ },
190
+ {
191
+ serviceId: "<id>",
192
+ extendPaths: [
193
+ {
194
+ path: "$.nested.property",
195
+ value: {
196
+ "TaxClassificationRef": {
197
+ "value": "EUC-99990201-V1-00020000",
198
+ },
199
+ },
200
+ },
201
+ ],
202
+ },
203
+ {
204
+ serviceId: "<id>",
205
+ extendPaths: [
206
+ {
207
+ path: "$.nested.property",
208
+ value: {
209
+ "TaxClassificationRef": {
210
+ "value": "EUC-99990201-V1-00020000",
211
+ },
212
+ },
213
+ },
214
+ ],
215
+ },
216
+ ],
217
+ },
218
+ });
219
+ expect(result.httpMeta.response.status).toBe(201);
220
+ expect(result.createCustomObjectResponse).toBeDefined();
221
+ expect(result.createCustomObjectResponse).toEqual({
222
+ statusCode: 200,
223
+ status: "OK",
224
+ service: "zoho-crm",
225
+ resource: "custom-objects",
226
+ operation: "add",
227
+ data: {
228
+ id: "12345",
229
+ },
230
+ });
231
+ });
232
+
233
+ test("Customobjects Crm Custom Objects One", async () => {
234
+ const testHttpClient = createTestHTTPClient("crm.customObjectsOne");
235
+
236
+ const apideck = new Apideck({
237
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
238
+ httpClient: testHttpClient,
239
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
240
+ });
241
+
242
+ const result = await apideck.crm.customObjects.get({
243
+ id: "<id>",
244
+ consumerId: "test-consumer",
245
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
246
+ serviceId: "salesforce",
247
+ objectId: "<id>",
248
+ });
249
+ expect(result.httpMeta.response.status).toBe(200);
250
+ expect(result.getCustomObjectResponse).toBeDefined();
251
+ expect(result.getCustomObjectResponse).toEqual({
252
+ statusCode: 200,
253
+ status: "OK",
254
+ service: "zoho-crm",
255
+ resource: "custom-objects",
256
+ operation: "one",
257
+ data: {
258
+ id: "co_12345",
259
+ ownerId: "user_12345",
260
+ name: "project",
261
+ fields: [
262
+ {
263
+ name: "name",
264
+ value: "string",
265
+ },
266
+ {
267
+ name: "name",
268
+ value: "string",
269
+ },
270
+ {
271
+ name: "name",
272
+ value: "string",
273
+ },
274
+ ],
275
+ updatedBy: "user_12345",
276
+ createdBy: "user_12345",
277
+ updatedAt: "2020-09-30T07:43:32.000Z",
278
+ createdAt: "2020-09-30T07:43:32.000Z",
279
+ passThrough: [
280
+ {
281
+ serviceId: "<id>",
282
+ extendPaths: [
283
+ {
284
+ path: "$.nested.property",
285
+ value: {
286
+ "TaxClassificationRef": {
287
+ "value": "EUC-99990201-V1-00020000",
288
+ },
289
+ },
290
+ },
291
+ {
292
+ path: "$.nested.property",
293
+ value: {
294
+ "TaxClassificationRef": {
295
+ "value": "EUC-99990201-V1-00020000",
296
+ },
297
+ },
298
+ },
299
+ {
300
+ path: "$.nested.property",
301
+ value: {
302
+ "TaxClassificationRef": {
303
+ "value": "EUC-99990201-V1-00020000",
304
+ },
305
+ },
306
+ },
307
+ ],
308
+ },
309
+ ],
310
+ },
311
+ });
312
+ });
313
+
314
+ test("Customobjects Crm Custom Objects Update", async () => {
315
+ const testHttpClient = createTestHTTPClient("crm.customObjectsUpdate");
316
+
317
+ const apideck = new Apideck({
318
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
319
+ httpClient: testHttpClient,
320
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
321
+ });
322
+
323
+ const result = await apideck.crm.customObjects.update({
324
+ id: "<id>",
325
+ objectId: "<id>",
326
+ consumerId: "test-consumer",
327
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
328
+ serviceId: "salesforce",
329
+ customObject: {
330
+ name: "project",
331
+ fields: [
332
+ {
333
+ name: "name",
334
+ value: "string",
335
+ },
336
+ {
337
+ name: "name",
338
+ value: "string",
339
+ },
340
+ ],
341
+ passThrough: [
342
+ {
343
+ serviceId: "<id>",
344
+ extendPaths: [
345
+ {
346
+ path: "$.nested.property",
347
+ value: {
348
+ "TaxClassificationRef": {
349
+ "value": "EUC-99990201-V1-00020000",
350
+ },
351
+ },
352
+ },
353
+ {
354
+ path: "$.nested.property",
355
+ value: {
356
+ "TaxClassificationRef": {
357
+ "value": "EUC-99990201-V1-00020000",
358
+ },
359
+ },
360
+ },
361
+ ],
362
+ },
363
+ ],
364
+ },
365
+ });
366
+ expect(result.httpMeta.response.status).toBe(200);
367
+ expect(result.updateCustomObjectResponse).toBeDefined();
368
+ expect(result.updateCustomObjectResponse).toEqual({
369
+ statusCode: 200,
370
+ status: "OK",
371
+ service: "zoho-crm",
372
+ resource: "custom-objects",
373
+ operation: "update",
374
+ data: {
375
+ id: "12345",
376
+ },
377
+ });
378
+ });
379
+
380
+ test("Customobjects Crm Custom Objects Delete", async () => {
381
+ const testHttpClient = createTestHTTPClient("crm.customObjectsDelete");
382
+
383
+ const apideck = new Apideck({
384
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
385
+ httpClient: testHttpClient,
386
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
387
+ });
388
+
389
+ const result = await apideck.crm.customObjects.delete({
390
+ id: "<id>",
391
+ consumerId: "test-consumer",
392
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
393
+ serviceId: "salesforce",
394
+ objectId: "<id>",
395
+ });
396
+ expect(result.httpMeta.response.status).toBe(200);
397
+ expect(result.deleteCustomObjectResponse).toBeDefined();
398
+ expect(result.deleteCustomObjectResponse).toEqual({
399
+ statusCode: 200,
400
+ status: "OK",
401
+ service: "zoho-crm",
402
+ resource: "custom-objects",
403
+ operation: "delete",
404
+ data: {
405
+ id: "12345",
406
+ },
407
+ });
408
+ });