@entifix/core 0.1.0-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 (351) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +11 -0
  3. package/dist/base-entities/configuration-client/configuration-client-singleton.d.ts +39 -0
  4. package/dist/base-entities/configuration-client/configuration-client-singleton.d.ts.map +1 -0
  5. package/dist/base-entities/configuration-client/configuration-client-singleton.js +164 -0
  6. package/dist/base-entities/configuration-client/configuration-client-singleton.js.map +1 -0
  7. package/dist/base-entities/configuration-client/index.d.ts +4 -0
  8. package/dist/base-entities/configuration-client/index.d.ts.map +1 -0
  9. package/dist/base-entities/configuration-client/index.js +5 -0
  10. package/dist/base-entities/configuration-client/index.js.map +1 -0
  11. package/dist/base-entities/configuration-client/read-configuration-from-process.d.ts +11 -0
  12. package/dist/base-entities/configuration-client/read-configuration-from-process.d.ts.map +1 -0
  13. package/dist/base-entities/configuration-client/read-configuration-from-process.js +26 -0
  14. package/dist/base-entities/configuration-client/read-configuration-from-process.js.map +1 -0
  15. package/dist/base-entities/configuration-client/types.d.ts +38 -0
  16. package/dist/base-entities/configuration-client/types.d.ts.map +1 -0
  17. package/dist/base-entities/configuration-client/types.js +3 -0
  18. package/dist/base-entities/configuration-client/types.js.map +1 -0
  19. package/dist/base-entities/entifix-error/entifix-error.d.ts +31 -0
  20. package/dist/base-entities/entifix-error/entifix-error.d.ts.map +1 -0
  21. package/dist/base-entities/entifix-error/entifix-error.js +56 -0
  22. package/dist/base-entities/entifix-error/entifix-error.js.map +1 -0
  23. package/dist/base-entities/entifix-error/index.d.ts +2 -0
  24. package/dist/base-entities/entifix-error/index.d.ts.map +1 -0
  25. package/dist/base-entities/entifix-error/index.js +3 -0
  26. package/dist/base-entities/entifix-error/index.js.map +1 -0
  27. package/dist/command-palette/command-matching.d.ts +79 -0
  28. package/dist/command-palette/command-matching.d.ts.map +1 -0
  29. package/dist/command-palette/command-matching.js +116 -0
  30. package/dist/command-palette/command-matching.js.map +1 -0
  31. package/dist/command-palette/command-source.d.ts +109 -0
  32. package/dist/command-palette/command-source.d.ts.map +1 -0
  33. package/dist/command-palette/command-source.js +11 -0
  34. package/dist/command-palette/command-source.js.map +1 -0
  35. package/dist/command-palette/index.d.ts +3 -0
  36. package/dist/command-palette/index.d.ts.map +1 -0
  37. package/dist/command-palette/index.js +4 -0
  38. package/dist/command-palette/index.js.map +1 -0
  39. package/dist/entity-definition/decorators/accessor/accessor.d.ts +3 -0
  40. package/dist/entity-definition/decorators/accessor/accessor.d.ts.map +1 -0
  41. package/dist/entity-definition/decorators/accessor/accessor.js +11 -0
  42. package/dist/entity-definition/decorators/accessor/accessor.js.map +1 -0
  43. package/dist/entity-definition/decorators/accessor/index.d.ts +2 -0
  44. package/dist/entity-definition/decorators/accessor/index.d.ts.map +1 -0
  45. package/dist/entity-definition/decorators/accessor/index.js +3 -0
  46. package/dist/entity-definition/decorators/accessor/index.js.map +1 -0
  47. package/dist/entity-definition/decorators/entity/entity.d.ts +4 -0
  48. package/dist/entity-definition/decorators/entity/entity.d.ts.map +1 -0
  49. package/dist/entity-definition/decorators/entity/entity.js +9 -0
  50. package/dist/entity-definition/decorators/entity/entity.js.map +1 -0
  51. package/dist/entity-definition/decorators/entity/index.d.ts +2 -0
  52. package/dist/entity-definition/decorators/entity/index.d.ts.map +1 -0
  53. package/dist/entity-definition/decorators/entity/index.js +3 -0
  54. package/dist/entity-definition/decorators/entity/index.js.map +1 -0
  55. package/dist/entity-definition/decorators/method/index.d.ts +2 -0
  56. package/dist/entity-definition/decorators/method/index.d.ts.map +1 -0
  57. package/dist/entity-definition/decorators/method/index.js +3 -0
  58. package/dist/entity-definition/decorators/method/index.js.map +1 -0
  59. package/dist/entity-definition/decorators/method/method.d.ts +3 -0
  60. package/dist/entity-definition/decorators/method/method.d.ts.map +1 -0
  61. package/dist/entity-definition/decorators/method/method.js +10 -0
  62. package/dist/entity-definition/decorators/method/method.js.map +1 -0
  63. package/dist/entity-definition/decorators/use-case/index.d.ts +2 -0
  64. package/dist/entity-definition/decorators/use-case/index.d.ts.map +1 -0
  65. package/dist/entity-definition/decorators/use-case/index.js +3 -0
  66. package/dist/entity-definition/decorators/use-case/index.js.map +1 -0
  67. package/dist/entity-definition/decorators/use-case/use-case.d.ts +18 -0
  68. package/dist/entity-definition/decorators/use-case/use-case.d.ts.map +1 -0
  69. package/dist/entity-definition/decorators/use-case/use-case.js +26 -0
  70. package/dist/entity-definition/decorators/use-case/use-case.js.map +1 -0
  71. package/dist/entity-definition/describe/describe-child-columns.d.ts +33 -0
  72. package/dist/entity-definition/describe/describe-child-columns.d.ts.map +1 -0
  73. package/dist/entity-definition/describe/describe-child-columns.js +44 -0
  74. package/dist/entity-definition/describe/describe-child-columns.js.map +1 -0
  75. package/dist/entity-definition/describe/describe-entity-columns.d.ts +83 -0
  76. package/dist/entity-definition/describe/describe-entity-columns.d.ts.map +1 -0
  77. package/dist/entity-definition/describe/describe-entity-columns.js +112 -0
  78. package/dist/entity-definition/describe/describe-entity-columns.js.map +1 -0
  79. package/dist/entity-definition/describe/describe-entity-use-cases.d.ts +34 -0
  80. package/dist/entity-definition/describe/describe-entity-use-cases.d.ts.map +1 -0
  81. package/dist/entity-definition/describe/describe-entity-use-cases.js +24 -0
  82. package/dist/entity-definition/describe/describe-entity-use-cases.js.map +1 -0
  83. package/dist/entity-definition/describe/index.d.ts +4 -0
  84. package/dist/entity-definition/describe/index.d.ts.map +1 -0
  85. package/dist/entity-definition/describe/index.js +5 -0
  86. package/dist/entity-definition/describe/index.js.map +1 -0
  87. package/dist/entity-definition/field-path.d.ts +49 -0
  88. package/dist/entity-definition/field-path.d.ts.map +1 -0
  89. package/dist/entity-definition/field-path.js +58 -0
  90. package/dist/entity-definition/field-path.js.map +1 -0
  91. package/dist/entity-definition/helpers/entity-definition-helpers.d.ts +59 -0
  92. package/dist/entity-definition/helpers/entity-definition-helpers.d.ts.map +1 -0
  93. package/dist/entity-definition/helpers/entity-definition-helpers.js +115 -0
  94. package/dist/entity-definition/helpers/entity-definition-helpers.js.map +1 -0
  95. package/dist/entity-definition/helpers/index.d.ts +2 -0
  96. package/dist/entity-definition/helpers/index.d.ts.map +1 -0
  97. package/dist/entity-definition/helpers/index.js +3 -0
  98. package/dist/entity-definition/helpers/index.js.map +1 -0
  99. package/dist/entity-definition/links/apply-entity-links/apply-entity-links.d.ts +48 -0
  100. package/dist/entity-definition/links/apply-entity-links/apply-entity-links.d.ts.map +1 -0
  101. package/dist/entity-definition/links/apply-entity-links/apply-entity-links.js +88 -0
  102. package/dist/entity-definition/links/apply-entity-links/apply-entity-links.js.map +1 -0
  103. package/dist/entity-definition/links/apply-entity-links/index.d.ts +2 -0
  104. package/dist/entity-definition/links/apply-entity-links/index.d.ts.map +1 -0
  105. package/dist/entity-definition/links/apply-entity-links/index.js +3 -0
  106. package/dist/entity-definition/links/apply-entity-links/index.js.map +1 -0
  107. package/dist/entity-definition/links/entity-collection-link/entity-collection-link.d.ts +29 -0
  108. package/dist/entity-definition/links/entity-collection-link/entity-collection-link.d.ts.map +1 -0
  109. package/dist/entity-definition/links/entity-collection-link/entity-collection-link.js +61 -0
  110. package/dist/entity-definition/links/entity-collection-link/entity-collection-link.js.map +1 -0
  111. package/dist/entity-definition/links/entity-collection-link/index.d.ts +2 -0
  112. package/dist/entity-definition/links/entity-collection-link/index.d.ts.map +1 -0
  113. package/dist/entity-definition/links/entity-collection-link/index.js +3 -0
  114. package/dist/entity-definition/links/entity-collection-link/index.js.map +1 -0
  115. package/dist/entity-definition/links/entity-link/entity-link.d.ts +58 -0
  116. package/dist/entity-definition/links/entity-link/entity-link.d.ts.map +1 -0
  117. package/dist/entity-definition/links/entity-link/entity-link.js +79 -0
  118. package/dist/entity-definition/links/entity-link/entity-link.js.map +1 -0
  119. package/dist/entity-definition/links/entity-link/index.d.ts +2 -0
  120. package/dist/entity-definition/links/entity-link/index.d.ts.map +1 -0
  121. package/dist/entity-definition/links/entity-link/index.js +3 -0
  122. package/dist/entity-definition/links/entity-link/index.js.map +1 -0
  123. package/dist/entity-definition/links/entity-link-source/entity-link-source.d.ts +74 -0
  124. package/dist/entity-definition/links/entity-link-source/entity-link-source.d.ts.map +1 -0
  125. package/dist/entity-definition/links/entity-link-source/entity-link-source.js +11 -0
  126. package/dist/entity-definition/links/entity-link-source/entity-link-source.js.map +1 -0
  127. package/dist/entity-definition/links/entity-link-source/index.d.ts +2 -0
  128. package/dist/entity-definition/links/entity-link-source/index.d.ts.map +1 -0
  129. package/dist/entity-definition/links/entity-link-source/index.js +3 -0
  130. package/dist/entity-definition/links/entity-link-source/index.js.map +1 -0
  131. package/dist/entity-definition/meta-entities/meta-accessor/index.d.ts +2 -0
  132. package/dist/entity-definition/meta-entities/meta-accessor/index.d.ts.map +1 -0
  133. package/dist/entity-definition/meta-entities/meta-accessor/index.js +3 -0
  134. package/dist/entity-definition/meta-entities/meta-accessor/index.js.map +1 -0
  135. package/dist/entity-definition/meta-entities/meta-accessor/meta-accessor.d.ts +137 -0
  136. package/dist/entity-definition/meta-entities/meta-accessor/meta-accessor.d.ts.map +1 -0
  137. package/dist/entity-definition/meta-entities/meta-accessor/meta-accessor.js +52 -0
  138. package/dist/entity-definition/meta-entities/meta-accessor/meta-accessor.js.map +1 -0
  139. package/dist/entity-definition/meta-entities/meta-entity/index.d.ts +2 -0
  140. package/dist/entity-definition/meta-entities/meta-entity/index.d.ts.map +1 -0
  141. package/dist/entity-definition/meta-entities/meta-entity/index.js +3 -0
  142. package/dist/entity-definition/meta-entities/meta-entity/index.js.map +1 -0
  143. package/dist/entity-definition/meta-entities/meta-entity/meta-entity.d.ts +17 -0
  144. package/dist/entity-definition/meta-entities/meta-entity/meta-entity.d.ts.map +1 -0
  145. package/dist/entity-definition/meta-entities/meta-entity/meta-entity.js +13 -0
  146. package/dist/entity-definition/meta-entities/meta-entity/meta-entity.js.map +1 -0
  147. package/dist/entity-definition/meta-entities/meta-method/index.d.ts +2 -0
  148. package/dist/entity-definition/meta-entities/meta-method/index.d.ts.map +1 -0
  149. package/dist/entity-definition/meta-entities/meta-method/index.js +3 -0
  150. package/dist/entity-definition/meta-entities/meta-method/index.js.map +1 -0
  151. package/dist/entity-definition/meta-entities/meta-method/meta-method.d.ts +16 -0
  152. package/dist/entity-definition/meta-entities/meta-method/meta-method.d.ts.map +1 -0
  153. package/dist/entity-definition/meta-entities/meta-method/meta-method.js +11 -0
  154. package/dist/entity-definition/meta-entities/meta-method/meta-method.js.map +1 -0
  155. package/dist/entity-definition/meta-entities/meta-use-case/index.d.ts +2 -0
  156. package/dist/entity-definition/meta-entities/meta-use-case/index.d.ts.map +1 -0
  157. package/dist/entity-definition/meta-entities/meta-use-case/index.js +3 -0
  158. package/dist/entity-definition/meta-entities/meta-use-case/index.js.map +1 -0
  159. package/dist/entity-definition/meta-entities/meta-use-case/meta-use-case.d.ts +94 -0
  160. package/dist/entity-definition/meta-entities/meta-use-case/meta-use-case.d.ts.map +1 -0
  161. package/dist/entity-definition/meta-entities/meta-use-case/meta-use-case.js +17 -0
  162. package/dist/entity-definition/meta-entities/meta-use-case/meta-use-case.js.map +1 -0
  163. package/dist/entity-definition/metadata/entity-metadata-document.d.ts +23 -0
  164. package/dist/entity-definition/metadata/entity-metadata-document.d.ts.map +1 -0
  165. package/dist/entity-definition/metadata/entity-metadata-document.js +16 -0
  166. package/dist/entity-definition/metadata/entity-metadata-document.js.map +1 -0
  167. package/dist/entity-definition/metadata/entity-metadata-source.d.ts +19 -0
  168. package/dist/entity-definition/metadata/entity-metadata-source.d.ts.map +1 -0
  169. package/dist/entity-definition/metadata/entity-metadata-source.js +15 -0
  170. package/dist/entity-definition/metadata/entity-metadata-source.js.map +1 -0
  171. package/dist/entity-definition/metadata/index.d.ts +3 -0
  172. package/dist/entity-definition/metadata/index.d.ts.map +1 -0
  173. package/dist/entity-definition/metadata/index.js +4 -0
  174. package/dist/entity-definition/metadata/index.js.map +1 -0
  175. package/dist/entity-definition/reconstruct/clone-entity-draft.d.ts +34 -0
  176. package/dist/entity-definition/reconstruct/clone-entity-draft.d.ts.map +1 -0
  177. package/dist/entity-definition/reconstruct/clone-entity-draft.js +75 -0
  178. package/dist/entity-definition/reconstruct/clone-entity-draft.js.map +1 -0
  179. package/dist/entity-definition/reconstruct/coerce-field-value.d.ts +34 -0
  180. package/dist/entity-definition/reconstruct/coerce-field-value.d.ts.map +1 -0
  181. package/dist/entity-definition/reconstruct/coerce-field-value.js +42 -0
  182. package/dist/entity-definition/reconstruct/coerce-field-value.js.map +1 -0
  183. package/dist/entity-definition/reconstruct/index.d.ts +5 -0
  184. package/dist/entity-definition/reconstruct/index.d.ts.map +1 -0
  185. package/dist/entity-definition/reconstruct/index.js +6 -0
  186. package/dist/entity-definition/reconstruct/index.js.map +1 -0
  187. package/dist/entity-definition/reconstruct/reconstruct-child.d.ts +35 -0
  188. package/dist/entity-definition/reconstruct/reconstruct-child.d.ts.map +1 -0
  189. package/dist/entity-definition/reconstruct/reconstruct-child.js +47 -0
  190. package/dist/entity-definition/reconstruct/reconstruct-child.js.map +1 -0
  191. package/dist/entity-definition/reconstruct/reconstruct-entity.d.ts +49 -0
  192. package/dist/entity-definition/reconstruct/reconstruct-entity.d.ts.map +1 -0
  193. package/dist/entity-definition/reconstruct/reconstruct-entity.js +116 -0
  194. package/dist/entity-definition/reconstruct/reconstruct-entity.js.map +1 -0
  195. package/dist/entity-definition/serializer/deserialize.d.ts +13 -0
  196. package/dist/entity-definition/serializer/deserialize.d.ts.map +1 -0
  197. package/dist/entity-definition/serializer/deserialize.js +145 -0
  198. package/dist/entity-definition/serializer/deserialize.js.map +1 -0
  199. package/dist/entity-definition/serializer/index.d.ts +3 -0
  200. package/dist/entity-definition/serializer/index.d.ts.map +1 -0
  201. package/dist/entity-definition/serializer/index.js +4 -0
  202. package/dist/entity-definition/serializer/index.js.map +1 -0
  203. package/dist/entity-definition/serializer/serialize.d.ts +26 -0
  204. package/dist/entity-definition/serializer/serialize.d.ts.map +1 -0
  205. package/dist/entity-definition/serializer/serialize.js +64 -0
  206. package/dist/entity-definition/serializer/serialize.js.map +1 -0
  207. package/dist/envelope/event-pattern.d.ts +14 -0
  208. package/dist/envelope/event-pattern.d.ts.map +1 -0
  209. package/dist/envelope/event-pattern.js +30 -0
  210. package/dist/envelope/event-pattern.js.map +1 -0
  211. package/dist/envelope/index.d.ts +5 -0
  212. package/dist/envelope/index.d.ts.map +1 -0
  213. package/dist/envelope/index.js +6 -0
  214. package/dist/envelope/index.js.map +1 -0
  215. package/dist/envelope/make-envelope.d.ts +45 -0
  216. package/dist/envelope/make-envelope.d.ts.map +1 -0
  217. package/dist/envelope/make-envelope.js +111 -0
  218. package/dist/envelope/make-envelope.js.map +1 -0
  219. package/dist/envelope/read-envelope.d.ts +48 -0
  220. package/dist/envelope/read-envelope.d.ts.map +1 -0
  221. package/dist/envelope/read-envelope.js +138 -0
  222. package/dist/envelope/read-envelope.js.map +1 -0
  223. package/dist/envelope/types.d.ts +173 -0
  224. package/dist/envelope/types.d.ts.map +1 -0
  225. package/dist/envelope/types.js +6 -0
  226. package/dist/envelope/types.js.map +1 -0
  227. package/dist/http/session-cookies.d.ts +25 -0
  228. package/dist/http/session-cookies.d.ts.map +1 -0
  229. package/dist/http/session-cookies.js +22 -0
  230. package/dist/http/session-cookies.js.map +1 -0
  231. package/dist/i18n/format.d.ts +22 -0
  232. package/dist/i18n/format.d.ts.map +1 -0
  233. package/dist/i18n/format.js +49 -0
  234. package/dist/i18n/format.js.map +1 -0
  235. package/dist/i18n/index.d.ts +4 -0
  236. package/dist/i18n/index.d.ts.map +1 -0
  237. package/dist/i18n/index.js +5 -0
  238. package/dist/i18n/index.js.map +1 -0
  239. package/dist/i18n/locales.d.ts +23 -0
  240. package/dist/i18n/locales.d.ts.map +1 -0
  241. package/dist/i18n/locales.js +25 -0
  242. package/dist/i18n/locales.js.map +1 -0
  243. package/dist/i18n/negotiate.d.ts +39 -0
  244. package/dist/i18n/negotiate.d.ts.map +1 -0
  245. package/dist/i18n/negotiate.js +63 -0
  246. package/dist/i18n/negotiate.js.map +1 -0
  247. package/dist/index.d.ts +42 -0
  248. package/dist/index.d.ts.map +1 -0
  249. package/dist/index.js +43 -0
  250. package/dist/index.js.map +1 -0
  251. package/dist/rsql/coerce-rsql.d.ts +27 -0
  252. package/dist/rsql/coerce-rsql.d.ts.map +1 -0
  253. package/dist/rsql/coerce-rsql.js +121 -0
  254. package/dist/rsql/coerce-rsql.js.map +1 -0
  255. package/dist/rsql/index.d.ts +8 -0
  256. package/dist/rsql/index.d.ts.map +1 -0
  257. package/dist/rsql/index.js +9 -0
  258. package/dist/rsql/index.js.map +1 -0
  259. package/dist/rsql/load-request-url.d.ts +30 -0
  260. package/dist/rsql/load-request-url.d.ts.map +1 -0
  261. package/dist/rsql/load-request-url.js +67 -0
  262. package/dist/rsql/load-request-url.js.map +1 -0
  263. package/dist/rsql/parse-rsql.d.ts +35 -0
  264. package/dist/rsql/parse-rsql.d.ts.map +1 -0
  265. package/dist/rsql/parse-rsql.js +235 -0
  266. package/dist/rsql/parse-rsql.js.map +1 -0
  267. package/dist/rsql/rsql-operators.d.ts +36 -0
  268. package/dist/rsql/rsql-operators.d.ts.map +1 -0
  269. package/dist/rsql/rsql-operators.js +65 -0
  270. package/dist/rsql/rsql-operators.js.map +1 -0
  271. package/dist/rsql/rsql-values.d.ts +11 -0
  272. package/dist/rsql/rsql-values.d.ts.map +1 -0
  273. package/dist/rsql/rsql-values.js +26 -0
  274. package/dist/rsql/rsql-values.js.map +1 -0
  275. package/dist/rsql/serialize-rsql.d.ts +19 -0
  276. package/dist/rsql/serialize-rsql.d.ts.map +1 -0
  277. package/dist/rsql/serialize-rsql.js +71 -0
  278. package/dist/rsql/serialize-rsql.js.map +1 -0
  279. package/dist/rsql/sort-param.d.ts +20 -0
  280. package/dist/rsql/sort-param.d.ts.map +1 -0
  281. package/dist/rsql/sort-param.js +66 -0
  282. package/dist/rsql/sort-param.js.map +1 -0
  283. package/dist/types/BulkOutcome.d.ts +27 -0
  284. package/dist/types/BulkOutcome.d.ts.map +1 -0
  285. package/dist/types/BulkOutcome.js +8 -0
  286. package/dist/types/BulkOutcome.js.map +1 -0
  287. package/dist/types/Entity.d.ts +6 -0
  288. package/dist/types/Entity.d.ts.map +1 -0
  289. package/dist/types/Entity.js +3 -0
  290. package/dist/types/Entity.js.map +1 -0
  291. package/dist/types/EntityAction.d.ts +15 -0
  292. package/dist/types/EntityAction.d.ts.map +1 -0
  293. package/dist/types/EntityAction.js +18 -0
  294. package/dist/types/EntityAction.js.map +1 -0
  295. package/dist/types/EntityDraft.d.ts +47 -0
  296. package/dist/types/EntityDraft.d.ts.map +1 -0
  297. package/dist/types/EntityDraft.js +14 -0
  298. package/dist/types/EntityDraft.js.map +1 -0
  299. package/dist/types/EntityFiltering.d.ts +45 -0
  300. package/dist/types/EntityFiltering.d.ts.map +1 -0
  301. package/dist/types/EntityFiltering.js +30 -0
  302. package/dist/types/EntityFiltering.js.map +1 -0
  303. package/dist/types/EntityLoadRequest.d.ts +10 -0
  304. package/dist/types/EntityLoadRequest.d.ts.map +1 -0
  305. package/dist/types/EntityLoadRequest.js +3 -0
  306. package/dist/types/EntityLoadRequest.js.map +1 -0
  307. package/dist/types/EntityPage.d.ts +8 -0
  308. package/dist/types/EntityPage.d.ts.map +1 -0
  309. package/dist/types/EntityPage.js +3 -0
  310. package/dist/types/EntityPage.js.map +1 -0
  311. package/dist/types/EntityRowDraft.d.ts +79 -0
  312. package/dist/types/EntityRowDraft.d.ts.map +1 -0
  313. package/dist/types/EntityRowDraft.js +65 -0
  314. package/dist/types/EntityRowDraft.js.map +1 -0
  315. package/dist/types/EntitySelection.d.ts +117 -0
  316. package/dist/types/EntitySelection.d.ts.map +1 -0
  317. package/dist/types/EntitySelection.js +107 -0
  318. package/dist/types/EntitySelection.js.map +1 -0
  319. package/dist/types/EntitySorting.d.ts +7 -0
  320. package/dist/types/EntitySorting.d.ts.map +1 -0
  321. package/dist/types/EntitySorting.js +3 -0
  322. package/dist/types/EntitySorting.js.map +1 -0
  323. package/dist/types/Json.d.ts +37 -0
  324. package/dist/types/Json.d.ts.map +1 -0
  325. package/dist/types/Json.js +43 -0
  326. package/dist/types/Json.js.map +1 -0
  327. package/dist/types/StandardSchema.d.ts +45 -0
  328. package/dist/types/StandardSchema.d.ts.map +1 -0
  329. package/dist/types/StandardSchema.js +15 -0
  330. package/dist/types/StandardSchema.js.map +1 -0
  331. package/dist/types/UseCase.d.ts +10 -0
  332. package/dist/types/UseCase.d.ts.map +1 -0
  333. package/dist/types/UseCase.js +10 -0
  334. package/dist/types/UseCase.js.map +1 -0
  335. package/dist/wizard/index.d.ts +4 -0
  336. package/dist/wizard/index.d.ts.map +1 -0
  337. package/dist/wizard/index.js +5 -0
  338. package/dist/wizard/index.js.map +1 -0
  339. package/dist/wizard/wizard-definition.d.ts +108 -0
  340. package/dist/wizard/wizard-definition.d.ts.map +1 -0
  341. package/dist/wizard/wizard-definition.js +125 -0
  342. package/dist/wizard/wizard-definition.js.map +1 -0
  343. package/dist/wizard/wizard-navigation.d.ts +81 -0
  344. package/dist/wizard/wizard-navigation.d.ts.map +1 -0
  345. package/dist/wizard/wizard-navigation.js +139 -0
  346. package/dist/wizard/wizard-navigation.js.map +1 -0
  347. package/dist/wizard/wizard-state.d.ts +89 -0
  348. package/dist/wizard/wizard-state.d.ts.map +1 -0
  349. package/dist/wizard/wizard-state.js +103 -0
  350. package/dist/wizard/wizard-state.js.map +1 -0
  351. package/package.json +64 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/rsql/sort-param.ts"],"sourcesContent":["import { EntifixBuildError } from '../base-entities/entifix-error/index.js';\nimport type { Entity, EntityConstructor } from '../types/Entity.js';\nimport type { EntitySorting, EntitySortType } from '../types/EntitySorting.js';\nimport { allowedDescriptors } from './coerce-rsql.js';\n\n/**\n * RSQL standardizes filtering only, so sorting travels in its own `sort`\n * parameter: `+name,-code`. The sign is the direction (`-` descending, `+` or\n * none ascending) and the list position is the precedence — which is exactly\n * what `EntitySorting`'s numeric keys mean, so the two forms map one to one.\n */\nconst SEPARATOR = ',';\n\n/** Flattens the sorting records into `[property, direction]` in priority order. */\nfunction orderedEntries<TEntity extends Entity>(\n sorting: EntitySorting<TEntity>[],\n): Array<[string, EntitySortType]> {\n const entries: Array<[string, EntitySortType]> = [];\n\n for (const record of sorting) {\n for (const priority of Object.keys(record)\n .map(Number)\n .sort((left, right) => left - right)) {\n const entry = record[priority];\n if (entry) entries.push([String(entry.property), entry.type]);\n }\n }\n\n return entries;\n}\n\n/**\n * Serializes an {@link EntityLoadRequest}'s `sorting` into the `sort`\n * parameter's value. Absent or empty sorting yields `''`, which callers omit\n * from the URL rather than sending empty.\n */\nexport function serializeSort<TEntity extends Entity>(\n sorting?: EntitySorting<TEntity>[],\n): string {\n if (!sorting || sorting.length === 0) return '';\n\n return orderedEntries(sorting)\n .map(([property, type]) => `${type === 'desc' ? '-' : '+'}${property}`)\n .join(SEPARATOR);\n}\n\n/**\n * Parses the `sort` parameter into the request's `sorting`, allowlisting every\n * member against the entity's `sortable` metadata for the same reason\n * {@link coerceFiltering} does: an unchecked property name would let a client\n * sort by a member the entity never meant to expose, and an unindexed one is a\n * collection scan.\n *\n * Returns a single-record array — one record whose numeric keys carry the\n * precedence — or `undefined` when there is nothing to sort by.\n */\nexport function parseSort<TEntity extends Entity>(\n entityConstructor: EntityConstructor<TEntity>,\n parameter: string | null | undefined,\n): EntitySorting<TEntity>[] | undefined {\n const text = parameter?.trim();\n if (!text) return undefined;\n\n const allowed = allowedDescriptors(\n entityConstructor,\n descriptor => descriptor.sortable,\n );\n\n const record = {} as EntitySorting<TEntity>;\n let priority = 0;\n\n for (const rawTerm of text.split(SEPARATOR)) {\n const term = rawTerm.trim();\n if (term === '') continue;\n\n const type: EntitySortType = term.startsWith('-') ? 'desc' : 'asc';\n const name = term.replace(/^[+-]/, '');\n const descriptor = allowed.get(name);\n\n if (!descriptor) {\n throw new EntifixBuildError(\n `\"${name}\" is not a sortable member`,\n undefined,\n { property: name },\n );\n }\n\n record[priority++] = { property: descriptor.key as keyof TEntity, type };\n }\n\n return priority === 0 ? undefined : [record];\n}\n"],"names":["EntifixBuildError","allowedDescriptors","SEPARATOR","orderedEntries","sorting","entries","record","priority","Object","keys","map","Number","sort","left","right","entry","push","String","property","type","serializeSort","length","join","parseSort","entityConstructor","parameter","text","trim","undefined","allowed","descriptor","sortable","rawTerm","split","term","startsWith","name","replace","get","key"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,0CAA0C;AAG5E,SAASC,kBAAkB,QAAQ,mBAAmB;AAEtD;;;;;CAKC,GACD,MAAMC,YAAY;AAElB,iFAAiF,GACjF,SAASC,eACPC,OAAiC;IAEjC,MAAMC,UAA2C,EAAE;IAEnD,KAAK,MAAMC,UAAUF,QAAS;QAC5B,KAAK,MAAMG,YAAYC,OAAOC,IAAI,CAACH,QAChCI,GAAG,CAACC,QACJC,IAAI,CAAC,CAACC,MAAMC,QAAUD,OAAOC,OAAQ;YACtC,MAAMC,QAAQT,MAAM,CAACC,SAAS;YAC9B,IAAIQ,OAAOV,QAAQW,IAAI,CAAC;gBAACC,OAAOF,MAAMG,QAAQ;gBAAGH,MAAMI,IAAI;aAAC;QAC9D;IACF;IAEA,OAAOd;AACT;AAEA;;;;CAIC,GACD,OAAO,SAASe,cACdhB,OAAkC;IAElC,IAAI,CAACA,WAAWA,QAAQiB,MAAM,KAAK,GAAG,OAAO;IAE7C,OAAOlB,eAAeC,SACnBM,GAAG,CAAC,CAAC,CAACQ,UAAUC,KAAK,GAAK,GAAGA,SAAS,SAAS,MAAM,MAAMD,UAAU,EACrEI,IAAI,CAACpB;AACV;AAEA;;;;;;;;;CASC,GACD,OAAO,SAASqB,UACdC,iBAA6C,EAC7CC,SAAoC;IAEpC,MAAMC,OAAOD,6BAAAA,UAAWE,IAAI;IAC5B,IAAI,CAACD,MAAM,OAAOE;IAElB,MAAMC,UAAU5B,mBACduB,mBACAM,CAAAA,aAAcA,WAAWC,QAAQ;IAGnC,MAAMzB,SAAS,CAAC;IAChB,IAAIC,WAAW;IAEf,KAAK,MAAMyB,WAAWN,KAAKO,KAAK,CAAC/B,WAAY;QAC3C,MAAMgC,OAAOF,QAAQL,IAAI;QACzB,IAAIO,SAAS,IAAI;QAEjB,MAAMf,OAAuBe,KAAKC,UAAU,CAAC,OAAO,SAAS;QAC7D,MAAMC,OAAOF,KAAKG,OAAO,CAAC,SAAS;QACnC,MAAMP,aAAaD,QAAQS,GAAG,CAACF;QAE/B,IAAI,CAACN,YAAY;YACf,MAAM,IAAI9B,kBACR,CAAC,CAAC,EAAEoC,KAAK,0BAA0B,CAAC,EACpCR,WACA;gBAAEV,UAAUkB;YAAK;QAErB;QAEA9B,MAAM,CAACC,WAAW,GAAG;YAAEW,UAAUY,WAAWS,GAAG;YAAmBpB;QAAK;IACzE;IAEA,OAAOZ,aAAa,IAAIqB,YAAY;QAACtB;KAAO;AAC9C"}
