@voxgig/sdkgen 4.8.2 → 4.9.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 (407) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/dist/action/doctor.d.ts +1 -0
  3. package/dist/action/doctor.js +50 -2
  4. package/dist/action/doctor.js.map +1 -1
  5. package/dist/helpers/naming.js +4 -2
  6. package/dist/helpers/naming.js.map +1 -1
  7. package/dist/tsconfig.tsbuildinfo +1 -1
  8. package/model/sdkgen.aon +21 -0
  9. package/package.json +1 -1
  10. package/project/.sdk/model/feature/secrets.aon +120 -18
  11. package/project/.sdk/model/target/c.aon +10 -0
  12. package/project/.sdk/model/target/clojure.aon +13 -0
  13. package/project/.sdk/model/target/cpp.aon +10 -0
  14. package/project/.sdk/model/target/csharp.aon +9 -0
  15. package/project/.sdk/model/target/dart.aon +10 -0
  16. package/project/.sdk/model/target/elixir.aon +9 -0
  17. package/project/.sdk/model/target/go.aon +13 -0
  18. package/project/.sdk/model/target/java.aon +9 -0
  19. package/project/.sdk/model/target/js.aon +7 -0
  20. package/project/.sdk/model/target/kotlin.aon +9 -0
  21. package/project/.sdk/model/target/lean.aon +17 -0
  22. package/project/.sdk/model/target/lua.aon +8 -0
  23. package/project/.sdk/model/target/ocaml.aon +9 -0
  24. package/project/.sdk/model/target/perl.aon +8 -0
  25. package/project/.sdk/model/target/php.aon +8 -0
  26. package/project/.sdk/model/target/py.aon +13 -0
  27. package/project/.sdk/model/target/rb.aon +8 -0
  28. package/project/.sdk/model/target/rust.aon +10 -0
  29. package/project/.sdk/model/target/scala.aon +21 -2
  30. package/project/.sdk/model/target/swift.aon +18 -0
  31. package/project/.sdk/model/target/ts.aon +13 -0
  32. package/project/.sdk/model/target/zig.aon +9 -0
  33. package/project/.sdk/src/cmp/clojure/Package_clojure.ts +9 -2
  34. package/project/.sdk/src/cmp/cpp/Gitignore_cpp.ts +3 -0
  35. package/project/.sdk/src/cmp/dart/Test_dart.ts +2 -0
  36. package/project/.sdk/src/cmp/elixir/Package_elixir.ts +4 -1
  37. package/project/.sdk/src/cmp/go/Config_go.ts +59 -2
  38. package/project/.sdk/src/cmp/go/Main_go.ts +8 -2
  39. package/project/.sdk/src/cmp/java/Test_java.ts +6 -5
  40. package/project/.sdk/src/cmp/kotlin/Test_kotlin.ts +6 -5
  41. package/project/.sdk/src/cmp/lean/Package_lean.ts +23 -0
  42. package/project/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +1 -0
  43. package/project/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +1 -0
  44. package/project/.sdk/src/cmp/ocaml/Gitignore_ocaml.ts +1 -0
  45. package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +7 -3
  46. package/project/.sdk/src/cmp/py/Config_py.ts +82 -1
  47. package/project/.sdk/src/cmp/py/Main_py.ts +44 -0
  48. package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +2 -0
  49. package/project/.sdk/src/cmp/swift/Main_swift.ts +10 -0
  50. package/project/.sdk/src/cmp/swift/Package_swift.ts +13 -1
  51. package/project/.sdk/src/cmp/ts/Config_ts.ts +42 -17
  52. package/project/.sdk/src/cmp/ts/fragment/Config.data.fragment.ts +13 -1
  53. package/project/.sdk/src/cmp/ts/fragment/Config.fragment.ts +13 -1
  54. package/project/.sdk/src/cmp/zig/Package_zig.ts +15 -11
  55. package/project/.sdk/src/cmp/zig/fragment/Entity.fragment.zig +3 -3
  56. package/project/.sdk/src/cmp/zig/fragment/EntityListOp.fragment.zig +3 -3
  57. package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +3 -3
  58. package/project/.sdk/src/cmp/zig/utility_zig.ts +50 -1
  59. package/project/.sdk/tm/c/Makefile +38 -3
  60. package/project/.sdk/tm/c/tests/omni_resolver.h +361 -0
  61. package/project/.sdk/tm/c/tests/omni_smoke_test.c +237 -0
  62. package/project/.sdk/tm/c/tests/primary_corpus_test.c +205 -284
  63. package/project/.sdk/tm/c/tests/struct_corpus_test.c +292 -212
  64. package/project/.sdk/tm/c/tests/vendor/omni/json.c +811 -0
  65. package/project/.sdk/tm/c/tests/vendor/omni/omni.h +240 -0
  66. package/project/.sdk/tm/c/tests/vendor/omni/runner.c +940 -0
  67. package/project/.sdk/tm/c/tests/vendor/omni/util.c +351 -0
  68. package/project/.sdk/tm/c/utility/struct/utility.c +7 -2
  69. package/project/.sdk/tm/clojure/test/sdk/test/omni.clj +401 -0
  70. package/project/.sdk/tm/clojure/test/sdk/test/omni_smoke.clj +81 -0
  71. package/project/.sdk/tm/clojure/test/sdk/test/primary.clj +92 -58
  72. package/project/.sdk/tm/clojure/test/sdk/test/struct_corpus.clj +122 -149
  73. package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +8 -3
  74. package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/json.clj +145 -0
  75. package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/runner.clj +445 -0
  76. package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/util.clj +145 -0
  77. package/project/.sdk/tm/cpp/Makefile +5 -1
  78. package/project/.sdk/tm/cpp/test/omni_resolver.hpp +473 -0
  79. package/project/.sdk/tm/cpp/test/omni_smoke_test.cpp +209 -0
  80. package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +243 -184
  81. package/project/.sdk/tm/cpp/test/runner_support.hpp +68 -181
  82. package/project/.sdk/tm/cpp/test/struct_corpus_test.cpp +183 -56
  83. package/project/.sdk/tm/cpp/test/vendor/omni/json.hpp +406 -0
  84. package/project/.sdk/tm/cpp/test/vendor/omni/omni.hpp +751 -0
  85. package/project/.sdk/tm/cpp/test/vendor/omni/util.hpp +256 -0
  86. package/project/.sdk/tm/cpp/utility/pipeline.hpp +7 -1
  87. package/project/.sdk/tm/csharp/test/OmniResolver.cs +491 -0
  88. package/project/.sdk/tm/csharp/test/OmniSmokeTest.cs +106 -0
  89. package/project/.sdk/tm/csharp/test/PrimaryUtilityTest.cs +299 -316
  90. package/project/.sdk/tm/csharp/test/Runner.cs +104 -269
  91. package/project/.sdk/tm/csharp/test/StructUtilityTest.cs +535 -724
  92. package/project/.sdk/tm/csharp/test/vendor/omni/Runner.cs +864 -0
  93. package/project/.sdk/tm/csharp/test/vendor/omni/Util.cs +347 -0
  94. package/project/.sdk/tm/csharp/utility/MakeSpec.cs +3 -1
  95. package/project/.sdk/tm/csharp/utility/PrepareMethod.cs +6 -1
  96. package/project/.sdk/tm/csharp/utility/struct/Struct.cs +21 -5
  97. package/project/.sdk/tm/dart/test/omni.dart +520 -0
  98. package/project/.sdk/tm/dart/test/omni_smoke_test.dart +143 -0
  99. package/project/.sdk/tm/dart/test/primary_test.dart +86 -28
  100. package/project/.sdk/tm/dart/test/struct_test.dart +438 -11
  101. package/project/.sdk/tm/dart/test/vendor/omni/omni.dart +7 -0
  102. package/project/.sdk/tm/dart/test/vendor/omni/runner.dart +653 -0
  103. package/project/.sdk/tm/dart/test/vendor/omni/util.dart +232 -0
  104. package/project/.sdk/tm/elixir/Makefile +11 -3
  105. package/project/.sdk/tm/elixir/test/omni_smoke_test.exs +117 -0
  106. package/project/.sdk/tm/elixir/test/primary_utility_test.exs +341 -16
  107. package/project/.sdk/tm/elixir/test/struct_corpus_test.exs +554 -9
  108. package/project/.sdk/tm/elixir/test/support/omni.ex +377 -0
  109. package/project/.sdk/tm/elixir/test/vendor/omni/json.ex +122 -0
  110. package/project/.sdk/tm/elixir/test/vendor/omni/runner.ex +623 -0
  111. package/project/.sdk/tm/elixir/test/vendor/omni/util.ex +187 -0
  112. package/project/.sdk/tm/go/core/context.go +32 -16
  113. package/project/.sdk/tm/go/feature/secrets/plugin/capability.go +261 -0
  114. package/project/.sdk/tm/go/feature/secrets/plugin/catalog.go +78 -0
  115. package/project/.sdk/tm/go/feature/secrets/plugin/config.go +652 -0
  116. package/project/.sdk/tm/go/feature/secrets/plugin/depend.go +250 -0
  117. package/project/.sdk/tm/go/feature/secrets/plugin/env.go +194 -0
  118. package/project/.sdk/tm/go/feature/secrets/plugin/export.go +80 -0
  119. package/project/.sdk/tm/go/feature/secrets/plugin/graph.go +238 -0
  120. package/project/.sdk/tm/go/feature/secrets/plugin/host.go +1575 -0
  121. package/project/.sdk/tm/go/feature/secrets/plugin/order.go +248 -0
  122. package/project/.sdk/tm/go/feature/secrets/plugin/point.go +184 -0
  123. package/project/.sdk/tm/go/feature/secrets/plugin/ref.go +123 -0
  124. package/project/.sdk/tm/go/feature/secrets/plugin/resolve.go +79 -0
  125. package/project/.sdk/tm/go/feature/secrets/plugin/types.go +296 -0
  126. package/project/.sdk/tm/go/feature/secrets/plugin/util.go +87 -0
  127. package/project/.sdk/tm/go/feature/secrets/plugin/version.go +161 -0
  128. package/project/.sdk/tm/go/feature/secrets/plugins/aws/aws.go +292 -0
  129. package/project/.sdk/tm/go/feature/secrets/plugins/aws/sigv4.go +201 -0
  130. package/project/.sdk/tm/go/feature/secrets/plugins/azuresecrets/azuresecrets.go +187 -0
  131. package/project/.sdk/tm/go/feature/secrets/plugins/boru/boru.go +184 -0
  132. package/project/.sdk/tm/go/feature/secrets/plugins/doppler/doppler.go +114 -0
  133. package/project/.sdk/tm/go/feature/secrets/plugins/gcpsecrets/gcpsecrets.go +156 -0
  134. package/project/.sdk/tm/go/feature/secrets/plugins/hashicorp/hashicorp.go +208 -0
  135. package/project/.sdk/tm/go/feature/secrets/plugins/httpjson/httpjson.go +241 -0
  136. package/project/.sdk/tm/go/feature/secrets/plugins/infisical/infisical.go +150 -0
  137. package/project/.sdk/tm/go/feature/secrets/plugins/onepassword/onepassword.go +152 -0
  138. package/project/.sdk/tm/go/feature/secrets/plugins/secretspec/secretspec.go +143 -0
  139. package/project/.sdk/tm/go/feature/secrets/sekreto/addr.go +120 -0
  140. package/project/.sdk/tm/go/feature/secrets/sekreto/providers.go +442 -0
  141. package/project/.sdk/tm/go/feature/secrets/sekreto/sekreto.go +714 -0
  142. package/project/.sdk/tm/go/feature/secrets_feature.go +675 -0
  143. package/project/.sdk/tm/go/src/feature/secrets/.gitkeep +0 -0
  144. package/project/.sdk/tm/go/test/feature/secrets/secrets_feature_test.go +799 -0
  145. package/project/.sdk/tm/go/test/omni/omni.go +902 -0
  146. package/project/.sdk/tm/go/test/omni/util.go +381 -0
  147. package/project/.sdk/tm/go/test/omniresolver_test.go +748 -0
  148. package/project/.sdk/tm/go/test/omnismoke_test.go +112 -0
  149. package/project/.sdk/tm/go/test/primary_utility_test.go +123 -191
  150. package/project/.sdk/tm/go/test/struct_utility_test.go +323 -16
  151. package/project/.sdk/tm/go/test/testsupport_test.go +294 -0
  152. package/project/.sdk/tm/go/utility/make_options.go +8 -1
  153. package/project/.sdk/tm/go/utility/prepare_method.go +5 -1
  154. package/project/.sdk/tm/go/utility/struct/voxgigstruct.go +2 -2
  155. package/project/.sdk/tm/java/test/OmniResolver.java +355 -0
  156. package/project/.sdk/tm/java/test/OmniSmokeTest.java +99 -0
  157. package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +254 -280
  158. package/project/.sdk/tm/java/test/RunnerSupport.java +9 -194
  159. package/project/.sdk/tm/java/test/StructCorpusTest.java +119 -42
  160. package/project/.sdk/tm/java/test/vendor/omni/Json.java +287 -0
  161. package/project/.sdk/tm/java/test/vendor/omni/Runner.java +851 -0
  162. package/project/.sdk/tm/java/test/vendor/omni/Util.java +322 -0
  163. package/project/.sdk/tm/java/utility/MakeSpec.java +3 -1
  164. package/project/.sdk/tm/java/utility/PrepareMethod.java +5 -5
  165. package/project/.sdk/tm/java/utility/struct/Struct.java +17 -4
  166. package/project/.sdk/tm/js/src/utility/StructUtility.js +3 -3
  167. package/project/.sdk/tm/js/test/omni.js +251 -0
  168. package/project/.sdk/tm/js/test/omni.test.js +105 -0
  169. package/project/.sdk/tm/js/test/utility/PrimaryUtility.test.js +6 -2
  170. package/project/.sdk/tm/js/test/utility/StructUtility.test.js +27 -2
  171. package/project/.sdk/tm/js/test/vendor/omni/index.js +77 -0
  172. package/project/.sdk/tm/js/test/vendor/omni/runner.js +628 -0
  173. package/project/.sdk/tm/js/test/vendor/omni/util.js +229 -0
  174. package/project/.sdk/tm/kotlin/core/Utility.kt +1 -1
  175. package/project/.sdk/tm/kotlin/test/OmniResolver.kt +343 -0
  176. package/project/.sdk/tm/kotlin/test/OmniSmokeTest.kt +100 -0
  177. package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +244 -262
  178. package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +9 -178
  179. package/project/.sdk/tm/kotlin/test/StructCorpusTest.kt +121 -32
  180. package/project/.sdk/tm/kotlin/test/vendor/omni/Json.kt +264 -0
  181. package/project/.sdk/tm/kotlin/test/vendor/omni/Runner.kt +615 -0
  182. package/project/.sdk/tm/kotlin/test/vendor/omni/Util.kt +139 -0
  183. package/project/.sdk/tm/kotlin/utility/MakeSpecUrl.kt +6 -3
  184. package/project/.sdk/tm/kotlin/utility/Prepare.kt +6 -6
  185. package/project/.sdk/tm/kotlin/utility/struct/Struct.kt +18 -2
  186. package/project/.sdk/tm/lean/Makefile +12 -5
  187. package/project/.sdk/tm/lean/src/SdkUtility.lean +14 -1
  188. package/project/.sdk/tm/lean/test/OmniResolver.lean +358 -0
  189. package/project/.sdk/tm/lean/test/OmniSmoke.lean +174 -0
  190. package/project/.sdk/tm/lean/test/StructCorpus.lean +245 -574
  191. package/project/.sdk/tm/lean/test/TPrimaryUtility.lean +155 -291
  192. package/project/.sdk/tm/lean/test/vendor/omni/Omni.lean +997 -0
  193. package/project/.sdk/tm/lua/test/omni.lua +456 -0
  194. package/project/.sdk/tm/lua/test/omni_smoke_test.lua +103 -0
  195. package/project/.sdk/tm/lua/test/primary_utility_test.lua +250 -509
  196. package/project/.sdk/tm/lua/test/struct_utility_test.lua +161 -70
  197. package/project/.sdk/tm/lua/test/vendor/omni/json.lua +268 -0
  198. package/project/.sdk/tm/lua/test/vendor/omni/regex.lua +385 -0
  199. package/project/.sdk/tm/lua/test/vendor/omni/runner.lua +641 -0
  200. package/project/.sdk/tm/lua/test/vendor/omni/util.lua +282 -0
  201. package/project/.sdk/tm/lua/utility/prepare_method.lua +5 -1
  202. package/project/.sdk/tm/lua/utility/struct/regex.lua +663 -0
  203. package/project/.sdk/tm/lua/utility/struct/struct.lua +660 -420
  204. package/project/.sdk/tm/ocaml/Makefile +37 -12
  205. package/project/.sdk/tm/ocaml/test/omni_resolver.ml +284 -0
  206. package/project/.sdk/tm/ocaml/test/omni_smoke_test.ml +169 -0
  207. package/project/.sdk/tm/ocaml/test/primary_utility_test.ml +84 -100
  208. package/project/.sdk/tm/ocaml/test/struct_corpus.ml +225 -201
  209. package/project/.sdk/tm/ocaml/test/vendor/omni/omni.ml +1157 -0
  210. package/project/.sdk/tm/perl/lib/Voxgig/Struct.pm +88 -12
  211. package/project/.sdk/tm/perl/t/omni.pm +647 -0
  212. package/project/.sdk/tm/perl/t/omni_smoke.t +87 -0
  213. package/project/.sdk/tm/perl/t/primary_utility.t +189 -487
  214. package/project/.sdk/tm/perl/t/struct_utility.t +455 -389
  215. package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Runner.pm +649 -0
  216. package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Util.pm +253 -0
  217. package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni.pm +24 -0
  218. package/project/.sdk/tm/perl/utility/prepare_method.pm +7 -2
  219. package/project/.sdk/tm/php/test/Omni.php +691 -0
  220. package/project/.sdk/tm/php/test/OmniSmokeTest.php +93 -0
  221. package/project/.sdk/tm/php/test/PrimaryUtilityTest.php +210 -571
  222. package/project/.sdk/tm/php/test/StructUtilityTest.php +320 -342
  223. package/project/.sdk/tm/php/test/vendor/omni/Runner.php +644 -0
  224. package/project/.sdk/tm/php/test/vendor/omni/Util.php +283 -0
  225. package/project/.sdk/tm/php/utility/MakeSpec.php +10 -3
  226. package/project/.sdk/tm/php/utility/PrepareBody.php +7 -1
  227. package/project/.sdk/tm/php/utility/PrepareMethod.php +6 -2
  228. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/__init__.py +36 -0
  229. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/capability.py +141 -0
  230. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/catalog.py +50 -0
  231. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/config.py +333 -0
  232. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/depend.py +198 -0
  233. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/env.py +147 -0
  234. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/export.py +52 -0
  235. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/graph.py +139 -0
  236. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/host.py +1053 -0
  237. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/order.py +171 -0
  238. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/point.py +95 -0
  239. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/ref.py +116 -0
  240. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/resolve.py +59 -0
  241. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/types.py +87 -0
  242. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/version.py +112 -0
  243. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/__init__.py +76 -0
  244. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/addr.py +116 -0
  245. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/aws.py +192 -0
  246. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/azuresecrets.py +120 -0
  247. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/boru.py +140 -0
  248. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/doppler.py +62 -0
  249. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/gcpsecrets.py +101 -0
  250. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/hashicorp.py +151 -0
  251. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/httpjson.py +115 -0
  252. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/infisical.py +90 -0
  253. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/onepassword.py +101 -0
  254. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/secretspec.py +119 -0
  255. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/sigv4.py +125 -0
  256. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/providers.py +211 -0
  257. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/sekreto.py +475 -0
  258. package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +467 -0
  259. package/project/.sdk/tm/py/pkg/utility/prepare_method.py +5 -1
  260. package/project/.sdk/tm/py/pkg/utility/voxgig_struct/__init__.py +0 -2
  261. package/project/.sdk/tm/py/pkg/utility/voxgig_struct/voxgig_struct.py +780 -529
  262. package/project/.sdk/tm/py/src/feature/secrets/.gitkeep +0 -0
  263. package/project/.sdk/tm/py/test/feature/__init__.py +0 -0
  264. package/project/.sdk/tm/py/test/feature/secrets/__init__.py +0 -0
  265. package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +337 -0
  266. package/project/.sdk/tm/py/test/omni.py +415 -0
  267. package/project/.sdk/tm/py/test/test_omni_smoke.py +74 -0
  268. package/project/.sdk/tm/py/test/test_primary_utility.py +144 -668
  269. package/project/.sdk/tm/py/test/test_struct_utility.py +74 -27
  270. package/project/.sdk/tm/py/test/voxgig_omni/__init__.py +62 -0
  271. package/project/.sdk/tm/py/test/voxgig_omni/runner.py +580 -0
  272. package/project/.sdk/tm/py/test/voxgig_omni/util.py +252 -0
  273. package/project/.sdk/tm/rb/test/omni.rb +505 -0
  274. package/project/.sdk/tm/rb/test/omni_smoke_test.rb +72 -0
  275. package/project/.sdk/tm/rb/test/primary_utility_test.rb +174 -560
  276. package/project/.sdk/tm/rb/test/struct_utility_test.rb +13 -7
  277. package/project/.sdk/tm/rb/test/vendor/omni/runner.rb +493 -0
  278. package/project/.sdk/tm/rb/test/vendor/omni/util.rb +199 -0
  279. package/project/.sdk/tm/rb/test/vendor/omni/voxgig_omni.rb +15 -0
  280. package/project/.sdk/tm/rb/utility/prepare_method.rb +5 -1
  281. package/project/.sdk/tm/rust/tests/common/mod.rs +19 -242
  282. package/project/.sdk/tm/rust/tests/omni_resolver/mod.rs +888 -0
  283. package/project/.sdk/tm/rust/tests/omni_smoke_test.rs +286 -0
  284. package/project/.sdk/tm/rust/tests/primary_utility_test.rs +318 -312
  285. package/project/.sdk/tm/rust/tests/struct_utility_test.rs +66 -28
  286. package/project/.sdk/tm/rust/tests/vendor/omni/json.rs +412 -0
  287. package/project/.sdk/tm/rust/tests/vendor/omni/mod.rs +38 -0
  288. package/project/.sdk/tm/rust/tests/vendor/omni/regex.rs +392 -0
  289. package/project/.sdk/tm/rust/tests/vendor/omni/runner.rs +1001 -0
  290. package/project/.sdk/tm/rust/tests/vendor/omni/util.rs +161 -0
  291. package/project/.sdk/tm/rust/utility/prepare_method.rs +5 -1
  292. package/project/.sdk/tm/scala/Makefile +16 -6
  293. package/project/.sdk/tm/scala/sdktest/OmniResolver.scala +497 -0
  294. package/project/.sdk/tm/scala/sdktest/OmniSmoke.scala +192 -0
  295. package/project/.sdk/tm/scala/sdktest/PrimaryCorpus.scala +47 -19
  296. package/project/.sdk/tm/scala/sdktest/StructCorpus.scala +0 -0
  297. package/project/.sdk/tm/scala/sdktest/vendor/omni/Json.scala +229 -0
  298. package/project/.sdk/tm/scala/sdktest/vendor/omni/Runner.scala +552 -0
  299. package/project/.sdk/tm/scala/sdktest/vendor/omni/Util.scala +104 -0
  300. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Constants.swift +10 -0
  301. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Inject.swift +28 -5
  302. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Injection.swift +5 -1
  303. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Minor.swift +4 -1
  304. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Validate.swift +15 -5
  305. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Prepare.swift +6 -1
  306. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniResolver.swift +474 -0
  307. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniSmokeTest.swift +107 -0
  308. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +141 -178
  309. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/Runner.swift +17 -113
  310. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/StructUtilityTest.swift +295 -446
  311. package/project/.sdk/tm/swift/Tests/vendor/omni/Json.swift +364 -0
  312. package/project/.sdk/tm/swift/Tests/vendor/omni/Runner.swift +730 -0
  313. package/project/.sdk/tm/swift/Tests/vendor/omni/Util.swift +162 -0
  314. package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +7 -0
  315. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Capability.ts +148 -0
  316. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Catalog.ts +55 -0
  317. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Config.ts +344 -0
  318. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Depend.ts +205 -0
  319. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Env.ts +138 -0
  320. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Export.ts +46 -0
  321. package/project/.sdk/tm/ts/src/feature/secrets/plugin/FeatureHost.ts +349 -0
  322. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Graph.ts +181 -0
  323. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Host.ts +1132 -0
  324. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Order.ts +177 -0
  325. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Point.ts +119 -0
  326. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Ref.ts +102 -0
  327. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Resolve.ts +61 -0
  328. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Types.ts +112 -0
  329. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Version.ts +100 -0
  330. package/project/.sdk/tm/ts/src/feature/secrets/plugin/index.ts +37 -0
  331. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/Sekreto.ts +163 -30
  332. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/index.ts +27 -22
  333. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/aws.ts +26 -36
  334. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/azuresecrets.ts +19 -21
  335. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/boru.ts +36 -17
  336. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/doppler.ts +14 -21
  337. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/gcpsecrets.ts +27 -27
  338. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/hashicorp.ts +25 -39
  339. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/httpjson.ts +99 -0
  340. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/infisical.ts +14 -16
  341. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/onepassword.ts +15 -22
  342. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/secretspec.ts +98 -0
  343. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{Sigv4.ts → plugins/sigv4.ts} +7 -6
  344. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/addr.ts +97 -23
  345. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/builtin.ts +37 -0
  346. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/dotenv.ts +4 -17
  347. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/env.ts +4 -16
  348. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/file.ts +11 -25
  349. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/memory.ts +6 -23
  350. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/support.ts +106 -39
  351. package/project/.sdk/tm/ts/src/utility/StructUtility.ts +3 -3
  352. package/project/.sdk/tm/ts/test/omni.ts +104 -32
  353. package/project/.sdk/tm/ts/test/utility/StructUtility.test.ts +27 -0
  354. package/project/.sdk/tm/ts/test/vendor/omni/Runner.ts +32 -5
  355. package/project/.sdk/tm/ts/test/vendor/omni/Util.ts +2 -2
  356. package/project/.sdk/tm/ts/test/vendor/omni/index.ts +2 -2
  357. package/project/.sdk/tm/zig/Makefile +15 -1
  358. package/project/.sdk/tm/zig/build.zig +23 -5
  359. package/project/.sdk/tm/zig/core/helpers.zig +52 -11
  360. package/project/.sdk/tm/zig/core/mem.zig +17 -1
  361. package/project/.sdk/tm/zig/core/utility.zig +23 -19
  362. package/project/.sdk/tm/zig/feature/audit.zig +2 -2
  363. package/project/.sdk/tm/zig/feature/cache.zig +2 -2
  364. package/project/.sdk/tm/zig/feature/debug.zig +5 -5
  365. package/project/.sdk/tm/zig/feature/netsim.zig +2 -2
  366. package/project/.sdk/tm/zig/feature/paging.zig +2 -2
  367. package/project/.sdk/tm/zig/feature/proxy.zig +15 -8
  368. package/project/.sdk/tm/zig/feature/streaming.zig +5 -5
  369. package/project/.sdk/tm/zig/feature/support.zig +3 -3
  370. package/project/.sdk/tm/zig/feature/telemetry.zig +5 -5
  371. package/project/.sdk/tm/zig/feature/test.zig +10 -5
  372. package/project/.sdk/tm/zig/test/fh.zig +10 -10
  373. package/project/.sdk/tm/zig/test/gotcha_test.zig +5 -5
  374. package/project/.sdk/tm/zig/test/omniresolver.zig +515 -0
  375. package/project/.sdk/tm/zig/test/omnismoke_test.zig +284 -0
  376. package/project/.sdk/tm/zig/test/pipeline_test.zig +8 -8
  377. package/project/.sdk/tm/zig/test/primary_utility_test.zig +145 -155
  378. package/project/.sdk/tm/zig/test/struct_corpus.zig +264 -187
  379. package/project/.sdk/tm/zig/test/vendor/omni/omni.zig +1314 -0
  380. package/project/.sdk/tm/zig/test/vendor/omni/regex.zig +446 -0
  381. package/project/.sdk/tm/zig/utility/voxgigstruct/regex.zig +7 -4
  382. package/project/.sdk/tm/zig/utility/voxgigstruct/struct.zig +356 -157
  383. package/project/sdkgen-package.json +1 -1
  384. package/src/action/doctor.ts +66 -2
  385. package/src/helpers/naming.ts +4 -2
  386. package/project/.sdk/tm/c/tests/runner.h +0 -274
  387. package/project/.sdk/tm/cpp/test/struct_runner.hpp +0 -314
  388. package/project/.sdk/tm/csharp/test/StructRunner.cs +0 -276
  389. package/project/.sdk/tm/dart/test/runner.dart +0 -406
  390. package/project/.sdk/tm/dart/test/struct_corpus.dart +0 -531
  391. package/project/.sdk/tm/elixir/test/support/struct_corpus.ex +0 -1088
  392. package/project/.sdk/tm/go/test/runner_test.go +0 -629
  393. package/project/.sdk/tm/go/test/struct_runner_test.go +0 -1094
  394. package/project/.sdk/tm/java/test/StructRunner.java +0 -281
  395. package/project/.sdk/tm/js/test/runner.js +0 -387
  396. package/project/.sdk/tm/kotlin/test/StructRunner.kt +0 -177
  397. package/project/.sdk/tm/lua/test/struct_runner.lua +0 -602
  398. package/project/.sdk/tm/ocaml/test/corpus_runner.ml +0 -185
  399. package/project/.sdk/tm/perl/t/struct_runner.pm +0 -275
  400. package/project/.sdk/tm/php/test/StructRunner.php +0 -275
  401. package/project/.sdk/tm/py/test/struct_runner.py +0 -411
  402. package/project/.sdk/tm/rb/test/struct_runner.rb +0 -309
  403. package/project/.sdk/tm/rust/tests/struct_runner/mod.rs +0 -424
  404. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/Registry.ts +0 -90
  405. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/http.ts +0 -66
  406. package/project/.sdk/tm/ts/test/vendor/omni/compat.ts +0 -188
  407. package/project/.sdk/tm/zig/test/struct_runner.zig +0 -464
