conductor-node 11.0.6 → 11.2.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 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://user-images.githubusercontent.com/170023/213273732-83dd6881-0b36-4787-820b-bd55cdc8444f.jpg" alt="QuickBooks Desktop autocomplete" width="600"/>
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/getting-started)
30
- 2. [API Reference](https://docs.conductor.is/apis)
31
- 3. [QuickBooks Desktop](https://docs.conductor.is/quickbooks-desktop)
32
- 4. [Error Handling](https://docs.conductor.is/error-handling)
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "11.0.6",
3
+ "version": "11.2.0",
4
4
  "description": "Easily integrate the entire QuickBooks Desktop API using fully-typed async TypeScript",
5
5
  "keywords": [
6
6
  "QuickBooks Desktop",
@@ -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
  });
@@ -5,46 +5,60 @@ export interface AuthSession {
5
5
  */
6
6
  readonly id: string;
7
7
  /**
8
- * The ID of the EndUser for whom to create an IntegrationConnection in this
9
- * AuthSession.
8
+ * The ID of the EndUser for whom to create an IntegrationConnection.
10
9
  */
11
10
  readonly endUserId: string;
12
11
  /**
13
- * The value that you will pass to the client to launch the authentication
12
+ * The secret used in `authFlowUrl` to securely access the authentication
14
13
  * flow.
15
14
  */
16
15
  readonly clientSecret: string;
17
16
  /**
18
- * The time at which this AuthSession expires.
17
+ * The URL of the authentication flow that you will pass to your client for
18
+ * your end-user to set up their IntegrationConnection.
19
+ */
20
+ readonly authFlowUrl: string;
21
+ /**
22
+ * The time at which the AuthSession expires.
19
23
  */
20
24
  readonly expiresAt: string;
25
+ /**
26
+ * The URL to which Conductor will redirect the end-user to return to your app
27
+ * after they complete the authentication flow. If `null`, their browser tab
28
+ * will close instead.
29
+ */
30
+ readonly returnUrl: string | undefined;
21
31
  }
22
32
  export interface AuthSessionCreateInput {
23
33
  /**
24
34
  * Your Conductor publishable key, which we use to create the session's
25
- * `authUrl`.
35
+ * `authFlowUrl`.
26
36
  */
27
37
  readonly publishableKey: string;
28
38
  /**
29
39
  * The ID of the EndUser for whom to create the IntegrationConnection.
30
40
  */
31
41
  readonly endUserId: string;
32
- }
33
- export interface AuthSessionCreateOutput extends AuthSession {
34
42
  /**
35
- * The URL of the authentication flow for the specified EndUser to set up the
36
- * IntegrationConnection.
43
+ * The number of minutes after which the AuthSession will expire. If not
44
+ * provided, defaults to 30 minutes.
45
+ */
46
+ readonly linkExpiryMins?: number;
47
+ /**
48
+ * The URL to which Conductor will redirect the end-user to return to your app
49
+ * after they complete the authentication flow. If not provided, their browser
50
+ * tab will close instead.
37
51
  */
38
- readonly authUrl: string;
52
+ readonly returnUrl?: string;
39
53
  }
40
54
  export default class AuthSessionsResource extends BaseResource {
41
55
  protected readonly ROUTE = "/auth_sessions";
42
56
  /**
43
- * Creates an AuthSession for launching the client-side IntegrationConnection
44
- * authentication flow. Use the returned session’s `clientSecret` to launch
45
- * the auth flow using Conductor.js.
57
+ * Creates an AuthSession. Pass the returned session’s `authFlowUrl` to the
58
+ * client for your end-user to launch the IntegrationConnection authentication
59
+ * flow.
46
60
  */
47
- create(input: AuthSessionCreateInput): Promise<AuthSessionCreateOutput>;
61
+ create(input: AuthSessionCreateInput): Promise<AuthSession>;
48
62
  /**
49
63
  * Retrieves the specified AuthSession.
50
64
  */
@@ -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 for launching the client-side IntegrationConnection
11
- * authentication flow. Use the returned session’s `clientSecret` to launch
12
- * the auth flow using Conductor.js.
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "11.0.6",
3
+ "version": "11.2.0",
4
4
  "description": "Easily integrate the entire QuickBooks Desktop API using fully-typed async TypeScript",
5
5
  "keywords": [
6
6
  "QuickBooks Desktop",