@medplum/agent 3.2.11 → 3.2.13

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.
Files changed (2) hide show
  1. package/dist/cjs/index.cjs +21 -17
  2. package/package.json +5 -5
@@ -43106,12 +43106,12 @@ function Po(r7) {
43106
43106
  }
43107
43107
  var Nn = [];
43108
43108
  for (let r7 = 0; r7 < 256; r7++) Nn.push(r7.toString(16).padStart(2, "0"));
43109
- function Fn(r7) {
43109
+ function Ln(r7) {
43110
43110
  let e = new Uint8Array(r7), t = new Array(e.length);
43111
43111
  for (let n = 0; n < e.length; n++) t[n] = Nn[e[n]];
43112
43112
  return t.join("");
43113
43113
  }
43114
- function Ln(r7) {
43114
+ function Fn(r7) {
43115
43115
  let e = new Uint8Array(r7), t = [];
43116
43116
  for (let n = 0; n < e.length; n++) t[n] = String.fromCharCode(e[n]);
43117
43117
  return window.btoa(t.join(""));
@@ -43171,8 +43171,8 @@ function me(r7) {
43171
43171
  var p = { Address: "Address", Age: "Age", Annotation: "Annotation", Attachment: "Attachment", BackboneElement: "BackboneElement", CodeableConcept: "CodeableConcept", Coding: "Coding", ContactDetail: "ContactDetail", ContactPoint: "ContactPoint", Contributor: "Contributor", Count: "Count", DataRequirement: "DataRequirement", Distance: "Distance", Dosage: "Dosage", Duration: "Duration", Expression: "Expression", Extension: "Extension", HumanName: "HumanName", Identifier: "Identifier", MarketingStatus: "MarketingStatus", Meta: "Meta", Money: "Money", Narrative: "Narrative", ParameterDefinition: "ParameterDefinition", Period: "Period", Population: "Population", ProdCharacteristic: "ProdCharacteristic", ProductShelfLife: "ProductShelfLife", Quantity: "Quantity", Range: "Range", Ratio: "Ratio", Reference: "Reference", RelatedArtifact: "RelatedArtifact", SampledData: "SampledData", Signature: "Signature", SubstanceAmount: "SubstanceAmount", SystemString: "http://hl7.org/fhirpath/System.String", Timing: "Timing", TriggerDefinition: "TriggerDefinition", UsageContext: "UsageContext", base64Binary: "base64Binary", boolean: "boolean", canonical: "canonical", code: "code", date: "date", dateTime: "dateTime", decimal: "decimal", id: "id", instant: "instant", integer: "integer", markdown: "markdown", oid: "oid", positiveInt: "positiveInt", string: "string", time: "time", unsignedInt: "unsignedInt", uri: "uri", url: "url", uuid: "uuid" };
43172
43172
  function Cr(r7) {
43173
43173
  for (let e of r7.base ?? []) {
43174
- let t = F.types[e];
43175
- t || (t = { searchParamsDetails: {} }, F.types[e] = t), t.searchParams || (t.searchParams = { _id: { base: [e], code: "_id", type: "token", expression: e + ".id" }, _lastUpdated: { base: [e], code: "_lastUpdated", type: "date", expression: e + ".meta.lastUpdated" }, _compartment: { base: [e], code: "_compartment", type: "reference", expression: e + ".meta.compartment" }, _profile: { base: [e], code: "_profile", type: "uri", expression: e + ".meta.profile" }, _security: { base: [e], code: "_security", type: "token", expression: e + ".meta.security" }, _source: { base: [e], code: "_source", type: "uri", expression: e + ".meta.source" }, _tag: { base: [e], code: "_tag", type: "token", expression: e + ".meta.tag" } }), t.searchParams[r7.code] = r7;
43174
+ let t = L.types[e];
43175
+ t || (t = { searchParamsDetails: {} }, L.types[e] = t), t.searchParams || (t.searchParams = { _id: { base: [e], code: "_id", type: "token", expression: e + ".id" }, _lastUpdated: { base: [e], code: "_lastUpdated", type: "date", expression: e + ".meta.lastUpdated" }, _compartment: { base: [e], code: "_compartment", type: "reference", expression: e + ".meta.compartment" }, _profile: { base: [e], code: "_profile", type: "uri", expression: e + ".meta.profile" }, _security: { base: [e], code: "_security", type: "token", expression: e + ".meta.security" }, _source: { base: [e], code: "_source", type: "uri", expression: e + ".meta.source" }, _tag: { base: [e], code: "_tag", type: "token", expression: e + ".meta.tag" } }), t.searchParams[r7.code] = r7;
43176
43176
  }
43177
43177
  }
43178
43178
  function ir(r7) {
@@ -43203,7 +43203,7 @@ function I(r7) {
43203
43203
  function ue(r7) {
43204
43204
  return !!(r7 && typeof r7 == "object" && "reference" in r7 && typeof r7.reference == "string");
43205
43205
  }
43206
- var F = { types: {} };
43206
+ var L = { types: {} };
43207
43207
  function Ae(r7) {
43208
43208
  if (r7.startsWith("T")) return r7 + "T00:00:00.000Z".substring(r7.length);
43209
43209
  if (r7.length <= 10) return r7;
@@ -43313,10 +43313,10 @@ var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
43313
43313
  if (n) return [{ type: p.time, value: Ae("T" + n[1]) }];
43314
43314
  }
43315
43315
  return [];
43316
- }, convertsToTime: (r7, e) => e.length === 0 ? [] : f(O.toTime(r7, e).length === 1), indexOf: (r7, e, t) => L((n, i) => n.indexOf(i), r7, e, t), substring: (r7, e, t, n) => L((i, o, s) => {
43316
+ }, convertsToTime: (r7, e) => e.length === 0 ? [] : f(O.toTime(r7, e).length === 1), indexOf: (r7, e, t) => F((n, i) => n.indexOf(i), r7, e, t), substring: (r7, e, t, n) => F((i, o, s) => {
43317
43317
  let a2 = o, c = s ? a2 + s : i.length;
43318
43318
  return a2 < 0 || a2 >= i.length ? void 0 : i.substring(a2, c);
43319
- }, r7, e, t, n), startsWith: (r7, e, t) => L((n, i) => n.startsWith(i), r7, e, t), endsWith: (r7, e, t) => L((n, i) => n.endsWith(i), r7, e, t), contains: (r7, e, t) => L((n, i) => n.includes(i), r7, e, t), upper: (r7, e) => L((t) => t.toUpperCase(), r7, e), lower: (r7, e) => L((t) => t.toLowerCase(), r7, e), replace: (r7, e, t, n) => L((i, o, s) => i.replaceAll(o, s), r7, e, t, n), matches: (r7, e, t) => L((n, i) => !!new RegExp(i).exec(n), r7, e, t), replaceMatches: (r7, e, t, n) => L((i, o, s) => i.replaceAll(o, s), r7, e, t, n), length: (r7, e) => L((t) => t.length, r7, e), toChars: (r7, e) => L((t) => t ? t.split("") : void 0, r7, e), encode: z, decode: z, escape: z, unescape: z, trim: z, split: z, join: (r7, e, t) => {
43319
+ }, r7, e, t, n), startsWith: (r7, e, t) => F((n, i) => n.startsWith(i), r7, e, t), endsWith: (r7, e, t) => F((n, i) => n.endsWith(i), r7, e, t), contains: (r7, e, t) => F((n, i) => n.includes(i), r7, e, t), upper: (r7, e) => F((t) => t.toUpperCase(), r7, e), lower: (r7, e) => F((t) => t.toLowerCase(), r7, e), replace: (r7, e, t, n) => F((i, o, s) => i.replaceAll(o, s), r7, e, t, n), matches: (r7, e, t) => F((n, i) => !!new RegExp(i).exec(n), r7, e, t), replaceMatches: (r7, e, t, n) => F((i, o, s) => i.replaceAll(o, s), r7, e, t, n), length: (r7, e) => F((t) => t.length, r7, e), toChars: (r7, e) => F((t) => t ? t.split("") : void 0, r7, e), encode: z, decode: z, escape: z, unescape: z, trim: z, split: z, join: (r7, e, t) => {
43320
43320
  let n = t?.eval(r7, he(r7))[0]?.value ?? "";
43321
43321
  if (typeof n != "string") throw new Error("Separator must be a string.");
43322
43322
  return [{ type: p.string, value: e.map((i) => i.value?.toString() ?? "").join(n) }];
@@ -43370,7 +43370,7 @@ var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
43370
43370
  }
43371
43371
  return [];
43372
43372
  } };
43373
- function L(r7, e, t, ...n) {
43373
+ function F(r7, e, t, ...n) {
43374
43374
  if (t.length === 0) return [];
43375
43375
  let [{ value: i }] = G(t, 1);
43376
43376
  if (typeof i != "string") throw new Error("String function cannot be called with non-string");
@@ -43682,7 +43682,7 @@ function ii(r7) {
43682
43682
  }
43683
43683
  function Vr() {
43684
43684
  let r7 = new Uint32Array(28);
43685
- return crypto.getRandomValues(r7), Fn(r7.buffer);
43685
+ return crypto.getRandomValues(r7), Ln(r7.buffer);
43686
43686
  }
43687
43687
  async function oi(r7) {
43688
43688
  return crypto.subtle.digest("SHA-256", new TextEncoder().encode(r7));
@@ -43818,7 +43818,7 @@ function Ws(r7, e) {
43818
43818
  if (!o.manyAllowed && (t.get(i) || 0) > 1) throw new d(h(`${t.get(i)} context entries with key '${i}' found for the '${r7}' event when schema only allows for 1.`));
43819
43819
  }
43820
43820
  }
43821
- function Fr(r7, e, t, n) {
43821
+ function Lr(r7, e, t, n) {
43822
43822
  if (!(r7 && typeof r7 == "string")) throw new d(h("Must provide a topic."));
43823
43823
  if (!Mr[e]) throw new d(h(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Mr).join(", ")}`));
43824
43824
  if (typeof t != "object") throw new d(h("context must be a context object or array of context objects."));
@@ -43927,7 +43927,7 @@ var M = class {
43927
43927
  };
43928
43928
  var je = class {
43929
43929
  constructor(e) {
43930
- this.storage = e ?? (typeof localStorage < "u" ? localStorage : new Lr());
43930
+ this.storage = e ?? (typeof localStorage < "u" ? localStorage : new Fr());
43931
43931
  }
43932
43932
  clear() {
43933
43933
  this.storage.clear();
@@ -43946,7 +43946,7 @@ var je = class {
43946
43946
  this.setString(e, t ? Mn(t) : void 0);
43947
43947
  }
43948
43948
  };
43949
- var Lr = class {
43949
+ var Fr = class {
43950
43950
  constructor() {
43951
43951
  this.data = /* @__PURE__ */ new Map();
43952
43952
  }
@@ -44347,7 +44347,7 @@ var Mt = class {
44347
44347
  return this.masterSubEmitter || (this.masterSubEmitter = new $e(...Array.from(this.criteriaEntries.keys()))), this.masterSubEmitter;
44348
44348
  }
44349
44349
  };
44350
- var Wd = "3.2.11-2a9ee14b4";
44350
+ var Wd = "3.2.13-21ac82df2";
44351
44351
  var Ys = D.FHIR_JSON + ", */*; q=0.1";
44352
44352
  var Zs = "https://api.medplum.com/";
44353
44353
  var Xs = 1e3;
@@ -44915,9 +44915,9 @@ var _t = class extends H {
44915
44915
  async startPkce() {
44916
44916
  let t = Vr();
44917
44917
  sessionStorage.setItem("pkceState", t);
44918
- let n = Vr();
44918
+ let n = Vr().slice(0, 128);
44919
44919
  sessionStorage.setItem("codeVerifier", n);
44920
- let i = await oi(n), o = Ln(i).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
44920
+ let i = await oi(n), o = Fn(i).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
44921
44921
  return sessionStorage.setItem("codeChallenge", o), { codeChallengeMethod: "S256", codeChallenge: o };
44922
44922
  }
44923
44923
  async requestAuthorization(t) {
@@ -44976,7 +44976,7 @@ var _t = class extends H {
44976
44976
  return new At(t);
44977
44977
  }
44978
44978
  async fhircastPublish(t, n, i, o) {
44979
- return ci(n) ? this.post(`/fhircast/STU3/${t}`, Fr(t, n, i, o), D.JSON) : (ui(n), this.post(`/fhircast/STU3/${t}`, Fr(t, n, i), D.JSON));
44979
+ return ci(n) ? this.post(`/fhircast/STU3/${t}`, Lr(t, n, i, o), D.JSON) : (ui(n), this.post(`/fhircast/STU3/${t}`, Lr(t, n, i), D.JSON));
44980
44980
  }
44981
44981
  async fhircastGetContext(t) {
44982
44982
  return this.get(`/fhircast/STU3/${t}`);
@@ -45019,7 +45019,11 @@ var _t = class extends H {
45019
45019
  setupStorageListener() {
45020
45020
  try {
45021
45021
  window.addEventListener("storage", (t) => {
45022
- (t.key === null || t.key === "activeLogin") && window.location.reload();
45022
+ if (t.key === null) window.location.reload();
45023
+ else if (t.key === "activeLogin") {
45024
+ let n = t.oldValue ? JSON.parse(t.oldValue) : void 0, i = t.newValue ? JSON.parse(t.newValue) : void 0;
45025
+ n?.profile.id !== i?.profile.id && window.location.reload();
45026
+ }
45023
45027
  });
45024
45028
  } catch {
45025
45029
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medplum/agent",
3
- "version": "3.2.11",
3
+ "version": "3.2.13",
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": "3.2.11",
28
- "@medplum/hl7": "3.2.11",
27
+ "@medplum/core": "3.2.13",
28
+ "@medplum/hl7": "3.2.13",
29
29
  "dcmjs-dimse": "0.1.28",
30
30
  "iconv-lite": "0.6.3",
31
31
  "ws": "8.18.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@medplum/fhirtypes": "3.2.11",
35
- "@medplum/mock": "3.2.11",
34
+ "@medplum/fhirtypes": "3.2.13",
35
+ "@medplum/mock": "3.2.13",
36
36
  "@types/async-eventemitter": "0.2.4",
37
37
  "@types/ws": "8.5.12",
38
38
  "mock-socket": "9.3.1",