@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
|
getModelPath,
|
|
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
|
// Type names come from the shared canonToType 'csharp' column (single source of truth).
|
|
@@ -15,6 +15,7 @@ import { csVarName } from './utility_csharp'
|
|
|
15
15
|
// A type-correct C# literal for a field's canonical type.
|
|
16
16
|
function csLit(type: any, placeholder: string = 'example'): string {
|
|
17
17
|
const k = canonScalarKey(type)
|
|
18
|
+
if ('NULL' === k) return 'null'
|
|
18
19
|
if ('INTEGER' === k) return '1L'
|
|
19
20
|
if ('NUMBER' === k) return '1.0'
|
|
20
21
|
if ('BOOLEAN' === k) return 'true'
|
|
@@ -47,8 +48,8 @@ const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string
|
|
|
47
48
|
},
|
|
48
49
|
patch: {
|
|
49
50
|
sig: 'Patch(reqdata, ctrl = null) -> object?',
|
|
50
|
-
returns: 'the patched entity
|
|
51
|
-
desc: 'Change part of an existing entity: only the fields given are sent. The data must include the entity `id`. Returns the patched entity
|
|
51
|
+
returns: 'the patched entity',
|
|
52
|
+
desc: 'Change part of an existing entity: only the fields given are sent. The data must include the entity `id`. Returns the patched entity and raises on error.',
|
|
52
53
|
},
|
|
53
54
|
remove: {
|
|
54
55
|
sig: 'Remove(reqmatch, ctrl = null) -> object?',
|
|
@@ -83,6 +84,7 @@ Complete API reference for the ${model.Name} ${target.title} SDK.
|
|
|
83
84
|
|
|
84
85
|
Content(`\`\`\`csharp
|
|
85
86
|
using ${model.const.Name}Sdk;
|
|
87
|
+
using Voxgig.Struct;
|
|
86
88
|
|
|
87
89
|
var client = new ${model.const.Name}SDK(options);
|
|
88
90
|
\`\`\`
|
|
@@ -285,8 +287,11 @@ var result = client.${ent.Name}().${opname.charAt(0).toUpperCase() + opname.slic
|
|
|
285
287
|
}
|
|
286
288
|
else if ('list' === opname) {
|
|
287
289
|
Content(`\`\`\`csharp
|
|
288
|
-
var results = client.${ent.Name}().List(
|
|
289
|
-
|
|
290
|
+
var results = (List<object?>)client.${ent.Name}().List(${csListMatch(ent)})!;
|
|
291
|
+
foreach (var item in results)
|
|
292
|
+
{
|
|
293
|
+
Console.WriteLine(StructUtils.Jsonify(((IEntity)item!).Data()));
|
|
294
|
+
}
|
|
290
295
|
\`\`\`
|
|
291
296
|
|
|
292
297
|
`)
|
|
@@ -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
|
// A type-correct C# literal for a param: numeric/boolean/array/object params
|
|
@@ -15,6 +15,7 @@ import { csVarName } from './utility_csharp'
|
|
|
15
15
|
// loose object model means all values live in Dictionary<string, object?>.
|
|
16
16
|
function csLit(type: any, placeholder: string = 'example'): string {
|
|
17
17
|
const k = canonScalarKey(type)
|
|
18
|
+
if ('NULL' === k) return 'null'
|
|
18
19
|
if ('INTEGER' === k) return '1L'
|
|
19
20
|
if ('NUMBER' === k) return '1.0'
|
|
20
21
|
if ('BOOLEAN' === k) return 'true'
|
|
@@ -36,9 +37,12 @@ const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
|
|
|
36
37
|
? `new ${model.const.Name}SDK(new Dictionary<string, object?>\n{\n ["apikey"] = Environment.GetEnvironmentVariable("${envName(model)}_APIKEY"),\n})`
|
|
37
38
|
: `new ${model.const.Name}SDK()`
|
|
38
39
|
|
|
40
|
+
const shown = null != exampleEntity &&
|
|
41
|
+
['list', 'load'].some((op: string) => Object.keys(exampleEntity.op || {}).includes(op))
|
|
42
|
+
|
|
39
43
|
Content(`\`\`\`csharp
|
|
40
44
|
using ${model.const.Name}Sdk;
|
|
41
|
-
|
|
45
|
+
${shown ? 'using Voxgig.Struct;\n' : ''}
|
|
42
46
|
var client = ${ctor};
|
|
43
47
|
|
|
44
48
|
`)
|
|
@@ -52,9 +56,12 @@ var client = ${ctor};
|
|
|
52
56
|
const idF = entityIdField(exampleEntity)
|
|
53
57
|
|
|
54
58
|
if (opnames.includes('list')) {
|
|
55
|
-
Content(`// List all ${eName.toLowerCase()}s (
|
|
56
|
-
var ${eVar}List = client.${eName}().List(
|
|
57
|
-
|
|
59
|
+
Content(`// List all ${eName.toLowerCase()}s (a list of entities, one per record, as object?; raises on error)
|
|
60
|
+
var ${eVar}List = (List<object?>)client.${eName}().List(${csListMatch(exampleEntity)})!;
|
|
61
|
+
foreach (var ${eVar}Item in ${eVar}List)
|
|
62
|
+
{
|
|
63
|
+
Console.WriteLine(StructUtils.Jsonify(((IEntity)${eVar}Item!).Data()));
|
|
64
|
+
}
|
|
58
65
|
`)
|
|
59
66
|
}
|
|
60
67
|
|
|
@@ -73,8 +80,8 @@ Console.WriteLine(${eVar}List);
|
|
|
73
80
|
: 'null'
|
|
74
81
|
Content(`
|
|
75
82
|
// Load a specific ${eName.toLowerCase()} (returns the entity, raises on error)
|
|
76
|
-
var ${eVar} = client.${eName}().Load(${loadArg})
|
|
77
|
-
Console.WriteLine(${eVar});
|
|
83
|
+
var ${eVar} = (IEntity)client.${eName}().Load(${loadArg})!;
|
|
84
|
+
Console.WriteLine(StructUtils.Jsonify(${eVar}.Data()));
|
|
78
85
|
`)
|
|
79
86
|
}
|
|
80
87
|
}
|
|
@@ -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,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'
|
|
@@ -41,16 +42,16 @@ var client = ${model.const.Name}SDK.TestSDK(null, null);
|
|
|
41
42
|
const opMethod = primaryOp.charAt(0).toUpperCase() + primaryOp.slice(1)
|
|
42
43
|
const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
|
|
43
44
|
let arg = 'null'
|
|
44
|
-
if (isMatchOp) {
|
|
45
|
+
if (isMatchOp || ('list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length)) {
|
|
45
46
|
// Every REQUIRED match key (id first) — the same shape that generates
|
|
46
47
|
// the op's request type, so the block stays honest.
|
|
47
|
-
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
48
|
-
.filter((it: any) => !it.optional || it.name === idF)
|
|
48
|
+
const items = (isMatchOp ? opRequestShape(exampleEntity, primaryOp).items
|
|
49
|
+
.filter((it: any) => !it.optional || it.name === idF) : requiredItems(exampleEntity, 'list'))
|
|
49
50
|
.sort((a: any, b: any) =>
|
|
50
51
|
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
51
52
|
arg = 0 < items.length
|
|
52
53
|
? `new Dictionary<string, object?> {${items.map((it: any) =>
|
|
53
|
-
` [
|
|
54
|
+
` [${csStringLiteral(it.name)}] = ${isMatchOp && it.name === idF ? '"test01"' : csLit(it.type)}`).join(',')} }`
|
|
54
55
|
: 'null'
|
|
55
56
|
} else if ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp) {
|
|
56
57
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
@@ -58,11 +59,18 @@ var client = ${model.const.Name}SDK.TestSDK(null, null);
|
|
|
58
59
|
const required = items.filter((it: any) => !it.optional)
|
|
59
60
|
const chosen = required.length ? required : items.slice(0, 3)
|
|
60
61
|
arg = `new Dictionary<string, object?> {${chosen.map((it: any) =>
|
|
61
|
-
` [
|
|
62
|
+
` [${csStringLiteral(it.name)}] = ${csLit(it.type)}`).join(',')} }`
|
|
62
63
|
}
|
|
63
|
-
const eVar = csVarName(exampleEntity.name)
|
|
64
|
-
Content(
|
|
65
|
-
|
|
64
|
+
const eVar = csVarName(exampleEntity.name)
|
|
65
|
+
Content('list' === primaryOp
|
|
66
|
+
? `var ${eVar}List = (List<object?>)client.${eName}().List(${arg})!;
|
|
67
|
+
foreach (var ${eVar}Item in ${eVar}List)
|
|
68
|
+
{
|
|
69
|
+
Console.WriteLine(StructUtils.Jsonify(((IEntity)${eVar}Item!).Data()));
|
|
70
|
+
}
|
|
71
|
+
`
|
|
72
|
+
: `var ${eVar} = (IEntity)client.${eName}().${opMethod}(${arg})!;
|
|
73
|
+
Console.WriteLine(StructUtils.Jsonify(${eVar}.Data()));
|
|
66
74
|
`)
|
|
67
75
|
}
|
|
68
76
|
|
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
camelify,
|
|
7
7
|
each,
|
|
8
8
|
safeVarName,
|
|
9
|
+
canonScalarKey,
|
|
10
|
+
requiredItems,
|
|
9
11
|
} from '@voxgig/sdkgen'
|
|
10
12
|
|
|
11
13
|
import {
|
|
@@ -202,8 +204,19 @@ function clean(o: any, dropDefaults?: boolean): any {
|
|
|
202
204
|
return prune(o, true === dropDefaults)
|
|
203
205
|
}
|
|
204
206
|
|
|
207
|
+
// A list's required route and query parameters, as the match it is called with.
|
|
208
|
+
function csListMatch(entity: any): string {
|
|
209
|
+
const lit = (type: any): string =>
|
|
210
|
+
(({ NULL: 'null', INTEGER: '1L', NUMBER: '1.0', BOOLEAN: 'true', ARRAY: 'new List<object?>()', OBJECT: 'new Dictionary<string, object?>()' }) as any)[canonScalarKey(type)] ?? '"example"'
|
|
211
|
+
const items = requiredItems(entity, 'list')
|
|
212
|
+
return 0 < items.length
|
|
213
|
+
? `new Dictionary<string, object?> {${items.map((it: any) => ` [${csStringLiteral(it.name)}] = ${lit(it.type)}`).join(',')} }`
|
|
214
|
+
: 'null'
|
|
215
|
+
}
|
|
216
|
+
|
|
205
217
|
|
|
206
218
|
export {
|
|
219
|
+
csListMatch,
|
|
207
220
|
clean,
|
|
208
221
|
csPascalName,
|
|
209
222
|
csStringLiteral,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from '@voxgig/apidef'
|
|
8
8
|
|
|
9
9
|
// Type names come from the shared canonToType 'elixir' column (single source of truth).
|
|
10
|
-
import { elixirLit } from './utility_elixir'
|
|
10
|
+
import { elixirLit, elixirListArgs } from './utility_elixir'
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
// Operation method spelling for the Elixir target: each op is a function on
|
|
@@ -120,7 +120,7 @@ takes an entity handle built from the client:
|
|
|
120
120
|
|
|
121
121
|
\`\`\`elixir
|
|
122
122
|
${eVar} = ${Name}.${eCall}(sdk)
|
|
123
|
-
|
|
123
|
+
${eVar} = ${Name}.Entity.${EName}.load(${eVar}, ${loadArg})
|
|
124
124
|
\`\`\`
|
|
125
125
|
|
|
126
126
|
`)
|
|
@@ -131,7 +131,7 @@ record = ${Name}.Entity.${EName}.load(${eVar}, ${loadArg})
|
|
|
131
131
|
|
|
132
132
|
\`\`\`elixir
|
|
133
133
|
${eVar} = ${Name}.${eCall}(sdk)
|
|
134
|
-
|
|
134
|
+
${eVar}s = ${Name}.Entity.${EName}.list(${eVar}${elixirListArgs(entity, Name)})
|
|
135
135
|
\`\`\`
|
|
136
136
|
|
|
137
137
|
`)
|
|
@@ -147,7 +147,7 @@ records = ${Name}.Entity.${EName}.list(${eVar})
|
|
|
147
147
|
|
|
148
148
|
\`\`\`elixir
|
|
149
149
|
${eVar} = ${Name}.${eCall}(sdk)
|
|
150
|
-
|
|
150
|
+
${eVar} = ${Name}.Entity.${EName}.create(${eVar}, ${Name}.Helpers.deep(%{
|
|
151
151
|
`)
|
|
152
152
|
createItems.map((it: any) => {
|
|
153
153
|
Content(` "${it.name}" => ${elixirLit(it.type, 'example_' + it.name)}, # ${canonToType(it.type, target.name)}
|
|
@@ -17,7 +17,8 @@ that every later pipeline stage observes — the immutable-Elixir way to honour
|
|
|
17
17
|
the shared-mutable hook contract.
|
|
18
18
|
|
|
19
19
|
Build inputs from native Elixir maps with \`${model.Name}.Helpers.deep/1\`,
|
|
20
|
-
and read fields off
|
|
20
|
+
and read fields off a record, which an entity's \`data_get/1\` returns, with
|
|
21
|
+
\`Voxgig.Struct.getprop/2\`.
|
|
21
22
|
|
|
22
23
|
### Module structure
|
|
23
24
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, isAuthActive, envName, entityIdField, pickExampleEntity, opRequestShape, elixirAccessor, entityCollection, exampleVarName } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, isAuthActive, envName, entityIdField, pickExampleEntity, opRequestShape, elixirAccessor, entityCollection, exampleVarName, requiredItems } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
nom,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
-
import { elixirLit } from './utility_elixir'
|
|
10
|
+
import { elixirLit, elixirString } from './utility_elixir'
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
|
|
@@ -27,20 +27,27 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
|
|
|
27
27
|
let testArg = 'H.deep(%{})'
|
|
28
28
|
if (exampleEntity && isMatchOp) {
|
|
29
29
|
testArg = idF ? `H.deep(%{"${idF}" => "test01"})` : 'H.deep(%{})'
|
|
30
|
+
} else if (exampleEntity && 'list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length) {
|
|
31
|
+
const chosen = requiredItems(exampleEntity, 'list')
|
|
32
|
+
testArg = `H.deep(%{${chosen.map((it: any) => `${elixirString(it.name)} => ${elixirLit(it.type)}`).join(', ')}})`
|
|
30
33
|
} else if (exampleEntity && ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp)) {
|
|
31
34
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
32
35
|
.filter((it: any) => it.name !== idF && it.name !== 'id')
|
|
33
36
|
const required = items.filter((it: any) => !it.optional)
|
|
34
37
|
const chosen = required.length ? required : items.slice(0, 3)
|
|
35
|
-
testArg = `H.deep(%{${chosen.map((it: any) =>
|
|
38
|
+
testArg = `H.deep(%{${chosen.map((it: any) => `${elixirString(it.name)} => ${elixirLit(it.type)}`).join(', ')}})`
|
|
36
39
|
}
|
|
37
40
|
|
|
38
|
-
const resVar = 'list' === primaryOp ? 'records' : 'record'
|
|
39
41
|
const testModeExample = primaryOp
|
|
40
42
|
? `# Entity ops return the entity, and list one per record (raise on error).
|
|
41
43
|
${eVar} = ${Name}.${eCall}(sdk)
|
|
42
|
-
${
|
|
43
|
-
|
|
44
|
+
${'list' === primaryOp
|
|
45
|
+
? `${eVar}s = ${Name}.Entity.${eName}.list(${eVar}, ${testArg})
|
|
46
|
+
for i <- 0..(Voxgig.Struct.size(${eVar}s) - 1)//1 do
|
|
47
|
+
IO.puts(Voxgig.Struct.jsonify(${Name}.Entity.${eName}.data_get(Voxgig.Struct.getelem(${eVar}s, i))))
|
|
48
|
+
end`
|
|
49
|
+
: `${eVar} = ${Name}.Entity.${eName}.${primaryOp}(${eVar}, ${testArg})
|
|
50
|
+
IO.puts(Voxgig.Struct.jsonify(${Name}.Entity.${eName}.data_get(${eVar})))`}`
|
|
44
51
|
: `result = ${Name}.direct(sdk, H.deep(%{"path" => "/api/resource", "method" => "GET"}))
|
|
45
52
|
IO.inspect(result)`
|
|
46
53
|
|
|
@@ -21,12 +21,12 @@ const ReadmeModel = cmp(function ReadmeModel(props: any) {
|
|
|
21
21
|
entityList.forEach((e: any) => Object.keys(e.op || {})
|
|
22
22
|
.forEach((o: string) => { if (e.op[o] && e.op[o].active !== false) opUnion.add(o) }))
|
|
23
23
|
const opRowDefs: Record<string, string> = {
|
|
24
|
-
load: '| `load` | `(entity, reqmatch, ctrl \\\\ nil) ::
|
|
24
|
+
load: '| `load` | `(entity, reqmatch, ctrl \\\\ nil) :: entity` | Load a single entity by match criteria, and return it. Raises on error. |',
|
|
25
25
|
list: '| `list` | `(entity, reqmatch \\\\ nil, ctrl \\\\ nil) :: list()` | List entities matching the criteria, one per record. Raises on error. |',
|
|
26
|
-
create: '| `create` | `(entity, reqdata, ctrl \\\\ nil) ::
|
|
27
|
-
update: '| `update` | `(entity, reqdata, ctrl \\\\ nil) ::
|
|
28
|
-
patch: '| `patch` | `(entity, reqdata, ctrl \\\\ nil) ::
|
|
29
|
-
remove: '| `remove` | `(entity, reqmatch \\\\ nil, ctrl \\\\ nil) ::
|
|
26
|
+
create: '| `create` | `(entity, reqdata, ctrl \\\\ nil) :: entity` | Create a new entity, and return it. Raises on error. |',
|
|
27
|
+
update: '| `update` | `(entity, reqdata, ctrl \\\\ nil) :: entity` | Update an existing entity, and return it. Raises on error. |',
|
|
28
|
+
patch: '| `patch` | `(entity, reqdata, ctrl \\\\ nil) :: entity` | Change part of an existing entity, and return it. Raises on error. |',
|
|
29
|
+
remove: '| `remove` | `(entity, reqmatch \\\\ nil, ctrl \\\\ nil) :: entity` | Remove an entity, and return it marked as deleted. Raises on error. |',
|
|
30
30
|
}
|
|
31
31
|
const opRows = ['load', 'list', 'create', 'update', 'patch', 'remove']
|
|
32
32
|
.filter((o) => opUnion.has(o)).map((o) => opRowDefs[o]).join('\n')
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
nom,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
-
import { elixirLit } from './utility_elixir'
|
|
10
|
+
import { elixirLit, elixirListArgs } from './utility_elixir'
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
|
|
@@ -55,14 +55,17 @@ sdk = ${ctor}
|
|
|
55
55
|
if (opnames.includes('list')) {
|
|
56
56
|
Content(`### 2. List ${eName.toLowerCase()} records
|
|
57
57
|
|
|
58
|
-
\`list/2\` returns a list of entities, one per record, and
|
|
59
|
-
\`
|
|
58
|
+
\`list/2\` returns a \`Voxgig.Struct\` list of entities, one per record, and
|
|
59
|
+
raises on error; \`Voxgig.Struct.getelem/2\` reads an item, and \`data_get/1\`
|
|
60
|
+
an entity's record.
|
|
60
61
|
|
|
61
62
|
\`\`\`elixir
|
|
62
63
|
try do
|
|
63
64
|
${eVar} = ${Name}.${eCall}(sdk)
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
${eVar}s = ${Name}.Entity.${eName}.list(${eVar}${elixirListArgs(exampleEntity, Name)})
|
|
66
|
+
for i <- 0..(Voxgig.Struct.size(${eVar}s) - 1)//1 do
|
|
67
|
+
IO.puts(Voxgig.Struct.jsonify(${Name}.Entity.${eName}.data_get(Voxgig.Struct.getelem(${eVar}s, i))))
|
|
68
|
+
end
|
|
66
69
|
rescue
|
|
67
70
|
err -> IO.puts("list failed: " <> inspect(err))
|
|
68
71
|
end
|
|
@@ -98,8 +101,8 @@ record.
|
|
|
98
101
|
\`\`\`elixir
|
|
99
102
|
try do
|
|
100
103
|
${neVar} = ${Name}.${neCall}(sdk)
|
|
101
|
-
|
|
102
|
-
IO.
|
|
104
|
+
${neVar} = ${Name}.Entity.${neName}.load(${neVar}, H.deep(%{${neMatch.join(', ')}}))
|
|
105
|
+
IO.puts(Voxgig.Struct.jsonify(${Name}.Entity.${neName}.data_get(${neVar})))
|
|
103
106
|
rescue
|
|
104
107
|
err -> IO.puts("load failed: " <> inspect(err))
|
|
105
108
|
end
|
|
@@ -126,8 +129,8 @@ record.
|
|
|
126
129
|
\`\`\`elixir
|
|
127
130
|
try do
|
|
128
131
|
${eVar} = ${Name}.${eCall}(sdk)
|
|
129
|
-
|
|
130
|
-
IO.
|
|
132
|
+
${eVar} = ${Name}.Entity.${eName}.load(${eVar}, ${loadArg})
|
|
133
|
+
IO.puts(Voxgig.Struct.jsonify(${Name}.Entity.${eName}.data_get(${eVar})))
|
|
131
134
|
rescue
|
|
132
135
|
err -> IO.puts("load failed: " <> inspect(err))
|
|
133
136
|
end
|
|
@@ -155,7 +158,7 @@ end
|
|
|
155
158
|
return it && it.type
|
|
156
159
|
}
|
|
157
160
|
const idValueFor = (opname: string): string => (null != dataIdF && opnames.includes('create'))
|
|
158
|
-
? `Voxgig.Struct.getprop(created, "${dataIdF}")`
|
|
161
|
+
? `Voxgig.Struct.getprop(${Name}.Entity.${eName}.data_get(created), "${dataIdF}")`
|
|
159
162
|
: elixirLit(idParamType(opname), 'example_id')
|
|
160
163
|
|
|
161
164
|
if (opnames.includes('create') || opnames.includes('update') || opnames.includes('patch') ||
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
10
|
// Type names come from the shared canonToType 'elixir' column (single source of truth).
|
|
11
|
-
import { elixirLit } from './utility_elixir'
|
|
11
|
+
import { elixirLit, elixirListArgs } from './utility_elixir'
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
const OP_SIGNATURES: Record<string, { sig: string, desc: string }> = {
|
|
15
15
|
load: {
|
|
16
|
-
sig: 'load(entity, reqmatch, ctrl \\\\ nil) ::
|
|
16
|
+
sig: 'load(entity, reqmatch, ctrl \\\\ nil) :: entity',
|
|
17
17
|
desc: 'Load a single entity matching the given criteria. Returns the entity, whose record `data_get/1` reads, and raises on error.',
|
|
18
18
|
},
|
|
19
19
|
list: {
|
|
@@ -21,19 +21,19 @@ const OP_SIGNATURES: Record<string, { sig: string, desc: string }> = {
|
|
|
21
21
|
desc: 'List entities matching the given criteria. The match is optional — call `list(entity)` to list all records. Returns a list of entities, one per record, and raises on error.',
|
|
22
22
|
},
|
|
23
23
|
create: {
|
|
24
|
-
sig: 'create(entity, reqdata, ctrl \\\\ nil) ::
|
|
24
|
+
sig: 'create(entity, reqdata, ctrl \\\\ nil) :: entity',
|
|
25
25
|
desc: 'Create a new entity with the given data. Returns the created entity and raises on error.',
|
|
26
26
|
},
|
|
27
27
|
update: {
|
|
28
|
-
sig: 'update(entity, reqdata, ctrl \\\\ nil) ::
|
|
28
|
+
sig: 'update(entity, reqdata, ctrl \\\\ nil) :: entity',
|
|
29
29
|
desc: 'Update an existing entity. The data must include the entity `id`. Returns the updated entity and raises on error.',
|
|
30
30
|
},
|
|
31
31
|
patch: {
|
|
32
|
-
sig: 'patch(entity, reqdata, ctrl \\\\ nil) ::
|
|
33
|
-
desc: 'Change part of an existing entity: only the fields given are sent. The data must include the entity `id`. Returns the patched entity
|
|
32
|
+
sig: 'patch(entity, reqdata, ctrl \\\\ nil) :: entity',
|
|
33
|
+
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.',
|
|
34
34
|
},
|
|
35
35
|
remove: {
|
|
36
|
-
sig: 'remove(entity, reqmatch, ctrl \\\\ nil) ::
|
|
36
|
+
sig: 'remove(entity, reqmatch, ctrl \\\\ nil) :: entity',
|
|
37
37
|
desc: 'Remove the entity matching the given criteria. Returns the entity, marked as deleted, and raises on error.',
|
|
38
38
|
},
|
|
39
39
|
}
|
|
@@ -218,14 +218,14 @@ ${info.desc}
|
|
|
218
218
|
it.name === idF ? ent.name + '_id' : it.name)}`).join(', ')}})`
|
|
219
219
|
: `${Name}.Helpers.deep(%{})`
|
|
220
220
|
Content(`\`\`\`elixir
|
|
221
|
-
|
|
221
|
+
${eVar} = ${Name}.Entity.${EName}.${opname}(${eVar}, ${arg})
|
|
222
222
|
\`\`\`
|
|
223
223
|
|
|
224
224
|
`)
|
|
225
225
|
}
|
|
226
226
|
else if ('list' === opname) {
|
|
227
227
|
Content(`\`\`\`elixir
|
|
228
|
-
|
|
228
|
+
${eVar}s = ${Name}.Entity.${EName}.list(${eVar}${elixirListArgs(ent, Name)})
|
|
229
229
|
\`\`\`
|
|
230
230
|
|
|
231
231
|
`)
|
|
@@ -234,7 +234,7 @@ records = ${Name}.Entity.${EName}.list(${eVar})
|
|
|
234
234
|
const createItems = opRequestShape(ent, 'create').items
|
|
235
235
|
.filter((it: any) => !it.optional)
|
|
236
236
|
Content(`\`\`\`elixir
|
|
237
|
-
|
|
237
|
+
${eVar} = ${Name}.Entity.${EName}.create(${eVar}, ${Name}.Helpers.deep(%{
|
|
238
238
|
`)
|
|
239
239
|
createItems.map((it: any) => {
|
|
240
240
|
Content(` "${it.name}" => ${elixirLit(it.type, 'example_' + it.name)}, # ${canonToType(it.type, target.name)}
|
|
@@ -254,7 +254,7 @@ record = ${Name}.Entity.${EName}.create(${eVar}, ${Name}.Helpers.deep(%{
|
|
|
254
254
|
` "${it.name}" => ${elixirLit(it.type,
|
|
255
255
|
it.name === idF ? ent.name + '_id' : it.name)},\n`).join('')
|
|
256
256
|
Content(`\`\`\`elixir
|
|
257
|
-
|
|
257
|
+
${eVar} = ${Name}.Entity.${EName}.${opname}(${eVar}, ${Name}.Helpers.deep(%{
|
|
258
258
|
${updateLines} # ${'patch' === opname ? 'Only the fields to change' : 'Fields to update'}
|
|
259
259
|
}))
|
|
260
260
|
\`\`\`
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
nom,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
-
import { elixirLit } from './utility_elixir'
|
|
10
|
+
import { elixirLit, elixirListArgs } from './utility_elixir'
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
|
|
@@ -42,9 +42,11 @@ sdk = ${ctor}
|
|
|
42
42
|
|
|
43
43
|
if (opnames.includes('list')) {
|
|
44
44
|
Content(`
|
|
45
|
-
# List all ${eName.toLowerCase()}
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
# List all ${eName.toLowerCase()}s (a list of entities, one per record; raises on error)
|
|
46
|
+
${eVar}s = ${Name}.Entity.${eName}.list(${eVar}${elixirListArgs(exampleEntity, Name)})
|
|
47
|
+
for i <- 0..(Voxgig.Struct.size(${eVar}s) - 1)//1 do
|
|
48
|
+
IO.puts(Voxgig.Struct.jsonify(${Name}.Entity.${eName}.data_get(Voxgig.Struct.getelem(${eVar}s, i))))
|
|
49
|
+
end
|
|
48
50
|
`)
|
|
49
51
|
}
|
|
50
52
|
|
|
@@ -66,8 +68,8 @@ IO.inspect(records)
|
|
|
66
68
|
: eVar
|
|
67
69
|
Content(`
|
|
68
70
|
# Load a specific ${eName.toLowerCase()} (returns the entity, raises on error)
|
|
69
|
-
|
|
70
|
-
IO.
|
|
71
|
+
${eVar} = ${Name}.Entity.${eName}.load(${loadArgs})
|
|
72
|
+
IO.puts(Voxgig.Struct.jsonify(${Name}.Entity.${eName}.data_get(${eVar})))
|
|
71
73
|
`)
|
|
72
74
|
}
|
|
73
75
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, entityIdField, pickExampleEntity, opRequestShape, elixirAccessor, entityCollection, exampleVarName } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, entityIdField, pickExampleEntity, opRequestShape, elixirAccessor, entityCollection, exampleVarName, requiredItems } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
nom,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
-
import { elixirLit } from './utility_elixir'
|
|
10
|
+
import { elixirLit, elixirString } from './utility_elixir'
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
const ReadmeTopTest = cmp(function ReadmeTopTest(props: any) {
|
|
@@ -33,28 +33,32 @@ sdk = ${Name}.test()
|
|
|
33
33
|
const idF = entityIdField(exampleEntity)
|
|
34
34
|
const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
|
|
35
35
|
let arg = ''
|
|
36
|
-
if (isMatchOp) {
|
|
37
|
-
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
38
|
-
.filter((it: any) => !it.optional || it.name === idF)
|
|
36
|
+
if (isMatchOp || ('list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length)) {
|
|
37
|
+
const items = (isMatchOp ? opRequestShape(exampleEntity, primaryOp).items
|
|
38
|
+
.filter((it: any) => !it.optional || it.name === idF) : requiredItems(exampleEntity, 'list'))
|
|
39
39
|
.sort((a: any, b: any) =>
|
|
40
40
|
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
41
41
|
arg = 0 < items.length
|
|
42
42
|
? `H.deep(%{${items.map((it: any) =>
|
|
43
|
-
|
|
43
|
+
`${elixirString(it.name)} => ${isMatchOp && it.name === idF ? '"test01"' : elixirLit(it.type)}`).join(', ')}})`
|
|
44
44
|
: 'H.deep(%{})'
|
|
45
45
|
} else if ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp) {
|
|
46
46
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
47
47
|
.filter((it: any) => it.name !== idF && it.name !== 'id')
|
|
48
48
|
const required = items.filter((it: any) => !it.optional)
|
|
49
49
|
const chosen = required.length ? required : items.slice(0, 3)
|
|
50
|
-
arg = `H.deep(%{${chosen.map((it: any) =>
|
|
50
|
+
arg = `H.deep(%{${chosen.map((it: any) => `${elixirString(it.name)} => ${elixirLit(it.type)}`).join(', ')}})`
|
|
51
51
|
} else {
|
|
52
52
|
arg = 'H.deep(%{})'
|
|
53
53
|
}
|
|
54
|
-
const resVar = 'list' === primaryOp ? 'records' : 'record'
|
|
55
54
|
Content(`${eVar} = ${Name}.${eCall}(sdk)
|
|
56
|
-
${
|
|
57
|
-
|
|
55
|
+
${'list' === primaryOp
|
|
56
|
+
? `${eVar}s = ${Name}.Entity.${eName}.list(${eVar}, ${arg})
|
|
57
|
+
for i <- 0..(Voxgig.Struct.size(${eVar}s) - 1)//1 do
|
|
58
|
+
IO.puts(Voxgig.Struct.jsonify(${Name}.Entity.${eName}.data_get(Voxgig.Struct.getelem(${eVar}s, i))))
|
|
59
|
+
end`
|
|
60
|
+
: `${eVar} = ${Name}.Entity.${eName}.${primaryOp}(${eVar}, ${arg})
|
|
61
|
+
IO.puts(Voxgig.Struct.jsonify(${Name}.Entity.${eName}.data_get(${eVar})))`}
|
|
58
62
|
`)
|
|
59
63
|
}
|
|
60
64
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# EJECT-START
|
|
2
2
|
|
|
3
|
-
# Returns the created entityname entity
|
|
4
|
-
# on success; pipeline errors surface as
|
|
5
|
-
# Utility.make_error (shape is
|
|
3
|
+
# Returns the created entityname entity, whose data_get/1 reads its record
|
|
4
|
+
# (ProjectName.Types.entityname/0), on success; pipeline errors surface as
|
|
5
|
+
# the error value built by Utility.make_error (shape is
|
|
6
|
+
# utility-configurable), hence term().
|
|
6
7
|
@spec create(map(), ProjectName.Types.entityname_create_data() | nil, map() | nil) :: term()
|
|
7
8
|
def create(ent, reqdata, ctrl \\ nil) do
|
|
8
9
|
ctx =
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# EJECT-START
|
|
2
2
|
|
|
3
|
-
# Returns a list of entityname
|
|
4
|
-
# on success; pipeline
|
|
5
|
-
# Utility.make_error (shape is
|
|
3
|
+
# Returns a list of entityname entities, one per record, whose data_get/1
|
|
4
|
+
# reads each record (ProjectName.Types.entityname/0), on success; pipeline
|
|
5
|
+
# errors surface as the error value built by Utility.make_error (shape is
|
|
6
|
+
# utility-configurable), hence term().
|
|
6
7
|
@spec list(map(), ProjectName.Types.entityname_list_match() | nil, map() | nil) :: term()
|
|
7
8
|
def list(ent, reqmatch \\ nil, ctrl \\ nil) do
|
|
8
9
|
reqmatch = if reqmatch == nil, do: S.jm([]), else: reqmatch
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# EJECT-START
|
|
2
2
|
|
|
3
|
-
# Returns the entityname entity
|
|
4
|
-
# success; pipeline errors surface as
|
|
5
|
-
# Utility.make_error (shape is
|
|
3
|
+
# Returns the entityname entity, whose data_get/1 reads its record
|
|
4
|
+
# (ProjectName.Types.entityname/0), on success; pipeline errors surface as
|
|
5
|
+
# the error value built by Utility.make_error (shape is
|
|
6
|
+
# utility-configurable), hence term().
|
|
6
7
|
@spec load(map(), ProjectName.Types.entityname_load_match() | nil, map() | nil) :: term()
|
|
7
8
|
def load(ent, reqmatch \\ nil, ctrl \\ nil) do
|
|
8
9
|
reqmatch = if reqmatch == nil, do: S.jm([]), else: reqmatch
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# EJECT-START
|
|
2
2
|
|
|
3
|
-
# Returns the patched entityname entity
|
|
4
|
-
# on success; pipeline errors surface as
|
|
5
|
-
# Utility.make_error (shape is
|
|
3
|
+
# Returns the patched entityname entity, whose data_get/1 reads its record
|
|
4
|
+
# (ProjectName.Types.entityname/0), on success; pipeline errors surface as
|
|
5
|
+
# the error value built by Utility.make_error (shape is
|
|
6
|
+
# utility-configurable), hence term().
|
|
6
7
|
@spec patch(map(), ProjectName.Types.entityname_patch_data() | nil, map() | nil) :: term()
|
|
7
8
|
def patch(ent, reqdata, ctrl \\ nil) do
|
|
8
9
|
ctx =
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# EJECT-START
|
|
2
2
|
|
|
3
|
-
# Returns the removed entityname entity
|
|
4
|
-
#
|
|
5
|
-
#
|
|
3
|
+
# Returns the removed entityname entity, marked as deleted, whose data_get/1
|
|
4
|
+
# reads the record it held (ProjectName.Types.entityname/0), on success;
|
|
5
|
+
# pipeline errors surface as the error value built by Utility.make_error
|
|
6
|
+
# (shape is utility-configurable), hence term().
|
|
6
7
|
@spec remove(map(), ProjectName.Types.entityname_remove_match() | nil, map() | nil) :: term()
|
|
7
8
|
def remove(ent, reqmatch \\ nil, ctrl \\ nil) do
|
|
8
9
|
reqmatch = if reqmatch == nil, do: S.jm([]), else: reqmatch
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# EJECT-START
|
|
2
2
|
|
|
3
|
-
# Returns the updated entityname entity
|
|
4
|
-
# on success; pipeline errors surface as
|
|
5
|
-
# Utility.make_error (shape is
|
|
3
|
+
# Returns the updated entityname entity, whose data_get/1 reads its record
|
|
4
|
+
# (ProjectName.Types.entityname/0), on success; pipeline errors surface as
|
|
5
|
+
# the error value built by Utility.make_error (shape is
|
|
6
|
+
# utility-configurable), hence term().
|
|
6
7
|
@spec update(map(), ProjectName.Types.entityname_update_data() | nil, map() | nil) :: term()
|
|
7
8
|
def update(ent, reqdata, ctrl \\ nil) do
|
|
8
9
|
ctx =
|