@apideck/unify 0.27.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/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/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
|
|
|
@@ -384,10 +384,153 @@ test("Payments Accounting Payments All", async () => {
|
|
|
384
384
|
});
|
|
385
385
|
});
|
|
386
386
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
387
|
+
test("Payments Accounting Payments Add", async () => {
|
|
388
|
+
const testHttpClient = createTestHTTPClient("accounting.paymentsAdd");
|
|
389
|
+
|
|
390
|
+
const apideck = new Apideck({
|
|
391
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
392
|
+
httpClient: testHttpClient,
|
|
393
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
const result = await apideck.accounting.payments.create({
|
|
397
|
+
consumerId: "test-consumer",
|
|
398
|
+
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
|
|
399
|
+
serviceId: "salesforce",
|
|
400
|
+
payment: {
|
|
401
|
+
currency: "USD",
|
|
402
|
+
currencyRate: 0.69,
|
|
403
|
+
totalAmount: 49.99,
|
|
404
|
+
reference: "123456",
|
|
405
|
+
paymentMethod: "cash",
|
|
406
|
+
paymentMethodReference: "123456",
|
|
407
|
+
paymentMethodId: "12345",
|
|
408
|
+
account: {
|
|
409
|
+
id: "123456",
|
|
410
|
+
nominalCode: "N091",
|
|
411
|
+
code: "453",
|
|
412
|
+
},
|
|
413
|
+
transactionDate: new Date("2021-05-01T12:00:00.000Z"),
|
|
414
|
+
customer: {
|
|
415
|
+
id: "12345",
|
|
416
|
+
displayName: "Windsurf Shop",
|
|
417
|
+
email: "boring@boring.com",
|
|
418
|
+
},
|
|
419
|
+
companyId: "12345",
|
|
420
|
+
reconciled: true,
|
|
421
|
+
status: "authorised",
|
|
422
|
+
type: "accounts_receivable",
|
|
423
|
+
allocations: [
|
|
424
|
+
{
|
|
425
|
+
id: "123456",
|
|
426
|
+
amount: 49.99,
|
|
427
|
+
allocationId: "123456",
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
id: "123456",
|
|
431
|
+
amount: 49.99,
|
|
432
|
+
allocationId: "123456",
|
|
433
|
+
},
|
|
434
|
+
],
|
|
435
|
+
note: "Some notes about this transaction",
|
|
436
|
+
number: "123456",
|
|
437
|
+
trackingCategories: [
|
|
438
|
+
{
|
|
439
|
+
id: "123456",
|
|
440
|
+
name: "New York",
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
id: "123456",
|
|
444
|
+
name: "New York",
|
|
445
|
+
},
|
|
446
|
+
],
|
|
447
|
+
customFields: [
|
|
448
|
+
{
|
|
449
|
+
id: "2389328923893298",
|
|
450
|
+
name: "employee_level",
|
|
451
|
+
description: "Employee Level",
|
|
452
|
+
value: "Uses Salesforce and Marketo",
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
id: "2389328923893298",
|
|
456
|
+
name: "employee_level",
|
|
457
|
+
description: "Employee Level",
|
|
458
|
+
value: "Uses Salesforce and Marketo",
|
|
459
|
+
},
|
|
460
|
+
],
|
|
461
|
+
rowVersion: "1-12345",
|
|
462
|
+
displayId: "123456",
|
|
463
|
+
passThrough: [
|
|
464
|
+
{
|
|
465
|
+
serviceId: "<id>",
|
|
466
|
+
extendPaths: [
|
|
467
|
+
{
|
|
468
|
+
path: "$.nested.property",
|
|
469
|
+
value: {
|
|
470
|
+
"TaxClassificationRef": {
|
|
471
|
+
"value": "EUC-99990201-V1-00020000",
|
|
472
|
+
},
|
|
473
|
+
},
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
path: "$.nested.property",
|
|
477
|
+
value: {
|
|
478
|
+
"TaxClassificationRef": {
|
|
479
|
+
"value": "EUC-99990201-V1-00020000",
|
|
480
|
+
},
|
|
481
|
+
},
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
path: "$.nested.property",
|
|
485
|
+
value: {
|
|
486
|
+
"TaxClassificationRef": {
|
|
487
|
+
"value": "EUC-99990201-V1-00020000",
|
|
488
|
+
},
|
|
489
|
+
},
|
|
490
|
+
},
|
|
491
|
+
],
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
serviceId: "<id>",
|
|
495
|
+
extendPaths: [
|
|
496
|
+
{
|
|
497
|
+
path: "$.nested.property",
|
|
498
|
+
value: {
|
|
499
|
+
"TaxClassificationRef": {
|
|
500
|
+
"value": "EUC-99990201-V1-00020000",
|
|
501
|
+
},
|
|
502
|
+
},
|
|
503
|
+
},
|
|
504
|
+
],
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
serviceId: "<id>",
|
|
508
|
+
extendPaths: [
|
|
509
|
+
{
|
|
510
|
+
path: "$.nested.property",
|
|
511
|
+
value: {
|
|
512
|
+
"TaxClassificationRef": {
|
|
513
|
+
"value": "EUC-99990201-V1-00020000",
|
|
514
|
+
},
|
|
515
|
+
},
|
|
516
|
+
},
|
|
517
|
+
],
|
|
518
|
+
},
|
|
519
|
+
],
|
|
520
|
+
},
|
|
521
|
+
});
|
|
522
|
+
expect(result.httpMeta.response.status).toBe(201);
|
|
523
|
+
expect(result.createPaymentResponse).toBeDefined();
|
|
524
|
+
expect(result.createPaymentResponse).toEqual({
|
|
525
|
+
statusCode: 200,
|
|
526
|
+
status: "OK",
|
|
527
|
+
service: "xero",
|
|
528
|
+
resource: "payments",
|
|
529
|
+
operation: "add",
|
|
530
|
+
data: {
|
|
531
|
+
id: "12345",
|
|
532
|
+
},
|
|
533
|
+
});
|
|
391
534
|
});
|
|
392
535
|
|
|
393
536
|
test("Payments Accounting Payments One", async () => {
|
|
@@ -528,10 +671,170 @@ test("Payments Accounting Payments One", async () => {
|
|
|
528
671
|
});
|
|
529
672
|
});
|
|
530
673
|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
674
|
+
test("Payments Accounting Payments Update", async () => {
|
|
675
|
+
const testHttpClient = createTestHTTPClient("accounting.paymentsUpdate");
|
|
676
|
+
|
|
677
|
+
const apideck = new Apideck({
|
|
678
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
679
|
+
httpClient: testHttpClient,
|
|
680
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
681
|
+
});
|
|
682
|
+
|
|
683
|
+
const result = await apideck.accounting.payments.update({
|
|
684
|
+
id: "<id>",
|
|
685
|
+
consumerId: "test-consumer",
|
|
686
|
+
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
|
|
687
|
+
serviceId: "salesforce",
|
|
688
|
+
payment: {
|
|
689
|
+
currency: "USD",
|
|
690
|
+
currencyRate: 0.69,
|
|
691
|
+
totalAmount: 49.99,
|
|
692
|
+
reference: "123456",
|
|
693
|
+
paymentMethod: "cash",
|
|
694
|
+
paymentMethodReference: "123456",
|
|
695
|
+
paymentMethodId: "12345",
|
|
696
|
+
account: {
|
|
697
|
+
id: "123456",
|
|
698
|
+
nominalCode: "N091",
|
|
699
|
+
code: "453",
|
|
700
|
+
},
|
|
701
|
+
transactionDate: new Date("2021-05-01T12:00:00.000Z"),
|
|
702
|
+
customer: {
|
|
703
|
+
id: "12345",
|
|
704
|
+
displayName: "Windsurf Shop",
|
|
705
|
+
email: "boring@boring.com",
|
|
706
|
+
},
|
|
707
|
+
companyId: "12345",
|
|
708
|
+
reconciled: true,
|
|
709
|
+
status: "authorised",
|
|
710
|
+
type: "accounts_receivable",
|
|
711
|
+
allocations: [
|
|
712
|
+
{
|
|
713
|
+
id: "123456",
|
|
714
|
+
amount: 49.99,
|
|
715
|
+
allocationId: "123456",
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
id: "123456",
|
|
719
|
+
amount: 49.99,
|
|
720
|
+
allocationId: "123456",
|
|
721
|
+
},
|
|
722
|
+
{
|
|
723
|
+
id: "123456",
|
|
724
|
+
amount: 49.99,
|
|
725
|
+
allocationId: "123456",
|
|
726
|
+
},
|
|
727
|
+
],
|
|
728
|
+
note: "Some notes about this transaction",
|
|
729
|
+
number: "123456",
|
|
730
|
+
trackingCategories: [
|
|
731
|
+
{
|
|
732
|
+
id: "123456",
|
|
733
|
+
name: "New York",
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
id: "123456",
|
|
737
|
+
name: "New York",
|
|
738
|
+
},
|
|
739
|
+
],
|
|
740
|
+
customFields: [
|
|
741
|
+
{
|
|
742
|
+
id: "2389328923893298",
|
|
743
|
+
name: "employee_level",
|
|
744
|
+
description: "Employee Level",
|
|
745
|
+
value: [
|
|
746
|
+
{},
|
|
747
|
+
{},
|
|
748
|
+
],
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
id: "2389328923893298",
|
|
752
|
+
name: "employee_level",
|
|
753
|
+
description: "Employee Level",
|
|
754
|
+
value: true,
|
|
755
|
+
},
|
|
756
|
+
],
|
|
757
|
+
rowVersion: "1-12345",
|
|
758
|
+
displayId: "123456",
|
|
759
|
+
passThrough: [
|
|
760
|
+
{
|
|
761
|
+
serviceId: "<id>",
|
|
762
|
+
extendPaths: [
|
|
763
|
+
{
|
|
764
|
+
path: "$.nested.property",
|
|
765
|
+
value: {
|
|
766
|
+
"TaxClassificationRef": {
|
|
767
|
+
"value": "EUC-99990201-V1-00020000",
|
|
768
|
+
},
|
|
769
|
+
},
|
|
770
|
+
},
|
|
771
|
+
],
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
serviceId: "<id>",
|
|
775
|
+
extendPaths: [
|
|
776
|
+
{
|
|
777
|
+
path: "$.nested.property",
|
|
778
|
+
value: {
|
|
779
|
+
"TaxClassificationRef": {
|
|
780
|
+
"value": "EUC-99990201-V1-00020000",
|
|
781
|
+
},
|
|
782
|
+
},
|
|
783
|
+
},
|
|
784
|
+
{
|
|
785
|
+
path: "$.nested.property",
|
|
786
|
+
value: {
|
|
787
|
+
"TaxClassificationRef": {
|
|
788
|
+
"value": "EUC-99990201-V1-00020000",
|
|
789
|
+
},
|
|
790
|
+
},
|
|
791
|
+
},
|
|
792
|
+
{
|
|
793
|
+
path: "$.nested.property",
|
|
794
|
+
value: {
|
|
795
|
+
"TaxClassificationRef": {
|
|
796
|
+
"value": "EUC-99990201-V1-00020000",
|
|
797
|
+
},
|
|
798
|
+
},
|
|
799
|
+
},
|
|
800
|
+
],
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
serviceId: "<id>",
|
|
804
|
+
extendPaths: [
|
|
805
|
+
{
|
|
806
|
+
path: "$.nested.property",
|
|
807
|
+
value: {
|
|
808
|
+
"TaxClassificationRef": {
|
|
809
|
+
"value": "EUC-99990201-V1-00020000",
|
|
810
|
+
},
|
|
811
|
+
},
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
path: "$.nested.property",
|
|
815
|
+
value: {
|
|
816
|
+
"TaxClassificationRef": {
|
|
817
|
+
"value": "EUC-99990201-V1-00020000",
|
|
818
|
+
},
|
|
819
|
+
},
|
|
820
|
+
},
|
|
821
|
+
],
|
|
822
|
+
},
|
|
823
|
+
],
|
|
824
|
+
},
|
|
825
|
+
});
|
|
826
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
827
|
+
expect(result.updatePaymentResponse).toBeDefined();
|
|
828
|
+
expect(result.updatePaymentResponse).toEqual({
|
|
829
|
+
statusCode: 200,
|
|
830
|
+
status: "OK",
|
|
831
|
+
service: "xero",
|
|
832
|
+
resource: "payments",
|
|
833
|
+
operation: "update",
|
|
834
|
+
data: {
|
|
835
|
+
id: "12345",
|
|
836
|
+
},
|
|
837
|
+
});
|
|
535
838
|
});
|
|
536
839
|
|
|
537
840
|
test("Payments Accounting Payments 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
|
|
|
@@ -242,10 +242,91 @@ test("Pipelines Crm Pipelines All", async () => {
|
|
|
242
242
|
});
|
|
243
243
|
});
|
|
244
244
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
245
|
+
test("Pipelines Crm Pipelines Add", async () => {
|
|
246
|
+
const testHttpClient = createTestHTTPClient("crm.pipelinesAdd");
|
|
247
|
+
|
|
248
|
+
const apideck = new Apideck({
|
|
249
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
250
|
+
httpClient: testHttpClient,
|
|
251
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
const result = await apideck.crm.pipelines.create({
|
|
255
|
+
consumerId: "test-consumer",
|
|
256
|
+
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
|
|
257
|
+
serviceId: "salesforce",
|
|
258
|
+
pipeline: {
|
|
259
|
+
id: "default",
|
|
260
|
+
name: "Sales Pipeline",
|
|
261
|
+
currency: "USD",
|
|
262
|
+
archived: false,
|
|
263
|
+
active: false,
|
|
264
|
+
displayOrder: 1,
|
|
265
|
+
winProbabilityEnabled: true,
|
|
266
|
+
stages: [
|
|
267
|
+
{
|
|
268
|
+
name: "Contract Sent",
|
|
269
|
+
value: "CONTRACT_SENT",
|
|
270
|
+
winProbability: 50,
|
|
271
|
+
displayOrder: 1,
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
name: "Contract Sent",
|
|
275
|
+
value: "CONTRACT_SENT",
|
|
276
|
+
winProbability: 50,
|
|
277
|
+
displayOrder: 1,
|
|
278
|
+
},
|
|
279
|
+
],
|
|
280
|
+
passThrough: [
|
|
281
|
+
{
|
|
282
|
+
serviceId: "<id>",
|
|
283
|
+
extendPaths: [
|
|
284
|
+
{
|
|
285
|
+
path: "$.nested.property",
|
|
286
|
+
value: {
|
|
287
|
+
"TaxClassificationRef": {
|
|
288
|
+
"value": "EUC-99990201-V1-00020000",
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
path: "$.nested.property",
|
|
294
|
+
value: {
|
|
295
|
+
"TaxClassificationRef": {
|
|
296
|
+
"value": "EUC-99990201-V1-00020000",
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
],
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
serviceId: "<id>",
|
|
304
|
+
extendPaths: [
|
|
305
|
+
{
|
|
306
|
+
path: "$.nested.property",
|
|
307
|
+
value: {
|
|
308
|
+
"TaxClassificationRef": {
|
|
309
|
+
"value": "EUC-99990201-V1-00020000",
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
],
|
|
314
|
+
},
|
|
315
|
+
],
|
|
316
|
+
},
|
|
317
|
+
});
|
|
318
|
+
expect(result.httpMeta.response.status).toBe(201);
|
|
319
|
+
expect(result.createPipelineResponse).toBeDefined();
|
|
320
|
+
expect(result.createPipelineResponse).toEqual({
|
|
321
|
+
statusCode: 200,
|
|
322
|
+
status: "OK",
|
|
323
|
+
service: "zoho-crm",
|
|
324
|
+
resource: "pipelines",
|
|
325
|
+
operation: "add",
|
|
326
|
+
data: {
|
|
327
|
+
id: "12345",
|
|
328
|
+
},
|
|
329
|
+
});
|
|
249
330
|
});
|
|
250
331
|
|
|
251
332
|
test("Pipelines Crm Pipelines One", async () => {
|
|
@@ -353,10 +434,114 @@ test("Pipelines Crm Pipelines One", async () => {
|
|
|
353
434
|
});
|
|
354
435
|
});
|
|
355
436
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
437
|
+
test("Pipelines Crm Pipelines Update", async () => {
|
|
438
|
+
const testHttpClient = createTestHTTPClient("crm.pipelinesUpdate");
|
|
439
|
+
|
|
440
|
+
const apideck = new Apideck({
|
|
441
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
442
|
+
httpClient: testHttpClient,
|
|
443
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
const result = await apideck.crm.pipelines.update({
|
|
447
|
+
id: "<id>",
|
|
448
|
+
consumerId: "test-consumer",
|
|
449
|
+
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
|
|
450
|
+
serviceId: "salesforce",
|
|
451
|
+
pipeline: {
|
|
452
|
+
id: "default",
|
|
453
|
+
name: "Sales Pipeline",
|
|
454
|
+
currency: "USD",
|
|
455
|
+
archived: false,
|
|
456
|
+
active: false,
|
|
457
|
+
displayOrder: 1,
|
|
458
|
+
winProbabilityEnabled: true,
|
|
459
|
+
stages: [
|
|
460
|
+
{
|
|
461
|
+
name: "Contract Sent",
|
|
462
|
+
value: "CONTRACT_SENT",
|
|
463
|
+
winProbability: 50,
|
|
464
|
+
displayOrder: 1,
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
name: "Contract Sent",
|
|
468
|
+
value: "CONTRACT_SENT",
|
|
469
|
+
winProbability: 50,
|
|
470
|
+
displayOrder: 1,
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
name: "Contract Sent",
|
|
474
|
+
value: "CONTRACT_SENT",
|
|
475
|
+
winProbability: 50,
|
|
476
|
+
displayOrder: 1,
|
|
477
|
+
},
|
|
478
|
+
],
|
|
479
|
+
passThrough: [
|
|
480
|
+
{
|
|
481
|
+
serviceId: "<id>",
|
|
482
|
+
extendPaths: [
|
|
483
|
+
{
|
|
484
|
+
path: "$.nested.property",
|
|
485
|
+
value: {
|
|
486
|
+
"TaxClassificationRef": {
|
|
487
|
+
"value": "EUC-99990201-V1-00020000",
|
|
488
|
+
},
|
|
489
|
+
},
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
path: "$.nested.property",
|
|
493
|
+
value: {
|
|
494
|
+
"TaxClassificationRef": {
|
|
495
|
+
"value": "EUC-99990201-V1-00020000",
|
|
496
|
+
},
|
|
497
|
+
},
|
|
498
|
+
},
|
|
499
|
+
],
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
serviceId: "<id>",
|
|
503
|
+
extendPaths: [
|
|
504
|
+
{
|
|
505
|
+
path: "$.nested.property",
|
|
506
|
+
value: {
|
|
507
|
+
"TaxClassificationRef": {
|
|
508
|
+
"value": "EUC-99990201-V1-00020000",
|
|
509
|
+
},
|
|
510
|
+
},
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
path: "$.nested.property",
|
|
514
|
+
value: {
|
|
515
|
+
"TaxClassificationRef": {
|
|
516
|
+
"value": "EUC-99990201-V1-00020000",
|
|
517
|
+
},
|
|
518
|
+
},
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
path: "$.nested.property",
|
|
522
|
+
value: {
|
|
523
|
+
"TaxClassificationRef": {
|
|
524
|
+
"value": "EUC-99990201-V1-00020000",
|
|
525
|
+
},
|
|
526
|
+
},
|
|
527
|
+
},
|
|
528
|
+
],
|
|
529
|
+
},
|
|
530
|
+
],
|
|
531
|
+
},
|
|
532
|
+
});
|
|
533
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
534
|
+
expect(result.updatePipelineResponse).toBeDefined();
|
|
535
|
+
expect(result.updatePipelineResponse).toEqual({
|
|
536
|
+
statusCode: 200,
|
|
537
|
+
status: "OK",
|
|
538
|
+
service: "zoho-crm",
|
|
539
|
+
resource: "pipelines",
|
|
540
|
+
operation: "update",
|
|
541
|
+
data: {
|
|
542
|
+
id: "12345",
|
|
543
|
+
},
|
|
544
|
+
});
|
|
360
545
|
});
|
|
361
546
|
|
|
362
547
|
test("Pipelines Crm Pipelines Delete", async () => {
|