@voxgig/sdkgen 4.8.2 → 4.8.3

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 (376) 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/src/cmp/clojure/Package_clojure.ts +9 -2
  33. package/project/.sdk/src/cmp/cpp/Gitignore_cpp.ts +3 -0
  34. package/project/.sdk/src/cmp/dart/Test_dart.ts +2 -0
  35. package/project/.sdk/src/cmp/elixir/Package_elixir.ts +4 -1
  36. package/project/.sdk/src/cmp/go/Config_go.ts +59 -2
  37. package/project/.sdk/src/cmp/go/Main_go.ts +8 -2
  38. package/project/.sdk/src/cmp/java/Test_java.ts +6 -5
  39. package/project/.sdk/src/cmp/kotlin/Test_kotlin.ts +6 -5
  40. package/project/.sdk/src/cmp/lean/Package_lean.ts +23 -0
  41. package/project/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +1 -0
  42. package/project/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +1 -0
  43. package/project/.sdk/src/cmp/ocaml/Gitignore_ocaml.ts +1 -0
  44. package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +7 -3
  45. package/project/.sdk/src/cmp/py/Config_py.ts +82 -1
  46. package/project/.sdk/src/cmp/py/Main_py.ts +44 -0
  47. package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +2 -0
  48. package/project/.sdk/src/cmp/swift/Main_swift.ts +10 -0
  49. package/project/.sdk/src/cmp/swift/Package_swift.ts +13 -1
  50. package/project/.sdk/src/cmp/ts/Config_ts.ts +42 -17
  51. package/project/.sdk/src/cmp/ts/fragment/Config.data.fragment.ts +13 -1
  52. package/project/.sdk/src/cmp/ts/fragment/Config.fragment.ts +13 -1
  53. package/project/.sdk/tm/c/Makefile +38 -3
  54. package/project/.sdk/tm/c/tests/omni_resolver.h +361 -0
  55. package/project/.sdk/tm/c/tests/omni_smoke_test.c +237 -0
  56. package/project/.sdk/tm/c/tests/primary_corpus_test.c +205 -284
  57. package/project/.sdk/tm/c/tests/struct_corpus_test.c +292 -212
  58. package/project/.sdk/tm/c/tests/vendor/omni/json.c +811 -0
  59. package/project/.sdk/tm/c/tests/vendor/omni/omni.h +240 -0
  60. package/project/.sdk/tm/c/tests/vendor/omni/runner.c +940 -0
  61. package/project/.sdk/tm/c/tests/vendor/omni/util.c +351 -0
  62. package/project/.sdk/tm/c/utility/struct/utility.c +7 -2
  63. package/project/.sdk/tm/clojure/test/sdk/test/omni.clj +401 -0
  64. package/project/.sdk/tm/clojure/test/sdk/test/omni_smoke.clj +81 -0
  65. package/project/.sdk/tm/clojure/test/sdk/test/primary.clj +92 -58
  66. package/project/.sdk/tm/clojure/test/sdk/test/struct_corpus.clj +122 -149
  67. package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +8 -3
  68. package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/json.clj +145 -0
  69. package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/runner.clj +445 -0
  70. package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/util.clj +145 -0
  71. package/project/.sdk/tm/cpp/Makefile +5 -1
  72. package/project/.sdk/tm/cpp/test/omni_resolver.hpp +473 -0
  73. package/project/.sdk/tm/cpp/test/omni_smoke_test.cpp +209 -0
  74. package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +243 -184
  75. package/project/.sdk/tm/cpp/test/runner_support.hpp +68 -181
  76. package/project/.sdk/tm/cpp/test/struct_corpus_test.cpp +183 -56
  77. package/project/.sdk/tm/cpp/test/vendor/omni/json.hpp +406 -0
  78. package/project/.sdk/tm/cpp/test/vendor/omni/omni.hpp +751 -0
  79. package/project/.sdk/tm/cpp/test/vendor/omni/util.hpp +256 -0
  80. package/project/.sdk/tm/cpp/utility/pipeline.hpp +7 -1
  81. package/project/.sdk/tm/csharp/test/OmniResolver.cs +491 -0
  82. package/project/.sdk/tm/csharp/test/OmniSmokeTest.cs +106 -0
  83. package/project/.sdk/tm/csharp/test/PrimaryUtilityTest.cs +299 -316
  84. package/project/.sdk/tm/csharp/test/Runner.cs +104 -269
  85. package/project/.sdk/tm/csharp/test/StructUtilityTest.cs +535 -724
  86. package/project/.sdk/tm/csharp/test/vendor/omni/Runner.cs +864 -0
  87. package/project/.sdk/tm/csharp/test/vendor/omni/Util.cs +347 -0
  88. package/project/.sdk/tm/csharp/utility/MakeSpec.cs +3 -1
  89. package/project/.sdk/tm/csharp/utility/PrepareMethod.cs +6 -1
  90. package/project/.sdk/tm/csharp/utility/struct/Struct.cs +21 -5
  91. package/project/.sdk/tm/dart/test/omni.dart +520 -0
  92. package/project/.sdk/tm/dart/test/omni_smoke_test.dart +143 -0
  93. package/project/.sdk/tm/dart/test/primary_test.dart +86 -28
  94. package/project/.sdk/tm/dart/test/struct_test.dart +438 -11
  95. package/project/.sdk/tm/dart/test/vendor/omni/omni.dart +7 -0
  96. package/project/.sdk/tm/dart/test/vendor/omni/runner.dart +653 -0
  97. package/project/.sdk/tm/dart/test/vendor/omni/util.dart +232 -0
  98. package/project/.sdk/tm/elixir/Makefile +11 -3
  99. package/project/.sdk/tm/elixir/test/omni_smoke_test.exs +117 -0
  100. package/project/.sdk/tm/elixir/test/primary_utility_test.exs +341 -16
  101. package/project/.sdk/tm/elixir/test/struct_corpus_test.exs +554 -9
  102. package/project/.sdk/tm/elixir/test/support/omni.ex +377 -0
  103. package/project/.sdk/tm/elixir/test/vendor/omni/json.ex +122 -0
  104. package/project/.sdk/tm/elixir/test/vendor/omni/runner.ex +623 -0
  105. package/project/.sdk/tm/elixir/test/vendor/omni/util.ex +187 -0
  106. package/project/.sdk/tm/go/core/context.go +32 -16
  107. package/project/.sdk/tm/go/feature/secrets/plugin/capability.go +261 -0
  108. package/project/.sdk/tm/go/feature/secrets/plugin/catalog.go +78 -0
  109. package/project/.sdk/tm/go/feature/secrets/plugin/config.go +652 -0
  110. package/project/.sdk/tm/go/feature/secrets/plugin/depend.go +250 -0
  111. package/project/.sdk/tm/go/feature/secrets/plugin/env.go +194 -0
  112. package/project/.sdk/tm/go/feature/secrets/plugin/export.go +80 -0
  113. package/project/.sdk/tm/go/feature/secrets/plugin/graph.go +238 -0
  114. package/project/.sdk/tm/go/feature/secrets/plugin/host.go +1575 -0
  115. package/project/.sdk/tm/go/feature/secrets/plugin/order.go +248 -0
  116. package/project/.sdk/tm/go/feature/secrets/plugin/point.go +184 -0
  117. package/project/.sdk/tm/go/feature/secrets/plugin/ref.go +123 -0
  118. package/project/.sdk/tm/go/feature/secrets/plugin/resolve.go +79 -0
  119. package/project/.sdk/tm/go/feature/secrets/plugin/types.go +296 -0
  120. package/project/.sdk/tm/go/feature/secrets/plugin/util.go +87 -0
  121. package/project/.sdk/tm/go/feature/secrets/plugin/version.go +161 -0
  122. package/project/.sdk/tm/go/feature/secrets/plugins/aws/aws.go +292 -0
  123. package/project/.sdk/tm/go/feature/secrets/plugins/aws/sigv4.go +201 -0
  124. package/project/.sdk/tm/go/feature/secrets/plugins/azuresecrets/azuresecrets.go +187 -0
  125. package/project/.sdk/tm/go/feature/secrets/plugins/boru/boru.go +184 -0
  126. package/project/.sdk/tm/go/feature/secrets/plugins/doppler/doppler.go +114 -0
  127. package/project/.sdk/tm/go/feature/secrets/plugins/gcpsecrets/gcpsecrets.go +156 -0
  128. package/project/.sdk/tm/go/feature/secrets/plugins/hashicorp/hashicorp.go +209 -0
  129. package/project/.sdk/tm/go/feature/secrets/plugins/httpjson/httpjson.go +241 -0
  130. package/project/.sdk/tm/go/feature/secrets/plugins/infisical/infisical.go +151 -0
  131. package/project/.sdk/tm/go/feature/secrets/plugins/onepassword/onepassword.go +152 -0
  132. package/project/.sdk/tm/go/feature/secrets/plugins/secretspec/secretspec.go +143 -0
  133. package/project/.sdk/tm/go/feature/secrets/sekreto/addr.go +120 -0
  134. package/project/.sdk/tm/go/feature/secrets/sekreto/providers.go +439 -0
  135. package/project/.sdk/tm/go/feature/secrets/sekreto/sekreto.go +685 -0
  136. package/project/.sdk/tm/go/feature/secrets_feature.go +675 -0
  137. package/project/.sdk/tm/go/src/feature/secrets/.gitkeep +0 -0
  138. package/project/.sdk/tm/go/test/feature/secrets/secrets_feature_test.go +799 -0
  139. package/project/.sdk/tm/go/test/omni/omni.go +897 -0
  140. package/project/.sdk/tm/go/test/omni/util.go +360 -0
  141. package/project/.sdk/tm/go/test/omniresolver_test.go +748 -0
  142. package/project/.sdk/tm/go/test/omnismoke_test.go +112 -0
  143. package/project/.sdk/tm/go/test/primary_utility_test.go +123 -191
  144. package/project/.sdk/tm/go/test/struct_utility_test.go +323 -16
  145. package/project/.sdk/tm/go/test/testsupport_test.go +294 -0
  146. package/project/.sdk/tm/go/utility/make_options.go +8 -1
  147. package/project/.sdk/tm/go/utility/prepare_method.go +5 -1
  148. package/project/.sdk/tm/go/utility/struct/voxgigstruct.go +2 -2
  149. package/project/.sdk/tm/java/test/OmniResolver.java +355 -0
  150. package/project/.sdk/tm/java/test/OmniSmokeTest.java +99 -0
  151. package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +254 -280
  152. package/project/.sdk/tm/java/test/RunnerSupport.java +9 -194
  153. package/project/.sdk/tm/java/test/StructCorpusTest.java +119 -42
  154. package/project/.sdk/tm/java/test/vendor/omni/Json.java +287 -0
  155. package/project/.sdk/tm/java/test/vendor/omni/Runner.java +851 -0
  156. package/project/.sdk/tm/java/test/vendor/omni/Util.java +322 -0
  157. package/project/.sdk/tm/java/utility/MakeSpec.java +3 -1
  158. package/project/.sdk/tm/java/utility/PrepareMethod.java +5 -5
  159. package/project/.sdk/tm/java/utility/struct/Struct.java +17 -4
  160. package/project/.sdk/tm/js/src/utility/StructUtility.js +3 -3
  161. package/project/.sdk/tm/js/test/omni.js +251 -0
  162. package/project/.sdk/tm/js/test/omni.test.js +105 -0
  163. package/project/.sdk/tm/js/test/utility/PrimaryUtility.test.js +6 -2
  164. package/project/.sdk/tm/js/test/utility/StructUtility.test.js +27 -2
  165. package/project/.sdk/tm/js/test/vendor/omni/index.js +77 -0
  166. package/project/.sdk/tm/js/test/vendor/omni/runner.js +613 -0
  167. package/project/.sdk/tm/js/test/vendor/omni/util.js +212 -0
  168. package/project/.sdk/tm/kotlin/core/Utility.kt +1 -1
  169. package/project/.sdk/tm/kotlin/test/OmniResolver.kt +343 -0
  170. package/project/.sdk/tm/kotlin/test/OmniSmokeTest.kt +100 -0
  171. package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +244 -262
  172. package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +9 -178
  173. package/project/.sdk/tm/kotlin/test/StructCorpusTest.kt +121 -32
  174. package/project/.sdk/tm/kotlin/test/vendor/omni/Json.kt +264 -0
  175. package/project/.sdk/tm/kotlin/test/vendor/omni/Runner.kt +615 -0
  176. package/project/.sdk/tm/kotlin/test/vendor/omni/Util.kt +139 -0
  177. package/project/.sdk/tm/kotlin/utility/MakeSpecUrl.kt +6 -3
  178. package/project/.sdk/tm/kotlin/utility/Prepare.kt +6 -6
  179. package/project/.sdk/tm/kotlin/utility/struct/Struct.kt +18 -2
  180. package/project/.sdk/tm/lean/Makefile +12 -5
  181. package/project/.sdk/tm/lean/src/SdkUtility.lean +14 -1
  182. package/project/.sdk/tm/lean/test/OmniResolver.lean +358 -0
  183. package/project/.sdk/tm/lean/test/OmniSmoke.lean +174 -0
  184. package/project/.sdk/tm/lean/test/StructCorpus.lean +245 -574
  185. package/project/.sdk/tm/lean/test/TPrimaryUtility.lean +155 -291
  186. package/project/.sdk/tm/lean/test/vendor/omni/Omni.lean +997 -0
  187. package/project/.sdk/tm/lua/test/omni.lua +456 -0
  188. package/project/.sdk/tm/lua/test/omni_smoke_test.lua +103 -0
  189. package/project/.sdk/tm/lua/test/primary_utility_test.lua +250 -509
  190. package/project/.sdk/tm/lua/test/struct_utility_test.lua +161 -70
  191. package/project/.sdk/tm/lua/test/vendor/omni/json.lua +268 -0
  192. package/project/.sdk/tm/lua/test/vendor/omni/regex.lua +385 -0
  193. package/project/.sdk/tm/lua/test/vendor/omni/runner.lua +641 -0
  194. package/project/.sdk/tm/lua/test/vendor/omni/util.lua +282 -0
  195. package/project/.sdk/tm/lua/utility/prepare_method.lua +5 -1
  196. package/project/.sdk/tm/lua/utility/struct/regex.lua +663 -0
  197. package/project/.sdk/tm/lua/utility/struct/struct.lua +660 -420
  198. package/project/.sdk/tm/ocaml/Makefile +37 -12
  199. package/project/.sdk/tm/ocaml/test/omni_resolver.ml +284 -0
  200. package/project/.sdk/tm/ocaml/test/omni_smoke_test.ml +169 -0
  201. package/project/.sdk/tm/ocaml/test/primary_utility_test.ml +84 -100
  202. package/project/.sdk/tm/ocaml/test/struct_corpus.ml +225 -201
  203. package/project/.sdk/tm/ocaml/test/vendor/omni/omni.ml +1157 -0
  204. package/project/.sdk/tm/perl/lib/Voxgig/Struct.pm +88 -12
  205. package/project/.sdk/tm/perl/t/omni.pm +647 -0
  206. package/project/.sdk/tm/perl/t/omni_smoke.t +87 -0
  207. package/project/.sdk/tm/perl/t/primary_utility.t +189 -487
  208. package/project/.sdk/tm/perl/t/struct_utility.t +455 -389
  209. package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Runner.pm +649 -0
  210. package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Util.pm +253 -0
  211. package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni.pm +24 -0
  212. package/project/.sdk/tm/perl/utility/prepare_method.pm +7 -2
  213. package/project/.sdk/tm/php/test/Omni.php +691 -0
  214. package/project/.sdk/tm/php/test/OmniSmokeTest.php +93 -0
  215. package/project/.sdk/tm/php/test/PrimaryUtilityTest.php +210 -571
  216. package/project/.sdk/tm/php/test/StructUtilityTest.php +320 -342
  217. package/project/.sdk/tm/php/test/vendor/omni/Runner.php +644 -0
  218. package/project/.sdk/tm/php/test/vendor/omni/Util.php +283 -0
  219. package/project/.sdk/tm/php/utility/MakeSpec.php +10 -3
  220. package/project/.sdk/tm/php/utility/PrepareBody.php +7 -1
  221. package/project/.sdk/tm/php/utility/PrepareMethod.php +6 -2
  222. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/__init__.py +36 -0
  223. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/capability.py +141 -0
  224. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/catalog.py +50 -0
  225. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/config.py +333 -0
  226. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/depend.py +198 -0
  227. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/env.py +147 -0
  228. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/export.py +52 -0
  229. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/graph.py +139 -0
  230. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/host.py +1053 -0
  231. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/order.py +171 -0
  232. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/point.py +95 -0
  233. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/ref.py +116 -0
  234. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/resolve.py +59 -0
  235. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/types.py +87 -0
  236. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/version.py +112 -0
  237. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/__init__.py +74 -0
  238. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/addr.py +116 -0
  239. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/aws.py +192 -0
  240. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/azuresecrets.py +120 -0
  241. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/boru.py +140 -0
  242. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/doppler.py +62 -0
  243. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/gcpsecrets.py +101 -0
  244. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/hashicorp.py +152 -0
  245. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/httpjson.py +115 -0
  246. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/infisical.py +92 -0
  247. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/onepassword.py +101 -0
  248. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/secretspec.py +119 -0
  249. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/sigv4.py +125 -0
  250. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/providers.py +211 -0
  251. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/sekreto.py +455 -0
  252. package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +467 -0
  253. package/project/.sdk/tm/py/pkg/utility/prepare_method.py +5 -1
  254. package/project/.sdk/tm/py/pkg/utility/voxgig_struct/__init__.py +0 -2
  255. package/project/.sdk/tm/py/pkg/utility/voxgig_struct/voxgig_struct.py +780 -529
  256. package/project/.sdk/tm/py/src/feature/secrets/.gitkeep +0 -0
  257. package/project/.sdk/tm/py/test/feature/__init__.py +0 -0
  258. package/project/.sdk/tm/py/test/feature/secrets/__init__.py +0 -0
  259. package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +337 -0
  260. package/project/.sdk/tm/py/test/omni.py +415 -0
  261. package/project/.sdk/tm/py/test/test_omni_smoke.py +74 -0
  262. package/project/.sdk/tm/py/test/test_primary_utility.py +144 -668
  263. package/project/.sdk/tm/py/test/test_struct_utility.py +74 -27
  264. package/project/.sdk/tm/py/test/voxgig_omni/__init__.py +62 -0
  265. package/project/.sdk/tm/py/test/voxgig_omni/runner.py +566 -0
  266. package/project/.sdk/tm/py/test/voxgig_omni/util.py +237 -0
  267. package/project/.sdk/tm/rb/test/omni.rb +505 -0
  268. package/project/.sdk/tm/rb/test/omni_smoke_test.rb +72 -0
  269. package/project/.sdk/tm/rb/test/primary_utility_test.rb +174 -560
  270. package/project/.sdk/tm/rb/test/struct_utility_test.rb +13 -7
  271. package/project/.sdk/tm/rb/test/vendor/omni/runner.rb +493 -0
  272. package/project/.sdk/tm/rb/test/vendor/omni/util.rb +199 -0
  273. package/project/.sdk/tm/rb/test/vendor/omni/voxgig_omni.rb +15 -0
  274. package/project/.sdk/tm/rb/utility/prepare_method.rb +5 -1
  275. package/project/.sdk/tm/rust/tests/common/mod.rs +19 -242
  276. package/project/.sdk/tm/rust/tests/omni_resolver/mod.rs +888 -0
  277. package/project/.sdk/tm/rust/tests/omni_smoke_test.rs +286 -0
  278. package/project/.sdk/tm/rust/tests/primary_utility_test.rs +318 -312
  279. package/project/.sdk/tm/rust/tests/struct_utility_test.rs +66 -28
  280. package/project/.sdk/tm/rust/tests/vendor/omni/json.rs +412 -0
  281. package/project/.sdk/tm/rust/tests/vendor/omni/mod.rs +38 -0
  282. package/project/.sdk/tm/rust/tests/vendor/omni/regex.rs +392 -0
  283. package/project/.sdk/tm/rust/tests/vendor/omni/runner.rs +1001 -0
  284. package/project/.sdk/tm/rust/tests/vendor/omni/util.rs +161 -0
  285. package/project/.sdk/tm/rust/utility/prepare_method.rs +5 -1
  286. package/project/.sdk/tm/scala/Makefile +16 -6
  287. package/project/.sdk/tm/scala/sdktest/OmniResolver.scala +497 -0
  288. package/project/.sdk/tm/scala/sdktest/OmniSmoke.scala +192 -0
  289. package/project/.sdk/tm/scala/sdktest/PrimaryCorpus.scala +47 -19
  290. package/project/.sdk/tm/scala/sdktest/StructCorpus.scala +0 -0
  291. package/project/.sdk/tm/scala/sdktest/vendor/omni/Json.scala +229 -0
  292. package/project/.sdk/tm/scala/sdktest/vendor/omni/Runner.scala +552 -0
  293. package/project/.sdk/tm/scala/sdktest/vendor/omni/Util.scala +104 -0
  294. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Constants.swift +10 -0
  295. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Inject.swift +28 -5
  296. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Injection.swift +5 -1
  297. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Minor.swift +4 -1
  298. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Validate.swift +15 -5
  299. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Prepare.swift +6 -1
  300. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniResolver.swift +474 -0
  301. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniSmokeTest.swift +107 -0
  302. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +141 -178
  303. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/Runner.swift +17 -113
  304. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/StructUtilityTest.swift +295 -446
  305. package/project/.sdk/tm/swift/Tests/vendor/omni/Json.swift +364 -0
  306. package/project/.sdk/tm/swift/Tests/vendor/omni/Runner.swift +730 -0
  307. package/project/.sdk/tm/swift/Tests/vendor/omni/Util.swift +162 -0
  308. package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +7 -0
  309. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Capability.ts +148 -0
  310. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Catalog.ts +55 -0
  311. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Config.ts +344 -0
  312. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Depend.ts +205 -0
  313. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Env.ts +138 -0
  314. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Export.ts +46 -0
  315. package/project/.sdk/tm/ts/src/feature/secrets/plugin/FeatureHost.ts +349 -0
  316. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Graph.ts +181 -0
  317. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Host.ts +1132 -0
  318. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Order.ts +177 -0
  319. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Point.ts +119 -0
  320. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Ref.ts +102 -0
  321. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Resolve.ts +61 -0
  322. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Types.ts +112 -0
  323. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Version.ts +100 -0
  324. package/project/.sdk/tm/ts/src/feature/secrets/plugin/index.ts +37 -0
  325. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/Sekreto.ts +163 -30
  326. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/index.ts +27 -22
  327. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/aws.ts +26 -36
  328. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/azuresecrets.ts +19 -21
  329. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/boru.ts +36 -17
  330. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/doppler.ts +14 -21
  331. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/gcpsecrets.ts +27 -27
  332. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/hashicorp.ts +25 -39
  333. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/httpjson.ts +99 -0
  334. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/infisical.ts +14 -16
  335. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/onepassword.ts +15 -22
  336. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/secretspec.ts +98 -0
  337. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{Sigv4.ts → plugins/sigv4.ts} +7 -6
  338. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/addr.ts +97 -23
  339. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/builtin.ts +37 -0
  340. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/dotenv.ts +4 -17
  341. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/env.ts +4 -16
  342. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/file.ts +11 -25
  343. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/memory.ts +6 -23
  344. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/support.ts +106 -39
  345. package/project/.sdk/tm/ts/src/utility/StructUtility.ts +3 -3
  346. package/project/.sdk/tm/ts/test/omni.ts +104 -32
  347. package/project/.sdk/tm/ts/test/utility/StructUtility.test.ts +27 -0
  348. package/project/.sdk/tm/ts/test/vendor/omni/Runner.ts +32 -5
  349. package/project/.sdk/tm/ts/test/vendor/omni/Util.ts +2 -2
  350. package/project/.sdk/tm/ts/test/vendor/omni/index.ts +2 -2
  351. package/project/.sdk/tm/zig/test/primary_utility_test.zig +1 -1
  352. package/project/.sdk/tm/zig/test/struct_runner.zig +5 -4
  353. package/project/sdkgen-package.json +1 -1
  354. package/src/action/doctor.ts +66 -2
  355. package/src/helpers/naming.ts +4 -2
  356. package/project/.sdk/tm/c/tests/runner.h +0 -274
  357. package/project/.sdk/tm/cpp/test/struct_runner.hpp +0 -314
  358. package/project/.sdk/tm/csharp/test/StructRunner.cs +0 -276
  359. package/project/.sdk/tm/dart/test/runner.dart +0 -406
  360. package/project/.sdk/tm/dart/test/struct_corpus.dart +0 -531
  361. package/project/.sdk/tm/elixir/test/support/struct_corpus.ex +0 -1088
  362. package/project/.sdk/tm/go/test/runner_test.go +0 -629
  363. package/project/.sdk/tm/go/test/struct_runner_test.go +0 -1094
  364. package/project/.sdk/tm/java/test/StructRunner.java +0 -281
  365. package/project/.sdk/tm/js/test/runner.js +0 -387
  366. package/project/.sdk/tm/kotlin/test/StructRunner.kt +0 -177
  367. package/project/.sdk/tm/lua/test/struct_runner.lua +0 -602
  368. package/project/.sdk/tm/ocaml/test/corpus_runner.ml +0 -185
  369. package/project/.sdk/tm/perl/t/struct_runner.pm +0 -275
  370. package/project/.sdk/tm/php/test/StructRunner.php +0 -275
  371. package/project/.sdk/tm/py/test/struct_runner.py +0 -411
  372. package/project/.sdk/tm/rb/test/struct_runner.rb +0 -309
  373. package/project/.sdk/tm/rust/tests/struct_runner/mod.rs +0 -424
  374. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/Registry.ts +0 -90
  375. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/http.ts +0 -66
  376. package/project/.sdk/tm/ts/test/vendor/omni/compat.ts +0 -188
