conductor-node 7.5.1 → 8.0.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/README.md CHANGED
@@ -42,9 +42,11 @@ Create a new integration-connection.
42
42
  const newQbdConnection = await conductor.createIntegrationConnection({
43
43
  // The identifier of the third-party platform to integrate.
44
44
  integrationKey: "quickbooks-desktop",
45
+ // Your end-user's unique ID in your product's database. Must be distinct
46
+ // from your other connections for the same integration.
47
+ endUserSourceId: "1234-abcd",
45
48
  // Your end-user's email address for identification only. No emails
46
- // will be sent. Must be distinct from your other connections for the
47
- // same `integrationKey`.
49
+ // will be sent.
48
50
  endUserEmail: "danny@constructionco.com",
49
51
  // Your end-user's company name that will be shown elsewhere in Conductor.
50
52
  endUserCompanyName: "Construction Corp",
@@ -58,7 +60,7 @@ The response includes the following:
58
60
  // ❗ Display this URL to your end-user: The URL for the QWC config file
59
61
  // that your end-user must download and open on their computer to
60
62
  // connect their QBD instance to Conductor.
61
- qwcFileDownloadUrl: 'https://production.api.conductor.is/qwc/{UUID}'
63
+ qwcFileDownloadUrl: 'https://api.conductor.is/qwc/{UUID}'
62
64
  // ❗ Display this password/access-code to your end-user: The unique
63
65
  // password that your end-user must enter into QuickBooks Web
64
66
  // Connector after loading the config file. This value will never be
@@ -69,6 +71,7 @@ The response includes the following:
69
71
  // this end-user's integration in the future.
70
72
  id: '{UUID}',
71
73
  integrationKey: 'quickbooks-desktop',
74
+ endUserSourceId: "1234-abcd",
72
75
  endUserEmail: 'danny@constructionco.com',
73
76
  endUserCompanyName: 'Construction Corp',
74
77
  lastHeartbeatAt: null
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "7.5.1",
3
+ "version": "8.0.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",
@@ -25,12 +25,13 @@ export default class Client {
25
25
  * @param integrationConnectionId The ID of the integration connection.
26
26
  * @returns result Object with the following properties:
27
27
  * @returns result.isConnected Whether we can connect to the end-user's QBD.
28
- * @returns result.devErrorMessage If `isConnected=false`, this will be the
29
- * corresponding error message for the developer; e.g., "The end-user's
30
- * computer is likely off".
31
- * @returns result.endUserErrorMessage If `isConnected=false`, this will be
32
- * the corresponding error message for the end-user; e.g., "Please ensure your
33
- * computer is on and QuickBooks Desktop is open".
28
+ * @returns result.error If `isConnected=false`, this will be an object with
29
+ * the following properties:
30
+ * @returns result.error.code The unique error code.
31
+ * @returns result.error.developerMessage The technical error message for the
32
+ * developer.
33
+ * @returns result.error.endUserMessage The user-friendly error message to
34
+ * display to the the end-user.
34
35
  */
35
36
  getConnectionStatus(integrationConnectionId: GraphqlGetConnectionStatusQueryVariables["integrationConnectionId"]): Promise<GraphqlGetConnectionStatusQuery["integrationConnection"]["connectionStatus"]>;
36
37
  /**
@@ -39,9 +40,11 @@ export default class Client {
39
40
  * @param input - The input object to create the integration connection.
40
41
  * @param input.integrationKey The identifier of the third-party platform to
41
42
  * integrate.
43
+ * @param input.endUserSourceId Your end-user's unique ID in your product's
44
+ * database. Must be distinct from your other connections for the same
45
+ * integration.
42
46
  * @param input.endUserEmail Your end-user's email address for identification
43
- * only. No emails will be sent. Must be distinct from your other connections
44
- * for the same integration.
47
+ * only. No emails will be sent.
45
48
  * @param input.endUserCompanyName Your end-user's company name that will be
46
49
  * shown elsewhere in Conductor.
47
50
  * @returns The newly created integration connection.
@@ -47,12 +47,13 @@ class Client {
47
47
  * @param integrationConnectionId The ID of the integration connection.
48
48
  * @returns result Object with the following properties:
49
49
  * @returns result.isConnected Whether we can connect to the end-user's QBD.
50
- * @returns result.devErrorMessage If `isConnected=false`, this will be the
51
- * corresponding error message for the developer; e.g., "The end-user's
52
- * computer is likely off".
53
- * @returns result.endUserErrorMessage If `isConnected=false`, this will be
54
- * the corresponding error message for the end-user; e.g., "Please ensure your
55
- * computer is on and QuickBooks Desktop is open".
50
+ * @returns result.error If `isConnected=false`, this will be an object with
51
+ * the following properties:
52
+ * @returns result.error.code The unique error code.
53
+ * @returns result.error.developerMessage The technical error message for the
54
+ * developer.
55
+ * @returns result.error.endUserMessage The user-friendly error message to
56
+ * display to the the end-user.
56
57
  */
57
58
  async getConnectionStatus(integrationConnectionId) {
58
59
  return this.graphqlOperations
@@ -65,9 +66,11 @@ class Client {
65
66
  * @param input - The input object to create the integration connection.
66
67
  * @param input.integrationKey The identifier of the third-party platform to
67
68
  * integrate.
69
+ * @param input.endUserSourceId Your end-user's unique ID in your product's
70
+ * database. Must be distinct from your other connections for the same
71
+ * integration.
68
72
  * @param input.endUserEmail Your end-user's email address for identification
69
- * only. No emails will be sent. Must be distinct from your other connections
70
- * for the same integration.
73
+ * only. No emails will be sent.
71
74
  * @param input.endUserCompanyName Your end-user's company name that will be
72
75
  * shown elsewhere in Conductor.
73
76
  * @returns The newly created integration connection.
@@ -26,6 +26,7 @@ export type Scalars = {
26
26
  export type GraphqlCreateIntegrationConnectionInput = {
27
27
  endUserCompanyName: Scalars["String"];
28
28
  endUserEmail: Scalars["String"];
29
+ endUserSourceId: Scalars["String"];
29
30
  integrationKey: Scalars["String"];
30
31
  };
31
32
  export type GraphqlSendIntegrationRequestInput = {
@@ -35,6 +36,7 @@ export type GraphqlSendIntegrationRequestInput = {
35
36
  export type GraphqlIntegrationConnectionFragment = {
36
37
  id: string;
37
38
  integrationKey: string;
39
+ endUserSourceId: string;
38
40
  endUserEmail: string;
39
41
  endUserCompanyName: string;
40
42
  lastHeartbeatAt: Date | null;
@@ -51,6 +53,7 @@ export type GraphqlGetIntegrationConnectionQuery = {
51
53
  integrationConnection: {
52
54
  id: string;
53
55
  integrationKey: string;
56
+ endUserSourceId: string;
54
57
  endUserEmail: string;
55
58
  endUserCompanyName: string;
56
59
  lastHeartbeatAt: Date | null;
@@ -63,6 +66,7 @@ export type GraphqlGetIntegrationConnectionsQuery = {
63
66
  integrationConnections: Array<{
64
67
  id: string;
65
68
  integrationKey: string;
69
+ endUserSourceId: string;
66
70
  endUserEmail: string;
67
71
  endUserCompanyName: string;
68
72
  lastHeartbeatAt: Date | null;
@@ -93,6 +97,7 @@ export type GraphqlCreateIntegrationConnectionMutation = {
93
97
  integrationConnection: {
94
98
  id: string;
95
99
  integrationKey: string;
100
+ endUserSourceId: string;
96
101
  endUserEmail: string;
97
102
  endUserCompanyName: string;
98
103
  lastHeartbeatAt: Date | null;
@@ -107,7 +112,7 @@ export type GraphqlSendIntegrationRequestMutation = {
107
112
  response: object;
108
113
  };
109
114
  };
110
- export declare const IntegrationConnectionFragmentDoc = "\n fragment IntegrationConnection on IntegrationConnection {\n id\n integrationKey\n endUserEmail\n endUserCompanyName\n lastHeartbeatAt\n}\n ";
115
+ export declare const IntegrationConnectionFragmentDoc = "\n fragment IntegrationConnection on IntegrationConnection {\n id\n integrationKey\n endUserSourceId\n endUserEmail\n endUserCompanyName\n lastHeartbeatAt\n}\n ";
111
116
  export declare const UserErrorFragmentDoc = "\n fragment UserError on UserError {\n code\n developerMessage\n endUserMessage\n}\n ";
112
117
  export declare const GetIntegrationConnectionDocument: string;
113
118
  export declare const GetIntegrationConnectionsDocument: string;
@@ -5,6 +5,7 @@ exports.IntegrationConnectionFragmentDoc = `
5
5
  fragment IntegrationConnection on IntegrationConnection {
6
6
  id
7
7
  integrationKey
8
+ endUserSourceId
8
9
  endUserEmail
9
10
  endUserCompanyName
10
11
  lastHeartbeatAt
@@ -4,5 +4,6 @@ export declare const currentEnvironment: {
4
4
  isTest: boolean;
5
5
  isDevelopment: boolean;
6
6
  isProduction: boolean;
7
+ isLocal: boolean;
7
8
  };
8
9
  export declare function getServerUrlForEnvironment(environment: Environment): string;
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getServerUrlForEnvironment = exports.currentEnvironment = void 0;
4
- const currentEnvironmentName = process.env["NODE_ENV"] ?? "development";
4
+ const currentEnvironmentName = (process.env["NODE_ENV"] ??
5
+ "development");
5
6
  exports.currentEnvironment = {
6
7
  name: currentEnvironmentName,
7
8
  isTest: currentEnvironmentName === "test",
8
9
  isDevelopment: currentEnvironmentName === "development",
9
10
  isProduction: currentEnvironmentName === "production",
11
+ isLocal: ["test", "development"].includes(currentEnvironmentName),
10
12
  };
11
13
  function getServerUrlForEnvironment(environment) {
12
14
  switch (environment) {
@@ -18,7 +20,7 @@ function getServerUrlForEnvironment(environment) {
18
20
  return "https://conductor.ngrok.io";
19
21
  }
20
22
  case "production": {
21
- return "https://production.api.conductor.is";
23
+ return "https://api.conductor.is";
22
24
  }
23
25
  default: {
24
26
  throw new Error("Invalid environment");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "7.5.1",
3
+ "version": "8.0.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",