conductor-node 4.0.6 → 4.1.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/dist/package.json +1 -1
- package/dist/src/Client.d.ts +1 -0
- package/dist/src/Client.js +17 -0
- package/package.json +1 -1
package/dist/package.json
CHANGED
package/dist/src/Client.d.ts
CHANGED
|
@@ -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;
|
package/dist/src/Client.js
CHANGED
|
@@ -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 = Math.floor((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