ballerina-core 1.0.256 → 1.0.258

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 (321) hide show
  1. package/bin/src/api-response-handler/coroutines/runner.js +20 -13
  2. package/bin/src/api-response-handler/state.js +13 -11
  3. package/bin/src/apiResultStatus/state.d.ts +10 -3
  4. package/bin/src/apiResultStatus/state.js +2 -5
  5. package/bin/src/async/domains/mirroring/domains/collection/coroutines/synchronizers.js +314 -196
  6. package/bin/src/async/domains/mirroring/domains/collection/state.js +126 -36
  7. package/bin/src/async/domains/mirroring/domains/entity/domains/loaded-collection/state.js +18 -11
  8. package/bin/src/async/domains/mirroring/domains/entity/domains/loaded-collection-entity/state.js +19 -19
  9. package/bin/src/async/domains/mirroring/domains/entity/domains/loaded-entities/state.js +1 -1
  10. package/bin/src/async/domains/mirroring/domains/entity/domains/loaded-entity/state.js +18 -18
  11. package/bin/src/async/domains/mirroring/domains/entity/state.js +18 -9
  12. package/bin/src/async/domains/mirroring/domains/singleton/coroutines/synchronizers.js +134 -83
  13. package/bin/src/async/domains/mirroring/domains/singleton/state.js +52 -8
  14. package/bin/src/async/domains/mirroring/domains/synchronization-result/state.d.ts +15 -9
  15. package/bin/src/async/domains/mirroring/domains/synchronization-result/state.js +1 -1
  16. package/bin/src/async/domains/mirroring/domains/synchronized-entities/state.js +7 -4
  17. package/bin/src/async/domains/promise/state.d.ts +9 -4
  18. package/bin/src/async/domains/promise/state.js +20 -9
  19. package/bin/src/async/domains/synchronized/coroutines/synchronize.js +80 -28
  20. package/bin/src/async/domains/synchronized/state.d.ts +14 -7
  21. package/bin/src/async/domains/synchronized/state.js +16 -6
  22. package/bin/src/async/state.d.ts +56 -45
  23. package/bin/src/async/state.js +115 -97
  24. package/bin/src/baseEntity/domains/identifiable/state.d.ts +15 -11
  25. package/bin/src/baseEntity/domains/identifiable/state.js +9 -9
  26. package/bin/src/collections/domains/array/state.d.ts +7 -7
  27. package/bin/src/collections/domains/array/state.js +5 -5
  28. package/bin/src/collections/domains/errors/state.d.ts +10 -10
  29. package/bin/src/collections/domains/errors/state.js +10 -10
  30. package/bin/src/collections/domains/immutable/domains/list/state.js +46 -44
  31. package/bin/src/collections/domains/immutable/domains/map/state.js +41 -23
  32. package/bin/src/collections/domains/immutable/domains/orderedMap/state.js +84 -65
  33. package/bin/src/collections/domains/immutable/domains/ordereredSet/state.d.ts +6 -6
  34. package/bin/src/collections/domains/immutable/domains/ordereredSet/state.js +6 -6
  35. package/bin/src/collections/domains/maybe/state.d.ts +9 -9
  36. package/bin/src/collections/domains/maybe/state.js +12 -9
  37. package/bin/src/collections/domains/product/state.d.ts +25 -19
  38. package/bin/src/collections/domains/product/state.js +13 -10
  39. package/bin/src/collections/domains/sum/state.d.ts +101 -77
  40. package/bin/src/collections/domains/sum/state.js +49 -32
  41. package/bin/src/collections/domains/valueOrErrors/state.js +81 -56
  42. package/bin/src/coroutines/builder.js +40 -19
  43. package/bin/src/coroutines/state.js +381 -306
  44. package/bin/src/coroutines/template.js +97 -59
  45. package/bin/src/debounced/coroutines/debounce.js +115 -89
  46. package/bin/src/debounced/state.js +62 -25
  47. package/bin/src/diagnostics/domains/message-box/state.d.ts +1 -1
  48. package/bin/src/diagnostics/domains/message-box/state.js +3 -3
  49. package/bin/src/foreignMutations/state.d.ts +3 -3
  50. package/bin/src/foreignMutations/state.js +1 -1
  51. package/bin/src/forms/domains/attachments/views/attachments-view.js +30 -8
  52. package/bin/src/forms/domains/collection/domains/reference/state.js +26 -20
  53. package/bin/src/forms/domains/collection/domains/selection/state.js +1 -1
  54. package/bin/src/forms/domains/dispatched-forms/built-ins/state.js +2007 -754
  55. package/bin/src/forms/domains/dispatched-forms/deserializer/coroutines/runner.d.ts.map +1 -1
  56. package/bin/src/forms/domains/dispatched-forms/deserializer/coroutines/runner.js +123 -44
  57. package/bin/src/forms/domains/dispatched-forms/deserializer/coroutines/runner.js.map +1 -1
  58. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/enum/state.js +40 -27
  59. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/primitive/state.js +21 -13
  60. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/stream/state.js +43 -27
  61. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/sumUnitDate/state.js +39 -22
  62. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/serializable/state.d.ts +167 -0
  63. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/serializable/state.d.ts.map +1 -0
  64. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/serializable/state.js +367 -0
  65. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/serializable/state.js.map +1 -0
  66. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/types/state.d.ts +7 -29
  67. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/types/state.d.ts.map +1 -1
  68. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/types/state.js +1098 -572
  69. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/types/state.js.map +1 -1
  70. package/bin/src/forms/domains/dispatched-forms/deserializer/state.d.ts +1 -0
  71. package/bin/src/forms/domains/dispatched-forms/deserializer/state.d.ts.map +1 -1
  72. package/bin/src/forms/domains/dispatched-forms/deserializer/state.js +322 -90
  73. package/bin/src/forms/domains/dispatched-forms/deserializer/state.js.map +1 -1
  74. package/bin/src/forms/domains/dispatched-forms/deserializer/template.js +3 -2
  75. package/bin/src/forms/domains/dispatched-forms/runner/coroutines/runner.d.ts +27 -4
  76. package/bin/src/forms/domains/dispatched-forms/runner/coroutines/runner.js +136 -82
  77. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/base-64-file/state.js +3 -3
  78. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/base-64-file/template.js +49 -23
  79. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/boolean/state.js +3 -3
  80. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/boolean/template.js +52 -24
  81. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/date/state.js +18 -6
  82. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/date/template.js +64 -30
  83. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/enum/state.js +9 -6
  84. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/enum/template.js +153 -60
  85. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/enum-multiselect/state.js +1 -1
  86. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/enum-multiselect/template.js +127 -50
  87. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/injectables/state.js +40 -22
  88. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/list/state.js +31 -13
  89. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/list/template.js +452 -152
  90. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/lookup-type/state.js +1 -1
  91. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/lookup-type/template.js +29 -8
  92. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/lookup-type/template.js.map +1 -1
  93. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/map/state.js +61 -18
  94. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/map/template.js +329 -90
  95. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/number/state.js +3 -3
  96. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/number/template.js +54 -23
  97. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/one/coroutines/_debouncer.js +22 -10
  98. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/one/coroutines/_initializeOne.js +49 -31
  99. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/one/coroutines/_initializeStream.js +29 -10
  100. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/one/coroutines/builder.js +2 -2
  101. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/one/coroutines/runner.js +47 -26
  102. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/one/state.js +88 -40
  103. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/one/template.js +386 -152
  104. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/readOnly/state.js +19 -10
  105. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/readOnly/template.js +99 -33
  106. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/record/state.js +32 -11
  107. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/record/template.js +227 -82
  108. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/searchable-infinite-stream/state.js +35 -13
  109. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/searchable-infinite-stream/template.js +195 -68
  110. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/searchable-infinite-stream-multiselect/state.js +36 -13
  111. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/searchable-infinite-stream-multiselect/template.js +246 -106
  112. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/secret/state.js +3 -3
  113. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/secret/template.js +54 -23
  114. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/state.js +40 -27
  115. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/string/state.js +3 -3
  116. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/string/template.js +58 -26
  117. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/sum/state.js +22 -7
  118. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/sum/template.js +188 -53
  119. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/coroutines/builder.js +2 -2
  120. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/coroutines/infiniteLoader.js +57 -24
  121. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/coroutines/initialiseFiltersAndSorting.js +70 -20
  122. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/coroutines/initialiseTable.d.ts.map +1 -1
  123. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/coroutines/initialiseTable.js +88 -48
  124. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/coroutines/initialiseTable.js.map +1 -1
  125. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/coroutines/loadWithRetries.js +40 -20
  126. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/coroutines/runner.js +43 -15
  127. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/state.js +301 -137
  128. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/state.js.map +1 -1
  129. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/template.js +692 -240
  130. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/tuple/state.js +20 -8
  131. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/tuple/template.js +132 -35
  132. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/union/state.js +21 -8
  133. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/union/template.js +105 -33
  134. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/unit/state.js +12 -9
  135. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/unit/template.js +54 -20
  136. package/bin/src/forms/domains/dispatched-forms/runner/domains/deltas/state.js +716 -560
  137. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/list/state.js +58 -18
  138. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/lookup/state.js +45 -14
  139. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/map/state.js +76 -18
  140. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/multiSelection/state.js +82 -24
  141. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/nestedDispatcher/state.js +37 -8
  142. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/one/state.js +120 -36
  143. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/primitive/state.js +145 -63
  144. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/readOnly/state.js +44 -12
  145. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/record/recordField/state.js +14 -4
  146. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/record/state.js +81 -25
  147. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/singleSelectionDispatcher/state.js +82 -24
  148. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/sum/state.js +63 -20
  149. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/table/state.js +248 -74
  150. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/tupleDispatcher/state.js +61 -13
  151. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/unionDispatcher/state.js +92 -33
  152. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/state.js +144 -45
  153. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/create/coroutines/_init.js +203 -95
  154. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/create/coroutines/_sync.js +79 -37
  155. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/create/coroutines/builder.js +2 -2
  156. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/create/coroutines/runner.js +19 -17
  157. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/create/state.js +58 -11
  158. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/create/template.js +73 -25
  159. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/edit/coroutines/_init.js +205 -95
  160. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/edit/coroutines/_sync.js +78 -37
  161. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/edit/coroutines/builder.js +2 -2
  162. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/edit/coroutines/runner.js +19 -17
  163. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/edit/state.js +58 -11
  164. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/edit/template.js +71 -25
  165. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/passthrough/coroutines/runner.js +163 -85
  166. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/passthrough/state.js +10 -4
  167. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/passthrough/template.js +72 -27
  168. package/bin/src/forms/domains/dispatched-forms/runner/domains/traversal/state.js +796 -436
  169. package/bin/src/forms/domains/dispatched-forms/runner/state.js +62 -38
  170. package/bin/src/forms/domains/dispatched-forms/runner/template.js +78 -25
  171. package/bin/src/forms/domains/launcher/coroutines/runner.js +120 -45
  172. package/bin/src/forms/domains/launcher/domains/create/coroutines/runner.js +240 -101
  173. package/bin/src/forms/domains/launcher/domains/create/state.js +62 -17
  174. package/bin/src/forms/domains/launcher/domains/create/template.js +84 -42
  175. package/bin/src/forms/domains/launcher/domains/edit/coroutines/runner.js +242 -103
  176. package/bin/src/forms/domains/launcher/domains/edit/state.js +62 -17
  177. package/bin/src/forms/domains/launcher/domains/edit/template.js +86 -43
  178. package/bin/src/forms/domains/launcher/domains/merger/state.d.ts +4 -4
  179. package/bin/src/forms/domains/launcher/domains/merger/state.js +35 -26
  180. package/bin/src/forms/domains/launcher/domains/passthrough/coroutines/runner.js +88 -42
  181. package/bin/src/forms/domains/launcher/domains/passthrough/state.js +44 -19
  182. package/bin/src/forms/domains/launcher/domains/passthrough/template.js +56 -34
  183. package/bin/src/forms/domains/launcher/state.js +6 -6
  184. package/bin/src/forms/domains/launcher/template.js +169 -85
  185. package/bin/src/forms/domains/parser/coroutines/runner.js +87 -25
  186. package/bin/src/forms/domains/parser/domains/built-ins/state.js +944 -533
  187. package/bin/src/forms/domains/parser/domains/deltas/state.js +444 -318
  188. package/bin/src/forms/domains/parser/domains/injectables/state.js +29 -26
  189. package/bin/src/forms/domains/parser/domains/layout/state.js +271 -183
  190. package/bin/src/forms/domains/parser/domains/predicates/domains/extractor/state.js +324 -162
  191. package/bin/src/forms/domains/parser/domains/predicates/state.js +1514 -984
  192. package/bin/src/forms/domains/parser/domains/renderer/state.js +1137 -480
  193. package/bin/src/forms/domains/parser/domains/types/state.js +355 -170
  194. package/bin/src/forms/domains/parser/domains/validator/state.js +417 -280
  195. package/bin/src/forms/domains/parser/state.js +612 -373
  196. package/bin/src/forms/domains/parser/template.js +1 -1
  197. package/bin/src/forms/domains/primitives/domains/base-64-file/state.js +5 -5
  198. package/bin/src/forms/domains/primitives/domains/base-64-file/template.js +38 -19
  199. package/bin/src/forms/domains/primitives/domains/boolean/state.js +5 -5
  200. package/bin/src/forms/domains/primitives/domains/boolean/template.js +38 -19
  201. package/bin/src/forms/domains/primitives/domains/date/state.js +18 -9
  202. package/bin/src/forms/domains/primitives/domains/date/template.js +51 -25
  203. package/bin/src/forms/domains/primitives/domains/enum/state.js +6 -6
  204. package/bin/src/forms/domains/primitives/domains/enum/template.js +117 -48
  205. package/bin/src/forms/domains/primitives/domains/enum-multiselect/state.js +1 -1
  206. package/bin/src/forms/domains/primitives/domains/enum-multiselect/template.js +99 -40
  207. package/bin/src/forms/domains/primitives/domains/list/state.js +14 -14
  208. package/bin/src/forms/domains/primitives/domains/list/template.js +200 -71
  209. package/bin/src/forms/domains/primitives/domains/map/state.js +14 -14
  210. package/bin/src/forms/domains/primitives/domains/map/template.js +294 -103
  211. package/bin/src/forms/domains/primitives/domains/number/state.js +5 -5
  212. package/bin/src/forms/domains/primitives/domains/number/template.js +38 -19
  213. package/bin/src/forms/domains/primitives/domains/searchable-infinite-stream/state.js +33 -16
  214. package/bin/src/forms/domains/primitives/domains/searchable-infinite-stream/template.js +171 -62
  215. package/bin/src/forms/domains/primitives/domains/searchable-infinite-stream-multiselect/state.js +1 -1
  216. package/bin/src/forms/domains/primitives/domains/searchable-infinite-stream-multiselect/template.js +182 -69
  217. package/bin/src/forms/domains/primitives/domains/secret/state.js +5 -5
  218. package/bin/src/forms/domains/primitives/domains/secret/template.js +38 -19
  219. package/bin/src/forms/domains/primitives/domains/string/state.js +5 -5
  220. package/bin/src/forms/domains/primitives/domains/string/template.js +42 -22
  221. package/bin/src/forms/domains/primitives/domains/sum/state.js +10 -10
  222. package/bin/src/forms/domains/primitives/domains/sum/template.js +141 -50
  223. package/bin/src/forms/domains/primitives/domains/tuple/state.js +9 -9
  224. package/bin/src/forms/domains/primitives/domains/tuple/template.js +100 -33
  225. package/bin/src/forms/domains/primitives/domains/unit/state.js +8 -8
  226. package/bin/src/forms/domains/primitives/domains/unit/template.js +22 -9
  227. package/bin/src/forms/domains/singleton/domains/form-label/state.d.ts +4 -4
  228. package/bin/src/forms/domains/singleton/domains/form-label/state.js +1 -1
  229. package/bin/src/forms/domains/singleton/state.js +12 -10
  230. package/bin/src/forms/domains/singleton/template.js +288 -113
  231. package/bin/src/fun/domains/curry/state.d.ts +4 -2
  232. package/bin/src/fun/domains/curry/state.js +1 -1
  233. package/bin/src/fun/domains/id/state.d.ts +1 -1
  234. package/bin/src/fun/domains/id/state.js +1 -1
  235. package/bin/src/fun/domains/predicate/domains/bool-expr.d.ts +57 -41
  236. package/bin/src/fun/domains/predicate/domains/bool-expr.js +76 -67
  237. package/bin/src/fun/domains/predicate/state.d.ts +9 -7
  238. package/bin/src/fun/domains/predicate/state.js +14 -10
  239. package/bin/src/fun/domains/simpleCallback/state.d.ts +1 -1
  240. package/bin/src/fun/domains/simpleCallback/state.js +1 -1
  241. package/bin/src/fun/domains/uncurry/state.d.ts +4 -2
  242. package/bin/src/fun/domains/uncurry/state.js +1 -1
  243. package/bin/src/fun/domains/unit/state.d.ts +1 -1
  244. package/bin/src/fun/domains/unit/state.js +1 -1
  245. package/bin/src/fun/domains/updater/domains/caseUpdater/state.d.ts +22 -7
  246. package/bin/src/fun/domains/updater/domains/caseUpdater/state.js +18 -10
  247. package/bin/src/fun/domains/updater/domains/mapUpdater/state.d.ts +24 -13
  248. package/bin/src/fun/domains/updater/domains/mapUpdater/state.js +40 -10
  249. package/bin/src/fun/domains/updater/domains/maybeUpdater/state.d.ts +19 -13
  250. package/bin/src/fun/domains/updater/domains/maybeUpdater/state.js +20 -9
  251. package/bin/src/fun/domains/updater/domains/orderedMapUpdater/state.d.ts +24 -13
  252. package/bin/src/fun/domains/updater/domains/orderedMapUpdater/state.js +47 -11
  253. package/bin/src/fun/domains/updater/domains/orderedSetUpdater/state.d.ts +20 -8
  254. package/bin/src/fun/domains/updater/domains/orderedSetUpdater/state.js +17 -5
  255. package/bin/src/fun/domains/updater/domains/replaceWith/state.d.ts +1 -1
  256. package/bin/src/fun/domains/updater/domains/replaceWith/state.js +1 -1
  257. package/bin/src/fun/domains/updater/domains/simpleUpdater/domains/baseSimpleUpdater/state.d.ts +13 -4
  258. package/bin/src/fun/domains/updater/domains/simpleUpdater/domains/baseSimpleUpdater/state.js +6 -4
  259. package/bin/src/fun/domains/updater/domains/simpleUpdater/state.d.ts +60 -22
  260. package/bin/src/fun/domains/updater/domains/simpleUpdater/state.js +42 -31
  261. package/bin/src/fun/domains/updater/state.d.ts +4 -4
  262. package/bin/src/fun/domains/updater/state.js +12 -10
  263. package/bin/src/fun/state.d.ts +3 -3
  264. package/bin/src/fun/state.js +9 -7
  265. package/bin/src/infinite-data-stream/coroutines/builder.js +1 -1
  266. package/bin/src/infinite-data-stream/coroutines/infiniteLoader.js +47 -20
  267. package/bin/src/infinite-data-stream/coroutines/runner.js +7 -7
  268. package/bin/src/infinite-data-stream/state.d.ts +84 -51
  269. package/bin/src/infinite-data-stream/state.js +125 -61
  270. package/bin/src/infinite-data-stream/template.js +3 -2
  271. package/bin/src/math/domains/DOMRect/state.d.ts +4 -4
  272. package/bin/src/math/domains/DOMRect/state.js +10 -8
  273. package/bin/src/math/domains/number/state.d.ts +5 -5
  274. package/bin/src/math/domains/number/state.js +5 -5
  275. package/bin/src/math/domains/rect/state.d.ts +8 -8
  276. package/bin/src/math/domains/rect/state.js +16 -15
  277. package/bin/src/math/domains/rgba/state.d.ts +17 -17
  278. package/bin/src/math/domains/rgba/state.js +77 -81
  279. package/bin/src/math/domains/size2/state.d.ts +8 -8
  280. package/bin/src/math/domains/size2/state.js +6 -6
  281. package/bin/src/math/domains/vector2/state.d.ts +10 -10
  282. package/bin/src/math/domains/vector2/state.js +8 -8
  283. package/bin/src/queue/state.js +23 -16
  284. package/bin/src/state/domains/repository/state.d.ts +15 -9
  285. package/bin/src/state/domains/repository/state.js +1 -1
  286. package/bin/src/template/state.js +163 -115
  287. package/bin/src/validation/state.js +38 -45
  288. package/bin/src/value/domains/mutable-value/state.js +3 -2
  289. package/bin/src/value/state.d.ts +9 -9
  290. package/bin/src/value/state.js +11 -8
  291. package/bin/src/value-infinite-data-stream/coroutines/builder.js +1 -1
  292. package/bin/src/value-infinite-data-stream/coroutines/infiniteLoader.js +55 -20
  293. package/bin/src/value-infinite-data-stream/coroutines/runner.js +6 -4
  294. package/bin/src/value-infinite-data-stream/state.js +199 -77
  295. package/bin/src/value-infinite-data-stream/template.js +4 -2
  296. package/bin/src/visibility/state.d.ts +5 -2
  297. package/bin/src/visibility/state.js +1 -1
  298. package/main.ts +1 -0
  299. package/package.json +1 -1
  300. package/src/forms/domains/dispatched-forms/deserializer/coroutines/runner.ts +2 -2
  301. package/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/apis/state.ts +117 -111
  302. package/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/list/state.ts +14 -5
  303. package/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/lookup/state.ts +75 -18
  304. package/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/map/state.ts +16 -6
  305. package/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/nestedRenderer/state.ts +27 -9
  306. package/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/one/state.ts +28 -8
  307. package/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/readOnly/state.ts +13 -4
  308. package/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/record/domains/recordFieldRenderer/state.ts +18 -7
  309. package/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/record/state.ts +40 -14
  310. package/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/sum/state.ts +15 -5
  311. package/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/table/domains/tableCellRenderer/state.ts +20 -6
  312. package/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/table/state.ts +101 -50
  313. package/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/tuple/state.ts +22 -23
  314. package/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/union/state.ts +37 -19
  315. package/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/state.ts +64 -6
  316. package/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/serializable/state.ts +585 -0
  317. package/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/types/state.ts +592 -340
  318. package/src/forms/domains/dispatched-forms/deserializer/domains/specification/state.ts +364 -226
  319. package/src/forms/domains/dispatched-forms/deserializer/state.ts +1 -2
  320. package/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/lookup-type/template.tsx +1 -1
  321. package/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/state.ts +2 -2
