@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,50 @@
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
+ unifiedApi: "crm",
20
+ serviceId: "pipedrive",
21
+ resource: "leads",
22
+ resourceId: "1234",
23
+ });
24
+ expect(result.httpMeta.response.status).toBe(200);
25
+ expect(result.getCustomFieldsResponse).toBeDefined();
26
+ expect(result.getCustomFieldsResponse).toEqual({
27
+ statusCode: 200,
28
+ status: "OK",
29
+ data: [
30
+ {
31
+ id: "123456",
32
+ name: "SSN",
33
+ description: "Employee Level",
34
+ value: "495172776",
35
+ },
36
+ {
37
+ id: "123456",
38
+ name: "SSN",
39
+ description: "Employee Level",
40
+ value: "495172776",
41
+ },
42
+ {
43
+ id: "123456",
44
+ name: "SSN",
45
+ description: "Employee Level",
46
+ value: "495172776",
47
+ },
48
+ ],
49
+ });
50
+ });
@@ -0,0 +1,63 @@
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
+ unifiedApi: "crm",
20
+ serviceId: "pipedrive",
21
+ });
22
+ expect(result.httpMeta.response.status).toBe(200);
23
+ expect(result.getCustomMappingsResponse).toBeDefined();
24
+ expect(result.getCustomMappingsResponse).toEqual({
25
+ statusCode: 200,
26
+ status: "OK",
27
+ data: [
28
+ {
29
+ id: "hris+employees+first_aid_training",
30
+ label: "First Aid Training",
31
+ description: "First Aid Training completed after 2019-01-01",
32
+ value: "$.root.training.first_aid",
33
+ key: "first_aid_training",
34
+ required: false,
35
+ customField: true,
36
+ consumerId: "test_user_id",
37
+ example: "Some value",
38
+ },
39
+ {
40
+ id: "hris+employees+first_aid_training",
41
+ label: "First Aid Training",
42
+ description: "First Aid Training completed after 2019-01-01",
43
+ value: "$.root.training.first_aid",
44
+ key: "first_aid_training",
45
+ required: false,
46
+ customField: true,
47
+ consumerId: "test_user_id",
48
+ example: "Some value",
49
+ },
50
+ {
51
+ id: "hris+employees+first_aid_training",
52
+ label: "First Aid Training",
53
+ description: "First Aid Training completed after 2019-01-01",
54
+ value: "$.root.training.first_aid",
55
+ key: "first_aid_training",
56
+ required: false,
57
+ customField: true,
58
+ consumerId: "test_user_id",
59
+ example: "Some value",
60
+ },
61
+ ],
62
+ });
63
+ });
@@ -0,0 +1,359 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { assert, expect, it, test } from "vitest";
6
+ import { Apideck } from "../index.js";
7
+ import { createTestHTTPClient } from "./testclient.js";
8
+
9
+ test("Departments Accounting Departments All", async () => {
10
+ const testHttpClient = createTestHTTPClient("accounting.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.accounting.departments.list({
19
+ serviceId: "salesforce",
20
+ fields: "id,updated_at",
21
+ filter: {
22
+ subsidiary: "1",
23
+ },
24
+ });
25
+ expect(result.httpMeta.response.status).toBe(200);
26
+ expect(result.getAccountingDepartmentsResponse).toBeDefined();
27
+ expect(result.getAccountingDepartmentsResponse).toEqual({
28
+ statusCode: 200,
29
+ status: "OK",
30
+ service: "xero",
31
+ resource: "subsidiaries",
32
+ operation: "all",
33
+ data: [
34
+ {
35
+ id: "12345",
36
+ parentId: "12345",
37
+ name: "Sales",
38
+ status: "active",
39
+ subsidiaries: [
40
+ {
41
+ id: "12345",
42
+ name: "SpaceX",
43
+ },
44
+ {
45
+ id: "12345",
46
+ name: "SpaceX",
47
+ },
48
+ ],
49
+ rowVersion: "1-12345",
50
+ updatedBy: "12345",
51
+ createdBy: "12345",
52
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
53
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
54
+ passThrough: [
55
+ {
56
+ serviceId: "<id>",
57
+ extendPaths: [
58
+ {
59
+ path: "$.nested.property",
60
+ value: {
61
+ "TaxClassificationRef": {
62
+ "value": "EUC-99990201-V1-00020000",
63
+ },
64
+ },
65
+ },
66
+ ],
67
+ },
68
+ {
69
+ serviceId: "<id>",
70
+ extendPaths: [
71
+ {
72
+ path: "$.nested.property",
73
+ value: {
74
+ "TaxClassificationRef": {
75
+ "value": "EUC-99990201-V1-00020000",
76
+ },
77
+ },
78
+ },
79
+ ],
80
+ },
81
+ {
82
+ serviceId: "<id>",
83
+ extendPaths: [
84
+ {
85
+ path: "$.nested.property",
86
+ value: {
87
+ "TaxClassificationRef": {
88
+ "value": "EUC-99990201-V1-00020000",
89
+ },
90
+ },
91
+ },
92
+ ],
93
+ },
94
+ ],
95
+ },
96
+ {
97
+ id: "12345",
98
+ parentId: "12345",
99
+ name: "Sales",
100
+ status: "active",
101
+ subsidiaries: [
102
+ {
103
+ id: "12345",
104
+ name: "SpaceX",
105
+ },
106
+ {
107
+ id: "12345",
108
+ name: "SpaceX",
109
+ },
110
+ ],
111
+ rowVersion: "1-12345",
112
+ updatedBy: "12345",
113
+ createdBy: "12345",
114
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
115
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
116
+ passThrough: [
117
+ {
118
+ serviceId: "<id>",
119
+ extendPaths: [
120
+ {
121
+ path: "$.nested.property",
122
+ value: {
123
+ "TaxClassificationRef": {
124
+ "value": "EUC-99990201-V1-00020000",
125
+ },
126
+ },
127
+ },
128
+ ],
129
+ },
130
+ {
131
+ serviceId: "<id>",
132
+ extendPaths: [
133
+ {
134
+ path: "$.nested.property",
135
+ value: {
136
+ "TaxClassificationRef": {
137
+ "value": "EUC-99990201-V1-00020000",
138
+ },
139
+ },
140
+ },
141
+ {
142
+ path: "$.nested.property",
143
+ value: {
144
+ "TaxClassificationRef": {
145
+ "value": "EUC-99990201-V1-00020000",
146
+ },
147
+ },
148
+ },
149
+ {
150
+ path: "$.nested.property",
151
+ value: {
152
+ "TaxClassificationRef": {
153
+ "value": "EUC-99990201-V1-00020000",
154
+ },
155
+ },
156
+ },
157
+ ],
158
+ },
159
+ ],
160
+ },
161
+ {
162
+ id: "12345",
163
+ parentId: "12345",
164
+ name: "Sales",
165
+ status: "active",
166
+ subsidiaries: [
167
+ {
168
+ id: "12345",
169
+ name: "SpaceX",
170
+ },
171
+ ],
172
+ rowVersion: "1-12345",
173
+ updatedBy: "12345",
174
+ createdBy: "12345",
175
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
176
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
177
+ passThrough: [
178
+ {
179
+ serviceId: "<id>",
180
+ extendPaths: [
181
+ {
182
+ path: "$.nested.property",
183
+ value: {
184
+ "TaxClassificationRef": {
185
+ "value": "EUC-99990201-V1-00020000",
186
+ },
187
+ },
188
+ },
189
+ {
190
+ path: "$.nested.property",
191
+ value: {
192
+ "TaxClassificationRef": {
193
+ "value": "EUC-99990201-V1-00020000",
194
+ },
195
+ },
196
+ },
197
+ {
198
+ path: "$.nested.property",
199
+ value: {
200
+ "TaxClassificationRef": {
201
+ "value": "EUC-99990201-V1-00020000",
202
+ },
203
+ },
204
+ },
205
+ ],
206
+ },
207
+ ],
208
+ },
209
+ ],
210
+ meta: {
211
+ itemsOnPage: 50,
212
+ cursors: {
213
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
214
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
215
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
216
+ },
217
+ },
218
+ links: {
219
+ previous:
220
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
221
+ current: "https://unify.apideck.com/crm/companies",
222
+ next:
223
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
224
+ },
225
+ });
226
+ });
227
+
228
+ it.skip("Departments Accounting Departments Add", async () => {
229
+ assert.fail(
230
+ "incomplete test found please make sure to address the following errors: [`workflow step accounting.departmentsAdd.test referencing operation accounting.departmentsAdd with expression in requestBody with type not currently supported`, `workflow step accounting.departmentsAdd.test referencing operation accounting.departmentsAdd with expression in requestBody with type not currently supported`, `workflow step accounting.departmentsAdd.test referencing operation accounting.departmentsAdd with expression in requestBody with type not currently supported`]",
231
+ );
232
+ });
233
+
234
+ test("Departments Accounting Departments One", async () => {
235
+ const testHttpClient = createTestHTTPClient("accounting.departmentsOne");
236
+
237
+ const apideck = new Apideck({
238
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
239
+ httpClient: testHttpClient,
240
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
241
+ });
242
+
243
+ const result = await apideck.accounting.departments.get({
244
+ id: "<id>",
245
+ serviceId: "salesforce",
246
+ fields: "id,updated_at",
247
+ });
248
+ expect(result.httpMeta.response.status).toBe(200);
249
+ expect(result.getAccountingDepartmentResponse).toBeDefined();
250
+ expect(result.getAccountingDepartmentResponse).toEqual({
251
+ statusCode: 200,
252
+ status: "OK",
253
+ service: "xero",
254
+ resource: "subsidiaries",
255
+ operation: "one",
256
+ data: {
257
+ id: "12345",
258
+ parentId: "12345",
259
+ name: "Sales",
260
+ status: "active",
261
+ subsidiaries: [
262
+ {
263
+ id: "12345",
264
+ name: "SpaceX",
265
+ },
266
+ {
267
+ id: "12345",
268
+ name: "SpaceX",
269
+ },
270
+ {
271
+ id: "12345",
272
+ name: "SpaceX",
273
+ },
274
+ ],
275
+ rowVersion: "1-12345",
276
+ updatedBy: "12345",
277
+ createdBy: "12345",
278
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
279
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
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
+ path: "$.nested.property",
315
+ value: {
316
+ "TaxClassificationRef": {
317
+ "value": "EUC-99990201-V1-00020000",
318
+ },
319
+ },
320
+ },
321
+ ],
322
+ },
323
+ ],
324
+ },
325
+ });
326
+ });
327
+
328
+ it.skip("Departments Accounting Departments Update", async () => {
329
+ assert.fail(
330
+ "incomplete test found please make sure to address the following errors: [`workflow step accounting.departmentsUpdate.test referencing operation accounting.departmentsUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.departmentsUpdate.test referencing operation accounting.departmentsUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.departmentsUpdate.test referencing operation accounting.departmentsUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.departmentsUpdate.test referencing operation accounting.departmentsUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.departmentsUpdate.test referencing operation accounting.departmentsUpdate with expression in requestBody with type not currently supported`]",
331
+ );
332
+ });
333
+
334
+ test("Departments Accounting Departments Delete", async () => {
335
+ const testHttpClient = createTestHTTPClient("accounting.departmentsDelete");
336
+
337
+ const apideck = new Apideck({
338
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
339
+ httpClient: testHttpClient,
340
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
341
+ });
342
+
343
+ const result = await apideck.accounting.departments.delete({
344
+ id: "<id>",
345
+ serviceId: "salesforce",
346
+ });
347
+ expect(result.httpMeta.response.status).toBe(200);
348
+ expect(result.deleteAccountingDepartmentResponse).toBeDefined();
349
+ expect(result.deleteAccountingDepartmentResponse).toEqual({
350
+ statusCode: 200,
351
+ status: "OK",
352
+ service: "quickbooks",
353
+ resource: "departments",
354
+ operation: "delete",
355
+ data: {
356
+ id: "12345",
357
+ },
358
+ });
359
+ });