conductor-node 3.8.2 → 3.8.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "3.8.2",
3
+ "version": "3.8.4",
4
4
  "description": "Conductor API wrapper",
5
5
  "author": "Danny Nemer <hi@DannyNemer.com>",
6
6
  "license": "MIT",
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const package_json_1 = __importDefault(require("./../package.json"));
7
7
  const environment_1 = require("./environment");
8
8
  const QbdIntegration_1 = __importDefault(require("./integrations/qbd/QbdIntegration"));
9
- const child_process_1 = require("child_process");
10
9
  const graphql_request_1 = require("graphql-request");
10
+ const node_child_process_1 = require("node:child_process");
11
11
  class Client {
12
12
  /** QuickBooks Desktop integration. */
13
13
  qbd;
@@ -71,7 +71,11 @@ class Client {
71
71
  console.log(JSON.stringify(error, undefined, 2));
72
72
  }
73
73
  if (error instanceof graphql_request_1.ClientError) {
74
- const errorMessage = error.response.errors?.[0]?.message;
74
+ const errorMessage = error.response.errors?.[0]?.message ??
75
+ // Though property `ClientError.response.error` does *not* exist,
76
+ // we've seen it occur (e.g., attempting to access `development`
77
+ // environment when `ngrok` is not running locally).
78
+ error.response["error"];
75
79
  if (errorMessage !== undefined) {
76
80
  throw new Error(errorMessage);
77
81
  }
@@ -81,7 +85,7 @@ class Client {
81
85
  }
82
86
  checkForUpdates() {
83
87
  const currentVersion = package_json_1.default.version;
84
- const latestVersion = (0, child_process_1.execSync)(`yarn info ${package_json_1.default.name} version`)
88
+ const latestVersion = (0, node_child_process_1.execSync)(`yarn info ${package_json_1.default.name} version`)
85
89
  .toString()
86
90
  .trim();
87
91
  if (currentVersion !== latestVersion) {
@@ -1,5 +1,4 @@
1
- import type { ClientOptions } from "./Client";
2
1
  import Client from "./Client";
3
- import type * as Types from "./integrations/types";
4
2
  export default Client;
5
- export type { ClientOptions, Types };
3
+ export { type ClientOptions } from "./Client";
4
+ export * as Types from "./integrations/types";
package/dist/src/index.js CHANGED
@@ -1,7 +1,34 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
5
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.Types = void 0;
30
+ // eslint-disable-next-line consistent-default-export-name/default-export-match-filename -- This file defines the exports for the `conductor-node` package, as defined by `main` in `package.json`. Hence, no other internal code imports this module and we can ignore the error that that the file's name must match the default export (`Client`).
6
31
  const Client_1 = __importDefault(require("./Client"));
32
+ // eslint-disable-next-line unicorn/prefer-export-from -- We need `Client` to be the default export, which is impossible to define with `export from`.
7
33
  exports.default = Client_1.default;
34
+ exports.Types = __importStar(require("./integrations/types"));
@@ -639,7 +639,7 @@ class QbdIntegration extends BaseIntegration_1.default {
639
639
  async sendRequestBase(integrationUserConnectionId, params, responseKey, responseBodyKey) {
640
640
  const response = (await this.sendRequest(integrationUserConnectionId, params));
641
641
  const responseBody = response[responseKey]?.[responseBodyKey];
642
- if (responseBody == null) {
642
+ if (responseBody === undefined) {
643
643
  throw new Error("No response");
644
644
  }
645
645
  return responseBody;