@voxgig/sdkgen 4.8.1 → 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 +2 -2
  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
@@ -2,304 +2,95 @@
2
2
  declare(strict_types=1);
3
3
 
4
4
  // ProjectName SDK primary utility test
5
+ //
6
+ // Corpus sections run through the vendored omni runner, via the resolver
7
+ // in test/Omni.php (struct-runner shape over native Voxgig\Omni). The
8
+ // inline corpus engine this file used to carry is retired: omni resolves
9
+ // arguments, applies the null rules, and enforces out/err/match - the
10
+ // subjects below only adapt each utility's calling convention.
11
+ //
12
+ // Three conventions to know when adding a section:
13
+ //
14
+ // - Utilities that answer as a (value, err) TUPLE go through
15
+ // ProjectNameOmni::unwrap, which throws the err so omni can match it
16
+ // against `err:` expectations. Utilities that answer bare values (or
17
+ // throw) are returned straight.
18
+ //
19
+ // - Contexts stay MAPS across the runner (Omni.php decision 2): a subject
20
+ // builds the typed context with ProjectNameOmni::ctx_from_map, runs the
21
+ // utility, and writes the observable state back with
22
+ // ProjectNameOmni::sync_ctx BEFORE throwing any error - that map is
23
+ // where a `match: {ctx: ...}` assertion reads.
24
+ //
25
+ // - `runsection` fails loudly when a section would run ZERO cases; a
26
+ // deliberately-empty (pending) section is named in PENDING.
5
27
 
6
28
  require_once __DIR__ . '/../projectname_sdk.php';
7
29
  require_once __DIR__ . '/Runner.php';
30
+ require_once __DIR__ . '/Omni.php';
8
31
 
9
32
  use PHPUnit\Framework\TestCase;
10
- use Voxgig\Struct\Struct;
11
33
 
12
34
  class PrimaryUtilityTest extends TestCase
