conductor-node 0.0.14 → 0.0.17
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 +1 -1
- package/dist/src/BaseClient.d.ts +11 -0
- package/dist/src/BaseClient.js +24 -0
- package/dist/{Client.d.ts → src/Client.d.ts} +2 -1
- package/dist/{Client.js → src/Client.js} +2 -5
- package/dist/{qb → src/qb}/ClientQBD.d.ts +6 -6
- package/dist/{qb → src/qb}/ClientQBD.js +5 -14
- package/dist/{qb → src/qb}/qbXMLTypes/Account.d.ts +0 -0
- package/dist/{qb → src/qb}/qbXMLTypes/Account.js +0 -0
- package/dist/{qb → src/qb}/qbXMLTypes/Customer.d.ts +0 -0
- package/dist/{qb → src/qb}/qbXMLTypes/Customer.js +0 -0
- package/dist/{qb → src/qb}/qbXMLTypes/Employee.d.ts +3 -2
- package/dist/{qb → src/qb}/qbXMLTypes/Employee.js +0 -0
- package/dist/{qb → src/qb}/qbXMLTypes/Vendor.d.ts +0 -0
- package/dist/{qb → src/qb}/qbXMLTypes/Vendor.js +0 -0
- package/dist/{qb → src/qb}/qbXMLTypes/shared.d.ts +0 -0
- package/dist/{qb → src/qb}/qbXMLTypes/shared.js +0 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ To send a request to a specific QuickBooks Desktop user, you must also supply th
|
|
|
23
23
|
|
|
24
24
|
```ts
|
|
25
25
|
import Conductor from "conductor-node";
|
|
26
|
-
const conductor = new Conductor("sk_test_...");
|
|
26
|
+
const conductor = new Conductor({ apiKey: "sk_test_..." });
|
|
27
27
|
|
|
28
28
|
conductor.qbd
|
|
29
29
|
.accountAdd("mock_qbwc_username", {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface BaseClientOptions {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
verbose?: boolean;
|
|
4
|
+
environment?: "development" | "staging";
|
|
5
|
+
}
|
|
6
|
+
export default class BaseClient {
|
|
7
|
+
protected readonly apiKey: string;
|
|
8
|
+
protected readonly verbose: boolean;
|
|
9
|
+
protected readonly serverURL: string;
|
|
10
|
+
constructor({ apiKey, verbose, environment, }: BaseClientOptions);
|
|
11
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// Store properties via superclass `BaseClient` instead of on `Client` passed to
|
|
4
|
+
// the integration clients (e.g., `ClientQBD`) to hide these properties from the
|
|
5
|
+
// dev user while still allowing the integration clients to access them.
|
|
6
|
+
//
|
|
7
|
+
// Downside: These values are stored in each subclass instead of sharing a
|
|
8
|
+
// single store (e.g., `Client`).
|
|
9
|
+
class BaseClient {
|
|
10
|
+
apiKey;
|
|
11
|
+
verbose;
|
|
12
|
+
serverURL;
|
|
13
|
+
constructor({ apiKey, verbose = false, environment = "development", }) {
|
|
14
|
+
this.apiKey = apiKey;
|
|
15
|
+
this.verbose = verbose;
|
|
16
|
+
if (environment === "development") {
|
|
17
|
+
this.serverURL = "https://conductor.ngrok.io";
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
throw new Error(`Unsupported environment: ${environment}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = BaseClient;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { BaseClientOptions } from "./BaseClient";
|
|
1
2
|
import ClientQBD from "./qb/ClientQBD";
|
|
2
3
|
export default class Client {
|
|
3
4
|
/** QuickBooks Desktop integration. */
|
|
4
5
|
readonly qbd: ClientQBD;
|
|
5
|
-
constructor(
|
|
6
|
+
constructor(options: BaseClientOptions);
|
|
6
7
|
}
|
|
@@ -7,11 +7,8 @@ const ClientQBD_1 = __importDefault(require("./qb/ClientQBD"));
|
|
|
7
7
|
class Client {
|
|
8
8
|
/** QuickBooks Desktop integration. */
|
|
9
9
|
qbd;
|
|
10
|
-
constructor(
|
|
11
|
-
|
|
12
|
-
// exposing them as properties to the user and mixing them with the
|
|
13
|
-
// integrations, like `qbd`.
|
|
14
|
-
this.qbd = new ClientQBD_1.default(apiKey, verbose, environment);
|
|
10
|
+
constructor(options) {
|
|
11
|
+
this.qbd = new ClientQBD_1.default(options);
|
|
15
12
|
}
|
|
16
13
|
}
|
|
17
14
|
exports.default = Client;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
+
import BaseClient from "../BaseClient";
|
|
1
2
|
import type { AccountAdd, AccountQueryRq, AccountRet } from "../qb/qbXMLTypes/Account";
|
|
2
3
|
import type { CustomerQueryRq, CustomerRet } from "../qb/qbXMLTypes/Customer";
|
|
3
4
|
import type { EmployeeAdd, EmployeeMod, EmployeeQueryRq, EmployeeRet } from "../qb/qbXMLTypes/Employee";
|
|
4
5
|
import type { VendorQueryRq, VendorRet } from "../qb/qbXMLTypes/Vendor";
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
constructor(apiKey: string, verbose: boolean, environment: string);
|
|
6
|
+
export interface QBXMLObj {
|
|
7
|
+
[apiName: string]: object;
|
|
8
|
+
}
|
|
9
|
+
export default class ClientQBD extends BaseClient {
|
|
10
10
|
/**
|
|
11
11
|
* Send any QBXML request to QuickBooks Desktop.
|
|
12
12
|
*
|
|
13
13
|
* Available APIs: https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop
|
|
14
14
|
*/
|
|
15
|
-
sendRequest(qbwcUsername: string, requestObj:
|
|
15
|
+
sendRequest(qbwcUsername: string, requestObj: QBXMLObj): Promise<QBXMLObj>;
|
|
16
16
|
/**
|
|
17
17
|
* Perform the same activities as a user does in the QB New Account form,
|
|
18
18
|
* which can be accessed in QB by selecting "Lists" → "Chart of Accounts" →
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
verbose;
|
|
6
|
-
serverURL;
|
|
7
|
-
constructor(apiKey, verbose, environment) {
|
|
8
|
-
this.apiKey = apiKey;
|
|
9
|
-
this.verbose = verbose;
|
|
10
|
-
if (environment === "development") {
|
|
11
|
-
this.serverURL = "https://conductor.ngrok.io";
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
throw new Error(`Unsupported environment: ${environment}`);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
6
|
+
const BaseClient_1 = __importDefault(require("../BaseClient"));
|
|
7
|
+
class ClientQBD extends BaseClient_1.default {
|
|
17
8
|
/**
|
|
18
9
|
* Send any QBXML request to QuickBooks Desktop.
|
|
19
10
|
*
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -282,19 +282,20 @@ interface EmployeeAddress {
|
|
|
282
282
|
*/
|
|
283
283
|
City?: string;
|
|
284
284
|
/**
|
|
285
|
-
* When it appears in the EmployeeAddress aggregate, the State element acts
|
|
285
|
+
* When it appears in the `EmployeeAddress` aggregate, the State element acts
|
|
286
286
|
* like an `ENUMTYPE` with the following possible values: None, AA (military),
|
|
287
287
|
* AE (military), AK, AL, AP (military), AR, AZ, CA, CO, CT, DC, DE, FL, GA,
|
|
288
288
|
* HI, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MS, MT, NC, ND, NE,
|
|
289
289
|
* NH, NJ, NM, NV, NY, OH, OK, OR, PA, PR, RI, SC, SD, TN, TX, UT, VA, VT, WA,
|
|
290
290
|
* WI, WV, and WY.
|
|
291
291
|
*/
|
|
292
|
-
State?:
|
|
292
|
+
State?: State;
|
|
293
293
|
/**
|
|
294
294
|
* The postal code in an address.
|
|
295
295
|
*/
|
|
296
296
|
PostalCode?: string;
|
|
297
297
|
}
|
|
298
|
+
declare type State = "AA" | "AE" | "AK" | "AL" | "AP" | "AR" | "AZ" | "CA" | "CO" | "CT" | "DC" | "DE" | "FL" | "GA" | "HI" | "IA" | "ID" | "IL" | "IN" | "KS" | "KY" | "LA" | "MA" | "MD" | "ME" | "MI" | "MN" | "MO" | "MS" | "MT" | "NC" | "ND" | "NE" | "NH" | "NJ" | "NM" | "None" | "NV" | "NY" | "OH" | "OK" | "OR" | "PA" | "PR" | "RI" | "SC" | "SD" | "TN" | "TX" | "UT" | "VA" | "VT" | "WA" | "WI" | "WV" | "WY";
|
|
298
299
|
interface EmergencyContacts {
|
|
299
300
|
PrimaryContact?: {
|
|
300
301
|
ContactName: string;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "conductor-node",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"description": "Conductor API wrapper",
|
|
5
5
|
"author": "Danny Nemer <hi@DannyNemer.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"main": "dist/Client.js",
|
|
8
|
-
"types": "dist/Client.d.ts",
|
|
7
|
+
"main": "dist/src/Client.js",
|
|
8
|
+
"types": "dist/src/Client.d.ts",
|
|
9
9
|
"files": [
|
|
10
|
-
"dist/**/*.[jt]s"
|
|
10
|
+
"dist/src/**/*.[jt]s"
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
13
|
"prepack": "yarn tsc && yarn tsc-alias",
|