@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
|
@@ -144,16 +144,23 @@ class ProjectNameSDK:
|
|
|
144
144
|
|
|
145
145
|
_, err = utility.prepare_auth(ctx)
|
|
146
146
|
if err is not None:
|
|
147
|
-
|
|
147
|
+
raise err
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
fetchdef, err = utility.make_fetch_def(ctx)
|
|
150
|
+
if err is not None:
|
|
151
|
+
raise err
|
|
152
|
+
|
|
153
|
+
return fetchdef
|
|
150
154
|
|
|
151
155
|
def direct(self, fetchargs=None):
|
|
152
156
|
utility = self._utility
|
|
153
157
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
158
|
+
try:
|
|
159
|
+
fetchdef = self.prepare(fetchargs)
|
|
160
|
+
except Exception as err:
|
|
161
|
+
# direct() is the raw-HTTP escape hatch: it never raises, it
|
|
162
|
+
# returns a result object callers branch on via result["ok"].
|
|
163
|
+
return {"ok": False, "err": err}
|
|
157
164
|
|
|
158
165
|
if fetchargs is None:
|
|
159
166
|
fetchargs = {}
|
|
@@ -170,13 +177,13 @@ class ProjectNameSDK:
|
|
|
170
177
|
fetched, fetch_err = utility.fetcher(ctx, url, fetchdef)
|
|
171
178
|
|
|
172
179
|
if fetch_err is not None:
|
|
173
|
-
return {"ok": False, "err": fetch_err}
|
|
180
|
+
return {"ok": False, "err": fetch_err}
|
|
174
181
|
|
|
175
182
|
if fetched is None:
|
|
176
183
|
return {
|
|
177
184
|
"ok": False,
|
|
178
185
|
"err": ctx.make_error("direct_no_response", "response: undefined"),
|
|
179
|
-
}
|
|
186
|
+
}
|
|
180
187
|
|
|
181
188
|
if isinstance(fetched, dict):
|
|
182
189
|
status = helpers.to_int(vs.getprop(fetched, "status"))
|
|
@@ -205,17 +212,17 @@ class ProjectNameSDK:
|
|
|
205
212
|
"status": status,
|
|
206
213
|
"headers": headers,
|
|
207
214
|
"data": json_data,
|
|
208
|
-
}
|
|
215
|
+
}
|
|
209
216
|
|
|
210
217
|
return {
|
|
211
218
|
"ok": False,
|
|
212
219
|
"err": ctx.make_error("direct_invalid", "invalid response type"),
|
|
213
|
-
}
|
|
220
|
+
}
|
|
214
221
|
|
|
215
222
|
# <[SLOT]>
|
|
216
223
|
|
|
217
224
|
@classmethod
|
|
218
|
-
def test(cls, testopts=None, sdkopts=None):
|
|
225
|
+
def test(cls, testopts=None, sdkopts=None) -> "ProjectNameSDK":
|
|
219
226
|
if sdkopts is None:
|
|
220
227
|
sdkopts = {}
|
|
221
228
|
sdkopts = vs.clone(sdkopts)
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
cmp,
|
|
11
11
|
each,
|
|
12
12
|
isAuthActive,
|
|
13
|
+
resolveAuthPrefix,
|
|
13
14
|
} from '@voxgig/sdkgen'
|
|
14
15
|
|
|
15
16
|
|
|
@@ -39,8 +40,8 @@ const Config = cmp(async function Config(props: any) {
|
|
|
39
40
|
const headers = getModelPath(model, `main.${KIT}.config.headers`) || {}
|
|
40
41
|
|
|
41
42
|
const authActive = isAuthActive(model)
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
// config.auth.prefix override -> spec-derived info.security.prefix -> 'Bearer'
|
|
44
|
+
const authPrefix = resolveAuthPrefix(model)
|
|
44
45
|
|
|
45
46
|
let baseUrl = ''
|
|
46
47
|
try { baseUrl = getModelPath(model, `main.${KIT}.info.servers.0.url`) } catch (_e) { }
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
// Typed-model generator (Ruby target).
|
|
4
|
+
//
|
|
5
|
+
// Ported from the TypeScript reference EntityTypes_ts.ts. Reads
|
|
6
|
+
// main.<KIT>.entity.<e>.fields[] and per-op params (op.<name>.points[].args.params[])
|
|
7
|
+
// and emits one file, <Sdk>_types.rb, containing a keyword-init Struct per active
|
|
8
|
+
// entity plus a request/match Struct per active op. Ruby has no enforced static
|
|
9
|
+
// types, so each member carries a YARD `@!attribute`/`@return` annotation whose
|
|
10
|
+
// element type comes from the canonical sentinels via the shared sdkgen helper
|
|
11
|
+
// `canonToType` (source of truth: @voxgig/apidef VALID_CANON):
|
|
12
|
+
// $STRING -> String, $INTEGER -> Integer, $NUMBER -> Float, $BOOLEAN -> Boolean,
|
|
13
|
+
// $OBJECT -> Hash, $ARRAY -> Array, unknown -> Object.
|
|
14
|
+
//
|
|
15
|
+
// Type-name scheme (IDENTICAL to TS): data type = <Name>; per-op request
|
|
16
|
+
// <Name>LoadMatch / <Name>ListMatch / <Name>RemoveMatch (query/id ops),
|
|
17
|
+
// <Name>CreateData / <Name>UpdateData (body ops). An op WITH params -> a Struct of
|
|
18
|
+
// those params (reqd:false -> annotated `[Type, nil]`). An op WITHOUT params -> a
|
|
19
|
+
// Struct over the entity fields (Struct members are always optional/nil, so this is
|
|
20
|
+
// the Ruby stand-in for TS `Partial<Name>`; callers may equally pass a plain Hash).
|
|
21
|
+
//
|
|
22
|
+
// Struct.new(keyword_init: true) gives value objects usable as `Advice.new(id: ...)`.
|
|
23
|
+
// The file is required by the main SDK module so these constants are always loaded.
|
|
24
|
+
|
|
25
|
+
import {
|
|
26
|
+
cmp, each,
|
|
27
|
+
File, Content,
|
|
28
|
+
} from '@voxgig/sdkgen'
|
|
29
|
+
|
|
30
|
+
import { canonToType, opTypeName, opRequestShape } from '@voxgig/sdkgen'
|
|
31
|
+
|
|
32
|
+
import {
|
|
33
|
+
KIT,
|
|
34
|
+
getModelPath,
|
|
35
|
+
} from '@voxgig/apidef'
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
const LANG = 'rb'
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
// A Ruby symbol literal for a member name: bare for identifiers, quoted otherwise.
|
|
42
|
+
function symName(name: string): string {
|
|
43
|
+
return /^[A-Za-z_][A-Za-z0-9_]*[?!=]?$/.test(name) ? ':' + name : ':"' + name + '"'
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
// Emit one typed value class: a YARD @!attribute block plus a keyword-init
|
|
48
|
+
// Struct. Ruby's `Struct.new` rejects zero members, so an empty shape falls
|
|
49
|
+
// back to a plain empty class (keeps the type name available).
|
|
50
|
+
function emitStruct(
|
|
51
|
+
typeName: string,
|
|
52
|
+
doc: string,
|
|
53
|
+
members: Array<{ name: string, type: unknown, optional: boolean }>,
|
|
54
|
+
) {
|
|
55
|
+
let block = `# ${doc}\n`
|
|
56
|
+
|
|
57
|
+
members.forEach((m) => {
|
|
58
|
+
const t = canonToType(m.type, LANG)
|
|
59
|
+
const ret = m.optional ? `[${t}, nil]` : `[${t}]`
|
|
60
|
+
block += `#\n# @!attribute [rw] ${m.name}\n# @return ${ret}\n`
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
if (0 === members.length) {
|
|
64
|
+
block += `class ${typeName}\nend\n\n`
|
|
65
|
+
Content(block)
|
|
66
|
+
return
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
block += `${typeName} = Struct.new(\n`
|
|
70
|
+
members.forEach((m) => {
|
|
71
|
+
block += ` ${symName(m.name)},\n`
|
|
72
|
+
})
|
|
73
|
+
block += ` keyword_init: true\n)\n\n`
|
|
74
|
+
|
|
75
|
+
Content(block)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
const EntityTypes = cmp(function EntityTypes(props: any) {
|
|
80
|
+
const { model } = props.ctx$
|
|
81
|
+
|
|
82
|
+
const entity = getModelPath(model, `main.${KIT}.entity`)
|
|
83
|
+
const entityList = each(entity).filter((e: any) => e.active !== false)
|
|
84
|
+
|
|
85
|
+
File({ name: model.const.Name + '_types.' + LANG }, () => {
|
|
86
|
+
|
|
87
|
+
Content(`# frozen_string_literal: true
|
|
88
|
+
|
|
89
|
+
# Typed models for the ${model.const.Name} SDK.
|
|
90
|
+
#
|
|
91
|
+
# GENERATED from the API model: main.${KIT}.entity.<e>.fields[] and per-op
|
|
92
|
+
# params (op.<name>.points[].args.params[]). Member types come from the
|
|
93
|
+
# canonical type sentinels via @voxgig/sdkgen canonToType (source of truth:
|
|
94
|
+
# @voxgig/apidef VALID_CANON). Ruby types are unenforced; these YARD
|
|
95
|
+
# annotations document the shapes. Do not edit by hand.
|
|
96
|
+
|
|
97
|
+
`)
|
|
98
|
+
|
|
99
|
+
entityList.forEach((ent: any) => {
|
|
100
|
+
const Name = ent.Name
|
|
101
|
+
const fields = (ent.fields ? each(ent.fields) : [])
|
|
102
|
+
.filter((f: any) => f.active !== false)
|
|
103
|
+
|
|
104
|
+
// Entity data model: one member per field (`req:false` -> nilable).
|
|
105
|
+
emitStruct(
|
|
106
|
+
Name,
|
|
107
|
+
`${Name} entity data model.`,
|
|
108
|
+
fields.map((f: any) => ({ name: f.name, type: f.type, optional: false === f.req })),
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
// Per active op: a request/match Struct. Members and their optionality
|
|
112
|
+
// come from the shared partiality policy (opRequestShape); this file only
|
|
113
|
+
// renders them as a keyword-init Struct.
|
|
114
|
+
const ops = ent.op || {}
|
|
115
|
+
;['load', 'list', 'create', 'update', 'remove'].forEach((opname: string) => {
|
|
116
|
+
if (null == ops[opname]) {
|
|
117
|
+
return
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const typeName = opTypeName(Name, opname)
|
|
121
|
+
const { items } = opRequestShape(ent, opname)
|
|
122
|
+
|
|
123
|
+
emitStruct(
|
|
124
|
+
typeName,
|
|
125
|
+
`Request payload for ${Name}#${opname}.`,
|
|
126
|
+
items,
|
|
127
|
+
)
|
|
128
|
+
})
|
|
129
|
+
})
|
|
130
|
+
})
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
export {
|
|
135
|
+
EntityTypes,
|
|
136
|
+
}
|
|
@@ -8,6 +8,7 @@ const MainEntity = cmp(async function MainEntity(props: any) {
|
|
|
8
8
|
const { model } = props.ctx$
|
|
9
9
|
|
|
10
10
|
Content(`
|
|
11
|
+
# Canonical facade: client.${entity.Name}.list / client.${entity.Name}.load({ "id" => ... })
|
|
11
12
|
def ${entity.Name}(data = nil)
|
|
12
13
|
require_relative 'entity/${entity.name}_entity'
|
|
13
14
|
${entity.Name}Entity.new(self, data)
|
|
@@ -22,6 +22,7 @@ import { Package } from './Package_rb'
|
|
|
22
22
|
import { Config } from './Config_rb'
|
|
23
23
|
import { Gitignore } from './Gitignore_rb'
|
|
24
24
|
import { MainEntity } from './MainEntity_rb'
|
|
25
|
+
import { EntityTypes } from './EntityTypes_rb'
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
const Main = cmp(async function Main(props: any) {
|
|
@@ -84,6 +85,9 @@ utility.feature_hook.call(@_rootctx, "${name}")
|
|
|
84
85
|
Config({ target })
|
|
85
86
|
})
|
|
86
87
|
|
|
88
|
+
// Generate typed models (<Sdk>_types.rb) — required by the main SDK file.
|
|
89
|
+
EntityTypes({ target })
|
|
90
|
+
|
|
87
91
|
// Generate feature factory module
|
|
88
92
|
File({ name: 'features.' + target.ext }, () => {
|
|
89
93
|
Content(`# ${model.const.Name} SDK feature factory
|
|
@@ -4,6 +4,8 @@ import {
|
|
|
4
4
|
File,
|
|
5
5
|
cmp,
|
|
6
6
|
collectDeps,
|
|
7
|
+
pkgDescription,
|
|
8
|
+
repoInfo,
|
|
7
9
|
} from '@voxgig/sdkgen'
|
|
8
10
|
|
|
9
11
|
|
|
@@ -24,6 +26,7 @@ const Package = cmp(async function Package(props: any) {
|
|
|
24
26
|
const ns = model.origin || 'voxgig-sdk'
|
|
25
27
|
const pkgBase = ns.endsWith('-sdk') ? model.name : `${model.name}-sdk`
|
|
26
28
|
const gemName = `${ns}-${pkgBase}`
|
|
29
|
+
const { repoUrl, issuesUrl, changelogUrl } = repoInfo(model)
|
|
27
30
|
|
|
28
31
|
const versionOf = (d: { version: string; source: 'feature' | 'target' }) =>
|
|
29
32
|
d.source === 'target' ? (d.version || '0.0') : d.version
|
|
@@ -44,23 +47,47 @@ gemspec
|
|
|
44
47
|
|
|
45
48
|
// Generate gemspec
|
|
46
49
|
File({ name: model.const.Name + '_sdk.gemspec' }, () => {
|
|
50
|
+
// RubyGems rejects a gemspec that declares the same runtime dependency
|
|
51
|
+
// twice (Gem::InvalidSpecificationException at `gem build`), so the
|
|
52
|
+
// unconstrained json fallback is only emitted when the model's own
|
|
53
|
+
// dependency list doesn't already declare json.
|
|
54
|
+
const deps = collectDeps(model, target.name, target.deps)
|
|
55
|
+
const hasJson = deps.some((d: any) => 'json' === d.name)
|
|
56
|
+
|
|
47
57
|
Content(`Gem::Specification.new do |spec|
|
|
48
58
|
spec.name = "${gemName}"
|
|
49
59
|
spec.version = "0.0.1"
|
|
50
60
|
spec.authors = ["Voxgig"]
|
|
51
|
-
spec.summary = "${model
|
|
61
|
+
spec.summary = "${pkgDescription(model, 'rb')}"
|
|
62
|
+
spec.description = "${pkgDescription(model, 'rb')}"
|
|
52
63
|
spec.license = "MIT"
|
|
53
|
-
spec.homepage = "
|
|
54
|
-
|
|
55
|
-
|
|
64
|
+
spec.homepage = "${repoUrl}"
|
|
65
|
+
spec.metadata = {
|
|
66
|
+
"homepage_uri" => "${repoUrl}",
|
|
67
|
+
"source_code_uri" => "${repoUrl}",
|
|
68
|
+
"bug_tracker_uri" => "${issuesUrl}",
|
|
69
|
+
"changelog_uri" => "${changelogUrl}",
|
|
70
|
+
"rubygems_mfa_required" => "true"
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
spec.files = Dir[
|
|
74
|
+
"*.rb",
|
|
75
|
+
"core/**/*.rb",
|
|
76
|
+
"entity/**/*.rb",
|
|
77
|
+
"feature/**/*.rb",
|
|
78
|
+
"utility/**/*.rb",
|
|
79
|
+
"LICENSE",
|
|
80
|
+
"README.md",
|
|
81
|
+
"REFERENCE.md"
|
|
82
|
+
]
|
|
56
83
|
spec.require_paths = ["."]
|
|
57
84
|
|
|
58
85
|
spec.required_ruby_version = ">= 3.0"
|
|
59
|
-
|
|
86
|
+
${hasJson ? '' : `
|
|
60
87
|
spec.add_dependency "json"
|
|
61
|
-
`)
|
|
88
|
+
`}`)
|
|
62
89
|
|
|
63
|
-
for (const d of
|
|
90
|
+
for (const d of deps) {
|
|
64
91
|
Content(` spec.add_dependency "${d.name}", "~> ${versionOf(d)}"
|
|
65
92
|
`)
|
|
66
93
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, each, Content } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, each, Content, canonToType, canonKey, entityIdField, opRequestShape } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -7,6 +7,19 @@ import {
|
|
|
7
7
|
} from '@voxgig/apidef'
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
// A type-correct Ruby literal for a field's canonical type — the create body
|
|
11
|
+
// is EXECUTED by the doc test, so it must carry a real value per field.
|
|
12
|
+
// Strings render the quoted placeholder.
|
|
13
|
+
function rbLit(type: any, placeholder: string = 'example'): string {
|
|
14
|
+
const k = canonKey(type)
|
|
15
|
+
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
16
|
+
if ('BOOLEAN' === k) return 'true'
|
|
17
|
+
if ('ARRAY' === k) return '[]'
|
|
18
|
+
if ('OBJECT' === k) return '{}'
|
|
19
|
+
return `"${placeholder}"`
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
10
23
|
// Operation method spelling differs between Go and other languages — Go
|
|
11
24
|
// uses PascalCase methods with explicit ctrl arg, others use lowercase
|
|
12
25
|
// methods with optional ctrl. The op descriptions are language-agnostic.
|
|
@@ -41,6 +54,8 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
|
41
54
|
publishedEntities.map((entity: any) => {
|
|
42
55
|
const opnames = Object.keys(entity.op || {})
|
|
43
56
|
const fields = entity.fields || []
|
|
57
|
+
// Model-driven id key: null when this entity has no id-like field.
|
|
58
|
+
const idF = entityIdField(entity)
|
|
44
59
|
|
|
45
60
|
Content(`
|
|
46
61
|
### ${entity.Name}
|
|
@@ -53,7 +68,7 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
|
53
68
|
`)
|
|
54
69
|
}
|
|
55
70
|
|
|
56
|
-
Content(`Create an instance:
|
|
71
|
+
Content(`Create an instance: \`${entity.name} = client.${entity.Name}\`
|
|
57
72
|
|
|
58
73
|
`)
|
|
59
74
|
|
|
@@ -84,7 +99,7 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
|
84
99
|
|
|
85
100
|
each(fields, (field: any) => {
|
|
86
101
|
const desc = field.short || ''
|
|
87
|
-
Content(`| \`${field.name}\` | \`${field.type
|
|
102
|
+
Content(`| \`${field.name}\` | \`${canonToType(field.type, target.name)}\` | ${desc} |
|
|
88
103
|
`)
|
|
89
104
|
})
|
|
90
105
|
|
|
@@ -93,10 +108,23 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
|
93
108
|
}
|
|
94
109
|
|
|
95
110
|
if (opnames.includes('load')) {
|
|
111
|
+
// The id key plus every REQUIRED match key (parent path params like
|
|
112
|
+
// page_id) — the same shape the runtime resolves path params from, so
|
|
113
|
+
// the example always works.
|
|
114
|
+
const loadItems = opRequestShape(entity, 'load').items
|
|
115
|
+
.filter((it: any) => !it.optional || it.name === idF)
|
|
116
|
+
.sort((a: any, b: any) =>
|
|
117
|
+
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
118
|
+
const loadArg = 0 < loadItems.length
|
|
119
|
+
? `{ ${loadItems.map((it: any) =>
|
|
120
|
+
`"${it.name}" => ${rbLit(it.type,
|
|
121
|
+
it.name === idF ? entity.name + '_id' : it.name)}`).join(', ')} }`
|
|
122
|
+
: ''
|
|
96
123
|
Content(`#### Example: Load
|
|
97
124
|
|
|
98
|
-
\`\`\`
|
|
99
|
-
|
|
125
|
+
\`\`\`ruby
|
|
126
|
+
# load returns the bare ${entity.Name} record (raises on error).
|
|
127
|
+
${entity.name} = client.${entity.Name}.load(${loadArg})
|
|
100
128
|
\`\`\`
|
|
101
129
|
|
|
102
130
|
`)
|
|
@@ -105,24 +133,30 @@ const ${entity.name} = await client.${entity.Name}().load({ id: '${entity.name}_
|
|
|
105
133
|
if (opnames.includes('list')) {
|
|
106
134
|
Content(`#### Example: List
|
|
107
135
|
|
|
108
|
-
\`\`\`
|
|
109
|
-
|
|
136
|
+
\`\`\`ruby
|
|
137
|
+
# list returns an Array of ${entity.Name} records (raises on error).
|
|
138
|
+
${entity.name}s = client.${entity.Name}.list
|
|
110
139
|
\`\`\`
|
|
111
140
|
|
|
112
141
|
`)
|
|
113
142
|
}
|
|
114
143
|
|
|
115
144
|
if (opnames.includes('create')) {
|
|
145
|
+
// Members come from the SAME shape the runtime validates
|
|
146
|
+
// (opRequestShape): every required member must appear — including a
|
|
147
|
+
// required id and parent keys like page_id — with a real, executable
|
|
148
|
+
// literal (the doc test RUNS this block, so a comment placeholder
|
|
149
|
+
// would break it).
|
|
150
|
+
const createItems = opRequestShape(entity, 'create').items
|
|
151
|
+
.filter((it: any) => !it.optional)
|
|
116
152
|
Content(`#### Example: Create
|
|
117
153
|
|
|
118
|
-
\`\`\`
|
|
119
|
-
|
|
154
|
+
\`\`\`ruby
|
|
155
|
+
${entity.name} = client.${entity.Name}.create({
|
|
120
156
|
`)
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
Content(` ${field.name}: /* ${field.type || 'value'} */,
|
|
157
|
+
createItems.map((it: any) => {
|
|
158
|
+
Content(` "${it.name}" => ${rbLit(it.type, 'example_' + it.name)}, # ${canonToType(it.type, target.name)}
|
|
124
159
|
`)
|
|
125
|
-
}
|
|
126
160
|
})
|
|
127
161
|
Content(`})
|
|
128
162
|
\`\`\`
|