osra 0.6.1 → 0.6.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.
|
@@ -20,7 +20,9 @@ export type ProtocolContext<TModules extends readonly RevivableModule[] = Defaul
|
|
|
20
20
|
connectionContexts: Map<string, ConnectionContext<TModules>>;
|
|
21
21
|
getUuid: () => Uuid;
|
|
22
22
|
presetRemoteUuid?: Uuid;
|
|
23
|
-
|
|
23
|
+
/** targetOrigin overrides the configured origin for this one send - only
|
|
24
|
+
* the unsolicited announce beacon broadcasts with '*'. */
|
|
25
|
+
sendMessage: (message: MessageVariant, targetOrigin?: string) => void;
|
|
24
26
|
protocolEventTarget: ProtocolEventTarget<TModules>;
|
|
25
27
|
resolveRemoteValue: (value: Capable<TModules>) => void;
|
|
26
28
|
rejectRemoteValue: (error: unknown) => void;
|
package/build/index.js
CHANGED
|
@@ -1469,7 +1469,7 @@ var de = (e) => {
|
|
|
1469
1469
|
let t = 50, n, r = () => {
|
|
1470
1470
|
if (!(e.unregisterSignal?.aborted || e.connectionContexts.size > 0)) {
|
|
1471
1471
|
try {
|
|
1472
|
-
e.sendMessage({ type: "announce" });
|
|
1472
|
+
e.sendMessage({ type: "announce" }, "*");
|
|
1473
1473
|
} catch {}
|
|
1474
1474
|
n = setTimeout(r, t), t = Math.min(t * 2, 1e3);
|
|
1475
1475
|
}
|
|
@@ -1501,16 +1501,16 @@ var de = (e) => {
|
|
|
1501
1501
|
if (!(k(m) && A(m))) throw Error("osra: transport must be able to both emit and receive to establish a connection; pass a bidirectional platform transport or a custom { emit, receive } pair");
|
|
1502
1502
|
let ee = Dr(d), h = /* @__PURE__ */ new Map(), { promise: g, resolve: te, reject: _ } = Promise.withResolvers();
|
|
1503
1503
|
g.catch(() => {});
|
|
1504
|
-
let v = f ?? globalThis.crypto.randomUUID(), y = (e) => {
|
|
1505
|
-
let
|
|
1504
|
+
let v = f ?? globalThis.crypto.randomUUID(), y = (e, t = s) => {
|
|
1505
|
+
let r = {
|
|
1506
1506
|
[n]: o,
|
|
1507
1507
|
name: i,
|
|
1508
1508
|
uuid: v,
|
|
1509
1509
|
...e
|
|
1510
1510
|
};
|
|
1511
|
-
u(m,
|
|
1512
|
-
}, b = (e) => {
|
|
1513
|
-
c?.aborted || y(e);
|
|
1511
|
+
u(m, r, t, I(r));
|
|
1512
|
+
}, b = (e, t) => {
|
|
1513
|
+
c?.aborted || y(e, t);
|
|
1514
1514
|
}, x = Er(), ne = {
|
|
1515
1515
|
transport: m,
|
|
1516
1516
|
value: e,
|