@voxgig/sdkgen 0.35.2 → 0.36.0
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 +1 -1
- package/dist/cmp/Readme.js +5 -5
- package/dist/cmp/Readme.js.map +1 -1
- package/dist/cmp/ReadmeEntity.js +74 -24
- package/dist/cmp/ReadmeEntity.js.map +1 -1
- package/dist/cmp/ReadmeExplanation.d.ts +2 -0
- package/dist/cmp/ReadmeExplanation.js +308 -0
- package/dist/cmp/ReadmeExplanation.js.map +1 -0
- package/dist/cmp/ReadmeHowto.d.ts +2 -0
- package/dist/cmp/ReadmeHowto.js +18 -0
- package/dist/cmp/ReadmeHowto.js.map +1 -0
- package/dist/cmp/ReadmeIntro.js +8 -23
- package/dist/cmp/ReadmeIntro.js.map +1 -1
- package/dist/cmp/ReadmeModel.js +55 -91
- package/dist/cmp/ReadmeModel.js.map +1 -1
- package/dist/cmp/ReadmeOptions.js +35 -11
- package/dist/cmp/ReadmeOptions.js.map +1 -1
- package/dist/cmp/ReadmeQuick.js +4 -1
- package/dist/cmp/ReadmeQuick.js.map +1 -1
- package/dist/cmp/ReadmeRef.js +1042 -40
- package/dist/cmp/ReadmeRef.js.map +1 -1
- package/dist/cmp/ReadmeTop.d.ts +2 -0
- package/dist/cmp/ReadmeTop.js +171 -0
- package/dist/cmp/ReadmeTop.js.map +1 -0
- package/dist/sdkgen.d.ts +7 -1
- package/dist/sdkgen.js +13 -1
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/project/.sdk/model/feature/feature-index.jsonic +5 -0
- package/project/.sdk/model/feature/log.jsonic +5 -1
- package/project/.sdk/model/feature/test.jsonic +1 -1
- package/project/.sdk/model/target/lua.jsonic +23 -0
- package/project/.sdk/model/target/php.jsonic +22 -0
- package/project/.sdk/model/target/py.jsonic +23 -0
- package/project/.sdk/model/target/rb.jsonic +23 -0
- package/project/.sdk/src/cmp/go/Main_go.ts +2 -6
- package/project/.sdk/src/cmp/go/ReadmeExplanation_go.ts +42 -0
- package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +112 -0
- package/project/.sdk/src/cmp/go/ReadmeInstall_go.ts +29 -0
- package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +129 -0
- package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +163 -0
- package/project/.sdk/src/cmp/go/ReadmeTopHowto_go.ts +24 -0
- package/project/.sdk/src/cmp/go/ReadmeTopQuick_go.ts +67 -0
- package/project/.sdk/src/cmp/go/ReadmeTopTest_go.ts +40 -0
- package/project/.sdk/src/cmp/go/TestDirect_go.ts +46 -2
- package/project/.sdk/src/cmp/go/TestEntity_go.ts +360 -160
- package/project/.sdk/src/cmp/go/Test_go.ts +24 -1
- package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +1 -1
- package/project/.sdk/src/cmp/lua/Config_lua.ts +112 -0
- package/project/.sdk/src/cmp/lua/EntityOperation_lua.ts +44 -0
- package/project/.sdk/src/cmp/lua/Entity_lua.ts +62 -0
- package/project/.sdk/src/cmp/lua/MainEntity_lua.ts +23 -0
- package/project/.sdk/src/cmp/lua/Main_lua.ts +133 -0
- package/project/.sdk/src/cmp/lua/Package_lua.ts +80 -0
- package/project/.sdk/src/cmp/lua/ReadmeExplanation_lua.ts +42 -0
- package/project/.sdk/src/cmp/lua/ReadmeHowto_lua.ts +100 -0
- package/project/.sdk/src/cmp/lua/ReadmeInstall_lua.ts +26 -0
- package/project/.sdk/src/cmp/lua/ReadmeModel_lua.ts +129 -0
- package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +99 -0
- package/project/.sdk/src/cmp/lua/ReadmeTopHowto_lua.ts +24 -0
- package/project/.sdk/src/cmp/lua/ReadmeTopQuick_lua.ts +55 -0
- package/project/.sdk/src/cmp/lua/ReadmeTopTest_lua.ts +38 -0
- package/project/.sdk/src/cmp/lua/TestDirect_lua.ts +261 -0
- package/project/.sdk/src/cmp/lua/TestEntity_lua.ts +483 -0
- package/project/.sdk/src/cmp/lua/Test_lua.ts +49 -0
- package/project/.sdk/src/cmp/lua/fragment/Entity.fragment.lua +147 -0
- package/project/.sdk/src/cmp/lua/fragment/EntityCreateOp.fragment.lua +27 -0
- package/project/.sdk/src/cmp/lua/fragment/EntityListOp.fragment.lua +24 -0
- package/project/.sdk/src/cmp/lua/fragment/EntityLoadOp.fragment.lua +30 -0
- package/project/.sdk/src/cmp/lua/fragment/EntityRemoveOp.fragment.lua +30 -0
- package/project/.sdk/src/cmp/lua/fragment/EntityUpdateOp.fragment.lua +30 -0
- package/project/.sdk/src/cmp/lua/fragment/Main.fragment.lua +256 -0
- package/project/.sdk/src/cmp/lua/fragment/SdkError.fragment.lua +26 -0
- package/project/.sdk/src/cmp/lua/tsconfig.json +15 -0
- package/project/.sdk/src/cmp/lua/utility_lua.ts +84 -0
- package/project/.sdk/src/cmp/php/Config_php.ts +107 -0
- package/project/.sdk/src/cmp/php/EntityOperation_php.ts +44 -0
- package/project/.sdk/src/cmp/php/Entity_php.ts +62 -0
- package/project/.sdk/src/cmp/php/MainEntity_php.ts +24 -0
- package/project/.sdk/src/cmp/php/Main_php.ts +135 -0
- package/project/.sdk/src/cmp/php/Package_php.ts +87 -0
- package/project/.sdk/src/cmp/php/ReadmeExplanation_php.ts +42 -0
- package/project/.sdk/src/cmp/php/ReadmeHowto_php.ts +101 -0
- package/project/.sdk/src/cmp/php/ReadmeInstall_php.ts +19 -0
- package/project/.sdk/src/cmp/php/ReadmeModel_php.ts +129 -0
- package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +100 -0
- package/project/.sdk/src/cmp/php/ReadmeTopHowto_php.ts +24 -0
- package/project/.sdk/src/cmp/php/ReadmeTopQuick_php.ts +56 -0
- package/project/.sdk/src/cmp/php/ReadmeTopTest_php.ts +38 -0
- package/project/.sdk/src/cmp/php/TestDirect_php.ts +270 -0
- package/project/.sdk/src/cmp/php/TestEntity_php.ts +484 -0
- package/project/.sdk/src/cmp/php/Test_php.ts +56 -0
- package/project/.sdk/src/cmp/php/fragment/Entity.fragment.php +146 -0
- package/project/.sdk/src/cmp/php/fragment/EntityCreateOp.fragment.php +26 -0
- package/project/.sdk/src/cmp/php/fragment/EntityListOp.fragment.php +23 -0
- package/project/.sdk/src/cmp/php/fragment/EntityLoadOp.fragment.php +29 -0
- package/project/.sdk/src/cmp/php/fragment/EntityRemoveOp.fragment.php +29 -0
- package/project/.sdk/src/cmp/php/fragment/EntityUpdateOp.fragment.php +29 -0
- package/project/.sdk/src/cmp/php/fragment/Main.fragment.php +233 -0
- package/project/.sdk/src/cmp/php/fragment/SdkError.fragment.php +24 -0
- package/project/.sdk/src/cmp/php/tsconfig.json +15 -0
- package/project/.sdk/src/cmp/php/utility_php.ts +85 -0
- package/project/.sdk/src/cmp/py/Config_py.ts +93 -0
- package/project/.sdk/src/cmp/py/EntityOperation_py.ts +44 -0
- package/project/.sdk/src/cmp/py/Entity_py.ts +62 -0
- package/project/.sdk/src/cmp/py/MainEntity_py.ts +22 -0
- package/project/.sdk/src/cmp/py/Main_py.ts +156 -0
- package/project/.sdk/src/cmp/py/Package_py.ts +75 -0
- package/project/.sdk/src/cmp/py/ReadmeExplanation_py.ts +41 -0
- package/project/.sdk/src/cmp/py/ReadmeHowto_py.ts +98 -0
- package/project/.sdk/src/cmp/py/ReadmeInstall_py.ts +25 -0
- package/project/.sdk/src/cmp/py/ReadmeModel_py.ts +130 -0
- package/project/.sdk/src/cmp/py/ReadmeQuick_py.ts +100 -0
- package/project/.sdk/src/cmp/py/ReadmeTopHowto_py.ts +24 -0
- package/project/.sdk/src/cmp/py/ReadmeTopQuick_py.ts +56 -0
- package/project/.sdk/src/cmp/py/ReadmeTopTest_py.ts +38 -0
- package/project/.sdk/src/cmp/py/TestDirect_py.ts +248 -0
- package/project/.sdk/src/cmp/py/TestEntity_py.ts +475 -0
- package/project/.sdk/src/cmp/py/Test_py.ts +55 -0
- package/project/.sdk/src/cmp/py/fragment/Entity.fragment.py +112 -0
- package/project/.sdk/src/cmp/py/fragment/EntityCreateOp.fragment.py +25 -0
- package/project/.sdk/src/cmp/py/fragment/EntityListOp.fragment.py +22 -0
- package/project/.sdk/src/cmp/py/fragment/EntityLoadOp.fragment.py +27 -0
- package/project/.sdk/src/cmp/py/fragment/EntityRemoveOp.fragment.py +27 -0
- package/project/.sdk/src/cmp/py/fragment/EntityUpdateOp.fragment.py +27 -0
- package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +222 -0
- package/project/.sdk/src/cmp/py/fragment/SdkError.fragment.py +16 -0
- package/project/.sdk/src/cmp/py/tsconfig.json +15 -0
- package/project/.sdk/src/cmp/py/utility_py.ts +84 -0
- package/project/.sdk/src/cmp/rb/Config_rb.ts +101 -0
- package/project/.sdk/src/cmp/rb/EntityOperation_rb.ts +44 -0
- package/project/.sdk/src/cmp/rb/Entity_rb.ts +62 -0
- package/project/.sdk/src/cmp/rb/MainEntity_rb.ts +23 -0
- package/project/.sdk/src/cmp/rb/Main_rb.ts +130 -0
- package/project/.sdk/src/cmp/rb/Package_rb.ts +111 -0
- package/project/.sdk/src/cmp/rb/ReadmeExplanation_rb.ts +42 -0
- package/project/.sdk/src/cmp/rb/ReadmeHowto_rb.ts +98 -0
- package/project/.sdk/src/cmp/rb/ReadmeInstall_rb.ts +31 -0
- package/project/.sdk/src/cmp/rb/ReadmeModel_rb.ts +129 -0
- package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +99 -0
- package/project/.sdk/src/cmp/rb/ReadmeTopHowto_rb.ts +24 -0
- package/project/.sdk/src/cmp/rb/ReadmeTopQuick_rb.ts +55 -0
- package/project/.sdk/src/cmp/rb/ReadmeTopTest_rb.ts +38 -0
- package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +260 -0
- package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +476 -0
- package/project/.sdk/src/cmp/rb/Test_rb.ts +50 -0
- package/project/.sdk/src/cmp/rb/fragment/Entity.fragment.rb +116 -0
- package/project/.sdk/src/cmp/rb/fragment/EntityCreateOp.fragment.rb +25 -0
- package/project/.sdk/src/cmp/rb/fragment/EntityListOp.fragment.rb +20 -0
- package/project/.sdk/src/cmp/rb/fragment/EntityLoadOp.fragment.rb +26 -0
- package/project/.sdk/src/cmp/rb/fragment/EntityRemoveOp.fragment.rb +26 -0
- package/project/.sdk/src/cmp/rb/fragment/EntityUpdateOp.fragment.rb +26 -0
- package/project/.sdk/src/cmp/rb/fragment/Main.fragment.rb +203 -0
- package/project/.sdk/src/cmp/rb/fragment/SdkError.fragment.rb +16 -0
- package/project/.sdk/src/cmp/rb/tsconfig.json +15 -0
- package/project/.sdk/src/cmp/rb/utility_rb.ts +84 -0
- package/project/.sdk/src/cmp/ts/ReadmeExplanation_ts.ts +34 -0
- package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +123 -0
- package/project/.sdk/src/cmp/ts/ReadmeInstall_ts.ts +1 -1
- package/project/.sdk/src/cmp/ts/ReadmeModel_ts.ts +159 -0
- package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +69 -54
- package/project/.sdk/src/cmp/ts/ReadmeTopHowto_ts.ts +25 -0
- package/project/.sdk/src/cmp/ts/ReadmeTopQuick_ts.ts +65 -0
- package/project/.sdk/src/cmp/ts/ReadmeTopTest_ts.ts +36 -0
- package/project/.sdk/tm/go/feature/log_feature.go +133 -0
- package/project/.sdk/tm/go/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/lua/LICENSE +22 -0
- package/project/.sdk/tm/lua/Makefile +10 -0
- package/project/.sdk/tm/lua/core/context.lua +208 -0
- package/project/.sdk/tm/lua/core/control.lua +17 -0
- package/project/.sdk/tm/lua/core/error.lua +30 -0
- package/project/.sdk/tm/lua/core/helpers.lua +30 -0
- package/project/.sdk/tm/lua/core/operation.lua +51 -0
- package/project/.sdk/tm/lua/core/response.lua +45 -0
- package/project/.sdk/tm/lua/core/result.lua +58 -0
- package/project/.sdk/tm/lua/core/spec.lua +29 -0
- package/project/.sdk/tm/lua/core/utility_type.lua +90 -0
- package/project/.sdk/tm/lua/feature/base_feature.lua +35 -0
- package/project/.sdk/tm/lua/feature/log_feature.lua +80 -0
- package/project/.sdk/tm/lua/feature/test_feature.lua +202 -0
- package/project/.sdk/tm/lua/src/feature/README.md +3 -0
- package/project/.sdk/tm/lua/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/lua/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/lua/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/lua/test/runner.lua +86 -0
- package/project/.sdk/tm/lua/utility/clean.lua +7 -0
- package/project/.sdk/tm/lua/utility/done.lua +19 -0
- package/project/.sdk/tm/lua/utility/feature_add.lua +8 -0
- package/project/.sdk/tm/lua/utility/feature_hook.lua +21 -0
- package/project/.sdk/tm/lua/utility/feature_init.lua +24 -0
- package/project/.sdk/tm/lua/utility/fetcher.lua +96 -0
- package/project/.sdk/tm/lua/utility/make_context.lua +9 -0
- package/project/.sdk/tm/lua/utility/make_error.lua +73 -0
- package/project/.sdk/tm/lua/utility/make_fetch_def.lua +43 -0
- package/project/.sdk/tm/lua/utility/make_options.lua +116 -0
- package/project/.sdk/tm/lua/utility/make_point.lua +92 -0
- package/project/.sdk/tm/lua/utility/make_request.lua +58 -0
- package/project/.sdk/tm/lua/utility/make_response.lua +44 -0
- package/project/.sdk/tm/lua/utility/make_result.lua +51 -0
- package/project/.sdk/tm/lua/utility/make_spec.lua +72 -0
- package/project/.sdk/tm/lua/utility/make_url.lua +46 -0
- package/project/.sdk/tm/lua/utility/param.lua +68 -0
- package/project/.sdk/tm/lua/utility/prepare_auth.lua +39 -0
- package/project/.sdk/tm/lua/utility/prepare_body.lua +14 -0
- package/project/.sdk/tm/lua/utility/prepare_headers.lua +20 -0
- package/project/.sdk/tm/lua/utility/prepare_method.lua +17 -0
- package/project/.sdk/tm/lua/utility/prepare_params.lua +36 -0
- package/project/.sdk/tm/lua/utility/prepare_path.lua +19 -0
- package/project/.sdk/tm/lua/utility/prepare_query.lua +41 -0
- package/project/.sdk/tm/lua/utility/register.lua +71 -0
- package/project/.sdk/tm/lua/utility/result_basic.lua +32 -0
- package/project/.sdk/tm/lua/utility/result_body.lua +17 -0
- package/project/.sdk/tm/lua/utility/result_headers.lua +22 -0
- package/project/.sdk/tm/lua/utility/struct/struct.lua +3417 -0
- package/project/.sdk/tm/lua/utility/transform_request.lua +31 -0
- package/project/.sdk/tm/lua/utility/transform_response.lua +44 -0
- package/project/.sdk/tm/php/LICENSE +22 -0
- package/project/.sdk/tm/php/Makefile +10 -0
- package/project/.sdk/tm/php/core/Context.php +139 -0
- package/project/.sdk/tm/php/core/Control.php +18 -0
- package/project/.sdk/tm/php/core/Error.php +37 -0
- package/project/.sdk/tm/php/core/Helpers.php +25 -0
- package/project/.sdk/tm/php/core/Operation.php +36 -0
- package/project/.sdk/tm/php/core/Response.php +30 -0
- package/project/.sdk/tm/php/core/Result.php +35 -0
- package/project/.sdk/tm/php/core/Spec.php +38 -0
- package/project/.sdk/tm/php/core/UtilityType.php +89 -0
- package/project/.sdk/tm/php/feature/BaseFeature.php +37 -0
- package/project/.sdk/tm/php/feature/LogFeature.php +65 -0
- package/project/.sdk/tm/php/feature/TestFeature.php +193 -0
- package/project/.sdk/tm/php/src/feature/README.md +3 -0
- package/project/.sdk/tm/php/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/php/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/php/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/php/test/Runner.php +89 -0
- package/project/.sdk/tm/php/utility/Clean.php +12 -0
- package/project/.sdk/tm/php/utility/Done.php +26 -0
- package/project/.sdk/tm/php/utility/FeatureAdd.php +12 -0
- package/project/.sdk/tm/php/utility/FeatureHook.php +23 -0
- package/project/.sdk/tm/php/utility/FeatureInit.php +25 -0
- package/project/.sdk/tm/php/utility/Fetcher.php +101 -0
- package/project/.sdk/tm/php/utility/MakeContext.php +14 -0
- package/project/.sdk/tm/php/utility/MakeError.php +59 -0
- package/project/.sdk/tm/php/utility/MakeFetchDef.php +36 -0
- package/project/.sdk/tm/php/utility/MakeOptions.php +98 -0
- package/project/.sdk/tm/php/utility/MakePoint.php +87 -0
- package/project/.sdk/tm/php/utility/MakeRequest.php +57 -0
- package/project/.sdk/tm/php/utility/MakeResponse.php +43 -0
- package/project/.sdk/tm/php/utility/MakeResult.php +50 -0
- package/project/.sdk/tm/php/utility/MakeSpec.php +64 -0
- package/project/.sdk/tm/php/utility/MakeUrl.php +41 -0
- package/project/.sdk/tm/php/utility/Param.php +66 -0
- package/project/.sdk/tm/php/utility/PrepareAuth.php +33 -0
- package/project/.sdk/tm/php/utility/PrepareBody.php +15 -0
- package/project/.sdk/tm/php/utility/PrepareHeaders.php +18 -0
- package/project/.sdk/tm/php/utility/PrepareMethod.php +21 -0
- package/project/.sdk/tm/php/utility/PrepareParams.php +34 -0
- package/project/.sdk/tm/php/utility/PreparePath.php +20 -0
- package/project/.sdk/tm/php/utility/PrepareQuery.php +32 -0
- package/project/.sdk/tm/php/utility/Register.php +67 -0
- package/project/.sdk/tm/php/utility/ResultBasic.php +29 -0
- package/project/.sdk/tm/php/utility/ResultBody.php +17 -0
- package/project/.sdk/tm/php/utility/ResultHeaders.php +21 -0
- package/project/.sdk/tm/php/utility/TransformRequest.php +27 -0
- package/project/.sdk/tm/php/utility/TransformResponse.php +42 -0
- package/project/.sdk/tm/php/utility/struct/Struct.php +3431 -0
- package/project/.sdk/tm/py/Makefile +10 -0
- package/project/.sdk/tm/py/core/__init__.py +0 -0
- package/project/.sdk/tm/py/core/context.py +199 -0
- package/project/.sdk/tm/py/core/control.py +12 -0
- package/project/.sdk/tm/py/core/error.py +18 -0
- package/project/.sdk/tm/py/core/helpers.py +15 -0
- package/project/.sdk/tm/py/core/operation.py +37 -0
- package/project/.sdk/tm/py/core/response.py +34 -0
- package/project/.sdk/tm/py/core/result.py +44 -0
- package/project/.sdk/tm/py/core/spec.py +23 -0
- package/project/.sdk/tm/py/core/utility_type.py +82 -0
- package/project/.sdk/tm/py/entity/__init__.py +0 -0
- package/project/.sdk/tm/py/feature/__init__.py +0 -0
- package/project/.sdk/tm/py/feature/base_feature.py +61 -0
- package/project/.sdk/tm/py/feature/log_feature.py +84 -0
- package/project/.sdk/tm/py/feature/test_feature.py +164 -0
- package/project/.sdk/tm/py/src/feature/README.md +3 -0
- package/project/.sdk/tm/py/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/py/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/py/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/py/test/__init__.py +0 -0
- package/project/.sdk/tm/py/test/runner.py +77 -0
- package/project/.sdk/tm/py/utility/__init__.py +0 -0
- package/project/.sdk/tm/py/utility/clean.py +5 -0
- package/project/.sdk/tm/py/utility/done.py +14 -0
- package/project/.sdk/tm/py/utility/feature_add.py +6 -0
- package/project/.sdk/tm/py/utility/feature_hook.py +15 -0
- package/project/.sdk/tm/py/utility/feature_init.py +18 -0
- package/project/.sdk/tm/py/utility/fetcher.py +95 -0
- package/project/.sdk/tm/py/utility/make_context.py +7 -0
- package/project/.sdk/tm/py/utility/make_error.py +64 -0
- package/project/.sdk/tm/py/utility/make_fetch_def.py +37 -0
- package/project/.sdk/tm/py/utility/make_options.py +103 -0
- package/project/.sdk/tm/py/utility/make_point.py +74 -0
- package/project/.sdk/tm/py/utility/make_request.py +52 -0
- package/project/.sdk/tm/py/utility/make_response.py +36 -0
- package/project/.sdk/tm/py/utility/make_result.py +41 -0
- package/project/.sdk/tm/py/utility/make_spec.py +68 -0
- package/project/.sdk/tm/py/utility/make_url.py +34 -0
- package/project/.sdk/tm/py/utility/param.py +55 -0
- package/project/.sdk/tm/py/utility/prepare_auth.py +34 -0
- package/project/.sdk/tm/py/utility/prepare_body.py +11 -0
- package/project/.sdk/tm/py/utility/prepare_headers.py +17 -0
- package/project/.sdk/tm/py/utility/prepare_method.py +15 -0
- package/project/.sdk/tm/py/utility/prepare_params.py +28 -0
- package/project/.sdk/tm/py/utility/prepare_path.py +16 -0
- package/project/.sdk/tm/py/utility/prepare_query.py +33 -0
- package/project/.sdk/tm/py/utility/register.py +68 -0
- package/project/.sdk/tm/py/utility/result_basic.py +26 -0
- package/project/.sdk/tm/py/utility/result_body.py +13 -0
- package/project/.sdk/tm/py/utility/result_headers.py +17 -0
- package/project/.sdk/tm/py/utility/transform_request.py +27 -0
- package/project/.sdk/tm/py/utility/transform_response.py +39 -0
- package/project/.sdk/tm/py/utility/voxgig_struct/__init__.py +72 -0
- package/project/.sdk/tm/py/utility/voxgig_struct/voxgig_struct.py +2770 -0
- package/project/.sdk/tm/rb/Gemfile +4 -0
- package/project/.sdk/tm/rb/LICENSE +22 -0
- package/project/.sdk/tm/rb/Makefile +10 -0
- package/project/.sdk/tm/rb/core/context.rb +105 -0
- package/project/.sdk/tm/rb/core/control.rb +11 -0
- package/project/.sdk/tm/rb/core/error.rb +24 -0
- package/project/.sdk/tm/rb/core/helpers.rb +16 -0
- package/project/.sdk/tm/rb/core/operation.rb +26 -0
- package/project/.sdk/tm/rb/core/response.rb +20 -0
- package/project/.sdk/tm/rb/core/result.rb +23 -0
- package/project/.sdk/tm/rb/core/spec.rb +23 -0
- package/project/.sdk/tm/rb/core/utility_type.rb +32 -0
- package/project/.sdk/tm/rb/feature/base_feature.rb +30 -0
- package/project/.sdk/tm/rb/feature/log_feature.rb +50 -0
- package/project/.sdk/tm/rb/feature/test_feature.rb +154 -0
- package/project/.sdk/tm/rb/src/feature/README.md +3 -0
- package/project/.sdk/tm/rb/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/rb/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/rb/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/rb/test/runner.rb +65 -0
- package/project/.sdk/tm/rb/utility/clean.rb +4 -0
- package/project/.sdk/tm/rb/utility/done.rb +14 -0
- package/project/.sdk/tm/rb/utility/feature_add.rb +6 -0
- package/project/.sdk/tm/rb/utility/feature_hook.rb +11 -0
- package/project/.sdk/tm/rb/utility/feature_init.rb +16 -0
- package/project/.sdk/tm/rb/utility/fetcher.rb +67 -0
- package/project/.sdk/tm/rb/utility/make_context.rb +7 -0
- package/project/.sdk/tm/rb/utility/make_error.rb +44 -0
- package/project/.sdk/tm/rb/utility/make_fetch_def.rb +24 -0
- package/project/.sdk/tm/rb/utility/make_options.rb +57 -0
- package/project/.sdk/tm/rb/utility/make_point.rb +77 -0
- package/project/.sdk/tm/rb/utility/make_request.rb +44 -0
- package/project/.sdk/tm/rb/utility/make_response.rb +25 -0
- package/project/.sdk/tm/rb/utility/make_result.rb +33 -0
- package/project/.sdk/tm/rb/utility/make_spec.rb +50 -0
- package/project/.sdk/tm/rb/utility/make_url.rb +32 -0
- package/project/.sdk/tm/rb/utility/param.rb +48 -0
- package/project/.sdk/tm/rb/utility/prepare_auth.rb +26 -0
- package/project/.sdk/tm/rb/utility/prepare_body.rb +6 -0
- package/project/.sdk/tm/rb/utility/prepare_headers.rb +11 -0
- package/project/.sdk/tm/rb/utility/prepare_method.rb +5 -0
- package/project/.sdk/tm/rb/utility/prepare_params.rb +25 -0
- package/project/.sdk/tm/rb/utility/prepare_path.rb +13 -0
- package/project/.sdk/tm/rb/utility/prepare_query.rb +22 -0
- package/project/.sdk/tm/rb/utility/register.rb +63 -0
- package/project/.sdk/tm/rb/utility/result_basic.rb +23 -0
- package/project/.sdk/tm/rb/utility/result_body.rb +11 -0
- package/project/.sdk/tm/rb/utility/result_headers.rb +15 -0
- package/project/.sdk/tm/rb/utility/struct/voxgig_struct.rb +2256 -0
- package/project/.sdk/tm/rb/utility/transform_request.rb +15 -0
- package/project/.sdk/tm/rb/utility/transform_response.rb +23 -0
- package/src/cmp/Readme.ts +5 -5
- package/src/cmp/ReadmeEntity.ts +77 -25
- package/src/cmp/ReadmeExplanation.ts +333 -0
- package/src/cmp/ReadmeHowto.ts +28 -0
- package/src/cmp/ReadmeIntro.ts +10 -24
- package/src/cmp/ReadmeModel.ts +57 -88
- package/src/cmp/ReadmeOptions.ts +40 -11
- package/src/cmp/ReadmeQuick.ts +4 -1
- package/src/cmp/ReadmeRef.ts +1057 -40
- package/src/cmp/ReadmeTop.ts +213 -0
- package/src/sdkgen.ts +12 -0
- package/project/.sdk/tm/go/test/exists_test.go +0 -16
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) $$const.year$$ $$const.Name$$
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# ProjectName SDK context
|
|
2
|
+
|
|
3
|
+
require_relative '../utility/struct/voxgig_struct'
|
|
4
|
+
require_relative 'control'
|
|
5
|
+
require_relative 'operation'
|
|
6
|
+
require_relative 'spec'
|
|
7
|
+
require_relative 'result'
|
|
8
|
+
require_relative 'response'
|
|
9
|
+
require_relative 'error'
|
|
10
|
+
require_relative 'helpers'
|
|
11
|
+
|
|
12
|
+
class ProjectNameContext
|
|
13
|
+
attr_accessor :id, :out, :client, :utility, :ctrl, :meta, :config,
|
|
14
|
+
:entopts, :options, :entity, :shared, :opmap,
|
|
15
|
+
:data, :reqdata, :match, :reqmatch, :point,
|
|
16
|
+
:spec, :result, :response, :op
|
|
17
|
+
|
|
18
|
+
def initialize(ctxmap = {}, basectx = nil)
|
|
19
|
+
ctxmap ||= {}
|
|
20
|
+
@id = "C#{rand(10000000..99999999)}"
|
|
21
|
+
@out = {}
|
|
22
|
+
|
|
23
|
+
@client = ProjectNameHelpers.get_ctx_prop(ctxmap, "client") || basectx&.client
|
|
24
|
+
@utility = ProjectNameHelpers.get_ctx_prop(ctxmap, "utility") || basectx&.utility
|
|
25
|
+
|
|
26
|
+
@ctrl = ProjectNameControl.new
|
|
27
|
+
ctrl_raw = ProjectNameHelpers.get_ctx_prop(ctxmap, "ctrl")
|
|
28
|
+
if ctrl_raw.is_a?(Hash)
|
|
29
|
+
@ctrl.throw_err = ctrl_raw["throw"] if ctrl_raw.key?("throw")
|
|
30
|
+
@ctrl.explain = ctrl_raw["explain"] if ctrl_raw["explain"].is_a?(Hash)
|
|
31
|
+
elsif basectx&.ctrl
|
|
32
|
+
@ctrl = basectx.ctrl
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
m = ProjectNameHelpers.get_ctx_prop(ctxmap, "meta")
|
|
36
|
+
@meta = m.is_a?(Hash) ? m : (basectx&.meta || {})
|
|
37
|
+
|
|
38
|
+
cfg = ProjectNameHelpers.get_ctx_prop(ctxmap, "config")
|
|
39
|
+
@config = cfg.is_a?(Hash) ? cfg : basectx&.config
|
|
40
|
+
|
|
41
|
+
eo = ProjectNameHelpers.get_ctx_prop(ctxmap, "entopts")
|
|
42
|
+
@entopts = eo.is_a?(Hash) ? eo : basectx&.entopts
|
|
43
|
+
|
|
44
|
+
o = ProjectNameHelpers.get_ctx_prop(ctxmap, "options")
|
|
45
|
+
@options = o.is_a?(Hash) ? o : basectx&.options
|
|
46
|
+
|
|
47
|
+
e = ProjectNameHelpers.get_ctx_prop(ctxmap, "entity")
|
|
48
|
+
@entity = e || basectx&.entity
|
|
49
|
+
|
|
50
|
+
s = ProjectNameHelpers.get_ctx_prop(ctxmap, "shared")
|
|
51
|
+
@shared = s.is_a?(Hash) ? s : basectx&.shared
|
|
52
|
+
|
|
53
|
+
om = ProjectNameHelpers.get_ctx_prop(ctxmap, "opmap")
|
|
54
|
+
@opmap = om.is_a?(Hash) ? om : (basectx&.opmap || {})
|
|
55
|
+
|
|
56
|
+
@data = ProjectNameHelpers.to_map(ProjectNameHelpers.get_ctx_prop(ctxmap, "data")) || {}
|
|
57
|
+
@reqdata = ProjectNameHelpers.to_map(ProjectNameHelpers.get_ctx_prop(ctxmap, "reqdata")) || {}
|
|
58
|
+
@match = ProjectNameHelpers.to_map(ProjectNameHelpers.get_ctx_prop(ctxmap, "match")) || {}
|
|
59
|
+
@reqmatch = ProjectNameHelpers.to_map(ProjectNameHelpers.get_ctx_prop(ctxmap, "reqmatch")) || {}
|
|
60
|
+
|
|
61
|
+
pt = ProjectNameHelpers.get_ctx_prop(ctxmap, "point")
|
|
62
|
+
@point = pt.is_a?(Hash) ? pt : basectx&.point
|
|
63
|
+
|
|
64
|
+
sp = ProjectNameHelpers.get_ctx_prop(ctxmap, "spec")
|
|
65
|
+
@spec = sp.is_a?(ProjectNameSpec) ? sp : basectx&.spec
|
|
66
|
+
|
|
67
|
+
r = ProjectNameHelpers.get_ctx_prop(ctxmap, "result")
|
|
68
|
+
@result = r.is_a?(ProjectNameResult) ? r : basectx&.result
|
|
69
|
+
|
|
70
|
+
rp = ProjectNameHelpers.get_ctx_prop(ctxmap, "response")
|
|
71
|
+
@response = rp.is_a?(ProjectNameResponse) ? rp : basectx&.response
|
|
72
|
+
|
|
73
|
+
opname = ProjectNameHelpers.get_ctx_prop(ctxmap, "opname") || ""
|
|
74
|
+
@op = resolve_op(opname)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def resolve_op(opname)
|
|
78
|
+
return @opmap[opname] if @opmap[opname]
|
|
79
|
+
return ProjectNameOperation.new({}) if opname.empty?
|
|
80
|
+
|
|
81
|
+
entname = @entity&.respond_to?(:get_name) ? @entity.get_name : "_"
|
|
82
|
+
opcfg = VoxgigStruct.getpath(@config, "entity.#{entname}.op.#{opname}")
|
|
83
|
+
|
|
84
|
+
input = (opname == "update" || opname == "create") ? "data" : "match"
|
|
85
|
+
|
|
86
|
+
points = []
|
|
87
|
+
if opcfg.is_a?(Hash)
|
|
88
|
+
t = VoxgigStruct.getprop(opcfg, "points")
|
|
89
|
+
points = t if t.is_a?(Array)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
op = ProjectNameOperation.new({
|
|
93
|
+
"entity" => entname,
|
|
94
|
+
"name" => opname,
|
|
95
|
+
"input" => input,
|
|
96
|
+
"points" => points,
|
|
97
|
+
})
|
|
98
|
+
@opmap[opname] = op
|
|
99
|
+
op
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def make_error(code, msg)
|
|
103
|
+
ProjectNameError.new(code, msg, self)
|
|
104
|
+
end
|
|
105
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# ProjectName SDK error
|
|
2
|
+
|
|
3
|
+
class ProjectNameError < StandardError
|
|
4
|
+
attr_accessor :is_sdk_error, :sdk, :code, :msg, :ctx, :result, :spec
|
|
5
|
+
|
|
6
|
+
def initialize(code = "", msg = "", ctx = nil)
|
|
7
|
+
super(msg)
|
|
8
|
+
@is_sdk_error = true
|
|
9
|
+
@sdk = "ProjectName"
|
|
10
|
+
@code = code
|
|
11
|
+
@msg = msg
|
|
12
|
+
@ctx = ctx
|
|
13
|
+
@result = nil
|
|
14
|
+
@spec = nil
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def error
|
|
18
|
+
@msg
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def to_s
|
|
22
|
+
@msg
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# ProjectName SDK helpers
|
|
2
|
+
|
|
3
|
+
module ProjectNameHelpers
|
|
4
|
+
def self.to_map(v)
|
|
5
|
+
v.is_a?(Hash) ? v : nil
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def self.to_int(v)
|
|
9
|
+
v.is_a?(Numeric) ? v.to_i : -1
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def self.get_ctx_prop(m, key)
|
|
13
|
+
return nil if m.nil?
|
|
14
|
+
m[key]
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# ProjectName SDK operation
|
|
2
|
+
|
|
3
|
+
require_relative '../utility/struct/voxgig_struct'
|
|
4
|
+
|
|
5
|
+
class ProjectNameOperation
|
|
6
|
+
attr_accessor :entity, :name, :input, :points, :alias_map
|
|
7
|
+
|
|
8
|
+
def initialize(opmap = {})
|
|
9
|
+
opmap ||= {}
|
|
10
|
+
e = VoxgigStruct.getprop(opmap, "entity")
|
|
11
|
+
@entity = (e.is_a?(String) && !e.empty?) ? e : "_"
|
|
12
|
+
n = VoxgigStruct.getprop(opmap, "name")
|
|
13
|
+
@name = (n.is_a?(String) && !n.empty?) ? n : "_"
|
|
14
|
+
i = VoxgigStruct.getprop(opmap, "input")
|
|
15
|
+
@input = (i.is_a?(String) && !i.empty?) ? i : "_"
|
|
16
|
+
|
|
17
|
+
@points = []
|
|
18
|
+
raw_points = VoxgigStruct.getprop(opmap, "points")
|
|
19
|
+
if raw_points.is_a?(Array)
|
|
20
|
+
raw_points.each { |t| @points << t if t.is_a?(Hash) }
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
raw_alias = VoxgigStruct.getprop(opmap, "alias")
|
|
24
|
+
@alias_map = raw_alias.is_a?(Hash) ? raw_alias : nil
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# ProjectName SDK response
|
|
2
|
+
|
|
3
|
+
require_relative '../utility/struct/voxgig_struct'
|
|
4
|
+
|
|
5
|
+
class ProjectNameResponse
|
|
6
|
+
attr_accessor :status, :status_text, :headers, :json_func, :body, :err
|
|
7
|
+
|
|
8
|
+
def initialize(resmap = {})
|
|
9
|
+
resmap ||= {}
|
|
10
|
+
s = VoxgigStruct.getprop(resmap, "status")
|
|
11
|
+
@status = s.is_a?(Numeric) ? s.to_i : -1
|
|
12
|
+
st = VoxgigStruct.getprop(resmap, "statusText")
|
|
13
|
+
@status_text = st.is_a?(String) ? st : ""
|
|
14
|
+
@headers = VoxgigStruct.getprop(resmap, "headers")
|
|
15
|
+
jf = VoxgigStruct.getprop(resmap, "json")
|
|
16
|
+
@json_func = jf.is_a?(Proc) ? jf : nil
|
|
17
|
+
@body = VoxgigStruct.getprop(resmap, "body")
|
|
18
|
+
@err = VoxgigStruct.getprop(resmap, "err")
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# ProjectName SDK result
|
|
2
|
+
|
|
3
|
+
require_relative '../utility/struct/voxgig_struct'
|
|
4
|
+
|
|
5
|
+
class ProjectNameResult
|
|
6
|
+
attr_accessor :ok, :status, :status_text, :headers, :body, :err, :resdata, :resmatch
|
|
7
|
+
|
|
8
|
+
def initialize(resmap = {})
|
|
9
|
+
resmap ||= {}
|
|
10
|
+
@ok = VoxgigStruct.getprop(resmap, "ok") == true
|
|
11
|
+
s = VoxgigStruct.getprop(resmap, "status")
|
|
12
|
+
@status = s.is_a?(Numeric) ? s.to_i : -1
|
|
13
|
+
st = VoxgigStruct.getprop(resmap, "statusText")
|
|
14
|
+
@status_text = st.is_a?(String) ? st : ""
|
|
15
|
+
h = VoxgigStruct.getprop(resmap, "headers")
|
|
16
|
+
@headers = h.is_a?(Hash) ? h : {}
|
|
17
|
+
@body = VoxgigStruct.getprop(resmap, "body")
|
|
18
|
+
@err = VoxgigStruct.getprop(resmap, "err")
|
|
19
|
+
@resdata = VoxgigStruct.getprop(resmap, "resdata")
|
|
20
|
+
rm = VoxgigStruct.getprop(resmap, "resmatch")
|
|
21
|
+
@resmatch = rm.is_a?(Hash) ? rm : nil
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# ProjectName SDK spec
|
|
2
|
+
|
|
3
|
+
class ProjectNameSpec
|
|
4
|
+
attr_accessor :parts, :headers, :alias_map, :base, :prefix, :suffix,
|
|
5
|
+
:params, :query, :step, :method, :body, :url, :path
|
|
6
|
+
|
|
7
|
+
def initialize(specmap = {})
|
|
8
|
+
specmap ||= {}
|
|
9
|
+
@parts = specmap["parts"] || specmap[:parts] || []
|
|
10
|
+
@headers = specmap["headers"] || specmap[:headers] || {}
|
|
11
|
+
@alias_map = specmap["alias"] || specmap[:alias] || {}
|
|
12
|
+
@base = specmap["base"] || specmap[:base] || ""
|
|
13
|
+
@prefix = specmap["prefix"] || specmap[:prefix] || ""
|
|
14
|
+
@suffix = specmap["suffix"] || specmap[:suffix] || ""
|
|
15
|
+
@params = specmap["params"] || specmap[:params] || {}
|
|
16
|
+
@query = specmap["query"] || specmap[:query] || {}
|
|
17
|
+
@step = specmap["step"] || specmap[:step] || ""
|
|
18
|
+
@method = specmap["method"] || specmap[:method] || "GET"
|
|
19
|
+
@body = specmap["body"] || specmap[:body]
|
|
20
|
+
@url = specmap["url"] || specmap[:url] || ""
|
|
21
|
+
@path = specmap["path"] || specmap[:path] || ""
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# ProjectName SDK utility type
|
|
2
|
+
|
|
3
|
+
class ProjectNameUtility
|
|
4
|
+
attr_accessor :clean, :done, :make_error, :feature_add, :feature_hook,
|
|
5
|
+
:feature_init, :fetcher, :make_fetch_def, :make_context,
|
|
6
|
+
:make_options, :make_request, :make_response, :make_result,
|
|
7
|
+
:make_point, :make_spec, :make_url, :param, :prepare_auth,
|
|
8
|
+
:prepare_body, :prepare_headers, :prepare_method,
|
|
9
|
+
:prepare_params, :prepare_path, :prepare_query,
|
|
10
|
+
:result_basic, :result_body, :result_headers,
|
|
11
|
+
:transform_request, :transform_response, :custom
|
|
12
|
+
|
|
13
|
+
@@registrar = nil
|
|
14
|
+
|
|
15
|
+
def self.registrar=(r)
|
|
16
|
+
@@registrar = r
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def initialize
|
|
20
|
+
@custom = {}
|
|
21
|
+
@@registrar&.call(self)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def self.copy(src)
|
|
25
|
+
u = ProjectNameUtility.new
|
|
26
|
+
src.instance_variables.each do |var|
|
|
27
|
+
u.instance_variable_set(var, src.instance_variable_get(var))
|
|
28
|
+
end
|
|
29
|
+
u.instance_variable_set(:@custom, src.custom.dup)
|
|
30
|
+
u
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# ProjectName SDK base feature
|
|
2
|
+
|
|
3
|
+
class ProjectNameBaseFeature
|
|
4
|
+
attr_accessor :version, :name, :active
|
|
5
|
+
|
|
6
|
+
def initialize
|
|
7
|
+
@version = "0.0.1"
|
|
8
|
+
@name = "base"
|
|
9
|
+
@active = true
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def get_version; @version; end
|
|
13
|
+
def get_name; @name; end
|
|
14
|
+
def get_active; @active; end
|
|
15
|
+
|
|
16
|
+
def init(ctx, options); end
|
|
17
|
+
def PostConstruct(ctx); end
|
|
18
|
+
def PostConstructEntity(ctx); end
|
|
19
|
+
def SetData(ctx); end
|
|
20
|
+
def GetData(ctx); end
|
|
21
|
+
def GetMatch(ctx); end
|
|
22
|
+
def SetMatch(ctx); end
|
|
23
|
+
def PrePoint(ctx); end
|
|
24
|
+
def PreSpec(ctx); end
|
|
25
|
+
def PreRequest(ctx); end
|
|
26
|
+
def PreResponse(ctx); end
|
|
27
|
+
def PreResult(ctx); end
|
|
28
|
+
def PreDone(ctx); end
|
|
29
|
+
def PreUnexpected(ctx); end
|
|
30
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# ProjectName SDK log feature
|
|
2
|
+
|
|
3
|
+
require_relative 'base_feature'
|
|
4
|
+
|
|
5
|
+
class ProjectNameLogFeature < ProjectNameBaseFeature
|
|
6
|
+
def initialize
|
|
7
|
+
super
|
|
8
|
+
@version = "0.0.1"
|
|
9
|
+
@name = "log"
|
|
10
|
+
@active = true
|
|
11
|
+
@client = nil
|
|
12
|
+
@options = nil
|
|
13
|
+
@logger = nil
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def init(ctx, options)
|
|
17
|
+
@client = ctx.client
|
|
18
|
+
@options = options
|
|
19
|
+
@active = options["active"] == true
|
|
20
|
+
|
|
21
|
+
if @active
|
|
22
|
+
if options["logger"]
|
|
23
|
+
@logger = options["logger"]
|
|
24
|
+
else
|
|
25
|
+
@logger = $stderr
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def _loghook(hook, ctx, level = "info")
|
|
31
|
+
return unless @logger
|
|
32
|
+
opname = ctx.op ? ctx.op.name : ""
|
|
33
|
+
msg = "hook=#{hook} op=#{opname}"
|
|
34
|
+
if @logger.respond_to?(:puts)
|
|
35
|
+
@logger.puts("[#{level.upcase}] #{msg}")
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def PostConstruct(ctx); _loghook("PostConstruct", ctx); end
|
|
40
|
+
def PostConstructEntity(ctx); _loghook("PostConstructEntity", ctx); end
|
|
41
|
+
def SetData(ctx); _loghook("SetData", ctx); end
|
|
42
|
+
def GetData(ctx); _loghook("GetData", ctx); end
|
|
43
|
+
def SetMatch(ctx); _loghook("SetMatch", ctx); end
|
|
44
|
+
def GetMatch(ctx); _loghook("GetMatch", ctx); end
|
|
45
|
+
def PrePoint(ctx); _loghook("PrePoint", ctx); end
|
|
46
|
+
def PreSpec(ctx); _loghook("PreSpec", ctx); end
|
|
47
|
+
def PreRequest(ctx); _loghook("PreRequest", ctx); end
|
|
48
|
+
def PreResponse(ctx); _loghook("PreResponse", ctx); end
|
|
49
|
+
def PreResult(ctx); _loghook("PreResult", ctx); end
|
|
50
|
+
end
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# ProjectName SDK test feature
|
|
2
|
+
|
|
3
|
+
require_relative '../utility/struct/voxgig_struct'
|
|
4
|
+
require_relative 'base_feature'
|
|
5
|
+
|
|
6
|
+
class ProjectNameTestFeature < ProjectNameBaseFeature
|
|
7
|
+
def initialize
|
|
8
|
+
super
|
|
9
|
+
@version = "0.0.1"
|
|
10
|
+
@name = "test"
|
|
11
|
+
@active = true
|
|
12
|
+
@client = nil
|
|
13
|
+
@options = nil
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def init(ctx, options)
|
|
17
|
+
@client = ctx.client
|
|
18
|
+
@options = options
|
|
19
|
+
|
|
20
|
+
entity = VoxgigStruct.getprop(options, "entity")
|
|
21
|
+
entity = {} unless entity.is_a?(Hash)
|
|
22
|
+
|
|
23
|
+
@client.mode = "test"
|
|
24
|
+
|
|
25
|
+
# Ensure entity ids are correct.
|
|
26
|
+
VoxgigStruct.walk(entity) do |key, val, parent, path|
|
|
27
|
+
if path.length == 2 && val.is_a?(Hash) && key
|
|
28
|
+
val["id"] = key
|
|
29
|
+
end
|
|
30
|
+
val
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
test_self = self
|
|
34
|
+
|
|
35
|
+
test_fetcher = ->(fctx, _fullurl, _fetchdef) {
|
|
36
|
+
respond = ->(status, data, extra) {
|
|
37
|
+
out = {
|
|
38
|
+
"status" => status,
|
|
39
|
+
"statusText" => "OK",
|
|
40
|
+
"json" => -> { data },
|
|
41
|
+
"body" => "not-used",
|
|
42
|
+
}
|
|
43
|
+
extra&.each { |k, v| out[k] = v }
|
|
44
|
+
return out, nil
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
op = fctx.op
|
|
48
|
+
entmap = VoxgigStruct.getprop(entity, op.entity)
|
|
49
|
+
entmap = {} unless entmap.is_a?(Hash)
|
|
50
|
+
|
|
51
|
+
if op.name == "load"
|
|
52
|
+
args = test_self.build_args(fctx, op, fctx.reqmatch)
|
|
53
|
+
found = VoxgigStruct.select(entmap, args)
|
|
54
|
+
ent = VoxgigStruct.getelem(found, 0)
|
|
55
|
+
return respond.call(404, nil, { "statusText" => "Not found" }) unless ent
|
|
56
|
+
VoxgigStruct.delprop(ent, "$KEY")
|
|
57
|
+
out = VoxgigStruct.clone(ent)
|
|
58
|
+
respond.call(200, out, nil)
|
|
59
|
+
|
|
60
|
+
elsif op.name == "list"
|
|
61
|
+
args = test_self.build_args(fctx, op, fctx.reqmatch)
|
|
62
|
+
found = VoxgigStruct.select(entmap, args)
|
|
63
|
+
return respond.call(404, nil, { "statusText" => "Not found" }) unless found
|
|
64
|
+
if found.is_a?(Array)
|
|
65
|
+
found.each { |item| VoxgigStruct.delprop(item, "$KEY") }
|
|
66
|
+
end
|
|
67
|
+
out = VoxgigStruct.clone(found)
|
|
68
|
+
respond.call(200, out, nil)
|
|
69
|
+
|
|
70
|
+
elsif op.name == "update"
|
|
71
|
+
args = test_self.build_args(fctx, op, fctx.reqdata)
|
|
72
|
+
found = VoxgigStruct.select(entmap, args)
|
|
73
|
+
ent = VoxgigStruct.getelem(found, 0)
|
|
74
|
+
return respond.call(404, nil, { "statusText" => "Not found" }) unless ent
|
|
75
|
+
if ent.is_a?(Hash) && fctx.reqdata
|
|
76
|
+
fctx.reqdata.each { |k, v| ent[k] = v }
|
|
77
|
+
end
|
|
78
|
+
VoxgigStruct.delprop(ent, "$KEY")
|
|
79
|
+
out = VoxgigStruct.clone(ent)
|
|
80
|
+
respond.call(200, out, nil)
|
|
81
|
+
|
|
82
|
+
elsif op.name == "remove"
|
|
83
|
+
args = test_self.build_args(fctx, op, fctx.reqmatch)
|
|
84
|
+
found = VoxgigStruct.select(entmap, args)
|
|
85
|
+
ent = VoxgigStruct.getelem(found, 0)
|
|
86
|
+
return respond.call(404, nil, { "statusText" => "Not found" }) unless ent
|
|
87
|
+
if ent.is_a?(Hash)
|
|
88
|
+
id = VoxgigStruct.getprop(ent, "id")
|
|
89
|
+
VoxgigStruct.delprop(entmap, id)
|
|
90
|
+
end
|
|
91
|
+
respond.call(200, nil, nil)
|
|
92
|
+
|
|
93
|
+
elsif op.name == "create"
|
|
94
|
+
test_self.build_args(fctx, op, fctx.reqdata)
|
|
95
|
+
id = fctx.utility.param.call(fctx, "id")
|
|
96
|
+
id ||= "%04x%04x%04x%04x" % [rand(0x10000), rand(0x10000), rand(0x10000), rand(0x10000)]
|
|
97
|
+
|
|
98
|
+
ent = VoxgigStruct.clone(fctx.reqdata)
|
|
99
|
+
if ent.is_a?(Hash)
|
|
100
|
+
ent["id"] = id
|
|
101
|
+
entmap[id.to_s] = ent if id.is_a?(String)
|
|
102
|
+
VoxgigStruct.delprop(ent, "$KEY")
|
|
103
|
+
out = VoxgigStruct.clone(ent)
|
|
104
|
+
return respond.call(200, out, nil)
|
|
105
|
+
end
|
|
106
|
+
respond.call(200, ent, nil)
|
|
107
|
+
|
|
108
|
+
else
|
|
109
|
+
respond.call(404, nil, { "statusText" => "Unknown operation" })
|
|
110
|
+
end
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
ctx.utility.fetcher = test_fetcher
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def build_args(ctx, op, args)
|
|
117
|
+
opname = op.name
|
|
118
|
+
points = VoxgigStruct.getpath(ctx.config, "entity.#{ctx.entity.get_name}.op.#{opname}.points")
|
|
119
|
+
point = VoxgigStruct.getelem(points, -1)
|
|
120
|
+
|
|
121
|
+
params_path = VoxgigStruct.getpath(point, "args.params")
|
|
122
|
+
reqd_params = VoxgigStruct.select(params_path, { "reqd" => true })
|
|
123
|
+
reqd = VoxgigStruct.transform(reqd_params, ["`$EACH`", "", "`$KEY.name`"])
|
|
124
|
+
|
|
125
|
+
qand = []
|
|
126
|
+
q = { "`$AND`" => qand }
|
|
127
|
+
|
|
128
|
+
if args
|
|
129
|
+
keys = VoxgigStruct.keysof(args)
|
|
130
|
+
if keys
|
|
131
|
+
keys.each do |key|
|
|
132
|
+
is_id = (key == "id")
|
|
133
|
+
selected = VoxgigStruct.select(reqd, key)
|
|
134
|
+
is_reqd = !VoxgigStruct.isempty(selected)
|
|
135
|
+
|
|
136
|
+
if is_id || is_reqd
|
|
137
|
+
v = ctx.utility.param.call(ctx, key)
|
|
138
|
+
ka = op.alias_map ? VoxgigStruct.getprop(op.alias_map, key) : nil
|
|
139
|
+
|
|
140
|
+
qor = [{ key => v }]
|
|
141
|
+
qor << { ka => v } if ka.is_a?(String)
|
|
142
|
+
|
|
143
|
+
qand << { "`$OR`" => qor }
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
q["`$AND`"] = qand
|
|
150
|
+
ctx.ctrl.explain["test"] = { "query" => q } if ctx.ctrl.explain
|
|
151
|
+
|
|
152
|
+
q
|
|
153
|
+
end
|
|
154
|
+
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# ProjectName SDK test runner
|
|
2
|
+
|
|
3
|
+
require 'json'
|
|
4
|
+
|
|
5
|
+
module ProjectNameTestRunner
|
|
6
|
+
@env = {}
|
|
7
|
+
|
|
8
|
+
def self.load_env_local
|
|
9
|
+
env_file = File.join(File.dirname(__FILE__), '..', '..', '.env.local')
|
|
10
|
+
return unless File.exist?(env_file)
|
|
11
|
+
|
|
12
|
+
File.readlines(env_file).each do |line|
|
|
13
|
+
line = line.strip
|
|
14
|
+
next if line.empty? || line.start_with?('#')
|
|
15
|
+
key, val = line.split('=', 2)
|
|
16
|
+
next unless key && val
|
|
17
|
+
@env[key.strip] = val.strip
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def self.getenv(key)
|
|
22
|
+
@env[key] || ENV[key]
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def self.env_override(m)
|
|
26
|
+
live = getenv("PROJECTNAME_TEST_LIVE")
|
|
27
|
+
override = getenv("PROJECTNAME_TEST_OVERRIDE")
|
|
28
|
+
|
|
29
|
+
if live == "TRUE" || override == "TRUE"
|
|
30
|
+
m.each_key do |key|
|
|
31
|
+
envval = getenv(key)
|
|
32
|
+
if envval && !envval.empty?
|
|
33
|
+
envval = envval.strip
|
|
34
|
+
if envval.start_with?('{')
|
|
35
|
+
begin
|
|
36
|
+
parsed = JSON.parse(envval)
|
|
37
|
+
m[key] = parsed
|
|
38
|
+
next
|
|
39
|
+
rescue JSON::ParserError
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
m[key] = envval
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
explain = getenv("PROJECTNAME_TEST_EXPLAIN")
|
|
48
|
+
m["PROJECTNAME_TEST_EXPLAIN"] = explain if explain && !explain.empty?
|
|
49
|
+
|
|
50
|
+
m
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def self.entity_list_to_data(list)
|
|
54
|
+
out = []
|
|
55
|
+
list.each do |item|
|
|
56
|
+
if item.is_a?(Hash)
|
|
57
|
+
out << item
|
|
58
|
+
elsif item.respond_to?(:data_get)
|
|
59
|
+
d = item.data_get
|
|
60
|
+
out << d if d.is_a?(Hash)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
out
|
|
64
|
+
end
|
|
65
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# ProjectName SDK utility: done
|
|
2
|
+
module ProjectNameUtilities
|
|
3
|
+
Done = ->(ctx) {
|
|
4
|
+
if ctx.ctrl.explain
|
|
5
|
+
ctx.ctrl.explain = ctx.utility.clean.call(ctx, ctx.ctrl.explain)
|
|
6
|
+
er = ctx.ctrl.explain["result"]
|
|
7
|
+
er.delete("err") if er.is_a?(Hash)
|
|
8
|
+
end
|
|
9
|
+
if ctx.result && ctx.result.ok
|
|
10
|
+
return ctx.result.resdata, nil
|
|
11
|
+
end
|
|
12
|
+
ctx.utility.make_error.call(ctx, nil)
|
|
13
|
+
}
|
|
14
|
+
end
|