@ir-kit/openapi-kotlin 2.0.0 → 3.0.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 (297) hide show
  1. package/README.md +13 -13
  2. package/dist/ast/index.d.ts +152 -0
  3. package/dist/ast/index.d.ts.map +1 -0
  4. package/dist/ast/index.js +159 -0
  5. package/dist/ast/index.js.map +1 -0
  6. package/dist/generate.d.ts +1 -1
  7. package/dist/generate.d.ts.map +1 -1
  8. package/dist/generate.js +13 -27
  9. package/dist/generate.js.map +1 -1
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +1 -1
  13. package/dist/index.js.map +1 -1
  14. package/dist/ir/identifiers.d.ts +7 -0
  15. package/dist/ir/identifiers.d.ts.map +1 -1
  16. package/dist/ir/identifiers.js +92 -3
  17. package/dist/ir/identifiers.js.map +1 -1
  18. package/dist/ir/impl/body.d.ts +4 -3
  19. package/dist/ir/impl/body.d.ts.map +1 -1
  20. package/dist/ir/impl/body.js +36 -37
  21. package/dist/ir/impl/body.js.map +1 -1
  22. package/dist/ir/impl/decode.d.ts +3 -2
  23. package/dist/ir/impl/decode.d.ts.map +1 -1
  24. package/dist/ir/impl/decode.js +16 -16
  25. package/dist/ir/impl/decode.js.map +1 -1
  26. package/dist/ir/impl/headers.d.ts +1 -1
  27. package/dist/ir/impl/headers.d.ts.map +1 -1
  28. package/dist/ir/impl/headers.js +3 -3
  29. package/dist/ir/impl/headers.js.map +1 -1
  30. package/dist/ir/impl/index.d.ts +5 -2
  31. package/dist/ir/impl/index.d.ts.map +1 -1
  32. package/dist/ir/impl/index.js +6 -7
  33. package/dist/ir/impl/index.js.map +1 -1
  34. package/dist/ir/impl/request.d.ts +6 -6
  35. package/dist/ir/impl/request.d.ts.map +1 -1
  36. package/dist/ir/impl/request.js +18 -8
  37. package/dist/ir/impl/request.js.map +1 -1
  38. package/dist/ir/impl/serializer.d.ts +4 -2
  39. package/dist/ir/impl/serializer.d.ts.map +1 -1
  40. package/dist/ir/impl/serializer.js +41 -60
  41. package/dist/ir/impl/serializer.js.map +1 -1
  42. package/dist/ir/impl/url.d.ts +1 -1
  43. package/dist/ir/impl/url.d.ts.map +1 -1
  44. package/dist/ir/impl/url.js +4 -4
  45. package/dist/ir/impl/url.js.map +1 -1
  46. package/dist/ir/index.d.ts +1 -1
  47. package/dist/ir/index.d.ts.map +1 -1
  48. package/dist/ir/index.js +1 -1
  49. package/dist/ir/index.js.map +1 -1
  50. package/dist/ir/operation/body.d.ts +1 -1
  51. package/dist/ir/operation/body.d.ts.map +1 -1
  52. package/dist/ir/operation/body.js +3 -3
  53. package/dist/ir/operation/body.js.map +1 -1
  54. package/dist/ir/operation/params.d.ts +1 -1
  55. package/dist/ir/operation/params.d.ts.map +1 -1
  56. package/dist/ir/operation/params.js +3 -3
  57. package/dist/ir/operation/params.js.map +1 -1
  58. package/dist/ir/operation/response.d.ts +3 -1
  59. package/dist/ir/operation/response.d.ts.map +1 -1
  60. package/dist/ir/operation/response.js +3 -4
  61. package/dist/ir/operation/response.js.map +1 -1
  62. package/dist/ir/operation/signature.d.ts +4 -2
  63. package/dist/ir/operation/signature.d.ts.map +1 -1
  64. package/dist/ir/operation/signature.js +5 -4
  65. package/dist/ir/operation/signature.js.map +1 -1
  66. package/dist/ir/operations.d.ts +7 -1
  67. package/dist/ir/operations.d.ts.map +1 -1
  68. package/dist/ir/operations.js +14 -17
  69. package/dist/ir/operations.js.map +1 -1
  70. package/dist/ir/runtime/index.d.ts +1 -1
  71. package/dist/ir/runtime/index.d.ts.map +1 -1
  72. package/dist/ir/runtime/index.js +1 -1
  73. package/dist/ir/runtime/index.js.map +1 -1
  74. package/dist/ir/runtime/templates.d.ts +1 -21
  75. package/dist/ir/runtime/templates.d.ts.map +1 -1
  76. package/dist/ir/runtime/templates.js +24 -428
  77. package/dist/ir/runtime/templates.js.map +1 -1
  78. package/dist/ir/schema.d.ts +3 -5
  79. package/dist/ir/schema.d.ts.map +1 -1
  80. package/dist/ir/schema.js +25 -37
  81. package/dist/ir/schema.js.map +1 -1
  82. package/dist/ir/type/context.d.ts +1 -1
  83. package/dist/ir/type/context.d.ts.map +1 -1
  84. package/dist/ir/type/index.d.ts +5 -3
  85. package/dist/ir/type/index.d.ts.map +1 -1
  86. package/dist/ir/type/index.js +12 -8
  87. package/dist/ir/type/index.js.map +1 -1
  88. package/dist/ir/type/primitive.d.ts +1 -1
  89. package/dist/ir/type/primitive.d.ts.map +1 -1
  90. package/dist/ir/type/primitive.js +1 -1
  91. package/dist/ir/type/primitive.js.map +1 -1
  92. package/dist/ir/type-ops.d.ts +2 -2
  93. package/dist/ir/type-ops.d.ts.map +1 -1
  94. package/dist/ir/type-ops.js +13 -17
  95. package/dist/ir/type-ops.js.map +1 -1
  96. package/dist/kt-compiler/index.d.ts +3 -6
  97. package/dist/kt-compiler/index.d.ts.map +1 -1
  98. package/dist/kt-compiler/index.js +7 -22
  99. package/dist/kt-compiler/index.js.map +1 -1
  100. package/dist/project/build.d.ts +1 -1
  101. package/dist/project/build.d.ts.map +1 -1
  102. package/dist/project/build.js +6 -8
  103. package/dist/project/build.js.map +1 -1
  104. package/dist/project/imports.d.ts +12 -12
  105. package/dist/project/imports.d.ts.map +1 -1
  106. package/dist/project/imports.js +60 -138
  107. package/dist/project/imports.js.map +1 -1
  108. package/dist/project/layout.d.ts +1 -1
  109. package/dist/project/layout.d.ts.map +1 -1
  110. package/dist/project/layout.js +1 -3
  111. package/dist/project/layout.js.map +1 -1
  112. package/package.json +12 -10
  113. package/runtime/APIClient.kt +140 -0
  114. package/runtime/APIError.kt +42 -0
  115. package/runtime/APIInterceptors.kt +14 -0
  116. package/runtime/APIKeyLocation.kt +7 -0
  117. package/runtime/Auth.kt +86 -0
  118. package/runtime/MultipartFormBody.kt +41 -0
  119. package/runtime/QueryStyle.kt +12 -0
  120. package/runtime/RequestOptions.kt +29 -0
  121. package/runtime/URLEncoding.kt +45 -0
  122. package/dist/kt-compiler/decl/class.d.ts +0 -6
  123. package/dist/kt-compiler/decl/class.d.ts.map +0 -1
  124. package/dist/kt-compiler/decl/class.js +0 -38
  125. package/dist/kt-compiler/decl/class.js.map +0 -1
  126. package/dist/kt-compiler/decl/dataClass.d.ts +0 -3
  127. package/dist/kt-compiler/decl/dataClass.d.ts.map +0 -1
  128. package/dist/kt-compiler/decl/dataClass.js +0 -18
  129. package/dist/kt-compiler/decl/dataClass.js.map +0 -1
  130. package/dist/kt-compiler/decl/enum.d.ts +0 -3
  131. package/dist/kt-compiler/decl/enum.d.ts.map +0 -1
  132. package/dist/kt-compiler/decl/enum.js +0 -32
  133. package/dist/kt-compiler/decl/enum.js.map +0 -1
  134. package/dist/kt-compiler/decl/fun.d.ts +0 -11
  135. package/dist/kt-compiler/decl/fun.d.ts.map +0 -1
  136. package/dist/kt-compiler/decl/fun.js +0 -69
  137. package/dist/kt-compiler/decl/fun.js.map +0 -1
  138. package/dist/kt-compiler/decl/index.d.ts +0 -13
  139. package/dist/kt-compiler/decl/index.d.ts.map +0 -1
  140. package/dist/kt-compiler/decl/index.js +0 -39
  141. package/dist/kt-compiler/decl/index.js.map +0 -1
  142. package/dist/kt-compiler/decl/interface.d.ts +0 -3
  143. package/dist/kt-compiler/decl/interface.d.ts.map +0 -1
  144. package/dist/kt-compiler/decl/interface.js +0 -15
  145. package/dist/kt-compiler/decl/interface.js.map +0 -1
  146. package/dist/kt-compiler/decl/object.d.ts +0 -3
  147. package/dist/kt-compiler/decl/object.d.ts.map +0 -1
  148. package/dist/kt-compiler/decl/object.js +0 -19
  149. package/dist/kt-compiler/decl/object.js.map +0 -1
  150. package/dist/kt-compiler/decl/prop.d.ts +0 -20
  151. package/dist/kt-compiler/decl/prop.d.ts.map +0 -1
  152. package/dist/kt-compiler/decl/prop.js +0 -42
  153. package/dist/kt-compiler/decl/prop.js.map +0 -1
  154. package/dist/kt-compiler/decl/sealedClass.d.ts +0 -3
  155. package/dist/kt-compiler/decl/sealedClass.d.ts.map +0 -1
  156. package/dist/kt-compiler/decl/sealedClass.js +0 -32
  157. package/dist/kt-compiler/decl/sealedClass.js.map +0 -1
  158. package/dist/kt-compiler/decl/topLevel.d.ts +0 -3
  159. package/dist/kt-compiler/decl/topLevel.d.ts.map +0 -1
  160. package/dist/kt-compiler/decl/topLevel.js +0 -5
  161. package/dist/kt-compiler/decl/topLevel.js.map +0 -1
  162. package/dist/kt-compiler/decl/typeAlias.d.ts +0 -3
  163. package/dist/kt-compiler/decl/typeAlias.d.ts.map +0 -1
  164. package/dist/kt-compiler/decl/typeAlias.js +0 -6
  165. package/dist/kt-compiler/decl/typeAlias.js.map +0 -1
  166. package/dist/kt-compiler/expr.d.ts +0 -4
  167. package/dist/kt-compiler/expr.d.ts.map +0 -1
  168. package/dist/kt-compiler/expr.js +0 -123
  169. package/dist/kt-compiler/expr.js.map +0 -1
  170. package/dist/kt-compiler/format.d.ts +0 -20
  171. package/dist/kt-compiler/format.d.ts.map +0 -1
  172. package/dist/kt-compiler/format.js +0 -27
  173. package/dist/kt-compiler/format.js.map +0 -1
  174. package/dist/kt-compiler/stmt.d.ts +0 -4
  175. package/dist/kt-compiler/stmt.d.ts.map +0 -1
  176. package/dist/kt-compiler/stmt.js +0 -72
  177. package/dist/kt-compiler/stmt.js.map +0 -1
  178. package/dist/kt-compiler/type.d.ts +0 -3
  179. package/dist/kt-compiler/type.d.ts.map +0 -1
  180. package/dist/kt-compiler/type.js +0 -28
  181. package/dist/kt-compiler/type.js.map +0 -1
  182. package/dist/kt-dsl/decl/class.d.ts +0 -50
  183. package/dist/kt-dsl/decl/class.d.ts.map +0 -1
  184. package/dist/kt-dsl/decl/class.js +0 -33
  185. package/dist/kt-dsl/decl/class.js.map +0 -1
  186. package/dist/kt-dsl/decl/dataClass.d.ts +0 -36
  187. package/dist/kt-dsl/decl/dataClass.d.ts.map +0 -1
  188. package/dist/kt-dsl/decl/dataClass.js +0 -25
  189. package/dist/kt-dsl/decl/dataClass.js.map +0 -1
  190. package/dist/kt-dsl/decl/enum.d.ts +0 -60
  191. package/dist/kt-dsl/decl/enum.d.ts.map +0 -1
  192. package/dist/kt-dsl/decl/enum.js +0 -38
  193. package/dist/kt-dsl/decl/enum.js.map +0 -1
  194. package/dist/kt-dsl/decl/index.d.ts +0 -11
  195. package/dist/kt-dsl/decl/index.d.ts.map +0 -1
  196. package/dist/kt-dsl/decl/index.js +0 -11
  197. package/dist/kt-dsl/decl/index.js.map +0 -1
  198. package/dist/kt-dsl/decl/interface.d.ts +0 -33
  199. package/dist/kt-dsl/decl/interface.d.ts.map +0 -1
  200. package/dist/kt-dsl/decl/interface.js +0 -24
  201. package/dist/kt-dsl/decl/interface.js.map +0 -1
  202. package/dist/kt-dsl/decl/object.d.ts +0 -34
  203. package/dist/kt-dsl/decl/object.d.ts.map +0 -1
  204. package/dist/kt-dsl/decl/object.js +0 -24
  205. package/dist/kt-dsl/decl/object.js.map +0 -1
  206. package/dist/kt-dsl/decl/prop.d.ts +0 -47
  207. package/dist/kt-dsl/decl/prop.d.ts.map +0 -1
  208. package/dist/kt-dsl/decl/prop.js +0 -28
  209. package/dist/kt-dsl/decl/prop.js.map +0 -1
  210. package/dist/kt-dsl/decl/sealedClass.d.ts +0 -68
  211. package/dist/kt-dsl/decl/sealedClass.d.ts.map +0 -1
  212. package/dist/kt-dsl/decl/sealedClass.js +0 -52
  213. package/dist/kt-dsl/decl/sealedClass.js.map +0 -1
  214. package/dist/kt-dsl/decl/topLevel.d.ts +0 -19
  215. package/dist/kt-dsl/decl/topLevel.d.ts.map +0 -1
  216. package/dist/kt-dsl/decl/topLevel.js +0 -17
  217. package/dist/kt-dsl/decl/topLevel.js.map +0 -1
  218. package/dist/kt-dsl/decl/typeAlias.d.ts +0 -23
  219. package/dist/kt-dsl/decl/typeAlias.d.ts.map +0 -1
  220. package/dist/kt-dsl/decl/typeAlias.js +0 -18
  221. package/dist/kt-dsl/decl/typeAlias.js.map +0 -1
  222. package/dist/kt-dsl/decl/types.d.ts +0 -10
  223. package/dist/kt-dsl/decl/types.d.ts.map +0 -1
  224. package/dist/kt-dsl/decl/types.js +0 -2
  225. package/dist/kt-dsl/decl/types.js.map +0 -1
  226. package/dist/kt-dsl/expr/access.d.ts +0 -48
  227. package/dist/kt-dsl/expr/access.d.ts.map +0 -1
  228. package/dist/kt-dsl/expr/access.js +0 -59
  229. package/dist/kt-dsl/expr/access.js.map +0 -1
  230. package/dist/kt-dsl/expr/call.d.ts +0 -38
  231. package/dist/kt-dsl/expr/call.d.ts.map +0 -1
  232. package/dist/kt-dsl/expr/call.js +0 -38
  233. package/dist/kt-dsl/expr/call.js.map +0 -1
  234. package/dist/kt-dsl/expr/index.d.ts +0 -7
  235. package/dist/kt-dsl/expr/index.d.ts.map +0 -1
  236. package/dist/kt-dsl/expr/index.js +0 -7
  237. package/dist/kt-dsl/expr/index.js.map +0 -1
  238. package/dist/kt-dsl/expr/literal.d.ts +0 -100
  239. package/dist/kt-dsl/expr/literal.d.ts.map +0 -1
  240. package/dist/kt-dsl/expr/literal.js +0 -108
  241. package/dist/kt-dsl/expr/literal.js.map +0 -1
  242. package/dist/kt-dsl/expr/misc.d.ts +0 -45
  243. package/dist/kt-dsl/expr/misc.d.ts.map +0 -1
  244. package/dist/kt-dsl/expr/misc.js +0 -63
  245. package/dist/kt-dsl/expr/misc.js.map +0 -1
  246. package/dist/kt-dsl/expr/op.d.ts +0 -25
  247. package/dist/kt-dsl/expr/op.d.ts.map +0 -1
  248. package/dist/kt-dsl/expr/op.js +0 -24
  249. package/dist/kt-dsl/expr/op.js.map +0 -1
  250. package/dist/kt-dsl/expr/types.d.ts +0 -93
  251. package/dist/kt-dsl/expr/types.d.ts.map +0 -1
  252. package/dist/kt-dsl/expr/types.js +0 -2
  253. package/dist/kt-dsl/expr/types.js.map +0 -1
  254. package/dist/kt-dsl/file.d.ts +0 -14
  255. package/dist/kt-dsl/file.d.ts.map +0 -1
  256. package/dist/kt-dsl/file.js +0 -9
  257. package/dist/kt-dsl/file.js.map +0 -1
  258. package/dist/kt-dsl/fun.d.ts +0 -73
  259. package/dist/kt-dsl/fun.d.ts.map +0 -1
  260. package/dist/kt-dsl/fun.js +0 -50
  261. package/dist/kt-dsl/fun.js.map +0 -1
  262. package/dist/kt-dsl/index.d.ts +0 -8
  263. package/dist/kt-dsl/index.d.ts.map +0 -1
  264. package/dist/kt-dsl/index.js +0 -8
  265. package/dist/kt-dsl/index.js.map +0 -1
  266. package/dist/kt-dsl/stmt/binding.d.ts +0 -56
  267. package/dist/kt-dsl/stmt/binding.d.ts.map +0 -1
  268. package/dist/kt-dsl/stmt/binding.js +0 -70
  269. package/dist/kt-dsl/stmt/binding.js.map +0 -1
  270. package/dist/kt-dsl/stmt/control.d.ts +0 -80
  271. package/dist/kt-dsl/stmt/control.d.ts.map +0 -1
  272. package/dist/kt-dsl/stmt/control.js +0 -77
  273. package/dist/kt-dsl/stmt/control.js.map +0 -1
  274. package/dist/kt-dsl/stmt/index.d.ts +0 -4
  275. package/dist/kt-dsl/stmt/index.d.ts.map +0 -1
  276. package/dist/kt-dsl/stmt/index.js +0 -4
  277. package/dist/kt-dsl/stmt/index.js.map +0 -1
  278. package/dist/kt-dsl/stmt/types.d.ts +0 -62
  279. package/dist/kt-dsl/stmt/types.d.ts.map +0 -1
  280. package/dist/kt-dsl/stmt/types.js +0 -2
  281. package/dist/kt-dsl/stmt/types.js.map +0 -1
  282. package/dist/kt-dsl/type/builders.d.ts +0 -75
  283. package/dist/kt-dsl/type/builders.d.ts.map +0 -1
  284. package/dist/kt-dsl/type/builders.js +0 -83
  285. package/dist/kt-dsl/type/builders.js.map +0 -1
  286. package/dist/kt-dsl/type/index.d.ts +0 -3
  287. package/dist/kt-dsl/type/index.d.ts.map +0 -1
  288. package/dist/kt-dsl/type/index.js +0 -3
  289. package/dist/kt-dsl/type/index.js.map +0 -1
  290. package/dist/kt-dsl/type/types.d.ts +0 -25
  291. package/dist/kt-dsl/type/types.d.ts.map +0 -1
  292. package/dist/kt-dsl/type/types.js +0 -2
  293. package/dist/kt-dsl/type/types.js.map +0 -1
  294. package/dist/kt-dsl/visibility.d.ts +0 -2
  295. package/dist/kt-dsl/visibility.d.ts.map +0 -1
  296. package/dist/kt-dsl/visibility.js +0 -2
  297. package/dist/kt-dsl/visibility.js.map +0 -1
