@medplum/agent 4.1.1 → 4.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/dist/cjs/index.cjs +21 -11
- package/package.json +5 -5
package/dist/cjs/index.cjs
CHANGED
|
@@ -33175,7 +33175,7 @@ var Wt = class {
|
|
|
33175
33175
|
return this.masterSubEmitter || (this.masterSubEmitter = new Ze(...Array.from(this.criteriaEntries.keys()))), this.masterSubEmitter;
|
|
33176
33176
|
}
|
|
33177
33177
|
};
|
|
33178
|
-
var Kr = "4.1.
|
|
33178
|
+
var Kr = "4.1.3-9eed5c174";
|
|
33179
33179
|
var ua = w.FHIR_JSON + ", */*; q=0.1";
|
|
33180
33180
|
var la = "https://api.medplum.com/";
|
|
33181
33181
|
var pa = 1e3;
|
|
@@ -33831,7 +33831,7 @@ var qt = class extends z {
|
|
|
33831
33831
|
return vi(n) ? this.post(this.fhircastHubUrl, Qr(t, n, i, o), w.JSON) : (Si(n), this.post(this.fhircastHubUrl, Qr(t, n, i), w.JSON));
|
|
33832
33832
|
}
|
|
33833
33833
|
async fhircastGetContext(t) {
|
|
33834
|
-
return this.get(`${this.fhircastHubUrl}/${t}
|
|
33834
|
+
return this.get(`${this.fhircastHubUrl}/${t}`, { cache: "no-cache" });
|
|
33835
33835
|
}
|
|
33836
33836
|
async invite(t, n) {
|
|
33837
33837
|
return this.post("admin/projects/" + t + "/invite", n);
|
|
@@ -34319,6 +34319,11 @@ function getChannelTypeShortName(endpoint) {
|
|
|
34319
34319
|
}
|
|
34320
34320
|
}
|
|
34321
34321
|
|
|
34322
|
+
// src/constants.ts
|
|
34323
|
+
var RETRY_WAIT_DURATION_MS = 1e4;
|
|
34324
|
+
var DEFAULT_PING_TIMEOUT = 3600;
|
|
34325
|
+
var MAX_MISSED_HEARTBEATS = 1;
|
|
34326
|
+
|
|
34322
34327
|
// src/dicom.ts
|
|
34323
34328
|
var dcmjs = __toESM(require_dcmjs());
|
|
34324
34329
|
var dimse = __toESM(require_dcmjs_dimse_min());
|
|
@@ -34596,8 +34601,6 @@ async function execAsync(command, options) {
|
|
|
34596
34601
|
});
|
|
34597
34602
|
});
|
|
34598
34603
|
}
|
|
34599
|
-
var DEFAULT_PING_TIMEOUT = 3600;
|
|
34600
|
-
var MAX_MISSED_HEARTBEATS = 1;
|
|
34601
34604
|
var App = class _App {
|
|
34602
34605
|
constructor(medplum, agentId, logLevel) {
|
|
34603
34606
|
this.webSocketQueue = [];
|
|
@@ -34777,13 +34780,10 @@ var App = class _App {
|
|
|
34777
34780
|
this.log.error(`WebSocket error on incoming message: ${Ce(err)}`);
|
|
34778
34781
|
}
|
|
34779
34782
|
});
|
|
34780
|
-
return new Promise((resolve2
|
|
34781
|
-
const
|
|
34782
|
-
() => reject(new Error("Timeout when attempting to connect to server WebSocket")),
|
|
34783
|
-
1e4
|
|
34784
|
-
);
|
|
34783
|
+
return new Promise((resolve2) => {
|
|
34784
|
+
const connectInterval = setInterval(() => this.webSocket?.reconnect(), RETRY_WAIT_DURATION_MS);
|
|
34785
34785
|
this.webSocket?.addEventListener("open", () => {
|
|
34786
|
-
|
|
34786
|
+
clearInterval(connectInterval);
|
|
34787
34787
|
resolve2();
|
|
34788
34788
|
});
|
|
34789
34789
|
});
|
|
@@ -35254,7 +35254,17 @@ async function agentMain(argv) {
|
|
|
35254
35254
|
}
|
|
35255
35255
|
const { baseUrl, clientId, clientSecret, agentId } = args;
|
|
35256
35256
|
const medplum = new qt({ baseUrl, clientId });
|
|
35257
|
-
|
|
35257
|
+
let loggedIn = false;
|
|
35258
|
+
while (!loggedIn) {
|
|
35259
|
+
try {
|
|
35260
|
+
await medplum.startClientLogin(clientId, clientSecret);
|
|
35261
|
+
loggedIn = true;
|
|
35262
|
+
} catch (err) {
|
|
35263
|
+
console.error("Failed to login", { err: Ce(err) });
|
|
35264
|
+
console.log("Retrying login in 10 seconds...");
|
|
35265
|
+
await kr(RETRY_WAIT_DURATION_MS);
|
|
35266
|
+
}
|
|
35267
|
+
}
|
|
35258
35268
|
const app = new App(medplum, agentId, Rh(args.logLevel ?? "INFO"));
|
|
35259
35269
|
await app.start();
|
|
35260
35270
|
process.on("SIGINT", async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medplum/agent",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.3",
|
|
4
4
|
"description": "Medplum Agent",
|
|
5
5
|
"homepage": "https://www.medplum.com/",
|
|
6
6
|
"bugs": {
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
"test": "jest"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@medplum/core": "4.1.
|
|
28
|
-
"@medplum/hl7": "4.1.
|
|
27
|
+
"@medplum/core": "4.1.3",
|
|
28
|
+
"@medplum/hl7": "4.1.3",
|
|
29
29
|
"dcmjs-dimse": "0.2.5",
|
|
30
30
|
"iconv-lite": "0.6.3",
|
|
31
31
|
"ws": "8.18.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@medplum/fhirtypes": "4.1.
|
|
35
|
-
"@medplum/mock": "4.1.
|
|
34
|
+
"@medplum/fhirtypes": "4.1.3",
|
|
35
|
+
"@medplum/mock": "4.1.3",
|
|
36
36
|
"@types/async-eventemitter": "0.2.4",
|
|
37
37
|
"@types/ws": "8.18.1",
|
|
38
38
|
"mock-socket": "9.3.1",
|