@fkn/lib 0.9.64 → 0.9.66
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/README.md +1 -2
- package/account-Bm7uIcQo.d.ts +39 -0
- package/account-Uh0-1Cbp.js +22 -0
- package/{account-generation-BiZxPztj.cjs → account-generation-ACCBzaI-.cjs} +1 -1
- package/{account-generation-DvRuJDa2.js → account-generation-BKHNe-jL.js} +2 -3
- package/account-m2iCmNui.cjs +1 -0
- package/{account-storage-D8CBG1cv.js → account-storage-BmCVutNL.js} +4 -5
- package/{account-storage-Co9IvkPr.d.ts → account-storage-UmSfF63A.d.ts} +1 -66
- package/{account-storage-DpHBgeX5.cjs → account-storage-dYWDpqsr.cjs} +1 -1
- package/account.cjs +1 -1
- package/account.d.ts +3 -40
- package/account.js +1 -23
- package/{api-xh6lzApn.d.ts → api-0Yp9uZcV.d.ts} +3 -7
- package/{api-BvJu2X1L.js → api-DRglK7ft.js} +19 -21
- package/{api-CrUO33y-.cjs → api-DrvhPN56.cjs} +1 -1
- package/api.cjs +1 -1
- package/api.d.ts +2 -2
- package/api.js +1 -2
- package/attach-policy.d.ts +0 -4
- package/attach-policy.js +2 -3
- package/{broker-frame-B31OXcnH.js → broker-frame-vjSpBa8d.js} +1 -2
- package/broker-frame.d.ts +1 -3
- package/broker-frame.js +1 -2
- package/{busy-DsMWrSzc.js → busy-C1JPjoZ_.js} +1 -2
- package/cloud/dgram.cjs +1 -1
- package/cloud/dgram.d.ts +1 -1
- package/cloud/dgram.js +1 -2
- package/cloud/dns.cjs +1 -1
- package/cloud/dns.d.ts +2 -2
- package/cloud/dns.js +1 -2
- package/cloud/fetch.cjs +1 -1
- package/cloud/fetch.d.ts +1 -1
- package/cloud/fetch.js +1 -2
- package/cloud/fs/promises.cjs +1 -1
- package/cloud/fs/promises.d.ts +3 -5
- package/cloud/fs/promises.js +2 -3
- package/cloud/fs.cjs +1 -1
- package/cloud/fs.d.ts +4 -4
- package/cloud/fs.js +4 -34
- package/cloud/http.cjs +1 -1
- package/cloud/http.d.ts +1 -1
- package/cloud/http.js +1 -2
- package/cloud/net.cjs +1 -1
- package/cloud/net.d.ts +1 -1
- package/cloud/net.js +3 -3
- package/{cloud-CI7FFRMC.d.ts → cloud-BoH54gaM.d.ts} +7 -11
- package/{cloud-FW59_g8F.js → cloud-C7StNncS.js} +15 -16
- package/cloud-TN0eDUy3.cjs +1 -0
- package/cloud.cjs +1 -1
- package/cloud.d.ts +7 -7
- package/cloud.js +7 -7
- package/connect-button-2FmOM8ai.d.ts +2 -0
- package/{connect-button-DtsN3X1J.js → connect-button-C1wKkIhh.js} +1 -2
- package/{contract-BGMJVvTg.d.ts → contract-0rua6Wsh.d.ts} +11 -6
- package/contract.d.ts +3 -3
- package/contract.js +1 -2
- package/desktop-DOubT4ES.d.ts +57 -0
- package/desktop-vXKU4wEK.cjs +1 -0
- package/desktop-xTT7ciGX.js +50 -0
- package/desktop.cjs +1 -1
- package/desktop.d.ts +2 -58
- package/desktop.js +1 -51
- package/dgram-BBbLokVF.js +397 -0
- package/dgram-BYk-QDHW.d.ts +118 -0
- package/dgram-D9ljiUFh.cjs +1 -0
- package/dgram.cjs +1 -1
- package/dgram.d.ts +2 -119
- package/dgram.js +1 -410
- package/dns-2v96zoEh.cjs +1 -0
- package/dns-DyB4K2oE.d.ts +9 -0
- package/dns-o8DLFjP1.js +5 -0
- package/dns.cjs +1 -1
- package/dns.d.ts +3 -10
- package/dns.js +1 -6
- package/extension-BXBjpypy.cjs +1 -0
- package/{extension-Chmpunqf.js → extension-D5UMnEmQ.js} +9 -11
- package/{extension-C1bcizcn.d.ts → extension-D98KM8W7.d.ts} +1 -27
- package/extension.cjs +1 -1
- package/extension.d.ts +2 -2
- package/extension.js +2 -2
- package/fs/promises.cjs +1 -1
- package/fs/promises.d.ts +2 -4
- package/fs/promises.js +2 -3
- package/fs--MLHvMW-.cjs +1 -0
- package/fs-BX_ghRy0.cjs +1 -0
- package/fs-BnWXGRik.js +33 -0
- package/{fs-DCJAYoYy.d.ts → fs-ChOYC6VD.d.ts} +3 -4
- package/{fs-Djuaj5pQ.js → fs-Cw7CcUhx.js} +17 -41
- package/fs.cjs +1 -1
- package/fs.d.ts +4 -4
- package/fs.js +2 -2
- package/{hosts-t7CKGTRz.js → hosts-HUfgMimI.js} +1 -2
- package/http-BE3UBktN.cjs +9 -0
- package/http-CDhG4bUc.d.ts +187 -0
- package/http-DIDjdm08.js +523 -0
- package/http.cjs +1 -9
- package/http.d.ts +2 -188
- package/http.js +1 -542
- package/index-CUWTpQKP.d.ts +87 -0
- package/{index-BQgZVQl7.d.ts → index-CcVwh9yz.d.ts} +0 -2
- package/{index-C5DdoMGo.d.ts → index-Cu5EcdK0.d.ts} +0 -59
- package/{index-57lTXnoe.d.ts → index-D6GPJ4Ow.d.ts} +29 -26
- package/index.cjs +1 -1
- package/index.d.ts +17 -25
- package/index.js +22 -27
- package/lib-Bs-g5jyp.cjs +53 -0
- package/{lib-BrsqpUkv.js → lib-CtJaID_y.js} +7 -31
- package/{messages-AdPfdoLV.d.ts → messages-B9dOXntM.d.ts} +0 -2
- package/messages.d.ts +1 -1
- package/messages.js +1 -2
- package/net-COkJw8lV.js +286 -0
- package/net-Dk2kqtgE.cjs +1 -0
- package/{net-BpyIeQ8r.d.ts → net-mVAYXs8e.d.ts} +5 -7
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +3 -323
- package/{node-fs-DY2fO5zd.js → node-fs-B4pY08Kc.js} +3 -10
- package/node-fs-DN0ejGTL.cjs +1 -0
- package/opfs/promises.cjs +1 -1
- package/opfs/promises.d.ts +2 -4
- package/opfs/promises.js +2 -3
- package/{opfs-D0goLAQW.js → opfs-CzCfVam3.js} +2 -3
- package/opfs-D3pYzYRc.js +35 -0
- package/opfs-DuXvTgIl.cjs +1 -0
- package/opfs.cjs +1 -1
- package/opfs.d.ts +3 -88
- package/opfs.js +1 -36
- package/package.json +1 -1
- package/packages-BEadIy_h.d.ts +155 -0
- package/packages-Cws_rcgf.js +346 -0
- package/packages-DT8vPB5_.cjs +1 -0
- package/packages.cjs +1 -1
- package/packages.d.ts +3 -156
- package/packages.js +1 -347
- package/{proxy-C4sYkxB5.js → proxy-BBAQxJmP.js} +5 -6
- package/{proxy-Dz60YyYy.d.ts → proxy-BP40IXYD.d.ts} +2 -4
- package/{proxy-jdE5tCwz.cjs → proxy-DVgGp6A8.cjs} +1 -1
- package/react.cjs +1 -1
- package/react.d.ts +16 -4
- package/react.js +96 -7
- package/{relay-choice-BGwXRC5d.js → relay-choice-Bb3oP2gw.js} +1 -2
- package/{relay-choice-5yUPI-tJ.d.ts → relay-choice-DOUttUnL.d.ts} +2 -4
- package/{rolldown-runtime-Dy4uBu1J.js → rolldown-runtime-CGnMp29N.js} +1 -2
- package/rooms-C6mbannC.d.ts +227 -0
- package/rooms-DHFS9cwA.cjs +1 -0
- package/rooms-DP5stTEr.js +300 -0
- package/rooms.cjs +1 -1
- package/rooms.d.ts +3 -228
- package/rooms.js +1 -301
- package/storage-BCjYihUO.cjs +1 -0
- package/storage-BhfImh_2.js +136 -0
- package/storage-DpCLksAa.d.ts +68 -0
- package/storage.cjs +1 -1
- package/storage.d.ts +3 -69
- package/storage.js +1 -137
- package/{utils-Cyq8uJiy.js → utils-DtWP-E9x.js} +1 -2
- package/{wire-Fk5pJaoy.d.ts → wire-DhmLnYEU.d.ts} +0 -2
- package/wire.d.ts +1 -1
- package/wire.js +1 -2
- package/cloud-DcgY8Xfp.cjs +0 -1
- package/connect-button-Cp0NS95-.d.ts +0 -4
- package/extension-I2Ziv2pk.cjs +0 -1
- package/fs-DeyJwJ3w.cjs +0 -1
- package/lib-C_X3WR4G.cjs +0 -53
- package/node-fs-vsWuoMGa.cjs +0 -1
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("./utils-BpHmMkIR.cjs"),t=require("./net-Dk2kqtgE.cjs");exports.Server=t.t,exports.Socket=t.n,exports._default=t.r,exports.default=t.r,exports.connect=t.i,exports.createConnection=t.a,exports.createServer=t.o,exports.isIP=e.t,exports.isIPv4=e.n,exports.isIPv6=e.r;
|
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-mVAYXs8e.js";
|
|
2
2
|
export { Server, Socket, _default, _default as default, connect, createConnection, createServer, isIP, isIPv4, isIPv6 };
|
package/net.js
CHANGED
|
@@ -1,323 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { t as r } from "./relay-choice-BGwXRC5d.js";
|
|
5
|
-
import { n as i, o as a, r as o, t as s } from "./utils-Cyq8uJiy.js";
|
|
6
|
-
import "./wire.js";
|
|
7
|
-
import { Stream as c } from "stream";
|
|
8
|
-
import { EventEmitter as l } from "events";
|
|
9
|
-
//#region src/webvpn/net.ts
|
|
10
|
-
var u = /* @__PURE__ */ e({
|
|
11
|
-
Server: () => f,
|
|
12
|
-
Socket: () => d,
|
|
13
|
-
_default: () => g,
|
|
14
|
-
connect: () => p,
|
|
15
|
-
createConnection: () => m,
|
|
16
|
-
createServer: () => h,
|
|
17
|
-
default: () => g,
|
|
18
|
-
isIP: () => s,
|
|
19
|
-
isIPv4: () => i,
|
|
20
|
-
isIPv6: () => o
|
|
21
|
-
}), d = class extends c.Duplex {
|
|
22
|
-
_localAddress;
|
|
23
|
-
_remoteAddress;
|
|
24
|
-
_webVPNTcpSocketPromise;
|
|
25
|
-
_relay;
|
|
26
|
-
constructor(e) {
|
|
27
|
-
if (e?.fd !== void 0) throw Error("FKN WebVPN does not support file descriptors");
|
|
28
|
-
super(e), e?.connection && this.__webvpn_tcp_socket_init__(e.connection);
|
|
29
|
-
}
|
|
30
|
-
_busyRelease;
|
|
31
|
-
__webvpn_tcp_socket_init__(e, t) {
|
|
32
|
-
return this._busyRelease ??= n("tcp socket"), t && (this._localAddress = {
|
|
33
|
-
address: t.localAddress,
|
|
34
|
-
family: t.localFamily,
|
|
35
|
-
port: t.localPort
|
|
36
|
-
}, this._remoteAddress = {
|
|
37
|
-
address: t.remoteAddress,
|
|
38
|
-
family: t.remoteFamily,
|
|
39
|
-
port: t.remotePort
|
|
40
|
-
}, this._relay = t.relay), this._webVPNTcpSocketPromise = e.then((e) => {
|
|
41
|
-
let t = e.dataReadableStream.getReader(), n = e.dataWritableStream.getWriter();
|
|
42
|
-
return this._localAddress = {
|
|
43
|
-
address: e.localAddress,
|
|
44
|
-
family: e.localFamily,
|
|
45
|
-
port: e.localPort
|
|
46
|
-
}, this._remoteAddress = {
|
|
47
|
-
address: e.remoteAddress,
|
|
48
|
-
family: e.remoteFamily,
|
|
49
|
-
port: e.remotePort
|
|
50
|
-
}, this._relay = e.relay, {
|
|
51
|
-
...e,
|
|
52
|
-
reader: t,
|
|
53
|
-
writer: n
|
|
54
|
-
};
|
|
55
|
-
}).catch((e) => {
|
|
56
|
-
this.emit("error", e);
|
|
57
|
-
}), this._webVPNTcpSocketPromise.then((e) => {
|
|
58
|
-
if (!e) {
|
|
59
|
-
this._busyRelease?.();
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
this.emit("connect");
|
|
63
|
-
}), this._webVPNTcpSocketPromise;
|
|
64
|
-
}
|
|
65
|
-
_read(e) {
|
|
66
|
-
if (!this._webVPNTcpSocketPromise) throw Error("Socket not connected");
|
|
67
|
-
this._webVPNTcpSocketPromise.then((e) => {
|
|
68
|
-
if (!e) {
|
|
69
|
-
this.push(null);
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
e.reader.read().then(({ value: e, done: t }) => {
|
|
73
|
-
if (t) {
|
|
74
|
-
this.push(null);
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
this._restartTimeoutTimer(), this.push(e);
|
|
78
|
-
}).catch((e) => {
|
|
79
|
-
this.destroy(e);
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
_write(e, t, n) {
|
|
84
|
-
if (!this._webVPNTcpSocketPromise) {
|
|
85
|
-
n(/* @__PURE__ */ Error("Socket not connected"));
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
this._webVPNTcpSocketPromise.then(async (t) => {
|
|
89
|
-
if (!t) throw Error("Socket not connected");
|
|
90
|
-
await t.writer.ready, await t.writer.write(e), this._restartTimeoutTimer(), n();
|
|
91
|
-
}).catch(n);
|
|
92
|
-
}
|
|
93
|
-
connect(...e) {
|
|
94
|
-
let n = a(...e), { relay: i } = n, o = this.__webvpn_tcp_socket_init__(t("an outbound tcp socket").then((e) => (i !== void 0 && r(e, "net.connect"), e.cloud.webvpn.tcpSocket({
|
|
95
|
-
remoteAddress: n.host ?? "localhost",
|
|
96
|
-
remotePort: n.port,
|
|
97
|
-
relay: i
|
|
98
|
-
}))));
|
|
99
|
-
return n.callback && o.then((e) => {
|
|
100
|
-
e && n.callback.call(this);
|
|
101
|
-
}), this;
|
|
102
|
-
}
|
|
103
|
-
_final(e) {
|
|
104
|
-
if (!this._webVPNTcpSocketPromise) {
|
|
105
|
-
e();
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
this._webVPNTcpSocketPromise.then(async (e) => {
|
|
109
|
-
e && await e.writer.close();
|
|
110
|
-
}).then(() => e(), (t) => e(t));
|
|
111
|
-
}
|
|
112
|
-
_destroy(e, t) {
|
|
113
|
-
if (this._timeoutTimer && clearTimeout(this._timeoutTimer), this._busyRelease?.(), !this._webVPNTcpSocketPromise) {
|
|
114
|
-
t(e);
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
this._webVPNTcpSocketPromise.then(async (e) => {
|
|
118
|
-
e && await (this._resetRequested ? e.resetAndDestroy() : e.destroy());
|
|
119
|
-
}).then(() => t(e), () => t(e));
|
|
120
|
-
}
|
|
121
|
-
destroySoon() {
|
|
122
|
-
if (this.writableFinished) {
|
|
123
|
-
this.destroy();
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
this.once("finish", () => this.destroy()), this.end();
|
|
127
|
-
}
|
|
128
|
-
_resetRequested = !1;
|
|
129
|
-
resetAndDestroy() {
|
|
130
|
-
return this._resetRequested = !0, this.destroy(), this;
|
|
131
|
-
}
|
|
132
|
-
_timeoutMs;
|
|
133
|
-
_timeoutTimer;
|
|
134
|
-
_restartTimeoutTimer() {
|
|
135
|
-
this._timeoutTimer && clearTimeout(this._timeoutTimer), this._timeoutMs && (this._timeoutTimer = setTimeout(() => this.emit("timeout"), this._timeoutMs));
|
|
136
|
-
}
|
|
137
|
-
setTimeout(e, t) {
|
|
138
|
-
return t && this.on("timeout", t), this._timeoutMs = e, this._restartTimeoutTimer(), this;
|
|
139
|
-
}
|
|
140
|
-
setNoDelay(e) {
|
|
141
|
-
let t = e ?? !0;
|
|
142
|
-
return this._setTcpOption({
|
|
143
|
-
type: 0,
|
|
144
|
-
value: t
|
|
145
|
-
}), this;
|
|
146
|
-
}
|
|
147
|
-
setKeepAlive(e, t) {
|
|
148
|
-
let n = e ?? !1, r = t !== void 0 && t > 0 ? Math.max(1, Math.round(t / 1e3)) : 0;
|
|
149
|
-
return this._setTcpOption({
|
|
150
|
-
type: 2,
|
|
151
|
-
enabled: n,
|
|
152
|
-
initialDelaySeconds: r
|
|
153
|
-
}), this;
|
|
154
|
-
}
|
|
155
|
-
setSendBufferSize(e) {
|
|
156
|
-
return this._setTcpOption({
|
|
157
|
-
type: 3,
|
|
158
|
-
value: e
|
|
159
|
-
}), this;
|
|
160
|
-
}
|
|
161
|
-
setRecvBufferSize(e) {
|
|
162
|
-
return this._setTcpOption({
|
|
163
|
-
type: 4,
|
|
164
|
-
value: e
|
|
165
|
-
}), this;
|
|
166
|
-
}
|
|
167
|
-
_typeOfService;
|
|
168
|
-
getTypeOfService() {
|
|
169
|
-
return this._typeOfService ?? 0;
|
|
170
|
-
}
|
|
171
|
-
setTypeOfService(e) {
|
|
172
|
-
return this._typeOfService = e, this;
|
|
173
|
-
}
|
|
174
|
-
_setTcpOption(e) {
|
|
175
|
-
if (!this._webVPNTcpSocketPromise) {
|
|
176
|
-
this.emit("error", /* @__PURE__ */ Error("Cannot set socket option before connect"));
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
this._webVPNTcpSocketPromise.then(async (t) => {
|
|
180
|
-
if (t) try {
|
|
181
|
-
await t.setOption(e);
|
|
182
|
-
} catch (e) {
|
|
183
|
-
this.emit("error", e);
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
write(e, t, ...n) {
|
|
188
|
-
return super.write(e, t, ...n);
|
|
189
|
-
}
|
|
190
|
-
address() {
|
|
191
|
-
return this._localAddress ?? {};
|
|
192
|
-
}
|
|
193
|
-
unref() {
|
|
194
|
-
return this;
|
|
195
|
-
}
|
|
196
|
-
ref() {
|
|
197
|
-
return this;
|
|
198
|
-
}
|
|
199
|
-
autoSelectFamilyAttemptedAddresses;
|
|
200
|
-
bufferSize;
|
|
201
|
-
bytesRead;
|
|
202
|
-
bytesWritten;
|
|
203
|
-
connecting;
|
|
204
|
-
pending;
|
|
205
|
-
get localAddress() {
|
|
206
|
-
if (!this._localAddress) throw Error("Socket is not connected");
|
|
207
|
-
return this._localAddress.address;
|
|
208
|
-
}
|
|
209
|
-
get localPort() {
|
|
210
|
-
if (!this._localAddress) throw Error("Socket is not connected");
|
|
211
|
-
return this._localAddress.port;
|
|
212
|
-
}
|
|
213
|
-
get localFamily() {
|
|
214
|
-
if (!this._localAddress) throw Error("Socket is not connected");
|
|
215
|
-
return this._localAddress.family;
|
|
216
|
-
}
|
|
217
|
-
readyState;
|
|
218
|
-
get remoteAddress() {
|
|
219
|
-
if (!this._remoteAddress) throw Error("Socket is not connected");
|
|
220
|
-
return this._remoteAddress.address;
|
|
221
|
-
}
|
|
222
|
-
get remotePort() {
|
|
223
|
-
if (!this._remoteAddress) throw Error("Socket is not connected");
|
|
224
|
-
return this._remoteAddress.port;
|
|
225
|
-
}
|
|
226
|
-
get remoteFamily() {
|
|
227
|
-
if (!this._remoteAddress) throw Error("Socket is not connected");
|
|
228
|
-
return this._remoteAddress.family;
|
|
229
|
-
}
|
|
230
|
-
timeout;
|
|
231
|
-
}, f = class extends l {
|
|
232
|
-
_localAddress;
|
|
233
|
-
_webVPNTcpSocketListenerPromise;
|
|
234
|
-
_relayChoice;
|
|
235
|
-
_relay;
|
|
236
|
-
constructor(e, t) {
|
|
237
|
-
super(e), this._relayChoice = e?.relay, t && this.on("connection", t), e?.connection && this.__webvpn_tcp_socket_listener_init__(e.connection);
|
|
238
|
-
}
|
|
239
|
-
_busyRelease;
|
|
240
|
-
__webvpn_tcp_socket_listener_init__(e) {
|
|
241
|
-
return this._busyRelease ??= n("tcp server"), this._webVPNTcpSocketListenerPromise = e.then((e) => (this._localAddress = {
|
|
242
|
-
address: e.localAddress,
|
|
243
|
-
family: e.localFamily,
|
|
244
|
-
port: e.localPort
|
|
245
|
-
}, this._relay = e.relay, e)).catch((e) => {
|
|
246
|
-
this.emit("error", e);
|
|
247
|
-
}), this._webVPNTcpSocketListenerPromise.then((e) => {
|
|
248
|
-
if (!e) {
|
|
249
|
-
this._busyRelease?.();
|
|
250
|
-
return;
|
|
251
|
-
}
|
|
252
|
-
this.emit("listening");
|
|
253
|
-
}), this._webVPNTcpSocketListenerPromise;
|
|
254
|
-
}
|
|
255
|
-
listen(...e) {
|
|
256
|
-
let n = a(...e);
|
|
257
|
-
this._closeEmitted = !1;
|
|
258
|
-
let i = (e) => {
|
|
259
|
-
let t = new d();
|
|
260
|
-
t.__webvpn_tcp_socket_init__(Promise.resolve(e), e), this.emit("connection", t);
|
|
261
|
-
}, o = (e) => {
|
|
262
|
-
this._localAddress = void 0;
|
|
263
|
-
try {
|
|
264
|
-
e && this.listenerCount("error") > 0 && this.emit("error", e);
|
|
265
|
-
} finally {
|
|
266
|
-
this._emitClose();
|
|
267
|
-
}
|
|
268
|
-
}, s = this._relayChoice, c = (e) => t("a tcp listener").then((t) => (s !== void 0 && r(t, "net.createServer"), t.cloud.webvpn.tcpSocketListener({
|
|
269
|
-
localAddress: e,
|
|
270
|
-
localPort: n.port,
|
|
271
|
-
onConnection: i,
|
|
272
|
-
onClose: o,
|
|
273
|
-
relay: s
|
|
274
|
-
}))), l = n.host ? c(n.host) : c("::").catch(() => c("0.0.0.0")), u = this.__webvpn_tcp_socket_listener_init__(l);
|
|
275
|
-
return n.callback && u.then((e) => {
|
|
276
|
-
e && n.callback.call(this);
|
|
277
|
-
}), this;
|
|
278
|
-
}
|
|
279
|
-
_closeEmitted = !1;
|
|
280
|
-
_emitClose() {
|
|
281
|
-
this._closeEmitted || (this._closeEmitted = !0, this._busyRelease?.(), this.emit("close"));
|
|
282
|
-
}
|
|
283
|
-
close(e) {
|
|
284
|
-
return this._webVPNTcpSocketListenerPromise && this._webVPNTcpSocketListenerPromise.then(async (t) => {
|
|
285
|
-
if (t) try {
|
|
286
|
-
await t.close(), this._localAddress = void 0, this._emitClose(), e && e();
|
|
287
|
-
} catch (t) {
|
|
288
|
-
this._localAddress = void 0, this._emitClose(), e && e(t);
|
|
289
|
-
}
|
|
290
|
-
}), this;
|
|
291
|
-
}
|
|
292
|
-
address() {
|
|
293
|
-
return this._localAddress ?? null;
|
|
294
|
-
}
|
|
295
|
-
getConnections(e) {
|
|
296
|
-
throw Error("Method not implemented.");
|
|
297
|
-
}
|
|
298
|
-
ref() {
|
|
299
|
-
return this;
|
|
300
|
-
}
|
|
301
|
-
unref() {
|
|
302
|
-
return this;
|
|
303
|
-
}
|
|
304
|
-
maxConnections;
|
|
305
|
-
connections;
|
|
306
|
-
listening;
|
|
307
|
-
async [Symbol.asyncDispose]() {}
|
|
308
|
-
}, p = (e, t) => new d().connect(e, t), m = p, h = (e, t) => {
|
|
309
|
-
typeof e == "function" && (t = e, e = void 0);
|
|
310
|
-
let n = new f(e);
|
|
311
|
-
return t && n.on("connection", t), n;
|
|
312
|
-
}, g = {
|
|
313
|
-
Socket: d,
|
|
314
|
-
Server: f,
|
|
315
|
-
connect: p,
|
|
316
|
-
createConnection: m,
|
|
317
|
-
createServer: h,
|
|
318
|
-
isIP: s,
|
|
319
|
-
isIPv4: i,
|
|
320
|
-
isIPv6: o
|
|
321
|
-
};
|
|
322
|
-
//#endregion
|
|
323
|
-
export { f as Server, d as Socket, g as _default, g as default, p as connect, m as createConnection, h as createServer, s as isIP, i as isIPv4, o as isIPv6, u as t };
|
|
1
|
+
import { n as e, r as t, t as n } from "./utils-DtWP-E9x.js";
|
|
2
|
+
import { a as r, i, n as a, o, r as s, t as c } from "./net-COkJw8lV.js";
|
|
3
|
+
export { c as Server, a as Socket, s as _default, s as default, i as connect, r as createConnection, o as createServer, n as isIP, e as isIPv4, t as isIPv6 };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as e } from "./busy-
|
|
1
|
+
import { i as e } from "./busy-C1JPjoZ_.js";
|
|
2
2
|
import { Buffer as t } from "buffer";
|
|
3
|
-
|
|
3
|
+
// src/fs/content-type.ts
|
|
4
4
|
var n = {
|
|
5
5
|
json: "application/json",
|
|
6
6
|
txt: "text/plain",
|
|
@@ -56,13 +56,7 @@ var n = {
|
|
|
56
56
|
return r.code = e, r.path = t, r.syscall = n, r;
|
|
57
57
|
}, s = (e) => {
|
|
58
58
|
let t = [];
|
|
59
|
-
for (let n of e.split("/"))
|
|
60
|
-
if (n === "..") {
|
|
61
|
-
t.pop();
|
|
62
|
-
continue;
|
|
63
|
-
}
|
|
64
|
-
t.push(n);
|
|
65
|
-
}
|
|
59
|
+
for (let n of e.split("/")) n && n !== "." && (n === ".." ? t.pop() : t.push(n));
|
|
66
60
|
return t.join("/");
|
|
67
61
|
}, c = (e) => e.split("/").slice(0, -1).join("/"), l = (e) => typeof e == "string" ? e : e instanceof URL ? decodeURIComponent(e.pathname) : e.toString(), u = (e) => typeof e == "string" ? e : e?.encoding ?? void 0, d = (e) => typeof e == "object" ? e?.contentType : void 0, f = (e) => typeof e == "object" && !!e?.recursive, p = (e, n) => {
|
|
68
62
|
let r = u(n);
|
|
@@ -403,5 +397,4 @@ var n = {
|
|
|
403
397
|
function x(e, t) {
|
|
404
398
|
return t.memfs ? y(e) : b(e);
|
|
405
399
|
}
|
|
406
|
-
//#endregion
|
|
407
400
|
export { x as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./busy-BXbVH595.cjs");let t=require("buffer");var n={json:`application/json`,txt:`text/plain`,html:`text/html`,htm:`text/html`,css:`text/css`,js:`text/javascript`,mjs:`text/javascript`,xml:`application/xml`,csv:`text/csv`,md:`text/markdown`,svg:`image/svg+xml`,png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,pdf:`application/pdf`,wasm:`application/wasm`},r=(e,t)=>{if(t)return t;let r=e.split(`/`).pop()??``,i=r.lastIndexOf(`.`);if(!(i<=0))return n[r.slice(i+1).toLowerCase()]},i=(e,t)=>({size:e,mtimeMs:t,mtime:new Date(t),atimeMs:t,ctimeMs:t,mode:420,isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1}),a=(e=0)=>({size:0,mtimeMs:e,mtime:new Date(e),atimeMs:e,ctimeMs:e,mode:493,isFile:()=>!1,isDirectory:()=>!0,isSymbolicLink:()=>!1}),o=(e,t,n)=>{let r=Error(`${e}: ${{ENOENT:`no such file or directory`,EEXIST:`file already exists`,ENOTDIR:`not a directory`,EISDIR:`illegal operation on a directory`,ENOTEMPTY:`directory not empty`,ERR_FS_EISDIR:`is a directory`}[e]??e}, ${n} '${t}'`);return r.code=e,r.path=t,r.syscall=n,r},s=e=>{let t=[];for(let n of e.split(`/`))n&&n!==`.`&&(n===`..`?t.pop():t.push(n));return t.join(`/`)},c=e=>e.split(`/`).slice(0,-1).join(`/`),l=e=>typeof e==`string`?e:e instanceof URL?decodeURIComponent(e.pathname):e.toString(),u=e=>typeof e==`string`?e:e?.encoding??void 0,d=e=>typeof e==`object`?e?.contentType:void 0,f=e=>typeof e==`object`&&!!e?.recursive,p=(e,n)=>{let r=u(n);return r?t.Buffer.from(e).toString(r):t.Buffer.from(e)},m=(e,n)=>{if(typeof e==`string`)return new Uint8Array(t.Buffer.from(e,u(n)??`utf8`));if(e instanceof Uint8Array)return e.slice();if(e instanceof ArrayBuffer)return new Uint8Array(e).slice();if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength).slice();throw TypeError(`The "data" argument must be of type string, Buffer, TypedArray, or DataView`)},h=t=>{let n=new Map([[``,{kind:`dir`,mtimeMs:0}]]),l=new Map,u=new Map,d=()=>t.captureAccount?{pin:t.captureAccount()}:{};e.i(`unsaved files`,()=>l.size>0||u.size>0);let f=new Set,p=()=>Date.now(),m=e=>{if(!e)return;let t=e.split(`/`),r=``;for(let e of t){r=r?`${r}/${e}`:e;let t=n.get(r);if(!t)n.set(r,{kind:`dir`,mtimeMs:p()});else if(t.kind===`file`)throw o(`ENOTDIR`,r,`mkdir`)}},h,g=0,_=async()=>{let e=d(),r=await t.list(e).catch(()=>[]),i=new Set,a=!1;for(let o of r){let r=s(o.path);if(i.add(r),!u.has(r)&&(!l.has(r)||f.has(r)))try{let i=await(await t.readFile(o.path,e)).arrayBuffer();if(u.has(r)||l.has(r)&&!f.has(r))continue;m(c(r));let a=Date.parse(o.updatedAt??``);n.set(r,{kind:`file`,data:new Uint8Array(i),mtimeMs:Number.isFinite(a)?a:p(),contentType:o.contentType??void 0}),f.delete(r),l.delete(r)}catch{a=!0,f.add(r)}}for(let e of f)i.has(e)||f.delete(e);g=a?Date.now():0},v=()=>(h&&(g===0||Date.now()-g<5e3)||(h=_()),h),y=async()=>{h=void 0,g=0,await v()},b=async()=>{let e=[...l].map(async([e,i])=>{if(f.has(e))return;let a=n.get(e);if(a?.kind!==`file`){l.delete(e);return}let o=a.data,s=r(e,a.contentType);try{await t.writeFile(e,o,s?{contentType:s,...i}:i);let r=n.get(e);r?.kind===`file`&&r.data===o&&l.delete(e)}catch{}}),i=[...u].map(async([e,n])=>{try{await t.remove(e,n),u.get(e)===n&&u.delete(e)}catch{}});await Promise.all([...e,...i])},x,S=()=>{x||=setTimeout(()=>{x=void 0,b().catch(()=>{})},250)};typeof addEventListener<`u`&&(addEventListener(`pagehide`,()=>{b().catch(()=>{})}),addEventListener(`visibilitychange`,()=>{typeof document<`u`&&document.visibilityState===`hidden`&&b().catch(()=>{})}));let C=e=>e.kind===`file`?i(e.data.byteLength,e.mtimeMs):a(e.mtimeMs),w=e=>Object.assign(Error(`storage: ${e} exists but could not be read, retry once its scope is available`),{code:`FKN_E2E_LOCKED`}),T=e=>{let t=s(e);return n.has(t)||f.has(t)},E=e=>{let t=s(e),r=n.get(t);if(!r)throw f.has(t)?w(e):o(`ENOENT`,e,`stat`);return C(r)},D=e=>{let t=s(e),r=n.get(t);if(!r)throw f.has(t)?w(e):o(`ENOENT`,e,`open`);if(r.kind===`dir`)throw o(`EISDIR`,e,`read`);return r.data},O=(e,t)=>{let n=new Uint8Array(e.byteLength+t.byteLength);return n.set(e,0),n.set(t,e.byteLength),n},k=(e,t,r,i)=>{let a=s(e);if(!a)throw o(`EISDIR`,e,`open`);if(f.has(a))throw w(e);let h=n.get(a);if(h?.kind===`dir`)throw o(`EISDIR`,e,`open`);m(c(a));let g=r&&h?.kind===`file`?O(h.data,t):t;n.set(a,{kind:`file`,data:g,mtimeMs:p(),contentType:i??(h?.kind===`file`?h.contentType:void 0)}),l.set(a,d()),u.delete(a),S()},A=(e,t)=>{let r=s(e);if(r){if(n.has(r)){if(t)return;throw o(`EEXIST`,e,`mkdir`)}if(!t&&!n.has(c(r)))throw o(`ENOENT`,e,`mkdir`);m(r)}},j=e=>{let t=s(e),r=n.get(t);if(!r)throw o(`ENOENT`,e,`scandir`);if(r.kind===`file`)throw o(`ENOTDIR`,e,`scandir`);let i=t?`${t}/`:``,a=new Set;for(let e of[...n.keys(),...f]){if(!e||!e.startsWith(i))continue;let t=e.slice(i.length);t&&a.add(t.split(`/`)[0])}return[...a]},M=(e,{op:t,recursive:r,force:i})=>{let a=d(),c=s(e),p=n.get(c);if(!p&&f.has(c)){if(t===`rmdir`)throw o(`ENOTDIR`,e,`rmdir`);f.delete(c),l.delete(c),u.set(c,a),S();return}if(!p){if(i||t===`rmdir`&&r)return;throw o(`ENOENT`,e,t===`rmdir`?`rmdir`:`unlink`)}if(t===`unlink`&&p.kind===`dir`)throw o(`EISDIR`,e,`unlink`);if(t===`rmdir`&&p.kind===`file`)throw o(`ENOTDIR`,e,`rmdir`);if(t===`rm`&&p.kind===`dir`&&!r)throw o(`ERR_FS_EISDIR`,e,`rm`);let m=`${c}/`,h=[...n.keys()].filter(e=>e.startsWith(m));if(h.length&&!r)throw o(`ENOTEMPTY`,e,`rmdir`);for(let e of[c,...h]){let t=n.get(e);n.delete(e),t?.kind===`file`&&(l.delete(e),u.set(e,a))}S()};return{mount:v,remount:y,flush:b,exists:T,stat:E,readFile:D,writeFile:k,mkdir:A,readdir:j,remove:M,rename:(e,t)=>{let r=d(),i=s(e),a=s(t);if(!i)throw o(`EBUSY`,e,`rename`);if(a===i||a.startsWith(`${i}/`))throw o(`EINVAL`,e,`rename`);if(f.has(i))throw w(e);if(f.has(a))throw w(t);let p=n.get(i);if(!p)throw o(`ENOENT`,e,`rename`);let h=n.get(a);if(h){if(h.kind!==p.kind)throw o(p.kind===`dir`?`ENOTDIR`:`EISDIR`,t,`rename`);M(a,{op:`rm`,recursive:!0,force:!0})}m(c(a));let g=`${i}/`,_=[i,...[...n.keys()].filter(e=>e.startsWith(g))];for(let e of _){let t=a+e.slice(i.length),o=n.get(e);n.set(t,o),n.delete(e),o.kind===`file`&&(l.set(t,r),u.delete(t),l.delete(e),u.set(e,r))}S()}}},g=(e,t)=>typeof e==`function`?e:t,_=e=>typeof e==`function`?void 0:e,v=(e,t)=>{e.then(e=>t(null,e),e=>t(e))},y=e=>{let t=h(e),n=(e,n)=>p(t.readFile(l(e)),n),r=(e,n,r)=>t.writeFile(l(e),m(n,r),!1,d(r)),i=(e,n,r)=>t.writeFile(l(e),m(n,r),!0,d(r)),a=e=>t.exists(l(e)),s=e=>t.stat(l(e)),c=e=>t.readdir(l(e)),u=(e,n)=>t.mkdir(l(e),f(n)),v=(e,n)=>t.remove(l(e),{op:`rm`,...n}),y=(e,n)=>t.remove(l(e),{op:`rmdir`,...n}),b=e=>t.remove(l(e),{op:`unlink`}),x=(e,n)=>t.rename(l(e),l(n)),S=(e,n)=>{t.mount().finally(()=>{let t;try{t=e()}catch(e){n(e);return}n(null,t)})},C=e=>t.mount().then(()=>e());return{available:e.available,readFileSync:n,writeFileSync:r,appendFileSync:i,existsSync:a,statSync:s,lstatSync:s,readdirSync:c,mkdirSync:u,rmSync:v,rmdirSync:y,unlinkSync:b,renameSync:x,readFile:(e,n,r)=>S(()=>p(t.readFile(l(e)),_(n)),g(n,r)),writeFile:(e,n,r,i)=>S(()=>t.writeFile(l(e),m(n,_(r)),!1,d(_(r))),g(r,i)),appendFile:(e,n,r,i)=>S(()=>t.writeFile(l(e),m(n,_(r)),!0,d(_(r))),g(r,i)),stat:(e,n)=>S(()=>t.stat(l(e)),n),readdir:(e,n,r)=>S(()=>t.readdir(l(e)),g(n,r)),mkdir:(e,n,r)=>S(()=>t.mkdir(l(e),f(_(n))),g(n,r)),rm:(e,n,r)=>S(()=>t.remove(l(e),{op:`rm`,..._(n)}),g(n,r)),unlink:(e,n)=>S(()=>t.remove(l(e),{op:`unlink`}),n),rename:(e,n,r)=>S(()=>t.rename(l(e),l(n)),r),exists:(e,n)=>{t.mount().finally(()=>n(t.exists(l(e))))},promises:{readFile:(e,n)=>C(()=>p(t.readFile(l(e)),n)),writeFile:(e,n,r)=>C(()=>t.writeFile(l(e),m(n,r),!1,d(r))),appendFile:(e,n,r)=>C(()=>t.writeFile(l(e),m(n,r),!0,d(r))),stat:e=>C(()=>t.stat(l(e))),lstat:e=>C(()=>t.stat(l(e))),readdir:e=>C(()=>t.readdir(l(e))),mkdir:(e,n)=>C(()=>t.mkdir(l(e),f(n))),rm:(e,n)=>C(()=>t.remove(l(e),{op:`rm`,...n})),rmdir:(e,n)=>C(()=>t.remove(l(e),{op:`rmdir`,...n})),unlink:e=>C(()=>t.remove(l(e),{op:`unlink`})),rename:(e,n)=>C(()=>t.rename(l(e),l(n))),access:e=>C(()=>{if(!t.exists(l(e)))throw o(`ENOENT`,l(e),`access`)})},mount:t.mount,flush:t.flush,remount:t.remount}},b=e=>{let t=()=>e.captureAccount?{pin:e.captureAccount()}:{},n=async(t,n)=>{let r=await e.readFile(l(t));return p(new Uint8Array(await r.arrayBuffer()),n)},c=async(t,n,i)=>{let a=l(t),o=r(a,d(i));await e.writeFile(a,m(n,i),o?{contentType:o}:void 0)},u=t=>e.remove(l(t)),f=async(n,r)=>{let i=t(),a=s(l(n)),o=s(l(r));if(a===o)return;let c=await e.readFile(a,i);await e.writeFile(o,c,i),await e.remove(a,i)},h=async t=>{let n=s(l(t)),r=n?`${n}/`:``,i=new Set;for(let t of await e.list()){let e=s(t.path);if(r&&!e.startsWith(r))continue;let n=e.slice(r.length);n&&i.add(n.split(`/`)[0])}return[...i]},y=async(e,t)=>{},b=async(n,r)=>{let i=t(),a=s(l(n));if(!r?.recursive){await e.remove(l(n),i);return}let o=`${a}/`,c=await e.list(i);await Promise.all(c.filter(e=>{let t=s(e.path);return t===a||t.startsWith(o)}).map(t=>e.remove(t.path,i).catch(()=>{})))},x=async t=>{let n=s(l(t)),r=await e.list(),c=r.find(e=>s(e.path)===n);if(c){let e=Date.parse(c.updatedAt??``);return i(c.size,Number.isFinite(e)?e:0)}if(r.some(e=>s(e.path).startsWith(`${n}/`)))return a();throw o(`ENOENT`,l(t),`stat`)},S={readFile:n,writeFile:c,unlink:u,rename:f,readdir:h,mkdir:y,rm:b,rmdir:b,stat:x,lstat:x,access:async e=>{await x(e)}};return{available:e.available,promises:S,readFile:(e,t,r)=>v(n(e,_(t)),g(t,r)),writeFile:(e,t,n,r)=>v(c(e,t,_(n)),g(n,r)),unlink:(e,t)=>v(u(e),t),rename:(e,t,n)=>v(f(e,t),n),readdir:(e,t,n)=>v(h(e),g(t,n)),mkdir:(e,t,n)=>v(y(),g(t,n)),rm:(e,t,n)=>v(b(e,_(t)),g(t,n)),stat:(e,t)=>v(x(e),t)}};function x(e,t){return t.memfs?y(e):b(e)}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return x}});
|
package/opfs/promises.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../opfs.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.
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../opfs-DuXvTgIl.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.p,p=e.p;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/opfs/promises.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { a as WriteData, i as Stats, n as MakeOptions, o as WriteOptions, r as ReadOptions } from "../index-
|
|
2
|
-
import { promises } from "../
|
|
3
|
-
//#region src/opfs/promises.d.ts
|
|
1
|
+
import { a as WriteData, i as Stats, n as MakeOptions, o as WriteOptions, r as ReadOptions } from "../index-CcVwh9yz.js";
|
|
2
|
+
import { p as promises } from "../index-CUWTpQKP.js";
|
|
4
3
|
export declare const readFile: (path: import("node:fs").PathLike, options?: ReadOptions) => Promise<Buffer | string>, writeFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>, appendFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>, unlink: (path: import("node:fs").PathLike) => Promise<void>, rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>, readdir: (path: import("node:fs").PathLike) => Promise<string[]>, mkdir: (path: import("node:fs").PathLike, options?: MakeOptions) => Promise<void>, rm: (path: import("node:fs").PathLike, options?: {
|
|
5
4
|
recursive?: boolean;
|
|
6
5
|
force?: boolean;
|
|
7
6
|
}) => Promise<void>, rmdir: (path: import("node:fs").PathLike, options?: {
|
|
8
7
|
recursive?: boolean;
|
|
9
8
|
}) => 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>;
|
|
10
|
-
//#endregion
|
|
11
9
|
export { promises as default };
|
package/opfs/promises.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { p as e } from "../opfs-D3pYzYRc.js";
|
|
2
|
+
// 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
|
-
//#endregion
|
|
5
4
|
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 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "./rolldown-runtime-
|
|
2
|
-
|
|
1
|
+
import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
2
|
+
// src/fs/opfs.ts
|
|
3
3
|
var t = /* @__PURE__ */ e({
|
|
4
4
|
available: () => a,
|
|
5
5
|
list: () => l,
|
|
@@ -51,5 +51,4 @@ var t = /* @__PURE__ */ e({
|
|
|
51
51
|
};
|
|
52
52
|
return await t(await n(), ""), e;
|
|
53
53
|
};
|
|
54
|
-
//#endregion
|
|
55
54
|
export { c as a, s as i, l as n, o, t as r, a as t };
|
package/opfs-D3pYzYRc.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
2
|
+
import { t } from "./node-fs-B4pY08Kc.js";
|
|
3
|
+
import { r as n } from "./opfs-CzCfVam3.js";
|
|
4
|
+
// src/opfs/index.ts
|
|
5
|
+
var r = /* @__PURE__ */ e({
|
|
6
|
+
appendFile: () => b,
|
|
7
|
+
appendFileSync: () => c,
|
|
8
|
+
available: () => a,
|
|
9
|
+
default: () => i,
|
|
10
|
+
exists: () => D,
|
|
11
|
+
existsSync: () => l,
|
|
12
|
+
flush: () => A,
|
|
13
|
+
lstatSync: () => d,
|
|
14
|
+
mkdir: () => C,
|
|
15
|
+
mkdirSync: () => p,
|
|
16
|
+
mount: () => k,
|
|
17
|
+
promises: () => O,
|
|
18
|
+
readFile: () => v,
|
|
19
|
+
readFileSync: () => o,
|
|
20
|
+
readdir: () => S,
|
|
21
|
+
readdirSync: () => f,
|
|
22
|
+
remount: () => j,
|
|
23
|
+
rename: () => E,
|
|
24
|
+
renameSync: () => _,
|
|
25
|
+
rm: () => w,
|
|
26
|
+
rmSync: () => m,
|
|
27
|
+
rmdirSync: () => h,
|
|
28
|
+
stat: () => x,
|
|
29
|
+
statSync: () => u,
|
|
30
|
+
unlink: () => T,
|
|
31
|
+
unlinkSync: () => g,
|
|
32
|
+
writeFile: () => y,
|
|
33
|
+
writeFileSync: () => s
|
|
34
|
+
}), i = t(n, { memfs: !0 }), { available: a, readFileSync: o, writeFileSync: s, appendFileSync: c, existsSync: l, statSync: u, lstatSync: d, readdirSync: f, mkdirSync: p, rmSync: m, rmdirSync: h, unlinkSync: g, renameSync: _, readFile: v, writeFile: y, appendFile: b, stat: x, readdir: S, mkdir: C, rm: w, unlink: T, rename: E, exists: D, promises: O, mount: k, flush: A, remount: j } = i;
|
|
35
|
+
export { h as C, g as D, T as E, y as O, m as S, u as T, f as _, l as a, _ as b, d as c, k as d, r as f, S as g, o as h, D as i, s as k, C as l, v as m, c as n, A as o, O as p, a as r, i as s, b as t, p as u, j as v, x as w, w as x, E as y };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./node-fs-DN0ejGTL.cjs"),n=require("./opfs-CXMESVLc.cjs");var r=e.t({appendFile:()=>b,appendFileSync:()=>c,available:()=>a,default:()=>i,exists:()=>D,existsSync:()=>l,flush:()=>A,lstatSync:()=>d,mkdir:()=>C,mkdirSync:()=>p,mount:()=>k,promises:()=>O,readFile:()=>v,readFileSync:()=>o,readdir:()=>S,readdirSync:()=>f,remount:()=>j,rename:()=>E,renameSync:()=>_,rm:()=>w,rmSync:()=>m,rmdirSync:()=>h,stat:()=>x,statSync:()=>u,unlink:()=>T,unlinkSync:()=>g,writeFile:()=>y,writeFileSync:()=>s}),i=t.t(n.r,{memfs:!0}),{available:a,readFileSync:o,writeFileSync:s,appendFileSync:c,existsSync:l,statSync:u,lstatSync:d,readdirSync:f,mkdirSync:p,rmSync:m,rmdirSync:h,unlinkSync:g,renameSync:_,readFile:v,writeFile:y,appendFile:b,stat:x,readdir:S,mkdir:C,rm:w,unlink:T,rename:E,exists:D,promises:O,mount:k,flush:A,remount:j}=i;Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return E}});
|
package/opfs.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("./opfs-DuXvTgIl.cjs");exports.appendFile=e.t,exports.appendFileSync=e.n,exports.available=e.r,exports.default=e.s,exports.exists=e.i,exports.existsSync=e.a,exports.flush=e.o,exports.lstatSync=e.c,exports.mkdir=e.l,exports.mkdirSync=e.u,exports.mount=e.d,exports.promises=e.p,exports.readFile=e.m,exports.readFileSync=e.h,exports.readdir=e.g,exports.readdirSync=e._,exports.remount=e.v,exports.rename=e.y,exports.renameSync=e.b,exports.rm=e.x,exports.rmSync=e.S,exports.rmdirSync=e.C,exports.stat=e.w,exports.statSync=e.T,exports.unlink=e.E,exports.unlinkSync=e.D,exports.writeFile=e.O,exports.writeFileSync=e.k;
|
package/opfs.d.ts
CHANGED
|
@@ -1,88 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
declare const fs: {
|
|
6
|
-
available: () => Promise<boolean>;
|
|
7
|
-
readFileSync: (path: import("node:fs").PathLike, options?: ReadOptions) => Buffer | string;
|
|
8
|
-
writeFileSync: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => void;
|
|
9
|
-
appendFileSync: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => void;
|
|
10
|
-
existsSync: (path: import("node:fs").PathLike) => boolean;
|
|
11
|
-
statSync: (path: import("node:fs").PathLike) => Stats;
|
|
12
|
-
lstatSync: (path: import("node:fs").PathLike) => Stats;
|
|
13
|
-
readdirSync: (path: import("node:fs").PathLike) => string[];
|
|
14
|
-
mkdirSync: (path: import("node:fs").PathLike, options?: MakeOptions) => void;
|
|
15
|
-
rmSync: (path: import("node:fs").PathLike, options?: {
|
|
16
|
-
recursive?: boolean;
|
|
17
|
-
force?: boolean;
|
|
18
|
-
}) => void;
|
|
19
|
-
rmdirSync: (path: import("node:fs").PathLike, options?: {
|
|
20
|
-
recursive?: boolean;
|
|
21
|
-
}) => void;
|
|
22
|
-
unlinkSync: (path: import("node:fs").PathLike) => void;
|
|
23
|
-
renameSync: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => void;
|
|
24
|
-
readFile: (path: import("node:fs").PathLike, a: ReadOptions | Callback<Buffer | string>, b?: Callback<Buffer | string>) => void;
|
|
25
|
-
writeFile: (path: import("node:fs").PathLike, data: WriteData, a: WriteOptions | Callback<void>, b?: Callback<void>) => void;
|
|
26
|
-
appendFile: (path: import("node:fs").PathLike, data: WriteData, a: WriteOptions | Callback<void>, b?: Callback<void>) => void;
|
|
27
|
-
stat: (path: import("node:fs").PathLike, callback: Callback<Stats>) => void;
|
|
28
|
-
readdir: (path: import("node:fs").PathLike, a: unknown, b?: Callback<string[]>) => void;
|
|
29
|
-
mkdir: (path: import("node:fs").PathLike, a: MakeOptions | Callback<void>, b?: Callback<void>) => void;
|
|
30
|
-
rm: (path: import("node:fs").PathLike, a: {
|
|
31
|
-
recursive?: boolean;
|
|
32
|
-
force?: boolean;
|
|
33
|
-
} | Callback<void>, b?: Callback<void>) => void;
|
|
34
|
-
unlink: (path: import("node:fs").PathLike, callback: Callback<void>) => void;
|
|
35
|
-
rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike, callback: Callback<void>) => void;
|
|
36
|
-
exists: (path: import("node:fs").PathLike, callback: (exists: boolean) => void) => void;
|
|
37
|
-
promises: {
|
|
38
|
-
readFile: (path: import("node:fs").PathLike, options?: ReadOptions) => Promise<Buffer | string>;
|
|
39
|
-
writeFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
|
|
40
|
-
appendFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
|
|
41
|
-
stat: (path: import("node:fs").PathLike) => Promise<Stats>;
|
|
42
|
-
lstat: (path: import("node:fs").PathLike) => Promise<Stats>;
|
|
43
|
-
readdir: (path: import("node:fs").PathLike) => Promise<string[]>;
|
|
44
|
-
mkdir: (path: import("node:fs").PathLike, options?: MakeOptions) => Promise<void>;
|
|
45
|
-
rm: (path: import("node:fs").PathLike, options?: {
|
|
46
|
-
recursive?: boolean;
|
|
47
|
-
force?: boolean;
|
|
48
|
-
}) => Promise<void>;
|
|
49
|
-
rmdir: (path: import("node:fs").PathLike, options?: {
|
|
50
|
-
recursive?: boolean;
|
|
51
|
-
}) => Promise<void>;
|
|
52
|
-
unlink: (path: import("node:fs").PathLike) => Promise<void>;
|
|
53
|
-
rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>;
|
|
54
|
-
access: (path: import("node:fs").PathLike) => Promise<void>;
|
|
55
|
-
};
|
|
56
|
-
mount: () => Promise<void>;
|
|
57
|
-
flush: () => Promise<void>;
|
|
58
|
-
remount: () => Promise<void>;
|
|
59
|
-
};
|
|
60
|
-
export 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?: {
|
|
77
|
-
recursive?: boolean;
|
|
78
|
-
force?: boolean;
|
|
79
|
-
}) => Promise<void>;
|
|
80
|
-
rmdir: (path: import("node:fs").PathLike, options?: {
|
|
81
|
-
recursive?: boolean;
|
|
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>;
|
|
87
|
-
//#endregion
|
|
88
|
-
export { type Stats, fs as default, index_d_exports as t };
|
|
1
|
+
import { i as Stats } from "./index-CcVwh9yz.js";
|
|
2
|
+
import { C as rmdirSync, D as unlinkSync, E as unlink, O as writeFile, S as rmSync, T as statSync, _ as readdirSync, a as existsSync, b as renameSync, d as mkdirSync, f as mount, g as readdir, h as readFileSync, i as exists, k as writeFileSync, l as lstatSync, m as readFile, n as appendFileSync, o as flush, p as promises, r as available, s as fs, t as appendFile, u as mkdir, v as remount, w as stat, x as rm, y as rename } from "./index-CUWTpQKP.js";
|
|
3
|
+
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, unlink, unlinkSync, writeFile, writeFileSync };
|
package/opfs.js
CHANGED
|
@@ -1,36 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { t } from "./node-fs-DY2fO5zd.js";
|
|
3
|
-
import { r as n } from "./opfs-D0goLAQW.js";
|
|
4
|
-
//#region src/opfs/index.ts
|
|
5
|
-
var r = /* @__PURE__ */ e({
|
|
6
|
-
appendFile: () => b,
|
|
7
|
-
appendFileSync: () => c,
|
|
8
|
-
available: () => a,
|
|
9
|
-
default: () => i,
|
|
10
|
-
exists: () => D,
|
|
11
|
-
existsSync: () => l,
|
|
12
|
-
flush: () => A,
|
|
13
|
-
lstatSync: () => d,
|
|
14
|
-
mkdir: () => C,
|
|
15
|
-
mkdirSync: () => p,
|
|
16
|
-
mount: () => k,
|
|
17
|
-
promises: () => O,
|
|
18
|
-
readFile: () => v,
|
|
19
|
-
readFileSync: () => o,
|
|
20
|
-
readdir: () => S,
|
|
21
|
-
readdirSync: () => f,
|
|
22
|
-
remount: () => j,
|
|
23
|
-
rename: () => E,
|
|
24
|
-
renameSync: () => _,
|
|
25
|
-
rm: () => w,
|
|
26
|
-
rmSync: () => m,
|
|
27
|
-
rmdirSync: () => h,
|
|
28
|
-
stat: () => x,
|
|
29
|
-
statSync: () => u,
|
|
30
|
-
unlink: () => T,
|
|
31
|
-
unlinkSync: () => g,
|
|
32
|
-
writeFile: () => y,
|
|
33
|
-
writeFileSync: () => s
|
|
34
|
-
}), i = t(n, { memfs: !0 }), { available: a, readFileSync: o, writeFileSync: s, appendFileSync: c, existsSync: l, statSync: u, lstatSync: d, readdirSync: f, mkdirSync: p, rmSync: m, rmdirSync: h, unlinkSync: g, renameSync: _, readFile: v, writeFile: y, appendFile: b, stat: x, readdir: S, mkdir: C, rm: w, unlink: T, rename: E, exists: D, promises: O, mount: k, flush: A, remount: j } = i;
|
|
35
|
-
//#endregion
|
|
36
|
-
export { b as appendFile, c as appendFileSync, a as available, i as default, D as exists, l as existsSync, A as flush, d as lstatSync, C as mkdir, p as mkdirSync, k as mount, O as promises, v as readFile, o as readFileSync, S as readdir, f as readdirSync, j as remount, E as rename, _ as renameSync, w as rm, m as rmSync, h as rmdirSync, x as stat, u as statSync, r as t, T as unlink, g as unlinkSync, y as writeFile, s as writeFileSync };
|
|
1
|
+
export { t as appendFile, n as appendFileSync, r as available, s as default, i as exists, a as existsSync, o as flush, c as lstatSync, l as mkdir, u as mkdirSync, d as mount, p as promises, m as readFile, h as readFileSync, g as readdir, _ as readdirSync, v as remount, y as rename, b as renameSync, x as rm, S as rmSync, C as rmdirSync, w as stat, T as statSync, E as unlink, D as unlinkSync, O as writeFile, k as writeFileSync } from "./opfs-D3pYzYRc.js";
|