conductor-node 7.2.0 → 7.3.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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "7.2.0",
3
+ "version": "7.3.1",
4
4
  "description": "Easily integrate with the entire QuickBooks Desktop API with fully-typed async TypeScript",
5
5
  "author": "Danny Nemer <hi@DannyNemer.com>",
6
6
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  import type { Environment } from "./environment";
2
- import type { GraphqlCreateIntegrationConnectionInput, GraphqlCreateIntegrationConnectionMutation, GraphqlGetConnectionStatusQuery, GraphqlGetConnectionStatusQueryVariables, GraphqlGetIntegrationConnectionQuery, GraphqlGetIntegrationConnectionQueryVariables, GraphqlGetIntegrationConnectionsQuery, GraphqlIntegrationRequestInput, GraphqlIntegrationRequestQuery, GraphqlIsIntegrationConnectionActiveQuery, GraphqlIsIntegrationConnectionActiveQueryVariables } from "./graphql/__generated__/operationTypes";
2
+ import type { GraphqlCreateIntegrationConnectionMutation, GraphqlGetConnectionStatusQuery, GraphqlGetConnectionStatusQueryVariables, GraphqlGetIntegrationConnectionQuery, GraphqlGetIntegrationConnectionQueryVariables, GraphqlGetIntegrationConnectionsQuery, GraphqlIntegrationRequestInput, GraphqlIntegrationRequestQuery, GraphqlIsIntegrationConnectionActiveQuery, GraphqlIsIntegrationConnectionActiveQueryVariables } from "./graphql/__generated__/operationTypes";
3
3
  import QbdIntegration from "./integrations/qbd/QbdIntegration";
