@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.
Files changed (181) 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-BJZnXcL3.mjs +14 -0
  20. package/dist/config-CDvaM7ZL.mjs +19 -0
  21. package/dist/config-CwmGeydd.mjs +19 -0
  22. package/dist/config-DdUVYIe0.mjs +19 -0
  23. package/dist/config-Dm0OCPw8.mjs +19 -0
  24. package/dist/config-Dp9C4aUE.mjs +21 -0
  25. package/dist/config-IeVj3de_.mjs +21 -0
  26. package/dist/config-aVU8JEKy.mjs +21 -0
  27. package/dist/fetch/index.d.mts +9 -0
  28. package/dist/fetch/index.mjs +9 -7
  29. package/dist/fetch/js/config/index.d.mts +3 -0
  30. package/dist/fetch/js/config/index.mjs +3 -13
  31. package/dist/fetch/js/index.d.mts +5 -0
  32. package/dist/fetch/js/index.mjs +5 -31
  33. package/dist/fetch/js/parser/index.d.mts +3 -0
  34. package/dist/fetch/js/parser/index.mjs +3 -83
  35. package/dist/fetch/ts/config/index.d.mts +3 -0
  36. package/dist/fetch/ts/config/index.mjs +3 -11
  37. package/dist/fetch/ts/index.d.mts +5 -0
  38. package/dist/fetch/ts/index.mjs +5 -31
  39. package/dist/fetch/ts/parser/index.d.mts +3 -0
  40. package/dist/fetch/ts/parser/index.mjs +3 -79
  41. package/dist/fetch-DDSgFojK.mjs +13 -0
  42. package/dist/got/index.d.mts +9 -0
  43. package/dist/got/index.mjs +9 -7
  44. package/dist/got/js/config/index.d.mts +3 -0
  45. package/dist/got/js/config/index.mjs +3 -18
  46. package/dist/got/js/index.d.mts +5 -0
  47. package/dist/got/js/index.mjs +5 -31
  48. package/dist/got/js/parser/index.d.mts +3 -0
  49. package/dist/got/js/parser/index.mjs +3 -82
  50. package/dist/got/ts/config/index.d.mts +3 -0
  51. package/dist/got/ts/config/index.mjs +3 -22
  52. package/dist/got/ts/index.d.mts +5 -0
  53. package/dist/got/ts/index.mjs +5 -31
  54. package/dist/got/ts/parser/index.d.mts +3 -0
  55. package/dist/got/ts/parser/index.mjs +3 -82
  56. package/dist/got-DhRc0hx6.mjs +13 -0
  57. package/dist/index.d-B-u-rHVf.d.mts +7 -0
  58. package/dist/index.d-B5ex0iL6.d.mts +18 -0
  59. package/dist/index.d-B6ea0pDX.d.mts +7 -0
  60. package/dist/index.d-B9YjsDSU.d.mts +7 -0
  61. package/dist/index.d-BCl4h5vb.d.mts +18 -0
  62. package/dist/index.d-BEPmcVlv.d.mts +12 -0
  63. package/dist/{axios/ts/parser/index.d.ts → index.d-BVDe1tFu.d.mts} +5 -3
  64. package/dist/index.d-Ba1tOHnm.d.mts +18 -0
  65. package/dist/{fetch/ts/parser/index.d.ts → index.d-BvMhV1lw.d.mts} +5 -3
  66. package/dist/index.d-C-mKHl9s.d.mts +7 -0
  67. package/dist/index.d-C-mT1tVI.d.mts +12 -0
  68. package/dist/index.d-C10wnMdy.d.mts +14 -0
  69. package/dist/index.d-C38NRU-q.d.mts +18 -0
  70. package/dist/index.d-CGbHzQH8.d.mts +18 -0
  71. package/dist/{axios/js/parser/index.d.ts → index.d-Ch6ZYMn0.d.mts} +5 -3
  72. package/dist/index.d-CozwYURq.d.mts +14 -0
  73. package/dist/index.d-D0ou41dA.d.mts +18 -0
  74. package/dist/index.d-D6AeBSov.d.mts +14 -0
  75. package/dist/index.d-D9OXwZhj.d.mts +7 -0
  76. package/dist/index.d-DBNQTE-q.d.mts +18 -0
  77. package/dist/index.d-DD5okdfE.d.mts +12 -0
  78. package/dist/index.d-DD9vtQSr.d.mts +14 -0
  79. package/dist/index.d-DT6dJ1Sg.d.mts +14 -0
  80. package/dist/index.d-DTsMFJM4.d.mts +18 -0
  81. package/dist/index.d-DgSgg69k.d.mts +18 -0
  82. package/dist/index.d-DkWb7AYg.d.mts +7 -0
  83. package/dist/index.d-DlncPuTy.d.mts +7 -0
  84. package/dist/index.d-DndBUrRi.d.mts +18 -0
  85. package/dist/index.d-Dsok7fEc.d.mts +7 -0
  86. package/dist/index.d-Dx6IWWI4.d.mts +7 -0
  87. package/dist/index.d-YNb6GO8o.d.mts +12 -0
  88. package/dist/index.d-qxp4tWxk.d.mts +7 -0
  89. package/dist/index.d-sEb0cOvU.d.mts +12 -0
  90. package/dist/index.d-xT7aQSB2.d.mts +14 -0
  91. package/dist/{fetch/js/parser/index.d.ts → index.d-yppv-kCz.d.mts} +5 -3
  92. package/dist/index.d.mts +47 -0
  93. package/dist/index.mjs +46 -20
  94. package/dist/js-CfKFwY21.mjs +19 -0
  95. package/dist/js-CqtsolD8.mjs +19 -0
  96. package/dist/js-DxwOJyF7.mjs +19 -0
  97. package/dist/js-nNB2l-OU.mjs +19 -0
  98. package/dist/js-t1rqZHU4.mjs +19 -0
  99. package/dist/ky/index.d.mts +9 -0
  100. package/dist/ky/index.mjs +9 -7
  101. package/dist/ky/js/config/index.d.mts +3 -0
  102. package/dist/ky/js/config/index.mjs +3 -18
  103. package/dist/ky/js/index.d.mts +5 -0
  104. package/dist/ky/js/index.mjs +5 -31
  105. package/dist/ky/js/parser/index.d.mts +3 -0
  106. package/dist/ky/js/parser/index.mjs +3 -79
  107. package/dist/ky/ts/config/index.d.mts +3 -0
  108. package/dist/ky/ts/config/index.mjs +3 -22
  109. package/dist/ky/ts/index.d.mts +5 -0
  110. package/dist/ky/ts/index.mjs +5 -31
  111. package/dist/ky/ts/parser/index.d.mts +3 -0
  112. package/dist/ky/ts/parser/index.mjs +3 -78
  113. package/dist/ky-tkF4RP6y.mjs +13 -0
  114. package/dist/ofetch/index.d.mts +9 -0
  115. package/dist/ofetch/index.mjs +9 -7
  116. package/dist/ofetch/js/config/index.d.mts +3 -0
  117. package/dist/ofetch/js/config/index.mjs +3 -18
  118. package/dist/ofetch/js/index.d.mts +5 -0
  119. package/dist/ofetch/js/index.mjs +5 -31
  120. package/dist/ofetch/js/parser/index.d.mts +3 -0
  121. package/dist/ofetch/js/parser/index.mjs +3 -78
  122. package/dist/ofetch/ts/config/index.d.mts +3 -0
  123. package/dist/ofetch/ts/config/index.mjs +3 -22
  124. package/dist/ofetch/ts/index.d.mts +5 -0
  125. package/dist/ofetch/ts/index.mjs +5 -31
  126. package/dist/ofetch/ts/parser/index.d.mts +3 -0
  127. package/dist/ofetch/ts/parser/index.mjs +3 -76
  128. package/dist/ofetch-D17IUjVF.mjs +13 -0
  129. package/dist/parser-8NB1Nfwt.mjs +63 -0
  130. package/dist/parser-B-nJrHKw.mjs +68 -0
  131. package/dist/parser-BGXx6lbG.mjs +66 -0
  132. package/dist/parser-BkWqv1qf.mjs +69 -0
  133. package/dist/parser-CAdkVm2b.mjs +77 -0
  134. package/dist/parser-CSJYNO0a.mjs +69 -0
  135. package/dist/parser-CaRC8JQj.mjs +67 -0
  136. package/dist/parser-GwoAS3rw.mjs +62 -0
  137. package/dist/parser-ZdK3ZwJM.mjs +69 -0
  138. package/dist/parser-aevzlGBk.mjs +72 -0
  139. package/dist/ts-4mi0Q-kd.mjs +19 -0
  140. package/dist/ts-B0VNlOAi.mjs +19 -0
  141. package/dist/ts-BLbY66M1.mjs +19 -0
  142. package/dist/ts-BrqtDsf2.mjs +19 -0
  143. package/dist/ts-DjVYemin.mjs +19 -0
  144. package/package.json +15 -15
  145. package/dist/axios/index.d.ts +0 -9
  146. package/dist/axios/js/config/index.d.ts +0 -5
  147. package/dist/axios/js/index.d.ts +0 -18
  148. package/dist/axios/ts/config/index.d.ts +0 -5
  149. package/dist/axios/ts/index.d.ts +0 -18
  150. package/dist/fetch/index.d.ts +0 -9
  151. package/dist/fetch/js/config/index.d.ts +0 -5
  152. package/dist/fetch/js/index.d.ts +0 -18
  153. package/dist/fetch/ts/config/index.d.ts +0 -5
  154. package/dist/fetch/ts/index.d.ts +0 -18
  155. package/dist/got/index.d.ts +0 -9
  156. package/dist/got/js/config/index.d.ts +0 -5
  157. package/dist/got/js/index.d.ts +0 -18
  158. package/dist/got/js/parser/index.d.ts +0 -12
  159. package/dist/got/ts/config/index.d.ts +0 -5
  160. package/dist/got/ts/index.d.ts +0 -18
  161. package/dist/got/ts/parser/index.d.ts +0 -12
  162. package/dist/index-BoRNV5uE.d.ts +0 -8
  163. package/dist/index-C-Of8dmT.d.ts +0 -8
  164. package/dist/index-DUlkpebX.d.ts +0 -8
  165. package/dist/index-doIz4HN1.d.ts +0 -8
  166. package/dist/index-ln0OpJQY.d.ts +0 -8
  167. package/dist/index.d.ts +0 -48
  168. package/dist/ky/index.d.ts +0 -9
  169. package/dist/ky/js/config/index.d.ts +0 -5
  170. package/dist/ky/js/index.d.ts +0 -18
  171. package/dist/ky/js/parser/index.d.ts +0 -12
  172. package/dist/ky/ts/config/index.d.ts +0 -5
  173. package/dist/ky/ts/index.d.ts +0 -18
  174. package/dist/ky/ts/parser/index.d.ts +0 -12
  175. package/dist/ofetch/index.d.ts +0 -9
  176. package/dist/ofetch/js/config/index.d.ts +0 -5
  177. package/dist/ofetch/js/index.d.ts +0 -18
  178. package/dist/ofetch/js/parser/index.d.ts +0 -12
  179. package/dist/ofetch/ts/config/index.d.ts +0 -5
  180. package/dist/ofetch/ts/index.d.ts +0 -18
  181. package/dist/ofetch/ts/parser/index.d.ts +0 -12
