@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
@@ -1,13 +1,3 @@
1
- // src/fetch/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.output = replaceMainext(userConfig.output) || "src/api/index.js";
8
- const configRead = _config(userConfig);
9
- return configRead;
10
- }
11
- export {
12
- config
13
- };
1
+ import { config$3 as config } from "../../../config-DuQgIn7U.mjs";
2
+
3
+ export { config };
@@ -0,0 +1,5 @@
1
+ import { parser$12 as parser } from "../../index.d-D1pp_HCy.mjs";
2
+ import { config$18 as config } from "../../index.d-BguloXfs.mjs";
3
+ import { compiler$19 as compiler, dest$19 as dest, generate$19 as generate, openapiPipeline$7 as openapiPipeline, original$19 as original } from "../../index.d-BgvbkDJL.mjs";
4
+
5
+ export { compiler, config, openapiPipeline as default, dest, generate, original, parser };
@@ -1,31 +1,5 @@
1
- // src/fetch/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$3 as config } from "../../config-DuQgIn7U.mjs";
2
+ import { parser$4 as parser } from "../../parser-DCA-N9mk.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-DwgoBEjQ.mjs";
4
+
5
+ export { compiler, config, js_default as default, dest, generate, original, parser };
@@ -0,0 +1,3 @@
1
+ import { PathsTransformOptions, parser$12 as parser, transformPaths$12 as transformPaths } from "../../../index.d-D1pp_HCy.mjs";
2
+
3
+ export { PathsTransformOptions, parser, transformPaths };
@@ -1,83 +1,3 @@
1
- // src/fetch/js/parser/index.ts
2
- import {
3
- literalFieldsToString,
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$4 as parser, transformPaths$4 as transformPaths } from "../../../parser-DCA-N9mk.mjs";
2
+
3
+ export { parser, transformPaths };
@@ -0,0 +1,3 @@
1
+ import { config$19 as config } from "../../../index.d-O3Nkol5h.mjs";
2
+
3
+ export { config };
@@ -1,11 +1,3 @@
1
- // src/fetch/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
- 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$17 as parser } from "../../index.d-BB-bpoWw.mjs";
2
+ import { config$19 as config } from "../../index.d-O3Nkol5h.mjs";
3
+ import { compiler$20 as compiler, dest$20 as dest, generate$20 as generate, openapiPipeline$8 as openapiPipeline, original$20 as original } from "../../index.d-BupSEh4R.mjs";
4
+
5
+ export { compiler, config, openapiPipeline as default, dest, generate, original, parser };
@@ -1,31 +1,5 @@
1
- // src/fetch/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$4 as config } from "../../config-B6UDPRkS.mjs";
2
+ import { parser$3 as parser } from "../../parser-DY9NSCKJ.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-CMn2aSnV.mjs";
4
+
5
+ export { compiler, config, ts_default as default, dest, generate, original, parser };
@@ -0,0 +1,3 @@
1
+ import { PathsTransformOptions$5 as PathsTransformOptions, parser$17 as parser, transformPaths$17 as transformPaths } from "../../../index.d-BB-bpoWw.mjs";
2
+
3
+ export { PathsTransformOptions, parser, transformPaths };
@@ -1,79 +1,3 @@
1
- // src/fetch/ts/parser/index.ts
2
- import {
3
- parseHeaderCommits,
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$3 as parser, transformPaths$3 as transformPaths } from "../../../parser-DY9NSCKJ.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-DwgoBEjQ.mjs";
3
+ import { ts_default$1 as ts_default } from "./ts-CMn2aSnV.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-D6gcSlpm.mjs";
2
+ import "../index.d-DrCRTA_-.mjs";
3
+ import { openapiPipeline$9 as openapiPipeline } from "../index.d-CljgOS4p.mjs";
4
+ import "../index.d-CAirdOCT.mjs";
5
+ import "../index.d-Cb9k2mo6.mjs";
6
+ import { openapiPipeline$10 as openapiPipeline$1 } from "../index.d-BulZ76hJ.mjs";
7
+ import "../index.d-BbxRLLMX.mjs";
8
+
9
+ export { openapiPipeline as js, openapiPipeline$1 as ts };
@@ -1,7 +1,9 @@
1
- // src/got/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-DAHoeaDU.mjs";
2
+ import "../parser-CE48730h.mjs";
3
+ import { js_default$1 as js_default } from "../js-DGjfw_hH.mjs";
4
+ import "../config-aVU8JEKy.mjs";
5
+ import "../parser-BJWwcP0S.mjs";
6
+ import { ts_default$2 as ts_default } from "../ts-C9t_rVQx.mjs";
7
+ import "../got-xeCavgZc.mjs";
8
+
9
+ export { js_default as js, ts_default as ts };
@@ -0,0 +1,3 @@
1
+ import { config$12 as config } from "../../../index.d-DrCRTA_-.mjs";
2
+
3
+ export { config };
@@ -1,18 +1,3 @@
1
- // src/got/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 || "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$2 as config } from "../../../config-DAHoeaDU.mjs";
2
+
3
+ export { config };
@@ -0,0 +1,5 @@
1
+ import { parser$18 as parser } from "../../index.d-D6gcSlpm.mjs";
2
+ import { config$12 as config } from "../../index.d-DrCRTA_-.mjs";
3
+ import { compiler$21 as compiler, dest$21 as dest, generate$21 as generate, openapiPipeline$9 as openapiPipeline, original$21 as original } from "../../index.d-CljgOS4p.mjs";
4
+
5
+ export { compiler, config, openapiPipeline as default, dest, generate, original, parser };
@@ -1,31 +1,5 @@
1
- // src/got/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$2 as config } from "../../config-DAHoeaDU.mjs";
2
+ import { parser$2 as parser } from "../../parser-CE48730h.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-DGjfw_hH.mjs";
4
+
5
+ export { compiler, config, js_default as default, dest, generate, original, parser };
@@ -0,0 +1,3 @@
1
+ import { PathsTransformOptions$6 as PathsTransformOptions, parser$18 as parser, transformPaths$18 as transformPaths } from "../../../index.d-D6gcSlpm.mjs";
2
+
3
+ export { PathsTransformOptions, parser, transformPaths };
@@ -1,82 +1,3 @@
1
- // src/got/js/parser/index.ts
2
- import {
3
- literalFieldsToString,
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$2 as parser, transformPaths$2 as transformPaths } from "../../../parser-CE48730h.mjs";
2
+
3
+ export { parser, transformPaths };
@@ -0,0 +1,3 @@
1
+ import { config$21 as config } from "../../../index.d-Cb9k2mo6.mjs";
2
+
3
+ export { config };
@@ -1,22 +1,3 @@
1
- // src/got/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 || "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$19 as parser } from "../../index.d-CAirdOCT.mjs";
2
+ import { config$21 as config } from "../../index.d-Cb9k2mo6.mjs";
3
+ import { compiler$22 as compiler, dest$22 as dest, generate$22 as generate, openapiPipeline$10 as openapiPipeline, original$22 as original } from "../../index.d-BulZ76hJ.mjs";
4
+
5
+ export { compiler, config, openapiPipeline as default, dest, generate, original, parser };
@@ -1,31 +1,5 @@
1
- // src/got/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$5 as config } from "../../config-aVU8JEKy.mjs";
2
+ import { parser$5 as parser } from "../../parser-BJWwcP0S.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-C9t_rVQx.mjs";
4
+
5
+ export { compiler, config, ts_default as default, dest, generate, original, parser };
@@ -0,0 +1,3 @@
1
+ import { PathsTransformOptions$7 as PathsTransformOptions, parser$19 as parser, transformPaths$19 as transformPaths } from "../../../index.d-CAirdOCT.mjs";
2
+
3
+ export { PathsTransformOptions, parser, transformPaths };