@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.
- package/jsr.json +1 -1
- package/lib/config.d.ts +4 -4
- package/lib/config.js +4 -4
- package/package.json +6 -2
- package/src/__tests__/activities.test.ts +1141 -0
- package/src/__tests__/agedcreditors.test.ts +280 -0
- package/src/__tests__/ageddebtors.test.ts +280 -0
- package/src/__tests__/apideckcompanies.test.ts +1082 -0
- package/src/__tests__/apideckcustomers.test.ts +364 -0
- package/src/__tests__/apideckdepartments.test.ts +497 -0
- package/src/__tests__/apiresources.test.ts +62 -0
- package/src/__tests__/apis.test.ts +216 -0
- package/src/__tests__/applicants.test.ts +1445 -0
- package/src/__tests__/applications.test.ts +515 -0
- package/src/__tests__/assertions.ts +13 -0
- package/src/__tests__/attachments.test.ts +371 -0
- package/src/__tests__/balancesheet.test.ts +453 -0
- package/src/__tests__/bankaccounts.test.ts +324 -0
- package/src/__tests__/bankfeedaccounts.test.ts +343 -0
- package/src/__tests__/bankfeedstatements.test.ts +408 -0
- package/src/__tests__/billpayments.test.ts +1031 -0
- package/src/__tests__/bills.test.ts +1630 -0
- package/src/__tests__/categories.test.ts +127 -0
- package/src/__tests__/collections.test.ts +120 -0
- package/src/__tests__/collectiontags.test.ts +68 -0
- package/src/__tests__/collectionticketcomments.test.ts +501 -0
- package/src/__tests__/collectiontickets.test.ts +627 -0
- package/src/__tests__/collectionusers.test.ts +126 -0
- package/src/__tests__/companies.test.ts +1642 -0
- package/src/__tests__/companyinfo.test.ts +219 -0
- package/src/__tests__/connectionconsent.test.ts +89 -0
- package/src/__tests__/connectionconsents.test.ts +31 -0
- package/src/__tests__/connectioncustommappings.test.ts +69 -0
- package/src/__tests__/connections.test.ts +2127 -0
- package/src/__tests__/connectionsettings.test.ts +687 -0
- package/src/__tests__/connectordocs.test.ts +29 -0
- package/src/__tests__/connectors.test.ts +753 -0
- package/src/__tests__/consumerrequestcounts.test.ts +42 -0
- package/src/__tests__/consumers.test.ts +523 -0
- package/src/__tests__/contacts.test.ts +1421 -0
- package/src/__tests__/createcallback.test.ts +36 -0
- package/src/__tests__/creditnotes.test.ts +2040 -0
- package/src/__tests__/customers.test.ts +1600 -0
- package/src/__tests__/customfields.test.ts +52 -0
- package/src/__tests__/custommappings.test.ts +65 -0
- package/src/__tests__/customobjects.test.ts +408 -0
- package/src/__tests__/customobjectschemas.test.ts +734 -0
- package/src/__tests__/departments.test.ts +529 -0
- package/src/__tests__/drivegroups.test.ts +496 -0
- package/src/__tests__/drives.test.ts +487 -0
- package/src/__tests__/employeepayrolls.test.ts +491 -0
- package/src/__tests__/employees.test.ts +2968 -0
- package/src/__tests__/employeeschedules.test.ts +457 -0
- package/src/__tests__/eventlogs.test.ts +158 -0
- package/src/__tests__/expensecategories.test.ts +324 -0
- package/src/__tests__/expensereports.test.ts +634 -0
- package/src/__tests__/expenses.test.ts +867 -0
- package/src/__tests__/files.test.ts +506 -0
- package/src/__tests__/files.ts +56 -0
- package/src/__tests__/folders.test.ts +390 -0
- package/src/__tests__/invoiceitems.test.ts +855 -0
- package/src/__tests__/invoices.test.ts +2173 -0
- package/src/__tests__/jobs.test.ts +1150 -0
- package/src/__tests__/journalentries.test.ts +1542 -0
- package/src/__tests__/leads.test.ts +1341 -0
- package/src/__tests__/ledgeraccounts.test.ts +829 -0
- package/src/__tests__/locations.test.ts +856 -0
- package/src/__tests__/logs.test.ts +137 -0
- package/src/__tests__/messages.test.ts +588 -0
- package/src/__tests__/notes.test.ts +523 -0
- package/src/__tests__/opportunities.test.ts +718 -0
- package/src/__tests__/orders.test.ts +854 -0
- package/src/__tests__/payments.test.ts +867 -0
- package/src/__tests__/payrolls.test.ts +485 -0
- package/src/__tests__/pipelines.test.ts +574 -0
- package/src/__tests__/products.test.ts +509 -0
- package/src/__tests__/profitandloss.test.ts +223 -0
- package/src/__tests__/projects.test.ts +480 -0
- package/src/__tests__/proxy.test.ts +41 -0
- package/src/__tests__/purchaseorders.test.ts +2139 -0
- package/src/__tests__/quotes.test.ts +678 -0
- package/src/__tests__/refunds.test.ts +812 -0
- package/src/__tests__/sessions.test.ts +72 -0
- package/src/__tests__/sharedlinks.test.ts +511 -0
- package/src/__tests__/stores.test.ts +41 -0
- package/src/__tests__/subsidiaries.test.ts +496 -0
- package/src/__tests__/suppliers.test.ts +1574 -0
- package/src/__tests__/taxrates.test.ts +701 -0
- package/src/__tests__/testclient.ts +48 -0
- package/src/__tests__/timeoffrequests.test.ts +588 -0
- package/src/__tests__/trackingcategories.test.ts +515 -0
- package/src/__tests__/uploadsessions.test.ts +221 -0
- package/src/__tests__/users.test.ts +1020 -0
- package/src/__tests__/validateconnection.test.ts +34 -0
- package/src/__tests__/webhooks.test.ts +254 -0
- package/src/lib/config.ts +4 -4
|
@@ -0,0 +1,216 @@
|
|
|
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("Apis Connector Apis All", async () => {
|
|
10
|
+
const testHttpClient = createTestHTTPClient("connector.apisAll");
|
|
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.connector.apis.list({
|
|
19
|
+
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
|
|
20
|
+
filter: {
|
|
21
|
+
status: "beta",
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
25
|
+
expect(result.getApisResponse).toBeDefined();
|
|
26
|
+
expect(result.getApisResponse).toEqual({
|
|
27
|
+
statusCode: 200,
|
|
28
|
+
status: "OK",
|
|
29
|
+
data: [
|
|
30
|
+
{
|
|
31
|
+
id: "file-storage",
|
|
32
|
+
name: "File Storage API",
|
|
33
|
+
description:
|
|
34
|
+
"Manage API keys, access tokens, OAuth flows and integrations.",
|
|
35
|
+
specUrl: "https://specs.apideck.com/file-storage.yml",
|
|
36
|
+
apiReferenceUrl:
|
|
37
|
+
"https://developers.apideck.com/apis/file-storage/reference",
|
|
38
|
+
postmanCollectionId: "1311564-00e7266b-a3d6-4f40-b172-baaa66a3ed6f",
|
|
39
|
+
categories: [
|
|
40
|
+
"files",
|
|
41
|
+
"file-storage",
|
|
42
|
+
"cloud-storage",
|
|
43
|
+
"object-storage",
|
|
44
|
+
],
|
|
45
|
+
resources: [
|
|
46
|
+
{
|
|
47
|
+
id: "companies",
|
|
48
|
+
name: "Companies",
|
|
49
|
+
excludedFromCoverage: false,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: "companies",
|
|
53
|
+
name: "Companies",
|
|
54
|
+
excludedFromCoverage: false,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
events: [
|
|
58
|
+
"crm.contact.updated",
|
|
59
|
+
"accounting.invoice.created",
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: "file-storage",
|
|
64
|
+
name: "File Storage API",
|
|
65
|
+
description:
|
|
66
|
+
"Manage API keys, access tokens, OAuth flows and integrations.",
|
|
67
|
+
specUrl: "https://specs.apideck.com/file-storage.yml",
|
|
68
|
+
apiReferenceUrl:
|
|
69
|
+
"https://developers.apideck.com/apis/file-storage/reference",
|
|
70
|
+
postmanCollectionId: "1311564-00e7266b-a3d6-4f40-b172-baaa66a3ed6f",
|
|
71
|
+
categories: [
|
|
72
|
+
"files",
|
|
73
|
+
"file-storage",
|
|
74
|
+
"cloud-storage",
|
|
75
|
+
"object-storage",
|
|
76
|
+
],
|
|
77
|
+
resources: [
|
|
78
|
+
{
|
|
79
|
+
id: "companies",
|
|
80
|
+
name: "Companies",
|
|
81
|
+
excludedFromCoverage: false,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: "companies",
|
|
85
|
+
name: "Companies",
|
|
86
|
+
excludedFromCoverage: false,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: "companies",
|
|
90
|
+
name: "Companies",
|
|
91
|
+
excludedFromCoverage: false,
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
events: [
|
|
95
|
+
"crm.contact.updated",
|
|
96
|
+
"accounting.invoice.created",
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: "file-storage",
|
|
101
|
+
name: "File Storage API",
|
|
102
|
+
description:
|
|
103
|
+
"Manage API keys, access tokens, OAuth flows and integrations.",
|
|
104
|
+
specUrl: "https://specs.apideck.com/file-storage.yml",
|
|
105
|
+
apiReferenceUrl:
|
|
106
|
+
"https://developers.apideck.com/apis/file-storage/reference",
|
|
107
|
+
postmanCollectionId: "1311564-00e7266b-a3d6-4f40-b172-baaa66a3ed6f",
|
|
108
|
+
categories: [
|
|
109
|
+
"files",
|
|
110
|
+
"file-storage",
|
|
111
|
+
"cloud-storage",
|
|
112
|
+
"object-storage",
|
|
113
|
+
],
|
|
114
|
+
resources: [
|
|
115
|
+
{
|
|
116
|
+
id: "companies",
|
|
117
|
+
name: "Companies",
|
|
118
|
+
excludedFromCoverage: false,
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
events: [
|
|
122
|
+
"crm.contact.updated",
|
|
123
|
+
"accounting.invoice.created",
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
meta: {
|
|
128
|
+
itemsOnPage: 50,
|
|
129
|
+
cursors: {
|
|
130
|
+
previous: "em9oby1jcm06OnBhZ2U6OjE=",
|
|
131
|
+
current: "em9oby1jcm06OnBhZ2U6OjI=",
|
|
132
|
+
next: "em9oby1jcm06OnBhZ2U6OjM=",
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
links: {
|
|
136
|
+
previous:
|
|
137
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
|
|
138
|
+
current: "https://unify.apideck.com/crm/companies",
|
|
139
|
+
next:
|
|
140
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
test("Apis Connector Apis One", async () => {
|
|
146
|
+
const testHttpClient = createTestHTTPClient("connector.apisOne");
|
|
147
|
+
|
|
148
|
+
const apideck = new Apideck({
|
|
149
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
150
|
+
httpClient: testHttpClient,
|
|
151
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
const result = await apideck.connector.apis.get({
|
|
155
|
+
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
|
|
156
|
+
id: "<id>",
|
|
157
|
+
});
|
|
158
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
159
|
+
expect(result.getApiResponse).toBeDefined();
|
|
160
|
+
expect(result.getApiResponse).toEqual({
|
|
161
|
+
statusCode: 200,
|
|
162
|
+
status: "OK",
|
|
163
|
+
data: {
|
|
164
|
+
id: "file-storage",
|
|
165
|
+
name: "File Storage API",
|
|
166
|
+
description:
|
|
167
|
+
"Manage API keys, access tokens, OAuth flows and integrations.",
|
|
168
|
+
specUrl: "https://specs.apideck.com/file-storage.yml",
|
|
169
|
+
apiReferenceUrl:
|
|
170
|
+
"https://developers.apideck.com/apis/file-storage/reference",
|
|
171
|
+
postmanCollectionId: "1311564-00e7266b-a3d6-4f40-b172-baaa66a3ed6f",
|
|
172
|
+
categories: [
|
|
173
|
+
"files",
|
|
174
|
+
"file-storage",
|
|
175
|
+
"cloud-storage",
|
|
176
|
+
"object-storage",
|
|
177
|
+
],
|
|
178
|
+
resources: [
|
|
179
|
+
{
|
|
180
|
+
id: "companies",
|
|
181
|
+
name: "Companies",
|
|
182
|
+
excludedFromCoverage: false,
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
id: "companies",
|
|
186
|
+
name: "Companies",
|
|
187
|
+
excludedFromCoverage: false,
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
id: "companies",
|
|
191
|
+
name: "Companies",
|
|
192
|
+
excludedFromCoverage: false,
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
events: [
|
|
196
|
+
"crm.contact.updated",
|
|
197
|
+
"accounting.invoice.created",
|
|
198
|
+
],
|
|
199
|
+
},
|
|
200
|
+
meta: {
|
|
201
|
+
itemsOnPage: 50,
|
|
202
|
+
cursors: {
|
|
203
|
+
previous: "em9oby1jcm06OnBhZ2U6OjE=",
|
|
204
|
+
current: "em9oby1jcm06OnBhZ2U6OjI=",
|
|
205
|
+
next: "em9oby1jcm06OnBhZ2U6OjM=",
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
links: {
|
|
209
|
+
previous:
|
|
210
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
|
|
211
|
+
current: "https://unify.apideck.com/crm/companies",
|
|
212
|
+
next:
|
|
213
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
});
|