@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.
Files changed (195) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/dist/cmp/ReadmeTop.js +1 -1
  3. package/dist/cmp/ReadmeTop.js.map +1 -1
  4. package/dist/cmp/ReadmeUnions.js +1 -1
  5. package/dist/cmp/ReadmeUnions.js.map +1 -1
  6. package/dist/cmp/Test.js +1 -1
  7. package/dist/cmp/Test.js.map +1 -1
  8. package/dist/helpers/buildIdNames.d.ts +3 -1
  9. package/dist/helpers/buildIdNames.js +15 -7
  10. package/dist/helpers/buildIdNames.js.map +1 -1
  11. package/dist/helpers/canonSpec.js +2 -2
  12. package/dist/helpers/canonSpec.js.map +1 -1
  13. package/dist/helpers/getMatchEntries.js +2 -2
  14. package/dist/helpers/getMatchEntries.js.map +1 -1
  15. package/dist/helpers/modelNames.js +5 -1
  16. package/dist/helpers/modelNames.js.map +1 -1
  17. package/dist/helpers/opShape.js +33 -33
  18. package/dist/helpers/opShape.js.map +1 -1
  19. package/dist/helpers/pointPath.js +5 -10
  20. package/dist/helpers/pointPath.js.map +1 -1
  21. package/dist/helpers/resolved.js +2 -29
  22. package/dist/helpers/resolved.js.map +1 -1
  23. package/dist/sdkgen.d.ts +2 -2
  24. package/dist/sdkgen.js +5 -3
  25. package/dist/sdkgen.js.map +1 -1
  26. package/dist/tsconfig.tsbuildinfo +1 -1
  27. package/dist/utility.js +15 -7
  28. package/dist/utility.js.map +1 -1
  29. package/package.json +3 -3
  30. package/project/.sdk/src/cmp/c/EntityTypes_c.ts +4 -4
  31. package/project/.sdk/src/cmp/c/ReadmeEntity_c.ts +3 -3
  32. package/project/.sdk/src/cmp/c/ReadmeModel_c.ts +3 -3
  33. package/project/.sdk/src/cmp/c/ReadmeRef_c.ts +5 -5
  34. package/project/.sdk/src/cmp/c/Schema_c.ts +1 -1
  35. package/project/.sdk/src/cmp/c/TestDirect_c.ts +12 -12
  36. package/project/.sdk/src/cmp/clojure/ReadmeEntity_clojure.ts +3 -3
  37. package/project/.sdk/src/cmp/clojure/ReadmeModel_clojure.ts +3 -3
  38. package/project/.sdk/src/cmp/clojure/ReadmeRef_clojure.ts +5 -5
  39. package/project/.sdk/src/cmp/clojure/Schema_clojure.ts +1 -1
  40. package/project/.sdk/src/cmp/cpp/EntityTypes_cpp.ts +3 -3
  41. package/project/.sdk/src/cmp/cpp/ReadmeEntity_cpp.ts +3 -3
  42. package/project/.sdk/src/cmp/cpp/ReadmeModel_cpp.ts +3 -3
  43. package/project/.sdk/src/cmp/cpp/ReadmeRef_cpp.ts +5 -5
  44. package/project/.sdk/src/cmp/cpp/Schema_cpp.ts +1 -1
  45. package/project/.sdk/src/cmp/cpp/TestDirect_cpp.ts +14 -14
  46. package/project/.sdk/src/cmp/cpp/TestEntity_cpp.ts +51 -50
  47. package/project/.sdk/src/cmp/csharp/EntityTypes_csharp.ts +4 -4
  48. package/project/.sdk/src/cmp/csharp/ReadmeEntity_csharp.ts +3 -3
  49. package/project/.sdk/src/cmp/csharp/ReadmeModel_csharp.ts +3 -3
  50. package/project/.sdk/src/cmp/csharp/ReadmeRef_csharp.ts +5 -5
  51. package/project/.sdk/src/cmp/csharp/Schema_csharp.ts +1 -1
  52. package/project/.sdk/src/cmp/csharp/TestDirect_csharp.ts +30 -30
  53. package/project/.sdk/src/cmp/csharp/TestEntity_csharp.ts +66 -65
  54. package/project/.sdk/src/cmp/elixir/EntityTypes_elixir.ts +4 -4
  55. package/project/.sdk/src/cmp/elixir/ReadmeEntity_elixir.ts +3 -3
  56. package/project/.sdk/src/cmp/elixir/ReadmeModel_elixir.ts +3 -3
  57. package/project/.sdk/src/cmp/elixir/ReadmeRef_elixir.ts +4 -4
  58. package/project/.sdk/src/cmp/elixir/Schema_elixir.ts +1 -1
  59. package/project/.sdk/src/cmp/go/EntityTypes_go.ts +4 -4
  60. package/project/.sdk/src/cmp/go/ReadmeEntity_go.ts +3 -3
  61. package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +3 -3
  62. package/project/.sdk/src/cmp/go/ReadmeRef_go.ts +5 -5
  63. package/project/.sdk/src/cmp/go/Schema_go.ts +1 -1
  64. package/project/.sdk/src/cmp/go/TestDirect_go.ts +38 -38
  65. package/project/.sdk/src/cmp/go/TestEntity_go.ts +75 -74
  66. package/project/.sdk/src/cmp/go/utility_go.ts +5 -5
  67. package/project/.sdk/src/cmp/java/EntityTypes_java.ts +4 -4
  68. package/project/.sdk/src/cmp/java/ReadmeEntity_java.ts +3 -3
  69. package/project/.sdk/src/cmp/java/ReadmeModel_java.ts +3 -3
  70. package/project/.sdk/src/cmp/java/ReadmeRef_java.ts +5 -5
  71. package/project/.sdk/src/cmp/java/Schema_java.ts +1 -1
  72. package/project/.sdk/src/cmp/java/TestDirect_java.ts +30 -30
  73. package/project/.sdk/src/cmp/java/TestEntity_java.ts +69 -68
  74. package/project/.sdk/src/cmp/js/EntityTypes_js.ts +5 -5
  75. package/project/.sdk/src/cmp/js/ReadmeEntity_js.ts +3 -3
  76. package/project/.sdk/src/cmp/js/ReadmeModel_js.ts +3 -3
  77. package/project/.sdk/src/cmp/js/ReadmeRef_js.ts +5 -5
  78. package/project/.sdk/src/cmp/js/Schema_js.ts +1 -1
  79. package/project/.sdk/src/cmp/js/TestDirect_js.ts +27 -27
  80. package/project/.sdk/src/cmp/js/TestEntity_js.ts +66 -69
  81. package/project/.sdk/src/cmp/js/TestLive_js.ts +3 -3
  82. package/project/.sdk/src/cmp/js/utility_js.ts +5 -5
  83. package/project/.sdk/src/cmp/kotlin/EntityTypes_kotlin.ts +4 -4
  84. package/project/.sdk/src/cmp/kotlin/ReadmeEntity_kotlin.ts +3 -3
  85. package/project/.sdk/src/cmp/kotlin/ReadmeModel_kotlin.ts +3 -3
  86. package/project/.sdk/src/cmp/kotlin/ReadmeRef_kotlin.ts +5 -5
  87. package/project/.sdk/src/cmp/kotlin/Schema_kotlin.ts +1 -1
  88. package/project/.sdk/src/cmp/kotlin/TestDirect_kotlin.ts +30 -30
  89. package/project/.sdk/src/cmp/kotlin/TestEntity_kotlin.ts +67 -66
  90. package/project/.sdk/src/cmp/lua/EntityTypes_lua.ts +5 -5
  91. package/project/.sdk/src/cmp/lua/ReadmeEntity_lua.ts +3 -3
  92. package/project/.sdk/src/cmp/lua/ReadmeModel_lua.ts +3 -3
  93. package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +4 -4
  94. package/project/.sdk/src/cmp/lua/ReadmeRef_lua.ts +5 -5
  95. package/project/.sdk/src/cmp/lua/Schema_lua.ts +1 -1
  96. package/project/.sdk/src/cmp/lua/TestDirect_lua.ts +25 -25
  97. package/project/.sdk/src/cmp/lua/TestEntity_lua.ts +66 -65
  98. package/project/.sdk/src/cmp/ocaml/ReadmeEntity_ocaml.ts +3 -3
  99. package/project/.sdk/src/cmp/ocaml/ReadmeModel_ocaml.ts +3 -3
  100. package/project/.sdk/src/cmp/ocaml/ReadmeRef_ocaml.ts +5 -5
  101. package/project/.sdk/src/cmp/ocaml/Schema_ocaml.ts +1 -1
  102. package/project/.sdk/src/cmp/perl/ReadmeEntity_perl.ts +3 -3
  103. package/project/.sdk/src/cmp/perl/ReadmeModel_perl.ts +3 -3
  104. package/project/.sdk/src/cmp/perl/ReadmeRef_perl.ts +5 -5
  105. package/project/.sdk/src/cmp/perl/Schema_perl.ts +1 -1
  106. package/project/.sdk/src/cmp/perl/TestDirect_perl.ts +25 -25
  107. package/project/.sdk/src/cmp/perl/TestEntity_perl.ts +60 -59
  108. package/project/.sdk/src/cmp/php/EntityTypes_php.ts +4 -4
  109. package/project/.sdk/src/cmp/php/ReadmeEntity_php.ts +3 -3
  110. package/project/.sdk/src/cmp/php/ReadmeModel_php.ts +3 -3
  111. package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +4 -4
  112. package/project/.sdk/src/cmp/php/ReadmeRef_php.ts +5 -5
  113. package/project/.sdk/src/cmp/php/Schema_php.ts +1 -1
  114. package/project/.sdk/src/cmp/php/TestDirect_php.ts +25 -25
  115. package/project/.sdk/src/cmp/php/TestEntity_php.ts +66 -65
  116. package/project/.sdk/src/cmp/py/EntityTypes_py.ts +4 -4
  117. package/project/.sdk/src/cmp/py/ReadmeEntity_py.ts +3 -3
  118. package/project/.sdk/src/cmp/py/ReadmeModel_py.ts +3 -3
  119. package/project/.sdk/src/cmp/py/ReadmeRef_py.ts +5 -5
  120. package/project/.sdk/src/cmp/py/Schema_py.ts +1 -1
  121. package/project/.sdk/src/cmp/py/TestDirect_py.ts +25 -25
  122. package/project/.sdk/src/cmp/py/TestEntity_py.ts +66 -65
  123. package/project/.sdk/src/cmp/py-data/Main_py-data.ts +4 -4
  124. package/project/.sdk/src/cmp/rb/EntityTypes_rb.ts +4 -4
  125. package/project/.sdk/src/cmp/rb/ReadmeEntity_rb.ts +3 -3
  126. package/project/.sdk/src/cmp/rb/ReadmeModel_rb.ts +3 -3
  127. package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +4 -4
  128. package/project/.sdk/src/cmp/rb/ReadmeRef_rb.ts +5 -5
  129. package/project/.sdk/src/cmp/rb/Schema_rb.ts +1 -1
  130. package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +25 -25
  131. package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +66 -65
  132. package/project/.sdk/src/cmp/rust/EntityTypes_rust.ts +4 -4
  133. package/project/.sdk/src/cmp/rust/ReadmeEntity_rust.ts +3 -3
  134. package/project/.sdk/src/cmp/rust/ReadmeModel_rust.ts +3 -3
  135. package/project/.sdk/src/cmp/rust/ReadmeRef_rust.ts +5 -5
  136. package/project/.sdk/src/cmp/rust/Schema_rust.ts +1 -1
  137. package/project/.sdk/src/cmp/rust/TestDirect_rust.ts +18 -18
  138. package/project/.sdk/src/cmp/rust/TestEntity_rust.ts +63 -62
  139. package/project/.sdk/src/cmp/scala/EntityTypes_scala.ts +4 -4
  140. package/project/.sdk/src/cmp/scala/ReadmeEntity_scala.ts +3 -3
  141. package/project/.sdk/src/cmp/scala/ReadmeModel_scala.ts +3 -3
  142. package/project/.sdk/src/cmp/scala/ReadmeRef_scala.ts +5 -5
  143. package/project/.sdk/src/cmp/scala/Schema_scala.ts +1 -1
  144. package/project/.sdk/src/cmp/scala/TestDirect_scala.ts +14 -14
  145. package/project/.sdk/src/cmp/scala/TestEntity_scala.ts +60 -59
  146. package/project/.sdk/src/cmp/swift/EntityTypes_swift.ts +4 -4
  147. package/project/.sdk/src/cmp/swift/ReadmeEntity_swift.ts +3 -3
  148. package/project/.sdk/src/cmp/swift/ReadmeModel_swift.ts +3 -3
  149. package/project/.sdk/src/cmp/swift/ReadmeRef_swift.ts +5 -5
  150. package/project/.sdk/src/cmp/swift/Schema_swift.ts +1 -1
  151. package/project/.sdk/src/cmp/ts/EntityTypes_ts.ts +5 -5
  152. package/project/.sdk/src/cmp/ts/ReadmeEntity_ts.ts +3 -3
  153. package/project/.sdk/src/cmp/ts/ReadmeModel_ts.ts +3 -3
  154. package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +1 -1
  155. package/project/.sdk/src/cmp/ts/ReadmeRef_ts.ts +5 -5
  156. package/project/.sdk/src/cmp/ts/Schema_ts.ts +1 -1
  157. package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +40 -40
  158. package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +72 -75
  159. package/project/.sdk/src/cmp/ts/TestLive_ts.ts +3 -3
  160. package/project/.sdk/src/cmp/ts/utility_ts.ts +5 -5
  161. package/project/.sdk/src/cmp/zig/ReadmeEntity_zig.ts +3 -3
  162. package/project/.sdk/src/cmp/zig/ReadmeModel_zig.ts +3 -3
  163. package/project/.sdk/src/cmp/zig/ReadmeRef_zig.ts +5 -5
  164. package/project/.sdk/src/cmp/zig/Schema_zig.ts +1 -1
  165. package/project/.sdk/tm/c/feature/test.c +20 -4
  166. package/project/.sdk/tm/clojure/src/sdk/features.clj +6 -4
  167. package/project/.sdk/tm/cpp/feature/test.hpp +17 -6
  168. package/project/.sdk/tm/csharp/feature/TestFeature.cs +10 -4
  169. package/project/.sdk/tm/elixir/lib/projectname/feature/test.ex +11 -5
  170. package/project/.sdk/tm/java/feature/TestFeature.java +11 -6
  171. package/project/.sdk/tm/js/test/live-entity.js +29 -29
  172. package/project/.sdk/tm/js/test/live-scenarios.js +4 -4
  173. package/project/.sdk/tm/kotlin/feature/TestFeature.kt +8 -4
  174. package/project/.sdk/tm/ocaml/sdk_features.ml +6 -4
  175. package/project/.sdk/tm/perl/feature/test_feature.pm +6 -4
  176. package/project/.sdk/tm/rb/feature/test_feature.rb +6 -4
  177. package/project/.sdk/tm/rust/feature/test.rs +8 -4
  178. package/project/.sdk/tm/scala/feature/TestFeature.scala +10 -6
  179. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/TestFeature.swift +10 -6
  180. package/project/.sdk/tm/ts/test/live-entity.ts +26 -26
  181. package/project/.sdk/tm/ts/test/live-scenarios.ts +3 -3
  182. package/project/.sdk/tm/zig/feature/test.zig +11 -4
  183. package/project/sdkgen-package.json +1 -1
  184. package/src/cmp/ReadmeTop.ts +1 -1
  185. package/src/cmp/ReadmeUnions.ts +1 -1
  186. package/src/cmp/Test.ts +1 -1
  187. package/src/helpers/buildIdNames.ts +17 -7
  188. package/src/helpers/canonSpec.ts +2 -2
  189. package/src/helpers/getMatchEntries.ts +2 -2
  190. package/src/helpers/modelNames.ts +6 -1
  191. package/src/helpers/opShape.ts +33 -33
  192. package/src/helpers/pointPath.ts +5 -10
  193. package/src/helpers/resolved.ts +3 -14
  194. package/src/sdkgen.ts +3 -1
  195. package/src/utility.ts +16 -7