@@ -1,17 +1,24 @@
1
1
  import { CoTypedFactory } from "../../coroutines/builder";
2
2
  import { AsyncState } from "../../../main";
3
3
  export const HandleApiResponse = (asyncAccessor, handlers) => {
4
- const CheckerCo = CoTypedFactory();
5
- return CheckerCo.GetState().then((_) => {
6
- const asyncState = asyncAccessor(_);
7
- return AsyncState.Operations.isLoading(asyncState)
8
- ? CheckerCo.Do(() => { })
9
- : CheckerCo.Do(() => {
10
- var _a, _b;
11
- return AsyncState.Operations.status(asyncState) === "error"
12
- ? (_a = handlers.handleError) === null || _a === void 0 ? void 0 : _a.call(handlers, asyncState.kind === "error" ? asyncState.error : undefined)
13
- : (_b = handlers.handleSuccess) === null || _b === void 0 ? void 0 : _b.call(handlers, _);
14
- });
15
- });
4
+ const CheckerCo = CoTypedFactory();
5
+ return CheckerCo.GetState().then((_) => {
6
+ const asyncState = asyncAccessor(_);
7
+ return AsyncState.Operations.isLoading(asyncState)
8
+ ? CheckerCo.Do(() => {})
9
+ : CheckerCo.Do(() => {
10
+ var _a, _b;
11
+ return AsyncState.Operations.status(asyncState) === "error"
12
+ ? (_a = handlers.handleError) === null || _a === void 0
13
+ ? void 0
14
+ : _a.call(
15
+ handlers,
16
+ asyncState.kind === "error" ? asyncState.error : undefined,
17
+ )
18
+ : (_b = handlers.handleSuccess) === null || _b === void 0
19
+ ? void 0
20
+ : _b.call(handlers, _);
21
+ });
22
+ });
16
23
  };
