@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
@@ -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$2 as config } from "../../config-BJZnXcL3.mjs";
2
+ import { parser$2 as parser } from "../../parser-CAdkVm2b.mjs";
3
+ import { compiler$2 as compiler, dest$2 as dest, generate$2 as generate, js_default$1 as js_default, original$2 as original } from "../../js-CqtsolD8.mjs";
4
+
5
+ export { compiler, config, js_default as default, dest, generate, original, parser };
@@ -0,0 +1,3 @@
1
+ import { PathsTransformOptions$4 as PathsTransformOptions, parser$14 as parser, transformPaths$14 as transformPaths } from "../../../index.d-C10wnMdy.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$2 as parser, transformPaths$2 as transformPaths } from "../../../parser-CAdkVm2b.mjs";
2
+
3
+ export { parser, transformPaths };
@@ -0,0 +1,3 @@
1
+ import { config$11 as config } from "../../../index.d-DkWb7AYg.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$16 as parser } from "../../index.d-D6AeBSov.mjs";
2
+ import { config$11 as config } from "../../index.d-DkWb7AYg.mjs";
3
+ import { compiler$12 as compiler, dest$12 as dest, generate$12 as generate, openapiPipeline$2 as openapiPipeline, original$12 as original } from "../../index.d-DndBUrRi.mjs";
4
+
5
+ export { compiler, config, openapiPipeline as default, dest, generate, original, parser };
@@ -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$5 as parser } from "../../parser-aevzlGBk.mjs";
3
+ import { compiler$4 as compiler, dest$4 as dest, generate$4 as generate, original$4 as original, ts_default$1 as ts_default } from "../../ts-BLbY66M1.mjs";
4
+
5
+ export { compiler, config, ts_default as default, dest, generate, original, parser };
@@ -0,0 +1,3 @@
1
+ import { PathsTransformOptions$6 as PathsTransformOptions, parser$16 as parser, transformPaths$16 as transformPaths } from "../../../index.d-D6AeBSov.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$5 as parser, transformPaths$5 as transformPaths } from "../../../parser-aevzlGBk.mjs";
2
+
3
+ export { parser, transformPaths };
@@ -0,0 +1,13 @@
1
+ import { __export } from "./chunk-BL35Yyzp.mjs";
2
+ import { js_default$1 as js_default } from "./js-CqtsolD8.mjs";
3
+ import { ts_default$1 as ts_default } from "./ts-BLbY66M1.mjs";
4
+
5
+ //#region src/fetch/index.ts
6
+ var fetch_exports = {};
7
+ __export(fetch_exports, {
8
+ js: () => js_default,
9
+ ts: () => ts_default
10
+ });
11
+
12
+ //#endregion
13
+ export { fetch_exports };
@@ -0,0 +1,9 @@
1
+ import "../index.d-BvMhV1lw.mjs";
2
+ import "../index.d-Dx6IWWI4.mjs";
3
+ import { openapiPipeline$9 as openapiPipeline } from "../index.d-BCl4h5vb.mjs";
4
+ import "../index.d-Ch6ZYMn0.mjs";
5
+ import "../index.d-Dsok7fEc.mjs";
6
+ import { openapiPipeline$8 as openapiPipeline$1 } from "../index.d-B5ex0iL6.mjs";
7
+ import "../index.d-sEb0cOvU.mjs";
8
+
9
+ export { openapiPipeline as js, openapiPipeline$1 as ts };
@@ -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-CDvaM7ZL.mjs";
2
+ import "../parser-BkWqv1qf.mjs";
3
+ import { js_default$2 as js_default } from "../js-t1rqZHU4.mjs";
4
+ import "../config-aVU8JEKy.mjs";
5
+ import "../parser-ZdK3ZwJM.mjs";
6
+ import { ts_default$2 as ts_default } from "../ts-DjVYemin.mjs";
7
+ import "../got-DhRc0hx6.mjs";
8
+
9
+ export { js_default as js, ts_default as ts };
@@ -0,0 +1,3 @@
1
+ import { config$16 as config } from "../../../index.d-Dx6IWWI4.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$3 as config } from "../../../config-CDvaM7ZL.mjs";
2
+
3
+ export { config };
@@ -0,0 +1,5 @@
1
+ import { parser$18 as parser } from "../../index.d-BvMhV1lw.mjs";
2
+ import { config$16 as config } from "../../index.d-Dx6IWWI4.mjs";
3
+ import { compiler$19 as compiler, dest$19 as dest, generate$19 as generate, openapiPipeline$9 as openapiPipeline, original$19 as original } from "../../index.d-BCl4h5vb.mjs";
4
+
5
+ export { compiler, config, openapiPipeline as default, dest, generate, original, parser };
@@ -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$3 as config } from "../../config-CDvaM7ZL.mjs";
2
+ import { parser$3 as parser } from "../../parser-BkWqv1qf.mjs";
3
+ import { compiler$3 as compiler, dest$3 as dest, generate$3 as generate, js_default$2 as js_default, original$3 as original } from "../../js-t1rqZHU4.mjs";
4
+
5
+ export { compiler, config, js_default as default, dest, generate, original, parser };
@@ -0,0 +1,3 @@
1
+ import { PathsTransformOptions$8 as PathsTransformOptions, parser$18 as parser, transformPaths$18 as transformPaths } from "../../../index.d-BvMhV1lw.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$3 as parser, transformPaths$3 as transformPaths } from "../../../parser-BkWqv1qf.mjs";
2
+
3
+ export { parser, transformPaths };
@@ -0,0 +1,3 @@
1
+ import { config$17 as config } from "../../../index.d-Dsok7fEc.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$15 as parser } from "../../index.d-Ch6ZYMn0.mjs";
2
+ import { config$17 as config } from "../../index.d-Dsok7fEc.mjs";
3
+ import { compiler$18 as compiler, dest$18 as dest, generate$18 as generate, openapiPipeline$8 as openapiPipeline, original$18 as original } from "../../index.d-B5ex0iL6.mjs";
4
+
5
+ export { compiler, config, openapiPipeline as default, dest, generate, original, parser };
@@ -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$4 as parser } from "../../parser-ZdK3ZwJM.mjs";
3
+ import { compiler$5 as compiler, dest$5 as dest, generate$5 as generate, original$5 as original, ts_default$2 as ts_default } from "../../ts-DjVYemin.mjs";
4
+
5
+ export { compiler, config, ts_default as default, dest, generate, original, parser };
@@ -0,0 +1,3 @@
1
+ import { PathsTransformOptions$5 as PathsTransformOptions, parser$15 as parser, transformPaths$15 as transformPaths } from "../../../index.d-Ch6ZYMn0.mjs";
2
+
3
+ export { PathsTransformOptions, parser, transformPaths };
@@ -1,82 +1,3 @@
1
- // src/got/ts/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: "OptionsOfTextResponseBody",
45
- required: false
46
- });
47
- options.push(["...", "config"]);
48
- if (configRead.config.baseURL)
49
- options.unshift(["prefixUrl", "baseURL"]);
50
- for (const parameter of parameters) {
51
- if (parameter.type === "FormData")
52
- parameter.type = "any";
53
- }
54
- const { spaceResponseType } = transformParameters(parameters, {
55
- syntax: "typescript",
56
- configRead,
57
- description,
58
- interfaces,
59
- responseType
60
- });
61
- transformBodyStringify("body", { options, parameters });
62
- transformQueryParams("query", { optionKey: "searchParams", options });
63
- url = transformUrlSyntax(url);
64
- functions.push({
65
- export: true,
66
- async: true,
67
- name,
68
- description,
69
- parameters,
70
- body: [
71
- `const response = http.${config.method}(${url}, {
72
- ${literalFieldsToString(options)}
73
- })`,
74
- `return response.json<${spaceResponseType}>()`
75
- ]
76
- });
77
- });
78
- }
79
- export {
80
- parser,
81
- transformPaths
82
- };
1
+ import { parser$4 as parser, transformPaths$4 as transformPaths } from "../../../parser-ZdK3ZwJM.mjs";
2
+
3
+ export { parser, transformPaths };
@@ -0,0 +1,13 @@
1
+ import { __export } from "./chunk-BL35Yyzp.mjs";
2
+ import { js_default$2 as js_default } from "./js-t1rqZHU4.mjs";
3
+ import { ts_default$2 as ts_default } from "./ts-DjVYemin.mjs";
4
+
5
+ //#region src/got/index.ts
6
+ var got_exports = {};
7
+ __export(got_exports, {
8
+ js: () => js_default,
9
+ ts: () => ts_default
10
+ });
11
+
12
+ //#endregion
13
+ export { got_exports };