@voxgig/sdkgen 1.3.17 → 1.3.19

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 (267) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/dist/cmp/Deploy.js +16 -16
  3. package/dist/cmp/Deploy.js.map +1 -1
  4. package/dist/cmp/Entity.js +5 -1
  5. package/dist/cmp/Entity.js.map +1 -1
  6. package/dist/cmp/Feature.js +2 -1
  7. package/dist/cmp/Feature.js.map +1 -1
  8. package/dist/cmp/ReadmeTop.js +13 -11
  9. package/dist/cmp/ReadmeTop.js.map +1 -1
  10. package/dist/helpers/canonType.js +8 -3
  11. package/dist/helpers/canonType.js.map +1 -1
  12. package/dist/helpers/collectDeps.d.ts +1 -1
  13. package/dist/helpers/collectDeps.js +36 -13
  14. package/dist/helpers/collectDeps.js.map +1 -1
  15. package/dist/helpers/naming.d.ts +5 -1
  16. package/dist/helpers/naming.js +118 -0
  17. package/dist/helpers/naming.js.map +1 -1
  18. package/dist/helpers/opShape.d.ts +3 -1
  19. package/dist/helpers/opShape.js +87 -8
  20. package/dist/helpers/opShape.js.map +1 -1
  21. package/dist/helpers/serverVars.d.ts +10 -0
  22. package/dist/helpers/serverVars.js +87 -0
  23. package/dist/helpers/serverVars.js.map +1 -0
  24. package/dist/sdkgen.d.ts +4 -3
  25. package/dist/sdkgen.js +11 -2
  26. package/dist/sdkgen.js.map +1 -1
  27. package/dist/tsconfig.tsbuildinfo +1 -1
  28. package/package.json +15 -10
  29. package/project/.sdk/model/target/cpp.aontu +4 -4
  30. package/project/.sdk/model/target/go-cli.aontu +17 -17
  31. package/project/.sdk/model/target/go-mcp.aontu +11 -11
  32. package/project/.sdk/model/target/go.aontu +1 -1
  33. package/project/.sdk/model/target/java.aontu +4 -4
  34. package/project/.sdk/model/target/kotlin.aontu +4 -4
  35. package/project/.sdk/model/target/lean.aontu +51 -0
  36. package/project/.sdk/model/target/scala.aontu +4 -4
  37. package/project/.sdk/src/cmp/c/EntityTypes_c.ts +3 -4
  38. package/project/.sdk/src/cmp/c/Entity_c.ts +3 -3
  39. package/project/.sdk/src/cmp/c/ReadmeExamplesTest_c.ts +24 -7
  40. package/project/.sdk/src/cmp/c/TestDirect_c.ts +3 -3
  41. package/project/.sdk/src/cmp/c/TestEntity_c.ts +1 -1
  42. package/project/.sdk/src/cmp/clojure/Entity_clojure.ts +1 -1
  43. package/project/.sdk/src/cmp/clojure/ReadmeExamplesTest_clojure.ts +19 -8
  44. package/project/.sdk/src/cmp/cpp/EntityTypes_cpp.ts +2 -2
  45. package/project/.sdk/src/cmp/cpp/Entity_cpp.ts +3 -3
  46. package/project/.sdk/src/cmp/cpp/MainEntity_cpp.ts +2 -2
  47. package/project/.sdk/src/cmp/cpp/ReadmeExamplesTest_cpp.ts +136 -0
  48. package/project/.sdk/src/cmp/cpp/TestDirect_cpp.ts +3 -3
  49. package/project/.sdk/src/cmp/cpp/Test_cpp.ts +4 -0
  50. package/project/.sdk/src/cmp/csharp/EntityTypes_csharp.ts +2 -3
  51. package/project/.sdk/src/cmp/csharp/Entity_csharp.ts +3 -3
  52. package/project/.sdk/src/cmp/csharp/MainEntity_csharp.ts +2 -2
  53. package/project/.sdk/src/cmp/csharp/Package_csharp.ts +1 -1
  54. package/project/.sdk/src/cmp/csharp/ReadmeExamplesTest_csharp.ts +13 -1
  55. package/project/.sdk/src/cmp/csharp/TestDirect_csharp.ts +3 -3
  56. package/project/.sdk/src/cmp/csharp/TestEntity_csharp.ts +22 -15
  57. package/project/.sdk/src/cmp/dart/EntityTypes_dart.ts +2 -3
  58. package/project/.sdk/src/cmp/dart/Entity_dart.ts +3 -3
  59. package/project/.sdk/src/cmp/dart/MainEntity_dart.ts +2 -2
  60. package/project/.sdk/src/cmp/dart/Main_dart.ts +3 -3
  61. package/project/.sdk/src/cmp/dart/Package_dart.ts +1 -1
  62. package/project/.sdk/src/cmp/dart/TestDirect_dart.ts +4 -4
  63. package/project/.sdk/src/cmp/elixir/EntityTypes_elixir.ts +2 -3
  64. package/project/.sdk/src/cmp/elixir/Entity_elixir.ts +1 -1
  65. package/project/.sdk/src/cmp/elixir/ReadmeExamplesTest_elixir.ts +21 -3
  66. package/project/.sdk/src/cmp/go/Config_go.ts +14 -2
  67. package/project/.sdk/src/cmp/go/EntityTypes_go.ts +110 -18
  68. package/project/.sdk/src/cmp/go/Entity_go.ts +3 -3
  69. package/project/.sdk/src/cmp/go/Main_go.ts +7 -6
  70. package/project/.sdk/src/cmp/go/Package_go.ts +1 -1
  71. package/project/.sdk/src/cmp/go/TestDirect_go.ts +3 -3
  72. package/project/.sdk/src/cmp/go/TestEntity_go.ts +1 -1
  73. package/project/.sdk/src/cmp/go/utility_go.ts +25 -0
  74. package/project/.sdk/src/cmp/go-cli/Main_go-cli.ts +62 -35
  75. package/project/.sdk/src/cmp/go-cli/fragment/main.fragment.go +7 -7
  76. package/project/.sdk/src/cmp/go-cli/fragment/words.fragment.go +21 -18
  77. package/project/.sdk/src/cmp/go-mcp/Main_go-mcp.ts +9 -1
  78. package/project/.sdk/src/cmp/haskell/ReadmeExamplesTest_haskell.ts +28 -18
  79. package/project/.sdk/src/cmp/java/EntityTypes_java.ts +2 -3
  80. package/project/.sdk/src/cmp/java/Entity_java.ts +3 -3
  81. package/project/.sdk/src/cmp/java/MainEntity_java.ts +2 -2
  82. package/project/.sdk/src/cmp/java/Package_java.ts +1 -1
  83. package/project/.sdk/src/cmp/java/ReadmeExamplesTest_java.ts +23 -1
  84. package/project/.sdk/src/cmp/java/TestDirect_java.ts +3 -3
  85. package/project/.sdk/src/cmp/js/Config_js.ts +11 -0
  86. package/project/.sdk/src/cmp/js/EntityTypes_js.ts +2 -3
  87. package/project/.sdk/src/cmp/js/Entity_js.ts +3 -3
  88. package/project/.sdk/src/cmp/js/MainEntity_js.ts +2 -2
  89. package/project/.sdk/src/cmp/js/Main_js.ts +2 -2
  90. package/project/.sdk/src/cmp/js/TestDirect_js.ts +4 -4
  91. package/project/.sdk/src/cmp/js/fragment/Config.fragment.js +2 -2
  92. package/project/.sdk/src/cmp/js/fragment/Direct.test.fragment.js +4 -0
  93. package/project/.sdk/src/cmp/kotlin/EntityTypes_kotlin.ts +2 -3
  94. package/project/.sdk/src/cmp/kotlin/Entity_kotlin.ts +3 -3
  95. package/project/.sdk/src/cmp/kotlin/MainEntity_kotlin.ts +2 -2
  96. package/project/.sdk/src/cmp/kotlin/Package_kotlin.ts +1 -1
  97. package/project/.sdk/src/cmp/kotlin/ReadmeExamplesTest_kotlin.ts +27 -2
  98. package/project/.sdk/src/cmp/kotlin/TestDirect_kotlin.ts +3 -3
  99. package/project/.sdk/src/cmp/lean/Config_lean.ts +88 -0
  100. package/project/.sdk/src/cmp/lean/Entity_lean.ts +9 -0
  101. package/project/.sdk/src/cmp/lean/Gitignore_lean.ts +18 -0
  102. package/project/.sdk/src/cmp/lean/Main_lean.ts +120 -0
  103. package/project/.sdk/src/cmp/lean/Package_lean.ts +68 -0
  104. package/project/.sdk/src/cmp/lean/ReadmeEntity_lean.ts +29 -0
  105. package/project/.sdk/src/cmp/lean/ReadmeExplanation_lean.ts +19 -0
  106. package/project/.sdk/src/cmp/lean/ReadmeHowto_lean.ts +25 -0
  107. package/project/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +38 -0
  108. package/project/.sdk/src/cmp/lean/ReadmeIntro_lean.ts +25 -0
  109. package/project/.sdk/src/cmp/lean/ReadmeModel_lean.ts +24 -0
  110. package/project/.sdk/src/cmp/lean/ReadmeOptions_lean.ts +22 -0
  111. package/project/.sdk/src/cmp/lean/ReadmeQuick_lean.ts +50 -0
  112. package/project/.sdk/src/cmp/lean/ReadmeRef_lean.ts +16 -0
  113. package/project/.sdk/src/cmp/lean/ReadmeTopHowto_lean.ts +16 -0
  114. package/project/.sdk/src/cmp/lean/ReadmeTopQuick_lean.ts +23 -0
  115. package/project/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +18 -0
  116. package/project/.sdk/src/cmp/lean/Test_lean.ts +207 -0
  117. package/project/.sdk/src/cmp/lean/utility_lean.ts +78 -0
  118. package/project/.sdk/src/cmp/lua/Config_lua.ts +10 -1
  119. package/project/.sdk/src/cmp/lua/EntityTypes_lua.ts +2 -3
  120. package/project/.sdk/src/cmp/lua/Entity_lua.ts +3 -3
  121. package/project/.sdk/src/cmp/lua/Package_lua.ts +1 -1
  122. package/project/.sdk/src/cmp/lua/TestDirect_lua.ts +3 -3
  123. package/project/.sdk/src/cmp/lua/TestEntity_lua.ts +1 -1
  124. package/project/.sdk/src/cmp/ocaml/ReadmeExamplesTest_ocaml.ts +29 -14
  125. package/project/.sdk/src/cmp/perl/Entity_perl.ts +3 -3
  126. package/project/.sdk/src/cmp/perl/MainEntity_perl.ts +2 -2
  127. package/project/.sdk/src/cmp/perl/Package_perl.ts +1 -1
  128. package/project/.sdk/src/cmp/perl/TestDirect_perl.ts +3 -3
  129. package/project/.sdk/src/cmp/php/Config_php.ts +13 -2
  130. package/project/.sdk/src/cmp/php/EntityTypes_php.ts +2 -3
  131. package/project/.sdk/src/cmp/php/Entity_php.ts +3 -3
  132. package/project/.sdk/src/cmp/php/MainEntity_php.ts +2 -2
  133. package/project/.sdk/src/cmp/php/Package_php.ts +1 -1
  134. package/project/.sdk/src/cmp/php/TestDirect_php.ts +3 -3
  135. package/project/.sdk/src/cmp/php/TestEntity_php.ts +1 -1
  136. package/project/.sdk/src/cmp/py/Config_py.ts +10 -1
  137. package/project/.sdk/src/cmp/py/EntityTypes_py.ts +2 -3
  138. package/project/.sdk/src/cmp/py/Entity_py.ts +3 -3
  139. package/project/.sdk/src/cmp/py/MainEntity_py.ts +2 -2
  140. package/project/.sdk/src/cmp/py/Main_py.ts +2 -2
  141. package/project/.sdk/src/cmp/py/Package_py.ts +1 -1
  142. package/project/.sdk/src/cmp/py/TestDirect_py.ts +3 -3
  143. package/project/.sdk/src/cmp/py/TestEntity_py.ts +1 -1
  144. package/project/.sdk/src/cmp/rb/Config_rb.ts +12 -1
  145. package/project/.sdk/src/cmp/rb/EntityTypes_rb.ts +15 -5
  146. package/project/.sdk/src/cmp/rb/Entity_rb.ts +3 -3
  147. package/project/.sdk/src/cmp/rb/MainEntity_rb.ts +2 -2
  148. package/project/.sdk/src/cmp/rb/Package_rb.ts +2 -2
  149. package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +3 -3
  150. package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +1 -1
  151. package/project/.sdk/src/cmp/rust/EntityBase_rust.ts +2 -2
  152. package/project/.sdk/src/cmp/rust/EntityTypes_rust.ts +3 -4
  153. package/project/.sdk/src/cmp/rust/Entity_rust.ts +3 -3
  154. package/project/.sdk/src/cmp/rust/MainEntity_rust.ts +2 -2
  155. package/project/.sdk/src/cmp/rust/Package_rust.ts +1 -1
  156. package/project/.sdk/src/cmp/rust/ReadmeExamplesTest_rust.ts +22 -10
  157. package/project/.sdk/src/cmp/rust/TestDirect_rust.ts +3 -3
  158. package/project/.sdk/src/cmp/rust/TestEntity_rust.ts +25 -18
  159. package/project/.sdk/src/cmp/scala/EntityTypes_scala.ts +2 -3
  160. package/project/.sdk/src/cmp/scala/Entity_scala.ts +3 -3
  161. package/project/.sdk/src/cmp/scala/MainEntity_scala.ts +2 -2
  162. package/project/.sdk/src/cmp/scala/ReadmeExamplesTest_scala.ts +22 -3
  163. package/project/.sdk/src/cmp/scala/TestDirect_scala.ts +3 -3
  164. package/project/.sdk/src/cmp/scala/Test_scala.ts +1 -1
  165. package/project/.sdk/src/cmp/swift/EntityTypes_swift.ts +12 -6
  166. package/project/.sdk/src/cmp/swift/Entity_swift.ts +3 -3
  167. package/project/.sdk/src/cmp/swift/MainEntity_swift.ts +2 -2
  168. package/project/.sdk/src/cmp/swift/Package_swift.ts +1 -1
  169. package/project/.sdk/src/cmp/swift/ReadmeExamplesTest_swift.ts +18 -1
  170. package/project/.sdk/src/cmp/swift/TestDirect_swift.ts +1 -1
  171. package/project/.sdk/src/cmp/ts/Config_ts.ts +11 -0
  172. package/project/.sdk/src/cmp/ts/EntityTypes_ts.ts +2 -3
  173. package/project/.sdk/src/cmp/ts/Entity_ts.ts +3 -3
  174. package/project/.sdk/src/cmp/ts/MainEntity_ts.ts +2 -2
  175. package/project/.sdk/src/cmp/ts/Main_ts.ts +2 -2
  176. package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +4 -4
  177. package/project/.sdk/src/cmp/ts/fragment/Config.fragment.ts +2 -2
  178. package/project/.sdk/src/cmp/ts/fragment/Direct.test.fragment.ts +4 -0
  179. package/project/.sdk/src/cmp/zig/Entity_zig.ts +3 -3
  180. package/project/.sdk/src/cmp/zig/MainEntity_zig.ts +2 -2
  181. package/project/.sdk/src/cmp/zig/Package_zig.ts +10 -2
  182. package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +8 -16
  183. package/project/.sdk/tm/csharp/Makefile +6 -6
  184. package/project/.sdk/tm/csharp/test/PrimaryUtilityTest.cs +10 -28
  185. package/project/.sdk/tm/dart/Makefile +3 -3
  186. package/project/.sdk/tm/dart/test/primary_test.dart +7 -0
  187. package/project/.sdk/tm/go/Makefile +6 -6
  188. package/project/.sdk/tm/go/feature/test_feature.go +33 -1
  189. package/project/.sdk/tm/go/test/primary_utility_test.go +46 -42
  190. package/project/.sdk/tm/go/test/runner_test.go +30 -1
  191. package/project/.sdk/tm/go/utility/make_options.go +48 -0
  192. package/project/.sdk/tm/java/Makefile +6 -6
  193. package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +7 -24
  194. package/project/.sdk/tm/js/Makefile +6 -6
  195. package/project/.sdk/tm/js/src/feature/test/TestFeature.js +18 -1
  196. package/project/.sdk/tm/js/src/utility/MakeOptionsUtility.js +39 -1
  197. package/project/.sdk/tm/js/test/utility/PrimaryUtility.test.js +13 -0
  198. package/project/.sdk/tm/kotlin/Makefile +6 -6
  199. package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +7 -20
  200. package/project/.sdk/tm/lean/LICENSE +21 -0
  201. package/project/.sdk/tm/lean/VERSION +1 -0
  202. package/project/.sdk/tm/lean/src/SdkFeature.lean +171 -0
  203. package/project/.sdk/tm/lean/src/SdkFeatures.lean +602 -0
  204. package/project/.sdk/tm/lean/src/SdkJson.lean +134 -0
  205. package/project/.sdk/tm/lean/src/SdkRuntime.lean +356 -0
  206. package/project/.sdk/tm/lean/src/SdkUtility.lean +617 -0
  207. package/project/.sdk/tm/lean/src/VoxgigStruct.lean +2880 -0
  208. package/project/.sdk/tm/lean/src/Vregex.lean +412 -0
  209. package/project/.sdk/tm/lean/src/feature/README.md +5 -0
  210. package/project/.sdk/tm/lean/src/feature/audit/.gitkeep +0 -0
  211. package/project/.sdk/tm/lean/src/feature/base/.gitkeep +0 -0
  212. package/project/.sdk/tm/lean/src/feature/cache/.gitkeep +0 -0
  213. package/project/.sdk/tm/lean/src/feature/clienttrack/.gitkeep +0 -0
  214. package/project/.sdk/tm/lean/src/feature/debug/.gitkeep +0 -0
  215. package/project/.sdk/tm/lean/src/feature/idempotency/.gitkeep +0 -0
  216. package/project/.sdk/tm/lean/src/feature/log/.gitkeep +0 -0
  217. package/project/.sdk/tm/lean/src/feature/metrics/.gitkeep +0 -0
  218. package/project/.sdk/tm/lean/src/feature/netsim/.gitkeep +0 -0
  219. package/project/.sdk/tm/lean/src/feature/paging/.gitkeep +0 -0
  220. package/project/.sdk/tm/lean/src/feature/proxy/.gitkeep +0 -0
  221. package/project/.sdk/tm/lean/src/feature/ratelimit/.gitkeep +0 -0
  222. package/project/.sdk/tm/lean/src/feature/rbac/.gitkeep +0 -0
  223. package/project/.sdk/tm/lean/src/feature/retry/.gitkeep +0 -0
  224. package/project/.sdk/tm/lean/src/feature/streaming/.gitkeep +0 -0
  225. package/project/.sdk/tm/lean/src/feature/telemetry/.gitkeep +0 -0
  226. package/project/.sdk/tm/lean/src/feature/test/.gitkeep +0 -0
  227. package/project/.sdk/tm/lean/src/feature/timeout/.gitkeep +0 -0
  228. package/project/.sdk/tm/lean/test/StructCorpus.lean +697 -0
  229. package/project/.sdk/tm/lean/test/TFeature.lean +268 -0
  230. package/project/.sdk/tm/lean/test/TPrimaryUtility.lean +349 -0
  231. package/project/.sdk/tm/lua/Makefile +7 -7
  232. package/project/.sdk/tm/lua/feature/test_feature.lua +29 -1
  233. package/project/.sdk/tm/lua/test/primary_utility_test.lua +14 -8
  234. package/project/.sdk/tm/lua/utility/make_options.lua +39 -0
  235. package/project/.sdk/tm/perl/Makefile +6 -6
  236. package/project/.sdk/tm/perl/t/primary_utility.t +8 -17
  237. package/project/.sdk/tm/php/Makefile +6 -6
  238. package/project/.sdk/tm/php/feature/TestFeature.php +30 -2
  239. package/project/.sdk/tm/php/test/PrimaryUtilityTest.php +14 -7
  240. package/project/.sdk/tm/php/utility/MakeOptions.php +44 -0
  241. package/project/.sdk/tm/py/Makefile +6 -6
  242. package/project/.sdk/tm/py/feature/test_feature.py +28 -1
  243. package/project/.sdk/tm/py/test/test_primary_utility.py +18 -18
  244. package/project/.sdk/tm/py/utility/make_options.py +42 -0
  245. package/project/.sdk/tm/rb/Makefile +6 -6
  246. package/project/.sdk/tm/rb/feature/test_feature.rb +24 -1
  247. package/project/.sdk/tm/rb/test/primary_utility_test.rb +11 -8
  248. package/project/.sdk/tm/rb/utility/make_options.rb +37 -0
  249. package/project/.sdk/tm/rust/Makefile +6 -6
  250. package/project/.sdk/tm/rust/tests/common/mod.rs +37 -1
  251. package/project/.sdk/tm/rust/tests/primary_utility_test.rs +12 -26
  252. package/project/.sdk/tm/swift/Makefile +6 -6
  253. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +7 -8
  254. package/project/.sdk/tm/ts/Makefile +6 -6
  255. package/project/.sdk/tm/ts/src/feature/test/TestFeature.ts +18 -1
  256. package/project/.sdk/tm/ts/src/utility/MakeOptionsUtility.ts +39 -1
  257. package/project/.sdk/tm/ts/test/utility/PrimaryUtility.test.ts +69 -21
  258. package/src/cmp/Deploy.ts +16 -16
  259. package/src/cmp/Entity.ts +5 -1
  260. package/src/cmp/Feature.ts +2 -1
  261. package/src/cmp/ReadmeTop.ts +13 -11
  262. package/src/helpers/canonType.ts +8 -3
  263. package/src/helpers/collectDeps.ts +39 -12
  264. package/src/helpers/naming.ts +130 -0
  265. package/src/helpers/opShape.ts +99 -12
  266. package/src/helpers/serverVars.ts +105 -0
  267. package/src/sdkgen.ts +12 -3
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- import { cmp, Content, entityClassName } from '@voxgig/sdkgen'
3
+ import { cmp, Content, entityClassName, entityCollection } from '@voxgig/sdkgen'
4
4
 
