conductor-node 11.3.2 → 11.4.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/README.md CHANGED
@@ -41,7 +41,7 @@ Conductor, the company, is building a data integration platform for vertical Saa
41
41
 
42
42
  ## Requirements
43
43
 
44
- 1. A Conductor API key pair: one secret key, one publishable key. Please [complete this form](https://73a5v9t55ed.typeform.com/to/VRX7rfrN) to join the beta.
44
+ 1. A Conductor API key pair: one secret key, one publishable key. Please [complete this form](https://forms.gle/1LTGXy2Hcyzw6qWa6) to join the beta.
45
45
  2. Node.js v16 or later.
46
46
 
47
47
  ## Installation
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "11.3.2",
3
+ "version": "11.4.1",
4
4
  "description": "QuickBooks Desktop API for Node.js and TypeScript",
5
5
  "keywords": [
6
6
  "QuickBooks",
@@ -12,6 +12,7 @@
12
12
  "QB Desktop",
13
13
  "QB Enterprise",
14
14
  "QBD",
15
+ "QBDT",
15
16
  "QBE",
16
17
  "Intuit"
17
18
  ],
@@ -30,11 +30,11 @@ class Client {
30
30
  this.qbd = new QbdIntegration_1.default(this.httpClient);
31
31
  }
32
32
  createHttpClient(apiKey, verbose) {
33
- // Use an environment variable for overriding the server URL for testing and
34
- // development instead of checking `NODE_ENV` to allow `conductor-node`
35
- // users to use the production API server when their `NODE_ENV` is set to
36
- // "development".
37
- const apiServerUrl = process.env["CONDUCTOR__MOCK_API_SERVER_URL"] ??
33
+ // We use an environment variable for overriding the server URL for testing
34
+ // and development instead of checking `NODE_ENV` to ensure `conductor-node`
35
+ // users use the production API server when their `NODE_ENV` is set to
36
+ // "development". Only Conductor team members can use the mock API server.
37
+ const apiServerUrl = process.env["CONDUCTOR_MOCK_API_SERVER_URL"] ??
38
38
  "https://api.conductor.is";
39
39
  const httpClient = axios_1.default.create({
40
40
  baseURL: `${apiServerUrl}/v1`,
@@ -423,7 +423,7 @@ export default class QbdIntegration extends BaseIntegration {
423
423
  add: (endUserId: string, params: QbdTypes.CheckAddRq["CheckAdd"]) => Promise<NonNullable<QbdTypes.CheckAddRs["CheckRet"]>>;
424
424
  /**
425
425
  * Modifies an existing Check. Notice that you cannot use this to modify
426
- * BillPaymentChecks.
426
+ * `BillPaymentChecks`.
427
427
  *
428
428
  * See more: https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/CheckMod
429
429
  */
@@ -993,7 +993,7 @@ export default class QbdIntegration extends BaseIntegration {
993
993
  * If you Add an invoice that has an inventory item on it, QB will
994
994
  * automatically calculate COGS and post it to the COGS account. (The
995
995
  * inventory item will need to be setup to post to the COGS account and must
996
- * have a unit cost in it.) However, notice that such an InvoiceAdd has
996
+ * have a unit cost in it.) However, notice that such an `InvoiceAdd` has
997
997
  * sales prices, not cost, so the Add is not impacting the cost of the item.
998
998
  * The cost of the item is only affected by purchases (bills and item
999
999
  * receipts) sales and inventory adjustments.
@@ -1583,8 +1583,9 @@ export default class QbdIntegration extends BaseIntegration {
1583
1583
  * In a `TimeTracking` message, `ItemServiceRef` refers to the type of work.
1584
1584
  * If no `CustomerRef` is specified, then `ItemServiceRef` is not needed. If
1585
1585
  * `IsBillable` is set to true, then `TimeTrackingAdd` must include both
1586
- * `ItemServiceRef` and `CustomerRef`. See more:
1587
- * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/ItemServiceAdd
1586
+ * `ItemServiceRef` and `CustomerRef`.
1587
+ *
1588
+ * See more: https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/ItemServiceAdd
1588
1589
  */
1589
1590
  add: (endUserId: string, params: QbdTypes.ItemServiceAddRq["ItemServiceAdd"]) => Promise<NonNullable<QbdTypes.ItemServiceAddRs["ItemServiceRet"]>>;
1590
1591
  /**
@@ -1819,9 +1820,7 @@ export default class QbdIntegration extends BaseIntegration {
1819
1820
  * QuickBooks Payroll Info window that provides detailed employee
1820
1821
  * information employee.
1821
1822
  *
1822
- *
1823
- * See more:
1824
- * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/PayrollItemWageAdd
1823
+ * See more: https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/PayrollItemWageAdd
1825
1824
  */
1826
1825
  add: (endUserId: string, params: QbdTypes.PayrollItemWageAddRq["PayrollItemWageAdd"]) => Promise<NonNullable<QbdTypes.PayrollItemWageAddRs["PayrollItemWageRet"]>>;
1827
1826
  /**
@@ -2457,14 +2456,23 @@ export default class QbdIntegration extends BaseIntegration {
2457
2456
  */
2458
2457
  timeTracking: {
2459
2458
  /**
2460
- * The time-tracking transactions that are returned in this query include
2461
- * time tracking information that was entered into QuickBooks manually or
2462
- * gathered using the QuickBooks “Timer” or “Stopwatch.” Note that the
2463
- * QuickBooks Timer application can run on its own without QuickBooks, but
2464
- * the QuickBooks SDK cannot access the Timer data directly. The Timer data
2465
- * must be imported into QuickBooks before it is accessible via the SDK.)
2459
+ * This request adds a time tracking transaction to QuickBooks, mirroring
2460
+ * the time-tracking feature available in the QuickBooks UI. The time
2461
+ * tracking feature allows a QuickBooks user to base payroll or invoices on
2462
+ * time worked. You can add time-tracking information to any vendor,
2463
+ * employee, or person on the Other Names list in QuickBooks.
2464
+ *
2465
+ * If `IsBillable` is set to true, both `CustomerRef` and `ItemServiceRef`
2466
+ * are required. There is no link between an invoice and the time entries.
2467
+ * However, when you do the invoicing from QuickBooks, QuickBooks does mark
2468
+ * the time entries as “billed.” If you don’t record the time entries as
2469
+ * billed properly, then you get into a user workflow issue where every time
2470
+ * the user creates an invoice for a customer, QB pops up a dialog asking if
2471
+ * they want to bill the un-billed time (which you already billed from your
2472
+ * app).
2466
2473
  *
2467
- * See more: https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/TimeTrackingQuery
2474
+ * See more:
2475
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/TimeTrackingAdd
2468
2476
  */
2469
2477
  add: (endUserId: string, params: QbdTypes.TimeTrackingAddRq["TimeTrackingAdd"]) => Promise<NonNullable<QbdTypes.TimeTrackingAddRs["TimeTrackingRet"]>>;
2470
2478
  /**
@@ -428,7 +428,7 @@ class QbdIntegration extends BaseIntegration_1.default {
428
428
  add: async (endUserId, params) => this.sendRequestWrapper(endUserId, { CheckAddRq: { CheckAdd: params } }, "CheckAddRs", "CheckRet"),
429
429
  /**
430
430
  * Modifies an existing Check. Notice that you cannot use this to modify
431
- * BillPaymentChecks.
431
+ * `BillPaymentChecks`.
432
432
  *
433
433
  * See more: https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/CheckMod
434
434
  */
@@ -998,7 +998,7 @@ class QbdIntegration extends BaseIntegration_1.default {
998
998
  * If you Add an invoice that has an inventory item on it, QB will
999
999
  * automatically calculate COGS and post it to the COGS account. (The
1000
1000
  * inventory item will need to be setup to post to the COGS account and must
1001
- * have a unit cost in it.) However, notice that such an InvoiceAdd has
1001
+ * have a unit cost in it.) However, notice that such an `InvoiceAdd` has
1002
1002
  * sales prices, not cost, so the Add is not impacting the cost of the item.
1003
1003
  * The cost of the item is only affected by purchases (bills and item
1004
1004
  * receipts) sales and inventory adjustments.
@@ -1588,8 +1588,9 @@ class QbdIntegration extends BaseIntegration_1.default {
1588
1588
  * In a `TimeTracking` message, `ItemServiceRef` refers to the type of work.
1589
1589
  * If no `CustomerRef` is specified, then `ItemServiceRef` is not needed. If
1590
1590
  * `IsBillable` is set to true, then `TimeTrackingAdd` must include both
1591
- * `ItemServiceRef` and `CustomerRef`. See more:
1592
- * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/ItemServiceAdd
1591
+ * `ItemServiceRef` and `CustomerRef`.
1592
+ *
1593
+ * See more: https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/ItemServiceAdd
1593
1594
  */
1594
1595
  add: async (endUserId, params) => this.sendRequestWrapper(endUserId, { ItemServiceAddRq: { ItemServiceAdd: params } }, "ItemServiceAddRs", "ItemServiceRet"),
1595
1596
  /**
@@ -1824,9 +1825,7 @@ class QbdIntegration extends BaseIntegration_1.default {
1824
1825
  * QuickBooks Payroll Info window that provides detailed employee
1825
1826
  * information employee.
1826
1827
  *
1827
- *
1828
- * See more:
1829
- * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/PayrollItemWageAdd
1828
+ * See more: https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/PayrollItemWageAdd
1830
1829
  */
1831
1830
  add: async (endUserId, params) => this.sendRequestWrapper(endUserId, { PayrollItemWageAddRq: { PayrollItemWageAdd: params } }, "PayrollItemWageAddRs", "PayrollItemWageRet"),
1832
1831
  /**
@@ -2462,14 +2461,23 @@ class QbdIntegration extends BaseIntegration_1.default {
2462
2461
  */
2463
2462
  timeTracking = {
2464
2463
  /**
2465
- * The time-tracking transactions that are returned in this query include
2466
- * time tracking information that was entered into QuickBooks manually or
2467
- * gathered using the QuickBooks “Timer” or “Stopwatch.” Note that the
2468
- * QuickBooks Timer application can run on its own without QuickBooks, but
2469
- * the QuickBooks SDK cannot access the Timer data directly. The Timer data
2470
- * must be imported into QuickBooks before it is accessible via the SDK.)
2464
+ * This request adds a time tracking transaction to QuickBooks, mirroring
2465
+ * the time-tracking feature available in the QuickBooks UI. The time
2466
+ * tracking feature allows a QuickBooks user to base payroll or invoices on
2467
+ * time worked. You can add time-tracking information to any vendor,
2468
+ * employee, or person on the Other Names list in QuickBooks.
2469
+ *
2470
+ * If `IsBillable` is set to true, both `CustomerRef` and `ItemServiceRef`
2471
+ * are required. There is no link between an invoice and the time entries.
2472
+ * However, when you do the invoicing from QuickBooks, QuickBooks does mark
2473
+ * the time entries as “billed.” If you don’t record the time entries as
2474
+ * billed properly, then you get into a user workflow issue where every time
2475
+ * the user creates an invoice for a customer, QB pops up a dialog asking if
2476
+ * they want to bill the un-billed time (which you already billed from your
2477
+ * app).
2471
2478
  *
2472
- * See more: https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/TimeTrackingQuery
2479
+ * See more:
2480
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/TimeTrackingAdd
2473
2481
  */
2474
2482
  add: async (endUserId, params) => this.sendRequestWrapper(endUserId, { TimeTrackingAddRq: { TimeTrackingAdd: params } }, "TimeTrackingAddRs", "TimeTrackingRet"),
2475
2483
  /**
@@ -5,11 +5,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.createFramedMessage = exports.checkForUpdates = void 0;
7
7
  const package_json_1 = __importDefault(require("../../package.json"));
8
+ const env_1 = require("../utils/env");
8
9
  const node_child_process_1 = __importDefault(require("node:child_process"));
9
10
  function checkForUpdates() {
10
11
  if (process.env.NODE_ENV === "test") {
11
12
  return;
12
13
  }
14
+ // `CONDUCTOR_HIDE_UPDATE_MESSAGE` hides the update message that is logged
15
+ // when a newer version of `conductor-node` is available. It's a truthy value.
16
+ if ((0, env_1.isEnvironmentVariableTruthy)("CONDUCTOR_HIDE_UPDATE_MESSAGE")) {
17
+ return;
18
+ }
13
19
  // Exit early if npm is not installed.
14
20
  try {
15
21
  node_child_process_1.default.execSync("which npm");
@@ -27,26 +33,28 @@ function checkForUpdates() {
27
33
  ? "yarn add"
28
34
  : "npm install";
29
35
  console.warn(createFramedMessage([
30
- "🟡 UPDATE AVAILABLE for Conductor!",
31
- `Current Version: ${currentVersion}`,
32
- `Latest Version: ${latestVersion}`,
33
- `To update, run: ${updateCommand} ${package_json_1.default.name}@latest`,
36
+ `🟡 Update available for Conductor! ${currentVersion} → ${latestVersion}`,
37
+ "",
38
+ "Run the following to update:",
39
+ ` ${updateCommand} ${package_json_1.default.name}@latest`,
34
40
  ]));
35
41
  }
36
42
  }
37
43
  exports.checkForUpdates = checkForUpdates;
38
44
  function createFramedMessage(messageLines) {
39
45
  const maxLength = Math.max(...messageLines.map((line) => line.length), 0);
46
+ const paddingHorizontalLength = 2;
40
47
  return [
41
48
  // Top border of the box.
42
- `┌${"─".repeat(maxLength + 2)}┐`,
49
+ `┌${"─".repeat(maxLength + paddingHorizontalLength * 2)}┐`,
43
50
  // Print each line of the message, padded to fit the box.
44
51
  ...messageLines.map((line) => {
45
- const padding = " ".repeat(maxLength - line.length);
46
- return `│ ${line}${padding} │`;
52
+ const paddingLine = " ".repeat(maxLength - line.length);
53
+ const paddingHorizontal = " ".repeat(paddingHorizontalLength);
54
+ return `│${paddingHorizontal}${line}${paddingLine}${paddingHorizontal}│`;
47
55
  }),
48
56
  // Bottom border of the box.
49
- `└${"─".repeat(maxLength + 2)}┘`,
57
+ `└${"─".repeat(maxLength + paddingHorizontalLength * 2)}┘`,
50
58
  ].join("\n");
51
59
  }
52
60
  exports.createFramedMessage = createFramedMessage;
@@ -0,0 +1 @@
1
+ export declare function isEnvironmentVariableTruthy(name: string): boolean;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isEnvironmentVariableTruthy = void 0;
4
+ const FALSY_VALUES = new Set([
5
+ undefined,
6
+ "",
7
+ "null",
8
+ "undefined",
9
+ "false",
10
+ "0",
11
+ ]);
12
+ function isEnvironmentVariableTruthy(name) {
13
+ const value = process.env[name]?.toLowerCase();
14
+ return !FALSY_VALUES.has(value);
15
+ }
16
+ exports.isEnvironmentVariableTruthy = isEnvironmentVariableTruthy;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "11.3.2",
3
+ "version": "11.4.1",
4
4
  "description": "QuickBooks Desktop API for Node.js and TypeScript",
5
5
  "keywords": [
6
6
  "QuickBooks",
@@ -12,6 +12,7 @@
12
12
  "QB Desktop",
13
13
  "QB Enterprise",
14
14
  "QBD",
15
+ "QBDT",
15
16
  "QBE",
16
17
  "Intuit"
17
18
  ],