@@ -0,0 +1,62 @@
1
+ import { literalFieldsToString, parseHeaderCommits, parseMethodMetadata, parseMethodParameters, parseOpenapiSpecification, transformBaseURL, transformDefinitions, transformParameters, transformUrlSyntax, traversePaths } from "@genapi/parser";
2
+
3
+ //#region src/axios/ts/parser/index.ts
4
+ function parser(configRead) {
5
+ const source = parseOpenapiSpecification(configRead.source);
6
+ const comments = parseHeaderCommits(source);
7
+ const interfaces = [];
8
+ const functions = [];
9
+ transformBaseURL(source, { configRead });
10
+ transformDefinitions(source.definitions, { interfaces });
11
+ transformPaths(source.paths, {
12
+ configRead,
13
+ functions,
14
+ interfaces
15
+ });
16
+ configRead.graphs.comments = comments;
17
+ configRead.graphs.functions = functions;
18
+ configRead.graphs.interfaces = interfaces;
19
+ return configRead;
20
+ }
21
+ function transformPaths(paths, { configRead, functions, interfaces }) {
22
+ traversePaths(paths, (config) => {
23
+ /**
24
+
25
+ * function params/function options/function use interfaces
26
+
27
+ */
28
+ const { parameters, interfaces: attachInters, options } = parseMethodParameters(config, {
29
+ body: "data",
30
+ query: "params"
31
+ });
32
+ let { name, description, url, responseType } = parseMethodMetadata(config);
33
+ options.push(["...", "config"]);
34
+ interfaces.push(...attachInters);
35
+ parameters.push({
36
+ name: "config",
37
+ type: "AxiosRequestConfig",
38
+ required: false
39
+ });
40
+ options.unshift("url");
41
+ options.unshift(["method", `"${config.method}"`]);
42
+ if (configRead.config.baseURL) options.unshift("baseURL");
43
+ const { spaceResponseType } = transformParameters(parameters, {
44
+ syntax: "typescript",
45
+ configRead,
46
+ description,
47
+ interfaces,
48
+ responseType
49
+ });
50
+ url = transformUrlSyntax(url);
51
+ functions.push({
52
+ export: true,
53
+ name,
54
+ description,
55
+ parameters,
56
+ body: [`const url = ${url}`, `return http.request<${spaceResponseType}>({ ${literalFieldsToString(options)} })`]
57
+ });
58
+ });
59
+ }
60
+
61
+ //#endregion
62
+ export { parser as parser$1, transformPaths as transformPaths$1 };
@@ -0,0 +1,69 @@
1
+ import { literalFieldsToString, parseHeaderCommits, parseMethodMetadata, parseMethodParameters, parseOpenapiSpecification, transformBaseURL, transformBodyStringify, transformDefinitions, transformParameters, transformQueryParams, transformUrlSyntax, traversePaths } from "@genapi/parser";
2
+
3
+ //#region src/got/ts/parser/index.ts
4
+ function parser(configRead) {
5
+ const source = parseOpenapiSpecification(configRead.source);
6
+ const comments = parseHeaderCommits(source);
7
+ const interfaces = [];
8
+ const functions = [];
9
+ transformBaseURL(source, { configRead });
10
+ transformDefinitions(source.definitions, { interfaces });
11
+ transformPaths(source.paths, {
12
+ configRead,
13
+ functions,
14
+ interfaces
15
+ });
16
+ configRead.graphs.comments = comments;
17
+ configRead.graphs.functions = functions;
18
+ configRead.graphs.interfaces = interfaces;
19
+ return configRead;
20
+ }
21
+ function transformPaths(paths, { configRead, functions, interfaces }) {
22
+ traversePaths(paths, (config) => {
23
+ /**
24
+
25
+ * function params/function options/function use interfaces
26
+
27
+ */
28
+ const { parameters, interfaces: attachInters, options } = parseMethodParameters(config);
29
+ let { name, description, url, responseType } = parseMethodMetadata(config);
30
+ interfaces.push(...attachInters);
31
+ parameters.push({
32
+ name: "config",
33
+ type: "OptionsOfTextResponseBody",
34
+ required: false
35
+ });
36
+ options.push(["...", "config"]);
37
+ if (configRead.config.baseURL) options.unshift(["prefixUrl", "baseURL"]);
38
+ for (const parameter of parameters) if (parameter.type === "FormData") parameter.type = "any";
39
+ const { spaceResponseType } = transformParameters(parameters, {
40
+ syntax: "typescript",
41
+ configRead,
42
+ description,
43
+ interfaces,
44
+ responseType
45
+ });
46
+ transformBodyStringify("body", {
47
+ options,
48
+ parameters
49
+ });
50
+ transformQueryParams("query", {
51
+ optionKey: "searchParams",
52
+ options
53
+ });
54
+ url = transformUrlSyntax(url);
55
+ functions.push({
56
+ export: true,
57
+ async: true,
58
+ name,
59
+ description,
60
+ parameters,
61
+ body: [`const response = http.${config.method}(${url}, {
62
+ ${literalFieldsToString(options)}
63
+ })`, `return response.json<${spaceResponseType}>()`]
64
+ });
65
+ });
66
+ }
67
+
68
+ //#endregion
69
+ export { parser as parser$4, transformPaths as transformPaths$4 };
@@ -0,0 +1,72 @@
1
+ import { parseHeaderCommits, parseMethodMetadata, parseMethodParameters, parseOpenapiSpecification, transformBaseURL, transformBodyStringify, transformDefinitions, transformFetchBody, transformHeaderOptions, transformParameters, transformQueryParams, transformUrlSyntax, traversePaths } from "@genapi/parser";
2
+
3
+ //#region src/fetch/ts/parser/index.ts
4
+ function parser(configRead) {
5
+ const source = parseOpenapiSpecification(configRead.source);
6
+ const comments = parseHeaderCommits(source);
7
+ const interfaces = [];
8
+ const functions = [];
9
+ transformBaseURL(source, { configRead });
10
+ transformDefinitions(source.definitions, { interfaces });
11
+ transformPaths(source.paths, {
12
+ configRead,
13
+ functions,
14
+ interfaces
15
+ });
16
+ configRead.graphs.comments = comments;
17
+ configRead.graphs.functions = functions;
18
+ configRead.graphs.interfaces = interfaces;
19
+ return configRead;
20
+ }
21
+ function transformPaths(paths, { configRead, functions, interfaces }) {
22
+ traversePaths(paths, (config) => {
23
+ /**
24
+
25
+ * function params/function options/function use interfaces
26
+
27
+ */
28
+ const { parameters, interfaces: attachInters, options } = parseMethodParameters(config);
29
+ let { name, description, url, responseType, body } = parseMethodMetadata(config);
30
+ interfaces.push(...attachInters);
31
+ parameters.push({
32
+ name: "config",
33
+ type: "RequestInit",
34
+ required: false
35
+ });
36
+ if (config.method.toLowerCase() !== "get") options.unshift(["method", `"${config.method}"`]);
37
+ transformHeaderOptions("body", {
38
+ options,
39
+ parameters
40
+ });
41
+ options.push(["...", "config"]);
42
+ const { spaceResponseType } = transformParameters(parameters, {
43
+ syntax: "typescript",
44
+ configRead,
45
+ description,
46
+ interfaces,
47
+ responseType
48
+ });
49
+ transformBodyStringify("body", {
50
+ options,
51
+ parameters
52
+ });
53
+ url = transformQueryParams("query", {
54
+ body,
55
+ options,
56
+ url
57
+ });
58
+ url = transformUrlSyntax(url, { baseURL: configRead.config.baseURL });
59
+ const fetch = transformFetchBody(url, options, spaceResponseType);
60
+ functions.push({
61
+ export: true,
62
+ async: true,
63
+ name,
64
+ description,
65
+ parameters,
66
+ body: [...body, ...fetch]
67
+ });
68
+ });
69
+ }
70
+
71
+ //#endregion
72
+ export { parser as parser$5, transformPaths as transformPaths$5 };
@@ -0,0 +1,19 @@
1
+ import { config$1 as config } from "./config-B89EoGE7.mjs";
2
+ import { parser$1 as parser } from "./parser-GwoAS3rw.mjs";
3
+ import pipeline, { compiler as compiler$1, dest as dest$1, generate as generate$1, original as original$1 } from "@genapi/pipeline";
4
+
5
+ //#region src/axios/ts/index.ts
6
+ function openapiPipeline(userConfig) {
7
+ const process = pipeline((userConfig$1) => config(userConfig$1), (configRead) => original$1(configRead), (configRead) => parser(configRead), (configRead) => compiler$1(configRead), (configRead) => generate$1(configRead), (configRead) => dest$1(configRead));
8
+ return process(userConfig);
9
+ }
10
+ openapiPipeline.config = config;
11
+ openapiPipeline.original = original$1;
12
+ openapiPipeline.parser = parser;
13
+ openapiPipeline.compiler = compiler$1;
14
+ openapiPipeline.generate = generate$1;
15
+ openapiPipeline.dest = dest$1;
16
+ var ts_default = openapiPipeline;
17
+
18
+ //#endregion
19
+ export { compiler$1, dest$1, generate$1, original$1, ts_default };
@@ -0,0 +1,19 @@
1
+ import { config$7 as config } from "./config-Dp9C4aUE.mjs";
2
+ import { parser$7 as parser } from "./parser-BGXx6lbG.mjs";
3
+ import pipeline, { compiler as compiler$1, dest as dest$1, generate as generate$1, original as original$1 } from "@genapi/pipeline";
4
+
5
+ //#region src/ofetch/ts/index.ts
6
+ function openapiPipeline(userConfig) {
7
+ const process = pipeline((userConfig$1) => config(userConfig$1), (configRead) => original$1(configRead), (configRead) => parser(configRead), (configRead) => compiler$1(configRead), (configRead) => generate$1(configRead), (configRead) => dest$1(configRead));
8
+ return process(userConfig);
9
+ }
10
+ openapiPipeline.config = config;
11
+ openapiPipeline.original = original$1;
12
+ openapiPipeline.parser = parser;
13
+ openapiPipeline.compiler = compiler$1;
14
+ openapiPipeline.generate = generate$1;
15
+ openapiPipeline.dest = dest$1;
16
+ var ts_default = openapiPipeline;
17
+
18
+ //#endregion
19
+ export { compiler$1 as compiler$7, dest$1 as dest$7, generate$1 as generate$7, original$1 as original$7, ts_default as ts_default$3 };
@@ -0,0 +1,19 @@
1
+ import { config$4 as config } from "./config-B6UDPRkS.mjs";
2
+ import { parser$5 as parser } from "./parser-aevzlGBk.mjs";
3
+ import pipeline, { compiler as compiler$1, dest as dest$1, generate as generate$1, original as original$1 } from "@genapi/pipeline";
4
+
5
+ //#region src/fetch/ts/index.ts
6
+ function openapiPipeline(userConfig) {
7
+ const process = pipeline((userConfig$1) => config(userConfig$1), (configRead) => original$1(configRead), (configRead) => parser(configRead), (configRead) => compiler$1(configRead), (configRead) => generate$1(configRead), (configRead) => dest$1(configRead));
8
+ return process(userConfig);
9
+ }
10
+ openapiPipeline.config = config;
11
+ openapiPipeline.original = original$1;
12
+ openapiPipeline.parser = parser;
13
+ openapiPipeline.compiler = compiler$1;
14
+ openapiPipeline.generate = generate$1;
15
+ openapiPipeline.dest = dest$1;
16
+ var ts_default = openapiPipeline;
17
+
18
+ //#endregion
19
+ export { compiler$1 as compiler$4, dest$1 as dest$4, generate$1 as generate$4, original$1 as original$4, ts_default as ts_default$1 };
@@ -0,0 +1,19 @@
1
+ import { config$9 as config } from "./config-IeVj3de_.mjs";
2
+ import { parser$9 as parser } from "./parser-B-nJrHKw.mjs";
3
+ import pipeline, { compiler as compiler$1, dest as dest$1, generate as generate$1, original as original$1 } from "@genapi/pipeline";
4
+
5
+ //#region src/ky/ts/index.ts
6
+ function openapiPipeline(userConfig) {
7
+ const process = pipeline((userConfig$1) => config(userConfig$1), (configRead) => original$1(configRead), (configRead) => parser(configRead), (configRead) => compiler$1(configRead), (configRead) => generate$1(configRead), (configRead) => dest$1(configRead));
8
+ return process(userConfig);
9
+ }
10
+ openapiPipeline.config = config;
11
+ openapiPipeline.original = original$1;
12
+ openapiPipeline.parser = parser;
13
+ openapiPipeline.compiler = compiler$1;
14
+ openapiPipeline.generate = generate$1;
15
+ openapiPipeline.dest = dest$1;
16
+ var ts_default = openapiPipeline;
17
+
18
+ //#endregion
19
+ export { compiler$1 as compiler$9, dest$1 as dest$9, generate$1 as generate$9, original$1 as original$9, ts_default as ts_default$4 };
@@ -0,0 +1,19 @@
1
+ import { config$5 as config } from "./config-aVU8JEKy.mjs";
2
+ import { parser$4 as parser } from "./parser-ZdK3ZwJM.mjs";
3
+ import pipeline, { compiler as compiler$1, dest as dest$1, generate as generate$1, original as original$1 } from "@genapi/pipeline";
4
+
5
+ //#region src/got/ts/index.ts
6
+ function openapiPipeline(userConfig) {
7
+ const process = pipeline((userConfig$1) => config(userConfig$1), (configRead) => original$1(configRead), (configRead) => parser(configRead), (configRead) => compiler$1(configRead), (configRead) => generate$1(configRead), (configRead) => dest$1(configRead));
8
+ return process(userConfig);
9
+ }
10
+ openapiPipeline.config = config;
11
+ openapiPipeline.original = original$1;
12
+ openapiPipeline.parser = parser;
13
+ openapiPipeline.compiler = compiler$1;
14
+ openapiPipeline.generate = generate$1;
15
+ openapiPipeline.dest = dest$1;
16
+ var ts_default = openapiPipeline;
17
+
18
+ //#endregion
19
+ export { compiler$1 as compiler$5, dest$1 as dest$5, generate$1 as generate$5, original$1 as original$5, ts_default as ts_default$2 };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genapi/presets",
3
3
  "type": "module",
