conductor-node 11.3.1 → 11.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.
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 [email us](mailto:hello@conductor.is?subject=Conductor%20Beta%20Access&body=Hello!%20Tell%20us%20a%20bit%20about%20what%20you%20are%20building:%20) to join the beta.
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.
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.1",
3
+ "version": "11.4.0",
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
  */
@@ -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
  /**
@@ -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
  */
@@ -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
  /**
@@ -1 +1,2 @@
1
1
  export declare function checkForUpdates(): void;
2
+ export declare function createFramedMessage(messageLines: string[]): string;
@@ -3,13 +3,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.checkForUpdates = void 0;
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");
@@ -26,7 +32,29 @@ function checkForUpdates() {
26
32
  const updateCommand = process.env["npm_execpath"]?.includes("yarn") === true
27
33
  ? "yarn add"
28
34
  : "npm install";
29
- console.warn(`⚠️ Update available for Conductor: ${currentVersion} -> ${latestVersion}. To update, run: ${updateCommand} ${package_json_1.default.name}@latest`);
35
+ console.warn(createFramedMessage([
36
+ `🟡 Update available for Conductor! ${currentVersion} → ${latestVersion}`,
37
+ "",
38
+ "Run the following to update:",
39
+ ` ${updateCommand} ${package_json_1.default.name}@latest`,
40
+ ]));
30
41
  }
31
42
  }
32
43
  exports.checkForUpdates = checkForUpdates;
44
+ function createFramedMessage(messageLines) {
45
+ const maxLength = Math.max(...messageLines.map((line) => line.length), 0);
46
+ const paddingHorizontalLength = 2;
47
+ return [
48
+ // Top border of the box.
49
+ `┌${"─".repeat(maxLength + paddingHorizontalLength * 2)}┐`,
50
+ // Print each line of the message, padded to fit the box.
51
+ ...messageLines.map((line) => {
52
+ const paddingLine = " ".repeat(maxLength - line.length);
53
+ const paddingHorizontal = " ".repeat(paddingHorizontalLength);
54
+ return `│${paddingHorizontal}${line}${paddingLine}${paddingHorizontal}│`;
55
+ }),
56
+ // Bottom border of the box.
57
+ `└${"─".repeat(maxLength + paddingHorizontalLength * 2)}┘`,
58
+ ].join("\n");
59
+ }
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.1",
3
+ "version": "11.4.0",
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
  ],