@@ -1,10 +1,29 @@
1
1
  -- ProjectName SDK primary utility test
2
+ --
3
+ -- Corpus sections run through the vendored omni runner, via the resolver
4
+ -- in test/omni.lua (struct-runner shape over native vendored omni). The
5
+ -- inline corpus engine this file used to carry is retired: omni resolves
6
+ -- arguments, applies the null rules, and enforces out/err/match - the
7
+ -- subjects below only adapt each utility's calling convention.
8
+ --
9
+ -- Three conventions to know when adding a section:
10
+ --
11
+ -- - Utilities that answer as a (value, err) PAIR go through `unwrap`,
12
+ -- which raises the err so omni can match it against `err:` expectations.
13
+ -- Utilities that answer bare values are passed straight through.
14
+ --
15
+ -- - A subject receives omni's RESOLVED arguments (the entry's ctx map, or
16
+ -- its `in`/`args` values), not the raw entry. The ctx map arrives in
17
+ -- the SDK's value model; `make_ctx_from_map` materialises the real
18
+ -- Context from it, exactly as the retired engine did.
19
+ --
20
+ -- - `match: {ctx: ...}` assertions read the entry's ctx AFTER the subject
21
+ -- ran, so a subject whose section asserts on context state writes the
22
+ -- relevant live-context fields back onto the ctx map it received - the
23
+ -- resolver splices those writebacks into the entry omni matches on.
2
24
 
