@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, safeVarName, exampleVarName } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, safeVarName, exampleVarName, seededList, litPair } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
|
|
11
11
|
function rbLit(type: any): string {
|
|
12
12
|
const k = canonScalarKey(type)
|
|
13
|
+
if ('NULL' === k) return 'nil'
|
|
13
14
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
14
15
|
if ('BOOLEAN' === k) return 'true'
|
|
15
16
|
if ('ARRAY' === k) return '[]'
|
|
@@ -28,13 +29,16 @@ const ReadmeTopTest = cmp(function ReadmeTopTest(props: any) {
|
|
|
28
29
|
if (exampleEntity && primaryOp) {
|
|
29
30
|
const eName = nom(exampleEntity, 'Name')
|
|
30
31
|
const ename = eName.toLowerCase()
|
|
31
|
-
// Model-driven id key: null when the entity has no id-like field
|
|
32
|
-
// seeded record carries no id and a match op takes no argument.
|
|
32
|
+
// Model-driven id key: null when the entity has no id-like field.
|
|
33
33
|
const idF = entityIdField(exampleEntity)
|
|
34
34
|
const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
|
|
35
|
-
const
|
|
35
|
+
const listed = 'list' === primaryOp ? seededList('rb', exampleEntity, idF, 'test01') : null
|
|
36
|
+
const recPairs = listed ? listed.record : idF ? [litPair('rb', idF, '"test01"')] : []
|
|
37
|
+
const recBody = 0 < recPairs.length ? `{ ${recPairs.join(', ')} }` : '{}'
|
|
36
38
|
let callArg = ''
|
|
37
|
-
if (
|
|
39
|
+
if (listed) {
|
|
40
|
+
callArg = 0 < listed.call.length ? `{ ${listed.call.join(', ')} }` : ''
|
|
41
|
+
} else if (isMatchOp) {
|
|
38
42
|
// Every REQUIRED match key (id first, then parent path params like
|
|
39
43
|
// page_id) — the same shape the runtime resolves path params from.
|
|
40
44
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
@@ -43,24 +47,24 @@ const ReadmeTopTest = cmp(function ReadmeTopTest(props: any) {
|
|
|
43
47
|
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
44
48
|
callArg = 0 < items.length
|
|
45
49
|
? `{ ${items.map((it: any) =>
|
|
46
|
-
|
|
50
|
+
litPair('rb', it.name, it.name === idF ? '"test01"' : rbLit(it.type))).join(', ')} }`
|
|
47
51
|
: ''
|
|
48
52
|
} else if ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp) {
|
|
49
53
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
50
54
|
.filter((it: any) => it.name !== idF && it.name !== 'id')
|
|
51
55
|
const required = items.filter((it: any) => !it.optional)
|
|
52
56
|
const chosen = required.length ? required : items.slice(0, 3)
|
|
53
|
-
callArg = `{ ${chosen.map((it: any) =>
|
|
57
|
+
callArg = `{ ${chosen.map((it: any) => litPair('rb', it.name, rbLit(it.type))).join(', ')} }`
|
|
54
58
|
}
|
|
55
59
|
// A list result is an Array — name the variable accordingly. Sanitise the
|
|
56
60
|
// base name — an entity whose lowercased name is a Ruby keyword (e.g.
|
|
57
|
-
// `self`) would otherwise emit uncompilable code. The fixture
|
|
58
|
-
//
|
|
61
|
+
// `self`) would otherwise emit uncompilable code. The fixture key is the
|
|
62
|
+
// model name, which the mock looks the entity up by.
|
|
59
63
|
const eVar = exampleVarName(ename, 'rb') + ('list' === primaryOp ? 's' : '')
|
|
60
64
|
Content(`\`\`\`ruby
|
|
61
65
|
# Seed fixture data so offline calls resolve without a live server.
|
|
62
66
|
client = ${model.const.Name}SDK.test({
|
|
63
|
-
"entity" => { "${
|
|
67
|
+
"entity" => { "${exampleEntity.name}" => { "test01" => ${recBody} } },
|
|
64
68
|
})
|
|
65
69
|
${eVar} = client.${eName}.${primaryOp}(${callArg})
|
|
66
70
|
\`\`\`
|
|
@@ -7,7 +7,8 @@ require_relative '../core/helpers'
|
|
|
7
7
|
#
|
|
8
8
|
# @param reqdata [EntityNameCreateData, Hash, nil] body data
|
|
9
9
|
# @param ctrl [Object, nil] optional per-call control
|
|
10
|
-
# @return [
|
|
10
|
+
# @return [EntyClass] the created EntityName entity (data_get reads its record);
|
|
11
|
+
# raises ProjectNameError on failure
|
|
11
12
|
def create(reqdata, ctrl = nil)
|
|
12
13
|
utility = @_utility
|
|
13
14
|
ctx = utility.make_context.call({
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# @param reqmatch [EntityNameListMatch, Hash, nil] match filter (any subset of
|
|
6
6
|
# EntityName fields); defaults to nil, treated as an empty match that lists all.
|
|
7
7
|
# @param ctrl [Object, nil] optional per-call control
|
|
8
|
-
# @return [Array<
|
|
8
|
+
# @return [Array<EntyClass>] the matching EntityName items, one entity per
|
|
9
9
|
# record (data_get reads the record); raises ProjectNameError on failure
|
|
10
10
|
def list(reqmatch = nil, ctrl = nil)
|
|
11
11
|
utility = @_utility
|
|
@@ -9,7 +9,8 @@ require_relative '../core/helpers'
|
|
|
9
9
|
# optional — an entity with no id-like key loads with no match (nil is treated
|
|
10
10
|
# as an empty match, so client.EntityName.load works with no args).
|
|
11
11
|
# @param ctrl [Object, nil] optional per-call control
|
|
12
|
-
# @return [
|
|
12
|
+
# @return [EntyClass] the loaded EntityName entity (data_get reads its record);
|
|
13
|
+
# raises ProjectNameError on failure
|
|
13
14
|
def load(reqmatch = nil, ctrl = nil)
|
|
14
15
|
utility = @_utility
|
|
15
16
|
ctx = utility.make_context.call({
|
|
@@ -7,7 +7,8 @@ require_relative '../core/helpers'
|
|
|
7
7
|
#
|
|
8
8
|
# @param reqdata [EntityNamePatchData, Hash, nil] body data
|
|
9
9
|
# @param ctrl [Object, nil] optional per-call control
|
|
10
|
-
# @return [
|
|
10
|
+
# @return [EntyClass] the patched EntityName entity (data_get reads its record);
|
|
11
|
+
# raises ProjectNameError on failure
|
|
11
12
|
def patch(reqdata, ctrl = nil)
|
|
12
13
|
utility = @_utility
|
|
13
14
|
ctx = utility.make_context.call({
|
|
@@ -7,7 +7,8 @@ require_relative '../core/helpers'
|
|
|
7
7
|
#
|
|
8
8
|
# @param reqmatch [EntityNameRemoveMatch, Hash, nil] match criteria (id/query fields)
|
|
9
9
|
# @param ctrl [Object, nil] optional per-call control
|
|
10
|
-
# @return [
|
|
10
|
+
# @return [EntyClass] the removed EntityName entity, marked as deleted; raises
|
|
11
|
+
# ProjectNameError on failure
|
|
11
12
|
def remove(reqmatch = nil, ctrl = nil)
|
|
12
13
|
utility = @_utility
|
|
13
14
|
ctx = utility.make_context.call({
|
|
@@ -7,7 +7,8 @@ require_relative '../core/helpers'
|
|
|
7
7
|
#
|
|
8
8
|
# @param reqdata [EntityNameUpdateData, Hash, nil] body data
|
|
9
9
|
# @param ctrl [Object, nil] optional per-call control
|
|
10
|
-
# @return [
|
|
10
|
+
# @return [EntyClass] the updated EntityName entity (data_get reads its record);
|
|
11
|
+
# raises ProjectNameError on failure
|
|
11
12
|
def update(reqdata, ctrl = nil)
|
|
12
13
|
utility = @_utility
|
|
13
14
|
ctx = utility.make_context.call({
|
|
@@ -6,6 +6,15 @@ import {
|
|
|
6
6
|
walk,
|
|
7
7
|
} from '@voxgig/struct'
|
|
8
8
|
|
|
9
|
+
import { listMatchArg } from '@voxgig/sdkgen'
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
// A list's required route and query parameters, as its call's arguments.
|
|
13
|
+
function rbListArgs(entity: any): string {
|
|
14
|
+
const arg = listMatchArg('rb', entity)
|
|
15
|
+
return '' === arg ? '' : `(${arg})`
|
|
16
|
+
}
|
|
17
|
+
|
|
9
18
|
|
|
10
19
|
function projectPath(suffix?: string): string {
|
|
11
20
|
return Path.normalize(Path.join(__dirname, '../../..', suffix ?? ''))
|
|
@@ -112,4 +121,5 @@ export {
|
|
|
112
121
|
formatRubyHash,
|
|
113
122
|
formatRubyValue,
|
|
114
123
|
projectPath,
|
|
124
|
+
rbListArgs,
|
|
115
125
|
}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
getModelPath,
|
|
7
7
|
} from '@voxgig/apidef'
|
|
8
8
|
|
|
9
|
-
import { rustVarName, rustMethodName } from './utility_rust'
|
|
9
|
+
import { rustVarName, rustMethodName, rustListMatch } from './utility_rust'
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
// Type names come from the shared canonToType 'rust' column (single source of truth).
|
|
@@ -14,6 +14,7 @@ import { rustVarName, rustMethodName } from './utility_rust'
|
|
|
14
14
|
// A type-correct rust expression constructing a voxgig struct Value.
|
|
15
15
|
function rustLit(type: any, placeholder: string = 'example'): string {
|
|
16
16
|
const k = canonScalarKey(type)
|
|
17
|
+
if ('NULL' === k) return 'Value::Null'
|
|
17
18
|
if ('INTEGER' === k || 'NUMBER' === k) return 'Value::Num(1.0)'
|
|
18
19
|
if ('BOOLEAN' === k) return 'Value::Bool(true)'
|
|
19
20
|
if ('ARRAY' === k) return 'Value::empty_list()'
|
|
@@ -135,7 +136,7 @@ println!("{:?}", ${eVar}.data(None));
|
|
|
135
136
|
Content(`#### Example: List
|
|
136
137
|
|
|
137
138
|
\`\`\`rust
|
|
138
|
-
let ${eVar}s = client.${method}(Value::Noval).list(
|
|
139
|
+
let ${eVar}s = client.${method}(Value::Noval).list(${rustListMatch(entity)}, Value::Noval).unwrap();
|
|
139
140
|
for ${eVar} in &${eVar}s {
|
|
140
141
|
println!("{:?}", ${eVar}.data(None));
|
|
141
142
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, isAuthActive, envName, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, isAuthActive, envName, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, requiredItems } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -13,6 +13,7 @@ import { crateIdent, rustVarName, rustMethodName } from './utility_rust'
|
|
|
13
13
|
// A type-correct rust expression constructing a voxgig struct Value.
|
|
14
14
|
function rustLit(type: any): string {
|
|
15
15
|
const k = canonScalarKey(type)
|
|
16
|
+
if ('NULL' === k) return 'Value::Null'
|
|
16
17
|
if ('INTEGER' === k || 'NUMBER' === k) return 'Value::Num(1.0)'
|
|
17
18
|
if ('BOOLEAN' === k) return 'Value::Bool(true)'
|
|
18
19
|
if ('ARRAY' === k) return 'Value::empty_list()'
|
|
@@ -37,13 +38,16 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
|
|
|
37
38
|
let testArg = 'Value::Noval'
|
|
38
39
|
if (exampleEntity && isMatchOp) {
|
|
39
40
|
testArg = idF ? `jo(vec![("${idF}", Value::str("test01"))])` : 'Value::Noval'
|
|
41
|
+
} else if (exampleEntity && 'list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length) {
|
|
42
|
+
const chosen = requiredItems(exampleEntity, 'list')
|
|
43
|
+
testArg = `jo(vec![${chosen.map((it: any) => `(${JSON.stringify(it.name)}, ${rustLit(it.type)})`).join(', ')}])`
|
|
40
44
|
} else if (exampleEntity && ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp)) {
|
|
41
45
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
42
46
|
.filter((it: any) => it.name !== idF && it.name !== 'id')
|
|
43
47
|
const required = items.filter((it: any) => !it.optional)
|
|
44
48
|
const chosen = required.length ? required : items.slice(0, 3)
|
|
45
49
|
testArg = 0 < chosen.length
|
|
46
|
-
? `jo(vec![${chosen.map((it: any) => `(
|
|
50
|
+
? `jo(vec![${chosen.map((it: any) => `(${JSON.stringify(it.name)}, ${rustLit(it.type)})`).join(', ')}])`
|
|
47
51
|
: 'Value::empty_map()'
|
|
48
52
|
}
|
|
49
53
|
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
nom,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
-
import { crateIdent, rustVarName, rustMethodName } from './utility_rust'
|
|
10
|
+
import { crateIdent, rustVarName, rustMethodName, rustListMatch } from './utility_rust'
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
|
|
@@ -37,6 +37,7 @@ const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
|
|
|
37
37
|
// A type-correct rust expression constructing a voxgig struct Value.
|
|
38
38
|
const rustLit = (type: any, placeholder: string = 'example'): string => {
|
|
39
39
|
const k = canonScalarKey(type)
|
|
40
|
+
if ('NULL' === k) return 'Value::Null'
|
|
40
41
|
if ('INTEGER' === k || 'NUMBER' === k) return 'Value::Num(1.0)'
|
|
41
42
|
if ('BOOLEAN' === k) return 'Value::Bool(true)'
|
|
42
43
|
if ('ARRAY' === k) return 'Value::empty_list()'
|
|
@@ -72,7 +73,7 @@ let client = ${ctor};
|
|
|
72
73
|
the \`Result\`. \`data(None)\` reads an entity's record.
|
|
73
74
|
|
|
74
75
|
\`\`\`rust
|
|
75
|
-
match client.${method}(Value::Noval).list(
|
|
76
|
+
match client.${method}(Value::Noval).list(${rustListMatch(exampleEntity)}, Value::Noval) {
|
|
76
77
|
Ok(${eVar}s) => {
|
|
77
78
|
for ${eVar} in &${eVar}s {
|
|
78
79
|
println!("{:?}", ${eVar}.data(None));
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
getModelPath,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
-
import { crateIdent, rustVarName, rustMethodName } from './utility_rust'
|
|
10
|
+
import { crateIdent, rustVarName, rustMethodName, rustListMatch } from './utility_rust'
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
// Type names come from the shared canonToType 'rust' column (single source of truth).
|
|
@@ -15,6 +15,7 @@ import { crateIdent, rustVarName, rustMethodName } from './utility_rust'
|
|
|
15
15
|
// A type-correct rust expression constructing a voxgig struct Value.
|
|
16
16
|
function rustLit(type: any, placeholder: string = 'example'): string {
|
|
17
17
|
const k = canonScalarKey(type)
|
|
18
|
+
if ('NULL' === k) return 'Value::Null'
|
|
18
19
|
if ('INTEGER' === k || 'NUMBER' === k) return 'Value::Num(1.0)'
|
|
19
20
|
if ('BOOLEAN' === k) return 'Value::Bool(true)'
|
|
20
21
|
if ('ARRAY' === k) return 'Value::empty_list()'
|
|
@@ -52,8 +53,8 @@ const ReadmeRef = cmp(function ReadmeRef(props: any) {
|
|
|
52
53
|
desc: 'Update an existing entity. The data must include the entity id. `Ok` is the updated entity.',
|
|
53
54
|
},
|
|
54
55
|
patch: {
|
|
55
|
-
sig: `patch(reqdata: Value, ctrl: Value) -> Result<
|
|
56
|
-
desc: 'Change part of an existing entity: only the fields given are sent. The data must include the entity id.
|
|
56
|
+
sig: `patch(reqdata: Value, ctrl: Value) -> Result<Rc<Self>, ${errType}>`,
|
|
57
|
+
desc: 'Change part of an existing entity: only the fields given are sent. The data must include the entity id. `Ok` is the patched entity.',
|
|
57
58
|
},
|
|
58
59
|
remove: {
|
|
59
60
|
sig: `remove(reqmatch: Value, ctrl: Value) -> Result<Rc<Self>, ${errType}>`,
|
|
@@ -279,7 +280,7 @@ println!("{:?}", result.data(None));
|
|
|
279
280
|
}
|
|
280
281
|
else if ('list' === opname) {
|
|
281
282
|
Content(`\`\`\`rust
|
|
282
|
-
let results = client.${method}(Value::Noval).list(
|
|
283
|
+
let results = client.${method}(Value::Noval).list(${rustListMatch(ent)}, Value::Noval).unwrap();
|
|
283
284
|
for ${eVar} in &results {
|
|
284
285
|
println!("{:?}", ${eVar}.data(None));
|
|
285
286
|
}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
nom,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
-
import { crateIdent, rustVarName, rustMethodName } from './utility_rust'
|
|
10
|
+
import { crateIdent, rustVarName, rustMethodName, rustListMatch } from './utility_rust'
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
// A type-correct rust expression constructing a voxgig struct Value for a
|
|
@@ -15,6 +15,7 @@ import { crateIdent, rustVarName, rustMethodName } from './utility_rust'
|
|
|
15
15
|
// render a typed literal.
|
|
16
16
|
function rustLit(type: any, placeholder: string = 'example'): string {
|
|
17
17
|
const k = canonScalarKey(type)
|
|
18
|
+
if ('NULL' === k) return 'Value::Null'
|
|
18
19
|
if ('INTEGER' === k || 'NUMBER' === k) return 'Value::Num(1.0)'
|
|
19
20
|
if ('BOOLEAN' === k) return 'Value::Bool(true)'
|
|
20
21
|
if ('ARRAY' === k) return 'Value::empty_list()'
|
|
@@ -54,7 +55,7 @@ let client = ${ctor};
|
|
|
54
55
|
|
|
55
56
|
if (opnames.includes('list')) {
|
|
56
57
|
Content(`// List all ${eName.toLowerCase()}s (one entity per record, Err on failure)
|
|
57
|
-
let ${eVar}s = client.${method}(Value::Noval).list(
|
|
58
|
+
let ${eVar}s = client.${method}(Value::Noval).list(${rustListMatch(exampleEntity)}, Value::Noval).unwrap();
|
|
58
59
|
for ${eVar} in &${eVar}s {
|
|
59
60
|
println!("{:?}", ${eVar}.data(None));
|
|
60
61
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, requiredItems } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -14,6 +14,7 @@ import { crateIdent, rustVarName, rustMethodName } from './utility_rust'
|
|
|
14
14
|
// field's canonical type.
|
|
15
15
|
function rustLit(type: any): string {
|
|
16
16
|
const k = canonScalarKey(type)
|
|
17
|
+
if ('NULL' === k) return 'Value::Null'
|
|
17
18
|
if ('INTEGER' === k || 'NUMBER' === k) return 'Value::Num(1.0)'
|
|
18
19
|
if ('BOOLEAN' === k) return 'Value::Bool(true)'
|
|
19
20
|
if ('ARRAY' === k) return 'Value::empty_list()'
|
|
@@ -44,16 +45,16 @@ let client = test_sdk(Value::Noval, Value::Noval);
|
|
|
44
45
|
const idF = entityIdField(exampleEntity)
|
|
45
46
|
const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
|
|
46
47
|
let arg = 'Value::Noval'
|
|
47
|
-
if (isMatchOp) {
|
|
48
|
+
if (isMatchOp || ('list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length)) {
|
|
48
49
|
// Every REQUIRED match key (id first) — the same shape that generates
|
|
49
50
|
// the op's request match.
|
|
50
|
-
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
51
|
-
.filter((it: any) => !it.optional || it.name === idF)
|
|
51
|
+
const items = (isMatchOp ? opRequestShape(exampleEntity, primaryOp).items
|
|
52
|
+
.filter((it: any) => !it.optional || it.name === idF) : requiredItems(exampleEntity, 'list'))
|
|
52
53
|
.sort((a: any, b: any) =>
|
|
53
54
|
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
54
55
|
arg = 0 < items.length
|
|
55
56
|
? `jo(vec![${items.map((it: any) =>
|
|
56
|
-
`(
|
|
57
|
+
`(${JSON.stringify(it.name)}, ${isMatchOp && it.name === idF ? 'Value::str("test01")' : rustLit(it.type)})`).join(', ')}])`
|
|
57
58
|
: 'Value::Noval'
|
|
58
59
|
} else if ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp) {
|
|
59
60
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
@@ -61,7 +62,7 @@ let client = test_sdk(Value::Noval, Value::Noval);
|
|
|
61
62
|
const required = items.filter((it: any) => !it.optional)
|
|
62
63
|
const chosen = required.length ? required : items.slice(0, 3)
|
|
63
64
|
arg = 0 < chosen.length
|
|
64
|
-
? `jo(vec![${chosen.map((it: any) => `(
|
|
65
|
+
? `jo(vec![${chosen.map((it: any) => `(${JSON.stringify(it.name)}, ${rustLit(it.type)})`).join(', ')}])`
|
|
65
66
|
: 'Value::empty_map()'
|
|
66
67
|
}
|
|
67
68
|
const eVar = rustVarName(exampleEntity.name)
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
walk,
|
|
5
5
|
} from '@voxgig/struct'
|
|
6
6
|
|
|
7
|
-
import { sdkName } from '@voxgig/sdkgen'
|
|
7
|
+
import { sdkName, canonScalarKey, requiredItems } from '@voxgig/sdkgen'
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
// Rust keywords (strict + reserved) that are illegal as an identifier.
|
|
@@ -150,7 +150,19 @@ function rustRawString(s: string): string {
|
|
|
150
150
|
return 'r' + hashes + '"' + s + '"' + hashes
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
+
// A list's required route and query parameters, as the match it is called with.
|
|
154
|
+
function rustListMatch(entity: any): string {
|
|
155
|
+
const lit = (type: any): string =>
|
|
156
|
+
(({ NULL: 'Value::Null', INTEGER: 'Value::Num(1.0)', NUMBER: 'Value::Num(1.0)', BOOLEAN: 'Value::Bool(true)', ARRAY: 'Value::empty_list()', OBJECT: 'Value::empty_map()' }) as any)[canonScalarKey(type)] ?? 'Value::str("example")'
|
|
157
|
+
const items = requiredItems(entity, 'list')
|
|
158
|
+
return 0 < items.length
|
|
159
|
+
? `jo(vec![${items.map((it: any) => `(${JSON.stringify(it.name)}, ${lit(it.type)})`).join(', ')}])`
|
|
160
|
+
: 'Value::Noval'
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
|
|
153
164
|
export {
|
|
165
|
+
rustListMatch,
|
|
154
166
|
rustMethodName,
|
|
155
167
|
rustRawString,
|
|
156
168
|
clean,
|
|
@@ -30,8 +30,9 @@ const SCALA_KEYWORDS = new Set<string>([
|
|
|
30
30
|
])
|
|
31
31
|
|
|
32
32
|
|
|
33
|
+
// A bare `_` is the wildcard, backquoted or not.
|
|
33
34
|
function scalaIdent(name: string): boolean {
|
|
34
|
-
return /^[A-Za-z_][A-Za-z0-9_]*$/.test(name) && !SCALA_KEYWORDS.has(name)
|
|
35
|
+
return /^[A-Za-z_][A-Za-z0-9_]*$/.test(name) && !SCALA_KEYWORDS.has(name) && '_' !== name
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
|
|
@@ -66,8 +67,10 @@ function emitCaseClass(typeName: string, items: any[], log?: any): void {
|
|
|
66
67
|
return
|
|
67
68
|
}
|
|
68
69
|
|
|
70
|
+
// A name ending in `_` lexes with the colon after it as one identifier.
|
|
69
71
|
const params = usable
|
|
70
|
-
.map((it: any) => `${it.name
|
|
72
|
+
.map((it: any) => `${it.name.endsWith('_') ? '`' + it.name + '`' : it.name}: ` +
|
|
73
|
+
canonToType(it.type, LANG))
|
|
71
74
|
.join(', ')
|
|
72
75
|
Content(` final case class ${typeName}(${params})
|
|
73
76
|
|
|
@@ -1,27 +1,16 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, each, Content, canonToType, canonKey,
|
|
2
|
+
import { cmp, each, Content, canonToType, canonKey, entityIdField, opRequestShape, opNeedsAction, javaMap, javaMapOf } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
6
6
|
getModelPath,
|
|
7
7
|
} from '@voxgig/apidef'
|
|
8
8
|
|
|
9
|
-
import { scalaVarName } from './utility_scala'
|
|
9
|
+
import { scalaVarName, scalaListMatch, scalaLit } from './utility_scala'
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
// Type names come from the shared canonToType 'scala' column (single source of truth).
|
|
13
13
|
|
|
14
|
-
function scalaLit(type: any, placeholder: string = 'example'): string {
|
|
15
|
-
const k = canonScalarKey(type)
|
|
16
|
-
if ('INTEGER' === k) return '1L'
|
|
17
|
-
if ('NUMBER' === k) return '1.0'
|
|
18
|
-
if ('BOOLEAN' === k) return 'true'
|
|
19
|
-
if ('ARRAY' === k) return 'java.util.List.of()'
|
|
20
|
-
if ('OBJECT' === k) return 'java.util.Map.of()'
|
|
21
|
-
return `"${placeholder}"`
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
14
|
// Operation method spelling for Scala: camelCase methods over the loose object
|
|
26
15
|
// model. The op descriptions are language-agnostic.
|
|
27
16
|
const OP_DESC: Record<string, { method: string, desc: string }> = {
|
|
@@ -58,7 +47,6 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
|
58
47
|
// An op that needs an action has no plain call to show.
|
|
59
48
|
const callable = opnames.filter((o: string) => !opNeedsAction(entity.op[o]))
|
|
60
49
|
const fields = Object.values(entity.fields || {})
|
|
61
|
-
// Model-driven id key: null when this entity has no id-like field.
|
|
62
50
|
const idF = entityIdField(entity)
|
|
63
51
|
// Sanitise the local variable name — a camelCased Scala keyword gets a
|
|
64
52
|
// trailing underscore (scalaVarName) so the snippet compiles.
|
|
@@ -124,9 +112,9 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
|
124
112
|
.sort((a: any, b: any) =>
|
|
125
113
|
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
126
114
|
const loadArg = 0 < loadItems.length
|
|
127
|
-
?
|
|
115
|
+
? javaMapOf(loadItems.map((it: any) =>
|
|
128
116
|
`"${it.name}", ${scalaLit(it.type,
|
|
129
|
-
it.name === idF ? entity.name + '_id' : it.name)}`)
|
|
117
|
+
it.name === idF ? entity.name + '_id' : it.name)}`), 'java.util.')
|
|
130
118
|
: 'null'
|
|
131
119
|
Content(`#### Example: Load
|
|
132
120
|
|
|
@@ -141,7 +129,7 @@ val ${eVar} = client.${accessor}(null).load(${loadArg}, null)
|
|
|
141
129
|
Content(`#### Example: List
|
|
142
130
|
|
|
143
131
|
\`\`\`scala
|
|
144
|
-
val ${eVar}List = client.${accessor}(null).list(
|
|
132
|
+
val ${eVar}List = client.${accessor}(null).list(${scalaListMatch(entity)}, null)
|
|
145
133
|
\`\`\`
|
|
146
134
|
|
|
147
135
|
`)
|
|
@@ -153,14 +141,15 @@ val ${eVar}List = client.${accessor}(null).list(null, null)
|
|
|
153
141
|
// required id and parent keys like page_id — with a real literal.
|
|
154
142
|
const createItems = opRequestShape(entity, 'create').items
|
|
155
143
|
.filter((it: any) => !it.optional)
|
|
144
|
+
const createMap = javaMap(createItems.length, 'java.util.')
|
|
156
145
|
Content(`#### Example: Create
|
|
157
146
|
|
|
158
147
|
\`\`\`scala
|
|
159
|
-
val ${eVar} = client.${accessor}(null).create(
|
|
148
|
+
val ${eVar} = client.${accessor}(null).create(${createMap.open}
|
|
160
149
|
`)
|
|
161
150
|
createItems.map((it: any, i: number) => {
|
|
162
151
|
const comma = i < createItems.length - 1 ? ',' : ''
|
|
163
|
-
Content(` "${it.name}", ${scalaLit(it.type, 'example_' + it.name)}${comma} // ${canonToType(it.type, target.name)}
|
|
152
|
+
Content(` ${createMap.pair(`"${it.name}", ${scalaLit(it.type, 'example_' + it.name)}`)}${comma} // ${canonToType(it.type, target.name)}
|
|
164
153
|
`)
|
|
165
154
|
})
|
|
166
155
|
Content(`), null)
|
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, isAuthActive, envName, canonKey,
|
|
2
|
+
import { cmp, Content, isAuthActive, envName, canonKey, entityIdField, pickExampleEntity, opRequestShape, requiredItems, javaMapOf } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
6
6
|
getModelPath,
|
|
7
7
|
} from '@voxgig/apidef'
|
|
8
8
|
|
|
9
|
-
import { scalaVarName } from './utility_scala'
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
// A type-correct Scala literal for a field's canonical type.
|
|
13
|
-
function scalaLit(type: any): string {
|
|
14
|
-
const k = canonScalarKey(type)
|
|
15
|
-
if ('INTEGER' === k) return '1L'
|
|
16
|
-
if ('NUMBER' === k) return '1.0'
|
|
17
|
-
if ('BOOLEAN' === k) return 'true'
|
|
18
|
-
if ('ARRAY' === k) return 'java.util.List.of()'
|
|
19
|
-
if ('OBJECT' === k) return 'java.util.Map.of()'
|
|
20
|
-
return '"example"'
|
|
21
|
-
}
|
|
9
|
+
import { scalaVarName, scalaLit } from './utility_scala'
|
|
22
10
|
|
|
23
11
|
|
|
24
12
|
const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
|
|
@@ -39,23 +27,30 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
|
|
|
39
27
|
let testArg = 'null'
|
|
40
28
|
if (exampleEntity && isMatchOp) {
|
|
41
29
|
testArg = idF ? `java.util.Map.of("${idF}", "test01")` : 'null'
|
|
30
|
+
} else if (exampleEntity && 'list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length) {
|
|
31
|
+
const chosen = requiredItems(exampleEntity, 'list')
|
|
32
|
+
testArg = javaMapOf(chosen.map((it: any) =>
|
|
33
|
+
`${JSON.stringify(it.name)}, ${scalaLit(it.type)}`), 'java.util.')
|
|
42
34
|
} else if (exampleEntity && ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp)) {
|
|
43
35
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
44
36
|
.filter((it: any) => it.name !== idF && it.name !== 'id')
|
|
45
37
|
const required = items.filter((it: any) => !it.optional)
|
|
46
38
|
const chosen = required.length ? required : items.slice(0, 3)
|
|
47
|
-
testArg =
|
|
48
|
-
|
|
39
|
+
testArg = javaMapOf(chosen.map((it: any) =>
|
|
40
|
+
`${JSON.stringify(it.name)}, ${scalaLit(it.type)}`), 'java.util.')
|
|
49
41
|
}
|
|
50
42
|
|
|
51
43
|
// The op-driven test-mode line, shown only when the SDK has an entity op.
|
|
52
44
|
// A direct()-only SDK (no ops anywhere) shows a direct() call instead.
|
|
53
|
-
const testModeExample = primaryOp
|
|
54
|
-
? `//
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
45
|
+
const testModeExample = 'list' === primaryOp
|
|
46
|
+
? `// list returns a list of entities, one per mock record; it raises on error.
|
|
47
|
+
val ${eVar}List = client.${accessor}(null).list(${testArg}, null).asInstanceOf[java.util.List[SdkEntity]]
|
|
48
|
+
${eVar}List.forEach(${eVar}Item => println(${eVar}Item.data()))`
|
|
49
|
+
: primaryOp
|
|
50
|
+
? `// Entity ops return the entity; they raise on error.
|
|
51
|
+
val ${eVar} = client.${accessor}(null).${primaryOp}(${testArg}, null).asInstanceOf[SdkEntity]
|
|
52
|
+
// data() reads the entity's mock record
|
|
53
|
+
println(${eVar}.data())`
|
|
59
54
|
: `val result = client.direct(java.util.Map.of(
|
|
60
55
|
"path", "/api/resource",
|
|
61
56
|
"method", "GET"))
|
|
@@ -24,12 +24,12 @@ const ReadmeModel = cmp(function ReadmeModel(props: any) {
|
|
|
24
24
|
entityList.forEach((e: any) => Object.keys(e.op || {})
|
|
25
25
|
.forEach((o: string) => { if (e.op[o] && e.op[o].active !== false) opUnion.add(o) }))
|
|
26
26
|
const opRowDefs: Record<string, string> = {
|
|
27
|
-
load: '| `load` | `(reqmatch, ctrl) -> Object` | Load a single entity by match criteria. Raises on error. |',
|
|
28
|
-
list: '| `list` | `(reqmatch, ctrl) -> Object` | List entities matching the criteria
|
|
29
|
-
create: '| `create` | `(reqdata, ctrl) -> Object` | Create a new entity. Raises on error. |',
|
|
30
|
-
update: '| `update` | `(reqdata, ctrl) -> Object` | Update an existing entity. Raises on error. |',
|
|
31
|
-
patch: '| `patch` | `(reqdata, ctrl) -> Object` | Change part of an existing entity. Raises on error. |',
|
|
32
|
-
remove: '| `remove` | `(reqmatch, ctrl) -> Object` | Remove an entity. Raises on error. |',
|
|
27
|
+
load: '| `load` | `(reqmatch, ctrl) -> Object` | Load a single entity by match criteria, and return it. Raises on error. |',
|
|
28
|
+
list: '| `list` | `(reqmatch, ctrl) -> Object` | List entities matching the criteria, one per record. Raises on error. |',
|
|
29
|
+
create: '| `create` | `(reqdata, ctrl) -> Object` | Create a new entity, and return it. Raises on error. |',
|
|
30
|
+
update: '| `update` | `(reqdata, ctrl) -> Object` | Update an existing entity, and return it. Raises on error. |',
|
|
31
|
+
patch: '| `patch` | `(reqdata, ctrl) -> Object` | Change part of an existing entity, and return it. Raises on error. |',
|
|
32
|
+
remove: '| `remove` | `(reqmatch, ctrl) -> Object` | Remove an entity, and return it marked as deleted. Raises on error. |',
|
|
33
33
|
}
|
|
34
34
|
const opRows = ['load', 'list', 'create', 'update', 'patch', 'remove']
|
|
35
35
|
.filter((o) => opUnion.has(o)).map((o) => opRowDefs[o]).join('\n')
|
|
@@ -94,9 +94,10 @@ ${opRows}
|
|
|
94
94
|
|
|
95
95
|
### Result shape
|
|
96
96
|
|
|
97
|
-
Entity operations return the
|
|
98
|
-
|
|
99
|
-
calls in \`try\`/\`catch\` to handle
|
|
97
|
+
Entity operations return the entity, and \`list\` a list of entities, one per
|
|
98
|
+
record, as \`Object\`; an entity is an \`SdkEntity\`, whose \`data()\` reads its
|
|
99
|
+
record. They raise on error, so wrap calls in \`try\`/\`catch\` to handle
|
|
100
|
+
failures.
|
|
100
101
|
|
|
101
102
|
The \`direct()\` escape hatch never raises — it returns a result
|
|
102
103
|
\`java.util.Map[String, Object]\` you branch on via \`result.get("ok")\`:
|