@fkn/lib 0.9.37 → 0.9.39
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.cjs +1 -1
- package/account.js +1 -1
- package/{api-CZI08srV.d.ts → api-BxXnHxbd.d.ts} +13 -7
- package/{api-CtiKFcK3.js → api-Dp-2AT3u.js} +84 -77
- package/api-jOTOA-5n.cjs +3 -0
- package/api.cjs +1 -1
- package/api.d.ts +2 -2
- package/api.js +1 -1
- 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.cjs +1 -1
- package/cloud/fs.js +1 -1
- package/cloud/net.d.ts +1 -1
- package/{cloud-DCZv4XAf.d.ts → cloud-B8QYSmW3.d.ts} +3 -3
- package/cloud-BZIJFvPF.cjs +1 -0
- package/{cloud-EfyYfgVT.js → cloud-oMACx7NL.js} +75 -75
- package/cloud.cjs +1 -1
- package/cloud.d.ts +3 -3
- package/cloud.js +2 -2
- package/{contract-_nWuFitS.d.ts → contract-sDmsw-9f.d.ts} +72 -7
- package/contract.cjs +1 -1
- package/contract.d.ts +2 -2
- package/contract.js +6 -2
- package/dgram.cjs +1 -1
- package/dgram.d.ts +2 -2
- package/dgram.js +1 -1
- package/dns.cjs +1 -1
- package/dns.d.ts +1 -1
- package/dns.js +1 -1
- package/{extension-B7jDaJVp.cjs → extension-Bl5ZNj0d.cjs} +1 -1
- package/{extension-sNRjVbET.js → extension-ChZyZgAL.js} +3 -3
- package/{extension-CqOhrS15.d.ts → extension-DMU-CwMw.d.ts} +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.js +1 -1
- package/{fs-D8RCGFNc.cjs → fs-CaQFRiIT.cjs} +1 -1
- package/{fs-BvNZePtN.js → fs-D3IsGdnN.js} +1 -1
- package/fs.cjs +1 -1
- package/fs.js +1 -1
- package/http.d.ts +1 -1
- package/{index-BUviSXsX.d.ts → index-D2CA-NX5.d.ts} +35 -3
- package/index.cjs +1 -1
- package/index.d.ts +4 -4
- package/index.js +5 -5
- package/{lib-FD1Ssqjt.js → lib-BlyFPeSv.js} +16 -11
- package/lib-tQKlXzhv.cjs +53 -0
- package/{net-eCY_QD4P.d.ts → net-Qmt9L_7t.d.ts} +2 -2
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +1 -1
- package/package.json +1 -1
- package/packages.cjs +1 -1
- package/packages.d.ts +1 -1
- package/packages.js +1 -1
- package/{proxy-CrTXoFQK.d.ts → proxy-CxRQLGNG.d.ts} +2 -2
- package/{proxy-DDwY3AVG.js → proxy-DMTdQ4dN.js} +1 -1
- package/{proxy-CYcaW5ew.cjs → proxy-DjoPtJH9.cjs} +1 -1
- package/rooms.cjs +1 -1
- package/rooms.d.ts +39 -8
- package/rooms.js +117 -95
- package/{storage-dSi2dUKx.cjs → storage-BJd-mWHE.cjs} +1 -1
- package/{storage-BbcnDCnc.js → storage-DSvL-t80.js} +1 -1
- package/api-Djf-XdZ4.cjs +0 -3
- package/cloud-Beg4iCRU.cjs +0 -1
- package/lib-DYKLnpWs.cjs +0 -53
package/dgram.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-Djf-XdZ4.cjs"),n=require("./busy-Dv8wzE5M.cjs"),r=require("./utils-BvgGdrgN.cjs");require("./wire.cjs");let i=require("buffer"),a=require("events"),o=require("ip-address");var s=e.t({Socket:()=>c,createSocket:()=>m,default:()=>h}),c=class extends a.EventEmitter{_type;_localAddress;_remoteAddress;_connectedLocally;_connectGeneration=0;_destroyed=!1;_busyRelease;_webVPNUdpSocketPromise;_dataPort;_socketId;_sendQueue=[];_sendQueueBytes=0;_sendFlushScheduled=!1;_peerTailCache=new Map;constructor(e){if(super(e),!e)throw Error(`Missing options`);this._type=e.type,e.connection&&this.__webvpn_udp_socket_init__(e.connection)}_lastRecvBufferSize=0;_lastSendBufferSize=0;_lastTtl=64;_lastMulticastTtl=1;_lastMulticastLoopback=!0;_setUdpOption(e){if(!this._webVPNUdpSocketPromise){this.emit(`error`,Error(`Cannot set socket option before bind`));return}this._webVPNUdpSocketPromise.then(async t=>{if(t)try{await t.setOption(e)}catch(e){this.emit(`error`,e)}})}_dataPortAcks=!1;_dataPortConsumedBytes=0;_dataPortAckedBytes=0;_ackDataPortBatch(e){if(!this._dataPortAcks||!this._dataPort||(this._dataPortConsumedBytes+=e,this._dataPortAckedBytes!==0&&this._dataPortConsumedBytes-this._dataPortAckedBytes<524288))return;this._dataPortAckedBytes=this._dataPortConsumedBytes;let t={type:r.n,consumedBytes:this._dataPortConsumedBytes};this._dataPort.postMessage(t)}_onTransportClosed(e){this._destroyed||(this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0,this.listenerCount(`error`)>0&&this.emit(`error`,Error(e||`WebVPN session closed`)),this.emit(`close`))}_onDataPortBatch(e){let t=new DataView(e),n=!1,r,a=0;for(;a+4<=e.byteLength;){let o=t.getUint32(a);a+=4;let s=a+o;if(s>e.byteLength)break;let c=a+4,l=t.getUint8(c);c+=1;let u,d,p;if(l===2){if(!this._remoteAddress){a=s;continue}u=this._remoteAddress.address,d=this._remoteAddress.family,p=this._remoteAddress.port}else{let n=new Uint8Array(e,c,l===0?4:16);l===0?(d=`IPv4`,u=`${n[0]}.${n[1]}.${n[2]}.${n[3]}`):(d=`IPv6`,u=f(n)),c+=n.byteLength,p=t.getUint16(c),c+=2}let m=t.getUint32(c);c+=4;try{this.emit(`message`,i.Buffer.from(e.slice(c,c+m)),{address:u,family:d,port:p,size:m})}catch(e){n||(n=!0,r=e)}a=s}if(n)throw r}_peerTail(e,t){if(e===void 0||t===void 0)return l;let n=`${e}|${t}`,r=this._peerTailCache.get(n);if(r)return r;let i=o.Address4.isValid(e)?d(e):p(e),a=new Uint8Array(1+i.byteLength+2);return a[0]=i.byteLength===4?0:1,a.set(i,1),new DataView(a.buffer).setUint16(1+i.byteLength,t),this._peerTailCache.size>=4096&&this._peerTailCache.clear(),this._peerTailCache.set(n,a),a}_portSend(e,t,n){let r=this._peerTail(t,n),i=new Uint8Array(8+r.byteLength+4+e.byteLength),a=new DataView(i.buffer);a.setUint32(0,i.byteLength-4),a.setUint32(4,this._socketId),i.set(r,8),a.setUint32(8+r.byteLength,e.byteLength),i.set(e,12+r.byteLength),this._sendQueue.push(i),this._sendQueueBytes+=i.byteLength,!this._sendFlushScheduled&&(this._sendFlushScheduled=!0,queueMicrotask(()=>{this._sendFlushScheduled=!1;let e=this._sendQueue,t=this._sendQueueBytes;if(this._sendQueue=[],this._sendQueueBytes=0,!e.length||!this._dataPort)return;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;this._dataPort.postMessage(n.buffer,[n.buffer])}))}addMembership(e,t){if(o.Address4.isValid(e)){let n=d(e),r=t&&o.Address4.isValid(t)?d(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:5,group:n,interface:r})}else if(o.Address6.isValid(e)){let t=p(e);this._setUdpOption({type:7,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}address(){if(!this._localAddress)throw Error(`EBADF`);return this._localAddress}bind(...e){let n=r.o(...e),i=this._type===`udp6`?`::`:`0.0.0.0`,a=this.__webvpn_udp_socket_init__(t.o(`a udp socket`).then(e=>e.cloud.webvpn.udpSocket({type:this._type,address:n.address??i,port:n.port,dataPort:!0})));return n.callback&&a.then(e=>{e&&n.callback.call(this)}),this}__webvpn_udp_socket_init__(e,t){return t&&(this._localAddress={address:t.localAddress,family:t.localFamily,port:t.localPort}),this._busyRelease??=n.t(`udp socket`),this._webVPNUdpSocketPromise=e.then(e=>{if(e.dataPort)this._socketId=e.socketId,this._dataPort=e.dataPort,this._dataPortAcks=e.dataPortAcks===!0,this._dataPort.onmessage=e=>{try{this._onDataPortBatch(e.data)}finally{this._ackDataPortBatch(e.data.byteLength)}};else{let t=e.dataReadableStream.getReader();(async()=>{for(;;){let{value:e,done:n}=await t.read();if(n)return;this.emit(`message`,i.Buffer.from(e.data),{address:e.address,family:e.family,port:e.port,size:e.size})}})().catch(e=>this._onTransportClosed(e instanceof Error?e.message:void 0))}return e.closed?.then(e=>this._onTransportClosed(e?.reason)).catch(()=>{}),this._localAddress={address:e.localAddress,family:e.localFamily,port:e.localPort},e}).catch(e=>{this.emit(`error`,e)}),this._webVPNUdpSocketPromise.then(e=>{if(!e){this._busyRelease?.();return}this.emit(`listening`)}),this._webVPNUdpSocketPromise}close(e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);return this._webVPNUdpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not bound`);let n=this._destroyed;this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0;try{await t.close()}finally{try{e&&e()}finally{n||this.emit(`close`)}}}).catch(()=>{}),this}connect(...e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not bound`);let n=e[0],r=this._type===`udp6`?`::1`:`127.0.0.1`,i=typeof e[1]==`string`?e[1]:r,a=typeof e.at(-1)==`function`?e.at(-1):void 0,o=await t.connect({remotePort:n,remoteAddress:i});this._connectedLocally=o?.local===!0,this._remoteAddress=o?.address?{address:o.address,family:o.family,port:o.port}:{address:i,family:this._type===`udp6`?`IPv6`:`IPv4`,port:n},this._connectGeneration+=1,a&&a()}).catch(e=>{this.emit(`error`,e)})}disconnect(){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);let e=this._remoteAddress,t=this._connectedLocally,n=this._connectGeneration;this._remoteAddress=void 0,this._connectedLocally=void 0,this._webVPNUdpSocketPromise.then(e=>e?.disconnect?.()).catch(r=>{this._connectGeneration===n&&(this._remoteAddress=e,this._connectedLocally=t),this.emit(`error`,r)})}dropMembership(e,t){if(o.Address4.isValid(e)){let n=d(e),r=t&&o.Address4.isValid(t)?d(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:6,group:n,interface:r})}else if(o.Address6.isValid(e)){let t=p(e);this._setUdpOption({type:8,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}getRecvBufferSize(){return this._lastRecvBufferSize}getSendBufferSize(){return this._lastSendBufferSize}getSendQueueSize(){return 0}getSendQueueCount(){return 0}ref(){return this}remoteAddress(){if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);return{address:this._remoteAddress.address,family:this._remoteAddress.family,port:this._remoteAddress.port}}send(...e){this._webVPNUdpSocketPromise||this.bind();let t=r.s(...e),n=u(t.message),i=n;if(t.hasRange){let{offset:e,length:r}=t;if(!Number.isInteger(e)||e<0||e>n.byteLength)throw Object.assign(RangeError(`"offset" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});if(!Number.isInteger(r)||r<0||r>n.byteLength-e)throw Object.assign(RangeError(`"length" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});i=n.subarray(e,e+r)}let a=this._type===`udp6`?`::1`:`127.0.0.1`;if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(e=>{if(!e)throw Error(`Socket not bound`);let n=t.callback,r=t.address??a,s=this._remoteAddress!==void 0&&t.address===void 0;if(this._dataPort&&(s||o.Address4.isValid(r)||o.Address6.isValid(r))){this._portSend(i,s?void 0:r,s?void 0:t.port),n?.call(this,null,i.byteLength);return}e.send({port:t.port,address:r,message:i.byteOffset===0&&i.byteLength===i.buffer.byteLength?i.buffer:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)}).then(()=>n?.call(this,null,i.byteLength),e=>n?n.call(this,e,0):this.emit(`error`,e))})}setBroadcast(e){this._setUdpOption({type:0,value:e})}setMulticastInterface(e){}setMulticastLoopback(e){return this._setUdpOption({type:3,value:e}),this._setUdpOption({type:4,value:e}),this._lastMulticastLoopback=e,e}setMulticastTTL(e){return this._setUdpOption({type:2,value:e}),this._lastMulticastTtl=e,e}setRecvBufferSize(e){this._setUdpOption({type:10,value:e}),this._lastRecvBufferSize=e}setSendBufferSize(e){this._setUdpOption({type:9,value:e}),this._lastSendBufferSize=e}setTTL(e){return this._setUdpOption({type:1,value:e}),this._lastTtl=e,e}unref(){return this}addSourceSpecificMembership(e,t,n){}dropSourceSpecificMembership(e,t,n){}async[Symbol.asyncDispose](){await new Promise(e=>{this.close(e)})}},l=new Uint8Array([2]),u=e=>{if(typeof e==`string`)return r.l.encode(e);if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(Array.isArray(e)){let t=e.map(u),n=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0)),r=0;for(let e of t)n.set(e,r),r+=e.byteLength;return n}return new Uint8Array(e)},d=e=>{let t=e.split(`.`).map(e=>parseInt(e,10));if(t.length!==4||t.some(e=>Number.isNaN(e)||e<0||e>255))throw Error(`Invalid IPv4 address: ${e}`);return new Uint8Array(t)},f=e=>{let t=[];for(let n=0;n<16;n+=2)t.push(e[n]<<8|e[n+1]);let n=-1,r=1;for(let e=0;e<8;){if(t[e]!==0){e++;continue}let i=e;for(;i<8&&t[i]===0;)i++;i-e>r&&(n=e,r=i-e),e=i}return n===-1?t.map(e=>e.toString(16)).join(`:`):`${t.slice(0,n).map(e=>e.toString(16)).join(`:`)}::${t.slice(n+r).map(e=>e.toString(16)).join(`:`)}`},p=e=>{let t=new o.Address6(e).getBitsBase16(0,128).match(/.{2}/g);if(!t||t.length!==16)throw Error(`Invalid IPv6 address: ${e}`);return new Uint8Array(t.map(e=>parseInt(e,16)))},m=(e,t)=>{let n=new c(typeof e==`string`?{type:e}:e);return t&&n.on(`message`,t),n},h={Socket:c,createSocket:m};exports.Socket=c,exports.createSocket=m,exports.default=h,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-jOTOA-5n.cjs"),n=require("./busy-Dv8wzE5M.cjs"),r=require("./utils-BvgGdrgN.cjs");require("./wire.cjs");let i=require("buffer"),a=require("events"),o=require("ip-address");var s=e.t({Socket:()=>c,createSocket:()=>m,default:()=>h}),c=class extends a.EventEmitter{_type;_localAddress;_remoteAddress;_connectedLocally;_connectGeneration=0;_destroyed=!1;_busyRelease;_webVPNUdpSocketPromise;_dataPort;_socketId;_sendQueue=[];_sendQueueBytes=0;_sendFlushScheduled=!1;_peerTailCache=new Map;constructor(e){if(super(e),!e)throw Error(`Missing options`);this._type=e.type,e.connection&&this.__webvpn_udp_socket_init__(e.connection)}_lastRecvBufferSize=0;_lastSendBufferSize=0;_lastTtl=64;_lastMulticastTtl=1;_lastMulticastLoopback=!0;_setUdpOption(e){if(!this._webVPNUdpSocketPromise){this.emit(`error`,Error(`Cannot set socket option before bind`));return}this._webVPNUdpSocketPromise.then(async t=>{if(t)try{await t.setOption(e)}catch(e){this.emit(`error`,e)}})}_dataPortAcks=!1;_dataPortConsumedBytes=0;_dataPortAckedBytes=0;_ackDataPortBatch(e){if(!this._dataPortAcks||!this._dataPort||(this._dataPortConsumedBytes+=e,this._dataPortAckedBytes!==0&&this._dataPortConsumedBytes-this._dataPortAckedBytes<524288))return;this._dataPortAckedBytes=this._dataPortConsumedBytes;let t={type:r.n,consumedBytes:this._dataPortConsumedBytes};this._dataPort.postMessage(t)}_onTransportClosed(e){this._destroyed||(this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0,this.listenerCount(`error`)>0&&this.emit(`error`,Error(e||`WebVPN session closed`)),this.emit(`close`))}_onDataPortBatch(e){let t=new DataView(e),n=!1,r,a=0;for(;a+4<=e.byteLength;){let o=t.getUint32(a);a+=4;let s=a+o;if(s>e.byteLength)break;let c=a+4,l=t.getUint8(c);c+=1;let u,d,p;if(l===2){if(!this._remoteAddress){a=s;continue}u=this._remoteAddress.address,d=this._remoteAddress.family,p=this._remoteAddress.port}else{let n=new Uint8Array(e,c,l===0?4:16);l===0?(d=`IPv4`,u=`${n[0]}.${n[1]}.${n[2]}.${n[3]}`):(d=`IPv6`,u=f(n)),c+=n.byteLength,p=t.getUint16(c),c+=2}let m=t.getUint32(c);c+=4;try{this.emit(`message`,i.Buffer.from(e.slice(c,c+m)),{address:u,family:d,port:p,size:m})}catch(e){n||(n=!0,r=e)}a=s}if(n)throw r}_peerTail(e,t){if(e===void 0||t===void 0)return l;let n=`${e}|${t}`,r=this._peerTailCache.get(n);if(r)return r;let i=o.Address4.isValid(e)?d(e):p(e),a=new Uint8Array(1+i.byteLength+2);return a[0]=i.byteLength===4?0:1,a.set(i,1),new DataView(a.buffer).setUint16(1+i.byteLength,t),this._peerTailCache.size>=4096&&this._peerTailCache.clear(),this._peerTailCache.set(n,a),a}_portSend(e,t,n){let r=this._peerTail(t,n),i=new Uint8Array(8+r.byteLength+4+e.byteLength),a=new DataView(i.buffer);a.setUint32(0,i.byteLength-4),a.setUint32(4,this._socketId),i.set(r,8),a.setUint32(8+r.byteLength,e.byteLength),i.set(e,12+r.byteLength),this._sendQueue.push(i),this._sendQueueBytes+=i.byteLength,!this._sendFlushScheduled&&(this._sendFlushScheduled=!0,queueMicrotask(()=>{this._sendFlushScheduled=!1;let e=this._sendQueue,t=this._sendQueueBytes;if(this._sendQueue=[],this._sendQueueBytes=0,!e.length||!this._dataPort)return;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;this._dataPort.postMessage(n.buffer,[n.buffer])}))}addMembership(e,t){if(o.Address4.isValid(e)){let n=d(e),r=t&&o.Address4.isValid(t)?d(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:5,group:n,interface:r})}else if(o.Address6.isValid(e)){let t=p(e);this._setUdpOption({type:7,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}address(){if(!this._localAddress)throw Error(`EBADF`);return this._localAddress}bind(...e){let n=r.o(...e),i=this._type===`udp6`?`::`:`0.0.0.0`,a=this.__webvpn_udp_socket_init__(t.o(`a udp socket`).then(e=>e.cloud.webvpn.udpSocket({type:this._type,address:n.address??i,port:n.port,dataPort:!0})));return n.callback&&a.then(e=>{e&&n.callback.call(this)}),this}__webvpn_udp_socket_init__(e,t){return t&&(this._localAddress={address:t.localAddress,family:t.localFamily,port:t.localPort}),this._busyRelease??=n.t(`udp socket`),this._webVPNUdpSocketPromise=e.then(e=>{if(e.dataPort)this._socketId=e.socketId,this._dataPort=e.dataPort,this._dataPortAcks=e.dataPortAcks===!0,this._dataPort.onmessage=e=>{try{this._onDataPortBatch(e.data)}finally{this._ackDataPortBatch(e.data.byteLength)}};else{let t=e.dataReadableStream.getReader();(async()=>{for(;;){let{value:e,done:n}=await t.read();if(n)return;this.emit(`message`,i.Buffer.from(e.data),{address:e.address,family:e.family,port:e.port,size:e.size})}})().catch(e=>this._onTransportClosed(e instanceof Error?e.message:void 0))}return e.closed?.then(e=>this._onTransportClosed(e?.reason)).catch(()=>{}),this._localAddress={address:e.localAddress,family:e.localFamily,port:e.localPort},e}).catch(e=>{this.emit(`error`,e)}),this._webVPNUdpSocketPromise.then(e=>{if(!e){this._busyRelease?.();return}this.emit(`listening`)}),this._webVPNUdpSocketPromise}close(e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);return this._webVPNUdpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not bound`);let n=this._destroyed;this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0;try{await t.close()}finally{try{e&&e()}finally{n||this.emit(`close`)}}}).catch(()=>{}),this}connect(...e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not bound`);let n=e[0],r=this._type===`udp6`?`::1`:`127.0.0.1`,i=typeof e[1]==`string`?e[1]:r,a=typeof e.at(-1)==`function`?e.at(-1):void 0,o=await t.connect({remotePort:n,remoteAddress:i});this._connectedLocally=o?.local===!0,this._remoteAddress=o?.address?{address:o.address,family:o.family,port:o.port}:{address:i,family:this._type===`udp6`?`IPv6`:`IPv4`,port:n},this._connectGeneration+=1,a&&a()}).catch(e=>{this.emit(`error`,e)})}disconnect(){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);let e=this._remoteAddress,t=this._connectedLocally,n=this._connectGeneration;this._remoteAddress=void 0,this._connectedLocally=void 0,this._webVPNUdpSocketPromise.then(e=>e?.disconnect?.()).catch(r=>{this._connectGeneration===n&&(this._remoteAddress=e,this._connectedLocally=t),this.emit(`error`,r)})}dropMembership(e,t){if(o.Address4.isValid(e)){let n=d(e),r=t&&o.Address4.isValid(t)?d(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:6,group:n,interface:r})}else if(o.Address6.isValid(e)){let t=p(e);this._setUdpOption({type:8,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}getRecvBufferSize(){return this._lastRecvBufferSize}getSendBufferSize(){return this._lastSendBufferSize}getSendQueueSize(){return 0}getSendQueueCount(){return 0}ref(){return this}remoteAddress(){if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);return{address:this._remoteAddress.address,family:this._remoteAddress.family,port:this._remoteAddress.port}}send(...e){this._webVPNUdpSocketPromise||this.bind();let t=r.s(...e),n=u(t.message),i=n;if(t.hasRange){let{offset:e,length:r}=t;if(!Number.isInteger(e)||e<0||e>n.byteLength)throw Object.assign(RangeError(`"offset" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});if(!Number.isInteger(r)||r<0||r>n.byteLength-e)throw Object.assign(RangeError(`"length" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});i=n.subarray(e,e+r)}let a=this._type===`udp6`?`::1`:`127.0.0.1`;if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(e=>{if(!e)throw Error(`Socket not bound`);let n=t.callback,r=t.address??a,s=this._remoteAddress!==void 0&&t.address===void 0;if(this._dataPort&&(s||o.Address4.isValid(r)||o.Address6.isValid(r))){this._portSend(i,s?void 0:r,s?void 0:t.port),n?.call(this,null,i.byteLength);return}e.send({port:t.port,address:r,message:i.byteOffset===0&&i.byteLength===i.buffer.byteLength?i.buffer:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)}).then(()=>n?.call(this,null,i.byteLength),e=>n?n.call(this,e,0):this.emit(`error`,e))})}setBroadcast(e){this._setUdpOption({type:0,value:e})}setMulticastInterface(e){}setMulticastLoopback(e){return this._setUdpOption({type:3,value:e}),this._setUdpOption({type:4,value:e}),this._lastMulticastLoopback=e,e}setMulticastTTL(e){return this._setUdpOption({type:2,value:e}),this._lastMulticastTtl=e,e}setRecvBufferSize(e){this._setUdpOption({type:10,value:e}),this._lastRecvBufferSize=e}setSendBufferSize(e){this._setUdpOption({type:9,value:e}),this._lastSendBufferSize=e}setTTL(e){return this._setUdpOption({type:1,value:e}),this._lastTtl=e,e}unref(){return this}addSourceSpecificMembership(e,t,n){}dropSourceSpecificMembership(e,t,n){}async[Symbol.asyncDispose](){await new Promise(e=>{this.close(e)})}},l=new Uint8Array([2]),u=e=>{if(typeof e==`string`)return r.l.encode(e);if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(Array.isArray(e)){let t=e.map(u),n=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0)),r=0;for(let e of t)n.set(e,r),r+=e.byteLength;return n}return new Uint8Array(e)},d=e=>{let t=e.split(`.`).map(e=>parseInt(e,10));if(t.length!==4||t.some(e=>Number.isNaN(e)||e<0||e>255))throw Error(`Invalid IPv4 address: ${e}`);return new Uint8Array(t)},f=e=>{let t=[];for(let n=0;n<16;n+=2)t.push(e[n]<<8|e[n+1]);let n=-1,r=1;for(let e=0;e<8;){if(t[e]!==0){e++;continue}let i=e;for(;i<8&&t[i]===0;)i++;i-e>r&&(n=e,r=i-e),e=i}return n===-1?t.map(e=>e.toString(16)).join(`:`):`${t.slice(0,n).map(e=>e.toString(16)).join(`:`)}::${t.slice(n+r).map(e=>e.toString(16)).join(`:`)}`},p=e=>{let t=new o.Address6(e).getBitsBase16(0,128).match(/.{2}/g);if(!t||t.length!==16)throw Error(`Invalid IPv6 address: ${e}`);return new Uint8Array(t.map(e=>parseInt(e,16)))},m=(e,t)=>{let n=new c(typeof e==`string`?{type:e}:e);return t&&n.on(`message`,t),n},h={Socket:c,createSocket:m};exports.Socket=c,exports.createSocket=m,exports.default=h,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
|
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 { Tt as UdpSocketResult, U as Resolvers } from "./contract-sDmsw-9f.js";
|
|
3
|
+
import "./api-BxXnHxbd.js";
|
|
4
4
|
import { Buffer } from "buffer";
|
|
5
5
|
import { AddressInfo } from "net";
|
|
6
6
|
import { EventEmitter } from "events";
|
package/dgram.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { o as t } from "./api-
|
|
2
|
+
import { o as t } from "./api-Dp-2AT3u.js";
|
|
3
3
|
import { t as n } from "./busy-B189uX--.js";
|
|
4
4
|
import { l as r, n as i, o as a, s as o } from "./utils-C-cAd4r4.js";
|
|
5
5
|
import "./wire.js";
|
package/dns.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-jOTOA-5n.cjs");var n=e.t({lookup:()=>r}),r=(e,n)=>t.a.then(t=>t.cloud.dns.lookup(e,n));exports.lookup=r,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
|
package/dns.d.ts
CHANGED
package/dns.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { a as t } from "./api-
|
|
2
|
+
import { a as t } from "./api-Dp-2AT3u.js";
|
|
3
3
|
//#region src/dns.ts
|
|
4
4
|
var n = /* @__PURE__ */ e({ lookup: () => r }), r = (e, n) => t.then((t) => t.cloud.dns.lookup(e, n));
|
|
5
5
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-tQKlXzhv.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.q())return!0;let r=await n.a,i=null,a=new Promise(e=>{i=()=>{t.q()&&e(!0)},t.K.addEventListener(`statuschange`,i)}),o=r.installPrompt.show(e).then(()=>!1),s=await Promise.race([a,o]);return i&&t.K.removeEventListener(`statuschange`,i),await r.installPrompt.hide().catch(()=>{}),s},o=null;t.Y(()=>(o||=a().then(()=>void 0).finally(()=>{o=null}),o));var s=()=>typeof document<`u`&&t.q(),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.I(e,a)}return s()?t.I(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.y,EXTENSION_ABI:()=>3,ExtensionOperationUnsupportedError:()=>t.Q,ExtensionOutdatedError:()=>t.$,FORGEABLE_HEADERS:()=>t.H,FrameWindowBlockedError:()=>t.d,FrameWindowRefusedError:()=>t.f,LOCATOR_DENIED:()=>t.w,LOCATOR_ERROR:()=>t.O,LOCATOR_UNSUPPORTED:()=>t.b,PERMISSION_DENIED:()=>t.t,REQUIRED_EXTENSION_ABI:()=>0,assertAttachableFrameUrl:()=>t.g,assertFetchableUrl:()=>t.F,assertForgeableHeaders:()=>t.U,assertLockdownApplicable:()=>t._,assertOneCookieIdentity:()=>t.W,attachFrame:()=>t.a,attachFramePermission:()=>t.p,available:()=>s,box:()=>t.rt,cookies:()=>t.N,createFrame:()=>t.m,createVideoElementHandle:()=>t.it,events:()=>t.K,extension:()=>t.K,fetch:()=>t.I,fetchCredentialedPermission:()=>t.L,fetchLocalPermission:()=>t.R,fetchPermission:()=>t.z,gotoPermission:()=>t.h,handleRevivableModules:()=>t.nt,hasForgedCookie:()=>t.G,isBlockedFetchUrl:()=>t.B,isBlockedFrameUrl:()=>t.v,isExtensionExposed:()=>t.q,isLocalNetworkUrl:()=>t.V,isLocatorDenied:()=>t.k,isLocatorUnsupported:()=>t.x,isPermissionDenied:()=>t.n,isTerminalError:()=>t.D,isType:()=>t.at,modifyRequestHeadersPermission:()=>t.A,permissions:()=>t.r,promptInstall:()=>a,readCookiePermission:()=>t.P,readExtensionHandshake:()=>t.J,removeRequestHeaderRule:()=>t.j,revive:()=>t.ot,setMissingExtensionHandler:()=>t.Y,setRequestHeaderRule:()=>t.M,supportsOperation:()=>t.tt,type:()=>t.st,waitForExtensionExposure:()=>t.X});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}});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { $ as t, A as n, B as r, D as i, F as a, G as o, H as s, I as c, J as l, K as u, L as ee, M as te, N as ne, O as d, P as f, Q as p, R as m, U as h, V as g, W as _, X as v, Y as y, _ as b, a as x, at as S, b as C, d as w, f as T, g as E, h as D, i as O, it as k, j as A, k as re, m as j, n as M, nt as N, ot as P, p as F, q as I, r as L, rt as R, st as z, t as B, tt as V, v as H, w as U, x as W, y as G, z as K } from "./lib-
|
|
3
|
-
import { a as q, d as J } from "./api-
|
|
4
|
-
import { t as Y } from "./proxy-
|
|
2
|
+
import { $ as t, A as n, B as r, D as i, F as a, G as o, H as s, I as c, J as l, K as u, L as ee, M as te, N as ne, O as d, P as f, Q as p, R as m, U as h, V as g, W as _, X as v, Y as y, _ as b, a as x, at as S, b as C, d as w, f as T, g as E, h as D, i as O, it as k, j as A, k as re, m as j, n as M, nt as N, ot as P, p as F, q as I, r as L, rt as R, st as z, t as B, tt as V, v as H, w as U, x as W, y as G, z as K } from "./lib-BlyFPeSv.js";
|
|
3
|
+
import { a as q, d as J } from "./api-Dp-2AT3u.js";
|
|
4
|
+
import { t as Y } from "./proxy-DMTdQ4dN.js";
|
|
5
5
|
import { available as X, fetch as ie } from "./desktop.js";
|
|
6
6
|
//#region src/extension-prompt.ts
|
|
7
7
|
var Z = async (e) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as CATEGORIES, B as revive, C as gotoPermission, D as PermissionGrant, E as LegacyPermissionRequest, F as RemoteVideoElement, G as OperationRequest, H as Executor, I as VideoElementState, K as SelectorPart, L as box, M as PermissionCategory, N as handleRevivableModules, O as PermissionRequest, P as BoxedVideoElement, R as createVideoElementHandle, S as createFrame, T as CategoryRequest, U as Gate, V as type, W as GateTools, _ as FrameWindowRefusedError, a as AttachWindowOptions, b as WindowFrame, c as FrameBackendEvent, d as FrameEventMap, f as FrameMessageEvent, g as FrameWindowRefusal, h as FrameWindowOptions, i as AttachFrameOptions, j as CategoryMeta, k as permissions, l as FrameDocumentEvent, m as FrameWindowBlockedError, n as attachFrame, o as Frame, p as FramePostMessageOptions, s as FrameBackend, t as ATTACH_FRAME_EVENT_KEY, u as FrameEventListener, v as GotoOptions, w as CategoryGrant, x as attachFramePermission, y as Locator, z as isType } from "./index-
|
|
1
|
+
import { A as CATEGORIES, B as revive, C as gotoPermission, D as PermissionGrant, E as LegacyPermissionRequest, F as RemoteVideoElement, G as OperationRequest, H as Executor, I as VideoElementState, K as SelectorPart, L as box, M as PermissionCategory, N as handleRevivableModules, O as PermissionRequest, P as BoxedVideoElement, R as createVideoElementHandle, S as createFrame, T as CategoryRequest, U as Gate, V as type, W as GateTools, _ as FrameWindowRefusedError, a as AttachWindowOptions, b as WindowFrame, c as FrameBackendEvent, d as FrameEventMap, f as FrameMessageEvent, g as FrameWindowRefusal, h as FrameWindowOptions, i as AttachFrameOptions, j as CategoryMeta, k as permissions, l as FrameDocumentEvent, m as FrameWindowBlockedError, n as attachFrame, o as Frame, p as FramePostMessageOptions, s as FrameBackend, t as ATTACH_FRAME_EVENT_KEY, u as FrameEventListener, v as GotoOptions, w as CategoryGrant, x as attachFramePermission, y as Locator, z as isType } from "./index-D2CA-NX5.js";
|
|
2
2
|
//#region ../frame-locator/lib/errors.d.ts
|
|
3
3
|
declare const LOCATOR_ERROR = "LocatorError";
|
|
4
4
|
declare const LOCATOR_UNSUPPORTED = "LocatorUnsupportedError";
|
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-tQKlXzhv.cjs"),t=require("./extension-Bl5ZNj0d.cjs");exports.ATTACH_FRAME_EVENT_KEY=e.i,exports.CATEGORIES=e.y,exports.EXTENSION_ABI=e.Z,exports.ExtensionOperationUnsupportedError=e.Q,exports.ExtensionOutdatedError=e.$,exports.FORGEABLE_HEADERS=e.H,exports.FrameWindowBlockedError=e.d,exports.FrameWindowRefusedError=e.f,exports.LOCATOR_DENIED=e.w,exports.LOCATOR_ERROR=e.O,exports.LOCATOR_UNSUPPORTED=e.b,exports.PERMISSION_DENIED=e.t,exports.REQUIRED_EXTENSION_ABI=e.et,exports.assertAttachableFrameUrl=e.g,exports.assertFetchableUrl=e.F,exports.assertForgeableHeaders=e.U,exports.assertLockdownApplicable=e._,exports.assertOneCookieIdentity=e.W,exports.attachFrame=e.a,exports.attachFramePermission=e.p,exports.available=t.r,exports.box=e.rt,exports.cookies=e.N,exports.createFrame=e.m,exports.createVideoElementHandle=e.it,exports.events=e.K,exports.extension=e.K,exports.fetch=e.I,exports.fetchCredentialedPermission=e.L,exports.fetchLocalPermission=e.R,exports.fetchPermission=e.z,exports.gotoPermission=e.h,exports.handleRevivableModules=e.nt,exports.hasForgedCookie=e.G,exports.isBlockedFetchUrl=e.B,exports.isBlockedFrameUrl=e.v,exports.isExtensionExposed=e.q,exports.isLocalNetworkUrl=e.V,exports.isLocatorDenied=e.k,exports.isLocatorUnsupported=e.x,exports.isPermissionDenied=e.n,exports.isTerminalError=e.D,exports.isType=e.at,exports.modifyRequestHeadersPermission=e.A,exports.permissions=e.r,exports.promptInstall=t.i,exports.readCookiePermission=e.P,exports.readExtensionHandshake=e.J,exports.removeRequestHeaderRule=e.j,exports.revive=e.ot,exports.setMissingExtensionHandler=e.Y,exports.setRequestHeaderRule=e.M,exports.supportsOperation=e.tt,exports.type=e.st,exports.waitForExtensionExposure=e.X;
|
package/extension.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as CATEGORIES, B as revive, C as gotoPermission, D as PermissionGrant, E as LegacyPermissionRequest, F as RemoteVideoElement, G as OperationRequest, H as Executor, I as VideoElementState, K as SelectorPart, L as box, M as PermissionCategory, N as handleRevivableModules, O as PermissionRequest, P as BoxedVideoElement, R as createVideoElementHandle, S as createFrame, T as CategoryRequest, U as Gate, V as type, W as GateTools, _ as FrameWindowRefusedError, a as AttachWindowOptions, b as WindowFrame, c as FrameBackendEvent, d as FrameEventMap, f as FrameMessageEvent, g as FrameWindowRefusal, h as FrameWindowOptions, i as AttachFrameOptions, j as CategoryMeta, k as permissions, l as FrameDocumentEvent, m as FrameWindowBlockedError, n as attachFrame, o as Frame, p as FramePostMessageOptions, s as FrameBackend, t as ATTACH_FRAME_EVENT_KEY, u as FrameEventListener, v as GotoOptions, w as CategoryGrant, x as attachFramePermission, y as Locator, z as isType } from "./index-
|
|
2
|
-
import { A as readCookiePermission, B as FORGEABLE_HEADERS, C as RequestHeaderRule, D as CookieDetails, E as setRequestHeaderRule, F as fetchCredentialedPermission, G as LOCATOR_ERROR, H as assertOneCookieIdentity, I as fetchLocalPermission, J as isLocatorUnsupported, K as LOCATOR_UNSUPPORTED, L as fetchPermission, M as ProxyFetchRequest, N as assertFetchableUrl, O as SiteCookie, P as fetch, R as isBlockedFetchUrl, S as HeaderOperation, T as removeRequestHeaderRule, U as hasForgedCookie, V as assertForgeableHeaders, W as LOCATOR_DENIED, Y as isTerminalError, _ as PermissionDeniedError, a as extension, b as assertLockdownApplicable, c as setMissingExtensionHandler, d as ExtensionHandshake, f as ExtensionOperationUnsupportedError, g as PERMISSION_DENIED, h as supportsOperation, i as promptInstall, j as FetchInit, k as cookies, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, o as isExtensionExposed, p as ExtensionOutdatedError, q as isLocatorDenied, r as isExtensionAvailable, s as readExtensionHandshake, u as EXTENSION_ABI, v as isPermissionDenied, w as modifyRequestHeadersPermission, x as isBlockedFrameUrl, y as assertAttachableFrameUrl, z as isLocalNetworkUrl } from "./extension-
|
|
1
|
+
import { A as CATEGORIES, B as revive, C as gotoPermission, D as PermissionGrant, E as LegacyPermissionRequest, F as RemoteVideoElement, G as OperationRequest, H as Executor, I as VideoElementState, K as SelectorPart, L as box, M as PermissionCategory, N as handleRevivableModules, O as PermissionRequest, P as BoxedVideoElement, R as createVideoElementHandle, S as createFrame, T as CategoryRequest, U as Gate, V as type, W as GateTools, _ as FrameWindowRefusedError, a as AttachWindowOptions, b as WindowFrame, c as FrameBackendEvent, d as FrameEventMap, f as FrameMessageEvent, g as FrameWindowRefusal, h as FrameWindowOptions, i as AttachFrameOptions, j as CategoryMeta, k as permissions, l as FrameDocumentEvent, m as FrameWindowBlockedError, n as attachFrame, o as Frame, p as FramePostMessageOptions, s as FrameBackend, t as ATTACH_FRAME_EVENT_KEY, u as FrameEventListener, v as GotoOptions, w as CategoryGrant, x as attachFramePermission, y as Locator, z as isType } from "./index-D2CA-NX5.js";
|
|
2
|
+
import { A as readCookiePermission, B as FORGEABLE_HEADERS, C as RequestHeaderRule, D as CookieDetails, E as setRequestHeaderRule, F as fetchCredentialedPermission, G as LOCATOR_ERROR, H as assertOneCookieIdentity, I as fetchLocalPermission, J as isLocatorUnsupported, K as LOCATOR_UNSUPPORTED, L as fetchPermission, M as ProxyFetchRequest, N as assertFetchableUrl, O as SiteCookie, P as fetch, R as isBlockedFetchUrl, S as HeaderOperation, T as removeRequestHeaderRule, U as hasForgedCookie, V as assertForgeableHeaders, W as LOCATOR_DENIED, Y as isTerminalError, _ as PermissionDeniedError, a as extension, b as assertLockdownApplicable, c as setMissingExtensionHandler, d as ExtensionHandshake, f as ExtensionOperationUnsupportedError, g as PERMISSION_DENIED, h as supportsOperation, i as promptInstall, j as FetchInit, k as cookies, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, o as isExtensionExposed, p as ExtensionOutdatedError, q as isLocatorDenied, r as isExtensionAvailable, s as readExtensionHandshake, u as EXTENSION_ABI, v as isPermissionDenied, w as modifyRequestHeadersPermission, x as isBlockedFrameUrl, y as assertAttachableFrameUrl, z as isLocalNetworkUrl } from "./extension-DMU-CwMw.js";
|
|
3
3
|
export { ATTACH_FRAME_EVENT_KEY, AttachFrameOptions, AttachWindowOptions, BoxedVideoElement, CATEGORIES, CategoryGrant, type CategoryMeta, CategoryRequest, CookieDetails, EXTENSION_ABI, type Executor, type ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, FrameBackendEvent, FrameDocumentEvent, FrameEventListener, FrameEventMap, FrameMessageEvent, FramePostMessageOptions, FrameWindowBlockedError, FrameWindowOptions, FrameWindowRefusal, FrameWindowRefusedError, type Gate, type GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_UNSUPPORTED, LegacyPermissionRequest, Locator, type OperationRequest, PERMISSION_DENIED, type PermissionCategory, type PermissionDeniedError, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, type SelectorPart, SiteCookie, 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, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, 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, A as t, B as n, D 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 d, N as f, O as p, P as m, Q as h, R as g, U as _, V as v, W as y, X as b, Y as x, Z as S, _ as C, a as w, at as T, b as E, d as D, et as O, f as k, g as A, h as j, i as M, it as N, j as P, k as F, m as I, n as L, nt as R, ot as z, p as B, q as V, r as H, rt as U, st as W, t as G, tt as K, v as q, w as J, x as Y, y as X, z as Z } from "./lib-
|
|
2
|
-
import { i as Q, r as $ } from "./extension-
|
|
1
|
+
import { $ as e, A as t, B as n, D 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 d, N as f, O as p, P as m, Q as h, R as g, U as _, V as v, W as y, X as b, Y as x, Z as S, _ as C, a as w, at as T, b as E, d as D, et as O, f as k, g as A, h as j, i as M, it as N, j as P, k as F, m as I, n as L, nt as R, ot as z, p as B, q as V, r as H, rt as U, st as W, t as G, tt as K, v as q, w as J, x as Y, y as X, z as Z } from "./lib-BlyFPeSv.js";
|
|
2
|
+
import { i as Q, r as $ } from "./extension-ChZyZgAL.js";
|
|
3
3
|
export { M as ATTACH_FRAME_EVENT_KEY, X as CATEGORIES, S as EXTENSION_ABI, h as ExtensionOperationUnsupportedError, e as ExtensionOutdatedError, o as FORGEABLE_HEADERS, D as FrameWindowBlockedError, k as FrameWindowRefusedError, J as LOCATOR_DENIED, p as LOCATOR_ERROR, E as LOCATOR_UNSUPPORTED, G as PERMISSION_DENIED, O as REQUIRED_EXTENSION_ABI, A as assertAttachableFrameUrl, i as assertFetchableUrl, _ as assertForgeableHeaders, C as assertLockdownApplicable, y as assertOneCookieIdentity, w as attachFrame, B as attachFramePermission, $ as available, U as box, f as cookies, I as createFrame, N as createVideoElementHandle, l as events, l as extension, s as fetch, u as fetchCredentialedPermission, g as fetchLocalPermission, Z as fetchPermission, j as gotoPermission, R as handleRevivableModules, a as hasForgedCookie, n as isBlockedFetchUrl, q as isBlockedFrameUrl, V as isExtensionExposed, v as isLocalNetworkUrl, F as isLocatorDenied, Y as isLocatorUnsupported, L as isPermissionDenied, r as isTerminalError, T as isType, t as modifyRequestHeadersPermission, H as permissions, Q as promptInstall, m as readCookiePermission, c as readExtensionHandshake, P as removeRequestHeaderRule, z as revive, x as setMissingExtensionHandler, d as setRequestHeaderRule, K as supportsOperation, W as type, b 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-CaQFRiIT.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.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as e } from "../fs-
|
|
1
|
+
import { v as e } from "../fs-D3IsGdnN.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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./busy-Dv8wzE5M.cjs"),n=require("./node-fs-BNTPsX5c.cjs"),r=require("./storage-dSi2dUKx.cjs"),i=require("./opfs-CXMESVLc.cjs");var a=e.t({adopt:()=>I,adoptable:()=>L,available:()=>u,list:()=>re,onConflict:()=>le,pending:()=>C,pendingDeletes:()=>w,pull:()=>ce,readFile:()=>ie,readFileSealed:()=>ae,remove:()=>se,replicating:()=>T,writeFile:()=>oe}),o,s=async()=>await(o??=i.t().catch(()=>!1))?!0:(o=void 0,!1),c=()=>r.r().catch(()=>`unknown`),l=async()=>await c()===`connected`,u=async()=>await s()||await l(),d=`fkn:fs:pending`,f=`fkn:fs:pending-delete`,p=`fkn:fs:adopt-declined`,m=!0,h=new Map,g=e=>{try{let t=localStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);return Array.isArray(n)?Object.fromEntries(n.filter(e=>typeof e==`string`).map(e=>[e,null])):n&&typeof n==`object`?n:{}}catch{return{}}},_=(e,t)=>{try{Object.keys(t).length?localStorage.setItem(e,JSON.stringify(t)):localStorage.removeItem(e)}catch{}},v=()=>g(d),y=(e,t)=>{let n=v();e in n||(n[e]=t===void 0?h.get(e)??null:t,_(d,n))},b=e=>{let t=v();e in t&&(delete t[e],_(d,t),D()||(k=O))},x=()=>g(f),ee=e=>{let t=x();e in t||(t[e]=h.get(e)??null,_(f,t))},S=e=>{let t=x();e in t&&(delete t[e],_(f,t),D()||(k=O))},C=()=>Object.keys(v()),w=()=>Object.keys(x()),T=()=>m,E=null;t.r(`storage replication`,()=>E!==null||R!==null);var D=()=>Object.keys(v()).length>0||Object.keys(x()).length>0,O=6e4,te=6e5,k=O,A=null,j=()=>{!A&&typeof window<`u`&&D()&&(A=setTimeout(()=>{A=null,M()},k),k=Math.min(k*2,te))},M=()=>{!E&&D()&&(E=F(!1).then(e=>{if(!D()){k=O;return}e.failed.length&&j()}).catch(()=>{j()}).finally(()=>{E=null}))},ne=null,N=()=>ne??=Promise.resolve().then(()=>require("./api.cjs")).then(e=>e.apiPromise),re=async()=>{U();let e=await c(),t=e===`connected`,[n,a]=await Promise.all([s().then(e=>e?i.n():[]).catch(()=>[]),t?r.o().then(e=>({ok:!0,entries:e})).catch(()=>({ok:!1,entries:[]})):Promise.resolve({ok:e===`disconnected`,entries:[]})]);e!==`unknown`&&(m=a.ok),a.ok&&e!==`unknown`&&(h=new Map(a.entries.map(e=>[e.path,e.updatedAt])));let o=new Map,l=e=>{let t=Date.parse(e.updatedAt??``);return Number.isFinite(t)?t:0},u=e=>{let t=o.get(e.path);(!t||l(e)>=l(t))&&o.set(e.path,e)};for(let e of n)u(e);for(let e of a.entries)u(e);return a.ok&&t&&(me(n,a.entries).catch(()=>{}),D()?M():z({local:n,remote:a.entries}).catch(()=>{})),[...o.values()]},ie=async e=>{if(await s())try{return await i.i(e)}catch(e){if(e?.name!==`NotFoundError`)throw e}let t=await r.c(e);return await s()&&i.o(e,t).catch(()=>{}),t},ae=async e=>{if(await s())try{let t=await i.i(e);return{data:new Uint8Array(await t.arrayBuffer()),sealedAt:null}}catch(e){if(e?.name!==`NotFoundError`)throw e}return r.l(e)},oe=async(e,t,n)=>{let a=t instanceof Blob?t:new Blob([t],n?.contentType?{type:n.contentType}:void 0);if(await s()){await i.o(e,a,n),U();let t=h.get(e)??null,o=await c();if(o===`disconnected`)return;if(o===`unknown`||!m){y(e,t),j();return}r.p(e,a,n).then(()=>b(e)).catch(n=>{y(e,t),j(),console.warn(`fs: cloud replicate failed, queued for adopt()`,n)});return}let o=await c();if(o===`connected`)return r.p(e,a,n);throw Error(o===`unknown`?`fs: cloud unreachable`:`fs: no storage backend available`)},se=async e=>{U();let t=[];await s()&&t.push(i.a(e).catch(()=>{}));let n=await c();if(n===`connected`?t.push(r.u(e).then(()=>S(e)).catch(t=>{ee(e),j(),console.warn(`fs: cloud delete failed, queued for retry`,t)})):n===`unknown`&&t.length&&h.has(e)&&(ee(e),j()),!t.length)throw Error(n===`unknown`?`fs: cloud unreachable`:`fs: no storage backend available`);b(e),await Promise.all(t)},ce=async e=>{let t=await r.c(e);return await s()&&await i.o(e,t),t},P=null,le=e=>(P=e,()=>{P===e&&(P=null)}),ue=async e=>{let t=await(await N()).cloud.fs.promptConflict({path:e.path,local:e.local,cloud:e.cloud}).catch(()=>null);return t===`local`?e.readLocal():t===`cloud`?e.readCloud():null},de=async e=>{if(P)try{return await P(e)}catch{return null}return ue(e)},F=async e=>{let t={uploaded:[],kept:[],resolved:[],unresolved:[],deleted:[],failed:[]},n=await c();if(n===`unknown`)throw Error(`fs: cloud unreachable`);if(n!==`connected`)throw Error(`fs: this needs a signed-in account`);let a=await s(),[o,l]=await Promise.all([a?i.n():Promise.resolve([]),r.o()]),u=new Map(l.map(e=>[e.path,e])),d=v();if(a)for(let e of Object.keys(d))o.some(t=>t.path===e)||b(e);for(let[e,n]of Object.entries(x())){let i=u.get(e);if(!i){S(e);continue}if(o.some(t=>t.path===e)){S(e);continue}if(i.updatedAt!==n){S(e);continue}try{await r.u(e),S(e),t.deleted.push(e)}catch(n){t.failed.push({path:e,error:n instanceof Error?n.message:String(n)})}}for(let n of o){let a=u.get(n.path),o=n.path in d;if(!o&&(a||!e)){a&&t.kept.push(n.path);continue}if(o&&a&&a.updatedAt!==d[n.path]){let e=null,o=null,s=await de({path:n.path,local:{size:n.size,updatedAt:n.updatedAt},cloud:{size:a.size,updatedAt:a.updatedAt},readLocal:()=>e??=i.i(n.path),readCloud:()=>o??=r.c(n.path)});if(s==null){t.unresolved.push(n.path);continue}try{let a=e!==null&&s===await e,c=o!==null&&s===await o;c||await r.p(n.path,s,n.contentType?{contentType:n.contentType}:void 0),a||await i.o(n.path,s),b(n.path),t.resolved.push({path:n.path,choice:a?`local`:c?`cloud`:`merged`})}catch(e){if(e?.code===`FKN_E2E_LOCKED`)throw e;t.failed.push({path:n.path,error:e instanceof Error?e.message:String(e)})}continue}try{let e=await i.i(n.path);await r.p(n.path,e,n.contentType?{contentType:n.contentType}:void 0),b(n.path),t.uploaded.push(n.path)}catch(e){if(y(n.path),e?.code===`FKN_E2E_LOCKED`)throw e;t.failed.push({path:n.path,error:e instanceof Error?e.message:String(e)})}}return t},I=async()=>{for(;E;)await E;let e=F(!0);E=e.then(()=>{},()=>{});try{return await e}finally{E=null}},L=async()=>{if(!await l()||!await s())return{paths:[],bytes:0};let[e,t]=await Promise.all([i.n(),r.o()]),n=new Set(t.map(e=>e.path)),a=e.filter(e=>!n.has(e.path));return{paths:a.map(e=>e.path),bytes:a.reduce((e,t)=>e+t.size,0)}},fe=()=>new Set(Object.keys(g(p))),pe=e=>{let t=g(p);for(let n of e)t[n]=null;_(p,t)},R=null,z=e=>R||(R=(async()=>{if(!await l())return;let t=e??(await s()?{local:await i.n(),remote:await r.o()}:null);if(!t)return;let n=new Set(t.remote.map(e=>e.path)),a=fe(),o=t.local.filter(e=>!n.has(e.path)&&!a.has(e.path));if(!o.length)return;let c=await N(),u=o.reduce((e,t)=>e+t.size,0);if(!await c.cloud.fs.promptAdopt({files:o.length,bytes:u}).catch(()=>!1)){pe(o.map(e=>e.path));return}await I()})().catch(()=>{}).finally(()=>{R=null}),R),B=null,V=!1,me=async(e,t)=>{let n=new Set(t.map(e=>e.path)),r=e.filter(e=>!n.has(e.path)),i=await N(),a=async()=>{await I().catch(()=>{});let e=await L().catch(()=>({paths:[],bytes:0}));await i.cloud.fs.setAdoptSource({files:e.paths.length,bytes:e.bytes},a).catch(()=>{})},o={files:r.length,bytes:r.reduce((e,t)=>e+t.size,0)};B=()=>{i.cloud.fs.setAdoptSource(o,a).catch(()=>{})},V||(V=!0,Promise.resolve().then(()=>require("./api.cjs")).then(e=>e.onApiEpoch((e,t)=>{t>1&&B?.()})).catch(()=>{})),await i.cloud.fs.setAdoptSource(o,a)},H=!1,U=()=>{H||typeof window>`u`||(H=!0,window.addEventListener(`online`,()=>{M()}),Promise.resolve().then(()=>require("./account.cjs")).then(e=>e.onChange(()=>{z().catch(()=>{}),M()})).catch(()=>{}))},he=e.t({adopt:()=>q,adoptable:()=>J,appendFile:()=>je,appendFileSync:()=>be,available:()=>_e,default:()=>$,exists:()=>Re,existsSync:()=>xe,flush:()=>Ve,lstatSync:()=>Ce,mkdir:()=>Pe,mkdirSync:()=>we,mount:()=>Be,onConflict:()=>Q,pending:()=>Y,pendingDeletes:()=>X,promises:()=>ze,pull:()=>G,readFile:()=>ke,readFileSealed:()=>K,readFileSync:()=>ve,readdir:()=>Ne,readdirSync:()=>W,remount:()=>He,rename:()=>Le,renameSync:()=>Oe,replicating:()=>Z,rm:()=>Fe,rmSync:()=>Te,rmdirSync:()=>Ee,stat:()=>Me,statSync:()=>Se,unlink:()=>Ie,unlinkSync:()=>De,writeFile:()=>Ae,writeFileSync:()=>ye}),ge=n.t(a,{memfs:!0}),{available:_e,readFileSync:ve,writeFileSync:ye,appendFileSync:be,existsSync:xe,statSync:Se,lstatSync:Ce,readdirSync:W,mkdirSync:we,rmSync:Te,rmdirSync:Ee,unlinkSync:De,renameSync:Oe,readFile:ke,writeFile:Ae,appendFile:je,stat:Me,readdir:Ne,mkdir:Pe,rm:Fe,unlink:Ie,rename:Le,exists:Re,promises:ze,mount:Be,flush:Ve,remount:He}=ge,G=ce,K=ae,q=I,J=L,Y=C,X=w,Z=T,Q=le,$={...ge,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 Te}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return He}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return Pe}}),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 be}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return G}});
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./busy-Dv8wzE5M.cjs"),n=require("./node-fs-BNTPsX5c.cjs"),r=require("./storage-BJd-mWHE.cjs"),i=require("./opfs-CXMESVLc.cjs");var a=e.t({adopt:()=>I,adoptable:()=>L,available:()=>u,list:()=>re,onConflict:()=>le,pending:()=>C,pendingDeletes:()=>w,pull:()=>ce,readFile:()=>ie,readFileSealed:()=>ae,remove:()=>se,replicating:()=>T,writeFile:()=>oe}),o,s=async()=>await(o??=i.t().catch(()=>!1))?!0:(o=void 0,!1),c=()=>r.r().catch(()=>`unknown`),l=async()=>await c()===`connected`,u=async()=>await s()||await l(),d=`fkn:fs:pending`,f=`fkn:fs:pending-delete`,p=`fkn:fs:adopt-declined`,m=!0,h=new Map,g=e=>{try{let t=localStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);return Array.isArray(n)?Object.fromEntries(n.filter(e=>typeof e==`string`).map(e=>[e,null])):n&&typeof n==`object`?n:{}}catch{return{}}},_=(e,t)=>{try{Object.keys(t).length?localStorage.setItem(e,JSON.stringify(t)):localStorage.removeItem(e)}catch{}},v=()=>g(d),y=(e,t)=>{let n=v();e in n||(n[e]=t===void 0?h.get(e)??null:t,_(d,n))},b=e=>{let t=v();e in t&&(delete t[e],_(d,t),D()||(k=O))},x=()=>g(f),ee=e=>{let t=x();e in t||(t[e]=h.get(e)??null,_(f,t))},S=e=>{let t=x();e in t&&(delete t[e],_(f,t),D()||(k=O))},C=()=>Object.keys(v()),w=()=>Object.keys(x()),T=()=>m,E=null;t.r(`storage replication`,()=>E!==null||R!==null);var D=()=>Object.keys(v()).length>0||Object.keys(x()).length>0,O=6e4,te=6e5,k=O,A=null,j=()=>{!A&&typeof window<`u`&&D()&&(A=setTimeout(()=>{A=null,M()},k),k=Math.min(k*2,te))},M=()=>{!E&&D()&&(E=F(!1).then(e=>{if(!D()){k=O;return}e.failed.length&&j()}).catch(()=>{j()}).finally(()=>{E=null}))},ne=null,N=()=>ne??=Promise.resolve().then(()=>require("./api.cjs")).then(e=>e.apiPromise),re=async()=>{U();let e=await c(),t=e===`connected`,[n,a]=await Promise.all([s().then(e=>e?i.n():[]).catch(()=>[]),t?r.o().then(e=>({ok:!0,entries:e})).catch(()=>({ok:!1,entries:[]})):Promise.resolve({ok:e===`disconnected`,entries:[]})]);e!==`unknown`&&(m=a.ok),a.ok&&e!==`unknown`&&(h=new Map(a.entries.map(e=>[e.path,e.updatedAt])));let o=new Map,l=e=>{let t=Date.parse(e.updatedAt??``);return Number.isFinite(t)?t:0},u=e=>{let t=o.get(e.path);(!t||l(e)>=l(t))&&o.set(e.path,e)};for(let e of n)u(e);for(let e of a.entries)u(e);return a.ok&&t&&(me(n,a.entries).catch(()=>{}),D()?M():z({local:n,remote:a.entries}).catch(()=>{})),[...o.values()]},ie=async e=>{if(await s())try{return await i.i(e)}catch(e){if(e?.name!==`NotFoundError`)throw e}let t=await r.c(e);return await s()&&i.o(e,t).catch(()=>{}),t},ae=async e=>{if(await s())try{let t=await i.i(e);return{data:new Uint8Array(await t.arrayBuffer()),sealedAt:null}}catch(e){if(e?.name!==`NotFoundError`)throw e}return r.l(e)},oe=async(e,t,n)=>{let a=t instanceof Blob?t:new Blob([t],n?.contentType?{type:n.contentType}:void 0);if(await s()){await i.o(e,a,n),U();let t=h.get(e)??null,o=await c();if(o===`disconnected`)return;if(o===`unknown`||!m){y(e,t),j();return}r.p(e,a,n).then(()=>b(e)).catch(n=>{y(e,t),j(),console.warn(`fs: cloud replicate failed, queued for adopt()`,n)});return}let o=await c();if(o===`connected`)return r.p(e,a,n);throw Error(o===`unknown`?`fs: cloud unreachable`:`fs: no storage backend available`)},se=async e=>{U();let t=[];await s()&&t.push(i.a(e).catch(()=>{}));let n=await c();if(n===`connected`?t.push(r.u(e).then(()=>S(e)).catch(t=>{ee(e),j(),console.warn(`fs: cloud delete failed, queued for retry`,t)})):n===`unknown`&&t.length&&h.has(e)&&(ee(e),j()),!t.length)throw Error(n===`unknown`?`fs: cloud unreachable`:`fs: no storage backend available`);b(e),await Promise.all(t)},ce=async e=>{let t=await r.c(e);return await s()&&await i.o(e,t),t},P=null,le=e=>(P=e,()=>{P===e&&(P=null)}),ue=async e=>{let t=await(await N()).cloud.fs.promptConflict({path:e.path,local:e.local,cloud:e.cloud}).catch(()=>null);return t===`local`?e.readLocal():t===`cloud`?e.readCloud():null},de=async e=>{if(P)try{return await P(e)}catch{return null}return ue(e)},F=async e=>{let t={uploaded:[],kept:[],resolved:[],unresolved:[],deleted:[],failed:[]},n=await c();if(n===`unknown`)throw Error(`fs: cloud unreachable`);if(n!==`connected`)throw Error(`fs: this needs a signed-in account`);let a=await s(),[o,l]=await Promise.all([a?i.n():Promise.resolve([]),r.o()]),u=new Map(l.map(e=>[e.path,e])),d=v();if(a)for(let e of Object.keys(d))o.some(t=>t.path===e)||b(e);for(let[e,n]of Object.entries(x())){let i=u.get(e);if(!i){S(e);continue}if(o.some(t=>t.path===e)){S(e);continue}if(i.updatedAt!==n){S(e);continue}try{await r.u(e),S(e),t.deleted.push(e)}catch(n){t.failed.push({path:e,error:n instanceof Error?n.message:String(n)})}}for(let n of o){let a=u.get(n.path),o=n.path in d;if(!o&&(a||!e)){a&&t.kept.push(n.path);continue}if(o&&a&&a.updatedAt!==d[n.path]){let e=null,o=null,s=await de({path:n.path,local:{size:n.size,updatedAt:n.updatedAt},cloud:{size:a.size,updatedAt:a.updatedAt},readLocal:()=>e??=i.i(n.path),readCloud:()=>o??=r.c(n.path)});if(s==null){t.unresolved.push(n.path);continue}try{let a=e!==null&&s===await e,c=o!==null&&s===await o;c||await r.p(n.path,s,n.contentType?{contentType:n.contentType}:void 0),a||await i.o(n.path,s),b(n.path),t.resolved.push({path:n.path,choice:a?`local`:c?`cloud`:`merged`})}catch(e){if(e?.code===`FKN_E2E_LOCKED`)throw e;t.failed.push({path:n.path,error:e instanceof Error?e.message:String(e)})}continue}try{let e=await i.i(n.path);await r.p(n.path,e,n.contentType?{contentType:n.contentType}:void 0),b(n.path),t.uploaded.push(n.path)}catch(e){if(y(n.path),e?.code===`FKN_E2E_LOCKED`)throw e;t.failed.push({path:n.path,error:e instanceof Error?e.message:String(e)})}}return t},I=async()=>{for(;E;)await E;let e=F(!0);E=e.then(()=>{},()=>{});try{return await e}finally{E=null}},L=async()=>{if(!await l()||!await s())return{paths:[],bytes:0};let[e,t]=await Promise.all([i.n(),r.o()]),n=new Set(t.map(e=>e.path)),a=e.filter(e=>!n.has(e.path));return{paths:a.map(e=>e.path),bytes:a.reduce((e,t)=>e+t.size,0)}},fe=()=>new Set(Object.keys(g(p))),pe=e=>{let t=g(p);for(let n of e)t[n]=null;_(p,t)},R=null,z=e=>R||(R=(async()=>{if(!await l())return;let t=e??(await s()?{local:await i.n(),remote:await r.o()}:null);if(!t)return;let n=new Set(t.remote.map(e=>e.path)),a=fe(),o=t.local.filter(e=>!n.has(e.path)&&!a.has(e.path));if(!o.length)return;let c=await N(),u=o.reduce((e,t)=>e+t.size,0);if(!await c.cloud.fs.promptAdopt({files:o.length,bytes:u}).catch(()=>!1)){pe(o.map(e=>e.path));return}await I()})().catch(()=>{}).finally(()=>{R=null}),R),B=null,V=!1,me=async(e,t)=>{let n=new Set(t.map(e=>e.path)),r=e.filter(e=>!n.has(e.path)),i=await N(),a=async()=>{await I().catch(()=>{});let e=await L().catch(()=>({paths:[],bytes:0}));await i.cloud.fs.setAdoptSource({files:e.paths.length,bytes:e.bytes},a).catch(()=>{})},o={files:r.length,bytes:r.reduce((e,t)=>e+t.size,0)};B=()=>{i.cloud.fs.setAdoptSource(o,a).catch(()=>{})},V||(V=!0,Promise.resolve().then(()=>require("./api.cjs")).then(e=>e.onApiEpoch((e,t)=>{t>1&&B?.()})).catch(()=>{})),await i.cloud.fs.setAdoptSource(o,a)},H=!1,U=()=>{H||typeof window>`u`||(H=!0,window.addEventListener(`online`,()=>{M()}),Promise.resolve().then(()=>require("./account.cjs")).then(e=>e.onChange(()=>{z().catch(()=>{}),M()})).catch(()=>{}))},he=e.t({adopt:()=>q,adoptable:()=>J,appendFile:()=>je,appendFileSync:()=>be,available:()=>_e,default:()=>$,exists:()=>Re,existsSync:()=>xe,flush:()=>Ve,lstatSync:()=>Ce,mkdir:()=>Pe,mkdirSync:()=>we,mount:()=>Be,onConflict:()=>Q,pending:()=>Y,pendingDeletes:()=>X,promises:()=>ze,pull:()=>G,readFile:()=>ke,readFileSealed:()=>K,readFileSync:()=>ve,readdir:()=>Ne,readdirSync:()=>W,remount:()=>He,rename:()=>Le,renameSync:()=>Oe,replicating:()=>Z,rm:()=>Fe,rmSync:()=>Te,rmdirSync:()=>Ee,stat:()=>Me,statSync:()=>Se,unlink:()=>Ie,unlinkSync:()=>De,writeFile:()=>Ae,writeFileSync:()=>ye}),ge=n.t(a,{memfs:!0}),{available:_e,readFileSync:ve,writeFileSync:ye,appendFileSync:be,existsSync:xe,statSync:Se,lstatSync:Ce,readdirSync:W,mkdirSync:we,rmSync:Te,rmdirSync:Ee,unlinkSync:De,renameSync:Oe,readFile:ke,writeFile:Ae,appendFile:je,stat:Me,readdir:Ne,mkdir:Pe,rm:Fe,unlink:Ie,rename:Le,exists:Re,promises:ze,mount:Be,flush:Ve,remount:He}=ge,G=ce,K=ae,q=I,J=L,Y=C,X=w,Z=T,Q=le,$={...ge,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 Te}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return He}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return Pe}}),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 be}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return G}});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
2
|
import { r as t } from "./busy-B189uX--.js";
|
|
3
3
|
import { t as n } from "./node-fs-BZy9bzKd.js";
|
|
4
|
-
import { c as r, l as i, o as a, p as o, r as s, u as c } from "./storage-
|
|
4
|
+
import { c as r, l as i, o as a, p as o, r as s, u as c } from "./storage-DSvL-t80.js";
|
|
5
5
|
import { a as l, i as u, n as d, o as f, t as p } from "./opfs-D0goLAQW.js";
|
|
6
6
|
//#region src/fs/hybrid.ts
|
|
7
7
|
var m = /* @__PURE__ */ e({
|
package/fs.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-CaQFRiIT.cjs");exports.adopt=e.t,exports.adoptable=e.n,exports.appendFile=e.r,exports.appendFileSync=e.i,exports.available=e.a,exports.default=e.l,exports.exists=e.o,exports.existsSync=e.s,exports.flush=e.c,exports.lstatSync=e.d,exports.mkdir=e.f,exports.mkdirSync=e.p,exports.mount=e.m,exports.onConflict=e.h,exports.pending=e.g,exports.pendingDeletes=e._,exports.promises=e.v,exports.pull=e.y,exports.readFile=e.b,exports.readFileSealed=e.x,exports.readFileSync=e.S,exports.readdir=e.C,exports.readdirSync=e.w,exports.remount=e.T,exports.rename=e.E,exports.renameSync=e.D,exports.replicating=e.O,exports.rm=e.k,exports.rmSync=e.A,exports.rmdirSync=e.j,exports.stat=e.M,exports.statSync=e.N,exports.unlink=e.P,exports.unlinkSync=e.F,exports.writeFile=e.I,exports.writeFileSync=e.L;
|
package/fs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as e, C as t, D as n, E as r, F as i, I as a, L as o, M as s, N as c, O as l, P as u, S as d, T as f, _ as p, a as m, b as h, c as g, d as _, f as v, g as y, h as b, i as x, j as S, k as C, l as w, m as T, n as E, o as D, p as O, r as k, s as A, t as j, v as M, w as N, x as P, y as F } from "./fs-
|
|
1
|
+
import { A as e, C as t, D as n, E as r, F as i, I as a, L as o, M as s, N as c, O as l, P as u, S as d, T as f, _ as p, a as m, b as h, c as g, d as _, f as v, g as y, h as b, i as x, j as S, k as C, l as w, m as T, n as E, o as D, p as O, r as k, s as A, t as j, v as M, w as N, x as P, y as F } from "./fs-D3IsGdnN.js";
|
|
2
2
|
export { j as adopt, E as adoptable, k as appendFile, x as appendFileSync, m as available, w as default, D as exists, A as existsSync, g as flush, _ as lstatSync, v as mkdir, O as mkdirSync, T as mount, b as onConflict, y as pending, p as pendingDeletes, M as promises, F as pull, h as readFile, P as readFileSealed, d as readFileSync, t as readdir, N as readdirSync, f as remount, r as rename, n as renameSync, l as replicating, C as rm, e as rmSync, S as rmdirSync, s as stat, c as statSync, u as unlink, i as unlinkSync, a as writeFile, o as writeFileSync };
|
package/http.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Socket, t as Server$1 } from "./net-
|
|
1
|
+
import { n as Socket, t as Server$1 } from "./net-Qmt9L_7t.js";
|
|
2
2
|
import { Buffer } from "buffer";
|
|
3
3
|
import { Stream } from "stream";
|
|
4
4
|
import { IncomingHttpHeaders, OutgoingHttpHeaders, RequestOptions } from "http";
|
|
@@ -904,6 +904,24 @@ declare const gotoPermission: {
|
|
|
904
904
|
readonly description: 'Lets the app navigate to another site without leaving its window.';
|
|
905
905
|
};
|
|
906
906
|
type GotoOptions = {
|
|
907
|
+
/**
|
|
908
|
+
* When `goto` resolves: `'load'`, the default, once the document it brings fired load;
|
|
909
|
+
* `'documentstart'` once that document has started, possibly before the page's own scripts ran.
|
|
910
|
+
* Either way a call made after it runs on the document the goto brought, never on the one it
|
|
911
|
+
* replaced. On the cloud backend a `'documentstart'` goto resolves before its document commits: an
|
|
912
|
+
* `evaluate` or `postMessage` made after it waits for that document, and a locator call retries
|
|
913
|
+
* until it comes, each within its own timeout. If that document has not come by the goto's deadline,
|
|
914
|
+
* `evaluate` and `postMessage` reject, and a locator call runs on whatever document the frame holds,
|
|
915
|
+
* since the goto itself already resolved; on the extension the goto rejects instead.
|
|
916
|
+
*
|
|
917
|
+
* A goto that changes only the fragment of the url the page is at keeps its document. On the cloud
|
|
918
|
+
* backend one awaited to `'load'` resolves once the page reports the new fragment, and a call made
|
|
919
|
+
* after one awaited to `'documentstart'` waits only until then. Two pages are the exception there,
|
|
920
|
+
* where such a goto brings a new document like any other: one reached through a redirect, and one
|
|
921
|
+
* that followed a link onto another origin. On the extension (measured on Chromium) one awaited to
|
|
922
|
+
* `'load'` resolves, since the frame fires load for it, and one awaited to `'documentstart'` runs
|
|
923
|
+
* out at its timeout, since no new document starts.
|
|
924
|
+
*/
|
|
907
925
|
waitUntil?: 'documentstart' | 'load';
|
|
908
926
|
domains?: string[];
|
|
909
927
|
};
|
|
@@ -992,6 +1010,12 @@ type Frame = Omit<FrameLocator<LocatorModules>, 'evaluate'> & {
|
|
|
992
1010
|
* Needs the Evaluation grant on both backends; an app without it is refused by name. It runs on the
|
|
993
1011
|
* attached frame only: a chain into a nested frame (`frameLocator(...).evaluate`) is refused.
|
|
994
1012
|
*
|
|
1013
|
+
* Called after `goto` resolved, whichever `waitUntil`, it runs once on the document that goto
|
|
1014
|
+
* brought, never on the one it replaced. On the cloud backend the call waits for that document when
|
|
1015
|
+
* it has not committed yet, and the wait counts toward the 30 seconds; if it has not come by the
|
|
1016
|
+
* goto's own deadline (the goto failed, or loaded something that is not a page), or the app started
|
|
1017
|
+
* another goto first, the call rejects with a `LocatorError` saying the code was not run.
|
|
1018
|
+
*
|
|
995
1019
|
* On the extension it also needs an extension new enough to run code (ABI 3, older ones are refused
|
|
996
1020
|
* with `ExtensionOperationUnsupportedError`), and it runs where the page's content security policy
|
|
997
1021
|
* allows it: a frame whose host the app declared has its CSP replaced, so code runs; an undeclared
|
|
@@ -1014,7 +1038,8 @@ type Frame = Omit<FrameLocator<LocatorModules>, 'evaluate'> & {
|
|
|
1014
1038
|
*
|
|
1015
1039
|
* It resolves once the message was handed to the browser for the document the frame holds, in the
|
|
1016
1040
|
* order the calls were made. That says nothing about whether the page listened, and a message
|
|
1017
|
-
* dropped for its origin resolves the same way.
|
|
1041
|
+
* dropped for its origin resolves the same way. Sent after `goto` resolved, it goes to the document
|
|
1042
|
+
* that goto brought, as `evaluate` runs there.
|
|
1018
1043
|
*
|
|
1019
1044
|
* Refused, and never sent again. On the cloud backend a refusal that depends on the grant or on the
|
|
1020
1045
|
* frame's document comes after `transfer` was detached, and loses what it moved with the message;
|
|
@@ -1030,8 +1055,9 @@ type Frame = Omit<FrameLocator<LocatorModules>, 'evaluate'> & {
|
|
|
1030
1055
|
* own traffic and a port handed over is a live channel into the page.
|
|
1031
1056
|
* - cloud, `LocatorUnsupportedError`: an FKN page or render proxy that predates messaging.
|
|
1032
1057
|
* - cloud, `LocatorError`: the document changed during the call, so the message may or may not have
|
|
1033
|
-
* reached it and is not sent to the next one; or the
|
|
1034
|
-
*
|
|
1058
|
+
* reached it and is not sent to the next one; or the document of the goto before it had not come
|
|
1059
|
+
* by that goto's deadline (the goto failed, or loaded something that is not a page) or before the
|
|
1060
|
+
* app started another goto, so nothing was sent.
|
|
1035
1061
|
* - extension, `LocatorUnsupportedError`: `'*'`, which needs an extension release that reports the
|
|
1036
1062
|
* frame's origin. Pass the origin.
|
|
1037
1063
|
* - the terminal detach error once the attachment ended.
|
|
@@ -1067,6 +1093,12 @@ type AttachFrameOptions = {
|
|
|
1067
1093
|
iframe: HTMLIFrameElement;
|
|
1068
1094
|
domains?: string[];
|
|
1069
1095
|
syncCookies?: boolean;
|
|
1096
|
+
/**
|
|
1097
|
+
* Replace the embedded site's CSP with a lockdown policy: the frame cannot fetch, connect, or load
|
|
1098
|
+
* any resource. Extension backend only. It needs an extension that announces an ABI: an older one
|
|
1099
|
+
* may not serve it, so the attach is refused with `ExtensionOperationUnsupportedError` (operation
|
|
1100
|
+
* `'lockdown'`) before anything is attached.
|
|
1101
|
+
*/
|
|
1070
1102
|
lockdown?: boolean;
|
|
1071
1103
|
/**
|
|
1072
1104
|
* Whole categories to ask for on one sheet or card right after the attach, before it resolves. A
|
package/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-tQKlXzhv.cjs"),n=require("./api-jOTOA-5n.cjs"),r=require("./busy-Dv8wzE5M.cjs"),i=require("./cloud-BZIJFvPF.cjs"),a=require("./dns.cjs"),o=require("./net.cjs"),s=require("./dgram.cjs"),c=require("./http.cjs"),l=require("./extension-Bl5ZNj0d.cjs"),u=require("./desktop.cjs"),d=require("./fs-CaQFRiIT.cjs"),f=require("./opfs.cjs"),p=require("./packages.cjs"),m=require("./rooms.cjs"),h=require("./account.cjs"),g=require("./connect-button-BpXDs7tw.cjs");let _=require("osra");var v=1e4,y=150,b=()=>new Promise(e=>{if(t.q())return e(!0);let n,r=setTimeout(()=>i(t.q()),v),i=t=>{clearTimeout(n),clearTimeout(r),o.disconnect(),document.removeEventListener(`readystatechange`,s),e(t)},a=()=>{clearTimeout(n),n=setTimeout(()=>i(t.q()),y)},o=new MutationObserver(()=>{t.q()&&i(!0)}),s=()=>{document.readyState===`complete`&&!t.q()&&a()};o.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-fkn-extension`]}),document.addEventListener(`readystatechange`,s),document.readyState===`complete`&&a()}),x=(async e=>{if(t.o(e)===`window`){let n=e;return l.r()?t.a(n):i.a()?i.i(n):t.a(n)}return S(e)}),S=async e=>l.r()||e.lockdown||!i.a()||await b()?t.a(e):i.i(e),C=`https://fkn.app`,w=async(e,t)=>{if(typeof window>`u`)throw Error(`FKN @fkn/lib: relayWorker must be called from the main thread`);let i=await n.u;if(!i)throw Error(`FKN @fkn/lib: relayWorker found no FKN transport in this realm`);let a=r.t(`relayed worker`);t?.unregisterSignal?.aborted?a():t?.unregisterSignal?.addEventListener(`abort`,a,{once:!0});let o=i.emit instanceof MessagePort?{}:{originA:t?.originA??C,originB:t?.originB??`*`};(0,_.relay)(i,e,{key:`fkn-api`,...o,unregisterSignal:t?.unregisterSignal})},T=async()=>typeof window>`u`?!1:(await n.a).connect.prompt(location.origin).catch(()=>!1),E=async()=>typeof window>`u`?null:(await n.a).relay.prompt().catch(()=>null),D=new Set,O=e=>(D.add(e),()=>{D.delete(e)}),k=()=>{if(D.size===0)return!1;for(let e of[...D])try{e()}catch{}return!0},A=(e,t)=>{if(typeof e?.onUpdateTaken==`function`)return Promise.resolve(e.onUpdateTaken(t))},j=e.t({applyUpdate:()=>W,busyReasons:()=>U,onUpdate:()=>R,onUpdateTaken:()=>z,updateReady:()=>M}),M=async()=>typeof window>`u`?!1:n.a.then(e=>e.shell?.updateReady()).then(e=>e===!0).catch(()=>!1),N=new Set,P=!1,F=()=>{P=!0;for(let e of[...N])try{e()}catch{}},I=0,L=()=>{let e=n.s();e&&N.size!==0&&I!==e.epoch&&(I=e.epoch,P=!1,Promise.resolve(e.remote.shell?.onUpdate(F)).catch(()=>{I===e.epoch&&(I=0)}))};typeof window<`u`&&n.l(L);var R=async e=>{if(typeof window>`u`)return()=>{};if(N.add(e),P)try{e()}catch{}return L(),()=>{N.delete(e)}},z=e=>typeof window>`u`?()=>{}:O(e),B=0,V=!1,H=()=>{if(!k()&&!V){V=!0;try{location.reload()}catch{}}};typeof window<`u`&&n.l(()=>{let e=n.s();if(!e||B===e.epoch)return;B=e.epoch;let t=A(e.remote.shell,H);if(!t){B=0;return}t.catch(()=>{B===e.epoch&&(B=0)})});var U=()=>r.n(),W=async()=>typeof window>`u`?!1:n.a.then(e=>e.shell?.applyUpdate()).then(e=>e===!0).catch(()=>!1);exports.ATTACH_FRAME_EVENT_KEY=t.i,exports.CATEGORIES=t.y,exports.EXTENSION_ABI=t.Z,exports.ExtensionOperationUnsupportedError=t.Q,exports.ExtensionOutdatedError=t.$,exports.FORGEABLE_HEADERS=t.H,exports.FrameWindowBlockedError=t.d,exports.FrameWindowRefusedError=t.f,exports.LOCATOR_DENIED=t.w,exports.LOCATOR_ERROR=t.O,exports.LOCATOR_UNSUPPORTED=t.b,exports.PERMISSION_DENIED=t.t,exports.REQUIRED_EXTENSION_ABI=t.et,Object.defineProperty(exports,"account",{enumerable:!0,get:function(){return h.t}}),exports.assertAttachableFrameUrl=t.g,exports.assertFetchableUrl=t.F,exports.assertForgeableHeaders=t.U,exports.assertLockdownApplicable=t._,exports.assertOneCookieIdentity=t.W,exports.attachFrame=x,exports.attachFramePermission=t.p,exports.box=t.rt,Object.defineProperty(exports,"cloud",{enumerable:!0,get:function(){return i.n}}),exports.connect=T,exports.connectButtonUrl=g.t,exports.cookies=t.N,exports.createFrame=t.m,exports.createVideoElementHandle=t.it,Object.defineProperty(exports,"desktop",{enumerable:!0,get:function(){return u.t}}),Object.defineProperty(exports,"dgram",{enumerable:!0,get:function(){return s.t}}),Object.defineProperty(exports,"dns",{enumerable:!0,get:function(){return a.t}}),Object.defineProperty(exports,"extension",{enumerable:!0,get:function(){return l.t}}),exports.fetch=l.n,exports.fetchCredentialedPermission=t.L,exports.fetchLocalPermission=t.R,exports.fetchPermission=t.z,Object.defineProperty(exports,"fs",{enumerable:!0,get:function(){return d.u}}),exports.gotoPermission=t.h,exports.handleRevivableModules=t.nt,exports.hasForgedCookie=t.G,Object.defineProperty(exports,"http",{enumerable:!0,get:function(){return c.t}}),exports.isBlockedFetchUrl=t.B,exports.isBlockedFrameUrl=t.v,exports.isExtensionExposed=t.q,exports.isLocalNetworkUrl=t.V,exports.isLocatorDenied=t.k,exports.isLocatorUnsupported=t.x,exports.isPermissionDenied=t.n,exports.isTerminalError=t.D,exports.isType=t.at,exports.modifyRequestHeadersPermission=t.A,Object.defineProperty(exports,"net",{enumerable:!0,get:function(){return o.t}}),Object.defineProperty(exports,"opfs",{enumerable:!0,get:function(){return f.t}}),Object.defineProperty(exports,"packages",{enumerable:!0,get:function(){return p.t}}),exports.permissions=t.r,exports.promptInstall=l.i,exports.promptRelay=E,exports.readCookiePermission=t.P,exports.readExtensionHandshake=t.J,exports.relayWorker=w,exports.removeRequestHeaderRule=t.j,exports.revive=t.ot,Object.defineProperty(exports,"rooms",{enumerable:!0,get:function(){return m.t}}),exports.setMissingExtensionHandler=t.Y,exports.setRequestHeaderRule=t.M,Object.defineProperty(exports,"shell",{enumerable:!0,get:function(){return j}}),exports.supportsOperation=t.tt,exports.type=t.st,exports.waitForExtensionExposure=t.X;
|
package/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as account_d_exports } from "./account.js";
|
|
2
|
-
import { A as CATEGORIES, B as revive, C as gotoPermission, D as PermissionGrant, E as LegacyPermissionRequest, F as RemoteVideoElement, G as OperationRequest, H as Executor, I as VideoElementState, K as SelectorPart, L as box, M as PermissionCategory, N as handleRevivableModules, O as PermissionRequest, P as BoxedVideoElement, R as createVideoElementHandle, S as createFrame, T as CategoryRequest, U as Gate, V as type, W as GateTools, _ as FrameWindowRefusedError, a as AttachWindowOptions, b as WindowFrame, c as FrameBackendEvent, d as FrameEventMap, f as FrameMessageEvent, g as FrameWindowRefusal, h as FrameWindowOptions, i as AttachFrameOptions, j as CategoryMeta, k as permissions, l as FrameDocumentEvent, m as FrameWindowBlockedError, o as Frame, p as FramePostMessageOptions, r as AttachFrameFunction, s as FrameBackend, t as ATTACH_FRAME_EVENT_KEY, u as FrameEventListener, v as GotoOptions, w as CategoryGrant, x as attachFramePermission, y as Locator, z as isType } from "./index-
|
|
3
|
-
import { A as readCookiePermission, B as FORGEABLE_HEADERS, C as RequestHeaderRule, D as CookieDetails, E as setRequestHeaderRule, F as fetchCredentialedPermission, G as LOCATOR_ERROR, H as assertOneCookieIdentity, I as fetchLocalPermission, J as isLocatorUnsupported, K as LOCATOR_UNSUPPORTED, L as fetchPermission, M as ProxyFetchRequest, N as assertFetchableUrl, O as SiteCookie, R as isBlockedFetchUrl, S as HeaderOperation, T as removeRequestHeaderRule, U as hasForgedCookie, V as assertForgeableHeaders, W as LOCATOR_DENIED, Y as isTerminalError, _ as PermissionDeniedError, b as assertLockdownApplicable, c as setMissingExtensionHandler, d as ExtensionHandshake, f as ExtensionOperationUnsupportedError, g as PERMISSION_DENIED, h as supportsOperation, i as promptInstall, j as FetchInit, k as cookies, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, n as fetch, o as isExtensionExposed, p as ExtensionOutdatedError, q as isLocatorDenied, s as readExtensionHandshake, t as extension_d_exports, u as EXTENSION_ABI, v as isPermissionDenied, w as modifyRequestHeadersPermission, x as isBlockedFrameUrl, y as assertAttachableFrameUrl, z as isLocalNetworkUrl } from "./extension-
|
|
4
|
-
import { n as cloud_d_exports } from "./cloud-
|
|
2
|
+
import { A as CATEGORIES, B as revive, C as gotoPermission, D as PermissionGrant, E as LegacyPermissionRequest, F as RemoteVideoElement, G as OperationRequest, H as Executor, I as VideoElementState, K as SelectorPart, L as box, M as PermissionCategory, N as handleRevivableModules, O as PermissionRequest, P as BoxedVideoElement, R as createVideoElementHandle, S as createFrame, T as CategoryRequest, U as Gate, V as type, W as GateTools, _ as FrameWindowRefusedError, a as AttachWindowOptions, b as WindowFrame, c as FrameBackendEvent, d as FrameEventMap, f as FrameMessageEvent, g as FrameWindowRefusal, h as FrameWindowOptions, i as AttachFrameOptions, j as CategoryMeta, k as permissions, l as FrameDocumentEvent, m as FrameWindowBlockedError, o as Frame, p as FramePostMessageOptions, r as AttachFrameFunction, s as FrameBackend, t as ATTACH_FRAME_EVENT_KEY, u as FrameEventListener, v as GotoOptions, w as CategoryGrant, x as attachFramePermission, y as Locator, z as isType } from "./index-D2CA-NX5.js";
|
|
3
|
+
import { A as readCookiePermission, B as FORGEABLE_HEADERS, C as RequestHeaderRule, D as CookieDetails, E as setRequestHeaderRule, F as fetchCredentialedPermission, G as LOCATOR_ERROR, H as assertOneCookieIdentity, I as fetchLocalPermission, J as isLocatorUnsupported, K as LOCATOR_UNSUPPORTED, L as fetchPermission, M as ProxyFetchRequest, N as assertFetchableUrl, O as SiteCookie, R as isBlockedFetchUrl, S as HeaderOperation, T as removeRequestHeaderRule, U as hasForgedCookie, V as assertForgeableHeaders, W as LOCATOR_DENIED, Y as isTerminalError, _ as PermissionDeniedError, b as assertLockdownApplicable, c as setMissingExtensionHandler, d as ExtensionHandshake, f as ExtensionOperationUnsupportedError, g as PERMISSION_DENIED, h as supportsOperation, i as promptInstall, j as FetchInit, k as cookies, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, n as fetch, o as isExtensionExposed, p as ExtensionOutdatedError, q as isLocatorDenied, s as readExtensionHandshake, t as extension_d_exports, u as EXTENSION_ABI, v as isPermissionDenied, w as modifyRequestHeadersPermission, x as isBlockedFrameUrl, y as assertAttachableFrameUrl, z as isLocalNetworkUrl } from "./extension-DMU-CwMw.js";
|
|
4
|
+
import { n as cloud_d_exports } from "./cloud-B8QYSmW3.js";
|
|
5
5
|
import { t as dns_d_exports } from "./dns.js";
|
|
6
6
|
import { u as index_d_exports } from "./index-kuPqkS_-.js";
|
|
7
|
-
import { s as net_d_exports } from "./net-
|
|
7
|
+
import { s as net_d_exports } from "./net-Qmt9L_7t.js";
|
|
8
8
|
import { t as dgram_d_exports } from "./dgram.js";
|
|
9
9
|
import { t as http_d_exports } from "./http.js";
|
|
10
10
|
import { t as desktop_d_exports } from "./desktop.js";
|
package/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { $ as t, A as n, B as r, D as i, F as a, G as o, H as ee, J as s, L as c, M as te, N as ne, O as re, P as ie, Q as ae, R as oe, U as se, V as ce, W as l, X as u, Y as le, Z as ue, _ as de, a as d, at as f, b as p, d as m, et as h, f as g, g as _, h as v, i as y, it as b, j as x, k as S, m as C, n as w, nt as T, o as E, ot as D, p as O, q as k, r as A, rt as j, st as M, t as N, tt as P, v as F, w as I, x as L, y as R, z } from "./lib-
|
|
3
|
-
import { a as B, l as V, s as H, u as fe } from "./api-
|
|
2
|
+
import { $ as t, A as n, B as r, D as i, F as a, G as o, H as ee, J as s, L as c, M as te, N as ne, O as re, P as ie, Q as ae, R as oe, U as se, V as ce, W as l, X as u, Y as le, Z as ue, _ as de, a as d, at as f, b as p, d as m, et as h, f as g, g as _, h as v, i as y, it as b, j as x, k as S, m as C, n as w, nt as T, o as E, ot as D, p as O, q as k, r as A, rt as j, st as M, t as N, tt as P, v as F, w as I, x as L, y as R, z } from "./lib-BlyFPeSv.js";
|
|
3
|
+
import { a as B, l as V, s as H, u as fe } from "./api-Dp-2AT3u.js";
|
|
4
4
|
import { n as pe, t as me } from "./busy-B189uX--.js";
|
|
5
|
-
import { a as U, i as W, n as he } from "./cloud-
|
|
5
|
+
import { a as U, i as W, n as he } from "./cloud-oMACx7NL.js";
|
|
6
6
|
import { t as ge } from "./dns.js";
|
|
7
7
|
import { t as _e } from "./net.js";
|
|
8
8
|
import { t as ve } from "./dgram.js";
|
|
9
9
|
import { t as G } from "./http.js";
|
|
10
|
-
import { i as ye, n as be, r as K, t as xe } from "./extension-
|
|
10
|
+
import { i as ye, n as be, r as K, t as xe } from "./extension-ChZyZgAL.js";
|
|
11
11
|
import { t as Se } from "./desktop.js";
|
|
12
|
-
import { u as Ce } from "./fs-
|
|
12
|
+
import { u as Ce } from "./fs-D3IsGdnN.js";
|
|
13
13
|
import { t as we } from "./opfs.js";
|
|
14
14
|
import { t as Te } from "./packages.js";
|
|
15
15
|
import { t as Ee } from "./rooms.js";
|
|
@@ -1906,26 +1906,31 @@ var Gn = (e) => {
|
|
|
1906
1906
|
}
|
|
1907
1907
|
}, Yn = "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY", Xn = !1, Zn = () => {
|
|
1908
1908
|
Xn || (Xn = !0, console.warn("[fkn-frame] the installed FKN WebExtension is too old to ask for permission categories upfront, so each capability will be asked for as it is first used. Updating the extension fixes this."));
|
|
1909
|
-
}, Qn = "frame: this frame no longer holds the document the app attached it to", $n = "frame.postMessage: '*' is not served on the extension yet, since this extension does not report the frame's origin; pass the page's origin as targetOrigin", er = (
|
|
1909
|
+
}, Qn = "frame: this frame no longer holds the document the app attached it to", $n = "frame.postMessage: '*' is not served on the extension yet, since this extension does not report the frame's origin; pass the page's origin as targetOrigin", er = () => {
|
|
1910
|
+
let e = D();
|
|
1911
|
+
if (e.status === "ok" && e.abi >= 1) return;
|
|
1912
|
+
let t = e.status === "absent" ? 0 : e.abi;
|
|
1913
|
+
throw new E("lockdown", t, `attachFrame: the installed FKN WebExtension (ABI ${t}) may predate lockdown, and one that does attaches the frame with its CSP removed rather than locked down. Updating the extension fixes this.`);
|
|
1914
|
+
}, tr = (e) => {
|
|
1910
1915
|
try {
|
|
1911
1916
|
return new URL(e, location.href).hostname;
|
|
1912
1917
|
} catch {
|
|
1913
1918
|
return "";
|
|
1914
1919
|
}
|
|
1915
|
-
},
|
|
1920
|
+
}, nr = async ({ iframe: e, domains: t = [], syncCookies: n = !0, lockdown: r = !1, permissions: i }) => {
|
|
1916
1921
|
let a = crypto.randomUUID();
|
|
1917
1922
|
if (Z(e.src), hn({
|
|
1918
1923
|
src: e.src,
|
|
1919
1924
|
domains: t,
|
|
1920
1925
|
lockdown: r
|
|
1921
|
-
}), await O(), !e.isConnected) throw Error("attachFrame: the iframe must be connected to the document before attaching");
|
|
1926
|
+
}), await O(), r && er(), !e.isConnected) throw Error("attachFrame: the iframe must be connected to the document before attaching");
|
|
1922
1927
|
e.dispatchEvent(new CustomEvent(Yn, { detail: a }));
|
|
1923
1928
|
let { executeLocator: o, highlightLocator: s, ensureLocatorPermission: c, requestCategories: l, evaluateFrame: u, goto: d } = await k.attachFrame({
|
|
1924
1929
|
marker: a,
|
|
1925
1930
|
domains: t,
|
|
1926
1931
|
syncCookies: n,
|
|
1927
1932
|
lockdown: r
|
|
1928
|
-
}), f = new Set(p([...t,
|
|
1933
|
+
}), f = new Set(p([...t, tr(e.src)], { ipv6: !0 })), m = (e) => f.has(p([Jn(e)], { ipv6: !0 })[0] ?? ""), h = Tn({
|
|
1929
1934
|
executor: {
|
|
1930
1935
|
execute: o,
|
|
1931
1936
|
highlight: s
|
|
@@ -1966,7 +1971,7 @@ var Gn = (e) => {
|
|
|
1966
1971
|
};
|
|
1967
1972
|
},
|
|
1968
1973
|
goto: (e, t = {}) => {
|
|
1969
|
-
for (let t of p([
|
|
1974
|
+
for (let t of p([tr(e)], { ipv6: !0 })) f.add(t);
|
|
1970
1975
|
return d({
|
|
1971
1976
|
url: e,
|
|
1972
1977
|
...t
|
|
@@ -1975,11 +1980,11 @@ var Gn = (e) => {
|
|
|
1975
1980
|
url: () => e.src
|
|
1976
1981
|
});
|
|
1977
1982
|
return i?.length && (cn() ? await h.request(i) : Zn()), h;
|
|
1978
|
-
},
|
|
1983
|
+
}, rr = "attachFrame: window mode is served by the cloud backend for now, whatever extension is installed. Use cloud.attachFrame({ window })", ir = async (e) => {
|
|
1979
1984
|
if (qn(e.window), e.syncCookies === !1) throw TypeError("attachFrame: syncCookies false does not apply to an extension window, which is the site's own first-party tab");
|
|
1980
1985
|
let t = D();
|
|
1981
|
-
throw new E("attachWindow", t.status === "absent" ? 0 : t.abi,
|
|
1982
|
-
},
|
|
1986
|
+
throw new E("attachWindow", t.status === "absent" ? 0 : t.abi, rr);
|
|
1987
|
+
}, ar = (async (e) => Gn(e) === "window" ? ir(e) : nr(e)), or = "permissions.request: pass hosts, the sites the grant applies to", sr = { request: async (e) => {
|
|
1983
1988
|
let t = e.map((e) => {
|
|
1984
1989
|
let { category: t, key: n, scope: r, reason: i, hosts: a } = e;
|
|
1985
1990
|
if (!("hosts" in e) && !("category" in e)) return { legacy: {
|
|
@@ -1988,7 +1993,7 @@ var Gn = (e) => {
|
|
|
1988
1993
|
reason: i
|
|
1989
1994
|
} };
|
|
1990
1995
|
let o = p(a ?? [], { ipv6: !0 });
|
|
1991
|
-
if (!o.length) throw TypeError(
|
|
1996
|
+
if (!o.length) throw TypeError(or);
|
|
1992
1997
|
return { ask: {
|
|
1993
1998
|
category: t,
|
|
1994
1999
|
key: n,
|
|
@@ -1999,6 +2004,6 @@ var Gn = (e) => {
|
|
|
1999
2004
|
In("permissions.request", n), n.length && await ln();
|
|
2000
2005
|
let { items: r, answer: i } = Ln(n), a = t.flatMap((e) => "legacy" in e ? [e.legacy] : []), o = [...r, ...a], s = o.length ? await k.requestPermissions(o) : [], c = i(s.slice(0, r.length)), l = s.slice(r.length), u = 0, d = 0;
|
|
2001
2006
|
return t.map((e) => "ask" in e ? c[u++] : l[d++]);
|
|
2002
|
-
} },
|
|
2007
|
+
} }, cr = "PermissionDeniedError", lr = (e) => e instanceof Error ? e.name === cr : Rn(e) && e.name === "PermissionDeniedError";
|
|
2003
2008
|
//#endregion
|
|
2004
|
-
export { T as $, it as A, Qe as B, V as C, xt as D, B as E, $e as F, Ve as G, A as H, tt as I, D as J, Pe as K, Je as L, at as M, rt as N, ht as O, nt as P, E as Q, Ye as R, H as S, _t as T, Ue as U, Ze as V, He as W, O as X, Le as Y, xe as Z, hn as _,
|
|
2009
|
+
export { T as $, it as A, Qe as B, V as C, xt as D, B as E, $e as F, Ve as G, A as H, tt as I, D as J, Pe as K, Je as L, at as M, rt as N, ht as O, nt as P, E as Q, Ye as R, H as S, _t as T, Ue as U, Ze as V, He as W, O as X, Le as Y, xe as Z, hn as _, ar as a, _e as at, I as b, jn as c, vn as d, Se as et, bn as f, Z as g, _n as h, Yn as i, w as it, ot as j, yt as k, Nn as l, Tn as m, lr as n, be as nt, Gn as o, ye as ot, gn as p, Fe as q, sr as r, ve as rt, qn as s, S as st, cr as t, Ae as tt, Mn as u, mn as v, L as w, vt as x, fn as y, qe as z };
|