3
- local json = require("dkjson")
4
- local vs = require("utility.struct.struct")
5
25
  local sdk = require("project-name-_sdk")
6
- local helpers = require("core.helpers")
7
- local runner = require("test.runner")
26
+ local omni = require("test.omni")
8
27
  local Context = require("core.context")
9
28
  local Spec = require("core.spec")
10
29
  local Result = require("core.result")
@@ -13,30 +32,31 @@ local Operation = require("core.operation")
13
32
  local BaseFeature = require("feature.base_feature")
14
33
  local ProjectNameError = require("core.error")
15
34
 
16
- local _test_dir = debug.getinfo(1, "S").source:match("^@(.+/)") or "./"
17
35
 
36
+ -- Resolved against test/omni.lua's own directory, so the suite works from
37
+ -- any working directory.
38
+ local TEST_JSON_FILE = "../../.sdk/test/test.json"
18
39
 
19
- -- Load test.json
20
- local function load_test_spec()
21
- local path = _test_dir .. "../../.sdk/test/test.json"
22
- local f = io.open(path, "r")
23
- if f == nil then
24
- error("failed to load test.json: " .. path)
25
- end
26
- local content = f:read("*a")
27
- f:close()
28
- local spec = json.decode(content)
29
- if spec == nil then
30
- error("failed to parse test.json")
31
- end
32
- return spec
33
- end
40
+
41
+ local runner = omni.makeRunner(TEST_JSON_FILE, sdk.test(nil, nil))
42
+ local run = runner("primary")
43
+
44
+ local spec = run.spec
45
+ local runset = run.runset
46
+ local runsetflags = run.runsetflags
47
+
48
+ -- Under the old inline runner the suite drove the SDK directly; under omni
49
+ -- the runpack's client is the read-through provider wrapping it. This
50
+ -- suite treats the client as the SDK - so unwrap the real instance
51
+ -- (mirrors ts/py).
52
+ local client = run.client.sdk
53
+ local utility = client:get_utility()
34
54
 
