@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 { RFCDate } from "../types/index.js";
|
|
8
8
|
import { createTestHTTPClient } from "./testclient.js";
|
|
@@ -412,10 +412,104 @@ test("Ledgeraccounts Accounting Ledger Accounts All", async () => {
|
|
|
412
412
|
});
|
|
413
413
|
});
|
|
414
414
|
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
415
|
+
test("Ledgeraccounts Accounting Ledger Accounts Add", async () => {
|
|
416
|
+
const testHttpClient = createTestHTTPClient("accounting.ledgerAccountsAdd");
|
|
417
|
+
|
|
418
|
+
const apideck = new Apideck({
|
|
419
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
420
|
+
httpClient: testHttpClient,
|
|
421
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
422
|
+
});
|
|
423
|
+
|
|
424
|
+
const result = await apideck.accounting.ledgerAccounts.create({
|
|
425
|
+
consumerId: "test-consumer",
|
|
426
|
+
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
|
|
427
|
+
serviceId: "salesforce",
|
|
428
|
+
ledgerAccount: {
|
|
429
|
+
displayId: "1-12345",
|
|
430
|
+
code: "453",
|
|
431
|
+
classification: "asset",
|
|
432
|
+
type: "bank",
|
|
433
|
+
subType: "CHECKING_ACCOUNT",
|
|
434
|
+
name: "Bank account",
|
|
435
|
+
fullyQualifiedName: "Asset.Bank.Checking_Account",
|
|
436
|
+
description: "Main checking account",
|
|
437
|
+
openingBalance: 75000,
|
|
438
|
+
currentBalance: 20000,
|
|
439
|
+
currency: "USD",
|
|
440
|
+
taxType: "NONE",
|
|
441
|
+
taxRate: {
|
|
442
|
+
id: "123456",
|
|
443
|
+
rate: 10,
|
|
444
|
+
},
|
|
445
|
+
level: 1,
|
|
446
|
+
active: true,
|
|
447
|
+
status: "active",
|
|
448
|
+
header: true,
|
|
449
|
+
bankAccount: {
|
|
450
|
+
bankName: "Monzo",
|
|
451
|
+
accountNumber: "123465",
|
|
452
|
+
accountName: "SPACEX LLC",
|
|
453
|
+
accountType: "credit_card",
|
|
454
|
+
iban: "CH2989144532982975332",
|
|
455
|
+
bic: "AUDSCHGGXXX",
|
|
456
|
+
routingNumber: "012345678",
|
|
457
|
+
bsbNumber: "062-001",
|
|
458
|
+
branchIdentifier: "001",
|
|
459
|
+
bankCode: "BNH",
|
|
460
|
+
currency: "USD",
|
|
461
|
+
},
|
|
462
|
+
parentAccount: {
|
|
463
|
+
id: "12345",
|
|
464
|
+
name: "Bank Accounts",
|
|
465
|
+
displayId: "1-1100",
|
|
466
|
+
},
|
|
467
|
+
subAccount: false,
|
|
468
|
+
lastReconciliationDate: new RFCDate("2020-09-30"),
|
|
469
|
+
customFields: [
|
|
470
|
+
{
|
|
471
|
+
id: "2389328923893298",
|
|
472
|
+
name: "employee_level",
|
|
473
|
+
description: "Employee Level",
|
|
474
|
+
value: {},
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
id: "2389328923893298",
|
|
478
|
+
name: "employee_level",
|
|
479
|
+
description: "Employee Level",
|
|
480
|
+
value: true,
|
|
481
|
+
},
|
|
482
|
+
],
|
|
483
|
+
rowVersion: "1-12345",
|
|
484
|
+
passThrough: [
|
|
485
|
+
{
|
|
486
|
+
serviceId: "<id>",
|
|
487
|
+
extendPaths: [
|
|
488
|
+
{
|
|
489
|
+
path: "$.nested.property",
|
|
490
|
+
value: {
|
|
491
|
+
"TaxClassificationRef": {
|
|
492
|
+
"value": "EUC-99990201-V1-00020000",
|
|
493
|
+
},
|
|
494
|
+
},
|
|
495
|
+
},
|
|
496
|
+
],
|
|
497
|
+
},
|
|
498
|
+
],
|
|
499
|
+
},
|
|
500
|
+
});
|
|
501
|
+
expect(result.httpMeta.response.status).toBe(201);
|
|
502
|
+
expect(result.createLedgerAccountResponse).toBeDefined();
|
|
503
|
+
expect(result.createLedgerAccountResponse).toEqual({
|
|
504
|
+
statusCode: 200,
|
|
505
|
+
status: "OK",
|
|
506
|
+
service: "xero",
|
|
507
|
+
resource: "ledger-accounts",
|
|
508
|
+
operation: "add",
|
|
509
|
+
data: {
|
|
510
|
+
id: "12345",
|
|
511
|
+
},
|
|
512
|
+
});
|
|
419
513
|
});
|
|
420
514
|
|
|
421
515
|
test("Ledgeraccounts Accounting Ledger Accounts One", async () => {
|
|
@@ -563,10 +657,145 @@ test("Ledgeraccounts Accounting Ledger Accounts One", async () => {
|
|
|
563
657
|
});
|
|
564
658
|
});
|
|
565
659
|
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
"
|
|
660
|
+
test("Ledgeraccounts Accounting Ledger Accounts Update", async () => {
|
|
661
|
+
const testHttpClient = createTestHTTPClient(
|
|
662
|
+
"accounting.ledgerAccountsUpdate",
|
|
569
663
|
);
|
|
664
|
+
|
|
665
|
+
const apideck = new Apideck({
|
|
666
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
667
|
+
httpClient: testHttpClient,
|
|
668
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
669
|
+
});
|
|
670
|
+
|
|
671
|
+
const result = await apideck.accounting.ledgerAccounts.update({
|
|
672
|
+
id: "<id>",
|
|
673
|
+
consumerId: "test-consumer",
|
|
674
|
+
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
|
|
675
|
+
serviceId: "salesforce",
|
|
676
|
+
ledgerAccount: {
|
|
677
|
+
displayId: "1-12345",
|
|
678
|
+
code: "453",
|
|
679
|
+
classification: "asset",
|
|
680
|
+
type: "bank",
|
|
681
|
+
subType: "CHECKING_ACCOUNT",
|
|
682
|
+
name: "Bank account",
|
|
683
|
+
fullyQualifiedName: "Asset.Bank.Checking_Account",
|
|
684
|
+
description: "Main checking account",
|
|
685
|
+
openingBalance: 75000,
|
|
686
|
+
currentBalance: 20000,
|
|
687
|
+
currency: "USD",
|
|
688
|
+
taxType: "NONE",
|
|
689
|
+
taxRate: {
|
|
690
|
+
id: "123456",
|
|
691
|
+
rate: 10,
|
|
692
|
+
},
|
|
693
|
+
level: 1,
|
|
694
|
+
active: true,
|
|
695
|
+
status: "active",
|
|
696
|
+
header: true,
|
|
697
|
+
bankAccount: {
|
|
698
|
+
bankName: "Monzo",
|
|
699
|
+
accountNumber: "123465",
|
|
700
|
+
accountName: "SPACEX LLC",
|
|
701
|
+
accountType: "credit_card",
|
|
702
|
+
iban: "CH2989144532982975332",
|
|
703
|
+
bic: "AUDSCHGGXXX",
|
|
704
|
+
routingNumber: "012345678",
|
|
705
|
+
bsbNumber: "062-001",
|
|
706
|
+
branchIdentifier: "001",
|
|
707
|
+
bankCode: "BNH",
|
|
708
|
+
currency: "USD",
|
|
709
|
+
},
|
|
710
|
+
parentAccount: {
|
|
711
|
+
id: "12345",
|
|
712
|
+
name: "Bank Accounts",
|
|
713
|
+
displayId: "1-1100",
|
|
714
|
+
},
|
|
715
|
+
subAccount: false,
|
|
716
|
+
lastReconciliationDate: new RFCDate("2020-09-30"),
|
|
717
|
+
customFields: [
|
|
718
|
+
{
|
|
719
|
+
id: "2389328923893298",
|
|
720
|
+
name: "employee_level",
|
|
721
|
+
description: "Employee Level",
|
|
722
|
+
value: {},
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
id: "2389328923893298",
|
|
726
|
+
name: "employee_level",
|
|
727
|
+
description: "Employee Level",
|
|
728
|
+
value: true,
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
id: "2389328923893298",
|
|
732
|
+
name: "employee_level",
|
|
733
|
+
description: "Employee Level",
|
|
734
|
+
value: [
|
|
735
|
+
{},
|
|
736
|
+
{},
|
|
737
|
+
],
|
|
738
|
+
},
|
|
739
|
+
],
|
|
740
|
+
rowVersion: "1-12345",
|
|
741
|
+
passThrough: [
|
|
742
|
+
{
|
|
743
|
+
serviceId: "<id>",
|
|
744
|
+
extendPaths: [
|
|
745
|
+
{
|
|
746
|
+
path: "$.nested.property",
|
|
747
|
+
value: {
|
|
748
|
+
"TaxClassificationRef": {
|
|
749
|
+
"value": "EUC-99990201-V1-00020000",
|
|
750
|
+
},
|
|
751
|
+
},
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
path: "$.nested.property",
|
|
755
|
+
value: {
|
|
756
|
+
"TaxClassificationRef": {
|
|
757
|
+
"value": "EUC-99990201-V1-00020000",
|
|
758
|
+
},
|
|
759
|
+
},
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
path: "$.nested.property",
|
|
763
|
+
value: {
|
|
764
|
+
"TaxClassificationRef": {
|
|
765
|
+
"value": "EUC-99990201-V1-00020000",
|
|
766
|
+
},
|
|
767
|
+
},
|
|
768
|
+
},
|
|
769
|
+
],
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
serviceId: "<id>",
|
|
773
|
+
extendPaths: [
|
|
774
|
+
{
|
|
775
|
+
path: "$.nested.property",
|
|
776
|
+
value: {
|
|
777
|
+
"TaxClassificationRef": {
|
|
778
|
+
"value": "EUC-99990201-V1-00020000",
|
|
779
|
+
},
|
|
780
|
+
},
|
|
781
|
+
},
|
|
782
|
+
],
|
|
783
|
+
},
|
|
784
|
+
],
|
|
785
|
+
},
|
|
786
|
+
});
|
|
787
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
788
|
+
expect(result.updateLedgerAccountResponse).toBeDefined();
|
|
789
|
+
expect(result.updateLedgerAccountResponse).toEqual({
|
|
790
|
+
statusCode: 200,
|
|
791
|
+
status: "OK",
|
|
792
|
+
service: "xero",
|
|
793
|
+
resource: "ledger-accounts",
|
|
794
|
+
operation: "update",
|
|
795
|
+
data: {
|
|
796
|
+
id: "12345",
|
|
797
|
+
},
|
|
798
|
+
});
|
|
570
799
|
});
|
|
571
800
|
|
|
572
801
|
test("Ledgeraccounts Accounting Ledger Accounts 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
|
|
|
@@ -344,10 +344,129 @@ test("Locations Accounting Locations All", async () => {
|
|
|
344
344
|
});
|
|
345
345
|
});
|
|
346
346
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
347
|
+
test("Locations Accounting Locations Add", async () => {
|
|
348
|
+
const testHttpClient = createTestHTTPClient("accounting.locationsAdd");
|
|
349
|
+
|
|
350
|
+
const apideck = new Apideck({
|
|
351
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
352
|
+
httpClient: testHttpClient,
|
|
353
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
const result = await apideck.accounting.locations.create({
|
|
357
|
+
consumerId: "test-consumer",
|
|
358
|
+
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
|
|
359
|
+
serviceId: "salesforce",
|
|
360
|
+
accountingLocation: {
|
|
361
|
+
parentId: "12345",
|
|
362
|
+
companyName: "SpaceX",
|
|
363
|
+
displayName: "11 UT - South Jordan",
|
|
364
|
+
status: "active",
|
|
365
|
+
addresses: [
|
|
366
|
+
{
|
|
367
|
+
id: "123",
|
|
368
|
+
type: "primary",
|
|
369
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
370
|
+
name: "HQ US",
|
|
371
|
+
line1: "Main street",
|
|
372
|
+
line2: "apt #",
|
|
373
|
+
line3: "Suite #",
|
|
374
|
+
line4: "delivery instructions",
|
|
375
|
+
streetNumber: "25",
|
|
376
|
+
city: "San Francisco",
|
|
377
|
+
state: "CA",
|
|
378
|
+
postalCode: "94104",
|
|
379
|
+
country: "US",
|
|
380
|
+
latitude: "40.759211",
|
|
381
|
+
longitude: "-73.984638",
|
|
382
|
+
county: "Santa Clara",
|
|
383
|
+
contactName: "Elon Musk",
|
|
384
|
+
salutation: "Mr",
|
|
385
|
+
phoneNumber: "111-111-1111",
|
|
386
|
+
fax: "122-111-1111",
|
|
387
|
+
email: "elon@musk.com",
|
|
388
|
+
website: "https://elonmusk.com",
|
|
389
|
+
notes: "Address notes or delivery instructions.",
|
|
390
|
+
rowVersion: "1-12345",
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
id: "123",
|
|
394
|
+
type: "primary",
|
|
395
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
396
|
+
name: "HQ US",
|
|
397
|
+
line1: "Main street",
|
|
398
|
+
line2: "apt #",
|
|
399
|
+
line3: "Suite #",
|
|
400
|
+
line4: "delivery instructions",
|
|
401
|
+
streetNumber: "25",
|
|
402
|
+
city: "San Francisco",
|
|
403
|
+
state: "CA",
|
|
404
|
+
postalCode: "94104",
|
|
405
|
+
country: "US",
|
|
406
|
+
latitude: "40.759211",
|
|
407
|
+
longitude: "-73.984638",
|
|
408
|
+
county: "Santa Clara",
|
|
409
|
+
contactName: "Elon Musk",
|
|
410
|
+
salutation: "Mr",
|
|
411
|
+
phoneNumber: "111-111-1111",
|
|
412
|
+
fax: "122-111-1111",
|
|
413
|
+
email: "elon@musk.com",
|
|
414
|
+
website: "https://elonmusk.com",
|
|
415
|
+
notes: "Address notes or delivery instructions.",
|
|
416
|
+
rowVersion: "1-12345",
|
|
417
|
+
},
|
|
418
|
+
],
|
|
419
|
+
subsidiaries: [
|
|
420
|
+
{
|
|
421
|
+
name: "SpaceX",
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
name: "SpaceX",
|
|
425
|
+
},
|
|
426
|
+
],
|
|
427
|
+
rowVersion: "1-12345",
|
|
428
|
+
passThrough: [
|
|
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
|
+
},
|
|
442
|
+
{
|
|
443
|
+
serviceId: "<id>",
|
|
444
|
+
extendPaths: [
|
|
445
|
+
{
|
|
446
|
+
path: "$.nested.property",
|
|
447
|
+
value: {
|
|
448
|
+
"TaxClassificationRef": {
|
|
449
|
+
"value": "EUC-99990201-V1-00020000",
|
|
450
|
+
},
|
|
451
|
+
},
|
|
452
|
+
},
|
|
453
|
+
],
|
|
454
|
+
},
|
|
455
|
+
],
|
|
456
|
+
},
|
|
457
|
+
});
|
|
458
|
+
expect(result.httpMeta.response.status).toBe(201);
|
|
459
|
+
expect(result.createAccountingLocationResponse).toBeDefined();
|
|
460
|
+
expect(result.createAccountingLocationResponse).toEqual({
|
|
461
|
+
statusCode: 200,
|
|
462
|
+
status: "OK",
|
|
463
|
+
service: "quickbooks",
|
|
464
|
+
resource: "locations",
|
|
465
|
+
operation: "add",
|
|
466
|
+
data: {
|
|
467
|
+
id: "12345",
|
|
468
|
+
},
|
|
469
|
+
});
|
|
351
470
|
});
|
|
352
471
|
|
|
353
472
|
test("Locations Accounting Locations One", async () => {
|
|
@@ -531,10 +650,180 @@ test("Locations Accounting Locations One", async () => {
|
|
|
531
650
|
});
|
|
532
651
|
});
|
|
533
652
|
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
653
|
+
test("Locations Accounting Locations Update", async () => {
|
|
654
|
+
const testHttpClient = createTestHTTPClient("accounting.locationsUpdate");
|
|
655
|
+
|
|
656
|
+
const apideck = new Apideck({
|
|
657
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
658
|
+
httpClient: testHttpClient,
|
|
659
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
660
|
+
});
|
|
661
|
+
|
|
662
|
+
const result = await apideck.accounting.locations.update({
|
|
663
|
+
id: "<id>",
|
|
664
|
+
consumerId: "test-consumer",
|
|
665
|
+
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
|
|
666
|
+
serviceId: "salesforce",
|
|
667
|
+
accountingLocation: {
|
|
668
|
+
parentId: "12345",
|
|
669
|
+
companyName: "SpaceX",
|
|
670
|
+
displayName: "11 UT - South Jordan",
|
|
671
|
+
status: "active",
|
|
672
|
+
addresses: [
|
|
673
|
+
{
|
|
674
|
+
id: "123",
|
|
675
|
+
type: "primary",
|
|
676
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
677
|
+
name: "HQ US",
|
|
678
|
+
line1: "Main street",
|
|
679
|
+
line2: "apt #",
|
|
680
|
+
line3: "Suite #",
|
|
681
|
+
line4: "delivery instructions",
|
|
682
|
+
streetNumber: "25",
|
|
683
|
+
city: "San Francisco",
|
|
684
|
+
state: "CA",
|
|
685
|
+
postalCode: "94104",
|
|
686
|
+
country: "US",
|
|
687
|
+
latitude: "40.759211",
|
|
688
|
+
longitude: "-73.984638",
|
|
689
|
+
county: "Santa Clara",
|
|
690
|
+
contactName: "Elon Musk",
|
|
691
|
+
salutation: "Mr",
|
|
692
|
+
phoneNumber: "111-111-1111",
|
|
693
|
+
fax: "122-111-1111",
|
|
694
|
+
email: "elon@musk.com",
|
|
695
|
+
website: "https://elonmusk.com",
|
|
696
|
+
notes: "Address notes or delivery instructions.",
|
|
697
|
+
rowVersion: "1-12345",
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
id: "123",
|
|
701
|
+
type: "primary",
|
|
702
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
703
|
+
name: "HQ US",
|
|
704
|
+
line1: "Main street",
|
|
705
|
+
line2: "apt #",
|
|
706
|
+
line3: "Suite #",
|
|
707
|
+
line4: "delivery instructions",
|
|
708
|
+
streetNumber: "25",
|
|
709
|
+
city: "San Francisco",
|
|
710
|
+
state: "CA",
|
|
711
|
+
postalCode: "94104",
|
|
712
|
+
country: "US",
|
|
713
|
+
latitude: "40.759211",
|
|
714
|
+
longitude: "-73.984638",
|
|
715
|
+
county: "Santa Clara",
|
|
716
|
+
contactName: "Elon Musk",
|
|
717
|
+
salutation: "Mr",
|
|
718
|
+
phoneNumber: "111-111-1111",
|
|
719
|
+
fax: "122-111-1111",
|
|
720
|
+
email: "elon@musk.com",
|
|
721
|
+
website: "https://elonmusk.com",
|
|
722
|
+
notes: "Address notes or delivery instructions.",
|
|
723
|
+
rowVersion: "1-12345",
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
id: "123",
|
|
727
|
+
type: "primary",
|
|
728
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
729
|
+
name: "HQ US",
|
|
730
|
+
line1: "Main street",
|
|
731
|
+
line2: "apt #",
|
|
732
|
+
line3: "Suite #",
|
|
733
|
+
line4: "delivery instructions",
|
|
734
|
+
streetNumber: "25",
|
|
735
|
+
city: "San Francisco",
|
|
736
|
+
state: "CA",
|
|
737
|
+
postalCode: "94104",
|
|
738
|
+
country: "US",
|
|
739
|
+
latitude: "40.759211",
|
|
740
|
+
longitude: "-73.984638",
|
|
741
|
+
county: "Santa Clara",
|
|
742
|
+
contactName: "Elon Musk",
|
|
743
|
+
salutation: "Mr",
|
|
744
|
+
phoneNumber: "111-111-1111",
|
|
745
|
+
fax: "122-111-1111",
|
|
746
|
+
email: "elon@musk.com",
|
|
747
|
+
website: "https://elonmusk.com",
|
|
748
|
+
notes: "Address notes or delivery instructions.",
|
|
749
|
+
rowVersion: "1-12345",
|
|
750
|
+
},
|
|
751
|
+
],
|
|
752
|
+
subsidiaries: [
|
|
753
|
+
{
|
|
754
|
+
name: "SpaceX",
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
name: "SpaceX",
|
|
758
|
+
},
|
|
759
|
+
],
|
|
760
|
+
rowVersion: "1-12345",
|
|
761
|
+
passThrough: [
|
|
762
|
+
{
|
|
763
|
+
serviceId: "<id>",
|
|
764
|
+
extendPaths: [
|
|
765
|
+
{
|
|
766
|
+
path: "$.nested.property",
|
|
767
|
+
value: {
|
|
768
|
+
"TaxClassificationRef": {
|
|
769
|
+
"value": "EUC-99990201-V1-00020000",
|
|
770
|
+
},
|
|
771
|
+
},
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
path: "$.nested.property",
|
|
775
|
+
value: {
|
|
776
|
+
"TaxClassificationRef": {
|
|
777
|
+
"value": "EUC-99990201-V1-00020000",
|
|
778
|
+
},
|
|
779
|
+
},
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
path: "$.nested.property",
|
|
783
|
+
value: {
|
|
784
|
+
"TaxClassificationRef": {
|
|
785
|
+
"value": "EUC-99990201-V1-00020000",
|
|
786
|
+
},
|
|
787
|
+
},
|
|
788
|
+
},
|
|
789
|
+
],
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
serviceId: "<id>",
|
|
793
|
+
extendPaths: [
|
|
794
|
+
{
|
|
795
|
+
path: "$.nested.property",
|
|
796
|
+
value: {
|
|
797
|
+
"TaxClassificationRef": {
|
|
798
|
+
"value": "EUC-99990201-V1-00020000",
|
|
799
|
+
},
|
|
800
|
+
},
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
path: "$.nested.property",
|
|
804
|
+
value: {
|
|
805
|
+
"TaxClassificationRef": {
|
|
806
|
+
"value": "EUC-99990201-V1-00020000",
|
|
807
|
+
},
|
|
808
|
+
},
|
|
809
|
+
},
|
|
810
|
+
],
|
|
811
|
+
},
|
|
812
|
+
],
|
|
813
|
+
},
|
|
814
|
+
});
|
|
815
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
816
|
+
expect(result.updateAccountingLocationResponse).toBeDefined();
|
|
817
|
+
expect(result.updateAccountingLocationResponse).toEqual({
|
|
818
|
+
statusCode: 200,
|
|
819
|
+
status: "OK",
|
|
820
|
+
service: "quickbooks",
|
|
821
|
+
resource: "locations",
|
|
822
|
+
operation: "update",
|
|
823
|
+
data: {
|
|
824
|
+
id: "12345",
|
|
825
|
+
},
|
|
826
|
+
});
|
|
538
827
|
});
|
|
539
828
|
|
|
540
829
|
test("Locations Accounting Locations Delete", async () => {
|