@voxgig/sdkgen 4.22.0 → 4.23.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 +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/feature/test.c +20 -4
- package/project/.sdk/tm/clojure/src/sdk/features.clj +6 -4
- package/project/.sdk/tm/cpp/feature/test.hpp +17 -6
- package/project/.sdk/tm/csharp/feature/TestFeature.cs +10 -4
- package/project/.sdk/tm/elixir/lib/projectname/feature/test.ex +11 -5
- package/project/.sdk/tm/java/feature/TestFeature.java +11 -6
- 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/feature/TestFeature.kt +8 -4
- package/project/.sdk/tm/ocaml/sdk_features.ml +6 -4
- package/project/.sdk/tm/perl/feature/test_feature.pm +6 -4
- package/project/.sdk/tm/rb/feature/test_feature.rb +6 -4
- package/project/.sdk/tm/rust/feature/test.rs +8 -4
- package/project/.sdk/tm/scala/feature/TestFeature.scala +10 -6
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/TestFeature.swift +10 -6
- 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/feature/test.zig +11 -4
- package/project/sdkgen-package.json +1 -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
|
@@ -32,10 +32,10 @@ function normalizePathParams(
|
|
|
32
32
|
const snaked = snakify(rawName)
|
|
33
33
|
const depluralized = depluralize(snaked)
|
|
34
34
|
const param = params.find((p: any) =>
|
|
35
|
-
p.
|
|
35
|
+
p.n === snaked || p.n === depluralized) ||
|
|
36
36
|
params.find((p: any) =>
|
|
37
|
-
p.
|
|
38
|
-
if (param) return '{' + param.
|
|
37
|
+
p.or === snaked || p.or === depluralized)
|
|
38
|
+
if (param) return '{' + param.n + '}'
|
|
39
39
|
|
|
40
40
|
if (rename) {
|
|
41
41
|
for (const [origCamel, renamedTo] of Object.entries(rename)) {
|
|
@@ -43,10 +43,10 @@ function normalizePathParams(
|
|
|
43
43
|
const origSnaked = snakify(origCamel)
|
|
44
44
|
const origDepluralized = depluralize(origSnaked)
|
|
45
45
|
const renamedParam = params.find(
|
|
46
|
-
(p: any) => p.
|
|
47
|
-
p.
|
|
46
|
+
(p: any) => p.or === origSnaked || p.n === origSnaked ||
|
|
47
|
+
p.or === origDepluralized || p.n === origDepluralized
|
|
48
48
|
)
|
|
49
|
-
if (renamedParam) return '{' + renamedParam.
|
|
49
|
+
if (renamedParam) return '{' + renamedParam.n + '}'
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -110,8 +110,8 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
110
110
|
|
|
111
111
|
// Get load point info
|
|
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
|
|
116
116
|
// direct-test path-param setup and URL-substitution asserts.
|
|
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,28 +129,28 @@ 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
|
// Get list point info
|
|
135
135
|
const listPoint = listOp?.points?.[0]
|
|
136
|
-
const listPath = listPoint ? normalizePathParams(pointParts(listPoint), listPoint?.
|
|
137
|
-
const listParams = listPoint?.
|
|
136
|
+
const listPath = listPoint ? normalizePathParams(pointParts(listPoint), listPoint?.g?.params || [], listPoint?.r?.param) : ''
|
|
137
|
+
const listParams = listPoint?.g?.params || []
|
|
138
138
|
|
|
139
139
|
// Required query params with spec-provided examples — needed in live mode.
|
|
140
|
-
const loadQuery = loadPoint?.
|
|
140
|
+
const loadQuery = loadPoint?.g?.query || []
|
|
141
141
|
const loadLiveQueryEntries = loadQuery
|
|
142
|
-
.filter((q: any) => q.
|
|
142
|
+
.filter((q: any) => q.r && undefined !== q.ex && null !== q.ex)
|
|
143
143
|
const loadLiveQueryLines = loadLiveQueryEntries
|
|
144
|
-
.map((q: any) => ` query.put("${q.
|
|
144
|
+
.map((q: any) => ` query.put("${q.n}", ${javaLiteral(q.ex)});`)
|
|
145
145
|
.join('\n')
|
|
146
146
|
|
|
147
147
|
// Path params with spec-provided examples — when ALL load params have
|
|
148
148
|
// spec examples, prefer them over list-bootstrap.
|
|
149
149
|
const loadAllHaveExamples =
|
|
150
150
|
loadParams.length > 0 &&
|
|
151
|
-
loadParams.every((p: any) => undefined !== p.
|
|
151
|
+
loadParams.every((p: any) => undefined !== p.ex && null !== p.ex)
|
|
152
152
|
const loadExampleLines = loadAllHaveExamples
|
|
153
|
-
? loadParams.map((p: any) => ` params.put("${p.
|
|
153
|
+
? loadParams.map((p: any) => ` params.put("${p.n}", ${javaLiteral(p.ex)});`).join('\n')
|
|
154
154
|
: ''
|
|
155
155
|
|
|
156
156
|
// Build the ENTID env var name for this entity
|
|
@@ -195,10 +195,10 @@ public class ${entity.Name}DirectTest {
|
|
|
195
195
|
if (hasList && listPoint) {
|
|
196
196
|
// Build live params for list
|
|
197
197
|
const listLiveParams = listParams.map((p: any) => {
|
|
198
|
-
const key = p.
|
|
198
|
+
const key = p.n === 'id'
|
|
199
199
|
? entity.name + '01'
|
|
200
|
-
: p.
|
|
201
|
-
return { name: p.
|
|
200
|
+
: p.n.replace(/_id$/, '') + '01'
|
|
201
|
+
return { name: p.n, key }
|
|
202
202
|
})
|
|
203
203
|
|
|
204
204
|
const listLiveIdKeys = listParams.length > 0
|
|
@@ -304,18 +304,18 @@ ${listSkipBlock} ${SDK} client = setup.client;
|
|
|
304
304
|
// Generate load test - in live mode, first list to get a real entity ID
|
|
305
305
|
if (hasLoad && loadPoint) {
|
|
306
306
|
// Identify ancestor params (not 'id') for live mode
|
|
307
|
-
const ancestorParams = loadParams.filter((p: any) => p.
|
|
307
|
+
const ancestorParams = loadParams.filter((p: any) => p.n !== 'id')
|
|
308
308
|
|
|
309
309
|
let loadLiveIdKeys: string[] = []
|
|
310
310
|
if (loadParams.length > 0 && !loadAllHaveExamples) {
|
|
311
311
|
if (hasList) {
|
|
312
312
|
loadLiveIdKeys = listParams.map((p: any) => {
|
|
313
|
-
return p.
|
|
313
|
+
return p.n === 'id'
|
|
314
314
|
? entity.name + '01'
|
|
315
|
-
: p.
|
|
315
|
+
: p.n.replace(/_id$/, '') + '01'
|
|
316
316
|
})
|
|
317
317
|
} else {
|
|
318
|
-
loadLiveIdKeys = loadParams.map((p: any) => p.
|
|
318
|
+
loadLiveIdKeys = loadParams.map((p: any) => p.n + '01')
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
const loadSkipBlock = loadLiveIdKeys.length > 0
|
|
@@ -359,10 +359,10 @@ ${loadSkipBlock} ${SDK} client = setup.client;
|
|
|
359
359
|
Content(` Map<String, Object> listParams = new LinkedHashMap<>();
|
|
360
360
|
`)
|
|
361
361
|
for (const p of listParams) {
|
|
362
|
-
const key = p.
|
|
362
|
+
const key = p.n === 'id'
|
|
363
363
|
? entity.name + '01'
|
|
364
|
-
: p.
|
|
365
|
-
Content(` listParams.put("${p.
|
|
364
|
+
: p.n.replace(/_id$/, '') + '01'
|
|
365
|
+
Content(` listParams.put("${p.n}", setup.idmap.get("${key}"));
|
|
366
366
|
`)
|
|
367
367
|
}
|
|
368
368
|
|
|
@@ -381,8 +381,8 @@ ${loadSkipBlock} ${SDK} client = setup.client;
|
|
|
381
381
|
params.put("id", firstEnt.get("id"));
|
|
382
382
|
`)
|
|
383
383
|
for (const p of ancestorParams) {
|
|
384
|
-
const key = p.
|
|
385
|
-
Content(` params.put("${p.
|
|
384
|
+
const key = p.n.replace(/_id$/, '') + '01'
|
|
385
|
+
Content(` params.put("${p.n}", setup.idmap.get("${key}"));
|
|
386
386
|
`)
|
|
387
387
|
}
|
|
388
388
|
}
|
|
@@ -392,7 +392,7 @@ ${loadSkipBlock} ${SDK} client = setup.client;
|
|
|
392
392
|
else {
|
|
393
393
|
`)
|
|
394
394
|
for (let i = 0; i < loadParams.length; i++) {
|
|
395
|
-
Content(` params.put("${loadParams[i].
|
|
395
|
+
Content(` params.put("${loadParams[i].n}", "direct0${i + 1}");
|
|
396
396
|
`)
|
|
397
397
|
}
|
|
398
398
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { flowSteps } from '@voxgig/sdkgen'
|
|
1
2
|
|
|
2
3
|
import {
|
|
3
4
|
KIT,
|
|
@@ -86,17 +87,17 @@ const TestEntity = cmp(function TestEntity(props: any) {
|
|
|
86
87
|
const idnames = buildIdNames(entity, basicflow)
|
|
87
88
|
|
|
88
89
|
// Get all update data entries for alias generation
|
|
89
|
-
const allSteps = Object.values(basicflow
|
|
90
|
-
const updateStep = allSteps.find((s: any) => s.
|
|
91
|
-
const updateData = updateStep?.
|
|
92
|
-
? Object.entries(updateStep.
|
|
90
|
+
const allSteps = Object.values(flowSteps(basicflow)) as any[]
|
|
91
|
+
const updateStep = allSteps.find((s: any) => s.o === 'update')
|
|
92
|
+
const updateData = updateStep?.d
|
|
93
|
+
? Object.entries(updateStep.d).filter(([k]: any) => k !== 'id' && !k.endsWith('$'))
|
|
93
94
|
: []
|
|
94
95
|
const aliases = updateData.map(([k, v]: any) => [k, v])
|
|
95
96
|
|
|
96
97
|
const genCtx: GenCtx = { model, entity, javapackage, flow: basicflow, PROJUPPER, accessor }
|
|
97
98
|
|
|
98
99
|
const stepOps = Array.from(new Set(
|
|
99
|
-
(allSteps as any[]).map((s: any) => s.
|
|
100
|
+
(allSteps as any[]).map((s: any) => s.o).filter(Boolean)))
|
|
100
101
|
|
|
101
102
|
File({ name: entity.Name + 'EntityTest.' + target.ext }, () => {
|
|
102
103
|
|
|
@@ -153,7 +154,7 @@ public class ${entity.Name}EntityTest {
|
|
|
153
154
|
${allSteps.length > 0 ? ` ${SDK} client = setup.client;\n\n` : ''}`)
|
|
154
155
|
|
|
155
156
|
// Check if the flow has a create step; if not, bootstrap entity data
|
|
156
|
-
const flowHasCreate = allSteps.some((s: any) => s.
|
|
157
|
+
const flowHasCreate = allSteps.some((s: any) => s.o === 'create')
|
|
157
158
|
if (!flowHasCreate) {
|
|
158
159
|
const preambleRef = entity.name + '_ref01'
|
|
159
160
|
const preambleVar = javaVar(preambleRef)
|
|
@@ -167,8 +168,8 @@ ${allSteps.length > 0 ? ` ${SDK} client = setup.client;\n\n` : ''}`)
|
|
|
167
168
|
}
|
|
168
169
|
|
|
169
170
|
// Model-driven step iteration
|
|
170
|
-
each(basicflow
|
|
171
|
-
const opgen: OpGen = GENERATE_OP[step.
|
|
171
|
+
each(flowSteps(basicflow), (step: any, index: any) => {
|
|
172
|
+
const opgen: OpGen = GENERATE_OP[step.o]
|
|
172
173
|
if (opgen) {
|
|
173
174
|
opgen(genCtx, step, index)
|
|
174
175
|
Content('\n')
|
|
@@ -179,7 +180,7 @@ ${allSteps.length > 0 ? ` ${SDK} client = setup.client;\n\n` : ''}`)
|
|
|
179
180
|
|
|
180
181
|
`)
|
|
181
182
|
|
|
182
|
-
const flowHasList = allSteps.some((s: any) => s.
|
|
183
|
+
const flowHasList = allSteps.some((s: any) => s.o === 'list')
|
|
183
184
|
if (flowHasList) {
|
|
184
185
|
Content(` @Test
|
|
185
186
|
public void stream() {
|
|
@@ -321,18 +322,18 @@ ${authActive ? ` liveOpts.put("apikey", env.get("${PROJUPPER}_APIKEY"));\n`
|
|
|
321
322
|
|
|
322
323
|
const generateCreate: OpGen = (ctx, step, index) => {
|
|
323
324
|
const { entity, flow, accessor } = ctx
|
|
324
|
-
const ref = step.
|
|
325
|
-
const entvar = javaVar(step.
|
|
326
|
-
const datavar = javaVar(step.
|
|
325
|
+
const ref = step.i.ref ?? entity.name + '_ref01'
|
|
326
|
+
const entvar = javaVar(step.i.entvar ?? ref + '_ent')
|
|
327
|
+
const datavar = javaVar(step.i.datavar ?? (ref + '_data' + (step.i.suffix ?? '')))
|
|
327
328
|
|
|
328
|
-
const priorSteps = Object.values(flow
|
|
329
|
+
const priorSteps = Object.values(flowSteps(flow)).slice(0, Number(index)) as any[]
|
|
329
330
|
const needsEnt = !priorSteps.some((s: any) =>
|
|
330
|
-
['create', 'list', 'load', 'update', 'remove'].includes(s.
|
|
331
|
+
['create', 'list', 'load', 'update', 'remove'].includes(s.o))
|
|
331
332
|
|
|
332
333
|
const hasDatvar = priorSteps.some((s: any) => {
|
|
333
|
-
if ('create' === s.
|
|
334
|
-
const priorRef = s.
|
|
335
|
-
const priorDatvar = javaVar(s.
|
|
334
|
+
if ('create' === s.o) {
|
|
335
|
+
const priorRef = s.i.ref ?? entity.name + '_ref01'
|
|
336
|
+
const priorDatvar = javaVar(s.i.datavar ?? (priorRef + '_data' + (s.i.suffix ?? '')))
|
|
336
337
|
return priorDatvar === datavar
|
|
337
338
|
}
|
|
338
339
|
return false
|
|
@@ -372,14 +373,14 @@ const generateCreate: OpGen = (ctx, step, index) => {
|
|
|
372
373
|
|
|
373
374
|
const generateList: OpGen = (ctx, step, index) => {
|
|
374
375
|
const { entity, flow, accessor } = ctx
|
|
375
|
-
const ref = step.
|
|
376
|
-
const entvar = javaVar(step.
|
|
377
|
-
const matchvar = javaVar(step.
|
|
378
|
-
const listvar = javaVar(step.
|
|
376
|
+
const ref = step.i.ref ?? entity.name + '_ref01'
|
|
377
|
+
const entvar = javaVar(step.i.entvar ?? ref + '_ent')
|
|
378
|
+
const matchvar = javaVar(step.i.matchvar ?? (ref + '_match' + (step.i.suffix ?? '')))
|
|
379
|
+
const listvar = javaVar(step.i.listvar ?? (ref + '_list' + (step.i.suffix ?? '')))
|
|
379
380
|
|
|
380
|
-
const priorSteps = Object.values(flow
|
|
381
|
+
const priorSteps = Object.values(flowSteps(flow)).slice(0, Number(index)) as any[]
|
|
381
382
|
const needsEnt = !priorSteps.some((s: any) =>
|
|
382
|
-
['create', 'list', 'load', 'update', 'remove'].includes(s.
|
|
383
|
+
['create', 'list', 'load', 'update', 'remove'].includes(s.o))
|
|
383
384
|
|
|
384
385
|
Content(` // LIST
|
|
385
386
|
`)
|
|
@@ -399,12 +400,12 @@ const generateList: OpGen = (ctx, step, index) => {
|
|
|
399
400
|
|
|
400
401
|
// Only declare ${listvar} as a real var when a downstream validator
|
|
401
402
|
// actually uses it.
|
|
402
|
-
const allSteps = Object.values(flow
|
|
403
|
-
const listvarUsed = !!step.
|
|
403
|
+
const allSteps = Object.values(flowSteps(flow)) as any[]
|
|
404
|
+
const listvarUsed = !!step.v?.some((v: any) => {
|
|
404
405
|
if ('ItemExists' !== v.apply && 'ItemNotExists' !== v.apply) return false
|
|
405
406
|
const validRef = v.def?.ref
|
|
406
|
-
return validRef && allSteps.some((s: any) => 'create' === s.
|
|
407
|
-
((s.
|
|
407
|
+
return validRef && allSteps.some((s: any) => 'create' === s.o &&
|
|
408
|
+
((s.i.ref ?? entity.name + '_ref01') === validRef))
|
|
408
409
|
})
|
|
409
410
|
|
|
410
411
|
Content(`
|
|
@@ -417,12 +418,12 @@ const generateList: OpGen = (ctx, step, index) => {
|
|
|
417
418
|
`)
|
|
418
419
|
}
|
|
419
420
|
|
|
420
|
-
// Handle validators from step.
|
|
421
|
-
if (step.
|
|
422
|
-
for (const validator of step.
|
|
421
|
+
// Handle validators from step.v
|
|
422
|
+
if (step.v) {
|
|
423
|
+
for (const validator of step.v) {
|
|
423
424
|
const validRef = validator.def?.ref
|
|
424
|
-
const hasRefData = validRef && allSteps.some((s: any) => 'create' === s.
|
|
425
|
-
((s.
|
|
425
|
+
const hasRefData = validRef && allSteps.some((s: any) => 'create' === s.o &&
|
|
426
|
+
((s.i.ref ?? entity.name + '_ref01') === validRef))
|
|
426
427
|
|
|
427
428
|
if ('ItemExists' === validator.apply && hasRefData) {
|
|
428
429
|
const refDataVar = javaVar(validRef + '_data')
|
|
@@ -448,16 +449,16 @@ const generateList: OpGen = (ctx, step, index) => {
|
|
|
448
449
|
|
|
449
450
|
const generateUpdate: OpGen = (ctx, step, index) => {
|
|
450
451
|
const { entity, flow, accessor } = ctx
|
|
451
|
-
const ref = step.
|
|
452
|
-
const entvar = javaVar(step.
|
|
453
|
-
const datavar = javaVar(step.
|
|
454
|
-
const resdatavar = javaVar(step.
|
|
455
|
-
const markdefvar = javaVar(step.
|
|
456
|
-
const srcdatavar = javaVar(step.
|
|
457
|
-
|
|
458
|
-
const priorSteps = Object.values(flow
|
|
452
|
+
const ref = step.i.ref ?? entity.name + '_ref01'
|
|
453
|
+
const entvar = javaVar(step.i.entvar ?? ref + '_ent')
|
|
454
|
+
const datavar = javaVar(step.i.datavar ?? (ref + '_data' + (step.i.suffix ?? '')))
|
|
455
|
+
const resdatavar = javaVar(step.i.resdatavar ?? (ref + '_resdata' + (step.i.suffix ?? '')))
|
|
456
|
+
const markdefvar = javaVar(step.i.markdefvar ?? (ref + '_markdef' + (step.i.suffix ?? '')))
|
|
457
|
+
const srcdatavar = javaVar(step.i.srcdatavar ?? (ref + '_data' + (step.i.suffix ?? '')))
|
|
458
|
+
|
|
459
|
+
const priorSteps = Object.values(flowSteps(flow)).slice(0, Number(index)) as any[]
|
|
459
460
|
const needsEnt = !priorSteps.some((s: any) =>
|
|
460
|
-
['create', 'list', 'load', 'update', 'remove'].includes(s.
|
|
461
|
+
['create', 'list', 'load', 'update', 'remove'].includes(s.o))
|
|
461
462
|
|
|
462
463
|
const hasEntIdU = null != entity.id
|
|
463
464
|
|
|
@@ -474,9 +475,9 @@ const generateUpdate: OpGen = (ctx, step, index) => {
|
|
|
474
475
|
`)
|
|
475
476
|
}
|
|
476
477
|
|
|
477
|
-
// Add data entries from step.
|
|
478
|
-
if (step.
|
|
479
|
-
const dataEntries = Object.entries(step.
|
|
478
|
+
// Add data entries from step.d
|
|
479
|
+
if (step.d) {
|
|
480
|
+
const dataEntries = Object.entries(step.d).filter(([k]: any) => k !== 'id' && !k.endsWith('$'))
|
|
480
481
|
for (const [key] of dataEntries) {
|
|
481
482
|
Content(` ${datavar}Up.put("${key}", setup.idmap.get("${key}"));
|
|
482
483
|
`)
|
|
@@ -484,10 +485,10 @@ const generateUpdate: OpGen = (ctx, step, index) => {
|
|
|
484
485
|
}
|
|
485
486
|
|
|
486
487
|
// Handle TextFieldMark spec
|
|
487
|
-
if (step.
|
|
488
|
-
for (const spec of step.
|
|
489
|
-
if ('TextFieldMark' === spec.apply && null != step.
|
|
490
|
-
const fieldname = step.
|
|
488
|
+
if (step.s) {
|
|
489
|
+
for (const spec of step.s) {
|
|
490
|
+
if ('TextFieldMark' === spec.apply && null != step.i.textfield) {
|
|
491
|
+
const fieldname = step.i.textfield
|
|
491
492
|
const fieldvalue = spec.def?.mark ?? `Mark01-${ref}`
|
|
492
493
|
Content(`
|
|
493
494
|
String ${markdefvar}Name = "${fieldname}";
|
|
@@ -510,9 +511,9 @@ const generateUpdate: OpGen = (ctx, step, index) => {
|
|
|
510
511
|
}
|
|
511
512
|
|
|
512
513
|
// Assert TextFieldMark
|
|
513
|
-
if (step.
|
|
514
|
-
for (const spec of step.
|
|
515
|
-
if ('TextFieldMark' === spec.apply && null != step.
|
|
514
|
+
if (step.s) {
|
|
515
|
+
for (const spec of step.s) {
|
|
516
|
+
if ('TextFieldMark' === spec.apply && null != step.i.textfield) {
|
|
516
517
|
Content(` assertEquals(${markdefvar}Value, ${resdatavar}.get(${markdefvar}Name),
|
|
517
518
|
"expected " + ${markdefvar}Name + " to be updated");
|
|
518
519
|
`)
|
|
@@ -524,24 +525,24 @@ const generateUpdate: OpGen = (ctx, step, index) => {
|
|
|
524
525
|
|
|
525
526
|
const generateLoad: OpGen = (ctx, step, index) => {
|
|
526
527
|
const { entity, flow, accessor } = ctx
|
|
527
|
-
const ref = step.
|
|
528
|
-
const entvar = javaVar(step.
|
|
529
|
-
const matchvar = javaVar(step.
|
|
530
|
-
const datavar = javaVar(step.
|
|
531
|
-
const srcdatavar = javaVar(step.
|
|
528
|
+
const ref = step.i.ref ?? entity.name + '_ref01'
|
|
529
|
+
const entvar = javaVar(step.i.entvar ?? ref + '_ent')
|
|
530
|
+
const matchvar = javaVar(step.i.matchvar ?? (ref + '_match' + (step.i.suffix ?? '')))
|
|
531
|
+
const datavar = javaVar(step.i.datavar ?? (ref + '_data' + (step.i.suffix ?? '')))
|
|
532
|
+
const srcdatavar = javaVar(step.i.srcdatavar ?? (ref + '_data' + (step.i.suffix ?? '')))
|
|
532
533
|
|
|
533
|
-
const priorSteps = Object.values(flow
|
|
534
|
+
const priorSteps = Object.values(flowSteps(flow)).slice(0, Number(index)) as any[]
|
|
534
535
|
const hasEntVar = priorSteps.some((s: any) =>
|
|
535
|
-
['create', 'list', 'load', 'update', 'remove'].includes(s.
|
|
536
|
+
['create', 'list', 'load', 'update', 'remove'].includes(s.o))
|
|
536
537
|
|
|
537
538
|
// Check if srcdatavar was declared by a prior create step or preamble
|
|
538
|
-
const flowHasCreate = Object.values(flow
|
|
539
|
+
const flowHasCreate = Object.values(flowSteps(flow)).some((s: any) => (s as any).o === 'create')
|
|
539
540
|
const preambleRef = entity.name + '_ref01'
|
|
540
541
|
const hasSrcData = (!flowHasCreate && srcdatavar === javaVar(preambleRef + '_data')) ||
|
|
541
542
|
priorSteps.some((s: any) => {
|
|
542
|
-
if ('create' === s.
|
|
543
|
-
const priorRef = s.
|
|
544
|
-
const priorDatvar = javaVar(s.
|
|
543
|
+
if ('create' === s.o) {
|
|
544
|
+
const priorRef = s.i.ref ?? entity.name + '_ref01'
|
|
545
|
+
const priorDatvar = javaVar(s.i.datavar ?? (priorRef + '_data' + (s.i.suffix ?? '')))
|
|
545
546
|
return priorDatvar === srcdatavar
|
|
546
547
|
}
|
|
547
548
|
return false
|
|
@@ -583,14 +584,14 @@ const generateLoad: OpGen = (ctx, step, index) => {
|
|
|
583
584
|
|
|
584
585
|
const generateRemove: OpGen = (ctx, step, index) => {
|
|
585
586
|
const { entity, flow, accessor } = ctx
|
|
586
|
-
const ref = step.
|
|
587
|
-
const entvar = javaVar(step.
|
|
588
|
-
const matchvar = javaVar(step.
|
|
589
|
-
const srcdatavar = javaVar(step.
|
|
587
|
+
const ref = step.i.ref ?? entity.name + '_ref01'
|
|
588
|
+
const entvar = javaVar(step.i.entvar ?? ref + '_ent')
|
|
589
|
+
const matchvar = javaVar(step.i.matchvar ?? (ref + '_match' + (step.i.suffix ?? '')))
|
|
590
|
+
const srcdatavar = javaVar(step.i.srcdatavar ?? (ref + '_data'))
|
|
590
591
|
|
|
591
|
-
const priorSteps = Object.values(flow
|
|
592
|
+
const priorSteps = Object.values(flowSteps(flow)).slice(0, Number(index)) as any[]
|
|
592
593
|
const needsEnt = !priorSteps.some((s: any) =>
|
|
593
|
-
['create', 'list', 'load', 'update', 'remove'].includes(s.
|
|
594
|
+
['create', 'list', 'load', 'update', 'remove'].includes(s.o))
|
|
594
595
|
|
|
595
596
|
Content(` // REMOVE
|
|
596
597
|
`)
|
|
@@ -42,8 +42,8 @@ const EntityTypes = cmp(function EntityTypes(props: any) {
|
|
|
42
42
|
|
|
43
43
|
Content(`// Typed models for the ${model.const.Name} SDK (JSDoc typedefs).
|
|
44
44
|
//
|
|
45
|
-
// GENERATED from the API model: main.${KIT}.entity.<e>.fields
|
|
46
|
-
// params (op.<name>.points[].
|
|
45
|
+
// GENERATED from the API model: main.${KIT}.entity.<e>.fields{} and per-op
|
|
46
|
+
// params (op.<name>.points[].g.params[]). Field/param types come from the
|
|
47
47
|
// canonical type sentinels via @voxgig/sdkgen canonToType (source of truth:
|
|
48
48
|
// @voxgig/apidef VALID_CANON). Annotations only — no runtime effect. Do not
|
|
49
49
|
// edit by hand.
|
|
@@ -53,14 +53,14 @@ const EntityTypes = cmp(function EntityTypes(props: any) {
|
|
|
53
53
|
entityList.forEach((ent: any) => {
|
|
54
54
|
const Name = ent.Name
|
|
55
55
|
const fields = (ent.fields ? each(ent.fields) : [])
|
|
56
|
-
.filter((f: any) => f.
|
|
56
|
+
.filter((f: any) => f.a !== false)
|
|
57
57
|
|
|
58
58
|
Content(`/**
|
|
59
59
|
* @typedef {Object} ${Name}
|
|
60
60
|
`)
|
|
61
61
|
fields.forEach((f: any) => {
|
|
62
|
-
const key = false === f.
|
|
63
|
-
Content(` * @property {${canonToType(f.
|
|
62
|
+
const key = false === f.r ? '[' + propKey(f.n) + ']' : propKey(f.n)
|
|
63
|
+
Content(` * @property {${canonToType(f.t, LANG)}} ${key}
|
|
64
64
|
`)
|
|
65
65
|
})
|
|
66
66
|
Content(` */
|
|
@@ -45,7 +45,7 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
|
45
45
|
|
|
46
46
|
publishedEntities.map((entity: any) => {
|
|
47
47
|
const opnames = Object.keys(entity.op || {})
|
|
48
|
-
const fields = entity.fields ||
|
|
48
|
+
const fields = Object.values(entity.fields || {})
|
|
49
49
|
// Model-driven id key: null when this entity has no id-like field.
|
|
50
50
|
const idF = entityIdField(entity)
|
|
51
51
|
const eVar = exampleVarName(entity.name, 'js')
|
|
@@ -91,8 +91,8 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
|
91
91
|
`)
|
|
92
92
|
|
|
93
93
|
each(fields, (field: any) => {
|
|
94
|
-
const desc = field.
|
|
95
|
-
Content(`| \`${field.
|
|
94
|
+
const desc = field.sh || ''
|
|
95
|
+
Content(`| \`${field.n}\` | \`${canonToType(field.t, target.name)}\` | ${desc} |
|
|
96
96
|
`)
|
|
97
97
|
})
|
|
98
98
|
|
|
@@ -153,13 +153,13 @@ The \`prepare()\` method returns:
|
|
|
153
153
|
`)
|
|
154
154
|
|
|
155
155
|
each(entityList, (ent: any) => {
|
|
156
|
-
const fields = ent.fields ||
|
|
156
|
+
const fields = Object.values(ent.fields || {})
|
|
157
157
|
const opnames = Object.keys(ent.op || {})
|
|
158
158
|
const ops = ent.op || {}
|
|
159
159
|
const points = each(ops).map((op: any) =>
|
|
160
160
|
op.points ? each(op.points) : []
|
|
161
161
|
).flat()
|
|
162
|
-
const path = points.length > 0 ? (points[0] as any).
|
|
162
|
+
const path = points.length > 0 ? (points[0] as any).o || '' : ''
|
|
163
163
|
|
|
164
164
|
Content(`#### ${ent.Name}
|
|
165
165
|
|
|
@@ -167,7 +167,7 @@ The \`prepare()\` method returns:
|
|
|
167
167
|
| --- | --- |
|
|
168
168
|
`)
|
|
169
169
|
each(fields, (field: any) => {
|
|
170
|
-
Content(`| \`${field.
|
|
170
|
+
Content(`| \`${field.n}\` | ${field.sh || ''} |
|
|
171
171
|
`)
|
|
172
172
|
})
|
|
173
173
|
|
|
@@ -181,7 +181,7 @@ Alias for \`${model.Name}SDK.test()\`.
|
|
|
181
181
|
// Entity reference sections
|
|
182
182
|
publishedEntities.map((ent: any) => {
|
|
183
183
|
const opnames = Object.keys(ent.op || {})
|
|
184
|
-
const fields = ent.fields ||
|
|
184
|
+
const fields = Object.values(ent.fields || {})
|
|
185
185
|
// Model-driven id key: null when this entity has no id-like field, in
|
|
186
186
|
// which case load/remove match on no argument and update omits the id.
|
|
187
187
|
const idF = entityIdField(ent)
|
|
@@ -214,9 +214,9 @@ const ${eVar} = client.${ent.Name}()
|
|
|
214
214
|
| --- | --- | --- | --- |
|
|
215
215
|
`)
|
|
216
216
|
each(fields, (field: any) => {
|
|
217
|
-
const req = field.
|
|
218
|
-
const desc = field.
|
|
219
|
-
Content(`| \`${field.
|
|
217
|
+
const req = field.r ? 'Yes' : 'No'
|
|
218
|
+
const desc = field.sh || ''
|
|
219
|
+
Content(`| \`${field.n}\` | \`${canonToType(field.t, target.name)}\` | ${req} | ${desc} |
|
|
220
220
|
`)
|
|
221
221
|
})
|
|
222
222
|
|
|
@@ -243,7 +243,7 @@ const ${eVar} = client.${ent.Name}()
|
|
|
243
243
|
if (fop.active === false) return '-'
|
|
244
244
|
return 'Yes'
|
|
245
245
|
})
|
|
246
|
-
Content(`| \`${field.
|
|
246
|
+
Content(`| \`${field.n}\` | ${cols.join(' | ')} |
|
|
247
247
|
`)
|
|
248
248
|
})
|
|
249
249
|
|
|
@@ -25,7 +25,7 @@ const Schema = cmp(async function Schema(props: any) {
|
|
|
25
25
|
Content(`// ${model.const.Name} ${target.Name} SDK: generated schemas. Do not edit.
|
|
26
26
|
//
|
|
27
27
|
// Generated from the model: \`main.kit.optspec\` and each feature's
|
|
28
|
-
// \`config.options\` for OPTSPEC; entity \`fields
|
|
28
|
+
// \`config.options\` for OPTSPEC; entity \`fields{}.type\` for ENTITYSPEC.
|
|
29
29
|
|
|
30
30
|
const OPTSPEC = ${JSON.stringify(optspec, null, 2)}
|
|
31
31
|
|