@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
package/dist/fetch/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$2 as config } from "../../config-BJZnXcL3.mjs";
|
|
2
|
+
import { parser$2 as parser } from "../../parser-CAdkVm2b.mjs";
|
|
3
|
+
import { compiler$2 as compiler, dest$2 as dest, generate$2 as generate, js_default$1 as js_default, original$2 as original } from "../../js-CqtsolD8.mjs";
|
|
4
|
+
|
|
5
|
+
export { compiler, config, js_default as default, dest, generate, original, parser };
|
|
@@ -1,83 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
parseHeaderCommits,
|
|
5
|
-
parseMethodMetadata,
|
|
6
|
-
parseMethodParameters,
|
|
7
|
-
parseOpenapiSpecification,
|
|
8
|
-
transformBaseURL,
|
|
9
|
-
transformBodyStringify,
|
|
10
|
-
transformDefinitions,
|
|
11
|
-
transformHeaderOptions,
|
|
12
|
-
transformParameters,
|
|
13
|
-
transformQueryParams,
|
|
14
|
-
transformUrlSyntax,
|
|
15
|
-
traversePaths
|
|
16
|
-
} from "@genapi/parser";
|
|
17
|
-
function parser(configRead) {
|
|
18
|
-
const source = parseOpenapiSpecification(configRead.source);
|
|
19
|
-
const comments = parseHeaderCommits(source);
|
|
20
|
-
const interfaces = [];
|
|
21
|
-
const functions = [];
|
|
22
|
-
transformBaseURL(source, {
|
|
23
|
-
configRead
|
|
24
|
-
});
|
|
25
|
-
transformDefinitions(source.definitions, {
|
|
26
|
-
interfaces
|
|
27
|
-
});
|
|
28
|
-
transformPaths(source.paths, {
|
|
29
|
-
configRead,
|
|
30
|
-
functions,
|
|
31
|
-
interfaces
|
|
32
|
-
});
|
|
33
|
-
configRead.graphs.comments = comments;
|
|
34
|
-
configRead.graphs.functions = functions;
|
|
35
|
-
configRead.graphs.interfaces = interfaces;
|
|
36
|
-
return configRead;
|
|
37
|
-
}
|
|
38
|
-
function transformPaths(paths, { configRead, functions, interfaces }) {
|
|
39
|
-
traversePaths(paths, (config) => {
|
|
40
|
-
const { parameters, interfaces: attachInters, options } = parseMethodParameters(config, {
|
|
41
|
-
formData: "body"
|
|
42
|
-
});
|
|
43
|
-
let { name, description, url, responseType, body } = parseMethodMetadata(config);
|
|
44
|
-
interfaces.push(...attachInters);
|
|
45
|
-
parameters.push({
|
|
46
|
-
name: "config",
|
|
47
|
-
type: "RequestInit",
|
|
48
|
-
required: false
|
|
49
|
-
});
|
|
50
|
-
if (config.method.toLowerCase() !== "get")
|
|
51
|
-
options.unshift(["method", `"${config.method}"`]);
|
|
52
|
-
transformHeaderOptions("body", { options, parameters });
|
|
53
|
-
options.push(["...", "config"]);
|
|
54
|
-
transformParameters(parameters, {
|
|
55
|
-
syntax: "ecmascript",
|
|
56
|
-
configRead,
|
|
57
|
-
description,
|
|
58
|
-
interfaces,
|
|
59
|
-
responseType
|
|
60
|
-
});
|
|
61
|
-
transformBodyStringify("body", { options, parameters });
|
|
62
|
-
url = transformQueryParams("query", { body, options, url });
|
|
63
|
-
url = transformUrlSyntax(url, { baseURL: configRead.config.baseURL });
|
|
64
|
-
functions.push({
|
|
65
|
-
export: true,
|
|
66
|
-
async: true,
|
|
67
|
-
name,
|
|
68
|
-
description,
|
|
69
|
-
parameters,
|
|
70
|
-
body: [
|
|
71
|
-
...body,
|
|
72
|
-
`const response = await fetch(${url}, {
|
|
73
|
-
${literalFieldsToString(options)}
|
|
74
|
-
})`,
|
|
75
|
-
"return response.json()"
|
|
76
|
-
]
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
export {
|
|
81
|
-
parser,
|
|
82
|
-
transformPaths
|
|
83
|
-
};
|
|
1
|
+
import { parser$2 as parser, transformPaths$2 as transformPaths } from "../../../parser-CAdkVm2b.mjs";
|
|
2
|
+
|
|
3
|
+
export { parser, transformPaths };
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
userConfig.import = userConfig.import || {};
|
|
5
|
-
userConfig.import.http = userConfig.import.http || "axios";
|
|
6
|
-
const configRead = _config(userConfig);
|
|
7
|
-
return configRead;
|
|
8
|
-
}
|
|
9
|
-
export {
|
|
10
|
-
config
|
|
11
|
-
};
|
|
1
|
+
import { config$4 as config } from "../../../config-B6UDPRkS.mjs";
|
|
2
|
+
|
|
3
|
+
export { config };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { parser$16 as parser } from "../../index.d-D6AeBSov.mjs";
|
|
2
|
+
import { config$11 as config } from "../../index.d-DkWb7AYg.mjs";
|
|
3
|
+
import { compiler$12 as compiler, dest$12 as dest, generate$12 as generate, openapiPipeline$2 as openapiPipeline, original$12 as original } from "../../index.d-DndBUrRi.mjs";
|
|
4
|
+
|
|
5
|
+
export { compiler, config, openapiPipeline as default, dest, generate, original, parser };
|
package/dist/fetch/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$4 as config } from "../../config-B6UDPRkS.mjs";
|
|
2
|
+
import { parser$5 as parser } from "../../parser-aevzlGBk.mjs";
|
|
3
|
+
import { compiler$4 as compiler, dest$4 as dest, generate$4 as generate, original$4 as original, ts_default$1 as ts_default } from "../../ts-BLbY66M1.mjs";
|
|
4
|
+
|
|
5
|
+
export { compiler, config, ts_default as default, dest, generate, original, parser };
|
|
@@ -1,79 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
parseMethodMetadata,
|
|
5
|
-
parseMethodParameters,
|
|
6
|
-
parseOpenapiSpecification,
|
|
7
|
-
transformBaseURL,
|
|
8
|
-
transformBodyStringify,
|
|
9
|
-
transformDefinitions,
|
|
10
|
-
transformFetchBody,
|
|
11
|
-
transformHeaderOptions,
|
|
12
|
-
transformParameters,
|
|
13
|
-
transformQueryParams,
|
|
14
|
-
transformUrlSyntax,
|
|
15
|
-
traversePaths
|
|
16
|
-
} from "@genapi/parser";
|
|
17
|
-
function parser(configRead) {
|
|
18
|
-
const source = parseOpenapiSpecification(configRead.source);
|
|
19
|
-
const comments = parseHeaderCommits(source);
|
|
20
|
-
const interfaces = [];
|
|
21
|
-
const functions = [];
|
|
22
|
-
transformBaseURL(source, {
|
|
23
|
-
configRead
|
|
24
|
-
});
|
|
25
|
-
transformDefinitions(source.definitions, {
|
|
26
|
-
interfaces
|
|
27
|
-
});
|
|
28
|
-
transformPaths(source.paths, {
|
|
29
|
-
configRead,
|
|
30
|
-
functions,
|
|
31
|
-
interfaces
|
|
32
|
-
});
|
|
33
|
-
configRead.graphs.comments = comments;
|
|
34
|
-
configRead.graphs.functions = functions;
|
|
35
|
-
configRead.graphs.interfaces = interfaces;
|
|
36
|
-
return configRead;
|
|
37
|
-
}
|
|
38
|
-
function transformPaths(paths, { configRead, functions, interfaces }) {
|
|
39
|
-
traversePaths(paths, (config) => {
|
|
40
|
-
const { parameters, interfaces: attachInters, options } = parseMethodParameters(config);
|
|
41
|
-
let { name, description, url, responseType, body } = parseMethodMetadata(config);
|
|
42
|
-
interfaces.push(...attachInters);
|
|
43
|
-
parameters.push({
|
|
44
|
-
name: "config",
|
|
45
|
-
type: "RequestInit",
|
|
46
|
-
required: false
|
|
47
|
-
});
|
|
48
|
-
if (config.method.toLowerCase() !== "get")
|
|
49
|
-
options.unshift(["method", `"${config.method}"`]);
|
|
50
|
-
transformHeaderOptions("body", { options, parameters });
|
|
51
|
-
options.push(["...", "config"]);
|
|
52
|
-
const { spaceResponseType } = transformParameters(parameters, {
|
|
53
|
-
syntax: "typescript",
|
|
54
|
-
configRead,
|
|
55
|
-
description,
|
|
56
|
-
interfaces,
|
|
57
|
-
responseType
|
|
58
|
-
});
|
|
59
|
-
transformBodyStringify("body", { options, parameters });
|
|
60
|
-
url = transformQueryParams("query", { body, options, url });
|
|
61
|
-
url = transformUrlSyntax(url, { baseURL: configRead.config.baseURL });
|
|
62
|
-
const fetch = transformFetchBody(url, options, spaceResponseType);
|
|
63
|
-
functions.push({
|
|
64
|
-
export: true,
|
|
65
|
-
async: true,
|
|
66
|
-
name,
|
|
67
|
-
description,
|
|
68
|
-
parameters,
|
|
69
|
-
body: [
|
|
70
|
-
...body,
|
|
71
|
-
...fetch
|
|
72
|
-
]
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
export {
|
|
77
|
-
parser,
|
|
78
|
-
transformPaths
|
|
79
|
-
};
|
|
1
|
+
import { parser$5 as parser, transformPaths$5 as transformPaths } from "../../../parser-aevzlGBk.mjs";
|
|
2
|
+
|
|
3
|
+
export { parser, transformPaths };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { __export } from "./chunk-BL35Yyzp.mjs";
|
|
2
|
+
import { js_default$1 as js_default } from "./js-CqtsolD8.mjs";
|
|
3
|
+
import { ts_default$1 as ts_default } from "./ts-BLbY66M1.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/fetch/index.ts
|
|
6
|
+
var fetch_exports = {};
|
|
7
|
+
__export(fetch_exports, {
|
|
8
|
+
js: () => js_default,
|
|
9
|
+
ts: () => ts_default
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { fetch_exports };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "../index.d-BvMhV1lw.mjs";
|
|
2
|
+
import "../index.d-Dx6IWWI4.mjs";
|
|
3
|
+
import { openapiPipeline$9 as openapiPipeline } from "../index.d-BCl4h5vb.mjs";
|
|
4
|
+
import "../index.d-Ch6ZYMn0.mjs";
|
|
5
|
+
import "../index.d-Dsok7fEc.mjs";
|
|
6
|
+
import { openapiPipeline$8 as openapiPipeline$1 } from "../index.d-B5ex0iL6.mjs";
|
|
7
|
+
import "../index.d-sEb0cOvU.mjs";
|
|
8
|
+
|
|
9
|
+
export { openapiPipeline as js, openapiPipeline$1 as ts };
|
package/dist/got/index.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import "../config-CDvaM7ZL.mjs";
|
|
2
|
+
import "../parser-BkWqv1qf.mjs";
|
|
3
|
+
import { js_default$2 as js_default } from "../js-t1rqZHU4.mjs";
|
|
4
|
+
import "../config-aVU8JEKy.mjs";
|
|
5
|
+
import "../parser-ZdK3ZwJM.mjs";
|
|
6
|
+
import { ts_default$2 as ts_default } from "../ts-DjVYemin.mjs";
|
|
7
|
+
import "../got-DhRc0hx6.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 || "got";
|
|
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$3 as config } from "../../../config-CDvaM7ZL.mjs";
|
|
2
|
+
|
|
3
|
+
export { config };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { parser$18 as parser } from "../../index.d-BvMhV1lw.mjs";
|
|
2
|
+
import { config$16 as config } from "../../index.d-Dx6IWWI4.mjs";
|
|
3
|
+
import { compiler$19 as compiler, dest$19 as dest, generate$19 as generate, openapiPipeline$9 as openapiPipeline, original$19 as original } from "../../index.d-BCl4h5vb.mjs";
|
|
4
|
+
|
|
5
|
+
export { compiler, config, openapiPipeline as default, dest, generate, original, parser };
|
package/dist/got/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$3 as config } from "../../config-CDvaM7ZL.mjs";
|
|
2
|
+
import { parser$3 as parser } from "../../parser-BkWqv1qf.mjs";
|
|
3
|
+
import { compiler$3 as compiler, dest$3 as dest, generate$3 as generate, js_default$2 as js_default, original$3 as original } from "../../js-t1rqZHU4.mjs";
|
|
4
|
+
|
|
5
|
+
export { compiler, config, js_default as default, dest, generate, original, parser };
|
|
@@ -1,82 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
parseHeaderCommits,
|
|
5
|
-
parseMethodMetadata,
|
|
6
|
-
parseMethodParameters,
|
|
7
|
-
parseOpenapiSpecification,
|
|
8
|
-
transformBaseURL,
|
|
9
|
-
transformBodyStringify,
|
|
10
|
-
transformDefinitions,
|
|
11
|
-
transformParameters,
|
|
12
|
-
transformQueryParams,
|
|
13
|
-
transformUrlSyntax,
|
|
14
|
-
traversePaths
|
|
15
|
-
} from "@genapi/parser";
|
|
16
|
-
function parser(configRead) {
|
|
17
|
-
const source = parseOpenapiSpecification(configRead.source);
|
|
18
|
-
const comments = parseHeaderCommits(source);
|
|
19
|
-
const interfaces = [];
|
|
20
|
-
const functions = [];
|
|
21
|
-
transformBaseURL(source, {
|
|
22
|
-
configRead
|
|
23
|
-
});
|
|
24
|
-
transformDefinitions(source.definitions, {
|
|
25
|
-
interfaces
|
|
26
|
-
});
|
|
27
|
-
transformPaths(source.paths, {
|
|
28
|
-
configRead,
|
|
29
|
-
functions,
|
|
30
|
-
interfaces
|
|
31
|
-
});
|
|
32
|
-
configRead.graphs.comments = comments;
|
|
33
|
-
configRead.graphs.functions = functions;
|
|
34
|
-
configRead.graphs.interfaces = interfaces;
|
|
35
|
-
return configRead;
|
|
36
|
-
}
|
|
37
|
-
function transformPaths(paths, { configRead, functions, interfaces }) {
|
|
38
|
-
traversePaths(paths, (config) => {
|
|
39
|
-
const { parameters, interfaces: attachInters, options } = parseMethodParameters(config);
|
|
40
|
-
let { name, description, url, responseType } = parseMethodMetadata(config);
|
|
41
|
-
interfaces.push(...attachInters);
|
|
42
|
-
parameters.push({
|
|
43
|
-
name: "config",
|
|
44
|
-
type: "import('got').OptionsOfTextResponseBody",
|
|
45
|
-
required: false
|
|
46
|
-
});
|
|
47
|
-
options.push(["...", "config"]);
|
|
48
|
-
if (configRead.config.baseURL)
|
|
49
|
-
options.unshift(["prefixUrl", "baseURL"]);
|
|
50
|
-
for (const parameter of parameters) {
|
|
51
|
-
if (parameter.type === "FormData")
|
|
52
|
-
parameter.type = "any";
|
|
53
|
-
}
|
|
54
|
-
transformParameters(parameters, {
|
|
55
|
-
syntax: "ecmascript",
|
|
56
|
-
configRead,
|
|
57
|
-
description,
|
|
58
|
-
interfaces,
|
|
59
|
-
responseType
|
|
60
|
-
});
|
|
61
|
-
transformBodyStringify("body", { options, parameters });
|
|
62
|
-
transformQueryParams("query", { optionKey: "searchParams", options });
|
|
63
|
-
url = transformUrlSyntax(url);
|
|
64
|
-
functions.push({
|
|
65
|
-
export: true,
|
|
66
|
-
async: true,
|
|
67
|
-
name,
|
|
68
|
-
description,
|
|
69
|
-
parameters,
|
|
70
|
-
body: [
|
|
71
|
-
`const response = await http(${url}, {
|
|
72
|
-
${literalFieldsToString(options)}
|
|
73
|
-
})`,
|
|
74
|
-
"return response.json()"
|
|
75
|
-
]
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
export {
|
|
80
|
-
parser,
|
|
81
|
-
transformPaths
|
|
82
|
-
};
|
|
1
|
+
import { parser$3 as parser, transformPaths$3 as transformPaths } from "../../../parser-BkWqv1qf.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 || "got";
|
|
6
|
-
const configRead = _config(userConfig);
|
|
7
|
-
configRead.graphs.imports.push({
|
|
8
|
-
name: "http",
|
|
9
|
-
names: userConfig.import.http === "got" ? ["OptionsOfTextResponseBody"] : void 0,
|
|
10
|
-
value: userConfig.import.http
|
|
11
|
-
});
|
|
12
|
-
if (userConfig.import.http !== "got") {
|
|
13
|
-
configRead.graphs.imports.push({
|
|
14
|
-
names: ["OptionsOfTextResponseBody"],
|
|
15
|
-
value: "got"
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
return configRead;
|
|
19
|
-
}
|
|
20
|
-
export {
|
|
21
|
-
config
|
|
22
|
-
};
|
|
1
|
+
import { config$5 as config } from "../../../config-aVU8JEKy.mjs";
|
|
2
|
+
|
|
3
|
+
export { config };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { parser$15 as parser } from "../../index.d-Ch6ZYMn0.mjs";
|
|
2
|
+
import { config$17 as config } from "../../index.d-Dsok7fEc.mjs";
|
|
3
|
+
import { compiler$18 as compiler, dest$18 as dest, generate$18 as generate, openapiPipeline$8 as openapiPipeline, original$18 as original } from "../../index.d-B5ex0iL6.mjs";
|
|
4
|
+
|
|
5
|
+
export { compiler, config, openapiPipeline as default, dest, generate, original, parser };
|
package/dist/got/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$5 as config } from "../../config-aVU8JEKy.mjs";
|
|
2
|
+
import { parser$4 as parser } from "../../parser-ZdK3ZwJM.mjs";
|
|
3
|
+
import { compiler$5 as compiler, dest$5 as dest, generate$5 as generate, original$5 as original, ts_default$2 as ts_default } from "../../ts-DjVYemin.mjs";
|
|
4
|
+
|
|
5
|
+
export { compiler, config, ts_default as default, dest, generate, original, parser };
|
|
@@ -1,82 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
parseHeaderCommits,
|
|
5
|
-
parseMethodMetadata,
|
|
6
|
-
parseMethodParameters,
|
|
7
|
-
parseOpenapiSpecification,
|
|
8
|
-
transformBaseURL,
|
|
9
|
-
transformBodyStringify,
|
|
10
|
-
transformDefinitions,
|
|
11
|
-
transformParameters,
|
|
12
|
-
transformQueryParams,
|
|
13
|
-
transformUrlSyntax,
|
|
14
|
-
traversePaths
|
|
15
|
-
} from "@genapi/parser";
|
|
16
|
-
function parser(configRead) {
|
|
17
|
-
const source = parseOpenapiSpecification(configRead.source);
|
|
18
|
-
const comments = parseHeaderCommits(source);
|
|
19
|
-
const interfaces = [];
|
|
20
|
-
const functions = [];
|
|
21
|
-
transformBaseURL(source, {
|
|
22
|
-
configRead
|
|
23
|
-
});
|
|
24
|
-
transformDefinitions(source.definitions, {
|
|
25
|
-
interfaces
|
|
26
|
-
});
|
|
27
|
-
transformPaths(source.paths, {
|
|
28
|
-
configRead,
|
|
29
|
-
functions,
|
|
30
|
-
interfaces
|
|
31
|
-
});
|
|
32
|
-
configRead.graphs.comments = comments;
|
|
33
|
-
configRead.graphs.functions = functions;
|
|
34
|
-
configRead.graphs.interfaces = interfaces;
|
|
35
|
-
return configRead;
|
|
36
|
-
}
|
|
37
|
-
function transformPaths(paths, { configRead, functions, interfaces }) {
|
|
38
|
-
traversePaths(paths, (config) => {
|
|
39
|
-
const { parameters, interfaces: attachInters, options } = parseMethodParameters(config);
|
|
40
|
-
let { name, description, url, responseType } = parseMethodMetadata(config);
|
|
41
|
-
interfaces.push(...attachInters);
|
|
42
|
-
parameters.push({
|
|
43
|
-
name: "config",
|
|
44
|
-
type: "OptionsOfTextResponseBody",
|
|
45
|
-
required: false
|
|
46
|
-
});
|
|
47
|
-
options.push(["...", "config"]);
|
|
48
|
-
if (configRead.config.baseURL)
|
|
49
|
-
options.unshift(["prefixUrl", "baseURL"]);
|
|
50
|
-
for (const parameter of parameters) {
|
|
51
|
-
if (parameter.type === "FormData")
|
|
52
|
-
parameter.type = "any";
|
|
53
|
-
}
|
|
54
|
-
const { spaceResponseType } = transformParameters(parameters, {
|
|
55
|
-
syntax: "typescript",
|
|
56
|
-
configRead,
|
|
57
|
-
description,
|
|
58
|
-
interfaces,
|
|
59
|
-
responseType
|
|
60
|
-
});
|
|
61
|
-
transformBodyStringify("body", { options, parameters });
|
|
62
|
-
transformQueryParams("query", { optionKey: "searchParams", options });
|
|
63
|
-
url = transformUrlSyntax(url);
|
|
64
|
-
functions.push({
|
|
65
|
-
export: true,
|
|
66
|
-
async: true,
|
|
67
|
-
name,
|
|
68
|
-
description,
|
|
69
|
-
parameters,
|
|
70
|
-
body: [
|
|
71
|
-
`const response = http.${config.method}(${url}, {
|
|
72
|
-
${literalFieldsToString(options)}
|
|
73
|
-
})`,
|
|
74
|
-
`return response.json<${spaceResponseType}>()`
|
|
75
|
-
]
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
export {
|
|
80
|
-
parser,
|
|
81
|
-
transformPaths
|
|
82
|
-
};
|
|
1
|
+
import { parser$4 as parser, transformPaths$4 as transformPaths } from "../../../parser-ZdK3ZwJM.mjs";
|
|
2
|
+
|
|
3
|
+
export { parser, transformPaths };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { __export } from "./chunk-BL35Yyzp.mjs";
|
|
2
|
+
import { js_default$2 as js_default } from "./js-t1rqZHU4.mjs";
|
|
3
|
+
import { ts_default$2 as ts_default } from "./ts-DjVYemin.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/got/index.ts
|
|
6
|
+
var got_exports = {};
|
|
7
|
+
__export(got_exports, {
|
|
8
|
+
js: () => js_default,
|
|
9
|
+
ts: () => ts_default
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { got_exports };
|