sdkloom 0.0.0-stage → 0.1.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 (383) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +239 -2
  3. package/kits/allowed-sources.json +24 -0
  4. package/kits/csharp/kit.json +6 -0
  5. package/kits/csharp/src/Runtime/Client.cs +295 -0
  6. package/kits/csharp/src/Runtime/Context.cs +216 -0
  7. package/kits/csharp/src/Runtime/Errors.cs +121 -0
  8. package/kits/csharp/src/Runtime/Http.cs +218 -0
  9. package/kits/csharp/src/Runtime/Json.cs +650 -0
  10. package/kits/csharp/src/Runtime/Lang.cs +212 -0
  11. package/kits/csharp/src/Runtime/Models.cs +206 -0
  12. package/kits/csharp/src/Runtime/Multipart.cs +108 -0
  13. package/kits/csharp/src/Runtime/Pagination.cs +122 -0
  14. package/kits/csharp/src/Runtime/Sse.cs +197 -0
  15. package/kits/csharp/src/Runtime/Testing.cs +375 -0
  16. package/kits/csharp/src/Runtime/Transport.cs +212 -0
  17. package/kits/csharp/src/Runtime/Wait.cs +57 -0
  18. package/kits/csharp/src/Runtime/Webhooks.cs +148 -0
  19. package/kits/csharp/tests/ClientTests.cs +128 -0
  20. package/kits/csharp/tests/HttpTests.cs +44 -0
  21. package/kits/csharp/tests/JsonTests.cs +132 -0
  22. package/kits/csharp/tests/LangTests.cs +57 -0
  23. package/kits/csharp/tests/MultipartTests.cs +31 -0
  24. package/kits/csharp/tests/PaginationTests.cs +93 -0
  25. package/kits/csharp/tests/SseTests.cs +122 -0
  26. package/kits/csharp/tests/TestRunner.cs +93 -0
  27. package/kits/csharp/tests/TestingTests.cs +80 -0
  28. package/kits/csharp/tests/TransportTests.cs +145 -0
  29. package/kits/csharp/tests/WaitTests.cs +39 -0
  30. package/kits/csharp/tests/WebhooksTests.cs +46 -0
  31. package/kits/csharp/versions.json +12 -0
  32. package/kits/go/kit.json +6 -0
  33. package/kits/go/src/sdkruntime/client.go +322 -0
  34. package/kits/go/src/sdkruntime/context.go +207 -0
  35. package/kits/go/src/sdkruntime/errors.go +74 -0
  36. package/kits/go/src/sdkruntime/http.go +261 -0
  37. package/kits/go/src/sdkruntime/json.go +527 -0
  38. package/kits/go/src/sdkruntime/lang.go +462 -0
  39. package/kits/go/src/sdkruntime/multipart.go +75 -0
  40. package/kits/go/src/sdkruntime/pagination.go +150 -0
  41. package/kits/go/src/sdkruntime/sse.go +267 -0
  42. package/kits/go/src/sdkruntime/testing.go +343 -0
  43. package/kits/go/src/sdkruntime/transport.go +168 -0
  44. package/kits/go/src/sdkruntime/wait.go +49 -0
  45. package/kits/go/src/sdkruntime/webhooks.go +129 -0
  46. package/kits/go/tests/client_test.go +185 -0
  47. package/kits/go/tests/http_test.go +78 -0
  48. package/kits/go/tests/json_test.go +127 -0
  49. package/kits/go/tests/lang_test.go +98 -0
  50. package/kits/go/tests/multipart_test.go +29 -0
  51. package/kits/go/tests/pagination_test.go +69 -0
  52. package/kits/go/tests/sse_test.go +129 -0
  53. package/kits/go/tests/testing_test.go +121 -0
  54. package/kits/go/tests/transport_test.go +133 -0
  55. package/kits/go/tests/wait_test.go +46 -0
  56. package/kits/go/tests/webhooks_test.go +62 -0
  57. package/kits/go/versions.json +12 -0
  58. package/kits/java/kit.json +6 -0
  59. package/kits/java/src/dev/sdkloom/runtime/ApiException.java +63 -0
  60. package/kits/java/src/dev/sdkloom/runtime/ArgumentException.java +24 -0
  61. package/kits/java/src/dev/sdkloom/runtime/Assert.java +72 -0
  62. package/kits/java/src/dev/sdkloom/runtime/ClientRuntime.java +220 -0
  63. package/kits/java/src/dev/sdkloom/runtime/Clock.java +39 -0
  64. package/kits/java/src/dev/sdkloom/runtime/Context.java +79 -0
  65. package/kits/java/src/dev/sdkloom/runtime/Decode.java +200 -0
  66. package/kits/java/src/dev/sdkloom/runtime/DecodeException.java +26 -0
  67. package/kits/java/src/dev/sdkloom/runtime/Decoder.java +16 -0
  68. package/kits/java/src/dev/sdkloom/runtime/Emitter.java +56 -0
  69. package/kits/java/src/dev/sdkloom/runtime/ErrorFactory.java +18 -0
  70. package/kits/java/src/dev/sdkloom/runtime/EventListener.java +20 -0
  71. package/kits/java/src/dev/sdkloom/runtime/EventStream.java +232 -0
  72. package/kits/java/src/dev/sdkloom/runtime/FakeClock.java +37 -0
  73. package/kits/java/src/dev/sdkloom/runtime/Headers.java +42 -0
  74. package/kits/java/src/dev/sdkloom/runtime/HttpRequest.java +88 -0
  75. package/kits/java/src/dev/sdkloom/runtime/HttpResponse.java +69 -0
  76. package/kits/java/src/dev/sdkloom/runtime/JdkTransport.java +97 -0
  77. package/kits/java/src/dev/sdkloom/runtime/Js.java +230 -0
  78. package/kits/java/src/dev/sdkloom/runtime/Json.java +281 -0
  79. package/kits/java/src/dev/sdkloom/runtime/JsonValue.java +15 -0
  80. package/kits/java/src/dev/sdkloom/runtime/Links.java +62 -0
  81. package/kits/java/src/dev/sdkloom/runtime/Middleware.java +16 -0
  82. package/kits/java/src/dev/sdkloom/runtime/MiddlewareEntry.java +43 -0
  83. package/kits/java/src/dev/sdkloom/runtime/MockRoute.java +111 -0
  84. package/kits/java/src/dev/sdkloom/runtime/MockTransport.java +62 -0
  85. package/kits/java/src/dev/sdkloom/runtime/MultipartForm.java +111 -0
  86. package/kits/java/src/dev/sdkloom/runtime/Next.java +16 -0
  87. package/kits/java/src/dev/sdkloom/runtime/OperationInfo.java +35 -0
  88. package/kits/java/src/dev/sdkloom/runtime/OperationMock.java +105 -0
  89. package/kits/java/src/dev/sdkloom/runtime/OperationSpec.java +125 -0
  90. package/kits/java/src/dev/sdkloom/runtime/Pages.java +55 -0
  91. package/kits/java/src/dev/sdkloom/runtime/Pipeline.java +29 -0
  92. package/kits/java/src/dev/sdkloom/runtime/RawResult.java +31 -0
  93. package/kits/java/src/dev/sdkloom/runtime/RecordedEvent.java +36 -0
  94. package/kits/java/src/dev/sdkloom/runtime/SdkInfo.java +38 -0
  95. package/kits/java/src/dev/sdkloom/runtime/SendOptions.java +34 -0
  96. package/kits/java/src/dev/sdkloom/runtime/ServerSentEvent.java +58 -0
  97. package/kits/java/src/dev/sdkloom/runtime/State.java +58 -0
  98. package/kits/java/src/dev/sdkloom/runtime/Test.java +21 -0
  99. package/kits/java/src/dev/sdkloom/runtime/TestRunner.java +63 -0
  100. package/kits/java/src/dev/sdkloom/runtime/Transport.java +16 -0
  101. package/kits/java/src/dev/sdkloom/runtime/TransportException.java +30 -0
  102. package/kits/java/src/dev/sdkloom/runtime/UrlConnectionTransport.java +195 -0
  103. package/kits/java/src/dev/sdkloom/runtime/Urls.java +116 -0
  104. package/kits/java/src/dev/sdkloom/runtime/Waits.java +53 -0
  105. package/kits/java/src/dev/sdkloom/runtime/WebhookSignatureException.java +24 -0
  106. package/kits/java/src/dev/sdkloom/runtime/Webhooks.java +146 -0
  107. package/kits/java/tests/dev/sdkloom/runtime/ClientTest.java +266 -0
  108. package/kits/java/tests/dev/sdkloom/runtime/EventStreamTest.java +131 -0
  109. package/kits/java/tests/dev/sdkloom/runtime/HttpTest.java +95 -0
  110. package/kits/java/tests/dev/sdkloom/runtime/JdkTransportTest.java +12 -0
  111. package/kits/java/tests/dev/sdkloom/runtime/JsTest.java +102 -0
  112. package/kits/java/tests/dev/sdkloom/runtime/JsonTest.java +87 -0
  113. package/kits/java/tests/dev/sdkloom/runtime/LinksTest.java +22 -0
  114. package/kits/java/tests/dev/sdkloom/runtime/MultipartFormTest.java +30 -0
  115. package/kits/java/tests/dev/sdkloom/runtime/PagesTest.java +75 -0
  116. package/kits/java/tests/dev/sdkloom/runtime/TestData.java +53 -0
  117. package/kits/java/tests/dev/sdkloom/runtime/TestingTest.java +156 -0
  118. package/kits/java/tests/dev/sdkloom/runtime/TransportContract.java +201 -0
  119. package/kits/java/tests/dev/sdkloom/runtime/UrlConnectionTransportTest.java +49 -0
  120. package/kits/java/tests/dev/sdkloom/runtime/WaitsTest.java +43 -0
  121. package/kits/java/tests/dev/sdkloom/runtime/WebhooksTest.java +45 -0
  122. package/kits/java/versions.json +41 -0
  123. package/kits/python/kit.json +6 -0
  124. package/kits/python/src/sdkloom_runtime/__init__.py +1 -0
  125. package/kits/python/src/sdkloom_runtime/client.py +232 -0
  126. package/kits/python/src/sdkloom_runtime/compat.py +195 -0
  127. package/kits/python/src/sdkloom_runtime/context.py +134 -0
  128. package/kits/python/src/sdkloom_runtime/errors.py +65 -0
  129. package/kits/python/src/sdkloom_runtime/http.py +192 -0
  130. package/kits/python/src/sdkloom_runtime/lang.py +207 -0
  131. package/kits/python/src/sdkloom_runtime/models.py +221 -0
  132. package/kits/python/src/sdkloom_runtime/multipart.py +69 -0
  133. package/kits/python/src/sdkloom_runtime/pagination.py +61 -0
  134. package/kits/python/src/sdkloom_runtime/pipeline.py +39 -0
  135. package/kits/python/src/sdkloom_runtime/sse.py +121 -0
  136. package/kits/python/src/sdkloom_runtime/testing.py +224 -0
  137. package/kits/python/src/sdkloom_runtime/transport.py +120 -0
  138. package/kits/python/src/sdkloom_runtime/wait.py +44 -0
  139. package/kits/python/src/sdkloom_runtime/webhooks.py +84 -0
  140. package/kits/python/tests/support.py +28 -0
  141. package/kits/python/tests/test_client.py +275 -0
  142. package/kits/python/tests/test_compat.py +87 -0
  143. package/kits/python/tests/test_http.py +94 -0
  144. package/kits/python/tests/test_lang.py +104 -0
  145. package/kits/python/tests/test_models.py +110 -0
  146. package/kits/python/tests/test_multipart.py +37 -0
  147. package/kits/python/tests/test_pagination.py +70 -0
  148. package/kits/python/tests/test_sse.py +61 -0
  149. package/kits/python/tests/test_testing.py +130 -0
  150. package/kits/python/tests/test_transport.py +124 -0
  151. package/kits/python/tests/test_wait.py +46 -0
  152. package/kits/python/tests/test_webhooks.py +57 -0
  153. package/kits/python/versions.json +33 -0
  154. package/kits/rust/kit.json +6 -0
  155. package/kits/rust/src/runtime/client.rs +212 -0
  156. package/kits/rust/src/runtime/context.rs +182 -0
  157. package/kits/rust/src/runtime/crypto.rs +84 -0
  158. package/kits/rust/src/runtime/errors.rs +147 -0
  159. package/kits/rust/src/runtime/http.rs +248 -0
  160. package/kits/rust/src/runtime/json.rs +424 -0
  161. package/kits/rust/src/runtime/lang.rs +296 -0
  162. package/kits/rust/src/runtime/mod.rs +30 -0
  163. package/kits/rust/src/runtime/models.rs +266 -0
  164. package/kits/rust/src/runtime/multipart.rs +81 -0
  165. package/kits/rust/src/runtime/pagination.rs +117 -0
  166. package/kits/rust/src/runtime/sse.rs +195 -0
  167. package/kits/rust/src/runtime/testing.rs +308 -0
  168. package/kits/rust/src/runtime/transport.rs +324 -0
  169. package/kits/rust/src/runtime/wait.rs +29 -0
  170. package/kits/rust/src/runtime/webhooks.rs +142 -0
  171. package/kits/rust/tests/client.rs +152 -0
  172. package/kits/rust/tests/http.rs +44 -0
  173. package/kits/rust/tests/json.rs +82 -0
  174. package/kits/rust/tests/lang.rs +74 -0
  175. package/kits/rust/tests/multipart.rs +21 -0
  176. package/kits/rust/tests/pagination.rs +61 -0
  177. package/kits/rust/tests/sse.rs +77 -0
  178. package/kits/rust/tests/testing.rs +90 -0
  179. package/kits/rust/tests/transport.rs +218 -0
  180. package/kits/rust/tests/wait.rs +32 -0
  181. package/kits/rust/tests/webhooks.rs +73 -0
  182. package/kits/rust/versions.json +6 -0
  183. package/kits/typescript/kit.json +6 -0
  184. package/kits/typescript/src/client.ts +223 -0
  185. package/kits/typescript/src/context.ts +108 -0
  186. package/kits/typescript/src/errors.ts +63 -0
  187. package/kits/typescript/src/helpers.ts +49 -0
  188. package/kits/typescript/src/http.ts +192 -0
  189. package/kits/typescript/src/models.ts +139 -0
  190. package/kits/typescript/src/multipart.ts +66 -0
  191. package/kits/typescript/src/pagination.ts +54 -0
  192. package/kits/typescript/src/pipeline.ts +25 -0
  193. package/kits/typescript/src/sse.ts +102 -0
  194. package/kits/typescript/src/testing.ts +217 -0
  195. package/kits/typescript/src/transport.ts +101 -0
  196. package/kits/typescript/src/wait.ts +36 -0
  197. package/kits/typescript/src/webhooks.ts +168 -0
  198. package/kits/typescript/tests/client.test.ts +269 -0
  199. package/kits/typescript/tests/helpers.test.ts +27 -0
  200. package/kits/typescript/tests/http.test.ts +80 -0
  201. package/kits/typescript/tests/models.test.ts +71 -0
  202. package/kits/typescript/tests/multipart.test.ts +28 -0
  203. package/kits/typescript/tests/pagination.test.ts +76 -0
  204. package/kits/typescript/tests/sse.test.ts +82 -0
  205. package/kits/typescript/tests/testing.test.ts +103 -0
  206. package/kits/typescript/tests/transport.test.ts +127 -0
  207. package/kits/typescript/tests/wait.test.ts +31 -0
  208. package/kits/typescript/tests/webhooks.test.ts +53 -0
  209. package/kits/typescript/versions.json +15 -0
  210. package/package.json +37 -4
  211. package/packages/cli/recipes/apiKeyHeader.ts +16 -0
  212. package/packages/cli/recipes/apiVersionHeader.ts +16 -0
  213. package/packages/cli/recipes/basic.ts +13 -0
  214. package/packages/cli/recipes/bearer.ts +10 -0
  215. package/packages/cli/recipes/hmacSign.ts +23 -0
  216. package/packages/cli/recipes/idempotencyKey.ts +19 -0
  217. package/packages/cli/recipes/oauthClientCredentials.ts +50 -0
  218. package/packages/cli/recipes/retry.ts +42 -0
  219. package/packages/cli/recipes/timing.ts +12 -0
  220. package/packages/cli/recipes/userAgent.ts +8 -0
  221. package/packages/cli/src/build.js +93 -0
  222. package/packages/cli/src/commands/build.js +31 -0
  223. package/packages/cli/src/commands/conformance-check.js +50 -0
  224. package/packages/cli/src/commands/contract.js +181 -0
  225. package/packages/cli/src/commands/diff.js +113 -0
  226. package/packages/cli/src/commands/doctor.js +43 -0
  227. package/packages/cli/src/commands/import-openapi.js +42 -0
  228. package/packages/cli/src/commands/init.js +27 -0
  229. package/packages/cli/src/commands/kit-check.js +145 -0
  230. package/packages/cli/src/commands/publish.js +81 -0
  231. package/packages/cli/src/commands/recipe.js +49 -0
  232. package/packages/cli/src/commands/record.js +181 -0
  233. package/packages/cli/src/commands/serve.js +156 -0
  234. package/packages/cli/src/commands/spec-check.js +57 -0
  235. package/packages/cli/src/commands/test.js +177 -0
  236. package/packages/cli/src/commands/variants.js +32 -0
  237. package/packages/cli/src/commands/verify.js +57 -0
  238. package/packages/cli/src/commands/version.js +63 -0
  239. package/packages/cli/src/containers.js +82 -0
  240. package/packages/cli/src/coverage.js +72 -0
  241. package/packages/cli/src/git.js +25 -0
  242. package/packages/cli/src/io.js +50 -0
  243. package/packages/cli/src/java/ScenarioHarness.java +297 -0
  244. package/packages/cli/src/java/SchemaRoundTrip.java +63 -0
  245. package/packages/cli/src/java.js +70 -0
  246. package/packages/cli/src/js/harness.mjs +120 -0
  247. package/packages/cli/src/kits.js +103 -0
  248. package/packages/cli/src/languages/csharp.js +274 -0
  249. package/packages/cli/src/languages/go.js +185 -0
  250. package/packages/cli/src/languages/index.js +18 -0
  251. package/packages/cli/src/languages/java.js +187 -0
  252. package/packages/cli/src/languages/python.js +120 -0
  253. package/packages/cli/src/languages/rust.js +189 -0
  254. package/packages/cli/src/languages/types.js +93 -0
  255. package/packages/cli/src/languages/typescript.js +112 -0
  256. package/packages/cli/src/main.js +13 -0
  257. package/packages/cli/src/packaging.js +39 -0
  258. package/packages/cli/src/portability.js +45 -0
  259. package/packages/cli/src/profiles.js +55 -0
  260. package/packages/cli/src/project.js +56 -0
  261. package/packages/cli/src/python/scenario_harness.py +162 -0
  262. package/packages/cli/src/python/schema_roundtrip.py +42 -0
  263. package/packages/cli/src/registries.js +214 -0
  264. package/packages/cli/src/resolve-core.js +39 -0
  265. package/packages/cli/src/run.js +133 -0
  266. package/packages/cli/src/runtimes.js +61 -0
  267. package/packages/cli/src/scenarios-java.js +82 -0
  268. package/packages/cli/src/scenarios-javascript.js +54 -0
  269. package/packages/cli/src/scenarios-python.js +90 -0
  270. package/packages/cli/src/scenarios.js +183 -0
  271. package/packages/cli/src/schema.js +84 -0
  272. package/packages/cli/src/templates.js +85 -0
  273. package/packages/cli/src/toolchains.js +68 -0
  274. package/packages/cli/src/transpiled-tests.js +92 -0
  275. package/packages/codegen/src/canonical-json.js +31 -0
  276. package/packages/codegen/src/capabilities.js +50 -0
  277. package/packages/codegen/src/code-writer.js +54 -0
  278. package/packages/codegen/src/file-tree.js +25 -0
  279. package/packages/codegen/src/hash.js +6 -0
  280. package/packages/codegen/src/index.js +16 -0
  281. package/packages/codegen/src/lock.js +106 -0
  282. package/packages/conformance/src/case.js +143 -0
  283. package/packages/conformance/src/checks.js +40 -0
  284. package/packages/conformance/src/index.js +3 -0
  285. package/packages/conformance/src/matrix.js +48 -0
  286. package/packages/conformance/src/suite.js +48 -0
  287. package/packages/differ/src/diff.js +500 -0
  288. package/packages/differ/src/index.js +3 -0
  289. package/packages/differ/src/notes.js +112 -0
  290. package/packages/differ/src/support.js +34 -0
  291. package/packages/gen-csharp/src/emit-client.js +397 -0
  292. package/packages/gen-csharp/src/emit-harness.js +333 -0
  293. package/packages/gen-csharp/src/emit-mock.js +111 -0
  294. package/packages/gen-csharp/src/emit-models.js +119 -0
  295. package/packages/gen-csharp/src/emit-webhooks.js +57 -0
  296. package/packages/gen-csharp/src/generate.js +245 -0
  297. package/packages/gen-csharp/src/index.js +5 -0
  298. package/packages/gen-csharp/src/names.js +284 -0
  299. package/packages/gen-go/src/emit-client.js +405 -0
  300. package/packages/gen-go/src/emit-harness.js +294 -0
  301. package/packages/gen-go/src/emit-mock.js +112 -0
  302. package/packages/gen-go/src/emit-models.js +146 -0
  303. package/packages/gen-go/src/emit-webhooks.js +58 -0
  304. package/packages/gen-go/src/generate.js +205 -0
  305. package/packages/gen-go/src/index.js +5 -0
  306. package/packages/gen-go/src/names.js +197 -0
  307. package/packages/gen-java/src/emit-client.js +441 -0
  308. package/packages/gen-java/src/emit-models.js +342 -0
  309. package/packages/gen-java/src/emit-testing.js +123 -0
  310. package/packages/gen-java/src/emit-webhooks.js +70 -0
  311. package/packages/gen-java/src/generate.js +244 -0
  312. package/packages/gen-java/src/index.js +4 -0
  313. package/packages/gen-java/src/names.js +197 -0
  314. package/packages/gen-python/src/emit-client.js +272 -0
  315. package/packages/gen-python/src/emit-models.js +139 -0
  316. package/packages/gen-python/src/emit-testing.js +93 -0
  317. package/packages/gen-python/src/emit-webhooks.js +48 -0
  318. package/packages/gen-python/src/generate.js +237 -0
  319. package/packages/gen-python/src/index.js +2 -0
  320. package/packages/gen-python/src/names.js +161 -0
  321. package/packages/gen-python/src/style.js +67 -0
  322. package/packages/gen-rust/src/emit-client.js +379 -0
  323. package/packages/gen-rust/src/emit-harness.js +278 -0
  324. package/packages/gen-rust/src/emit-mock.js +121 -0
  325. package/packages/gen-rust/src/emit-models.js +117 -0
  326. package/packages/gen-rust/src/emit-webhooks.js +58 -0
  327. package/packages/gen-rust/src/generate.js +243 -0
  328. package/packages/gen-rust/src/index.js +5 -0
  329. package/packages/gen-rust/src/names.js +223 -0
  330. package/packages/gen-typescript/src/emit-client.js +434 -0
  331. package/packages/gen-typescript/src/emit-models.js +93 -0
  332. package/packages/gen-typescript/src/emit-package.js +90 -0
  333. package/packages/gen-typescript/src/emit-testing.js +138 -0
  334. package/packages/gen-typescript/src/emit-webhooks.js +52 -0
  335. package/packages/gen-typescript/src/generate.js +70 -0
  336. package/packages/gen-typescript/src/index.js +3 -0
  337. package/packages/gen-typescript/src/naming.js +64 -0
  338. package/packages/gen-typescript/src/runtime.js +81 -0
  339. package/packages/gen-typescript/src/types.js +136 -0
  340. package/packages/ir/src/api-surface.js +22 -0
  341. package/packages/ir/src/checks.js +52 -0
  342. package/packages/ir/src/index.js +32 -0
  343. package/packages/ir/src/ir.js +214 -0
  344. package/packages/ir/src/pages.js +18 -0
  345. package/packages/ir/src/validate-ir.js +462 -0
  346. package/packages/ir/src/validate-types.js +140 -0
  347. package/packages/kit/src/block-parser.js +196 -0
  348. package/packages/kit/src/index.js +15 -0
  349. package/packages/kit/src/kit-check.js +203 -0
  350. package/packages/kit/src/sources.js +53 -0
  351. package/packages/kit/src/version-policy.js +133 -0
  352. package/packages/kit/src/version-range.js +132 -0
  353. package/packages/openapi/src/import.js +292 -0
  354. package/packages/openapi/src/index.js +1 -0
  355. package/packages/openapi/src/names.js +50 -0
  356. package/packages/openapi/src/schemas.js +264 -0
  357. package/packages/packager/src/archive.js +106 -0
  358. package/packages/packager/src/crate.js +39 -0
  359. package/packages/packager/src/gomodule.js +11 -0
  360. package/packages/packager/src/index.js +9 -0
  361. package/packages/packager/src/maven.js +85 -0
  362. package/packages/packager/src/metadata.js +34 -0
  363. package/packages/packager/src/npm.js +71 -0
  364. package/packages/packager/src/nuget.js +78 -0
  365. package/packages/packager/src/sbom.js +56 -0
  366. package/packages/packager/src/wheel.js +62 -0
  367. package/packages/spec/src/index.js +11 -0
  368. package/packages/spec/src/requirements.js +139 -0
  369. package/packages/transpile/src/ast.js +51 -0
  370. package/packages/transpile/src/check.js +669 -0
  371. package/packages/transpile/src/emit-csharp.js +469 -0
  372. package/packages/transpile/src/emit-go.js +529 -0
  373. package/packages/transpile/src/emit-java.js +360 -0
  374. package/packages/transpile/src/emit-python.js +320 -0
  375. package/packages/transpile/src/emit-rust.js +499 -0
  376. package/packages/transpile/src/errors.js +15 -0
  377. package/packages/transpile/src/index.js +13 -0
  378. package/packages/transpile/src/lexer.js +161 -0
  379. package/packages/transpile/src/parser.js +543 -0
  380. package/packages/transpile/src/tests/ast.js +46 -0
  381. package/packages/transpile/src/tests/parse.js +376 -0
  382. package/packages/transpile/src/tests/translate.js +849 -0
  383. package/packages/transpile/src/transpile.js +57 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 The sdkloom Authors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
