@fkn/lib 0.9.43 → 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-H1TzWitc.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-Y0FzWpFT.d.ts → cloud-DyOQPyUB.d.ts} +4 -4
- package/cloud.d.ts +4 -4
- package/{contract-DJxGa8lb.d.ts → contract-6Xfd_qel.d.ts} +108 -21
- package/contract.d.ts +3 -3
- package/dgram.d.ts +7 -14
- package/dns.d.ts +1 -1
- package/{extension-BtDg-F2g.d.ts → extension-BlEtNAYc.d.ts} +19 -37
- package/extension.d.ts +2 -2
- 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-BOInGaEl.d.ts} +31 -55
- package/{index-D2lvaQDs.d.ts → index-DKr9L2RI.d.ts} +6 -11
- package/index.d.ts +35 -38
- package/messages-d7pvCXPn.d.ts +34 -0
- package/messages.d.ts +1 -1
- package/{net-BOswhyfE.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-ylK5lpw8.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/messages-CRcziTuC.d.ts +0 -46
|
@@ -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-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";
|
|
@@ -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. */
|
package/extension.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
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-
|
|
2
|
-
import { $ as isLocatorInvalid, A as CookieDetails, B as fetchPermission, C as assertLockdownApplicable, D as modifyRequestHeadersPermission, E as RequestHeaderRule, F as ProxyFetchRequest, G as assertOneCookieIdentity, H as isLocalNetworkUrl, I as assertFetchableUrl, J as LOCATOR_ERROR, K as hasForgedCookie, L as fetch, M as cookies, N as readCookiePermission, O as removeRequestHeaderRule, P as FetchInit, Q as isLocatorDenied, R as fetchCredentialedPermission, S as assertAttachableFrameUrl, T as HeaderOperation, U as FORGEABLE_HEADERS, V as isBlockedFetchUrl, W as assertForgeableHeaders, X as LOCATOR_UNSUPPORTED, Y as LOCATOR_INVALID, Z as TimeoutError, _ as BackgroundStoppedError, a as extension, b as PermissionDeniedError, c as setMissingExtensionHandler, d as ExtensionHandshake, et as isLocatorUnsupported, f as ExtensionOperationUnsupportedError, g as BACKGROUND_STOPPED, h as supportsOperation, i as promptInstall, j as SiteCookie, k as setRequestHeaderRule, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, o as isExtensionExposed, p as ExtensionOutdatedError, q as LOCATOR_DENIED, r as isExtensionAvailable, s as readExtensionHandshake, tt as isTerminalError, u as EXTENSION_ABI, v as isBackgroundStopped, w as isBlockedFrameUrl, x as isPermissionDenied, y as PERMISSION_DENIED, z as fetchLocalPermission } from "./extension-
|
|
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
|
+
import { $ as isLocatorInvalid, A as CookieDetails, B as fetchPermission, C as assertLockdownApplicable, D as modifyRequestHeadersPermission, E as RequestHeaderRule, F as ProxyFetchRequest, G as assertOneCookieIdentity, H as isLocalNetworkUrl, I as assertFetchableUrl, J as LOCATOR_ERROR, K as hasForgedCookie, L as fetch, M as cookies, N as readCookiePermission, O as removeRequestHeaderRule, P as FetchInit, Q as isLocatorDenied, R as fetchCredentialedPermission, S as assertAttachableFrameUrl, T as HeaderOperation, U as FORGEABLE_HEADERS, V as isBlockedFetchUrl, W as assertForgeableHeaders, X as LOCATOR_UNSUPPORTED, Y as LOCATOR_INVALID, Z as TimeoutError, _ as BackgroundStoppedError, a as extension, b as PermissionDeniedError, c as setMissingExtensionHandler, d as ExtensionHandshake, et as isLocatorUnsupported, f as ExtensionOperationUnsupportedError, g as BACKGROUND_STOPPED, h as supportsOperation, i as promptInstall, j as SiteCookie, k as setRequestHeaderRule, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, o as isExtensionExposed, p as ExtensionOutdatedError, q as LOCATOR_DENIED, r as isExtensionAvailable, s as readExtensionHandshake, tt as isTerminalError, u as EXTENSION_ABI, v as isBackgroundStopped, w as isBlockedFrameUrl, x as isPermissionDenied, y as PERMISSION_DENIED, z as fetchLocalPermission } from "./extension-BlEtNAYc.js";
|
|
3
3
|
export { ATTACH_FRAME_EVENT_KEY, AddScriptTagOptions, AttachCookies, AttachFrameOptions, AttachWindowOptions, BACKGROUND_STOPPED, type BackgroundStoppedError, BlankPage, BoxedVideoElement, CATEGORIES, CategoryGrant, type CategoryMeta, CategoryRequest, ClearCookiesOptions, ClearCookiesWire, CookieDetails, CookieMatchWire, EXTENSION_ABI, type Executor, type ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, FrameBackendEvent, FrameDocumentEvent, FrameEventListener, FrameEventMap, FrameLocator, FrameMessageEvent, FramePostMessageOptions, FrameWindowBlockedError, FrameWindowOptions, FrameWindowRefusal, FrameWindowRefusedError, type Gate, type GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_INVALID, LOCATOR_UNSUPPORTED, LegacyPermissionRequest, Locator, type OperationRequest, PERMISSION_DENIED, type PermissionCategory, type PermissionDeniedError, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, type SelectorPart, SiteCookie, StorageState, StorageStateCookie, TimeoutError, VideoElementState, WindowFrame, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFrame, attachFramePermission, isExtensionAvailable as available, box, cookies, createFrame, createVideoElementHandle, extension as events, extension, fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, gotoPermission, handleRevivableModules, hasForgedCookie, isBackgroundStopped, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorInvalid, isLocatorUnsupported, isPermissionDenied, isTerminalError, isType, modifyRequestHeadersPermission, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, setMissingExtensionHandler, setRequestHeaderRule, supportsOperation, type, waitForExtensionExposure };
|
package/fs/promises.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as WriteData, i as Stats, n as MakeOptions, o as WriteOptions, r as ReadOptions } from "../index-BQgZVQl7.js";
|
|
2
|
-
import { v as promises } from "../index-
|
|
2
|
+
import { v as promises } from "../index-DKr9L2RI.js";
|
|
3
3
|
//#region src/fs/promises.d.ts
|
|
4
4
|
export declare const readFile: (path: import("node:fs").PathLike, options?: ReadOptions) => Promise<Buffer | string>, writeFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>, appendFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>, unlink: (path: import("node:fs").PathLike) => Promise<void>, rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>, readdir: (path: import("node:fs").PathLike) => Promise<string[]>, mkdir: (path: import("node:fs").PathLike, options?: MakeOptions) => Promise<void>, rm: (path: import("node:fs").PathLike, options?: {
|
|
5
5
|
recursive?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as WriteData, i as Stats, n as MakeOptions, o as WriteOptions, r as ReadOptions, t as Callback } from "./index-BQgZVQl7.js";
|
|
2
|
-
import { _ as unlock, a as StorageAccountChangedError, c as StorageNotFoundError, f as encryption, g as storage_d_exports, h as quota, i as SealedRead, l as StorageQuota, m as isNotFound, n as EncryptionStatus, o as StorageAccountPinUnsupportedError, p as isAccountChanged, r as FileEntry, s as StorageLockedError, t as CloudAvailability, u as availability } from "./storage-
|
|
3
|
-
import { c as STORAGE_ACCOUNT_CHANGED, l as STORAGE_ACCOUNT_PIN_UNSUPPORTED, u as STORAGE_NOT_FOUND } from "./messages-
|
|
2
|
+
import { _ as unlock, a as StorageAccountChangedError, c as StorageNotFoundError, f as encryption, g as storage_d_exports, h as quota, i as SealedRead, l as StorageQuota, m as isNotFound, n as EncryptionStatus, o as StorageAccountPinUnsupportedError, p as isAccountChanged, r as FileEntry, s as StorageLockedError, t as CloudAvailability, u as availability } from "./storage-BLBsmkmp.js";
|
|
3
|
+
import { c as STORAGE_ACCOUNT_CHANGED, l as STORAGE_ACCOUNT_PIN_UNSUPPORTED, u as STORAGE_NOT_FOUND } from "./messages-d7pvCXPn.js";
|
|
4
4
|
declare namespace fs_d_exports {
|
|
5
5
|
export { CloudAvailability, EncryptionStatus, FileEntry, STORAGE_ACCOUNT_CHANGED, STORAGE_ACCOUNT_PIN_UNSUPPORTED, STORAGE_NOT_FOUND, SealedRead, Stats, StorageAccountChangedError, StorageAccountPinUnsupportedError, StorageLockedError, StorageNotFoundError, StorageQuota, availability, available, encryption, isAccountChanged, isNotFound, list, mkdir, promises, quota, readFile, readFileSealed, readdir, rename, rm, stat, unlink, unlock, writeFile };
|
|
6
6
|
}
|
package/fs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as Stats } from "./index-BQgZVQl7.js";
|
|
2
|
-
import { a as StorageAccountChangedError, i as SealedRead, o as StorageAccountPinUnsupportedError, p as isAccountChanged } from "./storage-
|
|
3
|
-
import { c as STORAGE_ACCOUNT_CHANGED, l as STORAGE_ACCOUNT_PIN_UNSUPPORTED } from "./messages-
|
|
4
|
-
import { A as rmSync, B as ConflictResolver, C as readdir, D as renameSync, E as rename, F as unlinkSync, H as FileConflict, I as writeFile, L as writeFileSync, M as stat, N as statSync, O as replicating, P as unlink, R as AdoptSummary, S as readFileSync, T as remount, V as ConflictSide, _ as pendingDeletes, a as appendFileSync, b as readFile, c as existsSync, d as lstatSync, f as mkdir, g as pending, h as onConflict, i as appendFile, j as rmdirSync, k as rm, l as flush, m as mount, n as adopt, o as available, p as mkdirSync, r as adoptable, s as exists, t as _default, v as promises, w as readdirSync, x as readFileSealed, y as pull, z as ConflictResolution } from "./index-
|
|
2
|
+
import { a as StorageAccountChangedError, i as SealedRead, o as StorageAccountPinUnsupportedError, p as isAccountChanged } from "./storage-BLBsmkmp.js";
|
|
3
|
+
import { c as STORAGE_ACCOUNT_CHANGED, l as STORAGE_ACCOUNT_PIN_UNSUPPORTED } from "./messages-d7pvCXPn.js";
|
|
4
|
+
import { A as rmSync, B as ConflictResolver, C as readdir, D as renameSync, E as rename, F as unlinkSync, H as FileConflict, I as writeFile, L as writeFileSync, M as stat, N as statSync, O as replicating, P as unlink, R as AdoptSummary, S as readFileSync, T as remount, V as ConflictSide, _ as pendingDeletes, a as appendFileSync, b as readFile, c as existsSync, d as lstatSync, f as mkdir, g as pending, h as onConflict, i as appendFile, j as rmdirSync, k as rm, l as flush, m as mount, n as adopt, o as available, p as mkdirSync, r as adoptable, s as exists, t as _default, v as promises, w as readdirSync, x as readFileSealed, y as pull, z as ConflictResolution } from "./index-DKr9L2RI.js";
|
|
5
5
|
export { type AdoptSummary, type ConflictResolution, type ConflictResolver, type ConflictSide, type FileConflict, STORAGE_ACCOUNT_CHANGED, STORAGE_ACCOUNT_PIN_UNSUPPORTED, type SealedRead, type Stats, StorageAccountChangedError, StorageAccountPinUnsupportedError, adopt, adoptable, appendFile, appendFileSync, available, _default as default, exists, existsSync, flush, isAccountChanged, lstatSync, mkdir, mkdirSync, mount, onConflict, pending, pendingDeletes, promises, pull, readFile, readFileSealed, readFileSync, readdir, readdirSync, remount, rename, renameSync, replicating, rm, rmSync, rmdirSync, stat, statSync, unlink, unlinkSync, writeFile, writeFileSync };
|
package/http.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Socket, t as Server$1 } from "./net-
|
|
1
|
+
import { n as Socket, t as Server$1 } from "./net-CmMZgV2a.js";
|
|
2
2
|
import { Buffer } from "buffer";
|
|
3
3
|
import { Stream } from "stream";
|
|
4
4
|
import { IncomingHttpHeaders, OutgoingHttpHeaders, RequestOptions } from "http";
|
|
@@ -24,35 +24,24 @@ type SelectorModule = {
|
|
|
24
24
|
type OperationModule = {
|
|
25
25
|
resolve: (context: LocatorContext, ...args: any[]) => unknown;
|
|
26
26
|
/**
|
|
27
|
-
* Pins the operation to one chain kind, opting it out of the executor's cross-kind fallback.
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* `
|
|
31
|
-
* element `click` then runs against the child's `documentElement`. It is also bidirectional, so
|
|
32
|
-
* without this an operation registered only on the `frame` kind is silently reachable from an
|
|
33
|
-
* element chain too.
|
|
34
|
-
*
|
|
35
|
-
* For most operations that is a convenience. For one whose whole meaning is WHICH REALM it runs
|
|
36
|
-
* in, it is a silent identity confusion: `locator('#x').fetch()` would run in the document that
|
|
37
|
-
* CONTAINS `#x` while reading as though it ran in `#x`. Pin those, so the wrong spelling is
|
|
38
|
-
* refused by name instead of quietly doing something else.
|
|
27
|
+
* Pins the operation to one chain kind, opting it out of the executor's cross-kind fallback. That
|
|
28
|
+
* fallback is load bearing (`frameLocator('#f').click()` runs the element `click` against the
|
|
29
|
+
* child's `documentElement`) and bidirectional, so pin an operation whose meaning is which realm it
|
|
30
|
+
* runs in: unpinned, `locator('#x').fetch()` would run in the document containing `#x`.
|
|
39
31
|
*/
|
|
40
32
|
kind?: ChainKind;
|
|
41
33
|
/**
|
|
42
|
-
* The argument list a gate sees when `ensure(operation, options)` asks about this operation
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* settles a different key at `ensure` than the real call does: `fetch(url, init)` reads the method
|
|
47
|
-
* from `args[1]`, so it declares `options => [undefined, options]`.
|
|
34
|
+
* The argument list a gate sees when `ensure(operation, options)` asks about this operation, so a
|
|
35
|
+
* gate keyed on an argument settles the same key at `ensure` as the real call. Defaults to
|
|
36
|
+
* `[options]`; `fetch(url, init)` reads the method from `args[1]`, so it declares
|
|
37
|
+
* `options => [undefined, options]`.
|
|
48
38
|
*/
|
|
49
39
|
ensureArgs?: (options: Record<string, unknown>) => unknown[];
|
|
50
40
|
/**
|
|
51
|
-
* Maps the
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* arguments travel verbatim.
|
|
41
|
+
* Maps the caller's arguments to the ones the wire carries, before the gate and the executor see
|
|
42
|
+
* them, and gives the chain method its parameter types, so a public option can take a new name while
|
|
43
|
+
* every backend keeps reading the old one. Throw to refuse a call before anything is gated or sent.
|
|
44
|
+
* Absent, the arguments travel verbatim.
|
|
56
45
|
*/
|
|
57
46
|
send?: (...args: any[]) => unknown[];
|
|
58
47
|
/**
|
|
@@ -72,10 +61,9 @@ type Modules = {
|
|
|
72
61
|
};
|
|
73
62
|
/**
|
|
74
63
|
* A chain method answered on the calling side by rewriting the parts collected so far into parts every
|
|
75
|
-
* executor already resolves,
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* Throw to refuse a chain the rewrite cannot express. The executor never sees it.
|
|
64
|
+
* executor already resolves, so it reaches an older executor (which refuses a selector name it lacks)
|
|
65
|
+
* with a meaning it already has. `to` is the kind of chain it returns. Throw to refuse a chain the
|
|
66
|
+
* rewrite cannot express. The executor never sees it.
|
|
79
67
|
*/
|
|
80
68
|
type ChainRewrite = {
|
|
81
69
|
to: ChainKind;
|
|
@@ -122,16 +110,13 @@ type AddStyleTagOptions$1 = OperationOptions & {
|
|
|
122
110
|
//#endregion
|
|
123
111
|
//#region ../frame-locator/lib/fetch.d.ts
|
|
124
112
|
/**
|
|
125
|
-
* A request issued from the realm the chain
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
* exactly the degraded shape a CSRF-protected private API refuses.
|
|
113
|
+
* A request issued from the realm the chain lands in, so the browser supplies that document's own
|
|
114
|
+
* cookie jar (partitioned, on the extension path), `Origin`, `Referer` and `Sec-Fetch-*`. Nothing here
|
|
115
|
+
* synthesizes them: a private API declines a request whose initiator was synthesized.
|
|
129
116
|
*
|
|
130
|
-
* This
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
* without a permission a type error, plus an authoritative origin check in the content-script resolver.
|
|
134
|
-
* Do not add a "convenience" path that skips the consumer's gate.
|
|
117
|
+
* This is the mechanism only, with no allowlist and no consent. The consumer gates it (in the FKN
|
|
118
|
+
* extension, `LOCATOR_PERMISSIONS` plus an origin check in the content-script resolver), so do not add
|
|
119
|
+
* a path that skips the consumer's gate.
|
|
135
120
|
*/
|
|
136
121
|
type FrameFetchInit = OperationOptions & {
|
|
137
122
|
method?: string;
|
|
@@ -144,16 +129,12 @@ type FrameFetchInit = OperationOptions & {
|
|
|
144
129
|
*/
|
|
145
130
|
credentials?: RequestCredentials;
|
|
146
131
|
};
|
|
147
|
-
/**
|
|
148
|
-
* Deliberately NOT a `Response`. It crosses at least one RPC boundary, and a `Response` rebuilt on the
|
|
149
|
-
* far side with `new Response()` would be a different object with different headers anyway, so the
|
|
150
|
-
* shape says plainly what actually survives.
|
|
151
|
-
*/
|
|
132
|
+
/** Not a `Response`: it crosses at least one RPC boundary, so the shape states what survives. */
|
|
152
133
|
type FrameFetchResult = {
|
|
153
134
|
status: number;
|
|
154
135
|
statusText: string;
|
|
155
136
|
ok: boolean;
|
|
156
|
-
/** Where the response came from
|
|
137
|
+
/** Where the response came from after redirects. */
|
|
157
138
|
url: string;
|
|
158
139
|
redirected: boolean;
|
|
159
140
|
type: ResponseType;
|
|
@@ -364,11 +345,7 @@ type ToOf<M> = M extends {
|
|
|
364
345
|
} ? K : 'element';
|
|
365
346
|
type KindRewrites<R, K extends ChainKind> = K extends keyof R ? (R[K] extends Record<string, ChainRewrite> ? R[K] : {}) : {};
|
|
366
347
|
type ChainOf<M extends Modules, K extends ChainKind, R extends Rewrites> = K extends 'frame' ? FrameLocator$1<M, R> : Locator$1<M, R>;
|
|
367
|
-
/**
|
|
368
|
-
* What `ensure` may carry. An option no gate reads is accepted and ignored rather than refused:
|
|
369
|
-
* `subtree` is the one apps still pass, and the scope it once narrowed is now decided per site by
|
|
370
|
-
* the gate, so passing it changes nothing.
|
|
371
|
-
*/
|
|
348
|
+
/** What `ensure` may carry. An option no gate reads, `subtree` included, is accepted and ignored rather than refused. */
|
|
372
349
|
type EnsureOptions = OperationOptions & Record<string, unknown>;
|
|
373
350
|
type Chain<M extends Modules, K extends ChainKind, R extends Rewrites = {}> = { [N in Exclude<keyof M[K]['selectors'], keyof KindRewrites<R, K>>]: (...args: ArgsOf<M[K]['selectors'][N]>) => ChainOf<M, ToOf<M[K]['selectors'][N]>, R>; } & { [N in keyof M[K]['operations'] as M[K]['operations'][N] extends {
|
|
374
351
|
typed: false;
|
|
@@ -724,17 +701,17 @@ type LocatorRewrites = typeof locatorRewrites;
|
|
|
724
701
|
type PermissionCategory = 'interaction' | 'storage' | 'network' | 'evaluation';
|
|
725
702
|
/**
|
|
726
703
|
* What a category row says. `heading` is the name the popup, dashboard and activity log print;
|
|
727
|
-
* `summary` is
|
|
728
|
-
*
|
|
729
|
-
*
|
|
730
|
-
*
|
|
704
|
+
* `summary` is a one-line account of the category. The row copy is a template over `site` (the host
|
|
705
|
+
* the row consults, or its "first and N more" form). On the cloud card `cloudTitle` is its one short
|
|
706
|
+
* line and `cloudDescription` the line under it where hovering cannot be counted on, its tooltip
|
|
707
|
+
* everywhere else.
|
|
731
708
|
*/
|
|
732
709
|
type CategoryMeta = {
|
|
733
710
|
id: PermissionCategory;
|
|
734
711
|
heading: string;
|
|
735
712
|
summary: string;
|
|
736
713
|
title: (site: string) => string;
|
|
737
|
-
/** `signedIn` is false when the attach
|
|
714
|
+
/** `signedIn` is false only when the attach carried `syncCookies: false`, which only a library that predates `cookies` sends */
|
|
738
715
|
description: (site: string, signedIn: boolean) => string;
|
|
739
716
|
cloudTitle: (site: string) => string;
|
|
740
717
|
cloudDescription: (site: string) => string;
|
|
@@ -1134,9 +1111,8 @@ type Frame = Omit<FrameLocator, 'owner'> & {
|
|
|
1134
1111
|
/**
|
|
1135
1112
|
* Which backend serves this attachment, fixed for its life. The same call can draw a card on one
|
|
1136
1113
|
* backend and not the other, and spends a different identity on each, so an app must be able to
|
|
1137
|
-
* tell.
|
|
1138
|
-
*
|
|
1139
|
-
* backend that names none.
|
|
1114
|
+
* tell. Undefined only for a Frame an app built itself with `createFrame` from a backend that
|
|
1115
|
+
* names none.
|
|
1140
1116
|
*/
|
|
1141
1117
|
backend(): 'cloud' | 'extension' | undefined;
|
|
1142
1118
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as WriteData, i as Stats, n as MakeOptions, o as WriteOptions, r as ReadOptions, t as Callback } from "./index-BQgZVQl7.js";
|
|
2
|
-
import { a as StorageAccountChangedError, b as PinOptions, d as captureAccount$1, g as storage_d_exports, i as SealedRead, o as StorageAccountPinUnsupportedError, p as isAccountChanged, v as FileEntry, x as WriteData$1, y as FileSystem } from "./storage-
|
|
3
|
-
import { c as STORAGE_ACCOUNT_CHANGED, l as STORAGE_ACCOUNT_PIN_UNSUPPORTED } from "./messages-
|
|
2
|
+
import { a as StorageAccountChangedError, b as PinOptions, d as captureAccount$1, g as storage_d_exports, i as SealedRead, o as StorageAccountPinUnsupportedError, p as isAccountChanged, v as FileEntry, x as WriteData$1, y as FileSystem } from "./storage-BLBsmkmp.js";
|
|
3
|
+
import { c as STORAGE_ACCOUNT_CHANGED, l as STORAGE_ACCOUNT_PIN_UNSUPPORTED } from "./messages-d7pvCXPn.js";
|
|
4
4
|
declare namespace hybrid_d_exports {
|
|
5
5
|
export { AdoptSummary, ConflictResolution, ConflictResolver, ConflictSide, FileConflict, FileEntry, FileSystem, WriteData$1 as WriteData, adopt$1 as adopt, adoptable$1 as adoptable, available$1 as available, captureAccount, list, onConflict$1 as onConflict, pending$1 as pending, pendingDeletes$1 as pendingDeletes, pull$1 as pull, readFile$1 as readFile, readFileSealed$1 as readFileSealed, remove, replicating$1 as replicating, writeFile$1 as writeFile };
|
|
6
6
|
}
|
|
@@ -46,15 +46,10 @@ type FileConflict = {
|
|
|
46
46
|
* What should be at that path. Return one side's bytes, or anything else as a merge; null leaves the
|
|
47
47
|
* file alone and the summary reports it unresolved.
|
|
48
48
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* That identity is sound only because the resolver runs in THIS realm: the reads are memoized here,
|
|
54
|
-
* so the object the app holds is the object compared. A value that crosses osra arrives as a
|
|
55
|
-
* different object with equal content, in both directions, which `tests/osra-identity.browser.test.ts`
|
|
56
|
-
* pins against a real channel. So a resolver whose answer ever crossed a realm would simply read as a
|
|
57
|
-
* merge: one redundant write, never a wrong file.
|
|
49
|
+
* Whatever comes back is what wins. Returning the very Blob that `readLocal()` or `readCloud()`
|
|
50
|
+
* handed you is recognised by identity, so picking a side costs one write rather than two. An answer
|
|
51
|
+
* that crossed a realm (osra) arrives as a different object, so it reads as a merge: one redundant
|
|
52
|
+
* write, never a wrong file.
|
|
58
53
|
*/
|
|
59
54
|
type ConflictResolution = WriteData$1 | null;
|
|
60
55
|
type ConflictResolver = (conflict: FileConflict) => Promise<ConflictResolution> | ConflictResolution;
|
package/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as account_d_exports } from "./account.js";
|
|
2
|
-
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, o as AttachFrameOptions, p as FrameBackend, q as createVideoElementHandle, r as AttachFrameFunction, 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-
|
|
3
|
-
import { $ as isLocatorInvalid, A as CookieDetails, B as fetchPermission, C as assertLockdownApplicable, D as modifyRequestHeadersPermission, E as RequestHeaderRule, F as ProxyFetchRequest, G as assertOneCookieIdentity, H as isLocalNetworkUrl, I as assertFetchableUrl, J as LOCATOR_ERROR, K as hasForgedCookie, M as cookies, N as readCookiePermission, O as removeRequestHeaderRule, P as FetchInit, Q as isLocatorDenied, R as fetchCredentialedPermission, S as assertAttachableFrameUrl, T as HeaderOperation, U as FORGEABLE_HEADERS, V as isBlockedFetchUrl, W as assertForgeableHeaders, X as LOCATOR_UNSUPPORTED, Y as LOCATOR_INVALID, Z as TimeoutError, _ as BackgroundStoppedError, b as PermissionDeniedError, c as setMissingExtensionHandler, d as ExtensionHandshake, et as isLocatorUnsupported, f as ExtensionOperationUnsupportedError, g as BACKGROUND_STOPPED, h as supportsOperation, i as promptInstall, j as SiteCookie, k as setRequestHeaderRule, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, n as fetch, o as isExtensionExposed, p as ExtensionOutdatedError, q as LOCATOR_DENIED, s as readExtensionHandshake, t as extension_d_exports, tt as isTerminalError, u as EXTENSION_ABI, v as isBackgroundStopped, w as isBlockedFrameUrl, x as isPermissionDenied, y as PERMISSION_DENIED, z as fetchLocalPermission } from "./extension-
|
|
4
|
-
import { n as cloud_d_exports } from "./cloud-
|
|
2
|
+
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, o as AttachFrameOptions, p as FrameBackend, q as createVideoElementHandle, r as AttachFrameFunction, 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";
|
|
3
|
+
import { $ as isLocatorInvalid, A as CookieDetails, B as fetchPermission, C as assertLockdownApplicable, D as modifyRequestHeadersPermission, E as RequestHeaderRule, F as ProxyFetchRequest, G as assertOneCookieIdentity, H as isLocalNetworkUrl, I as assertFetchableUrl, J as LOCATOR_ERROR, K as hasForgedCookie, M as cookies, N as readCookiePermission, O as removeRequestHeaderRule, P as FetchInit, Q as isLocatorDenied, R as fetchCredentialedPermission, S as assertAttachableFrameUrl, T as HeaderOperation, U as FORGEABLE_HEADERS, V as isBlockedFetchUrl, W as assertForgeableHeaders, X as LOCATOR_UNSUPPORTED, Y as LOCATOR_INVALID, Z as TimeoutError, _ as BackgroundStoppedError, b as PermissionDeniedError, c as setMissingExtensionHandler, d as ExtensionHandshake, et as isLocatorUnsupported, f as ExtensionOperationUnsupportedError, g as BACKGROUND_STOPPED, h as supportsOperation, i as promptInstall, j as SiteCookie, k as setRequestHeaderRule, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, n as fetch, o as isExtensionExposed, p as ExtensionOutdatedError, q as LOCATOR_DENIED, s as readExtensionHandshake, t as extension_d_exports, tt as isTerminalError, u as EXTENSION_ABI, v as isBackgroundStopped, w as isBlockedFrameUrl, x as isPermissionDenied, y as PERMISSION_DENIED, z as fetchLocalPermission } from "./extension-BlEtNAYc.js";
|
|
4
|
+
import { n as cloud_d_exports } from "./cloud-DyOQPyUB.js";
|
|
5
5
|
import { t as dns_d_exports } from "./dns.js";
|
|
6
|
-
import { s as net_d_exports } from "./net-
|
|
6
|
+
import { s as net_d_exports } from "./net-CmMZgV2a.js";
|
|
7
7
|
import { t as dgram_d_exports } from "./dgram.js";
|
|
8
8
|
import { t as http_d_exports } from "./http.js";
|
|
9
9
|
import { t as desktop_d_exports } from "./desktop.js";
|
|
10
|
-
import { u as index_d_exports } from "./index-
|
|
10
|
+
import { u as index_d_exports } from "./index-DKr9L2RI.js";
|
|
11
11
|
import { t as index_d_exports$1 } from "./opfs.js";
|
|
12
12
|
import { t as packages_d_exports } from "./packages.js";
|
|
13
13
|
import { t as rooms_d_exports } from "./rooms.js";
|
|
@@ -31,6 +31,18 @@ import { t as connectButtonUrl } from "./connect-button-Cp0NS95-.js";
|
|
|
31
31
|
export declare const attachFrame: AttachFrameFunction;
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/relay.d.ts
|
|
34
|
+
/**
|
|
35
|
+
* Bridges a worker into the FKN API: once called, the worker can import `@fkn/lib` and use `net` /
|
|
36
|
+
* `dgram` exactly like the main thread. Main thread only.
|
|
37
|
+
*
|
|
38
|
+
* `originA` (default `WEB_ORIGIN`) is the `targetOrigin` for posts to the iframe, `originB` (default
|
|
39
|
+
* `'*'`) the one for posts to the worker, which enforces none. Pass `WEB_ORIGIN` for both only when
|
|
40
|
+
* relaying between two windows on the FKN origin.
|
|
41
|
+
*
|
|
42
|
+
* The page hands its `fkn-api` channel to the worker for good, and its own calls move to
|
|
43
|
+
* `fkn-api-window`. Against a cached FKN page from before that channel, the page's own calls refuse
|
|
44
|
+
* with `OwnChannelUnavailableError` and FKN's UI and account changes stay off here until a reload.
|
|
45
|
+
*/
|
|
34
46
|
export declare const relayWorker: (worker: Worker, options?: {
|
|
35
47
|
unregisterSignal?: AbortSignal;
|
|
36
48
|
originA?: string;
|
|
@@ -47,31 +59,20 @@ declare namespace shell_d_exports {
|
|
|
47
59
|
}
|
|
48
60
|
/**
|
|
49
61
|
* The FKN shell's update surface, for apps that want a say in when the platform frame reloads.
|
|
62
|
+
* Nothing here fires on its own schedule. Two moments:
|
|
50
63
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
64
|
+
* - **READY**, `onUpdate` / `updateReady`: a newer shell is downloaded and nothing has happened. The
|
|
65
|
+
* broker offers it in its own header and `applyUpdate` lets the app offer it too. It is never taken
|
|
66
|
+
* without a person asking, since only the app knows what a reload costs right now. The one
|
|
67
|
+
* exception: a broker frame that finds a newer shell while loading, before answering this page and
|
|
68
|
+
* with no other fkn.app window open, reloads itself first, so nothing of the app is interrupted.
|
|
69
|
+
* - **TAKEN**, `onUpdateTaken`: someone pressed update, here or in another tab, and the new shell
|
|
70
|
+
* controls every page on the origin. Each page now runs a new worker against an old-build document,
|
|
71
|
+
* so the lib RELOADS THE PAGE by default; an app that cannot be interrupted registers a handler.
|
|
53
72
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* a reload costs right now, and a torrent mid-download is the case that matters. The one exception
|
|
58
|
-
* is a broker frame that finds a newer shell as it loads, before it has answered this page at all,
|
|
59
|
-
* while no other fkn.app window is open: it reloads its own frame first, so this page's first
|
|
60
|
-
* connection is simply to the newer shell and nothing of the app is interrupted.
|
|
61
|
-
* - **TAKEN**, `onUpdateTaken`. Someone pressed update, here or in another tab, and the new shell is
|
|
62
|
-
* now in control of every page on the origin. That leaves each one running a new worker against a
|
|
63
|
-
* document from the old build, so the lib RELOADS THE PAGE by default to end the mix. An app that
|
|
64
|
-
* cannot be interrupted registers a handler and decides for itself.
|
|
65
|
-
*
|
|
66
|
-
* A lib-side driver that took a ready update by ITSELF, on an idle-looking page, shipped in 0.9.20
|
|
67
|
-
* to 0.9.22 and was removed. Idleness measured from the app realm cannot see a transfer running in
|
|
68
|
-
* a worker, and the cost of being wrong is someone's download. The default reload above is not that
|
|
69
|
-
* driver returning: it happens only after a person has pressed update, and only to finish what they
|
|
70
|
-
* asked for.
|
|
71
|
-
*
|
|
72
|
-
* The page's connection to a replaced frame is re-established automatically either way, which is
|
|
73
|
-
* what makes the button cheap to press: a call in flight at that moment rejects with a named error
|
|
74
|
-
* rather than hanging.
|
|
73
|
+
* The lib never takes a ready update by itself: idleness seen from the app realm cannot see a
|
|
74
|
+
* transfer running in a worker. The page's connection to a replaced frame is re-established
|
|
75
|
+
* automatically, and a call in flight at that moment rejects with a named error rather than hanging.
|
|
75
76
|
*/
|
|
76
77
|
/** Whether a newer FKN shell is downloaded and ready to apply. */
|
|
77
78
|
declare const updateReady: () => Promise<boolean>;
|
|
@@ -106,17 +107,13 @@ declare const onUpdate: (callback: () => void) => Promise<() => void>;
|
|
|
106
107
|
*/
|
|
107
108
|
declare const onUpdateTaken: (handler: () => void) => (() => void);
|
|
108
109
|
/**
|
|
109
|
-
* What a shell reload would sever right now, as
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
* servers, a streaming proxy response, a mounted package, a live frame attachment, unflushed
|
|
114
|
-
* write-behind. An empty list is not a promise that a reload is free, only that this realm holds
|
|
115
|
-
* nothing the lib knows about, so an app with state of its own should weigh that too.
|
|
110
|
+
* What a shell reload would sever right now, as human-readable reasons, empty when nothing is bound
|
|
111
|
+
* to the broker connection: open sockets and listening servers, a streaming proxy response, a mounted
|
|
112
|
+
* package, a live frame attachment, unflushed write-behind. Empty is not a promise that a reload is
|
|
113
|
+
* free, only that this realm holds nothing the lib knows about.
|
|
116
114
|
*
|
|
117
|
-
* It is per REALM
|
|
118
|
-
*
|
|
119
|
-
* app whose transfers live in a worker should ask the worker, not the page.
|
|
115
|
+
* It is per REALM: a worker that imports `@fkn/lib/net` keeps its own tally, which the window cannot
|
|
116
|
+
* see. An app whose transfers live in a worker should ask the worker, not the page.
|
|
120
117
|
*/
|
|
121
118
|
declare const busyReasons: () => string[];
|
|
122
119
|
/**
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region src/messages.d.ts
|
|
2
|
+
declare const E2E_LOCKED_MESSAGE = "fkn:e2e-locked";
|
|
3
|
+
declare const E2E_STALE_EPOCH_MESSAGE = "fkn:e2e-stale-epoch: this file is encrypted under a previous key you reset";
|
|
4
|
+
declare const E2E_INTEGRITY_MESSAGE = "fkn:e2e-integrity: stored data failed its integrity check";
|
|
5
|
+
/** sealed in an envelope older than v3; distinct from integrity, since the bytes are intact */
|
|
6
|
+
declare const E2E_RETIRED_FORMAT_MESSAGE = "fkn:e2e-retired-format: stored data is in a format this version no longer opens";
|
|
7
|
+
/**
|
|
8
|
+
* The error code for "there is no object at this path", so a caller tests absence instead of parsing
|
|
9
|
+
* a message. osra drops custom codes at the SharedWorker boundary, so storage.ts's rethrow re-mints
|
|
10
|
+
* it from the message on the app side.
|
|
11
|
+
*/
|
|
12
|
+
declare const STORAGE_NOT_FOUND = "FKN_STORAGE_NOT_FOUND";
|
|
13
|
+
/**
|
|
14
|
+
* The error code for "the api never answered". A caller that relaxes anything when the server is
|
|
15
|
+
* unreachable must never relax it on an answered error: an answered 500 lands exactly when a key
|
|
16
|
+
* rotation or a setting flip may be propagating. Across the SharedWorker hop the message prefix is
|
|
17
|
+
* the wire contract, since osra drops the code; same-realm callers can test the code.
|
|
18
|
+
*/
|
|
19
|
+
declare const STORAGE_UNREACHABLE = "FKN_API_UNREACHABLE";
|
|
20
|
+
/**
|
|
21
|
+
* The account pin's refusals, as message prefixes the broker throws. `ACCOUNT_CHANGED_MESSAGE`: the
|
|
22
|
+
* signed-in account is not the one the pin was taken under. `ACCOUNT_PIN_INVALID_MESSAGE`: the api
|
|
23
|
+
* could not read the pin. `ACCOUNT_PIN_UNSUPPORTED_MESSAGE`: a hop (the broker document or its shared
|
|
24
|
+
* worker) predates the pin, so the call was refused rather than sent unpinned. None is a sign-out.
|
|
25
|
+
*/
|
|
26
|
+
declare const ACCOUNT_CHANGED_MESSAGE = "fkn:account-changed";
|
|
27
|
+
declare const ACCOUNT_PIN_INVALID_MESSAGE = "fkn:account-pin-invalid";
|
|
28
|
+
declare const ACCOUNT_PIN_UNSUPPORTED_MESSAGE = "fkn:account-pin-unsupported";
|
|
29
|
+
/** The code of `StorageAccountChangedError`: a call made under one account was refused under another. */
|
|
30
|
+
declare const STORAGE_ACCOUNT_CHANGED = "FKN_ACCOUNT_CHANGED";
|
|
31
|
+
/** The code of `StorageAccountPinUnsupportedError`: the broker cannot pin calls, so none was sent. */
|
|
32
|
+
declare const STORAGE_ACCOUNT_PIN_UNSUPPORTED = "FKN_ACCOUNT_PIN_UNSUPPORTED";
|
|
33
|
+
//#endregion
|
|
34
|
+
export { E2E_LOCKED_MESSAGE as a, STORAGE_ACCOUNT_CHANGED as c, STORAGE_UNREACHABLE as d, E2E_INTEGRITY_MESSAGE as i, STORAGE_ACCOUNT_PIN_UNSUPPORTED as l, ACCOUNT_PIN_INVALID_MESSAGE as n, E2E_RETIRED_FORMAT_MESSAGE as o, ACCOUNT_PIN_UNSUPPORTED_MESSAGE as r, E2E_STALE_EPOCH_MESSAGE as s, ACCOUNT_CHANGED_MESSAGE as t, STORAGE_NOT_FOUND as u };
|
package/messages.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as E2E_LOCKED_MESSAGE, c as STORAGE_ACCOUNT_CHANGED, d as STORAGE_UNREACHABLE, i as E2E_INTEGRITY_MESSAGE, l as STORAGE_ACCOUNT_PIN_UNSUPPORTED, n as ACCOUNT_PIN_INVALID_MESSAGE, o as E2E_RETIRED_FORMAT_MESSAGE, r as ACCOUNT_PIN_UNSUPPORTED_MESSAGE, s as E2E_STALE_EPOCH_MESSAGE, t as ACCOUNT_CHANGED_MESSAGE, u as STORAGE_NOT_FOUND } from "./messages-
|
|
1
|
+
import { a as E2E_LOCKED_MESSAGE, c as STORAGE_ACCOUNT_CHANGED, d as STORAGE_UNREACHABLE, i as E2E_INTEGRITY_MESSAGE, l as STORAGE_ACCOUNT_PIN_UNSUPPORTED, n as ACCOUNT_PIN_INVALID_MESSAGE, o as E2E_RETIRED_FORMAT_MESSAGE, r as ACCOUNT_PIN_UNSUPPORTED_MESSAGE, s as E2E_STALE_EPOCH_MESSAGE, t as ACCOUNT_CHANGED_MESSAGE, u as STORAGE_NOT_FOUND } from "./messages-d7pvCXPn.js";
|
|
2
2
|
export { ACCOUNT_CHANGED_MESSAGE, ACCOUNT_PIN_INVALID_MESSAGE, ACCOUNT_PIN_UNSUPPORTED_MESSAGE, E2E_INTEGRITY_MESSAGE, E2E_LOCKED_MESSAGE, E2E_RETIRED_FORMAT_MESSAGE, E2E_STALE_EPOCH_MESSAGE, STORAGE_ACCOUNT_CHANGED, STORAGE_ACCOUNT_PIN_UNSUPPORTED, STORAGE_NOT_FOUND, STORAGE_UNREACHABLE };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Ct as TcpSocketListenerResult, K as Resolvers, Tt as TcpSocketResult } from "./contract-
|
|
2
|
-
import { o as TcpSocketOption } from "./wire-
|
|
3
|
-
import "./api-
|
|
1
|
+
import { Ct as TcpSocketListenerResult, K as Resolvers, Tt as TcpSocketResult } from "./contract-6Xfd_qel.js";
|
|
2
|
+
import { o as TcpSocketOption } from "./wire-BwA4JjZH.js";
|
|
3
|
+
import "./api-CFkZVr53.js";
|
|
4
4
|
import { AddressInfo, ListenOptions, Server, ServerOpts, Socket, SocketConnectOpts, SocketConstructorOpts } from "net";
|
|
5
5
|
import { DuplexOptions, Stream } from "stream";
|
|
6
6
|
import { EventEmitter } from "events";
|
|
@@ -32,19 +32,6 @@ declare class Socket$2 extends Stream.Duplex implements Socket {
|
|
|
32
32
|
constructor(options?: SocketConstructorOpts & DuplexOptions & {
|
|
33
33
|
connection?: ReturnType<WebVpnTcpSocket>;
|
|
34
34
|
});
|
|
35
|
-
/**
|
|
36
|
-
* `endpoints` publishes the four addresses SYNCHRONOUSLY, for a socket whose connection is
|
|
37
|
-
* already in hand.
|
|
38
|
-
*
|
|
39
|
-
* Node fills an accepted socket's endpoints in before it emits 'connection', and consumers read
|
|
40
|
-
* them right there in the handler. Without this the values only land in the `.then()` below, one
|
|
41
|
-
* microtask after the emit, and until then every address getter on this class THROWS
|
|
42
|
-
* `Socket is not connected` rather than answering undefined, so a caller reading them the way
|
|
43
|
-
* Node allows gets an exception and, if it wrapped all four in one try block, loses every one of
|
|
44
|
-
* them. libtorrent-wasm's socket shim does exactly that on accept, and libtorrent drops a peer it
|
|
45
|
-
* cannot name with no alert and no reply, which reads from outside as the relay never delivering
|
|
46
|
-
* the connection at all.
|
|
47
|
-
*/
|
|
48
35
|
_busyRelease?: () => void;
|
|
49
36
|
__webvpn_tcp_socket_init__(connection: ReturnType<WebVpnTcpSocket>, endpoints?: Awaited<ReturnType<WebVpnTcpSocket>>): Promise<(TcpSocketResult & {
|
|
50
37
|
reader: ReadableStreamDefaultReader<Uint8Array>;
|
|
@@ -95,9 +82,6 @@ declare class Socket$2 extends Stream.Duplex implements Socket {
|
|
|
95
82
|
timeout?: number | undefined;
|
|
96
83
|
}
|
|
97
84
|
interface EventEmitterOptions {
|
|
98
|
-
/**
|
|
99
|
-
* Enables automatic capturing of promise rejection.
|
|
100
|
-
*/
|
|
101
85
|
captureRejections?: boolean | undefined;
|
|
102
86
|
}
|
|
103
87
|
declare class Server$1 extends EventEmitter implements Server {
|
package/net.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createConnection, c as isIP, i as connect, l as isIPv4, n as Socket, o as createServer, r as _default, t as Server, u as isIPv6 } from "./net-
|
|
1
|
+
import { a as createConnection, c as isIP, i as connect, l as isIPv4, n as Socket, o as createServer, r as _default, t as Server, u as isIPv6 } from "./net-CmMZgV2a.js";
|
|
2
2
|
export { Server, Socket, _default, _default as default, connect, createConnection, createServer, isIP, isIPv4, isIPv6 };
|
package/package.json
CHANGED
package/packages.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as InstalledPackage, F as PackageResult, G as Radii, I as PackagesErrorCode, P as PackageQuery, R as PickOptions, T as InstallOptions, m as ConnectOptions, xt as SurfaceRect, z as Placement } from "./contract-
|
|
1
|
+
import { E as InstalledPackage, F as PackageResult, G as Radii, I as PackagesErrorCode, P as PackageQuery, R as PickOptions, T as InstallOptions, m as ConnectOptions, xt as SurfaceRect, z as Placement } from "./contract-6Xfd_qel.js";
|
|
2
2
|
import { Remote } from "osra";
|
|
3
3
|
declare namespace packages_d_exports {
|
|
4
4
|
export { AppConnectOptions, Connect, ConnectOptions, ConnectPayload, IncomingConnection, IncomingConnectionInfo, InstallOptions, InstalledPackage, MountOptions, MountedPackage, PackageConnection, PackageQuery, PackageResult, PackageView, PackagesError, PackagesErrorCode, PickOptions, Placement, Radii, RawPackageConnection, ShowOptions, SurfaceRect, attach, connect, hide, install, isVisible, list, mount, onConnect, onVisibilityChange, pick, search, show, uninstall };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { K as Resolvers } from "./contract-
|
|
2
|
-
import "./api-
|
|
1
|
+
import { K as Resolvers } from "./contract-6Xfd_qel.js";
|
|
2
|
+
import "./api-CFkZVr53.js";
|
|
3
3
|
//#region src/proxy.d.ts
|
|
4
4
|
type ProxyFetch = Resolvers['cloud']['fetch'];
|
|
5
5
|
type FetchParameters = Parameters<ProxyFetch>;
|