@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
package/src/helpers/opShape.ts
CHANGED
|
@@ -62,10 +62,10 @@ function opActions(op: any): { action: string, path: string }[] {
|
|
|
62
62
|
const points: any[] = op && op.points ? each(op.points) : []
|
|
63
63
|
|
|
64
64
|
return points
|
|
65
|
-
.filter((pt: any) => null != (pt && pt.
|
|
65
|
+
.filter((pt: any) => null != (pt && pt.q && pt.q['$action']))
|
|
66
66
|
.map((pt: any) => ({
|
|
67
|
-
action: String(pt.
|
|
68
|
-
path: String(pt.
|
|
67
|
+
action: String(pt.q['$action']),
|
|
68
|
+
path: String(pt.o || ''),
|
|
69
69
|
}))
|
|
70
70
|
.sort((a, b) => a.action < b.action ? -1 : a.action > b.action ? 1 : 0)
|
|
71
71
|
}
|
|
@@ -93,11 +93,11 @@ function entityPath(entity: any): string {
|
|
|
93
93
|
|
|
94
94
|
const points: any[] = op.points ? each(op.points) : []
|
|
95
95
|
const canonical = points.filter((pt: any) =>
|
|
96
|
-
null == (pt && pt.
|
|
96
|
+
null == (pt && pt.q && pt.q['$action']))
|
|
97
97
|
|
|
98
98
|
const pick = (0 < canonical.length ? canonical : points)[0]
|
|
99
|
-
if (null != pick && null != pick.
|
|
100
|
-
return String(pick.
|
|
99
|
+
if (null != pick && null != pick.o && '' !== pick.o) {
|
|
100
|
+
return String(pick.o)
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
|
|
@@ -109,7 +109,7 @@ function ownPoint(points: any[]): any {
|
|
|
109
109
|
let best = points[0]
|
|
110
110
|
|
|
111
111
|
for (const pt of points) {
|
|
112
|
-
if (null == pt || null == pt.
|
|
112
|
+
if (null == pt || null == pt.s || null == best || null == best.s) {
|
|
113
113
|
continue
|
|
114
114
|
}
|
|
115
115
|
|
|
@@ -140,7 +140,7 @@ function opParams(op: any): any[] {
|
|
|
140
140
|
let points: any[] = op && op.points ? each(op.points) : []
|
|
141
141
|
|
|
142
142
|
const canonical = points.filter((pt: any) =>
|
|
143
|
-
null == (pt && pt.
|
|
143
|
+
null == (pt && pt.q && pt.q['$action']))
|
|
144
144
|
if (0 < canonical.length) {
|
|
145
145
|
points = canonical
|
|
146
146
|
}
|
|
@@ -152,17 +152,17 @@ function opParams(op: any): any[] {
|
|
|
152
152
|
points.forEach((pt: any, pointIndex: number) => {
|
|
153
153
|
// Path AND query: a path-param-only read misses e.g. GET /result?trace_id=,
|
|
154
154
|
// which has no path param at all but still addresses one record.
|
|
155
|
-
const pathParams = pt && pt.
|
|
156
|
-
const queryParams = pt && pt.
|
|
155
|
+
const pathParams = pt && pt.g && pt.g.params ? each(pt.g.params) : []
|
|
156
|
+
const queryParams = pt && pt.g && pt.g.query ? each(pt.g.query) : []
|
|
157
157
|
const params = [...pathParams, ...queryParams]
|
|
158
158
|
const requiredHere: Record<string, boolean> = {}
|
|
159
159
|
params.forEach((p: any) => {
|
|
160
|
-
if (p && null != p.
|
|
161
|
-
requiredHere[p.
|
|
162
|
-
if (!seen[p.
|
|
163
|
-
seen[p.
|
|
164
|
-
requiredOnAll[p.
|
|
165
|
-
out.push(seen[p.
|
|
160
|
+
if (p && null != p.n) {
|
|
161
|
+
requiredHere[p.n] = false !== p.r
|
|
162
|
+
if (!seen[p.n]) {
|
|
163
|
+
seen[p.n] = { ...p }
|
|
164
|
+
requiredOnAll[p.n] = 0 === pointIndex
|
|
165
|
+
out.push(seen[p.n])
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
})
|
|
@@ -174,10 +174,10 @@ function opParams(op: any): any[] {
|
|
|
174
174
|
})
|
|
175
175
|
|
|
176
176
|
out.forEach((p: any) => {
|
|
177
|
-
p.
|
|
177
|
+
p.r = true === requiredOnAll[p.n]
|
|
178
178
|
})
|
|
179
179
|
|
|
180
|
-
if (1 < points.length && !out.some((p: any) => p.
|
|
180
|
+
if (1 < points.length && !out.some((p: any) => p.r) && !samePath(points)) {
|
|
181
181
|
return opParams({ points: [ownPoint(points)] })
|
|
182
182
|
}
|
|
183
183
|
|
|
@@ -194,12 +194,12 @@ function fieldInOp(field: any, opname: string): boolean {
|
|
|
194
194
|
function fieldOptional(field: any, opname: string): boolean {
|
|
195
195
|
switch (opname) {
|
|
196
196
|
case 'create':
|
|
197
|
-
return false === field.
|
|
197
|
+
return false === field.r
|
|
198
198
|
case 'update':
|
|
199
199
|
return true
|
|
200
200
|
case 'load':
|
|
201
201
|
case 'remove':
|
|
202
|
-
return 'id' !== field.
|
|
202
|
+
return 'id' !== field.n
|
|
203
203
|
case 'list':
|
|
204
204
|
default:
|
|
205
205
|
return true
|
|
@@ -223,30 +223,30 @@ function opRequestShape(ent: any, opname: string):
|
|
|
223
223
|
const params = opParams(op)
|
|
224
224
|
if (0 < params.length && !isbodyop) {
|
|
225
225
|
const items = params.map((p: any) => ({
|
|
226
|
-
name: p.
|
|
227
|
-
type: p.
|
|
228
|
-
optional: false === p.
|
|
226
|
+
name: p.n,
|
|
227
|
+
type: p.t,
|
|
228
|
+
optional: false === p.r,
|
|
229
229
|
}))
|
|
230
230
|
return { items, fromParams: true }
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
const paramItems = isbodyop ? params.map((p: any) => ({
|
|
234
|
-
name: p.
|
|
235
|
-
type: p.
|
|
236
|
-
optional: false === p.
|
|
234
|
+
name: p.n,
|
|
235
|
+
type: p.t,
|
|
236
|
+
optional: false === p.r,
|
|
237
237
|
})) : []
|
|
238
238
|
const paramNames = new Set(paramItems.map((p: any) => p.name))
|
|
239
239
|
|
|
240
240
|
const fields = (ent.fields ? each(ent.fields) : [])
|
|
241
|
-
.filter((f: any) => f.
|
|
241
|
+
.filter((f: any) => f.a !== false)
|
|
242
242
|
.filter((f: any) => fieldInOp(f, opname))
|
|
243
243
|
|
|
244
244
|
const items = paramItems.concat(
|
|
245
245
|
fields
|
|
246
|
-
.filter((f: any) => !paramNames.has(f.
|
|
246
|
+
.filter((f: any) => !paramNames.has(f.n))
|
|
247
247
|
.map((f: any) => ({
|
|
248
|
-
name: f.
|
|
249
|
-
type: f.
|
|
248
|
+
name: f.n,
|
|
249
|
+
type: f.t,
|
|
250
250
|
optional: fieldOptional(f, opname),
|
|
251
251
|
})))
|
|
252
252
|
|
|
@@ -453,7 +453,7 @@ function medianOf(xs: number[]): number {
|
|
|
453
453
|
}
|
|
454
454
|
|
|
455
455
|
|
|
456
|
-
// The id field on the entity's DATA type (its fields
|
|
456
|
+
// The id field on the entity's DATA type (its fields{}), or null. DISTINCT from
|
|
457
457
|
// entityIdField (the load-MATCH key): an API can model a load match that carries
|
|
458
458
|
// an `id` param while the response entity itself has no `id` field, so `.id`
|
|
459
459
|
// access on a RETURNED record must be guarded on this, not on the match key.
|
|
@@ -463,10 +463,10 @@ function entityDataIdField(ent: any): string | null {
|
|
|
463
463
|
}
|
|
464
464
|
const idName = (ent.id && ent.id.field) || 'id'
|
|
465
465
|
const fields = ent.fields ? each(ent.fields) : []
|
|
466
|
-
if (fields.some((f: any) => f && f.
|
|
466
|
+
if (fields.some((f: any) => f && f.n === idName)) {
|
|
467
467
|
return idName
|
|
468
468
|
}
|
|
469
|
-
if (fields.some((f: any) => f && f.
|
|
469
|
+
if (fields.some((f: any) => f && f.n === 'id')) {
|
|
470
470
|
return 'id'
|
|
471
471
|
}
|
|
472
472
|
return null
|
package/src/helpers/pointPath.ts
CHANGED
|
@@ -12,18 +12,13 @@ type PathSegment = {
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
function pointSegments(point: any): PathSegment[] {
|
|
15
|
-
const segments = point && point.
|
|
15
|
+
const segments = point && point.s
|
|
16
16
|
|
|
17
|
-
if (!Array.isArray(segments) && Array.isArray(point
|
|
17
|
+
if (!Array.isArray(segments) && (Array.isArray(point?.parts) || Array.isArray(point?.segments))) {
|
|
18
18
|
throw new SdkGenError(
|
|
19
|
-
'model: the point for `' + (
|
|
20
|
-
'`
|
|
21
|
-
|
|
22
|
-
'replaced the braced-string form with the typed segment vector in ' +
|
|
23
|
-
'8.2.0 (its ADR-003), so this model was generated by an older apidef ' +
|
|
24
|
-
'and has not been regenerated. Generating from it would build every ' +
|
|
25
|
-
'URL as the API root. Run `npm run generate` in the project\'s `.sdk` ' +
|
|
26
|
-
'so apidef rewrites its entity models, then generate again.')
|
|
19
|
+
'model: the point for `' + (point?.o || point?.orig || '(unknown path)') +
|
|
20
|
+
'` uses an obsolete path shape. Typed segments belong in `s`. ' +
|
|
21
|
+
'Run `npm run generate` in the project\'s `.sdk` to regenerate the API model.')
|
|
27
22
|
}
|
|
28
23
|
|
|
29
24
|
return Array.isArray(segments) ? segments : []
|
package/src/helpers/resolved.ts
CHANGED
|
@@ -13,13 +13,8 @@ function resolvedFor(ctx$: any): ResolvedSpec | undefined {
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
// A point's live-scenario hint. apidef sets `point.live` from the guide; a
|
|
17
|
-
// model built before it did carries the hint only inside the contract.
|
|
18
16
|
function liveHint(point: any): any {
|
|
19
|
-
|
|
20
|
-
if (undefined !== point.live) return point.live
|
|
21
|
-
if (null == point.contract?.json) return undefined
|
|
22
|
-
try { return JSON.parse(point.contract.json).live } catch { return undefined }
|
|
17
|
+
return point?.li
|
|
23
18
|
}
|
|
24
19
|
|
|
25
20
|
|
|
@@ -30,18 +25,12 @@ function hasLiveScenarios(model: any): boolean {
|
|
|
30
25
|
}
|
|
31
26
|
|
|
32
27
|
|
|
33
|
-
// A point's resolved specification facts. Prefers the capability apidef
|
|
34
|
-
// publishes; falls back to the contract for a model built before it, or a
|
|
35
|
-
// generation not driven through a model build.
|
|
36
28
|
function pointFacts(ctx$: any, point: any): any {
|
|
37
|
-
|
|
38
|
-
const facts = resolved?.operation(point?.method, point?.orig)
|
|
39
|
-
if (null != facts) return facts
|
|
40
|
-
if (null == point?.contract?.json) return {}
|
|
41
|
-
try { return JSON.parse(point.contract.json) } catch { return {} }
|
|
29
|
+
return resolvedFor(ctx$)?.operation(point?.m, point?.o) || {}
|
|
42
30
|
}
|
|
43
31
|
|
|
44
32
|
|
|
33
|
+
|
|
45
34
|
export {
|
|
46
35
|
resolvedFor,
|
|
47
36
|
liveHint,
|
package/src/sdkgen.ts
CHANGED
|
@@ -57,7 +57,7 @@ import { registerComponent } from './cmp/Registered'
|
|
|
57
57
|
import { resolvedFor, liveHint, pointFacts, hasLiveScenarios } from './helpers/resolved'
|
|
58
58
|
import type { RegisterOptions } from './cmp/Registered'
|
|
59
59
|
|
|
60
|
-
import { buildIdNames } from './helpers/buildIdNames'
|
|
60
|
+
import { buildIdNames, entityRelationName, flowSteps } from './helpers/buildIdNames'
|
|
61
61
|
import { getMatchEntries } from './helpers/getMatchEntries'
|
|
62
62
|
import { collectDeps } from './helpers/collectDeps'
|
|
63
63
|
import { guardModelNames } from './helpers/modelNames'
|
|
@@ -992,6 +992,8 @@ export {
|
|
|
992
992
|
SdkGenError,
|
|
993
993
|
|
|
994
994
|
buildIdNames,
|
|
995
|
+
entityRelationName,
|
|
996
|
+
flowSteps,
|
|
995
997
|
getMatchEntries,
|
|
996
998
|
collectDeps,
|
|
997
999
|
|
package/src/utility.ts
CHANGED
|
@@ -263,13 +263,19 @@ function withPointParts(op: any): any {
|
|
|
263
263
|
each(op, (o: any, opname: string) => {
|
|
264
264
|
out[opname] = null == o || null == o.points ? o : {
|
|
265
265
|
...o,
|
|
266
|
-
points: each(o.points).map((pt: any) => {
|
|
266
|
+
points: each(o.points).filter((pt: any) => false !== pt?.a).map((pt: any) => {
|
|
267
267
|
if (null == pt) return pt
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
268
|
+
const args = Object.fromEntries(Object.entries(pt.g || {}).map(([kind, values]) =>
|
|
269
|
+
[kind, each(values as any).filter((arg: any) => false !== arg.a).map((arg: any) => ({
|
|
270
|
+
name: arg.n, orig: arg.or, type: arg.t, kind: arg.k,
|
|
271
|
+
reqd: arg.r, example: arg.ex,
|
|
272
|
+
}))]))
|
|
273
|
+
// Runtime hooks expose descriptive names independently of the model schema.
|
|
274
|
+
return {
|
|
275
|
+
active: pt.a, kind: pt.k, method: pt.m, orig: pt.o,
|
|
276
|
+
segments: pt.s, parts: pointParts(pt), rename: pt.r,
|
|
277
|
+
transform: pt.t, args, select: pt.q, live: pt.li, graphql: pt.gq,
|
|
278
|
+
}
|
|
273
279
|
}),
|
|
274
280
|
}
|
|
275
281
|
})
|
|
@@ -298,7 +304,10 @@ function configDefinition(model: any, targetname?: string): { def: any, json: st
|
|
|
298
304
|
const entityStubs: any = {}
|
|
299
305
|
each(entity, (e: any) => {
|
|
300
306
|
entityDefs[e.name] = clean({
|
|
301
|
-
fields: e.fields
|
|
307
|
+
fields: each(e.fields || {}).filter((f: any) => false !== f.a).map((f: any) => ({
|
|
308
|
+
name: f.n, title: f.h, type: f.t, req: f.r, op: f.op,
|
|
309
|
+
short: f.sh, readOnly: f.ro, writeOnly: f.wo, deprecated: f.de, format: f.fo,
|
|
310
|
+
})),
|
|
302
311
|
id: e.id,
|
|
303
312
|
name: e.name,
|
|
304
313
|
op: withPointParts(e.op),
|