@genapi/presets 3.3.0 → 3.5.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-BJZnXcL3.mjs +14 -0
- package/dist/config-CDvaM7ZL.mjs +19 -0
- package/dist/config-CwmGeydd.mjs +19 -0
- package/dist/config-DdUVYIe0.mjs +19 -0
- package/dist/config-Dm0OCPw8.mjs +19 -0
- package/dist/config-Dp9C4aUE.mjs +21 -0
- package/dist/config-IeVj3de_.mjs +21 -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-DDSgFojK.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-DhRc0hx6.mjs +13 -0
- package/dist/index.d-B-u-rHVf.d.mts +7 -0
- package/dist/index.d-B5ex0iL6.d.mts +18 -0
- package/dist/index.d-B6ea0pDX.d.mts +7 -0
- package/dist/index.d-B9YjsDSU.d.mts +7 -0
- package/dist/index.d-BCl4h5vb.d.mts +18 -0
- package/dist/index.d-BEPmcVlv.d.mts +12 -0
- package/dist/{axios/ts/parser/index.d.ts → index.d-BVDe1tFu.d.mts} +5 -3
- package/dist/index.d-Ba1tOHnm.d.mts +18 -0
- package/dist/{fetch/ts/parser/index.d.ts → index.d-BvMhV1lw.d.mts} +5 -3
- package/dist/index.d-C-mKHl9s.d.mts +7 -0
- package/dist/index.d-C-mT1tVI.d.mts +12 -0
- package/dist/index.d-C10wnMdy.d.mts +14 -0
- package/dist/index.d-C38NRU-q.d.mts +18 -0
- package/dist/index.d-CGbHzQH8.d.mts +18 -0
- package/dist/{axios/js/parser/index.d.ts → index.d-Ch6ZYMn0.d.mts} +5 -3
- package/dist/index.d-CozwYURq.d.mts +14 -0
- package/dist/index.d-D0ou41dA.d.mts +18 -0
- package/dist/index.d-D6AeBSov.d.mts +14 -0
- package/dist/index.d-D9OXwZhj.d.mts +7 -0
- package/dist/index.d-DBNQTE-q.d.mts +18 -0
- package/dist/index.d-DD5okdfE.d.mts +12 -0
- package/dist/index.d-DD9vtQSr.d.mts +14 -0
- package/dist/index.d-DT6dJ1Sg.d.mts +14 -0
- package/dist/index.d-DTsMFJM4.d.mts +18 -0
- package/dist/index.d-DgSgg69k.d.mts +18 -0
- package/dist/index.d-DkWb7AYg.d.mts +7 -0
- package/dist/index.d-DlncPuTy.d.mts +7 -0
- package/dist/index.d-DndBUrRi.d.mts +18 -0
- package/dist/index.d-Dsok7fEc.d.mts +7 -0
- package/dist/index.d-Dx6IWWI4.d.mts +7 -0
- package/dist/index.d-YNb6GO8o.d.mts +12 -0
- package/dist/index.d-qxp4tWxk.d.mts +7 -0
- package/dist/index.d-sEb0cOvU.d.mts +12 -0
- package/dist/index.d-xT7aQSB2.d.mts +14 -0
- package/dist/{fetch/js/parser/index.d.ts → index.d-yppv-kCz.d.mts} +5 -3
- package/dist/index.d.mts +47 -0
- package/dist/index.mjs +46 -20
- package/dist/js-CfKFwY21.mjs +19 -0
- package/dist/js-CqtsolD8.mjs +19 -0
- package/dist/js-DxwOJyF7.mjs +19 -0
- package/dist/js-nNB2l-OU.mjs +19 -0
- package/dist/js-t1rqZHU4.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-tkF4RP6y.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-D17IUjVF.mjs +13 -0
- package/dist/parser-8NB1Nfwt.mjs +63 -0
- package/dist/parser-B-nJrHKw.mjs +68 -0
- package/dist/parser-BGXx6lbG.mjs +66 -0
- package/dist/parser-BkWqv1qf.mjs +69 -0
- package/dist/parser-CAdkVm2b.mjs +77 -0
- package/dist/parser-CSJYNO0a.mjs +69 -0
- package/dist/parser-CaRC8JQj.mjs +67 -0
- package/dist/parser-GwoAS3rw.mjs +62 -0
- package/dist/parser-ZdK3ZwJM.mjs +69 -0
- package/dist/parser-aevzlGBk.mjs +72 -0
- package/dist/ts-4mi0Q-kd.mjs +19 -0
- package/dist/ts-B0VNlOAi.mjs +19 -0
- package/dist/ts-BLbY66M1.mjs +19 -0
- package/dist/ts-BrqtDsf2.mjs +19 -0
- package/dist/ts-DjVYemin.mjs +19 -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-DD9vtQSr.mjs";
|
|
2
|
+
import "../index.d-B9YjsDSU.mjs";
|
|
3
|
+
import { openapiPipeline$1 as openapiPipeline } from "../index.d-D0ou41dA.mjs";
|
|
4
|
+
import "../index.d-xT7aQSB2.mjs";
|
|
5
|
+
import "../index.d-D9OXwZhj.mjs";
|
|
6
|
+
import { openapiPipeline as openapiPipeline$1 } from "../index.d-Ba1tOHnm.mjs";
|
|
7
|
+
import "../index.d-YNb6GO8o.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$19 as parser } from "../../index.d-DD9vtQSr.mjs";
|
|
2
|
+
import { config$19 as config } from "../../index.d-B9YjsDSU.mjs";
|
|
3
|
+
import { compiler$11 as compiler, dest$11 as dest, generate$11 as generate, openapiPipeline$1 as openapiPipeline, original$11 as original } from "../../index.d-D0ou41dA.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$17 as parser } from "../../index.d-xT7aQSB2.mjs";
|
|
2
|
+
import { config$18 as config } from "../../index.d-D9OXwZhj.mjs";
|
|
3
|
+
import { compiler$10 as compiler, dest$10 as dest, generate$10 as generate, openapiPipeline, original$10 as original } from "../../index.d-Ba1tOHnm.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,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$2 };
|
|
@@ -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$3 };
|
|
@@ -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/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,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$7 };
|
|
@@ -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$9 };
|
|
@@ -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-C10wnMdy.mjs";
|
|
2
|
+
import "../index.d-qxp4tWxk.mjs";
|
|
3
|
+
import { openapiPipeline$4 as openapiPipeline } from "../index.d-CGbHzQH8.mjs";
|
|
4
|
+
import "../index.d-D6AeBSov.mjs";
|
|
5
|
+
import "../index.d-DkWb7AYg.mjs";
|
|
6
|
+
import { openapiPipeline$2 as openapiPipeline$1 } from "../index.d-DndBUrRi.mjs";
|
|
7
|
+
import "../index.d-BEPmcVlv.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-BJZnXcL3.mjs";
|
|
2
|
+
import "../parser-CAdkVm2b.mjs";
|
|
3
|
+
import { js_default$1 as js_default } from "../js-CqtsolD8.mjs";
|
|
4
|
+
import "../config-B6UDPRkS.mjs";
|
|
5
|
+
import "../parser-aevzlGBk.mjs";
|
|
6
|
+
import { ts_default$1 as ts_default } from "../ts-BLbY66M1.mjs";
|
|
7
|
+
import "../fetch-DDSgFojK.mjs";
|
|
8
|
+
|
|
9
|
+
export { js_default as js, ts_default as ts };
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function config(userConfig) {
|
|
5
|
-
userConfig.import = userConfig.import || {};
|
|
6
|
-
userConfig.output = userConfig.output || {};
|
|
7
|
-
userConfig.output = replaceMainext(userConfig.output) || "src/api/index.js";
|
|
8
|
-
const configRead = _config(userConfig);
|
|
9
|
-
return configRead;
|
|
10
|
-
}
|
|
11
|
-
export {
|
|
12
|
-
config
|
|
13
|
-
};
|
|
1
|
+
import { config$2 as config } from "../../../config-BJZnXcL3.mjs";
|
|
2
|
+
|
|
3
|
+
export { config };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { parser$14 as parser } from "../../index.d-C10wnMdy.mjs";
|
|
2
|
+
import { config$14 as config } from "../../index.d-qxp4tWxk.mjs";
|
|
3
|
+
import { compiler$14 as compiler, dest$14 as dest, generate$14 as generate, openapiPipeline$4 as openapiPipeline, original$14 as original } from "../../index.d-CGbHzQH8.mjs";
|
|
4
|
+
|
|
5
|
+
export { compiler, config, openapiPipeline as default, dest, generate, original, parser };
|