conductor-node 7.3.5 → 7.3.6
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
|
@@ -106,10 +106,25 @@ const qbdConnection = await conductor.getIntegrationConnectionById(
|
|
|
106
106
|
);
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
### `
|
|
109
|
+
### `getConnectionStatus(id: string)`
|
|
110
110
|
|
|
111
|
-
Check
|
|
111
|
+
Check whether we can successfully connect to the end-user's QBD instance.
|
|
112
|
+
|
|
113
|
+
Unlike `lastHeartbeatAt`, which only checks if QBWC is running (i.e., is the user's computer on), this check fails if the user's computer is on but QBD is not running, the wrong company file is open, or there is a modal dialog open in QBD.
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
const connectionStatus = await conductor.getConnectionStatus(qbdConnectionId);
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The response includes the following:
|
|
112
120
|
|
|
113
121
|
```ts
|
|
114
|
-
|
|
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",
|
|
129
|
+
}
|
|
115
130
|
```
|
package/dist/package.json
CHANGED
package/dist/src/Client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Environment } from "./environment";
|
|
2
|
-
import type { GraphqlCreateIntegrationConnectionMutation, GraphqlGetConnectionStatusQuery, GraphqlGetConnectionStatusQueryVariables, GraphqlGetIntegrationConnectionQuery, GraphqlGetIntegrationConnectionQueryVariables, GraphqlGetIntegrationConnectionsQuery,
|
|
2
|
+
import type { GraphqlCreateIntegrationConnectionMutation, GraphqlGetConnectionStatusQuery, GraphqlGetConnectionStatusQueryVariables, GraphqlGetIntegrationConnectionQuery, GraphqlGetIntegrationConnectionQueryVariables, GraphqlGetIntegrationConnectionsQuery, GraphqlSendIntegrationRequestInput, GraphqlSendIntegrationRequestMutation } from "./graphql/__generated__/operationTypes";
|
|
3
3
|
import QbdIntegration from "./integrations/qbd/QbdIntegration";
|
|
4
4
|
export interface ClientOptions {
|
|
5
5
|
/** Log each request and response. */
|
|
@@ -16,7 +16,6 @@ export default class Client {
|
|
|
16
16
|
constructor(apiKey: string, { verbose, serverEnvironment }?: ClientOptions);
|
|
17
17
|
getIntegrationConnection(integrationConnectionId: GraphqlGetIntegrationConnectionQueryVariables["integrationConnectionId"]): Promise<GraphqlGetIntegrationConnectionQuery["integrationConnection"]>;
|
|
18
18
|
getIntegrationConnections(): Promise<GraphqlGetIntegrationConnectionsQuery["integrationConnections"]>;
|
|
19
|
-
isIntegrationConnectionActive(integrationConnectionId: GraphqlIsIntegrationConnectionActiveQueryVariables["integrationConnectionId"], secondsSinceLastActive?: GraphqlIsIntegrationConnectionActiveQueryVariables["secondsSinceLastActive"]): Promise<GraphqlIsIntegrationConnectionActiveQuery["integrationConnection"]["isActive"]>;
|
|
20
19
|
/**
|
|
21
20
|
* Check whether we can successfully connect to the end-user's QBD instance.
|
|
22
21
|
*
|
|
@@ -27,7 +26,7 @@ export default class Client {
|
|
|
27
26
|
*
|
|
28
27
|
* @param integrationConnectionId The ID of the integration connection.
|
|
29
28
|
* @returns result Object with the following properties:
|
|
30
|
-
* @returns result.isConnected Whether we can connect to QBD.
|
|
29
|
+
* @returns result.isConnected Whether we can connect to the end-user's QBD.
|
|
31
30
|
* @returns result.devErrorMessage If `isConnected=false`, this will be the
|
|
32
31
|
* corresponding error message for the developer; e.g., "The end-user's
|
|
33
32
|
* computer is likely off".
|
package/dist/src/Client.js
CHANGED
|
@@ -47,14 +47,6 @@ class Client {
|
|
|
47
47
|
.getIntegrationConnections()
|
|
48
48
|
.then((result) => result.integrationConnections);
|
|
49
49
|
}
|
|
50
|
-
async isIntegrationConnectionActive(integrationConnectionId, secondsSinceLastActive = 60) {
|
|
51
|
-
return this.graphqlOperations
|
|
52
|
-
.isIntegrationConnectionActive({
|
|
53
|
-
integrationConnectionId,
|
|
54
|
-
secondsSinceLastActive,
|
|
55
|
-
})
|
|
56
|
-
.then((result) => result.integrationConnection.isActive);
|
|
57
|
-
}
|
|
58
50
|
/**
|
|
59
51
|
* Check whether we can successfully connect to the end-user's QBD instance.
|
|
60
52
|
*
|
|
@@ -65,7 +57,7 @@ class Client {
|
|
|
65
57
|
*
|
|
66
58
|
* @param integrationConnectionId The ID of the integration connection.
|
|
67
59
|
* @returns result Object with the following properties:
|
|
68
|
-
* @returns result.isConnected Whether we can connect to QBD.
|
|
60
|
+
* @returns result.isConnected Whether we can connect to the end-user's QBD.
|
|
69
61
|
* @returns result.devErrorMessage If `isConnected=false`, this will be the
|
|
70
62
|
* corresponding error message for the developer; e.g., "The end-user's
|
|
71
63
|
* computer is likely off".
|
|
@@ -117,15 +117,6 @@ export type GraphqlGetIntegrationConnectionsQuery = {
|
|
|
117
117
|
lastHeartbeatAt: Date | null;
|
|
118
118
|
}>;
|
|
119
119
|
};
|
|
120
|
-
export type GraphqlIsIntegrationConnectionActiveQueryVariables = Exact<{
|
|
121
|
-
integrationConnectionId: Scalars["ID"];
|
|
122
|
-
secondsSinceLastActive: Scalars["Int"];
|
|
123
|
-
}>;
|
|
124
|
-
export type GraphqlIsIntegrationConnectionActiveQuery = {
|
|
125
|
-
integrationConnection: {
|
|
126
|
-
isActive: boolean;
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
120
|
export type GraphqlGetConnectionStatusQueryVariables = Exact<{
|
|
130
121
|
integrationConnectionId: Scalars["ID"];
|
|
131
122
|
}>;
|
|
@@ -165,7 +156,6 @@ export type GraphqlSendIntegrationRequestMutation = {
|
|
|
165
156
|
export declare const IntegrationConnectionFragmentDoc = "\n fragment IntegrationConnection on IntegrationConnection {\n id\n integrationKey\n endUserEmail\n endUserCompanyName\n lastHeartbeatAt\n}\n ";
|
|
166
157
|
export declare const GetIntegrationConnectionDocument: string;
|
|
167
158
|
export declare const GetIntegrationConnectionsDocument: string;
|
|
168
|
-
export declare const IsIntegrationConnectionActiveDocument = "\n query isIntegrationConnectionActive($integrationConnectionId: ID!, $secondsSinceLastActive: Int!) {\n integrationConnection(id: $integrationConnectionId) {\n isActive(secondsSinceLastActive: $secondsSinceLastActive)\n }\n}\n ";
|
|
169
159
|
export declare const GetConnectionStatusDocument = "\n query getConnectionStatus($integrationConnectionId: ID!) {\n integrationConnection(id: $integrationConnectionId) {\n connectionStatus {\n isConnected\n devErrorMessage\n endUserErrorMessage\n }\n }\n}\n ";
|
|
170
160
|
export declare const CreateIntegrationConnectionDocument: string;
|
|
171
161
|
export declare const SendIntegrationRequestDocument = "\n mutation sendIntegrationRequest($input: SendIntegrationRequestInput!) {\n sendIntegrationRequest(input: $input) {\n response\n }\n}\n ";
|
|
@@ -173,7 +163,6 @@ export type SdkFunctionWrapper = <T>(action: (requestHeaders?: Record<string, st
|
|
|
173
163
|
export declare function getSdk(client: GraphQLClient, withWrapper?: SdkFunctionWrapper): {
|
|
174
164
|
getIntegrationConnection(variables: GraphqlGetIntegrationConnectionQueryVariables, requestHeaders?: (Record<string, string> | Dom.Headers | string[][]) | undefined): Promise<GraphqlGetIntegrationConnectionQuery>;
|
|
175
165
|
getIntegrationConnections(variables?: GraphqlGetIntegrationConnectionsQueryVariables, requestHeaders?: (Record<string, string> | Dom.Headers | string[][]) | undefined): Promise<GraphqlGetIntegrationConnectionsQuery>;
|
|
176
|
-
isIntegrationConnectionActive(variables: GraphqlIsIntegrationConnectionActiveQueryVariables, requestHeaders?: (Record<string, string> | Dom.Headers | string[][]) | undefined): Promise<GraphqlIsIntegrationConnectionActiveQuery>;
|
|
177
166
|
getConnectionStatus(variables: GraphqlGetConnectionStatusQueryVariables, requestHeaders?: (Record<string, string> | Dom.Headers | string[][]) | undefined): Promise<GraphqlGetConnectionStatusQuery>;
|
|
178
167
|
createIntegrationConnection(variables: GraphqlCreateIntegrationConnectionMutationVariables, requestHeaders?: (Record<string, string> | Dom.Headers | string[][]) | undefined): Promise<GraphqlCreateIntegrationConnectionMutation>;
|
|
179
168
|
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.CreateIntegrationConnectionDocument = exports.GetConnectionStatusDocument = exports.
|
|
3
|
+
exports.getSdk = exports.SendIntegrationRequestDocument = exports.CreateIntegrationConnectionDocument = exports.GetConnectionStatusDocument = exports.GetIntegrationConnectionsDocument = exports.GetIntegrationConnectionDocument = exports.IntegrationConnectionFragmentDoc = void 0;
|
|
4
4
|
exports.IntegrationConnectionFragmentDoc = `
|
|
5
5
|
fragment IntegrationConnection on IntegrationConnection {
|
|
6
6
|
id
|
|
@@ -24,13 +24,6 @@ exports.GetIntegrationConnectionsDocument = `
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
${exports.IntegrationConnectionFragmentDoc}`;
|
|
27
|
-
exports.IsIntegrationConnectionActiveDocument = `
|
|
28
|
-
query isIntegrationConnectionActive($integrationConnectionId: ID!, $secondsSinceLastActive: Int!) {
|
|
29
|
-
integrationConnection(id: $integrationConnectionId) {
|
|
30
|
-
isActive(secondsSinceLastActive: $secondsSinceLastActive)
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
`;
|
|
34
27
|
exports.GetConnectionStatusDocument = `
|
|
35
28
|
query getConnectionStatus($integrationConnectionId: ID!) {
|
|
36
29
|
integrationConnection(id: $integrationConnectionId) {
|
|
@@ -69,9 +62,6 @@ function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
69
62
|
getIntegrationConnections(variables, requestHeaders) {
|
|
70
63
|
return withWrapper((wrappedRequestHeaders) => client.request(exports.GetIntegrationConnectionsDocument, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "getIntegrationConnections", "query");
|
|
71
64
|
},
|
|
72
|
-
isIntegrationConnectionActive(variables, requestHeaders) {
|
|
73
|
-
return withWrapper((wrappedRequestHeaders) => client.request(exports.IsIntegrationConnectionActiveDocument, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "isIntegrationConnectionActive", "query");
|
|
74
|
-
},
|
|
75
65
|
getConnectionStatus(variables, requestHeaders) {
|
|
76
66
|
return withWrapper((wrappedRequestHeaders) => client.request(exports.GetConnectionStatusDocument, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "getConnectionStatus", "query");
|
|
77
67
|
},
|
package/package.json
CHANGED