@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,7 +7,7 @@ import {
|
|
|
7
7
|
nom,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
-
import { ocamlVarName } from './utility_ocaml'
|
|
10
|
+
import { ocamlVarName, ocamlListMatch } from './utility_ocaml'
|
|
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
|
\`\`\`ocaml
|
|
38
38
|
open Voxgig_struct
|
|
39
39
|
open Sdk_helpers
|
|
40
|
+
open Sdk_types
|
|
40
41
|
|
|
41
42
|
let client = ${ctor}
|
|
42
43
|
\`\`\`
|
|
@@ -56,6 +57,7 @@ let client = ${ctor}
|
|
|
56
57
|
// A type-correct OCaml `value` literal for a param.
|
|
57
58
|
const ocamlLit = (type: any, placeholder: string = 'example'): string => {
|
|
58
59
|
const k = canonScalarKey(type)
|
|
60
|
+
if ('NULL' === k) return 'Null'
|
|
59
61
|
if ('INTEGER' === k || 'NUMBER' === k) return '(Num 1.)'
|
|
60
62
|
if ('BOOLEAN' === k) return '(Bool true)'
|
|
61
63
|
if ('ARRAY' === k) return '(empty_list ())'
|
|
@@ -71,7 +73,7 @@ record with \`e_data_get\`.
|
|
|
71
73
|
|
|
72
74
|
\`\`\`ocaml
|
|
73
75
|
(try
|
|
74
|
-
let ${fn}s = (Sdk_client.${fn} client Noval).e_list (
|
|
76
|
+
let ${fn}s = (Sdk_client.${fn} client Noval).e_list ${ocamlListMatch(exampleEntity)} Noval in
|
|
75
77
|
List.iter (fun e -> print_endline (stringify (e.e_data_get ()))) ${fn}s
|
|
76
78
|
with Sdk_error.E err -> Printf.eprintf "list failed: %s\\n" (Sdk_error.message err))
|
|
77
79
|
\`\`\`
|
|
@@ -158,7 +160,7 @@ record.
|
|
|
158
160
|
return it && it.type
|
|
159
161
|
}
|
|
160
162
|
const idValueFor = (opname: string): string => (null != dataIdF && opnames.includes('create'))
|
|
161
|
-
? `(getp created "${dataIdF}")`
|
|
163
|
+
? `(getp (created.e_data_get ()) "${dataIdF}")`
|
|
162
164
|
: ocamlLit(idParamType(opname), 'example_id')
|
|
163
165
|
|
|
164
166
|
if (opnames.includes('create') || opnames.includes('update') || opnames.includes('patch') ||
|
|
@@ -7,12 +7,13 @@ import {
|
|
|
7
7
|
getModelPath,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
-
import { ocamlVarName } from './utility_ocaml'
|
|
10
|
+
import { ocamlVarName, ocamlListMatch } from './utility_ocaml'
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
// A type-correct OCaml `value` literal. Strings render the quoted placeholder.
|
|
14
14
|
function ocamlLit(type: any, placeholder: string = 'example'): string {
|
|
15
15
|
const k = canonScalarKey(type)
|
|
16
|
+
if ('NULL' === k) return 'Null'
|
|
16
17
|
if ('INTEGER' === k || 'NUMBER' === k) return '(Num 1.)'
|
|
17
18
|
if ('BOOLEAN' === k) return '(Bool true)'
|
|
18
19
|
if ('ARRAY' === k) return '(empty_list ())'
|
|
@@ -39,32 +40,32 @@ const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string
|
|
|
39
40
|
load: {
|
|
40
41
|
sig: 'e_load reqmatch ctrl : entity_obj',
|
|
41
42
|
returns: 'the entity',
|
|
42
|
-
desc: 'Load a single entity matching the given criteria. Resolves to the
|
|
43
|
+
desc: 'Load a single entity matching the given criteria. Resolves to the entity, whose record `e_data_get` reads, and raises on error.',
|
|
43
44
|
},
|
|
44
45
|
list: {
|
|
45
46
|
sig: 'e_list reqmatch ctrl : entity_obj list',
|
|
46
47
|
returns: 'one entity per record',
|
|
47
|
-
desc: 'List entities matching the given criteria. The match is optional \u2014 pass `(empty_map ())` to list all records. Resolves to one
|
|
48
|
+
desc: 'List entities matching the given criteria. The match is optional \u2014 pass `(empty_map ())` to list all records. Resolves to one entity per record and raises on error.',
|
|
48
49
|
},
|
|
49
50
|
create: {
|
|
50
51
|
sig: 'e_create reqdata ctrl : entity_obj',
|
|
51
52
|
returns: 'the created entity',
|
|
52
|
-
desc: 'Create a new entity with the given data. Resolves to the
|
|
53
|
+
desc: 'Create a new entity with the given data. Resolves to the created entity and raises on error.',
|
|
53
54
|
},
|
|
54
55
|
update: {
|
|
55
56
|
sig: 'e_update reqdata ctrl : entity_obj',
|
|
56
57
|
returns: 'the updated entity',
|
|
57
|
-
desc: 'Update an existing entity. The data must include the entity `id`. Resolves to the
|
|
58
|
+
desc: 'Update an existing entity. The data must include the entity `id`. Resolves to the updated entity and raises on error.',
|
|
58
59
|
},
|
|
59
60
|
patch: {
|
|
60
61
|
sig: 'e_patch reqdata ctrl : entity_obj',
|
|
61
62
|
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`. Resolves to the
|
|
63
|
+
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 and raises on error.',
|
|
63
64
|
},
|
|
64
65
|
remove: {
|
|
65
66
|
sig: 'e_remove reqmatch ctrl : entity_obj',
|
|
66
67
|
returns: 'the removed entity',
|
|
67
|
-
desc: 'Remove the entity matching the given criteria. Resolves to the
|
|
68
|
+
desc: 'Remove the entity matching the given criteria. Resolves to the entity, marked as deleted (`e_deleted`); it keeps the data it held. Raises on error.',
|
|
68
69
|
},
|
|
69
70
|
}
|
|
70
71
|
|
|
@@ -95,6 +96,7 @@ Complete API reference for the ${model.Name} ${target.title} SDK.
|
|
|
95
96
|
Content(`\`\`\`ocaml
|
|
96
97
|
open Voxgig_struct
|
|
97
98
|
open Sdk_helpers
|
|
99
|
+
open Sdk_types
|
|
98
100
|
|
|
99
101
|
let client = Sdk_client.make options
|
|
100
102
|
\`\`\`
|
|
@@ -291,7 +293,7 @@ let result_data = result.e_data_get ()
|
|
|
291
293
|
else if ('list' === opname) {
|
|
292
294
|
Content(`\`\`\`ocaml
|
|
293
295
|
(* One ENTITY per record; the record is reached with e_data_get. *)
|
|
294
|
-
let results = (Sdk_client.${fn} client Noval).e_list (
|
|
296
|
+
let results = (Sdk_client.${fn} client Noval).e_list ${ocamlListMatch(ent)} Noval in
|
|
295
297
|
List.iter (fun e -> print_endline (stringify (e.e_data_get ()))) results
|
|
296
298
|
\`\`\`
|
|
297
299
|
|
|
@@ -6,13 +6,14 @@ import {
|
|
|
6
6
|
getModelPath,
|
|
7
7
|
} from '@voxgig/apidef'
|
|
8
8
|
|
|
9
|
-
import { ocamlVarName } from './utility_ocaml'
|
|
9
|
+
import { ocamlVarName, ocamlListMatch } from './utility_ocaml'
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
// A type-correct OCaml `value` literal for a param: numeric/boolean/array/
|
|
13
13
|
// object params render a typed literal; strings render the quoted placeholder.
|
|
14
14
|
function ocamlLit(type: any, placeholder: string = 'example'): string {
|
|
15
15
|
const k = canonScalarKey(type)
|
|
16
|
+
if ('NULL' === k) return 'Null'
|
|
16
17
|
if ('INTEGER' === k || 'NUMBER' === k) return '(Num 1.)'
|
|
17
18
|
if ('BOOLEAN' === k) return '(Bool true)'
|
|
18
19
|
if ('ARRAY' === k) return '(empty_list ())'
|
|
@@ -36,6 +37,7 @@ const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
|
|
|
36
37
|
Content(`\`\`\`ocaml
|
|
37
38
|
open Voxgig_struct
|
|
38
39
|
open Sdk_helpers
|
|
40
|
+
open Sdk_types
|
|
39
41
|
|
|
40
42
|
let () =
|
|
41
43
|
let client = ${ctor} in
|
|
@@ -50,7 +52,7 @@ let () =
|
|
|
50
52
|
|
|
51
53
|
if (opnames.includes('list')) {
|
|
52
54
|
Content(` (* List all ${fn} records (one ENTITY per record; raises on error) *)
|
|
53
|
-
let ${fn}s = (Sdk_client.${fn} client Noval).e_list (
|
|
55
|
+
let ${fn}s = (Sdk_client.${fn} client Noval).e_list ${ocamlListMatch(exampleEntity)} Noval in
|
|
54
56
|
List.iter (fun e -> print_endline (stringify (e.e_data_get ()))) ${fn}s;
|
|
55
57
|
`)
|
|
56
58
|
}
|
|
@@ -6,12 +6,13 @@ import {
|
|
|
6
6
|
getModelPath,
|
|
7
7
|
} from '@voxgig/apidef'
|
|
8
8
|
|
|
9
|
-
import { ocamlOpField, ocamlVarName } from './utility_ocaml'
|
|
9
|
+
import { ocamlListMatch, ocamlOpField, ocamlVarName } from './utility_ocaml'
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
// A type-correct OCaml `value` literal for a field's canonical type.
|
|
13
13
|
function ocamlLit(type: any): string {
|
|
14
14
|
const k = canonScalarKey(type)
|
|
15
|
+
if ('NULL' === k) return 'Null'
|
|
15
16
|
if ('INTEGER' === k || 'NUMBER' === k) return '(Num 1.)'
|
|
16
17
|
if ('BOOLEAN' === k) return '(Bool true)'
|
|
17
18
|
if ('ARRAY' === k) return '(empty_list ())'
|
|
@@ -41,7 +42,7 @@ let () =
|
|
|
41
42
|
const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
|
|
42
43
|
let arg = 'Noval'
|
|
43
44
|
if ('list' === primaryOp) {
|
|
44
|
-
arg =
|
|
45
|
+
arg = ocamlListMatch(exampleEntity)
|
|
45
46
|
} else if (isMatchOp) {
|
|
46
47
|
// Every REQUIRED match key (id first).
|
|
47
48
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
walk,
|
|
5
5
|
} from '@voxgig/struct'
|
|
6
6
|
|
|
7
|
-
import { sdkName } from '@voxgig/sdkgen'
|
|
7
|
+
import { sdkName, canonScalarKey, requiredItems } from '@voxgig/sdkgen'
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
// OCaml keywords that are illegal as a lowercase identifier. sdkgen's shared
|
|
@@ -151,10 +151,22 @@ function clean(o: any, dropDefaults?: boolean): any {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
|
|
154
|
+
// A list's required route and query parameters, as the match it is called with.
|
|
155
|
+
function ocamlListMatch(entity: any): string {
|
|
156
|
+
const lit = (type: any): string =>
|
|
157
|
+
(({ NULL: 'Null', INTEGER: '(Num 1.)', NUMBER: '(Num 1.)', BOOLEAN: '(Bool true)', ARRAY: '(empty_list ())', OBJECT: '(empty_map ())' }) as any)[canonScalarKey(type)] ?? '(Str "example")'
|
|
158
|
+
const items = requiredItems(entity, 'list')
|
|
159
|
+
return 0 < items.length
|
|
160
|
+
? `(jo [${items.map((it: any) => `("${ocamlString(it.name)}", ${lit(it.type)})`).join('; ')}])`
|
|
161
|
+
: '(empty_map ())'
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
|
|
154
165
|
export {
|
|
155
166
|
clean,
|
|
156
167
|
entityModule,
|
|
157
168
|
formatOcamlValue,
|
|
169
|
+
ocamlListMatch,
|
|
158
170
|
ocamlOpField,
|
|
159
171
|
ocamlString,
|
|
160
172
|
ocamlVarName,
|
|
@@ -6,12 +6,15 @@ import {
|
|
|
6
6
|
getModelPath,
|
|
7
7
|
} from '@voxgig/apidef'
|
|
8
8
|
|
|
9
|
+
import { perlListArgs } from './utility_perl'
|
|
10
|
+
|
|
9
11
|
|
|
10
12
|
// A type-correct, executable Perl literal for a field's canonical type. The
|
|
11
13
|
// create example is EXECUTED by the doc test, so a placeholder must be a real
|
|
12
14
|
// value. Strings render the quoted placeholder.
|
|
13
15
|
function perlLit(type: any, placeholder: string = 'example'): string {
|
|
14
16
|
const k = canonScalarKey(type)
|
|
17
|
+
if ('NULL' === k) return 'undef'
|
|
15
18
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
16
19
|
if ('BOOLEAN' === k) return '1'
|
|
17
20
|
if ('ARRAY' === k) return '[]'
|
|
@@ -146,7 +149,7 @@ my $${eVar} = $client->${entity.Name}->load(${loadArg});
|
|
|
146
149
|
|
|
147
150
|
\`\`\`perl
|
|
148
151
|
# an arrayref of entities, one per record; data_get reads each record
|
|
149
|
-
my $${eVar}s = $client->${entity.Name}->list;
|
|
152
|
+
my $${eVar}s = $client->${entity.Name}->list${perlListArgs(entity)};
|
|
150
153
|
print $_->data_get->{id}, "\\n" for @$${eVar}s;
|
|
151
154
|
\`\`\`
|
|
152
155
|
|
|
@@ -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,10 +7,13 @@ import {
|
|
|
7
7
|
nom,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
+
import { perlStringLiteral } from './utility_perl'
|
|
11
|
+
|
|
10
12
|
|
|
11
13
|
// A type-correct Perl literal for a field's canonical type.
|
|
12
14
|
function perlLit(type: any): string {
|
|
13
15
|
const k = canonScalarKey(type)
|
|
16
|
+
if ('NULL' === k) return 'undef'
|
|
14
17
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
15
18
|
if ('BOOLEAN' === k) return '1'
|
|
16
19
|
if ('ARRAY' === k) return '[]'
|
|
@@ -35,21 +38,23 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
|
|
|
35
38
|
let testArg = ''
|
|
36
39
|
if (exampleEntity && isMatchOp) {
|
|
37
40
|
testArg = idF ? `{ '${idF}' => 'test01' }` : ''
|
|
41
|
+
} else if (exampleEntity && 'list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length) {
|
|
42
|
+
const chosen = requiredItems(exampleEntity, 'list')
|
|
43
|
+
testArg = `{ ${chosen.map((it: any) => `${perlStringLiteral(it.name)} => ${perlLit(it.type)}`).join(', ')} }`
|
|
38
44
|
} else if (exampleEntity && ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp)) {
|
|
39
45
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
40
46
|
.filter((it: any) => it.name !== idF && it.name !== 'id')
|
|
41
47
|
const required = items.filter((it: any) => !it.optional)
|
|
42
48
|
const chosen = required.length ? required : items.slice(0, 3)
|
|
43
|
-
testArg = `{ ${chosen.map((it: any) =>
|
|
49
|
+
testArg = `{ ${chosen.map((it: any) => `${perlStringLiteral(it.name)} => ${perlLit(it.type)}`).join(', ')} }`
|
|
44
50
|
}
|
|
45
51
|
|
|
46
52
|
// The op-driven test-mode line, shown only when the SDK has an entity op.
|
|
47
53
|
// A direct()-only SDK (no ops anywhere) shows a direct() call instead.
|
|
48
54
|
const testModeExample = primaryOp
|
|
49
|
-
? `# Entity ops return the
|
|
50
|
-
# call data_get for the record.
|
|
55
|
+
? `# Entity ops return the entity, and list one per record; they die on error.
|
|
51
56
|
my $${eVar} = $client->${eName}->${primaryOp}(${testArg});
|
|
52
|
-
#
|
|
57
|
+
# data_get on an entity reads its mock response record`
|
|
53
58
|
: `my $result = $client->direct({ 'path' => '/api/resource', 'method' => 'GET' });
|
|
54
59
|
print $result->{ok}, "\\n";`
|
|
55
60
|
|
|
@@ -19,12 +19,12 @@ const ReadmeModel = cmp(function ReadmeModel(props: any) {
|
|
|
19
19
|
entityList.forEach((e: any) => Object.keys(e.op || {})
|
|
20
20
|
.forEach((o: string) => { if (e.op[o] && e.op[o].active !== false) opUnion.add(o) }))
|
|
21
21
|
const opRowDefs: Record<string, string> = {
|
|
22
|
-
load: '| `load` | `($reqmatch, $ctrl) ->
|
|
23
|
-
list: '| `list` | `($reqmatch, $ctrl) -> arrayref` | List entities matching the criteria
|
|
24
|
-
create: '| `create` | `($reqdata, $ctrl) ->
|
|
25
|
-
update: '| `update` | `($reqdata, $ctrl) ->
|
|
26
|
-
patch: '| `patch` | `($reqdata, $ctrl) ->
|
|
27
|
-
remove: '| `remove` | `($reqmatch, $ctrl) ->
|
|
22
|
+
load: '| `load` | `($reqmatch, $ctrl) -> entity` | Load a single entity by match criteria, and return it. Dies on error. |',
|
|
23
|
+
list: '| `list` | `($reqmatch, $ctrl) -> arrayref` | List entities matching the criteria, one per record. Dies on error. |',
|
|
24
|
+
create: '| `create` | `($reqdata, $ctrl) -> entity` | Create a new entity, and return it. Dies on error. |',
|
|
25
|
+
update: '| `update` | `($reqdata, $ctrl) -> entity` | Update an existing entity, and return it. Dies on error. |',
|
|
26
|
+
patch: '| `patch` | `($reqdata, $ctrl) -> entity` | Change part of an existing entity, and return it. Dies on error. |',
|
|
27
|
+
remove: '| `remove` | `($reqmatch, $ctrl) -> entity` | Remove an entity, and return it marked as deleted. Dies on error. |',
|
|
28
28
|
}
|
|
29
29
|
const opRows = ['load', 'list', 'create', 'update', 'patch', 'remove']
|
|
30
30
|
.filter((o) => opUnion.has(o)).map((o) => opRowDefs[o]).join('\n')
|
|
@@ -7,6 +7,8 @@ import {
|
|
|
7
7
|
nom,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
+
import { perlListArgs } from './utility_perl'
|
|
11
|
+
|
|
10
12
|
|
|
11
13
|
const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
|
|
12
14
|
const { target, ctx$: { model } } = props
|
|
@@ -56,6 +58,7 @@ my $client = ${ctor};
|
|
|
56
58
|
// A type-correct, executable Perl literal for a param.
|
|
57
59
|
const perlLit = (type: any, placeholder: string = 'example'): string => {
|
|
58
60
|
const k = canonScalarKey(type)
|
|
61
|
+
if ('NULL' === k) return 'undef'
|
|
59
62
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
60
63
|
if ('BOOLEAN' === k) return '1'
|
|
61
64
|
if ('ARRAY' === k) return '[]'
|
|
@@ -70,7 +73,7 @@ my $client = ${ctor};
|
|
|
70
73
|
error; \`data_get\` reads each record.
|
|
71
74
|
|
|
72
75
|
\`\`\`perl
|
|
73
|
-
my $${eVar}s = eval { $client->${eName}->list };
|
|
76
|
+
my $${eVar}s = eval { $client->${eName}->list${perlListArgs(exampleEntity)} };
|
|
74
77
|
if (my $err = $@) {
|
|
75
78
|
print "list failed: $err\\n";
|
|
76
79
|
}
|
|
@@ -114,7 +117,7 @@ if (my $err = $@) {
|
|
|
114
117
|
print "load failed: $err\\n";
|
|
115
118
|
}
|
|
116
119
|
else {
|
|
117
|
-
print
|
|
120
|
+
print $${neVar}->data_get->{id}, "\\n";
|
|
118
121
|
}
|
|
119
122
|
\`\`\`
|
|
120
123
|
|
|
@@ -141,7 +144,7 @@ if (my $err = $@) {
|
|
|
141
144
|
print "load failed: $err\\n";
|
|
142
145
|
}
|
|
143
146
|
else {
|
|
144
|
-
print
|
|
147
|
+
print $${eVar}->data_get->{id}, "\\n";
|
|
145
148
|
}
|
|
146
149
|
\`\`\`
|
|
147
150
|
|
|
@@ -169,7 +172,7 @@ else {
|
|
|
169
172
|
return it && it.type
|
|
170
173
|
}
|
|
171
174
|
const idValueFor = (opname: string): string => (null != dataIdF && opnames.includes('create'))
|
|
172
|
-
? `$created->{${dataIdF}}`
|
|
175
|
+
? `$created->data_get->{${dataIdF}}`
|
|
173
176
|
: perlLit(idParamType(opname), 'example_id')
|
|
174
177
|
|
|
175
178
|
if (opnames.includes('create') || opnames.includes('update') || opnames.includes('patch') ||
|
|
@@ -187,7 +190,7 @@ my $created = $client->${eName}->create({ ${examplePairs('create').join(', ')} }
|
|
|
187
190
|
if (opnames.includes('update')) {
|
|
188
191
|
const updatePairs = (idF ? [`'${idF}' => ${idValueFor('update')}`] : []).concat(examplePairs('update'))
|
|
189
192
|
const fromCreated = null != dataIdF && opnames.includes('create')
|
|
190
|
-
Content(`# Update${fromCreated ? " — the created
|
|
193
|
+
Content(`# Update${fromCreated ? " — the created entity's record holds its id" : ''}
|
|
191
194
|
$client->${eName}->update({ ${updatePairs.join(', ')} });
|
|
192
195
|
|
|
193
196
|
`)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, each, Content, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape , targetFeatures, opNeedsAction, bodyNote } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, each, Content, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape , targetFeatures, opNeedsAction, bodyNote, entityClassName, entityCollection } from '@voxgig/sdkgen'
|
|
3
3
|
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
4
4
|
|
|
5
5
|
import {
|
|
@@ -7,10 +7,13 @@ import {
|
|
|
7
7
|
getModelPath,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
+
import { perlListArgs } from './utility_perl'
|
|
11
|
+
|
|
10
12
|
|
|
11
13
|
// A type-correct, executable Perl literal for a field's canonical type.
|
|
12
14
|
function perlLit(type: any, placeholder: string = 'example'): string {
|
|
13
15
|
const k = canonScalarKey(type)
|
|
16
|
+
if ('NULL' === k) return 'undef'
|
|
14
17
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
15
18
|
if ('BOOLEAN' === k) return '1'
|
|
16
19
|
if ('ARRAY' === k) return '[]'
|
|
@@ -32,9 +35,9 @@ function perlType(type: any): string {
|
|
|
32
35
|
|
|
33
36
|
const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string }> = {
|
|
34
37
|
load: {
|
|
35
|
-
sig: 'load($reqmatch, $ctrl) ->
|
|
36
|
-
returns: 'the entity
|
|
37
|
-
desc: 'Load a single entity matching the given criteria. Returns the entity
|
|
38
|
+
sig: 'load($reqmatch, $ctrl) -> EntyClass',
|
|
39
|
+
returns: 'the entity',
|
|
40
|
+
desc: 'Load a single entity matching the given criteria. Returns the entity, whose record `data_get` reads, and dies on error.',
|
|
38
41
|
},
|
|
39
42
|
list: {
|
|
40
43
|
sig: 'list($reqmatch, $ctrl) -> arrayref',
|
|
@@ -42,24 +45,24 @@ const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string
|
|
|
42
45
|
desc: 'List entities matching the given criteria. The match is optional — call `list` with no argument to list all records. Returns an arrayref of entities, one per record (`data_get` reads each record), and dies on error.',
|
|
43
46
|
},
|
|
44
47
|
create: {
|
|
45
|
-
sig: 'create($reqdata, $ctrl) ->
|
|
46
|
-
returns: 'the created entity
|
|
47
|
-
desc: 'Create a new entity with the given data. Returns the created entity
|
|
48
|
+
sig: 'create($reqdata, $ctrl) -> EntyClass',
|
|
49
|
+
returns: 'the created entity',
|
|
50
|
+
desc: 'Create a new entity with the given data. Returns the created entity and dies on error.',
|
|
48
51
|
},
|
|
49
52
|
update: {
|
|
50
|
-
sig: 'update($reqdata, $ctrl) ->
|
|
51
|
-
returns: 'the updated entity
|
|
52
|
-
desc: 'Update an existing entity. The data must include the entity `id`. Returns the updated entity
|
|
53
|
+
sig: 'update($reqdata, $ctrl) -> EntyClass',
|
|
54
|
+
returns: 'the updated entity',
|
|
55
|
+
desc: 'Update an existing entity. The data must include the entity `id`. Returns the updated entity and dies on error.',
|
|
53
56
|
},
|
|
54
57
|
patch: {
|
|
55
|
-
sig: 'patch($reqdata, $ctrl) ->
|
|
56
|
-
returns: 'the patched entity
|
|
57
|
-
desc: 'Change part of an existing entity: only the fields given are sent. The data must include the entity `id`. Returns the patched entity
|
|
58
|
+
sig: 'patch($reqdata, $ctrl) -> EntyClass',
|
|
59
|
+
returns: 'the patched entity',
|
|
60
|
+
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 dies on error.',
|
|
58
61
|
},
|
|
59
62
|
remove: {
|
|
60
|
-
sig: 'remove($reqmatch, $ctrl) ->
|
|
61
|
-
returns: 'the removed entity
|
|
62
|
-
desc: 'Remove the entity matching the given criteria.
|
|
63
|
+
sig: 'remove($reqmatch, $ctrl) -> EntyClass',
|
|
64
|
+
returns: 'the removed entity',
|
|
65
|
+
desc: 'Remove the entity matching the given criteria. Returns the entity, marked as deleted, and dies on error.',
|
|
63
66
|
},
|
|
64
67
|
}
|
|
65
68
|
|
|
@@ -258,7 +261,7 @@ my $${eVar} = $client->${ent.Name};
|
|
|
258
261
|
const info = OP_SIGNATURES[opname]
|
|
259
262
|
if (!info) return
|
|
260
263
|
|
|
261
|
-
Content(`#### \`${info.sig}\`
|
|
264
|
+
Content(`#### \`${info.sig.replace('EntyClass', entityClassName(ent, entityCollection(model)))}\`
|
|
262
265
|
|
|
263
266
|
${info.desc}
|
|
264
267
|
|
|
@@ -286,7 +289,7 @@ my $result = $client->${ent.Name}->${opname}(${arg});
|
|
|
286
289
|
}
|
|
287
290
|
else if ('list' === opname) {
|
|
288
291
|
Content(`\`\`\`perl
|
|
289
|
-
my $results = $client->${ent.Name}->list;
|
|
292
|
+
my $results = $client->${ent.Name}->list${perlListArgs(ent)};
|
|
290
293
|
for my $${eVar} (@$results) {
|
|
291
294
|
print $${eVar}->data_get->{id}, "\\n";
|
|
292
295
|
}
|
|
@@ -7,6 +7,8 @@ import {
|
|
|
7
7
|
nom,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
+
import { perlListArgs } from './utility_perl'
|
|
11
|
+
|
|
10
12
|
|
|
11
13
|
// A type-correct, executable Perl literal for a param: numeric/boolean/
|
|
12
14
|
// array/hash params render a typed literal; strings render the quoted
|
|
@@ -14,6 +16,7 @@ import {
|
|
|
14
16
|
// would break it).
|
|
15
17
|
function perlLit(type: any, placeholder: string = 'example'): string {
|
|
16
18
|
const k = canonScalarKey(type)
|
|
19
|
+
if ('NULL' === k) return 'undef'
|
|
17
20
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
18
21
|
if ('BOOLEAN' === k) return '1'
|
|
19
22
|
if ('ARRAY' === k) return '[]'
|
|
@@ -50,7 +53,7 @@ my $client = ${ctor};
|
|
|
50
53
|
|
|
51
54
|
if (opnames.includes('list')) {
|
|
52
55
|
Content(`# List all ${eName.toLowerCase()}s (an arrayref of entities, one per record; dies on error)
|
|
53
|
-
my $${eVar}s = $client->${eName}->list;
|
|
56
|
+
my $${eVar}s = $client->${eName}->list${perlListArgs(exampleEntity)};
|
|
54
57
|
for my $${eVar} (@$${eVar}s) {
|
|
55
58
|
print $${eVar}->data_get->{id}, "\\n";
|
|
56
59
|
}
|
|
@@ -71,9 +74,9 @@ for my $${eVar} (@$${eVar}s) {
|
|
|
71
74
|
it.name === idF ? 'example_id' : 'example_' + it.name)}`).join(', ')} }`
|
|
72
75
|
: ''
|
|
73
76
|
Content(`
|
|
74
|
-
# Load a specific ${eName.toLowerCase()} (returns the
|
|
77
|
+
# Load a specific ${eName.toLowerCase()} (returns the entity; data_get reads its record; dies on error)
|
|
75
78
|
my $${eVar} = $client->${eName}->load(${loadArg});
|
|
76
|
-
print
|
|
79
|
+
print $${eVar}->data_get->{id}, "\\n";
|
|
77
80
|
`)
|
|
78
81
|
}
|
|
79
82
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, requiredItems } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -7,10 +7,13 @@ import {
|
|
|
7
7
|
nom,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
+
import { perlStringLiteral } from './utility_perl'
|
|
11
|
+
|
|
10
12
|
|
|
11
13
|
// A type-correct Perl literal for a field's canonical type.
|
|
12
14
|
function perlLit(type: any): string {
|
|
13
15
|
const k = canonScalarKey(type)
|
|
16
|
+
if ('NULL' === k) return 'undef'
|
|
14
17
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
15
18
|
if ('BOOLEAN' === k) return '1'
|
|
16
19
|
if ('ARRAY' === k) return '[]'
|
|
@@ -40,34 +43,34 @@ my $client = ${model.const.Name}SDK->test(undef, undef);
|
|
|
40
43
|
const idF = entityIdField(exampleEntity)
|
|
41
44
|
const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
|
|
42
45
|
let arg = ''
|
|
43
|
-
if (isMatchOp) {
|
|
46
|
+
if (isMatchOp || ('list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length)) {
|
|
44
47
|
// Every REQUIRED match key (id first) — the same shape that generates
|
|
45
48
|
// the op's match resolution, so the block runs offline against a seeded
|
|
46
49
|
// fixture.
|
|
47
|
-
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
48
|
-
.filter((it: any) => !it.optional || it.name === idF)
|
|
50
|
+
const items = (isMatchOp ? opRequestShape(exampleEntity, primaryOp).items
|
|
51
|
+
.filter((it: any) => !it.optional || it.name === idF) : requiredItems(exampleEntity, 'list'))
|
|
49
52
|
.sort((a: any, b: any) =>
|
|
50
53
|
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
51
54
|
arg = 0 < items.length
|
|
52
55
|
? `{ ${items.map((it: any) =>
|
|
53
|
-
|
|
56
|
+
`${perlStringLiteral(it.name)} => ${isMatchOp && it.name === idF ? "'test01'" : perlLit(it.type)}`).join(', ')} }`
|
|
54
57
|
: ''
|
|
55
58
|
} else if ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp) {
|
|
56
59
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
57
60
|
.filter((it: any) => it.name !== idF && it.name !== 'id')
|
|
58
61
|
const required = items.filter((it: any) => !it.optional)
|
|
59
62
|
const chosen = required.length ? required : items.slice(0, 3)
|
|
60
|
-
arg = `{ ${chosen.map((it: any) =>
|
|
63
|
+
arg = `{ ${chosen.map((it: any) => `${perlStringLiteral(it.name)} => ${perlLit(it.type)}`).join(', ')} }`
|
|
61
64
|
}
|
|
62
65
|
// A list() result is an arrayref — name the variable accordingly.
|
|
63
66
|
const eVar = eName.toLowerCase() + ('list' === primaryOp ? 's' : '')
|
|
64
67
|
Content(`my $${eVar} = $client->${eName}->${primaryOp}(${arg});
|
|
65
68
|
`)
|
|
66
69
|
if ('list' === primaryOp) {
|
|
67
|
-
Content(`print
|
|
70
|
+
Content(`print $_->data_get->{id}, "\\n" for @$${eVar};
|
|
68
71
|
`)
|
|
69
72
|
} else {
|
|
70
|
-
Content(`print
|
|
73
|
+
Content(`print $${eVar}->data_get->{id}, "\\n";
|
|
71
74
|
`)
|
|
72
75
|
}
|
|
73
76
|
}
|
|
@@ -138,7 +138,7 @@ sub match_get {
|
|
|
138
138
|
# result). When the streaming feature is active the result carries a `stream`
|
|
139
139
|
# coderef and this yields from it (honouring chunkSize / chunkDelay); else it
|
|
140
140
|
# falls back to yielding the materialised items so stream() always yields.
|
|
141
|
-
#
|
|
141
|
+
# An entity is yielded as its record, the hashref its data_get returns.
|
|
142
142
|
#
|
|
143
143
|
# $callopts parameterises the call:
|
|
144
144
|
# - ctrl: per-call pipeline control (threaded onto the op ctx);
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
# Create a new EntityName.
|
|
4
4
|
#
|
|
5
5
|
# reqdata: body data hashref (EntityNameCreateData shape). ctrl: optional
|
|
6
|
-
# per-call control. Returns the created EntityName
|
|
7
|
-
# with ProjectNameError on failure.
|
|
6
|
+
# per-call control. Returns the created EntityName entity (data_get reads
|
|
7
|
+
# its record); dies with ProjectNameError on failure.
|
|
8
8
|
sub create {
|
|
9
9
|
my ($self, $reqdata, $ctrl) = @_;
|
|
10
10
|
my $utility = $self->{_utility};
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
# reqmatch: match criteria hashref (id/query fields; EntityNameLoadMatch
|
|
6
6
|
# shape); optional - an entity with no id-like key loads with no match
|
|
7
7
|
# (undef is treated as an empty match). ctrl: optional per-call control.
|
|
8
|
-
# Returns the loaded EntityName
|
|
9
|
-
# on failure.
|
|
8
|
+
# Returns the loaded EntityName entity (data_get reads its record); dies
|
|
9
|
+
# with ProjectNameError on failure.
|
|
10
10
|
sub load {
|
|
11
11
|
my ($self, $reqmatch, $ctrl) = @_;
|
|
12
12
|
my $utility = $self->{_utility};
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
# Change part of an existing EntityName: only the fields given are sent.
|
|
4
4
|
#
|
|
5
5
|
# reqdata: body data hashref (EntityNamePatchData shape). ctrl: optional
|
|
6
|
-
# per-call control. Returns the patched EntityName
|
|
7
|
-
# with ProjectNameError on failure.
|
|
6
|
+
# per-call control. Returns the patched EntityName entity (data_get reads
|
|
7
|
+
# its record); dies with ProjectNameError on failure.
|
|
8
8
|
sub patch {
|
|
9
9
|
my ($self, $reqdata, $ctrl) = @_;
|
|
10
10
|
my $utility = $self->{_utility};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
#
|
|
5
5
|
# reqmatch: match criteria hashref (id/query fields; EntityNameRemoveMatch
|
|
6
6
|
# shape). ctrl: optional per-call control. Returns the removed EntityName
|
|
7
|
-
#
|
|
7
|
+
# entity, marked as deleted; dies with ProjectNameError on failure.
|
|
8
8
|
sub remove {
|
|
9
9
|
my ($self, $reqmatch, $ctrl) = @_;
|
|
10
10
|
my $utility = $self->{_utility};
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
# Update an existing EntityName.
|
|
4
4
|
#
|
|
5
5
|
# reqdata: body data hashref (EntityNameUpdateData shape). ctrl: optional
|
|
6
|
-
# per-call control. Returns the updated EntityName
|
|
7
|
-
# with ProjectNameError on failure.
|
|
6
|
+
# per-call control. Returns the updated EntityName entity (data_get reads
|
|
7
|
+
# its record); dies with ProjectNameError on failure.
|
|
8
8
|
sub update {
|
|
9
9
|
my ($self, $reqdata, $ctrl) = @_;
|
|
10
10
|
my $utility = $self->{_utility};
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
walk,
|
|
7
7
|
} from '@voxgig/struct'
|
|
8
8
|
|
|
9
|
-
import { targetFeatures } from '@voxgig/sdkgen'
|
|
9
|
+
import { targetFeatures, canonScalarKey, requiredItems } from '@voxgig/sdkgen'
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
function projectPath(suffix?: string): string {
|
|
@@ -71,8 +71,18 @@ function perlVersionLabel(version: string): string {
|
|
|
71
71
|
return major + '.' + Number(minor.slice(0, 3))
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
function perlListArgs(entity: any): string {
|
|
75
|
+
const lit = (type: any): string =>
|
|
76
|
+
(({ NULL: 'undef', INTEGER: '1', NUMBER: '1', BOOLEAN: '1', ARRAY: '[]', OBJECT: '{}' }) as any)[canonScalarKey(type)] ?? "'example'"
|
|
77
|
+
const items = requiredItems(entity, 'list')
|
|
78
|
+
return 0 < items.length
|
|
79
|
+
? `({ ${items.map((it: any) => `${perlStringLiteral(it.name)} => ${lit(it.type)}`).join(', ')} })`
|
|
80
|
+
: ''
|
|
81
|
+
}
|
|
82
|
+
|
|
74
83
|
|
|
75
84
|
export {
|
|
85
|
+
perlListArgs,
|
|
76
86
|
perlStringLiteral,
|
|
77
87
|
clean,
|
|
78
88
|
projectPath,
|