conductor-node 10.3.2 → 10.4.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
@@ -1,4 +1,4 @@
1
- # Conductor - The best QuickBooks Desktop integration on the planet
1
+ # [Conductor](https://conductor.is/) - The best QuickBooks Desktop integration on the planet
2
2
 
3
3
  Execute _any_ read or write [QuickBooks Desktop API](https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop) through async TypeScript and receive a fully-typed response.
4
4
 
@@ -16,7 +16,7 @@ Execute _any_ read or write [QuickBooks Desktop API](https://developer.intuit.co
16
16
 
17
17
  ## Requirements
18
18
 
19
- 1. A Conductor API key. [Please email us to join the private beta.](mailto:danny@conductor.is?subject=Conductor%20--%20Early%20Access)
19
+ 1. A Conductor API key. Please visit [our website](https://conductor.is/) to join the private beta.
20
20
 
21
21
  ## Installation
22
22
 
package/dist/package.json CHANGED
@@ -1,7 +1,17 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "10.3.2",
3
+ "version": "10.4.0",
4
4
  "description": "Easily integrate the entire QuickBooks Desktop API using fully-typed async TypeScript",
5
+ "keywords": [
6
+ "QuickBooks Desktop",
7
+ "QuickBooks",
8
+ "Intuit",
9
+ "QuickBooks Web Connector",
10
+ "qbXML",
11
+ "QBWC",
12
+ "QBD"
13
+ ],
14
+ "homepage": "https://conductor.is",
5
15
  "license": "MIT",
6
16
  "type": "commonjs",
7
17
  "main": "dist/src/index.js",
@@ -29,12 +39,5 @@
29
39
  "devDependencies": {
30
40
  "axios-mock-adapter": "^1.21.4",
31
41
  "tsc-alias": "^1.7.0"
32
- },
33
- "keywords": [
34
- "conductor",
35
- "qbd",
36
- "qbwc",
37
- "qbxml",
38
- "quickbooks desktop"
39
- ]
42
+ }
40
43
  }
@@ -1,5 +1,5 @@
1
1
  import type { EndUser } from "../resources/EndUsersResource";
2
- import type { IntegrationConnection } from "../resources/IntegrationConnectionsResource";
2
+ import type { IntegrationConnection, IntegrationKey } from "../resources/IntegrationConnectionsResource";
3
3
  import type { AxiosInstance } from "axios";
4
4
  export default abstract class BaseIntegration {
5
5
  protected readonly httpClient: AxiosInstance;
@@ -10,5 +10,5 @@ export default abstract class BaseIntegration {
10
10
  */
11
11
  protected sendRequestDeprecated(id: IntegrationConnection["id"], payload: Record<string, unknown>): Promise<object>;
12
12
  /** Not intended for public use. */
13
- protected sendRequest(endUserId: EndUser["id"], integrationKey: string, payload: Record<string, unknown>): Promise<object>;
13
+ protected sendRequest(endUserId: EndUser["id"], integrationKey: IntegrationKey, payload: Record<string, unknown>): Promise<object>;
14
14
  }
@@ -1,4 +1,5 @@
1
1
  import BaseResource from "../resources/BaseResource";
2
+ import type { IntegrationKey } from "../resources/IntegrationConnectionsResource";
2
3
  export interface EndUser {
3
4
  /**
4
5
  * The unique identifier for the object.
@@ -23,6 +24,9 @@ export interface EndUser {
23
24
  createdAt: string;
24
25
  }
25
26
  export type EndUserCreateInput = Pick<EndUser, "email" | "name" | "sourceId">;
27
+ export interface EndUserPingOutput {
28
+ duration: number;
29
+ }
26
30
  export default class EndUsersResource extends BaseResource {
27
31
  protected readonly ROUTE = "/end-users";
28
32
  /**
@@ -37,4 +41,20 @@ export default class EndUsersResource extends BaseResource {
37
41
  * Retrieves the specified end-user.
38
42
  */
39
43
  retrieve(id: EndUser["id"]): Promise<EndUser>;
44
+ /**
45
+ * Checks whether the specified integration-connection can connect and process
46
+ * requests end-to-end.
47
+ *
48
+ * If the connection fails, the error we encountered will be thrown as a
49
+ * `ConductorError` (like any request). This information is useful for showing
50
+ * a "connection status" indicator in your app. If an error occurs, we
51
+ * recommend displaying the property `error.endUserMessage` to your end-user
52
+ * in your app's UI.
53
+ *
54
+ * @param endUserId The ID of the end-user to ping.
55
+ * @param integrationKey The integration key for the integration-connection to
56
+ * ping.
57
+ * @returns The ping result with the duration in milliseconds.
58
+ */
59
+ ping(endUserId: EndUser["id"], integrationKey: IntegrationKey): Promise<EndUserPingOutput>;
40
60
  }
@@ -27,5 +27,24 @@ class EndUsersResource extends BaseResource_1.default {
27
27
  const { data } = await this.httpClient.get(`${this.ROUTE}/${id}`);
28
28
  return data;
29
29
  }
30
+ /**
31
+ * Checks whether the specified integration-connection can connect and process
32
+ * requests end-to-end.
33
+ *
34
+ * If the connection fails, the error we encountered will be thrown as a
35
+ * `ConductorError` (like any request). This information is useful for showing
36
+ * a "connection status" indicator in your app. If an error occurs, we
37
+ * recommend displaying the property `error.endUserMessage` to your end-user
38
+ * in your app's UI.
39
+ *
40
+ * @param endUserId The ID of the end-user to ping.
41
+ * @param integrationKey The integration key for the integration-connection to
42
+ * ping.
43
+ * @returns The ping result with the duration in milliseconds.
44
+ */
45
+ async ping(endUserId, integrationKey) {
46
+ const { data } = await this.httpClient.get(`${this.ROUTE}/${endUserId}/ping/${integrationKey}`);
47
+ return data;
48
+ }
30
49
  }
