conductor-node 6.1.1 → 6.1.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 +3 -3
- package/dist/package.json +1 -1
- package/dist/src/Client.d.ts +1 -1
- package/dist/src/Client.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Conductor - QuickBooks Desktop
|
|
1
|
+
# Conductor - 10x better QuickBooks Desktop integration
|
|
2
2
|
|
|
3
3
|
Execute _any_ read or write [QuickBooks Desktop API](https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop) through async TypeScript and receive a fully-typed response.
|
|
4
4
|
|
|
@@ -64,9 +64,9 @@ const connection = await conductor.getIntegrationConnectionById(
|
|
|
64
64
|
);
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
### `isIntegrationConnectionActive(id: string,
|
|
67
|
+
### `isIntegrationConnectionActive(id: string, secondsSinceLastActive: number = 10)`
|
|
68
68
|
|
|
69
|
-
Check if an integration connection is active within the last `
|
|
69
|
+
Check if an integration connection is active within the last `secondsSinceLastActive` seconds (defaults to 10 seconds).
|
|
70
70
|
|
|
71
71
|
```ts
|
|
72
72
|
const isActive = await conductor.isIntegrationConnectionActive(
|
package/dist/package.json
CHANGED
package/dist/src/Client.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export default class Client {
|
|
|
32
32
|
constructor(apiKey: string, { verbose, serverEnvironment }?: ClientOptions);
|
|
33
33
|
getIntegrationConnectionById(integrationConnectionId: string): Promise<GetIntegrationConnectionByIdResult["integrationConnection"]>;
|
|
34
34
|
getIntegrationConnections(): Promise<GetIntegrationConnectionsResult["integrationConnections"]>;
|
|
35
|
-
isIntegrationConnectionActive(integrationConnectionId: string,
|
|
35
|
+
isIntegrationConnectionActive(integrationConnectionId: string, secondsSinceLastActive?: number): Promise<boolean>;
|
|
36
36
|
logConnectionStatuses(): Promise<void>;
|
|
37
37
|
integrationRequest(integrationRequestParams: IntegrationRequestParams): Promise<object>;
|
|
38
38
|
private request;
|
package/dist/src/Client.js
CHANGED
|
@@ -59,15 +59,15 @@ class Client {
|
|
|
59
59
|
`));
|
|
60
60
|
return data.integrationConnections;
|
|
61
61
|
}
|
|
62
|
-
async isIntegrationConnectionActive(integrationConnectionId,
|
|
62
|
+
async isIntegrationConnectionActive(integrationConnectionId, secondsSinceLastActive = 10) {
|
|
63
63
|
const integrationConnection = await this.getIntegrationConnectionById(integrationConnectionId);
|
|
64
64
|
if (integrationConnection.lastHeartbeatAt === null) {
|
|
65
65
|
return false;
|
|
66
66
|
}
|
|
67
67
|
const lastHeartbeatAt = new Date(integrationConnection.lastHeartbeatAt);
|
|
68
68
|
const now = new Date();
|
|
69
|
-
const
|
|
70
|
-
return
|
|
69
|
+
const secondsSinceLastActiveActual = (now.getTime() - lastHeartbeatAt.getTime()) / 1000;
|
|
70
|
+
return secondsSinceLastActiveActual <= secondsSinceLastActive;
|
|
71
71
|
}
|
|
72
72
|
async logConnectionStatuses() {
|
|
73
73
|
const integrationConnections = (await this.getIntegrationConnections());
|
package/package.json
CHANGED