@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,70 @@
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("Sessions Vault Sessions Create", async () => {
10
+ const testHttpClient = createTestHTTPClient("vault.sessionsCreate");
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.sessions.create({
19
+ session: {
20
+ consumerMetadata: {
21
+ accountName: "SpaceX",
22
+ userName: "Elon Musk",
23
+ email: "elon@musk.com",
24
+ image: "https://www.spacex.com/static/images/share.jpg",
25
+ },
26
+ redirectUri: "https://mysaas.com/dashboard",
27
+ settings: {
28
+ unifiedApis: [
29
+ "crm",
30
+ ],
31
+ },
32
+ theme: {
33
+ favicon: "https://res.cloudinary.com/apideck/icons/intercom",
34
+ logo: "https://res.cloudinary.com/apideck/icons/intercom",
35
+ primaryColor: "#286efa",
36
+ sidepanelBackgroundColor: "#286efa",
37
+ sidepanelTextColor: "#FFFFFF",
38
+ vaultName: "Intercom",
39
+ privacyUrl: "https://compliance.apideck.com/privacy-policy",
40
+ termsUrl:
41
+ "https://www.termsfeed.com/terms-conditions/957c85c1b089ae9e3219c83eff65377e",
42
+ },
43
+ customConsumerSettings: {
44
+ "feature_flag_1": true,
45
+ "tax_rates": [
46
+ {
47
+ "id": "6",
48
+ "label": "6%",
49
+ },
50
+ {
51
+ "id": "21",
52
+ "label": "21%",
53
+ },
54
+ ],
55
+ },
56
+ },
57
+ });
58
+ expect(result.httpMeta.response.status).toBe(200);
59
+ expect(result.createSessionResponse).toBeDefined();
60
+ expect(result.createSessionResponse).toEqual({
61
+ statusCode: 200,
62
+ status: "OK",
63
+ data: {
64
+ sessionUri:
65
+ "http://vault.apideck.com/session/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb25zdW1lcl9pZCI6InRlc3RfdXNlcl9pZCIsImFwcGxpY2F0aW9uX2lkIj",
66
+ sessionToken:
67
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb25zdW1lcl9pZCI6InRlc3RfdXNlcl9pZCIsImFwcGxpY2F0aW9uX2lkIj",
68
+ },
69
+ });
70
+ });
@@ -0,0 +1,331 @@
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("Sharedlinks File Storage Shared Links All", async () => {
10
+ const testHttpClient = createTestHTTPClient("fileStorage.sharedLinksAll");
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.fileStorage.sharedLinks.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.getSharedLinksResponse).toBeDefined();
27
+ expect(result.getSharedLinksResponse).toEqual({
28
+ statusCode: 200,
29
+ status: "OK",
30
+ service: "dropbox",
31
+ resource: "Shared Links",
32
+ operation: "all",
33
+ data: [
34
+ {
35
+ url: "https://www.box.com/s/vspke7y05sb214wjokpk",
36
+ downloadUrl:
37
+ "https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg",
38
+ target: {
39
+ id: "12345",
40
+ name: "sample.jpg",
41
+ type: "file",
42
+ },
43
+ scope: "company",
44
+ expiresAt: new Date("2022-09-30T07:43:32.000Z"),
45
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
46
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
47
+ passThrough: [
48
+ {
49
+ serviceId: "<id>",
50
+ extendPaths: [
51
+ {
52
+ path: "$.nested.property",
53
+ value: {
54
+ "TaxClassificationRef": {
55
+ "value": "EUC-99990201-V1-00020000",
56
+ },
57
+ },
58
+ },
59
+ {
60
+ path: "$.nested.property",
61
+ value: {
62
+ "TaxClassificationRef": {
63
+ "value": "EUC-99990201-V1-00020000",
64
+ },
65
+ },
66
+ },
67
+ {
68
+ path: "$.nested.property",
69
+ value: {
70
+ "TaxClassificationRef": {
71
+ "value": "EUC-99990201-V1-00020000",
72
+ },
73
+ },
74
+ },
75
+ ],
76
+ },
77
+ {
78
+ serviceId: "<id>",
79
+ extendPaths: [
80
+ {
81
+ path: "$.nested.property",
82
+ value: {
83
+ "TaxClassificationRef": {
84
+ "value": "EUC-99990201-V1-00020000",
85
+ },
86
+ },
87
+ },
88
+ ],
89
+ },
90
+ ],
91
+ },
92
+ {
93
+ url: "https://www.box.com/s/vspke7y05sb214wjokpk",
94
+ downloadUrl:
95
+ "https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg",
96
+ target: {
97
+ id: "12345",
98
+ name: "sample.jpg",
99
+ type: "file",
100
+ },
101
+ scope: "company",
102
+ expiresAt: new Date("2022-09-30T07:43:32.000Z"),
103
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
104
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
105
+ passThrough: [
106
+ {
107
+ serviceId: "<id>",
108
+ extendPaths: [
109
+ {
110
+ path: "$.nested.property",
111
+ value: {
112
+ "TaxClassificationRef": {
113
+ "value": "EUC-99990201-V1-00020000",
114
+ },
115
+ },
116
+ },
117
+ ],
118
+ },
119
+ ],
120
+ },
121
+ {
122
+ url: "https://www.box.com/s/vspke7y05sb214wjokpk",
123
+ downloadUrl:
124
+ "https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg",
125
+ target: {
126
+ id: "12345",
127
+ name: "sample.jpg",
128
+ type: "file",
129
+ },
130
+ scope: "company",
131
+ expiresAt: new Date("2022-09-30T07:43:32.000Z"),
132
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
133
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
134
+ passThrough: [
135
+ {
136
+ serviceId: "<id>",
137
+ extendPaths: [
138
+ {
139
+ path: "$.nested.property",
140
+ value: {
141
+ "TaxClassificationRef": {
142
+ "value": "EUC-99990201-V1-00020000",
143
+ },
144
+ },
145
+ },
146
+ {
147
+ path: "$.nested.property",
148
+ value: {
149
+ "TaxClassificationRef": {
150
+ "value": "EUC-99990201-V1-00020000",
151
+ },
152
+ },
153
+ },
154
+ ],
155
+ },
156
+ {
157
+ serviceId: "<id>",
158
+ extendPaths: [
159
+ {
160
+ path: "$.nested.property",
161
+ value: {
162
+ "TaxClassificationRef": {
163
+ "value": "EUC-99990201-V1-00020000",
164
+ },
165
+ },
166
+ },
167
+ ],
168
+ },
169
+ ],
170
+ },
171
+ ],
172
+ meta: {
173
+ itemsOnPage: 50,
174
+ cursors: {
175
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
176
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
177
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
178
+ },
179
+ },
180
+ links: {
181
+ previous:
182
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
183
+ current: "https://unify.apideck.com/crm/companies",
184
+ next:
185
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
186
+ },
187
+ });
188
+ });
189
+
190
+ it.skip("Sharedlinks File Storage Shared Links Add", async () => {
191
+ assert.fail(
192
+ "incomplete test found please make sure to address the following errors: [`workflow step fileStorage.sharedLinksAdd.test referencing operation fileStorage.sharedLinksAdd with expression in requestBody with type not currently supported`, `workflow step fileStorage.sharedLinksAdd.test referencing operation fileStorage.sharedLinksAdd with expression in requestBody with type not currently supported`, `workflow step fileStorage.sharedLinksAdd.test referencing operation fileStorage.sharedLinksAdd with expression in requestBody with type not currently supported`, `workflow step fileStorage.sharedLinksAdd.test referencing operation fileStorage.sharedLinksAdd with expression in requestBody with type not currently supported`]",
193
+ );
194
+ });
195
+
196
+ test("Sharedlinks File Storage Shared Links One", async () => {
197
+ const testHttpClient = createTestHTTPClient("fileStorage.sharedLinksOne");
198
+
199
+ const apideck = new Apideck({
200
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
201
+ httpClient: testHttpClient,
202
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
203
+ });
204
+
205
+ const result = await apideck.fileStorage.sharedLinks.get({
206
+ id: "<id>",
207
+ serviceId: "salesforce",
208
+ fields: "id,updated_at",
209
+ });
210
+ expect(result.httpMeta.response.status).toBe(200);
211
+ expect(result.getSharedLinkResponse).toBeDefined();
212
+ expect(result.getSharedLinkResponse).toEqual({
213
+ statusCode: 200,
214
+ status: "OK",
215
+ service: "dropbox",
216
+ resource: "Shared Links",
217
+ operation: "one",
218
+ data: {
219
+ url: "https://www.box.com/s/vspke7y05sb214wjokpk",
220
+ downloadUrl:
221
+ "https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg",
222
+ target: {
223
+ id: "12345",
224
+ name: "sample.jpg",
225
+ type: "file",
226
+ },
227
+ scope: "company",
228
+ expiresAt: new Date("2022-09-30T07:43:32.000Z"),
229
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
230
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
231
+ passThrough: [
232
+ {
233
+ serviceId: "<id>",
234
+ extendPaths: [
235
+ {
236
+ path: "$.nested.property",
237
+ value: {
238
+ "TaxClassificationRef": {
239
+ "value": "EUC-99990201-V1-00020000",
240
+ },
241
+ },
242
+ },
243
+ {
244
+ path: "$.nested.property",
245
+ value: {
246
+ "TaxClassificationRef": {
247
+ "value": "EUC-99990201-V1-00020000",
248
+ },
249
+ },
250
+ },
251
+ ],
252
+ },
253
+ {
254
+ serviceId: "<id>",
255
+ extendPaths: [
256
+ {
257
+ path: "$.nested.property",
258
+ value: {
259
+ "TaxClassificationRef": {
260
+ "value": "EUC-99990201-V1-00020000",
261
+ },
262
+ },
263
+ },
264
+ {
265
+ path: "$.nested.property",
266
+ value: {
267
+ "TaxClassificationRef": {
268
+ "value": "EUC-99990201-V1-00020000",
269
+ },
270
+ },
271
+ },
272
+ ],
273
+ },
274
+ {
275
+ serviceId: "<id>",
276
+ extendPaths: [
277
+ {
278
+ path: "$.nested.property",
279
+ value: {
280
+ "TaxClassificationRef": {
281
+ "value": "EUC-99990201-V1-00020000",
282
+ },
283
+ },
284
+ },
285
+ {
286
+ path: "$.nested.property",
287
+ value: {
288
+ "TaxClassificationRef": {
289
+ "value": "EUC-99990201-V1-00020000",
290
+ },
291
+ },
292
+ },
293
+ ],
294
+ },
295
+ ],
296
+ },
297
+ });
298
+ });
299
+
300
+ it.skip("Sharedlinks File Storage Shared Links Update", async () => {
301
+ assert.fail(
302
+ "incomplete test found please make sure to address the following errors: [`workflow step fileStorage.sharedLinksUpdate.test referencing operation fileStorage.sharedLinksUpdate with expression in requestBody with type not currently supported`, `workflow step fileStorage.sharedLinksUpdate.test referencing operation fileStorage.sharedLinksUpdate with expression in requestBody with type not currently supported`, `workflow step fileStorage.sharedLinksUpdate.test referencing operation fileStorage.sharedLinksUpdate with expression in requestBody with type not currently supported`, `workflow step fileStorage.sharedLinksUpdate.test referencing operation fileStorage.sharedLinksUpdate with expression in requestBody with type not currently supported`, `workflow step fileStorage.sharedLinksUpdate.test referencing operation fileStorage.sharedLinksUpdate with expression in requestBody with type not currently supported`, `workflow step fileStorage.sharedLinksUpdate.test referencing operation fileStorage.sharedLinksUpdate with expression in requestBody with type not currently supported`, `workflow step fileStorage.sharedLinksUpdate.test referencing operation fileStorage.sharedLinksUpdate with expression in requestBody with type not currently supported`]",
303
+ );
304
+ });
305
+
306
+ test("Sharedlinks File Storage Shared Links Delete", async () => {
307
+ const testHttpClient = createTestHTTPClient("fileStorage.sharedLinksDelete");
308
+
309
+ const apideck = new Apideck({
310
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
311
+ httpClient: testHttpClient,
312
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
313
+ });
314
+
315
+ const result = await apideck.fileStorage.sharedLinks.delete({
316
+ id: "<id>",
317
+ serviceId: "salesforce",
318
+ });
319
+ expect(result.httpMeta.response.status).toBe(200);
320
+ expect(result.deleteSharedLinkResponse).toBeDefined();
321
+ expect(result.deleteSharedLinkResponse).toEqual({
322
+ statusCode: 200,
323
+ status: "OK",
324
+ service: "dropbox",
325
+ resource: "Shared Links",
326
+ operation: "delete",
327
+ data: {
328
+ id: "12345",
329
+ },
330
+ });
331
+ });
@@ -0,0 +1,39 @@
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("Stores Ecommerce Stores One", async () => {
10
+ const testHttpClient = createTestHTTPClient("ecommerce.storesOne");
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.stores.get({
19
+ serviceId: "salesforce",
20
+ fields: "id,updated_at",
21
+ });
22
+ expect(result.httpMeta.response.status).toBe(200);
23
+ expect(result.getStoreResponse).toBeDefined();
24
+ expect(result.getStoreResponse).toEqual({
25
+ statusCode: 200,
26
+ status: "OK",
27
+ service: "shopify",
28
+ resource: "stores",
29
+ operation: "one",
30
+ data: {
31
+ id: "12345",
32
+ name: "My Store",
33
+ storeUrl: "https://mybrand.com/shop",
34
+ adminUrl: "https://mybrand.com/admin",
35
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
36
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
37
+ },
38
+ });
39
+ });