@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
package/src/cmp/ReadmeTop.ts
CHANGED
|
@@ -8,47 +8,322 @@ import {
|
|
|
8
8
|
|
|
9
9
|
import { requirePath } from '../utility'
|
|
10
10
|
|
|
11
|
+
import { entityPrimaryOp, entityIdField, opRequestShape } from '../helpers/opShape'
|
|
12
|
+
import { canonKey } from '../helpers/canonType'
|
|
13
|
+
import { safeVarName } from '../helpers/naming'
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
installCommand as pkgInstall,
|
|
17
|
+
packageName,
|
|
18
|
+
registryState,
|
|
19
|
+
vendorCommand,
|
|
20
|
+
apiName,
|
|
21
|
+
nonAffiliation,
|
|
22
|
+
repoInfo,
|
|
23
|
+
SECURITY_EMAIL,
|
|
24
|
+
} from '../helpers/packageMeta'
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
const SDKGEN_REPO = 'https://github.com/voxgig/sdkgen'
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
// A type-correct TS example literal for a model field, keyed off its canonical
|
|
31
|
+
// type sentinel — mirrors the per-language `exampleValue`, but inline because
|
|
32
|
+
// this neutral component renders the intro `ts` block directly.
|
|
33
|
+
function tsExampleLiteral(type: any): string {
|
|
34
|
+
const k = canonKey(type)
|
|
35
|
+
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
36
|
+
if ('BOOLEAN' === k) return 'true'
|
|
37
|
+
if ('ARRAY' === k) return '[]'
|
|
38
|
+
if ('OBJECT' === k) return '{}'
|
|
39
|
+
return `'example'`
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
// Per-language install commands rendered in the top-level "Try it"
|
|
44
|
+
// section. The per-language `ReadmeInstall_<lang>.ts` templates exist
|
|
45
|
+
// but emit extra prose ("Or install from source: ..."); for the
|
|
46
|
+
// landing-page README we want a single copy-paste line per language.
|
|
47
|
+
function installCommand(target: any, model: any): string {
|
|
48
|
+
// Delegate to the single source of truth so the README install command can
|
|
49
|
+
// never drift from the real published package name (see helpers/packageMeta).
|
|
50
|
+
return pkgInstall(model, target.name)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
// Pick the language we lead the README with — first entry from the
|
|
55
|
+
// docs-ordered SDK targets. Returns undefined if there are no targets.
|
|
56
|
+
function pickLeadTarget(sdkTargets: any[]): any | undefined {
|
|
57
|
+
return sdkTargets[0]
|
|
58
|
+
}
|
|
59
|
+
|
|
11
60
|
|
|
12
61
|
const ReadmeTop = cmp(function ReadmeTop(props: any) {
|
|
13
62
|
const { ctx$ } = props
|
|
14
63
|
const { model } = ctx$
|
|
15
64
|
|
|
16
|
-
|
|
65
|
+
// Ensure the Name/NAME case variants exist (apidef usually sets these,
|
|
66
|
+
// but guard so the header never renders "undefined SDK"). Entity/feature
|
|
67
|
+
// names are guarded the same way below.
|
|
68
|
+
if (model.name && !model.Name) names(model, model.name)
|
|
69
|
+
|
|
70
|
+
const info = (model.main && model.main[KIT] && model.main[KIT].info) || {}
|
|
71
|
+
const def = (model.main && model.main.def) || {}
|
|
72
|
+
|
|
73
|
+
// Plain-text title — prefer the OpenAPI `info.title` when it's
|
|
74
|
+
// recognisably the product name (e.g. "Aare.guru API"), fall back
|
|
75
|
+
// to the normalised SDK Name.
|
|
76
|
+
const productName = info.title || `${model.Name} API`
|
|
77
|
+
|
|
78
|
+
const tagline = info.tagline
|
|
79
|
+
|| def.tagline
|
|
80
|
+
|| `${productName} client, generated from the OpenAPI spec.`
|
|
81
|
+
|
|
82
|
+
const aboutMd = info.about_md || ''
|
|
83
|
+
const licenseMd = info.license_md || ''
|
|
84
|
+
const licenseShort = info.license_short || ''
|
|
85
|
+
const homepage = info.homepage || ''
|
|
86
|
+
const docsUrl = info.docs_url || ''
|
|
87
|
+
const entityDesc = info.entity_desc || {}
|
|
88
|
+
|
|
17
89
|
const entity = getModelPath(model, `main.${KIT}.entity`)
|
|
18
90
|
const target = getModelPath(model, `main.${KIT}.target`)
|
|
19
91
|
const feature = getModelPath(model, `main.${KIT}.feature`)
|
|
20
92
|
|
|
21
|
-
// Ensure names are computed on entities and features
|
|
22
93
|
each(entity, (ent: any) => { if (!ent.Name) names(ent, ent.name) })
|
|
23
94
|
each(feature, (feat: any) => { if (!feat.Name) names(feat, feat.name) })
|
|
24
95
|
|
|
25
96
|
const activeEntities = each(entity).filter((e: any) => e.active !== false)
|
|
26
|
-
const activeTargets = each(target)
|
|
97
|
+
const activeTargets = each(target).filter((t: any) => t.active !== false)
|
|
98
|
+
|
|
99
|
+
const hasCli = activeTargets.some((t: any) => t.name === 'go-cli')
|
|
100
|
+
const hasMcp = activeTargets.some((t: any) => t.name === 'go-mcp')
|
|
101
|
+
const hasJsLike = activeTargets.some((t: any) => t.name === 'ts' || t.name === 'js')
|
|
102
|
+
|
|
103
|
+
// Canonical docs order from main.kit.config.docs_order (with a
|
|
104
|
+
// schema-supplied default of ['ts','py','php','go','rb','lua']).
|
|
105
|
+
// Targets present but not listed get appended in spec-defined order,
|
|
106
|
+
// so adding a new target never silently disappears from the docs.
|
|
107
|
+
const docsOrder: string[] = (getModelPath(model, `main.${KIT}.config.docs_order`,
|
|
108
|
+
{ only_active: false, required: false }) as any) || []
|
|
109
|
+
|
|
110
|
+
const sdkTargets = activeTargets
|
|
111
|
+
.filter((t: any) => t.name !== 'go-cli' && t.name !== 'go-mcp')
|
|
112
|
+
.slice()
|
|
113
|
+
.sort((a: any, b: any) => {
|
|
114
|
+
const ai = docsOrder.indexOf(a.name)
|
|
115
|
+
const bi = docsOrder.indexOf(b.name)
|
|
116
|
+
const av = ai === -1 ? docsOrder.length : ai
|
|
117
|
+
const bv = bi === -1 ? docsOrder.length : bi
|
|
118
|
+
return av - bv
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
const langList = sdkTargets.map((t: any) => t.title).join(', ')
|
|
122
|
+
const leadTarget = pickLeadTarget(sdkTargets)
|
|
27
123
|
|
|
28
124
|
File({ name: 'README.md' }, () => {
|
|
29
125
|
|
|
126
|
+
// 1. H1 + one-line value prop + unofficial / non-affiliation disclosure
|
|
30
127
|
Content(`# ${model.Name} SDK
|
|
31
128
|
|
|
32
|
-
${
|
|
129
|
+
${tagline}
|
|
130
|
+
|
|
131
|
+
${nonAffiliation(model)}
|
|
33
132
|
|
|
34
133
|
`)
|
|
35
134
|
|
|
36
|
-
//
|
|
37
|
-
if (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
)
|
|
42
|
-
|
|
135
|
+
// Positioning line, only when we actually have multiple SDK targets.
|
|
136
|
+
if (sdkTargets.length > 1) {
|
|
137
|
+
const surfaces = []
|
|
138
|
+
surfaces.push(`${langList} SDKs`)
|
|
139
|
+
if (hasCli) surfaces.push('a CLI')
|
|
140
|
+
if (hasJsLike) surfaces.push('an interactive REPL')
|
|
141
|
+
if (hasMcp) surfaces.push('an MCP server for AI agents')
|
|
142
|
+
const surfaceList = surfaces.length > 1
|
|
143
|
+
? surfaces.slice(0, -1).join(', ') + ', and ' + surfaces[surfaces.length - 1]
|
|
144
|
+
: surfaces[0]
|
|
145
|
+
Content(`> ${surfaceList} — all generated from one OpenAPI spec by [@voxgig/sdkgen](${SDKGEN_REPO}).
|
|
43
146
|
|
|
44
147
|
`)
|
|
45
148
|
}
|
|
46
149
|
|
|
150
|
+
// 2. About / what the API is
|
|
151
|
+
if (aboutMd) {
|
|
152
|
+
Content(`## About ${productName}
|
|
47
153
|
|
|
48
|
-
|
|
154
|
+
${aboutMd.trim()}
|
|
155
|
+
|
|
156
|
+
`)
|
|
157
|
+
} else if (def.desc) {
|
|
158
|
+
Content(`${def.desc}
|
|
159
|
+
|
|
160
|
+
`)
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// 2b. Entities-first framing: the API surface is a small set of semantic,
|
|
164
|
+
// Capitalised entities — NOT raw URL paths/queries — which is the core
|
|
165
|
+
// mental model the SDK is built around (model-driven; lists real entities).
|
|
49
166
|
if (activeEntities.length > 0) {
|
|
167
|
+
const entNames = activeEntities.map((e: any) => e.Name)
|
|
168
|
+
const entList = entNames.length > 1
|
|
169
|
+
? entNames.slice(0, -1).join(', ') + ' and ' + entNames[entNames.length - 1]
|
|
170
|
+
: entNames[0]
|
|
171
|
+
const exEnt = activeEntities[0]
|
|
172
|
+
const ex = exEnt.Name
|
|
173
|
+
const exLower = safeVarName(ex.toLowerCase(), 'ts')
|
|
174
|
+
// The example call uses the entity's PRIMARY op — an op it actually
|
|
175
|
+
// exposes (prefer list -> the array, then load -> the record, else a
|
|
176
|
+
// create with its required fields). A create-only entity therefore never
|
|
177
|
+
// shows a phantom .list()/.load() that would not compile. If it exposes
|
|
178
|
+
// only remove (or nothing), the op line is omitted entirely.
|
|
179
|
+
const primaryOp = entityPrimaryOp(exEnt)
|
|
180
|
+
let exCall = ''
|
|
181
|
+
if ('list' === primaryOp) {
|
|
182
|
+
exCall = `const items = await client.${ex}().list()`
|
|
183
|
+
} else if ('load' === primaryOp) {
|
|
184
|
+
exCall = `const ${exLower} = await client.${ex}().load()`
|
|
185
|
+
} else if ('create' === primaryOp || 'update' === primaryOp) {
|
|
186
|
+
const exIdF = entityIdField(exEnt)
|
|
187
|
+
const shapeItems = opRequestShape(exEnt, primaryOp).items
|
|
188
|
+
.filter((it: any) => it.name !== exIdF && it.name !== 'id')
|
|
189
|
+
const required = shapeItems.filter((it: any) => !it.optional)
|
|
190
|
+
// ALL required fields must appear or the literal is not assignable to
|
|
191
|
+
// the typed CreateData/UpdateData; cap only the optional fallback.
|
|
192
|
+
const chosen = required.length ? required : shapeItems.slice(0, 3)
|
|
193
|
+
const bodyLines = chosen.map((it: any) => ` ${it.name}: ${tsExampleLiteral(it.type)},`)
|
|
194
|
+
const body = bodyLines.length ? `\n${bodyLines.join('\n')}\n` : ''
|
|
195
|
+
exCall = `const ${exLower} = await client.${ex}().${primaryOp}({${body}})`
|
|
196
|
+
}
|
|
197
|
+
// Model-driven op list — only the operations the entities actually expose
|
|
198
|
+
// (advice may be list+load only; never claim create/update/remove exist).
|
|
199
|
+
const CANON_OPS = ['list', 'load', 'create', 'update', 'remove']
|
|
200
|
+
const opSet = new Set<string>()
|
|
201
|
+
activeEntities.forEach((e: any) => Object.keys(e.op || {})
|
|
202
|
+
.forEach((o: string) => { if ((e.op as any)[o] && (e.op as any)[o].active !== false) opSet.add(o) }))
|
|
203
|
+
const opNames = CANON_OPS.filter((o) => opSet.has(o)).concat([...opSet].filter((o) => !CANON_OPS.includes(o)))
|
|
204
|
+
const opList = (opNames.length ? opNames : ['list', 'load']).map((o) => '`' + o + '`').join(', ')
|
|
205
|
+
Content(`## Entities, not endpoints
|
|
206
|
+
|
|
207
|
+
This SDK exposes the API as a small set of **semantic entities** — ${entList} — that you
|
|
208
|
+
call directly, instead of assembling URL paths and query strings. Entities are
|
|
209
|
+
**Capitalised** to mark them as the primary surface, each with the operations they
|
|
210
|
+
support (${opList}):
|
|
211
|
+
|
|
212
|
+
\`\`\`ts
|
|
213
|
+
const client = new ${model.Name}SDK()${exCall ? '\n' + exCall : ''}
|
|
214
|
+
\`\`\`
|
|
215
|
+
|
|
216
|
+
Thinking in entities keeps the mental model small — for people and AI agents alike —
|
|
217
|
+
rather than reasoning about raw HTTP routes and query parameters.
|
|
218
|
+
|
|
219
|
+
`)
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// 3. Packages — real published package name + install command per
|
|
223
|
+
// ecosystem. A package that is NOT yet live on its registry (the fleet
|
|
224
|
+
// default: 'pending') must NOT advertise a `npm install ...` that 404s —
|
|
225
|
+
// its Install cell links to the git-tag releases page instead. The go
|
|
226
|
+
// family resolves from the tag directly (`go get <mod>@latest`).
|
|
227
|
+
if (sdkTargets.length > 0) {
|
|
228
|
+
const { releasesUrl } = repoInfo(model)
|
|
229
|
+
Content(`## Packages
|
|
230
|
+
|
|
231
|
+
| Language | Package | Install |
|
|
232
|
+
| --- | --- | --- |
|
|
233
|
+
`)
|
|
234
|
+
sdkTargets.forEach((tgt: any) => {
|
|
235
|
+
const state = registryState(model, tgt.name)
|
|
236
|
+
let cell: string
|
|
237
|
+
if ('active' === state) {
|
|
238
|
+
const cmd = installCommand(tgt, model)
|
|
239
|
+
if (!cmd) return
|
|
240
|
+
cell = '`' + cmd + '`'
|
|
241
|
+
} else if ('tag' === state) {
|
|
242
|
+
// Tag-only port (go): the vendor command IS the real install.
|
|
243
|
+
cell = '`' + vendorCommand(model, tgt.name) + '`'
|
|
244
|
+
} else {
|
|
245
|
+
// pending / inactive: point at the git tag, never a 404 command.
|
|
246
|
+
cell = `publish pending — [install from git tag](${releasesUrl})`
|
|
247
|
+
}
|
|
248
|
+
Content(`| ${tgt.title} | \`${packageName(model, tgt.name)}\` | ${cell} |
|
|
249
|
+
`)
|
|
250
|
+
})
|
|
251
|
+
Content(`
|
|
252
|
+
`)
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// 4. Quickstart in the lead language
|
|
256
|
+
if (leadTarget) {
|
|
257
|
+
Content(`## Quickstart
|
|
258
|
+
|
|
259
|
+
### ${leadTarget.title}
|
|
260
|
+
|
|
261
|
+
`)
|
|
262
|
+
const LeadQuick =
|
|
263
|
+
requirePath(ctx$, `./cmp/${leadTarget.name}/ReadmeTopQuick_${leadTarget.name}`, { ignore: true })
|
|
264
|
+
if (LeadQuick) {
|
|
265
|
+
LeadQuick['ReadmeTopQuick']({ target: leadTarget })
|
|
266
|
+
}
|
|
267
|
+
Content(`
|
|
268
|
+
See the [${leadTarget.title} README](${leadTarget.name}/README.md) for the full guide.
|
|
269
|
+
|
|
270
|
+
`)
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// 5. Surface table
|
|
274
|
+
if (sdkTargets.length > 0 || hasCli || hasMcp) {
|
|
275
|
+
Content(`## Surfaces
|
|
276
|
+
|
|
277
|
+
| Surface | Path |
|
|
278
|
+
| --- | --- |
|
|
279
|
+
`)
|
|
280
|
+
if (sdkTargets.length > 0) {
|
|
281
|
+
const paths = sdkTargets.map((t: any) => `\`${t.name}/\``).join(' ')
|
|
282
|
+
Content(`| **SDK** (${langList}) | ${paths} |
|
|
283
|
+
`)
|
|
284
|
+
}
|
|
285
|
+
if (hasCli) {
|
|
286
|
+
Content(`| **CLI** | \`go-cli/\` |
|
|
287
|
+
`)
|
|
288
|
+
}
|
|
289
|
+
if (hasMcp) {
|
|
290
|
+
Content(`| **MCP server** | \`go-mcp/\` |
|
|
291
|
+
`)
|
|
292
|
+
}
|
|
50
293
|
Content(`
|
|
51
|
-
|
|
294
|
+
`)
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// 6. MCP / agent usage — only if MCP target is enabled
|
|
298
|
+
if (hasMcp) {
|
|
299
|
+
Content(`## Use it from an AI agent (MCP)
|
|
300
|
+
|
|
301
|
+
The generated MCP server exposes every operation in this SDK as an
|
|
302
|
+
[MCP](https://modelcontextprotocol.io) tool that Claude, Cursor or Cline
|
|
303
|
+
can call directly. Build and register it:
|
|
304
|
+
|
|
305
|
+
\`\`\`bash
|
|
306
|
+
cd go-mcp && go build -o ${model.name}-mcp .
|
|
307
|
+
\`\`\`
|
|
308
|
+
|
|
309
|
+
Then add it to your agent's MCP config (Claude Desktop, Cursor, etc.):
|
|
310
|
+
|
|
311
|
+
\`\`\`json
|
|
312
|
+
{
|
|
313
|
+
"mcpServers": {
|
|
314
|
+
"${model.name}": {
|
|
315
|
+
"command": "/abs/path/to/${model.name}-mcp"
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
\`\`\`
|
|
320
|
+
|
|
321
|
+
`)
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// 7. Entities table
|
|
325
|
+
if (activeEntities.length > 0) {
|
|
326
|
+
Content(`## Entities
|
|
52
327
|
|
|
53
328
|
The API exposes ${activeEntities.length === 1 ? 'one entity' : activeEntities.length + ' entities'}:
|
|
54
329
|
|
|
@@ -57,8 +332,11 @@ The API exposes ${activeEntities.length === 1 ? 'one entity' : activeEntities.le
|
|
|
57
332
|
`)
|
|
58
333
|
|
|
59
334
|
activeEntities.map((ent: any) => {
|
|
60
|
-
const entdesc = ent.short || ''
|
|
61
335
|
const ops = ent.op || {}
|
|
336
|
+
const opNames = Object.keys(ops).filter((o: string) => (ops as any)[o]?.active !== false)
|
|
337
|
+
// Never emit a blank description cell: fall back to an ops-derived line.
|
|
338
|
+
const entdesc = entityDesc[ent.name] || ent.short || ent.desc ||
|
|
339
|
+
`The ${ent.Name} entity${opNames.length ? ' (' + opNames.join(', ') + ')' : ''}.`
|
|
62
340
|
const points = each(ops).map((op: any) =>
|
|
63
341
|
op.points ? each(op.points) : []
|
|
64
342
|
).flat()
|
|
@@ -69,140 +347,178 @@ The API exposes ${activeEntities.length === 1 ? 'one entity' : activeEntities.le
|
|
|
69
347
|
`)
|
|
70
348
|
})
|
|
71
349
|
|
|
350
|
+
const opUnion = new Set<string>()
|
|
351
|
+
activeEntities.forEach((e: any) => Object.keys(e.op || {})
|
|
352
|
+
.forEach((o: string) => { if ((e.op as any)[o]?.active !== false) opUnion.add(o) }))
|
|
353
|
+
const opAvail = ['load', 'list', 'create', 'update', 'remove'].filter((o) => opUnion.has(o))
|
|
354
|
+
const opBold = (opAvail.length ? opAvail : ['load', 'list']).map((o) => '**' + o + '**').join(', ')
|
|
72
355
|
Content(`
|
|
73
|
-
|
|
74
|
-
|
|
356
|
+
The operations available across these entities are ${opBold} — see each entity's
|
|
357
|
+
own list above for exactly which it supports.
|
|
75
358
|
|
|
76
359
|
`)
|
|
77
360
|
}
|
|
78
361
|
|
|
362
|
+
// 8. Quickstart in the other languages (lead is already covered above)
|
|
363
|
+
const otherTargets = sdkTargets.filter((t: any) => leadTarget && t.name !== leadTarget.name)
|
|
364
|
+
if (otherTargets.length > 0) {
|
|
365
|
+
Content(`## Quickstart in other languages
|
|
79
366
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
Every SDK call follows the same pipeline:
|
|
87
|
-
|
|
88
|
-
1. **Point** — resolve the API endpoint from the operation definition.
|
|
89
|
-
2. **Spec** — build the HTTP specification (URL, method, headers, body).
|
|
90
|
-
3. **Request** — send the HTTP request.
|
|
91
|
-
4. **Response** — receive and parse the response.
|
|
92
|
-
5. **Result** — extract the result data for the caller.
|
|
367
|
+
`)
|
|
368
|
+
otherTargets.forEach((tgt: any) => {
|
|
369
|
+
const Quick =
|
|
370
|
+
requirePath(ctx$, `./cmp/${tgt.name}/ReadmeTopQuick_${tgt.name}`, { ignore: true })
|
|
371
|
+
if (Quick) {
|
|
372
|
+
Content(`### ${tgt.title}
|
|
93
373
|
|
|
94
|
-
|
|
95
|
-
|
|
374
|
+
`)
|
|
375
|
+
Quick['ReadmeTopQuick']({ target: tgt })
|
|
376
|
+
Content(`
|
|
377
|
+
`)
|
|
378
|
+
}
|
|
379
|
+
})
|
|
380
|
+
}
|
|
96
381
|
|
|
97
|
-
|
|
382
|
+
// 9. Testing — keep, but slim
|
|
383
|
+
if (sdkTargets.length > 0) {
|
|
384
|
+
Content(`## Unit testing in offline mode
|
|
98
385
|
|
|
99
|
-
|
|
386
|
+
Every SDK ships a test mode that swaps the HTTP transport for an
|
|
387
|
+
in-memory mock, so unit tests run offline.
|
|
100
388
|
|
|
101
|
-
| Feature | Purpose |
|
|
102
|
-
| --- | --- |
|
|
103
389
|
`)
|
|
390
|
+
sdkTargets.forEach((tgt: any) => {
|
|
391
|
+
const Test =
|
|
392
|
+
requirePath(ctx$, `./cmp/${tgt.name}/ReadmeTopTest_${tgt.name}`, { ignore: true })
|
|
393
|
+
if (Test) {
|
|
394
|
+
Content(`### ${tgt.title}
|
|
104
395
|
|
|
105
|
-
each(feature, (feat: any) => {
|
|
106
|
-
if (!feat.active) return
|
|
107
|
-
const purpose = feat.title || feat.Name || feat.name
|
|
108
|
-
Content(`| **${feat.Name || feat.name}Feature** | ${purpose} |
|
|
109
396
|
`)
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
397
|
+
Test['ReadmeTopTest']({ target: tgt })
|
|
398
|
+
Content(`
|
|
399
|
+
`)
|
|
400
|
+
}
|
|
401
|
+
})
|
|
402
|
+
}
|
|
115
403
|
|
|
116
|
-
|
|
404
|
+
// 10. Direct and prepare — a common everyday task (the low-level
|
|
405
|
+
// escape hatch for endpoints the entity model doesn't cover).
|
|
406
|
+
Content(`## Direct and prepare
|
|
117
407
|
|
|
118
|
-
For endpoints
|
|
408
|
+
For endpoints the entity model doesn't cover, use the low-level methods:
|
|
119
409
|
|
|
120
410
|
- **\`direct(fetchargs)\`** — build and send an HTTP request in one step.
|
|
121
411
|
- **\`prepare(fetchargs)\`** — build the request without sending it.
|
|
122
412
|
|
|
123
|
-
Both accept a map with \`path\`, \`method\`, \`params\`, \`query\`,
|
|
124
|
-
and \`body\`.
|
|
413
|
+
Both accept a map with \`path\`, \`method\`, \`params\`, \`query\`,
|
|
414
|
+
\`headers\`, and \`body\`. See the [How-to guides](#how-to-guides) below.
|
|
125
415
|
|
|
126
416
|
`)
|
|
127
417
|
|
|
418
|
+
// 11. How-to guides — keep, useful for the engineer reader
|
|
419
|
+
Content(`## How-to guides
|
|
128
420
|
|
|
129
|
-
|
|
130
|
-
Content(`
|
|
131
|
-
## Quick start
|
|
132
|
-
|
|
133
|
-
`)
|
|
134
|
-
|
|
135
|
-
activeTargets.map((tgt: any) => {
|
|
136
|
-
const ReadmeTopQuick_sdk =
|
|
137
|
-
requirePath(ctx$, `./cmp/${tgt.name}/ReadmeTopQuick_${tgt.name}`, { ignore: true })
|
|
421
|
+
### Make a direct API call
|
|
138
422
|
|
|
139
|
-
|
|
140
|
-
Content(`### ${tgt.title}
|
|
423
|
+
When the entity interface does not cover an endpoint, use \`direct\`:
|
|
141
424
|
|
|
142
425
|
`)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
426
|
+
|
|
427
|
+
sdkTargets.forEach((tgt: any) => {
|
|
428
|
+
const Howto =
|
|
429
|
+
requirePath(ctx$, `./cmp/${tgt.name}/ReadmeTopHowto_${tgt.name}`, { ignore: true })
|
|
430
|
+
if (Howto) {
|
|
431
|
+
Howto['ReadmeTopHowto']({ target: tgt })
|
|
146
432
|
}
|
|
147
433
|
})
|
|
148
434
|
|
|
435
|
+
// 11b. Advanced — the pipeline model and feature hooks are internal
|
|
436
|
+
// machinery: useful when extending the SDK, but not part of everyday
|
|
437
|
+
// use, so they live below the task-focused sections above.
|
|
438
|
+
Content(`## Advanced
|
|
149
439
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
## Testing
|
|
440
|
+
> Everyday use only needs the sections above. This explains the internals
|
|
441
|
+
> behind every call — relevant when writing custom features.
|
|
153
442
|
|
|
154
|
-
|
|
155
|
-
in-memory mock, so tests run without a network connection.
|
|
443
|
+
Every SDK call runs the same five-stage pipeline:
|
|
156
444
|
|
|
157
|
-
|
|
445
|
+
1. **Point** — resolve the API endpoint from the operation definition.
|
|
446
|
+
2. **Spec** — build the HTTP specification (URL, method, headers, body).
|
|
447
|
+
3. **Request** — send the HTTP request.
|
|
448
|
+
4. **Response** — receive and parse the response.
|
|
449
|
+
5. **Result** — extract the result data for the caller.
|
|
158
450
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
451
|
+
A feature hook fires at each stage (e.g. \`PrePoint\`, \`PreSpec\`,
|
|
452
|
+
\`PreRequest\`), so features can inspect or modify the pipeline without
|
|
453
|
+
forking the SDK.
|
|
162
454
|
|
|
163
|
-
|
|
164
|
-
Content(`### ${tgt.title}
|
|
455
|
+
### Features
|
|
165
456
|
|
|
166
457
|
`)
|
|
167
|
-
|
|
168
|
-
|
|
458
|
+
|
|
459
|
+
Content(`| Feature | Purpose |
|
|
460
|
+
| --- | --- |
|
|
461
|
+
`)
|
|
462
|
+
each(feature, (feat: any) => {
|
|
463
|
+
if (!feat.active) return
|
|
464
|
+
const purpose = feat.title || feat.Name || feat.name
|
|
465
|
+
Content(`| **${feat.Name || feat.name}Feature** | ${purpose} |
|
|
169
466
|
`)
|
|
170
|
-
}
|
|
171
467
|
})
|
|
172
468
|
|
|
173
|
-
|
|
174
|
-
// How-to guides
|
|
175
469
|
Content(`
|
|
176
|
-
|
|
470
|
+
Pass custom features via the \`extend\` option at construction time.
|
|
177
471
|
|
|
178
|
-
|
|
472
|
+
`)
|
|
179
473
|
|
|
180
|
-
|
|
474
|
+
// 12. Per-language docs links
|
|
475
|
+
if (sdkTargets.length > 0) {
|
|
476
|
+
Content(`## Per-language documentation
|
|
181
477
|
|
|
182
478
|
`)
|
|
479
|
+
sdkTargets.forEach((tgt: any) => {
|
|
480
|
+
Content(`- [${tgt.title}](${tgt.name}/README.md)
|
|
481
|
+
`)
|
|
482
|
+
})
|
|
483
|
+
Content(`
|
|
484
|
+
`)
|
|
485
|
+
}
|
|
183
486
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
487
|
+
// 13. Upstream API — contact/servers from the OpenAPI info block
|
|
488
|
+
const upstreamUrl = (info.contact && info.contact.url)
|
|
489
|
+
|| (info.servers && info.servers[0] && info.servers[0].url)
|
|
490
|
+
|| homepage
|
|
491
|
+
if (upstreamUrl || docsUrl) {
|
|
492
|
+
Content(`## Upstream API
|
|
187
493
|
|
|
188
|
-
|
|
189
|
-
|
|
494
|
+
This SDK is generated from the upstream OpenAPI specification. It is an
|
|
495
|
+
unofficial client and is not affiliated with the API provider.
|
|
496
|
+
|
|
497
|
+
`)
|
|
498
|
+
if (upstreamUrl) {
|
|
499
|
+
Content(`- Upstream API: [${upstreamUrl}](${upstreamUrl})
|
|
500
|
+
`)
|
|
190
501
|
}
|
|
191
|
-
|
|
502
|
+
if (docsUrl && docsUrl !== upstreamUrl) {
|
|
503
|
+
Content(`- Documentation: [${docsUrl}](${docsUrl})
|
|
504
|
+
`)
|
|
505
|
+
}
|
|
506
|
+
Content(`
|
|
507
|
+
`)
|
|
508
|
+
}
|
|
192
509
|
|
|
510
|
+
// 13b. Security
|
|
511
|
+
Content(`## Security
|
|
193
512
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
## Language-specific documentation
|
|
513
|
+
Please report security issues to ${SECURITY_EMAIL}. See [SECURITY.md](SECURITY.md).
|
|
514
|
+
Do not open public issues for suspected vulnerabilities.
|
|
197
515
|
|
|
198
516
|
`)
|
|
199
517
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
`)
|
|
203
|
-
})
|
|
518
|
+
// 14. Provenance footer
|
|
519
|
+
Content(`---
|
|
204
520
|
|
|
205
|
-
|
|
521
|
+
Generated from the ${productName} OpenAPI spec by [@voxgig/sdkgen](${SDKGEN_REPO}).
|
|
206
522
|
`)
|
|
207
523
|
})
|
|
208
524
|
})
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { cmp, Content, File } from 'jostraca'
|
|
2
|
+
|
|
3
|
+
import { SECURITY_EMAIL, apiName, repoInfo } from '../helpers/packageMeta'
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
// Root SECURITY.md: a responsible-disclosure policy pointing at the Voxgig
|
|
7
|
+
// security contact, with the generated / unofficial disclosure inline.
|
|
8
|
+
const Security = cmp(function Security(props: any) {
|
|
9
|
+
const { ctx$ } = props
|
|
10
|
+
const { model } = ctx$
|
|
11
|
+
|
|
12
|
+
const { issuesUrl } = repoInfo(model)
|
|
13
|
+
|
|
14
|
+
File({ name: 'SECURITY.md' }, () => {
|
|
15
|
+
Content(`# Security Policy
|
|
16
|
+
|
|
17
|
+
## Reporting a vulnerability
|
|
18
|
+
|
|
19
|
+
Please report security issues to ${SECURITY_EMAIL}.
|
|
20
|
+
|
|
21
|
+
Do not open public GitHub issues for suspected vulnerabilities. We aim to
|
|
22
|
+
acknowledge reports within 3 business days.
|
|
23
|
+
|
|
24
|
+
For non-security bugs, use the issue tracker: ${issuesUrl}
|
|
25
|
+
|
|
26
|
+
## Scope
|
|
27
|
+
|
|
28
|
+
This policy applies to the generated Voxgig SDK packages published from this
|
|
29
|
+
repository (npm, PyPI, Packagist, RubyGems, LuaRocks, and the Go module).
|
|
30
|
+
|
|
31
|
+
This is an unofficial SDK for the ${apiName(model)} public API, generated by
|
|
32
|
+
Voxgig. It is not affiliated with, endorsed by, or sponsored by the upstream
|
|
33
|
+
API provider.
|
|
34
|
+
`)
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
Security
|
|
41
|
+
}
|