@apideck/unify 0.26.0 → 0.28.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/README.md +5 -5
- package/docs/sdks/companies/README.md +4 -4
- package/examples/README.md +26 -0
- package/examples/accountingTaxRatesList.example.ts +41 -0
- package/examples/package-lock.json +613 -0
- package/examples/package.json +18 -0
- package/funcs/crmCompaniesCreate.js +1 -1
- package/funcs/crmCompaniesCreate.js.map +1 -1
- package/funcs/crmCompaniesUpdate.js +1 -1
- package/funcs/crmCompaniesUpdate.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +4 -4
- package/lib/config.js +4 -4
- package/models/components/bankaccount.d.ts +5 -0
- package/models/components/bankaccount.d.ts.map +1 -1
- package/models/components/bankaccount.js +2 -0
- package/models/components/bankaccount.js.map +1 -1
- package/models/components/bankaccount1.d.ts +123 -0
- package/models/components/bankaccount1.d.ts.map +1 -0
- package/models/components/bankaccount1.js +128 -0
- package/models/components/bankaccount1.js.map +1 -0
- package/models/components/{company.d.ts → company1.d.ts} +32 -32
- package/models/components/company1.d.ts.map +1 -0
- package/models/components/{company.js → company1.js} +37 -37
- package/models/components/company1.js.map +1 -0
- package/models/components/companyinfo.d.ts +5 -0
- package/models/components/companyinfo.d.ts.map +1 -1
- package/models/components/companyinfo.js +4 -0
- package/models/components/companyinfo.js.map +1 -1
- package/models/components/getcompaniesresponse.d.ts +3 -3
- package/models/components/getcompaniesresponse.d.ts.map +1 -1
- package/models/components/getcompaniesresponse.js +3 -3
- package/models/components/getcompaniesresponse.js.map +1 -1
- package/models/components/getcompanyresponse.d.ts +3 -3
- package/models/components/getcompanyresponse.d.ts.map +1 -1
- package/models/components/getcompanyresponse.js +3 -3
- package/models/components/getcompanyresponse.js.map +1 -1
- package/models/components/index.d.ts +2 -1
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +2 -1
- package/models/components/index.js.map +1 -1
- package/models/components/ledgeraccount.d.ts +9 -9
- package/models/components/ledgeraccount.d.ts.map +1 -1
- package/models/components/ledgeraccount.js +19 -15
- package/models/components/ledgeraccount.js.map +1 -1
- package/models/components/ledgeraccountsfilter.d.ts +61 -0
- package/models/components/ledgeraccountsfilter.d.ts.map +1 -1
- package/models/components/ledgeraccountsfilter.js +33 -1
- package/models/components/ledgeraccountsfilter.js.map +1 -1
- package/models/components/supplier.d.ts +10 -0
- package/models/components/supplier.d.ts.map +1 -1
- package/models/components/supplier.js +4 -0
- package/models/components/supplier.js.map +1 -1
- package/models/errors/apierror.d.ts.map +1 -1
- package/models/errors/apierror.js +8 -2
- package/models/errors/apierror.js.map +1 -1
- package/models/errors/badrequestresponse.js +1 -1
- package/models/errors/badrequestresponse.js.map +1 -1
- package/models/errors/notfoundresponse.js +1 -1
- package/models/errors/notfoundresponse.js.map +1 -1
- package/models/errors/paymentrequiredresponse.js +1 -1
- package/models/errors/paymentrequiredresponse.js.map +1 -1
- package/models/errors/unauthorizedresponse.js +1 -1
- package/models/errors/unauthorizedresponse.js.map +1 -1
- package/models/errors/unprocessableresponse.js +1 -1
- package/models/errors/unprocessableresponse.js.map +1 -1
- package/models/operations/crmcompaniesadd.d.ts +2 -2
- package/models/operations/crmcompaniesadd.d.ts.map +1 -1
- package/models/operations/crmcompaniesadd.js +4 -4
- package/models/operations/crmcompaniesadd.js.map +1 -1
- package/models/operations/crmcompaniesupdate.d.ts +2 -2
- package/models/operations/crmcompaniesupdate.d.ts.map +1 -1
- package/models/operations/crmcompaniesupdate.js +4 -4
- package/models/operations/crmcompaniesupdate.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/activities.test.ts +360 -9
- package/src/__tests__/apideckcompanies.test.ts +373 -9
- package/src/__tests__/apideckdepartments.test.ts +181 -9
- package/src/__tests__/applicants.test.ts +473 -9
- package/src/__tests__/applications.test.ts +189 -9
- package/src/__tests__/billpayments.test.ts +367 -9
- package/src/__tests__/bills.test.ts +500 -9
- package/src/__tests__/collectionticketcomments.test.ts +183 -7
- package/src/__tests__/collectiontickets.test.ts +191 -7
- package/src/__tests__/companies.test.ts +538 -9
- package/src/__tests__/connections.test.ts +409 -5
- package/src/__tests__/connectionsettings.test.ts +410 -5
- package/src/__tests__/contacts.test.ts +466 -9
- package/src/__tests__/creditnotes.test.ts +758 -87
- package/src/__tests__/customers.test.ts +513 -9
- package/src/__tests__/customobjects.test.ts +150 -9
- package/src/__tests__/customobjectschemas.test.ts +321 -9
- package/src/__tests__/departments.test.ts +173 -9
- package/src/__tests__/drivegroups.test.ts +181 -9
- package/src/__tests__/drives.test.ts +179 -9
- package/src/__tests__/employees.test.ts +829 -94
- package/src/__tests__/expenses.test.ts +332 -9
- package/src/__tests__/files.test.ts +106 -5
- package/src/__tests__/folders.test.ts +296 -13
- package/src/__tests__/invoiceitems.test.ts +272 -9
- package/src/__tests__/invoices.test.ts +673 -67
- package/src/__tests__/journalentries.test.ts +490 -8
- package/src/__tests__/leads.test.ts +446 -9
- package/src/__tests__/ledgeraccounts.test.ts +237 -8
- package/src/__tests__/locations.test.ts +298 -9
- package/src/__tests__/messages.test.ts +195 -9
- package/src/__tests__/notes.test.ts +191 -9
- package/src/__tests__/opportunities.test.ts +218 -9
- package/src/__tests__/payments.test.ts +312 -9
- package/src/__tests__/pipelines.test.ts +194 -9
- package/src/__tests__/purchaseorders.test.ts +773 -104
- package/src/__tests__/sharedlinks.test.ts +183 -9
- package/src/__tests__/subsidiaries.test.ts +183 -9
- package/src/__tests__/suppliers.test.ts +505 -9
- package/src/__tests__/taxrates.test.ts +232 -9
- package/src/__tests__/timeoffrequests.test.ts +210 -9
- package/src/__tests__/trackingcategories.test.ts +187 -7
- package/src/__tests__/uploadsessions.test.ts +78 -5
- package/src/__tests__/users.test.ts +356 -9
- package/src/funcs/crmCompaniesCreate.ts +1 -1
- package/src/funcs/crmCompaniesUpdate.ts +1 -1
- package/src/lib/config.ts +4 -4
- package/src/models/components/bankaccount.ts +7 -0
- package/src/models/components/bankaccount1.ts +207 -0
- package/src/models/components/{company.ts → company1.ts} +131 -128
- package/src/models/components/companyinfo.ts +9 -0
- package/src/models/components/getcompaniesresponse.ts +9 -9
- package/src/models/components/getcompanyresponse.ts +9 -9
- package/src/models/components/index.ts +2 -1
- package/src/models/components/ledgeraccount.ts +25 -19
- package/src/models/components/ledgeraccountsfilter.ts +49 -0
- package/src/models/components/supplier.ts +14 -0
- package/src/models/errors/apierror.ts +8 -2
- package/src/models/errors/badrequestresponse.ts +1 -1
- package/src/models/errors/notfoundresponse.ts +1 -1
- package/src/models/errors/paymentrequiredresponse.ts +1 -1
- package/src/models/errors/unauthorizedresponse.ts +1 -1
- package/src/models/errors/unprocessableresponse.ts +1 -1
- package/src/models/operations/crmcompaniesadd.ts +6 -6
- package/src/models/operations/crmcompaniesupdate.ts +6 -6
- package/models/components/company.d.ts.map +0 -1
- package/models/components/company.js.map +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { expect, test } from "vitest";
|
|
6
6
|
import { Apideck } from "../index.js";
|
|
7
7
|
import { createTestHTTPClient } from "./testclient.js";
|
|
8
8
|
|
|
@@ -237,10 +237,88 @@ test("Messages Sms Messages All", async () => {
|
|
|
237
237
|
});
|
|
238
238
|
});
|
|
239
239
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
240
|
+
test("Messages Sms Messages Add", async () => {
|
|
241
|
+
const testHttpClient = createTestHTTPClient("sms.messagesAdd");
|
|
242
|
+
|
|
243
|
+
const apideck = new Apideck({
|
|
244
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
245
|
+
httpClient: testHttpClient,
|
|
246
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
const result = await apideck.sms.messages.create({
|
|
250
|
+
consumerId: "test-consumer",
|
|
251
|
+
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
|
|
252
|
+
serviceId: "salesforce",
|
|
253
|
+
message: {
|
|
254
|
+
from: "+15017122661",
|
|
255
|
+
to: "+15017122662",
|
|
256
|
+
subject: "Picture",
|
|
257
|
+
body: "Hi! How are you doing?",
|
|
258
|
+
type: "sms",
|
|
259
|
+
scheduledAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
260
|
+
webhookUrl:
|
|
261
|
+
"https://unify.apideck.com/webhook/webhooks/eyz329dkffdl4949/x/sms",
|
|
262
|
+
reference: "CUST001",
|
|
263
|
+
messagingServiceId: "123456",
|
|
264
|
+
passThrough: [
|
|
265
|
+
{
|
|
266
|
+
serviceId: "<id>",
|
|
267
|
+
extendPaths: [
|
|
268
|
+
{
|
|
269
|
+
path: "$.nested.property",
|
|
270
|
+
value: {
|
|
271
|
+
"TaxClassificationRef": {
|
|
272
|
+
"value": "EUC-99990201-V1-00020000",
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
path: "$.nested.property",
|
|
278
|
+
value: {
|
|
279
|
+
"TaxClassificationRef": {
|
|
280
|
+
"value": "EUC-99990201-V1-00020000",
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
],
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
serviceId: "<id>",
|
|
288
|
+
extendPaths: [
|
|
289
|
+
{
|
|
290
|
+
path: "$.nested.property",
|
|
291
|
+
value: {
|
|
292
|
+
"TaxClassificationRef": {
|
|
293
|
+
"value": "EUC-99990201-V1-00020000",
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
path: "$.nested.property",
|
|
299
|
+
value: {
|
|
300
|
+
"TaxClassificationRef": {
|
|
301
|
+
"value": "EUC-99990201-V1-00020000",
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
],
|
|
306
|
+
},
|
|
307
|
+
],
|
|
308
|
+
},
|
|
309
|
+
});
|
|
310
|
+
expect(result.httpMeta.response.status).toBe(201);
|
|
311
|
+
expect(result.createMessageResponse).toBeDefined();
|
|
312
|
+
expect(result.createMessageResponse).toEqual({
|
|
313
|
+
statusCode: 200,
|
|
314
|
+
status: "OK",
|
|
315
|
+
service: "twilio",
|
|
316
|
+
resource: "Messages",
|
|
317
|
+
operation: "add",
|
|
318
|
+
data: {
|
|
319
|
+
id: "12345",
|
|
320
|
+
},
|
|
321
|
+
});
|
|
244
322
|
});
|
|
245
323
|
|
|
246
324
|
test("Messages Sms Messages One", async () => {
|
|
@@ -366,10 +444,118 @@ test("Messages Sms Messages One", async () => {
|
|
|
366
444
|
});
|
|
367
445
|
});
|
|
368
446
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
447
|
+
test("Messages Sms Messages Update", async () => {
|
|
448
|
+
const testHttpClient = createTestHTTPClient("sms.messagesUpdate");
|
|
449
|
+
|
|
450
|
+
const apideck = new Apideck({
|
|
451
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
452
|
+
httpClient: testHttpClient,
|
|
453
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
454
|
+
});
|
|
455
|
+
|
|
456
|
+
const result = await apideck.sms.messages.update({
|
|
457
|
+
id: "<id>",
|
|
458
|
+
consumerId: "test-consumer",
|
|
459
|
+
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
|
|
460
|
+
serviceId: "salesforce",
|
|
461
|
+
message: {
|
|
462
|
+
from: "+15017122661",
|
|
463
|
+
to: "+15017122662",
|
|
464
|
+
subject: "Picture",
|
|
465
|
+
body: "Hi! How are you doing?",
|
|
466
|
+
type: "sms",
|
|
467
|
+
scheduledAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
468
|
+
webhookUrl:
|
|
469
|
+
"https://unify.apideck.com/webhook/webhooks/eyz329dkffdl4949/x/sms",
|
|
470
|
+
reference: "CUST001",
|
|
471
|
+
messagingServiceId: "123456",
|
|
472
|
+
passThrough: [
|
|
473
|
+
{
|
|
474
|
+
serviceId: "<id>",
|
|
475
|
+
extendPaths: [
|
|
476
|
+
{
|
|
477
|
+
path: "$.nested.property",
|
|
478
|
+
value: {
|
|
479
|
+
"TaxClassificationRef": {
|
|
480
|
+
"value": "EUC-99990201-V1-00020000",
|
|
481
|
+
},
|
|
482
|
+
},
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
path: "$.nested.property",
|
|
486
|
+
value: {
|
|
487
|
+
"TaxClassificationRef": {
|
|
488
|
+
"value": "EUC-99990201-V1-00020000",
|
|
489
|
+
},
|
|
490
|
+
},
|
|
491
|
+
},
|
|
492
|
+
],
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
serviceId: "<id>",
|
|
496
|
+
extendPaths: [
|
|
497
|
+
{
|
|
498
|
+
path: "$.nested.property",
|
|
499
|
+
value: {
|
|
500
|
+
"TaxClassificationRef": {
|
|
501
|
+
"value": "EUC-99990201-V1-00020000",
|
|
502
|
+
},
|
|
503
|
+
},
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
path: "$.nested.property",
|
|
507
|
+
value: {
|
|
508
|
+
"TaxClassificationRef": {
|
|
509
|
+
"value": "EUC-99990201-V1-00020000",
|
|
510
|
+
},
|
|
511
|
+
},
|
|
512
|
+
},
|
|
513
|
+
],
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
serviceId: "<id>",
|
|
517
|
+
extendPaths: [
|
|
518
|
+
{
|
|
519
|
+
path: "$.nested.property",
|
|
520
|
+
value: {
|
|
521
|
+
"TaxClassificationRef": {
|
|
522
|
+
"value": "EUC-99990201-V1-00020000",
|
|
523
|
+
},
|
|
524
|
+
},
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
path: "$.nested.property",
|
|
528
|
+
value: {
|
|
529
|
+
"TaxClassificationRef": {
|
|
530
|
+
"value": "EUC-99990201-V1-00020000",
|
|
531
|
+
},
|
|
532
|
+
},
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
path: "$.nested.property",
|
|
536
|
+
value: {
|
|
537
|
+
"TaxClassificationRef": {
|
|
538
|
+
"value": "EUC-99990201-V1-00020000",
|
|
539
|
+
},
|
|
540
|
+
},
|
|
541
|
+
},
|
|
542
|
+
],
|
|
543
|
+
},
|
|
544
|
+
],
|
|
545
|
+
},
|
|
546
|
+
});
|
|
547
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
548
|
+
expect(result.updateMessageResponse).toBeDefined();
|
|
549
|
+
expect(result.updateMessageResponse).toEqual({
|
|
550
|
+
statusCode: 200,
|
|
551
|
+
status: "OK",
|
|
552
|
+
service: "twilio",
|
|
553
|
+
resource: "Messages",
|
|
554
|
+
operation: "update",
|
|
555
|
+
data: {
|
|
556
|
+
id: "12345",
|
|
557
|
+
},
|
|
558
|
+
});
|
|
373
559
|
});
|
|
374
560
|
|
|
375
561
|
test("Messages Sms Messages Delete", async () => {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { expect, test } from "vitest";
|
|
6
6
|
import { Apideck } from "../index.js";
|
|
7
7
|
import { createTestHTTPClient } from "./testclient.js";
|
|
8
8
|
|
|
@@ -192,10 +192,86 @@ test("Notes Crm Notes All", async () => {
|
|
|
192
192
|
});
|
|
193
193
|
});
|
|
194
194
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
195
|
+
test("Notes Crm Notes Add", async () => {
|
|
196
|
+
const testHttpClient = createTestHTTPClient("crm.notesAdd");
|
|
197
|
+
|
|
198
|
+
const apideck = new Apideck({
|
|
199
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
200
|
+
httpClient: testHttpClient,
|
|
201
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
const result = await apideck.crm.notes.create({
|
|
205
|
+
consumerId: "test-consumer",
|
|
206
|
+
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
|
|
207
|
+
serviceId: "salesforce",
|
|
208
|
+
note: {
|
|
209
|
+
title: "Meeting Notes",
|
|
210
|
+
content: "Office hours are 9AM-6PM",
|
|
211
|
+
ownerId: "12345",
|
|
212
|
+
contactId: "12345",
|
|
213
|
+
companyId: "12345",
|
|
214
|
+
opportunityId: "12345",
|
|
215
|
+
leadId: "12345",
|
|
216
|
+
active: true,
|
|
217
|
+
passThrough: [
|
|
218
|
+
{
|
|
219
|
+
serviceId: "<id>",
|
|
220
|
+
extendPaths: [
|
|
221
|
+
{
|
|
222
|
+
path: "$.nested.property",
|
|
223
|
+
value: {
|
|
224
|
+
"TaxClassificationRef": {
|
|
225
|
+
"value": "EUC-99990201-V1-00020000",
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
path: "$.nested.property",
|
|
231
|
+
value: {
|
|
232
|
+
"TaxClassificationRef": {
|
|
233
|
+
"value": "EUC-99990201-V1-00020000",
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
serviceId: "<id>",
|
|
241
|
+
extendPaths: [
|
|
242
|
+
{
|
|
243
|
+
path: "$.nested.property",
|
|
244
|
+
value: {
|
|
245
|
+
"TaxClassificationRef": {
|
|
246
|
+
"value": "EUC-99990201-V1-00020000",
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
path: "$.nested.property",
|
|
252
|
+
value: {
|
|
253
|
+
"TaxClassificationRef": {
|
|
254
|
+
"value": "EUC-99990201-V1-00020000",
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
],
|
|
259
|
+
},
|
|
260
|
+
],
|
|
261
|
+
},
|
|
262
|
+
});
|
|
263
|
+
expect(result.httpMeta.response.status).toBe(201);
|
|
264
|
+
expect(result.createNoteResponse).toBeDefined();
|
|
265
|
+
expect(result.createNoteResponse).toEqual({
|
|
266
|
+
statusCode: 200,
|
|
267
|
+
status: "OK",
|
|
268
|
+
service: "zoho-crm",
|
|
269
|
+
resource: "notes",
|
|
270
|
+
operation: "add",
|
|
271
|
+
data: {
|
|
272
|
+
id: "12345",
|
|
273
|
+
},
|
|
274
|
+
});
|
|
199
275
|
});
|
|
200
276
|
|
|
201
277
|
test("Notes Crm Notes One", async () => {
|
|
@@ -305,10 +381,116 @@ test("Notes Crm Notes One", async () => {
|
|
|
305
381
|
});
|
|
306
382
|
});
|
|
307
383
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
384
|
+
test("Notes Crm Notes Update", async () => {
|
|
385
|
+
const testHttpClient = createTestHTTPClient("crm.notesUpdate");
|
|
386
|
+
|
|
387
|
+
const apideck = new Apideck({
|
|
388
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
389
|
+
httpClient: testHttpClient,
|
|
390
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
const result = await apideck.crm.notes.update({
|
|
394
|
+
id: "<id>",
|
|
395
|
+
consumerId: "test-consumer",
|
|
396
|
+
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
|
|
397
|
+
serviceId: "salesforce",
|
|
398
|
+
note: {
|
|
399
|
+
title: "Meeting Notes",
|
|
400
|
+
content: "Office hours are 9AM-6PM",
|
|
401
|
+
ownerId: "12345",
|
|
402
|
+
contactId: "12345",
|
|
403
|
+
companyId: "12345",
|
|
404
|
+
opportunityId: "12345",
|
|
405
|
+
leadId: "12345",
|
|
406
|
+
active: true,
|
|
407
|
+
passThrough: [
|
|
408
|
+
{
|
|
409
|
+
serviceId: "<id>",
|
|
410
|
+
extendPaths: [
|
|
411
|
+
{
|
|
412
|
+
path: "$.nested.property",
|
|
413
|
+
value: {
|
|
414
|
+
"TaxClassificationRef": {
|
|
415
|
+
"value": "EUC-99990201-V1-00020000",
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
path: "$.nested.property",
|
|
421
|
+
value: {
|
|
422
|
+
"TaxClassificationRef": {
|
|
423
|
+
"value": "EUC-99990201-V1-00020000",
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
},
|
|
427
|
+
],
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
serviceId: "<id>",
|
|
431
|
+
extendPaths: [
|
|
432
|
+
{
|
|
433
|
+
path: "$.nested.property",
|
|
434
|
+
value: {
|
|
435
|
+
"TaxClassificationRef": {
|
|
436
|
+
"value": "EUC-99990201-V1-00020000",
|
|
437
|
+
},
|
|
438
|
+
},
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
path: "$.nested.property",
|
|
442
|
+
value: {
|
|
443
|
+
"TaxClassificationRef": {
|
|
444
|
+
"value": "EUC-99990201-V1-00020000",
|
|
445
|
+
},
|
|
446
|
+
},
|
|
447
|
+
},
|
|
448
|
+
],
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
serviceId: "<id>",
|
|
452
|
+
extendPaths: [
|
|
453
|
+
{
|
|
454
|
+
path: "$.nested.property",
|
|
455
|
+
value: {
|
|
456
|
+
"TaxClassificationRef": {
|
|
457
|
+
"value": "EUC-99990201-V1-00020000",
|
|
458
|
+
},
|
|
459
|
+
},
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
path: "$.nested.property",
|
|
463
|
+
value: {
|
|
464
|
+
"TaxClassificationRef": {
|
|
465
|
+
"value": "EUC-99990201-V1-00020000",
|
|
466
|
+
},
|
|
467
|
+
},
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
path: "$.nested.property",
|
|
471
|
+
value: {
|
|
472
|
+
"TaxClassificationRef": {
|
|
473
|
+
"value": "EUC-99990201-V1-00020000",
|
|
474
|
+
},
|
|
475
|
+
},
|
|
476
|
+
},
|
|
477
|
+
],
|
|
478
|
+
},
|
|
479
|
+
],
|
|
480
|
+
},
|
|
481
|
+
});
|
|
482
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
483
|
+
expect(result.updateNoteResponse).toBeDefined();
|
|
484
|
+
expect(result.updateNoteResponse).toEqual({
|
|
485
|
+
statusCode: 200,
|
|
486
|
+
status: "OK",
|
|
487
|
+
service: "zoho-crm",
|
|
488
|
+
resource: "notes",
|
|
489
|
+
operation: "update",
|
|
490
|
+
data: {
|
|
491
|
+
id: "12345",
|
|
492
|
+
},
|
|
493
|
+
});
|
|
312
494
|
});
|
|
313
495
|
|
|
314
496
|
test("Notes Crm Notes Delete", async () => {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { expect, test } from "vitest";
|
|
6
6
|
import { Apideck } from "../index.js";
|
|
7
7
|
import { RFCDate } from "../types/index.js";
|
|
8
8
|
import { createTestHTTPClient } from "./testclient.js";
|
|
@@ -318,10 +318,95 @@ test("Opportunities Crm Opportunities All", async () => {
|
|
|
318
318
|
});
|
|
319
319
|
});
|
|
320
320
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
321
|
+
test("Opportunities Crm Opportunities Add", async () => {
|
|
322
|
+
const testHttpClient = createTestHTTPClient("crm.opportunitiesAdd");
|
|
323
|
+
|
|
324
|
+
const apideck = new Apideck({
|
|
325
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
326
|
+
httpClient: testHttpClient,
|
|
327
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
const result = await apideck.crm.opportunities.create({
|
|
331
|
+
consumerId: "test-consumer",
|
|
332
|
+
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
|
|
333
|
+
serviceId: "salesforce",
|
|
334
|
+
opportunity: {
|
|
335
|
+
title: "New Rocket",
|
|
336
|
+
primaryContactId: "12345",
|
|
337
|
+
description:
|
|
338
|
+
"Opportunities are created for People and Companies that are interested in buying your products or services. Create Opportunities for People and Companies to move them through one of your Pipelines.",
|
|
339
|
+
type: "Existing Customer - Upgrade",
|
|
340
|
+
monetaryAmount: 75000,
|
|
341
|
+
currency: "USD",
|
|
342
|
+
winProbability: 40,
|
|
343
|
+
closeDate: new RFCDate("2020-10-30"),
|
|
344
|
+
lossReasonId: "12345",
|
|
345
|
+
lossReason: "No budget",
|
|
346
|
+
wonReasonId: "12345",
|
|
347
|
+
wonReason: "Best pitch",
|
|
348
|
+
pipelineId: "12345",
|
|
349
|
+
pipelineStageId: "12345",
|
|
350
|
+
sourceId: "12345",
|
|
351
|
+
leadId: "12345",
|
|
352
|
+
leadSource: "Website",
|
|
353
|
+
contactId: "12345",
|
|
354
|
+
contactIds: [
|
|
355
|
+
"12345",
|
|
356
|
+
],
|
|
357
|
+
companyId: "12345",
|
|
358
|
+
companyName: "Copper",
|
|
359
|
+
ownerId: "12345",
|
|
360
|
+
priority: "None",
|
|
361
|
+
status: "Open",
|
|
362
|
+
statusId: "12345",
|
|
363
|
+
tags: [
|
|
364
|
+
"New",
|
|
365
|
+
],
|
|
366
|
+
customFields: [
|
|
367
|
+
{
|
|
368
|
+
id: "2389328923893298",
|
|
369
|
+
name: "employee_level",
|
|
370
|
+
description: "Employee Level",
|
|
371
|
+
value: {},
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
id: "2389328923893298",
|
|
375
|
+
name: "employee_level",
|
|
376
|
+
description: "Employee Level",
|
|
377
|
+
value: true,
|
|
378
|
+
},
|
|
379
|
+
],
|
|
380
|
+
stageLastChangedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
381
|
+
passThrough: [
|
|
382
|
+
{
|
|
383
|
+
serviceId: "<id>",
|
|
384
|
+
extendPaths: [
|
|
385
|
+
{
|
|
386
|
+
path: "$.nested.property",
|
|
387
|
+
value: {
|
|
388
|
+
"TaxClassificationRef": {
|
|
389
|
+
"value": "EUC-99990201-V1-00020000",
|
|
390
|
+
},
|
|
391
|
+
},
|
|
392
|
+
},
|
|
393
|
+
],
|
|
394
|
+
},
|
|
395
|
+
],
|
|
396
|
+
},
|
|
397
|
+
});
|
|
398
|
+
expect(result.httpMeta.response.status).toBe(201);
|
|
399
|
+
expect(result.createOpportunityResponse).toBeDefined();
|
|
400
|
+
expect(result.createOpportunityResponse).toEqual({
|
|
401
|
+
statusCode: 200,
|
|
402
|
+
status: "OK",
|
|
403
|
+
service: "zoho-crm",
|
|
404
|
+
resource: "opportunities",
|
|
405
|
+
operation: "add",
|
|
406
|
+
data: {
|
|
407
|
+
id: "12345",
|
|
408
|
+
},
|
|
409
|
+
});
|
|
325
410
|
});
|
|
326
411
|
|
|
327
412
|
test("Opportunities Crm Opportunities One", async () => {
|
|
@@ -474,10 +559,134 @@ test("Opportunities Crm Opportunities One", async () => {
|
|
|
474
559
|
});
|
|
475
560
|
});
|
|
476
561
|
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
562
|
+
test("Opportunities Crm Opportunities Update", async () => {
|
|
563
|
+
const testHttpClient = createTestHTTPClient("crm.opportunitiesUpdate");
|
|
564
|
+
|
|
565
|
+
const apideck = new Apideck({
|
|
566
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
567
|
+
httpClient: testHttpClient,
|
|
568
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
569
|
+
});
|
|
570
|
+
|
|
571
|
+
const result = await apideck.crm.opportunities.update({
|
|
572
|
+
id: "<id>",
|
|
573
|
+
consumerId: "test-consumer",
|
|
574
|
+
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
|
|
575
|
+
serviceId: "salesforce",
|
|
576
|
+
opportunity: {
|
|
577
|
+
title: "New Rocket",
|
|
578
|
+
primaryContactId: "12345",
|
|
579
|
+
description:
|
|
580
|
+
"Opportunities are created for People and Companies that are interested in buying your products or services. Create Opportunities for People and Companies to move them through one of your Pipelines.",
|
|
581
|
+
type: "Existing Customer - Upgrade",
|
|
582
|
+
monetaryAmount: 75000,
|
|
583
|
+
currency: "USD",
|
|
584
|
+
winProbability: 40,
|
|
585
|
+
closeDate: new RFCDate("2020-10-30"),
|
|
586
|
+
lossReasonId: "12345",
|
|
587
|
+
lossReason: "No budget",
|
|
588
|
+
wonReasonId: "12345",
|
|
589
|
+
wonReason: "Best pitch",
|
|
590
|
+
pipelineId: "12345",
|
|
591
|
+
pipelineStageId: "12345",
|
|
592
|
+
sourceId: "12345",
|
|
593
|
+
leadId: "12345",
|
|
594
|
+
leadSource: "Website",
|
|
595
|
+
contactId: "12345",
|
|
596
|
+
contactIds: [
|
|
597
|
+
"12345",
|
|
598
|
+
],
|
|
599
|
+
companyId: "12345",
|
|
600
|
+
companyName: "Copper",
|
|
601
|
+
ownerId: "12345",
|
|
602
|
+
priority: "None",
|
|
603
|
+
status: "Open",
|
|
604
|
+
statusId: "12345",
|
|
605
|
+
tags: [
|
|
606
|
+
"New",
|
|
607
|
+
],
|
|
608
|
+
customFields: [
|
|
609
|
+
{
|
|
610
|
+
id: "2389328923893298",
|
|
611
|
+
name: "employee_level",
|
|
612
|
+
description: "Employee Level",
|
|
613
|
+
value: {},
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
id: "2389328923893298",
|
|
617
|
+
name: "employee_level",
|
|
618
|
+
description: "Employee Level",
|
|
619
|
+
value: true,
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
id: "2389328923893298",
|
|
623
|
+
name: "employee_level",
|
|
624
|
+
description: "Employee Level",
|
|
625
|
+
value: [
|
|
626
|
+
{},
|
|
627
|
+
{},
|
|
628
|
+
],
|
|
629
|
+
},
|
|
630
|
+
],
|
|
631
|
+
stageLastChangedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
632
|
+
passThrough: [
|
|
633
|
+
{
|
|
634
|
+
serviceId: "<id>",
|
|
635
|
+
extendPaths: [
|
|
636
|
+
{
|
|
637
|
+
path: "$.nested.property",
|
|
638
|
+
value: {
|
|
639
|
+
"TaxClassificationRef": {
|
|
640
|
+
"value": "EUC-99990201-V1-00020000",
|
|
641
|
+
},
|
|
642
|
+
},
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
path: "$.nested.property",
|
|
646
|
+
value: {
|
|
647
|
+
"TaxClassificationRef": {
|
|
648
|
+
"value": "EUC-99990201-V1-00020000",
|
|
649
|
+
},
|
|
650
|
+
},
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
path: "$.nested.property",
|
|
654
|
+
value: {
|
|
655
|
+
"TaxClassificationRef": {
|
|
656
|
+
"value": "EUC-99990201-V1-00020000",
|
|
657
|
+
},
|
|
658
|
+
},
|
|
659
|
+
},
|
|
660
|
+
],
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
serviceId: "<id>",
|
|
664
|
+
extendPaths: [
|
|
665
|
+
{
|
|
666
|
+
path: "$.nested.property",
|
|
667
|
+
value: {
|
|
668
|
+
"TaxClassificationRef": {
|
|
669
|
+
"value": "EUC-99990201-V1-00020000",
|
|
670
|
+
},
|
|
671
|
+
},
|
|
672
|
+
},
|
|
673
|
+
],
|
|
674
|
+
},
|
|
675
|
+
],
|
|
676
|
+
},
|
|
677
|
+
});
|
|
678
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
679
|
+
expect(result.updateOpportunityResponse).toBeDefined();
|
|
680
|
+
expect(result.updateOpportunityResponse).toEqual({
|
|
681
|
+
statusCode: 200,
|
|
682
|
+
status: "OK",
|
|
683
|
+
service: "zoho-crm",
|
|
684
|
+
resource: "companies",
|
|
685
|
+
operation: "update",
|
|
686
|
+
data: {
|
|
687
|
+
id: "12345",
|
|
688
|
+
},
|
|
689
|
+
});
|
|
481
690
|
});
|
|
482
691
|
|
|
483
692
|
test("Opportunities Crm Opportunities Delete", async () => {
|