@genapi/presets 3.4.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,62 @@
|
|
|
1
|
+
import { literalFieldsToString, parseHeaderCommits, parseMethodMetadata, parseMethodParameters, parseOpenapiSpecification, transformBaseURL, transformDefinitions, transformParameters, transformUrlSyntax, traversePaths } from "@genapi/parser";
|
|
2
|
+
|
|
3
|
+
//#region src/axios/ts/parser/index.ts
|
|
4
|
+
function parser(configRead) {
|
|
5
|
+
const source = parseOpenapiSpecification(configRead.source);
|
|
6
|
+
const comments = parseHeaderCommits(source);
|
|
7
|
+
const interfaces = [];
|
|
8
|
+
const functions = [];
|
|
9
|
+
transformBaseURL(source, { configRead });
|
|
10
|
+
transformDefinitions(source.definitions, { interfaces });
|
|
11
|
+
transformPaths(source.paths, {
|
|
12
|
+
configRead,
|
|
13
|
+
functions,
|
|
14
|
+
interfaces
|
|
15
|
+
});
|
|
16
|
+
configRead.graphs.comments = comments;
|
|
17
|
+
configRead.graphs.functions = functions;
|
|
18
|
+
configRead.graphs.interfaces = interfaces;
|
|
19
|
+
return configRead;
|
|
20
|
+
}
|
|
21
|
+
function transformPaths(paths, { configRead, functions, interfaces }) {
|
|
22
|
+
traversePaths(paths, (config) => {
|
|
23
|
+
/**
|
|
24
|
+
|
|
25
|
+
* function params/function options/function use interfaces
|
|
26
|
+
|
|
27
|
+
*/
|
|
28
|
+
const { parameters, interfaces: attachInters, options } = parseMethodParameters(config, {
|
|
29
|
+
body: "data",
|
|
30
|
+
query: "params"
|
|
31
|
+
});
|
|
32
|
+
let { name, description, url, responseType } = parseMethodMetadata(config);
|
|
33
|
+
options.push(["...", "config"]);
|
|
34
|
+
interfaces.push(...attachInters);
|
|
35
|
+
parameters.push({
|
|
36
|
+
name: "config",
|
|
37
|
+
type: "AxiosRequestConfig",
|
|
38
|
+
required: false
|
|
39
|
+
});
|
|
40
|
+
options.unshift("url");
|
|
41
|
+
options.unshift(["method", `"${config.method}"`]);
|
|
42
|
+
if (configRead.config.baseURL) options.unshift("baseURL");
|
|
43
|
+
const { spaceResponseType } = transformParameters(parameters, {
|
|
44
|
+
syntax: "typescript",
|
|
45
|
+
configRead,
|
|
46
|
+
description,
|
|
47
|
+
interfaces,
|
|
48
|
+
responseType
|
|
49
|
+
});
|
|
50
|
+
url = transformUrlSyntax(url);
|
|
51
|
+
functions.push({
|
|
52
|
+
export: true,
|
|
53
|
+
name,
|
|
54
|
+
description,
|
|
55
|
+
parameters,
|
|
56
|
+
body: [`const url = ${url}`, `return http.request<${spaceResponseType}>({ ${literalFieldsToString(options)} })`]
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
//#endregion
|
|
62
|
+
export { parser as parser$1, transformPaths as transformPaths$1 };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { literalFieldsToString, parseHeaderCommits, parseMethodMetadata, parseMethodParameters, parseOpenapiSpecification, transformBaseURL, transformBodyStringify, transformDefinitions, transformParameters, transformQueryParams, transformUrlSyntax, traversePaths } from "@genapi/parser";
|
|
2
|
+
|
|
3
|
+
//#region src/got/ts/parser/index.ts
|
|
4
|
+
function parser(configRead) {
|
|
5
|
+
const source = parseOpenapiSpecification(configRead.source);
|
|
6
|
+
const comments = parseHeaderCommits(source);
|
|
7
|
+
const interfaces = [];
|
|
8
|
+
const functions = [];
|
|
9
|
+
transformBaseURL(source, { configRead });
|
|
10
|
+
transformDefinitions(source.definitions, { interfaces });
|
|
11
|
+
transformPaths(source.paths, {
|
|
12
|
+
configRead,
|
|
13
|
+
functions,
|
|
14
|
+
interfaces
|
|
15
|
+
});
|
|
16
|
+
configRead.graphs.comments = comments;
|
|
17
|
+
configRead.graphs.functions = functions;
|
|
18
|
+
configRead.graphs.interfaces = interfaces;
|
|
19
|
+
return configRead;
|
|
20
|
+
}
|
|
21
|
+
function transformPaths(paths, { configRead, functions, interfaces }) {
|
|
22
|
+
traversePaths(paths, (config) => {
|
|
23
|
+
/**
|
|
24
|
+
|
|
25
|
+
* function params/function options/function use interfaces
|
|
26
|
+
|
|
27
|
+
*/
|
|
28
|
+
const { parameters, interfaces: attachInters, options } = parseMethodParameters(config);
|
|
29
|
+
let { name, description, url, responseType } = parseMethodMetadata(config);
|
|
30
|
+
interfaces.push(...attachInters);
|
|
31
|
+
parameters.push({
|
|
32
|
+
name: "config",
|
|
33
|
+
type: "OptionsOfTextResponseBody",
|
|
34
|
+
required: false
|
|
35
|
+
});
|
|
36
|
+
options.push(["...", "config"]);
|
|
37
|
+
if (configRead.config.baseURL) options.unshift(["prefixUrl", "baseURL"]);
|
|
38
|
+
for (const parameter of parameters) if (parameter.type === "FormData") parameter.type = "any";
|
|
39
|
+
const { spaceResponseType } = transformParameters(parameters, {
|
|
40
|
+
syntax: "typescript",
|
|
41
|
+
configRead,
|
|
42
|
+
description,
|
|
43
|
+
interfaces,
|
|
44
|
+
responseType
|
|
45
|
+
});
|
|
46
|
+
transformBodyStringify("body", {
|
|
47
|
+
options,
|
|
48
|
+
parameters
|
|
49
|
+
});
|
|
50
|
+
transformQueryParams("query", {
|
|
51
|
+
optionKey: "searchParams",
|
|
52
|
+
options
|
|
53
|
+
});
|
|
54
|
+
url = transformUrlSyntax(url);
|
|
55
|
+
functions.push({
|
|
56
|
+
export: true,
|
|
57
|
+
async: true,
|
|
58
|
+
name,
|
|
59
|
+
description,
|
|
60
|
+
parameters,
|
|
61
|
+
body: [`const response = http.${config.method}(${url}, {
|
|
62
|
+
${literalFieldsToString(options)}
|
|
63
|
+
})`, `return response.json<${spaceResponseType}>()`]
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
export { parser as parser$4, transformPaths as transformPaths$4 };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { parseHeaderCommits, parseMethodMetadata, parseMethodParameters, parseOpenapiSpecification, transformBaseURL, transformBodyStringify, transformDefinitions, transformFetchBody, transformHeaderOptions, transformParameters, transformQueryParams, transformUrlSyntax, traversePaths } from "@genapi/parser";
|
|
2
|
+
|
|
3
|
+
//#region src/fetch/ts/parser/index.ts
|
|
4
|
+
function parser(configRead) {
|
|
5
|
+
const source = parseOpenapiSpecification(configRead.source);
|
|
6
|
+
const comments = parseHeaderCommits(source);
|
|
7
|
+
const interfaces = [];
|
|
8
|
+
const functions = [];
|
|
9
|
+
transformBaseURL(source, { configRead });
|
|
10
|
+
transformDefinitions(source.definitions, { interfaces });
|
|
11
|
+
transformPaths(source.paths, {
|
|
12
|
+
configRead,
|
|
13
|
+
functions,
|
|
14
|
+
interfaces
|
|
15
|
+
});
|
|
16
|
+
configRead.graphs.comments = comments;
|
|
17
|
+
configRead.graphs.functions = functions;
|
|
18
|
+
configRead.graphs.interfaces = interfaces;
|
|
19
|
+
return configRead;
|
|
20
|
+
}
|
|
21
|
+
function transformPaths(paths, { configRead, functions, interfaces }) {
|
|
22
|
+
traversePaths(paths, (config) => {
|
|
23
|
+
/**
|
|
24
|
+
|
|
25
|
+
* function params/function options/function use interfaces
|
|
26
|
+
|
|
27
|
+
*/
|
|
28
|
+
const { parameters, interfaces: attachInters, options } = parseMethodParameters(config);
|
|
29
|
+
let { name, description, url, responseType, body } = parseMethodMetadata(config);
|
|
30
|
+
interfaces.push(...attachInters);
|
|
31
|
+
parameters.push({
|
|
32
|
+
name: "config",
|
|
33
|
+
type: "RequestInit",
|
|
34
|
+
required: false
|
|
35
|
+
});
|
|
36
|
+
if (config.method.toLowerCase() !== "get") options.unshift(["method", `"${config.method}"`]);
|
|
37
|
+
transformHeaderOptions("body", {
|
|
38
|
+
options,
|
|
39
|
+
parameters
|
|
40
|
+
});
|
|
41
|
+
options.push(["...", "config"]);
|
|
42
|
+
const { spaceResponseType } = transformParameters(parameters, {
|
|
43
|
+
syntax: "typescript",
|
|
44
|
+
configRead,
|
|
45
|
+
description,
|
|
46
|
+
interfaces,
|
|
47
|
+
responseType
|
|
48
|
+
});
|
|
49
|
+
transformBodyStringify("body", {
|
|
50
|
+
options,
|
|
51
|
+
parameters
|
|
52
|
+
});
|
|
53
|
+
url = transformQueryParams("query", {
|
|
54
|
+
body,
|
|
55
|
+
options,
|
|
56
|
+
url
|
|
57
|
+
});
|
|
58
|
+
url = transformUrlSyntax(url, { baseURL: configRead.config.baseURL });
|
|
59
|
+
const fetch = transformFetchBody(url, options, spaceResponseType);
|
|
60
|
+
functions.push({
|
|
61
|
+
export: true,
|
|
62
|
+
async: true,
|
|
63
|
+
name,
|
|
64
|
+
description,
|
|
65
|
+
parameters,
|
|
66
|
+
body: [...body, ...fetch]
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
72
|
+
export { parser as parser$5, transformPaths as transformPaths$5 };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { config$1 as config } from "./config-B89EoGE7.mjs";
|
|
2
|
+
import { parser$1 as parser } from "./parser-GwoAS3rw.mjs";
|
|
3
|
+
import pipeline, { compiler as compiler$1, dest as dest$1, generate as generate$1, original as original$1 } from "@genapi/pipeline";
|
|
4
|
+
|
|
5
|
+
//#region src/axios/ts/index.ts
|
|
6
|
+
function openapiPipeline(userConfig) {
|
|
7
|
+
const process = pipeline((userConfig$1) => config(userConfig$1), (configRead) => original$1(configRead), (configRead) => parser(configRead), (configRead) => compiler$1(configRead), (configRead) => generate$1(configRead), (configRead) => dest$1(configRead));
|
|
8
|
+
return process(userConfig);
|
|
9
|
+
}
|
|
10
|
+
openapiPipeline.config = config;
|
|
11
|
+
openapiPipeline.original = original$1;
|
|
12
|
+
openapiPipeline.parser = parser;
|
|
13
|
+
openapiPipeline.compiler = compiler$1;
|
|
14
|
+
openapiPipeline.generate = generate$1;
|
|
15
|
+
openapiPipeline.dest = dest$1;
|
|
16
|
+
var ts_default = openapiPipeline;
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { compiler$1, dest$1, generate$1, original$1, ts_default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { config$7 as config } from "./config-Dp9C4aUE.mjs";
|
|
2
|
+
import { parser$7 as parser } from "./parser-BGXx6lbG.mjs";
|
|
3
|
+
import pipeline, { compiler as compiler$1, dest as dest$1, generate as generate$1, original as original$1 } from "@genapi/pipeline";
|
|
4
|
+
|
|
5
|
+
//#region src/ofetch/ts/index.ts
|
|
6
|
+
function openapiPipeline(userConfig) {
|
|
7
|
+
const process = pipeline((userConfig$1) => config(userConfig$1), (configRead) => original$1(configRead), (configRead) => parser(configRead), (configRead) => compiler$1(configRead), (configRead) => generate$1(configRead), (configRead) => dest$1(configRead));
|
|
8
|
+
return process(userConfig);
|
|
9
|
+
}
|
|
10
|
+
openapiPipeline.config = config;
|
|
11
|
+
openapiPipeline.original = original$1;
|
|
12
|
+
openapiPipeline.parser = parser;
|
|
13
|
+
openapiPipeline.compiler = compiler$1;
|
|
14
|
+
openapiPipeline.generate = generate$1;
|
|
15
|
+
openapiPipeline.dest = dest$1;
|
|
16
|
+
var ts_default = openapiPipeline;
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { compiler$1 as compiler$7, dest$1 as dest$7, generate$1 as generate$7, original$1 as original$7, ts_default as ts_default$3 };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { config$4 as config } from "./config-B6UDPRkS.mjs";
|
|
2
|
+
import { parser$5 as parser } from "./parser-aevzlGBk.mjs";
|
|
3
|
+
import pipeline, { compiler as compiler$1, dest as dest$1, generate as generate$1, original as original$1 } from "@genapi/pipeline";
|
|
4
|
+
|
|
5
|
+
//#region src/fetch/ts/index.ts
|
|
6
|
+
function openapiPipeline(userConfig) {
|
|
7
|
+
const process = pipeline((userConfig$1) => config(userConfig$1), (configRead) => original$1(configRead), (configRead) => parser(configRead), (configRead) => compiler$1(configRead), (configRead) => generate$1(configRead), (configRead) => dest$1(configRead));
|
|
8
|
+
return process(userConfig);
|
|
9
|
+
}
|
|
10
|
+
openapiPipeline.config = config;
|
|
11
|
+
openapiPipeline.original = original$1;
|
|
12
|
+
openapiPipeline.parser = parser;
|
|
13
|
+
openapiPipeline.compiler = compiler$1;
|
|
14
|
+
openapiPipeline.generate = generate$1;
|
|
15
|
+
openapiPipeline.dest = dest$1;
|
|
16
|
+
var ts_default = openapiPipeline;
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { compiler$1 as compiler$4, dest$1 as dest$4, generate$1 as generate$4, original$1 as original$4, ts_default as ts_default$1 };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { config$9 as config } from "./config-IeVj3de_.mjs";
|
|
2
|
+
import { parser$9 as parser } from "./parser-B-nJrHKw.mjs";
|
|
3
|
+
import pipeline, { compiler as compiler$1, dest as dest$1, generate as generate$1, original as original$1 } from "@genapi/pipeline";
|
|
4
|
+
|
|
5
|
+
//#region src/ky/ts/index.ts
|
|
6
|
+
function openapiPipeline(userConfig) {
|
|
7
|
+
const process = pipeline((userConfig$1) => config(userConfig$1), (configRead) => original$1(configRead), (configRead) => parser(configRead), (configRead) => compiler$1(configRead), (configRead) => generate$1(configRead), (configRead) => dest$1(configRead));
|
|
8
|
+
return process(userConfig);
|
|
9
|
+
}
|
|
10
|
+
openapiPipeline.config = config;
|
|
11
|
+
openapiPipeline.original = original$1;
|
|
12
|
+
openapiPipeline.parser = parser;
|
|
13
|
+
openapiPipeline.compiler = compiler$1;
|
|
14
|
+
openapiPipeline.generate = generate$1;
|
|
15
|
+
openapiPipeline.dest = dest$1;
|
|
16
|
+
var ts_default = openapiPipeline;
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { compiler$1 as compiler$9, dest$1 as dest$9, generate$1 as generate$9, original$1 as original$9, ts_default as ts_default$4 };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { config$5 as config } from "./config-aVU8JEKy.mjs";
|
|
2
|
+
import { parser$4 as parser } from "./parser-ZdK3ZwJM.mjs";
|
|
3
|
+
import pipeline, { compiler as compiler$1, dest as dest$1, generate as generate$1, original as original$1 } from "@genapi/pipeline";
|
|
4
|
+
|
|
5
|
+
//#region src/got/ts/index.ts
|
|
6
|
+
function openapiPipeline(userConfig) {
|
|
7
|
+
const process = pipeline((userConfig$1) => config(userConfig$1), (configRead) => original$1(configRead), (configRead) => parser(configRead), (configRead) => compiler$1(configRead), (configRead) => generate$1(configRead), (configRead) => dest$1(configRead));
|
|
8
|
+
return process(userConfig);
|
|
9
|
+
}
|
|
10
|
+
openapiPipeline.config = config;
|
|
11
|
+
openapiPipeline.original = original$1;
|
|
12
|
+
openapiPipeline.parser = parser;
|
|
13
|
+
openapiPipeline.compiler = compiler$1;
|
|
14
|
+
openapiPipeline.generate = generate$1;
|
|
15
|
+
openapiPipeline.dest = dest$1;
|
|
16
|
+
var ts_default = openapiPipeline;
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { compiler$1 as compiler$5, dest$1 as dest$5, generate$1 as generate$5, original$1 as original$5, ts_default as ts_default$2 };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genapi/presets",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.5.0",
|
|
5
5
|
"author": "Hairyf <wwu710632@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/hairyf/genapi#readme",
|
|
@@ -18,43 +18,43 @@
|
|
|
18
18
|
"exports": {
|
|
19
19
|
".": "./dist/index.mjs",
|
|
20
20
|
"./swag-axios-js": {
|
|
21
|
-
"types": "./dist/axios/js/index.d.
|
|
21
|
+
"types": "./dist/axios/js/index.d.mts",
|
|
22
22
|
"default": "./dist/axios/js/index.mjs"
|
|
23
23
|
},
|
|
24
24
|
"./swag-axios-ts": {
|
|
25
|
-
"types": "./dist/axios/ts/index.d.
|
|
25
|
+
"types": "./dist/axios/ts/index.d.mts",
|
|
26
26
|
"default": "./dist/axios/ts/index.mjs"
|
|
27
27
|
},
|
|
28
28
|
"./swag-fetch-js": {
|
|
29
|
-
"types": "./dist/fetch/js/index.d.
|
|
29
|
+
"types": "./dist/fetch/js/index.d.mts",
|
|
30
30
|
"default": "./dist/fetch/js/index.mjs"
|
|
31
31
|
},
|
|
32
32
|
"./swag-fetch-ts": {
|
|
33
|
-
"types": "./dist/fetch/ts/index.d.
|
|
33
|
+
"types": "./dist/fetch/ts/index.d.mts",
|
|
34
34
|
"default": "./dist/fetch/ts/index.mjs"
|
|
35
35
|
},
|
|
36
36
|
"./swag-got-js": {
|
|
37
|
-
"types": "./dist/got/js/index.d.
|
|
37
|
+
"types": "./dist/got/js/index.d.mts",
|
|
38
38
|
"default": "./dist/got/js/index.mjs"
|
|
39
39
|
},
|
|
40
40
|
"./swag-got-ts": {
|
|
41
|
-
"types": "./dist/got/ts/index.d.
|
|
41
|
+
"types": "./dist/got/ts/index.d.mts",
|
|
42
42
|
"default": "./dist/got/ts/index.mjs"
|
|
43
43
|
},
|
|
44
44
|
"./swag-ky-js": {
|
|
45
|
-
"types": "./dist/ky/js/index.d.
|
|
45
|
+
"types": "./dist/ky/js/index.d.mts",
|
|
46
46
|
"default": "./dist/ky/js/index.mjs"
|
|
47
47
|
},
|
|
48
48
|
"./swag-ky-ts": {
|
|
49
|
-
"types": "./dist/ky/ts/index.d.
|
|
49
|
+
"types": "./dist/ky/ts/index.d.mts",
|
|
50
50
|
"default": "./dist/ky/ts/index.mjs"
|
|
51
51
|
},
|
|
52
52
|
"./swag-ofetch-js": {
|
|
53
|
-
"types": "./dist/ofetch/js/index.d.
|
|
53
|
+
"types": "./dist/ofetch/js/index.d.mts",
|
|
54
54
|
"default": "./dist/ofetch/js/index.mjs"
|
|
55
55
|
},
|
|
56
56
|
"./swag-ofetch-ts": {
|
|
57
|
-
"types": "./dist/ofetch/ts/index.d.
|
|
57
|
+
"types": "./dist/ofetch/ts/index.d.mts",
|
|
58
58
|
"default": "./dist/ofetch/ts/index.mjs"
|
|
59
59
|
}
|
|
60
60
|
},
|
|
@@ -63,12 +63,12 @@
|
|
|
63
63
|
],
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"openapi-specification-types": "^0.0.3",
|
|
66
|
-
"@genapi/
|
|
67
|
-
"@genapi/
|
|
68
|
-
"@genapi/
|
|
66
|
+
"@genapi/pipeline": "3.5.0",
|
|
67
|
+
"@genapi/parser": "3.5.0",
|
|
68
|
+
"@genapi/shared": "3.5.0"
|
|
69
69
|
},
|
|
70
70
|
"scripts": {
|
|
71
|
-
"build": "
|
|
71
|
+
"build": "tsdown",
|
|
72
72
|
"start": "tsx src/index.ts"
|
|
73
73
|
}
|
|
74
74
|
}
|
package/dist/axios/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { default as js } from './js/index.js';
|
|
2
|
-
export { default as ts } from './ts/index.js';
|
|
3
|
-
import './js/parser/index.js';
|
|
4
|
-
import '@genapi/shared';
|
|
5
|
-
import 'openapi-specification-types';
|
|
6
|
-
import '@genapi/pipeline';
|
|
7
|
-
import './js/config/index.js';
|
|
8
|
-
import './ts/parser/index.js';
|
|
9
|
-
import './ts/config/index.js';
|
package/dist/axios/js/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { parser } from './parser/index.js';
|
|
2
|
-
import * as _genapi_pipeline from '@genapi/pipeline';
|
|
3
|
-
export { compiler, dest, generate, original } from '@genapi/pipeline';
|
|
4
|
-
import { config } from './config/index.js';
|
|
5
|
-
import { ApiPipeline } from '@genapi/shared';
|
|
6
|
-
import 'openapi-specification-types';
|
|
7
|
-
|
|
8
|
-
declare function openapiPipeline(userConfig: ApiPipeline.Config): Promise<void>;
|
|
9
|
-
declare namespace openapiPipeline {
|
|
10
|
-
var config: typeof config;
|
|
11
|
-
var original: typeof _genapi_pipeline.original;
|
|
12
|
-
var parser: typeof parser;
|
|
13
|
-
var compiler: typeof _genapi_pipeline.compiler;
|
|
14
|
-
var generate: typeof _genapi_pipeline.generate;
|
|
15
|
-
var dest: typeof _genapi_pipeline.dest;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { config, openapiPipeline as default, parser };
|
package/dist/axios/ts/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { parser } from './parser/index.js';
|
|
2
|
-
import * as _genapi_pipeline from '@genapi/pipeline';
|
|
3
|
-
export { compiler, dest, generate, original } from '@genapi/pipeline';
|
|
4
|
-
import { config } from './config/index.js';
|
|
5
|
-
import { ApiPipeline } from '@genapi/shared';
|
|
6
|
-
import 'openapi-specification-types';
|
|
7
|
-
|
|
8
|
-
declare function openapiPipeline(userConfig: ApiPipeline.Config): Promise<void>;
|
|
9
|
-
declare namespace openapiPipeline {
|
|
10
|
-
var config: typeof config;
|
|
11
|
-
var original: typeof _genapi_pipeline.original;
|
|
12
|
-
var parser: typeof parser;
|
|
13
|
-
var compiler: typeof _genapi_pipeline.compiler;
|
|
14
|
-
var generate: typeof _genapi_pipeline.generate;
|
|
15
|
-
var dest: typeof _genapi_pipeline.dest;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { config, openapiPipeline as default, parser };
|
package/dist/fetch/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { default as js } from './js/index.js';
|
|
2
|
-
export { default as ts } from './ts/index.js';
|
|
3
|
-
import './js/parser/index.js';
|
|
4
|
-
import '@genapi/shared';
|
|
5
|
-
import 'openapi-specification-types';
|
|
6
|
-
import '@genapi/pipeline';
|
|
7
|
-
import './js/config/index.js';
|
|
8
|
-
import './ts/parser/index.js';
|
|
9
|
-
import './ts/config/index.js';
|
package/dist/fetch/js/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { parser } from './parser/index.js';
|
|
2
|
-
import * as _genapi_pipeline from '@genapi/pipeline';
|
|
3
|
-
export { compiler, dest, generate, original } from '@genapi/pipeline';
|
|
4
|
-
import { config } from './config/index.js';
|
|
5
|
-
import { ApiPipeline } from '@genapi/shared';
|
|
6
|
-
import 'openapi-specification-types';
|
|
7
|
-
|
|
8
|
-
declare function openapiPipeline(userConfig: ApiPipeline.Config): Promise<void>;
|
|
9
|
-
declare namespace openapiPipeline {
|
|
10
|
-
var config: typeof config;
|
|
11
|
-
var original: typeof _genapi_pipeline.original;
|
|
12
|
-
var parser: typeof parser;
|
|
13
|
-
var compiler: typeof _genapi_pipeline.compiler;
|
|
14
|
-
var generate: typeof _genapi_pipeline.generate;
|
|
15
|
-
var dest: typeof _genapi_pipeline.dest;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { config, openapiPipeline as default, parser };
|
package/dist/fetch/ts/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { parser } from './parser/index.js';
|
|
2
|
-
import * as _genapi_pipeline from '@genapi/pipeline';
|
|
3
|
-
export { compiler, dest, generate, original } from '@genapi/pipeline';
|
|
4
|
-
import { config } from './config/index.js';
|
|
5
|
-
import { ApiPipeline } from '@genapi/shared';
|
|
6
|
-
import 'openapi-specification-types';
|
|
7
|
-
|
|
8
|
-
declare function openapiPipeline(userConfig: ApiPipeline.Config): Promise<void>;
|
|
9
|
-
declare namespace openapiPipeline {
|
|
10
|
-
var config: typeof config;
|
|
11
|
-
var original: typeof _genapi_pipeline.original;
|
|
12
|
-
var parser: typeof parser;
|
|
13
|
-
var compiler: typeof _genapi_pipeline.compiler;
|
|
14
|
-
var generate: typeof _genapi_pipeline.generate;
|
|
15
|
-
var dest: typeof _genapi_pipeline.dest;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { config, openapiPipeline as default, parser };
|
package/dist/got/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { default as js } from './js/index.js';
|
|
2
|
-
export { default as ts } from './ts/index.js';
|
|
3
|
-
import './js/parser/index.js';
|
|
4
|
-
import '@genapi/shared';
|
|
5
|
-
import 'openapi-specification-types';
|
|
6
|
-
import '@genapi/pipeline';
|
|
7
|
-
import './js/config/index.js';
|
|
8
|
-
import './ts/parser/index.js';
|
|
9
|
-
import './ts/config/index.js';
|
package/dist/got/js/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { parser } from './parser/index.js';
|
|
2
|
-
import * as _genapi_pipeline from '@genapi/pipeline';
|
|
3
|
-
export { compiler, dest, generate, original } from '@genapi/pipeline';
|
|
4
|
-
import { config } from './config/index.js';
|
|
5
|
-
import { ApiPipeline } from '@genapi/shared';
|
|
6
|
-
import 'openapi-specification-types';
|
|
7
|
-
|
|
8
|
-
declare function openapiPipeline(userConfig: ApiPipeline.Config): Promise<void>;
|
|
9
|
-
declare namespace openapiPipeline {
|
|
10
|
-
var config: typeof config;
|
|
11
|
-
var original: typeof _genapi_pipeline.original;
|
|
12
|
-
var parser: typeof parser;
|
|
13
|
-
var compiler: typeof _genapi_pipeline.compiler;
|
|
14
|
-
var generate: typeof _genapi_pipeline.generate;
|
|
15
|
-
var dest: typeof _genapi_pipeline.dest;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { config, openapiPipeline as default, parser };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ApiPipeline, StatementInterface, StatementFunction } from '@genapi/shared';
|
|
2
|
-
import { Paths } from 'openapi-specification-types';
|
|
3
|
-
|
|
4
|
-
interface PathsTransformOptions {
|
|
5
|
-
configRead: ApiPipeline.ConfigRead;
|
|
6
|
-
interfaces: StatementInterface[];
|
|
7
|
-
functions: StatementFunction[];
|
|
8
|
-
}
|
|
9
|
-
declare function parser(configRead: ApiPipeline.ConfigRead): ApiPipeline.ConfigRead<ApiPipeline.Config>;
|
|
10
|
-
declare function transformPaths(paths: Paths, { configRead, functions, interfaces }: PathsTransformOptions): void;
|
|
11
|
-
|
|
12
|
-
export { type PathsTransformOptions, parser, transformPaths };
|
package/dist/got/ts/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { parser } from './parser/index.js';
|
|
2
|
-
import * as _genapi_pipeline from '@genapi/pipeline';
|
|
3
|
-
export { compiler, dest, generate, original } from '@genapi/pipeline';
|
|
4
|
-
import { config } from './config/index.js';
|
|
5
|
-
import { ApiPipeline } from '@genapi/shared';
|
|
6
|
-
import 'openapi-specification-types';
|
|
7
|
-
|
|
8
|
-
declare function openapiPipeline(userConfig: ApiPipeline.Config): Promise<void>;
|
|
9
|
-
declare namespace openapiPipeline {
|
|
10
|
-
var config: typeof config;
|
|
11
|
-
var original: typeof _genapi_pipeline.original;
|
|
12
|
-
var parser: typeof parser;
|
|
13
|
-
var compiler: typeof _genapi_pipeline.compiler;
|
|
14
|
-
var generate: typeof _genapi_pipeline.generate;
|
|
15
|
-
var dest: typeof _genapi_pipeline.dest;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { config, openapiPipeline as default, parser };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ApiPipeline, StatementInterface, StatementFunction } from '@genapi/shared';
|
|
2
|
-
import { Paths } from 'openapi-specification-types';
|
|
3
|
-
|
|
4
|
-
interface PathsTransformOptions {
|
|
5
|
-
configRead: ApiPipeline.ConfigRead;
|
|
6
|
-
interfaces: StatementInterface[];
|
|
7
|
-
functions: StatementFunction[];
|
|
8
|
-
}
|
|
9
|
-
declare function parser(configRead: ApiPipeline.ConfigRead): ApiPipeline.ConfigRead<ApiPipeline.Config>;
|
|
10
|
-
declare function transformPaths(paths: Paths, { configRead, functions, interfaces }: PathsTransformOptions): void;
|
|
11
|
-
|
|
12
|
-
export { type PathsTransformOptions, parser, transformPaths };
|
package/dist/index-BoRNV5uE.d.ts
DELETED
package/dist/index-C-Of8dmT.d.ts
DELETED
package/dist/index-DUlkpebX.d.ts
DELETED
package/dist/index-doIz4HN1.d.ts
DELETED
package/dist/index-ln0OpJQY.d.ts
DELETED