@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,368 @@
1
+ /- Struct corpus: drives the `struct` subtree of the shared
2
+ ../.sdk/test/test.json — the project's own compiled corpus, the same file
3
+ every other target reads — through the vendored voxgig/struct port, on the
4
+ vendored @voxgig/omni engine.
5
+
6
+ The ENGINE is no longer in this file. It used to be: an in-tree JSON
7
+ reader, `fixJson`, `eqv`, `matchval`, `doMatch`, `resolveArgs`,
8
+ `checkResult`, `handleError` and `runSet` — this port's own copy of omni's
9
+ algorithm, drifting from it by construction. All of it is gone; every
10
+ group below is handed to omni through OmniResolver. What remains is what
11
+ actually belongs to this SDK: WHICH corpus group drives WHICH struct
12
+ function, and with which flags.
13
+
14
+ The file keeps its name (and the `structcorpus` executable keeps its
15
+ root), so no call site — Makefile, lakefile, CI — needed churn.
16
+
17
+ Flags mirror canonical: typescript/test/utility/StructUtility.test.ts. -/
18
+
19
+ import VoxgigStruct
20
+ import Omni
21
+ import OmniResolver
22
+
23
+ open VoxgigStruct
24
+ open OmniResolver
25
+
26
+ -- ---------------- subjects that need more than one expression ----------
27
+
28
+ def nullModifier : ModifyFn := fun v key parent _inj => do
29
+ if v == .str nullmark then
30
+ let _ ← setprop parent key .null
31
+ else match v with
32
+ | .str s =>
33
+ let _ ← setprop parent key (.str (s.replace nullmark "null"))
34
+ | _ => pure ()
35
+
36
+ /-- walk/log is authored as one {in, out} pair whose `out.after` is the log of
37
+ an after-walk. The subject builds that log and returns it; the resolver's
38
+ `single (out := ["after"])` selects the half the corpus asserts on. -/
39
+ def walkLogSubject (vin : Value) : SIO Value := do
40
+ let log ← emptyList
41
+ let walklog : WalkFn := fun key v parent path => do
42
+ let ks ← if isNullish key then stringify .noval else stringify key
43
+ let vs ← stringify v
44
+ let ps ← if isNullish parent then stringify .noval else stringify parent
45
+ let ts ← pathify path
46
+ let n ← size log
47
+ let _ ← setprop log (vInt n)
48
+ (.str ("k=" ++ ks ++ ", v=" ++ vs ++ ", p=" ++ ps ++ ", t=" ++ ts))
49
+ pure v
50
+ let _ ← walk vin (after := some walklog)
51
+ pure log
52
+
53
+ def walkCopySubject (vin : Value) : SIO Value := do
54
+ let cur ← IO.mkRef (← newList #[.noval])
55
+ let walkcopy : WalkFn := fun key v _parent path => do
56
+ if isNullish key then do
57
+ let seed ← if ismap v then emptyMap else if islist v then emptyList else pure v
58
+ cur.set (← newList #[seed])
59
+ pure v
60
+ else do
61
+ let i ← size path
62
+ let iN := i.toNat
63
+ let nv ← if isnode v then do
64
+ match (← cur.get) with
65
+ | .list r => do
66
+ let mut xs ← listItems r
67
+ while xs.size <= iN do
68
+ xs := xs.push .noval
69
+ let n ← if ismap v then emptyMap else emptyList
70
+ xs := xs.set! iN n
71
+ setListItems r xs
72
+ pure n
73
+ | _ => pure v
74
+ else pure v
75
+ let tgt ← getelem (← cur.get) (vInt (i - 1))
76
+ let _ ← setprop tgt key nv
77
+ pure v
78
+ let _ ← walk vin (before := some walkcopy)
79
+ getelem (← cur.get) (.num 0.0)
80
+
81
+ def walkDepthSubject (vin : Value) : SIO Value := do
82
+ let top ← IO.mkRef Value.noval
83
+ let curr ← IO.mkRef Value.noval
84
+ let copy : WalkFn := fun key v _parent _path => do
85
+ if isNullish key || isnode v then do
86
+ let child ← if islist v then emptyList else emptyMap
87
+ if isNullish key then do
88
+ top.set child
89
+ curr.set child
90
+ else do
91
+ let _ ← setprop (← curr.get) key child
92
+ curr.set child
93
+ else
94
+ let _ ← setprop (← curr.get) key v
95
+ pure v
96
+ let _ ← walk (← getp vin "src") (before := some copy) (maxdepth := ← getp vin "maxdepth")
97
+ top.get
98
+
99
+ -- ---------------- test groups ------------------------------------------
100
+
101
+ def runAll (r : Run) : SIO Unit := do
102
+
103
+ -- minor
104
+ runset r "minor.isnode" (getset r ["minor", "isnode"])
105
+ (fun v => pure (.bool (isnode v)))
106
+ runset r "minor.ismap" (getset r ["minor", "ismap"])
107
+ (fun v => pure (.bool (ismap v)))
108
+ runset r "minor.islist" (getset r ["minor", "islist"])
109
+ (fun v => pure (.bool (islist v)))
110
+ runset r "minor.iskey" (getset r ["minor", "iskey"])
111
+ (fun v => pure (.bool (iskey v))) (nullflag := false)
112
+ runset r "minor.strkey" (getset r ["minor", "strkey"])
113
+ (fun v => pure (.str (strkey v))) (nullflag := false)
114
+ runset r "minor.isempty" (getset r ["minor", "isempty"])
115
+ (fun v => do pure (.bool (← isempty v))) (nullflag := false)
116
+ runset r "minor.isfunc" (getset r ["minor", "isfunc"])
117
+ (fun v => pure (.bool (isfunc v)))
118
+ runset r "minor.clone" (getset r ["minor", "clone"]) clone (nullflag := false)
119
+ runset r "minor.escre" (getset r ["minor", "escre"]) escre
120
+ runset r "minor.escurl" (getset r ["minor", "escurl"]) escurl
121
+ runset r "minor.stringify" (getset r ["minor", "stringify"])
122
+ (fun vin => do
123
+ if ← hasp vin "val" then
124
+ pure (.str (← stringify (← getp vin "val") (maxlen := ← getp vin "max")))
125
+ else
126
+ pure (.str (← stringify .noval)))
127
+ (nullflag := false)
128
+ runset r "minor.jsonify" (getset r ["minor", "jsonify"])
129
+ (fun vin => do
130
+ pure (.str (← jsonify (← getp vin "val") (flags := ← getp vin "flags"))))
131
+ (nullflag := false)
132
+ -- `alt` is read by NULLISHNESS here and by PRESENCE for getprop below.
133
+ -- That is canonical's own split: it omits getprop's alt only when the KEY
134
+ -- is missing (`undefined === vin.alt`), so a present `alt: null` still
135
+ -- goes through, while getelem's rule is the looser `null == vin.alt`.
136
+ -- `minor/getprop#50` and `#51` are the entries that separate them — and
137
+ -- the retired hand-written engine hid the difference, because its `eqv`
138
+ -- matched a no-value against a null. The vendored engine does not.
139
+ runset r "minor.getelem" (getset r ["minor", "getelem"])
140
+ (fun vin => do
141
+ let alt ← getp vin "alt"
142
+ if isNullish alt then getelem (← getp vin "val") (← getp vin "key")
143
+ else getelem (← getp vin "val") (← getp vin "key") alt)
144
+ (nullflag := false)
145
+ runset r "minor.delprop" (getset r ["minor", "delprop"])
146
+ (fun vin => do delprop (← getp vin "parent") (← getp vin "key"))
147
+ runset r "minor.size" (getset r ["minor", "size"])
148
+ (fun v => do pure (vInt (← size v))) (nullflag := false)
149
+ runset r "minor.slice" (getset r ["minor", "slice"])
150
+ (fun vin => do
151
+ slice (← getp vin "val") (start := ← getp vin "start") (stop := ← getp vin "end"))
152
+ (nullflag := false)
153
+ runset r "minor.pad" (getset r ["minor", "pad"])
154
+ (fun vin => do
155
+ pure (.str (← pad (← getp vin "val") (padding := ← getp vin "pad")
156
+ (padchar := ← getp vin "char"))))
157
+ (nullflag := false)
158
+ runset r "minor.pathify" (getset r ["minor", "pathify"])
159
+ (fun vin => do
160
+ if ← hasp vin "path" then
161
+ pure (.str (← pathify (← getp vin "path") (startin := ← getp vin "from")))
162
+ else
163
+ pure (.str (← pathify .noval (startin := ← getp vin "from") (absent := true))))
164
+ (nullflag := false)
165
+ runset r "minor.items" (getset r ["minor", "items"]) items
166
+ runset r "minor.getprop" (getset r ["minor", "getprop"])
167
+ (fun vin => do
168
+ if ← hasp vin "alt" then
169
+ getprop (← getp vin "val") (← getp vin "key") (← getp vin "alt")
170
+ else getprop (← getp vin "val") (← getp vin "key"))
171
+ (nullflag := false)
172
+ runset r "minor.setprop" (getset r ["minor", "setprop"])
173
+ (fun vin => do
174
+ setprop (← getp vin "parent") (← getp vin "key") (← getp vin "val"))
175
+ runset r "minor.haskey" (getset r ["minor", "haskey"])
176
+ (fun vin => do
177
+ pure (.bool (← haskey (← getp vin "src") (← getp vin "key"))))
178
+ (nullflag := false)
179
+ runset r "minor.keysof" (getset r ["minor", "keysof"])
180
+ (fun v => do newList ((← keysof v).map (fun s => Value.str s)))
181
+ runset r "minor.join" (getset r ["minor", "join"])
182
+ (fun vin => do
183
+ let url := (← getp vin "url") == .bool true
184
+ pure (.str (← join (← getp vin "val") (sep := ← getp vin "sep") (url := url))))
185
+ (nullflag := false)
186
+ runset r "minor.typify" (getset r ["minor", "typify"])
187
+ (fun v => pure (vInt (typify v))) (nullflag := false)
188
+ runset r "minor.setpath" (getset r ["minor", "setpath"])
189
+ (fun vin => do
190
+ setpath (← getp vin "store") (← getp vin "path") (← getp vin "val"))
191
+ (nullflag := false)
192
+ runset r "minor.filter" (getset r ["minor", "filter"])
193
+ (fun vin => do
194
+ let checkV ← getp vin "check"
195
+ let check : (String × Value) → Bool :=
196
+ if checkV == .str "gt3" then
197
+ fun (_, x) => match x with | .num n => n > 3.0 | _ => false
198
+ else if checkV == .str "lt3" then
199
+ fun (_, x) => match x with | .num n => n < 3.0 | _ => false
200
+ else fun _ => false
201
+ filter (← getp vin "val") check)
202
+ runset r "minor.typename" (getset r ["minor", "typename"])
203
+ (fun v => do
204
+ let t : Int := match v with
205
+ | .num n => fToInt n
206
+ | _ => 0
207
+ pure (.str (typename t)))
208
+ runset r "minor.flatten" (getset r ["minor", "flatten"])
209
+ (fun vin => do
210
+ match (← getp vin "depth") with
211
+ | .num n => flatten (← getp vin "val") (depth := fToInt n)
212
+ | _ => flatten (← getp vin "val"))
213
+
214
+ -- walk
215
+ runset r "walk.log" (single (getset r ["walk", "log"]) (out := ["after"]))
216
+ walkLogSubject
217
+ runset r "walk.basic" (getset r ["walk", "basic"])
218
+ (fun vin => do
219
+ walk vin (after := some (fun _k v _p path => do
220
+ match v with
221
+ | .str s => do
222
+ let mut parts : List String := []
223
+ for x in (← listItemsOf path) do
224
+ parts := (← jsString x) :: parts
225
+ pure (.str (s ++ "~" ++ String.intercalate "." parts.reverse))
226
+ | _ => pure v)))
227
+ runset r "walk.copy" (getset r ["walk", "copy"]) walkCopySubject
228
+ runset r "walk.depth" (getset r ["walk", "depth"]) walkDepthSubject
229
+ (nullflag := false)
230
+
231
+ -- merge
232
+ runset r "merge.basic" (single (getset r ["merge", "basic"]))
233
+ (fun vin => do merge (← clone vin))
234
+ runset r "merge.cases" (getset r ["merge", "cases"]) (fun v => merge v)
235
+ runset r "merge.array" (getset r ["merge", "array"]) (fun v => merge v)
236
+ runset r "merge.integrity" (getset r ["merge", "integrity"]) (fun v => merge v)
237
+ runset r "merge.depth" (getset r ["merge", "depth"])
238
+ (fun vin => do merge (← getp vin "val") (maxdepth := ← getp vin "depth"))
239
+
240
+ -- getpath
241
+ runset r "getpath.basic" (getset r ["getpath", "basic"])
242
+ (fun vin => do getpath (← getp vin "store") (← getp vin "path"))
243
+ runset r "getpath.relative" (getset r ["getpath", "relative"])
244
+ (fun vin => do
245
+ let dpath ← match (← getp vin "dpath") with
246
+ | .str s => newList ((s.splitOn ".").map (fun x => Value.str x)).toArray
247
+ | _ => pure Value.noval
248
+ let d : InjDef := { dDparent := ← getp vin "dparent", dDpath := dpath }
249
+ getpath (← getp vin "store") (← getp vin "path") (.idef d))
250
+ runset r "getpath.special" (getset r ["getpath", "special"])
251
+ (fun vin => do
252
+ let injm ← getp vin "inj"
253
+ let d : InjDef := {
254
+ dBase := ← getprop injm (.str "base"), dMeta := ← getprop injm (.str "meta"),
255
+ dDparent := ← getprop injm (.str "dparent"), dDpath := ← getprop injm (.str "dpath"),
256
+ dKey := ← getprop injm (.str "key") }
257
+ getpath (← getp vin "store") (← getp vin "path")
258
+ (if isNullish injm then .inone else .idef d))
259
+ runset r "getpath.handler" (getset r ["getpath", "handler"])
260
+ (fun vin => do
261
+ let foo ← vFunc (fun _ _ _ _ => pure (.str "foo"))
262
+ let store ← omapV [("$TOP", ← getp vin "store"), ("$FOO", foo)]
263
+ let h ← registerFunc (fun _inj v _ref _store => do
264
+ match v with
265
+ | .func fid => callFunc fid (← getDummyInj) .noval "" .noval
266
+ | _ => pure v)
267
+ let d : InjDef := { dHandler := some h }
268
+ getpath store (← getp vin "path") (.idef d))
269
+
270
+ -- inject
271
+ runset r "inject.basic" (single (getset r ["inject", "basic"]))
272
+ (fun vin => do
273
+ inject (← clone (← getp vin "val")) (← clone (← getp vin "store")))
274
+ runset r "inject.string" (getset r ["inject", "string"])
275
+ (fun vin => do
276
+ let mid ← registerModify nullModifier
277
+ let d : InjDef := { dModify := some mid, dExtra := ← getp vin "current" }
278
+ inject (← getp vin "val") (← getp vin "store") (.idef d))
279
+ runset r "inject.deep" (getset r ["inject", "deep"])
280
+ (fun vin => do inject (← getp vin "val") (← getp vin "store"))
281
+
282
+ -- transform
283
+ runset r "transform.basic" (single (getset r ["transform", "basic"]))
284
+ (fun vin => do transform (← getp vin "data") (← getp vin "spec"))
285
+ for gn in ["paths", "cmds", "each", "pack", "ref"] do
286
+ runset r ("transform." ++ gn) (getset r ["transform", gn])
287
+ (fun vin => do transform (← getp vin "data") (← getp vin "spec"))
288
+ runset r "transform.modify" (getset r ["transform", "modify"])
289
+ (fun vin => do
290
+ let mid ← registerModify (fun v key parent _inj => do
291
+ match v with
292
+ | .str s =>
293
+ if !(isNullish key) && !(isNullish parent) then
294
+ let _ ← setprop parent key (.str ("@" ++ s))
295
+ | _ => pure ())
296
+ let d : InjDef := { dModify := some mid, dExtra := ← getp vin "store" }
297
+ transform (← getp vin "data") (← getp vin "spec") (.idef d))
298
+ runset r "transform.format" (getset r ["transform", "format"])
299
+ (fun vin => do transform (← getp vin "data") (← getp vin "spec"))
300
+ (nullflag := false)
301
+ runset r "transform.apply" (getset r ["transform", "apply"])
302
+ (fun vin => do transform (← getp vin "data") (← getp vin "spec"))
303
+
304
+ -- validate
305
+ runset r "validate.basic" (getset r ["validate", "basic"])
306
+ (fun vin => do validate (← getp vin "data") (← getp vin "spec"))
307
+ (nullflag := false)
308
+ for gn in ["child", "one", "exact"] do
309
+ runset r ("validate." ++ gn) (getset r ["validate", gn])
310
+ (fun vin => do validate (← getp vin "data") (← getp vin "spec"))
311
+ runset r "validate.invalid" (getset r ["validate", "invalid"])
312
+ (fun vin => do validate (← getp vin "data") (← getp vin "spec"))
313
+ (nullflag := false)
314
+ runset r "validate.special" (getset r ["validate", "special"])
315
+ (fun vin => do
316
+ let injm ← getp vin "inj"
317
+ let d : InjDef := { dMeta := ← getprop injm (.str "meta") }
318
+ validate (← getp vin "data") (← getp vin "spec")
319
+ (if isNullish injm then .inone else .idef d))
320
+
321
+ -- select
322
+ for gn in ["basic", "operators", "edge", "alts"] do
323
+ runset r ("select." ++ gn) (getset r ["select", gn])
324
+ (fun vin => do select (← getp vin "obj") (← getp vin "query"))
325
+
326
+ -- nullsem: does a PRESENT key holding a JSON null read as "no value"?
327
+ -- Every group runs {null: false} — the whole point of the section is the
328
+ -- distinction the null flag would erase.
329
+ --
330
+ -- This section used to be looked up as `sentinels`, under six group names
331
+ -- (`getprop_unify`, `getelem_absent`, `haskey_unify`, `isempty_unify`,
332
+ -- `isnode_unify`, `stringify_null`) the shipped corpus has never carried —
333
+ -- alongside a `regex` section it has never carried either. All eleven
334
+ -- groups therefore ran ZERO cases, silently. The vendored engine names a
335
+ -- missing group out loud (`SKIP`), which is how that was found; the
336
+ -- regex groups are gone because this port's `reTest`/`reFind`/... have no
337
+ -- corpus to answer, and nullsem is driven under the name it actually has.
338
+ runset r "nullsem.getprop" (getset r ["nullsem", "getprop"])
339
+ (fun vin => do
340
+ if ← hasp vin "alt" then
341
+ getprop (← getp vin "val") (← getp vin "key") (← getp vin "alt")
342
+ else getprop (← getp vin "val") (← getp vin "key"))
343
+ (nullflag := false)
344
+ runset r "nullsem.getelem" (getset r ["nullsem", "getelem"])
345
+ (fun vin => do
346
+ if ← hasp vin "alt" then
347
+ getelem (← getp vin "val") (← getp vin "key") (← getp vin "alt")
348
+ else getelem (← getp vin "val") (← getp vin "key"))
349
+ (nullflag := false)
350
+ runset r "nullsem.getpath" (getset r ["nullsem", "getpath"])
351
+ (fun vin => do getpath (← getp vin "store") (← getp vin "path"))
352
+ (nullflag := false)
353
+ runset r "nullsem.haskey" (getset r ["nullsem", "haskey"])
354
+ (fun vin => do
355
+ pure (.bool (← haskey (← getp vin "src") (← getp vin "key"))))
356
+ (nullflag := false)
357
+ runset r "nullsem.keysof" (getset r ["nullsem", "keysof"])
358
+ (fun v => do newList ((← keysof v).map (fun s => Value.str s)))
359
+ (nullflag := false)
360
+
361
+ -- ---------------- main --------------------------------------------------
362
+
363
+ def main (argv : List String) : IO UInt32 := do
364
+ let testfile ← resolveSpecPath argv
365
+ let r ← makeRun testfile "struct"
366
+ let sctx ← mkCtx
367
+ (runAll r).run sctx
368
+ report r "STRUCT CORPUS: "
@@ -0,0 +1,281 @@
1
+ /- ProjectName SDK feature test.
2
+
3
+ Verifies the feature catalog's OBSERVABLE behaviour. Each feature records
4
+ into the client's `track` bucket under its own name, so a test activates a
5
+ feature, runs an operation against the offline (test-mode) transport, and
6
+ asserts the bucket. Features that wrap the transport are additionally
7
+ checked for the effect they have on the request or the result. -/
8
+
9
+ import VoxgigStruct
10
+ import SdkJson
11
+ import SdkUtility
12
+ import SdkFeature
13
+ import SdkFeatures
14
+ import SdkClient
15
+
16
+ open VoxgigStruct
17
+
18
+ initialize npass : IO.Ref Nat ← IO.mkRef 0
19
+ initialize nfail : IO.Ref Nat ← IO.mkRef 0
20
+
21
+ def pass (msg : String) : SIO Unit := do
22
+ npass.modify (· + 1)
23
+ IO.println s!"ok - {msg}"
24
+
25
+ def fail (msg : String) : SIO Unit := do
26
+ nfail.modify (· + 1)
27
+ IO.println s!"FAIL - {msg}"
28
+
29
+ def check (cond : Bool) (msg : String) : SIO Unit := do
30
+ if cond then pass msg else fail msg
31
+
32
+ def gp := SdkUtility.gp
33
+ def gpS := SdkUtility.gpS
34
+
35
+ def numAt (v : Value) (k : String) : SIO Float := do
36
+ match (← gp v k) with
37
+ | .num n => pure n
38
+ | _ => pure 0.0
39
+
40
+ /-- A test-mode client with the named features activated. -/
41
+ def clientWith (seed : Value) (feats : Array (String × Value)) : SIO Value := do
42
+ let fmap ← emptyMap
43
+ for (n, o) in feats do
44
+ SdkUtility.sp fmap n o
45
+ let opts ← emptyMap
46
+ SdkUtility.sp opts "feature" fmap
47
+ Sdk.testSdk seed opts
48
+
49
+ def onOpts (extra : Array (String × Value)) : SIO Value := do
50
+ let o ← newMap #[("active", .bool true)]
51
+ for (k, v) in extra do
52
+ SdkUtility.sp o k v
53
+ pure o
54
+
55
+ /-- The bucket a feature records into. -/
56
+ def bucketOf (client : Value) (name : String) : SIO Value := do
57
+ gp (← gp client "track") name
58
+
59
+ /-- Does the entity declare this op? -/
60
+ def hasOp (e : Value) (opname : String) : SIO Bool := do
61
+ match (← gp (← gp e "op") opname) with
62
+ | .map _ => pure true
63
+ | _ => pure false
64
+
65
+ /-- The first entity that has a `list` op AND generated seed data: the feature
66
+ suite is entity-agnostic, so it discovers its subject from the config.
67
+ Returns whether the subject also has `create` — the idempotency check is
68
+ the one case that mutates, and a list-only entity (an API with a read-only
69
+ collection) has no create ENDPOINT, so calling it raises rather than
70
+ exercising the feature. Entities carrying both are preferred, so a model
71
+ that has one keeps the mutating coverage. -/
72
+ def findSubject : SIO (Option (String × Value × Bool)) := do
73
+ let config ← SdkJson.jsonRead SdkConfig.configJson
74
+ let ents ← gp config "entity"
75
+ let mut fallback : Option (String × Value × Bool) := none
76
+ for name in (← keysof ents) do
77
+ let e ← gp ents name
78
+ if ← hasOp e "list" then
79
+ let Name := name.capitalize
80
+ let seedPath := "../.sdk/test/entity/" ++ name ++ "/" ++ Name ++ "TestData.json"
81
+ if ← System.FilePath.pathExists seedPath then
82
+ let seed ← SdkJson.jsonRead (← IO.FS.readFile seedPath)
83
+ if ← hasOp e "create" then
84
+ return some (name, seed, true)
85
+ if fallback.isNone then
86
+ fallback := some (name, seed, false)
87
+ pure fallback
88
+
89
+ def main : IO UInt32 := do
90
+ let sctx ← mkCtx
91
+ let go : SIO Unit := do
92
+ match (← findSubject) with
93
+ | none => IO.println "skip - no entity with list op and seed data"
94
+ | some (ent, seed, hasCreate) => do
95
+ let mt ← emptyMap
96
+
97
+ -- log: counts requests
98
+ (do
99
+ let c ← clientWith seed #[("log", ← onOpts #[])]
100
+ let _ ← SdkRuntime.opList c ent mt mt
101
+ let b ← bucketOf c "log"
102
+ check ((← numAt b "calls") == 1.0) "log: counts one request")
103
+
104
+ -- metrics: totals and a per-op bucket
105
+ (do
106
+ let c ← clientWith seed #[("metrics", ← onOpts #[])]
107
+ let _ ← SdkRuntime.opList c ent mt mt
108
+ let _ ← SdkRuntime.opList c ent mt mt
109
+ let b ← bucketOf c "metrics"
110
+ let total ← gp b "total"
111
+ check ((← numAt total "count") == 2.0) "metrics: counts two operations"
112
+ check ((← numAt total "ok") == 2.0) "metrics: both recorded ok"
113
+ let ops ← gp b "ops"
114
+ check ((← keysof ops).size >= 1) "metrics: per-op bucket created")
115
+
116
+ -- telemetry: one span per operation, closed out
117
+ (do
118
+ let c ← clientWith seed #[("telemetry", ← onOpts #[])]
119
+ let _ ← SdkRuntime.opList c ent mt mt
120
+ let b ← bucketOf c "telemetry"
121
+ let spans ← gp b "spans"
122
+ let n ← (match spans with | .list i => do pure (← listItems i).size | _ => pure 0)
123
+ check (n == 1) "telemetry: records one span"
124
+ check ((← numAt b "active") == 0.0) "telemetry: span closed (active back to 0)")
125
+
126
+ -- audit: one record per operation
127
+ (do
128
+ let c ← clientWith seed #[("audit", ← onOpts #[])]
129
+ let _ ← SdkRuntime.opList c ent mt mt
130
+ let b ← bucketOf c "audit"
131
+ let recs ← gp b "records"
132
+ let n ← (match recs with | .list i => do pure (← listItems i).size | _ => pure 0)
133
+ check (n == 1) "audit: records one operation")
134
+
135
+ -- debug: an entry, with sensitive headers redacted
136
+ (do
137
+ let c ← clientWith seed #[("debug", ← onOpts #[])]
138
+ let _ ← SdkRuntime.opList c ent mt mt
139
+ let b ← bucketOf c "debug"
140
+ let entries ← gp b "entries"
141
+ match entries with
142
+ | .list i => do
143
+ let its ← listItems i
144
+ check (its.size == 1) "debug: records one entry"
145
+ if its.size > 0 then do
146
+ let e := its[0]!
147
+ check ((← gpS e "op") != "") "debug: entry names the operation"
148
+ | _ => fail "debug: no entries list")
149
+
150
+ -- idempotency: injects a key header on mutating ops only
151
+ (do
152
+ let c ← clientWith seed #[("idempotency", ← onOpts #[])]
153
+ let _ ← SdkRuntime.opList c ent mt mt
154
+ let b0 ← bucketOf c "idempotency"
155
+ check ((← numAt b0 "issued") == 0.0) "idempotency: no key for a read op"
156
+ if hasCreate then
157
+ let d ← newMap #[("name", .str "idem")]
158
+ let _ ← SdkRuntime.opCreate c ent d mt
159
+ let b ← bucketOf c "idempotency"
160
+ check ((← numAt b "issued") == 1.0) "idempotency: issues a key for create"
161
+ check ((← gpS b "last") != "") "idempotency: records the issued key")
162
+
163
+ -- clienttrack: request/session headers and a request count
164
+ (do
165
+ let c ← clientWith seed #[("clienttrack", ← onOpts #[])]
166
+ let _ ← SdkRuntime.opList c ent mt mt
167
+ let b ← bucketOf c "clienttrack"
168
+ check ((← numAt b "requests") == 1.0) "clienttrack: counts the request"
169
+ check ((← gpS b "session") != "") "clienttrack: assigns a session id"
170
+ check ((← gpS b "lastRequestId") != "") "clienttrack: assigns a request id")
171
+
172
+ -- rbac: denies when the required permission is absent, allows when granted
173
+ (do
174
+ let rules ← newMap #[("list", .str "read")]
175
+ let c ← clientWith seed #[("rbac", ← onOpts #[("rules", rules)])]
176
+ let denied ← (try
177
+ let _ ← SdkRuntime.opList c ent mt mt
178
+ pure false
179
+ catch _ => pure true)
180
+ check denied "rbac: denies an operation without the permission"
181
+ let b ← bucketOf c "rbac"
182
+ check ((← numAt b "denied") == 1.0) "rbac: records the denial")
183
+ (do
184
+ let rules ← newMap #[("list", .str "read")]
185
+ let perms ← newList #[.str "read"]
186
+ let c ← clientWith seed #[("rbac", ← onOpts #[("rules", rules), ("perms", perms)])]
187
+ let _ ← SdkRuntime.opList c ent mt mt
188
+ let b ← bucketOf c "rbac"
189
+ check ((← numAt b "allowed") == 1.0) "rbac: allows when the permission is granted")
190
+
191
+ -- cache: second identical read is served from the cache
192
+ (do
193
+ let c ← clientWith seed #[("cache", ← onOpts #[])]
194
+ let _ ← SdkRuntime.opList c ent mt mt
195
+ let _ ← SdkRuntime.opList c ent mt mt
196
+ let b ← bucketOf c "cache"
197
+ check ((← numAt b "miss") == 1.0) "cache: first read is a miss"
198
+ check ((← numAt b "hit") == 1.0) "cache: second read is a hit")
199
+
200
+ -- ratelimit: a tight burst throttles
201
+ (do
202
+ let c ← clientWith seed #[("ratelimit", ← onOpts #[("rate", .num 1.0), ("burst", .num 1.0)])]
203
+ let _ ← SdkRuntime.opList c ent mt mt
204
+ let _ ← SdkRuntime.opList c ent mt mt
205
+ let b ← bucketOf c "ratelimit"
206
+ check ((← numAt b "throttled") >= 1.0) "ratelimit: throttles the second call")
207
+
208
+ -- netsim: offline simulation fails the request
209
+ (do
210
+ let c ← clientWith seed #[("netsim", ← onOpts #[("offline", .bool true)])]
211
+ let failed ← (try
212
+ let _ ← SdkRuntime.opList c ent mt mt
213
+ pure false
214
+ catch _ => pure true)
215
+ check failed "netsim: offline simulation fails the request"
216
+ let b ← bucketOf c "netsim"
217
+ check ((← numAt b "calls") == 1.0) "netsim: records the simulated call")
218
+
219
+ -- netsim: failStatus is surfaced as the response status
220
+ (do
221
+ let c ← clientWith seed #[("netsim", ← onOpts #[("failStatus", .num 503.0)])]
222
+ let _ ← (try
223
+ let _ ← SdkRuntime.opList c ent mt mt
224
+ pure ()
225
+ catch _ => pure ())
226
+ let b ← bucketOf c "netsim"
227
+ check ((← numAt b "calls") == 1.0) "netsim: failStatus simulation runs")
228
+
229
+ -- proxy: annotates the transport and records the route
230
+ (do
231
+ let c ← clientWith seed #[("proxy", ← onOpts #[("url", .str "http://proxy.local:8080")])]
232
+ let _ ← SdkRuntime.opList c ent mt mt
233
+ let b ← bucketOf c "proxy"
234
+ check ((← numAt b "routed") == 1.0) "proxy: routes the request"
235
+ check ((← gpS b "url") == "http://proxy.local:8080") "proxy: records the proxy url")
236
+
237
+ -- timeout: a generous budget does not trip
238
+ (do
239
+ let c ← clientWith seed #[("timeout", ← onOpts #[("ms", .num 30000.0)])]
240
+ let _ ← SdkRuntime.opList c ent mt mt
241
+ pass "timeout: request within budget succeeds")
242
+
243
+ -- retry: a healthy transport is not retried
244
+ (do
245
+ let c ← clientWith seed #[("retry", ← onOpts #[])]
246
+ let _ ← SdkRuntime.opList c ent mt mt
247
+ let b ← bucketOf c "retry"
248
+ check ((← numAt b "attempts") == 0.0) "retry: no retry on a healthy response")
249
+
250
+ -- paging: annotates the query and counts items
251
+ (do
252
+ let c ← clientWith seed #[("paging", ← onOpts #[("size", .num 2.0)])]
253
+ let _ ← SdkRuntime.opList c ent mt mt
254
+ let b ← bucketOf c "paging"
255
+ check ((← numAt b "pages") == 1.0) "paging: counts the page"
256
+ check ((← numAt b "items") >= 1.0) "paging: counts the returned items")
257
+
258
+ -- streaming: reports the emitted items
259
+ (do
260
+ let c ← clientWith seed #[("streaming", ← onOpts #[])]
261
+ let _ ← SdkRuntime.opList c ent mt mt
262
+ let b ← bucketOf c "streaming"
263
+ check ((← numAt b "emitted") >= 1.0) "streaming: emits the list items"
264
+ check ((← numAt b "chunks") == 1.0) "streaming: reports one chunk")
265
+
266
+ -- an inactive feature records nothing
267
+ (do
268
+ let off ← newMap #[("active", .bool false)]
269
+ let c ← clientWith seed #[("log", off)]
270
+ let _ ← SdkRuntime.opList c ent mt mt
271
+ let b ← bucketOf c "log"
272
+ match b with
273
+ | .map _ => fail "inactive feature must not record"
274
+ | _ => pass "inactive feature records nothing")
275
+
276
+ go.run sctx
277
+ let p ← npass.get
278
+ let f ← nfail.get
279
+ IO.println ""
280
+ IO.println s!"feature: PASS {p} FAIL {f}"
281
+ if f > 0 then return 1 else return 0