4
4
  export interface ClientOptions {
5
5
  /** Log each request and response. */
@@ -25,11 +25,15 @@ export default class Client {
25
25
  * @param input.endUserEmail Your end-user's email address for identification
26
26
  * only. No emails will be sent. Must be distinct from your other connections
27
27
  * for the same integration.
28
- * @param input.endUserName Your end-user's name that will be shown elsewhere
28
+ * @param input.endUserCompanyName Your end-user's name that will be shown elsewhere
29
29
  * in Conductor.
30
30
  * @returns The newly created integration connection.
31
31
  */
32
- createIntegrationConnection(input: GraphqlCreateIntegrationConnectionInput & {
32
+ createIntegrationConnection(input: {
33
+ endUserEmail: string;
34
+ /** @deprecated Use endUserCompanyName instead */
35
+ endUserName?: string;
36
+ endUserCompanyName?: string;
33
37
  integrationKey: "quickbooks-desktop";
34
38
  }): Promise<GraphqlCreateIntegrationConnectionMutation["createIntegrationConnection"]>;
35
39
  isIntegrationConnectionActive(integrationConnectionId: GraphqlIsIntegrationConnectionActiveQueryVariables["integrationConnectionId"], secondsSinceLastActive?: GraphqlIsIntegrationConnectionActiveQueryVariables["secondsSinceLastActive"]): Promise<GraphqlIsIntegrationConnectionActiveQuery["integrationConnection"]["isActive"]>;
@@ -44,12 +48,12 @@ export default class Client {
44
48
  * @param integrationConnectionId The ID of the integration connection.
45
49
  * @returns result Object with the following properties:
46
50
  * @returns result.isConnected Whether we can connect to QBD.
47
- * @returns result.devErrorMessage If `isConnected` is `false`, a
48
- * developer-friendly error message; e.g., "The end-user's computer is likely
49
- * off". Else, `null`.
50
- * @returns result.endUserErrorMessage If `isConnected` is `false`, a
51
- * user-friendly error message; e.g., "Please ensure your computer is on and
52
- * QuickBooks Desktop is open". Else, `null`.
51
+ * @returns result.devErrorMessage If `isConnected=false`, this will be the
52
+ * corresponding error message for the developer; e.g., "The end-user's
53
+ * computer is likely off".
54
+ * @returns result.endUserErrorMessage If `isConnected=false`, this will be
55
+ * the corresponding error message for the end-user; e.g., "Please ensure your
56
+ * computer is on and QuickBooks Desktop is open".
53
57
  */
54
58
  getConnectionStatus(integrationConnectionId: GraphqlGetConnectionStatusQueryVariables["integrationConnectionId"]): Promise<GraphqlGetConnectionStatusQuery["integrationConnection"]["connectionStatus"]>;
55
59
  integrationRequest(input: GraphqlIntegrationRequestInput): Promise<GraphqlIntegrationRequestQuery["integrationRequest"]>;
@@ -56,13 +56,29 @@ class Client {
56
56
  * @param input.endUserEmail Your end-user's email address for identification
57
57
  * only. No emails will be sent. Must be distinct from your other connections
58
58
  * for the same integration.
59
- * @param input.endUserName Your end-user's name that will be shown elsewhere
59
+ * @param input.endUserCompanyName Your end-user's name that will be shown elsewhere
60
60
  * in Conductor.
61
61
  * @returns The newly created integration connection.
62
62
  */
63
63
  async createIntegrationConnection(input) {
64
+ // TODO: Remove block below after removing the deprecated field `endUserName`.
65
+ if (input.endUserName !== undefined) {
66
+ console.warn(chalk_1.default.yellow(`⚠️ The field "endUserName" for "conductor.createIntegrationConnection()" is deprecated. Please use "endUserCompanyName" instead.`));
67
+ }
68
+ const endUserCompanyNameShimmed = input.endUserCompanyName ?? input.endUserName;
69
+ if (endUserCompanyNameShimmed === undefined) {
70
+ throw new Error("End-user company name is required when creating an integration-connection.");
71
+ }
64
72
  return this.graphqlOperations
65
- .createIntegrationConnection({ input })
73
+ .createIntegrationConnection({
74
+ input: {
75
+ endUserEmail: input.endUserEmail,
76
+ // eslint-disable-next-line unicorn/no-null -- GraphQL does not support undefined.
77
+ endUserName: null,
78
+ endUserCompanyName: endUserCompanyNameShimmed,
79
+ integrationKey: input.integrationKey,
80
+ },
81
+ })
66
82
  .then((result) => result.createIntegrationConnection);
67
83
  }
68
84
  async isIntegrationConnectionActive(integrationConnectionId, secondsSinceLastActive = 60) {
@@ -84,12 +100,12 @@ class Client {
84
100
  * @param integrationConnectionId The ID of the integration connection.
85
101
  * @returns result Object with the following properties:
86
102
  * @returns result.isConnected Whether we can connect to QBD.
87
- * @returns result.devErrorMessage If `isConnected` is `false`, a
88
- * developer-friendly error message; e.g., "The end-user's computer is likely
89
- * off". Else, `null`.
90
- * @returns result.endUserErrorMessage If `isConnected` is `false`, a
91
- * user-friendly error message; e.g., "Please ensure your computer is on and
92
- * QuickBooks Desktop is open". Else, `null`.
103
+ * @returns result.devErrorMessage If `isConnected=false`, this will be the
104
+ * corresponding error message for the developer; e.g., "The end-user's
105
+ * computer is likely off".
106
+ * @returns result.endUserErrorMessage If `isConnected=false`, this will be
107
+ * the corresponding error message for the end-user; e.g., "Please ensure your
108
+ * computer is on and QuickBooks Desktop is open".
93
109
  */
94
110
  async getConnectionStatus(integrationConnectionId) {
95
111
  return this.graphqlOperations
@@ -29,8 +29,10 @@ export type GraphqlConnectionStatusResult = {
29
29
  isConnected: Scalars["Boolean"];
30
30
  };
31
31
  export type GraphqlCreateIntegrationConnectionInput = {
32
+ endUserCompanyName: InputMaybe<Scalars["String"]>;
32
33
  endUserEmail: Scalars["String"];
33
- endUserName: Scalars["String"];
34
+ /** @deprecated Use endUserCompanyName instead */
35
+ endUserName: InputMaybe<Scalars["String"]>;
34
36
  integrationKey: Scalars["String"];
35
37
  };
36
38
  export type GraphqlCreateIntegrationConnectionResult = {
@@ -46,7 +48,9 @@ export type GraphqlIntegration = {
46
48
  export type GraphqlIntegrationConnection = {
47
49
  connectionStatus: GraphqlConnectionStatusResult;
48
50
  devUserId: Scalars["ID"];
51
+ endUserCompanyName: Scalars["String"];
49
52
  endUserEmail: Scalars["String"];
53
+ /** @deprecated Use endUserCompanyName instead */
50
54
  endUserName: Scalars["String"];
51
55
  id: Scalars["ID"];
52
56
  integration: GraphqlIntegration;
@@ -781,6 +781,8 @@ export interface BillRet {
781
781
 
782
782
  Note (especially relevant to `CheckAdd` requests): When `RefNumber` is left blank in an SDK transaction add request (that is, or ), the `RefNumber` will be left blank in QuickBooks. This behavior is new as of QBFC3. It used to select the next sequential reference number since the last one used by QuickBooks, as though no `RefNumber` had been provided. This is especially relevant to `CheckAdd` requests because with the current behavior, you will not know the number until the check is printed. */
783
783
  RefNumber?: string;
784
+ /** If `IsPending` is set to true, the bill has not been completed or in draft version. */
785
+ IsPending?: boolean;
784
786
  /** Refers to the payment terms associated with this entity. (This will be an item on the `DateDrivenTerms` or `StandardTerms` list.) If a `TermsRef` aggregate includes both `FullName` and `ListID`, `FullName` will be ignored. */
785
787
  TermsRef?: TermsRef;
786
788
  /** Appears in the A/P register and in reports that include this bill. */
@@ -995,6 +997,8 @@ export interface CheckRet {
995
997
  Address?: Address;
996
998
  /** The address expressed as an address block of `Addr1` through `Addr5`, depending on the number of lines in the original request that created the address. */
997
999
  AddressBlock?: AddressBlock;
1000
+ /** If `IsPending` is set to true, the check has not been completed or in draft version. */
1001
+ IsPending?: boolean;
998
1002
  /** If `IsToBePrinted` is set to true, this transaction is on a list of forms to be printed later. The user can then choose to print all these forms at once. Notice that setting this field to true does not actually perform the printing. Only the QuickBooks user can do that from within QuickBooks. This cannot be done from the SDK. Setting this field to false does not prevent the QuickBooks user from printing the transaction later. It simply results in the transaction NOT being placed in the list of transactions to be printed. */
999
1003
  IsToBePrinted?: boolean;
1000
1004
  /** For future use with international versions of QuickBooks. */
@@ -2588,6 +2592,8 @@ export interface ItemLineAdd {
2588
2592
  SerialNumber?: string;
2589
2593
  /** The lot number of the asset. */
2590
2594
  LotNumber?: string;
2595
+ /** The expiration date of the inventory serial/lot number. Expiration `Date` is supported from QB Desktop 2023 (USA & Canada) and SDK 16.0. */
2596
+ ExpirationDateForSerialLotNumber: string;
2591
2597
  /** A descriptive text field. */
2592
2598
  Desc?: string;
2593
2599
  /** `QuantityFor` transactions: If an item line add on a transaction request specifies `Quantity` and `Amount` but not `Rate`, QuickBooks will use `Quantity` and `Amount` to calculate `Rate`. Likewise, if a request specifies `Quantity` and `Rate` but not `Amount`, QuickBooks will calculate the `Amount`. If a transaction add request includes a reference to an `ItemDiscount` item, do not include a `Quantity` element as well, or you will get an error. For Item requests: `Quantity` indicates how many of this item there are. */
@@ -2642,6 +2648,8 @@ export interface ItemLineMod {
2642
2648
  SerialNumber?: string;
2643
2649
  /** The lot number of the asset. */
2644
2650
  LotNumber?: string;
2651
+ /** The expiration date of the inventory serial/lot number. Expiration `Date` is supported from QB Desktop 2023 (USA & Canada) and SDK 16.0. */
2652
+ ExpirationDateForSerialLotNumber?: string;
2645
2653
  /** A descriptive text field. */
2646
2654
  Desc?: string;
2647
2655
  /** `QuantityFor` transactions: If an item line add on a transaction request specifies `Quantity` and `Amount` but not `Rate`, QuickBooks will use `Quantity` and `Amount` to calculate `Rate`. Likewise, if a request specifies `Quantity` and `Rate` but not `Amount`, QuickBooks will calculate the `Amount`. If a transaction add request includes a reference to an `ItemDiscount` item, do not include a `Quantity` element as well, or you will get an error. For Item requests: `Quantity` indicates how many of this item there are. */
@@ -2696,6 +2704,8 @@ export interface ItemLineRet {
2696
2704
  SerialNumber?: string;
2697
2705
  /** The lot number of the asset. */
2698
2706
  LotNumber?: string;
2707
+ /** The expiration date of the inventory serial/lot number. Expiration `Date` is supported from QB Desktop 2023 (USA & Canada) and SDK 16.0. */
2708
+ ExpirationDateForSerialLotNumber: string;
2699
2709
  /** A descriptive text field. */
2700
2710
  Desc?: string;
2701
2711
  /** `QuantityFor` transactions: If an item line add on a transaction request specifies `Quantity` and `Amount` but not `Rate`, QuickBooks will use `Quantity` and `Amount` to calculate `Rate`. Likewise, if a request specifies `Quantity` and `Rate` but not `Amount`, QuickBooks will calculate the `Amount`. If a transaction add request includes a reference to an `ItemDiscount` item, do not include a `Quantity` element as well, or you will get an error. For Item requests: `Quantity` indicates how many of this item there are. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "7.2.0",
3
+ "version": "7.3.1",
4
4
  "description": "Easily integrate with the entire QuickBooks Desktop API with fully-typed async TypeScript",
5
5
  "author": "Danny Nemer <hi@DannyNemer.com>",
6
6
  "license": "MIT",