13
35
  {
14
- private static ?array $test_spec = null;
15
-
16
- private static function load_test_spec(): array
17
- {
18
- if (self::$test_spec !== null) {
19
- return self::$test_spec;
20
- }
21
- $path = __DIR__ . '/../../.sdk/test/test.json';
22
- $content = file_get_contents($path);
23
- if ($content === false) {
24
- throw new RuntimeException("Failed to load test.json: $path");
36
+ // Resolved against test/Omni.php's own directory, so the suite works
37
+ // from any working directory.
38
+ private const TEST_JSON_FILE = '../../.sdk/test/test.json';
39
+
40
+ // Sections deliberately left empty in the shared corpus
41
+ // (.sdk/test/primary/<name>.aon carries a PENDING header). Everything
42
+ // else MUST contribute cases.
43
+ private const PENDING = [
44
+ 'fetcher', 'makeFetchDef', 'makeResult',
45
+ 'featureAdd', 'featureHook', 'featureInit',
46
+ ];
47
+
48
+ private static ?array $run = null;
49
+
50
+ /** The 'primary' runpack, built once for the whole class. */
51
+ private static function runpack(): array
52
+ {
53
+ if (self::$run === null) {
54
+ $runner = ProjectNameOmni::makeRunner(
55
+ self::TEST_JSON_FILE, ProjectNameSDK::test(null, null));
56
+ self::$run = $runner('primary');
25
57
  }
26
- $data = json_decode($content, true);
27
- if (json_last_error() !== JSON_ERROR_NONE) {
28
- throw new RuntimeException("Failed to parse test.json: " . json_last_error_msg());
29
- }
30
- self::$test_spec = $data;
31
- return $data;
58
+ return self::$run;
32
59
  }
33
60
 
34
- private static function get_spec(?array $spec, string ...$keys): ?array
61
+ /** The live SDK behind the runpack's provider client. */
62
+ private static function client(): ProjectNameSDK
35
63
  {
36
- $cur = $spec;
37
- foreach ($keys as $key) {
38
- if (!is_array($cur) || !array_key_exists($key, $cur)) {
39
- return null;
40
- }
41
- $cur = $cur[$key];
42
- }
43
- return is_array($cur) ? $cur : null;
64
+ return self::runpack()['client']['sdk'];
44
65
  }
45
66
 
46
- private function runset(?array $testspec, callable $subject): void
67
+ /**
68
+ * Run one corpus section, failing loudly when it would run ZERO
69
+ * cases. A renamed section or a fixture that compiled to an empty
70
+ * `set` used to pass silently, which defeats the point of a shared
71
+ * oracle. EVERY corpus-backed test goes through here (mirrors ts/py).
72
+ */
73
+ private function runsection(string $name, callable $subject): void
47
74
  {
48
- if ($testspec === null || !isset($testspec['set']) || !is_array($testspec['set'])) {
49
- return;
50
- }
51
- $set = $testspec['set'];
52
-
53
- foreach ($set as $i => $entry) {
54
- if (!is_array($entry)) {
55
- continue;
56
- }
57
-
58
- $mark = '';
59
- if (isset($entry['mark'])) {
60
- $mark = " (mark={$entry['mark']})";
61
- }
62
-
63
- $result = null;
64
- $err = null;
65
-
66
- try {
67
- [$result, $err] = $subject($entry);
68
- } catch (\Throwable $e) {
69
- $err = $e;
70
- }
71
-
72
- $expected_err = $entry['err'] ?? null;
73
-
74
- if ($err !== null) {
75
- if ($expected_err !== null) {
76
- $err_msg = ($err instanceof \Throwable) ? $err->getMessage() : (string)$err;
77
- if (is_string($expected_err)) {
78
- $this->assertTrue(
79
- $this->match_string($expected_err, $err_msg),
80
- "entry {$i}{$mark}: error mismatch: got \"{$err_msg}\", want contains \"{$expected_err}\""
81
- );
82
- }
83
- // err: true means any error is acceptable
84
-
85
- if (isset($entry['match']) && is_array($entry['match'])) {
86
- $result_map = [
87
- 'in' => $entry['in'] ?? null,
88
- 'out' => $this->json_normalize($result),
89
- 'err' => ['message' => ($err instanceof \Throwable) ? $err->getMessage() : (string)$err],
90
- ];
91
- $this->match_deep($i, $mark, $entry['match'], $result_map, '');
92
- }
93
- continue;
94
- }
95
- $err_msg = ($err instanceof \Throwable) ? $err->getMessage() : (string)$err;
96
- $this->fail("entry {$i}{$mark}: unexpected error: {$err_msg}");
97
- continue;
98
- }
99
-
100
- if ($expected_err !== null) {
101
- $this->fail(
102
- "entry {$i}{$mark}: expected error containing \"{$expected_err}\" but got result: "
103
- . json_encode($result)
104
- );
105
- continue;
106
- }
107
-
108
- $matched = false;
109
- if (isset($entry['match']) && is_array($entry['match'])) {
110
- $result_map = [
111
- 'in' => $entry['in'] ?? null,
112
- 'out' => $this->json_normalize($result),
113
- ];
114
- if (isset($entry['args'])) {
115
- $result_map['args'] = $entry['args'];
116
- } elseif (isset($entry['in'])) {
117
- $result_map['args'] = [$entry['in']];
118
- }
119
- if (isset($entry['ctx'])) {
120
- $result_map['ctx'] = $entry['ctx'];
121
- }
122
- $this->match_deep($i, $mark, $entry['match'], $result_map, '');
123
- $this->assertTrue(true, "entry {$i}{$mark}: match completed");
124
- $matched = true;
125
- }
126
-
127
- $expected_out = $entry['out'] ?? null;
128
- if ($expected_out === null && $matched) {
129
- continue;
130
- }
131
- if ($expected_out !== null) {
132
- $norm_result = $this->json_normalize($result);
133
- $norm_expected = $this->json_normalize($expected_out);
134
- $this->assertEquals(
135
- $norm_expected,
136
- $norm_result,
137
- "entry {$i}{$mark}: output mismatch"
138
- );
139
- }
140
- }
141
- }
142
-
143
- private function json_normalize(mixed $val): mixed
144
- {
145
- if ($val === null) {
146
- return null;
147
- }
148
- $j = json_encode($val);
149
- if ($j === false) {
150
- return $val;
151
- }
152
- return json_decode($j, true);
153
- }
154
-
155
- private function match_deep(int $entry_idx, string $mark, mixed $check, mixed $base, string $path): void
156
- {
157
- if ($check === null) {
158
- return;
159
- }
75
+ $R = self::runpack();
76
+ $spec = $R['spec'];
160
77
 
161
- if (is_array($check) && !$this->is_list($check)) {
162
- // Associative array (map)
163
- foreach ($check as $key => $check_val) {
164
- $child_path = $path . '.' . $key;
165
- $base_val = null;
166
- if (is_array($base) && array_key_exists($key, $base)) {
167
- $base_val = $base[$key];
168
- }
169
- $this->match_deep($entry_idx, $mark, $check_val, $base_val, $child_path);
170
- }
171
- } elseif (is_array($check) && $this->is_list($check)) {
172
- // Indexed array (list)
173
- foreach ($check as $i => $check_val) {
174
- $child_path = $path . "[{$i}]";
175
- $base_val = null;
176
- if (is_array($base) && isset($base[$i])) {
177
- $base_val = $base[$i];
178
- }
179
- $this->match_deep($entry_idx, $mark, $check_val, $base_val, $child_path);
180
- }
181
- } else {
182
- if (is_string($check) && $check === '__EXISTS__') {
183
- $this->assertNotNull(
184
- $base,
185
- "entry {$entry_idx}{$mark}: match {$path}: expected value to exist but got null"
186
- );
187
- return;
188
- }
189
- if (is_string($check) && $check === '__UNDEF__') {
190
- $this->assertNull(
191
- $base,
192
- "entry {$entry_idx}{$mark}: match {$path}: expected null but got " . json_encode($base)
193
- );
194
- return;
195
- }
196
-
197
- $norm_check = $this->json_normalize($check);
198
- $norm_base = $this->json_normalize($base);
199
-
200
- if ($norm_check !== $norm_base) {
201
- if (is_string($check) && $check !== '') {
202
- $base_str = Struct::stringify($base);
203
- if ($this->match_string($check, $base_str)) {
204
- return;
205
- }
206
- }
207
- $this->assertEquals(
208
- $norm_check,
209
- $norm_base,
210
- "entry {$entry_idx}{$mark}: match {$path}"
211
- );
212
- }
213
- }
214
- }
215
-
216
- private function match_string(string $pattern, string $val): bool
217
- {
218
- if (strlen($pattern) >= 2 && $pattern[0] === '/' && $pattern[strlen($pattern) - 1] === '/') {
219
- $re = substr($pattern, 1, -1);
220
- return (bool)preg_match('/' . $re . '/', $val);
221
- }
222
- return str_contains(strtolower($val), strtolower($pattern));
223
- }
224
-
225
- private function is_list(array $arr): bool
226
- {
227
- if (empty($arr)) {
228
- return true;
229
- }
230
- return array_keys($arr) === range(0, count($arr) - 1);
231
- }
232
-
233
- private static function make_ctx_from_map(
234
- ?array $ctxmap,
235
- ProjectNameSDK $client,
236
- ProjectNameUtility $utility
237
- ): ProjectNameContext {
238
- if ($ctxmap === null) {
239
- $ctxmap = [];
240
- }
241
-
242
- $ctx = new ProjectNameContext($ctxmap, null);
243
-
244
- $ctx->client = $client;
245
- $ctx->utility = $utility;
246
-
247
- if ($ctx->options === null) {
248
- $ctx->options = $client->options_map();
249
- }
250
-
251
- // Handle spec from JSON map
252
- if (isset($ctxmap['spec']) && is_array($ctxmap['spec'])) {
253
- $ctx->spec = new ProjectNameSpec($ctxmap['spec']);
254
- }
255
-
256
- // Handle result from JSON map
257
- if (isset($ctxmap['result']) && is_array($ctxmap['result'])) {
258
- $ctx->result = new ProjectNameResult($ctxmap['result']);
259
- if (isset($ctxmap['result']['err']) && is_array($ctxmap['result']['err'])) {
260
- $msg = $ctxmap['result']['err']['message'] ?? '';
261
- $ctx->result->err = new ProjectNameError('', $msg);
262
- }
263
- }
264
-
265
- // Handle response from JSON map
266
- if (isset($ctxmap['response']) && is_array($ctxmap['response'])) {
267
- $ctx->response = new ProjectNameResponse($ctxmap['response']);
268
- if (isset($ctxmap['response']['body'])) {
269
- $body_copy = $ctxmap['response']['body'];
270
- $ctx->response->json_func = function () use ($body_copy) { return $body_copy; };
271
- $ctx->response->body = $body_copy;
272
- }
273
- if (isset($ctxmap['response']['headers']) && is_array($ctxmap['response']['headers'])) {
274
- $lower_headers = [];
275
- foreach ($ctxmap['response']['headers'] as $k => $v) {
276
- $lower_headers[strtolower($k)] = $v;
277
- }
278
- $ctx->response->headers = $lower_headers;
279
- }
280
- }
78
+ $section = is_array($spec) ? ($spec[$name] ?? null) : null;
79
+ $this->assertIsArray($section,
80
+ "test corpus section '{$name}' missing - check the name against .sdk/test/primary/");
281
81
 
282
- return $ctx;
283
- }
82
+ $basic = $section['basic'] ?? null;
83
+ $this->assertTrue(is_array($basic) && is_array($basic['set'] ?? null),
84
+ "test corpus section '{$name}' has no basic.set list");
284
85
 
285
- private static function fixctx(ProjectNameContext $ctx, ProjectNameSDK $client): void
286
- {
287
- if ($ctx->client !== null && $ctx->options === null) {
288
- $ctx->options = $ctx->client->options_map();
86
+ if (0 === count($basic['set']) && !in_array($name, self::PENDING, true)) {
87
+ $this->fail(
88
+ "test corpus section '{$name}' is EMPTY - zero cases would run; " .
89
+ "add cases, or mark the fixture PENDING in .sdk/test/primary/");
289
90
  }
290
- }
291
91
 
292
- private static function err_from_map(?array $m): ?ProjectNameError
293
- {
294
- if ($m === null) {
295
- return null;
296
- }
297
- $msg = $m['message'] ?? '';
298
- if ($msg === '') {
299
- return null;
300
- }
301
- $code = $m['code'] ?? '';
302
- return new ProjectNameError($code, $msg);
92
+ $R['runset']($basic, $subject);
93
+ $this->assertTrue(true, "corpus section '{$name}' completed");
303
94
  }
304
95
 
305
96
  private static function make_test_ctx(
@@ -396,20 +187,14 @@ class PrimaryUtilityTest extends TestCase
396
187
 
397
188
  public function test_done_basic(): void
398
189
  {
399
- $spec = self::load_test_spec();
400
- $primary = self::get_spec($spec, 'primary');
401
- $client = ProjectNameSDK::test(null, null);
190
+ $client = self::client();
402
191
  $utility = $client->get_utility();
403
192
 
404
- $this->runset(self::get_spec($primary, 'done', 'basic'), function (array $entry) use ($client, $utility) {
405
- $ctxmap = $entry['ctx'] ?? [];
406
- $ctx = self::make_ctx_from_map($ctxmap, $client, $utility);
407
- self::fixctx($ctx, $client);
408
- // done now returns the bare result data (or raises on error, which
409
- // runset catches). Re-wrap success into a (result, err) tuple so the
410
- // data-driven spec matcher keeps working.
411
- $out = ($utility->done)($ctx);
412
- return [$out, null];
193
+ $this->runsection('done', function (array $ctxmap) use ($client, $utility) {
194
+ $ctx = ProjectNameOmni::ctx_from_map($ctxmap, $client, $utility);
195
+ // done returns the bare result data, or raises on error - which
196
+ // omni matches against the entry's `err`.
197
+ return ($utility->done)($ctx);
413
198
  });
414
199
  }
415
200
 
@@ -418,34 +203,17 @@ class PrimaryUtilityTest extends TestCase
418
203
 
419
204
  public function test_make_error_basic(): void
420
205
  {
421
- $spec = self::load_test_spec();
422
- $primary = self::get_spec($spec, 'primary');
423
- $client = ProjectNameSDK::test(null, null);
206
+ $client = self::client();
424
207
  $utility = $client->get_utility();
425
208
 
426
- $this->runset(self::get_spec($primary, 'makeError', 'basic'), function (array $entry) use ($client, $utility) {
427
- $args = $entry['args'] ?? [];
428
- if (empty($args)) {
429
- $args = [[]];
430
- }
431
-
432
- $ctxmap = $args[0] ?? [];
433
- if (!is_array($ctxmap)) {
434
- $ctxmap = [];
435
- }
436
- $ctx = self::make_ctx_from_map($ctxmap, $client, $utility);
437
- self::fixctx($ctx, $client);
438
-
439
- $err = null;
440
- if (count($args) > 1 && is_array($args[1])) {
441
- $err = self::err_from_map($args[1]);
442
- }
443
-
444
- // make_error now RAISES the constructed exception (default throw
445
- // path); runset catches it. On the no-throw path it returns the
446
- // bare result data, which we re-wrap into a (result, err) tuple.
447
- $out = ($utility->make_error)($ctx, $err);
448
- return [$out, null];
209
+ $this->runsection('makeError', function ($ctxmap = null, $errmap = null) use ($client, $utility) {
210
+ $ctx = ProjectNameOmni::ctx_from_map(
211
+ is_array($ctxmap) ? $ctxmap : [], $client, $utility);
212
+ $err = ProjectNameOmni::err_from_map(is_array($errmap) ? $errmap : null);
213
+ // make_error RAISES the constructed exception on the default
214
+ // (throw) path; omni matches it against the entry's err. On the
215
+ // no-throw path it returns the bare result data.
216
+ return ($utility->make_error)($ctx, $err);
449
217
  });
450
218
  }
451
219
 
@@ -649,27 +417,23 @@ class PrimaryUtilityTest extends TestCase
649
417
 
650
418
  public function test_make_context_basic(): void
651
419
  {
652
- $spec = self::load_test_spec();
653
- $primary = self::get_spec($spec, 'primary');
654
- $client = ProjectNameSDK::test(null, null);
655
- $utility = $client->get_utility();
420
+ $utility = self::client()->get_utility();
656
421
 
657
- $this->runset(self::get_spec($primary, 'makeContext', 'basic'), function (array $entry) use ($client, $utility) {
658
- $in = $entry['in'] ?? null;
659
- if (is_array($in)) {
660
- $ctx = ($utility->make_context)($in, null);
661
- $out = [
662
- 'id' => $ctx->id,
422
+ $this->runsection('makeContext', function ($vin = null) use ($utility) {
423
+ if (!is_array($vin)) {
424
+ return null;
425
+ }
426
+ $ctx = ($utility->make_context)($vin, null);
427
+ $out = [
428
+ 'id' => $ctx->id,
429
+ ];
430
+ if ($ctx->op !== null) {
431
+ $out['op'] = [
432
+ 'name' => $ctx->op->name,
433
+ 'input' => $ctx->op->input,
663
434
  ];
664
- if ($ctx->op !== null) {
665
- $out['op'] = [
666
- 'name' => $ctx->op->name,
667
- 'input' => $ctx->op->input,
668
- ];
669
- }
670
- return [$out, null];
671
435
  }
672
- return [null, null];
436
+ return $out;
673
437
  });
674
438
  }
675
439
 
@@ -740,20 +504,20 @@ class PrimaryUtilityTest extends TestCase
740
504
 
741
505
  public function test_make_options_basic(): void
742
506
  {
743
- $spec = self::load_test_spec();
744
- $primary = self::get_spec($spec, 'primary');
745
- $client = ProjectNameSDK::test(null, null);
507
+ $client = self::client();
746
508
  $utility = $client->get_utility();
747
509
 
748
- $this->runset(self::get_spec($primary, 'makeOptions', 'basic'), function (array $entry) use ($client, $utility) {
749
- $in = $entry['in'] ?? [];
510
+ $this->runsection('makeOptions', function ($vin = null) use ($client, $utility) {
511
+ if (!is_array($vin)) {
512
+ $vin = [];
513
+ }
750
514
  $ctx = ($utility->make_context)([
751
- 'options' => $in['options'] ?? null,
752
- 'config' => $in['config'] ?? null,
515
+ 'options' => $vin['options'] ?? null,
516
+ 'config' => $vin['config'] ?? null,
753
517
  ], null);
754
518
  $ctx->client = $client;
755
519
  $ctx->utility = $utility;
756
- return [($utility->make_options)($ctx), null];
520
+ return ($utility->make_options)($ctx);
757
521
  });
758
522
  }
759
523
 
@@ -762,27 +526,20 @@ class PrimaryUtilityTest extends TestCase
762
526
 
763
527
  public function test_make_request_basic(): void
764
528
  {
765
- $spec = self::load_test_spec();
766
- $primary = self::get_spec($spec, 'primary');
767
- $client = ProjectNameSDK::test(null, null);
529
+ $client = self::client();
768
530
  $utility = $client->get_utility();
769
531
 
770
- $this->runset(self::get_spec($primary, 'makeRequest', 'basic'), function (array &$entry) use ($client, $utility) {
771
- $ctxmap = $entry['ctx'] ?? [];
772
- $ctx = self::make_ctx_from_map($ctxmap, $client, $utility);
532
+ $this->runsection('makeRequest', function (array $ctxmap) use ($client, $utility) {
533
+ $ctx = ProjectNameOmni::ctx_from_map($ctxmap, $client, $utility);
773
534
  $ctx->options = $client->options_map();
774
535
 
775
536
  [$_, $err] = ($utility->make_request)($ctx);
776
537
 
777
- // Update entry ctx for match checking
778
- if ($ctx->response !== null) {
779
- $entry['ctx']['response'] = 'exists';
780
- }
781
- if ($ctx->result !== null) {
782
- $entry['ctx']['result'] = 'exists';
538
+ ProjectNameOmni::sync_ctx($ctxmap, $ctx);
539
+ if ($err !== null) {
540
+ throw $err;
783
541
  }
784
-
785
- return [null, $err];
542
+ return null;
786
543
  });
787
544
  }
788
545
 
@@ -791,30 +548,19 @@ class PrimaryUtilityTest extends TestCase
791
548
 
792
549
  public function test_make_response_basic(): void
793
550
  {
794
- $spec = self::load_test_spec();
795
- $primary = self::get_spec($spec, 'primary');
796
- $client = ProjectNameSDK::test(null, null);
551
+ $client = self::client();
797
552
  $utility = $client->get_utility();
798
553
 
799
- $this->runset(self::get_spec($primary, 'makeResponse', 'basic'), function (array &$entry) use ($client, $utility) {
800
- $ctxmap = $entry['ctx'] ?? [];
801
- $ctx = self::make_ctx_from_map($ctxmap, $client, $utility);
802
- self::fixctx($ctx, $client);
554
+ $this->runsection('makeResponse', function (array $ctxmap) use ($client, $utility) {
555
+ $ctx = ProjectNameOmni::ctx_from_map($ctxmap, $client, $utility);
803
556
 
804
557
  [$_, $err] = ($utility->make_response)($ctx);
805
558
 
806
- // Update entry ctx for match with result data
807
- if ($ctx->result !== null) {
808
- $entry['ctx']['result'] = [
809
- 'ok' => $ctx->result->ok,
810
- 'status' => $ctx->result->status,
811
- 'statusText' => $ctx->result->status_text,
812
- 'headers' => $ctx->result->headers,
813
- 'body' => $ctx->result->body,
814
- ];
559
+ ProjectNameOmni::sync_ctx($ctxmap, $ctx);
560
+ if ($err !== null) {
561
+ throw $err;
815
562
  }
816
-
817
- return [null, $err];
563
+ return null;
818
564
  });
819
565
  }
820
566
 
@@ -891,36 +637,23 @@ class PrimaryUtilityTest extends TestCase
891
637
 
892
638
  public function test_make_spec_basic(): void
893
639
  {
894
- $spec = self::load_test_spec();
895
- $primary = self::get_spec($spec, 'primary');
896
- $setup_opts = self::get_spec($primary, 'makeSpec', 'DEF', 'setup', 'a');
897
- $spec_client = ProjectNameSDK::test(null, $setup_opts);
640
+ $R = self::runpack();
641
+ $setup = $R['spec']['makeSpec']['DEF']['setup']['a'] ?? null;
642
+ $spec_client = ProjectNameSDK::test(null, is_array($setup) ? $setup : null);
898
643
  $spec_utility = $spec_client->get_utility();
899
- $client = ProjectNameSDK::test(null, null);
900
- $utility = $client->get_utility();
644
+ $utility = self::client()->get_utility();
901
645
 
902
- $this->runset(self::get_spec($primary, 'makeSpec', 'basic'), function (array &$entry) use ($spec_client, $spec_utility, $utility) {
903
- $ctxmap = $entry['ctx'] ?? [];
904
- $ctx = self::make_ctx_from_map($ctxmap, $spec_client, $spec_utility);
646
+ $this->runsection('makeSpec', function (array $ctxmap) use ($spec_client, $spec_utility, $utility) {
647
+ $ctx = ProjectNameOmni::ctx_from_map($ctxmap, $spec_client, $spec_utility);
905
648
  $ctx->options = $spec_client->options_map();
906
649
 
907
650
  [$_, $err] = ($utility->make_spec)($ctx);
908
651
 
909
- // Update entry ctx for match
910
- if ($ctx->spec !== null) {
911
- $entry['ctx']['spec'] = [
912
- 'base' => $ctx->spec->base,
913
- 'prefix' => $ctx->spec->prefix,
914
- 'suffix' => $ctx->spec->suffix,
915
- 'method' => $ctx->spec->method,
916
- 'params' => $ctx->spec->params,
917
- 'query' => $ctx->spec->query,
918
- 'headers' => $ctx->spec->headers,
919
- 'step' => $ctx->spec->step,
920
- ];
652
+ ProjectNameOmni::sync_ctx($ctxmap, $ctx);
653
+ if ($err !== null) {
654
+ throw $err;
921
655
  }
922
-
923
- return [null, $err];
656
+ return null;
924
657
  });
925
658
  }
926
659
 
@@ -953,18 +686,15 @@ class PrimaryUtilityTest extends TestCase
953
686
 
954
687
  public function test_make_url_basic(): void
955
688
  {
956
- $spec = self::load_test_spec();
957
- $primary = self::get_spec($spec, 'primary');
958
- $client = ProjectNameSDK::test(null, null);
689
+ $client = self::client();
959
690
  $utility = $client->get_utility();
960
691
 
961
- $this->runset(self::get_spec($primary, 'makeUrl', 'basic'), function (array $entry) use ($client, $utility) {
962
- $ctxmap = $entry['ctx'] ?? [];
963
- $ctx = self::make_ctx_from_map($ctxmap, $client, $utility);
692
+ $this->runsection('makeUrl', function (array $ctxmap) use ($client, $utility) {
693
+ $ctx = ProjectNameOmni::ctx_from_map($ctxmap, $client, $utility);
964
694
  if ($ctx->result === null) {
965
695
  $ctx->result = new ProjectNameResult([]);
966
696
  }
967
- return ($utility->make_url)($ctx);
697
+ return ProjectNameOmni::unwrap(($utility->make_url)($ctx));
968
698
  });
969
699
  }
970
700
 
@@ -973,18 +703,17 @@ class PrimaryUtilityTest extends TestCase
973
703
 
974
704
  public function test_operator_basic(): void
975
705
  {
976
- $spec = self::load_test_spec();
977
- $primary = self::get_spec($spec, 'primary');
978
-
979
- $this->runset(self::get_spec($primary, 'operator', 'basic'), function (array $entry) {
980
- $in = $entry['in'] ?? [];
981
- $op = new ProjectNameOperation($in);
982
- return [[
706
+ $this->runsection('operator', function ($vin = null) {
707
+ if (!is_array($vin)) {
708
+ $vin = [];
709
+ }
710
+ $op = new ProjectNameOperation($vin);
711
+ return [
983
712
  'entity' => $op->entity,
984
713
  'name' => $op->name,
985
714
  'input' => $op->input,
986
715
  'points' => $op->points,
987
- ], null];
716
+ ];
988
717
  });
989
718
  }
990
719
 
@@ -993,46 +722,19 @@ class PrimaryUtilityTest extends TestCase
993
722
 
994
723
  public function test_param_basic(): void
995
724
  {
996
- $spec = self::load_test_spec();
997
- $primary = self::get_spec($spec, 'primary');
998
- $client = ProjectNameSDK::test(null, null);
725
+ $client = self::client();
999
726
  $utility = $client->get_utility();
1000
727
 
1001
- $this->runset(self::get_spec($primary, 'param', 'basic'), function (array &$entry) use ($client, $utility) {
1002
- $args = $entry['args'] ?? [];
1003
- if (count($args) < 2) {
1004
- return [null, null];
1005
- }
728
+ $this->runsection('param', function ($ctxmap = null, $name = null) use ($client, $utility) {
729
+ $ctx = ProjectNameOmni::ctx_from_map(
730
+ is_array($ctxmap) ? $ctxmap : [], $client, $utility);
1006
731
 
1007
- $ctxmap = $args[0] ?? [];
1008
- if (!is_array($ctxmap)) {
1009
- $ctxmap = [];
1010
- }
1011
- $ctx = self::make_ctx_from_map($ctxmap, $client, $utility);
1012
- $paramdef = $args[1];
1013
-
1014
- $result = ($utility->param)($ctx, $paramdef);
1015
-
1016
- // Update entry ctx for match
1017
- if (isset($entry['match']) && is_array($entry['match'])) {
1018
- if (isset($entry['match']['ctx']) && is_array($entry['match']['ctx'])) {
1019
- $ctx_match = $entry['match']['ctx'];
1020
- if (!isset($entry['ctx'])) {
1021
- $entry['ctx'] = [];
1022
- }
1023
- if (isset($ctx_match['spec']) && is_array($ctx_match['spec'])) {
1024
- if ($ctx->spec !== null) {
1025
- if (isset($ctx_match['spec']['alias'])) {
1026
- $entry['ctx']['spec'] = [
1027
- 'alias' => $ctx->spec->alias_map,
1028
- ];
1029
- }
1030
- }
1031
- }
1032
- }
1033
- }
732
+ $result = ($utility->param)($ctx, $name);
1034
733
 
1035
- return [$result, null];
734
+ if (is_array($ctxmap)) {
735
+ ProjectNameOmni::sync_ctx($ctxmap, $ctx);
736
+ }
737
+ return $result;
1036
738
  });
1037
739
  }
1038
740
 
@@ -1041,29 +743,22 @@ class PrimaryUtilityTest extends TestCase
1041
743
 
1042
744
  public function test_prepare_auth_basic(): void
1043
745
  {
1044
- $spec = self::load_test_spec();
1045
- $primary = self::get_spec($spec, 'primary');
1046
- $setup_opts = self::get_spec($primary, 'prepareAuth', 'DEF', 'setup', 'a');
1047
- $auth_client = ProjectNameSDK::test(null, $setup_opts);
746
+ $R = self::runpack();
747
+ $setup = $R['spec']['prepareAuth']['DEF']['setup']['a'] ?? null;
748
+ $auth_client = ProjectNameSDK::test(null, is_array($setup) ? $setup : null);
1048
749
  $auth_utility = $auth_client->get_utility();
1049
- $client = ProjectNameSDK::test(null, null);
1050
- $utility = $client->get_utility();
750
+ $utility = self::client()->get_utility();
1051
751
 
1052
- $this->runset(self::get_spec($primary, 'prepareAuth', 'basic'), function (array &$entry) use ($auth_client, $auth_utility, $utility) {
1053
- $ctxmap = $entry['ctx'] ?? [];
1054
- $ctx = self::make_ctx_from_map($ctxmap, $auth_client, $auth_utility);
1055
- self::fixctx($ctx, $auth_client);
752
+ $this->runsection('prepareAuth', function (array $ctxmap) use ($auth_client, $auth_utility, $utility) {
753
+ $ctx = ProjectNameOmni::ctx_from_map($ctxmap, $auth_client, $auth_utility);
1056
754
 
1057
755
  [$_, $err] = ($utility->prepare_auth)($ctx);
1058
756
 
1059
- // Update entry ctx for match
1060
- if ($ctx->spec !== null) {
1061
- $entry['ctx']['spec'] = [
1062
- 'headers' => $ctx->spec->headers,
1063
- ];
757
+ ProjectNameOmni::sync_ctx($ctxmap, $ctx);
758
+ if ($err !== null) {
759
+ throw $err;
1064
760
  }
1065
-
1066
- return [null, $err];
761
+ return null;
1067
762
  });
1068
763
  }
1069
764
 
@@ -1072,16 +767,12 @@ class PrimaryUtilityTest extends TestCase
1072
767
 
1073
768
  public function test_prepare_body_basic(): void
1074
769
  {
1075
- $spec = self::load_test_spec();
1076
- $primary = self::get_spec($spec, 'primary');
1077
- $client = ProjectNameSDK::test(null, null);
770
+ $client = self::client();
1078
771
  $utility = $client->get_utility();
1079
772
 
1080
- $this->runset(self::get_spec($primary, 'prepareBody', 'basic'), function (array $entry) use ($client, $utility) {
1081
- $ctxmap = $entry['ctx'] ?? [];
1082
- $ctx = self::make_ctx_from_map($ctxmap, $client, $utility);
1083
- self::fixctx($ctx, $client);
1084
- return [($utility->prepare_body)($ctx), null];
773
+ $this->runsection('prepareBody', function (array $ctxmap) use ($client, $utility) {
774
+ $ctx = ProjectNameOmni::ctx_from_map($ctxmap, $client, $utility);
775
+ return ($utility->prepare_body)($ctx);
1085
776
  });
1086
777
  }
1087
778
 
@@ -1090,15 +781,12 @@ class PrimaryUtilityTest extends TestCase
1090
781
 
1091
782
  public function test_prepare_headers_basic(): void
1092
783
  {
1093
- $spec = self::load_test_spec();
1094
- $primary = self::get_spec($spec, 'primary');
1095
- $client = ProjectNameSDK::test(null, null);
784
+ $client = self::client();
1096
785
  $utility = $client->get_utility();
1097
786
 
1098
- $this->runset(self::get_spec($primary, 'prepareHeaders', 'basic'), function (array $entry) use ($client, $utility) {
1099
- $ctxmap = $entry['ctx'] ?? [];
1100
- $ctx = self::make_ctx_from_map($ctxmap, $client, $utility);
1101
- return [($utility->prepare_headers)($ctx), null];
787
+ $this->runsection('prepareHeaders', function (array $ctxmap) use ($client, $utility) {
788
+ $ctx = ProjectNameOmni::ctx_from_map($ctxmap, $client, $utility);
789
+ return ($utility->prepare_headers)($ctx);
1102
790
  });
1103
791
  }
1104
792
 
@@ -1107,15 +795,12 @@ class PrimaryUtilityTest extends TestCase
1107
795
 
1108
796
  public function test_prepare_method_basic(): void
1109
797
  {
1110
- $spec = self::load_test_spec();
1111
- $primary = self::get_spec($spec, 'primary');
1112
- $client = ProjectNameSDK::test(null, null);
798
+ $client = self::client();
1113
799
  $utility = $client->get_utility();
1114
800
 
1115
- $this->runset(self::get_spec($primary, 'prepareMethod', 'basic'), function (array $entry) use ($client, $utility) {
1116
- $ctxmap = $entry['ctx'] ?? [];
1117
- $ctx = self::make_ctx_from_map($ctxmap, $client, $utility);
1118
- return [($utility->prepare_method)($ctx), null];
801
+ $this->runsection('prepareMethod', function (array $ctxmap) use ($client, $utility) {
802
+ $ctx = ProjectNameOmni::ctx_from_map($ctxmap, $client, $utility);
803
+ return ($utility->prepare_method)($ctx);
1119
804
  });
1120
805
  }
1121
806
 
@@ -1124,15 +809,12 @@ class PrimaryUtilityTest extends TestCase
1124
809
 
1125
810
  public function test_prepare_params_basic(): void
1126
811
  {
1127
- $spec = self::load_test_spec();
1128
- $primary = self::get_spec($spec, 'primary');
1129
- $client = ProjectNameSDK::test(null, null);
812
+ $client = self::client();
1130
813
  $utility = $client->get_utility();
1131
814
 
1132
- $this->runset(self::get_spec($primary, 'prepareParams', 'basic'), function (array $entry) use ($client, $utility) {
1133
- $ctxmap = $entry['ctx'] ?? [];
1134
- $ctx = self::make_ctx_from_map($ctxmap, $client, $utility);
1135
- return [($utility->prepare_params)($ctx), null];
815
+ $this->runsection('prepareParams', function (array $ctxmap) use ($client, $utility) {
816
+ $ctx = ProjectNameOmni::ctx_from_map($ctxmap, $client, $utility);
817
+ return ($utility->prepare_params)($ctx);
1136
818
  });
1137
819
  }
1138
820
 
@@ -1141,17 +823,12 @@ class PrimaryUtilityTest extends TestCase
1141
823
 
1142
824
  public function test_prepare_path_basic(): void
1143
825
  {
1144
- // Was hand-written cases that had drifted out of the shared corpus
1145
- // (the preparePath fixture shipped as an empty `set: []`).
1146
- $spec = self::load_test_spec();
1147
- $primary = self::get_spec($spec, 'primary');
1148
- $client = ProjectNameSDK::test(null, null);
826
+ $client = self::client();
1149
827
  $utility = $client->get_utility();
1150
828
 
1151
- $this->runset(self::get_spec($primary, 'preparePath', 'basic'), function (array $entry) use ($client, $utility) {
1152
- $ctxmap = $entry['ctx'] ?? [];
1153
- $ctx = self::make_ctx_from_map($ctxmap, $client, $utility);
1154
- return [($utility->prepare_path)($ctx), null];
829
+ $this->runsection('preparePath', function (array $ctxmap) use ($client, $utility) {
830
+ $ctx = ProjectNameOmni::ctx_from_map($ctxmap, $client, $utility);
831
+ return ($utility->prepare_path)($ctx);
1155
832
  });
1156
833
  }
1157
834
 
@@ -1177,15 +854,12 @@ class PrimaryUtilityTest extends TestCase
1177
854
 
1178
855
  public function test_prepare_query_basic(): void
1179
856
  {
1180
- $spec = self::load_test_spec();
1181
- $primary = self::get_spec($spec, 'primary');
1182
- $client = ProjectNameSDK::test(null, null);
857
+ $client = self::client();
1183
858
  $utility = $client->get_utility();
1184
859
 
1185
- $this->runset(self::get_spec($primary, 'prepareQuery', 'basic'), function (array $entry) use ($client, $utility) {
1186
- $ctxmap = $entry['ctx'] ?? [];
1187
- $ctx = self::make_ctx_from_map($ctxmap, $client, $utility);
1188
- return [($utility->prepare_query)($ctx), null];
860
+ $this->runsection('prepareQuery', function (array $ctxmap) use ($client, $utility) {
861
+ $ctx = ProjectNameOmni::ctx_from_map($ctxmap, $client, $utility);
862
+ return ($utility->prepare_query)($ctx);
1189
863
  });
1190
864
  }
1191
865
 
@@ -1194,15 +868,11 @@ class PrimaryUtilityTest extends TestCase
1194
868
 
1195
869
  public function test_result_basic_basic(): void
1196
870
  {
1197
- $spec = self::load_test_spec();
1198
- $primary = self::get_spec($spec, 'primary');
1199
- $client = ProjectNameSDK::test(null, null);
871
+ $client = self::client();
1200
872
  $utility = $client->get_utility();
1201
873
 
1202
- $this->runset(self::get_spec($primary, 'resultBasic', 'basic'), function (array $entry) use ($client, $utility) {
1203
- $ctxmap = $entry['ctx'] ?? [];
1204
- $ctx = self::make_ctx_from_map($ctxmap, $client, $utility);
1205
- self::fixctx($ctx, $client);
874
+ $this->runsection('resultBasic', function (array $ctxmap) use ($client, $utility) {
875
+ $ctx = ProjectNameOmni::ctx_from_map($ctxmap, $client, $utility);
1206
876
 
1207
877
  $result = ($utility->result_basic)($ctx);
1208
878
 
@@ -1211,11 +881,12 @@ class PrimaryUtilityTest extends TestCase
1211
881
  'statusText' => $result->status_text,
1212
882
  ];
1213
883
  if ($result->err !== null) {
1214
- $err_msg = ($result->err instanceof ProjectNameError) ? $result->err->msg : (string)$result->err;
884
+ $err_msg = ($result->err instanceof ProjectNameError)
885
+ ? $result->err->msg : (string) $result->err;
1215
886
  $out['err'] = ['message' => $err_msg];
1216
887
  }
1217
888
 
1218
- return [$out, null];
889
+ return $out;
1219
890
  });
1220
891
  }
1221
892
 
@@ -1224,25 +895,16 @@ class PrimaryUtilityTest extends TestCase
1224
895
 
1225
896
  public function test_result_body_basic(): void
1226
897
  {
1227
- $spec = self::load_test_spec();
1228
- $primary = self::get_spec($spec, 'primary');
1229
- $client = ProjectNameSDK::test(null, null);
898
+ $client = self::client();
1230
899
  $utility = $client->get_utility();
1231
900
 
1232
- $this->runset(self::get_spec($primary, 'resultBody', 'basic'), function (array &$entry) use ($client, $utility) {
1233
- $ctxmap = $entry['ctx'] ?? [];
1234
- $ctx = self::make_ctx_from_map($ctxmap, $client, $utility);
901
+ $this->runsection('resultBody', function (array $ctxmap) use ($client, $utility) {
902
+ $ctx = ProjectNameOmni::ctx_from_map($ctxmap, $client, $utility);
1235
903
 
1236
904
  ($utility->result_body)($ctx);
1237
905
 
1238
- // Update entry ctx for match
1239
- if ($ctx->result !== null) {
1240
- $entry['ctx']['result'] = [
1241
- 'body' => $ctx->result->body,
1242
- ];
1243
- }
1244
-
1245
- return [null, null];
906
+ ProjectNameOmni::sync_ctx($ctxmap, $ctx);
907
+ return null;
1246
908
  });
1247
909
  }
1248
910
 
@@ -1251,25 +913,16 @@ class PrimaryUtilityTest extends TestCase
1251
913
 
1252
914
  public function test_result_headers_basic(): void
1253
915
  {
1254
- $spec = self::load_test_spec();
1255
- $primary = self::get_spec($spec, 'primary');
1256
- $client = ProjectNameSDK::test(null, null);
916
+ $client = self::client();
1257
917
  $utility = $client->get_utility();
1258
918
 
1259
- $this->runset(self::get_spec($primary, 'resultHeaders', 'basic'), function (array &$entry) use ($client, $utility) {
1260
- $ctxmap = $entry['ctx'] ?? [];
1261
- $ctx = self::make_ctx_from_map($ctxmap, $client, $utility);
919
+ $this->runsection('resultHeaders', function (array $ctxmap) use ($client, $utility) {
920
+ $ctx = ProjectNameOmni::ctx_from_map($ctxmap, $client, $utility);
1262
921
 
1263
922
  ($utility->result_headers)($ctx);
1264
923
 
1265
- // Update entry ctx for match
1266
- if ($ctx->result !== null) {
1267
- $entry['ctx']['result'] = [
1268
- 'headers' => $ctx->result->headers,
1269
- ];
1270
- }
1271
-
1272
- return [null, null];
924
+ ProjectNameOmni::sync_ctx($ctxmap, $ctx);
925
+ return null;
1273
926
  });
1274
927
  }
1275
928
 
@@ -1278,23 +931,16 @@ class PrimaryUtilityTest extends TestCase
1278
931
 
1279
932
  public function test_transform_request_basic(): void
1280
933
  {
1281
- $spec = self::load_test_spec();
1282
- $primary = self::get_spec($spec, 'primary');
1283
- $client = ProjectNameSDK::test(null, null);
934
+ $client = self::client();
1284
935
  $utility = $client->get_utility();
1285
936
 
1286
- $this->runset(self::get_spec($primary, 'transformRequest', 'basic'), function (array &$entry) use ($client, $utility) {
1287
- $ctxmap = $entry['ctx'] ?? [];
1288
- $ctx = self::make_ctx_from_map($ctxmap, $client, $utility);
937
+ $this->runsection('transformRequest', function (array $ctxmap) use ($client, $utility) {
938
+ $ctx = ProjectNameOmni::ctx_from_map($ctxmap, $client, $utility);
1289
939
 
1290
940
  $result = ($utility->transform_request)($ctx);
1291
941
 
1292
- // Update entry ctx for match (step changed)
1293
- if ($ctx->spec !== null && isset($entry['ctx']['spec']) && is_array($entry['ctx']['spec'])) {
1294
- $entry['ctx']['spec']['step'] = $ctx->spec->step;
1295
- }
1296
-
1297
- return [$result, null];
942
+ ProjectNameOmni::sync_ctx($ctxmap, $ctx);
943
+ return $result;
1298
944
  });
1299
945
  }
1300
946
 
@@ -1303,23 +949,16 @@ class PrimaryUtilityTest extends TestCase
1303
949
 
1304
950
  public function test_transform_response_basic(): void
1305
951
  {
1306
- $spec = self::load_test_spec();
1307
- $primary = self::get_spec($spec, 'primary');
1308
- $client = ProjectNameSDK::test(null, null);
952
+ $client = self::client();
1309
953
  $utility = $client->get_utility();
1310
954
 
1311
- $this->runset(self::get_spec($primary, 'transformResponse', 'basic'), function (array &$entry) use ($client, $utility) {
1312
- $ctxmap = $entry['ctx'] ?? [];
1313
- $ctx = self::make_ctx_from_map($ctxmap, $client, $utility);
955
+ $this->runsection('transformResponse', function (array $ctxmap) use ($client, $utility) {
956
+ $ctx = ProjectNameOmni::ctx_from_map($ctxmap, $client, $utility);
1314
957
 
1315
958
  $result = ($utility->transform_response)($ctx);
1316
959
 
1317
- // Update entry ctx for match (step changed)
1318
- if ($ctx->spec !== null && isset($entry['ctx']['spec']) && is_array($entry['ctx']['spec'])) {
1319
- $entry['ctx']['spec']['step'] = $ctx->spec->step;
1320
- }
1321
-
1322
- return [$result, null];
960
+ ProjectNameOmni::sync_ctx($ctxmap, $ctx);
961
+ return $result;
1323
962
  });
1324
963
  }
1325
964
  }