@fkn/lib 0.9.24 → 0.9.25

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.
Files changed (121) hide show
  1. package/account.cjs +1 -1
  2. package/account.d.ts +7 -3
  3. package/account.js +7 -7
  4. package/api-BCJO3EWi.cjs +3 -0
  5. package/api-CesI0aMl.d.ts +677 -0
  6. package/{api-Jq4OSTp1.js → api-DLvscoll.js} +99 -96
  7. package/api.cjs +1 -0
  8. package/api.d.ts +3 -0
  9. package/api.js +2 -0
  10. package/attach-policy.cjs +1 -0
  11. package/attach-policy.d.ts +35 -0
  12. package/attach-policy.js +43 -0
  13. package/{busy-Bp1E3JPT.js → busy-B189uX--.js} +1 -1
  14. package/cloud/dgram.cjs +1 -1
  15. package/cloud/dgram.js +2 -2
  16. package/cloud/dns.d.ts +1 -1
  17. package/cloud/fetch.cjs +1 -1
  18. package/cloud/fetch.d.ts +1 -1
  19. package/cloud/fetch.js +1 -1
  20. package/cloud/fs/promises.d.ts +7 -6
  21. package/cloud/fs/promises.js +1 -1
  22. package/cloud/fs.cjs +1 -1
  23. package/cloud/fs.d.ts +3 -3
  24. package/cloud/fs.js +10 -9
  25. package/cloud/net.cjs +1 -1
  26. package/cloud/net.d.ts +1 -1
  27. package/cloud/net.js +3 -3
  28. package/cloud-B2ZG-0MF.cjs +1 -0
  29. package/cloud-B7pI3pp1.d.ts +37 -0
  30. package/{cloud-7rfQ2BRH.js → cloud-DolBoNvR.js} +59 -97
  31. package/cloud.cjs +1 -1
  32. package/cloud.d.ts +4 -4
  33. package/cloud.js +4 -4
  34. package/{connect-button-Ds9KpXHe.js → connect-button-CN4ZJwT6.js} +1 -1
  35. package/{connect-button-D8KXSL6s.d.ts → connect-button-DdoEikEd.d.ts} +1 -1
  36. package/contract-D6ksmIm6.d.ts +394 -0
  37. package/contract.cjs +0 -0
  38. package/contract.d.ts +3 -0
  39. package/contract.js +0 -0
  40. package/desktop.js +1 -1
  41. package/dgram.cjs +1 -1
  42. package/dgram.d.ts +6 -47
  43. package/dgram.js +406 -2
  44. package/dns.cjs +1 -1
  45. package/dns.d.ts +1 -3
  46. package/dns.js +2 -2
  47. package/extension-CJUeVRXf.d.ts +361 -0
  48. package/extension-DBazc3ff.cjs +1 -0
  49. package/extension-Dw9gzvei.js +84 -0
  50. package/extension.cjs +1 -1
  51. package/extension.d.ts +3 -3
  52. package/extension.js +3 -3
  53. package/fs/promises.cjs +1 -1
  54. package/fs/promises.d.ts +8 -9
  55. package/fs/promises.js +2 -2
  56. package/fs-DYP7utdw.cjs +1 -0
  57. package/{fs-CUmugp10.d.ts → fs-DlGE0ZNu.d.ts} +20 -21
  58. package/{fs-pOQSZfuf.js → fs-d2ANVBkm.js} +8 -8
  59. package/fs.cjs +1 -1
  60. package/fs.d.ts +2 -2
  61. package/fs.js +1 -1
  62. package/http.cjs +3 -3
  63. package/http.d.ts +4 -6
  64. package/http.js +8 -8
  65. package/{index-CJ0vHTcS.d.ts → index-BQgZVQl7.d.ts} +4 -7
  66. package/{index-DY8WjklJ.d.ts → index-BhO-wymH.d.ts} +15 -293
  67. package/{index-BIZeEsNu.d.ts → index-CGJTVju4.d.ts} +52 -46
  68. package/index.cjs +1 -1
  69. package/index.d.ts +12 -13
  70. package/index.js +61 -59
  71. package/lib-DLM2M3_i.cjs +53 -0
  72. package/{lib-k3lstfa4.js → lib-duLPF_WZ.js} +328 -277
  73. package/messages-DvpKMTsY.d.ts +28 -0
  74. package/messages.cjs +1 -0
  75. package/messages.d.ts +2 -0
  76. package/messages.js +4 -0
  77. package/{net-DaWv81tQ.d.ts → net-DAOcF3Eb.d.ts} +12 -16
  78. package/net.cjs +1 -1
  79. package/net.d.ts +1 -1
  80. package/net.js +318 -3
  81. package/{node-fs-BZCQUmeE.js → node-fs-C9ECR_9H.js} +2 -2
  82. package/opfs/promises.d.ts +7 -8
  83. package/opfs/promises.js +1 -1
  84. package/{opfs-BibrNGF0.js → opfs-D0goLAQW.js} +1 -1
  85. package/opfs.d.ts +24 -26
  86. package/opfs.js +3 -3
  87. package/package.json +27 -2
  88. package/packages.cjs +1 -1
  89. package/packages.d.ts +143 -2
  90. package/packages.js +15 -15
  91. package/{proxy-DmMu2_1z.d.ts → proxy-BubvP9sg.d.ts} +3 -3
  92. package/{proxy-BNdvRifw.cjs → proxy-CefKCs-i.cjs} +1 -1
  93. package/{proxy-CRbkWS4E.js → proxy-KUfE4cEQ.js} +3 -3
  94. package/react.d.ts +3 -7
  95. package/react.js +2 -2
  96. package/{storage-BNjLc1FV.js → storage-BjGr_vC4.js} +5 -5
  97. package/storage-DLB4ciMf.cjs +1 -0
  98. package/utils-BvgGdrgN.cjs +1 -0
  99. package/{utils-DVlbuXmW.js → utils-C-cAd4r4.js} +2 -3
  100. package/wire-Gbo-D74t.d.ts +91 -0
  101. package/wire.cjs +1 -0
  102. package/wire.d.ts +2 -0
  103. package/wire.js +4 -0
  104. package/api-BGYSJVvR.d.ts +0 -789
  105. package/api-C-TpWHAU.cjs +0 -3
  106. package/cloud-BqjwL5KM.cjs +0 -1
  107. package/cloud-DMTkzfcf.d.ts +0 -36
  108. package/dgram-BLN-mfgq.cjs +0 -1
  109. package/dgram-DHQcHefn.js +0 -405
  110. package/extension-B8Y0sUwC.js +0 -78
  111. package/extension-CMPZjuaV.d.ts +0 -16
  112. package/extension-CgSGjcSl.cjs +0 -1
  113. package/fs-BNnozBMU.cjs +0 -1
  114. package/lib-DbiVHPXE.cjs +0 -53
  115. package/lookup-BtwWaCZJ.d.ts +0 -7
  116. package/net-B6RHtWwe.cjs +0 -1
  117. package/net-yBkobZqK.js +0 -317
  118. package/packages-Cn8S-Hkn.d.ts +0 -217
  119. package/storage-qxXFLgTM.d.ts +0 -44
  120. package/storage-xAeRQQiz.cjs +0 -1
  121. package/utils-QfNXtEhb.cjs +0 -1
