@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
  flatten,
@@ -88,10 +89,10 @@ const TestEntity = cmp(function TestEntity(props: any) {
88
89
  const idnames = buildIdNames(entity, basicflow)
89
90
  const idnamesStr = idnames.map(n => `"${n}"`).join(', ')
90
91
 
91
- const allSteps = Object.values(basicflow.step) as any[]
92
- const updateStep = allSteps.find((s: any) => s.op === 'update')
93
- const updateData = updateStep?.data
94
- ? Object.entries(updateStep.data).filter(([k]: any) => k !== 'id' && !k.endsWith('$'))
92
+ const allSteps = Object.values(flowSteps(basicflow)) as any[]
93
+ const updateStep = allSteps.find((s: any) => s.o === 'update')
94
+ const updateData = updateStep?.d
95
+ ? Object.entries(updateStep.d).filter(([k]: any) => k !== 'id' && !k.endsWith('$'))
95
96
  : []
96
97
  const aliases = updateData.map(([k, v]: any) => [k, v])
97
98
 
@@ -153,7 +154,7 @@ ${hasList ? `
153
154
  setup = ${entity.name}_basic_setup(nil)
154
155
  # Per-op sdk-test-control.json skip.
155
156
  _live = setup[:live] || false
156
- [${(Array.from(new Set((allSteps as any[]).map((s: any) => s.op).filter(Boolean)))).map(o => `"${o}"`).join(', ')}].each do |_op|
157
+ [${(Array.from(new Set((allSteps as any[]).map((s: any) => s.o).filter(Boolean)))).map(o => `"${o}"`).join(', ')}].each do |_op|
157
158
  _should_skip, _reason = Runner.is_control_skipped("entityOp", "${entity.name}." + _op, _live ? "live" : "unit")
158
159
  if _should_skip
159
160
  skip(_reason || "skipped via sdk-test-control.json")
@@ -171,7 +172,7 @@ ${hasList ? `
171
172
  `)
172
173
 
173
174
  // Check if the flow has a create step
174
- const flowHasCreate = allSteps.some((s: any) => s.op === 'create')
175
+ const flowHasCreate = allSteps.some((s: any) => s.o === 'create')
175
176
  if (!flowHasCreate) {
176
177
  Content(` # Bootstrap entity data from existing test data.
177
178
  ${entity.name}_ref01_data_raw = Vs.items(Helpers.to_map(
@@ -185,16 +186,16 @@ ${hasList ? `
185
186
  }
186
187
 
187
188
  // Model-driven step iteration
188
- each(basicflow.step, (step: any, index: any) => {
189
+ each(flowSteps(basicflow), (step: any, index: any) => {
189
190
  // Never emit a REMOVE (or its removed-item verify LIST) without a
190
191
  // preceding CREATE: a coherent CRUD flow only removes what it created,
191
192
  // so a create-less remove would mutate pre-existing (live) data.
192
193
  if (!flowHasCreate) {
193
- if ('remove' === step.op) { return }
194
- if ('list' === step.op &&
195
- (step.valid || []).some((v: any) => 'ItemNotExists' === v.apply)) { return }
194
+ if ('remove' === step.o) { return }
195
+ if ('list' === step.o &&
196
+ (step.v || []).some((v: any) => 'ItemNotExists' === v.apply)) { return }
196
197
  }
197
- const opgen: OpGen = GENERATE_OP[step.op]
198
+ const opgen: OpGen = GENERATE_OP[step.o]
198
199
  if (opgen) {
199
200
  opgen(genCtx, step, index)
200
201
  Content('\n')
@@ -294,18 +295,18 @@ end
294
295
 
295
296
  const generateCreate: OpGen = (ctx, step, index) => {
296
297
  const { entity, flow } = ctx
297
- const ref = step.input.ref ?? entity.name + '_ref01'
298
- const entvar = step.input.entvar ?? ref + '_ent'
299
- const datavar = step.input.datavar ?? (ref + '_data' + (step.input.suffix ?? ''))
298
+ const ref = step.i.ref ?? entity.name + '_ref01'
299
+ const entvar = step.i.entvar ?? ref + '_ent'
300
+ const datavar = step.i.datavar ?? (ref + '_data' + (step.i.suffix ?? ''))
300
301
 
301
- const priorSteps = Object.values(flow.step).slice(0, Number(index)) as any[]
302
+ const priorSteps = Object.values(flowSteps(flow)).slice(0, Number(index)) as any[]
302
303
  const needsEnt = !priorSteps.some((s: any) =>
303
- ['create', 'list', 'load', 'update', 'remove'].includes(s.op))
304
+ ['create', 'list', 'load', 'update', 'remove'].includes(s.o))
304
305
 
305
306
  const hasDatvar = priorSteps.some((s: any) => {
306
- if ('create' === s.op) {
307
- const priorRef = s.input.ref ?? entity.name + '_ref01'
308
- const priorDatvar = s.input.datavar ?? (priorRef + '_data' + (s.input.suffix ?? ''))
307
+ if ('create' === s.o) {
308
+ const priorRef = s.i.ref ?? entity.name + '_ref01'
309
+ const priorDatvar = s.i.datavar ?? (priorRef + '_data' + (s.i.suffix ?? ''))
309
310
  return priorDatvar === datavar
310
311
  }
311
312
  return false
@@ -349,14 +350,14 @@ const generateCreate: OpGen = (ctx, step, index) => {
349
350
  const generateList: OpGen = (ctx, step, index) => {
350
351
  const { entity, flow } = ctx
351
352
  const hasDataId = null != entityDataIdField(entity)
352
- const ref = step.input.ref ?? entity.name + '_ref01'
353
- const entvar = step.input.entvar ?? ref + '_ent'
354
- const matchvar = step.input.matchvar ?? (ref + '_match' + (step.input.suffix ?? ''))
355
- const listvar = step.input.listvar ?? (ref + '_list' + (step.input.suffix ?? ''))
353
+ const ref = step.i.ref ?? entity.name + '_ref01'
354
+ const entvar = step.i.entvar ?? ref + '_ent'
355
+ const matchvar = step.i.matchvar ?? (ref + '_match' + (step.i.suffix ?? ''))
356
+ const listvar = step.i.listvar ?? (ref + '_list' + (step.i.suffix ?? ''))
356
357
 
357
- const priorSteps = Object.values(flow.step).slice(0, Number(index)) as any[]
358
+ const priorSteps = Object.values(flowSteps(flow)).slice(0, Number(index)) as any[]
358
359
  const needsEnt = !priorSteps.some((s: any) =>
359
- ['create', 'list', 'load', 'update', 'remove'].includes(s.op))
360
+ ['create', 'list', 'load', 'update', 'remove'].includes(s.o))
360
361
 
361
362
  Content(` # LIST
362
363
  `)
@@ -386,12 +387,12 @@ const generateList: OpGen = (ctx, step, index) => {
386
387
  `)
387
388
 
388
389
  // Handle validators
389
- const allSteps = Object.values(flow.step) as any[]
390
- if (step.valid) {
391
- for (const validator of step.valid) {
390
+ const allSteps = Object.values(flowSteps(flow)) as any[]
391
+ if (step.v) {
392
+ for (const validator of step.v) {
392
393
  const validRef = validator.def?.ref
393
- const hasRefData = validRef && allSteps.some((s: any) => 'create' === s.op &&
394
- ((s.input.ref ?? entity.name + '_ref01') === validRef))
394
+ const hasRefData = validRef && allSteps.some((s: any) => 'create' === s.o &&
395
+ ((s.i.ref ?? entity.name + '_ref01') === validRef))
395
396
 
396
397
  if ('ItemExists' === validator.apply && hasRefData && hasDataId) {
397
398
  const refDataVar = validRef + '_data'
@@ -417,16 +418,16 @@ const generateList: OpGen = (ctx, step, index) => {
417
418
 
418
419
  const generateUpdate: OpGen = (ctx, step, index) => {
419
420
  const { entity, flow } = ctx
420
- const ref = step.input.ref ?? entity.name + '_ref01'
421
- const entvar = step.input.entvar ?? ref + '_ent'
422
- const datavar = step.input.datavar ?? (ref + '_data' + (step.input.suffix ?? ''))
423
- const resdatavar = step.input.resdatavar ?? (ref + '_resdata' + (step.input.suffix ?? ''))
424
- const markdefvar = step.input.markdefvar ?? (ref + '_markdef' + (step.input.suffix ?? ''))
425
- const srcdatavar = step.input.srcdatavar ?? (ref + '_data' + (step.input.suffix ?? ''))
426
-
427
- const priorSteps = Object.values(flow.step).slice(0, Number(index)) as any[]
421
+ const ref = step.i.ref ?? entity.name + '_ref01'
422
+ const entvar = step.i.entvar ?? ref + '_ent'
423
+ const datavar = step.i.datavar ?? (ref + '_data' + (step.i.suffix ?? ''))
424
+ const resdatavar = step.i.resdatavar ?? (ref + '_resdata' + (step.i.suffix ?? ''))
425
+ const markdefvar = step.i.markdefvar ?? (ref + '_markdef' + (step.i.suffix ?? ''))
426
+ const srcdatavar = step.i.srcdatavar ?? (ref + '_data' + (step.i.suffix ?? ''))
427
+
428
+ const priorSteps = Object.values(flowSteps(flow)).slice(0, Number(index)) as any[]
428
429
  const needsEnt = !priorSteps.some((s: any) =>
429
- ['create', 'list', 'load', 'update', 'remove'].includes(s.op))
430
+ ['create', 'list', 'load', 'update', 'remove'].includes(s.o))
430
431
 
431
432
  const hasEntIdU = null != entity.id
432
433
 
@@ -443,8 +444,8 @@ const generateUpdate: OpGen = (ctx, step, index) => {
443
444
  `)
444
445
  }
445
446
 
446
- if (step.data) {
447
- const dataEntries = Object.entries(step.data).filter(([k]: any) => k !== 'id' && !k.endsWith('$'))
447
+ if (step.d) {
448
+ const dataEntries = Object.entries(step.d).filter(([k]: any) => k !== 'id' && !k.endsWith('$'))
448
449
  for (const [key] of dataEntries) {
449
450
  Content(` "${key}" => setup[:idmap]["${key}"],
450
451
  `)
@@ -454,10 +455,10 @@ const generateUpdate: OpGen = (ctx, step, index) => {
454
455
  Content(` }
455
456
  `)
456
457
 
457
- if (step.spec) {
458
- for (const spec of step.spec) {
459
- if ('TextFieldMark' === spec.apply && null != step.input.textfield) {
460
- const fieldname = step.input.textfield
458
+ if (step.s) {
459
+ for (const spec of step.s) {
460
+ if ('TextFieldMark' === spec.apply && null != step.i.textfield) {
461
+ const fieldname = step.i.textfield
461
462
  const fieldvalue = spec.def?.mark ?? `Mark01-${ref}`
462
463
  Content(`
463
464
  ${markdefvar}_name = "${fieldname}"
@@ -478,9 +479,9 @@ const generateUpdate: OpGen = (ctx, step, index) => {
478
479
  `)
479
480
  }
480
481
 
481
- if (step.spec) {
482
- for (const spec of step.spec) {
483
- if ('TextFieldMark' === spec.apply && null != step.input.textfield) {
482
+ if (step.s) {
483
+ for (const spec of step.s) {
484
+ if ('TextFieldMark' === spec.apply && null != step.i.textfield) {
484
485
  Content(` assert_equal ${resdatavar}[${markdefvar}_name], ${markdefvar}_value
485
486
  `)
486
487
  }
@@ -491,23 +492,23 @@ const generateUpdate: OpGen = (ctx, step, index) => {
491
492
 
492
493
  const generateLoad: OpGen = (ctx, step, index) => {
493
494
  const { entity, flow } = ctx
494
- const ref = step.input.ref ?? entity.name + '_ref01'
495
- const entvar = step.input.entvar ?? ref + '_ent'
496
- const matchvar = step.input.matchvar ?? (ref + '_match' + (step.input.suffix ?? ''))
497
- const datavar = step.input.datavar ?? (ref + '_data' + (step.input.suffix ?? ''))
498
- const srcdatavar = step.input.srcdatavar ?? (ref + '_data' + (step.input.suffix ?? ''))
495
+ const ref = step.i.ref ?? entity.name + '_ref01'
496
+ const entvar = step.i.entvar ?? ref + '_ent'
497
+ const matchvar = step.i.matchvar ?? (ref + '_match' + (step.i.suffix ?? ''))
498
+ const datavar = step.i.datavar ?? (ref + '_data' + (step.i.suffix ?? ''))
499
+ const srcdatavar = step.i.srcdatavar ?? (ref + '_data' + (step.i.suffix ?? ''))
499
500
 
500
- const priorSteps = Object.values(flow.step).slice(0, Number(index)) as any[]
501
+ const priorSteps = Object.values(flowSteps(flow)).slice(0, Number(index)) as any[]
501
502
  const hasEntVar = priorSteps.some((s: any) =>
502
- ['create', 'list', 'load', 'update', 'remove'].includes(s.op))
503
+ ['create', 'list', 'load', 'update', 'remove'].includes(s.o))
503
504
 
504
- const flowHasCreate = Object.values(flow.step).some((s: any) => (s as any).op === 'create')
505
+ const flowHasCreate = Object.values(flowSteps(flow)).some((s: any) => (s as any).o === 'create')
505
506
  const preambleRef = entity.name + '_ref01'
506
507
  const hasSrcData = (!flowHasCreate && srcdatavar === (preambleRef + '_data')) ||
507
508
  priorSteps.some((s: any) => {
508
- if ('create' === s.op) {
509
- const priorRef = s.input.ref ?? entity.name + '_ref01'
510
- const priorDatvar = s.input.datavar ?? (priorRef + '_data' + (s.input.suffix ?? ''))
509
+ if ('create' === s.o) {
510
+ const priorRef = s.i.ref ?? entity.name + '_ref01'
511
+ const priorDatvar = s.i.datavar ?? (priorRef + '_data' + (s.i.suffix ?? ''))
511
512
  return priorDatvar === srcdatavar
512
513
  }
513
514
  return false
@@ -554,14 +555,14 @@ const generateRemove: OpGen = (ctx, step, index) => {
554
555
  if (null == entityDataIdField(entity)) {
555
556
  return
556
557
  }
557
- const ref = step.input.ref ?? entity.name + '_ref01'
558
- const entvar = step.input.entvar ?? ref + '_ent'
559
- const matchvar = step.input.matchvar ?? (ref + '_match' + (step.input.suffix ?? ''))
560
- const srcdatavar = step.input.srcdatavar ?? (ref + '_data')
558
+ const ref = step.i.ref ?? entity.name + '_ref01'
559
+ const entvar = step.i.entvar ?? ref + '_ent'
560
+ const matchvar = step.i.matchvar ?? (ref + '_match' + (step.i.suffix ?? ''))
561
+ const srcdatavar = step.i.srcdatavar ?? (ref + '_data')
561
562
 
562
- const priorSteps = Object.values(flow.step).slice(0, Number(index)) as any[]
563
+ const priorSteps = Object.values(flowSteps(flow)).slice(0, Number(index)) as any[]
563
564
  const needsEnt = !priorSteps.some((s: any) =>
564
- ['create', 'list', 'load', 'update', 'remove'].includes(s.op))
565
+ ['create', 'list', 'load', 'update', 'remove'].includes(s.o))
565
566
 
566
567
  Content(` # REMOVE
567
568
  `)
@@ -67,8 +67,8 @@ const EntityTypes = cmp(function EntityTypes(props: any) {
67
67
 
68
68
  Content(`// Typed models for the ${model.const.Name} SDK.
69
69
  //
70
- // GENERATED from the API model: main.${KIT}.entity.<e>.fields[] and per-op
71
- // params (op.<name>.points[].args.params[]). Field/param types are mapped
70
+ // GENERATED from the API model: main.${KIT}.entity.<e>.fields{} and per-op
71
+ // params (op.<name>.points[].g.params[]). Field/param types are mapped
72
72
  // from the canonical type sentinels. Do not edit by hand.
73
73
  //
74
74
  // These are DOCUMENTARY: the SDK runtime is dynamic (ops take/return the
@@ -83,12 +83,12 @@ use crate::utility::voxgigstruct::Value;
83
83
  entityList.forEach((ent: any) => {
84
84
  const Name = ent.Name
85
85
  const fields = (ent.fields ? each(ent.fields) : [])
86
- .filter((f: any) => f.active !== false)
86
+ .filter((f: any) => f.a !== false)
87
87
 
88
88
  emitStruct(
89
89
  `/// ${Name} is the typed data model for the ${ent.name} entity.`,
90
90
  Name,
91
- fields.map((f: any) => ({ name: f.name, type: f.type, optional: false === f.req }))
91
+ fields.map((f: any) => ({ name: f.n, type: f.t, optional: false === f.r }))
92
92
  )
93
93
 
94
94
  const ops = ent.op || {}
@@ -53,7 +53,7 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
53
53
 
54
54
  publishedEntities.map((entity: any) => {
55
55
  const opnames = Object.keys(entity.op || {})
56
- const fields = entity.fields || []
56
+ const fields = Object.values(entity.fields || {})
57
57
  const idF = entityIdField(entity)
58
58
  const eVar = rustVarName(entity.name)
59
59
  const method = rustMethodName(entity.name)
@@ -99,8 +99,8 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
99
99
  `)
100
100
 
101
101
  each(fields, (field: any) => {
102
- const desc = field.short || ''
103
- Content(`| \`${field.name}\` | \`${canonToType(field.type, target.name)}\` | ${desc} |
102
+ const desc = field.sh || ''
103
+ Content(`| \`${field.n}\` | \`${canonToType(field.t, target.name)}\` | ${desc} |
104
104
  `)
105
105
  })
106
106
 
@@ -119,13 +119,13 @@ On error, \`ok\` is \`false\` and \`err\` carries the error value.
119
119
 
120
120
  `)
121
121
  each(entityList, (ent: any) => {
122
- const fields = ent.fields || []
122
+ const fields = Object.values(ent.fields || {})
123
123
  const opnames = Object.keys(ent.op || {})
124
124
  const ops = ent.op || {}
125
125
  const points = each(ops).map((op: any) =>
126
126
  op.points ? each(op.points) : []
127
127
  ).flat()
128
- const path = points.length > 0 ? (points[0] as any).orig || '' : ''
128
+ const path = points.length > 0 ? (points[0] as any).o || '' : ''
129
129
 
130
130
  Content(`#### ${ent.Name}
131
131
 
@@ -133,7 +133,7 @@ On error, \`ok\` is \`false\` and \`err\` carries the error value.
133
133
  | --- | --- |
134
134
  `)
135
135
  each(fields, (field: any) => {
136
- Content(`| \`${field.name}\` | ${field.short || ''} |
136
+ Content(`| \`${field.n}\` | ${field.sh || ''} |
137
137
  `)
138
138
  })
139
139
 
@@ -166,7 +166,7 @@ Prepare a fetch definition without sending. Returns the fetchdef on \`Ok\`.
166
166
  // Entity reference sections
167
167
  publishedEntities.map((ent: any) => {
168
168
  const opnames = Object.keys(ent.op || {})
169
- const fields = ent.fields || []
169
+ const fields = Object.values(ent.fields || {})
170
170
  const idF = entityIdField(ent)
171
171
  const eVar = rustVarName(ent.name)
172
172
  const method = rustMethodName(ent.name)
@@ -199,9 +199,9 @@ let ${eVar} = client.${method}(Value::Noval);
199
199
  | --- | --- | --- | --- |
200
200
  `)
201
201
  each(fields, (field: any) => {
202
- const req = field.req ? 'Yes' : 'No'
203
- const desc = field.short || ''
204
- Content(`| \`${field.name}\` | \`${canonToType(field.type, target.name)}\` | ${req} | ${desc} |
202
+ const req = field.r ? 'Yes' : 'No'
203
+ const desc = field.sh || ''
204
+ Content(`| \`${field.n}\` | \`${canonToType(field.t, target.name)}\` | ${req} | ${desc} |
205
205
  `)
206
206
  })
207
207
 
@@ -226,7 +226,7 @@ let ${eVar} = client.${method}(Value::Noval);
226
226
  if (fop.active === false) return '-'
227
227
  return 'Yes'
228
228
  })
229
- Content(`| \`${field.name}\` | ${cols.join(' | ')} |
229
+ Content(`| \`${field.n}\` | ${cols.join(' | ')} |
230
230
  `)
231
231
  })
232
232
 
@@ -33,7 +33,7 @@ const Schema = cmp(async function Schema(props: any) {
33
33
  Content(`// ${model.const.Name} SDK: generated schemas. Do not edit.
34
34
  //
35
35
  // Built from the model: \`main.kit.optspec\` and each feature's
36
- // \`config.options\` for the option spec; entity \`fields[].type\` for the
36
+ // \`config.options\` for the option spec; entity \`fields{}.type\` for the
37
37
  // entity specs.
38
38
 
39
39
  use crate::utility::jsonparse::json_parse;
@@ -33,10 +33,10 @@ function normalizePathParams(
33
33
  const snaked = snakify(rawName)
34
34
  const depluralized = depluralize(snaked)
35
35
  const param = params.find((p: any) =>
36
- p.name === snaked || p.name === depluralized) ||
36
+ p.n === snaked || p.n === depluralized) ||
37
37
  params.find((p: any) =>
38
- p.orig === snaked || p.orig === depluralized)
39
- if (param) return '{' + param.name + '}'
38
+ p.or === snaked || p.or === depluralized)
39
+ if (param) return '{' + param.n + '}'
40
40
 
41
41
  if (rename) {
42
42
  for (const [origCamel, renamedTo] of Object.entries(rename)) {
@@ -44,10 +44,10 @@ function normalizePathParams(
44
44
  const origSnaked = snakify(origCamel)
45
45
  const origDepluralized = depluralize(origSnaked)
46
46
  const renamedParam = params.find(
47
- (p: any) => p.orig === origSnaked || p.name === origSnaked ||
48
- p.orig === origDepluralized || p.name === origDepluralized
47
+ (p: any) => p.or === origSnaked || p.n === origSnaked ||
48
+ p.or === origDepluralized || p.n === origDepluralized
49
49
  )
50
- if (renamedParam) return '{' + renamedParam.name + '}'
50
+ if (renamedParam) return '{' + renamedParam.n + '}'
51
51
  }
52
52
  }
53
53
  }
@@ -98,8 +98,8 @@ const TestDirect = cmp(function TestDirect(props: any) {
98
98
 
99
99
  // Load point info.
100
100
  const loadPoint = loadOp?.points?.[0]
101
- const loadPath = loadPoint ? normalizePathParams(pointParts(loadPoint), loadPoint?.args?.params || [], loadPoint?.rename?.param) : ''
102
- const allLoadParams = loadPoint?.args?.params || []
101
+ const loadPath = loadPoint ? normalizePathParams(pointParts(loadPoint), loadPoint?.g?.params || [], loadPoint?.r?.param) : ''
102
+ const allLoadParams = loadPoint?.g?.params || []
103
103
  // Only path params that actually appear in the URL template drive the
104
104
  // direct-test path-param setup and URL-substitution asserts.
105
105
  const _pathPlaceholders = new Set<string>()
@@ -108,7 +108,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
108
108
  _pathPlaceholders.add(part.slice(1, -1))
109
109
  }
110
110
  }
111
- const _renameMap = (loadPoint?.rename?.param || {}) as Record<string, string>
111
+ const _renameMap = (loadPoint?.r?.param || {}) as Record<string, string>
112
112
  const _renamedPlaceholders = new Set<string>()
113
113
  for (const ph of _pathPlaceholders) {
114
114
  _renamedPlaceholders.add(ph)
@@ -117,12 +117,12 @@ const TestDirect = cmp(function TestDirect(props: any) {
117
117
  }
118
118
  }
119
119
  const loadParams = allLoadParams.filter((p: any) =>
120
- _renamedPlaceholders.has(p.name) || _renamedPlaceholders.has(p.orig))
120
+ _renamedPlaceholders.has(p.n) || _renamedPlaceholders.has(p.or))
121
121
 
122
122
  // List point info.
123
123
  const listPoint = listOp?.points?.[0]
124
- const listPath = listPoint ? normalizePathParams(pointParts(listPoint), listPoint?.args?.params || [], listPoint?.rename?.param) : ''
125
- const listParams = listPoint?.args?.params || []
124
+ const listPath = listPoint ? normalizePathParams(pointParts(listPoint), listPoint?.g?.params || [], listPoint?.r?.param) : ''
125
+ const listParams = listPoint?.g?.params || []
126
126
 
127
127
  const entidEnvVar = `${PROJECTNAME}_TEST_${envToken(entity.name)}_ENTID`
128
128
 
@@ -224,10 +224,10 @@ fn ${evar}_direct_setup(mockres: Value) -> ${entity.Name}DirectSetup {
224
224
  if (hasList && listPoint) {
225
225
  // Live params: idmap keys per param.
226
226
  const listLiveParams = listParams.map((p: any) => {
227
- const key = p.name === 'id'
227
+ const key = p.n === 'id'
228
228
  ? entity.name + '01'
229
- : p.name.replace(/_id$/, '') + '01'
230
- return { name: p.name, key }
229
+ : p.n.replace(/_id$/, '') + '01'
230
+ return { name: p.n, key }
231
231
  })
232
232
 
233
233
  Content(`
@@ -345,10 +345,10 @@ fn ${evar}_direct_list() {
345
345
  if (hasLoad && loadPoint) {
346
346
  // idmap keys consumed by load in live mode.
347
347
  const loadLiveParams = loadParams.map((p: any) => {
348
- const key = p.name === 'id'
348
+ const key = p.n === 'id'
349
349
  ? entity.name + '01'
350
- : p.name.replace(/_id$/, '') + '01'
351
- return { name: p.name, key }
350
+ : p.n.replace(/_id$/, '') + '01'
351
+ return { name: p.n, key }
352
352
  })
353
353
 
354
354
  Content(`