@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,34 @@
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("Validateconnection Vault Validate Connection State", async () => {
10
+ const testHttpClient = createTestHTTPClient("vault.validateConnectionState");
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.validateConnection.state({
19
+ consumerId: "test-consumer",
20
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
21
+ serviceId: "pipedrive",
22
+ unifiedApi: "crm",
23
+ });
24
+ expect(result.httpMeta.response.status).toBe(200);
25
+ expect(result.validateConnectionStateResponse).toBeDefined();
26
+ expect(result.validateConnectionStateResponse).toEqual({
27
+ statusCode: 200,
28
+ status: "OK",
29
+ data: {
30
+ id: "crm+salesforce",
31
+ state: "authorized",
32
+ },
33
+ });
34
+ });
@@ -0,0 +1,254 @@
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("Webhooks Webhook Webhooks All", async () => {
10
+ const testHttpClient = createTestHTTPClient("webhook.webhooksAll");
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.webhook.webhooks.list({
19
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
20
+ });
21
+ expect(result.httpMeta.response.status).toBe(200);
22
+ expect(result.getWebhooksResponse).toBeDefined();
23
+ expect(result.getWebhooksResponse).toEqual({
24
+ statusCode: 200,
25
+ status: "OK",
26
+ data: [
27
+ {
28
+ id: "1234",
29
+ description: "A description",
30
+ unifiedApi: "crm",
31
+ status: "enabled",
32
+ disabledReason: "retry_limit",
33
+ deliveryUrl: "https://example.com/my/webhook/endpoint",
34
+ executeBaseUrl:
35
+ "https://unify.apideck.com/webhook/webhooks/1234/execute",
36
+ events: [
37
+ "vault.connection.created",
38
+ "vault.connection.updated",
39
+ ],
40
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
41
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
42
+ },
43
+ {
44
+ id: "1234",
45
+ description: "A description",
46
+ unifiedApi: "crm",
47
+ status: "enabled",
48
+ disabledReason: "retry_limit",
49
+ deliveryUrl: "https://example.com/my/webhook/endpoint",
50
+ executeBaseUrl:
51
+ "https://unify.apideck.com/webhook/webhooks/1234/execute",
52
+ events: [
53
+ "vault.connection.created",
54
+ "vault.connection.updated",
55
+ ],
56
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
57
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
58
+ },
59
+ {
60
+ id: "1234",
61
+ description: "A description",
62
+ unifiedApi: "crm",
63
+ status: "enabled",
64
+ disabledReason: "retry_limit",
65
+ deliveryUrl: "https://example.com/my/webhook/endpoint",
66
+ executeBaseUrl:
67
+ "https://unify.apideck.com/webhook/webhooks/1234/execute",
68
+ events: [
69
+ "vault.connection.created",
70
+ "vault.connection.updated",
71
+ ],
72
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
73
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
74
+ },
75
+ ],
76
+ meta: {
77
+ itemsOnPage: 50,
78
+ cursors: {
79
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
80
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
81
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
82
+ },
83
+ },
84
+ links: {
85
+ previous:
86
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
87
+ current: "https://unify.apideck.com/crm/companies",
88
+ next:
89
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
90
+ },
91
+ });
92
+ });
93
+
94
+ test("Webhooks Webhook Webhooks Add", async () => {
95
+ const testHttpClient = createTestHTTPClient("webhook.webhooksAdd");
96
+
97
+ const apideck = new Apideck({
98
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
99
+ httpClient: testHttpClient,
100
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
101
+ });
102
+
103
+ const result = await apideck.webhook.webhooks.create({
104
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
105
+ createWebhookRequest: {
106
+ description: "A description",
107
+ unifiedApi: "crm",
108
+ status: "enabled",
109
+ deliveryUrl: "https://example.com/my/webhook/endpoint",
110
+ events: [
111
+ "vault.connection.created",
112
+ "vault.connection.updated",
113
+ ],
114
+ },
115
+ });
116
+ expect(result.httpMeta.response.status).toBe(201);
117
+ expect(result.createWebhookResponse).toBeDefined();
118
+ expect(result.createWebhookResponse).toEqual({
119
+ statusCode: 200,
120
+ status: "OK",
121
+ data: {
122
+ id: "1234",
123
+ description: "A description",
124
+ unifiedApi: "crm",
125
+ status: "enabled",
126
+ disabledReason: "retry_limit",
127
+ deliveryUrl: "https://example.com/my/webhook/endpoint",
128
+ executeBaseUrl: "https://unify.apideck.com/webhook/webhooks/1234/execute",
129
+ events: [
130
+ "vault.connection.created",
131
+ "vault.connection.updated",
132
+ ],
133
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
134
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
135
+ },
136
+ });
137
+ });
138
+
139
+ test("Webhooks Webhook Webhooks One", async () => {
140
+ const testHttpClient = createTestHTTPClient("webhook.webhooksOne");
141
+
142
+ const apideck = new Apideck({
143
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
144
+ httpClient: testHttpClient,
145
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
146
+ });
147
+
148
+ const result = await apideck.webhook.webhooks.get({
149
+ id: "<id>",
150
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
151
+ });
152
+ expect(result.httpMeta.response.status).toBe(200);
153
+ expect(result.getWebhookResponse).toBeDefined();
154
+ expect(result.getWebhookResponse).toEqual({
155
+ statusCode: 200,
156
+ status: "OK",
157
+ data: {
158
+ id: "1234",
159
+ description: "A description",
160
+ unifiedApi: "crm",
161
+ status: "enabled",
162
+ disabledReason: "retry_limit",
163
+ deliveryUrl: "https://example.com/my/webhook/endpoint",
164
+ executeBaseUrl: "https://unify.apideck.com/webhook/webhooks/1234/execute",
165
+ events: [
166
+ "vault.connection.created",
167
+ "vault.connection.updated",
168
+ ],
169
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
170
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
171
+ },
172
+ });
173
+ });
174
+
175
+ test("Webhooks Webhook Webhooks Update", async () => {
176
+ const testHttpClient = createTestHTTPClient("webhook.webhooksUpdate");
177
+
178
+ const apideck = new Apideck({
179
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
180
+ httpClient: testHttpClient,
181
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
182
+ });
183
+
184
+ const result = await apideck.webhook.webhooks.update({
185
+ id: "<id>",
186
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
187
+ updateWebhookRequest: {
188
+ description: "A description",
189
+ status: "enabled",
190
+ deliveryUrl: "https://example.com/my/webhook/endpoint",
191
+ events: [
192
+ "vault.connection.created",
193
+ "vault.connection.updated",
194
+ ],
195
+ },
196
+ });
197
+ expect(result.httpMeta.response.status).toBe(200);
198
+ expect(result.updateWebhookResponse).toBeDefined();
199
+ expect(result.updateWebhookResponse).toEqual({
200
+ statusCode: 200,
201
+ status: "OK",
202
+ data: {
203
+ id: "1234",
204
+ description: "A description",
205
+ unifiedApi: "crm",
206
+ status: "enabled",
207
+ disabledReason: "retry_limit",
208
+ deliveryUrl: "https://example.com/my/webhook/endpoint",
209
+ executeBaseUrl: "https://unify.apideck.com/webhook/webhooks/1234/execute",
210
+ events: [
211
+ "vault.connection.created",
212
+ "vault.connection.updated",
213
+ ],
214
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
215
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
216
+ },
217
+ });
218
+ });
219
+
220
+ test("Webhooks Webhook Webhooks Delete", async () => {
221
+ const testHttpClient = createTestHTTPClient("webhook.webhooksDelete");
222
+
223
+ const apideck = new Apideck({
224
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
225
+ httpClient: testHttpClient,
226
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
227
+ });
228
+
229
+ const result = await apideck.webhook.webhooks.delete({
230
+ id: "<id>",
231
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
232
+ });
233
+ expect(result.httpMeta.response.status).toBe(200);
234
+ expect(result.deleteWebhookResponse).toBeDefined();
235
+ expect(result.deleteWebhookResponse).toEqual({
236
+ statusCode: 200,
237
+ status: "OK",
238
+ data: {
239
+ id: "1234",
240
+ description: "A description",
241
+ unifiedApi: "crm",
242
+ status: "enabled",
243
+ disabledReason: "retry_limit",
244
+ deliveryUrl: "https://example.com/my/webhook/endpoint",
245
+ executeBaseUrl: "https://unify.apideck.com/webhook/webhooks/1234/execute",
246
+ events: [
247
+ "vault.connection.created",
248
+ "vault.connection.updated",
249
+ ],
250
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
251
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
252
+ },
253
+ });
254
+ });
package/src/lib/config.ts CHANGED
@@ -67,8 +67,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
67
67
 
68
68
  export const SDK_METADATA = {
69
69
  language: "typescript",
70
- openapiDocVersion: "10.24.22",
71
- sdkVersion: "0.40.0",
72
- genVersion: "2.879.11",
73
- userAgent: "speakeasy-sdk/typescript 0.40.0 2.879.11 10.24.22 @apideck/unify",
70
+ openapiDocVersion: "10.24.23",
71
+ sdkVersion: "0.41.0",
72
+ genVersion: "2.879.13",
73
+ userAgent: "speakeasy-sdk/typescript 0.41.0 2.879.13 10.24.23 @apideck/unify",
74
74
  } as const;