4
- "version": "3.3.0",
4
+ "version": "3.5.0",
5
5
  "author": "Hairyf <wwu710632@gmail.com>",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/hairyf/genapi#readme",
@@ -18,43 +18,43 @@
18
18
  "exports": {
19
19
  ".": "./dist/index.mjs",
20
20
  "./swag-axios-js": {
21
- "types": "./dist/axios/js/index.d.ts",
21
+ "types": "./dist/axios/js/index.d.mts",
22
22
  "default": "./dist/axios/js/index.mjs"
23
23
  },
24
24
  "./swag-axios-ts": {
25
- "types": "./dist/axios/ts/index.d.ts",
25
+ "types": "./dist/axios/ts/index.d.mts",
26
26
  "default": "./dist/axios/ts/index.mjs"
27
27
  },
28
28
  "./swag-fetch-js": {
29
- "types": "./dist/fetch/js/index.d.ts",
29
+ "types": "./dist/fetch/js/index.d.mts",
30
30
  "default": "./dist/fetch/js/index.mjs"
31
31
  },
32
32
  "./swag-fetch-ts": {
33
- "types": "./dist/fetch/ts/index.d.ts",
33
+ "types": "./dist/fetch/ts/index.d.mts",
34
34
  "default": "./dist/fetch/ts/index.mjs"
35
35
  },
36
36
  "./swag-got-js": {
37
- "types": "./dist/got/js/index.d.ts",
37
+ "types": "./dist/got/js/index.d.mts",
38
38
  "default": "./dist/got/js/index.mjs"
39
39
  },
40
40
  "./swag-got-ts": {
41
- "types": "./dist/got/ts/index.d.ts",
41
+ "types": "./dist/got/ts/index.d.mts",
42
42
  "default": "./dist/got/ts/index.mjs"
43
43
  },
44
44
  "./swag-ky-js": {
45
- "types": "./dist/ky/js/index.d.ts",
45
+ "types": "./dist/ky/js/index.d.mts",
46
46
  "default": "./dist/ky/js/index.mjs"
47
47
  },
48
48
  "./swag-ky-ts": {
49
- "types": "./dist/ky/ts/index.d.ts",
49
+ "types": "./dist/ky/ts/index.d.mts",
50
50
  "default": "./dist/ky/ts/index.mjs"
51
51
  },
52
52
  "./swag-ofetch-js": {
53
- "types": "./dist/ofetch/js/index.d.ts",
53
+ "types": "./dist/ofetch/js/index.d.mts",
54
54
  "default": "./dist/ofetch/js/index.mjs"
55
55
  },
56
56
  "./swag-ofetch-ts": {
57
- "types": "./dist/ofetch/ts/index.d.ts",
57
+ "types": "./dist/ofetch/ts/index.d.mts",
58
58
  "default": "./dist/ofetch/ts/index.mjs"
59
59
  }
60
60
  },
