@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,17 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, requiredItems } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
6
6
|
getModelPath,
|
|
7
7
|
} from '@voxgig/apidef'
|
|
8
8
|
|
|
9
|
-
import { kotlinVarName } from './utility_kotlin'
|
|
9
|
+
import { kotlinVarName, kotlinString } from './utility_kotlin'
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
// A type-correct Kotlin literal for a field's canonical type.
|
|
13
13
|
function kotlinLit(type: any): string {
|
|
14
14
|
const k = canonScalarKey(type)
|
|
15
|
+
if ('NULL' === k) return 'null'
|
|
15
16
|
if ('INTEGER' === k) return '1L'
|
|
16
17
|
if ('NUMBER' === k) return '1.0'
|
|
17
18
|
if ('BOOLEAN' === k) return 'true'
|
|
@@ -40,16 +41,16 @@ val client = ${SDK}.testSDK(null, null)
|
|
|
40
41
|
const idF = entityIdField(exampleEntity)
|
|
41
42
|
const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
|
|
42
43
|
let arg = 'null'
|
|
43
|
-
if (isMatchOp) {
|
|
44
|
+
if (isMatchOp || ('list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length)) {
|
|
44
45
|
// Every REQUIRED match key (id first) — the same shape that generates
|
|
45
46
|
// the op's request type, so the block stays honest.
|
|
46
|
-
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
47
|
-
.filter((it: any) => !it.optional || it.name === idF)
|
|
47
|
+
const items = (isMatchOp ? opRequestShape(exampleEntity, primaryOp).items
|
|
48
|
+
.filter((it: any) => !it.optional || it.name === idF) : requiredItems(exampleEntity, 'list'))
|
|
48
49
|
.sort((a: any, b: any) =>
|
|
49
50
|
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
50
51
|
arg = 0 < items.length
|
|
51
52
|
? `mutableMapOf<String, Any?>(${items.map((it: any) =>
|
|
52
|
-
|
|
53
|
+
`${kotlinString(it.name)} to ${isMatchOp && it.name === idF ? '"test01"' : kotlinLit(it.type)}`).join(', ')})`
|
|
53
54
|
: 'null'
|
|
54
55
|
} else if ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp) {
|
|
55
56
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
@@ -57,12 +58,18 @@ val client = ${SDK}.testSDK(null, null)
|
|
|
57
58
|
const required = items.filter((it: any) => !it.optional)
|
|
58
59
|
const chosen = required.length ? required : items.slice(0, 3)
|
|
59
60
|
arg = `mutableMapOf<String, Any?>(${chosen.map((it: any) =>
|
|
60
|
-
|
|
61
|
+
`${kotlinString(it.name)} to ${kotlinLit(it.type)}`).join(', ')})`
|
|
61
62
|
}
|
|
62
|
-
const eVar = kotlinVarName(exampleEntity.name)
|
|
63
|
+
const eVar = kotlinVarName(exampleEntity.name)
|
|
63
64
|
const accessor = kotlinVarName(exampleEntity.name)
|
|
64
|
-
Content(
|
|
65
|
-
|
|
65
|
+
Content('list' === primaryOp
|
|
66
|
+
? `val ${eVar}List = client.${accessor}(null).list(${arg}, null) as List<*>
|
|
67
|
+
for (${eVar}Item in ${eVar}List) {
|
|
68
|
+
println((${eVar}Item as SdkEntity).data())
|
|
69
|
+
}
|
|
70
|
+
`
|
|
71
|
+
: `val ${eVar} = client.${accessor}(null).${primaryOp}(${arg}, null) as SdkEntity
|
|
72
|
+
println(${eVar}.data())
|
|
66
73
|
`)
|
|
67
74
|
}
|
|
68
75
|
|
|
@@ -4,6 +4,8 @@ import * as Path from 'node:path'
|
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
camelify,
|
|
7
|
+
canonScalarKey,
|
|
8
|
+
requiredItems,
|
|
7
9
|
} from '@voxgig/sdkgen'
|
|
8
10
|
|
|
9
11
|
import {
|
|
@@ -102,14 +104,32 @@ function jsonAppendLines(value: any, bufname: string): string {
|
|
|
102
104
|
return json
|
|
103
105
|
.split('\n')
|
|
104
106
|
.map((line) => {
|
|
105
|
-
const lit =
|
|
107
|
+
const lit = kotlinString(line)
|
|
106
108
|
return ` ${bufname}.append(${lit})\n`
|
|
107
109
|
})
|
|
108
110
|
.join('')
|
|
109
111
|
}
|
|
110
112
|
|
|
113
|
+
// A list's required route and query parameters, as the match it is called with.
|
|
114
|
+
// A Kotlin string literal, whose `$` would start a template.
|
|
115
|
+
function kotlinString(s: string): string {
|
|
116
|
+
return JSON.stringify(s).replace(/\$/g, '\\$')
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
function kotlinListMatch(entity: any): string {
|
|
121
|
+
const lit = (type: any): string =>
|
|
122
|
+
(({ NULL: 'null', INTEGER: '1L', NUMBER: '1.0', BOOLEAN: 'true', ARRAY: 'listOf<Any?>()', OBJECT: 'mapOf<String, Any?>()' }) as any)[canonScalarKey(type)] ?? '"example"'
|
|
123
|
+
const items = requiredItems(entity, 'list')
|
|
124
|
+
return 0 < items.length
|
|
125
|
+
? `mutableMapOf<String, Any?>(${items.map((it: any) => `${kotlinString(it.name)} to ${lit(it.type)}`).join(', ')})`
|
|
126
|
+
: 'null'
|
|
127
|
+
}
|
|
128
|
+
|
|
111
129
|
|
|
112
130
|
export {
|
|
131
|
+
kotlinString,
|
|
132
|
+
kotlinListMatch,
|
|
113
133
|
cleanModel,
|
|
114
134
|
gradleGroup,
|
|
115
135
|
kotlinPackage,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, entityIdField, opRequestShape, safeVarName, exampleVarName, luaKey, opNeedsAction } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, entityIdField, opRequestShape, safeVarName, exampleVarName, luaKey, opNeedsAction, listMatchArg } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
// parse).
|
|
14
14
|
function luaLit(type: any, placeholder: string = 'example'): string {
|
|
15
15
|
const k = canonScalarKey(type)
|
|
16
|
+
if ('NULL' === k) return 'nil'
|
|
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,7 +134,7 @@ local ${eVar}, err = client:${entity.Name}():load(${loadArg})
|
|
|
133
134
|
Content(`#### Example: List
|
|
134
135
|
|
|
135
136
|
\`\`\`lua
|
|
136
|
-
local ${eVar}s, err = client:${entity.Name}():list()
|
|
137
|
+
local ${eVar}s, err = client:${entity.Name}():list(${listMatchArg('lua', entity)})
|
|
137
138
|
\`\`\`
|
|
138
139
|
|
|
139
140
|
`)
|
|
@@ -35,7 +35,8 @@ const ReadmeExamplesTest = cmp(function ReadmeExamplesTest(props: any) {
|
|
|
35
35
|
-- network). Each client constructor is rewritten to the seeded
|
|
36
36
|
-- test-mode form, and fragments that only use \`client\` get a seeded
|
|
37
37
|
-- test client injected. A call to a method that does not exist raises
|
|
38
|
-
-- "call a nil value" and FAILS the test
|
|
38
|
+
-- "call a nil value" and FAILS the test, as does an SDK module that
|
|
39
|
+
-- does not load. A seeded-fixture miss surfaces
|
|
39
40
|
-- as a tolerated (nil, err) not-found domain error, not a raised error.
|
|
40
41
|
-- 3. Completeness: total == executed + illustration per doc. A block that
|
|
41
42
|
-- is neither runnable nor an explicit comment-only placeholder FAILS
|
|
@@ -219,12 +220,14 @@ for _, doc in ipairs(DOCS) do
|
|
|
219
220
|
if not ok then
|
|
220
221
|
local msg = tostring(e)
|
|
221
222
|
-- A nil accessor / missing method / bad index is a real doc bug:
|
|
222
|
-
-- the documented call does not exist.
|
|
223
|
+
-- the documented call does not exist. A module that does not
|
|
224
|
+
-- load is an SDK that does not load.
|
|
223
225
|
if msg:find("nil value") or msg:find("attempt to call")
|
|
224
|
-
or msg:find("attempt to index")
|
|
226
|
+
or msg:find("attempt to index") or msg:find("error loading module")
|
|
227
|
+
or msg:find("module '[^']*' not found") then
|
|
225
228
|
assert.is_true(false,
|
|
226
229
|
doc.label .. " runnable block #" .. i .. " hit a runtime " ..
|
|
227
|
-
"error (missing method / nil call): " .. msg ..
|
|
230
|
+
"error (missing method / nil call / module load): " .. msg ..
|
|
228
231
|
"\\n----\\n" .. src .. "\\n----")
|
|
229
232
|
end
|
|
230
233
|
-- Other runtime errors (a seeded-fixture miss surfaces as a
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, isAuthActive, envName, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, luaKey } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, isAuthActive, envName, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, luaKey, requiredItems } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
// A type-correct Lua literal for a field's canonical type.
|
|
12
12
|
function luaLit(type: any): string {
|
|
13
13
|
const k = canonScalarKey(type)
|
|
14
|
+
if ('NULL' === k) return 'nil'
|
|
14
15
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
15
16
|
if ('BOOLEAN' === k) return 'true'
|
|
16
17
|
if ('ARRAY' === k || 'OBJECT' === k) return '{}'
|
|
@@ -31,12 +32,12 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
|
|
|
31
32
|
const idF = exampleEntity ? entityIdField(exampleEntity) : null
|
|
32
33
|
const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
|
|
33
34
|
let testCallArg = ''
|
|
34
|
-
if (exampleEntity && isMatchOp) {
|
|
35
|
-
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
36
|
-
.filter((it: any) => !it.optional || it.name === idF)
|
|
35
|
+
if (exampleEntity && (isMatchOp || ('list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length))) {
|
|
36
|
+
const items = (isMatchOp ? opRequestShape(exampleEntity, primaryOp).items
|
|
37
|
+
.filter((it: any) => !it.optional || it.name === idF) : requiredItems(exampleEntity, 'list'))
|
|
37
38
|
.sort((a: any, b: any) => (a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
38
39
|
testCallArg = 0 < items.length
|
|
39
|
-
? `{ ${items.map((it: any) => `${luaKey(it.name)} = ${it.name === idF ? '"test01"' : luaLit(it.type)}`).join(', ')} }`
|
|
40
|
+
? `{ ${items.map((it: any) => `${luaKey(it.name)} = ${isMatchOp && it.name === idF ? '"test01"' : luaLit(it.type)}`).join(', ')} }`
|
|
40
41
|
: ''
|
|
41
42
|
} else if (exampleEntity && ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp)) {
|
|
42
43
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
@@ -50,9 +51,10 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
|
|
|
50
51
|
// A direct()-only SDK (no ops anywhere) shows a direct() call instead.
|
|
51
52
|
const testModeExample = primaryOp
|
|
52
53
|
? `local result, err = client:${eName}():${primaryOp}(${testCallArg})
|
|
53
|
-
-- result is
|
|
54
|
+
-- ${'list' === primaryOp ? 'result is an array of entities, one per mock record'
|
|
55
|
+
: 'result is the entity; data_get() reads its mock record'}; err is set on failure`
|
|
54
56
|
: `local result, err = client:direct({ path = "/api/resource", method = "GET" })
|
|
55
|
-
-- result
|
|
57
|
+
-- result holds ok, status, headers and data; err is set on failure`
|
|
56
58
|
|
|
57
59
|
const apikeyEnvLine = isAuthActive(model)
|
|
58
60
|
? `\n${envName(model)}_APIKEY=<your-key>`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, each, Content, isAuthActive, entityIdField } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, each, Content, isAuthActive, entityIdField, listMatchArg } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -17,12 +17,12 @@ const ReadmeModel = cmp(function ReadmeModel(props: any) {
|
|
|
17
17
|
entityList.forEach((e: any) => Object.keys(e.op || {})
|
|
18
18
|
.forEach((o: string) => { if (e.op[o] && e.op[o].active !== false) opUnion.add(o) }))
|
|
19
19
|
const opRowDefs: Record<string, string> = {
|
|
20
|
-
load: '| `load` | `(reqmatch, ctrl) -> any, err` | Load a single entity by match criteria. |',
|
|
21
|
-
list: '| `list` | `(reqmatch, ctrl) -> any, err` | List entities matching the criteria. |',
|
|
22
|
-
create: '| `create` | `(reqdata, ctrl) -> any, err` | Create a new entity. |',
|
|
23
|
-
update: '| `update` | `(reqdata, ctrl) -> any, err` | Update an existing entity. |',
|
|
24
|
-
patch: '| `patch` | `(reqdata, ctrl) -> any, err` | Change part of an existing entity. |',
|
|
25
|
-
remove: '| `remove` | `(reqmatch, ctrl) -> any, err` | Remove an entity. |',
|
|
20
|
+
load: '| `load` | `(reqmatch, ctrl) -> any, err` | Load a single entity by match criteria, and return it. |',
|
|
21
|
+
list: '| `list` | `(reqmatch, ctrl) -> any, err` | List entities matching the criteria, one per record. |',
|
|
22
|
+
create: '| `create` | `(reqdata, ctrl) -> any, err` | Create a new entity, and return it. |',
|
|
23
|
+
update: '| `update` | `(reqdata, ctrl) -> any, err` | Update an existing entity, and return it. |',
|
|
24
|
+
patch: '| `patch` | `(reqdata, ctrl) -> any, err` | Change part of an existing entity, and return it. |',
|
|
25
|
+
remove: '| `remove` | `(reqmatch, ctrl) -> any, err` | Remove an entity, and return it marked as deleted. |',
|
|
26
26
|
}
|
|
27
27
|
const opRows = ['load', 'list', 'create', 'update', 'patch', 'remove']
|
|
28
28
|
.filter((o) => opUnion.has(o)).map((o) => opRowDefs[o]).join('\n')
|
|
@@ -30,8 +30,8 @@ const ReadmeModel = cmp(function ReadmeModel(props: any) {
|
|
|
30
30
|
const recordOps = ['load', 'create', 'update', 'patch', 'remove'].filter((o) => opUnion.has(o))
|
|
31
31
|
.map((o) => '`' + o + '`')
|
|
32
32
|
const resultRows: string[] = []
|
|
33
|
-
if (recordOps.length) resultRows.push('| ' + recordOps.join(' / ') + ' | the entity record (a `table`) |')
|
|
34
|
-
if (opUnion.has('list')) resultRows.push('| `list` | an array (`table`) of
|
|
33
|
+
if (recordOps.length) resultRows.push('| ' + recordOps.join(' / ') + ' | the entity, whose `data_get()` reads its record (a `table`) |')
|
|
34
|
+
if (opUnion.has('list')) resultRows.push('| `list` | an array (`table`) of entities, one per record |')
|
|
35
35
|
const resultShapeRows = resultRows.join('\n')
|
|
36
36
|
|
|
37
37
|
// The Result-shape illustration calls `load`, so the example entity must
|
|
@@ -109,8 +109,8 @@ ${opRows}
|
|
|
109
109
|
|
|
110
110
|
### Result shape
|
|
111
111
|
|
|
112
|
-
Entity operations return \`(value, err)\`. The \`value\` is the
|
|
113
|
-
|
|
112
|
+
Entity operations return \`(value, err)\`. The \`value\` is the entity
|
|
113
|
+
itself — there is no wrapper:
|
|
114
114
|
|
|
115
115
|
| Operation | \`value\` |
|
|
116
116
|
| --- | --- |
|
|
@@ -119,9 +119,9 @@ ${resultShapeRows}
|
|
|
119
119
|
Check \`err\` first (it is non-\`nil\` on failure), then use \`value\`:
|
|
120
120
|
|
|
121
121
|
local ${eLower}, err = client:${eName}():${hasLoad ? 'load' : 'list'}(${
|
|
122
|
-
hasLoad
|
|
122
|
+
hasLoad ? (idF ? `{ ${idF} = "example_id" }` : '') : listMatchArg('lua', exEnt)})
|
|
123
123
|
if err then error(err) end
|
|
124
|
-
-- ${eLower} is
|
|
124
|
+
-- ${eLower} is ${hasLoad ? 'the loaded entity' : 'an array of entities, one per record'}
|
|
125
125
|
|
|
126
126
|
Only \`direct()\` returns a response envelope — a \`table\` with \`ok\`,
|
|
127
127
|
\`status\`, \`headers\`, and \`data\` keys.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, each, Content, isAuthActive, envName, canonKey, canonScalarKey, opRequestShape, entityIdField, entityDataIdField, entityOps, safeVarName, exampleVarName, luaKey } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, each, Content, isAuthActive, envName, canonKey, canonScalarKey, opRequestShape, entityIdField, entityDataIdField, entityOps, safeVarName, exampleVarName, luaKey, listMatchArg } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -57,6 +57,7 @@ local client = ${ctor}
|
|
|
57
57
|
// placeholder would not parse). Non-identifier keys use bracket syntax.
|
|
58
58
|
const luaLit = (type: any, placeholder: string = 'example'): string => {
|
|
59
59
|
const k = canonScalarKey(type)
|
|
60
|
+
if ('NULL' === k) return 'nil'
|
|
60
61
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
61
62
|
if ('BOOLEAN' === k) return 'true'
|
|
62
63
|
if ('ARRAY' === k || 'OBJECT' === k) return '{}'
|
|
@@ -77,19 +78,24 @@ local client = ${ctor}
|
|
|
77
78
|
fields.find((f: any) => f && !idNames.has(f.n) && isStringField(f)) ||
|
|
78
79
|
fields.find((f: any) => f && !idNames.has(f.n))
|
|
79
80
|
const displayField = displayFieldObj ? displayFieldObj.name : null
|
|
80
|
-
const idCol = dataIdF ? `
|
|
81
|
-
const dispCol = displayField ? `
|
|
81
|
+
const idCol = dataIdF ? `rec["${dataIdF}"]` : null
|
|
82
|
+
const dispCol = displayField ? `rec["${displayField}"]` : null
|
|
82
83
|
const printCols = [idCol, dispCol].filter(Boolean).join(', ')
|
|
83
|
-
|
|
84
|
+
// A record with neither column prints every field it holds.
|
|
85
|
+
const printRecord = (v: string, cols: string, pad: string): string => cols
|
|
86
|
+
? `${pad}local rec = ${v}:data_get()\n${pad}print(${cols})`
|
|
87
|
+
: `${pad}for k, val in pairs(${v}:data_get()) do print(k, val) end`
|
|
88
|
+
const printLine = printRecord('item', printCols, ' ')
|
|
84
89
|
|
|
85
90
|
if (opnames.includes('list')) {
|
|
86
91
|
Content(`### 2. List ${eName.toLowerCase()} records
|
|
87
92
|
|
|
88
|
-
Entity operations return \`(value, err)\`. For \`list\`, \`value\` is
|
|
89
|
-
array of
|
|
93
|
+
Entity operations return \`(value, err)\`. For \`list\`, \`value\` is an
|
|
94
|
+
array of entities, one per record — iterate it directly (there is no
|
|
95
|
+
wrapper), and read each record with \`data_get()\`.
|
|
90
96
|
|
|
91
97
|
\`\`\`lua
|
|
92
|
-
local ${eVar}s, err = client:${eName}():list()
|
|
98
|
+
local ${eVar}s, err = client:${eName}():list(${listMatchArg('lua', exampleEntity)})
|
|
93
99
|
if err then error(err) end
|
|
94
100
|
|
|
95
101
|
for _, item in ipairs(${eVar}s) do
|
|
@@ -104,6 +110,7 @@ end
|
|
|
104
110
|
const neName = nom(nestedEntity, 'Name')
|
|
105
111
|
const neArticle = /^[aeiou]/i.test(neName) ? "an" : "a"
|
|
106
112
|
const neVar = exampleVarName(neName.toLowerCase(), 'lua')
|
|
113
|
+
const neDataIdF = entityDataIdField(nestedEntity)
|
|
107
114
|
|
|
108
115
|
const neIdF = entityIdField(nestedEntity)
|
|
109
116
|
const neRequired = opRequestShape(nestedEntity, 'load').items
|
|
@@ -121,10 +128,12 @@ end
|
|
|
121
128
|
|
|
122
129
|
${neName} is nested under ${parentName}, so provide the \`${parentParam}\`.
|
|
123
130
|
|
|
131
|
+
\`load\` returns the entity; \`data_get()\` reads its record.
|
|
132
|
+
|
|
124
133
|
\`\`\`lua
|
|
125
134
|
local ${neVar}, err = client:${neName}():load({ ${neMatch.join(', ')} })
|
|
126
135
|
if err then error(err) end
|
|
127
|
-
|
|
136
|
+
${printRecord(neVar, neDataIdF ? `rec["${neDataIdF}"]` : '', '')}
|
|
128
137
|
\`\`\`
|
|
129
138
|
|
|
130
139
|
`)
|
|
@@ -142,10 +151,12 @@ print(${neVar})
|
|
|
142
151
|
|
|
143
152
|
Content(`### 3. Load ${article} ${eName.toLowerCase()}
|
|
144
153
|
|
|
154
|
+
\`load\` returns the entity; \`data_get()\` reads its record.
|
|
155
|
+
|
|
145
156
|
\`\`\`lua
|
|
146
157
|
local ${eVar}, err = client:${eName}():load(${loadArg})
|
|
147
158
|
if err then error(err) end
|
|
148
|
-
|
|
159
|
+
${printRecord(eVar, printCols, '')}
|
|
149
160
|
\`\`\`
|
|
150
161
|
|
|
151
162
|
`)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape, safeVarName, exampleVarName, luaKey
|
|
2
|
+
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape, safeVarName, exampleVarName, luaKey, 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 luaLit(type: any, placeholder: string = 'example'): string {
|
|
16
16
|
const k = canonScalarKey(type)
|
|
17
|
+
if ('NULL' === k) return 'nil'
|
|
17
18
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
18
19
|
if ('BOOLEAN' === k) return 'true'
|
|
19
20
|
if ('ARRAY' === k || 'OBJECT' === k) return '{}'
|
|
@@ -27,32 +28,32 @@ const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string
|
|
|
27
28
|
load: {
|
|
28
29
|
sig: 'load(reqmatch, ctrl) -> any, err',
|
|
29
30
|
returns: 'any, err',
|
|
30
|
-
desc: 'Load a single entity matching the given criteria.',
|
|
31
|
+
desc: 'Load a single entity matching the given criteria. Returns the entity, whose record `data_get()` reads, or `nil` and an error on failure.',
|
|
31
32
|
},
|
|
32
33
|
list: {
|
|
33
34
|
sig: 'list(reqmatch, ctrl) -> any, err',
|
|
34
35
|
returns: 'any, err',
|
|
35
|
-
desc: 'List entities matching the given criteria. Returns an array.',
|
|
36
|
+
desc: 'List entities matching the given criteria. Returns an array of entities, one per record, or `nil` and an error on failure.',
|
|
36
37
|
},
|
|
37
38
|
create: {
|
|
38
39
|
sig: 'create(reqdata, ctrl) -> any, err',
|
|
39
40
|
returns: 'any, err',
|
|
40
|
-
desc: 'Create a new entity with the given data.',
|
|
41
|
+
desc: 'Create a new entity with the given data. Returns the created entity, or `nil` and an error on failure.',
|
|
41
42
|
},
|
|
42
43
|
update: {
|
|
43
44
|
sig: 'update(reqdata, ctrl) -> any, err',
|
|
44
45
|
returns: 'any, err',
|
|
45
|
-
desc: 'Update an existing entity. The data must include the entity `id`.',
|
|
46
|
+
desc: 'Update an existing entity. The data must include the entity `id`. Returns the updated entity, or `nil` and an error on failure.',
|
|
46
47
|
},
|
|
47
48
|
patch: {
|
|
48
49
|
sig: 'patch(reqdata, ctrl) -> any, err',
|
|
49
50
|
returns: 'any, err',
|
|
50
|
-
desc: 'Change part of an existing entity: only the fields given are sent. The data must include the entity `id`.',
|
|
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, or `nil` and an error on failure.',
|
|
51
52
|
},
|
|
52
53
|
remove: {
|
|
53
54
|
sig: 'remove(reqmatch, ctrl) -> any, err',
|
|
54
55
|
returns: 'any, err',
|
|
55
|
-
desc: 'Remove the entity matching the given criteria.',
|
|
56
|
+
desc: 'Remove the entity matching the given criteria. Returns the entity, marked as deleted, or `nil` and an error on failure.',
|
|
56
57
|
},
|
|
57
58
|
}
|
|
58
59
|
|
|
@@ -285,7 +286,7 @@ local result, err = client:${ent.Name}():${opname}(${arg})
|
|
|
285
286
|
}
|
|
286
287
|
else if ('list' === opname) {
|
|
287
288
|
Content(`\`\`\`lua
|
|
288
|
-
local results, err = client:${ent.Name}():list()
|
|
289
|
+
local results, err = client:${ent.Name}():list(${listMatchArg('lua', ent)})
|
|
289
290
|
\`\`\`
|
|
290
291
|
|
|
291
292
|
`)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, isAuthActive, envName, canonKey, canonScalarKey, entityIdField, opRequestShape, safeVarName, exampleVarName, luaKey } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, isAuthActive, envName, canonKey, canonScalarKey, entityIdField, opRequestShape, safeVarName, exampleVarName, luaKey, 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 luaLit(type: any, placeholder: string = 'example'): string {
|
|
15
15
|
const k = canonScalarKey(type)
|
|
16
|
+
if ('NULL' === k) return 'nil'
|
|
16
17
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
17
18
|
if ('BOOLEAN' === k) return 'true'
|
|
18
19
|
if ('ARRAY' === k || 'OBJECT' === k) return '{}'
|
|
@@ -33,9 +34,12 @@ const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
|
|
|
33
34
|
? `sdk.new({\n apikey = os.getenv("${envName(model)}_APIKEY"),\n})`
|
|
34
35
|
: `sdk.new()`
|
|
35
36
|
|
|
37
|
+
const shown = null != exampleEntity &&
|
|
38
|
+
['list', 'load'].some((op: string) => Object.keys(exampleEntity.op || {}).includes(op))
|
|
39
|
+
|
|
36
40
|
Content(`\`\`\`lua
|
|
37
41
|
local sdk = require("${model.name}_sdk")
|
|
38
|
-
|
|
42
|
+
${shown ? 'local json = require("dkjson")\n' : ''}
|
|
39
43
|
local client = ${ctor}
|
|
40
44
|
|
|
41
45
|
`)
|
|
@@ -51,9 +55,12 @@ local client = ${ctor}
|
|
|
51
55
|
let hasCall = false
|
|
52
56
|
|
|
53
57
|
if (opnames.includes('list')) {
|
|
54
|
-
Content(`-- List all ${eName.toLowerCase()}s
|
|
55
|
-
local ${eVar}s, err = client:${eName}():list()
|
|
56
|
-
|
|
58
|
+
Content(`-- List all ${eName.toLowerCase()}s (an array of entities, one per record; err on failure)
|
|
59
|
+
local ${eVar}s, err = client:${eName}():list(${listMatchArg('lua', exampleEntity)})
|
|
60
|
+
if err then error(err) end
|
|
61
|
+
for _, ${eVar} in ipairs(${eVar}s) do
|
|
62
|
+
print(json.encode(${eVar}:data_get()))
|
|
63
|
+
end
|
|
57
64
|
`)
|
|
58
65
|
hasCall = true
|
|
59
66
|
}
|
|
@@ -72,9 +79,10 @@ print(${eVar}s)
|
|
|
72
79
|
it.name === idF ? 'example_id' : 'example_' + it.name)}`).join(', ')} }`
|
|
73
80
|
: ''
|
|
74
81
|
Content(`
|
|
75
|
-
-- Load a specific ${eName.toLowerCase()}
|
|
82
|
+
-- Load a specific ${eName.toLowerCase()} (returns the entity; err on failure)
|
|
76
83
|
local ${eVar}, err = client:${eName}():load(${loadArg})
|
|
77
|
-
|
|
84
|
+
if err then error(err) end
|
|
85
|
+
print(json.encode(${eVar}:data_get()))
|
|
78
86
|
`)
|
|
79
87
|
hasCall = true
|
|
80
88
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, luaKey } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, luaKey, requiredItems } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
// A type-correct Lua literal for a field's canonical type.
|
|
12
12
|
function luaLit(type: any): string {
|
|
13
13
|
const k = canonScalarKey(type)
|
|
14
|
+
if ('NULL' === k) return 'nil'
|
|
14
15
|
if ('INTEGER' === k || 'NUMBER' === k) return '1'
|
|
15
16
|
if ('BOOLEAN' === k) return 'true'
|
|
16
17
|
if ('ARRAY' === k || 'OBJECT' === k) return '{}'
|
|
@@ -36,16 +37,16 @@ local client = sdk.test()
|
|
|
36
37
|
const idF = entityIdField(exampleEntity)
|
|
37
38
|
const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
|
|
38
39
|
let arg = ''
|
|
39
|
-
if (isMatchOp) {
|
|
40
|
+
if (isMatchOp || ('list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length)) {
|
|
40
41
|
// Every REQUIRED match key (id first, then parent path params like
|
|
41
42
|
// page_id) — the same shape the runtime resolves path params from.
|
|
42
|
-
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
43
|
-
.filter((it: any) => !it.optional || it.name === idF)
|
|
43
|
+
const items = (isMatchOp ? opRequestShape(exampleEntity, primaryOp).items
|
|
44
|
+
.filter((it: any) => !it.optional || it.name === idF) : requiredItems(exampleEntity, 'list'))
|
|
44
45
|
.sort((a: any, b: any) =>
|
|
45
46
|
(a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
|
|
46
47
|
arg = 0 < items.length
|
|
47
48
|
? `{ ${items.map((it: any) =>
|
|
48
|
-
`${luaKey(it.name)} = ${it.name === idF ? '"test01"' : luaLit(it.type)}`).join(', ')} }`
|
|
49
|
+
`${luaKey(it.name)} = ${isMatchOp && it.name === idF ? '"test01"' : luaLit(it.type)}`).join(', ')} }`
|
|
49
50
|
: ''
|
|
50
51
|
} else if ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp) {
|
|
51
52
|
const items = opRequestShape(exampleEntity, primaryOp).items
|
|
@@ -6,13 +6,14 @@ import {
|
|
|
6
6
|
getModelPath,
|
|
7
7
|
} from '@voxgig/apidef'
|
|
8
8
|
|
|
9
|
-
import { ocamlVarName } from './utility_ocaml'
|
|
9
|
+
import { ocamlVarName, ocamlListMatch } from './utility_ocaml'
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
// A type-correct OCaml `value` literal for a field's canonical type. Strings
|
|
13
13
|
// render the quoted placeholder.
|
|
14
14
|
function ocamlLit(type: any, placeholder: string = 'example'): string {
|
|
15
15
|
const k = canonScalarKey(type)
|
|
16
|
+
if ('NULL' === k) return 'Null'
|
|
16
17
|
if ('INTEGER' === k || 'NUMBER' === k) return '(Num 1.)'
|
|
17
18
|
if ('BOOLEAN' === k) return '(Bool true)'
|
|
18
19
|
if ('ARRAY' === k) return '(empty_list ())'
|
|
@@ -154,7 +155,7 @@ let ${fn}_data = ${fn}.e_data_get ()
|
|
|
154
155
|
|
|
155
156
|
\`\`\`ocaml
|
|
156
157
|
(* One ENTITY per record. *)
|
|
157
|
-
let ${fn}s = (Sdk_client.${fn} client Noval).e_list (
|
|
158
|
+
let ${fn}s = (Sdk_client.${fn} client Noval).e_list ${ocamlListMatch(entity)} Noval
|
|
158
159
|
let ${fn}_datas = List.map (fun e -> e.e_data_get ()) ${fn}s
|
|
159
160
|
\`\`\`
|
|
160
161
|
|
|
@@ -6,12 +6,13 @@ import {
|
|
|
6
6
|
getModelPath,
|
|
7
7
|
} from '@voxgig/apidef'
|
|
8
8
|
|
|
9
|
-
import { ocamlOpField, ocamlVarName } from './utility_ocaml'
|
|
9
|
+
import { ocamlListMatch, ocamlOpField, ocamlVarName } from './utility_ocaml'
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
// A type-correct OCaml `value` literal for a field's canonical type.
|
|
13
13
|
function ocamlLit(type: any): string {
|
|
14
14
|
const k = canonScalarKey(type)
|
|
15
|
+
if ('NULL' === k) return 'Null'
|
|
15
16
|
if ('INTEGER' === k || 'NUMBER' === k) return '(Num 1.)'
|
|
16
17
|
if ('BOOLEAN' === k) return '(Bool true)'
|
|
17
18
|
if ('ARRAY' === k) return '(empty_list ())'
|
|
@@ -34,7 +35,7 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
|
|
|
34
35
|
const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
|
|
35
36
|
let testArg = 'Noval'
|
|
36
37
|
if (exampleEntity && 'list' === primaryOp) {
|
|
37
|
-
testArg =
|
|
38
|
+
testArg = ocamlListMatch(exampleEntity)
|
|
38
39
|
} else if (exampleEntity && isMatchOp) {
|
|
39
40
|
testArg = idF ? `(jo [("${idF}", Str "test01")])` : '(empty_map ())'
|
|
40
41
|
} else if (exampleEntity && ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp)) {
|