202
+
package/README.md CHANGED
@@ -1,3 +1,240 @@
1
- # Temporary Holding Version
1
+ # sdkloom
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **Write your API SDK once in TypeScript. Generate zero-dependency SDKs for TypeScript, Python, Java, Go, Rust and C#, and prove they behave the same.**
4
+
5
+ [![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
6
+ [![Website](https://img.shields.io/badge/website-sdkloom.atanur.dev-3d4fd6.svg)](https://sdkloom.atanur.dev)
7
+ ![Languages](https://img.shields.io/badge/SDKs-TypeScript%20%7C%20Python%20%7C%20Java%20%7C%20Go%20%7C%20Rust%20%7C%20C%23-555.svg)
8
+ ![Dependencies](https://img.shields.io/badge/runtime%20dependencies-0-success.svg)
9
+
10
+ sdkloom is an open-source SDK generator (API client generator) for teams that ship SDKs in more than one language.
11
+ You describe an HTTP API, its auth and its client-side logic once in TypeScript, or import an OpenAPI 3.0/3.1
12
+ document, and sdkloom:
13
+
14
+ - **generates idiomatic SDKs** for TypeScript, Python, Java, Go, Rust and C#, each using only its standard library;
15
+ - **transpiles your client logic** (auth, OAuth, request signing, retries, business rules) to every language and checks
16
+ that all six compute the same results;
17
+ - **runs one test suite against every SDK** on the oldest and newest runtime each one supports;
18
+ - **rates breaking changes per language** and picks the next version;
19
+ - **packages** for npm, PyPI, Maven Central, Go modules, crates.io and NuGet, with an SBOM.
20
+
21
+ It is a command-line tool that runs on your machine (Node.js 24); there is no account or hosted service.
22
+ Website: **[sdkloom.atanur.dev](https://sdkloom.atanur.dev)** · per-language pages:
23
+ [TypeScript](https://sdkloom.atanur.dev/languages/typescript/) ·
24
+ [Python](https://sdkloom.atanur.dev/languages/python/) ·
25
+ [Java](https://sdkloom.atanur.dev/languages/java/) ·
26
+ [Go](https://sdkloom.atanur.dev/languages/go/) ·
27
+ [Rust](https://sdkloom.atanur.dev/languages/rust/) ·
28
+ [C#](https://sdkloom.atanur.dev/languages/csharp/) ·
29
+ [OpenAPI](https://sdkloom.atanur.dev/openapi/) ·
30
+ [compared with other generators](https://sdkloom.atanur.dev/compare/)
31
+
32
+ **Status:** pre-release. TypeScript (Node 18+), Python (3.8+), Java (11+), Go (1.18+), Rust (1.70+) and C# (.NET Core 3.0+ / .NET 5+) SDKs are generated, tested, versioned and packaged for npm, PyPI, Maven Central, Go modules, crates.io and NuGet, with opt-in packages for Python 2.7 and Java 8.
33
+
34
+ ## Get started
35
+
36
+ sdkloom is not on npm yet; run it from a clone (Node.js 24+, nothing to install):
37
+
38
+ ```sh
39
+ git clone https://github.com/Atanur/sdkloom ~/sdkloom
40
+ mkdir -p ~/.local/bin && printf '#!/bin/sh\nexec node "$HOME/sdkloom/packages/cli/src/main.ts" "$@"\n' > ~/.local/bin/sdkloom && chmod +x ~/.local/bin/sdkloom
41
+
42
+ mkdir my-sdk && cd my-sdk && git init
43
+ sdkloom init # a small sample project
44
+ sdkloom import openapi openapi.json # or start from your OpenAPI document
45
+ sdkloom build && sdkloom test
46
+ ```
47
+
48
+ Moving an SDK you already ship? Give your coding agent the
49
+ [migrate-to-sdkloom skill](skills/migrate-to-sdkloom/SKILL.md). In Claude Code:
50
+
51
+ ```text
52
+ /plugin install sdkloom --marketplace Atanur/sdkloom
53
+ ```
54
+
55
+ ## What it is
56
+
57
+ sdkloom is an open-source toolchain for SDK authors:
58
+
59
+ - **Define once** — describe endpoints, types and auth, and write custom client-side logic, in TypeScript using `@sdkloom/core`.
60
+ - **Generate idiomatic SDKs** — TypeScript, Python, Java, Go, Rust and C#, each using only its standard library.
61
+ - **Test everywhere** — write tests once; sdkloom runs them against every generated SDK and reports a cross-language conformance matrix.
62
+ - **Version safely** — API-surface diffs drive semver bumps, with language-aware breaking-change detection.
63
+ - **Ship** — package, sign and publish to npm, PyPI, Maven Central, crates.io and NuGet (and tag-ready Go modules) from one command.
64
+
65
+ ## Quick look
66
+
67
+ ```ts
68
+ // sdkloom.config.ts
69
+ export default defineConfig({
70
+ name: "payments",
71
+ version: "0.1.0",
72
+ source: "sdk/index.ts",
73
+ targets: {
74
+ typescript: { package: "@example/payments" },
75
+ python: { package: "example-payments", module: "payments" },
76
+ java: { package: "com.example.payments" },
77
+ go: { module: "example.com/payments" },
78
+ rust: { crate: "example-payments" },
79
+ csharp: { package: "Example.Payments" },
80
+ },
81
+ });
82
+ ```
83
+
84
+ ```sh
85
+ sdkloom build # generated/<language>/ + sdkloom.lock.json + api.json
86
+ sdkloom build --check # fails if anything was edited by hand or is out of date
87
+ sdkloom test # scenarios and schema round-trips in every language, your tests in every language, API coverage
88
+ sdkloom serve # a fake API with example data for every operation, for any SDK or team
89
+ sdkloom recipe add retry # ready-made middleware (retry, timing, bearer, basic, apiKeyHeader, oauthClientCredentials, hmacSign, idempotencyKey, userAgent, apiVersionHeader)
90
+ sdkloom record getPet --args '{"id":"p1"}' --config '{"apiKey":"…"}' # one real call saved as a scenario, secrets masked
91
+ sdkloom contract --base-url https://staging.example.com/v1 --config '{"apiKey":"…"}' --args '{"getPet":{"id":"p1"}}'
92
+ # every read operation against a real API: answers must fit the definition; extra fields are listed
93
+ sdkloom import openapi openapi.json # start a definition (sdk/index.ts) from an OpenAPI 3.0/3.1 document
94
+ ```
95
+
96
+ Releasing:
97
+
98
+ ```sh
99
+ sdkloom diff [--behavior] # API changes since the last tag, per language, and the version they need
100
+ sdkloom version # next version, CHANGELOG entry, migrations/<version>.md for breaking changes
101
+ sdkloom verify # build --check, tests, version check, packaging — everything before a release
102
+ sdkloom publish --dry-run # dist/: npm tarball, wheel, Maven bundle, Go module zip, .crate, .nupkg, each with a CycloneDX SBOM
103
+ sdkloom publish --yes # upload (NPM_TOKEN, PYPI_TOKEN, MAVEN_CENTRAL_TOKEN, SDKLOOM_GPG_KEY, CARGO_REGISTRY_TOKEN, NUGET_API_KEY)
104
+ ```
105
+
106
+ A change can break one language and not another: reordering path parameters breaks Python and Java (positional) but
107
+ not TypeScript (named); making a response field required breaks Java (its accessor stops returning `Optional`); an
108
+ optional field added to a request model breaks Rust (struct literals name every field); an operation's first query
109
+ parameter breaks compiled C# callers. `sdkloom diff` reports each change per language, and a release only needs the
110
+ bump of the languages the SDK has. Go modules are published by pushing the tag, so `publish` says what to push.
111
+
112
+ `sdkloom test` runs every scenario on the oldest and newest version each package supports, using the toolchains it
113
+ finds on the machine: interpreters, JDKs, `~/sdk/go1.18*`, rustup toolchains, the SDKs of a `dotnet` installation (or the
114
+ ones named by `SDKLOOM_PYTHON_3_8`, `SDKLOOM_JAVA_HOME_11`, `SDKLOOM_GO_1_18`, `SDKLOOM_CARGO_1_70`, …). Nothing is
115
+ downloaded: Go runs with `GOPROXY=off`, cargo `--offline`, NuGet with its sources cleared. `--container` runs the
116
+ versions that are missing in their official images (`python:2.7-slim`, `eclipse-temurin:8-jdk`, `golang:1.18`,
117
+ `rust:1.70`, `mcr.microsoft.com/dotnet/sdk:8.0`, …); `--strict` fails when a version did not run.
118
+
119
+ ```text
120
+ typescript@18 typescript@24 python@3.8 python@3.15 python-py27@2.7 java@11 java@21 java-jdk8@8 go@1.18 go@1.26 rust@1.70 rust@1.99 csharp@8 csharp@10
121
+ 0001-create-payment ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
122
+ 0002-payment-not-… ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
123
+ 4 cases · 56 passed · 0 failed · 0 n/a · 0 not run
124
+ ```
125
+
126
+ Older versions are never dropped; they are separate packages the author opts into, with the same API and version:
127
+
128
+ ```ts
129
+ python: { package: "example-payments", variants: { py27: {} } }, // example-payments-py27: no annotations or dataclasses
130
+ java: { package: "com.example.payments", variants: { jdk8: {} } }, // payments-jdk8: HttpURLConnection instead of java.net.http
131
+ ```
132
+
133
+ `sdkloom variants <language>` lists what a kit offers. `sdkloom doctor` shows, for every package, the runtimes found for
134
+ its versions and what is known about them (end of life, TLS requirements), with sources; it only informs. The TypeScript
135
+ SDK uses web-standard APIs only, and `sdkloom test` says so (or lists the Node.js-only calls a custom middleware adds).
136
+
137
+ Every generated SDK uses only its language's standard library and ships typed mocks, a fake clock and example values
138
+ for your tests. The Rust crate speaks plain HTTP over `std::net`; for https, give it a `Transport` built on a TLS-capable
139
+ library. The C# SDK is one `netstandard2.1` library with async methods that take a `CancellationToken`.
140
+
141
+ Lists page with `paginate: page.cursor({ items, next, param })`, `page.offset({ items, param, limit })` or
142
+ `page.link({ items })` (the Link header's `rel="next"`, GitHub style; leave `items` out when the operation returns the
143
+ list) on the operation; every SDK then also has `<operation>All`, an iterator over every item that fetches pages as it goes: `for await`
144
+ in TypeScript, a generator in Python, an `Iterable` in Java, a `Pager` in Go, an `Iterator` in Rust and an
145
+ `IAsyncEnumerable` in C#.
146
+
147
+ Long-running work is declared with `wait: poll({ poll: "getExport", param: "id", from: "id", field: "status", done:
148
+ ["succeeded", "failed"] })` on the operation that starts it; every SDK then also has `<operation>AndWait`, which starts
149
+ the work and polls on the client's clock (instant with the fake clock in tests) until it is done or `timeoutMs` passes.
150
+
151
+ File uploads use `body: t.multipart()`: callers build the form with the SDK's `MultipartForm` (`.field(name,
152
+ value)`, `.file(name, filename, contentType, bytes)`), sent as multipart/form-data.
153
+
154
+ An API with dated versions declares `apiVersions: { header, values }` (oldest first); clients pin one with the
155
+ `apiVersion` option (the newest by default), it is sent on every request, and an operation marked `since: "<version>"`
156
+ is refused before sending when the client is pinned to an older version. Versions that change paths (`/v1`, `/v2`) are
157
+ separate servers or separate SDK definitions.
158
+
159
+ A path placeholder `{+key}` takes a value with slashes (`"2026/12/receipt.pdf"`), each segment encoded on its own.
160
+
161
+ An operation declared with `events: Model` streams server-sent events: the response is read as it arrives and each
162
+ event (`event`, `id`, `data`) comes out of an iterator as soon as it is complete: an async generator in TypeScript, a
163
+ generator in Python, an `EventStream` (Iterable, Closeable) in Java, `Next`/`Event`/`Err` in Go, an `Iterator` of
164
+ `Result` in Rust and an `IAsyncEnumerable` in C#. Typed data is read as JSON; `events: t.string()` keeps it as text.
165
+
166
+ Webhooks the API sends are declared under `webhooks:` with `webhook({ payload, signature: hmacSignature({...}) })`:
167
+ which header carries the HMAC-SHA256 signature, how it is encoded, what text is signed (`"{webhook-id}.{webhook-timestamp}.{body}"`
168
+ for Standard Webhooks, `"{body}"` for GitHub-style) and how old a timestamp may be. Every SDK then has a verify function
169
+ (`verifyPaymentEventsWebhook` in TypeScript, `verify_payment_events_webhook` in Python and Rust,
170
+ `PaymentsWebhooks.verifyPaymentEvents` in Java, `PaymentsWebhooks.VerifyPaymentEvents` in C#, `VerifyPaymentEventsWebhook`
171
+ in Go) that takes the raw body, the headers and the secret, compares in constant time and returns the decoded payload or
172
+ fails with `WebhookSignatureError`. OAuth client credentials come as a recipe: `sdkloom recipe add oauthClientCredentials`.
173
+
174
+ Business rules the SDK should offer on their own (a fee, a label, a check) are `logic()` functions:
175
+ `logic("feeCents", { input: { amountCents: t.int(), country: t.string() }, returns: t.int() }, (input) => …)` in the
176
+ definition's `logic: [...]` list. They follow the same subset as middleware ([spec/subset.md](spec/subset.md#logic-functions)),
177
+ take int, number, string and bool inputs, and every SDK exports them: `feeCents({ amountCents, country })` in TypeScript,
178
+ `fee_cents(amount_cents, country)` in Python and Rust, `PaymentsLogic.feeCents(…)` in Java, `FeeCents(…)` (with an
179
+ `error`) in Go and `PaymentsLogic.FeeCents(…)` in C#. Middleware and other logic functions call them too, imported from
180
+ any module of the project. A scenario with `"logic": { "name", "args" }` checks that all six
181
+ compute the same result.
182
+
183
+ Middleware is written once, in TypeScript, and transpiled to Python, Java, Go, Rust and C#; a differential test runs
184
+ each sample in all six languages and requires identical results. It must stay inside a small subset
185
+ ([spec/subset.md](spec/subset.md)); anything outside it stops the build with a rule number and the line. To keep a
186
+ middleware exactly as written in one language, put a native version in `custom/python/middleware.py`,
187
+ `custom/java/Middlewares.java`, `custom/go/middleware.go`, `custom/rust/middleware.rs` or `custom/csharp/Middleware.cs`;
188
+ it replaces the transpiled one.
189
+
190
+ Tests are written once too. `tests/*.test.ts` run in TypeScript and are transpiled to Python `unittest` and to Java
191
+ when `sdkloom test` runs (Go, Rust and C# run the scenarios and schema round-trips; transpiling tests to them comes
192
+ later); a test that uses something outside the test subset runs in TypeScript only, and the output says which rule it
193
+ breaks. Native tests run as well: `tests/python/test_*.py`, `tests/java/**/*Test.java`, `tests/go/*_test.go`,
194
+ `tests/rust/*.rs` (integration tests) and `tests/csharp/*.cs` (public static methods of `*Tests` classes). `testMiddleware()`
195
+ from `@sdkloom/core` tests one middleware on its own.
196
+
197
+ See [examples/payments](examples/payments): its middleware and tests exist only in TypeScript, and the same scenarios
198
+ pass in all six languages.
199
+
200
+ An existing API can start from its OpenAPI 3.0 or 3.1 document (JSON): `sdkloom import openapi openapi.json` writes
201
+ `sdk/index.ts` once, and from then on that file is the definition you edit. Component schemas become models,
202
+ `allOf` is merged, `oneOf`/`anyOf` with a discriminator becomes a union, nullable fields (3.0 `nullable` or 3.1
203
+ `type: [..., "null"]`) stay nullable, multipart bodies become `t.multipart()`, `text/event-stream` responses become
204
+ `events`, and 4xx/5xx responses become named errors. Security schemes are listed with the recipe to add. Whatever cannot
205
+ be carried over exactly (recursive schemas, cookie parameters, HEAD operations, `oneOf` without a discriminator) is
206
+ printed as a warning. [examples/openapi-shop](examples/openapi-shop) is generated this way and passes its scenarios
207
+ in all six languages.
208
+
209
+ ## Moving an existing SDK
210
+
211
+ [skills/migrate-to-sdkloom](skills/migrate-to-sdkloom/SKILL.md) is an agent skill (it works as a checklist for people
212
+ too) that moves an SDK you already ship into sdkloom: inventory, definition, behaviour, scenarios, a comparison of
213
+ the old and new public API per language, and a release plan. What sdkloom cannot express yet is written up as an
214
+ [SDK gap](.github/ISSUE_TEMPLATE/sdk-gap.md) issue, so it can be fixed for everyone.
215
+
216
+ ## Development
217
+
218
+ Requires Node.js 24+, Python 3.8+, a JDK 11+ (sources are compiled with `--release 11`, the Java 8 variant with
219
+ `--release 8`), Go, Rust (rustup, with the 1.70 toolchain) and a .NET SDK (8 and 10). More versions make `npm run verify`
220
+ cover more of the matrix: Node 18, Python 3.8 and 3.15, JDK 8, 11 and 21, Go 1.18 and the latest; Python 2.7 runs in a
221
+ container when Docker (or a compatible engine) answers. No third-party libraries anywhere; the TypeScript compiler is
222
+ the only dev dependency.
223
+
224
+ ```sh
225
+ npm install
226
+ npm run verify # typecheck, tests + 80% coverage, kit/spec/conformance checks
227
+ node packages/cli/src/main.ts help
228
+ ```
229
+
230
+ The website in [site/](site/) is a separate Astro project (shadcn/ui, Tailwind) with its own dependencies; sdkloom and
231
+ the SDKs it generates still have none. `node scripts/build-site.ts` measures the repository for it: it builds
232
+ `examples/payments`, counts and quotes its generated code, and reads the saved output of real `sdkloom test` and
233
+ `sdkloom diff` runs (`site/data/`) into `site/src/data/measured.json`. `cd site && npm run deploy` builds the site and
234
+ publishes it to Cloudflare with Wrangler.
235
+
236
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
237
+
238
+ ## License
239
+
240
+ [Apache-2.0](LICENSE)
@@ -0,0 +1,24 @@
1
+ {
2
+ "description": "Primary sources a kit block may cite. A domain also allows its subdomains; an entry with a path allows that path and everything under it.",
3
+ "sources": [
4
+ "docs.python.org",
5
+ "peps.python.org",
6
+ "docs.oracle.com",
7
+ "openjdk.org/jeps",
8
+ "nodejs.org/api",
9
+ "nodejs.org/docs",
10
+ "learn.microsoft.com",
11
+ "github.com/dotnet/csharplang",
12
+ "github.com/standard-webhooks/standard-webhooks",
13
+ "doc.rust-lang.org",
14
+ "rust-lang.github.io/rfcs",
15
+ "go.dev",
16
+ "pkg.go.dev",
17
+ "tc39.es",
18
+ "rfc-editor.org",
19
+ "developer.mozilla.org",
20
+ "fetch.spec.whatwg.org",
21
+ "html.spec.whatwg.org/multipage/server-sent-events.html",
22
+ "url.spec.whatwg.org"
23
+ ]
24
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "csharp",
3
+ "language": "csharp",
4
+ "version": "0.1.0",
5
+ "supports": ">=3"
6
+ }