@@ -1,6 +1,7 @@
1
1
  import { pascal } from "@ir-kit/codegen-core";
2
- import { iterOperations } from "@ir-kit/openapi";
3
- import { ktArg, ktCall, ktExprStmt, ktFun, ktIdent, ktInterface, ktMember, ktRef, ktReturn, ktTopLevelFun, } from "../kt-dsl/index.js";
2
+ import { groupOperationsByTag } from "@ir-kit/openapi";
3
+ import { isUnit, ktArg, ktCall, ktExprStmt, ktFun, ktIdent, ktInterface, ktMember, ktRef, ktReturn, ktTopLevelFun, } from "../ast/index.js";
4
+ import { kotlinTypeIdent, newTypeNames } from "./identifiers.js";
4
5
  import { buildClientClass } from "./impl/index.js";
5
6
  import { operationSignature, } from "./operation/index.js";
6
7
  /**
@@ -11,20 +12,12 @@ import { operationSignature, } from "./operation/index.js";
11
12
  */
12
13
  export function operationsToDecls(paths, opts = {}) {
13
14
  const defaultTag = opts.defaultTag ?? "Default";
14
- const interfaceName = opts.interfaceName ?? ((tag) => `${pascal(tag)}Api`);
15
+ const interfaceName = opts.interfaceName ?? ((tag) => kotlinTypeIdent(`${tag} Api`));
15
16
  const clientClassName = opts.clientClassName ?? ((p) => `OkHttp${p}`);
16
17
  const decls = [];
17
18
  const emit = (d) => decls.push(d);
18
- const byTag = new Map();
19
- for (const { pathStr, method, op, schemeNames } of iterOperations(paths, opts.securitySchemeNames)) {
20
- const sig = operationSignature(op, method, pathStr, emit, schemeNames);
21
- const tag = op.tags?.[0] ?? defaultTag;
22
- const list = byTag.get(tag);
23
- if (list)
24
- list.push(sig);
25
- else
26
- byTag.set(tag, [sig]);
27
- }
19
+ const names = opts.names ?? newTypeNames();
20
+ const byTag = groupOperationsByTag(paths, opts.securitySchemeNames, defaultTag, ({ pathStr, method, op, schemeNames }) => operationSignature(op, method, pathStr, emit, schemeNames, names));
28
21
  let needsMultipart = false;
29
22
  let needsAuth = false;
30
23
  for (const [tag, sigs] of byTag) {
@@ -45,6 +38,7 @@ export function operationsToDecls(paths, opts = {}) {
45
38
  if (!opts.interfaceOnly) {
46
39
  const result = buildClientClass(clientClassName(ifaceName), ifaceName, allSigs, {
47
40
  open: opts.openImpl,
41
+ aliases: new Map([...(opts.aliases ?? []), ...aliasesOf(decls)]),
48
42
  });
49
43
  decls.push(result.class);
50
44
  if (result.needsMultipart)
@@ -67,8 +61,8 @@ function withResponseSignature(sig) {
67
61
  };
68
62
  }
69
63
  function withResponseReturnType(t) {
70
- const isUnit = t.kind === "primitive" && t.name === "Unit";
71
- return isUnit ? ktRef("Response") : ktRef("Pair", [t, ktRef("Response")]);
64
+ const unit = isUnit(t);
65
+ return unit ? ktRef("Response") : ktRef("Pair", [t, ktRef("Response")]);
72
66
  }
73
67
  function hasSecurity(sig) {
74
68
  return sig.securitySchemeNames.length > 0;
@@ -110,7 +104,7 @@ function signatureToConvenienceFun(sig, receiverName) {
110
104
  const callArgs = baseParams.map((p) => ktArg(ktIdent(p.name), p.name));
111
105
  callArgs.push(ktArg(ktCall(ktIdent("RequestOptions"), []), "options"));
112
106
  const forwarded = ktCall(ktMember(ktIdent("this"), sig.name), callArgs);
113
- const isUnit = sig.returnType.kind === "primitive" && sig.returnType.name === "Unit";
107
+ const unit = isUnit(sig.returnType);
114
108
  return ktFun({
115
109
  name: sig.name,
116
110
  params: baseParams,
@@ -118,7 +112,10 @@ function signatureToConvenienceFun(sig, receiverName) {
118
112
  modifiers: ["suspend"],
119
113
  doc: sig.doc,
120
114
  receiver: ktRef(receiverName),
121
- body: [isUnit ? ktExprStmt(forwarded) : ktReturn(forwarded)],
115
+ body: [unit ? ktExprStmt(forwarded) : ktReturn(forwarded)],
122
116
  });
123
117
  }
118
+ export function aliasesOf(decls) {
119
+ return decls.flatMap((d) => d.aliasOf ? [[d.name, d.aliasOf]] : []);
120
+ }
124
121
  //# sourceMappingURL=operations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../src/ir/operations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAIL,KAAK,EACL,MAAM,EACN,UAAU,EACV,KAAK,EACL,OAAO,EACP,WAAW,EACX,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,aAAa,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAEL,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAqC9B;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAiC,EACjC,OAA0B,EAAE;IAE5B,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,SAAS,CAAC;IAChD,MAAM,aAAa,GACjB,IAAI,CAAC,aAAa,IAAI,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC/D,MAAM,eAAe,GAAG,IAAI,CAAC,eAAe,IAAI,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAE9E,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,IAAI,GAAG,EAAgC,CAAC;IAEtD,KAAK,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,cAAc,CAC/D,KAAK,EACL,IAAI,CAAC,mBAAmB,CACzB,EAAE,CAAC;QACF,MAAM,GAAG,GAAG,kBA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UAAU,EAAE,GAAG,CAAC,UAAU;QAC1B,SAAS,EAAE,CAAC,SAAS,CAAC;QACtB,GAAG,EAAE,GAAG,CAAC,GAAG;QACZ,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;QAC7B,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;KAC3D,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,SAAS,CACvB,KAA4B;IAE5B,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CACzB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAqB,CAAC,CAAC,CAAC,CAAC,EAAE,CAC3D,CAAC;AACJ,CAAC"}
@@ -1,3 +1,3 @@
1
1
  export type { RuntimeFile, RuntimeOpts } from "./templates.js";
2
- export { apiClientKt, buildRuntimeFiles } from "./templates.js";
2
+ export { buildRuntimeFiles } from "./templates.js";
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ir/runtime/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ir/runtime/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1,2 +1,2 @@
1
- export { apiClientKt, buildRuntimeFiles } from "./templates.js";
1
+ export { buildRuntimeFiles } from "./templates.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ir/runtime/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ir/runtime/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1,31 +1,11 @@
1
- /**
2
- * Runtime helper sources. These files ship verbatim into every generated
3
- * SDK — no spec-driven content beyond the package name. Encoding them as
4
- * fixed Kotlin strings (rather than DSL-built) keeps the codegen surface
5
- * small: the DSL only has to model what the per-operation impl actually
6
- * uses.
7
- *
8
- * Convention: `__PACKAGE__` is replaced by the consumer-chosen package
9
- * name during `buildRuntimeFiles(...)`.
10
- */
11
1
  export interface RuntimeOpts {
12
- /** Emit `var auth: MutableMap<String, Auth>` on `APIClient` and the
13
- * `Auth` / `APIKeyLocation` files. Set when the spec declares any
14
- * `securitySchemes`. */
15
- hasAuth: boolean;
16
- /** Emit the `multipart/form-data` helper. Set when at least one op has
2
+ /** Ship the `multipart/form-data` helper. Set when at least one op has
17
3
  * a `multipart/form-data` body. */
18
4
  hasMultipart: boolean;
19
- /** Emit the `application/x-www-form-urlencoded` helper file (`FormUrlEncoder`
20
- * object). Currently this is folded into ad-hoc `FormBody.Builder` calls
21
- * in the impl, so we don't ship a dedicated runtime file for it. */
22
- hasFormUrlEncoded: boolean;
23
5
  }
24
6
  export interface RuntimeFile {
25
7
  name: string;
26
8
  content: string;
27
9
  }
28
- export declare function apiClientKt(opts: RuntimeOpts): string;
29
- /** Ordered runtime files. The orchestrator places them under `API/`. */
30
10
  export declare function buildRuntimeFiles(opts: RuntimeOpts, pkg: string): RuntimeFile[];
31
11
  //# sourceMappingURL=templates.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/ir/runtime/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,WAAW,WAAW;IAC1B;;6BAEyB;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB;wCACoC;IACpC,YAAY,EAAE,OAAO,CAAC;IACtB;;yEAEqE;IACrE,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AA+YD,wBAAgB,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAKrD;AAED,wEAAwE;AACxE,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,MAAM,GACV,WAAW,EAAE,CAwBf"}
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/ir/runtime/templates.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,WAAW;IAC1B;wCACoC;IACpC,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAaD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,MAAM,GACV,WAAW,EAAE,CAWf"}
@@ -1,431 +1,27 @@
1
- /**
2
- * Runtime helper sources. These files ship verbatim into every generated
3
- * SDK — no spec-driven content beyond the package name. Encoding them as
4
- * fixed Kotlin strings (rather than DSL-built) keeps the codegen surface
5
- * small: the DSL only has to model what the per-operation impl actually
6
- * uses.
7
- *
8
- * Convention: `__PACKAGE__` is replaced by the consumer-chosen package
9
- * name during `buildRuntimeFiles(...)`.
10
- */
11
- const API_INTERCEPTORS_KT = `package __PACKAGE__
12
-
13
- import okhttp3.Request
14
-
15
- /**
16
- * Bag of per-request mutation hooks. Mirrors hey-api's TS client where
17
- * \`client.interceptors.request.use(fn)\` registers an interceptor that
18
- * runs against every outgoing request. Multiple interceptors compose —
19
- * auth, logging, and tracing all coexist as separate entries instead
20
- * of being chained inside one closure.
21
- */
22
- public class APIInterceptors {
23
- public val request: MutableList<suspend (Request) -> Request> = mutableListOf()
24
- }
25
- `;
26
- const API_ERROR_KT = `package __PACKAGE__
27
-
28
- /**
29
- * The typed error every impl method throws on non-2xx responses.
30
- *
31
- * - \`ClientError(statusCode, body)\` — 4XX
32
- * - \`ServerError(statusCode, body)\` — 5XX
33
- * - \`UnexpectedStatus(statusCode, body)\` — 1XX/3XX/anything outside 2-5
34
- * - \`DecodingFailed(cause)\` — kotlinx-serialization threw on a 2XX body
35
- * - \`Transport(cause)\` — OkHttp / network-layer failure
36
- *
37
- * Consumers \`catch\` and pattern-match. Bodies are surfaced as raw
38
- * \`ByteArray\` so callers can decode error envelopes themselves with the
39
- * codec they prefer.
40
- */
41
- public sealed class APIError(message: String? = null, cause: Throwable? = null) :
42
- RuntimeException(message, cause) {
43
-
44
- public class ClientError(
45
- public val statusCode: Int,
46
- public val body: ByteArray,
47
- ) : APIError("Client error: \$statusCode")
48
-
49
- public class ServerError(
50
- public val statusCode: Int,
51
- public val body: ByteArray,
52
- ) : APIError("Server error: \$statusCode")
53
-
54
- public class UnexpectedStatus(
55
- public val statusCode: Int,
56
- public val body: ByteArray,
57
- ) : APIError("Unexpected status: \$statusCode")
58
-
59
- public class DecodingFailed(cause: Throwable) :
60
- APIError("Decoding failed: \${cause.message}", cause)
61
-
62
- public class Transport(cause: Throwable) :
63
- APIError("Transport failure: \${cause.message}", cause)
64
- }
65
- `;
66
- const QUERY_STYLE_KT = `package __PACKAGE__
67
-
68
- /**
69
- * Query-array serialization style — matches the OpenAPI 3 \`style\` field
70
- * for query parameters whose value is an array. The default is \`form\`
71
- * with explode=true; the others appear when the spec opts into them.
72
- */
73
- public enum class QueryStyle {
74
- FORM,
75
- SPACE_DELIMITED,
76
- PIPE_DELIMITED,
77
- }
78
- `;
79
- const URL_ENCODING_KT = `package __PACKAGE__
80
-
81
- import okhttp3.HttpUrl
82
-
83
- /**
84
- * Helpers used by generated impl code to add OpenAPI-shaped query
85
- * parameters onto an \`HttpUrl.Builder\` without each call site having to
86
- * know the style/explode rules.
87
- *
88
- * - \`addScalar\` skips when the value is \`null\` so optional-and-missing
89
- * params don't emit a key at all.
90
- * - \`addArray\` honours \`style\` + \`explode\`: explode=true emits one
91
- * \`?name=v\` per element; explode=false joins per the style separator.
92
- */
93
- public object URLEncoding {
94
- public fun addScalar(builder: HttpUrl.Builder, name: String, value: Any?) {
95
- if (value == null) return
96
- builder.addQueryParameter(name, value.toString())
97
- }
98
-
99
- public fun addArray(
100
- builder: HttpUrl.Builder,
101
- name: String,
102
- values: List<Any>?,
103
- style: QueryStyle = QueryStyle.FORM,
104
- explode: Boolean = true,
105
- ) {
106
- if (values == null) return
107
- if (explode) {
108
- for (v in values) builder.addQueryParameter(name, v.toString())
109
- return
110
- }
111
- val sep = when (style) {
112
- QueryStyle.FORM -> ","
113
- QueryStyle.SPACE_DELIMITED -> " "
114
- QueryStyle.PIPE_DELIMITED -> "|"
115
- }
116
- builder.addQueryParameter(name, values.joinToString(sep) { it.toString() })
117
- }
118
- }
119
- `;
120
- const MULTIPART_KT = `package __PACKAGE__
121
-
122
- import okhttp3.MediaType.Companion.toMediaTypeOrNull
123
- import okhttp3.MultipartBody
124
- import okhttp3.RequestBody
125
- import okhttp3.RequestBody.Companion.toRequestBody
126
-
127
- /**
128
- * Thin wrapper over OkHttp's \`MultipartBody.Builder\` — keeps the impl
129
- * code symmetric with the JSON / form-urlencoded paths.
130
- *
131
- * - \`appendText(name, value)\` — text part.
132
- * - \`appendFile(name, filename, bytes,\`
133
- * \`mimeType)\` — binary part.
134
- * - \`build()\` — finalizes and returns a
135
- * \`RequestBody\` ready to pass
136
- * into \`.method("POST", body)\`.
137
- */
138
- public class MultipartFormBody {
139
- private val builder: MultipartBody.Builder =
140
- MultipartBody.Builder().setType(MultipartBody.FORM)
141
-
142
- public fun appendText(name: String, value: String) {
143
- builder.addFormDataPart(name, value)
144
- }
145
-
146
- public fun appendFile(
147
- name: String,
148
- filename: String,
149
- bytes: ByteArray,
150
- mimeType: String = "application/octet-stream",
151
- ) {
152
- val body: RequestBody = bytes.toRequestBody(mimeType.toMediaTypeOrNull())
153
- builder.addFormDataPart(name, filename, body)
154
- }
155
-
156
- public fun build(): RequestBody = builder.build()
157
- }
158
- `;
159
- const REQUEST_OPTIONS_KT = `package __PACKAGE__
160
-
161
- import okhttp3.HttpUrl
162
- import okhttp3.Request
163
- import okhttp3.Response
164
-
165
- /**
166
- * Per-call options bag — every generated method takes a
167
- * \`RequestOptions\` last param. Mirrors hey-api's TS SDK options shape.
168
- *
169
- * - \`client\` — override the impl's bound \`APIClient\`.
170
- * - \`baseUrl\` — override \`client.baseUrl\` for one call.
171
- * - \`timeout\` — per-call call-timeout in milliseconds.
172
- * - \`headers\` — extra/override headers, applied last.
173
- * - \`requestInterceptors\` — extra suspend interceptors, run after
174
- * client-level ones.
175
- * - \`responseValidator\` — runs after a 2xx response; throwing
176
- * converts the call into an exception.
177
- * - \`responseTransformer\` — rewrite the response body before decode.
178
- */
179
- public data class RequestOptions(
180
- public val client: APIClient? = null,
181
- public val baseUrl: HttpUrl? = null,
182
- public val timeout: Long? = null,
183
- public val headers: Map<String, String> = emptyMap(),
184
- public val requestInterceptors: List<suspend (Request) -> Request> = emptyList(),
185
- public val responseValidator: (suspend (ByteArray, Response) -> Unit)? = null,
186
- public val responseTransformer: (suspend (ByteArray) -> ByteArray)? = null,
187
- )
188
- `;
189
- const API_KEY_LOCATION_KT = `package __PACKAGE__
190
-
191
- public enum class APIKeyLocation {
192
- HEADER,
193
- QUERY,
194
- COOKIE,
195
- }
196
- `;
197
- const AUTH_KT = `package __PACKAGE__
198
-
199
- import java.util.Base64
200
- import okhttp3.HttpUrl
201
- import okhttp3.Request
202
-
203
- /**
204
- * Auth schemes consumers reach for in practice:
205
- *
206
- * - \`Bearer(token)\` — \`Authorization: Bearer <token>\`.
207
- * - \`ApiKey(name, value, in)\` — header / query / cookie placement,
208
- * matching the spec's
209
- * \`securitySchemes.<name>.in\`.
210
- * - \`Basic(username, password)\` — \`Authorization: Basic <base64>\`.
211
- *
212
- * Per-operation auth is auto-wired by the generator when an op has
213
- * \`security\` requirements; it walks the requirement names and applies
214
- * any matching scheme value the consumer has placed on \`APIClient.auth\`.
215
- *
216
- * \`apply\` mutates the request builder in-place for header / cookie
217
- * auth and returns the (possibly rewritten) \`HttpUrl\` so query auth
218
- * can re-thread its name=value into the URL.
219
- */
220
- public sealed class Auth {
221
- public abstract fun apply(builder: Request.Builder, url: HttpUrl): HttpUrl
222
-
223
- public data class Bearer(public val token: String) : Auth() {
224
- override fun apply(builder: Request.Builder, url: HttpUrl): HttpUrl {
225
- builder.header("Authorization", "Bearer \$token")
226
- return url
227
- }
228
- }
229
-
230
- public data class ApiKey(
231
- public val name: String,
232
- public val value: String,
233
- public val location: APIKeyLocation,
234
- ) : Auth() {
235
- override fun apply(builder: Request.Builder, url: HttpUrl): HttpUrl =
236
- when (location) {
237
- APIKeyLocation.HEADER -> {
238
- builder.header(name, value)
239
- url
240
- }
241
- APIKeyLocation.QUERY ->
242
- url.newBuilder().addQueryParameter(name, value).build()
243
- APIKeyLocation.COOKIE -> {
244
- val cookie = "\$name=\$value"
245
- val existing = builder.build().header("Cookie")
246
- builder.header("Cookie", existing?.let { "\$it; \$cookie" } ?: cookie)
247
- url
248
- }
249
- }
250
- }
251
-
252
- public data class Basic(
253
- public val username: String,
254
- public val password: String,
255
- ) : Auth() {
256
- override fun apply(builder: Request.Builder, url: HttpUrl): HttpUrl {
257
- val encoded = Base64.getEncoder()
258
- .encodeToString("\$username:\$password".toByteArray(Charsets.UTF_8))
259
- builder.header("Authorization", "Basic \$encoded")
260
- return url
261
- }
262
- }
263
- }
264
- `;
265
- const API_CLIENT_KT_BASE = `package __PACKAGE__
266
-
267
- import java.util.concurrent.TimeUnit
268
- import kotlinx.coroutines.Dispatchers
269
- import kotlinx.coroutines.withContext
270
- import kotlinx.serialization.json.Json
271
- import okhttp3.HttpUrl
272
- import okhttp3.OkHttpClient
273
- import okhttp3.Request
274
- import okhttp3.Response
275
-
276
- /**
277
- * Runtime helper every per-tag impl class delegates to. Owns the
278
- * transport-level concerns — \`OkHttpClient\`, \`Json\`, the interceptor
279
- * pipeline — and provides one source of truth for status-code
280
- * dispatch and decoding.
281
- *
282
- * - \`execute<T>(request, deserializer, …)\` — decodes a 2xx body to \`T\`.
283
- * - \`executeUnit(request, …)\` — discards the body.
284
- * - \`executeWithResponse<T>(request, deserializer,\`
285
- * \`…)\` — decode + raw \`Response\`.
286
- * - \`executeUnitWithResponse(request, …)\` — raw \`Response\` only.
287
- * - \`executeRaw(request, …)\` — raw \`(ByteArray, Response)\`,
288
- * used by multi-2xx ops.
289
- *
290
- * Status-code dispatch lives in \`sendAndDispatch\`; 2xx returns the
291
- * body bytes, 4xx/5xx throw the matching \`APIError\` subclass.
292
- */
293
- public class APIClient(
294
- public var baseUrl: HttpUrl,
295
- public val httpClient: OkHttpClient = OkHttpClient(),
296
- public val json: Json = Json {
297
- ignoreUnknownKeys = true
298
- encodeDefaults = true
299
- },
300
- public val interceptors: APIInterceptors = APIInterceptors(),__AUTH_FIELD__
301
- ) {
302
- public suspend fun <T> execute(
303
- request: Request,
304
- deserializer: kotlinx.serialization.DeserializationStrategy<T>,
305
- timeout: Long? = null,
306
- extraInterceptors: List<suspend (Request) -> Request> = emptyList(),
307
- responseValidator: (suspend (ByteArray, Response) -> Unit)? = null,
308
- responseTransformer: (suspend (ByteArray) -> ByteArray)? = null,
309
- ): T {
310
- val (data, response) = sendAndDispatch(request, timeout, extraInterceptors)
311
- responseValidator?.invoke(data, response)
312
- val body = responseTransformer?.invoke(data) ?: data
313
- return try {
314
- json.decodeFromString(deserializer, body.decodeToString())
315
- } catch (e: Throwable) {
316
- throw APIError.DecodingFailed(e)
317
- }
318
- }
319
-
320
- public suspend fun executeUnit(
321
- request: Request,
322
- timeout: Long? = null,
323
- extraInterceptors: List<suspend (Request) -> Request> = emptyList(),
324
- responseValidator: (suspend (ByteArray, Response) -> Unit)? = null,
325
- ) {
326
- val (data, response) = sendAndDispatch(request, timeout, extraInterceptors)
327
- responseValidator?.invoke(data, response)
328
- }
329
-
330
- public suspend fun <T> executeWithResponse(
331
- request: Request,
332
- deserializer: kotlinx.serialization.DeserializationStrategy<T>,
333
- timeout: Long? = null,
334
- extraInterceptors: List<suspend (Request) -> Request> = emptyList(),
335
- responseValidator: (suspend (ByteArray, Response) -> Unit)? = null,
336
- responseTransformer: (suspend (ByteArray) -> ByteArray)? = null,
337
- ): Pair<T, Response> {
338
- val (data, response) = sendAndDispatch(request, timeout, extraInterceptors)
339
- responseValidator?.invoke(data, response)
340
- val body = responseTransformer?.invoke(data) ?: data
341
- return try {
342
- json.decodeFromString(deserializer, body.decodeToString()) to response
343
- } catch (e: Throwable) {
344
- throw APIError.DecodingFailed(e)
345
- }
346
- }
347
-
348
- public suspend fun executeUnitWithResponse(
349
- request: Request,
350
- timeout: Long? = null,
351
- extraInterceptors: List<suspend (Request) -> Request> = emptyList(),
352
- responseValidator: (suspend (ByteArray, Response) -> Unit)? = null,
353
- ): Response {
354
- val (data, response) = sendAndDispatch(request, timeout, extraInterceptors)
355
- responseValidator?.invoke(data, response)
356
- return response
357
- }
358
-
359
- public suspend fun executeRaw(
360
- request: Request,
361
- timeout: Long? = null,
362
- extraInterceptors: List<suspend (Request) -> Request> = emptyList(),
363
- responseValidator: (suspend (ByteArray, Response) -> Unit)? = null,
364
- responseTransformer: (suspend (ByteArray) -> ByteArray)? = null,
365
- ): Pair<ByteArray, Response> {
366
- val (data, response) = sendAndDispatch(request, timeout, extraInterceptors)
367
- responseValidator?.invoke(data, response)
368
- val body = responseTransformer?.invoke(data) ?: data
369
- return body to response
370
- }
371
-
372
- private suspend fun sendAndDispatch(
373
- request: Request,
374
- timeout: Long?,
375
- extraInterceptors: List<suspend (Request) -> Request>,
376
- ): Pair<ByteArray, Response> {
377
- var req = request
378
- for (interceptor in interceptors.request) req = interceptor(req)
379
- for (interceptor in extraInterceptors) req = interceptor(req)
380
- val callClient = if (timeout == null) httpClient else
381
- httpClient.newBuilder().callTimeout(timeout, TimeUnit.MILLISECONDS).build()
382
- val response = try {
383
- withContext(Dispatchers.IO) {
384
- callClient.newCall(req).execute()
385
- }
386
- } catch (e: Throwable) {
387
- throw APIError.Transport(e)
388
- }
389
- val body = response.body?.bytes() ?: ByteArray(0)
390
- return when (val code = response.code) {
391
- in 200..299 -> body to response
392
- in 400..499 -> throw APIError.ClientError(code, body)
393
- in 500..599 -> throw APIError.ServerError(code, body)
394
- else -> throw APIError.UnexpectedStatus(code, body)
395
- }
396
- }
397
- }
398
- `;
399
- export function apiClientKt(opts) {
400
- const authField = opts.hasAuth
401
- ? "\n public val auth: MutableMap<String, Auth> = mutableMapOf(),"
402
- : "";
403
- return API_CLIENT_KT_BASE.replace("__AUTH_FIELD__", authField);
404
- }
405
- /** Ordered runtime files. The orchestrator places them under `API/`. */
1
+ import { readFileSync } from "node:fs";
2
+ /**
3
+ * Runtime helpers that ship into every generated SDK. They live as real,
4
+ * ktlint-clean Kotlin sources in `packages/openapi/kotlin/runtime/` and
5
+ * are copied verbatim; only the package header is rewritten.
6
+ */
7
+ const RUNTIME_DIR = new URL("../../../runtime/", import.meta.url);
8
+ const ALWAYS = [
9
+ "APIClient.kt",
10
+ "APIError.kt",
11
+ "APIInterceptors.kt",
12
+ "APIKeyLocation.kt",
13
+ "Auth.kt",
14
+ "QueryStyle.kt",
15
+ "RequestOptions.kt",
16
+ "URLEncoding.kt",
17
+ ];
406
18
  export function buildRuntimeFiles(opts, pkg) {
407
- const subst = (s) => s.replace(/__PACKAGE__/g, pkg);
408
- const files = [
409
- { name: "APIClient.kt", content: subst(apiClientKt(opts)) },
410
- { name: "APIError.kt", content: subst(API_ERROR_KT) },
411
- { name: "APIInterceptors.kt", content: subst(API_INTERCEPTORS_KT) },
412
- { name: "QueryStyle.kt", content: subst(QUERY_STYLE_KT) },
413
- { name: "URLEncoding.kt", content: subst(URL_ENCODING_KT) },
414
- { name: "RequestOptions.kt", content: subst(REQUEST_OPTIONS_KT) },
415
- ];
416
- if (opts.hasAuth) {
417
- files.push({ name: "Auth.kt", content: subst(AUTH_KT) });
418
- files.push({
419
- name: "APIKeyLocation.kt",
420
- content: subst(API_KEY_LOCATION_KT),
421
- });
422
- }
423
- if (opts.hasMultipart) {
424
- files.push({
425
- name: "MultipartFormBody.kt",
426
- content: subst(MULTIPART_KT),
427
- });
428
- }
429
- return files;
19
+ const names = opts.hasMultipart
20
+ ? [...ALWAYS, "MultipartFormBody.kt"]
21
+ : ALWAYS;
22
+ return names.map((name) => ({
23
+ name,
24
+ content: readFileSync(new URL(name, RUNTIME_DIR), "utf8").replace(/^package dev\.irkit\.runtime$/m, `package ${pkg}`),
25
+ }));
430
26
  }
431
27
  //# sourceMappingURL=templates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/ir/runtime/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAqBH,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;CAc3B,CAAC;AAEF,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCpB,CAAC;AAEF,MAAM,cAAc,GAAG;;;;;;;;;;;;CAYtB,CAAC;AAEF,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCvB,CAAC;AAEF,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCpB,CAAC;AAEF,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6B1B,CAAC;AAEF,MAAM,mBAAmB,GAAG;;;;;;;CAO3B,CAAC;AAEF,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;KACF,CAAC,CAAC,CAAC;AACN,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { IR } from "@hey-api/shared";
2
- import { type KtDecl } from "../kt-dsl/index.js";
2
+ import type { Namespace } from "@ir-kit/codegen-core";
3
+ import { type KtDecl } from "../ast/index.js";
3
4
  /**
4
5
  * Translate `IR.Model.components.schemas` into Kotlin decls.
5
6
  *
@@ -9,9 +10,6 @@ import { type KtDecl } from "../kt-dsl/index.js";
9
10
  * - object schemas with only `additionalProperties` → typealias to
10
11
  * `Map<String, V>`
11
12
  * - everything else → typealias to the dispatcher's resolved type
12
- *
13
- * Schemas come in as hey-api's `IR.SchemaObject` and are folded to
14
- * canonical {@link Schema} at the boundary.
15
13
  */
16
- export declare function schemasToDecls(schemas: Record<string, IR.SchemaObject>): KtDecl[];
14
+ export declare function schemasToDecls(schemas: Record<string, IR.SchemaObject>, names?: Namespace): KtDecl[];
17
15
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/ir/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAG1C,OAAO,EACL,KAAK,MAAM,EAMZ,MAAM,oBAAoB,CAAC;AAG5B;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,GACvC,MAAM,EAAE,CA2CV"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/ir/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,EACL,KAAK,MAAM,EAMZ,MAAM,iBAAiB,CAAC;AAIzB;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,EACxC,KAAK,GAAE,SAA0B,GAChC,MAAM,EAAE,CAgCV"}