@fkn/lib 0.9.43 → 0.9.45
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-H1TzWitc.d.ts → api-Cuf3ynZX.d.ts} +83 -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-CKCrMMB_.cjs +1 -0
- package/cloud-CVWGyZRT.js +559 -0
- package/{cloud-Y0FzWpFT.d.ts → cloud-KBzjWzt1.d.ts} +4 -4
- package/cloud.cjs +1 -1
- package/cloud.d.ts +4 -4
- package/cloud.js +1 -1
- package/{contract-DJxGa8lb.d.ts → contract-DP_jc5pZ.d.ts} +161 -27
- package/contract.cjs +1 -1
- package/contract.d.ts +4 -4
- package/contract.js +9 -3
- package/dgram.d.ts +7 -14
- package/dns.d.ts +1 -1
- package/extension-Dmnh5pcs.js +94 -0
- package/{extension-BtDg-F2g.d.ts → extension-X8cnvZej.d.ts} +19 -37
- package/extension-YBe6Q6r_.cjs +1 -0
- package/extension.cjs +1 -1
- package/extension.d.ts +2 -2
- 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-Cgnfjh9o.d.ts → index-C8Y-YHrU.d.ts} +42 -58
- package/{index-D2lvaQDs.d.ts → index-DKr9L2RI.d.ts} +6 -11
- package/index.cjs +1 -1
- package/index.d.ts +35 -38
- package/index.js +12 -12
- package/lib-D4uqe_rb.cjs +53 -0
- package/{lib-C3UwxjVs.js → lib-H5-e2A1h.js} +483 -468
- package/messages-d7pvCXPn.d.ts +34 -0
- package/messages.d.ts +1 -1
- package/{net-BOswhyfE.d.ts → net-eyWUIVn2.d.ts} +3 -19
- package/net.d.ts +1 -1
- package/package.json +1 -1
- package/packages.d.ts +1 -1
- package/{proxy-ylK5lpw8.d.ts → proxy-8Zp-G5da.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-Bx64HSkQ.cjs +0 -1
- package/cloud-D-vDUzzx.js +0 -552
- package/extension-CzZn0bY2.js +0 -94
- package/extension-DvFf7uoG.cjs +0 -1
- package/lib-fqQfEPk6.cjs +0 -53
- package/messages-CRcziTuC.d.ts +0 -46
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as StorageState, tt as SelectorPart, u as ClearCookiesWire } from "./index-
|
|
2
|
-
import { o as TcpSocketOption, v as UdpSocketOption } from "./wire-
|
|
1
|
+
import { D as StorageState, tt as SelectorPart, u as ClearCookiesWire } from "./index-C8Y-YHrU.js";
|
|
2
|
+
import { o as TcpSocketOption, v as UdpSocketOption } from "./wire-BwA4JjZH.js";
|
|
3
3
|
//#region ../web-extension/lib/lib/storage-state.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* A `storageState` cookie in the cloud jar's own shape (mirage's `Cookie`): `domain` always with
|
|
@@ -78,7 +78,7 @@ type WriteData = ArrayBuffer | Uint8Array | string;
|
|
|
78
78
|
/**
|
|
79
79
|
* The trailing option of every pinned storage call: a value `accountPin()` answered. The api refuses the
|
|
80
80
|
* call ACCOUNT_CHANGED when the signed-in account (or the app) is not the one the pin was taken under.
|
|
81
|
-
* Absent, the call is
|
|
81
|
+
* Absent, the call is unpinned.
|
|
82
82
|
*/
|
|
83
83
|
type AccountPinOptions = {
|
|
84
84
|
accountPin?: string;
|
|
@@ -118,12 +118,19 @@ type FrameFetchScope = 'frame.fetchRead' | 'frame.fetchWrite';
|
|
|
118
118
|
*
|
|
119
119
|
* A category asks for every capability in it; a `key` asks for one critical permission's own row,
|
|
120
120
|
* and is refused unless the registry has that key at severity 4 (none today). A critical grant
|
|
121
|
-
* covers that key alone, never another key or its category. `attach` binds an "Allow
|
|
122
|
-
* to the attachment that asked, so no other attachment can consume it.
|
|
121
|
+
* covers that key alone, never another key or its category. On a `key`, `attach` binds an "Allow
|
|
122
|
+
* once" answer to the attachment that asked, so no other attachment can consume it.
|
|
123
|
+
*
|
|
124
|
+
* On an Interaction or Site data entry, `attach` is set when the call stays in the frame's own
|
|
125
|
+
* document (no `frameLocator` or `owner` step), and lets the card offer that page: it reads where
|
|
126
|
+
* that attachment's frame is from its middle page, never from the app, so the app learns no path. A
|
|
127
|
+
* card that predates it ignores it and offers the whole site. Upfront asks, Network and Evaluation
|
|
128
|
+
* never send it.
|
|
123
129
|
*/
|
|
124
130
|
type FrameConsentRequest = {
|
|
125
131
|
category: 'interaction' | 'storage' | 'network' | 'evaluation';
|
|
126
132
|
hosts: string[];
|
|
133
|
+
attach?: string;
|
|
127
134
|
} | {
|
|
128
135
|
key: string;
|
|
129
136
|
hosts: string[];
|
|
@@ -215,6 +222,33 @@ declare const SHELL_JAR_MESSAGE: {
|
|
|
215
222
|
*/
|
|
216
223
|
declare const SHELL_JAR_UNREACHABLE: readonly ['bad-attach', 'no-storage', 'bad-jar', 'no-parent', 'no-jar-host', 'no-token', 'no-indexeddb', 'failed'];
|
|
217
224
|
type ShellJarUnreachable = (typeof SHELL_JAR_UNREACHABLE)[number];
|
|
225
|
+
/**
|
|
226
|
+
* FKN internal: why `Resolvers.proxyJar.key` answered no key. Only the render proxy's own documents
|
|
227
|
+
* ask, and only these names cross the wire.
|
|
228
|
+
*
|
|
229
|
+
* - `not-proxy`: the caller is not the render proxy's own origin.
|
|
230
|
+
* - `signed-out`: no account backs the app the proxy is attached to.
|
|
231
|
+
* - `not-enrolled`: the account has no key material, so there is nothing to seal under.
|
|
232
|
+
* - `locked`: the account has key material, and this partition holds no key for it.
|
|
233
|
+
* - `unconfirmed`: nothing answered in time, so neither of the two above is known.
|
|
234
|
+
*/
|
|
235
|
+
declare const PROXY_JAR_REFUSALS: readonly ['not-proxy', 'signed-out', 'not-enrolled', 'locked', 'unconfirmed'];
|
|
236
|
+
type ProxyJarRefusal = (typeof PROXY_JAR_REFUSALS)[number];
|
|
237
|
+
/**
|
|
238
|
+
* The key the render proxy seals one jar under. `key` is 32 bytes for AES-GCM and `jar` the name of the
|
|
239
|
+
* record (43 base64url characters); both are derived from the account's key for the top-level site the
|
|
240
|
+
* jar's storage partition belongs to, so a key handed out in one partition opens no other partition's
|
|
241
|
+
* jar. `verified` is false when no api answer vouched for the key's generation: such a key may open a
|
|
242
|
+
* record that exists, and must not create one or move a clear jar into one.
|
|
243
|
+
*/
|
|
244
|
+
type ProxyJarKey = {
|
|
245
|
+
key: Uint8Array;
|
|
246
|
+
jar: string;
|
|
247
|
+
verified: boolean;
|
|
248
|
+
};
|
|
249
|
+
type ProxyJarAnswer = ProxyJarKey | {
|
|
250
|
+
refused: ProxyJarRefusal;
|
|
251
|
+
};
|
|
218
252
|
/**
|
|
219
253
|
* What a window's middle page, the jar anchor its app mounted (`/attach-jar`) and the anchor's jar
|
|
220
254
|
* host say, all with the attach id.
|
|
@@ -310,9 +344,12 @@ type ShellControl = {
|
|
|
310
344
|
*
|
|
311
345
|
* Refuses, before anything is removed: a filter of any other shape (a TypeError
|
|
312
346
|
* `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)
|
|
314
|
-
*
|
|
315
|
-
*
|
|
347
|
+
* registered domain is none of the hosts' (each a LocatorDeniedError naming why), and, on a jar
|
|
348
|
+
* sealed under the FKN account's key while this device does not hold the key, every filter (an
|
|
349
|
+
* Error `frame.clearCookies: this attachment's jar is sealed under the FKN account's key, which this
|
|
350
|
+
* device does not hold yet; unlock it and call it again`, from a shell from 2026-10 on). Rejects
|
|
351
|
+
* with the library's own message when the jar's store did not take the removal. Absent from a shell
|
|
352
|
+
* that predates it.
|
|
316
353
|
*/
|
|
317
354
|
clearCookies?(filter: ClearCookiesWire, scope: {
|
|
318
355
|
hosts: string[];
|
|
@@ -558,8 +595,9 @@ type RoomMessage = {
|
|
|
558
595
|
text: string;
|
|
559
596
|
};
|
|
560
597
|
/**
|
|
561
|
-
* What a claimed room's mailbox holds, as the room last said. Null for a room
|
|
562
|
-
* `cap` is the most it stores: 500 MB, or the
|
|
598
|
+
* What a claimed room's mailbox holds, as the room last said. Null for a room that keeps no messages:
|
|
599
|
+
* one nobody has claimed, or a claim whose mailbox is off. `cap` is the most it stores: 500 MB, or the
|
|
600
|
+
* size limit the account set in its fkn.app settings.
|
|
563
601
|
*/
|
|
564
602
|
type RoomMailbox = {
|
|
565
603
|
messages: number;
|
|
@@ -600,12 +638,15 @@ type RoomEvent =
|
|
|
600
638
|
} |
|
|
601
639
|
/**
|
|
602
640
|
* the room was claimed, released (by its app, or by the account in its fkn.app settings) or
|
|
603
|
-
* dissolved; `owner` is the owner's member id, or '' while a
|
|
641
|
+
* dissolved, or its mailbox was turned off or on; `owner` is the owner's member id, or '' while a
|
|
642
|
+
* claimed room's owner has never joined. `mailbox` is whether the room now keeps messages, always
|
|
643
|
+
* false while `claimed` is false. Turning a mailbox off sends no `deleted`: what the app shows stays.
|
|
604
644
|
*/
|
|
605
645
|
{
|
|
606
646
|
type: 'claim';
|
|
607
647
|
claimed: boolean;
|
|
608
648
|
owner: string;
|
|
649
|
+
mailbox: boolean;
|
|
609
650
|
};
|
|
610
651
|
type RoomsErrorCode = 'invalid' | 'not-found' | 'bad-key' | 'full' | 'blocked' | 'denied' | 'rate-limited' | 'too-large' | 'storage' | 'quota' | 'unavailable' | 'closed';
|
|
611
652
|
/** A refusal, as data. `packages` crosses the hop the same way, and for the same reason. */
|
|
@@ -646,8 +687,10 @@ type RoomClaimOptions = {
|
|
|
646
687
|
* settings, where it can clear or unclaim the room, so say what would be lost. One line of plain text:
|
|
647
688
|
* trimmed, then 1 to 200 characters as `String.length` counts them, with no control character, line or
|
|
648
689
|
* paragraph separator, or bidi control; anything else is refused `invalid`, never cut short. Not sealed:
|
|
649
|
-
* stored with the claim and shown to the account only. Claiming again with one replaces it
|
|
650
|
-
* that claimed the room only (the same app once it is verified)
|
|
690
|
+
* stored with the claim and shown to the account only. Claiming again with one replaces it: on a room
|
|
691
|
+
* under an app's scope from the app that claimed the room only (the same app once it is verified), and
|
|
692
|
+
* from another app it is refused `denied` (`rooms: only the app that claimed the room can describe it`);
|
|
693
|
+
* on a `global` room from any app of the account. Claiming without one keeps it.
|
|
651
694
|
*/
|
|
652
695
|
description?: string;
|
|
653
696
|
/**
|
|
@@ -665,11 +708,27 @@ type RoomClaimOptions = {
|
|
|
665
708
|
* room. It counts toward the account's room limit while it lasts and frees the slot when it ends.
|
|
666
709
|
*
|
|
667
710
|
* The latest claim decides: claiming again without it makes the room permanent, and with it makes it
|
|
668
|
-
* temporary again.
|
|
669
|
-
* changes it
|
|
670
|
-
* the room
|
|
711
|
+
* temporary again. On a room under an app's scope only the app that claimed the room (the same app
|
|
712
|
+
* once it is verified) sets or changes it, and from another app it is refused `denied` (`rooms: only
|
|
713
|
+
* the app that claimed the room can set when it expires`); on a `global` room any app of the account
|
|
714
|
+
* does. A claim from another app without it leaves the room as it was, on either kind of room.
|
|
671
715
|
*/
|
|
672
716
|
temporary?: boolean | number;
|
|
717
|
+
/**
|
|
718
|
+
* Whether the room keeps its messages. `false` claims the name and stores nothing: a message reaches
|
|
719
|
+
* whoever is present and is kept nowhere, `backlog` answers an empty page, and `edit` and `delete` are
|
|
720
|
+
* refused `invalid` (`rooms: the room keeps no messages`). The claim still reserves the name, locks it
|
|
721
|
+
* to the key and keeps the owner, the blocks and the overrides when everyone leaves, and it still needs
|
|
722
|
+
* premium. `true` or no value keeps a mailbox. Anything else is refused `invalid` (`rooms: malformed
|
|
723
|
+
* frame`).
|
|
724
|
+
*
|
|
725
|
+
* Read only when the call starts the claim: on a room the account already holds it is ignored, so an
|
|
726
|
+
* app that claims on every open never undoes what the owner chose since. A claim landing after a
|
|
727
|
+
* temporary one ran out starts a new claim, so it reads it again. A broker too old to carry it refuses
|
|
728
|
+
* `false` `unavailable` (`rooms: the mailbox switch is not available`) rather than store what the app
|
|
729
|
+
* asked it not to.
|
|
730
|
+
*/
|
|
731
|
+
mailbox?: boolean;
|
|
673
732
|
};
|
|
674
733
|
/** What a backlog page answered: the highest seq it sent, and whether another page follows. */
|
|
675
734
|
type RoomBacklog = {
|
|
@@ -701,49 +760,108 @@ type RoomHandle = {
|
|
|
701
760
|
* let the room outlive what the app asked for.
|
|
702
761
|
*/
|
|
703
762
|
temporaryClaims?: true;
|
|
763
|
+
/**
|
|
764
|
+
* set by a broker that carries `mailbox` on a claim and sends `setMailbox`. A broker older than that
|
|
765
|
+
* drops the option and claims with a mailbox, and has no `setMailbox`, so the lib refuses both on a
|
|
766
|
+
* handle without it rather than store what the app asked it not to.
|
|
767
|
+
*/
|
|
768
|
+
mailboxSwitch?: true;
|
|
704
769
|
defaults: () => Promise<RoomDefaults>;
|
|
705
770
|
members: () => Promise<RoomMember[]>;
|
|
706
771
|
/** sealed before it leaves the browser and refused, never truncated, past this member's `maxMessageBytes` on the wire */
|
|
707
772
|
send: (text: string) => Promise<RoomsFail | {
|
|
708
773
|
ok: true;
|
|
709
774
|
}>;
|
|
710
|
-
/**
|
|
775
|
+
/**
|
|
776
|
+
* a stored message's text, replaced: the sender's own, or any as the owner. From another app of the
|
|
777
|
+
* claim's account on a room claimed under an app's scope, `denied` (`rooms: only the app that claimed
|
|
778
|
+
* the room can change it`), the account's own messages included, as `claim` says.
|
|
779
|
+
*/
|
|
711
780
|
edit: (seq: number, text: string) => Promise<RoomsFail | {
|
|
712
781
|
ok: true;
|
|
713
782
|
}>;
|
|
714
|
-
/**
|
|
783
|
+
/**
|
|
784
|
+
* stored messages dropped: one of the sender's own, or any range as the owner. From another app of the
|
|
785
|
+
* claim's account on a room claimed under an app's scope, `denied` (`rooms: only the app that claimed
|
|
786
|
+
* the room can change it`), the account's own messages included, as `claim` says.
|
|
787
|
+
*/
|
|
715
788
|
delete: (from: number, to?: number) => Promise<RoomsFail | {
|
|
716
789
|
ok: true;
|
|
717
790
|
}>;
|
|
718
791
|
/** replays stored messages above `after` as `message` events marked `replayed`, one page at a time */
|
|
719
792
|
backlog: (after: number, limit?: number) => Promise<RoomsFail | RoomBacklog>;
|
|
793
|
+
/**
|
|
794
|
+
* the room default for `send` or `receive`, from the owner only (`denied`, `rooms: not the room
|
|
795
|
+
* owner`). From another app of the claim's account on a room claimed under an app's scope, `denied`
|
|
796
|
+
* (`rooms: only the app that claimed the room can change it`), as `claim` says.
|
|
797
|
+
*/
|
|
720
798
|
setDefault: (permission: 'send' | 'receive', value: boolean) => Promise<RoomsFail | {
|
|
721
799
|
ok: true;
|
|
722
800
|
}>;
|
|
723
|
-
/**
|
|
801
|
+
/**
|
|
802
|
+
* the message size cap: the room default when no member is named, that member's override otherwise,
|
|
803
|
+
* cleared by null. From the owner only (`denied`, `rooms: not the room owner`); from another app of the
|
|
804
|
+
* claim's account on a room claimed under an app's scope, `denied` (`rooms: only the app that claimed
|
|
805
|
+
* the room can change it`), as `claim` says.
|
|
806
|
+
*/
|
|
724
807
|
limit: (maxMessageBytes: number | null, id?: string) => Promise<RoomsFail | {
|
|
725
808
|
ok: true;
|
|
726
809
|
}>;
|
|
810
|
+
/**
|
|
811
|
+
* a member's override of a permission, set to true, from the owner only (`denied`, `rooms: not the
|
|
812
|
+
* room owner`). From another app of the claim's account on a room claimed under an app's scope,
|
|
813
|
+
* `denied` (`rooms: only the app that claimed the room can change it`), as `claim` says.
|
|
814
|
+
*/
|
|
727
815
|
grant: (id: string, permission: RoomPermission) => Promise<RoomsFail | {
|
|
728
816
|
ok: true;
|
|
729
817
|
}>;
|
|
818
|
+
/**
|
|
819
|
+
* a member's override of a permission, set to false, from the owner only (`denied`, `rooms: not the
|
|
820
|
+
* room owner`). From another app of the claim's account on a room claimed under an app's scope,
|
|
821
|
+
* `denied` (`rooms: only the app that claimed the room can change it`), as `claim` says.
|
|
822
|
+
*/
|
|
730
823
|
revoke: (id: string, permission: RoomPermission) => Promise<RoomsFail | {
|
|
731
824
|
ok: true;
|
|
732
825
|
}>;
|
|
826
|
+
/**
|
|
827
|
+
* a member sent out, free to join again, with the `remove` permission (`denied`, `rooms: permission
|
|
828
|
+
* denied`). From another app of the claim's account on a room claimed under an app's scope, `denied`
|
|
829
|
+
* (`rooms: only the app that claimed the room can change it`), as `claim` says.
|
|
830
|
+
*/
|
|
733
831
|
remove: (id: string) => Promise<RoomsFail | {
|
|
734
832
|
ok: true;
|
|
735
833
|
}>;
|
|
834
|
+
/**
|
|
835
|
+
* a member sent out and kept out, with the `block` permission (`denied`, `rooms: permission denied`).
|
|
836
|
+
* From another app of the claim's account on a room claimed under an app's scope, `denied` (`rooms:
|
|
837
|
+
* only the app that claimed the room can change it`), as `claim` says.
|
|
838
|
+
*/
|
|
736
839
|
block: (id: string) => Promise<RoomsFail | {
|
|
737
840
|
ok: true;
|
|
738
841
|
}>;
|
|
842
|
+
/**
|
|
843
|
+
* a block lifted, with the `block` permission (`denied`, `rooms: permission denied`). From another app
|
|
844
|
+
* of the claim's account on a room claimed under an app's scope, `denied` (`rooms: only the app that
|
|
845
|
+
* claimed the room can change it`), as `claim` says.
|
|
846
|
+
*/
|
|
739
847
|
unblock: (id: string) => Promise<RoomsFail | {
|
|
740
848
|
ok: true;
|
|
741
849
|
}>;
|
|
742
850
|
/**
|
|
743
|
-
* keeps the name
|
|
744
|
-
* buys. `description` says what the room is for, shown to the account in
|
|
745
|
-
* `temporary` makes the claim end by itself that many milliseconds after its last
|
|
746
|
-
* days); the broker carries it as a number of milliseconds and never as `true`.
|
|
851
|
+
* keeps the name for the signed-in premium account, and a mailbox unless `mailbox` is false; the only
|
|
852
|
+
* thing in rooms that premium buys. `description` says what the room is for, shown to the account in
|
|
853
|
+
* its fkn.app settings. `temporary` makes the claim end by itself that many milliseconds after its last
|
|
854
|
+
* claim (`true` is 7 days); the broker carries it as a number of milliseconds and never as `true`.
|
|
855
|
+
* `mailbox` is read only when the call starts the claim.
|
|
856
|
+
*
|
|
857
|
+
* A room under an app's scope, which is every room but a `global` one, is changed by the claim's
|
|
858
|
+
* account only through the app that claimed it (the same app once it is verified): from another app of
|
|
859
|
+
* the account `setDefault`, `limit`, `grant`, `revoke`, `remove`, `block`, `unblock`, `setMailbox`,
|
|
860
|
+
* `edit` and `delete` answer `denied` (`rooms: only the app that claimed the room can change it`), the
|
|
861
|
+
* account's own messages included, and `unavailable` while the room cannot tell whether two apps are
|
|
862
|
+
* one. A claimed `global` room is changed by any app of the account, which also describes it, sets its
|
|
863
|
+
* `temporary` and releases it. The account's fkn.app settings
|
|
864
|
+
* change every room it claimed, and members of other accounts are answered as in any room.
|
|
747
865
|
*
|
|
748
866
|
* Past the account's room limit the call waits while fkn.app shows the person their claimed rooms over
|
|
749
867
|
* your app, with Unclaim on each: it answers `{ ok: true }` once one is unclaimed and this claim is
|
|
@@ -753,6 +871,15 @@ type RoomHandle = {
|
|
|
753
871
|
claim: (options?: RoomClaimOptions) => Promise<RoomsFail | {
|
|
754
872
|
ok: true;
|
|
755
873
|
}>;
|
|
874
|
+
/**
|
|
875
|
+
* the owner turns a claimed room's mailbox off, deleting what it stored, or on, starting it empty.
|
|
876
|
+
* Answers once the room is in that state and has tried to tell the api its storage figure; the answer
|
|
877
|
+
* does not say whether the api heard it. From another app of the claim's account on a room claimed
|
|
878
|
+
* under an app's scope, `denied` (`rooms: only the app that claimed the room can change it`), as `claim` says.
|
|
879
|
+
*/
|
|
880
|
+
setMailbox: (on: boolean) => Promise<RoomsFail | {
|
|
881
|
+
ok: true;
|
|
882
|
+
}>;
|
|
756
883
|
release: () => Promise<RoomsFail | {
|
|
757
884
|
ok: true;
|
|
758
885
|
}>;
|
|
@@ -806,9 +933,6 @@ type ProxyFetchInput = string | URL | Request;
|
|
|
806
933
|
* A spread request is the app's own choice and is not announced: the header keeps naming the
|
|
807
934
|
* session's node, which every request not carrying this flag still goes through. Only the cloud
|
|
808
935
|
* backend reads it; the extension and the desktop fetch from the user's own address and ignore it.
|
|
809
|
-
*
|
|
810
|
-
* `render` used to sit here. It set a request header the proxy never read and never listed for CORS,
|
|
811
|
-
* so a caller that passed it failed its own preflight; nothing did, and it is gone.
|
|
812
936
|
*/
|
|
813
937
|
type ProxyFetchInit = (RequestInit & {
|
|
814
938
|
spread?: boolean;
|
|
@@ -1011,6 +1135,16 @@ type Resolvers = {
|
|
|
1011
1135
|
onUpdateTaken: (callback: () => void) => () => void;
|
|
1012
1136
|
applyUpdate: () => Promise<boolean>;
|
|
1013
1137
|
};
|
|
1138
|
+
/** FKN internal: answers the render proxy's own origin only, every other caller gets `not-proxy`. */
|
|
1139
|
+
proxyJar: {
|
|
1140
|
+
/**
|
|
1141
|
+
* The key of the cookie jar in the caller's storage partition. Refusals cross as data. `prompt`
|
|
1142
|
+
* raises the key card, at most once per broker document, when the answer would be `locked`.
|
|
1143
|
+
*/
|
|
1144
|
+
key: (options?: {
|
|
1145
|
+
prompt?: boolean;
|
|
1146
|
+
}) => Promise<ProxyJarAnswer>;
|
|
1147
|
+
};
|
|
1014
1148
|
proxyFetch: ProxyFetch;
|
|
1015
1149
|
webVpnTcpSocket: (options: TcpSocketOptions) => Promise<TcpSocketResult>;
|
|
1016
1150
|
webVpnTcpSocketListener: (options: TcpSocketListenerOptions) => Promise<TcpSocketListenerResult>;
|
|
@@ -1021,4 +1155,4 @@ type Resolvers = {
|
|
|
1021
1155
|
hideInstallPrompt: () => void;
|
|
1022
1156
|
};
|
|
1023
1157
|
//#endregion
|
|
1024
|
-
export {
|
|
1158
|
+
export { RoomCreateOptions as $, MiddleGotoOptions as A, UdpDatagram as At, Placement as B, FrameMessageRelay as C, StorageEntry as Ct, IpFamily as D, TcpSocketListenerResult as Dt, InstalledPackage as E, TcpSocketListenerOptions as Et, PackageQuery as F, WINDOW_JAR_MODE_TIMEOUT_MS as Ft, ProxyJarKey as G, ProxyFetchInit as H, PackageResult as I, WindowMiddleControl as It, ROOM_TEMPORARY_MS as J, ProxyJarRefusal as K, PackagesErrorCode as L, WriteData as Lt, OverlayRect as M, UdpSocketResult as Mt, OverlayState as N, WINDOW_HANDSHAKE_TIMEOUT_MS as Nt, JAR_ANCHOR_MESSAGE as O, TcpSocketOptions as Ot, PROXY_JAR_REFUSALS as P, WINDOW_HELLO_TIMEOUT_MS as Pt, RoomClaimOptions as Q, PackagesFail as R, JarSeed as Rt, FrameFetchScope as S, ShellJarUnreachable as St, InstallOptions as T, SurfaceRect as Tt, ProxyFetchInput as U, ProxyFetch as V, ProxyJarAnswer as W, Resolvers as X, Radii as Y, RoomBacklog as Z, DnsLookup as _, SHELL_JAR_UNREACHABLE as _t, AccountChange as a, RoomMailbox as at, FrameConsentAnswer as b, ShellFrameMessage as bt, AdoptRequest as c, RoomOpenOptions as ct, ConflictRequest as d, RoomsErrorCode as dt, RoomDefaults as et, ConflictSide as f, RoomsFail as ft, DisplayLevel as g, SHELL_JAR_MESSAGE as gt, DisplayCause as h, SHELL_FRAME_MESSAGE as ht, Account as i, RoomJoinOptions as it, MountDescriptor as j, UdpSocketOptions as jt, MiddleControl as k, TcpSocketResult as kt, AdoptState as l, RoomPermission as lt, ConnectOptions as m, SHELL_CONTROL_KEY as mt, ATTACH_WINDOW_KEY as n, RoomEvent as nt, AccountPinOptions as o, RoomMember as ot, ConnectAvailability as p, SHELL_ATTACH_ERROR as pt, Quota as q, ATTACH_WINDOW_MESSAGE as r, RoomHandle as rt, AddressLookupResult as s, RoomMessage as st, ATTACH_FRAME_KEY as t, RoomEnd as tt, ConflictChoice as u, RoomPermissions as ut, EncryptionState as v, SetOverlayHost as vt, HiddenSurface as w, StorageQuota as wt, FrameConsentRequest as x, ShellGotoOptions as xt, FRAME_MESSAGE as y, ShellControl as yt, PickOptions as z, JarSeedCookie as zt };
|
package/contract.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=`fkn-attach-frame`,t=`fkn-attach-window`,n=`sdbx-control`,r=`sdbx-attach-error`,i=`fkn-frame-message`,a=`sdbx-frame-message`,o={hello:`fkn-attach-window`,refused:`fkn-attach-window-refused`,gone:`fkn-attach-window-gone`,detach:`fkn-attach-window-detach`},s={request:`sdbx-jar-request`,port:`sdbx-jar-port`,mode:`sdbx-jar-mode`},c=[`bad-attach`,`no-storage`,`bad-jar`,`no-parent`,`no-jar-host`,`no-token`,`no-indexeddb`,`failed`],l={hello:`fkn-jar-hello`,ready:`fkn-jar-ready`,port:`fkn-jar-port`,who:`fkn-jar-who`,host:`fkn-jar-host`},
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=`fkn-attach-frame`,t=`fkn-attach-window`,n=`sdbx-control`,r=`sdbx-attach-error`,i=`fkn-frame-message`,a=`sdbx-frame-message`,o={hello:`fkn-attach-window`,refused:`fkn-attach-window-refused`,gone:`fkn-attach-window-gone`,detach:`fkn-attach-window-detach`},s={request:`sdbx-jar-request`,port:`sdbx-jar-port`,mode:`sdbx-jar-mode`},c=[`bad-attach`,`no-storage`,`bad-jar`,`no-parent`,`no-jar-host`,`no-token`,`no-indexeddb`,`failed`],l=[`not-proxy`,`signed-out`,`not-enrolled`,`locked`,`unconfirmed`],u={hello:`fkn-jar-hello`,ready:`fkn-jar-ready`,port:`fkn-jar-port`,who:`fkn-jar-who`,host:`fkn-jar-host`},d=2e4,f=3e4,p=6e4,m={default:6048e5,min:6e4,max:31536e6};exports.ATTACH_FRAME_KEY=e,exports.ATTACH_WINDOW_KEY=t,exports.ATTACH_WINDOW_MESSAGE=o,exports.FRAME_MESSAGE=i,exports.JAR_ANCHOR_MESSAGE=u,exports.PROXY_JAR_REFUSALS=l,exports.ROOM_TEMPORARY_MS=m,exports.SHELL_ATTACH_ERROR=r,exports.SHELL_CONTROL_KEY=n,exports.SHELL_FRAME_MESSAGE=a,exports.SHELL_JAR_MESSAGE=s,exports.SHELL_JAR_UNREACHABLE=c,exports.WINDOW_HANDSHAKE_TIMEOUT_MS=p,exports.WINDOW_HELLO_TIMEOUT_MS=d,exports.WINDOW_JAR_MODE_TIMEOUT_MS=f;
|
package/contract.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as CookieMatchWire, u as ClearCookiesWire } from "./index-
|
|
2
|
-
import { $ as
|
|
3
|
-
import { o as TcpSocketOption, v as UdpSocketOption } from "./wire-
|
|
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 };
|
|
1
|
+
import { d as CookieMatchWire, u as ClearCookiesWire } from "./index-C8Y-YHrU.js";
|
|
2
|
+
import { $ as RoomCreateOptions, A as MiddleGotoOptions, At as UdpDatagram, B as Placement, C as FrameMessageRelay, Ct as StorageEntry, D as IpFamily, Dt as TcpSocketListenerResult, E as InstalledPackage, Et as TcpSocketListenerOptions, F as PackageQuery, Ft as WINDOW_JAR_MODE_TIMEOUT_MS, G as ProxyJarKey, H as ProxyFetchInit, I as PackageResult, It as WindowMiddleControl, J as ROOM_TEMPORARY_MS, K as ProxyJarRefusal, L as PackagesErrorCode, Lt as WriteData, M as OverlayRect, Mt as UdpSocketResult, N as OverlayState, Nt as WINDOW_HANDSHAKE_TIMEOUT_MS, O as JAR_ANCHOR_MESSAGE, Ot as TcpSocketOptions, P as PROXY_JAR_REFUSALS, Pt as WINDOW_HELLO_TIMEOUT_MS, Q as RoomClaimOptions, R as PackagesFail, Rt as JarSeed, S as FrameFetchScope, St as ShellJarUnreachable, T as InstallOptions, Tt as SurfaceRect, U as ProxyFetchInput, V as ProxyFetch, W as ProxyJarAnswer, X as Resolvers, Y as Radii, Z as RoomBacklog, _ as DnsLookup, _t as SHELL_JAR_UNREACHABLE, a as AccountChange, at as RoomMailbox, b as FrameConsentAnswer, bt as ShellFrameMessage, c as AdoptRequest, ct as RoomOpenOptions, d as ConflictRequest, dt as RoomsErrorCode, et as RoomDefaults, f as ConflictSide, ft as RoomsFail, g as DisplayLevel, gt as SHELL_JAR_MESSAGE, h as DisplayCause, ht as SHELL_FRAME_MESSAGE, i as Account, it as RoomJoinOptions, j as MountDescriptor, jt as UdpSocketOptions, k as MiddleControl, kt as TcpSocketResult, l as AdoptState, lt as RoomPermission, m as ConnectOptions, mt as SHELL_CONTROL_KEY, n as ATTACH_WINDOW_KEY, nt as RoomEvent, o as AccountPinOptions, ot as RoomMember, p as ConnectAvailability, pt as SHELL_ATTACH_ERROR, q as Quota, r as ATTACH_WINDOW_MESSAGE, rt as RoomHandle, s as AddressLookupResult, st as RoomMessage, t as ATTACH_FRAME_KEY, tt as RoomEnd, u as ConflictChoice, ut as RoomPermissions, v as EncryptionState, vt as SetOverlayHost, w as HiddenSurface, wt as StorageQuota, x as FrameConsentRequest, xt as ShellGotoOptions, y as FRAME_MESSAGE, yt as ShellControl, z as PickOptions, zt as JarSeedCookie } from "./contract-DP_jc5pZ.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, PROXY_JAR_REFUSALS, PackageQuery, PackageResult, PackagesErrorCode, PackagesFail, PickOptions, Placement, ProxyFetch, ProxyFetchInit, ProxyFetchInput, ProxyJarAnswer, ProxyJarKey, ProxyJarRefusal, 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/contract.js
CHANGED
|
@@ -17,16 +17,22 @@ var e = "fkn-attach-frame", t = "fkn-attach-window", n = "sdbx-control", r = "sd
|
|
|
17
17
|
"no-token",
|
|
18
18
|
"no-indexeddb",
|
|
19
19
|
"failed"
|
|
20
|
-
], l =
|
|
20
|
+
], l = [
|
|
21
|
+
"not-proxy",
|
|
22
|
+
"signed-out",
|
|
23
|
+
"not-enrolled",
|
|
24
|
+
"locked",
|
|
25
|
+
"unconfirmed"
|
|
26
|
+
], u = {
|
|
21
27
|
hello: "fkn-jar-hello",
|
|
22
28
|
ready: "fkn-jar-ready",
|
|
23
29
|
port: "fkn-jar-port",
|
|
24
30
|
who: "fkn-jar-who",
|
|
25
31
|
host: "fkn-jar-host"
|
|
26
|
-
},
|
|
32
|
+
}, d = 2e4, f = 3e4, p = 6e4, m = {
|
|
27
33
|
default: 6048e5,
|
|
28
34
|
min: 6e4,
|
|
29
35
|
max: 31536e6
|
|
30
36
|
};
|
|
31
37
|
//#endregion
|
|
32
|
-
export { e as ATTACH_FRAME_KEY, t as ATTACH_WINDOW_KEY, o as ATTACH_WINDOW_MESSAGE, i as FRAME_MESSAGE,
|
|
38
|
+
export { e as ATTACH_FRAME_KEY, t as ATTACH_WINDOW_KEY, o as ATTACH_WINDOW_MESSAGE, i as FRAME_MESSAGE, u as JAR_ANCHOR_MESSAGE, l as PROXY_JAR_REFUSALS, m as ROOM_TEMPORARY_MS, r as SHELL_ATTACH_ERROR, n as SHELL_CONTROL_KEY, a as SHELL_FRAME_MESSAGE, s as SHELL_JAR_MESSAGE, c as SHELL_JAR_UNREACHABLE, p as WINDOW_HANDSHAKE_TIMEOUT_MS, d as WINDOW_HELLO_TIMEOUT_MS, f as WINDOW_JAR_MODE_TIMEOUT_MS };
|
package/dgram.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { v as UdpSocketOption } from "./wire-
|
|
3
|
-
import "./api-
|
|
1
|
+
import { Mt as UdpSocketResult, X as Resolvers } from "./contract-DP_jc5pZ.js";
|
|
2
|
+
import { v as UdpSocketOption } from "./wire-BwA4JjZH.js";
|
|
3
|
+
import "./api-Cuf3ynZX.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
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
+
import { $ as t, A as n, B as r, C as i, D as a, E as o, F as ee, G as s, H as te, I as ne, J as c, K as l, L as u, M as re, O as ie, Q as ae, R as d, S as f, U as p, V as m, W as h, X as g, Y as _, Z as v, _ as y, a as b, at as x, b as S, ct as C, d as w, dt as T, et as E, ft as D, g as O, gt as k, ht as A, i as j, it as M, mt as N, n as oe, nt as P, pt as F, q as I, r as L, rt as R, st as z, t as B, tt as V, ut as H, v as U, w as W, x as G, y as K, z as q } from "./lib-H5-e2A1h.js";
|
|
3
|
+
import { o as se, p as ce } from "./api-DIgTslNb.js";
|
|
4
|
+
import { t as le } from "./proxy-Dixbk1WL.js";
|
|
5
|
+
import { available as ue, fetch as J } from "./desktop.js";
|
|
6
|
+
//#region ../web-extension/lib/utils/background-stopped.js
|
|
7
|
+
var Y = "BackgroundStoppedError", X = (e) => w(e) && e.name === "BackgroundStoppedError", Z = async (e) => {
|
|
8
|
+
if (typeof window > "u") return !1;
|
|
9
|
+
if (P()) return !0;
|
|
10
|
+
let t = await se, n = null, r = new Promise((e) => {
|
|
11
|
+
n = () => {
|
|
12
|
+
P() && e(!0);
|
|
13
|
+
}, V.addEventListener("statuschange", n);
|
|
14
|
+
}), i = t.installPrompt.show(e).then(() => !1), a = await Promise.race([r, i]);
|
|
15
|
+
return n && V.removeEventListener("statuschange", n), await t.installPrompt.hide().catch(() => {}), a;
|
|
16
|
+
}, Q = null;
|
|
17
|
+
M(() => (Q ||= Z().then(() => void 0).finally(() => {
|
|
18
|
+
Q = null;
|
|
19
|
+
}), Q));
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/auto.ts
|
|
22
|
+
var $ = () => typeof document < "u" && P(), de = async (e, t) => {
|
|
23
|
+
if (ce(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 s(e, t);
|
|
26
|
+
}
|
|
27
|
+
return $() ? s(e, {
|
|
28
|
+
...t,
|
|
29
|
+
credentials: "omit"
|
|
30
|
+
}) : ue() ? J(e, t) : le(e, t);
|
|
31
|
+
}, fe = /* @__PURE__ */ e({
|
|
32
|
+
ATTACH_FRAME_EVENT_KEY: () => j,
|
|
33
|
+
BACKGROUND_STOPPED: () => Y,
|
|
34
|
+
CATEGORIES: () => W,
|
|
35
|
+
EXTENSION_ABI: () => 4,
|
|
36
|
+
ExtensionOperationUnsupportedError: () => z,
|
|
37
|
+
ExtensionOutdatedError: () => C,
|
|
38
|
+
FORGEABLE_HEADERS: () => v,
|
|
39
|
+
FrameWindowBlockedError: () => O,
|
|
40
|
+
FrameWindowRefusedError: () => y,
|
|
41
|
+
LOCATOR_DENIED: () => n,
|
|
42
|
+
LOCATOR_ERROR: () => ne,
|
|
43
|
+
LOCATOR_INVALID: () => d,
|
|
44
|
+
LOCATOR_UNSUPPORTED: () => a,
|
|
45
|
+
PERMISSION_DENIED: () => B,
|
|
46
|
+
REQUIRED_EXTENSION_ABI: () => 0,
|
|
47
|
+
TimeoutError: () => o,
|
|
48
|
+
assertAttachableFrameUrl: () => G,
|
|
49
|
+
assertFetchableUrl: () => h,
|
|
50
|
+
assertForgeableHeaders: () => ae,
|
|
51
|
+
assertLockdownApplicable: () => f,
|
|
52
|
+
assertOneCookieIdentity: () => t,
|
|
53
|
+
attachFrame: () => b,
|
|
54
|
+
attachFramePermission: () => U,
|
|
55
|
+
available: () => $,
|
|
56
|
+
box: () => D,
|
|
57
|
+
cookies: () => te,
|
|
58
|
+
createFrame: () => K,
|
|
59
|
+
createVideoElementHandle: () => F,
|
|
60
|
+
events: () => V,
|
|
61
|
+
extension: () => V,
|
|
62
|
+
fetch: () => s,
|
|
63
|
+
fetchCredentialedPermission: () => l,
|
|
64
|
+
fetchLocalPermission: () => I,
|
|
65
|
+
fetchPermission: () => c,
|
|
66
|
+
gotoPermission: () => S,
|
|
67
|
+
handleRevivableModules: () => T,
|
|
68
|
+
hasForgedCookie: () => E,
|
|
69
|
+
isBackgroundStopped: () => X,
|
|
70
|
+
isBlockedFetchUrl: () => _,
|
|
71
|
+
isBlockedFrameUrl: () => i,
|
|
72
|
+
isExtensionExposed: () => P,
|
|
73
|
+
isLocalNetworkUrl: () => g,
|
|
74
|
+
isLocatorDenied: () => u,
|
|
75
|
+
isLocatorInvalid: () => re,
|
|
76
|
+
isLocatorUnsupported: () => ie,
|
|
77
|
+
isPermissionDenied: () => oe,
|
|
78
|
+
isTerminalError: () => ee,
|
|
79
|
+
isType: () => N,
|
|
80
|
+
modifyRequestHeadersPermission: () => q,
|
|
81
|
+
permissions: () => L,
|
|
82
|
+
promptInstall: () => Z,
|
|
83
|
+
readCookiePermission: () => p,
|
|
84
|
+
readExtensionHandshake: () => R,
|
|
85
|
+
removeRequestHeaderRule: () => r,
|
|
86
|
+
revive: () => A,
|
|
87
|
+
setMissingExtensionHandler: () => M,
|
|
88
|
+
setRequestHeaderRule: () => m,
|
|
89
|
+
supportsOperation: () => H,
|
|
90
|
+
type: () => k,
|
|
91
|
+
waitForExtensionExposure: () => x
|
|
92
|
+
});
|
|
93
|
+
//#endregion
|
|
94
|
+
export { Y as a, Z as i, de as n, X as o, $ as r, fe as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-C8Y-YHrU.js";
|
|
2
2
|
//#region ../frame-locator/lib/errors.d.ts
|
|
3
3
|
declare const LOCATOR_ERROR = "LocatorError";
|
|
4
4
|
declare const LOCATOR_UNSUPPORTED = "LocatorUnsupportedError";
|
|
@@ -121,6 +121,7 @@ type RequestHeaderRule = {
|
|
|
121
121
|
requestHeaders: HeaderOperation[];
|
|
122
122
|
reason?: string;
|
|
123
123
|
};
|
|
124
|
+
/** Tab-scoped: the rule is dropped when the tab goes away. */
|
|
124
125
|
declare const setRequestHeaderRule: (rule: RequestHeaderRule) => Promise<{
|
|
125
126
|
ruleId: number;
|
|
126
127
|
}>;
|
|
@@ -158,9 +159,7 @@ declare const BACKGROUND_STOPPED = "BackgroundStoppedError";
|
|
|
158
159
|
/**
|
|
159
160
|
* What a call into the extension rejects with when Chrome stopped the extension's worker before it finished
|
|
160
161
|
* 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.
|
|
162
|
+
* The call may or may not have run, so it is never resent; a retry by the app reaches the restarted worker.
|
|
164
163
|
*/
|
|
165
164
|
type BackgroundStoppedError = Error & {
|
|
166
165
|
name: typeof BACKGROUND_STOPPED;
|
|
@@ -170,31 +169,21 @@ declare const isBackgroundStopped: (error: unknown) => boolean;
|
|
|
170
169
|
//#endregion
|
|
171
170
|
//#region ../web-extension/lib/utils/extension-abi.d.ts
|
|
172
171
|
/**
|
|
173
|
-
* What the extension half announces about itself. Increment when the callable surface
|
|
174
|
-
* way a page could notice: an operation added, removed, renamed, or given different semantics.
|
|
175
|
-
*
|
|
176
|
-
* This is not the package version and not the manifest version. Those move for reasons that have
|
|
177
|
-
* nothing to do with the protocol (a dependency bump, a store resubmission), and tying the contract
|
|
178
|
-
* 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.
|
|
179
175
|
*/
|
|
180
176
|
declare const EXTENSION_ABI = 4;
|
|
181
177
|
/**
|
|
182
|
-
* The oldest extension the page half will talk to. Raise it
|
|
183
|
-
* on something older extensions cannot do, never merely because `EXTENSION_ABI` moved
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
* Deliberately 0 for this release. Every extension currently installed predates versioning and
|
|
187
|
-
* announces no ABI at all, so a floor of 1 would refuse all of them the moment this page half
|
|
188
|
-
* 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.
|
|
189
181
|
*/
|
|
190
182
|
declare const REQUIRED_EXTENSION_ABI = 0;
|
|
191
183
|
/**
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
* empty one. A pre-versioning extension supports the whole original surface and simply cannot say so,
|
|
196
|
-
* so an absent list has to read as "unknown, assume the old set" rather than "supports nothing".
|
|
197
|
-
* 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".
|
|
198
187
|
*/
|
|
199
188
|
type ExtensionHandshake = {
|
|
200
189
|
status: 'absent';
|
|
@@ -209,19 +198,14 @@ type ExtensionHandshake = {
|
|
|
209
198
|
operations: readonly string[] | null;
|
|
210
199
|
};
|
|
211
200
|
/**
|
|
212
|
-
* Whether a named operation is callable.
|
|
213
|
-
*
|
|
214
|
-
* `null` operations means the extension could not tell us, and the answer is YES: it predates the
|
|
215
|
-
* ops list and supports the original surface. The ABI floor is the mechanism for refusing an
|
|
216
|
-
* 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.
|
|
217
203
|
*/
|
|
218
204
|
declare const supportsOperation: (handshake: ExtensionHandshake, operation: string) => boolean;
|
|
219
205
|
/**
|
|
220
|
-
* Thrown instead of the generic "not installed" message when the extension
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
* A named class rather than a message match: only the name survives a structured-clone hop, and the
|
|
224
|
-
* 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.
|
|
225
209
|
*/
|
|
226
210
|
declare class ExtensionOutdatedError extends Error {
|
|
227
211
|
readonly abi: number;
|
|
@@ -248,10 +232,8 @@ type ExtensionEventMap = {
|
|
|
248
232
|
};
|
|
249
233
|
declare const extension: import("osra").TypedEventTarget<ExtensionEventMap>;
|
|
250
234
|
/**
|
|
251
|
-
* Unchanged on purpose
|
|
252
|
-
*
|
|
253
|
-
* compatibility here runs in BOTH directions, which is the only property that matters when neither
|
|
254
|
-
* 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.
|
|
255
237
|
*/
|
|
256
238
|
declare const isExtensionExposed: () => boolean;
|
|
257
239
|
/** The three-way answer: absent, present but too old, or usable. */
|