@genapi/presets 3.4.0 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/dist/axios/index.d.mts +9 -0
  2. package/dist/axios/index.mjs +9 -7
  3. package/dist/axios/js/config/index.d.mts +3 -0
  4. package/dist/axios/js/config/index.mjs +3 -18
  5. package/dist/axios/js/index.d.mts +5 -0
  6. package/dist/axios/js/index.mjs +5 -31
  7. package/dist/axios/js/parser/index.d.mts +3 -0
  8. package/dist/axios/js/parser/index.mjs +3 -77
  9. package/dist/axios/ts/config/index.d.mts +3 -0
  10. package/dist/axios/ts/config/index.mjs +3 -22
  11. package/dist/axios/ts/index.d.mts +5 -0
  12. package/dist/axios/ts/index.mjs +5 -31
  13. package/dist/axios/ts/parser/index.d.mts +3 -0
  14. package/dist/axios/ts/parser/index.mjs +3 -76
  15. package/dist/axios-CG6HLmR9.mjs +13 -0
  16. package/dist/chunk-BL35Yyzp.mjs +12 -0
  17. package/dist/config-B6UDPRkS.mjs +12 -0
  18. package/dist/config-B89EoGE7.mjs +21 -0
  19. package/dist/config-BGwXcXx1.mjs +21 -0
  20. package/dist/config-C94x0Nge.mjs +21 -0
  21. package/dist/config-CEngTpXa.mjs +21 -0
  22. package/dist/config-CwmGeydd.mjs +19 -0
  23. package/dist/config-DAHoeaDU.mjs +19 -0
  24. package/dist/config-DdUVYIe0.mjs +19 -0
  25. package/dist/config-Dm0OCPw8.mjs +19 -0
  26. package/dist/config-Dn-mxTew.mjs +19 -0
  27. package/dist/config-DuQgIn7U.mjs +14 -0
  28. package/dist/config-aVU8JEKy.mjs +21 -0
  29. package/dist/fetch/index.d.mts +9 -0
  30. package/dist/fetch/index.mjs +9 -7
  31. package/dist/fetch/js/config/index.d.mts +3 -0
  32. package/dist/fetch/js/config/index.mjs +3 -13
  33. package/dist/fetch/js/index.d.mts +5 -0
  34. package/dist/fetch/js/index.mjs +5 -31
  35. package/dist/fetch/js/parser/index.d.mts +3 -0
  36. package/dist/fetch/js/parser/index.mjs +3 -83
  37. package/dist/fetch/ts/config/index.d.mts +3 -0
  38. package/dist/fetch/ts/config/index.mjs +3 -11
  39. package/dist/fetch/ts/index.d.mts +5 -0
  40. package/dist/fetch/ts/index.mjs +5 -31
  41. package/dist/fetch/ts/parser/index.d.mts +3 -0
  42. package/dist/fetch/ts/parser/index.mjs +3 -79
  43. package/dist/fetch-BtwC6Lll.mjs +13 -0
  44. package/dist/got/index.d.mts +9 -0
  45. package/dist/got/index.mjs +9 -7
  46. package/dist/got/js/config/index.d.mts +3 -0
  47. package/dist/got/js/config/index.mjs +3 -18
  48. package/dist/got/js/index.d.mts +5 -0
  49. package/dist/got/js/index.mjs +5 -31
  50. package/dist/got/js/parser/index.d.mts +3 -0
  51. package/dist/got/js/parser/index.mjs +3 -82
  52. package/dist/got/ts/config/index.d.mts +3 -0
  53. package/dist/got/ts/config/index.mjs +3 -22
  54. package/dist/got/ts/index.d.mts +5 -0
  55. package/dist/got/ts/index.mjs +5 -31
  56. package/dist/got/ts/parser/index.d.mts +3 -0
  57. package/dist/got/ts/parser/index.mjs +3 -82
  58. package/dist/got-xeCavgZc.mjs +13 -0
  59. package/dist/{axios/js/parser/index.d.ts → index.d-4OvQY24D.d.mts} +5 -3
  60. package/dist/index.d-B0n5Pe6-.d.mts +12 -0
  61. package/dist/index.d-B1KgwGJV.d.mts +14 -0
  62. package/dist/index.d-B9C3SJsw.d.mts +7 -0
  63. package/dist/index.d-BB-bpoWw.d.mts +14 -0
  64. package/dist/index.d-BDMFuIpi.d.mts +12 -0
  65. package/dist/index.d-BDy4V2O7.d.mts +18 -0
  66. package/dist/index.d-BFJinzUY.d.mts +12 -0
  67. package/dist/index.d-BS6Sm47l.d.mts +18 -0
  68. package/dist/index.d-BSQRPGuK.d.mts +18 -0
  69. package/dist/index.d-BXgDnKDv.d.mts +7 -0
  70. package/dist/{axios/ts/parser/index.d.ts → index.d-BYOoHBar.d.mts} +5 -3
  71. package/dist/index.d-BahMmqz0.d.mts +18 -0
  72. package/dist/index.d-BbxRLLMX.d.mts +12 -0
  73. package/dist/index.d-BguloXfs.d.mts +7 -0
  74. package/dist/index.d-BgvbkDJL.d.mts +18 -0
  75. package/dist/index.d-Bknp-d4G.d.mts +14 -0
  76. package/dist/index.d-BulZ76hJ.d.mts +18 -0
  77. package/dist/index.d-BupSEh4R.d.mts +18 -0
  78. package/dist/index.d-CAirdOCT.d.mts +14 -0
  79. package/dist/index.d-CDf5ausb.d.mts +12 -0
  80. package/dist/index.d-CN37Zl7u.d.mts +14 -0
  81. package/dist/index.d-CVL676ax.d.mts +18 -0
  82. package/dist/index.d-Cb9k2mo6.d.mts +7 -0
  83. package/dist/index.d-CdRfZiCo.d.mts +18 -0
  84. package/dist/index.d-CfS61_iH.d.mts +7 -0
  85. package/dist/index.d-Ckbfjm0G.d.mts +7 -0
  86. package/dist/index.d-CljgOS4p.d.mts +18 -0
  87. package/dist/{fetch/js/parser/index.d.ts → index.d-D1pp_HCy.d.mts} +5 -3
  88. package/dist/index.d-D33XWXy5.d.mts +14 -0
  89. package/dist/index.d-D6gcSlpm.d.mts +14 -0
  90. package/dist/index.d-DCtFuYUN.d.mts +18 -0
  91. package/dist/index.d-DQZa03Va.d.mts +7 -0
  92. package/dist/index.d-DW8ts-IU.d.mts +14 -0
  93. package/dist/index.d-D_aZcN-0.d.mts +7 -0
  94. package/dist/index.d-DgggRtXp.d.mts +7 -0
  95. package/dist/index.d-DpLq-R_p.d.mts +12 -0
  96. package/dist/index.d-DrCRTA_-.d.mts +7 -0
  97. package/dist/index.d-DuVpMG8_.d.mts +18 -0
  98. package/dist/{fetch/ts/parser/index.d.ts → index.d-KQGa1SFg.d.mts} +5 -3
  99. package/dist/index.d-O3Nkol5h.d.mts +7 -0
  100. package/dist/index.d-lzQFIw8d.d.mts +7 -0
  101. package/dist/index.d.mts +55 -0
  102. package/dist/index.mjs +54 -20
  103. package/dist/js-CfKFwY21.mjs +19 -0
  104. package/dist/js-DGjfw_hH.mjs +19 -0
  105. package/dist/js-DwgoBEjQ.mjs +19 -0
  106. package/dist/js-DxwOJyF7.mjs +19 -0
  107. package/dist/js-nNB2l-OU.mjs +19 -0
  108. package/dist/js-uo8fh9bT.mjs +19 -0
  109. package/dist/ky/index.d.mts +9 -0
  110. package/dist/ky/index.mjs +9 -7
  111. package/dist/ky/js/config/index.d.mts +3 -0
  112. package/dist/ky/js/config/index.mjs +3 -18
  113. package/dist/ky/js/index.d.mts +5 -0
  114. package/dist/ky/js/index.mjs +5 -31
  115. package/dist/ky/js/parser/index.d.mts +3 -0
  116. package/dist/ky/js/parser/index.mjs +3 -79
  117. package/dist/ky/ts/config/index.d.mts +3 -0
  118. package/dist/ky/ts/config/index.mjs +3 -22
  119. package/dist/ky/ts/index.d.mts +5 -0
  120. package/dist/ky/ts/index.mjs +5 -31
  121. package/dist/ky/ts/parser/index.d.mts +3 -0
  122. package/dist/ky/ts/parser/index.mjs +3 -78
  123. package/dist/ky-B7lRjugo.mjs +13 -0
  124. package/dist/ofetch/index.d.mts +9 -0
  125. package/dist/ofetch/index.mjs +9 -7
  126. package/dist/ofetch/js/config/index.d.mts +3 -0
  127. package/dist/ofetch/js/config/index.mjs +3 -18
  128. package/dist/ofetch/js/index.d.mts +5 -0
  129. package/dist/ofetch/js/index.mjs +5 -31
  130. package/dist/ofetch/js/parser/index.d.mts +3 -0
  131. package/dist/ofetch/js/parser/index.mjs +3 -78
  132. package/dist/ofetch/ts/config/index.d.mts +3 -0
  133. package/dist/ofetch/ts/config/index.mjs +3 -22
  134. package/dist/ofetch/ts/index.d.mts +5 -0
  135. package/dist/ofetch/ts/index.mjs +5 -31
  136. package/dist/ofetch/ts/parser/index.d.mts +3 -0
  137. package/dist/ofetch/ts/parser/index.mjs +3 -76
  138. package/dist/ofetch-2rci5G0X.mjs +13 -0
  139. package/dist/parser-8NB1Nfwt.mjs +63 -0
  140. package/dist/parser-BJWwcP0S.mjs +69 -0
  141. package/dist/parser-CCXpH6OE.mjs +63 -0
  142. package/dist/parser-CE48730h.mjs +69 -0
  143. package/dist/parser-CFOZ5-GF.mjs +62 -0
  144. package/dist/parser-CSJYNO0a.mjs +69 -0
  145. package/dist/parser-C_kpdHgT.mjs +68 -0
  146. package/dist/parser-CaRC8JQj.mjs +67 -0
  147. package/dist/parser-DCA-N9mk.mjs +77 -0
  148. package/dist/parser-DY9NSCKJ.mjs +72 -0
  149. package/dist/parser-Dnqps2TD.mjs +66 -0
  150. package/dist/parser-GwoAS3rw.mjs +62 -0
  151. package/dist/ts-4mi0Q-kd.mjs +19 -0
  152. package/dist/ts-BaRFvnl0.mjs +19 -0
  153. package/dist/ts-BwAPOUdE.mjs +19 -0
  154. package/dist/ts-C9t_rVQx.mjs +19 -0
  155. package/dist/ts-CMn2aSnV.mjs +19 -0
  156. package/dist/ts-D-cZHoFQ.mjs +19 -0
  157. package/dist/uni/index.d.mts +9 -0
  158. package/dist/uni/index.mjs +9 -0
  159. package/dist/uni/js/config/index.d.mts +3 -0
  160. package/dist/uni/js/config/index.mjs +3 -0
  161. package/dist/uni/js/index.d.mts +5 -0
  162. package/dist/uni/js/index.mjs +5 -0
  163. package/dist/uni/js/parser/index.d.mts +3 -0
  164. package/dist/uni/js/parser/index.mjs +3 -0
  165. package/dist/uni/ts/config/index.d.mts +3 -0
  166. package/dist/uni/ts/config/index.mjs +3 -0
  167. package/dist/uni/ts/index.d.mts +5 -0
  168. package/dist/uni/ts/index.mjs +5 -0
  169. package/dist/uni/ts/parser/index.d.mts +3 -0
  170. package/dist/uni/ts/parser/index.mjs +3 -0
  171. package/dist/uni-DZmF7VCX.mjs +13 -0
  172. package/package.json +15 -15
  173. package/dist/axios/index.d.ts +0 -9
  174. package/dist/axios/js/config/index.d.ts +0 -5
  175. package/dist/axios/js/index.d.ts +0 -18
  176. package/dist/axios/ts/config/index.d.ts +0 -5
  177. package/dist/axios/ts/index.d.ts +0 -18
  178. package/dist/fetch/index.d.ts +0 -9
  179. package/dist/fetch/js/config/index.d.ts +0 -5
  180. package/dist/fetch/js/index.d.ts +0 -18
  181. package/dist/fetch/ts/config/index.d.ts +0 -5
  182. package/dist/fetch/ts/index.d.ts +0 -18
  183. package/dist/got/index.d.ts +0 -9
  184. package/dist/got/js/config/index.d.ts +0 -5
  185. package/dist/got/js/index.d.ts +0 -18
  186. package/dist/got/js/parser/index.d.ts +0 -12
  187. package/dist/got/ts/config/index.d.ts +0 -5
  188. package/dist/got/ts/index.d.ts +0 -18
  189. package/dist/got/ts/parser/index.d.ts +0 -12
  190. package/dist/index-BoRNV5uE.d.ts +0 -8
  191. package/dist/index-C-Of8dmT.d.ts +0 -8
  192. package/dist/index-DUlkpebX.d.ts +0 -8
  193. package/dist/index-doIz4HN1.d.ts +0 -8
  194. package/dist/index-ln0OpJQY.d.ts +0 -8
  195. package/dist/index.d.ts +0 -48
  196. package/dist/ky/index.d.ts +0 -9
  197. package/dist/ky/js/config/index.d.ts +0 -5
  198. package/dist/ky/js/index.d.ts +0 -18
  199. package/dist/ky/js/parser/index.d.ts +0 -12
  200. package/dist/ky/ts/config/index.d.ts +0 -5
  201. package/dist/ky/ts/index.d.ts +0 -18
  202. package/dist/ky/ts/parser/index.d.ts +0 -12
  203. package/dist/ofetch/index.d.ts +0 -9
  204. package/dist/ofetch/js/config/index.d.ts +0 -5
  205. package/dist/ofetch/js/index.d.ts +0 -18
  206. package/dist/ofetch/js/parser/index.d.ts +0 -12
  207. package/dist/ofetch/ts/config/index.d.ts +0 -5
  208. package/dist/ofetch/ts/index.d.ts +0 -18
  209. package/dist/ofetch/ts/parser/index.d.ts +0 -12
