@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, isAuthActive, envName, canonKey,
|
|
2
|
+
import { cmp, Content, isAuthActive, envName, canonKey, opRequestShape, entityIdField, entityOps, javaMapOf } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
nom,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
-
import { scalaVarName, scalaPackage } from './utility_scala'
|
|
10
|
+
import { scalaVarName, scalaPackage, scalaListMatch, scalaLit } from './utility_scala'
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
|
|
@@ -32,23 +32,12 @@ const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
|
|
|
32
32
|
|
|
33
33
|
const authActive = isAuthActive(model)
|
|
34
34
|
|
|
35
|
-
// A type-correct Scala literal for a param — the loose object model means
|
|
36
|
-
// all values live in a java.util.Map[String, Object].
|
|
37
|
-
const scalaLit = (type: any, placeholder: string = 'example'): string => {
|
|
38
|
-
const k = canonScalarKey(type)
|
|
39
|
-
if ('INTEGER' === k) return '1L'
|
|
40
|
-
if ('NUMBER' === k) return '1.0'
|
|
41
|
-
if ('BOOLEAN' === k) return 'true'
|
|
42
|
-
if ('ARRAY' === k) return 'java.util.List.of()'
|
|
43
|
-
if ('OBJECT' === k) return 'java.util.Map.of()'
|
|
44
|
-
return `"${placeholder}"`
|
|
45
|
-
}
|
|
46
|
-
|
|
47
35
|
if (authActive) {
|
|
48
36
|
Content(`### 1. Create a client
|
|
49
37
|
|
|
50
38
|
\`\`\`scala
|
|
51
39
|
import ${scalaPackage(model)}.core.${SDK}
|
|
40
|
+
import ${scalaPackage(model)}.core.SdkEntity
|
|
52
41
|
|
|
53
42
|
val options = new java.util.LinkedHashMap[String, Object]()
|
|
54
43
|
options.put("apikey", System.getenv("${envName(model)}_APIKEY"))
|
|
@@ -62,6 +51,7 @@ val client = new ${SDK}(options)
|
|
|
62
51
|
|
|
63
52
|
\`\`\`scala
|
|
64
53
|
import ${scalaPackage(model)}.core.${SDK}
|
|
54
|
+
import ${scalaPackage(model)}.core.SdkEntity
|
|
65
55
|
|
|
66
56
|
val client = new ${SDK}()
|
|
67
57
|
\`\`\`
|
|
@@ -84,13 +74,13 @@ val client = new ${SDK}()
|
|
|
84
74
|
if (opnames.includes('list')) {
|
|
85
75
|
Content(`### 2. List ${eName.toLowerCase()} records
|
|
86
76
|
|
|
87
|
-
\`list(null, null)\` returns
|
|
88
|
-
|
|
77
|
+
\`list(null, null)\` returns a list of entities, one per record (as \`Object\`),
|
|
78
|
+
and raises on error; an entity's \`data()\` reads its record.
|
|
89
79
|
|
|
90
80
|
\`\`\`scala
|
|
91
81
|
try {
|
|
92
|
-
val ${eVar}List = client.${accessor}(null).list(
|
|
93
|
-
println(${eVar}
|
|
82
|
+
val ${eVar}List = client.${accessor}(null).list(${scalaListMatch(exampleEntity)}, null).asInstanceOf[java.util.List[SdkEntity]]
|
|
83
|
+
${eVar}List.forEach(${eVar}Item => println(${eVar}Item.data()))
|
|
94
84
|
}
|
|
95
85
|
catch {
|
|
96
86
|
case err: RuntimeException => println("list failed: " + err.getMessage)
|
|
@@ -127,8 +117,8 @@ ${neName} is nested under ${parentName}, so provide the \`${parentParam}\`.
|
|
|
127
117
|
|
|
128
118
|
\`\`\`scala
|
|
129
119
|
try {
|
|
130
|
-
val ${neVar} = client.${neAccessor}(null).load(
|
|
131
|
-
println(${neVar})
|
|
120
|
+
val ${neVar} = client.${neAccessor}(null).load(${javaMapOf(neMatch, 'java.util.')}, null).asInstanceOf[SdkEntity]
|
|
121
|
+
println(${neVar}.data())
|
|
132
122
|
}
|
|
133
123
|
catch {
|
|
134
124
|
case err: RuntimeException => println("load failed: " + err.getMessage)
|
|
@@ -144,9 +134,9 @@ catch {
|
|
|
144
134
|
.sort((a: any, b: any) =>
|
|
145
135
|
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
146
136
|
const loadArg = 0 < loadRequired.length
|
|
147
|
-
?
|
|
137
|
+
? javaMapOf(loadRequired.map((it: any) =>
|
|
148
138
|
`"${it.name}", ${scalaLit(it.type,
|
|
149
|
-
it.name === idF ? 'example_id' : 'example_' + it.name)}`)
|
|
139
|
+
it.name === idF ? 'example_id' : 'example_' + it.name)}`), 'java.util.')
|
|
150
140
|
: 'null'
|
|
151
141
|
|
|
152
142
|
Content(`### 3. Load ${article} ${eName.toLowerCase()}
|
|
@@ -155,8 +145,8 @@ catch {
|
|
|
155
145
|
|
|
156
146
|
\`\`\`scala
|
|
157
147
|
try {
|
|
158
|
-
val ${eVar} = client.${accessor}(null).load(${loadArg}, null)
|
|
159
|
-
println(${eVar})
|
|
148
|
+
val ${eVar} = client.${accessor}(null).load(${loadArg}, null).asInstanceOf[SdkEntity]
|
|
149
|
+
println(${eVar}.data())
|
|
160
150
|
}
|
|
161
151
|
catch {
|
|
162
152
|
case err: RuntimeException => println("load failed: " + err.getMessage)
|
|
@@ -193,7 +183,7 @@ catch {
|
|
|
193
183
|
`)
|
|
194
184
|
if (opnames.includes('create')) {
|
|
195
185
|
Content(`// Create — returns the ENTITY (call data() for the record)
|
|
196
|
-
val created = client.${accessor}(null).create(
|
|
186
|
+
val created = client.${accessor}(null).create(${javaMapOf(examplePairs('create'), 'java.util.')}, null)
|
|
197
187
|
|
|
198
188
|
`)
|
|
199
189
|
}
|
|
@@ -201,7 +191,7 @@ val created = client.${accessor}(null).create(java.util.Map.of(${examplePairs('c
|
|
|
201
191
|
const updatePairs = (idF ? [`"${idF}", ${scalaLit(idParamType('update'), 'example_id')}`] : [])
|
|
202
192
|
.concat(examplePairs('update'))
|
|
203
193
|
Content(`// Update — supply the id in the match/data
|
|
204
|
-
client.${accessor}(null).update(
|
|
194
|
+
client.${accessor}(null).update(${javaMapOf(updatePairs, 'java.util.')}, null)
|
|
205
195
|
|
|
206
196
|
`)
|
|
207
197
|
}
|
|
@@ -209,7 +199,7 @@ client.${accessor}(null).update(java.util.Map.of(${updatePairs.join(', ')}), nul
|
|
|
209
199
|
const patchPairs = (idF ? [`"${idF}", ${scalaLit(idParamType('patch'), 'example_id')}`] : [])
|
|
210
200
|
.concat(examplePairs('patch'))
|
|
211
201
|
Content(`// Patch — sends only the fields given
|
|
212
|
-
client.${accessor}(null).patch(
|
|
202
|
+
client.${accessor}(null).patch(${javaMapOf(patchPairs, 'java.util.')}, null)
|
|
213
203
|
|
|
214
204
|
`)
|
|
215
205
|
}
|
|
@@ -223,7 +213,7 @@ client.${accessor}(null).patch(java.util.Map.of(${patchPairs.join(', ')}), null)
|
|
|
223
213
|
? `"${it.name}", ${scalaLit(idParamType('remove'), 'example_id')}`
|
|
224
214
|
: `"${it.name}", ${scalaLit(it.type, 'example_' + it.name)}`)
|
|
225
215
|
Content(`// Remove
|
|
226
|
-
client.${accessor}(null).remove(${removePairs.length ?
|
|
216
|
+
client.${accessor}(null).remove(${removePairs.length ? javaMapOf(removePairs, 'java.util.') : 'null'}, null)
|
|
227
217
|
`)
|
|
228
218
|
}
|
|
229
219
|
Content(`\`\`\`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, each, Content, canonToType, canonKey,
|
|
2
|
+
import { cmp, each, Content, canonToType, canonKey, File, isAuthActive, entityIdField, opRequestShape , targetFeatures, opNeedsAction, bodyNote, javaMap, javaMapOf } from '@voxgig/sdkgen'
|
|
3
3
|
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
4
4
|
|
|
5
5
|
import {
|
|
@@ -7,53 +7,41 @@ import {
|
|
|
7
7
|
getModelPath,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
-
import { scalaVarName } from './utility_scala'
|
|
10
|
+
import { scalaVarName, scalaListMatch, scalaLit } from './utility_scala'
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
// Type names come from the shared canonToType 'scala' column (single source of truth).
|
|
14
14
|
|
|
15
|
-
// A type-correct Scala literal for a field's canonical type.
|
|
16
|
-
function scalaLit(type: any, placeholder: string = 'example'): string {
|
|
17
|
-
const k = canonScalarKey(type)
|
|
18
|
-
if ('INTEGER' === k) return '1L'
|
|
19
|
-
if ('NUMBER' === k) return '1.0'
|
|
20
|
-
if ('BOOLEAN' === k) return 'true'
|
|
21
|
-
if ('ARRAY' === k) return 'java.util.List.of()'
|
|
22
|
-
if ('OBJECT' === k) return 'java.util.Map.of()'
|
|
23
|
-
return `"${placeholder}"`
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
15
|
const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string }> = {
|
|
28
16
|
load: {
|
|
29
17
|
sig: 'load(reqmatch, ctrl) -> Object',
|
|
30
|
-
returns: 'the entity
|
|
31
|
-
desc: 'Load a single entity matching the given criteria. Returns the entity data and raises on error.',
|
|
18
|
+
returns: 'the entity',
|
|
19
|
+
desc: 'Load a single entity matching the given criteria. Returns the entity, whose record `data()` reads, and raises on error.',
|
|
32
20
|
},
|
|
33
21
|
list: {
|
|
34
22
|
sig: 'list(reqmatch, ctrl) -> Object',
|
|
35
|
-
returns: '
|
|
36
|
-
desc: 'List entities matching the given criteria. The match is optional — call `list(null, null)` to list all records. Returns
|
|
23
|
+
returns: 'a list of entities, one per record',
|
|
24
|
+
desc: 'List entities matching the given criteria. The match is optional — call `list(null, null)` to list all records. Returns a list of entities, one per record, and raises on error.',
|
|
37
25
|
},
|
|
38
26
|
create: {
|
|
39
27
|
sig: 'create(reqdata, ctrl) -> Object',
|
|
40
|
-
returns: 'the created entity
|
|
41
|
-
desc: 'Create a new entity with the given data. Returns the created entity
|
|
28
|
+
returns: 'the created entity',
|
|
29
|
+
desc: 'Create a new entity with the given data. Returns the created entity and raises on error.',
|
|
42
30
|
},
|
|
43
31
|
update: {
|
|
44
32
|
sig: 'update(reqdata, ctrl) -> Object',
|
|
45
|
-
returns: 'the updated entity
|
|
46
|
-
desc: 'Update an existing entity. The data must include the entity `id`. Returns the updated entity
|
|
33
|
+
returns: 'the updated entity',
|
|
34
|
+
desc: 'Update an existing entity. The data must include the entity `id`. Returns the updated entity and raises on error.',
|
|
47
35
|
},
|
|
48
36
|
patch: {
|
|
49
37
|
sig: 'patch(reqdata, ctrl) -> Object',
|
|
50
|
-
returns: 'the patched entity
|
|
51
|
-
desc: 'Change part of an existing entity: only the fields given are sent. The data must include the entity `id`. Returns the patched entity
|
|
38
|
+
returns: 'the patched entity',
|
|
39
|
+
desc: 'Change part of an existing entity: only the fields given are sent. The data must include the entity `id`. Returns the patched entity and raises on error.',
|
|
52
40
|
},
|
|
53
41
|
remove: {
|
|
54
42
|
sig: 'remove(reqmatch, ctrl) -> Object',
|
|
55
|
-
returns: 'the removed entity
|
|
56
|
-
desc: 'Remove the entity matching the given criteria.
|
|
43
|
+
returns: 'the removed entity',
|
|
44
|
+
desc: 'Remove the entity matching the given criteria. Returns the entity, marked as deleted, and raises on error.',
|
|
57
45
|
},
|
|
58
46
|
}
|
|
59
47
|
|
|
@@ -273,9 +261,9 @@ ${info.desc}
|
|
|
273
261
|
.sort((a: any, b: any) =>
|
|
274
262
|
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
275
263
|
const arg = 0 < matchItems.length
|
|
276
|
-
?
|
|
264
|
+
? javaMapOf(matchItems.map((it: any) =>
|
|
277
265
|
`"${it.name}", ${scalaLit(it.type,
|
|
278
|
-
it.name === idF ? ent.name + '_id' : it.name)}`)
|
|
266
|
+
it.name === idF ? ent.name + '_id' : it.name)}`), 'java.util.')
|
|
279
267
|
: 'null'
|
|
280
268
|
Content(`\`\`\`scala
|
|
281
269
|
val result = client.${accessor}(null).${opname}(${arg}, null)
|
|
@@ -285,8 +273,8 @@ val result = client.${accessor}(null).${opname}(${arg}, null)
|
|
|
285
273
|
}
|
|
286
274
|
else if ('list' === opname) {
|
|
287
275
|
Content(`\`\`\`scala
|
|
288
|
-
val results = client.${accessor}(null).list(
|
|
289
|
-
println(
|
|
276
|
+
val results = client.${accessor}(null).list(${scalaListMatch(ent)}, null).asInstanceOf[java.util.List[SdkEntity]]
|
|
277
|
+
results.forEach(item => println(item.data()))
|
|
290
278
|
\`\`\`
|
|
291
279
|
|
|
292
280
|
`)
|
|
@@ -294,12 +282,13 @@ println(results)
|
|
|
294
282
|
else if ('create' === opname) {
|
|
295
283
|
const createItems = opRequestShape(ent, 'create').items
|
|
296
284
|
.filter((it: any) => !it.optional)
|
|
285
|
+
const createMap = javaMap(createItems.length, 'java.util.')
|
|
297
286
|
Content(`\`\`\`scala
|
|
298
|
-
val result = client.${accessor}(null).create(
|
|
287
|
+
val result = client.${accessor}(null).create(${createMap.open}
|
|
299
288
|
`)
|
|
300
289
|
createItems.map((it: any, i: number) => {
|
|
301
290
|
const comma = i < createItems.length - 1 ? ',' : ''
|
|
302
|
-
Content(` "${it.name}", ${scalaLit(it.type, 'example_' + it.name)}${comma} // ${canonToType(it.type, target.name)}
|
|
291
|
+
Content(` ${createMap.pair(`"${it.name}", ${scalaLit(it.type, 'example_' + it.name)}`)}${comma} // ${canonToType(it.type, target.name)}
|
|
303
292
|
`)
|
|
304
293
|
})
|
|
305
294
|
Content(`), null)
|
|
@@ -312,13 +301,14 @@ val result = client.${accessor}(null).create(java.util.Map.of(
|
|
|
312
301
|
.filter((it: any) => !it.optional || it.name === idF)
|
|
313
302
|
.sort((a: any, b: any) =>
|
|
314
303
|
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
304
|
+
const updateMap = javaMap(updateItems.length, 'java.util.')
|
|
315
305
|
const updateLines = updateItems.map((it: any, i: number) => {
|
|
316
306
|
const comma = i < updateItems.length - 1 ? ',' : ''
|
|
317
|
-
return ` "${it.name}", ${scalaLit(it.type,
|
|
318
|
-
it.name === idF ? ent.name + '_id' : it.name)}${comma}\n`
|
|
307
|
+
return ` ${updateMap.pair(`"${it.name}", ${scalaLit(it.type,
|
|
308
|
+
it.name === idF ? ent.name + '_id' : it.name)}`)}${comma}\n`
|
|
319
309
|
}).join('')
|
|
320
310
|
Content(`\`\`\`scala
|
|
321
|
-
val result = client.${accessor}(null).${opname}(
|
|
311
|
+
val result = client.${accessor}(null).${opname}(${updateMap.open}
|
|
322
312
|
${updateLines}), null)
|
|
323
313
|
\`\`\`
|
|
324
314
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, isAuthActive, envName, canonKey,
|
|
2
|
+
import { cmp, Content, isAuthActive, envName, canonKey, entityIdField, opRequestShape, javaMapOf } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -7,21 +7,7 @@ import {
|
|
|
7
7
|
nom,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
-
import { scalaVarName, scalaPackage } from './utility_scala'
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// A type-correct Scala literal for a param: numeric/boolean/array/object params
|
|
14
|
-
// render a typed literal; strings render the quoted placeholder. The SDK's
|
|
15
|
-
// loose object model means all values live in java.util.Map[String, Object].
|
|
16
|
-
function scalaLit(type: any, placeholder: string = 'example'): string {
|
|
17
|
-
const k = canonScalarKey(type)
|
|
18
|
-
if ('INTEGER' === k) return '1L'
|
|
19
|
-
if ('NUMBER' === k) return '1.0'
|
|
20
|
-
if ('BOOLEAN' === k) return 'true'
|
|
21
|
-
if ('ARRAY' === k) return 'java.util.List.of()'
|
|
22
|
-
if ('OBJECT' === k) return 'java.util.Map.of()'
|
|
23
|
-
return `"${placeholder}"`
|
|
24
|
-
}
|
|
10
|
+
import { scalaVarName, scalaPackage, scalaListMatch, scalaLit } from './utility_scala'
|
|
25
11
|
|
|
26
12
|
|
|
27
13
|
const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
|
|
@@ -35,9 +21,12 @@ const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
|
|
|
35
21
|
|
|
36
22
|
const authActive = isAuthActive(model)
|
|
37
23
|
|
|
24
|
+
const shown = null != exampleEntity &&
|
|
25
|
+
['list', 'load'].some((op: string) => Object.keys(exampleEntity.op || {}).includes(op))
|
|
26
|
+
|
|
38
27
|
Content(`\`\`\`scala
|
|
39
28
|
import ${scalaPackage(model)}.core.${SDK}
|
|
40
|
-
|
|
29
|
+
${shown ? `import ${scalaPackage(model)}.core.SdkEntity\n` : ''}
|
|
41
30
|
`)
|
|
42
31
|
|
|
43
32
|
if (authActive) {
|
|
@@ -61,9 +50,9 @@ val client = new ${SDK}(options)
|
|
|
61
50
|
const idF = entityIdField(exampleEntity)
|
|
62
51
|
|
|
63
52
|
if (opnames.includes('list')) {
|
|
64
|
-
Content(`// List all ${eNameLower}s (
|
|
65
|
-
val ${eVar}List = client.${accessor}(null).list(
|
|
66
|
-
println(${eVar}
|
|
53
|
+
Content(`// List all ${eNameLower}s (a list of entities, one per record; raises on error)
|
|
54
|
+
val ${eVar}List = client.${accessor}(null).list(${scalaListMatch(exampleEntity)}, null).asInstanceOf[java.util.List[SdkEntity]]
|
|
55
|
+
${eVar}List.forEach(${eVar}Item => println(${eVar}Item.data()))
|
|
67
56
|
`)
|
|
68
57
|
}
|
|
69
58
|
|
|
@@ -76,14 +65,14 @@ println(${eVar}List)
|
|
|
76
65
|
.sort((a: any, b: any) =>
|
|
77
66
|
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
78
67
|
const loadArg = 0 < loadItems.length
|
|
79
|
-
?
|
|
68
|
+
? javaMapOf(loadItems.map((it: any) =>
|
|
80
69
|
`"${it.name}", ${scalaLit(it.type,
|
|
81
|
-
it.name === idF ? 'example_id' : 'example_' + it.name)}`)
|
|
70
|
+
it.name === idF ? 'example_id' : 'example_' + it.name)}`), 'java.util.')
|
|
82
71
|
: 'null'
|
|
83
72
|
Content(`
|
|
84
|
-
// Load a specific ${eNameLower} (returns the
|
|
85
|
-
val ${eVar} = client.${accessor}(null).load(${loadArg}, null)
|
|
86
|
-
println(${eVar})
|
|
73
|
+
// Load a specific ${eNameLower} (returns the entity, raises on error)
|
|
74
|
+
val ${eVar} = client.${accessor}(null).load(${loadArg}, null).asInstanceOf[SdkEntity]
|
|
75
|
+
println(${eVar}.data())
|
|
87
76
|
`)
|
|
88
77
|
}
|
|
89
78
|
}
|
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, canonKey,
|
|
2
|
+
import { cmp, Content, 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 ReadmeTopTest = cmp(function ReadmeTopTest(props: any) {
|
|
@@ -40,29 +28,33 @@ val client = ${SDK}.testSDK(null, null)
|
|
|
40
28
|
const idF = entityIdField(exampleEntity)
|
|
41
29
|
const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
|
|
42
30
|
let arg = 'null'
|
|
43
|
-
if (isMatchOp) {
|
|
31
|
+
if (isMatchOp || ('list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length)) {
|
|
44
32
|
// Every REQUIRED match key (id first) — the same shape that generates
|
|
45
33
|
// the op's request type, so the block stays honest.
|
|
46
|
-
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
47
|
-
.filter((it: any) => !it.optional || it.name === idF)
|
|
34
|
+
const items = (isMatchOp ? opRequestShape(exampleEntity, primaryOp).items
|
|
35
|
+
.filter((it: any) => !it.optional || it.name === idF) : requiredItems(exampleEntity, 'list'))
|
|
48
36
|
.sort((a: any, b: any) =>
|
|
49
37
|
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
50
38
|
arg = 0 < items.length
|
|
51
|
-
?
|
|
52
|
-
|
|
39
|
+
? javaMapOf(items.map((it: any) =>
|
|
40
|
+
`${JSON.stringify(it.name)}, ${isMatchOp && it.name === idF ? '"test01"' : scalaLit(it.type)}`), 'java.util.')
|
|
53
41
|
: 'null'
|
|
54
42
|
} else if ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp) {
|
|
55
43
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
56
44
|
.filter((it: any) => it.name !== idF && it.name !== 'id')
|
|
57
45
|
const required = items.filter((it: any) => !it.optional)
|
|
58
46
|
const chosen = required.length ? required : items.slice(0, 3)
|
|
59
|
-
arg =
|
|
60
|
-
|
|
47
|
+
arg = javaMapOf(chosen.map((it: any) =>
|
|
48
|
+
`${JSON.stringify(it.name)}, ${scalaLit(it.type)}`), 'java.util.')
|
|
61
49
|
}
|
|
62
|
-
const eVar = scalaVarName(exampleEntity.name)
|
|
50
|
+
const eVar = scalaVarName(exampleEntity.name)
|
|
63
51
|
const accessor = scalaVarName(exampleEntity.name)
|
|
64
|
-
Content(
|
|
65
|
-
|
|
52
|
+
Content('list' === primaryOp
|
|
53
|
+
? `val ${eVar}List = client.${accessor}(null).list(${arg}, null).asInstanceOf[java.util.List[SdkEntity]]
|
|
54
|
+
${eVar}List.forEach(${eVar}Item => println(${eVar}Item.data()))
|
|
55
|
+
`
|
|
56
|
+
: `val ${eVar} = client.${accessor}(null).${primaryOp}(${arg}, null).asInstanceOf[SdkEntity]
|
|
57
|
+
println(${eVar}.data())
|
|
66
58
|
`)
|
|
67
59
|
}
|
|
68
60
|
|
|
@@ -4,6 +4,9 @@ import * as Path from 'node:path'
|
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
camelify,
|
|
7
|
+
canonScalarKey,
|
|
8
|
+
requiredItems,
|
|
9
|
+
javaMapOf,
|
|
7
10
|
} from '@voxgig/sdkgen'
|
|
8
11
|
|
|
9
12
|
import {
|
|
@@ -108,8 +111,30 @@ function jsonAppendLines(value: any, bufname: string): string {
|
|
|
108
111
|
.join('')
|
|
109
112
|
}
|
|
110
113
|
|
|
114
|
+
// Map.of and Map.entry reject a null value, so NULL keeps the placeholder.
|
|
115
|
+
function scalaLit(type: any, placeholder: string = 'example'): string {
|
|
116
|
+
const k = canonScalarKey(type)
|
|
117
|
+
if ('INTEGER' === k) return '1L'
|
|
118
|
+
if ('NUMBER' === k) return '1.0'
|
|
119
|
+
if ('BOOLEAN' === k) return 'true'
|
|
120
|
+
if ('ARRAY' === k) return 'java.util.List.of()'
|
|
121
|
+
if ('OBJECT' === k) return 'java.util.Map.of()'
|
|
122
|
+
return `"${placeholder}"`
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
// A list's required parameters as its match.
|
|
127
|
+
function scalaListMatch(entity: any): string {
|
|
128
|
+
const items = requiredItems(entity, 'list')
|
|
129
|
+
return 0 < items.length
|
|
130
|
+
? javaMapOf(items.map((it: any) => `${JSON.stringify(it.name)}, ${scalaLit(it.type)}`), 'java.util.')
|
|
131
|
+
: 'null'
|
|
132
|
+
}
|
|
133
|
+
|
|
111
134
|
|
|
112
135
|
export {
|
|
136
|
+
scalaLit,
|
|
137
|
+
scalaListMatch,
|
|
113
138
|
cleanModel,
|
|
114
139
|
mavenGroupId,
|
|
115
140
|
jsonAppendLines,
|
|
@@ -36,7 +36,7 @@ public struct ${typeName} {
|
|
|
36
36
|
items.forEach((it: any) => {
|
|
37
37
|
if (null == it || null == it.name) return
|
|
38
38
|
const ident = swiftVarName(it.name)
|
|
39
|
-
if (seen.has(ident)) return
|
|
39
|
+
if ('' === ident || seen.has(ident)) return
|
|
40
40
|
seen.add(ident)
|
|
41
41
|
Content(propLine(it.name, it.type, !!it.optional))
|
|
42
42
|
})
|
|
@@ -6,13 +6,14 @@ import {
|
|
|
6
6
|
getModelPath,
|
|
7
7
|
} from '@voxgig/apidef'
|
|
8
8
|
|
|
9
|
-
import { swiftVarName } from './utility_swift'
|
|
9
|
+
import { swiftVarName, swiftListMatch } from './utility_swift'
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
// Type names come from the shared canonToType 'swift' column (single source of truth).
|
|
13
13
|
|
|
14
14
|
function swiftLit(type: any, placeholder: string = 'example'): string {
|
|
15
15
|
const k = canonScalarKey(type)
|
|
16
|
+
if ('NULL' === k) return '.null'
|
|
16
17
|
if ('INTEGER' === k) return '.int(1)'
|
|
17
18
|
if ('NUMBER' === k) return '.double(1.0)'
|
|
18
19
|
if ('BOOLEAN' === k) return '.bool(true)'
|
|
@@ -141,7 +142,7 @@ let ${eVar} = try client.${accessor}().load(${loadArg}, nil)
|
|
|
141
142
|
Content(`#### Example: List
|
|
142
143
|
|
|
143
144
|
\`\`\`swift
|
|
144
|
-
let ${eVar}List = try client.${accessor}().list(
|
|
145
|
+
let ${eVar}List = try client.${accessor}().list(${swiftListMatch(entity)}, nil)
|
|
145
146
|
\`\`\`
|
|
146
147
|
|
|
147
148
|
`)
|
|
@@ -1,17 +1,18 @@
|
|
|
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,
|
|
6
6
|
getModelPath,
|
|
7
7
|
} from '@voxgig/apidef'
|
|
8
8
|
|
|
9
|
-
import { swiftVarName } from './utility_swift'
|
|
9
|
+
import { swiftVarName, swiftString } from './utility_swift'
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
// A type-correct Swift `Value` literal for a field's canonical type.
|
|
13
13
|
function swiftLit(type: any): string {
|
|
14
14
|
const k = canonScalarKey(type)
|
|
15
|
+
if ('NULL' === k) return '.null'
|
|
15
16
|
if ('INTEGER' === k) return '.int(1)'
|
|
16
17
|
if ('NUMBER' === k) return '.double(1.0)'
|
|
17
18
|
if ('BOOLEAN' === k) return '.bool(true)'
|
|
@@ -39,23 +40,36 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
|
|
|
39
40
|
let testArg = 'nil'
|
|
40
41
|
if (exampleEntity && isMatchOp) {
|
|
41
42
|
testArg = idF ? `VMap([("${idF}", .string("test01"))])` : 'nil'
|
|
43
|
+
} else if (exampleEntity && 'list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length) {
|
|
44
|
+
const chosen = requiredItems(exampleEntity, 'list')
|
|
45
|
+
testArg = `VMap([${chosen.map((it: any) =>
|
|
46
|
+
`(${swiftString(it.name)}, ${swiftLit(it.type)})`).join(', ')}])`
|
|
42
47
|
} else if (exampleEntity && ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp)) {
|
|
43
48
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
44
49
|
.filter((it: any) => it.name !== idF && it.name !== 'id')
|
|
45
50
|
const required = items.filter((it: any) => !it.optional)
|
|
46
51
|
const chosen = required.length ? required : items.slice(0, 3)
|
|
47
52
|
testArg = `VMap([${chosen.map((it: any) =>
|
|
48
|
-
`(
|
|
53
|
+
`(${swiftString(it.name)}, ${swiftLit(it.type)})`).join(', ')}])`
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
// The op-driven test-mode line, shown only when the SDK has an entity op.
|
|
52
57
|
// A direct()-only SDK (no ops anywhere) shows a direct() call instead.
|
|
53
|
-
const testModeExample = primaryOp
|
|
54
|
-
? `//
|
|
55
|
-
|
|
58
|
+
const testModeExample = 'list' === primaryOp
|
|
59
|
+
? `// list returns a Value list of entities, one per mock record; it throws on error.
|
|
60
|
+
let ${eVar}List = try client.${eName}().list(${testArg}, nil)
|
|
61
|
+
for ${eVar}Item in ${eVar}List.asList?.items ?? [] {
|
|
62
|
+
if let ${eVar}Entity = ${eVar}Item.asNative as? Entity {
|
|
63
|
+
print(${eVar}Entity.data())
|
|
64
|
+
}
|
|
65
|
+
}`
|
|
66
|
+
: primaryOp
|
|
67
|
+
? `// Entity ops return the entity, wrapped in a Value; they throw on error.
|
|
56
68
|
let ${eVar} = try client.${eName}().${primaryOp}(${testArg}, nil)
|
|
57
|
-
//
|
|
58
|
-
|
|
69
|
+
// data() reads the entity's mock record
|
|
70
|
+
if let ${eVar}Entity = ${eVar}.asNative as? Entity {
|
|
71
|
+
print(${eVar}Entity.data())
|
|
72
|
+
}`
|
|
59
73
|
: `let result = client.direct(VMap([
|
|
60
74
|
("path", .string("/api/resource")),
|
|
61
75
|
("method", .string("GET")),
|
|
@@ -23,12 +23,12 @@ const ReadmeModel = cmp(function ReadmeModel(props: any) {
|
|
|
23
23
|
entityList.forEach((e: any) => Object.keys(e.op || {})
|
|
24
24
|
.forEach((o: string) => { if (e.op[o] && e.op[o].active !== false) opUnion.add(o) }))
|
|
25
25
|
const opRowDefs: Record<string, string> = {
|
|
26
|
-
load: '| `load` | `(reqmatch, ctrl) throws -> Value` | Load a single entity by match criteria. Throws on error. |',
|
|
27
|
-
list: '| `list` | `(reqmatch, ctrl) throws -> Value` | List entities matching the criteria
|
|
28
|
-
create: '| `create` | `(reqdata, ctrl) throws -> Value` | Create a new entity. Throws on error. |',
|
|
29
|
-
update: '| `update` | `(reqdata, ctrl) throws -> Value` | Update an existing entity. Throws on error. |',
|
|
30
|
-
patch: '| `patch` | `(reqdata, ctrl) throws -> Value` | Change part of an existing entity. Throws on error. |',
|
|
31
|
-
remove: '| `remove` | `(reqmatch, ctrl) throws -> Value` | Remove an entity. Throws on error. |',
|
|
26
|
+
load: '| `load` | `(reqmatch, ctrl) throws -> Value` | Load a single entity by match criteria, and return it. Throws on error. |',
|
|
27
|
+
list: '| `list` | `(reqmatch, ctrl) throws -> Value` | List entities matching the criteria, one per record. Throws on error. |',
|
|
28
|
+
create: '| `create` | `(reqdata, ctrl) throws -> Value` | Create a new entity, and return it. Throws on error. |',
|
|
29
|
+
update: '| `update` | `(reqdata, ctrl) throws -> Value` | Update an existing entity, and return it. Throws on error. |',
|
|
30
|
+
patch: '| `patch` | `(reqdata, ctrl) throws -> Value` | Change part of an existing entity, and return it. Throws on error. |',
|
|
31
|
+
remove: '| `remove` | `(reqmatch, ctrl) throws -> Value` | Remove an entity, and return it marked as deleted. Throws on error. |',
|
|
32
32
|
}
|
|
33
33
|
const opRows = ['load', 'list', 'create', 'update', 'patch', 'remove']
|
|
34
34
|
.filter((o) => opUnion.has(o)).map((o) => opRowDefs[o]).join('\n')
|
|
@@ -93,9 +93,10 @@ ${opRows}
|
|
|
93
93
|
|
|
94
94
|
### Result shape
|
|
95
95
|
|
|
96
|
-
Entity operations return the
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
Entity operations return the entity, and \`list\` a \`Value\` list of entities,
|
|
97
|
+
one per record; each entity comes wrapped in a native \`Value\`, which
|
|
98
|
+
\`asNative as? Entity\` unwraps, and its \`data()\` reads the record. They
|
|
99
|
+
throw on error, so wrap calls in \`do\`/\`catch\` to handle failures.
|
|
99
100
|
|
|
100
101
|
The \`direct()\` escape hatch never throws — it returns a result \`VMap\` you
|
|
101
102
|
branch on via \`result.entries["ok"]\`:
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
nom,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
-
import { swiftVarName } from './utility_swift'
|
|
10
|
+
import { swiftVarName, swiftListMatch } from './utility_swift'
|
|
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
|
// means all values live in a `VMap` of `Value`.
|
|
38
38
|
const swiftLit = (type: any, placeholder: string = 'example'): string => {
|
|
39
39
|
const k = canonScalarKey(type)
|
|
40
|
+
if ('NULL' === k) return '.null'
|
|
40
41
|
if ('INTEGER' === k) return '.int(1)'
|
|
41
42
|
if ('NUMBER' === k) return '.double(1.0)'
|
|
42
43
|
if ('BOOLEAN' === k) return '.bool(true)'
|
|
@@ -84,14 +85,17 @@ let client = ${SDK}()
|
|
|
84
85
|
if (opnames.includes('list')) {
|
|
85
86
|
Content(`### 2. List ${eName.toLowerCase()} records
|
|
86
87
|
|
|
87
|
-
\`list(nil, nil)\` returns a \`Value\` list of
|
|
88
|
-
|
|
88
|
+
\`list(nil, nil)\` returns a \`Value\` list of entities, one per record, and
|
|
89
|
+
throws on error; \`asNative as? Entity\` unwraps an item, and its \`data()\`
|
|
90
|
+
reads the record.
|
|
89
91
|
|
|
90
92
|
\`\`\`swift
|
|
91
93
|
do {
|
|
92
|
-
let ${eVar}List = try client.${accessor}().list(
|
|
93
|
-
for ${eVar} in ${eVar}List.asList?.items ?? [] {
|
|
94
|
-
|
|
94
|
+
let ${eVar}List = try client.${accessor}().list(${swiftListMatch(exampleEntity)}, nil)
|
|
95
|
+
for ${eVar}Item in ${eVar}List.asList?.items ?? [] {
|
|
96
|
+
if let ${eVar}Entity = ${eVar}Item.asNative as? Entity {
|
|
97
|
+
print(${eVar}Entity.data())
|
|
98
|
+
}
|
|
95
99
|
}
|
|
96
100
|
}
|
|
97
101
|
catch {
|
|
@@ -130,7 +134,9 @@ ${neName} is nested under ${parentName}, so provide the \`${parentParam}\`.
|
|
|
130
134
|
\`\`\`swift
|
|
131
135
|
do {
|
|
132
136
|
let ${neVar} = try client.${neAccessor}().load(VMap([${neMatch.join(', ')}]), nil)
|
|
133
|
-
|
|
137
|
+
if let ${neVar}Entity = ${neVar}.asNative as? Entity {
|
|
138
|
+
print(${neVar}Entity.data())
|
|
139
|
+
}
|
|
134
140
|
}
|
|
135
141
|
catch {
|
|
136
142
|
print("load failed: \\(error)")
|
|
@@ -158,7 +164,9 @@ catch {
|
|
|
158
164
|
\`\`\`swift
|
|
159
165
|
do {
|
|
160
166
|
let ${eVar} = try client.${accessor}().load(${loadArg}, nil)
|
|
161
|
-
|
|
167
|
+
if let ${eVar}Entity = ${eVar}.asNative as? Entity {
|
|
168
|
+
print(${eVar}Entity.data())
|
|
169
|
+
}
|
|
162
170
|
}
|
|
163
171
|
catch {
|
|
164
172
|
print("load failed: \\(error)")
|