@voxgig/sdkgen 4.37.0 → 4.39.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 (134) hide show
  1. package/bin/voxgig-sdkgen +13 -2
  2. package/dist/action/copies.d.ts +6 -1
  3. package/dist/action/copies.js +43 -1
  4. package/dist/action/copies.js.map +1 -1
  5. package/dist/action/doctor.d.ts +2 -0
  6. package/dist/action/doctor.js +25 -6
  7. package/dist/action/doctor.js.map +1 -1
  8. package/dist/action/edition.js +3 -0
  9. package/dist/action/edition.js.map +1 -1
  10. package/dist/action/feature.js +3 -0
  11. package/dist/action/feature.js.map +1 -1
  12. package/dist/action/package.js +15 -0
  13. package/dist/action/package.js.map +1 -1
  14. package/dist/action/target.js +3 -0
  15. package/dist/action/target.js.map +1 -1
  16. package/dist/helpers/copymerge.d.ts +35 -0
  17. package/dist/helpers/copymerge.js +508 -0
  18. package/dist/helpers/copymerge.js.map +1 -0
  19. package/dist/helpers/flowGuard.js +4 -4
  20. package/dist/helpers/flowGuard.js.map +1 -1
  21. package/dist/helpers/liveDiscovery.d.ts +7 -0
  22. package/dist/helpers/liveDiscovery.js +20 -0
  23. package/dist/helpers/liveDiscovery.js.map +1 -0
  24. package/dist/helpers/opShape.d.ts +2 -1
  25. package/dist/helpers/opShape.js +4 -0
  26. package/dist/helpers/opShape.js.map +1 -1
  27. package/dist/helpers/pointPath.d.ts +2 -1
  28. package/dist/helpers/pointPath.js +6 -0
  29. package/dist/helpers/pointPath.js.map +1 -1
  30. package/dist/helpers/testPolicy.d.ts +14 -4
  31. package/dist/helpers/testPolicy.js +152 -54
  32. package/dist/helpers/testPolicy.js.map +1 -1
  33. package/dist/sdkgen.d.ts +8 -6
  34. package/dist/sdkgen.js +11 -5
  35. package/dist/sdkgen.js.map +1 -1
  36. package/dist/tsconfig.tsbuildinfo +1 -1
  37. package/dist/types.d.ts +1 -0
  38. package/dist/utility.js +7 -3
  39. package/dist/utility.js.map +1 -1
  40. package/model/sdkgen.aontu +4 -0
  41. package/package.json +1 -1
  42. package/project/.sdk/src/cmp/c/TestDirect_c.ts +3 -2
  43. package/project/.sdk/src/cmp/cpp/TestDirect_cpp.ts +3 -2
  44. package/project/.sdk/src/cmp/cpp/TestEntity_cpp.ts +33 -10
  45. package/project/.sdk/src/cmp/csharp/TestDirect_csharp.ts +12 -12
  46. package/project/.sdk/src/cmp/csharp/TestEntity_csharp.ts +73 -28
  47. package/project/.sdk/src/cmp/go/TestDirect_go.ts +12 -10
  48. package/project/.sdk/src/cmp/go/TestEntity_go.ts +67 -23
  49. package/project/.sdk/src/cmp/java/TestDirect_java.ts +12 -11
  50. package/project/.sdk/src/cmp/java/TestEntity_java.ts +71 -23
  51. package/project/.sdk/src/cmp/js/TestDirect_js.ts +13 -12
  52. package/project/.sdk/src/cmp/js/TestEntity_js.ts +41 -17
  53. package/project/.sdk/src/cmp/kotlin/TestDirect_kotlin.ts +12 -10
  54. package/project/.sdk/src/cmp/kotlin/TestEntity_kotlin.ts +64 -23
  55. package/project/.sdk/src/cmp/lua/TestDirect_lua.ts +9 -5
  56. package/project/.sdk/src/cmp/lua/TestEntity_lua.ts +61 -23
  57. package/project/.sdk/src/cmp/perl/TestDirect_perl.ts +9 -5
  58. package/project/.sdk/src/cmp/perl/TestEntity_perl.ts +58 -24
  59. package/project/.sdk/src/cmp/php/TestDirect_php.ts +9 -5
  60. package/project/.sdk/src/cmp/php/TestEntity_php.ts +61 -23
  61. package/project/.sdk/src/cmp/py/TestDirect_py.ts +10 -6
  62. package/project/.sdk/src/cmp/py/TestEntity_py.ts +59 -27
  63. package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +9 -5
  64. package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +59 -23
  65. package/project/.sdk/src/cmp/rust/TestDirect_rust.ts +9 -8
  66. package/project/.sdk/src/cmp/rust/TestEntity_rust.ts +56 -24
  67. package/project/.sdk/src/cmp/scala/TestDirect_scala.ts +3 -2
  68. package/project/.sdk/src/cmp/scala/TestEntity_scala.ts +36 -9
  69. package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +15 -32
  70. package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +41 -17
  71. package/project/.sdk/tm/c/tests/transport_test.c +33 -0
  72. package/project/.sdk/tm/c/utility/fetcher.c +151 -2
  73. package/project/.sdk/tm/c/utility/make_url.c +8 -6
  74. package/project/.sdk/tm/clojure/src/sdk/core.clj +17 -10
  75. package/project/.sdk/tm/clojure/test/sdk/test/pipeline.clj +38 -0
  76. package/project/.sdk/tm/cpp/utility/pipeline.hpp +5 -4
  77. package/project/.sdk/tm/csharp/test/PrimaryUtilityTest.cs +69 -0
  78. package/project/.sdk/tm/csharp/utility/Fetcher.cs +3 -1
  79. package/project/.sdk/tm/csharp/utility/MakeUrl.cs +5 -4
  80. package/project/.sdk/tm/elixir/lib/projectname/utility.ex +10 -6
  81. package/project/.sdk/tm/elixir/test/pipeline_test.exs +61 -0
  82. package/project/.sdk/tm/go/test/primary_utility_test.go +60 -0
  83. package/project/.sdk/tm/go/utility/fetcher.go +15 -4
  84. package/project/.sdk/tm/go/utility/make_url.go +4 -3
  85. package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +47 -0
  86. package/project/.sdk/tm/java/utility/MakeUrl.java +5 -4
  87. package/project/.sdk/tm/js/src/utility/MakeUrlUtility.js +5 -3
  88. package/project/.sdk/tm/js/test/live-runner.js +4 -3
  89. package/project/.sdk/tm/js/test/utility/PrimaryUtility.test.js +40 -0
  90. package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +41 -0
  91. package/project/.sdk/tm/kotlin/utility/MakeSpecUrl.kt +4 -3
  92. package/project/.sdk/tm/lua/test/primary_utility_test.lua +61 -0
  93. package/project/.sdk/tm/lua/utility/fetcher.lua +54 -6
  94. package/project/.sdk/tm/lua/utility/make_url.lua +5 -4
  95. package/project/.sdk/tm/ocaml/sdk_runtime.ml +5 -5
  96. package/project/.sdk/tm/perl/t/primary_utility.t +54 -0
  97. package/project/.sdk/tm/perl/utility/fetcher.pm +65 -11
  98. package/project/.sdk/tm/perl/utility/make_url.pm +4 -3
  99. package/project/.sdk/tm/php/test/PipelineTest.php +52 -0
  100. package/project/.sdk/tm/php/utility/Fetcher.php +81 -15
  101. package/project/.sdk/tm/php/utility/MakeUrl.php +5 -3
  102. package/project/.sdk/tm/py/pkg/utility/fetcher.py +1 -0
  103. package/project/.sdk/tm/py/pkg/utility/make_url.py +5 -4
  104. package/project/.sdk/tm/py/test/test_primary_utility.py +52 -0
  105. package/project/.sdk/tm/rb/test/primary_utility_test.rb +46 -0
  106. package/project/.sdk/tm/rb/utility/fetcher.rb +41 -5
  107. package/project/.sdk/tm/rb/utility/make_url.rb +5 -3
  108. package/project/.sdk/tm/rust/tests/primary_utility_test.rs +65 -0
  109. package/project/.sdk/tm/rust/utility/make_url.rs +7 -6
  110. package/project/.sdk/tm/scala/sdktest/SdkTestMain.scala +47 -1
  111. package/project/.sdk/tm/scala/utility/Make.scala +8 -6
  112. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Fetcher.swift +59 -15
  113. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Make.swift +4 -4
  114. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +72 -0
  115. package/project/.sdk/tm/ts/src/utility/MakeUrlUtility.ts +5 -3
  116. package/project/.sdk/tm/ts/test/live-runner.ts +4 -3
  117. package/project/.sdk/tm/ts/test/utility/PrimaryUtility.test.ts +40 -0
  118. package/project/.sdk/tm/zig/core/utility.zig +5 -5
  119. package/project/sdkgen-package.json +1 -1
  120. package/src/action/copies.ts +54 -0
  121. package/src/action/doctor.ts +36 -7
  122. package/src/action/edition.ts +9 -1
  123. package/src/action/feature.ts +7 -1
  124. package/src/action/package.ts +28 -1
  125. package/src/action/target.ts +7 -1
  126. package/src/helpers/copymerge.ts +707 -0
  127. package/src/helpers/flowGuard.ts +4 -4
  128. package/src/helpers/liveDiscovery.ts +31 -0
  129. package/src/helpers/opShape.ts +6 -0
  130. package/src/helpers/pointPath.ts +8 -0
  131. package/src/helpers/testPolicy.ts +193 -55
  132. package/src/sdkgen.ts +13 -3
  133. package/src/types.ts +2 -0
  134. package/src/utility.ts +10 -4
