conductor-node 9.0.1 → 9.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/dist/package.json +1 -1
- package/dist/src/graphql/graphqlOperationWrapper.d.ts +1 -1
- package/dist/src/graphql/graphqlOperationWrapper.js +5 -5
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/integrations/qbd/QbdIntegration.js +2 -2
- package/package.json +1 -1
- /package/dist/src/{errors.d.ts → error.d.ts} +0 -0
- /package/dist/src/{errors.js → error.js} +0 -0
package/dist/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConductorError } from "../
|
|
1
|
+
import type { ConductorError } from "../error";
|
|
2
2
|
import type { getSdk } from "../graphql/__generated__/operationTypes";
|
|
3
3
|
export declare function wrapGraphqlOperations<T extends ReturnType<typeof getSdk>>(graphqlOperations: T, verbose: boolean): T;
|
|
4
4
|
export declare function graphqlOperationWrapper<V extends {
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.wrapError = exports.getDurationString = exports.graphqlOperationWrapper = exports.wrapGraphqlOperations = void 0;
|
|
7
7
|
const package_json_1 = __importDefault(require("../../package.json"));
|
|
8
|
-
const
|
|
8
|
+
const error_1 = require("../error");
|
|
9
9
|
const graphql_request_1 = require("graphql-request");
|
|
10
10
|
const node_util_1 = __importDefault(require("node:util"));
|
|
11
11
|
function wrapGraphqlOperations(graphqlOperations, verbose) {
|
|
@@ -68,7 +68,7 @@ function wrapError(error) {
|
|
|
68
68
|
if (error instanceof graphql_request_1.ClientError) {
|
|
69
69
|
const { response } = error;
|
|
70
70
|
if ([404, 502, 503].includes(response.status)) {
|
|
71
|
-
return new
|
|
71
|
+
return new error_1.ConductorConnectionError({
|
|
72
72
|
code: "SERVER_UNAVAILABLE",
|
|
73
73
|
message: `The Conductor server returned a ${response.status} error, which may indicate that the server is unavailable. Please alert the Conductor team if this error persists.`,
|
|
74
74
|
httpStatusCode: response.status,
|
|
@@ -78,7 +78,7 @@ function wrapError(error) {
|
|
|
78
78
|
const errorExtensions = nestedError?.extensions;
|
|
79
79
|
if (errorExtensions) {
|
|
80
80
|
if (errorExtensions["code"] === "GRAPHQL_VALIDATION_FAILED") {
|
|
81
|
-
return new
|
|
81
|
+
return new error_1.ConductorInvalidRequestError({
|
|
82
82
|
code: "CLIENT_OUTDATED",
|
|
83
83
|
message: `Your version of "${package_json_1.default.name}" is not longer compatible with the Conductor server. Please run "yarn upgrade ${package_json_1.default.name} --latest" to update.`,
|
|
84
84
|
httpStatusCode: response.status,
|
|
@@ -93,14 +93,14 @@ function wrapError(error) {
|
|
|
93
93
|
// default to `ConductorUnknownError`.
|
|
94
94
|
// 4. If `endUserMessage` is absent, then `ConductorError` will use a
|
|
95
95
|
// default value.
|
|
96
|
-
return (0,
|
|
96
|
+
return (0, error_1.generateConductorErrorFromType)({
|
|
97
97
|
message: nestedError.message,
|
|
98
98
|
httpStatusCode: response.status,
|
|
99
99
|
...errorExtensions,
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
return new
|
|
103
|
+
return new error_1.ConductorInternalError({
|
|
104
104
|
code: "INVALID_JSON_RESPONSE",
|
|
105
105
|
message: "Invalid JSON received from the Conductor API.",
|
|
106
106
|
});
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.js
CHANGED
|
@@ -34,5 +34,5 @@ exports.QbdTypes = void 0;
|
|
|
34
34
|
const Client_1 = __importDefault(require("./Client"));
|
|
35
35
|
// eslint-disable-next-line unicorn/prefer-export-from -- We need `Client` to be the default export, which is impossible to define with `export from`.
|
|
36
36
|
exports.default = Client_1.default;
|
|
37
|
-
__exportStar(require("./
|
|
37
|
+
__exportStar(require("./error"), exports);
|
|
38
38
|
exports.QbdTypes = __importStar(require("./integrations/qbd/qbdTypes"));
|
|
@@ -3,7 +3,7 @@ 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
|
|
6
|
+
const error_1 = require("../../error");
|
|
7
7
|
const BaseIntegration_1 = __importDefault(require("../../integrations/BaseIntegration"));
|
|
8
8
|
class QbdIntegration extends BaseIntegration_1.default {
|
|
9
9
|
account = {
|
|
@@ -958,7 +958,7 @@ class QbdIntegration extends BaseIntegration_1.default {
|
|
|
958
958
|
const response = (await this.sendRequest(integrationConnectionId, params));
|
|
959
959
|
const responseBody = response[responseKey]?.[responseBodyKey];
|
|
960
960
|
if (responseBody === undefined) {
|
|
961
|
-
throw new
|
|
961
|
+
throw new error_1.ConductorIntegrationError({
|
|
962
962
|
message: "No response received from QuickBooks Desktop.",
|
|
963
963
|
endUserMessage: "No response received from QuickBooks Desktop.",
|
|
964
964
|
code: "QBD_NO_RESPONSE",
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|