@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,83 @@
1
+ import { type ChildConstructor, type EntityLinkSerialization, MetaAccessorType } from '../meta-entities/meta-accessor/index.js';
2
+ /**
3
+ * A displayable member of an entity, resolved from its accessor metadata. This
4
+ * is the contract generic UI builds itself from — a table's columns today, a
5
+ * form's fields later — so it stays framework-free and lives next to the
6
+ * metadata it derives from.
7
+ */
8
+ export interface EntityFieldDescriptor {
9
+ /** Accessor name. The stable identity used by preferences and slots. */
10
+ name: string;
11
+ /** Wire/property key: `alias ?? name`. */
12
+ key: string;
13
+ label: string;
14
+ /**
15
+ * Catalog key for {@link label}, when the entity declared one. Resolution is
16
+ * the presentation layer's job — core has no locale and no catalogs, and the
17
+ * same descriptor feeds the server-side filter allowlist, where a translated
18
+ * label would be meaningless.
19
+ */
20
+ labelKey?: string;
21
+ type: MetaAccessorType;
22
+ sortable: boolean;
23
+ filterable: boolean;
24
+ order: number;
25
+ /** Cannot be written back. A form shows it but disables its input. */
26
+ readonly: boolean;
27
+ /** Must hold a value. A form rejects submit while it is empty. */
28
+ required: boolean;
29
+ enumValues?: readonly string[];
30
+ /** Catalog prefix for {@link enumValues}; a value reads as `${enumLabelKey}.${value}`. */
31
+ enumLabelKey?: string;
32
+ /** Property of a `link` target used as its display label. */
33
+ linkLabelProperty: string;
34
+ /** Property of a `link` target a picker searches on. Defaults to the label. */
35
+ linkSearchProperty: string;
36
+ /** Whether a `link` writes back its foreign key or the inlined target. */
37
+ linkSerialization: EntityLinkSerialization;
38
+ /**
39
+ * The class describing one row of a `composition` member, resolved from the
40
+ * accessor's thunk. Absent on every other type.
41
+ */
42
+ childType?: ChildConstructor;
43
+ /**
44
+ * The member is dropped when the record is copied — a unique code, an audit
45
+ * stamp. The identity member is always reset and is not flagged.
46
+ */
47
+ resetOnClone: boolean;
48
+ }
49
+ /** Types whose values are scalars a user can meaningfully sort/filter on. */
50
+ export declare const SCALAR_TYPES: readonly MetaAccessorType[];
51
+ /**
52
+ * Types whose value is a collection. None of them may ever be sorted or
53
+ * filtered: this descriptor is also the **server-side RSQL allowlist**, and an
54
+ * array compared as a scalar matches nothing — so the query would not fail, it
55
+ * would quietly return an empty page.
56
+ *
57
+ * Exported so `describe-entity-columns.spec.ts` can assert that this list,
58
+ * {@link SCALAR_TYPES} and the two reference types partition
59
+ * `MetaAccessorTypes` exactly. Nothing in the repo guards `MetaAccessorType`
60
+ * exhaustively — every switch over it has a `default` that treats the value as
61
+ * a string — so that partition spec is what makes an eleventh type impossible
62
+ * to add silently.
63
+ */
64
+ export declare const COLLECTION_TYPES: readonly MetaAccessorType[];
65
+ /**
66
+ * Resolves an entity's displayable members from its accessor metadata, sorted by
67
+ * `order` (declaration order when undeclared).
68
+ *
69
+ * Getter-kind and non-`hidden` mirror the filter {@link serializeEntity} walks,
70
+ * minus its `readonly` exclusion: a read-only member is still worth showing,
71
+ * it just cannot be written back.
72
+ *
73
+ * `sample` is an optional instance used only to infer the `type` of accessors
74
+ * that did not declare one.
75
+ *
76
+ * The target is a {@link ChildConstructor} rather than an `EntityConstructor`,
77
+ * which is wider than it looks: nothing here reads `id`, and a `composition`
78
+ * member's child is a **value** with accessors and no identity. So the same
79
+ * walk describes an entity and describes one row of the collection it owns,
80
+ * from one implementation.
81
+ */
82
+ export declare function describeEntityColumns<TTarget extends object>(entityConstructor: ChildConstructor<TTarget>, sample?: TTarget): EntityFieldDescriptor[];
83
+ //# sourceMappingURL=describe-entity-columns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe-entity-columns.d.ts","sourceRoot":"","sources":["../../../src/entity-definition/describe/describe-entity-columns.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAE5B,gBAAgB,EACjB,MAAM,yCAAyC,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,QAAQ,EAAE,OAAO,CAAC;IAClB,kEAAkE;IAClE,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,0FAA0F;IAC1F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,iBAAiB,EAAE,MAAM,CAAC;IAC1B,+EAA+E;IAC/E,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0EAA0E;IAC1E,iBAAiB,EAAE,uBAAuB,CAAC;IAC3C;;;OAGG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B;;;OAGG;IACH,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,6EAA6E;AAC7E,eAAO,MAAM,YAAY,EAAE,SAAS,gBAAgB,EAMnD,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,gBAAgB,EAIvD,CAAC;AAkFF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,SAAS,MAAM,EAC1D,iBAAiB,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAC5C,MAAM,CAAC,EAAE,OAAO,GACf,qBAAqB,EAAE,CAazB"}
@@ -0,0 +1,112 @@
1
+ import { EntifixBuildError } from '../../base-entities/entifix-error/index.js';
2
+ import { extractMetaAccessors } from '../helpers/index.js';
3
+ import { EntityCollectionLink } from '../links/entity-collection-link/index.js';
4
+ import { EntityLink } from '../links/entity-link/index.js';
5
+ /** Types whose values are scalars a user can meaningfully sort/filter on. */ export const SCALAR_TYPES = [
6
+ 'string',
7
+ 'number',
8
+ 'boolean',
9
+ 'date',
10
+ 'enum'
11
+ ];
12
+ /**
13
+ * Types whose value is a collection. None of them may ever be sorted or
14
+ * filtered: this descriptor is also the **server-side RSQL allowlist**, and an
15
+ * array compared as a scalar matches nothing — so the query would not fail, it
16
+ * would quietly return an empty page.
17
+ *
18
+ * Exported so `describe-entity-columns.spec.ts` can assert that this list,
19
+ * {@link SCALAR_TYPES} and the two reference types partition
20
+ * `MetaAccessorTypes` exactly. Nothing in the repo guards `MetaAccessorType`
21
+ * exhaustively — every switch over it has a `default` that treats the value as
22
+ * a string — so that partition spec is what makes an eleventh type impossible
23
+ * to add silently.
24
+ */ export const COLLECTION_TYPES = [
25
+ 'linkCollection',
26
+ 'composition',
27
+ 'scalarCollection'
28
+ ];
29
+ /** `productCode` / `product-code` / `product_code` → `Product Code`. */ function humanize(name) {
30
+ return name.replace(/[-_]+/g, ' ').replace(/([a-z0-9])([A-Z])/g, '$1 $2').replace(/\s+/g, ' ').trim().replace(/^./, (first)=>first.toUpperCase());
31
+ }
32
+ /**
33
+ * Best-effort type for accessors that did not declare one. Entities are not
34
+ * required to annotate every member, so a sample row keeps a bare `@accessor()`
35
+ * usable; a declared `type` always wins over this.
36
+ */ function inferType(name, value) {
37
+ if (value instanceof EntityLink) return 'link';
38
+ if (value instanceof EntityCollectionLink) return 'linkCollection';
39
+ if (value instanceof Date) return 'date';
40
+ if (typeof value === 'number') return 'number';
41
+ if (typeof value === 'boolean') return 'boolean';
42
+ if (name === 'id') return 'id';
43
+ return 'string';
44
+ }
45
+ /**
46
+ * A collection member declared queryable is always a mistake, so it breaks the
47
+ * developer rather than the query — the same posture as `applyEntityLinks`
48
+ * throwing on an `embedded` link it cannot build.
49
+ *
50
+ * Silently clamping to `false` was the alternative and is worse: the author
51
+ * keeps a declaration that reads as honoured, and the symptom is an empty
52
+ * result page rather than an error anyone can act on.
53
+ */ function assertNotQueryable(metaAccessor, type) {
54
+ if (!COLLECTION_TYPES.includes(type)) return;
55
+ if (metaAccessor.sortable !== true && metaAccessor.filterable !== true) return;
56
+ throw new EntifixBuildError(`"${String(metaAccessor.name)}" is a ${type} and cannot be sortable or filterable — member metadata is the server-side query allowlist, and a collection compared as a scalar matches nothing.`);
57
+ }
58
+ function toDescriptor(metaAccessor, index, sample) {
59
+ var _metaAccessor_type, _metaAccessor_linkLabelProperty, _metaAccessor_alias, _metaAccessor_label, _metaAccessor_sortable, _metaAccessor_filterable, _metaAccessor_order, _metaAccessor_readonly, _metaAccessor_required, _metaAccessor_linkSearchProperty, _metaAccessor_linkSerialization, _metaAccessor_resetOnClone;
60
+ const name = String(metaAccessor.name);
61
+ const type = (_metaAccessor_type = metaAccessor.type) != null ? _metaAccessor_type : inferType(name, sample == null ? void 0 : sample[name]);
62
+ assertNotQueryable(metaAccessor, type);
63
+ const isScalar = SCALAR_TYPES.includes(type);
64
+ const linkLabelProperty = (_metaAccessor_linkLabelProperty = metaAccessor.linkLabelProperty) != null ? _metaAccessor_linkLabelProperty : 'name';
65
+ return {
66
+ name,
67
+ key: String((_metaAccessor_alias = metaAccessor.alias) != null ? _metaAccessor_alias : metaAccessor.name),
68
+ label: (_metaAccessor_label = metaAccessor.label) != null ? _metaAccessor_label : humanize(name),
69
+ labelKey: metaAccessor.labelKey,
70
+ type,
71
+ sortable: (_metaAccessor_sortable = metaAccessor.sortable) != null ? _metaAccessor_sortable : isScalar,
72
+ filterable: (_metaAccessor_filterable = metaAccessor.filterable) != null ? _metaAccessor_filterable : isScalar,
73
+ order: (_metaAccessor_order = metaAccessor.order) != null ? _metaAccessor_order : index,
74
+ readonly: (_metaAccessor_readonly = metaAccessor.readonly) != null ? _metaAccessor_readonly : false,
75
+ required: (_metaAccessor_required = metaAccessor.required) != null ? _metaAccessor_required : false,
76
+ enumValues: metaAccessor.enumValues,
77
+ enumLabelKey: metaAccessor.enumLabelKey,
78
+ linkLabelProperty,
79
+ linkSearchProperty: (_metaAccessor_linkSearchProperty = metaAccessor.linkSearchProperty) != null ? _metaAccessor_linkSearchProperty : linkLabelProperty,
80
+ linkSerialization: (_metaAccessor_linkSerialization = metaAccessor.linkSerialization) != null ? _metaAccessor_linkSerialization : 'id',
81
+ childType: metaAccessor.childType == null ? void 0 : metaAccessor.childType.call(metaAccessor),
82
+ resetOnClone: (_metaAccessor_resetOnClone = metaAccessor.resetOnClone) != null ? _metaAccessor_resetOnClone : false
83
+ };
84
+ }
85
+ /**
86
+ * Resolves an entity's displayable members from its accessor metadata, sorted by
87
+ * `order` (declaration order when undeclared).
88
+ *
89
+ * Getter-kind and non-`hidden` mirror the filter {@link serializeEntity} walks,
90
+ * minus its `readonly` exclusion: a read-only member is still worth showing,
91
+ * it just cannot be written back.
92
+ *
93
+ * `sample` is an optional instance used only to infer the `type` of accessors
94
+ * that did not declare one.
95
+ *
96
+ * The target is a {@link ChildConstructor} rather than an `EntityConstructor`,
97
+ * which is wider than it looks: nothing here reads `id`, and a `composition`
98
+ * member's child is a **value** with accessors and no identity. So the same
99
+ * walk describes an entity and describes one row of the collection it owns,
100
+ * from one implementation.
101
+ */ export function describeEntityColumns(entityConstructor, sample) {
102
+ const seen = new Set();
103
+ return extractMetaAccessors(entityConstructor).filter((metaAccessor)=>{
104
+ if (metaAccessor.hidden || metaAccessor.kind !== 'getter') return false;
105
+ const name = String(metaAccessor.name);
106
+ if (seen.has(name)) return false;
107
+ seen.add(name);
108
+ return true;
109
+ }).map((metaAccessor, index)=>toDescriptor(metaAccessor, index, sample)).sort((left, right)=>left.order - right.order);
110
+ }
111
+
112
+ //# sourceMappingURL=describe-entity-columns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/entity-definition/describe/describe-entity-columns.ts"],"sourcesContent":["import { EntifixBuildError } from '../../base-entities/entifix-error/index.js';\nimport { extractMetaAccessors } from '../helpers/index.js';\nimport { EntityCollectionLink } from '../links/entity-collection-link/index.js';\nimport { EntityLink } from '../links/entity-link/index.js';\nimport {\n type ChildConstructor,\n type EntityLinkSerialization,\n MetaAccessor,\n MetaAccessorType,\n} from '../meta-entities/meta-accessor/index.js';\n\n/**\n * A displayable member of an entity, resolved from its accessor metadata. This\n * is the contract generic UI builds itself from — a table's columns today, a\n * form's fields later — so it stays framework-free and lives next to the\n * metadata it derives from.\n */\nexport interface EntityFieldDescriptor {\n /** Accessor name. The stable identity used by preferences and slots. */\n name: string;\n /** Wire/property key: `alias ?? name`. */\n key: string;\n label: string;\n /**\n * Catalog key for {@link label}, when the entity declared one. Resolution is\n * the presentation layer's job — core has no locale and no catalogs, and the\n * same descriptor feeds the server-side filter allowlist, where a translated\n * label would be meaningless.\n */\n labelKey?: string;\n type: MetaAccessorType;\n sortable: boolean;\n filterable: boolean;\n order: number;\n /** Cannot be written back. A form shows it but disables its input. */\n readonly: boolean;\n /** Must hold a value. A form rejects submit while it is empty. */\n required: boolean;\n enumValues?: readonly string[];\n /** Catalog prefix for {@link enumValues}; a value reads as `${enumLabelKey}.${value}`. */\n enumLabelKey?: string;\n /** Property of a `link` target used as its display label. */\n linkLabelProperty: string;\n /** Property of a `link` target a picker searches on. Defaults to the label. */\n linkSearchProperty: string;\n /** Whether a `link` writes back its foreign key or the inlined target. */\n linkSerialization: EntityLinkSerialization;\n /**\n * The class describing one row of a `composition` member, resolved from the\n * accessor's thunk. Absent on every other type.\n */\n childType?: ChildConstructor;\n /**\n * The member is dropped when the record is copied — a unique code, an audit\n * stamp. The identity member is always reset and is not flagged.\n */\n resetOnClone: boolean;\n}\n\n/** Types whose values are scalars a user can meaningfully sort/filter on. */\nexport const SCALAR_TYPES: readonly MetaAccessorType[] = [\n 'string',\n 'number',\n 'boolean',\n 'date',\n 'enum',\n];\n\n/**\n * Types whose value is a collection. None of them may ever be sorted or\n * filtered: this descriptor is also the **server-side RSQL allowlist**, and an\n * array compared as a scalar matches nothing — so the query would not fail, it\n * would quietly return an empty page.\n *\n * Exported so `describe-entity-columns.spec.ts` can assert that this list,\n * {@link SCALAR_TYPES} and the two reference types partition\n * `MetaAccessorTypes` exactly. Nothing in the repo guards `MetaAccessorType`\n * exhaustively — every switch over it has a `default` that treats the value as\n * a string — so that partition spec is what makes an eleventh type impossible\n * to add silently.\n */\nexport const COLLECTION_TYPES: readonly MetaAccessorType[] = [\n 'linkCollection',\n 'composition',\n 'scalarCollection',\n];\n\n/** `productCode` / `product-code` / `product_code` → `Product Code`. */\nfunction humanize(name: string): string {\n return name\n .replace(/[-_]+/g, ' ')\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .replace(/\\s+/g, ' ')\n .trim()\n .replace(/^./, first => first.toUpperCase());\n}\n\n/**\n * Best-effort type for accessors that did not declare one. Entities are not\n * required to annotate every member, so a sample row keeps a bare `@accessor()`\n * usable; a declared `type` always wins over this.\n */\nfunction inferType(name: string, value: unknown): MetaAccessorType {\n if (value instanceof EntityLink) return 'link';\n if (value instanceof EntityCollectionLink) return 'linkCollection';\n if (value instanceof Date) return 'date';\n if (typeof value === 'number') return 'number';\n if (typeof value === 'boolean') return 'boolean';\n if (name === 'id') return 'id';\n return 'string';\n}\n\n/**\n * A collection member declared queryable is always a mistake, so it breaks the\n * developer rather than the query — the same posture as `applyEntityLinks`\n * throwing on an `embedded` link it cannot build.\n *\n * Silently clamping to `false` was the alternative and is worse: the author\n * keeps a declaration that reads as honoured, and the symptom is an empty\n * result page rather than an error anyone can act on.\n */\nfunction assertNotQueryable(\n metaAccessor: MetaAccessor,\n type: MetaAccessorType,\n) {\n if (!COLLECTION_TYPES.includes(type)) return;\n if (metaAccessor.sortable !== true && metaAccessor.filterable !== true)\n return;\n throw new EntifixBuildError(\n `\"${String(metaAccessor.name)}\" is a ${type} and cannot be sortable or filterable — member metadata is the server-side query allowlist, and a collection compared as a scalar matches nothing.`,\n );\n}\n\nfunction toDescriptor(\n metaAccessor: MetaAccessor,\n index: number,\n sample: unknown,\n): EntityFieldDescriptor {\n const name = String(metaAccessor.name);\n const type =\n metaAccessor.type ??\n inferType(name, (sample as Record<string, unknown> | undefined)?.[name]);\n assertNotQueryable(metaAccessor, type);\n const isScalar = SCALAR_TYPES.includes(type);\n const linkLabelProperty = metaAccessor.linkLabelProperty ?? 'name';\n\n return {\n name,\n key: String(metaAccessor.alias ?? metaAccessor.name),\n label: metaAccessor.label ?? humanize(name),\n labelKey: metaAccessor.labelKey,\n type,\n sortable: metaAccessor.sortable ?? isScalar,\n filterable: metaAccessor.filterable ?? isScalar,\n order: metaAccessor.order ?? index,\n readonly: metaAccessor.readonly ?? false,\n required: metaAccessor.required ?? false,\n enumValues: metaAccessor.enumValues,\n enumLabelKey: metaAccessor.enumLabelKey,\n linkLabelProperty,\n linkSearchProperty: metaAccessor.linkSearchProperty ?? linkLabelProperty,\n linkSerialization: metaAccessor.linkSerialization ?? 'id',\n childType: metaAccessor.childType?.(),\n resetOnClone: metaAccessor.resetOnClone ?? false,\n };\n}\n\n/**\n * Resolves an entity's displayable members from its accessor metadata, sorted by\n * `order` (declaration order when undeclared).\n *\n * Getter-kind and non-`hidden` mirror the filter {@link serializeEntity} walks,\n * minus its `readonly` exclusion: a read-only member is still worth showing,\n * it just cannot be written back.\n *\n * `sample` is an optional instance used only to infer the `type` of accessors\n * that did not declare one.\n *\n * The target is a {@link ChildConstructor} rather than an `EntityConstructor`,\n * which is wider than it looks: nothing here reads `id`, and a `composition`\n * member's child is a **value** with accessors and no identity. So the same\n * walk describes an entity and describes one row of the collection it owns,\n * from one implementation.\n */\nexport function describeEntityColumns<TTarget extends object>(\n entityConstructor: ChildConstructor<TTarget>,\n sample?: TTarget,\n): EntityFieldDescriptor[] {\n const seen = new Set<string>();\n\n return extractMetaAccessors(entityConstructor)\n .filter(metaAccessor => {\n if (metaAccessor.hidden || metaAccessor.kind !== 'getter') return false;\n const name = String(metaAccessor.name);\n if (seen.has(name)) return false;\n seen.add(name);\n return true;\n })\n .map((metaAccessor, index) => toDescriptor(metaAccessor, index, sample))\n .sort((left, right) => left.order - right.order);\n}\n"],"names":["EntifixBuildError","extractMetaAccessors","EntityCollectionLink","EntityLink","SCALAR_TYPES","COLLECTION_TYPES","humanize","name","replace","trim","first","toUpperCase","inferType","value","Date","assertNotQueryable","metaAccessor","type","includes","sortable","filterable","String","toDescriptor","index","sample","isScalar","linkLabelProperty","key","alias","label","labelKey","order","readonly","required","enumValues","enumLabelKey","linkSearchProperty","linkSerialization","childType","resetOnClone","describeEntityColumns","entityConstructor","seen","Set","filter","hidden","kind","has","add","map","sort","left","right"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,6CAA6C;AAC/E,SAASC,oBAAoB,QAAQ,sBAAsB;AAC3D,SAASC,oBAAoB,QAAQ,2CAA2C;AAChF,SAASC,UAAU,QAAQ,gCAAgC;AAwD3D,2EAA2E,GAC3E,OAAO,MAAMC,eAA4C;IACvD;IACA;IACA;IACA;IACA;CACD,CAAC;AAEF;;;;;;;;;;;;CAYC,GACD,OAAO,MAAMC,mBAAgD;IAC3D;IACA;IACA;CACD,CAAC;AAEF,sEAAsE,GACtE,SAASC,SAASC,IAAY;IAC5B,OAAOA,KACJC,OAAO,CAAC,UAAU,KAClBA,OAAO,CAAC,sBAAsB,SAC9BA,OAAO,CAAC,QAAQ,KAChBC,IAAI,GACJD,OAAO,CAAC,MAAME,CAAAA,QAASA,MAAMC,WAAW;AAC7C;AAEA;;;;CAIC,GACD,SAASC,UAAUL,IAAY,EAAEM,KAAc;IAC7C,IAAIA,iBAAiBV,YAAY,OAAO;IACxC,IAAIU,iBAAiBX,sBAAsB,OAAO;IAClD,IAAIW,iBAAiBC,MAAM,OAAO;IAClC,IAAI,OAAOD,UAAU,UAAU,OAAO;IACtC,IAAI,OAAOA,UAAU,WAAW,OAAO;IACvC,IAAIN,SAAS,MAAM,OAAO;IAC1B,OAAO;AACT;AAEA;;;;;;;;CAQC,GACD,SAASQ,mBACPC,YAA0B,EAC1BC,IAAsB;IAEtB,IAAI,CAACZ,iBAAiBa,QAAQ,CAACD,OAAO;IACtC,IAAID,aAAaG,QAAQ,KAAK,QAAQH,aAAaI,UAAU,KAAK,MAChE;IACF,MAAM,IAAIpB,kBACR,CAAC,CAAC,EAAEqB,OAAOL,aAAaT,IAAI,EAAE,OAAO,EAAEU,KAAK,kJAAkJ,CAAC;AAEnM;AAEA,SAASK,aACPN,YAA0B,EAC1BO,KAAa,EACbC,MAAe;QAIbR,oBAIwBA,iCAIZA,qBACLA,qBAGGA,wBACEA,0BACLA,qBACGA,wBACAA,wBAIUA,kCACDA,iCAELA;IAzBhB,MAAMT,OAAOc,OAAOL,aAAaT,IAAI;IACrC,MAAMU,QACJD,qBAAAA,aAAaC,IAAI,YAAjBD,qBACAJ,UAAUL,MAAOiB,0BAAD,AAACA,MAAgD,CAACjB,KAAK;IACzEQ,mBAAmBC,cAAcC;IACjC,MAAMQ,WAAWrB,aAAac,QAAQ,CAACD;IACvC,MAAMS,qBAAoBV,kCAAAA,aAAaU,iBAAiB,YAA9BV,kCAAkC;IAE5D,OAAO;QACLT;QACAoB,KAAKN,QAAOL,sBAAAA,aAAaY,KAAK,YAAlBZ,sBAAsBA,aAAaT,IAAI;QACnDsB,KAAK,GAAEb,sBAAAA,aAAaa,KAAK,YAAlBb,sBAAsBV,SAASC;QACtCuB,UAAUd,aAAac,QAAQ;QAC/Bb;QACAE,QAAQ,GAAEH,yBAAAA,aAAaG,QAAQ,YAArBH,yBAAyBS;QACnCL,UAAU,GAAEJ,2BAAAA,aAAaI,UAAU,YAAvBJ,2BAA2BS;QACvCM,KAAK,GAAEf,sBAAAA,aAAae,KAAK,YAAlBf,sBAAsBO;QAC7BS,QAAQ,GAAEhB,yBAAAA,aAAagB,QAAQ,YAArBhB,yBAAyB;QACnCiB,QAAQ,GAAEjB,yBAAAA,aAAaiB,QAAQ,YAArBjB,yBAAyB;QACnCkB,YAAYlB,aAAakB,UAAU;QACnCC,cAAcnB,aAAamB,YAAY;QACvCT;QACAU,kBAAkB,GAAEpB,mCAAAA,aAAaoB,kBAAkB,YAA/BpB,mCAAmCU;QACvDW,iBAAiB,GAAErB,kCAAAA,aAAaqB,iBAAiB,YAA9BrB,kCAAkC;QACrDsB,SAAS,EAAEtB,aAAasB,SAAS,oBAAtBtB,aAAasB,SAAS,MAAtBtB;QACXuB,YAAY,GAAEvB,6BAAAA,aAAauB,YAAY,YAAzBvB,6BAA6B;IAC7C;AACF;AAEA;;;;;;;;;;;;;;;;CAgBC,GACD,OAAO,SAASwB,sBACdC,iBAA4C,EAC5CjB,MAAgB;IAEhB,MAAMkB,OAAO,IAAIC;IAEjB,OAAO1C,qBAAqBwC,mBACzBG,MAAM,CAAC5B,CAAAA;QACN,IAAIA,aAAa6B,MAAM,IAAI7B,aAAa8B,IAAI,KAAK,UAAU,OAAO;QAClE,MAAMvC,OAAOc,OAAOL,aAAaT,IAAI;QACrC,IAAImC,KAAKK,GAAG,CAACxC,OAAO,OAAO;QAC3BmC,KAAKM,GAAG,CAACzC;QACT,OAAO;IACT,GACC0C,GAAG,CAAC,CAACjC,cAAcO,QAAUD,aAAaN,cAAcO,OAAOC,SAC/D0B,IAAI,CAAC,CAACC,MAAMC,QAAUD,KAAKpB,KAAK,GAAGqB,MAAMrB,KAAK;AACnD"}
@@ -0,0 +1,34 @@
1
+ import { Entity, EntityConstructor } from '../../types/Entity.js';
2
+ import type { UseCaseBinding, UseCaseCell, UseCaseConfirm, UseCasePlacement } from '../meta-entities/meta-use-case/index.js';
3
+ /**
4
+ * An action a caller may take on an entity, resolved from its use-case
5
+ * metadata. The counterpart to {@link EntityFieldDescriptor}, and like it,
6
+ * framework-free and copy-free — every human-readable member is a catalog key.
7
+ *
8
+ * It carries no `entity`: this is the shape that goes over the wire from
9
+ * `GET /api/<entity>/$metadata`, where the entity is already the address.
10
+ */
11
+ export interface UseCaseDescriptor {
12
+ /** The verb. Also the third segment of the permission guarding it. */
13
+ key: string;
14
+ binding: UseCaseBinding;
15
+ placement: UseCasePlacement;
16
+ /** Further cells this same verb appears in — see `MetaUseCaseOptions`. */
17
+ alsoAt?: readonly UseCaseCell[];
18
+ labelKey: string;
19
+ keywordsKey?: string;
20
+ confirm?: UseCaseConfirm;
21
+ form?: string;
22
+ }
23
+ /**
24
+ * Resolves the use cases declared against an entity, in declaration order.
25
+ *
26
+ * Unlike {@link describeEntityColumns}, this is only trustworthy where the
27
+ * use-case modules have been loaded: a `@useCase()` class registers itself when
28
+ * its module evaluates. On a service that is the composition root's job, and
29
+ * `@r10c/slices` fails the build on a class its package barrel does not export.
30
+ * A browser never calls this — it fetches the descriptors instead, so no
31
+ * use-case implementation reaches a client bundle.
32
+ */
33
+ export declare function describeEntityUseCases<TEntity extends Entity>(entityConstructor: EntityConstructor<TEntity>): UseCaseDescriptor[];
34
+ //# sourceMappingURL=describe-entity-use-cases.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe-entity-use-cases.d.ts","sourceRoot":"","sources":["../../../src/entity-definition/describe/describe-entity-use-cases.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,cAAc,EACd,gBAAgB,EACjB,MAAM,yCAAyC,CAAC;AAEjD;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,sEAAsE;IACtE,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,cAAc,CAAC;IACxB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,0EAA0E;IAC1E,MAAM,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,SAAS,MAAM,EAC3D,iBAAiB,EAAE,iBAAiB,CAAC,OAAO,CAAC,GAC5C,iBAAiB,EAAE,CAWrB"}
@@ -0,0 +1,24 @@
1
+ import { extractMetaUseCases } from '../helpers/index.js';
2
+ /**
3
+ * Resolves the use cases declared against an entity, in declaration order.
4
+ *
5
+ * Unlike {@link describeEntityColumns}, this is only trustworthy where the
6
+ * use-case modules have been loaded: a `@useCase()` class registers itself when
7
+ * its module evaluates. On a service that is the composition root's job, and
8
+ * `@r10c/slices` fails the build on a class its package barrel does not export.
9
+ * A browser never calls this — it fetches the descriptors instead, so no
10
+ * use-case implementation reaches a client bundle.
11
+ */ export function describeEntityUseCases(entityConstructor) {
12
+ return extractMetaUseCases(entityConstructor).map((metaUseCase)=>({
13
+ key: metaUseCase.key,
14
+ binding: metaUseCase.binding,
15
+ placement: metaUseCase.placement,
16
+ alsoAt: metaUseCase.alsoAt,
17
+ labelKey: metaUseCase.labelKey,
18
+ keywordsKey: metaUseCase.keywordsKey,
19
+ confirm: metaUseCase.confirm,
20
+ form: metaUseCase.form
21
+ }));
22
+ }
23
+
24
+ //# sourceMappingURL=describe-entity-use-cases.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/entity-definition/describe/describe-entity-use-cases.ts"],"sourcesContent":["import { Entity, EntityConstructor } from '../../types/Entity.js';\nimport { extractMetaUseCases } from '../helpers/index.js';\nimport type {\n UseCaseBinding,\n UseCaseCell,\n UseCaseConfirm,\n UseCasePlacement,\n} from '../meta-entities/meta-use-case/index.js';\n\n/**\n * An action a caller may take on an entity, resolved from its use-case\n * metadata. The counterpart to {@link EntityFieldDescriptor}, and like it,\n * framework-free and copy-free — every human-readable member is a catalog key.\n *\n * It carries no `entity`: this is the shape that goes over the wire from\n * `GET /api/<entity>/$metadata`, where the entity is already the address.\n */\nexport interface UseCaseDescriptor {\n /** The verb. Also the third segment of the permission guarding it. */\n key: string;\n binding: UseCaseBinding;\n placement: UseCasePlacement;\n /** Further cells this same verb appears in — see `MetaUseCaseOptions`. */\n alsoAt?: readonly UseCaseCell[];\n labelKey: string;\n keywordsKey?: string;\n confirm?: UseCaseConfirm;\n form?: string;\n}\n\n/**\n * Resolves the use cases declared against an entity, in declaration order.\n *\n * Unlike {@link describeEntityColumns}, this is only trustworthy where the\n * use-case modules have been loaded: a `@useCase()` class registers itself when\n * its module evaluates. On a service that is the composition root's job, and\n * `@r10c/slices` fails the build on a class its package barrel does not export.\n * A browser never calls this — it fetches the descriptors instead, so no\n * use-case implementation reaches a client bundle.\n */\nexport function describeEntityUseCases<TEntity extends Entity>(\n entityConstructor: EntityConstructor<TEntity>,\n): UseCaseDescriptor[] {\n return extractMetaUseCases(entityConstructor).map(metaUseCase => ({\n key: metaUseCase.key,\n binding: metaUseCase.binding,\n placement: metaUseCase.placement,\n alsoAt: metaUseCase.alsoAt,\n labelKey: metaUseCase.labelKey,\n keywordsKey: metaUseCase.keywordsKey,\n confirm: metaUseCase.confirm,\n form: metaUseCase.form,\n }));\n}\n"],"names":["extractMetaUseCases","describeEntityUseCases","entityConstructor","map","metaUseCase","key","binding","placement","alsoAt","labelKey","keywordsKey","confirm","form"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,sBAAsB;AA6B1D;;;;;;;;;CASC,GACD,OAAO,SAASC,uBACdC,iBAA6C;IAE7C,OAAOF,oBAAoBE,mBAAmBC,GAAG,CAACC,CAAAA,cAAgB,CAAA;YAChEC,KAAKD,YAAYC,GAAG;YACpBC,SAASF,YAAYE,OAAO;YAC5BC,WAAWH,YAAYG,SAAS;YAChCC,QAAQJ,YAAYI,MAAM;YAC1BC,UAAUL,YAAYK,QAAQ;YAC9BC,aAAaN,YAAYM,WAAW;YACpCC,SAASP,YAAYO,OAAO;YAC5BC,MAAMR,YAAYQ,IAAI;QACxB,CAAA;AACF"}
@@ -0,0 +1,4 @@
1
+ export * from './describe-child-columns.js';
2
+ export * from './describe-entity-columns.js';
3
+ export * from './describe-entity-use-cases.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entity-definition/describe/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './describe-child-columns.js';
2
+ export * from './describe-entity-columns.js';
3
+ export * from './describe-entity-use-cases.js';
4
+
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/entity-definition/describe/index.ts"],"sourcesContent":["export * from './describe-child-columns.js';\nexport * from './describe-entity-columns.js';\nexport * from './describe-entity-use-cases.js';\n"],"names":[],"mappings":"AAAA,cAAc,8BAA8B;AAC5C,cAAc,+BAA+B;AAC7C,cAAc,iCAAiC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * How an error names a member of one row of an owned collection.
3
+ *
4
+ * Every error map in the stack is `Record<string, string>` keyed by accessor
5
+ * name, which has no way to say "the quantity of the third line". This is that
6
+ * key: `items[2].quantity`.
7
+ *
8
+ * ## Why the index and not the row's key
9
+ *
10
+ * A row carries a minted `ROW_KEY` that is stable across re-renders, and it is
11
+ * tempting to address errors by it. It cannot be done: a Standard Schema issue
12
+ * carries a **positional** path (`['items', 2, 'quantity']`) and nothing else,
13
+ * so an index is the only thing a schema-authored rule can produce. Building the
14
+ * map on keys would mean the metadata rules and the schema rules addressed the
15
+ * same cell two different ways, and `composeEntityFormErrors` merges them by key.
16
+ *
17
+ * The index being stale after a removal is harmless here, and only here: the
18
+ * form re-runs its whole validator on every edit (`revalidateLogic`), so no
19
+ * index outlives the keystroke that invalidated it. React keys cannot be
20
+ * recomputed that way, which is exactly why rows are keyed by `ROW_KEY` and
21
+ * errors are keyed by index — two identities, two jobs, neither substitutable
22
+ * for the other.
23
+ */
24
+ /** The error-map key for `member[index].child`. */
25
+ export declare function rowFieldPath(member: string, index: number, child: string): string;
26
+ /** A parsed {@link rowFieldPath}. */
27
+ export interface RowFieldPath {
28
+ member: string;
29
+ index: number;
30
+ child: string;
31
+ }
32
+ /**
33
+ * Reads a {@link rowFieldPath} back, or `undefined` for a plain member name.
34
+ *
35
+ * The `undefined` is what keeps every existing caller working: a top-level
36
+ * field's key is just its accessor name, which is not this shape, so a consumer
37
+ * that only understands plain names is unaffected by the ones it cannot parse.
38
+ */
39
+ export declare function parseRowFieldPath(path: string): RowFieldPath | undefined;
40
+ /**
41
+ * Joins a Standard Schema issue path into an error-map key.
42
+ *
43
+ * Numeric segments become `[n]` and everything else a dotted member, so
44
+ * `['items', 2, 'quantity']` reads as `items[2].quantity` and a lone
45
+ * `['name']` reads as `name` — which is what `issueFieldName` returned before
46
+ * nested paths existed, so no existing rule changes meaning.
47
+ */
48
+ export declare function joinFieldPath(segments: readonly (string | number)[]): string;
49
+ //# sourceMappingURL=field-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field-path.d.ts","sourceRoot":"","sources":["../../src/entity-definition/field-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,mDAAmD;AACnD,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,MAAM,CAER;AAED,qCAAqC;AACrC,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAID;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CASxE;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,MAAM,CAO5E"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * How an error names a member of one row of an owned collection.
3
+ *
4
+ * Every error map in the stack is `Record<string, string>` keyed by accessor
5
+ * name, which has no way to say "the quantity of the third line". This is that
6
+ * key: `items[2].quantity`.
7
+ *
8
+ * ## Why the index and not the row's key
9
+ *
10
+ * A row carries a minted `ROW_KEY` that is stable across re-renders, and it is
11
+ * tempting to address errors by it. It cannot be done: a Standard Schema issue
12
+ * carries a **positional** path (`['items', 2, 'quantity']`) and nothing else,
13
+ * so an index is the only thing a schema-authored rule can produce. Building the
14
+ * map on keys would mean the metadata rules and the schema rules addressed the
15
+ * same cell two different ways, and `composeEntityFormErrors` merges them by key.
16
+ *
17
+ * The index being stale after a removal is harmless here, and only here: the
18
+ * form re-runs its whole validator on every edit (`revalidateLogic`), so no
19
+ * index outlives the keystroke that invalidated it. React keys cannot be
20
+ * recomputed that way, which is exactly why rows are keyed by `ROW_KEY` and
21
+ * errors are keyed by index — two identities, two jobs, neither substitutable
22
+ * for the other.
23
+ */ /** The error-map key for `member[index].child`. */ export function rowFieldPath(member, index, child) {
24
+ return `${member}[${index}].${child}`;
25
+ }
26
+ const ROW_FIELD_PATH = /^([^[\]]+)\[(\d+)]\.([^[\]]+)$/;
27
+ /**
28
+ * Reads a {@link rowFieldPath} back, or `undefined` for a plain member name.
29
+ *
30
+ * The `undefined` is what keeps every existing caller working: a top-level
31
+ * field's key is just its accessor name, which is not this shape, so a consumer
32
+ * that only understands plain names is unaffected by the ones it cannot parse.
33
+ */ export function parseRowFieldPath(path) {
34
+ const match = ROW_FIELD_PATH.exec(path);
35
+ if (match === null) return undefined;
36
+ return {
37
+ member: match[1],
38
+ index: Number(match[2]),
39
+ child: match[3]
40
+ };
41
+ }
42
+ /**
43
+ * Joins a Standard Schema issue path into an error-map key.
44
+ *
45
+ * Numeric segments become `[n]` and everything else a dotted member, so
46
+ * `['items', 2, 'quantity']` reads as `items[2].quantity` and a lone
47
+ * `['name']` reads as `name` — which is what `issueFieldName` returned before
48
+ * nested paths existed, so no existing rule changes meaning.
49
+ */ export function joinFieldPath(segments) {
50
+ return segments.reduce((path, segment)=>{
51
+ if (typeof segment === 'number' || /^\d+$/.test(segment)) {
52
+ return `${path}[${segment}]`;
53
+ }
54
+ return path === '' ? segment : `${path}.${segment}`;
55
+ }, '');
56
+ }
57
+
58
+ //# sourceMappingURL=field-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/entity-definition/field-path.ts"],"sourcesContent":["/**\n * How an error names a member of one row of an owned collection.\n *\n * Every error map in the stack is `Record<string, string>` keyed by accessor\n * name, which has no way to say \"the quantity of the third line\". This is that\n * key: `items[2].quantity`.\n *\n * ## Why the index and not the row's key\n *\n * A row carries a minted `ROW_KEY` that is stable across re-renders, and it is\n * tempting to address errors by it. It cannot be done: a Standard Schema issue\n * carries a **positional** path (`['items', 2, 'quantity']`) and nothing else,\n * so an index is the only thing a schema-authored rule can produce. Building the\n * map on keys would mean the metadata rules and the schema rules addressed the\n * same cell two different ways, and `composeEntityFormErrors` merges them by key.\n *\n * The index being stale after a removal is harmless here, and only here: the\n * form re-runs its whole validator on every edit (`revalidateLogic`), so no\n * index outlives the keystroke that invalidated it. React keys cannot be\n * recomputed that way, which is exactly why rows are keyed by `ROW_KEY` and\n * errors are keyed by index — two identities, two jobs, neither substitutable\n * for the other.\n */\n\n/** The error-map key for `member[index].child`. */\nexport function rowFieldPath(\n member: string,\n index: number,\n child: string,\n): string {\n return `${member}[${index}].${child}`;\n}\n\n/** A parsed {@link rowFieldPath}. */\nexport interface RowFieldPath {\n member: string;\n index: number;\n child: string;\n}\n\nconst ROW_FIELD_PATH = /^([^[\\]]+)\\[(\\d+)]\\.([^[\\]]+)$/;\n\n/**\n * Reads a {@link rowFieldPath} back, or `undefined` for a plain member name.\n *\n * The `undefined` is what keeps every existing caller working: a top-level\n * field's key is just its accessor name, which is not this shape, so a consumer\n * that only understands plain names is unaffected by the ones it cannot parse.\n */\nexport function parseRowFieldPath(path: string): RowFieldPath | undefined {\n const match = ROW_FIELD_PATH.exec(path);\n if (match === null) return undefined;\n\n return {\n member: match[1] as string,\n index: Number(match[2]),\n child: match[3] as string,\n };\n}\n\n/**\n * Joins a Standard Schema issue path into an error-map key.\n *\n * Numeric segments become `[n]` and everything else a dotted member, so\n * `['items', 2, 'quantity']` reads as `items[2].quantity` and a lone\n * `['name']` reads as `name` — which is what `issueFieldName` returned before\n * nested paths existed, so no existing rule changes meaning.\n */\nexport function joinFieldPath(segments: readonly (string | number)[]): string {\n return segments.reduce<string>((path, segment) => {\n if (typeof segment === 'number' || /^\\d+$/.test(segment)) {\n return `${path}[${segment}]`;\n }\n return path === '' ? segment : `${path}.${segment}`;\n }, '');\n}\n"],"names":["rowFieldPath","member","index","child","ROW_FIELD_PATH","parseRowFieldPath","path","match","exec","undefined","Number","joinFieldPath","segments","reduce","segment","test"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;CAsBC,GAED,iDAAiD,GACjD,OAAO,SAASA,aACdC,MAAc,EACdC,KAAa,EACbC,KAAa;IAEb,OAAO,GAAGF,OAAO,CAAC,EAAEC,MAAM,EAAE,EAAEC,OAAO;AACvC;AASA,MAAMC,iBAAiB;AAEvB;;;;;;CAMC,GACD,OAAO,SAASC,kBAAkBC,IAAY;IAC5C,MAAMC,QAAQH,eAAeI,IAAI,CAACF;IAClC,IAAIC,UAAU,MAAM,OAAOE;IAE3B,OAAO;QACLR,QAAQM,KAAK,CAAC,EAAE;QAChBL,OAAOQ,OAAOH,KAAK,CAAC,EAAE;QACtBJ,OAAOI,KAAK,CAAC,EAAE;IACjB;AACF;AAEA;;;;;;;CAOC,GACD,OAAO,SAASI,cAAcC,QAAsC;IAClE,OAAOA,SAASC,MAAM,CAAS,CAACP,MAAMQ;QACpC,IAAI,OAAOA,YAAY,YAAY,QAAQC,IAAI,CAACD,UAAU;YACxD,OAAO,GAAGR,KAAK,CAAC,EAAEQ,QAAQ,CAAC,CAAC;QAC9B;QACA,OAAOR,SAAS,KAAKQ,UAAU,GAAGR,KAAK,CAAC,EAAEQ,SAAS;IACrD,GAAG;AACL"}
@@ -0,0 +1,59 @@
1
+ import { Entity, EntityConstructor } from '../../types/Entity.js';
2
+ import { UseCaseConstructor } from '../../types/UseCase.js';
3
+ import { type ChildConstructor, MetaAccessor } from '../meta-entities/meta-accessor/index.js';
4
+ import { MetaEntity } from '../meta-entities/meta-entity/index.js';
5
+ import { MetaMethod } from '../meta-entities/meta-method/index.js';
6
+ import { MetaUseCase, MetaUseCaseBinding } from '../meta-entities/meta-use-case/index.js';
7
+ declare global {
8
+ interface SymbolConstructor {
9
+ readonly metadata: unique symbol;
10
+ }
11
+ }
12
+ export declare const META_ENTITY_KEY: unique symbol;
13
+ export declare const META_ACCESSOR_KEY: unique symbol;
14
+ export declare const META_METHOD_KEY: unique symbol;
15
+ export declare const META_USE_CASE_KEY: unique symbol;
16
+ export declare const META_USE_CASE_BINDING_KEY: unique symbol;
17
+ export declare function setMetaEntity(metadata: DecoratorMetadataObject | undefined, metaEntity: MetaEntity): void;
18
+ export declare function appendMetaAccessor(metadata: DecoratorMetadataObject | undefined, metaAccessor: MetaAccessor): void;
19
+ export declare function appendMetaMethod(metadata: DecoratorMetadataObject | undefined, metaMethod: MetaMethod): void;
20
+ /**
21
+ * Append a use case to the metadata of the entity it acts on.
22
+ *
23
+ * This is the one decorator that writes a bag other than its own: a use case is
24
+ * declared on its own class, but the entity is what a surface holds, so the
25
+ * descriptor has to end up there. The consequence is that a use-case module
26
+ * which is never imported leaves the entity looking as if it had no actions,
27
+ * which is why `@r10c/slices` asserts every `@useCase()` class is re-exported
28
+ * from its package barrel.
29
+ *
30
+ * It reads the target's **own** metadata rather than going through
31
+ * {@link readMetadata}. `Symbol.metadata` resolves along the prototype chain, so
32
+ * an inherited read would append the verb to a base class's bag and leak it to
33
+ * every subclass. A target with no own metadata is an entity missing
34
+ * `@entity()`, or a circular import that evaluated the use case first.
35
+ */
36
+ export declare function appendMetaUseCase<TEntity extends Entity>(target: EntityConstructor<TEntity>, metaUseCase: MetaUseCase): void;
37
+ /**
38
+ * Record on the use-case class itself which entity and verb it implements, so
39
+ * the permission can be derived from the class alone. That is what keeps the
40
+ * verb string written once, at the declaration, instead of being retyped at
41
+ * every guard.
42
+ */
43
+ export declare function setMetaUseCaseBinding(metadata: DecoratorMetadataObject | undefined, binding: MetaUseCaseBinding): void;
44
+ export declare function extractMetaEntity<TEntity extends Entity>(target: EntityConstructor<TEntity>): MetaEntity;
45
+ /**
46
+ * Every accessor declared on a class.
47
+ *
48
+ * The target is a {@link ChildConstructor}, not an `EntityConstructor`: an
49
+ * `@accessor()` writes to its own class's metadata bag with no help from
50
+ * `@entity()`, so a `composition` member's child — a value with no `id` — is
51
+ * described by exactly this walk.
52
+ */
53
+ export declare function extractMetaAccessors(target: ChildConstructor): MetaAccessor[];
54
+ export declare function extractMetaMethods<TEntity extends Entity>(target: EntityConstructor<TEntity>): MetaMethod[];
55
+ /** Every use case declared against an entity. Empty until one is imported. */
56
+ export declare function extractMetaUseCases<TEntity extends Entity>(target: EntityConstructor<TEntity>): MetaUseCase[];
57
+ /** The entity and verb a `@useCase()` class implements. */
58
+ export declare function extractMetaUseCaseBinding(target: UseCaseConstructor): MetaUseCaseBinding;
59
+ //# sourceMappingURL=entity-definition-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-definition-helpers.d.ts","sourceRoot":"","sources":["../../../src/entity-definition/helpers/entity-definition-helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EACL,KAAK,gBAAgB,EACrB,YAAY,EACb,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACnE,OAAO,EACL,WAAW,EACX,kBAAkB,EACnB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,iBAAiB;QACzB,QAAQ,CAAC,QAAQ,EAAE,OAAO,MAAM,CAAC;KAClC;CACF;AAED,eAAO,MAAM,eAAe,eAAuB,CAAC;AACpD,eAAO,MAAM,iBAAiB,eAAyB,CAAC;AACxD,eAAO,MAAM,eAAe,eAAuB,CAAC;AACpD,eAAO,MAAM,iBAAiB,eAAwB,CAAC;AACvD,eAAO,MAAM,yBAAyB,eAA+B,CAAC;AAatE,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,uBAAuB,GAAG,SAAS,EAC7C,UAAU,EAAE,UAAU,QAGvB;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,uBAAuB,GAAG,SAAS,EAC7C,YAAY,EAAE,YAAY,QAM3B;AAED,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,uBAAuB,GAAG,SAAS,EAC7C,UAAU,EAAE,UAAU,QAKvB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,SAAS,MAAM,EACtD,MAAM,EAAE,iBAAiB,CAAC,OAAO,CAAC,EAClC,WAAW,EAAE,WAAW,QAWzB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,uBAAuB,GAAG,SAAS,EAC7C,OAAO,EAAE,kBAAkB,QAG5B;AAQD,wBAAgB,iBAAiB,CAAC,OAAO,SAAS,MAAM,EACtD,MAAM,EAAE,iBAAiB,CAAC,OAAO,CAAC,GACjC,UAAU,CAOZ;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,gBAAgB,GAAG,YAAY,EAAE,CAG7E;AAED,wBAAgB,kBAAkB,CAAC,OAAO,SAAS,MAAM,EACvD,MAAM,EAAE,iBAAiB,CAAC,OAAO,CAAC,GACjC,UAAU,EAAE,CAGd;AAED,8EAA8E;AAC9E,wBAAgB,mBAAmB,CAAC,OAAO,SAAS,MAAM,EACxD,MAAM,EAAE,iBAAiB,CAAC,OAAO,CAAC,GACjC,WAAW,EAAE,CAGf;AAED,2DAA2D;AAC3D,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,kBAAkB,GACzB,kBAAkB,CAYpB"}
@@ -0,0 +1,115 @@
1
+ var _Symbol, _metadata;
2
+ (_metadata = (_Symbol = Symbol).metadata) != null ? _metadata : _Symbol.metadata = Symbol.for('Symbol.metadata');
3
+ import { EntifixBuildError } from '../../base-entities/entifix-error/index.js';
4
+ export const META_ENTITY_KEY = Symbol('MetaEntity');
5
+ export const META_ACCESSOR_KEY = Symbol('MetaAccessor');
6
+ export const META_METHOD_KEY = Symbol('MetaMethod');
7
+ export const META_USE_CASE_KEY = Symbol('MetaUseCase');
8
+ export const META_USE_CASE_BINDING_KEY = Symbol('MetaUseCaseBinding');
9
+ function requireMetadata(metadata) {
10
+ if (!metadata) {
11
+ throw new EntifixBuildError('Decorator metadata unavailable — Symbol.metadata polyfill missing or stage-3 decorator emit not enabled.');
12
+ }
13
+ return metadata;
14
+ }
15
+ export function setMetaEntity(metadata, metaEntity) {
16
+ requireMetadata(metadata)[META_ENTITY_KEY] = metaEntity;
17
+ }
18
+ export function appendMetaAccessor(metadata, metaAccessor) {
19
+ var _meta_META_ACCESSOR_KEY;
20
+ const meta = requireMetadata(metadata);
21
+ const existing = (_meta_META_ACCESSOR_KEY = meta[META_ACCESSOR_KEY]) != null ? _meta_META_ACCESSOR_KEY : [];
22
+ meta[META_ACCESSOR_KEY] = [
23
+ ...existing,
24
+ metaAccessor
25
+ ];
26
+ }
27
+ export function appendMetaMethod(metadata, metaMethod) {
28
+ var _meta_META_METHOD_KEY;
29
+ const meta = requireMetadata(metadata);
30
+ const existing = (_meta_META_METHOD_KEY = meta[META_METHOD_KEY]) != null ? _meta_META_METHOD_KEY : [];
31
+ meta[META_METHOD_KEY] = [
32
+ ...existing,
33
+ metaMethod
34
+ ];
35
+ }
36
+ /**
37
+ * Append a use case to the metadata of the entity it acts on.
38
+ *
39
+ * This is the one decorator that writes a bag other than its own: a use case is
40
+ * declared on its own class, but the entity is what a surface holds, so the
41
+ * descriptor has to end up there. The consequence is that a use-case module
42
+ * which is never imported leaves the entity looking as if it had no actions,
43
+ * which is why `@r10c/slices` asserts every `@useCase()` class is re-exported
44
+ * from its package barrel.
45
+ *
46
+ * It reads the target's **own** metadata rather than going through
47
+ * {@link readMetadata}. `Symbol.metadata` resolves along the prototype chain, so
48
+ * an inherited read would append the verb to a base class's bag and leak it to
49
+ * every subclass. A target with no own metadata is an entity missing
50
+ * `@entity()`, or a circular import that evaluated the use case first.
51
+ */ export function appendMetaUseCase(target, metaUseCase) {
52
+ var _own_META_USE_CASE_KEY;
53
+ var _Object_getOwnPropertyDescriptor;
54
+ const own = (_Object_getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor(target, Symbol.metadata)) == null ? void 0 : _Object_getOwnPropertyDescriptor.value;
55
+ if (!own) {
56
+ throw new EntifixBuildError(`Use case "${metaUseCase.key}" targets ${target.name}, which has no metadata of its own — it is missing @entity(), or a circular import evaluated the use case first.`);
57
+ }
58
+ const existing = (_own_META_USE_CASE_KEY = own[META_USE_CASE_KEY]) != null ? _own_META_USE_CASE_KEY : [];
59
+ own[META_USE_CASE_KEY] = [
60
+ ...existing,
61
+ metaUseCase
62
+ ];
63
+ }
64
+ /**
65
+ * Record on the use-case class itself which entity and verb it implements, so
66
+ * the permission can be derived from the class alone. That is what keeps the
67
+ * verb string written once, at the declaration, instead of being retyped at
68
+ * every guard.
69
+ */ export function setMetaUseCaseBinding(metadata, binding) {
70
+ requireMetadata(metadata)[META_USE_CASE_BINDING_KEY] = binding;
71
+ }
72
+ function readMetadata(target) {
73
+ var _target_Symbol_metadata;
74
+ return (_target_Symbol_metadata = target[Symbol.metadata]) != null ? _target_Symbol_metadata : undefined;
75
+ }
76
+ export function extractMetaEntity(target) {
77
+ const metadata = readMetadata(target);
78
+ const metaEntity = metadata == null ? void 0 : metadata[META_ENTITY_KEY];
79
+ if (!metaEntity) {
80
+ throw new EntifixBuildError(`MetaEntity not found for ${target.name}`);
81
+ }
82
+ return metaEntity;
83
+ }
84
+ /**
85
+ * Every accessor declared on a class.
86
+ *
87
+ * The target is a {@link ChildConstructor}, not an `EntityConstructor`: an
88
+ * `@accessor()` writes to its own class's metadata bag with no help from
89
+ * `@entity()`, so a `composition` member's child — a value with no `id` — is
90
+ * described by exactly this walk.
91
+ */ export function extractMetaAccessors(target) {
92
+ var _ref;
93
+ const metadata = readMetadata(target);
94
+ return (_ref = metadata == null ? void 0 : metadata[META_ACCESSOR_KEY]) != null ? _ref : [];
95
+ }
96
+ export function extractMetaMethods(target) {
97
+ var _ref;
98
+ const metadata = readMetadata(target);
99
+ return (_ref = metadata == null ? void 0 : metadata[META_METHOD_KEY]) != null ? _ref : [];
100
+ }
101
+ /** Every use case declared against an entity. Empty until one is imported. */ export function extractMetaUseCases(target) {
102
+ var _ref;
103
+ const metadata = readMetadata(target);
104
+ return (_ref = metadata == null ? void 0 : metadata[META_USE_CASE_KEY]) != null ? _ref : [];
105
+ }
106
+ /** The entity and verb a `@useCase()` class implements. */ export function extractMetaUseCaseBinding(target) {
107
+ const metadata = target[Symbol.metadata];
108
+ const binding = metadata == null ? void 0 : metadata[META_USE_CASE_BINDING_KEY];
109
+ if (!binding) {
110
+ throw new EntifixBuildError(`MetaUseCase not found for ${target.name} — is it missing @useCase()?`);
111
+ }
112
+ return binding;
113
+ }
114
+
115
+ //# sourceMappingURL=entity-definition-helpers.js.map