@@ -0,0 +1,851 @@
1
+ // VENDORED: @voxgig/omni sdk-20260904-1610-0 (java/src/com/voxgig/omni/Runner.java)
2
+ // Source: https://github.com/voxgig/omni @ 8c3e1b573a8d35796f7fc45e3226b977023cabf7 [tag: sdk-20260904-1610-0]
3
+ // License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
4
+ // Omni: the shared multi-language test runner.
5
+ //
6
+ // Port of the canonical TypeScript implementation
7
+ // (typescript/src/Runner.ts). Behaviour must match, case for case.
8
+
9
+ package com.voxgig.omni;
10
+
11
+ import java.io.IOException;
12
+ import java.nio.charset.StandardCharsets;
13
+ import java.nio.file.Files;
14
+ import java.nio.file.Paths;
15
+ import java.util.ArrayList;
16
+ import java.util.Arrays;
17
+ import java.util.Collections;
18
+ import java.util.HashMap;
19
+ import java.util.LinkedHashMap;
20
+ import java.util.List;
21
+ import java.util.Map;
22
+ import java.util.function.BiFunction;
23
+ import java.util.function.Function;
24
+ import java.util.regex.Pattern;
25
+
26
+ public final class Runner {
27
+
28
+ public static final String NULLMARK = Util.NULLMARK;
29
+ public static final String UNDEFMARK = Util.UNDEFMARK;
30
+ public static final String EXISTSMARK = Util.EXISTSMARK;
31
+
32
+ // The newest spec format version this runner understands. A spec with no
33
+ // OMNI block is version 0: the original, lenient format, frozen forever.
34
+ // Version 1 turns on strict entry validation (see checkentry).
35
+ public static final int SPECVERSION = 1;
36
+
37
+ // Capability strings this runner supports beyond the version baseline. A
38
+ // spec's OMNI.requires list is checked against this: an unknown
39
+ // capability refuses the spec loudly at load time, instead of a lagging
40
+ // port silently mis-running it. (Empty today; future format features
41
+ // mint a string here.)
42
+ public static final List<String> CAPABILITIES = Collections.emptyList();
43
+
44
+ // The complete set of fields an entry may carry. Under version 1
45
+ // anything else is an error: an unrecognised key is almost always a
46
+ // typo'd assertion, and a typo'd assertion is a test that silently
47
+ // stopped testing.
48
+ private static final List<String> ENTRYFIELDS =
49
+ Collections.unmodifiableList(
50
+ Arrays.asList("in", "args", "ctx", "out", "err", "match", "client", "id", "doc"));
51
+
52
+ private Runner() {}
53
+
54
+ /** The function under test. Arguments arrive as JSON values. */
55
+ public interface Subject {
56
+ Object call(Object... args) throws Exception;
57
+ }
58
+
59
+ /** A test failure (or a malformed spec). */
60
+ public static class OmniError extends RuntimeException {
61
+ private static final long serialVersionUID = 1L;
62
+
63
+ public final transient Object entry;
64
+
65
+ public OmniError(String message) {
66
+ this(message, null);
67
+ }
68
+
69
+ public OmniError(String message, Object entry) {
70
+ super(message);
71
+ this.entry = entry;
72
+ }
73
+ }
74
+
75
+ /** The host of the system under test. Every hook is optional. */
76
+ public static class Provider {
77
+ /** Resolve a test subject by name. */
78
+ public Function<String, Subject> subject;
79
+
80
+ /** Build a sub-provider from a DEF.client entry's options. */
81
+ public Function<Object, Provider> client;
82
+
83
+ /** Wrap a map argument as a call context. */
84
+ public Function<Object, Object> contextify;
85
+
86
+ /** Resolve references in client options against the store. */
87
+ public BiFunction<Object, Object, Object> inject;
88
+
89
+ /**
90
+ * Build the {@code match.err} base from the raised error, REPLACING
91
+ * {@link Runner#errify}. A library whose errors carry a code can then
92
+ * assert on it with {@code match: {err: {code: "x"}}} instead of
93
+ * pattern-matching prose.
94
+ */
95
+ public Function<Object, Object> errify;
96
+ }
97
+
98
+ /** Run-time options for a set of test entries. */
99
+ public static Map<String, Object> flags(Object... pairs) {
100
+ Map<String, Object> out = new LinkedHashMap<>();
101
+ for (int index = 0; index + 1 < pairs.length; index += 2) {
102
+ out.put(String.valueOf(pairs[index]), pairs[index + 1]);
103
+ }
104
+ return out;
105
+ }
106
+
107
+ /** What a runner returns for one named spec section. */
108
+ public static final class RunPack {
109
+ public final Object spec;
110
+ public final Subject subject;
111
+ public final Provider client;
112
+
113
+ private final String name;
114
+ private final Provider provider;
115
+ private final Map<String, Provider> clients;
116
+ private final int specversion;
117
+
118
+ RunPack(
119
+ Object spec,
120
+ Subject subject,
121
+ Provider provider,
122
+ Map<String, Provider> clients,
123
+ String name,
124
+ int specversion) {
125
+ this.spec = spec;
126
+ this.subject = subject;
127
+ this.client = provider;
128
+ this.provider = provider;
129
+ this.clients = clients;
130
+ this.name = name;
131
+ this.specversion = specversion;
132
+ }
133
+
134
+ /** A named group of the resolved spec. */
135
+ @SuppressWarnings("unchecked")
136
+ public Object set(String setname) {
137
+ if (Util.ismap(spec)) {
138
+ return ((Map<String, Object>) spec).get(setname);
139
+ }
140
+ return null;
141
+ }
142
+
143
+ /** Run one set of test entries. */
144
+ public void runset(Object testspec, Subject testsubject) {
145
+ runsetflags(testspec, new LinkedHashMap<>(), testsubject);
146
+ }
147
+
148
+ /** Run one set of test entries with flags. */
149
+ @SuppressWarnings("unchecked")
150
+ public void runsetflags(Object testspec, Map<String, Object> useflags, Subject testsubject) {
151
+ Map<String, Object> flags = resolveflags(useflags);
152
+ if (null == flags.get("name")) {
153
+ flags.put("name", null == name || name.isEmpty() ? "set" : name);
154
+ }
155
+
156
+ Subject subject = null != testsubject ? testsubject : this.subject;
157
+ if (null == subject) {
158
+ throw new OmniError("omni: no test subject for: " + flags.get("name"));
159
+ }
160
+
161
+ Object testspecmap = fixjson(testspec, flags);
162
+ if (!Util.ismap(testspecmap)
163
+ || !Util.islist(((Map<String, Object>) testspecmap).get("set"))) {
164
+ throw new OmniError("omni: test spec has no set: " + flags.get("name"));
165
+ }
166
+
167
+ List<Object> testset = (List<Object>) ((Map<String, Object>) testspecmap).get("set");
168
+
169
+ // Validate the AUTHORED group up front (before null-normalisation),
170
+ // and before any entry runs. Absorbs the empty-set check: a
171
+ // vacuously green group proves nothing, so version 1 makes an empty
172
+ // set an error unless the group is deliberately marked empty.
173
+ if (1 <= specversion) {
174
+ checkset(flags, testspec, testset);
175
+ }
176
+
177
+ for (int index = 0; index < testset.size(); index++) {
178
+ Object rawentry = testset.get(index);
179
+
180
+ if (specversion < 1 && !Util.ismap(rawentry)) {
181
+ throw new OmniError("omni: " + flags.get("name") + "[" + index + "]: entry is not a map");
182
+ }
183
+
184
+ Map<String, Object> entry = resolveentry((Map<String, Object>) rawentry, flags);
185
+
186
+ Subject entrysubject = subject;
187
+ Provider entryclient = provider;
188
+
189
+ Object clientname = entry.get("client");
190
+ if (null != clientname) {
191
+ Provider found = clients.get(String.valueOf(clientname));
192
+ if (null == found) {
193
+ throw new OmniError("omni: unknown client: " + clientname, entry);
194
+ }
195
+ entryclient = found;
196
+ Subject clientsubject = resolvesubject(name, found);
197
+ if (null != clientsubject) {
198
+ entrysubject = clientsubject;
199
+ }
200
+ }
201
+
202
+ Object[] args = resolveargs(entry, entryclient, provider);
203
+
204
+ Object res;
205
+ try {
206
+ res = entrysubject.call(args);
207
+ } catch (OmniError omnierr) {
208
+ throw omnierr;
209
+ } catch (Throwable err) {
210
+ handleerror(flags, index, entry, err, provider);
211
+ continue;
212
+ }
213
+
214
+ res = fixjson(res, flags);
215
+ entry.put("res", res);
216
+
217
+ checkresult(flags, index, entry, args, res);
218
+ }
219
+ }
220
+ }
221
+
222
+ /** Resolves one named section of a spec. */
223
+ public static final class RunnerPack {
224
+ private final Object alltests;
225
+ private final Provider provider;
226
+ private final int specversion;
227
+
228
+ RunnerPack(Object alltests, Provider provider, int specversion) {
229
+ this.alltests = alltests;
230
+ this.provider = provider;
231
+ this.specversion = specversion;
232
+ }
233
+
234
+ public RunPack runner(String name) {
235
+ return runner(name, null);
236
+ }
237
+
238
+ public RunPack runner(String name, Object store) {
239
+ Object spec = resolvespec(name, alltests);
240
+ Map<String, Provider> clients = resolveclients(provider, spec, store);
241
+ Subject subject = resolvesubject(name, provider);
242
+ return new RunPack(spec, subject, provider, clients, name, specversion);
243
+ }
244
+ }
245
+
246
+ /** Make a runner for a spec file path (or spec value) and a provider. */
247
+ public static RunnerPack makeRunner(Object specref, Provider provider) {
248
+ Object alltests = loadspec(specref);
249
+ // Fail fast: refuse a spec this runner cannot faithfully run before any
250
+ // entry in it gets a chance to run.
251
+ int specversion = resolveversion(alltests);
252
+ return new RunnerPack(alltests, null == provider ? new Provider() : provider, specversion);
253
+ }
254
+
255
+ /** Load a spec: a path to a JSON file, or an already-parsed value. */
256
+ public static Object loadspec(Object specref) {
257
+ if (specref instanceof String) {
258
+ try {
259
+ String text = new String(Files.readAllBytes(Paths.get((String) specref)), StandardCharsets.UTF_8);
260
+ return Json.parse(text);
261
+ } catch (IOException err) {
262
+ throw new OmniError("omni: cannot read spec: " + specref);
263
+ }
264
+ }
265
+ return specref;
266
+ }
267
+
268
+ /**
269
+ * Read the spec's format version from its optional top-level OMNI block,
270
+ * and refuse a spec this runner cannot faithfully run: a version newer
271
+ * than SPECVERSION, or a required capability not in CAPABILITIES.
272
+ */
273
+ @SuppressWarnings("unchecked")
274
+ static int resolveversion(Object alltests) {
275
+ // A genuinely absent OMNI key is legacy (version 0). A *present* OMNI
276
+ // that is null (or otherwise not a map) is malformed, not legacy - so
277
+ // this must be a presence check (containsKey), never a null check.
278
+ if (!Util.ismap(alltests) || !((Map<String, Object>) alltests).containsKey("OMNI")) {
279
+ return 0;
280
+ }
281
+ Object meta = ((Map<String, Object>) alltests).get("OMNI");
282
+
283
+ Object rawversion = Util.ismap(meta) ? ((Map<String, Object>) meta).get("version") : null;
284
+ if (!Util.ismap(meta)
285
+ || !Util.isnum(rawversion)
286
+ || ((Number) rawversion).doubleValue() != Math.rint(((Number) rawversion).doubleValue())) {
287
+ throw new OmniError("omni: malformed OMNI version block");
288
+ }
289
+
290
+ double version = ((Number) rawversion).doubleValue();
291
+ if (version < 0 || SPECVERSION < version) {
292
+ throw new OmniError("omni: unsupported spec version: " + Util.numstr(version));
293
+ }
294
+
295
+ // A present-but-null `requires` is malformed, not "skip"; only a
296
+ // genuinely absent key means no requirement was declared.
297
+ if (((Map<String, Object>) meta).containsKey("requires")) {
298
+ Object requires = ((Map<String, Object>) meta).get("requires");
299
+ if (!Util.islist(requires)) {
300
+ throw new OmniError("omni: malformed OMNI requires list");
301
+ }
302
+ for (Object cap : (List<Object>) requires) {
303
+ if (!(cap instanceof String) || !CAPABILITIES.contains(cap)) {
304
+ throw new OmniError("omni: spec requires unsupported capability: " + Util.stringify(cap));
305
+ }
306
+ }
307
+ }
308
+
309
+ return (int) version;
310
+ }
311
+
312
+ /**
313
+ * Strict entry validation, applied when the spec declares version 1 or
314
+ * later. The lenient format converts each of these mistakes into a
315
+ * silent pass or a dead field; here they fail with the entry named.
316
+ */
317
+ @SuppressWarnings("unchecked")
318
+ static void checkentry(Map<String, Object> flags, int index, Object rawentry) {
319
+ if (!Util.ismap(rawentry)) {
320
+ throw fail(flags, index, rawentry, "entry is not a map", null, null);
321
+ }
322
+
323
+ Map<String, Object> entry = (Map<String, Object>) rawentry;
324
+
325
+ for (String key : entry.keySet()) {
326
+ if (!ENTRYFIELDS.contains(key)) {
327
+ throw fail(flags, index, entry, "unknown entry field: " + key, null, null);
328
+ }
329
+ }
330
+
331
+ int argsources = 0;
332
+ for (String key : new String[] {"in", "args", "ctx"}) {
333
+ if (entry.containsKey(key)) {
334
+ argsources++;
335
+ }
336
+ }
337
+ if (1 < argsources) {
338
+ throw fail(flags, index, entry, "entry has more than one of in, args, ctx", null, null);
339
+ }
340
+
341
+ if (null != entry.get("err") && entry.containsKey("out")) {
342
+ throw fail(flags, index, entry, "entry has both err and out", null, null);
343
+ }
344
+
345
+ // Presence, not definedness: a present `id: null` must fail, not be
346
+ // treated as though no id were given at all.
347
+ if (entry.containsKey("id") && !(entry.get("id") instanceof String)) {
348
+ throw fail(flags, index, entry, "entry id is not a string", null, null);
349
+ }
350
+ }
351
+
352
+ /**
353
+ * Validate a version-1 group up front, against the AUTHORED entries -
354
+ * null-normalisation would otherwise rewrite an authored null (e.g.
355
+ * id: null) into a sentinel string and hide it from validation. A
356
+ * malformed spec is a spec error, not a test result, so it fails before
357
+ * any subject runs.
358
+ */
359
+ @SuppressWarnings("unchecked")
360
+ static void checkset(Map<String, Object> flags, Object testspec, List<Object> normalset) {
361
+ List<Object> origset = normalset;
362
+ if (Util.ismap(testspec)) {
363
+ Object rawset = ((Map<String, Object>) testspec).get("set");
364
+ if (Util.islist(rawset)) {
365
+ origset = (List<Object>) rawset;
366
+ }
367
+ }
368
+
369
+ Object emptyflag = Util.ismap(testspec) ? ((Map<String, Object>) testspec).get("empty") : null;
370
+ if (origset.isEmpty() && !Boolean.TRUE.equals(emptyflag)) {
371
+ throw new OmniError("omni: empty test set: " + flags.get("name"));
372
+ }
373
+
374
+ for (int index = 0; index < origset.size(); index++) {
375
+ checkentry(flags, index, origset.get(index));
376
+ }
377
+ }
378
+
379
+ /** Find `primary.<name>`, then `<name>`, then the whole spec. */
380
+ @SuppressWarnings("unchecked")
381
+ public static Object resolvespec(String name, Object alltests) {
382
+ if (null == name || name.isEmpty()) {
383
+ return alltests;
384
+ }
385
+
386
+ if (Util.ismap(alltests)) {
387
+ Map<String, Object> allmap = (Map<String, Object>) alltests;
388
+
389
+ Object primary = allmap.get("primary");
390
+ if (Util.ismap(primary)) {
391
+ Object section = ((Map<String, Object>) primary).get(name);
392
+ if (null != section) {
393
+ return section;
394
+ }
395
+ }
396
+
397
+ Object section = allmap.get(name);
398
+ if (null != section) {
399
+ return section;
400
+ }
401
+ }
402
+
403
+ return alltests;
404
+ }
405
+
406
+ /** Build the named clients declared by the spec's DEF.client block. */
407
+ @SuppressWarnings("unchecked")
408
+ static Map<String, Provider> resolveclients(Provider provider, Object spec, Object store) {
409
+ Map<String, Provider> clients = new HashMap<>();
410
+
411
+ if (!Util.ismap(spec)) {
412
+ return clients;
413
+ }
414
+
415
+ Object def = ((Map<String, Object>) spec).get("DEF");
416
+ if (!Util.ismap(def)) {
417
+ return clients;
418
+ }
419
+
420
+ Object defclient = ((Map<String, Object>) def).get("client");
421
+ if (!Util.ismap(defclient)) {
422
+ return clients;
423
+ }
424
+
425
+ // A spec may define clients that a given test run never references.
426
+ if (null == provider.client) {
427
+ return clients;
428
+ }
429
+
430
+ for (Map.Entry<String, Object> entry : ((Map<String, Object>) defclient).entrySet()) {
431
+ Object copts = new LinkedHashMap<String, Object>();
432
+ Object cdef = entry.getValue();
433
+ if (Util.ismap(cdef)) {
434
+ Object ctest = ((Map<String, Object>) cdef).get("test");
435
+ if (Util.ismap(ctest)) {
436
+ Object options = ((Map<String, Object>) ctest).get("options");
437
+ if (null != options) {
438
+ copts = Util.clone(options);
439
+ }
440
+ }
441
+ }
442
+
443
+ if (null != provider.inject && Util.ismap(store)) {
444
+ provider.inject.apply(copts, store);
445
+ }
446
+
447
+ clients.put(entry.getKey(), provider.client.apply(copts));
448
+ }
449
+
450
+ return clients;
451
+ }
452
+
453
+ static Subject resolvesubject(String name, Provider provider) {
454
+ if (null == name || name.isEmpty() || null == provider || null == provider.subject) {
455
+ return null;
456
+ }
457
+ return provider.subject.apply(name);
458
+ }
459
+
460
+ static Map<String, Object> resolveflags(Map<String, Object> flags) {
461
+ Map<String, Object> out = new LinkedHashMap<>();
462
+ if (null != flags) {
463
+ out.putAll(flags);
464
+ }
465
+ if (null == out.get("null")) {
466
+ out.put("null", Boolean.TRUE);
467
+ }
468
+ return out;
469
+ }
470
+
471
+ static boolean flagbool(Map<String, Object> flags, String name) {
472
+ Object val = flags.get(name);
473
+ return val instanceof Boolean && (Boolean) val;
474
+ }
475
+
476
+ /** An entry with no `out` expects a null (or absent) result. */
477
+ static Map<String, Object> resolveentry(Map<String, Object> entry, Map<String, Object> flags) {
478
+ if (null == entry.get("out") && flagbool(flags, "null")) {
479
+ entry.put("out", NULLMARK);
480
+ }
481
+ return entry;
482
+ }
483
+
484
+ /** Build the argument list: `ctx`, `args`, or `in`. */
485
+ @SuppressWarnings("unchecked")
486
+ static Object[] resolveargs(Map<String, Object> entry, Provider client, Provider provider) {
487
+ Object[] args;
488
+
489
+ boolean hasctx = entry.containsKey("ctx");
490
+ boolean hasargs = entry.containsKey("args");
491
+
492
+ if (hasctx) {
493
+ args = new Object[] {entry.get("ctx")};
494
+ } else if (hasargs) {
495
+ Object rawargs = entry.get("args");
496
+ if (Util.islist(rawargs)) {
497
+ args = ((List<Object>) rawargs).toArray();
498
+ } else {
499
+ args = new Object[] {rawargs};
500
+ }
501
+ } else {
502
+ // containsKey, not get: a Java Map cannot tell a missing key from one
503
+ // holding null, and the corpus needs the difference. An entry carrying
504
+ // none of `in`/`args`/`ctx` is called with one ABSENT argument, not
505
+ // null - `typify()` is 1073741824 where `typify(null)` is 4194432.
506
+ args =
507
+ new Object[] {
508
+ entry.containsKey("in") ? Util.clone(entry.get("in")) : Json.ABSENT
509
+ };
510
+ }
511
+
512
+ if ((hasctx || hasargs) && 0 < args.length && Util.ismap(args[0])) {
513
+ Object first = Util.clone(args[0]);
514
+ if (null != provider.contextify) {
515
+ first = provider.contextify.apply(first);
516
+ }
517
+ if (Util.ismap(first)) {
518
+ ((Map<String, Object>) first).put("client", client);
519
+ }
520
+ args[0] = first;
521
+ entry.put("ctx", first);
522
+ }
523
+
524
+ return args;
525
+ }
526
+
527
+ /** Nulls become NULLMARK, errors become {name,message}. Always a copy. */
528
+ public static Object fixjson(Object val, Map<String, Object> flags) {
529
+ boolean donull = null == flags || null == flags.get("null") || flagbool(flags, "null");
530
+ return fixjsonval(val, donull);
531
+ }
532
+
533
+ @SuppressWarnings("unchecked")
534
+ static Object fixjsonval(Object val, boolean donull) {
535
+ if (null == val || Util.isabsent(val)) {
536
+ // Canonical returns the value UNCHANGED when donull is false
537
+ // (typescript/src/Runner.ts): absent stays absent and null stays null.
538
+ // Answering null for both collapsed two states the corpus
539
+ // distinguishes. Same defect omni-lua and omni-rust carried
540
+ // (voxgig/omni#17, #23).
541
+ return donull ? NULLMARK : val;
542
+ }
543
+
544
+ if (val instanceof Throwable) {
545
+ return errify(val);
546
+ }
547
+
548
+ if (Util.islist(val)) {
549
+ List<Object> out = new ArrayList<>();
550
+ for (Object entry : (List<Object>) val) {
551
+ out.add(fixjsonval(entry, donull));
552
+ }
553
+ return out;
554
+ }
555
+
556
+ if (Util.ismap(val)) {
557
+ Map<String, Object> out = new LinkedHashMap<>();
558
+ for (Map.Entry<String, Object> entry : ((Map<String, Object>) val).entrySet()) {
559
+ out.put(entry.getKey(), fixjsonval(entry.getValue(), donull));
560
+ }
561
+ return out;
562
+ }
563
+
564
+ return val;
565
+ }
566
+
567
+ /** The JSON form of an error: always at least {name,message}. */
568
+ public static Map<String, Object> errify(Object err) {
569
+ Map<String, Object> out = new LinkedHashMap<>();
570
+ if (err instanceof Throwable) {
571
+ out.put("name", err.getClass().getSimpleName());
572
+ out.put("message", errmessage((Throwable) err));
573
+ } else {
574
+ out.put("name", "Error");
575
+ out.put("message", String.valueOf(err));
576
+ }
577
+ return out;
578
+ }
579
+
580
+ static String errmessage(Throwable err) {
581
+ String message = err.getMessage();
582
+ return null == message ? err.getClass().getSimpleName() : message;
583
+ }
584
+
585
+ /** The label of one entry, for failure messages. */
586
+ @SuppressWarnings("unchecked")
587
+ static String entryref(Map<String, Object> flags, int index, Object entry) {
588
+ Object label = flags.get("name");
589
+ Object id = Util.ismap(entry) ? ((Map<String, Object>) entry).get("id") : null;
590
+ String idpart = null == id ? "" : " (" + Util.stringify(id) + ")";
591
+ return (null == label ? "set" : String.valueOf(label)) + "[" + index + "]" + idpart;
592
+ }
593
+
594
+ static OmniError fail(
595
+ Map<String, Object> flags,
596
+ int index,
597
+ Object entry,
598
+ String reason,
599
+ String expected,
600
+ String actual) {
601
+
602
+ StringBuilder msg = new StringBuilder();
603
+ msg.append("omni: ").append(entryref(flags, index, entry)).append(": ").append(reason);
604
+ if (null != expected) {
605
+ msg.append("\n expected: ").append(expected);
606
+ }
607
+ if (null != actual) {
608
+ msg.append("\n actual: ").append(actual);
609
+ }
610
+ msg.append("\n entry: ").append(Util.stringify(entrysummary(entry)));
611
+
612
+ return new OmniError(msg.toString(), entry);
613
+ }
614
+
615
+ /** The spec-defined part of an entry (drop runner bookkeeping). */
616
+ @SuppressWarnings("unchecked")
617
+ static Object entrysummary(Object rawentry) {
618
+ if (!Util.ismap(rawentry)) {
619
+ return rawentry;
620
+ }
621
+ Map<String, Object> entry = (Map<String, Object>) rawentry;
622
+ Map<String, Object> out = new LinkedHashMap<>();
623
+ for (Map.Entry<String, Object> field : entry.entrySet()) {
624
+ String key = field.getKey();
625
+ if (!"res".equals(key) && !"thrown".equals(key) && !"ctx".equals(key)) {
626
+ out.put(key, field.getValue());
627
+ }
628
+ }
629
+ return out;
630
+ }
631
+
632
+ static void checkresult(
633
+ Map<String, Object> flags, int index, Map<String, Object> entry, Object[] args, Object res) {
634
+
635
+ boolean matched = false;
636
+
637
+ Object entryerr = entry.get("err");
638
+ if (null != entryerr) {
639
+ throw fail(
640
+ flags,
641
+ index,
642
+ entry,
643
+ "expected error did not occur",
644
+ Util.stringify(entryerr),
645
+ Util.stringify(res));
646
+ }
647
+
648
+ Object check = entry.get("match");
649
+ if (null != check) {
650
+ Map<String, Object> base = new LinkedHashMap<>();
651
+ base.put("in", entry.get("in"));
652
+ base.put("args", new ArrayList<>(java.util.Arrays.asList(args)));
653
+ base.put("out", entry.get("res"));
654
+ base.put("ctx", entry.get("ctx"));
655
+ match(flags, index, entry, check, base);
656
+ matched = true;
657
+ }
658
+
659
+ // Same conflation as resolveargs: an entry with NO `out` expects an absent
660
+ // result, and one with `out: null` expects a null. Reading it with get()
661
+ // made both null, so a subject that correctly returned nothing was
662
+ // compared against null and marked wrong.
663
+ //
664
+ // (Under `null: true` this never fires - resolveentry has already put
665
+ // NULLMARK there.)
666
+ Object out = entry.containsKey("out") ? entry.get("out") : Json.ABSENT;
667
+
668
+ if (Util.deepequal(res, out)) {
669
+ return;
670
+ }
671
+
672
+ // NOTE: a match with no explicit out is a complete check on its own.
673
+ // `null == out` in canonical is true of undefined too, so absent counts.
674
+ if (matched && (NULLMARK.equals(out) || null == out || Util.isabsent(out))) {
675
+ return;
676
+ }
677
+
678
+ throw fail(flags, index, entry, "result mismatch", Util.stringify(out), Util.stringify(res));
679
+ }
680
+
681
+ /** The error base a {@code match.err} sees: the provider's own, when it has one. */
682
+ static Object errbase(Object err, Provider provider) {
683
+ return null != provider && null != provider.errify
684
+ ? provider.errify.apply(err)
685
+ : errify(err);
686
+ }
687
+
688
+ static void handleerror(
689
+ Map<String, Object> flags,
690
+ int index,
691
+ Map<String, Object> entry,
692
+ Throwable err,
693
+ Provider provider) {
694
+
695
+ Object entryerr = entry.get("err");
696
+
697
+ if (null != entryerr) {
698
+ boolean istrue = entryerr instanceof Boolean && (Boolean) entryerr;
699
+
700
+ if (istrue || matchval(entryerr, errmessage(err))) {
701
+ Object check = entry.get("match");
702
+ if (null != check) {
703
+ Map<String, Object> base = new LinkedHashMap<>();
704
+ base.put("in", entry.get("in"));
705
+ base.put("out", entry.get("res"));
706
+ base.put("ctx", entry.get("ctx"));
707
+ base.put("err", errbase(err, provider));
708
+ match(flags, index, entry, check, base);
709
+ }
710
+ return;
711
+ }
712
+
713
+ throw fail(
714
+ flags, index, entry, "error mismatch", Util.stringify(entryerr), errmessage(err));
715
+ }
716
+
717
+ throw fail(flags, index, entry, "unexpected error", null, errmessage(err));
718
+ }
719
+
720
+ /** Check that every leaf of `check` is present, and matches, in `base`. */
721
+ public static void match(
722
+ Map<String, Object> flags, int index, Map<String, Object> entry, Object check, Object base) {
723
+
724
+ Object cbase = Util.clone(base);
725
+
726
+ Util.walk(
727
+ Util.clone(check),
728
+ (key, val, parent, path) -> {
729
+ String atpath = path.isEmpty() ? "<root>" : Util.pathify(path);
730
+
731
+ if (Util.isnode(val)) {
732
+ return val;
733
+ }
734
+
735
+ Object baseval = Util.getpath(cbase, path);
736
+
737
+ // The sentinels are tested BEFORE the identity check below.
738
+ // Otherwise a subject returning the literal string "__UNDEF__"
739
+ // satisfies an assertion that the key is absent - two mutually
740
+ // exclusive states passing one check. A sentinel that accepts its
741
+ // own literal is not a sentinel. (NULLMARK still accepts NULLMARK:
742
+ // under the default null flag a real null has already been
743
+ // normalised to it, so the two are genuinely indistinguishable
744
+ // here - that one needs a raw-value escape, not an ordering
745
+ // change.)
746
+
747
+ // Explicitly absent: satisfied only by a genuinely missing key,
748
+ // never by a present null (the distinction the sentinels exist to
749
+ // keep).
750
+ if (UNDEFMARK.equals(val)) {
751
+ if (Util.isabsent(baseval)) {
752
+ return val;
753
+ }
754
+ throw fail(
755
+ flags, index, entry, "expected absent at " + atpath,
756
+ "absent", Util.stringify(baseval));
757
+ }
758
+
759
+ // Explicitly null: satisfied only by a present null.
760
+ if (NULLMARK.equals(val)) {
761
+ if (null == baseval || NULLMARK.equals(baseval)) {
762
+ return val;
763
+ }
764
+ throw fail(
765
+ flags, index, entry, "expected null at " + atpath,
766
+ "null", Util.stringify(baseval));
767
+ }
768
+
769
+ // Explicitly present: any present value, including null.
770
+ if (EXISTSMARK.equals(val)) {
771
+ if (!Util.isabsent(baseval)) {
772
+ return val;
773
+ }
774
+ throw fail(
775
+ flags, index, entry, "expected present at " + atpath,
776
+ "present", "absent");
777
+ }
778
+
779
+ // Identical values match. This sits below the sentinel branches
780
+ // on purpose - see the note above.
781
+ if (Util.deepequal(val, baseval)) {
782
+ return val;
783
+ }
784
+
785
+ // A concrete expectation never matches a missing key - a match leaf
786
+ // against an absent value must fail, not substring-match
787
+ // "undefined".
788
+ if (Util.isabsent(baseval)) {
789
+ throw fail(
790
+ flags, index, entry, "match failed at " + atpath,
791
+ Util.stringify(val), "absent");
792
+ }
793
+
794
+ if (!matchval(val, baseval)) {
795
+ throw fail(
796
+ flags,
797
+ index,
798
+ entry,
799
+ "match failed at " + atpath,
800
+ Util.stringify(val),
801
+ Util.stringify(baseval));
802
+ }
803
+
804
+ return val;
805
+ });
806
+ }
807
+
808
+ /** Match one leaf: /regex/ or case-insensitive substring for strings. */
809
+ public static boolean matchval(Object check, Object base) {
810
+ if (Util.deepequal(check, base)) {
811
+ return true;
812
+ }
813
+
814
+ if (check instanceof String) {
815
+ String text = (String) check;
816
+
817
+ // An empty want would substring-match anything.
818
+ if (text.isEmpty()) {
819
+ return false;
820
+ }
821
+
822
+ String basestr = Util.stringify(base);
823
+
824
+ if (2 < text.length() && text.startsWith("/") && text.endsWith("/")) {
825
+ String pattern = text.substring(1, text.length() - 1);
826
+ try {
827
+ return Pattern.compile(pattern).matcher(basestr).find();
828
+ } catch (RuntimeException err) {
829
+ return false;
830
+ }
831
+ }
832
+
833
+ return basestr.toLowerCase().contains(text.toLowerCase());
834
+ }
835
+
836
+ return Util.deepequal(check, base);
837
+ }
838
+
839
+ /** Convert NULLMARK sentinels back into real nulls. */
840
+ @SuppressWarnings("unchecked")
841
+ public static Object nullmodifier(Object key, Object val, Object parent, List<Object> path) {
842
+ if (val instanceof String) {
843
+ String text = (String) val;
844
+ if (NULLMARK.equals(text)) {
845
+ return null;
846
+ }
847
+ return text.replace(NULLMARK, "null");
848
+ }
849
+ return val;
850
+ }
851
+ }