@fkn/lib 0.5.5 → 0.6.1
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 +9 -11
- package/account.js +2 -2
- package/api-BYUraih6.d.ts +524 -0
- package/{api-CDb2pv7C.cjs → api-DD5v1qP9.cjs} +1 -1
- package/{background-DvQm1JHR.js → background-BVBbBOmL.js} +41 -68
- package/background-B_VgpARk.cjs +1 -0
- package/cloud/dgram.cjs +1 -1
- package/cloud/dgram.d.ts +2 -541
- package/cloud/dgram.js +1 -3
- package/cloud/dns.cjs +1 -1
- package/cloud/dns.d.ts +3 -12
- package/cloud/dns.js +0 -1
- package/cloud/fs/promises.cjs +1 -1
- package/cloud/fs/promises.d.ts +7 -43
- package/cloud/fs/promises.js +0 -3
- package/cloud/fs.cjs +1 -1
- package/cloud/fs.d.ts +3 -75
- package/cloud/fs.js +3 -4
- package/cloud/http.cjs +1 -1
- package/cloud/http.d.ts +2 -767
- package/cloud/http.js +0 -3
- package/cloud/net.cjs +1 -1
- package/cloud/net.d.ts +2 -606
- package/cloud/net.js +2 -3
- package/cloud-5o7yJHeX.cjs +1 -0
- package/cloud-BFyf2uC7.js +112 -0
- package/cloud-gklfa4ZN.d.ts +41 -0
- package/cloud.cjs +1 -1
- package/cloud.d.ts +7 -1053
- package/cloud.js +8 -12
- package/{connect-button-poDZVmq2.cjs → connect-button-BBEjXzB3.cjs} +1 -1
- package/connect-button-D8KXSL6s.d.ts +4 -0
- package/desktop.cjs +1 -1
- package/desktop.d.ts +37 -34
- package/desktop.js +1 -1
- package/dgram-CE43gJq9.cjs +1 -0
- package/{dgram-c_Xk7ckJ.js → dgram-wtjARbt0.js} +3 -3
- package/dgram.cjs +1 -1
- package/dgram.d.ts +83 -533
- package/dgram.js +1 -3
- package/dns.cjs +1 -1
- package/dns.d.ts +9 -9
- package/dns.js +2 -2
- package/extension-3pxUYwrA.d.ts +16 -0
- package/extension-CPj10qwa.js +67 -0
- package/extension-D-NUXxzF.cjs +1 -0
- package/extension.cjs +1 -1
- package/extension.d.ts +3 -859
- package/extension.js +3 -5
- package/fs/promises.cjs +1 -1
- package/fs/promises.d.ts +8 -63
- package/fs/promises.js +1 -4
- package/fs-BfmfMBiw.cjs +1 -0
- package/{fs-BQs-x3_j.js → fs-D6nNf1mR.js} +4 -4
- package/fs-K7ROdxDx.d.ts +41 -0
- package/fs.cjs +1 -1
- package/fs.d.ts +81 -131
- package/fs.js +1 -4
- package/http.cjs +2 -2
- package/http.d.ts +152 -733
- package/http.js +7 -7
- package/index-BJztAQIP.d.ts +721 -0
- package/index-C6ZoDJg8.d.ts +31 -0
- package/index.cjs +1 -1
- package/index.d.ts +25 -2313
- package/index.js +23 -26
- package/lookup-BtwWaCZJ.d.ts +7 -0
- package/net-BDW1AVX1.d.ts +140 -0
- package/net-CpuAhaQC.cjs +1 -0
- package/{net-Bl6_W3bd.js → net-DKMWPXb_.js} +3 -3
- package/net.cjs +1 -1
- package/net.d.ts +2 -606
- package/net.js +2 -3
- package/{node-fs-DQn1TGJz.cjs → node-fs-C0eKnboT.cjs} +1 -1
- package/{node-fs-CdKPXPtW.js → node-fs-Dbf93qP7.js} +1 -1
- package/opfs/promises.cjs +1 -1
- package/opfs/promises.d.ts +8 -63
- package/opfs/promises.js +0 -1
- package/{opfs-BfcYLPGb.js → opfs-7_GmzQ93.js} +1 -1
- package/opfs-uClkgnb5.cjs +1 -0
- package/opfs.cjs +1 -1
- package/opfs.d.ts +80 -130
- package/opfs.js +3 -3
- package/package.json +6 -1
- package/packages-D36R2vBv.d.ts +108 -0
- package/packages.cjs +1 -0
- package/packages.d.ts +2 -0
- package/packages.js +150 -0
- package/{locator-9s7jNIA2.js → proxy-C8SG1Beo.js} +542 -344
- package/proxy-bPaU3-Cz.cjs +53 -0
- package/react.cjs +1 -1
- package/react.d.ts +11 -9
- package/react.js +1 -1
- package/{chunk-CPXzm0be.js → rolldown-runtime-DF993M8W.js} +1 -1
- package/rolldown-runtime-Doa5O59j.cjs +1 -0
- package/storage-OkwsFLN1.cjs +1 -0
- package/{storage-BcJfnkm3.js → storage-TmeyhZGt.js} +2 -2
- package/{utils-BsNRWMfl.cjs → utils-CoimMjf9.cjs} +1 -1
- package/background-CbU8TkWo.cjs +0 -1
- package/chunk-B6C_zzib.cjs +0 -1
- package/cloud-CWg9zCWm.cjs +0 -1
- package/cloud-eLyGYzbA.js +0 -33
- package/dgram-B3WC4VdJ.cjs +0 -1
- package/extension-BLkZiaAP.js +0 -253
- package/extension-DAiRg5ny.cjs +0 -1
- package/fs-DI1maxcZ.cjs +0 -1
- package/locator-CHfEe3Jv.cjs +0 -53
- package/net-C5kWnI4C.cjs +0 -1
- package/opfs-Dsi4FkJU.cjs +0 -1
- package/proxy-A9UvWUaF.cjs +0 -1
- package/proxy-wiZN4eTR.js +0 -14
- package/storage-C2-_-bTO.cjs +0 -1
- /package/{api-ByfayMm1.js → api--bnCFd4w.js} +0 -0
- /package/{connect-button-B_63ldmg.js → connect-button-Ds9KpXHe.js} +0 -0
- /package/{utils-CNydj3OT.js → utils-DPtyxGQu.js} +0 -0
package/extension.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import "./proxy-wiZN4eTR.js";
|
|
5
|
-
export { w as ATTACH_FRAME_EVENT_KEY, D as assertAttachableFrameUrl, M as assertFetchableUrl, h as assertLockdownApplicable, S as attachFrame, O as attachFramePermission, E as available, a as box, f as cookies, e as createVideoElementHandle, g as evaluatePermission, c as events, c as extension, m as fetch, j as fetchCredentialedPermission, u as fetchLocalPermission, o as fetchPermission, _ as gotoPermission, n as handleRevivableModules, A as isBlockedFetchUrl, T as isBlockedFrameUrl, s as isExtensionExposed, d as isLocalNetworkUrl, t as isType, C as modifyRequestHeadersPermission, p as permissions, b as promptInstall, k as readCookiePermission, y as removeRequestHeaderRule, i as revive, l as setMissingExtensionHandler, v as setRequestHeaderRule, r as type, x as waitForExtensionExposure };
|
|
1
|
+
import { A as e, B as t, C as n, D as r, E as i, F as a, H as o, I as s, L as c, M as l, N as u, O as d, P as f, R as p, S as m, T as h, V as g, a as _, c as v, d as y, i as b, j as x, k as S, l as C, o as w, r as T, s as E, u as D, w as O, x as k, z as A } from "./proxy-C8SG1Beo.js";
|
|
2
|
+
import { i as j, r as M } from "./extension-CPj10qwa.js";
|
|
3
|
+
export { b as ATTACH_FRAME_EVENT_KEY, C as assertAttachableFrameUrl, i as assertFetchableUrl, D as assertLockdownApplicable, _ as attachFrame, w as attachFramePermission, M as available, p as box, O as cookies, E as createFrame, A as createVideoElementHandle, u as events, u as extension, r as fetch, d as fetchCredentialedPermission, S as fetchLocalPermission, e as fetchPermission, v as gotoPermission, c as handleRevivableModules, x as isBlockedFetchUrl, y as isBlockedFrameUrl, f as isExtensionExposed, l as isLocalNetworkUrl, t as isType, k as modifyRequestHeadersPermission, T as permissions, j as promptInstall, h as readCookiePermission, m as removeRequestHeaderRule, g as revive, a as setMissingExtensionHandler, n as setRequestHeaderRule, o as type, s as waitForExtensionExposure };
|
package/fs/promises.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}})
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../fs-BfmfMBiw.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/fs/promises.d.ts
CHANGED
|
@@ -1,67 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { a as WriteData, i as Stats, n as MakeOptions, o as WriteOptions, r as ReadOptions } from "../index-C6ZoDJg8.js";
|
|
2
|
+
import { promises } from "../fs.js";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
flag?: string;
|
|
6
|
-
} | null | undefined;
|
|
7
|
-
type WriteOptions = BufferEncoding | {
|
|
8
|
-
encoding?: BufferEncoding | null;
|
|
9
|
-
mode?: number;
|
|
10
|
-
flag?: string;
|
|
11
|
-
contentType?: string;
|
|
12
|
-
} | null | undefined;
|
|
13
|
-
type WriteData = string | Uint8Array | ArrayBuffer | DataView;
|
|
14
|
-
type MakeOptions = {
|
|
15
|
-
recursive?: boolean;
|
|
16
|
-
} | number | null | undefined;
|
|
17
|
-
type Stats = {
|
|
18
|
-
size: number;
|
|
19
|
-
mtimeMs: number;
|
|
20
|
-
mtime: Date;
|
|
21
|
-
atimeMs: number;
|
|
22
|
-
ctimeMs: number;
|
|
23
|
-
mode: number;
|
|
24
|
-
isFile: () => boolean;
|
|
25
|
-
isDirectory: () => boolean;
|
|
26
|
-
isSymbolicLink: () => boolean;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
declare const promises: {
|
|
30
|
-
readFile: (path: node_fs.PathLike, options?: ReadOptions) => Promise<Buffer | string>;
|
|
31
|
-
writeFile: (path: node_fs.PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
|
|
32
|
-
appendFile: (path: node_fs.PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
|
|
33
|
-
stat: (path: node_fs.PathLike) => Promise<Stats>;
|
|
34
|
-
lstat: (path: node_fs.PathLike) => Promise<Stats>;
|
|
35
|
-
readdir: (path: node_fs.PathLike) => Promise<string[]>;
|
|
36
|
-
mkdir: (path: node_fs.PathLike, options?: MakeOptions) => Promise<void>;
|
|
37
|
-
rm: (path: node_fs.PathLike, options?: {
|
|
38
|
-
recursive?: boolean;
|
|
39
|
-
force?: boolean;
|
|
40
|
-
}) => Promise<void>;
|
|
41
|
-
rmdir: (path: node_fs.PathLike, options?: {
|
|
42
|
-
recursive?: boolean;
|
|
43
|
-
}) => Promise<void>;
|
|
44
|
-
unlink: (path: node_fs.PathLike) => Promise<void>;
|
|
45
|
-
rename: (from: node_fs.PathLike, to: node_fs.PathLike) => Promise<void>;
|
|
46
|
-
access: (path: node_fs.PathLike) => Promise<void>;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
declare const readFile: (path: node_fs.PathLike, options?: ReadOptions) => Promise<Buffer | string>;
|
|
50
|
-
declare const writeFile: (path: node_fs.PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
|
|
51
|
-
declare const appendFile: (path: node_fs.PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
|
|
52
|
-
declare const unlink: (path: node_fs.PathLike) => Promise<void>;
|
|
53
|
-
declare const rename: (from: node_fs.PathLike, to: node_fs.PathLike) => Promise<void>;
|
|
54
|
-
declare const readdir: (path: node_fs.PathLike) => Promise<string[]>;
|
|
55
|
-
declare const mkdir: (path: node_fs.PathLike, options?: MakeOptions) => Promise<void>;
|
|
56
|
-
declare const rm: (path: node_fs.PathLike, options?: {
|
|
4
|
+
//#region src/lib/fs/promises.d.ts
|
|
5
|
+
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?: {
|
|
57
6
|
recursive?: boolean;
|
|
58
7
|
force?: boolean;
|
|
59
|
-
}) => Promise<void
|
|
60
|
-
declare const rmdir: (path: node_fs.PathLike, options?: {
|
|
8
|
+
}) => Promise<void>, rmdir: (path: import("node:fs").PathLike, options?: {
|
|
61
9
|
recursive?: boolean;
|
|
62
|
-
}) => Promise<void>;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
declare const access: (path: node_fs.PathLike) => Promise<void>;
|
|
66
|
-
|
|
67
|
-
export { access, appendFile, promises as default, lstat, mkdir, readFile, readdir, rename, rm, rmdir, stat, unlink, writeFile };
|
|
10
|
+
}) => 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
|
+
//#endregion
|
|
12
|
+
export { access, appendFile, promises as default, lstat, mkdir, readFile, readdir, rename, rm, rmdir, stat, unlink, writeFile };
|
package/fs/promises.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "../node-fs-CdKPXPtW.js";
|
|
3
|
-
import "../storage-BcJfnkm3.js";
|
|
4
|
-
import { p as e } from "../fs-BQs-x3_j.js";
|
|
1
|
+
import { p as e } from "../fs-D6nNf1mR.js";
|
|
5
2
|
//#region src/lib/fs/promises.ts
|
|
6
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;
|
|
7
4
|
//#endregion
|
package/fs-BfmfMBiw.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-Doa5O59j.cjs"),t=require("./node-fs-C0eKnboT.cjs"),n=require("./storage-OkwsFLN1.cjs"),r=require("./opfs-uClkgnb5.cjs");var i=e.n({available:()=>c,list:()=>l,pull:()=>p,readFile:()=>u,remove:()=>f,writeFile:()=>d}),a,o=async()=>await(a??=r.t().catch(()=>!1))?!0:(a=void 0,!1),s=()=>n.t().catch(()=>!1),c=async()=>await o()||await s(),l=async()=>{let[e,t]=await Promise.all([o().then(e=>e?r.n():[]).catch(()=>[]),s().then(e=>e?n.n():[]).catch(()=>[])]),i=new Map,a=e=>{let t=Date.parse(e.updatedAt??``);return Number.isFinite(t)?t:0},c=e=>{let t=i.get(e.path);(!t||a(e)>=a(t))&&i.set(e.path,e)};for(let t of e)c(t);for(let e of t)c(e);return[...i.values()]},u=async e=>{if(await o())try{return await r.i(e)}catch(e){if(e?.name!==`NotFoundError`)throw e}let t=await n.i(e);return await o()&&r.o(e,t).catch(()=>{}),t},d=async(e,t,i)=>{let a=t instanceof Blob?t:new Blob([t],i?.contentType?{type:i.contentType}:void 0);if(await o()){await r.o(e,a,i),await s()&&n.s(e,a,i).catch(e=>console.warn(`fs: cloud replicate failed`,e));return}if(await s())return n.s(e,a,i);throw Error(`fs: no storage backend available`)},f=async e=>{let t=[];if(await o()&&t.push(r.a(e).catch(()=>{})),await s()&&t.push(n.a(e).catch(()=>{})),!t.length)throw Error(`fs: no storage backend available`);await Promise.all(t)},p=async e=>{let t=await n.i(e);return await o()&&await r.o(e,t),t},m=e.n({appendFile:()=>j,appendFileSync:()=>y,available:()=>g,default:()=>W,exists:()=>R,existsSync:()=>b,flush:()=>V,lstatSync:()=>S,mkdir:()=>P,mkdirSync:()=>w,mount:()=>B,promises:()=>z,pull:()=>U,readFile:()=>k,readFileSync:()=>_,readdir:()=>N,readdirSync:()=>C,remount:()=>H,rename:()=>L,renameSync:()=>O,rm:()=>F,rmSync:()=>T,rmdirSync:()=>E,stat:()=>M,statSync:()=>x,unlink:()=>I,unlinkSync:()=>D,writeFile:()=>A,writeFileSync:()=>v}),h=t.t(i,{memfs:!0}),{available:g,readFileSync:_,writeFileSync:v,appendFileSync:y,existsSync:b,statSync:x,lstatSync:S,readdirSync:C,mkdirSync:w,rmSync:T,rmdirSync:E,unlinkSync:D,renameSync:O,readFile:k,writeFile:A,appendFile:j,stat:M,readdir:N,mkdir:P,rm:F,unlink:I,rename:L,exists:R,promises:z,mount:B,flush:V,remount:H}=h,U=p,W={...h,pull:U};Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return H}});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as e } from "./
|
|
2
|
-
import { t } from "./node-fs-
|
|
3
|
-
import { a as n, i as r, n as i, s as a, t as o } from "./storage-
|
|
4
|
-
import { a as s, i as c, n as l, o as u, t as d } from "./opfs-
|
|
1
|
+
import { n as e } from "./rolldown-runtime-DF993M8W.js";
|
|
2
|
+
import { t } from "./node-fs-Dbf93qP7.js";
|
|
3
|
+
import { a as n, i as r, n as i, s as a, t as o } from "./storage-TmeyhZGt.js";
|
|
4
|
+
import { a as s, i as c, n as l, o as u, t as d } from "./opfs-7_GmzQ93.js";
|
|
5
5
|
//#region src/lib/fs/hybrid.ts
|
|
6
6
|
var f = /* @__PURE__ */ e({
|
|
7
7
|
available: () => g,
|
package/fs-K7ROdxDx.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { a as WriteData, i as Stats, n as MakeOptions, o as WriteOptions, r as ReadOptions, t as Callback } from "./index-C6ZoDJg8.js";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/storage.d.ts
|
|
4
|
+
type FileEntry = {
|
|
5
|
+
path: string;
|
|
6
|
+
size: number;
|
|
7
|
+
contentType: string | null;
|
|
8
|
+
updatedAt: string;
|
|
9
|
+
};
|
|
10
|
+
type StorageQuota = {
|
|
11
|
+
usedBytes: number;
|
|
12
|
+
limitBytes: number;
|
|
13
|
+
remaining: number;
|
|
14
|
+
objects: number;
|
|
15
|
+
maxObjects: number;
|
|
16
|
+
};
|
|
17
|
+
declare const quota: () => Promise<StorageQuota>;
|
|
18
|
+
declare namespace fs_d_exports {
|
|
19
|
+
export { FileEntry, Stats, StorageQuota, available, mkdir, promises, quota, readFile, readdir, rename, rm, stat, unlink, writeFile };
|
|
20
|
+
}
|
|
21
|
+
declare const available: () => Promise<boolean>, readFile: (path: import("node:fs").PathLike, a: ReadOptions | Callback<Buffer | string>, b?: Callback<Buffer | string>) => void, writeFile: (path: import("node:fs").PathLike, data: WriteData, a: WriteOptions | Callback<void>, b?: Callback<void>) => void, unlink: (path: import("node:fs").PathLike, callback: Callback<void>) => void, rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike, callback: Callback<void>) => void, readdir: (path: import("node:fs").PathLike, a: unknown, b?: Callback<string[]>) => void, mkdir: (path: import("node:fs").PathLike, a: MakeOptions | Callback<void>, b?: Callback<void>) => void, rm: (path: import("node:fs").PathLike, a: {
|
|
22
|
+
recursive?: boolean;
|
|
23
|
+
} | Callback<void>, b?: Callback<void>) => void, stat: (path: import("node:fs").PathLike, callback: Callback<Stats>) => void, promises: {
|
|
24
|
+
readFile: (path: import("node:fs").PathLike, options?: ReadOptions) => Promise<Buffer | string>;
|
|
25
|
+
writeFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
|
|
26
|
+
unlink: (path: import("node:fs").PathLike) => Promise<void>;
|
|
27
|
+
rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>;
|
|
28
|
+
readdir: (path: import("node:fs").PathLike) => Promise<string[]>;
|
|
29
|
+
mkdir: (_path?: import("node:fs").PathLike, _options?: MakeOptions) => Promise<void>;
|
|
30
|
+
rm: (path: import("node:fs").PathLike, options?: {
|
|
31
|
+
recursive?: boolean;
|
|
32
|
+
}) => Promise<void>;
|
|
33
|
+
rmdir: (path: import("node:fs").PathLike, options?: {
|
|
34
|
+
recursive?: boolean;
|
|
35
|
+
}) => Promise<void>;
|
|
36
|
+
stat: (path: import("node:fs").PathLike) => Promise<Stats>;
|
|
37
|
+
lstat: (path: import("node:fs").PathLike) => Promise<Stats>;
|
|
38
|
+
access: (path: import("node:fs").PathLike) => Promise<void>;
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
export { readFile as a, rm as c, writeFile as d, FileEntry as f, promises as i, stat as l, quota as m, fs_d_exports as n, readdir as o, StorageQuota as p, mkdir as r, rename as s, available as t, unlink as u };
|
package/fs.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}})
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./fs-BfmfMBiw.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.l,exports.mkdir=e.u,exports.mkdirSync=e.d,exports.mount=e.f,exports.promises=e.p,exports.pull=e.m,exports.readFile=e.h,exports.readFileSync=e.g,exports.readdir=e._,exports.readdirSync=e.v,exports.remount=e.y,exports.rename=e.b,exports.renameSync=e.x,exports.rm=e.S,exports.rmSync=e.C,exports.rmdirSync=e.w,exports.stat=e.T,exports.statSync=e.E,exports.unlink=e.D,exports.unlinkSync=e.O,exports.writeFile=e.k,exports.writeFileSync=e.A;
|
package/fs.d.ts
CHANGED
|
@@ -1,142 +1,92 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { a as WriteData, i as Stats, n as MakeOptions, o as WriteOptions, r as ReadOptions, t as Callback } from "./index-C6ZoDJg8.js";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
encoding?: BufferEncoding | null;
|
|
9
|
-
mode?: number;
|
|
10
|
-
flag?: string;
|
|
11
|
-
contentType?: string;
|
|
12
|
-
} | null | undefined;
|
|
13
|
-
type WriteData = string | Uint8Array | ArrayBuffer | DataView;
|
|
14
|
-
type MakeOptions = {
|
|
15
|
-
recursive?: boolean;
|
|
16
|
-
} | number | null | undefined;
|
|
17
|
-
type Callback<R> = (error: NodeJS.ErrnoException | null, result?: R) => void;
|
|
18
|
-
type Stats = {
|
|
19
|
-
size: number;
|
|
20
|
-
mtimeMs: number;
|
|
21
|
-
mtime: Date;
|
|
22
|
-
atimeMs: number;
|
|
23
|
-
ctimeMs: number;
|
|
24
|
-
mode: number;
|
|
25
|
-
isFile: () => boolean;
|
|
26
|
-
isDirectory: () => boolean;
|
|
27
|
-
isSymbolicLink: () => boolean;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
declare const available: () => Promise<boolean>;
|
|
31
|
-
declare const readFileSync: (path: node_fs.PathLike, options?: ReadOptions) => Buffer | string;
|
|
32
|
-
declare const writeFileSync: (path: node_fs.PathLike, data: WriteData, options?: WriteOptions) => void;
|
|
33
|
-
declare const appendFileSync: (path: node_fs.PathLike, data: WriteData, options?: WriteOptions) => void;
|
|
34
|
-
declare const existsSync: (path: node_fs.PathLike) => boolean;
|
|
35
|
-
declare const statSync: (path: node_fs.PathLike) => Stats;
|
|
36
|
-
declare const lstatSync: (path: node_fs.PathLike) => Stats;
|
|
37
|
-
declare const readdirSync: (path: node_fs.PathLike) => string[];
|
|
38
|
-
declare const mkdirSync: (path: node_fs.PathLike, options?: MakeOptions) => void;
|
|
39
|
-
declare const rmSync: (path: node_fs.PathLike, options?: {
|
|
3
|
+
//#region src/lib/fs/index.d.ts
|
|
4
|
+
declare namespace index_d_exports {
|
|
5
|
+
export { Stats, appendFile, appendFileSync, available, _default as default, exists, existsSync, flush, lstatSync, mkdir, mkdirSync, mount, promises, pull, readFile, readFileSync, readdir, readdirSync, remount, rename, renameSync, rm, rmSync, rmdirSync, stat, statSync, unlink, unlinkSync, writeFile, writeFileSync };
|
|
6
|
+
}
|
|
7
|
+
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?: {
|
|
40
8
|
recursive?: boolean;
|
|
41
9
|
force?: boolean;
|
|
42
|
-
}) => void
|
|
43
|
-
declare const rmdirSync: (path: node_fs.PathLike, options?: {
|
|
10
|
+
}) => void, rmdirSync: (path: import("node:fs").PathLike, options?: {
|
|
44
11
|
recursive?: boolean;
|
|
45
|
-
}) => void
|
|
46
|
-
declare const unlinkSync: (path: node_fs.PathLike) => void;
|
|
47
|
-
declare const renameSync: (from: node_fs.PathLike, to: node_fs.PathLike) => void;
|
|
48
|
-
declare const readFile: (path: node_fs.PathLike, a: ReadOptions | Callback<Buffer | string>, b?: Callback<Buffer | string>) => void;
|
|
49
|
-
declare const writeFile: (path: node_fs.PathLike, data: WriteData, a: WriteOptions | Callback<void>, b?: Callback<void>) => void;
|
|
50
|
-
declare const appendFile: (path: node_fs.PathLike, data: WriteData, a: WriteOptions | Callback<void>, b?: Callback<void>) => void;
|
|
51
|
-
declare const stat: (path: node_fs.PathLike, callback: Callback<Stats>) => void;
|
|
52
|
-
declare const readdir: (path: node_fs.PathLike, a: unknown, b?: Callback<string[]>) => void;
|
|
53
|
-
declare const mkdir: (path: node_fs.PathLike, a: MakeOptions | Callback<void>, b?: Callback<void>) => void;
|
|
54
|
-
declare const rm: (path: node_fs.PathLike, a: {
|
|
12
|
+
}) => 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: {
|
|
55
13
|
recursive?: boolean;
|
|
56
14
|
force?: boolean;
|
|
57
|
-
} | Callback<void>, b?: Callback<void>) => void
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
mkdir: (path: node_fs.PathLike, options?: MakeOptions) => Promise<void>;
|
|
69
|
-
rm: (path: node_fs.PathLike, options?: {
|
|
70
|
-
recursive?: boolean;
|
|
71
|
-
force?: boolean;
|
|
15
|
+
} | 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: {
|
|
16
|
+
readFile: (path: import("node:fs").PathLike, options?: ReadOptions) => Promise<Buffer | string>;
|
|
17
|
+
writeFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
|
|
18
|
+
appendFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
|
|
19
|
+
stat: (path: import("node:fs").PathLike) => Promise<Stats>;
|
|
20
|
+
lstat: (path: import("node:fs").PathLike) => Promise<Stats>;
|
|
21
|
+
readdir: (path: import("node:fs").PathLike) => Promise<string[]>;
|
|
22
|
+
mkdir: (path: import("node:fs").PathLike, options?: MakeOptions) => Promise<void>;
|
|
23
|
+
rm: (path: import("node:fs").PathLike, options?: {
|
|
24
|
+
recursive?: boolean;
|
|
25
|
+
force?: boolean;
|
|
72
26
|
}) => Promise<void>;
|
|
73
|
-
rmdir: (path:
|
|
74
|
-
|
|
27
|
+
rmdir: (path: import("node:fs").PathLike, options?: {
|
|
28
|
+
recursive?: boolean;
|
|
75
29
|
}) => Promise<void>;
|
|
76
|
-
unlink: (path:
|
|
77
|
-
rename: (from:
|
|
78
|
-
access: (path:
|
|
79
|
-
}
|
|
80
|
-
declare const mount: () => Promise<void>;
|
|
81
|
-
declare const flush: () => Promise<void>;
|
|
82
|
-
declare const remount: () => Promise<void>;
|
|
30
|
+
unlink: (path: import("node:fs").PathLike) => Promise<void>;
|
|
31
|
+
rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>;
|
|
32
|
+
access: (path: import("node:fs").PathLike) => Promise<void>;
|
|
33
|
+
}, mount: () => Promise<void>, flush: () => Promise<void>, remount: () => Promise<void>;
|
|
83
34
|
declare const pull: (path: string) => Promise<Blob>;
|
|
84
35
|
declare const _default: {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
36
|
+
available: () => Promise<boolean>;
|
|
37
|
+
readFileSync: (path: import("node:fs").PathLike, options?: ReadOptions) => Buffer | string;
|
|
38
|
+
writeFileSync: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => void;
|
|
39
|
+
appendFileSync: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => void;
|
|
40
|
+
existsSync: (path: import("node:fs").PathLike) => boolean;
|
|
41
|
+
statSync: (path: import("node:fs").PathLike) => Stats;
|
|
42
|
+
lstatSync: (path: import("node:fs").PathLike) => Stats;
|
|
43
|
+
readdirSync: (path: import("node:fs").PathLike) => string[];
|
|
44
|
+
mkdirSync: (path: import("node:fs").PathLike, options?: MakeOptions) => void;
|
|
45
|
+
rmSync: (path: import("node:fs").PathLike, options?: {
|
|
46
|
+
recursive?: boolean;
|
|
47
|
+
force?: boolean;
|
|
48
|
+
}) => void;
|
|
49
|
+
rmdirSync: (path: import("node:fs").PathLike, options?: {
|
|
50
|
+
recursive?: boolean;
|
|
51
|
+
}) => void;
|
|
52
|
+
unlinkSync: (path: import("node:fs").PathLike) => void;
|
|
53
|
+
renameSync: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => void;
|
|
54
|
+
readFile: (path: import("node:fs").PathLike, a: ReadOptions | Callback<Buffer | string>, b?: Callback<Buffer | string>) => void;
|
|
55
|
+
writeFile: (path: import("node:fs").PathLike, data: WriteData, a: WriteOptions | Callback<void>, b?: Callback<void>) => void;
|
|
56
|
+
appendFile: (path: import("node:fs").PathLike, data: WriteData, a: WriteOptions | Callback<void>, b?: Callback<void>) => void;
|
|
57
|
+
stat: (path: import("node:fs").PathLike, callback: Callback<Stats>) => void;
|
|
58
|
+
readdir: (path: import("node:fs").PathLike, a: unknown, b?: Callback<string[]>) => void;
|
|
59
|
+
mkdir: (path: import("node:fs").PathLike, a: MakeOptions | Callback<void>, b?: Callback<void>) => void;
|
|
60
|
+
rm: (path: import("node:fs").PathLike, a: {
|
|
61
|
+
recursive?: boolean;
|
|
62
|
+
force?: boolean;
|
|
63
|
+
} | Callback<void>, b?: Callback<void>) => void;
|
|
64
|
+
unlink: (path: import("node:fs").PathLike, callback: Callback<void>) => void;
|
|
65
|
+
rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike, callback: Callback<void>) => void;
|
|
66
|
+
exists: (path: import("node:fs").PathLike, callback: (exists: boolean) => void) => void;
|
|
67
|
+
promises: {
|
|
68
|
+
readFile: (path: import("node:fs").PathLike, options?: ReadOptions) => Promise<Buffer | string>;
|
|
69
|
+
writeFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
|
|
70
|
+
appendFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
|
|
71
|
+
stat: (path: import("node:fs").PathLike) => Promise<Stats>;
|
|
72
|
+
lstat: (path: import("node:fs").PathLike) => Promise<Stats>;
|
|
73
|
+
readdir: (path: import("node:fs").PathLike) => Promise<string[]>;
|
|
74
|
+
mkdir: (path: import("node:fs").PathLike, options?: MakeOptions) => Promise<void>;
|
|
75
|
+
rm: (path: import("node:fs").PathLike, options?: {
|
|
76
|
+
recursive?: boolean;
|
|
77
|
+
force?: boolean;
|
|
78
|
+
}) => Promise<void>;
|
|
79
|
+
rmdir: (path: import("node:fs").PathLike, options?: {
|
|
80
|
+
recursive?: boolean;
|
|
81
|
+
}) => Promise<void>;
|
|
82
|
+
unlink: (path: import("node:fs").PathLike) => Promise<void>;
|
|
83
|
+
rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>;
|
|
84
|
+
access: (path: import("node:fs").PathLike) => Promise<void>;
|
|
85
|
+
};
|
|
86
|
+
mount: () => Promise<void>;
|
|
87
|
+
flush: () => Promise<void>;
|
|
88
|
+
remount: () => Promise<void>;
|
|
89
|
+
pull: (path: string) => Promise<Blob>;
|
|
139
90
|
};
|
|
140
|
-
|
|
141
|
-
export { appendFile, appendFileSync, available, _default as default, exists, existsSync, flush, lstatSync, mkdir, mkdirSync, mount, promises, pull, readFile, readFileSync, readdir, readdirSync, remount, rename, renameSync, rm, rmSync, rmdirSync, stat, statSync, unlink, unlinkSync, writeFile, writeFileSync };
|
|
142
|
-
export type { Stats };
|
|
91
|
+
//#endregion
|
|
92
|
+
export { type Stats, appendFile, appendFileSync, available, _default as default, exists, existsSync, flush, lstatSync, mkdir, mkdirSync, mount, promises, pull, readFile, readFileSync, readdir, readdirSync, remount, rename, renameSync, rm, rmSync, rmdirSync, stat, statSync, index_d_exports as t, unlink, unlinkSync, writeFile, writeFileSync };
|
package/fs.js
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./node-fs-CdKPXPtW.js";
|
|
3
|
-
import "./storage-BcJfnkm3.js";
|
|
4
|
-
import { A as e, C as t, D as n, E as r, O as i, S as a, T as o, _ as s, a as c, b as l, d as u, f as d, g as f, h as p, i as m, k as h, l as g, m as _, n as v, o as y, p as b, r as x, s as S, t as C, u as w, v as T, w as E, x as D, y as O } from "./fs-BQs-x3_j.js";
|
|
1
|
+
import { A as e, C as t, D as n, E as r, O as i, S as a, T as o, _ as s, a as c, b as l, d as u, f as d, g as f, h as p, i as m, k as h, l as g, m as _, n as v, o as y, p as b, r as x, s as S, t as C, u as w, v as T, w as E, x as D, y as O } from "./fs-D6nNf1mR.js";
|
|
5
2
|
export { C as appendFile, v as appendFileSync, x as available, S as default, m as exists, c as existsSync, y as flush, g as lstatSync, w as mkdir, u as mkdirSync, d as mount, b as promises, _ as pull, p as readFile, f as readFileSync, s as readdir, T as readdirSync, O as remount, l as rename, D as renameSync, a as rm, t as rmSync, E as rmdirSync, o as stat, r as statSync, n as unlink, i as unlinkSync, h as writeFile, e as writeFileSync };
|
package/http.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-Doa5O59j.cjs"),t=require("./net-CpuAhaQC.cjs");let n=require("buffer"),r=require("stream");var i=e.n({Agent:()=>T,ClientRequest:()=>S,HTTPParser:()=>g,IncomingMessage:()=>v,METHODS:()=>o,STATUS_CODES:()=>s,Server:()=>w,ServerResponse:()=>b,_default:()=>A,createServer:()=>k,default:()=>A,get:()=>O,globalAgent:()=>E,request:()=>D}),a=new TextDecoder(`latin1`),o=`ACL.BIND.CHECKOUT.CONNECT.COPY.DELETE.GET.HEAD.LINK.LOCK.M-SEARCH.MERGE.MKACTIVITY.MKCALENDAR.MKCOL.MOVE.NOTIFY.OPTIONS.PATCH.POST.PROPFIND.PROPPATCH.PURGE.PUT.REBIND.REPORT.SEARCH.SOURCE.SUBSCRIBE.TRACE.UNBIND.UNLINK.UNLOCK.UNSUBSCRIBE`.split(`.`),s={100:`Continue`,101:`Switching Protocols`,102:`Processing`,103:`Early Hints`,200:`OK`,201:`Created`,202:`Accepted`,203:`Non-Authoritative Information`,204:`No Content`,205:`Reset Content`,206:`Partial Content`,207:`Multi-Status`,208:`Already Reported`,226:`IM Used`,300:`Multiple Choices`,301:`Moved Permanently`,302:`Found`,303:`See Other`,304:`Not Modified`,305:`Use Proxy`,307:`Temporary Redirect`,308:`Permanent Redirect`,400:`Bad Request`,401:`Unauthorized`,402:`Payment Required`,403:`Forbidden`,404:`Not Found`,405:`Method Not Allowed`,406:`Not Acceptable`,407:`Proxy Authentication Required`,408:`Request Timeout`,409:`Conflict`,410:`Gone`,411:`Length Required`,412:`Precondition Failed`,413:`Payload Too Large`,414:`URI Too Long`,415:`Unsupported Media Type`,416:`Range Not Satisfiable`,417:`Expectation Failed`,418:`I'm a Teapot`,421:`Misdirected Request`,422:`Unprocessable Entity`,423:`Locked`,424:`Failed Dependency`,425:`Too Early`,426:`Upgrade Required`,428:`Precondition Required`,429:`Too Many Requests`,431:`Request Header Fields Too Large`,451:`Unavailable For Legal Reasons`,500:`Internal Server Error`,501:`Not Implemented`,502:`Bad Gateway`,503:`Service Unavailable`,504:`Gateway Timeout`,505:`HTTP Version Not Supported`,506:`Variant Also Negotiates`,507:`Insufficient Storage`,508:`Loop Detected`,509:`Bandwidth Limit Exceeded`,510:`Not Extended`,511:`Network Authentication Required`},c=new Set([`content-type`,`content-length`,`user-agent`,`referer`,`host`,`authorization`,`proxy-authorization`,`if-modified-since`,`if-unmodified-since`,`from`,`location`,`max-forwards`,`retry-after`,`etag`,`last-modified`,`server`,`age`,`expires`]),l=13,u=10,d=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/,f=(e,t)=>(e.code=t,e),p=(e,t)=>{if(e.length===0)return t;if(t.length===0)return e;let n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n},m=(e,t)=>{for(let n=t;n+1<e.length;n++)if(e[n]===l&&e[n+1]===u)return n;return-1},h=e=>{for(let t=0;t+3<e.length;t++)if(e[t]===l&&e[t+1]===u&&e[t+2]===l&&e[t+3]===u)return t;return-1},g=class{mode;handlers;buf=new Uint8Array;state=`HEAD`;framing=`none`;bodyRemaining=0;chunkState=`size`;skipBody=!1;constructor(e,t){this.mode=e,this.handlers=t}execute(e){this.buf=p(this.buf,e);let t=!0;for(;t;)if(t=!1,this.state===`HEAD`){let e=h(this.buf);if(e===-1)return;let n=this.buf.subarray(0,e);this.buf=this.buf.subarray(e+4);let r=this.parseHead(n);this.handlers.onHeaders(r),this.setupBody(r),this.framing===`none`?(this.handlers.onComplete(),this.reset(),t=this.buf.length>0):(this.state=`BODY`,t=!0)}else this.consumeBody()&&(this.handlers.onComplete(),this.reset(),t=this.buf.length>0)}finish(){this.state===`BODY`&&this.framing===`eof`&&(this.handlers.onComplete(),this.reset())}reset(){this.state=`HEAD`,this.framing=`none`,this.bodyRemaining=0,this.chunkState=`size`,this.skipBody=!1}parseHead(e){let t=a.decode(e).split(`\r
|
|
2
2
|
`),n=t.shift()??``,r=[];for(let e of t)(e.startsWith(` `)||e.startsWith(` `))&&r.length>0?r[r.length-1]+=` `+e.trim():r.push(e);let i=[],o={};for(let e of r){if(!e)continue;let t=e.indexOf(`:`);if(t===-1)continue;let n=e.slice(0,t).trim(),r=e.slice(t+1).trim();i.push(n,r),this.addHeader(o,n,r)}let s={httpVersionMajor:1,httpVersionMinor:1,httpVersion:`1.1`,headers:o,rawHeaders:i};if(this.mode===`request`){let[e,t,r]=n.split(` `);s.method=(e??`GET`).toUpperCase(),s.url=t??`/`,this.applyVersion(s,r)}else{let e=n.indexOf(` `),t=n.slice(0,e),r=n.slice(e+1),i=r.indexOf(` `),a=i===-1?r:r.slice(0,i);s.statusCode=parseInt(a,10)||0,s.statusMessage=i===-1?``:r.slice(i+1),this.applyVersion(s,t)}return s}applyVersion(e,t){let n=/HTTP\/(\d)\.(\d)/i.exec(t??``);n&&(e.httpVersionMajor=parseInt(n[1],10),e.httpVersionMinor=parseInt(n[2],10),e.httpVersion=`${e.httpVersionMajor}.${e.httpVersionMinor}`)}addHeader(e,t,n){let r=t.toLowerCase();if(r===`set-cookie`){let t=e[`set-cookie`];Array.isArray(t)?t.push(n):e[`set-cookie`]=[n];return}let i=e[r];i===void 0?e[r]=n:c.has(r)||(e[r]=`${i}, ${n}`)}setupBody(e){if(this.skipBody){this.framing=`none`;return}let t=e.headers[`transfer-encoding`];if(typeof t==`string`&&t.toLowerCase().includes(`chunked`)){this.framing=`chunked`,this.chunkState=`size`;return}let n=e.headers[`content-length`];if(typeof n==`string`&&n!==``){let e=parseInt(n,10);e>0?(this.framing=`length`,this.bodyRemaining=e):this.framing=`none`;return}if(this.mode===`response`){let t=e.statusCode??0;t>=100&&t<200||t===204||t===304?this.framing=`none`:this.framing=`eof`}else this.framing=`none`}consumeBody(){if(this.framing===`length`){if(this.buf.length===0)return!1;let e=Math.min(this.bodyRemaining,this.buf.length);return this.handlers.onBody(this.buf.subarray(0,e)),this.buf=this.buf.subarray(e),this.bodyRemaining-=e,this.bodyRemaining===0}return this.framing===`eof`?(this.buf.length>0&&(this.handlers.onBody(this.buf),this.buf=new Uint8Array),!1):this.framing===`chunked`?this.consumeChunked():!0}consumeChunked(){for(;;)if(this.chunkState===`size`){let e=m(this.buf,0);if(e===-1)return!1;let t=a.decode(this.buf.subarray(0,e)),n=parseInt(t.split(`;`)[0].trim(),16);if(this.buf=this.buf.subarray(e+2),Number.isNaN(n))return!0;n===0?this.chunkState=`trailer`:(this.bodyRemaining=n,this.chunkState=`data`)}else if(this.chunkState===`data`){if(this.buf.length===0)return!1;let e=Math.min(this.bodyRemaining,this.buf.length);this.handlers.onBody(this.buf.subarray(0,e)),this.buf=this.buf.subarray(e),this.bodyRemaining-=e,this.bodyRemaining===0&&(this.chunkState=`dataCRLF`)}else if(this.chunkState===`dataCRLF`){if(this.buf.length<2)return!1;this.buf=this.buf.subarray(2),this.chunkState=`size`}else{let e=m(this.buf,0);if(e===-1)return!1;let t=e===0;if(this.buf=this.buf.subarray(e+2),t)return!0}}},_=(e,t)=>n.Buffer.isBuffer(e)?e:typeof e==`string`?n.Buffer.from(e,t??`utf8`):e instanceof Uint8Array?n.Buffer.from(e):e instanceof ArrayBuffer?n.Buffer.from(new Uint8Array(e)):n.Buffer.from(String(e)),v=class extends r.Stream.Readable{httpVersion=`1.1`;httpVersionMajor=1;httpVersionMinor=1;headers={};rawHeaders=[];trailers={};rawTrailers=[];method;url;statusCode;statusMessage;complete=!1;socket;constructor(e){super(),this.socket=e}get connection(){return this.socket}_applyHead(e){this.httpVersion=e.httpVersion,this.httpVersionMajor=e.httpVersionMajor,this.httpVersionMinor=e.httpVersionMinor,this.headers=e.headers,this.rawHeaders=e.rawHeaders,this.method=e.method,this.url=e.url,this.statusCode=e.statusCode,this.statusMessage=e.statusMessage}_read(){}setTimeout(e,t){return this.socket.setTimeout(e,t),this}},y=class extends r.Stream.Writable{_headerStore=new Map;headersSent=!1;chunkedEncoding=!1;finished=!1;_bodyWritten=!1;setHeader(e,t){if(this.headersSent)throw f(Error(`Cannot set headers after they are sent to the client`),`ERR_HTTP_HEADERS_SENT`);if(typeof e!=`string`||!d.test(e))throw f(TypeError(`Header name must be a valid HTTP token [${JSON.stringify(String(e))}]`),`ERR_INVALID_HTTP_TOKEN`);if(t===void 0)throw f(TypeError(`Invalid value "undefined" for header "${e}"`),`ERR_HTTP_INVALID_HEADER_VALUE`);return this._headerStore.set(e.toLowerCase(),[e,Array.isArray(t)?[...t]:t]),this}getHeader(e){return this._headerStore.get(e.toLowerCase())?.[1]}getHeaderNames(){return[...this._headerStore.values()].map(([e])=>e)}getHeaders(){let e={};for(let[t,n]of this._headerStore.values())e[t]=n;return e}hasHeader(e){return this._headerStore.has(e.toLowerCase())}removeHeader(e){if(this.headersSent)throw Error(`Cannot remove headers after they are sent to the client`);this._headerStore.delete(e.toLowerCase())}_storeHeader(e){let t=this.hasHeader(`content-length`),n=this.getHeader(`transfer-encoding`);typeof n==`string`&&n.toLowerCase().includes(`chunked`)?this.chunkedEncoding=!0:!t&&this._shouldSendBody()&&(this.chunkedEncoding=!0,this.setHeader(`Transfer-Encoding`,`chunked`));let r=e+`\r
|
|
3
3
|
`;for(let[e,t]of this._headerStore.values())if(Array.isArray(t))for(let n of t)r+=`${e}: ${n}\r\n`;else r+=`${e}: ${t}\r\n`;return r+=`\r
|
|
4
4
|
`,r}_writeToSocket(e,t){if(!this.socket){t(Error(`Socket is not available`));return}this.socket.write(e,t)}write(e,t,n){return this._bodyWritten=!0,super.write(e,t,n)}_write(e,t,r){let i=_(e),a=[];if(this.headersSent||=(this._implicitHeader(),a.push(n.Buffer.from(this._headBlock,`latin1`)),!0),this.chunkedEncoding?i.length>0&&(a.push(n.Buffer.from(`${i.length.toString(16)}\r\n`,`latin1`)),a.push(i),a.push(n.Buffer.from(`\r
|
|
@@ -6,4 +6,4 @@ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{val
|
|
|
6
6
|
\r
|
|
7
7
|
`,`latin1`)),this.finished=!0,t.length===0){e();return}this._writeToSocket(n.Buffer.concat(t),e)}end(e,t,n){if(e!=null&&typeof e!=`function`&&!this._bodyWritten&&!this.headersSent&&!this.chunkedEncoding&&!this.hasHeader(`content-length`)){let n=typeof t==`string`?t:void 0;this.setHeader(`Content-Length`,_(e,n).length)}return super.end(e,t,n)}_headBlock},b=class extends y{statusCode=200;statusMessage;_writeHeadCalled=!1;sendDate=!0;req;socket;_keepAlive=!0;constructor(e){super(),this.req=e,this.socket=e.socket}_shouldSendBody(){if(this.req.method===`HEAD`)return!1;let e=this.statusCode;return!(e>=100&&e<200||e===204||e===304)}writeHead(e,t,n){if(this._writeHeadCalled||this.headersSent)throw f(Error(`Cannot render headers after they are sent to the client`),`ERR_HTTP_HEADERS_SENT`);this._writeHeadCalled=!0,this.statusCode=e;let r=n;if(typeof t==`string`?this.statusMessage=t:t!=null&&(r=t),Array.isArray(r)){let e=Array.isArray(r[0])?r:Array.from({length:Math.floor(r.length/2)},(e,t)=>[r[t*2],r[t*2+1]]);for(let[t,n]of e)n!==void 0&&this._appendHeader(t,n)}else if(r)for(let[e,t]of Object.entries(r))t!==void 0&&this.setHeader(e,t);return this}_appendHeader(e,t){let n=this.getHeader(e);if(n===void 0)this.setHeader(e,t);else{let r=[...Array.isArray(n)?n:[n],...Array.isArray(t)?t:[t]].map(String);this.setHeader(e,r)}}_implicitHeader(){let e=this.statusMessage??s[this.statusCode]??`unknown`;this.sendDate&&!this.hasHeader(`date`)&&this.setHeader(`Date`,new Date().toUTCString()),this.hasHeader(`connection`)||this.setHeader(`Connection`,this._keepAlive?`keep-alive`:`close`),this._headBlock=this._storeHeader(`HTTP/1.1 ${this.statusCode} ${e}`)}writeContinue(){this._writeToSocket(n.Buffer.from(`HTTP/1.1 100 Continue\r
|
|
8
8
|
\r
|
|
9
|
-
`,`latin1`),()=>{})}setTimeout(e,t){return this.socket?.setTimeout(e,t),this}},x=(...e)=>{let t={},n={},r,i=[...e],a=i.shift();if(typeof a==`string`||a instanceof URL){let e=typeof a==`string`?new URL(a):a;t={protocol:e.protocol,hostname:e.hostname,host:e.hostname,port:e.port,path:`${e.pathname}${e.search}`,auth:e.username?`${e.username}:${e.password}`:void 0};let o=i.shift();typeof o==`function`?r=o:o&&typeof o==`object`&&(n=o,r=i.shift())}else a&&typeof a==`object`&&(n=a,r=i.shift());return{options:{...t,...n},callback:r}},S=class extends y{method;path;host;protocol;socket;get connection(){return this.socket}res=null;aborted=!1;_aborted=!1;constructor(e,r){super(),this.method=(e.method??`GET`).toUpperCase(),this.path=e.path??`/`,this.protocol=e.protocol??`http:`;let i=e.hostname??e.host??`localhost`;this.host=i;let a=Number(e.port??(this.protocol===`https:`?443:80));if(r&&this.once(`response`,r),e.headers)for(let[t,n]of Object.entries(e.headers))n!==void 0&&this.setHeader(t,n);if(!this.hasHeader(`host`)){let e=this.protocol===`https:`&&a===443||this.protocol!==`https:`&&a===80;this.setHeader(`Host`,e?i:`${i}:${a}`)}e.auth&&!this.hasHeader(`authorization`)&&this.setHeader(`Authorization`,`Basic ${n.Buffer.from(e.auth).toString(`base64`)}`),this.socket=new t.n,this.emit(`socket`,this.socket),this.socket.on(`error`,e=>{this._aborted||this.emit(`error`,e)}),this._attachResponseParser(),this.socket.connect({host:i,port:a},()=>{this.emit(`connect`)})}_shouldSendBody(){return this.method!==`GET`&&this.method!==`HEAD`&&this.method!==`DELETE`}_implicitHeader(){this._headBlock=this._storeHeader(`${this.method} ${this.path} HTTP/1.1`)}_attachResponseParser(){let e=new v(this.socket),t=new g(`response`,{onHeaders:n=>{e._applyHead(n),this.method===`HEAD`&&(t.skipBody=!0),this.res=e,this.emit(`response`,e)},onBody:t=>{e.push(n.Buffer.from(t))},onComplete:()=>{e.complete=!0,e.push(null)}});this.socket.on(`data`,e=>{this._aborted||t.execute(e)}),this.socket.on(`end`,()=>{t.finish()}),this.socket.on(`close`,()=>{this.emit(`close`)})}abort(){this._aborted||(this._aborted=!0,this.aborted=!0,this.emit(`abort`),this.socket.destroy())}destroy(e){return this._aborted?this:(this._aborted=!0,this.socket.destroy(e),super.destroy(e),this)}end(e,t,n){return this._aborted?this:super.end(e,t,n)}_writeToSocket(e,t){if(this._aborted){t();return}super._writeToSocket(e,t)}setTimeout(e,t){return this.socket.setTimeout(e,t),this}setNoDelay(e){this.socket.setNoDelay(e)}setSocketKeepAlive(e,t){this.socket.setKeepAlive(e,t)}},C=class extends t.t{constructor(e,t){let n={},r=t;typeof e==`function`?r=e:e&&(n=e),super(n),r&&this.on(`request`,r),this.on(`connection`,e=>this._handleConnection(e))}_handleConnection(e){let t=null,r=new g(`request`,{onHeaders:n=>{t=new v(e),t._applyHead(n),n.method===`HEAD`&&(r.skipBody=!0);let i=new b(t),a=String(n.headers.connection??``).toLowerCase();i._keepAlive=n.httpVersionMinor>=1?a!==`close`:a===`keep-alive`,i.on(`finish`,()=>{i._keepAlive||e.end()}),this.emit(`request`,t,i)},onBody:e=>{t?.push(n.Buffer.from(e))},onComplete:()=>{t&&(t.complete=!0,t.push(null)),t=null}});e.on(`data`,e=>r.execute(e)),e.on(`end`,()=>{r.finish(),t&&t.push(null)}),e.on(`error`,t=>this.emit(`clientError`,t,e))}},w=new Proxy(C,{apply:(e,t,n)=>new e(...n)}),T=class{maxSockets;maxFreeSockets;keepAlive;options;constructor(e={}){this.options=e,this.keepAlive=!!e.keepAlive,this.maxSockets=e.maxSockets??1/0,this.maxFreeSockets=e.maxFreeSockets??256}getName(e={}){return`${e.host??`localhost`}:${e.port??``}:${e.localAddress??``}`}destroy(){}},E=new T,D=(...e)=>{let{options:t,callback:n}=x(...e);return new S(t,n)},O=(...e)=>{let t=D(...e);return t.end(),t},k=(e,t)=>new w(e,t),A={METHODS:o,STATUS_CODES:s,Agent:T,globalAgent:E,Server:w,ServerResponse:b,IncomingMessage:v,ClientRequest:S,OutgoingMessage:y,createServer:k,request:D,get:O};exports.Agent=T,exports.ClientRequest=S,exports.HTTPParser=g,exports.IncomingMessage=v,exports.METHODS=o,exports.STATUS_CODES=s,exports.Server=w,exports.ServerResponse=b,exports._default=A,exports.default=A,exports.createServer=k,exports.get=O,exports.globalAgent=E,exports.request=D,Object.defineProperty(exports
|
|
9
|
+
`,`latin1`),()=>{})}setTimeout(e,t){return this.socket?.setTimeout(e,t),this}},x=(...e)=>{let t={},n={},r,i=[...e],a=i.shift();if(typeof a==`string`||a instanceof URL){let e=typeof a==`string`?new URL(a):a;t={protocol:e.protocol,hostname:e.hostname,host:e.hostname,port:e.port,path:`${e.pathname}${e.search}`,auth:e.username?`${e.username}:${e.password}`:void 0};let o=i.shift();typeof o==`function`?r=o:o&&typeof o==`object`&&(n=o,r=i.shift())}else a&&typeof a==`object`&&(n=a,r=i.shift());return{options:{...t,...n},callback:r}},S=class extends y{method;path;host;protocol;socket;get connection(){return this.socket}res=null;aborted=!1;_aborted=!1;constructor(e,r){super(),this.method=(e.method??`GET`).toUpperCase(),this.path=e.path??`/`,this.protocol=e.protocol??`http:`;let i=e.hostname??e.host??`localhost`;this.host=i;let a=Number(e.port??(this.protocol===`https:`?443:80));if(r&&this.once(`response`,r),e.headers)for(let[t,n]of Object.entries(e.headers))n!==void 0&&this.setHeader(t,n);if(!this.hasHeader(`host`)){let e=this.protocol===`https:`&&a===443||this.protocol!==`https:`&&a===80;this.setHeader(`Host`,e?i:`${i}:${a}`)}e.auth&&!this.hasHeader(`authorization`)&&this.setHeader(`Authorization`,`Basic ${n.Buffer.from(e.auth).toString(`base64`)}`),this.socket=new t.n,this.emit(`socket`,this.socket),this.socket.on(`error`,e=>{this._aborted||this.emit(`error`,e)}),this._attachResponseParser(),this.socket.connect({host:i,port:a},()=>{this.emit(`connect`)})}_shouldSendBody(){return this.method!==`GET`&&this.method!==`HEAD`&&this.method!==`DELETE`}_implicitHeader(){this._headBlock=this._storeHeader(`${this.method} ${this.path} HTTP/1.1`)}_attachResponseParser(){let e=new v(this.socket),t=new g(`response`,{onHeaders:n=>{e._applyHead(n),this.method===`HEAD`&&(t.skipBody=!0),this.res=e,this.emit(`response`,e)},onBody:t=>{e.push(n.Buffer.from(t))},onComplete:()=>{e.complete=!0,e.push(null)}});this.socket.on(`data`,e=>{this._aborted||t.execute(e)}),this.socket.on(`end`,()=>{t.finish()}),this.socket.on(`close`,()=>{this.emit(`close`)})}abort(){this._aborted||(this._aborted=!0,this.aborted=!0,this.emit(`abort`),this.socket.destroy())}destroy(e){return this._aborted?this:(this._aborted=!0,this.socket.destroy(e),super.destroy(e),this)}end(e,t,n){return this._aborted?this:super.end(e,t,n)}_writeToSocket(e,t){if(this._aborted){t();return}super._writeToSocket(e,t)}setTimeout(e,t){return this.socket.setTimeout(e,t),this}setNoDelay(e){this.socket.setNoDelay(e)}setSocketKeepAlive(e,t){this.socket.setKeepAlive(e,t)}},C=class extends t.t{constructor(e,t){let n={},r=t;typeof e==`function`?r=e:e&&(n=e),super(n),r&&this.on(`request`,r),this.on(`connection`,e=>this._handleConnection(e))}_handleConnection(e){let t=null,r=new g(`request`,{onHeaders:n=>{t=new v(e),t._applyHead(n),n.method===`HEAD`&&(r.skipBody=!0);let i=new b(t),a=String(n.headers.connection??``).toLowerCase();i._keepAlive=n.httpVersionMinor>=1?a!==`close`:a===`keep-alive`,i.on(`finish`,()=>{i._keepAlive||e.end()}),this.emit(`request`,t,i)},onBody:e=>{t?.push(n.Buffer.from(e))},onComplete:()=>{t&&(t.complete=!0,t.push(null)),t=null}});e.on(`data`,e=>r.execute(e)),e.on(`end`,()=>{r.finish(),t&&t.push(null)}),e.on(`error`,t=>this.emit(`clientError`,t,e))}},w=new Proxy(C,{apply:(e,t,n)=>new e(...n)}),T=class{maxSockets;maxFreeSockets;keepAlive;options;constructor(e={}){this.options=e,this.keepAlive=!!e.keepAlive,this.maxSockets=e.maxSockets??1/0,this.maxFreeSockets=e.maxFreeSockets??256}getName(e={}){return`${e.host??`localhost`}:${e.port??``}:${e.localAddress??``}`}destroy(){}},E=new T,D=(...e)=>{let{options:t,callback:n}=x(...e);return new S(t,n)},O=(...e)=>{let t=D(...e);return t.end(),t},k=(e,t)=>new w(e,t),A={METHODS:o,STATUS_CODES:s,Agent:T,globalAgent:E,Server:w,ServerResponse:b,IncomingMessage:v,ClientRequest:S,OutgoingMessage:y,createServer:k,request:D,get:O};exports.Agent=T,exports.ClientRequest=S,exports.HTTPParser=g,exports.IncomingMessage=v,exports.METHODS=o,exports.STATUS_CODES=s,exports.Server=w,exports.ServerResponse=b,exports._default=A,exports.default=A,exports.createServer=k,exports.get=O,exports.globalAgent=E,exports.request=D,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
|