@panoptic-it-solutions/quickbooks-client 0.2.0 → 0.3.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/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +25 -0
- package/dist/index.mjs +25 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -490,6 +490,8 @@ declare class QuickBooksClient {
|
|
|
490
490
|
createPayment(payment: Partial<Payment>): Promise<Payment>;
|
|
491
491
|
getAccount(id: string): Promise<Account>;
|
|
492
492
|
getAccounts(where?: string): Promise<Account[]>;
|
|
493
|
+
createAccount(account: Partial<Account>): Promise<Account>;
|
|
494
|
+
updateAccount(account: Account): Promise<Account>;
|
|
493
495
|
getVendor(id: string): Promise<Vendor>;
|
|
494
496
|
getVendors(where?: string): Promise<Vendor[]>;
|
|
495
497
|
createVendor(vendor: Partial<Vendor>): Promise<Vendor>;
|
|
@@ -551,6 +553,9 @@ declare class QuickBooksClient {
|
|
|
551
553
|
* Get company info
|
|
552
554
|
*/
|
|
553
555
|
getCompanyInfo(): Promise<CompanyInfo>;
|
|
556
|
+
updateCompanyInfo(companyInfo: Partial<CompanyInfo> & {
|
|
557
|
+
SyncToken: string;
|
|
558
|
+
}): Promise<CompanyInfo>;
|
|
554
559
|
/**
|
|
555
560
|
* Check if connected to QuickBooks
|
|
556
561
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -490,6 +490,8 @@ declare class QuickBooksClient {
|
|
|
490
490
|
createPayment(payment: Partial<Payment>): Promise<Payment>;
|
|
491
491
|
getAccount(id: string): Promise<Account>;
|
|
492
492
|
getAccounts(where?: string): Promise<Account[]>;
|
|
493
|
+
createAccount(account: Partial<Account>): Promise<Account>;
|
|
494
|
+
updateAccount(account: Account): Promise<Account>;
|
|
493
495
|
getVendor(id: string): Promise<Vendor>;
|
|
494
496
|
getVendors(where?: string): Promise<Vendor[]>;
|
|
495
497
|
createVendor(vendor: Partial<Vendor>): Promise<Vendor>;
|
|
@@ -551,6 +553,9 @@ declare class QuickBooksClient {
|
|
|
551
553
|
* Get company info
|
|
552
554
|
*/
|
|
553
555
|
getCompanyInfo(): Promise<CompanyInfo>;
|
|
556
|
+
updateCompanyInfo(companyInfo: Partial<CompanyInfo> & {
|
|
557
|
+
SyncToken: string;
|
|
558
|
+
}): Promise<CompanyInfo>;
|
|
554
559
|
/**
|
|
555
560
|
* Check if connected to QuickBooks
|
|
556
561
|
*/
|
package/dist/index.js
CHANGED
|
@@ -603,6 +603,22 @@ var QuickBooksClient = class {
|
|
|
603
603
|
const sql = where ? `SELECT * FROM Account WHERE ${where}` : "SELECT * FROM Account WHERE Active = true";
|
|
604
604
|
return this.queryAll(sql);
|
|
605
605
|
}
|
|
606
|
+
async createAccount(account) {
|
|
607
|
+
const response = await this.request(
|
|
608
|
+
"POST",
|
|
609
|
+
"/account",
|
|
610
|
+
account
|
|
611
|
+
);
|
|
612
|
+
return response.Account;
|
|
613
|
+
}
|
|
614
|
+
async updateAccount(account) {
|
|
615
|
+
const response = await this.request(
|
|
616
|
+
"POST",
|
|
617
|
+
"/account",
|
|
618
|
+
account
|
|
619
|
+
);
|
|
620
|
+
return response.Account;
|
|
621
|
+
}
|
|
606
622
|
// ============================================
|
|
607
623
|
// Vendor Methods
|
|
608
624
|
// ============================================
|
|
@@ -934,6 +950,15 @@ var QuickBooksClient = class {
|
|
|
934
950
|
);
|
|
935
951
|
return response.CompanyInfo;
|
|
936
952
|
}
|
|
953
|
+
async updateCompanyInfo(companyInfo) {
|
|
954
|
+
const tokens = await this.getValidTokens();
|
|
955
|
+
const response = await this.request(
|
|
956
|
+
"POST",
|
|
957
|
+
`/companyinfo`,
|
|
958
|
+
{ ...companyInfo, sparse: true }
|
|
959
|
+
);
|
|
960
|
+
return response.CompanyInfo;
|
|
961
|
+
}
|
|
937
962
|
/**
|
|
938
963
|
* Check if connected to QuickBooks
|
|
939
964
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -567,6 +567,22 @@ var QuickBooksClient = class {
|
|
|
567
567
|
const sql = where ? `SELECT * FROM Account WHERE ${where}` : "SELECT * FROM Account WHERE Active = true";
|
|
568
568
|
return this.queryAll(sql);
|
|
569
569
|
}
|
|
570
|
+
async createAccount(account) {
|
|
571
|
+
const response = await this.request(
|
|
572
|
+
"POST",
|
|
573
|
+
"/account",
|
|
574
|
+
account
|
|
575
|
+
);
|
|
576
|
+
return response.Account;
|
|
577
|
+
}
|
|
578
|
+
async updateAccount(account) {
|
|
579
|
+
const response = await this.request(
|
|
580
|
+
"POST",
|
|
581
|
+
"/account",
|
|
582
|
+
account
|
|
583
|
+
);
|
|
584
|
+
return response.Account;
|
|
585
|
+
}
|
|
570
586
|
// ============================================
|
|
571
587
|
// Vendor Methods
|
|
572
588
|
// ============================================
|
|
@@ -898,6 +914,15 @@ var QuickBooksClient = class {
|
|
|
898
914
|
);
|
|
899
915
|
return response.CompanyInfo;
|
|
900
916
|
}
|
|
917
|
+
async updateCompanyInfo(companyInfo) {
|
|
918
|
+
const tokens = await this.getValidTokens();
|
|
919
|
+
const response = await this.request(
|
|
920
|
+
"POST",
|
|
921
|
+
`/companyinfo`,
|
|
922
|
+
{ ...companyInfo, sparse: true }
|
|
923
|
+
);
|
|
924
|
+
return response.CompanyInfo;
|
|
925
|
+
}
|
|
901
926
|
/**
|
|
902
927
|
* Check if connected to QuickBooks
|
|
903
928
|
*/
|
package/package.json
CHANGED