conductor-node 8.1.0 → 8.2.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.
@@ -0,0 +1,2 @@
1
+ export declare function checkForUpdates(): void;
2
+ export declare function getServerUrlForEnvironment(environment: "development" | "production"): string;
@@ -3,13 +3,10 @@ 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
- const package_json_1 = __importDefault(require("../../package.json"));
7
- const environment_1 = require("../utils/environment");
6
+ exports.getServerUrlForEnvironment = exports.checkForUpdates = void 0;
7
+ const package_json_1 = __importDefault(require("./../package.json"));
8
8
  const node_child_process_1 = require("node:child_process");
9
9
  function checkForUpdates() {
10
- if (environment_1.currentEnvironment.isTest) {
11
- return;
12
- }
13
10
  const currentVersion = package_json_1.default.version;
14
11
  const latestVersion = (0, node_child_process_1.execSync)(`npm view ${package_json_1.default.name} version --silent`)
15
12
  .toString()
@@ -18,4 +15,11 @@ function checkForUpdates() {
18
15
  console.warn(`⚠️ A new version of Conductor is available! You are using "${package_json_1.default.name}" version ${currentVersion} but the latest version is ${latestVersion}. Please run "yarn upgrade ${package_json_1.default.name} --latest" to update.`);
19
16
  }
20
17
  }
21
- exports.default = checkForUpdates;
18
+ exports.checkForUpdates = checkForUpdates;
19
+ function getServerUrlForEnvironment(environment) {
20
+ if (environment === "production") {
21
+ return "https://api.conductor.is";
22
+ }
23
+ return "http://localhost:4000";
24
+ }
25
+ exports.getServerUrlForEnvironment = getServerUrlForEnvironment;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "8.1.0",
3
+ "version": "8.2.1",
4
4
  "description": "Easily integrate with the entire QuickBooks Desktop API with fully-typed async TypeScript",
5
5
  "author": "Danny Nemer <hi@DannyNemer.com>",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- export default function checkForUpdates(): void;
@@ -1,9 +0,0 @@
1
- export type Environment = "development" | "production" | "test";
2
- export declare const currentEnvironment: {
3
- name: Environment;
4
- isTest: boolean;
5
- isDevelopment: boolean;
6
- isProduction: boolean;
7
- isLocal: boolean;
8
- };
9
- export declare function getServerUrlForEnvironment(environment: Environment): string;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getServerUrlForEnvironment = exports.currentEnvironment = void 0;
4
- const currentEnvironmentName = (process.env["NODE_ENV"] ??
5
- "development");
6
- exports.currentEnvironment = {
7
- name: currentEnvironmentName,
8
- isTest: currentEnvironmentName === "test",
9
- isDevelopment: currentEnvironmentName === "development",
10
- isProduction: currentEnvironmentName === "production",
11
- isLocal: ["test", "development"].includes(currentEnvironmentName),
12
- };
13
- function getServerUrlForEnvironment(environment) {
14
- if (environment === "production") {
15
- return "https://api.conductor.is";
16
- }
17
- if (environment === "development") {
18
- // Though `localhost` works locally, we must return the hosted URL for
19
- // generating the QWC file to connect from a remote Windows QBD instance.
20
- return "https://conductor.ngrok.io";
21
- }
22
- return "http://localhost:4000";
23
- }
24
- exports.getServerUrlForEnvironment = getServerUrlForEnvironment;