@@ -15,6 +15,7 @@ import {
15
15
  serverVarEnv,
16
16
  serverVariables, envName, envToken, liveStrict, liveStrictNote,
17
17
  pointParts,
18
+ pointSlash,
18
19
  pointPlaceholders,
19
20
  pointIsGraphql,
20
21
  primaryPoint,
@@ -23,6 +24,7 @@ import {
23
24
  liveEntity,
24
25
  liveGetOnlyReason, LIVE_GETONLY_ENV,
25
26
  liveDirectGetOnly, liveExcludedLines, liveExcludedSummary,
27
+ liveDirectDiscovery,
26
28
  } from '@voxgig/sdkgen'
27
29
 
28
30
 
@@ -117,7 +119,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
117
119
  const loadPoint = null == loadOp?.points ? undefined :
118
120
  primaryPoint(loadOp.points, entity.name, 'load')
119
121
  const loadIsGraphql = pointIsGraphql(loadPoint)
120
- const loadPath = loadPoint ? normalizePathParams(pointParts(loadPoint), loadPoint?.g?.params || [], loadPoint?.r?.param) : ''
122
+ const loadPath = loadPoint ? normalizePathParams(pointParts(loadPoint), loadPoint?.g?.params || [], loadPoint?.r?.param) + pointSlash(loadPoint) : ''
121
123
  const allLoadParams = loadPoint?.g?.params || []
122
124
  // Some upstream OpenAPI specs declare a parameter as `in: path` even when
123
125
  // that path has no `{name}` placeholder for it. Only path params that
@@ -139,7 +141,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
139
141
  const listPoint = null == listOp?.points ? undefined :
140
142
  primaryPoint(listOp.points, entity.name, 'list')
141
143
  const listIsGraphql = pointIsGraphql(listPoint)
142
- const listPath = listPoint ? normalizePathParams(pointParts(listPoint), listPoint?.g?.params || [], listPoint?.r?.param) : ''
144
+ const listPath = listPoint ? normalizePathParams(pointParts(listPoint), listPoint?.g?.params || [], listPoint?.r?.param) + pointSlash(listPoint) : ''
143
145
  const listParams = listPoint?.g?.params || []
144
146
 
145
147
  const liveQueryLines = (point: any) => liveQueryExamples(point)
@@ -359,13 +361,14 @@ ${listLiveQueryLines}
359
361
  `"${p.n}": "direct0${i + 1}"`).join(', ')
360
362
  : ''
361
363
 
362
- const ancestorParams = loadParams.filter((p: any) => p.n !== 'id')
364
+ const discovery = liveDirectDiscovery(entity, loadParams, listPoint)
365
+ const ancestorParams = loadParams.filter((p: any) => p.n !== discovery?.param)
363
366
 
364
367
  const liveKey = (p: any) => p.n === 'id' ? entity.name + '01' : p.n.replace(/_id$/, '') + '01'
