@fkn/lib 0.9.39 → 0.9.41
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-CSnZiN18.cjs +1 -0
- package/account-generation-D7TpIoKt.js +28 -0
- package/account.cjs +1 -1
- package/account.d.ts +11 -0
- package/account.js +5 -17
- package/{api-BxXnHxbd.d.ts → api-Cbty0JUM.d.ts} +15 -13
- package/api.d.ts +2 -2
- package/cloud/dns.d.ts +1 -1
- package/cloud/fetch.d.ts +1 -1
- package/cloud/fs/promises.d.ts +1 -1
- package/cloud/fs.cjs +1 -1
- package/cloud/fs.d.ts +4 -4
- package/cloud/fs.js +31 -24
- package/cloud/net.d.ts +1 -1
- package/{cloud-B8QYSmW3.d.ts → cloud-4t1WoEZn.d.ts} +3 -3
- package/{cloud-oMACx7NL.js → cloud-BLv19j-W.js} +200 -196
- package/cloud-D7aQY4GH.cjs +1 -0
- package/cloud.cjs +1 -1
- package/cloud.d.ts +4 -4
- package/cloud.js +1 -1
- package/{contract-sDmsw-9f.d.ts → contract-BRc2ptdC.d.ts} +33 -10
- package/contract.d.ts +2 -2
- package/dgram.d.ts +2 -2
- package/dns.d.ts +1 -1
- package/extension-B9v933cT.js +89 -0
- package/extension-D2zMdc2f.cjs +1 -0
- package/extension.cjs +1 -1
- package/extension.js +3 -3
- package/fs/promises.cjs +1 -1
- package/fs/promises.d.ts +1 -1
- package/fs/promises.js +1 -1
- package/fs-BTyRnUPI.cjs +1 -0
- package/{fs--NhtUyYa.d.ts → fs-D0MMRnHC.d.ts} +8 -4
- package/fs-q7Kg51hq.js +513 -0
- package/fs.cjs +1 -1
- package/fs.d.ts +4 -3
- package/fs.js +4 -2
- package/http.d.ts +1 -1
- package/{index-kuPqkS_-.d.ts → index-D2lvaQDs.d.ts} +28 -38
- package/index.cjs +1 -1
- package/index.d.ts +3 -3
- package/index.js +13 -13
- package/{lib-tQKlXzhv.cjs → lib-BfAg9mHD.cjs} +1 -1
- package/{lib-BlyFPeSv.js → lib-C4Eeg9eM.js} +2 -2
- package/{messages-C66ghz_A.d.ts → messages-CRcziTuC.d.ts} +17 -1
- package/messages.cjs +1 -1
- package/messages.d.ts +2 -2
- package/messages.js +2 -2
- package/{net-Qmt9L_7t.d.ts → net-CcEZP6Bb.d.ts} +2 -2
- package/net.d.ts +1 -1
- package/{node-fs-BZy9bzKd.js → node-fs-CK2wWIYS.js} +140 -137
- package/node-fs-nfX7wisL.cjs +1 -0
- package/opfs.cjs +1 -1
- package/opfs.js +1 -1
- package/package.json +1 -1
- package/packages.d.ts +1 -1
- package/{proxy-CxRQLGNG.d.ts → proxy-D6YtsO1g.d.ts} +2 -2
- package/rooms.d.ts +1 -1
- package/storage-BS5WMO4f.cjs +1 -0
- package/storage-BVr2Rb-d.d.ts +167 -0
- package/storage-BWmGrO6a.js +123 -0
- package/cloud-BZIJFvPF.cjs +0 -1
- package/extension-Bl5ZNj0d.cjs +0 -1
- package/extension-ChZyZgAL.js +0 -89
- package/fs-CaQFRiIT.cjs +0 -1
- package/fs-D3IsGdnN.js +0 -360
- package/node-fs-BNTPsX5c.cjs +0 -1
- package/storage-BJd-mWHE.cjs +0 -1
- package/storage-DSvL-t80.js +0 -67
- package/storage-ZrY4Y4L5.d.ts +0 -88
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-BfAg9mHD.cjs"),n=require("./hosts-9dYv63ud.cjs"),r=require("./api-jOTOA-5n.cjs"),i=require("./busy-Dv8wzE5M.cjs"),a=require("./proxy-DjoPtJH9.cjs"),o=require("./attach-policy.cjs"),s=require("./contract.cjs"),c=require("./dns.cjs"),l=require("./cloud/fs.cjs"),u=require("./net.cjs"),d=require("./dgram.cjs"),f=require("./http.cjs");let p=require("osra");var m=async()=>{let e=()=>r.o(`frame consent`);try{let t=await e();return{request:typeof t.frameConsent.request==`function`?t.frameConsent.request:void 0,ensure:t.frameConsent.ensure}}catch(t){if(!(t instanceof r.n))throw t;return{request:void 0,ensure:t=>e().then(e=>e.frameConsent.ensure(t))}}},h=3e4,g=()=>t.C(`frame.evaluate: the code did not settle within ${h}ms`,`evaluate`),_=`frame: this frame no longer holds the document the app attached it to`,v=!1,y=()=>{v||(v=!0,console.warn(`[fkn-frame] this FKN broker is too old to ask for permission categories, so nothing was asked for upfront and each capability is asked for as it is first used. Reloading the page picks up the current broker.`))},b=e=>[...e].flatMap(e=>{try{return[new URL(e).hostname]}catch{return[]}}),x=(e,t,n)=>n===null?`frame.${e}: the user did not grant ${t} here`:`frame.${e}: the user did not grant ${t} on ${n}`,S=e=>{let{assertLive:r,attach:i,current:a,declaredHosts:s,documentHost:c,ensure:l,request:u,session:d,approvedOrigins:f}=e,p=new Set,m=async()=>c?await c():(()=>{try{return new URL(a()).hostname}catch{return``}})(),h=()=>n.t([...s,...b(f)]),g=async e=>(await u([e]))[0]??!1;return{gate:async({operation:e,args:a,phase:c})=>{r();let v=n.m(e,a);if(v===null)return;let y=t.d(v);if(y===void 0||y===`auto`)return;if(e===`fetch`){let e=o.frameFetchVerdict({session:d,declaredHosts:s,approvedOrigins:f},c===`ensure`?void 0:a[0],{classifier:`fetchTarget`});if(c===`ensure`&&!d)throw t.w(e.kind===`refuse`?e.reason:``,`fetch`);if(c!==`ensure`&&e.kind===`refuse`)throw t.w(e.reason,`fetch`);if(!u){if(e.kind===`refuse`)throw t.w(e.reason,`fetch`);if(!await l({scope:n.c(a[0],a[1]).scope,hosts:e.promptHosts}))throw t.w(`frame.fetch: the user did not grant this`,`fetch`);return}let r=e.kind===`consent`?e.targetHost:await m(),i=n.t([r,...s]);if(!i.length)throw t.w(`frame: navigate the frame before fetch`,`fetch`);if(await g({category:`network`,hosts:i})===!1)throw t.w(x(`fetch`,`network`,r||null),`fetch`);return}let b=await m();if(!b)throw t.w(`frame: navigate the frame before ${e}`,e);if(!h().includes(b))throw t.w(_,e);if(!u)return;let S=t.u(v);if(S===void 0||y===`critical`&&p.has(`${v} ${b}`))return;let C=n.t([b,...s]),w=await g(y===`critical`?{key:v,hosts:C,attach:i}:{category:S,hosts:C});if(w===!1)throw t.w(x(e,S,null),e);if(w===`once`&&c!==`ensure`)for(let e of C)p.add(`${v} ${e}`)},requestCategories:async e=>{r(),t.c(`frame.request`,e);let a=await m(),o=n.t(a?[a,...s]:s);if(!o.length)throw TypeError(`frame.request: navigate the frame or declare domains first`);let c=e.map(e=>{let n=e.key;return n===void 0?{named:void 0,critical:!1,category:e.category}:{named:n,critical:t.d(n)===`critical`,category:t.l(n)}}),l=({named:e,critical:t,category:n},r)=>({category:n,...t?{key:e}:{},hosts:o,allow:r});if(!u)return y(),c.map(e=>l(e,!1));let d=await u(c.map(({named:e,critical:t,category:n})=>t?{key:e,hosts:o,attach:i}:{category:n,hosts:o}));return c.map((e,t)=>l(e,d[t]!==void 0&&d[t]!==!1))},boundary:h}},C=e=>e,w=5e3,T=new Set([]),E=()=>`https://fkn.app`,D=e=>e?``:`incognito-${crypto.randomUUID()}`,O=(e,t,n)=>{let r,i=new Promise((e,i)=>{r=setTimeout(()=>i(typeof n==`string`?Error(n):n()),t)});return Promise.race([e,i]).finally(()=>clearTimeout(r))},k=e=>Object.assign(Error(e),{name:t.x}),A=`frame.postMessage: this FKN page predates frame messaging; reload the app to load the current one`,j=!1,M=()=>{j||(j=!0,console.warn(`[fkn-frame] this FKN page predates frame messaging, so the page's messages and documents are never reported. Reloading the app loads the current one.`))},N=({from:e,origin:t,attach:n,signal:r})=>i=>{let a=r=>{if(r.source===null||r.source!==e()||r.origin!==t)return;let a=r.data;typeof a==`object`&&a&&a.type===`fkn-frame-message`&&a.attach===n&&typeof a.origin==`string`&&(a.kind===`message`?i({type:`message`,data:a.data,origin:a.origin,ports:r.ports}):a.kind===`document`&&i({type:`document`,origin:a.origin}))};return window.addEventListener(`message`,a,{signal:r}),()=>window.removeEventListener(`message`,a)},P=({control:e,target:n,session:r,declaredHosts:i,approvedOrigins:a,attach:o,assertLive:s,guard:c,consent:l,onNavigated:u,relay:d})=>{let f=n,p=Promise.resolve(),{gate:m,requestCategories:v,boundary:y}=S({session:r,declaredHosts:i,approvedOrigins:a,attach:o,assertLive:s,documentHost:typeof e.documentHost==`function`?()=>c(()=>e.documentHost()):void 0,current:()=>f,...l});return t.h({executor:{execute:(n,r,i)=>T.has(r)?Promise.reject(t.E(r,`cloud`)):(s(),c(()=>e.executeLocator(n,r,i))),highlight:async()=>{}},gate:m,request:v,evaluate:async(t,n)=>(s(),await m({parts:[],operation:`evaluate`,args:[t,n],phase:`execute`}),O(c(()=>e.executeLocator([],`evaluate`,[t,n])),h,g)),postMessage:(n,r,i)=>{if(s(),typeof e.messaging!=`function`)throw t.D(A,`postMessage`,`cloud`);if(r!==`*`&&!y().includes(new URL(r).hostname))throw t.w(_,`postMessage`);let{port1:a,port2:o}=new MessageChannel;a.postMessage({data:n,transfer:i},i);let l=[o,r],u=p.then(async()=>(await m({parts:[],operation:`postMessage`,args:l,phase:`execute`}),{answer:c(()=>e.executeLocator([],`postMessage`,l))}));return p=u.catch(()=>{}),u.then(async({answer:e})=>{await e})},listen:t=>(typeof e.messaging!=`function`&&M(),d(t)),goto:async(t,n={})=>{let r=new URL(t,location.href).href;s();let{timeoutMs:i}=n,o=(()=>{try{return new URL(r).origin}catch{return``}})(),l=o!==``&&!a.has(o);l&&a.add(o);try{await O(c(()=>e.goto(r,n)),(i??3e4)+w,`cloud.attachFrame: the render proxy did not answer goto; the frame may have been detached or its page reloaded`)}catch(e){throw l&&a.delete(o),e}f=r,u()},url:()=>f})},F=250,I=500,L=65e3,R=2e3,z=2e3,ee=2,te=2e3,ne=2e3,re=({origin:e,target:t,session:n,domains:r,attach:i})=>{let a=new URL(`/attach-window`,e);return a.searchParams.set(`attach`,i),t&&a.searchParams.set(`url`,t),n&&a.searchParams.set(`session`,n),r.length&&a.searchParams.set(`domains`,r.join(`,`)),a.href},ie=(e,t)=>{let n=document.createElement(`iframe`),r=new URL(`/attach-jar`,e);return r.searchParams.set(`attach`,t),n.src=r.href,n.tabIndex=-1,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`style`,`display:none`),(document.body??document.documentElement).appendChild(n),n},B=(e,t)=>{let n=new MutationObserver(()=>{e.isConnected||t.aborted||(n.disconnect(),console.warn(`cloud.attachFrame: the window's jar anchor was removed from this page, so a sign-in in the window no longer reaches this app's cookie jar`))});e.parentNode&&n.observe(e.parentNode,{childList:!0}),n.observe(document.documentElement,{childList:!0}),t.addEventListener(`abort`,()=>n.disconnect(),{once:!0})},V=()=>k(`cloud.attachFrame: the attached window closed, reloaded or left the page FKN attached; attach a fresh window`),H=()=>k(`cloud.attachFrame: the attached window stopped answering; attach a fresh window`),U=()=>k(`cloud.attachFrame: the window went away before it connected; attach a fresh window`),W=()=>k(`cloud.attachFrame: the window closed before it connected. Either the user closed it, or this page's Cross-Origin-Opener-Policy cut its link to the window`),G=async e=>{if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);let{domains:r=[],syncCookies:a=!0,permissions:o}=e,{url:c,width:l,height:u}=t.s(e.window);if(window.origin===`null`)throw new t.p(`opaque-opener`);let d=E(),f=crypto.randomUUID(),m=D(a),h=n.t(r),g=new Set;c&&g.add(new URL(c).origin);let _=a?ie(d,f):null,v=window.open(re({origin:d,target:c,session:m,domains:h,attach:f}),`_blank`,`popup,width=${l},height=${u}`);if(!v)throw _?.remove(),new t.f;let y=new AbortController,b=!1,x=null,S=(e,t=!1)=>{if(x===null){x=e,y.abort(t?H():V());try{v.closed||v.postMessage({type:s.ATTACH_WINDOW_MESSAGE.detach,attach:f,...t?{unanswered:t}:{}},d)}catch{}_&&setTimeout(()=>_.remove(),ne)}};_&&B(_,y.signal);let w=new Promise((e,t)=>{y.signal.addEventListener(`abort`,()=>t(y.signal.reason),{once:!0})});w.catch(()=>{});let T=w.then(()=>{},()=>{}),k=()=>{if(y.signal.aborted)throw y.signal.reason},A=e=>y.signal.aborted?Promise.reject(y.signal.reason):Promise.race([e(),w]),j=e=>e.source===v&&e.origin===d;window.addEventListener(`message`,e=>{if(!j(e))return;let n=e.data;typeof n==`object`&&n&&n.attach===f&&(n.type===s.ATTACH_WINDOW_MESSAGE.refused?S(new t.p(n.reason)):n.type===s.ATTACH_WINDOW_MESSAGE.gone&&S(b?V():U()))},{signal:y.signal}),window.addEventListener(`pagehide`,()=>S(V()),{signal:y.signal});let M=()=>{try{v.postMessage({type:s.ATTACH_WINDOW_MESSAGE.hello,attach:f},d)}catch{}};M();let G=setInterval(M,F),K=setInterval(()=>{v.closed&&S(b?V():W())},I);y.signal.addEventListener(`abort`,()=>{clearInterval(G),clearInterval(K)},{once:!0});let q=async e=>{try{return await Promise.race([e,w])}catch(e){throw x??e}};try{let e=await q(O((0,p.expose)({},{key:s.ATTACH_WINDOW_KEY,transport:{emit:(e,t)=>v.postMessage(e,d,t??[]),receive:e=>{let t=t=>{j(t)&&e(t.data,{source:t.source,origin:t.origin})};return window.addEventListener(`message`,t),()=>window.removeEventListener(`message`,t)}},unregisterSignal:y.signal,revivableModules:C(t.rt)}),s.WINDOW_HANDSHAKE_TIMEOUT_MS,`cloud.attachFrame: timed out connecting to the window`));b=!0,clearInterval(G);let n=0,r=setInterval(()=>{O(A(()=>e.ping()),z,`ping`).then(()=>{n=0},()=>{y.signal.aborted||(document.visibilityState===`hidden`?n=0:++n>=ee&&S(H(),!0))})},R);y.signal.addEventListener(`abort`,()=>clearInterval(r),{once:!0}),await q(O(e.ready(),L,`cloud.attachFrame: the window never became ready`));let a=i.t(`attached frame`);y.signal.aborted?a():y.signal.addEventListener(`abort`,a,{once:!0});let l=P({control:e,target:c,session:m,declaredHosts:h,approvedOrigins:g,attach:f,assertLive:k,guard:A,consent:{request:t=>A(()=>e.requestConsent(t)),ensure:t=>A(()=>e.requestConsent([t])).then(([e])=>e!==void 0&&e!==!1)},onNavigated:()=>{},relay:N({from:()=>v,origin:d,attach:f,signal:y.signal})}),u=null,_=Object.assign(l,{close:()=>u??=(async()=>{y.signal.aborted||await O(Promise.allSettled([A(()=>e.flushCookies()),A(()=>e.sweepStorage())]),te,`close`).catch(()=>{});try{v.close()}catch{}S(V())})(),closed:T});return o?.length&&await q(_.request(o)),_}catch(e){let n=x??e;if(!(n instanceof t.p))try{v.close()}catch{}throw S(n),n}},K=2e4,q=65e3,J=e=>!e||e===`about:blank`,ae=({target:e,session:t,domains:n,attach:r})=>{let i=new URL(`/attach-frame`,E());return e&&i.searchParams.set(`url`,e),t&&i.searchParams.set(`session`,t),n.length&&i.searchParams.set(`domains`,n.join(`,`)),i.searchParams.set(`attach`,r),i.href},oe=(e,t)=>{let n=()=>{a(),t()},r=e.parentNode,i=new MutationObserver(()=>{(!e.isConnected||e.parentNode!==r)&&(a(),t())}),a=()=>{window.removeEventListener(`pagehide`,n),i.disconnect()};window.addEventListener(`pagehide`,n,{once:!0}),r&&i.observe(r,{childList:!0}),e.isConnected||(a(),t())},se=()=>k(`cloud.attachFrame: the attached iframe left the document or was reloaded; attach a fresh iframe`),ce=(e,t)=>{let n=[...e.split(`;`),...t.split(`;`)].map(e=>e.trim()).filter(Boolean);return[...new Set(n)].join(`; `)},le=[300,1200,4e3],Y=e=>{let t=()=>{if(!e.isConnected)return;let t=e.style.height,n=e.getBoundingClientRect();n.height&&(e.style.height=`${n.height-1}px`,setTimeout(()=>{e.style.height=t},50))};t();for(let e of le)setTimeout(t,e)},X=e=>{let t=e.getAttribute(`sandbox`);if(t===null)return;let n=new Set(t.toLowerCase().split(/\s+/).filter(Boolean)),r=[`allow-scripts`,`allow-same-origin`].filter(e=>!n.has(e));if(r.length)throw Error(`cloud.attachFrame: the iframe's sandbox attribute must include ${r.join(` and `)} for the render proxy to load`)},ue=async({iframe:e,domains:a=[],syncCookies:o=!0,lockdown:c=!1,permissions:l})=>{if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);if(c)throw Error(`cloud.attachFrame does not support lockdown; use the extension backend for a sealed frame`);if(!e.isConnected)throw Error(`cloud.attachFrame: the iframe must be connected to the document before attaching`);X(e);let u=e.getAttribute(`src`)??``,d=(()=>{if(J(u))return null;try{return new URL(e.src||u,location.href)}catch{throw Error(`cloud.attachFrame: the iframe src is not a valid URL: ${u}`)}})();if(d){let e=new URL(`/attach-frame`,E());if(d.origin===e.origin&&d.pathname===e.pathname)throw Error(`cloud.attachFrame: this iframe is already attached; navigate with the Frame returned by that attach or use a fresh iframe`)}let f=d?.href??``;f&&t._(f);let h=D(o),g=n.t(a),_=new Set;try{_.add(new URL(f).origin)}catch{}let v=new AbortController,y=e.referrerPolicy,b=e.allow,x=crypto.randomUUID();if(e.referrerPolicy=`origin`,e.allow=ce(r.f(),e.allow),e.src=ae({target:f,session:h,domains:g,attach:x}),!e.contentWindow)throw Error(`cloud.attachFrame: the iframe window is not available`);try{let n=await O((0,p.expose)({},{key:s.ATTACH_FRAME_KEY,origin:E(),transport:{receive:window,emit:e.contentWindow},unregisterSignal:v.signal,revivableModules:C(t.rt)}),K,`cloud.attachFrame: timed out connecting to the render proxy page`);await O(n.ready(),q,`cloud.attachFrame: the render proxy never became ready`),f&&Y(e),oe(e,()=>v.abort());let r=i.t(`attached frame`);v.signal.aborted?r():v.signal.addEventListener(`abort`,r,{once:!0});let a=e.contentWindow,o=P({control:n,target:f,session:h,declaredHosts:g,approvedOrigins:_,attach:x,assertLive:()=>{if(v.signal.aborted||!e.isConnected||e.contentWindow!==a)throw v.abort(),se()},guard:e=>e(),consent:await m(),onNavigated:()=>Y(e),relay:N({from:()=>a,origin:E(),attach:x,signal:v.signal})});return l?.length&&await o.request(l),o}catch(t){throw v.abort(),e.referrerPolicy=y,e.allow=b,e.src=f||`about:blank`,t}},Z=(async e=>t.o(e)===`window`?G(e):ue(e)),de=()=>typeof window<`u`&&!0,Q=async()=>{let e=await r.a.then(e=>e.cloud.quota());return{premium:e.premium,overQuota:e.overQuota,throttled:e.overQuota&&!e.premium,usedBytes:e.usedBytes,limitBytes:e.limitBytes,remainingBytes:e.remaining,bytesPerSecond:e.bytesPerSecond,bitsPerSecond:e.bytesPerSecond*8}},fe=e.t({attachFrame:()=>Z,available:()=>$,dgram:()=>d.t,dns:()=>c.t,fetch:()=>a.t,fs:()=>l.t,http:()=>f.t,net:()=>u.t,quota:()=>Q}),$=()=>r.c;Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return de}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return $}});
|
package/cloud.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./proxy-DjoPtJH9.cjs"),t=require("./cloud-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./proxy-DjoPtJH9.cjs"),t=require("./cloud-D7aQY4GH.cjs"),n=require("./dns.cjs"),r=require("./cloud/fs.cjs"),i=require("./net.cjs"),a=require("./dgram.cjs"),o=require("./http.cjs");exports.attachFrame=t.i,exports.available=t.t,Object.defineProperty(exports,"dgram",{enumerable:!0,get:function(){return a.t}}),Object.defineProperty(exports,"dns",{enumerable:!0,get:function(){return n.t}}),exports.fetch=e.t,Object.defineProperty(exports,"fs",{enumerable:!0,get:function(){return r.t}}),Object.defineProperty(exports,"http",{enumerable:!0,get:function(){return o.t}}),Object.defineProperty(exports,"net",{enumerable:!0,get:function(){return i.t}}),exports.quota=t.r;
|
package/cloud.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as cloudFetch } from "./proxy-
|
|
2
|
-
import { a as attachFrame, i as quota, r as QuotaStatus, t as available } from "./cloud-
|
|
1
|
+
import { t as cloudFetch } from "./proxy-D6YtsO1g.js";
|
|
2
|
+
import { a as attachFrame, i as quota, r as QuotaStatus, t as available } from "./cloud-4t1WoEZn.js";
|
|
3
3
|
import { t as dns_d_exports } from "./dns.js";
|
|
4
|
-
import { n as fs_d_exports } from "./fs
|
|
5
|
-
import { s as net_d_exports } from "./net-
|
|
4
|
+
import { n as fs_d_exports } from "./fs-D0MMRnHC.js";
|
|
5
|
+
import { s as net_d_exports } from "./net-CcEZP6Bb.js";
|
|
6
6
|
import { t as dgram_d_exports } from "./dgram.js";
|
|
7
7
|
import { t as http_d_exports } from "./http.js";
|
|
8
8
|
export { type QuotaStatus, attachFrame, available, dgram_d_exports as dgram, dns_d_exports as dns, cloudFetch as fetch, fs_d_exports as fs, http_d_exports as http, net_d_exports as net, quota };
|
package/cloud.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./proxy-DMTdQ4dN.js";
|
|
2
|
-
import { i as t, r as n, t as r } from "./cloud-
|
|
2
|
+
import { i as t, r as n, t as r } from "./cloud-BLv19j-W.js";
|
|
3
3
|
import { t as i } from "./dns.js";
|
|
4
4
|
import { t as a } from "./cloud/fs.js";
|
|
5
5
|
import { t as o } from "./net.js";
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { K as SelectorPart, v as GotoOptions } from "./index-D2CA-NX5.js";
|
|
2
2
|
import { o as TcpSocketOption, v as UdpSocketOption } from "./wire-Gbo-D74t.js";
|
|
3
3
|
//#region src/contract.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* What the broker's account change notification says. `switched` is true only when the account the
|
|
6
|
+
* broker acts as changed: another account, a sign-out or a sign-in. A renewal of the same account's
|
|
7
|
+
* token is false. A broker older than this sends no payload at all.
|
|
8
|
+
*/
|
|
9
|
+
type AccountChange = {
|
|
10
|
+
switched: boolean;
|
|
11
|
+
};
|
|
4
12
|
/** The signed-in account, or null when nobody is. */
|
|
5
13
|
type Account = {
|
|
6
14
|
name: string;
|
|
@@ -38,6 +46,14 @@ type StorageQuota = {
|
|
|
38
46
|
maxObjects: number;
|
|
39
47
|
};
|
|
40
48
|
type WriteData = ArrayBuffer | Uint8Array | string;
|
|
49
|
+
/**
|
|
50
|
+
* The trailing option of every pinned storage call: a value `accountPin()` answered. The api refuses the
|
|
51
|
+
* call ACCOUNT_CHANGED when the signed-in account (or the app) is not the one the pin was taken under.
|
|
52
|
+
* Absent, the call is sent exactly as it was before pins existed.
|
|
53
|
+
*/
|
|
54
|
+
type AccountPinOptions = {
|
|
55
|
+
accountPin?: string;
|
|
56
|
+
};
|
|
41
57
|
/** Encryption state of the account's cloud storage. */
|
|
42
58
|
type EncryptionState = {
|
|
43
59
|
unlocked: boolean;
|
|
@@ -72,8 +88,9 @@ type FrameFetchScope = 'frame.fetchRead' | 'frame.fetchWrite';
|
|
|
72
88
|
* One row on the cloud consent card.
|
|
73
89
|
*
|
|
74
90
|
* A category asks for every capability in it; a `key` asks for one critical permission's own row,
|
|
75
|
-
* and is refused unless the registry has that key at severity 4
|
|
76
|
-
*
|
|
91
|
+
* and is refused unless the registry has that key at severity 4 (none today). A critical grant
|
|
92
|
+
* covers that key alone, never another key or its category. `attach` binds an "Allow once" answer
|
|
93
|
+
* to the attachment that asked, so no other attachment can consume it.
|
|
77
94
|
*/
|
|
78
95
|
type FrameConsentRequest = {
|
|
79
96
|
category: 'interaction' | 'storage' | 'network' | 'evaluation';
|
|
@@ -86,7 +103,7 @@ type FrameConsentRequest = {
|
|
|
86
103
|
scope: FrameFetchScope;
|
|
87
104
|
hosts: string[];
|
|
88
105
|
};
|
|
89
|
-
/** `'once'` is a critical row answered
|
|
106
|
+
/** `'once'` is a critical row answered Once, a handoff the middle page takes for that attachment only; `'session'` a standing row, remembered until removed from the FKN bar, for a category and a critical key alike; `false` a refusal. */
|
|
90
107
|
type FrameConsentAnswer = 'once' | 'session' | false;
|
|
91
108
|
/** The osra key of an inline attachment's channel, which `/attach-frame` exposes to the library. */
|
|
92
109
|
declare const ATTACH_FRAME_KEY = "fkn-attach-frame";
|
|
@@ -753,9 +770,9 @@ type Resolvers = {
|
|
|
753
770
|
fs: {
|
|
754
771
|
available: () => Promise<boolean>;
|
|
755
772
|
availability: () => Promise<ConnectAvailability>;
|
|
756
|
-
list: () => Promise<StorageEntry[]>;
|
|
773
|
+
list: (opts?: AccountPinOptions) => Promise<StorageEntry[]>;
|
|
757
774
|
quota: () => Promise<StorageQuota>;
|
|
758
|
-
readFile: (path: string) => Promise<Uint8Array>;
|
|
775
|
+
readFile: (path: string, opts?: AccountPinOptions) => Promise<Uint8Array>;
|
|
759
776
|
/**
|
|
760
777
|
* The same read as `readFile`, plus the seal time the envelope authenticates, in milliseconds,
|
|
761
778
|
* or null for an envelope that carries no such field.
|
|
@@ -764,12 +781,18 @@ type Resolvers = {
|
|
|
764
781
|
* envelope's AAD; it is still the WRITER's own claim about when it sealed, so on its own it
|
|
765
782
|
* does not prove that this copy is the newest one.
|
|
766
783
|
*/
|
|
767
|
-
readFileSealed: (path: string) => Promise<{
|
|
784
|
+
readFileSealed: (path: string, opts?: AccountPinOptions) => Promise<{
|
|
768
785
|
bytes: Uint8Array;
|
|
769
786
|
sealedAt: number | null;
|
|
770
787
|
}>;
|
|
771
|
-
writeFile: (path: string, data: WriteData, contentType: string | null) => Promise<void>;
|
|
772
|
-
remove: (path: string) => Promise<void>;
|
|
788
|
+
writeFile: (path: string, data: WriteData, contentType: string | null, opts?: AccountPinOptions) => Promise<void>;
|
|
789
|
+
remove: (path: string, opts?: AccountPinOptions) => Promise<void>;
|
|
790
|
+
/**
|
|
791
|
+
* A fresh opaque pin for the account signed in now, under the calling app. It names nobody: every
|
|
792
|
+
* call answers a new value and two pins cannot be compared. A broker without this member cannot
|
|
793
|
+
* pin, and the library sends it no storage call at all.
|
|
794
|
+
*/
|
|
795
|
+
accountPin: () => Promise<string>;
|
|
773
796
|
encryption: () => Promise<EncryptionState>;
|
|
774
797
|
unlock: () => Promise<boolean>;
|
|
775
798
|
promptAdopt: (request: AdoptRequest) => Promise<boolean>;
|
|
@@ -846,7 +869,7 @@ type Resolvers = {
|
|
|
846
869
|
info: () => Promise<Account | null>;
|
|
847
870
|
login: (consumerOrigin: string) => Promise<boolean>;
|
|
848
871
|
logout: () => void;
|
|
849
|
-
onChange: (listener: () => void) => (() => void);
|
|
872
|
+
onChange: (listener: (change?: AccountChange) => void) => (() => void);
|
|
850
873
|
};
|
|
851
874
|
shell: {
|
|
852
875
|
updateReady: () => Promise<boolean>;
|
|
@@ -864,4 +887,4 @@ type Resolvers = {
|
|
|
864
887
|
hideInstallPrompt: () => void;
|
|
865
888
|
};
|
|
866
889
|
//#endregion
|
|
867
|
-
export {
|
|
890
|
+
export { RoomJoinOptions as $, MountDescriptor as A, WINDOW_JAR_MODE_TIMEOUT_MS as At, ProxyFetchInit as B, FrameMessageRelay as C, TcpSocketOptions as Ct, IpFamily as D, UdpSocketResult as Dt, InstalledPackage as E, UdpSocketOptions as Et, PackagesErrorCode as F, Resolvers as G, Quota as H, PackagesFail as I, RoomCreateOptions as J, RoomBacklog as K, PickOptions as L, OverlayState as M, WriteData as Mt, PackageQuery as N, JAR_ANCHOR_MESSAGE as O, WINDOW_HANDSHAKE_TIMEOUT_MS as Ot, PackageResult as P, RoomHandle as Q, Placement as R, FrameFetchScope as S, TcpSocketListenerResult as St, InstallOptions as T, UdpDatagram as Tt, ROOM_TEMPORARY_MS as U, ProxyFetchInput as V, Radii as W, RoomEnd as X, RoomDefaults as Y, RoomEvent as Z, DnsLookup as _, ShellJarUnreachable as _t, AccountChange as a, RoomPermissions as at, FrameConsentAnswer as b, SurfaceRect as bt, AdoptRequest as c, SHELL_ATTACH_ERROR as ct, ConflictRequest as d, SHELL_JAR_MESSAGE as dt, RoomMailbox as et, ConflictSide as f, SHELL_JAR_UNREACHABLE as ft, DisplayLevel as g, ShellGotoOptions as gt, DisplayCause as h, ShellFrameMessage as ht, Account as i, RoomPermission as it, OverlayRect as j, WindowMiddleControl as jt, MiddleControl as k, WINDOW_HELLO_TIMEOUT_MS as kt, AdoptState as l, SHELL_CONTROL_KEY as lt, ConnectOptions as m, ShellControl as mt, ATTACH_WINDOW_KEY as n, RoomMessage as nt, AccountPinOptions as o, RoomsErrorCode as ot, ConnectAvailability as p, SetOverlayHost as pt, RoomClaimOptions as q, ATTACH_WINDOW_MESSAGE as r, RoomOpenOptions as rt, AddressLookupResult as s, RoomsFail as st, ATTACH_FRAME_KEY as t, RoomMember as tt, ConflictChoice as u, SHELL_FRAME_MESSAGE as ut, EncryptionState as v, StorageEntry as vt, HiddenSurface as w, TcpSocketResult as wt, FrameConsentRequest as x, TcpSocketListenerOptions as xt, FRAME_MESSAGE as y, StorageQuota as yt, ProxyFetch as z };
|
package/contract.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { o as TcpSocketOption, v as UdpSocketOption } from "./wire-Gbo-D74t.js";
|
|
2
|
-
import { $ as
|
|
3
|
-
export { ATTACH_FRAME_KEY, ATTACH_WINDOW_KEY, ATTACH_WINDOW_MESSAGE, Account, AddressLookupResult, AdoptRequest, AdoptState, ConflictChoice, ConflictRequest, ConflictSide, ConnectAvailability, ConnectOptions, DisplayCause, DisplayLevel, DnsLookup, EncryptionState, FRAME_MESSAGE, FrameConsentAnswer, FrameConsentRequest, FrameFetchScope, FrameMessageRelay, HiddenSurface, InstallOptions, InstalledPackage, IpFamily, JAR_ANCHOR_MESSAGE, MiddleControl, MountDescriptor, OverlayRect, OverlayState, PackageQuery, PackageResult, PackagesErrorCode, PackagesFail, PickOptions, Placement, ProxyFetch, ProxyFetchInit, ProxyFetchInput, Quota, ROOM_TEMPORARY_MS, Radii, Resolvers, RoomBacklog, RoomClaimOptions, RoomCreateOptions, RoomDefaults, RoomEnd, RoomEvent, RoomHandle, RoomJoinOptions, RoomMailbox, RoomMember, RoomMessage, RoomOpenOptions, RoomPermission, RoomPermissions, RoomsErrorCode, RoomsFail, SHELL_ATTACH_ERROR, SHELL_CONTROL_KEY, SHELL_FRAME_MESSAGE, SHELL_JAR_MESSAGE, SHELL_JAR_UNREACHABLE, SetOverlayHost, ShellControl, ShellFrameMessage, ShellGotoOptions, ShellJarUnreachable, StorageEntry, StorageQuota, SurfaceRect, TcpSocketListenerOptions, TcpSocketListenerResult, type TcpSocketOption, TcpSocketOptions, TcpSocketResult, UdpDatagram, type UdpSocketOption, UdpSocketOptions, UdpSocketResult, WINDOW_HANDSHAKE_TIMEOUT_MS, WINDOW_HELLO_TIMEOUT_MS, WINDOW_JAR_MODE_TIMEOUT_MS, WindowMiddleControl, WriteData };
|
|
2
|
+
import { $ as RoomJoinOptions, A as MountDescriptor, At as WINDOW_JAR_MODE_TIMEOUT_MS, B as ProxyFetchInit, C as FrameMessageRelay, Ct as TcpSocketOptions, D as IpFamily, Dt as UdpSocketResult, E as InstalledPackage, Et as UdpSocketOptions, F as PackagesErrorCode, G as Resolvers, H as Quota, I as PackagesFail, J as RoomCreateOptions, K as RoomBacklog, L as PickOptions, M as OverlayState, Mt as WriteData, N as PackageQuery, O as JAR_ANCHOR_MESSAGE, Ot as WINDOW_HANDSHAKE_TIMEOUT_MS, P as PackageResult, Q as RoomHandle, R as Placement, S as FrameFetchScope, St as TcpSocketListenerResult, T as InstallOptions, Tt as UdpDatagram, U as ROOM_TEMPORARY_MS, V as ProxyFetchInput, W as Radii, X as RoomEnd, Y as RoomDefaults, Z as RoomEvent, _ as DnsLookup, _t as ShellJarUnreachable, a as AccountChange, at as RoomPermissions, b as FrameConsentAnswer, bt as SurfaceRect, c as AdoptRequest, ct as SHELL_ATTACH_ERROR, d as ConflictRequest, dt as SHELL_JAR_MESSAGE, et as RoomMailbox, f as ConflictSide, ft as SHELL_JAR_UNREACHABLE, g as DisplayLevel, gt as ShellGotoOptions, h as DisplayCause, ht as ShellFrameMessage, i as Account, it as RoomPermission, j as OverlayRect, jt as WindowMiddleControl, k as MiddleControl, kt as WINDOW_HELLO_TIMEOUT_MS, l as AdoptState, lt as SHELL_CONTROL_KEY, m as ConnectOptions, mt as ShellControl, n as ATTACH_WINDOW_KEY, nt as RoomMessage, o as AccountPinOptions, ot as RoomsErrorCode, p as ConnectAvailability, pt as SetOverlayHost, q as RoomClaimOptions, r as ATTACH_WINDOW_MESSAGE, rt as RoomOpenOptions, s as AddressLookupResult, st as RoomsFail, t as ATTACH_FRAME_KEY, tt as RoomMember, u as ConflictChoice, ut as SHELL_FRAME_MESSAGE, v as EncryptionState, vt as StorageEntry, w as HiddenSurface, wt as TcpSocketResult, x as FrameConsentRequest, xt as TcpSocketListenerOptions, y as FRAME_MESSAGE, yt as StorageQuota, z as ProxyFetch } from "./contract-BRc2ptdC.js";
|
|
3
|
+
export { ATTACH_FRAME_KEY, ATTACH_WINDOW_KEY, ATTACH_WINDOW_MESSAGE, Account, AccountChange, AccountPinOptions, AddressLookupResult, AdoptRequest, AdoptState, ConflictChoice, ConflictRequest, ConflictSide, ConnectAvailability, ConnectOptions, DisplayCause, DisplayLevel, DnsLookup, EncryptionState, FRAME_MESSAGE, FrameConsentAnswer, FrameConsentRequest, FrameFetchScope, FrameMessageRelay, HiddenSurface, InstallOptions, InstalledPackage, IpFamily, JAR_ANCHOR_MESSAGE, MiddleControl, MountDescriptor, OverlayRect, OverlayState, PackageQuery, PackageResult, PackagesErrorCode, PackagesFail, PickOptions, Placement, ProxyFetch, ProxyFetchInit, ProxyFetchInput, Quota, ROOM_TEMPORARY_MS, Radii, Resolvers, RoomBacklog, RoomClaimOptions, RoomCreateOptions, RoomDefaults, RoomEnd, RoomEvent, RoomHandle, RoomJoinOptions, RoomMailbox, RoomMember, RoomMessage, RoomOpenOptions, RoomPermission, RoomPermissions, RoomsErrorCode, RoomsFail, SHELL_ATTACH_ERROR, SHELL_CONTROL_KEY, SHELL_FRAME_MESSAGE, SHELL_JAR_MESSAGE, SHELL_JAR_UNREACHABLE, SetOverlayHost, ShellControl, ShellFrameMessage, ShellGotoOptions, ShellJarUnreachable, StorageEntry, StorageQuota, SurfaceRect, TcpSocketListenerOptions, TcpSocketListenerResult, type TcpSocketOption, TcpSocketOptions, TcpSocketResult, UdpDatagram, type UdpSocketOption, UdpSocketOptions, UdpSocketResult, WINDOW_HANDSHAKE_TIMEOUT_MS, WINDOW_HELLO_TIMEOUT_MS, WINDOW_JAR_MODE_TIMEOUT_MS, WindowMiddleControl, WriteData };
|
package/dgram.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { v as UdpSocketOption } from "./wire-Gbo-D74t.js";
|
|
2
|
-
import {
|
|
3
|
-
import "./api-
|
|
2
|
+
import { Dt as UdpSocketResult, G as Resolvers } from "./contract-BRc2ptdC.js";
|
|
3
|
+
import "./api-Cbty0JUM.js";
|
|
4
4
|
import { Buffer } from "buffer";
|
|
5
5
|
import { AddressInfo } from "net";
|
|
6
6
|
import { EventEmitter } from "events";
|
package/dns.d.ts
CHANGED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
+
import { $ as t, A as n, B as r, F as i, G as a, H as o, I as s, J as c, K as l, L as u, M as ee, N as te, O as ne, P as d, R as f, S as p, T as m, U as h, V as g, W as _, X as v, Y as y, Z as b, _ as x, a as S, at as C, b as w, ct as T, et as E, f as D, g as O, h as k, i as A, it as re, j, k as M, m as N, n as P, nt as F, ot as I, p as L, q as R, r as z, rt as B, st as V, t as H, v as U, x as W, y as G, z as K } from "./lib-C4Eeg9eM.js";
|
|
3
|
+
import { a as q, d as J } from "./api-Dp-2AT3u.js";
|
|
4
|
+
import { t as Y } from "./proxy-DMTdQ4dN.js";
|
|
5
|
+
import { available as X, fetch as ie } from "./desktop.js";
|
|
6
|
+
//#region src/extension-prompt.ts
|
|
7
|
+
var Z = async (e) => {
|
|
8
|
+
if (typeof window > "u") return !1;
|
|
9
|
+
if (c()) return !0;
|
|
10
|
+
let t = await q, n = null, r = new Promise((e) => {
|
|
11
|
+
n = () => {
|
|
12
|
+
c() && e(!0);
|
|
13
|
+
}, R.addEventListener("statuschange", n);
|
|
14
|
+
}), i = t.installPrompt.show(e).then(() => !1), a = await Promise.race([r, i]);
|
|
15
|
+
return n && R.removeEventListener("statuschange", n), await t.installPrompt.hide().catch(() => {}), a;
|
|
16
|
+
}, Q = null;
|
|
17
|
+
v(() => (Q ||= Z().then(() => void 0).finally(() => {
|
|
18
|
+
Q = null;
|
|
19
|
+
}), Q));
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/auto.ts
|
|
22
|
+
var $ = () => typeof document < "u" && c(), ae = async (e, t) => {
|
|
23
|
+
if (J(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 u(e, t);
|
|
26
|
+
}
|
|
27
|
+
return $() ? u(e, {
|
|
28
|
+
...t,
|
|
29
|
+
credentials: "omit"
|
|
30
|
+
}) : X() ? ie(e, t) : Y(e, t);
|
|
31
|
+
}, oe = /* @__PURE__ */ e({
|
|
32
|
+
ATTACH_FRAME_EVENT_KEY: () => A,
|
|
33
|
+
CATEGORIES: () => w,
|
|
34
|
+
EXTENSION_ABI: () => 3,
|
|
35
|
+
ExtensionOperationUnsupportedError: () => t,
|
|
36
|
+
ExtensionOutdatedError: () => E,
|
|
37
|
+
FORGEABLE_HEADERS: () => h,
|
|
38
|
+
FrameWindowBlockedError: () => D,
|
|
39
|
+
FrameWindowRefusedError: () => L,
|
|
40
|
+
LOCATOR_DENIED: () => m,
|
|
41
|
+
LOCATOR_ERROR: () => M,
|
|
42
|
+
LOCATOR_UNSUPPORTED: () => W,
|
|
43
|
+
PERMISSION_DENIED: () => H,
|
|
44
|
+
REQUIRED_EXTENSION_ABI: () => 0,
|
|
45
|
+
assertAttachableFrameUrl: () => x,
|
|
46
|
+
assertFetchableUrl: () => s,
|
|
47
|
+
assertForgeableHeaders: () => _,
|
|
48
|
+
assertLockdownApplicable: () => U,
|
|
49
|
+
assertOneCookieIdentity: () => a,
|
|
50
|
+
attachFrame: () => S,
|
|
51
|
+
attachFramePermission: () => N,
|
|
52
|
+
available: () => $,
|
|
53
|
+
box: () => re,
|
|
54
|
+
cookies: () => d,
|
|
55
|
+
createFrame: () => k,
|
|
56
|
+
createVideoElementHandle: () => C,
|
|
57
|
+
events: () => R,
|
|
58
|
+
extension: () => R,
|
|
59
|
+
fetch: () => u,
|
|
60
|
+
fetchCredentialedPermission: () => f,
|
|
61
|
+
fetchLocalPermission: () => K,
|
|
62
|
+
fetchPermission: () => r,
|
|
63
|
+
gotoPermission: () => O,
|
|
64
|
+
handleRevivableModules: () => B,
|
|
65
|
+
hasForgedCookie: () => l,
|
|
66
|
+
isBlockedFetchUrl: () => g,
|
|
67
|
+
isBlockedFrameUrl: () => G,
|
|
68
|
+
isExtensionExposed: () => c,
|
|
69
|
+
isLocalNetworkUrl: () => o,
|
|
70
|
+
isLocatorDenied: () => n,
|
|
71
|
+
isLocatorUnsupported: () => p,
|
|
72
|
+
isPermissionDenied: () => P,
|
|
73
|
+
isTerminalError: () => ne,
|
|
74
|
+
isType: () => I,
|
|
75
|
+
modifyRequestHeadersPermission: () => j,
|
|
76
|
+
permissions: () => z,
|
|
77
|
+
promptInstall: () => Z,
|
|
78
|
+
readCookiePermission: () => i,
|
|
79
|
+
readExtensionHandshake: () => y,
|
|
80
|
+
removeRequestHeaderRule: () => ee,
|
|
81
|
+
revive: () => V,
|
|
82
|
+
setMissingExtensionHandler: () => v,
|
|
83
|
+
setRequestHeaderRule: () => te,
|
|
84
|
+
supportsOperation: () => F,
|
|
85
|
+
type: () => T,
|
|
86
|
+
waitForExtensionExposure: () => b
|
|
87
|
+
});
|
|
88
|
+
//#endregion
|
|
89
|
+
export { Z as i, ae as n, $ as r, oe as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-BfAg9mHD.cjs"),n=require("./api-jOTOA-5n.cjs"),r=require("./proxy-DjoPtJH9.cjs"),i=require("./desktop.cjs");var a=async e=>{if(typeof window>`u`)return!1;if(t.J())return!0;let r=await n.a,i=null,a=new Promise(e=>{i=()=>{t.J()&&e(!0)},t.q.addEventListener(`statuschange`,i)}),o=r.installPrompt.show(e).then(()=>!1),s=await Promise.race([a,o]);return i&&t.q.removeEventListener(`statuschange`,i),await r.installPrompt.hide().catch(()=>{}),s},o=null;t.X(()=>(o||=a().then(()=>void 0).finally(()=>{o=null}),o));var s=()=>typeof document<`u`&&t.J(),c=async(e,a)=>{if(n.d(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.L(e,a)}return s()?t.L(e,{...a,credentials:`omit`}):i.available()?i.fetch(e,a):r.t(e,a)},l=e.t({ATTACH_FRAME_EVENT_KEY:()=>t.i,CATEGORIES:()=>t.b,EXTENSION_ABI:()=>3,ExtensionOperationUnsupportedError:()=>t.$,ExtensionOutdatedError:()=>t.et,FORGEABLE_HEADERS:()=>t.U,FrameWindowBlockedError:()=>t.f,FrameWindowRefusedError:()=>t.p,LOCATOR_DENIED:()=>t.T,LOCATOR_ERROR:()=>t.k,LOCATOR_UNSUPPORTED:()=>t.x,PERMISSION_DENIED:()=>t.t,REQUIRED_EXTENSION_ABI:()=>0,assertAttachableFrameUrl:()=>t._,assertFetchableUrl:()=>t.I,assertForgeableHeaders:()=>t.W,assertLockdownApplicable:()=>t.v,assertOneCookieIdentity:()=>t.G,attachFrame:()=>t.a,attachFramePermission:()=>t.m,available:()=>s,box:()=>t.it,cookies:()=>t.P,createFrame:()=>t.h,createVideoElementHandle:()=>t.at,events:()=>t.q,extension:()=>t.q,fetch:()=>t.L,fetchCredentialedPermission:()=>t.R,fetchLocalPermission:()=>t.z,fetchPermission:()=>t.B,gotoPermission:()=>t.g,handleRevivableModules:()=>t.rt,hasForgedCookie:()=>t.K,isBlockedFetchUrl:()=>t.V,isBlockedFrameUrl:()=>t.y,isExtensionExposed:()=>t.J,isLocalNetworkUrl:()=>t.H,isLocatorDenied:()=>t.A,isLocatorUnsupported:()=>t.S,isPermissionDenied:()=>t.n,isTerminalError:()=>t.O,isType:()=>t.ot,modifyRequestHeadersPermission:()=>t.j,permissions:()=>t.r,promptInstall:()=>a,readCookiePermission:()=>t.F,readExtensionHandshake:()=>t.Y,removeRequestHeaderRule:()=>t.M,revive:()=>t.st,setMissingExtensionHandler:()=>t.X,setRequestHeaderRule:()=>t.N,supportsOperation:()=>t.nt,type:()=>t.ct,waitForExtensionExposure:()=>t.Z});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}});
|
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-BfAg9mHD.cjs"),t=require("./extension-D2zMdc2f.cjs");exports.ATTACH_FRAME_EVENT_KEY=e.i,exports.CATEGORIES=e.b,exports.EXTENSION_ABI=e.Q,exports.ExtensionOperationUnsupportedError=e.$,exports.ExtensionOutdatedError=e.et,exports.FORGEABLE_HEADERS=e.U,exports.FrameWindowBlockedError=e.f,exports.FrameWindowRefusedError=e.p,exports.LOCATOR_DENIED=e.T,exports.LOCATOR_ERROR=e.k,exports.LOCATOR_UNSUPPORTED=e.x,exports.PERMISSION_DENIED=e.t,exports.REQUIRED_EXTENSION_ABI=e.tt,exports.assertAttachableFrameUrl=e._,exports.assertFetchableUrl=e.I,exports.assertForgeableHeaders=e.W,exports.assertLockdownApplicable=e.v,exports.assertOneCookieIdentity=e.G,exports.attachFrame=e.a,exports.attachFramePermission=e.m,exports.available=t.r,exports.box=e.it,exports.cookies=e.P,exports.createFrame=e.h,exports.createVideoElementHandle=e.at,exports.events=e.q,exports.extension=e.q,exports.fetch=e.L,exports.fetchCredentialedPermission=e.R,exports.fetchLocalPermission=e.z,exports.fetchPermission=e.B,exports.gotoPermission=e.g,exports.handleRevivableModules=e.rt,exports.hasForgedCookie=e.K,exports.isBlockedFetchUrl=e.V,exports.isBlockedFrameUrl=e.y,exports.isExtensionExposed=e.J,exports.isLocalNetworkUrl=e.H,exports.isLocatorDenied=e.A,exports.isLocatorUnsupported=e.S,exports.isPermissionDenied=e.n,exports.isTerminalError=e.O,exports.isType=e.ot,exports.modifyRequestHeadersPermission=e.j,exports.permissions=e.r,exports.promptInstall=t.i,exports.readCookiePermission=e.F,exports.readExtensionHandshake=e.Y,exports.removeRequestHeaderRule=e.M,exports.revive=e.st,exports.setMissingExtensionHandler=e.X,exports.setRequestHeaderRule=e.N,exports.supportsOperation=e.nt,exports.type=e.ct,exports.waitForExtensionExposure=e.Z;
|
package/extension.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as e, A as t, B as n,
|
|
2
|
-
import { i as Q, r as $ } from "./extension-
|
|
3
|
-
export {
|
|
1
|
+
import { $ as e, A as t, B as n, F as r, G as i, H as a, I as o, J as s, K as c, L as l, M as u, N as d, O 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, et as k, f as A, g as j, h as M, i as N, it as P, j as F, k as I, m as L, n as R, nt as z, ot as B, p as V, q as H, r as U, rt as W, st as G, t as K, tt as q, v as J, x as Y, y as X, z as Z } from "./lib-C4Eeg9eM.js";
|
|
2
|
+
import { i as Q, r as $ } from "./extension-B9v933cT.js";
|
|
3
|
+
export { N as ATTACH_FRAME_EVENT_KEY, D as CATEGORIES, m as EXTENSION_ABI, e as ExtensionOperationUnsupportedError, k as ExtensionOutdatedError, v as FORGEABLE_HEADERS, A as FrameWindowBlockedError, V as FrameWindowRefusedError, _ as LOCATOR_DENIED, I as LOCATOR_ERROR, Y as LOCATOR_UNSUPPORTED, K as PERMISSION_DENIED, q as REQUIRED_EXTENSION_ABI, w as assertAttachableFrameUrl, o as assertFetchableUrl, b as assertForgeableHeaders, J as assertLockdownApplicable, i as assertOneCookieIdentity, T as attachFrame, L as attachFramePermission, $ as available, P as box, p as cookies, M as createFrame, E as createVideoElementHandle, H as events, H as extension, l as fetch, h as fetchCredentialedPermission, Z as fetchLocalPermission, n as fetchPermission, j as gotoPermission, W as handleRevivableModules, c as hasForgedCookie, y as isBlockedFetchUrl, X as isBlockedFrameUrl, s as isExtensionExposed, a as isLocalNetworkUrl, t as isLocatorDenied, g as isLocatorUnsupported, R as isPermissionDenied, f as isTerminalError, B as isType, F as modifyRequestHeadersPermission, U as permissions, Q as promptInstall, r as readCookiePermission, S as readExtensionHandshake, u as removeRequestHeaderRule, G as revive, x as setMissingExtensionHandler, d as setRequestHeaderRule, z as supportsOperation, O as type, C 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-BTyRnUPI.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-D2lvaQDs.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-q7Kg51hq.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-BTyRnUPI.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./busy-Dv8wzE5M.cjs"),n=require("./node-fs-nfX7wisL.cjs"),r=require("./messages.cjs"),i=require("./storage-BS5WMO4f.cjs"),a=require("./opfs-CXMESVLc.cjs");var o=e.t({adopt:()=>R,adoptable:()=>B,available:()=>f,captureAccount:()=>s,list:()=>ve,onConflict:()=>Se,pending:()=>ue,pendingDeletes:()=>de,pull:()=>P,readFile:()=>ye,readFileSealed:()=>N,remove:()=>xe,replicating:()=>fe,writeFile:()=>be}),s=i.o,c,l=async()=>await(c??=a.t().catch(()=>!1))?!0:(c=void 0,!1),u=()=>i.a().catch(()=>`unknown`),d=async()=>await u()===`connected`,f=async()=>await l()||await d(),ee=`fkn:fs:pending`,te=`fkn:fs:pending-delete`,p=`fkn:fs:adopt-declined`,m=!0,ne=new Map,re=null,ie=(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:i.d(e),r=n(e);return r!==void 0&&r===n(t)},h=(e,t)=>ie(re,t)?ne.get(e)??null:null,g=e=>e===`write`?ee:te,_=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{}},ae=()=>{try{let e=JSON.parse(localStorage.getItem(p)??`{}`);return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}catch{return{}}},y=new Map,oe=e=>`pin`in e?e.pin:i.d(e)??null,se=(e,t,n,r)=>{let i=_(e),a=i[t],o=oe(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}`))},ce=(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)=>se(`write`,e,t,n),x=e=>ce(`write`,e),le=(e,t)=>se(`delete`,e,h(e,t),t),S=e=>ce(`delete`,e),ue=()=>Object.keys(_(`write`)),de=()=>Object.keys(_(`delete`)),fe=()=>m,C=new Map,pe=e=>C.get(e)===i.o().generation,me=(e,t,n)=>n.pin===null&&!y.has(`${e}:${t}`),w=null,T=!1;t.r(`storage replication`,()=>w!==null||V!==null);var E=()=>[`write`,`delete`].some(e=>Object.entries(_(e)).some(([t,n])=>n.pin===null?!me(e,t,n):!pe(n.pin))),D=6e4,he=6e5,O=D,k=null,A=()=>{!k&&typeof window<`u`&&E()&&(k=setTimeout(()=>{k=null,j()},O),O=Math.min(O*2,he))},j=()=>{if(w){T=!0;return}E()&&(w=Oe(!1,i.o()).then(e=>{if(!E()){O=D;return}e.failed.length&&A()}).catch(()=>{A()}).finally(()=>{w=null,ge()}))},ge=()=>{T&&(T=!1,j())},_e=null,M=()=>_e??=Promise.resolve().then(()=>require("./api.cjs")).then(e=>e.apiPromise),ve=async e=>{let t=e?.pin??i.o();W();let n=await u(),r=n===`connected`,[o,s]=await Promise.all([l().then(e=>e?a.n():[]).catch(()=>[]),r?i.f({pin:t}).then(e=>({ok:!0,entries:e}),e=>({ok:!1,entries:[],changed:i.c(e)?e:void 0})):Promise.resolve({ok:n===`disconnected`,entries:[]})]);if(n!==`unknown`&&(m=s.ok),s.ok&&n!==`unknown`&&(ne=new Map(s.entries.map(e=>[e.path,e.updatedAt])),re=t),s.changed)throw s.changed;let c=new Map,d=e=>{let t=Date.parse(e.updatedAt??``);return Number.isFinite(t)?t:0},f=e=>{let t=c.get(e.path);(!t||d(e)>=d(t))&&c.set(e.path,e)};for(let e of o)f(e);for(let e of s.entries)f(e);return s.ok&&r&&(Fe(o,s.entries).catch(()=>{}),E()?j():U({local:o,remote:s.entries,from:t}).catch(()=>{})),[...c.values()]},ye=async(e,t)=>{let n=t?.pin??i.o();if(await l())try{return await a.i(e)}catch(e){if(e?.name!==`NotFoundError`)throw e}let r=await i.h(e,{pin:n});return await l()&&a.o(e,r).catch(()=>{}),r},N=async(e,t)=>{let n=t?.pin??i.o();if(await l())try{let t=await a.i(e);return{data:new Uint8Array(await t.arrayBuffer()),sealedAt:null}}catch(e){if(e?.name!==`NotFoundError`)throw e}return i.g(e,{pin:n})},be=async(e,t,n)=>{let r=n?.pin??i.o(),o=n?.contentType,s=o?{contentType:o}:void 0,c=t instanceof Blob?t:new Blob([t],s?{type:s.contentType}:void 0);if(await l()){await a.o(e,c,s),W();let t=h(e,r),n=await u();if(n===`disconnected`)return;if(n===`unknown`||!m){b(e,t,r),A();return}i.b(e,c,{...s,pin:r}).then(()=>x(e)).catch(n=>{b(e,t,r),i.c(n)||A(),console.warn(`fs: cloud replicate failed, queued for adopt()`,n)});return}let d=await u();if(d===`connected`)return i.b(e,c,{...s,pin:r});throw Error(d===`unknown`?`fs: cloud unreachable`:`fs: no storage backend available`)},xe=async(e,t)=>{let n=t?.pin??i.o();W();let r=[];await l()&&r.push(a.a(e).catch(()=>{}));let o=await u();if(o===`connected`?r.push(i._(e,{pin:n}).then(()=>S(e)).catch(t=>{le(e,n),i.c(t)||A(),console.warn(`fs: cloud delete failed, queued for retry`,t)})):o===`unknown`&&r.length&&h(e,n)!==null&&(le(e,n),A()),!r.length)throw Error(o===`unknown`?`fs: cloud unreachable`:`fs: no storage backend available`);x(e),await Promise.all(r)},P=async e=>{let t=i.o(),n=await i.h(e,{pin:t});return await l()&&await a.o(e,n),n},F=null,Se=e=>(F=e,()=>{F===e&&(F=null)}),Ce=async e=>{let t=await(await M()).cloud.fs.promptConflict({path:e.path,local:e.local,cloud:e.cloud}).catch(()=>null);return t===`local`?e.readLocal():t===`cloud`?e.readCloud():null},we=async e=>{if(F)try{return await F(e)}catch{return null}return Ce(e)},I=class extends Error{},L=e=>e instanceof Error?e.message:String(e),Te=()=>{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},Ee=async()=>{for(let[e,t]of[...y]){let n=e.startsWith(`write:`)?`write`:`delete`,r=e.slice(n.length+1),a;try{a=await i.p(t)}catch(t){i.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:a},v(n,o))}},De=async(e,t,n,r,o,s)=>{let c=new Map(t.map(e=>[e.path,e])),l=e=>{if(i.c(e))throw new I};for(let[t,a]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!==a){S(t);continue}try{await i._(t,n),S(t),o.deleted.push(t)}catch(e){l(e),o.failed.push({path:t,error:L(e)})}}for(let t of r){let r=c.get(t.path),u=e.writes.has(t.path);if(!u){if(!s(t))continue;if(r){o.kept.push(t.path);continue}}let d=e.writes.get(t.path)??null;if(u&&r&&r.updatedAt!==d){let e=null,s=null,c=await we({path:t.path,local:{size:t.size,updatedAt:t.updatedAt},cloud:{size:r.size,updatedAt:r.updatedAt},readLocal:()=>e??=a.i(t.path),readCloud:()=>s??=i.h(t.path,n)});if(c==null){o.unresolved.push(t.path);continue}try{let r=e!==null&&c===await e,l=s!==null&&c===await s;l||await i.b(t.path,c,t.contentType?{contentType:t.contentType,...n}:n),r||await a.o(t.path,c),x(t.path),o.resolved.push({path:t.path,choice:r?`local`:l?`cloud`:`merged`})}catch(e){if(l(e),e?.code===`FKN_E2E_LOCKED`)throw e;o.failed.push({path:t.path,error:L(e)})}continue}try{let e=await a.i(t.path);await i.b(t.path,e,t.contentType?{contentType:t.contentType,...n}:n),x(t.path),o.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;o.failed.push({path:t.path,error:L(e)})}}},Oe=async(e,t)=>{let n={uploaded:[],kept:[],resolved:[],unresolved:[],deleted:[],failed:[]},r=await u();if(r===`unknown`)throw Error(`fs: cloud unreachable`);if(r!==`connected`)throw Error(`fs: this needs a signed-in account`);let o=await l(),s=o?await a.n():[];if(o)for(let e of Object.keys(_(`write`)))s.some(t=>t.path===e)||x(e);await Ee();for(let[e,r]of Te()){if(e===null||pe(e))continue;let a={pin:{pin:e}},o;try{o=await i.f(a)}catch(n){if(i.c(n)){C.set(e,t.generation);continue}if(i.l(n)){ke(e);continue}throw n}try{await De(r,o,a,s,n,()=>!1)}catch(n){if(!(n instanceof I))throw n;C.set(e,t.generation)}}if(e){let e={pin:t},r=await i.f(e),a=_(`write`),o=Te().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 a)&&!c.has(e.path);try{await De(o,r,e,s,n,l)}catch(e){throw e instanceof I?new i.t:e}}return n},ke=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)}},Ae=async e=>{for(;w;)await w;let t=Oe(!0,e);w=t.then(()=>{},()=>{});try{return await t}finally{w=null,ge()}},R=()=>Ae(i.o()),z=(e,t)=>{let n=new Set(t.map(e=>e.path)),r=_(`write`);return e.filter(e=>{let t=r[e.path];return t?me(`write`,e.path,t):!n.has(e.path)})},B=async()=>{let e=i.o();if(!await d()||!await l())return{paths:[],bytes:0};let[t,n]=await Promise.all([a.n(),i.f({pin:e})]),r=z(t,n);return{paths:r.map(e=>e.path),bytes:r.reduce((e,t)=>e+t.size,0)}},je=()=>new Set(Object.keys(ae())),Me=e=>{let t=ae();for(let n of e)t[n]=null;try{localStorage.setItem(p,JSON.stringify(t))}catch{}},V=null,H=!1,U=e=>{if(V)return H=!0,V;let t=e?.from??i.o();return V=(async()=>{if(!await d())return;let n=e??(await l()?{local:await a.n(),remote:await i.f({pin:t})}:null);if(!n)return;let r=je(),o=z(n.local,n.remote).filter(e=>!r.has(e.path));if(!o.length)return;let s=await M(),c=o.reduce((e,t)=>e+t.size,0);if(!await s.cloud.fs.promptAdopt({files:o.length,bytes:c}).catch(()=>!1)){Me(o.map(e=>e.path));return}`generation`in t&&await Ae(t)})().catch(()=>{}).finally(()=>{V=null,H&&(H=!1,U())}),V},Ne=null,Pe=!1,Fe=async(e,t)=>{let n=z(e,t),r=await M(),i=async()=>{await R().catch(()=>{});let e=await B().catch(()=>({paths:[],bytes:0}));await r.cloud.fs.setAdoptSource({files:e.paths.length,bytes:e.bytes},i).catch(()=>{})},a={files:n.length,bytes:n.reduce((e,t)=>e+t.size,0)};Ne=()=>{r.cloud.fs.setAdoptSource(a,i).catch(()=>{})},Pe||(Pe=!0,Promise.resolve().then(()=>require("./api.cjs")).then(e=>e.onApiEpoch((e,t)=>{t>1&&Ne?.()})).catch(()=>{})),await r.cloud.fs.setAdoptSource(a,i)},Ie=!1,W=()=>{Ie||typeof window>`u`||(Ie=!0,window.addEventListener(`online`,()=>{j()}),Promise.resolve().then(()=>require("./account.cjs")).then(e=>e.onChange(()=>{U().catch(()=>{}),j()})).catch(()=>{}))},Le=e.t({STORAGE_ACCOUNT_CHANGED:()=>r.STORAGE_ACCOUNT_CHANGED,STORAGE_ACCOUNT_PIN_UNSUPPORTED:()=>r.STORAGE_ACCOUNT_PIN_UNSUPPORTED,StorageAccountChangedError:()=>i.t,StorageAccountPinUnsupportedError:()=>i.n,adopt:()=>J,adoptable:()=>Y,appendFile:()=>et,appendFileSync:()=>He,available:()=>ze,default:()=>dt,exists:()=>st,existsSync:()=>Ue,flush:()=>G,isAccountChanged:()=>i.c,lstatSync:()=>Ge,mkdir:()=>rt,mkdirSync:()=>qe,mount:()=>lt,onConflict:()=>$,pending:()=>X,pendingDeletes:()=>Z,promises:()=>ct,pull:()=>K,readFile:()=>Qe,readFileSealed:()=>q,readFileSync:()=>Be,readdir:()=>nt,readdirSync:()=>Ke,remount:()=>ut,rename:()=>ot,renameSync:()=>Ze,replicating:()=>Q,rm:()=>it,rmSync:()=>Je,rmdirSync:()=>Ye,stat:()=>tt,statSync:()=>We,unlink:()=>at,unlinkSync:()=>Xe,writeFile:()=>$e,writeFileSync:()=>Ve}),Re=n.t(o,{memfs:!0}),{available:ze,readFileSync:Be,writeFileSync:Ve,appendFileSync:He,existsSync:Ue,statSync:We,lstatSync:Ge,readdirSync:Ke,mkdirSync:qe,rmSync:Je,rmdirSync:Ye,unlinkSync:Xe,renameSync:Ze,readFile:Qe,writeFile:$e,appendFile:et,stat:tt,readdir:nt,mkdir:rt,rm:it,unlink:at,rename:ot,exists:st,promises:ct,mount:lt,flush:G,remount:ut}=Re,K=P,q=N,J=R,Y=B,X=ue,Z=de,Q=fe,$=Se,dt={...Re,pull:K,readFileSealed:q,adopt:J,adoptable:Y,pending:X,pendingDeletes:Z,replicating:Q,onConflict:$};Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return We}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return at}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return rt}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return He}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return it}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return st}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return et}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return ct}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return K}});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as WriteData, i as Stats, n as MakeOptions, o as WriteOptions, r as ReadOptions, t as Callback } from "./index-BQgZVQl7.js";
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
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-BVr2Rb-d.js";
|
|
3
|
+
import { c as STORAGE_ACCOUNT_CHANGED, l as STORAGE_ACCOUNT_PIN_UNSUPPORTED, u as STORAGE_NOT_FOUND } from "./messages-CRcziTuC.js";
|
|
4
4
|
declare namespace fs_d_exports {
|
|
5
|
-
export { EncryptionStatus, FileEntry, STORAGE_NOT_FOUND, SealedRead, Stats, StorageLockedError, StorageNotFoundError, StorageQuota, available, encryption, isNotFound, mkdir, promises, quota, readFile, readFileSealed, readdir, rename, rm, stat, unlink, unlock, writeFile };
|
|
5
|
+
export { CloudAvailability, EncryptionStatus, FileEntry, STORAGE_ACCOUNT_CHANGED, STORAGE_ACCOUNT_PIN_UNSUPPORTED, STORAGE_NOT_FOUND, SealedRead, Stats, StorageAccountChangedError, StorageAccountPinUnsupportedError, StorageLockedError, StorageNotFoundError, StorageQuota, availability, available, encryption, isAccountChanged, isNotFound, list, mkdir, promises, quota, readFile, readFileSealed, readdir, rename, rm, stat, unlink, unlock, writeFile };
|
|
6
6
|
}
|
|
7
7
|
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: {
|
|
8
8
|
recursive?: boolean;
|
|
@@ -23,5 +23,9 @@ declare const available: () => Promise<boolean>, readFile: (path: import("node:f
|
|
|
23
23
|
lstat: (path: import("node:fs").PathLike) => Promise<Stats>;
|
|
24
24
|
access: (path: import("node:fs").PathLike) => Promise<void>;
|
|
25
25
|
};
|
|
26
|
+
/** Every object of this app in the account, with the server's stamps. */
|
|
27
|
+
declare const list: () => Promise<FileEntry[]>;
|
|
28
|
+
/** Not part of the node-style surface above, since node has no concept of a seal time; `readFile` is untouched. */
|
|
29
|
+
declare const readFileSealed: (path: string) => Promise<SealedRead>;
|
|
26
30
|
//#endregion
|
|
27
|
-
export {
|
|
31
|
+
export { promises as a, readdir as c, stat as d, unlink as f, mkdir as i, rename as l, fs_d_exports as n, readFile as o, writeFile as p, list as r, readFileSealed as s, available as t, rm as u };
|