conductor-node 11.2.3 → 11.2.5

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
@@ -5,6 +5,52 @@ Execute _any_ read or write QuickBooks Desktop API through async TypeScript and
5
5
  <!-- markdownlint-disable MD033 -->
6
6
  <img src="https://user-images.githubusercontent.com/170023/213273732-83dd6881-0b36-4787-820b-bd55cdc8444f.jpg" alt="QuickBooks Desktop autocomplete" width="700"/>
7
7
 
8
+ ## Requirements
9
+
10
+ 1. A Conductor API key pair: one secret key, one publishable key. Please [email us](mailto:hello@conductor.is?subject=Conductor%20Beta) to join the private beta.
11
+ 2. Node.js v16 or later.
12
+
13
+ ## Installation
14
+
15
+ ```sh
16
+ npm install conductor-node
17
+ # or
18
+ yarn add conductor-node
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ The full API reference is available [here](https://docs.conductor.is). The code below is a quickstart example.
24
+
25
+ ```ts
26
+ import Conductor from "conductor-node";
27
+
28
+ const conductor = new Conductor("{{YOUR_SECRET_KEY}}");
29
+
30
+ async function main() {
31
+ // 1. Create a new EndUser.
32
+ const endUser = await conductor.endUsers.create({
33
+ sourceId: "{{UNIQUE_ID_FROM_YOUR_DB}}",
34
+ email: "{{END_USER_EMAIL}}",
35
+ name: "{{END_USER_NAME}}",
36
+ });
37
+ console.log("Save this EndUser ID to auth future requests:", endUser.id);
38
+
39
+ // 2. Create an AuthSession to establish the QuickBooks Desktop connection.
40
+ const authSession = await conductor.authSessions.create({
41
+ publishableKey: "{{YOUR_PUBLISHABLE_KEY}}",
42
+ endUserId: endUser.id,
43
+ });
44
+ console.log("Complete the QuickBooks Desktop auth:", authSession.authFlowUrl);
45
+
46
+ // 3. Get a list of all Customers from QuickBooks Desktop for this EndUser.
47
+ const qbdCustomers = await conductor.qbd.customers.query(endUser.id);
48
+ console.log("QuickBooks Desktop customers:", qbdCustomers);
49
+ }
50
+
51
+ main();
52
+ ```
53
+
8
54
  ## [Documentation 🚀](https://docs.conductor.is)
9
55
 
10
56
  1. [Get Started](https://docs.conductor.is/overview/get-started)
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "11.2.3",
3
+ "version": "11.2.5",
4
4
  "description": "Easily integrate the entire QuickBooks Desktop API using fully-typed async TypeScript",
5
5
  "keywords": [
6
6
  "QuickBooks Desktop",
@@ -14,6 +14,8 @@
14
14
  "QBD"
15
15
  ],
16
16
  "homepage": "https://conductor.is",
17
+ "repository": "github:conductor-is/conductor-node",
18
+ "author": "Conductor <support@conductor.is>",
17
19
  "license": "MIT",
18
20
  "type": "commonjs",
19
21
  "main": "dist/src/index.js",
@@ -1,6 +1,6 @@
1
1
  import Client from "./Client";
2
2
  /**
3
- * TypeScript/ESM usage:
3
+ * ESM support:
4
4
  * import Conductor from "conductor-node";
5
5
  * import { ConductorIntegrationError } from "conductor-node";
6
6
  * import type { QbdTypes } from "conductor-node";
package/dist/src/index.js CHANGED
@@ -34,16 +34,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
34
34
  const Client_1 = __importDefault(require("./Client"));
35
35
  const ErrorModule = __importStar(require("./utils/error"));
36
36
  /**
37
- * TypeScript/ESM usage:
38
- * import Conductor from "conductor-node";
39
- * import { ConductorIntegrationError } from "conductor-node";
40
- * import type { QbdTypes } from "conductor-node";
41
- */
42
- // eslint-disable-next-line unicorn/prefer-export-from -- `Client` must be the default export, which is impossible to define with `export from`.
43
- exports.default = Client_1.default;
44
- __exportStar(require("./utils/error"), exports);
45
- /**
46
- * CommonJS usage:
37
+ * CommonJS support:
47
38
  * const Conductor = require("conductor-node");
48
39
  * const { ConductorIntegrationError } = require("conductor-node");
49
40
  */
@@ -52,3 +43,15 @@ if (module.exports !== undefined) {
52
43
  // Extend `module.exports` with the exports from `ErrorModule`.
53
44
  Object.assign(module.exports, ErrorModule);
54
45
  }
46
+ /**
47
+ * ESM support:
48
+ * import Conductor from "conductor-node";
49
+ * import { ConductorIntegrationError } from "conductor-node";
50
+ * import type { QbdTypes } from "conductor-node";
51
+ */
52
+ // eslint-disable-next-line unicorn/prefer-export-from -- `Client` must be the default export, which is impossible to define with `export from`.
53
+ exports.default = Client_1.default;
54
+ // Must come after `module.exports` above. Otherwise, it breaks the following in
55
+ // JavaScript ESM:
56
+ // const { ConductorIntegrationError } = require("conductor-node");
57
+ __exportStar(require("./utils/error"), exports);
@@ -19,7 +19,9 @@ export interface AuthSession {
19
19
  */
20
20
  readonly authFlowUrl: string;
21
21
  /**
22
- * The time at which the AuthSession expires.
22
+ * The time at which the AuthSession expires. By default, this value is 30
23
+ * minutes from creation. You can extend this time by setting `linkExpiryMins`
24
+ * when creating the AuthSession.
23
25
  */
24
26
  readonly expiresAt: string;
25
27
  /**
@@ -40,8 +42,9 @@ export interface AuthSessionCreateInput {
40
42
  */
41
43
  readonly endUserId: string;
42
44
  /**
43
- * The number of minutes after which the AuthSession will expire. If not
44
- * provided, defaults to 30 minutes.
45
+ * The number of minutes after which the AuthSession will expire. Must be at
46
+ * least 15 minutes and no more than 7 days. If not provided, defaults to 30
47
+ * minutes.
45
48
  */
46
49
  readonly linkExpiryMins?: number;
47
50
  /**
@@ -6,7 +6,7 @@ export interface EndUser {
6
6
  */
7
7
  readonly id: string;
8
8
  /**
9
- * Your end-user's unique ID in *your* database. Must be distinct from your
9
+ * Your end-user's unique ID in _your_ database. Must be distinct from your
10
10
  * other end-users.
11
11
  */
12
12
  readonly sourceId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "11.2.3",
3
+ "version": "11.2.5",
4
4
  "description": "Easily integrate the entire QuickBooks Desktop API using fully-typed async TypeScript",
5
5
  "keywords": [
6
6
  "QuickBooks Desktop",
@@ -14,6 +14,8 @@
14
14
  "QBD"
15
15
  ],
16
16
  "homepage": "https://conductor.is",
17
+ "repository": "github:conductor-is/conductor-node",
18
+ "author": "Conductor <support@conductor.is>",
17
19
  "license": "MIT",
18
20
  "type": "commonjs",
19
21
  "main": "dist/src/index.js",