conductor-node 0.1.2 → 0.1.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.
@@ -9,5 +9,5 @@ export default class BaseClient {
9
9
  protected readonly verbose: boolean;
10
10
  protected readonly serverURL: string;
11
11
  constructor({ apiKey, verbose, environment, }: BaseClientOptions);
12
- protected sendAPIRequest<T>(username: string, requestObj: T, apiPath: string): Promise<T>;
12
+ protected sendAPIRequest<T>(apiPath: string, username: string, requestObj: T): Promise<T>;
13
13
  }
@@ -16,7 +16,7 @@ class BaseClient {
16
16
  this.verbose = verbose;
17
17
  this.serverURL = (0, environment_1.envToBaseServerURL)(environment);
18
18
  }
19
- async sendAPIRequest(username, requestObj, apiPath) {
19
+ async sendAPIRequest(apiPath, username, requestObj) {
20
20
  const apiServerURL = `${this.serverURL}/${apiPath}`;
21
21
  if (this.verbose) {
22
22
  console.log(`Client sent request to ${apiServerURL} for user ${username}:`, JSON.stringify(requestObj, null, 2));
@@ -1,5 +1,5 @@
1
1
  import type { BaseClientOptions } from "./BaseClient";
2
- import ClientQBD from "./qb/ClientQBD";
2
+ import ClientQBD from "./qbd/ClientQBD";
3
3
  export default class Client {
4
4
  /** QuickBooks Desktop integration. */
5
5
  readonly qbd: ClientQBD;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const ClientQBD_1 = __importDefault(require("./qb/ClientQBD"));
6
+ const ClientQBD_1 = __importDefault(require("./qbd/ClientQBD"));
7
7
  class Client {
8
8
  /** QuickBooks Desktop integration. */
9
9
  qbd;
@@ -1,8 +1,5 @@
1
1
  import BaseClient from "../BaseClient";
2
- import type { AccountAdd, AccountQueryRq, AccountRet } from "../qb/qbXMLTypes/Account";
3
- import type { CustomerQueryRq, CustomerRet } from "../qb/qbXMLTypes/Customer";
4
- import type { EmployeeAdd, EmployeeMod, EmployeeQueryRq, EmployeeRet } from "../qb/qbXMLTypes/Employee";
5
- import type { VendorQueryRq, VendorRet } from "../qb/qbXMLTypes/Vendor";
2
+ import type * as qbd from "../qbd/qbdTypes";
6
3
  export interface QBXMLObj {
7
4
  [apiName: string]: object;
8
5
  }
@@ -20,7 +17,7 @@ export default class ClientQBD extends BaseClient {
20
17
  *
21
18
  * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/accountadd
22
19
  */
23
- accountAdd(qbwcUsername: string, params: AccountAdd): Promise<AccountRet>;
20
+ accountAdd(qbwcUsername: string, params: qbd.AccountAddRq["AccountAdd"]): Promise<qbd.AccountAddRs["AccountRet"]>;
24
21
  /**
25
22
  * `AccountQuery` is a list query that returns data for all accounts that
26
23
  * match the provided filter criteria. Notice that it returns only data
@@ -31,7 +28,7 @@ export default class ClientQBD extends BaseClient {
31
28
  *
32
29
  * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/accountquery
33
30
  */
34
- accountQuery(qbwcUsername: string, params: AccountQueryRq): Promise<AccountRet>;
31
+ accountQuery(qbwcUsername: string, params: qbd.AccountQueryRq): Promise<qbd.AccountQueryRs["AccountRet"]>;
35
32
  /**
36
33
  * Returns data for the specified customers.
37
34
  *
@@ -43,30 +40,30 @@ export default class ClientQBD extends BaseClient {
43
40
  *
44
41
  * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/customerquery
45
42
  */
46
- customerQuery(qbwcUsername: string, params: CustomerQueryRq): Promise<CustomerRet>;
43
+ customerQuery(qbwcUsername: string, params: qbd.CustomerQueryRq): Promise<qbd.CustomerQueryRs["CustomerRet"]>;
47
44
  /**
48
45
  * Adds an employee with personal data about the employee as well as certain
49
46
  * payroll-related data.
50
47
  *
51
48
  * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/employeeAdd
52
49
  */
53
- employeeAdd(qbwcUsername: string, params: EmployeeAdd): Promise<EmployeeRet>;
50
+ employeeAdd(qbwcUsername: string, params: qbd.EmployeeAddRq["EmployeeAdd"]): Promise<qbd.EmployeeAddRs["EmployeeRet"]>;
54
51
  /**
55
52
  * Modifies an existing employee.
56
53
  *
57
54
  * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/employeemod
58
55
  */
59
- employeeMod(qbwcUsername: string, params: EmployeeMod): Promise<EmployeeRet>;
56
+ employeeMod(qbwcUsername: string, params: qbd.EmployeeModRq["EmployeeMod"]): Promise<qbd.EmployeeModRs["EmployeeRet"]>;
60
57
  /**
61
58
  * Returns employee data.
62
59
  *
63
60
  * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/employeeQuery
64
61
  */
65
- employeeQuery(qbwcUsername: string, params: EmployeeQueryRq): Promise<EmployeeRet>;
62
+ employeeQuery(qbwcUsername: string, params: qbd.EmployeeQueryRq): Promise<qbd.EmployeeQueryRs["EmployeeRet"]>;
66
63
  /**
67
64
  * Queries for the specified vendor or set of vendors.
68
65
  *
69
66
  * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/vendorQuery
70
67
  */
71
- vendorQuery(qbwcUsername: string, params: VendorQueryRq): Promise<VendorRet>;
68
+ vendorQuery(qbwcUsername: string, params: qbd.VendorQueryRq): Promise<qbd.VendorQueryRs["VendorRet"]>;
72
69
  }
@@ -11,7 +11,7 @@ class ClientQBD extends BaseClient_1.default {
11
11
  * Available APIs: https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop
12
12
  */
13
13
  async sendRequest(qbwcUsername, requestObj) {
14
- return this.sendAPIRequest(qbwcUsername, requestObj, "qbd");
14
+ return this.sendAPIRequest("qbd", qbwcUsername, requestObj);
15
15
  }
16
16
  /**
17
17
  * Perform the same activities as a user does in the QB New Account form,