conductor-node 6.1.1 → 6.1.2

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
@@ -64,9 +64,9 @@ const connection = await conductor.getIntegrationConnectionById(
64
64
  );
65
65
  ```
66
66
 
67
- ### `isIntegrationConnectionActive(id: string, secondsSinceLastHeartbeat: number = 10)`
67
+ ### `isIntegrationConnectionActive(id: string, secondsSinceLastActive: number = 10)`
68
68
 
69
- Check if an integration connection is active within the last `secondsSinceLastHeartbeat` seconds (defaults to 10 seconds).
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "6.1.1",
3
+ "version": "6.1.2",
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",
@@ -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, secondsSinceLastHeartbeat?: number): Promise<boolean>;
35
+ isIntegrationConnectionActive(integrationConnectionId: string, secondsSinceLastActive?: number): Promise<boolean>;
36
36
  logConnectionStatuses(): Promise<void>;
37
37
  integrationRequest(integrationRequestParams: IntegrationRequestParams): Promise<object>;
38
38
  private request;
@@ -59,15 +59,15 @@ class Client {
59
59
  `));
60
60
  return data.integrationConnections;
61
61
  }
62
- async isIntegrationConnectionActive(integrationConnectionId, secondsSinceLastHeartbeat = 10) {
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 secondsSinceLastHeartbeatActual = (now.getTime() - lastHeartbeatAt.getTime()) / 1000;
70
- return secondsSinceLastHeartbeatActual <= secondsSinceLastHeartbeat;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "6.1.1",
3
+ "version": "6.1.2",
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",