365
368
  let loadLiveIdKeys: string[] = []
366
369
  if (loadParams.length > 0 && !loadAllHaveExamples) {
367
- loadLiveIdKeys = [...new Set((hasList ?
368
- [...listParams, ...loadParams.filter((p: any) => p.n !== 'id')] : loadParams).map(liveKey))]
370
+ loadLiveIdKeys = [...new Set((discovery ?
371
+ [...listParams, ...ancestorParams] : loadParams).map(liveKey))]
369
372
  }
370
373
  const loadSkipBlock = getOnlyKeysBlock(model, entity, 'direct-load-' + entity.name, loadLiveIdKeys) +
371
374
  (loadLiveIdKeys.length > 0
@@ -414,7 +417,7 @@ ${loadSkipBlock} client := setup.client
414
417
 
415
418
  if (loadAllHaveExamples) {
416
419
  Content(loadExampleLines + '\n')
417
- } else if (hasList && loadParams.length > 0) {
420
+ } else if (discovery) {
418
421
  Content(` listParams := map[string]any{}
419
422
  `)
420
423
  for (const p of listParams) {
@@ -444,14 +447,13 @@ ${loadSkipBlock} client := setup.client
444
447
  liveEmpty(t, "The account has no ${entity.name} record to load")
445
448
  }
446
449
  firstEnt := core.ToMapAny(listData[0])
447
- if firstEnt["id"] == nil {
450
+ if firstEnt[${JSON.stringify(discovery.field)}] == nil {
448
451
  liveMiss(t, ${strictConst}, "Live load blocked: discovery returned no usable identity")
449
452
  }
450
- params["id"] = firstEnt["id"]
453
+ params[${JSON.stringify(discovery.param)}] = firstEnt[${JSON.stringify(discovery.field)}]
451
454
  `)
452
455
  for (const p of ancestorParams) {
453
- const key = p.n.replace(/_id$/, '') + '01'
454
- Content(` params["${p.n}"] = setup.idmap["${key}"]
456
+ Content(` params["${p.n}"] = setup.idmap["${liveKey(p)}"]
455
457
  `)
456
458
  }
457
459
  } else if (loadParams.length > 0) {
@@ -27,11 +27,11 @@ import {
27
27
  isAuthActive,
28
28
  serverVarEnv,
29
29
  serverVariables,
30
- entityDataIdField, envName, envToken,
30
+ entityDataIdField, entityRecordIdField, envName, envToken,
31
31
  invalidRequest,
32
32
  liveFlowNeeds, liveStrict, liveStrictNote,
33
33
  liveRouteExamples, liveStepExamples, flowLoadRoute, flowLoadReadsRecord,
34
- liveGetOnly, liveExcludedLines, liveExcludedSummary, LIVE_GETONLY_ENV,
34
+ liveGates, liveExcludedLines, liveExcludedSummary, LIVE_GETONLY_ENV,
35
35
  liveEntity,
36
36
  } from '@voxgig/sdkgen'
37
37
 
@@ -268,19 +268,18 @@ ${failureTests(model, entity)}` : ''}${validateTest(model, entity)}
268
268
  })
269
269
  }
270
270
 
271
- const getOnly = liveGetOnly(entity, basicflow)
272
- if (null != getOnly) {
273
- Content(` if setup.live && os.Getenv(${JSON.stringify(LIVE_GETONLY_ENV)}) == "TRUE" {
274
- ${liveExcludedLines(getOnly).map((line) => '\t\t\tt.Log(' + JSON.stringify(line) + ')\n').join('')}`)
275
- if (0 === flowSteps(getOnly.flow).length) {
276
- Content(` t.Skip(${JSON.stringify(liveExcludedSummary(getOnly))})
271
+ for (const { getOnly, plan, runs } of liveGates(entity, basicflow)) {
272
+ Content(` if setup.live${getOnly ? ` && os.Getenv(${JSON.stringify(LIVE_GETONLY_ENV)}) == "TRUE"` : ''} {
273
+ ${liveExcludedLines(plan).map((line) => '\t\t\tt.Log(' + JSON.stringify(line) + ')\n').join('')}`)
274
+ if (!runs) {
275
+ Content(` t.Skip(${JSON.stringify(liveExcludedSummary(plan))})
277
276
  return
278
277
  }
279
278
 
280
279
  `)
281
280
  }
282
281
  else {
283
- flowBody(getOnly.flow)
282
+ flowBody(plan.flow)
284
283
  Content(` return
285
284
  }
286
285
 
@@ -313,7 +312,7 @@ ${liveExcludedLines(getOnly).map((line) => '\t\t\tt.Log(' + JSON.stringify(line)
313
312
  if err := json.Unmarshal(entityDataSource, &entityData); err != nil {
314
313
  panic("failed to parse ${entity.name} test data: " + err.Error())
315
314
  }
316
-
315
+ ${fixtureIdentity(entity)}
317
316
  options := map[string]any{}
318
317
  options["entity"] = entityData["existing"]
319
318
 
@@ -404,6 +403,17 @@ ${liveExcludedLines(getOnly).map((line) => '\t\t\tt.Log(' + JSON.stringify(line)
404
403
  function liveFlowGate(entity: any, needs: any, strict: boolean, strictConst: string,
405
404
  entidEnv: string, hasSteps: boolean): string {
406
405
  let out = ''
406
+ if (null != needs.examples) {
407
+ out += ` if setup.live {
408
+ for _liveKey, _liveEx := range map[string]any{${needs.examples
409
+ .map(([k, ex]: any) => JSON.stringify(k) + ': ' + goIdLit(ex)).join(', ')}} {
410
+ if setup.syntheticOnly || setup.idmap[_liveKey] == nil {
411
+ setup.idmap[_liveKey] = _liveEx
412
+ }
413
+ }
414
+ }
415
+ `
416
+ }
407
417
  if (0 < needs.keys.length) {
408
418
  out += ` if setup.live {
409
419
  for _, _liveKey := range []string{${needs.keys.map((k: string) => JSON.stringify(k)).join(', ')}} {
@@ -424,6 +434,14 @@ function liveFlowGate(entity: any, needs: any, strict: boolean, strictConst: str
424
434
  // A flow whose every step is skipped (a remove with no data id) uses none.
425
435
  out += '\t\tclient := setup.client\n\t\t_ = client\n'
426
436
  }
437
+ if (null != needs.record) {
438
+ out += ` if setup.live {
439
+ liveExisting(t, ${strictConst}, setup.data, ${JSON.stringify(entity.name)}, func() (any, error) {
440
+ return []any{map[string]any{"id": setup.idmap[${JSON.stringify(needs.record)}]}}, nil
441
+ })
442
+ }
443
+ `
444
+ }
427
445
  if (null != needs.discover) {
428
446
  const match = Object.entries(needs.discover)
429
447
  .map(([k, v]: any) => `${JSON.stringify(k)}: setup.idmap[${JSON.stringify(v)}]`)
@@ -501,7 +519,7 @@ const generateCreate: OpGen = (ctx, step, index) => {
501
519
  }
502
520
  `)
503
521
  if (null != ctx.entity.id) {
504
- Content(` if ${datavar}["id"] == nil {
522
+ Content(` if ${datavar}[${rid(ctx.entity)}] == nil {
505
523
  t.Fatal("expected created entity to have an id")
506
524
  }
507
525
  `)
@@ -543,7 +561,7 @@ const generateList: OpGen = (ctx, step, index) => {
543
561
  Content(` }
544
562
  `)
545
563
  }
546
- liveFill(entity, step, matchvar)
564
+ liveFill(entity, step, matchvar, flow)
547
565
 
548
566
  // Only declare ${listvar} as a real var when a downstream validator
549
567
  // actually uses it; otherwise `_` to satisfy Go's unused-var check.
@@ -582,7 +600,7 @@ const generateList: OpGen = (ctx, step, index) => {
582
600
  if ('ItemExists' === validator.apply && hasRefData && hasDataId) {
583
601
  const refDataVar = goVar(validRef + '_data')
584
602
  Content(`
585
- foundItem := vs.Select(entityListToData(${listvar}), map[string]any{"id": ${refDataVar}["id"]})
603
+ foundItem := vs.Select(entityListToData(${listvar}), map[string]any{${rid(entity)}: ${refDataVar}[${rid(entity)}]})
586
604
  if vs.IsEmpty(foundItem) {
587
605
  t.Fatal("expected to find created entity in list")
588
606
  }
@@ -590,7 +608,7 @@ const generateList: OpGen = (ctx, step, index) => {
590
608
  } else if ('ItemNotExists' === validator.apply && hasRefData && hasDataId) {
591
609
  const refDataVar = goVar(validRef + '_data')
592
610
  Content(`
593
- notFoundItem := vs.Select(entityListToData(${listvar}), map[string]any{"id": ${refDataVar}["id"]})
611
+ notFoundItem := vs.Select(entityListToData(${listvar}), map[string]any{${rid(entity)}: ${refDataVar}[${rid(entity)}]})
594
612
  if !vs.IsEmpty(notFoundItem) {
595
613
  t.Fatal("expected removed entity to not be in list")
596
614
  }
@@ -625,7 +643,7 @@ const generateUpdate: OpGen = (ctx, step, index) => {
625
643
  Content(` ${datavar}Up := map[string]any{
626
644
  `)
627
645
  if (hasEntIdU) {
628
- Content(` "id": ${srcdatavar}["id"],
646
+ Content(` "id": ${srcdatavar}[${rid(entity)}],
629
647
  `)
630
648
  }
631
649
 
@@ -667,7 +685,7 @@ const generateUpdate: OpGen = (ctx, step, index) => {
667
685
  }
668
686
  `)
669
687
  if (hasEntIdU) {
670
- Content(` if ${resdatavar}["id"] != ${datavar}Up["id"] {
688
+ Content(` if ${resdatavar}[${rid(entity)}] != ${datavar}Up["id"] {
671
689
  t.Fatal("expected update result id to match")
672
690
  }
673
691
  `)
@@ -730,11 +748,11 @@ const generateLoad: OpGen = (ctx, step, index) => {
730
748
  }
731
749
  if (hasEntId) {
732
750
  Content(` ${matchvar} := map[string]any{
733
- "id": ${srcdatavar}["id"],
751
+ "id": ${srcdatavar}[${rid(entity)}],
734
752
  }
735
753
  `)
736
754
  loadMatch(entity, step, matchvar, srcdatavar)
737
- liveFill(entity, step, matchvar)
755
+ liveFill(entity, step, matchvar, flow)
738
756
  Content(` ${datavar}Loaded, err := ${entvar}.Load(${matchvar}, nil)
739
757
  if err != nil {
740
758
  t.Fatalf("load failed: %v", err)
@@ -743,7 +761,7 @@ const generateLoad: OpGen = (ctx, step, index) => {
743
761
  if ${datavar}LoadResult == nil {
744
762
  t.Fatal("expected load result to be a map")
745
763
  }
746
- if ${datavar}LoadResult["id"] != ${srcdatavar}["id"] {
764
+ if ${datavar}LoadResult[${rid(entity)}] != ${srcdatavar}[${rid(entity)}] {
747
765
  t.Fatal("expected load result id to match")
748
766
  }
749
767
  `)
@@ -752,7 +770,7 @@ const generateLoad: OpGen = (ctx, step, index) => {
752
770
  Content(` ${matchvar} := map[string]any{}
753
771
  `)
754
772
  loadMatch(entity, step, matchvar, srcdatavar)
755
- liveFill(entity, step, matchvar)
773
+ liveFill(entity, step, matchvar, flow)
756
774
  Content(` ${datavar}Loaded, err := ${entvar}.Load(${matchvar}, nil)
757
775
  if err != nil {
758
776
  t.Fatalf("load failed: %v", err)
@@ -791,7 +809,7 @@ const generateRemove: OpGen = (ctx, step, index) => {
791
809
  }
792
810
  // Always match the prior-created entity by id to avoid mock-order flakes.
793
811
  Content(` ${matchvar} := map[string]any{
794
- "id": ${srcdatavar}["id"],
812
+ "id": ${srcdatavar}[${rid(entity)}],
795
813
  }
796
814
  `)
797
815
  parentMatch(step, matchvar)
@@ -803,12 +821,32 @@ const generateRemove: OpGen = (ctx, step, index) => {
803
821
  }
804
822
 
805
823
 
824
+ // The record field the entity's identity is read from, as a Go string literal.
825
+ function rid(entity: any): string {
826
+ return JSON.stringify(entityRecordIdField(entity))
827
+ }
828
+
829
+
830
+ // The fixture keeps each record's key in `id`; an entity keeping its identity
831
+ // in another field reads the key from there too.
832
+ function fixtureIdentity(entity: any): string {
833
+ const field = entityRecordIdField(entity)
834
+ return 'id' === field ? '' : `
835
+ for _, rec := range core.ToMapAny(vs.GetPath(entityData, "existing.${entity.name}")) {
836
+ if recMap := core.ToMapAny(rec); recMap != nil && recMap["id"] != nil {
837
+ recMap[${JSON.stringify(field)}] = recMap["id"]
838
+ }
839
+ }
840
+ `
841
+ }
842
+
843
+
806
844
  // A child's route names its parents, and an entity no earlier step has
807
845
  // filled knows none of them, so the call itself gives each parent id. A live
808
846
  // ENTID may key a parent by its field name, the fixture by its own name.
809
847
  // A live step sends each example its route requires and the step leaves unbound.
810
- function liveFill(entity: any, step: any, matchvar: string) {
811
- const fills = liveStepExamples(entity, step)
848
+ function liveFill(entity: any, step: any, matchvar: string, flow: any) {
849
+ const fills = liveStepExamples(entity, step, flow)
812
850
  if (0 < fills.length) {
813
851
  Content(` if setup.live {
814
852
  ${fills.map(([k, ex]) => ` ${matchvar}[${JSON.stringify(k)}] = ${JSON.stringify(ex)}\n`).join('')} }
@@ -817,6 +855,12 @@ ${fills.map(([k, ex]) => ` ${matchvar}[${JSON.stringify(k)}] = ${JSON.stringif
817
855
  }
818
856
 
819
857
 
858
+ // A number as JSON decodes one, so an example compares equal to a record's id.
859
+ function goIdLit(value: any): string {
860
+ return 'number' === typeof value ? 'float64(' + value + ')' : JSON.stringify(value)
861
+ }
862
+
863
+
820
864
  function parentMatch(step: any, matchvar: string) {
821
865
  const parents = Object.entries(step.m || {})
822
866
  .filter(([k]: any) => k !== 'id' && !k.endsWith('$'))
@@ -15,6 +15,7 @@ import {
15
15
  serverVarEnv,
16
16
  serverVariables, envName, envToken,
17
17
  pointParts,
18
+ pointSlash,
18
19
  pointPlaceholders,
19
20
  liveStrict,
20
21
  liveStrictNote,
@@ -24,6 +25,7 @@ import {
24
25
  liveQueryExamples,
25
26
  liveEntity,
26
27
  liveDirectGetOnly, liveExcludedLines, liveExcludedSummary, LIVE_GETONLY_ENV,
28
+ liveDirectDiscovery,
27
29
  } from '@voxgig/sdkgen'
28
30
 
29
31
 
@@ -131,7 +133,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
131
133
 
132
134
  // Get load point info
133
135
  const loadPoint = loadOp?.points?.[0]
134
- const loadPath = loadPoint ? normalizePathParams(pointParts(loadPoint), loadPoint?.g?.params || [], loadPoint?.r?.param) : ''
136
+ const loadPath = loadPoint ? normalizePathParams(pointParts(loadPoint), loadPoint?.g?.params || [], loadPoint?.r?.param) + pointSlash(loadPoint) : ''
135
137
  const allLoadParams = loadPoint?.g?.params || []
136
138
  // Only path params that actually appear in the URL template drive
137
139
  // direct-test path-param setup and URL-substitution asserts.
@@ -149,7 +151,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
149
151
 
150
152
  // Get list point info
151
153
  const listPoint = listOp?.points?.[0]
152
- const listPath = listPoint ? normalizePathParams(pointParts(listPoint), listPoint?.g?.params || [], listPoint?.r?.param) : ''
154
+ const listPath = listPoint ? normalizePathParams(pointParts(listPoint), listPoint?.g?.params || [], listPoint?.r?.param) + pointSlash(listPoint) : ''
153
155
  const listParams = listPoint?.g?.params || []
154
156
 
155
157
  // Required query params with spec-provided examples — needed in live mode.
@@ -347,14 +349,14 @@ ${listLiveQueryLines ? ' if (setup.live) {\n' + listLiveQueryLines + ' }\n
347
349
  `)
348
350
  }
349
351
  else if (hasLoad && loadPoint) {
350
- // Identify ancestor params (not 'id') for live mode
351
- const ancestorParams = loadParams.filter((p: any) => p.n !== 'id')
352
+ const discovery = liveDirectDiscovery(entity, loadParams, listPoint)
353
+ const ancestorParams = loadParams.filter((p: any) => p.n !== discovery?.param)
352
354
 
353
355
  const liveKey = (p: any) => p.n === 'id' ? entity.name + '01' : p.n.replace(/_id$/, '') + '01'
354
356
  let loadLiveIdKeys: string[] = []
355
357
  if (loadParams.length > 0 && !loadAllHaveExamples) {
356
- loadLiveIdKeys = [...new Set((hasList ?
357
- [...listParams, ...loadParams.filter((p: any) => p.n !== 'id')] : loadParams).map(liveKey))]
358
+ loadLiveIdKeys = [...new Set((discovery ?
359
+ [...listParams, ...ancestorParams] : loadParams).map(liveKey))]
358
360
  }
359
361
  const loadSkipBlock = getOnlyKeysBlock(model, entity, 'direct-load-' + entity.name, loadLiveIdKeys) +
360
362
  (loadLiveIdKeys.length > 0
@@ -395,7 +397,7 @@ ${loadSkipBlock} ${SDK} client = setup.client;
395
397
 
396
398
  if (loadAllHaveExamples) {
397
399
  Content(loadExampleLines + '\n')
398
- } else if (hasList && loadParams.length > 0) {
400
+ } else if (discovery) {
399
401
  Content(` Map<String, Object> listParams = new LinkedHashMap<>();
400
402
  `)
401
403
  for (const p of listParams) {
@@ -421,14 +423,13 @@ ${loadSkipBlock} ${SDK} client = setup.client;
421
423
  RunnerSupport.liveEmpty("The account has no ${entity.name} record to load");
422
424
  }
423
425
  Map<String, Object> firstEnt = Helpers.toMapAny(listData.get(0));
424
- if (firstEnt == null || firstEnt.get("id") == null) {
426
+ if (firstEnt == null || firstEnt.get("${discovery.field}") == null) {
425
427
  RunnerSupport.liveMiss(LIVE_STRICT, "Live load blocked: discovery returned no usable identity");
426
428
  }
427
- params.put("id", firstEnt.get("id"));
429
+ params.put("${discovery.param}", firstEnt.get("${discovery.field}"));
428
430
  `)
429
431
  for (const p of ancestorParams) {
430
- const key = p.n.replace(/_id$/, '') + '01'
431
- Content(` params.put("${p.n}", setup.idmap.get("${key}"));
432
+ Content(` params.put("${p.n}", setup.idmap.get("${liveKey(p)}"));
432
433
  `)
433
434
  }
434
435
  } else if (loadParams.length > 0) {
@@ -20,9 +20,9 @@ import {
20
20
  getMatchEntries,
21
21
  isAuthActive,
22
22
  serverVarEnv,
23
- serverVariables, envName, envToken,
23
+ serverVariables, envName, envToken, entityRecordIdField,
24
24
  liveFlowNeeds, liveStrict, liveStrictNote,
25
- liveGetOnly, liveExcludedLines, liveExcludedSummary, LIVE_GETONLY_ENV,
25
+ liveGates, liveExcludedLines, liveExcludedSummary, LIVE_GETONLY_ENV,
26
26
  liveRouteExamples, liveStepExamples,
27
27
  liveEntity,
28
28
  } from '@voxgig/sdkgen'
@@ -57,6 +57,12 @@ type OpGen = (ctx: GenCtx, step: ModelEntityFlowStep, index: number) => void
57
57
  function liveFlowGate(entity: any, needs: any, entidEnv: string, accessor: string,
58
58
  SDK: string, strict: boolean, hasSteps: boolean): string {
59
59
  let out = ''
60
+ for (const [k, ex] of needs.examples || []) {
61
+ out += ` if (setup.live && (setup.syntheticOnly || setup.idmap.get(${JSON.stringify(k)}) == null)) {
62
+ setup.idmap.put(${JSON.stringify(k)}, ${javaIdLit(ex)});
63
+ }
64
+ `
65
+ }
60
66
  if (0 < needs.keys.length) {
61
67
  out += ` if (setup.live) {
62
68
  for (String liveKey : new String[] { ${needs.keys.map((k: string) => JSON.stringify(k)).join(', ')} }) {
@@ -77,6 +83,16 @@ function liveFlowGate(entity: any, needs: any, entidEnv: string, accessor: strin
77
83
  return out
78
84
  }
79
85
  out += ` ${SDK} client = setup.client;\n`
86
+ if (null != needs.record) {
87
+ out += ` if (setup.live) {
88
+ RunnerSupport.liveExisting(setup.data, LIVE_STRICT, ${JSON.stringify(entity.name)}, () -> {
89
+ Map<String, Object> record = new LinkedHashMap<>();
90
+ record.put("id", setup.idmap.get(${JSON.stringify(needs.record)}));
91
+ return List.of(record);
92
+ });
93
+ }
94
+ `
95
+ }
80
96
  if (null != needs.discover) {
81
97
  const match = Object.entries(needs.discover)
82
98
  .map(([k, v]: any) => `match.put(${JSON.stringify(k)}, setup.idmap.get(${JSON.stringify(v)}));`)
@@ -244,19 +260,18 @@ ${liveStrictNote(strict, '//', ' ')}
244
260
  `)
245
261
  }
246
262
 
247
- const getOnly = liveGetOnly(entity, basicflow)
248
- if (null != getOnly) {
249
- Content(` if (setup.live && "TRUE".equals(System.getenv(${javaLit(LIVE_GETONLY_ENV)}))) {
250
- ${liveExcludedLines(getOnly).map((line) => ' System.out.println(' + javaLit(line) + ');\n').join('')}`)
251
- if (0 === flowSteps(getOnly.flow).length) {
252
- Content(` Assumptions.abort(${javaLit(liveExcludedSummary(getOnly))});
263
+ for (const { getOnly, plan, runs } of liveGates(entity, basicflow)) {
264
+ Content(` if (setup.live${getOnly ? ` && "TRUE".equals(System.getenv(${javaLit(LIVE_GETONLY_ENV)}))` : ''}) {
265
+ ${liveExcludedLines(plan).map((line) => ' System.out.println(' + javaLit(line) + ');\n').join('')}`)
266
+ if (!runs) {
267
+ Content(` Assumptions.abort(${javaLit(liveExcludedSummary(plan))});
253
268
  return;
254
269
  }
255
270
 
256
271
  `)
257
272
  }
258
273
  else {
259
- flowBody(getOnly.flow)
274
+ flowBody(plan.flow)
260
275
  Content(` return;
261
276
  }
262
277
 
@@ -331,7 +346,7 @@ ${liveExcludedLines(getOnly).map((line) => ' System.out.println(' + javaLit
331
346
  catch (Exception e) {
332
347
  throw new AssertionError("failed to read ${entity.name} test data: " + e.getMessage(), e);
333
348
  }
334
-
349
+ ${fixtureIdentity(entity)}
335
350
  Map<String, Object> options = new LinkedHashMap<>();
336
351
  options.put("entity", entityData.get("existing"));
337
352
 
@@ -458,7 +473,7 @@ const generateCreate: OpGen = (ctx, step, index) => {
458
473
  assertNotNull(${datavar}, "expected create result to be a map");
459
474
  `)
460
475
  if (null != ctx.entity.id) {
461
- Content(` assertNotNull(${datavar}.get("id"), "expected created entity to have an id");
476
+ Content(` assertNotNull(${datavar}.get(${rid(ctx.entity)}), "expected created entity to have an id");
462
477
  `)
463
478
  }
464
479
  }
@@ -490,7 +505,7 @@ const generateList: OpGen = (ctx, step, index) => {
490
505
  Content(` ${matchvar}.put("${key}", setup.idmap.get("${val}"));
491
506
  `)
492
507
  }
493
- Content(liveFill(entity, step, matchvar))
508
+ Content(liveFill(entity, step, matchvar, flow))
494
509
 
495
510
  // Only declare ${listvar} as a real var when a downstream validator
496
511
  // actually uses it.
@@ -524,7 +539,7 @@ const generateList: OpGen = (ctx, step, index) => {
524
539
  Content(`
525
540
  List<Object> foundItem = Struct.select(
526
541
  RunnerSupport.entityListToData(${listvar}),
527
- Struct.jm("id", ${refDataVar}.get("id")));
542
+ Struct.jm(${rid(entity)}, ${refDataVar}.get(${rid(entity)})));
528
543
  assertFalse(Struct.isempty(foundItem), "expected to find created entity in list");
529
544
  `)
530
545
  } else if ('ItemNotExists' === validator.apply && hasRefData) {
@@ -532,7 +547,7 @@ const generateList: OpGen = (ctx, step, index) => {
532
547
  Content(`
533
548
  List<Object> notFoundItem = Struct.select(
534
549
  RunnerSupport.entityListToData(${listvar}),
535
- Struct.jm("id", ${refDataVar}.get("id")));
550
+ Struct.jm(${rid(entity)}, ${refDataVar}.get(${rid(entity)})));
536
551
  assertTrue(Struct.isempty(notFoundItem), "expected removed entity to not be in list");
537
552
  `)
538
553
  }
@@ -565,7 +580,7 @@ const generateUpdate: OpGen = (ctx, step, index) => {
565
580
  Content(` Map<String, Object> ${datavar}Up = new LinkedHashMap<>();
566
581
  `)
567
582
  if (hasEntIdU) {
568
- Content(` ${datavar}Up.put("id", ${srcdatavar}.get("id"));
583
+ Content(` ${datavar}Up.put("id", ${srcdatavar}.get(${rid(entity)}));
569
584
  `)
570
585
  }
571
586
 
@@ -599,7 +614,7 @@ const generateUpdate: OpGen = (ctx, step, index) => {
599
614
  assertNotNull(${resdatavar}, "expected update result to be a map");
600
615
  `)
601
616
  if (hasEntIdU) {
602
- Content(` assertEquals(${datavar}Up.get("id"), ${resdatavar}.get("id"),
617
+ Content(` assertEquals(${datavar}Up.get("id"), ${resdatavar}.get(${rid(entity)}),
603
618
  "expected update result id to match");
604
619
  `)
605
620
  }
@@ -660,16 +675,16 @@ const generateLoad: OpGen = (ctx, step, index) => {
660
675
  Content(` Map<String, Object> ${matchvar} = new LinkedHashMap<>();
661
676
  `)
662
677
  if (hasEntId) {
663
- Content(` ${matchvar}.put("id", ${srcdatavar}.get("id"));
664
- ${loadMatch(entity, step, matchvar, srcdatavar)}${liveFill(entity, step, matchvar)} Object ${datavar}Loaded = ${entvar}.load(${matchvar}, null);
678
+ Content(` ${matchvar}.put("id", ${srcdatavar}.get(${rid(entity)}));
679
+ ${loadMatch(entity, step, matchvar, srcdatavar)}${liveFill(entity, step, matchvar, flow)} Object ${datavar}Loaded = ${entvar}.load(${matchvar}, null);
665
680
  Map<String, Object> ${datavar}LoadResult = Helpers.toMapAny(${datavar}Loaded instanceof SdkEntity ? ((SdkEntity) ${datavar}Loaded).data() : ${datavar}Loaded);
666
681
  assertNotNull(${datavar}LoadResult, "expected load result to be a map");
667
- assertEquals(${srcdatavar}.get("id"), ${datavar}LoadResult.get("id"),
682
+ assertEquals(${srcdatavar}.get(${rid(entity)}), ${datavar}LoadResult.get(${rid(entity)}),
668
683
  "expected load result id to match");
669
684
  `)
670
685
  }
671
686
  else {
672
- Content(`${loadMatch(entity, step, matchvar, srcdatavar)}${liveFill(entity, step, matchvar)} Object ${datavar}Loaded = ${entvar}.load(${matchvar}, null);
687
+ Content(`${loadMatch(entity, step, matchvar, srcdatavar)}${liveFill(entity, step, matchvar, flow)} Object ${datavar}Loaded = ${entvar}.load(${matchvar}, null);
673
688
  assertNotNull(${datavar}Loaded, "expected load result to be non-null");
674
689
  `)
675
690
  }
@@ -695,12 +710,39 @@ const generateRemove: OpGen = (ctx, step, index) => {
695
710
  }
696
711
  // Always match the prior-created entity by id to avoid mock-order flakes.
697
712
  Content(` Map<String, Object> ${matchvar} = new LinkedHashMap<>();
698
- ${matchvar}.put("id", ${srcdatavar}.get("id"));
713
+ ${matchvar}.put("id", ${srcdatavar}.get(${rid(entity)}));
699
714
  ${parentMatch(step, matchvar)} ${entvar}.remove(${matchvar}, null);
700
715
  `)
701
716
  }
702
717
 
703
718
 
719
+ // The record field the entity's identity is read from, as a Java string.
720
+ function rid(entity: any): string {
721
+ return JSON.stringify(entityRecordIdField(entity))
722
+ }
723
+
724
+
725
+ // The fixture keeps each record's key in `id`; an entity keeping its identity
726
+ // in another field reads the key from there too.
727
+ function fixtureIdentity(entity: any): string {
728
+ const field = entityRecordIdField(entity)
729
+ return 'id' === field ? '' : `
730
+ Object fixtureEntities = entityData.get("existing");
731
+ Object fixtureRecords = fixtureEntities instanceof Map
732
+ ? ((Map<?, ?>) fixtureEntities).get(${JSON.stringify(entity.name)}) : null;
733
+ if (fixtureRecords instanceof Map) {
734
+ for (Object fixtureRec : ((Map<?, ?>) fixtureRecords).values()) {
735
+ if (fixtureRec instanceof Map && null != ((Map<?, ?>) fixtureRec).get("id")) {
736
+ @SuppressWarnings("unchecked")
737
+ Map<String, Object> fixtureRecMap = (Map<String, Object>) fixtureRec;
738
+ fixtureRecMap.put(${JSON.stringify(field)}, fixtureRecMap.get("id"));
739
+ }
740
+ }
741
+ }
742
+ `
743
+ }
744
+
745
+
704
746
  // A child's route names its parents, and an entity no earlier step has
705
747
  // filled knows none of them, so the call itself gives each parent id. A live
706
748
  // ENTID may key a parent by its field name, the fixture by its own name.
@@ -710,9 +752,15 @@ function javaLit(value: any): string {
710
752
  }
711
753
 
712
754
 
755
+ // A whole number as Json.parse decodes one, so an example equals a record's id.
756
+ function javaIdLit(value: any): string {
757
+ return Number.isSafeInteger(value) ? value + 'L' : javaLit(value)
758
+ }
759
+
760
+
713
761
  // A live step sends each example its route requires and the step leaves unbound.
714
- function liveFill(entity: any, step: any, matchvar: string): string {
715
- const fills = liveStepExamples(entity, step)
762
+ function liveFill(entity: any, step: any, matchvar: string, flow: any): string {
763
+ const fills = liveStepExamples(entity, step, flow)
716
764
  return 0 === fills.length ? '' : ` if (setup.live) {
717
765
  ${fills.map(([k, ex]) => ` ${matchvar}.put(${JSON.stringify(k)}, ${javaLit(ex)});\n`).join('')} }
718
766
  `
@@ -19,9 +19,10 @@ import {
19
19
  isAuthActive,
20
20
  serverVarEnv,
21
21
  serverVariables,
22
- jsProp, envName, envToken,
22
+ jsProp, jsOptProp, envName, envToken,
23
23
  jsKey,
24
24
  pointParts,
25
+ pointSlash,
25
26
  pointIsGraphql,
26
27
  hasLiveScenarios,
27
28
  liveStrict,
@@ -33,6 +34,7 @@ import {
33
34
  liveEntity,
34
35
  liveGetOnlyReason, LIVE_GETONLY_ENV,
35
36
  liveDirectGetOnly, liveExcludedLines, liveExcludedSummary,
37
+ liveDirectDiscovery,
36
38
  } from '@voxgig/sdkgen'
37
39
 
38
40
 
@@ -187,7 +189,7 @@ function generateDirectLoad(model: Model, entity: ModelEntity) {
187
189
  }
188
190
 
189
191
  const loadParams = loadPoint.g?.params || []
190
- const loadPath = normalizePathParams(pointParts(loadPoint), loadParams, loadPoint.r?.param)
192
+ const loadPath = normalizePathParams(pointParts(loadPoint), loadParams, loadPoint.r?.param) + pointSlash(loadPoint)
191
193
  const liveQueryLines = liveQueryLinesJs(loadPoint)
192
194
 
193
195
  // Get list info for live mode bootstrapping
@@ -195,23 +197,21 @@ function generateDirectLoad(model: Model, entity: ModelEntity) {
195
197
  const listPoint = null == listOp?.points ? undefined :
196
198
  primaryPoint(listOp.points, entity.name, 'list')
197
199
  const listParams = listPoint?.g?.params || []
198
- const listPath = listPoint ? normalizePathParams(pointParts(listPoint), listParams, listPoint.r?.param) : ''
199
- const hasList = null != listPoint
200
-
201
- // Ancestor params (not 'id') for live mode
202
- const ancestorParams = loadParams.filter((p: any) => p.n !== 'id')
200
+ const listPath = listPoint ? normalizePathParams(pointParts(listPoint), listParams, listPoint.r?.param) + pointSlash(listPoint) : ''
201
+ const discovery = liveDirectDiscovery(entity, loadParams, listPoint)
203
202
 
204
203
  const paramAsserts = loadParams.map((p: any, i: number) =>
205
204
  ' assert(calls[0].url.includes(\'direct0' + (i + 1) + '\'))\n').join('')
206
205
 
207
206
  const liveListParams = listParams.map((p: any) => ({ name: p.n, key: liveIdKey(entity, p) }))
208
- const liveAncestorParams = ancestorParams.map((p: any) => ({ name: p.n, key: liveIdKey(entity, p) }))
209
207
  const mockParamLines = loadParams.map((p: any, i: number) =>
210
208
  ` ${jsProp('params', p.n)} = 'direct0${i + 1}'`).join('\n')
211
209
 
212
210
  let liveIdKeys: string[] = []
213
211
  let liveParamsBlock = ''
214
- if (hasList) {
212
+ if (null != discovery) {
213
+ const liveAncestorParams = loadParams.filter((p: any) => p.n !== discovery.param)
214
+ .map((p: any) => ({ name: p.n, key: liveIdKey(entity, p) }))
215
215
  liveIdKeys = [...new Set([...liveListParams, ...liveAncestorParams].map((lp: any) => lp.key))]
216
216
  const listParamLines = liveListParams.map((lp: any) =>
217
217
  ` ${lp.name}: setup.idmap['${lp.key}'],`).join('\n')
@@ -235,10 +235,11 @@ ${listParamLines}
235
235
  if (0 === listResult.data.length) {
236
236
  return void liveEmpty(t, 'The account has no ${entity.name} record to load')
237
237
  }
238
- if (null == listResult.data[0]?.id) {
238
+ const candidateId = ${jsOptProp('listResult.data[0]', discovery.field)}
239
+ if (null == candidateId) {
239
240
  return void liveMiss(t, LIVE_STRICT, 'Live load blocked: discovery returned no usable identity')
240
241
  }
241
- params.id = listResult.data[0].id
242
+ ${jsProp('params', discovery.param)} = candidateId
242
243
  ${ancestorParamLines}
243
244
  } else {
244
245
  ${mockParamLines}
@@ -301,7 +302,7 @@ function generateDirectList(model: Model, entity: ModelEntity) {
301
302
  }
302
303
 
303
304
  const listParams = listPoint.g?.params || []
304
- const listPath = normalizePathParams(pointParts(listPoint), listParams, listPoint.r?.param)
305
+ const listPath = normalizePathParams(pointParts(listPoint), listParams, listPoint.r?.param) + pointSlash(listPoint)
305
306
 
306
307
  const liveParams = listParams.map((p: any) => ({ name: p.n, key: liveIdKey(entity, p) }))
307
308
  const liveQueryLines = liveQueryLinesJs(listPoint)