@voxgig/sdkgen 4.34.1 → 4.34.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/voxgig-sdkgen +1 -1
- package/dist/cmp/ReadmeErrors.js +3 -3
- package/dist/cmp/ReadmeErrors.js.map +1 -1
- package/dist/cmp/ReadmeExplanation.js +3 -3
- package/dist/cmp/ReadmeExplanation.js.map +1 -1
- package/dist/cmp/ReadmeQuick.js +3 -1
- package/dist/cmp/ReadmeQuick.js.map +1 -1
- package/dist/cmp/ReadmeTop.js +9 -8
- package/dist/cmp/ReadmeTop.js.map +1 -1
- package/dist/helpers/definitionPlan.js +8 -4
- package/dist/helpers/definitionPlan.js.map +1 -1
- package/dist/helpers/naming.d.ts +2 -1
- package/dist/helpers/naming.js +11 -4
- package/dist/helpers/naming.js.map +1 -1
- package/dist/helpers/opExample.d.ts +16 -2
- package/dist/helpers/opExample.js +80 -21
- package/dist/helpers/opExample.js.map +1 -1
- package/dist/helpers/opShape.d.ts +3 -1
- package/dist/helpers/opShape.js +21 -8
- package/dist/helpers/opShape.js.map +1 -1
- package/dist/sdkgen.d.ts +4 -4
- package/dist/sdkgen.js +12 -4
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utility.d.ts +2 -1
- package/dist/utility.js +29 -3
- package/dist/utility.js.map +1 -1
- package/package.json +2 -2
- package/project/.sdk/src/cmp/c/ReadmeEntity_c.ts +3 -2
- package/project/.sdk/src/cmp/c/ReadmeHowto_c.ts +7 -3
- package/project/.sdk/src/cmp/c/ReadmeQuick_c.ts +3 -2
- package/project/.sdk/src/cmp/c/ReadmeRef_c.ts +5 -4
- package/project/.sdk/src/cmp/c/ReadmeTopQuick_c.ts +3 -2
- package/project/.sdk/src/cmp/c/ReadmeTopTest_c.ts +8 -7
- package/project/.sdk/src/cmp/c/utility_c.ts +21 -2
- package/project/.sdk/src/cmp/clojure/ReadmeEntity_clojure.ts +4 -1
- package/project/.sdk/src/cmp/clojure/ReadmeHowto_clojure.ts +17 -6
- package/project/.sdk/src/cmp/clojure/ReadmeModel_clojure.ts +6 -6
- package/project/.sdk/src/cmp/clojure/ReadmeQuick_clojure.ts +13 -8
- package/project/.sdk/src/cmp/clojure/ReadmeRef_clojure.ts +21 -18
- package/project/.sdk/src/cmp/clojure/ReadmeTopQuick_clojure.ts +6 -3
- package/project/.sdk/src/cmp/clojure/ReadmeTopTest_clojure.ts +16 -9
- package/project/.sdk/src/cmp/clojure/TestClean_clojure.ts +4 -4
- package/project/.sdk/src/cmp/clojure/fragment/Entity.fragment.clj +2 -1
- package/project/.sdk/src/cmp/clojure/utility_clojure.ts +14 -0
- package/project/.sdk/src/cmp/cpp/ReadmeEntity_cpp.ts +3 -2
- package/project/.sdk/src/cmp/cpp/ReadmeHowto_cpp.ts +7 -3
- package/project/.sdk/src/cmp/cpp/ReadmeQuick_cpp.ts +3 -2
- package/project/.sdk/src/cmp/cpp/ReadmeRef_cpp.ts +6 -5
- package/project/.sdk/src/cmp/cpp/ReadmeTopQuick_cpp.ts +3 -2
- package/project/.sdk/src/cmp/cpp/ReadmeTopTest_cpp.ts +8 -7
- package/project/.sdk/src/cmp/cpp/utility_cpp.ts +13 -0
- package/project/.sdk/src/cmp/csharp/ReadmeEntity_csharp.ts +3 -2
- package/project/.sdk/src/cmp/csharp/ReadmeHowto_csharp.ts +20 -8
- package/project/.sdk/src/cmp/csharp/ReadmeQuick_csharp.ts +13 -8
- package/project/.sdk/src/cmp/csharp/ReadmeRef_csharp.ts +10 -5
- package/project/.sdk/src/cmp/csharp/ReadmeTopQuick_csharp.ts +14 -7
- package/project/.sdk/src/cmp/csharp/ReadmeTopTest_csharp.ts +18 -10
- package/project/.sdk/src/cmp/csharp/utility_csharp.ts +13 -0
- package/project/.sdk/src/cmp/elixir/ReadmeEntity_elixir.ts +4 -4
- package/project/.sdk/src/cmp/elixir/ReadmeExplanation_elixir.ts +2 -1
- package/project/.sdk/src/cmp/elixir/ReadmeHowto_elixir.ts +13 -6
- package/project/.sdk/src/cmp/elixir/ReadmeModel_elixir.ts +5 -5
- package/project/.sdk/src/cmp/elixir/ReadmeQuick_elixir.ts +13 -10
- package/project/.sdk/src/cmp/elixir/ReadmeRef_elixir.ts +11 -11
- package/project/.sdk/src/cmp/elixir/ReadmeTopQuick_elixir.ts +8 -6
- package/project/.sdk/src/cmp/elixir/ReadmeTopTest_elixir.ts +14 -10
- package/project/.sdk/src/cmp/elixir/fragment/EntityCreateOp.fragment.ex +4 -3
- package/project/.sdk/src/cmp/elixir/fragment/EntityListOp.fragment.ex +4 -3
- package/project/.sdk/src/cmp/elixir/fragment/EntityLoadOp.fragment.ex +4 -3
- package/project/.sdk/src/cmp/elixir/fragment/EntityPatchOp.fragment.ex +4 -3
- package/project/.sdk/src/cmp/elixir/fragment/EntityRemoveOp.fragment.ex +4 -3
- package/project/.sdk/src/cmp/elixir/fragment/EntityUpdateOp.fragment.ex +4 -3
- package/project/.sdk/src/cmp/elixir/utility_elixir.ts +12 -0
- package/project/.sdk/src/cmp/go/ReadmeEntity_go.ts +8 -5
- package/project/.sdk/src/cmp/go/ReadmeExplanation_go.ts +3 -1
- package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +20 -8
- package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +16 -13
- package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +14 -13
- package/project/.sdk/src/cmp/go/ReadmeRef_go.ts +14 -13
- package/project/.sdk/src/cmp/go/ReadmeTopQuick_go.ts +10 -8
- package/project/.sdk/src/cmp/go/ReadmeTopTest_go.ts +6 -2
- package/project/.sdk/src/cmp/go/utility_go.ts +1 -1
- package/project/.sdk/src/cmp/java/ReadmeEntity_java.ts +8 -19
- package/project/.sdk/src/cmp/java/ReadmeHowto_java.ts +19 -22
- package/project/.sdk/src/cmp/java/ReadmeModel_java.ts +10 -9
- package/project/.sdk/src/cmp/java/ReadmeQuick_java.ts +24 -28
- package/project/.sdk/src/cmp/java/ReadmeRef_java.ts +27 -35
- package/project/.sdk/src/cmp/java/ReadmeTopQuick_java.ts +22 -25
- package/project/.sdk/src/cmp/java/ReadmeTopTest_java.ts +18 -24
- package/project/.sdk/src/cmp/java/utility_java.ts +25 -0
- package/project/.sdk/src/cmp/js/EntityOperation_js.ts +3 -1
- package/project/.sdk/src/cmp/js/ReadmeEntity_js.ts +2 -8
- package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +11 -9
- package/project/.sdk/src/cmp/js/ReadmeModel_js.ts +9 -9
- package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +7 -13
- package/project/.sdk/src/cmp/js/ReadmeRef_js.ts +14 -15
- package/project/.sdk/src/cmp/js/ReadmeTopQuick_js.ts +16 -11
- package/project/.sdk/src/cmp/js/ReadmeTopTest_js.ts +11 -7
- package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +1 -1
- package/project/.sdk/src/cmp/js/fragment/EntityListOp.fragment.js +1 -1
- package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +1 -1
- package/project/.sdk/src/cmp/js/fragment/EntityPatchOp.fragment.js +1 -1
- package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +1 -1
- package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +1 -1
- package/project/.sdk/src/cmp/js/utility_js.ts +2 -1
- package/project/.sdk/src/cmp/kotlin/ReadmeEntity_kotlin.ts +3 -2
- package/project/.sdk/src/cmp/kotlin/ReadmeHowto_kotlin.ts +19 -9
- package/project/.sdk/src/cmp/kotlin/ReadmeModel_kotlin.ts +10 -9
- package/project/.sdk/src/cmp/kotlin/ReadmeQuick_kotlin.ts +14 -9
- package/project/.sdk/src/cmp/kotlin/ReadmeRef_kotlin.ts +18 -15
- package/project/.sdk/src/cmp/kotlin/ReadmeTopQuick_kotlin.ts +14 -8
- package/project/.sdk/src/cmp/kotlin/ReadmeTopTest_kotlin.ts +17 -10
- package/project/.sdk/src/cmp/kotlin/utility_kotlin.ts +21 -1
- package/project/.sdk/src/cmp/lua/ReadmeEntity_lua.ts +3 -2
- package/project/.sdk/src/cmp/lua/ReadmeExamplesTest_lua.ts +7 -4
- package/project/.sdk/src/cmp/lua/ReadmeHowto_lua.ts +9 -7
- package/project/.sdk/src/cmp/lua/ReadmeModel_lua.ts +13 -13
- package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +20 -9
- package/project/.sdk/src/cmp/lua/ReadmeRef_lua.ts +9 -8
- package/project/.sdk/src/cmp/lua/ReadmeTopQuick_lua.ts +15 -7
- package/project/.sdk/src/cmp/lua/ReadmeTopTest_lua.ts +6 -5
- package/project/.sdk/src/cmp/lua/fragment/Entity.fragment.lua +1 -0
- package/project/.sdk/src/cmp/lua/fragment/EntityCreateOp.fragment.lua +1 -1
- package/project/.sdk/src/cmp/lua/fragment/EntityListOp.fragment.lua +1 -1
- package/project/.sdk/src/cmp/lua/fragment/EntityLoadOp.fragment.lua +1 -1
- package/project/.sdk/src/cmp/lua/fragment/EntityPatchOp.fragment.lua +1 -1
- package/project/.sdk/src/cmp/lua/fragment/EntityRemoveOp.fragment.lua +1 -1
- package/project/.sdk/src/cmp/lua/fragment/EntityUpdateOp.fragment.lua +1 -1
- package/project/.sdk/src/cmp/ocaml/ReadmeEntity_ocaml.ts +3 -2
- package/project/.sdk/src/cmp/ocaml/ReadmeHowto_ocaml.ts +3 -2
- package/project/.sdk/src/cmp/ocaml/ReadmeModel_ocaml.ts +1 -0
- package/project/.sdk/src/cmp/ocaml/ReadmeQuick_ocaml.ts +5 -3
- package/project/.sdk/src/cmp/ocaml/ReadmeRef_ocaml.ts +10 -8
- package/project/.sdk/src/cmp/ocaml/ReadmeTopQuick_ocaml.ts +4 -2
- package/project/.sdk/src/cmp/ocaml/ReadmeTopTest_ocaml.ts +3 -2
- package/project/.sdk/src/cmp/ocaml/utility_ocaml.ts +13 -1
- package/project/.sdk/src/cmp/perl/ReadmeEntity_perl.ts +4 -1
- package/project/.sdk/src/cmp/perl/ReadmeHowto_perl.ts +10 -5
- package/project/.sdk/src/cmp/perl/ReadmeModel_perl.ts +6 -6
- package/project/.sdk/src/cmp/perl/ReadmeQuick_perl.ts +8 -5
- package/project/.sdk/src/cmp/perl/ReadmeRef_perl.ts +21 -18
- package/project/.sdk/src/cmp/perl/ReadmeTopQuick_perl.ts +6 -3
- package/project/.sdk/src/cmp/perl/ReadmeTopTest_perl.ts +11 -8
- package/project/.sdk/src/cmp/perl/fragment/Entity.fragment.pm +1 -1
- package/project/.sdk/src/cmp/perl/fragment/EntityCreateOp.fragment.pm +2 -2
- package/project/.sdk/src/cmp/perl/fragment/EntityLoadOp.fragment.pm +2 -2
- package/project/.sdk/src/cmp/perl/fragment/EntityPatchOp.fragment.pm +2 -2
- package/project/.sdk/src/cmp/perl/fragment/EntityRemoveOp.fragment.pm +1 -1
- package/project/.sdk/src/cmp/perl/fragment/EntityUpdateOp.fragment.pm +2 -2
- package/project/.sdk/src/cmp/perl/utility_perl.ts +11 -1
- package/project/.sdk/src/cmp/php/EntityOperation_php.ts +3 -1
- package/project/.sdk/src/cmp/php/ReadmeEntity_php.ts +4 -3
- package/project/.sdk/src/cmp/php/ReadmeHowto_php.ts +12 -6
- package/project/.sdk/src/cmp/php/ReadmeModel_php.ts +9 -9
- package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +3 -2
- package/project/.sdk/src/cmp/php/ReadmeRef_php.ts +15 -14
- package/project/.sdk/src/cmp/php/ReadmeTopQuick_php.ts +5 -4
- package/project/.sdk/src/cmp/php/ReadmeTopTest_php.ts +13 -7
- package/project/.sdk/src/cmp/php/fragment/EntityCreateOp.fragment.php +2 -2
- package/project/.sdk/src/cmp/php/fragment/EntityListOp.fragment.php +2 -2
- package/project/.sdk/src/cmp/php/fragment/EntityLoadOp.fragment.php +2 -2
- package/project/.sdk/src/cmp/php/fragment/EntityPatchOp.fragment.php +2 -2
- package/project/.sdk/src/cmp/php/fragment/EntityRemoveOp.fragment.php +2 -2
- package/project/.sdk/src/cmp/php/fragment/EntityUpdateOp.fragment.php +2 -2
- package/project/.sdk/src/cmp/py/EntityOperation_py.ts +3 -1
- package/project/.sdk/src/cmp/py/ReadmeEntity_py.ts +3 -8
- package/project/.sdk/src/cmp/py/ReadmeHowto_py.ts +9 -9
- package/project/.sdk/src/cmp/py/ReadmeModel_py.ts +9 -9
- package/project/.sdk/src/cmp/py/ReadmeQuick_py.ts +9 -14
- package/project/.sdk/src/cmp/py/ReadmeRef_py.ts +23 -30
- package/project/.sdk/src/cmp/py/ReadmeTopQuick_py.ts +7 -12
- package/project/.sdk/src/cmp/py/ReadmeTopTest_py.ts +8 -7
- package/project/.sdk/src/cmp/py/fragment/EntityCreateOp.fragment.py +1 -1
- package/project/.sdk/src/cmp/py/fragment/EntityListOp.fragment.py +1 -1
- package/project/.sdk/src/cmp/py/fragment/EntityLoadOp.fragment.py +1 -1
- package/project/.sdk/src/cmp/py/fragment/EntityPatchOp.fragment.py +1 -1
- package/project/.sdk/src/cmp/py/fragment/EntityRemoveOp.fragment.py +1 -1
- package/project/.sdk/src/cmp/py/fragment/EntityUpdateOp.fragment.py +1 -1
- package/project/.sdk/src/cmp/rb/EntityOperation_rb.ts +3 -1
- package/project/.sdk/src/cmp/rb/EntityTypes_rb.ts +2 -1
- package/project/.sdk/src/cmp/rb/ReadmeEntity_rb.ts +4 -1
- package/project/.sdk/src/cmp/rb/ReadmeExamplesTest_rb.ts +3 -2
- package/project/.sdk/src/cmp/rb/ReadmeHowto_rb.ts +20 -10
- package/project/.sdk/src/cmp/rb/ReadmeModel_rb.ts +10 -9
- package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +6 -3
- package/project/.sdk/src/cmp/rb/ReadmeRef_rb.ts +14 -11
- package/project/.sdk/src/cmp/rb/ReadmeTopQuick_rb.ts +6 -3
- package/project/.sdk/src/cmp/rb/ReadmeTopTest_rb.ts +14 -10
- package/project/.sdk/src/cmp/rb/fragment/EntityCreateOp.fragment.rb +2 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityListOp.fragment.rb +1 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityLoadOp.fragment.rb +2 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityPatchOp.fragment.rb +2 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityRemoveOp.fragment.rb +2 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityUpdateOp.fragment.rb +2 -1
- package/project/.sdk/src/cmp/rb/utility_rb.ts +10 -0
- package/project/.sdk/src/cmp/rust/ReadmeEntity_rust.ts +3 -2
- package/project/.sdk/src/cmp/rust/ReadmeHowto_rust.ts +6 -2
- package/project/.sdk/src/cmp/rust/ReadmeQuick_rust.ts +3 -2
- package/project/.sdk/src/cmp/rust/ReadmeRef_rust.ts +5 -4
- package/project/.sdk/src/cmp/rust/ReadmeTopQuick_rust.ts +3 -2
- package/project/.sdk/src/cmp/rust/ReadmeTopTest_rust.ts +7 -6
- package/project/.sdk/src/cmp/rust/utility_rust.ts +13 -1
- package/project/.sdk/src/cmp/scala/EntityTypes_scala.ts +5 -2
- package/project/.sdk/src/cmp/scala/ReadmeEntity_scala.ts +8 -19
- package/project/.sdk/src/cmp/scala/ReadmeHowto_scala.ts +17 -22
- package/project/.sdk/src/cmp/scala/ReadmeModel_scala.ts +10 -9
- package/project/.sdk/src/cmp/scala/ReadmeQuick_scala.ts +18 -28
- package/project/.sdk/src/cmp/scala/ReadmeRef_scala.ts +25 -35
- package/project/.sdk/src/cmp/scala/ReadmeTopQuick_scala.ts +14 -25
- package/project/.sdk/src/cmp/scala/ReadmeTopTest_scala.ts +16 -24
- package/project/.sdk/src/cmp/scala/utility_scala.ts +25 -0
- package/project/.sdk/src/cmp/swift/EntityTypes_swift.ts +1 -1
- package/project/.sdk/src/cmp/swift/ReadmeEntity_swift.ts +3 -2
- package/project/.sdk/src/cmp/swift/ReadmeHowto_swift.ts +22 -8
- package/project/.sdk/src/cmp/swift/ReadmeModel_swift.ts +10 -9
- package/project/.sdk/src/cmp/swift/ReadmeQuick_swift.ts +16 -8
- package/project/.sdk/src/cmp/swift/ReadmeRef_swift.ts +20 -15
- package/project/.sdk/src/cmp/swift/ReadmeTopQuick_swift.ts +12 -7
- package/project/.sdk/src/cmp/swift/ReadmeTopTest_swift.ts +21 -10
- package/project/.sdk/src/cmp/swift/utility_swift.ts +14 -1
- package/project/.sdk/src/cmp/ts/ReadmeEntity_ts.ts +2 -8
- package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +11 -9
- package/project/.sdk/src/cmp/ts/ReadmeModel_ts.ts +9 -9
- package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +7 -13
- package/project/.sdk/src/cmp/ts/ReadmeRef_ts.ts +14 -23
- package/project/.sdk/src/cmp/ts/ReadmeTopQuick_ts.ts +8 -14
- package/project/.sdk/src/cmp/ts/ReadmeTopTest_ts.ts +29 -14
- package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +1 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +1 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +1 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityPatchOp.fragment.ts +1 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +1 -1
- package/project/.sdk/src/cmp/ts/utility_ts.ts +2 -1
- package/project/.sdk/src/cmp/zig/ReadmeEntity_zig.ts +3 -2
- package/project/.sdk/src/cmp/zig/ReadmeHowto_zig.ts +6 -2
- package/project/.sdk/src/cmp/zig/ReadmeQuick_zig.ts +4 -3
- package/project/.sdk/src/cmp/zig/ReadmeRef_zig.ts +5 -4
- package/project/.sdk/src/cmp/zig/ReadmeTopQuick_zig.ts +3 -2
- package/project/.sdk/src/cmp/zig/ReadmeTopTest_zig.ts +7 -6
- package/project/.sdk/src/cmp/zig/utility_zig.ts +13 -0
- package/project/.sdk/tm/c/utility/transform_request.c +1 -1
- package/project/.sdk/tm/clojure/src/sdk/core.clj +32 -26
- package/project/.sdk/tm/clojure/test/sdk/test/concurrency.clj +136 -0
- package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +3 -1
- package/project/.sdk/tm/cpp/core/types.hpp +36 -6
- package/project/.sdk/tm/cpp/test/concurrency_test.cpp +348 -0
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +42 -25
- package/project/.sdk/tm/csharp/core/Context.cs +8 -5
- package/project/.sdk/tm/csharp/test/ConcurrencyTest.cs +238 -0
- package/project/.sdk/tm/csharp/utility/Clean.cs +12 -10
- package/project/.sdk/tm/csharp/utility/TransformRequest.cs +1 -1
- package/project/.sdk/tm/elixir/lib/projectname/context.ex +3 -0
- package/project/.sdk/tm/elixir/lib/projectname/entity_base.ex +2 -1
- package/project/.sdk/tm/elixir/lib/projectname/utility.ex +31 -10
- package/project/.sdk/tm/elixir/test/concurrency_test.exs +176 -0
- package/project/.sdk/tm/go/core/context.go +5 -1
- package/project/.sdk/tm/go/test/concurrency_test.go +214 -0
- package/project/.sdk/tm/go/utility/transform_request.go +1 -1
- package/project/.sdk/tm/java/core/Context.java +6 -3
- package/project/.sdk/tm/java/test/ConcurrencyTest.java +221 -0
- package/project/.sdk/tm/java/utility/Clean.java +22 -17
- package/project/.sdk/tm/java/utility/TransformRequest.java +1 -1
- package/project/.sdk/tm/js/src/utility/TransformRequestUtility.js +1 -1
- package/project/.sdk/tm/kotlin/core/Context.kt +5 -3
- package/project/.sdk/tm/kotlin/test/ConcurrencyTest.kt +193 -0
- package/project/.sdk/tm/kotlin/utility/ResultTransform.kt +1 -1
- package/project/.sdk/tm/lua/utility/transform_request.lua +1 -1
- package/project/.sdk/tm/ocaml/Makefile +21 -8
- package/project/.sdk/tm/ocaml/sdk_runtime.ml +27 -12
- package/project/.sdk/tm/ocaml/sdk_types.ml +6 -2
- package/project/.sdk/tm/ocaml/test/concurrency_test.ml +148 -0
- package/project/.sdk/tm/perl/utility/transform_request.pm +1 -1
- package/project/.sdk/tm/php/feature/TestFeature.php +9 -9
- package/project/.sdk/tm/php/utility/TransformRequest.php +1 -1
- package/project/.sdk/tm/py/pkg/core/context.py +2 -2
- package/project/.sdk/tm/py/pkg/utility/clean.py +12 -8
- package/project/.sdk/tm/py/pkg/utility/transform_request.py +1 -1
- package/project/.sdk/tm/py/test/test_concurrency.py +177 -0
- package/project/.sdk/tm/rb/core/context.rb +8 -3
- package/project/.sdk/tm/rb/test/concurrency_test.rb +160 -0
- package/project/.sdk/tm/rb/utility/clean.rb +8 -7
- package/project/.sdk/tm/rb/utility/transform_request.rb +1 -1
- package/project/.sdk/tm/rust/utility/transform_request.rs +1 -1
- package/project/.sdk/tm/scala/Makefile +2 -0
- package/project/.sdk/tm/scala/core/Context.scala +6 -4
- package/project/.sdk/tm/scala/sdktest/ConcurrencyTest.scala +186 -0
- package/project/.sdk/tm/scala/utility/Transform.scala +1 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Context.swift +2 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/ResultUtil.swift +35 -12
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/ConcurrencyTest.swift +214 -0
- package/project/.sdk/tm/ts/src/utility/TransformRequestUtility.ts +1 -1
- package/project/.sdk/tm/zig/core/utility.zig +1 -1
- package/project/.sdk/tm/zig/feature/test.zig +10 -8
- package/project/sdkgen-package.json +1 -1
- package/src/cmp/ReadmeErrors.ts +5 -5
- package/src/cmp/ReadmeExplanation.ts +4 -5
- package/src/cmp/ReadmeQuick.ts +3 -1
- package/src/cmp/ReadmeTop.ts +10 -12
- package/src/helpers/definitionPlan.ts +8 -4
- package/src/helpers/naming.ts +12 -4
- package/src/helpers/opExample.ts +97 -25
- package/src/helpers/opShape.ts +25 -9
- package/src/sdkgen.ts +14 -3
- package/src/utility.ts +31 -4
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import {
|
|
3
3
|
cmp, camelify,
|
|
4
|
-
Content, Fragment
|
|
4
|
+
Content, Fragment,
|
|
5
|
+
entityClassName, entityCollection,
|
|
5
6
|
} from '@voxgig/sdkgen'
|
|
6
7
|
|
|
7
8
|
|
|
@@ -29,6 +30,7 @@ const EntityOperation = cmp(function Operation(props: any) {
|
|
|
29
30
|
ProjectName: model.const.Name,
|
|
30
31
|
EntityName: entity.Name,
|
|
31
32
|
entityname: entity.name,
|
|
33
|
+
EntyClass: entityClassName(entity, entityCollection(model), true),
|
|
32
34
|
'#Feature-Hook': ({ name, indent }: any) =>
|
|
33
35
|
Content({ indent }, `
|
|
34
36
|
($u->feature_hook)($ctx, "${name}");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, entityIdField, opRequestShape, phpEntityAccessor, opNeedsAction } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, entityIdField, opRequestShape, phpEntityAccessor, opNeedsAction, listMatchArg } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
// parse).
|
|
14
14
|
function phpLit(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 '1'
|
|
17
18
|
if ('BOOLEAN' === k) return 'true'
|
|
18
19
|
if ('ARRAY' === k || 'OBJECT' === k) return '[]'
|
|
@@ -133,8 +134,8 @@ $${entity.name} = $client->${phpEntityAccessor(entity.Name)}()->load(${loadArg})
|
|
|
133
134
|
Content(`#### Example: List
|
|
134
135
|
|
|
135
136
|
\`\`\`php
|
|
136
|
-
// list() returns an array of ${entity.Name}
|
|
137
|
-
$${entity.name}s = $client->${phpEntityAccessor(entity.Name)}()->list();
|
|
137
|
+
// list() returns an array of ${entity.Name} entities, one per record (throws on error).
|
|
138
|
+
$${entity.name}s = $client->${phpEntityAccessor(entity.Name)}()->list(${listMatchArg('php', entity)});
|
|
138
139
|
\`\`\`
|
|
139
140
|
|
|
140
141
|
`)
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, isAuthActive, envName, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, phpEntityAccessor } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, isAuthActive, envName, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, phpEntityAccessor, seededList, litPair } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import { KIT, getModelPath, nom } from '@voxgig/apidef'
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
function phpLit(type: any): string {
|
|
8
8
|
const k = canonScalarKey(type)
|
|
9
|
+
if ('NULL' === k) return 'null'
|
|
9
10
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
10
11
|
if ('BOOLEAN' === k) return 'true'
|
|
11
12
|
if ('ARRAY' === k || 'OBJECT' === k) return '[]'
|
|
@@ -27,29 +28,34 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
|
|
|
27
28
|
const { entity: exampleEntity, primaryOp } = pickExampleEntity(
|
|
28
29
|
Object.keys(seedable).length ? seedable : entity)
|
|
29
30
|
const eName = exampleEntity ? nom(exampleEntity, 'Name') : 'Entity'
|
|
30
|
-
// Model-driven id key
|
|
31
|
+
// Model-driven id key (null when the entity has none); the seed is keyed by model name.
|
|
31
32
|
const idF = exampleEntity ? entityIdField(exampleEntity) : null
|
|
32
33
|
const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
|
|
34
|
+
const listed = exampleEntity && 'list' === primaryOp
|
|
35
|
+
? seededList('php', exampleEntity, idF, 'test01') : null
|
|
33
36
|
const seedSentence = idF
|
|
34
37
|
? '. Seed fixture\ndata via the `entity` option so offline calls resolve without a live server'
|
|
35
38
|
: ''
|
|
39
|
+
const record = idF ? (listed ? listed.record : [litPair('php', idF, '"test01"')]).join(', ') : ''
|
|
36
40
|
const testCtor = idF
|
|
37
|
-
? `${model.const.Name}SDK::test([\n "entity" => ["${
|
|
41
|
+
? `${model.const.Name}SDK::test([\n "entity" => ["${exampleEntity.name}" => ["test01" => [${record}]]],\n])`
|
|
38
42
|
: `${model.const.Name}SDK::test()`
|
|
39
43
|
let testCallArg = ''
|
|
40
|
-
if (
|
|
44
|
+
if (listed) {
|
|
45
|
+
testCallArg = 0 < listed.call.length ? `[${listed.call.join(', ')}]` : ''
|
|
46
|
+
} else if (exampleEntity && isMatchOp) {
|
|
41
47
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
42
48
|
.filter((it: any) => !it.optional || it.name === idF)
|
|
43
49
|
.sort((a: any, b: any) => (a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
44
50
|
testCallArg = 0 < items.length
|
|
45
|
-
? `[${items.map((it: any) =>
|
|
51
|
+
? `[${items.map((it: any) => litPair('php', it.name, it.name === idF ? '"test01"' : phpLit(it.type))).join(', ')}]`
|
|
46
52
|
: ''
|
|
47
53
|
} else if (exampleEntity && ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp)) {
|
|
48
54
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
49
55
|
.filter((it: any) => it.name !== idF && it.name !== 'id')
|
|
50
56
|
const required = items.filter((it: any) => !it.optional)
|
|
51
57
|
const chosen = required.length ? required : items.slice(0, 3)
|
|
52
|
-
testCallArg = `[${chosen.map((it: any) =>
|
|
58
|
+
testCallArg = `[${chosen.map((it: any) => litPair('php', it.name, phpLit(it.type))).join(', ')}]`
|
|
53
59
|
}
|
|
54
60
|
|
|
55
61
|
// The op-driven test-mode line, shown only when the SDK has an entity op.
|
|
@@ -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` | `($reqmatch, $ctrl):
|
|
25
|
-
list: '| `list` | `(?array $reqmatch = null, $ctrl):
|
|
26
|
-
create: '| `create` | `($reqdata, $ctrl):
|
|
27
|
-
update: '| `update` | `($reqdata, $ctrl):
|
|
28
|
-
patch: '| `patch` | `($reqdata, $ctrl):
|
|
29
|
-
remove: '| `remove` | `($reqmatch, $ctrl):
|
|
24
|
+
load: '| `load` | `($reqmatch, $ctrl): mixed` | Load a single entity by match criteria, and return it. |',
|
|
25
|
+
list: '| `list` | `(?array $reqmatch = null, $ctrl): mixed` | List entities matching the criteria (call with no argument to list all), one per record. |',
|
|
26
|
+
create: '| `create` | `($reqdata, $ctrl): mixed` | Create a new entity, and return it. |',
|
|
27
|
+
update: '| `update` | `($reqdata, $ctrl): mixed` | Update an existing entity, and return it. |',
|
|
28
|
+
patch: '| `patch` | `($reqdata, $ctrl): mixed` | Change part of an existing entity, and return it. |',
|
|
29
|
+
remove: '| `remove` | `($reqmatch, $ctrl): mixed` | Remove an entity, and return it marked as deleted. |',
|
|
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')
|
|
@@ -94,9 +94,9 @@ ${opRows}
|
|
|
94
94
|
|
|
95
95
|
### Result shape
|
|
96
96
|
|
|
97
|
-
Entity operations return the
|
|
98
|
-
|
|
99
|
-
\`try\`/\`catch\` to handle failures.
|
|
97
|
+
Entity operations return the entity, and \`list\` an \`array\` of entities, one
|
|
98
|
+
per record; an entity's \`data_get()\` reads its record (an \`array\`). They
|
|
99
|
+
throw on error, so wrap calls in \`try\`/\`catch\` to handle failures.
|
|
100
100
|
|
|
101
101
|
The \`direct()\` escape hatch never throws — it returns a result \`array\`
|
|
102
102
|
you branch on via \`$result["ok"]\`:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, each, Content, isAuthActive, envName, canonKey, canonScalarKey, opRequestShape, entityIdField, entityDataIdField, entityOps, phpEntityAccessor } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, each, Content, isAuthActive, envName, canonKey, canonScalarKey, opRequestShape, entityIdField, entityDataIdField, entityOps, phpEntityAccessor, listMatchArg } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -55,6 +55,7 @@ $client = ${ctor};
|
|
|
55
55
|
// placeholder would not parse).
|
|
56
56
|
const phpLit = (type: any, placeholder: string = 'example'): string => {
|
|
57
57
|
const k = canonScalarKey(type)
|
|
58
|
+
if ('NULL' === k) return 'null'
|
|
58
59
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
59
60
|
if ('BOOLEAN' === k) return 'true'
|
|
60
61
|
if ('ARRAY' === k || 'OBJECT' === k) return '[]'
|
|
@@ -79,7 +80,7 @@ $client = ${ctor};
|
|
|
79
80
|
\`\`\`php
|
|
80
81
|
try {
|
|
81
82
|
// list() returns entity instances; data_get() reads each record.
|
|
82
|
-
$${eName.toLowerCase()}s = $client->${phpEntityAccessor(eName)}()->list();
|
|
83
|
+
$${eName.toLowerCase()}s = $client->${phpEntityAccessor(eName)}()->list(${listMatchArg('php', exampleEntity)});
|
|
83
84
|
foreach ($${eName.toLowerCase()}s as $record) {
|
|
84
85
|
$item = $record->data_get();
|
|
85
86
|
echo ${itemPrint} . "\\n";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape, phpEntityAccessor
|
|
2
|
+
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape, phpEntityAccessor, targetFeatures, opNeedsAction, bodyNote, listMatchArg } from '@voxgig/sdkgen'
|
|
3
3
|
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
4
4
|
|
|
5
5
|
import {
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
// parse).
|
|
15
15
|
function phpLit(type: any, placeholder: string = 'example'): string {
|
|
16
16
|
const k = canonScalarKey(type)
|
|
17
|
+
if ('NULL' === k) return 'null'
|
|
17
18
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
18
19
|
if ('BOOLEAN' === k) return 'true'
|
|
19
20
|
if ('ARRAY' === k || 'OBJECT' === k) return '[]'
|
|
@@ -24,33 +25,33 @@ function phpLit(type: any, placeholder: string = 'example'): string {
|
|
|
24
25
|
const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string }> = {
|
|
25
26
|
load: {
|
|
26
27
|
sig: 'load(array $reqmatch, ?array $ctrl = null): mixed',
|
|
27
|
-
returns: 'mixed — the
|
|
28
|
-
desc: 'Load a single entity matching the given criteria.
|
|
28
|
+
returns: 'mixed — the entity; throws on error',
|
|
29
|
+
desc: 'Load a single entity matching the given criteria. Returns the entity, whose record `data_get()` reads, and throws on error.',
|
|
29
30
|
},
|
|
30
31
|
list: {
|
|
31
32
|
sig: 'list(?array $reqmatch = null, ?array $ctrl = null): mixed',
|
|
32
|
-
returns: 'array — the
|
|
33
|
-
desc: 'List entities matching the given criteria (call with no argument to list all). Returns an array
|
|
33
|
+
returns: 'array — the entities, one per record; throws on error',
|
|
34
|
+
desc: 'List entities matching the given criteria (call with no argument to list all). Returns an array of entities, one per record, and throws on error.',
|
|
34
35
|
},
|
|
35
36
|
create: {
|
|
36
37
|
sig: 'create(array $reqdata, ?array $ctrl = null): mixed',
|
|
37
|
-
returns: 'mixed — the
|
|
38
|
-
desc: 'Create a new entity with the given data.
|
|
38
|
+
returns: 'mixed — the created entity; throws on error',
|
|
39
|
+
desc: 'Create a new entity with the given data. Returns the created entity and throws on error.',
|
|
39
40
|
},
|
|
40
41
|
update: {
|
|
41
42
|
sig: 'update(array $reqdata, ?array $ctrl = null): mixed',
|
|
42
|
-
returns: 'mixed — the
|
|
43
|
-
desc: 'Update an existing entity. The data must include the entity `id`.
|
|
43
|
+
returns: 'mixed — the updated entity; throws on error',
|
|
44
|
+
desc: 'Update an existing entity. The data must include the entity `id`. Returns the updated entity and throws on error.',
|
|
44
45
|
},
|
|
45
46
|
patch: {
|
|
46
47
|
sig: 'patch(array $reqdata, ?array $ctrl = null): mixed',
|
|
47
|
-
returns: 'mixed — the
|
|
48
|
-
desc: 'Change part of an existing entity: only the fields given are sent. The data must include the entity `id`.
|
|
48
|
+
returns: 'mixed — the patched entity; throws on error',
|
|
49
|
+
desc: 'Change part of an existing entity: only the fields given are sent. The data must include the entity `id`. Returns the patched entity and throws on error.',
|
|
49
50
|
},
|
|
50
51
|
remove: {
|
|
51
52
|
sig: 'remove(array $reqmatch, ?array $ctrl = null): mixed',
|
|
52
|
-
returns: 'mixed — the
|
|
53
|
-
desc: 'Remove the entity matching the given criteria.
|
|
53
|
+
returns: 'mixed — the entity, marked as deleted; throws on error',
|
|
54
|
+
desc: 'Remove the entity matching the given criteria. Returns the entity, marked as deleted, and throws on error.',
|
|
54
55
|
},
|
|
55
56
|
}
|
|
56
57
|
|
|
@@ -285,7 +286,7 @@ $result = $client->${phpEntityAccessor(ent.Name)}()->${opname}(${arg});
|
|
|
285
286
|
}
|
|
286
287
|
else if ('list' === opname) {
|
|
287
288
|
Content(`\`\`\`php
|
|
288
|
-
$results = $client->${phpEntityAccessor(ent.Name)}()->list();
|
|
289
|
+
$results = $client->${phpEntityAccessor(ent.Name)}()->list(${listMatchArg('php', ent)});
|
|
289
290
|
\`\`\`
|
|
290
291
|
|
|
291
292
|
`)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, isAuthActive, envName, canonKey, canonScalarKey, entityIdField, opRequestShape, phpEntityAccessor } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, isAuthActive, envName, canonKey, canonScalarKey, entityIdField, opRequestShape, phpEntityAccessor, listMatchArg } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
// doc test EXECUTES this block, so a comment placeholder would break it).
|
|
14
14
|
function phpLit(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 '1'
|
|
17
18
|
if ('BOOLEAN' === k) return 'true'
|
|
18
19
|
if ('ARRAY' === k || 'OBJECT' === k) return '[]'
|
|
@@ -50,8 +51,8 @@ $client = ${ctor};
|
|
|
50
51
|
let hasCall = false
|
|
51
52
|
|
|
52
53
|
if (opnames.includes('list')) {
|
|
53
|
-
Content(`// List all ${eName.toLowerCase()}s (
|
|
54
|
-
$${eName.toLowerCase()}s = $client->${phpEntityAccessor(eName)}()->list();
|
|
54
|
+
Content(`// List all ${eName.toLowerCase()}s (an array of entities, one per record; throws on error)
|
|
55
|
+
$${eName.toLowerCase()}s = $client->${phpEntityAccessor(eName)}()->list(${listMatchArg('php', exampleEntity)});
|
|
55
56
|
print_r(array_map(fn($item) => $item->data_get(), $${eName.toLowerCase()}s));
|
|
56
57
|
`)
|
|
57
58
|
hasCall = true
|
|
@@ -71,7 +72,7 @@ print_r(array_map(fn($item) => $item->data_get(), $${eName.toLowerCase()}s));
|
|
|
71
72
|
it.name === idF ? 'example_id' : 'example_' + it.name)}`).join(', ')}]`
|
|
72
73
|
: ''
|
|
73
74
|
Content(`
|
|
74
|
-
// Load a specific ${eName.toLowerCase()} (returns the
|
|
75
|
+
// Load a specific ${eName.toLowerCase()} (returns the entity; data_get() reads its record; throws on error)
|
|
75
76
|
$${eName.toLowerCase()} = $client->${phpEntityAccessor(eName)}()->load(${loadArg});
|
|
76
77
|
print_r($${eName.toLowerCase()}->data_get());
|
|
77
78
|
`)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, phpEntityAccessor } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, phpEntityAccessor, seededList, litPair } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
// A type-correct PHP literal for a field's canonical type.
|
|
12
12
|
function phpLit(type: any): string {
|
|
13
13
|
const k = canonScalarKey(type)
|
|
14
|
+
if ('NULL' === k) return 'null'
|
|
14
15
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
15
16
|
if ('BOOLEAN' === k) return 'true'
|
|
16
17
|
if ('ARRAY' === k || 'OBJECT' === k) return '[]'
|
|
@@ -33,9 +34,13 @@ const ReadmeTopTest = cmp(function ReadmeTopTest(props: any) {
|
|
|
33
34
|
// Model-driven id key: null when the entity has no id-like field.
|
|
34
35
|
const idF = entityIdField(exampleEntity)
|
|
35
36
|
const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
|
|
36
|
-
const
|
|
37
|
+
const listed = 'list' === primaryOp ? seededList('php', exampleEntity, idF, 'test01') : null
|
|
38
|
+
const recPairs = listed ? listed.record : idF ? [litPair('php', idF, '"test01"')] : []
|
|
39
|
+
const recBody = `[${recPairs.join(', ')}]`
|
|
37
40
|
let callArg = ''
|
|
38
|
-
if (
|
|
41
|
+
if (listed) {
|
|
42
|
+
callArg = 0 < listed.call.length ? `[${listed.call.join(', ')}]` : ''
|
|
43
|
+
} else if (isMatchOp) {
|
|
39
44
|
// Every REQUIRED match key (id first, then parent path params like
|
|
40
45
|
// page_id) — the same shape the runtime resolves path params from.
|
|
41
46
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
@@ -44,21 +49,22 @@ const ReadmeTopTest = cmp(function ReadmeTopTest(props: any) {
|
|
|
44
49
|
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
45
50
|
callArg = 0 < items.length
|
|
46
51
|
? `[${items.map((it: any) =>
|
|
47
|
-
|
|
52
|
+
litPair('php', it.name, it.name === idF ? '"test01"' : phpLit(it.type))).join(', ')}]`
|
|
48
53
|
: ''
|
|
49
54
|
} else if ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp) {
|
|
50
55
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
51
56
|
.filter((it: any) => it.name !== idF && it.name !== 'id')
|
|
52
57
|
const required = items.filter((it: any) => !it.optional)
|
|
53
58
|
const chosen = required.length ? required : items.slice(0, 3)
|
|
54
|
-
callArg = `[${chosen.map((it: any) =>
|
|
59
|
+
callArg = `[${chosen.map((it: any) => litPair('php', it.name, phpLit(it.type))).join(', ')}]`
|
|
55
60
|
}
|
|
56
|
-
// A list result is an array — name the variable accordingly.
|
|
61
|
+
// A list result is an array — name the variable accordingly. The fixture
|
|
62
|
+
// key is the model name, which the mock looks the entity up by.
|
|
57
63
|
const eVar = ename + ('list' === primaryOp ? 's' : '')
|
|
58
64
|
Content(`\`\`\`php
|
|
59
65
|
// Seed fixture data so offline calls resolve without a live server.
|
|
60
66
|
$client = ${model.const.Name}SDK::test([
|
|
61
|
-
"entity" => ["${
|
|
67
|
+
"entity" => ["${exampleEntity.name}" => ["test01" => ${recBody}]],
|
|
62
68
|
]);
|
|
63
69
|
$${eVar} = $client->${phpEntityAccessor(eName)}()->${primaryOp}(${callArg});
|
|
64
70
|
\`\`\`
|
|
@@ -9,8 +9,8 @@ require_once __DIR__ . '/../core/Helpers.php';
|
|
|
9
9
|
* @param EntityNameCreateData|array|null $reqdata Body data as an assoc-array;
|
|
10
10
|
* a typed EntityNameCreateData names the shape.
|
|
11
11
|
* @param mixed $ctrl Optional per-call control overrides.
|
|
12
|
-
* @return
|
|
13
|
-
*
|
|
12
|
+
* @return EntyClass The created EntityName entity, whose data_get() reads
|
|
13
|
+
* its record; throws ProjectNameError on failure (item-5 convention).
|
|
14
14
|
*/
|
|
15
15
|
public function create(?array $reqdata = null, $ctrl = null): mixed
|
|
16
16
|
{
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* @param EntityNameListMatch|array|null $reqmatch Match filter (any subset
|
|
7
7
|
* of EntityName fields) as an assoc-array; EntityNameListMatch names the shape.
|
|
8
8
|
* @param mixed $ctrl Optional per-call control overrides.
|
|
9
|
-
* @return
|
|
10
|
-
*
|
|
9
|
+
* @return EntyClass[] The EntityName entities, one per record, each read
|
|
10
|
+
* with data_get(); throws ProjectNameError on failure (item-5 convention).
|
|
11
11
|
*/
|
|
12
12
|
public function list(?array $reqmatch = null, $ctrl = null): mixed
|
|
13
13
|
{
|
|
@@ -9,8 +9,8 @@ require_once __DIR__ . '/../core/Helpers.php';
|
|
|
9
9
|
* @param EntityNameLoadMatch|array|null $reqmatch Match criteria (id/query
|
|
10
10
|
* fields) as an assoc-array; a typed EntityNameLoadMatch names the shape.
|
|
11
11
|
* @param mixed $ctrl Optional per-call control overrides.
|
|
12
|
-
* @return
|
|
13
|
-
*
|
|
12
|
+
* @return EntyClass The loaded EntityName entity, whose data_get() reads
|
|
13
|
+
* its record; throws ProjectNameError on failure (item-5 convention).
|
|
14
14
|
*/
|
|
15
15
|
public function load(?array $reqmatch = null, $ctrl = null): mixed
|
|
16
16
|
{
|
|
@@ -9,8 +9,8 @@ require_once __DIR__ . '/../core/Helpers.php';
|
|
|
9
9
|
* @param EntityNamePatchData|array|null $reqdata Body data as an assoc-array;
|
|
10
10
|
* a typed EntityNamePatchData names the shape.
|
|
11
11
|
* @param mixed $ctrl Optional per-call control overrides.
|
|
12
|
-
* @return
|
|
13
|
-
*
|
|
12
|
+
* @return EntyClass The patched EntityName entity, whose data_get() reads
|
|
13
|
+
* its record; throws ProjectNameError on failure (item-5 convention).
|
|
14
14
|
*/
|
|
15
15
|
public function patch(?array $reqdata = null, $ctrl = null): mixed
|
|
16
16
|
{
|
|
@@ -9,8 +9,8 @@ require_once __DIR__ . '/../core/Helpers.php';
|
|
|
9
9
|
* @param EntityNameRemoveMatch|array|null $reqmatch Match criteria (id/query
|
|
10
10
|
* fields) as an assoc-array; EntityNameRemoveMatch names the shape.
|
|
11
11
|
* @param mixed $ctrl Optional per-call control overrides.
|
|
12
|
-
* @return
|
|
13
|
-
*
|
|
12
|
+
* @return EntyClass The removed EntityName entity, marked as deleted; throws
|
|
13
|
+
* ProjectNameError on failure (item-5 convention).
|
|
14
14
|
*/
|
|
15
15
|
public function remove(?array $reqmatch = null, $ctrl = null): mixed
|
|
16
16
|
{
|
|
@@ -9,8 +9,8 @@ require_once __DIR__ . '/../core/Helpers.php';
|
|
|
9
9
|
* @param EntityNameUpdateData|array|null $reqdata Body data as an assoc-array;
|
|
10
10
|
* a typed EntityNameUpdateData names the shape.
|
|
11
11
|
* @param mixed $ctrl Optional per-call control overrides.
|
|
12
|
-
* @return
|
|
13
|
-
*
|
|
12
|
+
* @return EntyClass The updated EntityName entity, whose data_get() reads
|
|
13
|
+
* its record; throws ProjectNameError on failure (item-5 convention).
|
|
14
14
|
*/
|
|
15
15
|
public function update(?array $reqdata = null, $ctrl = null): mixed
|
|
16
16
|
{
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import {
|
|
3
3
|
cmp, camelify,
|
|
4
|
-
Content, Fragment
|
|
4
|
+
Content, Fragment,
|
|
5
|
+
entityClassName, entityCollection,
|
|
5
6
|
} from '@voxgig/sdkgen'
|
|
6
7
|
|
|
7
8
|
|
|
@@ -29,6 +30,7 @@ const EntityOperation = cmp(function Operation(props: any) {
|
|
|
29
30
|
ProjectName: model.const.Name,
|
|
30
31
|
EntityName: entity.Name,
|
|
31
32
|
entityname: entity.name,
|
|
33
|
+
EntyClass: entityClassName(entity, entityCollection(model)),
|
|
32
34
|
'#Feature-Hook': ({ name, indent }: any) =>
|
|
33
35
|
Content({ indent }, `
|
|
34
36
|
u.feature_hook(ctx, "${name}")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, entityIdField, opRequestShape, safeVarName, exampleVarName,
|
|
2
|
+
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, entityIdField, opRequestShape, safeVarName, exampleVarName, opNeedsAction, listMatchArg } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
|
|
10
10
|
function pyLit(type: any, placeholder: string = 'example'): string {
|
|
11
11
|
const k = canonScalarKey(type)
|
|
12
|
+
if ('NULL' === k) return 'None'
|
|
12
13
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
13
14
|
if ('BOOLEAN' === k) return 'True'
|
|
14
15
|
if ('ARRAY' === k) return '[]'
|
|
@@ -17,12 +18,6 @@ function pyLit(type: any, placeholder: string = 'example'): string {
|
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
|
|
20
|
-
function listMatchArg(ent: any): string {
|
|
21
|
-
const idF = entityIdField(ent)
|
|
22
|
-
return matchArg('py', ent, 'list', idF, idLiteral(ent, 'list', idF))
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
21
|
const OP_DESC: Record<string, { method: string, desc: string }> = {
|
|
27
22
|
load: { method: 'load(match)', desc: 'Load a single entity by match criteria.' },
|
|
28
23
|
list: { method: 'list()', desc: 'List entities, optionally matching the given criteria.' },
|
|
@@ -139,7 +134,7 @@ ${eVar} = client.${entity.Name}().load(${loadArg})
|
|
|
139
134
|
Content(`#### Example: List
|
|
140
135
|
|
|
141
136
|
\`\`\`python
|
|
142
|
-
${eVar}s = client.${entity.Name}().list(${listMatchArg(entity)})
|
|
137
|
+
${eVar}s = client.${entity.Name}().list(${listMatchArg('py', entity)})
|
|
143
138
|
\`\`\`
|
|
144
139
|
|
|
145
140
|
`)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, isAuthActive, envName, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, safeVarName, exampleVarName } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, isAuthActive, envName, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, safeVarName, exampleVarName, requiredItems, litPair } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
|
|
11
11
|
function pyLit(type: any): string {
|
|
12
12
|
const k = canonScalarKey(type)
|
|
13
|
+
if ('NULL' === k) return 'None'
|
|
13
14
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
14
15
|
if ('BOOLEAN' === k) return 'True'
|
|
15
16
|
if ('ARRAY' === k) return '[]'
|
|
@@ -33,28 +34,27 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
|
|
|
33
34
|
const idF = exampleEntity ? entityIdField(exampleEntity) : null
|
|
34
35
|
const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
|
|
35
36
|
let testArg = ''
|
|
36
|
-
if (exampleEntity && isMatchOp) {
|
|
37
|
-
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
38
|
-
.filter((it: any) => !it.optional || it.name === idF)
|
|
37
|
+
if (exampleEntity && (isMatchOp || ('list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length))) {
|
|
38
|
+
const items = (isMatchOp ? opRequestShape(exampleEntity, primaryOp).items
|
|
39
|
+
.filter((it: any) => !it.optional || it.name === idF) : requiredItems(exampleEntity, 'list'))
|
|
39
40
|
.sort((a: any, b: any) => (a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
40
41
|
testArg = 0 < items.length
|
|
41
|
-
? `{${items.map((it: any) =>
|
|
42
|
+
? `{${items.map((it: any) => litPair('py', it.name, isMatchOp && it.name === idF ? '"test01"' : pyLit(it.type))).join(', ')}}`
|
|
42
43
|
: ''
|
|
43
44
|
} else if (exampleEntity && ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp)) {
|
|
44
45
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
45
46
|
.filter((it: any) => it.name !== idF && it.name !== 'id')
|
|
46
47
|
const required = items.filter((it: any) => !it.optional)
|
|
47
48
|
const chosen = required.length ? required : items.slice(0, 3)
|
|
48
|
-
testArg = `{${chosen.map((it: any) =>
|
|
49
|
+
testArg = `{${chosen.map((it: any) => litPair('py', it.name, pyLit(it.type))).join(', ')}}`
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
// The op-driven test-mode line, shown only when the SDK has an entity op.
|
|
52
53
|
// A direct()-only SDK (no ops anywhere) shows a direct() call instead.
|
|
53
54
|
const testModeExample = primaryOp
|
|
54
|
-
? `# Entity ops return the
|
|
55
|
-
# call data_get() for the record.
|
|
55
|
+
? `# Entity ops return the entity, and list one per record; they raise on error.
|
|
56
56
|
${eVar} = client.${eName}().${primaryOp}(${testArg})
|
|
57
|
-
#
|
|
57
|
+
# data_get() on an entity reads its mock response record`
|
|
58
58
|
: `result = client.direct({"path": "/api/resource", "method": "GET"})
|
|
59
59
|
print(result)`
|
|
60
60
|
|
|
@@ -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` | `(reqmatch, ctrl) -> any` | Load a single entity by match criteria. Raises on error. |',
|
|
25
|
-
list: '| `list` | `(reqmatch, ctrl) -> list` | List entities matching the criteria. Raises on error. |',
|
|
26
|
-
create: '| `create` | `(reqdata, ctrl) -> any` | Create a new entity. Raises on error. |',
|
|
27
|
-
update: '| `update` | `(reqdata, ctrl) -> any` | Update an existing entity. Raises on error. |',
|
|
28
|
-
patch: '| `patch` | `(reqdata, ctrl) -> any` | Change part of an existing entity. Raises on error. |',
|
|
29
|
-
remove: '| `remove` | `(reqmatch, ctrl) -> any` | Remove an entity. Raises on error. |',
|
|
24
|
+
load: '| `load` | `(reqmatch, ctrl) -> any` | Load a single entity by match criteria, and return it. Raises on error. |',
|
|
25
|
+
list: '| `list` | `(reqmatch, ctrl) -> list` | List entities matching the criteria, one per record. Raises on error. |',
|
|
26
|
+
create: '| `create` | `(reqdata, ctrl) -> any` | Create a new entity, and return it. Raises on error. |',
|
|
27
|
+
update: '| `update` | `(reqdata, ctrl) -> any` | Update an existing entity, and return it. Raises on error. |',
|
|
28
|
+
patch: '| `patch` | `(reqdata, ctrl) -> any` | Change part of an existing entity, and return it. Raises on error. |',
|
|
29
|
+
remove: '| `remove` | `(reqmatch, ctrl) -> any` | 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')
|
|
@@ -95,9 +95,9 @@ ${opRows}
|
|
|
95
95
|
|
|
96
96
|
### Result shape
|
|
97
97
|
|
|
98
|
-
Entity operations return the
|
|
99
|
-
|
|
100
|
-
\`try\`/\`except\` to handle failures.
|
|
98
|
+
Entity operations return the entity, and \`list\` a \`list\` of entities, one
|
|
99
|
+
per record; an entity's \`data_get()\` reads its record (a \`dict\`). They raise
|
|
100
|
+
on error, so wrap calls in \`try\`/\`except\` to handle failures.
|
|
101
101
|
|
|
102
102
|
The \`direct()\` escape hatch never raises — it returns a result \`dict\`
|
|
103
103
|
you branch on via \`result["ok"]\`:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, each, Content, isAuthActive, envName, canonKey, canonScalarKey, opRequestShape, entityIdField, entityDataIdField, entityOps, safeVarName, exampleVarName,
|
|
2
|
+
import { cmp, each, Content, isAuthActive, envName, canonKey, canonScalarKey, opRequestShape, entityIdField, entityDataIdField, entityOps, safeVarName, exampleVarName, serverVariables, listMatchArg } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -8,12 +8,6 @@ import {
|
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
function listMatchArg(ent: any): string {
|
|
12
|
-
const idF = entityIdField(ent)
|
|
13
|
-
return matchArg('py', ent, 'list', idF, idLiteral(ent, 'list', idF))
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
11
|
const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
|
|
18
12
|
const { target, ctx$: { model } } = props
|
|
19
13
|
|
|
@@ -75,6 +69,7 @@ client = ${ctor}
|
|
|
75
69
|
// placeholder would not parse).
|
|
76
70
|
const pyLit = (type: any, placeholder: string = 'example'): string => {
|
|
77
71
|
const k = canonScalarKey(type)
|
|
72
|
+
if ('NULL' === k) return 'None'
|
|
78
73
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
79
74
|
if ('BOOLEAN' === k) return 'True'
|
|
80
75
|
if ('ARRAY' === k) return '[]'
|
|
@@ -85,14 +80,14 @@ client = ${ctor}
|
|
|
85
80
|
if (opnames.includes('list')) {
|
|
86
81
|
Content(`### 2. List ${eName.toLowerCase()} records
|
|
87
82
|
|
|
88
|
-
\`list()\` returns a \`list\` of
|
|
89
|
-
error
|
|
83
|
+
\`list()\` returns a \`list\` of entities, one per record, and raises on
|
|
84
|
+
error; an entity's \`data_get()\` reads its record (a \`dict\`).
|
|
90
85
|
|
|
91
86
|
\`\`\`python
|
|
92
87
|
try:
|
|
93
|
-
${eVar}s = client.${eName}().list(${listMatchArg(exampleEntity)})
|
|
88
|
+
${eVar}s = client.${eName}().list(${listMatchArg('py', exampleEntity)})
|
|
94
89
|
for ${eVar} in ${eVar}s:
|
|
95
|
-
print(${eVar})
|
|
90
|
+
print(${eVar}.data_get())
|
|
96
91
|
except Exception as err:
|
|
97
92
|
print(f"list failed: {err}")
|
|
98
93
|
\`\`\`
|
|
@@ -125,7 +120,7 @@ ${neName} is nested under ${parentName}, so provide the \`${parentParam}\`.
|
|
|
125
120
|
\`\`\`python
|
|
126
121
|
try:
|
|
127
122
|
${neVar} = client.${neName}().load({${neMatch.join(', ')}})
|
|
128
|
-
print(${neVar})
|
|
123
|
+
print(${neVar}.data_get())
|
|
129
124
|
except Exception as err:
|
|
130
125
|
print(f"load failed: {err}")
|
|
131
126
|
\`\`\`
|
|
@@ -150,7 +145,7 @@ except Exception as err:
|
|
|
150
145
|
\`\`\`python
|
|
151
146
|
try:
|
|
152
147
|
${eVar} = client.${eName}().load(${loadArg})
|
|
153
|
-
print(${eVar})
|
|
148
|
+
print(${eVar}.data_get())
|
|
154
149
|
except Exception as err:
|
|
155
150
|
print(f"load failed: {err}")
|
|
156
151
|
\`\`\`
|
|
@@ -196,7 +191,7 @@ created = client.${eName}().create({${examplePairs('create').join(', ')}})
|
|
|
196
191
|
if (opnames.includes('update')) {
|
|
197
192
|
const updatePairs = (idF ? [`"${idF}": ${idValueFor('update')}`] : []).concat(examplePairs('update'))
|
|
198
193
|
const fromCreated = null != dataIdF && opnames.includes('create')
|
|
199
|
-
Content(`# Update${fromCreated ? " — the created
|
|
194
|
+
Content(`# Update${fromCreated ? " — the created entity's record holds its id" : ''}
|
|
200
195
|
client.${eName}().update({${updatePairs.join(', ')}})
|
|
201
196
|
|
|
202
197
|
`)
|