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