@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
|
@@ -7,10 +7,13 @@ import {
|
|
|
7
7
|
getModelPath,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
+
import { cljListMatch } from './utility_clojure'
|
|
11
|
+
|
|
10
12
|
|
|
11
13
|
// A type-correct Clojure literal for a field's canonical type.
|
|
12
14
|
function cljLit(type: any, placeholder: string = 'example'): string {
|
|
13
15
|
const k = canonScalarKey(type)
|
|
16
|
+
if ('NULL' === k) return 'nil'
|
|
14
17
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
15
18
|
if ('BOOLEAN' === k) return 'true'
|
|
16
19
|
if ('ARRAY' === k) return '(vs/jt)'
|
|
@@ -34,34 +37,34 @@ function cljType(type: any): string {
|
|
|
34
37
|
|
|
35
38
|
const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string }> = {
|
|
36
39
|
load: {
|
|
37
|
-
sig: '(load ent reqmatch ctrl) ->
|
|
38
|
-
returns: 'the entity
|
|
39
|
-
desc: 'Load a single entity matching the given criteria. Returns the entity data and raises on error.',
|
|
40
|
+
sig: '(load ent reqmatch ctrl) -> entity',
|
|
41
|
+
returns: 'the entity',
|
|
42
|
+
desc: 'Load a single entity matching the given criteria. Returns the entity, whose record `((:data-get ent))` reads, and raises on error.',
|
|
40
43
|
},
|
|
41
44
|
list: {
|
|
42
45
|
sig: '(list ent reqmatch ctrl) -> vector',
|
|
43
|
-
returns: 'a vector of entities',
|
|
44
|
-
desc: 'List entities matching the given criteria. The match is optional — call with `nil` to list all records. Returns a vector and raises on error.',
|
|
46
|
+
returns: 'a vector of entities, one per record',
|
|
47
|
+
desc: 'List entities matching the given criteria. The match is optional — call with `nil` to list all records. Returns a vector of entities, one per record, and raises on error.',
|
|
45
48
|
},
|
|
46
49
|
create: {
|
|
47
|
-
sig: '(create ent reqdata ctrl) ->
|
|
48
|
-
returns: 'the created entity
|
|
49
|
-
desc: 'Create a new entity with the given data. Returns the created entity
|
|
50
|
+
sig: '(create ent reqdata ctrl) -> entity',
|
|
51
|
+
returns: 'the created entity',
|
|
52
|
+
desc: 'Create a new entity with the given data. Returns the created entity and raises on error.',
|
|
50
53
|
},
|
|
51
54
|
update: {
|
|
52
|
-
sig: '(update ent reqdata ctrl) ->
|
|
53
|
-
returns: 'the updated entity
|
|
54
|
-
desc: 'Update an existing entity. The data must include the entity `id`. Returns the updated entity
|
|
55
|
+
sig: '(update ent reqdata ctrl) -> entity',
|
|
56
|
+
returns: 'the updated entity',
|
|
57
|
+
desc: 'Update an existing entity. The data must include the entity `id`. Returns the updated entity and raises on error.',
|
|
55
58
|
},
|
|
56
59
|
patch: {
|
|
57
|
-
sig: '(patch ent reqdata ctrl) ->
|
|
58
|
-
returns: 'the patched entity
|
|
59
|
-
desc: 'Change part of an existing entity: only the fields given are sent. The data must include the entity `id`. Returns the patched entity
|
|
60
|
+
sig: '(patch ent reqdata ctrl) -> entity',
|
|
61
|
+
returns: 'the patched entity',
|
|
62
|
+
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.',
|
|
60
63
|
},
|
|
61
64
|
remove: {
|
|
62
|
-
sig: '(remove ent reqmatch ctrl) ->
|
|
63
|
-
returns: 'the removed entity
|
|
64
|
-
desc: 'Remove the entity matching the given criteria.
|
|
65
|
+
sig: '(remove ent reqmatch ctrl) -> entity',
|
|
66
|
+
returns: 'the removed entity',
|
|
67
|
+
desc: 'Remove the entity matching the given criteria. Returns the entity, marked as deleted, and raises on error.',
|
|
65
68
|
},
|
|
66
69
|
}
|
|
67
70
|
|
|
@@ -289,7 +292,7 @@ ${info.desc}
|
|
|
289
292
|
}
|
|
290
293
|
else if ('list' === opname) {
|
|
291
294
|
Content(`\`\`\`clojure
|
|
292
|
-
(doseq [${eLow} (e-${eLow}/list (api/${eLow} client nil)
|
|
295
|
+
(doseq [${eLow} (e-${eLow}/list (api/${eLow} client nil) ${cljListMatch(ent)} nil)]
|
|
293
296
|
(println ((:data-get ${eLow}))))
|
|
294
297
|
\`\`\`
|
|
295
298
|
|
|
@@ -7,11 +7,14 @@ import {
|
|
|
7
7
|
nom,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
+
import { cljListMatch } from './utility_clojure'
|
|
11
|
+
|
|
10
12
|
|
|
11
13
|
// A type-correct Clojure literal for a param: numeric/boolean/array/object
|
|
12
14
|
// params render a typed literal; strings render the quoted placeholder.
|
|
13
15
|
function cljLit(type: any, placeholder: string = 'example'): string {
|
|
14
16
|
const k = canonScalarKey(type)
|
|
17
|
+
if ('NULL' === k) return 'nil'
|
|
15
18
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
16
19
|
if ('BOOLEAN' === k) return 'true'
|
|
17
20
|
if ('ARRAY' === k) return '(vs/jt)'
|
|
@@ -52,7 +55,7 @@ const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
|
|
|
52
55
|
|
|
53
56
|
if (opnames.includes('list')) {
|
|
54
57
|
Content(`;; List all ${eLow}s (a vector of entities, one per record; raises on error)
|
|
55
|
-
(doseq [${eLow} (e-${eLow}/list (api/${eLow} client nil)
|
|
58
|
+
(doseq [${eLow} (e-${eLow}/list (api/${eLow} client nil) ${cljListMatch(exampleEntity)} nil)]
|
|
56
59
|
(println ((:data-get ${eLow}))))
|
|
57
60
|
`)
|
|
58
61
|
}
|
|
@@ -71,9 +74,9 @@ const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
|
|
|
71
74
|
it.name === idF ? 'example_id' : 'example_' + it.name)}`).join(' ')})`
|
|
72
75
|
: 'nil'
|
|
73
76
|
Content(`
|
|
74
|
-
;; Load a specific ${eLow} (returns the
|
|
77
|
+
;; Load a specific ${eLow} (returns the entity, raises on error)
|
|
75
78
|
(def ${eLow} (e-${eLow}/load (api/${eLow} client nil) ${loadArg} nil))
|
|
76
|
-
(println ${eLow})
|
|
79
|
+
(println ((:data-get ${eLow})))
|
|
77
80
|
`)
|
|
78
81
|
}
|
|
79
82
|
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, requiredItems } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
6
6
|
getModelPath,
|
|
7
7
|
} from '@voxgig/apidef'
|
|
8
8
|
|
|
9
|
+
import { cljString } from './utility_clojure'
|
|
10
|
+
|
|
9
11
|
|
|
10
12
|
// A type-correct Clojure literal for a field's canonical type.
|
|
11
13
|
function cljLit(type: any): string {
|
|
12
14
|
const k = canonScalarKey(type)
|
|
15
|
+
if ('NULL' === k) return 'nil'
|
|
13
16
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
14
17
|
if ('BOOLEAN' === k) return 'true'
|
|
15
18
|
if ('ARRAY' === k) return '(vs/jt)'
|
|
@@ -43,27 +46,31 @@ const ReadmeTopTest = cmp(function ReadmeTopTest(props: any) {
|
|
|
43
46
|
const idF = entityIdField(exampleEntity)
|
|
44
47
|
const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
|
|
45
48
|
let arg = 'nil'
|
|
46
|
-
if (isMatchOp) {
|
|
49
|
+
if (isMatchOp || ('list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length)) {
|
|
47
50
|
// Every REQUIRED match key (id first) — the same shape that generates
|
|
48
51
|
// the op's match handling.
|
|
49
|
-
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
50
|
-
.filter((it: any) => !it.optional || it.name === idF)
|
|
52
|
+
const items = (isMatchOp ? opRequestShape(exampleEntity, primaryOp).items
|
|
53
|
+
.filter((it: any) => !it.optional || it.name === idF) : requiredItems(exampleEntity, 'list'))
|
|
51
54
|
.sort((a: any, b: any) =>
|
|
52
55
|
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
53
56
|
arg = 0 < items.length
|
|
54
57
|
? `(vs/jm ${items.map((it: any) =>
|
|
55
|
-
|
|
58
|
+
`${cljString(it.name)} ${isMatchOp && it.name === idF ? '"test01"' : cljLit(it.type)}`).join(' ')})`
|
|
56
59
|
: 'nil'
|
|
57
60
|
} else if ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp) {
|
|
58
61
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
59
62
|
.filter((it: any) => it.name !== idF && it.name !== 'id')
|
|
60
63
|
const required = items.filter((it: any) => !it.optional)
|
|
61
64
|
const chosen = required.length ? required : items.slice(0, 3)
|
|
62
|
-
arg = `(vs/jm ${chosen.map((it: any) =>
|
|
65
|
+
arg = `(vs/jm ${chosen.map((it: any) => `${cljString(it.name)} ${cljLit(it.type)}`).join(' ')})`
|
|
63
66
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
(
|
|
67
|
+
Content('list' === primaryOp
|
|
68
|
+
? `(def ${eLow}s (e-${eLow}/list (api/${eLow} client nil) ${arg} nil))
|
|
69
|
+
(doseq [item ${eLow}s]
|
|
70
|
+
(println ((:data-get item))))
|
|
71
|
+
`
|
|
72
|
+
: `(def ${eLow} (e-${eLow}/${primaryOp} (api/${eLow} client nil) ${arg} nil))
|
|
73
|
+
(println ((:data-get ${eLow})))
|
|
67
74
|
`)
|
|
68
75
|
}
|
|
69
76
|
|
|
@@ -479,11 +479,11 @@ ${candidates(entity)}
|
|
|
479
479
|
(fn []
|
|
480
480
|
(let [cfg (core/make-clean-config (vs/jm "keys" "key,secret,token"))
|
|
481
481
|
ctx (atom {:options (vs/jm "__derived__" (vs/jm "clean" cfg))})
|
|
482
|
+
_ (core/u-clean-add-sensitive ctx (vs/jm "apikey" (vs/jm "value" "NESTED-SECRET-1")
|
|
483
|
+
"headers" (vs/jm "X-Api-Token" (vs/jt "LISTED-SECRET-2"))
|
|
484
|
+
"secret" 123456789
|
|
485
|
+
"name" "not-a-secret"))
|
|
482
486
|
values (vs/getprop cfg "values")]
|
|
483
|
-
(core/u-clean-add-sensitive ctx (vs/jm "apikey" (vs/jm "value" "NESTED-SECRET-1")
|
|
484
|
-
"headers" (vs/jm "X-Api-Token" (vs/jt "LISTED-SECRET-2"))
|
|
485
|
-
"secret" 123456789
|
|
486
|
-
"name" "not-a-secret"))
|
|
487
487
|
(t/is-true (.contains ^java.util.List values "NESTED-SECRET-1") "nested under apikey")
|
|
488
488
|
(t/is-true (.contains ^java.util.List values "LISTED-SECRET-2") "listed under a token header")
|
|
489
489
|
(t/is-true (.contains ^java.util.List values "123456789") "a number, as its text")
|
|
@@ -132,7 +132,8 @@
|
|
|
132
132
|
;; materialises the whole result). When the streaming feature is active the
|
|
133
133
|
;; result carries a `stream` thunk and this yields from it (honouring
|
|
134
134
|
;; chunkSize); otherwise it falls back to the materialised items, so stream
|
|
135
|
-
;; always yields.
|
|
135
|
+
;; always yields. An entity is yielded as its record, the struct map its
|
|
136
|
+
;; data-get returns.
|
|
136
137
|
;; `callopts` parameterises the call:
|
|
137
138
|
;; - ctrl: per-call pipeline control (threaded onto the op ctx);
|
|
138
139
|
;; - body: an async-iterable/list payload for outbound (upload) streaming,
|
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
walk,
|
|
7
7
|
} from '@voxgig/struct'
|
|
8
8
|
|
|
9
|
+
import { canonScalarKey, requiredItems } from '@voxgig/sdkgen'
|
|
10
|
+
|
|
9
11
|
|
|
10
12
|
function projectPath(suffix?: string): string {
|
|
11
13
|
return Path.normalize(Path.join(__dirname, '../../..', suffix ?? ''))
|
|
@@ -119,7 +121,19 @@ function cljStringChunks(json: string, maxBytes: number = 20000): string[] {
|
|
|
119
121
|
return 0 === chunks.length ? [''] : chunks
|
|
120
122
|
}
|
|
121
123
|
|
|
124
|
+
// A list's required route and query parameters, as the match it is called with.
|
|
125
|
+
function cljListMatch(entity: any): string {
|
|
126
|
+
const lit = (type: any): string =>
|
|
127
|
+
(({ NULL: 'nil', INTEGER: '1', NUMBER: '1', BOOLEAN: 'true', ARRAY: '(vs/jt)', OBJECT: '(vs/jm)' }) as any)[canonScalarKey(type)] ?? '"example"'
|
|
128
|
+
const items = requiredItems(entity, 'list')
|
|
129
|
+
return 0 < items.length
|
|
130
|
+
? `(vs/jm ${items.map((it: any) => `${cljString(it.name)} ${lit(it.type)}`).join(' ')})`
|
|
131
|
+
: 'nil'
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
|
|
122
135
|
export {
|
|
136
|
+
cljListMatch,
|
|
123
137
|
cljStringChunks,
|
|
124
138
|
clean,
|
|
125
139
|
formatCljValue,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
getModelPath,
|
|
7
7
|
} from '@voxgig/apidef'
|
|
8
8
|
|
|
9
|
-
import { cppVarName } from './utility_cpp'
|
|
9
|
+
import { cppVarName, cppListMatch } from './utility_cpp'
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
// Type names come from the shared canonToType 'cpp' column (single source of truth).
|
|
@@ -14,6 +14,7 @@ import { cppVarName } from './utility_cpp'
|
|
|
14
14
|
// A type-correct C++ literal for a field's canonical type.
|
|
15
15
|
function cppLit(type: any, placeholder: string = 'example'): string {
|
|
16
16
|
const k = canonScalarKey(type)
|
|
17
|
+
if ('NULL' === k) return 'Value(nullptr)'
|
|
17
18
|
if ('INTEGER' === k || 'NUMBER' === k) return 'Value(1)'
|
|
18
19
|
if ('BOOLEAN' === k) return 'Value(true)'
|
|
19
20
|
if ('ARRAY' === k) return 'vlist()'
|
|
@@ -140,7 +141,7 @@ std::cout << Struct::jsonify(${eVar}->data()) << std::endl;
|
|
|
140
141
|
Content(`#### Example: List
|
|
141
142
|
|
|
142
143
|
\`\`\`cpp
|
|
143
|
-
std::vector<SdkEntityPtr> ${eVar}s = client->${acc}()->list(
|
|
144
|
+
std::vector<SdkEntityPtr> ${eVar}s = client->${acc}()->list(${cppListMatch(entity)}, Value::undef());
|
|
144
145
|
for (const auto& ${eVar} : ${eVar}s) {
|
|
145
146
|
std::cout << Struct::jsonify(${eVar}->data()) << std::endl;
|
|
146
147
|
}
|
|
@@ -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 { cppVarName } from './utility_cpp'
|
|
9
|
+
import { cppVarName, cppEscape } from './utility_cpp'
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
// A type-correct C++ literal for a field's canonical type.
|
|
13
13
|
function cppLit(type: any): string {
|
|
14
14
|
const k = canonScalarKey(type)
|
|
15
|
+
if ('NULL' === k) return 'Value(nullptr)'
|
|
15
16
|
if ('INTEGER' === k || 'NUMBER' === k) return 'Value(1)'
|
|
16
17
|
if ('BOOLEAN' === k) return 'Value(true)'
|
|
17
18
|
if ('ARRAY' === k) return 'vlist()'
|
|
@@ -36,12 +37,15 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
|
|
|
36
37
|
let testArg = 'Value::undef()'
|
|
37
38
|
if (exampleEntity && isMatchOp) {
|
|
38
39
|
testArg = idF ? `vmap({{"${idF}", Value("test01")}})` : 'Value::undef()'
|
|
40
|
+
} else if (exampleEntity && 'list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length) {
|
|
41
|
+
const chosen = requiredItems(exampleEntity, 'list')
|
|
42
|
+
testArg = `vmap({${chosen.map((it: any) => `{"${cppEscape(it.name)}", ${cppLit(it.type)}}`).join(', ')}})`
|
|
39
43
|
} else if (exampleEntity && ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp)) {
|
|
40
44
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
41
45
|
.filter((it: any) => it.name !== idF && it.name !== 'id')
|
|
42
46
|
const required = items.filter((it: any) => !it.optional)
|
|
43
47
|
const chosen = required.length ? required : items.slice(0, 3)
|
|
44
|
-
testArg = `vmap({${chosen.map((it: any) => `{"${it.name}", ${cppLit(it.type)}}`).join(', ')}})`
|
|
48
|
+
testArg = `vmap({${chosen.map((it: any) => `{"${cppEscape(it.name)}", ${cppLit(it.type)}}`).join(', ')}})`
|
|
45
49
|
}
|
|
46
50
|
|
|
47
51
|
// The op-driven test-mode line, shown only when the SDK has an entity op.
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
nom,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
-
import { cppVarName } from './utility_cpp'
|
|
10
|
+
import { cppVarName, cppListMatch } from './utility_cpp'
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
|
|
@@ -57,6 +57,7 @@ ${ctor}
|
|
|
57
57
|
// params render a typed sdk::Value; strings render the quoted placeholder.
|
|
58
58
|
const cppLit = (type: any, placeholder: string = 'example'): string => {
|
|
59
59
|
const k = canonScalarKey(type)
|
|
60
|
+
if ('NULL' === k) return 'Value(nullptr)'
|
|
60
61
|
if ('INTEGER' === k || 'NUMBER' === k) return 'Value(1)'
|
|
61
62
|
if ('BOOLEAN' === k) return 'Value(true)'
|
|
62
63
|
if ('ARRAY' === k) return 'vlist()'
|
|
@@ -84,7 +85,7 @@ ${ctor}
|
|
|
84
85
|
|
|
85
86
|
\`\`\`cpp
|
|
86
87
|
try {
|
|
87
|
-
std::vector<SdkEntityPtr> ${eVar}s = client->${acc}()->list(
|
|
88
|
+
std::vector<SdkEntityPtr> ${eVar}s = client->${acc}()->list(${cppListMatch(exampleEntity)}, Value::undef());
|
|
88
89
|
for (const auto& ${eVar} : ${eVar}s) {
|
|
89
90
|
std::cout << Struct::jsonify(${eVar}->data()) << std::endl;
|
|
90
91
|
}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
getModelPath,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
-
import { cppVarName } from './utility_cpp'
|
|
10
|
+
import { cppVarName, cppListMatch } from './utility_cpp'
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
// Type names come from the shared canonToType 'cpp' column (single source of truth).
|
|
@@ -15,6 +15,7 @@ import { cppVarName } from './utility_cpp'
|
|
|
15
15
|
// A type-correct C++ literal for a field's canonical type.
|
|
16
16
|
function cppLit(type: any, placeholder: string = 'example'): string {
|
|
17
17
|
const k = canonScalarKey(type)
|
|
18
|
+
if ('NULL' === k) return 'Value(nullptr)'
|
|
18
19
|
if ('INTEGER' === k || 'NUMBER' === k) return 'Value(1)'
|
|
19
20
|
if ('BOOLEAN' === k) return 'Value(true)'
|
|
20
21
|
if ('ARRAY' === k) return 'vlist()'
|
|
@@ -45,9 +46,9 @@ const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string
|
|
|
45
46
|
desc: 'Update an existing entity. The data must include the entity `id`. Returns the updated entity and throws on error.',
|
|
46
47
|
},
|
|
47
48
|
patch: {
|
|
48
|
-
sig: 'patch(reqdata, ctrl) ->
|
|
49
|
-
returns: 'the patched entity
|
|
50
|
-
desc: 'Change part of an existing entity: only the fields given are sent. The data must include the entity `id`. Returns the patched entity
|
|
49
|
+
sig: 'patch(reqdata, ctrl) -> SdkEntityPtr',
|
|
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 and throws on error.',
|
|
51
52
|
},
|
|
52
53
|
remove: {
|
|
53
54
|
sig: 'remove(reqmatch, ctrl) -> SdkEntityPtr',
|
|
@@ -283,7 +284,7 @@ std::cout << Struct::jsonify(result->data()) << std::endl;
|
|
|
283
284
|
}
|
|
284
285
|
else if ('list' === opname) {
|
|
285
286
|
Content(`\`\`\`cpp
|
|
286
|
-
std::vector<SdkEntityPtr> results = client->${acc}()->list(
|
|
287
|
+
std::vector<SdkEntityPtr> results = client->${acc}()->list(${cppListMatch(ent)}, Value::undef());
|
|
287
288
|
for (const auto& ${acc} : results) {
|
|
288
289
|
std::cout << Struct::jsonify(${acc}->data()) << std::endl;
|
|
289
290
|
}
|
|
@@ -6,12 +6,13 @@ import {
|
|
|
6
6
|
getModelPath,
|
|
7
7
|
} from '@voxgig/apidef'
|
|
8
8
|
|
|
9
|
-
import { cppVarName } from './utility_cpp'
|
|
9
|
+
import { cppVarName, cppListMatch } from './utility_cpp'
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
// A type-correct C++ literal for a param.
|
|
13
13
|
function cppLit(type: any, placeholder: string = 'example'): string {
|
|
14
14
|
const k = canonScalarKey(type)
|
|
15
|
+
if ('NULL' === k) return 'Value(nullptr)'
|
|
15
16
|
if ('INTEGER' === k || 'NUMBER' === k) return 'Value(1)'
|
|
16
17
|
if ('BOOLEAN' === k) return 'Value(true)'
|
|
17
18
|
if ('ARRAY' === k) return 'vlist()'
|
|
@@ -58,7 +59,7 @@ ${ctor}
|
|
|
58
59
|
|
|
59
60
|
if (opnames.includes('list')) {
|
|
60
61
|
Content(`// List all ${acc}s (one entity per record, throws on error)
|
|
61
|
-
std::vector<SdkEntityPtr> ${eVar}s = client->${acc}()->list(
|
|
62
|
+
std::vector<SdkEntityPtr> ${eVar}s = client->${acc}()->list(${cppListMatch(exampleEntity)}, Value::undef());
|
|
62
63
|
for (const auto& ${eVar} : ${eVar}s) {
|
|
63
64
|
std::cout << Struct::jsonify(${eVar}->data()) << std::endl;
|
|
64
65
|
}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, requiredItems } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
6
6
|
getModelPath,
|
|
7
7
|
} from '@voxgig/apidef'
|
|
8
8
|
|
|
9
|
-
import { cppVarName } from './utility_cpp'
|
|
9
|
+
import { cppVarName, cppEscape } from './utility_cpp'
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
// A type-correct C++ literal for a field's canonical type.
|
|
13
13
|
function cppLit(type: any): string {
|
|
14
14
|
const k = canonScalarKey(type)
|
|
15
|
+
if ('NULL' === k) return 'Value(nullptr)'
|
|
15
16
|
if ('INTEGER' === k || 'NUMBER' === k) return 'Value(1)'
|
|
16
17
|
if ('BOOLEAN' === k) return 'Value(true)'
|
|
17
18
|
if ('ARRAY' === k) return 'vlist()'
|
|
@@ -37,21 +38,21 @@ auto client = ${model.const.Name}SDK::testSDK();
|
|
|
37
38
|
const idF = entityIdField(exampleEntity)
|
|
38
39
|
const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
|
|
39
40
|
let arg = 'Value::undef()'
|
|
40
|
-
if (isMatchOp) {
|
|
41
|
-
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
42
|
-
.filter((it: any) => !it.optional || it.name === idF)
|
|
41
|
+
if (isMatchOp || ('list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length)) {
|
|
42
|
+
const items = (isMatchOp ? opRequestShape(exampleEntity, primaryOp).items
|
|
43
|
+
.filter((it: any) => !it.optional || it.name === idF) : requiredItems(exampleEntity, 'list'))
|
|
43
44
|
.sort((a: any, b: any) =>
|
|
44
45
|
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
45
46
|
arg = 0 < items.length
|
|
46
47
|
? `vmap({${items.map((it: any) =>
|
|
47
|
-
`{"${it.name}", ${it.name === idF ? 'Value("test01")' : cppLit(it.type)}}`).join(', ')}})`
|
|
48
|
+
`{"${cppEscape(it.name)}", ${isMatchOp && it.name === idF ? 'Value("test01")' : cppLit(it.type)}}`).join(', ')}})`
|
|
48
49
|
: 'Value::undef()'
|
|
49
50
|
} else if ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp) {
|
|
50
51
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
51
52
|
.filter((it: any) => it.name !== idF && it.name !== 'id')
|
|
52
53
|
const required = items.filter((it: any) => !it.optional)
|
|
53
54
|
const chosen = required.length ? required : items.slice(0, 3)
|
|
54
|
-
arg = `vmap({${chosen.map((it: any) => `{"${it.name}", ${cppLit(it.type)}}`).join(', ')}})`
|
|
55
|
+
arg = `vmap({${chosen.map((it: any) => `{"${cppEscape(it.name)}", ${cppLit(it.type)}}`).join(', ')}})`
|
|
55
56
|
}
|
|
56
57
|
if ('list' === primaryOp) {
|
|
57
58
|
Content(`for (const auto& ${acc} : client->${acc}()->list(${arg}, Value::undef())) {
|
|
@@ -4,6 +4,8 @@ import {
|
|
|
4
4
|
walk,
|
|
5
5
|
} from '@voxgig/struct'
|
|
6
6
|
|
|
7
|
+
import { canonScalarKey, requiredItems } from '@voxgig/sdkgen'
|
|
8
|
+
|
|
7
9
|
|
|
8
10
|
const CPP_RESERVED = new Set<string>([
|
|
9
11
|
'alignas', 'alignof', 'and', 'and_eq', 'asm', 'auto', 'bitand', 'bitor',
|
|
@@ -97,8 +99,19 @@ function cppConfigLiterals(value: any): string {
|
|
|
97
99
|
return parts.join('\n')
|
|
98
100
|
}
|
|
99
101
|
|
|
102
|
+
// A list's required route and query parameters, as the match it is called with.
|
|
103
|
+
function cppListMatch(entity: any): string {
|
|
104
|
+
const lit = (type: any): string =>
|
|
105
|
+
(({ NULL: 'Value(nullptr)', INTEGER: 'Value(1)', NUMBER: 'Value(1)', BOOLEAN: 'Value(true)', ARRAY: 'vlist()', OBJECT: 'vmap()' }) as any)[canonScalarKey(type)] ?? 'Value("example")'
|
|
106
|
+
const items = requiredItems(entity, 'list')
|
|
107
|
+
return 0 < items.length
|
|
108
|
+
? `vmap({${items.map((it: any) => `{"${cppEscape(it.name)}", ${lit(it.type)}}`).join(', ')}})`
|
|
109
|
+
: 'Value::undef()'
|
|
110
|
+
}
|
|
111
|
+
|
|
100
112
|
|
|
101
113
|
export {
|
|
114
|
+
cppListMatch,
|
|
102
115
|
cleanModel,
|
|
103
116
|
cppConfigLiterals,
|
|
104
117
|
cppEscape,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
getModelPath,
|
|
7
7
|
} from '@voxgig/apidef'
|
|
8
8
|
|
|
9
|
-
import { csVarName } from './utility_csharp'
|
|
9
|
+
import { csVarName, csListMatch } from './utility_csharp'
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
// Type names come from the shared canonToType 'csharp' column (single source of truth).
|
|
@@ -14,6 +14,7 @@ import { csVarName } from './utility_csharp'
|
|
|
14
14
|
// A type-correct, JSON-serialisable C# literal for a field's canonical type.
|
|
15
15
|
function csLit(type: any, placeholder: string = 'example'): string {
|
|
16
16
|
const k = canonScalarKey(type)
|
|
17
|
+
if ('NULL' === k) return 'null'
|
|
17
18
|
if ('INTEGER' === k) return '1L'
|
|
18
19
|
if ('NUMBER' === k) return '1.0'
|
|
19
20
|
if ('BOOLEAN' === k) return 'true'
|
|
@@ -140,7 +141,7 @@ var ${eVar} = client.${entity.Name}().Load(${loadArg});
|
|
|
140
141
|
Content(`#### Example: List
|
|
141
142
|
|
|
142
143
|
\`\`\`csharp
|
|
143
|
-
var ${eVar}List = client.${entity.Name}().List(
|
|
144
|
+
var ${eVar}List = client.${entity.Name}().List(${csListMatch(entity)});
|
|
144
145
|
\`\`\`
|
|
145
146
|
|
|
146
147
|
`)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, isAuthActive, envName, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, isAuthActive, envName, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, requiredItems } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -7,12 +7,13 @@ import {
|
|
|
7
7
|
nom,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
-
import { csVarName } from './utility_csharp'
|
|
10
|
+
import { csVarName, csStringLiteral } from './utility_csharp'
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
// A type-correct C# literal for a field's canonical type.
|
|
14
14
|
function csLit(type: any): 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'
|
|
@@ -39,22 +40,33 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
|
|
|
39
40
|
let testArg = 'null'
|
|
40
41
|
if (exampleEntity && isMatchOp) {
|
|
41
42
|
testArg = idF ? `new Dictionary<string, object?> { ["${idF}"] = "test01" }` : 'null'
|
|
43
|
+
} else if (exampleEntity && 'list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length) {
|
|
44
|
+
const chosen = requiredItems(exampleEntity, 'list')
|
|
45
|
+
testArg = `new Dictionary<string, object?> {${chosen.map((it: any) =>
|
|
46
|
+
` [${csStringLiteral(it.name)}] = ${csLit(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 = `new Dictionary<string, object?> {${chosen.map((it: any) =>
|
|
48
|
-
` [
|
|
53
|
+
` [${csStringLiteral(it.name)}] = ${csLit(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
|
-
var ${eVar} = client.${eName}()
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
const testModeExample = 'list' === primaryOp
|
|
59
|
+
? `// List returns a list of entities, one per mock record; it raises on error.
|
|
60
|
+
var ${eVar}List = (List<object?>)client.${eName}().List(${testArg})!;
|
|
61
|
+
foreach (var ${eVar}Item in ${eVar}List)
|
|
62
|
+
{
|
|
63
|
+
Console.WriteLine(StructUtils.Jsonify(((IEntity)${eVar}Item!).Data()));
|
|
64
|
+
}`
|
|
65
|
+
: primaryOp
|
|
66
|
+
? `// Entity ops return the entity; they raise on error.
|
|
67
|
+
var ${eVar} = (IEntity)client.${eName}().${opMethod}(${testArg})!;
|
|
68
|
+
// Data() reads the entity's mock record
|
|
69
|
+
Console.WriteLine(StructUtils.Jsonify(${eVar}.Data()));`
|
|
58
70
|
: `var result = client.Direct(new Dictionary<string, object?>
|
|
59
71
|
{
|
|
60
72
|
["path"] = "/api/resource",
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
nom,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
-
import { csVarName } from './utility_csharp'
|
|
10
|
+
import { csVarName, csListMatch } from './utility_csharp'
|
|
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
|
|
|
38
38
|
\`\`\`csharp
|
|
39
39
|
using ${model.const.Name}Sdk;
|
|
40
|
+
using Voxgig.Struct;
|
|
40
41
|
|
|
41
42
|
var client = ${ctor};
|
|
42
43
|
\`\`\`
|
|
@@ -57,6 +58,7 @@ var client = ${ctor};
|
|
|
57
58
|
// A type-correct C# literal for a param.
|
|
58
59
|
const csLit = (type: any, placeholder: string = 'example'): string => {
|
|
59
60
|
const k = canonScalarKey(type)
|
|
61
|
+
if ('NULL' === k) return 'null'
|
|
60
62
|
if ('INTEGER' === k) return '1L'
|
|
61
63
|
if ('NUMBER' === k) return '1.0'
|
|
62
64
|
if ('BOOLEAN' === k) return 'true'
|
|
@@ -69,13 +71,16 @@ var client = ${ctor};
|
|
|
69
71
|
Content(`### 2. List ${eName.toLowerCase()} records
|
|
70
72
|
|
|
71
73
|
\`List(null)\` returns a list of entities, one per record (as \`object?\`), and
|
|
72
|
-
raises on error.
|
|
74
|
+
raises on error; an entity's \`Data()\` reads its record.
|
|
73
75
|
|
|
74
76
|
\`\`\`csharp
|
|
75
77
|
try
|
|
76
78
|
{
|
|
77
|
-
var ${eVar}List = client.${eName}().List(
|
|
78
|
-
|
|
79
|
+
var ${eVar}List = (List<object?>)client.${eName}().List(${csListMatch(exampleEntity)})!;
|
|
80
|
+
foreach (var ${eVar}Item in ${eVar}List)
|
|
81
|
+
{
|
|
82
|
+
Console.WriteLine(StructUtils.Jsonify(((IEntity)${eVar}Item!).Data()));
|
|
83
|
+
}
|
|
79
84
|
}
|
|
80
85
|
catch (Exception err)
|
|
81
86
|
{
|
|
@@ -114,8 +119,8 @@ ${neName} is nested under ${parentName}, so provide the \`${parentParam}\`.
|
|
|
114
119
|
\`\`\`csharp
|
|
115
120
|
try
|
|
116
121
|
{
|
|
117
|
-
var ${neVar} = client.${neName}().Load(new Dictionary<string, object?> { ${neMatch.join(', ')} })
|
|
118
|
-
Console.WriteLine(${neVar});
|
|
122
|
+
var ${neVar} = (IEntity)client.${neName}().Load(new Dictionary<string, object?> { ${neMatch.join(', ')} })!;
|
|
123
|
+
Console.WriteLine(StructUtils.Jsonify(${neVar}.Data()));
|
|
119
124
|
}
|
|
120
125
|
catch (Exception err)
|
|
121
126
|
{
|
|
@@ -145,8 +150,8 @@ catch (Exception err)
|
|
|
145
150
|
\`\`\`csharp
|
|
146
151
|
try
|
|
147
152
|
{
|
|
148
|
-
var ${eVar} = client.${eName}().Load(${loadArg})
|
|
149
|
-
Console.WriteLine(${eVar});
|
|
153
|
+
var ${eVar} = (IEntity)client.${eName}().Load(${loadArg})!;
|
|
154
|
+
Console.WriteLine(StructUtils.Jsonify(${eVar}.Data()));
|
|
150
155
|
}
|
|
151
156
|
catch (Exception err)
|
|
152
157
|
{
|