@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, each, Content, isAuthActive, packageName, envName, opRequestShape, entityIdField, entityOps, safeVarName, exampleVarName, jsKey, matchArg,
|
|
2
|
+
import { cmp, each, Content, isAuthActive, packageName, envName, opRequestShape, entityIdField, entityOps, safeVarName, exampleVarName, jsKey, matchArg, listMatchArg } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -10,12 +10,6 @@ import {
|
|
|
10
10
|
import { exampleValue } from './utility_js'
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
function listMatchArg(ent: any): string {
|
|
14
|
-
const idF = entityIdField(ent)
|
|
15
|
-
return matchArg('ts', ent, 'list', idF, idLiteral(ent, 'list', idF))
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
13
|
const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
|
|
20
14
|
const { target, ctx$: { model } } = props
|
|
21
15
|
|
|
@@ -84,7 +78,7 @@ const client = ${ctor}
|
|
|
84
78
|
|
|
85
79
|
\`\`\`js
|
|
86
80
|
const ${eVar} = await client.${eName}().load(${matchArg('load')})
|
|
87
|
-
console.log(${eVar})
|
|
81
|
+
console.log(${eVar}.data())
|
|
88
82
|
\`\`\`
|
|
89
83
|
`)
|
|
90
84
|
}
|
|
@@ -94,9 +88,9 @@ console.log(${eVar})
|
|
|
94
88
|
### List ${eName} Records
|
|
95
89
|
|
|
96
90
|
\`\`\`js
|
|
97
|
-
const ${eVar}s = await client.${eName}().list(${listMatchArg(exampleEntity)})
|
|
91
|
+
const ${eVar}s = await client.${eName}().list(${listMatchArg('js', exampleEntity)})
|
|
98
92
|
for (const ${eVar} of ${eVar}s) {
|
|
99
|
-
console.log(${eVar})
|
|
93
|
+
console.log(${eVar}.data())
|
|
100
94
|
}
|
|
101
95
|
\`\`\`
|
|
102
96
|
`)
|
|
@@ -110,7 +104,7 @@ for (const ${eVar} of ${eVar}s) {
|
|
|
110
104
|
|
|
111
105
|
\`\`\`js
|
|
112
106
|
const created = await client.${eName}().create({${createBody}})
|
|
113
|
-
console.log(created)
|
|
107
|
+
console.log(created.data())
|
|
114
108
|
\`\`\`
|
|
115
109
|
`)
|
|
116
110
|
}
|
|
@@ -125,7 +119,7 @@ console.log(created)
|
|
|
125
119
|
|
|
126
120
|
\`\`\`js
|
|
127
121
|
const updated = await client.${eName}().update({${updateBody}})
|
|
128
|
-
console.log(updated)
|
|
122
|
+
console.log(updated.data())
|
|
129
123
|
\`\`\`
|
|
130
124
|
`)
|
|
131
125
|
}
|
|
@@ -142,7 +136,7 @@ Sends only the fields given.
|
|
|
142
136
|
|
|
143
137
|
\`\`\`js
|
|
144
138
|
const patched = await client.${eName}().patch({${patchBody}})
|
|
145
|
-
console.log(patched)
|
|
139
|
+
console.log(patched.data())
|
|
146
140
|
\`\`\`
|
|
147
141
|
`)
|
|
148
142
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, each, Content, canonToType, File, isAuthActive, entityIdField, opRequestShape, safeVarName, exampleVarName, jsKey , targetFeatures, opNeedsAction, bodyNote } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, each, Content, canonToType, File, isAuthActive, entityIdField, opRequestShape, safeVarName, exampleVarName, jsKey , targetFeatures, opNeedsAction, bodyNote, listMatchArg } from '@voxgig/sdkgen'
|
|
3
3
|
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
4
4
|
|
|
5
5
|
import {
|
|
@@ -13,34 +13,33 @@ import { exampleValue } from './utility_js'
|
|
|
13
13
|
const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string }> = {
|
|
14
14
|
load: {
|
|
15
15
|
sig: 'load(match: object, ctrl?: object)',
|
|
16
|
-
returns: 'Promise<
|
|
17
|
-
desc: 'Load a single entity matching the given criteria.',
|
|
16
|
+
returns: 'Promise<Entity>',
|
|
17
|
+
desc: 'Load a single entity matching the given criteria. Resolves to the entity, whose record `data()` reads.',
|
|
18
18
|
},
|
|
19
19
|
list: {
|
|
20
20
|
sig: 'list(match: object, ctrl?: object)',
|
|
21
|
-
returns: 'Promise<
|
|
22
|
-
desc: 'List entities matching the given criteria.
|
|
21
|
+
returns: 'Promise<Entity[]>',
|
|
22
|
+
desc: 'List entities matching the given criteria. Resolves to an array of entities, one per record.',
|
|
23
23
|
},
|
|
24
24
|
create: {
|
|
25
25
|
sig: 'create(data: object, ctrl?: object)',
|
|
26
|
-
returns: 'Promise<
|
|
27
|
-
desc: 'Create a new entity with the given data.',
|
|
26
|
+
returns: 'Promise<Entity>',
|
|
27
|
+
desc: 'Create a new entity with the given data. Resolves to the created entity.',
|
|
28
28
|
},
|
|
29
29
|
update: {
|
|
30
30
|
sig: 'update(data: object, ctrl?: object)',
|
|
31
|
-
returns: 'Promise<
|
|
32
|
-
desc: 'Update an existing entity. The data must include the entity `id`.',
|
|
31
|
+
returns: 'Promise<Entity>',
|
|
32
|
+
desc: 'Update an existing entity. The data must include the entity `id`. Resolves to the updated entity.',
|
|
33
33
|
},
|
|
34
34
|
patch: {
|
|
35
35
|
sig: 'patch(data: object, ctrl?: object)',
|
|
36
|
-
returns: 'Promise<
|
|
37
|
-
desc: 'Change part of an existing entity: only the fields given are sent. '
|
|
38
|
-
'The data must include the entity `id`.',
|
|
36
|
+
returns: 'Promise<Entity>',
|
|
37
|
+
desc: 'Change part of an existing entity: only the fields given are sent. The data must include the entity `id`. Resolves to the patched entity.',
|
|
39
38
|
},
|
|
40
39
|
remove: {
|
|
41
40
|
sig: 'remove(match: object, ctrl?: object)',
|
|
42
|
-
returns: 'Promise<
|
|
43
|
-
desc: 'Remove the entity matching the given criteria.',
|
|
41
|
+
returns: 'Promise<Entity>',
|
|
42
|
+
desc: 'Remove the entity matching the given criteria. Resolves to the entity, marked as deleted.',
|
|
44
43
|
},
|
|
45
44
|
}
|
|
46
45
|
|
|
@@ -312,7 +311,7 @@ const result = await client.${ent.Name}().${opname}(${arg})
|
|
|
312
311
|
}
|
|
313
312
|
else if ('list' === opname) {
|
|
314
313
|
Content(`\`\`\`ts
|
|
315
|
-
const results = await client.${ent.Name}().${opname}()
|
|
314
|
+
const results = await client.${ent.Name}().${opname}(${listMatchArg('js', ent)})
|
|
316
315
|
\`\`\`
|
|
317
316
|
|
|
318
317
|
`)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, isAuthActive, packageName, envName, entityIdField, entityOps, opRequestShape, safeVarName, exampleVarName, jsKey,
|
|
2
|
+
import { cmp, Content, isAuthActive, packageName, envName, entityIdField, entityOps, opRequestShape, safeVarName, exampleVarName, jsKey, listMatchArg } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -10,12 +10,6 @@ import {
|
|
|
10
10
|
import { exampleValue } from './utility_js'
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
function listMatchArg(ent: any): string {
|
|
14
|
-
const idF = entityIdField(ent)
|
|
15
|
-
return matchArg('ts', ent, 'list', idF, idLiteral(ent, 'list', idF))
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
13
|
const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
|
|
20
14
|
const { target, ctx$: { model } } = props
|
|
21
15
|
|
|
@@ -38,13 +32,16 @@ const client = ${ctor}
|
|
|
38
32
|
const eVar = exampleVarName(eName.toLowerCase(), 'js')
|
|
39
33
|
const opnames = entityOps(exampleEntity)
|
|
40
34
|
|
|
35
|
+
let hasCall = false
|
|
36
|
+
|
|
41
37
|
if (opnames.includes('list')) {
|
|
42
|
-
Content(`// List all ${eName.toLowerCase()}s (
|
|
43
|
-
const ${eVar}s = await client.${eName}().list(${listMatchArg(exampleEntity)})
|
|
38
|
+
Content(`// List all ${eName.toLowerCase()}s (an array of entities, one per record)
|
|
39
|
+
const ${eVar}s = await client.${eName}().list(${listMatchArg('js', exampleEntity)})
|
|
44
40
|
for (const ${eVar} of ${eVar}s) {
|
|
45
|
-
console.log(${eVar})
|
|
41
|
+
console.log(${eVar}.data())
|
|
46
42
|
}
|
|
47
43
|
`)
|
|
44
|
+
hasCall = true
|
|
48
45
|
}
|
|
49
46
|
|
|
50
47
|
// Find a nested entity for a more interesting example: one with a parent
|
|
@@ -81,7 +78,15 @@ for (const ${eVar} of ${eVar}s) {
|
|
|
81
78
|
const ${neVar} = await client.${neName}().load({
|
|
82
79
|
${neMatchLines.join('\n')}
|
|
83
80
|
})
|
|
84
|
-
console.log(${neVar})
|
|
81
|
+
console.log(${neVar}.data())
|
|
82
|
+
`)
|
|
83
|
+
hasCall = true
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (!hasCall && opnames.includes('load')) {
|
|
87
|
+
Content(`// Load a specific ${eName.toLowerCase()} (returns the entity)
|
|
88
|
+
const ${eVar} = await client.${eName}().load()
|
|
89
|
+
console.log(${eVar}.data())
|
|
85
90
|
`)
|
|
86
91
|
}
|
|
87
92
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, entityIdField, pickExampleEntity, opRequestShape, safeVarName, exampleVarName, jsKey } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, entityIdField, pickExampleEntity, opRequestShape, safeVarName, exampleVarName, jsKey, requiredItems } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -30,11 +30,12 @@ const client = ${model.const.Name}SDK.test()
|
|
|
30
30
|
const primaryOpDef = exampleEntity.op && exampleEntity.op[primaryOp]
|
|
31
31
|
const idF = entityIdField(exampleEntity)
|
|
32
32
|
let arg = ''
|
|
33
|
-
|
|
33
|
+
const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
|
|
34
|
+
if (isMatchOp || 'list' === primaryOp) {
|
|
34
35
|
// Every REQUIRED match key (id first, then parent path params like
|
|
35
36
|
// page_id) — the same shape the runtime resolves path params from.
|
|
36
|
-
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
37
|
-
.filter((it: any) => !it.optional || it.name === idF)
|
|
37
|
+
const items = (isMatchOp ? opRequestShape(exampleEntity, primaryOp).items
|
|
38
|
+
.filter((it: any) => !it.optional || it.name === idF) : requiredItems(exampleEntity, 'list'))
|
|
38
39
|
.sort((a: any, b: any) =>
|
|
39
40
|
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
40
41
|
arg = 0 < items.length
|
|
@@ -50,10 +51,13 @@ const client = ${model.const.Name}SDK.test()
|
|
|
50
51
|
arg = `{ ${chosen.map((it: any) =>
|
|
51
52
|
`${jsKey(it.name)}: ${exampleValue(exampleEntity, primaryOpDef, it.name, 'example_' + it.name)}`).join(', ')} }`
|
|
52
53
|
}
|
|
54
|
+
const one = exampleVarName(eName.toLowerCase(), 'js')
|
|
53
55
|
Content(`const ${eVar} = await client.${eName}().${primaryOp}(${arg})
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
console.log(${eVar})
|
|
56
|
+
${'list' === primaryOp
|
|
57
|
+
? `// ${eVar} is an array of ${eName} entities, one per mock record
|
|
58
|
+
console.log(${eVar}.map((${one}) => ${one}.data()))`
|
|
59
|
+
: `// ${eVar} is the ${eName} entity; .data() reads its mock record
|
|
60
|
+
console.log(${eVar}.data())`}
|
|
57
61
|
`)
|
|
58
62
|
}
|
|
59
63
|
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
canonScalarKey,
|
|
8
8
|
each,
|
|
9
9
|
opParams,
|
|
10
|
+
jsQuote,
|
|
10
11
|
} from '@voxgig/sdkgen'
|
|
11
12
|
|
|
12
13
|
import {
|
|
@@ -54,7 +55,7 @@ function exampleValue(entity: any, op: any, paramName: string, placeholder: stri
|
|
|
54
55
|
if ('NULL' === key) {
|
|
55
56
|
return 'null'
|
|
56
57
|
}
|
|
57
|
-
return
|
|
58
|
+
return jsQuote(placeholder)
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
|
|
@@ -6,13 +6,14 @@ import {
|
|
|
6
6
|
getModelPath,
|
|
7
7
|
} from '@voxgig/apidef'
|
|
8
8
|
|
|
9
|
-
import { kotlinVarName } from './utility_kotlin'
|
|
9
|
+
import { kotlinVarName, kotlinListMatch } from './utility_kotlin'
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
// Type names come from the shared canonToType 'kotlin' column (single source of truth).
|
|
13
13
|
|
|
14
14
|
function kotlinLit(type: any, placeholder: string = 'example'): string {
|
|
15
15
|
const k = canonScalarKey(type)
|
|
16
|
+
if ('NULL' === k) return 'null'
|
|
16
17
|
if ('INTEGER' === k) return '1L'
|
|
17
18
|
if ('NUMBER' === k) return '1.0'
|
|
18
19
|
if ('BOOLEAN' === k) return 'true'
|
|
@@ -141,7 +142,7 @@ val ${eVar} = client.${accessor}(null).load(${loadArg}, null)
|
|
|
141
142
|
Content(`#### Example: List
|
|
142
143
|
|
|
143
144
|
\`\`\`kotlin
|
|
144
|
-
val ${eVar}List = client.${accessor}(null).list(
|
|
145
|
+
val ${eVar}List = client.${accessor}(null).list(${kotlinListMatch(entity)}, null)
|
|
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 { kotlinVarName } from './utility_kotlin'
|
|
9
|
+
import { kotlinVarName, kotlinString } from './utility_kotlin'
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
// A type-correct Kotlin literal for a field's canonical type.
|
|
13
13
|
function kotlinLit(type: any): string {
|
|
14
14
|
const k = canonScalarKey(type)
|
|
15
|
+
if ('NULL' === k) return 'null'
|
|
15
16
|
if ('INTEGER' === k) return '1L'
|
|
16
17
|
if ('NUMBER' === k) return '1.0'
|
|
17
18
|
if ('BOOLEAN' === k) return 'true'
|
|
@@ -39,23 +40,32 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
|
|
|
39
40
|
let testArg = 'null'
|
|
40
41
|
if (exampleEntity && isMatchOp) {
|
|
41
42
|
testArg = idF ? `mutableMapOf<String, Any?>("${idF}" to "test01")` : 'null'
|
|
43
|
+
} else if (exampleEntity && 'list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length) {
|
|
44
|
+
const chosen = requiredItems(exampleEntity, 'list')
|
|
45
|
+
testArg = `mutableMapOf<String, Any?>(${chosen.map((it: any) =>
|
|
46
|
+
`${kotlinString(it.name)} to ${kotlinLit(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 = `mutableMapOf<String, Any?>(${chosen.map((it: any) =>
|
|
48
|
-
|
|
53
|
+
`${kotlinString(it.name)} to ${kotlinLit(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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
const testModeExample = 'list' === primaryOp
|
|
59
|
+
? `// list returns a list of entities, one per mock record; it raises on error.
|
|
60
|
+
val ${eVar}List = client.${accessor}(null).list(${testArg}, null) as List<*>
|
|
61
|
+
for (${eVar}Item in ${eVar}List) {
|
|
62
|
+
println((${eVar}Item as SdkEntity).data())
|
|
63
|
+
}`
|
|
64
|
+
: primaryOp
|
|
65
|
+
? `// Entity ops return the entity; they raise on error.
|
|
66
|
+
val ${eVar} = client.${accessor}(null).${primaryOp}(${testArg}, null) as SdkEntity
|
|
67
|
+
// data() reads the entity's mock record
|
|
68
|
+
println(${eVar}.data())`
|
|
59
69
|
: `val result = client.direct(mutableMapOf<String, Any?>(
|
|
60
70
|
"path" to "/api/resource",
|
|
61
71
|
"method" to "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) -> Any?` | Load a single entity by match criteria. Raises on error. |',
|
|
28
|
-
list: '| `list` | `(reqmatch, ctrl) -> Any?` | List entities matching the criteria
|
|
29
|
-
create: '| `create` | `(reqdata, ctrl) -> Any?` | Create a new entity. Raises on error. |',
|
|
30
|
-
update: '| `update` | `(reqdata, ctrl) -> Any?` | Update an existing entity. Raises on error. |',
|
|
31
|
-
patch: '| `patch` | `(reqdata, ctrl) -> Any?` | Change part of an existing entity. Raises on error. |',
|
|
32
|
-
remove: '| `remove` | `(reqmatch, ctrl) -> Any?` | Remove an entity. Raises on error. |',
|
|
27
|
+
load: '| `load` | `(reqmatch, ctrl) -> Any?` | Load a single entity by match criteria, and return it. Raises on error. |',
|
|
28
|
+
list: '| `list` | `(reqmatch, ctrl) -> Any?` | List entities matching the criteria, one per record. Raises on error. |',
|
|
29
|
+
create: '| `create` | `(reqdata, ctrl) -> Any?` | Create a new entity, and return it. Raises on error. |',
|
|
30
|
+
update: '| `update` | `(reqdata, ctrl) -> Any?` | Update an existing entity, and return it. Raises on error. |',
|
|
31
|
+
patch: '| `patch` | `(reqdata, ctrl) -> Any?` | Change part of an existing entity, and return it. Raises on error. |',
|
|
32
|
+
remove: '| `remove` | `(reqmatch, ctrl) -> Any?` | 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 \`Any?\`; 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
|
\`MutableMap<String, Any?>\` you branch on via \`result["ok"]\`:
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
nom,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
-
import { kotlinVarName, kotlinPackage } from './utility_kotlin'
|
|
10
|
+
import { kotlinVarName, kotlinPackage, kotlinListMatch } from './utility_kotlin'
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
|
|
@@ -36,6 +36,7 @@ const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
|
|
|
36
36
|
// all values live in a MutableMap<String, Any?>.
|
|
37
37
|
const kotlinLit = (type: any, placeholder: string = 'example'): string => {
|
|
38
38
|
const k = canonScalarKey(type)
|
|
39
|
+
if ('NULL' === k) return 'null'
|
|
39
40
|
if ('INTEGER' === k) return '1L'
|
|
40
41
|
if ('NUMBER' === k) return '1.0'
|
|
41
42
|
if ('BOOLEAN' === k) return 'true'
|
|
@@ -49,6 +50,7 @@ const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
|
|
|
49
50
|
|
|
50
51
|
\`\`\`kotlin
|
|
51
52
|
import ${kotlinPackage(model)}.core.${SDK}
|
|
53
|
+
import ${kotlinPackage(model)}.core.SdkEntity
|
|
52
54
|
|
|
53
55
|
val client = ${SDK}(mutableMapOf<String, Any?>(
|
|
54
56
|
"apikey" to System.getenv("${envName(model)}_APIKEY"),
|
|
@@ -62,6 +64,7 @@ val client = ${SDK}(mutableMapOf<String, Any?>(
|
|
|
62
64
|
|
|
63
65
|
\`\`\`kotlin
|
|
64
66
|
import ${kotlinPackage(model)}.core.${SDK}
|
|
67
|
+
import ${kotlinPackage(model)}.core.SdkEntity
|
|
65
68
|
|
|
66
69
|
val client = ${SDK}()
|
|
67
70
|
\`\`\`
|
|
@@ -84,13 +87,15 @@ val client = ${SDK}()
|
|
|
84
87
|
if (opnames.includes('list')) {
|
|
85
88
|
Content(`### 2. List ${eName.toLowerCase()} records
|
|
86
89
|
|
|
87
|
-
\`list(null, null)\` returns
|
|
88
|
-
|
|
90
|
+
\`list(null, null)\` returns a list of entities, one per record (as \`Any?\`),
|
|
91
|
+
and raises on error; an entity's \`data()\` reads its record.
|
|
89
92
|
|
|
90
93
|
\`\`\`kotlin
|
|
91
94
|
try {
|
|
92
|
-
val ${eVar}List = client.${accessor}(null).list(
|
|
93
|
-
|
|
95
|
+
val ${eVar}List = client.${accessor}(null).list(${kotlinListMatch(exampleEntity)}, null) as List<*>
|
|
96
|
+
for (${eVar}Item in ${eVar}List) {
|
|
97
|
+
println((${eVar}Item as SdkEntity).data())
|
|
98
|
+
}
|
|
94
99
|
}
|
|
95
100
|
catch (err: RuntimeException) {
|
|
96
101
|
println("list failed: " + err.message)
|
|
@@ -127,8 +132,8 @@ ${neName} is nested under ${parentName}, so provide the \`${parentParam}\`.
|
|
|
127
132
|
|
|
128
133
|
\`\`\`kotlin
|
|
129
134
|
try {
|
|
130
|
-
val ${neVar} = client.${neAccessor}(null).load(mutableMapOf<String, Any?>(${neMatch.join(', ')}), null)
|
|
131
|
-
println(${neVar})
|
|
135
|
+
val ${neVar} = client.${neAccessor}(null).load(mutableMapOf<String, Any?>(${neMatch.join(', ')}), null) as SdkEntity
|
|
136
|
+
println(${neVar}.data())
|
|
132
137
|
}
|
|
133
138
|
catch (err: RuntimeException) {
|
|
134
139
|
println("load failed: " + err.message)
|
|
@@ -155,8 +160,8 @@ catch (err: RuntimeException) {
|
|
|
155
160
|
|
|
156
161
|
\`\`\`kotlin
|
|
157
162
|
try {
|
|
158
|
-
val ${eVar} = client.${accessor}(null).load(${loadArg}, null)
|
|
159
|
-
println(${eVar})
|
|
163
|
+
val ${eVar} = client.${accessor}(null).load(${loadArg}, null) as SdkEntity
|
|
164
|
+
println(${eVar}.data())
|
|
160
165
|
}
|
|
161
166
|
catch (err: RuntimeException) {
|
|
162
167
|
println("load failed: " + err.message)
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
getModelPath,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
-
import { kotlinVarName } from './utility_kotlin'
|
|
10
|
+
import { kotlinVarName, kotlinListMatch } from './utility_kotlin'
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
// Type names come from the shared canonToType 'kotlin' column (single source of truth).
|
|
@@ -15,6 +15,7 @@ import { kotlinVarName } from './utility_kotlin'
|
|
|
15
15
|
// A type-correct Kotlin literal for a field's canonical type.
|
|
16
16
|
function kotlinLit(type: any, placeholder: string = 'example'): string {
|
|
17
17
|
const k = canonScalarKey(type)
|
|
18
|
+
if ('NULL' === k) return 'null'
|
|
18
19
|
if ('INTEGER' === k) return '1L'
|
|
19
20
|
if ('NUMBER' === k) return '1.0'
|
|
20
21
|
if ('BOOLEAN' === k) return 'true'
|
|
@@ -27,33 +28,33 @@ function kotlinLit(type: any, placeholder: string = 'example'): string {
|
|
|
27
28
|
const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string }> = {
|
|
28
29
|
load: {
|
|
29
30
|
sig: 'load(reqmatch, ctrl) -> Any?',
|
|
30
|
-
returns: 'the entity
|
|
31
|
-
desc: 'Load a single entity matching the given criteria. Returns the entity data and raises on error.',
|
|
31
|
+
returns: 'the entity',
|
|
32
|
+
desc: 'Load a single entity matching the given criteria. Returns the entity, whose record `data()` reads, and raises on error.',
|
|
32
33
|
},
|
|
33
34
|
list: {
|
|
34
35
|
sig: 'list(reqmatch, ctrl) -> Any?',
|
|
35
|
-
returns: '
|
|
36
|
-
desc: 'List entities matching the given criteria. The match is optional — call `list(null, null)` to list all records. Returns
|
|
36
|
+
returns: 'a list of entities, one per record',
|
|
37
|
+
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
38
|
},
|
|
38
39
|
create: {
|
|
39
40
|
sig: 'create(reqdata, ctrl) -> Any?',
|
|
40
|
-
returns: 'the created entity
|
|
41
|
-
desc: 'Create a new entity with the given data. Returns the created entity
|
|
41
|
+
returns: 'the created entity',
|
|
42
|
+
desc: 'Create a new entity with the given data. Returns the created entity and raises on error.',
|
|
42
43
|
},
|
|
43
44
|
update: {
|
|
44
45
|
sig: 'update(reqdata, ctrl) -> Any?',
|
|
45
|
-
returns: 'the updated entity
|
|
46
|
-
desc: 'Update an existing entity. The data must include the entity `id`. Returns the updated entity
|
|
46
|
+
returns: 'the updated entity',
|
|
47
|
+
desc: 'Update an existing entity. The data must include the entity `id`. Returns the updated entity and raises on error.',
|
|
47
48
|
},
|
|
48
49
|
patch: {
|
|
49
50
|
sig: 'patch(reqdata, ctrl) -> Any?',
|
|
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
|
|
51
|
+
returns: 'the patched entity',
|
|
52
|
+
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
53
|
},
|
|
53
54
|
remove: {
|
|
54
55
|
sig: 'remove(reqmatch, ctrl) -> Any?',
|
|
55
|
-
returns: 'the removed entity
|
|
56
|
-
desc: 'Remove the entity matching the given criteria.
|
|
56
|
+
returns: 'the removed entity',
|
|
57
|
+
desc: 'Remove the entity matching the given criteria. Returns the entity, marked as deleted, and raises on error.',
|
|
57
58
|
},
|
|
58
59
|
}
|
|
59
60
|
|
|
@@ -285,8 +286,10 @@ val result = client.${accessor}(null).${opname}(${arg}, null)
|
|
|
285
286
|
}
|
|
286
287
|
else if ('list' === opname) {
|
|
287
288
|
Content(`\`\`\`kotlin
|
|
288
|
-
val results = client.${accessor}(null).list(
|
|
289
|
-
|
|
289
|
+
val results = client.${accessor}(null).list(${kotlinListMatch(ent)}, null) as List<*>
|
|
290
|
+
for (item in results) {
|
|
291
|
+
println((item as SdkEntity).data())
|
|
292
|
+
}
|
|
290
293
|
\`\`\`
|
|
291
294
|
|
|
292
295
|
`)
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
nom,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
-
import { kotlinVarName, kotlinPackage } from './utility_kotlin'
|
|
10
|
+
import { kotlinVarName, kotlinPackage, kotlinListMatch } from './utility_kotlin'
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
// A type-correct Kotlin literal for a param: numeric/boolean/array/object
|
|
@@ -15,6 +15,7 @@ import { kotlinVarName, kotlinPackage } from './utility_kotlin'
|
|
|
15
15
|
// SDK's loose object model means all values live in MutableMap<String, Any?>.
|
|
16
16
|
function kotlinLit(type: any, placeholder: string = 'example'): string {
|
|
17
17
|
const k = canonScalarKey(type)
|
|
18
|
+
if ('NULL' === k) return 'null'
|
|
18
19
|
if ('INTEGER' === k) return '1L'
|
|
19
20
|
if ('NUMBER' === k) return '1.0'
|
|
20
21
|
if ('BOOLEAN' === k) return 'true'
|
|
@@ -35,9 +36,12 @@ const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
|
|
|
35
36
|
|
|
36
37
|
const authActive = isAuthActive(model)
|
|
37
38
|
|
|
39
|
+
const shown = null != exampleEntity &&
|
|
40
|
+
['list', 'load'].some((op: string) => Object.keys(exampleEntity.op || {}).includes(op))
|
|
41
|
+
|
|
38
42
|
Content(`\`\`\`kotlin
|
|
39
43
|
import ${kotlinPackage(model)}.core.${SDK}
|
|
40
|
-
|
|
44
|
+
${shown ? `import ${kotlinPackage(model)}.core.SdkEntity\n` : ''}
|
|
41
45
|
`)
|
|
42
46
|
|
|
43
47
|
if (authActive) {
|
|
@@ -61,9 +65,11 @@ import ${kotlinPackage(model)}.core.${SDK}
|
|
|
61
65
|
const idF = entityIdField(exampleEntity)
|
|
62
66
|
|
|
63
67
|
if (opnames.includes('list')) {
|
|
64
|
-
Content(`// List all ${eNameLower}s (
|
|
65
|
-
val ${eVar}List = client.${accessor}(null).list(
|
|
66
|
-
|
|
68
|
+
Content(`// List all ${eNameLower}s (a list of entities, one per record; raises on error)
|
|
69
|
+
val ${eVar}List = client.${accessor}(null).list(${kotlinListMatch(exampleEntity)}, null) as List<*>
|
|
70
|
+
for (${eVar}Item in ${eVar}List) {
|
|
71
|
+
println((${eVar}Item as SdkEntity).data())
|
|
72
|
+
}
|
|
67
73
|
`)
|
|
68
74
|
}
|
|
69
75
|
|
|
@@ -81,9 +87,9 @@ println(${eVar}List)
|
|
|
81
87
|
it.name === idF ? 'example_id' : 'example_' + it.name)}`).join(', ')})`
|
|
82
88
|
: 'null'
|
|
83
89
|
Content(`
|
|
84
|
-
// Load a specific ${eNameLower} (returns the
|
|
85
|
-
val ${eVar} = client.${accessor}(null).load(${loadArg}, null)
|
|
86
|
-
println(${eVar})
|
|
90
|
+
// Load a specific ${eNameLower} (returns the entity, raises on error)
|
|
91
|
+
val ${eVar} = client.${accessor}(null).load(${loadArg}, null) as SdkEntity
|
|
92
|
+
println(${eVar}.data())
|
|
87
93
|
`)
|
|
88
94
|
}
|
|
89
95
|
}
|