@voxgig/sdkgen 1.3.14 → 1.3.18
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.
- package/bin/voxgig-sdkgen +1 -1
- package/dist/action/action.js.map +1 -1
- package/dist/action/feature.js.map +1 -1
- package/dist/action/target.js.map +1 -1
- package/dist/cmp/AgentGuide.js.map +1 -1
- package/dist/cmp/AgentGuideContent.js.map +1 -1
- package/dist/cmp/AgentGuideFeature.js.map +1 -1
- package/dist/cmp/AgentGuideTop.js.map +1 -1
- package/dist/cmp/Changelog.js.map +1 -1
- package/dist/cmp/Deploy.js.map +1 -1
- package/dist/cmp/Entity.js +5 -1
- package/dist/cmp/Entity.js.map +1 -1
- package/dist/cmp/Feature.js +2 -1
- package/dist/cmp/Feature.js.map +1 -1
- package/dist/cmp/FeatureHook.js.map +1 -1
- package/dist/cmp/License.js.map +1 -1
- package/dist/cmp/Main.js.map +1 -1
- package/dist/cmp/Readme.js.map +1 -1
- package/dist/cmp/ReadmeEntity.js.map +1 -1
- package/dist/cmp/ReadmeErrors.js +1 -1
- package/dist/cmp/ReadmeErrors.js.map +1 -1
- package/dist/cmp/ReadmeExplanation.js +2 -2
- package/dist/cmp/ReadmeExplanation.js.map +1 -1
- package/dist/cmp/ReadmeHowto.js.map +1 -1
- package/dist/cmp/ReadmeInstall.js.map +1 -1
- package/dist/cmp/ReadmeIntro.js.map +1 -1
- package/dist/cmp/ReadmeModel.js.map +1 -1
- package/dist/cmp/ReadmeOptions.js.map +1 -1
- package/dist/cmp/ReadmeQuick.js.map +1 -1
- package/dist/cmp/ReadmeRef.js.map +1 -1
- package/dist/cmp/ReadmeTop.js +1 -1
- package/dist/cmp/ReadmeTop.js.map +1 -1
- package/dist/cmp/Security.js.map +1 -1
- package/dist/cmp/Test.js.map +1 -1
- package/dist/helpers/buildIdNames.js.map +1 -1
- package/dist/helpers/canonType.d.ts +3 -2
- package/dist/helpers/canonType.js +112 -24
- package/dist/helpers/canonType.js.map +1 -1
- package/dist/helpers/collectDeps.d.ts +1 -1
- package/dist/helpers/collectDeps.js +36 -13
- package/dist/helpers/collectDeps.js.map +1 -1
- package/dist/helpers/getMatchEntries.js.map +1 -1
- package/dist/helpers/naming.d.ts +7 -1
- package/dist/helpers/naming.js +90 -0
- package/dist/helpers/naming.js.map +1 -1
- package/dist/helpers/opExample.d.ts +1 -1
- package/dist/helpers/opExample.js +37 -20
- package/dist/helpers/opExample.js.map +1 -1
- package/dist/helpers/opShape.d.ts +5 -1
- package/dist/helpers/opShape.js +174 -7
- package/dist/helpers/opShape.js.map +1 -1
- package/dist/helpers/packageMeta.js.map +1 -1
- package/dist/sdkgen.d.ts +3 -3
- package/dist/sdkgen.js +12 -2
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utility.js.map +1 -1
- package/package.json +20 -14
- package/project/.sdk/model/target/cpp.aontu +4 -4
- package/project/.sdk/model/target/go-cli.aontu +17 -17
- package/project/.sdk/model/target/go-mcp.aontu +11 -11
- package/project/.sdk/model/target/go.aontu +1 -1
- package/project/.sdk/model/target/haskell.aontu +6 -3
- package/project/.sdk/model/target/java.aontu +4 -4
- package/project/.sdk/model/target/kotlin.aontu +4 -4
- package/project/.sdk/model/target/lean.aontu +51 -0
- package/project/.sdk/model/target/scala.aontu +4 -4
- package/project/.sdk/model/target/zig.aontu +12 -2
- package/project/.sdk/src/cmp/c/Config_c.ts +16 -4
- package/project/.sdk/src/cmp/c/EntityTypes_c.ts +167 -0
- package/project/.sdk/src/cmp/c/Entity_c.ts +3 -3
- package/project/.sdk/src/cmp/c/Main_c.ts +4 -0
- package/project/.sdk/src/cmp/c/ReadmeEntity_c.ts +192 -0
- package/project/.sdk/src/cmp/c/ReadmeExamplesTest_c.ts +169 -0
- package/project/.sdk/src/cmp/c/ReadmeExplanation_c.ts +55 -0
- package/project/.sdk/src/cmp/c/ReadmeHowto_c.ts +168 -0
- package/project/.sdk/src/cmp/c/ReadmeInstall_c.ts +52 -0
- package/project/.sdk/src/cmp/c/ReadmeIntro_c.ts +67 -0
- package/project/.sdk/src/cmp/c/ReadmeModel_c.ts +151 -0
- package/project/.sdk/src/cmp/c/ReadmeOptions_c.ts +65 -0
- package/project/.sdk/src/cmp/c/ReadmeQuick_c.ts +225 -0
- package/project/.sdk/src/cmp/c/ReadmeRef_c.ts +398 -0
- package/project/.sdk/src/cmp/c/ReadmeTopHowto_c.ts +24 -0
- package/project/.sdk/src/cmp/c/ReadmeTopQuick_c.ts +104 -0
- package/project/.sdk/src/cmp/c/ReadmeTopTest_c.ts +86 -0
- package/project/.sdk/src/cmp/c/TestDirect_c.ts +3 -3
- package/project/.sdk/src/cmp/c/TestEntity_c.ts +10 -0
- package/project/.sdk/src/cmp/c/Test_c.ts +4 -0
- package/project/.sdk/src/cmp/c/utility_c.ts +8 -2
- package/project/.sdk/src/cmp/clojure/Entity_clojure.ts +1 -1
- package/project/.sdk/src/cmp/clojure/ReadmeEntity_clojure.ts +182 -0
- package/project/.sdk/src/cmp/clojure/ReadmeExamplesTest_clojure.ts +65 -0
- package/project/.sdk/src/cmp/clojure/ReadmeExplanation_clojure.ts +44 -0
- package/project/.sdk/src/cmp/clojure/ReadmeHowto_clojure.ts +144 -0
- package/project/.sdk/src/cmp/clojure/ReadmeInstall_clojure.ts +51 -0
- package/project/.sdk/src/cmp/clojure/ReadmeIntro_clojure.ts +66 -0
- package/project/.sdk/src/cmp/clojure/ReadmeModel_clojure.ts +156 -0
- package/project/.sdk/src/cmp/clojure/ReadmeOptions_clojure.ts +61 -0
- package/project/.sdk/src/cmp/clojure/ReadmeQuick_clojure.ts +210 -0
- package/project/.sdk/src/cmp/clojure/ReadmeRef_clojure.ts +409 -0
- package/project/.sdk/src/cmp/clojure/ReadmeTopHowto_clojure.ts +24 -0
- package/project/.sdk/src/cmp/clojure/ReadmeTopQuick_clojure.ts +98 -0
- package/project/.sdk/src/cmp/clojure/ReadmeTopTest_clojure.ts +78 -0
- package/project/.sdk/src/cmp/clojure/TestDirect_clojure.ts +58 -0
- package/project/.sdk/src/cmp/clojure/TestEntity_clojure.ts +79 -0
- package/project/.sdk/src/cmp/clojure/Test_clojure.ts +21 -65
- package/project/.sdk/src/cmp/cpp/EntityTypes_cpp.ts +174 -0
- package/project/.sdk/src/cmp/cpp/Entity_cpp.ts +3 -3
- package/project/.sdk/src/cmp/cpp/MainEntity_cpp.ts +2 -2
- package/project/.sdk/src/cmp/cpp/Main_cpp.ts +5 -0
- package/project/.sdk/src/cmp/cpp/ReadmeEntity_cpp.ts +170 -0
- package/project/.sdk/src/cmp/cpp/ReadmeExamplesTest_cpp.ts +136 -0
- package/project/.sdk/src/cmp/cpp/ReadmeExplanation_cpp.ts +45 -0
- package/project/.sdk/src/cmp/cpp/ReadmeHowto_cpp.ts +139 -0
- package/project/.sdk/src/cmp/cpp/ReadmeInstall_cpp.ts +42 -0
- package/project/.sdk/src/cmp/cpp/ReadmeIntro_cpp.ts +69 -0
- package/project/.sdk/src/cmp/cpp/ReadmeModel_cpp.ts +155 -0
- package/project/.sdk/src/cmp/cpp/ReadmeOptions_cpp.ts +62 -0
- package/project/.sdk/src/cmp/cpp/ReadmeQuick_cpp.ts +234 -0
- package/project/.sdk/src/cmp/cpp/ReadmeRef_cpp.ts +387 -0
- package/project/.sdk/src/cmp/cpp/ReadmeTopHowto_cpp.ts +24 -0
- package/project/.sdk/src/cmp/cpp/ReadmeTopQuick_cpp.ts +95 -0
- package/project/.sdk/src/cmp/cpp/ReadmeTopTest_cpp.ts +70 -0
- package/project/.sdk/src/cmp/cpp/TestDirect_cpp.ts +3 -3
- package/project/.sdk/src/cmp/cpp/TestEntity_cpp.ts +5 -1
- package/project/.sdk/src/cmp/cpp/Test_cpp.ts +4 -0
- package/project/.sdk/src/cmp/csharp/EntityTypes_csharp.ts +195 -0
- package/project/.sdk/src/cmp/csharp/Entity_csharp.ts +3 -3
- package/project/.sdk/src/cmp/csharp/MainEntity_csharp.ts +2 -2
- package/project/.sdk/src/cmp/csharp/Main_csharp.ts +6 -0
- package/project/.sdk/src/cmp/csharp/Package_csharp.ts +1 -1
- package/project/.sdk/src/cmp/csharp/ReadmeEntity_csharp.ts +174 -0
- package/project/.sdk/src/cmp/csharp/ReadmeExamplesTest_csharp.ts +210 -0
- package/project/.sdk/src/cmp/csharp/ReadmeExplanation_csharp.ts +42 -0
- package/project/.sdk/src/cmp/csharp/ReadmeHowto_csharp.ts +168 -0
- package/project/.sdk/src/cmp/csharp/ReadmeInstall_csharp.ts +41 -0
- package/project/.sdk/src/cmp/csharp/ReadmeIntro_csharp.ts +65 -0
- package/project/.sdk/src/cmp/csharp/ReadmeModel_csharp.ts +148 -0
- package/project/.sdk/src/cmp/csharp/ReadmeOptions_csharp.ts +60 -0
- package/project/.sdk/src/cmp/csharp/ReadmeQuick_csharp.ts +219 -0
- package/project/.sdk/src/cmp/csharp/ReadmeRef_csharp.ts +390 -0
- package/project/.sdk/src/cmp/csharp/ReadmeTopHowto_csharp.ts +25 -0
- package/project/.sdk/src/cmp/csharp/ReadmeTopQuick_csharp.ts +92 -0
- package/project/.sdk/src/cmp/csharp/ReadmeTopTest_csharp.ts +77 -0
- package/project/.sdk/src/cmp/csharp/TestDirect_csharp.ts +3 -3
- package/project/.sdk/src/cmp/csharp/Test_csharp.ts +4 -0
- package/project/.sdk/src/cmp/dart/EntityTypes_dart.ts +43 -30
- package/project/.sdk/src/cmp/dart/Entity_dart.ts +11 -3
- package/project/.sdk/src/cmp/dart/MainEntity_dart.ts +2 -2
- package/project/.sdk/src/cmp/dart/Main_dart.ts +3 -3
- package/project/.sdk/src/cmp/dart/Package_dart.ts +1 -1
- package/project/.sdk/src/cmp/dart/ReadmeEntity_dart.ts +166 -0
- package/project/.sdk/src/cmp/dart/ReadmeExamplesTest_dart.ts +238 -0
- package/project/.sdk/src/cmp/dart/ReadmeExplanation_dart.ts +53 -0
- package/project/.sdk/src/cmp/dart/ReadmeHowto_dart.ts +151 -0
- package/project/.sdk/src/cmp/dart/ReadmeInstall_dart.ts +59 -0
- package/project/.sdk/src/cmp/dart/ReadmeIntro_dart.ts +65 -0
- package/project/.sdk/src/cmp/dart/ReadmeModel_dart.ts +151 -0
- package/project/.sdk/src/cmp/dart/ReadmeOptions_dart.ts +63 -0
- package/project/.sdk/src/cmp/dart/ReadmeQuick_dart.ts +214 -0
- package/project/.sdk/src/cmp/dart/ReadmeRef_dart.ts +381 -0
- package/project/.sdk/src/cmp/dart/ReadmeTopHowto_dart.ts +24 -0
- package/project/.sdk/src/cmp/dart/ReadmeTopQuick_dart.ts +95 -0
- package/project/.sdk/src/cmp/dart/ReadmeTopTest_dart.ts +78 -0
- package/project/.sdk/src/cmp/dart/TestDirect_dart.ts +4 -4
- package/project/.sdk/src/cmp/dart/TestEntity_dart.ts +52 -0
- package/project/.sdk/src/cmp/dart/Test_dart.ts +6 -0
- package/project/.sdk/src/cmp/dart/fragment/Entity.fragment.dart +1 -3
- package/project/.sdk/src/cmp/dart/fragment/Entity.test.fragment.dart +1 -40
- package/project/.sdk/src/cmp/dart/fragment/Main.fragment.dart +3 -3
- package/project/.sdk/src/cmp/elixir/EntityTypes_elixir.ts +164 -0
- package/project/.sdk/src/cmp/elixir/Entity_elixir.ts +1 -1
- package/project/.sdk/src/cmp/elixir/Main_elixir.ts +4 -0
- package/project/.sdk/src/cmp/elixir/Package_elixir.ts +3 -1
- package/project/.sdk/src/cmp/elixir/ReadmeEntity_elixir.ts +163 -0
- package/project/.sdk/src/cmp/elixir/ReadmeExamplesTest_elixir.ts +144 -0
- package/project/.sdk/src/cmp/elixir/ReadmeExplanation_elixir.ts +55 -0
- package/project/.sdk/src/cmp/elixir/ReadmeHowto_elixir.ts +149 -0
- package/project/.sdk/src/cmp/elixir/ReadmeInstall_elixir.ts +67 -0
- package/project/.sdk/src/cmp/elixir/ReadmeIntro_elixir.ts +66 -0
- package/project/.sdk/src/cmp/elixir/ReadmeModel_elixir.ts +150 -0
- package/project/.sdk/src/cmp/elixir/ReadmeOptions_elixir.ts +62 -0
- package/project/.sdk/src/cmp/elixir/ReadmeQuick_elixir.ts +198 -0
- package/project/.sdk/src/cmp/elixir/ReadmeRef_elixir.ts +333 -0
- package/project/.sdk/src/cmp/elixir/ReadmeTopHowto_elixir.ts +26 -0
- package/project/.sdk/src/cmp/elixir/ReadmeTopQuick_elixir.ts +79 -0
- package/project/.sdk/src/cmp/elixir/ReadmeTopTest_elixir.ts +68 -0
- package/project/.sdk/src/cmp/elixir/Test_elixir.ts +4 -0
- package/project/.sdk/src/cmp/elixir/fragment/EntityCreateOp.fragment.ex +4 -0
- package/project/.sdk/src/cmp/elixir/fragment/EntityListOp.fragment.ex +4 -0
- package/project/.sdk/src/cmp/elixir/fragment/EntityLoadOp.fragment.ex +4 -0
- package/project/.sdk/src/cmp/elixir/fragment/EntityRemoveOp.fragment.ex +4 -0
- package/project/.sdk/src/cmp/elixir/fragment/EntityUpdateOp.fragment.ex +4 -0
- package/project/.sdk/src/cmp/elixir/utility_elixir.ts +32 -0
- package/project/.sdk/src/cmp/go/Config_go.ts +4 -1
- package/project/.sdk/src/cmp/go/EntityTypes_go.ts +121 -20
- package/project/.sdk/src/cmp/go/Entity_go.ts +3 -3
- package/project/.sdk/src/cmp/go/Main_go.ts +7 -6
- package/project/.sdk/src/cmp/go/Package_go.ts +1 -1
- package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +6 -1
- package/project/.sdk/src/cmp/go/TestDirect_go.ts +3 -3
- package/project/.sdk/src/cmp/go/TestEntity_go.ts +11 -4
- package/project/.sdk/src/cmp/go/utility_go.ts +28 -2
- package/project/.sdk/src/cmp/go-cli/Main_go-cli.ts +249 -44
- package/project/.sdk/src/cmp/go-cli/fragment/main.fragment.go +27 -5
- package/project/.sdk/src/cmp/go-mcp/Main_go-mcp.ts +200 -31
- package/project/.sdk/src/cmp/haskell/ReadmeEntity_haskell.ts +181 -0
- package/project/.sdk/src/cmp/haskell/ReadmeExamplesTest_haskell.ts +135 -0
- package/project/.sdk/src/cmp/haskell/ReadmeExplanation_haskell.ts +48 -0
- package/project/.sdk/src/cmp/haskell/ReadmeHowto_haskell.ts +168 -0
- package/project/.sdk/src/cmp/haskell/ReadmeInstall_haskell.ts +51 -0
- package/project/.sdk/src/cmp/haskell/ReadmeIntro_haskell.ts +67 -0
- package/project/.sdk/src/cmp/haskell/ReadmeModel_haskell.ts +160 -0
- package/project/.sdk/src/cmp/haskell/ReadmeOptions_haskell.ts +74 -0
- package/project/.sdk/src/cmp/haskell/ReadmeQuick_haskell.ts +237 -0
- package/project/.sdk/src/cmp/haskell/ReadmeRef_haskell.ts +405 -0
- package/project/.sdk/src/cmp/haskell/ReadmeTopHowto_haskell.ts +31 -0
- package/project/.sdk/src/cmp/haskell/ReadmeTopQuick_haskell.ts +104 -0
- package/project/.sdk/src/cmp/haskell/ReadmeTopTest_haskell.ts +80 -0
- package/project/.sdk/src/cmp/haskell/Test_haskell.ts +27 -2
- package/project/.sdk/src/cmp/java/EntityTypes_java.ts +206 -0
- package/project/.sdk/src/cmp/java/Entity_java.ts +3 -3
- package/project/.sdk/src/cmp/java/MainEntity_java.ts +2 -2
- package/project/.sdk/src/cmp/java/Main_java.ts +6 -0
- package/project/.sdk/src/cmp/java/Package_java.ts +1 -1
- package/project/.sdk/src/cmp/java/ReadmeEntity_java.ts +175 -0
- package/project/.sdk/src/cmp/java/ReadmeExamplesTest_java.ts +208 -0
- package/project/.sdk/src/cmp/java/ReadmeExplanation_java.ts +46 -0
- package/project/.sdk/src/cmp/java/ReadmeHowto_java.ts +156 -0
- package/project/.sdk/src/cmp/java/ReadmeInstall_java.ts +52 -0
- package/project/.sdk/src/cmp/java/ReadmeIntro_java.ts +66 -0
- package/project/.sdk/src/cmp/java/ReadmeModel_java.ts +150 -0
- package/project/.sdk/src/cmp/java/ReadmeOptions_java.ts +61 -0
- package/project/.sdk/src/cmp/java/ReadmeQuick_java.ts +230 -0
- package/project/.sdk/src/cmp/java/ReadmeRef_java.ts +388 -0
- package/project/.sdk/src/cmp/java/ReadmeTopHowto_java.ts +23 -0
- package/project/.sdk/src/cmp/java/ReadmeTopQuick_java.ts +103 -0
- package/project/.sdk/src/cmp/java/ReadmeTopTest_java.ts +77 -0
- package/project/.sdk/src/cmp/java/TestDirect_java.ts +3 -3
- package/project/.sdk/src/cmp/java/Test_java.ts +4 -0
- package/project/.sdk/src/cmp/js/EntityTypes_js.ts +25 -9
- package/project/.sdk/src/cmp/js/Entity_js.ts +3 -3
- package/project/.sdk/src/cmp/js/MainEntity_js.ts +6 -4
- package/project/.sdk/src/cmp/js/Main_js.ts +2 -2
- package/project/.sdk/src/cmp/js/ReadmeEntity_js.ts +4 -4
- package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +13 -4
- package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +4 -4
- package/project/.sdk/src/cmp/js/ReadmeRef_js.ts +5 -5
- package/project/.sdk/src/cmp/js/ReadmeTopQuick_js.ts +4 -4
- package/project/.sdk/src/cmp/js/ReadmeTopTest_js.ts +4 -4
- package/project/.sdk/src/cmp/js/TestDirect_js.ts +10 -9
- package/project/.sdk/src/cmp/js/TestEntity_js.ts +7 -2
- package/project/.sdk/src/cmp/js/fragment/Entity.test.fragment.js +0 -31
- package/project/.sdk/src/cmp/kotlin/EntityTypes_kotlin.ts +200 -0
- package/project/.sdk/src/cmp/kotlin/Entity_kotlin.ts +3 -3
- package/project/.sdk/src/cmp/kotlin/MainEntity_kotlin.ts +2 -2
- package/project/.sdk/src/cmp/kotlin/Main_kotlin.ts +6 -0
- package/project/.sdk/src/cmp/kotlin/Package_kotlin.ts +1 -1
- package/project/.sdk/src/cmp/kotlin/ReadmeEntity_kotlin.ts +175 -0
- package/project/.sdk/src/cmp/kotlin/ReadmeExamplesTest_kotlin.ts +198 -0
- package/project/.sdk/src/cmp/kotlin/ReadmeExplanation_kotlin.ts +47 -0
- package/project/.sdk/src/cmp/kotlin/ReadmeHowto_kotlin.ts +154 -0
- package/project/.sdk/src/cmp/kotlin/ReadmeInstall_kotlin.ts +50 -0
- package/project/.sdk/src/cmp/kotlin/ReadmeIntro_kotlin.ts +66 -0
- package/project/.sdk/src/cmp/kotlin/ReadmeModel_kotlin.ts +150 -0
- package/project/.sdk/src/cmp/kotlin/ReadmeOptions_kotlin.ts +61 -0
- package/project/.sdk/src/cmp/kotlin/ReadmeQuick_kotlin.ts +230 -0
- package/project/.sdk/src/cmp/kotlin/ReadmeRef_kotlin.ts +387 -0
- package/project/.sdk/src/cmp/kotlin/ReadmeTopHowto_kotlin.ts +23 -0
- package/project/.sdk/src/cmp/kotlin/ReadmeTopQuick_kotlin.ts +104 -0
- package/project/.sdk/src/cmp/kotlin/ReadmeTopTest_kotlin.ts +77 -0
- package/project/.sdk/src/cmp/kotlin/TestDirect_kotlin.ts +3 -3
- package/project/.sdk/src/cmp/kotlin/Test_kotlin.ts +4 -0
- package/project/.sdk/src/cmp/lean/Config_lean.ts +88 -0
- package/project/.sdk/src/cmp/lean/Entity_lean.ts +9 -0
- package/project/.sdk/src/cmp/lean/Gitignore_lean.ts +18 -0
- package/project/.sdk/src/cmp/lean/Main_lean.ts +120 -0
- package/project/.sdk/src/cmp/lean/Package_lean.ts +68 -0
- package/project/.sdk/src/cmp/lean/ReadmeEntity_lean.ts +29 -0
- package/project/.sdk/src/cmp/lean/ReadmeExplanation_lean.ts +19 -0
- package/project/.sdk/src/cmp/lean/ReadmeHowto_lean.ts +25 -0
- package/project/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +38 -0
- package/project/.sdk/src/cmp/lean/ReadmeIntro_lean.ts +25 -0
- package/project/.sdk/src/cmp/lean/ReadmeModel_lean.ts +24 -0
- package/project/.sdk/src/cmp/lean/ReadmeOptions_lean.ts +22 -0
- package/project/.sdk/src/cmp/lean/ReadmeQuick_lean.ts +50 -0
- package/project/.sdk/src/cmp/lean/ReadmeRef_lean.ts +16 -0
- package/project/.sdk/src/cmp/lean/ReadmeTopHowto_lean.ts +16 -0
- package/project/.sdk/src/cmp/lean/ReadmeTopQuick_lean.ts +23 -0
- package/project/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +18 -0
- package/project/.sdk/src/cmp/lean/Test_lean.ts +207 -0
- package/project/.sdk/src/cmp/lean/utility_lean.ts +78 -0
- package/project/.sdk/src/cmp/lua/Config_lua.ts +1 -1
- package/project/.sdk/src/cmp/lua/EntityTypes_lua.ts +19 -6
- package/project/.sdk/src/cmp/lua/Entity_lua.ts +3 -3
- package/project/.sdk/src/cmp/lua/Main_lua.ts +14 -2
- package/project/.sdk/src/cmp/lua/Package_lua.ts +1 -1
- package/project/.sdk/src/cmp/lua/ReadmeEntity_lua.ts +2 -2
- package/project/.sdk/src/cmp/lua/ReadmeHowto_lua.ts +6 -1
- package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +3 -3
- package/project/.sdk/src/cmp/lua/ReadmeRef_lua.ts +2 -2
- package/project/.sdk/src/cmp/lua/ReadmeTopQuick_lua.ts +2 -2
- package/project/.sdk/src/cmp/lua/TestDirect_lua.ts +3 -3
- package/project/.sdk/src/cmp/lua/TestEntity_lua.ts +8 -3
- package/project/.sdk/src/cmp/lua/Test_lua.ts +1 -1
- package/project/.sdk/src/cmp/lua/fragment/Main.fragment.lua +2 -0
- package/project/.sdk/src/cmp/ocaml/ReadmeEntity_ocaml.ts +180 -0
- package/project/.sdk/src/cmp/ocaml/ReadmeExamplesTest_ocaml.ts +126 -0
- package/project/.sdk/src/cmp/ocaml/ReadmeExplanation_ocaml.ts +46 -0
- package/project/.sdk/src/cmp/ocaml/ReadmeHowto_ocaml.ts +147 -0
- package/project/.sdk/src/cmp/ocaml/ReadmeInstall_ocaml.ts +44 -0
- package/project/.sdk/src/cmp/ocaml/ReadmeIntro_ocaml.ts +68 -0
- package/project/.sdk/src/cmp/ocaml/ReadmeModel_ocaml.ts +155 -0
- package/project/.sdk/src/cmp/ocaml/ReadmeOptions_ocaml.ts +59 -0
- package/project/.sdk/src/cmp/ocaml/ReadmeQuick_ocaml.ts +205 -0
- package/project/.sdk/src/cmp/ocaml/ReadmeRef_ocaml.ts +402 -0
- package/project/.sdk/src/cmp/ocaml/ReadmeTopHowto_ocaml.ts +25 -0
- package/project/.sdk/src/cmp/ocaml/ReadmeTopQuick_ocaml.ts +86 -0
- package/project/.sdk/src/cmp/ocaml/ReadmeTopTest_ocaml.ts +79 -0
- package/project/.sdk/src/cmp/ocaml/Test_ocaml.ts +4 -0
- package/project/.sdk/src/cmp/perl/Entity_perl.ts +3 -3
- package/project/.sdk/src/cmp/perl/MainEntity_perl.ts +2 -2
- package/project/.sdk/src/cmp/perl/Package_perl.ts +1 -1
- package/project/.sdk/src/cmp/perl/ReadmeEntity_perl.ts +181 -0
- package/project/.sdk/src/cmp/perl/ReadmeExamplesTest_perl.ts +354 -0
- package/project/.sdk/src/cmp/perl/ReadmeExplanation_perl.ts +43 -0
- package/project/.sdk/src/cmp/perl/ReadmeHowto_perl.ts +149 -0
- package/project/.sdk/src/cmp/perl/ReadmeInstall_perl.ts +47 -0
- package/project/.sdk/src/cmp/perl/ReadmeIntro_perl.ts +66 -0
- package/project/.sdk/src/cmp/perl/ReadmeModel_perl.ts +150 -0
- package/project/.sdk/src/cmp/perl/ReadmeOptions_perl.ts +59 -0
- package/project/.sdk/src/cmp/perl/ReadmeQuick_perl.ts +216 -0
- package/project/.sdk/src/cmp/perl/ReadmeRef_perl.ts +399 -0
- package/project/.sdk/src/cmp/perl/ReadmeTopHowto_perl.ts +24 -0
- package/project/.sdk/src/cmp/perl/ReadmeTopQuick_perl.ts +91 -0
- package/project/.sdk/src/cmp/perl/ReadmeTopTest_perl.ts +83 -0
- package/project/.sdk/src/cmp/perl/TestDirect_perl.ts +3 -3
- package/project/.sdk/src/cmp/perl/Test_perl.ts +4 -0
- package/project/.sdk/src/cmp/php/EntityTypes_php.ts +23 -7
- package/project/.sdk/src/cmp/php/Entity_php.ts +3 -3
- package/project/.sdk/src/cmp/php/MainEntity_php.ts +2 -2
- package/project/.sdk/src/cmp/php/Package_php.ts +1 -1
- package/project/.sdk/src/cmp/php/ReadmeHowto_php.ts +6 -1
- package/project/.sdk/src/cmp/php/TestDirect_php.ts +3 -3
- package/project/.sdk/src/cmp/php/TestEntity_php.ts +8 -3
- package/project/.sdk/src/cmp/py/EntityTypes_py.ts +32 -8
- package/project/.sdk/src/cmp/py/Entity_py.ts +4 -12
- package/project/.sdk/src/cmp/py/MainEntity_py.ts +2 -2
- package/project/.sdk/src/cmp/py/Main_py.ts +2 -2
- package/project/.sdk/src/cmp/py/Package_py.ts +1 -1
- package/project/.sdk/src/cmp/py/ReadmeEntity_py.ts +2 -2
- package/project/.sdk/src/cmp/py/ReadmeHowto_py.ts +8 -3
- package/project/.sdk/src/cmp/py/ReadmeQuick_py.ts +3 -3
- package/project/.sdk/src/cmp/py/ReadmeRef_py.ts +2 -2
- package/project/.sdk/src/cmp/py/ReadmeTopQuick_py.ts +2 -2
- package/project/.sdk/src/cmp/py/ReadmeTopTest_py.ts +2 -2
- package/project/.sdk/src/cmp/py/TestDirect_py.ts +3 -3
- package/project/.sdk/src/cmp/py/TestEntity_py.ts +8 -3
- package/project/.sdk/src/cmp/rb/EntityTypes_rb.ts +32 -8
- package/project/.sdk/src/cmp/rb/Entity_rb.ts +3 -3
- package/project/.sdk/src/cmp/rb/MainEntity_rb.ts +2 -2
- package/project/.sdk/src/cmp/rb/Package_rb.ts +2 -2
- package/project/.sdk/src/cmp/rb/ReadmeEntity_rb.ts +2 -2
- package/project/.sdk/src/cmp/rb/ReadmeHowto_rb.ts +8 -3
- package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +3 -3
- package/project/.sdk/src/cmp/rb/ReadmeRef_rb.ts +2 -2
- package/project/.sdk/src/cmp/rb/ReadmeTopQuick_rb.ts +2 -2
- package/project/.sdk/src/cmp/rb/ReadmeTopTest_rb.ts +2 -2
- package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +3 -3
- package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +8 -3
- package/project/.sdk/src/cmp/rust/EntityBase_rust.ts +6 -2
- package/project/.sdk/src/cmp/rust/EntityTypes_rust.ts +151 -0
- package/project/.sdk/src/cmp/rust/Entity_rust.ts +4 -4
- package/project/.sdk/src/cmp/rust/MainEntity_rust.ts +2 -2
- package/project/.sdk/src/cmp/rust/Main_rust.ts +5 -0
- package/project/.sdk/src/cmp/rust/Package_rust.ts +1 -1
- package/project/.sdk/src/cmp/rust/ReadmeEntity_rust.ts +163 -0
- package/project/.sdk/src/cmp/rust/ReadmeExamplesTest_rust.ts +144 -0
- package/project/.sdk/src/cmp/rust/ReadmeExplanation_rust.ts +44 -0
- package/project/.sdk/src/cmp/rust/ReadmeHowto_rust.ts +142 -0
- package/project/.sdk/src/cmp/rust/ReadmeInstall_rust.ts +49 -0
- package/project/.sdk/src/cmp/rust/ReadmeIntro_rust.ts +66 -0
- package/project/.sdk/src/cmp/rust/ReadmeModel_rust.ts +153 -0
- package/project/.sdk/src/cmp/rust/ReadmeOptions_rust.ts +60 -0
- package/project/.sdk/src/cmp/rust/ReadmeQuick_rust.ts +212 -0
- package/project/.sdk/src/cmp/rust/ReadmeRef_rust.ts +384 -0
- package/project/.sdk/src/cmp/rust/ReadmeTopHowto_rust.ts +24 -0
- package/project/.sdk/src/cmp/rust/ReadmeTopQuick_rust.ts +95 -0
- package/project/.sdk/src/cmp/rust/ReadmeTopTest_rust.ts +81 -0
- package/project/.sdk/src/cmp/rust/TestDirect_rust.ts +3 -3
- package/project/.sdk/src/cmp/rust/TestEntity_rust.ts +10 -0
- package/project/.sdk/src/cmp/rust/Test_rust.ts +4 -0
- package/project/.sdk/src/cmp/scala/EntityTypes_scala.ts +201 -0
- package/project/.sdk/src/cmp/scala/Entity_scala.ts +3 -3
- package/project/.sdk/src/cmp/scala/MainEntity_scala.ts +2 -2
- package/project/.sdk/src/cmp/scala/Main_scala.ts +6 -0
- package/project/.sdk/src/cmp/scala/ReadmeEntity_scala.ts +175 -0
- package/project/.sdk/src/cmp/scala/ReadmeExamplesTest_scala.ts +182 -0
- package/project/.sdk/src/cmp/scala/ReadmeExplanation_scala.ts +49 -0
- package/project/.sdk/src/cmp/scala/ReadmeHowto_scala.ts +155 -0
- package/project/.sdk/src/cmp/scala/ReadmeInstall_scala.ts +58 -0
- package/project/.sdk/src/cmp/scala/ReadmeIntro_scala.ts +66 -0
- package/project/.sdk/src/cmp/scala/ReadmeModel_scala.ts +150 -0
- package/project/.sdk/src/cmp/scala/ReadmeOptions_scala.ts +61 -0
- package/project/.sdk/src/cmp/scala/ReadmeQuick_scala.ts +230 -0
- package/project/.sdk/src/cmp/scala/ReadmeRef_scala.ts +388 -0
- package/project/.sdk/src/cmp/scala/ReadmeTopHowto_scala.ts +23 -0
- package/project/.sdk/src/cmp/scala/ReadmeTopQuick_scala.ts +104 -0
- package/project/.sdk/src/cmp/scala/ReadmeTopTest_scala.ts +77 -0
- package/project/.sdk/src/cmp/scala/TestDirect_scala.ts +3 -3
- package/project/.sdk/src/cmp/scala/TestEntity_scala.ts +38 -10
- package/project/.sdk/src/cmp/scala/Test_scala.ts +9 -1
- package/project/.sdk/src/cmp/swift/EntityTypes_swift.ts +151 -0
- package/project/.sdk/src/cmp/swift/Entity_swift.ts +3 -3
- package/project/.sdk/src/cmp/swift/MainEntity_swift.ts +2 -2
- package/project/.sdk/src/cmp/swift/Main_swift.ts +5 -0
- package/project/.sdk/src/cmp/swift/Package_swift.ts +1 -1
- package/project/.sdk/src/cmp/swift/ReadmeEntity_swift.ts +176 -0
- package/project/.sdk/src/cmp/swift/ReadmeExamplesTest_swift.ts +187 -0
- package/project/.sdk/src/cmp/swift/ReadmeExplanation_swift.ts +49 -0
- package/project/.sdk/src/cmp/swift/ReadmeHowto_swift.ts +159 -0
- package/project/.sdk/src/cmp/swift/ReadmeInstall_swift.ts +58 -0
- package/project/.sdk/src/cmp/swift/ReadmeIntro_swift.ts +64 -0
- package/project/.sdk/src/cmp/swift/ReadmeModel_swift.ts +149 -0
- package/project/.sdk/src/cmp/swift/ReadmeOptions_swift.ts +62 -0
- package/project/.sdk/src/cmp/swift/ReadmeQuick_swift.ts +232 -0
- package/project/.sdk/src/cmp/swift/ReadmeRef_swift.ts +387 -0
- package/project/.sdk/src/cmp/swift/ReadmeTopHowto_swift.ts +24 -0
- package/project/.sdk/src/cmp/swift/ReadmeTopQuick_swift.ts +105 -0
- package/project/.sdk/src/cmp/swift/ReadmeTopTest_swift.ts +77 -0
- package/project/.sdk/src/cmp/swift/TestDirect_swift.ts +1 -1
- package/project/.sdk/src/cmp/swift/Test_swift.ts +4 -0
- package/project/.sdk/src/cmp/ts/EntityTypes_ts.ts +19 -6
- package/project/.sdk/src/cmp/ts/Entity_ts.ts +3 -3
- package/project/.sdk/src/cmp/ts/MainEntity_ts.ts +6 -4
- package/project/.sdk/src/cmp/ts/Main_ts.ts +2 -2
- package/project/.sdk/src/cmp/ts/ReadmeEntity_ts.ts +4 -4
- package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +14 -4
- package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +29 -11
- package/project/.sdk/src/cmp/ts/ReadmeRef_ts.ts +5 -5
- package/project/.sdk/src/cmp/ts/ReadmeTopQuick_ts.ts +4 -4
- package/project/.sdk/src/cmp/ts/ReadmeTopTest_ts.ts +4 -4
- package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +17 -15
- package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +18 -2
- package/project/.sdk/src/cmp/zig/Config_zig.ts +22 -4
- package/project/.sdk/src/cmp/zig/Entity_zig.ts +4 -4
- package/project/.sdk/src/cmp/zig/MainEntity_zig.ts +2 -2
- package/project/.sdk/src/cmp/zig/Main_zig.ts +10 -4
- package/project/.sdk/src/cmp/zig/Package_zig.ts +61 -0
- package/project/.sdk/src/cmp/zig/ReadmeEntity_zig.ts +188 -0
- package/project/.sdk/src/cmp/zig/ReadmeExamplesTest_zig.ts +58 -0
- package/project/.sdk/src/cmp/zig/ReadmeExplanation_zig.ts +45 -0
- package/project/.sdk/src/cmp/zig/ReadmeHowto_zig.ts +143 -0
- package/project/.sdk/src/cmp/zig/ReadmeInstall_zig.ts +54 -0
- package/project/.sdk/src/cmp/zig/ReadmeIntro_zig.ts +66 -0
- package/project/.sdk/src/cmp/zig/ReadmeModel_zig.ts +152 -0
- package/project/.sdk/src/cmp/zig/ReadmeOptions_zig.ts +60 -0
- package/project/.sdk/src/cmp/zig/ReadmeQuick_zig.ts +211 -0
- package/project/.sdk/src/cmp/zig/ReadmeRef_zig.ts +400 -0
- package/project/.sdk/src/cmp/zig/ReadmeTopHowto_zig.ts +24 -0
- package/project/.sdk/src/cmp/zig/ReadmeTopQuick_zig.ts +96 -0
- package/project/.sdk/src/cmp/zig/ReadmeTopTest_zig.ts +82 -0
- package/project/.sdk/src/cmp/zig/TestDirect_zig.ts +66 -0
- package/project/.sdk/src/cmp/zig/TestEntity_zig.ts +79 -0
- package/project/.sdk/src/cmp/zig/Test_zig.ts +17 -61
- package/project/.sdk/tm/clojure/src/voxgig/struct.clj +1 -1
- package/project/.sdk/tm/cpp/test/feature_test.cpp +19 -0
- package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +8 -16
- package/project/.sdk/tm/csharp/test/PrimaryUtilityTest.cs +10 -28
- package/project/.sdk/tm/dart/lib/utility/MakeRequestUtility.dart +4 -1
- package/project/.sdk/tm/dart/lib/utility/voxgig_struct.dart +7 -1
- package/project/.sdk/tm/dart/test/primary_test.dart +7 -0
- package/project/.sdk/tm/elixir/lib/utility/struct/voxgig_struct.ex +1 -1
- package/project/.sdk/tm/elixir/test/primary_utility_test.exs +7 -1
- package/project/.sdk/tm/go/feature/test_feature.go +33 -1
- package/project/.sdk/tm/go/test/primary_utility_test.go +41 -42
- package/project/.sdk/tm/go/test/runner_test.go +30 -1
- package/project/.sdk/tm/go/utility/struct/voxgigstruct.go +3 -1
- package/project/.sdk/tm/haskell/test/Harness.hs +8 -3
- package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +7 -24
- package/project/.sdk/tm/js/Makefile +1 -1
- package/project/.sdk/tm/js/jsconfig.json +12 -0
- package/project/.sdk/tm/js/src/feature/test/TestFeature.js +18 -1
- package/project/.sdk/tm/js/test/utility/PrimaryUtility.test.js +8 -0
- package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +7 -20
- package/project/.sdk/tm/lean/LICENSE +21 -0
- package/project/.sdk/tm/lean/VERSION +1 -0
- package/project/.sdk/tm/lean/src/SdkFeature.lean +171 -0
- package/project/.sdk/tm/lean/src/SdkFeatures.lean +602 -0
- package/project/.sdk/tm/lean/src/SdkJson.lean +134 -0
- package/project/.sdk/tm/lean/src/SdkRuntime.lean +356 -0
- package/project/.sdk/tm/lean/src/SdkUtility.lean +617 -0
- package/project/.sdk/tm/lean/src/VoxgigStruct.lean +2880 -0
- package/project/.sdk/tm/lean/src/Vregex.lean +412 -0
- package/project/.sdk/tm/lean/src/feature/README.md +5 -0
- package/project/.sdk/tm/lean/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/lean/test/StructCorpus.lean +697 -0
- package/project/.sdk/tm/lean/test/TFeature.lean +268 -0
- package/project/.sdk/tm/lean/test/TPrimaryUtility.lean +349 -0
- package/project/.sdk/tm/lua/test/primary_utility_test.lua +10 -8
- package/project/.sdk/tm/ocaml/Makefile +5 -1
- package/project/.sdk/tm/perl/t/primary_utility.t +8 -17
- package/project/.sdk/tm/php/test/PrimaryUtilityTest.php +9 -7
- package/project/.sdk/tm/php/utility/struct/Struct.php +1 -1
- package/project/.sdk/tm/py/feature/test_feature.py +28 -1
- package/project/.sdk/tm/py/test/test_primary_utility.py +13 -18
- package/project/.sdk/tm/py/utility/voxgig_struct/voxgig_struct.py +1 -1
- package/project/.sdk/tm/rb/feature/test_feature.rb +24 -1
- package/project/.sdk/tm/rb/test/primary_utility_test.rb +7 -8
- package/project/.sdk/tm/rb/utility/struct/voxgig_struct.rb +1 -1
- package/project/.sdk/tm/rust/tests/common/mod.rs +37 -1
- package/project/.sdk/tm/rust/tests/primary_utility_test.rs +12 -26
- package/project/.sdk/tm/scala/sdktest/SdkTestMain.scala +8 -59
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +7 -8
- package/project/.sdk/tm/ts/Makefile +1 -1
- package/project/.sdk/tm/ts/src/feature/test/TestFeature.ts +18 -1
- package/project/.sdk/tm/ts/test/utility/PrimaryUtility.test.ts +65 -21
- package/project/.sdk/tm/zig/utility/voxgigstruct/struct.zig +1 -1
- package/src/cmp/Entity.ts +5 -1
- package/src/cmp/Feature.ts +2 -1
- package/src/cmp/ReadmeErrors.ts +2 -2
- package/src/cmp/ReadmeExplanation.ts +3 -3
- package/src/cmp/ReadmeTop.ts +2 -2
- package/src/helpers/canonType.ts +121 -25
- package/src/helpers/collectDeps.ts +39 -12
- package/src/helpers/naming.ts +106 -0
- package/src/helpers/opExample.ts +43 -20
- package/src/helpers/opShape.ts +197 -11
- package/src/sdkgen.ts +13 -3
- package/src/tsconfig.json +2 -0
- package/project/.sdk/tm/zig/build.zig.zon +0 -11
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
package sdktest
|
|
2
2
|
|
|
3
3
|
import (
|
|
4
|
+
"fmt"
|
|
4
5
|
"strings"
|
|
5
6
|
"testing"
|
|
6
7
|
|
|
@@ -119,7 +120,7 @@ func TestPrimaryUtility(t *testing.T) {
|
|
|
119
120
|
})
|
|
120
121
|
|
|
121
122
|
t.Run("done-basic", func(t *testing.T) {
|
|
122
|
-
|
|
123
|
+
runsetNamed(t, "done", getSpec(primary, "done", "basic"), func(entry map[string]any) (any, error) {
|
|
123
124
|
ctxmap, _ := entry["ctx"].(map[string]any)
|
|
124
125
|
ctx := makeCtxFromMap(ctxmap, client, utility)
|
|
125
126
|
fixctx(ctx, client)
|
|
@@ -128,7 +129,7 @@ func TestPrimaryUtility(t *testing.T) {
|
|
|
128
129
|
})
|
|
129
130
|
|
|
130
131
|
t.Run("makeError-basic", func(t *testing.T) {
|
|
131
|
-
|
|
132
|
+
runsetNamed(t, "makeError", getSpec(primary, "makeError", "basic"), func(entry map[string]any) (any, error) {
|
|
132
133
|
args, _ := entry["args"].([]any)
|
|
133
134
|
if len(args) == 0 {
|
|
134
135
|
args = []any{map[string]any{}}
|
|
@@ -306,7 +307,7 @@ func TestPrimaryUtility(t *testing.T) {
|
|
|
306
307
|
})
|
|
307
308
|
|
|
308
309
|
t.Run("makeContext-basic", func(t *testing.T) {
|
|
309
|
-
|
|
310
|
+
runsetNamed(t, "makeContext", getSpec(primary, "makeContext", "basic"), func(entry map[string]any) (any, error) {
|
|
310
311
|
in := entry["in"]
|
|
311
312
|
if inMap, ok := in.(map[string]any); ok {
|
|
312
313
|
ctx := utility.MakeContext(inMap, nil)
|
|
@@ -395,7 +396,7 @@ func TestPrimaryUtility(t *testing.T) {
|
|
|
395
396
|
})
|
|
396
397
|
|
|
397
398
|
t.Run("makeOptions-basic", func(t *testing.T) {
|
|
398
|
-
|
|
399
|
+
runsetNamed(t, "makeOptions", getSpec(primary, "makeOptions", "basic"), func(entry map[string]any) (any, error) {
|
|
399
400
|
in, _ := entry["in"].(map[string]any)
|
|
400
401
|
ctx := utility.MakeContext(map[string]any{
|
|
401
402
|
"options": in["options"],
|
|
@@ -408,7 +409,7 @@ func TestPrimaryUtility(t *testing.T) {
|
|
|
408
409
|
})
|
|
409
410
|
|
|
410
411
|
t.Run("makeRequest-basic", func(t *testing.T) {
|
|
411
|
-
|
|
412
|
+
runsetNamed(t, "makeRequest", getSpec(primary, "makeRequest", "basic"), func(entry map[string]any) (any, error) {
|
|
412
413
|
ctxmap, _ := entry["ctx"].(map[string]any)
|
|
413
414
|
ctx := makeCtxFromMap(ctxmap, client, utility)
|
|
414
415
|
ctx.Options = client.OptionsMap()
|
|
@@ -432,7 +433,7 @@ func TestPrimaryUtility(t *testing.T) {
|
|
|
432
433
|
})
|
|
433
434
|
|
|
434
435
|
t.Run("makeResponse-basic", func(t *testing.T) {
|
|
435
|
-
|
|
436
|
+
runsetNamed(t, "makeResponse", getSpec(primary, "makeResponse", "basic"), func(entry map[string]any) (any, error) {
|
|
436
437
|
ctxmap, _ := entry["ctx"].(map[string]any)
|
|
437
438
|
ctx := makeCtxFromMap(ctxmap, client, utility)
|
|
438
439
|
fixctx(ctx, client)
|
|
@@ -521,7 +522,7 @@ func TestPrimaryUtility(t *testing.T) {
|
|
|
521
522
|
specClient := sdk.TestSDK(nil, setupOpts)
|
|
522
523
|
specUtility := specClient.GetUtility()
|
|
523
524
|
|
|
524
|
-
|
|
525
|
+
runsetNamed(t, "makeSpec", getSpec(primary, "makeSpec", "basic"), func(entry map[string]any) (any, error) {
|
|
525
526
|
ctxmap, _ := entry["ctx"].(map[string]any)
|
|
526
527
|
ctx := makeCtxFromMap(ctxmap, specClient, specUtility)
|
|
527
528
|
ctx.Options = specClient.OptionsMap()
|
|
@@ -574,7 +575,7 @@ func TestPrimaryUtility(t *testing.T) {
|
|
|
574
575
|
})
|
|
575
576
|
|
|
576
577
|
t.Run("makeUrl-basic", func(t *testing.T) {
|
|
577
|
-
|
|
578
|
+
runsetNamed(t, "makeUrl", getSpec(primary, "makeUrl", "basic"), func(entry map[string]any) (any, error) {
|
|
578
579
|
ctxmap, _ := entry["ctx"].(map[string]any)
|
|
579
580
|
ctx := makeCtxFromMap(ctxmap, client, utility)
|
|
580
581
|
if ctx.Result == nil {
|
|
@@ -585,7 +586,7 @@ func TestPrimaryUtility(t *testing.T) {
|
|
|
585
586
|
})
|
|
586
587
|
|
|
587
588
|
t.Run("operator-basic", func(t *testing.T) {
|
|
588
|
-
|
|
589
|
+
runsetNamed(t, "operator", getSpec(primary, "operator", "basic"), func(entry map[string]any) (any, error) {
|
|
589
590
|
in, _ := entry["in"].(map[string]any)
|
|
590
591
|
op := sdk.NewOperation(in)
|
|
591
592
|
return map[string]any{
|
|
@@ -598,7 +599,7 @@ func TestPrimaryUtility(t *testing.T) {
|
|
|
598
599
|
})
|
|
599
600
|
|
|
600
601
|
t.Run("param-basic", func(t *testing.T) {
|
|
601
|
-
|
|
602
|
+
runsetNamed(t, "param", getSpec(primary, "param", "basic"), func(entry map[string]any) (any, error) {
|
|
602
603
|
args, _ := entry["args"].([]any)
|
|
603
604
|
if len(args) < 2 {
|
|
604
605
|
return nil, nil
|
|
@@ -647,7 +648,7 @@ func TestPrimaryUtility(t *testing.T) {
|
|
|
647
648
|
authClient := sdk.TestSDK(nil, setupOpts)
|
|
648
649
|
authUtility := authClient.GetUtility()
|
|
649
650
|
|
|
650
|
-
|
|
651
|
+
runsetNamed(t, "prepareAuth", getSpec(primary, "prepareAuth", "basic"), func(entry map[string]any) (any, error) {
|
|
651
652
|
ctxmap, _ := entry["ctx"].(map[string]any)
|
|
652
653
|
ctx := makeCtxFromMap(ctxmap, authClient, authUtility)
|
|
653
654
|
fixctx(ctx, authClient)
|
|
@@ -670,7 +671,7 @@ func TestPrimaryUtility(t *testing.T) {
|
|
|
670
671
|
})
|
|
671
672
|
|
|
672
673
|
t.Run("prepareBody-basic", func(t *testing.T) {
|
|
673
|
-
|
|
674
|
+
runsetNamed(t, "prepareBody", getSpec(primary, "prepareBody", "basic"), func(entry map[string]any) (any, error) {
|
|
674
675
|
ctxmap, _ := entry["ctx"].(map[string]any)
|
|
675
676
|
ctx := makeCtxFromMap(ctxmap, client, utility)
|
|
676
677
|
fixctx(ctx, client)
|
|
@@ -679,7 +680,7 @@ func TestPrimaryUtility(t *testing.T) {
|
|
|
679
680
|
})
|
|
680
681
|
|
|
681
682
|
t.Run("prepareHeaders-basic", func(t *testing.T) {
|
|
682
|
-
|
|
683
|
+
runsetNamed(t, "prepareHeaders", getSpec(primary, "prepareHeaders", "basic"), func(entry map[string]any) (any, error) {
|
|
683
684
|
ctxmap, _ := entry["ctx"].(map[string]any)
|
|
684
685
|
ctx := makeCtxFromMap(ctxmap, client, utility)
|
|
685
686
|
return utility.PrepareHeaders(ctx), nil
|
|
@@ -687,7 +688,7 @@ func TestPrimaryUtility(t *testing.T) {
|
|
|
687
688
|
})
|
|
688
689
|
|
|
689
690
|
t.Run("prepareMethod-basic", func(t *testing.T) {
|
|
690
|
-
|
|
691
|
+
runsetNamed(t, "prepareMethod", getSpec(primary, "prepareMethod", "basic"), func(entry map[string]any) (any, error) {
|
|
691
692
|
ctxmap, _ := entry["ctx"].(map[string]any)
|
|
692
693
|
ctx := makeCtxFromMap(ctxmap, client, utility)
|
|
693
694
|
return utility.PrepareMethod(ctx), nil
|
|
@@ -695,41 +696,39 @@ func TestPrimaryUtility(t *testing.T) {
|
|
|
695
696
|
})
|
|
696
697
|
|
|
697
698
|
t.Run("prepareParams-basic", func(t *testing.T) {
|
|
698
|
-
|
|
699
|
+
runsetNamed(t, "prepareParams", getSpec(primary, "prepareParams", "basic"), func(entry map[string]any) (any, error) {
|
|
699
700
|
ctxmap, _ := entry["ctx"].(map[string]any)
|
|
700
701
|
ctx := makeCtxFromMap(ctxmap, client, utility)
|
|
701
702
|
return utility.PrepareParams(ctx), nil
|
|
702
703
|
})
|
|
703
704
|
})
|
|
704
705
|
|
|
706
|
+
// Was two hand-written cases that had drifted out of the shared corpus
|
|
707
|
+
// (the preparePath fixture shipped as an empty `set: []`). Now driven by
|
|
708
|
+
// the corpus like every other section, so all ports assert the same
|
|
709
|
+
// separator/blank-segment behaviour.
|
|
705
710
|
t.Run("preparePath-basic", func(t *testing.T) {
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
path := utility.PreparePath(ctx)
|
|
713
|
-
if path != "api/planet/{id}" {
|
|
714
|
-
t.Errorf("expected api/planet/{id}, got %s", path)
|
|
715
|
-
}
|
|
711
|
+
runsetNamed(t, "preparePath", getSpec(primary, "preparePath", "basic"), func(entry map[string]any) (any, error) {
|
|
712
|
+
ctxmap, _ := entry["ctx"].(map[string]any)
|
|
713
|
+
ctx := makeCtxFromMap(ctxmap, client, utility)
|
|
714
|
+
return utility.PreparePath(ctx), nil
|
|
715
|
+
})
|
|
716
716
|
})
|
|
717
717
|
|
|
718
|
-
t.Run("
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
}
|
|
718
|
+
t.Run("clean-corpus", func(t *testing.T) {
|
|
719
|
+
runsetNamed(t, "clean", getSpec(primary, "clean", "basic"), func(entry map[string]any) (any, error) {
|
|
720
|
+
args, _ := entry["args"].([]any)
|
|
721
|
+
if 2 != len(args) {
|
|
722
|
+
return nil, fmt.Errorf("clean: expected 2 args, got %d", len(args))
|
|
723
|
+
}
|
|
724
|
+
ctxmap, _ := args[0].(map[string]any)
|
|
725
|
+
ctx := makeCtxFromMap(ctxmap, client, utility)
|
|
726
|
+
return utility.Clean(ctx, args[1]), nil
|
|
727
|
+
})
|
|
729
728
|
})
|
|
730
729
|
|
|
731
730
|
t.Run("prepareQuery-basic", func(t *testing.T) {
|
|
732
|
-
|
|
731
|
+
runsetNamed(t, "prepareQuery", getSpec(primary, "prepareQuery", "basic"), func(entry map[string]any) (any, error) {
|
|
733
732
|
ctxmap, _ := entry["ctx"].(map[string]any)
|
|
734
733
|
ctx := makeCtxFromMap(ctxmap, client, utility)
|
|
735
734
|
return utility.PrepareQuery(ctx), nil
|
|
@@ -737,7 +736,7 @@ func TestPrimaryUtility(t *testing.T) {
|
|
|
737
736
|
})
|
|
738
737
|
|
|
739
738
|
t.Run("resultBasic-basic", func(t *testing.T) {
|
|
740
|
-
|
|
739
|
+
runsetNamed(t, "resultBasic", getSpec(primary, "resultBasic", "basic"), func(entry map[string]any) (any, error) {
|
|
741
740
|
ctxmap, _ := entry["ctx"].(map[string]any)
|
|
742
741
|
ctx := makeCtxFromMap(ctxmap, client, utility)
|
|
743
742
|
fixctx(ctx, client)
|
|
@@ -759,7 +758,7 @@ func TestPrimaryUtility(t *testing.T) {
|
|
|
759
758
|
})
|
|
760
759
|
|
|
761
760
|
t.Run("resultBody-basic", func(t *testing.T) {
|
|
762
|
-
|
|
761
|
+
runsetNamed(t, "resultBody", getSpec(primary, "resultBody", "basic"), func(entry map[string]any) (any, error) {
|
|
763
762
|
ctxmap, _ := entry["ctx"].(map[string]any)
|
|
764
763
|
ctx := makeCtxFromMap(ctxmap, client, utility)
|
|
765
764
|
|
|
@@ -778,7 +777,7 @@ func TestPrimaryUtility(t *testing.T) {
|
|
|
778
777
|
})
|
|
779
778
|
|
|
780
779
|
t.Run("resultHeaders-basic", func(t *testing.T) {
|
|
781
|
-
|
|
780
|
+
runsetNamed(t, "resultHeaders", getSpec(primary, "resultHeaders", "basic"), func(entry map[string]any) (any, error) {
|
|
782
781
|
ctxmap, _ := entry["ctx"].(map[string]any)
|
|
783
782
|
ctx := makeCtxFromMap(ctxmap, client, utility)
|
|
784
783
|
|
|
@@ -797,7 +796,7 @@ func TestPrimaryUtility(t *testing.T) {
|
|
|
797
796
|
})
|
|
798
797
|
|
|
799
798
|
t.Run("transformRequest-basic", func(t *testing.T) {
|
|
800
|
-
|
|
799
|
+
runsetNamed(t, "transformRequest", getSpec(primary, "transformRequest", "basic"), func(entry map[string]any) (any, error) {
|
|
801
800
|
ctxmap, _ := entry["ctx"].(map[string]any)
|
|
802
801
|
ctx := makeCtxFromMap(ctxmap, client, utility)
|
|
803
802
|
|
|
@@ -816,7 +815,7 @@ func TestPrimaryUtility(t *testing.T) {
|
|
|
816
815
|
})
|
|
817
816
|
|
|
818
817
|
t.Run("transformResponse-basic", func(t *testing.T) {
|
|
819
|
-
|
|
818
|
+
runsetNamed(t, "transformResponse", getSpec(primary, "transformResponse", "basic"), func(entry map[string]any) (any, error) {
|
|
820
819
|
ctxmap, _ := entry["ctx"].(map[string]any)
|
|
821
820
|
ctx := makeCtxFromMap(ctxmap, client, utility)
|
|
822
821
|
|
|
@@ -215,11 +215,40 @@ func getSpec(spec map[string]any, keys ...string) map[string]any {
|
|
|
215
215
|
|
|
216
216
|
type RunSubject func(entry map[string]any) (any, error)
|
|
217
217
|
|
|
218
|
+
// PENDING sections are the ones deliberately left empty in the shared corpus
|
|
219
|
+
// (.sdk/test/primary/<name>.aontu). Everything else MUST contribute cases.
|
|
220
|
+
var pendingSections = map[string]bool{
|
|
221
|
+
"fetcher": true, "makeFetchDef": true, "makePoint": true, "makeResult": true,
|
|
222
|
+
"featureAdd": true, "featureHook": true, "featureInit": true,
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// runset drives one section of the shared test corpus.
|
|
226
|
+
//
|
|
227
|
+
// It used to `return` silently when "set" was missing or not a list, so a
|
|
228
|
+
// renamed section, a fixture that failed to compile, or an empty set reported
|
|
229
|
+
// PASS while running zero assertions — the whole point of a shared oracle
|
|
230
|
+
// lost without a single red test. Both conditions are now fatal, except for
|
|
231
|
+
// the sections explicitly marked PENDING in the corpus.
|
|
218
232
|
func runset(t *testing.T, testspec map[string]any, subject RunSubject) {
|
|
219
233
|
t.Helper()
|
|
234
|
+
runsetNamed(t, "", testspec, subject)
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
func runsetNamed(t *testing.T, name string, testspec map[string]any, subject RunSubject) {
|
|
238
|
+
t.Helper()
|
|
239
|
+
|
|
240
|
+
if testspec == nil {
|
|
241
|
+
t.Fatalf("test corpus section %q missing — check the name against .sdk/test/primary/", name)
|
|
242
|
+
}
|
|
243
|
+
|
|
220
244
|
set, ok := testspec["set"].([]any)
|
|
221
245
|
if !ok {
|
|
222
|
-
|
|
246
|
+
t.Fatalf("test corpus section %q has no `set` list — zero cases would run", name)
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if 0 == len(set) && !pendingSections[name] {
|
|
250
|
+
t.Fatalf("test corpus section %q is EMPTY — zero cases would run; "+
|
|
251
|
+
"add cases, or mark the fixture PENDING in .sdk/test/primary/", name)
|
|
223
252
|
}
|
|
224
253
|
|
|
225
254
|
for i, e := range set {
|
|
@@ -3932,8 +3932,10 @@ func makeValidation(exact bool) Modify {
|
|
|
3932
3932
|
// Empty spec object {} means object can be open (any keys).
|
|
3933
3933
|
if len(pkeys) > 0 && GetProp(pval, "`$OPEN`") != true {
|
|
3934
3934
|
badkeys := []string{}
|
|
3935
|
+
pvalMap, pvalIsMap := pval.(map[string]any)
|
|
3935
3936
|
for _, ckey := range ckeys {
|
|
3936
|
-
|
|
3937
|
+
_, present := pvalMap[ckey]
|
|
3938
|
+
if !pvalIsMap || !present {
|
|
3937
3939
|
badkeys = append(badkeys, ckey)
|
|
3938
3940
|
}
|
|
3939
3941
|
}
|
|
@@ -81,11 +81,16 @@ recordingServer mreply = do
|
|
|
81
81
|
|
|
82
82
|
-- ----- feature presence -----
|
|
83
83
|
|
|
84
|
+
-- A feature is present when the generated feature factory dispatches the
|
|
85
|
+
-- name to a real implementation. In this SDK every feature is always
|
|
86
|
+
-- compiled in (Cfg.makeFeature maps each known name to its own factory and
|
|
87
|
+
-- falls back to the "base" feature for unknown names), so presence is
|
|
88
|
+
-- determined by the factory, not by the model's default-active `feature`
|
|
89
|
+
-- map (which for a minimal API may list only `test`).
|
|
84
90
|
hasFeature :: String -> IO Bool
|
|
85
91
|
hasFeature name = do
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
case fm of { VMap _ -> do { v <- getp fm name; pure (not (isNullish v)) }; _ -> pure False }
|
|
92
|
+
ftr <- Cfg.makeFeature name
|
|
93
|
+
pure (fName ftr == name)
|
|
89
94
|
|
|
90
95
|
-- ----- harness -----
|
|
91
96
|
|
|
@@ -717,32 +717,15 @@ public class PrimaryUtilityTest {
|
|
|
717
717
|
|
|
718
718
|
@Test
|
|
719
719
|
public void preparePathBasic() {
|
|
720
|
+
// Was two hand-written cases that had drifted out of the shared corpus
|
|
721
|
+
// (the preparePath fixture shipped as an empty `set: []`).
|
|
720
722
|
ProjectNameSDK client = client();
|
|
721
723
|
Utility utility = client.getUtility();
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
ctx.point = fhMap(
|
|
728
|
-
"parts", parts,
|
|
729
|
-
"args", fhMap("params", new ArrayList<>()));
|
|
730
|
-
|
|
731
|
-
assertEquals("api/planet/{id}", utility.preparePath.apply(ctx));
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
@Test
|
|
735
|
-
public void preparePathSingle() {
|
|
736
|
-
ProjectNameSDK client = client();
|
|
737
|
-
Utility utility = client.getUtility();
|
|
738
|
-
Context ctx = makeTestFullCtx(client, utility);
|
|
739
|
-
List<Object> parts = new ArrayList<>();
|
|
740
|
-
parts.add("items");
|
|
741
|
-
ctx.point = fhMap(
|
|
742
|
-
"parts", parts,
|
|
743
|
-
"args", fhMap("params", new ArrayList<>()));
|
|
744
|
-
|
|
745
|
-
assertEquals("items", utility.preparePath.apply(ctx));
|
|
724
|
+
runset(getSpec(primary(), "preparePath", "basic"), (entry) -> {
|
|
725
|
+
Map<String, Object> ctxmap = Helpers.toMapAny(entry.get("ctx"));
|
|
726
|
+
Context ctx = makeCtxFromMap(ctxmap, client, utility);
|
|
727
|
+
return utility.preparePath.apply(ctx);
|
|
728
|
+
});
|
|
746
729
|
}
|
|
747
730
|
|
|
748
731
|
@Test
|
|
@@ -29,7 +29,7 @@ publish: test
|
|
|
29
29
|
echo "[dry-run] aql filler token detected: would publish to npm and tag $(TAG); nothing pushed."; \
|
|
30
30
|
exit 0; \
|
|
31
31
|
fi; \
|
|
32
|
-
npm publish --access public --registry https://registry.npmjs.org; \
|
|
32
|
+
npm stage publish --access public --registry https://registry.npmjs.org; \
|
|
33
33
|
git tag -a "$(TAG)" -m "js v$(VERSION)"; \
|
|
34
34
|
url=$$(git remote get-url origin | sed -E 's#^git@github.com:#https://github.com/#'); \
|
|
35
35
|
if [ -n "$$token" ] && printf '%s' "$$url" | grep -q '^https://github.com/'; then \
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Establishes the SDK folder as ONE JS program so the global JSDoc typedefs
|
|
3
|
+
// in src/*Types.js resolve from every file (op @param/@returns annotations
|
|
4
|
+
// reference them by bare name). checkJs stays off — add // @ts-check per
|
|
5
|
+
// file (or flip checkJs) to opt in to editor type-checking.
|
|
6
|
+
"compilerOptions": {
|
|
7
|
+
"module": "commonjs",
|
|
8
|
+
"target": "es2021",
|
|
9
|
+
"checkJs": false
|
|
10
|
+
},
|
|
11
|
+
"include": ["src", "test"]
|
|
12
|
+
}
|
|
@@ -49,12 +49,29 @@ class TestFeature extends BaseFeature {
|
|
|
49
49
|
const delprop = struct.delprop
|
|
50
50
|
const getdef = struct.getdef
|
|
51
51
|
|
|
52
|
+
// Shape the mock payload the way the real API would, so the op's
|
|
53
|
+
// response transform recovers the entity from it. A point carrying
|
|
54
|
+
// `transform.res: \`body.item\`` describes an API that answers
|
|
55
|
+
// `{item: {...}}`; handing back the bare entity means the transform
|
|
56
|
+
// unwraps a property that is not there and the caller gets undefined.
|
|
57
|
+
// The mock has to agree with the model, or it only ever simulates APIs
|
|
58
|
+
// whose responses happen to be unwrapped.
|
|
59
|
+
function envelope(data) {
|
|
60
|
+
const restf = getprop(getprop(ctx.point, 'transform', {}), 'res')
|
|
61
|
+
if (null == data || 'string' !== typeof restf) {
|
|
62
|
+
return data
|
|
63
|
+
}
|
|
64
|
+
const m = restf.match(/^`body\.([^`.]+)`$/)
|
|
65
|
+
return null == m ? data : { [m[1]]: data }
|
|
66
|
+
}
|
|
67
|
+
|
|
52
68
|
function respond(status, data, res) {
|
|
69
|
+
const payload = envelope(data)
|
|
53
70
|
const out = merge([
|
|
54
71
|
{
|
|
55
72
|
status,
|
|
56
73
|
statusText: 'OK',
|
|
57
|
-
json: async () =>
|
|
74
|
+
json: async () => payload,
|
|
58
75
|
body: 'not-used',
|
|
59
76
|
},
|
|
60
77
|
getdef(res, {})
|
|
@@ -96,6 +96,14 @@ describe('PrimaryUtility', async () => {
|
|
|
96
96
|
})
|
|
97
97
|
|
|
98
98
|
|
|
99
|
+
// preparePath shipped as an empty `set: []`, so no port drove it and several
|
|
100
|
+
// kept private hand-written cases instead. Corpus-driven like every other
|
|
101
|
+
// section now.
|
|
102
|
+
test('path-basic', async () => {
|
|
103
|
+
await runset(spec.preparePath.basic, utility.preparePath)
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
|
|
99
107
|
test('body-basic', async () => {
|
|
100
108
|
await runset(spec.prepareBody.basic, (ctx) => {
|
|
101
109
|
fixctx(ctx)
|
|
@@ -694,28 +694,15 @@ class PrimaryUtilityTest {
|
|
|
694
694
|
|
|
695
695
|
@Test
|
|
696
696
|
fun preparePathBasic() {
|
|
697
|
+
// Was two hand-written cases that had drifted out of the shared corpus
|
|
698
|
+
// (the preparePath fixture shipped as an empty `set: []`).
|
|
697
699
|
val client = client()
|
|
698
700
|
val utility = client.getUtility()
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
ctx.point = fhMap("parts", parts, "args", fhMap("params", mutableListOf<Any?>()))
|
|
705
|
-
|
|
706
|
-
assertEquals("api/planet/{id}", utility.preparePath(ctx))
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
@Test
|
|
710
|
-
fun preparePathSingle() {
|
|
711
|
-
val client = client()
|
|
712
|
-
val utility = client.getUtility()
|
|
713
|
-
val ctx = makeTestFullCtx(client, utility)
|
|
714
|
-
val parts = mutableListOf<Any?>()
|
|
715
|
-
parts.add("items")
|
|
716
|
-
ctx.point = fhMap("parts", parts, "args", fhMap("params", mutableListOf<Any?>()))
|
|
717
|
-
|
|
718
|
-
assertEquals("items", utility.preparePath(ctx))
|
|
701
|
+
runset(getSpec(primary(), "preparePath", "basic")) { entry ->
|
|
702
|
+
val ctxmap = Helpers.toMapAny(entry["ctx"])
|
|
703
|
+
val ctx = makeCtxFromMap(ctxmap, client, utility)
|
|
704
|
+
utility.preparePath(ctx)
|
|
705
|
+
}
|
|
719
706
|
}
|
|
720
707
|
|
|
721
708
|
@Test
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 voxgig
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.0.1
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/- ProjectName SDK feature catalog.
|
|
2
|
+
|
|
3
|
+
A feature observes and modifies the operation pipeline in two ways:
|
|
4
|
+
|
|
5
|
+
- by WRAPPING THE TRANSPORT: `init` replaces the client's fetcher with one
|
|
6
|
+
that calls the previous fetcher (retry, timeout, ratelimit, cache, proxy,
|
|
7
|
+
netsim, test all do this), so features compose as a middleware chain in
|
|
8
|
+
add order;
|
|
9
|
+
- by HANDLING A HOOK: a pipeline stage (PrePoint, PreSpec, PreRequest,
|
|
10
|
+
PreResponse, PreResult, PreDone, PreUnexpected) dispatched to every active
|
|
11
|
+
feature.
|
|
12
|
+
|
|
13
|
+
Lean cannot put closures inside the struct `Value` model, so features and
|
|
14
|
+
fetchers live in module-level registries and the client `Value` carries their
|
|
15
|
+
indices. Timing uses the monotonic clock; where the donors use randomness we
|
|
16
|
+
use a deterministic counter, which keeps generated suites reproducible. -/
|
|
17
|
+
|
|
18
|
+
import VoxgigStruct
|
|
19
|
+
import SdkJson
|
|
20
|
+
import SdkUtility
|
|
21
|
+
|
|
22
|
+
open VoxgigStruct
|
|
23
|
+
|
|
24
|
+
namespace SdkFeature
|
|
25
|
+
|
|
26
|
+
/-- Transport: ctx -> url -> fetchdef -> (response, error). -/
|
|
27
|
+
abbrev Fetcher := Value → String → Value → SIO (Value × Option Value)
|
|
28
|
+
|
|
29
|
+
structure Feature where
|
|
30
|
+
name : String
|
|
31
|
+
version : String := "0.0.1"
|
|
32
|
+
/-- init ctx options -/
|
|
33
|
+
init : Value → Value → SIO Unit := fun _ _ => pure ()
|
|
34
|
+
/-- hook stage ctx -/
|
|
35
|
+
hook : String → Value → SIO Unit := fun _ _ => pure ()
|
|
36
|
+
|
|
37
|
+
initialize featureReg : IO.Ref (Array Feature) ← IO.mkRef #[]
|
|
38
|
+
initialize fetcherReg : IO.Ref (Array Fetcher) ← IO.mkRef #[]
|
|
39
|
+
initialize seqRef : IO.Ref Nat ← IO.mkRef 0
|
|
40
|
+
|
|
41
|
+
def nextSeq : SIO Nat := do seqRef.modifyGet fun n => (n + 1, n + 1)
|
|
42
|
+
|
|
43
|
+
def nowMs : SIO Float := do pure (← IO.monoMsNow).toFloat
|
|
44
|
+
|
|
45
|
+
def sleepMs (ms : Float) : SIO Unit := do
|
|
46
|
+
if ms > 0.0 then IO.sleep (ms.toUInt32) else pure ()
|
|
47
|
+
|
|
48
|
+
/-- Deterministic id (no RNG: reproducible suites). -/
|
|
49
|
+
def genId : SIO String := do pure ("k" ++ toString (← nextSeq))
|
|
50
|
+
|
|
51
|
+
-- ---------------------------------------------------------------------------
|
|
52
|
+
-- option readers
|
|
53
|
+
-- ---------------------------------------------------------------------------
|
|
54
|
+
|
|
55
|
+
def optActive (opts : Value) : SIO Bool := do
|
|
56
|
+
match (← SdkUtility.gp opts "active") with
|
|
57
|
+
| .bool b => pure b
|
|
58
|
+
| _ => pure false
|
|
59
|
+
|
|
60
|
+
def optNum (opts : Value) (k : String) (d : Float) : SIO Float := do
|
|
61
|
+
match (← SdkUtility.gp opts k) with
|
|
62
|
+
| .num n => pure n
|
|
63
|
+
| _ => pure d
|
|
64
|
+
|
|
65
|
+
def optInt (opts : Value) (k : String) (d : Int) : SIO Int := do
|
|
66
|
+
match (← SdkUtility.gp opts k) with
|
|
67
|
+
| .num n => pure (fToInt n)
|
|
68
|
+
| _ => pure d
|
|
69
|
+
|
|
70
|
+
def optStr (opts : Value) (k d : String) : SIO String := do
|
|
71
|
+
let s ← SdkUtility.gpS opts k
|
|
72
|
+
pure (if s == "" then d else s)
|
|
73
|
+
|
|
74
|
+
def optStrList (opts : Value) (k : String) (d : Array String) : SIO (Array String) := do
|
|
75
|
+
match (← SdkUtility.gp opts k) with
|
|
76
|
+
| .list i => do
|
|
77
|
+
let its ← listItems i
|
|
78
|
+
pure (its.map SdkUtility.vs)
|
|
79
|
+
| _ => pure d
|
|
80
|
+
|
|
81
|
+
/-- The feature's own options map (the client passes `{active, ...}`). -/
|
|
82
|
+
def toOptsMap (opts : Value) : SIO Value := do
|
|
83
|
+
match opts with
|
|
84
|
+
| .map i => pure (.map i)
|
|
85
|
+
| _ => emptyMap
|
|
86
|
+
|
|
87
|
+
def upper (s : String) : String := s.toUpper
|
|
88
|
+
def lower (s : String) : String := s.toLower
|
|
89
|
+
|
|
90
|
+
/-- Case-insensitive header lookup. -/
|
|
91
|
+
def headerCI (headers : Value) (name : String) : SIO Value := do
|
|
92
|
+
match headers with
|
|
93
|
+
| .map i => do
|
|
94
|
+
let want := lower name
|
|
95
|
+
for k in (← keysof (.map i)) do
|
|
96
|
+
if lower k == want then return (← SdkUtility.gp (.map i) k)
|
|
97
|
+
pure .noval
|
|
98
|
+
| _ => pure .noval
|
|
99
|
+
|
|
100
|
+
-- ---------------------------------------------------------------------------
|
|
101
|
+
-- client wiring: fetcher chain + tracking buckets
|
|
102
|
+
-- ---------------------------------------------------------------------------
|
|
103
|
+
|
|
104
|
+
def registerFetcher (f : Fetcher) : SIO Nat := do
|
|
105
|
+
fetcherReg.modifyGet fun a => (a.size, a.push f)
|
|
106
|
+
|
|
107
|
+
def getFetcher (client : Value) : SIO Fetcher := do
|
|
108
|
+
match (← SdkUtility.gp client "fetcher") with
|
|
109
|
+
| .num n => do
|
|
110
|
+
let reg ← fetcherReg.get
|
|
111
|
+
pure (reg[fToInt n |>.toNat]!)
|
|
112
|
+
| _ => pure (fun _ _ _ => do pure (.noval, none))
|
|
113
|
+
|
|
114
|
+
def setFetcher (client : Value) (f : Fetcher) : SIO Unit := do
|
|
115
|
+
let id ← registerFetcher f
|
|
116
|
+
SdkUtility.sp client "fetcher" (.num id.toFloat)
|
|
117
|
+
|
|
118
|
+
/-- The client of a ctx. -/
|
|
119
|
+
def clientOf (ctx : Value) : SIO Value := do SdkUtility.gp ctx "client"
|
|
120
|
+
|
|
121
|
+
/-- A named metrics bucket on the client's `track` map. -/
|
|
122
|
+
def trackBucket (client : Value) (name : String) (mk : SIO Value) : SIO Value := do
|
|
123
|
+
let track ← SdkUtility.gpMap client "track"
|
|
124
|
+
match (← SdkUtility.gp track name) with
|
|
125
|
+
| .map i => pure (.map i)
|
|
126
|
+
| _ => do
|
|
127
|
+
let b ← mk
|
|
128
|
+
SdkUtility.sp track name b
|
|
129
|
+
pure b
|
|
130
|
+
|
|
131
|
+
def bumpNum (bucket : Value) (k : String) (n : Float) : SIO Unit := do
|
|
132
|
+
let cur ← SdkUtility.gp bucket k
|
|
133
|
+
let v := (match cur with | .num x => x | _ => 0.0) + n
|
|
134
|
+
SdkUtility.sp bucket k (.num v)
|
|
135
|
+
|
|
136
|
+
def trackCtx (ctx : Value) (name : String) (mk : SIO Value) : SIO Value := do
|
|
137
|
+
trackBucket (← clientOf ctx) name mk
|
|
138
|
+
|
|
139
|
+
-- ---------------------------------------------------------------------------
|
|
140
|
+
-- feature registry / dispatch
|
|
141
|
+
-- ---------------------------------------------------------------------------
|
|
142
|
+
|
|
143
|
+
def registerFeature (f : Feature) : SIO Nat := do
|
|
144
|
+
featureReg.modifyGet fun a => (a.size, a.push f)
|
|
145
|
+
|
|
146
|
+
def clientFeatures (client : Value) : SIO (Array (Nat × Feature)) := do
|
|
147
|
+
let reg ← featureReg.get
|
|
148
|
+
let mut out : Array (Nat × Feature) := #[]
|
|
149
|
+
match (← SdkUtility.gp client "features") with
|
|
150
|
+
| .list i =>
|
|
151
|
+
for fv in (← listItems i) do
|
|
152
|
+
match fv with
|
|
153
|
+
| .num n => do
|
|
154
|
+
let idx := fToInt n |>.toNat
|
|
155
|
+
if h : idx < reg.size then out := out.push (idx, reg[idx])
|
|
156
|
+
| _ => pure ()
|
|
157
|
+
| _ => pure ()
|
|
158
|
+
pure out
|
|
159
|
+
|
|
160
|
+
/-- Is the named feature active on this client? -/
|
|
161
|
+
def isActive (client : Value) (name : String) : SIO Bool := do
|
|
162
|
+
let fo ← SdkUtility.gp (← SdkUtility.gp client "featureopts") name
|
|
163
|
+
optActive fo
|
|
164
|
+
|
|
165
|
+
/-- Dispatch a pipeline stage to every active feature. -/
|
|
166
|
+
def dispatch (client : Value) (stage : String) (ctx : Value) : SIO Unit := do
|
|
167
|
+
for (_, f) in (← clientFeatures client) do
|
|
168
|
+
if (← isActive client f.name) then
|
|
169
|
+
f.hook stage ctx
|
|
170
|
+
|
|
171
|
+
end SdkFeature
|