@powerlines/plugin-automd 0.1.253 → 0.1.255
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/dist/{chunk-BrXtsOCC.cjs → _virtual/rolldown_runtime.cjs} +2 -12
- package/dist/{chunk-CS8OKu3y.mjs → _virtual/rolldown_runtime.mjs} +1 -1
- package/dist/index.cjs +7 -9656
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -9646
- package/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.cjs +78 -0
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +78 -0
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +1 -0
- package/dist/node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/dist/acorn.cjs +5032 -0
- package/dist/node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/dist/acorn.mjs +5032 -0
- package/dist/node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/dist/acorn.mjs.map +1 -0
- package/dist/node_modules/.pnpm/automd@0.4.3_patch_hash_0fe864a2d6fa1461e144747e5f0fbc0a5fb51435ec6b3217ffb18ff2d7058778_magicast@0.5.1/node_modules/automd/dist/index.cjs +650 -0
- package/dist/node_modules/.pnpm/automd@0.4.3_patch_hash_0fe864a2d6fa1461e144747e5f0fbc0a5fb51435ec6b3217ffb18ff2d7058778_magicast@0.5.1/node_modules/automd/dist/index.mjs +648 -0
- package/dist/node_modules/.pnpm/automd@0.4.3_patch_hash_0fe864a2d6fa1461e144747e5f0fbc0a5fb51435ec6b3217ffb18ff2d7058778_magicast@0.5.1/node_modules/automd/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.cjs +23 -0
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.mjs +23 -0
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.mjs.map +1 -0
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.cjs +405 -0
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.mjs +405 -0
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.mjs.map +1 -0
- package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.cjs +46 -0
- package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs +46 -0
- package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.cjs +204 -0
- package/dist/node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.mjs +203 -0
- package/dist/node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.cjs +1013 -0
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs +1008 -0
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.cjs +128 -0
- package/dist/node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.mjs +124 -0
- package/dist/node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.mjs.map +1 -0
- package/dist/{loader-DNEbMIIe.cjs → node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/babel.cjs} +41337 -58245
- package/dist/{loader-BRhKFmUn.mjs → node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/babel.mjs} +41334 -58245
- package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/babel.mjs.map +1 -0
- package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/jiti.cjs +4387 -0
- package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/jiti.mjs +4385 -0
- package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/jiti.mjs.map +1 -0
- package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/lib/jiti.cjs +26 -0
- package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/lib/jiti.mjs +27 -0
- package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/lib/jiti.mjs.map +1 -0
- package/dist/node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.cjs +370 -0
- package/dist/node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.mjs +368 -0
- package/dist/node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.cjs +939 -0
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs +940 -0
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.cjs +67 -0
- package/dist/node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.mjs +65 -0
- package/dist/node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist/index.cjs +1292 -0
- package/dist/node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist/index.mjs +1285 -0
- package/dist/node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist/index.mjs.map +1 -0
- package/dist/{multipart-parser-C_EjwsED.cjs → node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs} +2 -1
- package/dist/{multipart-parser-Dtmz_axo.mjs → node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs} +3 -2
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs.map +1 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.cjs +20 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs +17 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs.map +1 -0
- package/dist/{node-DapIDpAC.cjs → node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.cjs} +808 -857
- package/dist/{node-FGT1CWpL.mjs → node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs} +794 -806
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs.map +1 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.cjs +16 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs +15 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs.map +1 -0
- package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.cjs +36 -0
- package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs +34 -0
- package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs.map +1 -0
- package/dist/{node-CsMhpAoX.cjs → node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.cjs} +24 -66
- package/dist/{node-D8lz5B3d.mjs → node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs} +20 -59
- package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs.map +1 -0
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.cjs +139 -0
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +134 -0
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs.map +1 -0
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.cjs +77 -0
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs +77 -0
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs.map +1 -0
- package/dist/{dist-PRh64A_O.mjs → node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.cjs} +4 -2
- package/dist/{dist-DVv98dZY.cjs → node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs} +2 -19
- package/dist/node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs.map +1 -0
- package/dist/{dist-Jfd0GR_C.mjs → node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.cjs} +4 -46
- package/dist/{dist-8g8frrZv.cjs → node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs} +2 -69
- package/dist/node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/babel.cjs +12337 -0
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/babel.mjs +12338 -0
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/babel.mjs.map +1 -0
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.cjs +19 -0
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.mjs +19 -0
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.mjs.map +1 -0
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.cjs +71 -0
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.mjs +72 -0
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.mjs.map +1 -0
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.cjs +110 -0
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.mjs +101 -0
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.mjs.map +1 -0
- package/dist/types/index.cjs +0 -3
- package/dist/types/index.d.cts +2 -3
- package/dist/types/index.d.mts +2 -3
- package/dist/types/index.mjs +0 -4
- package/dist/types/plugin.cjs +0 -1
- package/dist/types/plugin.d.cts +52 -3
- package/dist/types/plugin.d.cts.map +1 -0
- package/dist/types/plugin.d.mts +52 -3
- package/dist/types/plugin.d.mts.map +1 -0
- package/dist/types/plugin.mjs +0 -2
- package/dist/types/toc.cjs +0 -1
- package/dist/types/toc.d.cts +35 -2
- package/dist/types/toc.d.cts.map +1 -0
- package/dist/types/toc.d.mts +35 -2
- package/dist/types/toc.d.mts.map +1 -0
- package/dist/types/toc.mjs +0 -2
- package/package.json +4 -4
- package/dist/dist-BavrV299.cjs +0 -682
- package/dist/dist-Jfd0GR_C.mjs.map +0 -1
- package/dist/dist-PRh64A_O.mjs.map +0 -1
- package/dist/dist-PXnBmevt.mjs +0 -681
- package/dist/dist-PXnBmevt.mjs.map +0 -1
- package/dist/index-B8OHl-c_.d.mts +0 -1
- package/dist/index-CmCelmEL.d.cts +0 -1
- package/dist/loader-BRhKFmUn.mjs.map +0 -1
- package/dist/multipart-parser-Dtmz_axo.mjs.map +0 -1
- package/dist/node-D8lz5B3d.mjs.map +0 -1
- package/dist/node-FGT1CWpL.mjs.map +0 -1
- package/dist/plugin-BVD0UMjp.d.cts +0 -52
- package/dist/plugin-BVD0UMjp.d.cts.map +0 -1
- package/dist/plugin-C6jB5e_j.d.mts +0 -52
- package/dist/plugin-C6jB5e_j.d.mts.map +0 -1
- package/dist/plugin-Ckx8qAq8.cjs +0 -0
- package/dist/plugin-jZ9N9Mz-.mjs +0 -1
- package/dist/toc-BN2Ji9Yo.d.mts +0 -35
- package/dist/toc-BN2Ji9Yo.d.mts.map +0 -1
- package/dist/toc-BQgoCyR1.cjs +0 -0
- package/dist/toc-BrayIFG6.d.cts +0 -35
- package/dist/toc-BrayIFG6.d.cts.map +0 -1
- package/dist/toc-CBjybXug.mjs +0 -1
- package/dist/types--fVOUYBq.mjs +0 -1
- package/dist/types-D208vOSb.cjs +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_index = require('../../../../node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.cjs');
|
|
3
|
+
const require_ofetch_CWycOUEr = require('./shared/ofetch.CWycOUEr.cjs');
|
|
4
|
+
let node_http = require("node:http");
|
|
5
|
+
node_http = require_rolldown_runtime.__toESM(node_http);
|
|
6
|
+
let node_https = require("node:https");
|
|
7
|
+
node_https = require_rolldown_runtime.__toESM(node_https);
|
|
8
|
+
|
|
9
|
+
//#region ../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs
|
|
10
|
+
function createNodeFetch() {
|
|
11
|
+
if (!JSON.parse(process.env.FETCH_KEEP_ALIVE || "false")) return require_index.r;
|
|
12
|
+
const agentOptions = { keepAlive: true };
|
|
13
|
+
const httpAgent = new node_http.default.Agent(agentOptions);
|
|
14
|
+
const httpsAgent = new node_https.default.Agent(agentOptions);
|
|
15
|
+
const nodeFetchOptions = { agent(parsedURL) {
|
|
16
|
+
return parsedURL.protocol === "http:" ? httpAgent : httpsAgent;
|
|
17
|
+
} };
|
|
18
|
+
return function nodeFetchWithKeepAlive(input, init) {
|
|
19
|
+
return require_index.r(input, {
|
|
20
|
+
...nodeFetchOptions,
|
|
21
|
+
...init
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const fetch = globalThis.fetch ? (...args) => globalThis.fetch(...args) : createNodeFetch();
|
|
26
|
+
const Headers = globalThis.Headers || require_index.n;
|
|
27
|
+
const AbortController = globalThis.AbortController || require_index.T;
|
|
28
|
+
const ofetch = require_ofetch_CWycOUEr.createFetch({
|
|
29
|
+
fetch,
|
|
30
|
+
Headers,
|
|
31
|
+
AbortController
|
|
32
|
+
});
|
|
33
|
+
const $fetch = ofetch;
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
exports.$fetch = $fetch;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { T, n, r } from "../../../../node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs";
|
|
2
|
+
import { FetchError, createFetch, createFetchError } from "./shared/ofetch.CWycOUEr.mjs";
|
|
3
|
+
import http from "node:http";
|
|
4
|
+
import https from "node:https";
|
|
5
|
+
|
|
6
|
+
//#region ../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs
|
|
7
|
+
function createNodeFetch() {
|
|
8
|
+
if (!JSON.parse(process.env.FETCH_KEEP_ALIVE || "false")) return r;
|
|
9
|
+
const agentOptions = { keepAlive: true };
|
|
10
|
+
const httpAgent = new http.Agent(agentOptions);
|
|
11
|
+
const httpsAgent = new https.Agent(agentOptions);
|
|
12
|
+
const nodeFetchOptions = { agent(parsedURL) {
|
|
13
|
+
return parsedURL.protocol === "http:" ? httpAgent : httpsAgent;
|
|
14
|
+
} };
|
|
15
|
+
return function nodeFetchWithKeepAlive(input, init) {
|
|
16
|
+
return r(input, {
|
|
17
|
+
...nodeFetchOptions,
|
|
18
|
+
...init
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const fetch = globalThis.fetch ? (...args) => globalThis.fetch(...args) : createNodeFetch();
|
|
23
|
+
const Headers = globalThis.Headers || n;
|
|
24
|
+
const AbortController = globalThis.AbortController || T;
|
|
25
|
+
const ofetch = createFetch({
|
|
26
|
+
fetch,
|
|
27
|
+
Headers,
|
|
28
|
+
AbortController
|
|
29
|
+
});
|
|
30
|
+
const $fetch = ofetch;
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { $fetch };
|
|
34
|
+
//# sourceMappingURL=node.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.mjs","names":["nodeFetch","Headers$1","AbortController$1"],"sources":["../../../../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs"],"sourcesContent":["import http from 'node:http';\nimport https from 'node:https';\nimport nodeFetch, { AbortController as AbortController$1, Headers as Headers$1 } from 'node-fetch-native';\nimport { c as createFetch } from './shared/ofetch.CWycOUEr.mjs';\nexport { F as FetchError, a as createFetchError } from './shared/ofetch.CWycOUEr.mjs';\nimport 'destr';\nimport 'ufo';\n\nfunction createNodeFetch() {\n const useKeepAlive = JSON.parse(process.env.FETCH_KEEP_ALIVE || \"false\");\n if (!useKeepAlive) {\n return nodeFetch;\n }\n const agentOptions = { keepAlive: true };\n const httpAgent = new http.Agent(agentOptions);\n const httpsAgent = new https.Agent(agentOptions);\n const nodeFetchOptions = {\n agent(parsedURL) {\n return parsedURL.protocol === \"http:\" ? httpAgent : httpsAgent;\n }\n };\n return function nodeFetchWithKeepAlive(input, init) {\n return nodeFetch(input, { ...nodeFetchOptions, ...init });\n };\n}\nconst fetch = globalThis.fetch ? (...args) => globalThis.fetch(...args) : createNodeFetch();\nconst Headers = globalThis.Headers || Headers$1;\nconst AbortController = globalThis.AbortController || AbortController$1;\nconst ofetch = createFetch({ fetch, Headers, AbortController });\nconst $fetch = ofetch;\n\nexport { $fetch, AbortController, Headers, createFetch, createNodeFetch, fetch, ofetch };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;AAQA,SAAS,kBAAkB;AAEzB,KAAI,CADiB,KAAK,MAAM,QAAQ,IAAI,oBAAoB,QAAQ,CAEtE,QAAOA;CAET,MAAM,eAAe,EAAE,WAAW,MAAM;CACxC,MAAM,YAAY,IAAI,KAAK,MAAM,aAAa;CAC9C,MAAM,aAAa,IAAI,MAAM,MAAM,aAAa;CAChD,MAAM,mBAAmB,EACvB,MAAM,WAAW;AACf,SAAO,UAAU,aAAa,UAAU,YAAY;IAEvD;AACD,QAAO,SAAS,uBAAuB,OAAO,MAAM;AAClD,SAAOA,EAAU,OAAO;GAAE,GAAG;GAAkB,GAAG;GAAM,CAAC;;;AAG7D,MAAM,QAAQ,WAAW,SAAS,GAAG,SAAS,WAAW,MAAM,GAAG,KAAK,GAAG,iBAAiB;AAC3F,MAAM,UAAU,WAAW,WAAWC;AACtC,MAAM,kBAAkB,WAAW,mBAAmBC;AACtD,MAAM,SAAS,YAAY;CAAE;CAAO;CAAS;CAAiB,CAAC;AAC/D,MAAM,SAAS"}
|
|
@@ -1,23 +1,6 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const require_node = require('./node-DapIDpAC.cjs');
|
|
4
|
-
let node_fs = require("node:fs");
|
|
5
|
-
let node_url = require("node:url");
|
|
6
|
-
let node_path = require("node:path");
|
|
7
|
-
let node_util = require("node:util");
|
|
8
|
-
let node_http = require("node:http");
|
|
9
|
-
node_http = require_chunk.__toESM(node_http);
|
|
10
|
-
let node_https = require("node:https");
|
|
11
|
-
node_https = require_chunk.__toESM(node_https);
|
|
12
|
-
let node_zlib = require("node:zlib");
|
|
13
|
-
let node_stream = require("node:stream");
|
|
14
|
-
let node_buffer = require("node:buffer");
|
|
15
|
-
let node_net = require("node:net");
|
|
1
|
+
const require_index = require('../../../../../ufo@1.6.3/node_modules/ufo/dist/index.cjs');
|
|
2
|
+
const require_index$1 = require('../../../../../destr@2.0.5/node_modules/destr/dist/index.cjs');
|
|
16
3
|
|
|
17
|
-
//#region ../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs
|
|
18
|
-
const o = !!globalThis.process?.env?.FORCE_NODE_FETCH, r = !o && globalThis.fetch || require_node.Mi, p = !o && globalThis.Blob || require_node.ut, F = !o && globalThis.File || require_node.qn, h = !o && globalThis.FormData || require_node.br, n = !o && globalThis.Headers || require_node.ye, c = !o && globalThis.Request || require_node.dt, R = !o && globalThis.Response || require_node.le, T = !o && globalThis.AbortController || require_node.Mn;
|
|
19
|
-
|
|
20
|
-
//#endregion
|
|
21
4
|
//#region ../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs
|
|
22
5
|
var FetchError = class extends Error {
|
|
23
6
|
constructor(message, opts) {
|
|
@@ -83,8 +66,8 @@ function detectResponseType(_contentType = "") {
|
|
|
83
66
|
if (textTypes.has(contentType) || contentType.startsWith("text/")) return "text";
|
|
84
67
|
return "blob";
|
|
85
68
|
}
|
|
86
|
-
function resolveFetchOptions(request, input, defaults, Headers
|
|
87
|
-
const headers = mergeHeaders(input?.headers ?? request?.headers, defaults?.headers, Headers
|
|
69
|
+
function resolveFetchOptions(request, input, defaults, Headers) {
|
|
70
|
+
const headers = mergeHeaders(input?.headers ?? request?.headers, defaults?.headers, Headers);
|
|
88
71
|
let query;
|
|
89
72
|
if (defaults?.query || defaults?.params || input?.params || input?.query) query = {
|
|
90
73
|
...defaults?.params,
|
|
@@ -100,10 +83,10 @@ function resolveFetchOptions(request, input, defaults, Headers$1) {
|
|
|
100
83
|
headers
|
|
101
84
|
};
|
|
102
85
|
}
|
|
103
|
-
function mergeHeaders(input, defaults, Headers
|
|
104
|
-
if (!defaults) return new Headers
|
|
105
|
-
const headers = new Headers
|
|
106
|
-
if (input) for (const [key, value] of Symbol.iterator in input || Array.isArray(input) ? input : new Headers
|
|
86
|
+
function mergeHeaders(input, defaults, Headers) {
|
|
87
|
+
if (!defaults) return new Headers(input);
|
|
88
|
+
const headers = new Headers(defaults);
|
|
89
|
+
if (input) for (const [key, value] of Symbol.iterator in input || Array.isArray(input) ? input : new Headers(input)) headers.set(key, value);
|
|
107
90
|
return headers;
|
|
108
91
|
}
|
|
109
92
|
async function callHooks(context, hooks) {
|
|
@@ -127,7 +110,7 @@ const nullBodyResponses = /* @__PURE__ */ new Set([
|
|
|
127
110
|
304
|
|
128
111
|
]);
|
|
129
112
|
function createFetch(globalOptions = {}) {
|
|
130
|
-
const { fetch
|
|
113
|
+
const { fetch = globalThis.fetch, Headers = globalThis.Headers, AbortController = globalThis.AbortController } = globalOptions;
|
|
131
114
|
async function onError(context) {
|
|
132
115
|
const isAbort = context.error && context.error.name === "AbortError" && !context.options.timeout || false;
|
|
133
116
|
if (context.options.retry !== false && !isAbort) {
|
|
@@ -151,19 +134,19 @@ function createFetch(globalOptions = {}) {
|
|
|
151
134
|
const $fetchRaw = async function $fetchRaw2(_request, _options = {}) {
|
|
152
135
|
const context = {
|
|
153
136
|
request: _request,
|
|
154
|
-
options: resolveFetchOptions(_request, _options, globalOptions.defaults, Headers
|
|
137
|
+
options: resolveFetchOptions(_request, _options, globalOptions.defaults, Headers),
|
|
155
138
|
response: void 0,
|
|
156
139
|
error: void 0
|
|
157
140
|
};
|
|
158
141
|
if (context.options.method) context.options.method = context.options.method.toUpperCase();
|
|
159
142
|
if (context.options.onRequest) {
|
|
160
143
|
await callHooks(context, context.options.onRequest);
|
|
161
|
-
if (!(context.options.headers instanceof Headers
|
|
144
|
+
if (!(context.options.headers instanceof Headers)) context.options.headers = new Headers(context.options.headers || {});
|
|
162
145
|
}
|
|
163
146
|
if (typeof context.request === "string") {
|
|
164
|
-
if (context.options.baseURL) context.request =
|
|
147
|
+
if (context.options.baseURL) context.request = require_index.withBase(context.request, context.options.baseURL);
|
|
165
148
|
if (context.options.query) {
|
|
166
|
-
context.request =
|
|
149
|
+
context.request = require_index.withQuery(context.request, context.options.query);
|
|
167
150
|
delete context.options.query;
|
|
168
151
|
}
|
|
169
152
|
if ("query" in context.options) delete context.options.query;
|
|
@@ -181,7 +164,7 @@ function createFetch(globalOptions = {}) {
|
|
|
181
164
|
}
|
|
182
165
|
let abortTimeout;
|
|
183
166
|
if (!context.options.signal && context.options.timeout) {
|
|
184
|
-
const controller = new AbortController
|
|
167
|
+
const controller = new AbortController();
|
|
185
168
|
abortTimeout = setTimeout(() => {
|
|
186
169
|
const error = /* @__PURE__ */ new Error("[TimeoutError]: The operation was aborted due to timeout");
|
|
187
170
|
error.name = "TimeoutError";
|
|
@@ -191,7 +174,7 @@ function createFetch(globalOptions = {}) {
|
|
|
191
174
|
context.options.signal = controller.signal;
|
|
192
175
|
}
|
|
193
176
|
try {
|
|
194
|
-
context.response = await fetch
|
|
177
|
+
context.response = await fetch(context.request, context.options);
|
|
195
178
|
} catch (error) {
|
|
196
179
|
context.error = error;
|
|
197
180
|
if (context.options.onRequestError) await callHooks(context, context.options.onRequestError);
|
|
@@ -204,7 +187,7 @@ function createFetch(globalOptions = {}) {
|
|
|
204
187
|
switch (responseType) {
|
|
205
188
|
case "json": {
|
|
206
189
|
const data = await context.response.text();
|
|
207
|
-
const parseFunction = context.options.parseResponse ||
|
|
190
|
+
const parseFunction = context.options.parseResponse || require_index$1.destr;
|
|
208
191
|
context.response._data = parseFunction(data);
|
|
209
192
|
break;
|
|
210
193
|
}
|
|
@@ -221,12 +204,12 @@ function createFetch(globalOptions = {}) {
|
|
|
221
204
|
}
|
|
222
205
|
return context.response;
|
|
223
206
|
};
|
|
224
|
-
const $fetch
|
|
207
|
+
const $fetch = async function $fetch2(request, options) {
|
|
225
208
|
return (await $fetchRaw(request, options))._data;
|
|
226
209
|
};
|
|
227
|
-
$fetch
|
|
228
|
-
$fetch
|
|
229
|
-
$fetch
|
|
210
|
+
$fetch.raw = $fetchRaw;
|
|
211
|
+
$fetch.native = (...args) => fetch(...args);
|
|
212
|
+
$fetch.create = (defaultOptions = {}, customGlobalOptions = {}) => createFetch({
|
|
230
213
|
...globalOptions,
|
|
231
214
|
...customGlobalOptions,
|
|
232
215
|
defaults: {
|
|
@@ -235,35 +218,10 @@ function createFetch(globalOptions = {}) {
|
|
|
235
218
|
...defaultOptions
|
|
236
219
|
}
|
|
237
220
|
});
|
|
238
|
-
return $fetch
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
//#endregion
|
|
242
|
-
//#region ../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs
|
|
243
|
-
function createNodeFetch() {
|
|
244
|
-
if (!JSON.parse(process.env.FETCH_KEEP_ALIVE || "false")) return r;
|
|
245
|
-
const agentOptions = { keepAlive: true };
|
|
246
|
-
const httpAgent = new node_http.default.Agent(agentOptions);
|
|
247
|
-
const httpsAgent = new node_https.default.Agent(agentOptions);
|
|
248
|
-
const nodeFetchOptions = { agent(parsedURL) {
|
|
249
|
-
return parsedURL.protocol === "http:" ? httpAgent : httpsAgent;
|
|
250
|
-
} };
|
|
251
|
-
return function nodeFetchWithKeepAlive(input, init) {
|
|
252
|
-
return r(input, {
|
|
253
|
-
...nodeFetchOptions,
|
|
254
|
-
...init
|
|
255
|
-
});
|
|
256
|
-
};
|
|
221
|
+
return $fetch;
|
|
257
222
|
}
|
|
258
|
-
const fetch = globalThis.fetch ? (...args) => globalThis.fetch(...args) : createNodeFetch();
|
|
259
|
-
const Headers = globalThis.Headers || n;
|
|
260
|
-
const AbortController = globalThis.AbortController || T;
|
|
261
|
-
const ofetch = createFetch({
|
|
262
|
-
fetch,
|
|
263
|
-
Headers,
|
|
264
|
-
AbortController
|
|
265
|
-
});
|
|
266
|
-
const $fetch = ofetch;
|
|
267
223
|
|
|
268
224
|
//#endregion
|
|
269
|
-
exports
|
|
225
|
+
exports.FetchError = FetchError;
|
|
226
|
+
exports.createFetch = createFetch;
|
|
227
|
+
exports.createFetchError = createFetchError;
|
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "node:fs";
|
|
4
|
-
import "node:util";
|
|
5
|
-
import http from "node:http";
|
|
6
|
-
import https from "node:https";
|
|
7
|
-
import "node:zlib";
|
|
8
|
-
import "node:stream";
|
|
9
|
-
import "node:buffer";
|
|
10
|
-
import "node:net";
|
|
1
|
+
import { withBase, withQuery } from "../../../../../ufo@1.6.3/node_modules/ufo/dist/index.mjs";
|
|
2
|
+
import { destr } from "../../../../../destr@2.0.5/node_modules/destr/dist/index.mjs";
|
|
11
3
|
|
|
12
|
-
//#region ../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs
|
|
13
|
-
const o = !!globalThis.process?.env?.FORCE_NODE_FETCH, r = !o && globalThis.fetch || Mi, p = !o && globalThis.Blob || ut, F = !o && globalThis.File || qn, h = !o && globalThis.FormData || br, n = !o && globalThis.Headers || ye, c = !o && globalThis.Request || dt, R = !o && globalThis.Response || le, T = !o && globalThis.AbortController || Mn;
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
4
|
//#region ../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs
|
|
17
5
|
var FetchError = class extends Error {
|
|
18
6
|
constructor(message, opts) {
|
|
@@ -78,8 +66,8 @@ function detectResponseType(_contentType = "") {
|
|
|
78
66
|
if (textTypes.has(contentType) || contentType.startsWith("text/")) return "text";
|
|
79
67
|
return "blob";
|
|
80
68
|
}
|
|
81
|
-
function resolveFetchOptions(request, input, defaults, Headers
|
|
82
|
-
const headers = mergeHeaders(input?.headers ?? request?.headers, defaults?.headers, Headers
|
|
69
|
+
function resolveFetchOptions(request, input, defaults, Headers) {
|
|
70
|
+
const headers = mergeHeaders(input?.headers ?? request?.headers, defaults?.headers, Headers);
|
|
83
71
|
let query;
|
|
84
72
|
if (defaults?.query || defaults?.params || input?.params || input?.query) query = {
|
|
85
73
|
...defaults?.params,
|
|
@@ -95,10 +83,10 @@ function resolveFetchOptions(request, input, defaults, Headers$1) {
|
|
|
95
83
|
headers
|
|
96
84
|
};
|
|
97
85
|
}
|
|
98
|
-
function mergeHeaders(input, defaults, Headers
|
|
99
|
-
if (!defaults) return new Headers
|
|
100
|
-
const headers = new Headers
|
|
101
|
-
if (input) for (const [key, value] of Symbol.iterator in input || Array.isArray(input) ? input : new Headers
|
|
86
|
+
function mergeHeaders(input, defaults, Headers) {
|
|
87
|
+
if (!defaults) return new Headers(input);
|
|
88
|
+
const headers = new Headers(defaults);
|
|
89
|
+
if (input) for (const [key, value] of Symbol.iterator in input || Array.isArray(input) ? input : new Headers(input)) headers.set(key, value);
|
|
102
90
|
return headers;
|
|
103
91
|
}
|
|
104
92
|
async function callHooks(context, hooks) {
|
|
@@ -122,7 +110,7 @@ const nullBodyResponses = /* @__PURE__ */ new Set([
|
|
|
122
110
|
304
|
|
123
111
|
]);
|
|
124
112
|
function createFetch(globalOptions = {}) {
|
|
125
|
-
const { fetch
|
|
113
|
+
const { fetch = globalThis.fetch, Headers = globalThis.Headers, AbortController = globalThis.AbortController } = globalOptions;
|
|
126
114
|
async function onError(context) {
|
|
127
115
|
const isAbort = context.error && context.error.name === "AbortError" && !context.options.timeout || false;
|
|
128
116
|
if (context.options.retry !== false && !isAbort) {
|
|
@@ -146,14 +134,14 @@ function createFetch(globalOptions = {}) {
|
|
|
146
134
|
const $fetchRaw = async function $fetchRaw2(_request, _options = {}) {
|
|
147
135
|
const context = {
|
|
148
136
|
request: _request,
|
|
149
|
-
options: resolveFetchOptions(_request, _options, globalOptions.defaults, Headers
|
|
137
|
+
options: resolveFetchOptions(_request, _options, globalOptions.defaults, Headers),
|
|
150
138
|
response: void 0,
|
|
151
139
|
error: void 0
|
|
152
140
|
};
|
|
153
141
|
if (context.options.method) context.options.method = context.options.method.toUpperCase();
|
|
154
142
|
if (context.options.onRequest) {
|
|
155
143
|
await callHooks(context, context.options.onRequest);
|
|
156
|
-
if (!(context.options.headers instanceof Headers
|
|
144
|
+
if (!(context.options.headers instanceof Headers)) context.options.headers = new Headers(context.options.headers || {});
|
|
157
145
|
}
|
|
158
146
|
if (typeof context.request === "string") {
|
|
159
147
|
if (context.options.baseURL) context.request = withBase(context.request, context.options.baseURL);
|
|
@@ -176,7 +164,7 @@ function createFetch(globalOptions = {}) {
|
|
|
176
164
|
}
|
|
177
165
|
let abortTimeout;
|
|
178
166
|
if (!context.options.signal && context.options.timeout) {
|
|
179
|
-
const controller = new AbortController
|
|
167
|
+
const controller = new AbortController();
|
|
180
168
|
abortTimeout = setTimeout(() => {
|
|
181
169
|
const error = /* @__PURE__ */ new Error("[TimeoutError]: The operation was aborted due to timeout");
|
|
182
170
|
error.name = "TimeoutError";
|
|
@@ -186,7 +174,7 @@ function createFetch(globalOptions = {}) {
|
|
|
186
174
|
context.options.signal = controller.signal;
|
|
187
175
|
}
|
|
188
176
|
try {
|
|
189
|
-
context.response = await fetch
|
|
177
|
+
context.response = await fetch(context.request, context.options);
|
|
190
178
|
} catch (error) {
|
|
191
179
|
context.error = error;
|
|
192
180
|
if (context.options.onRequestError) await callHooks(context, context.options.onRequestError);
|
|
@@ -216,12 +204,12 @@ function createFetch(globalOptions = {}) {
|
|
|
216
204
|
}
|
|
217
205
|
return context.response;
|
|
218
206
|
};
|
|
219
|
-
const $fetch
|
|
207
|
+
const $fetch = async function $fetch2(request, options) {
|
|
220
208
|
return (await $fetchRaw(request, options))._data;
|
|
221
209
|
};
|
|
222
|
-
$fetch
|
|
223
|
-
$fetch
|
|
224
|
-
$fetch
|
|
210
|
+
$fetch.raw = $fetchRaw;
|
|
211
|
+
$fetch.native = (...args) => fetch(...args);
|
|
212
|
+
$fetch.create = (defaultOptions = {}, customGlobalOptions = {}) => createFetch({
|
|
225
213
|
...globalOptions,
|
|
226
214
|
...customGlobalOptions,
|
|
227
215
|
defaults: {
|
|
@@ -230,36 +218,9 @@ function createFetch(globalOptions = {}) {
|
|
|
230
218
|
...defaultOptions
|
|
231
219
|
}
|
|
232
220
|
});
|
|
233
|
-
return $fetch
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
//#endregion
|
|
237
|
-
//#region ../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs
|
|
238
|
-
function createNodeFetch() {
|
|
239
|
-
if (!JSON.parse(process.env.FETCH_KEEP_ALIVE || "false")) return r;
|
|
240
|
-
const agentOptions = { keepAlive: true };
|
|
241
|
-
const httpAgent = new http.Agent(agentOptions);
|
|
242
|
-
const httpsAgent = new https.Agent(agentOptions);
|
|
243
|
-
const nodeFetchOptions = { agent(parsedURL) {
|
|
244
|
-
return parsedURL.protocol === "http:" ? httpAgent : httpsAgent;
|
|
245
|
-
} };
|
|
246
|
-
return function nodeFetchWithKeepAlive(input, init) {
|
|
247
|
-
return r(input, {
|
|
248
|
-
...nodeFetchOptions,
|
|
249
|
-
...init
|
|
250
|
-
});
|
|
251
|
-
};
|
|
221
|
+
return $fetch;
|
|
252
222
|
}
|
|
253
|
-
const fetch = globalThis.fetch ? (...args) => globalThis.fetch(...args) : createNodeFetch();
|
|
254
|
-
const Headers = globalThis.Headers || n;
|
|
255
|
-
const AbortController = globalThis.AbortController || T;
|
|
256
|
-
const ofetch = createFetch({
|
|
257
|
-
fetch,
|
|
258
|
-
Headers,
|
|
259
|
-
AbortController
|
|
260
|
-
});
|
|
261
|
-
const $fetch = ofetch;
|
|
262
223
|
|
|
263
224
|
//#endregion
|
|
264
|
-
export {
|
|
265
|
-
//# sourceMappingURL=
|
|
225
|
+
export { FetchError, createFetch, createFetchError };
|
|
226
|
+
//# sourceMappingURL=ofetch.CWycOUEr.mjs.map
|
package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ofetch.CWycOUEr.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs"],"sourcesContent":["import destr from 'destr';\nimport { withBase, withQuery } from 'ufo';\n\nclass FetchError extends Error {\n constructor(message, opts) {\n super(message, opts);\n this.name = \"FetchError\";\n if (opts?.cause && !this.cause) {\n this.cause = opts.cause;\n }\n }\n}\nfunction createFetchError(ctx) {\n const errorMessage = ctx.error?.message || ctx.error?.toString() || \"\";\n const method = ctx.request?.method || ctx.options?.method || \"GET\";\n const url = ctx.request?.url || String(ctx.request) || \"/\";\n const requestStr = `[${method}] ${JSON.stringify(url)}`;\n const statusStr = ctx.response ? `${ctx.response.status} ${ctx.response.statusText}` : \"<no response>\";\n const message = `${requestStr}: ${statusStr}${errorMessage ? ` ${errorMessage}` : \"\"}`;\n const fetchError = new FetchError(\n message,\n ctx.error ? { cause: ctx.error } : void 0\n );\n for (const key of [\"request\", \"options\", \"response\"]) {\n Object.defineProperty(fetchError, key, {\n get() {\n return ctx[key];\n }\n });\n }\n for (const [key, refKey] of [\n [\"data\", \"_data\"],\n [\"status\", \"status\"],\n [\"statusCode\", \"status\"],\n [\"statusText\", \"statusText\"],\n [\"statusMessage\", \"statusText\"]\n ]) {\n Object.defineProperty(fetchError, key, {\n get() {\n return ctx.response && ctx.response[refKey];\n }\n });\n }\n return fetchError;\n}\n\nconst payloadMethods = new Set(\n Object.freeze([\"PATCH\", \"POST\", \"PUT\", \"DELETE\"])\n);\nfunction isPayloadMethod(method = \"GET\") {\n return payloadMethods.has(method.toUpperCase());\n}\nfunction isJSONSerializable(value) {\n if (value === void 0) {\n return false;\n }\n const t = typeof value;\n if (t === \"string\" || t === \"number\" || t === \"boolean\" || t === null) {\n return true;\n }\n if (t !== \"object\") {\n return false;\n }\n if (Array.isArray(value)) {\n return true;\n }\n if (value.buffer) {\n return false;\n }\n if (value instanceof FormData || value instanceof URLSearchParams) {\n return false;\n }\n return value.constructor && value.constructor.name === \"Object\" || typeof value.toJSON === \"function\";\n}\nconst textTypes = /* @__PURE__ */ new Set([\n \"image/svg\",\n \"application/xml\",\n \"application/xhtml\",\n \"application/html\"\n]);\nconst JSON_RE = /^application\\/(?:[\\w!#$%&*.^`~-]*\\+)?json(;.+)?$/i;\nfunction detectResponseType(_contentType = \"\") {\n if (!_contentType) {\n return \"json\";\n }\n const contentType = _contentType.split(\";\").shift() || \"\";\n if (JSON_RE.test(contentType)) {\n return \"json\";\n }\n if (contentType === \"text/event-stream\") {\n return \"stream\";\n }\n if (textTypes.has(contentType) || contentType.startsWith(\"text/\")) {\n return \"text\";\n }\n return \"blob\";\n}\nfunction resolveFetchOptions(request, input, defaults, Headers) {\n const headers = mergeHeaders(\n input?.headers ?? request?.headers,\n defaults?.headers,\n Headers\n );\n let query;\n if (defaults?.query || defaults?.params || input?.params || input?.query) {\n query = {\n ...defaults?.params,\n ...defaults?.query,\n ...input?.params,\n ...input?.query\n };\n }\n return {\n ...defaults,\n ...input,\n query,\n params: query,\n headers\n };\n}\nfunction mergeHeaders(input, defaults, Headers) {\n if (!defaults) {\n return new Headers(input);\n }\n const headers = new Headers(defaults);\n if (input) {\n for (const [key, value] of Symbol.iterator in input || Array.isArray(input) ? input : new Headers(input)) {\n headers.set(key, value);\n }\n }\n return headers;\n}\nasync function callHooks(context, hooks) {\n if (hooks) {\n if (Array.isArray(hooks)) {\n for (const hook of hooks) {\n await hook(context);\n }\n } else {\n await hooks(context);\n }\n }\n}\n\nconst retryStatusCodes = /* @__PURE__ */ new Set([\n 408,\n // Request Timeout\n 409,\n // Conflict\n 425,\n // Too Early (Experimental)\n 429,\n // Too Many Requests\n 500,\n // Internal Server Error\n 502,\n // Bad Gateway\n 503,\n // Service Unavailable\n 504\n // Gateway Timeout\n]);\nconst nullBodyResponses = /* @__PURE__ */ new Set([101, 204, 205, 304]);\nfunction createFetch(globalOptions = {}) {\n const {\n fetch = globalThis.fetch,\n Headers = globalThis.Headers,\n AbortController = globalThis.AbortController\n } = globalOptions;\n async function onError(context) {\n const isAbort = context.error && context.error.name === \"AbortError\" && !context.options.timeout || false;\n if (context.options.retry !== false && !isAbort) {\n let retries;\n if (typeof context.options.retry === \"number\") {\n retries = context.options.retry;\n } else {\n retries = isPayloadMethod(context.options.method) ? 0 : 1;\n }\n const responseCode = context.response && context.response.status || 500;\n if (retries > 0 && (Array.isArray(context.options.retryStatusCodes) ? context.options.retryStatusCodes.includes(responseCode) : retryStatusCodes.has(responseCode))) {\n const retryDelay = typeof context.options.retryDelay === \"function\" ? context.options.retryDelay(context) : context.options.retryDelay || 0;\n if (retryDelay > 0) {\n await new Promise((resolve) => setTimeout(resolve, retryDelay));\n }\n return $fetchRaw(context.request, {\n ...context.options,\n retry: retries - 1\n });\n }\n }\n const error = createFetchError(context);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(error, $fetchRaw);\n }\n throw error;\n }\n const $fetchRaw = async function $fetchRaw2(_request, _options = {}) {\n const context = {\n request: _request,\n options: resolveFetchOptions(\n _request,\n _options,\n globalOptions.defaults,\n Headers\n ),\n response: void 0,\n error: void 0\n };\n if (context.options.method) {\n context.options.method = context.options.method.toUpperCase();\n }\n if (context.options.onRequest) {\n await callHooks(context, context.options.onRequest);\n if (!(context.options.headers instanceof Headers)) {\n context.options.headers = new Headers(\n context.options.headers || {}\n /* compat */\n );\n }\n }\n if (typeof context.request === \"string\") {\n if (context.options.baseURL) {\n context.request = withBase(context.request, context.options.baseURL);\n }\n if (context.options.query) {\n context.request = withQuery(context.request, context.options.query);\n delete context.options.query;\n }\n if (\"query\" in context.options) {\n delete context.options.query;\n }\n if (\"params\" in context.options) {\n delete context.options.params;\n }\n }\n if (context.options.body && isPayloadMethod(context.options.method)) {\n if (isJSONSerializable(context.options.body)) {\n const contentType = context.options.headers.get(\"content-type\");\n if (typeof context.options.body !== \"string\") {\n context.options.body = contentType === \"application/x-www-form-urlencoded\" ? new URLSearchParams(\n context.options.body\n ).toString() : JSON.stringify(context.options.body);\n }\n if (!contentType) {\n context.options.headers.set(\"content-type\", \"application/json\");\n }\n if (!context.options.headers.has(\"accept\")) {\n context.options.headers.set(\"accept\", \"application/json\");\n }\n } else if (\n // ReadableStream Body\n \"pipeTo\" in context.options.body && typeof context.options.body.pipeTo === \"function\" || // Node.js Stream Body\n typeof context.options.body.pipe === \"function\"\n ) {\n if (!(\"duplex\" in context.options)) {\n context.options.duplex = \"half\";\n }\n }\n }\n let abortTimeout;\n if (!context.options.signal && context.options.timeout) {\n const controller = new AbortController();\n abortTimeout = setTimeout(() => {\n const error = new Error(\n \"[TimeoutError]: The operation was aborted due to timeout\"\n );\n error.name = \"TimeoutError\";\n error.code = 23;\n controller.abort(error);\n }, context.options.timeout);\n context.options.signal = controller.signal;\n }\n try {\n context.response = await fetch(\n context.request,\n context.options\n );\n } catch (error) {\n context.error = error;\n if (context.options.onRequestError) {\n await callHooks(\n context,\n context.options.onRequestError\n );\n }\n return await onError(context);\n } finally {\n if (abortTimeout) {\n clearTimeout(abortTimeout);\n }\n }\n const hasBody = (context.response.body || // https://github.com/unjs/ofetch/issues/324\n // https://github.com/unjs/ofetch/issues/294\n // https://github.com/JakeChampion/fetch/issues/1454\n context.response._bodyInit) && !nullBodyResponses.has(context.response.status) && context.options.method !== \"HEAD\";\n if (hasBody) {\n const responseType = (context.options.parseResponse ? \"json\" : context.options.responseType) || detectResponseType(context.response.headers.get(\"content-type\") || \"\");\n switch (responseType) {\n case \"json\": {\n const data = await context.response.text();\n const parseFunction = context.options.parseResponse || destr;\n context.response._data = parseFunction(data);\n break;\n }\n case \"stream\": {\n context.response._data = context.response.body || context.response._bodyInit;\n break;\n }\n default: {\n context.response._data = await context.response[responseType]();\n }\n }\n }\n if (context.options.onResponse) {\n await callHooks(\n context,\n context.options.onResponse\n );\n }\n if (!context.options.ignoreResponseError && context.response.status >= 400 && context.response.status < 600) {\n if (context.options.onResponseError) {\n await callHooks(\n context,\n context.options.onResponseError\n );\n }\n return await onError(context);\n }\n return context.response;\n };\n const $fetch = async function $fetch2(request, options) {\n const r = await $fetchRaw(request, options);\n return r._data;\n };\n $fetch.raw = $fetchRaw;\n $fetch.native = (...args) => fetch(...args);\n $fetch.create = (defaultOptions = {}, customGlobalOptions = {}) => createFetch({\n ...globalOptions,\n ...customGlobalOptions,\n defaults: {\n ...globalOptions.defaults,\n ...customGlobalOptions.defaults,\n ...defaultOptions\n }\n });\n return $fetch;\n}\n\nexport { FetchError as F, createFetchError as a, createFetch as c };\n"],"x_google_ignoreList":[0],"mappings":";;;;AAGA,IAAM,aAAN,cAAyB,MAAM;CAC7B,YAAY,SAAS,MAAM;AACzB,QAAM,SAAS,KAAK;AACpB,OAAK,OAAO;AACZ,MAAI,MAAM,SAAS,CAAC,KAAK,MACvB,MAAK,QAAQ,KAAK;;;AAIxB,SAAS,iBAAiB,KAAK;CAC7B,MAAM,eAAe,IAAI,OAAO,WAAW,IAAI,OAAO,UAAU,IAAI;CACpE,MAAM,SAAS,IAAI,SAAS,UAAU,IAAI,SAAS,UAAU;CAC7D,MAAM,MAAM,IAAI,SAAS,OAAO,OAAO,IAAI,QAAQ,IAAI;CAIvD,MAAM,aAAa,IAAI,WADP,GAFG,IAAI,OAAO,IAAI,KAAK,UAAU,IAAI,GAEvB,IADZ,IAAI,WAAW,GAAG,IAAI,SAAS,OAAO,GAAG,IAAI,SAAS,eAA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AAO,MAAM;AACb,QAAO,UAAU,GAAG,SAAS,MAAM,GAAG,KAAK;AAC3C,QAAO,UAAU,iBAAiB,EAAE,EAAE,sBAAsB,EAAE,KAAK,YAAY;EAC7E,GAAG;EACH,GAAG;EACH,UAAU;GACR,GAAG,cAAc;GACjB,GAAG,oBAAoB;GACvB,GAAG;GACJ;EACF,CAAC;AACF,QAAO"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
|
|
2
|
+
//#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
3
|
+
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
4
|
+
function normalizeWindowsPath(input = "") {
|
|
5
|
+
if (!input) return input;
|
|
6
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
7
|
+
}
|
|
8
|
+
const _UNC_REGEX = /^[/\\]{2}/;
|
|
9
|
+
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
10
|
+
const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
11
|
+
const _EXTNAME_RE = /.(\.[^./]+|\.)$/;
|
|
12
|
+
const normalize = function(path) {
|
|
13
|
+
if (path.length === 0) return ".";
|
|
14
|
+
path = normalizeWindowsPath(path);
|
|
15
|
+
const isUNCPath = path.match(_UNC_REGEX);
|
|
16
|
+
const isPathAbsolute = isAbsolute(path);
|
|
17
|
+
const trailingSeparator = path[path.length - 1] === "/";
|
|
18
|
+
path = normalizeString(path, !isPathAbsolute);
|
|
19
|
+
if (path.length === 0) {
|
|
20
|
+
if (isPathAbsolute) return "/";
|
|
21
|
+
return trailingSeparator ? "./" : ".";
|
|
22
|
+
}
|
|
23
|
+
if (trailingSeparator) path += "/";
|
|
24
|
+
if (_DRIVE_LETTER_RE.test(path)) path += "/";
|
|
25
|
+
if (isUNCPath) {
|
|
26
|
+
if (!isPathAbsolute) return `//./${path}`;
|
|
27
|
+
return `//${path}`;
|
|
28
|
+
}
|
|
29
|
+
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
30
|
+
};
|
|
31
|
+
const join = function(...segments) {
|
|
32
|
+
let path = "";
|
|
33
|
+
for (const seg of segments) {
|
|
34
|
+
if (!seg) continue;
|
|
35
|
+
if (path.length > 0) {
|
|
36
|
+
const pathTrailing = path[path.length - 1] === "/";
|
|
37
|
+
const segLeading = seg[0] === "/";
|
|
38
|
+
if (pathTrailing && segLeading) path += seg.slice(1);
|
|
39
|
+
else path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
40
|
+
} else path += seg;
|
|
41
|
+
}
|
|
42
|
+
return normalize(path);
|
|
43
|
+
};
|
|
44
|
+
function cwd() {
|
|
45
|
+
if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
|
|
46
|
+
return "/";
|
|
47
|
+
}
|
|
48
|
+
const resolve = function(...arguments_) {
|
|
49
|
+
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
50
|
+
let resolvedPath = "";
|
|
51
|
+
let resolvedAbsolute = false;
|
|
52
|
+
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
53
|
+
const path = index >= 0 ? arguments_[index] : cwd();
|
|
54
|
+
if (!path || path.length === 0) continue;
|
|
55
|
+
resolvedPath = `${path}/${resolvedPath}`;
|
|
56
|
+
resolvedAbsolute = isAbsolute(path);
|
|
57
|
+
}
|
|
58
|
+
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
59
|
+
if (resolvedAbsolute && !isAbsolute(resolvedPath)) return `/${resolvedPath}`;
|
|
60
|
+
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
61
|
+
};
|
|
62
|
+
function normalizeString(path, allowAboveRoot) {
|
|
63
|
+
let res = "";
|
|
64
|
+
let lastSegmentLength = 0;
|
|
65
|
+
let lastSlash = -1;
|
|
66
|
+
let dots = 0;
|
|
67
|
+
let char = null;
|
|
68
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
69
|
+
if (index < path.length) char = path[index];
|
|
70
|
+
else if (char === "/") break;
|
|
71
|
+
else char = "/";
|
|
72
|
+
if (char === "/") {
|
|
73
|
+
if (lastSlash === index - 1 || dots === 1);
|
|
74
|
+
else if (dots === 2) {
|
|
75
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
76
|
+
if (res.length > 2) {
|
|
77
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
78
|
+
if (lastSlashIndex === -1) {
|
|
79
|
+
res = "";
|
|
80
|
+
lastSegmentLength = 0;
|
|
81
|
+
} else {
|
|
82
|
+
res = res.slice(0, lastSlashIndex);
|
|
83
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
84
|
+
}
|
|
85
|
+
lastSlash = index;
|
|
86
|
+
dots = 0;
|
|
87
|
+
continue;
|
|
88
|
+
} else if (res.length > 0) {
|
|
89
|
+
res = "";
|
|
90
|
+
lastSegmentLength = 0;
|
|
91
|
+
lastSlash = index;
|
|
92
|
+
dots = 0;
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (allowAboveRoot) {
|
|
97
|
+
res += res.length > 0 ? "/.." : "..";
|
|
98
|
+
lastSegmentLength = 2;
|
|
99
|
+
}
|
|
100
|
+
} else {
|
|
101
|
+
if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
|
|
102
|
+
else res = path.slice(lastSlash + 1, index);
|
|
103
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
104
|
+
}
|
|
105
|
+
lastSlash = index;
|
|
106
|
+
dots = 0;
|
|
107
|
+
} else if (char === "." && dots !== -1) ++dots;
|
|
108
|
+
else dots = -1;
|
|
109
|
+
}
|
|
110
|
+
return res;
|
|
111
|
+
}
|
|
112
|
+
const isAbsolute = function(p) {
|
|
113
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
114
|
+
};
|
|
115
|
+
const extname = function(p) {
|
|
116
|
+
if (p === "..") return "";
|
|
117
|
+
const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
|
118
|
+
return match && match[1] || "";
|
|
119
|
+
};
|
|
120
|
+
const basename = function(p, extension) {
|
|
121
|
+
const segments = normalizeWindowsPath(p).split("/");
|
|
122
|
+
let lastSegment = "";
|
|
123
|
+
for (let i = segments.length - 1; i >= 0; i--) {
|
|
124
|
+
const val = segments[i];
|
|
125
|
+
if (val) {
|
|
126
|
+
lastSegment = val;
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
//#endregion
|
|
134
|
+
exports.basename = basename;
|
|
135
|
+
exports.extname = extname;
|
|
136
|
+
exports.isAbsolute = isAbsolute;
|
|
137
|
+
exports.join = join;
|
|
138
|
+
exports.normalize = normalize;
|
|
139
|
+
exports.resolve = resolve;
|