31
50
  exports.default = EndUsersResource;
@@ -1,6 +1,7 @@
1
1
  import BaseResource from "../resources/BaseResource";
2
2
  import IntegrationConnectionAuthSessionsResource from "../resources/IntegrationConnectionAuthSessionsResource";
3
3
  import type { AxiosInstance } from "axios";
4
+ export type IntegrationKey = "quickbooks-desktop";
4
5
  export interface IntegrationConnection {
5
6
  /**
6
7
  * The unique identifier for the object.
@@ -14,7 +15,7 @@ export interface IntegrationConnection {
14
15
  * The identifier of the third-party platform to integrate (e.g.,
15
16
  * "quickbooks-desktop").
16
17
  */
17
- integrationKey: string;
18
+ integrationKey: IntegrationKey;
18
19
  /**
19
20
  * The time at which the object was created.
20
21
  */
@@ -29,7 +30,7 @@ export interface IntegrationConnectionCreateOldInput {
29
30
  * The identifier of the third-party platform to integrate (e.g.,
30
31
  * "quickbooks-desktop").
31
32
  */
32
- integrationKey: string;
33
+ integrationKey: IntegrationKey;
33
34
  /**
34
35
  * Your end-user's unique ID in your product's database. Must be distinct from
35
36
  * your other connections for the same integration.
package/package.json CHANGED
@@ -1,7 +1,17 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "10.3.2",
3
+ "version": "10.4.0",
4
4
  "description": "Easily integrate the entire QuickBooks Desktop API using fully-typed async TypeScript",
5
+ "keywords": [
6
+ "QuickBooks Desktop",
7
+ "QuickBooks",
8
+ "Intuit",
9
+ "QuickBooks Web Connector",
10
+ "qbXML",
11
+ "QBWC",
12
+ "QBD"
13
+ ],
14
+ "homepage": "https://conductor.is",
5
15
  "license": "MIT",
6
16
  "type": "commonjs",
7
17
  "main": "dist/src/index.js",
@@ -29,12 +39,5 @@
29
39
  "devDependencies": {
30
40
  "axios-mock-adapter": "^1.21.4",
31
41
  "tsc-alias": "^1.7.0"
32
- },
33
- "keywords": [
34
- "conductor",
35
- "qbd",
36
- "qbwc",
37
- "qbxml",
38
- "quickbooks desktop"
39
- ]
42
+ }
40
43
  }