@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
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
buildIdNames,
|
|
25
25
|
getMatchEntries,
|
|
26
26
|
isAuthActive,
|
|
27
|
+
entityDataIdField,
|
|
27
28
|
} from '@voxgig/sdkgen'
|
|
28
29
|
|
|
29
30
|
|
|
@@ -396,6 +397,7 @@ const generateCreate: OpGen = (ctx, step, index) => {
|
|
|
396
397
|
|
|
397
398
|
const generateList: OpGen = (ctx, step, index) => {
|
|
398
399
|
const { entity, flow } = ctx
|
|
400
|
+
const hasDataId = null != entityDataIdField(entity)
|
|
399
401
|
const ref = step.input.ref ?? entity.name + '_ref01'
|
|
400
402
|
const entvar = goVar(step.input.entvar ?? ref + '_ent')
|
|
401
403
|
const matchvar = goVar(step.input.matchvar ?? (ref + '_match' + (step.input.suffix ?? '')))
|
|
@@ -431,7 +433,9 @@ const generateList: OpGen = (ctx, step, index) => {
|
|
|
431
433
|
// Only declare ${listvar} as a real var when a downstream validator
|
|
432
434
|
// actually uses it; otherwise `_` to satisfy Go's unused-var check.
|
|
433
435
|
const allSteps = Object.values(flow.step) as any[]
|
|
434
|
-
|
|
436
|
+
// hasDataId: the ItemExists/ItemNotExists asserts (the only listvar users) are
|
|
437
|
+
// now gated on a real DATA id field, so without one the list result is unused.
|
|
438
|
+
const listvarUsed = hasDataId && !!step.valid?.some((v: any) => {
|
|
435
439
|
if ('ItemExists' !== v.apply && 'ItemNotExists' !== v.apply) return false
|
|
436
440
|
const validRef = v.def?.ref
|
|
437
441
|
return validRef && allSteps.some((s: any) => 'create' === s.op &&
|
|
@@ -460,7 +464,7 @@ const generateList: OpGen = (ctx, step, index) => {
|
|
|
460
464
|
const hasRefData = validRef && allSteps.some((s: any) => 'create' === s.op &&
|
|
461
465
|
((s.input.ref ?? entity.name + '_ref01') === validRef))
|
|
462
466
|
|
|
463
|
-
if ('ItemExists' === validator.apply && hasRefData) {
|
|
467
|
+
if ('ItemExists' === validator.apply && hasRefData && hasDataId) {
|
|
464
468
|
const refDataVar = goVar(validRef + '_data')
|
|
465
469
|
Content(`
|
|
466
470
|
foundItem := vs.Select(entityListToData(${listvar}), map[string]any{"id": ${refDataVar}["id"]})
|
|
@@ -468,7 +472,7 @@ const generateList: OpGen = (ctx, step, index) => {
|
|
|
468
472
|
t.Fatal("expected to find created entity in list")
|
|
469
473
|
}
|
|
470
474
|
`)
|
|
471
|
-
} else if ('ItemNotExists' === validator.apply && hasRefData) {
|
|
475
|
+
} else if ('ItemNotExists' === validator.apply && hasRefData && hasDataId) {
|
|
472
476
|
const refDataVar = goVar(validRef + '_data')
|
|
473
477
|
Content(`
|
|
474
478
|
notFoundItem := vs.Select(entityListToData(${listvar}), map[string]any{"id": ${refDataVar}["id"]})
|
|
@@ -642,6 +646,9 @@ const generateLoad: OpGen = (ctx, step, index) => {
|
|
|
642
646
|
|
|
643
647
|
const generateRemove: OpGen = (ctx, step, index) => {
|
|
644
648
|
const { entity, flow } = ctx
|
|
649
|
+
if (null == entityDataIdField(entity)) {
|
|
650
|
+
return
|
|
651
|
+
}
|
|
645
652
|
const ref = step.input.ref ?? entity.name + '_ref01'
|
|
646
653
|
const entvar = goVar(step.input.entvar ?? ref + '_ent')
|
|
647
654
|
const matchvar = goVar(step.input.matchvar ?? (ref + '_match' + (step.input.suffix ?? '')))
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
camelify,
|
|
7
7
|
canonKey,
|
|
8
8
|
each,
|
|
9
|
-
|
|
9
|
+
exampleVarName,
|
|
10
10
|
} from '@voxgig/sdkgen'
|
|
11
11
|
|
|
12
12
|
import {
|
|
@@ -77,7 +77,8 @@ function exampleValue(entity: any, op: any, paramName: string, placeholder: stri
|
|
|
77
77
|
// `type`/`range` entity must not bind a Go keyword).
|
|
78
78
|
function goVarName(name: string): string {
|
|
79
79
|
const pascal = camelify(name)
|
|
80
|
-
|
|
80
|
+
// exampleVarName also guards `client`, the doc examples' SDK-instance var.
|
|
81
|
+
return exampleVarName(pascal.charAt(0).toLowerCase() + pascal.slice(1), 'go')
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
|
|
@@ -50,18 +50,27 @@ const Main = cmp(function Main(props: any) {
|
|
|
50
50
|
/go-cli
|
|
51
51
|
`))
|
|
52
52
|
|
|
53
|
-
//
|
|
53
|
+
// ==========================================================================
|
|
54
|
+
// README.md — Diátaxis-structured, examples-first usage guide.
|
|
55
|
+
//
|
|
56
|
+
// EVERYTHING here is MODEL-DRIVEN: verbs, examples and how-to sections are
|
|
57
|
+
// gated on whether an active entity actually exposes that op
|
|
58
|
+
// (op.<name>.active !== false) — never document an operation no entity
|
|
59
|
+
// supports. The CLI implements three AQL words (list / load / update; see
|
|
60
|
+
// words.fragment.go + runOp).
|
|
61
|
+
// ==========================================================================
|
|
62
|
+
const bin = `${model.name}-cli`
|
|
54
63
|
const entityList = entityNames.length > 0 ? entityNames.join(' ') : '(none)'
|
|
64
|
+
const entityCount = entityNames.length
|
|
65
|
+
|
|
66
|
+
const projUpper = String(model.name).toUpperCase().replace(/[^A-Z0-9]/g, '_')
|
|
67
|
+
const apiKeyEnv = projUpper + '_APIKEY'
|
|
68
|
+
const baseEnv = projUpper + '_BASE'
|
|
55
69
|
|
|
56
|
-
// MODEL-DRIVEN verbs. The CLI implements three AQL words (list / load /
|
|
57
|
-
// update; see words.fragment.go + runOp). Each README verb row is
|
|
58
|
-
// advertised ONLY when at least one active entity actually exposes that
|
|
59
|
-
// op (op.<name>.active !== false) — never document an operation no entity
|
|
60
|
-
// supports.
|
|
61
70
|
const CLI_VERB_ROWS: Record<string, string> = {
|
|
62
|
-
list: '| `list` | `
|
|
63
|
-
load: '| `load` | `
|
|
64
|
-
update: '| `update` | `
|
|
71
|
+
list: '| `list` | `list <entity>` · `list <query> <entity>` | First page of records |',
|
|
72
|
+
load: '| `load` | `load <entity>` · `load <query> <entity>` | A single record |',
|
|
73
|
+
update: '| `update` | `update <query> <entity>` | Update a record, return it |',
|
|
65
74
|
}
|
|
66
75
|
const supportedOps = new Set<string>()
|
|
67
76
|
each(entityMap, (entity: any) => {
|
|
@@ -76,72 +85,260 @@ const Main = cmp(function Main(props: any) {
|
|
|
76
85
|
.map(op => CLI_VERB_ROWS[op])
|
|
77
86
|
.join('\n')
|
|
78
87
|
|
|
79
|
-
//
|
|
80
|
-
//
|
|
81
|
-
const
|
|
82
|
-
Object.values(entityMap).
|
|
88
|
+
// First / second active entity for concrete, truthful examples, gated on
|
|
89
|
+
// the FIRST entity's own ops so an example never shows a verb it lacks.
|
|
90
|
+
const activeEntityObjs: any[] =
|
|
91
|
+
Object.values(entityMap).filter((e: any) => e && e.active !== false)
|
|
92
|
+
const firstEntityObj: any = activeEntityObjs[0]
|
|
83
93
|
const firstEntity = firstEntityObj
|
|
84
94
|
? String(firstEntityObj.name).toLowerCase()
|
|
85
95
|
: (entityNames[0] || 'entity')
|
|
96
|
+
const secondEntity = activeEntityObjs.length > 1
|
|
97
|
+
? String(activeEntityObjs[1].name).toLowerCase()
|
|
98
|
+
: firstEntity
|
|
86
99
|
const firstOps: any = (firstEntityObj && firstEntityObj.op) || {}
|
|
87
100
|
const firstHas = (op: string) => !!(firstOps[op] && firstOps[op].active !== false)
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
101
|
+
const entityNoun = entityCount === 1 ? 'entity' : 'entities'
|
|
102
|
+
// The best single example expression this SDK can actually run, for the
|
|
103
|
+
// tutorial/REPL walkthroughs (never demonstrates an unsupported op).
|
|
104
|
+
const exampleOp =
|
|
105
|
+
firstHas('list') ? `list ${firstEntity}` :
|
|
106
|
+
firstHas('load') ? `load 1 ${firstEntity}` :
|
|
107
|
+
firstHas('update') ? `update '{id:1}' ${firstEntity}` : ''
|
|
108
|
+
// Fallback differs by context: a COMMAND-LINE arg uses the `--help` flag;
|
|
109
|
+
// the `/`-prefixed meta-command is only valid INSIDE the REPL.
|
|
110
|
+
const cliExampleExpr = exampleOp || '--help'
|
|
111
|
+
const replExampleExpr = exampleOp || '/help'
|
|
112
|
+
|
|
113
|
+
// ---- Examples block (up front) -------------------------------------------
|
|
114
|
+
const ex: string[] = []
|
|
115
|
+
ex.push(`# 1. Build a native binary (-> dist/<os>-<arch>/${bin})`)
|
|
116
|
+
ex.push('make build')
|
|
117
|
+
ex.push('')
|
|
118
|
+
ex.push('# 2. See usage (words, entities, env vars)')
|
|
119
|
+
ex.push(`./${bin} --help`)
|
|
120
|
+
ex.push('')
|
|
121
|
+
ex.push('# 3. Provide credentials once, via the environment')
|
|
122
|
+
ex.push(`export ${apiKeyEnv}=sk_live_xxx`)
|
|
123
|
+
ex.push('')
|
|
124
|
+
ex.push('# 4. Each command line is ONE AQL expression, run against the API:')
|
|
125
|
+
if (firstHas('list')) ex.push(`./${bin} list ${firstEntity}`)
|
|
92
126
|
if (firstHas('load')) {
|
|
93
|
-
|
|
94
|
-
|
|
127
|
+
ex.push(`./${bin} load 1 ${firstEntity} # {id:1} shorthand`)
|
|
128
|
+
ex.push(`./${bin} load '{id:1}' ${firstEntity} # explicit match map`)
|
|
95
129
|
}
|
|
96
|
-
if (firstHas('update')) {
|
|
97
|
-
|
|
130
|
+
if (firstHas('update')) ex.push(`./${bin} update '{name:"x"}' ${firstEntity}`)
|
|
131
|
+
if (firstHas('list') && secondEntity !== firstEntity) {
|
|
132
|
+
ex.push(`./${bin} list ${secondEntity}`)
|
|
98
133
|
}
|
|
134
|
+
ex.push('')
|
|
135
|
+
ex.push('# 5. Override the API base URL for a single call')
|
|
136
|
+
ex.push(`${baseEnv}=https://api.example.com ./${bin} ${cliExampleExpr}`)
|
|
137
|
+
ex.push('')
|
|
138
|
+
ex.push('# 6. No arguments -> interactive REPL')
|
|
139
|
+
ex.push(`./${bin}`)
|
|
140
|
+
ex.push(`${model.name}> ${replExampleExpr}`)
|
|
141
|
+
ex.push(`${model.name}> /quit`)
|
|
142
|
+
const exampleBlock = ex.join('\n')
|
|
143
|
+
|
|
144
|
+
// ---- How-to guides (gated) -----------------------------------------------
|
|
145
|
+
const howtos: string[] = []
|
|
146
|
+
if (firstHas('list')) howtos.push(`### List the records of an entity
|
|
99
147
|
|
|
100
|
-
|
|
148
|
+
\`\`\`sh
|
|
149
|
+
./${bin} list ${firstEntity}
|
|
150
|
+
\`\`\`
|
|
151
|
+
|
|
152
|
+
\`list <entity>\` returns the first page of records. \`<entity>\` is a bareword —
|
|
153
|
+
it is auto-quoted as an AQL atom, so no quotes are needed.`)
|
|
154
|
+
|
|
155
|
+
if (firstHas('load')) howtos.push(`### Load a single record
|
|
156
|
+
|
|
157
|
+
\`\`\`sh
|
|
158
|
+
./${bin} load 1 ${firstEntity} # scalar shorthand for {id:1}
|
|
159
|
+
./${bin} load '{id:1}' ${firstEntity} # explicit match map
|
|
160
|
+
\`\`\`
|
|
161
|
+
|
|
162
|
+
The query is either a **scalar** (\`1\`, treated as \`{id:1}\`) or a **match map**
|
|
163
|
+
(\`{id:1}\`, \`{slug:"acme"}\`). Quote the map so your shell passes it through intact.`)
|
|
164
|
+
|
|
165
|
+
if (firstHas('update')) howtos.push(`### Update a record
|
|
166
|
+
|
|
167
|
+
\`\`\`sh
|
|
168
|
+
./${bin} update '{id:1,name:"new"}' ${firstEntity}
|
|
169
|
+
\`\`\`
|
|
101
170
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
falls into an interactive REPL.
|
|
171
|
+
The match map carries both the selector and the new field values; the updated
|
|
172
|
+
record is printed back.`)
|
|
105
173
|
|
|
106
|
-
|
|
174
|
+
howtos.push(`### Authenticate and choose an environment
|
|
107
175
|
|
|
108
|
-
|
|
176
|
+
Configuration is read from the environment — nothing is written to disk:
|
|
109
177
|
|
|
110
178
|
\`\`\`sh
|
|
111
|
-
|
|
179
|
+
export ${apiKeyEnv}=sk_live_xxx # API key
|
|
180
|
+
export ${baseEnv}=https://api.example.com # optional: override the API base URL
|
|
181
|
+
./${bin} ${cliExampleExpr}
|
|
112
182
|
\`\`\`
|
|
113
183
|
|
|
114
|
-
|
|
184
|
+
Both are injectable by a secrets vault, so the key never has to be typed inline.`)
|
|
185
|
+
|
|
186
|
+
howtos.push(`### Explore interactively with the REPL
|
|
187
|
+
|
|
188
|
+
Run with no arguments to open a REPL (prompt \`${model.name}>\`). Each line is
|
|
189
|
+
evaluated as its own AQL expression:
|
|
190
|
+
|
|
191
|
+
\`\`\`text
|
|
192
|
+
$ ./${bin}
|
|
193
|
+
${exampleOp ? `${model.name}> ${exampleOp}\n` : ''}${model.name}> /help
|
|
194
|
+
${model.name}> /quit
|
|
195
|
+
\`\`\``)
|
|
196
|
+
|
|
197
|
+
howtos.push(`### Cross-compile release binaries
|
|
115
198
|
|
|
116
199
|
\`\`\`sh
|
|
117
|
-
|
|
200
|
+
make build # native binary for this machine
|
|
201
|
+
make build-all # linux/darwin/windows x amd64/arm64, under dist/<os>-<arch>/
|
|
202
|
+
\`\`\``)
|
|
118
203
|
|
|
119
|
-
|
|
120
|
-
|
|
204
|
+
howtos.push(`### Discover the available entities
|
|
205
|
+
|
|
206
|
+
\`/help\` in the REPL prints the full entity list, or see [Entities](#entities)
|
|
207
|
+
below — this SDK exposes ${entityCount} ${entityNoun}.`)
|
|
208
|
+
|
|
209
|
+
const howtoBlock = howtos.join('\n\n')
|
|
210
|
+
|
|
211
|
+
File({ name: 'README.md' }, () => Content(`# ${model.name}-cli
|
|
212
|
+
|
|
213
|
+
AQL-driven command-line client **and** interactive REPL for the ${model.Name}
|
|
214
|
+
SDK. Each command line is parsed as a single [AQL](https://github.com/aql-lang/aql)
|
|
215
|
+
expression and evaluated against the live API; run it with no arguments to drop
|
|
216
|
+
into a REPL. Built on \`github.com/aql-lang/aql/eng/go\` and the sibling Go SDK
|
|
217
|
+
at \`../go\`.
|
|
218
|
+
|
|
219
|
+
## Examples
|
|
220
|
+
|
|
221
|
+
\`\`\`sh
|
|
222
|
+
${exampleBlock}
|
|
121
223
|
\`\`\`
|
|
122
224
|
|
|
123
|
-
|
|
225
|
+
> The rest of this guide follows the [Diátaxis](https://diataxis.fr) framework:
|
|
226
|
+
> a hands-on **Tutorial**, task-focused **How-to guides**, a factual
|
|
227
|
+
> **Reference**, and background **Explanation**.
|
|
228
|
+
|
|
229
|
+
## Tutorial: your first query in under a minute
|
|
230
|
+
|
|
231
|
+
1. **Build the binary.** From this \`go-cli/\` directory:
|
|
232
|
+
|
|
233
|
+
\`\`\`sh
|
|
234
|
+
make build # -> dist/<os>-<arch>/${bin}
|
|
235
|
+
\`\`\`
|
|
124
236
|
|
|
125
|
-
|
|
126
|
-
|
|
237
|
+
2. **Set your API key** (read from the environment):
|
|
238
|
+
|
|
239
|
+
\`\`\`sh
|
|
240
|
+
export ${apiKeyEnv}=sk_live_xxx
|
|
241
|
+
\`\`\`
|
|
242
|
+
|
|
243
|
+
3. **Run a query.** Evaluate an AQL expression against the API (or run with no
|
|
244
|
+
arguments to open the REPL):
|
|
245
|
+
|
|
246
|
+
\`\`\`sh
|
|
247
|
+
./dist/*/${bin} ${cliExampleExpr}
|
|
248
|
+
\`\`\`
|
|
249
|
+
|
|
250
|
+
4. **Go interactive.** Run the binary with no arguments to open the REPL, then
|
|
251
|
+
type \`/help\` for the word and entity lists and \`/quit\` to leave.
|
|
252
|
+
|
|
253
|
+
That is the whole loop: *build → set key → evaluate AQL expressions*.
|
|
254
|
+
|
|
255
|
+
## How-to guides
|
|
256
|
+
|
|
257
|
+
${howtoBlock}
|
|
258
|
+
|
|
259
|
+
## Reference
|
|
260
|
+
|
|
261
|
+
### Words
|
|
262
|
+
|
|
263
|
+
The CLI registers these AQL words, each bound to the SDK:
|
|
264
|
+
|
|
265
|
+
| Word | Signatures | Returns |
|
|
266
|
+
|----------|-----------------------------------------------|--------------------------------|
|
|
127
267
|
${verbRows}
|
|
128
268
|
|
|
129
|
-
|
|
130
|
-
|
|
269
|
+
- \`<entity>\` is a bareword, auto-quoted as an AQL atom (e.g. \`${firstEntity}\`).
|
|
270
|
+
- \`<query>\` is either a **Map** (\`{id:1}\`) or a **Scalar** (\`1\`, treated as
|
|
271
|
+
\`{id:1}\`). A scalar is always wrapped as \`{id:<value>}\`.
|
|
272
|
+
|
|
273
|
+
### Environment variables
|
|
274
|
+
|
|
275
|
+
| Variable | Purpose |
|
|
276
|
+
|----------|---------|
|
|
277
|
+
| \`${apiKeyEnv}\` | API key sent with every request. |
|
|
278
|
+
| \`${baseEnv}\` | Optional override of the API base URL. |
|
|
279
|
+
|
|
280
|
+
Unset variables fall back to the SDK's built-in defaults.
|
|
281
|
+
|
|
282
|
+
### CLI flags
|
|
131
283
|
|
|
132
|
-
|
|
284
|
+
- \`--help\` / \`-h\` — print usage (words, entities, env vars) and exit.
|
|
285
|
+
|
|
286
|
+
### REPL commands
|
|
287
|
+
|
|
288
|
+
Meta-commands use the \`/\` prefix (everything else on a line is evaluated as AQL):
|
|
289
|
+
|
|
290
|
+
- \`/quit\` / \`/q\` / \`/exit\` — exit the REPL
|
|
291
|
+
- \`/help\` / \`/h\` / \`/?\` — show the word list, entity list and meta commands
|
|
292
|
+
|
|
293
|
+
### Exit codes
|
|
294
|
+
|
|
295
|
+
| Code | Meaning |
|
|
296
|
+
|------|---------|
|
|
297
|
+
| \`0\` | Success (also the normal REPL exit). |
|
|
298
|
+
| \`1\` | Parse error, word-registration error, or an API/evaluation error. |
|
|
299
|
+
|
|
300
|
+
### Build targets
|
|
301
|
+
|
|
302
|
+
| Target | Result |
|
|
303
|
+
|--------|--------|
|
|
304
|
+
| \`make build\` | Native binary at \`dist/<os>-<arch>/${bin}\`. |
|
|
305
|
+
| \`make build-all\` | linux/darwin/windows x amd64/arm64, each under its own \`dist/<os>-<arch>/\`. |
|
|
306
|
+
| \`make clean\` | Remove \`dist/\` and any stray binaries. |
|
|
307
|
+
|
|
308
|
+
### Entities
|
|
309
|
+
|
|
310
|
+
The ${entityCount} ${entityNoun} this SDK exposes (any is valid as \`<entity>\`):
|
|
133
311
|
|
|
134
312
|
${entityList}
|
|
135
313
|
|
|
136
|
-
##
|
|
314
|
+
## Explanation
|
|
315
|
+
|
|
316
|
+
### Why AQL?
|
|
317
|
+
|
|
318
|
+
The whole command line is one [AQL](https://github.com/aql-lang/aql) expression,
|
|
319
|
+
not a fixed \`verb --flag\` grammar. That means the same binary works one-shot
|
|
320
|
+
(\`./${bin} <expr>\`) and interactively (the REPL), and expressions compose the
|
|
321
|
+
same way in both. \`list\` / \`load\` / \`update\` are ordinary AQL *words* bound to
|
|
322
|
+
the SDK — adding SDK operations is adding words, not re-parsing flags.
|
|
323
|
+
|
|
324
|
+
### How it is wired
|
|
325
|
+
|
|
326
|
+
\`main.go\` builds the SDK client (configured from the environment), creates an
|
|
327
|
+
AQL registry, and \`words.go\` registers \`list\` / \`load\` / \`update\` as native
|
|
328
|
+
words that dispatch on the entity atom and call the sibling Go SDK at \`../go\`.
|
|
329
|
+
Results are unwrapped from their \`Entity\` wrappers to plain data before being
|
|
330
|
+
printed.
|
|
331
|
+
|
|
332
|
+
### Output format
|
|
137
333
|
|
|
138
|
-
|
|
139
|
-
-
|
|
334
|
+
Each result value is printed as its AQL string form (a JSON-like rendering of
|
|
335
|
+
the record or list of records). One-shot mode prints to stdout; errors go to
|
|
336
|
+
stderr with a non-zero exit code.
|
|
140
337
|
|
|
141
338
|
## Generated by
|
|
142
339
|
|
|
143
|
-
sdkgen \`go-cli\` target. See the target source under
|
|
144
|
-
|
|
340
|
+
sdkgen \`go-cli\` target. See the target source under \`.sdk/src/cmp/go-cli/\` in
|
|
341
|
+
this repo, or upstream at
|
|
145
342
|
\`github.com/voxgig/sdkgen/project/.sdk/src/cmp/go-cli/\`.
|
|
146
343
|
`))
|
|
147
344
|
|
|
@@ -19,14 +19,36 @@ import (
|
|
|
19
19
|
// prompt is the REPL prompt prefix (matches the SDK slug).
|
|
20
20
|
const prompt = "// <[SLOT:promptName]>"
|
|
21
21
|
|
|
22
|
-
// entitiesHelp is the space-separated entity list shown by
|
|
22
|
+
// entitiesHelp is the space-separated entity list shown by /help.
|
|
23
23
|
const entitiesHelp = "// <[SLOT:entityNamesSpaced]>"
|
|
24
24
|
|
|
25
25
|
func main() {
|
|
26
26
|
os.Exit(run(os.Args[1:], os.Stdin, os.Stdout, os.Stderr))
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
// usage prints the CLI help (for --help / -h). No client or network setup.
|
|
30
|
+
func usage(out io.Writer) {
|
|
31
|
+
fmt.Fprintf(out, "%s-cli — AQL-driven CLI + REPL for the %s SDK\n\n", prompt, prompt)
|
|
32
|
+
fmt.Fprintln(out, "Usage:")
|
|
33
|
+
fmt.Fprintf(out, " %s-cli [--help] [<AQL expression>]\n\n", prompt)
|
|
34
|
+
fmt.Fprintln(out, "With arguments, they are joined into a single AQL expression and")
|
|
35
|
+
fmt.Fprintln(out, "evaluated against the API. With no arguments, starts an interactive REPL.")
|
|
36
|
+
fmt.Fprintln(out)
|
|
37
|
+
fmt.Fprintln(out, "Words: list / load / update <query?> <entity>")
|
|
38
|
+
fmt.Fprintln(out, "Entities:", entitiesHelp)
|
|
39
|
+
fmt.Fprintln(out, "Env: APIKEYENVVAR (api key), BASEENVVAR (base url override)")
|
|
40
|
+
fmt.Fprintln(out, "REPL: /help /quit")
|
|
41
|
+
}
|
|
42
|
+
|
|
29
43
|
func run(args []string, in io.Reader, out, errOut io.Writer) int {
|
|
44
|
+
// --help / -h: print usage and exit before any config or network setup.
|
|
45
|
+
for _, a := range args {
|
|
46
|
+
if a == "--help" || a == "-h" {
|
|
47
|
+
usage(out)
|
|
48
|
+
return 0
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
30
52
|
// Configure from the environment: APIKEYENVVAR carries the API key and
|
|
31
53
|
// BASEENVVAR optionally overrides the API base URL (e.g. production).
|
|
32
54
|
// Both injectable by a secrets vault. Unset -> nil config defaults.
|
|
@@ -94,12 +116,12 @@ func repl(r *eng.Registry, in io.Reader, out io.Writer) {
|
|
|
94
116
|
continue
|
|
95
117
|
}
|
|
96
118
|
switch line {
|
|
97
|
-
case "
|
|
119
|
+
case "/quit", "/q", "/exit":
|
|
98
120
|
return
|
|
99
|
-
case "
|
|
100
|
-
fmt.Fprintln(out, "
|
|
121
|
+
case "/help", "/h", "/?":
|
|
122
|
+
fmt.Fprintln(out, "words: list / load / update <query?> <entity>")
|
|
101
123
|
fmt.Fprintln(out, "entities:", entitiesHelp)
|
|
102
|
-
fmt.Fprintln(out, "meta:
|
|
124
|
+
fmt.Fprintln(out, "meta: /help /quit")
|
|
103
125
|
continue
|
|
104
126
|
}
|
|
105
127
|
values, err := parser.Parse(line)
|