conductor-node 2.0.3 → 3.0.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 +8 -14
- package/dist/src/BaseClient.d.ts +1 -1
- package/dist/src/BaseClient.js +4 -4
- package/dist/src/qbd/ClientQBD.d.ts +19 -19
- package/dist/src/qbd/ClientQBD.js +22 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,24 +15,18 @@ yarn add conductor-node
|
|
|
15
15
|
|
|
16
16
|
## Usage
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
Instantiate `Conductor` with your account's secret key, which is available from Danny.
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
To send a request to a specific QuickBooks Desktop user, you must also supply their user id.
|
|
20
|
+
The `Conductor` instance can execute _any_ read or write [QuickBooks Desktop API](https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop) through TypeScript and receive a fully-typed response. Each request requires the user-id of a specific QuickBooks Desktop user.
|
|
23
21
|
|
|
24
22
|
```ts
|
|
25
23
|
import Conductor from "conductor-node";
|
|
26
24
|
const conductor = new Conductor("sk_test_...");
|
|
27
25
|
|
|
28
|
-
const
|
|
29
|
-
conductor.qbd.account
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
})
|
|
35
|
-
.then((account) => {
|
|
36
|
-
console.log("Response:", account);
|
|
37
|
-
});
|
|
26
|
+
const mockQBDUserId = "1";
|
|
27
|
+
const newAccount = await conductor.qbd.account.add(mockQBDUserId, {
|
|
28
|
+
Name: "Test Account",
|
|
29
|
+
AccountType: "Bank",
|
|
30
|
+
OpenBalance: "100",
|
|
31
|
+
});
|
|
38
32
|
```
|
package/dist/src/BaseClient.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export default class BaseClient {
|
|
|
8
8
|
protected readonly verbose: boolean;
|
|
9
9
|
protected readonly serverURL: string;
|
|
10
10
|
constructor(apiKey: string, { verbose, environment }: BaseClientOptions);
|
|
11
|
-
protected sendAPIRequest<T>(apiPath: string,
|
|
11
|
+
protected sendAPIRequest<T>(apiPath: string, integrationUserId: string, requestObj: T): Promise<T>;
|
|
12
12
|
}
|
package/dist/src/BaseClient.js
CHANGED
|
@@ -16,13 +16,13 @@ class BaseClient {
|
|
|
16
16
|
this.verbose = verbose;
|
|
17
17
|
this.serverURL = (0, environment_1.envToBaseServerURL)(environment);
|
|
18
18
|
}
|
|
19
|
-
async sendAPIRequest(apiPath,
|
|
19
|
+
async sendAPIRequest(apiPath, integrationUserId, requestObj) {
|
|
20
20
|
const apiServerURL = `${this.serverURL}/${apiPath}`;
|
|
21
21
|
if (this.verbose) {
|
|
22
|
-
console.log(`Client sent request to ${apiServerURL} for user ${
|
|
22
|
+
console.log(`Client sent request to ${apiServerURL} for ${apiPath} user ${integrationUserId}:`, JSON.stringify(requestObj, null, 2));
|
|
23
23
|
}
|
|
24
24
|
const response = await fetch(apiServerURL, {
|
|
25
|
-
body: JSON.stringify({
|
|
25
|
+
body: JSON.stringify({ integrationUserId, requestObj }),
|
|
26
26
|
headers: {
|
|
27
27
|
"Content-Type": "application/json",
|
|
28
28
|
Authorization: `Bearer ${this.apiKey}`,
|
|
@@ -35,7 +35,7 @@ class BaseClient {
|
|
|
35
35
|
}
|
|
36
36
|
const responseObj = (await response.json());
|
|
37
37
|
if (this.verbose) {
|
|
38
|
-
console.log(`Client received response for user ${
|
|
38
|
+
console.log(`Client received response for ${apiPath} user ${integrationUserId}:`, JSON.stringify(responseObj, null, 2));
|
|
39
39
|
}
|
|
40
40
|
return responseObj;
|
|
41
41
|
}
|
|
@@ -12,13 +12,13 @@ export default class ClientQBD extends BaseClient {
|
|
|
12
12
|
*
|
|
13
13
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/AccountAdd
|
|
14
14
|
*/
|
|
15
|
-
add: (
|
|
15
|
+
add: (integrationUserId: string, params: qbd.AccountAddRq["AccountAdd"]) => Promise<NonNullable<qbd.AccountAddRs["AccountRet"]>>;
|
|
16
16
|
/**
|
|
17
17
|
* Modifies an account.
|
|
18
18
|
*
|
|
19
19
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/AccountMod
|
|
20
20
|
*/
|
|
21
|
-
mod: (
|
|
21
|
+
mod: (integrationUserId: string, params: qbd.AccountModRq["AccountMod"]) => Promise<NonNullable<qbd.AccountModRs["AccountRet"]>>;
|
|
22
22
|
/**
|
|
23
23
|
* `AccountQuery` is a list query that returns data for all accounts that
|
|
24
24
|
* match the provided filter criteria. Notice that it returns only data
|
|
@@ -29,7 +29,7 @@ export default class ClientQBD extends BaseClient {
|
|
|
29
29
|
*
|
|
30
30
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/AccountQuery
|
|
31
31
|
*/
|
|
32
|
-
query: (
|
|
32
|
+
query: (integrationUserId: string, params: qbd.AccountQueryRq) => Promise<NonNullable<qbd.AccountQueryRs["AccountRet"]>>;
|
|
33
33
|
};
|
|
34
34
|
customer: {
|
|
35
35
|
/**
|
|
@@ -54,13 +54,13 @@ export default class ClientQBD extends BaseClient {
|
|
|
54
54
|
*
|
|
55
55
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/CustomerAdd
|
|
56
56
|
*/
|
|
57
|
-
add: (
|
|
57
|
+
add: (integrationUserId: string, params: qbd.CustomerAddRq["CustomerAdd"]) => Promise<NonNullable<qbd.CustomerAddRs["CustomerRet"]>>;
|
|
58
58
|
/**
|
|
59
59
|
* Modifies the customer record.
|
|
60
60
|
*
|
|
61
61
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/CustomerMod
|
|
62
62
|
*/
|
|
63
|
-
mod: (
|
|
63
|
+
mod: (integrationUserId: string, params: qbd.CustomerModRq["CustomerMod"]) => Promise<NonNullable<qbd.CustomerModRs["CustomerRet"]>>;
|
|
64
64
|
/**
|
|
65
65
|
* Returns data for the specified customers.
|
|
66
66
|
*
|
|
@@ -73,7 +73,7 @@ export default class ClientQBD extends BaseClient {
|
|
|
73
73
|
*
|
|
74
74
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/CustomerQuery
|
|
75
75
|
*/
|
|
76
|
-
query: (
|
|
76
|
+
query: (integrationUserId: string, params: qbd.CustomerQueryRq) => Promise<NonNullable<qbd.CustomerQueryRs["CustomerRet"]>>;
|
|
77
77
|
};
|
|
78
78
|
employee: {
|
|
79
79
|
/**
|
|
@@ -82,19 +82,19 @@ export default class ClientQBD extends BaseClient {
|
|
|
82
82
|
*
|
|
83
83
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/EmployeeAdd
|
|
84
84
|
*/
|
|
85
|
-
add: (
|
|
85
|
+
add: (integrationUserId: string, params: qbd.EmployeeAddRq["EmployeeAdd"]) => Promise<NonNullable<qbd.EmployeeAddRs["EmployeeRet"]>>;
|
|
86
86
|
/**
|
|
87
87
|
* Modifies an existing employee.
|
|
88
88
|
*
|
|
89
89
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/EmployeeMod
|
|
90
90
|
*/
|
|
91
|
-
mod: (
|
|
91
|
+
mod: (integrationUserId: string, params: qbd.EmployeeModRq["EmployeeMod"]) => Promise<NonNullable<qbd.EmployeeModRs["EmployeeRet"]>>;
|
|
92
92
|
/**
|
|
93
93
|
* Returns employee data.
|
|
94
94
|
*
|
|
95
95
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/EmployeeQuery
|
|
96
96
|
*/
|
|
97
|
-
query: (
|
|
97
|
+
query: (integrationUserId: string, params: qbd.EmployeeQueryRq) => Promise<NonNullable<qbd.EmployeeQueryRs["EmployeeRet"]>>;
|
|
98
98
|
};
|
|
99
99
|
journalEntry: {
|
|
100
100
|
/**
|
|
@@ -128,7 +128,7 @@ export default class ClientQBD extends BaseClient {
|
|
|
128
128
|
*
|
|
129
129
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/JournalEntryAdd
|
|
130
130
|
*/
|
|
131
|
-
add: (
|
|
131
|
+
add: (integrationUserId: string, params: qbd.JournalEntryAddRq["JournalEntryAdd"]) => Promise<NonNullable<qbd.JournalEntryAddRs["JournalEntryRet"]>>;
|
|
132
132
|
/**
|
|
133
133
|
* Modifies a journal entry.
|
|
134
134
|
*
|
|
@@ -138,7 +138,7 @@ export default class ClientQBD extends BaseClient {
|
|
|
138
138
|
*
|
|
139
139
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/JournalEntryMod
|
|
140
140
|
*/
|
|
141
|
-
mod: (
|
|
141
|
+
mod: (integrationUserId: string, params: qbd.JournalEntryModRq["JournalEntryMod"]) => Promise<NonNullable<qbd.JournalEntryModRs["JournalEntryRet"]>>;
|
|
142
142
|
/**
|
|
143
143
|
* In traditional accounting, transactions are entered into the general
|
|
144
144
|
* journal and categorized exclusively by account. In QuickBooks, most
|
|
@@ -163,7 +163,7 @@ export default class ClientQBD extends BaseClient {
|
|
|
163
163
|
*
|
|
164
164
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/JournalEntryQuery
|
|
165
165
|
*/
|
|
166
|
-
query: (
|
|
166
|
+
query: (integrationUserId: string, params: qbd.JournalEntryQueryRq) => Promise<NonNullable<qbd.JournalEntryQueryRs["JournalEntryRet"]>>;
|
|
167
167
|
};
|
|
168
168
|
timeTracking: {
|
|
169
169
|
/**
|
|
@@ -176,7 +176,7 @@ export default class ClientQBD extends BaseClient {
|
|
|
176
176
|
*
|
|
177
177
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/TimeTrackingQuery
|
|
178
178
|
*/
|
|
179
|
-
add: (
|
|
179
|
+
add: (integrationUserId: string, params: qbd.TimeTrackingAddRq["TimeTrackingAdd"]) => Promise<NonNullable<qbd.TimeTrackingAddRs["TimeTrackingRet"]>>;
|
|
180
180
|
/**
|
|
181
181
|
* Modifies a time tracking transaction.
|
|
182
182
|
*
|
|
@@ -203,7 +203,7 @@ export default class ClientQBD extends BaseClient {
|
|
|
203
203
|
*
|
|
204
204
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/TimeTrackingMod
|
|
205
205
|
*/
|
|
206
|
-
mod: (
|
|
206
|
+
mod: (integrationUserId: string, params: qbd.TimeTrackingModRq["TimeTrackingMod"]) => Promise<NonNullable<qbd.TimeTrackingModRs["TimeTrackingRet"]>>;
|
|
207
207
|
/**
|
|
208
208
|
* The time-tracking transactions that are returned in this query include
|
|
209
209
|
* time tracking information that was entered into QuickBooks manually or
|
|
@@ -214,7 +214,7 @@ export default class ClientQBD extends BaseClient {
|
|
|
214
214
|
*
|
|
215
215
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/TimeTrackingQuery
|
|
216
216
|
*/
|
|
217
|
-
query: (
|
|
217
|
+
query: (integrationUserId: string, params: qbd.TimeTrackingQueryRq) => Promise<NonNullable<qbd.TimeTrackingQueryRs["TimeTrackingRet"]>>;
|
|
218
218
|
};
|
|
219
219
|
vendor: {
|
|
220
220
|
/**
|
|
@@ -230,19 +230,19 @@ export default class ClientQBD extends BaseClient {
|
|
|
230
230
|
*
|
|
231
231
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/VendorAdd
|
|
232
232
|
*/
|
|
233
|
-
add: (
|
|
233
|
+
add: (integrationUserId: string, params: qbd.VendorAddRq["VendorAdd"]) => Promise<NonNullable<qbd.VendorAddRs["VendorRet"]>>;
|
|
234
234
|
/**
|
|
235
235
|
* Modifies a vendor.
|
|
236
236
|
*
|
|
237
237
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/VendorMod
|
|
238
238
|
*/
|
|
239
|
-
mod: (
|
|
239
|
+
mod: (integrationUserId: string, params: qbd.VendorModRq["VendorMod"]) => Promise<NonNullable<qbd.VendorModRs["VendorRet"]>>;
|
|
240
240
|
/**
|
|
241
241
|
* Queries for the specified vendor or set of vendors.
|
|
242
242
|
*
|
|
243
243
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/VendorQuery
|
|
244
244
|
*/
|
|
245
|
-
query: (
|
|
245
|
+
query: (integrationUserId: string, params: qbd.VendorQueryRq) => Promise<NonNullable<qbd.VendorQueryRs["VendorRet"]>>;
|
|
246
246
|
};
|
|
247
247
|
/**
|
|
248
248
|
* Send any QBXML request to QuickBooks Desktop.
|
|
@@ -250,6 +250,6 @@ export default class ClientQBD extends BaseClient {
|
|
|
250
250
|
* Available APIs:
|
|
251
251
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop
|
|
252
252
|
*/
|
|
253
|
-
sendRequest(
|
|
253
|
+
sendRequest(integrationUserId: string, requestObj: QBXMLObj): Promise<QBXMLObj>;
|
|
254
254
|
private sendRequestBase;
|
|
255
255
|
}
|
|
@@ -13,13 +13,13 @@ class ClientQBD extends BaseClient_1.default {
|
|
|
13
13
|
*
|
|
14
14
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/AccountAdd
|
|
15
15
|
*/
|
|
16
|
-
add: async (
|
|
16
|
+
add: async (integrationUserId, params) => this.sendRequestBase(integrationUserId, { AccountAddRq: { AccountAdd: params } }, "AccountAddRs", "AccountRet"),
|
|
17
17
|
/**
|
|
18
18
|
* Modifies an account.
|
|
19
19
|
*
|
|
20
20
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/AccountMod
|
|
21
21
|
*/
|
|
22
|
-
mod: async (
|
|
22
|
+
mod: async (integrationUserId, params) => this.sendRequestBase(integrationUserId, { AccountModRq: { AccountMod: params } }, "AccountModRs", "AccountRet"),
|
|
23
23
|
/**
|
|
24
24
|
* `AccountQuery` is a list query that returns data for all accounts that
|
|
25
25
|
* match the provided filter criteria. Notice that it returns only data
|
|
@@ -30,7 +30,7 @@ class ClientQBD extends BaseClient_1.default {
|
|
|
30
30
|
*
|
|
31
31
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/AccountQuery
|
|
32
32
|
*/
|
|
33
|
-
query: async (
|
|
33
|
+
query: async (integrationUserId, params) => this.sendRequestBase(integrationUserId, { AccountQueryRq: params }, "AccountQueryRs", "AccountRet"),
|
|
34
34
|
};
|
|
35
35
|
customer = {
|
|
36
36
|
/**
|
|
@@ -55,13 +55,13 @@ class ClientQBD extends BaseClient_1.default {
|
|
|
55
55
|
*
|
|
56
56
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/CustomerAdd
|
|
57
57
|
*/
|
|
58
|
-
add: async (
|
|
58
|
+
add: async (integrationUserId, params) => this.sendRequestBase(integrationUserId, { CustomerAddRq: { CustomerAdd: params } }, "CustomerAddRs", "CustomerRet"),
|
|
59
59
|
/**
|
|
60
60
|
* Modifies the customer record.
|
|
61
61
|
*
|
|
62
62
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/CustomerMod
|
|
63
63
|
*/
|
|
64
|
-
mod: async (
|
|
64
|
+
mod: async (integrationUserId, params) => this.sendRequestBase(integrationUserId, { CustomerModRq: { CustomerMod: params } }, "CustomerModRs", "CustomerRet"),
|
|
65
65
|
/**
|
|
66
66
|
* Returns data for the specified customers.
|
|
67
67
|
*
|
|
@@ -74,7 +74,7 @@ class ClientQBD extends BaseClient_1.default {
|
|
|
74
74
|
*
|
|
75
75
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/CustomerQuery
|
|
76
76
|
*/
|
|
77
|
-
query: async (
|
|
77
|
+
query: async (integrationUserId, params) => this.sendRequestBase(integrationUserId, { CustomerQueryRq: params }, "CustomerQueryRs", "CustomerRet"),
|
|
78
78
|
};
|
|
79
79
|
employee = {
|
|
80
80
|
/**
|
|
@@ -83,19 +83,19 @@ class ClientQBD extends BaseClient_1.default {
|
|
|
83
83
|
*
|
|
84
84
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/EmployeeAdd
|
|
85
85
|
*/
|
|
86
|
-
add: async (
|
|
86
|
+
add: async (integrationUserId, params) => this.sendRequestBase(integrationUserId, { EmployeeAddRq: { EmployeeAdd: params } }, "EmployeeAddRs", "EmployeeRet"),
|
|
87
87
|
/**
|
|
88
88
|
* Modifies an existing employee.
|
|
89
89
|
*
|
|
90
90
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/EmployeeMod
|
|
91
91
|
*/
|
|
92
|
-
mod: async (
|
|
92
|
+
mod: async (integrationUserId, params) => this.sendRequestBase(integrationUserId, { EmployeeModRq: { EmployeeMod: params } }, "EmployeeModRs", "EmployeeRet"),
|
|
93
93
|
/**
|
|
94
94
|
* Returns employee data.
|
|
95
95
|
*
|
|
96
96
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/EmployeeQuery
|
|
97
97
|
*/
|
|
98
|
-
query: async (
|
|
98
|
+
query: async (integrationUserId, params) => this.sendRequestBase(integrationUserId, { EmployeeQueryRq: params }, "EmployeeQueryRs", "EmployeeRet"),
|
|
99
99
|
};
|
|
100
100
|
journalEntry = {
|
|
101
101
|
/**
|
|
@@ -129,7 +129,7 @@ class ClientQBD extends BaseClient_1.default {
|
|
|
129
129
|
*
|
|
130
130
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/JournalEntryAdd
|
|
131
131
|
*/
|
|
132
|
-
add: async (
|
|
132
|
+
add: async (integrationUserId, params) => this.sendRequestBase(integrationUserId, { JournalEntryAddRq: { JournalEntryAdd: params } }, "JournalEntryAddRs", "JournalEntryRet"),
|
|
133
133
|
/**
|
|
134
134
|
* Modifies a journal entry.
|
|
135
135
|
*
|
|
@@ -139,7 +139,7 @@ class ClientQBD extends BaseClient_1.default {
|
|
|
139
139
|
*
|
|
140
140
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/JournalEntryMod
|
|
141
141
|
*/
|
|
142
|
-
mod: async (
|
|
142
|
+
mod: async (integrationUserId, params) => this.sendRequestBase(integrationUserId, { JournalEntryModRq: { JournalEntryMod: params } }, "JournalEntryModRs", "JournalEntryRet"),
|
|
143
143
|
/**
|
|
144
144
|
* In traditional accounting, transactions are entered into the general
|
|
145
145
|
* journal and categorized exclusively by account. In QuickBooks, most
|
|
@@ -164,7 +164,7 @@ class ClientQBD extends BaseClient_1.default {
|
|
|
164
164
|
*
|
|
165
165
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/JournalEntryQuery
|
|
166
166
|
*/
|
|
167
|
-
query: async (
|
|
167
|
+
query: async (integrationUserId, params) => this.sendRequestBase(integrationUserId, { JournalEntryQueryRq: params }, "JournalEntryQueryRs", "JournalEntryRet"),
|
|
168
168
|
};
|
|
169
169
|
timeTracking = {
|
|
170
170
|
/**
|
|
@@ -177,7 +177,7 @@ class ClientQBD extends BaseClient_1.default {
|
|
|
177
177
|
*
|
|
178
178
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/TimeTrackingQuery
|
|
179
179
|
*/
|
|
180
|
-
add: async (
|
|
180
|
+
add: async (integrationUserId, params) => this.sendRequestBase(integrationUserId, { TimeTrackingAddRq: { TimeTrackingAdd: params } }, "TimeTrackingAddRs", "TimeTrackingRet"),
|
|
181
181
|
/**
|
|
182
182
|
* Modifies a time tracking transaction.
|
|
183
183
|
*
|
|
@@ -204,7 +204,7 @@ class ClientQBD extends BaseClient_1.default {
|
|
|
204
204
|
*
|
|
205
205
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/TimeTrackingMod
|
|
206
206
|
*/
|
|
207
|
-
mod: async (
|
|
207
|
+
mod: async (integrationUserId, params) => this.sendRequestBase(integrationUserId, { TimeTrackingModRq: { TimeTrackingMod: params } }, "TimeTrackingModRs", "TimeTrackingRet"),
|
|
208
208
|
/**
|
|
209
209
|
* The time-tracking transactions that are returned in this query include
|
|
210
210
|
* time tracking information that was entered into QuickBooks manually or
|
|
@@ -215,7 +215,7 @@ class ClientQBD extends BaseClient_1.default {
|
|
|
215
215
|
*
|
|
216
216
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/TimeTrackingQuery
|
|
217
217
|
*/
|
|
218
|
-
query: async (
|
|
218
|
+
query: async (integrationUserId, params) => this.sendRequestBase(integrationUserId, { TimeTrackingQueryRq: params }, "TimeTrackingQueryRs", "TimeTrackingRet"),
|
|
219
219
|
};
|
|
220
220
|
vendor = {
|
|
221
221
|
/**
|
|
@@ -231,19 +231,19 @@ class ClientQBD extends BaseClient_1.default {
|
|
|
231
231
|
*
|
|
232
232
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/VendorAdd
|
|
233
233
|
*/
|
|
234
|
-
add: async (
|
|
234
|
+
add: async (integrationUserId, params) => this.sendRequestBase(integrationUserId, { VendorAddRq: { VendorAdd: params } }, "VendorAddRs", "VendorRet"),
|
|
235
235
|
/**
|
|
236
236
|
* Modifies a vendor.
|
|
237
237
|
*
|
|
238
238
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/VendorMod
|
|
239
239
|
*/
|
|
240
|
-
mod: async (
|
|
240
|
+
mod: async (integrationUserId, params) => this.sendRequestBase(integrationUserId, { VendorModRq: { VendorMod: params } }, "VendorModRs", "VendorRet"),
|
|
241
241
|
/**
|
|
242
242
|
* Queries for the specified vendor or set of vendors.
|
|
243
243
|
*
|
|
244
244
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/VendorQuery
|
|
245
245
|
*/
|
|
246
|
-
query: async (
|
|
246
|
+
query: async (integrationUserId, params) => this.sendRequestBase(integrationUserId, { VendorQueryRq: params }, "VendorQueryRs", "VendorRet"),
|
|
247
247
|
};
|
|
248
248
|
/**
|
|
249
249
|
* Send any QBXML request to QuickBooks Desktop.
|
|
@@ -251,11 +251,11 @@ class ClientQBD extends BaseClient_1.default {
|
|
|
251
251
|
* Available APIs:
|
|
252
252
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop
|
|
253
253
|
*/
|
|
254
|
-
async sendRequest(
|
|
255
|
-
return this.sendAPIRequest("qbd",
|
|
254
|
+
async sendRequest(integrationUserId, requestObj) {
|
|
255
|
+
return this.sendAPIRequest("qbd", integrationUserId, requestObj);
|
|
256
256
|
}
|
|
257
|
-
async sendRequestBase(
|
|
258
|
-
const response = (await this.sendRequest(
|
|
257
|
+
async sendRequestBase(integrationUserId, params, responseKey, responseBodyKey) {
|
|
258
|
+
const response = (await this.sendRequest(integrationUserId, params));
|
|
259
259
|
const responseBody = response[responseKey]?.[responseBodyKey];
|
|
260
260
|
if (responseBody == null) {
|
|
261
261
|
throw new Error("No response");
|