conductor-node 3.2.0 → 3.2.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.
@@ -0,0 +1,5 @@
1
+ import type Client from "@conductor/client/Client";
2
+ export default class BaseClient {
3
+ protected readonly root: Client;
4
+ constructor(client: Client);
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class BaseClient {
4
+ root;
5
+ constructor(client) {
6
+ this.root = client;
7
+ }
8
+ }
9
+ exports.default = BaseClient;
@@ -0,0 +1,21 @@
1
+ import type { Environment } from "@conductor/client/environment";
2
+ import ClientQbd from "@conductor/client/qbd/ClientQbd";
3
+ export interface ClientOptions {
4
+ /** Log the each request and response. */
5
+ verbose?: boolean;
6
+ environment?: Environment;
7
+ }
8
+ export interface IntegrationRequestParams {
9
+ integrationUserConnectionId: string;
10
+ requestObject: object;
11
+ }
12
+ export default class Client {
13
+ /** QuickBooks Desktop integration. */
14
+ readonly qbd: ClientQbd;
15
+ private readonly serverURL;
16
+ private readonly gqlClient;
17
+ private readonly verbose;
18
+ constructor(apiKey: string, { verbose, environment }?: ClientOptions);
19
+ integrationUserConnections(): Promise<object[]>;
20
+ integrationRequest(integrationRequestParams: IntegrationRequestParams): Promise<object>;
21
+ }
package/dist/Client.js ADDED
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const environment_1 = require("@conductor/client/environment");
7
+ const ClientQbd_1 = __importDefault(require("@conductor/client/qbd/ClientQbd"));
8
+ const graphql_request_1 = require("graphql-request");
9
+ class Client {
10
+ /** QuickBooks Desktop integration. */
11
+ qbd;
12
+ serverURL;
13
+ gqlClient;
14
+ verbose;
15
+ constructor(apiKey, { verbose = false, environment = "staging" } = {}) {
16
+ this.verbose = verbose;
17
+ this.serverURL = (0, environment_1.envToBaseServerURL)(environment);
18
+ this.gqlClient = new graphql_request_1.GraphQLClient(`${this.serverURL}/graphql`, {
19
+ headers: {
20
+ authorization: `Bearer ${apiKey}`,
21
+ },
22
+ });
23
+ this.qbd = new ClientQbd_1.default(this);
24
+ }
25
+ async integrationUserConnections() {
26
+ const data = await this.gqlClient.request(`#graphql
27
+ query {
28
+ integrationUserConnections {
29
+ id
30
+ integration {
31
+ id
32
+ name
33
+ }
34
+ username
35
+ }
36
+ }
37
+ `);
38
+ // @ts-expect-error - This will pass after we integrate GQL codegen.
39
+ return data.integrationUserConnections;
40
+ }
41
+ // TODO: Hide this method from the dev user while still allowing the
42
+ // integration clients to access it.
43
+ async integrationRequest(integrationRequestParams) {
44
+ if (this.verbose) {
45
+ console.log(`Client sent request to ${this.serverURL}:`, JSON.stringify(integrationRequestParams, null, 2));
46
+ console.time("Request time");
47
+ }
48
+ const response = await this.gqlClient.request(`#graphql
49
+ query IntegrationRequest($integrationRequestParams: IntegrationRequestParams!) {
50
+ integrationRequest(integrationRequestParams: $integrationRequestParams)
51
+ }
52
+ `, { integrationRequestParams });
53
+ // @ts-expect-error - This will pass after we integrate GQL codegen.
54
+ const responseBody = response.integrationRequest;
55
+ if (this.verbose) {
56
+ console.timeEnd("Request time");
57
+ console.log(`Client received response from ${this.serverURL}:`, JSON.stringify(responseBody, null, 2));
58
+ }
59
+ return responseBody;
60
+ }
61
+ }
62
+ exports.default = Client;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Client_1 = __importDefault(require("@conductor/client/Client"));
7
+ describe("Client", () => {
8
+ test("Create a new Client", () => {
9
+ const client = new Client_1.default("mock_api_key");
10
+ expect(client).toBeInstanceOf(Client_1.default);
11
+ });
12
+ test("Create a new Client with options", () => {
13
+ const client = new Client_1.default("mock_api_key", { environment: "staging" });
14
+ expect(client).toBeInstanceOf(Client_1.default);
15
+ });
16
+ });
@@ -0,0 +1,2 @@
1
+ export declare type Environment = "development" | "staging";
2
+ export declare function envToBaseServerURL(environment: Environment): string;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.envToBaseServerURL = void 0;
4
+ const STAGING_BASE_URL = "https://staging.api.conductor.is";
5
+ const DEVELOPMENT_BASE_URL = "https://conductor.ngrok.io";
6
+ function envToBaseServerURL(environment) {
7
+ switch (environment) {
8
+ case "staging":
9
+ return STAGING_BASE_URL;
10
+ case "development":
11
+ return DEVELOPMENT_BASE_URL;
12
+ default:
13
+ throw new Error("Invalid environment");
14
+ }
15
+ }
16
+ exports.envToBaseServerURL = envToBaseServerURL;
@@ -0,0 +1,376 @@
1
+ import BaseClient from "@conductor/client/BaseClient";
2
+ import type * as qbd from "@conductor/client/qbd/qbdTypes";
3
+ export default class ClientQbd extends BaseClient {
4
+ account: {
5
+ /**
6
+ * Perform the same activities as a user does in the QB New Account form,
7
+ * which can be accessed in QB by selecting "Lists" → "Chart of Accounts" →
8
+ * "Accounts" → "New".
9
+ *
10
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/AccountAdd
11
+ */
12
+ add: (integrationUserConnectionId: string, params: qbd.AccountAddRq["AccountAdd"]) => Promise<NonNullable<qbd.AccountAddRs["AccountRet"]>>;
13
+ /**
14
+ * Modifies an account.
15
+ *
16
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/AccountMod
17
+ */
18
+ mod: (integrationUserConnectionId: string, params: qbd.AccountModRq["AccountMod"]) => Promise<NonNullable<qbd.AccountModRs["AccountRet"]>>;
19
+ /**
20
+ * `AccountQuery` is a list query that returns data for all accounts that
21
+ * match the provided filter criteria. Notice that it returns only data
22
+ * internal to the account itself. It does not return any data about
23
+ * transactions involving the account. It does, however, return the parent
24
+ * account, if there is one. You can search across all accounts or you can
25
+ * specify an account type and search only those.
26
+ *
27
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/AccountQuery
28
+ */
29
+ query: (integrationUserConnectionId: string, params: qbd.AccountQueryRq) => Promise<NonNullable<qbd.AccountQueryRs["AccountRet"]>>;
30
+ };
31
+ check: {
32
+ /**
33
+ * The amount of a check is the total of the amounts assigned to expense
34
+ * lines and item lines. You can write a check for:
35
+ * - Any expense that you track through expense accounts.
36
+ * - The following types of items: fixed asset, non-inventory part, service,
37
+ * and other charge.
38
+ * - Putting money into your petty cash account.
39
+ * - Inventory part items (if you use the inventory/purchase order feature).
40
+ *
41
+ * You cannot use a `CheckAdd` for any of the following:
42
+ * - Paying a bill by check; instead, use a `BillPaymentCheckAdd`.
43
+ * - Paying employees or create paychecks.
44
+ * - Paying payroll taxes and liabilities.
45
+ * - Paying sales tax.
46
+ * - Paying for received items.
47
+ *
48
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/CheckAdd
49
+ */
50
+ add: (integrationUserConnectionId: string, params: qbd.CheckAddRq["CheckAdd"]) => Promise<NonNullable<qbd.CheckAddRs["CheckRet"]>>;
51
+ /**
52
+ * Modifies an existing Check. Notice that you cannot use this to modify BillPaymentChecks.
53
+ *
54
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/CheckMod
55
+ */
56
+ mod: (integrationUserConnectionId: string, params: qbd.CheckModRq["CheckMod"]) => Promise<NonNullable<qbd.CheckModRs["CheckRet"]>>;
57
+ /**
58
+ * Returns certain types of checks based on the supplied query criteria.
59
+ * Note that `BillPaymentChecks`, payroll checks, and liability checks are
60
+ * not returned.
61
+ *
62
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/CheckQuery
63
+ */
64
+ query: (integrationUserConnectionId: string, params: qbd.CheckQueryRq) => Promise<NonNullable<qbd.CheckQueryRs["CheckRet"]>>;
65
+ };
66
+ class: {
67
+ /**
68
+ * Classes can be used to separate transactions into meaningful categories.
69
+ * (For example, transactions could be classified according to department,
70
+ * business location, or type of work.) In QuickBooks, class tracking is off
71
+ * by default.
72
+ *
73
+ * A `ClassRef` aggregate refers to one of these named classes. For example,
74
+ * in a `TimeTracking` message, `ClassRef` refers to the QuickBooks class
75
+ * into which the timed activity falls. If a `ClassRef` aggregate includes
76
+ * both `FullName` and `ListID`, `FullName` will be ignored.
77
+ *
78
+ * In an `InvoiceAdd` request, if you specify a `ClassRef` for the whole
79
+ * invoice, that same `ClassRef` is automatically used in the line items. If
80
+ * you want to clear that (that is, have NO `ClassRef` for the line item,
81
+ * you can clear it in the line item by simply not specifying it in the line
82
+ * item.
83
+ *
84
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/ClassAdd
85
+ */
86
+ add: (integrationUserConnectionId: string, params: qbd.ClassAddRq["ClassAdd"]) => Promise<NonNullable<qbd.ClassAddRs["ClassRet"]>>;
87
+ /**
88
+ * Modifies the specified class.
89
+ *
90
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/ClassMod
91
+ */
92
+ mod: (integrationUserConnectionId: string, params: qbd.ClassModRq["ClassMod"]) => Promise<NonNullable<qbd.ClassModRs["ClassRet"]>>;
93
+ /**
94
+ * Queries for existing classes.
95
+ *
96
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/ClassQuery
97
+ */
98
+ query: (integrationUserConnectionId: string, params: qbd.ClassQueryRq) => Promise<NonNullable<qbd.ClassQueryRs["ClassRet"]>>;
99
+ };
100
+ customer: {
101
+ /**
102
+ * The customer list includes information about the QuickBooks user’s
103
+ * customers and the individual jobs that are being performed for them. A
104
+ * `CustomerRef` aggregate refers to one of the customers (or customer jobs)
105
+ * on the list. In a request, if a `CustomerRef` aggregate includes both
106
+ * `FullName` and `ListID`, `FullName` will be ignored. Special cases to
107
+ * note:
108
+ *
109
+ * - In `SalesReceipt` and `ReceivePayment` requests, `CustomerRef` refers
110
+ * to the customer or customer job to which the payment is credited.
111
+ *
112
+ * - In a `TimeTracking` request, CustomerRef refers to the customer or
113
+ * customer job to which this time could be billed. If `IsBillable` is set
114
+ * to true, `CustomerRef` is required in `TimeTrackingAdd`.
115
+ *
116
+ * - In an `ExpenseLineAdd` request, if `AccountRef` refers to an A/P
117
+ * account, `CustomerRef` must refer to a vendor (not to a customer). If
118
+ * `AccountRef` refers to any other type of account, the `CustomerRef`
119
+ * must refer to a customer.
120
+ *
121
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/CustomerAdd
122
+ */
123
+ add: (integrationUserConnectionId: string, params: qbd.CustomerAddRq["CustomerAdd"]) => Promise<NonNullable<qbd.CustomerAddRs["CustomerRet"]>>;
124
+ /**
125
+ * Modifies the customer record.
126
+ *
127
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/CustomerMod
128
+ */
129
+ mod: (integrationUserConnectionId: string, params: qbd.CustomerModRq["CustomerMod"]) => Promise<NonNullable<qbd.CustomerModRs["CustomerRet"]>>;
130
+ /**
131
+ * Returns data for the specified customers.
132
+ *
133
+ * Important: We highly recommend that you use the `IncludeRetElement` tag
134
+ * in your `CustomerQuery` to include any data you want but do NOT include
135
+ * the `ShipAddress` data in the `Response`, unless you need to get the
136
+ * shipping address for a particular customer. Excluding the shipping
137
+ * address data will significantly improve the performance of the
138
+ * `CustomerQuery`.
139
+ *
140
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/CustomerQuery
141
+ */
142
+ query: (integrationUserConnectionId: string, params: qbd.CustomerQueryRq) => Promise<NonNullable<qbd.CustomerQueryRs["CustomerRet"]>>;
143
+ };
144
+ employee: {
145
+ /**
146
+ * Adds an employee with personal data about the employee as well as certain
147
+ * payroll-related data.
148
+ *
149
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/EmployeeAdd
150
+ */
151
+ add: (integrationUserConnectionId: string, params: qbd.EmployeeAddRq["EmployeeAdd"]) => Promise<NonNullable<qbd.EmployeeAddRs["EmployeeRet"]>>;
152
+ /**
153
+ * Modifies an existing employee.
154
+ *
155
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/EmployeeMod
156
+ */
157
+ mod: (integrationUserConnectionId: string, params: qbd.EmployeeModRq["EmployeeMod"]) => Promise<NonNullable<qbd.EmployeeModRs["EmployeeRet"]>>;
158
+ /**
159
+ * Returns employee data.
160
+ *
161
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/EmployeeQuery
162
+ */
163
+ query: (integrationUserConnectionId: string, params: qbd.EmployeeQueryRq) => Promise<NonNullable<qbd.EmployeeQueryRs["EmployeeRet"]>>;
164
+ };
165
+ itemService: {
166
+ /**
167
+ * Adds a service item, which is an item that refers to services that a
168
+ * business charges for or purchases. Examples include specialized labor,
169
+ * consulting hours, and professional fees. An `ItemServiceRef` aggregate
170
+ * refers to an item on the ItemService list. In a request, if an
171
+ * `ItemServiceRef` aggregate includes both `FullName` and `ListID`,
172
+ * `FullName` will be ignored.
173
+ *
174
+ * In a `TimeTracking` message, `ItemServiceRef` refers to the type of work.
175
+ * If no `CustomerRef` is specified, then `ItemServiceRef` is not needed. If
176
+ * `IsBillable` is set to true, then `TimeTrackingAdd` must include both
177
+ * `ItemServiceRef` and `CustomerRef`.
178
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/ItemServiceAdd
179
+ */
180
+ add: (integrationUserConnectionId: string, params: qbd.ItemServiceAddRq["ItemServiceAdd"]) => Promise<NonNullable<qbd.ItemServiceAddRs["ItemServiceRet"]>>;
181
+ /**
182
+ * Modifies an existing service item.
183
+ *
184
+ * About `SalesOrPurchaseMod` versus `SalesAndPurchaseMod` in an
185
+ * `ItemServiceMod` request:
186
+ * - You cannot change the reimbursable status of a service item through the
187
+ * SDK. For example, if a service item is marked as non-reimbursable in
188
+ * QuickBooks, you cannot send a modify request that includes a
189
+ * `SalesAndPurchaseMod` aggregate. Similarly, if you send an
190
+ * `ItemServiceAdd` request that includes a `SalesOrPurchase` aggregate,
191
+ * you cannot later modify that item using a `SalesAndPurchaseMod`
192
+ * aggregate.
193
+ * - You can modify the various account references using the appropriate
194
+ * account reference aggregate and the matching `RefToExistingTxns`
195
+ * boolean. You need to use the boolean when you change an account ref
196
+ * because the QuickBooks UI displays a prompt asking whether the change
197
+ * should apply to existing transactions or not.
198
+ * - Specifying `False` means that the mod will not take affect if there
199
+ * are existing transactions.
200
+ * - Specifying `True` for the boolean basically dismisses this with a
201
+ * “Yes” answer, allowing your changes to be made and changes any
202
+ * existing transactions that use the item with that `AccountRef`.
203
+ * Setting this to `True` should be used with caution and normally only
204
+ * after some user has indicated that they want those changes made to
205
+ * all those existing transactions! If any affected transactions are
206
+ * protected by a closing date and password, the `AccountRef` changes
207
+ * will not be made and so the `Mod` request will return an error
208
+ * without making the requested `Mod`.
209
+ *
210
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/ItemServiceMod
211
+ */
212
+ mod: (integrationUserConnectionId: string, params: qbd.ItemServiceModRq["ItemServiceMod"]) => Promise<NonNullable<qbd.ItemServiceModRs["ItemServiceRet"]>>;
213
+ /**
214
+ * Queries for the specified service item or set of items.
215
+ *
216
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/ItemServiceQuery
217
+ */
218
+ query: (integrationUserConnectionId: string, params: qbd.ItemServiceQueryRq) => Promise<NonNullable<qbd.ItemServiceQueryRs["ItemServiceRet"]>>;
219
+ };
220
+ journalEntry: {
221
+ /**
222
+ * The debit and credit lines can be intermingled. A credit line can legally
223
+ * come first in the journal entry add.
224
+ *
225
+ * In traditional accounting, transactions are entered into the general
226
+ * journal and categorized exclusively by account. In QuickBooks, most
227
+ * transactions can be categorized either by account or by type (invoice,
228
+ * check, and so on). For a few activities in QuickBooks, you must use the
229
+ * general journal directly, for example for recording depreciation. Notice
230
+ * that you must supply the credit line and a corresponding debit line in
231
+ * the same request. It will not work to supply them in two distinct
232
+ * requests. You can supply as many credit lines and debit lines in one
233
+ * single request as you want so long as the total monetary amount from the
234
+ * credits equals the total monetary amount from the debits in that request.
235
+ *
236
+ * Finally, DO NOT supply negative sign for the monetary amounts. QuickBooks
237
+ * does that for you. If you do supply the negative sign, amounts will add
238
+ * instead of cancel and you’ll get a runtime error.
239
+ *
240
+ * Querying for Condensed Transactions: If you need the query to return
241
+ * condensed transactions, you can do this by using either an `Entity` or
242
+ * `Account` filter in the journal query request. Alternatively, you could
243
+ * use the The generic `TransactionQuery`, which can return condensed
244
+ * transactions.
245
+ *
246
+ * If the transaction is a home currency adjustment, QuickBooks will ignore
247
+ * the `IsAmountsEnteredInHomeCurrency`, `CurrencyRef`, and `ExchangeRate`
248
+ * elements.
249
+ *
250
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/JournalEntryAdd
251
+ */
252
+ add: (integrationUserConnectionId: string, params: qbd.JournalEntryAddRq["JournalEntryAdd"]) => Promise<NonNullable<qbd.JournalEntryAddRs["JournalEntryRet"]>>;
253
+ /**
254
+ * Modifies a journal entry.
255
+ *
256
+ * If the transaction is a home currency adjustment, QuickBooks will ignore
257
+ * the `IsAmountsEnteredInHomeCurrency`, `CurrencyRef`, and `ExchangeRate`
258
+ * elements.
259
+ *
260
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/JournalEntryMod
261
+ */
262
+ mod: (integrationUserConnectionId: string, params: qbd.JournalEntryModRq["JournalEntryMod"]) => Promise<NonNullable<qbd.JournalEntryModRs["JournalEntryRet"]>>;
263
+ /**
264
+ * In traditional accounting, transactions are entered into the general
265
+ * journal and categorized exclusively by account. In QuickBooks, most
266
+ * transactions can be categorized either by account or by type (invoice,
267
+ * check, and so on). For a few activities in QuickBooks, you must use the
268
+ * general journal directly, for example for recording depreciation. Notice
269
+ * that you must supply the credit line and a corresponding debit line in
270
+ * the same request. It will not work to supply them in two distinct
271
+ * requests. You can supply as many credit lines and debit lines in one
272
+ * single request as you want so long as the total monetary amount from the
273
+ * credits equals the total monetary amount from the debits in that request.
274
+ *
275
+ * Finally, DO NOT supply negative sign for the monetary amounts. QuickBooks
276
+ * does that for you. If you do supply the negative sign, amounts will add
277
+ * instead of cancel and you’ll get a runtime error.
278
+ *
279
+ * Querying for Condensed Transactions: If you need the query to return
280
+ * condensed transactions, you can do this by using either an `Entity` or
281
+ * `Account` filter in the journal query request. Alternatively, you could
282
+ * use the The generic `TransactionQuery`, which can return condensed
283
+ * transactions.
284
+ *
285
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/JournalEntryQuery
286
+ */
287
+ query: (integrationUserConnectionId: string, params: qbd.JournalEntryQueryRq) => Promise<NonNullable<qbd.JournalEntryQueryRs["JournalEntryRet"]>>;
288
+ };
289
+ timeTracking: {
290
+ /**
291
+ * The time-tracking transactions that are returned in this query include
292
+ * time tracking information that was entered into QuickBooks manually or
293
+ * gathered using the QuickBooks “Timer” or “Stopwatch.” Note that the
294
+ * QuickBooks Timer application can run on its own without QuickBooks, but
295
+ * the QuickBooks SDK cannot access the Timer data directly. The Timer data
296
+ * must be imported into QuickBooks before it is accessible via the SDK.)
297
+ *
298
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/TimeTrackingQuery
299
+ */
300
+ add: (integrationUserConnectionId: string, params: qbd.TimeTrackingAddRq["TimeTrackingAdd"]) => Promise<NonNullable<qbd.TimeTrackingAddRs["TimeTrackingRet"]>>;
301
+ /**
302
+ * Modifies a time tracking transaction.
303
+ *
304
+ * This allows you to modify time entry and mark time entered as billed.
305
+ * Applications using qbXML spec levels less than 6.0 aren’t able to Modify
306
+ * a time tracking transaction. However, those applications can achieve the
307
+ * results of a modify operation by deleting the time tracking transaction
308
+ * (using `TxnDelRq`) and then re-adding it with the desired values. You can
309
+ * do this only if no other downstream transactions have used that
310
+ * particular time tracking transaction. (Otherwise, the `TxnDel` request
311
+ * will fail.) This differs slightly from the UI, which allows these
312
+ * transactions to be edited directly. However, even in the UI, modifying a
313
+ * time tracking transaction does not result in changes to any downstream
314
+ * transactions that use it. There is no link between an invoice and the
315
+ * time entries. However when you do the invoicing from QuickBooks,
316
+ * QuickBooks does mark the time entries as “billed.” If you don’t record
317
+ * the time entries as billed properly, then you get into a user workflow
318
+ * issue where every time the user creates an invoice for a customer, QB
319
+ * pops up a dialog asking if they want to bill the un-billed time (which
320
+ * you already billed from your app). That’s why beginning with QB2007 and
321
+ * qbXML spec 6.0 we added support for the “BillableStatus” field *and* add
322
+ * `TimeTrackingMod` so that you can mark the time as billed when you create
323
+ * an invoice for it.
324
+ *
325
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/TimeTrackingMod
326
+ */
327
+ mod: (integrationUserConnectionId: string, params: qbd.TimeTrackingModRq["TimeTrackingMod"]) => Promise<NonNullable<qbd.TimeTrackingModRs["TimeTrackingRet"]>>;
328
+ /**
329
+ * The time-tracking transactions that are returned in this query include
330
+ * time tracking information that was entered into QuickBooks manually or
331
+ * gathered using the QuickBooks “Timer” or “Stopwatch.” Note that the
332
+ * QuickBooks Timer application can run on its own without QuickBooks, but
333
+ * the QuickBooks SDK cannot access the Timer data directly. The Timer data
334
+ * must be imported into QuickBooks before it is accessible via the SDK.)
335
+ *
336
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/TimeTrackingQuery
337
+ */
338
+ query: (integrationUserConnectionId: string, params: qbd.TimeTrackingQueryRq) => Promise<NonNullable<qbd.TimeTrackingQueryRs["TimeTrackingRet"]>>;
339
+ };
340
+ vendor: {
341
+ /**
342
+ * Adds a vendor.
343
+ *
344
+ * A vendor is any person or company from whom a small business owner buys
345
+ * goods and services. (Banks and tax agencies usually are included on the
346
+ * vendor list.) A company’s vendor list contains information such as
347
+ * account balance and contact information about each vendor. A `VendorRef`
348
+ * aggregate refers to one of the vendors on the list. In a request, if a
349
+ * `VendorRef` aggregate includes both `FullName` and `ListID`, `FullName`
350
+ * will be ignored.
351
+ *
352
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/VendorAdd
353
+ */
354
+ add: (integrationUserConnectionId: string, params: qbd.VendorAddRq["VendorAdd"]) => Promise<NonNullable<qbd.VendorAddRs["VendorRet"]>>;
355
+ /**
356
+ * Modifies a vendor.
357
+ *
358
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/VendorMod
359
+ */
360
+ mod: (integrationUserConnectionId: string, params: qbd.VendorModRq["VendorMod"]) => Promise<NonNullable<qbd.VendorModRs["VendorRet"]>>;
361
+ /**
362
+ * Queries for the specified vendor or set of vendors.
363
+ *
364
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/VendorQuery
365
+ */
366
+ query: (integrationUserConnectionId: string, params: qbd.VendorQueryRq) => Promise<NonNullable<qbd.VendorQueryRs["VendorRet"]>>;
367
+ };
368
+ /**
369
+ * Send any QBXML request to QuickBooks Desktop.
370
+ *
371
+ * Available APIs:
372
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop
373
+ */
374
+ sendRequest(integrationUserConnectionId: string, requestObject: object): Promise<object>;
375
+ private sendRequestBase;
376
+ }