@medyll/idae-machine 0.135.2 → 0.136.2

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 (375) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +555 -360
  3. package/cli.cjs +22 -0
  4. package/dist/__fixtures__/demoModel.d.ts +79 -0
  5. package/dist/__fixtures__/demoModel.js +146 -0
  6. package/dist/ai/frame/AiChatSession.svelte +152 -0
  7. package/dist/ai/frame/AiChatSession.svelte.d.ts +7 -0
  8. package/dist/ai/frame/index.d.ts +1 -0
  9. package/dist/ai/frame/index.js +2 -0
  10. package/dist/ai/index.d.ts +9 -0
  11. package/dist/ai/index.js +12 -0
  12. package/dist/ai/schema/ai-catalogs.d.ts +2 -0
  13. package/dist/ai/schema/ai-catalogs.js +86 -0
  14. package/dist/ai/schema/ai-chat-session.d.ts +2 -0
  15. package/dist/ai/schema/ai-chat-session.js +35 -0
  16. package/dist/ai/schema/ai-companion.d.ts +2 -0
  17. package/dist/ai/schema/ai-companion.js +25 -0
  18. package/dist/ai/schema/ai-message.d.ts +2 -0
  19. package/dist/ai/schema/ai-message.js +20 -0
  20. package/dist/ai/schema/ai-tool-call.d.ts +2 -0
  21. package/dist/ai/schema/ai-tool-call.js +18 -0
  22. package/dist/ai/schema/ai-user-prompt.d.ts +2 -0
  23. package/dist/ai/schema/ai-user-prompt.js +17 -0
  24. package/dist/ai/schema/tag.d.ts +2 -0
  25. package/dist/ai/schema/tag.js +14 -0
  26. package/dist/ai/streamIntoRecord.d.ts +31 -0
  27. package/dist/ai/streamIntoRecord.js +79 -0
  28. package/dist/config.d.ts +17 -0
  29. package/dist/config.js +19 -0
  30. package/dist/data-ui/controls/AlphabetFilter.svelte +114 -0
  31. package/dist/data-ui/controls/AlphabetFilter.svelte.d.ts +10 -0
  32. package/dist/data-ui/controls/ButtonAction.svelte +151 -0
  33. package/dist/data-ui/controls/ButtonAction.svelte.d.ts +18 -0
  34. package/dist/data-ui/controls/DataFind.svelte +174 -0
  35. package/dist/data-ui/controls/DataFind.svelte.d.ts +10 -0
  36. package/dist/data-ui/controls/DataGroup.svelte +150 -0
  37. package/dist/data-ui/controls/DataGroup.svelte.d.ts +7 -0
  38. package/dist/data-ui/controls/DataSort.svelte +78 -0
  39. package/dist/data-ui/controls/DataSort.svelte.d.ts +9 -0
  40. package/dist/data-ui/controls/DataToolbar.svelte +67 -0
  41. package/dist/data-ui/controls/DataToolbar.svelte.d.ts +11 -0
  42. package/dist/data-ui/controls/Find.svelte +38 -0
  43. package/dist/data-ui/controls/Find.svelte.d.ts +9 -0
  44. package/dist/data-ui/controls/FkFilter.svelte +94 -0
  45. package/dist/data-ui/controls/FkFilter.svelte.d.ts +11 -0
  46. package/dist/data-ui/controls/Group.svelte +36 -0
  47. package/dist/data-ui/controls/Group.svelte.d.ts +8 -0
  48. package/dist/data-ui/controls/ListMode.svelte +79 -0
  49. package/dist/data-ui/controls/ListMode.svelte.d.ts +10 -0
  50. package/dist/data-ui/controls/Sort.svelte +100 -0
  51. package/dist/data-ui/controls/Sort.svelte.d.ts +8 -0
  52. package/dist/data-ui/data/DataCount.svelte +67 -0
  53. package/dist/data-ui/data/DataCount.svelte.d.ts +36 -0
  54. package/dist/data-ui/data/DataFk.svelte +54 -0
  55. package/dist/data-ui/data/DataFk.svelte.d.ts +11 -0
  56. package/dist/data-ui/data/DataForm.svelte +191 -0
  57. package/dist/data-ui/data/DataForm.svelte.d.ts +15 -0
  58. package/dist/data-ui/data/DataList.svelte +645 -0
  59. package/dist/data-ui/data/DataList.svelte.d.ts +75 -0
  60. package/dist/data-ui/data/DataListFk.svelte +111 -0
  61. package/dist/data-ui/data/DataListFk.svelte.d.ts +13 -0
  62. package/dist/data-ui/data/DataListRfk.svelte +111 -0
  63. package/dist/data-ui/data/DataListRfk.svelte.d.ts +13 -0
  64. package/dist/data-ui/data/DataRecord.svelte +167 -0
  65. package/dist/data-ui/data/DataRecord.svelte.d.ts +22 -0
  66. package/dist/data-ui/data/DataRfk.svelte +73 -0
  67. package/dist/data-ui/data/DataRfk.svelte.d.ts +15 -0
  68. package/dist/data-ui/data/index.d.ts +7 -0
  69. package/dist/data-ui/data/index.js +8 -0
  70. package/dist/data-ui/field/DataField.svelte +343 -0
  71. package/dist/data-ui/field/DataField.svelte.d.ts +33 -0
  72. package/dist/{form/FieldInPlace.svelte → data-ui/field/DataFieldEdit.svelte} +103 -98
  73. package/dist/{form/FieldInPlace.svelte.d.ts → data-ui/field/DataFieldEdit.svelte.d.ts} +5 -5
  74. package/dist/data-ui/field/index.d.ts +2 -0
  75. package/dist/data-ui/field/index.js +3 -0
  76. package/dist/data-ui/field/snippets/FieldAiPrompt.svelte +145 -0
  77. package/dist/data-ui/field/snippets/FieldAiPrompt.svelte.d.ts +14 -0
  78. package/dist/data-ui/field/snippets/FieldBoolean.svelte +43 -0
  79. package/dist/data-ui/field/snippets/FieldBoolean.svelte.d.ts +12 -0
  80. package/dist/data-ui/field/snippets/FieldColor.svelte +48 -0
  81. package/dist/data-ui/field/snippets/FieldColor.svelte.d.ts +10 -0
  82. package/dist/data-ui/field/snippets/FieldCurrency.svelte +105 -0
  83. package/dist/data-ui/field/snippets/FieldCurrency.svelte.d.ts +15 -0
  84. package/dist/data-ui/field/snippets/FieldEmail.svelte +77 -0
  85. package/dist/data-ui/field/snippets/FieldEmail.svelte.d.ts +14 -0
  86. package/dist/data-ui/field/snippets/FieldIcon.svelte +73 -0
  87. package/dist/data-ui/field/snippets/FieldIcon.svelte.d.ts +11 -0
  88. package/dist/data-ui/field/snippets/FieldSelect.svelte +71 -0
  89. package/dist/data-ui/field/snippets/FieldSelect.svelte.d.ts +15 -0
  90. package/dist/data-ui/field/snippets/FieldText.svelte +52 -0
  91. package/dist/data-ui/field/snippets/FieldText.svelte.d.ts +13 -0
  92. package/dist/data-ui/field/snippets/FieldTextarea.svelte +50 -0
  93. package/dist/data-ui/field/snippets/FieldTextarea.svelte.d.ts +13 -0
  94. package/dist/data-ui/field/snippets/index.d.ts +9 -0
  95. package/dist/data-ui/field/snippets/index.js +10 -0
  96. package/dist/data-ui/fragments/ContextMenu.svelte +109 -0
  97. package/dist/data-ui/fragments/ContextMenu.svelte.d.ts +4 -0
  98. package/dist/data-ui/fragments/ContextMenuContent.svelte +275 -0
  99. package/dist/data-ui/fragments/ContextMenuContent.svelte.d.ts +8 -0
  100. package/dist/data-ui/fragments/Frame.svelte +43 -0
  101. package/dist/data-ui/fragments/Frame.svelte.d.ts +10 -0
  102. package/dist/data-ui/fragments/InfoLine.svelte +123 -0
  103. package/dist/data-ui/fragments/InfoLine.svelte.d.ts +12 -0
  104. package/dist/data-ui/fragments/Selector.svelte +56 -0
  105. package/dist/data-ui/fragments/Selector.svelte.d.ts +10 -0
  106. package/dist/{fragments → data-ui/fragments}/Skeleton.svelte +21 -21
  107. package/dist/data-ui/fragments/Tile.svelte +126 -0
  108. package/dist/data-ui/fragments/Tile.svelte.d.ts +14 -0
  109. package/dist/data-ui/fragments/contextMenu.svelte.d.ts +22 -0
  110. package/dist/data-ui/fragments/contextMenu.svelte.js +31 -0
  111. package/dist/data-ui/fragments/dialog/Dialog.svelte +185 -0
  112. package/dist/data-ui/fragments/dialog/Dialog.svelte.d.ts +29 -0
  113. package/dist/data-ui/fragments/dialog/dialog.svelte.d.ts +27 -0
  114. package/dist/data-ui/fragments/dialog/dialog.svelte.js +41 -0
  115. package/dist/data-ui/fragments/index.d.ts +11 -0
  116. package/dist/data-ui/fragments/index.js +11 -0
  117. package/dist/data-ui/utils/__tests__/HostProbe.svelte +18 -0
  118. package/dist/data-ui/utils/__tests__/HostProbe.svelte.d.ts +8 -0
  119. package/dist/data-ui/utils/data-utils.d.ts +29 -0
  120. package/dist/data-ui/utils/data-utils.js +83 -0
  121. package/dist/data-ui/utils/dataRelationUtils.d.ts +37 -0
  122. package/dist/data-ui/utils/dataRelationUtils.js +125 -0
  123. package/dist/data-ui/utils/diagramUtils.d.ts +6 -0
  124. package/dist/data-ui/utils/diagramUtils.js +131 -0
  125. package/dist/data-ui/utils/draggable.d.ts +15 -0
  126. package/dist/data-ui/utils/draggable.js +61 -0
  127. package/dist/data-ui/utils/menuPrefs.d.ts +80 -0
  128. package/dist/data-ui/utils/menuPrefs.js +119 -0
  129. package/dist/data-ui/utils/useMachinePrefs.svelte.d.ts +38 -0
  130. package/dist/data-ui/utils/useMachinePrefs.svelte.js +117 -0
  131. package/dist/data-ui/utils/useMenuTree.svelte.d.ts +26 -0
  132. package/dist/data-ui/utils/useMenuTree.svelte.js +68 -0
  133. package/dist/data-ui/utils/useRecordData.svelte.d.ts +22 -0
  134. package/dist/data-ui/utils/useRecordData.svelte.js +50 -0
  135. package/dist/data-ui/utils/useViewFields.svelte.d.ts +22 -0
  136. package/dist/data-ui/utils/useViewFields.svelte.js +59 -0
  137. package/dist/demo/.gitkeep +0 -0
  138. package/dist/demo/demo-status.json +9 -0
  139. package/dist/idae/boot.d.ts +28 -0
  140. package/dist/idae/boot.js +43 -0
  141. package/dist/idae/bridge/register.d.ts +4 -0
  142. package/dist/idae/bridge/register.js +15 -0
  143. package/dist/idae/capabilities/Capabilities.d.ts +10 -0
  144. package/dist/idae/capabilities/Capabilities.js +34 -0
  145. package/dist/idae/codefield/CodeFieldConvention.d.ts +3 -0
  146. package/dist/idae/codefield/CodeFieldConvention.js +25 -0
  147. package/dist/idae/fieldcatalog/defaultFieldTypesDef.d.ts +2 -0
  148. package/dist/idae/fieldcatalog/defaultFieldTypesDef.js +104 -0
  149. package/dist/idae/frames/FrameCatalog.d.ts +31 -0
  150. package/dist/idae/frames/FrameCatalog.js +31 -0
  151. package/dist/idae/index.d.ts +14 -0
  152. package/dist/idae/index.js +13 -0
  153. package/dist/idae/menu/IdaeMenuManager.d.ts +79 -0
  154. package/dist/idae/menu/IdaeMenuManager.js +108 -0
  155. package/dist/idae/menu/IdaeMenuStore.d.ts +77 -0
  156. package/dist/idae/menu/IdaeMenuStore.js +68 -0
  157. package/dist/idae/menu/menuSnapshot.d.ts +30 -0
  158. package/dist/idae/menu/menuSnapshot.js +30 -0
  159. package/dist/idae/meta/MetaModelProvider.d.ts +11 -0
  160. package/dist/idae/meta/MetaModelProvider.js +43 -0
  161. package/dist/idae/relations/RelationPolicy.d.ts +19 -0
  162. package/dist/idae/relations/RelationPolicy.js +125 -0
  163. package/dist/idae/rights/RightsPolicy.d.ts +16 -0
  164. package/dist/idae/rights/RightsPolicy.js +80 -0
  165. package/dist/idae/userscope/UserScopePolicy.d.ts +9 -0
  166. package/dist/idae/userscope/UserScopePolicy.js +42 -0
  167. package/dist/idae/userscope/navTracking.d.ts +11 -0
  168. package/dist/idae/userscope/navTracking.js +15 -0
  169. package/dist/index.d.ts +68 -35
  170. package/dist/index.js +82 -36
  171. package/dist/main/__tests__/_relationTestUtils.d.ts +12 -0
  172. package/dist/main/__tests__/_relationTestUtils.js +53 -0
  173. package/dist/main/__tests__/helpers/mockCollection.d.ts +21 -0
  174. package/dist/main/__tests__/helpers/mockCollection.js +27 -0
  175. package/dist/main/api/types.d.ts +29 -0
  176. package/dist/main/ext/hooks.d.ts +32 -0
  177. package/dist/main/ext/hooks.js +31 -0
  178. package/dist/main/ext/interfaces.d.ts +69 -0
  179. package/dist/main/ext/interfaces.js +3 -0
  180. package/dist/main/ext/registry.d.ts +29 -0
  181. package/dist/main/ext/registry.js +30 -0
  182. package/dist/main/frame/MachineFrameManager.d.ts +187 -0
  183. package/dist/main/frame/MachineFrameManager.js +403 -0
  184. package/dist/main/frame/contextMenuSetup.d.ts +9 -0
  185. package/dist/main/frame/contextMenuSetup.js +42 -0
  186. package/dist/main/frame/frameUrl.d.ts +1 -0
  187. package/dist/main/frame/frameUrl.js +8 -0
  188. package/dist/main/frame/frameUtils.d.ts +16 -0
  189. package/dist/main/frame/frameUtils.js +26 -0
  190. package/dist/main/frame/linkParser.d.ts +9 -0
  191. package/dist/main/frame/linkParser.js +15 -0
  192. package/dist/main/index.d.ts +15 -0
  193. package/dist/main/index.js +19 -0
  194. package/dist/main/machine/MachineAction.d.ts +62 -0
  195. package/dist/main/machine/MachineAction.js +96 -0
  196. package/dist/main/machine/MachineError.js +2 -2
  197. package/dist/main/machine/MachineFieldType.d.ts +25 -6
  198. package/dist/main/machine/MachineFieldType.js +118 -27
  199. package/dist/main/machine/MachineFkFold.d.ts +34 -0
  200. package/dist/main/machine/MachineFkFold.js +57 -0
  201. package/dist/main/machine/MachineRecordIdentity.d.ts +26 -0
  202. package/dist/main/machine/MachineRecordIdentity.js +44 -0
  203. package/dist/main/machine/MachineRights.d.ts +50 -0
  204. package/dist/main/machine/MachineRights.js +133 -0
  205. package/dist/main/machine/MachineRouter.d.ts +56 -0
  206. package/dist/main/machine/MachineRouter.js +250 -0
  207. package/dist/main/machine/MachineScheme.d.ts +40 -70
  208. package/dist/main/machine/MachineScheme.js +107 -94
  209. package/dist/main/machine/MachineSchemeField.js +32 -16
  210. package/dist/main/machine/MachineSchemeFieldForge.d.ts +11 -11
  211. package/dist/main/machine/MachineSchemeFieldForge.js +33 -21
  212. package/dist/main/machine/MachineSchemeFieldValues.d.ts +8 -9
  213. package/dist/main/machine/MachineSchemeFieldValues.js +12 -9
  214. package/dist/main/machine/MachineSchemeValidate.d.ts +69 -13
  215. package/dist/main/machine/MachineSchemeValidate.js +173 -46
  216. package/dist/main/machine/MachineSchemeValues.d.ts +32 -21
  217. package/dist/main/machine/MachineSchemeValues.js +132 -104
  218. package/dist/main/machine/SchemeFieldDefaultValues.d.ts +4 -2
  219. package/dist/main/machine/SchemeFieldDefaultValues.js +8 -2
  220. package/dist/main/machine/authState.svelte.d.ts +11 -0
  221. package/dist/main/machine/authState.svelte.js +17 -0
  222. package/dist/main/machine/fieldBuilder.d.ts +23 -0
  223. package/dist/main/machine/fieldBuilder.d.ts.map +1 -0
  224. package/dist/main/machine/fieldBuilder.js +10 -0
  225. package/dist/main/machine/fieldBuilder.js.map +1 -0
  226. package/dist/main/machine/machineLabel.d.ts +11 -0
  227. package/dist/main/machine/machineLabel.js +23 -0
  228. package/dist/main/machine/validateRules.d.ts +38 -0
  229. package/dist/main/machine/validateRules.js +109 -0
  230. package/dist/main/machine.d.ts +207 -68
  231. package/dist/main/machine.js +482 -96
  232. package/dist/main/machineDb.d.ts +21 -8
  233. package/dist/main/machineDb.js +33 -4
  234. package/dist/main/machineIdbAdapter.d.ts +83 -0
  235. package/dist/main/machineIdbAdapter.js +347 -0
  236. package/dist/main/machineModelBuilder.d.ts +31 -0
  237. package/dist/main/machineModelBuilder.js +58 -0
  238. package/dist/main/machineParserForge.d.ts +9 -18
  239. package/dist/main/machineParserForge.js +92 -35
  240. package/dist/main/machineSchemaCache.d.ts +8 -0
  241. package/dist/main/machineSchemaCache.js +58 -0
  242. package/dist/main/machineSchemaDoctor.d.ts +17 -0
  243. package/dist/main/machineSchemaDoctor.js +73 -0
  244. package/dist/main/machineSchemaLoader.d.ts +18 -0
  245. package/dist/main/machineSchemaLoader.js +43 -0
  246. package/dist/main/machineSeed.d.ts +21 -0
  247. package/dist/main/machineSeed.js +44 -0
  248. package/dist/main/router/componentRegistry.d.ts +35 -0
  249. package/dist/main/router/componentRegistry.js +35 -0
  250. package/dist/main/router/urlParser.d.ts +17 -0
  251. package/dist/main/router/urlParser.js +41 -0
  252. package/dist/main/warmupUtils.d.ts +40 -0
  253. package/dist/main/warmupUtils.js +73 -0
  254. package/dist/mcp/MachineMcpClient.d.ts +43 -0
  255. package/dist/mcp/MachineMcpClient.js +175 -0
  256. package/dist/shell/Frame.svelte +67 -0
  257. package/dist/shell/Frame.svelte.d.ts +11 -0
  258. package/dist/shell/auth/Login.svelte +244 -0
  259. package/dist/shell/auth/Login.svelte.d.ts +3 -0
  260. package/dist/shell/frame/dashboard/Dashboard.svelte +0 -0
  261. package/dist/shell/frame/dashboard/Dashboard.svelte.d.ts +26 -0
  262. package/dist/shell/frame/diagram/Diagram.svelte +244 -0
  263. package/dist/shell/frame/diagram/Diagram.svelte.d.ts +9 -0
  264. package/dist/shell/frame/explorer/Explorer.svelte +86 -0
  265. package/dist/shell/frame/explorer/Explorer.svelte.d.ts +29 -0
  266. package/dist/shell/frame/explorer/ExplorerContent.svelte +126 -0
  267. package/dist/shell/frame/explorer/ExplorerContent.svelte.d.ts +32 -0
  268. package/dist/shell/frame/index.d.ts +8 -0
  269. package/dist/shell/frame/index.js +9 -0
  270. package/dist/shell/frame/main-menu-content/MainMenuContent.svelte +100 -0
  271. package/dist/shell/frame/main-menu-content/MainMenuContent.svelte.d.ts +6 -0
  272. package/dist/shell/frame/planning/Planning.svelte +426 -0
  273. package/dist/shell/frame/planning/Planning.svelte.d.ts +12 -0
  274. package/dist/shell/frame/rbac/RbacMatrix.svelte +197 -0
  275. package/dist/shell/frame/rbac/RbacMatrix.svelte.d.ts +7 -0
  276. package/dist/shell/frame/space/Space.svelte +554 -0
  277. package/dist/shell/frame/space/Space.svelte.d.ts +8 -0
  278. package/dist/shell/frame/synthesis/Synthesis.svelte +383 -0
  279. package/dist/shell/frame/synthesis/Synthesis.svelte.d.ts +8 -0
  280. package/dist/shell/frame/today/Today.svelte +174 -0
  281. package/dist/shell/frame/today/Today.svelte.d.ts +3 -0
  282. package/dist/shell/layout/App.svelte +30 -0
  283. package/dist/shell/layout/App.svelte.d.ts +3 -0
  284. package/dist/shell/layout/Breadcrumb.svelte +67 -0
  285. package/dist/shell/layout/Breadcrumb.svelte.d.ts +12 -0
  286. package/dist/shell/layout/Columner.svelte +214 -0
  287. package/dist/shell/layout/Columner.svelte.d.ts +16 -0
  288. package/dist/shell/layout/DevResetPanel.svelte +194 -0
  289. package/dist/shell/layout/DevResetPanel.svelte.d.ts +7 -0
  290. package/dist/shell/layout/Fiche.svelte +111 -0
  291. package/dist/shell/layout/Fiche.svelte.d.ts +7 -0
  292. package/dist/shell/layout/FicheUpdate.svelte +53 -0
  293. package/dist/shell/layout/FicheUpdate.svelte.d.ts +7 -0
  294. package/dist/shell/layout/MainMenu.svelte +256 -0
  295. package/dist/shell/layout/MainMenu.svelte.d.ts +6 -0
  296. package/dist/shell/layout/MenuSettings.svelte +182 -0
  297. package/dist/shell/layout/MenuSettings.svelte.d.ts +6 -0
  298. package/dist/shell/layout/RecordTimeline.svelte +199 -0
  299. package/dist/shell/layout/RecordTimeline.svelte.d.ts +8 -0
  300. package/dist/shell/layout/RecordToolbar.svelte +39 -0
  301. package/dist/shell/layout/RecordToolbar.svelte.d.ts +7 -0
  302. package/dist/shell/layout/TaskBar.svelte +118 -0
  303. package/dist/shell/layout/TaskBar.svelte.d.ts +7 -0
  304. package/dist/shell/layout/TemplateShell.svelte +48 -0
  305. package/dist/shell/layout/TemplateShell.svelte.d.ts +15 -0
  306. package/dist/shell/layout/ThemeToggle.svelte +46 -0
  307. package/dist/shell/layout/ThemeToggle.svelte.d.ts +3 -0
  308. package/dist/shell/layout/index.d.ts +8 -0
  309. package/dist/shell/layout/index.js +9 -0
  310. package/dist/storage/ApiStorageAdapter.d.ts +41 -0
  311. package/dist/storage/ApiStorageAdapter.js +111 -0
  312. package/dist/storage/IdbStorageAdapter.d.ts +31 -0
  313. package/dist/storage/IdbStorageAdapter.js +72 -0
  314. package/dist/storage/MemoryStorageAdapter.d.ts +33 -0
  315. package/dist/storage/MemoryStorageAdapter.js +132 -0
  316. package/dist/storage/README.md +222 -0
  317. package/dist/storage/StorageAdapter.d.ts +75 -0
  318. package/dist/storage/StorageAdapter.js +7 -0
  319. package/dist/storage/demo/storage-demo.d.ts +22 -0
  320. package/dist/storage/demo/storage-demo.js +107 -0
  321. package/dist/storage/index.d.ts +9 -0
  322. package/dist/storage/index.js +9 -0
  323. package/dist/types/entity-types.d.ts +444 -0
  324. package/dist/types/entity-types.js +16 -0
  325. package/dist/types/index.d.ts +7 -0
  326. package/dist/types/index.js +6 -0
  327. package/dist/types/machine-model.d.ts +198 -0
  328. package/dist/types/machine-model.js +5 -0
  329. package/dist/types/qoolie-svelte.d.ts +11 -0
  330. package/dist/types/schema-utils.d.ts +32 -0
  331. package/dist/types/schema-utils.js +103 -0
  332. package/dist/utils/generateCode.d.ts +5 -0
  333. package/dist/utils/generateCode.js +9 -0
  334. package/dist/utils/logger.d.ts +10 -0
  335. package/dist/utils/logger.js +20 -0
  336. package/package.json +59 -33
  337. package/cli.js +0 -46
  338. package/dist/db/CrudService.d.ts +0 -9
  339. package/dist/db/CrudService.js +0 -45
  340. package/dist/demo/dbSchema.d.ts +0 -446
  341. package/dist/demo/dbSchema.js +0 -449
  342. package/dist/demo/testScheme.d.ts +0 -56
  343. package/dist/demo/testScheme.js +0 -42
  344. package/dist/form/CreateUpdate.svelte +0 -219
  345. package/dist/form/CreateUpdate.svelte.d.ts +0 -27
  346. package/dist/form/DataProvider.svelte +0 -23
  347. package/dist/form/DataProvider.svelte.d.ts +0 -7
  348. package/dist/form/FieldValue.svelte +0 -148
  349. package/dist/form/FieldValue.svelte.d.ts +0 -34
  350. package/dist/form/types.d.ts +0 -17
  351. package/dist/fragments/Confirm.svelte +0 -73
  352. package/dist/fragments/Confirm.svelte.d.ts +0 -7
  353. package/dist/fragments/Frame.svelte +0 -19
  354. package/dist/fragments/Frame.svelte.d.ts +0 -32
  355. package/dist/fragments/InfoLine.svelte +0 -21
  356. package/dist/fragments/InfoLine.svelte.d.ts +0 -35
  357. package/dist/fragments/Selector.svelte +0 -26
  358. package/dist/fragments/Selector.svelte.d.ts +0 -38
  359. package/dist/main/machine/MachineSchemeField.d.ts +0 -19
  360. package/dist/types/appschemeTypes.d.ts +0 -71
  361. package/dist/types/appschemeTypes.js +0 -83
  362. package/dist/ui/CollectionButton.svelte +0 -29
  363. package/dist/ui/CollectionButton.svelte.d.ts +0 -29
  364. package/dist/ui/CollectionFks.svelte +0 -24
  365. package/dist/ui/CollectionFks.svelte.d.ts +0 -9
  366. package/dist/ui/CollectionList.svelte +0 -100
  367. package/dist/ui/CollectionList.svelte.d.ts +0 -36
  368. package/dist/ui/CollectionListFieldValues.svelte +0 -59
  369. package/dist/ui/CollectionListFieldValues.svelte.d.ts +0 -9
  370. package/dist/ui/CollectionListMenu.svelte +0 -39
  371. package/dist/ui/CollectionListMenu.svelte.d.ts +0 -34
  372. package/dist/ui/CollectionReverseFks.svelte +0 -37
  373. package/dist/ui/CollectionReverseFks.svelte.d.ts +0 -14
  374. /package/dist/{fragments → data-ui/fragments}/Skeleton.svelte.d.ts +0 -0
  375. /package/dist/{form → main/api}/types.js +0 -0
