@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.
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/models/components/note.d.ts +5 -0
- package/models/components/note.d.ts.map +1 -1
- package/models/components/note.js +4 -0
- package/models/components/note.js.map +1 -1
- package/models/components/noteinput.d.ts +5 -0
- package/models/components/noteinput.d.ts.map +1 -1
- package/models/components/noteinput.js +4 -0
- package/models/components/noteinput.js.map +1 -1
- package/package.json +5 -1
- package/src/__tests__/activities.test.ts +783 -0
- package/src/__tests__/agedcreditors.test.ts +279 -0
- package/src/__tests__/ageddebtors.test.ts +279 -0
- package/src/__tests__/apideckcompanies.test.ts +712 -0
- package/src/__tests__/apideckcustomers.test.ts +360 -0
- package/src/__tests__/apideckdepartments.test.ts +319 -0
- package/src/__tests__/apiresources.test.ts +61 -0
- package/src/__tests__/apis.test.ts +214 -0
- package/src/__tests__/applicants.test.ts +976 -0
- package/src/__tests__/applications.test.ts +329 -0
- package/src/__tests__/assertions.ts +13 -0
- package/src/__tests__/attachments.test.ts +363 -0
- package/src/__tests__/balancesheet.test.ts +451 -0
- package/src/__tests__/billpayments.test.ts +666 -0
- package/src/__tests__/bills.test.ts +1133 -0
- package/src/__tests__/collections.test.ts +115 -0
- package/src/__tests__/collectiontags.test.ts +66 -0
- package/src/__tests__/collectionticketcomments.test.ts +318 -0
- package/src/__tests__/collectiontickets.test.ts +436 -0
- package/src/__tests__/collectionusers.test.ts +122 -0
- package/src/__tests__/companies.test.ts +1059 -0
- package/src/__tests__/companyinfo.test.ts +218 -0
- package/src/__tests__/connectioncustommappings.test.ts +67 -0
- package/src/__tests__/connections.test.ts +1713 -0
- package/src/__tests__/connectionsettings.test.ts +280 -0
- package/src/__tests__/connectordocs.test.ts +28 -0
- package/src/__tests__/connectors.test.ts +751 -0
- package/src/__tests__/consumerrequestcounts.test.ts +41 -0
- package/src/__tests__/consumers.test.ts +517 -0
- package/src/__tests__/contacts.test.ts +957 -0
- package/src/__tests__/createcallback.test.ts +34 -0
- package/src/__tests__/creditnotes.test.ts +1362 -0
- package/src/__tests__/customers.test.ts +1089 -0
- package/src/__tests__/customfields.test.ts +50 -0
- package/src/__tests__/custommappings.test.ts +63 -0
- package/src/__tests__/departments.test.ts +359 -0
- package/src/__tests__/drivegroups.test.ts +318 -0
- package/src/__tests__/drives.test.ts +311 -0
- package/src/__tests__/employeepayrolls.test.ts +487 -0
- package/src/__tests__/employees.test.ts +1682 -0
- package/src/__tests__/employeeschedules.test.ts +456 -0
- package/src/__tests__/eventlogs.test.ts +157 -0
- package/src/__tests__/expenses.test.ts +566 -0
- package/src/__tests__/files.test.ts +392 -0
- package/src/__tests__/files.ts +56 -0
- package/src/__tests__/folders.test.ts +103 -0
- package/src/__tests__/invoiceitems.test.ts +586 -0
- package/src/__tests__/invoices.test.ts +1561 -0
- package/src/__tests__/jobs.test.ts +837 -0
- package/src/__tests__/journalentries.test.ts +1053 -0
- package/src/__tests__/leads.test.ts +897 -0
- package/src/__tests__/ledgeraccounts.test.ts +594 -0
- package/src/__tests__/locations.test.ts +561 -0
- package/src/__tests__/logs.test.ts +135 -0
- package/src/__tests__/messages.test.ts +396 -0
- package/src/__tests__/mockserver/README.md +52 -0
- package/src/__tests__/notes.test.ts +335 -0
- package/src/__tests__/opportunities.test.ts +503 -0
- package/src/__tests__/orders.test.ts +849 -0
- package/src/__tests__/payments.test.ts +557 -0
- package/src/__tests__/payrolls.test.ts +481 -0
- package/src/__tests__/pipelines.test.ts +383 -0
- package/src/__tests__/products.test.ts +505 -0
- package/src/__tests__/profitandloss.test.ts +221 -0
- package/src/__tests__/purchaseorders.test.ts +1464 -0
- package/src/__tests__/sessions.test.ts +70 -0
- package/src/__tests__/sharedlinks.test.ts +331 -0
- package/src/__tests__/stores.test.ts +39 -0
- package/src/__tests__/subsidiaries.test.ts +316 -0
- package/src/__tests__/suppliers.test.ts +1071 -0
- package/src/__tests__/taxrates.test.ts +472 -0
- package/src/__tests__/testclient.ts +48 -0
- package/src/__tests__/timeoffrequests.test.ts +381 -0
- package/src/__tests__/trackingcategories.test.ts +329 -0
- package/src/__tests__/uploadsessions.test.ts +142 -0
- package/src/__tests__/users.test.ts +667 -0
- package/src/__tests__/validateconnection.test.ts +32 -0
- package/src/__tests__/webhooks.test.ts +248 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/note.ts +9 -0
- package/src/models/components/noteinput.ts +9 -0
|
@@ -0,0 +1,280 @@
|
|
|
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("Connectionsettings Vault Connection Settings All", async () => {
|
|
10
|
+
const testHttpClient = createTestHTTPClient("vault.connectionSettingsAll");
|
|
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.connectionSettings.list({
|
|
19
|
+
unifiedApi: "crm",
|
|
20
|
+
serviceId: "pipedrive",
|
|
21
|
+
resource: "leads",
|
|
22
|
+
});
|
|
23
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
24
|
+
expect(result.getConnectionResponse).toBeDefined();
|
|
25
|
+
expect(result.getConnectionResponse).toEqual({
|
|
26
|
+
statusCode: 200,
|
|
27
|
+
status: "OK",
|
|
28
|
+
data: {
|
|
29
|
+
id: "crm+salesforce",
|
|
30
|
+
serviceId: "salesforce",
|
|
31
|
+
name: "Salesforce",
|
|
32
|
+
tagLine:
|
|
33
|
+
"CRM software solutions and enterprise cloud computing from Salesforce, the leader in customer relationship management (CRM) and PaaS. Free 30 day trial.",
|
|
34
|
+
unifiedApi: "crm",
|
|
35
|
+
state: "authorized",
|
|
36
|
+
integrationState: "configured",
|
|
37
|
+
authType: "oauth2",
|
|
38
|
+
oauthGrantType: "authorization_code",
|
|
39
|
+
enabled: true,
|
|
40
|
+
website: "https://www.salesforce.com",
|
|
41
|
+
icon:
|
|
42
|
+
"https://res.cloudinary.com/apideck/image/upload/v1529456047/catalog/salesforce/icon128x128.png",
|
|
43
|
+
logo:
|
|
44
|
+
"https://c1.sfdcstatic.com/content/dam/web/en_us/www/images/home/logo-salesforce-m.svg",
|
|
45
|
+
authorizeUrl:
|
|
46
|
+
"https://unify.apideck.com/vault/authorize/salesforce/<application-id>?state=<state>",
|
|
47
|
+
revokeUrl:
|
|
48
|
+
"https://unify.apideck.com/vault/revoke/salesforce/<application-id>?state=<state>",
|
|
49
|
+
settings: {
|
|
50
|
+
"instance_url": "https://eu28.salesforce.com",
|
|
51
|
+
"api_key": "12345xxxxxx",
|
|
52
|
+
},
|
|
53
|
+
metadata: {
|
|
54
|
+
"account": {
|
|
55
|
+
"name": "My Company",
|
|
56
|
+
"id": "c01458a5-7276-41ce-bc19-639906b0450a",
|
|
57
|
+
},
|
|
58
|
+
"plan": "enterprise",
|
|
59
|
+
},
|
|
60
|
+
formFields: [
|
|
61
|
+
{
|
|
62
|
+
id: "instance_url",
|
|
63
|
+
label: "Instance url",
|
|
64
|
+
placeholder: "",
|
|
65
|
+
type: "text",
|
|
66
|
+
required: true,
|
|
67
|
+
customField: false,
|
|
68
|
+
allowCustomValues: false,
|
|
69
|
+
disabled: false,
|
|
70
|
+
sensitive: false,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: "api_key",
|
|
74
|
+
label: "API Key",
|
|
75
|
+
placeholder: "",
|
|
76
|
+
type: "text",
|
|
77
|
+
required: true,
|
|
78
|
+
customField: false,
|
|
79
|
+
allowCustomValues: false,
|
|
80
|
+
disabled: false,
|
|
81
|
+
sensitive: true,
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
configuration: [
|
|
85
|
+
{
|
|
86
|
+
resource: "leads",
|
|
87
|
+
defaults: [
|
|
88
|
+
{
|
|
89
|
+
target: "custom_fields",
|
|
90
|
+
id: "ProductInterest",
|
|
91
|
+
options: [
|
|
92
|
+
{
|
|
93
|
+
label: "General Channel",
|
|
94
|
+
value: 123,
|
|
95
|
+
optionType: "simple",
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
label: "General Channel",
|
|
99
|
+
value: true,
|
|
100
|
+
optionType: "simple",
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: "1234",
|
|
104
|
+
label: "General Channel",
|
|
105
|
+
options: [],
|
|
106
|
+
optionType: "group",
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
value: true,
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
target: "custom_fields",
|
|
113
|
+
id: "ProductInterest",
|
|
114
|
+
options: [
|
|
115
|
+
{
|
|
116
|
+
label: "General Channel",
|
|
117
|
+
value: true,
|
|
118
|
+
optionType: "simple",
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
value: 10.5,
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
resource: "leads",
|
|
127
|
+
defaults: [
|
|
128
|
+
{
|
|
129
|
+
target: "custom_fields",
|
|
130
|
+
id: "ProductInterest",
|
|
131
|
+
options: [
|
|
132
|
+
{
|
|
133
|
+
label: "General Channel",
|
|
134
|
+
value: 123,
|
|
135
|
+
optionType: "simple",
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
value: 10.5,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
target: "custom_fields",
|
|
142
|
+
id: "ProductInterest",
|
|
143
|
+
options: [
|
|
144
|
+
{
|
|
145
|
+
id: "1234",
|
|
146
|
+
label: "General Channel",
|
|
147
|
+
options: [
|
|
148
|
+
{
|
|
149
|
+
label: "General Channel",
|
|
150
|
+
value: [
|
|
151
|
+
"team",
|
|
152
|
+
"general",
|
|
153
|
+
],
|
|
154
|
+
optionType: "simple",
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
label: "General Channel",
|
|
158
|
+
value: 12.5,
|
|
159
|
+
optionType: "simple",
|
|
160
|
+
},
|
|
161
|
+
],
|
|
162
|
+
optionType: "group",
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
value: "GC5000 series",
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
resource: "leads",
|
|
171
|
+
defaults: [
|
|
172
|
+
{
|
|
173
|
+
target: "custom_fields",
|
|
174
|
+
id: "ProductInterest",
|
|
175
|
+
options: [
|
|
176
|
+
{
|
|
177
|
+
label: "General Channel",
|
|
178
|
+
value: [
|
|
179
|
+
"team",
|
|
180
|
+
"general",
|
|
181
|
+
],
|
|
182
|
+
optionType: "simple",
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
label: "General Channel",
|
|
186
|
+
value: [
|
|
187
|
+
"team",
|
|
188
|
+
"general",
|
|
189
|
+
],
|
|
190
|
+
optionType: "simple",
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
label: "General Channel",
|
|
194
|
+
value: "general",
|
|
195
|
+
optionType: "simple",
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
value: [],
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
configurableResources: [
|
|
204
|
+
"opportunities",
|
|
205
|
+
"companies",
|
|
206
|
+
"contacts",
|
|
207
|
+
"leads",
|
|
208
|
+
],
|
|
209
|
+
resourceSchemaSupport: [
|
|
210
|
+
"leads",
|
|
211
|
+
],
|
|
212
|
+
resourceSettingsSupport: [
|
|
213
|
+
"leads",
|
|
214
|
+
],
|
|
215
|
+
settingsRequiredForAuthorization: [
|
|
216
|
+
"client_id",
|
|
217
|
+
"client_secret",
|
|
218
|
+
],
|
|
219
|
+
subscriptions: [
|
|
220
|
+
{
|
|
221
|
+
downstreamId: "5f5f5f5f5f5f5f5f5f5f5f5f",
|
|
222
|
+
unifyEventTypes: [
|
|
223
|
+
"crm.contact.created",
|
|
224
|
+
],
|
|
225
|
+
downstreamEventTypes: [
|
|
226
|
+
"contacts.CREATED",
|
|
227
|
+
],
|
|
228
|
+
executeUrl:
|
|
229
|
+
"https://unify.apideck.com/webhook/w/{lookupIdToken}/{serviceId}?e={downstreamEventType}",
|
|
230
|
+
createdAt: "2020-10-01T12:00:00.000Z",
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
downstreamId: "5f5f5f5f5f5f5f5f5f5f5f5f",
|
|
234
|
+
unifyEventTypes: [
|
|
235
|
+
"crm.contact.created",
|
|
236
|
+
],
|
|
237
|
+
downstreamEventTypes: [
|
|
238
|
+
"contacts.CREATED",
|
|
239
|
+
],
|
|
240
|
+
executeUrl:
|
|
241
|
+
"https://unify.apideck.com/webhook/w/{lookupIdToken}/{serviceId}?e={downstreamEventType}",
|
|
242
|
+
createdAt: "2020-10-01T12:00:00.000Z",
|
|
243
|
+
},
|
|
244
|
+
],
|
|
245
|
+
hasGuide: true,
|
|
246
|
+
createdAt: 1615563533390,
|
|
247
|
+
customMappings: [
|
|
248
|
+
{
|
|
249
|
+
id: "hris+employees+first_aid_training",
|
|
250
|
+
label: "First Aid Training",
|
|
251
|
+
description: "First Aid Training completed after 2019-01-01",
|
|
252
|
+
value: "$.root.training.first_aid",
|
|
253
|
+
key: "first_aid_training",
|
|
254
|
+
required: false,
|
|
255
|
+
customField: true,
|
|
256
|
+
consumerId: "test_user_id",
|
|
257
|
+
example: "Some value",
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
id: "hris+employees+first_aid_training",
|
|
261
|
+
label: "First Aid Training",
|
|
262
|
+
description: "First Aid Training completed after 2019-01-01",
|
|
263
|
+
value: "$.root.training.first_aid",
|
|
264
|
+
key: "first_aid_training",
|
|
265
|
+
required: false,
|
|
266
|
+
customField: true,
|
|
267
|
+
consumerId: "test_user_id",
|
|
268
|
+
example: "Some value",
|
|
269
|
+
},
|
|
270
|
+
],
|
|
271
|
+
updatedAt: 1616662325753,
|
|
272
|
+
},
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
it.skip("Connectionsettings Vault Connection Settings Update", async () => {
|
|
277
|
+
assert.fail(
|
|
278
|
+
"incomplete test found please make sure to address the following errors: [`workflow step vault.connectionSettingsUpdate.test referencing operation vault.connectionSettingsUpdate with expression in requestBody with type not currently supported`, `workflow step vault.connectionSettingsUpdate.test referencing operation vault.connectionSettingsUpdate with expression in requestBody with type not currently supported`]",
|
|
279
|
+
);
|
|
280
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
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 { GetAcceptEnum } from "../sdk/connectordocs.js";
|
|
8
|
+
import { createTestHTTPClient } from "./testclient.js";
|
|
9
|
+
|
|
10
|
+
test("Connectordocs Connector Connector Docs One", async () => {
|
|
11
|
+
const testHttpClient = createTestHTTPClient("connector.connectorDocsOne");
|
|
12
|
+
|
|
13
|
+
const apideck = new Apideck({
|
|
14
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
15
|
+
httpClient: testHttpClient,
|
|
16
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const result = await apideck.connector.connectorDocs.get({
|
|
20
|
+
id: "<id>",
|
|
21
|
+
docId: "application_owner+oauth_credentials",
|
|
22
|
+
}, {
|
|
23
|
+
acceptHeaderOverride: GetAcceptEnum.textMarkdown,
|
|
24
|
+
});
|
|
25
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
26
|
+
expect(result.getConnectorDocResponse).toBeDefined();
|
|
27
|
+
expect(result.getConnectorDocResponse).toEqual("<value>");
|
|
28
|
+
});
|