conductor-node 10.5.0 → 10.5.1

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": "10.5.0",
3
+ "version": "10.5.1",
4
4
  "description": "Easily integrate the entire QuickBooks Desktop API using fully-typed async TypeScript",
5
5
  "keywords": [
6
6
  "QuickBooks Desktop",
@@ -22,7 +22,7 @@ class Client {
22
22
  (0, checkForUpdates_1.checkForUpdates)();
23
23
  this.httpClient = this.createHttpClient(apiKey, verbose, serverEnvironment);
24
24
  this.endUsers = new EndUsersResource_1.default(this.httpClient);
25
- this.integrationConnections = new IntegrationConnectionsResource_1.default(this.httpClient);
25
+ this.integrationConnections = new IntegrationConnectionsResource_1.default(this);
26
26
  this.qbd = new QbdIntegration_1.default(this.httpClient);
27
27
  }
28
28
  createHttpClient(apiKey, verbose, serverEnvironment) {
@@ -38,9 +38,9 @@ export interface IntegrationConnectionAuthSessionCreateInput {
38
38
  export default class IntegrationConnectionAuthSessionsResource extends BaseResource {
39
39
  protected readonly ROUTE = "/integration-connection-auth-sessions";
40
40
  /**
41
- * Creates an auth `session for launch the client-side Integration Connection
42
- * authentication flow. Use the returned session’s `clientSecret` to launch
43
- * the auth flow using `conductor-react`.
41
+ * Creates an auth session for launching the client-side
42
+ * integration-connection authentication flow. Use the returned session’s
43
+ * `clientSecret` to launch the auth flow using Conductor.js.
44
44
  */
45
45
  create(input: IntegrationConnectionAuthSessionCreateInput): Promise<IntegrationConnectionAuthSession>;
46
46
  /**
@@ -7,9 +7,9 @@ const BaseResource_1 = __importDefault(require("../resources/BaseResource"));
7
7
  class IntegrationConnectionAuthSessionsResource extends BaseResource_1.default {
8
8
  ROUTE = "/integration-connection-auth-sessions";
9
9
  /**
10
- * Creates an auth `session for launch the client-side Integration Connection
11
- * authentication flow. Use the returned session’s `clientSecret` to launch
12
- * the auth flow using `conductor-react`.
10
+ * Creates an auth session for launching the client-side
11
+ * integration-connection authentication flow. Use the returned session’s
12
+ * `clientSecret` to launch the auth flow using Conductor.js.
13
13
  */
14
14
  async create(input) {
15
15
  const { data } = await this.httpClient.post(this.ROUTE, input);
@@ -1,6 +1,6 @@
1
+ import type Client from "../Client";
1
2
  import BaseResource from "../resources/BaseResource";
2
3
  import IntegrationConnectionAuthSessionsResource from "../resources/IntegrationConnectionAuthSessionsResource";
3
- import type { AxiosInstance } from "axios";
4
4
  export type IntegrationSlug = "quickbooks-desktop";
5
5
  export interface IntegrationConnection {
6
6
  /**
@@ -22,8 +22,7 @@ export interface IntegrationConnection {
22
22
  createdAt: string;
23
23
  }
24
24
  /**
25
- * @deprecated We will soon remove this endpoint as we migrate to the new
26
- * end-user + auth-session model.
25
+ * @deprecated Instead use `conductor.endUsers.create()`.
27
26
  */
28
27
  export interface IntegrationConnectionCreateOldInput {
29
28
  /**
@@ -51,13 +50,16 @@ export interface IntegrationConnectionPingOutput {
51
50
  export default class IntegrationConnectionsResource extends BaseResource {
52
51
  readonly authSessions: IntegrationConnectionAuthSessionsResource;
53
52
  protected readonly ROUTE = "/integration-connections";
54
- constructor(httpClient: AxiosInstance);
53
+ private readonly client;
54
+ constructor(client: Client);
55
55
  /**
56
56
  * Returns a list of all integration-connections of all your end-users.
57
57
  */
58
58
  list(): Promise<IntegrationConnection[]>;
59
59
  /**
60
60
  * Creates a new integration-connection.
61
+ *
62
+ * @deprecated Instead use `conductor.endUsers.create({ ... })`.
61
63
  */
62
64
  create(input: IntegrationConnectionCreateOldInput): Promise<IntegrationConnection>;
63
65
  /**
@@ -76,6 +78,8 @@ export default class IntegrationConnectionsResource extends BaseResource {
76
78
  *
77
79
  * @param id The integration-connection ID.
78
80
  * @returns The ping result with the duration in milliseconds.
81
+ *
82
+ * @deprecated Instead use `conductor.endUsers.ping(id, "quickbooks-desktop")`.
79
83
  */
80
84
  ping(id: IntegrationConnection["id"]): Promise<IntegrationConnectionPingOutput>;
81
85
  }
@@ -8,8 +8,11 @@ const IntegrationConnectionAuthSessionsResource_1 = __importDefault(require("../
8
8
  class IntegrationConnectionsResource extends BaseResource_1.default {
9
9
  authSessions;
10
10
  ROUTE = "/integration-connections";
11
- constructor(httpClient) {
12
- super(httpClient);
11
+ client;
12
+ constructor(client) {
13
+ // @ts-expect-error -- Temporary hack.
14
+ super(client.httpClient);
15
+ this.client = client;
13
16
  this.authSessions = new IntegrationConnectionAuthSessionsResource_1.default(this.httpClient);
14
17
  }
15
18
  /**
@@ -21,10 +24,21 @@ class IntegrationConnectionsResource extends BaseResource_1.default {
21
24
  }
22
25
  /**
23
26
  * Creates a new integration-connection.
27
+ *
28
+ * @deprecated Instead use `conductor.endUsers.create({ ... })`.
24
29
  */
25
30
  async create(input) {
26
- const { data } = await this.httpClient.post(this.ROUTE, input);
27
- return data;
31
+ const endUser = await this.client.endUsers.create({
32
+ sourceId: input.endUserSourceId,
33
+ email: input.endUserEmail,
34
+ name: input.endUserCompanyName,
35
+ });
36
+ return {
37
+ id: endUser.id,
38
+ endUserId: endUser.id,
39
+ integrationSlug: input.integrationSlug,
40
+ createdAt: endUser.createdAt,
41
+ };
28
42
  }
29
43
  /**
30
44
  * Retrieves the specified integration-connection.
@@ -45,10 +59,15 @@ class IntegrationConnectionsResource extends BaseResource_1.default {
45
59
  *
46
60
  * @param id The integration-connection ID.
47
61
  * @returns The ping result with the duration in milliseconds.
62
+ *
63
+ * @deprecated Instead use `conductor.endUsers.ping(id, "quickbooks-desktop")`.
48
64
  */
49
65
  async ping(id) {
50
- const { data } = await this.httpClient.get(`${this.ROUTE}/${id}/ping`);
51
- return data;
66
+ if (id.startsWith("int_conn")) {
67
+ const { data } = await this.httpClient.get(`${this.ROUTE}/${id}/ping`);
68
+ return data;
69
+ }
70
+ return this.client.endUsers.ping(id, "quickbooks-desktop");
52
71
  }
53
72
  }
54
73
  exports.default = IntegrationConnectionsResource;
@@ -20,7 +20,7 @@ export interface ConductorServerError {
20
20
  readonly code: string;
21
21
  readonly httpStatusCode: number;
22
22
  readonly integrationCode?: string;
23
- readonly requestId?: string;
23
+ readonly requestId: string;
24
24
  };
25
25
  }
26
26
  export declare function isWellFormedConductorServerError(error: unknown): error is ConductorServerError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "10.5.0",
3
+ "version": "10.5.1",
4
4
  "description": "Easily integrate the entire QuickBooks Desktop API using fully-typed async TypeScript",
5
5
  "keywords": [
6
6
  "QuickBooks Desktop",