@@ -0,0 +1,361 @@
1
+ import { C as OperationRequest, S as GateTools, _ as isType, a as FrameBackend, b as Executor, c as attachFramePermission, d as handleRevivableModules, f as BoxedVideoElement, g as createVideoElementHandle, h as box, i as Frame, l as createFrame, m as VideoElementState, n as attachFrame, o as GotoOptions, p as RemoteVideoElement, r as AttachFrameOptions, s as Locator, t as ATTACH_FRAME_EVENT_KEY, u as gotoPermission, v as revive, w as SelectorPart, x as Gate, y as type } from "./index-BhO-wymH.js";
2
+ //#region ../web-extension/lib/lib/forgeable-headers.d.ts
3
+ declare const FORGEABLE_HEADERS: string[];
4
+ declare const hasForgedCookie: (unsafeHeaders: [string, string][] | undefined) => boolean;
5
+ declare const assertOneCookieIdentity: (unsafeHeaders: [string, string][] | undefined, credentials: 'include' | 'omit') => void;
6
+ declare const assertForgeableHeaders: (unsafeHeaders: [string, string][] | undefined) => void;
7
+ //#endregion
8
+ //#region ../web-extension/lib/lib/fetch.d.ts
9
+ declare const fetchPermission: {
10
+ readonly scope: 'network.fetch';
11
+ readonly category: 'network';
12
+ readonly severity: 0;
13
+ readonly title: 'Fetch data from other sites';
14
+ readonly description: 'Lets the app download public data from other websites directly, past the usual cross-origin limits.';
15
+ };
16
+ declare const fetchCredentialedPermission: {
17
+ readonly scope: 'network.fetchCredentialed';
18
+ readonly category: 'network';
19
+ readonly severity: 3;
20
+ readonly unsafe: true;
21
+ readonly title: 'Fetch from other sites, signed in as you';
22
+ readonly description: 'Lets the app fetch other sites using your logged-in session cookies, so it can read data only you should see.';
23
+ };
24
+ declare const fetchLocalPermission: {
25
+ readonly scope: 'network.fetchLocal';
26
+ readonly category: 'network';
27
+ readonly severity: 3;
28
+ readonly unsafe: true;
29
+ readonly title: 'Access devices on your local network';
30
+ readonly description: 'Lets the app reach devices and services on your home or work network, which websites normally cannot touch.';
31
+ };
32
+ declare const isLocalNetworkUrl: (raw: string) => boolean;
33
+ type ProxyFetchRequest = {
34
+ url: string;
35
+ method: string;
36
+ headers: [string, string][];
37
+ body: ArrayBuffer | null;
38
+ credentials: 'include' | 'omit';
39
+ redirect: RequestRedirect;
40
+ unsafeHeaders?: [string, string][];
41
+ reason?: string;
42
+ signal?: AbortSignal;
43
+ };
44
+ type FetchInit = RequestInit & {
45
+ reason?: string;
46
+ };
47
+ declare const isBlockedFetchUrl: (raw: string) => boolean;
48
+ declare const assertFetchableUrl: (raw: string) => void;
49
+ declare const fetch$1: (input: RequestInfo | URL, init?: FetchInit) => Promise<Response>;
50
+ //#endregion
51
+ //#region ../web-extension/lib/lib/cookies.d.ts
52
+ declare const readCookiePermission: {
53
+ readonly scope: 'network.readCookie';
54
+ readonly category: 'network';
55
+ readonly severity: 3;
56
+ readonly unsafe: true;
57
+ readonly title: 'Read a site’s cookie';
58
+ readonly description: 'Lets the app read a named cookie from another site, which can include the login token only that site should see.';
59
+ };
60
+ type CookieDetails = {
61
+ url: string;
62
+ name: string;
63
+ };
64
+ type SiteCookie = {
65
+ name: string;
66
+ value: string;
67
+ };
68
+ declare const cookies: {
69
+ get: (details: CookieDetails) => Promise<SiteCookie | null>;
70
+ };
71
+ //#endregion
72
+ //#region ../web-extension/lib/lib/request-rules.d.ts
73
+ declare const modifyRequestHeadersPermission: {
74
+ readonly scope: 'network.modifyRequestHeaders';
75
+ readonly category: 'network';
76
+ readonly severity: 2;
77
+ readonly unsafe: true;
78
+ readonly title: 'Rewrite request headers to other sites';
79
+ readonly description: 'Lets the app set or remove headers (like Origin and Referer) on this page’s own requests to the listed sites.';
80
+ };
81
+ type HeaderOperation = {
82
+ header: string;
83
+ operation: 'set' | 'remove';
84
+ value?: string;
85
+ };
86
+ type RequestHeaderRule = {
87
+ domains: string[];
88
+ requestHeaders: HeaderOperation[];
89
+ reason?: string;
90
+ };
91
+ declare const setRequestHeaderRule: (rule: RequestHeaderRule) => Promise<{
92
+ ruleId: number;
93
+ }>;
94
+ declare const removeRequestHeaderRule: (ruleId: number) => Promise<void>;
95
+ //#endregion
96
+ //#region ../frame-locator/lib/errors.d.ts
97
+ declare const LOCATOR_ERROR = "LocatorError";
98
+ declare const LOCATOR_UNSUPPORTED = "LocatorUnsupportedError";
99
+ declare const LOCATOR_DENIED = "LocatorDeniedError";
100
+ declare const isLocatorUnsupported: (error: unknown) => boolean;
101
+ declare const isLocatorDenied: (error: unknown) => boolean;
102
+ declare const isTerminalError: (error: unknown) => boolean;
103
+ //#endregion
104
+ //#region ../web-extension/lib/lib/frame-url.d.ts
105
+ declare const isBlockedFrameUrl: (raw: string) => boolean;
106
+ declare const assertAttachableFrameUrl: (raw: string) => void;
107
+ declare const assertLockdownApplicable: ({ src, domains, lockdown }: {
108
+ src: string;
109
+ domains: string[];
110
+ lockdown: boolean;
111
+ }) => void;
112
+ //#endregion
113
+ //#region ../web-extension/lib/permission/shared/registry.d.ts
114
+ declare const PERMISSIONS: readonly [{
115
+ readonly scope: 'read.text';
116
+ readonly category: 'read';
117
+ readonly severity: 1;
118
+ readonly title: 'Read text from the page';
119
+ readonly description: 'Lets the app see the text shown on this page.';
120
+ }, {
121
+ readonly scope: 'read.info';
122
+ readonly category: 'read';
123
+ readonly severity: 1;
124
+ readonly title: 'Read info from the page';
125
+ readonly description: 'Lets the app read the href value from a part of the page.';
126
+ }, {
127
+ readonly scope: 'read.visible';
128
+ readonly category: 'read';
129
+ readonly severity: 0;
130
+ readonly title: 'See what’s visible on the page';
131
+ readonly description: 'Lets the app check which elements are currently on screen.';
132
+ }, {
133
+ readonly scope: 'read.check';
134
+ readonly category: 'read';
135
+ readonly severity: 0;
136
+ readonly title: 'Check if something is on the page';
137
+ readonly description: 'Lets the app test whether a specific element exists.';
138
+ }, {
139
+ readonly scope: 'read.count';
140
+ readonly category: 'read';
141
+ readonly severity: 0;
142
+ readonly title: 'Count items on the page';
143
+ readonly description: 'Lets the app count how many matching elements are present.';
144
+ }, {
145
+ readonly scope: 'act.click';
146
+ readonly category: 'act';
147
+ readonly severity: 3;
148
+ readonly title: 'Click on the page';
149
+ readonly description: 'Lets the app press buttons or links for you.';
150
+ }, {
151
+ readonly scope: 'act.type';
152
+ readonly category: 'act';
153
+ readonly severity: 1;
154
+ readonly title: 'Type into a text field';
155
+ readonly description: 'Lets the app fill in form fields on your behalf.';
156
+ }, {
157
+ readonly scope: 'act.hover';
158
+ readonly category: 'act';
159
+ readonly severity: 1;
160
+ readonly title: 'Hover over the page';
161
+ readonly description: 'Lets the app point at things to reveal menus or tooltips.';
162
+ }, {
163
+ readonly scope: 'media.video';
164
+ readonly category: 'media';
165
+ readonly severity: 0;
166
+ readonly title: 'Control video playback';
167
+ readonly description: 'Lets the app play, pause, seek, and read the video on the page.';
168
+ }, {
169
+ readonly scope: 'media.appear';
170
+ readonly category: 'media';
171
+ readonly severity: 0;
172
+ readonly title: 'Change page appearance';
173
+ readonly description: 'Lets the app restyle parts of the page (safely filtered).';
174
+ }, {
175
+ readonly scope: 'media.appearU';
176
+ readonly category: 'media';
177
+ readonly severity: 2;
178
+ readonly unsafe: true;
179
+ readonly title: 'Change page appearance (unsafe)';
180
+ readonly description: 'Lets the app restyle the page WITHOUT safety filtering. Could be used to leak data over the network.';
181
+ }, {
182
+ readonly scope: 'embed.iframe';
183
+ readonly category: 'embed';
184
+ readonly severity: 0;
185
+ readonly title: 'Load another website inside this app';
186
+ readonly description: 'Lets the app embed external pages directly inside its own view.';
187
+ }, {
188
+ readonly scope: 'embed.open';
189
+ readonly category: 'embed';
190
+ readonly severity: 0;
191
+ readonly title: 'Open a website inside this app';
192
+ readonly description: 'Lets the app navigate to another site without leaving its window.';
193
+ }, {
194
+ readonly scope: 'frame.fetchRead';
195
+ readonly category: 'network';
196
+ readonly severity: 3;
197
+ readonly unsafe: true;
198
+ readonly title: 'Read your account data on this site';
199
+ readonly description: 'Lets the app read pages and data from this site as you, using the session in the frame.';
200
+ }, {
201
+ readonly scope: 'frame.fetchWrite';
202
+ readonly category: 'network';
203
+ readonly severity: 3;
204
+ readonly unsafe: true;
205
+ readonly title: 'Change your account data on this site';
206
+ readonly description: 'Lets the app send changes to this site as you, using the session in the frame.';
207
+ }, {
208
+ readonly scope: 'network.fetch';
209
+ readonly category: 'network';
210
+ readonly severity: 0;
211
+ readonly title: 'Fetch data from other sites';
212
+ readonly description: 'Lets the app download public data from other websites directly, past the usual cross-origin limits.';
213
+ }, {
214
+ readonly scope: 'network.fetchCredentialed';
215
+ readonly category: 'network';
216
+ readonly severity: 3;
217
+ readonly unsafe: true;
218
+ readonly title: 'Fetch from other sites, signed in as you';
219
+ readonly description: 'Lets the app fetch other sites using your logged-in session cookies, so it can read data only you should see.';
220
+ }, {
221
+ readonly scope: 'network.fetchLocal';
222
+ readonly category: 'network';
223
+ readonly severity: 3;
224
+ readonly unsafe: true;
225
+ readonly title: 'Access devices on your local network';
226
+ readonly description: 'Lets the app reach devices and services on your home or work network, which websites normally cannot touch.';
227
+ }, {
228
+ readonly scope: 'network.readCookie';
229
+ readonly category: 'network';
230
+ readonly severity: 3;
231
+ readonly unsafe: true;
232
+ readonly title: 'Read a site’s cookie';
233
+ readonly description: 'Lets the app read a named cookie from another site, which can include the login token only that site should see.';
234
+ }, {
235
+ readonly scope: 'network.modifyRequestHeaders';
236
+ readonly category: 'network';
237
+ readonly severity: 2;
238
+ readonly unsafe: true;
239
+ readonly title: 'Rewrite request headers to other sites';
240
+ readonly description: 'Lets the app set or remove headers (like Origin and Referer) on this page’s own requests to the listed sites.';
241
+ }];
242
+ type PermissionScope = (typeof PERMISSIONS)[number]['scope'];
243
+ //#endregion
244
+ //#region ../web-extension/lib/lib/permissions.d.ts
245
+ type PermissionRequest = {
246
+ key: PermissionScope;
247
+ scope?: string;
248
+ reason?: string;
249
+ };
250
+ type PermissionGrant = {
251
+ key: PermissionScope;
252
+ scope: string;
253
+ allow: boolean;
254
+ };
255
+ declare const permissions: {
256
+ request: (requests: PermissionRequest[]) => Promise<PermissionGrant[]>;
257
+ };
258
+ //#endregion
259
+ //#region ../web-extension/lib/utils/extension-abi.d.ts
260
+ /**
261
+ * What the extension half announces about itself. Increment when the callable surface CHANGES in a
262
+ * way a page could notice: an operation added, removed, renamed, or given different semantics.
263
+ *
264
+ * This is not the package version and not the manifest version. Those move for reasons that have
265
+ * nothing to do with the protocol (a dependency bump, a store resubmission), and tying the contract
266
+ * to them would make every release look like a protocol change.
267
+ */
268
+ declare const EXTENSION_ABI = 1;
269
+ /**
270
+ * The oldest extension the page half will talk to. Raise it ONLY when the page half starts depending
271
+ * on something older extensions cannot do, never merely because `EXTENSION_ABI` moved: an added
272
+ * operation does not break a page that does not call it.
273
+ *
274
+ * Deliberately 0 for this release. Every extension currently installed predates versioning and
275
+ * announces no ABI at all, so a floor of 1 would refuse all of them the moment this page half
276
+ * deployed, which is precisely the failure this file exists to prevent.
277
+ */
278
+ declare const REQUIRED_EXTENSION_ABI = 0;
279
+ /**
280
+ * Three answers, never a boolean.
281
+ *
282
+ * `operations` is `null` when the extension announced no list, which is NOT the same as announcing an
283
+ * empty one. A pre-versioning extension supports the whole original surface and simply cannot say so,
284
+ * so an absent list has to read as "unknown, assume the old set" rather than "supports nothing".
285
+ * Reading it the other way would refuse every operation on every currently installed extension.
286
+ */
287
+ type ExtensionHandshake = {
288
+ status: 'absent';
289
+ } | {
290
+ status: 'ok';
291
+ abi: number;
292
+ operations: readonly string[] | null;
293
+ } | {
294
+ status: 'outdated';
295
+ abi: number;
296
+ required: number;
297
+ operations: readonly string[] | null;
298
+ };
299
+ /**
300
+ * Whether a named operation is callable.
301
+ *
302
+ * `null` operations means the extension could not tell us, and the answer is YES: it predates the
303
+ * ops list and supports the original surface. The ABI floor is the mechanism for refusing an
304
+ * extension that is genuinely too old; this one only refines a list that was actually announced.
305
+ */
306
+ declare const supportsOperation: (handshake: ExtensionHandshake, operation: string) => boolean;
307
+ /**
308
+ * Thrown instead of the generic "not installed" message when the extension IS there and merely too
309
+ * old. Carries both numbers so an app can say which, and link its listing.
310
+ *
311
+ * A named class rather than a message match: only the name survives a structured-clone hop, and the
312
+ * codebase has been bitten before by an error whose identity was its text.
313
+ */
314
+ declare class ExtensionOutdatedError extends Error {
315
+ readonly abi: number;
316
+ readonly required: number;
317
+ readonly name = "ExtensionOutdatedError";
318
+ constructor(abi: number, required: number);
319
+ }
320
+ /** Thrown when the extension is current but does not serve the operation being asked for. */
321
+ declare class ExtensionOperationUnsupportedError extends Error {
322
+ readonly operation: string;
323
+ readonly abi: number;
324
+ readonly name = "ExtensionOperationUnsupportedError";
325
+ constructor(operation: string, abi: number);
326
+ }
327
+ //#endregion
328
+ //#region ../web-extension/lib/utils/extension.d.ts
329
+ type ExtensionEventMap = {
330
+ statuschange: CustomEvent<{
331
+ enabled: boolean;
332
+ }>;
333
+ };
334
+ declare const extension: import("osra").TypedEventTarget<ExtensionEventMap>;
335
+ /**
336
+ * Unchanged on purpose, and still exported: a page half built before versioning calls exactly this,
337
+ * and an extension that announces an ABI must keep answering it the same way. Backwards
338
+ * compatibility here runs in BOTH directions, which is the only property that matters when neither
339
+ * end updates on demand.
340
+ */
341
+ declare const isExtensionExposed: () => boolean;
342
+ /** The three-way answer: absent, present but too old, or usable. */
343
+ declare const readExtensionHandshake: () => ExtensionHandshake;
344
+ type MissingExtensionHandler = () => Promise<void>;
345
+ declare const setMissingExtensionHandler: (handler: MissingExtensionHandler | null) => void;
346
+ declare const waitForExtensionExposure: (timeout?: number) => Promise<void>;
347
+ //#endregion
348
+ //#region src/extension-prompt.d.ts
349
+ declare const promptInstall: (reason?: string) => Promise<boolean>;
350
+ //#endregion
351
+ //#region src/auto.d.ts
352
+ declare const isExtensionAvailable: () => boolean;
353
+ declare const fetch: (input: RequestInfo | URL, init?: RequestInit & {
354
+ reason?: string;
355
+ render?: boolean;
356
+ }) => Promise<Response>;
357
+ declare namespace extension_d_exports {
358
+ export { ATTACH_FRAME_EVENT_KEY, AttachFrameOptions, BoxedVideoElement, CookieDetails, EXTENSION_ABI, Executor, ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, Gate, GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_UNSUPPORTED, Locator, OperationRequest, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, SelectorPart, SiteCookie, VideoElementState, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFrame, attachFramePermission, isExtensionAvailable as available, box, cookies, createFrame, createVideoElementHandle, extension as events, extension, fetch$1 as fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, gotoPermission, handleRevivableModules, hasForgedCookie, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorUnsupported, isTerminalError, isType, modifyRequestHeadersPermission, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, setMissingExtensionHandler, setRequestHeaderRule, supportsOperation, type, waitForExtensionExposure };
359
+ }
360
+ //#endregion
361
+ export { modifyRequestHeadersPermission as A, fetch$1 as B, LOCATOR_ERROR as C, isTerminalError as D, isLocatorUnsupported as E, cookies as F, isLocalNetworkUrl as G, fetchLocalPermission as H, readCookiePermission as I, assertOneCookieIdentity as J, FORGEABLE_HEADERS as K, FetchInit as L, setRequestHeaderRule as M, CookieDetails as N, HeaderOperation as O, SiteCookie as P, ProxyFetchRequest as R, LOCATOR_DENIED as S, isLocatorDenied as T, fetchPermission as U, fetchCredentialedPermission as V, isBlockedFetchUrl as W, hasForgedCookie as Y, PermissionRequest as _, extension as a, assertLockdownApplicable as b, setMissingExtensionHandler as c, ExtensionHandshake as d, ExtensionOperationUnsupportedError as f, PermissionGrant as g, supportsOperation as h, promptInstall as i, removeRequestHeaderRule as j, RequestHeaderRule as k, waitForExtensionExposure as l, REQUIRED_EXTENSION_ABI as m, fetch as n, isExtensionExposed as o, ExtensionOutdatedError as p, assertForgeableHeaders as q, isExtensionAvailable as r, readExtensionHandshake as s, extension_d_exports as t, EXTENSION_ABI as u, permissions as v, LOCATOR_UNSUPPORTED as w, isBlockedFrameUrl as x, assertAttachableFrameUrl as y, assertFetchableUrl as z };
@@ -0,0 +1 @@
1
+ const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-DLM2M3_i.cjs"),n=require("./api-BCJO3EWi.cjs"),r=require("./proxy-CefKCs-i.cjs"),i=require("./desktop.cjs");var a=async e=>{if(typeof window>`u`)return!1;if(t.F())return!0;let r=await n.a,i=null,a=new Promise(e=>{i=()=>{t.F()&&e(!0)},t.P.addEventListener(`statuschange`,i)}),o=r.installPrompt.show(e).then(()=>!1),s=await Promise.race([a,o]);return i&&t.P.removeEventListener(`statuschange`,i),await r.installPrompt.hide().catch(()=>{}),s},o=null;t.L(()=>(o||=a().then(()=>void 0).finally(()=>{o=null}),o));var s=()=>typeof document<`u`&&t.F(),c=async(e,n)=>{if(r.n(e),n?.credentials===`include`){if(typeof document>`u`)throw Error(`fetch with credentials needs the FKN extension, which only exists in window realms`);return t.w(e,n)}return s()?t.w(e,{...n,credentials:`omit`}):i.available()?i.fetch(e,n):r.t(e,n)},l=e.t({ATTACH_FRAME_EVENT_KEY:()=>t.n,EXTENSION_ABI:()=>1,ExtensionOperationUnsupportedError:()=>t.B,ExtensionOutdatedError:()=>t.V,FORGEABLE_HEADERS:()=>t.A,LOCATOR_DENIED:()=>t.p,LOCATOR_ERROR:()=>t.g,LOCATOR_UNSUPPORTED:()=>t.u,REQUIRED_EXTENSION_ABI:()=>0,assertAttachableFrameUrl:()=>t.s,assertFetchableUrl:()=>t.C,assertForgeableHeaders:()=>t.j,assertLockdownApplicable:()=>t.c,assertOneCookieIdentity:()=>t.M,attachFrame:()=>t.r,attachFramePermission:()=>t.i,available:()=>s,box:()=>t.G,cookies:()=>t.x,createFrame:()=>t.a,createVideoElementHandle:()=>t.K,events:()=>t.P,extension:()=>t.P,fetch:()=>t.w,fetchCredentialedPermission:()=>t.T,fetchLocalPermission:()=>t.E,fetchPermission:()=>t.D,gotoPermission:()=>t.o,handleRevivableModules:()=>t.W,hasForgedCookie:()=>t.N,isBlockedFetchUrl:()=>t.O,isBlockedFrameUrl:()=>t.l,isExtensionExposed:()=>t.F,isLocalNetworkUrl:()=>t.k,isLocatorDenied:()=>t.h,isLocatorUnsupported:()=>t._,isTerminalError:()=>t.f,isType:()=>t.q,modifyRequestHeadersPermission:()=>t.v,permissions:()=>t.t,promptInstall:()=>a,readCookiePermission:()=>t.S,readExtensionHandshake:()=>t.I,removeRequestHeaderRule:()=>t.y,revive:()=>t.J,setMissingExtensionHandler:()=>t.L,setRequestHeaderRule:()=>t.b,supportsOperation:()=>t.U,type:()=>t.Y,waitForExtensionExposure:()=>t.R});Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
@@ -0,0 +1,84 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { A as t, B as n, C as r, D as i, E as a, F as o, G as s, I as c, J as l, K as u, L as d, M as f, N as p, O as m, P as h, R as g, S as _, T as v, U as y, V as b, W as x, Y as S, _ as C, a as w, b as T, c as E, f as D, g as O, h as k, i as A, j, k as M, l as N, n as ee, o as P, p as F, q as I, r as L, s as R, t as z, u as B, v as V, w as H, x as U, y as W } from "./lib-duLPF_WZ.js";
3
+ import { a as G } from "./api-DLvscoll.js";
4
+ import { n as K, t as q } from "./proxy-KUfE4cEQ.js";
5
+ import { available as J, fetch as Y } from "./desktop.js";
6
+ //#region src/extension-prompt.ts
7
+ var X = async (e) => {
8
+ if (typeof window > "u") return !1;
9
+ if (o()) return !0;
10
+ let t = await G, n = null, r = new Promise((e) => {
11
+ n = () => {
12
+ o() && e(!0);
13
+ }, h.addEventListener("statuschange", n);
14
+ }), i = t.installPrompt.show(e).then(() => !1), a = await Promise.race([r, i]);
15
+ return n && h.removeEventListener("statuschange", n), await t.installPrompt.hide().catch(() => {}), a;
16
+ }, Z = null;
17
+ d(() => (Z ||= X().then(() => void 0).finally(() => {
18
+ Z = null;
19
+ }), Z));
20
+ //#endregion
21
+ //#region src/auto.ts
22
+ var Q = () => typeof document < "u" && o(), $ = async (e, t) => {
23
+ if (K(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 H(e, t);
26
+ }
27
+ return Q() ? H(e, {
28
+ ...t,
29
+ credentials: "omit"
30
+ }) : J() ? Y(e, t) : q(e, t);
31
+ }, te = /* @__PURE__ */ e({
32
+ ATTACH_FRAME_EVENT_KEY: () => ee,
33
+ EXTENSION_ABI: () => 1,
34
+ ExtensionOperationUnsupportedError: () => n,
35
+ ExtensionOutdatedError: () => b,
36
+ FORGEABLE_HEADERS: () => t,
37
+ LOCATOR_DENIED: () => F,
38
+ LOCATOR_ERROR: () => O,
39
+ LOCATOR_UNSUPPORTED: () => B,
40
+ REQUIRED_EXTENSION_ABI: () => 0,
41
+ assertAttachableFrameUrl: () => R,
42
+ assertFetchableUrl: () => r,
43
+ assertForgeableHeaders: () => j,
44
+ assertLockdownApplicable: () => E,
45
+ assertOneCookieIdentity: () => f,
46
+ attachFrame: () => L,
47
+ attachFramePermission: () => A,
48
+ available: () => Q,
49
+ box: () => s,
50
+ cookies: () => U,
51
+ createFrame: () => w,
52
+ createVideoElementHandle: () => u,
53
+ events: () => h,
54
+ extension: () => h,
55
+ fetch: () => H,
56
+ fetchCredentialedPermission: () => v,
57
+ fetchLocalPermission: () => a,
58
+ fetchPermission: () => i,
59
+ gotoPermission: () => P,
60
+ handleRevivableModules: () => x,
61
+ hasForgedCookie: () => p,
62
+ isBlockedFetchUrl: () => m,
63
+ isBlockedFrameUrl: () => N,
64
+ isExtensionExposed: () => o,
65
+ isLocalNetworkUrl: () => M,
66
+ isLocatorDenied: () => k,
67
+ isLocatorUnsupported: () => C,
68
+ isTerminalError: () => D,
69
+ isType: () => I,
70
+ modifyRequestHeadersPermission: () => V,
71
+ permissions: () => z,
72
+ promptInstall: () => X,
73
+ readCookiePermission: () => _,
74
+ readExtensionHandshake: () => c,
75
+ removeRequestHeaderRule: () => W,
76
+ revive: () => l,
77
+ setMissingExtensionHandler: () => d,
78
+ setRequestHeaderRule: () => T,
79
+ supportsOperation: () => y,
80
+ type: () => S,
81
+ waitForExtensionExposure: () => g
82
+ });
83
+ //#endregion
84
+ export { X as i, $ as n, Q as r, te as t };
package/extension.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib-DbiVHPXE.cjs"),t=require("./extension-CgSGjcSl.cjs");exports.ATTACH_FRAME_EVENT_KEY=e.n,exports.FORGEABLE_HEADERS=e.A,exports.LOCATOR_DENIED=e.h,exports.LOCATOR_ERROR=e.g,exports.LOCATOR_UNSUPPORTED=e.m,exports.assertAttachableFrameUrl=e.s,exports.assertFetchableUrl=e.C,exports.assertForgeableHeaders=e.j,exports.assertLockdownApplicable=e.c,exports.assertOneCookieIdentity=e.M,exports.attachFrame=e.r,exports.attachFramePermission=e.i,exports.available=t.r,exports.box=e.z,exports.cookies=e.x,exports.createFrame=e.a,exports.createVideoElementHandle=e.B,exports.events=e.P,exports.extension=e.P,exports.fetch=e.w,exports.fetchCredentialedPermission=e.T,exports.fetchLocalPermission=e.E,exports.fetchPermission=e.D,exports.gotoPermission=e.o,exports.handleRevivableModules=e.R,exports.hasForgedCookie=e.N,exports.isBlockedFetchUrl=e.O,exports.isBlockedFrameUrl=e.l,exports.isExtensionExposed=e.F,exports.isLocalNetworkUrl=e.k,exports.isLocatorDenied=e.p,exports.isLocatorUnsupported=e.u,exports.isTerminalError=e.d,exports.isType=e.V,exports.modifyRequestHeadersPermission=e.v,exports.permissions=e.t,exports.promptInstall=t.i,exports.readCookiePermission=e.S,exports.removeRequestHeaderRule=e.y,exports.revive=e.H,exports.setMissingExtensionHandler=e.I,exports.setRequestHeaderRule=e.b,exports.type=e.U,exports.waitForExtensionExposure=e.L;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib-DLM2M3_i.cjs"),t=require("./extension-DBazc3ff.cjs");exports.ATTACH_FRAME_EVENT_KEY=e.n,exports.EXTENSION_ABI=e.z,exports.ExtensionOperationUnsupportedError=e.B,exports.ExtensionOutdatedError=e.V,exports.FORGEABLE_HEADERS=e.A,exports.LOCATOR_DENIED=e.p,exports.LOCATOR_ERROR=e.g,exports.LOCATOR_UNSUPPORTED=e.u,exports.REQUIRED_EXTENSION_ABI=e.H,exports.assertAttachableFrameUrl=e.s,exports.assertFetchableUrl=e.C,exports.assertForgeableHeaders=e.j,exports.assertLockdownApplicable=e.c,exports.assertOneCookieIdentity=e.M,exports.attachFrame=e.r,exports.attachFramePermission=e.i,exports.available=t.r,exports.box=e.G,exports.cookies=e.x,exports.createFrame=e.a,exports.createVideoElementHandle=e.K,exports.events=e.P,exports.extension=e.P,exports.fetch=e.w,exports.fetchCredentialedPermission=e.T,exports.fetchLocalPermission=e.E,exports.fetchPermission=e.D,exports.gotoPermission=e.o,exports.handleRevivableModules=e.W,exports.hasForgedCookie=e.N,exports.isBlockedFetchUrl=e.O,exports.isBlockedFrameUrl=e.l,exports.isExtensionExposed=e.F,exports.isLocalNetworkUrl=e.k,exports.isLocatorDenied=e.h,exports.isLocatorUnsupported=e._,exports.isTerminalError=e.f,exports.isType=e.q,exports.modifyRequestHeadersPermission=e.v,exports.permissions=e.t,exports.promptInstall=t.i,exports.readCookiePermission=e.S,exports.readExtensionHandshake=e.I,exports.removeRequestHeaderRule=e.y,exports.revive=e.J,exports.setMissingExtensionHandler=e.L,exports.setRequestHeaderRule=e.b,exports.supportsOperation=e.U,exports.type=e.Y,exports.waitForExtensionExposure=e.R;
package/extension.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { $ as fetch, A as LOCATOR_DENIED, B as SelectorPart, C as RemoteVideoElement, D as isType, E as createVideoElementHandle, F as isTerminalError, G as setRequestHeaderRule, H as RequestHeaderRule, I as Executor, J as cookies, K as CookieDetails, L as Gate, M as LOCATOR_UNSUPPORTED, N as isLocatorDenied, O as revive, P as isLocatorUnsupported, Q as assertFetchableUrl, R as GateTools, S as BoxedVideoElement, T as box, U as modifyRequestHeadersPermission, V as HeaderOperation, W as removeRequestHeaderRule, X as FetchInit, Y as readCookiePermission, Z as ProxyFetchRequest, _ as gotoPermission, a as PermissionGrant, at as FORGEABLE_HEADERS, b as isBlockedFrameUrl, c as ATTACH_FRAME_EVENT_KEY, ct as hasForgedCookie, d as Frame, et as fetchCredentialedPermission, f as FrameBackend, g as createFrame, h as attachFramePermission, i as waitForExtensionExposure, it as isLocalNetworkUrl, j as LOCATOR_ERROR, k as type, l as attachFrame, m as Locator, n as isExtensionExposed, nt as fetchPermission, o as PermissionRequest, ot as assertForgeableHeaders, p as GotoOptions, q as SiteCookie, r as setMissingExtensionHandler, rt as isBlockedFetchUrl, s as permissions, st as assertOneCookieIdentity, t as extension, tt as fetchLocalPermission, u as AttachFrameOptions, v as assertAttachableFrameUrl, w as VideoElementState, x as handleRevivableModules, y as assertLockdownApplicable, z as OperationRequest } from "./index-DY8WjklJ.js";
2
- import { i as promptInstall, r as isExtensionAvailable } from "./extension-CMPZjuaV.js";
3
- export { ATTACH_FRAME_EVENT_KEY, AttachFrameOptions, BoxedVideoElement, CookieDetails, type Executor, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, type Gate, type GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_UNSUPPORTED, Locator, type OperationRequest, PermissionGrant, PermissionRequest, ProxyFetchRequest, RemoteVideoElement, RequestHeaderRule, type SelectorPart, SiteCookie, VideoElementState, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFrame, attachFramePermission, isExtensionAvailable as available, box, cookies, createFrame, createVideoElementHandle, extension as events, extension, fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, gotoPermission, handleRevivableModules, hasForgedCookie, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorUnsupported, isTerminalError, isType, modifyRequestHeadersPermission, permissions, promptInstall, readCookiePermission, removeRequestHeaderRule, revive, setMissingExtensionHandler, setRequestHeaderRule, type, waitForExtensionExposure };
1
+ import { A as modifyRequestHeadersPermission, B as fetch, C as LOCATOR_ERROR, D as isTerminalError, E as isLocatorUnsupported, F as cookies, G as isLocalNetworkUrl, H as fetchLocalPermission, I as readCookiePermission, J as assertOneCookieIdentity, K as FORGEABLE_HEADERS, L as FetchInit, M as setRequestHeaderRule, N as CookieDetails, O as HeaderOperation, P as SiteCookie, R as ProxyFetchRequest, S as LOCATOR_DENIED, T as isLocatorDenied, U as fetchPermission, V as fetchCredentialedPermission, W as isBlockedFetchUrl, Y as hasForgedCookie, _ as PermissionRequest, a as extension, b as assertLockdownApplicable, c as setMissingExtensionHandler, d as ExtensionHandshake, f as ExtensionOperationUnsupportedError, g as PermissionGrant, h as supportsOperation, i as promptInstall, j as removeRequestHeaderRule, k as RequestHeaderRule, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, o as isExtensionExposed, p as ExtensionOutdatedError, q as assertForgeableHeaders, r as isExtensionAvailable, s as readExtensionHandshake, u as EXTENSION_ABI, v as permissions, w as LOCATOR_UNSUPPORTED, x as isBlockedFrameUrl, y as assertAttachableFrameUrl, z as assertFetchableUrl } from "./extension-CJUeVRXf.js";
2
+ import { C as OperationRequest, S as GateTools, _ as isType, a as FrameBackend, b as Executor, c as attachFramePermission, d as handleRevivableModules, f as BoxedVideoElement, g as createVideoElementHandle, h as box, i as Frame, l as createFrame, m as VideoElementState, n as attachFrame, o as GotoOptions, p as RemoteVideoElement, r as AttachFrameOptions, s as Locator, t as ATTACH_FRAME_EVENT_KEY, u as gotoPermission, v as revive, w as SelectorPart, x as Gate, y as type } from "./index-BhO-wymH.js";
3
+ export { ATTACH_FRAME_EVENT_KEY, AttachFrameOptions, BoxedVideoElement, CookieDetails, EXTENSION_ABI, type Executor, type ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, type Gate, type GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_UNSUPPORTED, Locator, type OperationRequest, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, type SelectorPart, SiteCookie, VideoElementState, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFrame, attachFramePermission, isExtensionAvailable as available, box, cookies, createFrame, createVideoElementHandle, extension as events, extension, fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, gotoPermission, handleRevivableModules, hasForgedCookie, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorUnsupported, isTerminalError, isType, modifyRequestHeadersPermission, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, setMissingExtensionHandler, setRequestHeaderRule, supportsOperation, type, waitForExtensionExposure };
package/extension.js CHANGED
@@ -1,3 +1,3 @@
1
- import { A as e, B as t, C as n, D as r, E as i, F as a, H as o, I as s, L as c, M as l, N as u, O as d, P as f, R as p, S as m, T as h, U as g, V as _, a as v, b as y, c as b, d as x, g as S, h as C, i as w, j as T, k as E, l as D, m as O, n as k, o as A, p as j, r as M, s as N, t as P, u as F, v as I, w as L, x as R, y as z, z as B } from "./lib-k3lstfa4.js";
2
- import { i as V, r as H } from "./extension-B8Y0sUwC.js";
3
- export { k as ATTACH_FRAME_EVENT_KEY, e as FORGEABLE_HEADERS, C as LOCATOR_DENIED, S as LOCATOR_ERROR, O as LOCATOR_UNSUPPORTED, N as assertAttachableFrameUrl, n as assertFetchableUrl, T as assertForgeableHeaders, b as assertLockdownApplicable, l as assertOneCookieIdentity, M as attachFrame, w as attachFramePermission, H as available, B as box, R as cookies, v as createFrame, t as createVideoElementHandle, f as events, f as extension, L as fetch, h as fetchCredentialedPermission, i as fetchLocalPermission, r as fetchPermission, A as gotoPermission, p as handleRevivableModules, u as hasForgedCookie, d as isBlockedFetchUrl, D as isBlockedFrameUrl, a as isExtensionExposed, E as isLocalNetworkUrl, j as isLocatorDenied, F as isLocatorUnsupported, x as isTerminalError, _ as isType, I as modifyRequestHeadersPermission, P as permissions, V as promptInstall, m as readCookiePermission, z as removeRequestHeaderRule, o as revive, s as setMissingExtensionHandler, y as setRequestHeaderRule, g as type, c as waitForExtensionExposure };
1
+ import { A as e, B as t, C as n, D as r, E as i, F as a, G as o, H as s, I as c, J as l, K as u, L as d, M as f, N as p, O as m, P as h, R as g, S as _, T as v, U as y, V as b, W as x, Y as S, _ as C, a as w, b as T, c as E, f as D, g as O, h as k, i as A, j, k as M, l as N, n as P, o as F, p as I, q as L, r as R, s as z, t as B, u as V, v as H, w as U, x as W, y as G, z as K } from "./lib-duLPF_WZ.js";
2
+ import { i as q, r as J } from "./extension-Dw9gzvei.js";
3
+ export { P as ATTACH_FRAME_EVENT_KEY, K as EXTENSION_ABI, t as ExtensionOperationUnsupportedError, b as ExtensionOutdatedError, e as FORGEABLE_HEADERS, I as LOCATOR_DENIED, O as LOCATOR_ERROR, V as LOCATOR_UNSUPPORTED, s as REQUIRED_EXTENSION_ABI, z as assertAttachableFrameUrl, n as assertFetchableUrl, j as assertForgeableHeaders, E as assertLockdownApplicable, f as assertOneCookieIdentity, R as attachFrame, A as attachFramePermission, J as available, o as box, W as cookies, w as createFrame, u as createVideoElementHandle, h as events, h as extension, U as fetch, v as fetchCredentialedPermission, i as fetchLocalPermission, r as fetchPermission, F as gotoPermission, x as handleRevivableModules, p as hasForgedCookie, m as isBlockedFetchUrl, N as isBlockedFrameUrl, a as isExtensionExposed, M as isLocalNetworkUrl, k as isLocatorDenied, C as isLocatorUnsupported, D as isTerminalError, L as isType, H as modifyRequestHeadersPermission, B as permissions, q as promptInstall, _ as readCookiePermission, c as readExtensionHandshake, G as removeRequestHeaderRule, l as revive, d as setMissingExtensionHandler, T as setRequestHeaderRule, y as supportsOperation, S as type, g as waitForExtensionExposure };
package/fs/promises.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../fs-BNnozBMU.cjs");var{readFile:t,writeFile:n,appendFile:r,unlink:i,rename:a,readdir:o,mkdir:s,rm:c,rmdir:l,stat:u,lstat:d,access:f}=e.v,p=e.v;exports.access=f,exports.appendFile=r,exports.default=p,exports.lstat=d,exports.mkdir=s,exports.readFile=t,exports.readdir=o,exports.rename=a,exports.rm=c,exports.rmdir=l,exports.stat=u,exports.unlink=i,exports.writeFile=n;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../fs-DYP7utdw.cjs");var{readFile:t,writeFile:n,appendFile:r,unlink:i,rename:a,readdir:o,mkdir:s,rm:c,rmdir:l,stat:u,lstat:d,access:f}=e.v,p=e.v;exports.access=f,exports.appendFile=r,exports.default=p,exports.lstat=d,exports.mkdir=s,exports.readFile=t,exports.readdir=o,exports.rename=a,exports.rm=c,exports.rmdir=l,exports.stat=u,exports.unlink=i,exports.writeFile=n;
package/fs/promises.d.ts CHANGED
@@ -1,12 +1,11 @@
1
- import { a as Stats, i as ReadOptions, o as WriteData, r as MakeOptions, s as WriteOptions } from "../index-CJ0vHTcS.js";
2
- import { v as promises } from "../index-BIZeEsNu.js";
3
-
4
- //#region src/lib/fs/promises.d.ts
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-CGJTVju4.js";
3
+ //#region src/fs/promises.d.ts
5
4
  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?: {
6
- recursive?: boolean;
7
- force?: boolean;
8
- }) => Promise<void>, rmdir: (path: import("node:fs").PathLike, options?: {
9
- recursive?: boolean;
10
- }) => Promise<void>, stat: (path: import("node:fs").PathLike) => Promise<Stats>, lstat: (path: import("node:fs").PathLike) => Promise<Stats>, access: (path: import("node:fs").PathLike) => Promise<void>;
5
+ recursive?: boolean;
6
+ force?: boolean;
7
+ }) => Promise<void>, rmdir: (path: import("node:fs").PathLike, options?: {
8
+ recursive?: boolean;
9
+ }) => Promise<void>, stat: (path: import("node:fs").PathLike) => Promise<Stats>, lstat: (path: import("node:fs").PathLike) => Promise<Stats>, access: (path: import("node:fs").PathLike) => Promise<void>;
11
10
  //#endregion
