conductor-node 10.0.2 → 10.2.0

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
@@ -92,9 +92,8 @@ The response looks like the following:
92
92
  Retrieves the specified integration-connection.
93
93
 
94
94
  ```ts
95
- const qbdConnection = await conductor.integrationConnections.retrieve(
96
- qbdConnectionId
97
- );
95
+ const qbdConnection =
96
+ await conductor.integrationConnections.retrieve(qbdConnectionId);
98
97
  ```
99
98
 
100
99
  ### `integrationConnections.ping(id: string)`
@@ -163,25 +162,28 @@ All errors thrown by the Conductor API are instances of `ConductorError` or its
163
162
 
164
163
  | Property | Type | Description |
165
164
  | ----------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
166
- | `type` | `string` | Categorizes the error. See [Error Types](#error-types) below.<br><br>This value is the same as the subclass name. E.g., `"ConductorIntegrationError"` or `"ConductorInvalidRequestError"`. |
167
- | `code` | `string` | The unique error code from Conductor, which is useful for adding special handling for specific errors. E.g., `"RESOURCE_MISSING"`, `"API_KEY_INVALID"`, or `"QBD_REQUEST_ERROR"`.<br><br>In contrast, `type` is more general and categorizes the error. |
168
- | `httpStatusCode` | `number` or `undefined` | The HTTP status code of the response that included the error. You probably won't need this. |
169
165
  | `message` | `string` | The developer-friendly error message for your logs. |
170
166
  | `endUserMessage` | `string` | The end-user-friendly error message to display in your app's UI to your end-users.<br><br>This value exists for _every_ error. E.g., for a QBD connection error, it might recommend the end-user to check that their QuickBooks Desktop is open and that they're logged in. But if a Conductor API key is expired, e.g., this message will just say "An internal server error occurred. Please try again later.". |
167
+ | `type` | `string` | Categorizes the error. See [Error Types](#error-types) below.<br><br>This value is the same as the subclass name. E.g., `"ConductorIntegrationError"` or `"ConductorInvalidRequestError"`. |
168
+ | `code` | `string` | The unique error code from Conductor, which is useful for adding special handling for specific errors. E.g., `"RESOURCE_MISSING"`, `"API_KEY_INVALID"`, or `"QBD_REQUEST_ERROR"`.<br><br>In contrast, `type` is more general and categorizes the error. |
169
+ | `httpStatusCode` | `number` or `undefined` | The HTTP status code of the response that included the error. |
171
170
  | `integrationCode` | `string` or `undefined` | The unique error code supplied by the third-party integration for errors returned by the integration (i.e., `ConductorIntegrationError`) or integration connector (i.e., `ConductorIntegrationConnectorError`). This is useful for adding special handling for specific errors from the third-party integration or connector.<br><br>The integration's corresponding error message for this code is in `error.message`.<br><br>The third-party integrations' error codes are not standardized, so you should not rely on this code to be the same across integrations. |
171
+ | `requestId` | `string` or `undefined` | The unique identifier for the request that caused the error.<br><br>If you need to contact us about a specific request, providing the request identifier will ensure the fastest possible resolution. |
172
+ | `headers` | `object` or `undefined` | The headers of the response that included the error. |
172
173
 
173
174
  ### Error Types
174
175
 
175
176
  The error object you receive will have one of the following error types:
176
177
 
177
- | Name | Description |
178
- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
179
- | `ConductorIntegrationError` | Raised when the third-party integration encounters an error while processing the end-user's request. This often results from an issue with the request or data handling that requires your attention to resolve.<br><br>E.g., a `ListID` you provided was not found in QuickBooks Desktop, or an accounting value you supplied did not adhere to the integration's accounting rules.<br><br>Refer to `error.integrationCode` for the error code returned by the integration, if available. |
180
- | `ConductorIntegrationConnectionError` | Raised when a connection error occurs with the third-party integration on the end-user's side. This typically indicates an issue with the end-user's integration connection or configuration, which they must resolve. In other words, you cannot take action to fix these errors.<br><br>E.g., QuickBooks Web Connector (QBWC) failed to connect to QuickBooks Desktop on the end-user's computer.<br><br>Refer to `error.integrationCode` for the error code returned by the integration connector, if available.<br><br>❗ We recommend _not_ alerting your team for these errors because only the end-user can fix them. See [Centralized Error Handling](#centralized-error-handling) for an example of this. |
181
- | `ConductorInvalidRequestError` | Raised when you make an API call with the wrong parameters, in the wrong state, or in an invalid way. |
182
- | `ConductorAuthenticationError` | Raised when Conductor cannot authenticate you with the credentials you provided. E.g., an incorrect API key. |
183
- | `ConductorConnectionError` | Raised when there was a network problem between the client (on your server) and Conductor's servers. E.g., a downed network or a bad TLS certificate. |
184
- | `ConductorInternalError` | Raised when something went wrong on Conductor's end. (These are rare.) |
178
+ | Name | Description |
179
+ | ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
180
+ | `ConductorIntegrationError` | Raised when the third-party integration encounters an error while processing the end-user's request. This often results from an issue with the request or data handling that requires your attention to resolve.<br><br>E.g., a `ListID` you provided was not found in QuickBooks Desktop, or an accounting value you supplied did not adhere to the integration's accounting rules.<br><br>Refer to `error.integrationCode` for the error code returned by the integration, if available. |
181
+ | `ConductorIntegrationConnectionError` | Raised when a connection error occurs with the third-party integration on the end-user's side. This typically indicates an issue with the end-user's integration-connection or configuration, which they must resolve. In other words, you cannot take action to fix these errors.<br><br>E.g., QuickBooks Web Connector (QBWC) failed to connect to QuickBooks Desktop on the end-user's computer.<br><br>Refer to `error.integrationCode` for the error code returned by the integration connector, if available.<br><br>❗ We recommend _not_ alerting your team for these errors because only the end-user can fix them. See [Global Error Handling](#global-error-handling) for an example of this. |
182
+ | `ConductorInvalidRequestError` | Raised when you make an API call with the wrong parameters, in the wrong state, or in an invalid way. |
183
+ | `ConductorAuthenticationError` | Raised when Conductor cannot authenticate you with the credentials you provided. E.g., an incorrect API key. |
184
+ | `ConductorPermissionError` | Raised when you attempt to access a resource that is not allowed. |
185
+ | `ConductorConnectionError` | Raised when there was a network problem between the client (on your server) and Conductor's servers. E.g., a downed network or a bad TLS certificate. |
186
+ | `ConductorInternalError` | Raised when something went wrong on Conductor's end. (These are rare.) |
185
187
 
186
188
  ### Specific Error Handling
187
189
 
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "10.0.2",
3
+ "version": "10.2.0",
4
4
  "description": "Easily integrate the entire QuickBooks Desktop API using fully-typed async TypeScript",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -1,12 +1,16 @@
1
1
  import QbdIntegration from "./integrations/qbd/QbdIntegration";
2
+ import EndUsersResource from "./resources/EndUsersResource";
2
3
  import IntegrationConnectionsResource from "./resources/IntegrationConnectionsResource";
3
4
  import { getServerUrlForEnvironment } from "./utils/http";
4
5
  export interface ClientOptions {
5
- /** Logs each request, response, and error. */
6
+ /**
7
+ * Enables logging each request, response, and error.
8
+ */
6
9
  readonly verbose?: boolean;
7
10
  readonly serverEnvironment?: Parameters<typeof getServerUrlForEnvironment>[0];
8
11
  }
9
12
  export default class Client {
13
+ readonly endUsers: EndUsersResource;
10
14
  readonly integrationConnections: IntegrationConnectionsResource;
11
15
  /** QuickBooks Desktop integration. */
12
16
  readonly qbd: QbdIntegration;
@@ -7,11 +7,13 @@ const package_json_1 = __importDefault(require("./../package.json"));
7
7
  const QbdIntegration_1 = __importDefault(require("./integrations/qbd/QbdIntegration"));
8
8
  const errorHandling_1 = require("./interceptors/errorHandling");
9
9
  const logging_1 = require("./interceptors/logging");
10
+ const EndUsersResource_1 = __importDefault(require("./resources/EndUsersResource"));
10
11
  const IntegrationConnectionsResource_1 = __importDefault(require("./resources/IntegrationConnectionsResource"));
11
12
  const checkForUpdates_1 = require("./utils/checkForUpdates");
12
13
  const http_1 = require("./utils/http");
13
14
  const axios_1 = __importDefault(require("axios"));
14
15
  class Client {
16
+ endUsers;
15
17
  integrationConnections;
16
18
  /** QuickBooks Desktop integration. */
17
19
  qbd;
@@ -19,6 +21,7 @@ class Client {
19
21
  constructor(apiKey, { verbose = false, serverEnvironment = "production" } = {}) {
20
22
  (0, checkForUpdates_1.checkForUpdates)();
21
23
  this.httpClient = this.createHttpClient(apiKey, verbose, serverEnvironment);
24
+ this.endUsers = new EndUsersResource_1.default(this.httpClient);
22
25
  this.integrationConnections = new IntegrationConnectionsResource_1.default(this.httpClient);
23
26
  this.qbd = new QbdIntegration_1.default(this.httpClient);
24
27
  }