@craft-ts/core 0.7.0-beta.13

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 (682) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +58 -0
  3. package/src/index.d.ts +148 -0
  4. package/src/index.d.ts.map +1 -0
  5. package/src/index.js +150 -0
  6. package/src/index.js.map +1 -0
  7. package/src/lib/after-recomputation.d.ts +327 -0
  8. package/src/lib/after-recomputation.d.ts.map +1 -0
  9. package/src/lib/after-recomputation.js +25 -0
  10. package/src/lib/after-recomputation.js.map +1 -0
  11. package/src/lib/app-checked-di.d.ts +82 -0
  12. package/src/lib/app-checked-di.d.ts.map +1 -0
  13. package/src/lib/app-checked-di.js +1 -0
  14. package/src/lib/app-checked-di.js.map +1 -0
  15. package/src/lib/async-process.d.ts +411 -0
  16. package/src/lib/async-process.d.ts.map +1 -0
  17. package/src/lib/async-process.js +702 -0
  18. package/src/lib/async-process.js.map +1 -0
  19. package/src/lib/branded-component/branded-component.d.ts +129 -0
  20. package/src/lib/branded-component/branded-component.d.ts.map +1 -0
  21. package/src/lib/branded-component/branded-component.js +7 -0
  22. package/src/lib/branded-component/branded-component.js.map +1 -0
  23. package/src/lib/browser-boundaries.d.ts +165 -0
  24. package/src/lib/browser-boundaries.d.ts.map +1 -0
  25. package/src/lib/browser-boundaries.js +550 -0
  26. package/src/lib/browser-boundaries.js.map +1 -0
  27. package/src/lib/client-di-requirement.d.ts +28 -0
  28. package/src/lib/client-di-requirement.d.ts.map +1 -0
  29. package/src/lib/client-di-requirement.js +11 -0
  30. package/src/lib/client-di-requirement.js.map +1 -0
  31. package/src/lib/client-function-middleware.d.ts +130 -0
  32. package/src/lib/client-function-middleware.d.ts.map +1 -0
  33. package/src/lib/client-function-middleware.js +144 -0
  34. package/src/lib/client-function-middleware.js.map +1 -0
  35. package/src/lib/component-monitoring.d.ts +7 -0
  36. package/src/lib/component-monitoring.d.ts.map +1 -0
  37. package/src/lib/component-monitoring.js +28 -0
  38. package/src/lib/component-monitoring.js.map +1 -0
  39. package/src/lib/component-register.d.ts +12 -0
  40. package/src/lib/component-register.d.ts.map +1 -0
  41. package/src/lib/component-register.js +13 -0
  42. package/src/lib/component-register.js.map +1 -0
  43. package/src/lib/computed-source.d.ts +303 -0
  44. package/src/lib/computed-source.d.ts.map +1 -0
  45. package/src/lib/computed-source.js +319 -0
  46. package/src/lib/computed-source.js.map +1 -0
  47. package/src/lib/correlation-id-plugin.d.ts +3 -0
  48. package/src/lib/correlation-id-plugin.d.ts.map +1 -0
  49. package/src/lib/correlation-id-plugin.js +73 -0
  50. package/src/lib/correlation-id-plugin.js.map +1 -0
  51. package/src/lib/correlation-id.d.ts +30 -0
  52. package/src/lib/correlation-id.d.ts.map +1 -0
  53. package/src/lib/correlation-id.js +86 -0
  54. package/src/lib/correlation-id.js.map +1 -0
  55. package/src/lib/craft-a11y.d.ts +22 -0
  56. package/src/lib/craft-a11y.d.ts.map +1 -0
  57. package/src/lib/craft-a11y.js +32 -0
  58. package/src/lib/craft-a11y.js.map +1 -0
  59. package/src/lib/craft-activated-route.d.ts +21 -0
  60. package/src/lib/craft-activated-route.d.ts.map +1 -0
  61. package/src/lib/craft-activated-route.js +20 -0
  62. package/src/lib/craft-activated-route.js.map +1 -0
  63. package/src/lib/craft-app-config.d.ts +91 -0
  64. package/src/lib/craft-app-config.d.ts.map +1 -0
  65. package/src/lib/craft-app-config.js +64 -0
  66. package/src/lib/craft-app-config.js.map +1 -0
  67. package/src/lib/craft-codec.d.ts +16 -0
  68. package/src/lib/craft-codec.d.ts.map +1 -0
  69. package/src/lib/craft-codec.js +1 -0
  70. package/src/lib/craft-codec.js.map +1 -0
  71. package/src/lib/craft-computed.d.ts +31 -0
  72. package/src/lib/craft-computed.d.ts.map +1 -0
  73. package/src/lib/craft-computed.js +81 -0
  74. package/src/lib/craft-computed.js.map +1 -0
  75. package/src/lib/craft-control-flow.d.ts +14 -0
  76. package/src/lib/craft-control-flow.d.ts.map +1 -0
  77. package/src/lib/craft-control-flow.js +18 -0
  78. package/src/lib/craft-control-flow.js.map +1 -0
  79. package/src/lib/craft-effect.d.ts +13 -0
  80. package/src/lib/craft-effect.d.ts.map +1 -0
  81. package/src/lib/craft-effect.js +93 -0
  82. package/src/lib/craft-effect.js.map +1 -0
  83. package/src/lib/craft-exception.d.ts +40 -0
  84. package/src/lib/craft-exception.d.ts.map +1 -0
  85. package/src/lib/craft-exception.js +16 -0
  86. package/src/lib/craft-exception.js.map +1 -0
  87. package/src/lib/craft-gen.d.ts +123 -0
  88. package/src/lib/craft-gen.d.ts.map +1 -0
  89. package/src/lib/craft-gen.js +90 -0
  90. package/src/lib/craft-gen.js.map +1 -0
  91. package/src/lib/craft-generator-runtime.d.ts +110 -0
  92. package/src/lib/craft-generator-runtime.d.ts.map +1 -0
  93. package/src/lib/craft-generator-runtime.js +191 -0
  94. package/src/lib/craft-generator-runtime.js.map +1 -0
  95. package/src/lib/craft-guard-runtime.d.ts +70 -0
  96. package/src/lib/craft-guard-runtime.d.ts.map +1 -0
  97. package/src/lib/craft-guard-runtime.js +195 -0
  98. package/src/lib/craft-guard-runtime.js.map +1 -0
  99. package/src/lib/craft-handshake.d.ts +35 -0
  100. package/src/lib/craft-handshake.d.ts.map +1 -0
  101. package/src/lib/craft-handshake.js +34 -0
  102. package/src/lib/craft-handshake.js.map +1 -0
  103. package/src/lib/craft-http-client.d.ts +236 -0
  104. package/src/lib/craft-http-client.d.ts.map +1 -0
  105. package/src/lib/craft-http-client.js +437 -0
  106. package/src/lib/craft-http-client.js.map +1 -0
  107. package/src/lib/craft-http-trace.d.ts +12 -0
  108. package/src/lib/craft-http-trace.d.ts.map +1 -0
  109. package/src/lib/craft-http-trace.js +28 -0
  110. package/src/lib/craft-http-trace.js.map +1 -0
  111. package/src/lib/craft-lazy.d.ts +42 -0
  112. package/src/lib/craft-lazy.d.ts.map +1 -0
  113. package/src/lib/craft-lazy.js +83 -0
  114. package/src/lib/craft-lazy.js.map +1 -0
  115. package/src/lib/craft-load-retry.d.ts +76 -0
  116. package/src/lib/craft-load-retry.d.ts.map +1 -0
  117. package/src/lib/craft-load-retry.js +160 -0
  118. package/src/lib/craft-load-retry.js.map +1 -0
  119. package/src/lib/craft-machine-history.d.ts +145 -0
  120. package/src/lib/craft-machine-history.d.ts.map +1 -0
  121. package/src/lib/craft-machine-history.js +276 -0
  122. package/src/lib/craft-machine-history.js.map +1 -0
  123. package/src/lib/craft-match.d.ts +49 -0
  124. package/src/lib/craft-match.d.ts.map +1 -0
  125. package/src/lib/craft-match.js +58 -0
  126. package/src/lib/craft-match.js.map +1 -0
  127. package/src/lib/craft-method.d.ts +28 -0
  128. package/src/lib/craft-method.d.ts.map +1 -0
  129. package/src/lib/craft-method.js +45 -0
  130. package/src/lib/craft-method.js.map +1 -0
  131. package/src/lib/craft-node-directive.d.ts +32 -0
  132. package/src/lib/craft-node-directive.d.ts.map +1 -0
  133. package/src/lib/craft-node-directive.js +22 -0
  134. package/src/lib/craft-node-directive.js.map +1 -0
  135. package/src/lib/craft-pending.d.ts +115 -0
  136. package/src/lib/craft-pending.d.ts.map +1 -0
  137. package/src/lib/craft-pending.js +187 -0
  138. package/src/lib/craft-pending.js.map +1 -0
  139. package/src/lib/craft-pipe.d.ts +63 -0
  140. package/src/lib/craft-pipe.d.ts.map +1 -0
  141. package/src/lib/craft-pipe.js +57 -0
  142. package/src/lib/craft-pipe.js.map +1 -0
  143. package/src/lib/craft-platform.d.ts +50 -0
  144. package/src/lib/craft-platform.d.ts.map +1 -0
  145. package/src/lib/craft-platform.js +175 -0
  146. package/src/lib/craft-platform.js.map +1 -0
  147. package/src/lib/craft-primitive-gen.d.ts +137 -0
  148. package/src/lib/craft-primitive-gen.d.ts.map +1 -0
  149. package/src/lib/craft-primitive-gen.js +76 -0
  150. package/src/lib/craft-primitive-gen.js.map +1 -0
  151. package/src/lib/craft-primitive-registry.d.ts +113 -0
  152. package/src/lib/craft-primitive-registry.d.ts.map +1 -0
  153. package/src/lib/craft-primitive-registry.js +159 -0
  154. package/src/lib/craft-primitive-registry.js.map +1 -0
  155. package/src/lib/craft-program-operators.d.ts +101 -0
  156. package/src/lib/craft-program-operators.d.ts.map +1 -0
  157. package/src/lib/craft-program-operators.js +116 -0
  158. package/src/lib/craft-program-operators.js.map +1 -0
  159. package/src/lib/craft-program-runtime.d.ts +80 -0
  160. package/src/lib/craft-program-runtime.d.ts.map +1 -0
  161. package/src/lib/craft-program-runtime.js +166 -0
  162. package/src/lib/craft-program-runtime.js.map +1 -0
  163. package/src/lib/craft-register-for-runtime.d.ts +39 -0
  164. package/src/lib/craft-register-for-runtime.d.ts.map +1 -0
  165. package/src/lib/craft-register-for-runtime.js +96 -0
  166. package/src/lib/craft-register-for-runtime.js.map +1 -0
  167. package/src/lib/craft-register-for.d.ts +57 -0
  168. package/src/lib/craft-register-for.d.ts.map +1 -0
  169. package/src/lib/craft-register-for.js +200 -0
  170. package/src/lib/craft-register-for.js.map +1 -0
  171. package/src/lib/craft-render-identity.d.ts +19 -0
  172. package/src/lib/craft-render-identity.d.ts.map +1 -0
  173. package/src/lib/craft-render-identity.js +23 -0
  174. package/src/lib/craft-render-identity.js.map +1 -0
  175. package/src/lib/craft-replay.d.ts +5 -0
  176. package/src/lib/craft-replay.d.ts.map +1 -0
  177. package/src/lib/craft-replay.js +28 -0
  178. package/src/lib/craft-replay.js.map +1 -0
  179. package/src/lib/craft-resolve.d.ts +39 -0
  180. package/src/lib/craft-resolve.d.ts.map +1 -0
  181. package/src/lib/craft-resolve.js +9 -0
  182. package/src/lib/craft-resolve.js.map +1 -0
  183. package/src/lib/craft-resource.d.ts +11 -0
  184. package/src/lib/craft-resource.d.ts.map +1 -0
  185. package/src/lib/craft-resource.js +264 -0
  186. package/src/lib/craft-resource.js.map +1 -0
  187. package/src/lib/craft-route-exceptions.d.ts +785 -0
  188. package/src/lib/craft-route-exceptions.d.ts.map +1 -0
  189. package/src/lib/craft-route-exceptions.js +86 -0
  190. package/src/lib/craft-route-exceptions.js.map +1 -0
  191. package/src/lib/craft-route-load-error.d.ts +1145 -0
  192. package/src/lib/craft-route-load-error.d.ts.map +1 -0
  193. package/src/lib/craft-route-load-error.js +173 -0
  194. package/src/lib/craft-route-load-error.js.map +1 -0
  195. package/src/lib/craft-route-meta.d.ts +52 -0
  196. package/src/lib/craft-route-meta.d.ts.map +1 -0
  197. package/src/lib/craft-route-meta.js +16 -0
  198. package/src/lib/craft-route-meta.js.map +1 -0
  199. package/src/lib/craft-route-target.d.ts +27 -0
  200. package/src/lib/craft-route-target.d.ts.map +1 -0
  201. package/src/lib/craft-route-target.js +22 -0
  202. package/src/lib/craft-route-target.js.map +1 -0
  203. package/src/lib/craft-router-outlet.d.ts +105 -0
  204. package/src/lib/craft-router-outlet.d.ts.map +1 -0
  205. package/src/lib/craft-router-outlet.js +735 -0
  206. package/src/lib/craft-router-outlet.js.map +1 -0
  207. package/src/lib/craft-router-tokens.d.ts +49 -0
  208. package/src/lib/craft-router-tokens.d.ts.map +1 -0
  209. package/src/lib/craft-router-tokens.js +15 -0
  210. package/src/lib/craft-router-tokens.js.map +1 -0
  211. package/src/lib/craft-router-trace.d.ts +18 -0
  212. package/src/lib/craft-router-trace.d.ts.map +1 -0
  213. package/src/lib/craft-router-trace.js +54 -0
  214. package/src/lib/craft-router-trace.js.map +1 -0
  215. package/src/lib/craft-router.d.ts +248 -0
  216. package/src/lib/craft-router.d.ts.map +1 -0
  217. package/src/lib/craft-router.js +559 -0
  218. package/src/lib/craft-router.js.map +1 -0
  219. package/src/lib/craft-routes.d.ts +755 -0
  220. package/src/lib/craft-routes.d.ts.map +1 -0
  221. package/src/lib/craft-routes.js +510 -0
  222. package/src/lib/craft-routes.js.map +1 -0
  223. package/src/lib/craft-service.d.ts +1034 -0
  224. package/src/lib/craft-service.d.ts.map +1 -0
  225. package/src/lib/craft-service.js +1072 -0
  226. package/src/lib/craft-service.js.map +1 -0
  227. package/src/lib/craft-service.shared.d.ts +35 -0
  228. package/src/lib/craft-service.shared.d.ts.map +1 -0
  229. package/src/lib/craft-service.shared.js +4 -0
  230. package/src/lib/craft-service.shared.js.map +1 -0
  231. package/src/lib/craft-settled.d.ts +171 -0
  232. package/src/lib/craft-settled.d.ts.map +1 -0
  233. package/src/lib/craft-settled.js +130 -0
  234. package/src/lib/craft-settled.js.map +1 -0
  235. package/src/lib/craft-ssr.d.ts +29 -0
  236. package/src/lib/craft-ssr.d.ts.map +1 -0
  237. package/src/lib/craft-ssr.js +27 -0
  238. package/src/lib/craft-ssr.js.map +1 -0
  239. package/src/lib/craft-state-machine-runtime.d.ts +88 -0
  240. package/src/lib/craft-state-machine-runtime.d.ts.map +1 -0
  241. package/src/lib/craft-state-machine-runtime.js +167 -0
  242. package/src/lib/craft-state-machine-runtime.js.map +1 -0
  243. package/src/lib/craft-state-machine.d.ts +233 -0
  244. package/src/lib/craft-state-machine.d.ts.map +1 -0
  245. package/src/lib/craft-state-machine.js +254 -0
  246. package/src/lib/craft-state-machine.js.map +1 -0
  247. package/src/lib/craft-target-runtime.d.ts +20 -0
  248. package/src/lib/craft-target-runtime.d.ts.map +1 -0
  249. package/src/lib/craft-target-runtime.js +42 -0
  250. package/src/lib/craft-target-runtime.js.map +1 -0
  251. package/src/lib/craft-transfer-snapshot.d.ts +19 -0
  252. package/src/lib/craft-transfer-snapshot.d.ts.map +1 -0
  253. package/src/lib/craft-transfer-snapshot.js +90 -0
  254. package/src/lib/craft-transfer-snapshot.js.map +1 -0
  255. package/src/lib/craft-unique.d.ts +7 -0
  256. package/src/lib/craft-unique.d.ts.map +1 -0
  257. package/src/lib/craft-unique.js +16 -0
  258. package/src/lib/craft-unique.js.map +1 -0
  259. package/src/lib/craft-until-settled.d.ts +99 -0
  260. package/src/lib/craft-until-settled.d.ts.map +1 -0
  261. package/src/lib/craft-until-settled.js +81 -0
  262. package/src/lib/craft-until-settled.js.map +1 -0
  263. package/src/lib/craft-use.d.ts +26 -0
  264. package/src/lib/craft-use.d.ts.map +1 -0
  265. package/src/lib/craft-use.js +37 -0
  266. package/src/lib/craft-use.js.map +1 -0
  267. package/src/lib/craft-view-transition.d.ts +102 -0
  268. package/src/lib/craft-view-transition.d.ts.map +1 -0
  269. package/src/lib/craft-view-transition.js +130 -0
  270. package/src/lib/craft-view-transition.js.map +1 -0
  271. package/src/lib/dom-event-hook.d.ts +30 -0
  272. package/src/lib/dom-event-hook.d.ts.map +1 -0
  273. package/src/lib/dom-event-hook.js +16 -0
  274. package/src/lib/dom-event-hook.js.map +1 -0
  275. package/src/lib/fn-wrapper.d.ts +13 -0
  276. package/src/lib/fn-wrapper.d.ts.map +1 -0
  277. package/src/lib/fn-wrapper.js +66 -0
  278. package/src/lib/fn-wrapper.js.map +1 -0
  279. package/src/lib/form/craft-field.d.ts +155 -0
  280. package/src/lib/form/craft-field.d.ts.map +1 -0
  281. package/src/lib/form/craft-field.directive.d.ts +70 -0
  282. package/src/lib/form/craft-field.directive.d.ts.map +1 -0
  283. package/src/lib/form/craft-field.directive.js +549 -0
  284. package/src/lib/form/craft-field.directive.js.map +1 -0
  285. package/src/lib/form/craft-field.js +586 -0
  286. package/src/lib/form/craft-field.js.map +1 -0
  287. package/src/lib/form/field-exception.d.ts +62 -0
  288. package/src/lib/form/field-exception.d.ts.map +1 -0
  289. package/src/lib/form/field-exception.js +37 -0
  290. package/src/lib/form/field-exception.js.map +1 -0
  291. package/src/lib/form/field-lens.d.ts +29 -0
  292. package/src/lib/form/field-lens.d.ts.map +1 -0
  293. package/src/lib/form/field-lens.js +32 -0
  294. package/src/lib/form/field-lens.js.map +1 -0
  295. package/src/lib/form/insert-form-attributes.d.ts +69 -0
  296. package/src/lib/form/insert-form-attributes.d.ts.map +1 -0
  297. package/src/lib/form/insert-form-attributes.js +163 -0
  298. package/src/lib/form/insert-form-attributes.js.map +1 -0
  299. package/src/lib/form/insert-form-internals.d.ts +110 -0
  300. package/src/lib/form/insert-form-internals.d.ts.map +1 -0
  301. package/src/lib/form/insert-form-internals.js +276 -0
  302. package/src/lib/form/insert-form-internals.js.map +1 -0
  303. package/src/lib/form/insert-form-schema.d.ts +10 -0
  304. package/src/lib/form/insert-form-schema.d.ts.map +1 -0
  305. package/src/lib/form/insert-form-schema.js +62 -0
  306. package/src/lib/form/insert-form-schema.js.map +1 -0
  307. package/src/lib/form/insert-form-submit.d.ts +79 -0
  308. package/src/lib/form/insert-form-submit.d.ts.map +1 -0
  309. package/src/lib/form/insert-form-submit.js +126 -0
  310. package/src/lib/form/insert-form-submit.js.map +1 -0
  311. package/src/lib/form/insert-form.d.ts +39 -0
  312. package/src/lib/form/insert-form.d.ts.map +1 -0
  313. package/src/lib/form/insert-form.js +255 -0
  314. package/src/lib/form/insert-form.js.map +1 -0
  315. package/src/lib/form/insert-select-form-tree.d.ts +33 -0
  316. package/src/lib/form/insert-select-form-tree.d.ts.map +1 -0
  317. package/src/lib/form/insert-select-form-tree.js +144 -0
  318. package/src/lib/form/insert-select-form-tree.js.map +1 -0
  319. package/src/lib/form/insert-sub-form-field.d.ts +17 -0
  320. package/src/lib/form/insert-sub-form-field.d.ts.map +1 -0
  321. package/src/lib/form/insert-sub-form-field.js +41 -0
  322. package/src/lib/form/insert-sub-form-field.js.map +1 -0
  323. package/src/lib/form/make-form-tree-insert.d.ts +22 -0
  324. package/src/lib/form/make-form-tree-insert.d.ts.map +1 -0
  325. package/src/lib/form/make-form-tree-insert.js +43 -0
  326. package/src/lib/form/make-form-tree-insert.js.map +1 -0
  327. package/src/lib/form/target-form-field.d.ts +11 -0
  328. package/src/lib/form/target-form-field.d.ts.map +1 -0
  329. package/src/lib/form/target-form-field.js +1 -0
  330. package/src/lib/form/target-form-field.js.map +1 -0
  331. package/src/lib/form/validator.d.ts +174 -0
  332. package/src/lib/form/validator.d.ts.map +1 -0
  333. package/src/lib/form/validator.js +465 -0
  334. package/src/lib/form/validator.js.map +1 -0
  335. package/src/lib/from-event-to-source$.d.ts +210 -0
  336. package/src/lib/from-event-to-source$.d.ts.map +1 -0
  337. package/src/lib/from-event-to-source$.js +29 -0
  338. package/src/lib/from-event-to-source$.js.map +1 -0
  339. package/src/lib/global-persister-handler.service.d.ts +10 -0
  340. package/src/lib/global-persister-handler.service.d.ts.map +1 -0
  341. package/src/lib/global-persister-handler.service.js +40 -0
  342. package/src/lib/global-persister-handler.service.js.map +1 -0
  343. package/src/lib/host/craft-compat.d.ts +242 -0
  344. package/src/lib/host/craft-compat.d.ts.map +1 -0
  345. package/src/lib/host/craft-compat.js +444 -0
  346. package/src/lib/host/craft-compat.js.map +1 -0
  347. package/src/lib/host/craft-dom.d.ts +16 -0
  348. package/src/lib/host/craft-dom.d.ts.map +1 -0
  349. package/src/lib/host/craft-dom.js +24 -0
  350. package/src/lib/host/craft-dom.js.map +1 -0
  351. package/src/lib/host/craft-http.d.ts +22 -0
  352. package/src/lib/host/craft-http.d.ts.map +1 -0
  353. package/src/lib/host/craft-http.js +80 -0
  354. package/src/lib/host/craft-http.js.map +1 -0
  355. package/src/lib/host/craft-injector-host.d.ts +3 -0
  356. package/src/lib/host/craft-injector-host.d.ts.map +1 -0
  357. package/src/lib/host/craft-injector-host.js +2 -0
  358. package/src/lib/host/craft-injector-host.js.map +1 -0
  359. package/src/lib/host/craft-injector.d.ts +40 -0
  360. package/src/lib/host/craft-injector.d.ts.map +1 -0
  361. package/src/lib/host/craft-injector.js +318 -0
  362. package/src/lib/host/craft-injector.js.map +1 -0
  363. package/src/lib/host/craft-linked-signal.d.ts +17 -0
  364. package/src/lib/host/craft-linked-signal.d.ts.map +1 -0
  365. package/src/lib/host/craft-linked-signal.js +86 -0
  366. package/src/lib/host/craft-linked-signal.js.map +1 -0
  367. package/src/lib/host/craft-router-runtime.d.ts +61 -0
  368. package/src/lib/host/craft-router-runtime.d.ts.map +1 -0
  369. package/src/lib/host/craft-router-runtime.js +456 -0
  370. package/src/lib/host/craft-router-runtime.js.map +1 -0
  371. package/src/lib/host/craft-router-types.d.ts +84 -0
  372. package/src/lib/host/craft-router-types.d.ts.map +1 -0
  373. package/src/lib/host/craft-router-types.js +35 -0
  374. package/src/lib/host/craft-router-types.js.map +1 -0
  375. package/src/lib/host/craft-signal.d.ts +45 -0
  376. package/src/lib/host/craft-signal.d.ts.map +1 -0
  377. package/src/lib/host/craft-signal.js +161 -0
  378. package/src/lib/host/craft-signal.js.map +1 -0
  379. package/src/lib/host/craft-test-bed.d.ts +63 -0
  380. package/src/lib/host/craft-test-bed.d.ts.map +1 -0
  381. package/src/lib/host/craft-test-bed.js +114 -0
  382. package/src/lib/host/craft-test-bed.js.map +1 -0
  383. package/src/lib/host-tag.d.ts +2 -0
  384. package/src/lib/host-tag.d.ts.map +1 -0
  385. package/src/lib/host-tag.js +2 -0
  386. package/src/lib/host-tag.js.map +1 -0
  387. package/src/lib/insert-entities.d.ts +131 -0
  388. package/src/lib/insert-entities.d.ts.map +1 -0
  389. package/src/lib/insert-entities.js +159 -0
  390. package/src/lib/insert-entities.js.map +1 -0
  391. package/src/lib/insert-noop-typing-anchor.d.ts +15 -0
  392. package/src/lib/insert-noop-typing-anchor.d.ts.map +1 -0
  393. package/src/lib/insert-noop-typing-anchor.js +16 -0
  394. package/src/lib/insert-noop-typing-anchor.js.map +1 -0
  395. package/src/lib/insert-pagination-placeholder-data.d.ts +122 -0
  396. package/src/lib/insert-pagination-placeholder-data.d.ts.map +1 -0
  397. package/src/lib/insert-pagination-placeholder-data.js +244 -0
  398. package/src/lib/insert-pagination-placeholder-data.js.map +1 -0
  399. package/src/lib/insert-react-on-mutation.d.ts +261 -0
  400. package/src/lib/insert-react-on-mutation.d.ts.map +1 -0
  401. package/src/lib/insert-react-on-mutation.js +227 -0
  402. package/src/lib/insert-react-on-mutation.js.map +1 -0
  403. package/src/lib/insert-select-resource.d.ts +31 -0
  404. package/src/lib/insert-select-resource.d.ts.map +1 -0
  405. package/src/lib/insert-select-resource.js +27 -0
  406. package/src/lib/insert-select-resource.js.map +1 -0
  407. package/src/lib/insert-select.d.ts +126 -0
  408. package/src/lib/insert-select.d.ts.map +1 -0
  409. package/src/lib/insert-select.js +535 -0
  410. package/src/lib/insert-select.js.map +1 -0
  411. package/src/lib/insert-storage-persister.d.ts +27 -0
  412. package/src/lib/insert-storage-persister.d.ts.map +1 -0
  413. package/src/lib/insert-storage-persister.js +65 -0
  414. package/src/lib/insert-storage-persister.js.map +1 -0
  415. package/src/lib/insert-typed-pipes.d.ts +64 -0
  416. package/src/lib/insert-typed-pipes.d.ts.map +1 -0
  417. package/src/lib/insert-typed-pipes.js +32 -0
  418. package/src/lib/insert-typed-pipes.js.map +1 -0
  419. package/src/lib/linked-source.d.ts +8 -0
  420. package/src/lib/linked-source.d.ts.map +1 -0
  421. package/src/lib/linked-source.js +24 -0
  422. package/src/lib/linked-source.js.map +1 -0
  423. package/src/lib/local-storage-persister.d.ts +4 -0
  424. package/src/lib/local-storage-persister.d.ts.map +1 -0
  425. package/src/lib/local-storage-persister.js +342 -0
  426. package/src/lib/local-storage-persister.js.map +1 -0
  427. package/src/lib/middleware-schema-shared.d.ts +67 -0
  428. package/src/lib/middleware-schema-shared.d.ts.map +1 -0
  429. package/src/lib/middleware-schema-shared.js +34 -0
  430. package/src/lib/middleware-schema-shared.js.map +1 -0
  431. package/src/lib/mock-http-request-for-route.d.ts +173 -0
  432. package/src/lib/mock-http-request-for-route.d.ts.map +1 -0
  433. package/src/lib/mock-http-request-for-route.js +127 -0
  434. package/src/lib/mock-http-request-for-route.js.map +1 -0
  435. package/src/lib/mutation.d.ts +332 -0
  436. package/src/lib/mutation.d.ts.map +1 -0
  437. package/src/lib/mutation.js +923 -0
  438. package/src/lib/mutation.js.map +1 -0
  439. package/src/lib/on$.d.ts +26 -0
  440. package/src/lib/on$.d.ts.map +1 -0
  441. package/src/lib/on$.js +19 -0
  442. package/src/lib/on$.js.map +1 -0
  443. package/src/lib/portable-server-function.d.ts +68 -0
  444. package/src/lib/portable-server-function.d.ts.map +1 -0
  445. package/src/lib/portable-server-function.js +97 -0
  446. package/src/lib/portable-server-function.js.map +1 -0
  447. package/src/lib/preserved-resource.d.ts +4 -0
  448. package/src/lib/preserved-resource.d.ts.map +1 -0
  449. package/src/lib/preserved-resource.js +60 -0
  450. package/src/lib/preserved-resource.js.map +1 -0
  451. package/src/lib/primitive-method-runtime-context.d.ts +28 -0
  452. package/src/lib/primitive-method-runtime-context.d.ts.map +1 -0
  453. package/src/lib/primitive-method-runtime-context.js +38 -0
  454. package/src/lib/primitive-method-runtime-context.js.map +1 -0
  455. package/src/lib/primitive-resource-runtime-context.d.ts +46 -0
  456. package/src/lib/primitive-resource-runtime-context.d.ts.map +1 -0
  457. package/src/lib/primitive-resource-runtime-context.js +102 -0
  458. package/src/lib/primitive-resource-runtime-context.js.map +1 -0
  459. package/src/lib/query-params.d.ts +216 -0
  460. package/src/lib/query-params.d.ts.map +1 -0
  461. package/src/lib/query-params.js +324 -0
  462. package/src/lib/query-params.js.map +1 -0
  463. package/src/lib/query.core.d.ts +214 -0
  464. package/src/lib/query.core.d.ts.map +1 -0
  465. package/src/lib/query.core.js +210 -0
  466. package/src/lib/query.core.js.map +1 -0
  467. package/src/lib/query.d.ts +324 -0
  468. package/src/lib/query.d.ts.map +1 -0
  469. package/src/lib/query.js +971 -0
  470. package/src/lib/query.js.map +1 -0
  471. package/src/lib/reactive-read.d.ts +162 -0
  472. package/src/lib/reactive-read.d.ts.map +1 -0
  473. package/src/lib/reactive-read.js +389 -0
  474. package/src/lib/reactive-read.js.map +1 -0
  475. package/src/lib/resource-by-id.d.ts +71 -0
  476. package/src/lib/resource-by-id.d.ts.map +1 -0
  477. package/src/lib/resource-by-id.js +294 -0
  478. package/src/lib/resource-by-id.js.map +1 -0
  479. package/src/lib/resource-exception.d.ts +30 -0
  480. package/src/lib/resource-exception.d.ts.map +1 -0
  481. package/src/lib/resource-exception.js +86 -0
  482. package/src/lib/resource-exception.js.map +1 -0
  483. package/src/lib/route-checked-di.d.ts +229 -0
  484. package/src/lib/route-checked-di.d.ts.map +1 -0
  485. package/src/lib/route-checked-di.js +1 -0
  486. package/src/lib/route-checked-di.js.map +1 -0
  487. package/src/lib/schema-validation.d.ts +89 -0
  488. package/src/lib/schema-validation.d.ts.map +1 -0
  489. package/src/lib/schema-validation.js +110 -0
  490. package/src/lib/schema-validation.js.map +1 -0
  491. package/src/lib/send-context-to-ai.d.ts +20 -0
  492. package/src/lib/send-context-to-ai.d.ts.map +1 -0
  493. package/src/lib/send-context-to-ai.js +18 -0
  494. package/src/lib/send-context-to-ai.js.map +1 -0
  495. package/src/lib/send-context-to-ai.tokens.d.ts +12 -0
  496. package/src/lib/send-context-to-ai.tokens.d.ts.map +1 -0
  497. package/src/lib/send-context-to-ai.tokens.js +1 -0
  498. package/src/lib/send-context-to-ai.tokens.js.map +1 -0
  499. package/src/lib/server-function-client.d.ts +102 -0
  500. package/src/lib/server-function-client.d.ts.map +1 -0
  501. package/src/lib/server-function-client.js +106 -0
  502. package/src/lib/server-function-client.js.map +1 -0
  503. package/src/lib/server-function-contract.d.ts +42 -0
  504. package/src/lib/server-function-contract.d.ts.map +1 -0
  505. package/src/lib/server-function-contract.js +23 -0
  506. package/src/lib/server-function-contract.js.map +1 -0
  507. package/src/lib/server-function-middleware.d.ts +222 -0
  508. package/src/lib/server-function-middleware.d.ts.map +1 -0
  509. package/src/lib/server-function-middleware.js +189 -0
  510. package/src/lib/server-function-middleware.js.map +1 -0
  511. package/src/lib/server-function.d.ts +114 -0
  512. package/src/lib/server-function.d.ts.map +1 -0
  513. package/src/lib/server-function.js +80 -0
  514. package/src/lib/server-function.js.map +1 -0
  515. package/src/lib/server-layer.d.ts +185 -0
  516. package/src/lib/server-layer.d.ts.map +1 -0
  517. package/src/lib/server-layer.js +121 -0
  518. package/src/lib/server-layer.js.map +1 -0
  519. package/src/lib/server.d.ts +83 -0
  520. package/src/lib/server.d.ts.map +1 -0
  521. package/src/lib/server.js +266 -0
  522. package/src/lib/server.js.map +1 -0
  523. package/src/lib/setup-craft-service-test.d.ts +90 -0
  524. package/src/lib/setup-craft-service-test.d.ts.map +1 -0
  525. package/src/lib/setup-craft-service-test.js +193 -0
  526. package/src/lib/setup-craft-service-test.js.map +1 -0
  527. package/src/lib/setup-craft-service-testing-by-register.d.ts +245 -0
  528. package/src/lib/setup-craft-service-testing-by-register.d.ts.map +1 -0
  529. package/src/lib/setup-craft-service-testing-by-register.js +316 -0
  530. package/src/lib/setup-craft-service-testing-by-register.js.map +1 -0
  531. package/src/lib/signal-proxy.d.ts +21 -0
  532. package/src/lib/signal-proxy.d.ts.map +1 -0
  533. package/src/lib/signal-proxy.js +79 -0
  534. package/src/lib/signal-proxy.js.map +1 -0
  535. package/src/lib/signal-source.d.ts +392 -0
  536. package/src/lib/signal-source.d.ts.map +1 -0
  537. package/src/lib/signal-source.js +433 -0
  538. package/src/lib/signal-source.js.map +1 -0
  539. package/src/lib/source$.d.ts +121 -0
  540. package/src/lib/source$.d.ts.map +1 -0
  541. package/src/lib/source$.js +171 -0
  542. package/src/lib/source$.js.map +1 -0
  543. package/src/lib/source-from-event.d.ts +350 -0
  544. package/src/lib/source-from-event.d.ts.map +1 -0
  545. package/src/lib/source-from-event.js +26 -0
  546. package/src/lib/source-from-event.js.map +1 -0
  547. package/src/lib/stacked-source.d.ts +6 -0
  548. package/src/lib/stacked-source.d.ts.map +1 -0
  549. package/src/lib/stacked-source.js +29 -0
  550. package/src/lib/stacked-source.js.map +1 -0
  551. package/src/lib/standard-schema.d.ts +43 -0
  552. package/src/lib/standard-schema.d.ts.map +1 -0
  553. package/src/lib/standard-schema.js +1 -0
  554. package/src/lib/standard-schema.js.map +1 -0
  555. package/src/lib/state-method-runtime-context.d.ts +13 -0
  556. package/src/lib/state-method-runtime-context.d.ts.map +1 -0
  557. package/src/lib/state-method-runtime-context.js +11 -0
  558. package/src/lib/state-method-runtime-context.js.map +1 -0
  559. package/src/lib/state.d.ts +158 -0
  560. package/src/lib/state.d.ts.map +1 -0
  561. package/src/lib/state.js +388 -0
  562. package/src/lib/state.js.map +1 -0
  563. package/src/lib/storage-persister.service.d.ts +25 -0
  564. package/src/lib/storage-persister.service.d.ts.map +1 -0
  565. package/src/lib/storage-persister.service.js +27 -0
  566. package/src/lib/storage-persister.service.js.map +1 -0
  567. package/src/lib/take-app-snapshot.d.ts +31 -0
  568. package/src/lib/take-app-snapshot.d.ts.map +1 -0
  569. package/src/lib/take-app-snapshot.js +93 -0
  570. package/src/lib/take-app-snapshot.js.map +1 -0
  571. package/src/lib/template-trace.d.ts +37 -0
  572. package/src/lib/template-trace.d.ts.map +1 -0
  573. package/src/lib/template-trace.js +37 -0
  574. package/src/lib/template-trace.js.map +1 -0
  575. package/src/lib/temporal-runtime.d.ts +146 -0
  576. package/src/lib/temporal-runtime.d.ts.map +1 -0
  577. package/src/lib/temporal-runtime.js +375 -0
  578. package/src/lib/temporal-runtime.js.map +1 -0
  579. package/src/lib/to-source.d.ts +335 -0
  580. package/src/lib/to-source.d.ts.map +1 -0
  581. package/src/lib/to-source.js +359 -0
  582. package/src/lib/to-source.js.map +1 -0
  583. package/src/lib/util/craft-resource-ref.d.ts +29 -0
  584. package/src/lib/util/craft-resource-ref.d.ts.map +1 -0
  585. package/src/lib/util/craft-resource-ref.js +1 -0
  586. package/src/lib/util/craft-resource-ref.js.map +1 -0
  587. package/src/lib/util/craft-resource-status.d.ts +17 -0
  588. package/src/lib/util/craft-resource-status.d.ts.map +1 -0
  589. package/src/lib/util/craft-resource-status.js +14 -0
  590. package/src/lib/util/craft-resource-status.js.map +1 -0
  591. package/src/lib/util/entities-util.d.ts +340 -0
  592. package/src/lib/util/entities-util.d.ts.map +1 -0
  593. package/src/lib/util/entities-util.js +136 -0
  594. package/src/lib/util/entities-util.js.map +1 -0
  595. package/src/lib/util/explicit-effect.d.ts +42 -0
  596. package/src/lib/util/explicit-effect.d.ts.map +1 -0
  597. package/src/lib/util/explicit-effect.js +37 -0
  598. package/src/lib/util/explicit-effect.js.map +1 -0
  599. package/src/lib/util/extract-signal-props-and-methods.d.ts +20 -0
  600. package/src/lib/util/extract-signal-props-and-methods.d.ts.map +1 -0
  601. package/src/lib/util/extract-signal-props-and-methods.js +1 -0
  602. package/src/lib/util/extract-signal-props-and-methods.js.map +1 -0
  603. package/src/lib/util/method-trigger-nonce.d.ts +45 -0
  604. package/src/lib/util/method-trigger-nonce.d.ts.map +1 -0
  605. package/src/lib/util/method-trigger-nonce.js +58 -0
  606. package/src/lib/util/method-trigger-nonce.js.map +1 -0
  607. package/src/lib/util/persister.type.d.ts +37 -0
  608. package/src/lib/util/persister.type.d.ts.map +1 -0
  609. package/src/lib/util/persister.type.js +1 -0
  610. package/src/lib/util/persister.type.js.map +1 -0
  611. package/src/lib/util/persister.util.d.ts +8 -0
  612. package/src/lib/util/persister.util.d.ts.map +1 -0
  613. package/src/lib/util/persister.util.js +71 -0
  614. package/src/lib/util/persister.util.js.map +1 -0
  615. package/src/lib/util/react-on-mutation-effect.d.ts +16 -0
  616. package/src/lib/util/react-on-mutation-effect.d.ts.map +1 -0
  617. package/src/lib/util/react-on-mutation-effect.js +148 -0
  618. package/src/lib/util/react-on-mutation-effect.js.map +1 -0
  619. package/src/lib/util/resource-by-id-changes-tracker.util.d.ts +27 -0
  620. package/src/lib/util/resource-by-id-changes-tracker.util.d.ts.map +1 -0
  621. package/src/lib/util/resource-by-id-changes-tracker.util.js +97 -0
  622. package/src/lib/util/resource-by-id-changes-tracker.util.js.map +1 -0
  623. package/src/lib/util/source.type.d.ts +6 -0
  624. package/src/lib/util/source.type.d.ts.map +1 -0
  625. package/src/lib/util/source.type.js +1 -0
  626. package/src/lib/util/source.type.js.map +1 -0
  627. package/src/lib/util/types/access-type-object-property-by-dotted-path.type.d.ts +4 -0
  628. package/src/lib/util/types/access-type-object-property-by-dotted-path.type.d.ts.map +1 -0
  629. package/src/lib/util/types/access-type-object-property-by-dotted-path.type.js +1 -0
  630. package/src/lib/util/types/access-type-object-property-by-dotted-path.type.js.map +1 -0
  631. package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.d.ts +27 -0
  632. package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.d.ts.map +1 -0
  633. package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.js +1 -0
  634. package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.js.map +1 -0
  635. package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.d.ts +24 -0
  636. package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.d.ts.map +1 -0
  637. package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.js +1 -0
  638. package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.js.map +1 -0
  639. package/src/lib/util/types/brand.d.ts +7 -0
  640. package/src/lib/util/types/brand.d.ts.map +1 -0
  641. package/src/lib/util/types/brand.js +9 -0
  642. package/src/lib/util/types/brand.js.map +1 -0
  643. package/src/lib/util/types/object-deep-path-mapper.type.d.ts +13 -0
  644. package/src/lib/util/types/object-deep-path-mapper.type.d.ts.map +1 -0
  645. package/src/lib/util/types/object-deep-path-mapper.type.js +1 -0
  646. package/src/lib/util/types/object-deep-path-mapper.type.js.map +1 -0
  647. package/src/lib/util/types/resource-by-id-config.type.d.ts +115 -0
  648. package/src/lib/util/types/resource-by-id-config.type.d.ts.map +1 -0
  649. package/src/lib/util/types/resource-by-id-config.type.js +1 -0
  650. package/src/lib/util/types/resource-by-id-config.type.js.map +1 -0
  651. package/src/lib/util/types/resource-with-params-or-params-fn.type.d.ts +52 -0
  652. package/src/lib/util/types/resource-with-params-or-params-fn.type.d.ts.map +1 -0
  653. package/src/lib/util/types/resource-with-params-or-params-fn.type.js +1 -0
  654. package/src/lib/util/types/resource-with-params-or-params-fn.type.js.map +1 -0
  655. package/src/lib/util/types/shared.type.d.ts +66 -0
  656. package/src/lib/util/types/shared.type.d.ts.map +1 -0
  657. package/src/lib/util/types/shared.type.js +1 -0
  658. package/src/lib/util/types/shared.type.js.map +1 -0
  659. package/src/lib/util/types/util.d.ts +16 -0
  660. package/src/lib/util/types/util.d.ts.map +1 -0
  661. package/src/lib/util/types/util.js +60 -0
  662. package/src/lib/util/types/util.js.map +1 -0
  663. package/src/lib/util/types/util.type.d.ts +67 -0
  664. package/src/lib/util/types/util.type.d.ts.map +1 -0
  665. package/src/lib/util/types/util.type.js +5 -0
  666. package/src/lib/util/types/util.type.js.map +1 -0
  667. package/src/lib/util/update-state.util.d.ts +10 -0
  668. package/src/lib/util/update-state.util.d.ts.map +1 -0
  669. package/src/lib/util/update-state.util.js +31 -0
  670. package/src/lib/util/update-state.util.js.map +1 -0
  671. package/src/lib/util/util.d.ts +19 -0
  672. package/src/lib/util/util.d.ts.map +1 -0
  673. package/src/lib/util/util.js +50 -0
  674. package/src/lib/util/util.js.map +1 -0
  675. package/src/lib/util/util.type.d.ts +107 -0
  676. package/src/lib/util/util.type.d.ts.map +1 -0
  677. package/src/lib/util/util.type.js +9 -0
  678. package/src/lib/util/util.type.js.map +1 -0
  679. package/src/lib/yieldable.d.ts +94 -0
  680. package/src/lib/yieldable.d.ts.map +1 -0
  681. package/src/lib/yieldable.js +109 -0
  682. package/src/lib/yieldable.js.map +1 -0