@@ -63,12 +63,12 @@
63
63
  ],
64
64
  "dependencies": {
65
65
  "openapi-specification-types": "^0.0.3",
66
- "@genapi/parser": "3.3.0",
67
- "@genapi/shared": "3.3.0",
68
- "@genapi/pipeline": "3.3.0"
66
+ "@genapi/pipeline": "3.5.0",
67
+ "@genapi/parser": "3.5.0",
68
+ "@genapi/shared": "3.5.0"
69
69
  },
70
70
  "scripts": {
71
- "build": "tsup",
71
+ "build": "tsdown",
72
72
  "start": "tsx src/index.ts"
73
73
  }
74
74
  }
@@ -1,9 +0,0 @@
1
- export { default as js } from './js/index.js';
2
- export { default as ts } from './ts/index.js';
3
- import './js/parser/index.js';
4
- import '@genapi/shared';
5
- import 'openapi-specification-types';
6
- import '@genapi/pipeline';
7
- import './js/config/index.js';
8
- import './ts/parser/index.js';
9
- import './ts/config/index.js';
@@ -1,5 +0,0 @@
1
- import { ApiPipeline } from '@genapi/shared';
2
-
3
- declare function config(userConfig: ApiPipeline.Config): ApiPipeline.ConfigRead;
4
-
5
- export { config };
@@ -1,18 +0,0 @@
1
- import { parser } from './parser/index.js';
2
- import * as _genapi_pipeline from '@genapi/pipeline';
3
- export { compiler, dest, generate, original } from '@genapi/pipeline';
4
- import { config } from './config/index.js';
5
- import { ApiPipeline } from '@genapi/shared';
6
- import 'openapi-specification-types';
7
-
8
- declare function openapiPipeline(userConfig: ApiPipeline.Config): Promise<void>;
9
- declare namespace openapiPipeline {
10
- var config: typeof config;
11
- var original: typeof _genapi_pipeline.original;
12
- var parser: typeof parser;
13
- var compiler: typeof _genapi_pipeline.compiler;
14
- var generate: typeof _genapi_pipeline.generate;
15
- var dest: typeof _genapi_pipeline.dest;
16
- }
17
-
18
- export { config, openapiPipeline as default, parser };
@@ -1,5 +0,0 @@
1
- import { ApiPipeline } from '@genapi/shared';
2
-
3
- declare function config(userConfig: ApiPipeline.Config): ApiPipeline.ConfigRead;
4
-
5
- export { config };
@@ -1,18 +0,0 @@
1
- import { parser } from './parser/index.js';
2
- import * as _genapi_pipeline from '@genapi/pipeline';
3
- export { compiler, dest, generate, original } from '@genapi/pipeline';
4
- import { config } from './config/index.js';
5
- import { ApiPipeline } from '@genapi/shared';
6
- import 'openapi-specification-types';
7
-
8
- declare function openapiPipeline(userConfig: ApiPipeline.Config): Promise<void>;
9
- declare namespace openapiPipeline {
10
- var config: typeof config;
11
- var original: typeof _genapi_pipeline.original;
12
- var parser: typeof parser;
13
- var compiler: typeof _genapi_pipeline.compiler;
14
- var generate: typeof _genapi_pipeline.generate;
15
- var dest: typeof _genapi_pipeline.dest;
16
- }
17
-
18
- export { config, openapiPipeline as default, parser };
@@ -1,9 +0,0 @@
1
- export { default as js } from './js/index.js';
2
- export { default as ts } from './ts/index.js';
3
- import './js/parser/index.js';
4
- import '@genapi/shared';
5
- import 'openapi-specification-types';
6
- import '@genapi/pipeline';
7
- import './js/config/index.js';
8
- import './ts/parser/index.js';
9
- import './ts/config/index.js';
@@ -1,5 +0,0 @@
1
- import { ApiPipeline } from '@genapi/shared';
2
-
3
- declare function config(userConfig: ApiPipeline.Config): ApiPipeline.ConfigRead;
4
-
5
- export { config };
@@ -1,18 +0,0 @@
1
- import { parser } from './parser/index.js';
2
- import * as _genapi_pipeline from '@genapi/pipeline';
3
- export { compiler, dest, generate, original } from '@genapi/pipeline';
4
- import { config } from './config/index.js';
5
- import { ApiPipeline } from '@genapi/shared';
6
- import 'openapi-specification-types';
7
-
8
- declare function openapiPipeline(userConfig: ApiPipeline.Config): Promise<void>;
9
- declare namespace openapiPipeline {
10
- var config: typeof config;
11
- var original: typeof _genapi_pipeline.original;
12
- var parser: typeof parser;
13
- var compiler: typeof _genapi_pipeline.compiler;
14
- var generate: typeof _genapi_pipeline.generate;
15
- var dest: typeof _genapi_pipeline.dest;
16
- }
17
-
18
- export { config, openapiPipeline as default, parser };
@@ -1,5 +0,0 @@
1
- import { ApiPipeline } from '@genapi/shared';
2
-
3
- declare function config(userConfig: ApiPipeline.Config): ApiPipeline.ConfigRead;
4
-
5
- export { config };
@@ -1,18 +0,0 @@
1
- import { parser } from './parser/index.js';
2
- import * as _genapi_pipeline from '@genapi/pipeline';
3
- export { compiler, dest, generate, original } from '@genapi/pipeline';
4
- import { config } from './config/index.js';
5
- import { ApiPipeline } from '@genapi/shared';
6
- import 'openapi-specification-types';
7
-
8
- declare function openapiPipeline(userConfig: ApiPipeline.Config): Promise<void>;
9
- declare namespace openapiPipeline {
10
- var config: typeof config;
11
- var original: typeof _genapi_pipeline.original;
12
- var parser: typeof parser;
13
- var compiler: typeof _genapi_pipeline.compiler;
14
- var generate: typeof _genapi_pipeline.generate;
15
- var dest: typeof _genapi_pipeline.dest;
16
- }
17
-
18
- export { config, openapiPipeline as default, parser };
@@ -1,9 +0,0 @@
1
- export { default as js } from './js/index.js';
2
- export { default as ts } from './ts/index.js';
3
- import './js/parser/index.js';
4
- import '@genapi/shared';
5
- import 'openapi-specification-types';
6
- import '@genapi/pipeline';
7
- import './js/config/index.js';
8
- import './ts/parser/index.js';
9
- import './ts/config/index.js';
@@ -1,5 +0,0 @@
1
- import { ApiPipeline } from '@genapi/shared';
2
-
3
- declare function config(userConfig: ApiPipeline.Config): ApiPipeline.ConfigRead;
4
-
5
- export { config };
@@ -1,18 +0,0 @@
1
- import { parser } from './parser/index.js';
2
- import * as _genapi_pipeline from '@genapi/pipeline';
3
- export { compiler, dest, generate, original } from '@genapi/pipeline';
4
- import { config } from './config/index.js';
5
- import { ApiPipeline } from '@genapi/shared';
6
- import 'openapi-specification-types';
7
-
8
- declare function openapiPipeline(userConfig: ApiPipeline.Config): Promise<void>;
9
- declare namespace openapiPipeline {
10
- var config: typeof config;
11
- var original: typeof _genapi_pipeline.original;
12
- var parser: typeof parser;
13
- var compiler: typeof _genapi_pipeline.compiler;
14
- var generate: typeof _genapi_pipeline.generate;
15
- var dest: typeof _genapi_pipeline.dest;
16
- }
17
-
18
- export { config, openapiPipeline as default, parser };
@@ -1,12 +0,0 @@
1
- import { ApiPipeline, StatementInterface, StatementFunction } from '@genapi/shared';
2
- import { Paths } from 'openapi-specification-types';
3
-
4
- interface PathsTransformOptions {
5
- configRead: ApiPipeline.ConfigRead;
6
- interfaces: StatementInterface[];
7
- functions: StatementFunction[];
8
- }
9
- declare function parser(configRead: ApiPipeline.ConfigRead): ApiPipeline.ConfigRead<ApiPipeline.Config>;
10
- declare function transformPaths(paths: Paths, { configRead, functions, interfaces }: PathsTransformOptions): void;
11
-
12
- export { type PathsTransformOptions, parser, transformPaths };
@@ -1,5 +0,0 @@
1
- import { ApiPipeline } from '@genapi/shared';
2
-
3
- declare function config(userConfig: ApiPipeline.Config): ApiPipeline.ConfigRead;
4
-
5
- export { config };
@@ -1,18 +0,0 @@
1
- import { parser } from './parser/index.js';
2
- import * as _genapi_pipeline from '@genapi/pipeline';
3
- export { compiler, dest, generate, original } from '@genapi/pipeline';
4
- import { config } from './config/index.js';
5
- import { ApiPipeline } from '@genapi/shared';
6
- import 'openapi-specification-types';
7
-
8
- declare function openapiPipeline(userConfig: ApiPipeline.Config): Promise<void>;
9
- declare namespace openapiPipeline {
10
- var config: typeof config;
11
- var original: typeof _genapi_pipeline.original;
12
- var parser: typeof parser;
13
- var compiler: typeof _genapi_pipeline.compiler;
14
- var generate: typeof _genapi_pipeline.generate;
15
- var dest: typeof _genapi_pipeline.dest;
16
- }
17
-
18
- export { config, openapiPipeline as default, parser };
@@ -1,12 +0,0 @@
1
- import { ApiPipeline, StatementInterface, StatementFunction } from '@genapi/shared';
2
- import { Paths } from 'openapi-specification-types';
3
-
4
- interface PathsTransformOptions {
5
- configRead: ApiPipeline.ConfigRead;
6
- interfaces: StatementInterface[];
7
- functions: StatementFunction[];
8
- }
9
- declare function parser(configRead: ApiPipeline.ConfigRead): ApiPipeline.ConfigRead<ApiPipeline.Config>;
10
- declare function transformPaths(paths: Paths, { configRead, functions, interfaces }: PathsTransformOptions): void;
11
-
12
- export { type PathsTransformOptions, parser, transformPaths };
@@ -1,8 +0,0 @@
1
- import openapiPipeline from './ky/js/index.js';
2
- import openapiPipeline$1 from './ky/ts/index.js';
3
-
4
- declare namespace ky {
5
- export { openapiPipeline as js, openapiPipeline$1 as ts };
6
- }
7
-
8
- export { ky as k };
@@ -1,8 +0,0 @@
1
- import openapiPipeline from './got/js/index.js';
2
- import openapiPipeline$1 from './got/ts/index.js';
3
-
4
- declare namespace got {
5
- export { openapiPipeline as js, openapiPipeline$1 as ts };
6
- }
7
-
8
- export { got as g };
@@ -1,8 +0,0 @@
1
- import openapiPipeline from './ofetch/js/index.js';
2
- import openapiPipeline$1 from './ofetch/ts/index.js';
3
-
4
- declare namespace ofetch {
5
- export { openapiPipeline as js, openapiPipeline$1 as ts };
6
- }
7
-
8
- export { ofetch as o };
@@ -1,8 +0,0 @@
1
- import openapiPipeline from './fetch/js/index.js';
2
- import openapiPipeline$1 from './fetch/ts/index.js';
3
-
4
- declare namespace fetch {
5
- export { openapiPipeline as js, openapiPipeline$1 as ts };
6
- }
7
-
8
- export { fetch as f };
@@ -1,8 +0,0 @@
1
- import openapiPipeline from './axios/js/index.js';
2
- import openapiPipeline$1 from './axios/ts/index.js';
3
-
4
- declare namespace axios {
5
- export { openapiPipeline as js, openapiPipeline$1 as ts };
6
- }
7
-
8
- export { axios as a };