@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
|
@@ -8,322 +8,342 @@ import {
|
|
|
8
8
|
|
|
9
9
|
import { requirePath } from '../utility'
|
|
10
10
|
|
|
11
|
+
import { entityIdField, entityPrimaryOp } from '../helpers/opShape'
|
|
12
|
+
import { idLiteral, matchArg, dataArg } from '../helpers/opExample'
|
|
13
|
+
import type { ExampleLang } from '../helpers/opExample'
|
|
14
|
+
import { safeVarName } from '../helpers/naming'
|
|
11
15
|
|
|
12
|
-
const ReadmeExplanation = cmp(function ReadmeExplanation(props: any) {
|
|
13
|
-
const { target, ctx$ } = props
|
|
14
|
-
const { model } = ctx$
|
|
15
|
-
|
|
16
|
-
const feature = getModelPath(model, `main.${KIT}.feature`)
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
function cap(s: string): string {
|
|
18
|
+
return s.charAt(0).toUpperCase() + s.slice(1)
|
|
19
|
+
}
|
|
20
20
|
|
|
21
|
-
### The operation pipeline
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
// The four sections below differ by target language but share an identical
|
|
23
|
+
// structure, so the per-language prose lives in one table rather than in
|
|
24
|
+
// parallel if/else chains. Targets not listed here (ts, js, ...) use
|
|
25
|
+
// DEFAULT_LANG.
|
|
26
|
+
type LangExplain = {
|
|
27
|
+
featureKind: string // what a "feature" is in this language
|
|
28
|
+
// stateful-entity explanation + example, driven by the entity's PRIMARY op
|
|
29
|
+
// (`op`) — never a hardcoded `load` a create-only entity lacks. `arg` is the
|
|
30
|
+
// pre-rendered, language-correct call argument; `matchIdF` is the id key when
|
|
31
|
+
// the op is a match op (so the `.match()` comment shows `{ id: ... }`), else
|
|
32
|
+
// null (a generic comment).
|
|
33
|
+
entityState: (
|
|
34
|
+
eName: string, eLower: string,
|
|
35
|
+
op: string, arg: string,
|
|
36
|
+
matchIdF: string | null, idLit: string,
|
|
37
|
+
) => string
|
|
38
|
+
direct: string // direct/prepare explanation
|
|
39
|
+
}
|
|
25
40
|
|
|
26
|
-
\`\`\`
|
|
27
|
-
PrePoint \u2192 PreSpec \u2192 PreRequest \u2192 PreResponse \u2192 PreResult \u2192 PreDone
|
|
28
|
-
\`\`\`
|
|
29
41
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- **PreRequest**: Sends the HTTP request. Features can intercept here
|
|
35
|
-
to replace the transport (as TestFeature does with mocks).
|
|
36
|
-
- **PreResponse**: Parses the raw HTTP response.
|
|
37
|
-
- **PreResult**: Extracts the business data from the parsed response.
|
|
38
|
-
- **PreDone**: Final stage before returning to the caller. Entity
|
|
39
|
-
state (match, data) is updated here.
|
|
42
|
+
const DEFAULT_LANG: LangExplain = {
|
|
43
|
+
featureKind: `Features are the extension mechanism. A feature is an object with a
|
|
44
|
+
\`hooks\` map. Each hook key is a pipeline stage name, and the value is
|
|
45
|
+
a function that receives the context.
|
|
40
46
|
|
|
41
|
-
|
|
47
|
+
`,
|
|
48
|
+
entityState: (eName, eLower, op, arg, matchIdF, idLit) => `Entity instances are stateful. After a successful \`${op}\`, the entity
|
|
49
|
+
stores the returned data and match criteria internally. Subsequent
|
|
50
|
+
calls on the same instance can rely on this state.
|
|
42
51
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
error is returned to the caller as the second element in the return tuple.
|
|
52
|
+
\`\`\`ts
|
|
53
|
+
const ${eLower} = client.${eName}()
|
|
54
|
+
await ${eLower}.${op}(${arg})
|
|
47
55
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
Content(`If any stage returns an error, the pipeline short-circuits and the
|
|
52
|
-
error is returned to the caller as the second element in the return array.
|
|
56
|
+
// ${eLower}.data() now returns the ${eLower} data from the last \`${op}\`
|
|
57
|
+
${matchIdF ? `// ${eLower}.match() returns { ${matchIdF}: ${idLit} }` : `// ${eLower}.match() returns the last match criteria`}
|
|
58
|
+
\`\`\`
|
|
53
59
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
else if (target.name === 'rb') {
|
|
57
|
-
Content(`If any stage returns an error, the pipeline short-circuits and the
|
|
58
|
-
error is returned to the caller as a second return value.
|
|
60
|
+
Call \`make()\` to create a fresh instance with the same configuration
|
|
61
|
+
but no stored state.
|
|
59
62
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
`,
|
|
64
|
+
direct: `The \`direct\` method gives full control over the HTTP request. Use it
|
|
65
|
+
for non-standard endpoints, bulk operations, or any path not modelled
|
|
66
|
+
as an entity. The \`prepare\` method is useful for debugging — it
|
|
67
|
+
shows exactly what \`direct\` would send.
|
|
65
68
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
else if (target.name === 'go') {
|
|
69
|
-
Content(`If any stage returns an error, the pipeline short-circuits and the
|
|
70
|
-
error is returned to the caller. An unexpected panic triggers the
|
|
71
|
-
\`PreUnexpected\` hook.
|
|
69
|
+
`,
|
|
70
|
+
}
|
|
72
71
|
|
|
73
|
-
`)
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
Content(`If any stage returns an error, the pipeline short-circuits and the
|
|
77
|
-
error is returned to the caller.
|
|
78
72
|
|
|
79
|
-
|
|
80
|
-
|
|
73
|
+
const LANGS: Record<string, LangExplain> = {
|
|
74
|
+
py: {
|
|
75
|
+
featureKind: `Features are the extension mechanism. A feature is a Python class
|
|
76
|
+
with hook methods named after pipeline stages (e.g. \`PrePoint\`,
|
|
77
|
+
\`PreSpec\`). Each method receives the context.
|
|
81
78
|
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
`,
|
|
80
|
+
entityState: (eName, eLower, op, arg) => `Entity instances are stateful. After a successful \`${op}\`, the entity
|
|
81
|
+
stores the returned data and match criteria internally.
|
|
84
82
|
|
|
83
|
+
\`\`\`python
|
|
84
|
+
${eLower} = client.${eName}()
|
|
85
|
+
${eLower}.${op}(${arg})
|
|
85
86
|
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
# ${eLower}.data_get() now returns the ${eLower} data from the last ${op}
|
|
88
|
+
# ${eLower}.match_get() returns the last match criteria
|
|
89
|
+
\`\`\`
|
|
88
90
|
|
|
89
|
-
|
|
91
|
+
Call \`make()\` to create a fresh instance with the same configuration
|
|
92
|
+
but no stored state.
|
|
90
93
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
\`
|
|
94
|
+
`,
|
|
95
|
+
direct: `\`direct()\` gives full control over the HTTP request. Use it for
|
|
96
|
+
non-standard endpoints, bulk operations, or any path not modelled as
|
|
97
|
+
an entity. \`prepare()\` builds the request without sending it — useful
|
|
98
|
+
for debugging or custom transport.
|
|
95
99
|
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
else if (target.name === 'php') {
|
|
99
|
-
Content(`Features are the extension mechanism. A feature is a PHP class
|
|
100
|
-
with hook methods named after pipeline stages (e.g. \`PrePoint\`,
|
|
101
|
-
\`PreSpec\`). Each method receives the context.
|
|
100
|
+
`,
|
|
101
|
+
},
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
else if (target.name === 'rb') {
|
|
106
|
-
Content(`Features are the extension mechanism. A feature is a Ruby class
|
|
103
|
+
php: {
|
|
104
|
+
featureKind: `Features are the extension mechanism. A feature is a PHP class
|
|
107
105
|
with hook methods named after pipeline stages (e.g. \`PrePoint\`,
|
|
108
106
|
\`PreSpec\`). Each method receives the context.
|
|
109
107
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
Content(`Features are the extension mechanism. A feature is a Lua table
|
|
114
|
-
with hook methods named after pipeline stages (e.g. \`PrePoint\`,
|
|
115
|
-
\`PreSpec\`). Each method receives the context.
|
|
108
|
+
`,
|
|
109
|
+
entityState: (eName, eLower, op, arg) => `Entity instances are stateful. After a successful \`${op}\`, the entity
|
|
110
|
+
stores the returned data and match criteria internally.
|
|
116
111
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
Content(`Features are the extension mechanism. A feature implements the
|
|
121
|
-
\`Feature\` interface and provides hooks \u2014 functions keyed by pipeline
|
|
122
|
-
stage names.
|
|
112
|
+
\`\`\`php
|
|
113
|
+
$${eLower} = $client->${eName}();
|
|
114
|
+
$${eLower}->${op}(${arg});
|
|
123
115
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
Content(`Features are the extension mechanism. A feature is an object with a
|
|
128
|
-
\`hooks\` map. Each hook key is a pipeline stage name, and the value is
|
|
129
|
-
a function that receives the context.
|
|
116
|
+
// $${eLower}->data_get() now returns the ${eLower} data from the last ${op}
|
|
117
|
+
// $${eLower}->match_get() returns the last match criteria
|
|
118
|
+
\`\`\`
|
|
130
119
|
|
|
131
|
-
|
|
132
|
-
|
|
120
|
+
Call \`make()\` to create a fresh instance with the same configuration
|
|
121
|
+
but no stored state.
|
|
133
122
|
|
|
134
|
-
|
|
123
|
+
`,
|
|
124
|
+
direct: `\`direct()\` gives full control over the HTTP request. Use it for
|
|
125
|
+
non-standard endpoints, bulk operations, or any path not modelled as
|
|
126
|
+
an entity. \`prepare()\` builds the request without sending it — useful
|
|
127
|
+
for debugging or custom transport.
|
|
135
128
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
if (!feat.active) return
|
|
139
|
-
if (!feat.Name) names(feat, feat.name)
|
|
140
|
-
const purpose = feat.title || feat.Name || feat.name
|
|
141
|
-
Content(`- **${feat.Name}Feature**: ${purpose}
|
|
142
|
-
`)
|
|
143
|
-
})
|
|
129
|
+
`,
|
|
130
|
+
},
|
|
144
131
|
|
|
145
|
-
|
|
146
|
-
Features are
|
|
147
|
-
|
|
132
|
+
rb: {
|
|
133
|
+
featureKind: `Features are the extension mechanism. A feature is a Ruby class
|
|
134
|
+
with hook methods named after pipeline stages (e.g. \`PrePoint\`,
|
|
135
|
+
\`PreSpec\`). Each method receives the context.
|
|
148
136
|
|
|
149
|
-
|
|
137
|
+
`,
|
|
138
|
+
entityState: (eName, eLower, op, arg) => `Entity instances are stateful. After a successful \`${op}\`, the entity
|
|
139
|
+
stores the returned data and match criteria internally.
|
|
150
140
|
|
|
141
|
+
\`\`\`ruby
|
|
142
|
+
${eLower} = client.${eName}
|
|
143
|
+
${eLower}.${op}(${arg})
|
|
151
144
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
145
|
+
# ${eLower}.data_get now returns the ${eLower} data from the last ${op}
|
|
146
|
+
# ${eLower}.match_get returns the last match criteria
|
|
147
|
+
\`\`\`
|
|
155
148
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
149
|
+
Call \`make\` to create a fresh instance with the same configuration
|
|
150
|
+
but no stored state.
|
|
159
151
|
|
|
152
|
+
`,
|
|
153
|
+
direct: `\`direct\` gives full control over the HTTP request. Use it for
|
|
154
|
+
non-standard endpoints, bulk operations, or any path not modelled as
|
|
155
|
+
an entity. \`prepare\` builds the request without sending it — useful
|
|
156
|
+
for debugging or custom transport.
|
|
160
157
|
|
|
161
|
-
|
|
162
|
-
|
|
158
|
+
`,
|
|
159
|
+
},
|
|
163
160
|
|
|
164
|
-
|
|
161
|
+
lua: {
|
|
162
|
+
featureKind: `Features are the extension mechanism. A feature is a Lua table
|
|
163
|
+
with hook methods named after pipeline stages (e.g. \`PrePoint\`,
|
|
164
|
+
\`PreSpec\`). Each method receives the context.
|
|
165
165
|
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
`,
|
|
167
|
+
entityState: (eName, eLower, op, arg) => `Entity instances are stateful. After a successful \`${op}\`, the entity
|
|
168
168
|
stores the returned data and match criteria internally.
|
|
169
169
|
|
|
170
|
-
\`\`\`
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
\`\`\`lua
|
|
171
|
+
local ${eLower} = client:${eName}()
|
|
172
|
+
${eLower}:${op}(${arg})
|
|
173
173
|
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
-- ${eLower}:data_get() now returns the ${eLower} data from the last ${op}
|
|
175
|
+
-- ${eLower}:match_get() returns the last match criteria
|
|
176
176
|
\`\`\`
|
|
177
177
|
|
|
178
178
|
Call \`make()\` to create a fresh instance with the same configuration
|
|
179
179
|
but no stored state.
|
|
180
180
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
181
|
+
`,
|
|
182
|
+
direct: `\`direct()\` gives full control over the HTTP request. Use it for
|
|
183
|
+
non-standard endpoints, bulk operations, or any path not modelled as
|
|
184
|
+
an entity. \`prepare()\` builds the request without sending it — useful
|
|
185
|
+
for debugging or custom transport.
|
|
186
186
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
[$result, $err] = $moon->load(["planet_id" => "earth", "id" => "luna"]);
|
|
187
|
+
`,
|
|
188
|
+
},
|
|
190
189
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
Call \`make()\` to create a fresh instance with the same configuration
|
|
196
|
-
but no stored state.
|
|
190
|
+
go: {
|
|
191
|
+
featureKind: `Features are the extension mechanism. A feature implements the
|
|
192
|
+
\`Feature\` interface and provides hooks — functions keyed by pipeline
|
|
193
|
+
stage names.
|
|
197
194
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
else if (target.name === 'rb') {
|
|
201
|
-
Content(`Entity instances are stateful. After a successful \`load\`, the entity
|
|
195
|
+
`,
|
|
196
|
+
entityState: (eName, eLower, op, arg) => `Entity instances are stateful. After a successful \`${cap(op)}\`, the entity
|
|
202
197
|
stores the returned data and match criteria internally.
|
|
203
198
|
|
|
204
|
-
\`\`\`
|
|
205
|
-
|
|
206
|
-
|
|
199
|
+
\`\`\`go
|
|
200
|
+
${eLower} := client.${eName}(nil)
|
|
201
|
+
${eLower}.${cap(op)}(${arg}, nil)
|
|
207
202
|
|
|
208
|
-
|
|
209
|
-
|
|
203
|
+
// ${eLower}.Data() now returns the ${eLower} data from the last ${op}
|
|
204
|
+
// ${eLower}.Match() returns the last match criteria
|
|
210
205
|
\`\`\`
|
|
211
206
|
|
|
212
|
-
Call \`
|
|
207
|
+
Call \`Make()\` to create a fresh instance with the same configuration
|
|
213
208
|
but no stored state.
|
|
214
209
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
210
|
+
`,
|
|
211
|
+
direct: `\`Direct()\` gives full control over the HTTP request. Use it for
|
|
212
|
+
non-standard endpoints, bulk operations, or any path not modelled as
|
|
213
|
+
an entity. \`Prepare()\` builds the request without sending it — useful
|
|
214
|
+
for debugging or custom transport.
|
|
220
215
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
216
|
+
`,
|
|
217
|
+
},
|
|
218
|
+
}
|
|
224
219
|
|
|
225
|
-
-- moon:data_get() now returns the loaded moon data
|
|
226
|
-
-- moon:match_get() returns the last match criteria
|
|
227
|
-
\`\`\`
|
|
228
220
|
|
|
229
|
-
|
|
230
|
-
|
|
221
|
+
const ReadmeExplanation = cmp(function ReadmeExplanation(props: any) {
|
|
222
|
+
const { target, ctx$ } = props
|
|
223
|
+
const { model } = ctx$
|
|
231
224
|
|
|
232
|
-
`)
|
|
225
|
+
const feature = getModelPath(model, `main.${KIT}.feature`)
|
|
226
|
+
const lang = LANGS[target.name] || DEFAULT_LANG
|
|
227
|
+
|
|
228
|
+
// Derive a real example entity from the model (the same way the sibling
|
|
229
|
+
// Readme components do) so the entity-state example never references a
|
|
230
|
+
// phantom entity.
|
|
231
|
+
const entity = getModelPath(model, `main.${KIT}.entity`, { only_active: false, required: false })
|
|
232
|
+
const ex = Object.values(entity || {}).find((e: any) => e && e.active !== false) as any
|
|
233
|
+
const eName = ex ? (ex.Name || (ex.name[0].toUpperCase() + ex.name.slice(1))) : 'Entity'
|
|
234
|
+
// Sanitise against the target's reserved words (a `Delete` entity must not
|
|
235
|
+
// bind `const delete = ...`).
|
|
236
|
+
const eLower = safeVarName(eName.toLowerCase(), target.name)
|
|
237
|
+
const lname = target.name as ExampleLang
|
|
238
|
+
// The entity's id-like key field name, or null when it has none (a
|
|
239
|
+
// response-wrapped spec can model an entity with no id). Drives whether the
|
|
240
|
+
// state example keys on an id at all.
|
|
241
|
+
const idF = entityIdField(ex)
|
|
242
|
+
// The entity's PRIMARY op — an op it actually exposes (never a hardcoded
|
|
243
|
+
// `load` a create-only entity lacks).
|
|
244
|
+
const primaryOp = entityPrimaryOp(ex) || 'load'
|
|
245
|
+
const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
|
|
246
|
+
// Type-correct example id literal (numeric when the id param is integer-typed),
|
|
247
|
+
// derived from the OP's param type so an id carried only in the match compiles.
|
|
248
|
+
const idLit = idLiteral(ex, primaryOp, idF)
|
|
249
|
+
// Language-correct call argument for the primary op: a match for load/remove,
|
|
250
|
+
// a required-field body for create/update, nothing for list.
|
|
251
|
+
let stateArg: string
|
|
252
|
+
if ('list' === primaryOp) {
|
|
253
|
+
stateArg = 'go' === target.name ? 'nil' : ''
|
|
254
|
+
} else if (isMatchOp) {
|
|
255
|
+
stateArg = matchArg(lname, idF, idLit)
|
|
256
|
+
} else {
|
|
257
|
+
stateArg = dataArg(lname, ex, primaryOp, idF)
|
|
233
258
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
stores the returned data and match criteria internally.
|
|
259
|
+
// Only a match op keys the `.match()` comment on `{ id: ... }`.
|
|
260
|
+
const matchIdF = isMatchOp ? idF : null
|
|
237
261
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
moon.Load(map[string]any{"planet_id": "earth", "id": "luna"}, nil)
|
|
262
|
+
Content(`
|
|
263
|
+
## Advanced
|
|
241
264
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
265
|
+
> The sections above cover everyday use. The material below explains the
|
|
266
|
+
> SDK's internals — useful when extending it with custom features, but not
|
|
267
|
+
> needed for normal use.
|
|
245
268
|
|
|
246
|
-
|
|
247
|
-
but no stored state.
|
|
269
|
+
### The operation pipeline
|
|
248
270
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
else {
|
|
252
|
-
Content(`Entity instances are stateful. After a successful \`load\`, the entity
|
|
253
|
-
stores the returned data and match criteria internally. Subsequent
|
|
254
|
-
calls on the same instance can rely on this state.
|
|
271
|
+
Every entity operation follows a six-stage pipeline. Each stage fires a
|
|
272
|
+
feature hook before executing:
|
|
255
273
|
|
|
256
|
-
\`\`\`
|
|
257
|
-
|
|
258
|
-
await moon.load({ planet_id: 'earth', id: 'luna' })
|
|
259
|
-
|
|
260
|
-
// moon.data() now returns the loaded moon data
|
|
261
|
-
// moon.match() returns { planet_id: 'earth', id: 'luna' }
|
|
274
|
+
\`\`\`
|
|
275
|
+
PrePoint → PreSpec → PreRequest → PreResponse → PreResult → PreDone
|
|
262
276
|
\`\`\`
|
|
263
277
|
|
|
264
|
-
|
|
265
|
-
|
|
278
|
+
- **PrePoint**: Resolves which API endpoint to call based on the
|
|
279
|
+
operation name and entity configuration.
|
|
280
|
+
- **PreSpec**: Builds the HTTP spec — URL, method, headers, body —
|
|
281
|
+
from the resolved point and the caller's parameters.
|
|
282
|
+
- **PreRequest**: Sends the HTTP request. Features can intercept here
|
|
283
|
+
to replace the transport (as TestFeature does with mocks).
|
|
284
|
+
- **PreResponse**: Parses the raw HTTP response.
|
|
285
|
+
- **PreResult**: Extracts the business data from the parsed response.
|
|
286
|
+
- **PreDone**: Final stage before returning to the caller. Entity
|
|
287
|
+
state (match, data) is updated here.
|
|
266
288
|
|
|
267
|
-
|
|
268
|
-
|
|
289
|
+
If any stage errors, the pipeline short-circuits and the error surfaces
|
|
290
|
+
to the caller — see [Error handling](#error-handling) for how that looks
|
|
291
|
+
in this language.
|
|
269
292
|
|
|
293
|
+
`)
|
|
270
294
|
|
|
271
|
-
// Direct vs entity access
|
|
272
|
-
Content(`### Direct vs entity access
|
|
273
295
|
|
|
274
|
-
|
|
275
|
-
|
|
296
|
+
// Features and hooks
|
|
297
|
+
Content(`### Features and hooks
|
|
276
298
|
|
|
277
299
|
`)
|
|
278
300
|
|
|
279
|
-
|
|
280
|
-
Content(`\`direct()\` gives full control over the HTTP request. Use it for
|
|
281
|
-
non-standard endpoints, bulk operations, or any path not modelled as
|
|
282
|
-
an entity. \`prepare()\` builds the request without sending it \u2014 useful
|
|
283
|
-
for debugging or custom transport.
|
|
301
|
+
Content(lang.featureKind)
|
|
284
302
|
|
|
285
|
-
`
|
|
286
|
-
}
|
|
287
|
-
else if (target.name === 'php') {
|
|
288
|
-
Content(`\`direct()\` gives full control over the HTTP request. Use it for
|
|
289
|
-
non-standard endpoints, bulk operations, or any path not modelled as
|
|
290
|
-
an entity. \`prepare()\` builds the request without sending it \u2014 useful
|
|
291
|
-
for debugging or custom transport.
|
|
303
|
+
Content(`The SDK ships with built-in features:
|
|
292
304
|
|
|
293
305
|
`)
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
for debugging or custom transport.
|
|
300
|
-
|
|
306
|
+
each(feature, (feat: any) => {
|
|
307
|
+
if (!feat.active) return
|
|
308
|
+
if (!feat.Name) names(feat, feat.name)
|
|
309
|
+
const purpose = feat.title || feat.Name || feat.name
|
|
310
|
+
Content(`- **${feat.Name}Feature**: ${purpose}
|
|
301
311
|
`)
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
for debugging or custom transport.
|
|
312
|
+
})
|
|
313
|
+
|
|
314
|
+
Content(`
|
|
315
|
+
Features are initialized in order. Hooks fire in the order features
|
|
316
|
+
were added, so later features can override earlier ones.
|
|
308
317
|
|
|
309
318
|
`)
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
// Target-specific explanation
|
|
322
|
+
const ReadmeExplanation_sdk =
|
|
323
|
+
requirePath(ctx$, `./cmp/${target.name}/ReadmeExplanation_${target.name}`, { ignore: true })
|
|
324
|
+
|
|
325
|
+
if (ReadmeExplanation_sdk) {
|
|
326
|
+
ReadmeExplanation_sdk['ReadmeExplanation']({ target })
|
|
310
327
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
for debugging or custom transport.
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
// Entity state
|
|
331
|
+
Content(`### Entity state
|
|
316
332
|
|
|
317
333
|
`)
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
334
|
+
|
|
335
|
+
Content(lang.entityState(eName, eLower, primaryOp, stateArg, matchIdF, idLit))
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
// Direct vs entity access
|
|
339
|
+
Content(`### Direct vs entity access
|
|
340
|
+
|
|
341
|
+
The entity interface handles URL construction, parameter placement,
|
|
342
|
+
and response parsing automatically. Use it for standard CRUD operations.
|
|
324
343
|
|
|
325
344
|
`)
|
|
326
|
-
|
|
345
|
+
|
|
346
|
+
Content(lang.direct)
|
|
327
347
|
|
|
328
348
|
})
|
|
329
349
|
|
package/src/cmp/ReadmeModel.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, each, Content } from 'jostraca'
|
|
2
|
+
import { cmp, each, names, Content } from 'jostraca'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -13,6 +13,10 @@ const ReadmeModel = cmp(function ReadmeModel(props: any) {
|
|
|
13
13
|
const { target, ctx$ } = props
|
|
14
14
|
const { model } = ctx$
|
|
15
15
|
|
|
16
|
+
// Guard the Name case variant so the reference header never renders
|
|
17
|
+
// "undefinedSDK" if apidef did not populate it.
|
|
18
|
+
if (model.name && !model.Name) names(model, model.name)
|
|
19
|
+
|
|
16
20
|
const entity = getModelPath(model, `main.${KIT}.entity`)
|
|
17
21
|
const entityList = each(entity).filter((e: any) => e.active !== false)
|
|
18
22
|
|
|
@@ -60,7 +64,8 @@ ${apikeyRow}| \`base\` | \`string\` | Base URL of the API server. |
|
|
|
60
64
|
`)
|
|
61
65
|
|
|
62
66
|
each(entityList, (ent: any) => {
|
|
63
|
-
|
|
67
|
+
const article = /^[aeiou]/i.test(ent.Name) ? 'an' : 'a'
|
|
68
|
+
Content(`| \`${ent.Name}(data?)\` | \`${ent.Name}Entity\` | Create ${article} ${ent.Name} entity instance. |
|
|
64
69
|
`)
|
|
65
70
|
})
|
|
66
71
|
|