@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
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
|
|
2
|
+
import { cmp, each, Content, canonToType, File, isAuthActive, 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
|
+
const OP_SIGNATURES: Record<string, { sig: string, desc: string }> = {
|
|
14
|
+
load: {
|
|
15
|
+
sig: 'load(entity, reqmatch, ctrl \\\\ nil) :: map()',
|
|
16
|
+
desc: 'Load a single entity matching the given criteria. Returns the entity data and raises on error.',
|
|
17
|
+
},
|
|
18
|
+
list: {
|
|
19
|
+
sig: 'list(entity, reqmatch \\\\ nil, ctrl \\\\ nil) :: list()',
|
|
20
|
+
desc: 'List entities matching the given criteria. The match is optional — call `list(entity)` to list all records. Returns a list and raises on error.',
|
|
21
|
+
},
|
|
22
|
+
create: {
|
|
23
|
+
sig: 'create(entity, reqdata, ctrl \\\\ nil) :: map()',
|
|
24
|
+
desc: 'Create a new entity with the given data. Returns the created entity data and raises on error.',
|
|
25
|
+
},
|
|
26
|
+
update: {
|
|
27
|
+
sig: 'update(entity, reqdata, ctrl \\\\ nil) :: map()',
|
|
28
|
+
desc: 'Update an existing entity. The data must include the entity `id`. Returns the updated entity data and raises on error.',
|
|
29
|
+
},
|
|
30
|
+
remove: {
|
|
31
|
+
sig: 'remove(entity, reqmatch, ctrl \\\\ nil) :: map()',
|
|
32
|
+
desc: 'Remove the entity matching the given criteria. Raises on error.',
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
const ReadmeRef = cmp(function ReadmeRef(props: any) {
|
|
38
|
+
const { target } = props
|
|
39
|
+
const { model } = props.ctx$
|
|
40
|
+
|
|
41
|
+
const Name = model.const.Name
|
|
42
|
+
const entity = getModelPath(model, `main.${KIT}.entity`)
|
|
43
|
+
const feature = getModelPath(model, `main.${KIT}.feature`)
|
|
44
|
+
|
|
45
|
+
const publishedEntities = each(entity).filter((e: any) => e.active !== false)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
File({ name: 'REFERENCE.md' }, () => {
|
|
49
|
+
|
|
50
|
+
Content(`# ${model.Name} ${target.title} SDK Reference
|
|
51
|
+
|
|
52
|
+
Complete API reference for the ${model.Name} ${target.title} SDK.
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## ${Name}
|
|
56
|
+
|
|
57
|
+
### Constructor
|
|
58
|
+
|
|
59
|
+
\`\`\`elixir
|
|
60
|
+
sdk = ${Name}.new(options)
|
|
61
|
+
\`\`\`
|
|
62
|
+
|
|
63
|
+
Create a new SDK client. \`options\` is a struct value node — build one from a
|
|
64
|
+
native map with \`${Name}.Helpers.deep/1\`.
|
|
65
|
+
|
|
66
|
+
**Options:**
|
|
67
|
+
|
|
68
|
+
| Name | Type | Description |
|
|
69
|
+
| --- | --- | --- |
|
|
70
|
+
${isAuthActive(model) ? '| `apikey` | `String.t()` | API key for authentication. |\n' : ''}| \`base\` | \`String.t()\` | Base URL for API requests. |
|
|
71
|
+
| \`prefix\` | \`String.t()\` | URL prefix appended after base. |
|
|
72
|
+
| \`suffix\` | \`String.t()\` | URL suffix appended after path. |
|
|
73
|
+
| \`headers\` | \`map()\` | Custom headers for all requests. |
|
|
74
|
+
| \`feature\` | \`map()\` | Feature configuration. |
|
|
75
|
+
| \`system\` | \`map()\` | System overrides (e.g. custom fetch). |
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
### Constructors
|
|
79
|
+
|
|
80
|
+
#### \`${Name}.test(testopts \\\\ nil, sdkopts \\\\ nil)\`
|
|
81
|
+
|
|
82
|
+
Create a test client with mock features active. Both arguments may be \`nil\`.
|
|
83
|
+
|
|
84
|
+
\`\`\`elixir
|
|
85
|
+
sdk = ${Name}.test()
|
|
86
|
+
\`\`\`
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### Functions
|
|
90
|
+
|
|
91
|
+
`)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
// Entity factory functions
|
|
95
|
+
publishedEntities.map((ent: any) => {
|
|
96
|
+
Content(`#### \`${Name}.${ent.name}(client, entopts \\\\ nil)\`
|
|
97
|
+
|
|
98
|
+
Create a \`${Name}.Entity.${ent.Name}\` handle.
|
|
99
|
+
|
|
100
|
+
`)
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
Content(`#### \`options_map(client) :: map()\`
|
|
105
|
+
|
|
106
|
+
Return a deep copy of the current SDK options.
|
|
107
|
+
|
|
108
|
+
#### \`get_utility(client) :: map()\`
|
|
109
|
+
|
|
110
|
+
Return the SDK utility node.
|
|
111
|
+
|
|
112
|
+
#### \`direct(client, fetchargs) :: map()\`
|
|
113
|
+
|
|
114
|
+
Make a direct HTTP request to any API endpoint. Returns a result node with
|
|
115
|
+
\`ok\`, \`status\`, \`headers\`, and \`data\` (or \`err\` on failure). This escape
|
|
116
|
+
hatch never raises — branch on \`Voxgig.Struct.getprop(result, "ok")\`.
|
|
117
|
+
|
|
118
|
+
**fetchargs keys:**
|
|
119
|
+
|
|
120
|
+
| Key | Type | Description |
|
|
121
|
+
| --- | --- | --- |
|
|
122
|
+
| \`path\` | \`String.t()\` | URL path with optional \`{param}\` placeholders. |
|
|
123
|
+
| \`method\` | \`String.t()\` | HTTP method (default: \`"GET"\`). |
|
|
124
|
+
| \`params\` | \`map()\` | Path parameter values. |
|
|
125
|
+
| \`query\` | \`map()\` | Query string parameters. |
|
|
126
|
+
| \`headers\` | \`map()\` | Request headers (merged with defaults). |
|
|
127
|
+
| \`body\` | \`any()\` | Request body (maps are JSON-serialized). |
|
|
128
|
+
|
|
129
|
+
#### \`prepare(client, fetchargs) :: map()\`
|
|
130
|
+
|
|
131
|
+
Prepare a fetch definition without sending. Returns the \`fetchdef\` and raises
|
|
132
|
+
on error.
|
|
133
|
+
|
|
134
|
+
`)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
// Entity reference sections
|
|
138
|
+
publishedEntities.map((ent: any) => {
|
|
139
|
+
const EName = ent.Name
|
|
140
|
+
const eVar = ent.name
|
|
141
|
+
const opnames = Object.keys(ent.op || {})
|
|
142
|
+
const fields = ent.fields || []
|
|
143
|
+
const idF = entityIdField(ent)
|
|
144
|
+
|
|
145
|
+
Content(`
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## ${Name}.Entity.${EName}
|
|
149
|
+
|
|
150
|
+
`)
|
|
151
|
+
|
|
152
|
+
if (ent.short) {
|
|
153
|
+
Content(`${ent.short}
|
|
154
|
+
|
|
155
|
+
`)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
Content(`\`\`\`elixir
|
|
159
|
+
${eVar} = ${Name}.${eVar}(sdk)
|
|
160
|
+
\`\`\`
|
|
161
|
+
|
|
162
|
+
`)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
// Field schema
|
|
166
|
+
if (fields.length > 0) {
|
|
167
|
+
Content(`### Fields
|
|
168
|
+
|
|
169
|
+
| Field | Type | Required | Description |
|
|
170
|
+
| --- | --- | --- | --- |
|
|
171
|
+
`)
|
|
172
|
+
each(fields, (field: any) => {
|
|
173
|
+
const req = field.req ? 'Yes' : 'No'
|
|
174
|
+
const desc = field.short || ''
|
|
175
|
+
Content(`| \`${field.name}\` | \`${canonToType(field.type, target.name)}\` | ${req} | ${desc} |
|
|
176
|
+
`)
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
Content(`
|
|
180
|
+
`)
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
// Operation details
|
|
185
|
+
if (opnames.length > 0) {
|
|
186
|
+
Content(`### Operations
|
|
187
|
+
|
|
188
|
+
`)
|
|
189
|
+
|
|
190
|
+
opnames.map((opname: string) => {
|
|
191
|
+
const info = OP_SIGNATURES[opname]
|
|
192
|
+
if (!info) return
|
|
193
|
+
|
|
194
|
+
Content(`#### \`${info.sig}\`
|
|
195
|
+
|
|
196
|
+
${info.desc}
|
|
197
|
+
|
|
198
|
+
`)
|
|
199
|
+
|
|
200
|
+
if ('load' === opname || 'remove' === opname) {
|
|
201
|
+
const matchItems = opRequestShape(ent, opname).items
|
|
202
|
+
.filter((it: any) => !it.optional || it.name === idF)
|
|
203
|
+
.sort((a: any, b: any) =>
|
|
204
|
+
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
205
|
+
const arg = 0 < matchItems.length
|
|
206
|
+
? `${Name}.Helpers.deep(%{${matchItems.map((it: any) =>
|
|
207
|
+
`"${it.name}" => ${elixirLit(it.type,
|
|
208
|
+
it.name === idF ? ent.name + '_id' : it.name)}`).join(', ')}})`
|
|
209
|
+
: `${Name}.Helpers.deep(%{})`
|
|
210
|
+
Content(`\`\`\`elixir
|
|
211
|
+
record = ${Name}.Entity.${EName}.${opname}(${eVar}, ${arg})
|
|
212
|
+
\`\`\`
|
|
213
|
+
|
|
214
|
+
`)
|
|
215
|
+
}
|
|
216
|
+
else if ('list' === opname) {
|
|
217
|
+
Content(`\`\`\`elixir
|
|
218
|
+
records = ${Name}.Entity.${EName}.list(${eVar})
|
|
219
|
+
\`\`\`
|
|
220
|
+
|
|
221
|
+
`)
|
|
222
|
+
}
|
|
223
|
+
else if ('create' === opname) {
|
|
224
|
+
const createItems = opRequestShape(ent, 'create').items
|
|
225
|
+
.filter((it: any) => !it.optional)
|
|
226
|
+
Content(`\`\`\`elixir
|
|
227
|
+
record = ${Name}.Entity.${EName}.create(${eVar}, ${Name}.Helpers.deep(%{
|
|
228
|
+
`)
|
|
229
|
+
createItems.map((it: any) => {
|
|
230
|
+
Content(` "${it.name}" => ${elixirLit(it.type, 'example_' + it.name)}, # ${canonToType(it.type, target.name)}
|
|
231
|
+
`)
|
|
232
|
+
})
|
|
233
|
+
Content(`}))
|
|
234
|
+
\`\`\`
|
|
235
|
+
|
|
236
|
+
`)
|
|
237
|
+
}
|
|
238
|
+
else if ('update' === opname) {
|
|
239
|
+
const updateItems = opRequestShape(ent, 'update').items
|
|
240
|
+
.filter((it: any) => !it.optional || it.name === idF)
|
|
241
|
+
.sort((a: any, b: any) =>
|
|
242
|
+
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
243
|
+
const updateLines = updateItems.map((it: any) =>
|
|
244
|
+
` "${it.name}" => ${elixirLit(it.type,
|
|
245
|
+
it.name === idF ? ent.name + '_id' : it.name)},\n`).join('')
|
|
246
|
+
Content(`\`\`\`elixir
|
|
247
|
+
record = ${Name}.Entity.${EName}.update(${eVar}, ${Name}.Helpers.deep(%{
|
|
248
|
+
${updateLines} # Fields to update
|
|
249
|
+
}))
|
|
250
|
+
\`\`\`
|
|
251
|
+
|
|
252
|
+
`)
|
|
253
|
+
}
|
|
254
|
+
})
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
// Common functions
|
|
259
|
+
Content(`### Common Functions
|
|
260
|
+
|
|
261
|
+
#### \`data_get(entity) :: map()\`
|
|
262
|
+
|
|
263
|
+
Get the entity data.
|
|
264
|
+
|
|
265
|
+
#### \`data_set(entity, data)\`
|
|
266
|
+
|
|
267
|
+
Set the entity data.
|
|
268
|
+
|
|
269
|
+
#### \`match_get(entity) :: map()\`
|
|
270
|
+
|
|
271
|
+
Get the entity match criteria.
|
|
272
|
+
|
|
273
|
+
#### \`match_set(entity, match)\`
|
|
274
|
+
|
|
275
|
+
Set the entity match criteria.
|
|
276
|
+
|
|
277
|
+
#### \`make(entity) :: entity\`
|
|
278
|
+
|
|
279
|
+
Create a new \`${Name}.Entity.${EName}\` handle with the same options.
|
|
280
|
+
|
|
281
|
+
#### \`get_name(entity) :: String.t()\`
|
|
282
|
+
|
|
283
|
+
Return the entity name.
|
|
284
|
+
|
|
285
|
+
`)
|
|
286
|
+
})
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
// Features section
|
|
290
|
+
const activeFeatures = each(feature).filter((f: any) => f.active)
|
|
291
|
+
if (activeFeatures.length > 0) {
|
|
292
|
+
Content(`
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## Features
|
|
296
|
+
|
|
297
|
+
| Feature | Version | Description |
|
|
298
|
+
| --- | --- | --- |
|
|
299
|
+
`)
|
|
300
|
+
|
|
301
|
+
activeFeatures.map((f: any) => {
|
|
302
|
+
Content(`| \`${f.name}\` | ${f.version || '0.0.1'} | ${f.title || ''} |
|
|
303
|
+
`)
|
|
304
|
+
})
|
|
305
|
+
|
|
306
|
+
Content(`
|
|
307
|
+
|
|
308
|
+
Features are activated via the \`feature\` option:
|
|
309
|
+
|
|
310
|
+
`)
|
|
311
|
+
|
|
312
|
+
Content(`\`\`\`elixir
|
|
313
|
+
sdk = ${Name}.new(${Name}.Helpers.deep(%{
|
|
314
|
+
"feature" => %{
|
|
315
|
+
`)
|
|
316
|
+
activeFeatures.map((f: any) => {
|
|
317
|
+
Content(` "${f.name}" => %{"active" => true},
|
|
318
|
+
`)
|
|
319
|
+
})
|
|
320
|
+
Content(` }
|
|
321
|
+
}))
|
|
322
|
+
\`\`\`
|
|
323
|
+
|
|
324
|
+
`)
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
})
|
|
328
|
+
})
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
export {
|
|
332
|
+
ReadmeRef
|
|
333
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
import { cmp, Content } from '@voxgig/sdkgen'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
const ReadmeTopHowto = cmp(function ReadmeTopHowto(props: any) {
|
|
6
|
+
const { ctx$: { model } } = props
|
|
7
|
+
|
|
8
|
+
const Name = model.const.Name
|
|
9
|
+
|
|
10
|
+
Content(`**Elixir:**
|
|
11
|
+
\`\`\`elixir
|
|
12
|
+
result = ${Name}.direct(sdk, ${Name}.Helpers.deep(%{
|
|
13
|
+
"path" => "/api/resource/{id}",
|
|
14
|
+
"method" => "GET",
|
|
15
|
+
"params" => %{"id" => "example"}
|
|
16
|
+
}))
|
|
17
|
+
\`\`\`
|
|
18
|
+
|
|
19
|
+
`)
|
|
20
|
+
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
ReadmeTopHowto
|
|
26
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
|
|
2
|
+
import { cmp, Content, isAuthActive, envName, entityIdField, opRequestShape } from '@voxgig/sdkgen'
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
KIT,
|
|
6
|
+
getModelPath,
|
|
7
|
+
nom,
|
|
8
|
+
} from '@voxgig/apidef'
|
|
9
|
+
|
|
10
|
+
import { elixirLit } from './utility_elixir'
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
|
|
14
|
+
const { ctx$: { model } } = props
|
|
15
|
+
|
|
16
|
+
const Name = model.const.Name
|
|
17
|
+
const entity = getModelPath(model, `main.${KIT}.entity`)
|
|
18
|
+
|
|
19
|
+
const exampleEntity = Object.values(entity).find((e: any) => e.active !== false) as any
|
|
20
|
+
|
|
21
|
+
const authActive = isAuthActive(model)
|
|
22
|
+
const ctor = authActive
|
|
23
|
+
? `${Name}.new(H.deep(%{"apikey" => System.get_env("${envName(model)}_APIKEY")}))`
|
|
24
|
+
: `${Name}.new()`
|
|
25
|
+
|
|
26
|
+
Content(`\`\`\`elixir
|
|
27
|
+
alias ${Name}.Helpers, as: H
|
|
28
|
+
|
|
29
|
+
sdk = ${ctor}
|
|
30
|
+
|
|
31
|
+
`)
|
|
32
|
+
|
|
33
|
+
if (exampleEntity) {
|
|
34
|
+
const eName = nom(exampleEntity, 'Name')
|
|
35
|
+
const eVar = exampleEntity.name
|
|
36
|
+
const opnames = Object.keys(exampleEntity.op || {})
|
|
37
|
+
const idF = entityIdField(exampleEntity)
|
|
38
|
+
|
|
39
|
+
Content(`${eVar} = ${Name}.${eVar}(sdk)
|
|
40
|
+
`)
|
|
41
|
+
|
|
42
|
+
if (opnames.includes('list')) {
|
|
43
|
+
Content(`
|
|
44
|
+
# List all ${eName.toLowerCase()} records (raises on error)
|
|
45
|
+
records = ${Name}.Entity.${eName}.list(${eVar})
|
|
46
|
+
IO.inspect(records)
|
|
47
|
+
`)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (opnames.includes('load')) {
|
|
51
|
+
// Every REQUIRED load-match key (id first, then parent path params like
|
|
52
|
+
// page_id) — the same shape the runtime resolves path params from, so
|
|
53
|
+
// the example always works.
|
|
54
|
+
const loadItems = opRequestShape(exampleEntity, 'load').items
|
|
55
|
+
.filter((it: any) => !it.optional || it.name === idF)
|
|
56
|
+
.sort((a: any, b: any) =>
|
|
57
|
+
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
58
|
+
const loadArg = 0 < loadItems.length
|
|
59
|
+
? `H.deep(%{${loadItems.map((it: any) =>
|
|
60
|
+
`"${it.name}" => ${elixirLit(it.type,
|
|
61
|
+
it.name === idF ? 'example_id' : 'example_' + it.name)}`).join(', ')}})`
|
|
62
|
+
: ''
|
|
63
|
+
Content(`
|
|
64
|
+
# Load a specific ${eName.toLowerCase()} (returns the record, raises on error)
|
|
65
|
+
record = ${Name}.Entity.${eName}.load(${eVar}, ${loadArg})
|
|
66
|
+
IO.inspect(record)
|
|
67
|
+
`)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
Content(`\`\`\`
|
|
72
|
+
`)
|
|
73
|
+
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
export {
|
|
78
|
+
ReadmeTopQuick
|
|
79
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
|
|
2
|
+
import { cmp, Content, entityIdField, pickExampleEntity, opRequestShape } from '@voxgig/sdkgen'
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
KIT,
|
|
6
|
+
getModelPath,
|
|
7
|
+
nom,
|
|
8
|
+
} from '@voxgig/apidef'
|
|
9
|
+
|
|
10
|
+
import { elixirLit } from './utility_elixir'
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const ReadmeTopTest = cmp(function ReadmeTopTest(props: any) {
|
|
14
|
+
const { ctx$: { model } } = props
|
|
15
|
+
|
|
16
|
+
const Name = model.const.Name
|
|
17
|
+
const entity = getModelPath(model, `main.${KIT}.entity`)
|
|
18
|
+
|
|
19
|
+
// Pick an entity with a real op (prefer a read op) — never fabricate a
|
|
20
|
+
// `load` on an op-less entity.
|
|
21
|
+
const { entity: exampleEntity, primaryOp } = pickExampleEntity(entity)
|
|
22
|
+
|
|
23
|
+
Content(`\`\`\`elixir
|
|
24
|
+
alias ${Name}.Helpers, as: H
|
|
25
|
+
|
|
26
|
+
sdk = ${Name}.test()
|
|
27
|
+
`)
|
|
28
|
+
|
|
29
|
+
if (exampleEntity && primaryOp) {
|
|
30
|
+
const eName = nom(exampleEntity, 'Name')
|
|
31
|
+
const eVar = exampleEntity.name
|
|
32
|
+
const idF = entityIdField(exampleEntity)
|
|
33
|
+
const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
|
|
34
|
+
let arg = ''
|
|
35
|
+
if (isMatchOp) {
|
|
36
|
+
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
37
|
+
.filter((it: any) => !it.optional || it.name === idF)
|
|
38
|
+
.sort((a: any, b: any) =>
|
|
39
|
+
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
40
|
+
arg = 0 < items.length
|
|
41
|
+
? `H.deep(%{${items.map((it: any) =>
|
|
42
|
+
`"${it.name}" => ${it.name === idF ? '"test01"' : elixirLit(it.type)}`).join(', ')}})`
|
|
43
|
+
: 'H.deep(%{})'
|
|
44
|
+
} else if ('create' === primaryOp || 'update' === primaryOp) {
|
|
45
|
+
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
46
|
+
.filter((it: any) => it.name !== idF && it.name !== 'id')
|
|
47
|
+
const required = items.filter((it: any) => !it.optional)
|
|
48
|
+
const chosen = required.length ? required : items.slice(0, 3)
|
|
49
|
+
arg = `H.deep(%{${chosen.map((it: any) => `"${it.name}" => ${elixirLit(it.type)}`).join(', ')}})`
|
|
50
|
+
} else {
|
|
51
|
+
arg = 'H.deep(%{})'
|
|
52
|
+
}
|
|
53
|
+
const resVar = 'list' === primaryOp ? 'records' : 'record'
|
|
54
|
+
Content(`${eVar} = ${Name}.${eVar}(sdk)
|
|
55
|
+
${resVar} = ${Name}.Entity.${eName}.${primaryOp}(${eVar}, ${arg})
|
|
56
|
+
IO.inspect(${resVar})
|
|
57
|
+
`)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
Content(`\`\`\`
|
|
61
|
+
`)
|
|
62
|
+
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
export {
|
|
67
|
+
ReadmeTopTest
|
|
68
|
+
}
|
|
@@ -12,6 +12,7 @@ import { cmp, each, Folder, File, Content } from '@voxgig/sdkgen'
|
|
|
12
12
|
|
|
13
13
|
import { TestEntity } from './TestEntity_elixir'
|
|
14
14
|
import { TestDirect } from './TestDirect_elixir'
|
|
15
|
+
import { ReadmeExamplesTest } from './ReadmeExamplesTest_elixir'
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
const Test = cmp(function Test(props: any) {
|
|
@@ -38,6 +39,9 @@ end
|
|
|
38
39
|
TestEntity({ target, entity })
|
|
39
40
|
TestDirect({ target, entity })
|
|
40
41
|
})
|
|
42
|
+
|
|
43
|
+
// Validate the documented elixir examples in the README/REFERENCE docs.
|
|
44
|
+
ReadmeExamplesTest({ target })
|
|
41
45
|
})
|
|
42
46
|
})
|
|
43
47
|
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# EJECT-START
|
|
2
2
|
|
|
3
|
+
# Returns the created entityname entity map (ProjectName.Types.entityname/0)
|
|
4
|
+
# on success; pipeline errors surface as the error value built by
|
|
5
|
+
# Utility.make_error (shape is utility-configurable), hence term().
|
|
6
|
+
@spec create(map(), ProjectName.Types.entityname_create_data() | nil, map() | nil) :: term()
|
|
3
7
|
def create(ent, reqdata, ctrl \\ nil) do
|
|
4
8
|
ctx =
|
|
5
9
|
Context.new(
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# EJECT-START
|
|
2
2
|
|
|
3
|
+
# Returns a list of entityname entity maps (ProjectName.Types.entityname/0)
|
|
4
|
+
# on success; pipeline errors surface as the error value built by
|
|
5
|
+
# Utility.make_error (shape is utility-configurable), hence term().
|
|
6
|
+
@spec list(map(), ProjectName.Types.entityname_list_match() | nil, map() | nil) :: term()
|
|
3
7
|
def list(ent, reqmatch \\ nil, ctrl \\ nil) do
|
|
4
8
|
reqmatch = if reqmatch == nil, do: S.jm([]), else: reqmatch
|
|
5
9
|
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# EJECT-START
|
|
2
2
|
|
|
3
|
+
# Returns the entityname entity map (ProjectName.Types.entityname/0) on
|
|
4
|
+
# success; pipeline errors surface as the error value built by
|
|
5
|
+
# Utility.make_error (shape is utility-configurable), hence term().
|
|
6
|
+
@spec load(map(), ProjectName.Types.entityname_load_match() | nil, map() | nil) :: term()
|
|
3
7
|
def load(ent, reqmatch \\ nil, ctrl \\ nil) do
|
|
4
8
|
reqmatch = if reqmatch == nil, do: S.jm([]), else: reqmatch
|
|
5
9
|
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# EJECT-START
|
|
2
2
|
|
|
3
|
+
# Returns the removed entityname entity map (ProjectName.Types.entityname/0)
|
|
4
|
+
# on success; pipeline errors surface as the error value built by
|
|
5
|
+
# Utility.make_error (shape is utility-configurable), hence term().
|
|
6
|
+
@spec remove(map(), ProjectName.Types.entityname_remove_match() | nil, map() | nil) :: term()
|
|
3
7
|
def remove(ent, reqmatch \\ nil, ctrl \\ nil) do
|
|
4
8
|
reqmatch = if reqmatch == nil, do: S.jm([]), else: reqmatch
|
|
5
9
|
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# EJECT-START
|
|
2
2
|
|
|
3
|
+
# Returns the updated entityname entity map (ProjectName.Types.entityname/0)
|
|
4
|
+
# on success; pipeline errors surface as the error value built by
|
|
5
|
+
# Utility.make_error (shape is utility-configurable), hence term().
|
|
6
|
+
@spec update(map(), ProjectName.Types.entityname_update_data() | nil, map() | nil) :: term()
|
|
3
7
|
def update(ent, reqdata, ctrl \\ nil) do
|
|
4
8
|
ctx =
|
|
5
9
|
Context.new(
|
|
@@ -6,6 +6,36 @@ import {
|
|
|
6
6
|
walk,
|
|
7
7
|
} from '@voxgig/struct'
|
|
8
8
|
|
|
9
|
+
import {
|
|
10
|
+
canonKey,
|
|
11
|
+
canonToType,
|
|
12
|
+
} from '@voxgig/sdkgen'
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
// Map a canonical type sentinel ($STRING, $INTEGER, ...) to an idiomatic
|
|
16
|
+
// Elixir typespec. Unknown/missing sentinels fall back to `any()` (never
|
|
17
|
+
// throws). Thin delegate to the SHARED canonToType 'elixir' column (the
|
|
18
|
+
// single source of truth per language — do not keep a local table here);
|
|
19
|
+
// kept as an exported function so existing importers keep working.
|
|
20
|
+
function elixirType(sentinel: unknown): string {
|
|
21
|
+
return canonToType(sentinel, 'elixir')
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
// A type-correct, executable Elixir literal for a field/param of the given
|
|
26
|
+
// canonical type. Strings render the quoted placeholder; numeric/boolean/
|
|
27
|
+
// collection types render a real literal so example blocks parse and run.
|
|
28
|
+
function elixirLit(sentinel: unknown, placeholder: string = 'example'): string {
|
|
29
|
+
switch (canonKey(sentinel)) {
|
|
30
|
+
case 'INTEGER':
|
|
31
|
+
case 'NUMBER': return '1'
|
|
32
|
+
case 'BOOLEAN': return 'true'
|
|
33
|
+
case 'ARRAY': return '[]'
|
|
34
|
+
case 'OBJECT': return '%{}'
|
|
35
|
+
default: return `"${placeholder}"`
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
9
39
|
|
|
10
40
|
function projectPath(suffix?: string): string {
|
|
11
41
|
return Path.normalize(Path.join(__dirname, '../../..', suffix ?? ''))
|
|
@@ -81,5 +111,7 @@ export {
|
|
|
81
111
|
clean,
|
|
82
112
|
formatElixir,
|
|
83
113
|
elixirString,
|
|
114
|
+
elixirType,
|
|
115
|
+
elixirLit,
|
|
84
116
|
projectPath,
|
|
85
117
|
}
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
File, Content, Folder,
|
|
32
32
|
} from '@voxgig/sdkgen'
|
|
33
33
|
|
|
34
|
-
import { canonToType, opTypeName, opRequestShape } from '@voxgig/sdkgen'
|
|
34
|
+
import { canonToType, opTypeName, opRequestShape, warnEntityTypeCollisions } from '@voxgig/sdkgen'
|
|
35
35
|
|
|
36
36
|
import {
|
|
37
37
|
KIT,
|
|
@@ -74,9 +74,13 @@ function fieldLine(name: string, sentinel: any, optional: boolean): string {
|
|
|
74
74
|
|
|
75
75
|
const EntityTypes = cmp(function EntityTypes(props: any) {
|
|
76
76
|
const { target } = props
|
|
77
|
-
const { model } = props.ctx$
|
|
77
|
+
const { model, log } = props.ctx$
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
// only_active:false — getModelPath DROPS active:false entries by default,
|
|
80
|
+
// but the consumer scaffold (create-sdkgen Root.ts) iterates the RAW entity
|
|
81
|
+
// collection, so inactive entities still get generated entity code that
|
|
82
|
+
// references these typed names. The typed model must cover them too.
|
|
83
|
+
const entity = getModelPath(model, `main.${KIT}.entity`, { only_active: false, required: false })
|
|
80
84
|
// Emit for every entity that gets an entity file. Main_go.ts / Entity_go.ts
|
|
81
85
|
// iterate entities WITHOUT an `active` filter and reference the typed data
|
|
82
86
|
// type `<Name>` in every *_entity.go, so a struct is required for each or the
|
|
@@ -89,6 +93,11 @@ const EntityTypes = cmp(function EntityTypes(props: any) {
|
|
|
89
93
|
const entityList = each(entity).filter((e: any) => e && null != e.name)
|
|
90
94
|
entityList.forEach((e: any) => { if (null == e.Name) names(e, e.name) })
|
|
91
95
|
|
|
96
|
+
// Surface duplicate generated type names (two entities with the same
|
|
97
|
+
// PascalCase Name) — they would redeclare a type in statically-typed
|
|
98
|
+
// targets. Detection only; renaming is a model-level decision.
|
|
99
|
+
warnEntityTypeCollisions(entity, log, LANG)
|
|
100
|
+
|
|
92
101
|
Folder({ name: 'entity' }, () => {
|
|
93
102
|
|
|
94
103
|
File({ name: 'types.' + target.ext }, () => {
|
|
@@ -45,7 +45,12 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
|
|
|
45
45
|
const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
|
|
46
46
|
let testArg = 'nil'
|
|
47
47
|
if (exampleEntity && isMatchOp) {
|
|
48
|
-
|
|
48
|
+
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
49
|
+
.filter((it: any) => !it.optional || it.name === idF)
|
|
50
|
+
.sort((a: any, b: any) => (a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
51
|
+
testArg = 0 < items.length
|
|
52
|
+
? `map[string]any{${items.map((it: any) => `"${it.name}": ${it.name === idF ? '"test01"' : goLit(it.type)}`).join(', ')}}`
|
|
53
|
+
: 'nil'
|
|
49
54
|
} else if (exampleEntity && ('create' === primaryOp || 'update' === primaryOp)) {
|
|
50
55
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
51
56
|
.filter((it: any) => it.name !== idF && it.name !== 'id')
|