@voxgig/sdkgen 1.2.0 → 1.3.1
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 +2 -2
- package/dist/action/action.d.ts +2 -1
- package/dist/action/action.js +15 -9
- package/dist/action/action.js.map +1 -1
- package/dist/action/feature.js +6 -3
- package/dist/action/feature.js.map +1 -1
- package/dist/action/target.d.ts +7 -1
- package/dist/action/target.js +13 -6
- package/dist/action/target.js.map +1 -1
- package/dist/cmp/Changelog.d.ts +2 -0
- package/dist/cmp/Changelog.js +30 -0
- package/dist/cmp/Changelog.js.map +1 -0
- package/dist/cmp/Deploy.d.ts +2 -0
- package/dist/cmp/Deploy.js +227 -0
- package/dist/cmp/Deploy.js.map +1 -0
- package/dist/cmp/FeatureHook.js +5 -6
- package/dist/cmp/FeatureHook.js.map +1 -1
- package/dist/cmp/License.d.ts +2 -0
- package/dist/cmp/License.js +44 -0
- package/dist/cmp/License.js.map +1 -0
- package/dist/cmp/Readme.js +2 -0
- package/dist/cmp/Readme.js.map +1 -1
- package/dist/cmp/ReadmeErrors.d.ts +2 -0
- package/dist/cmp/ReadmeErrors.js +210 -0
- package/dist/cmp/ReadmeErrors.js.map +1 -0
- package/dist/cmp/ReadmeExplanation.js +213 -223
- package/dist/cmp/ReadmeExplanation.js.map +1 -1
- package/dist/cmp/ReadmeModel.js +6 -1
- package/dist/cmp/ReadmeModel.js.map +1 -1
- package/dist/cmp/ReadmeTop.js +389 -82
- package/dist/cmp/ReadmeTop.js.map +1 -1
- package/dist/cmp/Security.d.ts +2 -0
- package/dist/cmp/Security.js +36 -0
- package/dist/cmp/Security.js.map +1 -0
- package/dist/helpers/canonType.d.ts +7 -0
- package/dist/helpers/canonType.js +74 -0
- package/dist/helpers/canonType.js.map +1 -0
- package/dist/helpers/collectDeps.d.ts +3 -2
- package/dist/helpers/collectDeps.js.map +1 -1
- package/dist/helpers/naming.d.ts +3 -0
- package/dist/helpers/naming.js +51 -0
- package/dist/helpers/naming.js.map +1 -0
- package/dist/helpers/opExample.d.ts +13 -0
- package/dist/helpers/opExample.js +149 -0
- package/dist/helpers/opExample.js.map +1 -0
- package/dist/helpers/opShape.d.ts +18 -0
- package/dist/helpers/opShape.js +193 -0
- package/dist/helpers/opShape.js.map +1 -0
- package/dist/helpers/packageMeta.d.ts +27 -0
- package/dist/helpers/packageMeta.js +224 -0
- package/dist/helpers/packageMeta.js.map +1 -0
- package/dist/sdkgen.d.ts +11 -1
- package/dist/sdkgen.js +57 -18
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +65 -2
- package/dist/types.js.map +1 -1
- package/dist/utility.js +20 -11
- package/dist/utility.js.map +1 -1
- package/model/sdkgen.aontu +137 -0
- package/package.json +13 -6
- package/project/.sdk/model/target/go-cli.jsonic +47 -0
- package/project/.sdk/model/target/go-mcp.jsonic +41 -0
- package/project/.sdk/model/target/go.jsonic +9 -3
- package/project/.sdk/model/target/js.jsonic +13 -0
- package/project/.sdk/model/target/lua.jsonic +13 -0
- package/project/.sdk/model/target/php.jsonic +13 -0
- package/project/.sdk/model/target/py.jsonic +13 -0
- package/project/.sdk/model/target/rb.jsonic +13 -0
- package/project/.sdk/model/target/ts.jsonic +13 -0
- package/project/.sdk/src/cmp/go/EntityOperation_go.ts +1 -0
- package/project/.sdk/src/cmp/go/EntityTypes_go.ts +197 -0
- package/project/.sdk/src/cmp/go/Entity_go.ts +2 -1
- package/project/.sdk/src/cmp/go/MainEntity_go.ts +6 -0
- package/project/.sdk/src/cmp/go/Main_go.ts +23 -3
- package/project/.sdk/src/cmp/go/Package_go.ts +1 -1
- package/project/.sdk/src/cmp/go/ReadmeEntity_go.ts +18 -6
- package/project/.sdk/src/cmp/go/ReadmeExamplesTest_go.ts +684 -0
- package/project/.sdk/src/cmp/go/ReadmeExplanation_go.ts +1 -1
- package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +48 -8
- package/project/.sdk/src/cmp/go/ReadmeInstall_go.ts +11 -6
- package/project/.sdk/src/cmp/go/ReadmeIntro_go.ts +40 -1
- package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +63 -17
- package/project/.sdk/src/cmp/go/ReadmeOptions_go.ts +4 -3
- package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +124 -115
- package/project/.sdk/src/cmp/go/ReadmeRef_go.ts +28 -15
- package/project/.sdk/src/cmp/go/ReadmeTopQuick_go.ts +33 -9
- package/project/.sdk/src/cmp/go/ReadmeTopTest_go.ts +35 -5
- package/project/.sdk/src/cmp/go/TestEntity_go.ts +1 -1
- package/project/.sdk/src/cmp/go/Test_go.ts +5 -1
- package/project/.sdk/src/cmp/go/fragment/Entity.fragment.go +21 -0
- package/project/.sdk/src/cmp/go/fragment/EntityCreateOp.fragment.go +11 -0
- package/project/.sdk/src/cmp/go/fragment/EntityListOp.fragment.go +11 -0
- package/project/.sdk/src/cmp/go/fragment/EntityLoadOp.fragment.go +11 -0
- package/project/.sdk/src/cmp/go/fragment/EntityRemoveOp.fragment.go +11 -0
- package/project/.sdk/src/cmp/go/fragment/EntityUpdateOp.fragment.go +11 -0
- package/project/.sdk/src/cmp/go-cli/Main_go-cli.ts +195 -0
- package/project/.sdk/src/cmp/go-cli/fragment/main.fragment.go +106 -0
- package/project/.sdk/src/cmp/go-cli/fragment/words.fragment.go +132 -0
- package/project/.sdk/src/cmp/go-mcp/Main_go-mcp.ts +184 -0
- package/project/.sdk/src/cmp/go-mcp/fragment/main.fragment.go +68 -0
- package/project/.sdk/src/cmp/go-mcp/fragment/tools.fragment.go +114 -0
- package/project/.sdk/src/cmp/js/EntityTypes_js.ts +111 -0
- package/project/.sdk/src/cmp/js/MainEntity_js.ts +1 -0
- package/project/.sdk/src/cmp/js/Main_js.ts +3 -0
- package/project/.sdk/src/cmp/js/Package_js.ts +16 -7
- package/project/.sdk/src/cmp/js/ReadmeEntity_js.ts +13 -7
- package/project/.sdk/src/cmp/js/ReadmeExplanation_js.ts +2 -2
- package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +52 -11
- package/project/.sdk/src/cmp/js/ReadmeIntro_js.ts +39 -1
- package/project/.sdk/src/cmp/js/ReadmeModel_js.ts +50 -18
- package/project/.sdk/src/cmp/js/ReadmeOptions_js.ts +4 -3
- package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +45 -19
- package/project/.sdk/src/cmp/js/ReadmeRef_js.ts +24 -13
- package/project/.sdk/src/cmp/js/ReadmeTopHowto_js.ts +3 -0
- package/project/.sdk/src/cmp/js/ReadmeTopQuick_js.ts +28 -12
- package/project/.sdk/src/cmp/js/ReadmeTopTest_js.ts +23 -3
- package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +5 -0
- package/project/.sdk/src/cmp/js/fragment/EntityListOp.fragment.js +5 -0
- package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +5 -0
- package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +5 -0
- package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +5 -0
- package/project/.sdk/src/cmp/js/utility_js.ts +57 -0
- package/project/.sdk/src/cmp/lua/EntityTypes_lua.ts +113 -0
- package/project/.sdk/src/cmp/lua/MainEntity_lua.ts +8 -0
- package/project/.sdk/src/cmp/lua/Main_lua.ts +4 -0
- package/project/.sdk/src/cmp/lua/Package_lua.ts +23 -4
- package/project/.sdk/src/cmp/lua/ReadmeEntity_lua.ts +12 -10
- package/project/.sdk/src/cmp/lua/ReadmeExamplesTest_lua.ts +293 -0
- package/project/.sdk/src/cmp/lua/ReadmeHowto_lua.ts +46 -8
- package/project/.sdk/src/cmp/lua/ReadmeInstall_lua.ts +19 -3
- package/project/.sdk/src/cmp/lua/ReadmeIntro_lua.ts +38 -1
- package/project/.sdk/src/cmp/lua/ReadmeModel_lua.ts +51 -16
- package/project/.sdk/src/cmp/lua/ReadmeOptions_lua.ts +4 -3
- package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +79 -18
- package/project/.sdk/src/cmp/lua/ReadmeRef_lua.ts +25 -20
- package/project/.sdk/src/cmp/lua/ReadmeTopQuick_lua.ts +17 -9
- package/project/.sdk/src/cmp/lua/ReadmeTopTest_lua.ts +32 -5
- package/project/.sdk/src/cmp/lua/Test_lua.ts +4 -0
- package/project/.sdk/src/cmp/lua/fragment/EntityCreateOp.fragment.lua +4 -0
- package/project/.sdk/src/cmp/lua/fragment/EntityListOp.fragment.lua +4 -0
- package/project/.sdk/src/cmp/lua/fragment/EntityLoadOp.fragment.lua +4 -0
- package/project/.sdk/src/cmp/lua/fragment/EntityRemoveOp.fragment.lua +4 -0
- package/project/.sdk/src/cmp/lua/fragment/EntityUpdateOp.fragment.lua +4 -0
- package/project/.sdk/src/cmp/php/EntityTypes_php.ts +142 -0
- package/project/.sdk/src/cmp/php/MainEntity_php.ts +18 -1
- package/project/.sdk/src/cmp/php/Main_php.ts +4 -0
- package/project/.sdk/src/cmp/php/Package_php.ts +18 -7
- package/project/.sdk/src/cmp/php/ReadmeEntity_php.ts +15 -11
- package/project/.sdk/src/cmp/php/ReadmeExamplesTest_php.ts +401 -0
- package/project/.sdk/src/cmp/php/ReadmeHowto_php.ts +56 -13
- package/project/.sdk/src/cmp/php/ReadmeInstall_php.ts +15 -3
- package/project/.sdk/src/cmp/php/ReadmeIntro_php.ts +40 -1
- package/project/.sdk/src/cmp/php/ReadmeModel_php.ts +26 -8
- package/project/.sdk/src/cmp/php/ReadmeOptions_php.ts +4 -3
- package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +80 -22
- package/project/.sdk/src/cmp/php/ReadmeRef_php.ts +51 -42
- package/project/.sdk/src/cmp/php/ReadmeTopHowto_php.ts +1 -1
- package/project/.sdk/src/cmp/php/ReadmeTopQuick_php.ts +19 -11
- package/project/.sdk/src/cmp/php/ReadmeTopTest_php.ts +41 -11
- package/project/.sdk/src/cmp/php/TestDirect_php.ts +9 -9
- package/project/.sdk/src/cmp/php/TestEntity_php.ts +6 -12
- package/project/.sdk/src/cmp/php/Test_php.ts +4 -0
- package/project/.sdk/src/cmp/php/fragment/Entity.fragment.php +13 -1
- package/project/.sdk/src/cmp/php/fragment/EntityCreateOp.fragment.php +10 -1
- package/project/.sdk/src/cmp/php/fragment/EntityListOp.fragment.php +10 -1
- package/project/.sdk/src/cmp/php/fragment/EntityLoadOp.fragment.php +10 -1
- package/project/.sdk/src/cmp/php/fragment/EntityRemoveOp.fragment.php +10 -1
- package/project/.sdk/src/cmp/php/fragment/EntityUpdateOp.fragment.php +10 -1
- package/project/.sdk/src/cmp/php/fragment/Main.fragment.php +22 -14
- package/project/.sdk/src/cmp/py/EntityTypes_py.ts +184 -0
- package/project/.sdk/src/cmp/py/Entity_py.ts +27 -0
- package/project/.sdk/src/cmp/py/MainEntity_py.ts +2 -1
- package/project/.sdk/src/cmp/py/Main_py.ts +35 -0
- package/project/.sdk/src/cmp/py/Package_py.ts +24 -3
- package/project/.sdk/src/cmp/py/ReadmeEntity_py.ts +27 -11
- package/project/.sdk/src/cmp/py/ReadmeExamplesTest_py.ts +626 -0
- package/project/.sdk/src/cmp/py/ReadmeHowto_py.ts +53 -14
- package/project/.sdk/src/cmp/py/ReadmeInstall_py.ts +19 -3
- package/project/.sdk/src/cmp/py/ReadmeIntro_py.ts +48 -1
- package/project/.sdk/src/cmp/py/ReadmeModel_py.ts +28 -10
- package/project/.sdk/src/cmp/py/ReadmeOptions_py.ts +4 -3
- package/project/.sdk/src/cmp/py/ReadmeQuick_py.ts +73 -24
- package/project/.sdk/src/cmp/py/ReadmeRef_py.ts +57 -37
- package/project/.sdk/src/cmp/py/ReadmeTopHowto_py.ts +1 -1
- package/project/.sdk/src/cmp/py/ReadmeTopQuick_py.ts +19 -11
- package/project/.sdk/src/cmp/py/ReadmeTopTest_py.ts +30 -5
- package/project/.sdk/src/cmp/py/TestDirect_py.ts +7 -9
- package/project/.sdk/src/cmp/py/TestEntity_py.ts +6 -14
- package/project/.sdk/src/cmp/py/Test_py.ts +4 -0
- package/project/.sdk/src/cmp/py/fragment/Entity.fragment.py +5 -2
- package/project/.sdk/src/cmp/py/fragment/EntityCreateOp.fragment.py +1 -1
- package/project/.sdk/src/cmp/py/fragment/EntityListOp.fragment.py +5 -1
- package/project/.sdk/src/cmp/py/fragment/EntityLoadOp.fragment.py +6 -1
- package/project/.sdk/src/cmp/py/fragment/EntityRemoveOp.fragment.py +6 -1
- package/project/.sdk/src/cmp/py/fragment/EntityUpdateOp.fragment.py +1 -1
- package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +17 -10
- package/project/.sdk/src/cmp/rb/EntityTypes_rb.ts +136 -0
- package/project/.sdk/src/cmp/rb/MainEntity_rb.ts +1 -0
- package/project/.sdk/src/cmp/rb/Main_rb.ts +4 -0
- package/project/.sdk/src/cmp/rb/Package_rb.ts +34 -7
- package/project/.sdk/src/cmp/rb/ReadmeEntity_rb.ts +26 -10
- package/project/.sdk/src/cmp/rb/ReadmeExamplesTest_rb.ts +289 -0
- package/project/.sdk/src/cmp/rb/ReadmeHowto_rb.ts +72 -21
- package/project/.sdk/src/cmp/rb/ReadmeInstall_rb.ts +16 -4
- package/project/.sdk/src/cmp/rb/ReadmeIntro_rb.ts +40 -1
- package/project/.sdk/src/cmp/rb/ReadmeModel_rb.ts +29 -12
- package/project/.sdk/src/cmp/rb/ReadmeOptions_rb.ts +4 -3
- package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +85 -22
- package/project/.sdk/src/cmp/rb/ReadmeRef_rb.ts +56 -37
- package/project/.sdk/src/cmp/rb/ReadmeTopHowto_rb.ts +1 -1
- package/project/.sdk/src/cmp/rb/ReadmeTopQuick_rb.ts +19 -11
- package/project/.sdk/src/cmp/rb/ReadmeTopTest_rb.ts +43 -11
- package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +9 -9
- package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +6 -12
- package/project/.sdk/src/cmp/rb/Test_rb.ts +4 -0
- package/project/.sdk/src/cmp/rb/fragment/Entity.fragment.rb +2 -0
- package/project/.sdk/src/cmp/rb/fragment/EntityCreateOp.fragment.rb +5 -0
- package/project/.sdk/src/cmp/rb/fragment/EntityListOp.fragment.rb +20 -2
- package/project/.sdk/src/cmp/rb/fragment/EntityLoadOp.fragment.rb +8 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityRemoveOp.fragment.rb +6 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityUpdateOp.fragment.rb +5 -0
- package/project/.sdk/src/cmp/rb/fragment/Main.fragment.rb +24 -8
- package/project/.sdk/src/cmp/ts/EntityTypes_ts.ts +105 -0
- package/project/.sdk/src/cmp/ts/Entity_ts.ts +17 -1
- package/project/.sdk/src/cmp/ts/MainEntity_ts.ts +1 -0
- package/project/.sdk/src/cmp/ts/Main_ts.ts +6 -0
- package/project/.sdk/src/cmp/ts/Package_ts.ts +14 -7
- package/project/.sdk/src/cmp/ts/ReadmeEntity_ts.ts +13 -7
- package/project/.sdk/src/cmp/ts/ReadmeExampleTest_ts.ts +81 -0
- package/project/.sdk/src/cmp/ts/ReadmeExamplesTest_ts.ts +446 -0
- package/project/.sdk/src/cmp/ts/ReadmeExplanation_ts.ts +2 -2
- package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +57 -11
- package/project/.sdk/src/cmp/ts/ReadmeInstall_ts.ts +19 -6
- package/project/.sdk/src/cmp/ts/ReadmeIntro_ts.ts +39 -1
- package/project/.sdk/src/cmp/ts/ReadmeModel_ts.ts +50 -18
- package/project/.sdk/src/cmp/ts/ReadmeOptions_ts.ts +4 -3
- package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +95 -40
- package/project/.sdk/src/cmp/ts/ReadmeRef_ts.ts +24 -13
- package/project/.sdk/src/cmp/ts/ReadmeTopHowto_ts.ts +3 -0
- package/project/.sdk/src/cmp/ts/ReadmeTopQuick_ts.ts +44 -12
- package/project/.sdk/src/cmp/ts/ReadmeTopTest_ts.ts +23 -3
- package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +2 -2
- package/project/.sdk/src/cmp/ts/Test_ts.ts +5 -0
- package/project/.sdk/src/cmp/ts/fragment/Entity.fragment.ts +3 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityBase.fragment.ts +10 -5
- package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +4 -2
- package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +4 -2
- package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +4 -2
- package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +4 -2
- package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +4 -2
- package/project/.sdk/src/cmp/ts/utility_ts.ts +59 -0
- package/project/.sdk/tm/go/LICENSE +1 -1
- package/project/.sdk/tm/go/Makefile +36 -1
- package/project/.sdk/tm/go/VERSION +1 -0
- package/project/.sdk/tm/go/core/context.go +12 -7
- package/project/.sdk/tm/go-cli/src/feature/README.md +6 -0
- package/project/.sdk/tm/go-cli/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/go-cli/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/go-cli/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/go-mcp/src/feature/README.md +6 -0
- package/project/.sdk/tm/go-mcp/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/go-mcp/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/go-mcp/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/js/LICENSE +1 -1
- package/project/.sdk/tm/js/Makefile +41 -0
- package/project/.sdk/tm/lua/LICENSE +1 -1
- package/project/.sdk/tm/lua/Makefile +40 -1
- package/project/.sdk/tm/lua/core/context.lua +13 -8
- package/project/.sdk/tm/php/LICENSE +1 -1
- package/project/.sdk/tm/php/Makefile +31 -1
- package/project/.sdk/tm/php/VERSION +1 -0
- package/project/.sdk/tm/php/core/Context.php +12 -6
- package/project/.sdk/tm/php/test/PrimaryUtilityTest.php +13 -4
- package/project/.sdk/tm/php/utility/Done.php +2 -2
- package/project/.sdk/tm/php/utility/MakeError.php +3 -3
- package/project/.sdk/tm/py/LICENSE +1 -1
- package/project/.sdk/tm/py/Makefile +34 -1
- package/project/.sdk/tm/py/core/context.py +12 -7
- package/project/.sdk/tm/py/test/test_primary_utility.py +15 -4
- package/project/.sdk/tm/py/utility/done.py +3 -1
- package/project/.sdk/tm/py/utility/make_error.py +2 -2
- package/project/.sdk/tm/rb/LICENSE +1 -1
- package/project/.sdk/tm/rb/Makefile +33 -1
- package/project/.sdk/tm/rb/core/context.rb +8 -3
- package/project/.sdk/tm/rb/test/primary_utility_test.rb +2 -2
- package/project/.sdk/tm/rb/utility/done.rb +3 -1
- package/project/.sdk/tm/rb/utility/make_error.rb +5 -2
- package/project/.sdk/tm/ts/LICENSE +1 -1
- package/project/.sdk/tm/ts/Makefile +42 -0
- package/project/.sdk/tm/ts/src/Context.ts +8 -3
- package/src/action/action.ts +17 -10
- package/src/action/feature.ts +8 -6
- package/src/action/target.ts +17 -8
- package/src/cmp/Changelog.ts +34 -0
- package/src/cmp/Deploy.ts +258 -0
- package/src/cmp/FeatureHook.ts +6 -8
- package/src/cmp/License.ts +49 -0
- package/src/cmp/Readme.ts +2 -0
- package/src/cmp/ReadmeErrors.ts +257 -0
- package/src/cmp/ReadmeExplanation.ts +250 -230
- package/src/cmp/ReadmeModel.ts +7 -2
- package/src/cmp/ReadmeTop.ts +411 -95
- package/src/cmp/Security.ts +41 -0
- package/src/helpers/canonType.ts +89 -0
- package/src/helpers/collectDeps.ts +5 -3
- package/src/helpers/naming.ts +59 -0
- package/src/helpers/opExample.ts +170 -0
- package/src/helpers/opShape.ts +236 -0
- package/src/helpers/packageMeta.ts +236 -0
- package/src/sdkgen.ts +87 -20
- package/src/tsconfig.json +1 -0
- package/src/types.ts +85 -2
- package/src/utility.ts +22 -11
- package/README.md +0 -2
- package/dist/action/lang.d.ts +0 -2
- package/dist/action/lang.js +0 -68
- package/dist/action/lang.js.map +0 -1
- package/dist/cmp/Hook.d.ts +0 -2
- package/dist/cmp/Hook.js +0 -10
- package/dist/cmp/Hook.js.map +0 -1
- package/dist/cmp/Top.d.ts +0 -2
- package/dist/cmp/Top.js +0 -23
- package/dist/cmp/Top.js.map +0 -1
- package/dist/prepare-openapi.d.ts +0 -2
- package/dist/prepare-openapi.js +0 -37
- package/dist/prepare-openapi.js.map +0 -1
- package/model/sdkgen.jsonic +0 -74
- package/project/.sdk/tm/go/utility/struct/go.mod +0 -3
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
main: def: {
|
|
4
|
+
desc: *'' | string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# Canonical order for language targets in generated documentation
|
|
9
|
+
# (top-level README, per-language docs links). Targets present in the
|
|
10
|
+
# SDK but not listed here are appended afterwards in spec-defined
|
|
11
|
+
# order. Override per-SDK by setting
|
|
12
|
+
# `main.kit.config.docs_order: ['py','ts',...]` in
|
|
13
|
+
# `<sdk>/.sdk/model/config.jsonic`.
|
|
14
|
+
main: kit: config: docs_order: *['ts','py','php','go','rb','lua'] | [&: string]
|
|
15
|
+
|
|
16
|
+
main: kit: target: &: {
|
|
17
|
+
name: key()
|
|
18
|
+
active: *true | boolean
|
|
19
|
+
ext: string
|
|
20
|
+
comment: line: string
|
|
21
|
+
module: {
|
|
22
|
+
name: string
|
|
23
|
+
}
|
|
24
|
+
deps: &: {
|
|
25
|
+
active: *false | boolean
|
|
26
|
+
version: *'*' | string
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
# Publication: how (and whether) this port is released. Credentials are
|
|
30
|
+
# always injected by the aql key vault (never on disk or argv).
|
|
31
|
+
#
|
|
32
|
+
# Every port gets a git release tag `<prefix>/vX.Y.Z` (prefix defaults
|
|
33
|
+
# to the target name). Ports with a `registry` entry also publish a
|
|
34
|
+
# package to that registry — but only when the registry is active
|
|
35
|
+
# (`registry.state === 'active'`): registries are activated one at a
|
|
36
|
+
# time as each ecosystem is ready. Until then a port is 'pending'
|
|
37
|
+
# (declared + git-tag-published, but not yet uploaded to the registry).
|
|
38
|
+
# Tag-only ports (the go family: the Go proxy resolves from GitHub
|
|
39
|
+
# tags) simply leave `registry` unset — they are implicitly pending
|
|
40
|
+
# until their `<target>/vX.Y.Z` tag exists.
|
|
41
|
+
publish: {
|
|
42
|
+
# Git release tag (all ports).
|
|
43
|
+
tag: {
|
|
44
|
+
active: *true | boolean
|
|
45
|
+
prefix: *'' | string # '' -> target name
|
|
46
|
+
# Who implements the tag publish: 'port' delegates to the port's
|
|
47
|
+
# own Makefile publish recipe (which may do more, e.g. go proxy
|
|
48
|
+
# priming); 'root' uses the generated root tag-push recipe (for
|
|
49
|
+
# ports without a Makefile, e.g. go-cli / go-mcp).
|
|
50
|
+
via: *'port' | string
|
|
51
|
+
vault: {
|
|
52
|
+
recipe: *'github' | string # aql `vault exec --for=<recipe>=<alias>`
|
|
53
|
+
alias: *'github' | string # default vault alias for the token
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
# Package registry (omit for tag-only ports).
|
|
58
|
+
registry: {
|
|
59
|
+
# Publication state (tri-state):
|
|
60
|
+
# 'pending' — declared + git-tag-published, NOT yet on the
|
|
61
|
+
# registry (the default: READMEs point at the git
|
|
62
|
+
# tag, deploy publishes the tag only).
|
|
63
|
+
# 'active' — package is uploaded to the registry; READMEs show
|
|
64
|
+
# the real `npm install`/`pip install`/... command.
|
|
65
|
+
# 'inactive' — registry deliberately disabled (also tag-only).
|
|
66
|
+
# Kept as a plain string (default 'pending') rather than a literal
|
|
67
|
+
# disjunction to sidestep aontu's literal-disjunction fragility;
|
|
68
|
+
# code (packageMeta.registryState / Deploy) enforces the tri-state.
|
|
69
|
+
state: *'pending' | string
|
|
70
|
+
# Back-compat alias: `active: true` still means state === 'active'.
|
|
71
|
+
active: *false | boolean # real publishes refuse when not active
|
|
72
|
+
name: *'' | string # npm | pypi | packagist | rubygems | luarocks
|
|
73
|
+
url: *'' | string
|
|
74
|
+
package: *'' | string # registry package name ('' -> derived)
|
|
75
|
+
vault: {
|
|
76
|
+
recipe: *'' | string # aql --for preset (npm, pypi, gem, ...)
|
|
77
|
+
alias: *'' | string # vault alias ('' -> registry name)
|
|
78
|
+
env: *'' | string # raw env var to inject when no preset exists
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
main: kit: entity: &: {
|
|
86
|
+
name: key()
|
|
87
|
+
active: *true | boolean
|
|
88
|
+
|
|
89
|
+
alias: {}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
main: kit: feature: &: {
|
|
94
|
+
name: key()
|
|
95
|
+
active: *false | boolean
|
|
96
|
+
title: string
|
|
97
|
+
|
|
98
|
+
# TODO: version '0.0.1' | semver # where semver is a string format type as per semver.org
|
|
99
|
+
version: *'0.0.1' | string
|
|
100
|
+
|
|
101
|
+
hook: &: {
|
|
102
|
+
active: *false | boolean
|
|
103
|
+
await: *false | boolean
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
hook: {
|
|
107
|
+
PostConstruct: {}
|
|
108
|
+
PostConstructEntity: {}
|
|
109
|
+
SetData: {}
|
|
110
|
+
GetData: {}
|
|
111
|
+
GetMatch: {}
|
|
112
|
+
|
|
113
|
+
PreTarget: {}
|
|
114
|
+
PreSpec: {}
|
|
115
|
+
PreRequest: {}
|
|
116
|
+
PreResponse: {}
|
|
117
|
+
PreResult: {}
|
|
118
|
+
PostOperation: {}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
# Target specific structures
|
|
122
|
+
target: &: deps: &: {
|
|
123
|
+
active: *false | boolean
|
|
124
|
+
version: *'*' | string
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
main: kit: option: &: {
|
|
130
|
+
name: key()
|
|
131
|
+
active: *true | boolean
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voxgig/sdkgen",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"main": "dist/sdkgen.js",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"types": "dist/sdkgen.d.ts",
|
|
@@ -23,12 +23,18 @@
|
|
|
23
23
|
"test-some": "node --enable-source-maps --test-name-pattern=\"$npm_config_pattern\" --test dist-test/**/*.test.js",
|
|
24
24
|
"watch": "tsc --build src test -w",
|
|
25
25
|
"build": "tsc --build src test",
|
|
26
|
-
"clean": "rm -rf node_modules yarn.lock package-lock.json",
|
|
26
|
+
"clean": "rm -rf dist dist-test node_modules yarn.lock package-lock.json",
|
|
27
27
|
"reset": "npm run clean && npm i && npm run build && npm test",
|
|
28
28
|
"embed-version": "node build/version.js",
|
|
29
|
+
"repo-bump": "npm version patch --no-git-tag-version && node -e \"console.log('bumped to v' + require('./package.json').version + ' (package.json only - commit via repo-tag / repo-release)')\"",
|
|
29
30
|
"repo-tag": "REPO_VERSION=`node -e \"console.log(require('./package').version)\"` && echo TAG: v$REPO_VERSION && git commit -a -m v$REPO_VERSION && git push && git tag v$REPO_VERSION && git push --tags;",
|
|
31
|
+
"repo-tag-dry": "REPO_VERSION=`node -e \"console.log(require('./package').version)\"` && echo \"[dry-run] TAG: v$REPO_VERSION\" && if git rev-parse -q --verify refs/tags/v$REPO_VERSION >/dev/null; then echo \"[dry-run] WARNING: tag v$REPO_VERSION already exists - bump the version first\"; else echo \"[dry-run] would commit -a, push, tag v$REPO_VERSION and push --tags; nothing done\"; fi && git status --short",
|
|
30
32
|
"repo-publish": "npm run clean && npm i && npm run repo-publish-quick",
|
|
31
|
-
"repo-publish-
|
|
33
|
+
"repo-publish-dry": "npm run clean && npm i && npm run repo-publish-quick-dry",
|
|
34
|
+
"repo-publish-quick": "npm run embed-version && npm run build && npm run test && npm run repo-tag && npm publish --registry https://registry.npmjs.org --access=public",
|
|
35
|
+
"repo-publish-quick-dry": "npm run build && npm run test && ( npm publish --dry-run --registry https://registry.npmjs.org --access=public || echo \"[dry-run] npm publish refused (see npm error above) - usually the version is already published; bump package.json before a real release\" )",
|
|
36
|
+
"repo-release": "npm run repo-publish && npm run repo-tag",
|
|
37
|
+
"repo-release-dry": "npm run repo-publish-quick-dry && npm run repo-tag-dry"
|
|
32
38
|
},
|
|
33
39
|
"license": "MIT",
|
|
34
40
|
"files": [
|
|
@@ -41,9 +47,9 @@
|
|
|
41
47
|
],
|
|
42
48
|
"devDependencies": {
|
|
43
49
|
"@types/js-yaml": "4.0.9",
|
|
44
|
-
"@types/node": "
|
|
50
|
+
"@types/node": "26.1.0",
|
|
45
51
|
"json-schema-to-ts": "3.1.1",
|
|
46
|
-
"memfs": "4.
|
|
52
|
+
"memfs": "4.62.0",
|
|
47
53
|
"typescript": "6.0.3"
|
|
48
54
|
},
|
|
49
55
|
"peerDependencies": {
|
|
@@ -51,6 +57,7 @@
|
|
|
51
57
|
"@voxgig/struct": ">=0",
|
|
52
58
|
"@voxgig/util": ">=0",
|
|
53
59
|
"aontu": ">=0",
|
|
54
|
-
"jostraca": ">=0"
|
|
60
|
+
"jostraca": ">=0",
|
|
61
|
+
"shape": ">=10.1"
|
|
55
62
|
}
|
|
56
63
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
// Go CLI target — a Go program that *consumes* the sibling Go SDK
|
|
3
|
+
// (generated by the `go` target into the same SDK repo). It is not a
|
|
4
|
+
// language SDK in its own right, so the standard per-entity /
|
|
5
|
+
// per-feature / readme / test generation phases are switched off via
|
|
6
|
+
// the `phase` map below.
|
|
7
|
+
|
|
8
|
+
main: kit: target: 'go-cli': {
|
|
9
|
+
|
|
10
|
+
title: 'Go CLI'
|
|
11
|
+
ext: go
|
|
12
|
+
comment: line: "//"
|
|
13
|
+
module: name: '$$name$$'
|
|
14
|
+
|
|
15
|
+
// Per-generation-phase activation. Mirrors the feature pattern
|
|
16
|
+
// (`main.kit.feature.<name>: { active: true }`). Root.ts inspects
|
|
17
|
+
// `target.phase.<name>.active` — defaults to true (active) when
|
|
18
|
+
// the entry is missing, so existing standard targets need no
|
|
19
|
+
// changes. A CLI-style target switches the standard phases off
|
|
20
|
+
// and runs only Main.
|
|
21
|
+
phase: {
|
|
22
|
+
entity: { active: false }
|
|
23
|
+
feature: { active: false }
|
|
24
|
+
readme: { active: false }
|
|
25
|
+
test: { active: false }
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// No external module deps declared here; the generated go.mod uses
|
|
29
|
+
// a relative replace to the sibling SDK at ../go and (until
|
|
30
|
+
// aql/eng is published with a subdir tag) a local replace for the
|
|
31
|
+
// AQL engine. See Main_go-cli.ts.
|
|
32
|
+
deps: {}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
// Feature-deps map slot — every target carries this so the same
|
|
37
|
+
// feature can specify per-target dep variants.
|
|
38
|
+
main: kit: feature: &: target: 'go-cli': deps: &: {
|
|
39
|
+
kind: *'prod' | string
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
# Publication: tag-only — the Go module proxy resolves versions from the
|
|
44
|
+
# go-cli/vX.Y.Z GitHub tag; there is no package registry to upload to.
|
|
45
|
+
main: kit: target: 'go-cli': publish: {
|
|
46
|
+
tag: { active: true, via: 'root' }
|
|
47
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
// Go MCP server target — a Go program that *consumes* the sibling Go
|
|
3
|
+
// SDK and exposes it as MCP tools. Like go-cli, it is not a language
|
|
4
|
+
// SDK in its own right, so the standard per-entity / per-feature /
|
|
5
|
+
// readme / test generation phases are switched off via the `phase`
|
|
6
|
+
// map below.
|
|
7
|
+
|
|
8
|
+
main: kit: target: 'go-mcp': {
|
|
9
|
+
|
|
10
|
+
title: 'Go MCP server'
|
|
11
|
+
ext: go
|
|
12
|
+
comment: line: "//"
|
|
13
|
+
module: name: '$$name$$'
|
|
14
|
+
|
|
15
|
+
// Per-generation-phase activation. Mirrors go-cli — only Main runs.
|
|
16
|
+
phase: {
|
|
17
|
+
entity: { active: false }
|
|
18
|
+
feature: { active: false }
|
|
19
|
+
readme: { active: false }
|
|
20
|
+
test: { active: false }
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// No external module deps declared here. The generated go.mod uses
|
|
24
|
+
// a relative replace to the sibling SDK at ../go and declares the
|
|
25
|
+
// MCP Go SDK as a direct dep. See Main_go-mcp.ts.
|
|
26
|
+
deps: {}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
// Feature-deps map slot — every target carries this so the same
|
|
31
|
+
// feature can specify per-target dep variants.
|
|
32
|
+
main: kit: feature: &: target: 'go-mcp': deps: &: {
|
|
33
|
+
kind: *'prod' | string
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# Publication: tag-only — the Go module proxy resolves versions from the
|
|
38
|
+
# go-mcp/vX.Y.Z GitHub tag; there is no package registry to upload to.
|
|
39
|
+
main: kit: target: 'go-mcp': publish: {
|
|
40
|
+
tag: { active: true, via: 'root' }
|
|
41
|
+
}
|
|
@@ -11,12 +11,18 @@ main: kit: target: go: {
|
|
|
11
11
|
kind: *'prod' | string
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
14
|
+
// struct is inlined under <gomodule>/utility/struct — no external dep.
|
|
15
|
+
deps: {}
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
|
|
20
19
|
main: kit: feature: &: target: go: deps: &: {
|
|
21
20
|
kind: *'prod' | string
|
|
22
21
|
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# Publication: tag-only — the Go module proxy resolves versions from the
|
|
25
|
+
# go/vX.Y.Z GitHub tag; there is no package registry to upload to.
|
|
26
|
+
main: kit: target: go: publish: {
|
|
27
|
+
tag: { active: true }
|
|
28
|
+
}
|
|
@@ -21,3 +21,16 @@ main: kit: feature: &: target: js: deps: &: {
|
|
|
21
21
|
# TODO: fix aontu disjunctions!
|
|
22
22
|
kind: *'prod' | string # 'peer' |'dev'
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
# Publication: npm registry (declared, publish pending — git-tag only).
|
|
27
|
+
main: kit: target: js: publish: {
|
|
28
|
+
tag: { active: true }
|
|
29
|
+
registry: {
|
|
30
|
+
state: 'pending'
|
|
31
|
+
active: false
|
|
32
|
+
name: 'npm'
|
|
33
|
+
url: 'https://registry.npmjs.org'
|
|
34
|
+
vault: { recipe: 'npm', alias: 'npm' }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -21,3 +21,16 @@ main: kit: target: lua: {
|
|
|
21
21
|
main: kit: feature: &: target: lua: deps: &: {
|
|
22
22
|
kind: *'prod' | string
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
# Publication: luarocks registry (declared, publish pending — git-tag only).
|
|
27
|
+
main: kit: target: lua: publish: {
|
|
28
|
+
tag: { active: true }
|
|
29
|
+
registry: {
|
|
30
|
+
state: 'pending'
|
|
31
|
+
active: false
|
|
32
|
+
name: 'luarocks'
|
|
33
|
+
url: 'https://luarocks.org'
|
|
34
|
+
vault: { alias: 'luarocks', env: 'LUAROCKS_API_KEY' }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -19,3 +19,16 @@ main: kit: target: php: {
|
|
|
19
19
|
main: kit: feature: &: target: php: deps: &: {
|
|
20
20
|
kind: *'prod' | string
|
|
21
21
|
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# Publication: packagist registry (declared, publish pending — git-tag only).
|
|
25
|
+
main: kit: target: php: publish: {
|
|
26
|
+
tag: { active: true }
|
|
27
|
+
registry: {
|
|
28
|
+
state: 'pending'
|
|
29
|
+
active: false
|
|
30
|
+
name: 'packagist'
|
|
31
|
+
url: 'https://packagist.org'
|
|
32
|
+
vault: { alias: 'packagist', env: 'PACKAGIST_API_TOKEN' }
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -21,3 +21,16 @@ main: kit: target: py: {
|
|
|
21
21
|
main: kit: feature: &: target: py: deps: &: {
|
|
22
22
|
kind: *'prod' | string
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
# Publication: pypi registry (declared, publish pending — git-tag only).
|
|
27
|
+
main: kit: target: py: publish: {
|
|
28
|
+
tag: { active: true }
|
|
29
|
+
registry: {
|
|
30
|
+
state: 'pending'
|
|
31
|
+
active: false
|
|
32
|
+
name: 'pypi'
|
|
33
|
+
url: 'https://pypi.org'
|
|
34
|
+
vault: { recipe: 'pypi', alias: 'pypi' }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -21,3 +21,16 @@ main: kit: target: rb: {
|
|
|
21
21
|
main: kit: feature: &: target: rb: deps: &: {
|
|
22
22
|
kind: *'prod' | string
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
# Publication: rubygems registry (declared, publish pending — git-tag only).
|
|
27
|
+
main: kit: target: rb: publish: {
|
|
28
|
+
tag: { active: true }
|
|
29
|
+
registry: {
|
|
30
|
+
state: 'pending'
|
|
31
|
+
active: false
|
|
32
|
+
name: 'rubygems'
|
|
33
|
+
url: 'https://rubygems.org'
|
|
34
|
+
vault: { recipe: 'gem', alias: 'gem' }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -24,3 +24,16 @@ main: kit: feature: &: target: ts: deps: &: {
|
|
|
24
24
|
# TODO: fix aontu disjunctions!
|
|
25
25
|
kind: *'prod' | string # 'peer' |'dev'
|
|
26
26
|
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
# Publication: npm registry (declared, publish pending — git-tag only).
|
|
30
|
+
main: kit: target: ts: publish: {
|
|
31
|
+
tag: { active: true }
|
|
32
|
+
registry: {
|
|
33
|
+
state: 'pending'
|
|
34
|
+
active: false
|
|
35
|
+
name: 'npm'
|
|
36
|
+
url: 'https://registry.npmjs.org'
|
|
37
|
+
vault: { recipe: 'npm', alias: 'npm' }
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -30,6 +30,7 @@ const EntityOperation = cmp(function Operation(props: any) {
|
|
|
30
30
|
replace: {
|
|
31
31
|
...entrep,
|
|
32
32
|
'GOMODULE': gomodule,
|
|
33
|
+
'"github.com/voxgig/struct"': `"${gomodule}/utility/struct"`,
|
|
33
34
|
ProjectName: model.const.Name,
|
|
34
35
|
EntityName: entity.Name,
|
|
35
36
|
entityname: entity.name,
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
// Typed-model generator (Go target).
|
|
4
|
+
//
|
|
5
|
+
// Reads main.<KIT>.entity.<e>.fields[] and per-op params
|
|
6
|
+
// (op.<name>.points[].args.params[]) and emits one file, entity/types.go, in
|
|
7
|
+
// the `entity` package, with a Go `type <Name> struct { ... }` per entity plus
|
|
8
|
+
// a request/match struct per active op. Field/param sentinels ($STRING,
|
|
9
|
+
// $INTEGER, ...) are turned into real Go types by the shared sdkgen helper
|
|
10
|
+
// `canonToType` (source of truth: @voxgig/apidef VALID_CANON).
|
|
11
|
+
//
|
|
12
|
+
// PORT NOTES (Go specifics vs the TS reference):
|
|
13
|
+
// * Types live in the SAME package as the entity methods (`entity`), so the
|
|
14
|
+
// generated typed accessors reference them without an import (task step B).
|
|
15
|
+
// * Go has no method overloading and go-cli / go-mcp dispatch entities
|
|
16
|
+
// dynamically through the untyped `core.ProjectNameEntity` interface
|
|
17
|
+
// (Load/List/... (map[string]any) (any, error)). That interface — and the
|
|
18
|
+
// untyped concrete methods that satisfy it — are therefore KEPT unchanged.
|
|
19
|
+
// Typed access is delivered ADDITIVELY: the op fragments emit `LoadTyped`
|
|
20
|
+
// / `ListTyped` / ... alongside the untyped methods, and Entity.fragment.go
|
|
21
|
+
// emits `DataTyped` / `MatchTyped`. All are thin typed wrappers over the
|
|
22
|
+
// untyped runtime (identical behaviour), converting at the typed boundary
|
|
23
|
+
// via the JSON-round-trip helpers emitted at the bottom of this file.
|
|
24
|
+
// * `list` typed op returns []<Name>; other typed ops return <Name>.
|
|
25
|
+
// * op WITH params -> a struct of those params (reqd:false -> pointer +
|
|
26
|
+
// ,omitempty). op WITHOUT params -> a struct mirroring the entity fields
|
|
27
|
+
// with every field optional (Go's analog of TS `Partial<Name>`).
|
|
28
|
+
|
|
29
|
+
import {
|
|
30
|
+
cmp, each,
|
|
31
|
+
File, Content, Folder,
|
|
32
|
+
} from '@voxgig/sdkgen'
|
|
33
|
+
|
|
34
|
+
import { canonToType, opTypeName, opRequestShape } from '@voxgig/sdkgen'
|
|
35
|
+
|
|
36
|
+
import {
|
|
37
|
+
KIT,
|
|
38
|
+
getModelPath,
|
|
39
|
+
} from '@voxgig/apidef'
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
const LANG = 'go'
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
function cap(s: string): string {
|
|
46
|
+
return s.charAt(0).toUpperCase() + s.slice(1)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
// A model field/param name -> an exported Go field identifier:
|
|
51
|
+
// advice -> Advice, some_field -> SomeField, id -> Id.
|
|
52
|
+
function goField(name: string): string {
|
|
53
|
+
const out = String(name)
|
|
54
|
+
.replace(/[^A-Za-z0-9]+/g, ' ')
|
|
55
|
+
.trim()
|
|
56
|
+
.split(/\s+/)
|
|
57
|
+
.filter(Boolean)
|
|
58
|
+
.map((s) => s.charAt(0).toUpperCase() + s.slice(1))
|
|
59
|
+
.join('')
|
|
60
|
+
// Go identifiers can't start with a digit.
|
|
61
|
+
return /^[A-Za-z_]/.test(out) ? out : 'F' + out
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
// One Go struct field line. `optional` -> pointer + ,omitempty (Go's closest
|
|
66
|
+
// analog to an optional/absent field).
|
|
67
|
+
function fieldLine(name: string, sentinel: any, optional: boolean): string {
|
|
68
|
+
const gt = canonToType(sentinel, LANG)
|
|
69
|
+
const typ = optional ? ('*' + gt) : gt
|
|
70
|
+
const tag = optional ? `\`json:"${name},omitempty"\`` : `\`json:"${name}"\``
|
|
71
|
+
return `\t${goField(name)} ${typ} ${tag}\n`
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
const EntityTypes = cmp(function EntityTypes(props: any) {
|
|
76
|
+
const { target } = props
|
|
77
|
+
const { model } = props.ctx$
|
|
78
|
+
|
|
79
|
+
const entity = getModelPath(model, `main.${KIT}.entity`)
|
|
80
|
+
// Emit for every entity that gets an entity file. Main_go.ts iterates
|
|
81
|
+
// entities WITHOUT an `active` filter, so a struct is required for each so
|
|
82
|
+
// the typed accessors in every *_entity.go resolve at compile time.
|
|
83
|
+
const entityList = each(entity).filter((e: any) => e && null != e.Name)
|
|
84
|
+
|
|
85
|
+
Folder({ name: 'entity' }, () => {
|
|
86
|
+
|
|
87
|
+
File({ name: 'types.' + target.ext }, () => {
|
|
88
|
+
|
|
89
|
+
Content(`// Typed models for the ${model.const.Name} SDK.
|
|
90
|
+
//
|
|
91
|
+
// GENERATED from the API model: main.${KIT}.entity.<e>.fields[] and per-op
|
|
92
|
+
// params (op.<name>.points[].args.params[]). Field/param types come from the
|
|
93
|
+
// canonical type sentinels via @voxgig/sdkgen canonToType (source of truth:
|
|
94
|
+
// @voxgig/apidef VALID_CANON). Do not edit by hand.
|
|
95
|
+
package entity
|
|
96
|
+
|
|
97
|
+
import "encoding/json"
|
|
98
|
+
|
|
99
|
+
`)
|
|
100
|
+
|
|
101
|
+
entityList.forEach((ent: any) => {
|
|
102
|
+
const Name = ent.Name
|
|
103
|
+
const fields = (ent.fields ? each(ent.fields) : [])
|
|
104
|
+
.filter((f: any) => f.active !== false)
|
|
105
|
+
|
|
106
|
+
// Entity data model: one field per model field. req:false -> pointer.
|
|
107
|
+
Content(`// ${Name} is the typed data model for the ${ent.name} entity.
|
|
108
|
+
type ${Name} struct {
|
|
109
|
+
`)
|
|
110
|
+
fields.forEach((f: any) => {
|
|
111
|
+
Content(fieldLine(f.name, f.type, false === f.req))
|
|
112
|
+
})
|
|
113
|
+
Content(`}
|
|
114
|
+
|
|
115
|
+
`)
|
|
116
|
+
|
|
117
|
+
// Per active op: a request/match struct (same package as the entity
|
|
118
|
+
// methods, so no import is needed there). Members and their optionality
|
|
119
|
+
// come from the shared partiality policy (opRequestShape); this file
|
|
120
|
+
// only renders them as a Go struct (optional -> pointer + ,omitempty).
|
|
121
|
+
const ops = ent.op || {}
|
|
122
|
+
;['load', 'list', 'create', 'update', 'remove'].forEach((opname: string) => {
|
|
123
|
+
if (null == ops[opname]) {
|
|
124
|
+
return
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const typeName = opTypeName(Name, opname)
|
|
128
|
+
const { items } = opRequestShape(ent, opname)
|
|
129
|
+
|
|
130
|
+
Content(`// ${typeName} is the typed request payload for ${Name}.${cap(opname)}Typed.
|
|
131
|
+
type ${typeName} struct {
|
|
132
|
+
`)
|
|
133
|
+
items.forEach((it: any) => {
|
|
134
|
+
Content(fieldLine(it.name, it.type, it.optional))
|
|
135
|
+
})
|
|
136
|
+
Content(`}
|
|
137
|
+
|
|
138
|
+
`)
|
|
139
|
+
})
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
// Conversion helpers shared by the generated typed accessors/methods.
|
|
143
|
+
// Kept unexported and package-local so the typed boundary stays a pure
|
|
144
|
+
// wrapper over the untyped runtime.
|
|
145
|
+
Content(`// asMap turns a typed request/data struct into the map[string]any the
|
|
146
|
+
// runtime op pipeline consumes, honouring the json tags above.
|
|
147
|
+
func asMap(v any) map[string]any {
|
|
148
|
+
out := map[string]any{}
|
|
149
|
+
b, err := json.Marshal(v)
|
|
150
|
+
if err != nil {
|
|
151
|
+
return out
|
|
152
|
+
}
|
|
153
|
+
_ = json.Unmarshal(b, &out)
|
|
154
|
+
return out
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// typedFrom decodes a runtime value (a map[string]any produced by the op
|
|
158
|
+
// pipeline) into a typed model T via a JSON round-trip. On any error it
|
|
159
|
+
// returns the zero value of T; the op's own (value, error) tuple carries the
|
|
160
|
+
// real error.
|
|
161
|
+
func typedFrom[T any](v any) T {
|
|
162
|
+
var out T
|
|
163
|
+
if v == nil {
|
|
164
|
+
return out
|
|
165
|
+
}
|
|
166
|
+
b, err := json.Marshal(v)
|
|
167
|
+
if err != nil {
|
|
168
|
+
return out
|
|
169
|
+
}
|
|
170
|
+
_ = json.Unmarshal(b, &out)
|
|
171
|
+
return out
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// typedSliceFrom decodes a runtime list value ([]any of maps) into a typed
|
|
175
|
+
// slice []T via a JSON round-trip, for list ops.
|
|
176
|
+
func typedSliceFrom[T any](v any) []T {
|
|
177
|
+
var out []T
|
|
178
|
+
if v == nil {
|
|
179
|
+
return out
|
|
180
|
+
}
|
|
181
|
+
b, err := json.Marshal(v)
|
|
182
|
+
if err != nil {
|
|
183
|
+
return out
|
|
184
|
+
}
|
|
185
|
+
_ = json.Unmarshal(b, &out)
|
|
186
|
+
return out
|
|
187
|
+
}
|
|
188
|
+
`)
|
|
189
|
+
|
|
190
|
+
})
|
|
191
|
+
})
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
export {
|
|
196
|
+
EntityTypes,
|
|
197
|
+
}
|
|
@@ -15,7 +15,7 @@ const Entity = cmp(function Entity(props: any) {
|
|
|
15
15
|
|
|
16
16
|
// Module name: concatenated lowercase
|
|
17
17
|
// Go module path == repo path on GitHub (org from model.origin).
|
|
18
|
-
const gomodule = `github.com/${model.origin || 'voxgig-sdk'}/${model.name}-sdk`
|
|
18
|
+
const gomodule = `github.com/${model.origin || 'voxgig-sdk'}/${model.name}-sdk/go`
|
|
19
19
|
|
|
20
20
|
const entrep = {
|
|
21
21
|
...stdrep,
|
|
@@ -57,6 +57,7 @@ const Entity = cmp(function Entity(props: any) {
|
|
|
57
57
|
replace: {
|
|
58
58
|
...entrep,
|
|
59
59
|
'GOMODULE': gomodule,
|
|
60
|
+
'"github.com/voxgig/struct"': `"${gomodule}/utility/struct"`,
|
|
60
61
|
ProjectName: model.const.Name,
|
|
61
62
|
EntityName: entity.Name,
|
|
62
63
|
entityname: entity.name,
|
|
@@ -7,7 +7,13 @@ const MainEntity = cmp(async function MainEntity(props: any) {
|
|
|
7
7
|
const { entity, gomodule } = props
|
|
8
8
|
const { model } = props.ctx$
|
|
9
9
|
|
|
10
|
+
// Go keeps the PascalCase accessor: exported identifiers must be PascalCase,
|
|
11
|
+
// so a lowercase facade is not idiomatic (nor exportable) in Go.
|
|
12
|
+
// Idiomatic usage: client.${entity.Name}(nil).List(nil, nil) / .Load(...).
|
|
10
13
|
Content(`
|
|
14
|
+
// ${entity.Name} returns a ${entity.Name} entity bound to this client.
|
|
15
|
+
// Idiomatic usage: client.${entity.Name}(nil).List(nil, nil) or
|
|
16
|
+
// client.${entity.Name}(nil).Load(map[string]any{"id": ...}, nil).
|
|
11
17
|
func (sdk *${model.const.Name}SDK) ${entity.Name}(data map[string]any) ${model.const.Name}Entity {
|
|
12
18
|
return New${entity.Name}EntityFunc(sdk, data)
|
|
13
19
|
}
|