conductor-node 7.3.2 → 7.3.4
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 +1 -1
- package/dist/package.json +1 -1
- package/dist/src/Client.d.ts +24 -24
- package/dist/src/Client.js +36 -36
- package/dist/src/graphql/__generated__/operationTypes.d.ts +67 -51
- package/dist/src/graphql/__generated__/operationTypes.js +40 -30
- package/dist/src/integrations/qbd/QbdIntegration.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
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, GraphqlIsIntegrationConnectionActiveQuery, GraphqlIsIntegrationConnectionActiveQueryVariables, 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. */
|
|
@@ -14,8 +14,28 @@ export default class Client {
|
|
|
14
14
|
private readonly graphqlClient;
|
|
15
15
|
private readonly graphqlOperations;
|
|
16
16
|
constructor(apiKey: string, { verbose, serverEnvironment }?: ClientOptions);
|
|
17
|
-
getIntegrationConnection(integrationConnectionId: GraphqlGetIntegrationConnectionQueryVariables["integrationConnectionId"]): Promise<GraphqlGetIntegrationConnectionQuery["integrationConnection"]>;
|
|
18
|
-
getIntegrationConnections(): Promise<GraphqlGetIntegrationConnectionsQuery["integrationConnections"]>;
|
|
17
|
+
getIntegrationConnection(integrationConnectionId: GraphqlGetIntegrationConnectionQueryVariables["integrationConnectionId"]): Promise<GraphqlGetIntegrationConnectionQuery["viewer"]["integrationConnection"]>;
|
|
18
|
+
getIntegrationConnections(): Promise<GraphqlGetIntegrationConnectionsQuery["viewer"]["integrationConnections"]>;
|
|
19
|
+
isIntegrationConnectionActive(integrationConnectionId: GraphqlIsIntegrationConnectionActiveQueryVariables["integrationConnectionId"], secondsSinceLastActive?: GraphqlIsIntegrationConnectionActiveQueryVariables["secondsSinceLastActive"]): Promise<GraphqlIsIntegrationConnectionActiveQuery["viewer"]["integrationConnection"]["isActive"]>;
|
|
20
|
+
/**
|
|
21
|
+
* Check whether we can successfully connect to the end-user's QBD instance.
|
|
22
|
+
*
|
|
23
|
+
* Unlike `lastHeartbeatAt`, which only checks if QBWC is running (i.e., is
|
|
24
|
+
* the user's computer on), this check fails if the user's computer is on but
|
|
25
|
+
* QBD is not running, the wrong company file is open, or there is a modal
|
|
26
|
+
* dialog open in QBD.
|
|
27
|
+
*
|
|
28
|
+
* @param integrationConnectionId The ID of the integration connection.
|
|
29
|
+
* @returns result Object with the following properties:
|
|
30
|
+
* @returns result.isConnected Whether we can connect to QBD.
|
|
31
|
+
* @returns result.devErrorMessage If `isConnected=false`, this will be the
|
|
32
|
+
* corresponding error message for the developer; e.g., "The end-user's
|
|
33
|
+
* computer is likely off".
|
|
34
|
+
* @returns result.endUserErrorMessage If `isConnected=false`, this will be
|
|
35
|
+
* the corresponding error message for the end-user; e.g., "Please ensure your
|
|
36
|
+
* computer is on and QuickBooks Desktop is open".
|
|
37
|
+
*/
|
|
38
|
+
getConnectionStatus(integrationConnectionId: GraphqlGetConnectionStatusQueryVariables["integrationConnectionId"]): Promise<GraphqlGetConnectionStatusQuery["viewer"]["integrationConnection"]["connectionStatus"]>;
|
|
19
39
|
/**
|
|
20
40
|
* Create a new integration connection.
|
|
21
41
|
*
|
|
@@ -36,27 +56,7 @@ export default class Client {
|
|
|
36
56
|
endUserCompanyName?: string;
|
|
37
57
|
integrationKey: "quickbooks-desktop";
|
|
38
58
|
}): Promise<GraphqlCreateIntegrationConnectionMutation["createIntegrationConnection"]>;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Check whether we can successfully connect to the end-user's QBD instance.
|
|
42
|
-
*
|
|
43
|
-
* Unlike `lastHeartbeatAt`, which only checks if QBWC is running (i.e., is
|
|
44
|
-
* the user's computer on), this check fails if the user's computer is on but
|
|
45
|
-
* QBD is not running, the wrong company file is open, or there is a modal
|
|
46
|
-
* dialog open in QBD.
|
|
47
|
-
*
|
|
48
|
-
* @param integrationConnectionId The ID of the integration connection.
|
|
49
|
-
* @returns result Object with the following properties:
|
|
50
|
-
* @returns result.isConnected Whether we can connect to QBD.
|
|
51
|
-
* @returns result.devErrorMessage If `isConnected=false`, this will be the
|
|
52
|
-
* corresponding error message for the developer; e.g., "The end-user's
|
|
53
|
-
* computer is likely off".
|
|
54
|
-
* @returns result.endUserErrorMessage If `isConnected=false`, this will be
|
|
55
|
-
* the corresponding error message for the end-user; e.g., "Please ensure your
|
|
56
|
-
* computer is on and QuickBooks Desktop is open".
|
|
57
|
-
*/
|
|
58
|
-
getConnectionStatus(integrationConnectionId: GraphqlGetConnectionStatusQueryVariables["integrationConnectionId"]): Promise<GraphqlGetConnectionStatusQuery["integrationConnection"]["connectionStatus"]>;
|
|
59
|
-
integrationRequest(input: GraphqlIntegrationRequestInput): Promise<GraphqlIntegrationRequestQuery["integrationRequest"]>;
|
|
59
|
+
sendIntegrationRequest(input: GraphqlSendIntegrationRequestInput): Promise<GraphqlSendIntegrationRequestMutation["sendIntegrationRequest"]["response"]>;
|
|
60
60
|
private graphqlOperationWrapper;
|
|
61
61
|
private checkForUpdates;
|
|
62
62
|
}
|
package/dist/src/Client.js
CHANGED
|
@@ -40,12 +40,43 @@ class Client {
|
|
|
40
40
|
async getIntegrationConnection(integrationConnectionId) {
|
|
41
41
|
return this.graphqlOperations
|
|
42
42
|
.getIntegrationConnection({ integrationConnectionId })
|
|
43
|
-
.then((result) => result.integrationConnection);
|
|
43
|
+
.then((result) => result.viewer.integrationConnection);
|
|
44
44
|
}
|
|
45
45
|
async getIntegrationConnections() {
|
|
46
46
|
return this.graphqlOperations
|
|
47
47
|
.getIntegrationConnections()
|
|
48
|
-
.then((result) => result.integrationConnections);
|
|
48
|
+
.then((result) => result.viewer.integrationConnections);
|
|
49
|
+
}
|
|
50
|
+
async isIntegrationConnectionActive(integrationConnectionId, secondsSinceLastActive = 60) {
|
|
51
|
+
return this.graphqlOperations
|
|
52
|
+
.isIntegrationConnectionActive({
|
|
53
|
+
integrationConnectionId,
|
|
54
|
+
secondsSinceLastActive,
|
|
55
|
+
})
|
|
56
|
+
.then((result) => result.viewer.integrationConnection.isActive);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Check whether we can successfully connect to the end-user's QBD instance.
|
|
60
|
+
*
|
|
61
|
+
* Unlike `lastHeartbeatAt`, which only checks if QBWC is running (i.e., is
|
|
62
|
+
* the user's computer on), this check fails if the user's computer is on but
|
|
63
|
+
* QBD is not running, the wrong company file is open, or there is a modal
|
|
64
|
+
* dialog open in QBD.
|
|
65
|
+
*
|
|
66
|
+
* @param integrationConnectionId The ID of the integration connection.
|
|
67
|
+
* @returns result Object with the following properties:
|
|
68
|
+
* @returns result.isConnected Whether we can connect to QBD.
|
|
69
|
+
* @returns result.devErrorMessage If `isConnected=false`, this will be the
|
|
70
|
+
* corresponding error message for the developer; e.g., "The end-user's
|
|
71
|
+
* computer is likely off".
|
|
72
|
+
* @returns result.endUserErrorMessage If `isConnected=false`, this will be
|
|
73
|
+
* the corresponding error message for the end-user; e.g., "Please ensure your
|
|
74
|
+
* computer is on and QuickBooks Desktop is open".
|
|
75
|
+
*/
|
|
76
|
+
async getConnectionStatus(integrationConnectionId) {
|
|
77
|
+
return this.graphqlOperations
|
|
78
|
+
.getConnectionStatus({ integrationConnectionId })
|
|
79
|
+
.then((result) => result.viewer.integrationConnection.connectionStatus);
|
|
49
80
|
}
|
|
50
81
|
/**
|
|
51
82
|
* Create a new integration connection.
|
|
@@ -81,43 +112,12 @@ class Client {
|
|
|
81
112
|
})
|
|
82
113
|
.then((result) => result.createIntegrationConnection);
|
|
83
114
|
}
|
|
84
|
-
async isIntegrationConnectionActive(integrationConnectionId, secondsSinceLastActive = 60) {
|
|
85
|
-
return this.graphqlOperations
|
|
86
|
-
.isIntegrationConnectionActive({
|
|
87
|
-
integrationConnectionId,
|
|
88
|
-
secondsSinceLastActive,
|
|
89
|
-
})
|
|
90
|
-
.then((result) => result.integrationConnection.isActive);
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Check whether we can successfully connect to the end-user's QBD instance.
|
|
94
|
-
*
|
|
95
|
-
* Unlike `lastHeartbeatAt`, which only checks if QBWC is running (i.e., is
|
|
96
|
-
* the user's computer on), this check fails if the user's computer is on but
|
|
97
|
-
* QBD is not running, the wrong company file is open, or there is a modal
|
|
98
|
-
* dialog open in QBD.
|
|
99
|
-
*
|
|
100
|
-
* @param integrationConnectionId The ID of the integration connection.
|
|
101
|
-
* @returns result Object with the following properties:
|
|
102
|
-
* @returns result.isConnected Whether we can connect to QBD.
|
|
103
|
-
* @returns result.devErrorMessage If `isConnected=false`, this will be the
|
|
104
|
-
* corresponding error message for the developer; e.g., "The end-user's
|
|
105
|
-
* computer is likely off".
|
|
106
|
-
* @returns result.endUserErrorMessage If `isConnected=false`, this will be
|
|
107
|
-
* the corresponding error message for the end-user; e.g., "Please ensure your
|
|
108
|
-
* computer is on and QuickBooks Desktop is open".
|
|
109
|
-
*/
|
|
110
|
-
async getConnectionStatus(integrationConnectionId) {
|
|
111
|
-
return this.graphqlOperations
|
|
112
|
-
.getConnectionStatus({ integrationConnectionId })
|
|
113
|
-
.then((result) => result.integrationConnection.connectionStatus);
|
|
114
|
-
}
|
|
115
115
|
// TODO: Hide this method from the dev-user while still allowing the
|
|
116
116
|
// integration clients to access it.
|
|
117
|
-
async
|
|
117
|
+
async sendIntegrationRequest(input) {
|
|
118
118
|
return this.graphqlOperations
|
|
119
|
-
.
|
|
120
|
-
.then((result) => result.
|
|
119
|
+
.sendIntegrationRequest({ input })
|
|
120
|
+
.then((result) => result.sendIntegrationRequest.response);
|
|
121
121
|
}
|
|
122
122
|
async graphqlOperationWrapper(operationName, variables, operation) {
|
|
123
123
|
if (this.verbose) {
|
|
@@ -62,72 +62,66 @@ export type GraphqlIntegrationConnection = {
|
|
|
62
62
|
export type GraphqlIntegrationConnectionIsActiveArgs = {
|
|
63
63
|
secondsSinceLastActive: Scalars["Int"];
|
|
64
64
|
};
|
|
65
|
-
export type GraphqlIntegrationRequestInput = {
|
|
66
|
-
integrationConnectionId: Scalars["ID"];
|
|
67
|
-
requestObject: Scalars["JSONObject"];
|
|
68
|
-
};
|
|
69
65
|
export type GraphqlMutation = {
|
|
70
66
|
createIntegrationConnection: GraphqlCreateIntegrationConnectionResult;
|
|
67
|
+
sendIntegrationRequest: GraphqlSendIntegrationRequestResult;
|
|
71
68
|
};
|
|
72
69
|
export type GraphqlMutationCreateIntegrationConnectionArgs = {
|
|
73
70
|
input: GraphqlCreateIntegrationConnectionInput;
|
|
74
71
|
};
|
|
72
|
+
export type GraphqlMutationSendIntegrationRequestArgs = {
|
|
73
|
+
input: GraphqlSendIntegrationRequestInput;
|
|
74
|
+
};
|
|
75
75
|
export type GraphqlQuery = {
|
|
76
|
+
viewer: GraphqlViewer;
|
|
77
|
+
};
|
|
78
|
+
export type GraphqlSendIntegrationRequestInput = {
|
|
79
|
+
integrationConnectionId: Scalars["ID"];
|
|
80
|
+
requestObject: Scalars["JSONObject"];
|
|
81
|
+
};
|
|
82
|
+
export type GraphqlSendIntegrationRequestResult = {
|
|
83
|
+
response: Scalars["JSONObject"];
|
|
84
|
+
};
|
|
85
|
+
export type GraphqlViewer = {
|
|
76
86
|
integrationConnection: GraphqlIntegrationConnection;
|
|
77
87
|
integrationConnections: Array<GraphqlIntegrationConnection>;
|
|
78
|
-
integrationRequest: Scalars["JSONObject"];
|
|
79
88
|
};
|
|
80
|
-
export type
|
|
89
|
+
export type GraphqlViewerIntegrationConnectionArgs = {
|
|
81
90
|
id: Scalars["ID"];
|
|
82
91
|
};
|
|
83
|
-
export type GraphqlQueryIntegrationRequestArgs = {
|
|
84
|
-
input: GraphqlIntegrationRequestInput;
|
|
85
|
-
};
|
|
86
92
|
export type GraphqlIntegrationConnectionFragment = {
|
|
87
93
|
id: string;
|
|
88
94
|
integrationKey: string;
|
|
89
95
|
endUserEmail: string;
|
|
90
|
-
|
|
96
|
+
endUserCompanyName: string;
|
|
91
97
|
lastHeartbeatAt: Date | null;
|
|
92
98
|
};
|
|
93
99
|
export type GraphqlGetIntegrationConnectionQueryVariables = Exact<{
|
|
94
100
|
integrationConnectionId: Scalars["ID"];
|
|
95
101
|
}>;
|
|
96
102
|
export type GraphqlGetIntegrationConnectionQuery = {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
viewer: {
|
|
104
|
+
integrationConnection: {
|
|
105
|
+
id: string;
|
|
106
|
+
integrationKey: string;
|
|
107
|
+
endUserEmail: string;
|
|
108
|
+
endUserCompanyName: string;
|
|
109
|
+
lastHeartbeatAt: Date | null;
|
|
110
|
+
};
|
|
103
111
|
};
|
|
104
112
|
};
|
|
105
113
|
export type GraphqlGetIntegrationConnectionsQueryVariables = Exact<{
|
|
106
114
|
[key: string]: never;
|
|
107
115
|
}>;
|
|
108
116
|
export type GraphqlGetIntegrationConnectionsQuery = {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
integrationKey: string;
|
|
112
|
-
endUserEmail: string;
|
|
113
|
-
endUserName: string;
|
|
114
|
-
lastHeartbeatAt: Date | null;
|
|
115
|
-
}>;
|
|
116
|
-
};
|
|
117
|
-
export type GraphqlCreateIntegrationConnectionMutationVariables = Exact<{
|
|
118
|
-
input: GraphqlCreateIntegrationConnectionInput;
|
|
119
|
-
}>;
|
|
120
|
-
export type GraphqlCreateIntegrationConnectionMutation = {
|
|
121
|
-
createIntegrationConnection: {
|
|
122
|
-
qbwcPassword: string;
|
|
123
|
-
qwcFileDownloadUrl: string;
|
|
124
|
-
integrationConnection: {
|
|
117
|
+
viewer: {
|
|
118
|
+
integrationConnections: Array<{
|
|
125
119
|
id: string;
|
|
126
120
|
integrationKey: string;
|
|
127
121
|
endUserEmail: string;
|
|
128
|
-
|
|
122
|
+
endUserCompanyName: string;
|
|
129
123
|
lastHeartbeatAt: Date | null;
|
|
130
|
-
}
|
|
124
|
+
}>;
|
|
131
125
|
};
|
|
132
126
|
};
|
|
133
127
|
export type GraphqlIsIntegrationConnectionActiveQueryVariables = Exact<{
|
|
@@ -135,42 +129,64 @@ export type GraphqlIsIntegrationConnectionActiveQueryVariables = Exact<{
|
|
|
135
129
|
secondsSinceLastActive: Scalars["Int"];
|
|
136
130
|
}>;
|
|
137
131
|
export type GraphqlIsIntegrationConnectionActiveQuery = {
|
|
138
|
-
|
|
139
|
-
|
|
132
|
+
viewer: {
|
|
133
|
+
integrationConnection: {
|
|
134
|
+
isActive: boolean;
|
|
135
|
+
};
|
|
140
136
|
};
|
|
141
137
|
};
|
|
142
138
|
export type GraphqlGetConnectionStatusQueryVariables = Exact<{
|
|
143
139
|
integrationConnectionId: Scalars["ID"];
|
|
144
140
|
}>;
|
|
145
141
|
export type GraphqlGetConnectionStatusQuery = {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
142
|
+
viewer: {
|
|
143
|
+
integrationConnection: {
|
|
144
|
+
connectionStatus: {
|
|
145
|
+
isConnected: boolean;
|
|
146
|
+
devErrorMessage: string | null;
|
|
147
|
+
endUserErrorMessage: string | null;
|
|
148
|
+
};
|
|
151
149
|
};
|
|
152
150
|
};
|
|
153
151
|
};
|
|
154
|
-
export type
|
|
155
|
-
input:
|
|
152
|
+
export type GraphqlCreateIntegrationConnectionMutationVariables = Exact<{
|
|
153
|
+
input: GraphqlCreateIntegrationConnectionInput;
|
|
156
154
|
}>;
|
|
157
|
-
export type
|
|
158
|
-
|
|
155
|
+
export type GraphqlCreateIntegrationConnectionMutation = {
|
|
156
|
+
createIntegrationConnection: {
|
|
157
|
+
qbwcPassword: string;
|
|
158
|
+
qwcFileDownloadUrl: string;
|
|
159
|
+
integrationConnection: {
|
|
160
|
+
id: string;
|
|
161
|
+
integrationKey: string;
|
|
162
|
+
endUserEmail: string;
|
|
163
|
+
endUserCompanyName: string;
|
|
164
|
+
lastHeartbeatAt: Date | null;
|
|
165
|
+
};
|
|
166
|
+
};
|
|
159
167
|
};
|
|
160
|
-
export
|
|
168
|
+
export type GraphqlSendIntegrationRequestMutationVariables = Exact<{
|
|
169
|
+
input: GraphqlSendIntegrationRequestInput;
|
|
170
|
+
}>;
|
|
171
|
+
export type GraphqlSendIntegrationRequestMutation = {
|
|
172
|
+
sendIntegrationRequest: {
|
|
173
|
+
response: object;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
export declare const IntegrationConnectionFragmentDoc = "\n fragment IntegrationConnection on IntegrationConnection {\n id\n integrationKey\n endUserEmail\n endUserCompanyName\n lastHeartbeatAt\n}\n ";
|
|
161
177
|
export declare const GetIntegrationConnectionDocument: string;
|
|
162
178
|
export declare const GetIntegrationConnectionsDocument: string;
|
|
179
|
+
export declare const IsIntegrationConnectionActiveDocument = "\n query isIntegrationConnectionActive($integrationConnectionId: ID!, $secondsSinceLastActive: Int!) {\n viewer {\n integrationConnection(id: $integrationConnectionId) {\n isActive(secondsSinceLastActive: $secondsSinceLastActive)\n }\n }\n}\n ";
|
|
180
|
+
export declare const GetConnectionStatusDocument = "\n query getConnectionStatus($integrationConnectionId: ID!) {\n viewer {\n integrationConnection(id: $integrationConnectionId) {\n connectionStatus {\n isConnected\n devErrorMessage\n endUserErrorMessage\n }\n }\n }\n}\n ";
|
|
163
181
|
export declare const CreateIntegrationConnectionDocument: string;
|
|
164
|
-
export declare const
|
|
165
|
-
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 ";
|
|
166
|
-
export declare const IntegrationRequestDocument = "\n query integrationRequest($input: IntegrationRequestInput!) {\n integrationRequest(input: $input)\n}\n ";
|
|
182
|
+
export declare const SendIntegrationRequestDocument = "\n mutation sendIntegrationRequest($input: SendIntegrationRequestInput!) {\n sendIntegrationRequest(input: $input) {\n response\n }\n}\n ";
|
|
167
183
|
export type SdkFunctionWrapper = <T>(action: (requestHeaders?: Record<string, string>) => Promise<T>, operationName: string, operationType?: string) => Promise<T>;
|
|
168
184
|
export declare function getSdk(client: GraphQLClient, withWrapper?: SdkFunctionWrapper): {
|
|
169
185
|
getIntegrationConnection(variables: GraphqlGetIntegrationConnectionQueryVariables, requestHeaders?: (Record<string, string> | Dom.Headers | string[][]) | undefined): Promise<GraphqlGetIntegrationConnectionQuery>;
|
|
170
186
|
getIntegrationConnections(variables?: GraphqlGetIntegrationConnectionsQueryVariables, requestHeaders?: (Record<string, string> | Dom.Headers | string[][]) | undefined): Promise<GraphqlGetIntegrationConnectionsQuery>;
|
|
171
|
-
createIntegrationConnection(variables: GraphqlCreateIntegrationConnectionMutationVariables, requestHeaders?: (Record<string, string> | Dom.Headers | string[][]) | undefined): Promise<GraphqlCreateIntegrationConnectionMutation>;
|
|
172
187
|
isIntegrationConnectionActive(variables: GraphqlIsIntegrationConnectionActiveQueryVariables, requestHeaders?: (Record<string, string> | Dom.Headers | string[][]) | undefined): Promise<GraphqlIsIntegrationConnectionActiveQuery>;
|
|
173
188
|
getConnectionStatus(variables: GraphqlGetConnectionStatusQueryVariables, requestHeaders?: (Record<string, string> | Dom.Headers | string[][]) | undefined): Promise<GraphqlGetConnectionStatusQuery>;
|
|
174
|
-
|
|
189
|
+
createIntegrationConnection(variables: GraphqlCreateIntegrationConnectionMutationVariables, requestHeaders?: (Record<string, string> | Dom.Headers | string[][]) | undefined): Promise<GraphqlCreateIntegrationConnectionMutation>;
|
|
190
|
+
sendIntegrationRequest(variables: GraphqlSendIntegrationRequestMutationVariables, requestHeaders?: (Record<string, string> | Dom.Headers | string[][]) | undefined): Promise<GraphqlSendIntegrationRequestMutation>;
|
|
175
191
|
};
|
|
176
192
|
export type Sdk = ReturnType<typeof getSdk>;
|
|
@@ -1,61 +1,71 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSdk = exports.
|
|
3
|
+
exports.getSdk = exports.SendIntegrationRequestDocument = exports.CreateIntegrationConnectionDocument = exports.GetConnectionStatusDocument = exports.IsIntegrationConnectionActiveDocument = exports.GetIntegrationConnectionsDocument = exports.GetIntegrationConnectionDocument = exports.IntegrationConnectionFragmentDoc = void 0;
|
|
4
4
|
exports.IntegrationConnectionFragmentDoc = `
|
|
5
5
|
fragment IntegrationConnection on IntegrationConnection {
|
|
6
6
|
id
|
|
7
7
|
integrationKey
|
|
8
8
|
endUserEmail
|
|
9
|
-
|
|
9
|
+
endUserCompanyName
|
|
10
10
|
lastHeartbeatAt
|
|
11
11
|
}
|
|
12
12
|
`;
|
|
13
13
|
exports.GetIntegrationConnectionDocument = `
|
|
14
14
|
query getIntegrationConnection($integrationConnectionId: ID!) {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
viewer {
|
|
16
|
+
integrationConnection(id: $integrationConnectionId) {
|
|
17
|
+
...IntegrationConnection
|
|
18
|
+
}
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
${exports.IntegrationConnectionFragmentDoc}`;
|
|
20
22
|
exports.GetIntegrationConnectionsDocument = `
|
|
21
23
|
query getIntegrationConnections {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
${exports.IntegrationConnectionFragmentDoc}`;
|
|
27
|
-
exports.CreateIntegrationConnectionDocument = `
|
|
28
|
-
mutation createIntegrationConnection($input: CreateIntegrationConnectionInput!) {
|
|
29
|
-
createIntegrationConnection(input: $input) {
|
|
30
|
-
integrationConnection {
|
|
24
|
+
viewer {
|
|
25
|
+
integrationConnections {
|
|
31
26
|
...IntegrationConnection
|
|
32
27
|
}
|
|
33
|
-
qbwcPassword
|
|
34
|
-
qwcFileDownloadUrl
|
|
35
28
|
}
|
|
36
29
|
}
|
|
37
30
|
${exports.IntegrationConnectionFragmentDoc}`;
|
|
38
31
|
exports.IsIntegrationConnectionActiveDocument = `
|
|
39
32
|
query isIntegrationConnectionActive($integrationConnectionId: ID!, $secondsSinceLastActive: Int!) {
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
viewer {
|
|
34
|
+
integrationConnection(id: $integrationConnectionId) {
|
|
35
|
+
isActive(secondsSinceLastActive: $secondsSinceLastActive)
|
|
36
|
+
}
|
|
42
37
|
}
|
|
43
38
|
}
|
|
44
39
|
`;
|
|
45
40
|
exports.GetConnectionStatusDocument = `
|
|
46
41
|
query getConnectionStatus($integrationConnectionId: ID!) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
42
|
+
viewer {
|
|
43
|
+
integrationConnection(id: $integrationConnectionId) {
|
|
44
|
+
connectionStatus {
|
|
45
|
+
isConnected
|
|
46
|
+
devErrorMessage
|
|
47
|
+
endUserErrorMessage
|
|
48
|
+
}
|
|
52
49
|
}
|
|
53
50
|
}
|
|
54
51
|
}
|
|
55
52
|
`;
|
|
56
|
-
exports.
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
exports.CreateIntegrationConnectionDocument = `
|
|
54
|
+
mutation createIntegrationConnection($input: CreateIntegrationConnectionInput!) {
|
|
55
|
+
createIntegrationConnection(input: $input) {
|
|
56
|
+
integrationConnection {
|
|
57
|
+
...IntegrationConnection
|
|
58
|
+
}
|
|
59
|
+
qbwcPassword
|
|
60
|
+
qwcFileDownloadUrl
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
${exports.IntegrationConnectionFragmentDoc}`;
|
|
64
|
+
exports.SendIntegrationRequestDocument = `
|
|
65
|
+
mutation sendIntegrationRequest($input: SendIntegrationRequestInput!) {
|
|
66
|
+
sendIntegrationRequest(input: $input) {
|
|
67
|
+
response
|
|
68
|
+
}
|
|
59
69
|
}
|
|
60
70
|
`;
|
|
61
71
|
const defaultWrapper = (action, _operationName, _operationType) => action();
|
|
@@ -67,17 +77,17 @@ function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
67
77
|
getIntegrationConnections(variables, requestHeaders) {
|
|
68
78
|
return withWrapper((wrappedRequestHeaders) => client.request(exports.GetIntegrationConnectionsDocument, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "getIntegrationConnections", "query");
|
|
69
79
|
},
|
|
70
|
-
createIntegrationConnection(variables, requestHeaders) {
|
|
71
|
-
return withWrapper((wrappedRequestHeaders) => client.request(exports.CreateIntegrationConnectionDocument, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "createIntegrationConnection", "mutation");
|
|
72
|
-
},
|
|
73
80
|
isIntegrationConnectionActive(variables, requestHeaders) {
|
|
74
81
|
return withWrapper((wrappedRequestHeaders) => client.request(exports.IsIntegrationConnectionActiveDocument, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "isIntegrationConnectionActive", "query");
|
|
75
82
|
},
|
|
76
83
|
getConnectionStatus(variables, requestHeaders) {
|
|
77
84
|
return withWrapper((wrappedRequestHeaders) => client.request(exports.GetConnectionStatusDocument, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "getConnectionStatus", "query");
|
|
78
85
|
},
|
|
79
|
-
|
|
80
|
-
return withWrapper((wrappedRequestHeaders) => client.request(exports.
|
|
86
|
+
createIntegrationConnection(variables, requestHeaders) {
|
|
87
|
+
return withWrapper((wrappedRequestHeaders) => client.request(exports.CreateIntegrationConnectionDocument, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "createIntegrationConnection", "mutation");
|
|
88
|
+
},
|
|
89
|
+
sendIntegrationRequest(variables, requestHeaders) {
|
|
90
|
+
return withWrapper((wrappedRequestHeaders) => client.request(exports.SendIntegrationRequestDocument, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "sendIntegrationRequest", "mutation");
|
|
81
91
|
},
|
|
82
92
|
};
|
|
83
93
|
}
|
|
@@ -668,7 +668,7 @@ class QbdIntegration extends BaseIntegration_1.default {
|
|
|
668
668
|
* https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop
|
|
669
669
|
*/
|
|
670
670
|
async sendRequest(integrationConnectionId, requestObject) {
|
|
671
|
-
return this.client.
|
|
671
|
+
return this.client.sendIntegrationRequest({
|
|
672
672
|
integrationConnectionId,
|
|
673
673
|
requestObject,
|
|
674
674
|
});
|
package/package.json
CHANGED