@voxgig/sdkgen 0.35.2 → 0.37.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/Main.js +0 -12
- package/dist/cmp/Main.js.map +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/Config_go.ts +6 -2
- 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/EntityBase_js.ts +34 -0
- package/project/.sdk/src/cmp/js/Main_js.ts +10 -0
- package/project/.sdk/src/cmp/js/ReadmeExplanation_js.ts +33 -0
- package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +123 -0
- package/project/.sdk/src/cmp/js/ReadmeModel_js.ts +152 -0
- package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +1 -1
- package/project/.sdk/src/cmp/js/ReadmeTopHowto_js.ts +25 -0
- package/project/.sdk/src/cmp/js/ReadmeTopQuick_js.ts +65 -0
- package/project/.sdk/src/cmp/js/ReadmeTopTest_js.ts +36 -0
- package/project/.sdk/src/cmp/js/TestDirect_js.ts +53 -5
- package/project/.sdk/src/cmp/js/TestEntity_js.ts +114 -20
- package/project/.sdk/src/cmp/js/fragment/Entity.fragment.js +7 -139
- package/project/.sdk/src/cmp/js/fragment/EntityBase.fragment.js +149 -0
- package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +6 -10
- package/project/.sdk/src/cmp/js/fragment/EntityListOp.fragment.js +6 -10
- package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +7 -11
- package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +7 -11
- package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +7 -11
- package/project/.sdk/src/cmp/js/fragment/Main.fragment.js +2 -0
- package/project/.sdk/src/cmp/js/fragment/SdkError.fragment.js +0 -2
- package/project/.sdk/src/cmp/lua/Config_lua.ts +116 -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 +485 -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 +111 -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 +479 -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 +97 -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 +477 -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 +105 -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/Main_ts.ts +7 -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/go/test/runner_test.go +16 -2
- package/project/.sdk/tm/js/src/Context.js +142 -0
- package/project/.sdk/tm/js/src/Control.js +16 -0
- package/project/.sdk/tm/js/src/Operation.js +19 -0
- package/project/.sdk/tm/js/src/Point.js +24 -0
- package/project/.sdk/tm/js/src/README.md +1 -0
- package/project/.sdk/tm/js/src/Response.js +19 -0
- package/project/.sdk/tm/js/src/Result.js +21 -0
- package/project/.sdk/tm/js/src/Spec.js +26 -0
- package/project/.sdk/tm/js/src/feature/README.md +1 -0
- package/project/.sdk/tm/js/src/feature/base/BaseFeature.js +45 -0
- package/project/.sdk/tm/js/src/feature/log/LogFeature.js +46 -47
- package/project/.sdk/tm/js/src/feature/test/TestFeature.js +207 -0
- package/project/.sdk/tm/js/src/types.js +22 -0
- package/project/.sdk/tm/js/src/utility/CleanUtility.js +31 -0
- package/project/.sdk/tm/js/src/utility/DoneUtility.js +11 -4
- package/project/.sdk/tm/js/src/utility/FeatureAddUtility.js +42 -0
- package/project/.sdk/tm/js/src/utility/FeatureHookUtility.js +25 -0
- package/project/.sdk/tm/js/src/utility/FeatureInitUtility.js +11 -0
- package/project/.sdk/tm/js/src/utility/FetcherUtility.js +28 -0
- package/project/.sdk/tm/js/src/utility/MakeContextUtility.js +11 -0
- package/project/.sdk/tm/js/src/utility/MakeErrorUtility.js +55 -0
- package/project/.sdk/tm/js/src/utility/MakeFetchDefUtility.js +44 -0
- package/project/.sdk/tm/js/src/utility/MakeOptionsUtility.js +93 -0
- package/project/.sdk/tm/js/src/utility/MakePointUtility.js +77 -0
- package/project/.sdk/tm/js/src/utility/MakeRequestUtility.js +63 -0
- package/project/.sdk/tm/js/src/utility/MakeResponseUtility.js +55 -0
- package/project/.sdk/tm/js/src/utility/MakeResultUtility.js +54 -0
- package/project/.sdk/tm/js/src/utility/MakeSpecUtility.js +58 -0
- package/project/.sdk/tm/js/src/utility/MakeUrlUtility.js +40 -0
- package/project/.sdk/tm/js/src/utility/ParamUtility.js +61 -0
- package/project/.sdk/tm/js/src/utility/PrepareAuthUtility.js +41 -0
- package/project/.sdk/tm/js/src/utility/PrepareBodyUtility.js +25 -0
- package/project/.sdk/tm/js/src/utility/PrepareHeadersUtility.js +18 -0
- package/project/.sdk/tm/js/src/utility/{MethodUtility.js → PrepareMethodUtility.js} +7 -7
- package/project/.sdk/tm/js/src/utility/PrepareParamsUtility.js +25 -0
- package/project/.sdk/tm/js/src/utility/PreparePathUtility.js +13 -0
- package/project/.sdk/tm/js/src/utility/PrepareQueryUtility.js +26 -0
- package/project/.sdk/tm/js/src/utility/README.md +1 -0
- package/project/.sdk/tm/js/src/utility/ResultBasicUtility.js +34 -0
- package/project/.sdk/tm/js/src/utility/ResultBodyUtility.js +18 -0
- package/project/.sdk/tm/js/src/utility/ResultHeadersUtility.js +22 -0
- package/project/.sdk/tm/js/src/utility/StructUtility.js +2219 -1078
- package/project/.sdk/tm/js/src/utility/TransformRequestUtility.js +28 -0
- package/project/.sdk/tm/js/src/utility/TransformResponseUtility.js +31 -0
- package/project/.sdk/tm/js/src/utility/Utility.js +61 -61
- package/project/.sdk/tm/js/test/README.md +1 -0
- package/project/.sdk/tm/js/test/exists.test.js +16 -0
- package/project/.sdk/tm/js/test/runner.js +323 -107
- package/project/.sdk/tm/js/test/utility/Custom.test.js +41 -63
- package/project/.sdk/tm/js/test/utility/PrimaryUtility.test.js +390 -116
- package/project/.sdk/tm/js/test/utility/StructUtility.test.js +728 -175
- package/project/.sdk/tm/js/test/utility/index.js +9 -0
- package/project/.sdk/tm/js/test/utility.js +72 -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/primary_utility_test.lua +1213 -0
- package/project/.sdk/tm/lua/test/runner.lua +86 -0
- package/project/.sdk/tm/lua/test/struct_runner.lua +602 -0
- package/project/.sdk/tm/lua/test/struct_utility_test.lua +959 -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 +3427 -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 +156 -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/PrimaryUtilityTest.php +1309 -0
- package/project/.sdk/tm/php/test/Runner.php +112 -0
- package/project/.sdk/tm/php/test/StructRunner.php +275 -0
- package/project/.sdk/tm/php/test/StructUtilityTest.php +1336 -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 +105 -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 +102 -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 +53 -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 +68 -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 +3535 -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 +90 -0
- package/project/.sdk/tm/py/test/struct_runner.py +411 -0
- package/project/.sdk/tm/py/test/test_primary_utility.py +1101 -0
- package/project/.sdk/tm/py/test/test_struct_utility.py +751 -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/primary_utility_test.rb +1083 -0
- package/project/.sdk/tm/rb/test/runner.rb +70 -0
- package/project/.sdk/tm/rb/test/struct_runner.rb +309 -0
- package/project/.sdk/tm/rb/test/struct_utility_test.rb +670 -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/Main.ts +1 -16
- 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/src/cmp/js/Quick_js.ts +0 -78
- package/project/.sdk/src/cmp/js/TestAcceptEntity_js.ts +0 -13
- package/project/.sdk/src/cmp/js/TestAccept_js.ts +0 -18
- package/project/.sdk/tm/go/test/exists_test.go +0 -16
- package/project/.sdk/tm/js/src/utility/AuthUtility.js +0 -21
- package/project/.sdk/tm/js/src/utility/BodyUtility.js +0 -29
- package/project/.sdk/tm/js/src/utility/ErrorUtility.js +0 -33
- package/project/.sdk/tm/js/src/utility/FindparamUtility.js +0 -31
- package/project/.sdk/tm/js/src/utility/FullurlUtility.js +0 -39
- package/project/.sdk/tm/js/src/utility/HeadersUtility.js +0 -13
- package/project/.sdk/tm/js/src/utility/JoinurlUtility.js +0 -14
- package/project/.sdk/tm/js/src/utility/OperatorUtility.js +0 -44
- package/project/.sdk/tm/js/src/utility/OptionsUtility.js +0 -54
- package/project/.sdk/tm/js/src/utility/ParamsUtility.js +0 -21
- package/project/.sdk/tm/js/src/utility/QueryUtility.js +0 -21
- package/project/.sdk/tm/js/src/utility/ReqformUtility.js +0 -32
- package/project/.sdk/tm/js/src/utility/RequestUtility.js +0 -48
- package/project/.sdk/tm/js/src/utility/ResbasicUtility.js +0 -27
- package/project/.sdk/tm/js/src/utility/ResbodyUtility.js +0 -15
- package/project/.sdk/tm/js/src/utility/ResformUtility.js +0 -34
- package/project/.sdk/tm/js/src/utility/ResheadersUtility.js +0 -19
- package/project/.sdk/tm/js/src/utility/ResponseUtility.js +0 -37
- package/project/.sdk/tm/js/src/utility/ResultUtility.js +0 -28
- package/project/.sdk/tm/js/src/utility/SpecUtility.js +0 -35
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# ProjectName SDK utility: transform_request
|
|
2
|
+
require_relative 'struct/voxgig_struct'
|
|
3
|
+
require_relative '../core/helpers'
|
|
4
|
+
module ProjectNameUtilities
|
|
5
|
+
TransformRequest = ->(ctx) {
|
|
6
|
+
spec = ctx.spec
|
|
7
|
+
point = ctx.point
|
|
8
|
+
spec.step = "reqform" if spec
|
|
9
|
+
transform = ProjectNameHelpers.to_map(VoxgigStruct.getprop(point, "transform"))
|
|
10
|
+
return ctx.reqdata unless transform
|
|
11
|
+
reqform = VoxgigStruct.getprop(transform, "req")
|
|
12
|
+
return ctx.reqdata unless reqform
|
|
13
|
+
VoxgigStruct.transform({ "reqdata" => ctx.reqdata }, reqform)
|
|
14
|
+
}
|
|
15
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# ProjectName SDK utility: transform_response
|
|
2
|
+
require_relative 'struct/voxgig_struct'
|
|
3
|
+
require_relative '../core/helpers'
|
|
4
|
+
module ProjectNameUtilities
|
|
5
|
+
TransformResponse = ->(ctx) {
|
|
6
|
+
spec = ctx.spec
|
|
7
|
+
result = ctx.result
|
|
8
|
+
point = ctx.point
|
|
9
|
+
spec.step = "resform" if spec
|
|
10
|
+
return nil if result.nil? || !result.ok
|
|
11
|
+
transform = ProjectNameHelpers.to_map(VoxgigStruct.getprop(point, "transform"))
|
|
12
|
+
return nil unless transform
|
|
13
|
+
resform = VoxgigStruct.getprop(transform, "res")
|
|
14
|
+
return nil unless resform
|
|
15
|
+
resdata = VoxgigStruct.transform({
|
|
16
|
+
"ok" => result.ok, "status" => result.status, "statusText" => result.status_text,
|
|
17
|
+
"headers" => result.headers, "body" => result.body, "err" => result.err,
|
|
18
|
+
"resdata" => result.resdata, "resmatch" => result.resmatch,
|
|
19
|
+
}, resform)
|
|
20
|
+
result.resdata = resdata
|
|
21
|
+
resdata
|
|
22
|
+
}
|
|
23
|
+
end
|
package/src/cmp/Main.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, names
|
|
2
|
+
import { cmp, names } from 'jostraca'
|
|
3
3
|
|
|
4
4
|
import { requirePath } from '../utility'
|
|
5
5
|
|
|
@@ -12,21 +12,6 @@ const Main = cmp(function Main(props: any) {
|
|
|
12
12
|
const { target, ctx$ } = props
|
|
13
13
|
const { model, stdrep, log } = ctx$
|
|
14
14
|
|
|
15
|
-
const copyOpts: any = {
|
|
16
|
-
// This folder is relative to the .sdk folder in the project, as that is where
|
|
17
|
-
// the sdk is generated from.
|
|
18
|
-
from: 'tm/' + target.name,
|
|
19
|
-
replace: {
|
|
20
|
-
...stdrep,
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (false === target.srcfeature) {
|
|
25
|
-
copyOpts.exclude = [/src\//]
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
Copy(copyOpts)
|
|
29
|
-
|
|
30
15
|
const Main_sdk = requirePath(ctx$, `cmp/${target.name}/Main_${target.name}`)
|
|
31
16
|
|
|
32
17
|
Main_sdk['Main']({ model, target, stdrep })
|
package/src/cmp/Readme.ts
CHANGED
|
@@ -8,6 +8,8 @@ import { ReadmeQuick } from './ReadmeQuick'
|
|
|
8
8
|
import { ReadmeModel } from './ReadmeModel'
|
|
9
9
|
import { ReadmeOptions } from './ReadmeOptions'
|
|
10
10
|
import { ReadmeEntity } from './ReadmeEntity'
|
|
11
|
+
import { ReadmeHowto } from './ReadmeHowto'
|
|
12
|
+
import { ReadmeExplanation } from './ReadmeExplanation'
|
|
11
13
|
import { ReadmeRef } from './ReadmeRef'
|
|
12
14
|
|
|
13
15
|
|
|
@@ -17,19 +19,17 @@ const Readme = cmp(function Readme(props: any) {
|
|
|
17
19
|
|
|
18
20
|
File({ name: 'README.md' }, () => {
|
|
19
21
|
|
|
20
|
-
Content(`
|
|
21
|
-
# ${model.Name} ${target.title} SDK
|
|
22
|
-
`)
|
|
23
|
-
// Sections
|
|
24
22
|
ReadmeIntro({ target })
|
|
25
23
|
ReadmeInstall({ target })
|
|
26
24
|
ReadmeQuick({ target })
|
|
25
|
+
ReadmeHowto({ target })
|
|
27
26
|
ReadmeModel({ target })
|
|
28
27
|
ReadmeOptions({ target })
|
|
29
28
|
ReadmeEntity({ target })
|
|
29
|
+
ReadmeExplanation({ target })
|
|
30
30
|
|
|
31
31
|
Content(`
|
|
32
|
-
## Reference
|
|
32
|
+
## Full Reference
|
|
33
33
|
|
|
34
34
|
See [REFERENCE.md](REFERENCE.md) for complete API reference
|
|
35
35
|
documentation including all method signatures, entity field schemas,
|
package/src/cmp/ReadmeEntity.ts
CHANGED
|
@@ -7,22 +7,25 @@ import {
|
|
|
7
7
|
} from '../types'
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
const OP_DESC: Record<string, { method: string, desc: string }> = {
|
|
11
|
-
load: { method: 'load(match)', desc: 'Load a single entity by match criteria.' },
|
|
12
|
-
list: { method: 'list(match)', desc: 'List entities matching the criteria.' },
|
|
13
|
-
create: { method: 'create(data)', desc: 'Create a new entity with the given data.' },
|
|
14
|
-
update: { method: 'update(data)', desc: 'Update an existing entity.' },
|
|
15
|
-
remove: { method: 'remove(match)', desc: 'Remove the matching entity.' },
|
|
10
|
+
const OP_DESC: Record<string, { method: string, goMethod: string, desc: string }> = {
|
|
11
|
+
load: { method: 'load(match)', goMethod: 'Load(match, ctrl)', desc: 'Load a single entity by match criteria.' },
|
|
12
|
+
list: { method: 'list(match)', goMethod: 'List(match, ctrl)', desc: 'List entities matching the criteria.' },
|
|
13
|
+
create: { method: 'create(data)', goMethod: 'Create(data, ctrl)', desc: 'Create a new entity with the given data.' },
|
|
14
|
+
update: { method: 'update(data)', goMethod: 'Update(data, ctrl)', desc: 'Update an existing entity.' },
|
|
15
|
+
remove: { method: 'remove(match)', goMethod: 'Remove(match, ctrl)', desc: 'Remove the matching entity.' },
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
20
|
-
const {
|
|
20
|
+
const { target } = props
|
|
21
|
+
const { model } = props.ctx$
|
|
21
22
|
|
|
22
23
|
const entity = getModelPath(model, `main.${KIT}.entity`)
|
|
24
|
+
const isGo = target.name === 'go'
|
|
25
|
+
const lang = isGo ? 'go' : 'ts'
|
|
23
26
|
|
|
24
27
|
const publishedEntities = each(entity)
|
|
25
|
-
.filter((entity: any) => entity.
|
|
28
|
+
.filter((entity: any) => entity.active !== false)
|
|
26
29
|
|
|
27
30
|
if (0 === publishedEntities.length) {
|
|
28
31
|
return
|
|
@@ -36,7 +39,7 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
|
36
39
|
|
|
37
40
|
publishedEntities.map((entity: any) => {
|
|
38
41
|
const opnames = Object.keys(entity.op || {})
|
|
39
|
-
const fields = entity.
|
|
42
|
+
const fields = entity.fields || []
|
|
40
43
|
|
|
41
44
|
Content(`
|
|
42
45
|
### ${entity.Name}
|
|
@@ -49,9 +52,16 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
|
49
52
|
`)
|
|
50
53
|
}
|
|
51
54
|
|
|
52
|
-
|
|
55
|
+
if (isGo) {
|
|
56
|
+
Content(`Create an instance: \`${entity.name} := client.${entity.Name}(nil)\`
|
|
53
57
|
|
|
54
58
|
`)
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
Content(`Create an instance: \`const ${entity.name} = client.${entity.Name}()\`
|
|
62
|
+
|
|
63
|
+
`)
|
|
64
|
+
}
|
|
55
65
|
|
|
56
66
|
// Operations table
|
|
57
67
|
if (opnames.length > 0) {
|
|
@@ -63,7 +73,8 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
|
63
73
|
opnames.map((opname: string) => {
|
|
64
74
|
const info = OP_DESC[opname]
|
|
65
75
|
if (info) {
|
|
66
|
-
|
|
76
|
+
const method = isGo ? info.goMethod : info.method
|
|
77
|
+
Content(`| \`${method}\` | ${info.desc} |
|
|
67
78
|
`)
|
|
68
79
|
}
|
|
69
80
|
})
|
|
@@ -91,42 +102,83 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
|
91
102
|
}
|
|
92
103
|
|
|
93
104
|
// Example usage
|
|
94
|
-
if (
|
|
95
|
-
|
|
105
|
+
if (isGo) {
|
|
106
|
+
if (opnames.includes('load')) {
|
|
107
|
+
Content(`#### Example: Load
|
|
108
|
+
|
|
109
|
+
\`\`\`go
|
|
110
|
+
result, err := client.${entity.Name}(nil).Load(map[string]any{"id": "${entity.name}_id"}, nil)
|
|
111
|
+
\`\`\`
|
|
112
|
+
|
|
113
|
+
`)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (opnames.includes('list')) {
|
|
117
|
+
Content(`#### Example: List
|
|
118
|
+
|
|
119
|
+
\`\`\`go
|
|
120
|
+
results, err := client.${entity.Name}(nil).List(nil, nil)
|
|
121
|
+
\`\`\`
|
|
122
|
+
|
|
123
|
+
`)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (opnames.includes('create')) {
|
|
127
|
+
Content(`#### Example: Create
|
|
128
|
+
|
|
129
|
+
\`\`\`go
|
|
130
|
+
result, err := client.${entity.Name}(nil).Create(map[string]any{
|
|
131
|
+
`)
|
|
132
|
+
each(fields, (field: any) => {
|
|
133
|
+
if ('id' !== field.name && field.req) {
|
|
134
|
+
Content(` "${field.name}": /* ${field.type || 'value'} */,
|
|
135
|
+
`)
|
|
136
|
+
}
|
|
137
|
+
})
|
|
138
|
+
Content(`}, nil)
|
|
139
|
+
\`\`\`
|
|
140
|
+
|
|
141
|
+
`)
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
if (opnames.includes('load')) {
|
|
146
|
+
Content(`#### Example: Load
|
|
96
147
|
|
|
97
148
|
\`\`\`ts
|
|
98
149
|
const ${entity.name} = await client.${entity.Name}().load({ id: '${entity.name}_id' })
|
|
99
150
|
\`\`\`
|
|
100
151
|
|
|
101
152
|
`)
|
|
102
|
-
|
|
153
|
+
}
|
|
103
154
|
|
|
104
|
-
|
|
105
|
-
|
|
155
|
+
if (opnames.includes('list')) {
|
|
156
|
+
Content(`#### Example: List
|
|
106
157
|
|
|
107
158
|
\`\`\`ts
|
|
108
159
|
const ${entity.name}s = await client.${entity.Name}().list()
|
|
109
160
|
\`\`\`
|
|
110
161
|
|
|
111
162
|
`)
|
|
112
|
-
|
|
163
|
+
}
|
|
113
164
|
|
|
114
|
-
|
|
115
|
-
|
|
165
|
+
if (opnames.includes('create')) {
|
|
166
|
+
Content(`#### Example: Create
|
|
116
167
|
|
|
117
168
|
\`\`\`ts
|
|
118
169
|
const ${entity.name} = await client.${entity.Name}().create({
|
|
119
170
|
`)
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
171
|
+
each(fields, (field: any) => {
|
|
172
|
+
if ('id' !== field.name && field.req) {
|
|
173
|
+
Content(` ${field.name}: /* ${field.type || 'value'} */,
|
|
123
174
|
`)
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
175
|
+
}
|
|
176
|
+
})
|
|
177
|
+
Content(`})
|
|
127
178
|
\`\`\`
|
|
128
179
|
|
|
129
180
|
`)
|
|
181
|
+
}
|
|
130
182
|
}
|
|
131
183
|
|
|
132
184
|
})
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
|
|
2
|
+
import { cmp, each, names, Content } from 'jostraca'
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
KIT,
|
|
6
|
+
getModelPath
|
|
7
|
+
} from '../types'
|
|
8
|
+
|
|
9
|
+
import { requirePath } from '../utility'
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
const ReadmeExplanation = cmp(function ReadmeExplanation(props: any) {
|
|
13
|
+
const { target, ctx$ } = props
|
|
14
|
+
const { model } = ctx$
|
|
15
|
+
|
|
16
|
+
const feature = getModelPath(model, `main.${KIT}.feature`)
|
|
17
|
+
|
|
18
|
+
Content(`
|
|
19
|
+
## Explanation
|
|
20
|
+
|
|
21
|
+
### The operation pipeline
|
|
22
|
+
|
|
23
|
+
Every entity operation (load, list, create, update, remove) follows a
|
|
24
|
+
six-stage pipeline. Each stage fires a feature hook before executing:
|
|
25
|
+
|
|
26
|
+
\`\`\`
|
|
27
|
+
PrePoint \u2192 PreSpec \u2192 PreRequest \u2192 PreResponse \u2192 PreResult \u2192 PreDone
|
|
28
|
+
\`\`\`
|
|
29
|
+
|
|
30
|
+
- **PrePoint**: Resolves which API endpoint to call based on the
|
|
31
|
+
operation name and entity configuration.
|
|
32
|
+
- **PreSpec**: Builds the HTTP spec \u2014 URL, method, headers, body \u2014
|
|
33
|
+
from the resolved point and the caller's parameters.
|
|
34
|
+
- **PreRequest**: Sends the HTTP request. Features can intercept here
|
|
35
|
+
to replace the transport (as TestFeature does with mocks).
|
|
36
|
+
- **PreResponse**: Parses the raw HTTP response.
|
|
37
|
+
- **PreResult**: Extracts the business data from the parsed response.
|
|
38
|
+
- **PreDone**: Final stage before returning to the caller. Entity
|
|
39
|
+
state (match, data) is updated here.
|
|
40
|
+
|
|
41
|
+
`)
|
|
42
|
+
|
|
43
|
+
// Target-specific error description
|
|
44
|
+
if (target.name === 'py') {
|
|
45
|
+
Content(`If any stage returns an error, the pipeline short-circuits and the
|
|
46
|
+
error is returned to the caller as the second element in the return tuple.
|
|
47
|
+
|
|
48
|
+
`)
|
|
49
|
+
}
|
|
50
|
+
else if (target.name === 'php') {
|
|
51
|
+
Content(`If any stage returns an error, the pipeline short-circuits and the
|
|
52
|
+
error is returned to the caller as the second element in the return array.
|
|
53
|
+
|
|
54
|
+
`)
|
|
55
|
+
}
|
|
56
|
+
else if (target.name === 'rb') {
|
|
57
|
+
Content(`If any stage returns an error, the pipeline short-circuits and the
|
|
58
|
+
error is returned to the caller as a second return value.
|
|
59
|
+
|
|
60
|
+
`)
|
|
61
|
+
}
|
|
62
|
+
else if (target.name === 'lua') {
|
|
63
|
+
Content(`If any stage returns an error, the pipeline short-circuits and the
|
|
64
|
+
error is returned to the caller as a second return value.
|
|
65
|
+
|
|
66
|
+
`)
|
|
67
|
+
}
|
|
68
|
+
else if (target.name === 'go') {
|
|
69
|
+
Content(`If any stage returns an error, the pipeline short-circuits and the
|
|
70
|
+
error is returned to the caller. An unexpected panic triggers the
|
|
71
|
+
\`PreUnexpected\` hook.
|
|
72
|
+
|
|
73
|
+
`)
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
Content(`If any stage returns an error, the pipeline short-circuits and the
|
|
77
|
+
error is returned to the caller.
|
|
78
|
+
|
|
79
|
+
An unexpected exception triggers the \`PreUnexpected\` hook before
|
|
80
|
+
propagating.
|
|
81
|
+
|
|
82
|
+
`)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
// Features and hooks
|
|
87
|
+
Content(`### Features and hooks
|
|
88
|
+
|
|
89
|
+
`)
|
|
90
|
+
|
|
91
|
+
if (target.name === 'py') {
|
|
92
|
+
Content(`Features are the extension mechanism. A feature is a Python class
|
|
93
|
+
with hook methods named after pipeline stages (e.g. \`PrePoint\`,
|
|
94
|
+
\`PreSpec\`). Each method receives the context.
|
|
95
|
+
|
|
96
|
+
`)
|
|
97
|
+
}
|
|
98
|
+
else if (target.name === 'php') {
|
|
99
|
+
Content(`Features are the extension mechanism. A feature is a PHP class
|
|
100
|
+
with hook methods named after pipeline stages (e.g. \`PrePoint\`,
|
|
101
|
+
\`PreSpec\`). Each method receives the context.
|
|
102
|
+
|
|
103
|
+
`)
|
|
104
|
+
}
|
|
105
|
+
else if (target.name === 'rb') {
|
|
106
|
+
Content(`Features are the extension mechanism. A feature is a Ruby class
|
|
107
|
+
with hook methods named after pipeline stages (e.g. \`PrePoint\`,
|
|
108
|
+
\`PreSpec\`). Each method receives the context.
|
|
109
|
+
|
|
110
|
+
`)
|
|
111
|
+
}
|
|
112
|
+
else if (target.name === 'lua') {
|
|
113
|
+
Content(`Features are the extension mechanism. A feature is a Lua table
|
|
114
|
+
with hook methods named after pipeline stages (e.g. \`PrePoint\`,
|
|
115
|
+
\`PreSpec\`). Each method receives the context.
|
|
116
|
+
|
|
117
|
+
`)
|
|
118
|
+
}
|
|
119
|
+
else if (target.name === 'go') {
|
|
120
|
+
Content(`Features are the extension mechanism. A feature implements the
|
|
121
|
+
\`Feature\` interface and provides hooks \u2014 functions keyed by pipeline
|
|
122
|
+
stage names.
|
|
123
|
+
|
|
124
|
+
`)
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
Content(`Features are the extension mechanism. A feature is an object with a
|
|
128
|
+
\`hooks\` map. Each hook key is a pipeline stage name, and the value is
|
|
129
|
+
a function that receives the context.
|
|
130
|
+
|
|
131
|
+
`)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
Content(`The SDK ships with built-in features:
|
|
135
|
+
|
|
136
|
+
`)
|
|
137
|
+
each(feature, (feat: any) => {
|
|
138
|
+
if (!feat.active) return
|
|
139
|
+
if (!feat.Name) names(feat, feat.name)
|
|
140
|
+
const purpose = feat.title || feat.Name || feat.name
|
|
141
|
+
Content(`- **${feat.Name}Feature**: ${purpose}
|
|
142
|
+
`)
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
Content(`
|
|
146
|
+
Features are initialized in order. Hooks fire in the order features
|
|
147
|
+
were added, so later features can override earlier ones.
|
|
148
|
+
|
|
149
|
+
`)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
// Target-specific explanation
|
|
153
|
+
const ReadmeExplanation_sdk =
|
|
154
|
+
requirePath(ctx$, `./cmp/${target.name}/ReadmeExplanation_${target.name}`, { ignore: true })
|
|
155
|
+
|
|
156
|
+
if (ReadmeExplanation_sdk) {
|
|
157
|
+
ReadmeExplanation_sdk['ReadmeExplanation']({ target })
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
// Entity state
|
|
162
|
+
Content(`### Entity state
|
|
163
|
+
|
|
164
|
+
`)
|
|
165
|
+
|
|
166
|
+
if (target.name === 'py') {
|
|
167
|
+
Content(`Entity instances are stateful. After a successful \`load\`, the entity
|
|
168
|
+
stores the returned data and match criteria internally.
|
|
169
|
+
|
|
170
|
+
\`\`\`python
|
|
171
|
+
moon = client.Moon()
|
|
172
|
+
moon.load({"planet_id": "earth", "id": "luna"})
|
|
173
|
+
|
|
174
|
+
# moon.data_get() now returns the loaded moon data
|
|
175
|
+
# moon.match_get() returns the last match criteria
|
|
176
|
+
\`\`\`
|
|
177
|
+
|
|
178
|
+
Call \`make()\` to create a fresh instance with the same configuration
|
|
179
|
+
but no stored state.
|
|
180
|
+
|
|
181
|
+
`)
|
|
182
|
+
}
|
|
183
|
+
else if (target.name === 'php') {
|
|
184
|
+
Content(`Entity instances are stateful. After a successful \`load\`, the entity
|
|
185
|
+
stores the returned data and match criteria internally.
|
|
186
|
+
|
|
187
|
+
\`\`\`php
|
|
188
|
+
$moon = $client->Moon();
|
|
189
|
+
[$result, $err] = $moon->load(["planet_id" => "earth", "id" => "luna"]);
|
|
190
|
+
|
|
191
|
+
// $moon->dataGet() now returns the loaded moon data
|
|
192
|
+
// $moon->matchGet() returns the last match criteria
|
|
193
|
+
\`\`\`
|
|
194
|
+
|
|
195
|
+
Call \`make()\` to create a fresh instance with the same configuration
|
|
196
|
+
but no stored state.
|
|
197
|
+
|
|
198
|
+
`)
|
|
199
|
+
}
|
|
200
|
+
else if (target.name === 'rb') {
|
|
201
|
+
Content(`Entity instances are stateful. After a successful \`load\`, the entity
|
|
202
|
+
stores the returned data and match criteria internally.
|
|
203
|
+
|
|
204
|
+
\`\`\`ruby
|
|
205
|
+
moon = client.Moon
|
|
206
|
+
moon.load({ "planet_id" => "earth", "id" => "luna" })
|
|
207
|
+
|
|
208
|
+
# moon.data_get now returns the loaded moon data
|
|
209
|
+
# moon.match_get returns the last match criteria
|
|
210
|
+
\`\`\`
|
|
211
|
+
|
|
212
|
+
Call \`make\` to create a fresh instance with the same configuration
|
|
213
|
+
but no stored state.
|
|
214
|
+
|
|
215
|
+
`)
|
|
216
|
+
}
|
|
217
|
+
else if (target.name === 'lua') {
|
|
218
|
+
Content(`Entity instances are stateful. After a successful \`load\`, the entity
|
|
219
|
+
stores the returned data and match criteria internally.
|
|
220
|
+
|
|
221
|
+
\`\`\`lua
|
|
222
|
+
local moon = client:Moon(nil)
|
|
223
|
+
moon:load({ planet_id = "earth", id = "luna" }, nil)
|
|
224
|
+
|
|
225
|
+
-- moon:data_get() now returns the loaded moon data
|
|
226
|
+
-- moon:match_get() returns the last match criteria
|
|
227
|
+
\`\`\`
|
|
228
|
+
|
|
229
|
+
Call \`make()\` to create a fresh instance with the same configuration
|
|
230
|
+
but no stored state.
|
|
231
|
+
|
|
232
|
+
`)
|
|
233
|
+
}
|
|
234
|
+
else if (target.name === 'go') {
|
|
235
|
+
Content(`Entity instances are stateful. After a successful \`Load\`, the entity
|
|
236
|
+
stores the returned data and match criteria internally.
|
|
237
|
+
|
|
238
|
+
\`\`\`go
|
|
239
|
+
moon := client.Moon(nil)
|
|
240
|
+
moon.Load(map[string]any{"planet_id": "earth", "id": "luna"}, nil)
|
|
241
|
+
|
|
242
|
+
// moon.Data() now returns the loaded moon data
|
|
243
|
+
// moon.Match() returns the last match criteria
|
|
244
|
+
\`\`\`
|
|
245
|
+
|
|
246
|
+
Call \`Make()\` to create a fresh instance with the same configuration
|
|
247
|
+
but no stored state.
|
|
248
|
+
|
|
249
|
+
`)
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
Content(`Entity instances are stateful. After a successful \`load\`, the entity
|
|
253
|
+
stores the returned data and match criteria internally. Subsequent
|
|
254
|
+
calls on the same instance can rely on this state.
|
|
255
|
+
|
|
256
|
+
\`\`\`ts
|
|
257
|
+
const moon = client.Moon()
|
|
258
|
+
await moon.load({ planet_id: 'earth', id: 'luna' })
|
|
259
|
+
|
|
260
|
+
// moon.data() now returns the loaded moon data
|
|
261
|
+
// moon.match() returns { planet_id: 'earth', id: 'luna' }
|
|
262
|
+
\`\`\`
|
|
263
|
+
|
|
264
|
+
Call \`make()\` to create a fresh instance with the same configuration
|
|
265
|
+
but no stored state.
|
|
266
|
+
|
|
267
|
+
`)
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
// Direct vs entity access
|
|
272
|
+
Content(`### Direct vs entity access
|
|
273
|
+
|
|
274
|
+
The entity interface handles URL construction, parameter placement,
|
|
275
|
+
and response parsing automatically. Use it for standard CRUD operations.
|
|
276
|
+
|
|
277
|
+
`)
|
|
278
|
+
|
|
279
|
+
if (target.name === 'py') {
|
|
280
|
+
Content(`\`direct()\` gives full control over the HTTP request. Use it for
|
|
281
|
+
non-standard endpoints, bulk operations, or any path not modelled as
|
|
282
|
+
an entity. \`prepare()\` builds the request without sending it \u2014 useful
|
|
283
|
+
for debugging or custom transport.
|
|
284
|
+
|
|
285
|
+
`)
|
|
286
|
+
}
|
|
287
|
+
else if (target.name === 'php') {
|
|
288
|
+
Content(`\`direct()\` gives full control over the HTTP request. Use it for
|
|
289
|
+
non-standard endpoints, bulk operations, or any path not modelled as
|
|
290
|
+
an entity. \`prepare()\` builds the request without sending it \u2014 useful
|
|
291
|
+
for debugging or custom transport.
|
|
292
|
+
|
|
293
|
+
`)
|
|
294
|
+
}
|
|
295
|
+
else if (target.name === 'rb') {
|
|
296
|
+
Content(`\`direct\` gives full control over the HTTP request. Use it for
|
|
297
|
+
non-standard endpoints, bulk operations, or any path not modelled as
|
|
298
|
+
an entity. \`prepare\` builds the request without sending it \u2014 useful
|
|
299
|
+
for debugging or custom transport.
|
|
300
|
+
|
|
301
|
+
`)
|
|
302
|
+
}
|
|
303
|
+
else if (target.name === 'lua') {
|
|
304
|
+
Content(`\`direct()\` gives full control over the HTTP request. Use it for
|
|
305
|
+
non-standard endpoints, bulk operations, or any path not modelled as
|
|
306
|
+
an entity. \`prepare()\` builds the request without sending it \u2014 useful
|
|
307
|
+
for debugging or custom transport.
|
|
308
|
+
|
|
309
|
+
`)
|
|
310
|
+
}
|
|
311
|
+
else if (target.name === 'go') {
|
|
312
|
+
Content(`\`Direct()\` gives full control over the HTTP request. Use it for
|
|
313
|
+
non-standard endpoints, bulk operations, or any path not modelled as
|
|
314
|
+
an entity. \`Prepare()\` builds the request without sending it \u2014 useful
|
|
315
|
+
for debugging or custom transport.
|
|
316
|
+
|
|
317
|
+
`)
|
|
318
|
+
}
|
|
319
|
+
else {
|
|
320
|
+
Content(`The \`direct\` method gives full control over the HTTP request. Use it
|
|
321
|
+
for non-standard endpoints, bulk operations, or any path not modelled
|
|
322
|
+
as an entity. The \`prepare\` method is useful for debugging \u2014 it
|
|
323
|
+
shows exactly what \`direct\` would send.
|
|
324
|
+
|
|
325
|
+
`)
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
})
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
export {
|
|
332
|
+
ReadmeExplanation
|
|
333
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
import { cmp, Content } from 'jostraca'
|
|
3
|
+
|
|
4
|
+
import { requirePath } from '../utility'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
|
|
8
|
+
const { target, ctx$ } = props
|
|
9
|
+
|
|
10
|
+
Content(`
|
|
11
|
+
## How-to guides
|
|
12
|
+
|
|
13
|
+
`)
|
|
14
|
+
|
|
15
|
+
const ReadmeHowto_sdk =
|
|
16
|
+
requirePath(ctx$, `./cmp/${target.name}/ReadmeHowto_${target.name}`, { ignore: true })
|
|
17
|
+
|
|
18
|
+
if (ReadmeHowto_sdk) {
|
|
19
|
+
ReadmeHowto_sdk['ReadmeHowto']({ target })
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
ReadmeHowto
|
|
28
|
+
}
|
package/src/cmp/ReadmeIntro.ts
CHANGED
|
@@ -7,38 +7,24 @@ import {
|
|
|
7
7
|
} from '../types'
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
const TARGET_INTRO: Record<string, string> = {
|
|
11
|
+
ts: 'Provides a type-safe,\nentity-oriented interface with full async/await support.',
|
|
12
|
+
go: 'Provides an entity-oriented interface\nusing standard Go conventions \u2014 no generics required, data flows as\n`map[string]any`.',
|
|
13
|
+
js: 'Provides an entity-oriented\ninterface with full async/await support.',
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
10
17
|
const ReadmeIntro = cmp(function ReadmeIntro(props: any) {
|
|
11
18
|
const { target } = props
|
|
12
19
|
const { model } = props.ctx$
|
|
13
20
|
|
|
14
21
|
const desc = model.main.def.desc || ''
|
|
15
|
-
const entity = getModelPath(model, `main.${KIT}.entity`)
|
|
16
|
-
|
|
17
|
-
const entityNames = Object.values(entity)
|
|
18
|
-
.filter((e: any) => e.publish)
|
|
19
|
-
.map((e: any) => `\`${e.Name}\``)
|
|
20
|
-
|
|
21
|
-
Content(`
|
|
22
|
-
## Introduction
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
`)
|
|
26
|
-
|
|
27
|
-
if (entityNames.length > 0) {
|
|
28
|
-
Content(`
|
|
29
|
-
This SDK provides an entity-oriented interface for the ${model.Name} API.
|
|
30
|
-
The following entities are available: ${entityNames.join(', ')}.
|
|
31
|
-
|
|
32
|
-
`)
|
|
33
|
-
}
|
|
23
|
+
const targetIntro = TARGET_INTRO[target.name] || 'Provides an entity-oriented interface.'
|
|
34
24
|
|
|
35
|
-
Content(
|
|
36
|
-
### Features
|
|
25
|
+
Content(`# ${model.Name} ${target.title} SDK
|
|
37
26
|
|
|
38
|
-
|
|
39
|
-
- Type safe: full TypeScript definitions included.
|
|
40
|
-
- Direct HTTP access: call any API endpoint using \`client.direct()\`.
|
|
41
|
-
- Testable: built-in test mode with mock support.
|
|
27
|
+
The ${target.title} SDK for the ${model.Name} API. ${targetIntro}
|
|
42
28
|
|
|
43
29
|
`)
|
|
44
30
|
|