17
- //# sourceMappingURL=runner.js.map
24
+ //# sourceMappingURL=runner.js.map
@@ -1,13 +1,15 @@
1
1
  export const ApiResponseChecker = {
2
- Default: (_) => ({
3
- apiResponseChecked: _ !== null && _ !== void 0 ? _ : false,
4
- }),
5
- Updaters: () => ({
6
- toChecked: () => (_) => (Object.assign(Object.assign({}, _), { apiResponseChecked: true })),
7
- toUnchecked: () => (_) => (Object.assign(Object.assign({}, _), { apiResponseChecked: false })),
8
- }),
9
- Operations: {
10
- checked: (_) => _.apiResponseChecked,
11
- },
2
+ Default: (_) => ({
3
+ apiResponseChecked: _ !== null && _ !== void 0 ? _ : false,
4
+ }),
5
+ Updaters: () => ({
6
+ toChecked: () => (_) =>
7
+ Object.assign(Object.assign({}, _), { apiResponseChecked: true }),
8
+ toUnchecked: () => (_) =>
9
+ Object.assign(Object.assign({}, _), { apiResponseChecked: false }),
10
+ }),
11
+ Operations: {
12
+ checked: (_) => _.apiResponseChecked,
13
+ },
12
14
  };
13
- //# sourceMappingURL=state.js.map
15
+ //# sourceMappingURL=state.js.map
@@ -1,5 +1,12 @@
1
- export declare const errorPermanenceStatus: readonly ["permanent failure", "transient failure"];
1
+ export declare const errorPermanenceStatus: readonly [
2
+ "permanent failure",
3
+ "transient failure",
4
+ ];
2
5
  export type ErrorPermanenceStatus = (typeof errorPermanenceStatus)[number];
