conductor-node 7.4.5 → 7.4.7

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
@@ -120,11 +120,13 @@ The response includes the following:
120
120
 
121
121
  ```ts
122
122
  {
123
- // Whether we can connect to the end-user's QBD.
124
- isConnected: false
125
- // If `isConnected=false`, the corresponding error message for the developer.
126
- devErrorMessage: "The end-user's computer is likely off",
127
- // If `isConnected=false`, the corresponding error message for the end-user.
128
- endUserErrorMessage: "Please ensure your computer is on and QuickBooks Desktop is open",
123
+ // Whether we can connect to the end-user's QuickBooks Desktop.
124
+ isConnected: false,
125
+ // If `isConnected=false`, an `error` like the following will exist:
126
+ error: {
127
+ code: "QBWC_CONNECTION_ERROR",
128
+ developerMessage: "QBWC Error 0x80040408: Could not start QuickBooks.",
129
+ endUserMessage: "An error occurred while connecting to QuickBooks Desktop. Please ensure QuickBooks Desktop is running and the correct company file is open, then try again.",
130
+ }
129
131
  }
130
132
  ```
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "7.4.5",
3
+ "version": "7.4.7",
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",
@@ -115,12 +115,16 @@ class Client {
115
115
  if (error instanceof graphql_request_1.ClientError) {
116
116
  const { response } = error;
117
117
  if ([404, 502, 503].includes(response.status)) {
118
- throw new Error(`The server returned a ${response.status} error, which may indicate that the server is down. Please alert the Conductor team if this error persists.`);
118
+ throw new Error(`The Conductor server returned a ${response.status} error, which may indicate that the server is down. Please alert the Conductor team if this error persists.`);
119
119
  }
120
- const errorMessage = response.errors?.[0]?.message ??
121
- // Though the property `ClientError.response.error` does *not* exist,
122
- // we've seen it occur (e.g., attempting to access `development`
123
- // environment when `ngrok` is not running locally).
120
+ const nestedError = response.errors?.[0];
121
+ if (nestedError?.extensions["code"] === "GRAPHQL_VALIDATION_FAILED") {
122
+ throw new Error(`The Conductor server is no longer compatible with your version of "${package_json_1.default.name}". Please run "yarn upgrade ${package_json_1.default.name}@latest --latest" to update.`);
123
+ }
124
+ const errorMessage = nestedError?.message ??
125
+ // Though `ClientError.response.error` is *not* defined in the type
126
+ // definition, we've seen it occur (e.g., attempting to access the
127
+ // `development` environment when `ngrok` is not running locally).
124
128
  response["error"];
125
129
  if (errorMessage !== undefined) {
126
130
  throw new Error(errorMessage);
@@ -138,7 +142,7 @@ class Client {
138
142
  .toString()
139
143
  .trim();
140
144
  if (currentVersion !== latestVersion) {
141
- 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 add ${package_json_1.default.name}@latest" to update.`));
145
+ 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.`));
142
146
  }
143
147
  }
144
148
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "7.4.5",
3
+ "version": "7.4.7",
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",