@fkn/lib 0.9.42 → 0.9.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{api-SwxtiYVU.d.ts → api-CFkZVr53.d.ts} +61 -30
- package/api.d.ts +2 -2
- package/attach-policy.d.ts +11 -15
- package/cloud/dns.d.ts +1 -1
- package/cloud/fetch.d.ts +1 -1
- package/cloud/fs/promises.d.ts +1 -1
- package/cloud/fs.d.ts +3 -3
- package/cloud/net.d.ts +1 -1
- package/cloud-Bx64HSkQ.cjs +1 -0
- package/cloud-D-vDUzzx.js +552 -0
- package/{cloud-DUH-v10C.d.ts → cloud-DyOQPyUB.d.ts} +4 -4
- package/cloud.cjs +1 -1
- package/cloud.d.ts +4 -4
- package/cloud.js +1 -1
- package/{contract-CCxPKIC7.d.ts → contract-6Xfd_qel.d.ts} +173 -22
- package/contract.d.ts +4 -4
- package/dgram.d.ts +7 -14
- package/dns.d.ts +1 -1
- package/{extension-yhwDSIiD.d.ts → extension-BlEtNAYc.d.ts} +36 -37
- package/extension-CzZn0bY2.js +94 -0
- package/extension-DvFf7uoG.cjs +1 -0
- package/extension.cjs +1 -1
- package/extension.d.ts +3 -3
- package/extension.js +3 -3
- package/fs/promises.d.ts +1 -1
- package/{fs-D0MMRnHC.d.ts → fs-KA1Mgisv.d.ts} +2 -2
- package/fs.d.ts +3 -3
- package/http.d.ts +1 -1
- package/{index-BtFiGoVQ.d.ts → index-BOInGaEl.d.ts} +103 -62
- package/{index-D2lvaQDs.d.ts → index-DKr9L2RI.d.ts} +6 -11
- package/index.cjs +1 -1
- package/index.d.ts +36 -39
- package/index.js +55 -55
- package/{lib-DppqX10G.js → lib-C3UwxjVs.js} +560 -474
- package/lib-fqQfEPk6.cjs +53 -0
- package/messages-d7pvCXPn.d.ts +34 -0
- package/messages.d.ts +1 -1
- package/{net-DcLF-6E-.d.ts → net-CmMZgV2a.d.ts} +3 -19
- package/net.d.ts +1 -1
- package/package.json +1 -1
- package/packages.d.ts +1 -1
- package/{proxy-CE46SkyA.d.ts → proxy-dOOmiMl4.d.ts} +2 -2
- package/rooms.cjs +1 -1
- package/rooms.d.ts +94 -15
- package/rooms.js +118 -90
- package/{storage-BVr2Rb-d.d.ts → storage-BLBsmkmp.d.ts} +14 -28
- package/{wire-Gbo-D74t.d.ts → wire-BwA4JjZH.d.ts} +6 -12
- package/wire.d.ts +1 -1
- package/cloud-868OlBKn.cjs +0 -1
- package/cloud-f3j4s8yZ.js +0 -545
- package/extension-BOBuYwZc.js +0 -92
- package/extension-hoUs5yJ7.cjs +0 -1
- package/lib-CfdmsLoI.cjs +0 -53
- package/messages-CRcziTuC.d.ts +0 -46
|
@@ -1,5 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { o as TcpSocketOption, v as UdpSocketOption } from "./wire-
|
|
1
|
+
import { D as StorageState, tt as SelectorPart, u as ClearCookiesWire } from "./index-BOInGaEl.js";
|
|
2
|
+
import { o as TcpSocketOption, v as UdpSocketOption } from "./wire-BwA4JjZH.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
|
|
@@ -49,7 +78,7 @@ type WriteData = ArrayBuffer | Uint8Array | string;
|
|
|
49
78
|
/**
|
|
50
79
|
* The trailing option of every pinned storage call: a value `accountPin()` answered. The api refuses the
|
|
51
80
|
* call ACCOUNT_CHANGED when the signed-in account (or the app) is not the one the pin was taken under.
|
|
52
|
-
* Absent, the call is
|
|
81
|
+
* Absent, the call is unpinned.
|
|
53
82
|
*/
|
|
54
83
|
type AccountPinOptions = {
|
|
55
84
|
accountPin?: string;
|
|
@@ -288,6 +317,25 @@ type ShellControl = {
|
|
|
288
317
|
clearCookies?(filter: ClearCookiesWire, scope: {
|
|
289
318
|
hosts: string[];
|
|
290
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>;
|
|
291
339
|
};
|
|
292
340
|
/**
|
|
293
341
|
* What a middle page exposes to the library, inline (`ATTACH_FRAME_KEY`) and for a window
|
|
@@ -339,6 +387,22 @@ type MiddleControl = {
|
|
|
339
387
|
* a middle page that predates it, which the library refuses by name.
|
|
340
388
|
*/
|
|
341
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>;
|
|
342
406
|
};
|
|
343
407
|
/** What a window's middle page adds to its channel. */
|
|
344
408
|
type WindowMiddleControl = MiddleControl & {
|
|
@@ -494,8 +558,9 @@ type RoomMessage = {
|
|
|
494
558
|
text: string;
|
|
495
559
|
};
|
|
496
560
|
/**
|
|
497
|
-
* What a claimed room's mailbox holds, as the room last said. Null for a room
|
|
498
|
-
* `cap` is the most it stores: 500 MB, or the
|
|
561
|
+
* What a claimed room's mailbox holds, as the room last said. Null for a room that keeps no messages:
|
|
562
|
+
* one nobody has claimed, or a claim whose mailbox is off. `cap` is the most it stores: 500 MB, or the
|
|
563
|
+
* size limit the account set in its fkn.app settings.
|
|
499
564
|
*/
|
|
500
565
|
type RoomMailbox = {
|
|
501
566
|
messages: number;
|
|
@@ -536,12 +601,15 @@ type RoomEvent =
|
|
|
536
601
|
} |
|
|
537
602
|
/**
|
|
538
603
|
* the room was claimed, released (by its app, or by the account in its fkn.app settings) or
|
|
539
|
-
* dissolved; `owner` is the owner's member id, or '' while a
|
|
604
|
+
* dissolved, or its mailbox was turned off or on; `owner` is the owner's member id, or '' while a
|
|
605
|
+
* claimed room's owner has never joined. `mailbox` is whether the room now keeps messages, always
|
|
606
|
+
* false while `claimed` is false. Turning a mailbox off sends no `deleted`: what the app shows stays.
|
|
540
607
|
*/
|
|
541
608
|
{
|
|
542
609
|
type: 'claim';
|
|
543
610
|
claimed: boolean;
|
|
544
611
|
owner: string;
|
|
612
|
+
mailbox: boolean;
|
|
545
613
|
};
|
|
546
614
|
type RoomsErrorCode = 'invalid' | 'not-found' | 'bad-key' | 'full' | 'blocked' | 'denied' | 'rate-limited' | 'too-large' | 'storage' | 'quota' | 'unavailable' | 'closed';
|
|
547
615
|
/** A refusal, as data. `packages` crosses the hop the same way, and for the same reason. */
|
|
@@ -582,8 +650,10 @@ type RoomClaimOptions = {
|
|
|
582
650
|
* settings, where it can clear or unclaim the room, so say what would be lost. One line of plain text:
|
|
583
651
|
* trimmed, then 1 to 200 characters as `String.length` counts them, with no control character, line or
|
|
584
652
|
* paragraph separator, or bidi control; anything else is refused `invalid`, never cut short. Not sealed:
|
|
585
|
-
* stored with the claim and shown to the account only. Claiming again with one replaces it
|
|
586
|
-
* that claimed the room only (the same app once it is verified)
|
|
653
|
+
* stored with the claim and shown to the account only. Claiming again with one replaces it: on a room
|
|
654
|
+
* under an app's scope from the app that claimed the room only (the same app once it is verified), and
|
|
655
|
+
* from another app it is refused `denied` (`rooms: only the app that claimed the room can describe it`);
|
|
656
|
+
* on a `global` room from any app of the account. Claiming without one keeps it.
|
|
587
657
|
*/
|
|
588
658
|
description?: string;
|
|
589
659
|
/**
|
|
@@ -601,11 +671,27 @@ type RoomClaimOptions = {
|
|
|
601
671
|
* room. It counts toward the account's room limit while it lasts and frees the slot when it ends.
|
|
602
672
|
*
|
|
603
673
|
* The latest claim decides: claiming again without it makes the room permanent, and with it makes it
|
|
604
|
-
* temporary again.
|
|
605
|
-
* changes it
|
|
606
|
-
* the room
|
|
674
|
+
* temporary again. On a room under an app's scope only the app that claimed the room (the same app
|
|
675
|
+
* once it is verified) sets or changes it, and from another app it is refused `denied` (`rooms: only
|
|
676
|
+
* the app that claimed the room can set when it expires`); on a `global` room any app of the account
|
|
677
|
+
* does. A claim from another app without it leaves the room as it was, on either kind of room.
|
|
607
678
|
*/
|
|
608
679
|
temporary?: boolean | number;
|
|
680
|
+
/**
|
|
681
|
+
* Whether the room keeps its messages. `false` claims the name and stores nothing: a message reaches
|
|
682
|
+
* whoever is present and is kept nowhere, `backlog` answers an empty page, and `edit` and `delete` are
|
|
683
|
+
* refused `invalid` (`rooms: the room keeps no messages`). The claim still reserves the name, locks it
|
|
684
|
+
* to the key and keeps the owner, the blocks and the overrides when everyone leaves, and it still needs
|
|
685
|
+
* premium. `true` or no value keeps a mailbox. Anything else is refused `invalid` (`rooms: malformed
|
|
686
|
+
* frame`).
|
|
687
|
+
*
|
|
688
|
+
* Read only when the call starts the claim: on a room the account already holds it is ignored, so an
|
|
689
|
+
* app that claims on every open never undoes what the owner chose since. A claim landing after a
|
|
690
|
+
* temporary one ran out starts a new claim, so it reads it again. A broker too old to carry it refuses
|
|
691
|
+
* `false` `unavailable` (`rooms: the mailbox switch is not available`) rather than store what the app
|
|
692
|
+
* asked it not to.
|
|
693
|
+
*/
|
|
694
|
+
mailbox?: boolean;
|
|
609
695
|
};
|
|
610
696
|
/** What a backlog page answered: the highest seq it sent, and whether another page follows. */
|
|
611
697
|
type RoomBacklog = {
|
|
@@ -637,49 +723,108 @@ type RoomHandle = {
|
|
|
637
723
|
* let the room outlive what the app asked for.
|
|
638
724
|
*/
|
|
639
725
|
temporaryClaims?: true;
|
|
726
|
+
/**
|
|
727
|
+
* set by a broker that carries `mailbox` on a claim and sends `setMailbox`. A broker older than that
|
|
728
|
+
* drops the option and claims with a mailbox, and has no `setMailbox`, so the lib refuses both on a
|
|
729
|
+
* handle without it rather than store what the app asked it not to.
|
|
730
|
+
*/
|
|
731
|
+
mailboxSwitch?: true;
|
|
640
732
|
defaults: () => Promise<RoomDefaults>;
|
|
641
733
|
members: () => Promise<RoomMember[]>;
|
|
642
734
|
/** sealed before it leaves the browser and refused, never truncated, past this member's `maxMessageBytes` on the wire */
|
|
643
735
|
send: (text: string) => Promise<RoomsFail | {
|
|
644
736
|
ok: true;
|
|
645
737
|
}>;
|
|
646
|
-
/**
|
|
738
|
+
/**
|
|
739
|
+
* a stored message's text, replaced: the sender's own, or any as the owner. From another app of the
|
|
740
|
+
* claim's account on a room claimed under an app's scope, `denied` (`rooms: only the app that claimed
|
|
741
|
+
* the room can change it`), the account's own messages included, as `claim` says.
|
|
742
|
+
*/
|
|
647
743
|
edit: (seq: number, text: string) => Promise<RoomsFail | {
|
|
648
744
|
ok: true;
|
|
649
745
|
}>;
|
|
650
|
-
/**
|
|
746
|
+
/**
|
|
747
|
+
* stored messages dropped: one of the sender's own, or any range as the owner. From another app of the
|
|
748
|
+
* claim's account on a room claimed under an app's scope, `denied` (`rooms: only the app that claimed
|
|
749
|
+
* the room can change it`), the account's own messages included, as `claim` says.
|
|
750
|
+
*/
|
|
651
751
|
delete: (from: number, to?: number) => Promise<RoomsFail | {
|
|
652
752
|
ok: true;
|
|
653
753
|
}>;
|
|
654
754
|
/** replays stored messages above `after` as `message` events marked `replayed`, one page at a time */
|
|
655
755
|
backlog: (after: number, limit?: number) => Promise<RoomsFail | RoomBacklog>;
|
|
756
|
+
/**
|
|
757
|
+
* the room default for `send` or `receive`, from the owner only (`denied`, `rooms: not the room
|
|
758
|
+
* owner`). From another app of the claim's account on a room claimed under an app's scope, `denied`
|
|
759
|
+
* (`rooms: only the app that claimed the room can change it`), as `claim` says.
|
|
760
|
+
*/
|
|
656
761
|
setDefault: (permission: 'send' | 'receive', value: boolean) => Promise<RoomsFail | {
|
|
657
762
|
ok: true;
|
|
658
763
|
}>;
|
|
659
|
-
/**
|
|
764
|
+
/**
|
|
765
|
+
* the message size cap: the room default when no member is named, that member's override otherwise,
|
|
766
|
+
* cleared by null. From the owner only (`denied`, `rooms: not the room owner`); from another app of the
|
|
767
|
+
* claim's account on a room claimed under an app's scope, `denied` (`rooms: only the app that claimed
|
|
768
|
+
* the room can change it`), as `claim` says.
|
|
769
|
+
*/
|
|
660
770
|
limit: (maxMessageBytes: number | null, id?: string) => Promise<RoomsFail | {
|
|
661
771
|
ok: true;
|
|
662
772
|
}>;
|
|
773
|
+
/**
|
|
774
|
+
* a member's override of a permission, set to true, from the owner only (`denied`, `rooms: not the
|
|
775
|
+
* room owner`). From another app of the claim's account on a room claimed under an app's scope,
|
|
776
|
+
* `denied` (`rooms: only the app that claimed the room can change it`), as `claim` says.
|
|
777
|
+
*/
|
|
663
778
|
grant: (id: string, permission: RoomPermission) => Promise<RoomsFail | {
|
|
664
779
|
ok: true;
|
|
665
780
|
}>;
|
|
781
|
+
/**
|
|
782
|
+
* a member's override of a permission, set to false, from the owner only (`denied`, `rooms: not the
|
|
783
|
+
* room owner`). From another app of the claim's account on a room claimed under an app's scope,
|
|
784
|
+
* `denied` (`rooms: only the app that claimed the room can change it`), as `claim` says.
|
|
785
|
+
*/
|
|
666
786
|
revoke: (id: string, permission: RoomPermission) => Promise<RoomsFail | {
|
|
667
787
|
ok: true;
|
|
668
788
|
}>;
|
|
789
|
+
/**
|
|
790
|
+
* a member sent out, free to join again, with the `remove` permission (`denied`, `rooms: permission
|
|
791
|
+
* denied`). From another app of the claim's account on a room claimed under an app's scope, `denied`
|
|
792
|
+
* (`rooms: only the app that claimed the room can change it`), as `claim` says.
|
|
793
|
+
*/
|
|
669
794
|
remove: (id: string) => Promise<RoomsFail | {
|
|
670
795
|
ok: true;
|
|
671
796
|
}>;
|
|
797
|
+
/**
|
|
798
|
+
* a member sent out and kept out, with the `block` permission (`denied`, `rooms: permission denied`).
|
|
799
|
+
* From another app of the claim's account on a room claimed under an app's scope, `denied` (`rooms:
|
|
800
|
+
* only the app that claimed the room can change it`), as `claim` says.
|
|
801
|
+
*/
|
|
672
802
|
block: (id: string) => Promise<RoomsFail | {
|
|
673
803
|
ok: true;
|
|
674
804
|
}>;
|
|
805
|
+
/**
|
|
806
|
+
* a block lifted, with the `block` permission (`denied`, `rooms: permission denied`). From another app
|
|
807
|
+
* of the claim's account on a room claimed under an app's scope, `denied` (`rooms: only the app that
|
|
808
|
+
* claimed the room can change it`), as `claim` says.
|
|
809
|
+
*/
|
|
675
810
|
unblock: (id: string) => Promise<RoomsFail | {
|
|
676
811
|
ok: true;
|
|
677
812
|
}>;
|
|
678
813
|
/**
|
|
679
|
-
* keeps the name
|
|
680
|
-
* buys. `description` says what the room is for, shown to the account in
|
|
681
|
-
* `temporary` makes the claim end by itself that many milliseconds after its last
|
|
682
|
-
* days); the broker carries it as a number of milliseconds and never as `true`.
|
|
814
|
+
* keeps the name for the signed-in premium account, and a mailbox unless `mailbox` is false; the only
|
|
815
|
+
* thing in rooms that premium buys. `description` says what the room is for, shown to the account in
|
|
816
|
+
* its fkn.app settings. `temporary` makes the claim end by itself that many milliseconds after its last
|
|
817
|
+
* claim (`true` is 7 days); the broker carries it as a number of milliseconds and never as `true`.
|
|
818
|
+
* `mailbox` is read only when the call starts the claim.
|
|
819
|
+
*
|
|
820
|
+
* A room under an app's scope, which is every room but a `global` one, is changed by the claim's
|
|
821
|
+
* account only through the app that claimed it (the same app once it is verified): from another app of
|
|
822
|
+
* the account `setDefault`, `limit`, `grant`, `revoke`, `remove`, `block`, `unblock`, `setMailbox`,
|
|
823
|
+
* `edit` and `delete` answer `denied` (`rooms: only the app that claimed the room can change it`), the
|
|
824
|
+
* account's own messages included, and `unavailable` while the room cannot tell whether two apps are
|
|
825
|
+
* one. A claimed `global` room is changed by any app of the account, which also describes it, sets its
|
|
826
|
+
* `temporary` and releases it. The account's fkn.app settings
|
|
827
|
+
* change every room it claimed, and members of other accounts are answered as in any room.
|
|
683
828
|
*
|
|
684
829
|
* Past the account's room limit the call waits while fkn.app shows the person their claimed rooms over
|
|
685
830
|
* your app, with Unclaim on each: it answers `{ ok: true }` once one is unclaimed and this claim is
|
|
@@ -689,6 +834,15 @@ type RoomHandle = {
|
|
|
689
834
|
claim: (options?: RoomClaimOptions) => Promise<RoomsFail | {
|
|
690
835
|
ok: true;
|
|
691
836
|
}>;
|
|
837
|
+
/**
|
|
838
|
+
* the owner turns a claimed room's mailbox off, deleting what it stored, or on, starting it empty.
|
|
839
|
+
* Answers once the room is in that state and has tried to tell the api its storage figure; the answer
|
|
840
|
+
* does not say whether the api heard it. From another app of the claim's account on a room claimed
|
|
841
|
+
* under an app's scope, `denied` (`rooms: only the app that claimed the room can change it`), as `claim` says.
|
|
842
|
+
*/
|
|
843
|
+
setMailbox: (on: boolean) => Promise<RoomsFail | {
|
|
844
|
+
ok: true;
|
|
845
|
+
}>;
|
|
692
846
|
release: () => Promise<RoomsFail | {
|
|
693
847
|
ok: true;
|
|
694
848
|
}>;
|
|
@@ -742,9 +896,6 @@ type ProxyFetchInput = string | URL | Request;
|
|
|
742
896
|
* A spread request is the app's own choice and is not announced: the header keeps naming the
|
|
743
897
|
* session's node, which every request not carrying this flag still goes through. Only the cloud
|
|
744
898
|
* backend reads it; the extension and the desktop fetch from the user's own address and ignore it.
|
|
745
|
-
*
|
|
746
|
-
* `render` used to sit here. It set a request header the proxy never read and never listed for CORS,
|
|
747
|
-
* so a caller that passed it failed its own preflight; nothing did, and it is gone.
|
|
748
899
|
*/
|
|
749
900
|
type ProxyFetchInit = (RequestInit & {
|
|
750
901
|
spread?: boolean;
|
|
@@ -957,4 +1108,4 @@ type Resolvers = {
|
|
|
957
1108
|
hideInstallPrompt: () => void;
|
|
958
1109
|
};
|
|
959
1110
|
//#endregion
|
|
960
|
-
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, 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, 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 };
|
|
1111
|
+
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,4 +1,4 @@
|
|
|
1
|
-
import { d as CookieMatchWire, u as ClearCookiesWire } from "./index-
|
|
2
|
-
import { o as
|
|
3
|
-
import {
|
|
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, 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 };
|
|
1
|
+
import { d as CookieMatchWire, u as ClearCookiesWire } from "./index-BOInGaEl.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-6Xfd_qel.js";
|
|
3
|
+
import { o as TcpSocketOption, v as UdpSocketOption } from "./wire-BwA4JjZH.js";
|
|
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.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "./api-
|
|
1
|
+
import { K as Resolvers, Ot as UdpSocketResult } from "./contract-6Xfd_qel.js";
|
|
2
|
+
import { v as UdpSocketOption } from "./wire-BwA4JjZH.js";
|
|
3
|
+
import "./api-CFkZVr53.js";
|
|
4
4
|
import { Buffer } from "buffer";
|
|
5
5
|
import { AddressInfo } from "net";
|
|
6
6
|
import { EventEmitter } from "events";
|
|
@@ -62,17 +62,10 @@ export declare class Socket extends EventEmitter implements Socket$2 {
|
|
|
62
62
|
bind(callback?: (() => void) | undefined): this;
|
|
63
63
|
bind(options: BindOptions, callback?: (() => void) | undefined): this;
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* reads it in the same turn as the bind gets an exception rather than the answer. Node fills an
|
|
70
|
-
* address in before it reports a socket as bound.
|
|
71
|
-
*
|
|
72
|
-
* Splitting this out of `bind()` is also what gives a test a seam. Everything a refused bind does
|
|
73
|
-
* lives past `apiWithin`, so without this the only way to reach it is to mock the resolver, and
|
|
74
|
-
* the guard on that path stayed untested through the whole period the relay could not refuse a
|
|
75
|
-
* bind at all.
|
|
65
|
+
* Wires the socket up from a connection already in hand and reports it as bound; also the seam a
|
|
66
|
+
* test uses to reach a refused bind without mocking the resolver. `endpoints` publishes the local
|
|
67
|
+
* address synchronously, as net.ts does: `address()` throws EBADF until the connection resolves,
|
|
68
|
+
* while Node fills an address in before reporting a socket bound.
|
|
76
69
|
*/
|
|
77
70
|
__webvpn_udp_socket_init__(connection: ReturnType<WebVpnUdpSocket>, endpoints?: Awaited<ReturnType<WebVpnUdpSocket>>): Promise<UdpSocketResult | undefined>;
|
|
78
71
|
close(callback?: (() => void) | undefined): this;
|
package/dns.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ 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-BOInGaEl.js";
|
|
2
2
|
//#region ../frame-locator/lib/errors.d.ts
|
|
3
3
|
declare const LOCATOR_ERROR = "LocatorError";
|
|
4
4
|
declare const LOCATOR_UNSUPPORTED = "LocatorUnsupportedError";
|
|
@@ -66,6 +66,8 @@ type ProxyFetchRequest = {
|
|
|
66
66
|
body: ArrayBuffer | null;
|
|
67
67
|
credentials: 'include' | 'omit';
|
|
68
68
|
redirect: RequestRedirect;
|
|
69
|
+
/** the browser's HTTP cache mode, the browser's default when absent */
|
|
70
|
+
cache?: RequestCache;
|
|
69
71
|
unsafeHeaders?: [string, string][];
|
|
70
72
|
reason?: string;
|
|
71
73
|
signal?: AbortSignal;
|
|
@@ -119,6 +121,7 @@ type RequestHeaderRule = {
|
|
|
119
121
|
requestHeaders: HeaderOperation[];
|
|
120
122
|
reason?: string;
|
|
121
123
|
};
|
|
124
|
+
/** Tab-scoped: the rule is dropped when the tab goes away. */
|
|
122
125
|
declare const setRequestHeaderRule: (rule: RequestHeaderRule) => Promise<{
|
|
123
126
|
ruleId: number;
|
|
124
127
|
}>;
|
|
@@ -151,33 +154,36 @@ type PermissionDeniedError = Error & {
|
|
|
151
154
|
};
|
|
152
155
|
declare const isPermissionDenied: (error: unknown) => boolean;
|
|
153
156
|
//#endregion
|
|
157
|
+
//#region ../web-extension/lib/utils/background-stopped.d.ts
|
|
158
|
+
declare const BACKGROUND_STOPPED = "BackgroundStoppedError";
|
|
159
|
+
/**
|
|
160
|
+
* What a call into the extension rejects with when Chrome stopped the extension's worker before it finished
|
|
161
|
+
* answering: before the call resolved, or, for a `fetch`, while its response body was still arriving.
|
|
162
|
+
* The call may or may not have run, so it is never resent; a retry by the app reaches the restarted worker.
|
|
163
|
+
*/
|
|
164
|
+
type BackgroundStoppedError = Error & {
|
|
165
|
+
name: typeof BACKGROUND_STOPPED;
|
|
166
|
+
};
|
|
167
|
+
/** Whether `error` is a `BackgroundStoppedError`, matched on `name` since it may arrive as a revived Error or a plain record. */
|
|
168
|
+
declare const isBackgroundStopped: (error: unknown) => boolean;
|
|
169
|
+
//#endregion
|
|
154
170
|
//#region ../web-extension/lib/utils/extension-abi.d.ts
|
|
155
171
|
/**
|
|
156
|
-
* What the extension half announces about itself. Increment when the callable surface
|
|
157
|
-
* way a page could notice: an operation added, removed, renamed, or given different semantics.
|
|
158
|
-
*
|
|
159
|
-
* This is not the package version and not the manifest version. Those move for reasons that have
|
|
160
|
-
* nothing to do with the protocol (a dependency bump, a store resubmission), and tying the contract
|
|
161
|
-
* to them would make every release look like a protocol change.
|
|
172
|
+
* What the extension half announces about itself. Increment when the callable surface changes in a
|
|
173
|
+
* way a page could notice: an operation added, removed, renamed, or given different semantics. Not
|
|
174
|
+
* the package or manifest version, which move for reasons unrelated to the protocol.
|
|
162
175
|
*/
|
|
163
|
-
declare const EXTENSION_ABI =
|
|
176
|
+
declare const EXTENSION_ABI = 4;
|
|
164
177
|
/**
|
|
165
|
-
* The oldest extension the page half will talk to. Raise it
|
|
166
|
-
* on something older extensions cannot do, never merely because `EXTENSION_ABI` moved
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
* Deliberately 0 for this release. Every extension currently installed predates versioning and
|
|
170
|
-
* announces no ABI at all, so a floor of 1 would refuse all of them the moment this page half
|
|
171
|
-
* deployed, which is precisely the failure this file exists to prevent.
|
|
178
|
+
* The oldest extension the page half will talk to. Raise it only when the page half starts depending
|
|
179
|
+
* on something older extensions cannot do, never merely because `EXTENSION_ABI` moved. Deliberately 0:
|
|
180
|
+
* extensions that predate versioning announce no ABI, and a floor of 1 would refuse all of them.
|
|
172
181
|
*/
|
|
173
182
|
declare const REQUIRED_EXTENSION_ABI = 0;
|
|
174
183
|
/**
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
* empty one. A pre-versioning extension supports the whole original surface and simply cannot say so,
|
|
179
|
-
* so an absent list has to read as "unknown, assume the old set" rather than "supports nothing".
|
|
180
|
-
* Reading it the other way would refuse every operation on every currently installed extension.
|
|
184
|
+
* `operations` is `null` when the extension announced no list, which is not the same as an empty one:
|
|
185
|
+
* a pre-versioning extension supports the whole original surface and cannot say so, so `null` reads
|
|
186
|
+
* as "assume the original set", never "supports nothing".
|
|
181
187
|
*/
|
|
182
188
|
type ExtensionHandshake = {
|
|
183
189
|
status: 'absent';
|
|
@@ -192,19 +198,14 @@ type ExtensionHandshake = {
|
|
|
192
198
|
operations: readonly string[] | null;
|
|
193
199
|
};
|
|
194
200
|
/**
|
|
195
|
-
* Whether a named operation is callable.
|
|
196
|
-
*
|
|
197
|
-
* `null` operations means the extension could not tell us, and the answer is YES: it predates the
|
|
198
|
-
* ops list and supports the original surface. The ABI floor is the mechanism for refusing an
|
|
199
|
-
* extension that is genuinely too old; this one only refines a list that was actually announced.
|
|
201
|
+
* Whether a named operation is callable. A `null` list answers true (the extension predates the list
|
|
202
|
+
* and supports the original surface); refusing a too-old extension is the ABI floor's job.
|
|
200
203
|
*/
|
|
201
204
|
declare const supportsOperation: (handshake: ExtensionHandshake, operation: string) => boolean;
|
|
202
205
|
/**
|
|
203
|
-
* Thrown instead of the generic "not installed" message when the extension
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
* A named class rather than a message match: only the name survives a structured-clone hop, and the
|
|
207
|
-
* codebase has been bitten before by an error whose identity was its text.
|
|
206
|
+
* Thrown instead of the generic "not installed" message when the extension is installed but too old.
|
|
207
|
+
* Carries both numbers so an app can say which and link its listing. Match it by `name`, which
|
|
208
|
+
* survives a structured-clone hop.
|
|
208
209
|
*/
|
|
209
210
|
declare class ExtensionOutdatedError extends Error {
|
|
210
211
|
readonly abi: number;
|
|
@@ -231,10 +232,8 @@ type ExtensionEventMap = {
|
|
|
231
232
|
};
|
|
232
233
|
declare const extension: import("osra").TypedEventTarget<ExtensionEventMap>;
|
|
233
234
|
/**
|
|
234
|
-
* Unchanged on purpose
|
|
235
|
-
*
|
|
236
|
-
* compatibility here runs in BOTH directions, which is the only property that matters when neither
|
|
237
|
-
* end updates on demand.
|
|
235
|
+
* Unchanged on purpose: a page half built before versioning calls exactly this, so an extension that
|
|
236
|
+
* announces an ABI keeps answering it the same way. An outdated extension also answers true.
|
|
238
237
|
*/
|
|
239
238
|
declare const isExtensionExposed: () => boolean;
|
|
240
239
|
/** The three-way answer: absent, present but too old, or usable. */
|
|
@@ -253,7 +252,7 @@ declare const fetch: (input: RequestInfo | URL, init?: RequestInit & {
|
|
|
253
252
|
spread?: boolean;
|
|
254
253
|
}) => Promise<Response>;
|
|
255
254
|
declare namespace extension_d_exports {
|
|
256
|
-
export { ATTACH_FRAME_EVENT_KEY, AddScriptTagOptions, AttachCookies, AttachFrameOptions, AttachWindowOptions, 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, 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, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorInvalid, isLocatorUnsupported, isPermissionDenied, isTerminalError, isType, modifyRequestHeadersPermission, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, setMissingExtensionHandler, setRequestHeaderRule, supportsOperation, type, waitForExtensionExposure };
|
|
255
|
+
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 };
|
|
257
256
|
}
|
|
258
257
|
//#endregion
|
|
259
|
-
export {
|
|
258
|
+
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}});
|