conductor-node 7.3.0 → 7.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
@@ -46,8 +46,8 @@ const newQbdConnection = await conductor.createIntegrationConnection({
46
46
  // will be sent. Must be distinct from your other connections for the
47
47
  // same `integrationKey`.
48
48
  endUserEmail: "danny@constructionco.com",
49
- // Your end-user's name that will be shown elsewhere in Conductor.
50
- endUserName: "Construction Corp",
49
+ // Your end-user's company name that will be shown elsewhere in Conductor.
50
+ endUserCompanyName: "Construction Corp",
51
51
  });
52
52
  ```
53
53
 
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "7.3.0",
3
+ "version": "7.3.2",
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
29
- * in Conductor.
28
+ * @param input.endUserCompanyName Your end-user's company name that will be
29
+ * shown elsewhere 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"]>;
@@ -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
60
- * in Conductor.
59
+ * @param input.endUserCompanyName Your end-user's company name that will be
60
+ * shown elsewhere 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) {
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "7.3.0",
3
+ "version": "7.3.2",
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",