conductor-node 10.3.0 → 10.3.2

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
@@ -16,8 +16,7 @@ Execute _any_ read or write [QuickBooks Desktop API](https://developer.intuit.co
16
16
 
17
17
  ## Requirements
18
18
 
19
- 1. A Conductor API key.
20
- 2. A running version of QuickBooks Desktop connected to Conductor. See our [guide to connecting QuickBooks Desktop to Conductor](https://conductor-io.notion.site/QuickBooks-Desktop-integration-setup-86f6325f747d4447b95d27b59ad89ef5).
19
+ 1. A Conductor API key. [Please email us to join the private beta.](mailto:danny@conductor.is?subject=Conductor%20--%20Early%20Access)
21
20
 
22
21
  ## Installation
23
22
 
@@ -65,8 +64,7 @@ const newQbdConnection = await conductor.integrationConnections.create({
65
64
  // Your end-user's unique ID in your product's database. Must be
66
65
  // distinct from your other connections for the same integration.
67
66
  endUserSourceId: "1234-abcd",
68
- // Your end-user's email address for identification only. No emails
69
- // will be sent.
67
+ // Your end-user's email address.
70
68
  endUserEmail: "danny@constructionco.com",
71
69
  // Your end-user's company name shown elsewhere in Conductor.
72
70
  endUserCompanyName: "Construction Corp",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "10.3.0",
3
+ "version": "10.3.2",
4
4
  "description": "Easily integrate the entire QuickBooks Desktop API using fully-typed async TypeScript",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -1,13 +1,14 @@
1
+ import type { EndUser } from "../resources/EndUsersResource";
1
2
  import type { IntegrationConnection } from "../resources/IntegrationConnectionsResource";
2
3
  import type { AxiosInstance } from "axios";
3
4
  export default abstract class BaseIntegration {
4
5
  protected readonly httpClient: AxiosInstance;
5
6
  constructor(httpClient: AxiosInstance);
6
7
  /**
7
- * @deprecated Use `sendRequestByEndUserIdAndIntegrationKey` after migrating
8
- * to end-user model.
8
+ * @deprecated Instead use `sendRequest` after migrating to the end-user
9
+ * model.
9
10
  */
10
11
  protected sendRequestDeprecated(id: IntegrationConnection["id"], payload: Record<string, unknown>): Promise<object>;
11
12
  /** Not intended for public use. */
12
- protected sendRequest(endUserId: IntegrationConnection["endUserId"], integrationKey: IntegrationConnection["integrationKey"], payload: Record<string, unknown>): Promise<object>;
13
+ protected sendRequest(endUserId: EndUser["id"], integrationKey: string, payload: Record<string, unknown>): Promise<object>;
13
14
  }
@@ -6,8 +6,8 @@ class BaseIntegration {
6
6
  this.httpClient = httpClient;
7
7
  }
8
8
  /**
9
- * @deprecated Use `sendRequestByEndUserIdAndIntegrationKey` after migrating
10
- * to end-user model.
9
+ * @deprecated Instead use `sendRequest` after migrating to the end-user
10
+ * model.
11
11
  */
12
12
  async sendRequestDeprecated(id, payload) {
13
13
  const { data } = await this.httpClient.post(`/integration-connections/${id}/send-request`, payload);
@@ -2404,14 +2404,9 @@ class QbdIntegration extends BaseIntegration_1.default {
2404
2404
  query: async (endUserId, params) => this.sendRequestWrapper(endUserId, { WorkersCompCodeQueryRq: params }, "WorkersCompCodeQueryRs", "WorkersCompCodeRet"),
2405
2405
  };
2406
2406
  async sendRequestWrapper(endUserId, params, responseWrapperKey, responseBodyKey) {
2407
- // Why is there no lint error for not initializing `response`?
2408
- let response;
2409
- if (endUserId.startsWith("int_conn")) {
2410
- response = (await this.sendRequestDeprecated(endUserId, params));
2411
- }
2412
- else {
2413
- response = (await this.sendRequest(endUserId, "quickbooks-desktop", params));
2414
- }
2407
+ const response = (endUserId.startsWith("int_conn")
2408
+ ? await this.sendRequestDeprecated(endUserId, params)
2409
+ : await this.sendRequest(endUserId, "quickbooks-desktop", params));
2415
2410
  const responseBody = response[responseWrapperKey]?.[responseBodyKey];
2416
2411
  if (responseBody === undefined) {
2417
2412
  throw new error_1.ConductorIntegrationError({
@@ -5419,9 +5419,9 @@ export interface InvoiceAdd {
5419
5419
  /** A list of credits to set. Setting, or applying, a credit means using an available credit to lower the balance of a transaction such as an invoice or a bill. (Creating a credit, on the other hand, means making a credit available to be applied in the future.) Notice that if you use a credit (`SetCredit`) only, in your `ReceivePaymentAdd` or `BillPaymentCreditCardAdd` request, then no transaction ID is created, because, from the viewpoint of QuickBooks, there was no transaction. Setting a credit merely creates links between existing transactions (for example, between a credit memo transaction and an invoice transaction), and no information about these links will be returned to you in the response. If you need to retrieve which transactions were linked in the `SetCredit`, for Bill Payment, you must do a `BillQuery` and specify `IncludeLinkedTxns`. */
5420
5420
  SetCredit?: SetCredit | SetCredit[];
5421
5421
  /** Represents one line in the invoice. Compare with `InvoiceLineGroup`, which represents a previously defined group of lines in the invoice. */
5422
- InvoiceLineAdd?: InvoiceLineAdd;
5422
+ InvoiceLineAdd?: InvoiceLineAdd | InvoiceLineAdd[];
5423
5423
  /** Represents a previously defined group of lines in the invoice. Compare with `InvoiceLine`, which represents just one line in the invoice. */
5424
- InvoiceLineGroupAdd?: InvoiceLineGroupAdd;
5424
+ InvoiceLineGroupAdd?: InvoiceLineGroupAdd | InvoiceLineGroupAdd[];
5425
5425
  }
5426
5426
  export interface InvoiceAddRq {
5427
5427
  InvoiceAdd: InvoiceAdd;
@@ -5984,9 +5984,9 @@ export interface InvoiceRet {
5984
5984
  The list of linked transactions is similar to the History view of a transaction in the user interface, but not identical, as the SDK list contains only linked transactions, not items. */
5985
5985
  LinkedTxn?: LinkedTxn | LinkedTxn[];
5986
5986
  /** Represents one line in the invoice. Compare with `InvoiceLineGroup`, which represents a previously defined group of lines in the invoice. */
5987
- InvoiceLineRet?: InvoiceLineRet;
5987
+ InvoiceLineRet?: InvoiceLineRet | InvoiceLineRet[];
5988
5988
  /** Represents a previously defined group of lines in the invoice. Compare with `InvoiceLine`, which represents just one line in the invoice. */
5989
- InvoiceLineGroupRet?: InvoiceLineGroupRet;
5989
+ InvoiceLineGroupRet?: InvoiceLineGroupRet | InvoiceLineGroupRet[];
5990
5990
  /** A list of `IDataExtRet` objects, each of which represents a field that has been added to QuickBooks as a data extension. */
5991
5991
  DataExtRet?: DataExtRet | DataExtRet[];
5992
5992
  }
@@ -5,13 +5,12 @@ export interface EndUser {
5
5
  */
6
6
  id: string;
7
7
  /**
8
- * Your end-user's unique ID in your database. Must be distinct from
9
- * your other end-users.
8
+ * Your end-user's unique ID in your database. Must be distinct from your
9
+ * other end-users.
10
10
  */
11
11
  sourceId: string;
12
12
  /**
13
- * Your end-user's email address for identification only. No emails will be
14
- * sent.
13
+ * Your end-user's email address.
15
14
  */
16
15
  email: string;
17
16
  /**
@@ -36,8 +36,7 @@ export interface IntegrationConnectionCreateOldInput {
36
36
  */
37
37
  endUserSourceId: string;
38
38
  /**
39
- * Your end-user's email address for identification only. No emails will be
40
- * sent.
39
+ * Your end-user's email address.
41
40
  */
42
41
  endUserEmail: string;
43
42
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "10.3.0",
3
+ "version": "10.3.2",
4
4
  "description": "Easily integrate the entire QuickBooks Desktop API using fully-typed async TypeScript",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",