@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
|
@@ -164,34 +164,34 @@ function generateDirectLoad(model: Model, entity: ModelEntity) {
|
|
|
164
164
|
return
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
const loadParams = loadPoint.
|
|
168
|
-
const loadPath = normalizePathParams(pointParts(loadPoint), loadParams, loadPoint.
|
|
167
|
+
const loadParams = loadPoint.g?.params || []
|
|
168
|
+
const loadPath = normalizePathParams(pointParts(loadPoint), loadParams, loadPoint.r?.param)
|
|
169
169
|
|
|
170
170
|
// Get list info for live mode bootstrapping
|
|
171
171
|
const listOp = entity.op?.list
|
|
172
172
|
const listPoint = listOp?.points?.[0]
|
|
173
|
-
const listParams = listPoint?.
|
|
174
|
-
const listPath = listPoint ? normalizePathParams(pointParts(listPoint), listParams, listPoint.
|
|
173
|
+
const listParams = listPoint?.g?.params || []
|
|
174
|
+
const listPath = listPoint ? normalizePathParams(pointParts(listPoint), listParams, listPoint.r?.param) : ''
|
|
175
175
|
const hasList = null != listPoint
|
|
176
176
|
|
|
177
177
|
// Ancestor params (not 'id') for live mode
|
|
178
|
-
const ancestorParams = loadParams.filter((p: any) => p.
|
|
178
|
+
const ancestorParams = loadParams.filter((p: any) => p.n !== 'id')
|
|
179
179
|
|
|
180
180
|
const paramAsserts = loadParams.map((p: any, i: number) =>
|
|
181
181
|
' assert(calls[0].url.includes(\'direct0' + (i + 1) + '\'))\n').join('')
|
|
182
182
|
|
|
183
183
|
// Build live list params
|
|
184
184
|
const liveListParams = listParams.map((p: any) => {
|
|
185
|
-
const key = p.
|
|
185
|
+
const key = p.n === 'id'
|
|
186
186
|
? entity.name + '01'
|
|
187
|
-
: p.
|
|
188
|
-
return { name: p.
|
|
187
|
+
: p.n.replace(/_id$/, '') + '01'
|
|
188
|
+
return { name: p.n, key }
|
|
189
189
|
})
|
|
190
190
|
|
|
191
191
|
// Build live ancestor params for load
|
|
192
192
|
const liveAncestorParams = ancestorParams.map((p: any) => {
|
|
193
|
-
const key = p.
|
|
194
|
-
return { name: p.
|
|
193
|
+
const key = p.n.replace(/_id$/, '') + '01'
|
|
194
|
+
return { name: p.n, key }
|
|
195
195
|
})
|
|
196
196
|
|
|
197
197
|
let liveParamsBlock = ''
|
|
@@ -217,11 +217,11 @@ ${listParamLines}
|
|
|
217
217
|
params.id = listData[0].id
|
|
218
218
|
${ancestorParamLines}
|
|
219
219
|
} else {
|
|
220
|
-
${loadParams.map((p: any, i: number) => ` ${jsProp('params', p.
|
|
220
|
+
${loadParams.map((p: any, i: number) => ` ${jsProp('params', p.n)} = 'direct0${i + 1}'`).join('\n')}
|
|
221
221
|
}`
|
|
222
222
|
} else {
|
|
223
223
|
liveParamsBlock = ` if (!setup.live) {
|
|
224
|
-
${loadParams.map((p: any, i: number) => ` ${jsProp('params', p.
|
|
224
|
+
${loadParams.map((p: any, i: number) => ` ${jsProp('params', p.n)} = 'direct0${i + 1}'`).join('\n')}
|
|
225
225
|
}`
|
|
226
226
|
}
|
|
227
227
|
|
|
@@ -267,15 +267,15 @@ function generateDirectList(model: Model, entity: ModelEntity) {
|
|
|
267
267
|
return
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
const listParams = listPoint.
|
|
271
|
-
const listPath = normalizePathParams(pointParts(listPoint), listParams, listPoint.
|
|
270
|
+
const listParams = listPoint.g?.params || []
|
|
271
|
+
const listPath = normalizePathParams(pointParts(listPoint), listParams, listPoint.r?.param)
|
|
272
272
|
|
|
273
273
|
// Build live params
|
|
274
274
|
const liveParams = listParams.map((p: any) => {
|
|
275
|
-
const key = p.
|
|
275
|
+
const key = p.n === 'id'
|
|
276
276
|
? entity.name + '01'
|
|
277
|
-
: p.
|
|
278
|
-
return { name: p.
|
|
277
|
+
: p.n.replace(/_id$/, '') + '01'
|
|
278
|
+
return { name: p.n, key }
|
|
279
279
|
})
|
|
280
280
|
|
|
281
281
|
const paramAsserts = listParams.map((p: any, i: number) =>
|
|
@@ -286,7 +286,7 @@ function generateDirectList(model: Model, entity: ModelEntity) {
|
|
|
286
286
|
const liveLines = liveParams.map((lp: any) =>
|
|
287
287
|
` ${jsProp('params', lp.name)} = setup.idmap['${lp.key}']`).join('\n')
|
|
288
288
|
const mockLines = listParams.map((p: any, i: number) =>
|
|
289
|
-
` ${jsProp('params', p.
|
|
289
|
+
` ${jsProp('params', p.n)} = 'direct0${i + 1}'`).join('\n')
|
|
290
290
|
|
|
291
291
|
paramsBlock = ` const params = {}
|
|
292
292
|
if (setup.live) {
|
|
@@ -328,15 +328,15 @@ ${paramAsserts} }
|
|
|
328
328
|
|
|
329
329
|
|
|
330
330
|
// GraphQL-backed op needs POST+body, not a REST-shaped GET+params direct()
|
|
331
|
-
// call — reuse apidef's own point.
|
|
331
|
+
// call — reuse apidef's own point.gq.doc via the SDK's graphql() hatch.
|
|
332
332
|
// Mirrors TestDirect_ts.ts's generateDirectGraphql.
|
|
333
333
|
function generateDirectGraphqlJs(
|
|
334
334
|
opname: 'load' | 'list',
|
|
335
335
|
entity: ModelEntity,
|
|
336
336
|
point: any,
|
|
337
337
|
) {
|
|
338
|
-
const doc: string = point.
|
|
339
|
-
const vars: any[] = point.
|
|
338
|
+
const doc: string = point.gq.doc
|
|
339
|
+
const vars: any[] = point.gq.vars || []
|
|
340
340
|
|
|
341
341
|
const mockVarLines = vars.map((v: any, i: number) =>
|
|
342
342
|
` variables[${JSON.stringify(v.name)}] = 'direct0${i + 1}'`).join('\n')
|
|
@@ -396,10 +396,10 @@ function normalizePathParams(
|
|
|
396
396
|
// original name was renamed to another param's current name (e.g. badge
|
|
397
397
|
// load: param 'group_id' has orig 'id', and another param has name 'id').
|
|
398
398
|
const param = params.find((p: any) =>
|
|
399
|
-
p.
|
|
399
|
+
p.n === snaked || p.n === depluralized) ||
|
|
400
400
|
params.find((p: any) =>
|
|
401
|
-
p.
|
|
402
|
-
if (param) return '{' + param.
|
|
401
|
+
p.or === snaked || p.or === depluralized)
|
|
402
|
+
if (param) return '{' + param.n + '}'
|
|
403
403
|
|
|
404
404
|
// Reverse-lookup through rename mapping: if rawName is a renamed value
|
|
405
405
|
// (e.g. "id"), find the original camelCase key (e.g. "closureId"),
|
|
@@ -410,10 +410,10 @@ function normalizePathParams(
|
|
|
410
410
|
const origSnaked = snakify(origCamel)
|
|
411
411
|
const origDepluralized = depluralize(origSnaked)
|
|
412
412
|
const renamedParam = params.find(
|
|
413
|
-
(p: any) => p.
|
|
414
|
-
p.
|
|
413
|
+
(p: any) => p.or === origSnaked || p.n === origSnaked ||
|
|
414
|
+
p.or === origDepluralized || p.n === origDepluralized
|
|
415
415
|
)
|
|
416
|
-
if (renamedParam) return '{' + renamedParam.
|
|
416
|
+
if (renamedParam) return '{' + renamedParam.n + '}'
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
419
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { pointFacts } from '@voxgig/sdkgen'
|
|
2
|
+
import { buildIdNames } from '@voxgig/sdkgen'
|
|
3
|
+
import { flowSteps } from '@voxgig/sdkgen'
|
|
1
4
|
|
|
2
5
|
import * as Path from 'node:path'
|
|
3
6
|
|
|
@@ -103,6 +106,8 @@ const TestEntity = cmp(function TestEntity(props: any) {
|
|
|
103
106
|
const basicflow = getModelPath(model, `main.${KIT}.flow.Basic${nom(entity, 'Name')}Flow`)
|
|
104
107
|
|
|
105
108
|
const dobasic = basicflow && true === basicflow.active
|
|
109
|
+
const liveFacts = Object.fromEntries(Object.values(entity.op || {}).flatMap((op: any) =>
|
|
110
|
+
(op.points || []).map((point: any) => [point.m + ' ' + point.o, pointFacts(ctx$, point)])))
|
|
106
111
|
|
|
107
112
|
if (!dobasic) {
|
|
108
113
|
return;
|
|
@@ -110,15 +115,7 @@ const TestEntity = cmp(function TestEntity(props: any) {
|
|
|
110
115
|
|
|
111
116
|
const indent = 2
|
|
112
117
|
|
|
113
|
-
const idlist =
|
|
114
|
-
entity.name + '01',
|
|
115
|
-
entity.name + '02',
|
|
116
|
-
entity.name + '03',
|
|
117
|
-
flatten(items(entity.relations.ancestors, (ap: any) =>
|
|
118
|
-
items(ap[1], (a: any) =>
|
|
119
|
-
items(['01', '02', '03'], (n: any) =>
|
|
120
|
-
a[1] + n[1]))), 2)
|
|
121
|
-
])
|
|
118
|
+
const idlist = buildIdNames(entity, basicflow)
|
|
122
119
|
|
|
123
120
|
Slot({ name: 'basicSetup' }, () => {
|
|
124
121
|
Content(`
|
|
@@ -204,15 +201,15 @@ function basicSetup(extra) {
|
|
|
204
201
|
|
|
205
202
|
|
|
206
203
|
Slot({ name: 'basic' }, () => {
|
|
207
|
-
const flowHasCreate = Object.values(basicflow
|
|
208
|
-
(s: any) => s.
|
|
204
|
+
const flowHasCreate = Object.values(flowSteps(basicflow)).some(
|
|
205
|
+
(s: any) => s.o === 'create'
|
|
209
206
|
)
|
|
210
207
|
|
|
211
208
|
Content(`
|
|
212
209
|
${hasLiveScenarios(model) ? `if (process.env.${PROJENVNAME}_TEST_LIVE === 'TRUE') { t.skip('Covered by live operation scenarios'); return }` : ''}
|
|
213
210
|
const setup = basicSetup()
|
|
214
211
|
if (setup.live) {
|
|
215
|
-
return runLiveEntity(setup, ${JSON.stringify(entity)}, ${JSON.stringify(basicflow)}, '${nom(entity, 'Name')}')
|
|
212
|
+
return runLiveEntity(setup, ${JSON.stringify(entity)}, ${JSON.stringify(basicflow)}, '${nom(entity, 'Name')}', ${JSON.stringify(liveFacts)})
|
|
216
213
|
}
|
|
217
214
|
const client = setup.client
|
|
218
215
|
const struct = setup.struct
|
|
@@ -234,8 +231,8 @@ function basicSetup(extra) {
|
|
|
234
231
|
const genCtx: GenCtx = {
|
|
235
232
|
model, entity, flow: basicflow, PROJUPPER: PROJENVNAME,
|
|
236
233
|
}
|
|
237
|
-
each(basicflow
|
|
238
|
-
const opgen = GENERATE_OP[step.
|
|
234
|
+
each(flowSteps(basicflow), (step: ModelEntityFlowStep, index: number) => {
|
|
235
|
+
const opgen = GENERATE_OP[step.o]
|
|
239
236
|
if (null != opgen) {
|
|
240
237
|
opgen(genCtx, step, index)
|
|
241
238
|
Content('\n')
|
|
@@ -250,18 +247,18 @@ function basicSetup(extra) {
|
|
|
250
247
|
|
|
251
248
|
const generateCreate: OpGen = (ctx, step, index) => {
|
|
252
249
|
const { entity, flow } = ctx
|
|
253
|
-
const ref = step.
|
|
254
|
-
const entvar = step.
|
|
255
|
-
const datavar = step.
|
|
250
|
+
const ref = step.i.ref ?? entity.name + '_ref01'
|
|
251
|
+
const entvar = step.i.entvar ?? ref + '_ent'
|
|
252
|
+
const datavar = step.i.datavar ?? (ref + '_data' + (step.i.suffix ?? ''))
|
|
256
253
|
|
|
257
|
-
const priorSteps = flow.
|
|
254
|
+
const priorSteps = flowSteps(flow).slice(0, Number(index))
|
|
258
255
|
const needsEnt = !priorSteps.some(s =>
|
|
259
|
-
['create', 'list', 'load', 'update', 'remove'].includes(s.
|
|
256
|
+
['create', 'list', 'load', 'update', 'remove'].includes(s.o))
|
|
260
257
|
|
|
261
258
|
const hasDatvar = priorSteps.some(s => {
|
|
262
|
-
if ('create' === s.
|
|
263
|
-
const priorRef = s.
|
|
264
|
-
const priorDatvar = s.
|
|
259
|
+
if ('create' === s.o) {
|
|
260
|
+
const priorRef = s.i.ref ?? entity.name + '_ref01'
|
|
261
|
+
const priorDatvar = s.i.datavar ?? (priorRef + '_data' + (s.i.suffix ?? ''))
|
|
265
262
|
return priorDatvar === datavar
|
|
266
263
|
}
|
|
267
264
|
return false
|
|
@@ -282,7 +279,7 @@ const generateCreate: OpGen = (ctx, step, index) => {
|
|
|
282
279
|
`)
|
|
283
280
|
}
|
|
284
281
|
|
|
285
|
-
each(step.
|
|
282
|
+
each(step.m, (mi: any) => {
|
|
286
283
|
Content(` ${datavar}['${mi.key$}'] = setup.idmap['${mi.val$}']
|
|
287
284
|
`)
|
|
288
285
|
})
|
|
@@ -306,14 +303,14 @@ const generateCreate: OpGen = (ctx, step, index) => {
|
|
|
306
303
|
const generateList: OpGen = (ctx, step, index) => {
|
|
307
304
|
const { entity, flow } = ctx
|
|
308
305
|
const hasDataId = null != entityDataIdField(entity)
|
|
309
|
-
const ref = step.
|
|
310
|
-
const entvar = step.
|
|
311
|
-
const matchvar = step.
|
|
312
|
-
const listvar = step.
|
|
306
|
+
const ref = step.i.ref ?? entity.name + '_ref01'
|
|
307
|
+
const entvar = step.i.entvar ?? ref + '_ent'
|
|
308
|
+
const matchvar = step.i.matchvar ?? (ref + '_match' + (step.i.suffix ?? ''))
|
|
309
|
+
const listvar = step.i.listvar ?? (ref + '_list' + (step.i.suffix ?? ''))
|
|
313
310
|
|
|
314
|
-
const priorSteps = flow.
|
|
311
|
+
const priorSteps = flowSteps(flow).slice(0, Number(index))
|
|
315
312
|
const needsEnt = !priorSteps.some(s =>
|
|
316
|
-
['create', 'list', 'load', 'update', 'remove'].includes(s.
|
|
313
|
+
['create', 'list', 'load', 'update', 'remove'].includes(s.o))
|
|
317
314
|
|
|
318
315
|
Content(`
|
|
319
316
|
// LIST
|
|
@@ -325,7 +322,7 @@ const generateList: OpGen = (ctx, step, index) => {
|
|
|
325
322
|
Content(` const ${matchvar} = {}
|
|
326
323
|
`)
|
|
327
324
|
|
|
328
|
-
each(step.
|
|
325
|
+
each(step.m, (mi: any) => {
|
|
329
326
|
Content(` ${matchvar}['${mi.key$}'] = setup.idmap['${mi.val$}']
|
|
330
327
|
`)
|
|
331
328
|
})
|
|
@@ -333,12 +330,12 @@ const generateList: OpGen = (ctx, step, index) => {
|
|
|
333
330
|
Content(`
|
|
334
331
|
const ${listvar} = (await ${entvar}.list(${matchvar})).map((e) => e.data())
|
|
335
332
|
`)
|
|
336
|
-
const allSteps = flow
|
|
337
|
-
for (let vI = 0; vI < step.
|
|
338
|
-
const validator = step.
|
|
333
|
+
const allSteps = flowSteps(flow)
|
|
334
|
+
for (let vI = 0; vI < step.v.length; vI++) {
|
|
335
|
+
const validator = step.v[vI]
|
|
339
336
|
const validRef = validator.def?.ref
|
|
340
|
-
const hasRefData = validRef && allSteps.some(s => 'create' === s.
|
|
341
|
-
((s.
|
|
337
|
+
const hasRefData = validRef && allSteps.some(s => 'create' === s.o &&
|
|
338
|
+
((s.i.ref ?? entity.name + '_ref01') === validRef))
|
|
342
339
|
|
|
343
340
|
if ('ItemExists' === validator.apply && hasRefData && hasDataId) {
|
|
344
341
|
Content(`
|
|
@@ -356,16 +353,16 @@ const generateList: OpGen = (ctx, step, index) => {
|
|
|
356
353
|
|
|
357
354
|
const generateUpdate: OpGen = (ctx, step, index) => {
|
|
358
355
|
const { entity, flow } = ctx
|
|
359
|
-
const ref = step.
|
|
360
|
-
const entvar = step.
|
|
361
|
-
const datavar = step.
|
|
362
|
-
const resdatavar = step.
|
|
363
|
-
const markdefvar = step.
|
|
364
|
-
const srcdatavar = step.
|
|
365
|
-
|
|
366
|
-
const priorSteps = flow.
|
|
356
|
+
const ref = step.i.ref ?? entity.name + '_ref01'
|
|
357
|
+
const entvar = step.i.entvar ?? ref + '_ent'
|
|
358
|
+
const datavar = step.i.datavar ?? (ref + '_data' + (step.i.suffix ?? ''))
|
|
359
|
+
const resdatavar = step.i.resdatavar ?? (ref + '_resdata' + (step.i.suffix ?? ''))
|
|
360
|
+
const markdefvar = step.i.markdefvar ?? (ref + '_markdef' + (step.i.suffix ?? ''))
|
|
361
|
+
const srcdatavar = step.i.srcdatavar ?? (ref + '_data' + (step.i.suffix ?? ''))
|
|
362
|
+
|
|
363
|
+
const priorSteps = flowSteps(flow).slice(0, Number(index))
|
|
367
364
|
const needsEnt = !priorSteps.some(s =>
|
|
368
|
-
['create', 'list', 'load', 'update', 'remove'].includes(s.
|
|
365
|
+
['create', 'list', 'load', 'update', 'remove'].includes(s.o))
|
|
369
366
|
|
|
370
367
|
const hasEntIdU = null != entity.id
|
|
371
368
|
|
|
@@ -383,7 +380,7 @@ const generateUpdate: OpGen = (ctx, step, index) => {
|
|
|
383
380
|
`)
|
|
384
381
|
}
|
|
385
382
|
|
|
386
|
-
each(step.
|
|
383
|
+
each(step.d, (mi: any) => {
|
|
387
384
|
if ('id' !== mi.key$) {
|
|
388
385
|
Content(` ${datavar} ['${mi.key$}'] = setup.idmap['${mi.key$}']
|
|
389
386
|
`)
|
|
@@ -391,10 +388,10 @@ const generateUpdate: OpGen = (ctx, step, index) => {
|
|
|
391
388
|
})
|
|
392
389
|
|
|
393
390
|
|
|
394
|
-
for (let sI = 0; sI < step.
|
|
395
|
-
const spec = step.
|
|
396
|
-
if ('TextFieldMark' === spec.apply && null != step.
|
|
397
|
-
const fieldname = step.
|
|
391
|
+
for (let sI = 0; sI < step.s.length; sI++) {
|
|
392
|
+
const spec = step.s[sI]
|
|
393
|
+
if ('TextFieldMark' === spec.apply && null != step.i.textfield) {
|
|
394
|
+
const fieldname = step.i.textfield
|
|
398
395
|
const fieldvalue = spec.def.mark
|
|
399
396
|
Content(`
|
|
400
397
|
const ${markdefvar} = { name: '${fieldname}', value: '${fieldvalue}_' + setup.now }
|
|
@@ -415,9 +412,9 @@ const generateUpdate: OpGen = (ctx, step, index) => {
|
|
|
415
412
|
`)
|
|
416
413
|
}
|
|
417
414
|
|
|
418
|
-
for (let sI = 0; sI < step.
|
|
419
|
-
const spec = step.
|
|
420
|
-
if ('TextFieldMark' === spec.apply && null != step.
|
|
415
|
+
for (let sI = 0; sI < step.s.length; sI++) {
|
|
416
|
+
const spec = step.s[sI]
|
|
417
|
+
if ('TextFieldMark' === spec.apply && null != step.i.textfield) {
|
|
421
418
|
Content(`
|
|
422
419
|
assert(${resdatavar}[${markdefvar}.name] === ${markdefvar}.value)
|
|
423
420
|
`)
|
|
@@ -429,25 +426,25 @@ const generateUpdate: OpGen = (ctx, step, index) => {
|
|
|
429
426
|
|
|
430
427
|
const generateLoad: OpGen = (ctx, step, index) => {
|
|
431
428
|
const { entity, flow } = ctx
|
|
432
|
-
const ref = step.
|
|
433
|
-
const entvar = step.
|
|
434
|
-
const matchvar = step.
|
|
435
|
-
const datavar = step.
|
|
436
|
-
const srcdatavar = step.
|
|
429
|
+
const ref = step.i.ref ?? entity.name + '_ref01'
|
|
430
|
+
const entvar = step.i.entvar ?? ref + '_ent'
|
|
431
|
+
const matchvar = step.i.matchvar ?? (ref + '_match' + (step.i.suffix ?? ''))
|
|
432
|
+
const datavar = step.i.datavar ?? (ref + '_data' + (step.i.suffix ?? ''))
|
|
433
|
+
const srcdatavar = step.i.srcdatavar ?? (ref + '_data' + (step.i.suffix ?? ''))
|
|
437
434
|
|
|
438
|
-
const priorSteps = flow.
|
|
435
|
+
const priorSteps = flowSteps(flow).slice(0, Number(index))
|
|
439
436
|
const hasEntVar = priorSteps.some(s =>
|
|
440
|
-
['create', 'list', 'load', 'update', 'remove'].includes(s.
|
|
437
|
+
['create', 'list', 'load', 'update', 'remove'].includes(s.o))
|
|
441
438
|
|
|
442
439
|
// Check if srcdatavar was declared by a prior create step or by the
|
|
443
440
|
// preamble bootstrap (which runs when the flow has no create step)
|
|
444
|
-
const flowHasCreate = flow.
|
|
441
|
+
const flowHasCreate = flowSteps(flow).some(s => s.o === 'create')
|
|
445
442
|
const preambleRef = entity.name + '_ref01'
|
|
446
443
|
const hasSrcData = (!flowHasCreate && srcdatavar === preambleRef + '_data') ||
|
|
447
444
|
priorSteps.some(s => {
|
|
448
|
-
if ('create' === s.
|
|
449
|
-
const priorRef = s.
|
|
450
|
-
const priorDatvar = s.
|
|
445
|
+
if ('create' === s.o) {
|
|
446
|
+
const priorRef = s.i.ref ?? entity.name + '_ref01'
|
|
447
|
+
const priorDatvar = s.i.datavar ?? (priorRef + '_data' + (s.i.suffix ?? ''))
|
|
451
448
|
return priorDatvar === srcdatavar
|
|
452
449
|
}
|
|
453
450
|
return false
|
|
@@ -487,14 +484,14 @@ const generateRemove: OpGen = (ctx, step, index) => {
|
|
|
487
484
|
if (null == entityDataIdField(entity)) {
|
|
488
485
|
return
|
|
489
486
|
}
|
|
490
|
-
const ref = step.
|
|
491
|
-
const entvar = step.
|
|
492
|
-
const matchvar = step.
|
|
493
|
-
const srcdatavar = step.
|
|
487
|
+
const ref = step.i.ref ?? entity.name + '_ref01'
|
|
488
|
+
const entvar = step.i.entvar ?? ref + '_ent'
|
|
489
|
+
const matchvar = step.i.matchvar ?? (ref + '_match' + (step.i.suffix ?? ''))
|
|
490
|
+
const srcdatavar = step.i.srcdatavar ?? (ref + '_data')
|
|
494
491
|
|
|
495
|
-
const priorSteps = flow.
|
|
492
|
+
const priorSteps = flowSteps(flow).slice(0, Number(index))
|
|
496
493
|
const needsEnt = !priorSteps.some(s =>
|
|
497
|
-
['create', 'list', 'load', 'update', 'remove'].includes(s.
|
|
494
|
+
['create', 'list', 'load', 'update', 'remove'].includes(s.o))
|
|
498
495
|
|
|
499
496
|
const hasEntIdR = null != entity.id
|
|
500
497
|
|
|
@@ -17,10 +17,10 @@ const TestLive = cmp(function TestLive(props: any) {
|
|
|
17
17
|
responses: all.responses,
|
|
18
18
|
}
|
|
19
19
|
if (model.main.kit.info?.auth === false) facts.security = []
|
|
20
|
-
const same = operation.points.filter((p: any) => JSON.stringify(p.
|
|
20
|
+
const same = operation.points.filter((p: any) => JSON.stringify(p.q || {}) === JSON.stringify(point.q || {}))
|
|
21
21
|
plan.push({ entity: entity.name, accessor: nom(entity, 'Name'), op,
|
|
22
|
-
id: point.
|
|
23
|
-
action: point.
|
|
22
|
+
id: point.co?.id || point.m + ' ' + point.o, contractVersion: 1, kind: point.k, graphql: point.gq, path: point.o, method: point.m,
|
|
23
|
+
action: point.q?.$action, rename: point.r, args: point.g, facts, reachable: same.length === 1 })
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -17,18 +17,18 @@ import {
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
// The declared canon-type sentinel of a named parameter of an op — looked up
|
|
20
|
-
// in the op's `points[].
|
|
20
|
+
// in the op's `points[].g.params[]` exactly as the typed-model generator
|
|
21
21
|
// does. Falls back to the entity field of the same name (used when the op
|
|
22
22
|
// has no params). Returns undefined when neither is present.
|
|
23
23
|
function paramCanonType(entity: any, op: any, paramName: string): unknown {
|
|
24
24
|
const params = op ? each(opParams(op)) : []
|
|
25
|
-
const found = (params as any[]).find((p: any) => p && p.
|
|
25
|
+
const found = (params as any[]).find((p: any) => p && p.n === paramName)
|
|
26
26
|
if (found) {
|
|
27
|
-
return found.
|
|
27
|
+
return found.t
|
|
28
28
|
}
|
|
29
29
|
const field = (entity && entity.fields ? each(entity.fields) : [])
|
|
30
|
-
.find((f: any) => f && f.
|
|
31
|
-
return field && field.
|
|
30
|
+
.find((f: any) => f && f.n === paramName) as any
|
|
31
|
+
return field && field.t
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
|
|
@@ -98,8 +98,8 @@ const EntityTypes = cmp(function EntityTypes(props: any) {
|
|
|
98
98
|
|
|
99
99
|
// Typed reference models for the ${model.const.Name} SDK.
|
|
100
100
|
//
|
|
101
|
-
// GENERATED from the API model: main.${KIT}.entity.<e>.fields
|
|
102
|
-
// params (op.<name>.points[].
|
|
101
|
+
// GENERATED from the API model: main.${KIT}.entity.<e>.fields{} and per-op
|
|
102
|
+
// params (op.<name>.points[].g.params[]). Field/param types come from the
|
|
103
103
|
// canonical type sentinels (source of truth: @voxgig/apidef VALID_CANON). Do
|
|
104
104
|
// not edit by hand.
|
|
105
105
|
//
|
|
@@ -117,10 +117,10 @@ object ${model.const.Name}Types {
|
|
|
117
117
|
entityList.forEach((ent: any) => {
|
|
118
118
|
const Name = ent.Name
|
|
119
119
|
const fields = (ent.fields ? each(ent.fields) : [])
|
|
120
|
-
.filter((f: any) => f.
|
|
120
|
+
.filter((f: any) => f.a !== false)
|
|
121
121
|
|
|
122
122
|
emitRecord(Name, fields.map((f: any) => ({
|
|
123
|
-
name: f.
|
|
123
|
+
name: f.n, type: f.t,
|
|
124
124
|
})), log)
|
|
125
125
|
|
|
126
126
|
const ops = ent.op || {}
|
|
@@ -54,7 +54,7 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
|
54
54
|
|
|
55
55
|
publishedEntities.map((entity: any) => {
|
|
56
56
|
const opnames = Object.keys(entity.op || {})
|
|
57
|
-
const fields = entity.fields ||
|
|
57
|
+
const fields = Object.values(entity.fields || {})
|
|
58
58
|
// Model-driven id key: null when this entity has no id-like field.
|
|
59
59
|
const idF = entityIdField(entity)
|
|
60
60
|
// Sanitise the local variable name — a camelCased Kotlin keyword gets a
|
|
@@ -103,8 +103,8 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
|
103
103
|
`)
|
|
104
104
|
|
|
105
105
|
each(fields, (field: any) => {
|
|
106
|
-
const desc = field.
|
|
107
|
-
Content(`| \`${field.
|
|
106
|
+
const desc = field.sh || ''
|
|
107
|
+
Content(`| \`${field.n}\` | \`${canonToType(field.t, target.name)}\` | ${desc} |
|
|
108
108
|
`)
|
|
109
109
|
})
|
|
110
110
|
|
|
@@ -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
|
|
|
@@ -170,7 +170,7 @@ Prepare a fetch definition without sending. Returns the \`fetchdef\` and raises
|
|
|
170
170
|
// Entity reference sections
|
|
171
171
|
publishedEntities.map((ent: any) => {
|
|
172
172
|
const opnames = Object.keys(ent.op || {})
|
|
173
|
-
const fields = ent.fields ||
|
|
173
|
+
const fields = Object.values(ent.fields || {})
|
|
174
174
|
// Model-driven id key: null when this entity has no id-like field.
|
|
175
175
|
const idF = entityIdField(ent)
|
|
176
176
|
// Sanitise the local variable name — kotlinVarName guards Kotlin keywords.
|
|
@@ -205,9 +205,9 @@ val ${eVar} = client.${accessor}(null)
|
|
|
205
205
|
| --- | --- | --- | --- |
|
|
206
206
|
`)
|
|
207
207
|
each(fields, (field: any) => {
|
|
208
|
-
const req = field.
|
|
209
|
-
const desc = field.
|
|
210
|
-
Content(`| \`${field.
|
|
208
|
+
const req = field.r ? 'Yes' : 'No'
|
|
209
|
+
const desc = field.sh || ''
|
|
210
|
+
Content(`| \`${field.n}\` | \`${canonToType(field.t, target.name)}\` | ${req} | ${desc} |
|
|
211
211
|
`)
|
|
212
212
|
})
|
|
213
213
|
|
|
@@ -232,7 +232,7 @@ val ${eVar} = client.${accessor}(null)
|
|
|
232
232
|
if (fop.active === false) return '-'
|
|
233
233
|
return 'Yes'
|
|
234
234
|
})
|
|
235
|
-
Content(`| \`${field.
|
|
235
|
+
Content(`| \`${field.n}\` | ${cols.join(' | ')} |
|
|
236
236
|
`)
|
|
237
237
|
})
|
|
238
238
|
|
|
@@ -40,7 +40,7 @@ import ${kotlinpackage}.utility.Json
|
|
|
40
40
|
* ${model.const.Name} ${target.Name} SDK: generated schemas. Do not edit.
|
|
41
41
|
*
|
|
42
42
|
* Generated from the model: \`main.kit.optspec\` and each feature's
|
|
43
|
-
* \`config.options\` for the option spec; entity \`fields
|
|
43
|
+
* \`config.options\` for the option spec; entity \`fields{}.type\` for the
|
|
44
44
|
* entity specs.
|
|
45
45
|
*/
|
|
46
46
|
@Suppress("UNCHECKED_CAST")
|