@voxgig/sdkgen 4.34.1 → 4.34.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/voxgig-sdkgen +1 -1
- package/dist/cmp/ReadmeErrors.js +3 -3
- package/dist/cmp/ReadmeErrors.js.map +1 -1
- package/dist/cmp/ReadmeExplanation.js +3 -3
- package/dist/cmp/ReadmeExplanation.js.map +1 -1
- package/dist/cmp/ReadmeQuick.js +3 -1
- package/dist/cmp/ReadmeQuick.js.map +1 -1
- package/dist/cmp/ReadmeTop.js +9 -8
- package/dist/cmp/ReadmeTop.js.map +1 -1
- package/dist/helpers/definitionPlan.js +8 -4
- package/dist/helpers/definitionPlan.js.map +1 -1
- package/dist/helpers/naming.d.ts +2 -1
- package/dist/helpers/naming.js +11 -4
- package/dist/helpers/naming.js.map +1 -1
- package/dist/helpers/opExample.d.ts +16 -2
- package/dist/helpers/opExample.js +80 -21
- package/dist/helpers/opExample.js.map +1 -1
- package/dist/helpers/opShape.d.ts +3 -1
- package/dist/helpers/opShape.js +21 -8
- package/dist/helpers/opShape.js.map +1 -1
- package/dist/sdkgen.d.ts +4 -4
- package/dist/sdkgen.js +12 -4
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utility.d.ts +2 -1
- package/dist/utility.js +29 -3
- package/dist/utility.js.map +1 -1
- package/package.json +2 -2
- package/project/.sdk/src/cmp/c/ReadmeEntity_c.ts +3 -2
- package/project/.sdk/src/cmp/c/ReadmeHowto_c.ts +7 -3
- package/project/.sdk/src/cmp/c/ReadmeQuick_c.ts +3 -2
- package/project/.sdk/src/cmp/c/ReadmeRef_c.ts +5 -4
- package/project/.sdk/src/cmp/c/ReadmeTopQuick_c.ts +3 -2
- package/project/.sdk/src/cmp/c/ReadmeTopTest_c.ts +8 -7
- package/project/.sdk/src/cmp/c/utility_c.ts +21 -2
- package/project/.sdk/src/cmp/clojure/ReadmeEntity_clojure.ts +4 -1
- package/project/.sdk/src/cmp/clojure/ReadmeHowto_clojure.ts +17 -6
- package/project/.sdk/src/cmp/clojure/ReadmeModel_clojure.ts +6 -6
- package/project/.sdk/src/cmp/clojure/ReadmeQuick_clojure.ts +13 -8
- package/project/.sdk/src/cmp/clojure/ReadmeRef_clojure.ts +21 -18
- package/project/.sdk/src/cmp/clojure/ReadmeTopQuick_clojure.ts +6 -3
- package/project/.sdk/src/cmp/clojure/ReadmeTopTest_clojure.ts +16 -9
- package/project/.sdk/src/cmp/clojure/TestClean_clojure.ts +4 -4
- package/project/.sdk/src/cmp/clojure/fragment/Entity.fragment.clj +2 -1
- package/project/.sdk/src/cmp/clojure/utility_clojure.ts +14 -0
- package/project/.sdk/src/cmp/cpp/ReadmeEntity_cpp.ts +3 -2
- package/project/.sdk/src/cmp/cpp/ReadmeHowto_cpp.ts +7 -3
- package/project/.sdk/src/cmp/cpp/ReadmeQuick_cpp.ts +3 -2
- package/project/.sdk/src/cmp/cpp/ReadmeRef_cpp.ts +6 -5
- package/project/.sdk/src/cmp/cpp/ReadmeTopQuick_cpp.ts +3 -2
- package/project/.sdk/src/cmp/cpp/ReadmeTopTest_cpp.ts +8 -7
- package/project/.sdk/src/cmp/cpp/utility_cpp.ts +13 -0
- package/project/.sdk/src/cmp/csharp/ReadmeEntity_csharp.ts +3 -2
- package/project/.sdk/src/cmp/csharp/ReadmeHowto_csharp.ts +20 -8
- package/project/.sdk/src/cmp/csharp/ReadmeQuick_csharp.ts +13 -8
- package/project/.sdk/src/cmp/csharp/ReadmeRef_csharp.ts +10 -5
- package/project/.sdk/src/cmp/csharp/ReadmeTopQuick_csharp.ts +14 -7
- package/project/.sdk/src/cmp/csharp/ReadmeTopTest_csharp.ts +18 -10
- package/project/.sdk/src/cmp/csharp/utility_csharp.ts +13 -0
- package/project/.sdk/src/cmp/elixir/ReadmeEntity_elixir.ts +4 -4
- package/project/.sdk/src/cmp/elixir/ReadmeExplanation_elixir.ts +2 -1
- package/project/.sdk/src/cmp/elixir/ReadmeHowto_elixir.ts +13 -6
- package/project/.sdk/src/cmp/elixir/ReadmeModel_elixir.ts +5 -5
- package/project/.sdk/src/cmp/elixir/ReadmeQuick_elixir.ts +13 -10
- package/project/.sdk/src/cmp/elixir/ReadmeRef_elixir.ts +11 -11
- package/project/.sdk/src/cmp/elixir/ReadmeTopQuick_elixir.ts +8 -6
- package/project/.sdk/src/cmp/elixir/ReadmeTopTest_elixir.ts +14 -10
- package/project/.sdk/src/cmp/elixir/fragment/EntityCreateOp.fragment.ex +4 -3
- package/project/.sdk/src/cmp/elixir/fragment/EntityListOp.fragment.ex +4 -3
- package/project/.sdk/src/cmp/elixir/fragment/EntityLoadOp.fragment.ex +4 -3
- package/project/.sdk/src/cmp/elixir/fragment/EntityPatchOp.fragment.ex +4 -3
- package/project/.sdk/src/cmp/elixir/fragment/EntityRemoveOp.fragment.ex +4 -3
- package/project/.sdk/src/cmp/elixir/fragment/EntityUpdateOp.fragment.ex +4 -3
- package/project/.sdk/src/cmp/elixir/utility_elixir.ts +12 -0
- package/project/.sdk/src/cmp/go/ReadmeEntity_go.ts +8 -5
- package/project/.sdk/src/cmp/go/ReadmeExplanation_go.ts +3 -1
- package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +20 -8
- package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +16 -13
- package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +14 -13
- package/project/.sdk/src/cmp/go/ReadmeRef_go.ts +14 -13
- package/project/.sdk/src/cmp/go/ReadmeTopQuick_go.ts +10 -8
- package/project/.sdk/src/cmp/go/ReadmeTopTest_go.ts +6 -2
- package/project/.sdk/src/cmp/go/utility_go.ts +1 -1
- package/project/.sdk/src/cmp/java/ReadmeEntity_java.ts +8 -19
- package/project/.sdk/src/cmp/java/ReadmeHowto_java.ts +19 -22
- package/project/.sdk/src/cmp/java/ReadmeModel_java.ts +10 -9
- package/project/.sdk/src/cmp/java/ReadmeQuick_java.ts +24 -28
- package/project/.sdk/src/cmp/java/ReadmeRef_java.ts +27 -35
- package/project/.sdk/src/cmp/java/ReadmeTopQuick_java.ts +22 -25
- package/project/.sdk/src/cmp/java/ReadmeTopTest_java.ts +18 -24
- package/project/.sdk/src/cmp/java/utility_java.ts +25 -0
- package/project/.sdk/src/cmp/js/EntityOperation_js.ts +3 -1
- package/project/.sdk/src/cmp/js/ReadmeEntity_js.ts +2 -8
- package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +11 -9
- package/project/.sdk/src/cmp/js/ReadmeModel_js.ts +9 -9
- package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +7 -13
- package/project/.sdk/src/cmp/js/ReadmeRef_js.ts +14 -15
- package/project/.sdk/src/cmp/js/ReadmeTopQuick_js.ts +16 -11
- package/project/.sdk/src/cmp/js/ReadmeTopTest_js.ts +11 -7
- package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +1 -1
- package/project/.sdk/src/cmp/js/fragment/EntityListOp.fragment.js +1 -1
- package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +1 -1
- package/project/.sdk/src/cmp/js/fragment/EntityPatchOp.fragment.js +1 -1
- package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +1 -1
- package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +1 -1
- package/project/.sdk/src/cmp/js/utility_js.ts +2 -1
- package/project/.sdk/src/cmp/kotlin/ReadmeEntity_kotlin.ts +3 -2
- package/project/.sdk/src/cmp/kotlin/ReadmeHowto_kotlin.ts +19 -9
- package/project/.sdk/src/cmp/kotlin/ReadmeModel_kotlin.ts +10 -9
- package/project/.sdk/src/cmp/kotlin/ReadmeQuick_kotlin.ts +14 -9
- package/project/.sdk/src/cmp/kotlin/ReadmeRef_kotlin.ts +18 -15
- package/project/.sdk/src/cmp/kotlin/ReadmeTopQuick_kotlin.ts +14 -8
- package/project/.sdk/src/cmp/kotlin/ReadmeTopTest_kotlin.ts +17 -10
- package/project/.sdk/src/cmp/kotlin/utility_kotlin.ts +21 -1
- package/project/.sdk/src/cmp/lua/ReadmeEntity_lua.ts +3 -2
- package/project/.sdk/src/cmp/lua/ReadmeExamplesTest_lua.ts +7 -4
- package/project/.sdk/src/cmp/lua/ReadmeHowto_lua.ts +9 -7
- package/project/.sdk/src/cmp/lua/ReadmeModel_lua.ts +13 -13
- package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +20 -9
- package/project/.sdk/src/cmp/lua/ReadmeRef_lua.ts +9 -8
- package/project/.sdk/src/cmp/lua/ReadmeTopQuick_lua.ts +15 -7
- package/project/.sdk/src/cmp/lua/ReadmeTopTest_lua.ts +6 -5
- package/project/.sdk/src/cmp/lua/fragment/Entity.fragment.lua +1 -0
- package/project/.sdk/src/cmp/lua/fragment/EntityCreateOp.fragment.lua +1 -1
- package/project/.sdk/src/cmp/lua/fragment/EntityListOp.fragment.lua +1 -1
- package/project/.sdk/src/cmp/lua/fragment/EntityLoadOp.fragment.lua +1 -1
- package/project/.sdk/src/cmp/lua/fragment/EntityPatchOp.fragment.lua +1 -1
- package/project/.sdk/src/cmp/lua/fragment/EntityRemoveOp.fragment.lua +1 -1
- package/project/.sdk/src/cmp/lua/fragment/EntityUpdateOp.fragment.lua +1 -1
- package/project/.sdk/src/cmp/ocaml/ReadmeEntity_ocaml.ts +3 -2
- package/project/.sdk/src/cmp/ocaml/ReadmeHowto_ocaml.ts +3 -2
- package/project/.sdk/src/cmp/ocaml/ReadmeModel_ocaml.ts +1 -0
- package/project/.sdk/src/cmp/ocaml/ReadmeQuick_ocaml.ts +5 -3
- package/project/.sdk/src/cmp/ocaml/ReadmeRef_ocaml.ts +10 -8
- package/project/.sdk/src/cmp/ocaml/ReadmeTopQuick_ocaml.ts +4 -2
- package/project/.sdk/src/cmp/ocaml/ReadmeTopTest_ocaml.ts +3 -2
- package/project/.sdk/src/cmp/ocaml/utility_ocaml.ts +13 -1
- package/project/.sdk/src/cmp/perl/ReadmeEntity_perl.ts +4 -1
- package/project/.sdk/src/cmp/perl/ReadmeHowto_perl.ts +10 -5
- package/project/.sdk/src/cmp/perl/ReadmeModel_perl.ts +6 -6
- package/project/.sdk/src/cmp/perl/ReadmeQuick_perl.ts +8 -5
- package/project/.sdk/src/cmp/perl/ReadmeRef_perl.ts +21 -18
- package/project/.sdk/src/cmp/perl/ReadmeTopQuick_perl.ts +6 -3
- package/project/.sdk/src/cmp/perl/ReadmeTopTest_perl.ts +11 -8
- package/project/.sdk/src/cmp/perl/fragment/Entity.fragment.pm +1 -1
- package/project/.sdk/src/cmp/perl/fragment/EntityCreateOp.fragment.pm +2 -2
- package/project/.sdk/src/cmp/perl/fragment/EntityLoadOp.fragment.pm +2 -2
- package/project/.sdk/src/cmp/perl/fragment/EntityPatchOp.fragment.pm +2 -2
- package/project/.sdk/src/cmp/perl/fragment/EntityRemoveOp.fragment.pm +1 -1
- package/project/.sdk/src/cmp/perl/fragment/EntityUpdateOp.fragment.pm +2 -2
- package/project/.sdk/src/cmp/perl/utility_perl.ts +11 -1
- package/project/.sdk/src/cmp/php/EntityOperation_php.ts +3 -1
- package/project/.sdk/src/cmp/php/ReadmeEntity_php.ts +4 -3
- package/project/.sdk/src/cmp/php/ReadmeHowto_php.ts +12 -6
- package/project/.sdk/src/cmp/php/ReadmeModel_php.ts +9 -9
- package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +3 -2
- package/project/.sdk/src/cmp/php/ReadmeRef_php.ts +15 -14
- package/project/.sdk/src/cmp/php/ReadmeTopQuick_php.ts +5 -4
- package/project/.sdk/src/cmp/php/ReadmeTopTest_php.ts +13 -7
- package/project/.sdk/src/cmp/php/fragment/EntityCreateOp.fragment.php +2 -2
- package/project/.sdk/src/cmp/php/fragment/EntityListOp.fragment.php +2 -2
- package/project/.sdk/src/cmp/php/fragment/EntityLoadOp.fragment.php +2 -2
- package/project/.sdk/src/cmp/php/fragment/EntityPatchOp.fragment.php +2 -2
- package/project/.sdk/src/cmp/php/fragment/EntityRemoveOp.fragment.php +2 -2
- package/project/.sdk/src/cmp/php/fragment/EntityUpdateOp.fragment.php +2 -2
- package/project/.sdk/src/cmp/py/EntityOperation_py.ts +3 -1
- package/project/.sdk/src/cmp/py/ReadmeEntity_py.ts +3 -8
- package/project/.sdk/src/cmp/py/ReadmeHowto_py.ts +9 -9
- package/project/.sdk/src/cmp/py/ReadmeModel_py.ts +9 -9
- package/project/.sdk/src/cmp/py/ReadmeQuick_py.ts +9 -14
- package/project/.sdk/src/cmp/py/ReadmeRef_py.ts +23 -30
- package/project/.sdk/src/cmp/py/ReadmeTopQuick_py.ts +7 -12
- package/project/.sdk/src/cmp/py/ReadmeTopTest_py.ts +8 -7
- package/project/.sdk/src/cmp/py/fragment/EntityCreateOp.fragment.py +1 -1
- package/project/.sdk/src/cmp/py/fragment/EntityListOp.fragment.py +1 -1
- package/project/.sdk/src/cmp/py/fragment/EntityLoadOp.fragment.py +1 -1
- package/project/.sdk/src/cmp/py/fragment/EntityPatchOp.fragment.py +1 -1
- package/project/.sdk/src/cmp/py/fragment/EntityRemoveOp.fragment.py +1 -1
- package/project/.sdk/src/cmp/py/fragment/EntityUpdateOp.fragment.py +1 -1
- package/project/.sdk/src/cmp/rb/EntityOperation_rb.ts +3 -1
- package/project/.sdk/src/cmp/rb/EntityTypes_rb.ts +2 -1
- package/project/.sdk/src/cmp/rb/ReadmeEntity_rb.ts +4 -1
- package/project/.sdk/src/cmp/rb/ReadmeExamplesTest_rb.ts +3 -2
- package/project/.sdk/src/cmp/rb/ReadmeHowto_rb.ts +20 -10
- package/project/.sdk/src/cmp/rb/ReadmeModel_rb.ts +10 -9
- package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +6 -3
- package/project/.sdk/src/cmp/rb/ReadmeRef_rb.ts +14 -11
- package/project/.sdk/src/cmp/rb/ReadmeTopQuick_rb.ts +6 -3
- package/project/.sdk/src/cmp/rb/ReadmeTopTest_rb.ts +14 -10
- package/project/.sdk/src/cmp/rb/fragment/EntityCreateOp.fragment.rb +2 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityListOp.fragment.rb +1 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityLoadOp.fragment.rb +2 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityPatchOp.fragment.rb +2 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityRemoveOp.fragment.rb +2 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityUpdateOp.fragment.rb +2 -1
- package/project/.sdk/src/cmp/rb/utility_rb.ts +10 -0
- package/project/.sdk/src/cmp/rust/ReadmeEntity_rust.ts +3 -2
- package/project/.sdk/src/cmp/rust/ReadmeHowto_rust.ts +6 -2
- package/project/.sdk/src/cmp/rust/ReadmeQuick_rust.ts +3 -2
- package/project/.sdk/src/cmp/rust/ReadmeRef_rust.ts +5 -4
- package/project/.sdk/src/cmp/rust/ReadmeTopQuick_rust.ts +3 -2
- package/project/.sdk/src/cmp/rust/ReadmeTopTest_rust.ts +7 -6
- package/project/.sdk/src/cmp/rust/utility_rust.ts +13 -1
- package/project/.sdk/src/cmp/scala/EntityTypes_scala.ts +5 -2
- package/project/.sdk/src/cmp/scala/ReadmeEntity_scala.ts +8 -19
- package/project/.sdk/src/cmp/scala/ReadmeHowto_scala.ts +17 -22
- package/project/.sdk/src/cmp/scala/ReadmeModel_scala.ts +10 -9
- package/project/.sdk/src/cmp/scala/ReadmeQuick_scala.ts +18 -28
- package/project/.sdk/src/cmp/scala/ReadmeRef_scala.ts +25 -35
- package/project/.sdk/src/cmp/scala/ReadmeTopQuick_scala.ts +14 -25
- package/project/.sdk/src/cmp/scala/ReadmeTopTest_scala.ts +16 -24
- package/project/.sdk/src/cmp/scala/utility_scala.ts +25 -0
- package/project/.sdk/src/cmp/swift/EntityTypes_swift.ts +1 -1
- package/project/.sdk/src/cmp/swift/ReadmeEntity_swift.ts +3 -2
- package/project/.sdk/src/cmp/swift/ReadmeHowto_swift.ts +22 -8
- package/project/.sdk/src/cmp/swift/ReadmeModel_swift.ts +10 -9
- package/project/.sdk/src/cmp/swift/ReadmeQuick_swift.ts +16 -8
- package/project/.sdk/src/cmp/swift/ReadmeRef_swift.ts +20 -15
- package/project/.sdk/src/cmp/swift/ReadmeTopQuick_swift.ts +12 -7
- package/project/.sdk/src/cmp/swift/ReadmeTopTest_swift.ts +21 -10
- package/project/.sdk/src/cmp/swift/utility_swift.ts +14 -1
- package/project/.sdk/src/cmp/ts/ReadmeEntity_ts.ts +2 -8
- package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +11 -9
- package/project/.sdk/src/cmp/ts/ReadmeModel_ts.ts +9 -9
- package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +7 -13
- package/project/.sdk/src/cmp/ts/ReadmeRef_ts.ts +14 -23
- package/project/.sdk/src/cmp/ts/ReadmeTopQuick_ts.ts +8 -14
- package/project/.sdk/src/cmp/ts/ReadmeTopTest_ts.ts +29 -14
- package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +1 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +1 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +1 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityPatchOp.fragment.ts +1 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +1 -1
- package/project/.sdk/src/cmp/ts/utility_ts.ts +2 -1
- package/project/.sdk/src/cmp/zig/ReadmeEntity_zig.ts +3 -2
- package/project/.sdk/src/cmp/zig/ReadmeHowto_zig.ts +6 -2
- package/project/.sdk/src/cmp/zig/ReadmeQuick_zig.ts +4 -3
- package/project/.sdk/src/cmp/zig/ReadmeRef_zig.ts +5 -4
- package/project/.sdk/src/cmp/zig/ReadmeTopQuick_zig.ts +3 -2
- package/project/.sdk/src/cmp/zig/ReadmeTopTest_zig.ts +7 -6
- package/project/.sdk/src/cmp/zig/utility_zig.ts +13 -0
- package/project/.sdk/tm/c/utility/transform_request.c +1 -1
- package/project/.sdk/tm/clojure/src/sdk/core.clj +32 -26
- package/project/.sdk/tm/clojure/test/sdk/test/concurrency.clj +136 -0
- package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +3 -1
- package/project/.sdk/tm/cpp/core/types.hpp +36 -6
- package/project/.sdk/tm/cpp/test/concurrency_test.cpp +348 -0
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +42 -25
- package/project/.sdk/tm/csharp/core/Context.cs +8 -5
- package/project/.sdk/tm/csharp/test/ConcurrencyTest.cs +238 -0
- package/project/.sdk/tm/csharp/utility/Clean.cs +12 -10
- package/project/.sdk/tm/csharp/utility/TransformRequest.cs +1 -1
- package/project/.sdk/tm/elixir/lib/projectname/context.ex +3 -0
- package/project/.sdk/tm/elixir/lib/projectname/entity_base.ex +2 -1
- package/project/.sdk/tm/elixir/lib/projectname/utility.ex +31 -10
- package/project/.sdk/tm/elixir/test/concurrency_test.exs +176 -0
- package/project/.sdk/tm/go/core/context.go +5 -1
- package/project/.sdk/tm/go/test/concurrency_test.go +214 -0
- package/project/.sdk/tm/go/utility/transform_request.go +1 -1
- package/project/.sdk/tm/java/core/Context.java +6 -3
- package/project/.sdk/tm/java/test/ConcurrencyTest.java +221 -0
- package/project/.sdk/tm/java/utility/Clean.java +22 -17
- package/project/.sdk/tm/java/utility/TransformRequest.java +1 -1
- package/project/.sdk/tm/js/src/utility/TransformRequestUtility.js +1 -1
- package/project/.sdk/tm/kotlin/core/Context.kt +5 -3
- package/project/.sdk/tm/kotlin/test/ConcurrencyTest.kt +193 -0
- package/project/.sdk/tm/kotlin/utility/ResultTransform.kt +1 -1
- package/project/.sdk/tm/lua/utility/transform_request.lua +1 -1
- package/project/.sdk/tm/ocaml/Makefile +21 -8
- package/project/.sdk/tm/ocaml/sdk_runtime.ml +27 -12
- package/project/.sdk/tm/ocaml/sdk_types.ml +6 -2
- package/project/.sdk/tm/ocaml/test/concurrency_test.ml +148 -0
- package/project/.sdk/tm/perl/utility/transform_request.pm +1 -1
- package/project/.sdk/tm/php/feature/TestFeature.php +9 -9
- package/project/.sdk/tm/php/utility/TransformRequest.php +1 -1
- package/project/.sdk/tm/py/pkg/core/context.py +2 -2
- package/project/.sdk/tm/py/pkg/utility/clean.py +12 -8
- package/project/.sdk/tm/py/pkg/utility/transform_request.py +1 -1
- package/project/.sdk/tm/py/test/test_concurrency.py +177 -0
- package/project/.sdk/tm/rb/core/context.rb +8 -3
- package/project/.sdk/tm/rb/test/concurrency_test.rb +160 -0
- package/project/.sdk/tm/rb/utility/clean.rb +8 -7
- package/project/.sdk/tm/rb/utility/transform_request.rb +1 -1
- package/project/.sdk/tm/rust/utility/transform_request.rs +1 -1
- package/project/.sdk/tm/scala/Makefile +2 -0
- package/project/.sdk/tm/scala/core/Context.scala +6 -4
- package/project/.sdk/tm/scala/sdktest/ConcurrencyTest.scala +186 -0
- package/project/.sdk/tm/scala/utility/Transform.scala +1 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Context.swift +2 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/ResultUtil.swift +35 -12
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/ConcurrencyTest.swift +214 -0
- package/project/.sdk/tm/ts/src/utility/TransformRequestUtility.ts +1 -1
- package/project/.sdk/tm/zig/core/utility.zig +1 -1
- package/project/.sdk/tm/zig/feature/test.zig +10 -8
- package/project/sdkgen-package.json +1 -1
- package/src/cmp/ReadmeErrors.ts +5 -5
- package/src/cmp/ReadmeExplanation.ts +4 -5
- package/src/cmp/ReadmeQuick.ts +3 -1
- package/src/cmp/ReadmeTop.ts +10 -12
- package/src/helpers/definitionPlan.ts +8 -4
- package/src/helpers/naming.ts +12 -4
- package/src/helpers/opExample.ts +97 -25
- package/src/helpers/opShape.ts +25 -9
- package/src/sdkgen.ts +14 -3
- package/src/utility.ts +31 -4
package/src/helpers/opExample.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
import { each } from 'jostraca'
|
|
3
|
-
import {
|
|
4
|
-
import { opRequestShape, opParams,
|
|
3
|
+
import { canonScalarKey } from './canonType'
|
|
4
|
+
import { opRequestShape, opParams, selectablePoints, pointRequires } from './opShape'
|
|
5
5
|
|
|
6
|
-
import { phpEntityAccessor } from './naming'
|
|
6
|
+
import { phpEntityAccessor, jsKey, luaKey } from './naming'
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
type ExampleLang = 'ts' | 'js' | 'py' | 'php' | 'rb' | 'lua' | 'go'
|
|
@@ -11,23 +11,35 @@ type ExampleLang = 'ts' | 'js' | 'py' | 'php' | 'rb' | 'lua' | 'go'
|
|
|
11
11
|
// The languages a literal is written in: the call languages, and JSON.
|
|
12
12
|
type LiteralLang = ExampleLang | 'json'
|
|
13
13
|
|
|
14
|
+
// The call languages, in the order a reader is likeliest to want one.
|
|
15
|
+
const EXAMPLE_LANGS: ExampleLang[] = ['ts', 'js', 'py', 'go', 'php', 'rb', 'lua']
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
// The language of a section shared by every target: its own, else TypeScript.
|
|
19
|
+
function helperLang(target: string): ExampleLang {
|
|
20
|
+
return EXAMPLE_LANGS.includes(target as ExampleLang) ? target as ExampleLang : 'ts'
|
|
21
|
+
}
|
|
22
|
+
|
|
14
23
|
|
|
15
24
|
function cap(s: string): string {
|
|
16
25
|
return s.charAt(0).toUpperCase() + s.slice(1)
|
|
17
26
|
}
|
|
18
27
|
|
|
19
28
|
|
|
29
|
+
const NULL_LIT: Record<LiteralLang, string> = {
|
|
30
|
+
ts: 'null', js: 'null', py: 'None', php: 'null', rb: 'nil', lua: 'nil', go: 'nil', json: 'null',
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
20
34
|
// A type-correct literal for a canonical type sentinel, in the target language.
|
|
21
|
-
function litFor(lang: LiteralLang, type: any): string {
|
|
22
|
-
const k =
|
|
35
|
+
function litFor(lang: LiteralLang, type: any, text: string = 'example'): string {
|
|
36
|
+
const k = canonScalarKey(type)
|
|
37
|
+
if ('NULL' === k) return NULL_LIT[lang]
|
|
23
38
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
24
39
|
if ('BOOLEAN' === k) return 'py' === lang ? 'True' : ('rb' === lang ? 'true' : 'true')
|
|
25
40
|
if ('ARRAY' === k) return ('lua' === lang) ? '{}' : ('go' === lang ? '[]any{}' : '[]')
|
|
26
|
-
// PHP has no `{}` literal
|
|
27
|
-
//
|
|
28
|
-
// writable field (dymo-api-introduction, html-creator). Arrays serve as both
|
|
29
|
-
// list and map, so `[]` is the empty object too. Ruby and Lua likewise want
|
|
30
|
-
// their own empty-hash/table spelling rather than JS's.
|
|
41
|
+
// PHP has no `{}` literal (`["data" => {}]` does not parse) and its arrays
|
|
42
|
+
// serve as maps; Ruby and Lua spell an empty map their own way too.
|
|
31
43
|
if ('OBJECT' === k) {
|
|
32
44
|
if ('go' === lang) return 'map[string]any{}'
|
|
33
45
|
if ('php' === lang) return '[]'
|
|
@@ -36,40 +48,51 @@ function litFor(lang: LiteralLang, type: any): string {
|
|
|
36
48
|
if ('py' === lang) return '{}'
|
|
37
49
|
return '{}'
|
|
38
50
|
}
|
|
39
|
-
return
|
|
51
|
+
return `"${text}"`
|
|
40
52
|
}
|
|
41
53
|
|
|
42
54
|
|
|
43
55
|
function idLiteral(ent: any, op: string, idF: string | null): string {
|
|
44
56
|
if (null == idF) return '"example_id"'
|
|
45
57
|
const item = opRequestShape(ent, op).items.find((it: any) => it.name === idF)
|
|
46
|
-
const k =
|
|
58
|
+
const k = canonScalarKey(item && item.type)
|
|
47
59
|
return ('INTEGER' === k || 'NUMBER' === k) ? '1' : '"example_id"'
|
|
48
60
|
}
|
|
49
61
|
|
|
50
62
|
|
|
51
|
-
const JS_IDENT = /^[A-Za-z_$][A-Za-z0-9_$]*$/
|
|
52
|
-
const LUA_IDENT = /^[A-Za-z_][A-Za-z0-9_]*$/
|
|
53
|
-
|
|
54
63
|
function litPair(lang: LiteralLang, name: string, value: string): string {
|
|
55
64
|
switch (lang) {
|
|
56
|
-
case 'py': return
|
|
57
|
-
case 'php': return `"${name}" => ${value}`
|
|
58
|
-
case 'rb': return
|
|
59
|
-
case 'go': return
|
|
65
|
+
case 'py': return `${JSON.stringify(name)}: ${value}`
|
|
66
|
+
case 'php': return `"${name.replace(/[\\"$]/g, '\\$&')}" => ${value}`
|
|
67
|
+
case 'rb': return `${JSON.stringify(name).replace(/#(?=[{$@])/g, '\\#')} => ${value}`
|
|
68
|
+
case 'go': return `${JSON.stringify(name)}: ${value}`
|
|
60
69
|
case 'json': return `${JSON.stringify(name)}: ${value}`
|
|
61
|
-
case 'lua': return
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
70
|
+
case 'lua': return `${luaKey(name)} = ${value}`
|
|
71
|
+
default: return `${jsKey(name)}: ${value}`
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
// The members an example call must give. Points of one route that each need
|
|
77
|
+
// a selector of their own share none, so the example takes the point that
|
|
78
|
+
// needs fewest when no point is reached by those every point needs.
|
|
79
|
+
function requiredItems(ent: any, op: string): any[] {
|
|
80
|
+
const needed = (e: any) => opRequestShape(e, op).items.filter((it: any) => !it.optional)
|
|
81
|
+
const items = needed(ent)
|
|
82
|
+
const given = items.map((it: any) => it.name)
|
|
83
|
+
const points = selectablePoints(ent?.op?.[op])
|
|
84
|
+
if (points.length < 2 || points.some((pt: any) => pointRequires(pt).every((n) => given.includes(n)))) {
|
|
85
|
+
return items
|
|
65
86
|
}
|
|
87
|
+
const fewest = points.reduce((a: any, b: any) => pointRequires(b).length < pointRequires(a).length ? b : a)
|
|
88
|
+
return needed({ ...ent, op: { ...ent.op, [op]: { ...ent.op[op], points: [fewest] } } })
|
|
66
89
|
}
|
|
67
90
|
|
|
68
91
|
|
|
69
92
|
function matchArg(
|
|
70
93
|
lang: LiteralLang, ent: any, op: string, idF: string | null, idLit: string
|
|
71
94
|
): string {
|
|
72
|
-
const items =
|
|
95
|
+
const items = requiredItems(ent, op)
|
|
73
96
|
if (0 === items.length) return 'go' === lang ? 'nil' : ('json' === lang ? '{}' : '')
|
|
74
97
|
const pairs = items.map((it: any) =>
|
|
75
98
|
litPair(lang, it.name, it.name === idF ? idLit : litFor(lang, it.type)))
|
|
@@ -82,6 +105,45 @@ function matchArg(
|
|
|
82
105
|
}
|
|
83
106
|
|
|
84
107
|
|
|
108
|
+
// Java's Map.of has an overload per pair count up to ten, and Map.ofEntries takes any.
|
|
109
|
+
function javaMap(count: number, pkg = ''): { open: string, pair: (kv: string) => string } {
|
|
110
|
+
const many = 10 < count
|
|
111
|
+
return {
|
|
112
|
+
open: pkg + (many ? 'Map.ofEntries(' : 'Map.of('),
|
|
113
|
+
pair: (kv: string) => many ? pkg + 'Map.entry(' + kv + ')' : kv,
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
function javaMapOf(pairs: string[], pkg = ''): string {
|
|
119
|
+
const map = javaMap(pairs.length, pkg)
|
|
120
|
+
return map.open + pairs.map(map.pair).join(', ') + ')'
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
// A list's required route and query parameters.
|
|
125
|
+
function listMatchArg(lang: LiteralLang, ent: any): string {
|
|
126
|
+
return matchArg(lang, ent, 'list', null, '')
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
// A test-mode list call's pairs and the record seeded for it: the mock gives a
|
|
131
|
+
// seeded record its key as `id`, so `id` and the load key are sent as that key.
|
|
132
|
+
function seededList(lang: LiteralLang, ent: any, idF: string | null, key: string):
|
|
133
|
+
{ call: string[], record: string[] } {
|
|
134
|
+
const items = [...requiredItems(ent, 'list')]
|
|
135
|
+
.sort((a: any, b: any) => (a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
136
|
+
const lit = (it: any): string =>
|
|
137
|
+
litFor(lang, it.type, it.name === idF || 'id' === it.name ? key : 'example')
|
|
138
|
+
const record = new Map<string, string>(null == idF ? [] : [[idF, `"${key}"`]])
|
|
139
|
+
items.forEach((it: any) => record.set(it.name, 'id' === it.name ? `"${key}"` : lit(it)))
|
|
140
|
+
return {
|
|
141
|
+
call: items.map((it: any) => litPair(lang, it.name, lit(it))),
|
|
142
|
+
record: [...record].map(([name, value]) => litPair(lang, name, value)),
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
|
|
85
147
|
// An update or patch addressed only by id and route also changes a field.
|
|
86
148
|
function dataArg(lang: LiteralLang, ent: any, op: string, idF: string | null): string {
|
|
87
149
|
const routed = new Set(opParams(ent?.op?.[op]).map((p: any) => p.n))
|
|
@@ -140,7 +202,9 @@ function primaryOpCall(
|
|
|
140
202
|
else { factory = `client.${eName}()`; sep = '.' }
|
|
141
203
|
|
|
142
204
|
let arg: string
|
|
143
|
-
if (isList
|
|
205
|
+
if (isList) {
|
|
206
|
+
arg = listMatchArg(lang, ent)
|
|
207
|
+
} else if (isMatch) {
|
|
144
208
|
arg = matchArg(lang, ent, op, idF, idLit)
|
|
145
209
|
} else if (isData) {
|
|
146
210
|
arg = dataArg(lang, ent, op, idF)
|
|
@@ -158,11 +222,19 @@ function primaryOpCall(
|
|
|
158
222
|
|
|
159
223
|
|
|
160
224
|
export {
|
|
225
|
+
EXAMPLE_LANGS,
|
|
226
|
+
helperLang,
|
|
161
227
|
primaryOpCall,
|
|
162
228
|
idLiteral,
|
|
229
|
+
requiredItems,
|
|
163
230
|
matchArg,
|
|
231
|
+
listMatchArg,
|
|
232
|
+
seededList,
|
|
164
233
|
dataArg,
|
|
234
|
+
javaMap,
|
|
235
|
+
javaMapOf,
|
|
165
236
|
litFor,
|
|
237
|
+
litPair,
|
|
166
238
|
}
|
|
167
239
|
|
|
168
240
|
export type {
|
package/src/helpers/opShape.ts
CHANGED
|
@@ -179,17 +179,31 @@ function opNeedsAction(op: any): boolean {
|
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
// The points a call can select: an action's only where every point is one.
|
|
183
|
+
function selectablePoints(op: any): any[] {
|
|
184
|
+
const points: any[] = op && op.points ? each(op.points) : []
|
|
185
185
|
const canonical = points.filter((pt: any) =>
|
|
186
186
|
null == (pt && pt.q && pt.q['$action']))
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
187
|
+
return 0 < canonical.length ? canonical : points
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
// The route and query parameters a point requires.
|
|
192
|
+
function pointRequires(pt: any): string[] {
|
|
193
|
+
const params = [
|
|
194
|
+
...(pt && pt.g && pt.g.params ? each(pt.g.params) : []),
|
|
195
|
+
...(pt && pt.g && pt.g.query ? each(pt.g.query) : []),
|
|
196
|
+
]
|
|
197
|
+
return params.filter((p: any) => p && null != p.n && false !== p.r).map((p: any) => p.n)
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
function opParams(op: any): any[] {
|
|
202
|
+
const points = selectablePoints(op)
|
|
190
203
|
|
|
191
|
-
|
|
192
|
-
const
|
|
204
|
+
// Keyed by parameter name, which may be `__proto__`.
|
|
205
|
+
const seen: Record<string, any> = Object.create(null)
|
|
206
|
+
const requiredOnAll: Record<string, boolean> = Object.create(null)
|
|
193
207
|
const out: any[] = []
|
|
194
208
|
|
|
195
209
|
points.forEach((pt: any, pointIndex: number) => {
|
|
@@ -198,7 +212,7 @@ function opParams(op: any): any[] {
|
|
|
198
212
|
const pathParams = pt && pt.g && pt.g.params ? each(pt.g.params) : []
|
|
199
213
|
const queryParams = pt && pt.g && pt.g.query ? each(pt.g.query) : []
|
|
200
214
|
const params = [...pathParams, ...queryParams]
|
|
201
|
-
const requiredHere: Record<string, boolean> =
|
|
215
|
+
const requiredHere: Record<string, boolean> = Object.create(null)
|
|
202
216
|
params.forEach((p: any) => {
|
|
203
217
|
if (p && null != p.n) {
|
|
204
218
|
requiredHere[p.n] = false !== p.r
|
|
@@ -679,6 +693,8 @@ export {
|
|
|
679
693
|
entityCollection,
|
|
680
694
|
opTypeName,
|
|
681
695
|
opParams,
|
|
696
|
+
selectablePoints,
|
|
697
|
+
pointRequires,
|
|
682
698
|
opReachable,
|
|
683
699
|
opNeedsAction,
|
|
684
700
|
ownPoint,
|
package/src/sdkgen.ts
CHANGED
|
@@ -17,7 +17,7 @@ import type {
|
|
|
17
17
|
ActionResult,
|
|
18
18
|
} from './types'
|
|
19
19
|
|
|
20
|
-
import { SdkGenError, requirePath, isAuthActive, resolveAuthPrefix, resolveAuthIn, resolveAuthName, isAuthSuppressed, isHttpBasicAuth,
|
|
20
|
+
import { SdkGenError, requirePath, isAuthActive, resolveAuthPrefix, resolveAuthIn, resolveAuthName, credentialPlacement, isAuthSuppressed, isHttpBasicAuth,
|
|
21
21
|
CONFIG_DATA_THRESHOLD, CONFIG_REPR_VALUES, isConfigData, configRepr,
|
|
22
22
|
configReprSetting, configDefinition, clean, rawStringLiteral } from './utility'
|
|
23
23
|
|
|
@@ -72,11 +72,14 @@ import { canonToType, canonToDtype, canonKey, canonScalarKey } from './helpers/c
|
|
|
72
72
|
import { canonToSpec, entityDataSpec, entityOpSpec, entitySpecs } from './helpers/canonSpec'
|
|
73
73
|
import { optionSpec, featureOptionSpec, entitySpecMap } from './helpers/optspec'
|
|
74
74
|
import { OP_SUFFIX, opTypeName, opParams, opReachable, opNeedsAction, ownPoint, opActions, entityActions, entityPath, opRequestShape, entityIdField, entityDataIdField, entityOps, invalidRequest, entityPrimaryOp, pickExampleEntity, entityClassName, entityTypeCollisions, warnEntityTypeCollisions, ungeneratedOps, warnUngeneratedOps, deriveEntityNames, entityCollection } from './helpers/opShape'
|
|
75
|
-
import { isReservedName, safeVarName, exampleVarName, phpEntityAccessor, entityCacheField, isRbCoreConstant, isRbSdkConstant, rbSafeTypeName, isSwiftSdkType, swiftSafeTypeName, isPhpReservedType, isPhpSdkClass, phpSafeTypeName, isTsReservedType, isTsSdkType, tsSafeTypeName, isElixirReservedType, elixirSafeTypeName, elixirTypeNames, elixirTypeName, elixirAccessorNames, elixirAccessor, tsTypeName, rbTypeName, phpTypeName, swiftTypeName, jsProp, jsOptProp, jsKey, luaKey, prefixLeadingDigit } from './helpers/naming'
|
|
75
|
+
import { isReservedName, safeVarName, exampleVarName, phpEntityAccessor, entityCacheField, isRbCoreConstant, isRbSdkConstant, rbSafeTypeName, isSwiftSdkType, swiftSafeTypeName, isPhpReservedType, isPhpSdkClass, phpSafeTypeName, isTsReservedType, isTsSdkType, tsSafeTypeName, isElixirReservedType, elixirSafeTypeName, elixirTypeNames, elixirTypeName, elixirAccessorNames, elixirAccessor, tsTypeName, rbTypeName, phpTypeName, swiftTypeName, jsProp, jsOptProp, jsKey, jsQuote, luaKey, prefixLeadingDigit } from './helpers/naming'
|
|
76
76
|
import { serverVariables, hasServerVariables, serverVarEnv } from './helpers/serverVars'
|
|
77
77
|
import { mcpTools, MCP_READ_OPS, MCP_WRITE_OPS } from './helpers/mcpTools'
|
|
78
78
|
import type { McpTool } from './helpers/mcpTools'
|
|
79
|
-
import {
|
|
79
|
+
import {
|
|
80
|
+
primaryOpCall, idLiteral, requiredItems, matchArg, listMatchArg, seededList, dataArg, javaMap, javaMapOf, litFor,
|
|
81
|
+
litPair,
|
|
82
|
+
} from './helpers/opExample'
|
|
80
83
|
import type { ExampleLang, LiteralLang } from './helpers/opExample'
|
|
81
84
|
import { liveStrict, liveStrictNote, liveFlowNeeds } from './helpers/testPolicy'
|
|
82
85
|
import type { LiveFlowNeeds } from './helpers/testPolicy'
|
|
@@ -1091,6 +1094,7 @@ export {
|
|
|
1091
1094
|
resolveAuthPrefix,
|
|
1092
1095
|
resolveAuthIn,
|
|
1093
1096
|
resolveAuthName,
|
|
1097
|
+
credentialPlacement,
|
|
1094
1098
|
isAuthSuppressed,
|
|
1095
1099
|
isHttpBasicAuth,
|
|
1096
1100
|
CONFIG_DATA_THRESHOLD,
|
|
@@ -1191,9 +1195,15 @@ export {
|
|
|
1191
1195
|
liveFlowNeeds,
|
|
1192
1196
|
primaryOpCall,
|
|
1193
1197
|
idLiteral,
|
|
1198
|
+
requiredItems,
|
|
1194
1199
|
matchArg,
|
|
1200
|
+
listMatchArg,
|
|
1201
|
+
seededList,
|
|
1202
|
+
javaMap,
|
|
1203
|
+
javaMapOf,
|
|
1195
1204
|
dataArg,
|
|
1196
1205
|
litFor,
|
|
1206
|
+
litPair,
|
|
1197
1207
|
featureOf,
|
|
1198
1208
|
availableFeatures,
|
|
1199
1209
|
findFeatureSources,
|
|
@@ -1223,6 +1233,7 @@ export {
|
|
|
1223
1233
|
jsProp,
|
|
1224
1234
|
jsOptProp,
|
|
1225
1235
|
jsKey,
|
|
1236
|
+
jsQuote,
|
|
1226
1237
|
luaKey,
|
|
1227
1238
|
prefixLeadingDigit,
|
|
1228
1239
|
|
package/src/utility.ts
CHANGED
|
@@ -84,6 +84,18 @@ function resolveAuthName(model: any): string {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
|
|
87
|
+
// Where the client sends the API key, when that is not the Authorization header.
|
|
88
|
+
function credentialPlacement(model: any): string {
|
|
89
|
+
if (!isAuthActive(model)) return ''
|
|
90
|
+
const where = resolveAuthIn(model)
|
|
91
|
+
const name = resolveAuthName(model)
|
|
92
|
+
if ('query' === where) return `The client sends the API key as the \`${name}\` query parameter.`
|
|
93
|
+
if ('cookie' === where) return `The client sends the API key as the \`${name}\` cookie.`
|
|
94
|
+
return 'authorization' === name.toLowerCase() ? '' :
|
|
95
|
+
`The client sends the API key in the \`${name}\` header.`
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
|
|
87
99
|
function isHttpBasicAuth(model: any): boolean {
|
|
88
100
|
const auth = getModelPath(model, `main.${KIT}.config.auth`,
|
|
89
101
|
{ only_active: false, required: false })
|
|
@@ -161,6 +173,7 @@ export {
|
|
|
161
173
|
resolveAuthPrefix,
|
|
162
174
|
resolveAuthIn,
|
|
163
175
|
resolveAuthName,
|
|
176
|
+
credentialPlacement,
|
|
164
177
|
isAuthSuppressed,
|
|
165
178
|
resolveAuthExchange,
|
|
166
179
|
isHttpBasicAuth,
|
|
@@ -272,7 +285,21 @@ const SPEC_FACTS: Record<string, (model: any) => any> = {
|
|
|
272
285
|
const ROUTED_KINDS = ['header', 'cookie', 'query']
|
|
273
286
|
|
|
274
287
|
|
|
275
|
-
|
|
288
|
+
// The names a point's body keeps when a routed argument shares one: those its
|
|
289
|
+
// JSON request body declares (`bf`), every active field where the model
|
|
290
|
+
// records no `bf`, and never a field the entity marks read-only.
|
|
291
|
+
function bodyFieldNames(pt: any, fields: any[]): string[] {
|
|
292
|
+
if (false === pt.bf) {
|
|
293
|
+
return []
|
|
294
|
+
}
|
|
295
|
+
const readOnly = fields.filter((f: any) => true === f.ro).map((f: any) => f.n)
|
|
296
|
+
const names: string[] = Array.isArray(pt.bf) ? pt.bf :
|
|
297
|
+
fields.filter((f: any) => false !== f.a).map((f: any) => f.n)
|
|
298
|
+
return names.filter((name) => !readOnly.includes(name))
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
function withPointParts(op: any, fields: any[] = []): any {
|
|
276
303
|
if (null == op) {
|
|
277
304
|
return op
|
|
278
305
|
}
|
|
@@ -283,12 +310,12 @@ function withPointParts(op: any, fields: string[] = []): any {
|
|
|
283
310
|
...o,
|
|
284
311
|
points: each(o.points).filter((pt: any) => false !== pt?.a).map((pt: any) => {
|
|
285
312
|
if (null == pt) return pt
|
|
313
|
+
const kept = bodyFieldNames(pt, fields)
|
|
286
314
|
const args = Object.fromEntries(Object.entries(pt.g || {}).map(([kind, values]) =>
|
|
287
315
|
[kind, each(values as any).filter((arg: any) => false !== arg.a).map((arg: any) => ({
|
|
288
316
|
name: arg.n, orig: arg.or, type: arg.t, kind: arg.k,
|
|
289
317
|
reqd: arg.r, example: arg.ex,
|
|
290
|
-
|
|
291
|
-
...(ROUTED_KINDS.includes(kind) && fields.includes(arg.n) ? { field: true } : {}),
|
|
318
|
+
...(ROUTED_KINDS.includes(kind) && kept.includes(arg.n) ? { field: true } : {}),
|
|
292
319
|
}))]))
|
|
293
320
|
// Runtime hooks expose descriptive names independently of the model schema.
|
|
294
321
|
return {
|
|
@@ -332,7 +359,7 @@ function configDefinition(model: any, targetname?: string): { def: any, json: st
|
|
|
332
359
|
})),
|
|
333
360
|
id: e.id,
|
|
334
361
|
name: e.name,
|
|
335
|
-
op: withPointParts(e.op, fields
|
|
362
|
+
op: withPointParts(e.op, each(e.fields || {})),
|
|
336
363
|
relations: e.relations,
|
|
337
364
|
}, true)
|
|
338
365
|
entityStubs[e.name] = {}
|