@fkn/lib 0.9.41 → 0.9.43
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-generation-CSnZiN18.cjs → account-generation-B-6Pn0b5.cjs} +1 -1
- package/{account-generation-D7TpIoKt.js → account-generation-XNWOvLea.js} +5 -5
- package/account.cjs +1 -1
- package/account.js +6 -6
- package/api--LOXTOpv.cjs +3 -0
- package/{api-Dp-2AT3u.js → api-DIgTslNb.js} +154 -114
- package/{api-Cbty0JUM.d.ts → api-H1TzWitc.d.ts} +24 -2
- package/api.cjs +1 -1
- package/api.d.ts +3 -3
- package/api.js +2 -2
- package/attach-policy.cjs +1 -1
- package/attach-policy.js +2 -2
- 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-Bx64HSkQ.cjs +1 -0
- package/cloud-D-vDUzzx.js +552 -0
- package/{cloud-4t1WoEZn.d.ts → cloud-Y0FzWpFT.d.ts} +5 -3
- package/cloud.cjs +1 -1
- package/cloud.d.ts +3 -3
- package/cloud.js +2 -2
- package/{contract-BRc2ptdC.d.ts → contract-DJxGa8lb.d.ts} +141 -7
- package/contract.d.ts +3 -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-DMU-CwMw.d.ts → extension-BtDg-F2g.d.ts} +40 -4
- package/extension-CzZn0bY2.js +94 -0
- package/extension-DvFf7uoG.cjs +1 -0
- package/extension.cjs +1 -1
- package/extension.d.ts +3 -3
- package/extension.js +3 -3
- package/fs/promises.cjs +1 -1
- package/fs/promises.js +1 -1
- package/{fs-q7Kg51hq.js → fs-CVnmXRf7.js} +1 -1
- package/{fs-BTyRnUPI.cjs → fs-p0bOOj5n.cjs} +1 -1
- package/fs.cjs +1 -1
- package/fs.js +2 -2
- package/{hosts-9dYv63ud.cjs → hosts-GNBhZO3-.cjs} +1 -1
- package/{hosts-BzbzOhG8.js → hosts-t7CKGTRz.js} +4 -1
- package/http.d.ts +1 -1
- package/{index-D2CA-NX5.d.ts → index-Cgnfjh9o.d.ts} +530 -51
- package/index.cjs +1 -1
- package/index.d.ts +16 -16
- package/index.js +56 -53
- package/{lib-C4Eeg9eM.js → lib-C3UwxjVs.js} +755 -501
- package/lib-fqQfEPk6.cjs +53 -0
- package/{net-CcEZP6Bb.d.ts → net-BOswhyfE.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 +14 -14
- package/{proxy-DjoPtJH9.cjs → proxy-CFK-KiwE.cjs} +1 -1
- package/{proxy-DMTdQ4dN.js → proxy-Dixbk1WL.js} +1 -1
- package/{proxy-D6YtsO1g.d.ts → proxy-ylK5lpw8.d.ts} +2 -2
- package/rooms.cjs +1 -1
- package/rooms.d.ts +1 -1
- package/rooms.js +11 -11
- package/{storage-BS5WMO4f.cjs → storage-D2cUJlVH.cjs} +1 -1
- package/{storage-BWmGrO6a.js → storage-Dn1gTLSZ.js} +2 -2
- package/api-jOTOA-5n.cjs +0 -3
- package/cloud-BLv19j-W.js +0 -480
- package/cloud-D7aQY4GH.cjs +0 -1
- package/extension-B9v933cT.js +0 -89
- package/extension-D2zMdc2f.cjs +0 -1
- package/lib-BfAg9mHD.cjs +0 -53
package/cloud.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as cloudFetch } from "./proxy-
|
|
2
|
-
import { a as attachFrame, i as quota, r as QuotaStatus, t as available } from "./cloud-
|
|
1
|
+
import { t as cloudFetch } from "./proxy-ylK5lpw8.js";
|
|
2
|
+
import { a as attachFrame, i as quota, r as QuotaStatus, t as available } from "./cloud-Y0FzWpFT.js";
|
|
3
3
|
import { t as dns_d_exports } from "./dns.js";
|
|
4
4
|
import { n as fs_d_exports } from "./fs-D0MMRnHC.js";
|
|
5
|
-
import { s as net_d_exports } from "./net-
|
|
5
|
+
import { s as net_d_exports } from "./net-BOswhyfE.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
|
export { type QuotaStatus, attachFrame, available, dgram_d_exports as dgram, dns_d_exports as dns, cloudFetch as fetch, fs_d_exports as fs, http_d_exports as http, net_d_exports as net, quota };
|
package/cloud.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "./proxy-
|
|
2
|
-
import { i as t, r as n, t as r } from "./cloud-
|
|
1
|
+
import { t as e } from "./proxy-Dixbk1WL.js";
|
|
2
|
+
import { i as t, r as n, t as r } from "./cloud-D-vDUzzx.js";
|
|
3
3
|
import { t as i } from "./dns.js";
|
|
4
4
|
import { t as a } from "./cloud/fs.js";
|
|
5
5
|
import { t as o } from "./net.js";
|
|
@@ -1,5 +1,34 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as StorageState, tt as SelectorPart, u as ClearCookiesWire } from "./index-Cgnfjh9o.js";
|
|
2
2
|
import { o as TcpSocketOption, v as UdpSocketOption } from "./wire-Gbo-D74t.js";
|
|
3
|
+
//#region ../web-extension/lib/lib/storage-state.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* A `storageState` cookie in the cloud jar's own shape (mirage's `Cookie`): `domain` always with
|
|
6
|
+
* its leading dot and `hostOnly` beside it, `expires` in milliseconds or absent for a session
|
|
7
|
+
* cookie, `sameSite` lowercase, every default filled in.
|
|
8
|
+
*/
|
|
9
|
+
type JarSeedCookie = {
|
|
10
|
+
name: string;
|
|
11
|
+
value: string;
|
|
12
|
+
domain: string;
|
|
13
|
+
hostOnly: boolean;
|
|
14
|
+
path: string;
|
|
15
|
+
expires?: number;
|
|
16
|
+
httpOnly: boolean;
|
|
17
|
+
secure: boolean;
|
|
18
|
+
sameSite: 'strict' | 'lax' | 'none';
|
|
19
|
+
};
|
|
20
|
+
/** A `storageState` as the render proxy seeds it into an attachment's jar and storage namespace. */
|
|
21
|
+
type JarSeed = {
|
|
22
|
+
cookies: JarSeedCookie[];
|
|
23
|
+
origins: {
|
|
24
|
+
origin: string;
|
|
25
|
+
localStorage: {
|
|
26
|
+
name: string;
|
|
27
|
+
value: string;
|
|
28
|
+
}[];
|
|
29
|
+
}[];
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
3
32
|
//#region src/contract.d.ts
|
|
4
33
|
/**
|
|
5
34
|
* What the broker's account change notification says. `switched` is true only when the account the
|
|
@@ -221,9 +250,26 @@ declare const WINDOW_JAR_MODE_TIMEOUT_MS = 30000;
|
|
|
221
250
|
* connect, or to say why it cannot.
|
|
222
251
|
*/
|
|
223
252
|
declare const WINDOW_HANDSHAKE_TIMEOUT_MS: number;
|
|
224
|
-
/**
|
|
225
|
-
|
|
253
|
+
/**
|
|
254
|
+
* A goto on the middle page's control channel, as a library sends it; the middle page hands it on to
|
|
255
|
+
* the shell as it came. Its own names, which never change with the public `GotoOptions`: the public
|
|
256
|
+
* `timeout` travels as `timeoutMs`.
|
|
257
|
+
*/
|
|
258
|
+
type MiddleGotoOptions = {
|
|
259
|
+
/**
|
|
260
|
+
* `'load'`, the default, once the goto's document fired load. `'commit'`, the public value: the
|
|
261
|
+
* goto resolves once its document holds the frame, and rejects when none came by the deadline. A
|
|
262
|
+
* shell that predates it reads `'commit'` as `'load'`, which never resolves before commit.
|
|
263
|
+
* `'documentstart'`, which no current library sends, keeps its wire meaning for every library that
|
|
264
|
+
* predates `'commit'`: resolving as soon as the navigation starts.
|
|
265
|
+
*/
|
|
266
|
+
waitUntil?: 'load' | 'commit' | 'documentstart';
|
|
267
|
+
/** The goto's deadline in milliseconds, 30000 when absent. */
|
|
226
268
|
timeoutMs?: number;
|
|
269
|
+
domains?: string[];
|
|
270
|
+
};
|
|
271
|
+
/** A goto on the shell's control channel. */
|
|
272
|
+
type ShellGotoOptions = MiddleGotoOptions & {
|
|
227
273
|
/**
|
|
228
274
|
* For an attachment's first navigation: past its deadline, a document that committed but never
|
|
229
275
|
* fired load counts as loaded, the rule the inline attachment's first load follows. Ignored by a
|
|
@@ -245,6 +291,51 @@ type ShellControl = {
|
|
|
245
291
|
flushCookies?(): Promise<void>;
|
|
246
292
|
/** Removes a window shell's own site storage; resolves at once for a shell whose storage is shared. */
|
|
247
293
|
sweepStorage?(): Promise<void>;
|
|
294
|
+
/**
|
|
295
|
+
* The url this shell's empty page is armed for (`?blank=`), `''` when none: a shell mounted with
|
|
296
|
+
* `?url=` or nothing, or one whose first goto disarmed it. Absent from a shell that predates blank
|
|
297
|
+
* pages, which reads no target from `?blank=` and so loads nothing.
|
|
298
|
+
*/
|
|
299
|
+
blank?(): Promise<string>;
|
|
300
|
+
/**
|
|
301
|
+
* Removes the cookies `filter` matches from this shell's jar, among the cookies of `scope.hosts`'
|
|
302
|
+
* sites only: a cookie is in reach when its domain's own registered domain is that of one of the
|
|
303
|
+
* hosts, or its domain is exactly a host that is itself a public suffix, so `amazonaws.com` reaches
|
|
304
|
+
* no `mybucket.s3.amazonaws.com` cookie, a site of its own under `s3.amazonaws.com`. Resolves
|
|
305
|
+
* `undefined` once its live realms dropped them (waiting at most 2000 ms) and the removal is
|
|
306
|
+
* committed, and takes the same steps when nothing matched, so neither its answer nor its time says
|
|
307
|
+
* whether the jar held a cookie there. That holds for `{ equals }` options, the only ones its
|
|
308
|
+
* middle page sends for now: a `{ pattern, flags }` one is still rebuilt and tested against every
|
|
309
|
+
* cookie in reach, so its running time on them would be part of the call's.
|
|
310
|
+
*
|
|
311
|
+
* Refuses, before anything is removed: a filter of any other shape (a TypeError
|
|
312
|
+
* `frame.clearCookies: malformed filter`), an empty `scope.hosts`, and a string `domain` whose
|
|
313
|
+
* registered domain is none of the hosts' (each a LocatorDeniedError naming why). Rejects with the
|
|
314
|
+
* library's own message when the jar's store did not take the removal. Absent from a shell that
|
|
315
|
+
* predates it.
|
|
316
|
+
*/
|
|
317
|
+
clearCookies?(filter: ClearCookiesWire, scope: {
|
|
318
|
+
hosts: string[];
|
|
319
|
+
}): Promise<void>;
|
|
320
|
+
/**
|
|
321
|
+
* The hosts this shell's extension carrier may send a blank page's own fetch and XHR requests to: the
|
|
322
|
+
* attachment's approved set, each call replacing the last. The shell drops every FKN platform host whatever it
|
|
323
|
+
* is told, and a shell with nothing to carry (a window, an `'ephemeral'` jar, a page that is not blank, no
|
|
324
|
+
* extension that announces the carrier) resolves and carries nothing. A TypeError for anything but an array of
|
|
325
|
+
* non-empty strings. Absent from a shell that predates the carrier, which sends every request through WebVPN.
|
|
326
|
+
*/
|
|
327
|
+
carry?(hosts: string[]): Promise<void>;
|
|
328
|
+
/**
|
|
329
|
+
* Seeds this shell's jar and storage namespace: the cookies join the jar, recorded as its own,
|
|
330
|
+
* and each origin's localStorage items are written where that origin's pages read them, by the
|
|
331
|
+
* frame host serving it before the host takes a navigation. Resolves once the jar holds the
|
|
332
|
+
* cookies and the items of every origin a host serves now are written, so a goto sent afterwards
|
|
333
|
+
* carries them. Only on a jar of the attachment's own with a namespace of its own: on the shared
|
|
334
|
+
* jar (an empty session, a window on its opener's) a TypeError `attachFrame: storageState seeds a
|
|
335
|
+
* fresh jar, so it needs cookies: 'ephemeral'`, with nothing seeded. A seed of another shape is a
|
|
336
|
+
* TypeError from the shell's controller. Absent from a shell that predates it.
|
|
337
|
+
*/
|
|
338
|
+
seed?(seed: JarSeed): Promise<void>;
|
|
248
339
|
};
|
|
249
340
|
/**
|
|
250
341
|
* What a middle page exposes to the library, inline (`ATTACH_FRAME_KEY`) and for a window
|
|
@@ -253,9 +344,7 @@ type ShellControl = {
|
|
|
253
344
|
*/
|
|
254
345
|
type MiddleControl = {
|
|
255
346
|
ready(): Promise<boolean>;
|
|
256
|
-
goto(url: string, options?:
|
|
257
|
-
timeoutMs?: number;
|
|
258
|
-
}): Promise<void>;
|
|
347
|
+
goto(url: string, options?: MiddleGotoOptions): Promise<void>;
|
|
259
348
|
executeLocator(parts: SelectorPart[], operation: string, args: unknown[]): Promise<unknown>;
|
|
260
349
|
/**
|
|
261
350
|
* The host of the document the frame holds now, as the render proxy last reported it, and `''`
|
|
@@ -269,6 +358,51 @@ type MiddleControl = {
|
|
|
269
358
|
* (`FRAME_MESSAGE`). Absent from one deployed before messaging, which the library refuses by name.
|
|
270
359
|
*/
|
|
271
360
|
messaging?(): Promise<true>;
|
|
361
|
+
/**
|
|
362
|
+
* The url the attachment's empty page is armed for while the frame still holds that page, `''`
|
|
363
|
+
* when none, once the first goto was sent, and once the frame reported any other url, even on the
|
|
364
|
+
* same host. The library sends a blank attach as `?blank=` and refuses it by name unless this
|
|
365
|
+
* echoes that url after `ready`, and reads it again before it skips the Evaluation card on a
|
|
366
|
+
* fresh jar, so it asks whenever this page's fresh-jar rule has ended. A middle page that serves
|
|
367
|
+
* it refuses `ready` when its shell does not answer `blank()` with the same url. Absent from a
|
|
368
|
+
* middle page that predates blank pages, which mounts its shell with no target.
|
|
369
|
+
*/
|
|
370
|
+
blank?(): Promise<string>;
|
|
371
|
+
/**
|
|
372
|
+
* Removes the cookies `filter` matches from the attachment's jar, among the cookies of the sites
|
|
373
|
+
* the attachment reaches: the middle page hands its shell the boundary's hosts (declared, plus the
|
|
374
|
+
* host of the attach url and of every goto from its send) as `ShellControl.clearCookies`' scope.
|
|
375
|
+
* No options travel as `{}`, and each option is `{ equals }` for now. Resolves `undefined` whatever
|
|
376
|
+
* the shell answered, so nothing about the jar crosses back, and the shell takes the same steps
|
|
377
|
+
* when nothing matched, so neither its time nor its refusals say whether the jar held a cookie
|
|
378
|
+
* there. Never gated: it asks for no grant and draws no card, and a frame holding no document is
|
|
379
|
+
* served, since a no-src attachment is what a sign-out runs on.
|
|
380
|
+
*
|
|
381
|
+
* Refuses, each with the library's own message and before anything is sent to the shell: a
|
|
382
|
+
* `{ pattern, flags }` option (a TypeError `frame.clearCookies: <key> is a RegExp, and clearCookies
|
|
383
|
+
* takes strings for name, domain and path for now`), since the shell would test it against every
|
|
384
|
+
* cookie in reach; a filter of any other shape (a TypeError `frame.clearCookies: malformed
|
|
385
|
+
* filter`); an attachment that reaches no site (LocatorDeniedError); and a shell that predates it
|
|
386
|
+
* (LocatorUnsupportedError). The shell's own refusals reach the library as they came. Absent from
|
|
387
|
+
* a middle page that predates it, which the library refuses by name.
|
|
388
|
+
*/
|
|
389
|
+
clearCookies?(filter: ClearCookiesWire): Promise<void>;
|
|
390
|
+
/**
|
|
391
|
+
* Seeds the attachment's fresh jar and storage namespace from a `storageState` in the app's own
|
|
392
|
+
* shape (milliseconds `expires`), which the middle page checks as the library does, turns into
|
|
393
|
+
* the jar's shape and hands its shell (`ShellControl.seed`). Once per attachment, before its first
|
|
394
|
+
* goto: the library mounts a seeded attach with no target and sends the attach url as that goto
|
|
395
|
+
* once this resolves. That goto is the attachment's first load, so it takes the first load's rule
|
|
396
|
+
* (`ShellGotoOptions.commitFallback`). Resolves `undefined`, so nothing about the jar crosses back.
|
|
397
|
+
*
|
|
398
|
+
* Refuses, before anything reaches the shell: a seed on the shared jar (the TypeError `attachFrame:
|
|
399
|
+
* storageState seeds a fresh jar, so it needs cookies: 'ephemeral'`), a malformed one (the
|
|
400
|
+
* library's own TypeErrors), a second seed, one sent once a goto was, even one still in flight, and
|
|
401
|
+
* one on an attachment mounted on a url, which its shell loads itself (each an Error), and a shell
|
|
402
|
+
* that predates seeding (LocatorUnsupportedError). Absent from a middle page that predates it,
|
|
403
|
+
* which the library refuses by name.
|
|
404
|
+
*/
|
|
405
|
+
seed?(state: StorageState): Promise<void>;
|
|
272
406
|
};
|
|
273
407
|
/** What a window's middle page adds to its channel. */
|
|
274
408
|
type WindowMiddleControl = MiddleControl & {
|
|
@@ -887,4 +1021,4 @@ type Resolvers = {
|
|
|
887
1021
|
hideInstallPrompt: () => void;
|
|
888
1022
|
};
|
|
889
1023
|
//#endregion
|
|
890
|
-
export {
|
|
1024
|
+
export { RoomHandle as $, MiddleGotoOptions as A, WINDOW_HELLO_TIMEOUT_MS as At, ProxyFetch as B, FrameMessageRelay as C, TcpSocketListenerResult as Ct, IpFamily as D, UdpSocketOptions as Dt, InstalledPackage as E, UdpDatagram as Et, PackageResult as F, JarSeedCookie as Ft, Radii as G, ProxyFetchInput as H, PackagesErrorCode as I, RoomClaimOptions as J, Resolvers as K, PackagesFail as L, OverlayRect as M, WindowMiddleControl as Mt, OverlayState as N, WriteData as Nt, JAR_ANCHOR_MESSAGE as O, UdpSocketResult as Ot, PackageQuery as P, JarSeed as Pt, RoomEvent as Q, PickOptions as R, FrameFetchScope as S, TcpSocketListenerOptions as St, InstallOptions as T, TcpSocketResult as Tt, Quota as U, ProxyFetchInit as V, ROOM_TEMPORARY_MS as W, RoomDefaults as X, RoomCreateOptions as Y, RoomEnd as Z, DnsLookup as _, ShellGotoOptions as _t, AccountChange as a, RoomPermission as at, FrameConsentAnswer as b, StorageQuota as bt, AdoptRequest as c, RoomsFail as ct, ConflictRequest as d, SHELL_FRAME_MESSAGE as dt, RoomJoinOptions as et, ConflictSide as f, SHELL_JAR_MESSAGE as ft, DisplayLevel as g, ShellFrameMessage as gt, DisplayCause as h, ShellControl as ht, Account as i, RoomOpenOptions as it, MountDescriptor as j, WINDOW_JAR_MODE_TIMEOUT_MS as jt, MiddleControl as k, WINDOW_HANDSHAKE_TIMEOUT_MS as kt, AdoptState as l, SHELL_ATTACH_ERROR as lt, ConnectOptions as m, SetOverlayHost as mt, ATTACH_WINDOW_KEY as n, RoomMember as nt, AccountPinOptions as o, RoomPermissions as ot, ConnectAvailability as p, SHELL_JAR_UNREACHABLE as pt, RoomBacklog as q, ATTACH_WINDOW_MESSAGE as r, RoomMessage as rt, AddressLookupResult as s, RoomsErrorCode as st, ATTACH_FRAME_KEY as t, RoomMailbox as tt, ConflictChoice as u, SHELL_CONTROL_KEY as ut, EncryptionState as v, ShellJarUnreachable as vt, HiddenSurface as w, TcpSocketOptions as wt, FrameConsentRequest as x, SurfaceRect as xt, FRAME_MESSAGE as y, StorageEntry as yt, Placement as z };
|
package/contract.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { d as CookieMatchWire, u as ClearCookiesWire } from "./index-Cgnfjh9o.js";
|
|
2
|
+
import { $ as RoomHandle, A as MiddleGotoOptions, At as WINDOW_HELLO_TIMEOUT_MS, B as ProxyFetch, C as FrameMessageRelay, Ct as TcpSocketListenerResult, D as IpFamily, Dt as UdpSocketOptions, E as InstalledPackage, Et as UdpDatagram, F as PackageResult, Ft as JarSeedCookie, G as Radii, H as ProxyFetchInput, I as PackagesErrorCode, J as RoomClaimOptions, K as Resolvers, L as PackagesFail, M as OverlayRect, Mt as WindowMiddleControl, N as OverlayState, Nt as WriteData, O as JAR_ANCHOR_MESSAGE, Ot as UdpSocketResult, P as PackageQuery, Pt as JarSeed, Q as RoomEvent, R as PickOptions, S as FrameFetchScope, St as TcpSocketListenerOptions, T as InstallOptions, Tt as TcpSocketResult, U as Quota, V as ProxyFetchInit, W as ROOM_TEMPORARY_MS, X as RoomDefaults, Y as RoomCreateOptions, Z as RoomEnd, _ as DnsLookup, _t as ShellGotoOptions, a as AccountChange, at as RoomPermission, b as FrameConsentAnswer, bt as StorageQuota, c as AdoptRequest, ct as RoomsFail, d as ConflictRequest, dt as SHELL_FRAME_MESSAGE, et as RoomJoinOptions, f as ConflictSide, ft as SHELL_JAR_MESSAGE, g as DisplayLevel, gt as ShellFrameMessage, h as DisplayCause, ht as ShellControl, i as Account, it as RoomOpenOptions, j as MountDescriptor, jt as WINDOW_JAR_MODE_TIMEOUT_MS, k as MiddleControl, kt as WINDOW_HANDSHAKE_TIMEOUT_MS, l as AdoptState, lt as SHELL_ATTACH_ERROR, m as ConnectOptions, mt as SetOverlayHost, n as ATTACH_WINDOW_KEY, nt as RoomMember, o as AccountPinOptions, ot as RoomPermissions, p as ConnectAvailability, pt as SHELL_JAR_UNREACHABLE, q as RoomBacklog, r as ATTACH_WINDOW_MESSAGE, rt as RoomMessage, s as AddressLookupResult, st as RoomsErrorCode, t as ATTACH_FRAME_KEY, tt as RoomMailbox, u as ConflictChoice, ut as SHELL_CONTROL_KEY, v as EncryptionState, vt as ShellJarUnreachable, w as HiddenSurface, wt as TcpSocketOptions, x as FrameConsentRequest, xt as SurfaceRect, y as FRAME_MESSAGE, yt as StorageEntry, z as Placement } from "./contract-DJxGa8lb.js";
|
|
1
3
|
import { o as TcpSocketOption, v as UdpSocketOption } from "./wire-Gbo-D74t.js";
|
|
2
|
-
|
|
3
|
-
export { ATTACH_FRAME_KEY, ATTACH_WINDOW_KEY, ATTACH_WINDOW_MESSAGE, Account, AccountChange, AccountPinOptions, AddressLookupResult, AdoptRequest, AdoptState, ConflictChoice, ConflictRequest, ConflictSide, ConnectAvailability, ConnectOptions, DisplayCause, DisplayLevel, DnsLookup, EncryptionState, FRAME_MESSAGE, FrameConsentAnswer, FrameConsentRequest, FrameFetchScope, FrameMessageRelay, HiddenSurface, InstallOptions, InstalledPackage, IpFamily, JAR_ANCHOR_MESSAGE, MiddleControl, MountDescriptor, OverlayRect, OverlayState, PackageQuery, PackageResult, PackagesErrorCode, PackagesFail, PickOptions, Placement, ProxyFetch, ProxyFetchInit, ProxyFetchInput, Quota, ROOM_TEMPORARY_MS, Radii, Resolvers, RoomBacklog, RoomClaimOptions, RoomCreateOptions, RoomDefaults, RoomEnd, RoomEvent, RoomHandle, RoomJoinOptions, RoomMailbox, RoomMember, RoomMessage, RoomOpenOptions, RoomPermission, RoomPermissions, RoomsErrorCode, RoomsFail, SHELL_ATTACH_ERROR, SHELL_CONTROL_KEY, SHELL_FRAME_MESSAGE, SHELL_JAR_MESSAGE, SHELL_JAR_UNREACHABLE, SetOverlayHost, ShellControl, ShellFrameMessage, ShellGotoOptions, ShellJarUnreachable, StorageEntry, StorageQuota, SurfaceRect, TcpSocketListenerOptions, TcpSocketListenerResult, type TcpSocketOption, TcpSocketOptions, TcpSocketResult, UdpDatagram, type UdpSocketOption, UdpSocketOptions, UdpSocketResult, WINDOW_HANDSHAKE_TIMEOUT_MS, WINDOW_HELLO_TIMEOUT_MS, WINDOW_JAR_MODE_TIMEOUT_MS, WindowMiddleControl, WriteData };
|
|
4
|
+
export { ATTACH_FRAME_KEY, ATTACH_WINDOW_KEY, ATTACH_WINDOW_MESSAGE, Account, AccountChange, AccountPinOptions, AddressLookupResult, AdoptRequest, AdoptState, type ClearCookiesWire, ConflictChoice, ConflictRequest, ConflictSide, ConnectAvailability, ConnectOptions, type CookieMatchWire, DisplayCause, DisplayLevel, DnsLookup, EncryptionState, FRAME_MESSAGE, FrameConsentAnswer, FrameConsentRequest, FrameFetchScope, FrameMessageRelay, HiddenSurface, InstallOptions, InstalledPackage, IpFamily, JAR_ANCHOR_MESSAGE, type JarSeed, type JarSeedCookie, MiddleControl, MiddleGotoOptions, MountDescriptor, OverlayRect, OverlayState, PackageQuery, PackageResult, PackagesErrorCode, PackagesFail, PickOptions, Placement, ProxyFetch, ProxyFetchInit, ProxyFetchInput, Quota, ROOM_TEMPORARY_MS, Radii, Resolvers, RoomBacklog, RoomClaimOptions, RoomCreateOptions, RoomDefaults, RoomEnd, RoomEvent, RoomHandle, RoomJoinOptions, RoomMailbox, RoomMember, RoomMessage, RoomOpenOptions, RoomPermission, RoomPermissions, RoomsErrorCode, RoomsFail, SHELL_ATTACH_ERROR, SHELL_CONTROL_KEY, SHELL_FRAME_MESSAGE, SHELL_JAR_MESSAGE, SHELL_JAR_UNREACHABLE, SetOverlayHost, ShellControl, ShellFrameMessage, ShellGotoOptions, ShellJarUnreachable, StorageEntry, StorageQuota, SurfaceRect, TcpSocketListenerOptions, TcpSocketListenerResult, type TcpSocketOption, TcpSocketOptions, TcpSocketResult, UdpDatagram, type UdpSocketOption, UdpSocketOptions, UdpSocketResult, WINDOW_HANDSHAKE_TIMEOUT_MS, WINDOW_HELLO_TIMEOUT_MS, WINDOW_JAR_MODE_TIMEOUT_MS, WindowMiddleControl, WriteData };
|
package/dgram.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-jOTOA-5n.cjs"),n=require("./busy-Dv8wzE5M.cjs"),r=require("./utils-BvgGdrgN.cjs");require("./wire.cjs");let i=require("buffer"),a=require("events"),o=require("ip-address");var s=e.t({Socket:()=>c,createSocket:()=>m,default:()=>h}),c=class extends a.EventEmitter{_type;_localAddress;_remoteAddress;_connectedLocally;_connectGeneration=0;_destroyed=!1;_busyRelease;_webVPNUdpSocketPromise;_dataPort;_socketId;_sendQueue=[];_sendQueueBytes=0;_sendFlushScheduled=!1;_peerTailCache=new Map;constructor(e){if(super(e),!e)throw Error(`Missing options`);this._type=e.type,e.connection&&this.__webvpn_udp_socket_init__(e.connection)}_lastRecvBufferSize=0;_lastSendBufferSize=0;_lastTtl=64;_lastMulticastTtl=1;_lastMulticastLoopback=!0;_setUdpOption(e){if(!this._webVPNUdpSocketPromise){this.emit(`error`,Error(`Cannot set socket option before bind`));return}this._webVPNUdpSocketPromise.then(async t=>{if(t)try{await t.setOption(e)}catch(e){this.emit(`error`,e)}})}_dataPortAcks=!1;_dataPortConsumedBytes=0;_dataPortAckedBytes=0;_ackDataPortBatch(e){if(!this._dataPortAcks||!this._dataPort||(this._dataPortConsumedBytes+=e,this._dataPortAckedBytes!==0&&this._dataPortConsumedBytes-this._dataPortAckedBytes<524288))return;this._dataPortAckedBytes=this._dataPortConsumedBytes;let t={type:r.n,consumedBytes:this._dataPortConsumedBytes};this._dataPort.postMessage(t)}_onTransportClosed(e){this._destroyed||(this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0,this.listenerCount(`error`)>0&&this.emit(`error`,Error(e||`WebVPN session closed`)),this.emit(`close`))}_onDataPortBatch(e){let t=new DataView(e),n=!1,r,a=0;for(;a+4<=e.byteLength;){let o=t.getUint32(a);a+=4;let s=a+o;if(s>e.byteLength)break;let c=a+4,l=t.getUint8(c);c+=1;let u,d,p;if(l===2){if(!this._remoteAddress){a=s;continue}u=this._remoteAddress.address,d=this._remoteAddress.family,p=this._remoteAddress.port}else{let n=new Uint8Array(e,c,l===0?4:16);l===0?(d=`IPv4`,u=`${n[0]}.${n[1]}.${n[2]}.${n[3]}`):(d=`IPv6`,u=f(n)),c+=n.byteLength,p=t.getUint16(c),c+=2}let m=t.getUint32(c);c+=4;try{this.emit(`message`,i.Buffer.from(e.slice(c,c+m)),{address:u,family:d,port:p,size:m})}catch(e){n||(n=!0,r=e)}a=s}if(n)throw r}_peerTail(e,t){if(e===void 0||t===void 0)return l;let n=`${e}|${t}`,r=this._peerTailCache.get(n);if(r)return r;let i=o.Address4.isValid(e)?d(e):p(e),a=new Uint8Array(1+i.byteLength+2);return a[0]=i.byteLength===4?0:1,a.set(i,1),new DataView(a.buffer).setUint16(1+i.byteLength,t),this._peerTailCache.size>=4096&&this._peerTailCache.clear(),this._peerTailCache.set(n,a),a}_portSend(e,t,n){let r=this._peerTail(t,n),i=new Uint8Array(8+r.byteLength+4+e.byteLength),a=new DataView(i.buffer);a.setUint32(0,i.byteLength-4),a.setUint32(4,this._socketId),i.set(r,8),a.setUint32(8+r.byteLength,e.byteLength),i.set(e,12+r.byteLength),this._sendQueue.push(i),this._sendQueueBytes+=i.byteLength,!this._sendFlushScheduled&&(this._sendFlushScheduled=!0,queueMicrotask(()=>{this._sendFlushScheduled=!1;let e=this._sendQueue,t=this._sendQueueBytes;if(this._sendQueue=[],this._sendQueueBytes=0,!e.length||!this._dataPort)return;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;this._dataPort.postMessage(n.buffer,[n.buffer])}))}addMembership(e,t){if(o.Address4.isValid(e)){let n=d(e),r=t&&o.Address4.isValid(t)?d(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:5,group:n,interface:r})}else if(o.Address6.isValid(e)){let t=p(e);this._setUdpOption({type:7,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}address(){if(!this._localAddress)throw Error(`EBADF`);return this._localAddress}bind(...e){let n=r.o(...e),i=this._type===`udp6`?`::`:`0.0.0.0`,a=this.__webvpn_udp_socket_init__(t.o(`a udp socket`).then(e=>e.cloud.webvpn.udpSocket({type:this._type,address:n.address??i,port:n.port,dataPort:!0})));return n.callback&&a.then(e=>{e&&n.callback.call(this)}),this}__webvpn_udp_socket_init__(e,t){return t&&(this._localAddress={address:t.localAddress,family:t.localFamily,port:t.localPort}),this._busyRelease??=n.t(`udp socket`),this._webVPNUdpSocketPromise=e.then(e=>{if(e.dataPort)this._socketId=e.socketId,this._dataPort=e.dataPort,this._dataPortAcks=e.dataPortAcks===!0,this._dataPort.onmessage=e=>{try{this._onDataPortBatch(e.data)}finally{this._ackDataPortBatch(e.data.byteLength)}};else{let t=e.dataReadableStream.getReader();(async()=>{for(;;){let{value:e,done:n}=await t.read();if(n)return;this.emit(`message`,i.Buffer.from(e.data),{address:e.address,family:e.family,port:e.port,size:e.size})}})().catch(e=>this._onTransportClosed(e instanceof Error?e.message:void 0))}return e.closed?.then(e=>this._onTransportClosed(e?.reason)).catch(()=>{}),this._localAddress={address:e.localAddress,family:e.localFamily,port:e.localPort},e}).catch(e=>{this.emit(`error`,e)}),this._webVPNUdpSocketPromise.then(e=>{if(!e){this._busyRelease?.();return}this.emit(`listening`)}),this._webVPNUdpSocketPromise}close(e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);return this._webVPNUdpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not bound`);let n=this._destroyed;this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0;try{await t.close()}finally{try{e&&e()}finally{n||this.emit(`close`)}}}).catch(()=>{}),this}connect(...e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not bound`);let n=e[0],r=this._type===`udp6`?`::1`:`127.0.0.1`,i=typeof e[1]==`string`?e[1]:r,a=typeof e.at(-1)==`function`?e.at(-1):void 0,o=await t.connect({remotePort:n,remoteAddress:i});this._connectedLocally=o?.local===!0,this._remoteAddress=o?.address?{address:o.address,family:o.family,port:o.port}:{address:i,family:this._type===`udp6`?`IPv6`:`IPv4`,port:n},this._connectGeneration+=1,a&&a()}).catch(e=>{this.emit(`error`,e)})}disconnect(){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);let e=this._remoteAddress,t=this._connectedLocally,n=this._connectGeneration;this._remoteAddress=void 0,this._connectedLocally=void 0,this._webVPNUdpSocketPromise.then(e=>e?.disconnect?.()).catch(r=>{this._connectGeneration===n&&(this._remoteAddress=e,this._connectedLocally=t),this.emit(`error`,r)})}dropMembership(e,t){if(o.Address4.isValid(e)){let n=d(e),r=t&&o.Address4.isValid(t)?d(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:6,group:n,interface:r})}else if(o.Address6.isValid(e)){let t=p(e);this._setUdpOption({type:8,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}getRecvBufferSize(){return this._lastRecvBufferSize}getSendBufferSize(){return this._lastSendBufferSize}getSendQueueSize(){return 0}getSendQueueCount(){return 0}ref(){return this}remoteAddress(){if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);return{address:this._remoteAddress.address,family:this._remoteAddress.family,port:this._remoteAddress.port}}send(...e){this._webVPNUdpSocketPromise||this.bind();let t=r.s(...e),n=u(t.message),i=n;if(t.hasRange){let{offset:e,length:r}=t;if(!Number.isInteger(e)||e<0||e>n.byteLength)throw Object.assign(RangeError(`"offset" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});if(!Number.isInteger(r)||r<0||r>n.byteLength-e)throw Object.assign(RangeError(`"length" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});i=n.subarray(e,e+r)}let a=this._type===`udp6`?`::1`:`127.0.0.1`;if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(e=>{if(!e)throw Error(`Socket not bound`);let n=t.callback,r=t.address??a,s=this._remoteAddress!==void 0&&t.address===void 0;if(this._dataPort&&(s||o.Address4.isValid(r)||o.Address6.isValid(r))){this._portSend(i,s?void 0:r,s?void 0:t.port),n?.call(this,null,i.byteLength);return}e.send({port:t.port,address:r,message:i.byteOffset===0&&i.byteLength===i.buffer.byteLength?i.buffer:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)}).then(()=>n?.call(this,null,i.byteLength),e=>n?n.call(this,e,0):this.emit(`error`,e))})}setBroadcast(e){this._setUdpOption({type:0,value:e})}setMulticastInterface(e){}setMulticastLoopback(e){return this._setUdpOption({type:3,value:e}),this._setUdpOption({type:4,value:e}),this._lastMulticastLoopback=e,e}setMulticastTTL(e){return this._setUdpOption({type:2,value:e}),this._lastMulticastTtl=e,e}setRecvBufferSize(e){this._setUdpOption({type:10,value:e}),this._lastRecvBufferSize=e}setSendBufferSize(e){this._setUdpOption({type:9,value:e}),this._lastSendBufferSize=e}setTTL(e){return this._setUdpOption({type:1,value:e}),this._lastTtl=e,e}unref(){return this}addSourceSpecificMembership(e,t,n){}dropSourceSpecificMembership(e,t,n){}async[Symbol.asyncDispose](){await new Promise(e=>{this.close(e)})}},l=new Uint8Array([2]),u=e=>{if(typeof e==`string`)return r.l.encode(e);if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(Array.isArray(e)){let t=e.map(u),n=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0)),r=0;for(let e of t)n.set(e,r),r+=e.byteLength;return n}return new Uint8Array(e)},d=e=>{let t=e.split(`.`).map(e=>parseInt(e,10));if(t.length!==4||t.some(e=>Number.isNaN(e)||e<0||e>255))throw Error(`Invalid IPv4 address: ${e}`);return new Uint8Array(t)},f=e=>{let t=[];for(let n=0;n<16;n+=2)t.push(e[n]<<8|e[n+1]);let n=-1,r=1;for(let e=0;e<8;){if(t[e]!==0){e++;continue}let i=e;for(;i<8&&t[i]===0;)i++;i-e>r&&(n=e,r=i-e),e=i}return n===-1?t.map(e=>e.toString(16)).join(`:`):`${t.slice(0,n).map(e=>e.toString(16)).join(`:`)}::${t.slice(n+r).map(e=>e.toString(16)).join(`:`)}`},p=e=>{let t=new o.Address6(e).getBitsBase16(0,128).match(/.{2}/g);if(!t||t.length!==16)throw Error(`Invalid IPv6 address: ${e}`);return new Uint8Array(t.map(e=>parseInt(e,16)))},m=(e,t)=>{let n=new c(typeof e==`string`?{type:e}:e);return t&&n.on(`message`,t),n},h={Socket:c,createSocket:m};exports.Socket=c,exports.createSocket=m,exports.default=h,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api--LOXTOpv.cjs"),n=require("./busy-Dv8wzE5M.cjs"),r=require("./utils-BvgGdrgN.cjs");require("./wire.cjs");let i=require("buffer"),a=require("events"),o=require("ip-address");var s=e.t({Socket:()=>c,createSocket:()=>m,default:()=>h}),c=class extends a.EventEmitter{_type;_localAddress;_remoteAddress;_connectedLocally;_connectGeneration=0;_destroyed=!1;_busyRelease;_webVPNUdpSocketPromise;_dataPort;_socketId;_sendQueue=[];_sendQueueBytes=0;_sendFlushScheduled=!1;_peerTailCache=new Map;constructor(e){if(super(e),!e)throw Error(`Missing options`);this._type=e.type,e.connection&&this.__webvpn_udp_socket_init__(e.connection)}_lastRecvBufferSize=0;_lastSendBufferSize=0;_lastTtl=64;_lastMulticastTtl=1;_lastMulticastLoopback=!0;_setUdpOption(e){if(!this._webVPNUdpSocketPromise){this.emit(`error`,Error(`Cannot set socket option before bind`));return}this._webVPNUdpSocketPromise.then(async t=>{if(t)try{await t.setOption(e)}catch(e){this.emit(`error`,e)}})}_dataPortAcks=!1;_dataPortConsumedBytes=0;_dataPortAckedBytes=0;_ackDataPortBatch(e){if(!this._dataPortAcks||!this._dataPort||(this._dataPortConsumedBytes+=e,this._dataPortAckedBytes!==0&&this._dataPortConsumedBytes-this._dataPortAckedBytes<524288))return;this._dataPortAckedBytes=this._dataPortConsumedBytes;let t={type:r.n,consumedBytes:this._dataPortConsumedBytes};this._dataPort.postMessage(t)}_onTransportClosed(e){this._destroyed||(this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0,this.listenerCount(`error`)>0&&this.emit(`error`,Error(e||`WebVPN session closed`)),this.emit(`close`))}_onDataPortBatch(e){let t=new DataView(e),n=!1,r,a=0;for(;a+4<=e.byteLength;){let o=t.getUint32(a);a+=4;let s=a+o;if(s>e.byteLength)break;let c=a+4,l=t.getUint8(c);c+=1;let u,d,p;if(l===2){if(!this._remoteAddress){a=s;continue}u=this._remoteAddress.address,d=this._remoteAddress.family,p=this._remoteAddress.port}else{let n=new Uint8Array(e,c,l===0?4:16);l===0?(d=`IPv4`,u=`${n[0]}.${n[1]}.${n[2]}.${n[3]}`):(d=`IPv6`,u=f(n)),c+=n.byteLength,p=t.getUint16(c),c+=2}let m=t.getUint32(c);c+=4;try{this.emit(`message`,i.Buffer.from(e.slice(c,c+m)),{address:u,family:d,port:p,size:m})}catch(e){n||(n=!0,r=e)}a=s}if(n)throw r}_peerTail(e,t){if(e===void 0||t===void 0)return l;let n=`${e}|${t}`,r=this._peerTailCache.get(n);if(r)return r;let i=o.Address4.isValid(e)?d(e):p(e),a=new Uint8Array(1+i.byteLength+2);return a[0]=i.byteLength===4?0:1,a.set(i,1),new DataView(a.buffer).setUint16(1+i.byteLength,t),this._peerTailCache.size>=4096&&this._peerTailCache.clear(),this._peerTailCache.set(n,a),a}_portSend(e,t,n){let r=this._peerTail(t,n),i=new Uint8Array(8+r.byteLength+4+e.byteLength),a=new DataView(i.buffer);a.setUint32(0,i.byteLength-4),a.setUint32(4,this._socketId),i.set(r,8),a.setUint32(8+r.byteLength,e.byteLength),i.set(e,12+r.byteLength),this._sendQueue.push(i),this._sendQueueBytes+=i.byteLength,!this._sendFlushScheduled&&(this._sendFlushScheduled=!0,queueMicrotask(()=>{this._sendFlushScheduled=!1;let e=this._sendQueue,t=this._sendQueueBytes;if(this._sendQueue=[],this._sendQueueBytes=0,!e.length||!this._dataPort)return;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;this._dataPort.postMessage(n.buffer,[n.buffer])}))}addMembership(e,t){if(o.Address4.isValid(e)){let n=d(e),r=t&&o.Address4.isValid(t)?d(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:5,group:n,interface:r})}else if(o.Address6.isValid(e)){let t=p(e);this._setUdpOption({type:7,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}address(){if(!this._localAddress)throw Error(`EBADF`);return this._localAddress}bind(...e){let n=r.o(...e),i=this._type===`udp6`?`::`:`0.0.0.0`,a=this.__webvpn_udp_socket_init__(t.s(`a udp socket`).then(e=>e.cloud.webvpn.udpSocket({type:this._type,address:n.address??i,port:n.port,dataPort:!0})));return n.callback&&a.then(e=>{e&&n.callback.call(this)}),this}__webvpn_udp_socket_init__(e,t){return t&&(this._localAddress={address:t.localAddress,family:t.localFamily,port:t.localPort}),this._busyRelease??=n.t(`udp socket`),this._webVPNUdpSocketPromise=e.then(e=>{if(e.dataPort)this._socketId=e.socketId,this._dataPort=e.dataPort,this._dataPortAcks=e.dataPortAcks===!0,this._dataPort.onmessage=e=>{try{this._onDataPortBatch(e.data)}finally{this._ackDataPortBatch(e.data.byteLength)}};else{let t=e.dataReadableStream.getReader();(async()=>{for(;;){let{value:e,done:n}=await t.read();if(n)return;this.emit(`message`,i.Buffer.from(e.data),{address:e.address,family:e.family,port:e.port,size:e.size})}})().catch(e=>this._onTransportClosed(e instanceof Error?e.message:void 0))}return e.closed?.then(e=>this._onTransportClosed(e?.reason)).catch(()=>{}),this._localAddress={address:e.localAddress,family:e.localFamily,port:e.localPort},e}).catch(e=>{this.emit(`error`,e)}),this._webVPNUdpSocketPromise.then(e=>{if(!e){this._busyRelease?.();return}this.emit(`listening`)}),this._webVPNUdpSocketPromise}close(e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);return this._webVPNUdpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not bound`);let n=this._destroyed;this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0;try{await t.close()}finally{try{e&&e()}finally{n||this.emit(`close`)}}}).catch(()=>{}),this}connect(...e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not bound`);let n=e[0],r=this._type===`udp6`?`::1`:`127.0.0.1`,i=typeof e[1]==`string`?e[1]:r,a=typeof e.at(-1)==`function`?e.at(-1):void 0,o=await t.connect({remotePort:n,remoteAddress:i});this._connectedLocally=o?.local===!0,this._remoteAddress=o?.address?{address:o.address,family:o.family,port:o.port}:{address:i,family:this._type===`udp6`?`IPv6`:`IPv4`,port:n},this._connectGeneration+=1,a&&a()}).catch(e=>{this.emit(`error`,e)})}disconnect(){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);let e=this._remoteAddress,t=this._connectedLocally,n=this._connectGeneration;this._remoteAddress=void 0,this._connectedLocally=void 0,this._webVPNUdpSocketPromise.then(e=>e?.disconnect?.()).catch(r=>{this._connectGeneration===n&&(this._remoteAddress=e,this._connectedLocally=t),this.emit(`error`,r)})}dropMembership(e,t){if(o.Address4.isValid(e)){let n=d(e),r=t&&o.Address4.isValid(t)?d(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:6,group:n,interface:r})}else if(o.Address6.isValid(e)){let t=p(e);this._setUdpOption({type:8,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}getRecvBufferSize(){return this._lastRecvBufferSize}getSendBufferSize(){return this._lastSendBufferSize}getSendQueueSize(){return 0}getSendQueueCount(){return 0}ref(){return this}remoteAddress(){if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);return{address:this._remoteAddress.address,family:this._remoteAddress.family,port:this._remoteAddress.port}}send(...e){this._webVPNUdpSocketPromise||this.bind();let t=r.s(...e),n=u(t.message),i=n;if(t.hasRange){let{offset:e,length:r}=t;if(!Number.isInteger(e)||e<0||e>n.byteLength)throw Object.assign(RangeError(`"offset" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});if(!Number.isInteger(r)||r<0||r>n.byteLength-e)throw Object.assign(RangeError(`"length" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});i=n.subarray(e,e+r)}let a=this._type===`udp6`?`::1`:`127.0.0.1`;if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(e=>{if(!e)throw Error(`Socket not bound`);let n=t.callback,r=t.address??a,s=this._remoteAddress!==void 0&&t.address===void 0;if(this._dataPort&&(s||o.Address4.isValid(r)||o.Address6.isValid(r))){this._portSend(i,s?void 0:r,s?void 0:t.port),n?.call(this,null,i.byteLength);return}e.send({port:t.port,address:r,message:i.byteOffset===0&&i.byteLength===i.buffer.byteLength?i.buffer:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)}).then(()=>n?.call(this,null,i.byteLength),e=>n?n.call(this,e,0):this.emit(`error`,e))})}setBroadcast(e){this._setUdpOption({type:0,value:e})}setMulticastInterface(e){}setMulticastLoopback(e){return this._setUdpOption({type:3,value:e}),this._setUdpOption({type:4,value:e}),this._lastMulticastLoopback=e,e}setMulticastTTL(e){return this._setUdpOption({type:2,value:e}),this._lastMulticastTtl=e,e}setRecvBufferSize(e){this._setUdpOption({type:10,value:e}),this._lastRecvBufferSize=e}setSendBufferSize(e){this._setUdpOption({type:9,value:e}),this._lastSendBufferSize=e}setTTL(e){return this._setUdpOption({type:1,value:e}),this._lastTtl=e,e}unref(){return this}addSourceSpecificMembership(e,t,n){}dropSourceSpecificMembership(e,t,n){}async[Symbol.asyncDispose](){await new Promise(e=>{this.close(e)})}},l=new Uint8Array([2]),u=e=>{if(typeof e==`string`)return r.l.encode(e);if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(Array.isArray(e)){let t=e.map(u),n=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0)),r=0;for(let e of t)n.set(e,r),r+=e.byteLength;return n}return new Uint8Array(e)},d=e=>{let t=e.split(`.`).map(e=>parseInt(e,10));if(t.length!==4||t.some(e=>Number.isNaN(e)||e<0||e>255))throw Error(`Invalid IPv4 address: ${e}`);return new Uint8Array(t)},f=e=>{let t=[];for(let n=0;n<16;n+=2)t.push(e[n]<<8|e[n+1]);let n=-1,r=1;for(let e=0;e<8;){if(t[e]!==0){e++;continue}let i=e;for(;i<8&&t[i]===0;)i++;i-e>r&&(n=e,r=i-e),e=i}return n===-1?t.map(e=>e.toString(16)).join(`:`):`${t.slice(0,n).map(e=>e.toString(16)).join(`:`)}::${t.slice(n+r).map(e=>e.toString(16)).join(`:`)}`},p=e=>{let t=new o.Address6(e).getBitsBase16(0,128).match(/.{2}/g);if(!t||t.length!==16)throw Error(`Invalid IPv6 address: ${e}`);return new Uint8Array(t.map(e=>parseInt(e,16)))},m=(e,t)=>{let n=new c(typeof e==`string`?{type:e}:e);return t&&n.on(`message`,t),n},h={Socket:c,createSocket:m};exports.Socket=c,exports.createSocket=m,exports.default=h,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
|
package/dgram.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { K as Resolvers, Ot as UdpSocketResult } from "./contract-DJxGa8lb.js";
|
|
1
2
|
import { v as UdpSocketOption } from "./wire-Gbo-D74t.js";
|
|
2
|
-
import
|
|
3
|
-
import "./api-Cbty0JUM.js";
|
|
3
|
+
import "./api-H1TzWitc.js";
|
|
4
4
|
import { Buffer } from "buffer";
|
|
5
5
|
import { AddressInfo } from "net";
|
|
6
6
|
import { EventEmitter } from "events";
|
package/dgram.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import {
|
|
2
|
+
import { s as t } from "./api-DIgTslNb.js";
|
|
3
3
|
import { t as n } from "./busy-B189uX--.js";
|
|
4
4
|
import { l as r, n as i, o as a, s as o } from "./utils-C-cAd4r4.js";
|
|
5
5
|
import "./wire.js";
|
package/dns.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--LOXTOpv.cjs");var n=e.t({lookup:()=>r}),r=(e,n)=>t.o.then(t=>t.cloud.dns.lookup(e,n));exports.lookup=r,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
|
package/dns.d.ts
CHANGED
package/dns.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import {
|
|
2
|
+
import { o as t } from "./api-DIgTslNb.js";
|
|
3
3
|
//#region src/dns.ts
|
|
4
4
|
var n = /* @__PURE__ */ e({ lookup: () => r }), r = (e, n) => t.then((t) => t.cloud.dns.lookup(e, n));
|
|
5
5
|
//#endregion
|
|
@@ -1,10 +1,29 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { $ as GateTools, A as attachFramePermission, B as CategoryMeta, C as FrameWindowRefusal, D as StorageState, E as Locator, F as LegacyPermissionRequest, G as VideoElementState, H as handleRevivableModules, I as PermissionGrant, J as isType, K as box, L as PermissionRequest, M as gotoPermission, N as CategoryGrant, O as StorageStateCookie, P as CategoryRequest, Q as Gate, R as permissions, S as FrameWindowOptions, T as GotoOptions, U as BoxedVideoElement, V as PermissionCategory, W as RemoteVideoElement, X as type, Y as revive, Z as Executor, _ as FrameEventMap, a as AttachCookies, b as FramePostMessageOptions, c as BlankPage, d as CookieMatchWire, et as OperationRequest, f as Frame, g as FrameEventListener, h as FrameDocumentEvent, i as AddScriptTagOptions, j as createFrame, k as WindowFrame, l as ClearCookiesOptions, m as FrameBackendEvent, n as attachFrame, o as AttachFrameOptions, p as FrameBackend, q as createVideoElementHandle, s as AttachWindowOptions, t as ATTACH_FRAME_EVENT_KEY, tt as SelectorPart, u as ClearCookiesWire, v as FrameLocator, w as FrameWindowRefusedError, x as FrameWindowBlockedError, y as FrameMessageEvent, z as CATEGORIES } from "./index-Cgnfjh9o.js";
|
|
2
2
|
//#region ../frame-locator/lib/errors.d.ts
|
|
3
3
|
declare const LOCATOR_ERROR = "LocatorError";
|
|
4
4
|
declare const LOCATOR_UNSUPPORTED = "LocatorUnsupportedError";
|
|
5
5
|
declare const LOCATOR_DENIED = "LocatorDeniedError";
|
|
6
|
+
declare const LOCATOR_INVALID = "LocatorInvalidError";
|
|
7
|
+
/**
|
|
8
|
+
* A call that ran out of time: its deadline passed before it settled. One class for every call that
|
|
9
|
+
* has a deadline, as Playwright's `TimeoutError`, named `'TimeoutError'` so a check by name works as
|
|
10
|
+
* well as `instanceof`. It is minted where the call was made, never in the realm that ran it, so it
|
|
11
|
+
* is an instance of this class in the caller's realm.
|
|
12
|
+
*
|
|
13
|
+
* `message` is what the call reported at its deadline, unchanged from the error it replaces. `cause`
|
|
14
|
+
* is the last retryable error an attempt met before the deadline, so a locator call that never found
|
|
15
|
+
* its element says why; it is absent when no attempt failed (one never settled, or the call is not
|
|
16
|
+
* retried). Not terminal: nothing retries a call past its own deadline.
|
|
17
|
+
*/
|
|
18
|
+
declare class TimeoutError extends Error {
|
|
19
|
+
readonly name = "TimeoutError";
|
|
20
|
+
constructor(message: string, options?: {
|
|
21
|
+
cause?: unknown;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
6
24
|
declare const isLocatorUnsupported: (error: unknown) => boolean;
|
|
7
25
|
declare const isLocatorDenied: (error: unknown) => boolean;
|
|
26
|
+
declare const isLocatorInvalid: (error: unknown) => boolean;
|
|
8
27
|
declare const isTerminalError: (error: unknown) => boolean;
|
|
9
28
|
//#endregion
|
|
10
29
|
//#region ../web-extension/lib/lib/forgeable-headers.d.ts
|
|
@@ -47,6 +66,8 @@ type ProxyFetchRequest = {
|
|
|
47
66
|
body: ArrayBuffer | null;
|
|
48
67
|
credentials: 'include' | 'omit';
|
|
49
68
|
redirect: RequestRedirect;
|
|
69
|
+
/** the browser's HTTP cache mode, the browser's default when absent */
|
|
70
|
+
cache?: RequestCache;
|
|
50
71
|
unsafeHeaders?: [string, string][];
|
|
51
72
|
reason?: string;
|
|
52
73
|
signal?: AbortSignal;
|
|
@@ -132,6 +153,21 @@ type PermissionDeniedError = Error & {
|
|
|
132
153
|
};
|
|
133
154
|
declare const isPermissionDenied: (error: unknown) => boolean;
|
|
134
155
|
//#endregion
|
|
156
|
+
//#region ../web-extension/lib/utils/background-stopped.d.ts
|
|
157
|
+
declare const BACKGROUND_STOPPED = "BackgroundStoppedError";
|
|
158
|
+
/**
|
|
159
|
+
* What a call into the extension rejects with when Chrome stopped the extension's worker before it finished
|
|
160
|
+
* answering: before the call resolved, or, for a `fetch`, while its response body was still arriving.
|
|
161
|
+
*
|
|
162
|
+
* The call may or may not have run, so the extension never sends it again. Retrying is the app's decision, and a
|
|
163
|
+
* retry is answered by the restarted worker.
|
|
164
|
+
*/
|
|
165
|
+
type BackgroundStoppedError = Error & {
|
|
166
|
+
name: typeof BACKGROUND_STOPPED;
|
|
167
|
+
};
|
|
168
|
+
/** Whether `error` is a `BackgroundStoppedError`, matched on `name` since it may arrive as a revived Error or a plain record. */
|
|
169
|
+
declare const isBackgroundStopped: (error: unknown) => boolean;
|
|
170
|
+
//#endregion
|
|
135
171
|
//#region ../web-extension/lib/utils/extension-abi.d.ts
|
|
136
172
|
/**
|
|
137
173
|
* What the extension half announces about itself. Increment when the callable surface CHANGES in a
|
|
@@ -141,7 +177,7 @@ declare const isPermissionDenied: (error: unknown) => boolean;
|
|
|
141
177
|
* nothing to do with the protocol (a dependency bump, a store resubmission), and tying the contract
|
|
142
178
|
* to them would make every release look like a protocol change.
|
|
143
179
|
*/
|
|
144
|
-
declare const EXTENSION_ABI =
|
|
180
|
+
declare const EXTENSION_ABI = 4;
|
|
145
181
|
/**
|
|
146
182
|
* The oldest extension the page half will talk to. Raise it ONLY when the page half starts depending
|
|
147
183
|
* on something older extensions cannot do, never merely because `EXTENSION_ABI` moved: an added
|
|
@@ -234,7 +270,7 @@ declare const fetch: (input: RequestInfo | URL, init?: RequestInit & {
|
|
|
234
270
|
spread?: boolean;
|
|
235
271
|
}) => Promise<Response>;
|
|
236
272
|
declare namespace extension_d_exports {
|
|
237
|
-
export { ATTACH_FRAME_EVENT_KEY, AttachFrameOptions, AttachWindowOptions, BoxedVideoElement, CATEGORIES, CategoryGrant, CategoryMeta, CategoryRequest, CookieDetails, EXTENSION_ABI, Executor, ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, FrameBackendEvent, FrameDocumentEvent, FrameEventListener, FrameEventMap, FrameMessageEvent, FramePostMessageOptions, FrameWindowBlockedError, FrameWindowOptions, FrameWindowRefusal, FrameWindowRefusedError, Gate, GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_UNSUPPORTED, LegacyPermissionRequest, Locator, OperationRequest, PERMISSION_DENIED, PermissionCategory, PermissionDeniedError, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, SelectorPart, SiteCookie, VideoElementState, WindowFrame, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFrame, attachFramePermission, isExtensionAvailable as available, box, cookies, createFrame, createVideoElementHandle, extension as events, extension, fetch$1 as fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, gotoPermission, handleRevivableModules, hasForgedCookie, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorUnsupported, isPermissionDenied, isTerminalError, isType, modifyRequestHeadersPermission, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, setMissingExtensionHandler, setRequestHeaderRule, supportsOperation, type, waitForExtensionExposure };
|
|
273
|
+
export { ATTACH_FRAME_EVENT_KEY, AddScriptTagOptions, AttachCookies, AttachFrameOptions, AttachWindowOptions, BACKGROUND_STOPPED, BackgroundStoppedError, BlankPage, BoxedVideoElement, CATEGORIES, CategoryGrant, CategoryMeta, CategoryRequest, ClearCookiesOptions, ClearCookiesWire, CookieDetails, CookieMatchWire, EXTENSION_ABI, Executor, ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, FrameBackendEvent, FrameDocumentEvent, FrameEventListener, FrameEventMap, FrameLocator, FrameMessageEvent, FramePostMessageOptions, FrameWindowBlockedError, FrameWindowOptions, FrameWindowRefusal, FrameWindowRefusedError, Gate, GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_INVALID, LOCATOR_UNSUPPORTED, LegacyPermissionRequest, Locator, OperationRequest, PERMISSION_DENIED, PermissionCategory, PermissionDeniedError, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, SelectorPart, SiteCookie, StorageState, StorageStateCookie, TimeoutError, VideoElementState, WindowFrame, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFrame, attachFramePermission, isExtensionAvailable as available, box, cookies, createFrame, createVideoElementHandle, extension as events, extension, fetch$1 as fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, gotoPermission, handleRevivableModules, hasForgedCookie, isBackgroundStopped, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorInvalid, isLocatorUnsupported, isPermissionDenied, isTerminalError, isType, modifyRequestHeadersPermission, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, setMissingExtensionHandler, setRequestHeaderRule, supportsOperation, type, waitForExtensionExposure };
|
|
238
274
|
}
|
|
239
275
|
//#endregion
|
|
240
|
-
export {
|
|
276
|
+
export { isLocatorInvalid as $, CookieDetails as A, fetchPermission as B, assertLockdownApplicable as C, modifyRequestHeadersPermission as D, RequestHeaderRule as E, ProxyFetchRequest as F, assertOneCookieIdentity as G, isLocalNetworkUrl as H, assertFetchableUrl as I, LOCATOR_ERROR as J, hasForgedCookie as K, fetch$1 as L, cookies as M, readCookiePermission as N, removeRequestHeaderRule as O, FetchInit as P, isLocatorDenied as Q, fetchCredentialedPermission as R, assertAttachableFrameUrl as S, HeaderOperation as T, FORGEABLE_HEADERS as U, isBlockedFetchUrl as V, assertForgeableHeaders as W, LOCATOR_UNSUPPORTED as X, LOCATOR_INVALID as Y, TimeoutError as Z, BackgroundStoppedError as _, extension as a, PermissionDeniedError as b, setMissingExtensionHandler as c, ExtensionHandshake as d, isLocatorUnsupported as et, ExtensionOperationUnsupportedError as f, BACKGROUND_STOPPED as g, supportsOperation as h, promptInstall as i, SiteCookie as j, setRequestHeaderRule as k, waitForExtensionExposure as l, REQUIRED_EXTENSION_ABI as m, fetch as n, isExtensionExposed as o, ExtensionOutdatedError as p, LOCATOR_DENIED as q, isExtensionAvailable as r, readExtensionHandshake as s, extension_d_exports as t, isTerminalError as tt, EXTENSION_ABI as u, isBackgroundStopped as v, isBlockedFrameUrl as w, isPermissionDenied as x, PERMISSION_DENIED as y, fetchLocalPermission as z };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
+
import { $ as t, B as n, C as r, D as i, E as a, F as o, G as ee, H as te, I as ne, J as s, K as c, L as l, N as u, P as d, Q as re, R as ie, S as f, T as p, U as m, V as h, W as g, X as _, Y as v, Z as y, _ as b, a as x, at as S, b as C, ct as w, d as T, dt as E, et as D, ft as O, g as k, i as A, j, k as M, lt as N, mt as P, n as ae, nt as F, ot as I, pt as L, q as R, r as z, rt as B, t as V, tt as H, ut as U, v as W, w as G, x as K, y as q, z as J } from "./lib-C3UwxjVs.js";
|
|
3
|
+
import { o as oe, p as se } from "./api-DIgTslNb.js";
|
|
4
|
+
import { t as ce } from "./proxy-Dixbk1WL.js";
|
|
5
|
+
import { available as le, fetch as ue } from "./desktop.js";
|
|
6
|
+
//#region ../web-extension/lib/utils/background-stopped.js
|
|
7
|
+
var Y = "BackgroundStoppedError", X = (e) => T(e) && e.name === "BackgroundStoppedError", Z = async (e) => {
|
|
8
|
+
if (typeof window > "u") return !1;
|
|
9
|
+
if (D()) return !0;
|
|
10
|
+
let n = await oe, r = null, i = new Promise((e) => {
|
|
11
|
+
r = () => {
|
|
12
|
+
D() && e(!0);
|
|
13
|
+
}, t.addEventListener("statuschange", r);
|
|
14
|
+
}), a = n.installPrompt.show(e).then(() => !1), o = await Promise.race([i, a]);
|
|
15
|
+
return r && t.removeEventListener("statuschange", r), await n.installPrompt.hide().catch(() => {}), o;
|
|
16
|
+
}, Q = null;
|
|
17
|
+
F(() => (Q ||= Z().then(() => void 0).finally(() => {
|
|
18
|
+
Q = null;
|
|
19
|
+
}), Q));
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/auto.ts
|
|
22
|
+
var $ = () => typeof document < "u" && D(), de = async (e, t) => {
|
|
23
|
+
if (se(e), t?.credentials === "include") {
|
|
24
|
+
if (typeof document > "u") throw Error("fetch with credentials needs the FKN extension, which only exists in window realms");
|
|
25
|
+
return m(e, t);
|
|
26
|
+
}
|
|
27
|
+
return $() ? m(e, {
|
|
28
|
+
...t,
|
|
29
|
+
credentials: "omit"
|
|
30
|
+
}) : le() ? ue(e, t) : ce(e, t);
|
|
31
|
+
}, fe = /* @__PURE__ */ e({
|
|
32
|
+
ATTACH_FRAME_EVENT_KEY: () => A,
|
|
33
|
+
BACKGROUND_STOPPED: () => Y,
|
|
34
|
+
CATEGORIES: () => G,
|
|
35
|
+
EXTENSION_ABI: () => 4,
|
|
36
|
+
ExtensionOperationUnsupportedError: () => S,
|
|
37
|
+
ExtensionOutdatedError: () => I,
|
|
38
|
+
FORGEABLE_HEADERS: () => v,
|
|
39
|
+
FrameWindowBlockedError: () => k,
|
|
40
|
+
FrameWindowRefusedError: () => b,
|
|
41
|
+
LOCATOR_DENIED: () => M,
|
|
42
|
+
LOCATOR_ERROR: () => d,
|
|
43
|
+
LOCATOR_INVALID: () => ne,
|
|
44
|
+
LOCATOR_UNSUPPORTED: () => a,
|
|
45
|
+
PERMISSION_DENIED: () => V,
|
|
46
|
+
REQUIRED_EXTENSION_ABI: () => 0,
|
|
47
|
+
TimeoutError: () => p,
|
|
48
|
+
assertAttachableFrameUrl: () => K,
|
|
49
|
+
assertFetchableUrl: () => te,
|
|
50
|
+
assertForgeableHeaders: () => _,
|
|
51
|
+
assertLockdownApplicable: () => f,
|
|
52
|
+
assertOneCookieIdentity: () => y,
|
|
53
|
+
attachFrame: () => x,
|
|
54
|
+
attachFramePermission: () => W,
|
|
55
|
+
available: () => $,
|
|
56
|
+
box: () => U,
|
|
57
|
+
cookies: () => n,
|
|
58
|
+
createFrame: () => q,
|
|
59
|
+
createVideoElementHandle: () => E,
|
|
60
|
+
events: () => t,
|
|
61
|
+
extension: () => t,
|
|
62
|
+
fetch: () => m,
|
|
63
|
+
fetchCredentialedPermission: () => g,
|
|
64
|
+
fetchLocalPermission: () => ee,
|
|
65
|
+
fetchPermission: () => c,
|
|
66
|
+
gotoPermission: () => C,
|
|
67
|
+
handleRevivableModules: () => N,
|
|
68
|
+
hasForgedCookie: () => re,
|
|
69
|
+
isBackgroundStopped: () => X,
|
|
70
|
+
isBlockedFetchUrl: () => R,
|
|
71
|
+
isBlockedFrameUrl: () => r,
|
|
72
|
+
isExtensionExposed: () => D,
|
|
73
|
+
isLocalNetworkUrl: () => s,
|
|
74
|
+
isLocatorDenied: () => o,
|
|
75
|
+
isLocatorInvalid: () => j,
|
|
76
|
+
isLocatorUnsupported: () => i,
|
|
77
|
+
isPermissionDenied: () => ae,
|
|
78
|
+
isTerminalError: () => u,
|
|
79
|
+
isType: () => O,
|
|
80
|
+
modifyRequestHeadersPermission: () => l,
|
|
81
|
+
permissions: () => z,
|
|
82
|
+
promptInstall: () => Z,
|
|
83
|
+
readCookiePermission: () => h,
|
|
84
|
+
readExtensionHandshake: () => H,
|
|
85
|
+
removeRequestHeaderRule: () => ie,
|
|
86
|
+
revive: () => L,
|
|
87
|
+
setMissingExtensionHandler: () => F,
|
|
88
|
+
setRequestHeaderRule: () => J,
|
|
89
|
+
supportsOperation: () => w,
|
|
90
|
+
type: () => P,
|
|
91
|
+
waitForExtensionExposure: () => B
|
|
92
|
+
});
|
|
93
|
+
//#endregion
|
|
94
|
+
export { Y as a, Z as i, de as n, X as o, $ as r, fe as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-fqQfEPk6.cjs"),n=require("./api--LOXTOpv.cjs"),r=require("./proxy-CFK-KiwE.cjs"),i=require("./desktop.cjs");var a=`BackgroundStoppedError`,o=e=>t.d(e)&&e.name===`BackgroundStoppedError`,s=async e=>{if(typeof window>`u`)return!1;if(t.et())return!0;let r=await n.o,i=null,a=new Promise(e=>{i=()=>{t.et()&&e(!0)},t.$.addEventListener(`statuschange`,i)}),o=r.installPrompt.show(e).then(()=>!1),s=await Promise.race([a,o]);return i&&t.$.removeEventListener(`statuschange`,i),await r.installPrompt.hide().catch(()=>{}),s},c=null;t.nt(()=>(c||=s().then(()=>void 0).finally(()=>{c=null}),c));var l=()=>typeof document<`u`&&t.et(),u=async(e,a)=>{if(n.p(e),a?.credentials===`include`){if(typeof document>`u`)throw Error(`fetch with credentials needs the FKN extension, which only exists in window realms`);return t.U(e,a)}return l()?t.U(e,{...a,credentials:`omit`}):i.available()?i.fetch(e,a):r.t(e,a)},d=e.t({ATTACH_FRAME_EVENT_KEY:()=>t.i,BACKGROUND_STOPPED:()=>a,CATEGORIES:()=>t.w,EXTENSION_ABI:()=>4,ExtensionOperationUnsupportedError:()=>t.at,ExtensionOutdatedError:()=>t.ot,FORGEABLE_HEADERS:()=>t.Y,FrameWindowBlockedError:()=>t.g,FrameWindowRefusedError:()=>t._,LOCATOR_DENIED:()=>t.k,LOCATOR_ERROR:()=>t.P,LOCATOR_INVALID:()=>t.I,LOCATOR_UNSUPPORTED:()=>t.E,PERMISSION_DENIED:()=>t.t,REQUIRED_EXTENSION_ABI:()=>0,TimeoutError:()=>t.T,assertAttachableFrameUrl:()=>t.x,assertFetchableUrl:()=>t.H,assertForgeableHeaders:()=>t.X,assertLockdownApplicable:()=>t.S,assertOneCookieIdentity:()=>t.Z,attachFrame:()=>t.a,attachFramePermission:()=>t.v,available:()=>l,box:()=>t.ut,cookies:()=>t.B,createFrame:()=>t.y,createVideoElementHandle:()=>t.dt,events:()=>t.$,extension:()=>t.$,fetch:()=>t.U,fetchCredentialedPermission:()=>t.W,fetchLocalPermission:()=>t.G,fetchPermission:()=>t.K,gotoPermission:()=>t.b,handleRevivableModules:()=>t.lt,hasForgedCookie:()=>t.Q,isBackgroundStopped:()=>o,isBlockedFetchUrl:()=>t.q,isBlockedFrameUrl:()=>t.C,isExtensionExposed:()=>t.et,isLocalNetworkUrl:()=>t.J,isLocatorDenied:()=>t.F,isLocatorInvalid:()=>t.j,isLocatorUnsupported:()=>t.D,isPermissionDenied:()=>t.n,isTerminalError:()=>t.N,isType:()=>t.ft,modifyRequestHeadersPermission:()=>t.L,permissions:()=>t.r,promptInstall:()=>s,readCookiePermission:()=>t.V,readExtensionHandshake:()=>t.tt,removeRequestHeaderRule:()=>t.R,revive:()=>t.pt,setMissingExtensionHandler:()=>t.nt,setRequestHeaderRule:()=>t.z,supportsOperation:()=>t.ct,type:()=>t.mt,waitForExtensionExposure:()=>t.rt});Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return d}});
|
package/extension.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib-fqQfEPk6.cjs"),t=require("./extension-DvFf7uoG.cjs");exports.ATTACH_FRAME_EVENT_KEY=e.i,exports.BACKGROUND_STOPPED=t.a,exports.CATEGORIES=e.w,exports.EXTENSION_ABI=e.it,exports.ExtensionOperationUnsupportedError=e.at,exports.ExtensionOutdatedError=e.ot,exports.FORGEABLE_HEADERS=e.Y,exports.FrameWindowBlockedError=e.g,exports.FrameWindowRefusedError=e._,exports.LOCATOR_DENIED=e.k,exports.LOCATOR_ERROR=e.P,exports.LOCATOR_INVALID=e.I,exports.LOCATOR_UNSUPPORTED=e.E,exports.PERMISSION_DENIED=e.t,exports.REQUIRED_EXTENSION_ABI=e.st,exports.TimeoutError=e.T,exports.assertAttachableFrameUrl=e.x,exports.assertFetchableUrl=e.H,exports.assertForgeableHeaders=e.X,exports.assertLockdownApplicable=e.S,exports.assertOneCookieIdentity=e.Z,exports.attachFrame=e.a,exports.attachFramePermission=e.v,exports.available=t.r,exports.box=e.ut,exports.cookies=e.B,exports.createFrame=e.y,exports.createVideoElementHandle=e.dt,exports.events=e.$,exports.extension=e.$,exports.fetch=e.U,exports.fetchCredentialedPermission=e.W,exports.fetchLocalPermission=e.G,exports.fetchPermission=e.K,exports.gotoPermission=e.b,exports.handleRevivableModules=e.lt,exports.hasForgedCookie=e.Q,exports.isBackgroundStopped=t.o,exports.isBlockedFetchUrl=e.q,exports.isBlockedFrameUrl=e.C,exports.isExtensionExposed=e.et,exports.isLocalNetworkUrl=e.J,exports.isLocatorDenied=e.F,exports.isLocatorInvalid=e.j,exports.isLocatorUnsupported=e.D,exports.isPermissionDenied=e.n,exports.isTerminalError=e.N,exports.isType=e.ft,exports.modifyRequestHeadersPermission=e.L,exports.permissions=e.r,exports.promptInstall=t.i,exports.readCookiePermission=e.V,exports.readExtensionHandshake=e.tt,exports.removeRequestHeaderRule=e.R,exports.revive=e.pt,exports.setMissingExtensionHandler=e.nt,exports.setRequestHeaderRule=e.z,exports.supportsOperation=e.ct,exports.type=e.mt,exports.waitForExtensionExposure=e.rt;
|
package/extension.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { A as
|
|
3
|
-
export { ATTACH_FRAME_EVENT_KEY, AttachFrameOptions, AttachWindowOptions, BoxedVideoElement, CATEGORIES, CategoryGrant, type CategoryMeta, CategoryRequest, CookieDetails, EXTENSION_ABI, type Executor, type ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, FrameBackendEvent, FrameDocumentEvent, FrameEventListener, FrameEventMap, FrameMessageEvent, FramePostMessageOptions, FrameWindowBlockedError, FrameWindowOptions, FrameWindowRefusal, FrameWindowRefusedError, type Gate, type GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_UNSUPPORTED, LegacyPermissionRequest, Locator, type OperationRequest, PERMISSION_DENIED, type PermissionCategory, type PermissionDeniedError, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, type SelectorPart, SiteCookie, VideoElementState, WindowFrame, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFrame, attachFramePermission, isExtensionAvailable as available, box, cookies, createFrame, createVideoElementHandle, extension as events, extension, fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, gotoPermission, handleRevivableModules, hasForgedCookie, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorUnsupported, isPermissionDenied, isTerminalError, isType, modifyRequestHeadersPermission, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, setMissingExtensionHandler, setRequestHeaderRule, supportsOperation, type, waitForExtensionExposure };
|
|
1
|
+
import { $ as GateTools, A as attachFramePermission, B as CategoryMeta, C as FrameWindowRefusal, D as StorageState, E as Locator, F as LegacyPermissionRequest, G as VideoElementState, H as handleRevivableModules, I as PermissionGrant, J as isType, K as box, L as PermissionRequest, M as gotoPermission, N as CategoryGrant, O as StorageStateCookie, P as CategoryRequest, Q as Gate, R as permissions, S as FrameWindowOptions, T as GotoOptions, U as BoxedVideoElement, V as PermissionCategory, W as RemoteVideoElement, X as type, Y as revive, Z as Executor, _ as FrameEventMap, a as AttachCookies, b as FramePostMessageOptions, c as BlankPage, d as CookieMatchWire, et as OperationRequest, f as Frame, g as FrameEventListener, h as FrameDocumentEvent, i as AddScriptTagOptions, j as createFrame, k as WindowFrame, l as ClearCookiesOptions, m as FrameBackendEvent, n as attachFrame, o as AttachFrameOptions, p as FrameBackend, q as createVideoElementHandle, s as AttachWindowOptions, t as ATTACH_FRAME_EVENT_KEY, tt as SelectorPart, u as ClearCookiesWire, v as FrameLocator, w as FrameWindowRefusedError, x as FrameWindowBlockedError, y as FrameMessageEvent, z as CATEGORIES } from "./index-Cgnfjh9o.js";
|
|
2
|
+
import { $ as isLocatorInvalid, A as CookieDetails, B as fetchPermission, C as assertLockdownApplicable, D as modifyRequestHeadersPermission, E as RequestHeaderRule, F as ProxyFetchRequest, G as assertOneCookieIdentity, H as isLocalNetworkUrl, I as assertFetchableUrl, J as LOCATOR_ERROR, K as hasForgedCookie, L as fetch, M as cookies, N as readCookiePermission, O as removeRequestHeaderRule, P as FetchInit, Q as isLocatorDenied, R as fetchCredentialedPermission, S as assertAttachableFrameUrl, T as HeaderOperation, U as FORGEABLE_HEADERS, V as isBlockedFetchUrl, W as assertForgeableHeaders, X as LOCATOR_UNSUPPORTED, Y as LOCATOR_INVALID, Z as TimeoutError, _ as BackgroundStoppedError, a as extension, b as PermissionDeniedError, c as setMissingExtensionHandler, d as ExtensionHandshake, et as isLocatorUnsupported, f as ExtensionOperationUnsupportedError, g as BACKGROUND_STOPPED, h as supportsOperation, i as promptInstall, j as SiteCookie, k as setRequestHeaderRule, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, o as isExtensionExposed, p as ExtensionOutdatedError, q as LOCATOR_DENIED, r as isExtensionAvailable, s as readExtensionHandshake, tt as isTerminalError, u as EXTENSION_ABI, v as isBackgroundStopped, w as isBlockedFrameUrl, x as isPermissionDenied, y as PERMISSION_DENIED, z as fetchLocalPermission } from "./extension-BtDg-F2g.js";
|
|
3
|
+
export { ATTACH_FRAME_EVENT_KEY, AddScriptTagOptions, AttachCookies, AttachFrameOptions, AttachWindowOptions, BACKGROUND_STOPPED, type BackgroundStoppedError, BlankPage, BoxedVideoElement, CATEGORIES, CategoryGrant, type CategoryMeta, CategoryRequest, ClearCookiesOptions, ClearCookiesWire, CookieDetails, CookieMatchWire, EXTENSION_ABI, type Executor, type ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, FrameBackendEvent, FrameDocumentEvent, FrameEventListener, FrameEventMap, FrameLocator, FrameMessageEvent, FramePostMessageOptions, FrameWindowBlockedError, FrameWindowOptions, FrameWindowRefusal, FrameWindowRefusedError, type Gate, type GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_INVALID, LOCATOR_UNSUPPORTED, LegacyPermissionRequest, Locator, type OperationRequest, PERMISSION_DENIED, type PermissionCategory, type PermissionDeniedError, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, type SelectorPart, SiteCookie, StorageState, StorageStateCookie, TimeoutError, VideoElementState, WindowFrame, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFrame, attachFramePermission, isExtensionAvailable as available, box, cookies, createFrame, createVideoElementHandle, extension as events, extension, fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, gotoPermission, handleRevivableModules, hasForgedCookie, isBackgroundStopped, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorInvalid, isLocatorUnsupported, isPermissionDenied, isTerminalError, isType, modifyRequestHeadersPermission, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, setMissingExtensionHandler, setRequestHeaderRule, supportsOperation, type, waitForExtensionExposure };
|
package/extension.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as e,
|
|
2
|
-
import { i as
|
|
3
|
-
export { N as ATTACH_FRAME_EVENT_KEY,
|
|
1
|
+
import { $ as e, B as t, C as n, D as r, E as i, F as a, G as o, H as s, I as c, J as l, K as u, L as d, N as f, P as p, Q as m, R as h, S as g, T as _, U as v, V as y, W as b, X as x, Y as S, Z as C, _ as w, a as T, at as E, b as D, ct as O, dt as k, et as A, ft as j, g as M, i as N, it as P, j as F, k as I, lt as L, mt as R, n as z, nt as B, ot as V, pt as H, q as U, r as W, rt as G, st as K, t as q, tt as J, ut as Y, v as X, w as Z, x as Q, y as $, z as ee } from "./lib-C3UwxjVs.js";
|
|
2
|
+
import { a as te, i as ne, o as re, r as ie } from "./extension-CzZn0bY2.js";
|
|
3
|
+
export { N as ATTACH_FRAME_EVENT_KEY, te as BACKGROUND_STOPPED, Z as CATEGORIES, P as EXTENSION_ABI, E as ExtensionOperationUnsupportedError, V as ExtensionOutdatedError, S as FORGEABLE_HEADERS, M as FrameWindowBlockedError, w as FrameWindowRefusedError, I as LOCATOR_DENIED, p as LOCATOR_ERROR, c as LOCATOR_INVALID, i as LOCATOR_UNSUPPORTED, q as PERMISSION_DENIED, K as REQUIRED_EXTENSION_ABI, _ as TimeoutError, Q as assertAttachableFrameUrl, s as assertFetchableUrl, x as assertForgeableHeaders, g as assertLockdownApplicable, C as assertOneCookieIdentity, T as attachFrame, X as attachFramePermission, ie as available, Y as box, t as cookies, $ as createFrame, k as createVideoElementHandle, e as events, e as extension, v as fetch, b as fetchCredentialedPermission, o as fetchLocalPermission, u as fetchPermission, D as gotoPermission, L as handleRevivableModules, m as hasForgedCookie, re as isBackgroundStopped, U as isBlockedFetchUrl, n as isBlockedFrameUrl, A as isExtensionExposed, l as isLocalNetworkUrl, a as isLocatorDenied, F as isLocatorInvalid, r as isLocatorUnsupported, z as isPermissionDenied, f as isTerminalError, j as isType, d as modifyRequestHeadersPermission, W as permissions, ne as promptInstall, y as readCookiePermission, J as readExtensionHandshake, h as removeRequestHeaderRule, H as revive, B as setMissingExtensionHandler, ee as setRequestHeaderRule, O as supportsOperation, R as type, G as waitForExtensionExposure };
|
package/fs/promises.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../fs-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../fs-p0bOOj5n.cjs");var{readFile:t,writeFile:n,appendFile:r,unlink:i,rename:a,readdir:o,mkdir:s,rm:c,rmdir:l,stat:u,lstat:d,access:f}=e.v,p=e.v;exports.access=f,exports.appendFile=r,exports.default=p,exports.lstat=d,exports.mkdir=s,exports.readFile=t,exports.readdir=o,exports.rename=a,exports.rm=c,exports.rmdir=l,exports.stat=u,exports.unlink=i,exports.writeFile=n;
|
package/fs/promises.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as e } from "../fs-
|
|
1
|
+
import { v as e } from "../fs-CVnmXRf7.js";
|
|
2
2
|
//#region src/fs/promises.ts
|
|
3
3
|
var { readFile: t, writeFile: n, appendFile: r, unlink: i, rename: a, readdir: o, mkdir: s, rm: c, rmdir: l, stat: u, lstat: d, access: f } = e, p = e;
|
|
4
4
|
//#endregion
|