@genapi/presets 3.5.0 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/axios/index.d.mts +7 -7
- package/dist/axios/js/config/index.d.mts +1 -1
- package/dist/axios/js/index.d.mts +3 -3
- package/dist/axios/js/parser/index.d.mts +1 -1
- package/dist/axios/ts/config/index.d.mts +1 -1
- package/dist/axios/ts/index.d.mts +3 -3
- package/dist/axios/ts/parser/index.d.mts +1 -1
- package/dist/{config-IeVj3de_.mjs → config-BGwXcXx1.mjs} +1 -1
- package/dist/{config-Dp9C4aUE.mjs → config-C94x0Nge.mjs} +1 -1
- package/dist/config-CEngTpXa.mjs +21 -0
- package/dist/{config-CDvaM7ZL.mjs → config-DAHoeaDU.mjs} +1 -1
- package/dist/config-Dn-mxTew.mjs +19 -0
- package/dist/{config-BJZnXcL3.mjs → config-DuQgIn7U.mjs} +1 -1
- package/dist/fetch/index.d.mts +7 -7
- package/dist/fetch/index.mjs +6 -6
- package/dist/fetch/js/config/index.d.mts +1 -1
- package/dist/fetch/js/config/index.mjs +1 -1
- package/dist/fetch/js/index.d.mts +3 -3
- package/dist/fetch/js/index.mjs +3 -3
- package/dist/fetch/js/parser/index.d.mts +1 -1
- package/dist/fetch/js/parser/index.mjs +1 -1
- package/dist/fetch/ts/config/index.d.mts +1 -1
- package/dist/fetch/ts/index.d.mts +3 -3
- package/dist/fetch/ts/index.mjs +2 -2
- package/dist/fetch/ts/parser/index.d.mts +1 -1
- package/dist/fetch/ts/parser/index.mjs +1 -1
- package/dist/{fetch-DDSgFojK.mjs → fetch-BtwC6Lll.mjs} +2 -2
- package/dist/got/index.d.mts +7 -7
- package/dist/got/index.mjs +6 -6
- package/dist/got/js/config/index.d.mts +1 -1
- package/dist/got/js/config/index.mjs +1 -1
- package/dist/got/js/index.d.mts +3 -3
- package/dist/got/js/index.mjs +3 -3
- package/dist/got/js/parser/index.d.mts +1 -1
- package/dist/got/js/parser/index.mjs +1 -1
- package/dist/got/ts/config/index.d.mts +1 -1
- package/dist/got/ts/index.d.mts +3 -3
- package/dist/got/ts/index.mjs +2 -2
- package/dist/got/ts/parser/index.d.mts +1 -1
- package/dist/got/ts/parser/index.mjs +1 -1
- package/dist/{got-DhRc0hx6.mjs → got-xeCavgZc.mjs} +2 -2
- package/dist/{index.d-C10wnMdy.d.mts → index.d-4OvQY24D.d.mts} +2 -2
- package/dist/{index.d-YNb6GO8o.d.mts → index.d-B0n5Pe6-.d.mts} +3 -3
- package/dist/index.d-B1KgwGJV.d.mts +14 -0
- package/dist/index.d-B9C3SJsw.d.mts +7 -0
- package/dist/{index.d-Ch6ZYMn0.d.mts → index.d-BB-bpoWw.d.mts} +2 -2
- package/dist/index.d-BDMFuIpi.d.mts +12 -0
- package/dist/{index.d-CGbHzQH8.d.mts → index.d-BDy4V2O7.d.mts} +4 -4
- package/dist/index.d-BFJinzUY.d.mts +12 -0
- package/dist/{index.d-DndBUrRi.d.mts → index.d-BS6Sm47l.d.mts} +4 -4
- package/dist/{index.d-DTsMFJM4.d.mts → index.d-BSQRPGuK.d.mts} +4 -4
- package/dist/{index.d-B9YjsDSU.d.mts → index.d-BXgDnKDv.d.mts} +1 -1
- package/dist/{index.d-BvMhV1lw.d.mts → index.d-BYOoHBar.d.mts} +2 -2
- package/dist/{index.d-Ba1tOHnm.d.mts → index.d-BahMmqz0.d.mts} +4 -4
- package/dist/{index.d-sEb0cOvU.d.mts → index.d-BbxRLLMX.d.mts} +3 -3
- package/dist/{index.d-qxp4tWxk.d.mts → index.d-BguloXfs.d.mts} +1 -1
- package/dist/{index.d-BCl4h5vb.d.mts → index.d-BgvbkDJL.d.mts} +4 -4
- package/dist/{index.d-BVDe1tFu.d.mts → index.d-Bknp-d4G.d.mts} +2 -2
- package/dist/index.d-BulZ76hJ.d.mts +18 -0
- package/dist/index.d-BupSEh4R.d.mts +18 -0
- package/dist/{index.d-xT7aQSB2.d.mts → index.d-CAirdOCT.d.mts} +2 -2
- package/dist/{index.d-C-mT1tVI.d.mts → index.d-CDf5ausb.d.mts} +4 -4
- package/dist/{index.d-DD9vtQSr.d.mts → index.d-CN37Zl7u.d.mts} +2 -2
- package/dist/{index.d-DgSgg69k.d.mts → index.d-CVL676ax.d.mts} +4 -4
- package/dist/{index.d-Dsok7fEc.d.mts → index.d-Cb9k2mo6.d.mts} +1 -1
- package/dist/{index.d-DBNQTE-q.d.mts → index.d-CdRfZiCo.d.mts} +4 -4
- package/dist/{index.d-C-mKHl9s.d.mts → index.d-CfS61_iH.d.mts} +1 -1
- package/dist/{index.d-DlncPuTy.d.mts → index.d-Ckbfjm0G.d.mts} +1 -1
- package/dist/index.d-CljgOS4p.d.mts +18 -0
- package/dist/{index.d-yppv-kCz.d.mts → index.d-D1pp_HCy.d.mts} +2 -2
- package/dist/{index.d-CozwYURq.d.mts → index.d-D33XWXy5.d.mts} +2 -2
- package/dist/{index.d-D6AeBSov.d.mts → index.d-D6gcSlpm.d.mts} +2 -2
- package/dist/{index.d-B5ex0iL6.d.mts → index.d-DCtFuYUN.d.mts} +4 -4
- package/dist/index.d-DQZa03Va.d.mts +7 -0
- package/dist/index.d-DW8ts-IU.d.mts +14 -0
- package/dist/{index.d-B-u-rHVf.d.mts → index.d-D_aZcN-0.d.mts} +1 -1
- package/dist/{index.d-D9OXwZhj.d.mts → index.d-DgggRtXp.d.mts} +1 -1
- package/dist/{index.d-DD5okdfE.d.mts → index.d-DpLq-R_p.d.mts} +3 -3
- package/dist/{index.d-Dx6IWWI4.d.mts → index.d-DrCRTA_-.d.mts} +1 -1
- package/dist/{index.d-C38NRU-q.d.mts → index.d-DuVpMG8_.d.mts} +4 -4
- package/dist/{index.d-DT6dJ1Sg.d.mts → index.d-KQGa1SFg.d.mts} +2 -2
- package/dist/{index.d-DkWb7AYg.d.mts → index.d-O3Nkol5h.d.mts} +1 -1
- package/dist/{index.d-B6ea0pDX.d.mts → index.d-lzQFIw8d.d.mts} +1 -1
- package/dist/index.d.mts +44 -36
- package/dist/index.mjs +30 -22
- package/dist/{js-CqtsolD8.mjs → js-DGjfw_hH.mjs} +3 -3
- package/dist/{js-t1rqZHU4.mjs → js-DwgoBEjQ.mjs} +3 -3
- package/dist/{ts-BrqtDsf2.mjs → js-uo8fh9bT.mjs} +5 -5
- package/dist/ky/index.d.mts +7 -7
- package/dist/ky/index.mjs +4 -4
- package/dist/ky/js/config/index.d.mts +1 -1
- package/dist/ky/js/index.d.mts +3 -3
- package/dist/ky/js/parser/index.d.mts +1 -1
- package/dist/ky/ts/config/index.d.mts +1 -1
- package/dist/ky/ts/config/index.mjs +1 -1
- package/dist/ky/ts/index.d.mts +3 -3
- package/dist/ky/ts/index.mjs +3 -3
- package/dist/ky/ts/parser/index.d.mts +1 -1
- package/dist/ky/ts/parser/index.mjs +1 -1
- package/dist/{ky-tkF4RP6y.mjs → ky-B7lRjugo.mjs} +1 -1
- package/dist/ofetch/index.d.mts +7 -7
- package/dist/ofetch/index.mjs +4 -4
- package/dist/ofetch/js/config/index.d.mts +1 -1
- package/dist/ofetch/js/index.d.mts +3 -3
- package/dist/ofetch/js/parser/index.d.mts +1 -1
- package/dist/ofetch/ts/config/index.d.mts +1 -1
- package/dist/ofetch/ts/config/index.mjs +1 -1
- package/dist/ofetch/ts/index.d.mts +3 -3
- package/dist/ofetch/ts/index.mjs +3 -3
- package/dist/ofetch/ts/parser/index.d.mts +1 -1
- package/dist/ofetch/ts/parser/index.mjs +1 -1
- package/dist/{ofetch-D17IUjVF.mjs → ofetch-2rci5G0X.mjs} +1 -1
- package/dist/{parser-ZdK3ZwJM.mjs → parser-BJWwcP0S.mjs} +1 -1
- package/dist/parser-CCXpH6OE.mjs +63 -0
- package/dist/{parser-BkWqv1qf.mjs → parser-CE48730h.mjs} +1 -1
- package/dist/parser-CFOZ5-GF.mjs +62 -0
- package/dist/{parser-B-nJrHKw.mjs → parser-C_kpdHgT.mjs} +1 -1
- package/dist/{parser-CAdkVm2b.mjs → parser-DCA-N9mk.mjs} +1 -1
- package/dist/{parser-aevzlGBk.mjs → parser-DY9NSCKJ.mjs} +1 -1
- package/dist/{parser-BGXx6lbG.mjs → parser-Dnqps2TD.mjs} +1 -1
- package/dist/ts-BaRFvnl0.mjs +19 -0
- package/dist/ts-BwAPOUdE.mjs +19 -0
- package/dist/{ts-DjVYemin.mjs → ts-C9t_rVQx.mjs} +1 -1
- package/dist/{ts-BLbY66M1.mjs → ts-CMn2aSnV.mjs} +1 -1
- package/dist/{ts-B0VNlOAi.mjs → ts-D-cZHoFQ.mjs} +3 -3
- package/dist/uni/index.d.mts +9 -0
- package/dist/uni/index.mjs +9 -0
- package/dist/uni/js/config/index.d.mts +3 -0
- package/dist/uni/js/config/index.mjs +3 -0
- package/dist/uni/js/index.d.mts +5 -0
- package/dist/uni/js/index.mjs +5 -0
- package/dist/uni/js/parser/index.d.mts +3 -0
- package/dist/uni/js/parser/index.mjs +3 -0
- package/dist/uni/ts/config/index.d.mts +3 -0
- package/dist/uni/ts/config/index.mjs +3 -0
- package/dist/uni/ts/index.d.mts +5 -0
- package/dist/uni/ts/index.mjs +5 -0
- package/dist/uni/ts/parser/index.d.mts +3 -0
- package/dist/uni/ts/parser/index.mjs +3 -0
- package/dist/uni-DZmF7VCX.mjs +13 -0
- package/package.json +4 -4
- package/dist/index.d-BEPmcVlv.d.mts +0 -12
- package/dist/index.d-D0ou41dA.d.mts +0 -18
package/dist/ky/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "../index.d-
|
|
2
|
-
import "../index.d-
|
|
3
|
-
import { openapiPipeline$
|
|
4
|
-
import "../index.d-
|
|
5
|
-
import "../index.d-
|
|
6
|
-
import { openapiPipeline$
|
|
7
|
-
import "../index.d-
|
|
1
|
+
import "../index.d-KQGa1SFg.mjs";
|
|
2
|
+
import "../index.d-CfS61_iH.mjs";
|
|
3
|
+
import { openapiPipeline$11 as openapiPipeline } from "../index.d-BahMmqz0.mjs";
|
|
4
|
+
import "../index.d-BYOoHBar.mjs";
|
|
5
|
+
import "../index.d-D_aZcN-0.mjs";
|
|
6
|
+
import { openapiPipeline$1 } from "../index.d-DuVpMG8_.mjs";
|
|
7
|
+
import "../index.d-BFJinzUY.mjs";
|
|
8
8
|
|
|
9
9
|
export { openapiPipeline as js, openapiPipeline$1 as ts };
|
package/dist/ky/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "../config-DdUVYIe0.mjs";
|
|
2
2
|
import "../parser-CSJYNO0a.mjs";
|
|
3
3
|
import { js_default$3 as js_default } from "../js-nNB2l-OU.mjs";
|
|
4
|
-
import "../config-
|
|
5
|
-
import "../parser-
|
|
6
|
-
import { ts_default$
|
|
7
|
-
import "../ky-
|
|
4
|
+
import "../config-BGwXcXx1.mjs";
|
|
5
|
+
import "../parser-C_kpdHgT.mjs";
|
|
6
|
+
import { ts_default$3 as ts_default } from "../ts-D-cZHoFQ.mjs";
|
|
7
|
+
import "../ky-B7lRjugo.mjs";
|
|
8
8
|
|
|
9
9
|
export { js_default as js, ts_default as ts };
|
package/dist/ky/js/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { parser$
|
|
2
|
-
import { config$
|
|
3
|
-
import { compiler$
|
|
1
|
+
import { parser$13 as parser } from "../../index.d-KQGa1SFg.mjs";
|
|
2
|
+
import { config$22 as config } from "../../index.d-CfS61_iH.mjs";
|
|
3
|
+
import { compiler$23 as compiler, dest$23 as dest, generate$23 as generate, openapiPipeline$11 as openapiPipeline, original$23 as original } from "../../index.d-BahMmqz0.mjs";
|
|
4
4
|
|
|
5
5
|
export { compiler, config, openapiPipeline as default, dest, generate, original, parser };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { PathsTransformOptions$
|
|
1
|
+
import { PathsTransformOptions$1 as PathsTransformOptions, parser$13 as parser, transformPaths$13 as transformPaths } from "../../../index.d-KQGa1SFg.mjs";
|
|
2
2
|
|
|
3
3
|
export { PathsTransformOptions, parser, transformPaths };
|
package/dist/ky/ts/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { parser$
|
|
2
|
-
import { config$
|
|
3
|
-
import { compiler$
|
|
1
|
+
import { parser$20 as parser } from "../../index.d-BYOoHBar.mjs";
|
|
2
|
+
import { config$17 as config } from "../../index.d-D_aZcN-0.mjs";
|
|
3
|
+
import { compiler$13 as compiler, dest$13 as dest, generate$13 as generate, openapiPipeline$1 as openapiPipeline, original$13 as original } from "../../index.d-DuVpMG8_.mjs";
|
|
4
4
|
|
|
5
5
|
export { compiler, config, openapiPipeline as default, dest, generate, original, parser };
|
package/dist/ky/ts/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { config$
|
|
2
|
-
import { parser$
|
|
3
|
-
import { compiler$
|
|
1
|
+
import { config$7 as config } from "../../config-BGwXcXx1.mjs";
|
|
2
|
+
import { parser$7 as parser } from "../../parser-C_kpdHgT.mjs";
|
|
3
|
+
import { compiler$7 as compiler, dest$7 as dest, generate$7 as generate, original$7 as original, ts_default$3 as ts_default } from "../../ts-D-cZHoFQ.mjs";
|
|
4
4
|
|
|
5
5
|
export { compiler, config, ts_default as default, dest, generate, original, parser };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { PathsTransformOptions, parser$
|
|
1
|
+
import { PathsTransformOptions$8 as PathsTransformOptions, parser$20 as parser, transformPaths$20 as transformPaths } from "../../../index.d-BYOoHBar.mjs";
|
|
2
2
|
|
|
3
3
|
export { PathsTransformOptions, parser, transformPaths };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __export } from "./chunk-BL35Yyzp.mjs";
|
|
2
2
|
import { js_default$3 as js_default } from "./js-nNB2l-OU.mjs";
|
|
3
|
-
import { ts_default$
|
|
3
|
+
import { ts_default$3 as ts_default } from "./ts-D-cZHoFQ.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/ky/index.ts
|
|
6
6
|
var ky_exports = {};
|
package/dist/ofetch/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "../index.d-
|
|
2
|
-
import "../index.d-
|
|
3
|
-
import { openapiPipeline$3 as openapiPipeline } from "../index.d-
|
|
4
|
-
import "../index.d-
|
|
5
|
-
import "../index.d-
|
|
6
|
-
import { openapiPipeline$6 as openapiPipeline$1 } from "../index.d-
|
|
7
|
-
import "../index.d-
|
|
1
|
+
import "../index.d-CN37Zl7u.mjs";
|
|
2
|
+
import "../index.d-lzQFIw8d.mjs";
|
|
3
|
+
import { openapiPipeline$3 as openapiPipeline } from "../index.d-BSQRPGuK.mjs";
|
|
4
|
+
import "../index.d-B1KgwGJV.mjs";
|
|
5
|
+
import "../index.d-Ckbfjm0G.mjs";
|
|
6
|
+
import { openapiPipeline$6 as openapiPipeline$1 } from "../index.d-DCtFuYUN.mjs";
|
|
7
|
+
import "../index.d-DpLq-R_p.mjs";
|
|
8
8
|
|
|
9
9
|
export { openapiPipeline as js, openapiPipeline$1 as ts };
|
package/dist/ofetch/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "../config-Dm0OCPw8.mjs";
|
|
2
2
|
import "../parser-CaRC8JQj.mjs";
|
|
3
3
|
import { js_default$4 as js_default } from "../js-DxwOJyF7.mjs";
|
|
4
|
-
import "../config-
|
|
5
|
-
import "../parser-
|
|
6
|
-
import { ts_default$
|
|
7
|
-
import "../ofetch-
|
|
4
|
+
import "../config-C94x0Nge.mjs";
|
|
5
|
+
import "../parser-Dnqps2TD.mjs";
|
|
6
|
+
import { ts_default$4 as ts_default } from "../ts-BaRFvnl0.mjs";
|
|
7
|
+
import "../ofetch-2rci5G0X.mjs";
|
|
8
8
|
|
|
9
9
|
export { js_default as js, ts_default as ts };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { parser$
|
|
2
|
-
import { config$
|
|
3
|
-
import { compiler$
|
|
1
|
+
import { parser$21 as parser } from "../../index.d-CN37Zl7u.mjs";
|
|
2
|
+
import { config$16 as config } from "../../index.d-lzQFIw8d.mjs";
|
|
3
|
+
import { compiler$15 as compiler, dest$15 as dest, generate$15 as generate, openapiPipeline$3 as openapiPipeline, original$15 as original } from "../../index.d-BSQRPGuK.mjs";
|
|
4
4
|
|
|
5
5
|
export { compiler, config, openapiPipeline as default, dest, generate, original, parser };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { PathsTransformOptions$
|
|
1
|
+
import { PathsTransformOptions$9 as PathsTransformOptions, parser$21 as parser, transformPaths$21 as transformPaths } from "../../../index.d-CN37Zl7u.mjs";
|
|
2
2
|
|
|
3
3
|
export { PathsTransformOptions, parser, transformPaths };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { parser$
|
|
2
|
-
import { config$
|
|
3
|
-
import { compiler$
|
|
1
|
+
import { parser$22 as parser } from "../../index.d-B1KgwGJV.mjs";
|
|
2
|
+
import { config$13 as config } from "../../index.d-Ckbfjm0G.mjs";
|
|
3
|
+
import { compiler$18 as compiler, dest$18 as dest, generate$18 as generate, openapiPipeline$6 as openapiPipeline, original$18 as original } from "../../index.d-DCtFuYUN.mjs";
|
|
4
4
|
|
|
5
5
|
export { compiler, config, openapiPipeline as default, dest, generate, original, parser };
|
package/dist/ofetch/ts/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { config$
|
|
2
|
-
import { parser$
|
|
3
|
-
import { compiler$
|
|
1
|
+
import { config$9 as config } from "../../config-C94x0Nge.mjs";
|
|
2
|
+
import { parser$10 as parser } from "../../parser-Dnqps2TD.mjs";
|
|
3
|
+
import { compiler$10 as compiler, dest$10 as dest, generate$10 as generate, original$10 as original, ts_default$4 as ts_default } from "../../ts-BaRFvnl0.mjs";
|
|
4
4
|
|
|
5
5
|
export { compiler, config, ts_default as default, dest, generate, original, parser };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { PathsTransformOptions$
|
|
1
|
+
import { PathsTransformOptions$10 as PathsTransformOptions, parser$22 as parser, transformPaths$22 as transformPaths } from "../../../index.d-B1KgwGJV.mjs";
|
|
2
2
|
|
|
3
3
|
export { PathsTransformOptions, parser, transformPaths };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __export } from "./chunk-BL35Yyzp.mjs";
|
|
2
2
|
import { js_default$4 as js_default } from "./js-DxwOJyF7.mjs";
|
|
3
|
-
import { ts_default$
|
|
3
|
+
import { ts_default$4 as ts_default } from "./ts-BaRFvnl0.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/ofetch/index.ts
|
|
6
6
|
var ofetch_exports = {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { literalFieldsToString, parseHeaderCommits, parseMethodMetadata, parseMethodParameters, parseOpenapiSpecification, transformBaseURL, transformDefinitions, transformParameters, transformUrlSyntax, traversePaths } from "@genapi/parser";
|
|
2
|
+
|
|
3
|
+
//#region src/uni/js/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
|
+
type: "import('@uni-helper/uni-network').UnConfig<never>",
|
|
37
|
+
name: "config",
|
|
38
|
+
required: false
|
|
39
|
+
});
|
|
40
|
+
options.unshift("url");
|
|
41
|
+
options.unshift(["method", `"${config.method}"`]);
|
|
42
|
+
if (configRead.config.baseURL) options.unshift("baseURL");
|
|
43
|
+
transformParameters(parameters, {
|
|
44
|
+
syntax: "ecmascript",
|
|
45
|
+
configRead,
|
|
46
|
+
description,
|
|
47
|
+
interfaces,
|
|
48
|
+
responseType,
|
|
49
|
+
generic: "import('@uni-helper/uni-network').UnResponse<{__type__}>"
|
|
50
|
+
});
|
|
51
|
+
url = transformUrlSyntax(url);
|
|
52
|
+
functions.push({
|
|
53
|
+
export: true,
|
|
54
|
+
name,
|
|
55
|
+
description,
|
|
56
|
+
parameters,
|
|
57
|
+
body: [`const url = ${url}`, `return http.request({ ${literalFieldsToString(options)} })`]
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
export { parser as parser$9, transformPaths as transformPaths$9 };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { literalFieldsToString, parseHeaderCommits, parseMethodMetadata, parseMethodParameters, parseOpenapiSpecification, transformBaseURL, transformDefinitions, transformParameters, transformUrlSyntax, traversePaths } from "@genapi/parser";
|
|
2
|
+
|
|
3
|
+
//#region src/uni/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: "UnConfig<never>",
|
|
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$11, transformPaths as transformPaths$11 };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { config$9 as config } from "./config-C94x0Nge.mjs";
|
|
2
|
+
import { parser$10 as parser } from "./parser-Dnqps2TD.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$10, dest$1 as dest$10, generate$1 as generate$10, original$1 as original$10, ts_default as ts_default$4 };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { config$11 as config } from "./config-CEngTpXa.mjs";
|
|
2
|
+
import { parser$11 as parser } from "./parser-CFOZ5-GF.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/uni/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$11, dest$1 as dest$11, generate$1 as generate$11, original$1 as original$11, ts_default as ts_default$5 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { config$5 as config } from "./config-aVU8JEKy.mjs";
|
|
2
|
-
import { parser$
|
|
2
|
+
import { parser$5 as parser } from "./parser-BJWwcP0S.mjs";
|
|
3
3
|
import pipeline, { compiler as compiler$1, dest as dest$1, generate as generate$1, original as original$1 } from "@genapi/pipeline";
|
|
4
4
|
|
|
5
5
|
//#region src/got/ts/index.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { config$4 as config } from "./config-B6UDPRkS.mjs";
|
|
2
|
-
import { parser$
|
|
2
|
+
import { parser$3 as parser } from "./parser-DY9NSCKJ.mjs";
|
|
3
3
|
import pipeline, { compiler as compiler$1, dest as dest$1, generate as generate$1, original as original$1 } from "@genapi/pipeline";
|
|
4
4
|
|
|
5
5
|
//#region src/fetch/ts/index.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { config$7 as config } from "./config-
|
|
2
|
-
import { parser$7 as parser } from "./parser-
|
|
1
|
+
import { config$7 as config } from "./config-BGwXcXx1.mjs";
|
|
2
|
+
import { parser$7 as parser } from "./parser-C_kpdHgT.mjs";
|
|
3
3
|
import pipeline, { compiler as compiler$1, dest as dest$1, generate as generate$1, original as original$1 } from "@genapi/pipeline";
|
|
4
4
|
|
|
5
|
-
//#region src/
|
|
5
|
+
//#region src/ky/ts/index.ts
|
|
6
6
|
function openapiPipeline(userConfig) {
|
|
7
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
8
|
return process(userConfig);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "../index.d-4OvQY24D.mjs";
|
|
2
|
+
import "../index.d-DQZa03Va.mjs";
|
|
3
|
+
import { openapiPipeline$5 as openapiPipeline } from "../index.d-CdRfZiCo.mjs";
|
|
4
|
+
import "../index.d-D33XWXy5.mjs";
|
|
5
|
+
import "../index.d-B9C3SJsw.mjs";
|
|
6
|
+
import { openapiPipeline$2 as openapiPipeline$1 } from "../index.d-BDy4V2O7.mjs";
|
|
7
|
+
import "../index.d-CDf5ausb.mjs";
|
|
8
|
+
|
|
9
|
+
export { openapiPipeline as js, openapiPipeline$1 as ts };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "../config-Dn-mxTew.mjs";
|
|
2
|
+
import "../parser-CCXpH6OE.mjs";
|
|
3
|
+
import { js_default$5 as js_default } from "../js-uo8fh9bT.mjs";
|
|
4
|
+
import "../config-CEngTpXa.mjs";
|
|
5
|
+
import "../parser-CFOZ5-GF.mjs";
|
|
6
|
+
import { ts_default$5 as ts_default } from "../ts-BwAPOUdE.mjs";
|
|
7
|
+
import "../uni-DZmF7VCX.mjs";
|
|
8
|
+
|
|
9
|
+
export { js_default as js, ts_default as ts };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { parser$16 as parser } from "../../index.d-4OvQY24D.mjs";
|
|
2
|
+
import { config$14 as config } from "../../index.d-DQZa03Va.mjs";
|
|
3
|
+
import { compiler$17 as compiler, dest$17 as dest, generate$17 as generate, openapiPipeline$5 as openapiPipeline, original$17 as original } from "../../index.d-CdRfZiCo.mjs";
|
|
4
|
+
|
|
5
|
+
export { compiler, config, openapiPipeline as default, dest, generate, original, parser };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { config$10 as config } from "../../config-Dn-mxTew.mjs";
|
|
2
|
+
import { parser$9 as parser } from "../../parser-CCXpH6OE.mjs";
|
|
3
|
+
import { compiler$9 as compiler, dest$9 as dest, generate$9 as generate, js_default$5 as js_default, original$9 as original } from "../../js-uo8fh9bT.mjs";
|
|
4
|
+
|
|
5
|
+
export { compiler, config, js_default as default, dest, generate, original, parser };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { parser$15 as parser } from "../../index.d-D33XWXy5.mjs";
|
|
2
|
+
import { config$15 as config } from "../../index.d-B9C3SJsw.mjs";
|
|
3
|
+
import { compiler$14 as compiler, dest$14 as dest, generate$14 as generate, openapiPipeline$2 as openapiPipeline, original$14 as original } from "../../index.d-BDy4V2O7.mjs";
|
|
4
|
+
|
|
5
|
+
export { compiler, config, openapiPipeline as default, dest, generate, original, parser };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { config$11 as config } from "../../config-CEngTpXa.mjs";
|
|
2
|
+
import { parser$11 as parser } from "../../parser-CFOZ5-GF.mjs";
|
|
3
|
+
import { compiler$11 as compiler, dest$11 as dest, generate$11 as generate, original$11 as original, ts_default$5 as ts_default } from "../../ts-BwAPOUdE.mjs";
|
|
4
|
+
|
|
5
|
+
export { compiler, config, ts_default as default, dest, generate, original, parser };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { __export } from "./chunk-BL35Yyzp.mjs";
|
|
2
|
+
import { js_default$5 as js_default } from "./js-uo8fh9bT.mjs";
|
|
3
|
+
import { ts_default$5 as ts_default } from "./ts-BwAPOUdE.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/uni/index.ts
|
|
6
|
+
var uni_exports = {};
|
|
7
|
+
__export(uni_exports, {
|
|
8
|
+
js: () => js_default,
|
|
9
|
+
ts: () => ts_default
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { uni_exports };
|
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.6.0",
|
|
5
5
|
"author": "Hairyf <wwu710632@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/hairyf/genapi#readme",
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
],
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"openapi-specification-types": "^0.0.3",
|
|
66
|
-
"@genapi/
|
|
67
|
-
"@genapi/
|
|
68
|
-
"@genapi/shared": "3.
|
|
66
|
+
"@genapi/parser": "3.6.0",
|
|
67
|
+
"@genapi/pipeline": "3.6.0",
|
|
68
|
+
"@genapi/shared": "3.6.0"
|
|
69
69
|
},
|
|
70
70
|
"scripts": {
|
|
71
71
|
"build": "tsdown",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { __export } from "./chunk-BL35Yyzp.mjs";
|
|
2
|
-
import { openapiPipeline$4 as openapiPipeline } from "./index.d-CGbHzQH8.mjs";
|
|
3
|
-
import { openapiPipeline$2 as openapiPipeline$1 } from "./index.d-DndBUrRi.mjs";
|
|
4
|
-
|
|
5
|
-
//#region src/fetch/index.d.ts
|
|
6
|
-
|
|
7
|
-
declare namespace index_d_exports {
|
|
8
|
-
export { openapiPipeline as js, openapiPipeline$1 as ts, }
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
//#endregion
|
|
12
|
-
export { index_d_exports as index_d_exports$3 };
|