12
11
  export { access, appendFile, promises as default, lstat, mkdir, readFile, readdir, rename, rm, rmdir, stat, unlink, writeFile };
package/fs/promises.js CHANGED
@@ -1,5 +1,5 @@
1
- import { v as e } from "../fs-pOQSZfuf.js";
2
- //#region src/lib/fs/promises.ts
1
+ import { v as e } from "../fs-d2ANVBkm.js";
2
+ //#region src/fs/promises.ts
3
3
  var { readFile: t, writeFile: n, appendFile: r, unlink: i, rename: a, readdir: o, mkdir: s, rm: c, rmdir: l, stat: u, lstat: d, access: f } = e, p = e;
4
4
  //#endregion
5
5
  export { f as access, r as appendFile, p as default, d as lstat, s as mkdir, t as readFile, o as readdir, a as rename, c as rm, l as rmdir, u as stat, i as unlink, n as writeFile };
@@ -0,0 +1 @@
1
+ const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./busy-Dv8wzE5M.cjs"),n=require("./node-fs-DZPGCYWg.cjs"),r=require("./storage-DLB4ciMf.cjs"),i=require("./opfs-CXMESVLc.cjs");var a=e.t({adopt:()=>I,adoptable:()=>L,available:()=>u,list:()=>re,onConflict:()=>ce,pending:()=>w,pendingDeletes:()=>ee,pull:()=>se,readFile:()=>ie,remove:()=>oe,replicating:()=>T,writeFile:()=>ae}),o,s=async()=>await(o??=i.t().catch(()=>!1))?!0:(o=void 0,!1),c=()=>r.r().catch(()=>`unknown`),l=async()=>await c()===`connected`,u=async()=>await s()||await l(),d=`fkn:fs:pending`,f=`fkn:fs:pending-delete`,p=`fkn:fs:adopt-declined`,m=!0,h=new Map,g=e=>{try{let t=localStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);return Array.isArray(n)?Object.fromEntries(n.filter(e=>typeof e==`string`).map(e=>[e,null])):n&&typeof n==`object`?n:{}}catch{return{}}},_=(e,t)=>{try{Object.keys(t).length?localStorage.setItem(e,JSON.stringify(t)):localStorage.removeItem(e)}catch{}},v=()=>g(d),y=(e,t)=>{let n=v();e in n||(n[e]=t===void 0?h.get(e)??null:t,_(d,n))},b=e=>{let t=v();e in t&&(delete t[e],_(d,t),D()||(k=O))},x=()=>g(f),S=e=>{let t=x();e in t||(t[e]=h.get(e)??null,_(f,t))},C=e=>{let t=x();e in t&&(delete t[e],_(f,t),D()||(k=O))},w=()=>Object.keys(v()),ee=()=>Object.keys(x()),T=()=>m,E=null;t.r(`storage replication`,()=>E!==null||R!==null);var D=()=>Object.keys(v()).length>0||Object.keys(x()).length>0,O=6e4,te=6e5,k=O,A=null,j=()=>{A||typeof window>`u`||!D()||(A=setTimeout(()=>{A=null,M()},k),k=Math.min(k*2,te))},M=()=>{E||!D()||(E=F(!1).then(e=>{if(!D()){k=O;return}e.failed.length&&j()}).catch(()=>{j()}).finally(()=>{E=null}))},ne=null,N=()=>ne??=Promise.resolve().then(()=>require("./api.cjs")).then(e=>e.apiPromise),re=async()=>{U();let e=await c(),t=e===`connected`,[n,a]=await Promise.all([s().then(e=>e?i.n():[]).catch(()=>[]),t?r.o().then(e=>({ok:!0,entries:e})).catch(()=>({ok:!1,entries:[]})):Promise.resolve({ok:e===`disconnected`,entries:[]})]);e!==`unknown`&&(m=a.ok),a.ok&&e!==`unknown`&&(h=new Map(a.entries.map(e=>[e.path,e.updatedAt])));let o=new Map,l=e=>{let t=Date.parse(e.updatedAt??``);return Number.isFinite(t)?t:0},u=e=>{let t=o.get(e.path);(!t||l(e)>=l(t))&&o.set(e.path,e)};for(let e of n)u(e);for(let e of a.entries)u(e);return a.ok&&t&&(pe(n,a.entries).catch(()=>{}),D()?M():z({local:n,remote:a.entries}).catch(()=>{})),[...o.values()]},ie=async e=>{if(await s())try{return await i.i(e)}catch(e){if(e?.name!==`NotFoundError`)throw e}let t=await r.c(e);return await s()&&i.o(e,t).catch(()=>{}),t},ae=async(e,t,n)=>{let a=t instanceof Blob?t:new Blob([t],n?.contentType?{type:n.contentType}:void 0);if(await s()){await i.o(e,a,n),U();let t=h.get(e)??null,o=await c();if(o===`disconnected`)return;if(o===`unknown`||!m){y(e,t),j();return}r.f(e,a,n).then(()=>b(e)).catch(n=>{y(e,t),j(),console.warn(`fs: cloud replicate failed, queued for adopt()`,n)});return}let o=await c();if(o===`connected`)return r.f(e,a,n);throw Error(o===`unknown`?`fs: cloud unreachable`:`fs: no storage backend available`)},oe=async e=>{U();let t=[];await s()&&t.push(i.a(e).catch(()=>{}));let n=await c();if(n===`connected`?t.push(r.l(e).then(()=>C(e)).catch(t=>{S(e),j(),console.warn(`fs: cloud delete failed, queued for retry`,t)})):n===`unknown`&&t.length&&h.has(e)&&(S(e),j()),!t.length)throw Error(n===`unknown`?`fs: cloud unreachable`:`fs: no storage backend available`);b(e),await Promise.all(t)},se=async e=>{let t=await r.c(e);return await s()&&await i.o(e,t),t},P=null,ce=e=>(P=e,()=>{P===e&&(P=null)}),le=async e=>(await N()).cloud.fs.promptConflict({path:e.path,local:e.local,cloud:e.cloud}).catch(()=>null),ue=async e=>{if(P)try{return await P(e)}catch{return null}return le(e)},F=async e=>{let t={uploaded:[],kept:[],resolved:[],unresolved:[],deleted:[],failed:[]},n=await c();if(n===`unknown`)throw Error(`fs: cloud unreachable`);if(n!==`connected`)throw Error(`fs: this needs a signed-in account`);let a=await s(),[o,l]=await Promise.all([a?i.n():Promise.resolve([]),r.o()]),u=new Map(l.map(e=>[e.path,e])),d=v();if(a)for(let e of Object.keys(d))o.some(t=>t.path===e)||b(e);for(let[e,n]of Object.entries(x())){let i=u.get(e);if(!i){C(e);continue}if(o.some(t=>t.path===e)){C(e);continue}if(i.updatedAt!==n){C(e);continue}try{await r.l(e),C(e),t.deleted.push(e)}catch(n){t.failed.push({path:e,error:n instanceof Error?n.message:String(n)})}}for(let n of o){let a=u.get(n.path),o=n.path in d;if(!o&&(a||!e)){a&&t.kept.push(n.path);continue}if(o&&a&&a.updatedAt!==d[n.path]){let e=await ue({path:n.path,local:{size:n.size,updatedAt:n.updatedAt},cloud:{size:a.size,updatedAt:a.updatedAt},readLocal:()=>i.i(n.path),readCloud:()=>r.c(n.path)});if(!e){t.unresolved.push(n.path);continue}try{if(e===`cloud`)await i.o(n.path,await r.c(n.path));else{let t=e===`local`?await i.i(n.path):e.merged;await r.f(n.path,t,n.contentType?{contentType:n.contentType}:void 0),e!==`local`&&await i.o(n.path,t)}b(n.path),t.resolved.push({path:n.path,choice:e===`local`||e===`cloud`?e:`merged`})}catch(e){if(e?.code===`FKN_E2E_LOCKED`)throw e;t.failed.push({path:n.path,error:e instanceof Error?e.message:String(e)})}continue}try{let e=await i.i(n.path);await r.f(n.path,e,n.contentType?{contentType:n.contentType}:void 0),b(n.path),t.uploaded.push(n.path)}catch(e){if(y(n.path),e?.code===`FKN_E2E_LOCKED`)throw e;t.failed.push({path:n.path,error:e instanceof Error?e.message:String(e)})}}return t},I=async()=>{for(;E;)await E;let e=F(!0);E=e.then(()=>{},()=>{});try{return await e}finally{E=null}},L=async()=>{if(!await l()||!await s())return{paths:[],bytes:0};let[e,t]=await Promise.all([i.n(),r.o()]),n=new Set(t.map(e=>e.path)),a=e.filter(e=>!n.has(e.path));return{paths:a.map(e=>e.path),bytes:a.reduce((e,t)=>e+t.size,0)}},de=()=>new Set(Object.keys(g(p))),fe=e=>{let t=g(p);for(let n of e)t[n]=null;_(p,t)},R=null,z=e=>R||(R=(async()=>{if(!await l())return;let t=e??(await s()?{local:await i.n(),remote:await r.o()}:null);if(!t)return;let n=new Set(t.remote.map(e=>e.path)),a=de(),o=t.local.filter(e=>!n.has(e.path)&&!a.has(e.path));if(!o.length)return;let c=await N(),u=o.reduce((e,t)=>e+t.size,0);if(!await c.cloud.fs.promptAdopt({files:o.length,bytes:u}).catch(()=>!1)){fe(o.map(e=>e.path));return}await I()})().catch(()=>{}).finally(()=>{R=null}),R),B=null,V=!1,pe=async(e,t)=>{let n=new Set(t.map(e=>e.path)),r=e.filter(e=>!n.has(e.path)),i=await N(),a=async()=>{await I().catch(()=>{});let e=await L().catch(()=>({paths:[],bytes:0}));await i.cloud.fs.setAdoptSource({files:e.paths.length,bytes:e.bytes},a).catch(()=>{})},o={files:r.length,bytes:r.reduce((e,t)=>e+t.size,0)};B=()=>{i.cloud.fs.setAdoptSource(o,a).catch(()=>{})},V||(V=!0,Promise.resolve().then(()=>require("./api.cjs")).then(e=>e.onApiEpoch((e,t)=>{t>1&&B?.()})).catch(()=>{})),await i.cloud.fs.setAdoptSource(o,a)},H=!1,U=()=>{H||typeof window>`u`||(H=!0,window.addEventListener(`online`,()=>{M()}),Promise.resolve().then(()=>require("./account.cjs")).then(e=>e.onChange(()=>{z().catch(()=>{}),M()})).catch(()=>{}))},me=e.t({adopt:()=>q,adoptable:()=>J,appendFile:()=>ke,appendFileSync:()=>ve,available:()=>he,default:()=>$,exists:()=>Ie,existsSync:()=>ye,flush:()=>ze,lstatSync:()=>xe,mkdir:()=>Me,mkdirSync:()=>Se,mount:()=>Re,onConflict:()=>Q,pending:()=>Y,pendingDeletes:()=>X,promises:()=>Le,pull:()=>K,readFile:()=>De,readFileSync:()=>ge,readdir:()=>je,readdirSync:()=>G,remount:()=>Be,rename:()=>Fe,renameSync:()=>Ee,replicating:()=>Z,rm:()=>Ne,rmSync:()=>Ce,rmdirSync:()=>we,stat:()=>Ae,statSync:()=>be,unlink:()=>Pe,unlinkSync:()=>Te,writeFile:()=>Oe,writeFileSync:()=>_e}),W=n.t(a,{memfs:!0}),{available:he,readFileSync:ge,writeFileSync:_e,appendFileSync:ve,existsSync:ye,statSync:be,lstatSync:xe,readdirSync:G,mkdirSync:Se,rmSync:Ce,rmdirSync:we,unlinkSync:Te,renameSync:Ee,readFile:De,writeFile:Oe,appendFile:ke,stat:Ae,readdir:je,mkdir:Me,rm:Ne,unlink:Pe,rename:Fe,exists:Ie,promises:Le,mount:Re,flush:ze,remount:Be}=W,K=se,q=I,J=L,Y=w,X=ee,Z=T,Q=ce,$={...W,pull:K,adopt:q,adoptable:J,pending:Y,pendingDeletes:X,replicating:Z,onConflict:Q};Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return me}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return K}});
@@ -1,7 +1,6 @@
1
- import { n as STORAGE_NOT_FOUND } from "./storage-qxXFLgTM.js";
2
- import { a as Stats, i as ReadOptions, n as Callback, o as WriteData, r as MakeOptions, s as WriteOptions } from "./index-CJ0vHTcS.js";
3
-
4
- //#region src/lib/storage.d.ts
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 { i as STORAGE_NOT_FOUND } from "./messages-DvpKMTsY.js";
3
+ //#region src/storage.d.ts
5
4
  type FileEntry = {
6
5
  path: string;
7
6
  size: number;
@@ -52,23 +51,23 @@ declare namespace fs_d_exports {
52
51
  export { EncryptionStatus, FileEntry, STORAGE_NOT_FOUND, Stats, StorageLockedError, StorageNotFoundError, StorageQuota, available, encryption, isNotFound, mkdir, promises, quota, readFile, readdir, rename, rm, stat, unlink, unlock, writeFile };
53
52
  }
54
53
  declare const available: () => Promise<boolean>, readFile: (path: import("node:fs").PathLike, a: ReadOptions | Callback<Buffer | string>, b?: Callback<Buffer | string>) => void, writeFile: (path: import("node:fs").PathLike, data: WriteData, a: WriteOptions | Callback<void>, b?: Callback<void>) => void, unlink: (path: import("node:fs").PathLike, callback: Callback<void>) => void, rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike, callback: Callback<void>) => void, readdir: (path: import("node:fs").PathLike, a: unknown, b?: Callback<string[]>) => void, mkdir: (path: import("node:fs").PathLike, a: MakeOptions | Callback<void>, b?: Callback<void>) => void, rm: (path: import("node:fs").PathLike, a: {
54
+ recursive?: boolean;
55
+ } | Callback<void>, b?: Callback<void>) => void, stat: (path: import("node:fs").PathLike, callback: Callback<Stats>) => void, promises: {
56
+ readFile: (path: import("node:fs").PathLike, options?: ReadOptions) => Promise<Buffer | string>;
57
+ writeFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
58
+ unlink: (path: import("node:fs").PathLike) => Promise<void>;
59
+ rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>;
60
+ readdir: (path: import("node:fs").PathLike) => Promise<string[]>;
61
+ mkdir: (_path?: import("node:fs").PathLike, _options?: MakeOptions) => Promise<void>;
62
+ rm: (path: import("node:fs").PathLike, options?: {
55
63
  recursive?: boolean;
56
- } | Callback<void>, b?: Callback<void>) => void, stat: (path: import("node:fs").PathLike, callback: Callback<Stats>) => void, promises: {
57
- readFile: (path: import("node:fs").PathLike, options?: ReadOptions) => Promise<Buffer | string>;
58
- writeFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
59
- unlink: (path: import("node:fs").PathLike) => Promise<void>;
60
- rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>;
61
- readdir: (path: import("node:fs").PathLike) => Promise<string[]>;
62
- mkdir: (_path?: import("node:fs").PathLike, _options?: MakeOptions) => Promise<void>;
63
- rm: (path: import("node:fs").PathLike, options?: {
64
- recursive?: boolean;
65
- }) => Promise<void>;
66
- rmdir: (path: import("node:fs").PathLike, options?: {
67
- recursive?: boolean;
68
- }) => Promise<void>;
69
- stat: (path: import("node:fs").PathLike) => Promise<Stats>;
70
- lstat: (path: import("node:fs").PathLike) => Promise<Stats>;
71
- access: (path: import("node:fs").PathLike) => Promise<void>;
72
- };
64
+ }) => Promise<void>;
65
+ rmdir: (path: import("node:fs").PathLike, options?: {
66
+ recursive?: boolean;
67
+ }) => Promise<void>;
68
+ stat: (path: import("node:fs").PathLike) => Promise<Stats>;
69
+ lstat: (path: import("node:fs").PathLike) => Promise<Stats>;
70
+ access: (path: import("node:fs").PathLike) => Promise<void>;
71
+ };
73
72
  //#endregion
74
73
  export { encryption as _, readFile as a, unlock as b, rm as c, writeFile as d, EncryptionStatus as f, StorageQuota as g, StorageNotFoundError as h, promises as i, stat as l, StorageLockedError as m, fs_d_exports as n, readdir as o, FileEntry as p, mkdir as r, rename as s, available as t, unlink as u, isNotFound as v, quota as y };