@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/account.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-Djf-XdZ4.cjs");var n=e.t({info:()=>a,login:()=>r,logout:()=>i,onChange:()=>u}),r=async()=>typeof window>`u`?!1:(await t.a).account.login(location.origin).catch(()=>!1),i=async()=>{typeof window<`u`&&await(await t.a).account.logout().catch(()=>{})},a=async()=>{if(typeof window>`u`)return null;let e=await t.a.then(e=>e.account.info()).catch(()=>null);return e?{name:e.name,image:e.image,premium:e.premium,premiumUntil:e.premiumUntil?Date.parse(e.premiumUntil):null}:null},o=new Set,s=()=>{for(let e of[...o])try{e()}catch{}},c=0,l=()=>{let e=t.s();e&&o.size!==0&&c!==e.epoch&&(c=e.epoch,Promise.resolve(e.remote.account.onChange(s)).catch(()=>{c===e.epoch&&(c=0)}))};typeof window<`u`&&t.l(l);var u=async e=>typeof window>`u`?()=>{}:(o.add(e),l(),()=>{o.delete(e)});exports.info=a,exports.login=r,exports.logout=i,exports.onChange=u,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
|
package/account.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare namespace account_d_exports {
|
|
2
2
|
export { AccountInfo, info, login, logout, onChange };
|
|
3
3
|
}
|
|
4
|
-
type AccountInfo = {
|
|
4
|
+
export type AccountInfo = {
|
|
5
5
|
/** the account's display name (a username, not necessarily a real name) */
|
|
6
6
|
name: string;
|
|
7
7
|
/** profile image URL, or null if none is set */
|
|
@@ -11,9 +11,9 @@ type AccountInfo = {
|
|
|
11
11
|
/** when the current subscription lapses, as a ms epoch, or null when not subscribed */
|
|
12
12
|
premiumUntil: number | null;
|
|
13
13
|
};
|
|
14
|
-
declare const login: () => Promise<boolean>;
|
|
15
|
-
declare const logout: () => Promise<void>;
|
|
16
|
-
declare const info: () => Promise<AccountInfo | null>;
|
|
17
|
-
declare const onChange: (callback: () => void) => Promise<() => void>;
|
|
14
|
+
export declare const login: () => Promise<boolean>;
|
|
15
|
+
export declare const logout: () => Promise<void>;
|
|
16
|
+
export declare const info: () => Promise<AccountInfo | null>;
|
|
17
|
+
export declare const onChange: (callback: () => void) => Promise<() => void>;
|
|
18
18
|
//#endregion
|
|
19
|
-
export {
|
|
19
|
+
export { account_d_exports as t };
|
package/account.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { a as t, l as n, s as r } from "./api-
|
|
2
|
+
import { a as t, l as n, s as r } from "./api-CtiKFcK3.js";
|
|
3
3
|
//#region src/account.ts
|
|
4
4
|
var i = /* @__PURE__ */ e({
|
|
5
5
|
info: () => s,
|
|
@@ -7,7 +7,7 @@ var i = /* @__PURE__ */ e({
|
|
|
7
7
|
logout: () => o,
|
|
8
8
|
onChange: () => f
|
|
9
9
|
}), a = async () => typeof window > "u" ? !1 : (await t).account.login(location.origin).catch(() => !1), o = async () => {
|
|
10
|
-
typeof window
|
|
10
|
+
typeof window < "u" && await (await t).account.logout().catch(() => {});
|
|
11
11
|
}, s = async () => {
|
|
12
12
|
if (typeof window > "u") return null;
|
|
13
13
|
let e = await t.then((e) => e.account.info()).catch(() => null);
|
|
@@ -23,7 +23,7 @@ var i = /* @__PURE__ */ e({
|
|
|
23
23
|
} catch {}
|
|
24
24
|
}, u = 0, d = () => {
|
|
25
25
|
let e = r();
|
|
26
|
-
|
|
26
|
+
e && c.size !== 0 && u !== e.epoch && (u = e.epoch, Promise.resolve(e.remote.account.onChange(l)).catch(() => {
|
|
27
27
|
u === e.epoch && (u = 0);
|
|
28
28
|
}));
|
|
29
29
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as TcpSocketOption, v as UdpSocketOption } from "./wire-Gbo-D74t.js";
|
|
2
|
-
import {
|
|
2
|
+
import { B as Resolvers, C as IpFamily, G as RoomEvent, I as ProxyFetchInit, J as RoomMailbox, L as ProxyFetchInput, N as PickOptions, O as OverlayState, P as Placement, Q as RoomPermission, Z as RoomOpenOptions, _ as FrameConsentAnswer, _t as UdpDatagram, c as ConflictChoice, d as ConnectAvailability, et as RoomsErrorCode, f as ConnectOptions, ht as TcpSocketOptions, j as PackagesErrorCode, k as PackageQuery, l as ConflictRequest, o as AdoptRequest, pt as TcpSocketListenerOptions, q as RoomJoinOptions, s as AdoptState, v as FrameConsentRequest, vt as UdpSocketOptions, wt as WriteData, x as InstallOptions } from "./contract-D37GGkou.js";
|
|
3
3
|
import { Remote } from "osra";
|
|
4
4
|
//#region src/api-epochs.d.ts
|
|
5
5
|
type EpochListener<T> = (remote: T, epoch: number) => void;
|
|
@@ -164,6 +164,7 @@ declare const onApiEpoch: (listener: EpochListener<{
|
|
|
164
164
|
};
|
|
165
165
|
frameConsent: {
|
|
166
166
|
ensure: (request: FrameConsentRequest) => Promise<boolean>;
|
|
167
|
+
request: (requests: FrameConsentRequest[]) => Promise<FrameConsentAnswer[]>;
|
|
167
168
|
};
|
|
168
169
|
connect: {
|
|
169
170
|
prompt: (consumerOrigin: string) => Promise<boolean>;
|
|
@@ -876,6 +877,7 @@ declare const currentApiEpoch: () => {
|
|
|
876
877
|
};
|
|
877
878
|
frameConsent: {
|
|
878
879
|
ensure: (request: FrameConsentRequest) => Promise<boolean>;
|
|
880
|
+
request: (requests: FrameConsentRequest[]) => Promise<FrameConsentAnswer[]>;
|
|
879
881
|
};
|
|
880
882
|
connect: {
|
|
881
883
|
prompt: (consumerOrigin: string) => Promise<boolean>;
|
|
@@ -97,13 +97,13 @@ var t = 1e4, n = 16, r = (e) => {
|
|
|
97
97
|
}
|
|
98
98
|
let a = g(n, t, i), o = a === "none" || CSS.supports("clip-path", a) ? a : "inset(100%)";
|
|
99
99
|
e.style.setProperty("clip-path", o, "important"), ie(t || o !== a ? null : _(n));
|
|
100
|
-
},
|
|
100
|
+
}, oe = (e) => {
|
|
101
101
|
if (typeof e != "object" || !e) return 0;
|
|
102
102
|
let { top: t } = e;
|
|
103
103
|
return typeof t != "number" || !Number.isFinite(t) || t <= 0 ? 0 : Math.min(Math.round(t), s);
|
|
104
|
-
},
|
|
105
|
-
if (
|
|
106
|
-
},
|
|
104
|
+
}, se = (e) => {
|
|
105
|
+
if (Array.isArray(e) && e.length === 4 && e.every((e) => typeof e == "number" && Number.isFinite(e) && e >= 0)) return e.some((e) => e > 0) ? e : void 0;
|
|
106
|
+
}, ce = (e, t) => {
|
|
107
107
|
if (typeof e != "object" || !e) return null;
|
|
108
108
|
let { x: n, y: r, width: i, height: a } = e;
|
|
109
109
|
if (![
|
|
@@ -112,7 +112,7 @@ var t = 1e4, n = 16, r = (e) => {
|
|
|
112
112
|
i,
|
|
113
113
|
a
|
|
114
114
|
].every((e) => typeof e == "number" && Number.isFinite(e))) return null;
|
|
115
|
-
let o = t.width, s = t.height, c = Math.max(0, Math.min(Math.round(n), o)), l = Math.max(0, Math.min(Math.round(r), s)), u = Math.max(c, Math.min(Math.round(n + i), o)), d = Math.max(l, Math.min(Math.round(r + a), s)), f =
|
|
115
|
+
let o = t.width, s = t.height, c = Math.max(0, Math.min(Math.round(n), o)), l = Math.max(0, Math.min(Math.round(r), s)), u = Math.max(c, Math.min(Math.round(n + i), o)), d = Math.max(l, Math.min(Math.round(r + a), s)), f = se(e.radius);
|
|
116
116
|
return {
|
|
117
117
|
x: c,
|
|
118
118
|
y: l,
|
|
@@ -120,49 +120,64 @@ var t = 1e4, n = 16, r = (e) => {
|
|
|
120
120
|
height: d - l,
|
|
121
121
|
...f ? { radius: f } : {}
|
|
122
122
|
};
|
|
123
|
-
},
|
|
123
|
+
}, E = {
|
|
124
124
|
"not-rendered": "this page is not painting it at all, so it or an ancestor is display:none, or the frame was moved out of the layout",
|
|
125
125
|
clipped: "it is clipped away or positioned outside the viewport",
|
|
126
126
|
"not-shown": "it is rendered but would not be seen, so either something is drawn over it, or it or an ancestor has opacity below 1, visibility:hidden, or a filter"
|
|
127
|
-
},
|
|
127
|
+
}, le = (e) => Array.isArray(e) ? e.slice(0, o).flatMap((e) => {
|
|
128
128
|
if (typeof e != "object" || !e) return [];
|
|
129
129
|
let { kind: t, cause: n, level: r } = e;
|
|
130
|
-
return typeof t != "string" || t.length > 40 || typeof n != "string" || !(n in
|
|
130
|
+
return typeof t != "string" || t.length > 40 || typeof n != "string" || !(n in E) || r !== "full" && r !== "liveness" ? [] : [{
|
|
131
131
|
kind: t,
|
|
132
132
|
cause: n,
|
|
133
133
|
level: r
|
|
134
134
|
}];
|
|
135
|
-
}) : [],
|
|
136
|
-
for (let { kind: t, cause: n, level: r } of e)
|
|
135
|
+
}) : [], D = /* @__PURE__ */ new Set(), ue = (e) => {
|
|
136
|
+
for (let { kind: t, cause: n, level: r } of e) D.has(t) || (D.add(t), console.error(`[FKN] The FKN ${JSON.stringify(t)} is not visible on this page: ${E[n]}. Nobody using this page can see or answer it.
|
|
137
137
|
@fkn/lib draws its UI inside <iframe title="FKN"> and sets display, position, top, left, width, height, border, padding, box-sizing, clip-path and z-index on that element. Leave those as they are, then check for an ancestor with opacity, visibility, display or a clipping transform, and for an element stacked above it.` + (r === "liveness" ? "\nThis browser reports limited detail, so the cause above is a best guess." : "")));
|
|
138
|
-
},
|
|
138
|
+
}, O = (e, t) => {
|
|
139
139
|
if (typeof e != "object" || !e) return null;
|
|
140
|
-
let n = e, r = (Array.isArray(n.rects) ? n.rects.slice(0, a) : []).map((e) =>
|
|
140
|
+
let n = e, r = (Array.isArray(n.rects) ? n.rects.slice(0, a) : []).map((e) => ce(e, t)).filter((e) => e !== null && e.width > 0 && e.height > 0);
|
|
141
141
|
return {
|
|
142
142
|
modal: n.modal === !0,
|
|
143
143
|
rects: r,
|
|
144
|
-
hidden:
|
|
145
|
-
inset:
|
|
144
|
+
hidden: le(n.hidden),
|
|
145
|
+
inset: oe(n.inset)
|
|
146
146
|
};
|
|
147
|
-
},
|
|
148
|
-
if (!b ||
|
|
149
|
-
let e = S(b), t = A
|
|
147
|
+
}, k = () => b !== null, A = null, j = null, M = () => {
|
|
148
|
+
if (!b || A === null) return;
|
|
149
|
+
let e = S(b), t = O(A, e);
|
|
150
150
|
t && T(b, t, e);
|
|
151
|
+
}, N = (e) => {
|
|
152
|
+
typeof ResizeObserver < "u" && (j ??= new ResizeObserver(M), j.disconnect(), j.observe(e));
|
|
151
153
|
}, P = (e) => {
|
|
152
|
-
typeof ResizeObserver > "u" || (M ??= new ResizeObserver(N), M.disconnect(), M.observe(e));
|
|
153
|
-
}, F = (e) => {
|
|
154
154
|
u(e), T(e, {
|
|
155
155
|
modal: !1,
|
|
156
156
|
rects: [],
|
|
157
157
|
hidden: [],
|
|
158
158
|
inset: 0
|
|
159
|
-
}, S(e)), b = e,
|
|
160
|
-
},
|
|
159
|
+
}, S(e)), b = e, N(e);
|
|
160
|
+
}, F = (e) => {
|
|
161
161
|
if (!b) return;
|
|
162
|
-
let t = S(b), n =
|
|
163
|
-
n && (
|
|
164
|
-
},
|
|
165
|
-
|
|
162
|
+
let t = S(b), n = O(e, t);
|
|
163
|
+
n && (A = e, T(b, n, t), ue(n.hidden));
|
|
164
|
+
}, I = [
|
|
165
|
+
"fkn.app",
|
|
166
|
+
"fkn.dev",
|
|
167
|
+
"sdbx.app"
|
|
168
|
+
], L = (e) => e.replace(/\.+$/, ""), R = (e) => {
|
|
169
|
+
let t = L(e);
|
|
170
|
+
return I.some((e) => t === e || t.endsWith(`.${e}`));
|
|
171
|
+
}, z = (e) => {
|
|
172
|
+
let t = typeof e == "string" ? e : e instanceof URL ? e.href : e.url, n;
|
|
173
|
+
try {
|
|
174
|
+
n = new URL(t);
|
|
175
|
+
} catch {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (R(n.hostname)) throw Error(`fetch refuses FKN platform domains (${n.hostname})`);
|
|
179
|
+
}, B = /* @__PURE__ */ "autoplay.fullscreen.picture-in-picture.encrypted-media.screen-wake-lock.speaker-selection.captured-surface-control.camera.microphone.display-capture.geolocation.midi.usb.serial.hid.bluetooth.gamepad.keyboard-map.xr-spatial-tracking.accelerometer.gyroscope.magnetometer.ambient-light-sensor.compute-pressure.clipboard-read.clipboard-write.storage-access.window-management.local-fonts.idle-detection.web-share.sync-xhr.unload.payment.publickey-credentials-get.publickey-credentials-create.otp-credentials.identity-credentials-get.digital-credentials-get.local-network.local-network-access.loopback-network".split("."), V = (e = !0) => [...B, ...e ? ["cross-origin-isolated"] : []].join("; "), H = "https://fkn.app", U = typeof globalThis < "u" && globalThis.document ? globalThis.document : void 0, W = typeof globalThis < "u" && globalThis.crossOriginIsolated === !0, G = `${H}/api${W ? "?coi=1" : ""}`, de = "fkn-api-port", fe = "fkn-api-port-ack", pe = 2e3, me = () => {
|
|
180
|
+
if (!U || typeof window > "u" || window.parent === window) return Promise.resolve(void 0);
|
|
166
181
|
let e;
|
|
167
182
|
try {
|
|
168
183
|
e = window.parent;
|
|
@@ -177,32 +192,32 @@ var t = 1e4, n = 16, r = (e) => {
|
|
|
177
192
|
} catch {}
|
|
178
193
|
n(e);
|
|
179
194
|
}, i = (e) => {
|
|
180
|
-
e.data?.type ===
|
|
181
|
-
}, a = setTimeout(() => r(void 0),
|
|
195
|
+
e.data?.type === fe && r(t.port1);
|
|
196
|
+
}, a = setTimeout(() => r(void 0), pe);
|
|
182
197
|
t.port1.addEventListener("message", i), t.port1.start();
|
|
183
198
|
try {
|
|
184
|
-
e.postMessage({ type:
|
|
199
|
+
e.postMessage({ type: de }, H, [t.port2]);
|
|
185
200
|
} catch {
|
|
186
201
|
r(void 0);
|
|
187
202
|
}
|
|
188
203
|
});
|
|
189
|
-
},
|
|
190
|
-
if (K || !
|
|
191
|
-
let e =
|
|
204
|
+
}, K, he = () => {
|
|
205
|
+
if (K || !U) return K;
|
|
206
|
+
let e = U.querySelector(`iframe[src="${G}"]`);
|
|
192
207
|
if (e) K = e;
|
|
193
208
|
else {
|
|
194
|
-
let e =
|
|
195
|
-
e.setAttribute("allow",
|
|
209
|
+
let e = U.createElement("iframe");
|
|
210
|
+
e.setAttribute("allow", V(W)), e.src = G, U.body.appendChild(e), K = e;
|
|
196
211
|
}
|
|
197
|
-
return
|
|
212
|
+
return P(K), K;
|
|
198
213
|
}, q = (async () => {
|
|
199
|
-
if (!
|
|
200
|
-
let e = await
|
|
214
|
+
if (!U) return;
|
|
215
|
+
let e = await me();
|
|
201
216
|
if (e) return {
|
|
202
217
|
receive: e,
|
|
203
218
|
emit: e
|
|
204
219
|
};
|
|
205
|
-
let t =
|
|
220
|
+
let t = he();
|
|
206
221
|
if (!t) return;
|
|
207
222
|
await i(t);
|
|
208
223
|
let n = t.contentWindow;
|
|
@@ -210,7 +225,7 @@ var t = 1e4, n = 16, r = (e) => {
|
|
|
210
225
|
receive: window,
|
|
211
226
|
emit: n
|
|
212
227
|
} : void 0;
|
|
213
|
-
})(),
|
|
228
|
+
})(), ge = (e) => {
|
|
214
229
|
let t, n = () => {}, r = new Promise((e) => {
|
|
215
230
|
n = e;
|
|
216
231
|
}), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), o = 0, s = 0;
|
|
@@ -279,14 +294,14 @@ var t = 1e4, n = 16, r = (e) => {
|
|
|
279
294
|
lastCall: () => o,
|
|
280
295
|
inFlight: () => s
|
|
281
296
|
};
|
|
282
|
-
},
|
|
297
|
+
}, _e = typeof window < "u" || typeof self < "u", ve = async () => {
|
|
283
298
|
if (typeof window < "u") return q;
|
|
284
299
|
if (typeof self < "u") return {
|
|
285
300
|
receive: self,
|
|
286
301
|
emit: self
|
|
287
302
|
};
|
|
288
|
-
}, J =
|
|
289
|
-
let t = await
|
|
303
|
+
}, J = ge({ async *[Symbol.asyncIterator]() {
|
|
304
|
+
let t = await ve();
|
|
290
305
|
if (!t) {
|
|
291
306
|
await new Promise(() => {});
|
|
292
307
|
return;
|
|
@@ -295,18 +310,18 @@ var t = 1e4, n = 16, r = (e) => {
|
|
|
295
310
|
key: "fkn-api",
|
|
296
311
|
transport: t
|
|
297
312
|
});
|
|
298
|
-
} }), Y = J.first.then(() => J.facade), X = 8e3,
|
|
313
|
+
} }), Y = J.first.then(() => J.facade), X = 8e3, ye = 1e3, Z = !1, Q = class extends Error {
|
|
299
314
|
constructor(e, t) {
|
|
300
315
|
super(`@fkn/lib: no broker connection within ${t}ms, so ${e} could not be requested`), this.name = "BrokerUnreachableError";
|
|
301
316
|
}
|
|
302
|
-
},
|
|
303
|
-
let t = Z ?
|
|
317
|
+
}, be = (e) => {
|
|
318
|
+
let t = Z ? ye : X;
|
|
304
319
|
return Promise.race([Y, new Promise((n, r) => setTimeout(() => {
|
|
305
320
|
Z = !0, r(new Q(e, t));
|
|
306
321
|
}, t))]);
|
|
307
|
-
}, $ = J.onEpoch,
|
|
322
|
+
}, $ = J.onEpoch, xe = J.current, Se = J.lastCall, Ce = J.inFlight;
|
|
308
323
|
$((e) => {
|
|
309
|
-
|
|
324
|
+
k() && e.overlay.setHost(F, { exactClips: f() }).catch(() => {});
|
|
310
325
|
});
|
|
311
326
|
//#endregion
|
|
312
|
-
export { Y as a,
|
|
327
|
+
export { Y as a, _e as c, z as d, Se as i, $ as l, Q as n, be as o, Ce as r, xe as s, X as t, q as u };
|
package/api-Djf-XdZ4.cjs
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
let e=require("osra");var t=1e4,n=16,r=e=>{let t;try{t=e.contentWindow}catch{return!0}if(!t)return!0;try{let e=t.location.href;return e!==``&&e!==`about:blank`}catch{return!0}},i=(e,i=t)=>new Promise(t=>{if(r(e))return t();let a=()=>{clearInterval(o),clearTimeout(s),e.removeEventListener(`load`,a),t()},o=setInterval(()=>{r(e)&&a()},n),s=setTimeout(a,i);e.addEventListener(`load`,a)}),a=32,o=8,s=120,c=typeof CSS<`u`&&CSS.supports(`clip-path`,`path('M0 0H1V1H0Z')`),l=typeof CSS<`u`&&CSS.supports(`clip-path`,`polygon(nonzero, 0px 0px, 1px 0px, 1px 1px)`),u=e=>{let t=e.style;t.setProperty(`display`,`block`,`important`),t.setProperty(`position`,`fixed`,`important`),t.setProperty(`top`,`0`,`important`),t.setProperty(`left`,`0`,`important`),t.setProperty(`width`,`100%`,`important`),t.setProperty(`height`,`100%`,`important`),t.setProperty(`border`,`none`,`important`),t.setProperty(`padding`,`0`,`important`),t.setProperty(`box-sizing`,`border-box`,`important`),t.setProperty(`clip-path`,`inset(100%)`,`important`),t.setProperty(`background`,`transparent`),t.setProperty(`color-scheme`,`normal`),t.setProperty(`z-index`,`2147483647`),e.setAttribute(`title`,`FKN`)},d=({x:e,y:t,width:n,height:r,radius:i})=>{if(!i)return`M${e} ${t}h${n}v${r}h${-n}Z`;let a=Math.min(n,r)/2,[o,s,c,l]=i.map(e=>Math.max(0,Math.min(e,a)));return`M${e+o} ${t}h${n-o-s}a${s} ${s} 0 0 1 ${s} ${s}v${r-s-c}a${c} ${c} 0 0 1 ${-c} ${c}h${-(n-c-l)}a${l} ${l} 0 0 1 ${-l} ${-l}v${-(r-l-o)}a${o} ${o} 0 0 1 ${o} ${-o}Z`},f=()=>c&&l,p=({x:e,y:t,width:n,height:r})=>[[e,t],[e+n,t],[e+n,t+r],[e,t+r],[e,t]],ee=e=>{let t=e[0];if(!t)return[];let n=p(t)[0],r=[];return e.forEach((t,i)=>{r.push(...p(t)),i>0&&i<e.length-1&&r.push(n)}),r},m=e=>`polygon(nonzero, ${ee(e).map(([e,t])=>`${e}px ${t}px`).join(`, `)})`,h=({x:e,y:t,width:n,height:r,radius:i},a)=>{let o=`${t}px ${a.width-e-n}px ${a.height-t-r}px ${e}px`;return i?`inset(${o} round ${i.map(e=>`${e}px`).join(` `)})`:`inset(${o})`},g=(e,t,n)=>{if(t)return`none`;if(e.length===0)return`inset(100%)`;let r=e.length===1?e[0]:void 0;return r?h(r,n):l&&e.length<=5&&!e.some(e=>e.radius)?m(e):`path('${e.map(d).join(``)}')`},_=e=>{if(e.length<2)return null;let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y));return{x:t,y:n,width:Math.max(...e.map(e=>e.x+e.width))-t,height:Math.max(...e.map(e=>e.y+e.height))-n}},te=(e,t,n)=>t>=e.x&&t<e.x+e.width&&n>=e.y&&n<e.y+e.height,ne=16,v=(e,t,n)=>t===1?e*ne:t===2?e*n:e,y=(e,t,n)=>{let r=getComputedStyle(e);return n!==0&&/auto|scroll/.test(r.overflowY)&&e.scrollHeight>e.clientHeight?!0:t!==0&&/auto|scroll/.test(r.overflowX)&&e.scrollWidth>e.clientWidth},re=(e,t,n)=>{for(let r=e;r;r=r.parentElement)if(y(r,t,n))return r;return document.scrollingElement},b=null,x=null,S=e=>({width:e.offsetWidth||window.innerWidth,height:e.offsetHeight||window.innerHeight}),C=e=>{if(!x||!b||!te(x,e.clientX,e.clientY))return;let t=document.elementFromPoint(e.clientX,e.clientY);if(!t||t===b)return;let n=v(e.deltaX,e.deltaMode,window.innerWidth),r=v(e.deltaY,e.deltaMode,window.innerHeight),i=re(t,n,r);i&&(i.scrollBy({left:n,top:r,behavior:`instant`}),e.cancelable&&e.preventDefault())},ie=e=>{let t=x!==null;x=e,t!==(e!==null)&&(e?window.addEventListener(`wheel`,C,{capture:!0,passive:!1}):window.removeEventListener(`wheel`,C,{capture:!0}))},w=0,ae=e=>{if(e===w)return;w=e;let t=document.documentElement.style;e>0?(t.setProperty(`margin-top`,`${e}px`,`important`),t.setProperty(`--fkn-inset-top`,`${e}px`)):(t.removeProperty(`margin-top`),t.removeProperty(`--fkn-inset-top`))},T=(e,{modal:t,rects:n,inset:r},i)=>{if(ae(r),!c){let r=t||n.length>0;e.style.setProperty(`pointer-events`,r?`auto`:`none`,`important`),e.style.setProperty(`visibility`,r?`visible`:`hidden`,`important`);return}let a=g(n,t,i),o=a===`none`||CSS.supports(`clip-path`,a)?a:`inset(100%)`;e.style.setProperty(`clip-path`,o,`important`),ie(t||o!==a?null:_(n))},oe=e=>{if(typeof e!=`object`||!e)return 0;let{top:t}=e;return typeof t!=`number`||!Number.isFinite(t)||t<=0?0:Math.min(Math.round(t),s)},se=e=>{if(Array.isArray(e)&&e.length===4&&e.every(e=>typeof e==`number`&&Number.isFinite(e)&&e>=0))return e.some(e=>e>0)?e:void 0},ce=(e,t)=>{if(typeof e!=`object`||!e)return null;let{x:n,y:r,width:i,height:a}=e;if(![n,r,i,a].every(e=>typeof e==`number`&&Number.isFinite(e)))return null;let o=t.width,s=t.height,c=Math.max(0,Math.min(Math.round(n),o)),l=Math.max(0,Math.min(Math.round(r),s)),u=Math.max(c,Math.min(Math.round(n+i),o)),d=Math.max(l,Math.min(Math.round(r+a),s)),f=se(e.radius);return{x:c,y:l,width:u-c,height:d-l,...f?{radius:f}:{}}},E={"not-rendered":`this page is not painting it at all, so it or an ancestor is display:none, or the frame was moved out of the layout`,clipped:`it is clipped away or positioned outside the viewport`,"not-shown":`it is rendered but would not be seen, so either something is drawn over it, or it or an ancestor has opacity below 1, visibility:hidden, or a filter`},le=e=>Array.isArray(e)?e.slice(0,o).flatMap(e=>{if(typeof e!=`object`||!e)return[];let{kind:t,cause:n,level:r}=e;return typeof t!=`string`||t.length>40||typeof n!=`string`||!(n in E)||r!==`full`&&r!==`liveness`?[]:[{kind:t,cause:n,level:r}]}):[],D=new Set,ue=e=>{for(let{kind:t,cause:n,level:r}of e)D.has(t)||(D.add(t),console.error(`[FKN] The FKN ${JSON.stringify(t)} is not visible on this page: ${E[n]}. Nobody using this page can see or answer it.
|
|
2
|
+
@fkn/lib draws its UI inside <iframe title="FKN"> and sets display, position, top, left, width, height, border, padding, box-sizing, clip-path and z-index on that element. Leave those as they are, then check for an ancestor with opacity, visibility, display or a clipping transform, and for an element stacked above it.`+(r===`liveness`?`
|
|
3
|
+
This browser reports limited detail, so the cause above is a best guess.`:``)))},O=(e,t)=>{if(typeof e!=`object`||!e)return null;let n=e,r=(Array.isArray(n.rects)?n.rects.slice(0,a):[]).map(e=>ce(e,t)).filter(e=>e!==null&&e.width>0&&e.height>0);return{modal:n.modal===!0,rects:r,hidden:le(n.hidden),inset:oe(n.inset)}},k=()=>b!==null,A=null,j=null,M=()=>{if(!b||A===null)return;let e=S(b),t=O(A,e);t&&T(b,t,e)},N=e=>{typeof ResizeObserver<`u`&&(j??=new ResizeObserver(M),j.disconnect(),j.observe(e))},P=e=>{u(e),T(e,{modal:!1,rects:[],hidden:[],inset:0},S(e)),b=e,N(e)},F=e=>{if(!b)return;let t=S(b),n=O(e,t);n&&(A=e,T(b,n,t),ue(n.hidden))},I=[`fkn.app`,`fkn.dev`,`sdbx.app`],L=e=>e.replace(/\.+$/,``),R=e=>{let t=L(e);return I.some(e=>t===e||t.endsWith(`.${e}`))},z=e=>{let t=typeof e==`string`?e:e instanceof URL?e.href:e.url,n;try{n=new URL(t)}catch{return}if(R(n.hostname))throw Error(`fetch refuses FKN platform domains (${n.hostname})`)},B=`autoplay.fullscreen.picture-in-picture.encrypted-media.screen-wake-lock.speaker-selection.captured-surface-control.camera.microphone.display-capture.geolocation.midi.usb.serial.hid.bluetooth.gamepad.keyboard-map.xr-spatial-tracking.accelerometer.gyroscope.magnetometer.ambient-light-sensor.compute-pressure.clipboard-read.clipboard-write.storage-access.window-management.local-fonts.idle-detection.web-share.sync-xhr.unload.payment.publickey-credentials-get.publickey-credentials-create.otp-credentials.identity-credentials-get.digital-credentials-get.local-network.local-network-access.loopback-network`.split(`.`),V=(e=!0)=>[...B,...e?[`cross-origin-isolated`]:[]].join(`; `),H=`https://fkn.app`,U=typeof globalThis<`u`&&globalThis.document?globalThis.document:void 0,W=typeof globalThis<`u`&&globalThis.crossOriginIsolated===!0,G=`${H}/api${W?`?coi=1`:``}`,de=`fkn-api-port`,fe=`fkn-api-port-ack`,pe=2e3,me=()=>{if(!U||typeof window>`u`||window.parent===window)return Promise.resolve(void 0);let e;try{e=window.parent}catch{return Promise.resolve(void 0)}let t=new MessageChannel;return new Promise(n=>{let r=e=>{if(clearTimeout(a),t.port1.removeEventListener(`message`,i),!e)try{t.port1.close()}catch{}n(e)},i=e=>{e.data?.type===fe&&r(t.port1)},a=setTimeout(()=>r(void 0),pe);t.port1.addEventListener(`message`,i),t.port1.start();try{e.postMessage({type:de},H,[t.port2])}catch{r(void 0)}})},K,he=()=>{if(K||!U)return K;let e=U.querySelector(`iframe[src="${G}"]`);if(e)K=e;else{let e=U.createElement(`iframe`);e.setAttribute(`allow`,V(W)),e.src=G,U.body.appendChild(e),K=e}return P(K),K},q=(async()=>{if(!U)return;let e=await me();if(e)return{receive:e,emit:e};let t=he();if(!t)return;await i(t);let n=t.contentWindow;return n?{receive:window,emit:n}:void 0})(),ge=e=>{let t,n=()=>{},r=new Promise(e=>{n=e}),i=new Set,a=new Set,o=0,s=0;(async()=>{for await(let r of e){let e=(t?.epoch??0)+1;t={remote:r,epoch:e},e===1&&n(r);let o=[...a];a.clear();let s=Error(`FKN: the broker was replaced while this call was pending; retry it`);for(let e of o)try{e(s)}catch{}for(let t of[...i])try{t(r,e)}catch{}}})().catch(()=>{});let c=async(e,n)=>{let i=t?.remote??await r;for(let t of e.slice(0,-1))i=i[t];let c=i[e[e.length-1]??``];o=Date.now(),s+=1;let l=()=>{},u=new Promise((e,t)=>{l=t});a.add(l);try{return await Promise.race([Promise.resolve(c.apply(i,n)),u])}finally{--s,a.delete(l),o=Date.now()}},l=new Map,u=e=>{let n=e.join(`\0`),r=l.get(n);if(r)return r;let i=new Proxy(function(){},{get:(n,r)=>{if(typeof r!=`string`||r===`then`)return;let i=t;if(i){let t=i.remote;for(let n of e)t=t?.[n];if(t?.[r]===void 0)return}return u([...e,r])},apply:(t,n,r)=>c(e,r)});return l.set(n,i),i};return{facade:u([]),first:r.then(()=>{}),current:()=>t,onEpoch:e=>{if(i.add(e),t)try{e(t.remote,t.epoch)}catch{}return()=>{i.delete(e)}},lastCall:()=>o,inFlight:()=>s}},_e=typeof window<`u`||typeof self<`u`,ve=async()=>{if(typeof window<`u`)return q;if(typeof self<`u`)return{receive:self,emit:self}},J=ge({async*[Symbol.asyncIterator](){let t=await ve();if(!t){await new Promise(()=>{});return}yield*(0,e.expose)({},{key:`fkn-api`,transport:t})}}),Y=J.first.then(()=>J.facade),X=8e3,ye=1e3,Z=!1,Q=class extends Error{constructor(e,t){super(`@fkn/lib: no broker connection within ${t}ms, so ${e} could not be requested`),this.name=`BrokerUnreachableError`}},be=e=>{let t=Z?ye:X;return Promise.race([Y,new Promise((n,r)=>setTimeout(()=>{Z=!0,r(new Q(e,t))},t))])},$=J.onEpoch,xe=J.current,Se=J.lastCall,Ce=J.inFlight;$(e=>{k()&&e.overlay.setHost(F,{exactClips:f()}).catch(()=>{})}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return q}});
|
package/api.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./api-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./api-Djf-XdZ4.cjs");exports.API_DEADLINE_MS=e.t,exports.BrokerUnreachableError=e.n,exports.apiInFlight=e.r,exports.apiLastCall=e.i,exports.apiPromise=e.a,exports.apiWithin=e.o,exports.currentApiEpoch=e.s,exports.hasTransport=e.c,exports.onApiEpoch=e.l;
|
package/api.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as apiPromise, c as hasTransport, i as apiLastCall, l as onApiEpoch, n as BrokerUnreachableError, o as apiWithin, r as apiInFlight, s as currentApiEpoch, t as API_DEADLINE_MS } from "./api-
|
|
1
|
+
import { B as Resolvers } from "./contract-D37GGkou.js";
|
|
2
|
+
import { a as apiPromise, c as hasTransport, i as apiLastCall, l as onApiEpoch, n as BrokerUnreachableError, o as apiWithin, r as apiInFlight, s as currentApiEpoch, t as API_DEADLINE_MS } from "./api-CfmRAze5.js";
|
|
3
3
|
export { API_DEADLINE_MS, BrokerUnreachableError, type Resolvers, apiInFlight, apiLastCall, apiPromise, apiWithin, currentApiEpoch, hasTransport, onApiEpoch };
|
package/api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./api-
|
|
1
|
+
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./api-CtiKFcK3.js";
|
|
2
2
|
export { c as API_DEADLINE_MS, i as BrokerUnreachableError, o as apiInFlight, n as apiLastCall, e as apiPromise, a as apiWithin, s as currentApiEpoch, t as hasTransport, r as onApiEpoch };
|
package/attach-policy.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./hosts-DD4rDeQH.cjs");var t=(t,n,{classifier:r=`no-base`}={})=>{if(!t.session)return{kind:`refuse`,reason:`frame.fetch on the cloud backend needs its own session: attach with syncCookies: false`};if(typeof n!=`string`)return{kind:`refuse`,reason:`frame.fetch: url must be a string`};let i;try{i=new URL(n)}catch{return{kind:`refuse`,reason:`frame.fetch on the cloud backend needs an absolute url`}}if(r===`fetchTarget`&&e.c(n).kind!==`absolute`)return{kind:`refuse`,reason:`frame.fetch on the cloud backend needs an absolute url`};if(i.protocol!==`https:`&&i.protocol!==`http:`)return{kind:`refuse`,reason:`frame.fetch: only http(s) urls are supported`};if(!(t.declaredHosts.includes(i.hostname)||t.approvedOrigins.has(i.origin)))return{kind:`refuse`,reason:`frame.fetch: the target is outside the origins this attachment declared`};let a=t.declaredHosts.length?t.declaredHosts:[i.hostname];return{kind:`consent`,targetHost:i.hostname,promptHosts:a}};exports.frameFetchVerdict=t,exports.normalizeDeclaredHosts=e.t;
|
package/attach-policy.d.ts
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
//#region ../web-extension/lib/permission/shared/hosts.d.ts
|
|
2
|
+
/** What `normalizeHosts` keeps beyond a bare hostname. */
|
|
3
|
+
type NormalizeHostsOptions = {
|
|
4
|
+
/**
|
|
5
|
+
* Keep a bracketed IPv6 literal, in the canonical form `URL.hostname` reports, because that is
|
|
6
|
+
* the value a document or a fetch is compared against. Off by default: only the extension's own
|
|
7
|
+
* callers pass it, so the cloud's declared hosts (`normalizeDeclaredHosts`) stay what they were.
|
|
8
|
+
*/
|
|
9
|
+
ipv6?: boolean;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Bare hostnames only: lowercase, no scheme, no port, no path, deduped in first-seen order, plus a
|
|
13
|
+
* bracketed IPv6 literal when `ipv6` is set. Anything else is dropped rather than repaired, so a
|
|
14
|
+
* malformed declaration narrows the app's reach instead of widening it. The sheet, the cloud card
|
|
15
|
+
* and the middle page all run this one function.
|
|
16
|
+
*/
|
|
17
|
+
declare const normalizeHosts: (raw: readonly string[], { ipv6 }?: NormalizeHostsOptions) => string[];
|
|
18
|
+
//#endregion
|
|
1
19
|
//#region src/attach-policy.d.ts
|
|
2
20
|
/**
|
|
3
21
|
* The pure half of the middle page's frame.fetch gate: everything that can be decided from the
|
|
@@ -9,7 +27,7 @@
|
|
|
9
27
|
* `locatorDeniedError`), or the shared dispatch loop retries them to its 30 second deadline and
|
|
10
28
|
* reports a timeout that names neither the operation nor the reason.
|
|
11
29
|
*/
|
|
12
|
-
type FrameFetchPolicy = {
|
|
30
|
+
export type FrameFetchPolicy = {
|
|
13
31
|
/** '' means the shared render-proxy jar; non-empty is an isolated per-attach session */
|
|
14
32
|
session: string;
|
|
15
33
|
/** bare hostnames the app declared at attach; matched on hostname alone, any scheme or port */
|
|
@@ -17,7 +35,7 @@ type FrameFetchPolicy = {
|
|
|
17
35
|
/** exact origins this attachment has legitimately visited: the attach url plus every goto target */
|
|
18
36
|
approvedOrigins: ReadonlySet<string>;
|
|
19
37
|
};
|
|
20
|
-
type FrameFetchVerdict = {
|
|
38
|
+
export type FrameFetchVerdict = {
|
|
21
39
|
kind: 'refuse';
|
|
22
40
|
reason: string;
|
|
23
41
|
} | {
|
|
@@ -26,10 +44,17 @@ type FrameFetchVerdict = {
|
|
|
26
44
|
promptHosts: string[];
|
|
27
45
|
};
|
|
28
46
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
47
|
+
* How a fetch url is read.
|
|
48
|
+
*
|
|
49
|
+
* `'no-base'` is `new URL(url)`, which accepts the two base-dependent forms `https:h/x` and
|
|
50
|
+
* `http:h/x` as if they named `h`. `'fetchTarget'` is the shared classifier, which calls those
|
|
51
|
+
* relative and refuses them here. The middle page keeps `'no-base'` until the contract deploy, so
|
|
52
|
+
* an application on an older library is refused nothing it was not refused before; the library's
|
|
53
|
+
* own gate passes `'fetchTarget'`.
|
|
31
54
|
*/
|
|
32
|
-
|
|
33
|
-
declare const frameFetchVerdict: (policy: FrameFetchPolicy, url: unknown
|
|
55
|
+
export type FrameFetchClassifier = 'no-base' | 'fetchTarget';
|
|
56
|
+
export declare const frameFetchVerdict: (policy: FrameFetchPolicy, url: unknown, { classifier }?: {
|
|
57
|
+
classifier?: FrameFetchClassifier;
|
|
58
|
+
}) => FrameFetchVerdict;
|
|
34
59
|
//#endregion
|
|
35
|
-
export {
|
|
60
|
+
export { normalizeHosts as normalizeDeclaredHosts };
|
package/attach-policy.js
CHANGED
|
@@ -1,43 +1,41 @@
|
|
|
1
|
+
import { c as e, t } from "./hosts-C4-8lWwz.js";
|
|
1
2
|
//#region src/attach-policy.ts
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
for (let n of e) {
|
|
5
|
-
let e = n.trim().toLowerCase();
|
|
6
|
-
!e || e.length > 253 || /^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/.test(e) && (t.includes(e) || t.push(e));
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
}, t = (e, t) => {
|
|
10
|
-
if (!e.session) return {
|
|
3
|
+
var n = (t, n, { classifier: r = "no-base" } = {}) => {
|
|
4
|
+
if (!t.session) return {
|
|
11
5
|
kind: "refuse",
|
|
12
6
|
reason: "frame.fetch on the cloud backend needs its own session: attach with syncCookies: false"
|
|
13
7
|
};
|
|
14
|
-
if (typeof
|
|
8
|
+
if (typeof n != "string") return {
|
|
15
9
|
kind: "refuse",
|
|
16
10
|
reason: "frame.fetch: url must be a string"
|
|
17
11
|
};
|
|
18
|
-
let
|
|
12
|
+
let i;
|
|
19
13
|
try {
|
|
20
|
-
|
|
14
|
+
i = new URL(n);
|
|
21
15
|
} catch {
|
|
22
16
|
return {
|
|
23
17
|
kind: "refuse",
|
|
24
18
|
reason: "frame.fetch on the cloud backend needs an absolute url"
|
|
25
19
|
};
|
|
26
20
|
}
|
|
27
|
-
if (
|
|
21
|
+
if (r === "fetchTarget" && e(n).kind !== "absolute") return {
|
|
22
|
+
kind: "refuse",
|
|
23
|
+
reason: "frame.fetch on the cloud backend needs an absolute url"
|
|
24
|
+
};
|
|
25
|
+
if (i.protocol !== "https:" && i.protocol !== "http:") return {
|
|
28
26
|
kind: "refuse",
|
|
29
27
|
reason: "frame.fetch: only http(s) urls are supported"
|
|
30
28
|
};
|
|
31
|
-
if (!(
|
|
29
|
+
if (!(t.declaredHosts.includes(i.hostname) || t.approvedOrigins.has(i.origin))) return {
|
|
32
30
|
kind: "refuse",
|
|
33
31
|
reason: "frame.fetch: the target is outside the origins this attachment declared"
|
|
34
32
|
};
|
|
35
|
-
let
|
|
33
|
+
let a = t.declaredHosts.length ? t.declaredHosts : [i.hostname];
|
|
36
34
|
return {
|
|
37
35
|
kind: "consent",
|
|
38
|
-
targetHost:
|
|
39
|
-
promptHosts:
|
|
36
|
+
targetHost: i.hostname,
|
|
37
|
+
promptHosts: a
|
|
40
38
|
};
|
|
41
39
|
};
|
|
42
40
|
//#endregion
|
|
43
|
-
export {
|
|
41
|
+
export { n as frameFetchVerdict, t as normalizeDeclaredHosts };
|
package/cloud/dns.d.ts
CHANGED
package/cloud/fetch.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../proxy-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../proxy-CYcaW5ew.cjs");exports.fetch=e.t;
|
package/cloud/fetch.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as cloudFetch } from "../proxy-
|
|
1
|
+
import { t as cloudFetch } from "../proxy-Bmb2wxG1.js";
|
|
2
2
|
export { cloudFetch as fetch };
|
package/cloud/fetch.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../proxy-
|
|
1
|
+
import { t as e } from "../proxy-DDwY3AVG.js";
|
|
2
2
|
export { e as fetch };
|
package/cloud/fs/promises.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { a as WriteData, i as Stats, n as MakeOptions, o as WriteOptions, r as ReadOptions } from "../../index-BQgZVQl7.js";
|
|
2
|
-
import "../../fs
|
|
2
|
+
import "../../fs--NhtUyYa.js";
|
|
3
3
|
//#region src/cloud/fs-promises.d.ts
|
|
4
|
-
declare const readFile: (path: import("node:fs").PathLike, options?: ReadOptions) => Promise<Buffer | string>, writeFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>, unlink: (path: import("node:fs").PathLike) => Promise<void>, rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>, readdir: (path: import("node:fs").PathLike) => Promise<string[]>, mkdir: (_path?: import("node:fs").PathLike, _options?: MakeOptions) => Promise<void>, rm: (path: import("node:fs").PathLike, options?: {
|
|
4
|
+
export declare const readFile: (path: import("node:fs").PathLike, options?: ReadOptions) => Promise<Buffer | string>, writeFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>, unlink: (path: import("node:fs").PathLike) => Promise<void>, rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>, readdir: (path: import("node:fs").PathLike) => Promise<string[]>, mkdir: (_path?: import("node:fs").PathLike, _options?: MakeOptions) => Promise<void>, rm: (path: import("node:fs").PathLike, options?: {
|
|
5
5
|
recursive?: boolean;
|
|
6
6
|
}) => Promise<void>, rmdir: (path: import("node:fs").PathLike, options?: {
|
|
7
7
|
recursive?: boolean;
|
|
8
8
|
}) => Promise<void>, stat: (path: import("node:fs").PathLike) => Promise<Stats>, lstat: (path: import("node:fs").PathLike) => Promise<Stats>, access: (path: import("node:fs").PathLike) => Promise<void>;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { access, lstat, mkdir, readFile, readdir, rename, rm, rmdir, stat, unlink, writeFile };
|
|
9
|
+
//#endregion
|
package/cloud/fs.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../rolldown-runtime-BIInC43l.cjs"),t=require("../node-fs-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../rolldown-runtime-BIInC43l.cjs"),t=require("../node-fs-BNTPsX5c.cjs"),n=require("../messages.cjs"),r=require("../storage-dSi2dUKx.cjs");var i=e.t({STORAGE_NOT_FOUND:()=>n.STORAGE_NOT_FOUND,StorageLockedError:()=>r.t,StorageNotFoundError:()=>r.n,available:()=>a,encryption:()=>r.i,isNotFound:()=>r.a,mkdir:()=>d,promises:()=>m,quota:()=>r.s,readFile:()=>o,readFileSealed:()=>r.l,readdir:()=>u,rename:()=>l,rm:()=>f,stat:()=>p,unlink:()=>c,unlock:()=>r.f,writeFile:()=>s}),{available:a,readFile:o,writeFile:s,unlink:c,rename:l,readdir:u,mkdir:d,rm:f,stat:p,promises:m}=t.t(r.d,{memfs:!1});exports.STORAGE_NOT_FOUND=n.STORAGE_NOT_FOUND,exports.StorageLockedError=r.t,exports.StorageNotFoundError=r.n,exports.available=a,exports.encryption=r.i,exports.isNotFound=r.a,exports.mkdir=d,exports.promises=m,exports.quota=r.s,exports.readFile=o,exports.readFileSealed=r.l,exports.readdir=u,exports.rename=l,exports.rm=f,exports.stat=p,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}}),exports.unlink=c,exports.unlock=r.f,exports.writeFile=s;
|
package/cloud/fs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as Stats } from "../index-BQgZVQl7.js";
|
|
2
|
-
import { a as StorageNotFoundError, c as isNotFound,
|
|
2
|
+
import { a as StorageNotFoundError, c as isNotFound, f as unlock, i as StorageLockedError, l as quota, n as FileEntry, o as StorageQuota, r as SealedRead, s as encryption, t as EncryptionStatus, u as readFileSealed } from "../storage-ZrY4Y4L5.js";
|
|
3
3
|
import { a as STORAGE_NOT_FOUND } from "../messages-C66ghz_A.js";
|
|
4
|
-
import { a as readFile, c as rm, d as writeFile, i as promises, l as stat, o as readdir, r as mkdir, s as rename, t as available, u as unlink } from "../fs
|
|
4
|
+
import { a as readFile, c as rm, d as writeFile, i as promises, l as stat, o as readdir, r as mkdir, s as rename, t as available, u as unlink } from "../fs--NhtUyYa.js";
|
|
5
5
|
export { type EncryptionStatus, type FileEntry, STORAGE_NOT_FOUND, type SealedRead, type Stats, StorageLockedError, StorageNotFoundError, type StorageQuota, available, encryption, isNotFound, mkdir, promises, quota, readFile, readFileSealed, readdir, rename, rm, stat, unlink, unlock, writeFile };
|
package/cloud/fs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "../rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { t } from "../node-fs-
|
|
2
|
+
import { t } from "../node-fs-BZy9bzKd.js";
|
|
3
3
|
import { STORAGE_NOT_FOUND as n } from "../messages.js";
|
|
4
|
-
import { a as r, d as i, f as a, i as o, l as s, n as c, s as l, t as u } from "../storage-
|
|
4
|
+
import { a as r, d as i, f as a, i as o, l as s, n as c, s as l, t as u } from "../storage-BbcnDCnc.js";
|
|
5
5
|
//#region src/cloud/fs.ts
|
|
6
6
|
var d = /* @__PURE__ */ e({
|
|
7
7
|
STORAGE_NOT_FOUND: () => n,
|
package/cloud/net.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createConnection, c as isIP, i as connect, l as isIPv4, n as Socket, o as createServer, r as _default, t as Server, u as isIPv6 } from "../net-
|
|
1
|
+
import { a as createConnection, c as isIP, i as connect, l as isIPv4, n as Socket, o as createServer, r as _default, t as Server, u as isIPv6 } from "../net-0SlODFSM.js";
|
|
2
2
|
export { Server, Socket, _default, _default as default, connect, createConnection, createServer, isIP, isIPv4, isIPv6 };
|