@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,117 @@
1
+ import type { Entity, EntityId } from './Entity.js';
2
+ import type { FilterGroup } from './EntityFiltering.js';
3
+ /**
4
+ * What a collection-bound action acts on.
5
+ *
6
+ * The two members are **not** two shapes of one idea, and collapsing them is
7
+ * the defect this type exists to prevent. "Select all on this page" is a list
8
+ * of ids the browser already holds; "select all 3.200 matching the filter" is a
9
+ * *filter expression the server evaluates* — the set is by definition larger
10
+ * than the page, so there is nothing to enumerate. Written as one optional
11
+ * field (`ids?: …` beside `all?: boolean`) the second quietly becomes the
12
+ * first, and a bulk action that reads as "the 25 rows I can see" runs over
13
+ * every row in the store.
14
+ *
15
+ * `excluded` is what makes the second member usable rather than all-or-nothing:
16
+ * an operator takes everything matching and then drops the two rows they know
17
+ * about. It is a subtraction from a server-side set, never an addition to a
18
+ * client-side one.
19
+ *
20
+ * `total` is carried rather than derived because only the server knows it, and
21
+ * the count is the whole affordance — "Retirar 3.200 marcas" is a different
22
+ * sentence from "Retirar", and the user has to read the number *before* they
23
+ * confirm ([ADR 0035](../../../../../../docs/adr/0035-entity-actions-selection-and-bulk.md)).
24
+ */
25
+ export type EntitySelection<TEntity extends Entity> = {
26
+ mode: 'ids';
27
+ ids: ReadonlySet<EntityId>;
28
+ } | {
29
+ mode: 'matching';
30
+ /** The filtering in effect when the set was taken. Absent means "every row". */
31
+ filtering?: FilterGroup<TEntity>;
32
+ /** How many rows the server said match. */
33
+ total: number;
34
+ /** Rows the user removed from the matching set. */
35
+ excluded: ReadonlySet<EntityId>;
36
+ };
37
+ /** An empty `ids` selection — the state a table starts and clears to. */
38
+ export declare const emptySelection: <TEntity extends Entity>() => EntitySelection<TEntity>;
39
+ /**
40
+ * How many rows the action will touch.
41
+ *
42
+ * For `matching` this is the server's count minus what the user removed, which
43
+ * is the number the confirmation must show. It can only ever be an estimate —
44
+ * rows may have been written since the count was taken — and that is inherent
45
+ * to the mode rather than a defect in it.
46
+ */
47
+ export declare function selectionSize<TEntity extends Entity>(selection: EntitySelection<TEntity>): number;
48
+ /** Whether one row is part of the selection. */
49
+ export declare function isSelected<TEntity extends Entity>(selection: EntitySelection<TEntity>, id: EntityId): boolean;
50
+ /** Whether the action would touch nothing. */
51
+ export declare function isSelectionEmpty<TEntity extends Entity>(selection: EntitySelection<TEntity>): boolean;
52
+ /**
53
+ * Add or remove one row, in whichever direction the current mode means.
54
+ *
55
+ * In `ids` mode a toggle writes the id set; in `matching` mode it writes the
56
+ * *exclusion* set, because the selection is the server's answer and the only
57
+ * thing the browser owns is what was taken back out of it. Both return a new
58
+ * value — the selection is controlled state held above the table.
59
+ */
60
+ export declare function toggleSelected<TEntity extends Entity>(selection: EntitySelection<TEntity>, id: EntityId, selected: boolean): EntitySelection<TEntity>;
61
+ /**
62
+ * The ids a bulk request should carry, or `undefined` when it must carry the
63
+ * filter instead.
64
+ *
65
+ * A caller that treats `undefined` as "no rows" has made exactly the mistake
66
+ * the two modes exist to prevent, so this returns `undefined` rather than an
67
+ * empty array: an empty array is a plausible payload and would silently do
68
+ * nothing, where `undefined` cannot be sent at all.
69
+ */
70
+ export declare function selectionIds<TEntity extends Entity>(selection: EntitySelection<TEntity>): EntityId[] | undefined;
71
+ /**
72
+ * The selection as it crosses the wire.
73
+ *
74
+ * `Set` does not survive `JSON.stringify` — it serializes to `{}`, silently,
75
+ * and arrives as an empty object that reads as "no rows excluded" rather than
76
+ * as an error. That is the same class of fault ADR 0032 recorded for autosaved
77
+ * drafts, and it is worse here: a `matching` selection whose exclusions
78
+ * evaporate acts on rows the operator deliberately took out.
79
+ *
80
+ * So the wire form is arrays and the in-memory form is sets, named separately
81
+ * rather than one type used loosely. The set is the right in-memory shape
82
+ * because it dedupes by construction and answers `isSelected` in constant time;
83
+ * the array is the only JSON shape there is.
84
+ */
85
+ export type EntitySelectionWire<TEntity extends Entity> = {
86
+ mode: 'ids';
87
+ ids: EntityId[];
88
+ } | {
89
+ mode: 'matching';
90
+ filtering?: FilterGroup<TEntity>;
91
+ total: number;
92
+ excluded: EntityId[];
93
+ };
94
+ /**
95
+ * Convert a selection to its wire form.
96
+ *
97
+ * ⚠️ **`Array.from(set)`, never `[...set]`.** Every package here compiles with
98
+ * `"loose": true` in its `.swcrc`, and SWC's loose spread helper skips the
99
+ * iterable protocol: it treats the operand as array-like, finds no `length` on
100
+ * a `Set`, and **wraps it as a single element** — `[...someSet]` becomes
101
+ * `[Set]`, silently, with the right `.size` still on the inner value. Measured
102
+ * against the running service, where it turned a two-row selection into one
103
+ * outcome whose `id` serialized as `{}`. Vitest and Turbopack transpile
104
+ * differently, so it passes every unit test and only fails in the built
105
+ * bundle.
106
+ */
107
+ export declare function toWireSelection<TEntity extends Entity>(selection: EntitySelection<TEntity>): EntitySelectionWire<TEntity>;
108
+ /**
109
+ * Read a wire selection back, rejecting anything that is not one.
110
+ *
111
+ * Untrusted input: this arrives in a request body and decides which rows a
112
+ * bulk write touches. A missing `mode` must not fall through to a default —
113
+ * defaulting to `ids` with no ids would act on nothing (merely confusing),
114
+ * while defaulting to `matching` would act on **everything**.
115
+ */
116
+ export declare function readWireSelection<TEntity extends Entity>(value: unknown): EntitySelection<TEntity> | undefined;
117
+ //# sourceMappingURL=EntitySelection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntitySelection.d.ts","sourceRoot":"","sources":["../../src/types/EntitySelection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,MAAM,eAAe,CAAC,OAAO,SAAS,MAAM,IAC9C;IACE,IAAI,EAAE,KAAK,CAAC;IACZ,GAAG,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;CAC5B,GACD;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,gFAAgF;IAChF,SAAS,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACjC,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;CACjC,CAAC;AAEN,yEAAyE;AACzE,eAAO,MAAM,cAAc,GACzB,OAAO,SAAS,MAAM,OACnB,eAAe,CAAC,OAAO,CAAgD,CAAC;AAE7E;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,SAAS,MAAM,EAClD,SAAS,EAAE,eAAe,CAAC,OAAO,CAAC,GAClC,MAAM,CAIR;AAED,gDAAgD;AAChD,wBAAgB,UAAU,CAAC,OAAO,SAAS,MAAM,EAC/C,SAAS,EAAE,eAAe,CAAC,OAAO,CAAC,EACnC,EAAE,EAAE,QAAQ,GACX,OAAO,CAIT;AAED,8CAA8C;AAC9C,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,MAAM,EACrD,SAAS,EAAE,eAAe,CAAC,OAAO,CAAC,GAClC,OAAO,CAET;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,OAAO,SAAS,MAAM,EACnD,SAAS,EAAE,eAAe,CAAC,OAAO,CAAC,EACnC,EAAE,EAAE,QAAQ,EACZ,QAAQ,EAAE,OAAO,GAChB,eAAe,CAAC,OAAO,CAAC,CAY1B;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,OAAO,SAAS,MAAM,EACjD,SAAS,EAAE,eAAe,CAAC,OAAO,CAAC,GAClC,QAAQ,EAAE,GAAG,SAAS,CAExB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,mBAAmB,CAAC,OAAO,SAAS,MAAM,IAClD;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,QAAQ,EAAE,CAAA;CAAE,GAChC;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,SAAS,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,QAAQ,EAAE,CAAC;CACtB,CAAC;AAEN;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,OAAO,SAAS,MAAM,EACpD,SAAS,EAAE,eAAe,CAAC,OAAO,CAAC,GAClC,mBAAmB,CAAC,OAAO,CAAC,CAI9B;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,SAAS,MAAM,EACtD,KAAK,EAAE,OAAO,GACb,eAAe,CAAC,OAAO,CAAC,GAAG,SAAS,CA0BtC"}
@@ -0,0 +1,107 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ /** An empty `ids` selection — the state a table starts and clears to. */ export const emptySelection = ()=>({
3
+ mode: 'ids',
4
+ ids: new Set()
5
+ });
6
+ /**
7
+ * How many rows the action will touch.
8
+ *
9
+ * For `matching` this is the server's count minus what the user removed, which
10
+ * is the number the confirmation must show. It can only ever be an estimate —
11
+ * rows may have been written since the count was taken — and that is inherent
12
+ * to the mode rather than a defect in it.
13
+ */ export function selectionSize(selection) {
14
+ return selection.mode === 'ids' ? selection.ids.size : Math.max(0, selection.total - selection.excluded.size);
15
+ }
16
+ /** Whether one row is part of the selection. */ export function isSelected(selection, id) {
17
+ return selection.mode === 'ids' ? selection.ids.has(id) : !selection.excluded.has(id);
18
+ }
19
+ /** Whether the action would touch nothing. */ export function isSelectionEmpty(selection) {
20
+ return selectionSize(selection) === 0;
21
+ }
22
+ /**
23
+ * Add or remove one row, in whichever direction the current mode means.
24
+ *
25
+ * In `ids` mode a toggle writes the id set; in `matching` mode it writes the
26
+ * *exclusion* set, because the selection is the server's answer and the only
27
+ * thing the browser owns is what was taken back out of it. Both return a new
28
+ * value — the selection is controlled state held above the table.
29
+ */ export function toggleSelected(selection, id, selected) {
30
+ if (selection.mode === 'ids') {
31
+ const ids = new Set(selection.ids);
32
+ if (selected) ids.add(id);
33
+ else ids.delete(id);
34
+ return {
35
+ mode: 'ids',
36
+ ids
37
+ };
38
+ }
39
+ const excluded = new Set(selection.excluded);
40
+ if (selected) excluded.delete(id);
41
+ else excluded.add(id);
42
+ return _extends({}, selection, {
43
+ excluded
44
+ });
45
+ }
46
+ /**
47
+ * The ids a bulk request should carry, or `undefined` when it must carry the
48
+ * filter instead.
49
+ *
50
+ * A caller that treats `undefined` as "no rows" has made exactly the mistake
51
+ * the two modes exist to prevent, so this returns `undefined` rather than an
52
+ * empty array: an empty array is a plausible payload and would silently do
53
+ * nothing, where `undefined` cannot be sent at all.
54
+ */ export function selectionIds(selection) {
55
+ return selection.mode === 'ids' ? Array.from(selection.ids) : undefined;
56
+ }
57
+ /**
58
+ * Convert a selection to its wire form.
59
+ *
60
+ * ⚠️ **`Array.from(set)`, never `[...set]`.** Every package here compiles with
61
+ * `"loose": true` in its `.swcrc`, and SWC's loose spread helper skips the
62
+ * iterable protocol: it treats the operand as array-like, finds no `length` on
63
+ * a `Set`, and **wraps it as a single element** — `[...someSet]` becomes
64
+ * `[Set]`, silently, with the right `.size` still on the inner value. Measured
65
+ * against the running service, where it turned a two-row selection into one
66
+ * outcome whose `id` serialized as `{}`. Vitest and Turbopack transpile
67
+ * differently, so it passes every unit test and only fails in the built
68
+ * bundle.
69
+ */ export function toWireSelection(selection) {
70
+ return selection.mode === 'ids' ? {
71
+ mode: 'ids',
72
+ ids: Array.from(selection.ids)
73
+ } : _extends({}, selection, {
74
+ excluded: Array.from(selection.excluded)
75
+ });
76
+ }
77
+ /**
78
+ * Read a wire selection back, rejecting anything that is not one.
79
+ *
80
+ * Untrusted input: this arrives in a request body and decides which rows a
81
+ * bulk write touches. A missing `mode` must not fall through to a default —
82
+ * defaulting to `ids` with no ids would act on nothing (merely confusing),
83
+ * while defaulting to `matching` would act on **everything**.
84
+ */ export function readWireSelection(value) {
85
+ if (typeof value !== 'object' || value === null) return undefined;
86
+ const candidate = value;
87
+ if (candidate.mode === 'ids') {
88
+ return Array.isArray(candidate.ids) ? {
89
+ mode: 'ids',
90
+ ids: new Set(candidate.ids)
91
+ } : undefined;
92
+ }
93
+ if (candidate.mode === 'matching') {
94
+ const matching = candidate;
95
+ if (typeof matching.total !== 'number') return undefined;
96
+ if (!Array.isArray(matching.excluded)) return undefined;
97
+ return {
98
+ mode: 'matching',
99
+ filtering: matching.filtering,
100
+ total: matching.total,
101
+ excluded: new Set(matching.excluded)
102
+ };
103
+ }
104
+ return undefined;
105
+ }
106
+
107
+ //# sourceMappingURL=EntitySelection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/EntitySelection.ts"],"sourcesContent":["import type { Entity, EntityId } from './Entity.js';\nimport type { FilterGroup } from './EntityFiltering.js';\n\n/**\n * What a collection-bound action acts on.\n *\n * The two members are **not** two shapes of one idea, and collapsing them is\n * the defect this type exists to prevent. \"Select all on this page\" is a list\n * of ids the browser already holds; \"select all 3.200 matching the filter\" is a\n * *filter expression the server evaluates* — the set is by definition larger\n * than the page, so there is nothing to enumerate. Written as one optional\n * field (`ids?: …` beside `all?: boolean`) the second quietly becomes the\n * first, and a bulk action that reads as \"the 25 rows I can see\" runs over\n * every row in the store.\n *\n * `excluded` is what makes the second member usable rather than all-or-nothing:\n * an operator takes everything matching and then drops the two rows they know\n * about. It is a subtraction from a server-side set, never an addition to a\n * client-side one.\n *\n * `total` is carried rather than derived because only the server knows it, and\n * the count is the whole affordance — \"Retirar 3.200 marcas\" is a different\n * sentence from \"Retirar\", and the user has to read the number *before* they\n * confirm ([ADR 0035](../../../../../../docs/adr/0035-entity-actions-selection-and-bulk.md)).\n */\nexport type EntitySelection<TEntity extends Entity> =\n | {\n mode: 'ids';\n ids: ReadonlySet<EntityId>;\n }\n | {\n mode: 'matching';\n /** The filtering in effect when the set was taken. Absent means \"every row\". */\n filtering?: FilterGroup<TEntity>;\n /** How many rows the server said match. */\n total: number;\n /** Rows the user removed from the matching set. */\n excluded: ReadonlySet<EntityId>;\n };\n\n/** An empty `ids` selection — the state a table starts and clears to. */\nexport const emptySelection = <\n TEntity extends Entity,\n>(): EntitySelection<TEntity> => ({ mode: 'ids', ids: new Set<EntityId>() });\n\n/**\n * How many rows the action will touch.\n *\n * For `matching` this is the server's count minus what the user removed, which\n * is the number the confirmation must show. It can only ever be an estimate —\n * rows may have been written since the count was taken — and that is inherent\n * to the mode rather than a defect in it.\n */\nexport function selectionSize<TEntity extends Entity>(\n selection: EntitySelection<TEntity>,\n): number {\n return selection.mode === 'ids'\n ? selection.ids.size\n : Math.max(0, selection.total - selection.excluded.size);\n}\n\n/** Whether one row is part of the selection. */\nexport function isSelected<TEntity extends Entity>(\n selection: EntitySelection<TEntity>,\n id: EntityId,\n): boolean {\n return selection.mode === 'ids'\n ? selection.ids.has(id)\n : !selection.excluded.has(id);\n}\n\n/** Whether the action would touch nothing. */\nexport function isSelectionEmpty<TEntity extends Entity>(\n selection: EntitySelection<TEntity>,\n): boolean {\n return selectionSize(selection) === 0;\n}\n\n/**\n * Add or remove one row, in whichever direction the current mode means.\n *\n * In `ids` mode a toggle writes the id set; in `matching` mode it writes the\n * *exclusion* set, because the selection is the server's answer and the only\n * thing the browser owns is what was taken back out of it. Both return a new\n * value — the selection is controlled state held above the table.\n */\nexport function toggleSelected<TEntity extends Entity>(\n selection: EntitySelection<TEntity>,\n id: EntityId,\n selected: boolean,\n): EntitySelection<TEntity> {\n if (selection.mode === 'ids') {\n const ids = new Set(selection.ids);\n if (selected) ids.add(id);\n else ids.delete(id);\n return { mode: 'ids', ids };\n }\n\n const excluded = new Set(selection.excluded);\n if (selected) excluded.delete(id);\n else excluded.add(id);\n return { ...selection, excluded };\n}\n\n/**\n * The ids a bulk request should carry, or `undefined` when it must carry the\n * filter instead.\n *\n * A caller that treats `undefined` as \"no rows\" has made exactly the mistake\n * the two modes exist to prevent, so this returns `undefined` rather than an\n * empty array: an empty array is a plausible payload and would silently do\n * nothing, where `undefined` cannot be sent at all.\n */\nexport function selectionIds<TEntity extends Entity>(\n selection: EntitySelection<TEntity>,\n): EntityId[] | undefined {\n return selection.mode === 'ids' ? Array.from(selection.ids) : undefined;\n}\n\n/**\n * The selection as it crosses the wire.\n *\n * `Set` does not survive `JSON.stringify` — it serializes to `{}`, silently,\n * and arrives as an empty object that reads as \"no rows excluded\" rather than\n * as an error. That is the same class of fault ADR 0032 recorded for autosaved\n * drafts, and it is worse here: a `matching` selection whose exclusions\n * evaporate acts on rows the operator deliberately took out.\n *\n * So the wire form is arrays and the in-memory form is sets, named separately\n * rather than one type used loosely. The set is the right in-memory shape\n * because it dedupes by construction and answers `isSelected` in constant time;\n * the array is the only JSON shape there is.\n */\nexport type EntitySelectionWire<TEntity extends Entity> =\n | { mode: 'ids'; ids: EntityId[] }\n | {\n mode: 'matching';\n filtering?: FilterGroup<TEntity>;\n total: number;\n excluded: EntityId[];\n };\n\n/**\n * Convert a selection to its wire form.\n *\n * ⚠️ **`Array.from(set)`, never `[...set]`.** Every package here compiles with\n * `\"loose\": true` in its `.swcrc`, and SWC's loose spread helper skips the\n * iterable protocol: it treats the operand as array-like, finds no `length` on\n * a `Set`, and **wraps it as a single element** — `[...someSet]` becomes\n * `[Set]`, silently, with the right `.size` still on the inner value. Measured\n * against the running service, where it turned a two-row selection into one\n * outcome whose `id` serialized as `{}`. Vitest and Turbopack transpile\n * differently, so it passes every unit test and only fails in the built\n * bundle.\n */\nexport function toWireSelection<TEntity extends Entity>(\n selection: EntitySelection<TEntity>,\n): EntitySelectionWire<TEntity> {\n return selection.mode === 'ids'\n ? { mode: 'ids', ids: Array.from(selection.ids) }\n : { ...selection, excluded: Array.from(selection.excluded) };\n}\n\n/**\n * Read a wire selection back, rejecting anything that is not one.\n *\n * Untrusted input: this arrives in a request body and decides which rows a\n * bulk write touches. A missing `mode` must not fall through to a default —\n * defaulting to `ids` with no ids would act on nothing (merely confusing),\n * while defaulting to `matching` would act on **everything**.\n */\nexport function readWireSelection<TEntity extends Entity>(\n value: unknown,\n): EntitySelection<TEntity> | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const candidate = value as Partial<EntitySelectionWire<TEntity>>;\n\n if (candidate.mode === 'ids') {\n return Array.isArray(candidate.ids)\n ? { mode: 'ids', ids: new Set(candidate.ids) }\n : undefined;\n }\n\n if (candidate.mode === 'matching') {\n const matching = candidate as Extract<\n EntitySelectionWire<TEntity>,\n { mode: 'matching' }\n >;\n if (typeof matching.total !== 'number') return undefined;\n if (!Array.isArray(matching.excluded)) return undefined;\n return {\n mode: 'matching',\n filtering: matching.filtering,\n total: matching.total,\n excluded: new Set(matching.excluded),\n };\n }\n\n return undefined;\n}\n"],"names":["emptySelection","mode","ids","Set","selectionSize","selection","size","Math","max","total","excluded","isSelected","id","has","isSelectionEmpty","toggleSelected","selected","add","delete","selectionIds","Array","from","undefined","toWireSelection","readWireSelection","value","candidate","isArray","matching","filtering"],"mappings":";AAwCA,uEAAuE,GACvE,OAAO,MAAMA,iBAAiB,IAEI,CAAA;QAAEC,MAAM;QAAOC,KAAK,IAAIC;IAAgB,CAAA,EAAG;AAE7E;;;;;;;CAOC,GACD,OAAO,SAASC,cACdC,SAAmC;IAEnC,OAAOA,UAAUJ,IAAI,KAAK,QACtBI,UAAUH,GAAG,CAACI,IAAI,GAClBC,KAAKC,GAAG,CAAC,GAAGH,UAAUI,KAAK,GAAGJ,UAAUK,QAAQ,CAACJ,IAAI;AAC3D;AAEA,8CAA8C,GAC9C,OAAO,SAASK,WACdN,SAAmC,EACnCO,EAAY;IAEZ,OAAOP,UAAUJ,IAAI,KAAK,QACtBI,UAAUH,GAAG,CAACW,GAAG,CAACD,MAClB,CAACP,UAAUK,QAAQ,CAACG,GAAG,CAACD;AAC9B;AAEA,4CAA4C,GAC5C,OAAO,SAASE,iBACdT,SAAmC;IAEnC,OAAOD,cAAcC,eAAe;AACtC;AAEA;;;;;;;CAOC,GACD,OAAO,SAASU,eACdV,SAAmC,EACnCO,EAAY,EACZI,QAAiB;IAEjB,IAAIX,UAAUJ,IAAI,KAAK,OAAO;QAC5B,MAAMC,MAAM,IAAIC,IAAIE,UAAUH,GAAG;QACjC,IAAIc,UAAUd,IAAIe,GAAG,CAACL;aACjBV,IAAIgB,MAAM,CAACN;QAChB,OAAO;YAAEX,MAAM;YAAOC;QAAI;IAC5B;IAEA,MAAMQ,WAAW,IAAIP,IAAIE,UAAUK,QAAQ;IAC3C,IAAIM,UAAUN,SAASQ,MAAM,CAACN;SACzBF,SAASO,GAAG,CAACL;IAClB,OAAO,aAAKP;QAAWK;;AACzB;AAEA;;;;;;;;CAQC,GACD,OAAO,SAASS,aACdd,SAAmC;IAEnC,OAAOA,UAAUJ,IAAI,KAAK,QAAQmB,MAAMC,IAAI,CAAChB,UAAUH,GAAG,IAAIoB;AAChE;AAyBA;;;;;;;;;;;;CAYC,GACD,OAAO,SAASC,gBACdlB,SAAmC;IAEnC,OAAOA,UAAUJ,IAAI,KAAK,QACtB;QAAEA,MAAM;QAAOC,KAAKkB,MAAMC,IAAI,CAAChB,UAAUH,GAAG;IAAE,IAC9C,aAAKG;QAAWK,UAAUU,MAAMC,IAAI,CAAChB,UAAUK,QAAQ;;AAC7D;AAEA;;;;;;;CAOC,GACD,OAAO,SAASc,kBACdC,KAAc;IAEd,IAAI,OAAOA,UAAU,YAAYA,UAAU,MAAM,OAAOH;IACxD,MAAMI,YAAYD;IAElB,IAAIC,UAAUzB,IAAI,KAAK,OAAO;QAC5B,OAAOmB,MAAMO,OAAO,CAACD,UAAUxB,GAAG,IAC9B;YAAED,MAAM;YAAOC,KAAK,IAAIC,IAAIuB,UAAUxB,GAAG;QAAE,IAC3CoB;IACN;IAEA,IAAII,UAAUzB,IAAI,KAAK,YAAY;QACjC,MAAM2B,WAAWF;QAIjB,IAAI,OAAOE,SAASnB,KAAK,KAAK,UAAU,OAAOa;QAC/C,IAAI,CAACF,MAAMO,OAAO,CAACC,SAASlB,QAAQ,GAAG,OAAOY;QAC9C,OAAO;YACLrB,MAAM;YACN4B,WAAWD,SAASC,SAAS;YAC7BpB,OAAOmB,SAASnB,KAAK;YACrBC,UAAU,IAAIP,IAAIyB,SAASlB,QAAQ;QACrC;IACF;IAEA,OAAOY;AACT"}
@@ -0,0 +1,7 @@
1
+ import type { Entity } from './Entity.js';
2
+ export type EntitySortType = 'asc' | 'desc';
3
+ export type EntitySorting<TEntity extends Entity> = Record<number, {
4
+ property: keyof TEntity;
5
+ type: EntitySortType;
6
+ }>;
7
+ //# sourceMappingURL=EntitySorting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntitySorting.d.ts","sourceRoot":"","sources":["../../src/types/EntitySorting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,CAAC;AAE5C,MAAM,MAAM,aAAa,CAAC,OAAO,SAAS,MAAM,IAAI,MAAM,CACxD,MAAM,EACN;IACE,QAAQ,EAAE,MAAM,OAAO,CAAC;IACxB,IAAI,EAAE,cAAc,CAAC;CACtB,CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=EntitySorting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/EntitySorting.ts"],"sourcesContent":["import type { Entity } from './Entity.js';\n\nexport type EntitySortType = 'asc' | 'desc';\n\nexport type EntitySorting<TEntity extends Entity> = Record<\n number,\n {\n property: keyof TEntity;\n type: EntitySortType;\n }\n>;\n"],"names":[],"mappings":"AAIA,WAME"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * A value that survives `JSON.parse(JSON.stringify(x))` unchanged.
3
+ *
4
+ * It exists to make one rule checkable at compile time: **anything persisted as
5
+ * an autosaved draft is JSON round-trippable, period** — no class instances, no
6
+ * `EntityLink`, no `Date`. A draft is written through `createJSONStorage`, so a
7
+ * value that is not this is not "mostly preserved"; it comes back as something
8
+ * else (a `Date` as a string, an entity as a bare object, a `Map` as `{}`) and
9
+ * the loss is silent.
10
+ *
11
+ * Note the deliberate asymmetry with `UiPreferencesState`, the other persisted
12
+ * client store: that one writes through IndexedDB's **structured clone**, which
13
+ * does preserve a `Date` and a `Map`. The two contracts differ, so a type that
14
+ * describes one must not be reused for the other.
15
+ *
16
+ * `undefined` is absent on purpose — `JSON.stringify` drops an `undefined`
17
+ * member rather than round-tripping it, so a draft holding one restores with
18
+ * that key missing. Model "no value" as `null`, or leave the key out.
19
+ */
20
+ export type JsonValue = string | number | boolean | null | readonly JsonValue[] | {
21
+ readonly [key: string]: JsonValue;
22
+ };
23
+ /** A JSON object — the shape a draft always takes at its top level. */
24
+ export type JsonObject = {
25
+ readonly [key: string]: JsonValue;
26
+ };
27
+ /**
28
+ * Whether a runtime value is {@link JsonValue}-shaped.
29
+ *
30
+ * The type above is the compile-time half; this is what a restore boundary needs,
31
+ * because a value read back out of storage arrives as `unknown` and no cast makes
32
+ * it true. Deliberately structural rather than a `JSON.stringify` round trip: a
33
+ * cycle throws there, and a `Date` survives it while being exactly what this must
34
+ * reject.
35
+ */
36
+ export declare function isJsonValue(value: unknown): value is JsonValue;
37
+ //# sourceMappingURL=Json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Json.d.ts","sourceRoot":"","sources":["../../src/types/Json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,SAAS,EAAE,GACpB;IAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAE1C,uEAAuE;AACvE,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAE/D;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAc9D"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * A value that survives `JSON.parse(JSON.stringify(x))` unchanged.
3
+ *
4
+ * It exists to make one rule checkable at compile time: **anything persisted as
5
+ * an autosaved draft is JSON round-trippable, period** — no class instances, no
6
+ * `EntityLink`, no `Date`. A draft is written through `createJSONStorage`, so a
7
+ * value that is not this is not "mostly preserved"; it comes back as something
8
+ * else (a `Date` as a string, an entity as a bare object, a `Map` as `{}`) and
9
+ * the loss is silent.
10
+ *
11
+ * Note the deliberate asymmetry with `UiPreferencesState`, the other persisted
12
+ * client store: that one writes through IndexedDB's **structured clone**, which
13
+ * does preserve a `Date` and a `Map`. The two contracts differ, so a type that
14
+ * describes one must not be reused for the other.
15
+ *
16
+ * `undefined` is absent on purpose — `JSON.stringify` drops an `undefined`
17
+ * member rather than round-tripping it, so a draft holding one restores with
18
+ * that key missing. Model "no value" as `null`, or leave the key out.
19
+ */ /**
20
+ * Whether a runtime value is {@link JsonValue}-shaped.
21
+ *
22
+ * The type above is the compile-time half; this is what a restore boundary needs,
23
+ * because a value read back out of storage arrives as `unknown` and no cast makes
24
+ * it true. Deliberately structural rather than a `JSON.stringify` round trip: a
25
+ * cycle throws there, and a `Date` survives it while being exactly what this must
26
+ * reject.
27
+ */ export function isJsonValue(value) {
28
+ if (value === null) return true;
29
+ const type = typeof value;
30
+ if (type === 'string' || type === 'number' || type === 'boolean') {
31
+ // `NaN` and `Infinity` serialize as `null`, so they do not round-trip.
32
+ return type !== 'number' || Number.isFinite(value);
33
+ }
34
+ if (Array.isArray(value)) return value.every(isJsonValue);
35
+ if (type !== 'object') return false;
36
+ // A plain object only. `Object.create(null)` is JSON-safe too and is what a
37
+ // `JSON.parse` reviver can produce, so both prototypes are accepted.
38
+ const prototype = Object.getPrototypeOf(value);
39
+ if (prototype !== Object.prototype && prototype !== null) return false;
40
+ return Object.values(value).every(isJsonValue);
41
+ }
42
+
43
+ //# sourceMappingURL=Json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/Json.ts"],"sourcesContent":["/**\n * A value that survives `JSON.parse(JSON.stringify(x))` unchanged.\n *\n * It exists to make one rule checkable at compile time: **anything persisted as\n * an autosaved draft is JSON round-trippable, period** — no class instances, no\n * `EntityLink`, no `Date`. A draft is written through `createJSONStorage`, so a\n * value that is not this is not \"mostly preserved\"; it comes back as something\n * else (a `Date` as a string, an entity as a bare object, a `Map` as `{}`) and\n * the loss is silent.\n *\n * Note the deliberate asymmetry with `UiPreferencesState`, the other persisted\n * client store: that one writes through IndexedDB's **structured clone**, which\n * does preserve a `Date` and a `Map`. The two contracts differ, so a type that\n * describes one must not be reused for the other.\n *\n * `undefined` is absent on purpose — `JSON.stringify` drops an `undefined`\n * member rather than round-tripping it, so a draft holding one restores with\n * that key missing. Model \"no value\" as `null`, or leave the key out.\n */\nexport type JsonValue =\n | string\n | number\n | boolean\n | null\n | readonly JsonValue[]\n | { readonly [key: string]: JsonValue };\n\n/** A JSON object — the shape a draft always takes at its top level. */\nexport type JsonObject = { readonly [key: string]: JsonValue };\n\n/**\n * Whether a runtime value is {@link JsonValue}-shaped.\n *\n * The type above is the compile-time half; this is what a restore boundary needs,\n * because a value read back out of storage arrives as `unknown` and no cast makes\n * it true. Deliberately structural rather than a `JSON.stringify` round trip: a\n * cycle throws there, and a `Date` survives it while being exactly what this must\n * reject.\n */\nexport function isJsonValue(value: unknown): value is JsonValue {\n if (value === null) return true;\n const type = typeof value;\n if (type === 'string' || type === 'number' || type === 'boolean') {\n // `NaN` and `Infinity` serialize as `null`, so they do not round-trip.\n return type !== 'number' || Number.isFinite(value);\n }\n if (Array.isArray(value)) return value.every(isJsonValue);\n if (type !== 'object') return false;\n // A plain object only. `Object.create(null)` is JSON-safe too and is what a\n // `JSON.parse` reviver can produce, so both prototypes are accepted.\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null) return false;\n return Object.values(value as Record<string, unknown>).every(isJsonValue);\n}\n"],"names":["isJsonValue","value","type","Number","isFinite","Array","isArray","every","prototype","Object","getPrototypeOf","values"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;CAkBC,GAYD;;;;;;;;CAQC,GACD,OAAO,SAASA,YAAYC,KAAc;IACxC,IAAIA,UAAU,MAAM,OAAO;IAC3B,MAAMC,OAAO,OAAOD;IACpB,IAAIC,SAAS,YAAYA,SAAS,YAAYA,SAAS,WAAW;QAChE,uEAAuE;QACvE,OAAOA,SAAS,YAAYC,OAAOC,QAAQ,CAACH;IAC9C;IACA,IAAII,MAAMC,OAAO,CAACL,QAAQ,OAAOA,MAAMM,KAAK,CAACP;IAC7C,IAAIE,SAAS,UAAU,OAAO;IAC9B,4EAA4E;IAC5E,qEAAqE;IACrE,MAAMM,YAAYC,OAAOC,cAAc,CAACT;IACxC,IAAIO,cAAcC,OAAOD,SAAS,IAAIA,cAAc,MAAM,OAAO;IACjE,OAAOC,OAAOE,MAAM,CAACV,OAAkCM,KAAK,CAACP;AAC/D"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * The [Standard Schema](https://standardschema.dev) v1 contract, vendored.
3
+ *
4
+ * Standard Schema is an interface, not a library: Zod, Valibot and ArkType all
5
+ * expose `~standard` and nothing else is needed to run one. Declaring it here
6
+ * lets an entity carry a real schema without `@entifix/core` — the bottom of
7
+ * the stack — taking a runtime dependency on any validation library, and keeps
8
+ * whichever one a domain picks an implementation detail of that domain.
9
+ *
10
+ * Only the parts a caller needs to *run* a schema are vendored; the inference
11
+ * helpers from the published package are left out deliberately, since a draft
12
+ * arrives as strings and is validated, never parsed into a typed value here.
13
+ */
14
+ export interface StandardSchemaV1<Input = unknown, Output = Input> {
15
+ readonly '~standard': StandardSchemaV1Props<Input, Output>;
16
+ }
17
+ export interface StandardSchemaV1Props<Input = unknown, Output = Input> {
18
+ /** Contract version, for a consumer that has to branch on it. */
19
+ readonly version: 1;
20
+ /** The library that produced the schema (`zod`, `valibot`, …). */
21
+ readonly vendor: string;
22
+ /**
23
+ * Validates a value. Returns issues on failure and the parsed value on
24
+ * success — a Promise when the schema has async rules.
25
+ */
26
+ readonly validate: (value: unknown) => StandardSchemaV1Result<Output> | Promise<StandardSchemaV1Result<Output>>;
27
+ readonly types?: {
28
+ readonly input: Input;
29
+ readonly output: Output;
30
+ };
31
+ }
32
+ export type StandardSchemaV1Result<Output> = {
33
+ readonly value: Output;
34
+ readonly issues?: undefined;
35
+ } | {
36
+ readonly issues: readonly StandardSchemaV1Issue[];
37
+ };
38
+ export interface StandardSchemaV1Issue {
39
+ readonly message: string;
40
+ /** Where the issue occurred; empty (or absent) means the value as a whole. */
41
+ readonly path?: ReadonlyArray<PropertyKey | {
42
+ readonly key: PropertyKey;
43
+ }>;
44
+ }
45
+ //# sourceMappingURL=StandardSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StandardSchema.d.ts","sourceRoot":"","sources":["../../src/types/StandardSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,gBAAgB,CAAC,KAAK,GAAG,OAAO,EAAE,MAAM,GAAG,KAAK;IAC/D,QAAQ,CAAC,WAAW,EAAE,qBAAqB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;CAC5D;AAED,MAAM,WAAW,qBAAqB,CAAC,KAAK,GAAG,OAAO,EAAE,MAAM,GAAG,KAAK;IACpE,iEAAiE;IACjE,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACpB,kEAAkE;IAClE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,CACjB,KAAK,EAAE,OAAO,KACX,sBAAsB,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9E,QAAQ,CAAC,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CACrE;AAED,MAAM,MAAM,sBAAsB,CAAC,MAAM,IACrC;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,GACvD;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,qBAAqB,EAAE,CAAA;CAAE,CAAC;AAE1D,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,WAAW,GAAG;QAAE,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAA;KAAE,CAAC,CAAC;CAC5E"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The [Standard Schema](https://standardschema.dev) v1 contract, vendored.
3
+ *
4
+ * Standard Schema is an interface, not a library: Zod, Valibot and ArkType all
5
+ * expose `~standard` and nothing else is needed to run one. Declaring it here
6
+ * lets an entity carry a real schema without `@entifix/core` — the bottom of
7
+ * the stack — taking a runtime dependency on any validation library, and keeps
8
+ * whichever one a domain picks an implementation detail of that domain.
9
+ *
10
+ * Only the parts a caller needs to *run* a schema are vendored; the inference
11
+ * helpers from the published package are left out deliberately, since a draft
12
+ * arrives as strings and is validated, never parsed into a typed value here.
13
+ */ export { };
14
+
15
+ //# sourceMappingURL=StandardSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/StandardSchema.ts"],"sourcesContent":["/**\n * The [Standard Schema](https://standardschema.dev) v1 contract, vendored.\n *\n * Standard Schema is an interface, not a library: Zod, Valibot and ArkType all\n * expose `~standard` and nothing else is needed to run one. Declaring it here\n * lets an entity carry a real schema without `@entifix/core` — the bottom of\n * the stack — taking a runtime dependency on any validation library, and keeps\n * whichever one a domain picks an implementation detail of that domain.\n *\n * Only the parts a caller needs to *run* a schema are vendored; the inference\n * helpers from the published package are left out deliberately, since a draft\n * arrives as strings and is validated, never parsed into a typed value here.\n */\nexport interface StandardSchemaV1<Input = unknown, Output = Input> {\n readonly '~standard': StandardSchemaV1Props<Input, Output>;\n}\n\nexport interface StandardSchemaV1Props<Input = unknown, Output = Input> {\n /** Contract version, for a consumer that has to branch on it. */\n readonly version: 1;\n /** The library that produced the schema (`zod`, `valibot`, …). */\n readonly vendor: string;\n /**\n * Validates a value. Returns issues on failure and the parsed value on\n * success — a Promise when the schema has async rules.\n */\n readonly validate: (\n value: unknown,\n ) => StandardSchemaV1Result<Output> | Promise<StandardSchemaV1Result<Output>>;\n readonly types?: { readonly input: Input; readonly output: Output };\n}\n\nexport type StandardSchemaV1Result<Output> =\n | { readonly value: Output; readonly issues?: undefined }\n | { readonly issues: readonly StandardSchemaV1Issue[] };\n\nexport interface StandardSchemaV1Issue {\n readonly message: string;\n /** Where the issue occurred; empty (or absent) means the value as a whole. */\n readonly path?: ReadonlyArray<PropertyKey | { readonly key: PropertyKey }>;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;CAYC,GAwBD,WAIC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * A `@useCase()`-decorated class.
3
+ *
4
+ * It is never instantiated: the class exists because stage-3 decorators apply to
5
+ * classes, methods, fields and accessors only, so `@useCase() export function
6
+ * publishUC()` does not parse. The class is what makes annotation possible at
7
+ * all, and its behaviour lives in a static.
8
+ */
9
+ export type UseCaseConstructor = new (...args: any[]) => unknown;
10
+ //# sourceMappingURL=UseCase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UseCase.d.ts","sourceRoot":"","sources":["../../src/types/UseCase.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAG/B,GAAG,IAAI,EAAE,GAAG,EAAE,KACX,OAAO,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * A `@useCase()`-decorated class.
3
+ *
4
+ * It is never instantiated: the class exists because stage-3 decorators apply to
5
+ * classes, methods, fields and accessors only, so `@useCase() export function
6
+ * publishUC()` does not parse. The class is what makes annotation possible at
7
+ * all, and its behaviour lives in a static.
8
+ */ export { };
9
+
10
+ //# sourceMappingURL=UseCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/UseCase.ts"],"sourcesContent":["/**\n * A `@useCase()`-decorated class.\n *\n * It is never instantiated: the class exists because stage-3 decorators apply to\n * classes, methods, fields and accessors only, so `@useCase() export function\n * publishUC()` does not parse. The class is what makes annotation possible at\n * all, and its behaviour lives in a static.\n */\nexport type UseCaseConstructor = new (\n // Same reason as `EntityConstructor`: the parameters are the author's business.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...args: any[]\n) => unknown;\n"],"names":[],"mappings":"AAAA;;;;;;;CAOC,GACD,WAIa"}
@@ -0,0 +1,4 @@
1
+ export * from './wizard-definition.js';
2
+ export * from './wizard-navigation.js';
3
+ export * from './wizard-state.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/wizard/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './wizard-definition.js';
2
+ export * from './wizard-navigation.js';
3
+ export * from './wizard-state.js';
4
+
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/wizard/index.ts"],"sourcesContent":["export * from './wizard-definition.js';\nexport * from './wizard-navigation.js';\nexport * from './wizard-state.js';\n"],"names":[],"mappings":"AAAA,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,oBAAoB"}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * What a step holds, which decides how its value is stored and edited.
3
+ *
4
+ * `form` is one `useEntityForm` instance over part of an entity; `selection` is
5
+ * a table step whose value is a set of ids; `choice` is a branch point offering
6
+ * a fixed list of options; `summary` is the read-only recap; `custom` is
7
+ * anything else the host renders and reads itself.
8
+ */
9
+ export declare const WizardStepKinds: readonly ["form", "selection", "choice", "summary", "custom"];
10
+ export type WizardStepKind = (typeof WizardStepKinds)[number];
11
+ /**
12
+ * One step, and the edges out of it.
13
+ *
14
+ * **The graph is data; `next` only chooses along it.** `to` lists the steps this
15
+ * one may lead to, so reachability, unknown targets, cycles and terminality are
16
+ * decidable by reading the definition — no probing, no enumeration of the state
17
+ * space, and no rule that "only appears to hold" because a `next` reading a form
18
+ * value could never be enumerated. It is the move
19
+ * [ADR 0039](../../../../../../docs/adr/0039-multi-step-sagas-are-orchestrated.md)
20
+ * made for saga steps, for the same reason: a walkable definition is checkable
21
+ * at load, and a function is not.
22
+ *
23
+ * A step with an empty `to` is **terminal**, and
24
+ * {@link assertWizardDefinition} requires that to be the summary.
25
+ */
26
+ export interface WizardStep {
27
+ readonly id: string;
28
+ readonly kind: WizardStepKind;
29
+ /** Catalog key for the stepper's label. Resolved by the renderer, never here. */
30
+ readonly labelKey: string;
31
+ /**
32
+ * The options a `choice` step offers, as stable identifiers.
33
+ *
34
+ * Required on `choice` and forbidden elsewhere: the value of a choice step is
35
+ * one of these strings, so a choice with no options can never be answered and
36
+ * options on a form step describe nothing.
37
+ */
38
+ readonly options?: readonly string[];
39
+ /** Every step this one may lead to. Empty means the flow ends here. */
40
+ readonly to: readonly string[];
41
+ /**
42
+ * Which of {@link WizardStep.to} comes next, given everything answered so far.
43
+ *
44
+ * Optional, and omitting it is the ordinary case: a step with exactly one edge
45
+ * needs no function to pick it. A step with several **must** declare one, or
46
+ * the definition cannot say where it goes.
47
+ *
48
+ * It returns a step id and never `undefined`: **the end of the flow is an
49
+ * empty `to`, not a `next` that declines**. Two ways of saying the same thing
50
+ * would let a step be terminal in one of them and not the other, and it is
51
+ * `to` that {@link assertWizardDefinition} can read.
52
+ */
53
+ next?(state: WizardStateLike): string;
54
+ }
55
+ /**
56
+ * The part of the state a `next` may read.
57
+ *
58
+ * Declared structurally rather than importing `WizardState`, so the definition
59
+ * module stays below the state module and neither has to import the other.
60
+ */
61
+ export interface WizardStateLike {
62
+ readonly activeStep: string;
63
+ readonly steps: {
64
+ readonly [stepId: string]: unknown;
65
+ };
66
+ }
67
+ /**
68
+ * A whole wizard: its key — which is also its screen key in a workspace address
69
+ * — and its steps, the first of which is where the flow begins.
70
+ */
71
+ export interface WizardDefinition {
72
+ readonly key: string;
73
+ readonly steps: readonly WizardStep[];
74
+ }
75
+ /** The step a flow starts at: the first declared. */
76
+ export declare const entryStep: (definition: WizardDefinition) => WizardStep;
77
+ /** The step with this id, or `undefined` when the definition has none. */
78
+ export declare const findStep: (definition: WizardDefinition, stepId: string) => WizardStep | undefined;
79
+ /**
80
+ * Checks a definition the moment it is declared, and throws rather than
81
+ * degrading.
82
+ *
83
+ * **Load time, not step time.** A wizard whose last step is missing, or whose
84
+ * branch names a step that does not exist, must fail on the first render of any
85
+ * surface rather than on the render of the step nobody reached — otherwise the
86
+ * failure of the longest flow in the product arrives at the end of it. That is
87
+ * the posture `assertLinkSourcesAreEditable` and `surfaceFor` already take
88
+ * ([ADR 0035](../../../../../../docs/adr/0035-entity-actions-selection-and-bulk.md)).
89
+ *
90
+ * Six faults, each of which is silent otherwise:
91
+ *
92
+ * - **no steps**, which renders an empty frame with a disabled button;
93
+ * - **a duplicate id**, which makes one step's stored value overwrite another's;
94
+ * - **an unknown `to` target**, a typo that strands the flow mid-way;
95
+ * - **several edges and no `next`**, which cannot say where the step goes;
96
+ * - **a step nothing reaches**, which is either a dead branch or a missing edge;
97
+ * - **the wrong terminal step** — the flow must end in the summary, and there
98
+ * must be exactly one of those. A wizard ending anywhere else commits without
99
+ * the operator ever seeing what they answered, which
100
+ * [#111](https://github.com/r10c-technologies/r10c/issues/111) records as not
101
+ * optional.
102
+ *
103
+ * A cycle needs no separate check: every step is reachable from the entry and
104
+ * exactly one is terminal, so a cycle would leave the steps on it unable to
105
+ * reach that terminal, which the walk below reports as unreachable-from-here.
106
+ */
107
+ export declare function assertWizardDefinition(definition: WizardDefinition): void;
108
+ //# sourceMappingURL=wizard-definition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wizard-definition.d.ts","sourceRoot":"","sources":["../../src/wizard/wizard-definition.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,+DAMlB,CAAC;AACX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,iFAAiF;IACjF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,uEAAuE;IACvE,QAAQ,CAAC,EAAE,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAAC;CACvC;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CACxD;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;CACvC;AAED,qDAAqD;AACrD,eAAO,MAAM,SAAS,GAAI,YAAY,gBAAgB,KAAG,UAMxD,CAAC;AAEF,0EAA0E;AAC1E,eAAO,MAAM,QAAQ,GACnB,YAAY,gBAAgB,EAC5B,QAAQ,MAAM,KACb,UAAU,GAAG,SAA8D,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,gBAAgB,GAAG,IAAI,CAiCzE"}