conductor-node 8.5.1 → 8.5.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/README.md +29 -29
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -54,13 +54,13 @@ Create a new integration-connection.
|
|
|
54
54
|
const newQbdConnection = await conductor.createIntegrationConnection({
|
|
55
55
|
// The identifier of the third-party platform to integrate.
|
|
56
56
|
integrationKey: "quickbooks-desktop",
|
|
57
|
-
// Your end-user's unique ID in your product's database. Must be
|
|
58
|
-
// from your other connections for the same integration.
|
|
57
|
+
// Your end-user's unique ID in your product's database. Must be
|
|
58
|
+
// distinct from your other connections for the same integration.
|
|
59
59
|
endUserSourceId: "1234-abcd",
|
|
60
60
|
// Your end-user's email address for identification only. No emails
|
|
61
61
|
// will be sent.
|
|
62
62
|
endUserEmail: "danny@constructionco.com",
|
|
63
|
-
// Your end-user's company name
|
|
63
|
+
// Your end-user's company name shown elsewhere in Conductor.
|
|
64
64
|
endUserCompanyName: "Construction Corp",
|
|
65
65
|
});
|
|
66
66
|
```
|
|
@@ -192,33 +192,15 @@ The error object you receive will have one of the following error types:
|
|
|
192
192
|
| `ConductorConnectionError` | There was a network problem between the client (on your server) and Conductor's servers. |
|
|
193
193
|
| `ConductorInternalError` | Something went wrong on Conductor's end. (These are rare.) |
|
|
194
194
|
|
|
195
|
-
###
|
|
195
|
+
### Alerting
|
|
196
196
|
|
|
197
|
-
|
|
197
|
+
We recommend sending a **warning** to your error-tracking service (e.g., Sentry) for instances of `ConductorIntegrationError`, which are your end-user's fault (e.g., cannot connect to QBD on your end-user's computer) and sending an **error** for all other errors (e.g., invalid API key).
|
|
198
198
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
Name: "Test Account",
|
|
203
|
-
AccountType: "Bank",
|
|
204
|
-
OpenBalance: "100",
|
|
205
|
-
});
|
|
206
|
-
} catch (error) {
|
|
207
|
-
if (error instanceof ConductorError) {
|
|
208
|
-
// TODO: Update your app's UI to display `error.endUserMessage`.
|
|
209
|
-
|
|
210
|
-
// RECOMMENDED: Send a *warning* to Sentry for integration-errors, which are
|
|
211
|
-
// your end-user's fault (e.g., cannot connect to QBD on your end-user's
|
|
212
|
-
// computer) or an *error* for other errors (e.g., invalid API key).
|
|
213
|
-
Sentry.captureException(error, {
|
|
214
|
-
level: error instanceof ConductorIntegrationError ? "warning" : "error",
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
// ...
|
|
218
|
-
}
|
|
219
|
-
```
|
|
199
|
+
### Example
|
|
200
|
+
|
|
201
|
+
**NOTE:** We do not expect you to individually implement error handling as shown below for every API call. Ideally, we recommend implementing error handling in a single place in your app, such as a global error handler.
|
|
220
202
|
|
|
221
|
-
|
|
203
|
+
In the form of a rejected promise:
|
|
222
204
|
|
|
223
205
|
```ts
|
|
224
206
|
conductor.qbd.account
|
|
@@ -232,9 +214,27 @@ conductor.qbd.account
|
|
|
232
214
|
})
|
|
233
215
|
.catch((error) => {
|
|
234
216
|
if (error instanceof ConductorError) {
|
|
235
|
-
//
|
|
217
|
+
// Update your app's UI to display `error.endUserMessage`.
|
|
218
|
+
} else {
|
|
236
219
|
// ...
|
|
237
220
|
}
|
|
238
|
-
// ...
|
|
239
221
|
});
|
|
240
222
|
```
|
|
223
|
+
|
|
224
|
+
Or using `async`/`await`:
|
|
225
|
+
|
|
226
|
+
```ts
|
|
227
|
+
try {
|
|
228
|
+
const newAccount = await conductor.qbd.account.add(qbdConnectionId, {
|
|
229
|
+
Name: "Test Account",
|
|
230
|
+
AccountType: "Bank",
|
|
231
|
+
OpenBalance: "100",
|
|
232
|
+
});
|
|
233
|
+
} catch (error) {
|
|
234
|
+
if (error instanceof ConductorError) {
|
|
235
|
+
// Update your app's UI to display `error.endUserMessage`.
|
|
236
|
+
} else {
|
|
237
|
+
// ...
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
```
|
package/dist/package.json
CHANGED
package/package.json
CHANGED