@voxgig/sdkgen 4.34.1 → 4.34.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/voxgig-sdkgen +1 -1
- package/dist/cmp/ReadmeErrors.js +3 -3
- package/dist/cmp/ReadmeErrors.js.map +1 -1
- package/dist/cmp/ReadmeExplanation.js +3 -3
- package/dist/cmp/ReadmeExplanation.js.map +1 -1
- package/dist/cmp/ReadmeQuick.js +3 -1
- package/dist/cmp/ReadmeQuick.js.map +1 -1
- package/dist/cmp/ReadmeTop.js +9 -8
- package/dist/cmp/ReadmeTop.js.map +1 -1
- package/dist/helpers/definitionPlan.js +8 -4
- package/dist/helpers/definitionPlan.js.map +1 -1
- package/dist/helpers/naming.d.ts +2 -1
- package/dist/helpers/naming.js +11 -4
- package/dist/helpers/naming.js.map +1 -1
- package/dist/helpers/opExample.d.ts +16 -2
- package/dist/helpers/opExample.js +80 -21
- package/dist/helpers/opExample.js.map +1 -1
- package/dist/helpers/opShape.d.ts +3 -1
- package/dist/helpers/opShape.js +21 -8
- package/dist/helpers/opShape.js.map +1 -1
- package/dist/sdkgen.d.ts +4 -4
- package/dist/sdkgen.js +12 -4
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utility.d.ts +2 -1
- package/dist/utility.js +29 -3
- package/dist/utility.js.map +1 -1
- package/package.json +2 -2
- package/project/.sdk/src/cmp/c/ReadmeEntity_c.ts +3 -2
- package/project/.sdk/src/cmp/c/ReadmeHowto_c.ts +7 -3
- package/project/.sdk/src/cmp/c/ReadmeQuick_c.ts +3 -2
- package/project/.sdk/src/cmp/c/ReadmeRef_c.ts +5 -4
- package/project/.sdk/src/cmp/c/ReadmeTopQuick_c.ts +3 -2
- package/project/.sdk/src/cmp/c/ReadmeTopTest_c.ts +8 -7
- package/project/.sdk/src/cmp/c/utility_c.ts +21 -2
- package/project/.sdk/src/cmp/clojure/ReadmeEntity_clojure.ts +4 -1
- package/project/.sdk/src/cmp/clojure/ReadmeHowto_clojure.ts +17 -6
- package/project/.sdk/src/cmp/clojure/ReadmeModel_clojure.ts +6 -6
- package/project/.sdk/src/cmp/clojure/ReadmeQuick_clojure.ts +13 -8
- package/project/.sdk/src/cmp/clojure/ReadmeRef_clojure.ts +21 -18
- package/project/.sdk/src/cmp/clojure/ReadmeTopQuick_clojure.ts +6 -3
- package/project/.sdk/src/cmp/clojure/ReadmeTopTest_clojure.ts +16 -9
- package/project/.sdk/src/cmp/clojure/TestClean_clojure.ts +4 -4
- package/project/.sdk/src/cmp/clojure/fragment/Entity.fragment.clj +2 -1
- package/project/.sdk/src/cmp/clojure/utility_clojure.ts +14 -0
- package/project/.sdk/src/cmp/cpp/ReadmeEntity_cpp.ts +3 -2
- package/project/.sdk/src/cmp/cpp/ReadmeHowto_cpp.ts +7 -3
- package/project/.sdk/src/cmp/cpp/ReadmeQuick_cpp.ts +3 -2
- package/project/.sdk/src/cmp/cpp/ReadmeRef_cpp.ts +6 -5
- package/project/.sdk/src/cmp/cpp/ReadmeTopQuick_cpp.ts +3 -2
- package/project/.sdk/src/cmp/cpp/ReadmeTopTest_cpp.ts +8 -7
- package/project/.sdk/src/cmp/cpp/utility_cpp.ts +13 -0
- package/project/.sdk/src/cmp/csharp/ReadmeEntity_csharp.ts +3 -2
- package/project/.sdk/src/cmp/csharp/ReadmeHowto_csharp.ts +20 -8
- package/project/.sdk/src/cmp/csharp/ReadmeQuick_csharp.ts +13 -8
- package/project/.sdk/src/cmp/csharp/ReadmeRef_csharp.ts +10 -5
- package/project/.sdk/src/cmp/csharp/ReadmeTopQuick_csharp.ts +14 -7
- package/project/.sdk/src/cmp/csharp/ReadmeTopTest_csharp.ts +18 -10
- package/project/.sdk/src/cmp/csharp/utility_csharp.ts +13 -0
- package/project/.sdk/src/cmp/elixir/ReadmeEntity_elixir.ts +4 -4
- package/project/.sdk/src/cmp/elixir/ReadmeExplanation_elixir.ts +2 -1
- package/project/.sdk/src/cmp/elixir/ReadmeHowto_elixir.ts +13 -6
- package/project/.sdk/src/cmp/elixir/ReadmeModel_elixir.ts +5 -5
- package/project/.sdk/src/cmp/elixir/ReadmeQuick_elixir.ts +13 -10
- package/project/.sdk/src/cmp/elixir/ReadmeRef_elixir.ts +11 -11
- package/project/.sdk/src/cmp/elixir/ReadmeTopQuick_elixir.ts +8 -6
- package/project/.sdk/src/cmp/elixir/ReadmeTopTest_elixir.ts +14 -10
- package/project/.sdk/src/cmp/elixir/fragment/EntityCreateOp.fragment.ex +4 -3
- package/project/.sdk/src/cmp/elixir/fragment/EntityListOp.fragment.ex +4 -3
- package/project/.sdk/src/cmp/elixir/fragment/EntityLoadOp.fragment.ex +4 -3
- package/project/.sdk/src/cmp/elixir/fragment/EntityPatchOp.fragment.ex +4 -3
- package/project/.sdk/src/cmp/elixir/fragment/EntityRemoveOp.fragment.ex +4 -3
- package/project/.sdk/src/cmp/elixir/fragment/EntityUpdateOp.fragment.ex +4 -3
- package/project/.sdk/src/cmp/elixir/utility_elixir.ts +12 -0
- package/project/.sdk/src/cmp/go/ReadmeEntity_go.ts +8 -5
- package/project/.sdk/src/cmp/go/ReadmeExplanation_go.ts +3 -1
- package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +20 -8
- package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +16 -13
- package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +14 -13
- package/project/.sdk/src/cmp/go/ReadmeRef_go.ts +14 -13
- package/project/.sdk/src/cmp/go/ReadmeTopQuick_go.ts +10 -8
- package/project/.sdk/src/cmp/go/ReadmeTopTest_go.ts +6 -2
- package/project/.sdk/src/cmp/go/utility_go.ts +1 -1
- package/project/.sdk/src/cmp/java/ReadmeEntity_java.ts +8 -19
- package/project/.sdk/src/cmp/java/ReadmeHowto_java.ts +19 -22
- package/project/.sdk/src/cmp/java/ReadmeModel_java.ts +10 -9
- package/project/.sdk/src/cmp/java/ReadmeQuick_java.ts +24 -28
- package/project/.sdk/src/cmp/java/ReadmeRef_java.ts +27 -35
- package/project/.sdk/src/cmp/java/ReadmeTopQuick_java.ts +22 -25
- package/project/.sdk/src/cmp/java/ReadmeTopTest_java.ts +18 -24
- package/project/.sdk/src/cmp/java/utility_java.ts +25 -0
- package/project/.sdk/src/cmp/js/EntityOperation_js.ts +3 -1
- package/project/.sdk/src/cmp/js/ReadmeEntity_js.ts +2 -8
- package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +11 -9
- package/project/.sdk/src/cmp/js/ReadmeModel_js.ts +9 -9
- package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +7 -13
- package/project/.sdk/src/cmp/js/ReadmeRef_js.ts +14 -15
- package/project/.sdk/src/cmp/js/ReadmeTopQuick_js.ts +16 -11
- package/project/.sdk/src/cmp/js/ReadmeTopTest_js.ts +11 -7
- package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +1 -1
- package/project/.sdk/src/cmp/js/fragment/EntityListOp.fragment.js +1 -1
- package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +1 -1
- package/project/.sdk/src/cmp/js/fragment/EntityPatchOp.fragment.js +1 -1
- package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +1 -1
- package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +1 -1
- package/project/.sdk/src/cmp/js/utility_js.ts +2 -1
- package/project/.sdk/src/cmp/kotlin/ReadmeEntity_kotlin.ts +3 -2
- package/project/.sdk/src/cmp/kotlin/ReadmeHowto_kotlin.ts +19 -9
- package/project/.sdk/src/cmp/kotlin/ReadmeModel_kotlin.ts +10 -9
- package/project/.sdk/src/cmp/kotlin/ReadmeQuick_kotlin.ts +14 -9
- package/project/.sdk/src/cmp/kotlin/ReadmeRef_kotlin.ts +18 -15
- package/project/.sdk/src/cmp/kotlin/ReadmeTopQuick_kotlin.ts +14 -8
- package/project/.sdk/src/cmp/kotlin/ReadmeTopTest_kotlin.ts +17 -10
- package/project/.sdk/src/cmp/kotlin/utility_kotlin.ts +21 -1
- package/project/.sdk/src/cmp/lua/ReadmeEntity_lua.ts +3 -2
- package/project/.sdk/src/cmp/lua/ReadmeExamplesTest_lua.ts +7 -4
- package/project/.sdk/src/cmp/lua/ReadmeHowto_lua.ts +9 -7
- package/project/.sdk/src/cmp/lua/ReadmeModel_lua.ts +13 -13
- package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +20 -9
- package/project/.sdk/src/cmp/lua/ReadmeRef_lua.ts +9 -8
- package/project/.sdk/src/cmp/lua/ReadmeTopQuick_lua.ts +15 -7
- package/project/.sdk/src/cmp/lua/ReadmeTopTest_lua.ts +6 -5
- package/project/.sdk/src/cmp/lua/fragment/Entity.fragment.lua +1 -0
- package/project/.sdk/src/cmp/lua/fragment/EntityCreateOp.fragment.lua +1 -1
- package/project/.sdk/src/cmp/lua/fragment/EntityListOp.fragment.lua +1 -1
- package/project/.sdk/src/cmp/lua/fragment/EntityLoadOp.fragment.lua +1 -1
- package/project/.sdk/src/cmp/lua/fragment/EntityPatchOp.fragment.lua +1 -1
- package/project/.sdk/src/cmp/lua/fragment/EntityRemoveOp.fragment.lua +1 -1
- package/project/.sdk/src/cmp/lua/fragment/EntityUpdateOp.fragment.lua +1 -1
- package/project/.sdk/src/cmp/ocaml/ReadmeEntity_ocaml.ts +3 -2
- package/project/.sdk/src/cmp/ocaml/ReadmeHowto_ocaml.ts +3 -2
- package/project/.sdk/src/cmp/ocaml/ReadmeModel_ocaml.ts +1 -0
- package/project/.sdk/src/cmp/ocaml/ReadmeQuick_ocaml.ts +5 -3
- package/project/.sdk/src/cmp/ocaml/ReadmeRef_ocaml.ts +10 -8
- package/project/.sdk/src/cmp/ocaml/ReadmeTopQuick_ocaml.ts +4 -2
- package/project/.sdk/src/cmp/ocaml/ReadmeTopTest_ocaml.ts +3 -2
- package/project/.sdk/src/cmp/ocaml/utility_ocaml.ts +13 -1
- package/project/.sdk/src/cmp/perl/ReadmeEntity_perl.ts +4 -1
- package/project/.sdk/src/cmp/perl/ReadmeHowto_perl.ts +10 -5
- package/project/.sdk/src/cmp/perl/ReadmeModel_perl.ts +6 -6
- package/project/.sdk/src/cmp/perl/ReadmeQuick_perl.ts +8 -5
- package/project/.sdk/src/cmp/perl/ReadmeRef_perl.ts +21 -18
- package/project/.sdk/src/cmp/perl/ReadmeTopQuick_perl.ts +6 -3
- package/project/.sdk/src/cmp/perl/ReadmeTopTest_perl.ts +11 -8
- package/project/.sdk/src/cmp/perl/fragment/Entity.fragment.pm +1 -1
- package/project/.sdk/src/cmp/perl/fragment/EntityCreateOp.fragment.pm +2 -2
- package/project/.sdk/src/cmp/perl/fragment/EntityLoadOp.fragment.pm +2 -2
- package/project/.sdk/src/cmp/perl/fragment/EntityPatchOp.fragment.pm +2 -2
- package/project/.sdk/src/cmp/perl/fragment/EntityRemoveOp.fragment.pm +1 -1
- package/project/.sdk/src/cmp/perl/fragment/EntityUpdateOp.fragment.pm +2 -2
- package/project/.sdk/src/cmp/perl/utility_perl.ts +11 -1
- package/project/.sdk/src/cmp/php/EntityOperation_php.ts +3 -1
- package/project/.sdk/src/cmp/php/ReadmeEntity_php.ts +4 -3
- package/project/.sdk/src/cmp/php/ReadmeHowto_php.ts +12 -6
- package/project/.sdk/src/cmp/php/ReadmeModel_php.ts +9 -9
- package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +3 -2
- package/project/.sdk/src/cmp/php/ReadmeRef_php.ts +15 -14
- package/project/.sdk/src/cmp/php/ReadmeTopQuick_php.ts +5 -4
- package/project/.sdk/src/cmp/php/ReadmeTopTest_php.ts +13 -7
- package/project/.sdk/src/cmp/php/fragment/EntityCreateOp.fragment.php +2 -2
- package/project/.sdk/src/cmp/php/fragment/EntityListOp.fragment.php +2 -2
- package/project/.sdk/src/cmp/php/fragment/EntityLoadOp.fragment.php +2 -2
- package/project/.sdk/src/cmp/php/fragment/EntityPatchOp.fragment.php +2 -2
- package/project/.sdk/src/cmp/php/fragment/EntityRemoveOp.fragment.php +2 -2
- package/project/.sdk/src/cmp/php/fragment/EntityUpdateOp.fragment.php +2 -2
- package/project/.sdk/src/cmp/py/EntityOperation_py.ts +3 -1
- package/project/.sdk/src/cmp/py/ReadmeEntity_py.ts +3 -8
- package/project/.sdk/src/cmp/py/ReadmeHowto_py.ts +9 -9
- package/project/.sdk/src/cmp/py/ReadmeModel_py.ts +9 -9
- package/project/.sdk/src/cmp/py/ReadmeQuick_py.ts +9 -14
- package/project/.sdk/src/cmp/py/ReadmeRef_py.ts +23 -30
- package/project/.sdk/src/cmp/py/ReadmeTopQuick_py.ts +7 -12
- package/project/.sdk/src/cmp/py/ReadmeTopTest_py.ts +8 -7
- package/project/.sdk/src/cmp/py/fragment/EntityCreateOp.fragment.py +1 -1
- package/project/.sdk/src/cmp/py/fragment/EntityListOp.fragment.py +1 -1
- package/project/.sdk/src/cmp/py/fragment/EntityLoadOp.fragment.py +1 -1
- package/project/.sdk/src/cmp/py/fragment/EntityPatchOp.fragment.py +1 -1
- package/project/.sdk/src/cmp/py/fragment/EntityRemoveOp.fragment.py +1 -1
- package/project/.sdk/src/cmp/py/fragment/EntityUpdateOp.fragment.py +1 -1
- package/project/.sdk/src/cmp/rb/EntityOperation_rb.ts +3 -1
- package/project/.sdk/src/cmp/rb/EntityTypes_rb.ts +2 -1
- package/project/.sdk/src/cmp/rb/ReadmeEntity_rb.ts +4 -1
- package/project/.sdk/src/cmp/rb/ReadmeExamplesTest_rb.ts +3 -2
- package/project/.sdk/src/cmp/rb/ReadmeHowto_rb.ts +20 -10
- package/project/.sdk/src/cmp/rb/ReadmeModel_rb.ts +10 -9
- package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +6 -3
- package/project/.sdk/src/cmp/rb/ReadmeRef_rb.ts +14 -11
- package/project/.sdk/src/cmp/rb/ReadmeTopQuick_rb.ts +6 -3
- package/project/.sdk/src/cmp/rb/ReadmeTopTest_rb.ts +14 -10
- package/project/.sdk/src/cmp/rb/fragment/EntityCreateOp.fragment.rb +2 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityListOp.fragment.rb +1 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityLoadOp.fragment.rb +2 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityPatchOp.fragment.rb +2 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityRemoveOp.fragment.rb +2 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityUpdateOp.fragment.rb +2 -1
- package/project/.sdk/src/cmp/rb/utility_rb.ts +10 -0
- package/project/.sdk/src/cmp/rust/ReadmeEntity_rust.ts +3 -2
- package/project/.sdk/src/cmp/rust/ReadmeHowto_rust.ts +6 -2
- package/project/.sdk/src/cmp/rust/ReadmeQuick_rust.ts +3 -2
- package/project/.sdk/src/cmp/rust/ReadmeRef_rust.ts +5 -4
- package/project/.sdk/src/cmp/rust/ReadmeTopQuick_rust.ts +3 -2
- package/project/.sdk/src/cmp/rust/ReadmeTopTest_rust.ts +7 -6
- package/project/.sdk/src/cmp/rust/utility_rust.ts +13 -1
- package/project/.sdk/src/cmp/scala/EntityTypes_scala.ts +5 -2
- package/project/.sdk/src/cmp/scala/ReadmeEntity_scala.ts +8 -19
- package/project/.sdk/src/cmp/scala/ReadmeHowto_scala.ts +17 -22
- package/project/.sdk/src/cmp/scala/ReadmeModel_scala.ts +10 -9
- package/project/.sdk/src/cmp/scala/ReadmeQuick_scala.ts +18 -28
- package/project/.sdk/src/cmp/scala/ReadmeRef_scala.ts +25 -35
- package/project/.sdk/src/cmp/scala/ReadmeTopQuick_scala.ts +14 -25
- package/project/.sdk/src/cmp/scala/ReadmeTopTest_scala.ts +16 -24
- package/project/.sdk/src/cmp/scala/utility_scala.ts +25 -0
- package/project/.sdk/src/cmp/swift/EntityTypes_swift.ts +1 -1
- package/project/.sdk/src/cmp/swift/ReadmeEntity_swift.ts +3 -2
- package/project/.sdk/src/cmp/swift/ReadmeHowto_swift.ts +22 -8
- package/project/.sdk/src/cmp/swift/ReadmeModel_swift.ts +10 -9
- package/project/.sdk/src/cmp/swift/ReadmeQuick_swift.ts +16 -8
- package/project/.sdk/src/cmp/swift/ReadmeRef_swift.ts +20 -15
- package/project/.sdk/src/cmp/swift/ReadmeTopQuick_swift.ts +12 -7
- package/project/.sdk/src/cmp/swift/ReadmeTopTest_swift.ts +21 -10
- package/project/.sdk/src/cmp/swift/utility_swift.ts +14 -1
- package/project/.sdk/src/cmp/ts/ReadmeEntity_ts.ts +2 -8
- package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +11 -9
- package/project/.sdk/src/cmp/ts/ReadmeModel_ts.ts +9 -9
- package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +7 -13
- package/project/.sdk/src/cmp/ts/ReadmeRef_ts.ts +14 -23
- package/project/.sdk/src/cmp/ts/ReadmeTopQuick_ts.ts +8 -14
- package/project/.sdk/src/cmp/ts/ReadmeTopTest_ts.ts +29 -14
- package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +1 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +1 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +1 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityPatchOp.fragment.ts +1 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +1 -1
- package/project/.sdk/src/cmp/ts/utility_ts.ts +2 -1
- package/project/.sdk/src/cmp/zig/ReadmeEntity_zig.ts +3 -2
- package/project/.sdk/src/cmp/zig/ReadmeHowto_zig.ts +6 -2
- package/project/.sdk/src/cmp/zig/ReadmeQuick_zig.ts +4 -3
- package/project/.sdk/src/cmp/zig/ReadmeRef_zig.ts +5 -4
- package/project/.sdk/src/cmp/zig/ReadmeTopQuick_zig.ts +3 -2
- package/project/.sdk/src/cmp/zig/ReadmeTopTest_zig.ts +7 -6
- package/project/.sdk/src/cmp/zig/utility_zig.ts +13 -0
- package/project/.sdk/tm/c/utility/transform_request.c +1 -1
- package/project/.sdk/tm/clojure/src/sdk/core.clj +32 -26
- package/project/.sdk/tm/clojure/test/sdk/test/concurrency.clj +136 -0
- package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +3 -1
- package/project/.sdk/tm/cpp/core/types.hpp +36 -6
- package/project/.sdk/tm/cpp/test/concurrency_test.cpp +348 -0
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +42 -25
- package/project/.sdk/tm/csharp/core/Context.cs +8 -5
- package/project/.sdk/tm/csharp/test/ConcurrencyTest.cs +238 -0
- package/project/.sdk/tm/csharp/utility/Clean.cs +12 -10
- package/project/.sdk/tm/csharp/utility/TransformRequest.cs +1 -1
- package/project/.sdk/tm/elixir/lib/projectname/context.ex +3 -0
- package/project/.sdk/tm/elixir/lib/projectname/entity_base.ex +2 -1
- package/project/.sdk/tm/elixir/lib/projectname/utility.ex +31 -10
- package/project/.sdk/tm/elixir/test/concurrency_test.exs +176 -0
- package/project/.sdk/tm/go/core/context.go +5 -1
- package/project/.sdk/tm/go/test/concurrency_test.go +214 -0
- package/project/.sdk/tm/go/utility/transform_request.go +1 -1
- package/project/.sdk/tm/java/core/Context.java +6 -3
- package/project/.sdk/tm/java/test/ConcurrencyTest.java +221 -0
- package/project/.sdk/tm/java/utility/Clean.java +22 -17
- package/project/.sdk/tm/java/utility/TransformRequest.java +1 -1
- package/project/.sdk/tm/js/src/utility/TransformRequestUtility.js +1 -1
- package/project/.sdk/tm/kotlin/core/Context.kt +5 -3
- package/project/.sdk/tm/kotlin/test/ConcurrencyTest.kt +193 -0
- package/project/.sdk/tm/kotlin/utility/ResultTransform.kt +1 -1
- package/project/.sdk/tm/lua/utility/transform_request.lua +1 -1
- package/project/.sdk/tm/ocaml/Makefile +21 -8
- package/project/.sdk/tm/ocaml/sdk_runtime.ml +27 -12
- package/project/.sdk/tm/ocaml/sdk_types.ml +6 -2
- package/project/.sdk/tm/ocaml/test/concurrency_test.ml +148 -0
- package/project/.sdk/tm/perl/utility/transform_request.pm +1 -1
- package/project/.sdk/tm/php/feature/TestFeature.php +9 -9
- package/project/.sdk/tm/php/utility/TransformRequest.php +1 -1
- package/project/.sdk/tm/py/pkg/core/context.py +2 -2
- package/project/.sdk/tm/py/pkg/utility/clean.py +12 -8
- package/project/.sdk/tm/py/pkg/utility/transform_request.py +1 -1
- package/project/.sdk/tm/py/test/test_concurrency.py +177 -0
- package/project/.sdk/tm/rb/core/context.rb +8 -3
- package/project/.sdk/tm/rb/test/concurrency_test.rb +160 -0
- package/project/.sdk/tm/rb/utility/clean.rb +8 -7
- package/project/.sdk/tm/rb/utility/transform_request.rb +1 -1
- package/project/.sdk/tm/rust/utility/transform_request.rs +1 -1
- package/project/.sdk/tm/scala/Makefile +2 -0
- package/project/.sdk/tm/scala/core/Context.scala +6 -4
- package/project/.sdk/tm/scala/sdktest/ConcurrencyTest.scala +186 -0
- package/project/.sdk/tm/scala/utility/Transform.scala +1 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Context.swift +2 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/ResultUtil.swift +35 -12
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/ConcurrencyTest.swift +214 -0
- package/project/.sdk/tm/ts/src/utility/TransformRequestUtility.ts +1 -1
- package/project/.sdk/tm/zig/core/utility.zig +1 -1
- package/project/.sdk/tm/zig/feature/test.zig +10 -8
- package/project/sdkgen-package.json +1 -1
- package/src/cmp/ReadmeErrors.ts +5 -5
- package/src/cmp/ReadmeExplanation.ts +4 -5
- package/src/cmp/ReadmeQuick.ts +3 -1
- package/src/cmp/ReadmeTop.ts +10 -12
- package/src/helpers/definitionPlan.ts +8 -4
- package/src/helpers/naming.ts +12 -4
- package/src/helpers/opExample.ts +97 -25
- package/src/helpers/opShape.ts +25 -9
- package/src/sdkgen.ts +14 -3
- package/src/utility.ts +31 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape, safeVarName, exampleVarName,
|
|
2
|
+
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape, safeVarName, exampleVarName, targetFeatures, opNeedsAction, bodyNote, listMatchArg, entityClassName, entityCollection } from '@voxgig/sdkgen'
|
|
3
3
|
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
4
4
|
|
|
5
5
|
import {
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
// test. Strings render the quoted placeholder.
|
|
14
14
|
function pyLit(type: any, placeholder: string = 'example'): string {
|
|
15
15
|
const k = canonScalarKey(type)
|
|
16
|
+
if ('NULL' === k) return 'None'
|
|
16
17
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
17
18
|
if ('BOOLEAN' === k) return 'True'
|
|
18
19
|
if ('ARRAY' === k) return '[]'
|
|
@@ -21,42 +22,36 @@ function pyLit(type: any, placeholder: string = 'example'): string {
|
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
|
|
24
|
-
function listMatchArg(ent: any): string {
|
|
25
|
-
const idF = entityIdField(ent)
|
|
26
|
-
return matchArg('py', ent, 'list', idF, idLiteral(ent, 'list', idF))
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
25
|
const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string }> = {
|
|
31
26
|
load: {
|
|
32
|
-
sig: 'load(reqmatch, ctrl=None) ->
|
|
33
|
-
returns: 'the entity
|
|
34
|
-
desc: 'Load a single entity matching the given criteria. Returns the entity
|
|
27
|
+
sig: 'load(reqmatch, ctrl=None) -> EntyClass',
|
|
28
|
+
returns: 'the entity',
|
|
29
|
+
desc: 'Load a single entity matching the given criteria. Returns the entity, whose record `data_get()` reads, and raises on error.',
|
|
35
30
|
},
|
|
36
31
|
list: {
|
|
37
|
-
sig: 'list(reqmatch=None, ctrl=None) -> list',
|
|
38
|
-
returns: 'a list of entities',
|
|
39
|
-
desc: 'List entities matching the given criteria. The match is optional — call `list()` with no argument to list all records. Returns a list and raises on error.',
|
|
32
|
+
sig: 'list(reqmatch=None, ctrl=None) -> list[EntyClass]',
|
|
33
|
+
returns: 'a list of entities, one per record',
|
|
34
|
+
desc: 'List entities matching the given criteria. The match is optional — call `list()` with no argument to list all records. Returns a list of entities, one per record, and raises on error.',
|
|
40
35
|
},
|
|
41
36
|
create: {
|
|
42
|
-
sig: 'create(reqdata, ctrl=None) ->
|
|
43
|
-
returns: 'the created entity
|
|
44
|
-
desc: 'Create a new entity with the given data. Returns the created entity
|
|
37
|
+
sig: 'create(reqdata, ctrl=None) -> EntyClass',
|
|
38
|
+
returns: 'the created entity',
|
|
39
|
+
desc: 'Create a new entity with the given data. Returns the created entity and raises on error.',
|
|
45
40
|
},
|
|
46
41
|
update: {
|
|
47
|
-
sig: 'update(reqdata, ctrl=None) ->
|
|
48
|
-
returns: 'the updated entity
|
|
49
|
-
desc: 'Update an existing entity. The data must include the entity `id`. Returns the updated entity
|
|
42
|
+
sig: 'update(reqdata, ctrl=None) -> EntyClass',
|
|
43
|
+
returns: 'the updated entity',
|
|
44
|
+
desc: 'Update an existing entity. The data must include the entity `id`. Returns the updated entity and raises on error.',
|
|
50
45
|
},
|
|
51
46
|
patch: {
|
|
52
|
-
sig: 'patch(reqdata, ctrl=None) ->
|
|
53
|
-
returns: 'the patched entity
|
|
54
|
-
desc: 'Change part of an existing entity: only the fields given are sent. The data must include the entity `id`. Returns the patched entity
|
|
47
|
+
sig: 'patch(reqdata, ctrl=None) -> EntyClass',
|
|
48
|
+
returns: 'the patched entity',
|
|
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 raises on error.',
|
|
55
50
|
},
|
|
56
51
|
remove: {
|
|
57
|
-
sig: 'remove(reqmatch, ctrl=None) ->
|
|
58
|
-
returns: 'the removed entity
|
|
59
|
-
desc: 'Remove the entity matching the given criteria.
|
|
52
|
+
sig: 'remove(reqmatch, ctrl=None) -> EntyClass',
|
|
53
|
+
returns: 'the removed entity',
|
|
54
|
+
desc: 'Remove the entity matching the given criteria. Returns the entity, marked as deleted, and raises on error.',
|
|
60
55
|
},
|
|
61
56
|
}
|
|
62
57
|
|
|
@@ -255,7 +250,7 @@ ${eVar} = client.${ent.Name}()
|
|
|
255
250
|
const info = OP_SIGNATURES[opname]
|
|
256
251
|
if (!info) return
|
|
257
252
|
|
|
258
|
-
Content(`#### \`${info.sig}\`
|
|
253
|
+
Content(`#### \`${info.sig.replace('EntyClass', entityClassName(ent, entityCollection(model)))}\`
|
|
259
254
|
|
|
260
255
|
${info.desc}
|
|
261
256
|
|
|
@@ -288,9 +283,9 @@ result = client.${ent.Name}().${opname}(${arg})
|
|
|
288
283
|
}
|
|
289
284
|
else if ('list' === opname) {
|
|
290
285
|
Content(`\`\`\`python
|
|
291
|
-
results = client.${ent.Name}().list(${listMatchArg(ent)})
|
|
286
|
+
results = client.${ent.Name}().list(${listMatchArg('py', ent)})
|
|
292
287
|
for ${eVar} in results:
|
|
293
|
-
print(${eVar})
|
|
288
|
+
print(${eVar}.data_get())
|
|
294
289
|
\`\`\`
|
|
295
290
|
|
|
296
291
|
`)
|
|
@@ -417,8 +412,6 @@ client = ${model.const.Name}SDK({
|
|
|
417
412
|
})
|
|
418
413
|
|
|
419
414
|
|
|
420
|
-
|
|
421
|
-
|
|
422
415
|
export {
|
|
423
416
|
ReadmeRef
|
|
424
417
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, isAuthActive, envName, canonKey, canonScalarKey, entityIdField, opRequestShape, safeVarName, exampleVarName,
|
|
2
|
+
import { cmp, Content, isAuthActive, envName, canonKey, canonScalarKey, entityIdField, opRequestShape, safeVarName, exampleVarName, serverVariables, listMatchArg } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
// would break it).
|
|
15
15
|
function pyLit(type: any, placeholder: string = 'example'): string {
|
|
16
16
|
const k = canonScalarKey(type)
|
|
17
|
+
if ('NULL' === k) return 'None'
|
|
17
18
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
18
19
|
if ('BOOLEAN' === k) return 'True'
|
|
19
20
|
if ('ARRAY' === k) return '[]'
|
|
@@ -22,12 +23,6 @@ function pyLit(type: any, placeholder: string = 'example'): string {
|
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
|
|
25
|
-
function listMatchArg(ent: any): string {
|
|
26
|
-
const idF = entityIdField(ent)
|
|
27
|
-
return matchArg('py', ent, 'list', idF, idLiteral(ent, 'list', idF))
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
26
|
const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
|
|
32
27
|
const { target, ctx$: { model } } = props
|
|
33
28
|
|
|
@@ -68,10 +63,10 @@ client = ${ctor}
|
|
|
68
63
|
let hasCall = false
|
|
69
64
|
|
|
70
65
|
if (opnames.includes('list')) {
|
|
71
|
-
Content(`# List all ${eName.toLowerCase()}s (
|
|
72
|
-
${eVar}s = client.${eName}().list(${listMatchArg(exampleEntity)})
|
|
66
|
+
Content(`# List all ${eName.toLowerCase()}s (a list of entities, one per record; raises on error)
|
|
67
|
+
${eVar}s = client.${eName}().list(${listMatchArg('py', exampleEntity)})
|
|
73
68
|
for ${eVar} in ${eVar}s:
|
|
74
|
-
print(${eVar})
|
|
69
|
+
print(${eVar}.data_get())
|
|
75
70
|
`)
|
|
76
71
|
hasCall = true
|
|
77
72
|
}
|
|
@@ -87,9 +82,9 @@ for ${eVar} in ${eVar}s:
|
|
|
87
82
|
it.name === idF ? 'example_id' : 'example_' + it.name)}`).join(', ')}}`
|
|
88
83
|
: ''
|
|
89
84
|
Content(`
|
|
90
|
-
# Load a specific ${eName.toLowerCase()} (returns the
|
|
85
|
+
# Load a specific ${eName.toLowerCase()} (returns the entity, raises on error)
|
|
91
86
|
${eVar} = client.${eName}().load(${loadArg})
|
|
92
|
-
print(${eVar})
|
|
87
|
+
print(${eVar}.data_get())
|
|
93
88
|
`)
|
|
94
89
|
hasCall = true
|
|
95
90
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, safeVarName, exampleVarName } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, safeVarName, exampleVarName, requiredItems, litPair } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
// A type-correct Python literal for a field's canonical type.
|
|
12
12
|
function pyLit(type: any): string {
|
|
13
13
|
const k = canonScalarKey(type)
|
|
14
|
+
if ('NULL' === k) return 'None'
|
|
14
15
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
15
16
|
if ('BOOLEAN' === k) return 'True'
|
|
16
17
|
if ('ARRAY' === k) return '[]'
|
|
@@ -37,30 +38,30 @@ client = ${model.const.Name}SDK.test()
|
|
|
37
38
|
const idF = entityIdField(exampleEntity)
|
|
38
39
|
const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
|
|
39
40
|
let arg = ''
|
|
40
|
-
if (isMatchOp) {
|
|
41
|
+
if (isMatchOp || ('list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length)) {
|
|
41
42
|
// Every REQUIRED match key (id first) — the same shape that generates
|
|
42
43
|
// the op's Match type, so the block also satisfies the mypy doc gate.
|
|
43
|
-
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
44
|
-
.filter((it: any) => !it.optional || it.name === idF)
|
|
44
|
+
const items = (isMatchOp ? opRequestShape(exampleEntity, primaryOp).items
|
|
45
|
+
.filter((it: any) => !it.optional || it.name === idF) : requiredItems(exampleEntity, 'list'))
|
|
45
46
|
.sort((a: any, b: any) =>
|
|
46
47
|
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
47
48
|
arg = 0 < items.length
|
|
48
49
|
? `{${items.map((it: any) =>
|
|
49
|
-
|
|
50
|
+
litPair('py', it.name, isMatchOp && it.name === idF ? '"test01"' : pyLit(it.type))).join(', ')}}`
|
|
50
51
|
: ''
|
|
51
52
|
} else if ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp) {
|
|
52
53
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
53
54
|
.filter((it: any) => it.name !== idF && it.name !== 'id')
|
|
54
55
|
const required = items.filter((it: any) => !it.optional)
|
|
55
56
|
const chosen = required.length ? required : items.slice(0, 3)
|
|
56
|
-
arg = `{${chosen.map((it: any) =>
|
|
57
|
+
arg = `{${chosen.map((it: any) => litPair('py', it.name, pyLit(it.type))).join(', ')}}`
|
|
57
58
|
}
|
|
58
59
|
// A list() result is a list — name the variable accordingly (the root
|
|
59
60
|
// README doc gate concatenates blocks, so reusing the singular name for
|
|
60
61
|
// a different type is a mypy assignment error).
|
|
61
62
|
const eVar = exampleVarName(eName.toLowerCase(), 'py') + ('list' === primaryOp ? 's' : '')
|
|
62
63
|
Content(`${eVar} = client.${eName}().${primaryOp}(${arg})
|
|
63
|
-
print(${eVar})
|
|
64
|
+
print(${'list' === primaryOp ? '[item.data_get() for item in ' + eVar + ']' : eVar + '.data_get()'})
|
|
64
65
|
`)
|
|
65
66
|
}
|
|
66
67
|
|
|
@@ -5,7 +5,7 @@ entity_create_op = None
|
|
|
5
5
|
|
|
6
6
|
# EJECT-START
|
|
7
7
|
|
|
8
|
-
def create(self, reqdata: EntityNameCreateData, ctrl=None) ->
|
|
8
|
+
def create(self, reqdata: EntityNameCreateData, ctrl=None) -> EntyClass:
|
|
9
9
|
utility = self._utility
|
|
10
10
|
ctx = utility.make_context({
|
|
11
11
|
"opname": "create",
|
|
@@ -2,7 +2,7 @@ entity_list_op = None
|
|
|
2
2
|
|
|
3
3
|
# EJECT-START
|
|
4
4
|
|
|
5
|
-
def list(self, reqmatch=None, ctrl=None) -> list[
|
|
5
|
+
def list(self, reqmatch=None, ctrl=None) -> list[EntyClass]:
|
|
6
6
|
utility = self._utility
|
|
7
7
|
# reqmatch is optional: an omitted match lists all records. Treat None
|
|
8
8
|
# as an empty match so client.EntityName().list() works with no args.
|
|
@@ -5,7 +5,7 @@ entity_load_op = None
|
|
|
5
5
|
|
|
6
6
|
# EJECT-START
|
|
7
7
|
|
|
8
|
-
def load(self, reqmatch=None, ctrl=None) ->
|
|
8
|
+
def load(self, reqmatch=None, ctrl=None) -> EntyClass:
|
|
9
9
|
utility = self._utility
|
|
10
10
|
# reqmatch is optional: an entity with no id-like key loads with no
|
|
11
11
|
# match. Treat None as an empty match so client.EntityName().load()
|
|
@@ -5,7 +5,7 @@ entity_patch_op = None
|
|
|
5
5
|
|
|
6
6
|
# EJECT-START
|
|
7
7
|
|
|
8
|
-
def patch(self, reqdata: EntityNamePatchData, ctrl=None) ->
|
|
8
|
+
def patch(self, reqdata: EntityNamePatchData, ctrl=None) -> EntyClass:
|
|
9
9
|
utility = self._utility
|
|
10
10
|
ctx = utility.make_context({
|
|
11
11
|
"opname": "patch",
|
|
@@ -5,7 +5,7 @@ entity_remove_op = None
|
|
|
5
5
|
|
|
6
6
|
# EJECT-START
|
|
7
7
|
|
|
8
|
-
def remove(self, reqmatch=None, ctrl=None) ->
|
|
8
|
+
def remove(self, reqmatch=None, ctrl=None) -> EntyClass:
|
|
9
9
|
utility = self._utility
|
|
10
10
|
# reqmatch is optional: an entity with no id-like key removes with no
|
|
11
11
|
# match. Treat None as an empty match so client.EntityName().remove()
|
|
@@ -5,7 +5,7 @@ entity_update_op = None
|
|
|
5
5
|
|
|
6
6
|
# EJECT-START
|
|
7
7
|
|
|
8
|
-
def update(self, reqdata: EntityNameUpdateData, ctrl=None) ->
|
|
8
|
+
def update(self, reqdata: EntityNameUpdateData, ctrl=None) -> EntyClass:
|
|
9
9
|
utility = self._utility
|
|
10
10
|
ctx = utility.make_context({
|
|
11
11
|
"opname": "update",
|
|
@@ -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.call(ctx, "${name}")
|
|
@@ -19,7 +19,8 @@ const LANG = 'rb'
|
|
|
19
19
|
|
|
20
20
|
// A Ruby symbol literal for a member name: bare for identifiers, quoted otherwise.
|
|
21
21
|
function symName(name: string): string {
|
|
22
|
-
return /^[A-Za-z_][A-Za-z0-9_]*[?!=]?$/.test(name) ? ':' + name
|
|
22
|
+
return /^[A-Za-z_][A-Za-z0-9_]*[?!=]?$/.test(name) ? ':' + name
|
|
23
|
+
: ':' + JSON.stringify(name).replace(/#(?=[{$@])/g, '\\#')
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
|
|
@@ -6,9 +6,12 @@ import {
|
|
|
6
6
|
getModelPath,
|
|
7
7
|
} from '@voxgig/apidef'
|
|
8
8
|
|
|
9
|
+
import { rbListArgs } from './utility_rb'
|
|
10
|
+
|
|
9
11
|
|
|
10
12
|
function rbLit(type: any, placeholder: string = 'example'): string {
|
|
11
13
|
const k = canonScalarKey(type)
|
|
14
|
+
if ('NULL' === k) return 'nil'
|
|
12
15
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
13
16
|
if ('BOOLEAN' === k) return 'true'
|
|
14
17
|
if ('ARRAY' === k) return '[]'
|
|
@@ -134,7 +137,7 @@ ${eVar} = client.${entity.Name}.load(${loadArg})
|
|
|
134
137
|
|
|
135
138
|
\`\`\`ruby
|
|
136
139
|
# list returns an Array of ${entity.Name} entities, one per record (raises on error).
|
|
137
|
-
${eVar}s = client.${entity.Name}.list
|
|
140
|
+
${eVar}s = client.${entity.Name}.list${rbListArgs(entity)}
|
|
138
141
|
${eVar}s.each { |item| puts item.data_get }
|
|
139
142
|
\`\`\`
|
|
140
143
|
|
|
@@ -80,8 +80,9 @@ ${entityLines}
|
|
|
80
80
|
CLIENT = /(?<![\\w\\-.\\/"'])client(?![\\w\\-\\/"'])/
|
|
81
81
|
|
|
82
82
|
# Ruby-level errors that indicate a real bug in a documented example (as
|
|
83
|
-
# opposed to an expected not-found / domain error, which is tolerated)
|
|
84
|
-
|
|
83
|
+
# opposed to an expected not-found / domain error, which is tolerated), and
|
|
84
|
+
# the ScriptError classes an SDK that does not load raises.
|
|
85
|
+
FATAL = /NoMethodError|NameError|ArgumentError|SyntaxError|LoadError|NotImplementedError|undefined method|undefined local variable|uninitialized constant|wrong number of arguments/
|
|
85
86
|
|
|
86
87
|
# Extract every fenced ruby block from all three docs, each tagged with its
|
|
87
88
|
# source doc label and its index within that doc.
|
|
@@ -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, seededList, litPair } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
|
|
11
11
|
function rbLit(type: any): string {
|
|
12
12
|
const k = canonScalarKey(type)
|
|
13
|
+
if ('NULL' === k) return 'nil'
|
|
13
14
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
14
15
|
if ('BOOLEAN' === k) return 'true'
|
|
15
16
|
if ('ARRAY' === k) return '[]'
|
|
@@ -26,40 +27,49 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
|
|
|
26
27
|
const eName = exampleEntity ? nom(exampleEntity, 'Name') : 'Entity'
|
|
27
28
|
// Sanitise the local variable name — an entity whose lowercased name is a
|
|
28
29
|
// Ruby keyword (e.g. `self`) would otherwise emit uncompilable code. The
|
|
29
|
-
// fixture
|
|
30
|
-
// entity's registered name for the mock lookup to resolve.
|
|
30
|
+
// fixture key is the model name, which the mock looks the entity up by.
|
|
31
31
|
const eVar = exampleVarName(eName.toLowerCase(), 'rb')
|
|
32
32
|
const idF = exampleEntity ? entityIdField(exampleEntity) : null
|
|
33
33
|
const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
|
|
34
|
+
const listed = exampleEntity && 'list' === primaryOp
|
|
35
|
+
? seededList('rb', exampleEntity, idF, 'test01') : null
|
|
34
36
|
const seedSentence = idF
|
|
35
37
|
? '. Seed fixture\ndata via the `entity` option so offline calls resolve without a live server'
|
|
36
38
|
: ''
|
|
39
|
+
const record = idF ? (listed ? listed.record : [litPair('rb', idF, '"test01"')]).join(', ') : ''
|
|
37
40
|
const testCtor = idF
|
|
38
|
-
? `${model.const.Name}SDK.test({\n "entity" => { "${
|
|
41
|
+
? `${model.const.Name}SDK.test({\n "entity" => { "${exampleEntity.name}" => { "test01" => { ${record} } } },\n})`
|
|
39
42
|
: `${model.const.Name}SDK.test`
|
|
40
43
|
let testCallArg = ''
|
|
41
|
-
if (
|
|
44
|
+
if (listed) {
|
|
45
|
+
testCallArg = 0 < listed.call.length ? `{ ${listed.call.join(', ')} }` : ''
|
|
46
|
+
} else if (exampleEntity && isMatchOp) {
|
|
42
47
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
43
48
|
.filter((it: any) => !it.optional || it.name === idF)
|
|
44
49
|
.sort((a: any, b: any) => (a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
45
50
|
testCallArg = 0 < items.length
|
|
46
|
-
? `{ ${items.map((it: any) =>
|
|
51
|
+
? `{ ${items.map((it: any) => litPair('rb', it.name, it.name === idF ? '"test01"' : rbLit(it.type))).join(', ')} }`
|
|
47
52
|
: ''
|
|
48
53
|
} else if (exampleEntity && ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp)) {
|
|
49
54
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
50
55
|
.filter((it: any) => it.name !== idF && it.name !== 'id')
|
|
51
56
|
const required = items.filter((it: any) => !it.optional)
|
|
52
57
|
const chosen = required.length ? required : items.slice(0, 3)
|
|
53
|
-
testCallArg = `{ ${chosen.map((it: any) =>
|
|
58
|
+
testCallArg = `{ ${chosen.map((it: any) => litPair('rb', it.name, rbLit(it.type))).join(', ')} }`
|
|
54
59
|
}
|
|
55
60
|
|
|
56
61
|
// The op-driven test-mode line, shown only when the SDK has an entity op.
|
|
57
62
|
// A direct()-only SDK (no ops anywhere) shows a direct() call instead.
|
|
58
|
-
const testModeExample = primaryOp
|
|
63
|
+
const testModeExample = 'list' === primaryOp
|
|
64
|
+
? `# list returns an Array of ${eName} entities, one per mock record (raises on
|
|
65
|
+
# error); data_get reads each record.
|
|
66
|
+
${eVar}s = client.${eName}.list(${testCallArg})
|
|
67
|
+
${eVar}s.each { |item| puts item.data_get }`
|
|
68
|
+
: primaryOp
|
|
59
69
|
? `# Entity ops return the ENTITY (raises on error);
|
|
60
|
-
#
|
|
70
|
+
# data_get reads its mock record.
|
|
61
71
|
${eVar} = client.${eName}.${primaryOp}(${testCallArg})
|
|
62
|
-
puts ${eVar}`
|
|
72
|
+
puts ${eVar}.data_get`
|
|
63
73
|
: `result = client.direct({ "path" => "/api/resource", "method" => "GET" })
|
|
64
74
|
puts result`
|
|
65
75
|
|
|
@@ -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 = nil, ctrl) -> Array` | List entities matching the criteria (call with no argument to list all)
|
|
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 = nil, ctrl) -> Array` | List entities matching the criteria (call with no argument to list all), 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')
|
|
@@ -94,9 +94,10 @@ ${opRows}
|
|
|
94
94
|
|
|
95
95
|
### Result shape
|
|
96
96
|
|
|
97
|
-
Entity operations return the
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
Entity operations return the entity, and \`list\` an \`Array\` of entities, one
|
|
98
|
+
per record; an entity's \`data_get\` reads its record. On failure they raise a
|
|
99
|
+
\`${model.const.Name}Error\` (a \`StandardError\` subclass), so wrap calls in
|
|
100
|
+
\`begin\`/\`rescue\` where you need to handle errors.
|
|
100
101
|
|
|
101
102
|
The \`direct\` escape hatch is the exception: it never raises and instead
|
|
102
103
|
returns a result \`Hash\` with these keys:
|
|
@@ -7,6 +7,8 @@ import {
|
|
|
7
7
|
nom,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
+
import { rbListArgs } from './utility_rb'
|
|
11
|
+
|
|
10
12
|
|
|
11
13
|
const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
|
|
12
14
|
const { target, ctx$: { model } } = props
|
|
@@ -56,6 +58,7 @@ client = ${ctor}
|
|
|
56
58
|
// placeholder would not parse).
|
|
57
59
|
const rbLit = (type: any, placeholder: string = 'example'): string => {
|
|
58
60
|
const k = canonScalarKey(type)
|
|
61
|
+
if ('NULL' === k) return 'nil'
|
|
59
62
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
60
63
|
if ('BOOLEAN' === k) return 'true'
|
|
61
64
|
if ('ARRAY' === k) return '[]'
|
|
@@ -81,7 +84,7 @@ client = ${ctor}
|
|
|
81
84
|
\`\`\`ruby
|
|
82
85
|
begin
|
|
83
86
|
# list returns an Array of ${eName} entities, one per record; data_get reads the record.
|
|
84
|
-
${eVar}s = client.${eName}.list
|
|
87
|
+
${eVar}s = client.${eName}.list${rbListArgs(exampleEntity)}
|
|
85
88
|
${eVar}s.each do |item|
|
|
86
89
|
record = item.data_get
|
|
87
90
|
puts "${itemPrint}"
|
|
@@ -122,7 +125,7 @@ ${neName} is nested under ${parentName}, so provide the \`${parentParam}\`.
|
|
|
122
125
|
begin
|
|
123
126
|
# load returns the ENTITY — call data_get for the ${neName} record (raises on error).
|
|
124
127
|
${neVar} = client.${neName}.load({ ${neMatch.join(', ')} })
|
|
125
|
-
puts ${neVar}
|
|
128
|
+
puts ${neVar}.data_get
|
|
126
129
|
rescue => err
|
|
127
130
|
warn "load failed: #{err}"
|
|
128
131
|
end
|
|
@@ -147,7 +150,7 @@ end
|
|
|
147
150
|
begin
|
|
148
151
|
# load returns the ENTITY — call data_get for the ${eName} record (raises on error).
|
|
149
152
|
${eVar} = client.${eName}.load(${loadArg})
|
|
150
|
-
puts ${eVar}
|
|
153
|
+
puts ${eVar}.data_get
|
|
151
154
|
rescue => err
|
|
152
155
|
warn "load failed: #{err}"
|
|
153
156
|
end
|
|
@@ -7,12 +7,15 @@ import {
|
|
|
7
7
|
getModelPath,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
+
import { rbListArgs } from './utility_rb'
|
|
11
|
+
|
|
10
12
|
|
|
11
13
|
// A type-correct Ruby literal for a field's canonical type — the create body
|
|
12
14
|
// is EXECUTED by the doc test, so it must carry a real value per field.
|
|
13
15
|
// Strings render the quoted placeholder.
|
|
14
16
|
function rbLit(type: any, placeholder: string = 'example'): string {
|
|
15
17
|
const k = canonScalarKey(type)
|
|
18
|
+
if ('NULL' === k) return 'nil'
|
|
16
19
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
17
20
|
if ('BOOLEAN' === k) return 'true'
|
|
18
21
|
if ('ARRAY' === k) return '[]'
|
|
@@ -24,8 +27,8 @@ function rbLit(type: any, placeholder: string = 'example'): string {
|
|
|
24
27
|
const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string }> = {
|
|
25
28
|
load: {
|
|
26
29
|
sig: 'load(reqmatch, ctrl = nil) -> result',
|
|
27
|
-
returns: '
|
|
28
|
-
desc: 'Load a single entity matching the given criteria.
|
|
30
|
+
returns: 'the entity',
|
|
31
|
+
desc: 'Load a single entity matching the given criteria. Returns the entity, whose record `data_get` reads, and raises on error.',
|
|
29
32
|
},
|
|
30
33
|
list: {
|
|
31
34
|
sig: 'list(reqmatch = nil, ctrl = nil) -> Array',
|
|
@@ -34,23 +37,23 @@ const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string
|
|
|
34
37
|
},
|
|
35
38
|
create: {
|
|
36
39
|
sig: 'create(reqdata, ctrl = nil) -> result',
|
|
37
|
-
returns: '
|
|
38
|
-
desc: 'Create a new entity with the given data.
|
|
40
|
+
returns: 'the created entity',
|
|
41
|
+
desc: 'Create a new entity with the given data. Returns the created entity and raises on error.',
|
|
39
42
|
},
|
|
40
43
|
update: {
|
|
41
44
|
sig: 'update(reqdata, ctrl = nil) -> result',
|
|
42
|
-
returns: '
|
|
43
|
-
desc: 'Update an existing entity. The data must include the entity `id`.
|
|
45
|
+
returns: 'the updated entity',
|
|
46
|
+
desc: 'Update an existing entity. The data must include the entity `id`. Returns the updated entity and raises on error.',
|
|
44
47
|
},
|
|
45
48
|
patch: {
|
|
46
49
|
sig: 'patch(reqdata, ctrl = nil) -> result',
|
|
47
|
-
returns: '
|
|
48
|
-
desc: 'Change part of an existing entity: only the fields given are sent. The data must include the entity `id`.
|
|
50
|
+
returns: 'the patched entity',
|
|
51
|
+
desc: 'Change part of an existing entity: only the fields given are sent. The data must include the entity `id`. Returns the patched entity and raises on error.',
|
|
49
52
|
},
|
|
50
53
|
remove: {
|
|
51
54
|
sig: 'remove(reqmatch, ctrl = nil) -> result',
|
|
52
|
-
returns: '
|
|
53
|
-
desc: 'Remove the entity matching the given criteria.
|
|
55
|
+
returns: 'the removed entity',
|
|
56
|
+
desc: 'Remove the entity matching the given criteria. Returns the entity, marked as deleted, and raises on error.',
|
|
54
57
|
},
|
|
55
58
|
}
|
|
56
59
|
|
|
@@ -288,7 +291,7 @@ result = client.${ent.Name}.${opname}(${arg})
|
|
|
288
291
|
}
|
|
289
292
|
else if ('list' === opname) {
|
|
290
293
|
Content(`\`\`\`ruby
|
|
291
|
-
results = client.${ent.Name}.list
|
|
294
|
+
results = client.${ent.Name}.list${rbListArgs(ent)}
|
|
292
295
|
results.each { |item| puts item.data_get }
|
|
293
296
|
\`\`\`
|
|
294
297
|
|
|
@@ -7,6 +7,8 @@ import {
|
|
|
7
7
|
nom,
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
|
+
import { rbListArgs } from './utility_rb'
|
|
11
|
+
|
|
10
12
|
|
|
11
13
|
// A type-correct, executable Ruby literal for a param: numeric/boolean/
|
|
12
14
|
// array/hash params render a typed literal; strings render the quoted
|
|
@@ -14,6 +16,7 @@ import {
|
|
|
14
16
|
// would break it).
|
|
15
17
|
function rbLit(type: any, placeholder: string = 'example'): string {
|
|
16
18
|
const k = canonScalarKey(type)
|
|
19
|
+
if ('NULL' === k) return 'nil'
|
|
17
20
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
18
21
|
if ('BOOLEAN' === k) return 'true'
|
|
19
22
|
if ('ARRAY' === k) return '[]'
|
|
@@ -53,7 +56,7 @@ client = ${ctor}
|
|
|
53
56
|
|
|
54
57
|
if (opnames.includes('list')) {
|
|
55
58
|
Content(`# List all ${eName.toLowerCase()}s (an Array of entities, one per record; raises on error)
|
|
56
|
-
${eVar}s = client.${eName}.list
|
|
59
|
+
${eVar}s = client.${eName}.list${rbListArgs(exampleEntity)}
|
|
57
60
|
${eVar}s.each { |item| puts item.data_get }
|
|
58
61
|
`)
|
|
59
62
|
hasCall = true
|
|
@@ -70,9 +73,9 @@ ${eVar}s.each { |item| puts item.data_get }
|
|
|
70
73
|
it.name === idF ? 'example_id' : 'example_' + it.name)}`).join(', ')} }`
|
|
71
74
|
: ''
|
|
72
75
|
Content(`
|
|
73
|
-
# Load a specific ${eName.toLowerCase()} (returns the
|
|
76
|
+
# Load a specific ${eName.toLowerCase()} (returns the entity; data_get reads its record; raises on error)
|
|
74
77
|
${eVar} = client.${eName}.load(${loadArg})
|
|
75
|
-
puts ${eVar}
|
|
78
|
+
puts ${eVar}.data_get
|
|
76
79
|
`)
|
|
77
80
|
hasCall = true
|
|
78
81
|
}
|