@contember/binding-legacy 2.1.0-alpha.37 → 2.1.0-alpha.39

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 (390) hide show
  1. package/dist/development/index.cjs +34 -0
  2. package/dist/development/index.cjs.map +1 -0
  3. package/dist/development/index.js +28 -0
  4. package/dist/development/index.js.map +1 -0
  5. package/dist/development/src/accessorTree/NormalizedPersistedData.cjs +10 -0
  6. package/dist/development/src/accessorTree/NormalizedPersistedData.cjs.map +1 -0
  7. package/dist/development/src/accessorTree/NormalizedPersistedData.js +10 -0
  8. package/dist/development/src/accessorTree/NormalizedPersistedData.js.map +1 -0
  9. package/dist/development/src/accessors/EntityAccessorImpl.cjs +179 -0
  10. package/dist/development/src/accessors/EntityAccessorImpl.cjs.map +1 -0
  11. package/dist/development/src/accessors/EntityAccessorImpl.js +179 -0
  12. package/dist/development/src/accessors/EntityAccessorImpl.js.map +1 -0
  13. package/dist/development/src/accessors/EntityListAccessorImpl.cjs +112 -0
  14. package/dist/development/src/accessors/EntityListAccessorImpl.cjs.map +1 -0
  15. package/dist/development/src/accessors/EntityListAccessorImpl.js +112 -0
  16. package/dist/development/src/accessors/EntityListAccessorImpl.js.map +1 -0
  17. package/dist/development/src/accessors/FieldAccessorImpl.cjs +54 -0
  18. package/dist/development/src/accessors/FieldAccessorImpl.cjs.map +1 -0
  19. package/dist/development/src/accessors/FieldAccessorImpl.js +54 -0
  20. package/dist/development/src/accessors/FieldAccessorImpl.js.map +1 -0
  21. package/dist/development/src/core/AccessorErrorManager.cjs +200 -0
  22. package/dist/development/src/core/AccessorErrorManager.cjs.map +1 -0
  23. package/dist/development/src/core/AccessorErrorManager.js +200 -0
  24. package/dist/development/src/core/AccessorErrorManager.js.map +1 -0
  25. package/dist/development/src/core/Config.cjs +29 -0
  26. package/dist/development/src/core/Config.cjs.map +1 -0
  27. package/dist/development/src/core/Config.js +29 -0
  28. package/dist/development/src/core/Config.js.map +1 -0
  29. package/dist/development/src/core/DataBinding.cjs +357 -0
  30. package/dist/development/src/core/DataBinding.cjs.map +1 -0
  31. package/dist/development/src/core/DataBinding.js +357 -0
  32. package/dist/development/src/core/DataBinding.js.map +1 -0
  33. package/dist/development/src/core/DirtinessTracker.cjs +26 -0
  34. package/dist/development/src/core/DirtinessTracker.cjs.map +1 -0
  35. package/dist/development/src/core/DirtinessTracker.js +26 -0
  36. package/dist/development/src/core/DirtinessTracker.js.map +1 -0
  37. package/dist/development/src/core/ErrorsPreprocessor.cjs +180 -0
  38. package/dist/development/src/core/ErrorsPreprocessor.cjs.map +1 -0
  39. package/dist/development/src/core/ErrorsPreprocessor.js +180 -0
  40. package/dist/development/src/core/ErrorsPreprocessor.js.map +1 -0
  41. package/dist/development/src/core/EventManager.cjs +439 -0
  42. package/dist/development/src/core/EventManager.cjs.map +1 -0
  43. package/dist/development/src/core/EventManager.js +439 -0
  44. package/dist/development/src/core/EventManager.js.map +1 -0
  45. package/dist/development/src/core/MutationGenerator.cjs +670 -0
  46. package/dist/development/src/core/MutationGenerator.cjs.map +1 -0
  47. package/dist/development/src/core/MutationGenerator.js +670 -0
  48. package/dist/development/src/core/MutationGenerator.js.map +1 -0
  49. package/dist/development/src/core/QueryGenerator.cjs +110 -0
  50. package/dist/development/src/core/QueryGenerator.cjs.map +1 -0
  51. package/dist/development/src/core/QueryGenerator.js +110 -0
  52. package/dist/development/src/core/QueryGenerator.js.map +1 -0
  53. package/dist/development/src/core/RealmKeyGenerator.cjs +42 -0
  54. package/dist/development/src/core/RealmKeyGenerator.cjs.map +1 -0
  55. package/dist/development/src/core/RealmKeyGenerator.js +42 -0
  56. package/dist/development/src/core/RealmKeyGenerator.js.map +1 -0
  57. package/dist/development/src/core/RequestResponseNormalizer.cjs +136 -0
  58. package/dist/development/src/core/RequestResponseNormalizer.cjs.map +1 -0
  59. package/dist/development/src/core/RequestResponseNormalizer.js +136 -0
  60. package/dist/development/src/core/RequestResponseNormalizer.js.map +1 -0
  61. package/dist/development/src/core/StateInitializer.cjs +379 -0
  62. package/dist/development/src/core/StateInitializer.cjs.map +1 -0
  63. package/dist/development/src/core/StateInitializer.js +379 -0
  64. package/dist/development/src/core/StateInitializer.js.map +1 -0
  65. package/dist/development/src/core/TreeAugmenter.cjs +351 -0
  66. package/dist/development/src/core/TreeAugmenter.cjs.map +1 -0
  67. package/dist/development/src/core/TreeAugmenter.js +351 -0
  68. package/dist/development/src/core/TreeAugmenter.js.map +1 -0
  69. package/dist/development/src/core/TreeStore.cjs +172 -0
  70. package/dist/development/src/core/TreeStore.cjs.map +1 -0
  71. package/dist/development/src/core/TreeStore.js +172 -0
  72. package/dist/development/src/core/TreeStore.js.map +1 -0
  73. package/dist/development/src/core/exceptions/ErrorLocator.cjs +59 -0
  74. package/dist/development/src/core/exceptions/ErrorLocator.cjs.map +1 -0
  75. package/dist/development/src/core/exceptions/ErrorLocator.js +59 -0
  76. package/dist/development/src/core/exceptions/ErrorLocator.js.map +1 -0
  77. package/dist/development/src/core/exceptions/MarkerSugarer.cjs +51 -0
  78. package/dist/development/src/core/exceptions/MarkerSugarer.cjs.map +1 -0
  79. package/dist/development/src/core/exceptions/MarkerSugarer.js +51 -0
  80. package/dist/development/src/core/exceptions/MarkerSugarer.js.map +1 -0
  81. package/dist/development/src/core/exceptions/TreeParameterSugarer.cjs +33 -0
  82. package/dist/development/src/core/exceptions/TreeParameterSugarer.cjs.map +1 -0
  83. package/dist/development/src/core/exceptions/TreeParameterSugarer.js +33 -0
  84. package/dist/development/src/core/exceptions/TreeParameterSugarer.js.map +1 -0
  85. package/dist/development/src/core/factories/createBatchUpdatesOptions.cjs +23 -0
  86. package/dist/development/src/core/factories/createBatchUpdatesOptions.cjs.map +1 -0
  87. package/dist/development/src/core/factories/createBatchUpdatesOptions.js +23 -0
  88. package/dist/development/src/core/factories/createBatchUpdatesOptions.js.map +1 -0
  89. package/dist/development/src/core/operations/EntityOperations.cjs +224 -0
  90. package/dist/development/src/core/operations/EntityOperations.cjs.map +1 -0
  91. package/dist/development/src/core/operations/EntityOperations.js +224 -0
  92. package/dist/development/src/core/operations/EntityOperations.js.map +1 -0
  93. package/dist/development/src/core/operations/FieldOperations.cjs +92 -0
  94. package/dist/development/src/core/operations/FieldOperations.cjs.map +1 -0
  95. package/dist/development/src/core/operations/FieldOperations.js +92 -0
  96. package/dist/development/src/core/operations/FieldOperations.js.map +1 -0
  97. package/dist/development/src/core/operations/ListOperations.cjs +158 -0
  98. package/dist/development/src/core/operations/ListOperations.cjs.map +1 -0
  99. package/dist/development/src/core/operations/ListOperations.js +158 -0
  100. package/dist/development/src/core/operations/ListOperations.js.map +1 -0
  101. package/dist/development/src/core/operations/OperationsHelpers.cjs +87 -0
  102. package/dist/development/src/core/operations/OperationsHelpers.cjs.map +1 -0
  103. package/dist/development/src/core/operations/OperationsHelpers.js +87 -0
  104. package/dist/development/src/core/operations/OperationsHelpers.js.map +1 -0
  105. package/dist/development/src/core/requestAliases/MutationAlias.cjs +14 -0
  106. package/dist/development/src/core/requestAliases/MutationAlias.cjs.map +1 -0
  107. package/dist/development/src/core/requestAliases/MutationAlias.js +14 -0
  108. package/dist/development/src/core/requestAliases/MutationAlias.js.map +1 -0
  109. package/dist/development/src/core/state/StateIterator.cjs +100 -0
  110. package/dist/development/src/core/state/StateIterator.cjs.map +1 -0
  111. package/dist/development/src/core/state/StateIterator.js +100 -0
  112. package/dist/development/src/core/state/StateIterator.js.map +1 -0
  113. package/dist/development/src/core/state/getEntityMarker.cjs +5 -0
  114. package/dist/development/src/core/state/getEntityMarker.cjs.map +1 -0
  115. package/dist/development/src/core/state/getEntityMarker.js +5 -0
  116. package/dist/development/src/core/state/getEntityMarker.js.map +1 -0
  117. package/dist/development/src/core/utils/getCombinedSignal.cjs +33 -0
  118. package/dist/development/src/core/utils/getCombinedSignal.cjs.map +1 -0
  119. package/dist/development/src/core/utils/getCombinedSignal.js +33 -0
  120. package/dist/development/src/core/utils/getCombinedSignal.js.map +1 -0
  121. package/dist/development/src/fieldHelpers/helpers/FieldHelper.cjs +13 -0
  122. package/dist/development/src/fieldHelpers/helpers/FieldHelper.cjs.map +1 -0
  123. package/dist/development/src/fieldHelpers/helpers/FieldHelper.js +13 -0
  124. package/dist/development/src/fieldHelpers/helpers/FieldHelper.js.map +1 -0
  125. package/dist/development/src/fieldHelpers/helpers/TemporalFieldHelper.cjs +18 -0
  126. package/dist/development/src/fieldHelpers/helpers/TemporalFieldHelper.cjs.map +1 -0
  127. package/dist/development/src/fieldHelpers/helpers/TemporalFieldHelper.js +18 -0
  128. package/dist/development/src/fieldHelpers/helpers/TemporalFieldHelper.js.map +1 -0
  129. package/dist/development/src/fieldHelpers/helpers/UuidFieldHelper.cjs +16 -0
  130. package/dist/development/src/fieldHelpers/helpers/UuidFieldHelper.cjs.map +1 -0
  131. package/dist/development/src/fieldHelpers/helpers/UuidFieldHelper.js +16 -0
  132. package/dist/development/src/fieldHelpers/helpers/UuidFieldHelper.js.map +1 -0
  133. package/dist/development/src/utils/generateEnumerabilityPreventingEntropy.cjs +7 -0
  134. package/dist/development/src/utils/generateEnumerabilityPreventingEntropy.cjs.map +1 -0
  135. package/dist/development/src/utils/generateEnumerabilityPreventingEntropy.js +7 -0
  136. package/dist/development/src/utils/generateEnumerabilityPreventingEntropy.js.map +1 -0
  137. package/dist/development/src/utils/isEmptyObject.cjs +12 -0
  138. package/dist/development/src/utils/isEmptyObject.cjs.map +1 -0
  139. package/dist/development/src/utils/isEmptyObject.js +12 -0
  140. package/dist/development/src/utils/isEmptyObject.js.map +1 -0
  141. package/dist/production/index.cjs +34 -0
  142. package/dist/production/index.cjs.map +1 -0
  143. package/dist/production/index.js +28 -0
  144. package/dist/production/index.js.map +1 -0
  145. package/dist/production/src/accessorTree/NormalizedPersistedData.cjs +10 -0
  146. package/dist/production/src/accessorTree/NormalizedPersistedData.cjs.map +1 -0
  147. package/dist/production/src/accessorTree/NormalizedPersistedData.js +10 -0
  148. package/dist/production/src/accessorTree/NormalizedPersistedData.js.map +1 -0
  149. package/dist/production/src/accessors/EntityAccessorImpl.cjs +179 -0
  150. package/dist/production/src/accessors/EntityAccessorImpl.cjs.map +1 -0
  151. package/dist/production/src/accessors/EntityAccessorImpl.js +179 -0
  152. package/dist/production/src/accessors/EntityAccessorImpl.js.map +1 -0
  153. package/dist/production/src/accessors/EntityListAccessorImpl.cjs +112 -0
  154. package/dist/production/src/accessors/EntityListAccessorImpl.cjs.map +1 -0
  155. package/dist/production/src/accessors/EntityListAccessorImpl.js +112 -0
  156. package/dist/production/src/accessors/EntityListAccessorImpl.js.map +1 -0
  157. package/dist/production/src/accessors/FieldAccessorImpl.cjs +54 -0
  158. package/dist/production/src/accessors/FieldAccessorImpl.cjs.map +1 -0
  159. package/dist/production/src/accessors/FieldAccessorImpl.js +54 -0
  160. package/dist/production/src/accessors/FieldAccessorImpl.js.map +1 -0
  161. package/dist/production/src/core/AccessorErrorManager.cjs +200 -0
  162. package/dist/production/src/core/AccessorErrorManager.cjs.map +1 -0
  163. package/dist/production/src/core/AccessorErrorManager.js +200 -0
  164. package/dist/production/src/core/AccessorErrorManager.js.map +1 -0
  165. package/dist/production/src/core/Config.cjs +29 -0
  166. package/dist/production/src/core/Config.cjs.map +1 -0
  167. package/dist/production/src/core/Config.js +29 -0
  168. package/dist/production/src/core/Config.js.map +1 -0
  169. package/dist/production/src/core/DataBinding.cjs +357 -0
  170. package/dist/production/src/core/DataBinding.cjs.map +1 -0
  171. package/dist/production/src/core/DataBinding.js +357 -0
  172. package/dist/production/src/core/DataBinding.js.map +1 -0
  173. package/dist/production/src/core/DirtinessTracker.cjs +26 -0
  174. package/dist/production/src/core/DirtinessTracker.cjs.map +1 -0
  175. package/dist/production/src/core/DirtinessTracker.js +26 -0
  176. package/dist/production/src/core/DirtinessTracker.js.map +1 -0
  177. package/dist/production/src/core/ErrorsPreprocessor.cjs +180 -0
  178. package/dist/production/src/core/ErrorsPreprocessor.cjs.map +1 -0
  179. package/dist/production/src/core/ErrorsPreprocessor.js +180 -0
  180. package/dist/production/src/core/ErrorsPreprocessor.js.map +1 -0
  181. package/dist/production/src/core/EventManager.cjs +413 -0
  182. package/dist/production/src/core/EventManager.cjs.map +1 -0
  183. package/dist/production/src/core/EventManager.js +413 -0
  184. package/dist/production/src/core/EventManager.js.map +1 -0
  185. package/dist/production/src/core/MutationGenerator.cjs +670 -0
  186. package/dist/production/src/core/MutationGenerator.cjs.map +1 -0
  187. package/dist/production/src/core/MutationGenerator.js +670 -0
  188. package/dist/production/src/core/MutationGenerator.js.map +1 -0
  189. package/dist/production/src/core/QueryGenerator.cjs +110 -0
  190. package/dist/production/src/core/QueryGenerator.cjs.map +1 -0
  191. package/dist/production/src/core/QueryGenerator.js +110 -0
  192. package/dist/production/src/core/QueryGenerator.js.map +1 -0
  193. package/dist/production/src/core/RealmKeyGenerator.cjs +42 -0
  194. package/dist/production/src/core/RealmKeyGenerator.cjs.map +1 -0
  195. package/dist/production/src/core/RealmKeyGenerator.js +42 -0
  196. package/dist/production/src/core/RealmKeyGenerator.js.map +1 -0
  197. package/dist/production/src/core/RequestResponseNormalizer.cjs +136 -0
  198. package/dist/production/src/core/RequestResponseNormalizer.cjs.map +1 -0
  199. package/dist/production/src/core/RequestResponseNormalizer.js +136 -0
  200. package/dist/production/src/core/RequestResponseNormalizer.js.map +1 -0
  201. package/dist/production/src/core/StateInitializer.cjs +379 -0
  202. package/dist/production/src/core/StateInitializer.cjs.map +1 -0
  203. package/dist/production/src/core/StateInitializer.js +379 -0
  204. package/dist/production/src/core/StateInitializer.js.map +1 -0
  205. package/dist/production/src/core/TreeAugmenter.cjs +351 -0
  206. package/dist/production/src/core/TreeAugmenter.cjs.map +1 -0
  207. package/dist/production/src/core/TreeAugmenter.js +351 -0
  208. package/dist/production/src/core/TreeAugmenter.js.map +1 -0
  209. package/dist/production/src/core/TreeStore.cjs +172 -0
  210. package/dist/production/src/core/TreeStore.cjs.map +1 -0
  211. package/dist/production/src/core/TreeStore.js +172 -0
  212. package/dist/production/src/core/TreeStore.js.map +1 -0
  213. package/dist/production/src/core/exceptions/ErrorLocator.cjs +59 -0
  214. package/dist/production/src/core/exceptions/ErrorLocator.cjs.map +1 -0
  215. package/dist/production/src/core/exceptions/ErrorLocator.js +59 -0
  216. package/dist/production/src/core/exceptions/ErrorLocator.js.map +1 -0
  217. package/dist/production/src/core/exceptions/MarkerSugarer.cjs +51 -0
  218. package/dist/production/src/core/exceptions/MarkerSugarer.cjs.map +1 -0
  219. package/dist/production/src/core/exceptions/MarkerSugarer.js +51 -0
  220. package/dist/production/src/core/exceptions/MarkerSugarer.js.map +1 -0
  221. package/dist/production/src/core/exceptions/TreeParameterSugarer.cjs +33 -0
  222. package/dist/production/src/core/exceptions/TreeParameterSugarer.cjs.map +1 -0
  223. package/dist/production/src/core/exceptions/TreeParameterSugarer.js +33 -0
  224. package/dist/production/src/core/exceptions/TreeParameterSugarer.js.map +1 -0
  225. package/dist/production/src/core/factories/createBatchUpdatesOptions.cjs +23 -0
  226. package/dist/production/src/core/factories/createBatchUpdatesOptions.cjs.map +1 -0
  227. package/dist/production/src/core/factories/createBatchUpdatesOptions.js +23 -0
  228. package/dist/production/src/core/factories/createBatchUpdatesOptions.js.map +1 -0
  229. package/dist/production/src/core/operations/EntityOperations.cjs +224 -0
  230. package/dist/production/src/core/operations/EntityOperations.cjs.map +1 -0
  231. package/dist/production/src/core/operations/EntityOperations.js +224 -0
  232. package/dist/production/src/core/operations/EntityOperations.js.map +1 -0
  233. package/dist/production/src/core/operations/FieldOperations.cjs +73 -0
  234. package/dist/production/src/core/operations/FieldOperations.cjs.map +1 -0
  235. package/dist/production/src/core/operations/FieldOperations.js +73 -0
  236. package/dist/production/src/core/operations/FieldOperations.js.map +1 -0
  237. package/dist/production/src/core/operations/ListOperations.cjs +158 -0
  238. package/dist/production/src/core/operations/ListOperations.cjs.map +1 -0
  239. package/dist/production/src/core/operations/ListOperations.js +158 -0
  240. package/dist/production/src/core/operations/ListOperations.js.map +1 -0
  241. package/dist/production/src/core/operations/OperationsHelpers.cjs +87 -0
  242. package/dist/production/src/core/operations/OperationsHelpers.cjs.map +1 -0
  243. package/dist/production/src/core/operations/OperationsHelpers.js +87 -0
  244. package/dist/production/src/core/operations/OperationsHelpers.js.map +1 -0
  245. package/dist/production/src/core/requestAliases/MutationAlias.cjs +14 -0
  246. package/dist/production/src/core/requestAliases/MutationAlias.cjs.map +1 -0
  247. package/dist/production/src/core/requestAliases/MutationAlias.js +14 -0
  248. package/dist/production/src/core/requestAliases/MutationAlias.js.map +1 -0
  249. package/dist/production/src/core/state/StateIterator.cjs +100 -0
  250. package/dist/production/src/core/state/StateIterator.cjs.map +1 -0
  251. package/dist/production/src/core/state/StateIterator.js +100 -0
  252. package/dist/production/src/core/state/StateIterator.js.map +1 -0
  253. package/dist/production/src/core/state/getEntityMarker.cjs +5 -0
  254. package/dist/production/src/core/state/getEntityMarker.cjs.map +1 -0
  255. package/dist/production/src/core/state/getEntityMarker.js +5 -0
  256. package/dist/production/src/core/state/getEntityMarker.js.map +1 -0
  257. package/dist/production/src/core/utils/getCombinedSignal.cjs +33 -0
  258. package/dist/production/src/core/utils/getCombinedSignal.cjs.map +1 -0
  259. package/dist/production/src/core/utils/getCombinedSignal.js +33 -0
  260. package/dist/production/src/core/utils/getCombinedSignal.js.map +1 -0
  261. package/dist/production/src/fieldHelpers/helpers/FieldHelper.cjs +13 -0
  262. package/dist/production/src/fieldHelpers/helpers/FieldHelper.cjs.map +1 -0
  263. package/dist/production/src/fieldHelpers/helpers/FieldHelper.js +13 -0
  264. package/dist/production/src/fieldHelpers/helpers/FieldHelper.js.map +1 -0
  265. package/dist/production/src/fieldHelpers/helpers/TemporalFieldHelper.cjs +18 -0
  266. package/dist/production/src/fieldHelpers/helpers/TemporalFieldHelper.cjs.map +1 -0
  267. package/dist/production/src/fieldHelpers/helpers/TemporalFieldHelper.js +18 -0
  268. package/dist/production/src/fieldHelpers/helpers/TemporalFieldHelper.js.map +1 -0
  269. package/dist/production/src/fieldHelpers/helpers/UuidFieldHelper.cjs +16 -0
  270. package/dist/production/src/fieldHelpers/helpers/UuidFieldHelper.cjs.map +1 -0
  271. package/dist/production/src/fieldHelpers/helpers/UuidFieldHelper.js +16 -0
  272. package/dist/production/src/fieldHelpers/helpers/UuidFieldHelper.js.map +1 -0
  273. package/dist/production/src/utils/generateEnumerabilityPreventingEntropy.cjs +7 -0
  274. package/dist/production/src/utils/generateEnumerabilityPreventingEntropy.cjs.map +1 -0
  275. package/dist/production/src/utils/generateEnumerabilityPreventingEntropy.js +7 -0
  276. package/dist/production/src/utils/generateEnumerabilityPreventingEntropy.js.map +1 -0
  277. package/dist/production/src/utils/isEmptyObject.cjs +12 -0
  278. package/dist/production/src/utils/isEmptyObject.cjs.map +1 -0
  279. package/dist/production/src/utils/isEmptyObject.js +12 -0
  280. package/dist/production/src/utils/isEmptyObject.js.map +1 -0
  281. package/dist/types/accessorTree/NormalizedPersistedData.d.ts +18 -0
  282. package/dist/types/accessorTree/NormalizedPersistedData.d.ts.map +1 -0
  283. package/dist/types/accessorTree/index.d.ts +2 -0
  284. package/dist/types/accessorTree/index.d.ts.map +1 -0
  285. package/dist/types/accessors/BindingConfig.d.ts +6 -0
  286. package/dist/types/accessors/BindingConfig.d.ts.map +1 -0
  287. package/dist/types/accessors/EntityAccessorImpl.d.ts +56 -0
  288. package/dist/types/accessors/EntityAccessorImpl.d.ts.map +1 -0
  289. package/dist/types/accessors/EntityListAccessorImpl.d.ts +57 -0
  290. package/dist/types/accessors/EntityListAccessorImpl.d.ts.map +1 -0
  291. package/dist/types/accessors/FieldAccessorImpl.d.ts +32 -0
  292. package/dist/types/accessors/FieldAccessorImpl.d.ts.map +1 -0
  293. package/dist/types/accessors/index.d.ts +5 -0
  294. package/dist/types/accessors/index.d.ts.map +1 -0
  295. package/dist/types/core/AccessorErrorManager.d.ts +25 -0
  296. package/dist/types/core/AccessorErrorManager.d.ts.map +1 -0
  297. package/dist/types/core/Config.d.ts +9 -0
  298. package/dist/types/core/Config.d.ts.map +1 -0
  299. package/dist/types/core/DataBinding.d.ts +54 -0
  300. package/dist/types/core/DataBinding.d.ts.map +1 -0
  301. package/dist/types/core/DirtinessTracker.d.ts +9 -0
  302. package/dist/types/core/DirtinessTracker.d.ts.map +1 -0
  303. package/dist/types/core/ErrorsPreprocessor.d.ts +34 -0
  304. package/dist/types/core/ErrorsPreprocessor.d.ts.map +1 -0
  305. package/dist/types/core/EventManager.d.ts +57 -0
  306. package/dist/types/core/EventManager.d.ts.map +1 -0
  307. package/dist/types/core/MutationGenerator.d.ts +49 -0
  308. package/dist/types/core/MutationGenerator.d.ts.map +1 -0
  309. package/dist/types/core/QueryGenerator.d.ts +13 -0
  310. package/dist/types/core/QueryGenerator.d.ts.map +1 -0
  311. package/dist/types/core/RealmKeyGenerator.d.ts +10 -0
  312. package/dist/types/core/RealmKeyGenerator.d.ts.map +1 -0
  313. package/dist/types/core/RequestResponseNormalizer.d.ts +11 -0
  314. package/dist/types/core/RequestResponseNormalizer.d.ts.map +1 -0
  315. package/dist/types/core/StateInitializer.d.ts +34 -0
  316. package/dist/types/core/StateInitializer.d.ts.map +1 -0
  317. package/dist/types/core/TreeAugmenter.d.ts +25 -0
  318. package/dist/types/core/TreeAugmenter.d.ts.map +1 -0
  319. package/dist/types/core/TreeStore.d.ts +30 -0
  320. package/dist/types/core/TreeStore.d.ts.map +1 -0
  321. package/dist/types/core/UpdateMetadata.d.ts +4 -0
  322. package/dist/types/core/UpdateMetadata.d.ts.map +1 -0
  323. package/dist/types/core/exceptions/ErrorLocator.d.ts +8 -0
  324. package/dist/types/core/exceptions/ErrorLocator.d.ts.map +1 -0
  325. package/dist/types/core/exceptions/MarkerSugarer.d.ts +10 -0
  326. package/dist/types/core/exceptions/MarkerSugarer.d.ts.map +1 -0
  327. package/dist/types/core/exceptions/TreeParameterSugarer.d.ts +11 -0
  328. package/dist/types/core/exceptions/TreeParameterSugarer.d.ts.map +1 -0
  329. package/dist/types/core/factories/createBatchUpdatesOptions.d.ts +5 -0
  330. package/dist/types/core/factories/createBatchUpdatesOptions.d.ts.map +1 -0
  331. package/dist/types/core/factories/index.d.ts +2 -0
  332. package/dist/types/core/factories/index.d.ts.map +1 -0
  333. package/dist/types/core/index.d.ts +9 -0
  334. package/dist/types/core/index.d.ts.map +1 -0
  335. package/dist/types/core/operations/EntityOperations.d.ts +26 -0
  336. package/dist/types/core/operations/EntityOperations.d.ts.map +1 -0
  337. package/dist/types/core/operations/FieldOperations.d.ts +22 -0
  338. package/dist/types/core/operations/FieldOperations.d.ts.map +1 -0
  339. package/dist/types/core/operations/ListOperations.d.ts +32 -0
  340. package/dist/types/core/operations/ListOperations.d.ts.map +1 -0
  341. package/dist/types/core/operations/OperationsHelpers.d.ts +14 -0
  342. package/dist/types/core/operations/OperationsHelpers.d.ts.map +1 -0
  343. package/dist/types/core/operations/index.d.ts +4 -0
  344. package/dist/types/core/operations/index.d.ts.map +1 -0
  345. package/dist/types/core/requestAliases/MutationAlias.d.ts +6 -0
  346. package/dist/types/core/requestAliases/MutationAlias.d.ts.map +1 -0
  347. package/dist/types/core/requestAliases/index.d.ts +2 -0
  348. package/dist/types/core/requestAliases/index.d.ts.map +1 -0
  349. package/dist/types/core/state/EntityListState.d.ts +29 -0
  350. package/dist/types/core/state/EntityListState.d.ts.map +1 -0
  351. package/dist/types/core/state/EntityRealmState.d.ts +44 -0
  352. package/dist/types/core/state/EntityRealmState.d.ts.map +1 -0
  353. package/dist/types/core/state/EntityState.d.ts +11 -0
  354. package/dist/types/core/state/EntityState.d.ts.map +1 -0
  355. package/dist/types/core/state/FieldState.d.ts +19 -0
  356. package/dist/types/core/state/FieldState.d.ts.map +1 -0
  357. package/dist/types/core/state/StateIterator.d.ts +14 -0
  358. package/dist/types/core/state/StateIterator.d.ts.map +1 -0
  359. package/dist/types/core/state/StateNode.d.ts +8 -0
  360. package/dist/types/core/state/StateNode.d.ts.map +1 -0
  361. package/dist/types/core/state/getEntityMarker.d.ts +3 -0
  362. package/dist/types/core/state/getEntityMarker.d.ts.map +1 -0
  363. package/dist/types/core/state/index.d.ts +8 -0
  364. package/dist/types/core/state/index.d.ts.map +1 -0
  365. package/dist/types/core/utils/getCombinedSignal.d.ts +2 -0
  366. package/dist/types/core/utils/getCombinedSignal.d.ts.map +1 -0
  367. package/dist/types/core/utils/index.d.ts +2 -0
  368. package/dist/types/core/utils/index.d.ts.map +1 -0
  369. package/dist/types/fieldHelpers/helpers/FieldHelper.d.ts +7 -0
  370. package/dist/types/fieldHelpers/helpers/FieldHelper.d.ts.map +1 -0
  371. package/dist/types/fieldHelpers/helpers/TemporalFieldHelper.d.ts +10 -0
  372. package/dist/types/fieldHelpers/helpers/TemporalFieldHelper.d.ts.map +1 -0
  373. package/dist/types/fieldHelpers/helpers/UuidFieldHelper.d.ts +10 -0
  374. package/dist/types/fieldHelpers/helpers/UuidFieldHelper.d.ts.map +1 -0
  375. package/dist/types/fieldHelpers/helpers/index.d.ts +3 -0
  376. package/dist/types/fieldHelpers/helpers/index.d.ts.map +1 -0
  377. package/dist/types/fieldHelpers/index.d.ts +2 -0
  378. package/dist/types/fieldHelpers/index.d.ts.map +1 -0
  379. package/dist/types/index.d.ts +5 -0
  380. package/dist/types/index.d.ts.map +1 -0
  381. package/dist/types/tsconfig.tsbuildinfo +1 -0
  382. package/dist/types/utils/assertNever.d.ts +2 -0
  383. package/dist/types/utils/assertNever.d.ts.map +1 -0
  384. package/dist/types/utils/generateEnumerabilityPreventingEntropy.d.ts +2 -0
  385. package/dist/types/utils/generateEnumerabilityPreventingEntropy.d.ts.map +1 -0
  386. package/dist/types/utils/index.d.ts +4 -0
  387. package/dist/types/utils/index.d.ts.map +1 -0
  388. package/dist/types/utils/isEmptyObject.d.ts +2 -0
  389. package/dist/types/utils/isEmptyObject.d.ts.map +1 -0
  390. package/package.json +5 -5
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const bindingCommon = require("@contember/binding-common");
4
+ var __defProp = Object.defineProperty;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
7
+ class EntityListAccessorImpl {
8
+ constructor(state, operations, name, _children, _idsPersistedOnServer, hasUnpersistedChanges, errors, environment, getAccessor) {
9
+ this.state = state;
10
+ this.operations = operations;
11
+ this.name = name;
12
+ this._children = _children;
13
+ this._idsPersistedOnServer = _idsPersistedOnServer;
14
+ this.hasUnpersistedChanges = hasUnpersistedChanges;
15
+ this.errors = errors;
16
+ this.environment = environment;
17
+ this.getAccessor = getAccessor;
18
+ __publicField(this, "__type", "EntityListAccessor");
19
+ }
20
+ /**
21
+ * Returns all entity keys that are on the list.
22
+ * **KEYS ARE NOT IDS!**
23
+ * @see EntityAccessor.key
24
+ */
25
+ *keys() {
26
+ for (const accessor of this) {
27
+ yield accessor.key;
28
+ }
29
+ }
30
+ *ids() {
31
+ yield* this._children.keys();
32
+ }
33
+ /**
34
+ * This will only contain the ids that the server knows about. Not necessarily the ids that have been added on
35
+ * the list since the last server query.
36
+ */
37
+ get idsPersistedOnServer() {
38
+ return new Set(this._idsPersistedOnServer);
39
+ }
40
+ *[Symbol.iterator]() {
41
+ for (const { getAccessor } of this._children.values()) {
42
+ yield getAccessor();
43
+ }
44
+ }
45
+ hasEntityId(id) {
46
+ return this._children.has(id);
47
+ }
48
+ isEmpty() {
49
+ return this.length === 0;
50
+ }
51
+ get length() {
52
+ return this._children.size;
53
+ }
54
+ hasEntityOnServer(entityOrItsId) {
55
+ if (typeof entityOrItsId === "string" || typeof entityOrItsId === "number") {
56
+ return this.idsPersistedOnServer.has(entityOrItsId);
57
+ }
58
+ const idOnServer = entityOrItsId.idOnServer;
59
+ if (idOnServer === void 0) {
60
+ return false;
61
+ }
62
+ return this.idsPersistedOnServer.has(idOnServer);
63
+ }
64
+ deleteAll() {
65
+ this.batchUpdates((getAccessor) => {
66
+ const list = getAccessor();
67
+ for (const entity of list) {
68
+ entity.deleteEntity();
69
+ }
70
+ });
71
+ }
72
+ disconnectAll() {
73
+ this.batchUpdates((getAccessor) => {
74
+ const list = getAccessor();
75
+ for (const entity of list) {
76
+ list.disconnectEntity(entity);
77
+ }
78
+ });
79
+ }
80
+ addError(error) {
81
+ return this.operations.addError(this.state, bindingCommon.ErrorAccessor.normalizeError(error));
82
+ }
83
+ addEventListener(event, listener) {
84
+ return this.operations.addEventListener(this.state, event, listener);
85
+ }
86
+ addChildEventListener(event, listener) {
87
+ return this.operations.addChildEventListener(this.state, event, listener);
88
+ }
89
+ batchUpdates(performUpdates) {
90
+ this.operations.batchUpdates(this.state, performUpdates);
91
+ }
92
+ connectEntity(entityToConnect) {
93
+ this.operations.connectEntity(this.state, entityToConnect);
94
+ }
95
+ createNewEntity(initialize) {
96
+ return this.operations.createNewEntity(this.state, initialize);
97
+ }
98
+ disconnectEntity(childEntity, options = {}) {
99
+ this.operations.disconnectEntity(this.state, childEntity, options);
100
+ }
101
+ getChildEntityById(id) {
102
+ return this.operations.getChildEntityById(this.state, id);
103
+ }
104
+ getParent() {
105
+ return this.state.blueprint.parent?.getAccessor();
106
+ }
107
+ getMarker() {
108
+ return this.state.blueprint.marker;
109
+ }
110
+ }
111
+ exports.EntityListAccessorImpl = EntityListAccessorImpl;
112
+ //# sourceMappingURL=EntityListAccessorImpl.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityListAccessorImpl.cjs","sources":["../../../../../packages/binding-legacy/src/accessors/EntityListAccessorImpl.ts"],"sourcesContent":["import type { EntityListState } from '../core/state'\nimport type { ListOperations } from '../core/operations'\nimport {\n\tEntityAccessor,\n\tEntityId,\n\tEntityListSubTreeMarker,\n\tEntityName,\n\tEntityRealmKey,\n\tEnvironment,\n\tErrorAccessor,\n\tHasManyRelationMarker,\n\tRuntimeId,\n} from '@contember/binding-common'\nimport { EntityListAccessor } from '@contember/binding-common'\n\nexport class EntityListAccessorImpl implements EntityListAccessor {\n\tpublic readonly __type = 'EntityListAccessor' as const\n\n\tpublic constructor(\n\t\tprivate readonly state: EntityListState,\n\t\tprivate readonly operations: ListOperations,\n\t\tpublic readonly name: EntityName,\n\t\tprivate readonly _children: ReadonlyMap<EntityId, { getAccessor: EntityAccessor.GetEntityAccessor }>,\n\t\tprivate readonly _idsPersistedOnServer: ReadonlySet<EntityId>,\n\t\tpublic readonly hasUnpersistedChanges: boolean,\n\t\tpublic readonly errors: ErrorAccessor | undefined,\n\t\tpublic readonly environment: Environment,\n\t\tpublic readonly getAccessor: EntityListAccessor.GetEntityListAccessor,\n\t) {\n\t}\n\n\t/**\n\t * Returns all entity keys that are on the list.\n\t * **KEYS ARE NOT IDS!**\n\t * @see EntityAccessor.key\n\t */\n\tpublic *keys(): IterableIterator<EntityRealmKey> {\n\t\tfor (const accessor of this) {\n\t\t\tyield accessor.key!\n\t\t}\n\t}\n\n\tpublic *ids(): IterableIterator<EntityId> {\n\t\tyield* this._children.keys()\n\t}\n\n\t/**\n\t * This will only contain the ids that the server knows about. Not necessarily the ids that have been added on\n\t * the list since the last server query.\n\t */\n\tpublic get idsPersistedOnServer(): Set<EntityId> {\n\t\treturn new Set(this._idsPersistedOnServer)\n\t}\n\n\tpublic *[Symbol.iterator](): IterableIterator<EntityAccessor> {\n\t\tfor (const { getAccessor } of this._children.values()) {\n\t\t\tyield getAccessor()\n\t\t}\n\t}\n\n\tpublic hasEntityId(id: EntityId): boolean {\n\t\treturn this._children.has(id)\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn this.length === 0\n\t}\n\n\tpublic get length(): number {\n\t\treturn this._children.size\n\t}\n\n\tpublic hasEntityOnServer(entityOrItsId: EntityAccessor | EntityId): boolean {\n\t\tif (typeof entityOrItsId === 'string' || typeof entityOrItsId === 'number') {\n\t\t\treturn this.idsPersistedOnServer.has(entityOrItsId)\n\t\t}\n\t\tconst idOnServer = entityOrItsId.idOnServer\n\t\tif (idOnServer === undefined) {\n\t\t\treturn false\n\t\t}\n\t\treturn this.idsPersistedOnServer.has(idOnServer)\n\t}\n\n\tpublic deleteAll(): void {\n\t\tthis.batchUpdates(getAccessor => {\n\t\t\tconst list = getAccessor()\n\t\t\tfor (const entity of list) {\n\t\t\t\tentity.deleteEntity()\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic disconnectAll(): void {\n\t\tthis.batchUpdates(getAccessor => {\n\t\t\tconst list = getAccessor()\n\t\t\tfor (const entity of list) {\n\t\t\t\tlist.disconnectEntity(entity)\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic addError(error: ErrorAccessor.Error | string): () => void {\n\t\treturn this.operations.addError(this.state, ErrorAccessor.normalizeError(error))\n\t}\n\n\tpublic addEventListener<Type extends keyof EntityListAccessor.RuntimeEntityListEventListenerMap>(\n\t\tevent: { type: Type; key?: string },\n\t\tlistener: EntityListAccessor.EntityListEventListenerMap[Type],\n\t) {\n\t\treturn this.operations.addEventListener(this.state, event, listener)\n\t}\n\n\tpublic addChildEventListener<Type extends keyof EntityAccessor.EntityEventListenerMap>(\n\t\tevent: { type: Type; key?: string },\n\t\tlistener: EntityAccessor.EntityEventListenerMap[Type],\n\t) {\n\t\treturn this.operations.addChildEventListener(this.state, event, listener)\n\t}\n\n\tpublic batchUpdates(performUpdates: EntityListAccessor.BatchUpdatesHandler): void {\n\t\tthis.operations.batchUpdates(this.state, performUpdates)\n\t}\n\n\tpublic connectEntity(entityToConnect: EntityAccessor): void {\n\t\tthis.operations.connectEntity(this.state, entityToConnect)\n\t}\n\n\tpublic createNewEntity(initialize?: EntityAccessor.BatchUpdatesHandler): RuntimeId {\n\t\treturn this.operations.createNewEntity(this.state, initialize)\n\t}\n\n\tpublic disconnectEntity(childEntity: EntityAccessor, options: { noPersist?: boolean } = {}): void {\n\t\tthis.operations.disconnectEntity(this.state, childEntity, options)\n\t}\n\n\tpublic getChildEntityById(id: EntityId): EntityAccessor {\n\t\treturn this.operations.getChildEntityById(this.state, id)\n\t}\n\n\tpublic getParent(): EntityAccessor | undefined {\n\t\treturn this.state.blueprint.parent?.getAccessor()\n\t}\n\n\tpublic getMarker(): EntityListSubTreeMarker | HasManyRelationMarker {\n\t\treturn this.state.blueprint.marker\n\t}\n}\n"],"names":["ErrorAccessor"],"mappings":";;;;;;AAeO,MAAM,uBAAqD;AAAA,EAG1D,YACW,OACA,YACD,MACC,WACA,uBACD,uBACA,QACA,aACA,aACf;AATgB,SAAA,QAAA;AACA,SAAA,aAAA;AACD,SAAA,OAAA;AACC,SAAA,YAAA;AACA,SAAA,wBAAA;AACD,SAAA,wBAAA;AACA,SAAA,SAAA;AACA,SAAA,cAAA;AACA,SAAA,cAAA;AAXjB,kBAAA,MAAgB,UAAS,oBAAA;AAAA,EAazB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,CAAQ,OAAyC;AAChD,eAAW,YAAY,MAAM;AAC5B,YAAM,SAAS;AAAA,IAChB;AAAA,EACD;AAAA,EAEA,CAAQ,MAAkC;AACzC,WAAO,KAAK,UAAU,KAAA;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAW,uBAAsC;AAChD,WAAO,IAAI,IAAI,KAAK,qBAAqB;AAAA,EAC1C;AAAA,EAEA,EAAS,OAAO,QAAQ,IAAsC;AAC7D,eAAW,EAAE,YAAA,KAAiB,KAAK,UAAU,UAAU;AACtD,YAAM,YAAA;AAAA,IACP;AAAA,EACD;AAAA,EAEO,YAAY,IAAuB;AACzC,WAAO,KAAK,UAAU,IAAI,EAAE;AAAA,EAC7B;AAAA,EAEO,UAAmB;AACzB,WAAO,KAAK,WAAW;AAAA,EACxB;AAAA,EAEA,IAAW,SAAiB;AAC3B,WAAO,KAAK,UAAU;AAAA,EACvB;AAAA,EAEO,kBAAkB,eAAmD;AAC3E,QAAI,OAAO,kBAAkB,YAAY,OAAO,kBAAkB,UAAU;AAC3E,aAAO,KAAK,qBAAqB,IAAI,aAAa;AAAA,IACnD;AACA,UAAM,aAAa,cAAc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Q,YAAA;AAAA,EACrC;AAAA,EAEO,YAA6D;AACnE,WAAO,KAAK,MAAM,UAAU;AAAA,EAC7B;AACD;;"}
@@ -0,0 +1,112 @@
1
+ import { ErrorAccessor } from "@contember/binding-common";
2
+ var __defProp = Object.defineProperty;
3
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
+ var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
5
+ class EntityListAccessorImpl {
6
+ constructor(state, operations, name, _children, _idsPersistedOnServer, hasUnpersistedChanges, errors, environment, getAccessor) {
7
+ this.state = state;
8
+ this.operations = operations;
9
+ this.name = name;
10
+ this._children = _children;
11
+ this._idsPersistedOnServer = _idsPersistedOnServer;
12
+ this.hasUnpersistedChanges = hasUnpersistedChanges;
13
+ this.errors = errors;
14
+ this.environment = environment;
15
+ this.getAccessor = getAccessor;
16
+ __publicField(this, "__type", "EntityListAccessor");
17
+ }
18
+ /**
19
+ * Returns all entity keys that are on the list.
20
+ * **KEYS ARE NOT IDS!**
21
+ * @see EntityAccessor.key
22
+ */
23
+ *keys() {
24
+ for (const accessor of this) {
25
+ yield accessor.key;
26
+ }
27
+ }
28
+ *ids() {
29
+ yield* this._children.keys();
30
+ }
31
+ /**
32
+ * This will only contain the ids that the server knows about. Not necessarily the ids that have been added on
33
+ * the list since the last server query.
34
+ */
35
+ get idsPersistedOnServer() {
36
+ return new Set(this._idsPersistedOnServer);
37
+ }
38
+ *[Symbol.iterator]() {
39
+ for (const { getAccessor } of this._children.values()) {
40
+ yield getAccessor();
41
+ }
42
+ }
43
+ hasEntityId(id) {
44
+ return this._children.has(id);
45
+ }
46
+ isEmpty() {
47
+ return this.length === 0;
48
+ }
49
+ get length() {
50
+ return this._children.size;
51
+ }
52
+ hasEntityOnServer(entityOrItsId) {
53
+ if (typeof entityOrItsId === "string" || typeof entityOrItsId === "number") {
54
+ return this.idsPersistedOnServer.has(entityOrItsId);
55
+ }
56
+ const idOnServer = entityOrItsId.idOnServer;
57
+ if (idOnServer === void 0) {
58
+ return false;
59
+ }
60
+ return this.idsPersistedOnServer.has(idOnServer);
61
+ }
62
+ deleteAll() {
63
+ this.batchUpdates((getAccessor) => {
64
+ const list = getAccessor();
65
+ for (const entity of list) {
66
+ entity.deleteEntity();
67
+ }
68
+ });
69
+ }
70
+ disconnectAll() {
71
+ this.batchUpdates((getAccessor) => {
72
+ const list = getAccessor();
73
+ for (const entity of list) {
74
+ list.disconnectEntity(entity);
75
+ }
76
+ });
77
+ }
78
+ addError(error) {
79
+ return this.operations.addError(this.state, ErrorAccessor.normalizeError(error));
80
+ }
81
+ addEventListener(event, listener) {
82
+ return this.operations.addEventListener(this.state, event, listener);
83
+ }
84
+ addChildEventListener(event, listener) {
85
+ return this.operations.addChildEventListener(this.state, event, listener);
86
+ }
87
+ batchUpdates(performUpdates) {
88
+ this.operations.batchUpdates(this.state, performUpdates);
89
+ }
90
+ connectEntity(entityToConnect) {
91
+ this.operations.connectEntity(this.state, entityToConnect);
92
+ }
93
+ createNewEntity(initialize) {
94
+ return this.operations.createNewEntity(this.state, initialize);
95
+ }
96
+ disconnectEntity(childEntity, options = {}) {
97
+ this.operations.disconnectEntity(this.state, childEntity, options);
98
+ }
99
+ getChildEntityById(id) {
100
+ return this.operations.getChildEntityById(this.state, id);
101
+ }
102
+ getParent() {
103
+ return this.state.blueprint.parent?.getAccessor();
104
+ }
105
+ getMarker() {
106
+ return this.state.blueprint.marker;
107
+ }
108
+ }
109
+ export {
110
+ EntityListAccessorImpl
111
+ };
112
+ //# sourceMappingURL=EntityListAccessorImpl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityListAccessorImpl.js","sources":["../../../../../packages/binding-legacy/src/accessors/EntityListAccessorImpl.ts"],"sourcesContent":["import type { EntityListState } from '../core/state'\nimport type { ListOperations } from '../core/operations'\nimport {\n\tEntityAccessor,\n\tEntityId,\n\tEntityListSubTreeMarker,\n\tEntityName,\n\tEntityRealmKey,\n\tEnvironment,\n\tErrorAccessor,\n\tHasManyRelationMarker,\n\tRuntimeId,\n} from '@contember/binding-common'\nimport { EntityListAccessor } from '@contember/binding-common'\n\nexport class EntityListAccessorImpl implements EntityListAccessor {\n\tpublic readonly __type = 'EntityListAccessor' as const\n\n\tpublic constructor(\n\t\tprivate readonly state: EntityListState,\n\t\tprivate readonly operations: ListOperations,\n\t\tpublic readonly name: EntityName,\n\t\tprivate readonly _children: ReadonlyMap<EntityId, { getAccessor: EntityAccessor.GetEntityAccessor }>,\n\t\tprivate readonly _idsPersistedOnServer: ReadonlySet<EntityId>,\n\t\tpublic readonly hasUnpersistedChanges: boolean,\n\t\tpublic readonly errors: ErrorAccessor | undefined,\n\t\tpublic readonly environment: Environment,\n\t\tpublic readonly getAccessor: EntityListAccessor.GetEntityListAccessor,\n\t) {\n\t}\n\n\t/**\n\t * Returns all entity keys that are on the list.\n\t * **KEYS ARE NOT IDS!**\n\t * @see EntityAccessor.key\n\t */\n\tpublic *keys(): IterableIterator<EntityRealmKey> {\n\t\tfor (const accessor of this) {\n\t\t\tyield accessor.key!\n\t\t}\n\t}\n\n\tpublic *ids(): IterableIterator<EntityId> {\n\t\tyield* this._children.keys()\n\t}\n\n\t/**\n\t * This will only contain the ids that the server knows about. Not necessarily the ids that have been added on\n\t * the list since the last server query.\n\t */\n\tpublic get idsPersistedOnServer(): Set<EntityId> {\n\t\treturn new Set(this._idsPersistedOnServer)\n\t}\n\n\tpublic *[Symbol.iterator](): IterableIterator<EntityAccessor> {\n\t\tfor (const { getAccessor } of this._children.values()) {\n\t\t\tyield getAccessor()\n\t\t}\n\t}\n\n\tpublic hasEntityId(id: EntityId): boolean {\n\t\treturn this._children.has(id)\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn this.length === 0\n\t}\n\n\tpublic get length(): number {\n\t\treturn this._children.size\n\t}\n\n\tpublic hasEntityOnServer(entityOrItsId: EntityAccessor | EntityId): boolean {\n\t\tif (typeof entityOrItsId === 'string' || typeof entityOrItsId === 'number') {\n\t\t\treturn this.idsPersistedOnServer.has(entityOrItsId)\n\t\t}\n\t\tconst idOnServer = entityOrItsId.idOnServer\n\t\tif (idOnServer === undefined) {\n\t\t\treturn false\n\t\t}\n\t\treturn this.idsPersistedOnServer.has(idOnServer)\n\t}\n\n\tpublic deleteAll(): void {\n\t\tthis.batchUpdates(getAccessor => {\n\t\t\tconst list = getAccessor()\n\t\t\tfor (const entity of list) {\n\t\t\t\tentity.deleteEntity()\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic disconnectAll(): void {\n\t\tthis.batchUpdates(getAccessor => {\n\t\t\tconst list = getAccessor()\n\t\t\tfor (const entity of list) {\n\t\t\t\tlist.disconnectEntity(entity)\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic addError(error: ErrorAccessor.Error | string): () => void {\n\t\treturn this.operations.addError(this.state, ErrorAccessor.normalizeError(error))\n\t}\n\n\tpublic addEventListener<Type extends keyof EntityListAccessor.RuntimeEntityListEventListenerMap>(\n\t\tevent: { type: Type; key?: string },\n\t\tlistener: EntityListAccessor.EntityListEventListenerMap[Type],\n\t) {\n\t\treturn this.operations.addEventListener(this.state, event, listener)\n\t}\n\n\tpublic addChildEventListener<Type extends keyof EntityAccessor.EntityEventListenerMap>(\n\t\tevent: { type: Type; key?: string },\n\t\tlistener: EntityAccessor.EntityEventListenerMap[Type],\n\t) {\n\t\treturn this.operations.addChildEventListener(this.state, event, listener)\n\t}\n\n\tpublic batchUpdates(performUpdates: EntityListAccessor.BatchUpdatesHandler): void {\n\t\tthis.operations.batchUpdates(this.state, performUpdates)\n\t}\n\n\tpublic connectEntity(entityToConnect: EntityAccessor): void {\n\t\tthis.operations.connectEntity(this.state, entityToConnect)\n\t}\n\n\tpublic createNewEntity(initialize?: EntityAccessor.BatchUpdatesHandler): RuntimeId {\n\t\treturn this.operations.createNewEntity(this.state, initialize)\n\t}\n\n\tpublic disconnectEntity(childEntity: EntityAccessor, options: { noPersist?: boolean } = {}): void {\n\t\tthis.operations.disconnectEntity(this.state, childEntity, options)\n\t}\n\n\tpublic getChildEntityById(id: EntityId): EntityAccessor {\n\t\treturn this.operations.getChildEntityById(this.state, id)\n\t}\n\n\tpublic getParent(): EntityAccessor | undefined {\n\t\treturn this.state.blueprint.parent?.getAccessor()\n\t}\n\n\tpublic getMarker(): EntityListSubTreeMarker | HasManyRelationMarker {\n\t\treturn this.state.blueprint.marker\n\t}\n}\n"],"names":[],"mappings":";;;;AAeO,MAAM,uBAAqD;AAAA,EAG1D,YACW,OACA,YACD,MACC,WACA,uBACD,uBACA,QACA,aACA,aACf;AATgB,SAAA,QAAA;AACA,SAAA,aAAA;AACD,SAAA,OAAA;AACC,SAAA,YAAA;AACA,SAAA,wBAAA;AACD,SAAA,wBAAA;AACA,SAAA,SAAA;AACA,SAAA,cAAA;AACA,SAAA,cAAA;AAXjB,kBAAA,MAAgB,UAAS,oBAAA;AAAA,EAazB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,CAAQ,OAAyC;AAChD,eAAW,YAAY,MAAM;AAC5B,YAAM,SAAS;AAAA,IAChB;AAAA,EACD;AAAA,EAEA,CAAQ,MAAkC;AACzC,WAAO,KAAK,UAAU,KAAA;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAW,uBAAsC;AAChD,WAAO,IAAI,IAAI,KAAK,qBAAqB;AAAA,EAC1C;AAAA,EAEA,EAAS,OAAO,QAAQ,IAAsC;AAC7D,eAAW,EAAE,YAAA,KAAiB,KAAK,UAAU,UAAU;AACtD,YAAM,YAAA;AAAA,IACP;AAAA,EACD;AAAA,EAEO,YAAY,IAAuB;AACzC,WAAO,KAAK,UAAU,IAAI,EAAE;AAAA,EAC7B;AAAA,EAEO,UAAmB;AACzB,WAAO,KAAK,WAAW;AAAA,EACxB;AAAA,EAEA,IAAW,SAAiB;AAC3B,WAAO,KAAK,UAAU;AAAA,EACvB;AAAA,EAEO,kBAAkB,eAAmD;AAC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ACvD,WAAO,KAAK,WAAW,mBAAmB,KAAK,OAAO,EAAE;AAAA,EACzD;AAAA,EAEO,YAAwC;AAC9C,WAAO,KAAK,MAAM,UAAU,QAAQ,YAAA;AAAA,EACrC;AAAA,EAEO,YAA6D;AACnE,WAAO,KAAK,MAAM,UAAU;AAAA,EAC7B;AACD;"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const bindingCommon = require("@contember/binding-common");
4
+ const TemporalFieldHelper = require("../fieldHelpers/helpers/TemporalFieldHelper.cjs");
5
+ const UuidFieldHelper = require("../fieldHelpers/helpers/UuidFieldHelper.cjs");
6
+ var __defProp = Object.defineProperty;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
9
+ class FieldAccessorImpl {
10
+ constructor(state, operations, fieldName, value, valueOnServer, defaultValue, errors, hasUnpersistedChanges, touchLog, getAccessor, schema) {
11
+ this.state = state;
12
+ this.operations = operations;
13
+ this.fieldName = fieldName;
14
+ this.value = value;
15
+ this.valueOnServer = valueOnServer;
16
+ this.defaultValue = defaultValue;
17
+ this.errors = errors;
18
+ this.hasUnpersistedChanges = hasUnpersistedChanges;
19
+ this.touchLog = touchLog;
20
+ this.getAccessor = getAccessor;
21
+ this.schema = schema;
22
+ __publicField(this, "__type", "FieldAccessor");
23
+ }
24
+ addError(error) {
25
+ return this.operations.addError(this.state, bindingCommon.ErrorAccessor.normalizeError(error));
26
+ }
27
+ clearErrors() {
28
+ this.operations.clearErrors(this.state);
29
+ }
30
+ addEventListener(event, listener) {
31
+ return this.operations.addEventListener(this.state, event, listener);
32
+ }
33
+ updateValue(newValue, options) {
34
+ this.operations.updateValue(this.state, newValue, options);
35
+ }
36
+ isTouchedBy(agent) {
37
+ return this.touchLog?.has(agent) ?? false;
38
+ }
39
+ get isTouched() {
40
+ return this.isTouchedBy("user");
41
+ }
42
+ // helpers
43
+ get asTemporal() {
44
+ return new TemporalFieldHelper.TemporalFieldHelper(this.getAccessor);
45
+ }
46
+ get asUuid() {
47
+ return new UuidFieldHelper.UuidFieldHelper(this.getAccessor);
48
+ }
49
+ getParent() {
50
+ return this.state.parent.getAccessor();
51
+ }
52
+ }
53
+ exports.FieldAccessorImpl = FieldAccessorImpl;
54
+ //# sourceMappingURL=FieldAccessorImpl.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldAccessorImpl.cjs","sources":["../../../../../packages/binding-legacy/src/accessors/FieldAccessorImpl.ts"],"sourcesContent":["import type { FieldState } from '../core/state'\nimport type { FieldOperations } from '../core/operations'\nimport { TemporalFieldHelper, UuidFieldHelper } from '../fieldHelpers'\nimport { EntityAccessor, ErrorAccessor, FieldAccessor, FieldName, FieldValue, SchemaColumn } from '@contember/binding-common'\n\nexport class FieldAccessorImpl<Value extends FieldValue = FieldValue> implements FieldAccessor {\n\tpublic readonly __type = 'FieldAccessor' as const\n\n\tconstructor(\n\t\tprivate readonly state: FieldState<Value>,\n\t\tprivate readonly operations: FieldOperations,\n\t\tpublic readonly fieldName: FieldName,\n\t\tpublic readonly value: Value | null,\n\t\tpublic readonly valueOnServer: Value | null,\n\t\tpublic readonly defaultValue: Value | undefined,\n\t\tpublic readonly errors: ErrorAccessor | undefined,\n\t\tpublic readonly hasUnpersistedChanges: boolean,\n\t\tprivate readonly touchLog: ReadonlySet<string> | undefined,\n\t\tpublic readonly getAccessor: FieldAccessor.GetFieldAccessor<Value>,\n\t\tpublic readonly schema: SchemaColumn,\n\t) {\n\t}\n\n\tpublic addError(error: ErrorAccessor.Error | string): () => void {\n\t\treturn this.operations.addError(this.state, ErrorAccessor.normalizeError(error))\n\t}\n\n\tpublic clearErrors(): void {\n\t\tthis.operations.clearErrors(this.state)\n\t}\n\n\tpublic addEventListener<Type extends keyof FieldAccessor.FieldEventListenerMap<Value>>(\n\t\tevent: { type: Type; key?: string },\n\t\tlistener: FieldAccessor.FieldEventListenerMap<Value>[Type],\n\t): () => void {\n\t\treturn this.operations.addEventListener(this.state, event, listener)\n\t}\n\n\tpublic updateValue(newValue: Value | null, options?: FieldAccessor.UpdateOptions): void {\n\t\tthis.operations.updateValue(this.state, newValue, options)\n\t}\n\n\tpublic isTouchedBy(agent: 'user' | (string & {})) {\n\t\treturn this.touchLog?.has(agent) ?? false\n\t}\n\n\tpublic get isTouched() {\n\t\treturn this.isTouchedBy('user')\n\t}\n\n\t// helpers\n\n\tpublic get asTemporal(): TemporalFieldHelper {\n\t\treturn new TemporalFieldHelper(this.getAccessor as FieldAccessor.GetFieldAccessor<any>)\n\t}\n\n\tpublic get asUuid(): UuidFieldHelper {\n\t\treturn new UuidFieldHelper(this.getAccessor as FieldAccessor.GetFieldAccessor<any>)\n\t}\n\n\tpublic getParent(): EntityAccessor {\n\t\treturn this.state.parent.getAccessor()\n\t}\n}\n"],"names":["ErrorAccessor","TemporalFieldHelper","UuidFieldHelper"],"mappings":";;;;;;;;AAKO,MAAM,kBAAkF;AAAA,EAG9F,YACkB,OACA,YACD,WACA,OACA,eACA,cACA,QACA,uBACC,UACD,aACA,QACf;AAXgB,SAAA,QAAA;AACA,SAAA,aAAA;AACD,SAAA,YAAA;AACA,SAAA,QAAA;AACA,SAAA,gBAAA;AACA,SAAA,eAAA;AACA,SAAA,SAAA;AACA,SAAA,wBAAA;AACC,SAAA,WAAA;AACD,SAAA,cAAA;AACA,SAAA,SAAA;AAbjB,kBAAA,MAAgB,UAAS,eAAA;AAAA,EAezB;AAAA,EAEO,SAAS,OAAiD;AAChE,WAAO,KAAK,WAAW,SAAS,KAAK,OAAOA,cAAAA,cAAc,eAAe,KAAK,CAAC;AAAA,EAChF;AAAA,EAEO,cAAoB;AAC1B,SAAK,WAAW,YAAY,KAAK,KAAK;AAAA,EACvC;AAAA,EAEO,iBACN,OACA,UACa;AACb,WAAO,KAAK,WAAW,iBAAiB,KAAK,OAAO,OAAO,QAAQ;AAAA,EACpE;AAAA,EAEO,YAAY,UAAwB,SAA6C;AACvF,SAAK,WAAW,YAAY,KAAK,OAAO,UAAU,OAAO;AAAA,EAC1D;AAAA,EAEO,YAAY,OAA+B;AACjD,WAAO,KAAK,UAAU,IAAI,KAAK,KAAK;AAAA,EACrC;AAAA,EAEA,IAAW,YAAY;AACtB,WAAO,KAAK,YAAY,MAAM;AAAA,EAC/B;AAAA;AAAA,EAIA,IAAW,aAAkC;AAC5C,WAAO,IAAIC,oBAAAA,oBAAoB,KAAK,WAAkD;AAAA,EACvF;AAAA,EAEA,IAAW,SAA0B;AACpC,WAAO,IAAIC,gBAAAA,gBAAgB,KAAK,WAAkD;AAAA,EACnF;AAAA,EAEO,YAA4B;AAClC,WAAO,KAAK,MAAM,OAAO,YAAA;AAAA,EAC1B;AACD;;"}
@@ -0,0 +1,54 @@
1
+ import { ErrorAccessor } from "@contember/binding-common";
2
+ import { TemporalFieldHelper } from "../fieldHelpers/helpers/TemporalFieldHelper.js";
3
+ import { UuidFieldHelper } from "../fieldHelpers/helpers/UuidFieldHelper.js";
4
+ var __defProp = Object.defineProperty;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
7
+ class FieldAccessorImpl {
8
+ constructor(state, operations, fieldName, value, valueOnServer, defaultValue, errors, hasUnpersistedChanges, touchLog, getAccessor, schema) {
9
+ this.state = state;
10
+ this.operations = operations;
11
+ this.fieldName = fieldName;
12
+ this.value = value;
13
+ this.valueOnServer = valueOnServer;
14
+ this.defaultValue = defaultValue;
15
+ this.errors = errors;
16
+ this.hasUnpersistedChanges = hasUnpersistedChanges;
17
+ this.touchLog = touchLog;
18
+ this.getAccessor = getAccessor;
19
+ this.schema = schema;
20
+ __publicField(this, "__type", "FieldAccessor");
21
+ }
22
+ addError(error) {
23
+ return this.operations.addError(this.state, ErrorAccessor.normalizeError(error));
24
+ }
25
+ clearErrors() {
26
+ this.operations.clearErrors(this.state);
27
+ }
28
+ addEventListener(event, listener) {
29
+ return this.operations.addEventListener(this.state, event, listener);
30
+ }
31
+ updateValue(newValue, options) {
32
+ this.operations.updateValue(this.state, newValue, options);
33
+ }
34
+ isTouchedBy(agent) {
35
+ return this.touchLog?.has(agent) ?? false;
36
+ }
37
+ get isTouched() {
38
+ return this.isTouchedBy("user");
39
+ }
40
+ // helpers
41
+ get asTemporal() {
42
+ return new TemporalFieldHelper(this.getAccessor);
43
+ }
44
+ get asUuid() {
45
+ return new UuidFieldHelper(this.getAccessor);
46
+ }
47
+ getParent() {
48
+ return this.state.parent.getAccessor();
49
+ }
50
+ }
51
+ export {
52
+ FieldAccessorImpl
53
+ };
54
+ //# sourceMappingURL=FieldAccessorImpl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldAccessorImpl.js","sources":["../../../../../packages/binding-legacy/src/accessors/FieldAccessorImpl.ts"],"sourcesContent":["import type { FieldState } from '../core/state'\nimport type { FieldOperations } from '../core/operations'\nimport { TemporalFieldHelper, UuidFieldHelper } from '../fieldHelpers'\nimport { EntityAccessor, ErrorAccessor, FieldAccessor, FieldName, FieldValue, SchemaColumn } from '@contember/binding-common'\n\nexport class FieldAccessorImpl<Value extends FieldValue = FieldValue> implements FieldAccessor {\n\tpublic readonly __type = 'FieldAccessor' as const\n\n\tconstructor(\n\t\tprivate readonly state: FieldState<Value>,\n\t\tprivate readonly operations: FieldOperations,\n\t\tpublic readonly fieldName: FieldName,\n\t\tpublic readonly value: Value | null,\n\t\tpublic readonly valueOnServer: Value | null,\n\t\tpublic readonly defaultValue: Value | undefined,\n\t\tpublic readonly errors: ErrorAccessor | undefined,\n\t\tpublic readonly hasUnpersistedChanges: boolean,\n\t\tprivate readonly touchLog: ReadonlySet<string> | undefined,\n\t\tpublic readonly getAccessor: FieldAccessor.GetFieldAccessor<Value>,\n\t\tpublic readonly schema: SchemaColumn,\n\t) {\n\t}\n\n\tpublic addError(error: ErrorAccessor.Error | string): () => void {\n\t\treturn this.operations.addError(this.state, ErrorAccessor.normalizeError(error))\n\t}\n\n\tpublic clearErrors(): void {\n\t\tthis.operations.clearErrors(this.state)\n\t}\n\n\tpublic addEventListener<Type extends keyof FieldAccessor.FieldEventListenerMap<Value>>(\n\t\tevent: { type: Type; key?: string },\n\t\tlistener: FieldAccessor.FieldEventListenerMap<Value>[Type],\n\t): () => void {\n\t\treturn this.operations.addEventListener(this.state, event, listener)\n\t}\n\n\tpublic updateValue(newValue: Value | null, options?: FieldAccessor.UpdateOptions): void {\n\t\tthis.operations.updateValue(this.state, newValue, options)\n\t}\n\n\tpublic isTouchedBy(agent: 'user' | (string & {})) {\n\t\treturn this.touchLog?.has(agent) ?? false\n\t}\n\n\tpublic get isTouched() {\n\t\treturn this.isTouchedBy('user')\n\t}\n\n\t// helpers\n\n\tpublic get asTemporal(): TemporalFieldHelper {\n\t\treturn new TemporalFieldHelper(this.getAccessor as FieldAccessor.GetFieldAccessor<any>)\n\t}\n\n\tpublic get asUuid(): UuidFieldHelper {\n\t\treturn new UuidFieldHelper(this.getAccessor as FieldAccessor.GetFieldAccessor<any>)\n\t}\n\n\tpublic getParent(): EntityAccessor {\n\t\treturn this.state.parent.getAccessor()\n\t}\n}\n"],"names":[],"mappings":";;;;;;AAKO,MAAM,kBAAkF;AAAA,EAG9F,YACkB,OACA,YACD,WACA,OACA,eACA,cACA,QACA,uBACC,UACD,aACA,QACf;AAXgB,SAAA,QAAA;AACA,SAAA,aAAA;AACD,SAAA,YAAA;AACA,SAAA,QAAA;AACA,SAAA,gBAAA;AACA,SAAA,eAAA;AACA,SAAA,SAAA;AACA,SAAA,wBAAA;AACC,SAAA,WAAA;AACD,SAAA,cAAA;AACA,SAAA,SAAA;AAbjB,kBAAA,MAAgB,UAAS,eAAA;AAAA,EAezB;AAAA,EAEO,SAAS,OAAiD;AAChE,WAAO,KAAK,WAAW,SAAS,KAAK,OAAO,cAAc,eAAe,KAAK,CAAC;AAAA,EAChF;AAAA,EAEO,cAAoB;AAC1B,SAAK,WAAW,YAAY,KAAK,KAAK;AAAA,EACvC;AAAA,EAEO,iBACN,OACA,UACa;AACb,WAAO,KAAK,WAAW,iBAAiB,KAAK,OAAO,OAAO,QAAQ;AAAA,EACpE;AAAA,EAEO,YAAY,UAAwB,SAA6C;AACvF,SAAK,WAAW,YAAY,KAAK,OAAO,UAAU,OAAO;AAAA,EAC1D;AAAA,EAEO,YAAY,OAA+B;AACjD,WAAO,KAAK,UAAU,IAAI,KAAK,KAAK;AAAA,EACrC;AAAA,EAEA,IAAW,YAAY;AACtB,WAAO,KAAK,YAAY,MAAM;AAAA,EAC/B;AAAA;AAAA,EAIA,IAAW,aAAkC;AAC5C,WAAO,IAAI,oBAAoB,KAAK,WAAkD;AAAA,EACvF;AAAA,EAEA,IAAW,SAA0B;AACpC,WAAO,IAAI,gBAAgB,KAAK,WAAkD;AAAA,EACnF;AAAA,EAEO,YAA4B;AAClC,WAAO,KAAK,MAAM,OAAO,YAAA;AAAA,EAC1B;AACD;"}
@@ -0,0 +1,200 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const ErrorsPreprocessor = require("./ErrorsPreprocessor.cjs");
4
+ const EventManager = require("./EventManager.cjs");
5
+ const getEntityMarker = require("./state/getEntityMarker.cjs");
6
+ var __defProp = Object.defineProperty;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
9
+ class AccessorErrorManager {
10
+ constructor(eventManager, treeStore) {
11
+ this.eventManager = eventManager;
12
+ this.treeStore = treeStore;
13
+ __publicField(this, "errorsByState", /* @__PURE__ */ new Map());
14
+ __publicField(this, "getNewErrorId", /* @__PURE__ */ (() => {
15
+ let errorId = 1;
16
+ return () => errorId++;
17
+ })());
18
+ }
19
+ hasErrors() {
20
+ return !!this.errorsByState.size;
21
+ }
22
+ getErrors() {
23
+ return Array.from(this.errorsByState.values(), (it) => Array.from(it.values())).flat();
24
+ }
25
+ clearErrors() {
26
+ this.eventManager.syncOperation(() => {
27
+ for (const [stateNode] of this.errorsByState) {
28
+ stateNode.errors = void 0;
29
+ this.eventManager.registerJustUpdated(stateNode, EventManager.EventManager.NO_CHANGES_DIFFERENCE);
30
+ }
31
+ this.errorsByState.clear();
32
+ });
33
+ }
34
+ clearErrorsByState(state) {
35
+ return this.eventManager.syncOperation(() => {
36
+ if (!this.errorsByState.has(state)) {
37
+ return;
38
+ }
39
+ this.errorsByState.delete(state);
40
+ state.errors = void 0;
41
+ this.eventManager.registerJustUpdated(state, EventManager.EventManager.NO_CHANGES_DIFFERENCE);
42
+ });
43
+ }
44
+ replaceErrors(data, operations) {
45
+ this.eventManager.syncOperation(() => {
46
+ this.clearErrors();
47
+ const preprocessor = new ErrorsPreprocessor.ErrorsPreprocessor(data, operations);
48
+ const errorTreeRoot = preprocessor.preprocess();
49
+ this.setRootStateErrors(errorTreeRoot);
50
+ this.dumpErrorData(data);
51
+ });
52
+ }
53
+ addError(state, error) {
54
+ return this.eventManager.syncOperation(() => {
55
+ const errorId = this.getNewErrorId();
56
+ let errorsById = this.errorsByState.get(state);
57
+ if (errorsById === void 0) {
58
+ this.errorsByState.set(state, errorsById = /* @__PURE__ */ new Map());
59
+ }
60
+ errorsById.set(errorId, error);
61
+ state.errors = { errors: Array.from(errorsById.values()) };
62
+ this.eventManager.registerJustUpdated(state, EventManager.EventManager.NO_CHANGES_DIFFERENCE);
63
+ return () => this.eventManager.syncOperation(() => {
64
+ const errorsById2 = this.errorsByState.get(state);
65
+ if (errorsById2 === void 0) {
66
+ return;
67
+ }
68
+ errorsById2.delete(errorId);
69
+ if (errorsById2.size) {
70
+ state.errors = { errors: Array.from(errorsById2.values()) };
71
+ } else {
72
+ state.errors = void 0;
73
+ this.errorsByState.delete(state);
74
+ }
75
+ this.eventManager.registerJustUpdated(state, EventManager.EventManager.NO_CHANGES_DIFFERENCE);
76
+ });
77
+ });
78
+ }
79
+ addSeveralErrors(state, errors) {
80
+ if (errors.validation) {
81
+ for (const error of errors.validation) {
82
+ this.addError(state, error);
83
+ }
84
+ }
85
+ if (errors.execution) {
86
+ for (const error of errors.execution) {
87
+ this.addError(state, error);
88
+ }
89
+ }
90
+ }
91
+ setRootStateErrors(errorTreeRoot) {
92
+ for (const rootStates of this.treeStore.subTreeStatesByRoot.values()) {
93
+ for (const [subTreePlaceholder, rootError] of errorTreeRoot) {
94
+ const rootState = rootStates.get(subTreePlaceholder);
95
+ if (!rootState) {
96
+ continue;
97
+ }
98
+ switch (rootState.type) {
99
+ case "entityRealm": {
100
+ this.setEntityStateErrors(rootState, rootError);
101
+ break;
102
+ }
103
+ case "entityList": {
104
+ this.setEntityListStateErrors(rootState, rootError);
105
+ break;
106
+ }
107
+ }
108
+ }
109
+ }
110
+ }
111
+ setEntityStateErrors(state, errors) {
112
+ this.addSeveralErrors(state, errors);
113
+ if (errors.nodeType !== "iNode") {
114
+ return;
115
+ }
116
+ for (const [childKey, child] of errors.children) {
117
+ if (typeof childKey !== "string") {
118
+ continue;
119
+ }
120
+ if (child.nodeType === "leaf") {
121
+ const fieldState = state.children.get(childKey);
122
+ if (fieldState?.type === "field") {
123
+ this.addSeveralErrors(fieldState, child);
124
+ continue;
125
+ }
126
+ }
127
+ const fields = getEntityMarker.getEntityMarker(state).fields;
128
+ const placeholders = fields.placeholders.get(childKey);
129
+ if (placeholders === void 0) {
130
+ continue;
131
+ }
132
+ const normalizedPlaceholders = typeof placeholders === "string" ? /* @__PURE__ */ new Set([placeholders]) : placeholders;
133
+ for (const normalizedPlaceholder of normalizedPlaceholders) {
134
+ const fieldState = state.children.get(normalizedPlaceholder);
135
+ if (fieldState === void 0) {
136
+ continue;
137
+ }
138
+ switch (fieldState.type) {
139
+ case "entityRealm":
140
+ if (child.nodeType === "iNode" && child.children.has(fieldState.entity.id.value)) {
141
+ this.setEntityStateErrors(fieldState, child.children.get(fieldState.entity.id.value));
142
+ } else {
143
+ this.setEntityStateErrors(fieldState, child);
144
+ }
145
+ break;
146
+ case "entityList":
147
+ this.setEntityListStateErrors(fieldState, child);
148
+ break;
149
+ }
150
+ }
151
+ }
152
+ }
153
+ setEntityListStateErrors(state, errors) {
154
+ this.addSeveralErrors(state, errors);
155
+ if (errors.nodeType !== "iNode") {
156
+ return;
157
+ }
158
+ for (const [childKey, childError] of errors.children) {
159
+ let childState = state.children.get(childKey);
160
+ if (childState === void 0) {
161
+ continue;
162
+ }
163
+ if (childState.type === "entityRealmStub") {
164
+ childState.getAccessor();
165
+ childState = state.children.get(childKey);
166
+ }
167
+ if (childError.nodeType === "iNode") {
168
+ this.setEntityStateErrors(childState, childError);
169
+ }
170
+ }
171
+ }
172
+ dumpErrorData(data) {
173
+ for (const subTreePlaceholder in data.data) {
174
+ const treeDatum = data.data[subTreePlaceholder];
175
+ const executionErrors = treeDatum.errors;
176
+ const allErrors = treeDatum?.validation?.errors ? executionErrors.concat(treeDatum.validation.errors) : executionErrors;
177
+ const normalizedErrors = allErrors.map((error) => {
178
+ const path = "paths" in error ? error.paths[0] ?? [] : error.path;
179
+ return {
180
+ path: path.map((pathPart) => {
181
+ if ("field" in pathPart) {
182
+ return pathPart.field;
183
+ }
184
+ if (pathPart.alias) {
185
+ return `#${pathPart.index}(${pathPart.alias})`;
186
+ }
187
+ return pathPart.index;
188
+ }).join("."),
189
+ type: "type" in error ? error.type : void 0,
190
+ message: typeof error.message === "string" ? error.message : error.message?.text
191
+ };
192
+ });
193
+ if (Object.keys(normalizedErrors).length) {
194
+ console.table(normalizedErrors);
195
+ }
196
+ }
197
+ }
198
+ }
199
+ exports.AccessorErrorManager = AccessorErrorManager;
200
+ //# sourceMappingURL=AccessorErrorManager.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccessorErrorManager.cjs","sources":["../../../../../packages/binding-legacy/src/core/AccessorErrorManager.ts"],"sourcesContent":["import { ErrorAccessor } from '@contember/binding-common'\nimport { ErrorsPreprocessor } from './ErrorsPreprocessor'\nimport { EventManager } from './EventManager'\nimport { EntityListState, EntityRealmState, getEntityMarker, StateNode } from './state'\nimport type { TreeStore } from './TreeStore'\nimport { SubMutationOperation } from './MutationGenerator'\nimport { DataBindingTransactionResult } from '@contember/binding-common'\nimport { MutationError, ValidationError } from '@contember/client'\n\nexport class AccessorErrorManager {\n\tprivate errorsByState: Map<StateNode, ErrorAccessor.ErrorsById> = new Map()\n\n\tprivate getNewErrorId = (() => {\n\t\tlet errorId = 1\n\n\t\treturn () => errorId++\n\t})()\n\n\tpublic constructor(private readonly eventManager: EventManager, private readonly treeStore: TreeStore) {}\n\n\tpublic hasErrors() {\n\t\treturn !!this.errorsByState.size\n\t}\n\n\tpublic getErrors(): ErrorAccessor.Error[] {\n\t\treturn Array.from(this.errorsByState.values(), it => Array.from(it.values())).flat()\n\t}\n\n\tpublic clearErrors() {\n\t\tthis.eventManager.syncOperation(() => {\n\t\t\tfor (const [stateNode] of this.errorsByState) {\n\t\t\t\tstateNode.errors = undefined\n\t\t\t\tthis.eventManager.registerJustUpdated(stateNode, EventManager.NO_CHANGES_DIFFERENCE)\n\t\t\t}\n\t\t\tthis.errorsByState.clear()\n\t\t})\n\t}\n\n\tpublic clearErrorsByState(state: StateNode): void {\n\t\treturn this.eventManager.syncOperation(() => {\n\t\t\tif (!this.errorsByState.has(state)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.errorsByState.delete(state)\n\t\t\tstate.errors = undefined\n\t\t\tthis.eventManager.registerJustUpdated(state, EventManager.NO_CHANGES_DIFFERENCE)\n\t\t})\n\t}\n\n\tpublic replaceErrors(data: DataBindingTransactionResult, operations: SubMutationOperation[]) {\n\t\tthis.eventManager.syncOperation(() => {\n\t\t\tthis.clearErrors()\n\n\t\t\tconst preprocessor = new ErrorsPreprocessor(data, operations)\n\t\t\tconst errorTreeRoot = preprocessor.preprocess()\n\n\t\t\tthis.setRootStateErrors(errorTreeRoot)\n\n\t\t\tthis.dumpErrorData(data)\n\t\t})\n\t}\n\n\tpublic addError(state: StateNode, error: ErrorAccessor.Error): () => void {\n\t\treturn this.eventManager.syncOperation(() => {\n\t\t\tconst errorId = this.getNewErrorId()\n\n\t\t\tlet errorsById: ErrorAccessor.ErrorsById | undefined = this.errorsByState.get(state)\n\t\t\tif (errorsById === undefined) {\n\t\t\t\tthis.errorsByState.set(state, errorsById = new Map())\n\t\t\t}\n\t\t\terrorsById.set(errorId, error)\n\t\t\tstate.errors = { errors: Array.from(errorsById.values()) }\n\t\t\tthis.eventManager.registerJustUpdated(state, EventManager.NO_CHANGES_DIFFERENCE)\n\n\t\t\treturn () =>\n\t\t\t\tthis.eventManager.syncOperation(() => {\n\t\t\t\t\tconst errorsById = this.errorsByState.get(state)\n\t\t\t\t\tif (errorsById === undefined) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\terrorsById.delete(errorId)\n\t\t\t\t\tif (errorsById.size) {\n\t\t\t\t\t\tstate.errors = { errors: Array.from(errorsById.values()) }\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstate.errors = undefined\n\t\t\t\t\t\tthis.errorsByState.delete(state)\n\t\t\t\t\t}\n\t\t\t\t\tthis.eventManager.registerJustUpdated(state, EventManager.NO_CHANGES_DIFFERENCE)\n\t\t\t\t})\n\t\t})\n\t}\n\n\tprivate addSeveralErrors(state: StateNode, errors: ErrorsPreprocessor.BaseErrorNode) {\n\t\tif (errors.validation) {\n\t\t\tfor (const error of errors.validation) {\n\t\t\t\tthis.addError(state, error)\n\t\t\t}\n\t\t}\n\t\tif (errors.execution) {\n\t\t\tfor (const error of errors.execution) {\n\t\t\t\tthis.addError(state, error)\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate setRootStateErrors(errorTreeRoot: ErrorsPreprocessor.ErrorTreeRoot) {\n\t\tfor (const rootStates of this.treeStore.subTreeStatesByRoot.values()) {\n\t\t\tfor (const [subTreePlaceholder, rootError] of errorTreeRoot) {\n\t\t\t\tconst rootState = rootStates.get(subTreePlaceholder)\n\n\t\t\t\tif (!rootState) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tswitch (rootState.type) {\n\t\t\t\t\tcase 'entityRealm': {\n\t\t\t\t\t\tthis.setEntityStateErrors(rootState, rootError)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tcase 'entityList': {\n\t\t\t\t\t\tthis.setEntityListStateErrors(rootState, rootError)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate setEntityStateErrors(\n\t\tstate: EntityRealmState,\n\t\terrors: ErrorsPreprocessor.ErrorINode | ErrorsPreprocessor.LeafErrorNode,\n\t) {\n\t\tthis.addSeveralErrors(state, errors)\n\n\t\tif (errors.nodeType !== 'iNode') {\n\t\t\treturn\n\t\t}\n\n\t\tfor (const [childKey, child] of errors.children) {\n\t\t\tif (typeof childKey !== 'string') {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (child.nodeType === 'leaf') {\n\t\t\t\tconst fieldState = state.children.get(childKey)\n\n\t\t\t\tif (fieldState?.type === 'field') {\n\t\t\t\t\tthis.addSeveralErrors(fieldState, child)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Deliberately letting flow get here as well. Leaf errors *CAN* refer to relations as well.\n\n\t\t\tconst fields = getEntityMarker(state).fields\n\t\t\tconst placeholders = fields.placeholders.get(childKey)\n\t\t\tif (placeholders === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst normalizedPlaceholders = typeof placeholders === 'string' ? new Set([placeholders]) : placeholders\n\n\t\t\tfor (const normalizedPlaceholder of normalizedPlaceholders) {\n\t\t\t\tconst fieldState = state.children.get(normalizedPlaceholder)\n\t\t\t\tif (fieldState === undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tswitch (fieldState.type) {\n\t\t\t\t\tcase 'entityRealm':\n\t\t\t\t\t\t// unwrap for reduced has many\n\t\t\t\t\t\tif (child.nodeType === 'iNode' && child.children.has(fieldState.entity.id.value)) {\n\t\t\t\t\t\t\tthis.setEntityStateErrors(fieldState, child.children.get(fieldState.entity.id.value)!)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.setEntityStateErrors(fieldState, child)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'entityList':\n\t\t\t\t\t\tthis.setEntityListStateErrors(fieldState, child)\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate setEntityListStateErrors(\n\t\tstate: EntityListState,\n\t\terrors: ErrorsPreprocessor.ErrorINode | ErrorsPreprocessor.LeafErrorNode,\n\t) {\n\t\tthis.addSeveralErrors(state, errors)\n\n\t\tif (errors.nodeType !== 'iNode') {\n\t\t\treturn\n\t\t}\n\n\t\tfor (const [childKey, childError] of errors.children) {\n\t\t\tlet childState = state.children.get(childKey)\n\n\t\t\tif (childState === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (childState.type === 'entityRealmStub') {\n\t\t\t\tchildState.getAccessor() // Force init\n\t\t\t\tchildState = state.children.get(childKey)!\n\t\t\t}\n\n\t\t\tif (childError.nodeType === 'iNode') {\n\t\t\t\tthis.setEntityStateErrors(childState as EntityRealmState, childError)\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate dumpErrorData(data: DataBindingTransactionResult) {\n\t\t// TODO this is just temporary\n\t\tfor (const subTreePlaceholder in data.data) {\n\t\t\tconst treeDatum = data.data[subTreePlaceholder]\n\t\t\tconst executionErrors: Array<MutationError | ValidationError> = treeDatum.errors\n\t\t\tconst allErrors = treeDatum?.validation?.errors\n\t\t\t\t? executionErrors.concat(treeDatum.validation.errors)\n\t\t\t\t: executionErrors\n\t\t\tconst normalizedErrors = allErrors.map((error: MutationError | ValidationError) => {\n\t\t\t\tconst path = 'paths' in error ? (error.paths[0] ?? []) : error.path\n\t\t\t\treturn {\n\t\t\t\t\tpath: path\n\t\t\t\t\t\t.map(pathPart => {\n\t\t\t\t\t\t\tif ('field' in pathPart) {\n\t\t\t\t\t\t\t\treturn pathPart.field\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (pathPart.alias) {\n\t\t\t\t\t\t\t\treturn `#${pathPart.index}(${pathPart.alias})`\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn pathPart.index\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join('.'),\n\t\t\t\t\ttype: 'type' in error ? error.type : undefined,\n\t\t\t\t\tmessage: typeof error.message === 'string' ? error.message : error.message?.text,\n\t\t\t\t}\n\t\t\t})\n\t\t\tif (Object.keys(normalizedErrors).length) {\n\t\t\t\t// biome-ignore lint/suspicious/noConsole: debug output\n\t\t\t\tconsole.table(normalizedErrors)\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":["EventManager","ErrorsPreprocessor","errorsById","getEntityMarker"],"mappings":";;;;;;;;AASO,MAAM,qBAAqB;AAAA,EAS1B,YAA6B,cAA6C,WAAsB;AAAnE,SAAA,eAAA;AAA6C,SAAA,YAAA;AARjF,kBAAA,MAAQ,qCAA8D,IAAA,CAAI;AAE1E,kBAAA,MAAQ,iBAAiB,uBAAM;AAC9B,UAAI,UAAU;AAEd,aAAO,MAAM;AAAA,IACd,IAAG;AAAA,EAEqG;AAAA,EAEjG,YAAY;AAClB,WAAO,CAAC,CAAC,KAAK,cAAc;AAAA,EAC7B;AAAA,EAEO,YAAmC;AACzC,WAAO,MAAM,KAAK,KAAK,cAAc,UAAU,CAAA,OAAM,MAAM,KAAK,GAAG,OAAA,CAAQ,CAAC,EAAE,KAAA;AAAA,EAC/E;AAAA,EAEO,cAAc;AACpB,SAAK,aAAa,cAAc,MAAM;AACrC,iBAAW,CAAC,SAAS,KA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