@@ -0,0 +1,27 @@
1
+ import type { EntityId } from './Entity.js';
2
+ /**
3
+ * What happened to **one** row of a bulk action.
4
+ *
5
+ * Partial failure is the normal case, not an edge one: 40 rows selected, 3
6
+ * refused. A single success/failure result for the whole run lies in both
7
+ * directions — reported as a failure it hides the 37 that were written, and
8
+ * reported as a success it hides the 3 that were not, which is the worse half
9
+ * because the user walks away believing the work is done.
10
+ *
11
+ * `code` is an **error code**, never a sentence. Services answer
12
+ * `{ error, code, detail }` and the browser renders the code through the
13
+ * `errors` catalog, so a failure reason stays translatable and a new one fails
14
+ * `@r10c/i18n-check` rather than reaching a user in English
15
+ * ([docs/I18N.md](../../../../../../docs/I18N.md)).
16
+ */
17
+ export interface BulkOutcome {
18
+ id: EntityId;
19
+ ok: boolean;
20
+ /** Present only when `ok` is false. */
21
+ code?: string;
22
+ }
23
+ /** The ids that failed — what a retry re-runs, and nothing else. */
24
+ export declare function failedIds(outcomes: readonly BulkOutcome[]): EntityId[];
25
+ /** How many rows were written. */
26
+ export declare function succeededCount(outcomes: readonly BulkOutcome[]): number;
27
+ //# sourceMappingURL=BulkOutcome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BulkOutcome.d.ts","sourceRoot":"","sources":["../../src/types/BulkOutcome.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,QAAQ,CAAC;IACb,EAAE,EAAE,OAAO,CAAC;IACZ,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,oEAAoE;AACpE,wBAAgB,SAAS,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,GAAG,QAAQ,EAAE,CAEtE;AAED,kCAAkC;AAClC,wBAAgB,cAAc,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,GAAG,MAAM,CAEvE"}
@@ -0,0 +1,8 @@
1
+ /** The ids that failed — what a retry re-runs, and nothing else. */ export function failedIds(outcomes) {
2
+ return outcomes.filter((outcome)=>!outcome.ok).map((outcome)=>outcome.id);
3
+ }
4
+ /** How many rows were written. */ export function succeededCount(outcomes) {
5
+ return outcomes.filter((outcome)=>outcome.ok).length;
6
+ }
7
+
8
+ //# sourceMappingURL=BulkOutcome.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/BulkOutcome.ts"],"sourcesContent":["import type { EntityId } from './Entity.js';\n\n/**\n * What happened to **one** row of a bulk action.\n *\n * Partial failure is the normal case, not an edge one: 40 rows selected, 3\n * refused. A single success/failure result for the whole run lies in both\n * directions — reported as a failure it hides the 37 that were written, and\n * reported as a success it hides the 3 that were not, which is the worse half\n * because the user walks away believing the work is done.\n *\n * `code` is an **error code**, never a sentence. Services answer\n * `{ error, code, detail }` and the browser renders the code through the\n * `errors` catalog, so a failure reason stays translatable and a new one fails\n * `@r10c/i18n-check` rather than reaching a user in English\n * ([docs/I18N.md](../../../../../../docs/I18N.md)).\n */\nexport interface BulkOutcome {\n id: EntityId;\n ok: boolean;\n /** Present only when `ok` is false. */\n code?: string;\n}\n\n/** The ids that failed — what a retry re-runs, and nothing else. */\nexport function failedIds(outcomes: readonly BulkOutcome[]): EntityId[] {\n return outcomes.filter(outcome => !outcome.ok).map(outcome => outcome.id);\n}\n\n/** How many rows were written. */\nexport function succeededCount(outcomes: readonly BulkOutcome[]): number {\n return outcomes.filter(outcome => outcome.ok).length;\n}\n"],"names":["failedIds","outcomes","filter","outcome","ok","map","id","succeededCount","length"],"mappings":"AAwBA,kEAAkE,GAClE,OAAO,SAASA,UAAUC,QAAgC;IACxD,OAAOA,SAASC,MAAM,CAACC,CAAAA,UAAW,CAACA,QAAQC,EAAE,EAAEC,GAAG,CAACF,CAAAA,UAAWA,QAAQG,EAAE;AAC1E;AAEA,gCAAgC,GAChC,OAAO,SAASC,eAAeN,QAAgC;IAC7D,OAAOA,SAASC,MAAM,CAACC,CAAAA,UAAWA,QAAQC,EAAE,EAAEI,MAAM;AACtD"}
@@ -0,0 +1,6 @@
1
+ export type EntityId = string | number | symbol | undefined;
2
+ export interface Entity {
3
+ id: EntityId;
4
+ }
5
+ export type EntityConstructor<TEntity extends Entity> = new (...args: any[]) => TEntity;
6
+ //# sourceMappingURL=Entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Entity.d.ts","sourceRoot":"","sources":["../../src/types/Entity.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAE5D,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,QAAQ,CAAC;CACd;AAED,MAAM,MAAM,iBAAiB,CAAC,OAAO,SAAS,MAAM,IAAI,KAItD,GAAG,IAAI,EAAE,GAAG,EAAE,KACX,OAAO,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=Entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/Entity.ts"],"sourcesContent":["export type EntityId = string | number | symbol | undefined;\n\nexport interface Entity {\n id: EntityId;\n}\n\nexport type EntityConstructor<TEntity extends Entity> = new (\n // Allow any arguments in the constructor, as we don't know the specific parameters for each entity.\n // The important part is that it returns an instance of TEntity.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...args: any[]\n) => TEntity;\n"],"names":[],"mappings":"AAMA,WAKa"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * What a caller wants to do with a resource: the CRUD triple every entity has
3
+ * by construction, as opposed to a verb a domain declares with `@useCase()`.
4
+ *
5
+ * It lives in `core` rather than in the authorization vocabulary because two
6
+ * layers that may not import each other both need it. `@entifix/authz` owns
7
+ * the *permission* built from an action and re-exports these as `Actions` /
8
+ * `Action`; `@entifix/react-controls` reads the same triple off a served
9
+ * `EntityMetadataDocument` to decide whether to render Save and Delete, and
10
+ * `entifix:react` may not depend on the business layer
11
+ * ([ADR 0026](../../../../../../docs/adr/0026-the-use-case-descriptor-and-served-entity-metadata.md)).
12
+ */
13
+ export declare const ENTITY_ACTIONS: readonly ["read", "write", "delete"];
14
+ export type EntityAction = (typeof ENTITY_ACTIONS)[number];
15
+ //# sourceMappingURL=EntityAction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityAction.d.ts","sourceRoot":"","sources":["../../src/types/EntityAction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,sCAAuC,CAAC;AACnE,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * What a caller wants to do with a resource: the CRUD triple every entity has
3
+ * by construction, as opposed to a verb a domain declares with `@useCase()`.
4
+ *
5
+ * It lives in `core` rather than in the authorization vocabulary because two
6
+ * layers that may not import each other both need it. `@entifix/authz` owns
7
+ * the *permission* built from an action and re-exports these as `Actions` /
8
+ * `Action`; `@entifix/react-controls` reads the same triple off a served
9
+ * `EntityMetadataDocument` to decide whether to render Save and Delete, and
10
+ * `entifix:react` may not depend on the business layer
11
+ * ([ADR 0026](../../../../../../docs/adr/0026-the-use-case-descriptor-and-served-entity-metadata.md)).
12
+ */ export const ENTITY_ACTIONS = [
13
+ 'read',
14
+ 'write',
15
+ 'delete'
16
+ ];
17
+
18
+ //# sourceMappingURL=EntityAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/EntityAction.ts"],"sourcesContent":["/**\n * What a caller wants to do with a resource: the CRUD triple every entity has\n * by construction, as opposed to a verb a domain declares with `@useCase()`.\n *\n * It lives in `core` rather than in the authorization vocabulary because two\n * layers that may not import each other both need it. `@entifix/authz` owns\n * the *permission* built from an action and re-exports these as `Actions` /\n * `Action`; `@entifix/react-controls` reads the same triple off a served\n * `EntityMetadataDocument` to decide whether to render Save and Delete, and\n * `entifix:react` may not depend on the business layer\n * ([ADR 0026](../../../../../../docs/adr/0026-the-use-case-descriptor-and-served-entity-metadata.md)).\n */\nexport const ENTITY_ACTIONS = ['read', 'write', 'delete'] as const;\nexport type EntityAction = (typeof ENTITY_ACTIONS)[number];\n"],"names":["ENTITY_ACTIONS"],"mappings":"AAAA;;;;;;;;;;;CAWC,GACD,OAAO,MAAMA,iBAAiB;IAAC;IAAQ;IAAS;CAAS,CAAU"}
@@ -0,0 +1,47 @@
1
+ import type { EntityRowDraft } from './EntityRowDraft.js';
2
+ /**
3
+ * A form's in-progress values, keyed by accessor name.
4
+ *
5
+ * A scalar member's value is a **string**, because that is what a native input
6
+ * round-trips: a `scalarCollection` drafts as a comma list, a `date` as
7
+ * `yyyy-mm-dd`, a relation as its foreign key. Reading one is therefore still
8
+ * `values[name] ?? ''` in every place that only edits scalars.
9
+ *
10
+ * A **`composition`** member's value is an `EntityRowDraft[]` — rows the master
11
+ * owns, each a string map carrying its own `ROW_KEY`. That is the whole reason
12
+ * this is a union and not `string`: rows have no lossless string form, and the
13
+ * two shapes a draft can hold are exactly the two ADR 0034 named.
14
+ *
15
+ * **Exactly two shapes, and the union says so rather than `JsonValue`.** Both
16
+ * are JSON — a workspace autosaves a draft through `createJSONStorage`
17
+ * ([ADR 0032](../../../../../../docs/adr/0032-what-may-live-in-an-autosaved-draft.md)),
18
+ * so a class instance, an `EntityLink` or a `Date` does not degrade, it returns
19
+ * as something else, silently — but `JsonValue` would say more than is true. A
20
+ * member whose value is neither a string nor a row list has no editor, no
21
+ * coercion and no restore rule: `reconstructEntity` would carry it through
22
+ * untouched and the serializer would write it.
23
+ *
24
+ * The narrower union is also what keeps the form engine compiling. `JsonValue`
25
+ * is **recursive**, and TanStack Form derives a field-path type from the value
26
+ * it is given, so a draft typed that way makes that derivation unbounded —
27
+ * `Type instantiation is excessively deep and possibly infinite`. A row is a
28
+ * flat string map, so this union has a bottom and the derivation terminates.
29
+ *
30
+ * The alias exists in **one** place on purpose. The same structural type was
31
+ * declared four times — `EntityFormValues`, `EntityFormDraft`, `EntityLinkDraft`
32
+ * and `EntityCrudDraft` — and collapsing them is what made this widening a
33
+ * single edit rather than four found by search.
34
+ */
35
+ export type EntityDraftValue = string | readonly EntityRowDraft[];
36
+ export type EntityDraft = Record<string, EntityDraftValue>;
37
+ /**
38
+ * The string a draft holds for a scalar member.
39
+ *
40
+ * A draft value is `JsonValue` now, but every scalar editor still writes and
41
+ * reads a string, so this is the read every one of them performs — in one
42
+ * place, so a member that came back from storage as a number or `null` renders
43
+ * as an empty input instead of flipping React from controlled to uncontrolled
44
+ * mid-render.
45
+ */
46
+ export declare function readDraftString(values: EntityDraft | undefined, name: string): string;
47
+ //# sourceMappingURL=EntityDraft.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityDraft.d.ts","sourceRoot":"","sources":["../../src/types/EntityDraft.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,SAAS,cAAc,EAAE,CAAC;AAElE,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAE3D;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,GAAG,SAAS,EAC/B,IAAI,EAAE,MAAM,GACX,MAAM,CAGR"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The string a draft holds for a scalar member.
3
+ *
4
+ * A draft value is `JsonValue` now, but every scalar editor still writes and
5
+ * reads a string, so this is the read every one of them performs — in one
6
+ * place, so a member that came back from storage as a number or `null` renders
7
+ * as an empty input instead of flipping React from controlled to uncontrolled
8
+ * mid-render.
9
+ */ export function readDraftString(values, name) {
10
+ const value = values == null ? void 0 : values[name];
11
+ return typeof value === 'string' ? value : '';
12
+ }
13
+
14
+ //# sourceMappingURL=EntityDraft.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/EntityDraft.ts"],"sourcesContent":["import type { EntityRowDraft } from './EntityRowDraft.js';\n\n/**\n * A form's in-progress values, keyed by accessor name.\n *\n * A scalar member's value is a **string**, because that is what a native input\n * round-trips: a `scalarCollection` drafts as a comma list, a `date` as\n * `yyyy-mm-dd`, a relation as its foreign key. Reading one is therefore still\n * `values[name] ?? ''` in every place that only edits scalars.\n *\n * A **`composition`** member's value is an `EntityRowDraft[]` — rows the master\n * owns, each a string map carrying its own `ROW_KEY`. That is the whole reason\n * this is a union and not `string`: rows have no lossless string form, and the\n * two shapes a draft can hold are exactly the two ADR 0034 named.\n *\n * **Exactly two shapes, and the union says so rather than `JsonValue`.** Both\n * are JSON — a workspace autosaves a draft through `createJSONStorage`\n * ([ADR 0032](../../../../../../docs/adr/0032-what-may-live-in-an-autosaved-draft.md)),\n * so a class instance, an `EntityLink` or a `Date` does not degrade, it returns\n * as something else, silently — but `JsonValue` would say more than is true. A\n * member whose value is neither a string nor a row list has no editor, no\n * coercion and no restore rule: `reconstructEntity` would carry it through\n * untouched and the serializer would write it.\n *\n * The narrower union is also what keeps the form engine compiling. `JsonValue`\n * is **recursive**, and TanStack Form derives a field-path type from the value\n * it is given, so a draft typed that way makes that derivation unbounded —\n * `Type instantiation is excessively deep and possibly infinite`. A row is a\n * flat string map, so this union has a bottom and the derivation terminates.\n *\n * The alias exists in **one** place on purpose. The same structural type was\n * declared four times — `EntityFormValues`, `EntityFormDraft`, `EntityLinkDraft`\n * and `EntityCrudDraft` — and collapsing them is what made this widening a\n * single edit rather than four found by search.\n */\nexport type EntityDraftValue = string | readonly EntityRowDraft[];\n\nexport type EntityDraft = Record<string, EntityDraftValue>;\n\n/**\n * The string a draft holds for a scalar member.\n *\n * A draft value is `JsonValue` now, but every scalar editor still writes and\n * reads a string, so this is the read every one of them performs — in one\n * place, so a member that came back from storage as a number or `null` renders\n * as an empty input instead of flipping React from controlled to uncontrolled\n * mid-render.\n */\nexport function readDraftString(\n values: EntityDraft | undefined,\n name: string,\n): string {\n const value = values?.[name];\n return typeof value === 'string' ? value : '';\n}\n"],"names":["readDraftString","values","name","value"],"mappings":"AAuCA;;;;;;;;CAQC,GACD,OAAO,SAASA,gBACdC,MAA+B,EAC/BC,IAAY;IAEZ,MAAMC,QAAQF,0BAAAA,MAAQ,CAACC,KAAK;IAC5B,OAAO,OAAOC,UAAU,WAAWA,QAAQ;AAC7C"}
@@ -0,0 +1,45 @@
1
+ import type { Entity } from './Entity.js';
2
+ export declare const EntityFilterBinaryOperators: readonly ["eq", "ne", "gt", "gte", "lt", "lte"];
3
+ export type EntityFilterBinaryOperator = (typeof EntityFilterBinaryOperators)[number];
4
+ export type EntityFilterBinary<TEntity extends Entity, TKey extends keyof TEntity> = {
5
+ property: TKey;
6
+ operator: EntityFilterBinaryOperator;
7
+ value: TEntity[TKey];
8
+ };
9
+ export declare const EntityFilterArrayOperators: readonly ["in", "nin"];
10
+ export type EntityFilterArrayOperator = (typeof EntityFilterArrayOperators)[number];
11
+ export type EntityFilterArray<TEntity extends Entity, TKey extends keyof TEntity> = {
12
+ property: TKey;
13
+ operator: EntityFilterArrayOperator;
14
+ values: Array<TEntity[TKey]>;
15
+ };
16
+ export declare const EntityFilterRangeOperators: readonly ["between", "nbetween"];
17
+ export type EntityFilterRangeOperator = (typeof EntityFilterRangeOperators)[number];
18
+ export type EntityFilterRange<TEntity extends Entity, TKey extends keyof TEntity> = {
19
+ property: TKey;
20
+ operator: EntityFilterRangeOperator;
21
+ start: TEntity[TKey];
22
+ end: TEntity[TKey];
23
+ };
24
+ export declare const EntityFilterStringOperators: readonly ["like", "nlike"];
25
+ export type EntityFilterStringOperator = (typeof EntityFilterStringOperators)[number];
26
+ export type EntityFilterString<TEntity extends Entity> = {
27
+ property: keyof TEntity;
28
+ operator: EntityFilterStringOperator;
29
+ value: string;
30
+ };
31
+ export declare const EntityFilterNullOperators: readonly ["isNull", "isNotNull"];
32
+ export type EntityFilterNullOperator = (typeof EntityFilterNullOperators)[number];
33
+ export type EntityFilterNull<TEntity extends Entity, TKey extends keyof TEntity> = {
34
+ property: TKey;
35
+ operator: EntityFilterNullOperator;
36
+ };
37
+ export type EntityFilter<TEntity extends Entity> = EntityFilterBinary<TEntity, keyof TEntity> | EntityFilterArray<TEntity, keyof TEntity> | EntityFilterRange<TEntity, keyof TEntity> | EntityFilterString<TEntity> | EntityFilterNull<TEntity, keyof TEntity>;
38
+ export declare const LogicOperators: readonly ["and", "or"];
39
+ export type LogicOperator = (typeof LogicOperators)[number];
40
+ export type FilterGroup<TEntity extends Entity> = {
41
+ operator: LogicOperator;
42
+ values: Array<EntityFilter<TEntity> | FilterGroup<TEntity>>;
43
+ };
44
+ export type EntityFiltering<TEntity extends Entity> = EntityFilter<TEntity> | Array<EntityFilter<TEntity>> | FilterGroup<TEntity>;
45
+ //# sourceMappingURL=EntityFiltering.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityFiltering.d.ts","sourceRoot":"","sources":["../../src/types/EntityFiltering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,eAAO,MAAM,2BAA2B,iDAO9B,CAAC;AACX,MAAM,MAAM,0BAA0B,GACpC,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAC/C,MAAM,MAAM,kBAAkB,CAC5B,OAAO,SAAS,MAAM,EACtB,IAAI,SAAS,MAAM,OAAO,IACxB;IACF,QAAQ,EAAE,IAAI,CAAC;IACf,QAAQ,EAAE,0BAA0B,CAAC;IACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,0BAA0B,wBAAyB,CAAC;AACjE,MAAM,MAAM,yBAAyB,GACnC,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAC9C,MAAM,MAAM,iBAAiB,CAC3B,OAAO,SAAS,MAAM,EACtB,IAAI,SAAS,MAAM,OAAO,IACxB;IACF,QAAQ,EAAE,IAAI,CAAC;IACf,QAAQ,EAAE,yBAAyB,CAAC;IACpC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,0BAA0B,kCAAmC,CAAC;AAC3E,MAAM,MAAM,yBAAyB,GACnC,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAC9C,MAAM,MAAM,iBAAiB,CAC3B,OAAO,SAAS,MAAM,EACtB,IAAI,SAAS,MAAM,OAAO,IACxB;IACF,QAAQ,EAAE,IAAI,CAAC;IACf,QAAQ,EAAE,yBAAyB,CAAC;IACpC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACrB,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,2BAA2B,4BAA6B,CAAC;AACtE,MAAM,MAAM,0BAA0B,GACpC,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAC/C,MAAM,MAAM,kBAAkB,CAAC,OAAO,SAAS,MAAM,IAAI;IACvD,QAAQ,EAAE,MAAM,OAAO,CAAC;IACxB,QAAQ,EAAE,0BAA0B,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,yBAAyB,kCAAmC,CAAC;AAC1E,MAAM,MAAM,wBAAwB,GAClC,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC7C,MAAM,MAAM,gBAAgB,CAC1B,OAAO,SAAS,MAAM,EACtB,IAAI,SAAS,MAAM,OAAO,IACxB;IACF,QAAQ,EAAE,IAAI,CAAC;IACf,QAAQ,EAAE,wBAAwB,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,OAAO,SAAS,MAAM,IAC3C,kBAAkB,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,GAC1C,iBAAiB,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,GACzC,iBAAiB,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,GACzC,kBAAkB,CAAC,OAAO,CAAC,GAC3B,gBAAgB,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC;AAE7C,eAAO,MAAM,cAAc,wBAAyB,CAAC;AACrD,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAC5D,MAAM,MAAM,WAAW,CAAC,OAAO,SAAS,MAAM,IAAI;IAChD,QAAQ,EAAE,aAAa,CAAC;IACxB,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;CAC7D,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,OAAO,SAAS,MAAM,IAChD,YAAY,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC"}
@@ -0,0 +1,30 @@
1
+ export const EntityFilterBinaryOperators = [
2
+ 'eq',
3
+ 'ne',
4
+ 'gt',
5
+ 'gte',
6
+ 'lt',
7
+ 'lte'
8
+ ];
9
+ export const EntityFilterArrayOperators = [
10
+ 'in',
11
+ 'nin'
12
+ ];
13
+ export const EntityFilterRangeOperators = [
14
+ 'between',
15
+ 'nbetween'
16
+ ];
17
+ export const EntityFilterStringOperators = [
18
+ 'like',
19
+ 'nlike'
20
+ ];
21
+ export const EntityFilterNullOperators = [
22
+ 'isNull',
23
+ 'isNotNull'
24
+ ];
25
+ export const LogicOperators = [
26
+ 'and',
27
+ 'or'
28
+ ];
29
+
30
+ //# sourceMappingURL=EntityFiltering.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/EntityFiltering.ts"],"sourcesContent":["import type { Entity } from './Entity.js';\n\nexport const EntityFilterBinaryOperators = [\n 'eq',\n 'ne',\n 'gt',\n 'gte',\n 'lt',\n 'lte',\n] as const;\nexport type EntityFilterBinaryOperator =\n (typeof EntityFilterBinaryOperators)[number];\nexport type EntityFilterBinary<\n TEntity extends Entity,\n TKey extends keyof TEntity,\n> = {\n property: TKey;\n operator: EntityFilterBinaryOperator;\n value: TEntity[TKey];\n};\n\nexport const EntityFilterArrayOperators = ['in', 'nin'] as const;\nexport type EntityFilterArrayOperator =\n (typeof EntityFilterArrayOperators)[number];\nexport type EntityFilterArray<\n TEntity extends Entity,\n TKey extends keyof TEntity,\n> = {\n property: TKey;\n operator: EntityFilterArrayOperator;\n values: Array<TEntity[TKey]>;\n};\n\nexport const EntityFilterRangeOperators = ['between', 'nbetween'] as const;\nexport type EntityFilterRangeOperator =\n (typeof EntityFilterRangeOperators)[number];\nexport type EntityFilterRange<\n TEntity extends Entity,\n TKey extends keyof TEntity,\n> = {\n property: TKey;\n operator: EntityFilterRangeOperator;\n start: TEntity[TKey];\n end: TEntity[TKey];\n};\n\nexport const EntityFilterStringOperators = ['like', 'nlike'] as const;\nexport type EntityFilterStringOperator =\n (typeof EntityFilterStringOperators)[number];\nexport type EntityFilterString<TEntity extends Entity> = {\n property: keyof TEntity;\n operator: EntityFilterStringOperator;\n value: string;\n};\n\nexport const EntityFilterNullOperators = ['isNull', 'isNotNull'] as const;\nexport type EntityFilterNullOperator =\n (typeof EntityFilterNullOperators)[number];\nexport type EntityFilterNull<\n TEntity extends Entity,\n TKey extends keyof TEntity,\n> = {\n property: TKey;\n operator: EntityFilterNullOperator;\n};\n\nexport type EntityFilter<TEntity extends Entity> =\n | EntityFilterBinary<TEntity, keyof TEntity>\n | EntityFilterArray<TEntity, keyof TEntity>\n | EntityFilterRange<TEntity, keyof TEntity>\n | EntityFilterString<TEntity>\n | EntityFilterNull<TEntity, keyof TEntity>;\n\nexport const LogicOperators = ['and', 'or'] as const;\nexport type LogicOperator = (typeof LogicOperators)[number];\nexport type FilterGroup<TEntity extends Entity> = {\n operator: LogicOperator;\n values: Array<EntityFilter<TEntity> | FilterGroup<TEntity>>;\n};\n\nexport type EntityFiltering<TEntity extends Entity> =\n EntityFilter<TEntity> | Array<EntityFilter<TEntity>> | FilterGroup<TEntity>;\n"],"names":["EntityFilterBinaryOperators","EntityFilterArrayOperators","EntityFilterRangeOperators","EntityFilterStringOperators","EntityFilterNullOperators","LogicOperators"],"mappings":"AAEA,OAAO,MAAMA,8BAA8B;IACzC;IACA;IACA;IACA;IACA;IACA;CACD,CAAU;AAYX,OAAO,MAAMC,6BAA6B;IAAC;IAAM;CAAM,CAAU;AAYjE,OAAO,MAAMC,6BAA6B;IAAC;IAAW;CAAW,CAAU;AAa3E,OAAO,MAAMC,8BAA8B;IAAC;IAAQ;CAAQ,CAAU;AAStE,OAAO,MAAMC,4BAA4B;IAAC;IAAU;CAAY,CAAU;AAkB1E,OAAO,MAAMC,iBAAiB;IAAC;IAAO;CAAK,CAAU"}
@@ -0,0 +1,10 @@
1
+ import type { Entity } from './Entity.js';
2
+ import type { EntityFiltering } from './EntityFiltering.js';
3
+ import type { EntitySorting } from './EntitySorting.js';
4
+ export interface EntityLoadRequest<TEntity extends Entity = Entity> {
5
+ filtering?: EntityFiltering<TEntity>[];
6
+ sorting?: EntitySorting<TEntity>[];
7
+ page?: number;
8
+ pageSize?: number;
9
+ }
10
+ //# sourceMappingURL=EntityLoadRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityLoadRequest.d.ts","sourceRoot":"","sources":["../../src/types/EntityLoadRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,WAAW,iBAAiB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM;IAChE,SAAS,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;IACvC,OAAO,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=EntityLoadRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/EntityLoadRequest.ts"],"sourcesContent":["import type { Entity } from './Entity.js';\nimport type { EntityFiltering } from './EntityFiltering.js';\nimport type { EntitySorting } from './EntitySorting.js';\n\nexport interface EntityLoadRequest<TEntity extends Entity = Entity> {\n filtering?: EntityFiltering<TEntity>[];\n sorting?: EntitySorting<TEntity>[];\n page?: number;\n pageSize?: number;\n}\n"],"names":[],"mappings":"AAIA,WAKC"}
@@ -0,0 +1,8 @@
1
+ import type { Entity } from './Entity.js';
2
+ import type { EntityLoadRequest } from './EntityLoadRequest.js';
3
+ export interface EntityPage<TEntity extends Entity> {
4
+ items: TEntity[];
5
+ total: number;
6
+ request: EntityLoadRequest<TEntity>;
7
+ }
8
+ //# sourceMappingURL=EntityPage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityPage.d.ts","sourceRoot":"","sources":["../../src/types/EntityPage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,WAAW,UAAU,CAAC,OAAO,SAAS,MAAM;IAChD,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;CACrC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=EntityPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/EntityPage.ts"],"sourcesContent":["import type { Entity } from './Entity.js';\nimport type { EntityLoadRequest } from './EntityLoadRequest.js';\n\nexport interface EntityPage<TEntity extends Entity> {\n items: TEntity[];\n total: number;\n request: EntityLoadRequest<TEntity>;\n}\n"],"names":[],"mappings":"AAGA,WAIC"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * The member a row draft carries its client-side identity in.
3
+ *
4
+ * A `composition`'s rows are editable before the record they belong to has ever
5
+ * been saved, and the child is a **value** — `OrderItem` has no `id`, no domain
6
+ * and no permission namespace
7
+ * ([ADR 0034](../../../../../../docs/adr/0034-composition-metadata.md)). So the
8
+ * only identity a row can have is one the browser mints, and it exists for
9
+ * exactly two jobs: a stable React key, and stable focus across a re-render.
10
+ *
11
+ * `$` is not a legal first character for any member this repo declares, but that
12
+ * is a convention rather than a rule, so `describeChildColumns` **throws** on a
13
+ * child that declares this name instead of trusting it. A silent collision would
14
+ * be a row whose key is overwritten by its own data — it would re-key on every
15
+ * keystroke, lose focus mid-word, and address the wrong row's errors.
16
+ */
17
+ export declare const ROW_KEY = "$key";
18
+ /**
19
+ * One row of an owned collection, as a form holds it.
20
+ *
21
+ * Members are strings for the reason every draft value is a string — that is
22
+ * what a native input round-trips — and the whole row is JSON, because the
23
+ * workspace autosaves the master's draft through `createJSONStorage`
24
+ * ([ADR 0032](../../../../../../docs/adr/0032-what-may-live-in-an-autosaved-draft.md)).
25
+ * The key rides **inside** the row rather than in a parallel array precisely so
26
+ * that it survives that round trip attached to the row it identifies; a parallel
27
+ * structure re-introduces the index identity this exists to avoid.
28
+ *
29
+ * {@link ROW_KEY} never reaches the wire: `reconstructChild` drops it when it
30
+ * rebuilds the child, so the serializer never sees a member the entity does not
31
+ * declare.
32
+ */
33
+ export type EntityRowDraft = {
34
+ [member: string]: string;
35
+ };
36
+ /**
37
+ * Mints a key for a row the user has just added.
38
+ *
39
+ * `crypto.randomUUID` rather than a counter, because two drafts restored into
40
+ * one session must not collide, and a counter that resets on reload would
41
+ * re-issue keys a persisted draft is still using.
42
+ */
43
+ export declare function newRowKey(): string;
44
+ /**
45
+ * The key of the *n*th row as the record supplied it.
46
+ *
47
+ * Deterministic, and that is load-bearing rather than tidy. Seeding is not a
48
+ * one-time event: `useEntityForm` re-seeds whenever its `entity` changes
49
+ * identity, and a caller that builds the record inline re-seeds on **every
50
+ * render**. Minting a fresh random key there produces a draft that differs from
51
+ * the last one on every pass, so the form engine sees its defaults change
52
+ * forever and React stops with `Maximum update depth exceeded` — a live hang,
53
+ * not a test artifact.
54
+ *
55
+ * Positional is safe *here* precisely because it describes the record rather
56
+ * than the live list: re-seeding the same record yields the same keys, and once
57
+ * the user adds or removes anything the keys already in the draft are carried
58
+ * through untouched. A row added at runtime takes a {@link newRowKey} instead,
59
+ * which can never collide with this shape.
60
+ */
61
+ export declare function seededRowKey(index: number): string;
62
+ /**
63
+ * Whether a draft value is a usable list of rows.
64
+ *
65
+ * A restored draft is `JsonValue`, so a composition member can come back as
66
+ * anything — a string written by a build before this existed, `null`, or an
67
+ * array of the wrong shape. Every caller must ask before reading, and the answer
68
+ * for a value that fails is an empty grid rather than a crash: an unreadable
69
+ * draft is an unfinished edit, and `restoreEntityDraft` already discards those
70
+ * per entry rather than losing the whole form.
71
+ *
72
+ * A row missing its {@link ROW_KEY} fails, deliberately. Minting one here would
73
+ * hide the case where a row was written by something that does not know the
74
+ * contract, and the missing key would then be minted afresh on every render.
75
+ */
76
+ export declare function isRowDraftArray(value: unknown): value is EntityRowDraft[];
77
+ /** The rows a draft value holds, or an empty list when it holds none usable. */
78
+ export declare function readRowDrafts(value: unknown): EntityRowDraft[];
79
+ //# sourceMappingURL=EntityRowDraft.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityRowDraft.d.ts","sourceRoot":"","sources":["../../src/types/EntityRowDraft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,OAAO,SAAS,CAAC;AAE9B;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,cAAc,GAAG;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAE1D;;;;;;GAMG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,EAAE,CAczE;AAED,gFAAgF;AAChF,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,EAAE,CAE9D"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * The member a row draft carries its client-side identity in.
3
+ *
4
+ * A `composition`'s rows are editable before the record they belong to has ever
5
+ * been saved, and the child is a **value** — `OrderItem` has no `id`, no domain
6
+ * and no permission namespace
7
+ * ([ADR 0034](../../../../../../docs/adr/0034-composition-metadata.md)). So the
8
+ * only identity a row can have is one the browser mints, and it exists for
9
+ * exactly two jobs: a stable React key, and stable focus across a re-render.
10
+ *
11
+ * `$` is not a legal first character for any member this repo declares, but that
12
+ * is a convention rather than a rule, so `describeChildColumns` **throws** on a
13
+ * child that declares this name instead of trusting it. A silent collision would
14
+ * be a row whose key is overwritten by its own data — it would re-key on every
15
+ * keystroke, lose focus mid-word, and address the wrong row's errors.
16
+ */ export const ROW_KEY = '$key';
17
+ /**
18
+ * Mints a key for a row the user has just added.
19
+ *
20
+ * `crypto.randomUUID` rather than a counter, because two drafts restored into
21
+ * one session must not collide, and a counter that resets on reload would
22
+ * re-issue keys a persisted draft is still using.
23
+ */ export function newRowKey() {
24
+ return crypto.randomUUID();
25
+ }
26
+ /**
27
+ * The key of the *n*th row as the record supplied it.
28
+ *
29
+ * Deterministic, and that is load-bearing rather than tidy. Seeding is not a
30
+ * one-time event: `useEntityForm` re-seeds whenever its `entity` changes
31
+ * identity, and a caller that builds the record inline re-seeds on **every
32
+ * render**. Minting a fresh random key there produces a draft that differs from
33
+ * the last one on every pass, so the form engine sees its defaults change
34
+ * forever and React stops with `Maximum update depth exceeded` — a live hang,
35
+ * not a test artifact.
36
+ *
37
+ * Positional is safe *here* precisely because it describes the record rather
38
+ * than the live list: re-seeding the same record yields the same keys, and once
39
+ * the user adds or removes anything the keys already in the draft are carried
40
+ * through untouched. A row added at runtime takes a {@link newRowKey} instead,
41
+ * which can never collide with this shape.
42
+ */ export function seededRowKey(index) {
43
+ return `row-${index}`;
44
+ }
45
+ /**
46
+ * Whether a draft value is a usable list of rows.
47
+ *
48
+ * A restored draft is `JsonValue`, so a composition member can come back as
49
+ * anything — a string written by a build before this existed, `null`, or an
50
+ * array of the wrong shape. Every caller must ask before reading, and the answer
51
+ * for a value that fails is an empty grid rather than a crash: an unreadable
52
+ * draft is an unfinished edit, and `restoreEntityDraft` already discards those
53
+ * per entry rather than losing the whole form.
54
+ *
55
+ * A row missing its {@link ROW_KEY} fails, deliberately. Minting one here would
56
+ * hide the case where a row was written by something that does not know the
57
+ * contract, and the missing key would then be minted afresh on every render.
58
+ */ export function isRowDraftArray(value) {
59
+ return Array.isArray(value) && value.every((row)=>typeof row === 'object' && row !== null && !Array.isArray(row) && typeof row[ROW_KEY] === 'string' && Object.values(row).every((member)=>typeof member === 'string'));
60
+ }
61
+ /** The rows a draft value holds, or an empty list when it holds none usable. */ export function readRowDrafts(value) {
62
+ return isRowDraftArray(value) ? value : [];
63
+ }
64
+
65
+ //# sourceMappingURL=EntityRowDraft.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/EntityRowDraft.ts"],"sourcesContent":["/**\n * The member a row draft carries its client-side identity in.\n *\n * A `composition`'s rows are editable before the record they belong to has ever\n * been saved, and the child is a **value** — `OrderItem` has no `id`, no domain\n * and no permission namespace\n * ([ADR 0034](../../../../../../docs/adr/0034-composition-metadata.md)). So the\n * only identity a row can have is one the browser mints, and it exists for\n * exactly two jobs: a stable React key, and stable focus across a re-render.\n *\n * `$` is not a legal first character for any member this repo declares, but that\n * is a convention rather than a rule, so `describeChildColumns` **throws** on a\n * child that declares this name instead of trusting it. A silent collision would\n * be a row whose key is overwritten by its own data — it would re-key on every\n * keystroke, lose focus mid-word, and address the wrong row's errors.\n */\nexport const ROW_KEY = '$key';\n\n/**\n * One row of an owned collection, as a form holds it.\n *\n * Members are strings for the reason every draft value is a string — that is\n * what a native input round-trips — and the whole row is JSON, because the\n * workspace autosaves the master's draft through `createJSONStorage`\n * ([ADR 0032](../../../../../../docs/adr/0032-what-may-live-in-an-autosaved-draft.md)).\n * The key rides **inside** the row rather than in a parallel array precisely so\n * that it survives that round trip attached to the row it identifies; a parallel\n * structure re-introduces the index identity this exists to avoid.\n *\n * {@link ROW_KEY} never reaches the wire: `reconstructChild` drops it when it\n * rebuilds the child, so the serializer never sees a member the entity does not\n * declare.\n */\nexport type EntityRowDraft = { [member: string]: string };\n\n/**\n * Mints a key for a row the user has just added.\n *\n * `crypto.randomUUID` rather than a counter, because two drafts restored into\n * one session must not collide, and a counter that resets on reload would\n * re-issue keys a persisted draft is still using.\n */\nexport function newRowKey(): string {\n return crypto.randomUUID();\n}\n\n/**\n * The key of the *n*th row as the record supplied it.\n *\n * Deterministic, and that is load-bearing rather than tidy. Seeding is not a\n * one-time event: `useEntityForm` re-seeds whenever its `entity` changes\n * identity, and a caller that builds the record inline re-seeds on **every\n * render**. Minting a fresh random key there produces a draft that differs from\n * the last one on every pass, so the form engine sees its defaults change\n * forever and React stops with `Maximum update depth exceeded` — a live hang,\n * not a test artifact.\n *\n * Positional is safe *here* precisely because it describes the record rather\n * than the live list: re-seeding the same record yields the same keys, and once\n * the user adds or removes anything the keys already in the draft are carried\n * through untouched. A row added at runtime takes a {@link newRowKey} instead,\n * which can never collide with this shape.\n */\nexport function seededRowKey(index: number): string {\n return `row-${index}`;\n}\n\n/**\n * Whether a draft value is a usable list of rows.\n *\n * A restored draft is `JsonValue`, so a composition member can come back as\n * anything — a string written by a build before this existed, `null`, or an\n * array of the wrong shape. Every caller must ask before reading, and the answer\n * for a value that fails is an empty grid rather than a crash: an unreadable\n * draft is an unfinished edit, and `restoreEntityDraft` already discards those\n * per entry rather than losing the whole form.\n *\n * A row missing its {@link ROW_KEY} fails, deliberately. Minting one here would\n * hide the case where a row was written by something that does not know the\n * contract, and the missing key would then be minted afresh on every render.\n */\nexport function isRowDraftArray(value: unknown): value is EntityRowDraft[] {\n return (\n Array.isArray(value) &&\n value.every(\n row =>\n typeof row === 'object' &&\n row !== null &&\n !Array.isArray(row) &&\n typeof (row as Record<string, unknown>)[ROW_KEY] === 'string' &&\n Object.values(row as Record<string, unknown>).every(\n member => typeof member === 'string',\n ),\n )\n );\n}\n\n/** The rows a draft value holds, or an empty list when it holds none usable. */\nexport function readRowDrafts(value: unknown): EntityRowDraft[] {\n return isRowDraftArray(value) ? value : [];\n}\n"],"names":["ROW_KEY","newRowKey","crypto","randomUUID","seededRowKey","index","isRowDraftArray","value","Array","isArray","every","row","Object","values","member","readRowDrafts"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD,OAAO,MAAMA,UAAU,OAAO;AAmB9B;;;;;;CAMC,GACD,OAAO,SAASC;IACd,OAAOC,OAAOC,UAAU;AAC1B;AAEA;;;;;;;;;;;;;;;;CAgBC,GACD,OAAO,SAASC,aAAaC,KAAa;IACxC,OAAO,CAAC,IAAI,EAAEA,OAAO;AACvB;AAEA;;;;;;;;;;;;;CAaC,GACD,OAAO,SAASC,gBAAgBC,KAAc;IAC5C,OACEC,MAAMC,OAAO,CAACF,UACdA,MAAMG,KAAK,CACTC,CAAAA,MACE,OAAOA,QAAQ,YACfA,QAAQ,QACR,CAACH,MAAMC,OAAO,CAACE,QACf,OAAO,AAACA,GAA+B,CAACX,QAAQ,KAAK,YACrDY,OAAOC,MAAM,CAACF,KAAgCD,KAAK,CACjDI,CAAAA,SAAU,OAAOA,WAAW;AAItC;AAEA,8EAA8E,GAC9E,OAAO,SAASC,cAAcR,KAAc;IAC1C,OAAOD,gBAAgBC,SAASA,QAAQ,EAAE;AAC5C"}