conductor-node 11.3.2 → 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/dist/package.json +2 -1
- package/dist/src/Client.js +5 -5
- package/dist/src/integrations/qbd/QbdIntegration.d.ts +5 -6
- package/dist/src/integrations/qbd/QbdIntegration.js +5 -6
- package/dist/src/utils/checkForUpdates.js +16 -8
- package/dist/src/utils/env.d.ts +1 -0
- package/dist/src/utils/env.js +16 -0
- package/package.json +2 -1
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "conductor-node",
|
|
3
|
-
"version": "11.
|
|
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
|
],
|
package/dist/src/Client.js
CHANGED
|
@@ -30,11 +30,11 @@ class Client {
|
|
|
30
30
|
this.qbd = new QbdIntegration_1.default(this.httpClient);
|
|
31
31
|
}
|
|
32
32
|
createHttpClient(apiKey, verbose) {
|
|
33
|
-
//
|
|
34
|
-
// development instead of checking `NODE_ENV` to
|
|
35
|
-
// users
|
|
36
|
-
// "development".
|
|
37
|
-
const apiServerUrl = process.env["
|
|
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`.
|
|
1587
|
-
*
|
|
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`.
|
|
1592
|
-
*
|
|
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
|
/**
|
|
@@ -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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
`
|
|
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
|
|
46
|
-
|
|
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
|
+
"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
|
],
|