3
- export declare const apiResultStatuses: readonly ["success", "permanent failure", "transient failure"];
6
+ export declare const apiResultStatuses: readonly [
7
+ "success",
8
+ "permanent failure",
9
+ "transient failure",
10
+ ];
4
11
  export type ApiResultStatus = (typeof apiResultStatuses)[number];
5
- //# sourceMappingURL=state.d.ts.map
12
+ //# sourceMappingURL=state.d.ts.map
@@ -1,6 +1,3 @@
1
- export const errorPermanenceStatus = [
2
- "permanent failure",
3
- "transient failure",
4
- ];
1
+ export const errorPermanenceStatus = ["permanent failure", "transient failure"];
5
2
  export const apiResultStatuses = ["success", ...errorPermanenceStatus];
6
- //# sourceMappingURL=state.js.map
3
+ //# sourceMappingURL=state.js.map
@@ -1,220 +1,338 @@
1
- import { CoTypedFactory, AsyncState, replaceWith, Entity, Debounced, } from "../../../../../../../main";
1
+ import {
2
+ CoTypedFactory,
3
+ AsyncState,
4
+ replaceWith,
5
+ Entity,
6
+ Debounced,
7
+ } from "../../../../../../../main";
2
8
  import { Fun } from "../../../../../../fun/state";
