@voxgig/sdkgen-langpack 0.0.1

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 (300) hide show
  1. package/.sdk/model/target/dart.aon +63 -0
  2. package/.sdk/model/target/haskell.aon +72 -0
  3. package/.sdk/model/target/lean.aon +91 -0
  4. package/.sdk/src/cmp/dart/Config_dart.ts +248 -0
  5. package/.sdk/src/cmp/dart/EntityBase_dart.ts +34 -0
  6. package/.sdk/src/cmp/dart/EntityOperation_dart.ts +43 -0
  7. package/.sdk/src/cmp/dart/EntityTypes_dart.ts +207 -0
  8. package/.sdk/src/cmp/dart/Entity_dart.ts +87 -0
  9. package/.sdk/src/cmp/dart/Gitignore_dart.ts +34 -0
  10. package/.sdk/src/cmp/dart/MainEntity_dart.ts +33 -0
  11. package/.sdk/src/cmp/dart/Main_dart.ts +178 -0
  12. package/.sdk/src/cmp/dart/Package_dart.ts +82 -0
  13. package/.sdk/src/cmp/dart/ReadmeEntity_dart.ts +177 -0
  14. package/.sdk/src/cmp/dart/ReadmeExamplesTest_dart.ts +238 -0
  15. package/.sdk/src/cmp/dart/ReadmeExplanation_dart.ts +53 -0
  16. package/.sdk/src/cmp/dart/ReadmeHowto_dart.ts +152 -0
  17. package/.sdk/src/cmp/dart/ReadmeInstall_dart.ts +59 -0
  18. package/.sdk/src/cmp/dart/ReadmeIntro_dart.ts +65 -0
  19. package/.sdk/src/cmp/dart/ReadmeModel_dart.ts +151 -0
  20. package/.sdk/src/cmp/dart/ReadmeOptions_dart.ts +63 -0
  21. package/.sdk/src/cmp/dart/ReadmeQuick_dart.ts +225 -0
  22. package/.sdk/src/cmp/dart/ReadmeRef_dart.ts +397 -0
  23. package/.sdk/src/cmp/dart/ReadmeTopHowto_dart.ts +24 -0
  24. package/.sdk/src/cmp/dart/ReadmeTopQuick_dart.ts +106 -0
  25. package/.sdk/src/cmp/dart/ReadmeTopTest_dart.ts +78 -0
  26. package/.sdk/src/cmp/dart/SdkError_dart.ts +42 -0
  27. package/.sdk/src/cmp/dart/TestDirect_dart.ts +516 -0
  28. package/.sdk/src/cmp/dart/TestEntity_dart.ts +628 -0
  29. package/.sdk/src/cmp/dart/Test_dart.ts +138 -0
  30. package/.sdk/src/cmp/dart/fragment/Config.data.fragment.dart +98 -0
  31. package/.sdk/src/cmp/dart/fragment/Config.fragment.dart +70 -0
  32. package/.sdk/src/cmp/dart/fragment/Direct.test.fragment.dart +25 -0
  33. package/.sdk/src/cmp/dart/fragment/Entity.fragment.dart +29 -0
  34. package/.sdk/src/cmp/dart/fragment/Entity.test.fragment.dart +28 -0
  35. package/.sdk/src/cmp/dart/fragment/EntityBase.fragment.dart +302 -0
  36. package/.sdk/src/cmp/dart/fragment/EntityCreateOp.fragment.dart +98 -0
  37. package/.sdk/src/cmp/dart/fragment/EntityListOp.fragment.dart +90 -0
  38. package/.sdk/src/cmp/dart/fragment/EntityLoadOp.fragment.dart +102 -0
  39. package/.sdk/src/cmp/dart/fragment/EntityRemoveOp.fragment.dart +108 -0
  40. package/.sdk/src/cmp/dart/fragment/EntityUpdateOp.fragment.dart +102 -0
  41. package/.sdk/src/cmp/dart/fragment/Main.fragment.dart +339 -0
  42. package/.sdk/src/cmp/dart/fragment/SdkError.fragment.dart +26 -0
  43. package/.sdk/src/cmp/dart/tsconfig.json +15 -0
  44. package/.sdk/src/cmp/dart/utility_dart.ts +155 -0
  45. package/.sdk/src/cmp/haskell/Config_haskell.ts +98 -0
  46. package/.sdk/src/cmp/haskell/Entity_haskell.ts +13 -0
  47. package/.sdk/src/cmp/haskell/Gitignore_haskell.ts +27 -0
  48. package/.sdk/src/cmp/haskell/Main_haskell.ts +123 -0
  49. package/.sdk/src/cmp/haskell/Package_haskell.ts +60 -0
  50. package/.sdk/src/cmp/haskell/ReadmeEntity_haskell.ts +186 -0
  51. package/.sdk/src/cmp/haskell/ReadmeExamplesTest_haskell.ts +135 -0
  52. package/.sdk/src/cmp/haskell/ReadmeExplanation_haskell.ts +48 -0
  53. package/.sdk/src/cmp/haskell/ReadmeHowto_haskell.ts +168 -0
  54. package/.sdk/src/cmp/haskell/ReadmeInstall_haskell.ts +51 -0
  55. package/.sdk/src/cmp/haskell/ReadmeIntro_haskell.ts +67 -0
  56. package/.sdk/src/cmp/haskell/ReadmeModel_haskell.ts +162 -0
  57. package/.sdk/src/cmp/haskell/ReadmeOptions_haskell.ts +74 -0
  58. package/.sdk/src/cmp/haskell/ReadmeQuick_haskell.ts +241 -0
  59. package/.sdk/src/cmp/haskell/ReadmeRef_haskell.ts +408 -0
  60. package/.sdk/src/cmp/haskell/ReadmeTopHowto_haskell.ts +31 -0
  61. package/.sdk/src/cmp/haskell/ReadmeTopQuick_haskell.ts +104 -0
  62. package/.sdk/src/cmp/haskell/ReadmeTopTest_haskell.ts +80 -0
  63. package/.sdk/src/cmp/haskell/Test_haskell.ts +297 -0
  64. package/.sdk/src/cmp/haskell/tsconfig.json +15 -0
  65. package/.sdk/src/cmp/haskell/utility_haskell.ts +166 -0
  66. package/.sdk/src/cmp/lean/Config_lean.ts +93 -0
  67. package/.sdk/src/cmp/lean/Entity_lean.ts +9 -0
  68. package/.sdk/src/cmp/lean/Gitignore_lean.ts +18 -0
  69. package/.sdk/src/cmp/lean/Main_lean.ts +120 -0
  70. package/.sdk/src/cmp/lean/Package_lean.ts +93 -0
  71. package/.sdk/src/cmp/lean/ReadmeEntity_lean.ts +29 -0
  72. package/.sdk/src/cmp/lean/ReadmeExplanation_lean.ts +19 -0
  73. package/.sdk/src/cmp/lean/ReadmeHowto_lean.ts +25 -0
  74. package/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +39 -0
  75. package/.sdk/src/cmp/lean/ReadmeIntro_lean.ts +25 -0
  76. package/.sdk/src/cmp/lean/ReadmeModel_lean.ts +24 -0
  77. package/.sdk/src/cmp/lean/ReadmeOptions_lean.ts +22 -0
  78. package/.sdk/src/cmp/lean/ReadmeQuick_lean.ts +50 -0
  79. package/.sdk/src/cmp/lean/ReadmeRef_lean.ts +40 -0
  80. package/.sdk/src/cmp/lean/ReadmeTopHowto_lean.ts +16 -0
  81. package/.sdk/src/cmp/lean/ReadmeTopQuick_lean.ts +23 -0
  82. package/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +19 -0
  83. package/.sdk/src/cmp/lean/Test_lean.ts +261 -0
  84. package/.sdk/src/cmp/lean/utility_lean.ts +129 -0
  85. package/.sdk/tm/dart/LICENSE +22 -0
  86. package/.sdk/tm/dart/Makefile +50 -0
  87. package/.sdk/tm/dart/lib/Context.dart +150 -0
  88. package/.sdk/tm/dart/lib/Control.dart +15 -0
  89. package/.sdk/tm/dart/lib/Operation.dart +31 -0
  90. package/.sdk/tm/dart/lib/Point.dart +51 -0
  91. package/.sdk/tm/dart/lib/Response.dart +32 -0
  92. package/.sdk/tm/dart/lib/Result.dart +39 -0
  93. package/.sdk/tm/dart/lib/Spec.dart +49 -0
  94. package/.sdk/tm/dart/lib/feature/audit/AuditFeature.dart +103 -0
  95. package/.sdk/tm/dart/lib/feature/base/BaseFeature.dart +76 -0
  96. package/.sdk/tm/dart/lib/feature/cache/CacheFeature.dart +152 -0
  97. package/.sdk/tm/dart/lib/feature/clienttrack/ClienttrackFeature.dart +104 -0
  98. package/.sdk/tm/dart/lib/feature/cost/CostFeature.dart +446 -0
  99. package/.sdk/tm/dart/lib/feature/debug/DebugFeature.dart +153 -0
  100. package/.sdk/tm/dart/lib/feature/idempotency/IdempotencyFeature.dart +92 -0
  101. package/.sdk/tm/dart/lib/feature/log/LogFeature.dart +85 -0
  102. package/.sdk/tm/dart/lib/feature/metrics/MetricsFeature.dart +103 -0
  103. package/.sdk/tm/dart/lib/feature/netsim/NetsimFeature.dart +186 -0
  104. package/.sdk/tm/dart/lib/feature/paging/PagingFeature.dart +240 -0
  105. package/.sdk/tm/dart/lib/feature/proxy/ProxyFeature.dart +118 -0
  106. package/.sdk/tm/dart/lib/feature/ratelimit/RatelimitFeature.dart +103 -0
  107. package/.sdk/tm/dart/lib/feature/rbac/RbacFeature.dart +121 -0
  108. package/.sdk/tm/dart/lib/feature/retry/RetryFeature.dart +155 -0
  109. package/.sdk/tm/dart/lib/feature/secrets/SecretsFeature.dart +649 -0
  110. package/.sdk/tm/dart/lib/feature/secrets/plugin/capability.dart +105 -0
  111. package/.sdk/tm/dart/lib/feature/secrets/plugin/catalog.dart +46 -0
  112. package/.sdk/tm/dart/lib/feature/secrets/plugin/config.dart +297 -0
  113. package/.sdk/tm/dart/lib/feature/secrets/plugin/depend.dart +198 -0
  114. package/.sdk/tm/dart/lib/feature/secrets/plugin/env.dart +144 -0
  115. package/.sdk/tm/dart/lib/feature/secrets/plugin/export.dart +58 -0
  116. package/.sdk/tm/dart/lib/feature/secrets/plugin/graph.dart +160 -0
  117. package/.sdk/tm/dart/lib/feature/secrets/plugin/host.dart +1067 -0
  118. package/.sdk/tm/dart/lib/feature/secrets/plugin/order.dart +172 -0
  119. package/.sdk/tm/dart/lib/feature/secrets/plugin/plugin.dart +23 -0
  120. package/.sdk/tm/dart/lib/feature/secrets/plugin/point.dart +117 -0
  121. package/.sdk/tm/dart/lib/feature/secrets/plugin/ref.dart +105 -0
  122. package/.sdk/tm/dart/lib/feature/secrets/plugin/resolve.dart +58 -0
  123. package/.sdk/tm/dart/lib/feature/secrets/plugin/types.dart +201 -0
  124. package/.sdk/tm/dart/lib/feature/secrets/plugin/version.dart +116 -0
  125. package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/aws.dart +285 -0
  126. package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/azuresecrets.dart +178 -0
  127. package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/boru.dart +145 -0
  128. package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/crypto.dart +194 -0
  129. package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/doppler.dart +101 -0
  130. package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/gcpsecrets.dart +143 -0
  131. package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/hashicorp.dart +190 -0
  132. package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/httpjson.dart +363 -0
  133. package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/infisical.dart +149 -0
  134. package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/onepassword.dart +146 -0
  135. package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/secretspec.dart +116 -0
  136. package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/sigv4.dart +237 -0
  137. package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/addr.dart +138 -0
  138. package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/json.dart +276 -0
  139. package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/provider.dart +31 -0
  140. package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/providers.dart +243 -0
  141. package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/sekreto.dart +730 -0
  142. package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/spec.dart +200 -0
  143. package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/support.dart +217 -0
  144. package/.sdk/tm/dart/lib/feature/streaming/StreamingFeature.dart +97 -0
  145. package/.sdk/tm/dart/lib/feature/telemetry/TelemetryFeature.dart +136 -0
  146. package/.sdk/tm/dart/lib/feature/test/TestFeature.dart +328 -0
  147. package/.sdk/tm/dart/lib/feature/timeout/TimeoutFeature.dart +104 -0
  148. package/.sdk/tm/dart/lib/utility/CleanUtility.dart +12 -0
  149. package/.sdk/tm/dart/lib/utility/DoneUtility.dart +18 -0
  150. package/.sdk/tm/dart/lib/utility/ErrUtility.dart +46 -0
  151. package/.sdk/tm/dart/lib/utility/FeatureAddUtility.dart +35 -0
  152. package/.sdk/tm/dart/lib/utility/FeatureHookUtility.dart +20 -0
  153. package/.sdk/tm/dart/lib/utility/FeatureInitUtility.dart +9 -0
  154. package/.sdk/tm/dart/lib/utility/FetcherUtility.dart +104 -0
  155. package/.sdk/tm/dart/lib/utility/GraphqlUtility.dart +162 -0
  156. package/.sdk/tm/dart/lib/utility/MakeContextUtility.dart +6 -0
  157. package/.sdk/tm/dart/lib/utility/MakeErrorUtility.dart +71 -0
  158. package/.sdk/tm/dart/lib/utility/MakeFetchDefUtility.dart +42 -0
  159. package/.sdk/tm/dart/lib/utility/MakeOptionsUtility.dart +233 -0
  160. package/.sdk/tm/dart/lib/utility/MakePointUtility.dart +130 -0
  161. package/.sdk/tm/dart/lib/utility/MakeRequestUtility.dart +66 -0
  162. package/.sdk/tm/dart/lib/utility/MakeResponseUtility.dart +59 -0
  163. package/.sdk/tm/dart/lib/utility/MakeResultUtility.dart +49 -0
  164. package/.sdk/tm/dart/lib/utility/MakeSpecUtility.dart +77 -0
  165. package/.sdk/tm/dart/lib/utility/MakeUrlUtility.dart +51 -0
  166. package/.sdk/tm/dart/lib/utility/ParamUtility.dart +56 -0
  167. package/.sdk/tm/dart/lib/utility/PrepareAuthUtility.dart +46 -0
  168. package/.sdk/tm/dart/lib/utility/PrepareBodyUtility.dart +19 -0
  169. package/.sdk/tm/dart/lib/utility/PrepareHeadersUtility.dart +11 -0
  170. package/.sdk/tm/dart/lib/utility/PrepareMethodUtility.dart +30 -0
  171. package/.sdk/tm/dart/lib/utility/PrepareParamsUtility.dart +23 -0
  172. package/.sdk/tm/dart/lib/utility/PreparePathUtility.dart +9 -0
  173. package/.sdk/tm/dart/lib/utility/PrepareQueryUtility.dart +18 -0
  174. package/.sdk/tm/dart/lib/utility/ResultBasicUtility.dart +29 -0
  175. package/.sdk/tm/dart/lib/utility/ResultBodyUtility.dart +15 -0
  176. package/.sdk/tm/dart/lib/utility/ResultHeadersUtility.dart +18 -0
  177. package/.sdk/tm/dart/lib/utility/StructUtility.dart +127 -0
  178. package/.sdk/tm/dart/lib/utility/TransformRequestUtility.dart +28 -0
  179. package/.sdk/tm/dart/lib/utility/TransformResponseUtility.dart +44 -0
  180. package/.sdk/tm/dart/lib/utility/Utility.dart +239 -0
  181. package/.sdk/tm/dart/lib/utility/voxgig_struct.dart +2462 -0
  182. package/.sdk/tm/dart/src/feature/README.md +3 -0
  183. package/.sdk/tm/dart/src/feature/audit/.gitkeep +0 -0
  184. package/.sdk/tm/dart/src/feature/base/.gitkeep +0 -0
  185. package/.sdk/tm/dart/src/feature/cache/.gitkeep +0 -0
  186. package/.sdk/tm/dart/src/feature/clienttrack/.gitkeep +0 -0
  187. package/.sdk/tm/dart/src/feature/cost/.gitkeep +0 -0
  188. package/.sdk/tm/dart/src/feature/debug/.gitkeep +0 -0
  189. package/.sdk/tm/dart/src/feature/idempotency/.gitkeep +0 -0
  190. package/.sdk/tm/dart/src/feature/log/.gitkeep +0 -0
  191. package/.sdk/tm/dart/src/feature/metrics/.gitkeep +0 -0
  192. package/.sdk/tm/dart/src/feature/netsim/.gitkeep +0 -0
  193. package/.sdk/tm/dart/src/feature/paging/.gitkeep +0 -0
  194. package/.sdk/tm/dart/src/feature/proxy/.gitkeep +0 -0
  195. package/.sdk/tm/dart/src/feature/ratelimit/.gitkeep +0 -0
  196. package/.sdk/tm/dart/src/feature/rbac/.gitkeep +0 -0
  197. package/.sdk/tm/dart/src/feature/retry/.gitkeep +0 -0
  198. package/.sdk/tm/dart/src/feature/secrets/.gitkeep +0 -0
  199. package/.sdk/tm/dart/src/feature/streaming/.gitkeep +0 -0
  200. package/.sdk/tm/dart/src/feature/telemetry/.gitkeep +0 -0
  201. package/.sdk/tm/dart/src/feature/test/.gitkeep +0 -0
  202. package/.sdk/tm/dart/src/feature/timeout/.gitkeep +0 -0
  203. package/.sdk/tm/dart/test/custom_test.dart +65 -0
  204. package/.sdk/tm/dart/test/exists_test.dart +12 -0
  205. package/.sdk/tm/dart/test/feature/harness.dart +347 -0
  206. package/.sdk/tm/dart/test/feature/secrets/secrets_test.dart +1107 -0
  207. package/.sdk/tm/dart/test/feature_test.dart +1193 -0
  208. package/.sdk/tm/dart/test/harness.dart +153 -0
  209. package/.sdk/tm/dart/test/netsim_test.dart +48 -0
  210. package/.sdk/tm/dart/test/omni.dart +520 -0
  211. package/.sdk/tm/dart/test/omni_smoke_test.dart +143 -0
  212. package/.sdk/tm/dart/test/pipeline_test.dart +608 -0
  213. package/.sdk/tm/dart/test/primary_test.dart +476 -0
  214. package/.sdk/tm/dart/test/sdk-test-control.json +19 -0
  215. package/.sdk/tm/dart/test/struct_test.dart +468 -0
  216. package/.sdk/tm/dart/test/utility.dart +198 -0
  217. package/.sdk/tm/dart/test/vendor/omni/omni.dart +7 -0
  218. package/.sdk/tm/dart/test/vendor/omni/runner.dart +653 -0
  219. package/.sdk/tm/dart/test/vendor/omni/util.dart +232 -0
  220. package/.sdk/tm/haskell/LICENSE +21 -0
  221. package/.sdk/tm/haskell/Makefile +22 -0
  222. package/.sdk/tm/haskell/VERSION +1 -0
  223. package/.sdk/tm/haskell/src/SdkFeatures.hs +1440 -0
  224. package/.sdk/tm/haskell/src/SdkHelpers.hs +337 -0
  225. package/.sdk/tm/haskell/src/SdkJson.hs +111 -0
  226. package/.sdk/tm/haskell/src/SdkRuntime.hs +1279 -0
  227. package/.sdk/tm/haskell/src/SdkTypes.hs +195 -0
  228. package/.sdk/tm/haskell/src/VoxgigStruct.hs +2299 -0
  229. package/.sdk/tm/haskell/src/Vregex.hs +237 -0
  230. package/.sdk/tm/haskell/src/feature/README.md +5 -0
  231. package/.sdk/tm/haskell/src/feature/audit/.gitkeep +0 -0
  232. package/.sdk/tm/haskell/src/feature/base/.gitkeep +0 -0
  233. package/.sdk/tm/haskell/src/feature/cache/.gitkeep +0 -0
  234. package/.sdk/tm/haskell/src/feature/clienttrack/.gitkeep +0 -0
  235. package/.sdk/tm/haskell/src/feature/debug/.gitkeep +0 -0
  236. package/.sdk/tm/haskell/src/feature/idempotency/.gitkeep +0 -0
  237. package/.sdk/tm/haskell/src/feature/log/.gitkeep +0 -0
  238. package/.sdk/tm/haskell/src/feature/metrics/.gitkeep +0 -0
  239. package/.sdk/tm/haskell/src/feature/netsim/.gitkeep +0 -0
  240. package/.sdk/tm/haskell/src/feature/paging/.gitkeep +0 -0
  241. package/.sdk/tm/haskell/src/feature/proxy/.gitkeep +0 -0
  242. package/.sdk/tm/haskell/src/feature/ratelimit/.gitkeep +0 -0
  243. package/.sdk/tm/haskell/src/feature/rbac/.gitkeep +0 -0
  244. package/.sdk/tm/haskell/src/feature/retry/.gitkeep +0 -0
  245. package/.sdk/tm/haskell/src/feature/streaming/.gitkeep +0 -0
  246. package/.sdk/tm/haskell/src/feature/telemetry/.gitkeep +0 -0
  247. package/.sdk/tm/haskell/src/feature/test/.gitkeep +0 -0
  248. package/.sdk/tm/haskell/src/feature/timeout/.gitkeep +0 -0
  249. package/.sdk/tm/haskell/test/Harness.hs +281 -0
  250. package/.sdk/tm/haskell/test/OmniResolver.hs +252 -0
  251. package/.sdk/tm/haskell/test/Runner.hs +49 -0
  252. package/.sdk/tm/haskell/test/StructCorpus.hs +449 -0
  253. package/.sdk/tm/haskell/test/TCustomUtility.hs +38 -0
  254. package/.sdk/tm/haskell/test/TFeature.hs +794 -0
  255. package/.sdk/tm/haskell/test/TNetsim.hs +50 -0
  256. package/.sdk/tm/haskell/test/TPipeline.hs +334 -0
  257. package/.sdk/tm/haskell/test/TPrimaryCorpus.hs +263 -0
  258. package/.sdk/tm/haskell/test/TPrimaryUtility.hs +386 -0
  259. package/.sdk/tm/haskell/test/Testutil.hs +59 -0
  260. package/.sdk/tm/haskell/test/vendor/omni/Omni.hs +1147 -0
  261. package/.sdk/tm/lean/LICENSE +21 -0
  262. package/.sdk/tm/lean/Makefile +32 -0
  263. package/.sdk/tm/lean/VERSION +1 -0
  264. package/.sdk/tm/lean/src/SdkFeature.lean +171 -0
  265. package/.sdk/tm/lean/src/SdkFeatures.lean +787 -0
  266. package/.sdk/tm/lean/src/SdkJson.lean +134 -0
  267. package/.sdk/tm/lean/src/SdkRuntime.lean +374 -0
  268. package/.sdk/tm/lean/src/SdkUtility.lean +809 -0
  269. package/.sdk/tm/lean/src/VoxgigStruct.lean +2880 -0
  270. package/.sdk/tm/lean/src/Vregex.lean +412 -0
  271. package/.sdk/tm/lean/src/feature/README.md +5 -0
  272. package/.sdk/tm/lean/src/feature/audit/.gitkeep +0 -0
  273. package/.sdk/tm/lean/src/feature/base/.gitkeep +0 -0
  274. package/.sdk/tm/lean/src/feature/cache/.gitkeep +0 -0
  275. package/.sdk/tm/lean/src/feature/clienttrack/.gitkeep +0 -0
  276. package/.sdk/tm/lean/src/feature/cost/.gitkeep +0 -0
  277. package/.sdk/tm/lean/src/feature/debug/.gitkeep +0 -0
  278. package/.sdk/tm/lean/src/feature/idempotency/.gitkeep +0 -0
  279. package/.sdk/tm/lean/src/feature/log/.gitkeep +0 -0
  280. package/.sdk/tm/lean/src/feature/metrics/.gitkeep +0 -0
  281. package/.sdk/tm/lean/src/feature/netsim/.gitkeep +0 -0
  282. package/.sdk/tm/lean/src/feature/paging/.gitkeep +0 -0
  283. package/.sdk/tm/lean/src/feature/proxy/.gitkeep +0 -0
  284. package/.sdk/tm/lean/src/feature/ratelimit/.gitkeep +0 -0
  285. package/.sdk/tm/lean/src/feature/rbac/.gitkeep +0 -0
  286. package/.sdk/tm/lean/src/feature/retry/.gitkeep +0 -0
  287. package/.sdk/tm/lean/src/feature/streaming/.gitkeep +0 -0
  288. package/.sdk/tm/lean/src/feature/telemetry/.gitkeep +0 -0
  289. package/.sdk/tm/lean/src/feature/test/.gitkeep +0 -0
  290. package/.sdk/tm/lean/src/feature/timeout/.gitkeep +0 -0
  291. package/.sdk/tm/lean/test/OmniResolver.lean +358 -0
  292. package/.sdk/tm/lean/test/OmniSmoke.lean +174 -0
  293. package/.sdk/tm/lean/test/StructCorpus.lean +368 -0
  294. package/.sdk/tm/lean/test/TFeature.lean +281 -0
  295. package/.sdk/tm/lean/test/TPrimaryUtility.lean +227 -0
  296. package/.sdk/tm/lean/test/vendor/omni/Omni.lean +997 -0
  297. package/LICENSE +21 -0
  298. package/README.md +104 -0
  299. package/package.json +78 -0
  300. package/sdkgen-package.json +22 -0