@@ -1,21 +1,29 @@
1
- import type { TplCollectionName, TplFields } from "@medyll/idae-idbql";
2
- import { MachineDb } from "../machineDb.js";
1
+ import type { TplCollectionName, TplFields } from '../../types/index.js';
2
+ import { MachineDb } from '../machineDb.js';
3
3
  /**
4
- *
5
- *
6
- *
7
- *
8
4
  * @class MachineSchemeValidate
9
5
  * @role Provides validation utilities for form fields in a collection.
6
+ * Supports field validation, custom validators, cross-field validation, and async validators.
10
7
  *
11
8
  * Usage:
12
- * const validator = new IDbFormValidate('agent');
9
+ * const validator = new MachineSchemeValidate('agents', machineDb);
10
+ * validator.registerCustom('email', (val) => /^.+@.+/.test(val));
13
11
  * const result = validator.validateField('email', value);
14
12
  */
13
+ /** Validation error result structure */
14
+ export interface ValidationError {
15
+ fieldName: string;
16
+ message: string;
17
+ severity: 'error' | 'warning';
18
+ type: 'required' | 'type' | 'format' | 'custom' | 'cross-field';
19
+ }
15
20
  export declare class MachineSchemeValidate {
16
21
  #private;
17
22
  private collection;
18
23
  private machineDb;
24
+ private customValidators;
25
+ private asyncValidators;
26
+ private crossFieldValidators;
19
27
  /**
20
28
  * Create a new MachineSchemeValidate instance.
21
29
  * @role Constructor
@@ -30,22 +38,70 @@ export declare class MachineSchemeValidate {
30
38
  * @param {any} value The value to validate.
31
39
  * @return {{ isValid: boolean; error?: string; }} An object with isValid and optional error.
32
40
  */
33
- validateField(fieldName: keyof TplFields, value: unknown): {
41
+ validateField(fieldName: keyof TplFields, value: unknown, formData?: Record<string, unknown>): Promise<{
34
42
  isValid: boolean;
35
43
  error?: string;
36
- };
44
+ }>;
37
45
  /**
38
46
  * Validate a single field value for a collection.
39
47
  * @param fieldName The field name.
40
48
  * @param value The value to validate.
41
49
  * @returns True if valid, false otherwise.
42
50
  */
43
- validateFieldValue(fieldName: keyof TplFields, value: any): boolean;
44
- validateForm(formData: Record<string, any>, options?: {
51
+ /**
52
+ * Quick validation check for a field value (boolean result).
53
+ * @role Field validation
54
+ * @param {keyof TplFields} fieldName The field name to validate.
55
+ * @param {unknown} value The value to validate.
56
+ * @returns {Promise<boolean>} True if valid, false otherwise.
57
+ */
58
+ validateFieldValue(fieldName: keyof TplFields, value: unknown): Promise<boolean>;
59
+ /**
60
+ * Register a custom validator function for a specific field.
61
+ * @role Custom validation
62
+ * @param {keyof TplFields} fieldName The field name to validate.
63
+ * @param {(value: unknown) => boolean} validator The validator function (returns true if valid).
64
+ */
65
+ registerCustom(fieldName: keyof TplFields, validator: (value: unknown) => boolean): void;
66
+ /**
67
+ * Register an async validator function for a specific field.
68
+ * @role Async validation
69
+ * @param {keyof TplFields} fieldName The field name to validate.
70
+ * @param {(value: unknown) => Promise<boolean>} validator The async validator function.
71
+ */
72
+ registerAsync(fieldName: keyof TplFields, validator: (value: unknown) => Promise<boolean>): void;
73
+ /**
74
+ * Register a cross-field validator that validates multiple fields together.
75
+ * @role Cross-field validation
76
+ * @param {Object} rule The cross-field validation rule.
77
+ * @param {string[]} rule.fields The field names involved in the validation.
78
+ * @param {(data: Record<string, unknown>) => boolean | Promise<boolean>} rule.validator The validator function.
79
+ */
80
+ registerCrossField(rule: {
81
+ fields: string[];
82
+ validator: (data: Record<string, unknown>) => boolean | Promise<boolean>;
83
+ }): void;
84
+ /**
85
+ * Validate entire form data against all collection fields.
86
+ * @role Form validation
87
+ * @param {Record<string, unknown>} formData The complete form data to validate.
88
+ * @param {Object} [options] Validation options.
89
+ * @param {string[]} [options.ignoreFields] Fields to skip during validation.
90
+ * @param {Array} [options.crossFieldValidators] Array of cross-field validator functions.
91
+ * @returns {Promise<Object>} Validation result with isValid flag, error messages, and invalid field names.
92
+ */
93
+ validateForm(formData: Record<string, unknown>, options?: {
45
94
  ignoreFields?: string[] | undefined;
46
- }): {
95
+ crossFieldValidators?: Array<(data: Record<string, unknown>) => boolean | {
96
+ isValid: boolean;
97
+ errors?: Record<string, string>;
98
+ } | Promise<boolean | {
99
+ isValid: boolean;
100
+ errors?: Record<string, string>;
101
+ }>>;
102
+ }): Promise<{
47
103
  isValid: boolean;
48
104
  errors: Record<string, string>;
49
105
  invalidFields: string[];
50
- };
106
+ }>;
51
107
  }
