conductor-node 0.0.0 → 0.0.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/README.md CHANGED
@@ -1,11 +1,9 @@
1
1
  # Conductor Node.js Library
2
2
 
3
- The Conductor Node library provides convenient access to the Conductor API from applications written in server-side JavaScript.
3
+ The Conductor Node.js library provides convenient access to the Conductor API from applications written in server-side JavaScript.
4
4
 
5
5
  There are zero dependencies.
6
6
 
7
- Currently supports executing any [QuickBooks Desktop API](https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop) via JSON and receiving the response in JSON. In the future, these API will have extensive TypeScript typings.
8
-
9
7
  ## Installation
10
8
 
11
9
  ```sh
@@ -16,8 +14,12 @@ yarn add conductor-node
16
14
 
17
15
  The package must be configured with your account's secret key, which is available from Danny.
18
16
 
17
+ Currently supports executing any [QuickBooks Desktop API](https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop) via JSON and receiving the response in JSON. In the future, Conductor will incorporate extensive typings for these APIs.
18
+
19
+ To send a request to a specific QuickBooks Desktop user, you must also supply the username in their `.qwc` file that you provided them.
20
+
19
21
  ```ts
20
- import Conductor from "conductor";
22
+ import Conductor from "conductor-node";
21
23
  const conductor = new Conductor("sk_test_...");
22
24
 
23
25
  conductor
@@ -0,0 +1,5 @@
1
+ export default class Client {
2
+ private readonly apiKey;
3
+ constructor(apiKey: string);
4
+ sendRequest(qbwcUsername: string, requestObj: object): Promise<object>;
5
+ }
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class Client {
4
+ apiKey;
5
+ constructor(apiKey) {
6
+ this.apiKey = apiKey;
7
+ }
8
+ async sendRequest(qbwcUsername, requestObj) {
9
+ return fetch("https://conductor.ngrok.io", {
10
+ body: JSON.stringify({ qbwcUsername, requestObj }),
11
+ headers: {
12
+ "Content-Type": "application/json",
13
+ Authorization: `Bearer ${this.apiKey}`,
14
+ },
15
+ method: "POST",
16
+ }).then((res) => res.json());
17
+ }
18
+ }
19
+ exports.default = Client;
File without changes
package/package.json CHANGED
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "0.0.0",
3
+ "version": "0.0.1",
4
4
  "description": "Conductor API wrapper",
5
5
  "author": "Danny Nemer <hi@DannyNemer.com>",
6
6
  "repository": "git@github.com:conductor-io/conductor-node.git",
7
- "main": "src/Client.ts",
7
+ "main": "dist/index.ts",
8
+ "types": "dist/index.d.ts",
9
+ "scripts": {
10
+ "prepublish": "tsc"
11
+ },
8
12
  "devDependencies": {
9
13
  "typescript": "^4.7.4"
10
14
  }
package/tsconfig.json CHANGED
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "target": "ESNext",
4
- "module": "NodeNext"
4
+ "module": "NodeNext",
5
+ // Required for npm.
6
+ "declaration": true,
7
+ "outDir": "./dist"
5
8
  }
6
9
  }