@@ -0,0 +1,9 @@
1
+ import "../index.d-DW8ts-IU.mjs";
2
+ import "../index.d-BXgDnKDv.mjs";
3
+ import { openapiPipeline } from "../index.d-BS6Sm47l.mjs";
4
+ import "../index.d-Bknp-d4G.mjs";
5
+ import "../index.d-DgggRtXp.mjs";
6
+ import { openapiPipeline$4 as openapiPipeline$1 } from "../index.d-CVL676ax.mjs";
7
+ import "../index.d-B0n5Pe6-.mjs";
8
+
9
+ export { openapiPipeline as js, openapiPipeline$1 as ts };
@@ -1,7 +1,9 @@
1
- // src/axios/index.ts
2
- import { default as default2 } from "./js/index.mjs";
3
- import { default as default3 } from "./ts/index.mjs";
4
- export {
5
- default2 as js,
6
- default3 as ts
7
- };
1
+ import "../config-CwmGeydd.mjs";
2
+ import "../parser-8NB1Nfwt.mjs";
3
+ import { js_default } from "../js-CfKFwY21.mjs";
4
+ import "../config-B89EoGE7.mjs";
5
+ import "../parser-GwoAS3rw.mjs";
6
+ import { ts_default } from "../ts-4mi0Q-kd.mjs";
7
+ import "../axios-CG6HLmR9.mjs";
8
+
9
+ export { js_default as js, ts_default as ts };
@@ -0,0 +1,3 @@
1
+ import { config$23 as config } from "../../../index.d-BXgDnKDv.mjs";
2
+
3
+ export { config };
@@ -1,18 +1,3 @@
1
- // src/axios/js/config/index.ts
2
- import { replaceMainext } from "@genapi/parser";
3
- import { config as _config } from "@genapi/pipeline";
4
- function config(userConfig) {
5
- userConfig.import = userConfig.import || {};
6
- userConfig.output = userConfig.output || {};
7
- userConfig.import.http = userConfig.import.http || "axios";
8
- userConfig.output = replaceMainext(userConfig.output) || "src/api/index.js";
9
- const configRead = _config(userConfig);
10
- configRead.graphs.imports.push({
11
- name: "http",
12
- value: userConfig.import.http
13
- });
14
- return configRead;
15
- }
16
- export {
17
- config
18
- };
1
+ import { config } from "../../../config-CwmGeydd.mjs";
2
+
3
+ export { config };
@@ -0,0 +1,5 @@
1
+ import { parser$23 as parser } from "../../index.d-DW8ts-IU.mjs";
2
+ import { config$23 as config } from "../../index.d-BXgDnKDv.mjs";
3
+ import { compiler$12 as compiler, dest$12 as dest, generate$12 as generate, openapiPipeline, original$12 as original } from "../../index.d-BS6Sm47l.mjs";
4
+
5
+ export { compiler, config, openapiPipeline as default, dest, generate, original, parser };
@@ -1,31 +1,5 @@
1
- // src/axios/js/index.ts
2
- import pipeline, { compiler, dest, generate, original } from "@genapi/pipeline";
3
- import { config } from "./config/index.mjs";
4
- import { parser } from "./parser/index.mjs";
5
- function openapiPipeline(userConfig) {
6
- const process = pipeline(
7
- (userConfig2) => config(userConfig2),
8
- (configRead) => original(configRead),
9
- (configRead) => parser(configRead),
10
- (configRead) => compiler(configRead),
11
- (configRead) => generate(configRead),
12
- (configRead) => dest(configRead)
13
- );
14
- return process(userConfig);
15
- }
16
- openapiPipeline.config = config;
17
- openapiPipeline.original = original;
18
- openapiPipeline.parser = parser;
19
- openapiPipeline.compiler = compiler;
20
- openapiPipeline.generate = generate;
21
- openapiPipeline.dest = dest;
22
- var js_default = openapiPipeline;
23
- export {
24
- compiler,
25
- config,
26
- js_default as default,
27
- dest,
28
- generate,
29
- original,
30
- parser
31
- };
1
+ import { config } from "../../config-CwmGeydd.mjs";
2
+ import { parser } from "../../parser-8NB1Nfwt.mjs";
3
+ import { compiler, dest, generate, js_default, original } from "../../js-CfKFwY21.mjs";
4
+
5
+ export { compiler, config, js_default as default, dest, generate, original, parser };
@@ -0,0 +1,3 @@
1
+ import { PathsTransformOptions$11 as PathsTransformOptions, parser$23 as parser, transformPaths$23 as transformPaths } from "../../../index.d-DW8ts-IU.mjs";
2
+
3
+ export { PathsTransformOptions, parser, transformPaths };
@@ -1,77 +1,3 @@
1
- // src/axios/js/parser/index.ts
2
- import {
3
- literalFieldsToString,
4
- parseHeaderCommits,
5
- parseMethodMetadata,
6
- parseMethodParameters,
7
- parseOpenapiSpecification,
8
- transformBaseURL,
9
- transformDefinitions,
10
- transformParameters,
11
- transformUrlSyntax,
12
- traversePaths
13
- } from "@genapi/parser";
14
- function parser(configRead) {
15
- const source = parseOpenapiSpecification(configRead.source);
16
- const comments = parseHeaderCommits(source);
17
- const interfaces = [];
18
- const functions = [];
19
- transformBaseURL(source, {
20
- configRead
21
- });
22
- transformDefinitions(source.definitions, {
23
- interfaces
24
- });
25
- transformPaths(source.paths, {
26
- configRead,
27
- functions,
28
- interfaces
29
- });
30
- configRead.graphs.comments = comments;
31
- configRead.graphs.functions = functions;
32
- configRead.graphs.interfaces = interfaces;
33
- return configRead;
34
- }
35
- function transformPaths(paths, { configRead, functions, interfaces }) {
36
- traversePaths(paths, (config) => {
37
- const { parameters, interfaces: attachInters, options } = parseMethodParameters(config, {
38
- body: "data",
39
- query: "params"
40
- });
41
- let { name, description, url, responseType } = parseMethodMetadata(config);
42
- options.push(["...", "config"]);
43
- interfaces.push(...attachInters);
44
- parameters.push({
45
- type: "import('axios').AxiosRequestConfig",
46
- name: "config",
47
- required: false
48
- });
49
- options.unshift("url");
50
- options.unshift(["method", `"${config.method}"`]);
51
- if (configRead.config.baseURL)
52
- options.unshift("baseURL");
53
- transformParameters(parameters, {
54
- syntax: "ecmascript",
55
- configRead,
56
- description,
57
- interfaces,
58
- responseType,
59
- generic: "import('axios').AxiosResponse<{__type__}>"
60
- });
61
- url = transformUrlSyntax(url);
62
- functions.push({
63
- export: true,
64
- name,
65
- description,
66
- parameters,
67
- body: [
68
- `const url = ${url}`,
69
- `return http.request({ ${literalFieldsToString(options)} })`
70
- ]
71
- });
72
- });
73
- }
74
- export {
75
- parser,
76
- transformPaths
77
- };
1
+ import { parser, transformPaths } from "../../../parser-8NB1Nfwt.mjs";
2
+
3
+ export { parser, transformPaths };
@@ -0,0 +1,3 @@
1
+ import { config$20 as config } from "../../../index.d-DgggRtXp.mjs";
2
+
3
+ export { config };
@@ -1,22 +1,3 @@
1
- // src/axios/ts/config/index.ts
2
- import { config as _config } from "@genapi/pipeline";
3
- function config(userConfig) {
4
- userConfig.import = userConfig.import || {};
5
- userConfig.import.http = userConfig.import.http || "axios";
6
- const configRead = _config(userConfig);
7
- configRead.graphs.imports.push({
8
- name: "http",
9
- names: userConfig.import.http === "axios" ? ["AxiosRequestConfig"] : void 0,
10
- value: userConfig.import.http
11
- });
12
- if (userConfig.import.http !== "axios") {
13
- configRead.graphs.imports.push({
14
- names: ["AxiosRequestConfig"],
15
- value: "axios"
16
- });
17
- }
18
- return configRead;
19
- }
20
- export {
21
- config
22
- };
1
+ import { config$1 as config } from "../../../config-B89EoGE7.mjs";
2
+
3
+ export { config };
@@ -0,0 +1,5 @@
1
+ import { parser$14 as parser } from "../../index.d-Bknp-d4G.mjs";
2
+ import { config$20 as config } from "../../index.d-DgggRtXp.mjs";
3
+ import { compiler$16 as compiler, dest$16 as dest, generate$16 as generate, openapiPipeline$4 as openapiPipeline, original$16 as original } from "../../index.d-CVL676ax.mjs";
4
+
5
+ export { compiler, config, openapiPipeline as default, dest, generate, original, parser };
@@ -1,31 +1,5 @@
1
- // src/axios/ts/index.ts
2
- import pipeline, { compiler, dest, generate, original } from "@genapi/pipeline";
3
- import { config } from "./config/index.mjs";
4
- import { parser } from "./parser/index.mjs";
5
- function openapiPipeline(userConfig) {
6
- const process = pipeline(
7
- (userConfig2) => config(userConfig2),
8
- (configRead) => original(configRead),
9
- (configRead) => parser(configRead),
10
- (configRead) => compiler(configRead),
11
- (configRead) => generate(configRead),
12
- (configRead) => dest(configRead)
13
- );
14
- return process(userConfig);
15
- }
16
- openapiPipeline.config = config;
17
- openapiPipeline.original = original;
18
- openapiPipeline.parser = parser;
19
- openapiPipeline.compiler = compiler;
20
- openapiPipeline.generate = generate;
21
- openapiPipeline.dest = dest;
22
- var ts_default = openapiPipeline;
23
- export {
24
- compiler,
25
- config,
26
- ts_default as default,
27
- dest,
28
- generate,
29
- original,
30
- parser
31
- };
1
+ import { config$1 as config } from "../../config-B89EoGE7.mjs";
2
+ import { parser$1 as parser } from "../../parser-GwoAS3rw.mjs";
3
+ import { compiler$1 as compiler, dest$1 as dest, generate$1 as generate, original$1 as original, ts_default } from "../../ts-4mi0Q-kd.mjs";
4
+
5
+ export { compiler, config, ts_default as default, dest, generate, original, parser };
@@ -0,0 +1,3 @@
1
+ import { PathsTransformOptions$2 as PathsTransformOptions, parser$14 as parser, transformPaths$14 as transformPaths } from "../../../index.d-Bknp-d4G.mjs";
2
+
3
+ export { PathsTransformOptions, parser, transformPaths };
@@ -1,76 +1,3 @@
1
- // src/axios/ts/parser/index.ts
2
- import {
3
- literalFieldsToString,
4
- parseHeaderCommits,
5
- parseMethodMetadata,
6
- parseMethodParameters,
7
- parseOpenapiSpecification,
8
- transformBaseURL,
9
- transformDefinitions,
10
- transformParameters,
11
- transformUrlSyntax,
12
- traversePaths
13
- } from "@genapi/parser";
14
- function parser(configRead) {
15
- const source = parseOpenapiSpecification(configRead.source);
16
- const comments = parseHeaderCommits(source);
17
- const interfaces = [];
18
- const functions = [];
19
- transformBaseURL(source, {
20
- configRead
21
- });
22
- transformDefinitions(source.definitions, {
23
- interfaces
24
- });
25
- transformPaths(source.paths, {
26
- configRead,
27
- functions,
28
- interfaces
29
- });
30
- configRead.graphs.comments = comments;
31
- configRead.graphs.functions = functions;
32
- configRead.graphs.interfaces = interfaces;
33
- return configRead;
34
- }
35
- function transformPaths(paths, { configRead, functions, interfaces }) {
36
- traversePaths(paths, (config) => {
37
- const { parameters, interfaces: attachInters, options } = parseMethodParameters(config, {
38
- body: "data",
39
- query: "params"
40
- });
41
- let { name, description, url, responseType } = parseMethodMetadata(config);
42
- options.push(["...", "config"]);
43
- interfaces.push(...attachInters);
44
- parameters.push({
45
- name: "config",
46
- type: "AxiosRequestConfig",
47
- required: false
48
- });
49
- options.unshift("url");
50
- options.unshift(["method", `"${config.method}"`]);
51
- if (configRead.config.baseURL)
52
- options.unshift("baseURL");
53
- const { spaceResponseType } = transformParameters(parameters, {
54
- syntax: "typescript",
55
- configRead,
56
- description,
57
- interfaces,
58
- responseType
59
- });
60
- url = transformUrlSyntax(url);
61
- functions.push({
62
- export: true,
63
- name,
64
- description,
65
- parameters,
66
- body: [
67
- `const url = ${url}`,
68
- `return http.request<${spaceResponseType}>({ ${literalFieldsToString(options)} })`
69
- ]
70
- });
71
- });
72
- }
73
- export {
74
- parser,
75
- transformPaths
76
- };
1
+ import { parser$1 as parser, transformPaths$1 as transformPaths } from "../../../parser-GwoAS3rw.mjs";
2
+
3
+ export { parser, transformPaths };
@@ -0,0 +1,13 @@
1
+ import { __export } from "./chunk-BL35Yyzp.mjs";
2
+ import { js_default } from "./js-CfKFwY21.mjs";
3
+ import { ts_default } from "./ts-4mi0Q-kd.mjs";
4
+
5
+ //#region src/axios/index.ts
6
+ var axios_exports = {};
7
+ __export(axios_exports, {
8
+ js: () => js_default,
9
+ ts: () => ts_default
10
+ });
11
+
12
+ //#endregion
13
+ export { axios_exports };
@@ -0,0 +1,12 @@
1
+
2
+ //#region rolldown:runtime
3
+ var __defProp = Object.defineProperty;
4
+ var __export = (target, all) => {
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ };
10
+
11
+ //#endregion
12
+ export { __export };
@@ -0,0 +1,12 @@
1
+ import { config } from "@genapi/pipeline";
2
+
3
+ //#region src/fetch/ts/config/index.ts
4
+ function config$1(userConfig) {
5
+ userConfig.import = userConfig.import || {};
6
+ userConfig.import.http = userConfig.import.http || "axios";
7
+ const configRead = config(userConfig);
8
+ return configRead;
9
+ }
10
+
11
+ //#endregion
12
+ export { config$1 as config$4 };
@@ -0,0 +1,21 @@
1
+ import { config } from "@genapi/pipeline";
2
+
3
+ //#region src/axios/ts/config/index.ts
4
+ function config$1(userConfig) {
5
+ userConfig.import = userConfig.import || {};
6
+ userConfig.import.http = userConfig.import.http || "axios";
7
+ const configRead = config(userConfig);
8
+ configRead.graphs.imports.push({
9
+ name: "http",
10
+ names: userConfig.import.http === "axios" ? ["AxiosRequestConfig"] : void 0,
11
+ value: userConfig.import.http
12
+ });
13
+ if (userConfig.import.http !== "axios") configRead.graphs.imports.push({
14
+ names: ["AxiosRequestConfig"],
15
+ value: "axios"
16
+ });
17
+ return configRead;
18
+ }
19
+
20
+ //#endregion
21
+ export { config$1 };
@@ -0,0 +1,21 @@
1
+ import { config } from "@genapi/pipeline";
2
+
3
+ //#region src/ky/ts/config/index.ts
4
+ function config$1(userConfig) {
5
+ userConfig.import = userConfig.import || {};
6
+ userConfig.import.http = userConfig.import.http || "ky";
7
+ const configRead = config(userConfig);
8
+ configRead.graphs.imports.push({
9
+ name: "http",
10
+ names: userConfig.import.http === "ky" ? ["Options"] : void 0,
11
+ value: userConfig.import.http
12
+ });
13
+ if (userConfig.import.http !== "ky") configRead.graphs.imports.push({
14
+ names: ["Options"],
15
+ value: "ky"
16
+ });
17
+ return configRead;
18
+ }
19
+
20
+ //#endregion
21
+ export { config$1 as config$7 };
@@ -0,0 +1,21 @@
1
+ import { config } from "@genapi/pipeline";
2
+
3
+ //#region src/ofetch/ts/config/index.ts
4
+ function config$1(userConfig) {
5
+ userConfig.import = userConfig.import || {};
6
+ userConfig.import.http = userConfig.import.http || "ofetch";
7
+ const configRead = config(userConfig);
8
+ configRead.graphs.imports.push({
9
+ name: "ofetch",
10
+ names: userConfig.import.http === "ofetch" ? ["FetchOptions"] : void 0,
11
+ value: userConfig.import.http
12
+ });
13
+ if (userConfig.import.http !== "ofetch") configRead.graphs.imports.push({
14
+ names: ["FetchOptions"],
15
+ value: "ofetch"
16
+ });
17
+ return configRead;
18
+ }
19
+
20
+ //#endregion
21
+ export { config$1 as config$9 };
@@ -0,0 +1,21 @@
1
+ import { config } from "@genapi/pipeline";
2
+
3
+ //#region src/uni/ts/config/index.ts
4
+ function config$1(userConfig) {
5
+ userConfig.import = userConfig.import || {};
6
+ userConfig.import.http = userConfig.import.http || "@uni-helper/uni-network";
7
+ const configRead = config(userConfig);
8
+ configRead.graphs.imports.push({
9
+ name: "http",
10
+ names: userConfig.import.http === "@uni-helper/uni-network" ? ["UnConfig"] : void 0,
11
+ value: userConfig.import.http
12
+ });
13
+ if (userConfig.import.http !== "@uni-helper/uni-network") configRead.graphs.imports.push({
14
+ names: ["UnConfig"],
15
+ value: "@uni-helper/uni-network"
16
+ });
17
+ return configRead;
18
+ }
19
+
20
+ //#endregion
21
+ export { config$1 as config$11 };
@@ -0,0 +1,19 @@
1
+ import { config } from "@genapi/pipeline";
2
+ import { replaceMainext } from "@genapi/parser";
3
+
4
+ //#region src/axios/js/config/index.ts
5
+ function config$1(userConfig) {
6
+ userConfig.import = userConfig.import || {};
7
+ userConfig.output = userConfig.output || {};
8
+ userConfig.import.http = userConfig.import.http || "axios";
9
+ userConfig.output = replaceMainext(userConfig.output) || "src/api/index.js";
10
+ const configRead = config(userConfig);
11
+ configRead.graphs.imports.push({
12
+ name: "http",
13
+ value: userConfig.import.http
14
+ });
15
+ return configRead;
16
+ }
17
+
18
+ //#endregion
19
+ export { config$1 as config };
@@ -0,0 +1,19 @@
1
+ import { config } from "@genapi/pipeline";
2
+ import { replaceMainext } from "@genapi/parser";
3
+
4
+ //#region src/got/js/config/index.ts
5
+ function config$1(userConfig) {
6
+ userConfig.import = userConfig.import || {};
7
+ userConfig.output = userConfig.output || {};
8
+ userConfig.import.http = userConfig.import.http || "got";
9
+ userConfig.output = replaceMainext(userConfig.output) || "src/api/index.js";
10
+ const configRead = config(userConfig);
11
+ configRead.graphs.imports.push({
12
+ name: "http",
13
+ value: userConfig.import.http
14
+ });
15
+ return configRead;
16
+ }
17
+
18
+ //#endregion
19
+ export { config$1 as config$2 };
@@ -0,0 +1,19 @@
1
+ import { config } from "@genapi/pipeline";
2
+ import { replaceMainext } from "@genapi/parser";
3
+
4
+ //#region src/ky/js/config/index.ts
5
+ function config$1(userConfig) {
6
+ userConfig.import = userConfig.import || {};
7
+ userConfig.output = userConfig.output || {};
8
+ userConfig.import.http = userConfig.import.http || "ky";
9
+ userConfig.output = replaceMainext(userConfig.output) || "src/api/index.js";
10
+ const configRead = config(userConfig);
11
+ configRead.graphs.imports.push({
12
+ name: "http",
13
+ value: userConfig.import.http
14
+ });
15
+ return configRead;
16
+ }
17
+
18
+ //#endregion
19
+ export { config$1 as config$6 };
@@ -0,0 +1,19 @@
1
+ import { config } from "@genapi/pipeline";
2
+ import { replaceMainext } from "@genapi/parser";
3
+
4
+ //#region src/ofetch/js/config/index.ts
5
+ function config$1(userConfig) {
6
+ userConfig.import = userConfig.import || {};
7
+ userConfig.output = userConfig.output || {};
8
+ userConfig.import.http = userConfig.import.http || "ofetch";
9
+ userConfig.output = replaceMainext(userConfig.output) || "src/api/index.js";
10
+ const configRead = config(userConfig);
11
+ configRead.graphs.imports.push({
12
+ name: "ofetch",
13
+ value: userConfig.import.http
14
+ });
15
+ return configRead;
16
+ }
17
+
18
+ //#endregion
19
+ export { config$1 as config$8 };
@@ -0,0 +1,19 @@
1
+ import { config } from "@genapi/pipeline";
2
+ import { replaceMainext } from "@genapi/parser";
3
+
4
+ //#region src/uni/js/config/index.ts
5
+ function config$1(userConfig) {
6
+ userConfig.import = userConfig.import || {};
7
+ userConfig.output = userConfig.output || {};
8
+ userConfig.import.http = userConfig.import.http || "@uni-helper/uni-network";
9
+ userConfig.output = replaceMainext(userConfig.output) || "src/api/index.js";
10
+ const configRead = config(userConfig);
11
+ configRead.graphs.imports.push({
12
+ name: "http",
13
+ value: userConfig.import.http
14
+ });
15
+ return configRead;
16
+ }
17
+
18
+ //#endregion
19
+ export { config$1 as config$10 };
@@ -0,0 +1,14 @@
1
+ import { config } from "@genapi/pipeline";
2
+ import { replaceMainext } from "@genapi/parser";
3
+
4
+ //#region src/fetch/js/config/index.ts
5
+ function config$1(userConfig) {
6
+ userConfig.import = userConfig.import || {};
7
+ userConfig.output = userConfig.output || {};
8
+ userConfig.output = replaceMainext(userConfig.output) || "src/api/index.js";
9
+ const configRead = config(userConfig);
10
+ return configRead;
11
+ }
12
+
13
+ //#endregion
14
+ export { config$1 as config$3 };
@@ -0,0 +1,21 @@
1
+ import { config } from "@genapi/pipeline";
2
+
3
+ //#region src/got/ts/config/index.ts
4
+ function config$1(userConfig) {
5
+ userConfig.import = userConfig.import || {};
6
+ userConfig.import.http = userConfig.import.http || "got";
7
+ const configRead = config(userConfig);
8
+ configRead.graphs.imports.push({
9
+ name: "http",
10
+ names: userConfig.import.http === "got" ? ["OptionsOfTextResponseBody"] : void 0,
11
+ value: userConfig.import.http
12
+ });
13
+ if (userConfig.import.http !== "got") configRead.graphs.imports.push({
14
+ names: ["OptionsOfTextResponseBody"],
15
+ value: "got"
16
+ });
17
+ return configRead;
18
+ }
19
+
20
+ //#endregion
21
+ export { config$1 as config$5 };
@@ -0,0 +1,9 @@
1
+ import "../index.d-D1pp_HCy.mjs";
2
+ import "../index.d-BguloXfs.mjs";
3
+ import { openapiPipeline$7 as openapiPipeline } from "../index.d-BgvbkDJL.mjs";
4
+ import "../index.d-BB-bpoWw.mjs";
5
+ import "../index.d-O3Nkol5h.mjs";
6
+ import { openapiPipeline$8 as openapiPipeline$1 } from "../index.d-BupSEh4R.mjs";
7
+ import "../index.d-BDMFuIpi.mjs";
8
+
9
+ export { openapiPipeline as js, openapiPipeline$1 as ts };
@@ -1,7 +1,9 @@
1
- // src/fetch/index.ts
2
- import { default as default2 } from "./js/index.mjs";
3
- import { default as default3 } from "./ts/index.mjs";
4
- export {
5
- default2 as js,
6
- default3 as ts
7
- };
1
+ import "../config-DuQgIn7U.mjs";
2
+ import "../parser-DCA-N9mk.mjs";
3
+ import { js_default$2 as js_default } from "../js-DwgoBEjQ.mjs";
4
+ import "../config-B6UDPRkS.mjs";
5
+ import "../parser-DY9NSCKJ.mjs";
6
+ import { ts_default$1 as ts_default } from "../ts-CMn2aSnV.mjs";
7
+ import "../fetch-BtwC6Lll.mjs";
8
+
9
+ export { js_default as js, ts_default as ts };
@@ -0,0 +1,3 @@
1
+ import { config$18 as config } from "../../../index.d-BguloXfs.mjs";
2
+
3
+ export { config };