3
9
  import { insideEntitySynchronizedAndDebounced } from "../../singleton/coroutines/synchronizers";
4
10
  import { Collection, CollectionEntity } from "../state";
5
- export const collectionEntityLoader = (synchronizers) => (k, id, narrowing_k, widening_k, dependees) => Object.assign((mutation, mutationArg, entityId) => {
6
- const Co = CoTypedFactory();
7
- return Co.GetState().then((current) => {
8
- const entities = narrowing_k(current).entities;
9
- if (!AsyncState.Operations.hasValue(entities.sync) ||
10
- !entities.sync.value.get(entityId))
11
+ export const collectionEntityLoader =
12
+ (synchronizers) => (k, id, narrowing_k, widening_k, dependees) =>
13
+ Object.assign(
14
+ (mutation, mutationArg, entityId) => {
15
+ const Co = CoTypedFactory();
16
+ return Co.GetState().then((current) => {
17
+ const entities = narrowing_k(current).entities;
18
+ if (
19
+ !AsyncState.Operations.hasValue(entities.sync) ||
20
+ !entities.sync.value.get(entityId)
21
+ )
11
22
  return Co.Return("completed");
12
- return synchronizers[k][mutation](mutationArg)
13
- .embed((_) => {
14
- const entities = narrowing_k(_).entities;
15
- if (AsyncState.Operations.hasValue(entities.sync)) {
16
- const entity = entities.sync.value.get(entityId);
17
- if (entity != undefined)
23
+ return synchronizers[k][mutation](mutationArg)
24
+ .embed(
25
+ (_) => {
26
+ const entities = narrowing_k(_).entities;
27
+ if (AsyncState.Operations.hasValue(entities.sync)) {
28
+ const entity = entities.sync.value.get(entityId);
29
+ if (entity != undefined)
18
30
  return Object.assign(Object.assign({}, _), entity);
19
- }
20
- return undefined;
21
- }, Fun(Collection().Updaters.Core.entity.set(entityId)).then(widening_k))
22
- .then((syncResult) => Co.All(dependees).then((syncResults) => Co.Return([syncResult, ...syncResults].some((_) => _ == "should be enqueued again")
23
- ? "should be enqueued again"
24
- : "completed")));
25
- });
26
- }, {
27
- add: (entityId, entity, position) => {
28
- const Co = CoTypedFactory();
29
- const CoColl = CoTypedFactory();
30
- return CoColl.SetState((_) => {
31
+ }
32
+ return undefined;
33
+ },
34
+ Fun(Collection().Updaters.Core.entity.set(entityId)).then(
35
+ widening_k,
36
+ ),
37
+ )
38
+ .then((syncResult) =>
39
+ Co.All(dependees).then((syncResults) =>
40
+ Co.Return(
41
+ [syncResult, ...syncResults].some(
42
+ (_) => _ == "should be enqueued again",
43
+ )
44
+ ? "should be enqueued again"
45
+ : "completed",
46
+ ),
47
+ ),
48
+ );
49
+ });
50
+ },
51
+ {
52
+ add: (entityId, entity, position) => {
53
+ const Co = CoTypedFactory();
54
+ const CoColl = CoTypedFactory();
55
+ return CoColl.SetState((_) => {
31
56
  // alert("state set?!?")
32
57
  // return Collection<Collections[k]>().Updaters.Core.entity.add([entityId, entity, position ?? { kind: "at the end" }])(_)
33
58
  return _;
34
- })
35
- .embed((_) => (Object.assign(Object.assign({}, _), narrowing_k(_))), widening_k)
36
- .then(() => synchronizers[k]
37
- .add(entity)
38
- .embed((_) => {
39
- const entities = narrowing_k(_).entities;
40
- if (AsyncState.Operations.hasValue(entities.sync)) {
59
+ })
60
+ .embed(
61
+ (_) => Object.assign(Object.assign({}, _), narrowing_k(_)),
62
+ widening_k,
63
+ )
64
+ .then(() =>
65
+ synchronizers[k]
66
+ .add(entity)
67
+ .embed(
68
+ (_) => {
69
+ const entities = narrowing_k(_).entities;
70
+ if (AsyncState.Operations.hasValue(entities.sync)) {
71
+ const entity = entities.sync.value.get(entityId);
72
+ if (entity != undefined)
73
+ return Object.assign(Object.assign({}, _), entity);
74
+ }
75
+ return undefined;
76
+ },
77
+ Fun(Collection().Updaters.Core.entity.set(entityId)).then(
78
+ widening_k,
79
+ ),
80
+ )
81
+ // )
82
+ // .then(_ =>
83
+ // CoColl.GetState().then(current => {
84
+ // if (!AsyncState.Operations.hasValue(current.entities.sync)) return CoColl.Return(unit)
85
+ // const syncedEntity = current.entities.sync.value.get(entityId)
86
+ // if (!syncedEntity || !AsyncState.Operations.hasValue(syncedEntity.value.value.sync)) return CoColl.Return(unit)
87
+ // if (id(syncedEntity.value.value.sync.value) == entityId) return CoColl.Return(unit)
88
+ // // otherwise, the id has changed (probably overridden by the API), let's save the new id
89
+ // return CoColl.SetState(
90
+ // Collection<Collections[k]>().Updaters.Core.entity.add([id(syncedEntity.value.value.sync.value), syncedEntity, position ?? { kind:"at the end" }]).then(
91
+ // Collection<Collections[k]>().Updaters.Core.entity.remove(entityId)
92
+ // )
93
+ // )
94
+ // }
95
+ // )
96
+ // .embed<Context & SynchronizedEntities, SynchronizedEntities>(_ => ({ ..._, ...(narrowing_k(_)) }), widening_k)
97
+ .then((syncResult) =>
98
+ Co.All(dependees).then((syncResults) =>
99
+ Co.Return(
100
+ [syncResult, ...syncResults].some(
101
+ (_) => _ == "should be enqueued again",
102
+ )
103
+ ? "should be enqueued again"
104
+ : "completed",
105
+ ),
106
+ ),
107
+ ),
108
+ );
109
+ },
110
+ remove: (entityId) => {
111
+ const Co = CoTypedFactory();
112
+ const CoColl = CoTypedFactory();
113
+ return CoColl.SetState(
114
+ // Collection<Collections[k]>().Updaters.Core.entity.remove(entityId)
115
+ Collection().Updaters.Core.removed(entityId, replaceWith(true)),
116
+ )
117
+ .embed(
118
+ (_) => Object.assign(Object.assign({}, _), narrowing_k(_)),
119
+ widening_k,
120
+ )
121
+ .then(() =>
122
+ synchronizers[k].remove(entityId).embed(
123
+ (_) => {
124
+ const entities = narrowing_k(_).entities;
125
+ if (AsyncState.Operations.hasValue(entities.sync)) {
126
+ const entity = entities.sync.value.get(entityId);
127
+ if (entity != undefined)
128
+ return Object.assign(Object.assign({}, _), entity);
129
+ }
130
+ return undefined;
131
+ },
132
+ Fun(Collection().Updaters.Core.entity.set(entityId)).then(
133
+ widening_k,
134
+ ),
135
+ ),
136
+ )
137
+ .then((_) =>
138
+ Co.GetState().then((current) => {
139
+ const entities = narrowing_k(current).entities;
140
+ if (!AsyncState.Operations.hasValue(entities.sync))
141
+ return Co.Return("completed");
41
142
  const entity = entities.sync.value.get(entityId);
42
- if (entity != undefined)
43
- return Object.assign(Object.assign({}, _), entity);
44
- }
45
- return undefined;
46
- }, Fun(Collection().Updaters.Core.entity.set(entityId)).then(widening_k))
47
- // )
48
- // .then(_ =>
49
- // CoColl.GetState().then(current => {
50
- // if (!AsyncState.Operations.hasValue(current.entities.sync)) return CoColl.Return(unit)
51
- // const syncedEntity = current.entities.sync.value.get(entityId)
52
- // if (!syncedEntity || !AsyncState.Operations.hasValue(syncedEntity.value.value.sync)) return CoColl.Return(unit)
53
- // if (id(syncedEntity.value.value.sync.value) == entityId) return CoColl.Return(unit)
54
- // // otherwise, the id has changed (probably overridden by the API), let's save the new id
55
- // return CoColl.SetState(
56
- // Collection<Collections[k]>().Updaters.Core.entity.add([id(syncedEntity.value.value.sync.value), syncedEntity, position ?? { kind:"at the end" }]).then(
57
- // Collection<Collections[k]>().Updaters.Core.entity.remove(entityId)
58
- // )
59
- // )
60
- // }
61
- // )
62
- // .embed<Context & SynchronizedEntities, SynchronizedEntities>(_ => ({ ..._, ...(narrowing_k(_)) }), widening_k)
63
- .then((syncResult) => Co.All(dependees).then((syncResults) => Co.Return([syncResult, ...syncResults].some((_) => _ == "should be enqueued again")
64
- ? "should be enqueued again"
65
- : "completed"))));
66
- },
67
- remove: (entityId) => {
68
- const Co = CoTypedFactory();
69
- const CoColl = CoTypedFactory();
70
- return CoColl.SetState(
71
- // Collection<Collections[k]>().Updaters.Core.entity.remove(entityId)
72
- Collection().Updaters.Core.removed(entityId, replaceWith(true)))
73
- .embed((_) => (Object.assign(Object.assign({}, _), narrowing_k(_))), widening_k)
74
- .then(() => synchronizers[k]
75
- .remove(entityId)
76
- .embed((_) => {
77
- const entities = narrowing_k(_).entities;
78
- if (AsyncState.Operations.hasValue(entities.sync)) {
79
- const entity = entities.sync.value.get(entityId);
80
- if (entity != undefined)
81
- return Object.assign(Object.assign({}, _), entity);
82
- }
83
- return undefined;
84
- }, Fun(Collection().Updaters.Core.entity.set(entityId)).then(widening_k)))
85
- .then((_) => Co.GetState().then((current) => {
86
- const entities = narrowing_k(current).entities;
87
- if (!AsyncState.Operations.hasValue(entities.sync))
88
- return Co.Return("completed");
89
- const entity = entities.sync.value.get(entityId);
90
- if (!entity || entity.value.sync.kind == "error")
91
- return Co.Return("completed");
92
- return Co.All(dependees).then((syncResults) => Co.Return(syncResults.some((_) => _ == "should be enqueued again")
93
- ? "should be enqueued again"
94
- : "completed"));
95
- }));
96
- },
97
- wholeMutations: (mutation, mutationArg) => {
98
- const Co = CoTypedFactory();
99
- const CoColl = CoTypedFactory();
100
- return CoColl.Seq([
101
- synchronizers[k]["wholeMutations"][mutation](mutationArg)
102
- .embed((_) => (Object.assign(Object.assign({}, _), _.entities)), Collection().Updaters.Core.entities),
103
- ])
104
- .embed((_) => (Object.assign(Object.assign({}, _), narrowing_k(_))), widening_k)
105
- .then((syncResult) => Co.All(dependees).then((syncResults) => Co.Return([syncResult, ...syncResults].some((_) => _ == "should be enqueued again")
106
- ? "should be enqueued again"
107
- : "completed")));
108
- },
109
- });
110
- export const collectionDirtySetter = () => (k, narrowing_k, widening_k) => (entityId, dirtyStatus) => {
143
+ if (!entity || entity.value.sync.kind == "error")
144
+ return Co.Return("completed");
145
+ return Co.All(dependees).then((syncResults) =>
146
+ Co.Return(
147
+ syncResults.some((_) => _ == "should be enqueued again")
148
+ ? "should be enqueued again"
149
+ : "completed",
150
+ ),
151
+ );
152
+ }),
153
+ );
154
+ },
155
+ wholeMutations: (mutation, mutationArg) => {
156
+ const Co = CoTypedFactory();
157
+ const CoColl = CoTypedFactory();
158
+ return CoColl.Seq([
159
+ synchronizers[k]["wholeMutations"]
160
+ [mutation](mutationArg)
161
+ .embed(
162
+ (_) => Object.assign(Object.assign({}, _), _.entities),
163
+ Collection().Updaters.Core.entities,
164
+ ),
165
+ ])
166
+ .embed(
167
+ (_) => Object.assign(Object.assign({}, _), narrowing_k(_)),
168
+ widening_k,
169
+ )
170
+ .then((syncResult) =>
171
+ Co.All(dependees).then((syncResults) =>
172
+ Co.Return(
173
+ [syncResult, ...syncResults].some(
174
+ (_) => _ == "should be enqueued again",
175
+ )
176
+ ? "should be enqueued again"
177
+ : "completed",
178
+ ),
179
+ ),
180
+ );
181
+ },
182
+ },
183
+ );
184
+ export const collectionDirtySetter =
185
+ () => (k, narrowing_k, widening_k) => (entityId, dirtyStatus) => {
111
186
  const CoEntity = CoTypedFactory();
112
187
  const Co = CoTypedFactory();
113
- return CoEntity.SetState(CollectionEntity().Updaters.Core.entity(Entity().Updaters.Core.value(Debounced.Updaters.Core.dirty(replaceWith(dirtyStatus))))).embed((_) => {
188
+ return CoEntity.SetState(
189
+ CollectionEntity().Updaters.Core.entity(
190
+ Entity().Updaters.Core.value(
191
+ Debounced.Updaters.Core.dirty(replaceWith(dirtyStatus)),
192
+ ),
193
+ ),
194
+ ).embed(
195
+ (_) => {
114
196
  const _narrowed = narrowing_k(_);
115
197
  const entities = _narrowed.entities;
116
198
  if (AsyncState.Operations.hasValue(entities.sync)) {
117
- const entity = entities.sync.value.get(entityId);
118
- if (entity != undefined)
119
- return Object.assign(Object.assign({}, _), entity);
199
+ const entity = entities.sync.value.get(entityId);
200
+ if (entity != undefined)
201
+ return Object.assign(Object.assign({}, _), entity);
120
202
  }
121
203
  return undefined;
122
- }, Fun(Collection().Updaters.Core.entity.set(entityId)).then(widening_k));
123
- };
124
- export const collectionCheckNotDirty = () => ([id, e]) => {
204
+ },
205
+ Fun(Collection().Updaters.Core.entity.set(entityId)).then(widening_k),
206
+ );
207
+ };
208
+ export const collectionCheckNotDirty =
209
+ () =>
210
+ ([id, e]) => {
125
211
  var _a;
126
- return (AsyncState.Operations.hasValue(e.entities.sync) &&
127
- ((_a = e.entities.sync.value.get(id)) === null || _a === void 0 ? void 0 : _a.value.dirty) != "not dirty");
128
- };
129
- export const collectionEntityUpdater = () => (widening_k) => Fun(([id, u]) => widening_k(Collection().Updaters.Template.entityValue(id, u)));
212
+ return (
213
+ AsyncState.Operations.hasValue(e.entities.sync) &&
214
+ ((_a = e.entities.sync.value.get(id)) === null || _a === void 0
215
+ ? void 0
216
+ : _a.value.dirty) != "not dirty"
217
+ );
218
+ };
219
+ export const collectionEntityUpdater = () => (widening_k) =>
220
+ Fun(([id, u]) =>
221
+ widening_k(Collection().Updaters.Template.entityValue(id, u)),
222
+ );
130
223
  export const withTrivialComparator = (_) => [_, (_) => "=="];
