conductor-node 3.8.3 → 3.8.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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "3.8.3",
3
+ "version": "3.8.5",
4
4
  "description": "Conductor API wrapper",
5
5
  "author": "Danny Nemer <hi@DannyNemer.com>",
6
6
  "license": "MIT",
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const package_json_1 = __importDefault(require("./../package.json"));
7
7
  const environment_1 = require("./environment");
8
8
  const QbdIntegration_1 = __importDefault(require("./integrations/qbd/QbdIntegration"));
9
- const child_process_1 = require("child_process");
10
9
  const graphql_request_1 = require("graphql-request");
10
+ const node_child_process_1 = require("node:child_process");
11
11
  class Client {
12
12
  /** QuickBooks Desktop integration. */
13
13
  qbd;
@@ -85,7 +85,7 @@ class Client {
85
85
  }
86
86
  checkForUpdates() {
87
87
  const currentVersion = package_json_1.default.version;
88
- const latestVersion = (0, child_process_1.execSync)(`yarn info ${package_json_1.default.name} version`)
88
+ const latestVersion = (0, node_child_process_1.execSync)(`yarn info ${package_json_1.default.name} version`)
89
89
  .toString()
90
90
  .trim();
91
91
  if (currentVersion !== latestVersion) {
@@ -1,5 +1,4 @@
1
- import type { ClientOptions } from "./Client";
2
1
  import Client from "./Client";
3
- import type * as Types from "./integrations/types";
4
2
  export default Client;
5
- export type { ClientOptions, Types };
3
+ export { type ClientOptions } from "./Client";
4
+ export * as Types from "./integrations/types";
package/dist/src/index.js CHANGED
@@ -1,7 +1,34 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
5
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.Types = void 0;
30
+ // eslint-disable-next-line consistent-default-export-name/default-export-match-filename -- This file defines the exports for the `conductor-node` package, as defined by `main` in `package.json`. Hence, no other internal code imports this module and we can ignore the error that that the file's name must match the default export (`Client`).
6
31
  const Client_1 = __importDefault(require("./Client"));
32
+ // eslint-disable-next-line unicorn/prefer-export-from -- We need `Client` to be the default export, which is impossible to define with `export from`.
7
33
  exports.default = Client_1.default;
34
+ exports.Types = __importStar(require("./integrations/types"));
@@ -396,6 +396,29 @@ export default class QbdIntegration extends BaseIntegration {
396
396
  */
397
397
  query: (integrationUserConnectionId: string, params: QbdTypes.CustomerQueryRq) => Promise<NonNullable<QbdTypes.CustomerQueryRs["CustomerRet"]>>;
398
398
  };
399
+ deposit: {
400
+ /**
401
+ * After you receive payments from customers (see `ReceivePayment`), you can
402
+ * use the `DepositAdd` request to either deposit each payment directly into
403
+ * a QuickBooks bank account or you can group payments together. You can
404
+ * also choose the method you prefer for depositing payments.
405
+ *
406
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/DepositAdd
407
+ */
408
+ add: (integrationUserConnectionId: string, params: QbdTypes.DepositAddRq["DepositAdd"]) => Promise<NonNullable<QbdTypes.DepositAddRs["DepositRet"]>>;
409
+ /**
410
+ * Modifies an existing deposit.
411
+ *
412
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/DepositMod
413
+ */
414
+ mod: (integrationUserConnectionId: string, params: QbdTypes.DepositModRq["DepositMod"]) => Promise<NonNullable<QbdTypes.DepositModRs["DepositRet"]>>;
415
+ /**
416
+ * This request searches for deposits that match the supplied filters.
417
+ *
418
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/DepositQuery
419
+ */
420
+ query: (integrationUserConnectionId: string, params: QbdTypes.DepositQueryRq) => Promise<NonNullable<QbdTypes.DepositQueryRs["DepositRet"]>>;
421
+ };
399
422
  employee: {
400
423
  /**
401
424
  * Adds an employee with personal data about the employee as well as certain
@@ -400,6 +400,29 @@ class QbdIntegration extends BaseIntegration_1.default {
400
400
  */
401
401
  query: async (integrationUserConnectionId, params) => this.sendRequestBase(integrationUserConnectionId, { CustomerQueryRq: params }, "CustomerQueryRs", "CustomerRet"),
402
402
  };
403
+ deposit = {
404
+ /**
405
+ * After you receive payments from customers (see `ReceivePayment`), you can
406
+ * use the `DepositAdd` request to either deposit each payment directly into
407
+ * a QuickBooks bank account or you can group payments together. You can
408
+ * also choose the method you prefer for depositing payments.
409
+ *
410
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/DepositAdd
411
+ */
412
+ add: async (integrationUserConnectionId, params) => this.sendRequestBase(integrationUserConnectionId, { DepositAddRq: { DepositAdd: params } }, "DepositAddRs", "DepositRet"),
413
+ /**
414
+ * Modifies an existing deposit.
415
+ *
416
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/DepositMod
417
+ */
418
+ mod: async (integrationUserConnectionId, params) => this.sendRequestBase(integrationUserConnectionId, { DepositModRq: { DepositMod: params } }, "DepositModRs", "DepositRet"),
419
+ /**
420
+ * This request searches for deposits that match the supplied filters.
421
+ *
422
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/DepositQuery
423
+ */
424
+ query: async (integrationUserConnectionId, params) => this.sendRequestBase(integrationUserConnectionId, { DepositQueryRq: params }, "DepositQueryRs", "DepositRet"),
425
+ };
403
426
  employee = {
404
427
  /**
405
428
  * Adds an employee with personal data about the employee as well as certain
@@ -639,7 +662,7 @@ class QbdIntegration extends BaseIntegration_1.default {
639
662
  async sendRequestBase(integrationUserConnectionId, params, responseKey, responseBodyKey) {
640
663
  const response = (await this.sendRequest(integrationUserConnectionId, params));
641
664
  const responseBody = response[responseKey]?.[responseBodyKey];
642
- if (responseBody == null) {
665
+ if (responseBody === undefined) {
643
666
  throw new Error("No response");
644
667
  }
645
668
  return responseBody;