conductor-node 11.0.5 → 11.1.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/README.md +6 -5
- package/dist/package.json +1 -1
- package/dist/src/integrations/qbd/QbdIntegration.js +1 -1
- package/dist/src/interceptors/errorHandling.js +1 -1
- package/dist/src/resources/AuthSessionsResource.d.ts +15 -12
- package/dist/src/resources/AuthSessionsResource.js +3 -3
- package/dist/src/resources/EndUsersResource.d.ts +1 -1
- package/dist/src/resources/EndUsersResource.js +1 -1
- package/dist/src/resources/IntegrationConnectionsResource.d.ts +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Execute _any_ read or write QuickBooks Desktop API through async TypeScript and receive a fully-typed response.
|
|
4
4
|
|
|
5
5
|
<!-- markdownlint-disable MD033 -->
|
|
6
|
-
<img src="https://
|
|
6
|
+
<img src="https://mintlify.s3-us-west-1.amazonaws.com/conductor/images/autocomplete.jpg" alt="QuickBooks Desktop autocomplete" width="600"/>
|
|
7
7
|
|
|
8
8
|
## Usage
|
|
9
9
|
|
|
@@ -26,7 +26,8 @@ const newAccount = await conductor.qbd.account.add(endUsers[0].id, {
|
|
|
26
26
|
|
|
27
27
|
## Documentation
|
|
28
28
|
|
|
29
|
-
1. [Getting Started](https://docs.conductor.is/
|
|
30
|
-
2. [
|
|
31
|
-
3. [QuickBooks Desktop](https://docs.conductor.is/quickbooks-desktop)
|
|
32
|
-
4. [
|
|
29
|
+
1. [Getting Started](https://docs.conductor.is/overview/get-started)
|
|
30
|
+
2. [Quickstart](https://docs.conductor.is/overview/quickstart)
|
|
31
|
+
3. [QuickBooks Desktop APIs](https://docs.conductor.is/usage/quickbooks-desktop)
|
|
32
|
+
4. [API Reference](https://docs.conductor.is/apis)
|
|
33
|
+
5. [Error Handling](https://docs.conductor.is/usage/error-handling)
|
package/dist/package.json
CHANGED
|
@@ -2728,7 +2728,7 @@ class QbdIntegration extends BaseIntegration_1.default {
|
|
|
2728
2728
|
query: async (endUserId, params = {}) => this.sendRequestWrapper(endUserId, { WorkersCompCodeQueryRq: params }, "WorkersCompCodeQueryRs", "WorkersCompCodeRet"),
|
|
2729
2729
|
};
|
|
2730
2730
|
async sendRequestWrapper(endUserId, params, responseWrapperKey, responseBodyKey) {
|
|
2731
|
-
const response = (await this.sendRequest(endUserId, "
|
|
2731
|
+
const response = (await this.sendRequest(endUserId, "quickbooks_desktop", params));
|
|
2732
2732
|
const responseBody = response[responseWrapperKey]?.[responseBodyKey];
|
|
2733
2733
|
if (responseBody === undefined) {
|
|
2734
2734
|
throw new error_1.ConductorIntegrationError({
|
|
@@ -46,7 +46,7 @@ function addErrorHandlingInterceptors(httpClient) {
|
|
|
46
46
|
// Conductor API is offline) or an error ocurred when setting up the
|
|
47
47
|
// request (e.g., no network connection).
|
|
48
48
|
throw new error_1.ConductorConnectionError({
|
|
49
|
-
message: `An error occurred with our connection to Conductor: ${error.message}`,
|
|
49
|
+
message: `An error occurred with our connection to Conductor: ${error.message === "" ? error.code : error.message}`,
|
|
50
50
|
code: error.code ?? "NETWORK_ERROR",
|
|
51
51
|
httpStatusCode: error.status,
|
|
52
52
|
});
|
|
@@ -10,41 +10,44 @@ export interface AuthSession {
|
|
|
10
10
|
*/
|
|
11
11
|
readonly endUserId: string;
|
|
12
12
|
/**
|
|
13
|
-
* The
|
|
13
|
+
* The secret used in `authFlowUrl` to securely access the authentication
|
|
14
14
|
* flow.
|
|
15
15
|
*/
|
|
16
16
|
readonly clientSecret: string;
|
|
17
17
|
/**
|
|
18
|
-
* The
|
|
18
|
+
* The URL of the authentication flow that you will pass to your client for
|
|
19
|
+
* your end-user to set up their IntegrationConnection.
|
|
20
|
+
*/
|
|
21
|
+
readonly authFlowUrl: string;
|
|
22
|
+
/**
|
|
23
|
+
* The time at which the AuthSession expires.
|
|
19
24
|
*/
|
|
20
25
|
readonly expiresAt: string;
|
|
21
26
|
}
|
|
22
27
|
export interface AuthSessionCreateInput {
|
|
23
28
|
/**
|
|
24
29
|
* Your Conductor publishable key, which we use to create the session's
|
|
25
|
-
* `
|
|
30
|
+
* `authFlowUrl`.
|
|
26
31
|
*/
|
|
27
32
|
readonly publishableKey: string;
|
|
28
33
|
/**
|
|
29
34
|
* The ID of the EndUser for whom to create the IntegrationConnection.
|
|
30
35
|
*/
|
|
31
36
|
readonly endUserId: string;
|
|
32
|
-
}
|
|
33
|
-
export interface AuthSessionCreateOutput extends AuthSession {
|
|
34
37
|
/**
|
|
35
|
-
* The
|
|
36
|
-
*
|
|
38
|
+
* The number of minutes after which the AuthSession will expire. If not
|
|
39
|
+
* provided, defaults to 30 minutes.
|
|
37
40
|
*/
|
|
38
|
-
readonly
|
|
41
|
+
readonly linkExpiryMins?: number;
|
|
39
42
|
}
|
|
40
43
|
export default class AuthSessionsResource extends BaseResource {
|
|
41
44
|
protected readonly ROUTE = "/auth_sessions";
|
|
42
45
|
/**
|
|
43
|
-
* Creates an AuthSession
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
+
* Creates an AuthSession. Pass the returned session’s `authFlowUrl` to the
|
|
47
|
+
* client for your end-user to launch the IntegrationConnection authentication
|
|
48
|
+
* flow.
|
|
46
49
|
*/
|
|
47
|
-
create(input: AuthSessionCreateInput): Promise<
|
|
50
|
+
create(input: AuthSessionCreateInput): Promise<AuthSession>;
|
|
48
51
|
/**
|
|
49
52
|
* Retrieves the specified AuthSession.
|
|
50
53
|
*/
|
|
@@ -7,9 +7,9 @@ const BaseResource_1 = __importDefault(require("../resources/BaseResource"));
|
|
|
7
7
|
class AuthSessionsResource extends BaseResource_1.default {
|
|
8
8
|
ROUTE = "/auth_sessions";
|
|
9
9
|
/**
|
|
10
|
-
* Creates an AuthSession
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* Creates an AuthSession. Pass the returned session’s `authFlowUrl` to the
|
|
11
|
+
* client for your end-user to launch the IntegrationConnection authentication
|
|
12
|
+
* flow.
|
|
13
13
|
*/
|
|
14
14
|
async create(input) {
|
|
15
15
|
const { data } = await this.httpClient.post(this.ROUTE, input);
|
|
@@ -56,7 +56,7 @@ export default class EndUsersResource extends BaseResource {
|
|
|
56
56
|
*
|
|
57
57
|
* @param id The ID of the end-user to ping.
|
|
58
58
|
* @param integrationSlug The integration identifier for the end-user's
|
|
59
|
-
* connection you want to ping (e.g. "
|
|
59
|
+
* connection you want to ping (e.g. "quickbooks_desktop").
|
|
60
60
|
* @returns The ping result with the duration in milliseconds.
|
|
61
61
|
*/
|
|
62
62
|
ping(id: EndUser["id"], integrationSlug: IntegrationSlug): Promise<EndUserPingOutput>;
|
|
@@ -39,7 +39,7 @@ class EndUsersResource extends BaseResource_1.default {
|
|
|
39
39
|
*
|
|
40
40
|
* @param id The ID of the end-user to ping.
|
|
41
41
|
* @param integrationSlug The integration identifier for the end-user's
|
|
42
|
-
* connection you want to ping (e.g. "
|
|
42
|
+
* connection you want to ping (e.g. "quickbooks_desktop").
|
|
43
43
|
* @returns The ping result with the duration in milliseconds.
|
|
44
44
|
*/
|
|
45
45
|
async ping(id, integrationSlug) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BaseResource from "../resources/BaseResource";
|
|
2
|
-
export type IntegrationSlug = "
|
|
2
|
+
export type IntegrationSlug = "quickbooks_desktop";
|
|
3
3
|
export interface IntegrationConnection {
|
|
4
4
|
/**
|
|
5
5
|
* The unique identifier for the object.
|
|
@@ -11,7 +11,7 @@ export interface IntegrationConnection {
|
|
|
11
11
|
readonly endUserId: string;
|
|
12
12
|
/**
|
|
13
13
|
* The identifier of the third-party platform to integrate (e.g.,
|
|
14
|
-
* "
|
|
14
|
+
* "quickbooks_desktop").
|
|
15
15
|
*/
|
|
16
16
|
readonly integrationSlug: IntegrationSlug;
|
|
17
17
|
/**
|