conductor-node 4.0.6 → 4.1.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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "4.0.6",
3
+ "version": "4.1.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",
@@ -18,6 +18,7 @@ export default class Client {
18
18
  constructor(apiKey: string, { verbose, serverEnvironment }?: ClientOptions);
19
19
  getIntegrationConnection(integrationConnectionId: string): Promise<object>;
20
20
  getIntegrationConnections(): Promise<object[]>;
21
+ logLastHeartbeats(): Promise<void>;
21
22
  integrationRequest(integrationRequestParams: IntegrationRequestParams): Promise<object>;
22
23
  private request;
23
24
  private checkForUpdates;
@@ -61,6 +61,23 @@ class Client {
61
61
  // @ts-expect-error - This will pass after we integrate GQL codegen.
62
62
  return data.integrationConnections;
63
63
  }
64
+ async logLastHeartbeats() {
65
+ const integrationConnections = await this.getIntegrationConnections();
66
+ integrationConnections.forEach((integrationConnection) => {
67
+ // @ts-expect-error - This will pass after we integrate GQL codegen.
68
+ let logMessage = `${integrationConnection.qbwcUsername}: `;
69
+ // @ts-expect-error - This will pass after we integrate GQL codegen.
70
+ const lastHeartbeatAt = integrationConnection.lastHeartbeatAt;
71
+ if (lastHeartbeatAt !== undefined) {
72
+ const secondsSinceLastHeartbeat = (Date.now() - new Date(lastHeartbeatAt).getTime()) / 1000;
73
+ logMessage += `${secondsSinceLastHeartbeat} seconds ago`;
74
+ }
75
+ else {
76
+ logMessage += "never";
77
+ }
78
+ console.log(logMessage);
79
+ });
80
+ }
64
81
  // TODO: Hide this method from the dev user while still allowing the
65
82
  // integration clients to access it.
66
83
  async integrationRequest(integrationRequestParams) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "4.0.6",
3
+ "version": "4.1.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",