conductor-node 7.4.0 → 7.4.3

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.4.0",
3
+ "version": "7.4.3",
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",
@@ -13,7 +13,7 @@
13
13
  ],
14
14
  "scripts": {
15
15
  "prepack": "yarn tsc && yarn delete-compiled-tests && yarn tsc-alias --verbose",
16
- "delete-compiled-tests": "rm -rf `find ./dist -type d -name __tests__`",
16
+ "delete-compiled-tests": "rm -rf `find ./dist -type d -name __tests__` ./dist/src/utils/testing.*",
17
17
  "postpack": "rm -rf dist",
18
18
  "clean": "rm -rf dist package conductor-node-*.tgz tsconfig.tsbuildinfo",
19
19
  "gen:graphql-types": "yarn graphql-codegen --config ./src/graphql/codegenConfig.ts",
@@ -1,5 +1,5 @@
1
1
  import type { Environment } from "./environment";
2
- import type { GraphqlCreateIntegrationConnectionMutation, GraphqlGetConnectionStatusQuery, GraphqlGetConnectionStatusQueryVariables, GraphqlGetIntegrationConnectionQuery, GraphqlGetIntegrationConnectionQueryVariables, GraphqlGetIntegrationConnectionsQuery, GraphqlSendIntegrationRequestInput, GraphqlSendIntegrationRequestMutation } from "./graphql/__generated__/operationTypes";
2
+ import type { GraphqlCreateIntegrationConnectionInput, GraphqlCreateIntegrationConnectionMutation, GraphqlGetConnectionStatusQuery, GraphqlGetConnectionStatusQueryVariables, GraphqlGetIntegrationConnectionQuery, GraphqlGetIntegrationConnectionQueryVariables, GraphqlGetIntegrationConnectionsQuery, GraphqlSendIntegrationRequestInput, GraphqlSendIntegrationRequestMutation } from "./graphql/__generated__/operationTypes";
3
3
  import QbdIntegration from "./integrations/qbd/QbdIntegration";
4
4
  export interface ClientOptions {
5
5
  /** Log each request and response. */
@@ -48,11 +48,7 @@ export default class Client {
48
48
  * shown elsewhere in Conductor.
49
49
  * @returns The newly created integration connection.
50
50
  */
51
- createIntegrationConnection(input: {
52
- endUserEmail: string;
53
- /** @deprecated Use endUserCompanyName instead */
54
- endUserName?: string;
55
- endUserCompanyName?: string;
51
+ createIntegrationConnection(input: GraphqlCreateIntegrationConnectionInput & {
56
52
  integrationKey: "quickbooks-desktop";
57
53
  }): Promise<GraphqlCreateIntegrationConnectionMutation["createIntegrationConnection"]>;
58
54
  sendIntegrationRequest(input: GraphqlSendIntegrationRequestInput): Promise<GraphqlSendIntegrationRequestMutation["sendIntegrationRequest"]["response"]>;
@@ -84,24 +84,8 @@ class Client {
84
84
  * @returns The newly created integration connection.
85
85
  */
86
86
  async createIntegrationConnection(input) {
87
- // TODO: Remove block below after removing the deprecated field `endUserName`.
88
- if (input.endUserName !== undefined) {
89
- console.warn(chalk_1.default.yellow(`⚠️ The field "endUserName" for "conductor.createIntegrationConnection()" is deprecated. Please use "endUserCompanyName" instead.`));
90
- }
91
- const endUserCompanyNameShimmed = input.endUserCompanyName ?? input.endUserName;
92
- if (endUserCompanyNameShimmed === undefined) {
93
- throw new Error("End-user company name is required when creating an integration-connection.");
94
- }
95
87
  return this.graphqlOperations
96
- .createIntegrationConnection({
97
- input: {
98
- endUserEmail: input.endUserEmail,
99
- // eslint-disable-next-line unicorn/no-null -- GraphQL does not support undefined.
100
- endUserName: null,
101
- endUserCompanyName: endUserCompanyNameShimmed,
102
- integrationKey: input.integrationKey,
103
- },
104
- })
88
+ .createIntegrationConnection({ input })
105
89
  .then((result) => result.createIntegrationConnection);
106
90
  }
107
91
  // TODO: Hide this method from the dev-user while still allowing the
@@ -25,7 +25,7 @@ function getServerUrlForEnvironment(environment) {
25
25
  return "https://production.api.conductor.is";
26
26
  }
27
27
  default: {
28
- throw new Error(`Invalid environment`);
28
+ throw new Error("Invalid environment");
29
29
  }
30
30
  }
31
31
  }
@@ -24,15 +24,12 @@ export type Scalars = {
24
24
  JSONObject: object;
25
25
  };
26
26
  export type GraphqlConnectionStatusResult = {
27
- devErrorMessage: Maybe<Scalars["String"]>;
28
- endUserErrorMessage: Maybe<Scalars["String"]>;
27
+ error: Maybe<GraphqlUserError>;
29
28
  isConnected: Scalars["Boolean"];
30
29
  };
31
30
  export type GraphqlCreateIntegrationConnectionInput = {
32
- endUserCompanyName: InputMaybe<Scalars["String"]>;
31
+ endUserCompanyName: Scalars["String"];
33
32
  endUserEmail: Scalars["String"];
34
- /** @deprecated Use endUserCompanyName instead */
35
- endUserName: InputMaybe<Scalars["String"]>;
36
33
  integrationKey: Scalars["String"];
37
34
  };
38
35
  export type GraphqlCreateIntegrationConnectionResult = {
@@ -50,8 +47,6 @@ export type GraphqlIntegrationConnection = {
50
47
  devUserId: Scalars["ID"];
51
48
  endUserCompanyName: Scalars["String"];
52
49
  endUserEmail: Scalars["String"];
53
- /** @deprecated Use endUserCompanyName instead */
54
- endUserName: Scalars["String"];
55
50
  id: Scalars["ID"];
56
51
  integration: GraphqlIntegration;
57
52
  integrationKey: Scalars["String"];
@@ -82,6 +77,10 @@ export type GraphqlSendIntegrationRequestInput = {
82
77
  export type GraphqlSendIntegrationRequestResult = {
83
78
  response: Scalars["JSONObject"];
84
79
  };
80
+ export type GraphqlUserError = {
81
+ devMessage: Scalars["String"];
82
+ endUserMessage: Scalars["String"];
83
+ };
85
84
  export type GraphqlIntegrationConnectionFragment = {
86
85
  id: string;
87
86
  integrationKey: string;
@@ -120,8 +119,10 @@ export type GraphqlGetConnectionStatusQuery = {
120
119
  integrationConnection: {
121
120
  connectionStatus: {
122
121
  isConnected: boolean;
123
- devErrorMessage: string | null;
124
- endUserErrorMessage: string | null;
122
+ error: {
123
+ devMessage: string;
124
+ endUserMessage: string;
125
+ } | null;
125
126
  };
126
127
  };
127
128
  };
@@ -152,7 +153,7 @@ export type GraphqlSendIntegrationRequestMutation = {
152
153
  export declare const IntegrationConnectionFragmentDoc = "\n fragment IntegrationConnection on IntegrationConnection {\n id\n integrationKey\n endUserEmail\n endUserCompanyName\n lastHeartbeatAt\n}\n ";
153
154
  export declare const GetIntegrationConnectionDocument: string;
154
155
  export declare const GetIntegrationConnectionsDocument: string;
155
- export declare const GetConnectionStatusDocument = "\n query getConnectionStatus($integrationConnectionId: ID!) {\n integrationConnection(id: $integrationConnectionId) {\n connectionStatus {\n isConnected\n devErrorMessage\n endUserErrorMessage\n }\n }\n}\n ";
156
+ export declare const GetConnectionStatusDocument = "\n query getConnectionStatus($integrationConnectionId: ID!) {\n integrationConnection(id: $integrationConnectionId) {\n connectionStatus {\n isConnected\n error {\n devMessage\n endUserMessage\n }\n }\n }\n}\n ";
156
157
  export declare const CreateIntegrationConnectionDocument: string;
157
158
  export declare const SendIntegrationRequestDocument = "\n mutation sendIntegrationRequest($input: SendIntegrationRequestInput!) {\n sendIntegrationRequest(input: $input) {\n response\n }\n}\n ";
158
159
  export type SdkFunctionWrapper = <T>(action: (requestHeaders?: Record<string, string>) => Promise<T>, operationName: string, operationType?: string) => Promise<T>;
@@ -29,8 +29,10 @@ exports.GetConnectionStatusDocument = `
29
29
  integrationConnection(id: $integrationConnectionId) {
30
30
  connectionStatus {
31
31
  isConnected
32
- devErrorMessage
33
- endUserErrorMessage
32
+ error {
33
+ devMessage
34
+ endUserMessage
35
+ }
34
36
  }
35
37
  }
36
38
  }
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "7.4.0",
3
+ "version": "7.4.3",
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",
@@ -13,7 +13,7 @@
13
13
  ],
14
14
  "scripts": {
15
15
  "prepack": "yarn tsc && yarn delete-compiled-tests && yarn tsc-alias --verbose",
16
- "delete-compiled-tests": "rm -rf `find ./dist -type d -name __tests__`",
16
+ "delete-compiled-tests": "rm -rf `find ./dist -type d -name __tests__` ./dist/src/utils/testing.*",
17
17
  "postpack": "rm -rf dist",
18
18
  "clean": "rm -rf dist package conductor-node-*.tgz tsconfig.tsbuildinfo",
19
19
  "gen:graphql-types": "yarn graphql-codegen --config ./src/graphql/codegenConfig.ts",