@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,42 @@
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("Consumerrequestcounts Vault Consumer Request Counts All", async () => {
10
+ const testHttpClient = createTestHTTPClient("vault.consumerRequestCountsAll");
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.consumerRequestCounts.list({
19
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
20
+ consumerId: "test_user_id",
21
+ startDatetime: "2021-05-01T12:00:00.000Z",
22
+ endDatetime: "2021-05-30T12:00:00.000Z",
23
+ });
24
+ expect(result.httpMeta.response.status).toBe(200);
25
+ expect(result.consumerRequestCountsInDateRangeResponse).toBeDefined();
26
+ expect(result.consumerRequestCountsInDateRangeResponse).toEqual({
27
+ statusCode: 200,
28
+ status: "OK",
29
+ data: {
30
+ applicationId: "1111",
31
+ consumerId: "test_user_id",
32
+ startDatetime: "2021-05-01T12:00:00.000Z",
33
+ endDatetime: "2021-05-10T12:00:00.000Z",
34
+ aggregatedRequestCount: 40,
35
+ requestCounts: {
36
+ unify: 100,
37
+ proxy: 10,
38
+ vault: 21,
39
+ },
40
+ },
41
+ });
42
+ });
@@ -0,0 +1,523 @@
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("Consumers Vault Consumers Add", async () => {
10
+ const testHttpClient = createTestHTTPClient("vault.consumersAdd");
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.consumers.create({
19
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
20
+ createConsumerRequest: {
21
+ consumerId: "test_consumer_id",
22
+ metadata: {
23
+ accountName: "SpaceX",
24
+ userName: "Elon Musk",
25
+ email: "elon@musk.com",
26
+ image: "https://www.spacex.com/static/images/share.jpg",
27
+ },
28
+ },
29
+ });
30
+ expect(result.httpMeta.response.status).toBe(200);
31
+ expect(result.createConsumerResponse).toBeDefined();
32
+ expect(result.createConsumerResponse).toEqual({
33
+ statusCode: 200,
34
+ status: "OK",
35
+ data: {
36
+ consumerId: "test_consumer_id",
37
+ applicationId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
38
+ metadata: {
39
+ accountName: "SpaceX",
40
+ userName: "Elon Musk",
41
+ email: "elon@musk.com",
42
+ image: "https://www.spacex.com/static/images/share.jpg",
43
+ },
44
+ connections: [
45
+ {
46
+ id: "1111+test_user_id",
47
+ name: "Salesforce",
48
+ icon:
49
+ "https://res.cloudinary.com/apideck/image/upload/v1529456047/catalog/salesforce/icon128x128.png",
50
+ logo:
51
+ "https://c1.sfdcstatic.com/content/dam/web/en_us/www/images/home/logo-salesforce-m.svg",
52
+ website: "https://www.salesforce.com",
53
+ tagLine:
54
+ "CRM software solutions and enterprise cloud computing from Salesforce, the leader in customer relationship management (CRM) and PaaS. Free 30 day trial.",
55
+ serviceId: "teamleader",
56
+ unifiedApi: "crm",
57
+ consumerId: "test_user_id",
58
+ authType: "oauth2",
59
+ enabled: true,
60
+ settings: {
61
+ "instance_url": "https://eu28.salesforce.com",
62
+ },
63
+ metadata: {
64
+ "account": {
65
+ "name": "My Company",
66
+ "id": "c01458a5-7276-41ce-bc19-639906b0450a",
67
+ },
68
+ "plan": "enterprise",
69
+ },
70
+ createdAt: "2020-09-19T12:18:37.071Z",
71
+ updatedAt: "2020-09-19T12:18:37.071Z",
72
+ state: "authorized",
73
+ },
74
+ {
75
+ id: "1111+test_user_id",
76
+ name: "Salesforce",
77
+ icon:
78
+ "https://res.cloudinary.com/apideck/image/upload/v1529456047/catalog/salesforce/icon128x128.png",
79
+ logo:
80
+ "https://c1.sfdcstatic.com/content/dam/web/en_us/www/images/home/logo-salesforce-m.svg",
81
+ website: "https://www.salesforce.com",
82
+ tagLine:
83
+ "CRM software solutions and enterprise cloud computing from Salesforce, the leader in customer relationship management (CRM) and PaaS. Free 30 day trial.",
84
+ serviceId: "teamleader",
85
+ unifiedApi: "crm",
86
+ consumerId: "test_user_id",
87
+ authType: "oauth2",
88
+ enabled: true,
89
+ settings: {
90
+ "instance_url": "https://eu28.salesforce.com",
91
+ },
92
+ metadata: {
93
+ "account": {
94
+ "name": "My Company",
95
+ "id": "c01458a5-7276-41ce-bc19-639906b0450a",
96
+ },
97
+ "plan": "enterprise",
98
+ },
99
+ createdAt: "2020-09-19T12:18:37.071Z",
100
+ updatedAt: "2020-09-19T12:18:37.071Z",
101
+ state: "authorized",
102
+ },
103
+ ],
104
+ services: [
105
+ "salesforce",
106
+ "stripe",
107
+ ],
108
+ aggregatedRequestCount: 101,
109
+ requestCounts: {
110
+ unify: 100,
111
+ proxy: 10,
112
+ vault: 21,
113
+ },
114
+ created: "2021-05-07T12:55:42.242Z",
115
+ modified: "2021-05-07T12:55:42.242Z",
116
+ requestCountUpdated: "2021-05-07T12:55:42.242Z",
117
+ },
118
+ });
119
+ });
120
+
121
+ test("Consumers Vault Consumers All", async () => {
122
+ const testHttpClient = createTestHTTPClient("vault.consumersAll");
123
+
124
+ const apideck = new Apideck({
125
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
126
+ httpClient: testHttpClient,
127
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
128
+ });
129
+
130
+ const result = await apideck.vault.consumers.list({
131
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
132
+ });
133
+ expect(result.httpMeta.response.status).toBe(200);
134
+ expect(result.getConsumersResponse).toBeDefined();
135
+ expect(result.getConsumersResponse).toEqual({
136
+ statusCode: 200,
137
+ status: "OK",
138
+ data: [
139
+ {
140
+ consumerId: "test_consumer_id",
141
+ applicationId: "1111",
142
+ metadata: {
143
+ accountName: "SpaceX",
144
+ userName: "Elon Musk",
145
+ email: "elon@musk.com",
146
+ image: "https://www.spacex.com/static/images/share.jpg",
147
+ },
148
+ aggregatedRequestCount: 101,
149
+ requestCounts: {
150
+ unify: 100,
151
+ proxy: 10,
152
+ vault: 21,
153
+ },
154
+ created: "2021-05-07T12:55:42.242Z",
155
+ modified: "2021-05-07T12:55:42.242Z",
156
+ requestCountUpdated: "2021-05-07T12:55:42.242Z",
157
+ services: [
158
+ "salesforce",
159
+ "stripe",
160
+ ],
161
+ },
162
+ {
163
+ consumerId: "test_consumer_id",
164
+ applicationId: "1111",
165
+ metadata: {
166
+ accountName: "SpaceX",
167
+ userName: "Elon Musk",
168
+ email: "elon@musk.com",
169
+ image: "https://www.spacex.com/static/images/share.jpg",
170
+ },
171
+ aggregatedRequestCount: 101,
172
+ requestCounts: {
173
+ unify: 100,
174
+ proxy: 10,
175
+ vault: 21,
176
+ },
177
+ created: "2021-05-07T12:55:42.242Z",
178
+ modified: "2021-05-07T12:55:42.242Z",
179
+ requestCountUpdated: "2021-05-07T12:55:42.242Z",
180
+ services: [
181
+ "salesforce",
182
+ "stripe",
183
+ ],
184
+ },
185
+ {
186
+ consumerId: "test_consumer_id",
187
+ applicationId: "1111",
188
+ metadata: {
189
+ accountName: "SpaceX",
190
+ userName: "Elon Musk",
191
+ email: "elon@musk.com",
192
+ image: "https://www.spacex.com/static/images/share.jpg",
193
+ },
194
+ aggregatedRequestCount: 101,
195
+ requestCounts: {
196
+ unify: 100,
197
+ proxy: 10,
198
+ vault: 21,
199
+ },
200
+ created: "2021-05-07T12:55:42.242Z",
201
+ modified: "2021-05-07T12:55:42.242Z",
202
+ requestCountUpdated: "2021-05-07T12:55:42.242Z",
203
+ services: [
204
+ "salesforce",
205
+ "stripe",
206
+ ],
207
+ },
208
+ ],
209
+ meta: {
210
+ itemsOnPage: 50,
211
+ cursors: {
212
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
213
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
214
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
215
+ },
216
+ },
217
+ links: {
218
+ previous:
219
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
220
+ current: "https://unify.apideck.com/crm/companies",
221
+ next:
222
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
223
+ },
224
+ });
225
+ });
226
+
227
+ test("Consumers Vault Consumers One", async () => {
228
+ const testHttpClient = createTestHTTPClient("vault.consumersOne");
229
+
230
+ const apideck = new Apideck({
231
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
232
+ httpClient: testHttpClient,
233
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
234
+ });
235
+
236
+ const result = await apideck.vault.consumers.get({
237
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
238
+ consumerId: "test_user_id",
239
+ });
240
+ expect(result.httpMeta.response.status).toBe(200);
241
+ expect(result.getConsumerResponse).toBeDefined();
242
+ expect(result.getConsumerResponse).toEqual({
243
+ statusCode: 200,
244
+ status: "OK",
245
+ data: {
246
+ consumerId: "test_consumer_id",
247
+ applicationId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
248
+ metadata: {
249
+ accountName: "SpaceX",
250
+ userName: "Elon Musk",
251
+ email: "elon@musk.com",
252
+ image: "https://www.spacex.com/static/images/share.jpg",
253
+ },
254
+ connections: [
255
+ {
256
+ id: "1111+test_user_id",
257
+ name: "Salesforce",
258
+ icon:
259
+ "https://res.cloudinary.com/apideck/image/upload/v1529456047/catalog/salesforce/icon128x128.png",
260
+ logo:
261
+ "https://c1.sfdcstatic.com/content/dam/web/en_us/www/images/home/logo-salesforce-m.svg",
262
+ website: "https://www.salesforce.com",
263
+ tagLine:
264
+ "CRM software solutions and enterprise cloud computing from Salesforce, the leader in customer relationship management (CRM) and PaaS. Free 30 day trial.",
265
+ serviceId: "teamleader",
266
+ unifiedApi: "crm",
267
+ consumerId: "test_user_id",
268
+ authType: "oauth2",
269
+ enabled: true,
270
+ settings: {
271
+ "instance_url": "https://eu28.salesforce.com",
272
+ },
273
+ metadata: {
274
+ "account": {
275
+ "name": "My Company",
276
+ "id": "c01458a5-7276-41ce-bc19-639906b0450a",
277
+ },
278
+ "plan": "enterprise",
279
+ },
280
+ createdAt: "2020-09-19T12:18:37.071Z",
281
+ updatedAt: "2020-09-19T12:18:37.071Z",
282
+ state: "authorized",
283
+ },
284
+ {
285
+ id: "1111+test_user_id",
286
+ name: "Salesforce",
287
+ icon:
288
+ "https://res.cloudinary.com/apideck/image/upload/v1529456047/catalog/salesforce/icon128x128.png",
289
+ logo:
290
+ "https://c1.sfdcstatic.com/content/dam/web/en_us/www/images/home/logo-salesforce-m.svg",
291
+ website: "https://www.salesforce.com",
292
+ tagLine:
293
+ "CRM software solutions and enterprise cloud computing from Salesforce, the leader in customer relationship management (CRM) and PaaS. Free 30 day trial.",
294
+ serviceId: "teamleader",
295
+ unifiedApi: "crm",
296
+ consumerId: "test_user_id",
297
+ authType: "oauth2",
298
+ enabled: true,
299
+ settings: {
300
+ "instance_url": "https://eu28.salesforce.com",
301
+ },
302
+ metadata: {
303
+ "account": {
304
+ "name": "My Company",
305
+ "id": "c01458a5-7276-41ce-bc19-639906b0450a",
306
+ },
307
+ "plan": "enterprise",
308
+ },
309
+ createdAt: "2020-09-19T12:18:37.071Z",
310
+ updatedAt: "2020-09-19T12:18:37.071Z",
311
+ state: "authorized",
312
+ },
313
+ {
314
+ id: "1111+test_user_id",
315
+ name: "Salesforce",
316
+ icon:
317
+ "https://res.cloudinary.com/apideck/image/upload/v1529456047/catalog/salesforce/icon128x128.png",
318
+ logo:
319
+ "https://c1.sfdcstatic.com/content/dam/web/en_us/www/images/home/logo-salesforce-m.svg",
320
+ website: "https://www.salesforce.com",
321
+ tagLine:
322
+ "CRM software solutions and enterprise cloud computing from Salesforce, the leader in customer relationship management (CRM) and PaaS. Free 30 day trial.",
323
+ serviceId: "teamleader",
324
+ unifiedApi: "crm",
325
+ consumerId: "test_user_id",
326
+ authType: "oauth2",
327
+ enabled: true,
328
+ settings: {
329
+ "instance_url": "https://eu28.salesforce.com",
330
+ },
331
+ metadata: {
332
+ "account": {
333
+ "name": "My Company",
334
+ "id": "c01458a5-7276-41ce-bc19-639906b0450a",
335
+ },
336
+ "plan": "enterprise",
337
+ },
338
+ createdAt: "2020-09-19T12:18:37.071Z",
339
+ updatedAt: "2020-09-19T12:18:37.071Z",
340
+ state: "authorized",
341
+ },
342
+ ],
343
+ services: [
344
+ "salesforce",
345
+ "stripe",
346
+ ],
347
+ aggregatedRequestCount: 101,
348
+ requestCounts: {
349
+ unify: 100,
350
+ proxy: 10,
351
+ vault: 21,
352
+ },
353
+ created: "2021-05-07T12:55:42.242Z",
354
+ modified: "2021-05-07T12:55:42.242Z",
355
+ requestCountUpdated: "2021-05-07T12:55:42.242Z",
356
+ },
357
+ });
358
+ });
359
+
360
+ test("Consumers Vault Consumers Update", async () => {
361
+ const testHttpClient = createTestHTTPClient("vault.consumersUpdate");
362
+
363
+ const apideck = new Apideck({
364
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
365
+ httpClient: testHttpClient,
366
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
367
+ });
368
+
369
+ const result = await apideck.vault.consumers.update({
370
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
371
+ consumerId: "test_user_id",
372
+ updateConsumerRequest: {
373
+ metadata: {
374
+ accountName: "SpaceX",
375
+ userName: "Elon Musk",
376
+ email: "elon@musk.com",
377
+ image: "https://www.spacex.com/static/images/share.jpg",
378
+ },
379
+ },
380
+ });
381
+ expect(result.httpMeta.response.status).toBe(200);
382
+ expect(result.updateConsumerResponse).toBeDefined();
383
+ expect(result.updateConsumerResponse).toEqual({
384
+ statusCode: 200,
385
+ status: "OK",
386
+ data: {
387
+ consumerId: "test_consumer_id",
388
+ applicationId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
389
+ metadata: {
390
+ accountName: "SpaceX",
391
+ userName: "Elon Musk",
392
+ email: "elon@musk.com",
393
+ image: "https://www.spacex.com/static/images/share.jpg",
394
+ },
395
+ connections: [
396
+ {
397
+ id: "1111+test_user_id",
398
+ name: "Salesforce",
399
+ icon:
400
+ "https://res.cloudinary.com/apideck/image/upload/v1529456047/catalog/salesforce/icon128x128.png",
401
+ logo:
402
+ "https://c1.sfdcstatic.com/content/dam/web/en_us/www/images/home/logo-salesforce-m.svg",
403
+ website: "https://www.salesforce.com",
404
+ tagLine:
405
+ "CRM software solutions and enterprise cloud computing from Salesforce, the leader in customer relationship management (CRM) and PaaS. Free 30 day trial.",
406
+ serviceId: "teamleader",
407
+ unifiedApi: "crm",
408
+ consumerId: "test_user_id",
409
+ authType: "oauth2",
410
+ enabled: true,
411
+ settings: {
412
+ "instance_url": "https://eu28.salesforce.com",
413
+ },
414
+ metadata: {
415
+ "account": {
416
+ "name": "My Company",
417
+ "id": "c01458a5-7276-41ce-bc19-639906b0450a",
418
+ },
419
+ "plan": "enterprise",
420
+ },
421
+ createdAt: "2020-09-19T12:18:37.071Z",
422
+ updatedAt: "2020-09-19T12:18:37.071Z",
423
+ state: "authorized",
424
+ },
425
+ {
426
+ id: "1111+test_user_id",
427
+ name: "Salesforce",
428
+ icon:
429
+ "https://res.cloudinary.com/apideck/image/upload/v1529456047/catalog/salesforce/icon128x128.png",
430
+ logo:
431
+ "https://c1.sfdcstatic.com/content/dam/web/en_us/www/images/home/logo-salesforce-m.svg",
432
+ website: "https://www.salesforce.com",
433
+ tagLine:
434
+ "CRM software solutions and enterprise cloud computing from Salesforce, the leader in customer relationship management (CRM) and PaaS. Free 30 day trial.",
435
+ serviceId: "teamleader",
436
+ unifiedApi: "crm",
437
+ consumerId: "test_user_id",
438
+ authType: "oauth2",
439
+ enabled: true,
440
+ settings: {
441
+ "instance_url": "https://eu28.salesforce.com",
442
+ },
443
+ metadata: {
444
+ "account": {
445
+ "name": "My Company",
446
+ "id": "c01458a5-7276-41ce-bc19-639906b0450a",
447
+ },
448
+ "plan": "enterprise",
449
+ },
450
+ createdAt: "2020-09-19T12:18:37.071Z",
451
+ updatedAt: "2020-09-19T12:18:37.071Z",
452
+ state: "authorized",
453
+ },
454
+ {
455
+ id: "1111+test_user_id",
456
+ name: "Salesforce",
457
+ icon:
458
+ "https://res.cloudinary.com/apideck/image/upload/v1529456047/catalog/salesforce/icon128x128.png",
459
+ logo:
460
+ "https://c1.sfdcstatic.com/content/dam/web/en_us/www/images/home/logo-salesforce-m.svg",
461
+ website: "https://www.salesforce.com",
462
+ tagLine:
463
+ "CRM software solutions and enterprise cloud computing from Salesforce, the leader in customer relationship management (CRM) and PaaS. Free 30 day trial.",
464
+ serviceId: "teamleader",
465
+ unifiedApi: "crm",
466
+ consumerId: "test_user_id",
467
+ authType: "oauth2",
468
+ enabled: true,
469
+ settings: {
470
+ "instance_url": "https://eu28.salesforce.com",
471
+ },
472
+ metadata: {
473
+ "account": {
474
+ "name": "My Company",
475
+ "id": "c01458a5-7276-41ce-bc19-639906b0450a",
476
+ },
477
+ "plan": "enterprise",
478
+ },
479
+ createdAt: "2020-09-19T12:18:37.071Z",
480
+ updatedAt: "2020-09-19T12:18:37.071Z",
481
+ state: "authorized",
482
+ },
483
+ ],
484
+ services: [
485
+ "salesforce",
486
+ "stripe",
487
+ ],
488
+ aggregatedRequestCount: 101,
489
+ requestCounts: {
490
+ unify: 100,
491
+ proxy: 10,
492
+ vault: 21,
493
+ },
494
+ created: "2021-05-07T12:55:42.242Z",
495
+ modified: "2021-05-07T12:55:42.242Z",
496
+ requestCountUpdated: "2021-05-07T12:55:42.242Z",
497
+ },
498
+ });
499
+ });
500
+
501
+ test("Consumers Vault Consumers Delete", async () => {
502
+ const testHttpClient = createTestHTTPClient("vault.consumersDelete");
503
+
504
+ const apideck = new Apideck({
505
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
506
+ httpClient: testHttpClient,
507
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
508
+ });
509
+
510
+ const result = await apideck.vault.consumers.delete({
511
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
512
+ consumerId: "test_user_id",
513
+ });
514
+ expect(result.httpMeta.response.status).toBe(200);
515
+ expect(result.deleteConsumerResponse).toBeDefined();
516
+ expect(result.deleteConsumerResponse).toEqual({
517
+ statusCode: 200,
518
+ status: "OK",
519
+ data: {
520
+ consumerId: "test_consumer_id",
521
+ },
522
+ });
523
+ });