@@ -1,21 +1,16 @@
1
- import { MachineDb } from "../machineDb.js";
2
- import { MachineErrorValidation } from "./MachineErrorValidation.js";
3
- import MachineSchemeFieldType, { defaultTypes, } from "./MachineFieldType.js";
4
- /**
5
- *
6
- *
7
- *
8
- *
9
- * @class MachineSchemeValidate
10
- * @role Provides validation utilities for form fields in a collection.
11
- *
12
- * Usage:
13
- * const validator = new IDbFormValidate('agent');
14
- * const result = validator.validateField('email', value);
15
- */
1
+ import { MachineDb } from '../machineDb.js';
2
+ import { MachineErrorValidation } from './MachineErrorValidation.js';
3
+ import { MachineError } from './MachineError.js';
4
+ import MachineSchemeFieldType, { defaultTypes } from './MachineFieldType.js';
5
+ import { validateField as validateFieldPure } from './validateRules.js';
16
6
  export class MachineSchemeValidate {
17
7
  collection;
18
8
  machineDb;
9
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
+ customValidators = new Map();
11
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
+ asyncValidators = new Map();
13
+ crossFieldValidators = [];
19
14
  /**
20
15
  * Create a new MachineSchemeValidate instance.
21
16
  * @role Constructor
@@ -33,33 +28,44 @@ export class MachineSchemeValidate {
33
28
  * @param {any} value The value to validate.
34
29
  * @return {{ isValid: boolean; error?: string; }} An object with isValid and optional error.
35
30
  */
36
- validateField(fieldName, value) {
31
+ async validateField(fieldName, value, formData) {
37
32
  try {
38
- const fieldInfo = this.machineDb
39
- .collection(this.collection)
40
- .field(fieldName)
41
- .parse();
33
+ const fieldInfo = this.machineDb.collection(this.collection).field(fieldName).parse();
42
34
  if (!fieldInfo) {
43
35
  return {
44
36
  isValid: false,
45
- error: `Field ${String(fieldName)} not found in collection`,
37
+ error: `Field ${String(fieldName)} not found in collection`
46
38
  };
47
39
  }
48
- if (!this.#validateType(value, fieldInfo.fieldType)) {
40
+ // If the value is empty (undefined/null/empty string) and the field is not required, skip further checks.
41
+ const args = (fieldInfo.fieldArgs ?? []);
42
+ const isRequired = args.includes('required');
43
+ if (value === undefined || value === null || value === '') {
44
+ if (isRequired) {
45
+ return this.#returnError(fieldName, 'required');
46
+ }
47
+ return { isValid: true };
48
+ }
49
+ const typeOK = await this.#validateType(value, fieldInfo.fieldType, {
50
+ formData,
51
+ fieldName: String(fieldName)
52
+ });
53
+ if (!typeOK) {
49
54
  return this.#returnError(fieldName, fieldInfo.fieldType);
50
55
  }
51
- if (fieldInfo.fieldArgs) {
52
- for (const arg of fieldInfo.fieldArgs) {
53
- if (arg === "required" &&
54
- (value === undefined || value === null || value === "")) {
55
- return this.#returnError(fieldName, "required");
56
- }
56
+ // Check custom validators for this field
57
+ const customValidators = this.customValidators.get(String(fieldName)) || [];
58
+ for (const validator of customValidators) {
59
+ if (!validator(value)) {
60
+ return { isValid: false, error: `Invalid value for ${String(fieldName)}` };
57
61
  }
58
62
  }
59
- const typeDef = MachineSchemeFieldType.getFieldType(fieldInfo.fieldType);
60
- if (typeDef && typeDef.validator) {
61
- if (!typeDef.validator(value)) {
62
- return this.#returnError(fieldName, fieldInfo.fieldType);
63
+ // Check async validators for this field
64
+ const asyncValidators = this.asyncValidators.get(String(fieldName)) || [];
65
+ for (const validator of asyncValidators) {
66
+ const isValid = await validator(value);
67
+ if (!isValid) {
68
+ return { isValid: false, error: `Validation failed for ${String(fieldName)}` };
63
69
  }
64
70
  }
65
71
  return { isValid: true };
@@ -68,6 +74,9 @@ export class MachineSchemeValidate {
68
74
  if (error instanceof MachineErrorValidation) {
69
75
  return { isValid: false, error: error.message };
70
76
  }
77
+ else if (error instanceof MachineError) {
78
+ return { isValid: false, error: error.message };
79
+ }
71
80
  throw error;
72
81
  }
73
82
  }
@@ -77,44 +86,162 @@ export class MachineSchemeValidate {
77
86
  * @param value The value to validate.
78
87
  * @returns True if valid, false otherwise.
79
88
  */
80
- validateFieldValue(fieldName, value) {
81
- const result = this.validateField(fieldName, value);
89
+ /**
90
+ * Quick validation check for a field value (boolean result).
91
+ * @role Field validation
92
+ * @param {keyof TplFields} fieldName The field name to validate.
93
+ * @param {unknown} value The value to validate.
94
+ * @returns {Promise<boolean>} True if valid, false otherwise.
95
+ */
96
+ async validateFieldValue(fieldName, value) {
97
+ const result = await this.validateField(fieldName, value);
82
98
  return !!result.isValid;
83
99
  }
84
- validateForm(formData, options = {}) {
100
+ /**
101
+ * Register a custom validator function for a specific field.
102
+ * @role Custom validation
103
+ * @param {keyof TplFields} fieldName The field name to validate.
104
+ * @param {(value: unknown) => boolean} validator The validator function (returns true if valid).
105
+ */
106
+ registerCustom(fieldName, validator) {
107
+ if (!this.customValidators.has(String(fieldName))) {
108
+ this.customValidators.set(String(fieldName), []);
109
+ }
110
+ this.customValidators.get(String(fieldName))?.push(validator);
111
+ }
112
+ /**
113
+ * Register an async validator function for a specific field.
114
+ * @role Async validation
115
+ * @param {keyof TplFields} fieldName The field name to validate.
116
+ * @param {(value: unknown) => Promise<boolean>} validator The async validator function.
117
+ */
118
+ registerAsync(fieldName, validator) {
119
+ if (!this.asyncValidators.has(String(fieldName))) {
120
+ this.asyncValidators.set(String(fieldName), []);
121
+ }
122
+ this.asyncValidators.get(String(fieldName))?.push(validator);
123
+ }
124
+ /**
125
+ * Register a cross-field validator that validates multiple fields together.
126
+ * @role Cross-field validation
127
+ * @param {Object} rule The cross-field validation rule.
128
+ * @param {string[]} rule.fields The field names involved in the validation.
129
+ * @param {(data: Record<string, unknown>) => boolean | Promise<boolean>} rule.validator The validator function.
130
+ */
131
+ registerCrossField(rule) {
132
+ this.crossFieldValidators.push(rule);
133
+ }
134
+ /**
135
+ * Validate entire form data against all collection fields.
136
+ * @role Form validation
137
+ * @param {Record<string, unknown>} formData The complete form data to validate.
138
+ * @param {Object} [options] Validation options.
139
+ * @param {string[]} [options.ignoreFields] Fields to skip during validation.
140
+ * @param {Array} [options.crossFieldValidators] Array of cross-field validator functions.
141
+ * @returns {Promise<Object>} Validation result with isValid flag, error messages, and invalid field names.
142
+ */
143
+ async validateForm(formData, options = {}) {
85
144
  const errors = {};
86
145
  const invalidFields = [];
87
146
  let isValid = true;
88
- const fields = this.machineDb.collection(this.collection).template.fields;
147
+ const fields = this.machineDb.collection(this.collection).fields;
89
148
  if (!fields) {
90
149
  return {
91
150
  isValid: false,
92
- errors: { general: "Collection template not found" },
93
- invalidFields: ["general"],
151
+ errors: { general: 'Collection fields not found' },
152
+ invalidFields: ['general']
94
153
  };
95
154
  }
96
- for (const [fieldName, fieldRule] of Object.entries(fields)) {
97
- // Ignorer les champs spécifiés dans options.ignoreFields
155
+ for (const [fieldName] of Object.entries(fields)) {
98
156
  if (options.ignoreFields && options.ignoreFields.includes(fieldName)) {
99
157
  continue;
100
158
  }
101
- const result = this.validateField(fieldName, formData[fieldName]);
159
+ const result = await this.validateField(fieldName, formData[fieldName], formData);
102
160
  if (!result.isValid) {
103
- errors[fieldName] = result.error || "Invalid field";
161
+ errors[fieldName] = result.error || 'Invalid field';
104
162
  invalidFields.push(fieldName);
105
163
  isValid = false;
106
164
  }
107
165
  }
166
+ // FK relations declared `required: true` in the `fks` block — checked
167
+ // separately from `fields` since FK refs aren't scalar form fields.
168
+ const scheme = this.machineDb.collection(this.collection);
169
+ for (const [relationKey, fkDef] of Object.entries(scheme.fks)) {
170
+ if (!fkDef.required)
171
+ continue;
172
+ if (options.ignoreFields && options.ignoreFields.includes(relationKey))
173
+ continue;
174
+ if (!scheme.hasFkValue(formData, relationKey)) {
175
+ errors[relationKey] = 'Ce champ est obligatoire';
176
+ invalidFields.push(relationKey);
177
+ isValid = false;
178
+ }
179
+ }
180
+ // Cross-field validators (from options parameter)
181
+ if (options.crossFieldValidators) {
182
+ for (const vf of options.crossFieldValidators) {
183
+ const out = await vf(formData);
184
+ if (typeof out === 'boolean') {
185
+ if (!out) {
186
+ errors['__form'] = 'Cross-field validation failed';
187
+ invalidFields.push('__form');
188
+ isValid = false;
189
+ }
190
+ }
191
+ else if (typeof out === 'object') {
192
+ if (!out.isValid) {
193
+ if (out.errors) {
194
+ Object.entries(out.errors).forEach(([k, v]) => {
195
+ errors[k] = v;
196
+ invalidFields.push(k);
197
+ isValid = false;
198
+ });
199
+ }
200
+ else {
201
+ errors['__form'] = 'Cross-field validation failed';
202
+ invalidFields.push('__form');
203
+ isValid = false;
204
+ }
205
+ }
206
+ }
207
+ }
208
+ }
209
+ // Cross-field validators (registered instance validators)
210
+ for (const rule of this.crossFieldValidators) {
211
+ try {
212
+ const result = await rule.validator(formData);
213
+ if (!result) {
214
+ errors['__form'] = `Cross-field validation failed for fields: ${rule.fields.join(', ')}`;
215
+ invalidFields.push('__form');
216
+ isValid = false;
217
+ }
218
+ }
219
+ catch (error) {
220
+ errors['__form'] = 'Cross-field validation error';
221
+ invalidFields.push('__form');
222
+ isValid = false;
223
+ }
224
+ }
108
225
  return { isValid, errors, invalidFields };
109
226
  }
110
- #validateType(value, type) {
111
- const typeDef = MachineSchemeFieldType.getFieldType(type ?? "any");
227
+ async #validateType(value, type, ctx) {
228
+ // First try the shared pure validateRules for standard types
229
+ const pureError = validateFieldPure(value, { type: type ?? 'any' });
230
+ if (pureError !== null) {
231
+ return false;
232
+ }
233
+ // Then check MachineSchemeFieldType registry for custom types
234
+ const typeDef = MachineSchemeFieldType.getFieldType(type ?? 'any');
112
235
  if (typeDef && typeDef.validator) {
113
- return typeDef.validator(value);
236
+ const res = typeDef.validator(value, ctx);
237
+ if (res && typeof res?.then === 'function') {
238
+ return (await res);
239
+ }
240
+ return Boolean(res);
114
241
  }
115
242
  return true;
116
243
  }
117
244
  #returnError(fieldName, enumCode) {
118
- throw new MachineErrorValidation(String(fieldName), enumCode ?? "unknown", `Invalid format for field ${String(fieldName)}. Cause "${enumCode}" `);
245
+ throw new MachineErrorValidation(String(fieldName), enumCode ?? 'unknown', `Invalid format for field ${String(fieldName)}. Cause "${enumCode}" `);
119
246
  }
120
247
  }
@@ -1,4 +1,4 @@
1
- import type { TplCollectionName, TplFields } from '@medyll/idae-idbql';
1
+ import type { TplCollectionName, TplFields } from '../../types/index.js';
2
2
  import { MachineDb } from '../machineDb.js';
3
3
  /**
4
4
  * @class MachineSchemeValues
@@ -8,7 +8,7 @@ import { MachineDb } from '../machineDb.js';
8
8
  *
9
9
  * @template T The type of the data object for the collection.
10
10
  */
11
- export declare class MachineSchemeValues<T extends Record<string, any>> {
11
+ export declare class MachineSchemeValues<T extends Record<string, unknown>> {
12
12
  #private;
13
13
  /**
14
14
  * The IDbBase instance used for schema introspection.
@@ -28,10 +28,10 @@ export declare class MachineSchemeValues<T extends Record<string, any>> {
28
28
  /**
29
29
  * Get the presentation string for a data object, using the collection's presentation template.
30
30
  * @role Presentation logic
31
- * @param {Record<string, any>} data The data object.
31
+ * @param {Record<string, unknown>} data The data object.
32
32
  * @return {string} The formatted presentation string.
33
33
  */
34
- presentation(data: Record<string, any>): string;
34
+ presentation(data: Record<string, unknown>): string;
35
35
  /**
36
36
  * Get the value of the index field for a data object.
37
37
  * @param data The data object.
@@ -40,10 +40,10 @@ export declare class MachineSchemeValues<T extends Record<string, any>> {
40
40
  /**
41
41
  * Get the value of the index field for a data object.
42
42
  * @role Index accessor
43
- * @param {Record<string, any>} data The data object.
44
- * @return {any | null} The value of the index field, or null if not found.
43
+ * @param {Record<string, unknown>} data The data object.
44
+ * @return {unknown | null} The value of the index field, or null if not found.
45
45
  */
46
- indexValue(data: Record<string, any>): any | null;
46
+ indexValue(data: Record<string, unknown>): unknown | null;
47
47
  /**
48
48
  * Format a field value for display, using the field type and schema.
49
49
  * @param fieldName The field name.
@@ -71,7 +71,7 @@ export declare class MachineSchemeValues<T extends Record<string, any>> {
71
71
  * @param {T} data The data object.
72
72
  * @return {Record<`data-${'collection' | 'collectionId' | 'fieldName' | 'fieldType' | 'fieldArgs'}`, string>} The data-* attributes for the field.
73
73
  */
74
- getInputDataSet(fieldName: string, data: T): Record<`data-${'collection' | 'collectionId' | 'fieldName' | 'fieldType' | 'fieldArgs'}`, string>;
74
+ getInputDataSet(fieldName: string, data: T): Record<`data-${'collection' | 'collection-id' | 'fieldName' | 'fieldType' | 'fieldArgs' | 'inputSize'}`, string>;
75
75
  /**
76
76
  * Iterate over an array field and return an array of IDbForge objects for each element.
77
77
  * @param fieldName The field name.
@@ -82,28 +82,39 @@ export declare class MachineSchemeValues<T extends Record<string, any>> {
82
82
  * Iterate over an array field and return an array of IDbForge objects for each element.
83
83
  * @role Array field iteration
84
84
  * @param {keyof TplFields} fieldName The field name.
85
- * @param {any[]} data The array data.
86
- * @return {IDbForge[]} An array of IDbForge objects.
85
+ * @param {unknown[]} data The array data.
86
+ * @return {Array<Record<string, unknown>>} An array of IDbForge objects.
87
87
  */
88
- iterateArrayField(fieldName: keyof TplFields, data: any[]): any[];
88
+ iterateArrayField(fieldName: keyof TplFields, data: unknown[]): Array<Record<string, unknown>>;
89
89
  /**
90
- * Iterate over an object field and return an array of IDbForge objects for each property.
90
+ * Iterate over an object field and return data rows keyed by property name.
91
91
  * @param fieldName The field name.
92
92
  * @param data The object data.
93
- * @returns An array of IDbForge objects.
93
+ * @returns Data rows derived from the object's properties.
94
94
  */
95
+ iterateObjectField(fieldName: keyof TplFields, data: Record<string, unknown>): Array<Record<string, unknown>>;
95
96
  /**
96
- * Iterate over an object field and return an array of IDbForge objects for each property.
97
- * @role Object field iteration
98
- * @param {keyof TplFields} fieldName The field name.
99
- * @param {Record<string, unknown>} data The object data.
100
- * @return {IDbForge[]} An array of IDbForge objects.
97
+ * Resolved descriptor for a single field — the machine-native equivalent of the legacy
98
+ * `columnModel[]` entry. Scalar-vs-FK divergence is decided HERE, never in a component.
99
+ */
100
+ descriptor(fieldName: string): {
101
+ kind: 'scalar' | 'fk';
102
+ fieldName: string;
103
+ fieldType: string;
104
+ title: string;
105
+ fkCollection?: string;
106
+ fkIndexField?: string;
107
+ } | null;
108
+ /**
109
+ * Human-readable display value for a field.
110
+ * Scalar → MachineSchemeFieldType.format(). FK → presentation(targetRecord).
111
+ * `resolveTarget` is injected by the caller (keeps this class pure/testable).
101
112
  */
102
- iterateObjectField(fieldName: keyof TplFields, data: Record<string, unknown>): any[];
113
+ displayValue(fieldName: keyof T, data: T, resolveTarget?: (fkCollection: string, fkIndexField: string, value: unknown) => Record<string, unknown> | undefined): string;
103
114
  /**
104
115
  * Get default values for the collection, using global and collection-specific factories.
105
116
  * @role Default values
106
- * @returns {Record<string, any>} An object with default values for each field in the collection.
117
+ * @returns {Record<string, unknown>} An object with default values for each field in the collection.
107
118
  */
108
- getDefaults(): Record<string, any>;
119
+ getDefaults(): Record<string, unknown>;
109
120
  }