conductor-node 8.6.6 → 9.0.0
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
|
+
"version": "9.0.0",
|
|
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",
|
|
@@ -16,10 +16,11 @@
|
|
|
16
16
|
"delete-compiled-tests": "rm -rf `find ./dist -type d -name __tests__` ./dist/src/utils/testing.*",
|
|
17
17
|
"postpack": "rm -rf dist",
|
|
18
18
|
"clean": "rm -rf dist package conductor-node-*.tgz tsconfig.tsbuildinfo",
|
|
19
|
-
"gen:graphql": "yarn graphql-codegen --config
|
|
19
|
+
"gen:graphql": "yarn graphql-codegen --config=./src/graphql/codegenConfig.ts",
|
|
20
20
|
"diff": "yarn pack && npm diff --diff=conductor-node@latest --diff=conductor-node-v$(node -p \"require('./package.json').version\").tgz && yarn clean",
|
|
21
21
|
"prepublishOnly": "yarn test",
|
|
22
|
-
"test": "yarn --cwd
|
|
22
|
+
"test": "yarn --cwd=../.. test ./packages/client",
|
|
23
|
+
"jest": "yarn --cwd=../../ jest"
|
|
23
24
|
},
|
|
24
25
|
"engines": {
|
|
25
26
|
"node": ">=16"
|
package/dist/src/Client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GraphqlCreateIntegrationConnectionInput, GraphqlCreateIntegrationConnectionMutation,
|
|
1
|
+
import type { GraphqlCreateIntegrationConnectionInput, GraphqlCreateIntegrationConnectionMutation, GraphqlGetIntegrationConnectionQuery, GraphqlGetIntegrationConnectionQueryVariables, GraphqlGetIntegrationConnectionsQuery, GraphqlPingIntegrationConnectionMutation, GraphqlPingIntegrationConnectionMutationVariables } from "./graphql/__generated__/operationTypes";
|
|
2
2
|
import QbdIntegration from "./integrations/qbd/QbdIntegration";
|
|
3
3
|
import { getServerUrlForEnvironment } from "./utils";
|
|
4
4
|
export interface ClientOptions {
|
|
@@ -25,25 +25,6 @@ export default class Client {
|
|
|
25
25
|
* @returns The integration-connections.
|
|
26
26
|
*/
|
|
27
27
|
getIntegrationConnections(): Promise<GraphqlGetIntegrationConnectionsQuery["integrationConnections"]>;
|
|
28
|
-
/**
|
|
29
|
-
* Checks whether we can successfully connect to the end-user's QBD instance.
|
|
30
|
-
*
|
|
31
|
-
* Unlike `lastHeartbeatAt`, which only checks if QBWC is running (i.e., is
|
|
32
|
-
* the user's computer on), this check fails if the user's computer is on but
|
|
33
|
-
* QBD is not running, the wrong company file is open, or there is a modal
|
|
34
|
-
* dialog open in QBD.
|
|
35
|
-
*
|
|
36
|
-
* @param integrationConnectionId The ID of the integration-connection.
|
|
37
|
-
* @returns The result object with the following properties:
|
|
38
|
-
* - isConnected: Whether we can connect to the end-user's QBD.
|
|
39
|
-
* - error: If `isConnected=false`, this will be an object with the following
|
|
40
|
-
* properties:
|
|
41
|
-
* - error.code - The unique error code.
|
|
42
|
-
* - error.developerMessage - The technical error message for the developer.
|
|
43
|
-
* - error.endUserMessage - The user-friendly error message to display to
|
|
44
|
-
* the the end-user.
|
|
45
|
-
*/
|
|
46
|
-
getConnectionStatus(integrationConnectionId: GraphqlGetConnectionStatusQueryVariables["integrationConnectionId"]): Promise<GraphqlGetConnectionStatusQuery["integrationConnection"]["connectionStatus"]>;
|
|
47
28
|
/**
|
|
48
29
|
* Creates a new integration-connection.
|
|
49
30
|
*
|
package/dist/src/Client.js
CHANGED
|
@@ -41,29 +41,6 @@ class Client {
|
|
|
41
41
|
.getIntegrationConnections()
|
|
42
42
|
.then((result) => result.integrationConnections);
|
|
43
43
|
}
|
|
44
|
-
/**
|
|
45
|
-
* Checks whether we can successfully connect to the end-user's QBD instance.
|
|
46
|
-
*
|
|
47
|
-
* Unlike `lastHeartbeatAt`, which only checks if QBWC is running (i.e., is
|
|
48
|
-
* the user's computer on), this check fails if the user's computer is on but
|
|
49
|
-
* QBD is not running, the wrong company file is open, or there is a modal
|
|
50
|
-
* dialog open in QBD.
|
|
51
|
-
*
|
|
52
|
-
* @param integrationConnectionId The ID of the integration-connection.
|
|
53
|
-
* @returns The result object with the following properties:
|
|
54
|
-
* - isConnected: Whether we can connect to the end-user's QBD.
|
|
55
|
-
* - error: If `isConnected=false`, this will be an object with the following
|
|
56
|
-
* properties:
|
|
57
|
-
* - error.code - The unique error code.
|
|
58
|
-
* - error.developerMessage - The technical error message for the developer.
|
|
59
|
-
* - error.endUserMessage - The user-friendly error message to display to
|
|
60
|
-
* the the end-user.
|
|
61
|
-
*/
|
|
62
|
-
async getConnectionStatus(integrationConnectionId) {
|
|
63
|
-
return this.graphqlOperations
|
|
64
|
-
.getConnectionStatus({ integrationConnectionId })
|
|
65
|
-
.then((result) => result.integrationConnection.connectionStatus);
|
|
66
|
-
}
|
|
67
44
|
/**
|
|
68
45
|
* Creates a new integration-connection.
|
|
69
46
|
*
|
package/dist/src/errors.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateConductorErrorFromType = exports.ConductorUnknownError = exports.ConductorInternalError = exports.ConductorConnectionError = exports.ConductorAuthenticationError = exports.ConductorInvalidRequestError = exports.ConductorIntegrationError = exports.ConductorError = exports.DEFAULT_END_USER_MESSAGE = void 0;
|
|
4
4
|
/* eslint-disable max-classes-per-file -- Use one module for all error classes. */
|
|
5
|
+
// Matches server-side default value.
|
|
5
6
|
exports.DEFAULT_END_USER_MESSAGE = "An internal server error occurred. Please try again later.";
|
|
6
7
|
/**
|
|
7
8
|
* The base error from which all other more specific Conductor errors derive.
|
|
@@ -47,11 +47,6 @@ export type GraphqlIntegrationConnectionFragment = {
|
|
|
47
47
|
endUserCompanyName: string;
|
|
48
48
|
lastHeartbeatAt: Date | null;
|
|
49
49
|
};
|
|
50
|
-
export type GraphqlUserErrorFragment = {
|
|
51
|
-
code: string;
|
|
52
|
-
developerMessage: string;
|
|
53
|
-
endUserMessage: string;
|
|
54
|
-
};
|
|
55
50
|
export type GraphqlGetIntegrationConnectionQueryVariables = Exact<{
|
|
56
51
|
integrationConnectionId: Scalars["ID"];
|
|
57
52
|
}>;
|
|
@@ -78,21 +73,6 @@ export type GraphqlGetIntegrationConnectionsQuery = {
|
|
|
78
73
|
lastHeartbeatAt: Date | null;
|
|
79
74
|
}>;
|
|
80
75
|
};
|
|
81
|
-
export type GraphqlGetConnectionStatusQueryVariables = Exact<{
|
|
82
|
-
integrationConnectionId: Scalars["ID"];
|
|
83
|
-
}>;
|
|
84
|
-
export type GraphqlGetConnectionStatusQuery = {
|
|
85
|
-
integrationConnection: {
|
|
86
|
-
connectionStatus: {
|
|
87
|
-
isConnected: boolean;
|
|
88
|
-
error: {
|
|
89
|
-
code: string;
|
|
90
|
-
developerMessage: string;
|
|
91
|
-
endUserMessage: string;
|
|
92
|
-
} | null;
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
76
|
export type GraphqlCreateIntegrationConnectionMutationVariables = Exact<{
|
|
97
77
|
input: GraphqlCreateIntegrationConnectionInput;
|
|
98
78
|
}>;
|
|
@@ -125,10 +105,8 @@ export type GraphqlSendIntegrationRequestMutation = {
|
|
|
125
105
|
};
|
|
126
106
|
};
|
|
127
107
|
export declare const IntegrationConnectionFragmentDoc = "\n fragment IntegrationConnection on IntegrationConnection {\n id\n integrationKey\n endUserSourceId\n endUserEmail\n endUserCompanyName\n lastHeartbeatAt\n}\n ";
|
|
128
|
-
export declare const UserErrorFragmentDoc = "\n fragment UserError on UserError {\n code\n developerMessage\n endUserMessage\n}\n ";
|
|
129
108
|
export declare const GetIntegrationConnectionDocument: string;
|
|
130
109
|
export declare const GetIntegrationConnectionsDocument: string;
|
|
131
|
-
export declare const GetConnectionStatusDocument: string;
|
|
132
110
|
export declare const CreateIntegrationConnectionDocument: string;
|
|
133
111
|
export declare const PingIntegrationConnectionDocument = "\n mutation pingIntegrationConnection($input: PingIntegrationConnectionInput!) {\n pingIntegrationConnection(input: $input) {\n duration\n }\n}\n ";
|
|
134
112
|
export declare const SendIntegrationRequestDocument = "\n mutation sendIntegrationRequest($input: SendIntegrationRequestInput!) {\n sendIntegrationRequest(input: $input) {\n response\n }\n}\n ";
|
|
@@ -136,7 +114,6 @@ export type SdkFunctionWrapper = <T>(action: (requestHeaders?: Record<string, st
|
|
|
136
114
|
export declare function getSdk(client: GraphQLClient, withWrapper?: SdkFunctionWrapper): {
|
|
137
115
|
getIntegrationConnection(variables: GraphqlGetIntegrationConnectionQueryVariables, requestHeaders?: (Record<string, string> | Dom.Headers | string[][]) | undefined): Promise<GraphqlGetIntegrationConnectionQuery>;
|
|
138
116
|
getIntegrationConnections(variables?: GraphqlGetIntegrationConnectionsQueryVariables, requestHeaders?: (Record<string, string> | Dom.Headers | string[][]) | undefined): Promise<GraphqlGetIntegrationConnectionsQuery>;
|
|
139
|
-
getConnectionStatus(variables: GraphqlGetConnectionStatusQueryVariables, requestHeaders?: (Record<string, string> | Dom.Headers | string[][]) | undefined): Promise<GraphqlGetConnectionStatusQuery>;
|
|
140
117
|
createIntegrationConnection(variables: GraphqlCreateIntegrationConnectionMutationVariables, requestHeaders?: (Record<string, string> | Dom.Headers | string[][]) | undefined): Promise<GraphqlCreateIntegrationConnectionMutation>;
|
|
141
118
|
pingIntegrationConnection(variables: GraphqlPingIntegrationConnectionMutationVariables, requestHeaders?: (Record<string, string> | Dom.Headers | string[][]) | undefined): Promise<GraphqlPingIntegrationConnectionMutation>;
|
|
142
119
|
sendIntegrationRequest(variables: GraphqlSendIntegrationRequestMutationVariables, requestHeaders?: (Record<string, string> | Dom.Headers | string[][]) | undefined): Promise<GraphqlSendIntegrationRequestMutation>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSdk = exports.SendIntegrationRequestDocument = exports.PingIntegrationConnectionDocument = exports.CreateIntegrationConnectionDocument = exports.
|
|
3
|
+
exports.getSdk = exports.SendIntegrationRequestDocument = exports.PingIntegrationConnectionDocument = exports.CreateIntegrationConnectionDocument = exports.GetIntegrationConnectionsDocument = exports.GetIntegrationConnectionDocument = exports.IntegrationConnectionFragmentDoc = void 0;
|
|
4
4
|
exports.IntegrationConnectionFragmentDoc = `
|
|
5
5
|
fragment IntegrationConnection on IntegrationConnection {
|
|
6
6
|
id
|
|
@@ -11,13 +11,6 @@ exports.IntegrationConnectionFragmentDoc = `
|
|
|
11
11
|
lastHeartbeatAt
|
|
12
12
|
}
|
|
13
13
|
`;
|
|
14
|
-
exports.UserErrorFragmentDoc = `
|
|
15
|
-
fragment UserError on UserError {
|
|
16
|
-
code
|
|
17
|
-
developerMessage
|
|
18
|
-
endUserMessage
|
|
19
|
-
}
|
|
20
|
-
`;
|
|
21
14
|
exports.GetIntegrationConnectionDocument = `
|
|
22
15
|
query getIntegrationConnection($integrationConnectionId: ID!) {
|
|
23
16
|
integrationConnection(id: $integrationConnectionId) {
|
|
@@ -32,18 +25,6 @@ exports.GetIntegrationConnectionsDocument = `
|
|
|
32
25
|
}
|
|
33
26
|
}
|
|
34
27
|
${exports.IntegrationConnectionFragmentDoc}`;
|
|
35
|
-
exports.GetConnectionStatusDocument = `
|
|
36
|
-
query getConnectionStatus($integrationConnectionId: ID!) {
|
|
37
|
-
integrationConnection(id: $integrationConnectionId) {
|
|
38
|
-
connectionStatus {
|
|
39
|
-
isConnected
|
|
40
|
-
error {
|
|
41
|
-
...UserError
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
${exports.UserErrorFragmentDoc}`;
|
|
47
28
|
exports.CreateIntegrationConnectionDocument = `
|
|
48
29
|
mutation createIntegrationConnection($input: CreateIntegrationConnectionInput!) {
|
|
49
30
|
createIntegrationConnection(input: $input) {
|
|
@@ -76,9 +57,6 @@ function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
76
57
|
getIntegrationConnections(variables, requestHeaders) {
|
|
77
58
|
return withWrapper((wrappedRequestHeaders) => client.request(exports.GetIntegrationConnectionsDocument, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "getIntegrationConnections", "query");
|
|
78
59
|
},
|
|
79
|
-
getConnectionStatus(variables, requestHeaders) {
|
|
80
|
-
return withWrapper((wrappedRequestHeaders) => client.request(exports.GetConnectionStatusDocument, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "getConnectionStatus", "query");
|
|
81
|
-
},
|
|
82
60
|
createIntegrationConnection(variables, requestHeaders) {
|
|
83
61
|
return withWrapper((wrappedRequestHeaders) => client.request(exports.CreateIntegrationConnectionDocument, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "createIntegrationConnection", "mutation");
|
|
84
62
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "conductor-node",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
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",
|
|
@@ -16,10 +16,11 @@
|
|
|
16
16
|
"delete-compiled-tests": "rm -rf `find ./dist -type d -name __tests__` ./dist/src/utils/testing.*",
|
|
17
17
|
"postpack": "rm -rf dist",
|
|
18
18
|
"clean": "rm -rf dist package conductor-node-*.tgz tsconfig.tsbuildinfo",
|
|
19
|
-
"gen:graphql": "yarn graphql-codegen --config
|
|
19
|
+
"gen:graphql": "yarn graphql-codegen --config=./src/graphql/codegenConfig.ts",
|
|
20
20
|
"diff": "yarn pack && npm diff --diff=conductor-node@latest --diff=conductor-node-v$(node -p \"require('./package.json').version\").tgz && yarn clean",
|
|
21
21
|
"prepublishOnly": "yarn test",
|
|
22
|
-
"test": "yarn --cwd
|
|
22
|
+
"test": "yarn --cwd=../.. test ./packages/client",
|
|
23
|
+
"jest": "yarn --cwd=../../ jest"
|
|
23
24
|
},
|
|
24
25
|
"engines": {
|
|
25
26
|
"node": ">=16"
|