131
224
  export const collectionSynchronizationContext = (entityDescriptors) => {
132
- let synchronizers = {};
133
- Object.keys(entityDescriptors).forEach((k_s) => {
134
- const k = k_s;
135
- synchronizers[k] = {};
136
- Object.keys(entityDescriptors[k]).forEach((field) => {
137
- // only update the mutation fields of the entity descriptor
138
- if (field != "entityName" &&
139
- field != "narrowing" &&
140
- field != "widening" &&
141
- field != "dependees" &&
142
- field != "add" &&
143
- field != "remove" &&
144
- field != "default" &&
145
- field != "reload" &&
146
- field != "reloadElement")
147
- synchronizers[k][field] = (mutationArg) => {
148
- return insideEntitySynchronizedAndDebounced(entityDescriptors[k][field](mutationArg));
149
- };
150
- });
151
- synchronizers[k]["add"] = (entity, position) => insideEntitySynchronizedAndDebounced(entityDescriptors[k]["add"](entity, position));
152
- synchronizers[k]["remove"] = (entityId) => insideEntitySynchronizedAndDebounced(entityDescriptors[k]["remove"](entityId));
153
- synchronizers[k]["wholeMutations"] = {};
154
- Object.keys(entityDescriptors[k]["wholeMutations"]).forEach((field) => {
155
- synchronizers[k]["wholeMutations"][field] = (mutationArg) => entityDescriptors[k]["wholeMutations"][field](mutationArg);
156
- });
225
+ let synchronizers = {};
226
+ Object.keys(entityDescriptors).forEach((k_s) => {
227
+ const k = k_s;
228
+ synchronizers[k] = {};
229
+ Object.keys(entityDescriptors[k]).forEach((field) => {
230
+ // only update the mutation fields of the entity descriptor
231
+ if (
232
+ field != "entityName" &&
233
+ field != "narrowing" &&
234
+ field != "widening" &&
235
+ field != "dependees" &&
236
+ field != "add" &&
237
+ field != "remove" &&
238
+ field != "default" &&
239
+ field != "reload" &&
240
+ field != "reloadElement"
241
+ )
242
+ synchronizers[k][field] = (mutationArg) => {
243
+ return insideEntitySynchronizedAndDebounced(
244
+ entityDescriptors[k][field](mutationArg),
245
+ );
246
+ };
157
247
  });
158
- const loaders = {};
159
- Object.keys(entityDescriptors).forEach((k_s) => {
160
- const k = k_s;
161
- loaders[k] = collectionEntityLoader(synchronizers)(k, entityDescriptors[k].id, entityDescriptors[k].narrowing, entityDescriptors[k].widening, entityDescriptors[k].dependees);
248
+ synchronizers[k]["add"] = (entity, position) =>
249
+ insideEntitySynchronizedAndDebounced(
250
+ entityDescriptors[k]["add"](entity, position),
251
+ );
252
+ synchronizers[k]["remove"] = (entityId) =>
253
+ insideEntitySynchronizedAndDebounced(
254
+ entityDescriptors[k]["remove"](entityId),
255
+ );
256
+ synchronizers[k]["wholeMutations"] = {};
257
+ Object.keys(entityDescriptors[k]["wholeMutations"]).forEach((field) => {
258
+ synchronizers[k]["wholeMutations"][field] = (mutationArg) =>
259
+ entityDescriptors[k]["wholeMutations"][field](mutationArg);
162
260
  });
163
- const dirtyCheckers = {};
164
- Object.keys(entityDescriptors).forEach((k_s) => {
165
- const k = k_s;
166
- dirtyCheckers[k] = Fun(collectionCheckNotDirty());
261
+ });
262
+ const loaders = {};
263
+ Object.keys(entityDescriptors).forEach((k_s) => {
264
+ const k = k_s;
265
+ loaders[k] = collectionEntityLoader(synchronizers)(
266
+ k,
267
+ entityDescriptors[k].id,
268
+ entityDescriptors[k].narrowing,
269
+ entityDescriptors[k].widening,
270
+ entityDescriptors[k].dependees,
271
+ );
272
+ });
273
+ const dirtyCheckers = {};
274
+ Object.keys(entityDescriptors).forEach((k_s) => {
275
+ const k = k_s;
276
+ dirtyCheckers[k] = Fun(collectionCheckNotDirty());
277
+ });
278
+ const dirtySetters = {};
279
+ Object.keys(entityDescriptors).forEach((k_s) => {
280
+ const k = k_s;
281
+ dirtySetters[k] = collectionDirtySetter()(
282
+ k,
283
+ entityDescriptors[k].narrowing,
284
+ entityDescriptors[k].widening,
285
+ );
286
+ });
287
+ const updaters = {};
288
+ Object.keys(entityDescriptors).forEach((k_s) => {
289
+ const k = k_s;
290
+ updaters[k] = collectionEntityUpdater()(entityDescriptors[k].widening);
291
+ });
292
+ const mutationComparators = {};
293
+ Object.keys(entityDescriptors).forEach((k_s) => {
294
+ const k = k_s;
295
+ mutationComparators[k] = {};
296
+ Object.keys(entityDescriptors[k]).forEach((field) => {
297
+ if (
298
+ field != "entityName" &&
299
+ field != "narrowing" &&
300
+ field != "widening" &&
301
+ field != "dependees" &&
302
+ field != "add" &&
303
+ field != "remove" &&
304
+ field != "default" &&
305
+ field != "reload"
306
+ )
307
+ mutationComparators[k][field] = entityDescriptors[k][field][1];
167
308
  });
168
- const dirtySetters = {};
169
- Object.keys(entityDescriptors).forEach((k_s) => {
170
- const k = k_s;
171
- dirtySetters[k] = collectionDirtySetter()(k, entityDescriptors[k].narrowing, entityDescriptors[k].widening);
172
- });
173
- const updaters = {};
174
- Object.keys(entityDescriptors).forEach((k_s) => {
175
- const k = k_s;
176
- updaters[k] = collectionEntityUpdater()(entityDescriptors[k].widening);
177
- });
178
- const mutationComparators = {};
179
- Object.keys(entityDescriptors).forEach((k_s) => {
180
- const k = k_s;
181
- mutationComparators[k] = {};
182
- Object.keys(entityDescriptors[k]).forEach((field) => {
183
- if (field != "entityName" &&
184
- field != "narrowing" &&
185
- field != "widening" &&
186
- field != "dependees" &&
187
- field != "add" &&
188
- field != "remove" &&
189
- field != "default" &&
190
- field != "reload")
191
- mutationComparators[k][field] = entityDescriptors[k][field][1];
192
- });
193
- });
194
- const wholeMutationComparators = {};
195
- Object.keys(entityDescriptors).forEach((k_s) => {
196
- const k = k_s;
197
- wholeMutationComparators[k] = {};
198
- Object.keys(entityDescriptors[k]).forEach((field) => {
199
- if (field != "entityName" &&
200
- field != "narrowing" &&
201
- field != "widening" &&
202
- field != "dependees" &&
203
- field != "add" &&
204
- field != "remove" &&
205
- field != "default" &&
206
- field != "reload")
207
- wholeMutationComparators[k][field] = entityDescriptors[k][field][1];
208
- });
309
+ });
310
+ const wholeMutationComparators = {};
311
+ Object.keys(entityDescriptors).forEach((k_s) => {
312
+ const k = k_s;
313
+ wholeMutationComparators[k] = {};
314
+ Object.keys(entityDescriptors[k]).forEach((field) => {
315
+ if (
316
+ field != "entityName" &&
317
+ field != "narrowing" &&
318
+ field != "widening" &&
319
+ field != "dependees" &&
320
+ field != "add" &&
321
+ field != "remove" &&
322
+ field != "default" &&
323
+ field != "reload"
324
+ )
325
+ wholeMutationComparators[k][field] = entityDescriptors[k][field][1];
209
326
  });
210
- return [
211
- loaders,
212
- dirtyCheckers,
213
- dirtySetters,
214
- updaters,
215
- entityDescriptors,
216
- mutationComparators,
217
- wholeMutationComparators,
218
- ];
327
+ });
328
+ return [
329
+ loaders,
330
+ dirtyCheckers,
331
+ dirtySetters,
332
+ updaters,
333
+ entityDescriptors,
334
+ mutationComparators,
335
+ wholeMutationComparators,
336
+ ];
219
337
  };
220
- //# sourceMappingURL=synchronizers.js.map
338
+ //# sourceMappingURL=synchronizers.js.map