@fkn/lib 0.9.32 → 0.9.34
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.js +1 -1
- package/{api-DLvscoll.js → api-BdTgLphT.js} +80 -65
- package/{api-LKxHamsI.d.ts → api-Bgsg9t9D.d.ts} +7 -1
- package/api-MW-Lm0u8.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 +30 -5
- 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.cjs +1 -1
- package/cloud/fs.js +1 -1
- package/cloud/net.d.ts +1 -1
- package/{cloud-BYw0XBF4.d.ts → cloud-C40YCPuv.d.ts} +4 -4
- package/cloud-DBNeXS9R.js +272 -0
- package/cloud-DHuqVKrl.cjs +1 -0
- package/cloud.cjs +1 -1
- package/cloud.d.ts +3 -3
- package/cloud.js +2 -2
- package/{contract-CSdeTq_Y.d.ts → contract-Gd543I6m.d.ts} +31 -1
- package/contract.d.ts +2 -2
- package/dgram.cjs +1 -1
- package/dgram.d.ts +2 -2
- package/dgram.js +1 -1
- package/dns.cjs +1 -1
- package/dns.d.ts +1 -1
- package/dns.js +1 -1
- package/{extension-DNkuFy1Y.d.ts → extension-Bm-PwsD6.d.ts} +23 -147
- package/extension-DALH11b4.js +87 -0
- package/extension-lR-cSs2P.cjs +1 -0
- 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.js +1 -1
- package/{fs-DEnJQLa9.cjs → fs-Bv3aFjqA.cjs} +1 -1
- package/{fs-gY-aKqaf.js → fs-O2bp9J0x.js} +1 -1
- package/fs.cjs +1 -1
- package/fs.js +1 -1
- package/hosts-C4-8lWwz.js +161 -0
- package/hosts-DD4rDeQH.cjs +1 -0
- package/http.d.ts +1 -1
- package/{index-DH3_12nU.d.ts → index-DIK21kfh.d.ts} +278 -5
- package/index.cjs +1 -1
- package/index.d.ts +5 -5
- package/index.js +62 -62
- package/{lib-duLPF_WZ.js → lib-C3f3XmGZ.js} +544 -393
- package/lib-WiHTYaNP.cjs +53 -0
- package/{net-DtRM2eKo.d.ts → net-BBtYFEzu.d.ts} +2 -2
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +1 -1
- package/package.json +1 -1
- package/packages.cjs +1 -1
- package/packages.d.ts +1 -1
- package/packages.js +5 -2
- package/{proxy-AooDS--C.d.ts → proxy-XeHtHIdZ.d.ts} +2 -2
- package/proxy-_m6Sqcr6.cjs +1 -0
- package/proxy-fXckOcRn.js +60 -0
- package/rooms.cjs +1 -1
- package/rooms.d.ts +1 -1
- package/rooms.js +1 -1
- package/{storage-5o8AtNi_.js → storage-C6Cd4J5E.js} +1 -1
- package/{storage-Dk6d2Vlz.cjs → storage-D2eBifiu.cjs} +1 -1
- package/api-BCJO3EWi.cjs +0 -3
- package/cloud-B2ZG-0MF.cjs +0 -1
- package/cloud-DolBoNvR.js +0 -174
- package/extension-DBazc3ff.cjs +0 -1
- package/extension-Dw9gzvei.js +0 -84
- package/lib-DLM2M3_i.cjs +0 -53
- package/proxy-CefKCs-i.cjs +0 -1
- package/proxy-KUfE4cEQ.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-MW-Lm0u8.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.js
CHANGED
|
@@ -59,51 +59,51 @@ var t = 1e4, n = 16, r = (e) => {
|
|
|
59
59
|
width: Math.max(...e.map((e) => e.x + e.width)) - t,
|
|
60
60
|
height: Math.max(...e.map((e) => e.y + e.height)) - n
|
|
61
61
|
};
|
|
62
|
-
},
|
|
62
|
+
}, 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) => {
|
|
63
63
|
let r = getComputedStyle(e);
|
|
64
64
|
return n !== 0 && /auto|scroll/.test(r.overflowY) && e.scrollHeight > e.clientHeight ? !0 : t !== 0 && /auto|scroll/.test(r.overflowX) && e.scrollWidth > e.clientWidth;
|
|
65
65
|
}, re = (e, t, n) => {
|
|
66
|
-
for (let r = e; r; r = r.parentElement) if (
|
|
66
|
+
for (let r = e; r; r = r.parentElement) if (y(r, t, n)) return r;
|
|
67
67
|
return document.scrollingElement;
|
|
68
68
|
}, b = null, x = null, S = (e) => ({
|
|
69
69
|
width: e.offsetWidth || window.innerWidth,
|
|
70
70
|
height: e.offsetHeight || window.innerHeight
|
|
71
71
|
}), C = (e) => {
|
|
72
|
-
if (!x || !b || !
|
|
72
|
+
if (!x || !b || !te(x, e.clientX, e.clientY)) return;
|
|
73
73
|
let t = document.elementFromPoint(e.clientX, e.clientY);
|
|
74
74
|
if (!t || t === b) return;
|
|
75
|
-
let n =
|
|
75
|
+
let n = v(e.deltaX, e.deltaMode, window.innerWidth), r = v(e.deltaY, e.deltaMode, window.innerHeight), i = re(t, n, r);
|
|
76
76
|
i && (i.scrollBy({
|
|
77
77
|
left: n,
|
|
78
78
|
top: r,
|
|
79
79
|
behavior: "instant"
|
|
80
80
|
}), e.cancelable && e.preventDefault());
|
|
81
|
-
},
|
|
81
|
+
}, ie = (e) => {
|
|
82
82
|
let t = x !== null;
|
|
83
83
|
x = e, t !== (e !== null) && (e ? window.addEventListener("wheel", C, {
|
|
84
84
|
capture: !0,
|
|
85
85
|
passive: !1
|
|
86
86
|
}) : window.removeEventListener("wheel", C, { capture: !0 }));
|
|
87
|
-
},
|
|
88
|
-
if (e ===
|
|
89
|
-
|
|
87
|
+
}, w = 0, ae = (e) => {
|
|
88
|
+
if (e === w) return;
|
|
89
|
+
w = e;
|
|
90
90
|
let t = document.documentElement.style;
|
|
91
91
|
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"));
|
|
92
|
-
},
|
|
93
|
-
if (
|
|
92
|
+
}, T = (e, { modal: t, rects: n, inset: r }, i) => {
|
|
93
|
+
if (ae(r), !c) {
|
|
94
94
|
let r = t || n.length > 0;
|
|
95
95
|
e.style.setProperty("pointer-events", r ? "auto" : "none", "important"), e.style.setProperty("visibility", r ? "visible" : "hidden", "important");
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
98
|
let a = g(n, t, i), o = a === "none" || CSS.supports("clip-path", a) ? a : "inset(100%)";
|
|
99
|
-
e.style.setProperty("clip-path", o, "important"),
|
|
100
|
-
},
|
|
99
|
+
e.style.setProperty("clip-path", o, "important"), ie(t || o !== a ? null : _(n));
|
|
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
|
-
},
|
|
104
|
+
}, se = (e) => {
|
|
105
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
|
-
},
|
|
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 =
|
|
150
|
-
t &&
|
|
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
|
+
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
|
-
|
|
153
|
-
}, F = (e) => {
|
|
154
|
-
u(e), E(e, {
|
|
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 (
|
|
191
|
-
let e =
|
|
192
|
-
if (e)
|
|
204
|
+
}, K, he = () => {
|
|
205
|
+
if (K || !U) return K;
|
|
206
|
+
let e = U.querySelector(`iframe[src="${G}"]`);
|
|
207
|
+
if (e) K = e;
|
|
193
208
|
else {
|
|
194
|
-
let e =
|
|
195
|
-
|
|
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
|
|
198
|
-
},
|
|
199
|
-
if (!
|
|
200
|
-
let e = await
|
|
212
|
+
return P(K), K;
|
|
213
|
+
}, q = (async () => {
|
|
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
|
-
},
|
|
283
|
-
if (typeof window < "u") return
|
|
297
|
+
}, _e = typeof window < "u" || typeof self < "u", ve = async () => {
|
|
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
|
-
},
|
|
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
|
-
} }),
|
|
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 =
|
|
304
|
-
return Promise.race([
|
|
305
|
-
|
|
317
|
+
}, be = (e) => {
|
|
318
|
+
let t = Z ? ye : X;
|
|
319
|
+
return Promise.race([Y, new Promise((n, r) => setTimeout(() => {
|
|
320
|
+
Z = !0, r(new Q(e, t));
|
|
306
321
|
}, t))]);
|
|
307
|
-
},
|
|
308
|
-
|
|
309
|
-
|
|
322
|
+
}, $ = J.onEpoch, xe = J.current, Se = J.lastCall, Ce = J.inFlight;
|
|
323
|
+
$((e) => {
|
|
324
|
+
k() && e.overlay.setHost(F, { exactClips: f() }).catch(() => {});
|
|
310
325
|
});
|
|
311
326
|
//#endregion
|
|
312
|
-
export {
|
|
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 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as TcpSocketOption, v as UdpSocketOption } from "./wire-Gbo-D74t.js";
|
|
2
|
-
import {
|
|
2
|
+
import { B as RoomEvent, C as OverlayState, E as PackagesErrorCode, F as Resolvers, H as RoomJoinOptions, K as RoomOpenOptions, M as ProxyFetchInput, O as PickOptions, U as RoomMailbox, Y as RoomsErrorCode, a as ConflictChoice, at as UdpDatagram, b as IpFamily, c as ConnectAvailability, ct as WriteData, h as FrameConsentRequest, i as AdoptState, j as ProxyFetchInit, k as Placement, l as ConnectOptions, m as FrameConsentAnswer, o as ConflictRequest, ot as UdpSocketOptions, q as RoomPermission, r as AdoptRequest, rt as TcpSocketOptions, tt as TcpSocketListenerOptions, v as InstallOptions, w as PackageQuery } from "./contract-Gd543I6m.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>;
|
|
@@ -226,6 +227,7 @@ declare const onApiEpoch: (listener: EpochListener<{
|
|
|
226
227
|
name: string;
|
|
227
228
|
version: string | null;
|
|
228
229
|
installedAt: number;
|
|
230
|
+
appId?: string;
|
|
229
231
|
};
|
|
230
232
|
} | {
|
|
231
233
|
declined: true;
|
|
@@ -247,6 +249,7 @@ declare const onApiEpoch: (listener: EpochListener<{
|
|
|
247
249
|
name: string;
|
|
248
250
|
version: string | null;
|
|
249
251
|
installedAt: number;
|
|
252
|
+
appId?: string;
|
|
250
253
|
}[];
|
|
251
254
|
}>;
|
|
252
255
|
uninstall: (uri: string) => Promise<{
|
|
@@ -874,6 +877,7 @@ declare const currentApiEpoch: () => {
|
|
|
874
877
|
};
|
|
875
878
|
frameConsent: {
|
|
876
879
|
ensure: (request: FrameConsentRequest) => Promise<boolean>;
|
|
880
|
+
request: (requests: FrameConsentRequest[]) => Promise<FrameConsentAnswer[]>;
|
|
877
881
|
};
|
|
878
882
|
connect: {
|
|
879
883
|
prompt: (consumerOrigin: string) => Promise<boolean>;
|
|
@@ -936,6 +940,7 @@ declare const currentApiEpoch: () => {
|
|
|
936
940
|
name: string;
|
|
937
941
|
version: string | null;
|
|
938
942
|
installedAt: number;
|
|
943
|
+
appId?: string;
|
|
939
944
|
};
|
|
940
945
|
} | {
|
|
941
946
|
declined: true;
|
|
@@ -957,6 +962,7 @@ declare const currentApiEpoch: () => {
|
|
|
957
962
|
name: string;
|
|
958
963
|
version: string | null;
|
|
959
964
|
installedAt: number;
|
|
965
|
+
appId?: string;
|
|
960
966
|
}[];
|
|
961
967
|
}>;
|
|
962
968
|
uninstall: (uri: string) => Promise<{
|
package/api-MW-Lm0u8.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-MW-Lm0u8.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 { F as Resolvers } from "./contract-Gd543I6m.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-Bgsg9t9D.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-BdTgLphT.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
|
|
@@ -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
|
+
type FrameFetchClassifier = 'no-base' | 'fetchTarget';
|
|
56
|
+
declare const frameFetchVerdict: (policy: FrameFetchPolicy, url: unknown, { classifier }?: {
|
|
57
|
+
classifier?: FrameFetchClassifier;
|
|
58
|
+
}) => FrameFetchVerdict;
|
|
34
59
|
//#endregion
|
|
35
|
-
export { FrameFetchPolicy, FrameFetchVerdict, frameFetchVerdict, normalizeDeclaredHosts };
|
|
60
|
+
export { FrameFetchClassifier, FrameFetchPolicy, FrameFetchVerdict, frameFetchVerdict, 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-_m6Sqcr6.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-XeHtHIdZ.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-fXckOcRn.js";
|
|
2
2
|
export { e as fetch };
|
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-DZPGCYWg.cjs"),n=require("../messages.cjs"),r=require("../storage-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../rolldown-runtime-BIInC43l.cjs"),t=require("../node-fs-DZPGCYWg.cjs"),n=require("../messages.cjs"),r=require("../storage-D2eBifiu.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.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "../rolldown-runtime-Dy4uBu1J.js";
|
|
2
2
|
import { t } from "../node-fs-C9ECR_9H.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-C6Cd4J5E.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-BBtYFEzu.js";
|
|
2
2
|
export { Server, Socket, _default, _default as default, connect, createConnection, createServer, isIP, isIPv4, isIPv6 };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { t as cloudFetch } from "./proxy-
|
|
2
|
-
import { i as Frame, r as AttachFrameOptions } from "./index-
|
|
1
|
+
import { t as cloudFetch } from "./proxy-XeHtHIdZ.js";
|
|
2
|
+
import { i as Frame, r as AttachFrameOptions } from "./index-DIK21kfh.js";
|
|
3
3
|
import { t as dns_d_exports } from "./dns.js";
|
|
4
4
|
import { n as fs_d_exports } from "./fs-CYcErwc4.js";
|
|
5
|
-
import { s as net_d_exports } from "./net-
|
|
5
|
+
import { s as net_d_exports } from "./net-BBtYFEzu.js";
|
|
6
6
|
import { t as dgram_d_exports } from "./dgram.js";
|
|
7
7
|
import { t as http_d_exports } from "./http.js";
|
|
8
8
|
//#region src/cloud/frame.d.ts
|
|
9
|
-
declare const attachFrame: ({ iframe, domains, syncCookies, lockdown }: AttachFrameOptions) => Promise<Frame>;
|
|
9
|
+
declare const attachFrame: ({ iframe, domains, syncCookies, lockdown, permissions }: AttachFrameOptions) => Promise<Frame>;
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/quota.d.ts
|
|
12
12
|
type QuotaStatus = {
|