@contember/binding 1.2.3 → 1.3.0-alpha.10

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 (1106) hide show
  1. package/dist/development/BindingError.cjs +10 -0
  2. package/dist/development/BindingError.cjs.map +1 -0
  3. package/dist/development/accessorTree/NormalizedPersistedData.cjs +10 -0
  4. package/dist/development/accessorTree/NormalizedPersistedData.cjs.map +1 -0
  5. package/dist/development/accessorTree/RuntimeId.cjs +64 -0
  6. package/dist/development/accessorTree/RuntimeId.cjs.map +1 -0
  7. package/dist/development/accessorTree/RuntimeId.js +5 -5
  8. package/dist/development/accessorTree/RuntimeId.js.map +1 -1
  9. package/dist/development/accessors/EntityAccessor.cjs +169 -0
  10. package/dist/development/accessors/EntityAccessor.cjs.map +1 -0
  11. package/dist/development/accessors/EntityAccessor.js +1 -1
  12. package/dist/development/accessors/EntityAccessor.js.map +1 -1
  13. package/dist/development/accessors/EntityListAccessor.cjs +101 -0
  14. package/dist/development/accessors/EntityListAccessor.cjs.map +1 -0
  15. package/dist/development/accessors/ErrorAccessor.cjs +16 -0
  16. package/dist/development/accessors/ErrorAccessor.cjs.map +1 -0
  17. package/dist/development/accessors/FieldAccessor.cjs +59 -0
  18. package/dist/development/accessors/FieldAccessor.cjs.map +1 -0
  19. package/dist/development/accessors/TreeRootAccessor.cjs +14 -0
  20. package/dist/development/accessors/TreeRootAccessor.cjs.map +1 -0
  21. package/dist/development/accessors/TreeRootAccessor.js.map +1 -1
  22. package/dist/development/bindingTypes.cjs +9 -0
  23. package/dist/development/bindingTypes.cjs.map +1 -0
  24. package/dist/development/core/AccessorErrorManager.cjs +207 -0
  25. package/dist/development/core/AccessorErrorManager.cjs.map +1 -0
  26. package/dist/development/core/AccessorErrorManager.js +11 -6
  27. package/dist/development/core/AccessorErrorManager.js.map +1 -1
  28. package/dist/development/core/Config.cjs +32 -0
  29. package/dist/development/core/Config.cjs.map +1 -0
  30. package/dist/development/core/Config.js +3 -3
  31. package/dist/development/core/Config.js.map +1 -1
  32. package/dist/development/core/DataBinding.cjs +352 -0
  33. package/dist/development/core/DataBinding.cjs.map +1 -0
  34. package/dist/development/core/DataBinding.js +56 -49
  35. package/dist/development/core/DataBinding.js.map +1 -1
  36. package/dist/development/core/DirtinessTracker.cjs +29 -0
  37. package/dist/development/core/DirtinessTracker.cjs.map +1 -0
  38. package/dist/development/core/ErrorsPreprocessor.cjs +181 -0
  39. package/dist/development/core/ErrorsPreprocessor.cjs.map +1 -0
  40. package/dist/development/core/ErrorsPreprocessor.js +16 -16
  41. package/dist/development/core/ErrorsPreprocessor.js.map +1 -1
  42. package/dist/development/core/EventManager.cjs +440 -0
  43. package/dist/development/core/EventManager.cjs.map +1 -0
  44. package/dist/development/core/EventManager.js +7 -5
  45. package/dist/development/core/EventManager.js.map +1 -1
  46. package/dist/development/core/MarkerComparator.cjs +79 -0
  47. package/dist/development/core/MarkerComparator.cjs.map +1 -0
  48. package/dist/development/core/MarkerComparator.js.map +1 -1
  49. package/dist/development/core/MarkerMerger.cjs +252 -0
  50. package/dist/development/core/MarkerMerger.cjs.map +1 -0
  51. package/dist/development/core/MarkerMerger.js +2 -2
  52. package/dist/development/core/MarkerMerger.js.map +1 -1
  53. package/dist/development/core/MutationGenerator.cjs +635 -0
  54. package/dist/development/core/MutationGenerator.cjs.map +1 -0
  55. package/dist/development/core/MutationGenerator.js +341 -294
  56. package/dist/development/core/MutationGenerator.js.map +1 -1
  57. package/dist/development/core/QueryGenerator.cjs +113 -0
  58. package/dist/development/core/QueryGenerator.cjs.map +1 -0
  59. package/dist/development/core/QueryGenerator.js +62 -73
  60. package/dist/development/core/QueryGenerator.js.map +1 -1
  61. package/dist/development/core/RealmKeyGenerator.cjs +47 -0
  62. package/dist/development/core/RealmKeyGenerator.cjs.map +1 -0
  63. package/dist/development/core/RealmKeyGenerator.js.map +1 -1
  64. package/dist/development/core/RequestResponseNormalizer.cjs +125 -0
  65. package/dist/development/core/RequestResponseNormalizer.cjs.map +1 -0
  66. package/dist/development/core/StateInitializer.cjs +389 -0
  67. package/dist/development/core/StateInitializer.cjs.map +1 -0
  68. package/dist/development/core/StateInitializer.js +2 -2
  69. package/dist/development/core/StateInitializer.js.map +1 -1
  70. package/dist/development/core/TreeAugmenter.cjs +213 -0
  71. package/dist/development/core/TreeAugmenter.cjs.map +1 -0
  72. package/dist/development/core/TreeFilterGenerator.cjs +83 -0
  73. package/dist/development/core/TreeFilterGenerator.cjs.map +1 -0
  74. package/dist/development/core/TreeParameterMerger.cjs +304 -0
  75. package/dist/development/core/TreeParameterMerger.cjs.map +1 -0
  76. package/dist/development/core/TreeParameterMerger.js +8 -0
  77. package/dist/development/core/TreeParameterMerger.js.map +1 -1
  78. package/dist/development/core/TreeStore.cjs +182 -0
  79. package/dist/development/core/TreeStore.cjs.map +1 -0
  80. package/dist/development/core/TreeStore.js +1 -1
  81. package/dist/development/core/TreeStore.js.map +1 -1
  82. package/dist/development/core/VariableInputTransformer.cjs +24 -0
  83. package/dist/development/core/VariableInputTransformer.cjs.map +1 -0
  84. package/dist/development/core/VariableInputTransformer.js.map +1 -1
  85. package/dist/development/core/exceptions/ErrorLocator.cjs +62 -0
  86. package/dist/development/core/exceptions/ErrorLocator.cjs.map +1 -0
  87. package/dist/development/core/exceptions/LocalizedBindingError.cjs +14 -0
  88. package/dist/development/core/exceptions/LocalizedBindingError.cjs.map +1 -0
  89. package/dist/development/core/exceptions/MarkerSugarer.cjs +56 -0
  90. package/dist/development/core/exceptions/MarkerSugarer.cjs.map +1 -0
  91. package/dist/development/core/exceptions/TreeParameterSugarer.cjs +33 -0
  92. package/dist/development/core/exceptions/TreeParameterSugarer.cjs.map +1 -0
  93. package/dist/development/core/exceptions/TreeParameterSugarer.js.map +1 -1
  94. package/dist/development/core/factories/createBatchUpdatesOptions.cjs +20 -0
  95. package/dist/development/core/factories/createBatchUpdatesOptions.cjs.map +1 -0
  96. package/dist/development/core/factories/createBatchUpdatesOptions.js.map +1 -1
  97. package/dist/development/core/operations/EntityOperations.cjs +238 -0
  98. package/dist/development/core/operations/EntityOperations.cjs.map +1 -0
  99. package/dist/development/core/operations/EntityOperations.js +1 -1
  100. package/dist/development/core/operations/EntityOperations.js.map +1 -1
  101. package/dist/development/core/operations/FieldOperations.cjs +96 -0
  102. package/dist/development/core/operations/FieldOperations.cjs.map +1 -0
  103. package/dist/development/core/operations/FieldOperations.js +1 -1
  104. package/dist/development/core/operations/FieldOperations.js.map +1 -1
  105. package/dist/development/core/operations/ListOperations.cjs +159 -0
  106. package/dist/development/core/operations/ListOperations.cjs.map +1 -0
  107. package/dist/development/core/operations/ListOperations.js.map +1 -1
  108. package/dist/development/core/operations/OperationsHelpers.cjs +85 -0
  109. package/dist/development/core/operations/OperationsHelpers.cjs.map +1 -0
  110. package/dist/development/core/operations/OperationsHelpers.js.map +1 -1
  111. package/dist/development/core/requestAliases/MutationAlias.cjs +14 -0
  112. package/dist/development/core/requestAliases/MutationAlias.cjs.map +1 -0
  113. package/dist/development/core/requestAliases/MutationAlias.js.map +1 -1
  114. package/dist/development/core/schema/Schema.cjs +39 -0
  115. package/dist/development/core/schema/Schema.cjs.map +1 -0
  116. package/dist/development/core/schema/Schema.js.map +1 -1
  117. package/dist/development/core/schema/SchemaLoader.cjs +28 -0
  118. package/dist/development/core/schema/SchemaLoader.cjs.map +1 -0
  119. package/dist/development/core/schema/SchemaLoader.js +2 -2
  120. package/dist/development/core/schema/SchemaLoader.js.map +1 -1
  121. package/dist/development/core/schema/SchemaPreprocessor.cjs +38 -0
  122. package/dist/development/core/schema/SchemaPreprocessor.cjs.map +1 -0
  123. package/dist/development/core/state/StateIterator.cjs +100 -0
  124. package/dist/development/core/state/StateIterator.cjs.map +1 -0
  125. package/dist/development/core/state/getEntityMarker.cjs +5 -0
  126. package/dist/development/core/state/getEntityMarker.cjs.map +1 -0
  127. package/dist/development/core/utils/createQueryBuilder.cjs +32 -0
  128. package/dist/development/core/utils/createQueryBuilder.cjs.map +1 -0
  129. package/dist/development/core/utils/createQueryBuilder.js +32 -0
  130. package/dist/development/core/utils/createQueryBuilder.js.map +1 -0
  131. package/dist/development/core/utils/getCombinedSignal.cjs +33 -0
  132. package/dist/development/core/utils/getCombinedSignal.cjs.map +1 -0
  133. package/dist/development/dao/Environment.cjs +213 -0
  134. package/dist/development/dao/Environment.cjs.map +1 -0
  135. package/dist/development/dao/Environment.js.map +1 -1
  136. package/dist/development/dao/TreeNodeEnvironmentFactory.cjs +89 -0
  137. package/dist/development/dao/TreeNodeEnvironmentFactory.cjs.map +1 -0
  138. package/dist/development/dao/VariableFieldValue.cjs +9 -0
  139. package/dist/development/dao/VariableFieldValue.cjs.map +1 -0
  140. package/dist/development/fieldHelpers/helpers/FieldHelper.cjs +17 -0
  141. package/dist/development/fieldHelpers/helpers/FieldHelper.cjs.map +1 -0
  142. package/dist/development/fieldHelpers/helpers/TemporalFieldHelper.cjs +18 -0
  143. package/dist/development/fieldHelpers/helpers/TemporalFieldHelper.cjs.map +1 -0
  144. package/dist/development/fieldHelpers/helpers/UuidFieldHelper.cjs +16 -0
  145. package/dist/development/fieldHelpers/helpers/UuidFieldHelper.cjs.map +1 -0
  146. package/dist/development/index.cjs +124 -0
  147. package/dist/development/index.cjs.map +1 -0
  148. package/dist/development/index.js +18 -135
  149. package/dist/development/index.js.map +1 -1
  150. package/dist/development/markers/EntityFieldMarkersContainer.cjs +41 -0
  151. package/dist/development/markers/EntityFieldMarkersContainer.cjs.map +1 -0
  152. package/dist/development/markers/EntityFieldsWithHoistablesMarker.cjs +11 -0
  153. package/dist/development/markers/EntityFieldsWithHoistablesMarker.cjs.map +1 -0
  154. package/dist/development/markers/EntityListSubTreeMarker.cjs +23 -0
  155. package/dist/development/markers/EntityListSubTreeMarker.cjs.map +1 -0
  156. package/dist/development/markers/EntitySubTreeMarker.cjs +23 -0
  157. package/dist/development/markers/EntitySubTreeMarker.cjs.map +1 -0
  158. package/dist/development/markers/FieldMarker.cjs +20 -0
  159. package/dist/development/markers/FieldMarker.cjs.map +1 -0
  160. package/dist/development/markers/HasManyRelationMarker.cjs +29 -0
  161. package/dist/development/markers/HasManyRelationMarker.cjs.map +1 -0
  162. package/dist/development/markers/HasOneRelationMarker.cjs +23 -0
  163. package/dist/development/markers/HasOneRelationMarker.cjs.map +1 -0
  164. package/dist/development/markers/MarkerTreeRoot.cjs +10 -0
  165. package/dist/development/markers/MarkerTreeRoot.cjs.map +1 -0
  166. package/dist/development/markers/ParentEntityMarker.cjs +10 -0
  167. package/dist/development/markers/ParentEntityMarker.cjs.map +1 -0
  168. package/dist/development/markers/PlaceholderGenerator.cjs +23 -0
  169. package/dist/development/markers/PlaceholderGenerator.cjs.map +1 -0
  170. package/dist/development/markers/PlaceholderGenerator.js.map +1 -1
  171. package/dist/development/markers/PlaceholderParametersGenerator.cjs +62 -0
  172. package/dist/development/markers/PlaceholderParametersGenerator.cjs.map +1 -0
  173. package/dist/development/queryLanguage/CacheStore.cjs +47 -0
  174. package/dist/development/queryLanguage/CacheStore.cjs.map +1 -0
  175. package/dist/development/queryLanguage/CacheStore.js +2 -1
  176. package/dist/development/queryLanguage/CacheStore.js.map +1 -1
  177. package/dist/development/queryLanguage/MarkerFactory.cjs +200 -0
  178. package/dist/development/queryLanguage/MarkerFactory.cjs.map +1 -0
  179. package/dist/development/queryLanguage/MarkerFactory.js +1 -1
  180. package/dist/development/queryLanguage/Parser.cjs +728 -0
  181. package/dist/development/queryLanguage/Parser.cjs.map +1 -0
  182. package/dist/development/queryLanguage/Parser.js +70 -29
  183. package/dist/development/queryLanguage/Parser.js.map +1 -1
  184. package/dist/development/queryLanguage/QueryLanguage.cjs +520 -0
  185. package/dist/development/queryLanguage/QueryLanguage.cjs.map +1 -0
  186. package/dist/development/queryLanguage/QueryLanguage.js +16 -14
  187. package/dist/development/queryLanguage/QueryLanguage.js.map +1 -1
  188. package/dist/development/queryLanguage/QueryLanguageError.cjs +6 -0
  189. package/dist/development/queryLanguage/QueryLanguageError.cjs.map +1 -0
  190. package/dist/development/queryLanguage/tokenList.cjs +150 -0
  191. package/dist/development/queryLanguage/tokenList.cjs.map +1 -0
  192. package/dist/development/queryLanguage/tokenList.js +1 -1
  193. package/dist/development/queryLanguage/tokenList.js.map +1 -1
  194. package/dist/development/structures/BijectiveIndexedMap.cjs +120 -0
  195. package/dist/development/structures/BijectiveIndexedMap.cjs.map +1 -0
  196. package/dist/development/structures/LRUCache.cjs +35 -0
  197. package/dist/development/structures/LRUCache.cjs.map +1 -0
  198. package/dist/development/structures/WeakIdCache.cjs +33 -0
  199. package/dist/development/structures/WeakIdCache.cjs.map +1 -0
  200. package/dist/development/treeParameterHelpers/wrapFilterInHasOnes.cjs +22 -0
  201. package/dist/development/treeParameterHelpers/wrapFilterInHasOnes.cjs.map +1 -0
  202. package/dist/development/treeParameters/EntityCreationParameters.cjs +8 -0
  203. package/dist/development/treeParameters/EntityCreationParameters.cjs.map +1 -0
  204. package/dist/development/treeParameters/EntityListPreferences.cjs +7 -0
  205. package/dist/development/treeParameters/EntityListPreferences.cjs.map +1 -0
  206. package/dist/development/treeParameters/EventListenersStore.cjs +70 -0
  207. package/dist/development/treeParameters/EventListenersStore.cjs.map +1 -0
  208. package/dist/development/treeParameters/EventListenersStore.js.map +1 -1
  209. package/dist/development/treeParameters/LeafField.cjs +7 -0
  210. package/dist/development/treeParameters/LeafField.cjs.map +1 -0
  211. package/dist/development/treeParameters/QualifiedEntityParameters.cjs +7 -0
  212. package/dist/development/treeParameters/QualifiedEntityParameters.cjs.map +1 -0
  213. package/dist/development/treeParameters/Relation.cjs +7 -0
  214. package/dist/development/treeParameters/Relation.cjs.map +1 -0
  215. package/dist/development/utils/Hashing.cjs +22 -0
  216. package/dist/development/utils/Hashing.cjs.map +1 -0
  217. package/dist/development/utils/TreeNodeUtils.cjs +77 -0
  218. package/dist/development/utils/TreeNodeUtils.cjs.map +1 -0
  219. package/dist/development/utils/TreeNodeUtils.js.map +1 -1
  220. package/dist/development/utils/assert.cjs +11 -0
  221. package/dist/development/utils/assert.cjs.map +1 -0
  222. package/dist/development/utils/assert.js.map +1 -1
  223. package/dist/development/utils/assertNever.cjs +10 -0
  224. package/dist/development/utils/assertNever.cjs.map +1 -0
  225. package/dist/development/utils/generateEnumerabilityPreventingEntropy.cjs +7 -0
  226. package/dist/development/utils/generateEnumerabilityPreventingEntropy.cjs.map +1 -0
  227. package/dist/development/utils/isEmptyObject.cjs +12 -0
  228. package/dist/development/utils/isEmptyObject.cjs.map +1 -0
  229. package/dist/development/utils/ucfirst.cjs +5 -0
  230. package/dist/development/utils/ucfirst.cjs.map +1 -0
  231. package/dist/development/utils/ucfirst.js.map +1 -1
  232. package/dist/production/BindingError.cjs +10 -0
  233. package/dist/production/BindingError.cjs.map +1 -0
  234. package/dist/production/accessorTree/NormalizedPersistedData.cjs +10 -0
  235. package/dist/production/accessorTree/NormalizedPersistedData.cjs.map +1 -0
  236. package/dist/production/accessorTree/RuntimeId.cjs +64 -0
  237. package/dist/production/accessorTree/RuntimeId.cjs.map +1 -0
  238. package/dist/production/accessorTree/RuntimeId.js +5 -5
  239. package/dist/production/accessorTree/RuntimeId.js.map +1 -1
  240. package/dist/production/accessors/EntityAccessor.cjs +169 -0
  241. package/dist/production/accessors/EntityAccessor.cjs.map +1 -0
  242. package/dist/production/accessors/EntityAccessor.js +1 -1
  243. package/dist/production/accessors/EntityAccessor.js.map +1 -1
  244. package/dist/production/accessors/EntityListAccessor.cjs +101 -0
  245. package/dist/production/accessors/EntityListAccessor.cjs.map +1 -0
  246. package/dist/production/accessors/ErrorAccessor.cjs +16 -0
  247. package/dist/production/accessors/ErrorAccessor.cjs.map +1 -0
  248. package/dist/production/accessors/FieldAccessor.cjs +59 -0
  249. package/dist/production/accessors/FieldAccessor.cjs.map +1 -0
  250. package/dist/production/accessors/TreeRootAccessor.cjs +14 -0
  251. package/dist/production/accessors/TreeRootAccessor.cjs.map +1 -0
  252. package/dist/production/accessors/TreeRootAccessor.js.map +1 -1
  253. package/dist/production/bindingTypes.cjs +9 -0
  254. package/dist/production/bindingTypes.cjs.map +1 -0
  255. package/dist/production/core/AccessorErrorManager.cjs +207 -0
  256. package/dist/production/core/AccessorErrorManager.cjs.map +1 -0
  257. package/dist/production/core/AccessorErrorManager.js +11 -6
  258. package/dist/production/core/AccessorErrorManager.js.map +1 -1
  259. package/dist/production/core/Config.cjs +32 -0
  260. package/dist/production/core/Config.cjs.map +1 -0
  261. package/dist/production/core/Config.js +3 -3
  262. package/dist/production/core/Config.js.map +1 -1
  263. package/dist/production/core/DataBinding.cjs +352 -0
  264. package/dist/production/core/DataBinding.cjs.map +1 -0
  265. package/dist/production/core/DataBinding.js +56 -49
  266. package/dist/production/core/DataBinding.js.map +1 -1
  267. package/dist/production/core/DirtinessTracker.cjs +29 -0
  268. package/dist/production/core/DirtinessTracker.cjs.map +1 -0
  269. package/dist/production/core/ErrorsPreprocessor.cjs +181 -0
  270. package/dist/production/core/ErrorsPreprocessor.cjs.map +1 -0
  271. package/dist/production/core/ErrorsPreprocessor.js +16 -16
  272. package/dist/production/core/ErrorsPreprocessor.js.map +1 -1
  273. package/dist/production/core/EventManager.cjs +414 -0
  274. package/dist/production/core/EventManager.cjs.map +1 -0
  275. package/dist/production/core/EventManager.js +7 -5
  276. package/dist/production/core/EventManager.js.map +1 -1
  277. package/dist/production/core/MarkerComparator.cjs +79 -0
  278. package/dist/production/core/MarkerComparator.cjs.map +1 -0
  279. package/dist/production/core/MarkerComparator.js.map +1 -1
  280. package/dist/production/core/MarkerMerger.cjs +252 -0
  281. package/dist/production/core/MarkerMerger.cjs.map +1 -0
  282. package/dist/production/core/MarkerMerger.js +2 -2
  283. package/dist/production/core/MarkerMerger.js.map +1 -1
  284. package/dist/production/core/MutationGenerator.cjs +635 -0
  285. package/dist/production/core/MutationGenerator.cjs.map +1 -0
  286. package/dist/production/core/MutationGenerator.js +341 -294
  287. package/dist/production/core/MutationGenerator.js.map +1 -1
  288. package/dist/production/core/QueryGenerator.cjs +113 -0
  289. package/dist/production/core/QueryGenerator.cjs.map +1 -0
  290. package/dist/production/core/QueryGenerator.js +62 -73
  291. package/dist/production/core/QueryGenerator.js.map +1 -1
  292. package/dist/production/core/RealmKeyGenerator.cjs +47 -0
  293. package/dist/production/core/RealmKeyGenerator.cjs.map +1 -0
  294. package/dist/production/core/RealmKeyGenerator.js.map +1 -1
  295. package/dist/production/core/RequestResponseNormalizer.cjs +125 -0
  296. package/dist/production/core/RequestResponseNormalizer.cjs.map +1 -0
  297. package/dist/production/core/StateInitializer.cjs +389 -0
  298. package/dist/production/core/StateInitializer.cjs.map +1 -0
  299. package/dist/production/core/StateInitializer.js +2 -2
  300. package/dist/production/core/StateInitializer.js.map +1 -1
  301. package/dist/production/core/TreeAugmenter.cjs +213 -0
  302. package/dist/production/core/TreeAugmenter.cjs.map +1 -0
  303. package/dist/production/core/TreeFilterGenerator.cjs +83 -0
  304. package/dist/production/core/TreeFilterGenerator.cjs.map +1 -0
  305. package/dist/production/core/TreeParameterMerger.cjs +304 -0
  306. package/dist/production/core/TreeParameterMerger.cjs.map +1 -0
  307. package/dist/production/core/TreeParameterMerger.js +8 -0
  308. package/dist/production/core/TreeParameterMerger.js.map +1 -1
  309. package/dist/production/core/TreeStore.cjs +182 -0
  310. package/dist/production/core/TreeStore.cjs.map +1 -0
  311. package/dist/production/core/TreeStore.js +1 -1
  312. package/dist/production/core/TreeStore.js.map +1 -1
  313. package/dist/production/core/VariableInputTransformer.cjs +24 -0
  314. package/dist/production/core/VariableInputTransformer.cjs.map +1 -0
  315. package/dist/production/core/VariableInputTransformer.js.map +1 -1
  316. package/dist/production/core/exceptions/ErrorLocator.cjs +62 -0
  317. package/dist/production/core/exceptions/ErrorLocator.cjs.map +1 -0
  318. package/dist/production/core/exceptions/LocalizedBindingError.cjs +14 -0
  319. package/dist/production/core/exceptions/LocalizedBindingError.cjs.map +1 -0
  320. package/dist/production/core/exceptions/MarkerSugarer.cjs +56 -0
  321. package/dist/production/core/exceptions/MarkerSugarer.cjs.map +1 -0
  322. package/dist/production/core/exceptions/TreeParameterSugarer.cjs +33 -0
  323. package/dist/production/core/exceptions/TreeParameterSugarer.cjs.map +1 -0
  324. package/dist/production/core/exceptions/TreeParameterSugarer.js.map +1 -1
  325. package/dist/production/core/factories/createBatchUpdatesOptions.cjs +20 -0
  326. package/dist/production/core/factories/createBatchUpdatesOptions.cjs.map +1 -0
  327. package/dist/production/core/factories/createBatchUpdatesOptions.js.map +1 -1
  328. package/dist/production/core/operations/EntityOperations.cjs +238 -0
  329. package/dist/production/core/operations/EntityOperations.cjs.map +1 -0
  330. package/dist/production/core/operations/EntityOperations.js +1 -1
  331. package/dist/production/core/operations/EntityOperations.js.map +1 -1
  332. package/dist/production/core/operations/FieldOperations.cjs +76 -0
  333. package/dist/production/core/operations/FieldOperations.cjs.map +1 -0
  334. package/dist/production/core/operations/FieldOperations.js +1 -1
  335. package/dist/production/core/operations/ListOperations.cjs +159 -0
  336. package/dist/production/core/operations/ListOperations.cjs.map +1 -0
  337. package/dist/production/core/operations/ListOperations.js.map +1 -1
  338. package/dist/production/core/operations/OperationsHelpers.cjs +85 -0
  339. package/dist/production/core/operations/OperationsHelpers.cjs.map +1 -0
  340. package/dist/production/core/operations/OperationsHelpers.js.map +1 -1
  341. package/dist/production/core/requestAliases/MutationAlias.cjs +14 -0
  342. package/dist/production/core/requestAliases/MutationAlias.cjs.map +1 -0
  343. package/dist/production/core/requestAliases/MutationAlias.js.map +1 -1
  344. package/dist/production/core/schema/Schema.cjs +39 -0
  345. package/dist/production/core/schema/Schema.cjs.map +1 -0
  346. package/dist/production/core/schema/Schema.js.map +1 -1
  347. package/dist/production/core/schema/SchemaLoader.cjs +28 -0
  348. package/dist/production/core/schema/SchemaLoader.cjs.map +1 -0
  349. package/dist/production/core/schema/SchemaLoader.js +2 -2
  350. package/dist/production/core/schema/SchemaLoader.js.map +1 -1
  351. package/dist/production/core/schema/SchemaPreprocessor.cjs +38 -0
  352. package/dist/production/core/schema/SchemaPreprocessor.cjs.map +1 -0
  353. package/dist/production/core/state/StateIterator.cjs +100 -0
  354. package/dist/production/core/state/StateIterator.cjs.map +1 -0
  355. package/dist/production/core/state/getEntityMarker.cjs +5 -0
  356. package/dist/production/core/state/getEntityMarker.cjs.map +1 -0
  357. package/dist/production/core/utils/createQueryBuilder.cjs +32 -0
  358. package/dist/production/core/utils/createQueryBuilder.cjs.map +1 -0
  359. package/dist/production/core/utils/createQueryBuilder.js +32 -0
  360. package/dist/production/core/utils/createQueryBuilder.js.map +1 -0
  361. package/dist/production/core/utils/getCombinedSignal.cjs +33 -0
  362. package/dist/production/core/utils/getCombinedSignal.cjs.map +1 -0
  363. package/dist/production/dao/Environment.cjs +213 -0
  364. package/dist/production/dao/Environment.cjs.map +1 -0
  365. package/dist/production/dao/Environment.js.map +1 -1
  366. package/dist/production/dao/TreeNodeEnvironmentFactory.cjs +89 -0
  367. package/dist/production/dao/TreeNodeEnvironmentFactory.cjs.map +1 -0
  368. package/dist/production/dao/VariableFieldValue.cjs +9 -0
  369. package/dist/production/dao/VariableFieldValue.cjs.map +1 -0
  370. package/dist/production/fieldHelpers/helpers/FieldHelper.cjs +17 -0
  371. package/dist/production/fieldHelpers/helpers/FieldHelper.cjs.map +1 -0
  372. package/dist/production/fieldHelpers/helpers/TemporalFieldHelper.cjs +18 -0
  373. package/dist/production/fieldHelpers/helpers/TemporalFieldHelper.cjs.map +1 -0
  374. package/dist/production/fieldHelpers/helpers/UuidFieldHelper.cjs +16 -0
  375. package/dist/production/fieldHelpers/helpers/UuidFieldHelper.cjs.map +1 -0
  376. package/dist/production/index.cjs +124 -0
  377. package/dist/production/index.cjs.map +1 -0
  378. package/dist/production/index.js +18 -135
  379. package/dist/production/index.js.map +1 -1
  380. package/dist/production/markers/EntityFieldMarkersContainer.cjs +41 -0
  381. package/dist/production/markers/EntityFieldMarkersContainer.cjs.map +1 -0
  382. package/dist/production/markers/EntityFieldsWithHoistablesMarker.cjs +11 -0
  383. package/dist/production/markers/EntityFieldsWithHoistablesMarker.cjs.map +1 -0
  384. package/dist/production/markers/EntityListSubTreeMarker.cjs +23 -0
  385. package/dist/production/markers/EntityListSubTreeMarker.cjs.map +1 -0
  386. package/dist/production/markers/EntitySubTreeMarker.cjs +23 -0
  387. package/dist/production/markers/EntitySubTreeMarker.cjs.map +1 -0
  388. package/dist/production/markers/FieldMarker.cjs +20 -0
  389. package/dist/production/markers/FieldMarker.cjs.map +1 -0
  390. package/dist/production/markers/HasManyRelationMarker.cjs +23 -0
  391. package/dist/production/markers/HasManyRelationMarker.cjs.map +1 -0
  392. package/dist/production/markers/HasOneRelationMarker.cjs +23 -0
  393. package/dist/production/markers/HasOneRelationMarker.cjs.map +1 -0
  394. package/dist/production/markers/MarkerTreeRoot.cjs +10 -0
  395. package/dist/production/markers/MarkerTreeRoot.cjs.map +1 -0
  396. package/dist/production/markers/ParentEntityMarker.cjs +10 -0
  397. package/dist/production/markers/ParentEntityMarker.cjs.map +1 -0
  398. package/dist/production/markers/PlaceholderGenerator.cjs +23 -0
  399. package/dist/production/markers/PlaceholderGenerator.cjs.map +1 -0
  400. package/dist/production/markers/PlaceholderGenerator.js.map +1 -1
  401. package/dist/production/markers/PlaceholderParametersGenerator.cjs +62 -0
  402. package/dist/production/markers/PlaceholderParametersGenerator.cjs.map +1 -0
  403. package/dist/production/queryLanguage/CacheStore.cjs +47 -0
  404. package/dist/production/queryLanguage/CacheStore.cjs.map +1 -0
  405. package/dist/production/queryLanguage/CacheStore.js +2 -1
  406. package/dist/production/queryLanguage/CacheStore.js.map +1 -1
  407. package/dist/production/queryLanguage/MarkerFactory.cjs +200 -0
  408. package/dist/production/queryLanguage/MarkerFactory.cjs.map +1 -0
  409. package/dist/production/queryLanguage/MarkerFactory.js +1 -1
  410. package/dist/production/queryLanguage/Parser.cjs +725 -0
  411. package/dist/production/queryLanguage/Parser.cjs.map +1 -0
  412. package/dist/production/queryLanguage/Parser.js +70 -29
  413. package/dist/production/queryLanguage/Parser.js.map +1 -1
  414. package/dist/production/queryLanguage/QueryLanguage.cjs +517 -0
  415. package/dist/production/queryLanguage/QueryLanguage.cjs.map +1 -0
  416. package/dist/production/queryLanguage/QueryLanguage.js +16 -14
  417. package/dist/production/queryLanguage/QueryLanguage.js.map +1 -1
  418. package/dist/production/queryLanguage/QueryLanguageError.cjs +6 -0
  419. package/dist/production/queryLanguage/QueryLanguageError.cjs.map +1 -0
  420. package/dist/production/queryLanguage/tokenList.cjs +150 -0
  421. package/dist/production/queryLanguage/tokenList.cjs.map +1 -0
  422. package/dist/production/queryLanguage/tokenList.js +1 -1
  423. package/dist/production/queryLanguage/tokenList.js.map +1 -1
  424. package/dist/production/structures/BijectiveIndexedMap.cjs +120 -0
  425. package/dist/production/structures/BijectiveIndexedMap.cjs.map +1 -0
  426. package/dist/production/structures/LRUCache.cjs +35 -0
  427. package/dist/production/structures/LRUCache.cjs.map +1 -0
  428. package/dist/production/structures/WeakIdCache.cjs +33 -0
  429. package/dist/production/structures/WeakIdCache.cjs.map +1 -0
  430. package/dist/production/treeParameterHelpers/wrapFilterInHasOnes.cjs +22 -0
  431. package/dist/production/treeParameterHelpers/wrapFilterInHasOnes.cjs.map +1 -0
  432. package/dist/production/treeParameters/EntityCreationParameters.cjs +8 -0
  433. package/dist/production/treeParameters/EntityCreationParameters.cjs.map +1 -0
  434. package/dist/production/treeParameters/EntityListPreferences.cjs +7 -0
  435. package/dist/production/treeParameters/EntityListPreferences.cjs.map +1 -0
  436. package/dist/production/treeParameters/EventListenersStore.cjs +70 -0
  437. package/dist/production/treeParameters/EventListenersStore.cjs.map +1 -0
  438. package/dist/production/treeParameters/EventListenersStore.js.map +1 -1
  439. package/dist/production/treeParameters/LeafField.cjs +7 -0
  440. package/dist/production/treeParameters/LeafField.cjs.map +1 -0
  441. package/dist/production/treeParameters/QualifiedEntityParameters.cjs +7 -0
  442. package/dist/production/treeParameters/QualifiedEntityParameters.cjs.map +1 -0
  443. package/dist/production/treeParameters/Relation.cjs +7 -0
  444. package/dist/production/treeParameters/Relation.cjs.map +1 -0
  445. package/dist/production/utils/Hashing.cjs +22 -0
  446. package/dist/production/utils/Hashing.cjs.map +1 -0
  447. package/dist/production/utils/TreeNodeUtils.cjs +77 -0
  448. package/dist/production/utils/TreeNodeUtils.cjs.map +1 -0
  449. package/dist/production/utils/TreeNodeUtils.js.map +1 -1
  450. package/dist/production/utils/assert.cjs +11 -0
  451. package/dist/production/utils/assert.cjs.map +1 -0
  452. package/dist/production/utils/assert.js.map +1 -1
  453. package/dist/production/utils/assertNever.cjs +10 -0
  454. package/dist/production/utils/assertNever.cjs.map +1 -0
  455. package/dist/production/utils/generateEnumerabilityPreventingEntropy.cjs +7 -0
  456. package/dist/production/utils/generateEnumerabilityPreventingEntropy.cjs.map +1 -0
  457. package/dist/production/utils/isEmptyObject.cjs +12 -0
  458. package/dist/production/utils/isEmptyObject.cjs.map +1 -0
  459. package/dist/production/utils/ucfirst.cjs +5 -0
  460. package/dist/production/utils/ucfirst.cjs.map +1 -0
  461. package/dist/production/utils/ucfirst.js.map +1 -1
  462. package/dist/types/accessorTree/PersistResult.d.ts +1 -2
  463. package/dist/types/accessorTree/PersistResult.d.ts.map +1 -1
  464. package/dist/types/accessorTree/index.d.ts +0 -15
  465. package/dist/types/accessorTree/index.d.ts.map +1 -1
  466. package/dist/types/accessors/BindingOperations.d.ts +2 -2
  467. package/dist/types/accessors/BindingOperations.d.ts.map +1 -1
  468. package/dist/types/accessors/EntityAccessor.d.ts +2 -2
  469. package/dist/types/accessors/EntityAccessor.d.ts.map +1 -1
  470. package/dist/types/accessors/ExtendTree.d.ts +1 -2
  471. package/dist/types/accessors/ExtendTree.d.ts.map +1 -1
  472. package/dist/types/accessors/TreeRootAccessor.d.ts +3 -3
  473. package/dist/types/accessors/TreeRootAccessor.d.ts.map +1 -1
  474. package/dist/types/core/AccessorErrorManager.d.ts +2 -2
  475. package/dist/types/core/AccessorErrorManager.d.ts.map +1 -1
  476. package/dist/types/core/DataBinding.d.ts +11 -6
  477. package/dist/types/core/DataBinding.d.ts.map +1 -1
  478. package/dist/types/core/ErrorsPreprocessor.d.ts +2 -2
  479. package/dist/types/core/ErrorsPreprocessor.d.ts.map +1 -1
  480. package/dist/types/core/EventManager.d.ts +2 -1
  481. package/dist/types/core/EventManager.d.ts.map +1 -1
  482. package/dist/types/core/MutationGenerator.d.ts +16 -13
  483. package/dist/types/core/MutationGenerator.d.ts.map +1 -1
  484. package/dist/types/core/QueryGenerator.d.ts +6 -8
  485. package/dist/types/core/QueryGenerator.d.ts.map +1 -1
  486. package/dist/types/core/TreeParameterMerger.d.ts.map +1 -1
  487. package/dist/types/core/index.d.ts +7 -1
  488. package/dist/types/core/index.d.ts.map +1 -1
  489. package/dist/types/core/schema/index.d.ts +2 -0
  490. package/dist/types/core/schema/index.d.ts.map +1 -1
  491. package/dist/types/core/state/EntityListState.d.ts +2 -0
  492. package/dist/types/core/state/EntityListState.d.ts.map +1 -1
  493. package/dist/types/core/utils/createQueryBuilder.d.ts +4 -0
  494. package/dist/types/core/utils/createQueryBuilder.d.ts.map +1 -0
  495. package/dist/types/dao/Environment.d.ts +5 -2
  496. package/dist/types/dao/Environment.d.ts.map +1 -1
  497. package/dist/types/dao/index.d.ts +1 -0
  498. package/dist/types/dao/index.d.ts.map +1 -1
  499. package/dist/types/index.d.ts +0 -5
  500. package/dist/types/index.d.ts.map +1 -1
  501. package/dist/types/queryLanguage/CacheStore.d.ts.map +1 -1
  502. package/dist/types/queryLanguage/Parser.d.ts +3 -2
  503. package/dist/types/queryLanguage/Parser.d.ts.map +1 -1
  504. package/dist/types/queryLanguage/QueryLanguage.d.ts.map +1 -1
  505. package/dist/types/treeParameters/EventListenersStore.d.ts +2 -1
  506. package/dist/types/treeParameters/EventListenersStore.d.ts.map +1 -1
  507. package/dist/types/treeParameters/UnconstrainedQualifiedEntityList.d.ts +2 -0
  508. package/dist/types/treeParameters/UnconstrainedQualifiedEntityList.d.ts.map +1 -1
  509. package/dist/types/treeParameters/UnconstrainedQualifiedSingleEntity.d.ts +2 -0
  510. package/dist/types/treeParameters/UnconstrainedQualifiedSingleEntity.d.ts.map +1 -1
  511. package/dist/types/tsconfig.tsbuildinfo +1 -1
  512. package/package.json +13 -15
  513. package/src/accessorTree/PersistResult.ts +1 -2
  514. package/src/accessorTree/index.ts +0 -15
  515. package/src/accessors/BindingOperations.ts +2 -2
  516. package/src/accessors/EntityAccessor.ts +2 -2
  517. package/src/accessors/ExtendTree.ts +1 -2
  518. package/src/accessors/TreeRootAccessor.ts +2 -2
  519. package/src/core/AccessorErrorManager.ts +17 -10
  520. package/src/core/DataBinding.ts +76 -75
  521. package/src/core/ErrorsPreprocessor.ts +24 -23
  522. package/src/core/EventManager.ts +6 -3
  523. package/src/core/MutationGenerator.ts +411 -412
  524. package/src/core/QueryGenerator.ts +66 -112
  525. package/src/core/StateInitializer.ts +2 -2
  526. package/src/core/TreeParameterMerger.ts +8 -0
  527. package/src/core/index.ts +7 -1
  528. package/src/core/schema/SchemaLoader.ts +2 -2
  529. package/src/core/schema/index.ts +2 -0
  530. package/src/core/state/EntityListState.ts +2 -0
  531. package/src/core/utils/createQueryBuilder.ts +31 -0
  532. package/src/dao/Environment.ts +6 -2
  533. package/src/dao/index.ts +1 -0
  534. package/src/index.ts +0 -5
  535. package/src/queryLanguage/CacheStore.ts +1 -0
  536. package/src/queryLanguage/Parser.ts +76 -37
  537. package/src/queryLanguage/QueryLanguage.ts +4 -1
  538. package/src/queryLanguage/tokenList.ts +1 -1
  539. package/src/treeParameters/EventListenersStore.ts +2 -1
  540. package/src/treeParameters/UnconstrainedQualifiedEntityList.ts +2 -0
  541. package/src/treeParameters/UnconstrainedQualifiedSingleEntity.ts +2 -0
  542. package/src/tsconfig.json +1 -4
  543. package/dist/development/accessorPropagation/AccessorProvider.js +0 -18
  544. package/dist/development/accessorPropagation/AccessorProvider.js.map +0 -1
  545. package/dist/development/accessorPropagation/BindingOperationsContext.js +0 -31
  546. package/dist/development/accessorPropagation/BindingOperationsContext.js.map +0 -1
  547. package/dist/development/accessorPropagation/BindingOperationsProvider.js +0 -13
  548. package/dist/development/accessorPropagation/BindingOperationsProvider.js.map +0 -1
  549. package/dist/development/accessorPropagation/EntityKeyContext.js +0 -7
  550. package/dist/development/accessorPropagation/EntityKeyContext.js.map +0 -1
  551. package/dist/development/accessorPropagation/EntityKeyProvider.js +0 -13
  552. package/dist/development/accessorPropagation/EntityKeyProvider.js.map +0 -1
  553. package/dist/development/accessorPropagation/EnvironmentContext.js +0 -53
  554. package/dist/development/accessorPropagation/EnvironmentContext.js.map +0 -1
  555. package/dist/development/accessorPropagation/TreeRootIdContext.js +0 -7
  556. package/dist/development/accessorPropagation/TreeRootIdContext.js.map +0 -1
  557. package/dist/development/accessorPropagation/TreeRootIdProvider.js +0 -13
  558. package/dist/development/accessorPropagation/TreeRootIdProvider.js.map +0 -1
  559. package/dist/development/accessorPropagation/useAccessorUpdateSubscription.js +0 -55
  560. package/dist/development/accessorPropagation/useAccessorUpdateSubscription.js.map +0 -1
  561. package/dist/development/accessorPropagation/useBindingOperations.js +0 -7
  562. package/dist/development/accessorPropagation/useBindingOperations.js.map +0 -1
  563. package/dist/development/accessorPropagation/useDesugaredRelativeEntityList.js +0 -47
  564. package/dist/development/accessorPropagation/useDesugaredRelativeEntityList.js.map +0 -1
  565. package/dist/development/accessorPropagation/useDesugaredRelativeSingleEntity.js +0 -35
  566. package/dist/development/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +0 -1
  567. package/dist/development/accessorPropagation/useDesugaredRelativeSingleField.js +0 -35
  568. package/dist/development/accessorPropagation/useDesugaredRelativeSingleField.js.map +0 -1
  569. package/dist/development/accessorPropagation/useEntity.js +0 -38
  570. package/dist/development/accessorPropagation/useEntity.js.map +0 -1
  571. package/dist/development/accessorPropagation/useEntityKey.js +0 -16
  572. package/dist/development/accessorPropagation/useEntityKey.js.map +0 -1
  573. package/dist/development/accessorPropagation/useEntityList.js +0 -36
  574. package/dist/development/accessorPropagation/useEntityList.js.map +0 -1
  575. package/dist/development/accessorPropagation/useEntityListSubTree.js +0 -19
  576. package/dist/development/accessorPropagation/useEntityListSubTree.js.map +0 -1
  577. package/dist/development/accessorPropagation/useEntityListSubTreeParameters.js +0 -69
  578. package/dist/development/accessorPropagation/useEntityListSubTreeParameters.js.map +0 -1
  579. package/dist/development/accessorPropagation/useEntitySubTree.js +0 -19
  580. package/dist/development/accessorPropagation/useEntitySubTree.js.map +0 -1
  581. package/dist/development/accessorPropagation/useEntitySubTreeParameters.js +0 -47
  582. package/dist/development/accessorPropagation/useEntitySubTreeParameters.js.map +0 -1
  583. package/dist/development/accessorPropagation/useEnvironment.js +0 -9
  584. package/dist/development/accessorPropagation/useEnvironment.js.map +0 -1
  585. package/dist/development/accessorPropagation/useExtendTree.js +0 -32
  586. package/dist/development/accessorPropagation/useExtendTree.js.map +0 -1
  587. package/dist/development/accessorPropagation/useField.js +0 -36
  588. package/dist/development/accessorPropagation/useField.js.map +0 -1
  589. package/dist/development/accessorPropagation/useGetEntityByKey.js +0 -6
  590. package/dist/development/accessorPropagation/useGetEntityByKey.js.map +0 -1
  591. package/dist/development/accessorPropagation/useGetEntityListSubTree.js +0 -17
  592. package/dist/development/accessorPropagation/useGetEntityListSubTree.js.map +0 -1
  593. package/dist/development/accessorPropagation/useGetEntitySubTree.js +0 -17
  594. package/dist/development/accessorPropagation/useGetEntitySubTree.js.map +0 -1
  595. package/dist/development/accessorPropagation/useGetTreeFilters.js +0 -6
  596. package/dist/development/accessorPropagation/useGetTreeFilters.js.map +0 -1
  597. package/dist/development/accessorPropagation/useHasEntity.js +0 -9
  598. package/dist/development/accessorPropagation/useHasEntity.js.map +0 -1
  599. package/dist/development/accessorPropagation/usePersist.js +0 -6
  600. package/dist/development/accessorPropagation/usePersist.js.map +0 -1
  601. package/dist/development/accessorPropagation/useTreeRootId.js +0 -7
  602. package/dist/development/accessorPropagation/useTreeRootId.js.map +0 -1
  603. package/dist/development/accessorSorting/SetOrderFieldOnCreate.js +0 -118
  604. package/dist/development/accessorSorting/SetOrderFieldOnCreate.js.map +0 -1
  605. package/dist/development/accessorSorting/addEntityAtIndex.js +0 -18
  606. package/dist/development/accessorSorting/addEntityAtIndex.js.map +0 -1
  607. package/dist/development/accessorSorting/errors.js +0 -10
  608. package/dist/development/accessorSorting/errors.js.map +0 -1
  609. package/dist/development/accessorSorting/moveEntity.js +0 -42
  610. package/dist/development/accessorSorting/moveEntity.js.map +0 -1
  611. package/dist/development/accessorSorting/repairEntitiesOrder.js +0 -13
  612. package/dist/development/accessorSorting/repairEntitiesOrder.js.map +0 -1
  613. package/dist/development/accessorSorting/sortEntities.js +0 -17
  614. package/dist/development/accessorSorting/sortEntities.js.map +0 -1
  615. package/dist/development/accessorSorting/useSortedEntities.js +0 -80
  616. package/dist/development/accessorSorting/useSortedEntities.js.map +0 -1
  617. package/dist/development/accessorTree/AccessorTree.js +0 -39
  618. package/dist/development/accessorTree/AccessorTree.js.map +0 -1
  619. package/dist/development/accessorTree/AccessorTreeStateContext.js +0 -6
  620. package/dist/development/accessorTree/AccessorTreeStateContext.js.map +0 -1
  621. package/dist/development/accessorTree/DirtinessContext.js +0 -7
  622. package/dist/development/accessorTree/DirtinessContext.js.map +0 -1
  623. package/dist/development/accessorTree/MutationStateContext.js +0 -7
  624. package/dist/development/accessorTree/MutationStateContext.js.map +0 -1
  625. package/dist/development/accessorTree/accessorTreeStateReducer.js +0 -34
  626. package/dist/development/accessorTree/accessorTreeStateReducer.js.map +0 -1
  627. package/dist/development/accessorTree/metadataToRequestError.js +0 -15
  628. package/dist/development/accessorTree/metadataToRequestError.js.map +0 -1
  629. package/dist/development/accessorTree/useAccessorTreeState.js +0 -14
  630. package/dist/development/accessorTree/useAccessorTreeState.js.map +0 -1
  631. package/dist/development/accessorTree/useDataBinding.js +0 -84
  632. package/dist/development/accessorTree/useDataBinding.js.map +0 -1
  633. package/dist/development/accessorTree/useDirtinessState.js +0 -7
  634. package/dist/development/accessorTree/useDirtinessState.js.map +0 -1
  635. package/dist/development/accessorTree/useMutationState.js +0 -7
  636. package/dist/development/accessorTree/useMutationState.js.map +0 -1
  637. package/dist/development/core/IncrementalMarkerBuilder.js +0 -70
  638. package/dist/development/core/IncrementalMarkerBuilder.js.map +0 -1
  639. package/dist/development/core/MarkerTreeGenerator.js +0 -95
  640. package/dist/development/core/MarkerTreeGenerator.js.map +0 -1
  641. package/dist/development/coreComponents/Component.js +0 -33
  642. package/dist/development/coreComponents/Component.js.map +0 -1
  643. package/dist/development/coreComponents/DataBindingProvider.js +0 -24
  644. package/dist/development/coreComponents/DataBindingProvider.js.map +0 -1
  645. package/dist/development/coreComponents/Entity.js +0 -20
  646. package/dist/development/coreComponents/Entity.js.map +0 -1
  647. package/dist/development/coreComponents/EntityList.js +0 -45
  648. package/dist/development/coreComponents/EntityList.js.map +0 -1
  649. package/dist/development/coreComponents/EntityListSubTree.js +0 -58
  650. package/dist/development/coreComponents/EntityListSubTree.js.map +0 -1
  651. package/dist/development/coreComponents/EntitySubTree.js +0 -81
  652. package/dist/development/coreComponents/EntitySubTree.js.map +0 -1
  653. package/dist/development/coreComponents/Field.js +0 -37
  654. package/dist/development/coreComponents/Field.js.map +0 -1
  655. package/dist/development/coreComponents/HasMany.js +0 -42
  656. package/dist/development/coreComponents/HasMany.js.map +0 -1
  657. package/dist/development/coreComponents/HasOne.js +0 -42
  658. package/dist/development/coreComponents/HasOne.js.map +0 -1
  659. package/dist/development/coreComponents/ParentEntity.js +0 -18
  660. package/dist/development/coreComponents/ParentEntity.js.map +0 -1
  661. package/dist/development/entityEvents/useDerivedField.js +0 -42
  662. package/dist/development/entityEvents/useDerivedField.js.map +0 -1
  663. package/dist/development/entityEvents/useEntityBeforePersist.js +0 -8
  664. package/dist/development/entityEvents/useEntityBeforePersist.js.map +0 -1
  665. package/dist/development/entityEvents/useEntityBeforeUpdate.js +0 -8
  666. package/dist/development/entityEvents/useEntityBeforeUpdate.js.map +0 -1
  667. package/dist/development/entityEvents/useEntityEvent.js +0 -32
  668. package/dist/development/entityEvents/useEntityEvent.js.map +0 -1
  669. package/dist/development/entityEvents/useEntityPersistError.js +0 -8
  670. package/dist/development/entityEvents/useEntityPersistError.js.map +0 -1
  671. package/dist/development/entityEvents/useEntityPersistSuccess.js +0 -8
  672. package/dist/development/entityEvents/useEntityPersistSuccess.js.map +0 -1
  673. package/dist/development/entityEvents/useOnConnectionUpdate.js +0 -8
  674. package/dist/development/entityEvents/useOnConnectionUpdate.js.map +0 -1
  675. package/dist/development/helperComponents/DeferredSubTrees.js +0 -105
  676. package/dist/development/helperComponents/DeferredSubTrees.js.map +0 -1
  677. package/dist/development/helperComponents/EntityView.js +0 -14
  678. package/dist/development/helperComponents/EntityView.js.map +0 -1
  679. package/dist/development/helperComponents/FieldView.js +0 -61
  680. package/dist/development/helperComponents/FieldView.js.map +0 -1
  681. package/dist/development/helperComponents/If.js +0 -84
  682. package/dist/development/helperComponents/If.js.map +0 -1
  683. package/dist/development/helperComponents/StaticRender.js +0 -15
  684. package/dist/development/helperComponents/StaticRender.js.map +0 -1
  685. package/dist/development/helperComponents/SugaredField.js +0 -21
  686. package/dist/development/helperComponents/SugaredField.js.map +0 -1
  687. package/dist/development/helperComponents/helpers/FilterEvaluator.js +0 -37
  688. package/dist/development/helperComponents/helpers/FilterEvaluator.js.map +0 -1
  689. package/dist/development/helperComponents/helpers/FilterFieldsCollector.js +0 -40
  690. package/dist/development/helperComponents/helpers/FilterFieldsCollector.js.map +0 -1
  691. package/dist/development/helperComponents/helpers/evaluateCondition.js +0 -49
  692. package/dist/development/helperComponents/helpers/evaluateCondition.js.map +0 -1
  693. package/dist/production/accessorPropagation/AccessorProvider.js +0 -10
  694. package/dist/production/accessorPropagation/AccessorProvider.js.map +0 -1
  695. package/dist/production/accessorPropagation/BindingOperationsContext.js +0 -31
  696. package/dist/production/accessorPropagation/BindingOperationsContext.js.map +0 -1
  697. package/dist/production/accessorPropagation/BindingOperationsProvider.js +0 -9
  698. package/dist/production/accessorPropagation/BindingOperationsProvider.js.map +0 -1
  699. package/dist/production/accessorPropagation/EntityKeyContext.js +0 -7
  700. package/dist/production/accessorPropagation/EntityKeyContext.js.map +0 -1
  701. package/dist/production/accessorPropagation/EntityKeyProvider.js +0 -9
  702. package/dist/production/accessorPropagation/EntityKeyProvider.js.map +0 -1
  703. package/dist/production/accessorPropagation/EnvironmentContext.js +0 -37
  704. package/dist/production/accessorPropagation/EnvironmentContext.js.map +0 -1
  705. package/dist/production/accessorPropagation/TreeRootIdContext.js +0 -7
  706. package/dist/production/accessorPropagation/TreeRootIdContext.js.map +0 -1
  707. package/dist/production/accessorPropagation/TreeRootIdProvider.js +0 -9
  708. package/dist/production/accessorPropagation/TreeRootIdProvider.js.map +0 -1
  709. package/dist/production/accessorPropagation/useAccessorUpdateSubscription.js +0 -55
  710. package/dist/production/accessorPropagation/useAccessorUpdateSubscription.js.map +0 -1
  711. package/dist/production/accessorPropagation/useBindingOperations.js +0 -7
  712. package/dist/production/accessorPropagation/useBindingOperations.js.map +0 -1
  713. package/dist/production/accessorPropagation/useDesugaredRelativeEntityList.js +0 -47
  714. package/dist/production/accessorPropagation/useDesugaredRelativeEntityList.js.map +0 -1
  715. package/dist/production/accessorPropagation/useDesugaredRelativeSingleEntity.js +0 -35
  716. package/dist/production/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +0 -1
  717. package/dist/production/accessorPropagation/useDesugaredRelativeSingleField.js +0 -35
  718. package/dist/production/accessorPropagation/useDesugaredRelativeSingleField.js.map +0 -1
  719. package/dist/production/accessorPropagation/useEntity.js +0 -38
  720. package/dist/production/accessorPropagation/useEntity.js.map +0 -1
  721. package/dist/production/accessorPropagation/useEntityKey.js +0 -16
  722. package/dist/production/accessorPropagation/useEntityKey.js.map +0 -1
  723. package/dist/production/accessorPropagation/useEntityList.js +0 -36
  724. package/dist/production/accessorPropagation/useEntityList.js.map +0 -1
  725. package/dist/production/accessorPropagation/useEntityListSubTree.js +0 -19
  726. package/dist/production/accessorPropagation/useEntityListSubTree.js.map +0 -1
  727. package/dist/production/accessorPropagation/useEntityListSubTreeParameters.js +0 -69
  728. package/dist/production/accessorPropagation/useEntityListSubTreeParameters.js.map +0 -1
  729. package/dist/production/accessorPropagation/useEntitySubTree.js +0 -19
  730. package/dist/production/accessorPropagation/useEntitySubTree.js.map +0 -1
  731. package/dist/production/accessorPropagation/useEntitySubTreeParameters.js +0 -47
  732. package/dist/production/accessorPropagation/useEntitySubTreeParameters.js.map +0 -1
  733. package/dist/production/accessorPropagation/useEnvironment.js +0 -9
  734. package/dist/production/accessorPropagation/useEnvironment.js.map +0 -1
  735. package/dist/production/accessorPropagation/useExtendTree.js +0 -32
  736. package/dist/production/accessorPropagation/useExtendTree.js.map +0 -1
  737. package/dist/production/accessorPropagation/useField.js +0 -36
  738. package/dist/production/accessorPropagation/useField.js.map +0 -1
  739. package/dist/production/accessorPropagation/useGetEntityByKey.js +0 -6
  740. package/dist/production/accessorPropagation/useGetEntityByKey.js.map +0 -1
  741. package/dist/production/accessorPropagation/useGetEntityListSubTree.js +0 -17
  742. package/dist/production/accessorPropagation/useGetEntityListSubTree.js.map +0 -1
  743. package/dist/production/accessorPropagation/useGetEntitySubTree.js +0 -17
  744. package/dist/production/accessorPropagation/useGetEntitySubTree.js.map +0 -1
  745. package/dist/production/accessorPropagation/useGetTreeFilters.js +0 -6
  746. package/dist/production/accessorPropagation/useGetTreeFilters.js.map +0 -1
  747. package/dist/production/accessorPropagation/useHasEntity.js +0 -9
  748. package/dist/production/accessorPropagation/useHasEntity.js.map +0 -1
  749. package/dist/production/accessorPropagation/usePersist.js +0 -6
  750. package/dist/production/accessorPropagation/usePersist.js.map +0 -1
  751. package/dist/production/accessorPropagation/useTreeRootId.js +0 -7
  752. package/dist/production/accessorPropagation/useTreeRootId.js.map +0 -1
  753. package/dist/production/accessorSorting/SetOrderFieldOnCreate.js +0 -74
  754. package/dist/production/accessorSorting/SetOrderFieldOnCreate.js.map +0 -1
  755. package/dist/production/accessorSorting/addEntityAtIndex.js +0 -18
  756. package/dist/production/accessorSorting/addEntityAtIndex.js.map +0 -1
  757. package/dist/production/accessorSorting/errors.js +0 -10
  758. package/dist/production/accessorSorting/errors.js.map +0 -1
  759. package/dist/production/accessorSorting/moveEntity.js +0 -42
  760. package/dist/production/accessorSorting/moveEntity.js.map +0 -1
  761. package/dist/production/accessorSorting/repairEntitiesOrder.js +0 -13
  762. package/dist/production/accessorSorting/repairEntitiesOrder.js.map +0 -1
  763. package/dist/production/accessorSorting/sortEntities.js +0 -17
  764. package/dist/production/accessorSorting/sortEntities.js.map +0 -1
  765. package/dist/production/accessorSorting/useSortedEntities.js +0 -80
  766. package/dist/production/accessorSorting/useSortedEntities.js.map +0 -1
  767. package/dist/production/accessorTree/AccessorTree.js +0 -19
  768. package/dist/production/accessorTree/AccessorTree.js.map +0 -1
  769. package/dist/production/accessorTree/AccessorTreeStateContext.js +0 -6
  770. package/dist/production/accessorTree/AccessorTreeStateContext.js.map +0 -1
  771. package/dist/production/accessorTree/DirtinessContext.js +0 -7
  772. package/dist/production/accessorTree/DirtinessContext.js.map +0 -1
  773. package/dist/production/accessorTree/MutationStateContext.js +0 -7
  774. package/dist/production/accessorTree/MutationStateContext.js.map +0 -1
  775. package/dist/production/accessorTree/accessorTreeStateReducer.js +0 -34
  776. package/dist/production/accessorTree/accessorTreeStateReducer.js.map +0 -1
  777. package/dist/production/accessorTree/metadataToRequestError.js +0 -15
  778. package/dist/production/accessorTree/metadataToRequestError.js.map +0 -1
  779. package/dist/production/accessorTree/useAccessorTreeState.js +0 -14
  780. package/dist/production/accessorTree/useAccessorTreeState.js.map +0 -1
  781. package/dist/production/accessorTree/useDataBinding.js +0 -84
  782. package/dist/production/accessorTree/useDataBinding.js.map +0 -1
  783. package/dist/production/accessorTree/useDirtinessState.js +0 -7
  784. package/dist/production/accessorTree/useDirtinessState.js.map +0 -1
  785. package/dist/production/accessorTree/useMutationState.js +0 -7
  786. package/dist/production/accessorTree/useMutationState.js.map +0 -1
  787. package/dist/production/core/IncrementalMarkerBuilder.js +0 -70
  788. package/dist/production/core/IncrementalMarkerBuilder.js.map +0 -1
  789. package/dist/production/core/MarkerTreeGenerator.js +0 -95
  790. package/dist/production/core/MarkerTreeGenerator.js.map +0 -1
  791. package/dist/production/coreComponents/Component.js +0 -33
  792. package/dist/production/coreComponents/Component.js.map +0 -1
  793. package/dist/production/coreComponents/DataBindingProvider.js +0 -20
  794. package/dist/production/coreComponents/DataBindingProvider.js.map +0 -1
  795. package/dist/production/coreComponents/Entity.js +0 -16
  796. package/dist/production/coreComponents/Entity.js.map +0 -1
  797. package/dist/production/coreComponents/EntityList.js +0 -33
  798. package/dist/production/coreComponents/EntityList.js.map +0 -1
  799. package/dist/production/coreComponents/EntityListSubTree.js +0 -46
  800. package/dist/production/coreComponents/EntityListSubTree.js.map +0 -1
  801. package/dist/production/coreComponents/EntitySubTree.js +0 -57
  802. package/dist/production/coreComponents/EntitySubTree.js.map +0 -1
  803. package/dist/production/coreComponents/Field.js +0 -29
  804. package/dist/production/coreComponents/Field.js.map +0 -1
  805. package/dist/production/coreComponents/HasMany.js +0 -30
  806. package/dist/production/coreComponents/HasMany.js.map +0 -1
  807. package/dist/production/coreComponents/HasOne.js +0 -30
  808. package/dist/production/coreComponents/HasOne.js.map +0 -1
  809. package/dist/production/coreComponents/ParentEntity.js +0 -14
  810. package/dist/production/coreComponents/ParentEntity.js.map +0 -1
  811. package/dist/production/entityEvents/useDerivedField.js +0 -42
  812. package/dist/production/entityEvents/useDerivedField.js.map +0 -1
  813. package/dist/production/entityEvents/useEntityBeforePersist.js +0 -8
  814. package/dist/production/entityEvents/useEntityBeforePersist.js.map +0 -1
  815. package/dist/production/entityEvents/useEntityBeforeUpdate.js +0 -8
  816. package/dist/production/entityEvents/useEntityBeforeUpdate.js.map +0 -1
  817. package/dist/production/entityEvents/useEntityEvent.js +0 -32
  818. package/dist/production/entityEvents/useEntityEvent.js.map +0 -1
  819. package/dist/production/entityEvents/useEntityPersistError.js +0 -8
  820. package/dist/production/entityEvents/useEntityPersistError.js.map +0 -1
  821. package/dist/production/entityEvents/useEntityPersistSuccess.js +0 -8
  822. package/dist/production/entityEvents/useEntityPersistSuccess.js.map +0 -1
  823. package/dist/production/entityEvents/useOnConnectionUpdate.js +0 -8
  824. package/dist/production/entityEvents/useOnConnectionUpdate.js.map +0 -1
  825. package/dist/production/helperComponents/DeferredSubTrees.js +0 -89
  826. package/dist/production/helperComponents/DeferredSubTrees.js.map +0 -1
  827. package/dist/production/helperComponents/EntityView.js +0 -10
  828. package/dist/production/helperComponents/EntityView.js.map +0 -1
  829. package/dist/production/helperComponents/FieldView.js +0 -49
  830. package/dist/production/helperComponents/FieldView.js.map +0 -1
  831. package/dist/production/helperComponents/If.js +0 -52
  832. package/dist/production/helperComponents/If.js.map +0 -1
  833. package/dist/production/helperComponents/StaticRender.js +0 -11
  834. package/dist/production/helperComponents/StaticRender.js.map +0 -1
  835. package/dist/production/helperComponents/SugaredField.js +0 -13
  836. package/dist/production/helperComponents/SugaredField.js.map +0 -1
  837. package/dist/production/helperComponents/helpers/FilterEvaluator.js +0 -37
  838. package/dist/production/helperComponents/helpers/FilterEvaluator.js.map +0 -1
  839. package/dist/production/helperComponents/helpers/FilterFieldsCollector.js +0 -40
  840. package/dist/production/helperComponents/helpers/FilterFieldsCollector.js.map +0 -1
  841. package/dist/production/helperComponents/helpers/evaluateCondition.js +0 -49
  842. package/dist/production/helperComponents/helpers/evaluateCondition.js.map +0 -1
  843. package/dist/types/accessorPropagation/AccessorProvider.d.ts +0 -8
  844. package/dist/types/accessorPropagation/AccessorProvider.d.ts.map +0 -1
  845. package/dist/types/accessorPropagation/BindingOperationsContext.d.ts +0 -4
  846. package/dist/types/accessorPropagation/BindingOperationsContext.d.ts.map +0 -1
  847. package/dist/types/accessorPropagation/BindingOperationsProvider.d.ts +0 -8
  848. package/dist/types/accessorPropagation/BindingOperationsProvider.d.ts.map +0 -1
  849. package/dist/types/accessorPropagation/EntityKeyContext.d.ts +0 -2
  850. package/dist/types/accessorPropagation/EntityKeyContext.d.ts.map +0 -1
  851. package/dist/types/accessorPropagation/EntityKeyProvider.d.ts +0 -7
  852. package/dist/types/accessorPropagation/EntityKeyProvider.d.ts.map +0 -1
  853. package/dist/types/accessorPropagation/EnvironmentContext.d.ts +0 -15
  854. package/dist/types/accessorPropagation/EnvironmentContext.d.ts.map +0 -1
  855. package/dist/types/accessorPropagation/TreeRootIdContext.d.ts +0 -2
  856. package/dist/types/accessorPropagation/TreeRootIdContext.d.ts.map +0 -1
  857. package/dist/types/accessorPropagation/TreeRootIdProvider.d.ts +0 -8
  858. package/dist/types/accessorPropagation/TreeRootIdProvider.d.ts.map +0 -1
  859. package/dist/types/accessorPropagation/index.d.ts +0 -28
  860. package/dist/types/accessorPropagation/index.d.ts.map +0 -1
  861. package/dist/types/accessorPropagation/useAccessorUpdateSubscription.d.ts +0 -16
  862. package/dist/types/accessorPropagation/useAccessorUpdateSubscription.d.ts.map +0 -1
  863. package/dist/types/accessorPropagation/useBindingOperations.d.ts +0 -3
  864. package/dist/types/accessorPropagation/useBindingOperations.d.ts.map +0 -1
  865. package/dist/types/accessorPropagation/useDesugaredRelativeEntityList.d.ts +0 -11
  866. package/dist/types/accessorPropagation/useDesugaredRelativeEntityList.d.ts.map +0 -1
  867. package/dist/types/accessorPropagation/useDesugaredRelativeSingleEntity.d.ts +0 -11
  868. package/dist/types/accessorPropagation/useDesugaredRelativeSingleEntity.d.ts.map +0 -1
  869. package/dist/types/accessorPropagation/useDesugaredRelativeSingleField.d.ts +0 -11
  870. package/dist/types/accessorPropagation/useDesugaredRelativeSingleField.d.ts.map +0 -1
  871. package/dist/types/accessorPropagation/useEntity.d.ts +0 -7
  872. package/dist/types/accessorPropagation/useEntity.d.ts.map +0 -1
  873. package/dist/types/accessorPropagation/useEntityKey.d.ts +0 -2
  874. package/dist/types/accessorPropagation/useEntityKey.d.ts.map +0 -1
  875. package/dist/types/accessorPropagation/useEntityList.d.ts +0 -6
  876. package/dist/types/accessorPropagation/useEntityList.d.ts.map +0 -1
  877. package/dist/types/accessorPropagation/useEntityListSubTree.d.ts +0 -6
  878. package/dist/types/accessorPropagation/useEntityListSubTree.d.ts.map +0 -1
  879. package/dist/types/accessorPropagation/useEntityListSubTreeParameters.d.ts +0 -5
  880. package/dist/types/accessorPropagation/useEntityListSubTreeParameters.d.ts.map +0 -1
  881. package/dist/types/accessorPropagation/useEntitySubTree.d.ts +0 -6
  882. package/dist/types/accessorPropagation/useEntitySubTree.d.ts.map +0 -1
  883. package/dist/types/accessorPropagation/useEntitySubTreeParameters.d.ts +0 -5
  884. package/dist/types/accessorPropagation/useEntitySubTreeParameters.d.ts.map +0 -1
  885. package/dist/types/accessorPropagation/useEnvironment.d.ts +0 -3
  886. package/dist/types/accessorPropagation/useEnvironment.d.ts.map +0 -1
  887. package/dist/types/accessorPropagation/useExtendTree.d.ts +0 -5
  888. package/dist/types/accessorPropagation/useExtendTree.d.ts.map +0 -1
  889. package/dist/types/accessorPropagation/useField.d.ts +0 -6
  890. package/dist/types/accessorPropagation/useField.d.ts.map +0 -1
  891. package/dist/types/accessorPropagation/useGetEntityByKey.d.ts +0 -3
  892. package/dist/types/accessorPropagation/useGetEntityByKey.d.ts.map +0 -1
  893. package/dist/types/accessorPropagation/useGetEntityListSubTree.d.ts +0 -5
  894. package/dist/types/accessorPropagation/useGetEntityListSubTree.d.ts.map +0 -1
  895. package/dist/types/accessorPropagation/useGetEntitySubTree.d.ts +0 -5
  896. package/dist/types/accessorPropagation/useGetEntitySubTree.d.ts.map +0 -1
  897. package/dist/types/accessorPropagation/useGetTreeFilters.d.ts +0 -3
  898. package/dist/types/accessorPropagation/useGetTreeFilters.d.ts.map +0 -1
  899. package/dist/types/accessorPropagation/useHasEntity.d.ts +0 -2
  900. package/dist/types/accessorPropagation/useHasEntity.d.ts.map +0 -1
  901. package/dist/types/accessorPropagation/usePersist.d.ts +0 -3
  902. package/dist/types/accessorPropagation/usePersist.d.ts.map +0 -1
  903. package/dist/types/accessorPropagation/useTreeRootId.d.ts +0 -3
  904. package/dist/types/accessorPropagation/useTreeRootId.d.ts.map +0 -1
  905. package/dist/types/accessorSorting/SetOrderFieldOnCreate.d.ts +0 -9
  906. package/dist/types/accessorSorting/SetOrderFieldOnCreate.d.ts.map +0 -1
  907. package/dist/types/accessorSorting/SortedEntities.d.ts +0 -9
  908. package/dist/types/accessorSorting/SortedEntities.d.ts.map +0 -1
  909. package/dist/types/accessorSorting/addEntityAtIndex.d.ts +0 -4
  910. package/dist/types/accessorSorting/addEntityAtIndex.d.ts.map +0 -1
  911. package/dist/types/accessorSorting/errors.d.ts +0 -3
  912. package/dist/types/accessorSorting/errors.d.ts.map +0 -1
  913. package/dist/types/accessorSorting/index.d.ts +0 -8
  914. package/dist/types/accessorSorting/index.d.ts.map +0 -1
  915. package/dist/types/accessorSorting/moveEntity.d.ts +0 -5
  916. package/dist/types/accessorSorting/moveEntity.d.ts.map +0 -1
  917. package/dist/types/accessorSorting/repairEntitiesOrder.d.ts +0 -4
  918. package/dist/types/accessorSorting/repairEntitiesOrder.d.ts.map +0 -1
  919. package/dist/types/accessorSorting/sortEntities.d.ts +0 -4
  920. package/dist/types/accessorSorting/sortEntities.d.ts.map +0 -1
  921. package/dist/types/accessorSorting/useSortedEntities.d.ts +0 -5
  922. package/dist/types/accessorSorting/useSortedEntities.d.ts.map +0 -1
  923. package/dist/types/accessorTree/AccessorTree.d.ts +0 -14
  924. package/dist/types/accessorTree/AccessorTree.d.ts.map +0 -1
  925. package/dist/types/accessorTree/AccessorTreeState.d.ts +0 -23
  926. package/dist/types/accessorTree/AccessorTreeState.d.ts.map +0 -1
  927. package/dist/types/accessorTree/AccessorTreeStateAction.d.ts +0 -18
  928. package/dist/types/accessorTree/AccessorTreeStateAction.d.ts.map +0 -1
  929. package/dist/types/accessorTree/AccessorTreeStateContext.d.ts +0 -3
  930. package/dist/types/accessorTree/AccessorTreeStateContext.d.ts.map +0 -1
  931. package/dist/types/accessorTree/AccessorTreeStateMetadata.d.ts +0 -4
  932. package/dist/types/accessorTree/AccessorTreeStateMetadata.d.ts.map +0 -1
  933. package/dist/types/accessorTree/AccessorTreeStateOptions.d.ts +0 -7
  934. package/dist/types/accessorTree/AccessorTreeStateOptions.d.ts.map +0 -1
  935. package/dist/types/accessorTree/DirtinessContext.d.ts +0 -2
  936. package/dist/types/accessorTree/DirtinessContext.d.ts.map +0 -1
  937. package/dist/types/accessorTree/MutationRequestResponse.d.ts +0 -52
  938. package/dist/types/accessorTree/MutationRequestResponse.d.ts.map +0 -1
  939. package/dist/types/accessorTree/MutationStateContext.d.ts +0 -2
  940. package/dist/types/accessorTree/MutationStateContext.d.ts.map +0 -1
  941. package/dist/types/accessorTree/RequestError.d.ts +0 -21
  942. package/dist/types/accessorTree/RequestError.d.ts.map +0 -1
  943. package/dist/types/accessorTree/accessorTreeStateReducer.d.ts +0 -4
  944. package/dist/types/accessorTree/accessorTreeStateReducer.d.ts.map +0 -1
  945. package/dist/types/accessorTree/metadataToRequestError.d.ts +0 -4
  946. package/dist/types/accessorTree/metadataToRequestError.d.ts.map +0 -1
  947. package/dist/types/accessorTree/useAccessorTreeState.d.ts +0 -2
  948. package/dist/types/accessorTree/useAccessorTreeState.d.ts.map +0 -1
  949. package/dist/types/accessorTree/useDataBinding.d.ts +0 -4
  950. package/dist/types/accessorTree/useDataBinding.d.ts.map +0 -1
  951. package/dist/types/accessorTree/useDirtinessState.d.ts +0 -2
  952. package/dist/types/accessorTree/useDirtinessState.d.ts.map +0 -1
  953. package/dist/types/accessorTree/useMutationState.d.ts +0 -2
  954. package/dist/types/accessorTree/useMutationState.d.ts.map +0 -1
  955. package/dist/types/core/IncrementalMarkerBuilder.d.ts +0 -7
  956. package/dist/types/core/IncrementalMarkerBuilder.d.ts.map +0 -1
  957. package/dist/types/core/MarkerTreeGenerator.d.ts +0 -14
  958. package/dist/types/core/MarkerTreeGenerator.d.ts.map +0 -1
  959. package/dist/types/coreComponents/Component.d.ts +0 -13
  960. package/dist/types/coreComponents/Component.d.ts.map +0 -1
  961. package/dist/types/coreComponents/DataBindingProvider.d.ts +0 -27
  962. package/dist/types/coreComponents/DataBindingProvider.d.ts.map +0 -1
  963. package/dist/types/coreComponents/Entity.d.ts +0 -12
  964. package/dist/types/coreComponents/Entity.d.ts.map +0 -1
  965. package/dist/types/coreComponents/EntityList.d.ts +0 -15
  966. package/dist/types/coreComponents/EntityList.d.ts.map +0 -1
  967. package/dist/types/coreComponents/EntityListSubTree.d.ts +0 -26
  968. package/dist/types/coreComponents/EntityListSubTree.d.ts.map +0 -1
  969. package/dist/types/coreComponents/EntitySubTree.d.ts +0 -24
  970. package/dist/types/coreComponents/EntitySubTree.d.ts.map +0 -1
  971. package/dist/types/coreComponents/Field.d.ts +0 -14
  972. package/dist/types/coreComponents/Field.d.ts.map +0 -1
  973. package/dist/types/coreComponents/HasMany.d.ts +0 -16
  974. package/dist/types/coreComponents/HasMany.d.ts.map +0 -1
  975. package/dist/types/coreComponents/HasOne.d.ts +0 -12
  976. package/dist/types/coreComponents/HasOne.d.ts.map +0 -1
  977. package/dist/types/coreComponents/MarkerProvider.d.ts +0 -21
  978. package/dist/types/coreComponents/MarkerProvider.d.ts.map +0 -1
  979. package/dist/types/coreComponents/ParentEntity.d.ts +0 -10
  980. package/dist/types/coreComponents/ParentEntity.d.ts.map +0 -1
  981. package/dist/types/coreComponents/index.d.ts +0 -12
  982. package/dist/types/coreComponents/index.d.ts.map +0 -1
  983. package/dist/types/entityEvents/index.d.ts +0 -8
  984. package/dist/types/entityEvents/index.d.ts.map +0 -1
  985. package/dist/types/entityEvents/useDerivedField.d.ts +0 -9
  986. package/dist/types/entityEvents/useDerivedField.d.ts.map +0 -1
  987. package/dist/types/entityEvents/useEntityBeforePersist.d.ts +0 -3
  988. package/dist/types/entityEvents/useEntityBeforePersist.d.ts.map +0 -1
  989. package/dist/types/entityEvents/useEntityBeforeUpdate.d.ts +0 -3
  990. package/dist/types/entityEvents/useEntityBeforeUpdate.d.ts.map +0 -1
  991. package/dist/types/entityEvents/useEntityEvent.d.ts +0 -9
  992. package/dist/types/entityEvents/useEntityEvent.d.ts.map +0 -1
  993. package/dist/types/entityEvents/useEntityPersistError.d.ts +0 -3
  994. package/dist/types/entityEvents/useEntityPersistError.d.ts.map +0 -1
  995. package/dist/types/entityEvents/useEntityPersistSuccess.d.ts +0 -3
  996. package/dist/types/entityEvents/useEntityPersistSuccess.d.ts.map +0 -1
  997. package/dist/types/entityEvents/useOnConnectionUpdate.d.ts +0 -4
  998. package/dist/types/entityEvents/useOnConnectionUpdate.d.ts.map +0 -1
  999. package/dist/types/helperComponents/DeferredSubTrees.d.ts +0 -10
  1000. package/dist/types/helperComponents/DeferredSubTrees.d.ts.map +0 -1
  1001. package/dist/types/helperComponents/EntityView.d.ts +0 -12
  1002. package/dist/types/helperComponents/EntityView.d.ts.map +0 -1
  1003. package/dist/types/helperComponents/FieldView.d.ts +0 -59
  1004. package/dist/types/helperComponents/FieldView.d.ts.map +0 -1
  1005. package/dist/types/helperComponents/If.d.ts +0 -17
  1006. package/dist/types/helperComponents/If.d.ts.map +0 -1
  1007. package/dist/types/helperComponents/StaticRender.d.ts +0 -9
  1008. package/dist/types/helperComponents/StaticRender.d.ts.map +0 -1
  1009. package/dist/types/helperComponents/SugaredField.d.ts +0 -12
  1010. package/dist/types/helperComponents/SugaredField.d.ts.map +0 -1
  1011. package/dist/types/helperComponents/helpers/FilterEvaluator.d.ts +0 -9
  1012. package/dist/types/helperComponents/helpers/FilterEvaluator.d.ts.map +0 -1
  1013. package/dist/types/helperComponents/helpers/FilterFieldsCollector.d.ts +0 -10
  1014. package/dist/types/helperComponents/helpers/FilterFieldsCollector.d.ts.map +0 -1
  1015. package/dist/types/helperComponents/helpers/evaluateCondition.d.ts +0 -4
  1016. package/dist/types/helperComponents/helpers/evaluateCondition.d.ts.map +0 -1
  1017. package/dist/types/helperComponents/index.d.ts +0 -7
  1018. package/dist/types/helperComponents/index.d.ts.map +0 -1
  1019. package/src/accessorPropagation/AccessorProvider.tsx +0 -17
  1020. package/src/accessorPropagation/BindingOperationsContext.ts +0 -32
  1021. package/src/accessorPropagation/BindingOperationsProvider.tsx +0 -16
  1022. package/src/accessorPropagation/EntityKeyContext.ts +0 -4
  1023. package/src/accessorPropagation/EntityKeyProvider.tsx +0 -11
  1024. package/src/accessorPropagation/EnvironmentContext.tsx +0 -44
  1025. package/src/accessorPropagation/TreeRootIdContext.ts +0 -5
  1026. package/src/accessorPropagation/TreeRootIdProvider.tsx +0 -12
  1027. package/src/accessorPropagation/index.ts +0 -30
  1028. package/src/accessorPropagation/useAccessorUpdateSubscription.ts +0 -107
  1029. package/src/accessorPropagation/useBindingOperations.ts +0 -5
  1030. package/src/accessorPropagation/useDesugaredRelativeEntityList.ts +0 -70
  1031. package/src/accessorPropagation/useDesugaredRelativeSingleEntity.ts +0 -58
  1032. package/src/accessorPropagation/useDesugaredRelativeSingleField.ts +0 -58
  1033. package/src/accessorPropagation/useEntity.ts +0 -56
  1034. package/src/accessorPropagation/useEntityKey.ts +0 -15
  1035. package/src/accessorPropagation/useEntityList.ts +0 -49
  1036. package/src/accessorPropagation/useEntityListSubTree.ts +0 -27
  1037. package/src/accessorPropagation/useEntityListSubTreeParameters.ts +0 -88
  1038. package/src/accessorPropagation/useEntitySubTree.ts +0 -26
  1039. package/src/accessorPropagation/useEntitySubTreeParameters.ts +0 -66
  1040. package/src/accessorPropagation/useEnvironment.ts +0 -7
  1041. package/src/accessorPropagation/useExtendTree.ts +0 -30
  1042. package/src/accessorPropagation/useField.ts +0 -51
  1043. package/src/accessorPropagation/useGetEntityByKey.ts +0 -4
  1044. package/src/accessorPropagation/useGetEntityListSubTree.ts +0 -28
  1045. package/src/accessorPropagation/useGetEntitySubTree.ts +0 -28
  1046. package/src/accessorPropagation/useGetTreeFilters.ts +0 -4
  1047. package/src/accessorPropagation/useHasEntity.ts +0 -6
  1048. package/src/accessorPropagation/usePersist.ts +0 -4
  1049. package/src/accessorPropagation/useTreeRootId.ts +0 -5
  1050. package/src/accessorSorting/SetOrderFieldOnCreate.tsx +0 -92
  1051. package/src/accessorSorting/SortedEntities.ts +0 -9
  1052. package/src/accessorSorting/addEntityAtIndex.ts +0 -27
  1053. package/src/accessorSorting/errors.ts +0 -9
  1054. package/src/accessorSorting/index.ts +0 -9
  1055. package/src/accessorSorting/moveEntity.ts +0 -66
  1056. package/src/accessorSorting/repairEntitiesOrder.ts +0 -15
  1057. package/src/accessorSorting/sortEntities.ts +0 -20
  1058. package/src/accessorSorting/useSortedEntities.ts +0 -102
  1059. package/src/accessorTree/AccessorTree.tsx +0 -37
  1060. package/src/accessorTree/AccessorTreeState.ts +0 -29
  1061. package/src/accessorTree/AccessorTreeStateAction.ts +0 -21
  1062. package/src/accessorTree/AccessorTreeStateContext.ts +0 -4
  1063. package/src/accessorTree/AccessorTreeStateMetadata.ts +0 -3
  1064. package/src/accessorTree/AccessorTreeStateOptions.ts +0 -7
  1065. package/src/accessorTree/DirtinessContext.ts +0 -4
  1066. package/src/accessorTree/MutationRequestResponse.ts +0 -64
  1067. package/src/accessorTree/MutationStateContext.ts +0 -4
  1068. package/src/accessorTree/RequestError.ts +0 -22
  1069. package/src/accessorTree/accessorTreeStateReducer.ts +0 -36
  1070. package/src/accessorTree/metadataToRequestError.ts +0 -14
  1071. package/src/accessorTree/useAccessorTreeState.ts +0 -11
  1072. package/src/accessorTree/useDataBinding.ts +0 -104
  1073. package/src/accessorTree/useDirtinessState.ts +0 -4
  1074. package/src/accessorTree/useMutationState.ts +0 -4
  1075. package/src/core/IncrementalMarkerBuilder.ts +0 -60
  1076. package/src/core/MarkerTreeGenerator.ts +0 -121
  1077. package/src/coreComponents/Component.tsx +0 -74
  1078. package/src/coreComponents/DataBindingProvider.tsx +0 -54
  1079. package/src/coreComponents/Entity.tsx +0 -26
  1080. package/src/coreComponents/EntityList.tsx +0 -55
  1081. package/src/coreComponents/EntityListSubTree.tsx +0 -83
  1082. package/src/coreComponents/EntitySubTree.tsx +0 -93
  1083. package/src/coreComponents/Field.tsx +0 -46
  1084. package/src/coreComponents/HasMany.tsx +0 -47
  1085. package/src/coreComponents/HasOne.tsx +0 -41
  1086. package/src/coreComponents/MarkerProvider.ts +0 -59
  1087. package/src/coreComponents/ParentEntity.tsx +0 -20
  1088. package/src/coreComponents/index.ts +0 -11
  1089. package/src/entityEvents/index.ts +0 -7
  1090. package/src/entityEvents/useDerivedField.ts +0 -64
  1091. package/src/entityEvents/useEntityBeforePersist.ts +0 -6
  1092. package/src/entityEvents/useEntityBeforeUpdate.ts +0 -6
  1093. package/src/entityEvents/useEntityEvent.ts +0 -57
  1094. package/src/entityEvents/useEntityPersistError.ts +0 -6
  1095. package/src/entityEvents/useEntityPersistSuccess.ts +0 -6
  1096. package/src/entityEvents/useOnConnectionUpdate.ts +0 -10
  1097. package/src/helperComponents/DeferredSubTrees.tsx +0 -126
  1098. package/src/helperComponents/EntityView.tsx +0 -19
  1099. package/src/helperComponents/FieldView.tsx +0 -142
  1100. package/src/helperComponents/If.tsx +0 -74
  1101. package/src/helperComponents/StaticRender.tsx +0 -15
  1102. package/src/helperComponents/SugaredField.tsx +0 -18
  1103. package/src/helperComponents/helpers/FilterEvaluator.ts +0 -46
  1104. package/src/helperComponents/helpers/FilterFieldsCollector.ts +0 -46
  1105. package/src/helperComponents/helpers/evaluateCondition.ts +0 -52
  1106. package/src/helperComponents/index.ts +0 -6
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const getEntityMarker = require("./getEntityMarker.cjs");
4
+ const assertNever = require("../../utils/assertNever.cjs");
5
+ class StateIterator {
6
+ static *eachSiblingRealm(state, relevantPlaceholder) {
7
+ for (let [realmKey, realm] of state.entity.realms) {
8
+ if (realm.type === "entityRealmStub") {
9
+ if (relevantPlaceholder === void 0 || getEntityMarker.getEntityMarker(realm).fields.placeholders.has(relevantPlaceholder)) {
10
+ realm.getAccessor();
11
+ realm = state.entity.realms.get(realmKey);
12
+ } else {
13
+ continue;
14
+ }
15
+ }
16
+ yield realm;
17
+ }
18
+ }
19
+ // Note that this only yields siblings with the same placeholderName!
20
+ static *eachSiblingRealmChild(treeStore, state) {
21
+ if (state.type === "entityList" && state.blueprint.parent === void 0) {
22
+ for (const [, rootStates] of treeStore.subTreeStatesByRoot) {
23
+ const rootList = rootStates.get(state.blueprint.marker.placeholderName);
24
+ if (rootList?.type === "entityList") {
25
+ yield rootList;
26
+ }
27
+ }
28
+ return;
29
+ }
30
+ let closestEntityRealm;
31
+ let placeholderName;
32
+ if (state.type === "field") {
33
+ closestEntityRealm = state.parent;
34
+ placeholderName = state.placeholderName;
35
+ } else if (state.type === "entityList") {
36
+ closestEntityRealm = state.blueprint.parent;
37
+ placeholderName = state.blueprint.marker.placeholderName;
38
+ } else {
39
+ return assertNever.assertNever();
40
+ }
41
+ for (const realm of this.eachSiblingRealm(closestEntityRealm, placeholderName)) {
42
+ const child = realm.children.get(placeholderName);
43
+ if (child === void 0) {
44
+ continue;
45
+ }
46
+ if (child.type === state.type) {
47
+ yield child;
48
+ }
49
+ }
50
+ }
51
+ static *depthFirstAllNodes(root) {
52
+ switch (root.type) {
53
+ case "entityRealm":
54
+ case "entityList":
55
+ for (const childState of root.children.values()) {
56
+ switch (childState.type) {
57
+ case "field":
58
+ case "entityRealm":
59
+ case "entityList":
60
+ yield* this.depthFirstAllNodes(childState);
61
+ break;
62
+ case "entityRealmStub":
63
+ break;
64
+ default:
65
+ return assertNever.assertNever();
66
+ }
67
+ }
68
+ break;
69
+ case "field":
70
+ break;
71
+ default:
72
+ return assertNever.assertNever();
73
+ }
74
+ yield root;
75
+ }
76
+ static *depthFirstINodes(root, match) {
77
+ switch (root.type) {
78
+ case "entityRealm":
79
+ case "entityList":
80
+ for (const childState of root.children.values()) {
81
+ if (childState.type === "entityRealm" || childState.type === "entityList") {
82
+ yield* this.depthFirstINodes(childState, match);
83
+ }
84
+ }
85
+ break;
86
+ default:
87
+ return assertNever.assertNever();
88
+ }
89
+ if (match === void 0 || match(root)) {
90
+ yield root;
91
+ }
92
+ }
93
+ static *eachRootState(treeStore) {
94
+ for (const rootStates of treeStore.subTreeStatesByRoot.values()) {
95
+ yield* rootStates.entries();
96
+ }
97
+ }
98
+ }
99
+ exports.StateIterator = StateIterator;
100
+ //# sourceMappingURL=StateIterator.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StateIterator.cjs","sources":["../../../../src/core/state/StateIterator.ts"],"sourcesContent":["import type { FieldValue, PlaceholderName } from '../../treeParameters'\nimport { assertNever } from '../../utils'\nimport type { TreeStore } from '../TreeStore'\nimport type { EntityListState } from './EntityListState'\nimport type { EntityRealmState } from './EntityRealmState'\nimport type { FieldState } from './FieldState'\nimport { getEntityMarker } from './getEntityMarker'\nimport type { RootStateNode, StateINode, StateNode } from './StateNode'\n\nexport class StateIterator {\n\tpublic static *eachSiblingRealm(\n\t\tstate: EntityRealmState,\n\t\trelevantPlaceholder?: PlaceholderName,\n\t): IterableIterator<EntityRealmState> {\n\t\tfor (let [realmKey, realm] of state.entity.realms) {\n\t\t\tif (realm.type === 'entityRealmStub') {\n\t\t\t\tif (relevantPlaceholder === undefined || getEntityMarker(realm).fields.placeholders.has(relevantPlaceholder)) {\n\t\t\t\t\trealm.getAccessor()\n\t\t\t\t\trealm = state.entity.realms.get(realmKey) as EntityRealmState\n\t\t\t\t} else {\n\t\t\t\t\t// This realm is irrelevant. No need to force-initialize it.\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\tyield realm\n\t\t}\n\t}\n\n\t// Note that this only yields siblings with the same placeholderName!\n\tpublic static *eachSiblingRealmChild<Value extends FieldValue, S extends EntityListState | FieldState<Value>>(\n\t\ttreeStore: TreeStore,\n\t\tstate: S & StateNode<Value>,\n\t): IterableIterator<S> {\n\t\tif (state.type === 'entityList' && state.blueprint.parent === undefined) {\n\t\t\t// Top-level entity list\n\t\t\tfor (const [, rootStates] of treeStore.subTreeStatesByRoot) {\n\t\t\t\tconst rootList = rootStates.get(state.blueprint.marker.placeholderName)\n\t\t\t\tif (rootList?.type === 'entityList') {\n\t\t\t\t\tyield rootList as S\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tlet closestEntityRealm: EntityRealmState\n\t\tlet placeholderName: PlaceholderName\n\n\t\tif (state.type === 'field') {\n\t\t\tclosestEntityRealm = state.parent\n\t\t\tplaceholderName = state.placeholderName\n\t\t} else if (state.type === 'entityList') {\n\t\t\tclosestEntityRealm = state.blueprint.parent! // The parent-less case is handled above. Hence the assertion.\n\t\t\tplaceholderName = state.blueprint.marker.placeholderName\n\t\t} else {\n\t\t\treturn assertNever(state)\n\t\t}\n\n\t\tfor (const realm of this.eachSiblingRealm(closestEntityRealm, placeholderName)) {\n\t\t\tconst child = realm.children.get(placeholderName)\n\t\t\tif (child === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (child.type === state.type) {\n\t\t\t\tyield child as S\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static *depthFirstAllNodes(root: StateNode): IterableIterator<StateNode> {\n\t\tswitch (root.type) {\n\t\t\tcase 'entityRealm':\n\t\t\tcase 'entityList':\n\t\t\t\tfor (const childState of root.children.values()) {\n\t\t\t\t\tswitch (childState.type) {\n\t\t\t\t\t\tcase 'field':\n\t\t\t\t\t\tcase 'entityRealm':\n\t\t\t\t\t\tcase 'entityList':\n\t\t\t\t\t\t\tyield* this.depthFirstAllNodes(childState)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tcase 'entityRealmStub':\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn assertNever(childState)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase 'field':\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\treturn assertNever(root)\n\t\t}\n\t\tyield root\n\t}\n\n\tpublic static *depthFirstINodes(\n\t\troot: StateINode,\n\t\tmatch?: (iNode: StateINode) => boolean,\n\t): IterableIterator<StateINode> {\n\t\tswitch (root.type) {\n\t\t\tcase 'entityRealm':\n\t\t\tcase 'entityList':\n\t\t\t\tfor (const childState of root.children.values()) {\n\t\t\t\t\tif (childState.type === 'entityRealm' || childState.type === 'entityList') {\n\t\t\t\t\t\tyield* this.depthFirstINodes(childState, match)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\treturn assertNever(root)\n\t\t}\n\t\tif (match === undefined || match(root)) {\n\t\t\tyield root\n\t\t}\n\t}\n\n\tpublic static *eachRootState(treeStore: TreeStore): IterableIterator<[PlaceholderName, RootStateNode]> {\n\t\tfor (const rootStates of treeStore.subTreeStatesByRoot.values()) {\n\t\t\tyield* rootStates.entries()\n\t\t}\n\t}\n}\n"],"names":["getEntityMarker","assertNever"],"mappings":";;;;AASO,MAAM,cAAc;AAAA,EAC1B,QAAe,iBACd,OACA,qBACqC;AACrC,aAAS,CAAC,UAAU,KAAK,KAAK,MAAM,OAAO,QAAQ;AAC9C,UAAA,MAAM,SAAS,mBAAmB;AACjC,YAAA,wBAAwB,UAAaA,gCAAgB,KAAK,EAAE,OAAO,aAAa,IAAI,mBAAmB,GAAG;AAC7G,gBAAM,YAAY;AAClB,kBAAQ,MAAM,OAAO,OAAO,IAAI,QAAQ;AAAA,QAAA,OAClC;AAEN;AAAA,QACD;AAAA,MACD;AACM,YAAA;AAAA,IACP;AAAA,EACD;AAAA;AAAA,EAGA,QAAe,sBACd,WACA,OACsB;AACtB,QAAI,MAAM,SAAS,gBAAgB,MAAM,UAAU,WAAW,QAAW;AAExE,iBAAW,CAAG,EAAA,UAAU,KAAK,UAAU,qBAAqB;AAC3D,cAAM,WAAW,WAAW,IAAI,MAAM,UAAU,OAAO,eAAe;AAClE,YAAA,UAAU,SAAS,cAAc;AAC9B,gBAAA;AAAA,QACP;AAAA,MACD;AACA;AAAA,IACD;AAEI,QAAA;AACA,QAAA;AAEA,QAAA,MAAM,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P;AAAA,EACD;AAAA,EAEA,QAAe,cAAc,WAA0E;AACtG,eAAW,cAAc,UAAU,oBAAoB,OAAA,GAAU;AAChE,aAAO,WAAW;IACnB;AAAA,EACD;AACD;;"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const getEntityMarker = (realm) => realm.blueprint.type === "listEntity" ? realm.blueprint.parent.blueprint.marker : realm.blueprint.marker;
4
+ exports.getEntityMarker = getEntityMarker;
5
+ //# sourceMappingURL=getEntityMarker.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getEntityMarker.cjs","sources":["../../../../src/core/state/getEntityMarker.ts"],"sourcesContent":["import type { EntityRealmState, EntityRealmStateStub } from './EntityRealmState'\n\nexport const getEntityMarker = (realm: EntityRealmState | EntityRealmStateStub) =>\n\trealm.blueprint.type === 'listEntity' ? realm.blueprint.parent.blueprint.marker : realm.blueprint.marker\n"],"names":[],"mappings":";;AAEO,MAAM,kBAAkB,CAAC,UAC/B,MAAM,UAAU,SAAS,eAAe,MAAM,UAAU,OAAO,UAAU,SAAS,MAAM,UAAU;;"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const client = require("@contember/client");
4
+ const createQueryBuilder = (schema) => {
5
+ const schemaNames = {
6
+ entities: Object.fromEntries(schema.getEntityNames().map((it) => {
7
+ const entity = schema.getEntity(it);
8
+ return [it, {
9
+ name: it,
10
+ scalars: Array.from(entity.fields.values()).filter((it2) => it2.__typename === "_Column").map((it2) => it2.name),
11
+ fields: Object.fromEntries(Array.from(entity.fields.values()).map((it2) => {
12
+ if (it2.__typename === "_Column") {
13
+ return [it2.name, { type: "column" }];
14
+ }
15
+ if (it2.__typename === "_Relation") {
16
+ return [
17
+ it2.name,
18
+ {
19
+ type: it2.type === "ManyHasMany" || it2.type === "OneHasMany" ? "many" : "one",
20
+ entity: it2.targetEntity
21
+ }
22
+ ];
23
+ }
24
+ throw new Error();
25
+ }))
26
+ }];
27
+ }))
28
+ };
29
+ return new client.ContentQueryBuilder(schemaNames);
30
+ };
31
+ exports.createQueryBuilder = createQueryBuilder;
32
+ //# sourceMappingURL=createQueryBuilder.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createQueryBuilder.cjs","sources":["../../../../src/core/utils/createQueryBuilder.ts"],"sourcesContent":["import { Schema, SchemaRelation } from '../schema'\nimport { ContentQueryBuilder, SchemaEntityNames, SchemaNames } from '@contember/client'\n\nexport const createQueryBuilder = (schema: Schema) => {\n\tconst schemaNames: SchemaNames = {\n\t\tentities: Object.fromEntries(schema.getEntityNames().map((it): [string, SchemaEntityNames<string>] => {\n\t\t\tconst entity = schema.getEntity(it)\n\t\t\treturn [it, {\n\t\t\t\tname: it,\n\t\t\t\tscalars: Array.from(entity.fields.values()).filter(it => it.__typename === '_Column').map(it => it.name),\n\t\t\t\tfields: Object.fromEntries(Array.from(entity.fields.values()).map(it => {\n\t\t\t\t\tif (it.__typename === '_Column') {\n\t\t\t\t\t\treturn [it.name, { type: 'column' }]\n\t\t\t\t\t}\n\t\t\t\t\tif (it.__typename === '_Relation') {\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tit.name,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: it.type === 'ManyHasMany' || it.type === 'OneHasMany' ? 'many' : 'one',\n\t\t\t\t\t\t\t\tentity: (it as SchemaRelation).targetEntity,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t\tthrow new Error()\n\t\t\t\t})),\n\t\t\t}]\n\t\t})),\n\t}\n\n\treturn new ContentQueryBuilder(schemaNames)\n}\n"],"names":["it","ContentQueryBuilder"],"mappings":";;;AAGa,MAAA,qBAAqB,CAAC,WAAmB;AACrD,QAAM,cAA2B;AAAA,IAChC,UAAU,OAAO,YAAY,OAAO,iBAAiB,IAAI,CAAC,OAA4C;AAC/F,YAAA,SAAS,OAAO,UAAU,EAAE;AAClC,aAAO,CAAC,IAAI;AAAA,QACX,MAAM;AAAA,QACN,SAAS,MAAM,KAAK,OAAO,OAAO,OAAA,CAAQ,EAAE,OAAO,CAAAA,QAAMA,IAAG,eAAe,SAAS,EAAE,IAAI,CAAAA,QAAMA,IAAG,IAAI;AAAA,QACvG,QAAQ,OAAO,YAAY,MAAM,KAAK,OAAO,OAAO,OAAQ,CAAA,EAAE,IAAI,CAAAA,QAAM;AACnEA,cAAAA,IAAG,eAAe,WAAW;AAChC,mBAAO,CAACA,IAAG,MAAM,EAAE,MAAM,SAAU,CAAA;AAAA,UACpC;AACIA,cAAAA,IAAG,eAAe,aAAa;AAC3B,mBAAA;AAAA,cACNA,IAAG;AAAA,cACH;AAAA,gBACC,MAAMA,IAAG,SAAS,iBAAiBA,IAAG,SAAS,eAAe,SAAS;AAAA,gBACvE,QAASA,IAAsB;AAAA,cAChC;AAAA,YAAA;AAAA,UAEF;AACA,gBAAM,IAAI,MAAM;AAAA,QAAA,CAChB,CAAC;AAAA,MAAA,CACF;AAAA,IAAA,CACD,CAAC;AAAA,EAAA;AAGI,SAAA,IAAIC,OAAAA,oBAAoB,WAAW;AAC3C;;"}
@@ -0,0 +1,32 @@
1
+ import { ContentQueryBuilder } from "@contember/client";
2
+ const createQueryBuilder = (schema) => {
3
+ const schemaNames = {
4
+ entities: Object.fromEntries(schema.getEntityNames().map((it) => {
5
+ const entity = schema.getEntity(it);
6
+ return [it, {
7
+ name: it,
8
+ scalars: Array.from(entity.fields.values()).filter((it2) => it2.__typename === "_Column").map((it2) => it2.name),
9
+ fields: Object.fromEntries(Array.from(entity.fields.values()).map((it2) => {
10
+ if (it2.__typename === "_Column") {
11
+ return [it2.name, { type: "column" }];
12
+ }
13
+ if (it2.__typename === "_Relation") {
14
+ return [
15
+ it2.name,
16
+ {
17
+ type: it2.type === "ManyHasMany" || it2.type === "OneHasMany" ? "many" : "one",
18
+ entity: it2.targetEntity
19
+ }
20
+ ];
21
+ }
22
+ throw new Error();
23
+ }))
24
+ }];
25
+ }))
26
+ };
27
+ return new ContentQueryBuilder(schemaNames);
28
+ };
29
+ export {
30
+ createQueryBuilder
31
+ };
32
+ //# sourceMappingURL=createQueryBuilder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createQueryBuilder.js","sources":["../../../../src/core/utils/createQueryBuilder.ts"],"sourcesContent":["import { Schema, SchemaRelation } from '../schema'\nimport { ContentQueryBuilder, SchemaEntityNames, SchemaNames } from '@contember/client'\n\nexport const createQueryBuilder = (schema: Schema) => {\n\tconst schemaNames: SchemaNames = {\n\t\tentities: Object.fromEntries(schema.getEntityNames().map((it): [string, SchemaEntityNames<string>] => {\n\t\t\tconst entity = schema.getEntity(it)\n\t\t\treturn [it, {\n\t\t\t\tname: it,\n\t\t\t\tscalars: Array.from(entity.fields.values()).filter(it => it.__typename === '_Column').map(it => it.name),\n\t\t\t\tfields: Object.fromEntries(Array.from(entity.fields.values()).map(it => {\n\t\t\t\t\tif (it.__typename === '_Column') {\n\t\t\t\t\t\treturn [it.name, { type: 'column' }]\n\t\t\t\t\t}\n\t\t\t\t\tif (it.__typename === '_Relation') {\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tit.name,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: it.type === 'ManyHasMany' || it.type === 'OneHasMany' ? 'many' : 'one',\n\t\t\t\t\t\t\t\tentity: (it as SchemaRelation).targetEntity,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t\tthrow new Error()\n\t\t\t\t})),\n\t\t\t}]\n\t\t})),\n\t}\n\n\treturn new ContentQueryBuilder(schemaNames)\n}\n"],"names":["it"],"mappings":";AAGa,MAAA,qBAAqB,CAAC,WAAmB;AACrD,QAAM,cAA2B;AAAA,IAChC,UAAU,OAAO,YAAY,OAAO,iBAAiB,IAAI,CAAC,OAA4C;AAC/F,YAAA,SAAS,OAAO,UAAU,EAAE;AAClC,aAAO,CAAC,IAAI;AAAA,QACX,MAAM;AAAA,QACN,SAAS,MAAM,KAAK,OAAO,OAAO,OAAA,CAAQ,EAAE,OAAO,CAAAA,QAAMA,IAAG,eAAe,SAAS,EAAE,IAAI,CAAAA,QAAMA,IAAG,IAAI;AAAA,QACvG,QAAQ,OAAO,YAAY,MAAM,KAAK,OAAO,OAAO,OAAQ,CAAA,EAAE,IAAI,CAAAA,QAAM;AACnEA,cAAAA,IAAG,eAAe,WAAW;AAChC,mBAAO,CAACA,IAAG,MAAM,EAAE,MAAM,SAAU,CAAA;AAAA,UACpC;AACIA,cAAAA,IAAG,eAAe,aAAa;AAC3B,mBAAA;AAAA,cACNA,IAAG;AAAA,cACH;AAAA,gBACC,MAAMA,IAAG,SAAS,iBAAiBA,IAAG,SAAS,eAAe,SAAS;AAAA,gBACvE,QAASA,IAAsB;AAAA,cAChC;AAAA,YAAA;AAAA,UAEF;AACA,gBAAM,IAAI,MAAM;AAAA,QAAA,CAChB,CAAC;AAAA,MAAA,CACF;AAAA,IAAA,CACD,CAAC;AAAA,EAAA;AAGI,SAAA,IAAI,oBAAoB,WAAW;AAC3C;"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const getCombinedSignal = (components) => {
4
+ let abortedCount = 0;
5
+ let signalCount = 0;
6
+ const controller = new AbortController();
7
+ const refresh = () => {
8
+ if (signalCount === 0) {
9
+ return;
10
+ }
11
+ if (abortedCount >= signalCount) {
12
+ controller.abort();
13
+ }
14
+ };
15
+ for (const component of components) {
16
+ if (!component) {
17
+ continue;
18
+ }
19
+ signalCount++;
20
+ if (component.aborted) {
21
+ abortedCount++;
22
+ } else {
23
+ component.addEventListener("abort", () => {
24
+ abortedCount++;
25
+ refresh();
26
+ });
27
+ }
28
+ }
29
+ refresh();
30
+ return controller.signal;
31
+ };
32
+ exports.getCombinedSignal = getCombinedSignal;
33
+ //# sourceMappingURL=getCombinedSignal.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCombinedSignal.cjs","sources":["../../../../src/core/utils/getCombinedSignal.ts"],"sourcesContent":["// Returns a signal that aborts when all present signals are aborted.\nexport const getCombinedSignal = (components: Iterable<AbortSignal | undefined>): AbortSignal => {\n\tlet abortedCount = 0\n\tlet signalCount = 0\n\n\tconst controller = new AbortController()\n\tconst refresh = () => {\n\t\tif (signalCount === 0) {\n\t\t\treturn\n\t\t}\n\t\tif (abortedCount >= signalCount) {\n\t\t\tcontroller.abort()\n\t\t}\n\t}\n\n\tfor (const component of components) {\n\t\tif (!component) {\n\t\t\tcontinue\n\t\t}\n\n\t\tsignalCount++\n\n\t\tif (component.aborted) {\n\t\t\tabortedCount++\n\t\t} else {\n\t\t\tcomponent.addEventListener('abort', () => {\n\t\t\t\tabortedCount++\n\t\t\t\trefresh()\n\t\t\t})\n\t\t}\n\t}\n\n\trefresh()\n\n\treturn controller.signal\n}\n"],"names":[],"mappings":";;AACa,MAAA,oBAAoB,CAAC,eAA+D;AAChG,MAAI,eAAe;AACnB,MAAI,cAAc;AAEZ,QAAA,aAAa,IAAI;AACvB,QAAM,UAAU,MAAM;AACrB,QAAI,gBAAgB,GAAG;AACtB;AAAA,IACD;AACA,QAAI,gBAAgB,aAAa;AAChC,iBAAW,MAAM;AAAA,IAClB;AAAA,EAAA;AAGD,aAAW,aAAa,YAAY;AACnC,QAAI,CAAC,WAAW;AACf;AAAA,IACD;AAEA;AAEA,QAAI,UAAU,SAAS;AACtB;AAAA,IAAA,OACM;AACI,gBAAA,iBAAiB,SAAS,MAAM;AACzC;AACQ;MAAA,CACR;AAAA,IACF;AAAA,EACD;AAEQ;AAER,SAAO,WAAW;AACnB;;"}
@@ -0,0 +1,213 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const BindingError = require("../BindingError.cjs");
4
+ const equal = require("fast-deep-equal/es6/index.js");
5
+ class Environment {
6
+ constructor(options) {
7
+ this.options = options;
8
+ }
9
+ static create() {
10
+ return new Environment({
11
+ dimensions: {},
12
+ variables: {},
13
+ parameters: {},
14
+ extensions: /* @__PURE__ */ new Map()
15
+ });
16
+ }
17
+ getSubTree() {
18
+ for (let env = this; env.options.node; env = env.getParent()) {
19
+ const node = env.options.node;
20
+ if (node.type === "subtree-entity" || node.type === "subtree-entity-list") {
21
+ return node;
22
+ }
23
+ }
24
+ throw new BindingError.BindingError("Not in a SubTree");
25
+ }
26
+ getSubTreeNode() {
27
+ if (!this.options.node) {
28
+ throw new BindingError.BindingError();
29
+ }
30
+ return this.options.node;
31
+ }
32
+ withSubTree(SubTree) {
33
+ const { parent, ...options } = this.options;
34
+ return new Environment({
35
+ ...options,
36
+ node: SubTree
37
+ });
38
+ }
39
+ withSubTreeChild(node) {
40
+ if (!this.options.node) {
41
+ throw new BindingError.BindingError(`Cannot call withSubTreeChild without previous call of withSubTree`);
42
+ }
43
+ if (this.options.node.entity.fields.get(node.field.name) !== node.field) {
44
+ throw new BindingError.BindingError();
45
+ }
46
+ return new Environment({
47
+ ...this.options,
48
+ node,
49
+ parent: this
50
+ });
51
+ }
52
+ hasVariable(key) {
53
+ return key in this.options.variables;
54
+ }
55
+ getVariable(key) {
56
+ if (!(key in this.options.variables)) {
57
+ throw new BindingError.BindingError(`Variable ${key} not found`);
58
+ }
59
+ return this.options.variables[key];
60
+ }
61
+ getVariableOrElse(key, fallback) {
62
+ return this.options.variables[key] ?? fallback;
63
+ }
64
+ /** @deprecated use getVariable or getParameter */
65
+ getValue(key) {
66
+ console.warn("Environment.getValue() is deprecated, use Environment.getVariable() or Environment.getParameter() instead.");
67
+ return this.getVariableOrElse(key, void 0) ?? this.getParameterOrElse(key, void 0);
68
+ }
69
+ /** @deprecated use getVariableOrElse or getParameterOrElse */
70
+ getValueOrElse(key, fallback) {
71
+ console.warn("Environment.getValueOrElse() is deprecated, use Environment.getVariableOrElse() or Environment.getParameterOrElse() instead.");
72
+ return this.getVariableOrElse(key, void 0) ?? this.getParameterOrElse(key, fallback);
73
+ }
74
+ /** @deprecated */
75
+ hasName(key) {
76
+ console.warn("Environment.hasName() is deprecated, use Environment.hasVariable() or Environment.hasParameter() instead.");
77
+ return key in this.options.variables || key in this.options.parameters;
78
+ }
79
+ withVariables(variables) {
80
+ if (variables === void 0) {
81
+ return this;
82
+ }
83
+ const newVariables = { ...this.options.variables };
84
+ for (const [newName, newValue] of Object.entries(variables)) {
85
+ if (newName === "labelMiddleware") {
86
+ throw new BindingError.BindingError("You cannot pass labelMiddleware to withVariables method. Use withLabelMiddleware instead.");
87
+ }
88
+ const resolvedValue = typeof newValue === "function" ? newValue(this) : newValue;
89
+ if (resolvedValue === void 0) {
90
+ delete newVariables[newName];
91
+ } else {
92
+ newVariables[newName] = resolvedValue;
93
+ }
94
+ }
95
+ return new Environment({
96
+ ...this.options,
97
+ variables: newVariables,
98
+ parent: this
99
+ });
100
+ }
101
+ getAllVariables() {
102
+ return this.options.variables;
103
+ }
104
+ hasParameter(key) {
105
+ return key in this.options.parameters;
106
+ }
107
+ getParameter(key) {
108
+ if (!(key in this.options.parameters)) {
109
+ throw new BindingError.BindingError(`Parameter ${key} not found`);
110
+ }
111
+ return this.options.parameters[key];
112
+ }
113
+ getParameterOrElse(key, fallback) {
114
+ return this.options.parameters[key] ?? fallback;
115
+ }
116
+ getAllParameters() {
117
+ return this.options.parameters;
118
+ }
119
+ withParameters(parameters) {
120
+ return new Environment({ ...this.options, parameters });
121
+ }
122
+ hasDimension(dimensionName) {
123
+ return dimensionName in this.options.dimensions;
124
+ }
125
+ getDimension(dimensionName) {
126
+ if (!(dimensionName in this.options.dimensions)) {
127
+ throw new BindingError.BindingError(`Dimension ${dimensionName} does not exist.`);
128
+ }
129
+ return this.options.dimensions[dimensionName];
130
+ }
131
+ getDimensionOrElse(dimensionName, fallback) {
132
+ return this.options.dimensions[dimensionName] ?? fallback;
133
+ }
134
+ getAllDimensions() {
135
+ return this.options.dimensions;
136
+ }
137
+ withDimensions(dimensions) {
138
+ const newDimensions = {
139
+ ...this.options.dimensions,
140
+ ...dimensions
141
+ };
142
+ if (equal(newDimensions, this.options.dimensions)) {
143
+ return this;
144
+ }
145
+ return new Environment({ ...this.options, dimensions: newDimensions });
146
+ }
147
+ getSchema() {
148
+ if (!this.options.schema) {
149
+ throw new BindingError.BindingError("Schema is not set");
150
+ }
151
+ return this.options.schema;
152
+ }
153
+ withSchema(schema) {
154
+ return new Environment({ ...this.options, schema });
155
+ }
156
+ getParent() {
157
+ if (!this.options.parent) {
158
+ throw new BindingError.BindingError("There is no parent environment");
159
+ }
160
+ return this.options.parent;
161
+ }
162
+ withExtension(extension, state) {
163
+ return new Environment({
164
+ ...this.options,
165
+ extensions: new Map([...this.options.extensions, [extension, state]])
166
+ });
167
+ }
168
+ getExtension(extension) {
169
+ const state = this.options.extensions.get(extension);
170
+ return extension.create(state, this);
171
+ }
172
+ merge(other) {
173
+ if (other === this) {
174
+ return this;
175
+ }
176
+ if (!equal(this.options.node, other.options.node)) {
177
+ throw new BindingError.BindingError(`Cannot merge two environments with different tree position.`);
178
+ }
179
+ if (this.options.parameters !== other.options.parameters) {
180
+ throw new BindingError.BindingError(`Cannot merge two environments with different parameters.`);
181
+ }
182
+ if (this.options.dimensions !== other.options.dimensions) {
183
+ throw new BindingError.BindingError(`Cannot merge two environments with different dimensions.`);
184
+ }
185
+ if (this.options.extensions !== other.options.extensions) {
186
+ throw new BindingError.BindingError(`Cannot merge two environments with different extensions.`);
187
+ }
188
+ if (equal(this.options.variables, other.options.variables) && this.options.parent === other.options.parent) {
189
+ return this;
190
+ }
191
+ for (const key in other.options.variables) {
192
+ if (key in this.options.variables && !equal(this.options.variables[key], other.options.variables[key])) {
193
+ throw new BindingError.BindingError(`Cannot merge two environments with different value of variable ${key}:
194
+ ` + JSON.stringify(this.options.variables[key]) + "\n" + JSON.stringify(other.options.variables[key]));
195
+ }
196
+ }
197
+ return new Environment({
198
+ ...this.options,
199
+ parent: this.options.parent && other.options.parent ? this.options.parent.merge(other.options.parent) : void 0,
200
+ variables: { ...this.options.variables, ...other.options.variables }
201
+ });
202
+ }
203
+ }
204
+ ((Environment2) => {
205
+ Environment2.createExtension = (create, otherMethods) => {
206
+ return {
207
+ create,
208
+ ...otherMethods
209
+ };
210
+ };
211
+ })(Environment || (Environment = {}));
212
+ exports.Environment = Environment;
213
+ //# sourceMappingURL=Environment.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Environment.cjs","sources":["../../../src/dao/Environment.ts"],"sourcesContent":["import { BindingError } from '../BindingError'\nimport type { Filter } from '../treeParameters'\nimport equal from 'fast-deep-equal/es6/index.js'\nimport { Schema, SchemaColumn, SchemaEntity, SchemaRelation } from '../core/schema'\nimport { GraphQlLiteral } from '@contember/client'\n\nclass Environment {\n\tprivate constructor(\n\t\tprivate readonly options: Environment.Options,\n\t) {\n\t}\n\n\tpublic static create() {\n\t\treturn new Environment({\n\t\t\tdimensions: {},\n\t\t\tvariables: {},\n\t\t\tparameters: {},\n\t\t\textensions: new Map(),\n\t\t})\n\t}\n\n\tpublic getSubTree(): Environment.SubTreeNode {\n\t\tfor (let env: Environment = this; env.options.node; env = env.getParent()) {\n\t\t\tconst node = env.options.node\n\t\t\tif (node.type === 'subtree-entity' || node.type === 'subtree-entity-list') {\n\t\t\t\treturn node\n\t\t\t}\n\t\t}\n\t\tthrow new BindingError('Not in a SubTree')\n\t}\n\n\tpublic getSubTreeNode(): Environment.AnyNode {\n\t\tif (!this.options.node) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\treturn this.options.node\n\t}\n\n\tpublic withSubTree(SubTree: Environment.SubTreeNode) {\n\t\tconst { parent, ...options } = this.options\n\t\treturn new Environment({\n\t\t\t...options,\n\t\t\tnode: SubTree,\n\t\t})\n\t}\n\n\tpublic withSubTreeChild(node: Environment.InnerNode) {\n\t\tif (!this.options.node) {\n\t\t\tthrow new BindingError(`Cannot call withSubTreeChild without previous call of withSubTree`)\n\t\t}\n\t\tif (this.options.node.entity.fields.get(node.field.name) !== node.field) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\tnode,\n\t\t\tparent: this,\n\t\t})\n\t}\n\n\n\tpublic hasVariable(key: string): boolean {\n\t\treturn key in this.options.variables\n\t}\n\n\tpublic getVariable<V extends Environment.Value = Environment.Value>(key: string): V {\n\t\tif (!(key in this.options.variables)) {\n\t\t\tthrow new BindingError(`Variable ${key} not found`)\n\t\t}\n\t\treturn this.options.variables[key] as V\n\t}\n\n\tpublic getVariableOrElse<F, V extends Environment.Value = Environment.Value>(key: string, fallback: F): V | F {\n\t\treturn (this.options.variables[key] as V) ?? fallback\n\t}\n\n\t/** @deprecated use getVariable or getParameter */\n\tpublic getValue<V extends Environment.Value = Environment.Value>(key: string): V {\n\t\tconsole.warn('Environment.getValue() is deprecated, use Environment.getVariable() or Environment.getParameter() instead.')\n\t\treturn this.getVariableOrElse(key, undefined) ?? this.getParameterOrElse(key, undefined) as V\n\t}\n\n\t/** @deprecated use getVariableOrElse or getParameterOrElse */\n\tpublic getValueOrElse<F, V extends Environment.Value = Environment.Value>(key: string, fallback: F): V | F {\n\t\tconsole.warn('Environment.getValueOrElse() is deprecated, use Environment.getVariableOrElse() or Environment.getParameterOrElse() instead.')\n\t\treturn this.getVariableOrElse(key, undefined) ?? this.getParameterOrElse(key, fallback) as any\n\t}\n\n\t/** @deprecated */\n\tpublic hasName(key: string): boolean {\n\t\tconsole.warn('Environment.hasName() is deprecated, use Environment.hasVariable() or Environment.hasParameter() instead.')\n\t\treturn key in this.options.variables || key in this.options.parameters\n\t}\n\n\tpublic withVariables(variables: Environment.ValuesMapWithFactory | undefined): Environment {\n\t\tif (variables === undefined) {\n\t\t\treturn this\n\t\t}\n\t\tconst newVariables = { ...this.options.variables }\n\t\tfor (const [newName, newValue] of Object.entries(variables)) {\n\t\t\tif (newName === 'labelMiddleware') {\n\t\t\t\tthrow new BindingError('You cannot pass labelMiddleware to withVariables method. Use withLabelMiddleware instead.')\n\t\t\t}\n\t\t\tconst resolvedValue = typeof newValue === 'function' ? newValue(this) : newValue\n\t\t\tif (resolvedValue === undefined) {\n\t\t\t\tdelete newVariables[newName]\n\t\t\t} else {\n\t\t\t\tnewVariables[newName] = resolvedValue\n\t\t\t}\n\t\t}\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\tvariables: newVariables,\n\t\t\tparent: this,\n\t\t})\n\t}\n\n\tpublic getAllVariables() {\n\t\treturn this.options.variables\n\t}\n\n\tpublic hasParameter(key: string): boolean {\n\t\treturn key in this.options.parameters\n\t}\n\n\tpublic getParameter<F>(key: string): string | number {\n\t\tif (!(key in this.options.parameters)) {\n\t\t\tthrow new BindingError(`Parameter ${key} not found`)\n\t\t}\n\t\treturn this.options.parameters[key] as string | number\n\t}\n\n\tpublic getParameterOrElse<F>(key: string, fallback: F): string | number | F {\n\t\treturn this.options.parameters[key] ?? fallback\n\t}\n\n\tpublic getAllParameters() {\n\t\treturn this.options.parameters\n\t}\n\n\tpublic withParameters(parameters: Environment.Parameters): Environment {\n\t\treturn new Environment({ ...this.options, parameters })\n\t}\n\n\tpublic hasDimension(dimensionName: string): boolean {\n\t\treturn dimensionName in this.options.dimensions\n\t}\n\n\tpublic getDimension<F>(dimensionName: string): string[] {\n\t\tif (!(dimensionName in this.options.dimensions)) {\n\t\t\tthrow new BindingError(`Dimension ${dimensionName} does not exist.`)\n\t\t}\n\t\treturn this.options.dimensions[dimensionName]\n\t}\n\n\tpublic getDimensionOrElse<F>(dimensionName: string, fallback: F): string[] | F {\n\t\treturn this.options.dimensions[dimensionName] ?? fallback\n\t}\n\n\tpublic getAllDimensions(): Environment.SelectedDimensions {\n\t\treturn this.options.dimensions\n\t}\n\n\tpublic withDimensions(dimensions: Environment.SelectedDimensions): Environment {\n\t\tconst newDimensions = {\n\t\t\t...this.options.dimensions,\n\t\t\t...dimensions,\n\t\t}\n\t\tif (equal(newDimensions, this.options.dimensions)) {\n\t\t\treturn this\n\t\t}\n\t\treturn new Environment({ ...this.options, dimensions: newDimensions })\n\t}\n\n\tpublic getSchema(): Schema {\n\t\tif (!this.options.schema) {\n\t\t\tthrow new BindingError('Schema is not set')\n\t\t}\n\t\treturn this.options.schema\n\t}\n\n\tpublic withSchema(schema: Schema): Environment {\n\t\treturn new Environment({ ...this.options, schema })\n\t}\n\n\tpublic getParent(): Environment {\n\t\tif (!this.options.parent) {\n\t\t\tthrow new BindingError('There is no parent environment')\n\t\t}\n\t\treturn this.options.parent\n\t}\n\n\tpublic withExtension<S, R>(extension: Environment.Extension<S, R>, state: S): Environment {\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\textensions: new Map([...this.options.extensions, [extension, state] as [Environment.Extension<unknown, unknown>, unknown]]),\n\t\t})\n\t}\n\n\tpublic getExtension<S, R>(extension: Environment.Extension<S, R>): R {\n\t\tconst state = this.options.extensions.get(extension as Environment.Extension<unknown, unknown>)\n\t\treturn extension.create(state as S, this)\n\t}\n\n\tpublic merge(other: Environment): Environment {\n\t\tif (other === this) {\n\t\t\treturn this\n\t\t}\n\t\tif (!equal(this.options.node, other.options.node)) {\n\t\t\tthrow new BindingError(`Cannot merge two environments with different tree position.`)\n\t\t}\n\t\tif (this.options.parameters !== other.options.parameters) {\n\t\t\tthrow new BindingError(`Cannot merge two environments with different parameters.`)\n\t\t}\n\t\tif (this.options.dimensions !== other.options.dimensions) {\n\t\t\tthrow new BindingError(`Cannot merge two environments with different dimensions.`)\n\t\t}\n\t\tif (this.options.extensions !== other.options.extensions) {\n\t\t\t// todo: deep compare?\n\t\t\tthrow new BindingError(`Cannot merge two environments with different extensions.`)\n\t\t}\n\n\t\tif (equal(this.options.variables, other.options.variables) && this.options.parent === other.options.parent) {\n\t\t\treturn this\n\t\t}\n\t\tfor (const key in other.options.variables) {\n\t\t\tif (key in this.options.variables && !equal(this.options.variables[key], other.options.variables[key])) {\n\t\t\t\tthrow new BindingError(`Cannot merge two environments with different value of variable ${key}:\\n`\n\t\t\t\t\t+ JSON.stringify(this.options.variables[key]) + '\\n'\n\t\t\t\t\t+ JSON.stringify(other.options.variables[key]))\n\t\t\t}\n\t\t}\n\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\tparent: this.options.parent && other.options.parent ? this.options.parent.merge(other.options.parent) : undefined,\n\t\t\tvariables: { ...this.options.variables, ...other.options.variables },\n\t\t})\n\t}\n}\n\nnamespace Environment {\n\texport type Name = string\n\n\texport type ReactElementLike = {\n\t\ttype: any\n\t\tprops: any\n\t}\n\n\texport type Value = string | number | boolean | undefined | GraphQlLiteral | Filter | ReactElementLike\n\n\texport type ResolvedValue = Value\n\n\texport interface Options {\n\t\tnode?: AnyNode\n\t\tschema?: Schema\n\t\tdimensions: SelectedDimensions\n\t\tparameters: Parameters\n\t\tvariables: CustomVariables\n\t\tparent?: Environment\n\t\textensions: Map<Extension<unknown, unknown>, unknown>\n\t}\n\n\texport type SubTreeNode =\n\t\t| SubTreeEntityNode\n\t\t| SubTreeEntityListNode\n\n\texport type InnerNode =\n\t\t| EntityNode\n\t\t| EntityListNode\n\t\t| ColumnNode\n\n\texport type AnyNode =\n\t\t| SubTreeNode\n\t\t| InnerNode\n\n\texport interface SubTreeEntityNode {\n\t\ttype: 'subtree-entity'\n\t\tentity: SchemaEntity\n\t\texpectedCardinality: 'zero' | 'one' | 'zero-or-one'\n\t\tfilter: Filter\n\t}\n\n\texport interface SubTreeEntityListNode {\n\t\ttype: 'subtree-entity-list'\n\t\tentity: SchemaEntity\n\t\texpectedCardinality: 'zero-to-many' | 'zero'\n\t\tfilter: Filter\n\t}\n\n\texport interface EntityNode {\n\t\ttype: 'entity'\n\t\tentity: SchemaEntity\n\t\tfield: SchemaRelation\n\t}\n\n\texport interface EntityListNode {\n\t\ttype: 'entity-list'\n\t\tentity: SchemaEntity\n\t\tfield: SchemaRelation\n\t}\n\n\texport interface ColumnNode {\n\t\ttype: 'column'\n\t\tentity: SchemaEntity\n\t\tfield: SchemaColumn\n\t}\n\n\texport interface SelectedDimensions {\n\t\t[key: string]: string[]\n\t}\n\n\texport type Parameters = {\n\t\t[K in string]?: string | number\n\t}\n\n\texport interface CustomVariables {\n\t\t[key: string]: Value\n\t}\n\n\texport interface ValuesMapWithFactory {\n\t\t[key: string]:\n\t\t\t| ((environment: Environment) => Value)\n\t\t\t| Value\n\t}\n\n\texport type Extension<State, Result> = {\n\t\tcreate: (state: State | undefined, environment: Environment) => Result\n\t}\n\n\texport const createExtension = <S, R>(create: Extension<S, R>['create'], otherMethods?: Omit<Extension<S, R>, 'create'>): Extension<S, R> => {\n\t\treturn {\n\t\t\tcreate,\n\t\t\t...otherMethods,\n\t\t}\n\t}\n\n\t/** @deprecated */\n\texport type DeltaFactory = ValuesMapWithFactory\n}\n\nexport { Environment }\n"],"names":["BindingError","Environment"],"mappings":";;;;AAMA,MAAM,YAAY;AAAA,EACT,YACU,SAChB;AADgB,SAAA,UAAA;AAAA,EAElB;AAAA,EAEA,OAAc,SAAS;AACtB,WAAO,IAAI,YAAY;AAAA,MACtB,YAAY,CAAC;AAAA,MACb,WAAW,CAAC;AAAA,MACZ,YAAY,CAAC;AAAA,MACb,gCAAgB,IAAI;AAAA,IAAA,CACpB;AAAA,EACF;AAAA,EAEO,aAAsC;AACnC,aAAA,MAAmB,MAAM,IAAI,QAAQ,MAAM,MAAM,IAAI,aAAa;AACpE,YAAA,OAAO,IAAI,QAAQ;AACzB,UAAI,KAAK,SAAS,oBAAoB,KAAK,SAAS,uBAAuB;AACnE,eAAA;AAAA,MACR;AAAA,IACD;AACM,UAAA,IAAIA,aAAAA,aAAa,kBAAkB;AAAA,EAC1C;AAAA,EAEO,iBAAsC;AACxC,QAAA,CAAC,KAAK,QAAQ,MAAM;AACvB,YAAM,IAAIA,aAAa,aAAA;AAAA,IACxB;AACA,WAAO,KAAK,QAAQ;AAAA,EACrB;AAAA,EAEO,YAAY,SAAkC;AACpD,UAAM,EAAE,QAAQ,GAAG,QAAA,IAAY,KAAK;AACpC,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QAAmC,iBAAoE;AACrI,WAAA;AAAA,MACN;AAAA,MACA,GAAG;AAAA,IAAA;AAAA,EACJ;AACD,GA9FS,gBAAA,cAAA,CAAA,EAAA;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Environment.js","sources":["../../../src/dao/Environment.ts"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { BindingError } from '../BindingError'\nimport type { Filter } from '../treeParameters'\nimport equal from 'fast-deep-equal/es6/index.js'\nimport { Schema, SchemaColumn, SchemaEntity, SchemaRelation } from '../core/schema'\nimport { GraphQlLiteral } from '@contember/client'\n\nclass Environment {\n\tprivate constructor(\n\t\tprivate readonly options: Environment.Options,\n\t) {\n\t}\n\n\tpublic static create() {\n\t\treturn new Environment({\n\t\t\tdimensions: {},\n\t\t\tvariables: {},\n\t\t\tparameters: {},\n\t\t\textensions: new Map(),\n\t\t})\n\t}\n\n\tpublic getSubTree(): Environment.SubTreeNode {\n\t\tfor (let env: Environment = this; env.options.node; env = env.getParent()) {\n\t\t\tconst node = env.options.node\n\t\t\tif (node.type === 'subtree-entity' || node.type === 'subtree-entity-list') {\n\t\t\t\treturn node\n\t\t\t}\n\t\t}\n\t\tthrow new BindingError('Not in a SubTree')\n\t}\n\n\tpublic getSubTreeNode(): Environment.AnyNode {\n\t\tif (!this.options.node) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\treturn this.options.node\n\t}\n\n\tpublic withSubTree(SubTree: Environment.SubTreeNode) {\n\t\tconst { parent, ...options } = this.options\n\t\treturn new Environment({\n\t\t\t...options,\n\t\t\tnode: SubTree,\n\t\t})\n\t}\n\n\tpublic withSubTreeChild(node: Environment.InnerNode) {\n\t\tif (!this.options.node) {\n\t\t\tthrow new BindingError(`Cannot call withSubTreeChild without previous call of withSubTree`)\n\t\t}\n\t\tif (this.options.node.entity.fields.get(node.field.name) !== node.field) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\tnode,\n\t\t\tparent: this,\n\t\t})\n\t}\n\n\n\tpublic hasVariable(key: string): boolean {\n\t\treturn key in this.options.variables\n\t}\n\n\tpublic getVariable<V extends Environment.Value = Environment.Value>(key: string): V {\n\t\tif (!(key in this.options.variables)) {\n\t\t\tthrow new BindingError(`Variable ${key} not found`)\n\t\t}\n\t\treturn this.options.variables[key] as V\n\t}\n\n\tpublic getVariableOrElse<F, V extends Environment.Value = Environment.Value>(key: string, fallback: F): V | F {\n\t\treturn (this.options.variables[key] as V) ?? fallback\n\t}\n\n\t/** @deprecated use getVariable or getParameter */\n\tpublic getValue<V extends Environment.Value = Environment.Value>(key: string): V {\n\t\tconsole.warn('Environment.getValue() is deprecated, use Environment.getVariable() or Environment.getParameter() instead.')\n\t\treturn this.getVariableOrElse(key, undefined) ?? this.getParameterOrElse(key, undefined) as V\n\t}\n\n\t/** @deprecated use getVariableOrElse or getParameterOrElse */\n\tpublic getValueOrElse<F, V extends Environment.Value = Environment.Value>(key: string, fallback: F): V | F {\n\t\tconsole.warn('Environment.getValueOrElse() is deprecated, use Environment.getVariableOrElse() or Environment.getParameterOrElse() instead.')\n\t\treturn this.getVariableOrElse(key, undefined) ?? this.getParameterOrElse(key, fallback) as any\n\t}\n\n\t/** @deprecated */\n\tpublic hasName(key: string): boolean {\n\t\tconsole.warn('Environment.hasName() is deprecated, use Environment.hasVariable() or Environment.hasParameter() instead.')\n\t\treturn key in this.options.variables || key in this.options.parameters\n\t}\n\n\tpublic withVariables(variables: Environment.ValuesMapWithFactory | undefined): Environment {\n\t\tif (variables === undefined) {\n\t\t\treturn this\n\t\t}\n\t\tconst newVariables = { ...this.options.variables }\n\t\tfor (const [newName, newValue] of Object.entries(variables)) {\n\t\t\tif (newName === 'labelMiddleware') {\n\t\t\t\tthrow new BindingError('You cannot pass labelMiddleware to withVariables method. Use withLabelMiddleware instead.')\n\t\t\t}\n\t\t\tconst resolvedValue = typeof newValue === 'function' ? newValue(this) : newValue\n\t\t\tif (resolvedValue === undefined) {\n\t\t\t\tdelete newVariables[newName]\n\t\t\t} else {\n\t\t\t\tnewVariables[newName] = resolvedValue\n\t\t\t}\n\t\t}\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\tvariables: newVariables,\n\t\t\tparent: this,\n\t\t})\n\t}\n\n\tpublic getAllVariables() {\n\t\treturn this.options.variables\n\t}\n\n\tpublic hasParameter(key: string): boolean {\n\t\treturn key in this.options.parameters\n\t}\n\n\tpublic getParameter<F>(key: string): string | number {\n\t\tif (!(key in this.options.parameters)) {\n\t\t\tthrow new BindingError(`Parameter ${key} not found`)\n\t\t}\n\t\treturn this.options.parameters[key] as string | number\n\t}\n\n\tpublic getParameterOrElse<F>(key: string, fallback: F): string | number | F {\n\t\treturn this.options.parameters[key] ?? fallback\n\t}\n\n\tpublic getAllParameters() {\n\t\treturn this.options.parameters\n\t}\n\n\tpublic withParameters(parameters: Environment.Parameters): Environment {\n\t\treturn new Environment({ ...this.options, parameters })\n\t}\n\n\tpublic hasDimension(dimensionName: string): boolean {\n\t\treturn dimensionName in this.options.dimensions\n\t}\n\n\tpublic getDimension<F>(dimensionName: string): string[] {\n\t\tif (!(dimensionName in this.options.dimensions)) {\n\t\t\tthrow new BindingError(`Dimension ${dimensionName} does not exist.`)\n\t\t}\n\t\treturn this.options.dimensions[dimensionName]\n\t}\n\n\tpublic getDimensionOrElse<F>(dimensionName: string, fallback: F): string[] | F {\n\t\treturn this.options.dimensions[dimensionName] ?? fallback\n\t}\n\n\tpublic getAllDimensions(): Environment.SelectedDimensions {\n\t\treturn this.options.dimensions\n\t}\n\n\tpublic withDimensions(dimensions: Environment.SelectedDimensions): Environment {\n\t\tconst newDimensions = {\n\t\t\t...this.options.dimensions,\n\t\t\t...dimensions,\n\t\t}\n\t\tif (equal(newDimensions, this.options.dimensions)) {\n\t\t\treturn this\n\t\t}\n\t\treturn new Environment({ ...this.options, dimensions: newDimensions })\n\t}\n\n\tpublic getSchema(): Schema {\n\t\tif (!this.options.schema) {\n\t\t\tthrow new BindingError('Schema is not set')\n\t\t}\n\t\treturn this.options.schema\n\t}\n\n\tpublic withSchema(schema: Schema): Environment {\n\t\treturn new Environment({ ...this.options, schema })\n\t}\n\n\tpublic getParent(): Environment {\n\t\tif (!this.options.parent) {\n\t\t\tthrow new BindingError('There is no parent environment')\n\t\t}\n\t\treturn this.options.parent\n\t}\n\n\tpublic withExtension<S, R>(extension: Environment.Extension<S, R>, state: S): Environment {\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\textensions: new Map([...this.options.extensions, [extension, state] as [Environment.Extension<unknown, unknown>, unknown]]),\n\t\t})\n\t}\n\n\tpublic getExtension<S, R>(extension: Environment.Extension<S, R>): R {\n\t\tconst state = this.options.extensions.get(extension as Environment.Extension<unknown, unknown>)\n\t\treturn extension.create(state as S, this)\n\t}\n\n\tpublic merge(other: Environment): Environment {\n\t\tif (other === this) {\n\t\t\treturn this\n\t\t}\n\t\tif (!equal(this.options.node, other.options.node)) {\n\t\t\tthrow new BindingError(`Cannot merge two environments with different tree position.`)\n\t\t}\n\t\tif (this.options.parameters !== other.options.parameters) {\n\t\t\tthrow new BindingError(`Cannot merge two environments with different parameters.`)\n\t\t}\n\t\tif (this.options.dimensions !== other.options.dimensions) {\n\t\t\tthrow new BindingError(`Cannot merge two environments with different dimensions.`)\n\t\t}\n\t\tif (this.options.extensions !== other.options.extensions) {\n\t\t\t// todo: deep compare?\n\t\t\tthrow new BindingError(`Cannot merge two environments with different extensions.`)\n\t\t}\n\n\t\tif (equal(this.options.variables, other.options.variables) && this.options.parent === other.options.parent) {\n\t\t\treturn this\n\t\t}\n\t\tfor (const key in other.options.variables) {\n\t\t\tif (key in this.options.variables && !equal(this.options.variables[key], other.options.variables[key])) {\n\t\t\t\tthrow new BindingError(`Cannot merge two environments with different value of variable ${key}:\\n`\n\t\t\t\t\t+ JSON.stringify(this.options.variables[key]) + '\\n'\n\t\t\t\t\t+ JSON.stringify(other.options.variables[key]))\n\t\t\t}\n\t\t}\n\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\tparent: this.options.parent && other.options.parent ? this.options.parent.merge(other.options.parent) : undefined,\n\t\t\tvariables: { ...this.options.variables, ...other.options.variables },\n\t\t})\n\t}\n}\n\nnamespace Environment {\n\texport type Name = string\n\n\texport type Value = ReactNode | GraphQlLiteral | Filter\n\n\texport type ResolvedValue = Value\n\n\texport interface Options {\n\t\tnode?: AnyNode\n\t\tschema?: Schema\n\t\tdimensions: SelectedDimensions\n\t\tparameters: Parameters\n\t\tvariables: CustomVariables\n\t\tparent?: Environment\n\t\textensions: Map<Extension<unknown, unknown>, unknown>\n\t}\n\n\texport type SubTreeNode =\n\t\t| SubTreeEntityNode\n\t\t| SubTreeEntityListNode\n\n\texport type InnerNode =\n\t\t| EntityNode\n\t\t| EntityListNode\n\t\t| ColumnNode\n\n\texport type AnyNode =\n\t\t| SubTreeNode\n\t\t| InnerNode\n\n\texport interface SubTreeEntityNode {\n\t\ttype: 'subtree-entity'\n\t\tentity: SchemaEntity\n\t\texpectedCardinality: 'zero' | 'one' | 'zero-or-one'\n\t\tfilter: Filter\n\t}\n\n\texport interface SubTreeEntityListNode {\n\t\ttype: 'subtree-entity-list'\n\t\tentity: SchemaEntity\n\t\texpectedCardinality: 'zero-to-many' | 'zero'\n\t\tfilter: Filter\n\t}\n\n\texport interface EntityNode {\n\t\ttype: 'entity'\n\t\tentity: SchemaEntity\n\t\tfield: SchemaRelation\n\t}\n\n\texport interface EntityListNode {\n\t\ttype: 'entity-list'\n\t\tentity: SchemaEntity\n\t\tfield: SchemaRelation\n\t}\n\n\texport interface ColumnNode {\n\t\ttype: 'column'\n\t\tentity: SchemaEntity\n\t\tfield: SchemaColumn\n\t}\n\n\texport interface SelectedDimensions {\n\t\t[key: string]: string[]\n\t}\n\n\texport type Parameters = {\n\t\t[K in string]?: string | number\n\t}\n\n\texport interface CustomVariables {\n\t\t[key: string]: Value\n\t}\n\n\texport interface ValuesMapWithFactory {\n\t\t[key: string]:\n\t\t\t| ((environment: Environment) => Value)\n\t\t\t| Value\n\t}\n\n\texport type Extension<State, Result> = {\n\t\tcreate: (state: State | undefined, environment: Environment) => Result\n\t}\n\n\texport const createExtension = <S, R>(create: Extension<S, R>['create'], otherMethods?: Omit<Extension<S, R>, 'create'>): Extension<S, R> => {\n\t\treturn {\n\t\t\tcreate,\n\t\t\t...otherMethods,\n\t\t}\n\t}\n\n\t/** @deprecated */\n\texport type DeltaFactory = ValuesMapWithFactory\n}\n\nexport { Environment }\n"],"names":["Environment"],"mappings":";;AAOA,MAAM,YAAY;AAAA,EACT,YACU,SAChB;AADgB,SAAA,UAAA;AAAA,EAElB;AAAA,EAEA,OAAc,SAAS;AACtB,WAAO,IAAI,YAAY;AAAA,MACtB,YAAY,CAAC;AAAA,MACb,WAAW,CAAC;AAAA,MACZ,YAAY,CAAC;AAAA,MACb,gCAAgB,IAAI;AAAA,IAAA,CACpB;AAAA,EACF;AAAA,EAEO,aAAsC;AACnC,aAAA,MAAmB,MAAM,IAAI,QAAQ,MAAM,MAAM,IAAI,aAAa;AACpE,YAAA,OAAO,IAAI,QAAQ;AACzB,UAAI,KAAK,SAAS,oBAAoB,KAAK,SAAS,uBAAuB;AACnE,eAAA;AAAA,MACR;AAAA,IACD;AACM,UAAA,IAAI,aAAa,kBAAkB;AAAA,EAC1C;AAAA,EAEO,iBAAsC;AACxC,QAAA,CAAC,KAAK,QAAQ,MAAM;AACvB,YAAM,IAAI,aAAa;AAAA,IACxB;AACA,WAAO,KAAK,QAAQ;AAAA,EACrB;AAAA,EAEO,YAAY,SAAkC;AACpD,UAAM,EAAE,QAAQ,GAAG,QAAA,IAAY,KAAK;AACpC,WAAO,IAAI,YAAY;AAAA,MACtB,GAAG;AAAA,MACH,MAAM;AAAA,IAAA,CACN;AAAA,EACF;AAAA,EAEO,iBAAiB,MAA6B;AAChD,QAAA,CAAC,KAAK,QAAQ,MAAM;AACjB,YAAA,IAAI,aAAa,mEAAmE;AAAA,IAC3F;AACI,QAAA,KAAK,QAAQ,K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,YAAY;AACnD,YAAA,IAAI,aAAa,0DAA0D;AAAA,IAClF;AACA,QAAI,KAAK,QAAQ,eAAe,MAAM,QAAQ,YAAY;AAEnD,YAAA,IAAI,aAAa,0DAA0D;AAAA,IAClF;AAEA,QAAI,MAAM,KAAK,QAAQ,WAAW,MAAM,QAAQ,SAAS,KAAK,KAAK,QAAQ,WAAW,MAAM,QAAQ,QAAQ;AACpG,aAAA;AAAA,IACR;AACW,eAAA,OAAO,MAAM,QAAQ,WAAW;AAC1C,UAAI,OAAO,KAAK,QAAQ,aAAa,CAAC,MAAM,KAAK,QAAQ,UAAU,GAAG,GAAG,MAAM,QAAQ,UAAU,GAAG,CAAC,GAAG;AACjG,cAAA,IAAI,aAAa,kEAAkE;AAAA,IACtF,KAAK,UAAU,KAAK,QAAQ,UAAU,GAAG,CAAC,IAAI,OAC9C,KAAK,UAAU,MAAM,QAAQ,UAAU,GAAG,CAAC,CAAC;AAAA,MAChD;AAAA,IACD;AAEA,WAAO,IAAI,YAAY;AAAA,MACtB,GAAG,KAAK;AAAA,MACR,QAAQ,KAAK,QAAQ,UAAU,MAAM,QAAQ,SAAS,KAAK,QAAQ,OAAO,MAAM,MAAM,QAAQ,MAAM,IAAI;AAAA,MACxG,WAAW,EAAE,GAAG,KAAK,QAAQ,WAAW,GAAG,MAAM,QAAQ,UAAU;AAAA,IAAA,CACnE;AAAA,EACF;AACD;AAAA,CAEA,CAAUA,iBAAV;AAoFcA,eAAA,kBAAkB,CAAO,QAAmC,iBAAoE;AACrI,WAAA;AAAA,MACN;AAAA,MACA,GAAG;AAAA,IAAA;AAAA,EACJ;AACD,GAzFS,gBAAA,cAAA,CAAA,EAAA;"}
1
+ {"version":3,"file":"Environment.js","sources":["../../../src/dao/Environment.ts"],"sourcesContent":["import { BindingError } from '../BindingError'\nimport type { Filter } from '../treeParameters'\nimport equal from 'fast-deep-equal/es6/index.js'\nimport { Schema, SchemaColumn, SchemaEntity, SchemaRelation } from '../core/schema'\nimport { GraphQlLiteral } from '@contember/client'\n\nclass Environment {\n\tprivate constructor(\n\t\tprivate readonly options: Environment.Options,\n\t) {\n\t}\n\n\tpublic static create() {\n\t\treturn new Environment({\n\t\t\tdimensions: {},\n\t\t\tvariables: {},\n\t\t\tparameters: {},\n\t\t\textensions: new Map(),\n\t\t})\n\t}\n\n\tpublic getSubTree(): Environment.SubTreeNode {\n\t\tfor (let env: Environment = this; env.options.node; env = env.getParent()) {\n\t\t\tconst node = env.options.node\n\t\t\tif (node.type === 'subtree-entity' || node.type === 'subtree-entity-list') {\n\t\t\t\treturn node\n\t\t\t}\n\t\t}\n\t\tthrow new BindingError('Not in a SubTree')\n\t}\n\n\tpublic getSubTreeNode(): Environment.AnyNode {\n\t\tif (!this.options.node) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\treturn this.options.node\n\t}\n\n\tpublic withSubTree(SubTree: Environment.SubTreeNode) {\n\t\tconst { parent, ...options } = this.options\n\t\treturn new Environment({\n\t\t\t...options,\n\t\t\tnode: SubTree,\n\t\t})\n\t}\n\n\tpublic withSubTreeChild(node: Environment.InnerNode) {\n\t\tif (!this.options.node) {\n\t\t\tthrow new BindingError(`Cannot call withSubTreeChild without previous call of withSubTree`)\n\t\t}\n\t\tif (this.options.node.entity.fields.get(node.field.name) !== node.field) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\tnode,\n\t\t\tparent: this,\n\t\t})\n\t}\n\n\n\tpublic hasVariable(key: string): boolean {\n\t\treturn key in this.options.variables\n\t}\n\n\tpublic getVariable<V extends Environment.Value = Environment.Value>(key: string): V {\n\t\tif (!(key in this.options.variables)) {\n\t\t\tthrow new BindingError(`Variable ${key} not found`)\n\t\t}\n\t\treturn this.options.variables[key] as V\n\t}\n\n\tpublic getVariableOrElse<F, V extends Environment.Value = Environment.Value>(key: string, fallback: F): V | F {\n\t\treturn (this.options.variables[key] as V) ?? fallback\n\t}\n\n\t/** @deprecated use getVariable or getParameter */\n\tpublic getValue<V extends Environment.Value = Environment.Value>(key: string): V {\n\t\tconsole.warn('Environment.getValue() is deprecated, use Environment.getVariable() or Environment.getParameter() instead.')\n\t\treturn this.getVariableOrElse(key, undefined) ?? this.getParameterOrElse(key, undefined) as V\n\t}\n\n\t/** @deprecated use getVariableOrElse or getParameterOrElse */\n\tpublic getValueOrElse<F, V extends Environment.Value = Environment.Value>(key: string, fallback: F): V | F {\n\t\tconsole.warn('Environment.getValueOrElse() is deprecated, use Environment.getVariableOrElse() or Environment.getParameterOrElse() instead.')\n\t\treturn this.getVariableOrElse(key, undefined) ?? this.getParameterOrElse(key, fallback) as any\n\t}\n\n\t/** @deprecated */\n\tpublic hasName(key: string): boolean {\n\t\tconsole.warn('Environment.hasName() is deprecated, use Environment.hasVariable() or Environment.hasParameter() instead.')\n\t\treturn key in this.options.variables || key in this.options.parameters\n\t}\n\n\tpublic withVariables(variables: Environment.ValuesMapWithFactory | undefined): Environment {\n\t\tif (variables === undefined) {\n\t\t\treturn this\n\t\t}\n\t\tconst newVariables = { ...this.options.variables }\n\t\tfor (const [newName, newValue] of Object.entries(variables)) {\n\t\t\tif (newName === 'labelMiddleware') {\n\t\t\t\tthrow new BindingError('You cannot pass labelMiddleware to withVariables method. Use withLabelMiddleware instead.')\n\t\t\t}\n\t\t\tconst resolvedValue = typeof newValue === 'function' ? newValue(this) : newValue\n\t\t\tif (resolvedValue === undefined) {\n\t\t\t\tdelete newVariables[newName]\n\t\t\t} else {\n\t\t\t\tnewVariables[newName] = resolvedValue\n\t\t\t}\n\t\t}\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\tvariables: newVariables,\n\t\t\tparent: this,\n\t\t})\n\t}\n\n\tpublic getAllVariables() {\n\t\treturn this.options.variables\n\t}\n\n\tpublic hasParameter(key: string): boolean {\n\t\treturn key in this.options.parameters\n\t}\n\n\tpublic getParameter<F>(key: string): string | number {\n\t\tif (!(key in this.options.parameters)) {\n\t\t\tthrow new BindingError(`Parameter ${key} not found`)\n\t\t}\n\t\treturn this.options.parameters[key] as string | number\n\t}\n\n\tpublic getParameterOrElse<F>(key: string, fallback: F): string | number | F {\n\t\treturn this.options.parameters[key] ?? fallback\n\t}\n\n\tpublic getAllParameters() {\n\t\treturn this.options.parameters\n\t}\n\n\tpublic withParameters(parameters: Environment.Parameters): Environment {\n\t\treturn new Environment({ ...this.options, parameters })\n\t}\n\n\tpublic hasDimension(dimensionName: string): boolean {\n\t\treturn dimensionName in this.options.dimensions\n\t}\n\n\tpublic getDimension<F>(dimensionName: string): string[] {\n\t\tif (!(dimensionName in this.options.dimensions)) {\n\t\t\tthrow new BindingError(`Dimension ${dimensionName} does not exist.`)\n\t\t}\n\t\treturn this.options.dimensions[dimensionName]\n\t}\n\n\tpublic getDimensionOrElse<F>(dimensionName: string, fallback: F): string[] | F {\n\t\treturn this.options.dimensions[dimensionName] ?? fallback\n\t}\n\n\tpublic getAllDimensions(): Environment.SelectedDimensions {\n\t\treturn this.options.dimensions\n\t}\n\n\tpublic withDimensions(dimensions: Environment.SelectedDimensions): Environment {\n\t\tconst newDimensions = {\n\t\t\t...this.options.dimensions,\n\t\t\t...dimensions,\n\t\t}\n\t\tif (equal(newDimensions, this.options.dimensions)) {\n\t\t\treturn this\n\t\t}\n\t\treturn new Environment({ ...this.options, dimensions: newDimensions })\n\t}\n\n\tpublic getSchema(): Schema {\n\t\tif (!this.options.schema) {\n\t\t\tthrow new BindingError('Schema is not set')\n\t\t}\n\t\treturn this.options.schema\n\t}\n\n\tpublic withSchema(schema: Schema): Environment {\n\t\treturn new Environment({ ...this.options, schema })\n\t}\n\n\tpublic getParent(): Environment {\n\t\tif (!this.options.parent) {\n\t\t\tthrow new BindingError('There is no parent environment')\n\t\t}\n\t\treturn this.options.parent\n\t}\n\n\tpublic withExtension<S, R>(extension: Environment.Extension<S, R>, state: S): Environment {\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\textensions: new Map([...this.options.extensions, [extension, state] as [Environment.Extension<unknown, unknown>, unknown]]),\n\t\t})\n\t}\n\n\tpublic getExtension<S, R>(extension: Environment.Extension<S, R>): R {\n\t\tconst state = this.options.extensions.get(extension as Environment.Extension<unknown, unknown>)\n\t\treturn extension.create(state as S, this)\n\t}\n\n\tpublic merge(other: Environment): Environment {\n\t\tif (other === this) {\n\t\t\treturn this\n\t\t}\n\t\tif (!equal(this.options.node, other.options.node)) {\n\t\t\tthrow new BindingError(`Cannot merge two environments with different tree position.`)\n\t\t}\n\t\tif (this.options.parameters !== other.options.parameters) {\n\t\t\tthrow new BindingError(`Cannot merge two environments with different parameters.`)\n\t\t}\n\t\tif (this.options.dimensions !== other.options.dimensions) {\n\t\t\tthrow new BindingError(`Cannot merge two environments with different dimensions.`)\n\t\t}\n\t\tif (this.options.extensions !== other.options.extensions) {\n\t\t\t// todo: deep compare?\n\t\t\tthrow new BindingError(`Cannot merge two environments with different extensions.`)\n\t\t}\n\n\t\tif (equal(this.options.variables, other.options.variables) && this.options.parent === other.options.parent) {\n\t\t\treturn this\n\t\t}\n\t\tfor (const key in other.options.variables) {\n\t\t\tif (key in this.options.variables && !equal(this.options.variables[key], other.options.variables[key])) {\n\t\t\t\tthrow new BindingError(`Cannot merge two environments with different value of variable ${key}:\\n`\n\t\t\t\t\t+ JSON.stringify(this.options.variables[key]) + '\\n'\n\t\t\t\t\t+ JSON.stringify(other.options.variables[key]))\n\t\t\t}\n\t\t}\n\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\tparent: this.options.parent && other.options.parent ? this.options.parent.merge(other.options.parent) : undefined,\n\t\t\tvariables: { ...this.options.variables, ...other.options.variables },\n\t\t})\n\t}\n}\n\nnamespace Environment {\n\texport type Name = string\n\n\texport type ReactElementLike = {\n\t\ttype: any\n\t\tprops: any\n\t}\n\n\texport type Value = string | number | boolean | undefined | GraphQlLiteral | Filter | ReactElementLike\n\n\texport type ResolvedValue = Value\n\n\texport interface Options {\n\t\tnode?: AnyNode\n\t\tschema?: Schema\n\t\tdimensions: SelectedDimensions\n\t\tparameters: Parameters\n\t\tvariables: CustomVariables\n\t\tparent?: Environment\n\t\textensions: Map<Extension<unknown, unknown>, unknown>\n\t}\n\n\texport type SubTreeNode =\n\t\t| SubTreeEntityNode\n\t\t| SubTreeEntityListNode\n\n\texport type InnerNode =\n\t\t| EntityNode\n\t\t| EntityListNode\n\t\t| ColumnNode\n\n\texport type AnyNode =\n\t\t| SubTreeNode\n\t\t| InnerNode\n\n\texport interface SubTreeEntityNode {\n\t\ttype: 'subtree-entity'\n\t\tentity: SchemaEntity\n\t\texpectedCardinality: 'zero' | 'one' | 'zero-or-one'\n\t\tfilter: Filter\n\t}\n\n\texport interface SubTreeEntityListNode {\n\t\ttype: 'subtree-entity-list'\n\t\tentity: SchemaEntity\n\t\texpectedCardinality: 'zero-to-many' | 'zero'\n\t\tfilter: Filter\n\t}\n\n\texport interface EntityNode {\n\t\ttype: 'entity'\n\t\tentity: SchemaEntity\n\t\tfield: SchemaRelation\n\t}\n\n\texport interface EntityListNode {\n\t\ttype: 'entity-list'\n\t\tentity: SchemaEntity\n\t\tfield: SchemaRelation\n\t}\n\n\texport interface ColumnNode {\n\t\ttype: 'column'\n\t\tentity: SchemaEntity\n\t\tfield: SchemaColumn\n\t}\n\n\texport interface SelectedDimensions {\n\t\t[key: string]: string[]\n\t}\n\n\texport type Parameters = {\n\t\t[K in string]?: string | number\n\t}\n\n\texport interface CustomVariables {\n\t\t[key: string]: Value\n\t}\n\n\texport interface ValuesMapWithFactory {\n\t\t[key: string]:\n\t\t\t| ((environment: Environment) => Value)\n\t\t\t| Value\n\t}\n\n\texport type Extension<State, Result> = {\n\t\tcreate: (state: State | undefined, environment: Environment) => Result\n\t}\n\n\texport const createExtension = <S, R>(create: Extension<S, R>['create'], otherMethods?: Omit<Extension<S, R>, 'create'>): Extension<S, R> => {\n\t\treturn {\n\t\t\tcreate,\n\t\t\t...otherMethods,\n\t\t}\n\t}\n\n\t/** @deprecated */\n\texport type DeltaFactory = ValuesMapWithFactory\n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