@@ -0,0 +1,93 @@
1
+ import {
2
+ Content,
3
+ File,
4
+ cmp,
5
+ each,
6
+ isAuthActive,
7
+ resolveAuthPrefix,
8
+ targetFeatures,
9
+ configDefinition,
10
+ } from '@voxgig/sdkgen'
11
+
12
+ import {
13
+ KIT,
14
+ Model,
15
+ getModelPath,
16
+ } from '@voxgig/apidef'
17
+
18
+ import {
19
+ leanString,
20
+ } from './utility_lean'
21
+
22
+
23
+ // SdkConfig.lean: the embedded API model, serialised to a JSON string. The
24
+ // config-driven runtime (SdkRuntime) parses it into a struct `Value` at client
25
+ // construction — the whole SDK is data-driven, so there is no per-entity code.
26
+ const Config = cmp(async function Config(props: any) {
27
+ const ctx$ = props.ctx$
28
+ const target = props.target
29
+
30
+ const model: Model = ctx$.model
31
+
32
+ const entity = getModelPath(model, `main.${KIT}.entity`)
33
+ const { def: configDef } = configDefinition(model, target.name)
34
+ // Gated by the applicability tags, so this target never imports or
35
+ // registers a feature it has no source for. One rule, one place:
36
+ // helpers/applicability.
37
+ const feature = targetFeatures(model, target)
38
+ const headers = getModelPath(model, `main.${KIT}.config.headers`) || {}
39
+
40
+ const authActive = isAuthActive(model)
41
+ const authPrefix = resolveAuthPrefix(model)
42
+
43
+ let baseUrl = ''
44
+ try { baseUrl = getModelPath(model, `main.${KIT}.info.servers.0.url`) } catch (_e) { }
45
+
46
+ const featureConfig: any = {}
47
+ each(feature, (f: any) => { featureConfig[f.name] = f.config || {} })
48
+
49
+ const entityOptions: any = {}
50
+ each(entity, (ent: any) => { entityOptions[ent.name] = {} })
51
+
52
+ const options: any = {
53
+ base: baseUrl,
54
+ headers,
55
+ entity: entityOptions,
56
+ }
57
+ if (authActive) {
58
+ options.auth = { prefix: authPrefix }
59
+ }
60
+
61
+ // configDefinition's `def.entity` verbatim, NOT rebuilt here. This reduce
62
+ // was one of fourteen copies of that function's entityDefs loop, and when
63
+ // configDefinition started reconstructing a point's `parts` from apidef's
64
+ // segment vector (its ADR-003), only the copies that read `configDef` got
65
+ // it — this target's literal config emitted paths with no parts at all
66
+ // while its data config had them. One rule, one place.
67
+ const entityConfig = configDef.entity
68
+
69
+ const config = {
70
+ main: { name: model.const.Name },
71
+ feature: featureConfig,
72
+ options,
73
+ entity: entityConfig,
74
+ }
75
+
76
+ File({ name: 'SdkConfig.' + target.ext }, () => {
77
+ Content(`-- Generated API configuration for the config-driven runtime.
78
+ -- The embedded model is parsed into a struct Value at client construction.
79
+
80
+ namespace SdkConfig
81
+
82
+ def configJson : String :=
83
+ ${leanString(JSON.stringify(config))}
84
+
85
+ end SdkConfig
86
+ `)
87
+ })
88
+ })
89
+
90
+
91
+ export {
92
+ Config
93
+ }
@@ -0,0 +1,9 @@
1
+ import { cmp } from '@voxgig/sdkgen'
2
+
3
+ // Entities are generic in the Lean target: there is no per-entity generated
4
+ // module. Every entity's operations are dispatched by the config-driven
5
+ // SdkRuntime (see SdkClient), so this component emits nothing. It exists only
6
+ // so the neutral Entity component can resolve a language delegate.
7
+ const Entity = cmp(function Entity(_props: any) {})
8
+
9
+ export { Entity }
@@ -0,0 +1,18 @@
1
+ import { Content, File, cmp } from '@voxgig/sdkgen'
2
+
3
+ const Gitignore = cmp(async function Gitignore(_props: any) {
4
+ File({ name: '.gitignore' }, () => {
5
+ Content(`# Lake build output
6
+ .lake/
7
+ build/
8
+ lake-packages/
9
+
10
+ # IDE / OS
11
+ .idea/
12
+ .vscode/
13
+ .DS_Store
14
+ `)
15
+ })
16
+ })
17
+
18
+ export { Gitignore }
@@ -0,0 +1,120 @@
1
+ import {
2
+ cmp, each,
3
+ File, Content, Copy, Folder,
4
+ } from '@voxgig/sdkgen'
5
+
6
+ import type {
7
+ ModelEntity
8
+ } from '@voxgig/apidef'
9
+
10
+ import {
11
+ KIT,
12
+ getModelPath
13
+ } from '@voxgig/apidef'
14
+
15
+ import { Package } from './Package_lean'
16
+ import { Config } from './Config_lean'
17
+ import { Gitignore } from './Gitignore_lean'
18
+
19
+
20
+ // Op name -> generated wrapper. list/load/remove take a match; create takes
21
+ // data; update takes both. Any non-standard op falls back to the match+data
22
+ // form. Every wrapper delegates to the config-driven SdkRuntime.
23
+ function opWrapper(entName: string, opName: string): string {
24
+ const q = `"${entName}"`
25
+ switch (opName) {
26
+ case 'list':
27
+ return ` def list (c m co : Value) : SIO Value := SdkRuntime.opList c ${q} m co\n`
28
+ case 'load':
29
+ return ` def load (c m co : Value) : SIO Value := SdkRuntime.opLoad c ${q} m co\n`
30
+ case 'remove':
31
+ return ` def remove (c m co : Value) : SIO Value := SdkRuntime.opRemove c ${q} m co\n`
32
+ case 'create':
33
+ return ` def create (c d co : Value) : SIO Value := SdkRuntime.opCreate c ${q} d co\n`
34
+ case 'update':
35
+ return ` def update (c m d co : Value) : SIO Value := SdkRuntime.opUpdate c ${q} m d co\n`
36
+ default:
37
+ return ` def ${opName} (c m d co : Value) : SIO Value := SdkRuntime.runOp c ${q} "${opName}" m d co\n`
38
+ }
39
+ }
40
+
41
+
42
+ const Main = cmp(async function Main(props: any) {
43
+
44
+ const { target } = props
45
+ const { model } = props.ctx$
46
+
47
+ const entity: ModelEntity = getModelPath(model, `main.${KIT}.entity`)
48
+
49
+ Package({ target })
50
+ Gitignore({})
51
+
52
+ // Copy tm/lean verbatim (placeholder substitution applies): the runtime under
53
+ // src/ (VoxgigStruct, Vregex, SdkJson, SdkRuntime), plus LICENSE/VERSION. The
54
+ // per-feature custom-source scaffold under src/feature is excluded.
55
+ Copy({
56
+ from: 'tm/' + target.name,
57
+ exclude: [/src\/feature\//],
58
+ replace: {
59
+ ...props.ctx$.stdrep,
60
+ }
61
+ })
62
+
63
+ // Generated modules under src/: the embedded API config and the public
64
+ // client (constructors + one op namespace per entity).
65
+ Folder({ name: 'src' }, () => {
66
+
67
+ Config({ target })
68
+
69
+ File({ name: 'SdkClient.' + target.ext }, () => {
70
+
71
+ let namespaces = ''
72
+ each(entity, (e: any) => {
73
+ // Capitalise the entity name for its op namespace.
74
+ const ns = e.name.charAt(0).toUpperCase() + e.name.slice(1)
75
+ let ops = ''
76
+ each(e.op, (op: any) => { ops += opWrapper(e.name, op.name) })
77
+ namespaces += `namespace ${ns}\n${ops}end ${ns}\n\n`
78
+ })
79
+
80
+ Content(`-- ${model.const.Name} SDK public client (generated by @voxgig/sdkgen).
81
+ --
82
+ -- Constructors (newSdk / testSdk) and one op namespace per entity. Entities are
83
+ -- generic: every op delegates to the config-driven SdkRuntime, so the pipeline
84
+ -- is identical for every entity and every API.
85
+
86
+ import VoxgigStruct
87
+ import SdkRuntime
88
+ import SdkConfig
89
+
90
+ open VoxgigStruct
91
+
92
+ namespace Sdk
93
+
94
+ /-- Construct a live client from an options map (empty map = defaults). -/
95
+ def newSdk (options : Value) : SIO Value :=
96
+ SdkRuntime.mkClientV options SdkConfig.configJson
97
+
98
+ /-- No-argument convenience constructor. -/
99
+ def newSdk0 : SIO Value := do newSdk (← emptyMap)
100
+
101
+ /-- Construct a test-mode client: operations are answered from an in-memory
102
+ store seeded with the entity test data, so no server is needed. -/
103
+ def testSdk (seed : Value) (options : Value) : SIO Value :=
104
+ SdkRuntime.mkTestClientV options SdkConfig.configJson seed
105
+
106
+ /-- Test client with default options. -/
107
+ def testSdk0 (seed : Value) : SIO Value := do testSdk seed (← emptyMap)
108
+
109
+ end Sdk
110
+
111
+ ${namespaces}`)
112
+ })
113
+ })
114
+
115
+ })
116
+
117
+
118
+ export {
119
+ Main
120
+ }
@@ -0,0 +1,93 @@
1
+ import {
2
+ Content,
3
+ File,
4
+ cmp,
5
+ packageVersion,
6
+ } from '@voxgig/sdkgen'
7
+
8
+ import type {
9
+ Model,
10
+ } from '@voxgig/apidef'
11
+
12
+ import { pkgName } from './utility_lean'
13
+
14
+
15
+ // Each runtime module is its own `lean_lib` (Lake globs `<LibName>.lean` from
16
+ // srcDir), matching the vendored struct project's layout. The runtime is
17
+ // dependency-free (prelude + Std only); the HTTP transport shells to curl.
18
+ const LIBS = [
19
+ 'Vregex', 'VoxgigStruct', 'SdkJson', 'SdkUtility', 'SdkFeature', 'SdkFeatures', 'SdkRuntime', 'SdkConfig',
20
+ 'SdkClient',
21
+ ]
22
+
23
+
24
+ const Package = cmp(async function Package(props: any) {
25
+ const ctx$ = props.ctx$
26
+ const target = props.target
27
+ const model: Model = ctx$.model
28
+
29
+ const libBlocks = LIBS.map((n) =>
30
+ `[[lean_lib]]\nname = "${n}"\nsrcDir = "src"\n`).join('\n')
31
+
32
+ File({ name: 'lakefile.toml' }, () => {
33
+ Content(`# ${model.const.Name} SDK for Lean 4 (generated by @voxgig/sdkgen).
34
+ name = "${pkgName(model)}"
35
+ version = "${packageVersion(model, target.name)}"
36
+ defaultTargets = ["SdkClient"]
37
+
38
+ ${libBlocks}
39
+ # The corpus ENGINE: the vendored @voxgig/omni Lean port, source rather than
40
+ # a dependency. Its own lean_lib so Lake can find the module, and
41
+ # deliberately NOT in defaultTargets: only the test executables import it, so
42
+ # \`lake build\` compiles the shipped library without it and nothing a
43
+ # consumer installs ever names omni. Lake has no test-scoped dependency, so
44
+ # vendoring is what keeps that isolation.
45
+ [[lean_lib]]
46
+ name = "Omni"
47
+ srcDir = "test/vendor/omni"
48
+
49
+ # The adapter that drives omni's native API with subjects built from this
50
+ # SDK's own utilities. Imported by the corpus suites and the smoke test.
51
+ [[lean_lib]]
52
+ name = "OmniResolver"
53
+ srcDir = "test"
54
+
55
+ [[lean_exe]]
56
+ name = "runner"
57
+ srcDir = "test"
58
+ root = "Runner"
59
+
60
+ [[lean_exe]]
61
+ name = "structcorpus"
62
+ srcDir = "test"
63
+ root = "StructCorpus"
64
+
65
+ [[lean_exe]]
66
+ name = "primary"
67
+ srcDir = "test"
68
+ root = "TPrimaryUtility"
69
+
70
+ [[lean_exe]]
71
+ name = "feature"
72
+ srcDir = "test"
73
+ root = "TFeature"
74
+
75
+ # Smoke test for the vendored engine itself: a runner that cannot FAIL a bad
76
+ # entry would turn every corpus suite vacuously green.
77
+ [[lean_exe]]
78
+ name = "omnismoke"
79
+ srcDir = "test"
80
+ root = "OmniSmoke"
81
+ `)
82
+ })
83
+
84
+ // Pin the toolchain to the version the runtime is developed against.
85
+ File({ name: 'lean-toolchain' }, () => {
86
+ Content(`leanprover/lean4:v4.32.1\n`)
87
+ })
88
+ })
89
+
90
+
91
+ export {
92
+ Package
93
+ }
@@ -0,0 +1,29 @@
1
+ import { cmp, Content, each } from '@voxgig/sdkgen'
2
+
3
+ // One section per entity: its op namespace and the verbs it supports.
4
+ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
5
+ const { entity } = props
6
+ if (null == entity) return
7
+ const ns = entity.name.charAt(0).toUpperCase() + entity.name.slice(1)
8
+ const ops = Object.keys(entity.op || {}).sort()
9
+ if (0 === ops.length) return
10
+
11
+ let rows = ''
12
+ for (const op of ops) {
13
+ const call =
14
+ 'create' === op ? `${ns}.create sdk data (← emptyMap)`
15
+ : 'update' === op ? `${ns}.update sdk match data (← emptyMap)`
16
+ : `${ns}.${op} sdk match (← emptyMap)`
17
+ rows += `| \`${op}\` | \`${call}\` |\n`
18
+ }
19
+
20
+ Content(`Operations are in the \`${ns}\` namespace; each takes the client first
21
+ and per-call options last.
22
+
23
+ | Op | Call |
24
+ | --- | --- |
25
+ ${rows}
26
+ `)
27
+ })
28
+
29
+ export { ReadmeEntity }
@@ -0,0 +1,19 @@
1
+ import { cmp, Content } from '@voxgig/sdkgen'
2
+
3
+ const ReadmeExplanation = cmp(function ReadmeExplanation(_props: any) {
4
+ Content(`The SDK is **config-driven**: the API model is embedded as JSON in
5
+ \`SdkConfig.lean\` and parsed into a \`Value\` when a client is constructed. An
6
+ operation looks up its entity and op in that model, selects the matching
7
+ endpoint (a point whose \`select.exist\` keys are satisfied), builds the URL from
8
+ the point's path parts, applies the request transform, performs the call, then
9
+ applies the response transform. Because the pipeline is data-driven rather than
10
+ generated per entity, every entity and every API follow exactly the same path.
11
+
12
+ The HTTP transport shells out to \`curl\` via \`IO.Process\` — Lean 4 has no HTTP
13
+ library in its standard distribution, and this keeps the package free of Lake
14
+ dependencies.
15
+
16
+ `)
17
+ })
18
+
19
+ export { ReadmeExplanation }
@@ -0,0 +1,25 @@
1
+ import { cmp, Content } from '@voxgig/sdkgen'
2
+
3
+ const ReadmeHowto = cmp(function ReadmeHowto(_props: any) {
4
+ Content(`**Handle a missing record.** A \`load\` that finds nothing yields a
5
+ non-map value, so match on it:
6
+
7
+ \`\`\`lean
8
+ match (← Entity.load sdk m (← emptyMap)) with
9
+ | .map _ => IO.println "found"
10
+ | _ => IO.println "not found"
11
+ \`\`\`
12
+
13
+ **Test without a server.** \`Sdk.testSdk0\` takes seed data (the shape of the
14
+ generated \`<Entity>TestData.json\`) and answers operations from an in-memory
15
+ store, so entity behaviour can be exercised offline:
16
+
17
+ \`\`\`lean
18
+ let seed ← SdkJson.jsonRead (← IO.FS.readFile "../.sdk/test/entity/<e>/<E>TestData.json")
19
+ let sdk ← Sdk.testSdk0 seed
20
+ \`\`\`
21
+
22
+ `)
23
+ })
24
+
25
+ export { ReadmeHowto }
@@ -0,0 +1,39 @@
1
+ import { cmp, Content, isPublished, repoInfo } from '@voxgig/sdkgen'
2
+
3
+ const ReadmeInstall = cmp(function ReadmeInstall(props: any) {
4
+ const { target, ctx$ } = props
5
+ const { model } = ctx$
6
+
7
+ if (isPublished(model, target.name)) {
8
+ Content(`\`\`\`bash
9
+ cd ${target.name} && lake build
10
+ \`\`\`
11
+
12
+ `)
13
+ return
14
+ }
15
+
16
+ const { releasesUrl } = repoInfo(model)
17
+ Content(`This package is not yet published to [Reservoir](https://reservoir.lean-lang.org).
18
+ Install it from the GitHub release tag (\`${target.name}/vX.Y.Z\`, see
19
+ [Releases](${releasesUrl})) or from a source checkout. The runtime is
20
+ dependency-free (only the Lean 4 prelude + Std; the HTTP transport shells out
21
+ to \`curl\`), so a plain Lake build is all that is needed:
22
+
23
+ \`\`\`bash
24
+ cd ${target.name} && lake build
25
+ \`\`\`
26
+
27
+ Run the offline struct-corpus test (no server needed) and the live entity
28
+ tests (point them at a server with \`SDK_TEST_BASE\`):
29
+
30
+ \`\`\`bash
31
+ lake exe omnismoke
32
+ lake exe structcorpus
33
+ SDK_TEST_BASE=http://localhost:8901 lake exe runner
34
+ \`\`\`
35
+
36
+ `)
37
+ })
38
+
39
+ export { ReadmeInstall }
@@ -0,0 +1,25 @@
1
+ import { cmp, Content } from '@voxgig/sdkgen'
2
+ import { KIT, getModelPath } from '@voxgig/apidef'
3
+
4
+ const ReadmeIntro = cmp(function ReadmeIntro(props: any) {
5
+ const { target, ctx$: { model } } = props
6
+ const info = (model.main && model.main.kit && model.main.kit.info) || {}
7
+ const tagline = info.tagline || ''
8
+
9
+ Content(`# ${model.Name} ${target.title} SDK
10
+
11
+ ${tagline}
12
+
13
+ The ${target.title} SDK for the ${model.Name} API — an entity-oriented client
14
+ for Lean 4. The API is surfaced as capitalised Entities with a small, uniform
15
+ verb set (\`list\`, \`load\`, \`create\`, \`update\`, \`remove\`); every operation is
16
+ driven by the embedded config through the dependency-free vendored voxgig
17
+ \`Value\` struct model, and runs in struct's \`SIO\` monad.
18
+
19
+ `)
20
+
21
+ // touch the model so a mis-shaped model surfaces here, not at render time.
22
+ getModelPath(model, `main.${KIT}.entity`)
23
+ })
24
+
25
+ export { ReadmeIntro }
@@ -0,0 +1,24 @@
1
+ import { cmp, Content } from '@voxgig/sdkgen'
2
+
3
+ const ReadmeModel = cmp(function ReadmeModel(_props: any) {
4
+ Content(`Every value crossing the SDK boundary — options, request payloads,
5
+ responses and results — is a vendored voxgig \`Value\` (see \`VoxgigStruct.lean\`):
6
+ a JSON-shaped, heap-backed node, the Lean equivalent of the \`map[string]any\`
7
+ the Go and Python SDKs pass around. Operations run in struct's \`SIO\` monad
8
+ (\`ReaderT Ctx IO\`), so a single \`mkCtx\` is threaded through a run:
9
+
10
+ \`\`\`lean
11
+ let ctx ← mkCtx
12
+ (do
13
+ let sdk ← Sdk.newSdk (← emptyMap)
14
+ ...
15
+ ).run ctx
16
+ \`\`\`
17
+
18
+ Build values with \`newMap\` / \`newList\`, read them with \`getprop\` / \`getpath\`,
19
+ and render them with \`stringify\` (debug) or \`jsonify\` (strict JSON).
20
+
21
+ `)
22
+ })
23
+
24
+ export { ReadmeModel }
@@ -0,0 +1,22 @@
1
+ import { cmp, Content } from '@voxgig/sdkgen'
2
+
3
+ const ReadmeOptions = cmp(function ReadmeOptions(_props: any) {
4
+ Content(`Options are a struct \`Value\` map passed to \`Sdk.newSdk\`:
5
+
6
+ | Option | Meaning |
7
+ | --- | --- |
8
+ | \`base\` | API base URL (overrides the built-in default) |
9
+ | \`prefix\` / \`suffix\` | Path fragments wrapped around every request path |
10
+ | \`headers\` | Default request headers (merged with per-request headers) |
11
+ | \`apikey\` | Bearer/api key, sent via the \`authorization\` header |
12
+ | \`entity\` | Per-entity option overrides, keyed by entity name |
13
+
14
+ \`\`\`lean
15
+ let opts ← newMap #[("base", .str "https://api.example.com"), ("apikey", .str key)]
16
+ let sdk ← Sdk.newSdk opts
17
+ \`\`\`
18
+
19
+ `)
20
+ })
21
+
22
+ export { ReadmeOptions }
@@ -0,0 +1,50 @@
1
+ import { cmp, Content, isAuthActive, envName } from '@voxgig/sdkgen'
2
+ import { KIT, getModelPath } from '@voxgig/apidef'
3
+
4
+ // A capitalised entity op namespace + a representative read op for the example.
5
+ function pickEntity(model: any): { ns: string, op: string } | null {
6
+ const entity = getModelPath(model, `main.${KIT}.entity`)
7
+ const ents = Object.values(entity || {}).filter((e: any) => e.active !== false)
8
+ for (const e of ents as any[]) {
9
+ const ops = Object.keys(e.op || {})
10
+ const op = ops.includes('list') ? 'list' : ops[0]
11
+ if (op) {
12
+ return { ns: e.name.charAt(0).toUpperCase() + e.name.slice(1), op }
13
+ }
14
+ }
15
+ return null
16
+ }
17
+
18
+ const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
19
+ const { ctx$: { model } } = props
20
+ const pick = pickEntity(model)
21
+ const ns = pick ? pick.ns : 'Entity'
22
+ const op = pick ? pick.op : 'list'
23
+ const auth = isAuthActive(model)
24
+ const optLines = [`("base", .str "https://api.example.com")`]
25
+ if (auth) {
26
+ optLines.push(`("apikey", .str (← IO.getEnv "${envName(model)}").getD "")`)
27
+ }
28
+
29
+ Content(`Construct a client with \`Sdk.newSdk\` and call an entity op. Everything runs
30
+ in struct's \`SIO\` monad, so wrap your calls and \`.run\` them on a fresh \`mkCtx\`:
31
+
32
+ \`\`\`lean
33
+ import SdkClient
34
+
35
+ open VoxgigStruct
36
+
37
+ def main : IO Unit := do
38
+ let ctx ← mkCtx
39
+ (do
40
+ let opts ← newMap #[${optLines.join(', ')}]
41
+ let sdk ← Sdk.newSdk opts
42
+ let result ← ${ns}.${op} sdk (← emptyMap) (← emptyMap)
43
+ IO.println s!"result: {← stringify result}"
44
+ ).run ctx
45
+ \`\`\`
46
+
47
+ `)
48
+ })
49
+
50
+ export { ReadmeQuick }
@@ -0,0 +1,40 @@
1
+ import { cmp, Content, File, ReadmeRefFeatures } from '@voxgig/sdkgen'
2
+
3
+
4
+ // Lean emitted no REFERENCE.md at all. Every other per-language ReadmeRef
5
+ // opens the File itself; this one only called Content(), so its module table
6
+ // was written into no file and dropped, and lean was the one target shipping
7
+ // no reference. Opening the File fixes that and gives the shared feature
8
+ // reference somewhere to land.
9
+ const ReadmeRef = cmp(function ReadmeRef(props: any) {
10
+ const { target, ctx$ } = props
11
+ const { model } = ctx$
12
+
13
+ File({ name: 'REFERENCE.md' }, () => {
14
+
15
+ Content(`# ${model.Name} ${target.title} SDK Reference
16
+
17
+ Complete API reference for the ${model.Name} ${target.title} SDK.
18
+
19
+
20
+ ## Modules
21
+
22
+ | Module | Purpose |
23
+ | --- | --- |
24
+ | \`SdkClient\` | \`Sdk.newSdk\` / \`Sdk.testSdk\` and the per-entity op namespaces |
25
+ | \`SdkConfig\` | the embedded API model (JSON) |
26
+ | \`SdkRuntime\` | the config-driven operation pipeline and curl transport |
27
+ | \`SdkUtility\` | request-shaping utilities (spec, url, params, transforms, result) |
28
+ | \`SdkJson\` | JSON text to struct \`Value\` |
29
+ | \`VoxgigStruct\` | the vendored voxgig struct value model |
30
+
31
+
32
+ ## Features
33
+
34
+ `)
35
+
36
+ ReadmeRefFeatures({ target })
37
+ })
38
+ })
39
+
40
+ export { ReadmeRef }
@@ -0,0 +1,16 @@
1
+ import { cmp, Content } from '@voxgig/sdkgen'
2
+
3
+ // The Lean stanza of the top-level README how-to section.
4
+ const ReadmeTopHowto = cmp(function ReadmeTopHowto(props: any) {
5
+ const { target } = props
6
+ Content(`For Lean, point the client at another server with the \`base\` option,
7
+ and run the entity suite against it with \`SDK_TEST_BASE\`:
8
+
9
+ \`\`\`bash
10
+ cd ${target.name} && SDK_TEST_BASE=http://localhost:8901 lake exe runner
11
+ \`\`\`
12
+
13
+ `)
14
+ })
15
+
16
+ export { ReadmeTopHowto }
@@ -0,0 +1,23 @@
1
+ import { cmp, Content } from '@voxgig/sdkgen'
2
+
3
+ // The Lean stanza of the top-level (multi-language) README quick start.
4
+ const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
5
+ const { target } = props
6
+ Content(`\`\`\`lean
7
+ import SdkClient
8
+ open VoxgigStruct
9
+
10
+ def main : IO Unit := do
11
+ let ctx ← mkCtx
12
+ (do
13
+ let sdk ← Sdk.newSdk (← emptyMap)
14
+ IO.println s!"client ready"
15
+ ).run ctx
16
+ \`\`\`
17
+
18
+ Build it with \`cd ${target.name} && lake build\`.
19
+
20
+ `)
21
+ })
22
+
23
+ export { ReadmeTopQuick }
@@ -0,0 +1,19 @@
1
+ import { cmp, Content } from '@voxgig/sdkgen'
2
+
3
+ // The Lean stanza of the top-level README test section.
4
+ const ReadmeTopTest = cmp(function ReadmeTopTest(props: any) {
5
+ const { target } = props
6
+ Content(`\`\`\`bash
7
+ cd ${target.name}
8
+ lake build
9
+ lake exe omnismoke # the vendored @voxgig/omni corpus engine itself
10
+ lake exe primary # shared corpus: request-shaping utilities
11
+ lake exe feature # the feature catalog (retry, cache, rbac, netsim, …)
12
+ lake exe structcorpus # shared corpus: the vendored struct model
13
+ lake exe runner # entity behaviour (offline; add SDK_TEST_BASE for live)
14
+ \`\`\`
15
+
16
+ `)
17
+ })
18
+
19
+ export { ReadmeTopTest }