@voxgig/sdkgen 1.3.14 → 1.3.17
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.map +1 -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 +107 -24
- package/dist/helpers/canonType.js.map +1 -1
- package/dist/helpers/collectDeps.js.map +1 -1
- package/dist/helpers/getMatchEntries.js.map +1 -1
- package/dist/helpers/naming.d.ts +5 -1
- package/dist/helpers/naming.js +37 -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 +3 -1
- package/dist/helpers/opShape.js +91 -3
- 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 +7 -1
- 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 +7 -6
- package/project/.sdk/model/target/haskell.aontu +6 -3
- 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 +168 -0
- 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 +152 -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/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/ReadmeEntity_clojure.ts +182 -0
- package/project/.sdk/src/cmp/clojure/ReadmeExamplesTest_clojure.ts +54 -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/Main_cpp.ts +5 -0
- package/project/.sdk/src/cmp/cpp/ReadmeEntity_cpp.ts +170 -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/TestEntity_cpp.ts +5 -1
- package/project/.sdk/src/cmp/csharp/EntityTypes_csharp.ts +196 -0
- package/project/.sdk/src/cmp/csharp/Main_csharp.ts +6 -0
- package/project/.sdk/src/cmp/csharp/ReadmeEntity_csharp.ts +174 -0
- package/project/.sdk/src/cmp/csharp/ReadmeExamplesTest_csharp.ts +198 -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/Test_csharp.ts +4 -0
- package/project/.sdk/src/cmp/dart/EntityTypes_dart.ts +43 -29
- package/project/.sdk/src/cmp/dart/Entity_dart.ts +8 -0
- 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/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 +165 -0
- 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 +126 -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/EntityTypes_go.ts +12 -3
- package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +6 -1
- package/project/.sdk/src/cmp/go/TestEntity_go.ts +10 -3
- package/project/.sdk/src/cmp/go/utility_go.ts +3 -2
- package/project/.sdk/src/cmp/go-cli/Main_go-cli.ts +240 -43
- package/project/.sdk/src/cmp/go-cli/fragment/main.fragment.go +27 -5
- package/project/.sdk/src/cmp/go-mcp/Main_go-mcp.ts +191 -30
- package/project/.sdk/src/cmp/haskell/ReadmeEntity_haskell.ts +181 -0
- package/project/.sdk/src/cmp/haskell/ReadmeExamplesTest_haskell.ts +125 -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 +207 -0
- package/project/.sdk/src/cmp/java/Main_java.ts +6 -0
- package/project/.sdk/src/cmp/java/ReadmeEntity_java.ts +175 -0
- package/project/.sdk/src/cmp/java/ReadmeExamplesTest_java.ts +186 -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/Test_java.ts +4 -0
- package/project/.sdk/src/cmp/js/EntityTypes_js.ts +25 -8
- package/project/.sdk/src/cmp/js/MainEntity_js.ts +4 -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 +6 -5
- 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 +201 -0
- package/project/.sdk/src/cmp/kotlin/Main_kotlin.ts +6 -0
- package/project/.sdk/src/cmp/kotlin/ReadmeEntity_kotlin.ts +175 -0
- package/project/.sdk/src/cmp/kotlin/ReadmeExamplesTest_kotlin.ts +173 -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/Test_kotlin.ts +4 -0
- package/project/.sdk/src/cmp/lua/Config_lua.ts +1 -1
- package/project/.sdk/src/cmp/lua/EntityTypes_lua.ts +19 -5
- package/project/.sdk/src/cmp/lua/Main_lua.ts +14 -2
- 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/TestEntity_lua.ts +7 -2
- 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 +111 -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/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/Test_perl.ts +4 -0
- package/project/.sdk/src/cmp/php/EntityTypes_php.ts +23 -6
- package/project/.sdk/src/cmp/php/ReadmeHowto_php.ts +6 -1
- package/project/.sdk/src/cmp/php/TestEntity_php.ts +7 -2
- package/project/.sdk/src/cmp/py/EntityTypes_py.ts +32 -7
- package/project/.sdk/src/cmp/py/Entity_py.ts +2 -10
- 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/TestEntity_py.ts +7 -2
- package/project/.sdk/src/cmp/rb/EntityTypes_rb.ts +19 -5
- 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/TestEntity_rb.ts +7 -2
- package/project/.sdk/src/cmp/rust/EntityBase_rust.ts +4 -0
- package/project/.sdk/src/cmp/rust/EntityTypes_rust.ts +152 -0
- package/project/.sdk/src/cmp/rust/Entity_rust.ts +1 -1
- package/project/.sdk/src/cmp/rust/Main_rust.ts +5 -0
- package/project/.sdk/src/cmp/rust/ReadmeEntity_rust.ts +163 -0
- package/project/.sdk/src/cmp/rust/ReadmeExamplesTest_rust.ts +132 -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/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 +202 -0
- 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 +163 -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/TestEntity_scala.ts +38 -10
- package/project/.sdk/src/cmp/scala/Test_scala.ts +8 -0
- package/project/.sdk/src/cmp/swift/EntityTypes_swift.ts +152 -0
- package/project/.sdk/src/cmp/swift/Main_swift.ts +5 -0
- package/project/.sdk/src/cmp/swift/ReadmeEntity_swift.ts +176 -0
- package/project/.sdk/src/cmp/swift/ReadmeExamplesTest_swift.ts +170 -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/Test_swift.ts +4 -0
- package/project/.sdk/src/cmp/ts/EntityTypes_ts.ts +19 -5
- package/project/.sdk/src/cmp/ts/MainEntity_ts.ts +4 -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 +13 -11
- 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 +1 -1
- package/project/.sdk/src/cmp/zig/Main_zig.ts +10 -4
- package/project/.sdk/src/cmp/zig/Package_zig.ts +53 -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/dart/lib/utility/MakeRequestUtility.dart +4 -1
- package/project/.sdk/tm/dart/lib/utility/voxgig_struct.dart +7 -1
- 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/utility/struct/voxgigstruct.go +3 -1
- package/project/.sdk/tm/haskell/test/Harness.hs +8 -3
- package/project/.sdk/tm/js/Makefile +1 -1
- package/project/.sdk/tm/js/jsconfig.json +12 -0
- package/project/.sdk/tm/ocaml/Makefile +5 -1
- package/project/.sdk/tm/php/utility/struct/Struct.php +1 -1
- package/project/.sdk/tm/py/utility/voxgig_struct/voxgig_struct.py +1 -1
- package/project/.sdk/tm/rb/utility/struct/voxgig_struct.rb +1 -1
- package/project/.sdk/tm/scala/sdktest/SdkTestMain.scala +8 -59
- package/project/.sdk/tm/ts/Makefile +1 -1
- package/project/.sdk/tm/zig/utility/voxgigstruct/struct.zig +1 -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 +116 -25
- package/src/helpers/naming.ts +47 -0
- package/src/helpers/opExample.ts +43 -20
- package/src/helpers/opShape.ts +102 -3
- package/src/sdkgen.ts +8 -2
- package/src/tsconfig.json +2 -0
- package/project/.sdk/tm/zig/build.zig.zon +0 -11
|
@@ -17,46 +17,7 @@ void tests() {
|
|
|
17
17
|
ok(null != ent);
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
// stream() runs the list op through the full pipeline and yields each
|
|
22
|
-
// result item. Seed two entities via test mode; with the `streaming`
|
|
23
|
-
// feature active it yields the feature's incremental items, else it
|
|
24
|
-
// falls back to the materialised items — either way every item yields.
|
|
25
|
-
final seed = <String, dynamic>{
|
|
26
|
-
'entity': {
|
|
27
|
-
'entityname': {
|
|
28
|
-
'strm01': <String, dynamic>{'id': 'strm01'},
|
|
29
|
-
'strm02': <String, dynamic>{'id': 'strm02'},
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
final sdkopts = <String, dynamic>{};
|
|
35
|
-
if (null != config.feature['streaming']) {
|
|
36
|
-
sdkopts['feature'] = {
|
|
37
|
-
'streaming': {'active': true}
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
final testsdk = ProjectNameSDK.test(seed, sdkopts);
|
|
42
|
-
final ent = testsdk.EntityName();
|
|
43
|
-
|
|
44
|
-
final seen = [];
|
|
45
|
-
await for (final item in ent.stream('list', <String, dynamic>{})) {
|
|
46
|
-
seen.add(item);
|
|
47
|
-
}
|
|
48
|
-
equal(2, seen.length);
|
|
49
|
-
|
|
50
|
-
// Fallback: with streaming inactive, stream() still yields both items
|
|
51
|
-
// from the materialised result.
|
|
52
|
-
final plainsdk = ProjectNameSDK.test(seed);
|
|
53
|
-
final plainent = plainsdk.EntityName();
|
|
54
|
-
final seen2 = [];
|
|
55
|
-
await for (final item in plainent.stream('list', <String, dynamic>{})) {
|
|
56
|
-
seen2.add(item);
|
|
57
|
-
}
|
|
58
|
-
equal(2, seen2.length);
|
|
59
|
-
});
|
|
20
|
+
// <[SLOT:stream]>
|
|
60
21
|
|
|
61
22
|
test('basic', (t) async {
|
|
62
23
|
// <[SLOT:basic]>
|
|
@@ -5,9 +5,9 @@ import 'dart:async';
|
|
|
5
5
|
|
|
6
6
|
import 'Config.dart';
|
|
7
7
|
import 'Spec.dart';
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
|
|
8
|
+
// ProjectNameEntityBase / ProjectNameError / BaseFeature are re-exported below;
|
|
9
|
+
// a Dart `export` needs no matching `import`, so importing them here too is an
|
|
10
|
+
// unused_import. Keep only the imports actually referenced in this file.
|
|
11
11
|
import 'utility/ErrUtility.dart';
|
|
12
12
|
import 'utility/Utility.dart';
|
|
13
13
|
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
// Typed-model generator (Elixir target). Port of EntityTypes_ts.ts / _rb.ts.
|
|
4
|
+
//
|
|
5
|
+
// Reads main.<KIT>.entity.<e>.fields[] and per-op params
|
|
6
|
+
// (op.<name>.points[].args.params[]) and emits one module, lib/<app>_types.ex,
|
|
7
|
+
// holding an `@type` alias per active entity plus a request/match type per
|
|
8
|
+
// active op, each with a `@typedoc` documenting its concrete members.
|
|
9
|
+
//
|
|
10
|
+
// TYPE CHOICE: the SDK carries data as string-keyed struct value nodes, and
|
|
11
|
+
// Elixir map typespecs cannot pin individual string keys (only
|
|
12
|
+
// `optional(String.t()) => v`), so every alias resolves to an open string-keyed
|
|
13
|
+
// map `%{optional(String.t()) => any()}`. The precise per-member shape is
|
|
14
|
+
// documented in the accompanying @typedoc (the honest Elixir analogue of the
|
|
15
|
+
// TS interface / rb Struct). Field/param sentinels ($STRING, $INTEGER, ...) are
|
|
16
|
+
// turned into real Elixir typespec fragments (String.t(), integer(), ...) by
|
|
17
|
+
// the shared sdkgen canonToType 'elixir' column (via the `elixirType`
|
|
18
|
+
// delegate in utility_elixir).
|
|
19
|
+
//
|
|
20
|
+
// Op type-name scheme mirrors every other language — derived from the SHARED
|
|
21
|
+
// OP_SUFFIX policy, snake_cased for Elixir:
|
|
22
|
+
// <ename>, <ename>_load_match, <ename>_list_match, <ename>_create_data,
|
|
23
|
+
// <ename>_update_data, <ename>_remove_match.
|
|
24
|
+
// The generated entity modules reference these aliases from @spec annotations
|
|
25
|
+
// on their op functions (see fragment/Entity*Op.fragment.ex).
|
|
26
|
+
|
|
27
|
+
import {
|
|
28
|
+
cmp, each, names,
|
|
29
|
+
File, Folder, Content,
|
|
30
|
+
} from '@voxgig/sdkgen'
|
|
31
|
+
|
|
32
|
+
import { opRequestShape, OP_SUFFIX, warnEntityTypeCollisions } from '@voxgig/sdkgen'
|
|
33
|
+
|
|
34
|
+
import {
|
|
35
|
+
KIT,
|
|
36
|
+
getModelPath,
|
|
37
|
+
} from '@voxgig/apidef'
|
|
38
|
+
|
|
39
|
+
import { elixirType } from './utility_elixir'
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
// Snake_case op type name, derived from the SHARED OP_SUFFIX policy (the
|
|
43
|
+
// PascalCase scheme <Name><Op><Match|Data> rendered Elixir-style):
|
|
44
|
+
// <ename>_load_match, <ename>_create_data, ...
|
|
45
|
+
function elixirOpTypeName(ename: string, opname: string): string {
|
|
46
|
+
return ename + '_' + opname + '_' + (OP_SUFFIX[opname] || 'Match').toLowerCase()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
// Emit one `@typedoc` + `@type` alias. The alias is always an open
|
|
51
|
+
// string-keyed map; the members are documented in the doc block.
|
|
52
|
+
function emitType(
|
|
53
|
+
typeName: string,
|
|
54
|
+
doc: string,
|
|
55
|
+
members: Array<{ name: string, type: unknown, optional: boolean }>,
|
|
56
|
+
): void {
|
|
57
|
+
let block = ` @typedoc """\n ${doc}\n`
|
|
58
|
+
|
|
59
|
+
if (0 < members.length) {
|
|
60
|
+
block += `\n Members:\n`
|
|
61
|
+
members.forEach((m) => {
|
|
62
|
+
const req = m.optional ? ' (optional)' : ' (required)'
|
|
63
|
+
block += ` * \`"${m.name}"\` — ${elixirType(m.type)}${req}\n`
|
|
64
|
+
})
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
block += ` """\n @type ${typeName} :: %{optional(String.t()) => any()}\n\n`
|
|
68
|
+
|
|
69
|
+
Content(block)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
const LANG = 'elixir'
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
const EntityTypes = cmp(function EntityTypes(props: any) {
|
|
77
|
+
const { model, log } = props.ctx$
|
|
78
|
+
|
|
79
|
+
const Name = model.const.Name
|
|
80
|
+
const app = model.const.name.toLowerCase()
|
|
81
|
+
|
|
82
|
+
// only_active:false — getModelPath DROPS active:false entries by default,
|
|
83
|
+
// but the consumer scaffold (create-sdkgen Root.ts) iterates the RAW entity
|
|
84
|
+
// collection, so inactive entities still get generated entity code that
|
|
85
|
+
// references these typed names. The typed model must cover them too.
|
|
86
|
+
const entity = getModelPath(model, `main.${KIT}.entity`, { only_active: false, required: false })
|
|
87
|
+
// Emit for EVERY entity that gets an entity module: the consumer scaffold
|
|
88
|
+
// (create-sdkgen Root.ts) iterates entities WITHOUT an active filter, and
|
|
89
|
+
// each generated module carries @specs referencing its Types aliases, so an
|
|
90
|
+
// alias is required for each or the project won't compile. Filter on `name`
|
|
91
|
+
// (always present), NOT `active` — parity with the go emitter's fix.
|
|
92
|
+
const entityList = each(entity).filter((e: any) => e && null != e.name)
|
|
93
|
+
// Derive the PascalCase Name up-front — it is set LAZILY by names(), so an
|
|
94
|
+
// entity not yet named would otherwise read `Name = undefined` below.
|
|
95
|
+
entityList.forEach((e: any) => { if (null == e.Name) names(e, e.name) })
|
|
96
|
+
|
|
97
|
+
// Surface duplicate generated type names (two entities with the same
|
|
98
|
+
// PascalCase Name) — they would redeclare a type in statically-typed
|
|
99
|
+
// targets. Detection only; renaming is a model-level decision.
|
|
100
|
+
warnEntityTypeCollisions(entity, log, LANG)
|
|
101
|
+
|
|
102
|
+
Folder({ name: 'lib' }, () => {
|
|
103
|
+
File({ name: app + '_types.ex' }, () => {
|
|
104
|
+
|
|
105
|
+
Content(`# Typed models for the ${Name} SDK.
|
|
106
|
+
#
|
|
107
|
+
# GENERATED from the API model: main.${KIT}.entity.<e>.fields[] and per-op
|
|
108
|
+
# params (op.<name>.points[].args.params[]). Member types come from the
|
|
109
|
+
# canonical type sentinels. The SDK carries data as string-keyed struct value
|
|
110
|
+
# nodes, so each alias is an open string-keyed map; the @typedoc member lists
|
|
111
|
+
# document the concrete shapes. Do not edit by hand.
|
|
112
|
+
|
|
113
|
+
defmodule ${Name}.Types do
|
|
114
|
+
@moduledoc """
|
|
115
|
+
Documented shapes for the ${Name} SDK entities and operation payloads.
|
|
116
|
+
|
|
117
|
+
Every alias resolves to an open string-keyed map because the SDK carries
|
|
118
|
+
data as string-keyed struct value nodes; consult each type's member list for
|
|
119
|
+
the concrete field/param types.
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
`)
|
|
123
|
+
|
|
124
|
+
entityList.forEach((ent: any) => {
|
|
125
|
+
const EName = ent.Name
|
|
126
|
+
const ename = ent.name
|
|
127
|
+
const fields = (ent.fields ? each(ent.fields) : [])
|
|
128
|
+
.filter((f: any) => f.active !== false)
|
|
129
|
+
|
|
130
|
+
// Entity data model: one member per field (`req:false` -> optional).
|
|
131
|
+
emitType(
|
|
132
|
+
ename,
|
|
133
|
+
`${EName} entity data model.`,
|
|
134
|
+
fields.map((f: any) => ({ name: f.name, type: f.type, optional: false === f.req })),
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
// Per active op: a request/match type. Members and their optionality
|
|
138
|
+
// come from the shared partiality policy (opRequestShape).
|
|
139
|
+
const ops = ent.op || {}
|
|
140
|
+
;['load', 'list', 'create', 'update', 'remove'].forEach((opname: string) => {
|
|
141
|
+
if (null == ops[opname]) {
|
|
142
|
+
return
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const typeName = elixirOpTypeName(ename, opname)
|
|
146
|
+
const { items } = opRequestShape(ent, opname)
|
|
147
|
+
|
|
148
|
+
emitType(
|
|
149
|
+
typeName,
|
|
150
|
+
`Request payload for ${EName} ${opname}.`,
|
|
151
|
+
items,
|
|
152
|
+
)
|
|
153
|
+
})
|
|
154
|
+
})
|
|
155
|
+
|
|
156
|
+
Content(`end
|
|
157
|
+
`)
|
|
158
|
+
})
|
|
159
|
+
})
|
|
160
|
+
})
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
export {
|
|
164
|
+
EntityTypes,
|
|
165
|
+
}
|
|
@@ -17,6 +17,7 @@ import { Package } from './Package_elixir'
|
|
|
17
17
|
import { Config } from './Config_elixir'
|
|
18
18
|
import { Gitignore } from './Gitignore_elixir'
|
|
19
19
|
import { MainEntity } from './MainEntity_elixir'
|
|
20
|
+
import { EntityTypes } from './EntityTypes_elixir'
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
// #`-comment hook marker key (gotcha #1: jostraca's built-in #Name-Tag
|
|
@@ -44,6 +45,9 @@ const Main = cmp(async function Main(props: any) {
|
|
|
44
45
|
Package({ target })
|
|
45
46
|
Gitignore({})
|
|
46
47
|
|
|
48
|
+
// Generate the documented typespec module (lib/<app>_types.ex).
|
|
49
|
+
EntityTypes({ target })
|
|
50
|
+
|
|
47
51
|
// Copy tm/elixir verbatim (with ProjectName/projectname substitution).
|
|
48
52
|
Copy({
|
|
49
53
|
from: 'tm/' + target.name,
|
|
@@ -20,7 +20,9 @@ const Package = cmp(async function Package(props: any) {
|
|
|
20
20
|
const model: Model = ctx$.model
|
|
21
21
|
|
|
22
22
|
const Name = model.const.Name
|
|
23
|
-
|
|
23
|
+
// Elixir app names are atoms: a hyphenated slug (`bluefin-decryptx-p2pe`)
|
|
24
|
+
// is invalid (`:a-b` parses as subtraction). Snake_case it.
|
|
25
|
+
const app = String(model.const.name).replace(/-/g, '_')
|
|
24
26
|
const { repoUrl } = repoInfo(model)
|
|
25
27
|
|
|
26
28
|
File({ name: 'mix.exs' }, () => {
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
|
|
2
|
+
import { cmp, each, Content, canonToType, entityIdField, opRequestShape } from '@voxgig/sdkgen'
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
KIT,
|
|
6
|
+
getModelPath,
|
|
7
|
+
} from '@voxgig/apidef'
|
|
8
|
+
|
|
9
|
+
// Type names come from the shared canonToType 'elixir' column (single source of truth).
|
|
10
|
+
import { elixirLit } from './utility_elixir'
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
// Operation method spelling for the Elixir target: each op is a function on
|
|
14
|
+
// the entity's module taking the entity handle first. The descriptions are
|
|
15
|
+
// language-agnostic.
|
|
16
|
+
const OP_DESC: Record<string, { method: string, desc: string }> = {
|
|
17
|
+
load: { method: 'load(entity, match)', desc: 'Load a single entity by match criteria.' },
|
|
18
|
+
list: { method: 'list(entity)', desc: 'List entities, optionally matching the given criteria.' },
|
|
19
|
+
create: { method: 'create(entity, data)', desc: 'Create a new entity with the given data.' },
|
|
20
|
+
update: { method: 'update(entity, data)', desc: 'Update an existing entity.' },
|
|
21
|
+
remove: { method: 'remove(entity, match)', desc: 'Remove the matching entity.' },
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
26
|
+
const { target } = props
|
|
27
|
+
const { model } = props.ctx$
|
|
28
|
+
|
|
29
|
+
const Name = model.const.Name
|
|
30
|
+
const entity = getModelPath(model, `main.${KIT}.entity`)
|
|
31
|
+
|
|
32
|
+
const publishedEntities = each(entity)
|
|
33
|
+
.filter((entity: any) => entity.active !== false)
|
|
34
|
+
|
|
35
|
+
if (0 === publishedEntities.length) {
|
|
36
|
+
return
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
Content(`
|
|
40
|
+
|
|
41
|
+
## Entities
|
|
42
|
+
|
|
43
|
+
Every operation lives on the entity's \`${Name}.Entity.<Name>\` module and
|
|
44
|
+
takes an entity handle built from the client:
|
|
45
|
+
|
|
46
|
+
`)
|
|
47
|
+
|
|
48
|
+
publishedEntities.map((entity: any) => {
|
|
49
|
+
const EName = entity.Name
|
|
50
|
+
const eVar = entity.name
|
|
51
|
+
const opnames = Object.keys(entity.op || {})
|
|
52
|
+
const fields = entity.fields || []
|
|
53
|
+
const idF = entityIdField(entity)
|
|
54
|
+
|
|
55
|
+
Content(`
|
|
56
|
+
### ${EName}
|
|
57
|
+
|
|
58
|
+
`)
|
|
59
|
+
|
|
60
|
+
if (entity.short) {
|
|
61
|
+
Content(`${entity.short}
|
|
62
|
+
|
|
63
|
+
`)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
Content(`Create a handle: \`${eVar} = ${Name}.${eVar}(sdk)\`
|
|
67
|
+
|
|
68
|
+
`)
|
|
69
|
+
|
|
70
|
+
if (opnames.length > 0) {
|
|
71
|
+
Content(`#### Operations
|
|
72
|
+
|
|
73
|
+
| Method | Description |
|
|
74
|
+
| --- | --- |
|
|
75
|
+
`)
|
|
76
|
+
opnames.map((opname: string) => {
|
|
77
|
+
const info = OP_DESC[opname]
|
|
78
|
+
if (info) {
|
|
79
|
+
Content(`| \`${info.method}\` | ${info.desc} |
|
|
80
|
+
`)
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
Content(`
|
|
85
|
+
`)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (fields.length > 0) {
|
|
89
|
+
Content(`#### Fields
|
|
90
|
+
|
|
91
|
+
| Field | Type | Description |
|
|
92
|
+
| --- | --- | --- |
|
|
93
|
+
`)
|
|
94
|
+
|
|
95
|
+
each(fields, (field: any) => {
|
|
96
|
+
const desc = field.short || ''
|
|
97
|
+
Content(`| \`${field.name}\` | \`${canonToType(field.type, target.name)}\` | ${desc} |
|
|
98
|
+
`)
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
Content(`
|
|
102
|
+
`)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (opnames.includes('load')) {
|
|
106
|
+
const loadItems = opRequestShape(entity, 'load').items
|
|
107
|
+
.filter((it: any) => !it.optional || it.name === idF)
|
|
108
|
+
.sort((a: any, b: any) =>
|
|
109
|
+
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
110
|
+
const loadArg = 0 < loadItems.length
|
|
111
|
+
? `${Name}.Helpers.deep(%{${loadItems.map((it: any) =>
|
|
112
|
+
`"${it.name}" => ${elixirLit(it.type,
|
|
113
|
+
it.name === idF ? entity.name + '_id' : it.name)}`).join(', ')}})`
|
|
114
|
+
: `${Name}.Helpers.deep(%{})`
|
|
115
|
+
Content(`#### Example: Load
|
|
116
|
+
|
|
117
|
+
\`\`\`elixir
|
|
118
|
+
${eVar} = ${Name}.${eVar}(sdk)
|
|
119
|
+
record = ${Name}.Entity.${EName}.load(${eVar}, ${loadArg})
|
|
120
|
+
\`\`\`
|
|
121
|
+
|
|
122
|
+
`)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (opnames.includes('list')) {
|
|
126
|
+
Content(`#### Example: List
|
|
127
|
+
|
|
128
|
+
\`\`\`elixir
|
|
129
|
+
${eVar} = ${Name}.${eVar}(sdk)
|
|
130
|
+
records = ${Name}.Entity.${EName}.list(${eVar})
|
|
131
|
+
\`\`\`
|
|
132
|
+
|
|
133
|
+
`)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (opnames.includes('create')) {
|
|
137
|
+
// Members come from the SAME shape the runtime validates
|
|
138
|
+
// (opRequestShape): every required member must appear — with a real,
|
|
139
|
+
// executable literal.
|
|
140
|
+
const createItems = opRequestShape(entity, 'create').items
|
|
141
|
+
.filter((it: any) => !it.optional)
|
|
142
|
+
Content(`#### Example: Create
|
|
143
|
+
|
|
144
|
+
\`\`\`elixir
|
|
145
|
+
${eVar} = ${Name}.${eVar}(sdk)
|
|
146
|
+
record = ${Name}.Entity.${EName}.create(${eVar}, ${Name}.Helpers.deep(%{
|
|
147
|
+
`)
|
|
148
|
+
createItems.map((it: any) => {
|
|
149
|
+
Content(` "${it.name}" => ${elixirLit(it.type, 'example_' + it.name)}, # ${canonToType(it.type, target.name)}
|
|
150
|
+
`)
|
|
151
|
+
})
|
|
152
|
+
Content(`}))
|
|
153
|
+
\`\`\`
|
|
154
|
+
|
|
155
|
+
`)
|
|
156
|
+
}
|
|
157
|
+
})
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
export {
|
|
162
|
+
ReadmeEntity
|
|
163
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
|
|
2
|
+
import { cmp, Content, File } from '@voxgig/sdkgen'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// Emits elixir/test/readme_examples_test.exs — an ExUnit SYNTAX + PRESENCE
|
|
6
|
+
// gate over every ```elixir fenced block in the three docs that ship elixir
|
|
7
|
+
// examples: the repository ROOT README.md, the per-language elixir/README.md,
|
|
8
|
+
// and the per-language elixir/REFERENCE.md.
|
|
9
|
+
//
|
|
10
|
+
// For each block, tagged by (source doc, index), the gate PARSES it with
|
|
11
|
+
// `Code.string_to_quoted/1` — catching malformed examples (a missing `end`, a
|
|
12
|
+
// bad token, an unbalanced `%{}`). It also asserts each doc that exists ships
|
|
13
|
+
// at least one elixir block.
|
|
14
|
+
//
|
|
15
|
+
// SCOPE NOTE: unlike the Python/Lua gates this does NOT execute blocks in a
|
|
16
|
+
// seeded offline subprocess. Elixir's compile model makes running a README
|
|
17
|
+
// fragment against the generated `<Name>` modules substantially heavier (each
|
|
18
|
+
// block would need the SDK compiled and loaded, and the narrative aliases
|
|
19
|
+
// resolved), so this port stops at the syntax gate — a real, useful guard that
|
|
20
|
+
// keeps documented examples parseable as the generator evolves.
|
|
21
|
+
//
|
|
22
|
+
// The emitted Elixir avoids backticks (chr 96 via <<96>>) so this TS template
|
|
23
|
+
// literal stays clean; the only interpolation is the SDK module name.
|
|
24
|
+
const ReadmeExamplesTest = cmp(function ReadmeExamplesTest(props: any) {
|
|
25
|
+
const { ctx$: { model } } = props
|
|
26
|
+
|
|
27
|
+
const Name = model.const.Name
|
|
28
|
+
|
|
29
|
+
File({ name: 'readme_examples_test.exs' }, () => {
|
|
30
|
+
Content(`# ${Name} SDK — documentation elixir-examples syntax gate.
|
|
31
|
+
#
|
|
32
|
+
# SYNTAX + PRESENCE gate over every elixir fenced code block in three docs:
|
|
33
|
+
# - the repository ROOT README.md (one directory above the elixir/ package),
|
|
34
|
+
# - the per-language elixir/README.md,
|
|
35
|
+
# - the per-language elixir/REFERENCE.md.
|
|
36
|
+
#
|
|
37
|
+
# Every block is parsed with Code.string_to_quoted/1 so a malformed documented
|
|
38
|
+
# example (missing end, unbalanced map, bad token) fails the suite. Generated
|
|
39
|
+
# by @voxgig/sdkgen — do not edit by hand.
|
|
40
|
+
|
|
41
|
+
defmodule ${Name}.ReadmeExamplesTest do
|
|
42
|
+
use ExUnit.Case
|
|
43
|
+
|
|
44
|
+
# The triple-backtick markdown fence, built without literal backticks.
|
|
45
|
+
@fence String.duplicate(<<96>>, 3)
|
|
46
|
+
|
|
47
|
+
@pkg_root Path.expand("..", __DIR__)
|
|
48
|
+
@docs [
|
|
49
|
+
{"root README", Path.expand("../README.md", @pkg_root)},
|
|
50
|
+
{"elixir README.md", Path.join(@pkg_root, "README.md")},
|
|
51
|
+
{"elixir REFERENCE.md", Path.join(@pkg_root, "REFERENCE.md")}
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
# Return the code bodies of every elixir-tagged fenced block in \`text\`.
|
|
55
|
+
# Splitting on the fence yields alternating outside/inside segments; the
|
|
56
|
+
# odd-indexed ones are inside a fence. Keep only those whose info string
|
|
57
|
+
# (first line) is exactly "elixir".
|
|
58
|
+
defp elixir_blocks(text) do
|
|
59
|
+
text
|
|
60
|
+
|> String.split(@fence)
|
|
61
|
+
|> Enum.with_index()
|
|
62
|
+
|> Enum.filter(fn {_seg, i} -> rem(i, 2) == 1 end)
|
|
63
|
+
|> Enum.map(fn {seg, _i} -> seg end)
|
|
64
|
+
|> Enum.filter(fn seg ->
|
|
65
|
+
[info | _] = String.split(seg, "\\n")
|
|
66
|
+
String.trim(info) == "elixir"
|
|
67
|
+
end)
|
|
68
|
+
|> Enum.map(fn seg ->
|
|
69
|
+
[_info | rest] = String.split(seg, "\\n")
|
|
70
|
+
Enum.join(rest, "\\n")
|
|
71
|
+
end)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
defp doc_blocks(path) do
|
|
75
|
+
case File.read(path) do
|
|
76
|
+
{:ok, text} -> {:present, elixir_blocks(text)}
|
|
77
|
+
_ -> :absent
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
test "documented elixir examples parse" do
|
|
82
|
+
{failures, present, total} =
|
|
83
|
+
Enum.reduce(@docs, {[], 0, 0}, fn {label, path}, {fails, present, total} ->
|
|
84
|
+
case doc_blocks(path) do
|
|
85
|
+
:absent ->
|
|
86
|
+
{fails, present, total}
|
|
87
|
+
|
|
88
|
+
{:present, blocks} ->
|
|
89
|
+
block_fails =
|
|
90
|
+
blocks
|
|
91
|
+
|> Enum.with_index()
|
|
92
|
+
|> Enum.flat_map(fn {block, i} ->
|
|
93
|
+
case Code.string_to_quoted(block) do
|
|
94
|
+
{:ok, _ast} ->
|
|
95
|
+
[]
|
|
96
|
+
|
|
97
|
+
{:error, reason} ->
|
|
98
|
+
[
|
|
99
|
+
label <>
|
|
100
|
+
" elixir block #" <>
|
|
101
|
+
Integer.to_string(i) <>
|
|
102
|
+
" failed to parse: " <>
|
|
103
|
+
inspect(reason) <> "\\n\\n" <> block
|
|
104
|
+
]
|
|
105
|
+
end
|
|
106
|
+
end)
|
|
107
|
+
|
|
108
|
+
{fails ++ block_fails, present + 1, total + length(blocks)}
|
|
109
|
+
end
|
|
110
|
+
end)
|
|
111
|
+
|
|
112
|
+
assert failures == [], Enum.join(failures, "\\n\\n")
|
|
113
|
+
|
|
114
|
+
# At least one doc must be present and carry at least one elixir example.
|
|
115
|
+
assert present > 0, "no README/REFERENCE docs found to scan for elixir examples"
|
|
116
|
+
assert total > 0, "expected at least one elixir example block across the docs"
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
`)
|
|
120
|
+
})
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
export {
|
|
125
|
+
ReadmeExamplesTest
|
|
126
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
|
|
2
|
+
import { cmp, Content } from '@voxgig/sdkgen'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
const ReadmeExplanation = cmp(function ReadmeExplanation(props: any) {
|
|
6
|
+
const { target, ctx$: { model } } = props
|
|
7
|
+
|
|
8
|
+
const app = model.const.name.toLowerCase()
|
|
9
|
+
|
|
10
|
+
Content(`### Data as struct value nodes
|
|
11
|
+
|
|
12
|
+
The Elixir SDK models every runtime object — clients, contexts, results and
|
|
13
|
+
record data — as reference-stable struct value nodes from the vendored
|
|
14
|
+
\`Voxgig.Struct\` library rather than as compile-time structs. This mirrors
|
|
15
|
+
the dynamic nature of the API and lets a feature hook mutate a shared node
|
|
16
|
+
that every later pipeline stage observes — the immutable-Elixir way to honour
|
|
17
|
+
the shared-mutable hook contract.
|
|
18
|
+
|
|
19
|
+
Build inputs from native Elixir maps with \`${model.Name}.Helpers.deep/1\`,
|
|
20
|
+
and read fields off results with \`Voxgig.Struct.getprop/2\`.
|
|
21
|
+
|
|
22
|
+
### Module structure
|
|
23
|
+
|
|
24
|
+
\`\`\`
|
|
25
|
+
elixir/
|
|
26
|
+
├── lib/
|
|
27
|
+
│ ├── ${app}.ex -- Main SDK module (entity factories)
|
|
28
|
+
│ ├── config.ex -- Resolved configuration
|
|
29
|
+
│ ├── features.ex -- Feature factory
|
|
30
|
+
│ ├── pipeline.ex -- Operation pipeline
|
|
31
|
+
│ └── ${app}/
|
|
32
|
+
│ ├── context.ex -- Operation context
|
|
33
|
+
│ ├── entity_base.ex -- Shared entity behaviour
|
|
34
|
+
│ ├── error.ex -- SDK error type
|
|
35
|
+
│ ├── feature.ex -- Built-in features
|
|
36
|
+
│ ├── helpers.ex -- Value helpers (deep/1, ...)
|
|
37
|
+
│ ├── json.ex -- JSON encode/decode
|
|
38
|
+
│ └── utility.ex -- Utility functions
|
|
39
|
+
│ └── entity/ -- Per-entity modules
|
|
40
|
+
├── mix.exs -- Package manifest
|
|
41
|
+
└── test/ -- ExUnit suites
|
|
42
|
+
\`\`\`
|
|
43
|
+
|
|
44
|
+
The main module \`${model.Name}\` exposes the SDK constructors and one entity
|
|
45
|
+
factory function per entity. Call an operation on the matching
|
|
46
|
+
\`${model.Name}.Entity.<Name>\` module.
|
|
47
|
+
|
|
48
|
+
`)
|
|
49
|
+
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
ReadmeExplanation
|
|
55
|
+
}
|