@@ -1,3 +1,4 @@
1
+ import { flowSteps } from '@voxgig/sdkgen'
1
2
 
2
3
  import {
3
4
  KIT,
@@ -54,16 +55,16 @@ const TestEntity = cmp(function TestEntity(props: any) {
54
55
  const idnames = buildIdNames(entity, basicflow)
55
56
  const idnamesStr = idnames.map(n => `Value("${n}")`).join(', ')
56
57
 
57
- const allSteps = Object.values(basicflow.step) as any[]
58
- const updateStep = allSteps.find((s: any) => s.op === 'update')
59
- const updateData = updateStep?.data
60
- ? Object.entries(updateStep.data).filter(([k]: any) => k !== 'id' && !k.endsWith('$'))
58
+ const allSteps = Object.values(flowSteps(basicflow)) as any[]
59
+ const updateStep = allSteps.find((s: any) => s.o === 'update')
60
+ const updateData = updateStep?.d
61
+ ? Object.entries(updateStep.d).filter(([k]: any) => k !== 'id' && !k.endsWith('$'))
61
62
  : []
62
63
  const aliases = updateData.map(([k, v]: any) => [k, v])
63
64
 
64
65
  const genCtx: GenCtx = { model, entity, flow: basicflow }
65
66
 
66
- const opsList = Array.from(new Set(allSteps.map((s: any) => s.op).filter(Boolean)))
67
+ const opsList = Array.from(new Set(allSteps.map((s: any) => s.o).filter(Boolean)))
67
68
  .map(o => `"${o}"`).join(', ')
68
69
 
69
70
  const method = cppVarName(entity.name)
@@ -133,7 +134,7 @@ static ${entity.Name}Setup ${evar}_basic_setup(const Value& extra) {
133
134
 
134
135
  ${entity.Name}Setup s;
135
136
  s.client = client;
136
- s.data = entity_data;
137
+ s.d = entity_data;
137
138
  s.idmap = idmap_resolved;
138
139
  s.env = env;
139
140
  s.live = live;
@@ -153,7 +154,7 @@ static void ${evar}_entity_instance() {
153
154
  // The stream test drives the list op; only emit it when the entity has a
154
155
  // list op (a create/load-only entity has no list endpoint, so
155
156
  // stream("list") throws "Operation \"list\" has no endpoint definitions").
156
- const flowHasList = allSteps.some((s: any) => 'list' === s.op)
157
+ const flowHasList = allSteps.some((s: any) => 'list' === s.o)
157
158
  if (flowHasList) {
158
159
  Content(`
159
160
  static void ${evar}_entity_stream() {
@@ -192,7 +193,7 @@ static void ${evar}_entity_basic() {
192
193
  `)
193
194
 
194
195
  // No create step: bootstrap entity data from existing fixtures.
195
- const flowHasCreate = allSteps.some((s: any) => s.op === 'create')
196
+ const flowHasCreate = allSteps.some((s: any) => s.o === 'create')
196
197
  if (!flowHasCreate) {
197
198
  const preambleVar = cppVarName(entity.name + '_ref01')
198
199
  Content(`
@@ -211,8 +212,8 @@ static void ${evar}_entity_basic() {
211
212
  }
212
213
 
213
214
  // Model-driven step iteration.
214
- each(basicflow.step, (step: any, index: any) => {
215
- const opgen: OpGen = GENERATE_OP[step.op]
215
+ each(flowSteps(basicflow), (step: any, index: any) => {
216
+ const opgen: OpGen = GENERATE_OP[step.o]
216
217
  if (opgen) {
217
218
  opgen(genCtx, step, index)
218
219
  Content('\n')
@@ -243,9 +244,9 @@ const declaredVars = new Set<string>()
243
244
 
244
245
  const generateCreate: OpGen = (ctx, step: any, index) => {
245
246
  const { entity } = ctx
246
- const ref = step.input?.ref ?? entity.name + '_ref01'
247
- const datavar = cppVarName(step.input?.datavar ?? (ref + '_data' + (step.input?.suffix ?? '')))
248
- const entvar = cppVarName(step.input?.entvar ?? ref + '_ent')
247
+ const ref = step.i?.ref ?? entity.name + '_ref01'
248
+ const datavar = cppVarName(step.i?.datavar ?? (ref + '_data' + (step.i?.suffix ?? '')))
249
+ const entvar = cppVarName(step.i?.entvar ?? ref + '_ent')
249
250
 
250
251
  Content(` // CREATE
251
252
  auto ${entvar} = client->${cppVarName(entity.name)}();
@@ -277,14 +278,14 @@ const generateCreate: OpGen = (ctx, step: any, index) => {
277
278
 
278
279
  const generateList: OpGen = (ctx, step: any, index) => {
279
280
  const { entity, flow } = ctx
280
- const ref = step.input?.ref ?? entity.name + '_ref01'
281
- const entvar = cppVarName(step.input?.entvar ?? ref + '_ent')
282
- const matchvar = cppVarName(step.input?.matchvar ?? (ref + '_match' + (step.input?.suffix ?? '')))
283
- const listvar = cppVarName(step.input?.listvar ?? (ref + '_list' + (step.input?.suffix ?? '')))
281
+ const ref = step.i?.ref ?? entity.name + '_ref01'
282
+ const entvar = cppVarName(step.i?.entvar ?? ref + '_ent')
283
+ const matchvar = cppVarName(step.i?.matchvar ?? (ref + '_match' + (step.i?.suffix ?? '')))
284
+ const listvar = cppVarName(step.i?.listvar ?? (ref + '_list' + (step.i?.suffix ?? '')))
284
285
 
285
- const priorSteps = Object.values(flow.step).slice(0, Number(index)) as any[]
286
+ const priorSteps = Object.values(flowSteps(flow)).slice(0, Number(index)) as any[]
286
287
  const needsEnt = !priorSteps.some((s: any) =>
287
- ['create', 'list', 'load', 'update', 'remove'].includes(s.op))
288
+ ['create', 'list', 'load', 'update', 'remove'].includes(s.o))
288
289
 
289
290
  Content(` // LIST
290
291
  `)
@@ -306,12 +307,12 @@ const generateList: OpGen = (ctx, step: any, index) => {
306
307
  ASSERT_TRUE(${listvar}.is_list(), "expected list result to be an array");
307
308
  `)
308
309
 
309
- const allSteps = Object.values(flow.step) as any[]
310
- if (step.valid) {
311
- for (const validator of (step as any).valid) {
310
+ const allSteps = Object.values(flowSteps(flow)) as any[]
311
+ if (step.v) {
312
+ for (const validator of (step as any).v) {
312
313
  const validRef = validator.def?.ref
313
- const hasRefData = validRef && allSteps.some((s: any) => 'create' === s.op &&
314
- ((s.input?.ref ?? entity.name + '_ref01') === validRef))
314
+ const hasRefData = validRef && allSteps.some((s: any) => 'create' === s.o &&
315
+ ((s.i?.ref ?? entity.name + '_ref01') === validRef))
315
316
  if ('ItemExists' === validator.apply && hasRefData) {
316
317
  const refDataVar = cppVarName(validRef + '_data')
317
318
  Content(` {
@@ -334,15 +335,15 @@ const generateList: OpGen = (ctx, step: any, index) => {
334
335
 
335
336
  const generateUpdate: OpGen = (ctx, step: any, index) => {
336
337
  const { entity, flow } = ctx
337
- const ref = step.input?.ref ?? entity.name + '_ref01'
338
- const entvar = cppVarName(step.input?.entvar ?? ref + '_ent')
339
- const datavar = cppVarName(step.input?.datavar ?? (ref + '_data' + (step.input?.suffix ?? '')))
340
- const resdatavar = cppVarName(step.input?.resdatavar ?? (ref + '_resdata' + (step.input?.suffix ?? '')))
341
- const srcdatavar = cppVarName(step.input?.srcdatavar ?? (ref + '_data' + (step.input?.suffix ?? '')))
338
+ const ref = step.i?.ref ?? entity.name + '_ref01'
339
+ const entvar = cppVarName(step.i?.entvar ?? ref + '_ent')
340
+ const datavar = cppVarName(step.i?.datavar ?? (ref + '_data' + (step.i?.suffix ?? '')))
341
+ const resdatavar = cppVarName(step.i?.resdatavar ?? (ref + '_resdata' + (step.i?.suffix ?? '')))
342
+ const srcdatavar = cppVarName(step.i?.srcdatavar ?? (ref + '_data' + (step.i?.suffix ?? '')))
342
343
 
343
- const priorSteps = Object.values(flow.step).slice(0, Number(index)) as any[]
344
+ const priorSteps = Object.values(flowSteps(flow)).slice(0, Number(index)) as any[]
344
345
  const needsEnt = !priorSteps.some((s: any) =>
345
- ['create', 'list', 'load', 'update', 'remove'].includes(s.op))
346
+ ['create', 'list', 'load', 'update', 'remove'].includes(s.o))
346
347
  const hasEntIdU = null != entity.id
347
348
 
348
349
  Content(` // UPDATE
@@ -357,8 +358,8 @@ const generateUpdate: OpGen = (ctx, step: any, index) => {
357
358
  Content(` setp(${datavar}_up, "id", getp(${srcdatavar}, "id"));
358
359
  `)
359
360
  }
360
- if (step.data) {
361
- const dataEntries = Object.entries(step.data).filter(([k]: any) => k !== 'id' && !k.endsWith('$'))
361
+ if (step.d) {
362
+ const dataEntries = Object.entries(step.d).filter(([k]: any) => k !== 'id' && !k.endsWith('$'))
362
363
  for (const [key] of dataEntries) {
363
364
  Content(` setp(${datavar}_up, "${key}", getp(setup.idmap, "${key}"));
364
365
  `)
@@ -366,10 +367,10 @@ const generateUpdate: OpGen = (ctx, step: any, index) => {
366
367
  }
367
368
  let markname = ''
368
369
  let markval = ''
369
- if (step.spec) {
370
- for (const spec of (step as any).spec) {
371
- if ('TextFieldMark' === spec.apply && null != step.input?.textfield) {
372
- markname = step.input.textfield
370
+ if (step.s) {
371
+ for (const spec of (step as any).s) {
372
+ if ('TextFieldMark' === spec.apply && null != step.i?.textfield) {
373
+ markname = step.i.textfield
373
374
  const fieldvalue = spec.def?.mark ?? `Mark01-${ref}`
374
375
  markval = `${fieldvalue}_`
375
376
  Content(` std::string ${datavar}_markval = std::string("${fieldvalue}_") + std::to_string(setup.now);
@@ -396,15 +397,15 @@ const generateUpdate: OpGen = (ctx, step: any, index) => {
396
397
 
397
398
  const generateLoad: OpGen = (ctx, step: any, index) => {
398
399
  const { entity, flow } = ctx
399
- const ref = step.input?.ref ?? entity.name + '_ref01'
400
- const entvar = cppVarName(step.input?.entvar ?? ref + '_ent')
401
- const matchvar = cppVarName(step.input?.matchvar ?? (ref + '_match' + (step.input?.suffix ?? '')))
402
- const datavar = cppVarName(step.input?.datavar ?? (ref + '_data' + (step.input?.suffix ?? '')))
403
- const srcdatavar = cppVarName(step.input?.srcdatavar ?? (ref + '_data' + (step.input?.suffix ?? '')))
400
+ const ref = step.i?.ref ?? entity.name + '_ref01'
401
+ const entvar = cppVarName(step.i?.entvar ?? ref + '_ent')
402
+ const matchvar = cppVarName(step.i?.matchvar ?? (ref + '_match' + (step.i?.suffix ?? '')))
403
+ const datavar = cppVarName(step.i?.datavar ?? (ref + '_data' + (step.i?.suffix ?? '')))
404
+ const srcdatavar = cppVarName(step.i?.srcdatavar ?? (ref + '_data' + (step.i?.suffix ?? '')))
404
405
 
405
- const priorSteps = Object.values(flow.step).slice(0, Number(index)) as any[]
406
+ const priorSteps = Object.values(flowSteps(flow)).slice(0, Number(index)) as any[]
406
407
  const hasEntVar = priorSteps.some((s: any) =>
407
- ['create', 'list', 'load', 'update', 'remove'].includes(s.op))
408
+ ['create', 'list', 'load', 'update', 'remove'].includes(s.o))
408
409
  const hasEntId = null != entity.id
409
410
 
410
411
  Content(` // LOAD
@@ -431,14 +432,14 @@ const generateLoad: OpGen = (ctx, step: any, index) => {
431
432
 
432
433
  const generateRemove: OpGen = (ctx, step: any, index) => {
433
434
  const { entity, flow } = ctx
434
- const ref = step.input?.ref ?? entity.name + '_ref01'
435
- const entvar = cppVarName(step.input?.entvar ?? ref + '_ent')
436
- const matchvar = cppVarName(step.input?.matchvar ?? (ref + '_match' + (step.input?.suffix ?? '')))
437
- const srcdatavar = cppVarName(step.input?.srcdatavar ?? (ref + '_data'))
435
+ const ref = step.i?.ref ?? entity.name + '_ref01'
436
+ const entvar = cppVarName(step.i?.entvar ?? ref + '_ent')
437
+ const matchvar = cppVarName(step.i?.matchvar ?? (ref + '_match' + (step.i?.suffix ?? '')))
438
+ const srcdatavar = cppVarName(step.i?.srcdatavar ?? (ref + '_data'))
438
439
 
439
- const priorSteps = Object.values(flow.step).slice(0, Number(index)) as any[]
440
+ const priorSteps = Object.values(flowSteps(flow)).slice(0, Number(index)) as any[]
440
441
  const needsEnt = !priorSteps.some((s: any) =>
441
- ['create', 'list', 'load', 'update', 'remove'].includes(s.op))
442
+ ['create', 'list', 'load', 'update', 'remove'].includes(s.o))
442
443
 
443
444
  Content(` // REMOVE
444
445
  `)
@@ -100,8 +100,8 @@ const EntityTypes = cmp(function EntityTypes(props: any) {
100
100
 
101
101
  Content(`// Typed reference models for the ${model.const.Name} SDK.
102
102
  //
103
- // GENERATED from the API model: main.${KIT}.entity.<e>.fields[] and per-op
104
- // params (op.<name>.points[].args.params[]). Field/param types come from the
103
+ // GENERATED from the API model: main.${KIT}.entity.<e>.fields{} and per-op
104
+ // params (op.<name>.points[].g.params[]). Field/param types come from the
105
105
  // canonical type sentinels (source of truth: @voxgig/apidef VALID_CANON). Do
106
106
  // not edit by hand.
107
107
  //
@@ -118,10 +118,10 @@ namespace ${model.const.Name}Sdk.Types;
118
118
  entityList.forEach((ent: any) => {
119
119
  const Name = ent.Name
120
120
  const fields = (ent.fields ? each(ent.fields) : [])
121
- .filter((f: any) => f.active !== false)
121
+ .filter((f: any) => f.a !== false)
122
122
 
123
123
  emitRecord(Name, fields.map((f: any) => ({
124
- name: f.name, type: f.type, optional: false === f.req,
124
+ name: f.n, type: f.t, optional: false === f.r,
125
125
  })), log)
126
126
 
127
127
  const ops = ent.op || {}
@@ -55,7 +55,7 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
55
55
 
56
56
  publishedEntities.map((entity: any) => {
57
57
  const opnames = Object.keys(entity.op || {})
58
- const fields = entity.fields || []
58
+ const fields = Object.values(entity.fields || {})
59
59
  const idF = entityIdField(entity)
60
60
  // Sanitise the local variable name — a camelCased C# keyword gets a
61
61
  // trailing underscore (csVarName) so the snippet compiles.
@@ -102,8 +102,8 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
102
102
  `)
103
103
 
104
104
  each(fields, (field: any) => {
105
- const desc = field.short || ''
106
- Content(`| \`${field.name}\` | \`${canonToType(field.type, target.name)}\` | ${desc} |
105
+ const desc = field.sh || ''
106
+ Content(`| \`${field.n}\` | \`${canonToType(field.t, target.name)}\` | ${desc} |
107
107
  `)
108
108
  })
109
109
 
@@ -114,13 +114,13 @@ On error, \`ok\` is \`false\` and \`err\` contains the error value.
114
114
 
115
115
  `)
116
116
  each(entityList, (ent: any) => {
117
- const fields = ent.fields || []
117
+ const fields = Object.values(ent.fields || {})
118
118
  const opnames = Object.keys(ent.op || {})
119
119
  const ops = ent.op || {}
120
120
  const points = each(ops).map((op: any) =>
121
121
  op.points ? each(op.points) : []
122
122
  ).flat()
123
- const path = points.length > 0 ? (points[0] as any).orig || '' : ''
123
+ const path = points.length > 0 ? (points[0] as any).o || '' : ''
124
124
 
125
125
  Content(`#### ${ent.Name}
126
126
 
@@ -128,7 +128,7 @@ On error, \`ok\` is \`false\` and \`err\` contains the error value.
128
128
  | --- | --- |
129
129
  `)
130
130
  each(fields, (field: any) => {
131
- Content(`| \`${field.name}\` | ${field.short || ''} |
131
+ Content(`| \`${field.n}\` | ${field.sh || ''} |
132
132
  `)
133
133
  })
134
134
 
@@ -171,7 +171,7 @@ Prepare a fetch definition without sending. Returns the \`fetchdef\` and raises
171
171
  // Entity reference sections
172
172
  publishedEntities.map((ent: any) => {
173
173
  const opnames = Object.keys(ent.op || {})
174
- const fields = ent.fields || []
174
+ const fields = Object.values(ent.fields || {})
175
175
  // Model-driven id key: null when this entity has no id-like field.
176
176
  const idF = entityIdField(ent)
177
177
  // Sanitise the local variable name — csVarName guards C# keywords.
@@ -205,9 +205,9 @@ var ${eVar} = client.${ent.Name}();
205
205
  | --- | --- | --- | --- |
206
206
  `)
207
207
  each(fields, (field: any) => {
208
- const req = field.req ? 'Yes' : 'No'
209
- const desc = field.short || ''
210
- Content(`| \`${field.name}\` | \`${canonToType(field.type, target.name)}\` | ${req} | ${desc} |
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 @@ var ${eVar} = client.${ent.Name}();
232
232
  if (fop.active === false) return '-'
233
233
  return 'Yes'
234
234
  })
235
- Content(`| \`${field.name}\` | ${cols.join(' | ')} |
235
+ Content(`| \`${field.n}\` | ${cols.join(' | ')} |
236
236
  `)
237
237
  })
238
238
 
@@ -34,7 +34,7 @@ const Schema = cmp(async function Schema(props: any) {
34
34
  // do not edit by hand.
35
35
  //
36
36
  // Built from the model: \`main.kit.optspec\` and each feature's
37
- // \`config.options\` for Optspec; entity \`fields[].type\` for Entityspec.
37
+ // \`config.options\` for Optspec; entity \`fields{}.type\` for Entityspec.
38
38
 
39
39
  namespace ${model.const.Name}Sdk;
40
40
 
@@ -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.name === snaked || p.name === depluralized) ||
35
+ p.n === snaked || p.n === depluralized) ||
36
36
  params.find((p: any) =>
37
- p.orig === snaked || p.orig === depluralized)
38
- if (param) return '{' + param.name + '}'
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.orig === origSnaked || p.name === origSnaked ||
47
- p.orig === origDepluralized || p.name === origDepluralized
46
+ (p: any) => p.or === origSnaked || p.n === origSnaked ||
47
+ p.or === origDepluralized || p.n === origDepluralized
48
48
  )
49
- if (renamedParam) return '{' + renamedParam.name + '}'
49
+ if (renamedParam) return '{' + renamedParam.n + '}'
50
50
  }
51
51
  }
52
52
  }
@@ -103,8 +103,8 @@ const TestDirect = cmp(function TestDirect(props: any) {
103
103
 
104
104
  // Get load point info
105
105
  const loadPoint = loadOp?.points?.[0]
106
- const loadPath = loadPoint ? normalizePathParams(pointParts(loadPoint), loadPoint?.args?.params || [], loadPoint?.rename?.param) : ''
107
- const allLoadParams = loadPoint?.args?.params || []
106
+ const loadPath = loadPoint ? normalizePathParams(pointParts(loadPoint), loadPoint?.g?.params || [], loadPoint?.r?.param) : ''
107
+ const allLoadParams = loadPoint?.g?.params || []
108
108
  // Only path params that actually appear in the URL template drive direct
109
109
  // path-param setup and URL-substitution asserts.
110
110
  const _pathPlaceholders = new Set<string>()
@@ -113,7 +113,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
113
113
  _pathPlaceholders.add(part.slice(1, -1))
114
114
  }
115
115
  }
116
- const _renameMap = (loadPoint?.rename?.param || {}) as Record<string, string>
116
+ const _renameMap = (loadPoint?.r?.param || {}) as Record<string, string>
117
117
  const _renamedPlaceholders = new Set<string>()
118
118
  for (const ph of _pathPlaceholders) {
119
119
  _renamedPlaceholders.add(ph)
@@ -122,29 +122,29 @@ const TestDirect = cmp(function TestDirect(props: any) {
122
122
  }
123
123
  }
124
124
  const loadParams = allLoadParams.filter((p: any) =>
125
- _renamedPlaceholders.has(p.name) || _renamedPlaceholders.has(p.orig))
125
+ _renamedPlaceholders.has(p.n) || _renamedPlaceholders.has(p.or))
126
126
 
127
127
  // Get list point info
128
128
  const listPoint = listOp?.points?.[0]
129
- const listPath = listPoint ? normalizePathParams(pointParts(listPoint), listPoint?.args?.params || [], listPoint?.rename?.param) : ''
130
- const listParams = listPoint?.args?.params || []
129
+ const listPath = listPoint ? normalizePathParams(pointParts(listPoint), listPoint?.g?.params || [], listPoint?.r?.param) : ''
130
+ const listParams = listPoint?.g?.params || []
131
131
 
132
132
  // Required query params with spec-provided examples - needed in live mode.
133
- const loadQuery = loadPoint?.args?.query || []
133
+ const loadQuery = loadPoint?.g?.query || []
134
134
  const loadLiveQueryEntries = loadQuery
135
- .filter((q: any) => q.reqd && undefined !== q.example && null !== q.example)
135
+ .filter((q: any) => q.r && undefined !== q.ex && null !== q.ex)
136
136
  const loadLiveQueryLines = loadLiveQueryEntries
137
- .map((q: any) => ` query["${q.name}"] = ${formatCsValue(q.example)};`)
137
+ .map((q: any) => ` query["${q.n}"] = ${formatCsValue(q.ex)};`)
138
138
  .join('\n')
139
139
 
140
140
  // Path params with spec-provided examples - when ALL load params have
141
141
  // spec examples, prefer them over list-bootstrap in live mode.
142
142
  const loadAllHaveExamples =
143
143
  loadParams.length > 0 &&
144
- loadParams.every((p: any) => undefined !== p.example && null !== p.example)
144
+ loadParams.every((p: any) => undefined !== p.ex && null !== p.ex)
145
145
  const loadExampleLines = loadAllHaveExamples
146
146
  ? loadParams.map((p: any) =>
147
- ` pathParams["${p.name}"] = ${formatCsValue(p.example)};`).join('\n')
147
+ ` pathParams["${p.n}"] = ${formatCsValue(p.ex)};`).join('\n')
148
148
  : ''
149
149
 
150
150
  const entidEnvVar = `${PROJECTNAME}_TEST_${ENTUPPER}_ENTID`
@@ -168,10 +168,10 @@ public class ${entity.Name}DirectTest
168
168
  if (hasList && listPoint) {
169
169
  // Build live params for list
170
170
  const listLiveParams = listParams.map((p: any) => {
171
- const key = p.name === 'id'
171
+ const key = p.n === 'id'
172
172
  ? entity.name + '01'
173
- : p.name.replace(/_id$/, '') + '01'
174
- return { name: p.name, key }
173
+ : p.n.replace(/_id$/, '') + '01'
174
+ return { name: p.n, key }
175
175
  })
176
176
 
177
177
  const listLiveIdKeys = listParams.length > 0
@@ -297,18 +297,18 @@ ${listSkipBlock} var client = setup.Client;
297
297
  // Generate load test - in live mode, first list to get a real entity ID
298
298
  if (hasLoad && loadPoint) {
299
299
  // Identify ancestor params (not 'id') for live mode
300
- const ancestorParams = loadParams.filter((p: any) => p.name !== 'id')
300
+ const ancestorParams = loadParams.filter((p: any) => p.n !== 'id')
301
301
 
302
302
  let loadLiveIdKeys: string[] = []
303
303
  if (loadParams.length > 0 && !loadAllHaveExamples) {
304
304
  if (hasList) {
305
305
  loadLiveIdKeys = listParams.map((p: any) => {
306
- return p.name === 'id'
306
+ return p.n === 'id'
307
307
  ? entity.name + '01'
308
- : p.name.replace(/_id$/, '') + '01'
308
+ : p.n.replace(/_id$/, '') + '01'
309
309
  })
310
310
  } else {
311
- loadLiveIdKeys = loadParams.map((p: any) => p.name + '01')
311
+ loadLiveIdKeys = loadParams.map((p: any) => p.n + '01')
312
312
  }
313
313
  }
314
314
  const loadSkipBlock = loadLiveIdKeys.length > 0
@@ -362,10 +362,10 @@ ${loadSkipBlock} var client = setup.Client;
362
362
  Content(` var listParams = new Dictionary<string, object?>();
363
363
  `)
364
364
  for (const p of listParams) {
365
- const key = p.name === 'id'
365
+ const key = p.n === 'id'
366
366
  ? entity.name + '01'
367
- : p.name.replace(/_id$/, '') + '01'
368
- Content(` listParams["${p.name}"] = setup.Idmap["${key}"];
367
+ : p.n.replace(/_id$/, '') + '01'
368
+ Content(` listParams["${p.n}"] = setup.Idmap["${key}"];
369
369
  `)
370
370
  }
371
371
 
@@ -390,8 +390,8 @@ ${loadSkipBlock} var client = setup.Client;
390
390
  pathParams["id"] = firstEnt?["id"];
391
391
  `)
392
392
  for (const p of ancestorParams) {
393
- const key = p.name.replace(/_id$/, '') + '01'
394
- Content(` pathParams["${p.name}"] = setup.Idmap["${key}"];
393
+ const key = p.n.replace(/_id$/, '') + '01'
394
+ Content(` pathParams["${p.n}"] = setup.Idmap["${key}"];
395
395
  `)
396
396
  }
397
397
  }
@@ -402,7 +402,7 @@ ${loadSkipBlock} var client = setup.Client;
402
402
  {
403
403
  `)
404
404
  for (let i = 0; i < loadParams.length; i++) {
405
- Content(` pathParams["${loadParams[i].name}"] = "direct0${i + 1}";
405
+ Content(` pathParams["${loadParams[i].n}"] = "direct0${i + 1}";
406
406
  `)
407
407
  }
408
408
  }