@fkn/lib 0.9.46 → 0.9.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{account-generation-B-6Pn0b5.cjs → account-generation-9VhfEDoW.cjs} +1 -1
- package/{account-generation-XNWOvLea.js → account-generation-hUekEHGW.js} +1 -1
- package/account.cjs +1 -1
- package/account.js +2 -2
- package/{api-DOXb_WrB.d.ts → api-DIBhBtcU.d.ts} +2 -24
- package/api-DMnVye0K.cjs +3 -0
- package/{api-DIgTslNb.js → api-ySazPAwN.js} +97 -59
- package/api.cjs +1 -1
- package/api.d.ts +2 -2
- package/api.js +1 -1
- package/busy-BXbVH595.cjs +1 -0
- package/{busy-B189uX--.js → busy-DsMWrSzc.js} +6 -3
- package/cloud/dns.d.ts +1 -1
- package/cloud/fetch.cjs +1 -1
- package/cloud/fetch.d.ts +1 -1
- package/cloud/fetch.js +1 -1
- package/cloud/fs/promises.d.ts +1 -1
- package/cloud/fs.cjs +1 -1
- package/cloud/fs.d.ts +2 -2
- package/cloud/fs.js +2 -2
- package/cloud/net.cjs +1 -1
- package/cloud/net.d.ts +1 -1
- package/cloud/net.js +2 -2
- package/{cloud-v5x4uhDC.js → cloud-BD7uzz5h.js} +14 -18
- package/{cloud-DSx-jDFk.d.ts → cloud-Bdw5nX-B.d.ts} +4 -4
- package/{cloud-CUzZFzG3.cjs → cloud-DL4i8kvf.cjs} +1 -1
- package/cloud.cjs +1 -1
- package/cloud.d.ts +4 -4
- package/cloud.js +2 -2
- package/{contract-BmLpSueo.d.ts → contract-LOcbTDjP.d.ts} +6 -46
- package/contract.cjs +1 -1
- package/contract.d.ts +4 -4
- package/contract.js +3 -9
- package/dgram.cjs +1 -1
- package/dgram.d.ts +3 -3
- package/dgram.js +19 -19
- package/dns.cjs +1 -1
- package/dns.d.ts +1 -1
- package/dns.js +1 -1
- package/{extension-BnVG0YL4.js → extension-BeIkBEi3.js} +4 -4
- package/{extension-C2tBRE9i.d.ts → extension-Bsvr9OaV.d.ts} +6 -6
- package/{extension-3bxlAW8M.cjs → extension-eG1RMTDc.cjs} +1 -1
- package/extension.cjs +1 -1
- package/extension.d.ts +2 -2
- package/extension.js +2 -2
- package/fs/promises.cjs +1 -1
- package/fs/promises.d.ts +1 -1
- package/fs/promises.js +1 -1
- package/fs-BY0Csn2V.js +515 -0
- package/fs-DnF1cQuE.cjs +1 -0
- package/{fs-KA1Mgisv.d.ts → fs-lKZe5xIo.d.ts} +1 -1
- package/fs.cjs +1 -1
- package/fs.d.ts +2 -2
- package/fs.js +2 -2
- package/http.d.ts +1 -1
- package/{index-DKr9L2RI.d.ts → index-D9x6A-Gx.d.ts} +1 -1
- package/{index-B98wvTaI.d.ts → index-iawzrUiB.d.ts} +86 -32
- package/index.cjs +1 -1
- package/index.d.ts +9 -8
- package/index.js +30 -32
- package/lib-CK2F5cc1.cjs +53 -0
- package/{lib-BFwrzgpu.js → lib-zMHWCUXz.js} +663 -486
- package/{net-BFjtzAK0.d.ts → net-taIhsmvu.d.ts} +5 -5
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +11 -12
- package/{node-fs-CK2wWIYS.js → node-fs-DY2fO5zd.js} +1 -1
- package/{node-fs-nfX7wisL.cjs → node-fs-vsWuoMGa.cjs} +1 -1
- package/opfs.cjs +1 -1
- package/opfs.js +1 -1
- package/package.json +1 -1
- package/packages.cjs +1 -1
- package/packages.d.ts +1 -1
- package/packages.js +2 -2
- package/{proxy-Dixbk1WL.js → proxy-BXkxwBxK.js} +2 -2
- package/{proxy-CFK-KiwE.cjs → proxy-BfkfFsNI.cjs} +1 -1
- package/{proxy-BrsMJmiK.d.ts → proxy-CSKLtRTm.d.ts} +2 -2
- package/rooms.cjs +1 -1
- package/rooms.d.ts +1 -1
- package/rooms.js +13 -21
- package/{storage-BLBsmkmp.d.ts → storage-B_mXNAdB.d.ts} +4 -5
- package/{storage-Dn1gTLSZ.js → storage-C6F9SnDM.js} +2 -2
- package/{storage-D2cUJlVH.cjs → storage-DmRIhg1P.cjs} +1 -1
- package/utils-BpHmMkIR.cjs +1 -0
- package/{utils-C-cAd4r4.js → utils-Cyq8uJiy.js} +7 -9
- package/{wire-BwA4JjZH.d.ts → wire-Fk5pJaoy.d.ts} +8 -1
- package/wire.cjs +1 -1
- package/wire.d.ts +2 -2
- package/wire.js +2 -2
- package/api--LOXTOpv.cjs +0 -3
- package/busy-Dv8wzE5M.cjs +0 -1
- package/fs-CVnmXRf7.js +0 -513
- package/fs-p0bOOj5n.cjs +0 -1
- package/lib-47LPHYgB.cjs +0 -53
- package/utils-BvgGdrgN.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-CK2F5cc1.cjs"),n=require("./api-DMnVye0K.cjs"),r=require("./proxy-BfkfFsNI.cjs"),i=require("./desktop.cjs");var a=`BackgroundStoppedError`,o=e=>t.d(e)&&e.name===`BackgroundStoppedError`,s=async e=>{if(typeof window>`u`)return!1;if(t.et())return!0;let r=await n.o,i=null,a=new Promise(e=>{i=()=>{t.et()&&e(!0)},t.$.addEventListener(`statuschange`,i)}),o=r.installPrompt.show(e).then(()=>!1),s=await Promise.race([a,o]);return i&&t.$.removeEventListener(`statuschange`,i),await r.installPrompt.hide().catch(()=>{}),s},c=null;t.nt(()=>(c||=s().then(()=>void 0).finally(()=>{c=null}),c));var l=()=>typeof document<`u`&&t.et(),u=async(e,a)=>{if(n.p(e),a?.credentials===`include`){if(typeof document>`u`)throw Error(`fetch with credentials needs the FKN extension, which only exists in window realms`);return t.U(e,a)}return l()?t.U(e,{...a,credentials:`omit`}):i.available()?i.fetch(e,a):r.t(e,a)},d=e.t({ATTACH_FRAME_EVENT_KEY:()=>t.i,BACKGROUND_STOPPED:()=>a,CATEGORIES:()=>t.w,EXTENSION_ABI:()=>5,ExtensionOperationUnsupportedError:()=>t.at,ExtensionOutdatedError:()=>t.ot,FORGEABLE_HEADERS:()=>t.Y,FrameWindowBlockedError:()=>t.g,FrameWindowRefusedError:()=>t._,LOCATOR_DENIED:()=>t.k,LOCATOR_ERROR:()=>t.P,LOCATOR_INVALID:()=>t.I,LOCATOR_UNSUPPORTED:()=>t.E,PERMISSION_DENIED:()=>t.t,REQUIRED_EXTENSION_ABI:()=>0,TimeoutError:()=>t.T,assertAttachableFrameUrl:()=>t.x,assertFetchableUrl:()=>t.H,assertForgeableHeaders:()=>t.X,assertLockdownApplicable:()=>t.S,assertOneCookieIdentity:()=>t.Z,attachFrame:()=>t.a,attachFramePermission:()=>t.v,available:()=>l,box:()=>t.ut,cookies:()=>t.B,createFrame:()=>t.y,createVideoElementHandle:()=>t.dt,events:()=>t.$,extension:()=>t.$,fetch:()=>t.U,fetchCredentialedPermission:()=>t.W,fetchLocalPermission:()=>t.G,fetchPermission:()=>t.K,gotoPermission:()=>t.b,handleRevivableModules:()=>t.lt,hasForgedCookie:()=>t.Q,isBackgroundStopped:()=>o,isBlockedFetchUrl:()=>t.q,isBlockedFrameUrl:()=>t.C,isExtensionExposed:()=>t.et,isLocalNetworkUrl:()=>t.J,isLocatorDenied:()=>t.F,isLocatorInvalid:()=>t.j,isLocatorUnsupported:()=>t.D,isPermissionDenied:()=>t.n,isTerminalError:()=>t.N,isType:()=>t.ft,modifyRequestHeadersPermission:()=>t.L,permissions:()=>t.r,promptInstall:()=>s,readCookiePermission:()=>t.V,readExtensionHandshake:()=>t.tt,removeRequestHeaderRule:()=>t.R,revive:()=>t.pt,setMissingExtensionHandler:()=>t.nt,setRequestHeaderRule:()=>t.z,supportsOperation:()=>t.ct,type:()=>t.mt,waitForExtensionExposure:()=>t.rt});Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return d}});
|
package/extension.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib-CK2F5cc1.cjs"),t=require("./extension-eG1RMTDc.cjs");exports.ATTACH_FRAME_EVENT_KEY=e.i,exports.BACKGROUND_STOPPED=t.a,exports.CATEGORIES=e.w,exports.EXTENSION_ABI=e.it,exports.ExtensionOperationUnsupportedError=e.at,exports.ExtensionOutdatedError=e.ot,exports.FORGEABLE_HEADERS=e.Y,exports.FrameWindowBlockedError=e.g,exports.FrameWindowRefusedError=e._,exports.LOCATOR_DENIED=e.k,exports.LOCATOR_ERROR=e.P,exports.LOCATOR_INVALID=e.I,exports.LOCATOR_UNSUPPORTED=e.E,exports.PERMISSION_DENIED=e.t,exports.REQUIRED_EXTENSION_ABI=e.st,exports.TimeoutError=e.T,exports.assertAttachableFrameUrl=e.x,exports.assertFetchableUrl=e.H,exports.assertForgeableHeaders=e.X,exports.assertLockdownApplicable=e.S,exports.assertOneCookieIdentity=e.Z,exports.attachFrame=e.a,exports.attachFramePermission=e.v,exports.available=t.r,exports.box=e.ut,exports.cookies=e.B,exports.createFrame=e.y,exports.createVideoElementHandle=e.dt,exports.events=e.$,exports.extension=e.$,exports.fetch=e.U,exports.fetchCredentialedPermission=e.W,exports.fetchLocalPermission=e.G,exports.fetchPermission=e.K,exports.gotoPermission=e.b,exports.handleRevivableModules=e.lt,exports.hasForgedCookie=e.Q,exports.isBackgroundStopped=t.o,exports.isBlockedFetchUrl=e.q,exports.isBlockedFrameUrl=e.C,exports.isExtensionExposed=e.et,exports.isLocalNetworkUrl=e.J,exports.isLocatorDenied=e.F,exports.isLocatorInvalid=e.j,exports.isLocatorUnsupported=e.D,exports.isPermissionDenied=e.n,exports.isTerminalError=e.N,exports.isType=e.ft,exports.modifyRequestHeadersPermission=e.L,exports.permissions=e.r,exports.promptInstall=t.i,exports.readCookiePermission=e.V,exports.readExtensionHandshake=e.tt,exports.removeRequestHeaderRule=e.R,exports.revive=e.pt,exports.setMissingExtensionHandler=e.nt,exports.setRequestHeaderRule=e.z,exports.supportsOperation=e.ct,exports.type=e.mt,exports.waitForExtensionExposure=e.rt;
|
package/extension.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ 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-iawzrUiB.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-Bsvr9OaV.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/extension.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as e, B as t, C as n, D as r, E as i, F as a, G as o, H as s, I as c, J as l, K as u, L as d, N as f, P as p, Q as m, R as h, S as g, T as _, U as v, V as y, W as b, X as x, Y as S, Z as C, _ as w, a as T, at as E, b as D, ct as O, dt as k, et as A, ft as j, g as M, i as N, it as P, j as F, k as I, lt as L, mt as R, n as z, nt as B, ot as V, pt as H, q as U, r as W, rt as G, st as K, t as q, tt as J, ut as Y, v as X, w as Z, x as Q, y as $, z as ee } from "./lib-
|
|
2
|
-
import { a as te, i as ne, o as re, r as ie } from "./extension-
|
|
1
|
+
import { $ as e, B as t, C as n, D as r, E as i, F as a, G as o, H as s, I as c, J as l, K as u, L as d, N as f, P as p, Q as m, R as h, S as g, T as _, U as v, V as y, W as b, X as x, Y as S, Z as C, _ as w, a as T, at as E, b as D, ct as O, dt as k, et as A, ft as j, g as M, i as N, it as P, j as F, k as I, lt as L, mt as R, n as z, nt as B, ot as V, pt as H, q as U, r as W, rt as G, st as K, t as q, tt as J, ut as Y, v as X, w as Z, x as Q, y as $, z as ee } from "./lib-zMHWCUXz.js";
|
|
2
|
+
import { a as te, i as ne, o as re, r as ie } from "./extension-BeIkBEi3.js";
|
|
3
3
|
export { N as ATTACH_FRAME_EVENT_KEY, te as BACKGROUND_STOPPED, Z as CATEGORIES, P as EXTENSION_ABI, E as ExtensionOperationUnsupportedError, V as ExtensionOutdatedError, S as FORGEABLE_HEADERS, M as FrameWindowBlockedError, w as FrameWindowRefusedError, I as LOCATOR_DENIED, p as LOCATOR_ERROR, c as LOCATOR_INVALID, i as LOCATOR_UNSUPPORTED, q as PERMISSION_DENIED, K as REQUIRED_EXTENSION_ABI, _ as TimeoutError, Q as assertAttachableFrameUrl, s as assertFetchableUrl, x as assertForgeableHeaders, g as assertLockdownApplicable, C as assertOneCookieIdentity, T as attachFrame, X as attachFramePermission, ie as available, Y as box, t as cookies, $ as createFrame, k as createVideoElementHandle, e as events, e as extension, v as fetch, b as fetchCredentialedPermission, o as fetchLocalPermission, u as fetchPermission, D as gotoPermission, L as handleRevivableModules, m as hasForgedCookie, re as isBackgroundStopped, U as isBlockedFetchUrl, n as isBlockedFrameUrl, A as isExtensionExposed, l as isLocalNetworkUrl, a as isLocatorDenied, F as isLocatorInvalid, r as isLocatorUnsupported, z as isPermissionDenied, f as isTerminalError, j as isType, d as modifyRequestHeadersPermission, W as permissions, ne as promptInstall, y as readCookiePermission, J as readExtensionHandshake, h as removeRequestHeaderRule, H as revive, B as setMissingExtensionHandler, ee as setRequestHeaderRule, O as supportsOperation, R as type, G as waitForExtensionExposure };
|
package/fs/promises.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../fs-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../fs-DnF1cQuE.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,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-D9x6A-Gx.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;
|
package/fs/promises.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as e } from "../fs-
|
|
1
|
+
import { v as e } from "../fs-BY0Csn2V.js";
|
|
2
2
|
//#region src/fs/promises.ts
|
|
3
3
|
var { readFile: t, writeFile: n, appendFile: r, unlink: i, rename: a, readdir: o, mkdir: s, rm: c, rmdir: l, stat: u, lstat: d, access: f } = e, p = e;
|
|
4
4
|
//#endregion
|
package/fs-BY0Csn2V.js
ADDED
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
+
import { o as t, u as n } from "./api-ySazPAwN.js";
|
|
3
|
+
import { i as r } from "./busy-DsMWrSzc.js";
|
|
4
|
+
import { t as i } from "./node-fs-DY2fO5zd.js";
|
|
5
|
+
import { STORAGE_ACCOUNT_CHANGED as a, STORAGE_ACCOUNT_PIN_UNSUPPORTED as o } from "./messages.js";
|
|
6
|
+
import { _ as s, a as c, b as l, c as u, d as ee, f as d, g as te, h as f, l as ne, n as re, o as p, p as ie, t as ae } from "./storage-C6F9SnDM.js";
|
|
7
|
+
import { onChange as oe } from "./account.js";
|
|
8
|
+
import { a as se, i as m, n as h, o as g, t as ce } from "./opfs-D0goLAQW.js";
|
|
9
|
+
//#region src/fs/hybrid.ts
|
|
10
|
+
var le = /* @__PURE__ */ e({
|
|
11
|
+
adopt: () => V,
|
|
12
|
+
adoptable: () => U,
|
|
13
|
+
available: () => fe,
|
|
14
|
+
captureAccount: () => ue,
|
|
15
|
+
list: () => je,
|
|
16
|
+
onConflict: () => Le,
|
|
17
|
+
pending: () => we,
|
|
18
|
+
pendingDeletes: () => Te,
|
|
19
|
+
pull: () => Ie,
|
|
20
|
+
readFile: () => Me,
|
|
21
|
+
readFileSealed: () => Ne,
|
|
22
|
+
remove: () => Fe,
|
|
23
|
+
replicating: () => Ee,
|
|
24
|
+
writeFile: () => Pe
|
|
25
|
+
}), ue = p, de, _ = async () => await (de ??= ce().catch(() => !1)) ? !0 : (de = void 0, !1), v = () => c().catch(() => "unknown"), y = async () => await v() === "connected", fe = async () => await _() || await y(), pe = "fkn:fs:pending", me = "fkn:fs:pending-delete", he = "fkn:fs:adopt-declined", b = !0, ge = /* @__PURE__ */ new Map(), _e = null, ve = (e, t) => {
|
|
26
|
+
if (e === null) return !1;
|
|
27
|
+
if ("generation" in e && "generation" in t) return e.generation === t.generation;
|
|
28
|
+
let n = (e) => "pin" in e ? e.pin : ee(e), r = n(e);
|
|
29
|
+
return r !== void 0 && r === n(t);
|
|
30
|
+
}, x = (e, t) => ve(_e, t) ? ge.get(e) ?? null : null, S = (e) => e === "write" ? pe : me, C = (e) => {
|
|
31
|
+
try {
|
|
32
|
+
let t = localStorage.getItem(S(e));
|
|
33
|
+
if (!t) return {};
|
|
34
|
+
let n = JSON.parse(t);
|
|
35
|
+
if (Array.isArray(n)) return Object.fromEntries(n.filter((e) => typeof e == "string").map((e) => [e, {
|
|
36
|
+
base: null,
|
|
37
|
+
pin: null
|
|
38
|
+
}]));
|
|
39
|
+
if (!n || typeof n != "object") return {};
|
|
40
|
+
let r = {};
|
|
41
|
+
for (let [e, t] of Object.entries(n)) if (t === null || typeof t == "string") r[e] = {
|
|
42
|
+
base: t,
|
|
43
|
+
pin: null
|
|
44
|
+
};
|
|
45
|
+
else if (typeof t == "object") {
|
|
46
|
+
let { base: n, pin: i } = t;
|
|
47
|
+
r[e] = {
|
|
48
|
+
base: typeof n == "string" ? n : null,
|
|
49
|
+
pin: typeof i == "string" && i ? i : null
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
return r;
|
|
53
|
+
} catch {
|
|
54
|
+
return {};
|
|
55
|
+
}
|
|
56
|
+
}, w = (e, t) => {
|
|
57
|
+
try {
|
|
58
|
+
Object.keys(t).length ? localStorage.setItem(S(e), JSON.stringify(t)) : localStorage.removeItem(S(e));
|
|
59
|
+
} catch {}
|
|
60
|
+
}, ye = () => {
|
|
61
|
+
try {
|
|
62
|
+
let e = JSON.parse(localStorage.getItem(he) ?? "{}");
|
|
63
|
+
return e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
64
|
+
} catch {
|
|
65
|
+
return {};
|
|
66
|
+
}
|
|
67
|
+
}, T = /* @__PURE__ */ new Map(), be = (e) => "pin" in e ? e.pin : ee(e) ?? null, xe = (e, t, n, r) => {
|
|
68
|
+
let i = C(e), a = i[t], o = be(r);
|
|
69
|
+
a && o !== null && a.pin === o || (i[t] = {
|
|
70
|
+
base: a ? a.base : n,
|
|
71
|
+
pin: o
|
|
72
|
+
}, w(e, i), o === null && "generation" in r ? T.set(`${e}:${t}`, r) : T.delete(`${e}:${t}`));
|
|
73
|
+
}, Se = (e, t) => {
|
|
74
|
+
T.delete(`${e}:${t}`);
|
|
75
|
+
let n = C(e);
|
|
76
|
+
t in n && (delete n[t], w(e, n), M() || (P = N));
|
|
77
|
+
}, E = (e, t, n) => xe("write", e, t, n), D = (e) => Se("write", e), Ce = (e, t) => xe("delete", e, x(e, t), t), O = (e) => Se("delete", e), we = () => Object.keys(C("write")), Te = () => Object.keys(C("delete")), Ee = () => b, k = /* @__PURE__ */ new Map(), De = (e) => k.get(e) === p().generation, Oe = (e, t, n) => n.pin === null && !T.has(`${e}:${t}`), A = null, j = !1;
|
|
78
|
+
r("storage replication", () => A !== null || W !== null);
|
|
79
|
+
var M = () => ["write", "delete"].some((e) => Object.entries(C(e)).some(([t, n]) => n.pin === null ? !Oe(e, t, n) : !De(n.pin))), N = 6e4, ke = 6e5, P = N, F = null, I = () => {
|
|
80
|
+
!F && typeof window < "u" && M() && (F = setTimeout(() => {
|
|
81
|
+
F = null, L();
|
|
82
|
+
}, P), P = Math.min(P * 2, ke));
|
|
83
|
+
}, L = () => {
|
|
84
|
+
if (A) {
|
|
85
|
+
j = !0;
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
M() && (A = Ue(!1, p()).then((e) => {
|
|
89
|
+
if (!M()) {
|
|
90
|
+
P = N;
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
e.failed.length && I();
|
|
94
|
+
}).catch(() => {
|
|
95
|
+
I();
|
|
96
|
+
}).finally(() => {
|
|
97
|
+
A = null, Ae();
|
|
98
|
+
}));
|
|
99
|
+
}, Ae = () => {
|
|
100
|
+
j && (j = !1, L());
|
|
101
|
+
}, je = async (e) => {
|
|
102
|
+
let t = e?.pin ?? p();
|
|
103
|
+
q();
|
|
104
|
+
let n = await v(), r = n === "connected", [i, a] = await Promise.all([_().then((e) => e ? h() : []).catch(() => []), r ? d({ pin: t }).then((e) => ({
|
|
105
|
+
ok: !0,
|
|
106
|
+
entries: e
|
|
107
|
+
}), (e) => ({
|
|
108
|
+
ok: !1,
|
|
109
|
+
entries: [],
|
|
110
|
+
changed: u(e) ? e : void 0
|
|
111
|
+
})) : Promise.resolve({
|
|
112
|
+
ok: n === "disconnected",
|
|
113
|
+
entries: []
|
|
114
|
+
})]);
|
|
115
|
+
if (n !== "unknown" && (b = a.ok), a.ok && n !== "unknown" && (ge = new Map(a.entries.map((e) => [e.path, e.updatedAt])), _e = t), a.changed) throw a.changed;
|
|
116
|
+
let o = /* @__PURE__ */ new Map(), s = (e) => {
|
|
117
|
+
let t = Date.parse(e.updatedAt ?? "");
|
|
118
|
+
return Number.isFinite(t) ? t : 0;
|
|
119
|
+
}, c = (e) => {
|
|
120
|
+
let t = o.get(e.path);
|
|
121
|
+
(!t || s(e) >= s(t)) && o.set(e.path, e);
|
|
122
|
+
};
|
|
123
|
+
for (let e of i) c(e);
|
|
124
|
+
for (let e of a.entries) c(e);
|
|
125
|
+
return a.ok && r && (Xe(i, a.entries).catch(() => {}), M() ? L() : K({
|
|
126
|
+
local: i,
|
|
127
|
+
remote: a.entries,
|
|
128
|
+
from: t
|
|
129
|
+
}).catch(() => {})), [...o.values()];
|
|
130
|
+
}, Me = async (e, t) => {
|
|
131
|
+
let n = t?.pin ?? p();
|
|
132
|
+
if (await _()) try {
|
|
133
|
+
return await m(e);
|
|
134
|
+
} catch (e) {
|
|
135
|
+
if (e?.name !== "NotFoundError") throw e;
|
|
136
|
+
}
|
|
137
|
+
let r = await f(e, { pin: n });
|
|
138
|
+
return await _() && g(e, r).catch(() => {}), r;
|
|
139
|
+
}, Ne = async (e, t) => {
|
|
140
|
+
let n = t?.pin ?? p();
|
|
141
|
+
if (await _()) try {
|
|
142
|
+
let t = await m(e);
|
|
143
|
+
return {
|
|
144
|
+
data: new Uint8Array(await t.arrayBuffer()),
|
|
145
|
+
sealedAt: null
|
|
146
|
+
};
|
|
147
|
+
} catch (e) {
|
|
148
|
+
if (e?.name !== "NotFoundError") throw e;
|
|
149
|
+
}
|
|
150
|
+
return te(e, { pin: n });
|
|
151
|
+
}, Pe = async (e, t, n) => {
|
|
152
|
+
let r = n?.pin ?? p(), i = n?.contentType, a = i ? { contentType: i } : void 0, o = t instanceof Blob ? t : new Blob([t], a ? { type: a.contentType } : void 0);
|
|
153
|
+
if (await _()) {
|
|
154
|
+
await g(e, o, a), q();
|
|
155
|
+
let t = x(e, r), n = await v();
|
|
156
|
+
if (n === "disconnected") return;
|
|
157
|
+
if (n === "unknown" || !b) {
|
|
158
|
+
E(e, t, r), I();
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
l(e, o, {
|
|
162
|
+
...a,
|
|
163
|
+
pin: r
|
|
164
|
+
}).then(() => D(e)).catch((n) => {
|
|
165
|
+
E(e, t, r), u(n) || I(), console.warn("fs: cloud replicate failed, queued for adopt()", n);
|
|
166
|
+
});
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
let s = await v();
|
|
170
|
+
if (s === "connected") return l(e, o, {
|
|
171
|
+
...a,
|
|
172
|
+
pin: r
|
|
173
|
+
});
|
|
174
|
+
throw Error(s === "unknown" ? "fs: cloud unreachable" : "fs: no storage backend available");
|
|
175
|
+
}, Fe = async (e, t) => {
|
|
176
|
+
let n = t?.pin ?? p();
|
|
177
|
+
q();
|
|
178
|
+
let r = [];
|
|
179
|
+
await _() && r.push(se(e).catch(() => {}));
|
|
180
|
+
let i = await v();
|
|
181
|
+
if (i === "connected" ? r.push(s(e, { pin: n }).then(() => O(e)).catch((t) => {
|
|
182
|
+
Ce(e, n), u(t) || I(), console.warn("fs: cloud delete failed, queued for retry", t);
|
|
183
|
+
})) : i === "unknown" && r.length && x(e, n) !== null && (Ce(e, n), I()), !r.length) throw Error(i === "unknown" ? "fs: cloud unreachable" : "fs: no storage backend available");
|
|
184
|
+
D(e), await Promise.all(r);
|
|
185
|
+
}, Ie = async (e) => {
|
|
186
|
+
let t = p(), n = await f(e, { pin: t });
|
|
187
|
+
return await _() && await g(e, n), n;
|
|
188
|
+
}, R = null, Le = (e) => (R = e, () => {
|
|
189
|
+
R === e && (R = null);
|
|
190
|
+
}), Re = async (e) => {
|
|
191
|
+
let n = await (await t).cloud.fs.promptConflict({
|
|
192
|
+
path: e.path,
|
|
193
|
+
local: e.local,
|
|
194
|
+
cloud: e.cloud
|
|
195
|
+
}).catch(() => null);
|
|
196
|
+
return n === "local" ? e.readLocal() : n === "cloud" ? e.readCloud() : null;
|
|
197
|
+
}, ze = async (e) => {
|
|
198
|
+
if (R) try {
|
|
199
|
+
return await R(e);
|
|
200
|
+
} catch {
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
return Re(e);
|
|
204
|
+
}, z = class extends Error {}, B = (e) => e instanceof Error ? e.message : String(e), Be = () => {
|
|
205
|
+
let e = /* @__PURE__ */ new Map(), t = (t) => {
|
|
206
|
+
let n = e.get(t);
|
|
207
|
+
return n || e.set(t, n = {
|
|
208
|
+
writes: /* @__PURE__ */ new Map(),
|
|
209
|
+
deletes: /* @__PURE__ */ new Map()
|
|
210
|
+
}), n;
|
|
211
|
+
};
|
|
212
|
+
for (let [e, n] of Object.entries(C("write"))) t(n.pin).writes.set(e, n.base);
|
|
213
|
+
for (let [e, n] of Object.entries(C("delete"))) t(n.pin).deletes.set(e, n.base);
|
|
214
|
+
return e;
|
|
215
|
+
}, Ve = async () => {
|
|
216
|
+
for (let [e, t] of [...T]) {
|
|
217
|
+
let n = e.startsWith("write:") ? "write" : "delete", r = e.slice(n.length + 1), i;
|
|
218
|
+
try {
|
|
219
|
+
i = await ie(t);
|
|
220
|
+
} catch (t) {
|
|
221
|
+
u(t) && T.delete(e);
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
if (T.get(e) !== t) continue;
|
|
225
|
+
T.delete(e);
|
|
226
|
+
let a = C(n), o = a[r];
|
|
227
|
+
o && o.pin === null && (a[r] = {
|
|
228
|
+
base: o.base,
|
|
229
|
+
pin: i
|
|
230
|
+
}, w(n, a));
|
|
231
|
+
}
|
|
232
|
+
}, He = async (e, t, n, r, i, a) => {
|
|
233
|
+
let o = new Map(t.map((e) => [e.path, e])), c = (e) => {
|
|
234
|
+
if (u(e)) throw new z();
|
|
235
|
+
};
|
|
236
|
+
for (let [t, a] of e.deletes) {
|
|
237
|
+
let e = o.get(t);
|
|
238
|
+
if (!e) {
|
|
239
|
+
O(t);
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
if (r.some((e) => e.path === t)) {
|
|
243
|
+
O(t);
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
246
|
+
if (e.updatedAt !== a) {
|
|
247
|
+
O(t);
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
try {
|
|
251
|
+
await s(t, n), O(t), i.deleted.push(t);
|
|
252
|
+
} catch (e) {
|
|
253
|
+
c(e), i.failed.push({
|
|
254
|
+
path: t,
|
|
255
|
+
error: B(e)
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
for (let t of r) {
|
|
260
|
+
let r = o.get(t.path), s = e.writes.has(t.path);
|
|
261
|
+
if (!s) {
|
|
262
|
+
if (!a(t)) continue;
|
|
263
|
+
if (r) {
|
|
264
|
+
i.kept.push(t.path);
|
|
265
|
+
continue;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
let u = e.writes.get(t.path) ?? null;
|
|
269
|
+
if (s && r && r.updatedAt !== u) {
|
|
270
|
+
let e = null, a = null, o = await ze({
|
|
271
|
+
path: t.path,
|
|
272
|
+
local: {
|
|
273
|
+
size: t.size,
|
|
274
|
+
updatedAt: t.updatedAt
|
|
275
|
+
},
|
|
276
|
+
cloud: {
|
|
277
|
+
size: r.size,
|
|
278
|
+
updatedAt: r.updatedAt
|
|
279
|
+
},
|
|
280
|
+
readLocal: () => e ??= m(t.path),
|
|
281
|
+
readCloud: () => a ??= f(t.path, n)
|
|
282
|
+
});
|
|
283
|
+
if (o == null) {
|
|
284
|
+
i.unresolved.push(t.path);
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
try {
|
|
288
|
+
let r = e !== null && o === await e, s = a !== null && o === await a;
|
|
289
|
+
s || await l(t.path, o, t.contentType ? {
|
|
290
|
+
contentType: t.contentType,
|
|
291
|
+
...n
|
|
292
|
+
} : n), r || await g(t.path, o), D(t.path), i.resolved.push({
|
|
293
|
+
path: t.path,
|
|
294
|
+
choice: r ? "local" : s ? "cloud" : "merged"
|
|
295
|
+
});
|
|
296
|
+
} catch (e) {
|
|
297
|
+
if (c(e), e?.code === "FKN_E2E_LOCKED") throw e;
|
|
298
|
+
i.failed.push({
|
|
299
|
+
path: t.path,
|
|
300
|
+
error: B(e)
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
continue;
|
|
304
|
+
}
|
|
305
|
+
try {
|
|
306
|
+
let e = await m(t.path);
|
|
307
|
+
await l(t.path, e, t.contentType ? {
|
|
308
|
+
contentType: t.contentType,
|
|
309
|
+
...n
|
|
310
|
+
} : n), D(t.path), i.uploaded.push(t.path);
|
|
311
|
+
} catch (e) {
|
|
312
|
+
if (s || E(t.path, r?.updatedAt ?? null, n.pin), c(e), e?.code === "FKN_E2E_LOCKED") throw e;
|
|
313
|
+
i.failed.push({
|
|
314
|
+
path: t.path,
|
|
315
|
+
error: B(e)
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}, Ue = async (e, t) => {
|
|
320
|
+
let n = {
|
|
321
|
+
uploaded: [],
|
|
322
|
+
kept: [],
|
|
323
|
+
resolved: [],
|
|
324
|
+
unresolved: [],
|
|
325
|
+
deleted: [],
|
|
326
|
+
failed: []
|
|
327
|
+
}, r = await v();
|
|
328
|
+
if (r === "unknown") throw Error("fs: cloud unreachable");
|
|
329
|
+
if (r !== "connected") throw Error("fs: this needs a signed-in account");
|
|
330
|
+
let i = await _(), a = i ? await h() : [];
|
|
331
|
+
if (i) for (let e of Object.keys(C("write"))) a.some((t) => t.path === e) || D(e);
|
|
332
|
+
await Ve();
|
|
333
|
+
for (let [e, r] of Be()) {
|
|
334
|
+
if (e === null || De(e)) continue;
|
|
335
|
+
let i = { pin: { pin: e } }, o;
|
|
336
|
+
try {
|
|
337
|
+
o = await d(i);
|
|
338
|
+
} catch (n) {
|
|
339
|
+
if (u(n)) {
|
|
340
|
+
k.set(e, t.generation);
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
if (ne(n)) {
|
|
344
|
+
We(e);
|
|
345
|
+
continue;
|
|
346
|
+
}
|
|
347
|
+
throw n;
|
|
348
|
+
}
|
|
349
|
+
try {
|
|
350
|
+
await He(r, o, i, a, n, () => !1);
|
|
351
|
+
} catch (n) {
|
|
352
|
+
if (!(n instanceof z)) throw n;
|
|
353
|
+
k.set(e, t.generation);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
if (e) {
|
|
357
|
+
let e = { pin: t }, r = await d(e), i = C("write"), o = Be().get(null) ?? {
|
|
358
|
+
writes: /* @__PURE__ */ new Map(),
|
|
359
|
+
deletes: /* @__PURE__ */ new Map()
|
|
360
|
+
}, s = /* @__PURE__ */ new Set([
|
|
361
|
+
...n.uploaded,
|
|
362
|
+
...n.resolved.map(({ path: e }) => e),
|
|
363
|
+
...n.unresolved,
|
|
364
|
+
...n.failed.map(({ path: e }) => e)
|
|
365
|
+
]), c = (e) => !(e.path in i) && !s.has(e.path);
|
|
366
|
+
try {
|
|
367
|
+
await He(o, r, e, a, n, c);
|
|
368
|
+
} catch (e) {
|
|
369
|
+
throw e instanceof z ? new ae() : e;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
return n;
|
|
373
|
+
}, We = (e) => {
|
|
374
|
+
for (let t of ["write", "delete"]) {
|
|
375
|
+
let n = C(t), r = !1;
|
|
376
|
+
for (let t of Object.values(n)) t.pin === e && (t.pin = null, r = !0);
|
|
377
|
+
r && w(t, n);
|
|
378
|
+
}
|
|
379
|
+
}, Ge = async (e) => {
|
|
380
|
+
for (; A;) await A;
|
|
381
|
+
let t = Ue(!0, e);
|
|
382
|
+
A = t.then(() => {}, () => {});
|
|
383
|
+
try {
|
|
384
|
+
return await t;
|
|
385
|
+
} finally {
|
|
386
|
+
A = null, Ae();
|
|
387
|
+
}
|
|
388
|
+
}, V = () => Ge(p()), H = (e, t) => {
|
|
389
|
+
let n = new Set(t.map((e) => e.path)), r = C("write");
|
|
390
|
+
return e.filter((e) => {
|
|
391
|
+
let t = r[e.path];
|
|
392
|
+
return t ? Oe("write", e.path, t) : !n.has(e.path);
|
|
393
|
+
});
|
|
394
|
+
}, U = async () => {
|
|
395
|
+
let e = p();
|
|
396
|
+
if (!await y() || !await _()) return {
|
|
397
|
+
paths: [],
|
|
398
|
+
bytes: 0
|
|
399
|
+
};
|
|
400
|
+
let [t, n] = await Promise.all([h(), d({ pin: e })]), r = H(t, n);
|
|
401
|
+
return {
|
|
402
|
+
paths: r.map((e) => e.path),
|
|
403
|
+
bytes: r.reduce((e, t) => e + t.size, 0)
|
|
404
|
+
};
|
|
405
|
+
}, Ke = () => new Set(Object.keys(ye())), qe = (e) => {
|
|
406
|
+
let t = ye();
|
|
407
|
+
for (let n of e) t[n] = null;
|
|
408
|
+
try {
|
|
409
|
+
localStorage.setItem(he, JSON.stringify(t));
|
|
410
|
+
} catch {}
|
|
411
|
+
}, W = null, G = !1, K = (e) => {
|
|
412
|
+
if (W) return G = !0, W;
|
|
413
|
+
let n = e?.from ?? p();
|
|
414
|
+
return W = (async () => {
|
|
415
|
+
if (!await y()) return;
|
|
416
|
+
let r = e ?? (await _() ? {
|
|
417
|
+
local: await h(),
|
|
418
|
+
remote: await d({ pin: n })
|
|
419
|
+
} : null);
|
|
420
|
+
if (!r) return;
|
|
421
|
+
let i = Ke(), a = H(r.local, r.remote).filter((e) => !i.has(e.path));
|
|
422
|
+
if (!a.length) return;
|
|
423
|
+
let o = await t, s = a.reduce((e, t) => e + t.size, 0);
|
|
424
|
+
if (!await o.cloud.fs.promptAdopt({
|
|
425
|
+
files: a.length,
|
|
426
|
+
bytes: s
|
|
427
|
+
}).catch(() => !1)) {
|
|
428
|
+
qe(a.map((e) => e.path));
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
"generation" in n && await Ge(n);
|
|
432
|
+
})().catch(() => {}).finally(() => {
|
|
433
|
+
W = null, G && (G = !1, K());
|
|
434
|
+
}), W;
|
|
435
|
+
}, Je = null, Ye = !1, Xe = async (e, r) => {
|
|
436
|
+
let i = H(e, r), a = await t, o = async () => {
|
|
437
|
+
await V().catch(() => {});
|
|
438
|
+
let e = await U().catch(() => ({
|
|
439
|
+
paths: [],
|
|
440
|
+
bytes: 0
|
|
441
|
+
}));
|
|
442
|
+
await a.cloud.fs.setAdoptSource({
|
|
443
|
+
files: e.paths.length,
|
|
444
|
+
bytes: e.bytes
|
|
445
|
+
}, o).catch(() => {});
|
|
446
|
+
}, s = {
|
|
447
|
+
files: i.length,
|
|
448
|
+
bytes: i.reduce((e, t) => e + t.size, 0)
|
|
449
|
+
};
|
|
450
|
+
Je = () => {
|
|
451
|
+
a.cloud.fs.setAdoptSource(s, o).catch(() => {});
|
|
452
|
+
}, Ye || (Ye = !0, n((e, t) => {
|
|
453
|
+
t > 1 && Je?.();
|
|
454
|
+
})), await a.cloud.fs.setAdoptSource(s, o);
|
|
455
|
+
}, Ze = !1, q = () => {
|
|
456
|
+
Ze || typeof window > "u" || (Ze = !0, window.addEventListener("online", () => {
|
|
457
|
+
L();
|
|
458
|
+
}), oe(() => {
|
|
459
|
+
K().catch(() => {}), L();
|
|
460
|
+
}).catch(() => {}));
|
|
461
|
+
}, Qe = /* @__PURE__ */ e({
|
|
462
|
+
STORAGE_ACCOUNT_CHANGED: () => a,
|
|
463
|
+
STORAGE_ACCOUNT_PIN_UNSUPPORTED: () => o,
|
|
464
|
+
StorageAccountChangedError: () => ae,
|
|
465
|
+
StorageAccountPinUnsupportedError: () => re,
|
|
466
|
+
adopt: () => X,
|
|
467
|
+
adoptable: () => Z,
|
|
468
|
+
appendFile: () => ht,
|
|
469
|
+
appendFileSync: () => rt,
|
|
470
|
+
available: () => et,
|
|
471
|
+
default: () => kt,
|
|
472
|
+
exists: () => St,
|
|
473
|
+
existsSync: () => it,
|
|
474
|
+
flush: () => Tt,
|
|
475
|
+
isAccountChanged: () => u,
|
|
476
|
+
lstatSync: () => ot,
|
|
477
|
+
mkdir: () => vt,
|
|
478
|
+
mkdirSync: () => ct,
|
|
479
|
+
mount: () => wt,
|
|
480
|
+
onConflict: () => Ot,
|
|
481
|
+
pending: () => Q,
|
|
482
|
+
pendingDeletes: () => $,
|
|
483
|
+
promises: () => Ct,
|
|
484
|
+
pull: () => J,
|
|
485
|
+
readFile: () => pt,
|
|
486
|
+
readFileSealed: () => Y,
|
|
487
|
+
readFileSync: () => tt,
|
|
488
|
+
readdir: () => _t,
|
|
489
|
+
readdirSync: () => st,
|
|
490
|
+
remount: () => Et,
|
|
491
|
+
rename: () => xt,
|
|
492
|
+
renameSync: () => ft,
|
|
493
|
+
replicating: () => Dt,
|
|
494
|
+
rm: () => yt,
|
|
495
|
+
rmSync: () => lt,
|
|
496
|
+
rmdirSync: () => ut,
|
|
497
|
+
stat: () => gt,
|
|
498
|
+
statSync: () => at,
|
|
499
|
+
unlink: () => bt,
|
|
500
|
+
unlinkSync: () => dt,
|
|
501
|
+
writeFile: () => mt,
|
|
502
|
+
writeFileSync: () => nt
|
|
503
|
+
}), $e = i(le, { memfs: !0 }), { available: et, readFileSync: tt, writeFileSync: nt, appendFileSync: rt, existsSync: it, statSync: at, lstatSync: ot, readdirSync: st, mkdirSync: ct, rmSync: lt, rmdirSync: ut, unlinkSync: dt, renameSync: ft, readFile: pt, writeFile: mt, appendFile: ht, stat: gt, readdir: _t, mkdir: vt, rm: yt, unlink: bt, rename: xt, exists: St, promises: Ct, mount: wt, flush: Tt, remount: Et } = $e, J = Ie, Y = Ne, X = V, Z = U, Q = we, $ = Te, Dt = Ee, Ot = Le, kt = {
|
|
504
|
+
...$e,
|
|
505
|
+
pull: J,
|
|
506
|
+
readFileSealed: Y,
|
|
507
|
+
adopt: X,
|
|
508
|
+
adoptable: Z,
|
|
509
|
+
pending: Q,
|
|
510
|
+
pendingDeletes: $,
|
|
511
|
+
replicating: Dt,
|
|
512
|
+
onConflict: Ot
|
|
513
|
+
};
|
|
514
|
+
//#endregion
|
|
515
|
+
export { lt as A, _t as C, ft as D, xt as E, dt as F, mt as I, nt as L, gt as M, at as N, Dt as O, bt as P, tt as S, Et as T, $ as _, et as a, pt as b, Tt as c, ot as d, vt as f, Q as g, Ot as h, rt as i, ut as j, yt as k, kt as l, wt as m, Z as n, St as o, ct as p, ht as r, it as s, X as t, Qe as u, Ct as v, st as w, Y as x, J as y };
|
package/fs-DnF1cQuE.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-DMnVye0K.cjs"),n=require("./busy-BXbVH595.cjs"),r=require("./node-fs-vsWuoMGa.cjs"),i=require("./messages.cjs"),a=require("./storage-DmRIhg1P.cjs"),o=require("./account.cjs"),s=require("./opfs-CXMESVLc.cjs");var c=e.t({adopt:()=>L,adoptable:()=>z,available:()=>ee,captureAccount:()=>l,list:()=>ye,onConflict:()=>Ce,pending:()=>fe,pendingDeletes:()=>pe,pull:()=>N,readFile:()=>be,readFileSealed:()=>M,remove:()=>Se,replicating:()=>me,writeFile:()=>xe}),l=a.o,u,d=async()=>await(u??=s.t().catch(()=>!1))?!0:(u=void 0,!1),f=()=>a.a().catch(()=>`unknown`),p=async()=>await f()===`connected`,ee=async()=>await d()||await p(),te=`fkn:fs:pending`,ne=`fkn:fs:pending-delete`,re=`fkn:fs:adopt-declined`,m=!0,ie=new Map,ae=null,oe=(e,t)=>{if(e===null)return!1;if(`generation`in e&&`generation`in t)return e.generation===t.generation;let n=e=>`pin`in e?e.pin:a.d(e),r=n(e);return r!==void 0&&r===n(t)},h=(e,t)=>oe(ae,t)?ie.get(e)??null:null,g=e=>e===`write`?te:ne,_=e=>{try{let t=localStorage.getItem(g(e));if(!t)return{};let n=JSON.parse(t);if(Array.isArray(n))return Object.fromEntries(n.filter(e=>typeof e==`string`).map(e=>[e,{base:null,pin:null}]));if(!n||typeof n!=`object`)return{};let r={};for(let[e,t]of Object.entries(n))if(t===null||typeof t==`string`)r[e]={base:t,pin:null};else if(typeof t==`object`){let{base:n,pin:i}=t;r[e]={base:typeof n==`string`?n:null,pin:typeof i==`string`&&i?i:null}}return r}catch{return{}}},v=(e,t)=>{try{Object.keys(t).length?localStorage.setItem(g(e),JSON.stringify(t)):localStorage.removeItem(g(e))}catch{}},se=()=>{try{let e=JSON.parse(localStorage.getItem(re)??`{}`);return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}catch{return{}}},y=new Map,ce=e=>`pin`in e?e.pin:a.d(e)??null,le=(e,t,n,r)=>{let i=_(e),a=i[t],o=ce(r);a&&o!==null&&a.pin===o||(i[t]={base:a?a.base:n,pin:o},v(e,i),o===null&&`generation`in r?y.set(`${e}:${t}`,r):y.delete(`${e}:${t}`))},ue=(e,t)=>{y.delete(`${e}:${t}`);let n=_(e);t in n&&(delete n[t],v(e,n),E()||(O=D))},b=(e,t,n)=>le(`write`,e,t,n),x=e=>ue(`write`,e),de=(e,t)=>le(`delete`,e,h(e,t),t),S=e=>ue(`delete`,e),fe=()=>Object.keys(_(`write`)),pe=()=>Object.keys(_(`delete`)),me=()=>m,C=new Map,he=e=>C.get(e)===a.o().generation,ge=(e,t,n)=>n.pin===null&&!y.has(`${e}:${t}`),w=null,T=!1;n.i(`storage replication`,()=>w!==null||B!==null);var E=()=>[`write`,`delete`].some(e=>Object.entries(_(e)).some(([t,n])=>n.pin===null?!ge(e,t,n):!he(n.pin))),D=6e4,_e=6e5,O=D,k=null,A=()=>{!k&&typeof window<`u`&&E()&&(k=setTimeout(()=>{k=null,j()},O),O=Math.min(O*2,_e))},j=()=>{if(w){T=!0;return}E()&&(w=ke(!1,a.o()).then(e=>{if(!E()){O=D;return}e.failed.length&&A()}).catch(()=>{A()}).finally(()=>{w=null,ve()}))},ve=()=>{T&&(T=!1,j())},ye=async e=>{let t=e?.pin??a.o();U();let n=await f(),r=n===`connected`,[i,o]=await Promise.all([d().then(e=>e?s.n():[]).catch(()=>[]),r?a.f({pin:t}).then(e=>({ok:!0,entries:e}),e=>({ok:!1,entries:[],changed:a.c(e)?e:void 0})):Promise.resolve({ok:n===`disconnected`,entries:[]})]);if(n!==`unknown`&&(m=o.ok),o.ok&&n!==`unknown`&&(ie=new Map(o.entries.map(e=>[e.path,e.updatedAt])),ae=t),o.changed)throw o.changed;let c=new Map,l=e=>{let t=Date.parse(e.updatedAt??``);return Number.isFinite(t)?t:0},u=e=>{let t=c.get(e.path);(!t||l(e)>=l(t))&&c.set(e.path,e)};for(let e of i)u(e);for(let e of o.entries)u(e);return o.ok&&r&&(Ie(i,o.entries).catch(()=>{}),E()?j():H({local:i,remote:o.entries,from:t}).catch(()=>{})),[...c.values()]},be=async(e,t)=>{let n=t?.pin??a.o();if(await d())try{return await s.i(e)}catch(e){if(e?.name!==`NotFoundError`)throw e}let r=await a.h(e,{pin:n});return await d()&&s.o(e,r).catch(()=>{}),r},M=async(e,t)=>{let n=t?.pin??a.o();if(await d())try{let t=await s.i(e);return{data:new Uint8Array(await t.arrayBuffer()),sealedAt:null}}catch(e){if(e?.name!==`NotFoundError`)throw e}return a.g(e,{pin:n})},xe=async(e,t,n)=>{let r=n?.pin??a.o(),i=n?.contentType,o=i?{contentType:i}:void 0,c=t instanceof Blob?t:new Blob([t],o?{type:o.contentType}:void 0);if(await d()){await s.o(e,c,o),U();let t=h(e,r),n=await f();if(n===`disconnected`)return;if(n===`unknown`||!m){b(e,t,r),A();return}a.b(e,c,{...o,pin:r}).then(()=>x(e)).catch(n=>{b(e,t,r),a.c(n)||A(),console.warn(`fs: cloud replicate failed, queued for adopt()`,n)});return}let l=await f();if(l===`connected`)return a.b(e,c,{...o,pin:r});throw Error(l===`unknown`?`fs: cloud unreachable`:`fs: no storage backend available`)},Se=async(e,t)=>{let n=t?.pin??a.o();U();let r=[];await d()&&r.push(s.a(e).catch(()=>{}));let i=await f();if(i===`connected`?r.push(a._(e,{pin:n}).then(()=>S(e)).catch(t=>{de(e,n),a.c(t)||A(),console.warn(`fs: cloud delete failed, queued for retry`,t)})):i===`unknown`&&r.length&&h(e,n)!==null&&(de(e,n),A()),!r.length)throw Error(i===`unknown`?`fs: cloud unreachable`:`fs: no storage backend available`);x(e),await Promise.all(r)},N=async e=>{let t=a.o(),n=await a.h(e,{pin:t});return await d()&&await s.o(e,n),n},P=null,Ce=e=>(P=e,()=>{P===e&&(P=null)}),we=async e=>{let n=await(await t.o).cloud.fs.promptConflict({path:e.path,local:e.local,cloud:e.cloud}).catch(()=>null);return n===`local`?e.readLocal():n===`cloud`?e.readCloud():null},Te=async e=>{if(P)try{return await P(e)}catch{return null}return we(e)},F=class extends Error{},I=e=>e instanceof Error?e.message:String(e),Ee=()=>{let e=new Map,t=t=>{let n=e.get(t);return n||e.set(t,n={writes:new Map,deletes:new Map}),n};for(let[e,n]of Object.entries(_(`write`)))t(n.pin).writes.set(e,n.base);for(let[e,n]of Object.entries(_(`delete`)))t(n.pin).deletes.set(e,n.base);return e},De=async()=>{for(let[e,t]of[...y]){let n=e.startsWith(`write:`)?`write`:`delete`,r=e.slice(n.length+1),i;try{i=await a.p(t)}catch(t){a.c(t)&&y.delete(e);continue}if(y.get(e)!==t)continue;y.delete(e);let o=_(n),s=o[r];s&&s.pin===null&&(o[r]={base:s.base,pin:i},v(n,o))}},Oe=async(e,t,n,r,i,o)=>{let c=new Map(t.map(e=>[e.path,e])),l=e=>{if(a.c(e))throw new F};for(let[t,o]of e.deletes){let e=c.get(t);if(!e){S(t);continue}if(r.some(e=>e.path===t)){S(t);continue}if(e.updatedAt!==o){S(t);continue}try{await a._(t,n),S(t),i.deleted.push(t)}catch(e){l(e),i.failed.push({path:t,error:I(e)})}}for(let t of r){let r=c.get(t.path),u=e.writes.has(t.path);if(!u){if(!o(t))continue;if(r){i.kept.push(t.path);continue}}let d=e.writes.get(t.path)??null;if(u&&r&&r.updatedAt!==d){let e=null,o=null,c=await Te({path:t.path,local:{size:t.size,updatedAt:t.updatedAt},cloud:{size:r.size,updatedAt:r.updatedAt},readLocal:()=>e??=s.i(t.path),readCloud:()=>o??=a.h(t.path,n)});if(c==null){i.unresolved.push(t.path);continue}try{let r=e!==null&&c===await e,l=o!==null&&c===await o;l||await a.b(t.path,c,t.contentType?{contentType:t.contentType,...n}:n),r||await s.o(t.path,c),x(t.path),i.resolved.push({path:t.path,choice:r?`local`:l?`cloud`:`merged`})}catch(e){if(l(e),e?.code===`FKN_E2E_LOCKED`)throw e;i.failed.push({path:t.path,error:I(e)})}continue}try{let e=await s.i(t.path);await a.b(t.path,e,t.contentType?{contentType:t.contentType,...n}:n),x(t.path),i.uploaded.push(t.path)}catch(e){if(u||b(t.path,r?.updatedAt??null,n.pin),l(e),e?.code===`FKN_E2E_LOCKED`)throw e;i.failed.push({path:t.path,error:I(e)})}}},ke=async(e,t)=>{let n={uploaded:[],kept:[],resolved:[],unresolved:[],deleted:[],failed:[]},r=await f();if(r===`unknown`)throw Error(`fs: cloud unreachable`);if(r!==`connected`)throw Error(`fs: this needs a signed-in account`);let i=await d(),o=i?await s.n():[];if(i)for(let e of Object.keys(_(`write`)))o.some(t=>t.path===e)||x(e);await De();for(let[e,r]of Ee()){if(e===null||he(e))continue;let i={pin:{pin:e}},s;try{s=await a.f(i)}catch(n){if(a.c(n)){C.set(e,t.generation);continue}if(a.l(n)){Ae(e);continue}throw n}try{await Oe(r,s,i,o,n,()=>!1)}catch(n){if(!(n instanceof F))throw n;C.set(e,t.generation)}}if(e){let e={pin:t},r=await a.f(e),i=_(`write`),s=Ee().get(null)??{writes:new Map,deletes:new Map},c=new Set([...n.uploaded,...n.resolved.map(({path:e})=>e),...n.unresolved,...n.failed.map(({path:e})=>e)]),l=e=>!(e.path in i)&&!c.has(e.path);try{await Oe(s,r,e,o,n,l)}catch(e){throw e instanceof F?new a.t:e}}return n},Ae=e=>{for(let t of[`write`,`delete`]){let n=_(t),r=!1;for(let t of Object.values(n))t.pin===e&&(t.pin=null,r=!0);r&&v(t,n)}},je=async e=>{for(;w;)await w;let t=ke(!0,e);w=t.then(()=>{},()=>{});try{return await t}finally{w=null,ve()}},L=()=>je(a.o()),R=(e,t)=>{let n=new Set(t.map(e=>e.path)),r=_(`write`);return e.filter(e=>{let t=r[e.path];return t?ge(`write`,e.path,t):!n.has(e.path)})},z=async()=>{let e=a.o();if(!await p()||!await d())return{paths:[],bytes:0};let[t,n]=await Promise.all([s.n(),a.f({pin:e})]),r=R(t,n);return{paths:r.map(e=>e.path),bytes:r.reduce((e,t)=>e+t.size,0)}},Me=()=>new Set(Object.keys(se())),Ne=e=>{let t=se();for(let n of e)t[n]=null;try{localStorage.setItem(re,JSON.stringify(t))}catch{}},B=null,V=!1,H=e=>{if(B)return V=!0,B;let n=e?.from??a.o();return B=(async()=>{if(!await p())return;let r=e??(await d()?{local:await s.n(),remote:await a.f({pin:n})}:null);if(!r)return;let i=Me(),o=R(r.local,r.remote).filter(e=>!i.has(e.path));if(!o.length)return;let c=await t.o,l=o.reduce((e,t)=>e+t.size,0);if(!await c.cloud.fs.promptAdopt({files:o.length,bytes:l}).catch(()=>!1)){Ne(o.map(e=>e.path));return}`generation`in n&&await je(n)})().catch(()=>{}).finally(()=>{B=null,V&&(V=!1,H())}),B},Pe=null,Fe=!1,Ie=async(e,n)=>{let r=R(e,n),i=await t.o,a=async()=>{await L().catch(()=>{});let e=await z().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)};Pe=()=>{i.cloud.fs.setAdoptSource(o,a).catch(()=>{})},Fe||(Fe=!0,t.u((e,t)=>{t>1&&Pe?.()})),await i.cloud.fs.setAdoptSource(o,a)},Le=!1,U=()=>{Le||typeof window>`u`||(Le=!0,window.addEventListener(`online`,()=>{j()}),o.onChange(()=>{H().catch(()=>{}),j()}).catch(()=>{}))},Re=e.t({STORAGE_ACCOUNT_CHANGED:()=>i.STORAGE_ACCOUNT_CHANGED,STORAGE_ACCOUNT_PIN_UNSUPPORTED:()=>i.STORAGE_ACCOUNT_PIN_UNSUPPORTED,StorageAccountChangedError:()=>a.t,StorageAccountPinUnsupportedError:()=>a.n,adopt:()=>q,adoptable:()=>J,appendFile:()=>tt,appendFileSync:()=>Ue,available:()=>Be,default:()=>$,exists:()=>ct,existsSync:()=>We,flush:()=>W,isAccountChanged:()=>a.c,lstatSync:()=>Ke,mkdir:()=>it,mkdirSync:()=>Je,mount:()=>ut,onConflict:()=>Q,pending:()=>Y,pendingDeletes:()=>X,promises:()=>lt,pull:()=>G,readFile:()=>$e,readFileSealed:()=>K,readFileSync:()=>Ve,readdir:()=>rt,readdirSync:()=>qe,remount:()=>dt,rename:()=>st,renameSync:()=>Qe,replicating:()=>Z,rm:()=>at,rmSync:()=>Ye,rmdirSync:()=>Xe,stat:()=>nt,statSync:()=>Ge,unlink:()=>ot,unlinkSync:()=>Ze,writeFile:()=>et,writeFileSync:()=>He}),ze=r.t(c,{memfs:!0}),{available:Be,readFileSync:Ve,writeFileSync:He,appendFileSync:Ue,existsSync:We,statSync:Ge,lstatSync:Ke,readdirSync:qe,mkdirSync:Je,rmSync:Ye,rmdirSync:Xe,unlinkSync:Ze,renameSync:Qe,readFile:$e,writeFile:et,appendFile:tt,stat:nt,readdir:rt,mkdir:it,rm:at,unlink:ot,rename:st,exists:ct,promises:lt,mount:ut,flush:W,remount:dt}=ze,G=N,K=M,q=L,J=z,Y=fe,X=pe,Z=me,Q=Ce,$={...ze,pull:G,readFileSealed:K,adopt:q,adoptable:J,pending:Y,pendingDeletes:X,replicating:Z,onConflict:Q};Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return rt}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return st}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return et}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return He}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return it}}),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 Ue}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return at}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return ct}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return We}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return G}});
|
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
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-B_mXNAdB.js";
|
|
3
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 };
|
package/fs.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./messages.cjs"),t=require("./storage-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./messages.cjs"),t=require("./storage-DmRIhg1P.cjs"),n=require("./fs-DnF1cQuE.cjs");exports.STORAGE_ACCOUNT_CHANGED=e.STORAGE_ACCOUNT_CHANGED,exports.STORAGE_ACCOUNT_PIN_UNSUPPORTED=e.STORAGE_ACCOUNT_PIN_UNSUPPORTED,exports.StorageAccountChangedError=t.t,exports.StorageAccountPinUnsupportedError=t.n,exports.adopt=n.t,exports.adoptable=n.n,exports.appendFile=n.r,exports.appendFileSync=n.i,exports.available=n.a,exports.default=n.l,exports.exists=n.o,exports.existsSync=n.s,exports.flush=n.c,exports.isAccountChanged=t.c,exports.lstatSync=n.d,exports.mkdir=n.f,exports.mkdirSync=n.p,exports.mount=n.m,exports.onConflict=n.h,exports.pending=n.g,exports.pendingDeletes=n._,exports.promises=n.v,exports.pull=n.y,exports.readFile=n.b,exports.readFileSealed=n.x,exports.readFileSync=n.S,exports.readdir=n.C,exports.readdirSync=n.w,exports.remount=n.T,exports.rename=n.E,exports.renameSync=n.D,exports.replicating=n.O,exports.rm=n.k,exports.rmSync=n.A,exports.rmdirSync=n.j,exports.stat=n.M,exports.statSync=n.N,exports.unlink=n.P,exports.unlinkSync=n.F,exports.writeFile=n.I,exports.writeFileSync=n.L;
|
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-
|
|
2
|
+
import { a as StorageAccountChangedError, i as SealedRead, o as StorageAccountPinUnsupportedError, p as isAccountChanged } from "./storage-B_mXNAdB.js";
|
|
3
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-
|
|
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-D9x6A-Gx.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 };
|