35
55
 
36
56
  -- Navigate into nested map by keys
37
- local function get_spec(spec, ...)
38
- local cur = spec
39
- local keys = {...}
57
+ local function get_spec(base, ...)
58
+ local cur = base
59
+ local keys = { ... }
40
60
  for _, key in ipairs(keys) do
41
61
  if type(cur) ~= "table" then
42
62
  return nil
@@ -50,251 +70,62 @@ local function get_spec(spec, ...)
50
70
  end
51
71
 
52
72
 
53
- -- JSON normalize: round-trip through JSON to normalize types
54
- local function json_normalize(val)
55
- if val == nil then
56
- return nil
57
- end
58
- local encoded = json.encode(val)
59
- if encoded == nil then
60
- return val
61
- end
62
- local decoded = json.decode(encoded)
63
- return decoded
64
- end
65
-
66
-
67
- -- JSON string representation
68
- local function json_str(val)
69
- if val == nil then
70
- return "nil"
71
- end
72
- local encoded = json.encode(val)
73
- if encoded == nil then
74
- return tostring(val)
75
- end
76
- return encoded
77
- end
78
-
79
-
80
- -- Match a string pattern: /regex/ or case-insensitive contains
81
- -- Converts common PCRE patterns (\w, \d, \s) to Lua patterns (%w, %d, %s)
82
- local function match_string(pattern, val)
83
- if #pattern >= 2 and pattern:sub(1, 1) == "/" and pattern:sub(-1) == "/" then
84
- local re = pattern:sub(2, -2)
85
- -- Convert PCRE character classes to Lua pattern equivalents
86
- re = re:gsub("\\w", "%%w")
87
- re = re:gsub("\\d", "%%d")
88
- re = re:gsub("\\s", "%%s")
89
- local ok = string.find(val, re)
90
- return ok ~= nil
91
- end
92
- return string.find(string.lower(val), string.lower(pattern), 1, true) ~= nil
93
- end
94
-
95
-
96
- -- Deep match: check that all keys in 'check' exist and match in 'base'
97
- local function match_deep(check, base, path, errors)
98
- if check == nil then
99
- return
100
- end
101
-
102
- path = path or ""
103
- errors = errors or {}
104
-
105
- if type(check) == "table" then
106
- -- Determine if check is a list (array) or map
107
- local is_list = false
108
- if #check > 0 then
109
- is_list = true
110
- for k, _ in pairs(check) do
111
- if type(k) ~= "number" then
112
- is_list = false
113
- break
114
- end
115
- end
116
- end
117
-
118
- if is_list then
119
- for i, check_val in ipairs(check) do
120
- local child_path = path .. "[" .. i .. "]"
121
- local base_val = nil
122
- if type(base) == "table" and base[i] ~= nil then
123
- base_val = base[i]
124
- end
125
- match_deep(check_val, base_val, child_path, errors)
126
- end
127
- else
128
- for key, check_val in pairs(check) do
129
- local child_path = path .. "." .. tostring(key)
130
- local base_val = nil
131
- if type(base) == "table" then
132
- base_val = base[key]
133
- end
134
- match_deep(check_val, base_val, child_path, errors)
135
- end
136
- end
137
- else
138
- local check_str = nil
139
- if type(check) == "string" then
140
- check_str = check
141
- end
142
-
143
- if check_str == "__EXISTS__" then
144
- if base == nil then
145
- table.insert(errors, "match " .. path .. ": expected value to exist but got nil")
146
- end
147
- return
148
- end
149
-
150
- if check_str == "__UNDEF__" then
151
- if base ~= nil then
152
- table.insert(errors, "match " .. path .. ": expected nil but got " .. json_str(base))
153
- end
154
- return
155
- end
156
-
157
- local norm_check = json_normalize(check)
158
- local norm_base = json_normalize(base)
159
-
160
- -- Compare normalized values
161
- local check_json = json.encode(norm_check)
162
- local base_json = json.encode(norm_base)
163
-
164
- if check_json ~= base_json then
165
- if check_str ~= nil and check_str ~= "" then
166
- local base_str = tostring(base or "")
167
- if match_string(check_str, base_str) then
168
- return
169
- end
170
- end
171
- table.insert(errors, "match " .. path .. ": got " ..
172
- json_str(norm_base) .. ", want " .. json_str(norm_check))
173
- end
73
+ -- Sections deliberately left empty in the shared corpus
74
+ -- (.sdk/test/primary/<name>.aon carries a PENDING header). Everything else
75
+ -- MUST contribute cases.
76
+ local PENDING = {
77
+ fetcher = true,
78
+ makeFetchDef = true,
79
+ makeResult = true,
80
+ featureAdd = true,
81
+ featureHook = true,
82
+ featureInit = true,
83
+ }
84
+
85
+
86
+ -- Run one corpus section, failing loudly when it would run ZERO cases. A
87
+ -- renamed section or a fixture that compiled to an empty `set` used to
88
+ -- pass silently, which defeats the point of a shared oracle. EVERY
89
+ -- corpus-backed test goes through here (mirrors ts/py).
90
+ local function runsection(name, subject)
91
+ local section = get_spec(spec, name)
92
+ assert(section ~= nil,
93
+ "test corpus section '" .. name .. "' missing - check the name " ..
94
+ "against .sdk/test/primary/")
95
+ local basic = get_spec(section, "basic")
96
+ assert(basic ~= nil and type(basic.set) == "table",
97
+ "test corpus section '" .. name .. "' has no basic.set list")
98
+ if #basic.set == 0 and not PENDING[name] then
99
+ error("test corpus section '" .. name .. "' is EMPTY - zero cases " ..
100
+ "would run; add cases, or mark the fixture PENDING in .sdk/test/primary/")
174
101
  end
