@fkn/lib 0.9.33 → 0.9.35
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/account.cjs +1 -1
- package/account.d.ts +6 -6
- package/account.js +3 -3
- package/{api-Cc5qxCHP.d.ts → api-CfmRAze5.d.ts} +3 -1
- package/{api-BlAtp6lc.js → api-CtiKFcK3.js} +62 -47
- package/api-Djf-XdZ4.cjs +3 -0
- package/api.cjs +1 -1
- package/api.d.ts +2 -2
- package/api.js +1 -1
- package/attach-policy.cjs +1 -1
- package/attach-policy.d.ts +32 -7
- package/attach-policy.js +16 -18
- package/cloud/dns.d.ts +1 -1
- package/cloud/fetch.cjs +1 -1
- package/cloud/fetch.d.ts +1 -1
- package/cloud/fetch.js +1 -1
- package/cloud/fs/promises.d.ts +3 -4
- package/cloud/fs.cjs +1 -1
- package/cloud/fs.d.ts +2 -2
- package/cloud/fs.js +2 -2
- package/cloud/net.d.ts +1 -1
- package/cloud-B9Sd7V1g.js +422 -0
- package/cloud-DCWD_0sd.cjs +1 -0
- package/{cloud-D0Ebu5bX.d.ts → cloud-DxitkM7z.d.ts} +9 -5
- package/cloud.cjs +1 -1
- package/cloud.d.ts +4 -4
- package/cloud.js +2 -2
- package/{contract-CahPObYc.d.ts → contract-D37GGkou.d.ts} +146 -1
- package/contract.cjs +1 -0
- package/contract.d.ts +2 -2
- package/contract.js +28 -0
- package/desktop.d.ts +7 -7
- package/dgram.cjs +1 -1
- package/dgram.d.ts +5 -5
- package/dgram.js +1 -1
- package/dns.cjs +1 -1
- package/dns.d.ts +3 -3
- package/dns.js +1 -1
- package/extension-DJQ0oYdk.js +89 -0
- package/extension-DSrUjoLw.cjs +1 -0
- package/{extension-DNkuFy1Y.d.ts → extension-TRYu_aG-.d.ts} +36 -157
- package/extension.cjs +1 -1
- package/extension.d.ts +3 -3
- package/extension.js +3 -3
- package/fs/promises.cjs +1 -1
- package/fs/promises.d.ts +3 -3
- package/fs/promises.js +1 -1
- package/{fs-CYcErwc4.d.ts → fs--NhtUyYa.d.ts} +1 -1
- package/{fs-BSsWw8HM.js → fs-BvNZePtN.js} +4 -4
- package/{fs-DxDxbvRS.cjs → fs-D8RCGFNc.cjs} +1 -1
- package/fs.cjs +1 -1
- package/fs.d.ts +2 -2
- package/fs.js +1 -1
- package/hosts-C4-8lWwz.js +161 -0
- package/hosts-DD4rDeQH.cjs +1 -0
- package/http.d.ts +20 -20
- package/{index-DH3_12nU.d.ts → index-C_Lqta5o.d.ts} +385 -7
- package/{index-Cg6y_FTi.d.ts → index-kuPqkS_-.d.ts} +26 -3
- package/index.cjs +1 -1
- package/index.d.ts +25 -10
- package/index.js +68 -62
- package/{lib-duLPF_WZ.js → lib-B-jGWfsv.js} +597 -396
- package/lib-Cjd91q7g.cjs +53 -0
- package/{net-BXPEJToS.d.ts → net-0SlODFSM.d.ts} +2 -2
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +1 -1
- package/node-fs-BNTPsX5c.cjs +1 -0
- package/{node-fs-C9ECR_9H.js → node-fs-BZy9bzKd.js} +2 -2
- package/opfs/promises.d.ts +2 -2
- package/opfs.cjs +1 -1
- package/opfs.d.ts +2 -2
- package/opfs.js +1 -1
- package/package.json +1 -1
- package/packages.cjs +1 -1
- package/packages.d.ts +27 -27
- package/packages.js +1 -1
- package/{proxy-DxiJU5Y_.d.ts → proxy-Bmb2wxG1.d.ts} +2 -2
- package/proxy-CYcaW5ew.cjs +1 -0
- package/proxy-DDwY3AVG.js +60 -0
- package/react.d.ts +3 -3
- package/rooms.cjs +1 -1
- package/rooms.d.ts +8 -8
- package/rooms.js +1 -1
- package/{storage-Bo01npo9.js → storage-BbcnDCnc.js} +1 -1
- package/{storage-WZEvw3KN.d.ts → storage-ZrY4Y4L5.d.ts} +21 -2
- package/{storage-DEjjVCT2.cjs → storage-dSi2dUKx.cjs} +1 -1
- package/api-Beky02FK.cjs +0 -3
- package/cloud-BZmduWyX.cjs +0 -1
- package/cloud-DaVb11IV.js +0 -174
- package/extension-D70dtUvW.cjs +0 -1
- package/extension-DdXNlt9_.js +0 -84
- package/lib-DLM2M3_i.cjs +0 -53
- package/node-fs-DZPGCYWg.cjs +0 -1
- package/proxy-DexG-Wmk.cjs +0 -1
- package/proxy-VY0HRl2E.js +0 -75
package/index.js
CHANGED
|
@@ -1,101 +1,107 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import { n as
|
|
5
|
-
import { a as U, i as W, n as
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import { i as
|
|
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 { $ as t, A as n, B as r, C as i, D as a, E as o, F as s, G as c, H as l, I as ee, J as te, K as ne, L as re, M as ie, N as ae, O as oe, Q as se, R as u, S as d, T as ce, U as le, V as ue, X as de, Y as f, Z as p, _ as m, a as h, at as g, b as _, d as v, et as y, f as b, g as x, h as S, i as C, it as w, j as T, k as E, m as D, n as O, nt as k, o as A, p as j, q as M, r as N, rt as P, t as F, tt as I, v as L, y as R, z } from "./lib-B-jGWfsv.js";
|
|
3
|
+
import { a as B, l as V, s as H, u as fe } from "./api-CtiKFcK3.js";
|
|
4
|
+
import { n as pe, t as me } from "./busy-B189uX--.js";
|
|
5
|
+
import { a as U, i as W, n as he } from "./cloud-B9Sd7V1g.js";
|
|
6
|
+
import { t as ge } from "./dns.js";
|
|
7
|
+
import { t as _e } from "./net.js";
|
|
8
|
+
import { t as ve } from "./dgram.js";
|
|
9
|
+
import { t as G } from "./http.js";
|
|
10
|
+
import { i as ye, n as be, r as K, t as xe } from "./extension-DJQ0oYdk.js";
|
|
11
|
+
import { t as Se } from "./desktop.js";
|
|
12
|
+
import { u as Ce } from "./fs-BvNZePtN.js";
|
|
13
|
+
import { t as we } from "./opfs.js";
|
|
14
|
+
import { t as Te } from "./packages.js";
|
|
15
|
+
import { t as Ee } from "./rooms.js";
|
|
16
|
+
import { t as De } from "./account.js";
|
|
17
|
+
import { t as Oe } from "./connect-button-DtsN3X1J.js";
|
|
18
|
+
import { relay as ke } from "osra";
|
|
19
19
|
//#region src/frame.ts
|
|
20
|
-
var
|
|
21
|
-
if (
|
|
22
|
-
let t, n = setTimeout(() => r(
|
|
23
|
-
clearTimeout(t), clearTimeout(n), a.disconnect(), document.removeEventListener("readystatechange",
|
|
20
|
+
var Ae = 1e4, je = 150, Me = () => new Promise((e) => {
|
|
21
|
+
if (c()) return e(!0);
|
|
22
|
+
let t, n = setTimeout(() => r(c()), Ae), r = (r) => {
|
|
23
|
+
clearTimeout(t), clearTimeout(n), a.disconnect(), document.removeEventListener("readystatechange", o), e(r);
|
|
24
24
|
}, i = () => {
|
|
25
|
-
clearTimeout(t), t = setTimeout(() => r(
|
|
25
|
+
clearTimeout(t), t = setTimeout(() => r(c()), je);
|
|
26
26
|
}, a = new MutationObserver(() => {
|
|
27
|
-
|
|
28
|
-
}),
|
|
29
|
-
document.readyState === "complete" && !
|
|
27
|
+
c() && r(!0);
|
|
28
|
+
}), o = () => {
|
|
29
|
+
document.readyState === "complete" && !c() && 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
|
+
}), Ne = (async (e) => {
|
|
36
|
+
if (A(e) === "window") {
|
|
37
|
+
let t = e;
|
|
38
|
+
return K() ? h(t) : U() ? W(t) : h(t);
|
|
39
|
+
}
|
|
40
|
+
return Pe(e);
|
|
41
|
+
}), Pe = async (e) => K() || e.lockdown || !U() || await Me() ? h(e) : W(e), Fe = "https://fkn.app", Ie = async (e, t) => {
|
|
36
42
|
if (typeof window > "u") throw Error("FKN @fkn/lib: relayWorker must be called from the main thread");
|
|
37
|
-
let n = await
|
|
43
|
+
let n = await fe;
|
|
38
44
|
if (!n) throw Error("FKN @fkn/lib: relayWorker found no FKN transport in this realm");
|
|
39
|
-
let r =
|
|
45
|
+
let r = me("relayed worker");
|
|
40
46
|
t?.unregisterSignal?.aborted ? r() : t?.unregisterSignal?.addEventListener("abort", r, { once: !0 });
|
|
41
47
|
let i = n.emit instanceof MessagePort ? {} : {
|
|
42
|
-
originA: t?.originA ??
|
|
48
|
+
originA: t?.originA ?? Fe,
|
|
43
49
|
originB: t?.originB ?? "*"
|
|
44
50
|
};
|
|
45
|
-
|
|
51
|
+
ke(n, e, {
|
|
46
52
|
key: "fkn-api",
|
|
47
53
|
...i,
|
|
48
54
|
unregisterSignal: t?.unregisterSignal
|
|
49
55
|
});
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
}),
|
|
53
|
-
if (
|
|
54
|
-
for (let e of [...
|
|
56
|
+
}, Le = async () => typeof window > "u" ? !1 : (await B).connect.prompt(location.origin).catch(() => !1), Re = async () => typeof window > "u" ? null : (await B).relay.prompt().catch(() => null), q = /* @__PURE__ */ new Set(), ze = (e) => (q.add(e), () => {
|
|
57
|
+
q.delete(e);
|
|
58
|
+
}), Be = () => {
|
|
59
|
+
if (q.size === 0) return !1;
|
|
60
|
+
for (let e of [...q]) try {
|
|
55
61
|
e();
|
|
56
62
|
} catch {}
|
|
57
63
|
return !0;
|
|
58
|
-
},
|
|
64
|
+
}, Ve = (e, t) => {
|
|
59
65
|
if (typeof e?.onUpdateTaken == "function") return Promise.resolve(e.onUpdateTaken(t));
|
|
60
|
-
},
|
|
61
|
-
applyUpdate: () =>
|
|
62
|
-
busyReasons: () =>
|
|
63
|
-
onUpdate: () =>
|
|
64
|
-
onUpdateTaken: () =>
|
|
65
|
-
updateReady: () =>
|
|
66
|
-
}),
|
|
67
|
-
|
|
68
|
-
for (let e of [...
|
|
66
|
+
}, He = /* @__PURE__ */ e({
|
|
67
|
+
applyUpdate: () => Ye,
|
|
68
|
+
busyReasons: () => Je,
|
|
69
|
+
onUpdate: () => Ge,
|
|
70
|
+
onUpdateTaken: () => Ke,
|
|
71
|
+
updateReady: () => Ue
|
|
72
|
+
}), Ue = async () => typeof window > "u" ? !1 : B.then((e) => e.shell?.updateReady()).then((e) => e === !0).catch(() => !1), J = /* @__PURE__ */ new Set(), Y = !1, We = () => {
|
|
73
|
+
Y = !0;
|
|
74
|
+
for (let e of [...J]) try {
|
|
69
75
|
e();
|
|
70
76
|
} catch {}
|
|
71
|
-
},
|
|
72
|
-
let e =
|
|
73
|
-
|
|
74
|
-
|
|
77
|
+
}, X = 0, Z = () => {
|
|
78
|
+
let e = H();
|
|
79
|
+
e && J.size !== 0 && X !== e.epoch && (X = e.epoch, Y = !1, Promise.resolve(e.remote.shell?.onUpdate(We)).catch(() => {
|
|
80
|
+
X === e.epoch && (X = 0);
|
|
75
81
|
}));
|
|
76
82
|
};
|
|
77
|
-
typeof window < "u" &&
|
|
78
|
-
var
|
|
83
|
+
typeof window < "u" && V(Z);
|
|
84
|
+
var Ge = async (e) => {
|
|
79
85
|
if (typeof window > "u") return () => {};
|
|
80
|
-
if (
|
|
86
|
+
if (J.add(e), Y) try {
|
|
81
87
|
e();
|
|
82
88
|
} catch {}
|
|
83
|
-
return
|
|
84
|
-
|
|
89
|
+
return Z(), () => {
|
|
90
|
+
J.delete(e);
|
|
85
91
|
};
|
|
86
|
-
},
|
|
87
|
-
if (!
|
|
92
|
+
}, Ke = (e) => typeof window > "u" ? () => {} : ze(e), Q = 0, $ = !1, qe = () => {
|
|
93
|
+
if (!Be() && !$) {
|
|
88
94
|
$ = !0;
|
|
89
95
|
try {
|
|
90
96
|
location.reload();
|
|
91
97
|
} catch {}
|
|
92
98
|
}
|
|
93
99
|
};
|
|
94
|
-
typeof window < "u" &&
|
|
95
|
-
let e =
|
|
100
|
+
typeof window < "u" && V(() => {
|
|
101
|
+
let e = H();
|
|
96
102
|
if (!e || Q === e.epoch) return;
|
|
97
103
|
Q = e.epoch;
|
|
98
|
-
let t =
|
|
104
|
+
let t = Ve(e.remote.shell, qe);
|
|
99
105
|
if (!t) {
|
|
100
106
|
Q = 0;
|
|
101
107
|
return;
|
|
@@ -104,6 +110,6 @@ typeof window < "u" && R(() => {
|
|
|
104
110
|
Q === e.epoch && (Q = 0);
|
|
105
111
|
});
|
|
106
112
|
});
|
|
107
|
-
var
|
|
113
|
+
var Je = () => pe(), Ye = async () => typeof window > "u" ? !1 : B.then((e) => e.shell?.applyUpdate()).then((e) => e === !0).catch(() => !1);
|
|
108
114
|
//#endregion
|
|
109
|
-
export {
|
|
115
|
+
export { C as ATTACH_FRAME_EVENT_KEY, a as CATEGORIES, f as EXTENSION_ABI, de as ExtensionOperationUnsupportedError, p as ExtensionOutdatedError, r as FORGEABLE_HEADERS, v as FrameWindowBlockedError, b as FrameWindowRefusedError, i as LOCATOR_DENIED, o as LOCATOR_ERROR, _ as LOCATOR_UNSUPPORTED, F as PERMISSION_DENIED, se as REQUIRED_EXTENSION_ABI, De as account, x as assertAttachableFrameUrl, ae as assertFetchableUrl, ue as assertForgeableHeaders, m as assertLockdownApplicable, l as assertOneCookieIdentity, Ne as attachFrame, j as attachFramePermission, I as box, he as cloud, Le as connect, Oe as connectButtonUrl, T as cookies, D as createFrame, k as createVideoElementHandle, Se as desktop, ve as dgram, ge as dns, xe as extension, be as fetch, s as fetchCredentialedPermission, ee as fetchLocalPermission, re as fetchPermission, Ce as fs, S as gotoPermission, y as handleRevivableModules, le as hasForgedCookie, G as http, u as isBlockedFetchUrl, L as isBlockedFrameUrl, c as isExtensionExposed, z as isLocalNetworkUrl, R as isLocatorDenied, d as isLocatorUnsupported, O as isPermissionDenied, ce as isTerminalError, P as isType, oe as modifyRequestHeadersPermission, _e as net, we as opfs, Te as packages, N as permissions, ye as promptInstall, Re as promptRelay, ie as readCookiePermission, ne as readExtensionHandshake, Ie as relayWorker, E as removeRequestHeaderRule, w as revive, Ee as rooms, M as setMissingExtensionHandler, n as setRequestHeaderRule, He as shell, t as supportsOperation, g as type, te as waitForExtensionExposure };
|