@fkn/lib 0.9.42 → 0.9.44
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/{api-SwxtiYVU.d.ts → api-CFkZVr53.d.ts} +61 -30
- package/api.d.ts +2 -2
- package/attach-policy.d.ts +11 -15
- package/cloud/dns.d.ts +1 -1
- package/cloud/fetch.d.ts +1 -1
- package/cloud/fs/promises.d.ts +1 -1
- package/cloud/fs.d.ts +3 -3
- package/cloud/net.d.ts +1 -1
- package/cloud-Bx64HSkQ.cjs +1 -0
- package/cloud-D-vDUzzx.js +552 -0
- package/{cloud-DUH-v10C.d.ts → cloud-DyOQPyUB.d.ts} +4 -4
- package/cloud.cjs +1 -1
- package/cloud.d.ts +4 -4
- package/cloud.js +1 -1
- package/{contract-CCxPKIC7.d.ts → contract-6Xfd_qel.d.ts} +173 -22
- package/contract.d.ts +4 -4
- package/dgram.d.ts +7 -14
- package/dns.d.ts +1 -1
- package/{extension-yhwDSIiD.d.ts → extension-BlEtNAYc.d.ts} +36 -37
- package/extension-CzZn0bY2.js +94 -0
- package/extension-DvFf7uoG.cjs +1 -0
- package/extension.cjs +1 -1
- package/extension.d.ts +3 -3
- package/extension.js +3 -3
- package/fs/promises.d.ts +1 -1
- package/{fs-D0MMRnHC.d.ts → fs-KA1Mgisv.d.ts} +2 -2
- package/fs.d.ts +3 -3
- package/http.d.ts +1 -1
- package/{index-BtFiGoVQ.d.ts → index-BOInGaEl.d.ts} +103 -62
- package/{index-D2lvaQDs.d.ts → index-DKr9L2RI.d.ts} +6 -11
- package/index.cjs +1 -1
- package/index.d.ts +36 -39
- package/index.js +55 -55
- package/{lib-DppqX10G.js → lib-C3UwxjVs.js} +560 -474
- package/lib-fqQfEPk6.cjs +53 -0
- package/messages-d7pvCXPn.d.ts +34 -0
- package/messages.d.ts +1 -1
- package/{net-DcLF-6E-.d.ts → net-CmMZgV2a.d.ts} +3 -19
- package/net.d.ts +1 -1
- package/package.json +1 -1
- package/packages.d.ts +1 -1
- package/{proxy-CE46SkyA.d.ts → proxy-dOOmiMl4.d.ts} +2 -2
- package/rooms.cjs +1 -1
- package/rooms.d.ts +94 -15
- package/rooms.js +118 -90
- package/{storage-BVr2Rb-d.d.ts → storage-BLBsmkmp.d.ts} +14 -28
- package/{wire-Gbo-D74t.d.ts → wire-BwA4JjZH.d.ts} +6 -12
- package/wire.d.ts +1 -1
- package/cloud-868OlBKn.cjs +0 -1
- package/cloud-f3j4s8yZ.js +0 -545
- package/extension-BOBuYwZc.js +0 -92
- package/extension-hoUs5yJ7.cjs +0 -1
- package/lib-CfdmsLoI.cjs +0 -53
- package/messages-CRcziTuC.d.ts +0 -46
package/index.js
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import {
|
|
11
|
-
import { t as
|
|
12
|
-
import { u as
|
|
13
|
-
import { t as
|
|
14
|
-
import { t as
|
|
15
|
-
import { t as
|
|
16
|
-
import { t as
|
|
17
|
-
import { t as
|
|
18
|
-
import { relay as
|
|
2
|
+
import { B as t, C as n, D as r, E as i, F as a, G as o, H as ee, I as te, J as ne, K as s, L as re, N as ie, P as ae, Q as c, R as l, S as oe, T as se, V as ce, W as le, X as ue, Y as de, Z as u, _ as d, a as f, at as p, b as m, ct as h, dt as g, et as _, ft as v, g as y, i as b, it as x, j as S, k as C, lt as w, mt as T, n as E, nt as D, o as O, ot as k, pt as A, q as j, r as M, rt as N, st as P, t as F, tt as I, ut as L, v as R, w as z, x as B, y as V, z as H } from "./lib-C3UwxjVs.js";
|
|
3
|
+
import { a as fe, i as pe, n as me, o as he, t as ge } from "./extension-CzZn0bY2.js";
|
|
4
|
+
import { c as U, d as _e, f as ve, o as W, u as G } from "./api-DIgTslNb.js";
|
|
5
|
+
import { n as ye, t as be } from "./busy-B189uX--.js";
|
|
6
|
+
import { a as xe, i as K, n as Se } from "./cloud-D-vDUzzx.js";
|
|
7
|
+
import { t as Ce } from "./dns.js";
|
|
8
|
+
import { t as we } from "./net.js";
|
|
9
|
+
import { t as Te } from "./dgram.js";
|
|
10
|
+
import { t as Ee } from "./http.js";
|
|
11
|
+
import { t as De } from "./desktop.js";
|
|
12
|
+
import { u as Oe } from "./fs-CVnmXRf7.js";
|
|
13
|
+
import { t as ke } from "./opfs.js";
|
|
14
|
+
import { t as Ae } from "./packages.js";
|
|
15
|
+
import { t as je } from "./rooms.js";
|
|
16
|
+
import { t as Me } from "./account.js";
|
|
17
|
+
import { t as Ne } from "./connect-button-DtsN3X1J.js";
|
|
18
|
+
import { relay as Pe } from "osra";
|
|
19
19
|
//#region src/frame.ts
|
|
20
|
-
var
|
|
21
|
-
if (
|
|
22
|
-
let
|
|
23
|
-
clearTimeout(
|
|
24
|
-
},
|
|
25
|
-
clearTimeout(
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
}),
|
|
29
|
-
document.readyState === "complete" && !
|
|
20
|
+
var Fe = 1e4, Ie = 150, Le = () => new Promise((e) => {
|
|
21
|
+
if (_()) return e(!0);
|
|
22
|
+
let t, n = setTimeout(() => r(_()), Fe), r = (r) => {
|
|
23
|
+
clearTimeout(t), clearTimeout(n), a.disconnect(), document.removeEventListener("readystatechange", o), e(r);
|
|
24
|
+
}, i = () => {
|
|
25
|
+
clearTimeout(t), t = setTimeout(() => r(_()), Ie);
|
|
26
|
+
}, a = new MutationObserver(() => {
|
|
27
|
+
_() && r(!0);
|
|
28
|
+
}), o = () => {
|
|
29
|
+
document.readyState === "complete" && !_() && i();
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
a.observe(document.documentElement, {
|
|
32
32
|
attributes: !0,
|
|
33
33
|
attributeFilter: ["data-fkn-extension"]
|
|
34
|
-
}), document.addEventListener("readystatechange",
|
|
35
|
-
}),
|
|
34
|
+
}), document.addEventListener("readystatechange", o), document.readyState === "complete" && i();
|
|
35
|
+
}), Re = (async (e) => {
|
|
36
36
|
let { kind: t, cookies: n } = O(e);
|
|
37
37
|
if (t === "window") {
|
|
38
38
|
let t = e;
|
|
39
|
-
return n === "native" ?
|
|
39
|
+
return n === "native" ? f(t) : K(t);
|
|
40
40
|
}
|
|
41
41
|
let r = e;
|
|
42
|
-
return n === "native" ?
|
|
43
|
-
}),
|
|
42
|
+
return n === "native" ? ze(r) : K(r);
|
|
43
|
+
}), ze = async (e) => (xe(e), await Le(), f(e)), Be = "https://fkn.app", Ve = async (e, t) => {
|
|
44
44
|
if (typeof window > "u") throw Error("FKN @fkn/lib: relayWorker must be called from the main thread");
|
|
45
|
-
let n = await
|
|
45
|
+
let n = await ve;
|
|
46
46
|
if (!n) throw Error("FKN @fkn/lib: relayWorker found no FKN transport in this realm");
|
|
47
|
-
|
|
48
|
-
let r =
|
|
47
|
+
_e();
|
|
48
|
+
let r = be("relayed worker");
|
|
49
49
|
t?.unregisterSignal?.aborted ? r() : t?.unregisterSignal?.addEventListener("abort", r, { once: !0 });
|
|
50
50
|
let i = n.emit instanceof MessagePort ? {} : {
|
|
51
|
-
originA: t?.originA ??
|
|
51
|
+
originA: t?.originA ?? Be,
|
|
52
52
|
originB: t?.originB ?? "*"
|
|
53
53
|
};
|
|
54
|
-
|
|
54
|
+
Pe(n, e, {
|
|
55
55
|
key: "fkn-api",
|
|
56
56
|
...i,
|
|
57
57
|
unregisterSignal: t?.unregisterSignal
|
|
58
58
|
});
|
|
59
|
-
},
|
|
59
|
+
}, He = async () => typeof window > "u" ? !1 : (await W).connect.prompt(location.origin).catch(() => !1), Ue = async () => typeof window > "u" ? null : (await W).relay.prompt().catch(() => null), q = /* @__PURE__ */ new Set(), We = (e) => (q.add(e), () => {
|
|
60
60
|
q.delete(e);
|
|
61
|
-
}),
|
|
61
|
+
}), Ge = () => {
|
|
62
62
|
if (q.size === 0) return !1;
|
|
63
63
|
for (let e of [...q]) try {
|
|
64
64
|
e();
|
|
65
65
|
} catch {}
|
|
66
66
|
return !0;
|
|
67
|
-
},
|
|
67
|
+
}, Ke = (e, t) => {
|
|
68
68
|
if (typeof e?.onUpdateTaken == "function") return Promise.resolve(e.onUpdateTaken(t));
|
|
69
|
-
},
|
|
70
|
-
applyUpdate: () =>
|
|
71
|
-
busyReasons: () =>
|
|
72
|
-
onUpdate: () =>
|
|
73
|
-
onUpdateTaken: () =>
|
|
74
|
-
updateReady: () =>
|
|
75
|
-
}),
|
|
69
|
+
}, qe = /* @__PURE__ */ e({
|
|
70
|
+
applyUpdate: () => et,
|
|
71
|
+
busyReasons: () => $e,
|
|
72
|
+
onUpdate: () => Xe,
|
|
73
|
+
onUpdateTaken: () => Ze,
|
|
74
|
+
updateReady: () => Je
|
|
75
|
+
}), Je = async () => typeof window > "u" ? !1 : W.then((e) => e.shell?.updateReady()).then((e) => e === !0).catch(() => !1), J = /* @__PURE__ */ new Set(), Y = !1, Ye = () => {
|
|
76
76
|
Y = !0;
|
|
77
77
|
for (let e of [...J]) try {
|
|
78
78
|
e();
|
|
79
79
|
} catch {}
|
|
80
80
|
}, X = 0, Z = () => {
|
|
81
81
|
let e = U();
|
|
82
|
-
e && J.size !== 0 && X !== e.epoch && (X = e.epoch, Y = !1, Promise.resolve(e.remote.shell?.onUpdate(
|
|
82
|
+
e && J.size !== 0 && X !== e.epoch && (X = e.epoch, Y = !1, Promise.resolve(e.remote.shell?.onUpdate(Ye)).catch(() => {
|
|
83
83
|
X === e.epoch && (X = 0);
|
|
84
84
|
}));
|
|
85
85
|
};
|
|
86
86
|
typeof window < "u" && G(Z);
|
|
87
|
-
var
|
|
87
|
+
var Xe = async (e) => {
|
|
88
88
|
if (typeof window > "u") return () => {};
|
|
89
89
|
if (J.add(e), Y) try {
|
|
90
90
|
e();
|
|
@@ -92,8 +92,8 @@ var Je = async (e) => {
|
|
|
92
92
|
return Z(), () => {
|
|
93
93
|
J.delete(e);
|
|
94
94
|
};
|
|
95
|
-
},
|
|
96
|
-
if (!
|
|
95
|
+
}, Ze = (e) => typeof window > "u" ? () => {} : We(e), Q = 0, $ = !1, Qe = () => {
|
|
96
|
+
if (!Ge() && !$) {
|
|
97
97
|
$ = !0;
|
|
98
98
|
try {
|
|
99
99
|
location.reload();
|
|
@@ -104,7 +104,7 @@ typeof window < "u" && G(() => {
|
|
|
104
104
|
let e = U();
|
|
105
105
|
if (!e || Q === e.epoch) return;
|
|
106
106
|
Q = e.epoch;
|
|
107
|
-
let t =
|
|
107
|
+
let t = Ke(e.remote.shell, Qe);
|
|
108
108
|
if (!t) {
|
|
109
109
|
Q = 0;
|
|
110
110
|
return;
|
|
@@ -113,6 +113,6 @@ typeof window < "u" && G(() => {
|
|
|
113
113
|
Q === e.epoch && (Q = 0);
|
|
114
114
|
});
|
|
115
115
|
});
|
|
116
|
-
var
|
|
116
|
+
var $e = () => ye(), et = async () => typeof window > "u" ? !1 : W.then((e) => e.shell?.applyUpdate()).then((e) => e === !0).catch(() => !1);
|
|
117
117
|
//#endregion
|
|
118
|
-
export {
|
|
118
|
+
export { b as ATTACH_FRAME_EVENT_KEY, fe as BACKGROUND_STOPPED, z as CATEGORIES, x as EXTENSION_ABI, p as ExtensionOperationUnsupportedError, k as ExtensionOutdatedError, de as FORGEABLE_HEADERS, y as FrameWindowBlockedError, d as FrameWindowRefusedError, C as LOCATOR_DENIED, ae as LOCATOR_ERROR, te as LOCATOR_INVALID, i as LOCATOR_UNSUPPORTED, F as PERMISSION_DENIED, P as REQUIRED_EXTENSION_ABI, se as TimeoutError, Me as account, B as assertAttachableFrameUrl, ee as assertFetchableUrl, ue as assertForgeableHeaders, oe as assertLockdownApplicable, u as assertOneCookieIdentity, Re as attachFrame, R as attachFramePermission, L as box, Se as cloud, He as connect, Ne as connectButtonUrl, t as cookies, V as createFrame, g as createVideoElementHandle, De as desktop, Te as dgram, Ce as dns, ge as extension, me as fetch, le as fetchCredentialedPermission, o as fetchLocalPermission, s as fetchPermission, Oe as fs, m as gotoPermission, w as handleRevivableModules, c as hasForgedCookie, Ee as http, he as isBackgroundStopped, j as isBlockedFetchUrl, n as isBlockedFrameUrl, _ as isExtensionExposed, ne as isLocalNetworkUrl, a as isLocatorDenied, S as isLocatorInvalid, r as isLocatorUnsupported, E as isPermissionDenied, ie as isTerminalError, v as isType, re as modifyRequestHeadersPermission, we as net, ke as opfs, Ae as packages, M as permissions, pe as promptInstall, Ue as promptRelay, ce as readCookiePermission, I as readExtensionHandshake, Ve as relayWorker, l as removeRequestHeaderRule, A as revive, je as rooms, D as setMissingExtensionHandler, H as setRequestHeaderRule, qe as shell, h as supportsOperation, T as type, N as waitForExtensionExposure };
|