5
5
  import {
6
6
  KIT,
@@ -14,7 +14,7 @@ const MainEntity = cmp(async function MainEntity(props: any) {
14
14
 
15
15
  // Return the collision-free class TYPE (entityClassName); the accessor METHOD
16
16
  // name (entity.Name) is unchanged so callers still write client.<Name>().
17
- const cls = entityClassName(entity, getModelPath(model, `main.${KIT}.entity`))
17
+ const cls = entityClassName(entity, entityCollection(model))
18
18
 
19
19
  Content(`
20
20
  // Entity access: \`client.${entity.Name}().list()\` / \`client.${entity.Name}().load({ id })\`.
@@ -4,7 +4,7 @@ import * as Path from 'node:path'
4
4
  import {
5
5
  cmp, each, names, cmap,
6
6
  List, File, Content, Copy, Folder, Fragment, Line, FeatureHook,
7
- entityClassName,
7
+ entityClassName, entityCollection,
8
8
  } from '@voxgig/sdkgen'
9
9
 
10
10
 
@@ -57,7 +57,7 @@ const Main = cmp(async function Main(props: any) {
57
57
  Line(`// ${model.const.Name} ${target.Name} SDK\n`)
58
58
 
59
59
  List({ item: entity }, ({ item }: any) => {
60
- const cls = entityClassName(item, entity)
60
+ const cls = entityClassName(item, entityCollection(model))
61
61
  return Line(`import { ${cls} } from './entity/${cls}'`)
62
62
  })
63
63
 
@@ -49,7 +49,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
49
49
  apikey: env.${PROJECTNAME}_APIKEY,`
50
50
  : ''
51
51
 
52
- const opnames = Object.keys(entity.op)
52
+ const opnames = Object.keys(entity.op || {})
53
53
  const hasLoad = opnames.includes('load')
54
54
  const hasList = opnames.includes('list')
55
55
 
@@ -151,7 +151,7 @@ function unwrapListData(data: any): any[] | null {
151
151
 
152
152
 
153
153
  function generateDirectLoad(model: Model, entity: ModelEntity) {
154
- const loadOp = entity.op.load
154
+ const loadOp = entity.op?.load
155
155
  const loadPoint: ModelPoint | undefined = loadOp?.points?.[0]
156
156
 
157
157
  if (null == loadPoint) {
@@ -198,7 +198,7 @@ function generateDirectLoad(model: Model, entity: ModelEntity) {
198
198
  .join('\n')
199
199
 
200
200
  // Get list info for live mode bootstrapping
201
- const listOp = entity.op.list
201
+ const listOp = entity.op?.list
202
202
  const listPoint = listOp?.points?.[0]
203
203
  const listParams = listPoint?.args?.params || []
204
204
  const listPath = listPoint ? normalizePathParams(listPoint.parts || [], listParams, listPoint.rename?.param) : ''
@@ -356,7 +356,7 @@ ${paramAsserts} }
356
356
 
357
357
 
358
358
  function generateDirectList(model: Model, entity: ModelEntity) {
359
- const listOp = entity.op.list
359
+ const listOp = entity.op?.list
360
360
  const listPoint: ModelPoint | undefined = listOp?.points?.[0]
361
361
 
362
362
  if (null == listPoint) {
@@ -19,7 +19,7 @@ class Config {
19
19
 
20
20
 
21
21
  main = {
22
- name: 'ProjectName',
22
+ name: '$$const.Name$$',
23
23
  }
24
24
 
25
25
 
@@ -31,7 +31,7 @@ class Config {
31
31
  options = {
32
32
  base: '$$main.kit.info.servers.0.url$$',
33
33
 
34
- 'AUTHBLOCK'headers: 'HEADERS',
34
+ 'SERVERBLOCK''AUTHBLOCK'headers: 'HEADERS',
35
35
 
36
36
  entity: {
37
37
  // #EntityConfigs
@@ -24,6 +24,10 @@ describe('EntityNameDirect', async () => {
24
24
 
25
25
  test('direct-exists', async () => {
26
26
  const sdk = new ProjectNameSDK({
27
+ // Concrete base: a live construction must satisfy any server
28
+ // variables a templated base URL declares; overriding base with a
29
+ // literal (as the direct flow tests do) sidesteps the requirement.
30
+ base: 'http://localhost:8080',
27
31
  system: { fetch: async () => ({}) }
28
32
  })
29
33
  assert('function' === typeof sdk.direct)
@@ -4,7 +4,7 @@ import * as Path from 'node:path'
4
4
  import {
5
5
  cmp, camelify,
6
6
  File, Content, Folder, Fragment,
7
- entityClassName,
7
+ entityClassName, entityCollection,
8
8
  } from '@voxgig/sdkgen'
9
9
 
10
10
  import {
@@ -20,7 +20,7 @@ const Entity = cmp(function Entity(props: any) {
20
20
  const { model, stdrep } = props.ctx$
21
21
  const { target, entity } = props
22
22
 
23
- const entityColl = getModelPath(model, `main.${KIT}.entity`)
23
+ const entityColl = entityCollection(model)
24
24
  const cls = entityClassName(entity, entityColl)
25
25
 
26
26
  const entrep = {
@@ -34,7 +34,7 @@ const Entity = cmp(function Entity(props: any) {
34
34
 
35
35
  File({ name: zigVarName(entity.name) + '.' + target.ext }, () => {
36
36
 
37
- const opnames = Object.keys(entity.op)
37
+ const opnames = Object.keys(entity.op || {})
38
38
 
39
39
  // For each CRUD op: if the spec defines it, splice in the real
40
40
  // implementation. Otherwise emit a stub returning the unsupported_op
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, entityClassName } from '@voxgig/sdkgen'
2
+ import { cmp, Content, entityClassName, entityCollection } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -16,7 +16,7 @@ const MainEntity = cmp(async function MainEntity(props: any) {
16
16
  const { entity } = props
17
17
  const { model } = props.ctx$
18
18
 
19
- const entityColl = getModelPath(model, `main.${KIT}.entity`)
19
+ const entityColl = entityCollection(model)
20
20
  const cls = entityClassName(entity, entityColl)
21
21
  const method = zigVarName(entity.name)
22
22
  const mod = zigVarName(entity.name)
@@ -23,8 +23,16 @@ import { zigModuleName } from './utility_zig'
23
23
  //
24
24
  // The `.paths` allow-list mirrors the (registry-less) template: it only
25
25
  // matters when packaging for a registry, which zig does not do, so it is kept
26
- // stable. `.name` is a plain string here (matching the target's zig toolchain
27
- // pin) rather than the newer enum-literal + fingerprint form.
26
+ // stable. `.name` is a plain string here rather than the newer enum-literal +
27
+ // fingerprint form.
28
+ //
29
+ // TOOLCHAIN PIN: the string form REQUIRES zig <= 0.13. Zig 0.14 rejects it
30
+ // outright — `build.zig.zon:2:13: error: expected enum literal` — so the
31
+ // generated SDK will not build at all on a newer toolchain. The consumer CI
32
+ // job pins 0.13.0 to match (create-sdkgen
33
+ // project/standard/.github/workflows/ci.yml). Moving to a newer zig means
34
+ // changing BOTH: `.name = .${name}` plus a `.fingerprint` here, and the CI
35
+ // pin there.
28
36
  const Package = cmp(async function Package(props: any) {
29
37
  const ctx$ = props.ctx$
30
38
  const model: Model = ctx$.model
@@ -669,23 +669,16 @@ static void prepareParamsBasic() {
669
669
  // --- preparePath ------------------------------------------------------------
670
670
 
671
671
  static void preparePathBasic() {
672
+ // Was hand-written cases that had drifted out of the shared corpus (the
673
+ // preparePath fixture shipped as an empty `set: []`).
672
674
  auto c = client();
673
675
  UtilityPtr utility = c->getUtility();
674
- CtxPtr ctx = makeTestFullCtx(c, utility);
675
- ctx->point = fhMap({
676
- {"parts", vlist({Value("api"), Value("planet"), Value("{id}")})},
677
- {"args", fhMap({{"params", vlist()}})}});
678
- ASSERT_EQ(utility->preparePath(ctx), std::string("api/planet/{id}"), "expected api/planet/{id}");
679
- }
680
-
681
- static void preparePathSingle() {
682
- auto c = client();
683
- UtilityPtr utility = c->getUtility();
684
- CtxPtr ctx = makeTestFullCtx(c, utility);
685
- ctx->point = fhMap({
686
- {"parts", vlist({Value("items")})},
687
- {"args", fhMap({{"params", vlist()}})}});
688
- ASSERT_EQ(utility->preparePath(ctx), std::string("items"), "expected items");
676
+ rs::runset("preparePath-basic", rs::get_spec(primary(), {"preparePath", "basic"}),
677
+ [&](const Value& entry) -> Value {
678
+ Value ctxmap = Helpers::toMapAny(getp(entry, "ctx"));
679
+ CtxPtr ctx = rs::make_ctx_from_map(ctxmap, c, utility);
680
+ return Value(utility->preparePath(ctx));
681
+ });
689
682
  }
690
683
 
691
684
  // --- prepareQuery -----------------------------------------------------------
@@ -830,7 +823,6 @@ int main() {
830
823
  T_RUN(prepareMethodBasic);
831
824
  T_RUN(prepareParamsBasic);
832
825
  T_RUN(preparePathBasic);
833
- T_RUN(preparePathSingle);
834
826
  T_RUN(prepareQueryBasic);
835
827
  T_RUN(resultBasicBasic);
836
828
  T_RUN(resultBodyBasic);
@@ -15,21 +15,21 @@ clean:
15
15
  # publishing a version currently means pushing the tag csharp/vX.Y.Z. When the
16
16
  # registry goes live, `dotnet pack` + `dotnet nuget push` slot in before the
17
17
  # tag (mirroring the voxgig/struct csharp Makefile). Run headless under the
18
- # aql key vault, which injects the GitHub token so nothing lands on disk or
18
+ # boru key vault, which injects the GitHub token so nothing lands on disk or
19
19
  # argv:
20
- # aql vault exec --for=github=<alias> -- make publish
21
- # aql `--dry-run` injects a filler token we detect to rehearse (no tag/push).
20
+ # boru vault exec --for=github=<alias> -- make publish
21
+ # boru `--dry-run` injects a filler token we detect to rehearse (no tag/push).
22
22
  # set -e + tag-last: a failed push never leaves a tag behind.
23
23
  VERSION := $(shell cat VERSION)
24
24
  TAG := csharp/v$(VERSION)
25
- AQL_DRY_RUN_FILLER := AQL-DRY-RUN-FILLER-NOT-A-REAL-SECRET
25
+ BORU_DRY_RUN_FILLER := BORU-DRY-RUN-FILLER-NOT-A-REAL-SECRET
26
26
  publish: test
27
27
  @if git rev-parse -q --verify "refs/tags/$(TAG)" >/dev/null; then \
28
28
  echo "tag $(TAG) already exists — bump VERSION first"; exit 1; fi
29
29
  @set -e; \
30
30
  token="$${GITHUB_TOKEN:-$$GH_TOKEN}"; \
31
- if [ "$$token" = "$(AQL_DRY_RUN_FILLER)" ]; then \
32
- echo "[dry-run] aql filler token detected: would tag $(TAG); nothing pushed."; \
31
+ if [ "$$token" = "$(BORU_DRY_RUN_FILLER)" ]; then \
32
+ echo "[dry-run] boru filler token detected: would tag $(TAG); nothing pushed."; \
33
33
  exit 0; \
34
34
  fi; \
35
35
  git tag -a "$(TAG)" -m "csharp v$(VERSION)"; \
@@ -789,38 +789,20 @@ public class PrimaryUtilityTest
789
789
  });
790
790
  }
791
791
 
792
+ // Was two hand-written cases that had drifted out of the shared corpus
793
+ // (the preparePath fixture shipped as an empty `set: []`). Now driven by
794
+ // the corpus like every other section, so all ports assert the same
795
+ // separator / blank-segment behaviour.
792
796
  [Fact]
793
797
  public void PreparePathBasic()
794
798
  {
795
- var ctx = MakeTestFullCtx(_client, _utility);
796
- ctx.Point = new Dictionary<string, object?>
799
+ TestRunner.RunSet(TestRunner.GetSpec(_primary, "preparePath", "basic"), entry =>
797
800
  {
798
- ["parts"] = new List<object?> { "api", "planet", "{id}" },
799
- ["args"] = new Dictionary<string, object?>
800
- {
801
- ["params"] = new List<object?>(),
802
- },
803
- };
804
-
805
- var path = _utility.PreparePath(ctx);
806
- Assert.Equal("api/planet/{id}", path);
807
- }
808
-
809
- [Fact]
810
- public void PreparePathSingle()
811
- {
812
- var ctx = MakeTestFullCtx(_client, _utility);
813
- ctx.Point = new Dictionary<string, object?>
814
- {
815
- ["parts"] = new List<object?> { "items" },
816
- ["args"] = new Dictionary<string, object?>
817
- {
818
- ["params"] = new List<object?>(),
819
- },
820
- };
821
-
822
- var path = _utility.PreparePath(ctx);
823
- Assert.Equal("items", path);
801
+ var ctxmap = entry.TryGetValue("ctx", out var c)
802
+ ? c as Dictionary<string, object?> : null;
803
+ var ctx = TestRunner.MakeCtxFromMap(ctxmap, _client, _utility);
804
+ return _utility.PreparePath(ctx);
805
+ });
824
806
  }
825
807
 
826
808
  [Fact]
@@ -22,14 +22,14 @@ clean:
22
22
  # the tag. set -e + tag-last: a failed upload never leaves a tag behind.
23
23
  VERSION := $(shell sed -nE 's/^version: *([0-9][^ ]*).*/\1/p' pubspec.yaml | head -1)
24
24
  TAG := dart/v$(VERSION)
25
- AQL_DRY_RUN_FILLER := AQL-DRY-RUN-FILLER-NOT-A-REAL-SECRET
25
+ BORU_DRY_RUN_FILLER := BORU-DRY-RUN-FILLER-NOT-A-REAL-SECRET
26
26
  publish: test
27
27
  @if git rev-parse -q --verify "refs/tags/$(TAG)" >/dev/null; then \
28
28
  echo "tag $(TAG) already exists — bump pubspec.yaml version first"; exit 1; fi
29
29
  @set -e; \
30
30
  token="$${GITHUB_TOKEN:-$$GH_TOKEN}"; \
31
- if [ "$$token" = "$(AQL_DRY_RUN_FILLER)" ]; then \
32
- echo "[dry-run] aql filler token detected: would publish to pub.dev and tag $(TAG); nothing pushed."; \
31
+ if [ "$$token" = "$(BORU_DRY_RUN_FILLER)" ]; then \
32
+ echo "[dry-run] boru filler token detected: would publish to pub.dev and tag $(TAG); nothing pushed."; \
33
33
  exit 0; \
34
34
  fi; \
35
35
  if [ -n "$$PUB_CREDENTIALS" ]; then \
@@ -94,6 +94,13 @@ void tests() {
94
94
  await _runset(_g('prepareQuery.basic'), _utility.prepareQuery);
95
95
  });
96
96
 
97
+ // preparePath shipped as an empty `set: []`, so no port drove it and
98
+ // several kept private hand-written cases instead.
99
+ test('path-basic', (t) async {
100
+ await _setup();
101
+ await _runset(_g('preparePath.basic'), _utility.preparePath);
102
+ });
103
+
97
104
  test('body-basic', (t) async {
98
105
  await _setup();
99
106
  await _runset(_g('prepareBody.basic'), (dynamic ctx) {
@@ -13,10 +13,10 @@ clean:
13
13
  # Go modules have no registry upload — publishing a version means pushing the
14
14
  # tag go/vX.Y.Z (this module is the go/ subdir, and Go's submodule-tag
15
15
  # convention is <subdir>/vX.Y.Z), which the module proxy + pkg.go.dev pick up on
16
- # first fetch. Run headless under the aql key vault, which injects the GitHub
16
+ # first fetch. Run headless under the boru key vault, which injects the GitHub
17
17
  # token so nothing lands on disk or argv:
18
- # aql vault exec --for=github=<alias> -- make publish
19
- # aql `--dry-run` injects a filler token we detect to rehearse (no tag/push).
18
+ # boru vault exec --for=github=<alias> -- make publish
19
+ # boru `--dry-run` injects a filler token we detect to rehearse (no tag/push).
20
20
  # set -e + tag-last: a failed push never leaves a tag behind.
21
21
  #
22
22
  # NOTE: publishing the git tag is deliberately NOT gated on `go test` (every
@@ -24,14 +24,14 @@ clean:
24
24
  # block the module tag). Run `make test` separately in CI to gate quality.
25
25
  VERSION := $(shell cat VERSION)
26
26
  TAG := go/v$(VERSION)
27
- AQL_DRY_RUN_FILLER := AQL-DRY-RUN-FILLER-NOT-A-REAL-SECRET
27
+ BORU_DRY_RUN_FILLER := BORU-DRY-RUN-FILLER-NOT-A-REAL-SECRET
28
28
  publish:
29
29
  @if git rev-parse -q --verify "refs/tags/$(TAG)" >/dev/null; then \
30
30
  echo "tag $(TAG) already exists — bump VERSION first"; exit 1; fi
31
31
  @set -e; \
32
32
  token="$${GITHUB_TOKEN:-$$GH_TOKEN}"; \
33
- if [ "$$token" = "$(AQL_DRY_RUN_FILLER)" ]; then \
34
- echo "[dry-run] aql filler token detected: would tag $(TAG) for pkg.go.dev; nothing pushed."; \
33
+ if [ "$$token" = "$(BORU_DRY_RUN_FILLER)" ]; then \
34
+ echo "[dry-run] boru filler token detected: would tag $(TAG) for pkg.go.dev; nothing pushed."; \
35
35
  exit 0; \
36
36
  fi; \
37
37
  git tag -a "$(TAG)" -m "go v$(VERSION)"; \
@@ -3,12 +3,17 @@ package feature
3
3
  import (
4
4
  "fmt"
5
5
  "math/rand"
6
+ "regexp"
6
7
 
7
8
  vs "github.com/voxgig/struct"
8
9
 
9
10
  "GOMODULE/core"
10
11
  )
11
12
 
13
+ // The `body.<key>` form of an op's response transform: the mock wraps its
14
+ // payload in <key> so the transform can unwrap it again.
15
+ var envelopeResRe = regexp.MustCompile("^`body\\.([^`.]+)`$")
16
+
12
17
  type TestFeature struct {
13
18
  BaseFeature
14
19
  client *core.ProjectNameSDK
@@ -49,11 +54,38 @@ func (f *TestFeature) Init(ctx *core.Context, options map[string]any) {
49
54
  self := f
50
55
 
51
56
  testFetcher := func(ctx *core.Context, _fullurl string, _fetchdef map[string]any) (any, error) {
57
+ // Shape the mock payload the way the real API would, so the op's
58
+ // response transform recovers the entity from it. A point carrying
59
+ // `transform.res: ` + "`body.item`" + ` describes an API that answers
60
+ // {"item": {...}}; handing back the bare entity means the transform
61
+ // unwraps a property that is not there and the caller gets nil. The
62
+ // mock has to agree with the model, or it only ever simulates APIs
63
+ // whose responses happen to be unwrapped. Mirrors the ts mock.
64
+ envelope := func(data any) any {
65
+ if data == nil || ctx.Point == nil {
66
+ return data
67
+ }
68
+ tm, ok := ctx.Point["transform"].(map[string]any)
69
+ if !ok {
70
+ return data
71
+ }
72
+ restf, ok := tm["res"].(string)
73
+ if !ok {
74
+ return data
75
+ }
76
+ m := envelopeResRe.FindStringSubmatch(restf)
77
+ if m == nil {
78
+ return data
79
+ }
80
+ return map[string]any{m[1]: data}
81
+ }
82
+
52
83
  respond := func(status int, data any, extra map[string]any) map[string]any {
84
+ payload := envelope(data)
53
85
  out := map[string]any{
54
86
  "status": status,
55
87
  "statusText": "OK",
56
- "json": (func() any)(func() any { return data }),
88
+ "json": (func() any)(func() any { return payload }),
57
89
  "body": "not-used",
58
90
  }
59
91
  if extra != nil {