conductor-node 8.0.0 → 8.0.2

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
@@ -53,29 +53,18 @@ const newQbdConnection = await conductor.createIntegrationConnection({
53
53
  });
54
54
  ```
55
55
 
56
- The response includes the following:
56
+ The response looks like the following:
57
57
 
58
58
  ```ts
59
59
  {
60
- // ❗ Display this URL to your end-user: The URL for the QWC config file
61
- // that your end-user must download and open on their computer to
62
- // connect their QBD instance to Conductor.
63
- qwcFileDownloadUrl: 'https://production.api.conductor.is/qwc/{UUID}'
64
- // ❗ Display this password/access-code to your end-user: The unique
65
- // password that your end-user must enter into QuickBooks Web
66
- // Connector after loading the config file. This value will never be
67
- // shown again.
68
- qbwcPassword: '{unique-password}',
69
- integrationConnection: {
70
- // ❗ Save this `id` to your database for executing requests to
71
- // this end-user's integration in the future.
72
- id: '{UUID}',
73
- integrationKey: 'quickbooks-desktop',
74
- endUserSourceId: "1234-abcd",
75
- endUserEmail: 'danny@constructionco.com',
76
- endUserCompanyName: 'Construction Corp',
77
- lastHeartbeatAt: null
78
- }
60
+ // ❗ Save this `id` to your database for executing requests to this
61
+ // end-user's integration in the future.
62
+ id: '{UUID}',
63
+ integrationKey: 'quickbooks-desktop',
64
+ endUserSourceId: "1234-abcd",
65
+ endUserEmail: 'danny@constructionco.com',
66
+ endUserCompanyName: 'Construction Corp',
67
+ lastHeartbeatAt: null
79
68
  }
80
69
  ```
81
70
 
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "8.0.0",
3
+ "version": "8.0.2",
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",
@@ -23,7 +23,6 @@
23
23
  "node": ">=16"
24
24
  },
25
25
  "dependencies": {
26
- "chalk": "^4",
27
26
  "graphql": "^16.6.0",
28
27
  "graphql-request": "^5.0.0"
29
28
  },
@@ -51,7 +51,7 @@ export default class Client {
51
51
  */
52
52
  createIntegrationConnection(input: GraphqlCreateIntegrationConnectionInput & {
53
53
  integrationKey: "quickbooks-desktop";
54
- }): Promise<GraphqlCreateIntegrationConnectionMutation["createIntegrationConnection"]>;
54
+ }): Promise<GraphqlCreateIntegrationConnectionMutation["createIntegrationConnection"]["integrationConnection"]>;
55
55
  /** Not intended for public use. */
56
56
  sendIntegrationRequest(input: GraphqlSendIntegrationRequestInput): Promise<GraphqlSendIntegrationRequestMutation["sendIntegrationRequest"]["response"]>;
57
57
  }
@@ -78,7 +78,7 @@ class Client {
78
78
  async createIntegrationConnection(input) {
79
79
  return this.graphqlOperations
80
80
  .createIntegrationConnection({ input })
81
- .then((result) => result.createIntegrationConnection);
81
+ .then((result) => result.createIntegrationConnection.integrationConnection);
82
82
  }
83
83
  // TODO: Find a way to make this private.
84
84
  /** Not intended for public use. */
@@ -33,6 +33,9 @@ export type GraphqlSendIntegrationRequestInput = {
33
33
  integrationConnectionId: Scalars["ID"];
34
34
  requestObject: Scalars["JSONObject"];
35
35
  };
36
+ export type GraphqlSetUpIntegrationConnectionInput = {
37
+ integrationConnectionId: Scalars["ID"];
38
+ };
36
39
  export type GraphqlIntegrationConnectionFragment = {
37
40
  id: string;
38
41
  integrationKey: string;
@@ -92,8 +95,6 @@ export type GraphqlCreateIntegrationConnectionMutationVariables = Exact<{
92
95
  }>;
93
96
  export type GraphqlCreateIntegrationConnectionMutation = {
94
97
  createIntegrationConnection: {
95
- qbwcPassword: string;
96
- qwcFileDownloadUrl: string;
97
98
  integrationConnection: {
98
99
  id: string;
99
100
  integrationKey: string;
@@ -50,8 +50,6 @@ exports.CreateIntegrationConnectionDocument = `
50
50
  integrationConnection {
51
51
  ...IntegrationConnection
52
52
  }
53
- qbwcPassword
54
- qwcFileDownloadUrl
55
53
  }
56
54
  }
57
55
  ${exports.IntegrationConnectionFragmentDoc}`;
@@ -5,18 +5,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const package_json_1 = __importDefault(require("../../package.json"));
7
7
  const environment_1 = require("../utils/environment");
8
- const chalk_1 = __importDefault(require("chalk"));
9
8
  const node_child_process_1 = require("node:child_process");
10
9
  function checkForUpdates() {
11
10
  if (environment_1.currentEnvironment.isTest) {
12
11
  return;
13
12
  }
14
13
  const currentVersion = package_json_1.default.version;
15
- const latestVersion = (0, node_child_process_1.execSync)(`yarn info ${package_json_1.default.name} version`)
14
+ const latestVersion = (0, node_child_process_1.execSync)(`npm view ${package_json_1.default.name} version --silent`)
16
15
  .toString()
17
16
  .trim();
18
17
  if (currentVersion !== latestVersion) {
19
- console.warn(chalk_1.default.yellow(`⚠️ 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.`));
18
+ 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.`);
20
19
  }
21
20
  }
22
21
  exports.default = checkForUpdates;
@@ -4,5 +4,6 @@ export declare const currentEnvironment: {
4
4
  isTest: boolean;
5
5
  isDevelopment: boolean;
6
6
  isProduction: boolean;
7
+ isLocal: boolean;
7
8
  };
8
9
  export declare function getServerUrlForEnvironment(environment: Environment): string;
@@ -1,28 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getServerUrlForEnvironment = exports.currentEnvironment = void 0;
4
- const currentEnvironmentName = process.env["NODE_ENV"] ?? "development";
4
+ const currentEnvironmentName = (process.env["NODE_ENV"] ??
5
+ "development");
5
6
  exports.currentEnvironment = {
6
7
  name: currentEnvironmentName,
7
8
  isTest: currentEnvironmentName === "test",
8
9
  isDevelopment: currentEnvironmentName === "development",
9
10
  isProduction: currentEnvironmentName === "production",
11
+ isLocal: ["test", "development"].includes(currentEnvironmentName),
10
12
  };
11
13
  function getServerUrlForEnvironment(environment) {
12
- switch (environment) {
13
- case "test": {
14
- // DOES NOT EXIST.
15
- return "https://test.api.conductor.is";
16
- }
17
- case "development": {
18
- return "https://conductor.ngrok.io";
19
- }
20
- case "production": {
21
- return "https://production.api.conductor.is";
22
- }
23
- default: {
24
- throw new Error("Invalid environment");
25
- }
14
+ if (environment === "production") {
15
+ return "https://api.conductor.is";
26
16
  }
17
+ return "http://localhost:4000";
27
18
  }
28
19
  exports.getServerUrlForEnvironment = getServerUrlForEnvironment;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "8.0.0",
3
+ "version": "8.0.2",
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",
@@ -23,7 +23,6 @@
23
23
  "node": ">=16"
24
24
  },
25
25
  "dependencies": {
26
- "chalk": "^4",
27
26
  "graphql": "^16.6.0",
28
27
  "graphql-request": "^5.0.0"
29
28
  },