conductor-node 0.2.1 → 0.4.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.
@@ -5,6 +5,328 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const BaseClient_1 = __importDefault(require("../BaseClient"));
7
7
  class ClientQBD extends BaseClient_1.default {
8
+ account = {
9
+ /**
10
+ * Perform the same activities as a user does in the QB New Account form,
11
+ * which can be accessed in QB by selecting "Lists" → "Chart of Accounts" →
12
+ * "Accounts" → "New".
13
+ *
14
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/AccountAdd
15
+ */
16
+ add: async (qbwcUsername, params) => {
17
+ const response = (await this.sendRequest(qbwcUsername, {
18
+ AccountAddRq: { AccountAdd: params },
19
+ }));
20
+ const responseBody = response.AccountAddRs.AccountRet;
21
+ if (!responseBody) {
22
+ throw new Error("No response");
23
+ }
24
+ return responseBody;
25
+ },
26
+ /**
27
+ * Modifies an account.
28
+ *
29
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/AccountMod
30
+ */
31
+ mod: async (qbwcUsername, params) => {
32
+ const response = (await this.sendRequest(qbwcUsername, {
33
+ AccountModRq: { AccountMod: params },
34
+ }));
35
+ const responseBody = response.AccountModRs.AccountRet;
36
+ if (!responseBody) {
37
+ throw new Error("No response");
38
+ }
39
+ return responseBody;
40
+ },
41
+ /**
42
+ * `AccountQuery` is a list query that returns data for all accounts that
43
+ * match the provided filter criteria. Notice that it returns only data
44
+ * internal to the account itself. It does not return any data about
45
+ * transactions involving the account. It does, however, return the parent
46
+ * account, if there is one. You can search across all accounts or you can
47
+ * specify an account type and search only those.
48
+ *
49
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/AccountQuery
50
+ */
51
+ query: async (qbwcUsername, params) => {
52
+ const response = (await this.sendRequest(qbwcUsername, {
53
+ AccountQueryRq: params,
54
+ }));
55
+ const responseBody = response.AccountQueryRs.AccountRet;
56
+ if (!responseBody) {
57
+ throw new Error("No response");
58
+ }
59
+ return responseBody;
60
+ },
61
+ };
62
+ customer = {
63
+ /**
64
+ * The customer list includes information about the QuickBooks user’s
65
+ * customers and the individual jobs that are being performed for them. A
66
+ * `CustomerRef` aggregate refers to one of the customers (or customer jobs)
67
+ * on the list. In a request, if a `CustomerRef` aggregate includes both
68
+ * `FullName` and `ListID`, `FullName` will be ignored. Special cases to note:
69
+ *
70
+ * - In `SalesReceipt` and `ReceivePayment` requests, `CustomerRef` refers to
71
+ * the customer or customer job to which the payment is credited.
72
+ *
73
+ * - In a `TimeTracking` request, CustomerRef refers to the customer or
74
+ * customer job to which this time could be billed. If `IsBillable` is set
75
+ * to true, `CustomerRef` is required in `TimeTrackingAdd`.
76
+ *
77
+ * - In an `ExpenseLineAdd` request, if `AccountRef` refers to an A/P account,
78
+ * `CustomerRef` must refer to a vendor (not to a customer). If `AccountRef`
79
+ * refers to any other type of account, the `CustomerRef` must refer to a
80
+ * customer.
81
+ *
82
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/CustomerAdd
83
+ */
84
+ add: async (qbwcUsername, params) => {
85
+ const response = (await this.sendRequest(qbwcUsername, {
86
+ CustomerAddRq: { CustomerAdd: params },
87
+ }));
88
+ const responseBody = response.CustomerAddRs.CustomerRet;
89
+ if (!responseBody) {
90
+ throw new Error("No response");
91
+ }
92
+ return responseBody;
93
+ },
94
+ /**
95
+ * Modifies the customer record.
96
+ *
97
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/CustomerMod
98
+ */
99
+ mod: async (qbwcUsername, params) => {
100
+ const response = (await this.sendRequest(qbwcUsername, {
101
+ CustomerModRq: { CustomerMod: params },
102
+ }));
103
+ const responseBody = response.CustomerModRs.CustomerRet;
104
+ if (!responseBody) {
105
+ throw new Error("No response");
106
+ }
107
+ return responseBody;
108
+ },
109
+ /**
110
+ * Returns data for the specified customers.
111
+ *
112
+ * Important: We highly recommend that you use the `IncludeRetElement` tag in
113
+ * your `CustomerQuery` to include any data you want but do NOT include the
114
+ * `ShipAddress` data in the `Response`, unless you need to get the shipping
115
+ * address for a particular customer. Excluding the shipping address data will
116
+ * significantly improve the performance of the `CustomerQuery`.
117
+ *
118
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/CustomerQuery
119
+ */
120
+ query: async (qbwcUsername, params) => {
121
+ const response = (await this.sendRequest(qbwcUsername, {
122
+ CustomerQueryRq: params,
123
+ }));
124
+ const responseBody = response.CustomerQueryRs.CustomerRet;
125
+ if (!responseBody) {
126
+ throw new Error("No response");
127
+ }
128
+ return responseBody;
129
+ },
130
+ };
131
+ employee = {
132
+ /**
133
+ * Adds an employee with personal data about the employee as well as certain
134
+ * payroll-related data.
135
+ *
136
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/EmployeeAdd
137
+ */
138
+ add: async (qbwcUsername, params) => {
139
+ const response = (await this.sendRequest(qbwcUsername, {
140
+ EmployeeAddRq: { EmployeeAdd: params },
141
+ }));
142
+ const responseBody = response.EmployeeAddRs.EmployeeRet;
143
+ if (!responseBody) {
144
+ throw new Error("No response");
145
+ }
146
+ return responseBody;
147
+ },
148
+ /**
149
+ * Modifies an existing employee.
150
+ *
151
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/EmployeeMod
152
+ */
153
+ mod: async (qbwcUsername, params) => {
154
+ const response = (await this.sendRequest(qbwcUsername, {
155
+ EmployeeModRq: { EmployeeMod: params },
156
+ }));
157
+ const responseBody = response.EmployeeModRs.EmployeeRet;
158
+ if (!responseBody) {
159
+ throw new Error("No response");
160
+ }
161
+ return responseBody;
162
+ },
163
+ /**
164
+ * Returns employee data.
165
+ *
166
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/EmployeeQuery
167
+ */
168
+ query: async (qbwcUsername, params) => {
169
+ const response = (await this.sendRequest(qbwcUsername, {
170
+ EmployeeQueryRq: params,
171
+ }));
172
+ const responseBody = response.EmployeeQueryRs.EmployeeRet;
173
+ if (!responseBody) {
174
+ throw new Error("No response");
175
+ }
176
+ return responseBody;
177
+ },
178
+ };
179
+ journalEntry = {
180
+ /**
181
+ * The debit and credit lines can be intermingled. A credit line can legally
182
+ * come first in the journal entry add.
183
+ *
184
+ * In traditional accounting, transactions are entered into the general
185
+ * journal and categorized exclusively by account. In QuickBooks, most
186
+ * transactions can be categorized either by account or by type (invoice,
187
+ * check, and so on). For a few activities in QuickBooks, you must use the
188
+ * general journal directly, for example for recording depreciation. Notice
189
+ * that you must supply the credit line and a corresponding debit line in the
190
+ * same request. It will not work to supply them in two distinct requests. You
191
+ * can supply as many credit lines and debit lines in one single request as
192
+ * you want so long as the total monetary amount from the credits equals the
193
+ * total monetary amount from the debits in that request.
194
+ *
195
+ * Finally, DO NOT supply negative sign for the monetary amounts. QuickBooks
196
+ * does that for you. If you do supply the negative sign, amounts will add
197
+ * instead of cancel and you’ll get a runtime error.
198
+ *
199
+ * Querying for Condensed Transactions: If you need the query to return
200
+ * condensed transactions, you can do this by using either an `Entity` or
201
+ * `Account` filter in the journal query request. Alternatively, you could use
202
+ * the The generic `TransactionQuery`, which can return condensed
203
+ * transactions.
204
+ *
205
+ * If the transaction is a home currency adjustment, QuickBooks will ignore
206
+ * the `IsAmountsEnteredInHomeCurrency`, `CurrencyRef`, and `ExchangeRate`
207
+ * elements.
208
+ *
209
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/JournalEntryAdd
210
+ */
211
+ add: async (qbwcUsername, params) => {
212
+ const response = (await this.sendRequest(qbwcUsername, {
213
+ JournalEntryAddRq: params,
214
+ }));
215
+ const responseBody = response.JournalEntryAddRs.JournalEntryRet;
216
+ if (!responseBody) {
217
+ throw new Error("No response");
218
+ }
219
+ return responseBody;
220
+ },
221
+ /**
222
+ * Modifies a journal entry.
223
+ *
224
+ * If the transaction is a home currency adjustment, QuickBooks will ignore
225
+ * the `IsAmountsEnteredInHomeCurrency`, `CurrencyRef`, and `ExchangeRate`
226
+ * elements.
227
+ *
228
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/JournalEntryMod
229
+ */
230
+ mod: async (qbwcUsername, params) => {
231
+ const response = (await this.sendRequest(qbwcUsername, {
232
+ JournalEntryModRq: { JournalEntryMod: params },
233
+ }));
234
+ const responseBody = response.JournalEntryModRs.JournalEntryRet;
235
+ if (!responseBody) {
236
+ throw new Error("No response");
237
+ }
238
+ return responseBody;
239
+ },
240
+ /**
241
+ * In traditional accounting, transactions are entered into the general
242
+ * journal and categorized exclusively by account. In QuickBooks, most
243
+ * transactions can be categorized either by account or by type (invoice,
244
+ * check, and so on). For a few activities in QuickBooks, you must use the
245
+ * general journal directly, for example for recording depreciation. Notice
246
+ * that you must supply the credit line and a corresponding debit line in the
247
+ * same request. It will not work to supply them in two distinct requests. You
248
+ * can supply as many credit lines and debit lines in one single request as
249
+ * you want so long as the total monetary amount from the credits equals the
250
+ * total monetary amount from the debits in that request.
251
+ *
252
+ * Finally, DO NOT supply negative sign for the monetary amounts. QuickBooks
253
+ * does that for you. If you do supply the negative sign, amounts will add
254
+ * instead of cancel and you’ll get a runtime error.
255
+ *
256
+ * Querying for Condensed Transactions: If you need the query to return
257
+ * condensed transactions, you can do this by using either an `Entity` or
258
+ * `Account` filter in the journal query request. Alternatively, you could use
259
+ * the The generic `TransactionQuery`, which can return condensed
260
+ * transactions.
261
+ *
262
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/JournalEntryQuery
263
+ */
264
+ query: async (qbwcUsername, params) => {
265
+ const response = (await this.sendRequest(qbwcUsername, {
266
+ JournalEntryQueryRq: params,
267
+ }));
268
+ const responseBody = response.JournalEntryQueryRs.JournalEntryRet;
269
+ if (!responseBody) {
270
+ throw new Error("No response");
271
+ }
272
+ return responseBody;
273
+ },
274
+ };
275
+ vendor = {
276
+ /**
277
+ * Adds a vendor.
278
+ *
279
+ * A vendor is any person or company from whom a small business owner buys
280
+ * goods and services. (Banks and tax agencies usually are included on the
281
+ * vendor list.) A company’s vendor list contains information such as account
282
+ * balance and contact information about each vendor. A `VendorRef` aggregate
283
+ * refers to one of the vendors on the list. In a request, if a `VendorRef`
284
+ * aggregate includes both `FullName` and `ListID`, `FullName` will be
285
+ * ignored.
286
+ *
287
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/VendorAdd
288
+ */
289
+ add: async (qbwcUsername, params) => {
290
+ const response = (await this.sendRequest(qbwcUsername, {
291
+ VendorAddRq: { VendorAdd: params },
292
+ }));
293
+ const responseBody = response.VendorAddRs.VendorRet;
294
+ if (!responseBody) {
295
+ throw new Error("No response");
296
+ }
297
+ return responseBody;
298
+ },
299
+ /**
300
+ * Modifies a vendor.
301
+ *
302
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/VendorMod
303
+ */
304
+ mod: async (qbwcUsername, params) => {
305
+ const response = (await this.sendRequest(qbwcUsername, {
306
+ VendorModRq: { VendorMod: params },
307
+ }));
308
+ const responseBody = response.VendorModRs.VendorRet;
309
+ if (!responseBody) {
310
+ throw new Error("No response");
311
+ }
312
+ return responseBody;
313
+ },
314
+ /**
315
+ * Queries for the specified vendor or set of vendors.
316
+ *
317
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/VendorQuery
318
+ */
319
+ query: async (qbwcUsername, params) => {
320
+ const response = (await this.sendRequest(qbwcUsername, {
321
+ VendorQueryRq: params,
322
+ }));
323
+ const responseBody = response.VendorQueryRs.VendorRet;
324
+ if (!responseBody) {
325
+ throw new Error("No response");
326
+ }
327
+ return responseBody;
328
+ },
329
+ };
8
330
  /**
9
331
  * Send any QBXML request to QuickBooks Desktop.
10
332
  *
@@ -13,279 +335,5 @@ class ClientQBD extends BaseClient_1.default {
13
335
  async sendRequest(qbwcUsername, requestObj) {
14
336
  return this.sendAPIRequest("qbd", qbwcUsername, requestObj);
15
337
  }
16
- /**
17
- * Perform the same activities as a user does in the QB New Account form,
18
- * which can be accessed in QB by selecting "Lists" → "Chart of Accounts" →
19
- * "Accounts" → "New".
20
- *
21
- * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/AccountAdd
22
- */
23
- async accountAdd(qbwcUsername, params) {
24
- const response = (await this.sendRequest(qbwcUsername, {
25
- AccountAddRq: { AccountAdd: params },
26
- }));
27
- const responseBody = response.AccountAddRs.AccountRet;
28
- if (!responseBody) {
29
- throw new Error("No response");
30
- }
31
- return responseBody;
32
- }
33
- /**
34
- * Modifies an account.
35
- *
36
- * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/AccountMod
37
- */
38
- async accountMod(qbwcUsername, params) {
39
- const response = (await this.sendRequest(qbwcUsername, {
40
- AccountModRq: { AccountMod: params },
41
- }));
42
- const responseBody = response.AccountModRs.AccountRet;
43
- if (!responseBody) {
44
- throw new Error("No response");
45
- }
46
- return responseBody;
47
- }
48
- /**
49
- * `AccountQuery` is a list query that returns data for all accounts that
50
- * match the provided filter criteria. Notice that it returns only data
51
- * internal to the account itself. It does not return any data about
52
- * transactions involving the account. It does, however, return the parent
53
- * account, if there is one. You can search across all accounts or you can
54
- * specify an account type and search only those.
55
- *
56
- * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/AccountQuery
57
- */
58
- async accountQuery(qbwcUsername, params) {
59
- const response = (await this.sendRequest(qbwcUsername, {
60
- AccountQueryRq: params,
61
- }));
62
- const responseBody = response.AccountQueryRs.AccountRet;
63
- if (!responseBody) {
64
- throw new Error("No response");
65
- }
66
- return responseBody;
67
- }
68
- /**
69
- * The customer list includes information about the QuickBooks user’s
70
- * customers and the individual jobs that are being performed for them. A
71
- * `CustomerRef` aggregate refers to one of the customers (or customer jobs)
72
- * on the list. In a request, if a `CustomerRef` aggregate includes both
73
- * `FullName` and `ListID`, `FullName` will be ignored. Special cases to note:
74
- *
75
- * - In `SalesReceipt` and `ReceivePayment` requests, `CustomerRef` refers to
76
- * the customer or customer job to which the payment is credited.
77
- *
78
- * - In a `TimeTracking` request, CustomerRef refers to the customer or
79
- * customer job to which this time could be billed. If `IsBillable` is set
80
- * to true, `CustomerRef` is required in `TimeTrackingAdd`.
81
- *
82
- * - In an `ExpenseLineAdd` request, if `AccountRef` refers to an A/P account,
83
- * `CustomerRef` must refer to a vendor (not to a customer). If `AccountRef`
84
- * refers to any other type of account, the `CustomerRef` must refer to a
85
- * customer.
86
- *
87
- * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/CustomerAdd
88
- */
89
- async customerAdd(qbwcUsername, params) {
90
- const response = (await this.sendRequest(qbwcUsername, {
91
- CustomerAddRq: { CustomerAdd: params },
92
- }));
93
- const responseBody = response.CustomerAddRs.CustomerRet;
94
- if (!responseBody) {
95
- throw new Error("No response");
96
- }
97
- return responseBody;
98
- }
99
- /**
100
- * Modifies the customer record.
101
- *
102
- * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/CustomerMod
103
- */
104
- async customerMod(qbwcUsername, params) {
105
- const response = (await this.sendRequest(qbwcUsername, {
106
- CustomerModRq: { CustomerMod: params },
107
- }));
108
- const responseBody = response.CustomerModRs.CustomerRet;
109
- if (!responseBody) {
110
- throw new Error("No response");
111
- }
112
- return responseBody;
113
- }
114
- /**
115
- * Returns data for the specified customers.
116
- *
117
- * Important: We highly recommend that you use the `IncludeRetElement` tag in
118
- * your `CustomerQuery` to include any data you want but do NOT include the
119
- * `ShipAddress` data in the `Response`, unless you need to get the shipping
120
- * address for a particular customer. Excluding the shipping address data will
121
- * significantly improve the performance of the `CustomerQuery`.
122
- *
123
- * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/CustomerQuery
124
- */
125
- async customerQuery(qbwcUsername, params) {
126
- const response = (await this.sendRequest(qbwcUsername, {
127
- CustomerQueryRq: params,
128
- }));
129
- const responseBody = response.CustomerQueryRs.CustomerRet;
130
- if (!responseBody) {
131
- throw new Error("No response");
132
- }
133
- return responseBody;
134
- }
135
- /**
136
- * Adds an employee with personal data about the employee as well as certain
137
- * payroll-related data.
138
- *
139
- * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/EmployeeAdd
140
- */
141
- async employeeAdd(qbwcUsername, params) {
142
- const response = (await this.sendRequest(qbwcUsername, {
143
- EmployeeAddRq: { EmployeeAdd: params },
144
- }));
145
- const responseBody = response.EmployeeAddRs.EmployeeRet;
146
- if (!responseBody) {
147
- throw new Error("No response");
148
- }
149
- return responseBody;
150
- }
151
- /**
152
- * Modifies an existing employee.
153
- *
154
- * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/EmployeeMod
155
- */
156
- async employeeMod(qbwcUsername, params) {
157
- const response = (await this.sendRequest(qbwcUsername, {
158
- EmployeeModRq: { EmployeeMod: params },
159
- }));
160
- const responseBody = response.EmployeeModRs.EmployeeRet;
161
- if (!responseBody) {
162
- throw new Error("No response");
163
- }
164
- return responseBody;
165
- }
166
- /**
167
- * Returns employee data.
168
- *
169
- * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/EmployeeQuery
170
- */
171
- async employeeQuery(qbwcUsername, params) {
172
- const response = (await this.sendRequest(qbwcUsername, {
173
- EmployeeQueryRq: params,
174
- }));
175
- const responseBody = response.EmployeeQueryRs.EmployeeRet;
176
- if (!responseBody) {
177
- throw new Error("No response");
178
- }
179
- return responseBody;
180
- }
181
- /**
182
- * The debit and credit lines can be intermingled. A credit line can legally
183
- * come first in the journal entry add.
184
- *
185
- * In traditional accounting, transactions are entered into the general
186
- * journal and categorized exclusively by account. In QuickBooks, most
187
- * transactions can be categorized either by account or by type (invoice,
188
- * check, and so on). For a few activities in QuickBooks, you must use the
189
- * general journal directly, for example for recording depreciation. Notice
190
- * that you must supply the credit line and a corresponding debit line in the
191
- * same request. It will not work to supply them in two distinct requests. You
192
- * can supply as many credit lines and debit lines in one single request as
193
- * you want so long as the total monetary amount from the credits equals the
194
- * total monetary amount from the debits in that request.
195
- *
196
- * Finally, DO NOT supply negative sign for the monetary amounts. QuickBooks
197
- * does that for you. If you do supply the negative sign, amounts will add
198
- * instead of cancel and you’ll get a runtime error.
199
- *
200
- * Querying for Condensed Transactions: If you need the query to return
201
- * condensed transactions, you can do this by using either an `Entity` or
202
- * `Account` filter in the journal query request. Alternatively, you could use
203
- * the The generic `TransactionQuery`, which can return condensed
204
- * transactions.
205
- *
206
- * If the transaction is a home currency adjustment, QuickBooks will ignore
207
- * the `IsAmountsEnteredInHomeCurrency`, `CurrencyRef`, and `ExchangeRate`
208
- * elements.
209
- *
210
- * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/JournalEntryAdd
211
- */
212
- async journalEntryAdd(qbwcUsername, params) {
213
- const response = (await this.sendRequest(qbwcUsername, {
214
- JournalEntryAddRq: params,
215
- }));
216
- const responseBody = response.JournalEntryAddRs.JournalEntryRet;
217
- if (!responseBody) {
218
- throw new Error("No response");
219
- }
220
- return responseBody;
221
- }
222
- /**
223
- * Modifies a journal entry.
224
- *
225
- * If the transaction is a home currency adjustment, QuickBooks will ignore
226
- * the `IsAmountsEnteredInHomeCurrency`, `CurrencyRef`, and `ExchangeRate`
227
- * elements.
228
- *
229
- * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/JournalEntryMod
230
- */
231
- async journalEntryMod(qbwcUsername, params) {
232
- const response = (await this.sendRequest(qbwcUsername, {
233
- JournalEntryModRq: { JournalEntryMod: params },
234
- }));
235
- const responseBody = response.JournalEntryModRs.JournalEntryRet;
236
- if (!responseBody) {
237
- throw new Error("No response");
238
- }
239
- return responseBody;
240
- }
241
- /**
242
- * In traditional accounting, transactions are entered into the general
243
- * journal and categorized exclusively by account. In QuickBooks, most
244
- * transactions can be categorized either by account or by type (invoice,
245
- * check, and so on). For a few activities in QuickBooks, you must use the
246
- * general journal directly, for example for recording depreciation. Notice
247
- * that you must supply the credit line and a corresponding debit line in the
248
- * same request. It will not work to supply them in two distinct requests. You
249
- * can supply as many credit lines and debit lines in one single request as
250
- * you want so long as the total monetary amount from the credits equals the
251
- * total monetary amount from the debits in that request.
252
- *
253
- * Finally, DO NOT supply negative sign for the monetary amounts. QuickBooks
254
- * does that for you. If you do supply the negative sign, amounts will add
255
- * instead of cancel and you’ll get a runtime error.
256
- *
257
- * Querying for Condensed Transactions: If you need the query to return
258
- * condensed transactions, you can do this by using either an `Entity` or
259
- * `Account` filter in the journal query request. Alternatively, you could use
260
- * the The generic `TransactionQuery`, which can return condensed
261
- * transactions.
262
- *
263
- * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/JournalEntryQuery
264
- */
265
- async journalEntryQuery(qbwcUsername, params) {
266
- const response = (await this.sendRequest(qbwcUsername, {
267
- JournalEntryQueryRq: params,
268
- }));
269
- const responseBody = response.JournalEntryQueryRs.JournalEntryRet;
270
- if (!responseBody) {
271
- throw new Error("No response");
272
- }
273
- return responseBody;
274
- }
275
- /**
276
- * Queries for the specified vendor or set of vendors.
277
- *
278
- * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/VendorQuery
279
- */
280
- async vendorQuery(qbwcUsername, params) {
281
- const response = (await this.sendRequest(qbwcUsername, {
282
- VendorQueryRq: params,
283
- }));
284
- const responseBody = response.VendorQueryRs.VendorRet;
285
- if (!responseBody) {
286
- throw new Error("No response");
287
- }
288
- return responseBody;
289
- }
290
338
  }
291
339
  exports.default = ClientQBD;