conductor-node 3.7.0 → 3.7.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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "3.7.0",
3
+ "version": "3.7.1",
4
4
  "description": "Conductor API wrapper",
5
5
  "author": "Danny Nemer <hi@DannyNemer.com>",
6
6
  "license": "MIT",
@@ -19,4 +19,5 @@ export default class Client {
19
19
  integrationUserConnections(): Promise<object[]>;
20
20
  integrationRequest(integrationRequestParams: IntegrationRequestParams): Promise<object>;
21
21
  private request;
22
+ private checkForUpdates;
22
23
  }
@@ -6,6 +6,7 @@ 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");
9
10
  const graphql_request_1 = require("graphql-request");
10
11
  class Client {
11
12
  /** QuickBooks Desktop integration. */
@@ -14,6 +15,7 @@ class Client {
14
15
  gqlClient;
15
16
  verbose;
16
17
  constructor(apiKey, { verbose = false, environment = "staging" } = {}) {
18
+ this.checkForUpdates();
17
19
  this.verbose = verbose;
18
20
  this.serverURL = (0, environment_1.envToBaseServerURL)(environment);
19
21
  this.gqlClient = new graphql_request_1.GraphQLClient(`${this.serverURL}/graphql`, {
@@ -74,5 +76,14 @@ class Client {
74
76
  throw error;
75
77
  }
76
78
  }
79
+ checkForUpdates() {
80
+ const currentVersion = package_json_1.default.version;
81
+ const latestVersion = (0, child_process_1.execSync)(`npm view ${package_json_1.default.name} version`)
82
+ .toString()
83
+ .trim();
84
+ if (currentVersion !== latestVersion) {
85
+ console.warn(`Warning: You are using ${package_json_1.default.name} version ${currentVersion} but the latest version is ${latestVersion}. Please run "npm install ${package_json_1.default.name}@${latestVersion}" to update to the latest version.`);
86
+ }
87
+ }
77
88
  }
78
89
  exports.default = Client;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "3.7.0",
3
+ "version": "3.7.1",
4
4
  "description": "Conductor API wrapper",
5
5
  "author": "Danny Nemer <hi@DannyNemer.com>",
6
6
  "license": "MIT",