102
+ return runset(basic, subject)
175
103
  end
176
104
 
177
105
 
178
- -- Run a test set from test.json
179
- local function runset(testspec, subject)
180
- if testspec == nil then
181
- return
182
- end
183
- local set = testspec["set"]
184
- if type(set) ~= "table" then
185
- return
186
- end
187
-
188
- for si, entry_ref in ipairs(set) do
189
- local i = si - 1
190
- local entry = entry_ref
191
-
192
- local mark = ""
193
- if entry["mark"] ~= nil then
194
- mark = " (mark=" .. tostring(entry["mark"]) .. ")"
195
- end
196
-
197
- local result, err = subject(entry)
198
-
199
- local expected_err = entry["err"]
200
-
201
- if err ~= nil then
202
- if expected_err ~= nil then
203
- local err_msg = tostring(err)
204
- if type(err) == "table" and err.msg ~= nil then
205
- err_msg = err.msg
206
- end
207
- if type(expected_err) == "string" then
208
- if not match_string(expected_err, err_msg) then
209
- error("entry " .. i .. mark .. ": error mismatch: got " ..
210
- json_str(err_msg) .. ", want contains " .. json_str(expected_err))
211
- end
212
- elseif type(expected_err) == "boolean" and expected_err == true then
213
- -- err: true means any error is acceptable
214
- end
215
- if entry["match"] ~= nil then
216
- local result_map = {
217
- ["in"] = entry["in"],
218
- out = json_normalize(result),
219
- err = { message = tostring(err) },
220
- }
221
- local errors = {}
222
- match_deep(entry["match"], result_map, "", errors)
223
- if #errors > 0 then
224
- error("entry " .. i .. mark .. ": " .. table.concat(errors, "; "))
225
- end
226
- end
227
- goto continue
228
- end
229
- error("entry " .. i .. mark .. ": unexpected error: " .. tostring(err))
230
- end
231
-
232
- if expected_err ~= nil then
233
- error("entry " .. i .. mark .. ": expected error containing " ..
234
- json_str(expected_err) .. " but got result: " .. json_str(result))
235
- end
236
-
237
- do
238
- local matched = false
239
- if entry["match"] ~= nil then
240
- local result_map = {
241
- ["in"] = entry["in"],
242
- out = json_normalize(result),
243
- }
244
- if entry["args"] ~= nil then
245
- result_map["args"] = entry["args"]
246
- elseif entry["in"] ~= nil then
247
- result_map["args"] = { entry["in"] }
248
- end
249
- if entry["ctx"] ~= nil then
250
- result_map["ctx"] = entry["ctx"]
251
- end
252
- local errors = {}
253
- match_deep(entry["match"], result_map, "", errors)
254
- if #errors > 0 then
255
- error("entry " .. i .. mark .. ": " .. table.concat(errors, "; "))
256
- end
257
- matched = true
258
- end
259
-
260
- local expected_out = entry["out"]
261
- if expected_out == nil and matched then
262
- goto continue
263
- end
264
- if expected_out ~= nil then
265
- local norm_result = json_normalize(result)
266
- local norm_expected = json_normalize(expected_out)
267
- local rj = json.encode(norm_result)
268
- local ej = json.encode(norm_expected)
269
- -- Treat empty [] and {} as equivalent
270
- local rj_norm = (rj == "[]") and "{}" or rj
271
- local ej_norm = (ej == "[]") and "{}" or ej
272
- if rj_norm ~= ej_norm then
273
- error("entry " .. i .. mark .. ": output mismatch: got " ..
274
- json_str(norm_result) .. ", want " .. json_str(norm_expected))
275
- end
276
- end
277
- end
278
-
279
- ::continue::
106
+ -- (value, err) pair convention -> value-or-raise, omni's shape.
107
+ local function unwrap(val, err)
108
+ if err ~= nil then
109
+ error(err)
280
110
  end
111
+ return val
281
112
  end
282
113
 
283
114
 
284
115
  -- Create a context from a JSON map (like makeCtxFromMap in Go)
285
- local function make_ctx_from_map(ctxmap, client, utility)
116
+ local function make_ctx_from_map(ctxmap, ctxclient, ctxutility)
286
117
  if ctxmap == nil then
287
118
  ctxmap = {}
288
119
  end
289
120
 
290
121
  local ctx = Context.new(ctxmap, nil)
291
122
 
292
- if client ~= nil then
293
- ctx.client = client
294
- ctx.utility = utility
123
+ if ctxclient ~= nil then
124
+ ctx.client = ctxclient
125
+ ctx.utility = ctxutility
295
126
  end
296
- if ctx.options == nil and client ~= nil then
297
- ctx.options = client:options_map()
127
+ if ctx.options == nil and ctxclient ~= nil then
128
+ ctx.options = ctxclient:options_map()
298
129
  end
299
130
 
300
131
  -- Handle spec from JSON map
@@ -336,7 +167,7 @@ end
336
167
 
337
168
 
338
169
  -- Fix context options
339
- local function fixctx(ctx, client)
170
+ local function fixctx(ctx, ctxclient)
340
171
  if ctx ~= nil and ctx.client ~= nil and ctx.options == nil then
