@voxgig/sdkgen 1.2.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/voxgig-sdkgen +2 -2
- package/dist/action/action.d.ts +2 -1
- package/dist/action/action.js +15 -9
- package/dist/action/action.js.map +1 -1
- package/dist/action/feature.js +6 -3
- package/dist/action/feature.js.map +1 -1
- package/dist/action/target.d.ts +7 -1
- package/dist/action/target.js +13 -6
- package/dist/action/target.js.map +1 -1
- package/dist/cmp/Changelog.d.ts +2 -0
- package/dist/cmp/Changelog.js +30 -0
- package/dist/cmp/Changelog.js.map +1 -0
- package/dist/cmp/Deploy.d.ts +2 -0
- package/dist/cmp/Deploy.js +227 -0
- package/dist/cmp/Deploy.js.map +1 -0
- package/dist/cmp/FeatureHook.js +5 -6
- package/dist/cmp/FeatureHook.js.map +1 -1
- package/dist/cmp/License.d.ts +2 -0
- package/dist/cmp/License.js +44 -0
- package/dist/cmp/License.js.map +1 -0
- package/dist/cmp/Readme.js +2 -0
- package/dist/cmp/Readme.js.map +1 -1
- package/dist/cmp/ReadmeErrors.d.ts +2 -0
- package/dist/cmp/ReadmeErrors.js +210 -0
- package/dist/cmp/ReadmeErrors.js.map +1 -0
- package/dist/cmp/ReadmeExplanation.js +213 -223
- package/dist/cmp/ReadmeExplanation.js.map +1 -1
- package/dist/cmp/ReadmeModel.js +6 -1
- package/dist/cmp/ReadmeModel.js.map +1 -1
- package/dist/cmp/ReadmeTop.js +389 -82
- package/dist/cmp/ReadmeTop.js.map +1 -1
- package/dist/cmp/Security.d.ts +2 -0
- package/dist/cmp/Security.js +36 -0
- package/dist/cmp/Security.js.map +1 -0
- package/dist/helpers/canonType.d.ts +7 -0
- package/dist/helpers/canonType.js +74 -0
- package/dist/helpers/canonType.js.map +1 -0
- package/dist/helpers/collectDeps.d.ts +3 -2
- package/dist/helpers/collectDeps.js.map +1 -1
- package/dist/helpers/naming.d.ts +3 -0
- package/dist/helpers/naming.js +51 -0
- package/dist/helpers/naming.js.map +1 -0
- package/dist/helpers/opExample.d.ts +13 -0
- package/dist/helpers/opExample.js +149 -0
- package/dist/helpers/opExample.js.map +1 -0
- package/dist/helpers/opShape.d.ts +18 -0
- package/dist/helpers/opShape.js +193 -0
- package/dist/helpers/opShape.js.map +1 -0
- package/dist/helpers/packageMeta.d.ts +27 -0
- package/dist/helpers/packageMeta.js +224 -0
- package/dist/helpers/packageMeta.js.map +1 -0
- package/dist/sdkgen.d.ts +11 -1
- package/dist/sdkgen.js +57 -18
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +65 -2
- package/dist/types.js.map +1 -1
- package/dist/utility.js +20 -11
- package/dist/utility.js.map +1 -1
- package/model/sdkgen.aontu +137 -0
- package/package.json +13 -6
- package/project/.sdk/model/target/go-cli.jsonic +47 -0
- package/project/.sdk/model/target/go-mcp.jsonic +41 -0
- package/project/.sdk/model/target/go.jsonic +9 -3
- package/project/.sdk/model/target/js.jsonic +13 -0
- package/project/.sdk/model/target/lua.jsonic +13 -0
- package/project/.sdk/model/target/php.jsonic +13 -0
- package/project/.sdk/model/target/py.jsonic +13 -0
- package/project/.sdk/model/target/rb.jsonic +13 -0
- package/project/.sdk/model/target/ts.jsonic +13 -0
- package/project/.sdk/src/cmp/go/EntityOperation_go.ts +1 -0
- package/project/.sdk/src/cmp/go/EntityTypes_go.ts +197 -0
- package/project/.sdk/src/cmp/go/Entity_go.ts +2 -1
- package/project/.sdk/src/cmp/go/MainEntity_go.ts +6 -0
- package/project/.sdk/src/cmp/go/Main_go.ts +23 -3
- package/project/.sdk/src/cmp/go/Package_go.ts +1 -1
- package/project/.sdk/src/cmp/go/ReadmeEntity_go.ts +18 -6
- package/project/.sdk/src/cmp/go/ReadmeExamplesTest_go.ts +684 -0
- package/project/.sdk/src/cmp/go/ReadmeExplanation_go.ts +1 -1
- package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +48 -8
- package/project/.sdk/src/cmp/go/ReadmeInstall_go.ts +11 -6
- package/project/.sdk/src/cmp/go/ReadmeIntro_go.ts +40 -1
- package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +63 -17
- package/project/.sdk/src/cmp/go/ReadmeOptions_go.ts +4 -3
- package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +124 -115
- package/project/.sdk/src/cmp/go/ReadmeRef_go.ts +28 -15
- package/project/.sdk/src/cmp/go/ReadmeTopQuick_go.ts +33 -9
- package/project/.sdk/src/cmp/go/ReadmeTopTest_go.ts +35 -5
- package/project/.sdk/src/cmp/go/TestEntity_go.ts +1 -1
- package/project/.sdk/src/cmp/go/Test_go.ts +5 -1
- package/project/.sdk/src/cmp/go/fragment/Entity.fragment.go +21 -0
- package/project/.sdk/src/cmp/go/fragment/EntityCreateOp.fragment.go +11 -0
- package/project/.sdk/src/cmp/go/fragment/EntityListOp.fragment.go +11 -0
- package/project/.sdk/src/cmp/go/fragment/EntityLoadOp.fragment.go +11 -0
- package/project/.sdk/src/cmp/go/fragment/EntityRemoveOp.fragment.go +11 -0
- package/project/.sdk/src/cmp/go/fragment/EntityUpdateOp.fragment.go +11 -0
- package/project/.sdk/src/cmp/go-cli/Main_go-cli.ts +195 -0
- package/project/.sdk/src/cmp/go-cli/fragment/main.fragment.go +106 -0
- package/project/.sdk/src/cmp/go-cli/fragment/words.fragment.go +132 -0
- package/project/.sdk/src/cmp/go-mcp/Main_go-mcp.ts +184 -0
- package/project/.sdk/src/cmp/go-mcp/fragment/main.fragment.go +68 -0
- package/project/.sdk/src/cmp/go-mcp/fragment/tools.fragment.go +114 -0
- package/project/.sdk/src/cmp/js/EntityTypes_js.ts +111 -0
- package/project/.sdk/src/cmp/js/MainEntity_js.ts +1 -0
- package/project/.sdk/src/cmp/js/Main_js.ts +3 -0
- package/project/.sdk/src/cmp/js/Package_js.ts +16 -7
- package/project/.sdk/src/cmp/js/ReadmeEntity_js.ts +13 -7
- package/project/.sdk/src/cmp/js/ReadmeExplanation_js.ts +2 -2
- package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +52 -11
- package/project/.sdk/src/cmp/js/ReadmeIntro_js.ts +39 -1
- package/project/.sdk/src/cmp/js/ReadmeModel_js.ts +50 -18
- package/project/.sdk/src/cmp/js/ReadmeOptions_js.ts +4 -3
- package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +45 -19
- package/project/.sdk/src/cmp/js/ReadmeRef_js.ts +24 -13
- package/project/.sdk/src/cmp/js/ReadmeTopHowto_js.ts +3 -0
- package/project/.sdk/src/cmp/js/ReadmeTopQuick_js.ts +28 -12
- package/project/.sdk/src/cmp/js/ReadmeTopTest_js.ts +23 -3
- package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +5 -0
- package/project/.sdk/src/cmp/js/fragment/EntityListOp.fragment.js +5 -0
- package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +5 -0
- package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +5 -0
- package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +5 -0
- package/project/.sdk/src/cmp/js/utility_js.ts +57 -0
- package/project/.sdk/src/cmp/lua/EntityTypes_lua.ts +113 -0
- package/project/.sdk/src/cmp/lua/MainEntity_lua.ts +8 -0
- package/project/.sdk/src/cmp/lua/Main_lua.ts +4 -0
- package/project/.sdk/src/cmp/lua/Package_lua.ts +23 -4
- package/project/.sdk/src/cmp/lua/ReadmeEntity_lua.ts +12 -10
- package/project/.sdk/src/cmp/lua/ReadmeExamplesTest_lua.ts +293 -0
- package/project/.sdk/src/cmp/lua/ReadmeHowto_lua.ts +46 -8
- package/project/.sdk/src/cmp/lua/ReadmeInstall_lua.ts +19 -3
- package/project/.sdk/src/cmp/lua/ReadmeIntro_lua.ts +38 -1
- package/project/.sdk/src/cmp/lua/ReadmeModel_lua.ts +51 -16
- package/project/.sdk/src/cmp/lua/ReadmeOptions_lua.ts +4 -3
- package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +79 -18
- package/project/.sdk/src/cmp/lua/ReadmeRef_lua.ts +25 -20
- package/project/.sdk/src/cmp/lua/ReadmeTopQuick_lua.ts +17 -9
- package/project/.sdk/src/cmp/lua/ReadmeTopTest_lua.ts +32 -5
- package/project/.sdk/src/cmp/lua/Test_lua.ts +4 -0
- package/project/.sdk/src/cmp/lua/fragment/EntityCreateOp.fragment.lua +4 -0
- package/project/.sdk/src/cmp/lua/fragment/EntityListOp.fragment.lua +4 -0
- package/project/.sdk/src/cmp/lua/fragment/EntityLoadOp.fragment.lua +4 -0
- package/project/.sdk/src/cmp/lua/fragment/EntityRemoveOp.fragment.lua +4 -0
- package/project/.sdk/src/cmp/lua/fragment/EntityUpdateOp.fragment.lua +4 -0
- package/project/.sdk/src/cmp/php/EntityTypes_php.ts +142 -0
- package/project/.sdk/src/cmp/php/MainEntity_php.ts +18 -1
- package/project/.sdk/src/cmp/php/Main_php.ts +4 -0
- package/project/.sdk/src/cmp/php/Package_php.ts +18 -7
- package/project/.sdk/src/cmp/php/ReadmeEntity_php.ts +15 -11
- package/project/.sdk/src/cmp/php/ReadmeExamplesTest_php.ts +401 -0
- package/project/.sdk/src/cmp/php/ReadmeHowto_php.ts +56 -13
- package/project/.sdk/src/cmp/php/ReadmeInstall_php.ts +15 -3
- package/project/.sdk/src/cmp/php/ReadmeIntro_php.ts +40 -1
- package/project/.sdk/src/cmp/php/ReadmeModel_php.ts +26 -8
- package/project/.sdk/src/cmp/php/ReadmeOptions_php.ts +4 -3
- package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +80 -22
- package/project/.sdk/src/cmp/php/ReadmeRef_php.ts +51 -42
- package/project/.sdk/src/cmp/php/ReadmeTopHowto_php.ts +1 -1
- package/project/.sdk/src/cmp/php/ReadmeTopQuick_php.ts +19 -11
- package/project/.sdk/src/cmp/php/ReadmeTopTest_php.ts +41 -11
- package/project/.sdk/src/cmp/php/TestDirect_php.ts +9 -9
- package/project/.sdk/src/cmp/php/TestEntity_php.ts +6 -12
- package/project/.sdk/src/cmp/php/Test_php.ts +4 -0
- package/project/.sdk/src/cmp/php/fragment/Entity.fragment.php +13 -1
- package/project/.sdk/src/cmp/php/fragment/EntityCreateOp.fragment.php +10 -1
- package/project/.sdk/src/cmp/php/fragment/EntityListOp.fragment.php +10 -1
- package/project/.sdk/src/cmp/php/fragment/EntityLoadOp.fragment.php +10 -1
- package/project/.sdk/src/cmp/php/fragment/EntityRemoveOp.fragment.php +10 -1
- package/project/.sdk/src/cmp/php/fragment/EntityUpdateOp.fragment.php +10 -1
- package/project/.sdk/src/cmp/php/fragment/Main.fragment.php +22 -14
- package/project/.sdk/src/cmp/py/EntityTypes_py.ts +184 -0
- package/project/.sdk/src/cmp/py/Entity_py.ts +27 -0
- package/project/.sdk/src/cmp/py/MainEntity_py.ts +2 -1
- package/project/.sdk/src/cmp/py/Main_py.ts +35 -0
- package/project/.sdk/src/cmp/py/Package_py.ts +24 -3
- package/project/.sdk/src/cmp/py/ReadmeEntity_py.ts +27 -11
- package/project/.sdk/src/cmp/py/ReadmeExamplesTest_py.ts +626 -0
- package/project/.sdk/src/cmp/py/ReadmeHowto_py.ts +53 -14
- package/project/.sdk/src/cmp/py/ReadmeInstall_py.ts +19 -3
- package/project/.sdk/src/cmp/py/ReadmeIntro_py.ts +48 -1
- package/project/.sdk/src/cmp/py/ReadmeModel_py.ts +28 -10
- package/project/.sdk/src/cmp/py/ReadmeOptions_py.ts +4 -3
- package/project/.sdk/src/cmp/py/ReadmeQuick_py.ts +73 -24
- package/project/.sdk/src/cmp/py/ReadmeRef_py.ts +57 -37
- package/project/.sdk/src/cmp/py/ReadmeTopHowto_py.ts +1 -1
- package/project/.sdk/src/cmp/py/ReadmeTopQuick_py.ts +19 -11
- package/project/.sdk/src/cmp/py/ReadmeTopTest_py.ts +30 -5
- package/project/.sdk/src/cmp/py/TestDirect_py.ts +7 -9
- package/project/.sdk/src/cmp/py/TestEntity_py.ts +6 -14
- package/project/.sdk/src/cmp/py/Test_py.ts +4 -0
- package/project/.sdk/src/cmp/py/fragment/Entity.fragment.py +5 -2
- package/project/.sdk/src/cmp/py/fragment/EntityCreateOp.fragment.py +1 -1
- package/project/.sdk/src/cmp/py/fragment/EntityListOp.fragment.py +5 -1
- package/project/.sdk/src/cmp/py/fragment/EntityLoadOp.fragment.py +6 -1
- package/project/.sdk/src/cmp/py/fragment/EntityRemoveOp.fragment.py +6 -1
- package/project/.sdk/src/cmp/py/fragment/EntityUpdateOp.fragment.py +1 -1
- package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +17 -10
- package/project/.sdk/src/cmp/rb/EntityTypes_rb.ts +136 -0
- package/project/.sdk/src/cmp/rb/MainEntity_rb.ts +1 -0
- package/project/.sdk/src/cmp/rb/Main_rb.ts +4 -0
- package/project/.sdk/src/cmp/rb/Package_rb.ts +34 -7
- package/project/.sdk/src/cmp/rb/ReadmeEntity_rb.ts +26 -10
- package/project/.sdk/src/cmp/rb/ReadmeExamplesTest_rb.ts +289 -0
- package/project/.sdk/src/cmp/rb/ReadmeHowto_rb.ts +72 -21
- package/project/.sdk/src/cmp/rb/ReadmeInstall_rb.ts +16 -4
- package/project/.sdk/src/cmp/rb/ReadmeIntro_rb.ts +40 -1
- package/project/.sdk/src/cmp/rb/ReadmeModel_rb.ts +29 -12
- package/project/.sdk/src/cmp/rb/ReadmeOptions_rb.ts +4 -3
- package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +85 -22
- package/project/.sdk/src/cmp/rb/ReadmeRef_rb.ts +56 -37
- package/project/.sdk/src/cmp/rb/ReadmeTopHowto_rb.ts +1 -1
- package/project/.sdk/src/cmp/rb/ReadmeTopQuick_rb.ts +19 -11
- package/project/.sdk/src/cmp/rb/ReadmeTopTest_rb.ts +43 -11
- package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +9 -9
- package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +6 -12
- package/project/.sdk/src/cmp/rb/Test_rb.ts +4 -0
- package/project/.sdk/src/cmp/rb/fragment/Entity.fragment.rb +2 -0
- package/project/.sdk/src/cmp/rb/fragment/EntityCreateOp.fragment.rb +5 -0
- package/project/.sdk/src/cmp/rb/fragment/EntityListOp.fragment.rb +20 -2
- package/project/.sdk/src/cmp/rb/fragment/EntityLoadOp.fragment.rb +8 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityRemoveOp.fragment.rb +6 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityUpdateOp.fragment.rb +5 -0
- package/project/.sdk/src/cmp/rb/fragment/Main.fragment.rb +24 -8
- package/project/.sdk/src/cmp/ts/EntityTypes_ts.ts +105 -0
- package/project/.sdk/src/cmp/ts/Entity_ts.ts +17 -1
- package/project/.sdk/src/cmp/ts/MainEntity_ts.ts +1 -0
- package/project/.sdk/src/cmp/ts/Main_ts.ts +6 -0
- package/project/.sdk/src/cmp/ts/Package_ts.ts +14 -7
- package/project/.sdk/src/cmp/ts/ReadmeEntity_ts.ts +13 -7
- package/project/.sdk/src/cmp/ts/ReadmeExampleTest_ts.ts +81 -0
- package/project/.sdk/src/cmp/ts/ReadmeExamplesTest_ts.ts +446 -0
- package/project/.sdk/src/cmp/ts/ReadmeExplanation_ts.ts +2 -2
- package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +57 -11
- package/project/.sdk/src/cmp/ts/ReadmeInstall_ts.ts +19 -6
- package/project/.sdk/src/cmp/ts/ReadmeIntro_ts.ts +39 -1
- package/project/.sdk/src/cmp/ts/ReadmeModel_ts.ts +50 -18
- package/project/.sdk/src/cmp/ts/ReadmeOptions_ts.ts +4 -3
- package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +95 -40
- package/project/.sdk/src/cmp/ts/ReadmeRef_ts.ts +24 -13
- package/project/.sdk/src/cmp/ts/ReadmeTopHowto_ts.ts +3 -0
- package/project/.sdk/src/cmp/ts/ReadmeTopQuick_ts.ts +44 -12
- package/project/.sdk/src/cmp/ts/ReadmeTopTest_ts.ts +23 -3
- package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +2 -2
- package/project/.sdk/src/cmp/ts/Test_ts.ts +5 -0
- package/project/.sdk/src/cmp/ts/fragment/Entity.fragment.ts +3 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityBase.fragment.ts +10 -5
- package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +4 -2
- package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +4 -2
- package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +4 -2
- package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +4 -2
- package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +4 -2
- package/project/.sdk/src/cmp/ts/utility_ts.ts +59 -0
- package/project/.sdk/tm/go/LICENSE +1 -1
- package/project/.sdk/tm/go/Makefile +36 -1
- package/project/.sdk/tm/go/VERSION +1 -0
- package/project/.sdk/tm/go/core/context.go +12 -7
- package/project/.sdk/tm/go-cli/src/feature/README.md +6 -0
- package/project/.sdk/tm/go-cli/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/go-cli/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/go-cli/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/go-mcp/src/feature/README.md +6 -0
- package/project/.sdk/tm/go-mcp/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/go-mcp/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/go-mcp/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/js/LICENSE +1 -1
- package/project/.sdk/tm/js/Makefile +41 -0
- package/project/.sdk/tm/lua/LICENSE +1 -1
- package/project/.sdk/tm/lua/Makefile +40 -1
- package/project/.sdk/tm/lua/core/context.lua +13 -8
- package/project/.sdk/tm/php/LICENSE +1 -1
- package/project/.sdk/tm/php/Makefile +31 -1
- package/project/.sdk/tm/php/VERSION +1 -0
- package/project/.sdk/tm/php/core/Context.php +12 -6
- package/project/.sdk/tm/php/test/PrimaryUtilityTest.php +13 -4
- package/project/.sdk/tm/php/utility/Done.php +2 -2
- package/project/.sdk/tm/php/utility/MakeError.php +3 -3
- package/project/.sdk/tm/py/LICENSE +1 -1
- package/project/.sdk/tm/py/Makefile +34 -1
- package/project/.sdk/tm/py/core/context.py +12 -7
- package/project/.sdk/tm/py/test/test_primary_utility.py +15 -4
- package/project/.sdk/tm/py/utility/done.py +3 -1
- package/project/.sdk/tm/py/utility/make_error.py +2 -2
- package/project/.sdk/tm/rb/LICENSE +1 -1
- package/project/.sdk/tm/rb/Makefile +33 -1
- package/project/.sdk/tm/rb/core/context.rb +8 -3
- package/project/.sdk/tm/rb/test/primary_utility_test.rb +2 -2
- package/project/.sdk/tm/rb/utility/done.rb +3 -1
- package/project/.sdk/tm/rb/utility/make_error.rb +5 -2
- package/project/.sdk/tm/ts/LICENSE +1 -1
- package/project/.sdk/tm/ts/Makefile +42 -0
- package/project/.sdk/tm/ts/src/Context.ts +8 -3
- package/src/action/action.ts +17 -10
- package/src/action/feature.ts +8 -6
- package/src/action/target.ts +17 -8
- package/src/cmp/Changelog.ts +34 -0
- package/src/cmp/Deploy.ts +258 -0
- package/src/cmp/FeatureHook.ts +6 -8
- package/src/cmp/License.ts +49 -0
- package/src/cmp/Readme.ts +2 -0
- package/src/cmp/ReadmeErrors.ts +257 -0
- package/src/cmp/ReadmeExplanation.ts +250 -230
- package/src/cmp/ReadmeModel.ts +7 -2
- package/src/cmp/ReadmeTop.ts +411 -95
- package/src/cmp/Security.ts +41 -0
- package/src/helpers/canonType.ts +89 -0
- package/src/helpers/collectDeps.ts +5 -3
- package/src/helpers/naming.ts +59 -0
- package/src/helpers/opExample.ts +170 -0
- package/src/helpers/opShape.ts +236 -0
- package/src/helpers/packageMeta.ts +236 -0
- package/src/sdkgen.ts +87 -20
- package/src/tsconfig.json +1 -0
- package/src/types.ts +85 -2
- package/src/utility.ts +22 -11
- package/README.md +0 -2
- package/dist/action/lang.d.ts +0 -2
- package/dist/action/lang.js +0 -68
- package/dist/action/lang.js.map +0 -1
- package/dist/cmp/Hook.d.ts +0 -2
- package/dist/cmp/Hook.js +0 -10
- package/dist/cmp/Hook.js.map +0 -1
- package/dist/cmp/Top.d.ts +0 -2
- package/dist/cmp/Top.js +0 -23
- package/dist/cmp/Top.js.map +0 -1
- package/dist/prepare-openapi.d.ts +0 -2
- package/dist/prepare-openapi.js +0 -37
- package/dist/prepare-openapi.js.map +0 -1
- package/model/sdkgen.jsonic +0 -74
- package/project/.sdk/tm/go/utility/struct/go.mod +0 -3
|
@@ -100,16 +100,22 @@ class ProjectNameContext
|
|
|
100
100
|
|
|
101
101
|
public function resolve_op(string $opname): ProjectNameOperation
|
|
102
102
|
{
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
// Cache key is `<entity>:<opname>` so two entities with the same op
|
|
104
|
+
// (e.g. both have a "list") get distinct cached Operations. Keying
|
|
105
|
+
// on opname alone caused the first-resolved entity's points to be
|
|
106
|
+
// served to every subsequent entity's call.
|
|
107
|
+
$entname = (is_object($this->entity) && method_exists($this->entity, 'get_name'))
|
|
108
|
+
? $this->entity->get_name()
|
|
109
|
+
: '_';
|
|
110
|
+
$cacheKey = $entname . ':' . $opname;
|
|
111
|
+
|
|
112
|
+
if (isset($this->opmap[$cacheKey])) {
|
|
113
|
+
return $this->opmap[$cacheKey];
|
|
105
114
|
}
|
|
106
115
|
if ($opname === '') {
|
|
107
116
|
return new ProjectNameOperation([]);
|
|
108
117
|
}
|
|
109
118
|
|
|
110
|
-
$entname = (is_object($this->entity) && method_exists($this->entity, 'get_name'))
|
|
111
|
-
? $this->entity->get_name()
|
|
112
|
-
: '_';
|
|
113
119
|
$opcfg = \Voxgig\Struct\Struct::getpath($this->config, "entity.{$entname}.op.{$opname}");
|
|
114
120
|
|
|
115
121
|
$input = ($opname === 'update' || $opname === 'create') ? 'data' : 'match';
|
|
@@ -128,7 +134,7 @@ class ProjectNameContext
|
|
|
128
134
|
'input' => $input,
|
|
129
135
|
'points' => $points,
|
|
130
136
|
]);
|
|
131
|
-
$this->opmap[$
|
|
137
|
+
$this->opmap[$cacheKey] = $op;
|
|
132
138
|
return $op;
|
|
133
139
|
}
|
|
134
140
|
|
|
@@ -405,7 +405,11 @@ class PrimaryUtilityTest extends TestCase
|
|
|
405
405
|
$ctxmap = $entry['ctx'] ?? [];
|
|
406
406
|
$ctx = self::make_ctx_from_map($ctxmap, $client, $utility);
|
|
407
407
|
self::fixctx($ctx, $client);
|
|
408
|
-
|
|
408
|
+
// done now returns the bare result data (or raises on error, which
|
|
409
|
+
// runset catches). Re-wrap success into a (result, err) tuple so the
|
|
410
|
+
// data-driven spec matcher keeps working.
|
|
411
|
+
$out = ($utility->done)($ctx);
|
|
412
|
+
return [$out, null];
|
|
409
413
|
});
|
|
410
414
|
}
|
|
411
415
|
|
|
@@ -437,7 +441,11 @@ class PrimaryUtilityTest extends TestCase
|
|
|
437
441
|
$err = self::err_from_map($args[1]);
|
|
438
442
|
}
|
|
439
443
|
|
|
440
|
-
|
|
444
|
+
// make_error now RAISES the constructed exception (default throw
|
|
445
|
+
// path); runset catches it. On the no-throw path it returns the
|
|
446
|
+
// bare result data, which we re-wrap into a (result, err) tuple.
|
|
447
|
+
$out = ($utility->make_error)($ctx, $err);
|
|
448
|
+
return [$out, null];
|
|
441
449
|
});
|
|
442
450
|
}
|
|
443
451
|
|
|
@@ -455,8 +463,9 @@ class PrimaryUtilityTest extends TestCase
|
|
|
455
463
|
'resdata' => ['id' => 'safe01'],
|
|
456
464
|
]);
|
|
457
465
|
|
|
458
|
-
|
|
459
|
-
|
|
466
|
+
// throw_err === false: make_error returns the bare result data instead
|
|
467
|
+
// of raising (the result-object / no-throw escape hatch).
|
|
468
|
+
$out = ($utility->make_error)($ctx, $ctx->make_error('test_code', 'test message'));
|
|
460
469
|
$this->assertIsArray($out);
|
|
461
470
|
$this->assertEquals('safe01', $out['id']);
|
|
462
471
|
}
|
|
@@ -5,7 +5,7 @@ declare(strict_types=1);
|
|
|
5
5
|
|
|
6
6
|
class ProjectNameDone
|
|
7
7
|
{
|
|
8
|
-
public static function call(ProjectNameContext $ctx):
|
|
8
|
+
public static function call(ProjectNameContext $ctx): mixed
|
|
9
9
|
{
|
|
10
10
|
if ($ctx->ctrl->explain) {
|
|
11
11
|
$ctx->ctrl->explain = ($ctx->utility->clean)($ctx, $ctx->ctrl->explain);
|
|
@@ -19,7 +19,7 @@ class ProjectNameDone
|
|
|
19
19
|
if (is_object($resdata)) {
|
|
20
20
|
$resdata = (array)$resdata;
|
|
21
21
|
}
|
|
22
|
-
return
|
|
22
|
+
return $resdata;
|
|
23
23
|
}
|
|
24
24
|
return ($ctx->utility->make_error)($ctx, null);
|
|
25
25
|
}
|
|
@@ -9,7 +9,7 @@ require_once __DIR__ . '/../core/Error.php';
|
|
|
9
9
|
|
|
10
10
|
class ProjectNameMakeError
|
|
11
11
|
{
|
|
12
|
-
public static function call(?ProjectNameContext $ctx, mixed $err):
|
|
12
|
+
public static function call(?ProjectNameContext $ctx, mixed $err): mixed
|
|
13
13
|
{
|
|
14
14
|
if ($ctx === null) {
|
|
15
15
|
require_once __DIR__ . '/../core/Context.php';
|
|
@@ -52,8 +52,8 @@ class ProjectNameMakeError
|
|
|
52
52
|
$ctx->ctrl->err = $sdk_err;
|
|
53
53
|
|
|
54
54
|
if ($ctx->ctrl->throw_err === false) {
|
|
55
|
-
return
|
|
55
|
+
return $result->resdata;
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
throw $sdk_err;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.PHONY: test build clean
|
|
1
|
+
.PHONY: test build clean publish
|
|
2
2
|
|
|
3
3
|
test:
|
|
4
4
|
python -m pytest test/
|
|
@@ -8,3 +8,36 @@ build:
|
|
|
8
8
|
|
|
9
9
|
clean:
|
|
10
10
|
find . -name __pycache__ -exec rm -rf {} + 2>/dev/null; true
|
|
11
|
+
|
|
12
|
+
# --- Release: publish to PyPI ---------------------------------------------
|
|
13
|
+
# Publish this package to PyPI, then tag py/vX.Y.Z. Run headless under the aql
|
|
14
|
+
# key vault, which injects the PyPI + GitHub tokens as environment variables
|
|
15
|
+
# (never written to disk or argv):
|
|
16
|
+
# aql vault exec --for=pypi=<alias> --for=github=<alias> -- make publish
|
|
17
|
+
# aql `--dry-run` injects a filler token we detect to rehearse: builds the dist
|
|
18
|
+
# but performs no upload, tag, or push. set -e + tag-last: a failed upload never
|
|
19
|
+
# leaves a tag behind. Needs python `build` + `twine` (pip install build twine).
|
|
20
|
+
VERSION := $(shell sed -nE 's/^version *= *"([^"]+)".*/\1/p' pyproject.toml | head -1)
|
|
21
|
+
TAG := py/v$(VERSION)
|
|
22
|
+
AQL_DRY_RUN_FILLER := AQL-DRY-RUN-FILLER-NOT-A-REAL-SECRET
|
|
23
|
+
publish: test
|
|
24
|
+
@if git rev-parse -q --verify "refs/tags/$(TAG)" >/dev/null; then \
|
|
25
|
+
echo "tag $(TAG) already exists — bump pyproject.toml version first"; exit 1; fi
|
|
26
|
+
@set -e; \
|
|
27
|
+
token="$${GITHUB_TOKEN:-$$GH_TOKEN}"; \
|
|
28
|
+
rm -rf dist; \
|
|
29
|
+
python3 -m build; \
|
|
30
|
+
if [ "$$token" = "$(AQL_DRY_RUN_FILLER)" ] || [ "$$TWINE_PASSWORD" = "$(AQL_DRY_RUN_FILLER)" ]; then \
|
|
31
|
+
echo "[dry-run] aql filler token detected: built the dist; would upload to PyPI and tag $(TAG); nothing pushed."; \
|
|
32
|
+
exit 0; \
|
|
33
|
+
fi; \
|
|
34
|
+
python3 -m twine upload dist/*; \
|
|
35
|
+
git tag -a "$(TAG)" -m "py v$(VERSION)"; \
|
|
36
|
+
url=$$(git remote get-url origin | sed -E 's#^git@github.com:#https://github.com/#'); \
|
|
37
|
+
if [ -n "$$token" ] && printf '%s' "$$url" | grep -q '^https://github.com/'; then \
|
|
38
|
+
hdr="AUTHORIZATION: basic $$(printf 'x-access-token:%s' "$$token" | base64 | tr -d '\n')"; \
|
|
39
|
+
git -c http.extraheader="$$hdr" push "$$url" "$(TAG)"; \
|
|
40
|
+
else \
|
|
41
|
+
git push origin "$(TAG)"; \
|
|
42
|
+
fi; \
|
|
43
|
+
echo "Published to PyPI + tag $(TAG)."
|
|
@@ -163,15 +163,20 @@ class ProjectNameContext:
|
|
|
163
163
|
self.op = self.resolve_op(opname)
|
|
164
164
|
|
|
165
165
|
def resolve_op(self, opname):
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
return ProjectNameOperation({})
|
|
171
|
-
|
|
166
|
+
# Cache key is `<entity>:<opname>` so two entities with the same op
|
|
167
|
+
# (e.g. both have a "list") get distinct cached Operations. Keying
|
|
168
|
+
# on opname alone caused the first-resolved entity's points to be
|
|
169
|
+
# served to every subsequent entity's call.
|
|
172
170
|
entname = "_"
|
|
173
171
|
if self.entity is not None and hasattr(self.entity, "get_name") and callable(self.entity.get_name):
|
|
174
172
|
entname = self.entity.get_name()
|
|
173
|
+
cache_key = entname + ":" + opname
|
|
174
|
+
|
|
175
|
+
if cache_key in self.opmap:
|
|
176
|
+
return self.opmap[cache_key]
|
|
177
|
+
|
|
178
|
+
if opname == "":
|
|
179
|
+
return ProjectNameOperation({})
|
|
175
180
|
|
|
176
181
|
opcfg = vs.getpath(self.config, "entity." + entname + ".op." + opname)
|
|
177
182
|
|
|
@@ -192,7 +197,7 @@ class ProjectNameContext:
|
|
|
192
197
|
"points": points,
|
|
193
198
|
})
|
|
194
199
|
|
|
195
|
-
self.opmap[
|
|
200
|
+
self.opmap[cache_key] = op
|
|
196
201
|
return op
|
|
197
202
|
|
|
198
203
|
def make_error(self, code, msg):
|
|
@@ -329,7 +329,12 @@ class TestPrimaryUtility:
|
|
|
329
329
|
ctxmap = {}
|
|
330
330
|
ctx = _make_ctx_from_map(ctxmap, client, utility)
|
|
331
331
|
_fixctx(ctx, client)
|
|
332
|
-
|
|
332
|
+
# done() returns the bare result data on success and raises on
|
|
333
|
+
# error. Adapt to the (result, err) shape the runner expects.
|
|
334
|
+
try:
|
|
335
|
+
return utility.done(ctx), None
|
|
336
|
+
except ProjectNameError as e:
|
|
337
|
+
return None, e
|
|
333
338
|
|
|
334
339
|
_runset(_get_spec(primary, "done", "basic"), subject)
|
|
335
340
|
|
|
@@ -356,7 +361,12 @@ class TestPrimaryUtility:
|
|
|
356
361
|
if isinstance(err_map, dict):
|
|
357
362
|
err = _err_from_map(err_map)
|
|
358
363
|
|
|
359
|
-
|
|
364
|
+
# make_error() raises the constructed exception on the default
|
|
365
|
+
# (throw) path. Adapt to the (result, err) shape the runner expects.
|
|
366
|
+
try:
|
|
367
|
+
return utility.make_error(ctx, err), None
|
|
368
|
+
except ProjectNameError as e:
|
|
369
|
+
return None, e
|
|
360
370
|
|
|
361
371
|
_runset(_get_spec(primary, "makeError", "basic"), subject)
|
|
362
372
|
|
|
@@ -370,8 +380,9 @@ class TestPrimaryUtility:
|
|
|
370
380
|
"resdata": {"id": "safe01"},
|
|
371
381
|
})
|
|
372
382
|
|
|
373
|
-
|
|
374
|
-
|
|
383
|
+
# throw_err is False: make_error returns the bare result data instead
|
|
384
|
+
# of raising (the result-object / no-throw escape hatch).
|
|
385
|
+
out = utility.make_error(ctx, ctx.make_error("test_code", "test message"))
|
|
375
386
|
assert isinstance(out, dict)
|
|
376
387
|
assert out["id"] == "safe01"
|
|
377
388
|
|
|
@@ -9,6 +9,8 @@ def done_util(ctx):
|
|
|
9
9
|
explain_result.pop("err", None)
|
|
10
10
|
|
|
11
11
|
if ctx.result is not None and ctx.result.ok:
|
|
12
|
-
return ctx.result.resdata
|
|
12
|
+
return ctx.result.resdata
|
|
13
13
|
|
|
14
|
+
# make_error raises on the default (throw) path; only returns bare
|
|
15
|
+
# resdata when throw_err is explicitly disabled.
|
|
14
16
|
return ctx.utility.make_error(ctx, None)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.PHONY: test build clean
|
|
1
|
+
.PHONY: test build clean publish
|
|
2
2
|
|
|
3
3
|
test:
|
|
4
4
|
ruby -Ilib test/exists_test.rb
|
|
@@ -8,3 +8,35 @@ build:
|
|
|
8
8
|
|
|
9
9
|
clean:
|
|
10
10
|
@echo "No clean step for Ruby"
|
|
11
|
+
|
|
12
|
+
# --- Release: publish to RubyGems -----------------------------------------
|
|
13
|
+
# Build the gem and push it to RubyGems, then tag rb/vX.Y.Z. Run headless under
|
|
14
|
+
# the aql key vault, which injects GEM_HOST_API_KEY + the GitHub token (never on
|
|
15
|
+
# disk or argv):
|
|
16
|
+
# aql vault exec --for=gem=<alias> --for=github=<alias> -- make publish
|
|
17
|
+
# aql `--dry-run` injects a filler token we detect to rehearse (build only, no
|
|
18
|
+
# push/tag). set -e + tag-last: a failed push never leaves a tag behind.
|
|
19
|
+
VERSION := $(shell sed -nE 's/.*\.version *= *"([^"]+)".*/\1/p' *.gemspec | head -1)
|
|
20
|
+
TAG := rb/v$(VERSION)
|
|
21
|
+
AQL_DRY_RUN_FILLER := AQL-DRY-RUN-FILLER-NOT-A-REAL-SECRET
|
|
22
|
+
publish: test
|
|
23
|
+
@if git rev-parse -q --verify "refs/tags/$(TAG)" >/dev/null; then \
|
|
24
|
+
echo "tag $(TAG) already exists — bump the gemspec version first"; exit 1; fi
|
|
25
|
+
@set -e; \
|
|
26
|
+
token="$${GITHUB_TOKEN:-$$GH_TOKEN}"; \
|
|
27
|
+
rm -f *.gem; \
|
|
28
|
+
gem build *.gemspec; \
|
|
29
|
+
if [ "$$token" = "$(AQL_DRY_RUN_FILLER)" ] || [ "$$GEM_HOST_API_KEY" = "$(AQL_DRY_RUN_FILLER)" ]; then \
|
|
30
|
+
echo "[dry-run] aql filler token detected: built the gem; would push to RubyGems and tag $(TAG); nothing pushed."; \
|
|
31
|
+
exit 0; \
|
|
32
|
+
fi; \
|
|
33
|
+
gem push *.gem; \
|
|
34
|
+
git tag -a "$(TAG)" -m "rb v$(VERSION)"; \
|
|
35
|
+
url=$$(git remote get-url origin | sed -E 's#^git@github.com:#https://github.com/#'); \
|
|
36
|
+
if [ -n "$$token" ] && printf '%s' "$$url" | grep -q '^https://github.com/'; then \
|
|
37
|
+
hdr="AUTHORIZATION: basic $$(printf 'x-access-token:%s' "$$token" | base64 | tr -d '\n')"; \
|
|
38
|
+
git -c http.extraheader="$$hdr" push "$$url" "$(TAG)"; \
|
|
39
|
+
else \
|
|
40
|
+
git push origin "$(TAG)"; \
|
|
41
|
+
fi; \
|
|
42
|
+
echo "Published to RubyGems + tag $(TAG)."
|
|
@@ -75,10 +75,15 @@ class ProjectNameContext
|
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
def resolve_op(opname)
|
|
78
|
-
|
|
78
|
+
# Cache key is `<entity>:<opname>` so two entities with the same op
|
|
79
|
+
# (e.g. both have a "list") get distinct cached Operations. Keying
|
|
80
|
+
# on opname alone caused the first-resolved entity's points to be
|
|
81
|
+
# served to every subsequent entity's call.
|
|
82
|
+
entname = @entity&.respond_to?(:get_name) ? @entity.get_name : "_"
|
|
83
|
+
cache_key = "#{entname}:#{opname}"
|
|
84
|
+
return @opmap[cache_key] if @opmap[cache_key]
|
|
79
85
|
return ProjectNameOperation.new({}) if opname.empty?
|
|
80
86
|
|
|
81
|
-
entname = @entity&.respond_to?(:get_name) ? @entity.get_name : "_"
|
|
82
87
|
opcfg = VoxgigStruct.getpath(@config, "entity.#{entname}.op.#{opname}")
|
|
83
88
|
|
|
84
89
|
input = (opname == "update" || opname == "create") ? "data" : "match"
|
|
@@ -95,7 +100,7 @@ class ProjectNameContext
|
|
|
95
100
|
"input" => input,
|
|
96
101
|
"points" => points,
|
|
97
102
|
})
|
|
98
|
-
@opmap[
|
|
103
|
+
@opmap[cache_key] = op
|
|
99
104
|
op
|
|
100
105
|
end
|
|
101
106
|
|
|
@@ -101,8 +101,8 @@ class PrimaryUtilityTest < Minitest::Test
|
|
|
101
101
|
"resdata" => { "id" => "safe01" },
|
|
102
102
|
})
|
|
103
103
|
|
|
104
|
-
out
|
|
105
|
-
|
|
104
|
+
# Opt-out path: throw_err disabled -> returns the bare result data, no raise.
|
|
105
|
+
out = @utility.make_error.call(ctx, ctx.make_error("test_code", "test message"))
|
|
106
106
|
assert out.is_a?(Hash), "expected hash result, got: #{out.class}"
|
|
107
107
|
assert_equal "safe01", out["id"], "expected id=safe01"
|
|
108
108
|
end
|
|
@@ -7,8 +7,10 @@ module ProjectNameUtilities
|
|
|
7
7
|
er.delete("err") if er.is_a?(Hash)
|
|
8
8
|
end
|
|
9
9
|
if ctx.result && ctx.result.ok
|
|
10
|
-
return ctx.result.resdata
|
|
10
|
+
return ctx.result.resdata
|
|
11
11
|
end
|
|
12
|
+
# On error, make_error raises the exception (or, when throw_err is
|
|
13
|
+
# disabled, returns the bare result data). Propagate its value.
|
|
12
14
|
ctx.utility.make_error.call(ctx, nil)
|
|
13
15
|
}
|
|
14
16
|
end
|
|
@@ -36,9 +36,12 @@ module ProjectNameUtilities
|
|
|
36
36
|
|
|
37
37
|
ctx.ctrl.err = sdk_err
|
|
38
38
|
|
|
39
|
+
# Opt-out escape hatch: when throwing is explicitly disabled, return the
|
|
40
|
+
# bare result data instead of raising.
|
|
39
41
|
if ctx.ctrl.throw_err == false
|
|
40
|
-
return result.resdata
|
|
42
|
+
return result.resdata
|
|
41
43
|
end
|
|
42
|
-
|
|
44
|
+
# Default idiomatic path: raise the already-constructed exception.
|
|
45
|
+
raise sdk_err
|
|
43
46
|
}
|
|
44
47
|
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
.PHONY: test build clean publish
|
|
2
|
+
|
|
3
|
+
# tsc emits to dist/ + dist-test/; the test runner reads dist-test/, so build first.
|
|
4
|
+
test: build
|
|
5
|
+
npm test
|
|
6
|
+
|
|
7
|
+
build:
|
|
8
|
+
npm run build
|
|
9
|
+
|
|
10
|
+
clean:
|
|
11
|
+
rm -rf dist dist-test node_modules
|
|
12
|
+
|
|
13
|
+
# --- Release: publish to npm ----------------------------------------------
|
|
14
|
+
# Compile, then publish this package to npm and tag ts/vX.Y.Z. Run headless
|
|
15
|
+
# under the aql key vault, which injects the npm auth token + the GitHub token
|
|
16
|
+
# (never on disk or argv):
|
|
17
|
+
# aql vault exec --for=npm=<alias> --for=github=<alias> -- make publish
|
|
18
|
+
# aql `--dry-run` injects a filler token we detect to rehearse (build only, no
|
|
19
|
+
# publish/tag). set -e + tag-last: a failed publish never leaves a tag behind.
|
|
20
|
+
SHELL := /bin/bash
|
|
21
|
+
VERSION := $(shell node -p "require('./package.json').version")
|
|
22
|
+
TAG := ts/v$(VERSION)
|
|
23
|
+
AQL_DRY_RUN_FILLER := AQL-DRY-RUN-FILLER-NOT-A-REAL-SECRET
|
|
24
|
+
publish: test
|
|
25
|
+
@if git rev-parse -q --verify "refs/tags/$(TAG)" >/dev/null; then \
|
|
26
|
+
echo "tag $(TAG) already exists — bump package.json version first"; exit 1; fi
|
|
27
|
+
@set -e; \
|
|
28
|
+
token="$${GITHUB_TOKEN:-$$GH_TOKEN}"; \
|
|
29
|
+
if [ "$$token" = "$(AQL_DRY_RUN_FILLER)" ]; then \
|
|
30
|
+
echo "[dry-run] aql filler token detected: would publish to npm and tag $(TAG); nothing pushed."; \
|
|
31
|
+
exit 0; \
|
|
32
|
+
fi; \
|
|
33
|
+
npm publish --access public --registry https://registry.npmjs.org; \
|
|
34
|
+
git tag -a "$(TAG)" -m "ts v$(VERSION)"; \
|
|
35
|
+
url=$$(git remote get-url origin | sed -E 's#^git@github.com:#https://github.com/#'); \
|
|
36
|
+
if [ -n "$$token" ] && printf '%s' "$$url" | grep -q '^https://github.com/'; then \
|
|
37
|
+
hdr="AUTHORIZATION: basic $$(printf 'x-access-token:%s' "$$token" | base64 | tr -d '\n')"; \
|
|
38
|
+
git -c http.extraheader="$$hdr" push "$$url" "$(TAG)"; \
|
|
39
|
+
else \
|
|
40
|
+
git push origin "$(TAG)"; \
|
|
41
|
+
fi; \
|
|
42
|
+
echo "Published to npm + tag $(TAG)."
|
|
@@ -86,10 +86,15 @@ class Context {
|
|
|
86
86
|
|
|
87
87
|
|
|
88
88
|
resolveOp(opname: string): Operation {
|
|
89
|
-
|
|
89
|
+
// Cache key is `<entity>:<opname>` so two entities with the same op
|
|
90
|
+
// (e.g. both have a "list") get distinct cached Operations. Keying on
|
|
91
|
+
// opname alone caused the first-resolved entity's points to be served
|
|
92
|
+
// to every subsequent entity's call.
|
|
93
|
+
const entname = getprop(this.entity, 'name', '')
|
|
94
|
+
const cacheKey = entname + ':' + opname
|
|
95
|
+
let op: Operation = getprop(this.opmap, cacheKey)
|
|
90
96
|
|
|
91
97
|
if (null == op && null != opname) {
|
|
92
|
-
const entname = getprop(this.entity, 'name', '')
|
|
93
98
|
const opcfg = getpath(this.config, ['entity', entname, 'op', opname])
|
|
94
99
|
let input = 'match'
|
|
95
100
|
|
|
@@ -104,7 +109,7 @@ class Context {
|
|
|
104
109
|
points: getprop(opcfg, 'points', [])
|
|
105
110
|
})
|
|
106
111
|
|
|
107
|
-
setprop(this.opmap,
|
|
112
|
+
setprop(this.opmap, cacheKey, op)
|
|
108
113
|
}
|
|
109
114
|
|
|
110
115
|
return op
|
package/src/action/action.ts
CHANGED
|
@@ -12,19 +12,25 @@ import type {
|
|
|
12
12
|
} from '../types'
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
// Append `@"<name>.jsonic"` import lines for each name not already present in
|
|
16
|
+
// the index content. Checking against the accumulating result (not the
|
|
17
|
+
// original) means duplicate names in the same call are added at most once.
|
|
18
|
+
function appendIndexEntries(content: string, names: string[]): string {
|
|
19
|
+
let out = content
|
|
20
|
+
|
|
21
|
+
for (const n of names) {
|
|
22
|
+
const entry = `@"${n}.jsonic"`
|
|
23
|
+
if (!out.includes(entry)) {
|
|
24
|
+
out += '\n' + entry
|
|
25
|
+
}
|
|
26
|
+
}
|
|
17
27
|
|
|
18
|
-
|
|
19
|
-
|
|
28
|
+
return out
|
|
29
|
+
}
|
|
20
30
|
|
|
21
|
-
names.map((n: string) => {
|
|
22
|
-
if (!oldcontent.includes(`@"${n}.jsonic"`)) {
|
|
23
|
-
newcontent += `\n@"${n}.jsonic"`
|
|
24
|
-
}
|
|
25
|
-
})
|
|
26
31
|
|
|
27
|
-
|
|
32
|
+
const UpdateIndex = cmp(function UpdateIndex(props: any) {
|
|
33
|
+
Content(appendIndexEntries(props.content, props.names))
|
|
28
34
|
})
|
|
29
35
|
|
|
30
36
|
|
|
@@ -49,5 +55,6 @@ function loadContent(actx: ActionContext, which: string | string[]) {
|
|
|
49
55
|
|
|
50
56
|
export {
|
|
51
57
|
UpdateIndex,
|
|
58
|
+
appendIndexEntries,
|
|
52
59
|
loadContent
|
|
53
60
|
}
|
package/src/action/feature.ts
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import Path from 'node:path'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
-
Jostraca,
|
|
6
5
|
Project,
|
|
7
6
|
File,
|
|
8
7
|
Folder,
|
|
@@ -64,7 +63,10 @@ async function cmd_feature_add(args: string[], actx: ActionContext): Promise<Act
|
|
|
64
63
|
|
|
65
64
|
async function feature_add(features: string[], actx: ActionContext): Promise<ActionResult> {
|
|
66
65
|
|
|
67
|
-
|
|
66
|
+
// Reuse the caller's Jostraca instance so feature generation honours the
|
|
67
|
+
// shared controls (notably `dryrun`). A fresh Jostraca() defaults dryrun
|
|
68
|
+
// to false and would write files during a dry run.
|
|
69
|
+
const jostraca = actx.jostraca
|
|
68
70
|
|
|
69
71
|
const opts = {
|
|
70
72
|
fs: actx.fs,
|
|
@@ -129,12 +131,12 @@ const FeatureRoot = cmp(function FeatureRoot(props: any) {
|
|
|
129
131
|
}))
|
|
130
132
|
})
|
|
131
133
|
|
|
132
|
-
each(target, (
|
|
133
|
-
Folder({ name: 'tm/' +
|
|
134
|
+
each(target, (t) =>
|
|
135
|
+
Folder({ name: 'tm/' + t.name + '/src/feature/' + fname }, () => {
|
|
134
136
|
const from = Path.join(
|
|
135
|
-
(
|
|
137
|
+
(t.base || Path.join(BASE, '/project/.sdk')),
|
|
136
138
|
'tm',
|
|
137
|
-
|
|
139
|
+
t.name,
|
|
138
140
|
'/src/feature/',
|
|
139
141
|
fname
|
|
140
142
|
)
|
package/src/action/target.ts
CHANGED
|
@@ -87,17 +87,22 @@ async function target_add(targets: string[], actx: ActionContext): Promise<Actio
|
|
|
87
87
|
})
|
|
88
88
|
|
|
89
89
|
|
|
90
|
-
const jres = await jostraca.generate(opts, () => TargetRoot({ targets, actx }))
|
|
91
|
-
|
|
92
|
-
showChanges(opts.log, 'target-result', jres)
|
|
93
|
-
|
|
94
90
|
// The `test` feature is required by every generated target (SDK.test()
|
|
95
91
|
// depends on it), so ensure it is added even if the model does not yet
|
|
96
92
|
// declare it.
|
|
97
93
|
const features = Array.from(new Set([
|
|
98
94
|
'test',
|
|
99
|
-
...Object.keys(actx.model.main[KIT]
|
|
95
|
+
...Object.keys(actx.model.main[KIT]?.feature ?? {}),
|
|
100
96
|
]))
|
|
97
|
+
|
|
98
|
+
const jres = await jostraca.generate(opts, () =>
|
|
99
|
+
TargetRoot({ targets, features, actx }))
|
|
100
|
+
|
|
101
|
+
showChanges(opts.log, 'target-result', jres)
|
|
102
|
+
|
|
103
|
+
// feature_add copies feature templates for targets already registered in
|
|
104
|
+
// the model. The targets added above are not in the in-memory model yet,
|
|
105
|
+
// so TargetRoot copies their feature templates itself.
|
|
101
106
|
await feature_add(features, actx)
|
|
102
107
|
|
|
103
108
|
opts.log.info({
|
|
@@ -112,7 +117,7 @@ async function target_add(targets: string[], actx: ActionContext): Promise<Actio
|
|
|
112
117
|
|
|
113
118
|
|
|
114
119
|
const TargetRoot = cmp(function TargetRoot(props: any) {
|
|
115
|
-
const { ctx$, targets } = props
|
|
120
|
+
const { ctx$, targets, features } = props
|
|
116
121
|
const { model, log } = ctx$
|
|
117
122
|
|
|
118
123
|
// TODO: jostraca - make from value easier to specify
|
|
@@ -174,8 +179,11 @@ const TargetRoot = cmp(function TargetRoot(props: any) {
|
|
|
174
179
|
Folder({ name: 'src/feature' }, () => {
|
|
175
180
|
Copy({ from: tfolder + '/tm/' + torigname + '/src/feature/README.md' })
|
|
176
181
|
|
|
177
|
-
|
|
178
|
-
|
|
182
|
+
each(Array.from(new Set(['base', ...(features ?? [])])), (f: any) => {
|
|
183
|
+
const fname = f.val$
|
|
184
|
+
Folder({ name: fname }, () => {
|
|
185
|
+
Copy({ from: tfolder + '/tm/' + torigname + '/src/feature/' + fname })
|
|
186
|
+
})
|
|
179
187
|
})
|
|
180
188
|
})
|
|
181
189
|
})
|
|
@@ -256,4 +264,5 @@ function resolveTarget(tref: string, ctx$: any) {
|
|
|
256
264
|
export {
|
|
257
265
|
action_target,
|
|
258
266
|
target_add,
|
|
267
|
+
resolveTarget,
|
|
259
268
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { cmp, Content, File } from 'jostraca'
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
// Root CHANGELOG.md seed. Generated as an initial "Keep a Changelog" skeleton;
|
|
5
|
+
// the version reflects the lockstep SDK version at generation time. (Publish
|
|
6
|
+
// history is carried by the git release tags <target>/vX.Y.Z.)
|
|
7
|
+
const Changelog = cmp(function Changelog(props: any) {
|
|
8
|
+
const { ctx$ } = props
|
|
9
|
+
const { model } = ctx$
|
|
10
|
+
|
|
11
|
+
const name = model.Name || model.name
|
|
12
|
+
|
|
13
|
+
File({ name: 'CHANGELOG.md' }, () => {
|
|
14
|
+
Content(`# Changelog
|
|
15
|
+
|
|
16
|
+
All notable changes to the generated ${name} SDK are documented here.
|
|
17
|
+
This project follows [Keep a Changelog](https://keepachangelog.com) and
|
|
18
|
+
[Semantic Versioning](https://semver.org).
|
|
19
|
+
|
|
20
|
+
## [Unreleased]
|
|
21
|
+
|
|
22
|
+
## [0.0.1]
|
|
23
|
+
|
|
24
|
+
- Initial generated release of the ${name} SDK (TypeScript, Python, PHP, Go,
|
|
25
|
+
Ruby, and Lua, plus CLI and MCP surfaces), generated from the upstream
|
|
26
|
+
OpenAPI specification by @voxgig/sdkgen.
|
|
27
|
+
`)
|
|
28
|
+
})
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
Changelog
|
|
34
|
+
}
|