@genapi/presets 3.4.0 → 3.6.0
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/axios/index.d.mts +9 -0
- package/dist/axios/index.mjs +9 -7
- package/dist/axios/js/config/index.d.mts +3 -0
- package/dist/axios/js/config/index.mjs +3 -18
- package/dist/axios/js/index.d.mts +5 -0
- package/dist/axios/js/index.mjs +5 -31
- package/dist/axios/js/parser/index.d.mts +3 -0
- package/dist/axios/js/parser/index.mjs +3 -77
- package/dist/axios/ts/config/index.d.mts +3 -0
- package/dist/axios/ts/config/index.mjs +3 -22
- package/dist/axios/ts/index.d.mts +5 -0
- package/dist/axios/ts/index.mjs +5 -31
- package/dist/axios/ts/parser/index.d.mts +3 -0
- package/dist/axios/ts/parser/index.mjs +3 -76
- package/dist/axios-CG6HLmR9.mjs +13 -0
- package/dist/chunk-BL35Yyzp.mjs +12 -0
- package/dist/config-B6UDPRkS.mjs +12 -0
- package/dist/config-B89EoGE7.mjs +21 -0
- package/dist/config-BGwXcXx1.mjs +21 -0
- package/dist/config-C94x0Nge.mjs +21 -0
- package/dist/config-CEngTpXa.mjs +21 -0
- package/dist/config-CwmGeydd.mjs +19 -0
- package/dist/config-DAHoeaDU.mjs +19 -0
- package/dist/config-DdUVYIe0.mjs +19 -0
- package/dist/config-Dm0OCPw8.mjs +19 -0
- package/dist/config-Dn-mxTew.mjs +19 -0
- package/dist/config-DuQgIn7U.mjs +14 -0
- package/dist/config-aVU8JEKy.mjs +21 -0
- package/dist/fetch/index.d.mts +9 -0
- package/dist/fetch/index.mjs +9 -7
- package/dist/fetch/js/config/index.d.mts +3 -0
- package/dist/fetch/js/config/index.mjs +3 -13
- package/dist/fetch/js/index.d.mts +5 -0
- package/dist/fetch/js/index.mjs +5 -31
- package/dist/fetch/js/parser/index.d.mts +3 -0
- package/dist/fetch/js/parser/index.mjs +3 -83
- package/dist/fetch/ts/config/index.d.mts +3 -0
- package/dist/fetch/ts/config/index.mjs +3 -11
- package/dist/fetch/ts/index.d.mts +5 -0
- package/dist/fetch/ts/index.mjs +5 -31
- package/dist/fetch/ts/parser/index.d.mts +3 -0
- package/dist/fetch/ts/parser/index.mjs +3 -79
- package/dist/fetch-BtwC6Lll.mjs +13 -0
- package/dist/got/index.d.mts +9 -0
- package/dist/got/index.mjs +9 -7
- package/dist/got/js/config/index.d.mts +3 -0
- package/dist/got/js/config/index.mjs +3 -18
- package/dist/got/js/index.d.mts +5 -0
- package/dist/got/js/index.mjs +5 -31
- package/dist/got/js/parser/index.d.mts +3 -0
- package/dist/got/js/parser/index.mjs +3 -82
- package/dist/got/ts/config/index.d.mts +3 -0
- package/dist/got/ts/config/index.mjs +3 -22
- package/dist/got/ts/index.d.mts +5 -0
- package/dist/got/ts/index.mjs +5 -31
- package/dist/got/ts/parser/index.d.mts +3 -0
- package/dist/got/ts/parser/index.mjs +3 -82
- package/dist/got-xeCavgZc.mjs +13 -0
- package/dist/{axios/js/parser/index.d.ts → index.d-4OvQY24D.d.mts} +5 -3
- package/dist/index.d-B0n5Pe6-.d.mts +12 -0
- package/dist/index.d-B1KgwGJV.d.mts +14 -0
- package/dist/index.d-B9C3SJsw.d.mts +7 -0
- package/dist/index.d-BB-bpoWw.d.mts +14 -0
- package/dist/index.d-BDMFuIpi.d.mts +12 -0
- package/dist/index.d-BDy4V2O7.d.mts +18 -0
- package/dist/index.d-BFJinzUY.d.mts +12 -0
- package/dist/index.d-BS6Sm47l.d.mts +18 -0
- package/dist/index.d-BSQRPGuK.d.mts +18 -0
- package/dist/index.d-BXgDnKDv.d.mts +7 -0
- package/dist/{axios/ts/parser/index.d.ts → index.d-BYOoHBar.d.mts} +5 -3
- package/dist/index.d-BahMmqz0.d.mts +18 -0
- package/dist/index.d-BbxRLLMX.d.mts +12 -0
- package/dist/index.d-BguloXfs.d.mts +7 -0
- package/dist/index.d-BgvbkDJL.d.mts +18 -0
- package/dist/index.d-Bknp-d4G.d.mts +14 -0
- package/dist/index.d-BulZ76hJ.d.mts +18 -0
- package/dist/index.d-BupSEh4R.d.mts +18 -0
- package/dist/index.d-CAirdOCT.d.mts +14 -0
- package/dist/index.d-CDf5ausb.d.mts +12 -0
- package/dist/index.d-CN37Zl7u.d.mts +14 -0
- package/dist/index.d-CVL676ax.d.mts +18 -0
- package/dist/index.d-Cb9k2mo6.d.mts +7 -0
- package/dist/index.d-CdRfZiCo.d.mts +18 -0
- package/dist/index.d-CfS61_iH.d.mts +7 -0
- package/dist/index.d-Ckbfjm0G.d.mts +7 -0
- package/dist/index.d-CljgOS4p.d.mts +18 -0
- package/dist/{fetch/js/parser/index.d.ts → index.d-D1pp_HCy.d.mts} +5 -3
- package/dist/index.d-D33XWXy5.d.mts +14 -0
- package/dist/index.d-D6gcSlpm.d.mts +14 -0
- package/dist/index.d-DCtFuYUN.d.mts +18 -0
- package/dist/index.d-DQZa03Va.d.mts +7 -0
- package/dist/index.d-DW8ts-IU.d.mts +14 -0
- package/dist/index.d-D_aZcN-0.d.mts +7 -0
- package/dist/index.d-DgggRtXp.d.mts +7 -0
- package/dist/index.d-DpLq-R_p.d.mts +12 -0
- package/dist/index.d-DrCRTA_-.d.mts +7 -0
- package/dist/index.d-DuVpMG8_.d.mts +18 -0
- package/dist/{fetch/ts/parser/index.d.ts → index.d-KQGa1SFg.d.mts} +5 -3
- package/dist/index.d-O3Nkol5h.d.mts +7 -0
- package/dist/index.d-lzQFIw8d.d.mts +7 -0
- package/dist/index.d.mts +55 -0
- package/dist/index.mjs +54 -20
- package/dist/js-CfKFwY21.mjs +19 -0
- package/dist/js-DGjfw_hH.mjs +19 -0
- package/dist/js-DwgoBEjQ.mjs +19 -0
- package/dist/js-DxwOJyF7.mjs +19 -0
- package/dist/js-nNB2l-OU.mjs +19 -0
- package/dist/js-uo8fh9bT.mjs +19 -0
- package/dist/ky/index.d.mts +9 -0
- package/dist/ky/index.mjs +9 -7
- package/dist/ky/js/config/index.d.mts +3 -0
- package/dist/ky/js/config/index.mjs +3 -18
- package/dist/ky/js/index.d.mts +5 -0
- package/dist/ky/js/index.mjs +5 -31
- package/dist/ky/js/parser/index.d.mts +3 -0
- package/dist/ky/js/parser/index.mjs +3 -79
- package/dist/ky/ts/config/index.d.mts +3 -0
- package/dist/ky/ts/config/index.mjs +3 -22
- package/dist/ky/ts/index.d.mts +5 -0
- package/dist/ky/ts/index.mjs +5 -31
- package/dist/ky/ts/parser/index.d.mts +3 -0
- package/dist/ky/ts/parser/index.mjs +3 -78
- package/dist/ky-B7lRjugo.mjs +13 -0
- package/dist/ofetch/index.d.mts +9 -0
- package/dist/ofetch/index.mjs +9 -7
- package/dist/ofetch/js/config/index.d.mts +3 -0
- package/dist/ofetch/js/config/index.mjs +3 -18
- package/dist/ofetch/js/index.d.mts +5 -0
- package/dist/ofetch/js/index.mjs +5 -31
- package/dist/ofetch/js/parser/index.d.mts +3 -0
- package/dist/ofetch/js/parser/index.mjs +3 -78
- package/dist/ofetch/ts/config/index.d.mts +3 -0
- package/dist/ofetch/ts/config/index.mjs +3 -22
- package/dist/ofetch/ts/index.d.mts +5 -0
- package/dist/ofetch/ts/index.mjs +5 -31
- package/dist/ofetch/ts/parser/index.d.mts +3 -0
- package/dist/ofetch/ts/parser/index.mjs +3 -76
- package/dist/ofetch-2rci5G0X.mjs +13 -0
- package/dist/parser-8NB1Nfwt.mjs +63 -0
- package/dist/parser-BJWwcP0S.mjs +69 -0
- package/dist/parser-CCXpH6OE.mjs +63 -0
- package/dist/parser-CE48730h.mjs +69 -0
- package/dist/parser-CFOZ5-GF.mjs +62 -0
- package/dist/parser-CSJYNO0a.mjs +69 -0
- package/dist/parser-C_kpdHgT.mjs +68 -0
- package/dist/parser-CaRC8JQj.mjs +67 -0
- package/dist/parser-DCA-N9mk.mjs +77 -0
- package/dist/parser-DY9NSCKJ.mjs +72 -0
- package/dist/parser-Dnqps2TD.mjs +66 -0
- package/dist/parser-GwoAS3rw.mjs +62 -0
- package/dist/ts-4mi0Q-kd.mjs +19 -0
- package/dist/ts-BaRFvnl0.mjs +19 -0
- package/dist/ts-BwAPOUdE.mjs +19 -0
- package/dist/ts-C9t_rVQx.mjs +19 -0
- package/dist/ts-CMn2aSnV.mjs +19 -0
- package/dist/ts-D-cZHoFQ.mjs +19 -0
- package/dist/uni/index.d.mts +9 -0
- package/dist/uni/index.mjs +9 -0
- package/dist/uni/js/config/index.d.mts +3 -0
- package/dist/uni/js/config/index.mjs +3 -0
- package/dist/uni/js/index.d.mts +5 -0
- package/dist/uni/js/index.mjs +5 -0
- package/dist/uni/js/parser/index.d.mts +3 -0
- package/dist/uni/js/parser/index.mjs +3 -0
- package/dist/uni/ts/config/index.d.mts +3 -0
- package/dist/uni/ts/config/index.mjs +3 -0
- package/dist/uni/ts/index.d.mts +5 -0
- package/dist/uni/ts/index.mjs +5 -0
- package/dist/uni/ts/parser/index.d.mts +3 -0
- package/dist/uni/ts/parser/index.mjs +3 -0
- package/dist/uni-DZmF7VCX.mjs +13 -0
- package/package.json +15 -15
- package/dist/axios/index.d.ts +0 -9
- package/dist/axios/js/config/index.d.ts +0 -5
- package/dist/axios/js/index.d.ts +0 -18
- package/dist/axios/ts/config/index.d.ts +0 -5
- package/dist/axios/ts/index.d.ts +0 -18
- package/dist/fetch/index.d.ts +0 -9
- package/dist/fetch/js/config/index.d.ts +0 -5
- package/dist/fetch/js/index.d.ts +0 -18
- package/dist/fetch/ts/config/index.d.ts +0 -5
- package/dist/fetch/ts/index.d.ts +0 -18
- package/dist/got/index.d.ts +0 -9
- package/dist/got/js/config/index.d.ts +0 -5
- package/dist/got/js/index.d.ts +0 -18
- package/dist/got/js/parser/index.d.ts +0 -12
- package/dist/got/ts/config/index.d.ts +0 -5
- package/dist/got/ts/index.d.ts +0 -18
- package/dist/got/ts/parser/index.d.ts +0 -12
- package/dist/index-BoRNV5uE.d.ts +0 -8
- package/dist/index-C-Of8dmT.d.ts +0 -8
- package/dist/index-DUlkpebX.d.ts +0 -8
- package/dist/index-doIz4HN1.d.ts +0 -8
- package/dist/index-ln0OpJQY.d.ts +0 -8
- package/dist/index.d.ts +0 -48
- package/dist/ky/index.d.ts +0 -9
- package/dist/ky/js/config/index.d.ts +0 -5
- package/dist/ky/js/index.d.ts +0 -18
- package/dist/ky/js/parser/index.d.ts +0 -12
- package/dist/ky/ts/config/index.d.ts +0 -5
- package/dist/ky/ts/index.d.ts +0 -18
- package/dist/ky/ts/parser/index.d.ts +0 -12
- package/dist/ofetch/index.d.ts +0 -9
- package/dist/ofetch/js/config/index.d.ts +0 -5
- package/dist/ofetch/js/index.d.ts +0 -18
- package/dist/ofetch/js/parser/index.d.ts +0 -12
- package/dist/ofetch/ts/config/index.d.ts +0 -5
- package/dist/ofetch/ts/index.d.ts +0 -18
- package/dist/ofetch/ts/parser/index.d.ts +0 -12
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "../index.d-DW8ts-IU.mjs";
|
|
2
|
+
import "../index.d-BXgDnKDv.mjs";
|
|
3
|
+
import { openapiPipeline } from "../index.d-BS6Sm47l.mjs";
|
|
4
|
+
import "../index.d-Bknp-d4G.mjs";
|
|
5
|
+
import "../index.d-DgggRtXp.mjs";
|
|
6
|
+
import { openapiPipeline$4 as openapiPipeline$1 } from "../index.d-CVL676ax.mjs";
|
|
7
|
+
import "../index.d-B0n5Pe6-.mjs";
|
|
8
|
+
|
|
9
|
+
export { openapiPipeline as js, openapiPipeline$1 as ts };
|
package/dist/axios/index.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import "../config-CwmGeydd.mjs";
|
|
2
|
+
import "../parser-8NB1Nfwt.mjs";
|
|
3
|
+
import { js_default } from "../js-CfKFwY21.mjs";
|
|
4
|
+
import "../config-B89EoGE7.mjs";
|
|
5
|
+
import "../parser-GwoAS3rw.mjs";
|
|
6
|
+
import { ts_default } from "../ts-4mi0Q-kd.mjs";
|
|
7
|
+
import "../axios-CG6HLmR9.mjs";
|
|
8
|
+
|
|
9
|
+
export { js_default as js, ts_default as ts };
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function config(userConfig) {
|
|
5
|
-
userConfig.import = userConfig.import || {};
|
|
6
|
-
userConfig.output = userConfig.output || {};
|
|
7
|
-
userConfig.import.http = userConfig.import.http || "axios";
|
|
8
|
-
userConfig.output = replaceMainext(userConfig.output) || "src/api/index.js";
|
|
9
|
-
const configRead = _config(userConfig);
|
|
10
|
-
configRead.graphs.imports.push({
|
|
11
|
-
name: "http",
|
|
12
|
-
value: userConfig.import.http
|
|
13
|
-
});
|
|
14
|
-
return configRead;
|
|
15
|
-
}
|
|
16
|
-
export {
|
|
17
|
-
config
|
|
18
|
-
};
|
|
1
|
+
import { config } from "../../../config-CwmGeydd.mjs";
|
|
2
|
+
|
|
3
|
+
export { config };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { parser$23 as parser } from "../../index.d-DW8ts-IU.mjs";
|
|
2
|
+
import { config$23 as config } from "../../index.d-BXgDnKDv.mjs";
|
|
3
|
+
import { compiler$12 as compiler, dest$12 as dest, generate$12 as generate, openapiPipeline, original$12 as original } from "../../index.d-BS6Sm47l.mjs";
|
|
4
|
+
|
|
5
|
+
export { compiler, config, openapiPipeline as default, dest, generate, original, parser };
|
package/dist/axios/js/index.mjs
CHANGED
|
@@ -1,31 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const process = pipeline(
|
|
7
|
-
(userConfig2) => config(userConfig2),
|
|
8
|
-
(configRead) => original(configRead),
|
|
9
|
-
(configRead) => parser(configRead),
|
|
10
|
-
(configRead) => compiler(configRead),
|
|
11
|
-
(configRead) => generate(configRead),
|
|
12
|
-
(configRead) => dest(configRead)
|
|
13
|
-
);
|
|
14
|
-
return process(userConfig);
|
|
15
|
-
}
|
|
16
|
-
openapiPipeline.config = config;
|
|
17
|
-
openapiPipeline.original = original;
|
|
18
|
-
openapiPipeline.parser = parser;
|
|
19
|
-
openapiPipeline.compiler = compiler;
|
|
20
|
-
openapiPipeline.generate = generate;
|
|
21
|
-
openapiPipeline.dest = dest;
|
|
22
|
-
var js_default = openapiPipeline;
|
|
23
|
-
export {
|
|
24
|
-
compiler,
|
|
25
|
-
config,
|
|
26
|
-
js_default as default,
|
|
27
|
-
dest,
|
|
28
|
-
generate,
|
|
29
|
-
original,
|
|
30
|
-
parser
|
|
31
|
-
};
|
|
1
|
+
import { config } from "../../config-CwmGeydd.mjs";
|
|
2
|
+
import { parser } from "../../parser-8NB1Nfwt.mjs";
|
|
3
|
+
import { compiler, dest, generate, js_default, original } from "../../js-CfKFwY21.mjs";
|
|
4
|
+
|
|
5
|
+
export { compiler, config, js_default as default, dest, generate, original, parser };
|
|
@@ -1,77 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
parseHeaderCommits,
|
|
5
|
-
parseMethodMetadata,
|
|
6
|
-
parseMethodParameters,
|
|
7
|
-
parseOpenapiSpecification,
|
|
8
|
-
transformBaseURL,
|
|
9
|
-
transformDefinitions,
|
|
10
|
-
transformParameters,
|
|
11
|
-
transformUrlSyntax,
|
|
12
|
-
traversePaths
|
|
13
|
-
} from "@genapi/parser";
|
|
14
|
-
function parser(configRead) {
|
|
15
|
-
const source = parseOpenapiSpecification(configRead.source);
|
|
16
|
-
const comments = parseHeaderCommits(source);
|
|
17
|
-
const interfaces = [];
|
|
18
|
-
const functions = [];
|
|
19
|
-
transformBaseURL(source, {
|
|
20
|
-
configRead
|
|
21
|
-
});
|
|
22
|
-
transformDefinitions(source.definitions, {
|
|
23
|
-
interfaces
|
|
24
|
-
});
|
|
25
|
-
transformPaths(source.paths, {
|
|
26
|
-
configRead,
|
|
27
|
-
functions,
|
|
28
|
-
interfaces
|
|
29
|
-
});
|
|
30
|
-
configRead.graphs.comments = comments;
|
|
31
|
-
configRead.graphs.functions = functions;
|
|
32
|
-
configRead.graphs.interfaces = interfaces;
|
|
33
|
-
return configRead;
|
|
34
|
-
}
|
|
35
|
-
function transformPaths(paths, { configRead, functions, interfaces }) {
|
|
36
|
-
traversePaths(paths, (config) => {
|
|
37
|
-
const { parameters, interfaces: attachInters, options } = parseMethodParameters(config, {
|
|
38
|
-
body: "data",
|
|
39
|
-
query: "params"
|
|
40
|
-
});
|
|
41
|
-
let { name, description, url, responseType } = parseMethodMetadata(config);
|
|
42
|
-
options.push(["...", "config"]);
|
|
43
|
-
interfaces.push(...attachInters);
|
|
44
|
-
parameters.push({
|
|
45
|
-
type: "import('axios').AxiosRequestConfig",
|
|
46
|
-
name: "config",
|
|
47
|
-
required: false
|
|
48
|
-
});
|
|
49
|
-
options.unshift("url");
|
|
50
|
-
options.unshift(["method", `"${config.method}"`]);
|
|
51
|
-
if (configRead.config.baseURL)
|
|
52
|
-
options.unshift("baseURL");
|
|
53
|
-
transformParameters(parameters, {
|
|
54
|
-
syntax: "ecmascript",
|
|
55
|
-
configRead,
|
|
56
|
-
description,
|
|
57
|
-
interfaces,
|
|
58
|
-
responseType,
|
|
59
|
-
generic: "import('axios').AxiosResponse<{__type__}>"
|
|
60
|
-
});
|
|
61
|
-
url = transformUrlSyntax(url);
|
|
62
|
-
functions.push({
|
|
63
|
-
export: true,
|
|
64
|
-
name,
|
|
65
|
-
description,
|
|
66
|
-
parameters,
|
|
67
|
-
body: [
|
|
68
|
-
`const url = ${url}`,
|
|
69
|
-
`return http.request({ ${literalFieldsToString(options)} })`
|
|
70
|
-
]
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
export {
|
|
75
|
-
parser,
|
|
76
|
-
transformPaths
|
|
77
|
-
};
|
|
1
|
+
import { parser, transformPaths } from "../../../parser-8NB1Nfwt.mjs";
|
|
2
|
+
|
|
3
|
+
export { parser, transformPaths };
|
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
userConfig.import = userConfig.import || {};
|
|
5
|
-
userConfig.import.http = userConfig.import.http || "axios";
|
|
6
|
-
const configRead = _config(userConfig);
|
|
7
|
-
configRead.graphs.imports.push({
|
|
8
|
-
name: "http",
|
|
9
|
-
names: userConfig.import.http === "axios" ? ["AxiosRequestConfig"] : void 0,
|
|
10
|
-
value: userConfig.import.http
|
|
11
|
-
});
|
|
12
|
-
if (userConfig.import.http !== "axios") {
|
|
13
|
-
configRead.graphs.imports.push({
|
|
14
|
-
names: ["AxiosRequestConfig"],
|
|
15
|
-
value: "axios"
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
return configRead;
|
|
19
|
-
}
|
|
20
|
-
export {
|
|
21
|
-
config
|
|
22
|
-
};
|
|
1
|
+
import { config$1 as config } from "../../../config-B89EoGE7.mjs";
|
|
2
|
+
|
|
3
|
+
export { config };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { parser$14 as parser } from "../../index.d-Bknp-d4G.mjs";
|
|
2
|
+
import { config$20 as config } from "../../index.d-DgggRtXp.mjs";
|
|
3
|
+
import { compiler$16 as compiler, dest$16 as dest, generate$16 as generate, openapiPipeline$4 as openapiPipeline, original$16 as original } from "../../index.d-CVL676ax.mjs";
|
|
4
|
+
|
|
5
|
+
export { compiler, config, openapiPipeline as default, dest, generate, original, parser };
|
package/dist/axios/ts/index.mjs
CHANGED
|
@@ -1,31 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const process = pipeline(
|
|
7
|
-
(userConfig2) => config(userConfig2),
|
|
8
|
-
(configRead) => original(configRead),
|
|
9
|
-
(configRead) => parser(configRead),
|
|
10
|
-
(configRead) => compiler(configRead),
|
|
11
|
-
(configRead) => generate(configRead),
|
|
12
|
-
(configRead) => dest(configRead)
|
|
13
|
-
);
|
|
14
|
-
return process(userConfig);
|
|
15
|
-
}
|
|
16
|
-
openapiPipeline.config = config;
|
|
17
|
-
openapiPipeline.original = original;
|
|
18
|
-
openapiPipeline.parser = parser;
|
|
19
|
-
openapiPipeline.compiler = compiler;
|
|
20
|
-
openapiPipeline.generate = generate;
|
|
21
|
-
openapiPipeline.dest = dest;
|
|
22
|
-
var ts_default = openapiPipeline;
|
|
23
|
-
export {
|
|
24
|
-
compiler,
|
|
25
|
-
config,
|
|
26
|
-
ts_default as default,
|
|
27
|
-
dest,
|
|
28
|
-
generate,
|
|
29
|
-
original,
|
|
30
|
-
parser
|
|
31
|
-
};
|
|
1
|
+
import { config$1 as config } from "../../config-B89EoGE7.mjs";
|
|
2
|
+
import { parser$1 as parser } from "../../parser-GwoAS3rw.mjs";
|
|
3
|
+
import { compiler$1 as compiler, dest$1 as dest, generate$1 as generate, original$1 as original, ts_default } from "../../ts-4mi0Q-kd.mjs";
|
|
4
|
+
|
|
5
|
+
export { compiler, config, ts_default as default, dest, generate, original, parser };
|
|
@@ -1,76 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
parseHeaderCommits,
|
|
5
|
-
parseMethodMetadata,
|
|
6
|
-
parseMethodParameters,
|
|
7
|
-
parseOpenapiSpecification,
|
|
8
|
-
transformBaseURL,
|
|
9
|
-
transformDefinitions,
|
|
10
|
-
transformParameters,
|
|
11
|
-
transformUrlSyntax,
|
|
12
|
-
traversePaths
|
|
13
|
-
} from "@genapi/parser";
|
|
14
|
-
function parser(configRead) {
|
|
15
|
-
const source = parseOpenapiSpecification(configRead.source);
|
|
16
|
-
const comments = parseHeaderCommits(source);
|
|
17
|
-
const interfaces = [];
|
|
18
|
-
const functions = [];
|
|
19
|
-
transformBaseURL(source, {
|
|
20
|
-
configRead
|
|
21
|
-
});
|
|
22
|
-
transformDefinitions(source.definitions, {
|
|
23
|
-
interfaces
|
|
24
|
-
});
|
|
25
|
-
transformPaths(source.paths, {
|
|
26
|
-
configRead,
|
|
27
|
-
functions,
|
|
28
|
-
interfaces
|
|
29
|
-
});
|
|
30
|
-
configRead.graphs.comments = comments;
|
|
31
|
-
configRead.graphs.functions = functions;
|
|
32
|
-
configRead.graphs.interfaces = interfaces;
|
|
33
|
-
return configRead;
|
|
34
|
-
}
|
|
35
|
-
function transformPaths(paths, { configRead, functions, interfaces }) {
|
|
36
|
-
traversePaths(paths, (config) => {
|
|
37
|
-
const { parameters, interfaces: attachInters, options } = parseMethodParameters(config, {
|
|
38
|
-
body: "data",
|
|
39
|
-
query: "params"
|
|
40
|
-
});
|
|
41
|
-
let { name, description, url, responseType } = parseMethodMetadata(config);
|
|
42
|
-
options.push(["...", "config"]);
|
|
43
|
-
interfaces.push(...attachInters);
|
|
44
|
-
parameters.push({
|
|
45
|
-
name: "config",
|
|
46
|
-
type: "AxiosRequestConfig",
|
|
47
|
-
required: false
|
|
48
|
-
});
|
|
49
|
-
options.unshift("url");
|
|
50
|
-
options.unshift(["method", `"${config.method}"`]);
|
|
51
|
-
if (configRead.config.baseURL)
|
|
52
|
-
options.unshift("baseURL");
|
|
53
|
-
const { spaceResponseType } = transformParameters(parameters, {
|
|
54
|
-
syntax: "typescript",
|
|
55
|
-
configRead,
|
|
56
|
-
description,
|
|
57
|
-
interfaces,
|
|
58
|
-
responseType
|
|
59
|
-
});
|
|
60
|
-
url = transformUrlSyntax(url);
|
|
61
|
-
functions.push({
|
|
62
|
-
export: true,
|
|
63
|
-
name,
|
|
64
|
-
description,
|
|
65
|
-
parameters,
|
|
66
|
-
body: [
|
|
67
|
-
`const url = ${url}`,
|
|
68
|
-
`return http.request<${spaceResponseType}>({ ${literalFieldsToString(options)} })`
|
|
69
|
-
]
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
export {
|
|
74
|
-
parser,
|
|
75
|
-
transformPaths
|
|
76
|
-
};
|
|
1
|
+
import { parser$1 as parser, transformPaths$1 as transformPaths } from "../../../parser-GwoAS3rw.mjs";
|
|
2
|
+
|
|
3
|
+
export { parser, transformPaths };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { __export } from "./chunk-BL35Yyzp.mjs";
|
|
2
|
+
import { js_default } from "./js-CfKFwY21.mjs";
|
|
3
|
+
import { ts_default } from "./ts-4mi0Q-kd.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/axios/index.ts
|
|
6
|
+
var axios_exports = {};
|
|
7
|
+
__export(axios_exports, {
|
|
8
|
+
js: () => js_default,
|
|
9
|
+
ts: () => ts_default
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { axios_exports };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { config } from "@genapi/pipeline";
|
|
2
|
+
|
|
3
|
+
//#region src/fetch/ts/config/index.ts
|
|
4
|
+
function config$1(userConfig) {
|
|
5
|
+
userConfig.import = userConfig.import || {};
|
|
6
|
+
userConfig.import.http = userConfig.import.http || "axios";
|
|
7
|
+
const configRead = config(userConfig);
|
|
8
|
+
return configRead;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { config$1 as config$4 };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { config } from "@genapi/pipeline";
|
|
2
|
+
|
|
3
|
+
//#region src/axios/ts/config/index.ts
|
|
4
|
+
function config$1(userConfig) {
|
|
5
|
+
userConfig.import = userConfig.import || {};
|
|
6
|
+
userConfig.import.http = userConfig.import.http || "axios";
|
|
7
|
+
const configRead = config(userConfig);
|
|
8
|
+
configRead.graphs.imports.push({
|
|
9
|
+
name: "http",
|
|
10
|
+
names: userConfig.import.http === "axios" ? ["AxiosRequestConfig"] : void 0,
|
|
11
|
+
value: userConfig.import.http
|
|
12
|
+
});
|
|
13
|
+
if (userConfig.import.http !== "axios") configRead.graphs.imports.push({
|
|
14
|
+
names: ["AxiosRequestConfig"],
|
|
15
|
+
value: "axios"
|
|
16
|
+
});
|
|
17
|
+
return configRead;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { config$1 };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { config } from "@genapi/pipeline";
|
|
2
|
+
|
|
3
|
+
//#region src/ky/ts/config/index.ts
|
|
4
|
+
function config$1(userConfig) {
|
|
5
|
+
userConfig.import = userConfig.import || {};
|
|
6
|
+
userConfig.import.http = userConfig.import.http || "ky";
|
|
7
|
+
const configRead = config(userConfig);
|
|
8
|
+
configRead.graphs.imports.push({
|
|
9
|
+
name: "http",
|
|
10
|
+
names: userConfig.import.http === "ky" ? ["Options"] : void 0,
|
|
11
|
+
value: userConfig.import.http
|
|
12
|
+
});
|
|
13
|
+
if (userConfig.import.http !== "ky") configRead.graphs.imports.push({
|
|
14
|
+
names: ["Options"],
|
|
15
|
+
value: "ky"
|
|
16
|
+
});
|
|
17
|
+
return configRead;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { config$1 as config$7 };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { config } from "@genapi/pipeline";
|
|
2
|
+
|
|
3
|
+
//#region src/ofetch/ts/config/index.ts
|
|
4
|
+
function config$1(userConfig) {
|
|
5
|
+
userConfig.import = userConfig.import || {};
|
|
6
|
+
userConfig.import.http = userConfig.import.http || "ofetch";
|
|
7
|
+
const configRead = config(userConfig);
|
|
8
|
+
configRead.graphs.imports.push({
|
|
9
|
+
name: "ofetch",
|
|
10
|
+
names: userConfig.import.http === "ofetch" ? ["FetchOptions"] : void 0,
|
|
11
|
+
value: userConfig.import.http
|
|
12
|
+
});
|
|
13
|
+
if (userConfig.import.http !== "ofetch") configRead.graphs.imports.push({
|
|
14
|
+
names: ["FetchOptions"],
|
|
15
|
+
value: "ofetch"
|
|
16
|
+
});
|
|
17
|
+
return configRead;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { config$1 as config$9 };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { config } from "@genapi/pipeline";
|
|
2
|
+
|
|
3
|
+
//#region src/uni/ts/config/index.ts
|
|
4
|
+
function config$1(userConfig) {
|
|
5
|
+
userConfig.import = userConfig.import || {};
|
|
6
|
+
userConfig.import.http = userConfig.import.http || "@uni-helper/uni-network";
|
|
7
|
+
const configRead = config(userConfig);
|
|
8
|
+
configRead.graphs.imports.push({
|
|
9
|
+
name: "http",
|
|
10
|
+
names: userConfig.import.http === "@uni-helper/uni-network" ? ["UnConfig"] : void 0,
|
|
11
|
+
value: userConfig.import.http
|
|
12
|
+
});
|
|
13
|
+
if (userConfig.import.http !== "@uni-helper/uni-network") configRead.graphs.imports.push({
|
|
14
|
+
names: ["UnConfig"],
|
|
15
|
+
value: "@uni-helper/uni-network"
|
|
16
|
+
});
|
|
17
|
+
return configRead;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { config$1 as config$11 };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { config } from "@genapi/pipeline";
|
|
2
|
+
import { replaceMainext } from "@genapi/parser";
|
|
3
|
+
|
|
4
|
+
//#region src/axios/js/config/index.ts
|
|
5
|
+
function config$1(userConfig) {
|
|
6
|
+
userConfig.import = userConfig.import || {};
|
|
7
|
+
userConfig.output = userConfig.output || {};
|
|
8
|
+
userConfig.import.http = userConfig.import.http || "axios";
|
|
9
|
+
userConfig.output = replaceMainext(userConfig.output) || "src/api/index.js";
|
|
10
|
+
const configRead = config(userConfig);
|
|
11
|
+
configRead.graphs.imports.push({
|
|
12
|
+
name: "http",
|
|
13
|
+
value: userConfig.import.http
|
|
14
|
+
});
|
|
15
|
+
return configRead;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { config$1 as config };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { config } from "@genapi/pipeline";
|
|
2
|
+
import { replaceMainext } from "@genapi/parser";
|
|
3
|
+
|
|
4
|
+
//#region src/got/js/config/index.ts
|
|
5
|
+
function config$1(userConfig) {
|
|
6
|
+
userConfig.import = userConfig.import || {};
|
|
7
|
+
userConfig.output = userConfig.output || {};
|
|
8
|
+
userConfig.import.http = userConfig.import.http || "got";
|
|
9
|
+
userConfig.output = replaceMainext(userConfig.output) || "src/api/index.js";
|
|
10
|
+
const configRead = config(userConfig);
|
|
11
|
+
configRead.graphs.imports.push({
|
|
12
|
+
name: "http",
|
|
13
|
+
value: userConfig.import.http
|
|
14
|
+
});
|
|
15
|
+
return configRead;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { config$1 as config$2 };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { config } from "@genapi/pipeline";
|
|
2
|
+
import { replaceMainext } from "@genapi/parser";
|
|
3
|
+
|
|
4
|
+
//#region src/ky/js/config/index.ts
|
|
5
|
+
function config$1(userConfig) {
|
|
6
|
+
userConfig.import = userConfig.import || {};
|
|
7
|
+
userConfig.output = userConfig.output || {};
|
|
8
|
+
userConfig.import.http = userConfig.import.http || "ky";
|
|
9
|
+
userConfig.output = replaceMainext(userConfig.output) || "src/api/index.js";
|
|
10
|
+
const configRead = config(userConfig);
|
|
11
|
+
configRead.graphs.imports.push({
|
|
12
|
+
name: "http",
|
|
13
|
+
value: userConfig.import.http
|
|
14
|
+
});
|
|
15
|
+
return configRead;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { config$1 as config$6 };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { config } from "@genapi/pipeline";
|
|
2
|
+
import { replaceMainext } from "@genapi/parser";
|
|
3
|
+
|
|
4
|
+
//#region src/ofetch/js/config/index.ts
|
|
5
|
+
function config$1(userConfig) {
|
|
6
|
+
userConfig.import = userConfig.import || {};
|
|
7
|
+
userConfig.output = userConfig.output || {};
|
|
8
|
+
userConfig.import.http = userConfig.import.http || "ofetch";
|
|
9
|
+
userConfig.output = replaceMainext(userConfig.output) || "src/api/index.js";
|
|
10
|
+
const configRead = config(userConfig);
|
|
11
|
+
configRead.graphs.imports.push({
|
|
12
|
+
name: "ofetch",
|
|
13
|
+
value: userConfig.import.http
|
|
14
|
+
});
|
|
15
|
+
return configRead;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { config$1 as config$8 };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { config } from "@genapi/pipeline";
|
|
2
|
+
import { replaceMainext } from "@genapi/parser";
|
|
3
|
+
|
|
4
|
+
//#region src/uni/js/config/index.ts
|
|
5
|
+
function config$1(userConfig) {
|
|
6
|
+
userConfig.import = userConfig.import || {};
|
|
7
|
+
userConfig.output = userConfig.output || {};
|
|
8
|
+
userConfig.import.http = userConfig.import.http || "@uni-helper/uni-network";
|
|
9
|
+
userConfig.output = replaceMainext(userConfig.output) || "src/api/index.js";
|
|
10
|
+
const configRead = config(userConfig);
|
|
11
|
+
configRead.graphs.imports.push({
|
|
12
|
+
name: "http",
|
|
13
|
+
value: userConfig.import.http
|
|
14
|
+
});
|
|
15
|
+
return configRead;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { config$1 as config$10 };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { config } from "@genapi/pipeline";
|
|
2
|
+
import { replaceMainext } from "@genapi/parser";
|
|
3
|
+
|
|
4
|
+
//#region src/fetch/js/config/index.ts
|
|
5
|
+
function config$1(userConfig) {
|
|
6
|
+
userConfig.import = userConfig.import || {};
|
|
7
|
+
userConfig.output = userConfig.output || {};
|
|
8
|
+
userConfig.output = replaceMainext(userConfig.output) || "src/api/index.js";
|
|
9
|
+
const configRead = config(userConfig);
|
|
10
|
+
return configRead;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { config$1 as config$3 };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { config } from "@genapi/pipeline";
|
|
2
|
+
|
|
3
|
+
//#region src/got/ts/config/index.ts
|
|
4
|
+
function config$1(userConfig) {
|
|
5
|
+
userConfig.import = userConfig.import || {};
|
|
6
|
+
userConfig.import.http = userConfig.import.http || "got";
|
|
7
|
+
const configRead = config(userConfig);
|
|
8
|
+
configRead.graphs.imports.push({
|
|
9
|
+
name: "http",
|
|
10
|
+
names: userConfig.import.http === "got" ? ["OptionsOfTextResponseBody"] : void 0,
|
|
11
|
+
value: userConfig.import.http
|
|
12
|
+
});
|
|
13
|
+
if (userConfig.import.http !== "got") configRead.graphs.imports.push({
|
|
14
|
+
names: ["OptionsOfTextResponseBody"],
|
|
15
|
+
value: "got"
|
|
16
|
+
});
|
|
17
|
+
return configRead;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { config$1 as config$5 };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "../index.d-D1pp_HCy.mjs";
|
|
2
|
+
import "../index.d-BguloXfs.mjs";
|
|
3
|
+
import { openapiPipeline$7 as openapiPipeline } from "../index.d-BgvbkDJL.mjs";
|
|
4
|
+
import "../index.d-BB-bpoWw.mjs";
|
|
5
|
+
import "../index.d-O3Nkol5h.mjs";
|
|
6
|
+
import { openapiPipeline$8 as openapiPipeline$1 } from "../index.d-BupSEh4R.mjs";
|
|
7
|
+
import "../index.d-BDMFuIpi.mjs";
|
|
8
|
+
|
|
9
|
+
export { openapiPipeline as js, openapiPipeline$1 as ts };
|
package/dist/fetch/index.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import "../config-DuQgIn7U.mjs";
|
|
2
|
+
import "../parser-DCA-N9mk.mjs";
|
|
3
|
+
import { js_default$2 as js_default } from "../js-DwgoBEjQ.mjs";
|
|
4
|
+
import "../config-B6UDPRkS.mjs";
|
|
5
|
+
import "../parser-DY9NSCKJ.mjs";
|
|
6
|
+
import { ts_default$1 as ts_default } from "../ts-CMn2aSnV.mjs";
|
|
7
|
+
import "../fetch-BtwC6Lll.mjs";
|
|
8
|
+
|
|
9
|
+
export { js_default as js, ts_default as ts };
|