@voxgig/sdkgen 1.2.1 → 1.3.2
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 +3 -1
- package/dist/action/action.js +26 -10
- package/dist/action/action.js.map +1 -1
- package/dist/action/feature.js +9 -8
- package/dist/action/feature.js.map +1 -1
- package/dist/action/target.d.ts +7 -1
- package/dist/action/target.js +22 -13
- 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 +225 -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 +12 -2
- package/dist/sdkgen.js +60 -20
- 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.d.ts +2 -1
- package/dist/utility.js +39 -11
- package/dist/utility.js.map +1 -1
- package/model/sdkgen.aontu +137 -0
- package/package.json +11 -5
- package/project/.sdk/model/feature/feature-index.aontu +5 -0
- package/project/.sdk/model/target/go-cli.aontu +47 -0
- package/project/.sdk/model/target/go-mcp.aontu +41 -0
- package/project/.sdk/model/target/go.aontu +28 -0
- package/project/.sdk/model/target/{js.jsonic → js.aontu} +13 -0
- package/project/.sdk/model/target/{lua.jsonic → lua.aontu} +13 -0
- package/project/.sdk/model/target/{php.jsonic → php.aontu} +13 -0
- package/project/.sdk/model/target/{py.jsonic → py.aontu} +13 -0
- package/project/.sdk/model/target/{rb.jsonic → rb.aontu} +13 -0
- package/project/.sdk/model/target/{ts.jsonic → ts.aontu} +13 -0
- package/project/.sdk/src/cmp/go/Config_go.ts +3 -2
- 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 +48 -10
- package/project/.sdk/src/cmp/go/ReadmeExamplesTest_go.ts +688 -0
- package/project/.sdk/src/cmp/go/ReadmeExplanation_go.ts +1 -1
- package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +52 -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 +67 -17
- package/project/.sdk/src/cmp/go/ReadmeOptions_go.ts +4 -3
- package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +146 -116
- package/project/.sdk/src/cmp/go/ReadmeRef_go.ts +87 -21
- package/project/.sdk/src/cmp/go/ReadmeTopHowto_go.ts +4 -0
- package/project/.sdk/src/cmp/go/ReadmeTopQuick_go.ts +75 -16
- 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/utility_go.ts +70 -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/Config_js.ts +3 -6
- 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 +33 -10
- 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 +70 -20
- package/project/.sdk/src/cmp/js/ReadmeRef_js.ts +50 -16
- package/project/.sdk/src/cmp/js/ReadmeTopHowto_js.ts +3 -0
- package/project/.sdk/src/cmp/js/ReadmeTopQuick_js.ts +45 -19
- package/project/.sdk/src/cmp/js/ReadmeTopTest_js.ts +35 -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/Config_lua.ts +3 -2
- 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 +50 -13
- 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 +156 -21
- package/project/.sdk/src/cmp/lua/ReadmeRef_lua.ts +71 -23
- package/project/.sdk/src/cmp/lua/ReadmeTopQuick_lua.ts +46 -9
- package/project/.sdk/src/cmp/lua/ReadmeTopTest_lua.ts +43 -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/Config_php.ts +3 -2
- 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 +46 -14
- 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 +159 -25
- package/project/.sdk/src/cmp/php/ReadmeRef_php.ts +90 -45
- package/project/.sdk/src/cmp/php/ReadmeTopHowto_php.ts +1 -1
- package/project/.sdk/src/cmp/php/ReadmeTopQuick_php.ts +43 -11
- package/project/.sdk/src/cmp/php/ReadmeTopTest_php.ts +52 -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/Config_py.ts +3 -2
- 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 +48 -14
- 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 +150 -27
- package/project/.sdk/src/cmp/py/ReadmeRef_py.ts +86 -40
- package/project/.sdk/src/cmp/py/ReadmeTopHowto_py.ts +1 -1
- package/project/.sdk/src/cmp/py/ReadmeTopQuick_py.ts +45 -11
- package/project/.sdk/src/cmp/py/ReadmeTopTest_py.ts +43 -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/Config_rb.ts +3 -2
- 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 +47 -13
- 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 +163 -25
- package/project/.sdk/src/cmp/rb/ReadmeRef_rb.ts +85 -40
- package/project/.sdk/src/cmp/rb/ReadmeTopHowto_rb.ts +1 -1
- package/project/.sdk/src/cmp/rb/ReadmeTopQuick_rb.ts +45 -11
- package/project/.sdk/src/cmp/rb/ReadmeTopTest_rb.ts +54 -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/Config_ts.ts +3 -6
- 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 +32 -10
- 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 +141 -48
- package/project/.sdk/src/cmp/ts/ReadmeRef_ts.ts +50 -16
- package/project/.sdk/src/cmp/ts/ReadmeTopHowto_ts.ts +3 -0
- package/project/.sdk/src/cmp/ts/ReadmeTopQuick_ts.ts +58 -19
- package/project/.sdk/src/cmp/ts/ReadmeTopTest_ts.ts +35 -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/test/test_struct_utility.py +1 -1
- 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 +36 -2
- 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 +30 -11
- package/src/action/feature.ts +12 -14
- package/src/action/target.ts +28 -17
- 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 +274 -0
- package/src/helpers/packageMeta.ts +236 -0
- package/src/sdkgen.ts +91 -23
- package/src/tsconfig.json +1 -0
- package/src/types.ts +85 -2
- package/src/utility.ts +45 -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/model/feature/feature-index.jsonic +0 -5
- package/project/.sdk/model/target/go.jsonic +0 -22
- package/project/.sdk/tm/go/utility/struct/go.mod +0 -3
- /package/project/.sdk/model/feature/{log.jsonic → log.aontu} +0 -0
- /package/project/.sdk/model/feature/{test.jsonic → test.aontu} +0 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
// Single source of truth for a generated SDK's PUBLISHED identity and its
|
|
2
|
+
// descriptive metadata, shared by the per-language Package_<lang>.ts manifest
|
|
3
|
+
// generators AND the README install/heading components — so the install
|
|
4
|
+
// command a README prints can never drift from the real published package name
|
|
5
|
+
// (the #1 defect the publishing recommendations call out).
|
|
6
|
+
//
|
|
7
|
+
// The recommendations require, for every package:
|
|
8
|
+
// - install commands that match the real package name EXACTLY;
|
|
9
|
+
// - description "Unofficial generated <Lang> SDK for the <API> public API.";
|
|
10
|
+
// - a generic non-affiliation statement (upstream owner names are unreliable);
|
|
11
|
+
// - homepage / repository / issues under github.com/<origin>/<slug>-sdk;
|
|
12
|
+
// - the fixed keyword set [voxgig sdk generated-sdk openapi api-client <slug>].
|
|
13
|
+
//
|
|
14
|
+
// Every value here is derived from the resolved model (model.name, model.origin,
|
|
15
|
+
// main.kit.info.title) — no new inputs required.
|
|
16
|
+
|
|
17
|
+
import { KIT, nom } from '@voxgig/apidef'
|
|
18
|
+
|
|
19
|
+
const PUBLISHER = 'Voxgig'
|
|
20
|
+
const PUBLISHER_URL = 'https://voxgig.com'
|
|
21
|
+
const SECURITY_EMAIL = 'security@voxgig.com'
|
|
22
|
+
const GENERATOR_URL = 'https://github.com/voxgig/sdkgen'
|
|
23
|
+
|
|
24
|
+
const LANG_LABEL: Record<string, string> = {
|
|
25
|
+
ts: 'TypeScript',
|
|
26
|
+
js: 'JavaScript',
|
|
27
|
+
py: 'Python',
|
|
28
|
+
php: 'PHP',
|
|
29
|
+
rb: 'Ruby',
|
|
30
|
+
lua: 'Lua',
|
|
31
|
+
go: 'Go',
|
|
32
|
+
'go-cli': 'Go CLI',
|
|
33
|
+
'go-mcp': 'Go MCP server',
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function langLabel(target: string): string {
|
|
37
|
+
return LANG_LABEL[target] || target
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// GitHub org (publisher slug), repo name, and the canonical repo URLs.
|
|
41
|
+
function repoInfo(model: any) {
|
|
42
|
+
const slug = model.name
|
|
43
|
+
const origin = model.origin || 'voxgig-sdk'
|
|
44
|
+
const repo = `${slug}-sdk`
|
|
45
|
+
const repoUrl = `https://github.com/${origin}/${repo}`
|
|
46
|
+
return {
|
|
47
|
+
slug,
|
|
48
|
+
origin,
|
|
49
|
+
repo,
|
|
50
|
+
repoUrl,
|
|
51
|
+
issuesUrl: `${repoUrl}/issues`,
|
|
52
|
+
changelogUrl: `${repoUrl}/blob/main/CHANGELOG.md`,
|
|
53
|
+
// Version-agnostic releases page: where the `<target>/vX.Y.Z` git tags
|
|
54
|
+
// that a pending (not-yet-on-registry) package is installed from live.
|
|
55
|
+
releasesUrl: `${repoUrl}/releases`,
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
// Publication state of a target's package registry, tri-state + tag-only:
|
|
61
|
+
// 'tag' — no registry (the go family); resolved from the git tag.
|
|
62
|
+
// 'pending' — registry declared but the package is not uploaded yet
|
|
63
|
+
// (the fleet default): install from the git tag.
|
|
64
|
+
// 'active' — package is live on the registry: show the real install cmd.
|
|
65
|
+
// 'inactive' — registry deliberately disabled (tag-only, like pending).
|
|
66
|
+
// Reads main.kit.target.<t>.publish.registry.state (default 'pending').
|
|
67
|
+
// The legacy boolean `registry.active: true` is honoured as a back-compat
|
|
68
|
+
// alias for state === 'active'.
|
|
69
|
+
function registryState(model: any, target: string): 'tag' | 'pending' | 'active' | 'inactive' {
|
|
70
|
+
if ('go' === target || 'go-cli' === target || 'go-mcp' === target) return 'tag'
|
|
71
|
+
const reg = model?.main?.[KIT]?.target?.[target]?.publish?.registry
|
|
72
|
+
if (null == reg || '' === (reg.name || '')) return 'tag'
|
|
73
|
+
if (true === reg.active) return 'active' // legacy alias
|
|
74
|
+
const s = reg.state
|
|
75
|
+
if ('active' === s || 'inactive' === s || 'pending' === s) return s
|
|
76
|
+
return 'pending'
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// True only when the package is actually live on its registry (so a README
|
|
80
|
+
// may print the real `npm install`/`pip install`/... command). Everything
|
|
81
|
+
// else — pending, inactive, tag-only — installs from the git tag instead.
|
|
82
|
+
function isPublished(model: any, target: string): boolean {
|
|
83
|
+
return 'active' === registryState(model, target)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// The registry a target uploads to (npm | pypi | packagist | ...), or ''
|
|
87
|
+
// for tag-only ports. Used in the "not yet on <registry>" pending message.
|
|
88
|
+
function registryName(model: any, target: string): string {
|
|
89
|
+
const reg = model?.main?.[KIT]?.target?.[target]?.publish?.registry
|
|
90
|
+
return (reg && reg.name) ? String(reg.name) : ''
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// The vendor / git-tag install pointer for a NOT-yet-published target. For
|
|
94
|
+
// the go family this is the canonical install (`go get <module>@latest`,
|
|
95
|
+
// which the Go proxy resolves from the `<subdir>/vX.Y.Z` tag). For registry
|
|
96
|
+
// ports it is a short "not yet on <registry> — install from the git tag"
|
|
97
|
+
// pointer carrying the releases URL.
|
|
98
|
+
function vendorCommand(model: any, target: string): string {
|
|
99
|
+
const { releasesUrl } = repoInfo(model)
|
|
100
|
+
switch (target) {
|
|
101
|
+
case 'go':
|
|
102
|
+
return `go get ${packageName(model, 'go')}@latest`
|
|
103
|
+
case 'go-mcp':
|
|
104
|
+
return `go get ${packageName(model, 'go-mcp')}@latest`
|
|
105
|
+
case 'go-cli':
|
|
106
|
+
return `go install ${packageName(model, 'go-cli')}/cmd/${model.name}@latest`
|
|
107
|
+
default: {
|
|
108
|
+
const reg = registryName(model, target)
|
|
109
|
+
return `not yet on ${reg || 'the registry'} — install from the git tag: ${releasesUrl}`
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// API display name for descriptions, e.g. "Aare.guru". Uses the OpenAPI
|
|
115
|
+
// info.title (present for ~98% of the fleet), stripping a trailing " API" so
|
|
116
|
+
// we don't render "... Aare.guru API public API". Falls back to the normalised
|
|
117
|
+
// SDK Name, then the slug.
|
|
118
|
+
function apiName(model: any): string {
|
|
119
|
+
const info = (model.main && model.main[KIT] && model.main[KIT].info) || {}
|
|
120
|
+
const raw = (null != info.title ? String(info.title) : '').trim()
|
|
121
|
+
const stripped = raw.replace(/\s*API\s*$/i, '').trim()
|
|
122
|
+
return stripped || nom(model, 'Name') || model.name
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// The REAL published package name per ecosystem — mirrors the exact formula in
|
|
126
|
+
// each Package_<lang>.ts. This is the one canonical implementation.
|
|
127
|
+
function packageName(model: any, eco: string): string {
|
|
128
|
+
const slug = model.name
|
|
129
|
+
const origin = model.origin || 'voxgig-sdk'
|
|
130
|
+
const base = origin.endsWith('-sdk') ? slug : `${slug}-sdk`
|
|
131
|
+
const npmScoped = `@${origin}/${slug}${origin.endsWith('-sdk') ? '' : '-sdk'}`
|
|
132
|
+
switch (eco) {
|
|
133
|
+
case 'npm':
|
|
134
|
+
case 'ts':
|
|
135
|
+
return npmScoped
|
|
136
|
+
case 'js':
|
|
137
|
+
return `${npmScoped}-js`
|
|
138
|
+
case 'pypi':
|
|
139
|
+
case 'py':
|
|
140
|
+
case 'gem':
|
|
141
|
+
case 'rb':
|
|
142
|
+
case 'luarocks':
|
|
143
|
+
case 'lua':
|
|
144
|
+
return `${origin}-${base}`
|
|
145
|
+
case 'composer':
|
|
146
|
+
case 'php':
|
|
147
|
+
return `${origin}/${base}`
|
|
148
|
+
case 'go':
|
|
149
|
+
return `github.com/${origin}/${slug}-sdk/go`
|
|
150
|
+
case 'go-cli':
|
|
151
|
+
return `github.com/${origin}/${slug}-sdk/go-cli`
|
|
152
|
+
case 'go-mcp':
|
|
153
|
+
return `github.com/${origin}/${slug}-sdk/go-mcp`
|
|
154
|
+
default:
|
|
155
|
+
return `${origin}-${base}`
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Copy-paste install command for a target, using the REAL package name.
|
|
160
|
+
// Only a package that is actually live on its registry (isPublished) gets a
|
|
161
|
+
// registry install command; everything else (pending / inactive / tag-only,
|
|
162
|
+
// including the whole go family) returns the git-tag vendor command instead,
|
|
163
|
+
// so a README never prints a `npm install ...` that 404s.
|
|
164
|
+
function installCommand(model: any, target: string): string {
|
|
165
|
+
if (!isPublished(model, target)) {
|
|
166
|
+
return vendorCommand(model, target)
|
|
167
|
+
}
|
|
168
|
+
switch (target) {
|
|
169
|
+
case 'ts':
|
|
170
|
+
return `npm install ${packageName(model, 'npm')}`
|
|
171
|
+
case 'js':
|
|
172
|
+
return `npm install ${packageName(model, 'js')}`
|
|
173
|
+
case 'py':
|
|
174
|
+
return `pip install ${packageName(model, 'pypi')}`
|
|
175
|
+
case 'php':
|
|
176
|
+
return `composer require ${packageName(model, 'composer')}`
|
|
177
|
+
case 'rb':
|
|
178
|
+
return `gem install ${packageName(model, 'gem')}`
|
|
179
|
+
case 'lua':
|
|
180
|
+
return `luarocks install ${packageName(model, 'luarocks')}`
|
|
181
|
+
case 'go':
|
|
182
|
+
return `go get ${packageName(model, 'go')}`
|
|
183
|
+
case 'go-cli':
|
|
184
|
+
return `go install ${packageName(model, 'go-cli')}/cmd/${model.name}@latest`
|
|
185
|
+
default:
|
|
186
|
+
return ''
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// The standard one-line package description (with the generic non-affiliation
|
|
191
|
+
// statement inline) used in every manifest.
|
|
192
|
+
function pkgDescription(model: any, target: string): string {
|
|
193
|
+
return `Unofficial generated ${langLabel(target)} SDK for the ${apiName(model)} public API.` +
|
|
194
|
+
` Not affiliated with or endorsed by the upstream API provider.`
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Longer non-affiliation / generated-code disclosure for READMEs, LICENSE and
|
|
198
|
+
// SECURITY.md. Generic on the upstream owner (owner names are only ~45%
|
|
199
|
+
// reliably known across the fleet).
|
|
200
|
+
function nonAffiliation(model: any): string {
|
|
201
|
+
return `This is an unofficial SDK for the ${apiName(model)} public API, generated by ` +
|
|
202
|
+
`${PUBLISHER} with [\`@voxgig/sdkgen\`](${GENERATOR_URL}). ` +
|
|
203
|
+
`It is not affiliated with, endorsed by, or sponsored by the upstream API provider.`
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function keywords(model: any): string[] {
|
|
207
|
+
return ['voxgig', 'sdk', 'generated-sdk', 'openapi', 'api-client', model.name]
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// A VALID uppercase env-var base derived from the slug: 'unsolicited-advice' ->
|
|
211
|
+
// 'UNSOLICITED_ADVICE'. Use for <NAME>_APIKEY / <NAME>_TEST_LIVE so examples are
|
|
212
|
+
// valid identifiers (model.NAME left a hyphen in, breaking process.env.X).
|
|
213
|
+
function envName(model: any): string {
|
|
214
|
+
return String(model.name || '').toUpperCase().replace(/[^A-Z0-9]+/g, '_').replace(/^_+|_+$/g, '')
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export {
|
|
218
|
+
PUBLISHER,
|
|
219
|
+
PUBLISHER_URL,
|
|
220
|
+
SECURITY_EMAIL,
|
|
221
|
+
GENERATOR_URL,
|
|
222
|
+
LANG_LABEL,
|
|
223
|
+
langLabel,
|
|
224
|
+
repoInfo,
|
|
225
|
+
apiName,
|
|
226
|
+
packageName,
|
|
227
|
+
installCommand,
|
|
228
|
+
registryState,
|
|
229
|
+
isPublished,
|
|
230
|
+
registryName,
|
|
231
|
+
vendorCommand,
|
|
232
|
+
pkgDescription,
|
|
233
|
+
nonAffiliation,
|
|
234
|
+
keywords,
|
|
235
|
+
envName,
|
|
236
|
+
}
|
package/src/sdkgen.ts
CHANGED
|
@@ -19,16 +19,21 @@ import type {
|
|
|
19
19
|
ActionResult,
|
|
20
20
|
} from './types'
|
|
21
21
|
|
|
22
|
-
import { SdkGenError, requirePath, isAuthActive } from './utility'
|
|
22
|
+
import { SdkGenError, requirePath, isAuthActive, resolveAuthPrefix } from './utility'
|
|
23
23
|
|
|
24
24
|
import { Main } from './cmp/Main'
|
|
25
|
+
import { Deploy } from './cmp/Deploy'
|
|
25
26
|
import { Entity } from './cmp/Entity'
|
|
26
27
|
import { Feature } from './cmp/Feature'
|
|
27
28
|
import { Readme } from './cmp/Readme'
|
|
28
29
|
import { ReadmeTop } from './cmp/ReadmeTop'
|
|
30
|
+
import { License } from './cmp/License'
|
|
31
|
+
import { Security } from './cmp/Security'
|
|
32
|
+
import { Changelog } from './cmp/Changelog'
|
|
29
33
|
import { Test } from './cmp/Test'
|
|
30
34
|
import { ReadmeInstall } from './cmp/ReadmeInstall'
|
|
31
35
|
import { ReadmeQuick } from './cmp/ReadmeQuick'
|
|
36
|
+
import { ReadmeErrors } from './cmp/ReadmeErrors'
|
|
32
37
|
import { ReadmeIntro } from './cmp/ReadmeIntro'
|
|
33
38
|
import { ReadmeModel } from './cmp/ReadmeModel'
|
|
34
39
|
import { ReadmeOptions } from './cmp/ReadmeOptions'
|
|
@@ -42,6 +47,28 @@ import { buildIdNames } from './helpers/buildIdNames'
|
|
|
42
47
|
import { getMatchEntries } from './helpers/getMatchEntries'
|
|
43
48
|
import { collectDeps } from './helpers/collectDeps'
|
|
44
49
|
import type { DepEntry } from './helpers/collectDeps'
|
|
50
|
+
import { canonToType, canonKey } from './helpers/canonType'
|
|
51
|
+
import { OP_SUFFIX, opTypeName, opParams, opRequestShape, entityIdField, entityDataIdField, entityOps, entityPrimaryOp } from './helpers/opShape'
|
|
52
|
+
import { isReservedName, safeVarName } from './helpers/naming'
|
|
53
|
+
import {
|
|
54
|
+
packageName,
|
|
55
|
+
installCommand,
|
|
56
|
+
registryState,
|
|
57
|
+
isPublished,
|
|
58
|
+
registryName,
|
|
59
|
+
vendorCommand,
|
|
60
|
+
pkgDescription,
|
|
61
|
+
nonAffiliation,
|
|
62
|
+
keywords,
|
|
63
|
+
envName,
|
|
64
|
+
repoInfo,
|
|
65
|
+
apiName,
|
|
66
|
+
langLabel,
|
|
67
|
+
PUBLISHER,
|
|
68
|
+
PUBLISHER_URL,
|
|
69
|
+
SECURITY_EMAIL,
|
|
70
|
+
GENERATOR_URL,
|
|
71
|
+
} from './helpers/packageMeta'
|
|
45
72
|
|
|
46
73
|
|
|
47
74
|
import {
|
|
@@ -95,14 +122,15 @@ const ACTION_MAP: any = {
|
|
|
95
122
|
const dlog = getdlog('sdkgen', __filename)
|
|
96
123
|
|
|
97
124
|
|
|
98
|
-
let aontu: any = null
|
|
99
|
-
|
|
100
|
-
|
|
101
125
|
function SdkGen(opts: SdkGenOptions) {
|
|
102
126
|
const fs = opts.fs || Fs
|
|
103
127
|
const folder = opts.folder || '../'
|
|
104
128
|
const now = opts.now || (() => Date.now())
|
|
105
129
|
|
|
130
|
+
// Per-instance cache of the Aontu model loader. Previously a module-level
|
|
131
|
+
// global, which leaked the (relative) preload across SdkGen instances.
|
|
132
|
+
let aontu: any = null
|
|
133
|
+
|
|
106
134
|
const jopts = {
|
|
107
135
|
now,
|
|
108
136
|
control: {
|
|
@@ -130,7 +158,7 @@ function SdkGen(opts: SdkGenOptions) {
|
|
|
130
158
|
|
|
131
159
|
let Root = spec.root
|
|
132
160
|
|
|
133
|
-
if (null == Root && null != config
|
|
161
|
+
if (null == Root && null != config?.root) {
|
|
134
162
|
clear(config.root)
|
|
135
163
|
const rootModule: any = require(config.root)
|
|
136
164
|
Root = rootModule.Root
|
|
@@ -198,17 +226,11 @@ function SdkGen(opts: SdkGenOptions) {
|
|
|
198
226
|
|
|
199
227
|
|
|
200
228
|
function resolveModel() {
|
|
201
|
-
const path = './model/sdk.
|
|
229
|
+
const path = './model/sdk.aontu'
|
|
202
230
|
const errs: any[] = []
|
|
203
231
|
|
|
204
232
|
if (null == aontu) {
|
|
205
|
-
aontu = new Aontu(
|
|
206
|
-
preload: {
|
|
207
|
-
folders: ['./model'],
|
|
208
|
-
ext: ['.jsonic', '.json'],
|
|
209
|
-
recursive: true,
|
|
210
|
-
}
|
|
211
|
-
})
|
|
233
|
+
aontu = new Aontu()
|
|
212
234
|
}
|
|
213
235
|
|
|
214
236
|
const aopts = { path, errs }
|
|
@@ -217,17 +239,16 @@ function SdkGen(opts: SdkGenOptions) {
|
|
|
217
239
|
const model = aontu.generate(src, aopts)
|
|
218
240
|
|
|
219
241
|
if (0 < errs.length) {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
242
|
+
const serr = errs[0]
|
|
243
|
+
const err: any = new SdkGenError('Model Error: ' + serr.msg)
|
|
244
|
+
err.cause$ = [serr]
|
|
223
245
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
err.rooterrs$ = errs
|
|
229
|
-
throw err
|
|
246
|
+
if ('syntax' === serr.why) {
|
|
247
|
+
err.uxmsg$ = true
|
|
230
248
|
}
|
|
249
|
+
|
|
250
|
+
err.rooterrs$ = errs
|
|
251
|
+
throw err
|
|
231
252
|
}
|
|
232
253
|
|
|
233
254
|
model.const = { name: model.name }
|
|
@@ -278,7 +299,7 @@ SdkGen.makeBuild = async function(opts: SdkGenOptions) {
|
|
|
278
299
|
root: opts.root,
|
|
279
300
|
def: opts.def || 'no-def',
|
|
280
301
|
kind: 'openapi-3',
|
|
281
|
-
model: opts.model ? (opts.model.folder + '/api.
|
|
302
|
+
model: opts.model ? (opts.model.folder + '/api.aontu') : 'no-model',
|
|
282
303
|
meta: opts.meta || {},
|
|
283
304
|
}
|
|
284
305
|
|
|
@@ -338,6 +359,16 @@ export type {
|
|
|
338
359
|
DepEntry,
|
|
339
360
|
}
|
|
340
361
|
|
|
362
|
+
export type {
|
|
363
|
+
SdkModel,
|
|
364
|
+
ModelKit,
|
|
365
|
+
ModelTarget,
|
|
366
|
+
ModelFeature,
|
|
367
|
+
ModelEntity,
|
|
368
|
+
ModelDep,
|
|
369
|
+
ModelHook,
|
|
370
|
+
} from './types'
|
|
371
|
+
|
|
341
372
|
|
|
342
373
|
|
|
343
374
|
type Component = (props: any, children?: any) => void
|
|
@@ -375,6 +406,10 @@ export const List: Component = JostracaModule.List
|
|
|
375
406
|
|
|
376
407
|
export {
|
|
377
408
|
Main,
|
|
409
|
+
Deploy,
|
|
410
|
+
License,
|
|
411
|
+
Security,
|
|
412
|
+
Changelog,
|
|
378
413
|
Entity,
|
|
379
414
|
Feature,
|
|
380
415
|
Test,
|
|
@@ -382,6 +417,7 @@ export {
|
|
|
382
417
|
ReadmeTop,
|
|
383
418
|
ReadmeInstall,
|
|
384
419
|
ReadmeQuick,
|
|
420
|
+
ReadmeErrors,
|
|
385
421
|
ReadmeIntro,
|
|
386
422
|
ReadmeModel,
|
|
387
423
|
ReadmeOptions,
|
|
@@ -396,8 +432,40 @@ export {
|
|
|
396
432
|
|
|
397
433
|
requirePath,
|
|
398
434
|
isAuthActive,
|
|
435
|
+
resolveAuthPrefix,
|
|
399
436
|
|
|
400
437
|
buildIdNames,
|
|
401
438
|
getMatchEntries,
|
|
402
439
|
collectDeps,
|
|
440
|
+
canonToType,
|
|
441
|
+
canonKey,
|
|
442
|
+
|
|
443
|
+
OP_SUFFIX,
|
|
444
|
+
opTypeName,
|
|
445
|
+
opParams,
|
|
446
|
+
opRequestShape,
|
|
447
|
+
entityIdField,
|
|
448
|
+
entityDataIdField,
|
|
449
|
+
entityOps,
|
|
450
|
+
entityPrimaryOp,
|
|
451
|
+
isReservedName,
|
|
452
|
+
safeVarName,
|
|
453
|
+
|
|
454
|
+
packageName,
|
|
455
|
+
installCommand,
|
|
456
|
+
registryState,
|
|
457
|
+
isPublished,
|
|
458
|
+
registryName,
|
|
459
|
+
vendorCommand,
|
|
460
|
+
pkgDescription,
|
|
461
|
+
nonAffiliation,
|
|
462
|
+
keywords,
|
|
463
|
+
envName,
|
|
464
|
+
repoInfo,
|
|
465
|
+
apiName,
|
|
466
|
+
langLabel,
|
|
467
|
+
PUBLISHER,
|
|
468
|
+
PUBLISHER_URL,
|
|
469
|
+
SECURITY_EMAIL,
|
|
470
|
+
GENERATOR_URL,
|
|
403
471
|
}
|
package/src/tsconfig.json
CHANGED
package/src/types.ts
CHANGED
|
@@ -14,11 +14,88 @@ import {
|
|
|
14
14
|
type FsUtil = typeof Fs
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
// The model is produced by aontu/apidef and carries dynamic metadata
|
|
18
|
+
// (key$, val$, index$, and the Name/NAME case variants injected by
|
|
19
|
+
// jostraca's names()). These interfaces document the fields sdkgen relies
|
|
20
|
+
// on while the index signatures keep the genuinely-dynamic remainder
|
|
21
|
+
// accessible — a pragmatic middle ground until the model is shaped with
|
|
22
|
+
// `shape`.
|
|
23
|
+
|
|
24
|
+
// Case variants injected by jostraca's names() helper.
|
|
25
|
+
type NameCases = {
|
|
26
|
+
name?: string
|
|
27
|
+
Name?: string
|
|
28
|
+
NAME?: string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// A dependency entry inside a target or feature `deps` block.
|
|
32
|
+
type ModelDep = {
|
|
33
|
+
key$?: string
|
|
34
|
+
version?: string
|
|
35
|
+
active?: boolean
|
|
36
|
+
kind?: string
|
|
37
|
+
replace?: string
|
|
38
|
+
[extra: string]: any
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
type ModelHook = {
|
|
42
|
+
active?: boolean
|
|
43
|
+
[extra: string]: any
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
type ModelFeature = NameCases & {
|
|
47
|
+
active?: boolean
|
|
48
|
+
title?: string
|
|
49
|
+
version?: string
|
|
50
|
+
hook?: Record<string, ModelHook>
|
|
51
|
+
deps?: Record<string, Record<string, ModelDep>>
|
|
52
|
+
[extra: string]: any
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
type ModelTarget = NameCases & {
|
|
56
|
+
active?: boolean
|
|
57
|
+
title?: string
|
|
58
|
+
base?: string
|
|
59
|
+
module?: { name?: string }
|
|
60
|
+
srcfeature?: boolean
|
|
61
|
+
[extra: string]: any
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
type ModelEntity = NameCases & {
|
|
65
|
+
active?: boolean
|
|
66
|
+
short?: string
|
|
67
|
+
desc?: string
|
|
68
|
+
op?: Record<string, any>
|
|
69
|
+
relations?: { ancestors?: any }
|
|
70
|
+
[extra: string]: any
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
type ModelKit = {
|
|
74
|
+
info?: Record<string, any>
|
|
75
|
+
config?: Record<string, any>
|
|
76
|
+
target?: Record<string, ModelTarget>
|
|
77
|
+
feature?: Record<string, ModelFeature>
|
|
78
|
+
entity?: Record<string, ModelEntity>
|
|
79
|
+
[extra: string]: any
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
type SdkModel = NameCases & {
|
|
83
|
+
origin?: string
|
|
84
|
+
const?: Record<string, any>
|
|
85
|
+
main: {
|
|
86
|
+
kit?: ModelKit
|
|
87
|
+
def?: Record<string, any>
|
|
88
|
+
[extra: string]: any
|
|
89
|
+
}
|
|
90
|
+
[extra: string]: any
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
17
94
|
type ActionContext = {
|
|
18
95
|
fs: () => FsUtil,
|
|
19
96
|
log: any,
|
|
20
97
|
folder: string,
|
|
21
|
-
model:
|
|
98
|
+
model: SdkModel,
|
|
22
99
|
url: string,
|
|
23
100
|
opts: any,
|
|
24
101
|
jostraca: any
|
|
@@ -38,5 +115,11 @@ export {
|
|
|
38
115
|
export type {
|
|
39
116
|
ActionContext,
|
|
40
117
|
ActionResult,
|
|
118
|
+
SdkModel,
|
|
119
|
+
ModelKit,
|
|
120
|
+
ModelTarget,
|
|
121
|
+
ModelFeature,
|
|
122
|
+
ModelEntity,
|
|
123
|
+
ModelDep,
|
|
124
|
+
ModelHook,
|
|
41
125
|
}
|
|
42
|
-
|
package/src/utility.ts
CHANGED
|
@@ -12,31 +12,64 @@ function resolvePath(ctx$: any, path: string): any {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
// True unless the model
|
|
16
|
-
//
|
|
17
|
-
//
|
|
15
|
+
// True unless the model declares auth off. Templates use this to gate
|
|
16
|
+
// apikey-related code, docs, and examples for public APIs that need no
|
|
17
|
+
// authentication. Two opt-outs, in priority order:
|
|
18
|
+
// 1. main.kit.info.auth: false (user-facing, set in api-info.aontu)
|
|
19
|
+
// 2. main.kit.config.auth.active: false
|
|
18
20
|
function isAuthActive(model: any): boolean {
|
|
21
|
+
const info = getModelPath(model, `main.${KIT}.info`,
|
|
22
|
+
{ only_active: false, required: false })
|
|
23
|
+
if (info && false === info.auth) return false
|
|
24
|
+
|
|
19
25
|
const auth = getModelPath(model, `main.${KIT}.config.auth`,
|
|
20
26
|
{ only_active: false, required: false })
|
|
21
27
|
return null == auth || false !== auth.active
|
|
22
28
|
}
|
|
23
29
|
|
|
24
30
|
|
|
31
|
+
// The credential prefix for the Authorization header value, resolved in
|
|
32
|
+
// priority order:
|
|
33
|
+
// 1. main.kit.config.auth.prefix (per-SDK user override)
|
|
34
|
+
// 2. main.kit.info.security.prefix (spec-derived, set by apidef from the
|
|
35
|
+
// API's securityScheme — e.g. 'OAuth' for Statuspage)
|
|
36
|
+
// 3. 'Bearer' (conventional fallback)
|
|
37
|
+
// '' is a valid resolved value: it means a raw credential with no prefix
|
|
38
|
+
// (e.g. an apiKey scheme in a custom header). Config generators for every
|
|
39
|
+
// language target must use this instead of hardcoding 'Bearer'.
|
|
40
|
+
function resolveAuthPrefix(model: any): string {
|
|
41
|
+
const auth = getModelPath(model, `main.${KIT}.config.auth`,
|
|
42
|
+
{ only_active: false, required: false })
|
|
43
|
+
if (null != auth && null != auth.prefix) return String(auth.prefix)
|
|
44
|
+
|
|
45
|
+
const security = getModelPath(model, `main.${KIT}.info.security`,
|
|
46
|
+
{ only_active: false, required: false })
|
|
47
|
+
if (null != security && null != security.prefix) return String(security.prefix)
|
|
48
|
+
|
|
49
|
+
return 'Bearer'
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
25
53
|
function requirePath(ctx$: any, path: string, flags?: { ignore?: boolean }): any {
|
|
26
54
|
const fullpath = resolvePath(ctx$, path)
|
|
27
55
|
const ignore = null == flags?.ignore ? false : flags.ignore
|
|
28
56
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
57
|
+
// When `ignore` is set, only swallow a genuine "module not found"
|
|
58
|
+
// resolution failure. A module that resolves but throws while loading
|
|
59
|
+
// (syntax error, runtime bug, or a missing *nested* dependency) must
|
|
60
|
+
// propagate — otherwise the optional component silently renders nothing
|
|
61
|
+
// and the real failure is invisible.
|
|
62
|
+
if (ignore) {
|
|
63
|
+
try {
|
|
64
|
+
require.resolve(fullpath)
|
|
35
65
|
}
|
|
36
|
-
|
|
37
|
-
|
|
66
|
+
catch (err: any) {
|
|
67
|
+
ctx$.log.warn({ point: 'require-missing', path, note: path })
|
|
68
|
+
return undefined
|
|
38
69
|
}
|
|
39
70
|
}
|
|
71
|
+
|
|
72
|
+
return require(fullpath)
|
|
40
73
|
}
|
|
41
74
|
|
|
42
75
|
|
|
@@ -52,5 +85,6 @@ export {
|
|
|
52
85
|
resolvePath,
|
|
53
86
|
requirePath,
|
|
54
87
|
isAuthActive,
|
|
88
|
+
resolveAuthPrefix,
|
|
55
89
|
SdkGenError,
|
|
56
90
|
}
|
package/README.md
DELETED
package/dist/action/lang.d.ts
DELETED