@fkn/lib 0.9.23 → 0.9.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/account.cjs +1 -1
- package/account.d.ts +7 -3
- package/account.js +7 -7
- package/api-BCJO3EWi.cjs +3 -0
- package/api-CesI0aMl.d.ts +677 -0
- package/{api-Jq4OSTp1.js → api-DLvscoll.js} +99 -96
- package/api.cjs +1 -0
- package/api.d.ts +3 -0
- package/api.js +2 -0
- package/attach-policy.cjs +1 -0
- package/attach-policy.d.ts +35 -0
- package/attach-policy.js +43 -0
- package/{busy-Bp1E3JPT.js → busy-B189uX--.js} +1 -1
- package/cloud/dgram.cjs +1 -1
- package/cloud/dgram.js +2 -2
- package/cloud/dns.d.ts +1 -1
- package/cloud/fetch.cjs +1 -1
- package/cloud/fetch.d.ts +1 -1
- package/cloud/fetch.js +1 -1
- package/cloud/fs/promises.d.ts +7 -6
- package/cloud/fs/promises.js +1 -1
- package/cloud/fs.cjs +1 -1
- package/cloud/fs.d.ts +3 -3
- package/cloud/fs.js +10 -9
- package/cloud/net.cjs +1 -1
- package/cloud/net.d.ts +1 -1
- package/cloud/net.js +3 -3
- package/cloud-B2ZG-0MF.cjs +1 -0
- package/cloud-B7pI3pp1.d.ts +37 -0
- package/{cloud-7rfQ2BRH.js → cloud-DolBoNvR.js} +59 -97
- package/cloud.cjs +1 -1
- package/cloud.d.ts +4 -4
- package/cloud.js +4 -4
- package/{connect-button-Ds9KpXHe.js → connect-button-CN4ZJwT6.js} +1 -1
- package/{connect-button-D8KXSL6s.d.ts → connect-button-DdoEikEd.d.ts} +1 -1
- package/contract-D6ksmIm6.d.ts +394 -0
- package/contract.cjs +0 -0
- package/contract.d.ts +3 -0
- package/contract.js +0 -0
- package/desktop.js +1 -1
- package/dgram.cjs +1 -1
- package/dgram.d.ts +6 -47
- package/dgram.js +406 -2
- package/dns.cjs +1 -1
- package/dns.d.ts +1 -3
- package/dns.js +2 -2
- package/extension-CJUeVRXf.d.ts +361 -0
- package/extension-DBazc3ff.cjs +1 -0
- package/extension-Dw9gzvei.js +84 -0
- package/extension.cjs +1 -1
- package/extension.d.ts +3 -3
- package/extension.js +3 -3
- package/fs/promises.cjs +1 -1
- package/fs/promises.d.ts +8 -9
- package/fs/promises.js +2 -2
- package/fs-DYP7utdw.cjs +1 -0
- package/{fs-CUmugp10.d.ts → fs-DlGE0ZNu.d.ts} +20 -21
- package/{fs-pOQSZfuf.js → fs-d2ANVBkm.js} +8 -8
- package/fs.cjs +1 -1
- package/fs.d.ts +2 -2
- package/fs.js +1 -1
- package/http.cjs +3 -3
- package/http.d.ts +4 -6
- package/http.js +8 -8
- package/{index-CJ0vHTcS.d.ts → index-BQgZVQl7.d.ts} +4 -7
- package/{index-DY8WjklJ.d.ts → index-BhO-wymH.d.ts} +15 -293
- package/{index-BIZeEsNu.d.ts → index-CGJTVju4.d.ts} +52 -46
- package/index.cjs +1 -1
- package/index.d.ts +12 -13
- package/index.js +60 -49
- package/lib-DLM2M3_i.cjs +53 -0
- package/{lib-k3lstfa4.js → lib-duLPF_WZ.js} +328 -277
- package/messages-DvpKMTsY.d.ts +28 -0
- package/messages.cjs +1 -0
- package/messages.d.ts +2 -0
- package/messages.js +4 -0
- package/{net-DaWv81tQ.d.ts → net-DAOcF3Eb.d.ts} +12 -16
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +318 -3
- package/{node-fs-BZCQUmeE.js → node-fs-C9ECR_9H.js} +2 -2
- package/opfs/promises.d.ts +7 -8
- package/opfs/promises.js +1 -1
- package/{opfs-BibrNGF0.js → opfs-D0goLAQW.js} +1 -1
- package/opfs.d.ts +24 -26
- package/opfs.js +3 -3
- package/package.json +27 -2
- package/packages.cjs +1 -1
- package/packages.d.ts +143 -2
- package/packages.js +15 -15
- package/{proxy-DmMu2_1z.d.ts → proxy-BubvP9sg.d.ts} +3 -3
- package/{proxy-BNdvRifw.cjs → proxy-CefKCs-i.cjs} +1 -1
- package/{proxy-CRbkWS4E.js → proxy-KUfE4cEQ.js} +3 -3
- package/react.d.ts +3 -7
- package/react.js +2 -2
- package/{storage-BNjLc1FV.js → storage-BjGr_vC4.js} +5 -5
- package/storage-DLB4ciMf.cjs +1 -0
- package/utils-BvgGdrgN.cjs +1 -0
- package/{utils-DVlbuXmW.js → utils-C-cAd4r4.js} +2 -3
- package/wire-Gbo-D74t.d.ts +91 -0
- package/wire.cjs +1 -0
- package/wire.d.ts +2 -0
- package/wire.js +4 -0
- package/api-BGYSJVvR.d.ts +0 -789
- package/api-C-TpWHAU.cjs +0 -3
- package/cloud-BqjwL5KM.cjs +0 -1
- package/cloud-DMTkzfcf.d.ts +0 -36
- package/dgram-BLN-mfgq.cjs +0 -1
- package/dgram-DHQcHefn.js +0 -405
- package/extension-B8Y0sUwC.js +0 -78
- package/extension-CMPZjuaV.d.ts +0 -16
- package/extension-CgSGjcSl.cjs +0 -1
- package/fs-BNnozBMU.cjs +0 -1
- package/lib-DbiVHPXE.cjs +0 -53
- package/lookup-BtwWaCZJ.d.ts +0 -7
- package/net-B6RHtWwe.cjs +0 -1
- package/net-yBkobZqK.js +0 -317
- package/packages-Cn8S-Hkn.d.ts +0 -217
- package/storage-qxXFLgTM.d.ts +0 -44
- package/storage-xAeRQQiz.cjs +0 -1
- package/utils-QfNXtEhb.cjs +0 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/messages.d.ts
|
|
2
|
+
declare const E2E_LOCKED_MESSAGE = "fkn:e2e-locked";
|
|
3
|
+
declare const E2E_STALE_EPOCH_MESSAGE = "fkn:e2e-stale-epoch: this file is encrypted under a previous key you reset";
|
|
4
|
+
declare const E2E_INTEGRITY_MESSAGE = "fkn:e2e-integrity: stored data failed its integrity check";
|
|
5
|
+
/**
|
|
6
|
+
* "There is no object at this path", as a thing a caller can TEST rather than parse.
|
|
7
|
+
*
|
|
8
|
+
* osra's error boxer ships name, message, stack and cause ONLY, so this code survives same-realm
|
|
9
|
+
* hops but NOT the SharedWorker boundary; the message fallback in src/lib/storage.ts's rethrow is
|
|
10
|
+
* what carries absence across that hop and re-mints the coded error for apps. The message does not
|
|
11
|
+
* survive being reworded, which is the problem this exists to end: absence arrives in two
|
|
12
|
+
* completely different sentences depending on which half of the read failed, and every consumer
|
|
13
|
+
* was left regex-matching both. Ripple got one of them and missed the other, and a library quietly
|
|
14
|
+
* went un-backed-up for a day because a missing backup read as a transient error.
|
|
15
|
+
*/
|
|
16
|
+
declare const STORAGE_NOT_FOUND = "FKN_STORAGE_NOT_FOUND";
|
|
17
|
+
/**
|
|
18
|
+
* "The api never answered", as a thing a caller can TEST, for the same reason as above and one
|
|
19
|
+
* more: a caller that relaxes anything when the server cannot be reached must never relax it on
|
|
20
|
+
* an ANSWERED error, because an answered 500 lands exactly when a key rotation or a setting flip
|
|
21
|
+
* may be propagating. The MESSAGE prefix is the wire contract: osra's error boxer ships name,
|
|
22
|
+
* message, stack and cause only, so a custom code does NOT survive the SharedWorker hop (the
|
|
23
|
+
* E2E_LOCKED_MESSAGE prefix match exists for exactly this reason). The code is still set for
|
|
24
|
+
* same-realm callers, which is the cheaper test when it is available.
|
|
25
|
+
*/
|
|
26
|
+
declare const STORAGE_UNREACHABLE = "FKN_API_UNREACHABLE";
|
|
27
|
+
//#endregion
|
|
28
|
+
export { STORAGE_UNREACHABLE as a, STORAGE_NOT_FOUND as i, E2E_LOCKED_MESSAGE as n, E2E_STALE_EPOCH_MESSAGE as r, E2E_INTEGRITY_MESSAGE as t };
|
package/messages.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=`fkn:e2e-locked`,t=`fkn:e2e-stale-epoch: this file is encrypted under a previous key you reset`,n=`fkn:e2e-integrity: stored data failed its integrity check`,r=`FKN_STORAGE_NOT_FOUND`,i=`FKN_API_UNREACHABLE`;exports.E2E_INTEGRITY_MESSAGE=n,exports.E2E_LOCKED_MESSAGE=e,exports.E2E_STALE_EPOCH_MESSAGE=t,exports.STORAGE_NOT_FOUND=r,exports.STORAGE_UNREACHABLE=i;
|
package/messages.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as STORAGE_UNREACHABLE, i as STORAGE_NOT_FOUND, n as E2E_LOCKED_MESSAGE, r as E2E_STALE_EPOCH_MESSAGE, t as E2E_INTEGRITY_MESSAGE } from "./messages-DvpKMTsY.js";
|
|
2
|
+
export { E2E_INTEGRITY_MESSAGE, E2E_LOCKED_MESSAGE, E2E_STALE_EPOCH_MESSAGE, STORAGE_NOT_FOUND, STORAGE_UNREACHABLE };
|
package/messages.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/messages.ts
|
|
2
|
+
var e = "fkn:e2e-locked", t = "fkn:e2e-stale-epoch: this file is encrypted under a previous key you reset", n = "fkn:e2e-integrity: stored data failed its integrity check", r = "FKN_STORAGE_NOT_FOUND", i = "FKN_API_UNREACHABLE";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { n as E2E_INTEGRITY_MESSAGE, e as E2E_LOCKED_MESSAGE, t as E2E_STALE_EPOCH_MESSAGE, r as STORAGE_NOT_FOUND, i as STORAGE_UNREACHABLE };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as TcpSocketOption } from "./wire-Gbo-D74t.js";
|
|
2
|
+
import { B as TcpSocketListenerResult, H as TcpSocketResult, P as Resolvers } from "./contract-D6ksmIm6.js";
|
|
3
|
+
import "./api-CesI0aMl.js";
|
|
2
4
|
import { AddressInfo, ListenOptions, Server, ServerOpts, Socket, SocketConnectOpts, SocketConstructorOpts } from "net";
|
|
3
5
|
import { DuplexOptions, Stream } from "stream";
|
|
4
6
|
import { EventEmitter } from "events";
|
|
5
7
|
import { BindOptions } from "dgram";
|
|
6
|
-
|
|
7
|
-
//#region src/lib/webvpn/utils.d.ts
|
|
8
|
+
//#region src/webvpn/utils.d.ts
|
|
8
9
|
declare const isIPv4: (input: string) => boolean;
|
|
9
10
|
declare const isIPv6: (input: string) => boolean;
|
|
10
11
|
declare const isIP: (input: string) => 0 | 4 | 6;
|
|
@@ -45,7 +46,7 @@ declare class Socket$2 extends Stream.Duplex implements Socket {
|
|
|
45
46
|
* the connection at all.
|
|
46
47
|
*/
|
|
47
48
|
_busyRelease?: () => void;
|
|
48
|
-
__webvpn_tcp_socket_init__(connection: ReturnType<WebVpnTcpSocket>, endpoints?: Awaited<ReturnType<WebVpnTcpSocket>>): Promise<(
|
|
49
|
+
__webvpn_tcp_socket_init__(connection: ReturnType<WebVpnTcpSocket>, endpoints?: Awaited<ReturnType<WebVpnTcpSocket>>): Promise<(TcpSocketResult & {
|
|
49
50
|
reader: ReadableStreamDefaultReader<Uint8Array>;
|
|
50
51
|
writer: WritableStreamDefaultWriter<Uint8Array>;
|
|
51
52
|
}) | undefined>;
|
|
@@ -110,12 +111,7 @@ declare class Server$1 extends EventEmitter implements Server {
|
|
|
110
111
|
connection?: ReturnType<WebVpnTcpSocketListener>;
|
|
111
112
|
}, connectionListener?: (socket: Socket$2) => void);
|
|
112
113
|
_busyRelease?: () => void;
|
|
113
|
-
__webvpn_tcp_socket_listener_init__(connection: ReturnType<WebVpnTcpSocketListener>): Promise<
|
|
114
|
-
localAddress: string;
|
|
115
|
-
localFamily: "IPv4" | "IPv6";
|
|
116
|
-
localPort: number;
|
|
117
|
-
close: () => Promise<void>;
|
|
118
|
-
} | undefined>;
|
|
114
|
+
__webvpn_tcp_socket_listener_init__(connection: ReturnType<WebVpnTcpSocketListener>): Promise<TcpSocketListenerResult | undefined>;
|
|
119
115
|
/**
|
|
120
116
|
* Starts a TCP listener through WebVPN. Port and host forms are supported.
|
|
121
117
|
* IPC paths and existing Node handles are not supported and reject at runtime.
|
|
@@ -151,12 +147,12 @@ declare const createServer: (options?: ServerOpts | ((socket: Socket$2) => void)
|
|
|
151
147
|
declare const _default: {
|
|
152
148
|
Socket: typeof Socket$2;
|
|
153
149
|
Server: typeof Server$1;
|
|
154
|
-
connect:
|
|
155
|
-
createConnection:
|
|
156
|
-
createServer:
|
|
157
|
-
isIP:
|
|
158
|
-
isIPv4:
|
|
159
|
-
isIPv6:
|
|
150
|
+
connect: typeof connect;
|
|
151
|
+
createConnection: typeof createConnection;
|
|
152
|
+
createServer: typeof createServer;
|
|
153
|
+
isIP: typeof isIP;
|
|
154
|
+
isIPv4: typeof isIPv4;
|
|
155
|
+
isIPv6: typeof isIPv6;
|
|
160
156
|
};
|
|
161
157
|
//#endregion
|
|
162
158
|
export { createConnection as a, isIP as c, connect as i, isIPv4 as l, Socket$2 as n, createServer as o, _default as r, net_d_exports as s, Server$1 as t, isIPv6 as u };
|
package/net.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-BCJO3EWi.cjs"),n=require("./busy-Dv8wzE5M.cjs"),r=require("./utils-BvgGdrgN.cjs");require("./wire.cjs");let i=require("stream"),a=require("events");var o=e.t({Server:()=>c,Socket:()=>s,_default:()=>f,connect:()=>l,createConnection:()=>u,createServer:()=>d,default:()=>f,isIP:()=>r.r,isIPv4:()=>r.i,isIPv6:()=>r.a}),s=class extends i.Stream.Duplex{_localAddress;_remoteAddress;_webVPNTcpSocketPromise;constructor(e){if(e?.fd!==void 0)throw Error(`FKN WebVPN does not support file descriptors`);super(e),e?.connection&&this.__webvpn_tcp_socket_init__(e.connection)}_busyRelease;__webvpn_tcp_socket_init__(e,t){if(this._busyRelease??=n.t(`tcp socket`),t&&(this._localAddress={address:t.localAddress,family:t.localFamily,port:t.localPort},this._remoteAddress={address:t.remoteAddress,family:t.remoteFamily,port:t.remotePort}),this._webVPNTcpSocketPromise=e.then(e=>{let t=e.dataReadableStream.getReader(),n=e.dataWritableStream.getWriter();return this._localAddress={address:e.localAddress,family:e.localFamily,port:e.localPort},this._remoteAddress={address:e.remoteAddress,family:e.remoteFamily,port:e.remotePort},{...e,reader:t,writer:n}}).catch(e=>{this.emit(`error`,e)}),!this._webVPNTcpSocketPromise)throw Error(`Socket not connected`);return this._webVPNTcpSocketPromise.then(e=>{if(!e){this._busyRelease?.();return}this.emit(`connect`)}),this._webVPNTcpSocketPromise}_read(e){if(!this._webVPNTcpSocketPromise)throw Error(`Socket not connected`);this._webVPNTcpSocketPromise.then(e=>{if(!e){this.push(null);return}e.reader.read().then(({value:e,done:t})=>{if(t){this.push(null);return}this._restartTimeoutTimer(),this.push(e)}).catch(e=>{this.destroy(e)})})}_write(e,t,n){if(!this._webVPNTcpSocketPromise){n(Error(`Socket not connected`));return}this._webVPNTcpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not connected`);await t.writer.ready,await t.writer.write(e),this._restartTimeoutTimer(),n()}).catch(n)}connect(...e){let n=r.c(...e),i=this.__webvpn_tcp_socket_init__(t.o(`an outbound tcp socket`).then(e=>e.cloud.webvpn.tcpSocket({remoteAddress:n.host??`localhost`,remotePort:n.port})));return n.callback&&i.then(e=>{e&&n.callback.call(this)}),this}_final(e){if(!this._webVPNTcpSocketPromise){e();return}this._webVPNTcpSocketPromise.then(async e=>{e&&await e.writer.close()}).then(()=>e(),t=>e(t))}_destroy(e,t){if(this._timeoutTimer&&clearTimeout(this._timeoutTimer),this._busyRelease?.(),!this._webVPNTcpSocketPromise){t(e);return}this._webVPNTcpSocketPromise.then(async e=>{e&&await(this._resetRequested?e.resetAndDestroy():e.destroy())}).then(()=>t(e),()=>t(e))}destroySoon(){if(this.writableFinished){this.destroy();return}this.once(`finish`,()=>this.destroy()),this.end()}_resetRequested=!1;resetAndDestroy(){return this._resetRequested=!0,this.destroy(),this}_timeoutMs;_timeoutTimer;_restartTimeoutTimer(){this._timeoutTimer&&clearTimeout(this._timeoutTimer),this._timeoutMs&&(this._timeoutTimer=setTimeout(()=>this.emit(`timeout`),this._timeoutMs))}setTimeout(e,t){return t&&this.on(`timeout`,t),this._timeoutMs=e,this._restartTimeoutTimer(),this}setNoDelay(e){let t=e??!0;return this._setTcpOption({type:0,value:t}),this}setKeepAlive(e,t){let n=e??!1,r=t!==void 0&&t>0?Math.max(1,Math.round(t/1e3)):0;return this._setTcpOption({type:2,enabled:n,initialDelaySeconds:r}),this}setSendBufferSize(e){return this._setTcpOption({type:3,value:e}),this}setRecvBufferSize(e){return this._setTcpOption({type:4,value:e}),this}_typeOfService;getTypeOfService(){return this._typeOfService??0}setTypeOfService(e){return this._typeOfService=e,this}_setTcpOption(e){if(!this._webVPNTcpSocketPromise){this.emit(`error`,Error(`Cannot set socket option before connect`));return}this._webVPNTcpSocketPromise.then(async t=>{if(t)try{await t.setOption(e)}catch(e){this.emit(`error`,e)}})}write(e,t,...n){return super.write(e,t,...n)}address(){return this._localAddress??{}}unref(){return this}ref(){return this}autoSelectFamilyAttemptedAddresses;bufferSize;bytesRead;bytesWritten;connecting;pending;get localAddress(){if(!this._localAddress)throw Error(`Socket is not connected`);return this._localAddress.address}get localPort(){if(!this._localAddress)throw Error(`Socket is not connected`);return this._localAddress.port}get localFamily(){if(!this._localAddress)throw Error(`Socket is not connected`);return this._localAddress.family}readyState;get remoteAddress(){if(!this._remoteAddress)throw Error(`Socket is not connected`);return this._remoteAddress.address}get remotePort(){if(!this._remoteAddress)throw Error(`Socket is not connected`);return this._remoteAddress.port}get remoteFamily(){if(!this._remoteAddress)throw Error(`Socket is not connected`);return this._remoteAddress.family}timeout},c=class extends a.EventEmitter{_localAddress;_webVPNTcpSocketListenerPromise;constructor(e,t){super(e),t&&this.on(`connection`,t),e?.connection&&this.__webvpn_tcp_socket_listener_init__(e.connection)}_busyRelease;__webvpn_tcp_socket_listener_init__(e){return this._busyRelease??=n.t(`tcp server`),this._webVPNTcpSocketListenerPromise=e.then(e=>(this._localAddress={address:e.localAddress,family:e.localFamily,port:e.localPort},e)).catch(e=>{this.emit(`error`,e)}),this._webVPNTcpSocketListenerPromise.then(e=>{if(!e){this._busyRelease?.();return}this.emit(`listening`)}),this._webVPNTcpSocketListenerPromise}listen(...e){let n=r.c(...e);this._closeEmitted=!1;let i=e=>{let t=new s;t.__webvpn_tcp_socket_init__(Promise.resolve(e),e),this.emit(`connection`,t)},a=e=>{this._localAddress=void 0;try{e&&this.listenerCount(`error`)>0&&this.emit(`error`,e)}finally{this._emitClose()}},o=e=>t.o(`a tcp listener`).then(t=>t.cloud.webvpn.tcpSocketListener({localAddress:e,localPort:n.port,onConnection:i,onClose:a})),c=n.host?o(n.host):o(`::`).catch(()=>o(`0.0.0.0`)),l=this.__webvpn_tcp_socket_listener_init__(c);return n.callback&&l.then(e=>{e&&n.callback.call(this)}),this}_closeEmitted=!1;_emitClose(){this._closeEmitted||(this._closeEmitted=!0,this._busyRelease?.(),this.emit(`close`))}close(e){return this._webVPNTcpSocketListenerPromise&&this._webVPNTcpSocketListenerPromise.then(async t=>{if(t)try{await t.close(),this._localAddress=void 0,this._emitClose(),e&&e()}catch(t){this._localAddress=void 0,this._emitClose(),e&&e(t)}}),this}address(){return this._localAddress??null}getConnections(e){throw Error(`Method not implemented.`)}ref(){return this}unref(){return this}maxConnections;connections;listening;async[Symbol.asyncDispose](){}},l=(e,t)=>new s().connect(e,t),u=(e,t)=>new s().connect(e,t),d=(e,t)=>{typeof e==`function`&&(t=e,e=void 0);let n=new c(e);return t&&n.on(`connection`,t),n},f={Socket:s,Server:c,connect:l,createConnection:u,createServer:d,isIP:r.r,isIPv4:r.i,isIPv6:r.a};exports.Server=c,exports.Socket=s,exports._default=f,exports.default=f,exports.connect=l,exports.createConnection=u,exports.createServer=d,exports.isIP=r.r,exports.isIPv4=r.i,exports.isIPv6=r.a,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
|
package/net.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createConnection, c as isIP, i as connect, l as isIPv4, n as Socket, o as createServer, r as _default, t as Server, u as isIPv6 } from "./net-
|
|
1
|
+
import { a as createConnection, c as isIP, i as connect, l as isIPv4, n as Socket, o as createServer, r as _default, t as Server, u as isIPv6 } from "./net-DAOcF3Eb.js";
|
|
2
2
|
export { Server, Socket, _default, _default as default, connect, createConnection, createServer, isIP, isIPv4, isIPv6 };
|
package/net.js
CHANGED
|
@@ -1,3 +1,318 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
+
import { o as t } from "./api-DLvscoll.js";
|
|
3
|
+
import { t as n } from "./busy-B189uX--.js";
|
|
4
|
+
import { a as r, c as i, i as a, r as o } from "./utils-C-cAd4r4.js";
|
|
5
|
+
import "./wire.js";
|
|
6
|
+
import { Stream as s } from "stream";
|
|
7
|
+
import { EventEmitter as c } from "events";
|
|
8
|
+
//#region src/webvpn/net.ts
|
|
9
|
+
var l = /* @__PURE__ */ e({
|
|
10
|
+
Server: () => d,
|
|
11
|
+
Socket: () => u,
|
|
12
|
+
_default: () => h,
|
|
13
|
+
connect: () => f,
|
|
14
|
+
createConnection: () => p,
|
|
15
|
+
createServer: () => m,
|
|
16
|
+
default: () => h,
|
|
17
|
+
isIP: () => o,
|
|
18
|
+
isIPv4: () => a,
|
|
19
|
+
isIPv6: () => r
|
|
20
|
+
}), u = class extends s.Duplex {
|
|
21
|
+
_localAddress;
|
|
22
|
+
_remoteAddress;
|
|
23
|
+
_webVPNTcpSocketPromise;
|
|
24
|
+
constructor(e) {
|
|
25
|
+
if (e?.fd !== void 0) throw Error("FKN WebVPN does not support file descriptors");
|
|
26
|
+
super(e), e?.connection && this.__webvpn_tcp_socket_init__(e.connection);
|
|
27
|
+
}
|
|
28
|
+
_busyRelease;
|
|
29
|
+
__webvpn_tcp_socket_init__(e, t) {
|
|
30
|
+
if (this._busyRelease ??= n("tcp socket"), t && (this._localAddress = {
|
|
31
|
+
address: t.localAddress,
|
|
32
|
+
family: t.localFamily,
|
|
33
|
+
port: t.localPort
|
|
34
|
+
}, this._remoteAddress = {
|
|
35
|
+
address: t.remoteAddress,
|
|
36
|
+
family: t.remoteFamily,
|
|
37
|
+
port: t.remotePort
|
|
38
|
+
}), this._webVPNTcpSocketPromise = e.then((e) => {
|
|
39
|
+
let t = e.dataReadableStream.getReader(), n = e.dataWritableStream.getWriter();
|
|
40
|
+
return this._localAddress = {
|
|
41
|
+
address: e.localAddress,
|
|
42
|
+
family: e.localFamily,
|
|
43
|
+
port: e.localPort
|
|
44
|
+
}, this._remoteAddress = {
|
|
45
|
+
address: e.remoteAddress,
|
|
46
|
+
family: e.remoteFamily,
|
|
47
|
+
port: e.remotePort
|
|
48
|
+
}, {
|
|
49
|
+
...e,
|
|
50
|
+
reader: t,
|
|
51
|
+
writer: n
|
|
52
|
+
};
|
|
53
|
+
}).catch((e) => {
|
|
54
|
+
this.emit("error", e);
|
|
55
|
+
}), !this._webVPNTcpSocketPromise) throw Error("Socket not connected");
|
|
56
|
+
return this._webVPNTcpSocketPromise.then((e) => {
|
|
57
|
+
if (!e) {
|
|
58
|
+
this._busyRelease?.();
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
this.emit("connect");
|
|
62
|
+
}), this._webVPNTcpSocketPromise;
|
|
63
|
+
}
|
|
64
|
+
_read(e) {
|
|
65
|
+
if (!this._webVPNTcpSocketPromise) throw Error("Socket not connected");
|
|
66
|
+
this._webVPNTcpSocketPromise.then((e) => {
|
|
67
|
+
if (!e) {
|
|
68
|
+
this.push(null);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
e.reader.read().then(({ value: e, done: t }) => {
|
|
72
|
+
if (t) {
|
|
73
|
+
this.push(null);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
this._restartTimeoutTimer(), this.push(e);
|
|
77
|
+
}).catch((e) => {
|
|
78
|
+
this.destroy(e);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
_write(e, t, n) {
|
|
83
|
+
if (!this._webVPNTcpSocketPromise) {
|
|
84
|
+
n(/* @__PURE__ */ Error("Socket not connected"));
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
this._webVPNTcpSocketPromise.then(async (t) => {
|
|
88
|
+
if (!t) throw Error("Socket not connected");
|
|
89
|
+
await t.writer.ready, await t.writer.write(e), this._restartTimeoutTimer(), n();
|
|
90
|
+
}).catch(n);
|
|
91
|
+
}
|
|
92
|
+
connect(...e) {
|
|
93
|
+
let n = i(...e), r = this.__webvpn_tcp_socket_init__(t("an outbound tcp socket").then((e) => e.cloud.webvpn.tcpSocket({
|
|
94
|
+
remoteAddress: n.host ?? "localhost",
|
|
95
|
+
remotePort: n.port
|
|
96
|
+
})));
|
|
97
|
+
return n.callback && r.then((e) => {
|
|
98
|
+
e && n.callback.call(this);
|
|
99
|
+
}), this;
|
|
100
|
+
}
|
|
101
|
+
_final(e) {
|
|
102
|
+
if (!this._webVPNTcpSocketPromise) {
|
|
103
|
+
e();
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
this._webVPNTcpSocketPromise.then(async (e) => {
|
|
107
|
+
e && await e.writer.close();
|
|
108
|
+
}).then(() => e(), (t) => e(t));
|
|
109
|
+
}
|
|
110
|
+
_destroy(e, t) {
|
|
111
|
+
if (this._timeoutTimer && clearTimeout(this._timeoutTimer), this._busyRelease?.(), !this._webVPNTcpSocketPromise) {
|
|
112
|
+
t(e);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
this._webVPNTcpSocketPromise.then(async (e) => {
|
|
116
|
+
e && await (this._resetRequested ? e.resetAndDestroy() : e.destroy());
|
|
117
|
+
}).then(() => t(e), () => t(e));
|
|
118
|
+
}
|
|
119
|
+
destroySoon() {
|
|
120
|
+
if (this.writableFinished) {
|
|
121
|
+
this.destroy();
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
this.once("finish", () => this.destroy()), this.end();
|
|
125
|
+
}
|
|
126
|
+
_resetRequested = !1;
|
|
127
|
+
resetAndDestroy() {
|
|
128
|
+
return this._resetRequested = !0, this.destroy(), this;
|
|
129
|
+
}
|
|
130
|
+
_timeoutMs;
|
|
131
|
+
_timeoutTimer;
|
|
132
|
+
_restartTimeoutTimer() {
|
|
133
|
+
this._timeoutTimer && clearTimeout(this._timeoutTimer), this._timeoutMs && (this._timeoutTimer = setTimeout(() => this.emit("timeout"), this._timeoutMs));
|
|
134
|
+
}
|
|
135
|
+
setTimeout(e, t) {
|
|
136
|
+
return t && this.on("timeout", t), this._timeoutMs = e, this._restartTimeoutTimer(), this;
|
|
137
|
+
}
|
|
138
|
+
setNoDelay(e) {
|
|
139
|
+
let t = e ?? !0;
|
|
140
|
+
return this._setTcpOption({
|
|
141
|
+
type: 0,
|
|
142
|
+
value: t
|
|
143
|
+
}), this;
|
|
144
|
+
}
|
|
145
|
+
setKeepAlive(e, t) {
|
|
146
|
+
let n = e ?? !1, r = t !== void 0 && t > 0 ? Math.max(1, Math.round(t / 1e3)) : 0;
|
|
147
|
+
return this._setTcpOption({
|
|
148
|
+
type: 2,
|
|
149
|
+
enabled: n,
|
|
150
|
+
initialDelaySeconds: r
|
|
151
|
+
}), this;
|
|
152
|
+
}
|
|
153
|
+
setSendBufferSize(e) {
|
|
154
|
+
return this._setTcpOption({
|
|
155
|
+
type: 3,
|
|
156
|
+
value: e
|
|
157
|
+
}), this;
|
|
158
|
+
}
|
|
159
|
+
setRecvBufferSize(e) {
|
|
160
|
+
return this._setTcpOption({
|
|
161
|
+
type: 4,
|
|
162
|
+
value: e
|
|
163
|
+
}), this;
|
|
164
|
+
}
|
|
165
|
+
_typeOfService;
|
|
166
|
+
getTypeOfService() {
|
|
167
|
+
return this._typeOfService ?? 0;
|
|
168
|
+
}
|
|
169
|
+
setTypeOfService(e) {
|
|
170
|
+
return this._typeOfService = e, this;
|
|
171
|
+
}
|
|
172
|
+
_setTcpOption(e) {
|
|
173
|
+
if (!this._webVPNTcpSocketPromise) {
|
|
174
|
+
this.emit("error", /* @__PURE__ */ Error("Cannot set socket option before connect"));
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
this._webVPNTcpSocketPromise.then(async (t) => {
|
|
178
|
+
if (t) try {
|
|
179
|
+
await t.setOption(e);
|
|
180
|
+
} catch (e) {
|
|
181
|
+
this.emit("error", e);
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
write(e, t, ...n) {
|
|
186
|
+
return super.write(e, t, ...n);
|
|
187
|
+
}
|
|
188
|
+
address() {
|
|
189
|
+
return this._localAddress ?? {};
|
|
190
|
+
}
|
|
191
|
+
unref() {
|
|
192
|
+
return this;
|
|
193
|
+
}
|
|
194
|
+
ref() {
|
|
195
|
+
return this;
|
|
196
|
+
}
|
|
197
|
+
autoSelectFamilyAttemptedAddresses;
|
|
198
|
+
bufferSize;
|
|
199
|
+
bytesRead;
|
|
200
|
+
bytesWritten;
|
|
201
|
+
connecting;
|
|
202
|
+
pending;
|
|
203
|
+
get localAddress() {
|
|
204
|
+
if (!this._localAddress) throw Error("Socket is not connected");
|
|
205
|
+
return this._localAddress.address;
|
|
206
|
+
}
|
|
207
|
+
get localPort() {
|
|
208
|
+
if (!this._localAddress) throw Error("Socket is not connected");
|
|
209
|
+
return this._localAddress.port;
|
|
210
|
+
}
|
|
211
|
+
get localFamily() {
|
|
212
|
+
if (!this._localAddress) throw Error("Socket is not connected");
|
|
213
|
+
return this._localAddress.family;
|
|
214
|
+
}
|
|
215
|
+
readyState;
|
|
216
|
+
get remoteAddress() {
|
|
217
|
+
if (!this._remoteAddress) throw Error("Socket is not connected");
|
|
218
|
+
return this._remoteAddress.address;
|
|
219
|
+
}
|
|
220
|
+
get remotePort() {
|
|
221
|
+
if (!this._remoteAddress) throw Error("Socket is not connected");
|
|
222
|
+
return this._remoteAddress.port;
|
|
223
|
+
}
|
|
224
|
+
get remoteFamily() {
|
|
225
|
+
if (!this._remoteAddress) throw Error("Socket is not connected");
|
|
226
|
+
return this._remoteAddress.family;
|
|
227
|
+
}
|
|
228
|
+
timeout;
|
|
229
|
+
}, d = class extends c {
|
|
230
|
+
_localAddress;
|
|
231
|
+
_webVPNTcpSocketListenerPromise;
|
|
232
|
+
constructor(e, t) {
|
|
233
|
+
super(e), t && this.on("connection", t), e?.connection && this.__webvpn_tcp_socket_listener_init__(e.connection);
|
|
234
|
+
}
|
|
235
|
+
_busyRelease;
|
|
236
|
+
__webvpn_tcp_socket_listener_init__(e) {
|
|
237
|
+
return this._busyRelease ??= n("tcp server"), this._webVPNTcpSocketListenerPromise = e.then((e) => (this._localAddress = {
|
|
238
|
+
address: e.localAddress,
|
|
239
|
+
family: e.localFamily,
|
|
240
|
+
port: e.localPort
|
|
241
|
+
}, e)).catch((e) => {
|
|
242
|
+
this.emit("error", e);
|
|
243
|
+
}), this._webVPNTcpSocketListenerPromise.then((e) => {
|
|
244
|
+
if (!e) {
|
|
245
|
+
this._busyRelease?.();
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
this.emit("listening");
|
|
249
|
+
}), this._webVPNTcpSocketListenerPromise;
|
|
250
|
+
}
|
|
251
|
+
listen(...e) {
|
|
252
|
+
let n = i(...e);
|
|
253
|
+
this._closeEmitted = !1;
|
|
254
|
+
let r = (e) => {
|
|
255
|
+
let t = new u();
|
|
256
|
+
t.__webvpn_tcp_socket_init__(Promise.resolve(e), e), this.emit("connection", t);
|
|
257
|
+
}, a = (e) => {
|
|
258
|
+
this._localAddress = void 0;
|
|
259
|
+
try {
|
|
260
|
+
e && this.listenerCount("error") > 0 && this.emit("error", e);
|
|
261
|
+
} finally {
|
|
262
|
+
this._emitClose();
|
|
263
|
+
}
|
|
264
|
+
}, o = (e) => t("a tcp listener").then((t) => t.cloud.webvpn.tcpSocketListener({
|
|
265
|
+
localAddress: e,
|
|
266
|
+
localPort: n.port,
|
|
267
|
+
onConnection: r,
|
|
268
|
+
onClose: a
|
|
269
|
+
})), s = n.host ? o(n.host) : o("::").catch(() => o("0.0.0.0")), c = this.__webvpn_tcp_socket_listener_init__(s);
|
|
270
|
+
return n.callback && c.then((e) => {
|
|
271
|
+
e && n.callback.call(this);
|
|
272
|
+
}), this;
|
|
273
|
+
}
|
|
274
|
+
_closeEmitted = !1;
|
|
275
|
+
_emitClose() {
|
|
276
|
+
this._closeEmitted || (this._closeEmitted = !0, this._busyRelease?.(), this.emit("close"));
|
|
277
|
+
}
|
|
278
|
+
close(e) {
|
|
279
|
+
return this._webVPNTcpSocketListenerPromise && this._webVPNTcpSocketListenerPromise.then(async (t) => {
|
|
280
|
+
if (t) try {
|
|
281
|
+
await t.close(), this._localAddress = void 0, this._emitClose(), e && e();
|
|
282
|
+
} catch (t) {
|
|
283
|
+
this._localAddress = void 0, this._emitClose(), e && e(t);
|
|
284
|
+
}
|
|
285
|
+
}), this;
|
|
286
|
+
}
|
|
287
|
+
address() {
|
|
288
|
+
return this._localAddress ?? null;
|
|
289
|
+
}
|
|
290
|
+
getConnections(e) {
|
|
291
|
+
throw Error("Method not implemented.");
|
|
292
|
+
}
|
|
293
|
+
ref() {
|
|
294
|
+
return this;
|
|
295
|
+
}
|
|
296
|
+
unref() {
|
|
297
|
+
return this;
|
|
298
|
+
}
|
|
299
|
+
maxConnections;
|
|
300
|
+
connections;
|
|
301
|
+
listening;
|
|
302
|
+
async [Symbol.asyncDispose]() {}
|
|
303
|
+
}, f = (e, t) => new u().connect(e, t), p = (e, t) => new u().connect(e, t), m = (e, t) => {
|
|
304
|
+
typeof e == "function" && (t = e, e = void 0);
|
|
305
|
+
let n = new d(e);
|
|
306
|
+
return t && n.on("connection", t), n;
|
|
307
|
+
}, h = {
|
|
308
|
+
Socket: u,
|
|
309
|
+
Server: d,
|
|
310
|
+
connect: f,
|
|
311
|
+
createConnection: p,
|
|
312
|
+
createServer: m,
|
|
313
|
+
isIP: o,
|
|
314
|
+
isIPv4: a,
|
|
315
|
+
isIPv6: r
|
|
316
|
+
};
|
|
317
|
+
//#endregion
|
|
318
|
+
export { d as Server, u as Socket, h as _default, h as default, f as connect, p as createConnection, m as createServer, o as isIP, a as isIPv4, r as isIPv6, l as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as e } from "./busy-
|
|
1
|
+
import { r as e } from "./busy-B189uX--.js";
|
|
2
2
|
import { Buffer as t } from "buffer";
|
|
3
|
-
//#region src/
|
|
3
|
+
//#region src/fs/content-type.ts
|
|
4
4
|
var n = {
|
|
5
5
|
json: "application/json",
|
|
6
6
|
txt: "text/plain",
|
package/opfs/promises.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as WriteData, i as Stats, n as MakeOptions, o as WriteOptions, r as ReadOptions } from "../index-BQgZVQl7.js";
|
|
2
2
|
import { promises } from "../opfs.js";
|
|
3
|
-
|
|
4
|
-
//#region src/lib/opfs/promises.d.ts
|
|
3
|
+
//#region src/opfs/promises.d.ts
|
|
5
4
|
declare const readFile: (path: import("node:fs").PathLike, options?: ReadOptions) => Promise<Buffer | string>, writeFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>, appendFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>, unlink: (path: import("node:fs").PathLike) => Promise<void>, rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>, readdir: (path: import("node:fs").PathLike) => Promise<string[]>, mkdir: (path: import("node:fs").PathLike, options?: MakeOptions) => Promise<void>, rm: (path: import("node:fs").PathLike, options?: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
recursive?: boolean;
|
|
6
|
+
force?: boolean;
|
|
7
|
+
}) => Promise<void>, rmdir: (path: import("node:fs").PathLike, options?: {
|
|
8
|
+
recursive?: boolean;
|
|
9
|
+
}) => Promise<void>, stat: (path: import("node:fs").PathLike) => Promise<Stats>, lstat: (path: import("node:fs").PathLike) => Promise<Stats>, access: (path: import("node:fs").PathLike) => Promise<void>;
|
|
11
10
|
//#endregion
|
|
12
11
|
export { access, appendFile, promises as default, lstat, mkdir, readFile, readdir, rename, rm, rmdir, stat, unlink, writeFile };
|
package/opfs/promises.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { promises as e } from "../opfs.js";
|
|
2
|
-
//#region src/
|
|
2
|
+
//#region src/opfs/promises.ts
|
|
3
3
|
var { readFile: t, writeFile: n, appendFile: r, unlink: i, rename: a, readdir: o, mkdir: s, rm: c, rmdir: l, stat: u, lstat: d, access: f } = e, p = e;
|
|
4
4
|
//#endregion
|
|
5
5
|
export { f as access, r as appendFile, p as default, d as lstat, s as mkdir, t as readFile, o as readdir, a as rename, c as rm, l as rmdir, u as stat, i as unlink, n as writeFile };
|
package/opfs.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
|
|
3
|
-
//#region src/lib/opfs/index.d.ts
|
|
1
|
+
import { a as WriteData, i as Stats, n as MakeOptions, o as WriteOptions, r as ReadOptions, t as Callback } from "./index-BQgZVQl7.js";
|
|
4
2
|
declare namespace index_d_exports {
|
|
5
3
|
export { Stats, appendFile, appendFileSync, available, fs as default, exists, existsSync, flush, lstatSync, mkdir, mkdirSync, mount, promises, readFile, readFileSync, readdir, readdirSync, remount, rename, renameSync, rm, rmSync, rmdirSync, stat, statSync, unlink, unlinkSync, writeFile, writeFileSync };
|
|
6
4
|
}
|
|
@@ -60,31 +58,31 @@ declare const fs: {
|
|
|
60
58
|
remount: () => Promise<void>;
|
|
61
59
|
};
|
|
62
60
|
declare const available: () => Promise<boolean>, readFileSync: (path: import("node:fs").PathLike, options?: ReadOptions) => Buffer | string, writeFileSync: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => void, appendFileSync: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => void, existsSync: (path: import("node:fs").PathLike) => boolean, statSync: (path: import("node:fs").PathLike) => Stats, lstatSync: (path: import("node:fs").PathLike) => Stats, readdirSync: (path: import("node:fs").PathLike) => string[], mkdirSync: (path: import("node:fs").PathLike, options?: MakeOptions) => void, rmSync: (path: import("node:fs").PathLike, options?: {
|
|
61
|
+
recursive?: boolean;
|
|
62
|
+
force?: boolean;
|
|
63
|
+
}) => void, rmdirSync: (path: import("node:fs").PathLike, options?: {
|
|
64
|
+
recursive?: boolean;
|
|
65
|
+
}) => void, unlinkSync: (path: import("node:fs").PathLike) => void, renameSync: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => void, readFile: (path: import("node:fs").PathLike, a: ReadOptions | Callback<Buffer | string>, b?: Callback<Buffer | string>) => void, writeFile: (path: import("node:fs").PathLike, data: WriteData, a: WriteOptions | Callback<void>, b?: Callback<void>) => void, appendFile: (path: import("node:fs").PathLike, data: WriteData, a: WriteOptions | Callback<void>, b?: Callback<void>) => void, stat: (path: import("node:fs").PathLike, callback: Callback<Stats>) => void, readdir: (path: import("node:fs").PathLike, a: unknown, b?: Callback<string[]>) => void, mkdir: (path: import("node:fs").PathLike, a: MakeOptions | Callback<void>, b?: Callback<void>) => void, rm: (path: import("node:fs").PathLike, a: {
|
|
66
|
+
recursive?: boolean;
|
|
67
|
+
force?: boolean;
|
|
68
|
+
} | Callback<void>, b?: Callback<void>) => void, unlink: (path: import("node:fs").PathLike, callback: Callback<void>) => void, rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike, callback: Callback<void>) => void, exists: (path: import("node:fs").PathLike, callback: (exists: boolean) => void) => void, promises: {
|
|
69
|
+
readFile: (path: import("node:fs").PathLike, options?: ReadOptions) => Promise<Buffer | string>;
|
|
70
|
+
writeFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
|
|
71
|
+
appendFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
|
|
72
|
+
stat: (path: import("node:fs").PathLike) => Promise<Stats>;
|
|
73
|
+
lstat: (path: import("node:fs").PathLike) => Promise<Stats>;
|
|
74
|
+
readdir: (path: import("node:fs").PathLike) => Promise<string[]>;
|
|
75
|
+
mkdir: (path: import("node:fs").PathLike, options?: MakeOptions) => Promise<void>;
|
|
76
|
+
rm: (path: import("node:fs").PathLike, options?: {
|
|
63
77
|
recursive?: boolean;
|
|
64
78
|
force?: boolean;
|
|
65
|
-
}) => void
|
|
79
|
+
}) => Promise<void>;
|
|
80
|
+
rmdir: (path: import("node:fs").PathLike, options?: {
|
|
66
81
|
recursive?: boolean;
|
|
67
|
-
}) =>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
writeFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
|
|
73
|
-
appendFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
|
|
74
|
-
stat: (path: import("node:fs").PathLike) => Promise<Stats>;
|
|
75
|
-
lstat: (path: import("node:fs").PathLike) => Promise<Stats>;
|
|
76
|
-
readdir: (path: import("node:fs").PathLike) => Promise<string[]>;
|
|
77
|
-
mkdir: (path: import("node:fs").PathLike, options?: MakeOptions) => Promise<void>;
|
|
78
|
-
rm: (path: import("node:fs").PathLike, options?: {
|
|
79
|
-
recursive?: boolean;
|
|
80
|
-
force?: boolean;
|
|
81
|
-
}) => Promise<void>;
|
|
82
|
-
rmdir: (path: import("node:fs").PathLike, options?: {
|
|
83
|
-
recursive?: boolean;
|
|
84
|
-
}) => Promise<void>;
|
|
85
|
-
unlink: (path: import("node:fs").PathLike) => Promise<void>;
|
|
86
|
-
rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>;
|
|
87
|
-
access: (path: import("node:fs").PathLike) => Promise<void>;
|
|
88
|
-
}, mount: () => Promise<void>, flush: () => Promise<void>, remount: () => Promise<void>;
|
|
82
|
+
}) => Promise<void>;
|
|
83
|
+
unlink: (path: import("node:fs").PathLike) => Promise<void>;
|
|
84
|
+
rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>;
|
|
85
|
+
access: (path: import("node:fs").PathLike) => Promise<void>;
|
|
86
|
+
}, mount: () => Promise<void>, flush: () => Promise<void>, remount: () => Promise<void>;
|
|
89
87
|
//#endregion
|
|
90
88
|
export { type Stats, appendFile, appendFileSync, available, fs as default, exists, existsSync, flush, lstatSync, mkdir, mkdirSync, mount, promises, readFile, readFileSync, readdir, readdirSync, remount, rename, renameSync, rm, rmSync, rmdirSync, stat, statSync, index_d_exports as t, unlink, unlinkSync, writeFile, writeFileSync };
|
package/opfs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { t } from "./node-fs-
|
|
3
|
-
import { r as n } from "./opfs-
|
|
4
|
-
//#region src/
|
|
2
|
+
import { t } from "./node-fs-C9ECR_9H.js";
|
|
3
|
+
import { r as n } from "./opfs-D0goLAQW.js";
|
|
4
|
+
//#region src/opfs/index.ts
|
|
5
5
|
var r = /* @__PURE__ */ e({
|
|
6
6
|
appendFile: () => b,
|
|
7
7
|
appendFileSync: () => c,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fkn/lib",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.25",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -115,12 +115,37 @@
|
|
|
115
115
|
"import": "./react.js",
|
|
116
116
|
"require": "./react.cjs"
|
|
117
117
|
},
|
|
118
|
+
"./contract": {
|
|
119
|
+
"types": "./contract.d.ts",
|
|
120
|
+
"import": "./contract.js",
|
|
121
|
+
"require": "./contract.cjs"
|
|
122
|
+
},
|
|
123
|
+
"./wire": {
|
|
124
|
+
"types": "./wire.d.ts",
|
|
125
|
+
"import": "./wire.js",
|
|
126
|
+
"require": "./wire.cjs"
|
|
127
|
+
},
|
|
128
|
+
"./messages": {
|
|
129
|
+
"types": "./messages.d.ts",
|
|
130
|
+
"import": "./messages.js",
|
|
131
|
+
"require": "./messages.cjs"
|
|
132
|
+
},
|
|
133
|
+
"./attach-policy": {
|
|
134
|
+
"types": "./attach-policy.d.ts",
|
|
135
|
+
"import": "./attach-policy.js",
|
|
136
|
+
"require": "./attach-policy.cjs"
|
|
137
|
+
},
|
|
138
|
+
"./api": {
|
|
139
|
+
"types": "./api.d.ts",
|
|
140
|
+
"import": "./api.js",
|
|
141
|
+
"require": "./api.cjs"
|
|
142
|
+
},
|
|
118
143
|
"./package.json": "./package.json"
|
|
119
144
|
},
|
|
120
145
|
"dependencies": {
|
|
121
146
|
"ip-address": "^10.1.0",
|
|
122
147
|
"osra": "^0.6.4",
|
|
123
|
-
"@types/node": "^25.
|
|
148
|
+
"@types/node": "^25.9.5"
|
|
124
149
|
},
|
|
125
150
|
"peerDependencies": {
|
|
126
151
|
"react": ">=18"
|