@@ -0,0 +1,115 @@
1
+ import { ResourceLoaderParams, ResourceOptions, ResourceRef, ResourceStreamingLoader } from '../../host/craft-compat';
2
+ import { ResourceMethod } from './shared.type';
3
+ import { ResourceByIdRef } from '../../resource-by-id';
4
+ export type ResourceByIdConfig<ResourceState, Params, ParamsArgs, GroupIdentifier extends string, FromObjectGroupIdentifier extends string, FromObjectState, FromObjectResourceParams> = (Omit<ResourceOptions<NoInfer<ResourceState>, Params>, 'params' | 'loader'> & ({
5
+ /**
6
+ * A reactive function which determines the request to be made. Whenever the request changes, the
7
+ * loader will be triggered to fetch a new value for the resource.
8
+ *
9
+ * If a request function isn't provided, the loader won't rerun unless the resource is reloaded.
10
+ */
11
+ params: () => Params;
12
+ loader: (param: NoInfer<ResourceLoaderParams<Params>>) => Promise<ResourceState>;
13
+ method?: never;
14
+ fromResourceById?: never;
15
+ stream?: never;
16
+ /**
17
+ * Each the query load, the value will return undefined.
18
+ * To avoid flickering display and also enable to the data to be retrieved from cache, use () => true
19
+ * default value: false
20
+ */
21
+ preservePreviousValue?: () => boolean;
22
+ } | {
23
+ /**
24
+ * Used to generate a method in the store, when called will trigger the resource loader/stream.
25
+ *
26
+ * Only support one parameter which can be an object to pass multiple parameters.
27
+ */
28
+ method: (args: ParamsArgs) => Params;
29
+ loader: (param: NoInfer<ResourceLoaderParams<Params>>) => Promise<ResourceState>;
30
+ params?: never;
31
+ fromResourceById?: never;
32
+ stream?: never;
33
+ preservePreviousValue?: () => boolean;
34
+ } | {
35
+ method?: never;
36
+ loader?: never;
37
+ params?: () => Params;
38
+ fromResourceById?: never;
39
+ /**
40
+ * Loading function which returns a `Promise` of a signal of the resource's value for a given
41
+ * request, which can change over time as new values are received from a stream.
42
+ */
43
+ stream: ResourceStreamingLoader<ResourceState, Params>;
44
+ preservePreviousValue?: () => boolean;
45
+ } | {
46
+ method: ResourceMethod<ParamsArgs, Params>;
47
+ loader?: never;
48
+ params?: never;
49
+ fromResourceById?: never;
50
+ /**
51
+ * Loading function which returns a `Promise` of a signal of the resource's value for a given
52
+ * request, which can change over time as new values are received from a stream.
53
+ */
54
+ stream: ResourceStreamingLoader<ResourceState, Params>;
55
+ preservePreviousValue?: () => boolean;
56
+ } | {
57
+ /**
58
+ * Use it, when you need to bind a ResourceByIdRef to another ResourceByIdRef.
59
+ * It will enforce the fromObject keys syncing when the fromObject resource change.
60
+ */
61
+ fromResourceById: ResourceByIdRef<FromObjectGroupIdentifier, FromObjectState, FromObjectResourceParams>;
62
+ /**
63
+ * A reactive function which determines the request to be made. Whenever the request changes, the
64
+ * loader will be triggered to fetch a new value for the resource.
65
+ *
66
+ * If a request function isn't provided, the loader won't rerun unless the resource is reloaded.
67
+ */
68
+ params: (entity: ResourceRef<NoInfer<FromObjectState>>) => Params;
69
+ loader: (param: NoInfer<ResourceLoaderParams<Params>>) => Promise<ResourceState>;
70
+ method?: never;
71
+ stream?: never;
72
+ /**
73
+ * Each the query load, the value will return undefined.
74
+ * To avoid flickering display and also enable to the data to be retrieved from cache, use () => true
75
+ * default value: false
76
+ */
77
+ preservePreviousValue?: () => boolean;
78
+ } | {
79
+ method?: never;
80
+ loader?: never;
81
+ params?: () => Params;
82
+ fromResourceById?: never;
83
+ /**
84
+ * Loading function which returns a `Promise` of a signal of the resource's value for a given
85
+ * request, which can change over time as new values are received from a stream.
86
+ */
87
+ stream: ResourceStreamingLoader<ResourceState, Params>;
88
+ preservePreviousValue?: () => boolean;
89
+ }) & {
90
+ /**
91
+ * A unique identifier for the resource, derived from the params.
92
+ * It should be a string that uniquely identifies the resource based on the params.
93
+ */
94
+ identifier: (params: NoInfer<NonNullable<Params>>) => GroupIdentifier;
95
+ /**
96
+ * Under the hood, a resource is generated for each new identifier generated when the params source change.
97
+ *
98
+ * If the source change, and their is an existing resource with the same identifier, it will be re-used.
99
+ *
100
+ * In this case, when the source is an object, an existing resource can be retrieved by the matching his record key with identifier function, but as the reference change it will trigger the loading of the resource again.
101
+ *
102
+ * To avoid this, you can use this option to tell how to compare the incoming params with the existing params of the resource.
103
+ * - 'useIdentifier': will use the identifier function to compare the previous params and the incoming params. This very useful when using pagination.
104
+ * - 'default' (default value): will use a strict equality check (===) between the previous params and the incoming params.
105
+ * - (a: Params, b: Params) => boolean: you can provide your own comparison function to compare the previous params and the incoming params. This is useful when you want to compare specific fields of the params.
106
+ *
107
+ * Note: if your params is a primitive (string, number, boolean, etc.), you don't need to use this option since the strict equality check will work as expected.
108
+ *
109
+ * For **queries** the default value is 'useIdentifier'
110
+ *
111
+ * For **mutations** the default value is 'default'
112
+ */
113
+ equalParams?: Params extends object ? 'default' | 'useIdentifier' | ((a: Params, b: Params, identifierFn: (params: Params) => GroupIdentifier) => boolean) : never;
114
+ });
115
+ //# sourceMappingURL=resource-by-id-config.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-by-id-config.type.d.ts","sourceRoot":"","sources":["../../../../../../../libs/core/src/lib/util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,EAAE,MAAM,OAAO,CAAC;CACvC,CACJ,GAAG;IACF;;;OAGG;IACH,UAAU,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,KAAK,eAAe,CAAC;IACtE;;;;;;;;;;;;;;;;;OAiBG;IACH,WAAW,CAAC,EAAE,MAAM,SAAS,MAAM,GAE3B,SAAS,GACT,eAAe,GACf,CAAC,CACC,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,eAAe,KAC9C,OAAO,CAAC,GACjB,KAAK,CAAC;CACX,CAAA,CAAC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=resource-by-id-config.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-by-id-config.type.js","sourceRoot":"","sources":["../../../../../../../libs/core/src/lib/util/types/resource-by-id-config.type.ts"],"names":[],"mappings":"","sourcesContent":["import {\n ResourceLoaderParams,\n ResourceOptions,\n ResourceRef,\n ResourceStreamingLoader,\n} from '../../host/craft-compat';\nimport { ResourceMethod } from './shared.type';\nimport { ResourceByIdRef } from '../../resource-by-id';\n\nexport type ResourceByIdConfig<\n ResourceState,\n Params,\n ParamsArgs,\n GroupIdentifier extends string,\n FromObjectGroupIdentifier extends string,\n FromObjectState,\n FromObjectResourceParams\n> =\n | Omit<ResourceOptions<NoInfer<ResourceState>, Params>, 'params' | 'loader'> &\n (\n | {\n /**\n * A reactive function which determines the request to be made. Whenever the request changes, the\n * loader will be triggered to fetch a new value for the resource.\n *\n * If a request function isn't provided, the loader won't rerun unless the resource is reloaded.\n */\n params: () => Params;\n loader: (\n param: NoInfer<ResourceLoaderParams<Params>>\n ) => Promise<ResourceState>;\n method?: never;\n fromResourceById?: never;\n stream?: never;\n /**\n * Each the query load, the value will return undefined.\n * To avoid flickering display and also enable to the data to be retrieved from cache, use () => true\n * default value: false\n */\n preservePreviousValue?: () => boolean;\n }\n | {\n /**\n * Used to generate a method in the store, when called will trigger the resource loader/stream.\n *\n * Only support one parameter which can be an object to pass multiple parameters.\n */\n method: (args: ParamsArgs) => Params;\n loader: (\n param: NoInfer<ResourceLoaderParams<Params>>\n ) => Promise<ResourceState>;\n params?: never;\n fromResourceById?: never;\n stream?: never;\n preservePreviousValue?: () => boolean;\n }\n | {\n method?: never;\n loader?: never;\n params?: () => Params;\n fromResourceById?: never;\n /**\n * Loading function which returns a `Promise` of a signal of the resource's value for a given\n * request, which can change over time as new values are received from a stream.\n */\n stream: ResourceStreamingLoader<ResourceState, Params>;\n preservePreviousValue?: () => boolean;\n }\n | {\n method: ResourceMethod<ParamsArgs, Params>;\n loader?: never;\n params?: never;\n fromResourceById?: never;\n /**\n * Loading function which returns a `Promise` of a signal of the resource's value for a given\n * request, which can change over time as new values are received from a stream.\n */\n stream: ResourceStreamingLoader<ResourceState, Params>;\n preservePreviousValue?: () => boolean;\n }\n | {\n /**\n * Use it, when you need to bind a ResourceByIdRef to another ResourceByIdRef.\n * It will enforce the fromObject keys syncing when the fromObject resource change.\n */\n fromResourceById: ResourceByIdRef<\n FromObjectGroupIdentifier,\n FromObjectState,\n FromObjectResourceParams\n >;\n /**\n * A reactive function which determines the request to be made. Whenever the request changes, the\n * loader will be triggered to fetch a new value for the resource.\n *\n * If a request function isn't provided, the loader won't rerun unless the resource is reloaded.\n */\n params: (entity: ResourceRef<NoInfer<FromObjectState>>) => Params;\n loader: (\n param: NoInfer<ResourceLoaderParams<Params>>\n ) => Promise<ResourceState>;\n method?: never;\n stream?: never;\n /**\n * Each the query load, the value will return undefined.\n * To avoid flickering display and also enable to the data to be retrieved from cache, use () => true\n * default value: false\n */\n preservePreviousValue?: () => boolean;\n }\n | {\n method?: never;\n loader?: never;\n params?: () => Params;\n fromResourceById?: never;\n /**\n * Loading function which returns a `Promise` of a signal of the resource's value for a given\n * request, which can change over time as new values are received from a stream.\n */\n stream: ResourceStreamingLoader<ResourceState, Params>;\n preservePreviousValue?: () => boolean;\n }\n ) & {\n /**\n * A unique identifier for the resource, derived from the params.\n * It should be a string that uniquely identifies the resource based on the params.\n */\n identifier: (params: NoInfer<NonNullable<Params>>) => GroupIdentifier;\n /**\n * Under the hood, a resource is generated for each new identifier generated when the params source change.\n *\n * If the source change, and their is an existing resource with the same identifier, it will be re-used.\n *\n * In this case, when the source is an object, an existing resource can be retrieved by the matching his record key with identifier function, but as the reference change it will trigger the loading of the resource again.\n *\n * To avoid this, you can use this option to tell how to compare the incoming params with the existing params of the resource.\n * - 'useIdentifier': will use the identifier function to compare the previous params and the incoming params. This very useful when using pagination.\n * - 'default' (default value): will use a strict equality check (===) between the previous params and the incoming params.\n * - (a: Params, b: Params) => boolean: you can provide your own comparison function to compare the previous params and the incoming params. This is useful when you want to compare specific fields of the params.\n *\n * Note: if your params is a primitive (string, number, boolean, etc.), you don't need to use this option since the strict equality check will work as expected.\n *\n * For **queries** the default value is 'useIdentifier'\n *\n * For **mutations** the default value is 'default'\n */\n equalParams?: Params extends object\n ?\n | 'default'\n | 'useIdentifier'\n | ((\n a: Params,\n b: Params,\n identifierFn: (params: Params) => GroupIdentifier\n ) => boolean)\n : never;\n };\n"]}
@@ -0,0 +1,52 @@
1
+ import { ResourceLoaderParams, ResourceOptions, ResourceStreamingLoader } from '../../host/craft-compat';
2
+ import { ResourceMethod } from './shared.type';
3
+ export type ResourceWithParamsOrParamsFn<ResourceState, Params, ParamsArgs> = (Omit<ResourceOptions<NoInfer<ResourceState>, Params>, 'params' | 'loader'> & ({
4
+ /**
5
+ * A reactive function which determines the request to be made. Whenever the request changes, the
6
+ * loader will be triggered to fetch a new value for the resource.
7
+ *
8
+ * If a request function isn't provided, the loader won't rerun unless the resource is reloaded.
9
+ */
10
+ params: () => Params;
11
+ loader: (param: NoInfer<ResourceLoaderParams<Params>>) => Promise<ResourceState>;
12
+ method?: never;
13
+ stream?: never;
14
+ /**
15
+ * Each the query load, the value will return undefined.
16
+ * To avoid flickering display and also enable to the data to be retrieved from cache, use () => true
17
+ * default value: false
18
+ */
19
+ preservePreviousValue?: () => boolean;
20
+ } | {
21
+ /**
22
+ * Used to generate a method in the store, when called will trigger the resource loader/stream.
23
+ *
24
+ * Only support one parameter which can be an object to pass multiple parameters.
25
+ */
26
+ method: (args: ParamsArgs) => Params;
27
+ loader: (param: NoInfer<ResourceLoaderParams<Params>>) => Promise<ResourceState>;
28
+ params?: never;
29
+ stream?: never;
30
+ preservePreviousValue?: () => boolean;
31
+ } | {
32
+ method?: never;
33
+ loader?: never;
34
+ params?: () => Params;
35
+ /**
36
+ * Loading function which returns a `Promise` of a signal of the resource's value for a given
37
+ * request, which can change over time as new values are received from a stream.
38
+ */
39
+ stream: ResourceStreamingLoader<ResourceState, Params>;
40
+ preservePreviousValue?: () => boolean;
41
+ } | {
42
+ method: ResourceMethod<ParamsArgs, Params>;
43
+ loader?: never;
44
+ params?: never;
45
+ /**
46
+ * Loading function which returns a `Promise` of a signal of the resource's value for a given
47
+ * request, which can change over time as new values are received from a stream.
48
+ */
49
+ stream: ResourceStreamingLoader<ResourceState, Params>;
50
+ preservePreviousValue?: () => boolean;
51
+ }));
52
+ //# sourceMappingURL=resource-with-params-or-params-fn.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-with-params-or-params-fn.type.d.ts","sourceRoot":"","sources":["../../../../../../../libs/core/src/lib/util/types/resource-with-params-or-params-fn.type.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,uBAAuB,EACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,MAAM,4BAA4B,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,IACxE,CAAE,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC,GACxE,CACI;IACE;;;;;OAKG;IACH,MAAM,EAAE,MAAM,MAAM,CAAC;IACrB,MAAM,EAAE,CACN,KAAK,EAAE,OAAO,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,KACzC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC5B,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,MAAM,CAAC,EAAE,KAAK,CAAC;IACf;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,MAAM,OAAO,CAAC;CACvC,GACD;IACE;;;;OAIG;IACH,MAAM,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,MAAM,CAAC;IACrC,MAAM,EAAE,CACN,KAAK,EAAE,OAAO,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,KACzC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC5B,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,qBAAqB,CAAC,EAAE,MAAM,OAAO,CAAC;CACvC,GACD;IACE,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;IACtB;;;OAGG;IACH,MAAM,EAAE,uBAAuB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACvD,qBAAqB,CAAC,EAAE,MAAM,OAAO,CAAC;CACvC,GACD;IACE,MAAM,EAAE,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAC3C,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,MAAM,CAAC,EAAE,KAAK,CAAC;IACf;;;OAGG;IACH,MAAM,EAAE,uBAAuB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACvD,qBAAqB,CAAC,EAAE,MAAM,OAAO,CAAC;CACvC,CACJ,CAAA,CAAC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=resource-with-params-or-params-fn.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-with-params-or-params-fn.type.js","sourceRoot":"","sources":["../../../../../../../libs/core/src/lib/util/types/resource-with-params-or-params-fn.type.ts"],"names":[],"mappings":"","sourcesContent":["import {\n ResourceLoaderParams,\n ResourceOptions,\n ResourceStreamingLoader,\n} from '../../host/craft-compat';\nimport { ResourceMethod } from './shared.type';\n\nexport type ResourceWithParamsOrParamsFn<ResourceState, Params, ParamsArgs> =\n | Omit<ResourceOptions<NoInfer<ResourceState>, Params>, 'params' | 'loader'> &\n (\n | {\n /**\n * A reactive function which determines the request to be made. Whenever the request changes, the\n * loader will be triggered to fetch a new value for the resource.\n *\n * If a request function isn't provided, the loader won't rerun unless the resource is reloaded.\n */\n params: () => Params;\n loader: (\n param: NoInfer<ResourceLoaderParams<Params>>\n ) => Promise<ResourceState>;\n method?: never;\n stream?: never;\n /**\n * Each the query load, the value will return undefined.\n * To avoid flickering display and also enable to the data to be retrieved from cache, use () => true\n * default value: false\n */\n preservePreviousValue?: () => boolean;\n }\n | {\n /**\n * Used to generate a method in the store, when called will trigger the resource loader/stream.\n *\n * Only support one parameter which can be an object to pass multiple parameters.\n */\n method: (args: ParamsArgs) => Params;\n loader: (\n param: NoInfer<ResourceLoaderParams<Params>>\n ) => Promise<ResourceState>;\n params?: never;\n stream?: never;\n preservePreviousValue?: () => boolean;\n }\n | {\n method?: never;\n loader?: never;\n params?: () => Params;\n /**\n * Loading function which returns a `Promise` of a signal of the resource's value for a given\n * request, which can change over time as new values are received from a stream.\n */\n stream: ResourceStreamingLoader<ResourceState, Params>;\n preservePreviousValue?: () => boolean;\n }\n | {\n method: ResourceMethod<ParamsArgs, Params>;\n loader?: never;\n params?: never;\n /**\n * Loading function which returns a `Promise` of a signal of the resource's value for a given\n * request, which can change over time as new values are received from a stream.\n */\n stream: ResourceStreamingLoader<ResourceState, Params>;\n preservePreviousValue?: () => boolean;\n }\n );\n"]}
@@ -0,0 +1,66 @@
1
+ import { ObjectDeepPath } from './object-deep-path-mapper.type';
2
+ import { AccessTypeObjectPropertyByDottedPath, DottedPathPathToTuple } from './access-type-object-property-by-dotted-path.type';
3
+ import { InternalType, MergeObjects } from './util.type';
4
+ import { ResourceByIdRef } from '../../resource-by-id';
5
+ import { MutationResourceByIdRefHelper, ResourceExceptionConstraints } from '../../query.core';
6
+ import { CraftResourceRef } from '../craft-resource-ref';
7
+ export type QueryAndMutationRecordConstraints = {
8
+ query: InternalType<unknown, unknown, unknown, unknown, boolean, unknown, unknown, unknown, ResourceExceptionConstraints>;
9
+ mutation: InternalType<unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, ResourceExceptionConstraints>;
10
+ };
11
+ export type CustomReloadOnSpecificMutationStatus<QueryAndMutationRecord extends QueryAndMutationRecordConstraints> = (data: MergeObjects<[
12
+ {
13
+ queryResource: CraftResourceRef<QueryAndMutationRecord['query']['state'], QueryAndMutationRecord['query']['params']>;
14
+ mutationResource: CraftResourceRef<QueryAndMutationRecord['mutation']['state'], QueryAndMutationRecord['mutation']['params']>;
15
+ mutationParams: NonNullable<QueryAndMutationRecord['mutation']['params']>;
16
+ },
17
+ QueryAndMutationRecord['query']['isGroupedResource'] extends true ? {
18
+ queryIdentifier: QueryAndMutationRecord['query']['groupIdentifier'];
19
+ queryResources: ResourceByIdRef<string, QueryAndMutationRecord['query']['state'], QueryAndMutationRecord['query']['params']>;
20
+ } : {},
21
+ QueryAndMutationRecord['mutation']['isGroupedResource'] extends true ? {
22
+ mutationIdentifier: QueryAndMutationRecord['mutation']['groupIdentifier'];
23
+ mutationResources: ResourceByIdRef<string, QueryAndMutationRecord['mutation']['state'], QueryAndMutationRecord['mutation']['params']>;
24
+ } : {}
25
+ ]>) => boolean;
26
+ export type ReloadQueriesConfig<QueryAndMutationRecord extends QueryAndMutationRecordConstraints> = false | {
27
+ onMutationException?: boolean | CustomReloadOnSpecificMutationStatus<QueryAndMutationRecord>;
28
+ onMutationResolved?: boolean | CustomReloadOnSpecificMutationStatus<QueryAndMutationRecord>;
29
+ onMutationLoading?: boolean | CustomReloadOnSpecificMutationStatus<QueryAndMutationRecord>;
30
+ };
31
+ export type PatchMutationQuery<QueryAndMutationRecord extends QueryAndMutationRecordConstraints> = QueryAndMutationRecord['query']['state'] extends object ? {
32
+ [queryPatchPath in ObjectDeepPath<QueryAndMutationRecord['query']['state']>]?: AccessTypeObjectPropertyByDottedPath<QueryAndMutationRecord['query']['state'], DottedPathPathToTuple<queryPatchPath>> extends infer TargetedType ? PatchQueryFn<QueryAndMutationRecord, TargetedType> : never;
33
+ } : never;
34
+ export type PatchQueryFn<QueryAndMutationRecord extends QueryAndMutationRecordConstraints, TargetedType> = (data: MergeObjects<[
35
+ {
36
+ queryResource: NoInfer<CraftResourceRef<QueryAndMutationRecord['query']['state'], QueryAndMutationRecord['query']['params']>>;
37
+ mutationResource: NoInfer<CraftResourceRef<QueryAndMutationRecord['mutation']['state'], QueryAndMutationRecord['mutation']['params']>>;
38
+ mutationParams: NonNullable<NoInfer<QueryAndMutationRecord['mutation']['params']>>;
39
+ targetedState: TargetedType | undefined;
40
+ },
41
+ QueryAndMutationRecord['query']['groupIdentifier'] extends string ? {
42
+ queryIdentifier: QueryAndMutationRecord['query']['groupIdentifier'];
43
+ queryResources: ResourceByIdRef<QueryAndMutationRecord['query']['groupIdentifier'], QueryAndMutationRecord['query']['state'], QueryAndMutationRecord['query']['params']>;
44
+ } : {},
45
+ QueryAndMutationRecord['mutation']['groupIdentifier'] extends string ? {
46
+ mutationIdentifier: QueryAndMutationRecord['mutation']['groupIdentifier'];
47
+ mutationResources: MutationResourceByIdRefHelper<QueryAndMutationRecord>;
48
+ } : {}
49
+ ]>) => TargetedType;
50
+ export type FilterQueryById<QueryAndMutationRecord extends QueryAndMutationRecordConstraints> = (data: MergeObjects<[
51
+ {
52
+ queryResource: CraftResourceRef<QueryAndMutationRecord['query']['state'], QueryAndMutationRecord['query']['params']>;
53
+ mutationResource: CraftResourceRef<NoInfer<QueryAndMutationRecord['mutation']['state']>, NoInfer<QueryAndMutationRecord['mutation']['params']>>;
54
+ mutationParams: NonNullable<NoInfer<QueryAndMutationRecord['mutation']['params']>>;
55
+ },
56
+ QueryAndMutationRecord['query']['groupIdentifier'] extends string ? {
57
+ queryIdentifier: QueryAndMutationRecord['query']['groupIdentifier'];
58
+ queryResources: ResourceByIdRef<QueryAndMutationRecord['query']['groupIdentifier'], QueryAndMutationRecord['query']['state'], QueryAndMutationRecord['query']['params']>;
59
+ } : {},
60
+ QueryAndMutationRecord['mutation']['groupIdentifier'] extends string ? {
61
+ mutationIdentifier: QueryAndMutationRecord['mutation']['groupIdentifier'];
62
+ mutationResources: ResourceByIdRef<QueryAndMutationRecord['mutation']['groupIdentifier'], QueryAndMutationRecord['mutation']['state'], QueryAndMutationRecord['mutation']['params']>;
63
+ } : {}
64
+ ]>) => boolean;
65
+ export type ResourceMethod<ParamsArgs, ResourceParams> = (args: ParamsArgs) => ResourceParams;
66
+ //# sourceMappingURL=shared.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.type.d.ts","sourceRoot":"","sources":["../../../../../../../libs/core/src/lib/util/types/shared.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EACL,oCAAoC,EACpC,qBAAqB,EACtB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,EAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,MAAM,MAAM,iCAAiC,GAAG;IAC9C,KAAK,EAAE,YAAY,CACjB,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,4BAA4B,CAC7B,CAAC;IACF,QAAQ,EAAE,YAAY,CACpB,OAAO,EACP,OAAO,EACP,OAA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ACE,eAAe,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,CAAC;QACpE,cAAc,EAAE,eAAe,CAC7B,sBAAsB,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,EAClD,sBAAsB,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EACxC,sBAAsB,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAC1C,CAAC;KACH,GACD,EAAE;IACN,sBAAsB,CAAC,UAAU,CAAC,CAAC,iBAAiB,CAAC,SAAS,MAAM,GAChE;QACE,kBAAkB,EAAE,sBAAsB,CAAC,UAAU,CAAC,CAAC,iBAAiB,CAAC,CAAC;QAC1E,iBAAiB,EAAE,eAAe,CAChC,sBAAsB,CAAC,UAAU,CAAC,CAAC,iBAAiB,CAAC,EACrD,sBAAsB,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,EAC3C,sBAAsB,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAC7C,CAAC;KACH,GACD,EAAE;CACP,CACF,KACE,OAAO,CAAC;AAEb,MAAM,MAAM,cAAc,CAAC,UAAU,EAAE,cAAc,IAAI,CACvD,IAAI,EAAE,UAAU,KACb,cAAc,CAAC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=shared.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.type.js","sourceRoot":"","sources":["../../../../../../../libs/core/src/lib/util/types/shared.type.ts"],"names":[],"mappings":"","sourcesContent":["import { ObjectDeepPath } from './object-deep-path-mapper.type';\nimport {\n AccessTypeObjectPropertyByDottedPath,\n DottedPathPathToTuple,\n} from './access-type-object-property-by-dotted-path.type';\nimport { InternalType, MergeObjects } from './util.type';\nimport { ResourceByIdRef } from '../../resource-by-id';\nimport {\n MutationResourceByIdRefHelper,\n ResourceExceptionConstraints,\n} from '../../query.core';\nimport { CraftResourceRef } from '../craft-resource-ref';\n\n// todo rename, and rename server state constraints\nexport type QueryAndMutationRecordConstraints = {\n query: InternalType<\n unknown,\n unknown,\n unknown,\n unknown,\n boolean,\n unknown,\n unknown,\n unknown,\n ResourceExceptionConstraints\n >;\n mutation: InternalType<\n unknown,\n unknown,\n unknown,\n unknown,\n unknown,\n unknown,\n unknown,\n unknown,\n ResourceExceptionConstraints\n >;\n};\n\nexport type CustomReloadOnSpecificMutationStatus<\n QueryAndMutationRecord extends QueryAndMutationRecordConstraints,\n> = (\n data: MergeObjects<\n [\n {\n queryResource: CraftResourceRef<\n QueryAndMutationRecord['query']['state'],\n QueryAndMutationRecord['query']['params']\n >;\n mutationResource: CraftResourceRef<\n QueryAndMutationRecord['mutation']['state'],\n QueryAndMutationRecord['mutation']['params']\n >;\n mutationParams: NonNullable<\n QueryAndMutationRecord['mutation']['params']\n >;\n },\n QueryAndMutationRecord['query']['isGroupedResource'] extends true\n ? {\n queryIdentifier: QueryAndMutationRecord['query']['groupIdentifier'];\n queryResources: ResourceByIdRef<\n string,\n QueryAndMutationRecord['query']['state'],\n QueryAndMutationRecord['query']['params']\n >;\n }\n : {},\n QueryAndMutationRecord['mutation']['isGroupedResource'] extends true\n ? {\n mutationIdentifier: QueryAndMutationRecord['mutation']['groupIdentifier'];\n mutationResources: ResourceByIdRef<\n string,\n QueryAndMutationRecord['mutation']['state'],\n QueryAndMutationRecord['mutation']['params']\n >;\n }\n : {},\n ]\n >,\n) => boolean;\n\nexport type ReloadQueriesConfig<\n QueryAndMutationRecord extends QueryAndMutationRecordConstraints,\n> =\n | false\n | {\n onMutationException?:\n | boolean\n | CustomReloadOnSpecificMutationStatus<QueryAndMutationRecord>;\n onMutationResolved?:\n | boolean\n | CustomReloadOnSpecificMutationStatus<QueryAndMutationRecord>;\n onMutationLoading?:\n | boolean\n | CustomReloadOnSpecificMutationStatus<QueryAndMutationRecord>;\n };\n\nexport type PatchMutationQuery<\n QueryAndMutationRecord extends QueryAndMutationRecordConstraints,\n> = QueryAndMutationRecord['query']['state'] extends object\n ? {\n [queryPatchPath in ObjectDeepPath<\n QueryAndMutationRecord['query']['state']\n >]?: AccessTypeObjectPropertyByDottedPath<\n QueryAndMutationRecord['query']['state'],\n DottedPathPathToTuple<queryPatchPath>\n > extends infer TargetedType\n ? PatchQueryFn<QueryAndMutationRecord, TargetedType>\n : never;\n }\n : never;\n\nexport type PatchQueryFn<\n QueryAndMutationRecord extends QueryAndMutationRecordConstraints,\n TargetedType,\n> = (\n data: MergeObjects<\n [\n {\n queryResource: NoInfer<\n CraftResourceRef<\n QueryAndMutationRecord['query']['state'],\n QueryAndMutationRecord['query']['params']\n >\n >;\n mutationResource: NoInfer<\n CraftResourceRef<\n QueryAndMutationRecord['mutation']['state'],\n QueryAndMutationRecord['mutation']['params']\n >\n >;\n mutationParams: NonNullable<\n NoInfer<QueryAndMutationRecord['mutation']['params']>\n >;\n targetedState: TargetedType | undefined;\n },\n QueryAndMutationRecord['query']['groupIdentifier'] extends string\n ? {\n queryIdentifier: QueryAndMutationRecord['query']['groupIdentifier'];\n queryResources: ResourceByIdRef<\n QueryAndMutationRecord['query']['groupIdentifier'],\n QueryAndMutationRecord['query']['state'],\n QueryAndMutationRecord['query']['params']\n >;\n }\n : {},\n QueryAndMutationRecord['mutation']['groupIdentifier'] extends string\n ? {\n mutationIdentifier: QueryAndMutationRecord['mutation']['groupIdentifier'];\n mutationResources: MutationResourceByIdRefHelper<QueryAndMutationRecord>;\n }\n : {},\n ]\n >,\n) => TargetedType;\n\nexport type FilterQueryById<\n QueryAndMutationRecord extends QueryAndMutationRecordConstraints,\n> = (\n data: MergeObjects<\n [\n {\n queryResource: CraftResourceRef<\n QueryAndMutationRecord['query']['state'],\n QueryAndMutationRecord['query']['params']\n >;\n mutationResource: CraftResourceRef<\n NoInfer<QueryAndMutationRecord['mutation']['state']>,\n NoInfer<QueryAndMutationRecord['mutation']['params']>\n >;\n mutationParams: NonNullable<\n NoInfer<QueryAndMutationRecord['mutation']['params']>\n >;\n },\n QueryAndMutationRecord['query']['groupIdentifier'] extends string\n ? {\n queryIdentifier: QueryAndMutationRecord['query']['groupIdentifier'];\n queryResources: ResourceByIdRef<\n QueryAndMutationRecord['query']['groupIdentifier'],\n QueryAndMutationRecord['query']['state'],\n QueryAndMutationRecord['query']['params']\n >;\n }\n : {},\n QueryAndMutationRecord['mutation']['groupIdentifier'] extends string\n ? {\n mutationIdentifier: QueryAndMutationRecord['mutation']['groupIdentifier'];\n mutationResources: ResourceByIdRef<\n QueryAndMutationRecord['mutation']['groupIdentifier'],\n QueryAndMutationRecord['mutation']['state'],\n QueryAndMutationRecord['mutation']['params']\n >;\n }\n : {},\n ]\n >,\n) => boolean;\n\nexport type ResourceMethod<ParamsArgs, ResourceParams> = (\n args: ParamsArgs,\n) => ResourceParams;\n"]}
@@ -0,0 +1,16 @@
1
+ import { EffectCleanupRegisterFn, EffectRef, InjectionToken, Injector } from '../../host/craft-compat';
2
+ import { ExplicitEffectValues } from '../explicit-effect';
3
+ export declare const DYNAMIC_EFFECT_REF_INSTANCE_TOKEN: InjectionToken<EffectRef>;
4
+ export declare function nestedEffect<T, R, GroupIdentifier extends string>(parentInjector: Injector, effectFn: (onCleanup: EffectCleanupRegisterFn) => void): EffectRef;
5
+ /**
6
+ * A {@link nestedEffect} that can stop itself from inside its own body.
7
+ *
8
+ * Effects run their first pass synchronously, so the body cannot close over the
9
+ * `EffectRef` the call is about to return — reaching for it during that first
10
+ * pass is a temporal-dead-zone error. The body is handed a `stop` callback
11
+ * instead, and a stop requested before the ref exists is honoured as soon as it
12
+ * does.
13
+ */
14
+ export declare function selfStoppingNestedEffect(parentInjector: Injector, effectFn: (stop: () => void, onCleanup: EffectCleanupRegisterFn) => void): EffectRef;
15
+ export declare function explicitNestedEffect<T, R, GroupIdentifier extends string, Input extends readonly unknown[], Params = Input>(parentInjector: Injector, deps: readonly [...ExplicitEffectValues<Input>], fn: (deps: Params, onCleanup: EffectCleanupRegisterFn) => void): EffectRef;
16
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../../../../libs/core/src/lib/util/types/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,uBAAuB,EACvB,SAAS,EACT,cAAc,EACd,QAAQ,EACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAkB,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1E,eAAO,MAAM,iCAAiC,2BAE7C,CAAC;AAEF,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,eAAe,SAAS,MAAM,EAC/D,cAAc,EAAE,QAAQ,EACxB,QAAQ,EAAE,CAAC,SAAS,EAAE,uBAAuB,KAAK,IAAI,aAiBvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,cAAc,EAAE,QAAQ,EACxB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,IAAI,EAAE,SAAS,EAAE,uBAAuB,KAAK,IAAI,GACvE,SAAS,CAYX;AAED,wBAAgB,oBAAoB,CAClC,CAAC,EACD,CAAC,EACD,eAAe,SAAS,MAAM,EAC9B,KAAK,SAAS,SAAS,OAAO,EAAE,EAChC,MAAM,GAAG,KAAK,EAEd,cAAc,EAAE,QAAQ,EACxB,IAAI,EAAE,SAAS,CAAC,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC,EAC/C,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,uBAAuB,KAAK,IAAI,aAiB/D"}
@@ -0,0 +1,60 @@
1
+ import { effect, InjectionToken, Injector, } from '../../host/craft-compat';
2
+ import { explicitEffect } from '../explicit-effect';
3
+ export const DYNAMIC_EFFECT_REF_INSTANCE_TOKEN = new InjectionToken('Injection token used to provide a dynamically created effectRef instance.');
4
+ export function nestedEffect(parentInjector, effectFn) {
5
+ const injector = Injector.create({
6
+ providers: [
7
+ {
8
+ provide: DYNAMIC_EFFECT_REF_INSTANCE_TOKEN,
9
+ useFactory: () => {
10
+ return effect(effectFn, {
11
+ injector: parentInjector,
12
+ });
13
+ },
14
+ },
15
+ ],
16
+ parent: parentInjector,
17
+ });
18
+ const effectRef = injector.get(DYNAMIC_EFFECT_REF_INSTANCE_TOKEN);
19
+ return effectRef;
20
+ }
21
+ /**
22
+ * A {@link nestedEffect} that can stop itself from inside its own body.
23
+ *
24
+ * Effects run their first pass synchronously, so the body cannot close over the
25
+ * `EffectRef` the call is about to return — reaching for it during that first
26
+ * pass is a temporal-dead-zone error. The body is handed a `stop` callback
27
+ * instead, and a stop requested before the ref exists is honoured as soon as it
28
+ * does.
29
+ */
30
+ export function selfStoppingNestedEffect(parentInjector, effectFn) {
31
+ let ref;
32
+ let stopped = false;
33
+ const stop = () => {
34
+ stopped = true;
35
+ ref?.destroy();
36
+ };
37
+ ref = nestedEffect(parentInjector, (onCleanup) => effectFn(stop, onCleanup));
38
+ if (stopped) {
39
+ ref.destroy();
40
+ }
41
+ return ref;
42
+ }
43
+ export function explicitNestedEffect(parentInjector, deps, fn) {
44
+ const injector = Injector.create({
45
+ providers: [
46
+ {
47
+ provide: DYNAMIC_EFFECT_REF_INSTANCE_TOKEN,
48
+ useFactory: () => {
49
+ return explicitEffect(deps, fn, {
50
+ injector: parentInjector,
51
+ });
52
+ },
53
+ },
54
+ ],
55
+ parent: parentInjector,
56
+ });
57
+ const effectRef = injector.get(DYNAMIC_EFFECT_REF_INSTANCE_TOKEN);
58
+ return effectRef;
59
+ }
60
+ //# sourceMappingURL=util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../../../../libs/core/src/lib/util/types/util.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EAGN,cAAc,EACd,QAAQ,GACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAwB,MAAM,oBAAoB,CAAC;AAE1E,MAAM,CAAC,MAAM,iCAAiC,GAAG,IAAI,cAAc,CACjE,2EAA2E,CAC5E,CAAC;AAEF,MAAM,UAAU,YAAY,CAC1B,cAAwB,EACx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C,CAAC;IACH,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;IAClE,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import {\n effect,\n EffectCleanupRegisterFn,\n EffectRef,\n InjectionToken,\n Injector,\n} from '../../host/craft-compat';\nimport { explicitEffect, ExplicitEffectValues } from '../explicit-effect';\n\nexport const DYNAMIC_EFFECT_REF_INSTANCE_TOKEN = new InjectionToken<EffectRef>(\n 'Injection token used to provide a dynamically created effectRef instance.',\n);\n\nexport function nestedEffect<T, R, GroupIdentifier extends string>(\n parentInjector: Injector,\n effectFn: (onCleanup: EffectCleanupRegisterFn) => void,\n) {\n const injector = Injector.create({\n providers: [\n {\n provide: DYNAMIC_EFFECT_REF_INSTANCE_TOKEN,\n useFactory: () => {\n return effect(effectFn, {\n injector: parentInjector,\n });\n },\n },\n ],\n parent: parentInjector,\n });\n const effectRef = injector.get(DYNAMIC_EFFECT_REF_INSTANCE_TOKEN);\n return effectRef;\n}\n\n/**\n * A {@link nestedEffect} that can stop itself from inside its own body.\n *\n * Effects run their first pass synchronously, so the body cannot close over the\n * `EffectRef` the call is about to return — reaching for it during that first\n * pass is a temporal-dead-zone error. The body is handed a `stop` callback\n * instead, and a stop requested before the ref exists is honoured as soon as it\n * does.\n */\nexport function selfStoppingNestedEffect(\n parentInjector: Injector,\n effectFn: (stop: () => void, onCleanup: EffectCleanupRegisterFn) => void,\n): EffectRef {\n let ref: EffectRef | undefined;\n let stopped = false;\n const stop = () => {\n stopped = true;\n ref?.destroy();\n };\n ref = nestedEffect(parentInjector, (onCleanup) => effectFn(stop, onCleanup));\n if (stopped) {\n ref.destroy();\n }\n return ref;\n}\n\nexport function explicitNestedEffect<\n T,\n R,\n GroupIdentifier extends string,\n Input extends readonly unknown[],\n Params = Input,\n>(\n parentInjector: Injector,\n deps: readonly [...ExplicitEffectValues<Input>],\n fn: (deps: Params, onCleanup: EffectCleanupRegisterFn) => void,\n) {\n const injector = Injector.create({\n providers: [\n {\n provide: DYNAMIC_EFFECT_REF_INSTANCE_TOKEN,\n useFactory: () => {\n return explicitEffect(deps, fn, {\n injector: parentInjector,\n });\n },\n },\n ],\n parent: parentInjector,\n });\n const effectRef = injector.get(DYNAMIC_EFFECT_REF_INSTANCE_TOKEN);\n return effectRef;\n}\n"]}
@@ -0,0 +1,67 @@
1
+ import { Type } from '../../host/craft-compat';
2
+ import { Prettify } from '../util.type';
3
+ import { ResourceExceptionConstraints } from '../../query.core';
4
+ export type MakeOptionalPropertiesRequired<T, K extends keyof T = keyof T> = T & {
5
+ [P in K]-?: T[P];
6
+ };
7
+ export type MergeObject<A, B> = A & B;
8
+ export type MergeObjects<F extends unknown[], Acc = {}> = F extends [
9
+ infer First,
10
+ ...infer Rest
11
+ ] ? First extends object ? MergeObjects<Rest, MergeObject<Acc, First>> : Prettify<Acc> : Prettify<Acc>;
12
+ export type InternalType<State, Params, Args, IsGroupedResource, IsMethod, Insertions, GroupIdentifier, SourceParams, Exceptions extends ResourceExceptionConstraints> = {
13
+ state: State;
14
+ params: Params;
15
+ args: Args;
16
+ isGroupedResource: IsGroupedResource;
17
+ groupIdentifier: GroupIdentifier;
18
+ isMethod?: IsMethod;
19
+ insertions?: Insertions;
20
+ sourceParams?: SourceParams;
21
+ exceptions: Exceptions;
22
+ };
23
+ /**
24
+ * trick to combine multiple unions of objects into a single object
25
+ * only works with objects not primitives
26
+ * @param union - Union of objects
27
+ * @returns Intersection of objects
28
+ */
29
+ export type UnionToIntersection<union> = (union extends any ? (k: union) => void : never) extends (k: infer intersection) => void ? intersection : never;
30
+ /**
31
+ * get last element of union
32
+ * @param Union - Union of any types
33
+ * @returns Last element of union
34
+ */
35
+ type GetUnionLast<Union> = UnionToIntersection<Union extends any ? () => Union : never> extends () => infer Last ? Last : never;
36
+ /**
37
+ * Convert union to tuple
38
+ * @param Union - Union of any types, can be union of complex, composed or primitive types
39
+ * @returns Tuple of each elements in the union
40
+ */
41
+ export type UnionToTuple<Union, Tuple extends unknown[] = []> = [
42
+ Union
43
+ ] extends [never] ? Tuple : UnionToTuple<Exclude<Union, GetUnionLast<Union>>, [
44
+ GetUnionLast<Union>,
45
+ ...Tuple
46
+ ]>;
47
+ export type HasChild<T> = T extends any[] ? false : T extends object ? true : false;
48
+ /**
49
+ * Negates a boolean type.
50
+ */
51
+ export type Not<T extends boolean> = T extends true ? false : true;
52
+ /**
53
+ * @internal
54
+ */
55
+ declare const secret: unique symbol;
56
+ /**
57
+ * @internal
58
+ */
59
+ type Secret = typeof secret;
60
+ /**
61
+ * Checks if the given type is `never`.
62
+ */
63
+ export type IsNever<T> = [T] extends [never] ? true : false;
64
+ export type IsAny<T> = [T] extends [Secret] ? Not<IsNever<T>> : false;
65
+ export type InferInjectedType<T extends Type<unknown>> = T extends Type<infer U> ? U : never;
66
+ export {};
67
+ //# sourceMappingURL=util.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.type.d.ts","sourceRoot":"","sources":["../../../../../../../libs/core/src/lib/util/types/util.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAGhE,MAAM,MAAM,8BAA8B,CACxC,CAAC,EACD,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,CAAC,IACzB,CAAC,GAAG;KACL,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEtC,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,OAAO,EAAE,EAAE,GAAG,GAAG,EAAE,IAAI,CAAC,SAAS;IAClE,MAAM,KAAK;IACX,GAAG,MAAM,IAAI;CACd,GACG,KAAK,S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;IAAC,YAAY,CAAC,KAAK,CAAC;IAAE,GAAG,KAAK;CAAC,CAChC,CAAC;AAEN,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,EAAE,GACrC,KAAK,GACL,CAAC,SAAS,MAAM,GACd,IAAI,GACJ,KAAK,CAAC;AAEZ;;GAEG;AACH,MAAM,MAAM,GAAG,CAAC,CAAC,SAAS,OAAO,IAAI,CAAC,SAAS,IAAI,GAAG,KAAK,GAAG,IAAI,CAAC;AAEnE;;GAEG;AACH,QAAA,MAAM,MAAM,eAAmB,CAAC;AAEhC;;GAEG;AACH,KAAK,MAAM,GAAG,OAAO,MAAM,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;AAE5D,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;AAEtE,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,IACnD,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @internal
3
+ */
4
+ const secret = Symbol('secret');
5
+ //# sourceMappingURL=util.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.type.js","sourceRoot":"","sources":["../../../../../../../libs/core/src/lib/util/types/util.type.ts"],"names":[],"mappings":"AA+FA;;GAEG;AACH,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["import { Type } from '../../host/craft-compat';\nimport { Prettify } from '../util.type';\nimport { ResourceExceptionConstraints } from '../../query.core';\n\n// It is not possible to get all the properties key of an optional object, so make the optional properties required\nexport type MakeOptionalPropertiesRequired<\n T,\n K extends keyof T = keyof T,\n> = T & {\n [P in K]-?: T[P];\n};\n\nexport type MergeObject<A, B> = A & B;\n\nexport type MergeObjects<F extends unknown[], Acc = {}> = F extends [\n infer First,\n ...infer Rest,\n]\n ? First extends object\n ? MergeObjects<Rest, MergeObject<Acc, First>>\n : Prettify<Acc>\n : Prettify<Acc>;\n\nexport type InternalType<\n State,\n Params,\n Args,\n IsGroupedResource,\n IsMethod,\n Insertions,\n GroupIdentifier,\n SourceParams,\n Exceptions extends ResourceExceptionConstraints,\n> = {\n state: State;\n params: Params;\n args: Args;\n isGroupedResource: IsGroupedResource;\n groupIdentifier: GroupIdentifier;\n isMethod?: IsMethod;\n insertions?: Insertions;\n sourceParams?: SourceParams;\n exceptions: Exceptions;\n};\n\n// from https://github.com/ecyrbe/zodios/blob/main/src/utils.types.ts\n/**\n * trick to combine multiple unions of objects into a single object\n * only works with objects not primitives\n * @param union - Union of objects\n * @returns Intersection of objects\n */\nexport type UnionToIntersection<union> = (\n union extends any ? (k: union) => void : never\n) extends (k: infer intersection) => void\n ? intersection\n : never;\n\n/**\n * get last element of union\n * @param Union - Union of any types\n * @returns Last element of union\n */\ntype GetUnionLast<Union> =\n UnionToIntersection<\n Union extends any ? () => Union : never\n > extends () => infer Last\n ? Last\n : never;\n\n/**\n * Convert union to tuple\n * @param Union - Union of any types, can be union of complex, composed or primitive types\n * @returns Tuple of each elements in the union\n */\nexport type UnionToTuple<Union, Tuple extends unknown[] = []> = [\n Union,\n] extends [never]\n ? Tuple\n : UnionToTuple<\n Exclude<Union, GetUnionLast<Union>>,\n [GetUnionLast<Union>, ...Tuple]\n >;\n\nexport type HasChild<T> = T extends any[]\n ? false\n : T extends object\n ? true\n : false;\n\n/**\n * Negates a boolean type.\n */\nexport type Not<T extends boolean> = T extends true ? false : true;\n\n/**\n * @internal\n */\nconst secret = Symbol('secret');\n\n/**\n * @internal\n */\ntype Secret = typeof secret;\n\n/**\n * Checks if the given type is `never`.\n */\nexport type IsNever<T> = [T] extends [never] ? true : false;\n\nexport type IsAny<T> = [T] extends [Secret] ? Not<IsNever<T>> : false;\n\nexport type InferInjectedType<T extends Type<unknown>> =\n T extends Type<infer U> ? U : never;\n"]}
@@ -0,0 +1,10 @@
1
+ export declare function createNestedStateUpdate({ state, keysPath, value, }: {
2
+ state: any;
3
+ keysPath: string[];
4
+ value: any;
5
+ }): any;
6
+ export declare function getNestedStateValue({ state, keysPath, }: {
7
+ state: any;
8
+ keysPath: string[];
9
+ }): any;
10
+ //# sourceMappingURL=update-state.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-state.util.d.ts","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/util/update-state.util.ts"],"names":[],"mappings":"AACA,wBAAgB,uBAAuB,CAAC,EACtC,KAAK,EACL,QAAQ,EACR,KAAK,GACN,EAAE;IACD,KAAK,EAAE,GAAG,CAAC;IACX,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,EAAE,GAAG,CAAC;CACZ,GAAG,GAAG,CAuBN;AACD,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,GAAG,CAAC;IACX,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,GAAG,GAAG,CAON"}
@@ -0,0 +1,31 @@
1
+ // todo handle update of array of objects
2
+ export function createNestedStateUpdate({ state, keysPath, value, }) {
3
+ if (keysPath.length === 0) {
4
+ return value;
5
+ }
6
+ const [currentKey, ...remainingKeys] = keysPath;
7
+ const currentState = state[currentKey] || {};
8
+ return {
9
+ ...state,
10
+ [currentKey]: remainingKeys.length === 0
11
+ ? Array.isArray(currentState)
12
+ ? value
13
+ : typeof value === 'object' && value !== null && !Array.isArray(value)
14
+ ? { ...currentState, ...value }
15
+ : value
16
+ : createNestedStateUpdate({
17
+ state: currentState,
18
+ keysPath: remainingKeys,
19
+ value,
20
+ }),
21
+ };
22
+ }
23
+ export function getNestedStateValue({ state, keysPath, }) {
24
+ return keysPath.reduce((currentState, key) => {
25
+ if (currentState && typeof currentState === 'object') {
26
+ return currentState[key];
27
+ }
28
+ return undefined;
29
+ }, state);
30
+ }
31
+ //# sourceMappingURL=update-state.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-state.util.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/util/update-state.util.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,MAAM,UAAU,uBAAuB,CAAC,EACtC,KAAK,EACL,QAAQ,EACR,KAAK,GAKN;IACC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,CAAC,UAAU,EAAE,GAAG,aAAa,CAAC,GAAG,QAAQ,CAAC;IAChD,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;IAE7C,OAAO;QACL,GAAG,KAAK;QACR,CAAC,UAAU,CAAC,EACV,aAAa,CAAC,MAAM,KAAK,CAAC;YACxB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC;gBAC3B,CAAC,CAAC,KAAK;gBACP,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;oBACtE,CAAC,CAAC,EAAE,GAAG,YAAY,EAAE,GAAG,KAAK,EAAE;oBAC/B,CAAC,CAAC,KAAK;YACT,CAAC,CAAC,uBAAuB,CAAC;gBACtB,KAAK,EAAE,YAAY;gBACnB,QAAQ,EAAE,aAAa;gBACvB,KAAK;aACN,CAAC;KACT,CAAC;AACJ,CAAC;AACD,MAAM,UAAU,mBAAmB,CAAC,EAClC,KAAK,EACL,QAAQ,GAIT;IACC,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,YAAY,EAAE,GAAG,EAAE,EAAE;QAC3C,IAAI,YAAY,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;YACrD,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC,EAAE,KAAK,CAAC,CAAC;AACZ,CAAC","sourcesContent":["// todo handle update of array of objects\nexport function createNestedStateUpdate({\n state,\n keysPath,\n value,\n}: {\n state: any;\n keysPath: string[];\n value: any;\n}): any {\n if (keysPath.length === 0) {\n return value;\n }\n\n const [currentKey, ...remainingKeys] = keysPath;\n const currentState = state[currentKey] || {};\n\n return {\n ...state,\n [currentKey]:\n remainingKeys.length === 0\n ? Array.isArray(currentState)\n ? value\n : typeof value === 'object' && value !== null && !Array.isArray(value)\n ? { ...currentState, ...value }\n : value\n : createNestedStateUpdate({\n state: currentState,\n keysPath: remainingKeys,\n value,\n }),\n };\n}\nexport function getNestedStateValue({\n state,\n keysPath,\n}: {\n state: any;\n keysPath: string[];\n}): any {\n return keysPath.reduce((currentState, key) => {\n if (currentState && typeof currentState === 'object') {\n return currentState[key];\n }\n return undefined;\n }, state);\n}\n"]}
@@ -0,0 +1,19 @@
1
+ import { WritableSignal } from '../host/craft-compat';
2
+ import { ReadonlySource } from './source.type';
3
+ export declare const SourceBrand: unique symbol;
4
+ export declare const SourceBranded: {
5
+ [SourceBrand]: true;
6
+ };
7
+ export type SourceBranded = {
8
+ [SourceBrand]: true;
9
+ };
10
+ /**
11
+ * Works for Source and ReadonlySource
12
+ */
13
+ export declare function isSource(value: any): boolean;
14
+ export type SourceBrand = typeof SourceBrand;
15
+ export declare function capitalize<S extends string>(str: S): Capitalize<S>;
16
+ export declare function createMethodHandlers<State>(methodsData: Record<string, ((...args: any[]) => NoInfer<State>) | ReadonlySource<State>> | undefined, state: WritableSignal<State>, options?: {
17
+ onStateChange?: (newValue: State) => void;
18
+ }): Record<string, Function>;
19
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/util/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,eAAO,MAAM,WAAW,eAAwB,CAAC;AAEjD,eAAO,MAAM,aAAa;;CAEzB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAK5C;AAED,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC;AAE7C,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAElE;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EACxC,WAAW,EACP,MAAM,CACJ,MAAM,EACN,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,CAC7D,GACD,SAAS,EACb,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,EAC5B,OAAO,CAAC,EAAE;IACR,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,KAAK,IAAI,CAAC;CAC3C,4BA+CF"}