@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
package/src/cmp/ReadmeRef.ts
CHANGED
|
@@ -6,8 +6,10 @@ import {
|
|
|
6
6
|
getModelPath
|
|
7
7
|
} from '../types'
|
|
8
8
|
|
|
9
|
+
import { requirePath } from '../utility'
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
|
|
12
|
+
const OP_SIGNATURES_TS: Record<string, { sig: string, returns: string, desc: string }> = {
|
|
11
13
|
load: {
|
|
12
14
|
sig: 'load(match: object, ctrl?: object)',
|
|
13
15
|
returns: 'Promise<object>',
|
|
@@ -35,6 +37,146 @@ const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string
|
|
|
35
37
|
},
|
|
36
38
|
}
|
|
37
39
|
|
|
40
|
+
const OP_SIGNATURES_LUA: Record<string, { sig: string, returns: string, desc: string }> = {
|
|
41
|
+
load: {
|
|
42
|
+
sig: 'load(reqmatch, ctrl) -> any, err',
|
|
43
|
+
returns: 'any, err',
|
|
44
|
+
desc: 'Load a single entity matching the given criteria.',
|
|
45
|
+
},
|
|
46
|
+
list: {
|
|
47
|
+
sig: 'list(reqmatch, ctrl) -> any, err',
|
|
48
|
+
returns: 'any, err',
|
|
49
|
+
desc: 'List entities matching the given criteria. Returns an array.',
|
|
50
|
+
},
|
|
51
|
+
create: {
|
|
52
|
+
sig: 'create(reqdata, ctrl) -> any, err',
|
|
53
|
+
returns: 'any, err',
|
|
54
|
+
desc: 'Create a new entity with the given data.',
|
|
55
|
+
},
|
|
56
|
+
update: {
|
|
57
|
+
sig: 'update(reqdata, ctrl) -> any, err',
|
|
58
|
+
returns: 'any, err',
|
|
59
|
+
desc: 'Update an existing entity. The data must include the entity `id`.',
|
|
60
|
+
},
|
|
61
|
+
remove: {
|
|
62
|
+
sig: 'remove(reqmatch, ctrl) -> any, err',
|
|
63
|
+
returns: 'any, err',
|
|
64
|
+
desc: 'Remove the entity matching the given criteria.',
|
|
65
|
+
},
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const OP_SIGNATURES_RB: Record<string, { sig: string, returns: string, desc: string }> = {
|
|
69
|
+
load: {
|
|
70
|
+
sig: 'load(reqmatch, ctrl = nil) -> result, err',
|
|
71
|
+
returns: 'result, err',
|
|
72
|
+
desc: 'Load a single entity matching the given criteria.',
|
|
73
|
+
},
|
|
74
|
+
list: {
|
|
75
|
+
sig: 'list(reqmatch, ctrl = nil) -> result, err',
|
|
76
|
+
returns: 'result, err',
|
|
77
|
+
desc: 'List entities matching the given criteria. Returns an array.',
|
|
78
|
+
},
|
|
79
|
+
create: {
|
|
80
|
+
sig: 'create(reqdata, ctrl = nil) -> result, err',
|
|
81
|
+
returns: 'result, err',
|
|
82
|
+
desc: 'Create a new entity with the given data.',
|
|
83
|
+
},
|
|
84
|
+
update: {
|
|
85
|
+
sig: 'update(reqdata, ctrl = nil) -> result, err',
|
|
86
|
+
returns: 'result, err',
|
|
87
|
+
desc: 'Update an existing entity. The data must include the entity `id`.',
|
|
88
|
+
},
|
|
89
|
+
remove: {
|
|
90
|
+
sig: 'remove(reqmatch, ctrl = nil) -> result, err',
|
|
91
|
+
returns: 'result, err',
|
|
92
|
+
desc: 'Remove the entity matching the given criteria.',
|
|
93
|
+
},
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const OP_SIGNATURES_PY: Record<string, { sig: string, returns: string, desc: string }> = {
|
|
97
|
+
load: {
|
|
98
|
+
sig: 'load(reqmatch, ctrl=None) -> tuple',
|
|
99
|
+
returns: '(result, err)',
|
|
100
|
+
desc: 'Load a single entity matching the given criteria.',
|
|
101
|
+
},
|
|
102
|
+
list: {
|
|
103
|
+
sig: 'list(reqmatch, ctrl=None) -> tuple',
|
|
104
|
+
returns: '(result, err)',
|
|
105
|
+
desc: 'List entities matching the given criteria. Returns an array.',
|
|
106
|
+
},
|
|
107
|
+
create: {
|
|
108
|
+
sig: 'create(reqdata, ctrl=None) -> tuple',
|
|
109
|
+
returns: '(result, err)',
|
|
110
|
+
desc: 'Create a new entity with the given data.',
|
|
111
|
+
},
|
|
112
|
+
update: {
|
|
113
|
+
sig: 'update(reqdata, ctrl=None) -> tuple',
|
|
114
|
+
returns: '(result, err)',
|
|
115
|
+
desc: 'Update an existing entity. The data must include the entity `id`.',
|
|
116
|
+
},
|
|
117
|
+
remove: {
|
|
118
|
+
sig: 'remove(reqmatch, ctrl=None) -> tuple',
|
|
119
|
+
returns: '(result, err)',
|
|
120
|
+
desc: 'Remove the entity matching the given criteria.',
|
|
121
|
+
},
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const OP_SIGNATURES_PHP: Record<string, { sig: string, returns: string, desc: string }> = {
|
|
125
|
+
load: {
|
|
126
|
+
sig: 'load(array $reqmatch, ?array $ctrl = null): array',
|
|
127
|
+
returns: 'array [$result, $err]',
|
|
128
|
+
desc: 'Load a single entity matching the given criteria.',
|
|
129
|
+
},
|
|
130
|
+
list: {
|
|
131
|
+
sig: 'list(array $reqmatch, ?array $ctrl = null): array',
|
|
132
|
+
returns: 'array [$result, $err]',
|
|
133
|
+
desc: 'List entities matching the given criteria. Returns an array.',
|
|
134
|
+
},
|
|
135
|
+
create: {
|
|
136
|
+
sig: 'create(array $reqdata, ?array $ctrl = null): array',
|
|
137
|
+
returns: 'array [$result, $err]',
|
|
138
|
+
desc: 'Create a new entity with the given data.',
|
|
139
|
+
},
|
|
140
|
+
update: {
|
|
141
|
+
sig: 'update(array $reqdata, ?array $ctrl = null): array',
|
|
142
|
+
returns: 'array [$result, $err]',
|
|
143
|
+
desc: 'Update an existing entity. The data must include the entity `id`.',
|
|
144
|
+
},
|
|
145
|
+
remove: {
|
|
146
|
+
sig: 'remove(array $reqmatch, ?array $ctrl = null): array',
|
|
147
|
+
returns: 'array [$result, $err]',
|
|
148
|
+
desc: 'Remove the entity matching the given criteria.',
|
|
149
|
+
},
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const OP_SIGNATURES_GO: Record<string, { sig: string, returns: string, desc: string }> = {
|
|
153
|
+
load: {
|
|
154
|
+
sig: 'Load(reqmatch, ctrl map[string]any) (any, error)',
|
|
155
|
+
returns: '(any, error)',
|
|
156
|
+
desc: 'Load a single entity matching the given criteria.',
|
|
157
|
+
},
|
|
158
|
+
list: {
|
|
159
|
+
sig: 'List(reqmatch, ctrl map[string]any) (any, error)',
|
|
160
|
+
returns: '(any, error)',
|
|
161
|
+
desc: 'List entities matching the given criteria. Returns an array.',
|
|
162
|
+
},
|
|
163
|
+
create: {
|
|
164
|
+
sig: 'Create(reqdata, ctrl map[string]any) (any, error)',
|
|
165
|
+
returns: '(any, error)',
|
|
166
|
+
desc: 'Create a new entity with the given data.',
|
|
167
|
+
},
|
|
168
|
+
update: {
|
|
169
|
+
sig: 'Update(reqdata, ctrl map[string]any) (any, error)',
|
|
170
|
+
returns: '(any, error)',
|
|
171
|
+
desc: 'Update an existing entity. The data must include the entity `id`.',
|
|
172
|
+
},
|
|
173
|
+
remove: {
|
|
174
|
+
sig: 'Remove(reqmatch, ctrl map[string]any) (any, error)',
|
|
175
|
+
returns: '(any, error)',
|
|
176
|
+
desc: 'Remove the entity matching the given criteria.',
|
|
177
|
+
},
|
|
178
|
+
}
|
|
179
|
+
|
|
38
180
|
|
|
39
181
|
const ReadmeRef = cmp(function ReadmeRef(props: any) {
|
|
40
182
|
const { target } = props
|
|
@@ -43,7 +185,15 @@ const ReadmeRef = cmp(function ReadmeRef(props: any) {
|
|
|
43
185
|
const entity = getModelPath(model, `main.${KIT}.entity`)
|
|
44
186
|
const feature = getModelPath(model, `main.${KIT}.feature`)
|
|
45
187
|
|
|
46
|
-
const publishedEntities = each(entity).filter((e: any) => e.
|
|
188
|
+
const publishedEntities = each(entity).filter((e: any) => e.active !== false)
|
|
189
|
+
|
|
190
|
+
const isGo = target.name === 'go'
|
|
191
|
+
const isLua = target.name === 'lua'
|
|
192
|
+
const isRb = target.name === 'rb'
|
|
193
|
+
const isPhp = target.name === 'php'
|
|
194
|
+
const isPy = target.name === 'py'
|
|
195
|
+
const lang = isGo ? 'go' : isLua ? 'lua' : isRb ? 'rb' : isPhp ? 'php' : isPy ? 'py' : 'ts'
|
|
196
|
+
const OP_SIGNATURES = isGo ? OP_SIGNATURES_GO : isLua ? OP_SIGNATURES_LUA : isRb ? OP_SIGNATURES_RB : isPhp ? OP_SIGNATURES_PHP : isPy ? OP_SIGNATURES_PY : OP_SIGNATURES_TS
|
|
47
197
|
|
|
48
198
|
File({ name: 'REFERENCE.md' }, () => {
|
|
49
199
|
|
|
@@ -56,7 +206,127 @@ Complete API reference for the ${model.Name} ${target.title} SDK.
|
|
|
56
206
|
|
|
57
207
|
### Constructor
|
|
58
208
|
|
|
59
|
-
|
|
209
|
+
`)
|
|
210
|
+
|
|
211
|
+
if (isPy) {
|
|
212
|
+
Content(`\`\`\`python
|
|
213
|
+
from ${model.name}_sdk import ${model.const.Name}SDK
|
|
214
|
+
|
|
215
|
+
client = ${model.const.Name}SDK(options)
|
|
216
|
+
\`\`\`
|
|
217
|
+
|
|
218
|
+
Create a new SDK client instance.
|
|
219
|
+
|
|
220
|
+
**Parameters:**
|
|
221
|
+
|
|
222
|
+
| Name | Type | Description |
|
|
223
|
+
| --- | --- | --- |
|
|
224
|
+
| \`options\` | \`dict\` | SDK configuration options. |
|
|
225
|
+
| \`options["apikey"]\` | \`str\` | API key for authentication. |
|
|
226
|
+
| \`options["base"]\` | \`str\` | Base URL for API requests. |
|
|
227
|
+
| \`options["prefix"]\` | \`str\` | URL prefix appended after base. |
|
|
228
|
+
| \`options["suffix"]\` | \`str\` | URL suffix appended after path. |
|
|
229
|
+
| \`options["headers"]\` | \`dict\` | Custom headers for all requests. |
|
|
230
|
+
| \`options["feature"]\` | \`dict\` | Feature configuration. |
|
|
231
|
+
| \`options["system"]\` | \`dict\` | System overrides (e.g. custom fetch). |
|
|
232
|
+
|
|
233
|
+
`)
|
|
234
|
+
}
|
|
235
|
+
else if (isPhp) {
|
|
236
|
+
Content(`\`\`\`php
|
|
237
|
+
require_once __DIR__ . '/${model.name}_sdk.php';
|
|
238
|
+
|
|
239
|
+
$client = new ${model.const.Name}SDK($options);
|
|
240
|
+
\`\`\`
|
|
241
|
+
|
|
242
|
+
Create a new SDK client instance.
|
|
243
|
+
|
|
244
|
+
**Parameters:**
|
|
245
|
+
|
|
246
|
+
| Name | Type | Description |
|
|
247
|
+
| --- | --- | --- |
|
|
248
|
+
| \`$options\` | \`array\` | SDK configuration options. |
|
|
249
|
+
| \`$options["apikey"]\` | \`string\` | API key for authentication. |
|
|
250
|
+
| \`$options["base"]\` | \`string\` | Base URL for API requests. |
|
|
251
|
+
| \`$options["prefix"]\` | \`string\` | URL prefix appended after base. |
|
|
252
|
+
| \`$options["suffix"]\` | \`string\` | URL suffix appended after path. |
|
|
253
|
+
| \`$options["headers"]\` | \`array\` | Custom headers for all requests. |
|
|
254
|
+
| \`$options["feature"]\` | \`array\` | Feature configuration. |
|
|
255
|
+
| \`$options["system"]\` | \`array\` | System overrides (e.g. custom fetch). |
|
|
256
|
+
|
|
257
|
+
`)
|
|
258
|
+
}
|
|
259
|
+
else if (isRb) {
|
|
260
|
+
Content(`\`\`\`ruby
|
|
261
|
+
require_relative '${model.name}_sdk'
|
|
262
|
+
|
|
263
|
+
client = ${model.const.Name}SDK.new(options)
|
|
264
|
+
\`\`\`
|
|
265
|
+
|
|
266
|
+
Create a new SDK client instance.
|
|
267
|
+
|
|
268
|
+
**Parameters:**
|
|
269
|
+
|
|
270
|
+
| Name | Type | Description |
|
|
271
|
+
| --- | --- | --- |
|
|
272
|
+
| \`options\` | \`Hash\` | SDK configuration options. |
|
|
273
|
+
| \`options["apikey"]\` | \`String\` | API key for authentication. |
|
|
274
|
+
| \`options["base"]\` | \`String\` | Base URL for API requests. |
|
|
275
|
+
| \`options["prefix"]\` | \`String\` | URL prefix appended after base. |
|
|
276
|
+
| \`options["suffix"]\` | \`String\` | URL suffix appended after path. |
|
|
277
|
+
| \`options["headers"]\` | \`Hash\` | Custom headers for all requests. |
|
|
278
|
+
| \`options["feature"]\` | \`Hash\` | Feature configuration. |
|
|
279
|
+
| \`options["system"]\` | \`Hash\` | System overrides (e.g. custom fetch). |
|
|
280
|
+
|
|
281
|
+
`)
|
|
282
|
+
}
|
|
283
|
+
else if (isLua) {
|
|
284
|
+
Content(`\`\`\`lua
|
|
285
|
+
local sdk = require("${model.name}_sdk")
|
|
286
|
+
local client = sdk.new(options)
|
|
287
|
+
\`\`\`
|
|
288
|
+
|
|
289
|
+
Create a new SDK client instance.
|
|
290
|
+
|
|
291
|
+
**Parameters:**
|
|
292
|
+
|
|
293
|
+
| Name | Type | Description |
|
|
294
|
+
| --- | --- | --- |
|
|
295
|
+
| \`options\` | \`table\` | SDK configuration options. |
|
|
296
|
+
| \`options.apikey\` | \`string\` | API key for authentication. |
|
|
297
|
+
| \`options.base\` | \`string\` | Base URL for API requests. |
|
|
298
|
+
| \`options.prefix\` | \`string\` | URL prefix appended after base. |
|
|
299
|
+
| \`options.suffix\` | \`string\` | URL suffix appended after path. |
|
|
300
|
+
| \`options.headers\` | \`table\` | Custom headers for all requests. |
|
|
301
|
+
| \`options.feature\` | \`table\` | Feature configuration. |
|
|
302
|
+
| \`options.system\` | \`table\` | System overrides (e.g. custom fetch). |
|
|
303
|
+
|
|
304
|
+
`)
|
|
305
|
+
}
|
|
306
|
+
else if (isGo) {
|
|
307
|
+
Content(`\`\`\`go
|
|
308
|
+
func New${model.const.Name}SDK(options map[string]any) *${model.const.Name}SDK
|
|
309
|
+
\`\`\`
|
|
310
|
+
|
|
311
|
+
Create a new SDK client instance.
|
|
312
|
+
|
|
313
|
+
**Parameters:**
|
|
314
|
+
|
|
315
|
+
| Name | Type | Description |
|
|
316
|
+
| --- | --- | --- |
|
|
317
|
+
| \`options\` | \`map[string]any\` | SDK configuration options. |
|
|
318
|
+
| \`options["apikey"]\` | \`string\` | API key for authentication. |
|
|
319
|
+
| \`options["base"]\` | \`string\` | Base URL for API requests. |
|
|
320
|
+
| \`options["prefix"]\` | \`string\` | URL prefix appended after base. |
|
|
321
|
+
| \`options["suffix"]\` | \`string\` | URL suffix appended after path. |
|
|
322
|
+
| \`options["headers"]\` | \`map[string]any\` | Custom headers for all requests. |
|
|
323
|
+
| \`options["feature"]\` | \`map[string]any\` | Feature configuration. |
|
|
324
|
+
| \`options["system"]\` | \`map[string]any\` | System overrides (e.g. custom fetch). |
|
|
325
|
+
|
|
326
|
+
`)
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
Content(`\`\`\`ts
|
|
60
330
|
new ${model.Name}SDK(options?: object)
|
|
61
331
|
\`\`\`
|
|
62
332
|
|
|
@@ -75,10 +345,72 @@ Create a new SDK client instance.
|
|
|
75
345
|
| \`options.feature\` | \`object\` | Feature configuration. |
|
|
76
346
|
| \`options.system\` | \`object\` | System overrides (e.g. custom fetch). |
|
|
77
347
|
|
|
348
|
+
`)
|
|
349
|
+
}
|
|
350
|
+
|
|
78
351
|
|
|
352
|
+
Content(`
|
|
79
353
|
### Static Methods
|
|
80
354
|
|
|
81
|
-
|
|
355
|
+
`)
|
|
356
|
+
|
|
357
|
+
if (isPy) {
|
|
358
|
+
Content(`#### \`${model.const.Name}SDK.test(testopts=None, sdkopts=None)\`
|
|
359
|
+
|
|
360
|
+
Create a test client with mock features active. Both arguments may be \`None\`.
|
|
361
|
+
|
|
362
|
+
\`\`\`python
|
|
363
|
+
client = ${model.const.Name}SDK.test()
|
|
364
|
+
\`\`\`
|
|
365
|
+
|
|
366
|
+
`)
|
|
367
|
+
}
|
|
368
|
+
else if (isPhp) {
|
|
369
|
+
Content(`#### \`${model.const.Name}SDK::test($testopts = null, $sdkopts = null)\`
|
|
370
|
+
|
|
371
|
+
Create a test client with mock features active. Both arguments may be \`null\`.
|
|
372
|
+
|
|
373
|
+
\`\`\`php
|
|
374
|
+
$client = ${model.const.Name}SDK::test();
|
|
375
|
+
\`\`\`
|
|
376
|
+
|
|
377
|
+
`)
|
|
378
|
+
}
|
|
379
|
+
else if (isRb) {
|
|
380
|
+
Content(`#### \`${model.const.Name}SDK.test(testopts = nil, sdkopts = nil)\`
|
|
381
|
+
|
|
382
|
+
Create a test client with mock features active. Both arguments may be \`nil\`.
|
|
383
|
+
|
|
384
|
+
\`\`\`ruby
|
|
385
|
+
client = ${model.const.Name}SDK.test
|
|
386
|
+
\`\`\`
|
|
387
|
+
|
|
388
|
+
`)
|
|
389
|
+
}
|
|
390
|
+
else if (isLua) {
|
|
391
|
+
Content(`#### \`sdk.test(testopts, sdkopts)\`
|
|
392
|
+
|
|
393
|
+
Create a test client with mock features active. Both arguments may be \`nil\`.
|
|
394
|
+
|
|
395
|
+
\`\`\`lua
|
|
396
|
+
local client = sdk.test(nil, nil)
|
|
397
|
+
\`\`\`
|
|
398
|
+
|
|
399
|
+
`)
|
|
400
|
+
}
|
|
401
|
+
else if (isGo) {
|
|
402
|
+
Content(`#### \`TestSDK(testopts, sdkopts map[string]any) *${model.const.Name}SDK\`
|
|
403
|
+
|
|
404
|
+
Create a test client with mock features active. Both arguments may be \`nil\`.
|
|
405
|
+
|
|
406
|
+
\`\`\`go
|
|
407
|
+
client := sdk.TestSDK(nil, nil)
|
|
408
|
+
\`\`\`
|
|
409
|
+
|
|
410
|
+
`)
|
|
411
|
+
}
|
|
412
|
+
else {
|
|
413
|
+
Content(`#### \`${model.Name}SDK.test(testopts?, sdkopts?)\`
|
|
82
414
|
|
|
83
415
|
Create a test client with mock features active.
|
|
84
416
|
|
|
@@ -93,33 +425,248 @@ const client = ${model.Name}SDK.test()
|
|
|
93
425
|
| \`testopts\` | \`object\` | Test feature options. |
|
|
94
426
|
| \`sdkopts\` | \`object\` | Additional SDK options merged with test defaults. |
|
|
95
427
|
|
|
96
|
-
**Returns:** \`${model.Name}SDK\` instance in test mode.
|
|
428
|
+
**Returns:** \`${model.Name}SDK\` instance in test mode.
|
|
429
|
+
|
|
430
|
+
`)
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
Content(`
|
|
435
|
+
### Instance Methods
|
|
436
|
+
|
|
437
|
+
`)
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
// Entity factory methods
|
|
441
|
+
publishedEntities.map((ent: any) => {
|
|
442
|
+
if (isPy) {
|
|
443
|
+
Content(`#### \`${ent.Name}(data=None)\`
|
|
444
|
+
|
|
445
|
+
Create a new \`${ent.Name}Entity\` instance. Pass \`None\` for no initial data.
|
|
446
|
+
|
|
447
|
+
`)
|
|
448
|
+
}
|
|
449
|
+
else if (isPhp) {
|
|
450
|
+
Content(`#### \`${ent.Name}($data = null)\`
|
|
451
|
+
|
|
452
|
+
Create a new \`${ent.Name}Entity\` instance. Pass \`null\` for no initial data.
|
|
453
|
+
|
|
454
|
+
`)
|
|
455
|
+
}
|
|
456
|
+
else if (isRb) {
|
|
457
|
+
Content(`#### \`${ent.Name}(data = nil)\`
|
|
458
|
+
|
|
459
|
+
Create a new \`${ent.Name}\` entity instance. Pass \`nil\` for no initial data.
|
|
460
|
+
|
|
461
|
+
`)
|
|
462
|
+
}
|
|
463
|
+
else if (isLua) {
|
|
464
|
+
Content(`#### \`${ent.Name}(data)\`
|
|
465
|
+
|
|
466
|
+
Create a new \`${ent.Name}\` entity instance. Pass \`nil\` for no initial data.
|
|
467
|
+
|
|
468
|
+
`)
|
|
469
|
+
}
|
|
470
|
+
else if (isGo) {
|
|
471
|
+
Content(`#### \`${ent.Name}(data map[string]any) ${model.const.Name}Entity\`
|
|
472
|
+
|
|
473
|
+
Create a new \`${ent.Name}\` entity instance. Pass \`nil\` for no initial data.
|
|
474
|
+
|
|
475
|
+
`)
|
|
476
|
+
}
|
|
477
|
+
else {
|
|
478
|
+
Content(`#### \`${ent.Name}(data?: object)\`
|
|
479
|
+
|
|
480
|
+
Create a new \`${ent.Name}\` entity instance.
|
|
481
|
+
|
|
482
|
+
**Parameters:**
|
|
483
|
+
|
|
484
|
+
| Name | Type | Description |
|
|
485
|
+
| --- | --- | --- |
|
|
486
|
+
| \`data\` | \`object\` | Initial entity data. |
|
|
487
|
+
|
|
488
|
+
**Returns:** \`${ent.Name}Entity\` instance.
|
|
489
|
+
|
|
490
|
+
`)
|
|
491
|
+
}
|
|
492
|
+
})
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
if (isPy) {
|
|
496
|
+
Content(`#### \`options_map() -> dict\`
|
|
497
|
+
|
|
498
|
+
Return a deep copy of the current SDK options.
|
|
499
|
+
|
|
500
|
+
#### \`get_utility() -> Utility\`
|
|
501
|
+
|
|
502
|
+
Return a copy of the SDK utility object.
|
|
503
|
+
|
|
504
|
+
#### \`direct(fetchargs=None) -> tuple\`
|
|
505
|
+
|
|
506
|
+
Make a direct HTTP request to any API endpoint. Returns \`(result, err)\`.
|
|
507
|
+
|
|
508
|
+
**Parameters:**
|
|
509
|
+
|
|
510
|
+
| Name | Type | Description |
|
|
511
|
+
| --- | --- | --- |
|
|
512
|
+
| \`fetchargs["path"]\` | \`str\` | URL path with optional \`{param}\` placeholders. |
|
|
513
|
+
| \`fetchargs["method"]\` | \`str\` | HTTP method (default: \`"GET"\`). |
|
|
514
|
+
| \`fetchargs["params"]\` | \`dict\` | Path parameter values. |
|
|
515
|
+
| \`fetchargs["query"]\` | \`dict\` | Query string parameters. |
|
|
516
|
+
| \`fetchargs["headers"]\` | \`dict\` | Request headers (merged with defaults). |
|
|
517
|
+
| \`fetchargs["body"]\` | \`any\` | Request body (dicts are JSON-serialized). |
|
|
518
|
+
|
|
519
|
+
**Returns:** \`(result_dict, err)\`
|
|
520
|
+
|
|
521
|
+
#### \`prepare(fetchargs=None) -> tuple\`
|
|
522
|
+
|
|
523
|
+
Prepare a fetch definition without sending. Returns \`(fetchdef, err)\`.
|
|
524
|
+
|
|
525
|
+
`)
|
|
526
|
+
}
|
|
527
|
+
else if (isPhp) {
|
|
528
|
+
Content(`#### \`optionsMap(): array\`
|
|
529
|
+
|
|
530
|
+
Return a deep copy of the current SDK options.
|
|
531
|
+
|
|
532
|
+
#### \`getUtility(): ProjectNameUtility\`
|
|
533
|
+
|
|
534
|
+
Return a copy of the SDK utility object.
|
|
535
|
+
|
|
536
|
+
#### \`direct(array $fetchargs = []): array\`
|
|
537
|
+
|
|
538
|
+
Make a direct HTTP request to any API endpoint. Returns \`[$result, $err]\`.
|
|
539
|
+
|
|
540
|
+
**Parameters:**
|
|
541
|
+
|
|
542
|
+
| Name | Type | Description |
|
|
543
|
+
| --- | --- | --- |
|
|
544
|
+
| \`$fetchargs["path"]\` | \`string\` | URL path with optional \`{param}\` placeholders. |
|
|
545
|
+
| \`$fetchargs["method"]\` | \`string\` | HTTP method (default: \`"GET"\`). |
|
|
546
|
+
| \`$fetchargs["params"]\` | \`array\` | Path parameter values for \`{param}\` substitution. |
|
|
547
|
+
| \`$fetchargs["query"]\` | \`array\` | Query string parameters. |
|
|
548
|
+
| \`$fetchargs["headers"]\` | \`array\` | Request headers (merged with defaults). |
|
|
549
|
+
| \`$fetchargs["body"]\` | \`mixed\` | Request body (arrays are JSON-serialized). |
|
|
550
|
+
| \`$fetchargs["ctrl"]\` | \`array\` | Control options. |
|
|
551
|
+
|
|
552
|
+
**Returns:** \`array [$result, $err]\`
|
|
553
|
+
|
|
554
|
+
#### \`prepare(array $fetchargs = []): array\`
|
|
555
|
+
|
|
556
|
+
Prepare a fetch definition without sending the request. Returns \`[$fetchdef, $err]\`.
|
|
557
|
+
|
|
558
|
+
`)
|
|
559
|
+
}
|
|
560
|
+
else if (isRb) {
|
|
561
|
+
Content(`#### \`options_map -> Hash\`
|
|
562
|
+
|
|
563
|
+
Return a deep copy of the current SDK options.
|
|
564
|
+
|
|
565
|
+
#### \`get_utility -> Utility\`
|
|
566
|
+
|
|
567
|
+
Return a copy of the SDK utility object.
|
|
568
|
+
|
|
569
|
+
#### \`direct(fetchargs = {}) -> Hash, err\`
|
|
570
|
+
|
|
571
|
+
Make a direct HTTP request to any API endpoint.
|
|
572
|
+
|
|
573
|
+
**Parameters:**
|
|
574
|
+
|
|
575
|
+
| Name | Type | Description |
|
|
576
|
+
| --- | --- | --- |
|
|
577
|
+
| \`fetchargs["path"]\` | \`String\` | URL path with optional \`{param}\` placeholders. |
|
|
578
|
+
| \`fetchargs["method"]\` | \`String\` | HTTP method (default: \`"GET"\`). |
|
|
579
|
+
| \`fetchargs["params"]\` | \`Hash\` | Path parameter values for \`{param}\` substitution. |
|
|
580
|
+
| \`fetchargs["query"]\` | \`Hash\` | Query string parameters. |
|
|
581
|
+
| \`fetchargs["headers"]\` | \`Hash\` | Request headers (merged with defaults). |
|
|
582
|
+
| \`fetchargs["body"]\` | \`any\` | Request body (hashes are JSON-serialized). |
|
|
583
|
+
| \`fetchargs["ctrl"]\` | \`Hash\` | Control options (e.g. \`{ "explain" => true }\`). |
|
|
584
|
+
|
|
585
|
+
**Returns:** \`Hash, err\`
|
|
586
|
+
|
|
587
|
+
#### \`prepare(fetchargs = {}) -> Hash, err\`
|
|
588
|
+
|
|
589
|
+
Prepare a fetch definition without sending the request. Accepts the
|
|
590
|
+
same parameters as \`direct()\`.
|
|
591
|
+
|
|
592
|
+
**Returns:** \`Hash, err\`
|
|
593
|
+
|
|
594
|
+
`)
|
|
595
|
+
}
|
|
596
|
+
else if (isLua) {
|
|
597
|
+
Content(`#### \`options_map() -> table\`
|
|
598
|
+
|
|
599
|
+
Return a deep copy of the current SDK options.
|
|
600
|
+
|
|
601
|
+
#### \`get_utility() -> Utility\`
|
|
602
|
+
|
|
603
|
+
Return a copy of the SDK utility object.
|
|
604
|
+
|
|
605
|
+
#### \`direct(fetchargs) -> table, err\`
|
|
606
|
+
|
|
607
|
+
Make a direct HTTP request to any API endpoint.
|
|
608
|
+
|
|
609
|
+
**Parameters:**
|
|
610
|
+
|
|
611
|
+
| Name | Type | Description |
|
|
612
|
+
| --- | --- | --- |
|
|
613
|
+
| \`fetchargs.path\` | \`string\` | URL path with optional \`{param}\` placeholders. |
|
|
614
|
+
| \`fetchargs.method\` | \`string\` | HTTP method (default: \`"GET"\`). |
|
|
615
|
+
| \`fetchargs.params\` | \`table\` | Path parameter values for \`{param}\` substitution. |
|
|
616
|
+
| \`fetchargs.query\` | \`table\` | Query string parameters. |
|
|
617
|
+
| \`fetchargs.headers\` | \`table\` | Request headers (merged with defaults). |
|
|
618
|
+
| \`fetchargs.body\` | \`any\` | Request body (tables are JSON-serialized). |
|
|
619
|
+
| \`fetchargs.ctrl\` | \`table\` | Control options (e.g. \`{ explain = true }\`). |
|
|
620
|
+
|
|
621
|
+
**Returns:** \`table, err\`
|
|
97
622
|
|
|
623
|
+
#### \`prepare(fetchargs) -> table, err\`
|
|
98
624
|
|
|
99
|
-
|
|
625
|
+
Prepare a fetch definition without sending the request. Accepts the
|
|
626
|
+
same parameters as \`direct()\`.
|
|
627
|
+
|
|
628
|
+
**Returns:** \`table, err\`
|
|
100
629
|
|
|
101
630
|
`)
|
|
631
|
+
}
|
|
632
|
+
else if (isGo) {
|
|
633
|
+
Content(`#### \`OptionsMap() map[string]any\`
|
|
102
634
|
|
|
635
|
+
Return a deep copy of the current SDK options.
|
|
103
636
|
|
|
104
|
-
|
|
105
|
-
publishedEntities.map((ent: any) => {
|
|
106
|
-
Content(`#### \`${ent.Name}(data?: object)\`
|
|
637
|
+
#### \`GetUtility() *Utility\`
|
|
107
638
|
|
|
108
|
-
|
|
639
|
+
Return a copy of the SDK utility object.
|
|
640
|
+
|
|
641
|
+
#### \`Direct(fetchargs map[string]any) (map[string]any, error)\`
|
|
642
|
+
|
|
643
|
+
Make a direct HTTP request to any API endpoint.
|
|
109
644
|
|
|
110
645
|
**Parameters:**
|
|
111
646
|
|
|
112
647
|
| Name | Type | Description |
|
|
113
648
|
| --- | --- | --- |
|
|
114
|
-
| \`
|
|
649
|
+
| \`fetchargs["path"]\` | \`string\` | URL path with optional \`{param}\` placeholders. |
|
|
650
|
+
| \`fetchargs["method"]\` | \`string\` | HTTP method (default: \`"GET"\`). |
|
|
651
|
+
| \`fetchargs["params"]\` | \`map[string]any\` | Path parameter values for \`{param}\` substitution. |
|
|
652
|
+
| \`fetchargs["query"]\` | \`map[string]any\` | Query string parameters. |
|
|
653
|
+
| \`fetchargs["headers"]\` | \`map[string]any\` | Request headers (merged with defaults). |
|
|
654
|
+
| \`fetchargs["body"]\` | \`any\` | Request body (maps are JSON-serialized). |
|
|
655
|
+
| \`fetchargs["ctrl"]\` | \`map[string]any\` | Control options (e.g. \`map[string]any{"explain": true}\`). |
|
|
115
656
|
|
|
116
|
-
**Returns:**
|
|
657
|
+
**Returns:** \`(map[string]any, error)\`
|
|
117
658
|
|
|
118
|
-
|
|
119
|
-
|
|
659
|
+
#### \`Prepare(fetchargs map[string]any) (map[string]any, error)\`
|
|
660
|
+
|
|
661
|
+
Prepare a fetch definition without sending the request. Accepts the
|
|
662
|
+
same parameters as \`Direct()\`.
|
|
120
663
|
|
|
664
|
+
**Returns:** \`(map[string]any, error)\`
|
|
121
665
|
|
|
122
|
-
|
|
666
|
+
`)
|
|
667
|
+
}
|
|
668
|
+
else {
|
|
669
|
+
Content(`#### \`options()\`
|
|
123
670
|
|
|
124
671
|
Return a deep copy of the current SDK options.
|
|
125
672
|
|
|
@@ -163,12 +710,13 @@ Alias for \`${model.Name}SDK.test()\`.
|
|
|
163
710
|
**Returns:** \`${model.Name}SDK\` instance in test mode.
|
|
164
711
|
|
|
165
712
|
`)
|
|
713
|
+
}
|
|
166
714
|
|
|
167
715
|
|
|
168
716
|
// Entity reference sections
|
|
169
717
|
publishedEntities.map((ent: any) => {
|
|
170
718
|
const opnames = Object.keys(ent.op || {})
|
|
171
|
-
const fields = ent.
|
|
719
|
+
const fields = ent.fields || []
|
|
172
720
|
|
|
173
721
|
Content(`
|
|
174
722
|
---
|
|
@@ -183,11 +731,48 @@ Alias for \`${model.Name}SDK.test()\`.
|
|
|
183
731
|
`)
|
|
184
732
|
}
|
|
185
733
|
|
|
186
|
-
|
|
734
|
+
if (isPy) {
|
|
735
|
+
Content(`\`\`\`python
|
|
736
|
+
${ent.name} = client.${ent.Name}()
|
|
737
|
+
\`\`\`
|
|
738
|
+
|
|
739
|
+
`)
|
|
740
|
+
}
|
|
741
|
+
else if (isPhp) {
|
|
742
|
+
Content(`\`\`\`php
|
|
743
|
+
$${ent.name} = $client->${ent.Name}();
|
|
744
|
+
\`\`\`
|
|
745
|
+
|
|
746
|
+
`)
|
|
747
|
+
}
|
|
748
|
+
else if (isRb) {
|
|
749
|
+
Content(`\`\`\`ruby
|
|
750
|
+
${ent.name} = client.${ent.Name}
|
|
751
|
+
\`\`\`
|
|
752
|
+
|
|
753
|
+
`)
|
|
754
|
+
}
|
|
755
|
+
else if (isLua) {
|
|
756
|
+
Content(`\`\`\`lua
|
|
757
|
+
local ${ent.name} = client:${ent.Name}(nil)
|
|
758
|
+
\`\`\`
|
|
759
|
+
|
|
760
|
+
`)
|
|
761
|
+
}
|
|
762
|
+
else if (isGo) {
|
|
763
|
+
Content(`\`\`\`go
|
|
764
|
+
${ent.name} := client.${ent.Name}(nil)
|
|
765
|
+
\`\`\`
|
|
766
|
+
|
|
767
|
+
`)
|
|
768
|
+
}
|
|
769
|
+
else {
|
|
770
|
+
Content(`\`\`\`ts
|
|
187
771
|
const ${ent.name} = client.${ent.Name}()
|
|
188
772
|
\`\`\`
|
|
189
773
|
|
|
190
774
|
`)
|
|
775
|
+
}
|
|
191
776
|
|
|
192
777
|
|
|
193
778
|
// Field schema
|
|
@@ -251,37 +836,244 @@ ${info.desc}
|
|
|
251
836
|
`)
|
|
252
837
|
|
|
253
838
|
// Show example
|
|
254
|
-
if (
|
|
255
|
-
|
|
256
|
-
|
|
839
|
+
if (isPy) {
|
|
840
|
+
if ('load' === opname || 'remove' === opname) {
|
|
841
|
+
Content(`\`\`\`python
|
|
842
|
+
result, err = client.${ent.Name}().${opname}({"id": "${ent.name}_id"})
|
|
843
|
+
\`\`\`
|
|
844
|
+
|
|
845
|
+
`)
|
|
846
|
+
}
|
|
847
|
+
else if ('list' === opname) {
|
|
848
|
+
Content(`\`\`\`python
|
|
849
|
+
results, err = client.${ent.Name}().list({})
|
|
850
|
+
\`\`\`
|
|
851
|
+
|
|
852
|
+
`)
|
|
853
|
+
}
|
|
854
|
+
else if ('create' === opname) {
|
|
855
|
+
Content(`\`\`\`python
|
|
856
|
+
result, err = client.${ent.Name}().create({
|
|
857
|
+
`)
|
|
858
|
+
each(fields, (field: any) => {
|
|
859
|
+
if ('id' !== field.name && field.req) {
|
|
860
|
+
Content(` "${field.name}": # ${field.type || 'value'},
|
|
861
|
+
`)
|
|
862
|
+
}
|
|
863
|
+
})
|
|
864
|
+
Content(`})
|
|
865
|
+
\`\`\`
|
|
866
|
+
|
|
867
|
+
`)
|
|
868
|
+
}
|
|
869
|
+
else if ('update' === opname) {
|
|
870
|
+
Content(`\`\`\`python
|
|
871
|
+
result, err = client.${ent.Name}().update({
|
|
872
|
+
"id": "${ent.name}_id",
|
|
873
|
+
# Fields to update
|
|
874
|
+
})
|
|
257
875
|
\`\`\`
|
|
258
876
|
|
|
259
877
|
`)
|
|
878
|
+
}
|
|
260
879
|
}
|
|
261
|
-
else if (
|
|
262
|
-
|
|
263
|
-
|
|
880
|
+
else if (isPhp) {
|
|
881
|
+
if ('load' === opname || 'remove' === opname) {
|
|
882
|
+
Content(`\`\`\`php
|
|
883
|
+
[$result, $err] = $client->${ent.Name}()->${opname}(["id" => "${ent.name}_id"]);
|
|
884
|
+
\`\`\`
|
|
885
|
+
|
|
886
|
+
`)
|
|
887
|
+
}
|
|
888
|
+
else if ('list' === opname) {
|
|
889
|
+
Content(`\`\`\`php
|
|
890
|
+
[$results, $err] = $client->${ent.Name}()->list([]);
|
|
891
|
+
\`\`\`
|
|
892
|
+
|
|
893
|
+
`)
|
|
894
|
+
}
|
|
895
|
+
else if ('create' === opname) {
|
|
896
|
+
Content(`\`\`\`php
|
|
897
|
+
[$result, $err] = $client->${ent.Name}()->create([
|
|
898
|
+
`)
|
|
899
|
+
each(fields, (field: any) => {
|
|
900
|
+
if ('id' !== field.name && field.req) {
|
|
901
|
+
Content(` "${field.name}" => /* ${field.type || 'value'} */,
|
|
902
|
+
`)
|
|
903
|
+
}
|
|
904
|
+
})
|
|
905
|
+
Content(`]);
|
|
906
|
+
\`\`\`
|
|
907
|
+
|
|
908
|
+
`)
|
|
909
|
+
}
|
|
910
|
+
else if ('update' === opname) {
|
|
911
|
+
Content(`\`\`\`php
|
|
912
|
+
[$result, $err] = $client->${ent.Name}()->update([
|
|
913
|
+
"id" => "${ent.name}_id",
|
|
914
|
+
// Fields to update
|
|
915
|
+
]);
|
|
264
916
|
\`\`\`
|
|
265
917
|
|
|
266
918
|
`)
|
|
919
|
+
}
|
|
267
920
|
}
|
|
268
|
-
else if (
|
|
269
|
-
|
|
270
|
-
|
|
921
|
+
else if (isRb) {
|
|
922
|
+
if ('load' === opname || 'remove' === opname) {
|
|
923
|
+
Content(`\`\`\`ruby
|
|
924
|
+
result, err = client.${ent.Name}.${opname}({ "id" => "${ent.name}_id" })
|
|
925
|
+
\`\`\`
|
|
926
|
+
|
|
927
|
+
`)
|
|
928
|
+
}
|
|
929
|
+
else if ('list' === opname) {
|
|
930
|
+
Content(`\`\`\`ruby
|
|
931
|
+
results, err = client.${ent.Name}.list(nil)
|
|
932
|
+
\`\`\`
|
|
933
|
+
|
|
271
934
|
`)
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
935
|
+
}
|
|
936
|
+
else if ('create' === opname) {
|
|
937
|
+
Content(`\`\`\`ruby
|
|
938
|
+
result, err = client.${ent.Name}.create({
|
|
275
939
|
`)
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
940
|
+
each(fields, (field: any) => {
|
|
941
|
+
if ('id' !== field.name && field.req) {
|
|
942
|
+
Content(` "${field.name}" => # ${field.type || 'value'},
|
|
943
|
+
`)
|
|
944
|
+
}
|
|
945
|
+
})
|
|
946
|
+
Content(`})
|
|
947
|
+
\`\`\`
|
|
948
|
+
|
|
949
|
+
`)
|
|
950
|
+
}
|
|
951
|
+
else if ('update' === opname) {
|
|
952
|
+
Content(`\`\`\`ruby
|
|
953
|
+
result, err = client.${ent.Name}.update({
|
|
954
|
+
"id" => "${ent.name}_id",
|
|
955
|
+
# Fields to update
|
|
956
|
+
})
|
|
957
|
+
\`\`\`
|
|
958
|
+
|
|
959
|
+
`)
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
else if (isLua) {
|
|
963
|
+
if ('load' === opname || 'remove' === opname) {
|
|
964
|
+
Content(`\`\`\`lua
|
|
965
|
+
local result, err = client:${ent.Name}(nil):${opname}({ id = "${ent.name}_id" }, nil)
|
|
966
|
+
\`\`\`
|
|
967
|
+
|
|
968
|
+
`)
|
|
969
|
+
}
|
|
970
|
+
else if ('list' === opname) {
|
|
971
|
+
Content(`\`\`\`lua
|
|
972
|
+
local results, err = client:${ent.Name}(nil):list(nil, nil)
|
|
973
|
+
\`\`\`
|
|
974
|
+
|
|
975
|
+
`)
|
|
976
|
+
}
|
|
977
|
+
else if ('create' === opname) {
|
|
978
|
+
Content(`\`\`\`lua
|
|
979
|
+
local result, err = client:${ent.Name}(nil):create({
|
|
980
|
+
`)
|
|
981
|
+
each(fields, (field: any) => {
|
|
982
|
+
if ('id' !== field.name && field.req) {
|
|
983
|
+
Content(` ${field.name} = --[[ ${field.type || 'value'} ]],
|
|
984
|
+
`)
|
|
985
|
+
}
|
|
986
|
+
})
|
|
987
|
+
Content(`}, nil)
|
|
988
|
+
\`\`\`
|
|
989
|
+
|
|
990
|
+
`)
|
|
991
|
+
}
|
|
992
|
+
else if ('update' === opname) {
|
|
993
|
+
Content(`\`\`\`lua
|
|
994
|
+
local result, err = client:${ent.Name}(nil):update({
|
|
995
|
+
id = "${ent.name}_id",
|
|
996
|
+
-- Fields to update
|
|
997
|
+
}, nil)
|
|
998
|
+
\`\`\`
|
|
999
|
+
|
|
1000
|
+
`)
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
else if (isGo) {
|
|
1004
|
+
if ('load' === opname || 'remove' === opname) {
|
|
1005
|
+
const goOpName = opname.charAt(0).toUpperCase() + opname.slice(1)
|
|
1006
|
+
Content(`\`\`\`go
|
|
1007
|
+
result, err := client.${ent.Name}(nil).${goOpName}(map[string]any{"id": "${ent.name}_id"}, nil)
|
|
1008
|
+
\`\`\`
|
|
1009
|
+
|
|
1010
|
+
`)
|
|
1011
|
+
}
|
|
1012
|
+
else if ('list' === opname) {
|
|
1013
|
+
Content(`\`\`\`go
|
|
1014
|
+
results, err := client.${ent.Name}(nil).List(nil, nil)
|
|
1015
|
+
\`\`\`
|
|
1016
|
+
|
|
1017
|
+
`)
|
|
1018
|
+
}
|
|
1019
|
+
else if ('create' === opname) {
|
|
1020
|
+
Content(`\`\`\`go
|
|
1021
|
+
result, err := client.${ent.Name}(nil).Create(map[string]any{
|
|
1022
|
+
`)
|
|
1023
|
+
each(fields, (field: any) => {
|
|
1024
|
+
if ('id' !== field.name && field.req) {
|
|
1025
|
+
Content(` "${field.name}": /* ${field.type || 'value'} */,
|
|
1026
|
+
`)
|
|
1027
|
+
}
|
|
1028
|
+
})
|
|
1029
|
+
Content(`}, nil)
|
|
1030
|
+
\`\`\`
|
|
1031
|
+
|
|
1032
|
+
`)
|
|
1033
|
+
}
|
|
1034
|
+
else if ('update' === opname) {
|
|
1035
|
+
Content(`\`\`\`go
|
|
1036
|
+
result, err := client.${ent.Name}(nil).Update(map[string]any{
|
|
1037
|
+
"id": "${ent.name}_id",
|
|
1038
|
+
// Fields to update
|
|
1039
|
+
}, nil)
|
|
279
1040
|
\`\`\`
|
|
280
1041
|
|
|
281
1042
|
`)
|
|
1043
|
+
}
|
|
282
1044
|
}
|
|
283
|
-
else
|
|
284
|
-
|
|
1045
|
+
else {
|
|
1046
|
+
if ('load' === opname || 'remove' === opname) {
|
|
1047
|
+
Content(`\`\`\`ts
|
|
1048
|
+
const result = await client.${ent.Name}().${opname}({ id: '${ent.name}_id' })
|
|
1049
|
+
\`\`\`
|
|
1050
|
+
|
|
1051
|
+
`)
|
|
1052
|
+
}
|
|
1053
|
+
else if ('list' === opname) {
|
|
1054
|
+
Content(`\`\`\`ts
|
|
1055
|
+
const results = await client.${ent.Name}().${opname}()
|
|
1056
|
+
\`\`\`
|
|
1057
|
+
|
|
1058
|
+
`)
|
|
1059
|
+
}
|
|
1060
|
+
else if ('create' === opname) {
|
|
1061
|
+
Content(`\`\`\`ts
|
|
1062
|
+
const result = await client.${ent.Name}().create({
|
|
1063
|
+
`)
|
|
1064
|
+
each(fields, (field: any) => {
|
|
1065
|
+
if ('id' !== field.name && field.req) {
|
|
1066
|
+
Content(` ${field.name}: /* ${field.type || 'value'} */,
|
|
1067
|
+
`)
|
|
1068
|
+
}
|
|
1069
|
+
})
|
|
1070
|
+
Content(`})
|
|
1071
|
+
\`\`\`
|
|
1072
|
+
|
|
1073
|
+
`)
|
|
1074
|
+
}
|
|
1075
|
+
else if ('update' === opname) {
|
|
1076
|
+
Content(`\`\`\`ts
|
|
285
1077
|
const result = await client.${ent.Name}().update({
|
|
286
1078
|
id: '${ent.name}_id',
|
|
287
1079
|
// Fields to update
|
|
@@ -289,13 +1081,158 @@ const result = await client.${ent.Name}().update({
|
|
|
289
1081
|
\`\`\`
|
|
290
1082
|
|
|
291
1083
|
`)
|
|
1084
|
+
}
|
|
292
1085
|
}
|
|
293
1086
|
})
|
|
294
1087
|
}
|
|
295
1088
|
|
|
296
1089
|
|
|
297
1090
|
// Common methods
|
|
298
|
-
|
|
1091
|
+
if (isPy) {
|
|
1092
|
+
Content(`### Common Methods
|
|
1093
|
+
|
|
1094
|
+
#### \`data_get() -> dict\`
|
|
1095
|
+
|
|
1096
|
+
Get the entity data.
|
|
1097
|
+
|
|
1098
|
+
#### \`data_set(data)\`
|
|
1099
|
+
|
|
1100
|
+
Set the entity data.
|
|
1101
|
+
|
|
1102
|
+
#### \`match_get() -> dict\`
|
|
1103
|
+
|
|
1104
|
+
Get the entity match criteria.
|
|
1105
|
+
|
|
1106
|
+
#### \`match_set(match)\`
|
|
1107
|
+
|
|
1108
|
+
Set the entity match criteria.
|
|
1109
|
+
|
|
1110
|
+
#### \`make() -> Entity\`
|
|
1111
|
+
|
|
1112
|
+
Create a new \`${ent.Name}Entity\` instance with the same options.
|
|
1113
|
+
|
|
1114
|
+
#### \`get_name() -> str\`
|
|
1115
|
+
|
|
1116
|
+
Return the entity name.
|
|
1117
|
+
|
|
1118
|
+
`)
|
|
1119
|
+
}
|
|
1120
|
+
else if (isPhp) {
|
|
1121
|
+
Content(`### Common Methods
|
|
1122
|
+
|
|
1123
|
+
#### \`dataGet(): array\`
|
|
1124
|
+
|
|
1125
|
+
Get the entity data. Returns a copy of the current data.
|
|
1126
|
+
|
|
1127
|
+
#### \`dataSet($data): void\`
|
|
1128
|
+
|
|
1129
|
+
Set the entity data.
|
|
1130
|
+
|
|
1131
|
+
#### \`matchGet(): array\`
|
|
1132
|
+
|
|
1133
|
+
Get the entity match criteria.
|
|
1134
|
+
|
|
1135
|
+
#### \`matchSet($match): void\`
|
|
1136
|
+
|
|
1137
|
+
Set the entity match criteria.
|
|
1138
|
+
|
|
1139
|
+
#### \`make(): ${ent.Name}Entity\`
|
|
1140
|
+
|
|
1141
|
+
Create a new \`${ent.Name}Entity\` instance with the same client and
|
|
1142
|
+
options.
|
|
1143
|
+
|
|
1144
|
+
#### \`getName(): string\`
|
|
1145
|
+
|
|
1146
|
+
Return the entity name.
|
|
1147
|
+
|
|
1148
|
+
`)
|
|
1149
|
+
}
|
|
1150
|
+
else if (isRb) {
|
|
1151
|
+
Content(`### Common Methods
|
|
1152
|
+
|
|
1153
|
+
#### \`data_get -> Hash\`
|
|
1154
|
+
|
|
1155
|
+
Get the entity data. Returns a copy of the current data.
|
|
1156
|
+
|
|
1157
|
+
#### \`data_set(data)\`
|
|
1158
|
+
|
|
1159
|
+
Set the entity data.
|
|
1160
|
+
|
|
1161
|
+
#### \`match_get -> Hash\`
|
|
1162
|
+
|
|
1163
|
+
Get the entity match criteria.
|
|
1164
|
+
|
|
1165
|
+
#### \`match_set(match)\`
|
|
1166
|
+
|
|
1167
|
+
Set the entity match criteria.
|
|
1168
|
+
|
|
1169
|
+
#### \`make -> Entity\`
|
|
1170
|
+
|
|
1171
|
+
Create a new \`${ent.Name}Entity\` instance with the same client and
|
|
1172
|
+
options.
|
|
1173
|
+
|
|
1174
|
+
#### \`get_name -> String\`
|
|
1175
|
+
|
|
1176
|
+
Return the entity name.
|
|
1177
|
+
|
|
1178
|
+
`)
|
|
1179
|
+
}
|
|
1180
|
+
else if (isLua) {
|
|
1181
|
+
Content(`### Common Methods
|
|
1182
|
+
|
|
1183
|
+
#### \`data_get() -> table\`
|
|
1184
|
+
|
|
1185
|
+
Get the entity data. Returns a copy of the current data.
|
|
1186
|
+
|
|
1187
|
+
#### \`data_set(data)\`
|
|
1188
|
+
|
|
1189
|
+
Set the entity data.
|
|
1190
|
+
|
|
1191
|
+
#### \`match_get() -> table\`
|
|
1192
|
+
|
|
1193
|
+
Get the entity match criteria.
|
|
1194
|
+
|
|
1195
|
+
#### \`match_set(match)\`
|
|
1196
|
+
|
|
1197
|
+
Set the entity match criteria.
|
|
1198
|
+
|
|
1199
|
+
#### \`make() -> Entity\`
|
|
1200
|
+
|
|
1201
|
+
Create a new \`${ent.Name}Entity\` instance with the same client and
|
|
1202
|
+
options.
|
|
1203
|
+
|
|
1204
|
+
#### \`get_name() -> string\`
|
|
1205
|
+
|
|
1206
|
+
Return the entity name.
|
|
1207
|
+
|
|
1208
|
+
`)
|
|
1209
|
+
}
|
|
1210
|
+
else if (isGo) {
|
|
1211
|
+
Content(`### Common Methods
|
|
1212
|
+
|
|
1213
|
+
#### \`Data(args ...any) any\`
|
|
1214
|
+
|
|
1215
|
+
Get or set the entity data. When called with data, sets the entity's
|
|
1216
|
+
internal data and returns the current data. When called without
|
|
1217
|
+
arguments, returns a copy of the current data.
|
|
1218
|
+
|
|
1219
|
+
#### \`Match(args ...any) any\`
|
|
1220
|
+
|
|
1221
|
+
Get or set the entity match criteria. Works the same as \`Data()\`.
|
|
1222
|
+
|
|
1223
|
+
#### \`Make() Entity\`
|
|
1224
|
+
|
|
1225
|
+
Create a new \`${ent.Name}Entity\` instance with the same client and
|
|
1226
|
+
options.
|
|
1227
|
+
|
|
1228
|
+
#### \`GetName() string\`
|
|
1229
|
+
|
|
1230
|
+
Return the entity name.
|
|
1231
|
+
|
|
1232
|
+
`)
|
|
1233
|
+
}
|
|
1234
|
+
else {
|
|
1235
|
+
Content(`### Common Methods
|
|
299
1236
|
|
|
300
1237
|
#### \`data(data?: object)\`
|
|
301
1238
|
|
|
@@ -321,6 +1258,7 @@ Return the parent \`${model.Name}SDK\` instance.
|
|
|
321
1258
|
Return a copy of the entity options.
|
|
322
1259
|
|
|
323
1260
|
`)
|
|
1261
|
+
}
|
|
324
1262
|
})
|
|
325
1263
|
|
|
326
1264
|
|
|
@@ -345,19 +1283,98 @@ Return a copy of the entity options.
|
|
|
345
1283
|
|
|
346
1284
|
Features are activated via the \`feature\` option:
|
|
347
1285
|
|
|
348
|
-
|
|
1286
|
+
`)
|
|
1287
|
+
|
|
1288
|
+
if (isPy) {
|
|
1289
|
+
Content(`\`\`\`python
|
|
1290
|
+
client = ${model.const.Name}SDK({
|
|
1291
|
+
"feature": {
|
|
1292
|
+
`)
|
|
1293
|
+
activeFeatures.map((f: any) => {
|
|
1294
|
+
Content(` "${f.name}": {"active": True},
|
|
1295
|
+
`)
|
|
1296
|
+
})
|
|
1297
|
+
Content(` },
|
|
1298
|
+
})
|
|
1299
|
+
\`\`\`
|
|
1300
|
+
|
|
1301
|
+
`)
|
|
1302
|
+
}
|
|
1303
|
+
else if (isPhp) {
|
|
1304
|
+
Content(`\`\`\`php
|
|
1305
|
+
$client = new ${model.const.Name}SDK([
|
|
1306
|
+
"feature" => [
|
|
1307
|
+
`)
|
|
1308
|
+
activeFeatures.map((f: any) => {
|
|
1309
|
+
Content(` "${f.name}" => ["active" => true],
|
|
1310
|
+
`)
|
|
1311
|
+
})
|
|
1312
|
+
Content(` ],
|
|
1313
|
+
]);
|
|
1314
|
+
\`\`\`
|
|
1315
|
+
|
|
1316
|
+
`)
|
|
1317
|
+
}
|
|
1318
|
+
else if (isRb) {
|
|
1319
|
+
Content(`\`\`\`ruby
|
|
1320
|
+
client = ${model.const.Name}SDK.new({
|
|
1321
|
+
"feature" => {
|
|
1322
|
+
`)
|
|
1323
|
+
activeFeatures.map((f: any) => {
|
|
1324
|
+
Content(` "${f.name}" => { "active" => true },
|
|
1325
|
+
`)
|
|
1326
|
+
})
|
|
1327
|
+
Content(` },
|
|
1328
|
+
})
|
|
1329
|
+
\`\`\`
|
|
1330
|
+
|
|
1331
|
+
`)
|
|
1332
|
+
}
|
|
1333
|
+
else if (isLua) {
|
|
1334
|
+
Content(`\`\`\`lua
|
|
1335
|
+
local client = sdk.new({
|
|
1336
|
+
feature = {
|
|
1337
|
+
`)
|
|
1338
|
+
activeFeatures.map((f: any) => {
|
|
1339
|
+
Content(` ${f.name} = { active = true },
|
|
1340
|
+
`)
|
|
1341
|
+
})
|
|
1342
|
+
Content(` },
|
|
1343
|
+
})
|
|
1344
|
+
\`\`\`
|
|
1345
|
+
|
|
1346
|
+
`)
|
|
1347
|
+
}
|
|
1348
|
+
else if (isGo) {
|
|
1349
|
+
Content(`\`\`\`go
|
|
1350
|
+
client := sdk.New${model.const.Name}SDK(map[string]any{
|
|
1351
|
+
"feature": map[string]any{
|
|
1352
|
+
`)
|
|
1353
|
+
activeFeatures.map((f: any) => {
|
|
1354
|
+
Content(` "${f.name}": map[string]any{"active": true},
|
|
1355
|
+
`)
|
|
1356
|
+
})
|
|
1357
|
+
Content(` },
|
|
1358
|
+
})
|
|
1359
|
+
\`\`\`
|
|
1360
|
+
|
|
1361
|
+
`)
|
|
1362
|
+
}
|
|
1363
|
+
else {
|
|
1364
|
+
Content(`\`\`\`ts
|
|
349
1365
|
const client = new ${model.Name}SDK({
|
|
350
1366
|
feature: {
|
|
351
1367
|
`)
|
|
352
|
-
|
|
353
|
-
|
|
1368
|
+
activeFeatures.map((f: any) => {
|
|
1369
|
+
Content(` ${f.name}: { active: true },
|
|
354
1370
|
`)
|
|
355
|
-
|
|
356
|
-
|
|
1371
|
+
})
|
|
1372
|
+
Content(` }
|
|
357
1373
|
})
|
|
358
1374
|
\`\`\`
|
|
359
1375
|
|
|
360
1376
|
`)
|
|
1377
|
+
}
|
|
361
1378
|
}
|
|
362
1379
|
|
|
363
1380
|
})
|