341
172
  ctx.options = ctx.client:options_map()
342
173
  end
@@ -358,24 +189,24 @@ end
358
189
 
359
190
 
360
191
  -- Create a basic test context
361
- local function make_test_ctx(client, utility, overrides)
192
+ local function make_test_ctx(ctxclient, ctxutility, overrides)
362
193
  local ctxmap = {
363
194
  opname = "load",
364
- client = client,
365
- utility = utility,
195
+ client = ctxclient,
196
+ utility = ctxutility,
366
197
  }
367
198
  if overrides ~= nil then
368
199
  for k, v in pairs(overrides) do
369
200
  ctxmap[k] = v
370
201
  end
371
202
  end
372
- return utility.make_context(ctxmap, client:get_root_ctx())
203
+ return ctxutility.make_context(ctxmap, ctxclient:get_root_ctx())
373
204
  end
374
205
 
375
206
 
376
207
  -- Create a full test context with point and match
377
- local function make_test_full_ctx(client, utility)
378
- local ctx = make_test_ctx(client, utility, nil)
208
+ local function make_test_full_ctx(ctxclient, ctxutility)
209
+ local ctx = make_test_ctx(ctxclient, ctxutility, nil)
379
210
  ctx.point = {
380
211
  parts = { "items", "{id}" },
381
212
  args = { params = { { name = "id", reqd = true } } },
@@ -392,13 +223,6 @@ end
392
223
 
393
224
 
394
225
  describe("PrimaryUtility", function()
395
- local spec = load_test_spec()
396
- local primary = get_spec(spec, "primary")
397
- assert.is_not_nil(primary, "primary section not found in test.json")
398
-
399
- local client = sdk.test(nil, nil)
400
- local utility = client:get_utility()
401
-
402
226
 
403
227
  it("exists", function()
404
228
  assert.is_not_nil(utility.clean, "clean should not be nil")
@@ -442,40 +266,31 @@ describe("PrimaryUtility", function()
442
266
 
443
267
 
444
268
  it("done-basic", function()
445
- runset(get_spec(primary, "done", "basic"), function(entry)
446
- local ctxmap = entry["ctx"]
447
- if type(ctxmap) ~= "table" then
448
- ctxmap = {}
269
+ runsection("done", function(cin)
270
+ if type(cin) ~= "table" then
271
+ cin = {}
449
272
  end
450
- local ctx = make_ctx_from_map(ctxmap, client, utility)
273
+ local ctx = make_ctx_from_map(cin, client, utility)
451
274
  fixctx(ctx, client)
452
- return utility.done(ctx)
275
+ return unwrap(utility.done(ctx))
453
276
  end)
454
277
  end)
455
278
 
456
279
 
457
280
  it("makeError-basic", function()
458
- runset(get_spec(primary, "makeError", "basic"), function(entry)
459
- local args = entry["args"]
460
- if type(args) ~= "table" or #args == 0 then
461
- args = { {} }
281
+ runsection("makeError", function(cin, errmap)
282
+ if type(cin) ~= "table" then
283
+ cin = {}
462
284
  end
463
-
464
- local ctxmap = args[1]
465
- if type(ctxmap) ~= "table" then
466
- ctxmap = {}
467
- end
468
- local ctx = make_ctx_from_map(ctxmap, client, utility)
285
+ local ctx = make_ctx_from_map(cin, client, utility)
469
286
  fixctx(ctx, client)
470
287
 
471
288
  local err_val = nil
472
- if #args > 1 then
473
- if type(args[2]) == "table" then
474
- err_val = err_from_map(args[2])
475
- end
289
+ if type(errmap) == "table" then
290
+ err_val = err_from_map(errmap)
476
291
  end
477
292
 
478
- return utility.make_error(ctx, err_val)
293
+ return unwrap(utility.make_error(ctx, err_val))
479
294
  end)
480
295
  end)
481
296
 
@@ -632,22 +447,21 @@ describe("PrimaryUtility", function()
632
447
 
633
448
 
634
449
  it("makeContext-basic", function()
635
- runset(get_spec(primary, "makeContext", "basic"), function(entry)
636
- local in_val = entry["in"]
637
- if type(in_val) == "table" then
638
- local ctx = utility.make_context(in_val, nil)
639
- local out = {
640
- id = ctx.id,
450
+ runsection("makeContext", function(vin)
451
+ if type(vin) ~= "table" then
452
+ return nil
453
+ end
454
+ local ctx = utility.make_context(vin, nil)
455
+ local out = {
456
+ id = ctx.id,
457
+ }
458
+ if ctx.op ~= nil then
459
+ out["op"] = {
460
+ name = ctx.op.name,
461
+ input = ctx.op.input,
641
462
  }
642
- if ctx.op ~= nil then
643
- out["op"] = {
644
- name = ctx.op.name,
645
- input = ctx.op.input,
646
- }
647
- end
648
- return out, nil
649
463
  end
650
- return nil, nil
464
+ return out
651
465
  end)
652
466
  end)
653
467
 
@@ -708,70 +522,58 @@ describe("PrimaryUtility", function()
708
522
 
709
523
 
710
524
  it("makeOptions-basic", function()
711
- runset(get_spec(primary, "makeOptions", "basic"), function(entry)
712
- local in_val = entry["in"]
713
- if type(in_val) ~= "table" then
714
- in_val = {}
525
+ runsection("makeOptions", function(vin)
526
+ if type(vin) ~= "table" then
527
+ vin = {}
715
528
  end
716
529
  local ctx = utility.make_context({
717
- options = in_val["options"],
718
- config = in_val["config"],
530
+ options = vin["options"],
531
+ config = vin["config"],
719
532
  }, nil)
720
533
  ctx.client = client
721
534
  ctx.utility = utility
722
- return utility.make_options(ctx), nil
535
+ return (utility.make_options(ctx))
723
536
  end)
724
537
  end)
725
538
 
726
539
 
727
540
  it("makeRequest-basic", function()
728
- runset(get_spec(primary, "makeRequest", "basic"), function(entry)
729
- local ctxmap = entry["ctx"]
730
- if type(ctxmap) ~= "table" then
731
- ctxmap = {}
541
+ runsection("makeRequest", function(cin)
542
+ if type(cin) ~= "table" then
543
+ cin = {}
732
544
  end
733
- local ctx = make_ctx_from_map(ctxmap, client, utility)
545
+ local ctx = make_ctx_from_map(cin, client, utility)
734
546
  ctx.options = client:options_map()
735
547
 
736
- local _, err = utility.make_request(ctx)
737
- if err ~= nil then
738
- return nil, err
739
- end
548
+ unwrap(utility.make_request(ctx))
740
549
 
741
- -- Update entry ctx for match checking
742
- local entry_ctx = entry["ctx"]
743
- if type(entry_ctx) == "table" then
744
- if ctx.response ~= nil then
745
- entry_ctx["response"] = "exists"
746
- end
747
- if ctx.result ~= nil then
748
- entry_ctx["result"] = "exists"
749
- end
550
+ -- Write live-context state back for match checking (the corpus
551
+ -- asserts `__EXISTS__`, so presence is what matters).
552
+ if ctx.response ~= nil then
553
+ cin["response"] = "exists"
554
+ end
555
+ if ctx.result ~= nil then
556
+ cin["result"] = "exists"
750
557
  end
751
558
 
752
- return nil, nil
559
+ return nil
753
560
  end)
754
561
  end)
755
562
 
756
563
 
757
564
  it("makeResponse-basic", function()
758
- runset(get_spec(primary, "makeResponse", "basic"), function(entry)
759
- local ctxmap = entry["ctx"]
760
- if type(ctxmap) ~= "table" then
761
- ctxmap = {}
565
+ runsection("makeResponse", function(cin)
566
+ if type(cin) ~= "table" then
567
+ cin = {}
762
568
  end
763
- local ctx = make_ctx_from_map(ctxmap, client, utility)
569
+ local ctx = make_ctx_from_map(cin, client, utility)
764
570
  fixctx(ctx, client)
765
571
 
766
- local _, err = utility.make_response(ctx)
767
- if err ~= nil then
768
- return nil, err
769
- end
572
+ unwrap(utility.make_response(ctx))
770
573
 
771
- -- Update entry ctx for match checking with result data
772
- local entry_ctx = entry["ctx"]
773
- if type(entry_ctx) == "table" and ctx.result ~= nil then
774
- entry_ctx["result"] = {
574
+ -- Write live-context result state back for match checking
575
+ if ctx.result ~= nil then
576
+ cin["result"] = {
775
577
  ok = ctx.result.ok,
776
578
  status = ctx.result.status,
777
579
  statusText = ctx.result.status_text,
@@ -780,7 +582,7 @@ describe("PrimaryUtility", function()
780
582
  }
781
583
  end
782
584
 
783
- return nil, nil
585
+ return nil
784
586
  end)
785
587
  end)
786
588
 
@@ -839,27 +641,22 @@ describe("PrimaryUtility", function()
839
641
 
840
642
 
841
643
  it("makeSpec-basic", function()
842
- local setup_opts = get_spec(primary, "makeSpec", "DEF", "setup", "a")
644
+ local setup_opts = omni.tostruct(get_spec(spec, "makeSpec", "DEF", "setup", "a"))
843
645
  local spec_client = sdk.test(nil, setup_opts)
844
646
  local spec_utility = spec_client:get_utility()
845
647
 
846
- runset(get_spec(primary, "makeSpec", "basic"), function(entry)
847
- local ctxmap = entry["ctx"]
848
- if type(ctxmap) ~= "table" then
849
- ctxmap = {}
648
+ runsection("makeSpec", function(cin)
649
+ if type(cin) ~= "table" then
650
+ cin = {}
850
651
  end
851
- local ctx = make_ctx_from_map(ctxmap, spec_client, spec_utility)
652
+ local ctx = make_ctx_from_map(cin, spec_client, spec_utility)
852
653
  ctx.options = spec_client:options_map()
853
654
 
854
- local _, err = utility.make_spec(ctx)
855
- if err ~= nil then
856
- return nil, err
857
- end
655
+ unwrap(utility.make_spec(ctx))
858
656
 
859
- -- Update entry ctx for match
860
- local entry_ctx = entry["ctx"]
861
- if type(entry_ctx) == "table" and ctx.spec ~= nil then
862
- entry_ctx["spec"] = {
657
+ -- Write live-context spec state back for match checking
658
+ if ctx.spec ~= nil then
659
+ cin["spec"] = {
863
660
  base = ctx.spec.base,
864
661
  prefix = ctx.spec.prefix,
865
662
  suffix = ctx.spec.suffix,
@@ -871,7 +668,7 @@ describe("PrimaryUtility", function()
871
668
  }
872
669
  end
873
670
 
874
- return nil, nil
671
+ return nil
875
672
  end)
876
673
  end)
877
674
 
@@ -896,175 +693,135 @@ describe("PrimaryUtility", function()
896
693
 
897
694
 
898
695
  it("makeUrl-basic", function()
899
- runset(get_spec(primary, "makeUrl", "basic"), function(entry)
900
- local ctxmap = entry["ctx"]
901
- if type(ctxmap) ~= "table" then
902
- ctxmap = {}
696
+ runsection("makeUrl", function(cin)
697
+ if type(cin) ~= "table" then
698
+ cin = {}
903
699
  end
904
- local ctx = make_ctx_from_map(ctxmap, client, utility)
700
+ local ctx = make_ctx_from_map(cin, client, utility)
905
701
  if ctx.result == nil then
906
702
  ctx.result = Result.new({})
907
703
  end
908
- return utility.make_url(ctx)
704
+ return unwrap(utility.make_url(ctx))
909
705
  end)
910
706
  end)
911
707
 
912
708
 
913
709
  it("operator-basic", function()
914
- runset(get_spec(primary, "operator", "basic"), function(entry)
915
- local in_val = entry["in"]
916
- if type(in_val) ~= "table" then
917
- in_val = {}
710
+ runsection("operator", function(vin)
711
+ if type(vin) ~= "table" then
712
+ vin = {}
918
713
  end
919
- local op = Operation.new(in_val)
714
+ local op = Operation.new(vin)
920
715
  return {
921
716
  entity = op.entity,
922
717
  name = op.name,
923
718
  input = op.input,
924
719
  points = op.points,
925
- }, nil
720
+ }
926
721
  end)
927
722
  end)
928
723
 
929
724
 
930
725
  it("param-basic", function()
931
- runset(get_spec(primary, "param", "basic"), function(entry)
932
- local args = entry["args"]
933
- if type(args) ~= "table" or #args < 2 then
934
- return nil, nil
935
- end
936
-
937
- local ctxmap = args[1]
938
- if type(ctxmap) ~= "table" then
939
- ctxmap = {}
726
+ runsection("param", function(cin, paramdef)
727
+ if type(cin) ~= "table" then
728
+ cin = {}
940
729
  end
941
- local ctx = make_ctx_from_map(ctxmap, client, utility)
942
- local paramdef = args[2]
730
+ local ctx = make_ctx_from_map(cin, client, utility)
943
731
 
944
732
  local result = utility.param(ctx, paramdef)
945
733
 
946
- -- Update entry ctx for match
947
- if type(entry["match"]) == "table" then
948
- local ctx_match = entry["match"]["ctx"]
949
- if type(ctx_match) == "table" then
950
- local entry_ctx = entry["ctx"]
951
- if entry_ctx == nil then
952
- entry_ctx = {}
953
- entry["ctx"] = entry_ctx
954
- end
955
- -- Copy spec alias back to entry ctx for matching
956
- local spec_match = ctx_match["spec"]
957
- if type(spec_match) == "table" then
958
- if ctx.spec ~= nil then
959
- if entry_ctx["spec"] == nil then
960
- entry_ctx["spec"] = {}
961
- end
962
- local alias_match = spec_match["alias"]
963
- if type(alias_match) == "table" then
964
- entry_ctx["spec"] = {
965
- alias = ctx.spec.alias,
966
- }
967
- end
968
- end
969
- end
734
+ -- Write spec alias back for `match: {ctx: {spec: {alias: ...}}}`
735
+ if ctx.spec ~= nil and ctx.spec.alias ~= nil then
736
+ if type(cin["spec"]) ~= "table" then
737
+ cin["spec"] = {}
970
738
  end
739
+ cin["spec"]["alias"] = ctx.spec.alias
971
740
  end
972
741
 
973
- return result, nil
742
+ return result
974
743
  end)
975
744
  end)
976
745
 
977
746
 
978
747
  it("prepareAuth-basic", function()
979
- local setup_opts = get_spec(primary, "prepareAuth", "DEF", "setup", "a")
748
+ local setup_opts = omni.tostruct(get_spec(spec, "prepareAuth", "DEF", "setup", "a"))
980
749
  local auth_client = sdk.test(nil, setup_opts)
981
750
  local auth_utility = auth_client:get_utility()
982
751
 
983
- runset(get_spec(primary, "prepareAuth", "basic"), function(entry)
984
- local ctxmap = entry["ctx"]
985
- if type(ctxmap) ~= "table" then
986
- ctxmap = {}
752
+ runsection("prepareAuth", function(cin)
753
+ if type(cin) ~= "table" then
754
+ cin = {}
987
755
  end
988
- local ctx = make_ctx_from_map(ctxmap, auth_client, auth_utility)
756
+ local ctx = make_ctx_from_map(cin, auth_client, auth_utility)
989
757
  fixctx(ctx, auth_client)
990
758
 
991
- local _, err = utility.prepare_auth(ctx)
992
- if err ~= nil then
993
- return nil, err
994
- end
759
+ unwrap(utility.prepare_auth(ctx))
995
760
 
996
- -- Update entry ctx for match
997
- local entry_ctx = entry["ctx"]
998
- if type(entry_ctx) == "table" and ctx.spec ~= nil then
999
- entry_ctx["spec"] = {
761
+ -- Write live-context spec headers back for match checking
762
+ if ctx.spec ~= nil then
763
+ cin["spec"] = {
1000
764
  headers = ctx.spec.headers,
1001
765
  }
1002
766
  end
1003
767
 
1004
- return nil, nil
768
+ return nil
1005
769
  end)
1006
770
  end)
1007
771
 
1008
772
 
1009
773
  it("prepareBody-basic", function()
1010
- runset(get_spec(primary, "prepareBody", "basic"), function(entry)
1011
- local ctxmap = entry["ctx"]
1012
- if type(ctxmap) ~= "table" then
1013
- ctxmap = {}
774
+ runsection("prepareBody", function(cin)
775
+ if type(cin) ~= "table" then
776
+ cin = {}
1014
777
  end
1015
- local ctx = make_ctx_from_map(ctxmap, client, utility)
778
+ local ctx = make_ctx_from_map(cin, client, utility)
1016
779
  fixctx(ctx, client)
1017
- return utility.prepare_body(ctx), nil
780
+ return (utility.prepare_body(ctx))
1018
781
  end)
1019
782
  end)
1020
783
 
1021
784
 
1022
785
  it("prepareHeaders-basic", function()
1023
- runset(get_spec(primary, "prepareHeaders", "basic"), function(entry)
1024
- local ctxmap = entry["ctx"]
1025
- if type(ctxmap) ~= "table" then
1026
- ctxmap = {}
786
+ runsection("prepareHeaders", function(cin)
787
+ if type(cin) ~= "table" then
788
+ cin = {}
1027
789
  end
1028
- local ctx = make_ctx_from_map(ctxmap, client, utility)
1029
- return utility.prepare_headers(ctx), nil
790
+ local ctx = make_ctx_from_map(cin, client, utility)
791
+ return (utility.prepare_headers(ctx))
1030
792
  end)
1031
793
  end)
1032
794
 
1033
795
 
1034
796
  it("prepareMethod-basic", function()
1035
- runset(get_spec(primary, "prepareMethod", "basic"), function(entry)
1036
- local ctxmap = entry["ctx"]
1037
- if type(ctxmap) ~= "table" then
1038
- ctxmap = {}
797
+ runsection("prepareMethod", function(cin)
798
+ if type(cin) ~= "table" then
799
+ cin = {}
1039
800
  end
1040
- local ctx = make_ctx_from_map(ctxmap, client, utility)
1041
- return utility.prepare_method(ctx), nil
801
+ local ctx = make_ctx_from_map(cin, client, utility)
802
+ return (utility.prepare_method(ctx))
1042
803
  end)
1043
804
  end)
1044
805
 
1045
806
 
1046
807
  it("prepareParams-basic", function()
1047
- runset(get_spec(primary, "prepareParams", "basic"), function(entry)
1048
- local ctxmap = entry["ctx"]
1049
- if type(ctxmap) ~= "table" then
1050
- ctxmap = {}
808
+ runsection("prepareParams", function(cin)
809
+ if type(cin) ~= "table" then
810
+ cin = {}
1051
811
  end
1052
- local ctx = make_ctx_from_map(ctxmap, client, utility)
1053
- return utility.prepare_params(ctx), nil
812
+ local ctx = make_ctx_from_map(cin, client, utility)
813
+ return (utility.prepare_params(ctx))
1054
814
  end)
1055
815
  end)
1056
816
 
1057
817
 
1058
818
  it("preparePath-basic", function()
1059
- -- Was hand-written cases that had drifted out of the shared corpus
1060
- -- (the preparePath fixture shipped as an empty `set: []`).
1061
- runset(get_spec(primary, "preparePath", "basic"), function(entry)
1062
- local ctxmap = entry["ctx"]
1063
- if type(ctxmap) ~= "table" then
1064
- ctxmap = {}
819
+ runsection("preparePath", function(cin)
820
+ if type(cin) ~= "table" then
821
+ cin = {}
1065
822
  end
1066
- local ctx = make_ctx_from_map(ctxmap, client, utility)
1067
- return utility.prepare_path(ctx), nil
823
+ local ctx = make_ctx_from_map(cin, client, utility)
824
+ return (utility.prepare_path(ctx))
1068
825
  end)
1069
826
  end)
1070
827
 
@@ -1082,24 +839,22 @@ describe("PrimaryUtility", function()
1082
839
 
1083
840
 
1084
841
  it("prepareQuery-basic", function()
1085
- runset(get_spec(primary, "prepareQuery", "basic"), function(entry)
1086
- local ctxmap = entry["ctx"]
1087
- if type(ctxmap) ~= "table" then
1088
- ctxmap = {}
842
+ runsection("prepareQuery", function(cin)
843
+ if type(cin) ~= "table" then
844
+ cin = {}
1089
845
  end
1090
- local ctx = make_ctx_from_map(ctxmap, client, utility)
1091
- return utility.prepare_query(ctx), nil
846
+ local ctx = make_ctx_from_map(cin, client, utility)
847
+ return (utility.prepare_query(ctx))
1092
848
  end)
1093
849
  end)
1094
850
 
1095
851
 
1096
852
  it("resultBasic-basic", function()
1097
- runset(get_spec(primary, "resultBasic", "basic"), function(entry)
1098
- local ctxmap = entry["ctx"]
1099
- if type(ctxmap) ~= "table" then
1100
- ctxmap = {}
853
+ runsection("resultBasic", function(cin)
854
+ if type(cin) ~= "table" then
855
+ cin = {}
1101
856
  end
1102
- local ctx = make_ctx_from_map(ctxmap, client, utility)
857
+ local ctx = make_ctx_from_map(cin, client, utility)
1103
858
  fixctx(ctx, client)
1104
859
 
1105
860
  local result = utility.result_basic(ctx)
@@ -1118,101 +873,87 @@ describe("PrimaryUtility", function()
1118
873
  }
1119
874
  end
1120
875
 
1121
- return out, nil
876
+ return out
1122
877
  end)
1123
878
  end)
1124
879
 
1125
880
 
1126
881
  it("resultBody-basic", function()
1127
- runset(get_spec(primary, "resultBody", "basic"), function(entry)
1128
- local ctxmap = entry["ctx"]
1129
- if type(ctxmap) ~= "table" then
1130
- ctxmap = {}
882
+ runsection("resultBody", function(cin)
883
+ if type(cin) ~= "table" then
884
+ cin = {}
1131
885
  end
1132
- local ctx = make_ctx_from_map(ctxmap, client, utility)
886
+ local ctx = make_ctx_from_map(cin, client, utility)
1133
887
 
1134
888
  utility.result_body(ctx)
1135
889
 
1136
- -- Update entry ctx for match
1137
- local entry_ctx = entry["ctx"]
1138
- if type(entry_ctx) == "table" and ctx.result ~= nil then
1139
- entry_ctx["result"] = {
890
+ -- Write live-context result state back for match checking
891
+ if ctx.result ~= nil then
892
+ cin["result"] = {
1140
893
  body = ctx.result.body,
1141
894
  }
1142
895
  end
1143
896
 
1144
- return nil, nil
897
+ return nil
1145
898
  end)
1146
899
  end)
1147
900
 
1148
901
 
1149
902
  it("resultHeaders-basic", function()
1150
- runset(get_spec(primary, "resultHeaders", "basic"), function(entry)
1151
- local ctxmap = entry["ctx"]
1152
- if type(ctxmap) ~= "table" then
1153
- ctxmap = {}
903
+ runsection("resultHeaders", function(cin)
904
+ if type(cin) ~= "table" then
905
+ cin = {}
1154
906
  end
1155
- local ctx = make_ctx_from_map(ctxmap, client, utility)
907
+ local ctx = make_ctx_from_map(cin, client, utility)
1156
908
 
1157
909
  utility.result_headers(ctx)
1158
910
 
1159
- -- Update entry ctx for match
1160
- local entry_ctx = entry["ctx"]
1161
- if type(entry_ctx) == "table" and ctx.result ~= nil then
1162
- entry_ctx["result"] = {
911
+ -- Write live-context result state back for match checking
912
+ if ctx.result ~= nil then
913
+ cin["result"] = {
1163
914
  headers = ctx.result.headers,
1164
915
  }
1165
916
  end
1166
917
 
1167
- return nil, nil
918
+ return nil
1168
919
  end)
1169
920
  end)
1170
921
 
1171
922
 
1172
923
  it("transformRequest-basic", function()
1173
- runset(get_spec(primary, "transformRequest", "basic"), function(entry)
1174
- local ctxmap = entry["ctx"]
1175
- if type(ctxmap) ~= "table" then
1176
- ctxmap = {}
924
+ runsection("transformRequest", function(cin)
925
+ if type(cin) ~= "table" then
926
+ cin = {}
1177
927
  end
1178
- local ctx = make_ctx_from_map(ctxmap, client, utility)
928
+ local ctx = make_ctx_from_map(cin, client, utility)
1179
929
 
1180
930
  local result = utility.transform_request(ctx)
1181
931
 
1182
- -- Update entry ctx for match (step changed)
1183
- local entry_ctx = entry["ctx"]
1184
- if type(entry_ctx) == "table" and ctx.spec ~= nil then
1185
- local spec_map = entry_ctx["spec"]
1186
- if type(spec_map) == "table" then
1187
- spec_map["step"] = ctx.spec.step
1188
- end
932
+ -- Write the step change back for match checking
933
+ if ctx.spec ~= nil and type(cin["spec"]) == "table" then
934
+ cin["spec"]["step"] = ctx.spec.step
1189
935
  end
1190
936
 
1191
- return result, nil
937
+ return result
1192
938
  end)
1193
939
  end)
1194
940
 
1195
941
 
1196
942
  it("transformResponse-basic", function()
1197
- runset(get_spec(primary, "transformResponse", "basic"), function(entry)
1198
- local ctxmap = entry["ctx"]
1199
- if type(ctxmap) ~= "table" then
1200
- ctxmap = {}
943
+ runsection("transformResponse", function(cin)
944
+ if type(cin) ~= "table" then
945
+ cin = {}
1201
946
  end
1202
- local ctx = make_ctx_from_map(ctxmap, client, utility)
947
+ local ctx = make_ctx_from_map(cin, client, utility)
1203
948
 
1204
949
  local result = utility.transform_response(ctx)
1205
950
 
1206
- -- Update entry ctx for match (step changed)
1207
- local entry_ctx = entry["ctx"]
1208
- if type(entry_ctx) == "table" and ctx.spec ~= nil then
1209
- local spec_map = entry_ctx["spec"]
1210
- if type(spec_map) == "table" then
1211
- spec_map["step"] = ctx.spec.step
1212
- end
951
+ -- Write the step change back for match checking
952
+ if ctx.spec ~= nil and type(cin["spec"]) == "table" then
953
+ cin["spec"]["step"] = ctx.spec.step
1213
954
  end
1214
955
 
1215
- return result, nil
956
+ return result
1216
957
  end)
1217
958
  end)
1218
959