@voxgig/sdkgen 4.22.0 → 4.24.0
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 +18 -2
- package/dist/action/doctor.d.ts +1 -1
- package/dist/action/doctor.js +12 -10
- package/dist/action/doctor.js.map +1 -1
- package/dist/action/edition.js +4 -0
- package/dist/action/edition.js.map +1 -1
- package/dist/action/feature.js +5 -1
- package/dist/action/feature.js.map +1 -1
- package/dist/action/remove.d.ts +16 -0
- package/dist/action/remove.js +345 -0
- package/dist/action/remove.js.map +1 -0
- package/dist/action/target.js +6 -1
- package/dist/action/target.js.map +1 -1
- package/dist/cmp/ReadmeTop.js +1 -1
- package/dist/cmp/ReadmeTop.js.map +1 -1
- package/dist/cmp/ReadmeUnions.js +1 -1
- package/dist/cmp/ReadmeUnions.js.map +1 -1
- package/dist/cmp/Test.js +1 -1
- package/dist/cmp/Test.js.map +1 -1
- package/dist/helpers/buildIdNames.d.ts +3 -1
- package/dist/helpers/buildIdNames.js +15 -7
- package/dist/helpers/buildIdNames.js.map +1 -1
- package/dist/helpers/canonSpec.js +2 -2
- package/dist/helpers/canonSpec.js.map +1 -1
- package/dist/helpers/getMatchEntries.js +2 -2
- package/dist/helpers/getMatchEntries.js.map +1 -1
- package/dist/helpers/modelNames.js +5 -1
- package/dist/helpers/modelNames.js.map +1 -1
- package/dist/helpers/opShape.js +33 -33
- package/dist/helpers/opShape.js.map +1 -1
- package/dist/helpers/pointPath.js +5 -10
- package/dist/helpers/pointPath.js.map +1 -1
- package/dist/helpers/resolved.js +2 -29
- package/dist/helpers/resolved.js.map +1 -1
- package/dist/sdkgen.d.ts +2 -2
- package/dist/sdkgen.js +5 -3
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utility.js +15 -7
- package/dist/utility.js.map +1 -1
- package/package.json +3 -3
- package/project/.sdk/src/cmp/c/EntityTypes_c.ts +4 -4
- package/project/.sdk/src/cmp/c/ReadmeEntity_c.ts +3 -3
- package/project/.sdk/src/cmp/c/ReadmeModel_c.ts +3 -3
- package/project/.sdk/src/cmp/c/ReadmeRef_c.ts +5 -5
- package/project/.sdk/src/cmp/c/Schema_c.ts +1 -1
- package/project/.sdk/src/cmp/c/TestDirect_c.ts +12 -12
- package/project/.sdk/src/cmp/clojure/ReadmeEntity_clojure.ts +3 -3
- package/project/.sdk/src/cmp/clojure/ReadmeModel_clojure.ts +3 -3
- package/project/.sdk/src/cmp/clojure/ReadmeRef_clojure.ts +5 -5
- package/project/.sdk/src/cmp/clojure/Schema_clojure.ts +1 -1
- package/project/.sdk/src/cmp/cpp/EntityTypes_cpp.ts +3 -3
- package/project/.sdk/src/cmp/cpp/ReadmeEntity_cpp.ts +3 -3
- package/project/.sdk/src/cmp/cpp/ReadmeModel_cpp.ts +3 -3
- package/project/.sdk/src/cmp/cpp/ReadmeRef_cpp.ts +5 -5
- package/project/.sdk/src/cmp/cpp/Schema_cpp.ts +1 -1
- package/project/.sdk/src/cmp/cpp/TestDirect_cpp.ts +14 -14
- package/project/.sdk/src/cmp/cpp/TestEntity_cpp.ts +51 -50
- package/project/.sdk/src/cmp/csharp/EntityTypes_csharp.ts +4 -4
- package/project/.sdk/src/cmp/csharp/ReadmeEntity_csharp.ts +3 -3
- package/project/.sdk/src/cmp/csharp/ReadmeModel_csharp.ts +3 -3
- package/project/.sdk/src/cmp/csharp/ReadmeRef_csharp.ts +5 -5
- package/project/.sdk/src/cmp/csharp/Schema_csharp.ts +1 -1
- package/project/.sdk/src/cmp/csharp/TestDirect_csharp.ts +30 -30
- package/project/.sdk/src/cmp/csharp/TestEntity_csharp.ts +66 -65
- package/project/.sdk/src/cmp/elixir/EntityTypes_elixir.ts +4 -4
- package/project/.sdk/src/cmp/elixir/ReadmeEntity_elixir.ts +3 -3
- package/project/.sdk/src/cmp/elixir/ReadmeModel_elixir.ts +3 -3
- package/project/.sdk/src/cmp/elixir/ReadmeRef_elixir.ts +4 -4
- package/project/.sdk/src/cmp/elixir/Schema_elixir.ts +1 -1
- package/project/.sdk/src/cmp/go/EntityTypes_go.ts +4 -4
- package/project/.sdk/src/cmp/go/ReadmeEntity_go.ts +3 -3
- package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +3 -3
- package/project/.sdk/src/cmp/go/ReadmeRef_go.ts +5 -5
- package/project/.sdk/src/cmp/go/Schema_go.ts +1 -1
- package/project/.sdk/src/cmp/go/TestDirect_go.ts +38 -38
- package/project/.sdk/src/cmp/go/TestEntity_go.ts +75 -74
- package/project/.sdk/src/cmp/go/utility_go.ts +5 -5
- package/project/.sdk/src/cmp/java/EntityTypes_java.ts +4 -4
- package/project/.sdk/src/cmp/java/ReadmeEntity_java.ts +3 -3
- package/project/.sdk/src/cmp/java/ReadmeModel_java.ts +3 -3
- package/project/.sdk/src/cmp/java/ReadmeRef_java.ts +5 -5
- package/project/.sdk/src/cmp/java/Schema_java.ts +1 -1
- package/project/.sdk/src/cmp/java/TestDirect_java.ts +30 -30
- package/project/.sdk/src/cmp/java/TestEntity_java.ts +69 -68
- package/project/.sdk/src/cmp/js/EntityTypes_js.ts +5 -5
- package/project/.sdk/src/cmp/js/ReadmeEntity_js.ts +3 -3
- package/project/.sdk/src/cmp/js/ReadmeModel_js.ts +3 -3
- package/project/.sdk/src/cmp/js/ReadmeRef_js.ts +5 -5
- package/project/.sdk/src/cmp/js/Schema_js.ts +1 -1
- package/project/.sdk/src/cmp/js/TestDirect_js.ts +27 -27
- package/project/.sdk/src/cmp/js/TestEntity_js.ts +66 -69
- package/project/.sdk/src/cmp/js/TestLive_js.ts +3 -3
- package/project/.sdk/src/cmp/js/utility_js.ts +5 -5
- package/project/.sdk/src/cmp/kotlin/EntityTypes_kotlin.ts +4 -4
- package/project/.sdk/src/cmp/kotlin/ReadmeEntity_kotlin.ts +3 -3
- package/project/.sdk/src/cmp/kotlin/ReadmeModel_kotlin.ts +3 -3
- package/project/.sdk/src/cmp/kotlin/ReadmeRef_kotlin.ts +5 -5
- package/project/.sdk/src/cmp/kotlin/Schema_kotlin.ts +1 -1
- package/project/.sdk/src/cmp/kotlin/TestDirect_kotlin.ts +30 -30
- package/project/.sdk/src/cmp/kotlin/TestEntity_kotlin.ts +67 -66
- package/project/.sdk/src/cmp/lua/EntityTypes_lua.ts +5 -5
- package/project/.sdk/src/cmp/lua/ReadmeEntity_lua.ts +3 -3
- package/project/.sdk/src/cmp/lua/ReadmeModel_lua.ts +3 -3
- package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +4 -4
- package/project/.sdk/src/cmp/lua/ReadmeRef_lua.ts +5 -5
- package/project/.sdk/src/cmp/lua/Schema_lua.ts +1 -1
- package/project/.sdk/src/cmp/lua/TestDirect_lua.ts +25 -25
- package/project/.sdk/src/cmp/lua/TestEntity_lua.ts +66 -65
- package/project/.sdk/src/cmp/ocaml/ReadmeEntity_ocaml.ts +3 -3
- package/project/.sdk/src/cmp/ocaml/ReadmeModel_ocaml.ts +3 -3
- package/project/.sdk/src/cmp/ocaml/ReadmeRef_ocaml.ts +5 -5
- package/project/.sdk/src/cmp/ocaml/Schema_ocaml.ts +1 -1
- package/project/.sdk/src/cmp/perl/ReadmeEntity_perl.ts +3 -3
- package/project/.sdk/src/cmp/perl/ReadmeModel_perl.ts +3 -3
- package/project/.sdk/src/cmp/perl/ReadmeRef_perl.ts +5 -5
- package/project/.sdk/src/cmp/perl/Schema_perl.ts +1 -1
- package/project/.sdk/src/cmp/perl/TestDirect_perl.ts +25 -25
- package/project/.sdk/src/cmp/perl/TestEntity_perl.ts +60 -59
- package/project/.sdk/src/cmp/php/EntityTypes_php.ts +4 -4
- package/project/.sdk/src/cmp/php/ReadmeEntity_php.ts +3 -3
- package/project/.sdk/src/cmp/php/ReadmeModel_php.ts +3 -3
- package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +4 -4
- package/project/.sdk/src/cmp/php/ReadmeRef_php.ts +5 -5
- package/project/.sdk/src/cmp/php/Schema_php.ts +1 -1
- package/project/.sdk/src/cmp/php/TestDirect_php.ts +25 -25
- package/project/.sdk/src/cmp/php/TestEntity_php.ts +66 -65
- package/project/.sdk/src/cmp/py/EntityTypes_py.ts +4 -4
- package/project/.sdk/src/cmp/py/ReadmeEntity_py.ts +3 -3
- package/project/.sdk/src/cmp/py/ReadmeModel_py.ts +3 -3
- package/project/.sdk/src/cmp/py/ReadmeRef_py.ts +5 -5
- package/project/.sdk/src/cmp/py/Schema_py.ts +1 -1
- package/project/.sdk/src/cmp/py/TestDirect_py.ts +25 -25
- package/project/.sdk/src/cmp/py/TestEntity_py.ts +66 -65
- package/project/.sdk/src/cmp/py-data/Main_py-data.ts +4 -4
- package/project/.sdk/src/cmp/rb/EntityTypes_rb.ts +4 -4
- package/project/.sdk/src/cmp/rb/ReadmeEntity_rb.ts +3 -3
- package/project/.sdk/src/cmp/rb/ReadmeModel_rb.ts +3 -3
- package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +4 -4
- package/project/.sdk/src/cmp/rb/ReadmeRef_rb.ts +5 -5
- package/project/.sdk/src/cmp/rb/Schema_rb.ts +1 -1
- package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +25 -25
- package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +66 -65
- package/project/.sdk/src/cmp/rust/EntityTypes_rust.ts +4 -4
- package/project/.sdk/src/cmp/rust/ReadmeEntity_rust.ts +3 -3
- package/project/.sdk/src/cmp/rust/ReadmeModel_rust.ts +3 -3
- package/project/.sdk/src/cmp/rust/ReadmeRef_rust.ts +5 -5
- package/project/.sdk/src/cmp/rust/Schema_rust.ts +1 -1
- package/project/.sdk/src/cmp/rust/TestDirect_rust.ts +18 -18
- package/project/.sdk/src/cmp/rust/TestEntity_rust.ts +63 -62
- package/project/.sdk/src/cmp/scala/EntityTypes_scala.ts +4 -4
- package/project/.sdk/src/cmp/scala/ReadmeEntity_scala.ts +3 -3
- package/project/.sdk/src/cmp/scala/ReadmeModel_scala.ts +3 -3
- package/project/.sdk/src/cmp/scala/ReadmeRef_scala.ts +5 -5
- package/project/.sdk/src/cmp/scala/Schema_scala.ts +1 -1
- package/project/.sdk/src/cmp/scala/TestDirect_scala.ts +14 -14
- package/project/.sdk/src/cmp/scala/TestEntity_scala.ts +60 -59
- package/project/.sdk/src/cmp/swift/EntityTypes_swift.ts +4 -4
- package/project/.sdk/src/cmp/swift/ReadmeEntity_swift.ts +3 -3
- package/project/.sdk/src/cmp/swift/ReadmeModel_swift.ts +3 -3
- package/project/.sdk/src/cmp/swift/ReadmeRef_swift.ts +5 -5
- package/project/.sdk/src/cmp/swift/Schema_swift.ts +1 -1
- package/project/.sdk/src/cmp/ts/EntityTypes_ts.ts +5 -5
- package/project/.sdk/src/cmp/ts/ReadmeEntity_ts.ts +3 -3
- package/project/.sdk/src/cmp/ts/ReadmeModel_ts.ts +3 -3
- package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +1 -1
- package/project/.sdk/src/cmp/ts/ReadmeRef_ts.ts +5 -5
- package/project/.sdk/src/cmp/ts/Schema_ts.ts +1 -1
- package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +40 -40
- package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +72 -75
- package/project/.sdk/src/cmp/ts/TestLive_ts.ts +3 -3
- package/project/.sdk/src/cmp/ts/utility_ts.ts +5 -5
- package/project/.sdk/src/cmp/zig/ReadmeEntity_zig.ts +3 -3
- package/project/.sdk/src/cmp/zig/ReadmeModel_zig.ts +3 -3
- package/project/.sdk/src/cmp/zig/ReadmeRef_zig.ts +5 -5
- package/project/.sdk/src/cmp/zig/Schema_zig.ts +1 -1
- package/project/.sdk/tm/c/core/context.c +3 -1
- package/project/.sdk/tm/c/feature/paging.c +37 -3
- package/project/.sdk/tm/c/feature/test.c +71 -31
- package/project/.sdk/tm/c/utility/prepare_query.c +2 -1
- package/project/.sdk/tm/c/utility/transform_request.c +25 -3
- package/project/.sdk/tm/clojure/src/sdk/core.clj +21 -7
- package/project/.sdk/tm/clojure/src/sdk/features.clj +74 -22
- package/project/.sdk/tm/cpp/core/types.hpp +1 -1
- package/project/.sdk/tm/cpp/feature/paging.hpp +36 -3
- package/project/.sdk/tm/cpp/feature/test.hpp +58 -19
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +16 -4
- package/project/.sdk/tm/csharp/core/Context.cs +1 -1
- package/project/.sdk/tm/csharp/feature/PagingFeature.cs +58 -4
- package/project/.sdk/tm/csharp/feature/TestFeature.cs +23 -25
- package/project/.sdk/tm/csharp/utility/Fetcher.cs +19 -12
- package/project/.sdk/tm/csharp/utility/PrepareQuery.cs +1 -1
- package/project/.sdk/tm/csharp/utility/TransformRequest.cs +23 -3
- package/project/.sdk/tm/elixir/lib/projectname/context.ex +1 -1
- package/project/.sdk/tm/elixir/lib/projectname/feature/paging.ex +52 -10
- package/project/.sdk/tm/elixir/lib/projectname/feature/test.ex +58 -22
- package/project/.sdk/tm/elixir/lib/projectname/utility.ex +30 -9
- package/project/.sdk/tm/go/core/context.go +13 -13
- package/project/.sdk/tm/go/feature/paging_feature.go +40 -2
- package/project/.sdk/tm/go/feature/test_feature.go +3 -15
- package/project/.sdk/tm/go/test/feature_corpus_test.go +1 -0
- package/project/.sdk/tm/go/test/feature_test.go +54 -0
- package/project/.sdk/tm/go/utility/fetcher.go +41 -20
- package/project/.sdk/tm/go/utility/prepare_query.go +1 -1
- package/project/.sdk/tm/go/utility/transform_request.go +22 -3
- package/project/.sdk/tm/java/core/Context.java +2 -1
- package/project/.sdk/tm/java/feature/PagingFeature.java +46 -4
- package/project/.sdk/tm/java/feature/TestFeature.java +21 -19
- package/project/.sdk/tm/java/test/FeatureCorpusTest.java +3 -0
- package/project/.sdk/tm/java/test/FeatureTest.java +42 -0
- package/project/.sdk/tm/java/utility/Fetcher.java +36 -28
- package/project/.sdk/tm/java/utility/PrepareQuery.java +1 -1
- package/project/.sdk/tm/java/utility/TransformRequest.java +18 -3
- package/project/.sdk/tm/js/src/Context.js +7 -2
- package/project/.sdk/tm/js/src/feature/paging/PagingFeature.js +24 -6
- package/project/.sdk/tm/js/src/feature/test/TestFeature.js +7 -5
- package/project/.sdk/tm/js/src/utility/PrepareQueryUtility.js +1 -1
- package/project/.sdk/tm/js/test/feature/Corpus.test.js +4 -0
- package/project/.sdk/tm/js/test/live-entity.js +29 -29
- package/project/.sdk/tm/js/test/live-scenarios.js +4 -4
- package/project/.sdk/tm/kotlin/core/Context.kt +1 -1
- package/project/.sdk/tm/kotlin/feature/PagingFeature.kt +36 -4
- package/project/.sdk/tm/kotlin/feature/TestFeature.kt +19 -18
- package/project/.sdk/tm/kotlin/utility/Fetcher.kt +33 -24
- package/project/.sdk/tm/kotlin/utility/Prepare.kt +1 -1
- package/project/.sdk/tm/kotlin/utility/ResultTransform.kt +18 -3
- package/project/.sdk/tm/lua/core/context.lua +8 -1
- package/project/.sdk/tm/lua/core/control.lua +3 -0
- package/project/.sdk/tm/lua/feature/paging_feature.lua +44 -5
- package/project/.sdk/tm/lua/feature/test_feature.lua +32 -14
- package/project/.sdk/tm/lua/utility/prepare_query.lua +2 -1
- package/project/.sdk/tm/lua/utility/transform_request.lua +19 -3
- package/project/.sdk/tm/ocaml/sdk_features.ml +78 -25
- package/project/.sdk/tm/ocaml/sdk_runtime.ml +23 -8
- package/project/.sdk/tm/perl/core/context.pm +2 -1
- package/project/.sdk/tm/perl/feature/paging_feature.pm +31 -5
- package/project/.sdk/tm/perl/feature/test_feature.pm +52 -20
- package/project/.sdk/tm/perl/feature/timeout_feature.pm +17 -13
- package/project/.sdk/tm/perl/t/feature_corpus.t +14 -1
- package/project/.sdk/tm/perl/utility/fetcher.pm +15 -1
- package/project/.sdk/tm/perl/utility/prepare_query.pm +1 -0
- package/project/.sdk/tm/perl/utility/transform_request.pm +13 -3
- package/project/.sdk/tm/php/core/Context.php +5 -1
- package/project/.sdk/tm/php/core/Control.php +5 -0
- package/project/.sdk/tm/php/feature/PagingFeature.php +26 -5
- package/project/.sdk/tm/php/feature/TestFeature.php +27 -42
- package/project/.sdk/tm/php/test/FeatureCorpusTest.php +17 -1
- package/project/.sdk/tm/php/test/FeatureTest.php +44 -0
- package/project/.sdk/tm/php/utility/Fetcher.php +17 -3
- package/project/.sdk/tm/php/utility/PrepareQuery.php +1 -1
- package/project/.sdk/tm/php/utility/TransformRequest.php +15 -3
- package/project/.sdk/tm/py/pkg/core/context.py +2 -1
- package/project/.sdk/tm/py/pkg/feature/paging_feature.py +29 -4
- package/project/.sdk/tm/py/pkg/feature/test_feature.py +29 -12
- package/project/.sdk/tm/py/pkg/utility/fetcher.py +63 -65
- package/project/.sdk/tm/py/pkg/utility/prepare_query.py +2 -1
- package/project/.sdk/tm/py/pkg/utility/transform_request.py +11 -3
- package/project/.sdk/tm/py/test/test_feature.py +27 -0
- package/project/.sdk/tm/py/test/test_feature_corpus.py +11 -1
- package/project/.sdk/tm/rb/core/context.rb +1 -1
- package/project/.sdk/tm/rb/feature/paging_feature.rb +27 -5
- package/project/.sdk/tm/rb/feature/test_feature.rb +39 -11
- package/project/.sdk/tm/rb/test/feature_corpus_test.rb +12 -1
- package/project/.sdk/tm/rb/test/feature_test.rb +38 -0
- package/project/.sdk/tm/rb/utility/fetcher.rb +49 -3
- package/project/.sdk/tm/rb/utility/prepare_query.rb +1 -1
- package/project/.sdk/tm/rb/utility/transform_request.rb +10 -3
- package/project/.sdk/tm/rust/core/context.rs +2 -6
- package/project/.sdk/tm/rust/feature/paging.rs +44 -3
- package/project/.sdk/tm/rust/feature/secrets.rs +1 -1
- package/project/.sdk/tm/rust/feature/test.rs +74 -37
- package/project/.sdk/tm/rust/utility/fetcher.rs +41 -14
- package/project/.sdk/tm/rust/utility/prepare_query.rs +1 -1
- package/project/.sdk/tm/rust/utility/transform_request.rs +31 -5
- package/project/.sdk/tm/scala/core/Context.scala +2 -1
- package/project/.sdk/tm/scala/feature/PagingFeature.scala +41 -4
- package/project/.sdk/tm/scala/feature/TestFeature.scala +21 -18
- package/project/.sdk/tm/scala/utility/Fetcher.scala +34 -13
- package/project/.sdk/tm/scala/utility/Prepare.scala +1 -1
- package/project/.sdk/tm/scala/utility/Transform.scala +19 -3
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Context.swift +1 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/PagingFeature.swift +31 -4
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/TestFeature.swift +22 -15
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Fetcher.swift +22 -3
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Prepare.swift +1 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/ResultUtil.swift +14 -3
- package/project/.sdk/tm/ts/src/Context.ts +7 -2
- package/project/.sdk/tm/ts/src/feature/paging/PagingFeature.ts +19 -3
- package/project/.sdk/tm/ts/src/feature/test/TestFeature.ts +3 -0
- package/project/.sdk/tm/ts/src/utility/PrepareQueryUtility.ts +1 -1
- package/project/.sdk/tm/ts/test/feature/Corpus.test.ts +1 -0
- package/project/.sdk/tm/ts/test/live-entity.ts +26 -26
- package/project/.sdk/tm/ts/test/live-scenarios.ts +3 -3
- package/project/.sdk/tm/zig/core/context.zig +1 -1
- package/project/.sdk/tm/zig/core/utility.zig +19 -5
- package/project/.sdk/tm/zig/feature/paging.zig +34 -4
- package/project/.sdk/tm/zig/feature/test.zig +65 -30
- package/project/sdkgen-package.json +1 -1
- package/src/action/doctor.ts +12 -9
- package/src/action/edition.ts +8 -0
- package/src/action/feature.ts +7 -1
- package/src/action/remove.ts +492 -0
- package/src/action/target.ts +8 -1
- package/src/cmp/ReadmeTop.ts +1 -1
- package/src/cmp/ReadmeUnions.ts +1 -1
- package/src/cmp/Test.ts +1 -1
- package/src/helpers/buildIdNames.ts +17 -7
- package/src/helpers/canonSpec.ts +2 -2
- package/src/helpers/getMatchEntries.ts +2 -2
- package/src/helpers/modelNames.ts +6 -1
- package/src/helpers/opShape.ts +33 -33
- package/src/helpers/pointPath.ts +5 -10
- package/src/helpers/resolved.ts +3 -14
- package/src/sdkgen.ts +3 -1
- package/src/utility.ts +16 -7
|
@@ -33,10 +33,10 @@ function normalizePathParams(
|
|
|
33
33
|
// original name was renamed to another param's current name (e.g. badge
|
|
34
34
|
// load: param 'group_id' has orig 'id', and another param has name 'id').
|
|
35
35
|
const param = params.find((p: any) =>
|
|
36
|
-
p.
|
|
36
|
+
p.n === snaked || p.n === depluralized) ||
|
|
37
37
|
params.find((p: any) =>
|
|
38
|
-
p.
|
|
39
|
-
if (param) return '{' + param.
|
|
38
|
+
p.or === snaked || p.or === depluralized)
|
|
39
|
+
if (param) return '{' + param.n + '}'
|
|
40
40
|
|
|
41
41
|
if (rename) {
|
|
42
42
|
for (const [origCamel, renamedTo] of Object.entries(rename)) {
|
|
@@ -44,10 +44,10 @@ function normalizePathParams(
|
|
|
44
44
|
const origSnaked = snakify(origCamel)
|
|
45
45
|
const origDepluralized = depluralize(origSnaked)
|
|
46
46
|
const renamedParam = params.find(
|
|
47
|
-
(p: any) => p.
|
|
48
|
-
p.
|
|
47
|
+
(p: any) => p.or === origSnaked || p.n === origSnaked ||
|
|
48
|
+
p.or === origDepluralized || p.n === origDepluralized
|
|
49
49
|
)
|
|
50
|
-
if (renamedParam) return '{' + renamedParam.
|
|
50
|
+
if (renamedParam) return '{' + renamedParam.n + '}'
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -110,8 +110,8 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
110
110
|
const listOp = entity.op?.list
|
|
111
111
|
|
|
112
112
|
const loadPoint = loadOp?.points?.[0]
|
|
113
|
-
const loadPath = loadPoint ? normalizePathParams(pointParts(loadPoint), loadPoint?.
|
|
114
|
-
const allLoadParams = loadPoint?.
|
|
113
|
+
const loadPath = loadPoint ? normalizePathParams(pointParts(loadPoint), loadPoint?.g?.params || [], loadPoint?.r?.param) : ''
|
|
114
|
+
const allLoadParams = loadPoint?.g?.params || []
|
|
115
115
|
// Only path params that actually appear in the URL template drive direct-
|
|
116
116
|
// test path-param setup and URL-substitution asserts (see TestDirect_rb).
|
|
117
117
|
const _pathPlaceholders = new Set<string>()
|
|
@@ -120,7 +120,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
120
120
|
_pathPlaceholders.add(part.slice(1, -1))
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
const _renameMap = (loadPoint?.
|
|
123
|
+
const _renameMap = (loadPoint?.r?.param || {}) as Record<string, string>
|
|
124
124
|
const _renamedPlaceholders = new Set<string>()
|
|
125
125
|
for (const ph of _pathPlaceholders) {
|
|
126
126
|
_renamedPlaceholders.add(ph)
|
|
@@ -129,25 +129,25 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
const loadParams = allLoadParams.filter((p: any) =>
|
|
132
|
-
_renamedPlaceholders.has(p.
|
|
132
|
+
_renamedPlaceholders.has(p.n) || _renamedPlaceholders.has(p.or))
|
|
133
133
|
|
|
134
134
|
const listPoint = listOp?.points?.[0]
|
|
135
|
-
const listPath = listPoint ? normalizePathParams(pointParts(listPoint), listPoint?.
|
|
136
|
-
const listParams = listPoint?.
|
|
135
|
+
const listPath = listPoint ? normalizePathParams(pointParts(listPoint), listPoint?.g?.params || [], listPoint?.r?.param) : ''
|
|
136
|
+
const listParams = listPoint?.g?.params || []
|
|
137
137
|
|
|
138
138
|
// Required query params with spec-provided examples - needed in live mode.
|
|
139
|
-
const loadQuery = loadPoint?.
|
|
139
|
+
const loadQuery = loadPoint?.g?.query || []
|
|
140
140
|
const loadLiveQueryEntries = loadQuery
|
|
141
|
-
.filter((q: any) => q.
|
|
141
|
+
.filter((q: any) => q.r && undefined !== q.ex && null !== q.ex)
|
|
142
142
|
const loadLiveQueryLines = loadLiveQueryEntries
|
|
143
|
-
.map((q: any) => ` $query->{'${q.
|
|
143
|
+
.map((q: any) => ` $query->{'${q.n}'} = ${perlScalar(q.ex)};`)
|
|
144
144
|
.join('\n')
|
|
145
145
|
|
|
146
146
|
const loadAllHaveExamples =
|
|
147
147
|
loadParams.length > 0 &&
|
|
148
|
-
loadParams.every((p: any) => undefined !== p.
|
|
148
|
+
loadParams.every((p: any) => undefined !== p.ex && null !== p.ex)
|
|
149
149
|
const loadExampleLines = loadAllHaveExamples
|
|
150
|
-
? loadParams.map((p: any) => ` $params->{'${p.
|
|
150
|
+
? loadParams.map((p: any) => ` $params->{'${p.n}'} = ${perlScalar(p.ex)};`).join('\n')
|
|
151
151
|
: ''
|
|
152
152
|
|
|
153
153
|
const entidEnvVar = `${PROJECTNAME}_TEST_${envToken(entity.name)}_ENTID`
|
|
@@ -171,9 +171,9 @@ require(Cwd::abs_path("$FindBin::Bin/runner.pm"));
|
|
|
171
171
|
|
|
172
172
|
if (hasList && listPoint) {
|
|
173
173
|
const listLiveIdKeys: string[] = listParams.map((lp: any) => {
|
|
174
|
-
return lp.
|
|
174
|
+
return lp.n === 'id'
|
|
175
175
|
? entity.name + '01'
|
|
176
|
-
: lp.
|
|
176
|
+
: lp.n.replace(/_id$/, '') + '01'
|
|
177
177
|
})
|
|
178
178
|
const listSkipBlock = listLiveIdKeys.length > 0
|
|
179
179
|
? ` if ($setup->{live}) {
|
|
@@ -207,14 +207,14 @@ ${listSkipBlock} my $client = $setup->{client};
|
|
|
207
207
|
Content(` my $params = {};
|
|
208
208
|
`)
|
|
209
209
|
for (const lp of listParams) {
|
|
210
|
-
const key = lp.
|
|
210
|
+
const key = lp.n === 'id'
|
|
211
211
|
? entity.name + '01'
|
|
212
|
-
: lp.
|
|
212
|
+
: lp.n.replace(/_id$/, '') + '01'
|
|
213
213
|
Content(` if ($setup->{live}) {
|
|
214
|
-
$params->{'${lp.
|
|
214
|
+
$params->{'${lp.n}'} = $setup->{idmap}{'${key}'};
|
|
215
215
|
}
|
|
216
216
|
else {
|
|
217
|
-
$params->{'${lp.
|
|
217
|
+
$params->{'${lp.n}'} = 'direct01';
|
|
218
218
|
}
|
|
219
219
|
`)
|
|
220
220
|
}
|
|
@@ -305,7 +305,7 @@ ${loadSkipBlock} my $client = $setup->{client};
|
|
|
305
305
|
else {
|
|
306
306
|
`)
|
|
307
307
|
for (let i = 0; i < loadParams.length; i++) {
|
|
308
|
-
Content(` $params->{'${loadParams[i].
|
|
308
|
+
Content(` $params->{'${loadParams[i].n}'} = 'direct0${i + 1}';
|
|
309
309
|
`)
|
|
310
310
|
}
|
|
311
311
|
Content(` }
|
|
@@ -320,7 +320,7 @@ ${loadLiveQueryLines}
|
|
|
320
320
|
Content(` unless ($setup->{live}) {
|
|
321
321
|
`)
|
|
322
322
|
for (let i = 0; i < loadParams.length; i++) {
|
|
323
|
-
Content(` $params->{'${loadParams[i].
|
|
323
|
+
Content(` $params->{'${loadParams[i].n}'} = 'direct0${i + 1}';
|
|
324
324
|
`)
|
|
325
325
|
}
|
|
326
326
|
Content(` }
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { flowSteps } from '@voxgig/sdkgen'
|
|
1
2
|
|
|
2
3
|
import {
|
|
3
4
|
KIT,
|
|
@@ -80,10 +81,10 @@ const TestEntity = cmp(function TestEntity(props: any) {
|
|
|
80
81
|
const idnames = buildIdNames(entity, basicflow)
|
|
81
82
|
const idnamesStr = idnames.map(n => `'${n}'`).join(', ')
|
|
82
83
|
|
|
83
|
-
const allSteps = Object.values(basicflow
|
|
84
|
-
const updateStep = allSteps.find((s: any) => s.
|
|
85
|
-
const updateData = updateStep?.
|
|
86
|
-
? Object.entries(updateStep.
|
|
84
|
+
const allSteps = Object.values(flowSteps(basicflow)) as any[]
|
|
85
|
+
const updateStep = allSteps.find((s: any) => s.o === 'update')
|
|
86
|
+
const updateData = updateStep?.d
|
|
87
|
+
? Object.entries(updateStep.d).filter(([k]: any) => k !== 'id' && !k.endsWith('$'))
|
|
87
88
|
: []
|
|
88
89
|
const aliases = updateData.map(([k, v]: any) => [k, v])
|
|
89
90
|
|
|
@@ -93,7 +94,7 @@ const TestEntity = cmp(function TestEntity(props: any) {
|
|
|
93
94
|
// below therefore wraps this in a second pair of parens, which is a no-op
|
|
94
95
|
// for a non-empty list because Perl flattens it.
|
|
95
96
|
const opsList = Array.from(new Set(
|
|
96
|
-
(allSteps as any[]).map((s: any) => s.
|
|
97
|
+
(allSteps as any[]).map((s: any) => s.o).filter(Boolean)))
|
|
97
98
|
.map(o => `'${o}'`).join(', ')
|
|
98
99
|
|
|
99
100
|
const genCtx: GenCtx = { model, entity, flow: basicflow, N, PROJUPPER }
|
|
@@ -145,7 +146,7 @@ BASIC_FLOW: {
|
|
|
145
146
|
`)
|
|
146
147
|
|
|
147
148
|
// Check if the flow has a create step
|
|
148
|
-
const flowHasCreate = allSteps.some((s: any) => s.
|
|
149
|
+
const flowHasCreate = allSteps.some((s: any) => s.o === 'create')
|
|
149
150
|
if (!flowHasCreate) {
|
|
150
151
|
Content(` # Bootstrap entity data from existing test data.
|
|
151
152
|
$V{${entity.name}_ref01_data_raw} = Voxgig::Struct::items(${N}Helpers::to_map(
|
|
@@ -159,8 +160,8 @@ BASIC_FLOW: {
|
|
|
159
160
|
}
|
|
160
161
|
|
|
161
162
|
// Model-driven step iteration
|
|
162
|
-
each(basicflow
|
|
163
|
-
const opgen: OpGen = GENERATE_OP[step.
|
|
163
|
+
each(flowSteps(basicflow), (step: any, index: any) => {
|
|
164
|
+
const opgen: OpGen = GENERATE_OP[step.o]
|
|
164
165
|
if (opgen) {
|
|
165
166
|
opgen(genCtx, step, index)
|
|
166
167
|
Content('\n')
|
|
@@ -261,13 +262,13 @@ done_testing();
|
|
|
261
262
|
|
|
262
263
|
const generateCreate: OpGen = (ctx, step, index) => {
|
|
263
264
|
const { entity, flow, N } = ctx
|
|
264
|
-
const ref = step.
|
|
265
|
-
const entvar = step.
|
|
266
|
-
const datavar = step.
|
|
265
|
+
const ref = step.i.ref ?? entity.name + '_ref01'
|
|
266
|
+
const entvar = step.i.entvar ?? ref + '_ent'
|
|
267
|
+
const datavar = step.i.datavar ?? (ref + '_data' + (step.i.suffix ?? ''))
|
|
267
268
|
|
|
268
|
-
const priorSteps = Object.values(flow
|
|
269
|
+
const priorSteps = Object.values(flowSteps(flow)).slice(0, Number(index)) as any[]
|
|
269
270
|
const needsEnt = !priorSteps.some((s: any) =>
|
|
270
|
-
['create', 'list', 'load', 'update', 'remove'].includes(s.
|
|
271
|
+
['create', 'list', 'load', 'update', 'remove'].includes(s.o))
|
|
271
272
|
|
|
272
273
|
Content(` # CREATE
|
|
273
274
|
`)
|
|
@@ -299,14 +300,14 @@ const generateCreate: OpGen = (ctx, step, index) => {
|
|
|
299
300
|
|
|
300
301
|
const generateList: OpGen = (ctx, step, index) => {
|
|
301
302
|
const { entity, flow, N } = ctx
|
|
302
|
-
const ref = step.
|
|
303
|
-
const entvar = step.
|
|
304
|
-
const matchvar = step.
|
|
305
|
-
const listvar = step.
|
|
303
|
+
const ref = step.i.ref ?? entity.name + '_ref01'
|
|
304
|
+
const entvar = step.i.entvar ?? ref + '_ent'
|
|
305
|
+
const matchvar = step.i.matchvar ?? (ref + '_match' + (step.i.suffix ?? ''))
|
|
306
|
+
const listvar = step.i.listvar ?? (ref + '_list' + (step.i.suffix ?? ''))
|
|
306
307
|
|
|
307
|
-
const priorSteps = Object.values(flow
|
|
308
|
+
const priorSteps = Object.values(flowSteps(flow)).slice(0, Number(index)) as any[]
|
|
308
309
|
const needsEnt = !priorSteps.some((s: any) =>
|
|
309
|
-
['create', 'list', 'load', 'update', 'remove'].includes(s.
|
|
310
|
+
['create', 'list', 'load', 'update', 'remove'].includes(s.o))
|
|
310
311
|
|
|
311
312
|
Content(` # LIST
|
|
312
313
|
`)
|
|
@@ -336,12 +337,12 @@ const generateList: OpGen = (ctx, step, index) => {
|
|
|
336
337
|
`)
|
|
337
338
|
|
|
338
339
|
// Handle validators
|
|
339
|
-
const allSteps = Object.values(flow
|
|
340
|
-
if (step.
|
|
341
|
-
for (const validator of step.
|
|
340
|
+
const allSteps = Object.values(flowSteps(flow)) as any[]
|
|
341
|
+
if (step.v) {
|
|
342
|
+
for (const validator of step.v) {
|
|
342
343
|
const validRef = validator.def?.ref
|
|
343
|
-
const hasRefData = validRef && allSteps.some((s: any) => 'create' === s.
|
|
344
|
-
((s.
|
|
344
|
+
const hasRefData = validRef && allSteps.some((s: any) => 'create' === s.o &&
|
|
345
|
+
((s.i.ref ?? entity.name + '_ref01') === validRef))
|
|
345
346
|
|
|
346
347
|
if ('ItemExists' === validator.apply && hasRefData) {
|
|
347
348
|
const refDataVar = validRef + '_data'
|
|
@@ -367,16 +368,16 @@ const generateList: OpGen = (ctx, step, index) => {
|
|
|
367
368
|
|
|
368
369
|
const generateUpdate: OpGen = (ctx, step, index) => {
|
|
369
370
|
const { entity, flow, N } = ctx
|
|
370
|
-
const ref = step.
|
|
371
|
-
const entvar = step.
|
|
372
|
-
const datavar = step.
|
|
373
|
-
const resdatavar = step.
|
|
374
|
-
const markdefvar = step.
|
|
375
|
-
const srcdatavar = step.
|
|
376
|
-
|
|
377
|
-
const priorSteps = Object.values(flow
|
|
371
|
+
const ref = step.i.ref ?? entity.name + '_ref01'
|
|
372
|
+
const entvar = step.i.entvar ?? ref + '_ent'
|
|
373
|
+
const datavar = step.i.datavar ?? (ref + '_data' + (step.i.suffix ?? ''))
|
|
374
|
+
const resdatavar = step.i.resdatavar ?? (ref + '_resdata' + (step.i.suffix ?? ''))
|
|
375
|
+
const markdefvar = step.i.markdefvar ?? (ref + '_markdef' + (step.i.suffix ?? ''))
|
|
376
|
+
const srcdatavar = step.i.srcdatavar ?? (ref + '_data' + (step.i.suffix ?? ''))
|
|
377
|
+
|
|
378
|
+
const priorSteps = Object.values(flowSteps(flow)).slice(0, Number(index)) as any[]
|
|
378
379
|
const needsEnt = !priorSteps.some((s: any) =>
|
|
379
|
-
['create', 'list', 'load', 'update', 'remove'].includes(s.
|
|
380
|
+
['create', 'list', 'load', 'update', 'remove'].includes(s.o))
|
|
380
381
|
|
|
381
382
|
const hasEntIdU = null != entity.id
|
|
382
383
|
|
|
@@ -393,8 +394,8 @@ const generateUpdate: OpGen = (ctx, step, index) => {
|
|
|
393
394
|
`)
|
|
394
395
|
}
|
|
395
396
|
|
|
396
|
-
if (step.
|
|
397
|
-
const dataEntries = Object.entries(step.
|
|
397
|
+
if (step.d) {
|
|
398
|
+
const dataEntries = Object.entries(step.d).filter(([k]: any) => k !== 'id' && !k.endsWith('$'))
|
|
398
399
|
for (const [key] of dataEntries) {
|
|
399
400
|
Content(` '${key}' => $setup->{idmap}{'${key}'},
|
|
400
401
|
`)
|
|
@@ -404,10 +405,10 @@ const generateUpdate: OpGen = (ctx, step, index) => {
|
|
|
404
405
|
Content(` };
|
|
405
406
|
`)
|
|
406
407
|
|
|
407
|
-
if (step.
|
|
408
|
-
for (const spec of step.
|
|
409
|
-
if ('TextFieldMark' === spec.apply && null != step.
|
|
410
|
-
const fieldname = step.
|
|
408
|
+
if (step.s) {
|
|
409
|
+
for (const spec of step.s) {
|
|
410
|
+
if ('TextFieldMark' === spec.apply && null != step.i.textfield) {
|
|
411
|
+
const fieldname = step.i.textfield
|
|
411
412
|
const fieldvalue = spec.def?.mark ?? `Mark01-${ref}`
|
|
412
413
|
Content(`
|
|
413
414
|
$V{${markdefvar}_name} = '${fieldname}';
|
|
@@ -428,9 +429,9 @@ const generateUpdate: OpGen = (ctx, step, index) => {
|
|
|
428
429
|
`)
|
|
429
430
|
}
|
|
430
431
|
|
|
431
|
-
if (step.
|
|
432
|
-
for (const spec of step.
|
|
433
|
-
if ('TextFieldMark' === spec.apply && null != step.
|
|
432
|
+
if (step.s) {
|
|
433
|
+
for (const spec of step.s) {
|
|
434
|
+
if ('TextFieldMark' === spec.apply && null != step.i.textfield) {
|
|
434
435
|
Content(` is($V{${resdatavar}}{ $V{${markdefvar}_name} }, $V{${markdefvar}_value}, '${entity.name} update: mark');
|
|
435
436
|
`)
|
|
436
437
|
}
|
|
@@ -441,23 +442,23 @@ const generateUpdate: OpGen = (ctx, step, index) => {
|
|
|
441
442
|
|
|
442
443
|
const generateLoad: OpGen = (ctx, step, index) => {
|
|
443
444
|
const { entity, flow, N } = ctx
|
|
444
|
-
const ref = step.
|
|
445
|
-
const entvar = step.
|
|
446
|
-
const matchvar = step.
|
|
447
|
-
const datavar = step.
|
|
448
|
-
const srcdatavar = step.
|
|
445
|
+
const ref = step.i.ref ?? entity.name + '_ref01'
|
|
446
|
+
const entvar = step.i.entvar ?? ref + '_ent'
|
|
447
|
+
const matchvar = step.i.matchvar ?? (ref + '_match' + (step.i.suffix ?? ''))
|
|
448
|
+
const datavar = step.i.datavar ?? (ref + '_data' + (step.i.suffix ?? ''))
|
|
449
|
+
const srcdatavar = step.i.srcdatavar ?? (ref + '_data' + (step.i.suffix ?? ''))
|
|
449
450
|
|
|
450
|
-
const priorSteps = Object.values(flow
|
|
451
|
+
const priorSteps = Object.values(flowSteps(flow)).slice(0, Number(index)) as any[]
|
|
451
452
|
const hasEntVar = priorSteps.some((s: any) =>
|
|
452
|
-
['create', 'list', 'load', 'update', 'remove'].includes(s.
|
|
453
|
+
['create', 'list', 'load', 'update', 'remove'].includes(s.o))
|
|
453
454
|
|
|
454
|
-
const flowHasCreate = Object.values(flow
|
|
455
|
+
const flowHasCreate = Object.values(flowSteps(flow)).some((s: any) => (s as any).o === 'create')
|
|
455
456
|
const preambleRef = entity.name + '_ref01'
|
|
456
457
|
const hasSrcData = (!flowHasCreate && srcdatavar === (preambleRef + '_data')) ||
|
|
457
458
|
priorSteps.some((s: any) => {
|
|
458
|
-
if ('create' === s.
|
|
459
|
-
const priorRef = s.
|
|
460
|
-
const priorDatvar = s.
|
|
459
|
+
if ('create' === s.o) {
|
|
460
|
+
const priorRef = s.i.ref ?? entity.name + '_ref01'
|
|
461
|
+
const priorDatvar = s.i.datavar ?? (priorRef + '_data' + (s.i.suffix ?? ''))
|
|
461
462
|
return priorDatvar === srcdatavar
|
|
462
463
|
}
|
|
463
464
|
return false
|
|
@@ -501,14 +502,14 @@ const generateLoad: OpGen = (ctx, step, index) => {
|
|
|
501
502
|
|
|
502
503
|
const generateRemove: OpGen = (ctx, step, index) => {
|
|
503
504
|
const { entity, flow, N } = ctx
|
|
504
|
-
const ref = step.
|
|
505
|
-
const entvar = step.
|
|
506
|
-
const matchvar = step.
|
|
507
|
-
const srcdatavar = step.
|
|
505
|
+
const ref = step.i.ref ?? entity.name + '_ref01'
|
|
506
|
+
const entvar = step.i.entvar ?? ref + '_ent'
|
|
507
|
+
const matchvar = step.i.matchvar ?? (ref + '_match' + (step.i.suffix ?? ''))
|
|
508
|
+
const srcdatavar = step.i.srcdatavar ?? (ref + '_data')
|
|
508
509
|
|
|
509
|
-
const priorSteps = Object.values(flow
|
|
510
|
+
const priorSteps = Object.values(flowSteps(flow)).slice(0, Number(index)) as any[]
|
|
510
511
|
const needsEnt = !priorSteps.some((s: any) =>
|
|
511
|
-
['create', 'list', 'load', 'update', 'remove'].includes(s.
|
|
512
|
+
['create', 'list', 'load', 'update', 'remove'].includes(s.o))
|
|
512
513
|
|
|
513
514
|
Content(` # REMOVE
|
|
514
515
|
`)
|
|
@@ -60,8 +60,8 @@ declare(strict_types=1);
|
|
|
60
60
|
|
|
61
61
|
// Typed models for the ${model.const.Name} SDK.
|
|
62
62
|
//
|
|
63
|
-
// GENERATED from the API model: main.${KIT}.entity.<e>.fields
|
|
64
|
-
// params (op.<name>.points[].
|
|
63
|
+
// GENERATED from the API model: main.${KIT}.entity.<e>.fields{} and per-op
|
|
64
|
+
// params (op.<name>.points[].g.params[]). Field/param types come from the
|
|
65
65
|
// canonical type sentinels via @voxgig/sdkgen canonToType (source of truth:
|
|
66
66
|
// @voxgig/apidef VALID_CANON). Do not edit by hand.
|
|
67
67
|
//
|
|
@@ -74,7 +74,7 @@ declare(strict_types=1);
|
|
|
74
74
|
entityList.forEach((ent: any) => {
|
|
75
75
|
const Name = ent.Name
|
|
76
76
|
const fields = (ent.fields ? each(ent.fields) : [])
|
|
77
|
-
.filter((f: any) => f.
|
|
77
|
+
.filter((f: any) => f.a !== false && validName(f.n))
|
|
78
78
|
|
|
79
79
|
const TypeName = phpSafeTypeName(Name)
|
|
80
80
|
|
|
@@ -83,7 +83,7 @@ class ${TypeName}
|
|
|
83
83
|
{
|
|
84
84
|
`)
|
|
85
85
|
fields.forEach((f: any) => {
|
|
86
|
-
Content(propLine(f.
|
|
86
|
+
Content(propLine(f.n, f.t, false === f.r))
|
|
87
87
|
})
|
|
88
88
|
Content(`}
|
|
89
89
|
|
|
@@ -53,7 +53,7 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
|
53
53
|
|
|
54
54
|
publishedEntities.map((entity: any) => {
|
|
55
55
|
const opnames = Object.keys(entity.op || {})
|
|
56
|
-
const fields = entity.fields ||
|
|
56
|
+
const fields = Object.values(entity.fields || {})
|
|
57
57
|
const idF = entityIdField(entity)
|
|
58
58
|
|
|
59
59
|
Content(`
|
|
@@ -97,8 +97,8 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
|
97
97
|
`)
|
|
98
98
|
|
|
99
99
|
each(fields, (field: any) => {
|
|
100
|
-
const desc = field.
|
|
101
|
-
Content(`| \`${field.
|
|
100
|
+
const desc = field.sh || ''
|
|
101
|
+
Content(`| \`${field.n}\` | \`${canonToType(field.t, target.name)}\` | ${desc} |
|
|
102
102
|
`)
|
|
103
103
|
})
|
|
104
104
|
|
|
@@ -116,13 +116,13 @@ On error, \`ok\` is \`false\` and \`$err\` contains the error value.
|
|
|
116
116
|
|
|
117
117
|
`)
|
|
118
118
|
each(entityList, (ent: any) => {
|
|
119
|
-
const fields = ent.fields ||
|
|
119
|
+
const fields = Object.values(ent.fields || {})
|
|
120
120
|
const opnames = Object.keys(ent.op || {})
|
|
121
121
|
const ops = ent.op || {}
|
|
122
122
|
const points = each(ops).map((op: any) =>
|
|
123
123
|
op.points ? each(op.points) : []
|
|
124
124
|
).flat()
|
|
125
|
-
const path = points.length > 0 ? (points[0] as any).
|
|
125
|
+
const path = points.length > 0 ? (points[0] as any).o || '' : ''
|
|
126
126
|
|
|
127
127
|
Content(`#### ${ent.Name}
|
|
128
128
|
|
|
@@ -130,7 +130,7 @@ On error, \`ok\` is \`false\` and \`$err\` contains the error value.
|
|
|
130
130
|
| --- | --- |
|
|
131
131
|
`)
|
|
132
132
|
each(fields, (field: any) => {
|
|
133
|
-
Content(`| \`${field.
|
|
133
|
+
Content(`| \`${field.n}\` | ${field.sh || ''} |
|
|
134
134
|
`)
|
|
135
135
|
})
|
|
136
136
|
|
|
@@ -64,13 +64,13 @@ $client = ${ctor};
|
|
|
64
64
|
// Model-driven display field: the entity's first non-id string field
|
|
65
65
|
// (falling back to any non-id field), so the list example prints a real
|
|
66
66
|
// column instead of a hardcoded "name" the entity may not have.
|
|
67
|
-
const fields = exampleEntity.fields ||
|
|
67
|
+
const fields: any[] = Object.values(exampleEntity.fields || {})
|
|
68
68
|
const displayField =
|
|
69
|
-
fields.find((f: any) => f && f.
|
|
70
|
-
fields.find((f: any) => f && f.
|
|
69
|
+
fields.find((f: any) => f && f.n !== 'id' && f.t === '$STRING') ||
|
|
70
|
+
fields.find((f: any) => f && f.n !== 'id') ||
|
|
71
71
|
null
|
|
72
72
|
const idCol = dataIdF ? `$item[${JSON.stringify(dataIdF)}]` : null
|
|
73
|
-
const dispCol = displayField ? `$item[${JSON.stringify(displayField.
|
|
73
|
+
const dispCol = displayField ? `$item[${JSON.stringify(displayField.n)}]` : null
|
|
74
74
|
const itemPrint = [idCol, dispCol].filter(Boolean).join(' . " " . ') || 'json_encode($item)'
|
|
75
75
|
|
|
76
76
|
if (opnames.includes('list')) {
|
|
@@ -168,7 +168,7 @@ Prepare a fetch definition without sending the request. Returns the
|
|
|
168
168
|
// Entity reference sections
|
|
169
169
|
publishedEntities.map((ent: any) => {
|
|
170
170
|
const opnames = Object.keys(ent.op || {})
|
|
171
|
-
const fields = ent.fields ||
|
|
171
|
+
const fields = Object.values(ent.fields || {})
|
|
172
172
|
// Model-driven id key: null when this entity has no id-like field, in
|
|
173
173
|
// which case load/remove match on no argument and update omits the id.
|
|
174
174
|
const idF = entityIdField(ent)
|
|
@@ -200,9 +200,9 @@ $${ent.name} = $client->${phpEntityAccessor(ent.Name)}();
|
|
|
200
200
|
| --- | --- | --- | --- |
|
|
201
201
|
`)
|
|
202
202
|
each(fields, (field: any) => {
|
|
203
|
-
const req = field.
|
|
204
|
-
const desc = field.
|
|
205
|
-
Content(`| \`${field.
|
|
203
|
+
const req = field.r ? 'Yes' : 'No'
|
|
204
|
+
const desc = field.sh || ''
|
|
205
|
+
Content(`| \`${field.n}\` | \`${canonToType(field.t, target.name)}\` | ${req} | ${desc} |
|
|
206
206
|
`)
|
|
207
207
|
})
|
|
208
208
|
|
|
@@ -229,7 +229,7 @@ $${ent.name} = $client->${phpEntityAccessor(ent.Name)}();
|
|
|
229
229
|
if (fop.active === false) return '-'
|
|
230
230
|
return 'Yes'
|
|
231
231
|
})
|
|
232
|
-
Content(`| \`${field.
|
|
232
|
+
Content(`| \`${field.n}\` | ${cols.join(' | ')} |
|
|
233
233
|
`)
|
|
234
234
|
})
|
|
235
235
|
|
|
@@ -29,7 +29,7 @@ declare(strict_types=1);
|
|
|
29
29
|
// ${model.const.Name} ${target.Name} SDK: generated schemas. Do not edit.
|
|
30
30
|
//
|
|
31
31
|
// Generated from the model: \`main.kit.optspec\` and each feature's
|
|
32
|
-
// \`config.options\` for OPTSPEC; entity \`fields
|
|
32
|
+
// \`config.options\` for OPTSPEC; entity \`fields{}.type\` for ENTITYSPEC.
|
|
33
33
|
|
|
34
34
|
class ${model.const.Name}Schema
|
|
35
35
|
{
|
|
@@ -33,10 +33,10 @@ function normalizePathParams(
|
|
|
33
33
|
// original name was renamed to another param's current name (e.g. badge
|
|
34
34
|
// load: param 'group_id' has orig 'id', and another param has name 'id').
|
|
35
35
|
const param = params.find((p: any) =>
|
|
36
|
-
p.
|
|
36
|
+
p.n === snaked || p.n === depluralized) ||
|
|
37
37
|
params.find((p: any) =>
|
|
38
|
-
p.
|
|
39
|
-
if (param) return '{' + param.
|
|
38
|
+
p.or === snaked || p.or === depluralized)
|
|
39
|
+
if (param) return '{' + param.n + '}'
|
|
40
40
|
|
|
41
41
|
if (rename) {
|
|
42
42
|
for (const [origCamel, renamedTo] of Object.entries(rename)) {
|
|
@@ -44,10 +44,10 @@ function normalizePathParams(
|
|
|
44
44
|
const origSnaked = snakify(origCamel)
|
|
45
45
|
const origDepluralized = depluralize(origSnaked)
|
|
46
46
|
const renamedParam = params.find(
|
|
47
|
-
(p: any) => p.
|
|
48
|
-
p.
|
|
47
|
+
(p: any) => p.or === origSnaked || p.n === origSnaked ||
|
|
48
|
+
p.or === origDepluralized || p.n === origDepluralized
|
|
49
49
|
)
|
|
50
|
-
if (renamedParam) return '{' + renamedParam.
|
|
50
|
+
if (renamedParam) return '{' + renamedParam.n + '}'
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -100,8 +100,8 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
100
100
|
const listOp = entity.op?.list
|
|
101
101
|
|
|
102
102
|
const loadPoint = loadOp?.points?.[0]
|
|
103
|
-
const loadPath = loadPoint ? normalizePathParams(pointParts(loadPoint), loadPoint?.
|
|
104
|
-
const allLoadParams = loadPoint?.
|
|
103
|
+
const loadPath = loadPoint ? normalizePathParams(pointParts(loadPoint), loadPoint?.g?.params || [], loadPoint?.r?.param) : ''
|
|
104
|
+
const allLoadParams = loadPoint?.g?.params || []
|
|
105
105
|
// Some upstream OpenAPI specs declare a parameter as `in: path` even when
|
|
106
106
|
// that path has no `{name}` placeholder for it. Only path params that
|
|
107
107
|
// actually appear in the URL template should drive direct-test path-param
|
|
@@ -113,7 +113,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
113
113
|
_pathPlaceholders.add(part.slice(1, -1))
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
const _renameMap = (loadPoint?.
|
|
116
|
+
const _renameMap = (loadPoint?.r?.param || {}) as Record<string, string>
|
|
117
117
|
const _renamedPlaceholders = new Set<string>()
|
|
118
118
|
for (const ph of _pathPlaceholders) {
|
|
119
119
|
_renamedPlaceholders.add(ph)
|
|
@@ -122,25 +122,25 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
const loadParams = allLoadParams.filter((p: any) =>
|
|
125
|
-
_renamedPlaceholders.has(p.
|
|
125
|
+
_renamedPlaceholders.has(p.n) || _renamedPlaceholders.has(p.or))
|
|
126
126
|
|
|
127
127
|
const listPoint = listOp?.points?.[0]
|
|
128
|
-
const listPath = listPoint ? normalizePathParams(pointParts(listPoint), listPoint?.
|
|
129
|
-
const listParams = listPoint?.
|
|
128
|
+
const listPath = listPoint ? normalizePathParams(pointParts(listPoint), listPoint?.g?.params || [], listPoint?.r?.param) : ''
|
|
129
|
+
const listParams = listPoint?.g?.params || []
|
|
130
130
|
|
|
131
131
|
// Required query params with spec-provided examples — needed in live mode.
|
|
132
|
-
const loadQuery = loadPoint?.
|
|
132
|
+
const loadQuery = loadPoint?.g?.query || []
|
|
133
133
|
const loadLiveQueryEntries = loadQuery
|
|
134
|
-
.filter((q: any) => q.
|
|
134
|
+
.filter((q: any) => q.r && undefined !== q.ex && null !== q.ex)
|
|
135
135
|
const loadLiveQueryLines = loadLiveQueryEntries
|
|
136
|
-
.map((q: any) => ` $query["${q.
|
|
136
|
+
.map((q: any) => ` $query["${q.n}"] = ${JSON.stringify(q.ex)};`)
|
|
137
137
|
.join('\n')
|
|
138
138
|
|
|
139
139
|
const loadAllHaveExamples =
|
|
140
140
|
loadParams.length > 0 &&
|
|
141
|
-
loadParams.every((p: any) => undefined !== p.
|
|
141
|
+
loadParams.every((p: any) => undefined !== p.ex && null !== p.ex)
|
|
142
142
|
const loadExampleLines = loadAllHaveExamples
|
|
143
|
-
? loadParams.map((p: any) => ` $params["${p.
|
|
143
|
+
? loadParams.map((p: any) => ` $params["${p.n}"] = ${JSON.stringify(p.ex)};`).join('\n')
|
|
144
144
|
: ''
|
|
145
145
|
|
|
146
146
|
const entidEnvVar = `${PROJECTNAME}_TEST_${envToken(entity.name)}_ENTID`
|
|
@@ -163,9 +163,9 @@ class ${entity.Name}DirectTest extends TestCase
|
|
|
163
163
|
|
|
164
164
|
if (hasList && listPoint) {
|
|
165
165
|
const listLiveIdKeys: string[] = listParams.map((lp: any) => {
|
|
166
|
-
return lp.
|
|
166
|
+
return lp.n === 'id'
|
|
167
167
|
? entity.name + '01'
|
|
168
|
-
: lp.
|
|
168
|
+
: lp.n.replace(/_id$/, '') + '01'
|
|
169
169
|
})
|
|
170
170
|
const listSkipBlock = listLiveIdKeys.length > 0
|
|
171
171
|
? ` if ($setup["live"]) {
|
|
@@ -197,13 +197,13 @@ ${listSkipBlock} $client = $setup["client"];
|
|
|
197
197
|
Content(` $params = [];
|
|
198
198
|
`)
|
|
199
199
|
for (const lp of listParams) {
|
|
200
|
-
const key = lp.
|
|
200
|
+
const key = lp.n === 'id'
|
|
201
201
|
? entity.name + '01'
|
|
202
|
-
: lp.
|
|
202
|
+
: lp.n.replace(/_id$/, '') + '01'
|
|
203
203
|
Content(` if ($setup["live"]) {
|
|
204
|
-
$params["${lp.
|
|
204
|
+
$params["${lp.n}"] = $setup["idmap"]["${key}"];
|
|
205
205
|
} else {
|
|
206
|
-
$params["${lp.
|
|
206
|
+
$params["${lp.n}"] = "direct01";
|
|
207
207
|
}
|
|
208
208
|
`)
|
|
209
209
|
}
|
|
@@ -289,7 +289,7 @@ ${loadSkipBlock} $client = $setup["client"];
|
|
|
289
289
|
Content(` } else {
|
|
290
290
|
`)
|
|
291
291
|
for (let i = 0; i < loadParams.length; i++) {
|
|
292
|
-
Content(` $params["${loadParams[i].
|
|
292
|
+
Content(` $params["${loadParams[i].n}"] = "direct0${i + 1}";
|
|
293
293
|
`)
|
|
294
294
|
}
|
|
295
295
|
Content(` }
|
|
@@ -304,7 +304,7 @@ ${loadLiveQueryLines}
|
|
|
304
304
|
Content(` if (!$setup["live"]) {
|
|
305
305
|
`)
|
|
306
306
|
for (let i = 0; i < loadParams.length; i++) {
|
|
307
|
-
Content(` $params["${loadParams[i].
|
|
307
|
+
Content(` $params["${loadParams[i].n}"] = "direct0${i + 1}";
|
|
308
308
|
`)
|
|
309
309
|
}
|
|
310
310
|
Content(` }
|