@milaboratories/pl-middle-layer 1.46.20 → 1.46.22

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 (402) hide show
  1. package/dist/block_registry/index.d.ts +3 -3
  2. package/dist/block_registry/registry-v2-provider.cjs.map +1 -1
  3. package/dist/block_registry/registry-v2-provider.d.ts +2 -2
  4. package/dist/block_registry/registry-v2-provider.js.map +1 -1
  5. package/dist/block_registry/registry.cjs +54 -53
  6. package/dist/block_registry/registry.cjs.map +1 -1
  7. package/dist/block_registry/registry.d.ts +4 -4
  8. package/dist/block_registry/registry.d.ts.map +1 -1
  9. package/dist/block_registry/registry.js +54 -53
  10. package/dist/block_registry/registry.js.map +1 -1
  11. package/dist/block_registry/watcher.cjs +12 -12
  12. package/dist/block_registry/watcher.cjs.map +1 -1
  13. package/dist/block_registry/watcher.d.ts +6 -6
  14. package/dist/block_registry/watcher.d.ts.map +1 -1
  15. package/dist/block_registry/watcher.js +12 -12
  16. package/dist/block_registry/watcher.js.map +1 -1
  17. package/dist/block_registry/well_known_registries.cjs +6 -6
  18. package/dist/block_registry/well_known_registries.cjs.map +1 -1
  19. package/dist/block_registry/well_known_registries.d.ts +1 -1
  20. package/dist/block_registry/well_known_registries.js +6 -6
  21. package/dist/block_registry/well_known_registries.js.map +1 -1
  22. package/dist/cfg_render/executor.cjs +11 -11
  23. package/dist/cfg_render/executor.cjs.map +1 -1
  24. package/dist/cfg_render/executor.d.ts +5 -5
  25. package/dist/cfg_render/executor.js +11 -11
  26. package/dist/cfg_render/executor.js.map +1 -1
  27. package/dist/cfg_render/operation.d.ts +5 -5
  28. package/dist/cfg_render/renderer.cjs +74 -75
  29. package/dist/cfg_render/renderer.cjs.map +1 -1
  30. package/dist/cfg_render/renderer.d.ts +2 -2
  31. package/dist/cfg_render/renderer.d.ts.map +1 -1
  32. package/dist/cfg_render/renderer.js +74 -75
  33. package/dist/cfg_render/renderer.js.map +1 -1
  34. package/dist/cfg_render/traverse.cjs +27 -27
  35. package/dist/cfg_render/traverse.cjs.map +1 -1
  36. package/dist/cfg_render/traverse.d.ts +1 -1
  37. package/dist/cfg_render/traverse.js +27 -27
  38. package/dist/cfg_render/traverse.js.map +1 -1
  39. package/dist/cfg_render/util.cjs +1 -1
  40. package/dist/cfg_render/util.cjs.map +1 -1
  41. package/dist/cfg_render/util.d.ts +1 -1
  42. package/dist/cfg_render/util.js +1 -1
  43. package/dist/cfg_render/util.js.map +1 -1
  44. package/dist/debug/index.cjs +4 -2
  45. package/dist/debug/index.cjs.map +1 -1
  46. package/dist/debug/index.d.ts +2 -2
  47. package/dist/debug/index.d.ts.map +1 -1
  48. package/dist/debug/index.js +4 -2
  49. package/dist/debug/index.js.map +1 -1
  50. package/dist/dev_env/index.cjs +8 -8
  51. package/dist/dev_env/index.cjs.map +1 -1
  52. package/dist/dev_env/index.js +8 -8
  53. package/dist/dev_env/index.js.map +1 -1
  54. package/dist/dev_env/util.cjs +1 -1
  55. package/dist/dev_env/util.cjs.map +1 -1
  56. package/dist/dev_env/util.d.ts +1 -1
  57. package/dist/dev_env/util.js +1 -1
  58. package/dist/dev_env/util.js.map +1 -1
  59. package/dist/index.d.ts +16 -16
  60. package/dist/js_render/computable_context.cjs +78 -78
  61. package/dist/js_render/computable_context.cjs.map +1 -1
  62. package/dist/js_render/computable_context.d.ts +9 -9
  63. package/dist/js_render/computable_context.d.ts.map +1 -1
  64. package/dist/js_render/computable_context.js +78 -78
  65. package/dist/js_render/computable_context.js.map +1 -1
  66. package/dist/js_render/context.cjs +33 -27
  67. package/dist/js_render/context.cjs.map +1 -1
  68. package/dist/js_render/context.d.ts +7 -7
  69. package/dist/js_render/context.d.ts.map +1 -1
  70. package/dist/js_render/context.js +33 -27
  71. package/dist/js_render/context.js.map +1 -1
  72. package/dist/js_render/index.cjs +10 -6
  73. package/dist/js_render/index.cjs.map +1 -1
  74. package/dist/js_render/index.d.ts +6 -6
  75. package/dist/js_render/index.d.ts.map +1 -1
  76. package/dist/js_render/index.js +10 -6
  77. package/dist/js_render/index.js.map +1 -1
  78. package/dist/middle_layer/active_cfg.cjs.map +1 -1
  79. package/dist/middle_layer/active_cfg.d.ts +3 -3
  80. package/dist/middle_layer/active_cfg.d.ts.map +1 -1
  81. package/dist/middle_layer/active_cfg.js.map +1 -1
  82. package/dist/middle_layer/block.cjs +1 -1
  83. package/dist/middle_layer/block.cjs.map +1 -1
  84. package/dist/middle_layer/block.d.ts +6 -6
  85. package/dist/middle_layer/block.d.ts.map +1 -1
  86. package/dist/middle_layer/block.js +1 -1
  87. package/dist/middle_layer/block.js.map +1 -1
  88. package/dist/middle_layer/block_ctx.cjs +9 -9
  89. package/dist/middle_layer/block_ctx.cjs.map +1 -1
  90. package/dist/middle_layer/block_ctx.d.ts +6 -6
  91. package/dist/middle_layer/block_ctx.d.ts.map +1 -1
  92. package/dist/middle_layer/block_ctx.js +9 -9
  93. package/dist/middle_layer/block_ctx.js.map +1 -1
  94. package/dist/middle_layer/block_ctx_unsafe.cjs +1 -1
  95. package/dist/middle_layer/block_ctx_unsafe.cjs.map +1 -1
  96. package/dist/middle_layer/block_ctx_unsafe.d.ts +5 -5
  97. package/dist/middle_layer/block_ctx_unsafe.js +1 -1
  98. package/dist/middle_layer/block_ctx_unsafe.js.map +1 -1
  99. package/dist/middle_layer/driver_kit.cjs +1 -2
  100. package/dist/middle_layer/driver_kit.cjs.map +1 -1
  101. package/dist/middle_layer/driver_kit.d.ts +7 -7
  102. package/dist/middle_layer/driver_kit.d.ts.map +1 -1
  103. package/dist/middle_layer/driver_kit.js +1 -2
  104. package/dist/middle_layer/driver_kit.js.map +1 -1
  105. package/dist/middle_layer/frontend_path.cjs +5 -5
  106. package/dist/middle_layer/frontend_path.cjs.map +1 -1
  107. package/dist/middle_layer/frontend_path.d.ts +4 -4
  108. package/dist/middle_layer/frontend_path.d.ts.map +1 -1
  109. package/dist/middle_layer/frontend_path.js +5 -5
  110. package/dist/middle_layer/frontend_path.js.map +1 -1
  111. package/dist/middle_layer/index.d.ts +4 -4
  112. package/dist/middle_layer/middle_layer.cjs +11 -11
  113. package/dist/middle_layer/middle_layer.cjs.map +1 -1
  114. package/dist/middle_layer/middle_layer.d.ts +18 -18
  115. package/dist/middle_layer/middle_layer.d.ts.map +1 -1
  116. package/dist/middle_layer/middle_layer.js +11 -11
  117. package/dist/middle_layer/middle_layer.js.map +1 -1
  118. package/dist/middle_layer/navigation_states.cjs +2 -2
  119. package/dist/middle_layer/navigation_states.cjs.map +1 -1
  120. package/dist/middle_layer/navigation_states.d.ts +2 -2
  121. package/dist/middle_layer/navigation_states.js +2 -2
  122. package/dist/middle_layer/navigation_states.js.map +1 -1
  123. package/dist/middle_layer/ops.cjs +5 -5
  124. package/dist/middle_layer/ops.cjs.map +1 -1
  125. package/dist/middle_layer/ops.d.ts +11 -11
  126. package/dist/middle_layer/ops.d.ts.map +1 -1
  127. package/dist/middle_layer/ops.js +5 -5
  128. package/dist/middle_layer/ops.js.map +1 -1
  129. package/dist/middle_layer/project.cjs +71 -63
  130. package/dist/middle_layer/project.cjs.map +1 -1
  131. package/dist/middle_layer/project.d.ts +10 -10
  132. package/dist/middle_layer/project.d.ts.map +1 -1
  133. package/dist/middle_layer/project.js +71 -63
  134. package/dist/middle_layer/project.js.map +1 -1
  135. package/dist/middle_layer/project_list.cjs +2 -2
  136. package/dist/middle_layer/project_list.cjs.map +1 -1
  137. package/dist/middle_layer/project_list.d.ts +6 -6
  138. package/dist/middle_layer/project_list.d.ts.map +1 -1
  139. package/dist/middle_layer/project_list.js +2 -2
  140. package/dist/middle_layer/project_list.js.map +1 -1
  141. package/dist/middle_layer/project_overview.cjs +40 -40
  142. package/dist/middle_layer/project_overview.cjs.map +1 -1
  143. package/dist/middle_layer/project_overview.d.ts +5 -5
  144. package/dist/middle_layer/project_overview.d.ts.map +1 -1
  145. package/dist/middle_layer/project_overview.js +40 -40
  146. package/dist/middle_layer/project_overview.js.map +1 -1
  147. package/dist/middle_layer/project_overview_light.cjs.map +1 -1
  148. package/dist/middle_layer/project_overview_light.d.ts +2 -2
  149. package/dist/middle_layer/project_overview_light.d.ts.map +1 -1
  150. package/dist/middle_layer/project_overview_light.js.map +1 -1
  151. package/dist/middle_layer/render.cjs +1 -1
  152. package/dist/middle_layer/render.cjs.map +1 -1
  153. package/dist/middle_layer/render.d.ts +4 -4
  154. package/dist/middle_layer/render.js +1 -1
  155. package/dist/middle_layer/render.js.map +1 -1
  156. package/dist/middle_layer/render.test.d.ts +2 -2
  157. package/dist/middle_layer/types.d.ts +3 -3
  158. package/dist/middle_layer/util.cjs +9 -4
  159. package/dist/middle_layer/util.cjs.map +1 -1
  160. package/dist/middle_layer/util.d.ts +4 -4
  161. package/dist/middle_layer/util.d.ts.map +1 -1
  162. package/dist/middle_layer/util.js +9 -4
  163. package/dist/middle_layer/util.js.map +1 -1
  164. package/dist/model/args.cjs +19 -15
  165. package/dist/model/args.cjs.map +1 -1
  166. package/dist/model/args.d.ts +1 -1
  167. package/dist/model/args.d.ts.map +1 -1
  168. package/dist/model/args.js +19 -15
  169. package/dist/model/args.js.map +1 -1
  170. package/dist/model/block_pack.d.ts +2 -2
  171. package/dist/model/block_pack_spec.cjs +3 -3
  172. package/dist/model/block_pack_spec.cjs.map +1 -1
  173. package/dist/model/block_pack_spec.d.ts +8 -8
  174. package/dist/model/block_pack_spec.js +3 -3
  175. package/dist/model/block_pack_spec.js.map +1 -1
  176. package/dist/model/block_storage_helper.cjs +4 -4
  177. package/dist/model/block_storage_helper.cjs.map +1 -1
  178. package/dist/model/block_storage_helper.d.ts +2 -2
  179. package/dist/model/block_storage_helper.d.ts.map +1 -1
  180. package/dist/model/block_storage_helper.js +4 -4
  181. package/dist/model/block_storage_helper.js.map +1 -1
  182. package/dist/model/index.d.ts +3 -3
  183. package/dist/model/project_helper.cjs +30 -13
  184. package/dist/model/project_helper.cjs.map +1 -1
  185. package/dist/model/project_helper.d.ts +4 -4
  186. package/dist/model/project_helper.d.ts.map +1 -1
  187. package/dist/model/project_helper.js +30 -13
  188. package/dist/model/project_helper.js.map +1 -1
  189. package/dist/model/project_model.cjs +23 -23
  190. package/dist/model/project_model.cjs.map +1 -1
  191. package/dist/model/project_model.d.ts +6 -6
  192. package/dist/model/project_model.d.ts.map +1 -1
  193. package/dist/model/project_model.js +23 -23
  194. package/dist/model/project_model.js.map +1 -1
  195. package/dist/model/project_model_util.cjs +2 -2
  196. package/dist/model/project_model_util.cjs.map +1 -1
  197. package/dist/model/project_model_util.d.ts +3 -3
  198. package/dist/model/project_model_util.d.ts.map +1 -1
  199. package/dist/model/project_model_util.js +2 -2
  200. package/dist/model/project_model_util.js.map +1 -1
  201. package/dist/model/project_model_v1.cjs +2 -2
  202. package/dist/model/project_model_v1.cjs.map +1 -1
  203. package/dist/model/project_model_v1.js +2 -2
  204. package/dist/model/project_model_v1.js.map +1 -1
  205. package/dist/model/template_spec.d.ts +5 -5
  206. package/dist/mutator/block-pack/block_pack.cjs +43 -43
  207. package/dist/mutator/block-pack/block_pack.cjs.map +1 -1
  208. package/dist/mutator/block-pack/block_pack.d.ts +6 -6
  209. package/dist/mutator/block-pack/block_pack.d.ts.map +1 -1
  210. package/dist/mutator/block-pack/block_pack.js +43 -43
  211. package/dist/mutator/block-pack/block_pack.js.map +1 -1
  212. package/dist/mutator/block-pack/frontend.cjs +2 -2
  213. package/dist/mutator/block-pack/frontend.cjs.map +1 -1
  214. package/dist/mutator/block-pack/frontend.d.ts +2 -2
  215. package/dist/mutator/block-pack/frontend.d.ts.map +1 -1
  216. package/dist/mutator/block-pack/frontend.js +2 -2
  217. package/dist/mutator/block-pack/frontend.js.map +1 -1
  218. package/dist/mutator/context_export.cjs +5 -5
  219. package/dist/mutator/context_export.cjs.map +1 -1
  220. package/dist/mutator/context_export.d.ts +2 -2
  221. package/dist/mutator/context_export.d.ts.map +1 -1
  222. package/dist/mutator/context_export.js +5 -5
  223. package/dist/mutator/context_export.js.map +1 -1
  224. package/dist/mutator/migration.cjs +7 -7
  225. package/dist/mutator/migration.cjs.map +1 -1
  226. package/dist/mutator/migration.d.ts +1 -1
  227. package/dist/mutator/migration.d.ts.map +1 -1
  228. package/dist/mutator/migration.js +7 -7
  229. package/dist/mutator/migration.js.map +1 -1
  230. package/dist/mutator/project.cjs +147 -148
  231. package/dist/mutator/project.cjs.map +1 -1
  232. package/dist/mutator/project.d.ts +13 -13
  233. package/dist/mutator/project.d.ts.map +1 -1
  234. package/dist/mutator/project.js +147 -148
  235. package/dist/mutator/project.js.map +1 -1
  236. package/dist/mutator/template/direct_template_loader.cjs +16 -16
  237. package/dist/mutator/template/direct_template_loader.cjs.map +1 -1
  238. package/dist/mutator/template/direct_template_loader.d.ts +2 -2
  239. package/dist/mutator/template/direct_template_loader.d.ts.map +1 -1
  240. package/dist/mutator/template/direct_template_loader.js +16 -16
  241. package/dist/mutator/template/direct_template_loader.js.map +1 -1
  242. package/dist/mutator/template/direct_template_loader_v3.cjs +13 -13
  243. package/dist/mutator/template/direct_template_loader_v3.cjs.map +1 -1
  244. package/dist/mutator/template/direct_template_loader_v3.d.ts +3 -3
  245. package/dist/mutator/template/direct_template_loader_v3.d.ts.map +1 -1
  246. package/dist/mutator/template/direct_template_loader_v3.js +13 -13
  247. package/dist/mutator/template/direct_template_loader_v3.js.map +1 -1
  248. package/dist/mutator/template/render_block.cjs +7 -7
  249. package/dist/mutator/template/render_block.cjs.map +1 -1
  250. package/dist/mutator/template/render_block.d.ts +1 -1
  251. package/dist/mutator/template/render_block.d.ts.map +1 -1
  252. package/dist/mutator/template/render_block.js +7 -7
  253. package/dist/mutator/template/render_block.js.map +1 -1
  254. package/dist/mutator/template/render_template.cjs +10 -10
  255. package/dist/mutator/template/render_template.cjs.map +1 -1
  256. package/dist/mutator/template/render_template.d.ts +2 -2
  257. package/dist/mutator/template/render_template.js +10 -10
  258. package/dist/mutator/template/render_template.js.map +1 -1
  259. package/dist/mutator/template/template_loading.cjs +17 -17
  260. package/dist/mutator/template/template_loading.cjs.map +1 -1
  261. package/dist/mutator/template/template_loading.d.ts +2 -2
  262. package/dist/mutator/template/template_loading.js +17 -17
  263. package/dist/mutator/template/template_loading.js.map +1 -1
  264. package/dist/network_check/network_check.cjs +33 -32
  265. package/dist/network_check/network_check.cjs.map +1 -1
  266. package/dist/network_check/network_check.d.ts +6 -6
  267. package/dist/network_check/network_check.d.ts.map +1 -1
  268. package/dist/network_check/network_check.js +33 -32
  269. package/dist/network_check/network_check.js.map +1 -1
  270. package/dist/network_check/pings.cjs +3 -3
  271. package/dist/network_check/pings.cjs.map +1 -1
  272. package/dist/network_check/pings.d.ts +4 -4
  273. package/dist/network_check/pings.d.ts.map +1 -1
  274. package/dist/network_check/pings.js +3 -3
  275. package/dist/network_check/pings.js.map +1 -1
  276. package/dist/network_check/template.cjs +57 -44
  277. package/dist/network_check/template.cjs.map +1 -1
  278. package/dist/network_check/template.d.ts +8 -8
  279. package/dist/network_check/template.d.ts.map +1 -1
  280. package/dist/network_check/template.js +57 -44
  281. package/dist/network_check/template.js.map +1 -1
  282. package/dist/pool/data.cjs +45 -33
  283. package/dist/pool/data.cjs.map +1 -1
  284. package/dist/pool/data.d.ts +3 -3
  285. package/dist/pool/data.d.ts.map +1 -1
  286. package/dist/pool/data.js +45 -33
  287. package/dist/pool/data.js.map +1 -1
  288. package/dist/pool/driver.cjs +18 -16
  289. package/dist/pool/driver.cjs.map +1 -1
  290. package/dist/pool/driver.d.ts +5 -5
  291. package/dist/pool/driver.d.ts.map +1 -1
  292. package/dist/pool/driver.js +18 -16
  293. package/dist/pool/driver.js.map +1 -1
  294. package/dist/pool/index.d.ts +2 -2
  295. package/dist/pool/p_object_collection.cjs +5 -5
  296. package/dist/pool/p_object_collection.cjs.map +1 -1
  297. package/dist/pool/p_object_collection.d.ts +2 -2
  298. package/dist/pool/p_object_collection.d.ts.map +1 -1
  299. package/dist/pool/p_object_collection.js +5 -5
  300. package/dist/pool/p_object_collection.js.map +1 -1
  301. package/dist/pool/result_pool.cjs +6 -6
  302. package/dist/pool/result_pool.cjs.map +1 -1
  303. package/dist/pool/result_pool.d.ts +6 -6
  304. package/dist/pool/result_pool.d.ts.map +1 -1
  305. package/dist/pool/result_pool.js +6 -6
  306. package/dist/pool/result_pool.js.map +1 -1
  307. package/dist/test/block_packs.d.ts +2 -2
  308. package/dist/test/known_templates.d.ts +1 -1
  309. package/dist/worker/WorkerManager.cjs +7 -8
  310. package/dist/worker/WorkerManager.cjs.map +1 -1
  311. package/dist/worker/WorkerManager.d.ts +2 -2
  312. package/dist/worker/WorkerManager.d.ts.map +1 -1
  313. package/dist/worker/WorkerManager.js +7 -8
  314. package/dist/worker/WorkerManager.js.map +1 -1
  315. package/dist/worker/worker.cjs +6 -4
  316. package/dist/worker/worker.cjs.map +1 -1
  317. package/dist/worker/worker.js +6 -4
  318. package/dist/worker/worker.js.map +1 -1
  319. package/dist/worker/workerApi.cjs.map +1 -1
  320. package/dist/worker/workerApi.js.map +1 -1
  321. package/package.json +41 -41
  322. package/src/block_registry/index.ts +3 -3
  323. package/src/block_registry/registry-v2-provider.ts +2 -2
  324. package/src/block_registry/registry.test.ts +17 -17
  325. package/src/block_registry/registry.ts +55 -60
  326. package/src/block_registry/watcher.ts +24 -23
  327. package/src/block_registry/well_known_registries.ts +7 -7
  328. package/src/cfg_render/executor.test.ts +36 -36
  329. package/src/cfg_render/executor.ts +24 -24
  330. package/src/cfg_render/operation.ts +5 -5
  331. package/src/cfg_render/renderer.ts +96 -93
  332. package/src/cfg_render/traverse.ts +50 -50
  333. package/src/cfg_render/util.ts +3 -3
  334. package/src/debug/index.ts +6 -4
  335. package/src/dev_env/index.ts +16 -16
  336. package/src/dev_env/util.ts +3 -3
  337. package/src/index.ts +16 -16
  338. package/src/js_render/computable_context.ts +143 -126
  339. package/src/js_render/context.ts +72 -44
  340. package/src/js_render/index.ts +51 -24
  341. package/src/middle_layer/active_cfg.ts +14 -12
  342. package/src/middle_layer/block.ts +30 -23
  343. package/src/middle_layer/block_ctx.ts +27 -31
  344. package/src/middle_layer/block_ctx_unsafe.ts +9 -9
  345. package/src/middle_layer/driver_kit.ts +13 -19
  346. package/src/middle_layer/frontend_path.ts +18 -23
  347. package/src/middle_layer/index.ts +4 -4
  348. package/src/middle_layer/middle_layer.ts +57 -55
  349. package/src/middle_layer/navigation_states.ts +6 -6
  350. package/src/middle_layer/ops.ts +43 -42
  351. package/src/middle_layer/project.ts +274 -173
  352. package/src/middle_layer/project_list.ts +14 -15
  353. package/src/middle_layer/project_overview.ts +104 -113
  354. package/src/middle_layer/project_overview_light.ts +7 -9
  355. package/src/middle_layer/render.test.ts +49 -48
  356. package/src/middle_layer/render.ts +9 -9
  357. package/src/middle_layer/types.ts +3 -3
  358. package/src/middle_layer/util.ts +17 -12
  359. package/src/model/args.ts +22 -19
  360. package/src/model/block_pack.ts +2 -2
  361. package/src/model/block_pack_spec.ts +11 -11
  362. package/src/model/block_storage_helper.ts +11 -11
  363. package/src/model/index.ts +3 -3
  364. package/src/model/project_helper.ts +78 -32
  365. package/src/model/project_model.test.ts +5 -9
  366. package/src/model/project_model.ts +48 -49
  367. package/src/model/project_model_util.test.ts +86 -53
  368. package/src/model/project_model_util.ts +18 -14
  369. package/src/model/project_model_v1.ts +3 -3
  370. package/src/model/template_spec.ts +5 -5
  371. package/src/mutator/block-pack/block_pack.test.ts +25 -25
  372. package/src/mutator/block-pack/block_pack.ts +70 -68
  373. package/src/mutator/block-pack/frontend.ts +6 -13
  374. package/src/mutator/context_export.ts +12 -10
  375. package/src/mutator/migration.ts +20 -14
  376. package/src/mutator/project-v3.test.ts +123 -118
  377. package/src/mutator/project.test.ts +105 -94
  378. package/src/mutator/project.ts +357 -274
  379. package/src/mutator/template/direct_template_loader.ts +26 -32
  380. package/src/mutator/template/direct_template_loader_v3.ts +51 -25
  381. package/src/mutator/template/render_block.ts +14 -21
  382. package/src/mutator/template/render_template.ts +13 -13
  383. package/src/mutator/template/template_loading.ts +23 -23
  384. package/src/mutator/template/template_render.test.ts +87 -86
  385. package/src/network_check/network_check.test.ts +4 -4
  386. package/src/network_check/network_check.ts +102 -79
  387. package/src/network_check/pings.ts +35 -16
  388. package/src/network_check/template.test.ts +47 -44
  389. package/src/network_check/template.ts +151 -95
  390. package/src/network_check/test_utils.ts +1 -1
  391. package/src/pool/data.ts +81 -69
  392. package/src/pool/driver.ts +56 -51
  393. package/src/pool/index.ts +2 -2
  394. package/src/pool/p_object_collection.ts +16 -15
  395. package/src/pool/result_pool.ts +23 -34
  396. package/src/test/block_packs.ts +15 -15
  397. package/src/test/explicit_templates.ts +4 -4
  398. package/src/test/known_templates.ts +10 -10
  399. package/src/test_env.ts +1 -1
  400. package/src/worker/WorkerManager.ts +22 -18
  401. package/src/worker/worker.ts +11 -9
  402. package/src/worker/workerApi.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"util.cjs","sources":["../../src/middle_layer/util.ts"],"sourcesContent":["import type { PlTreeNodeAccessor } from '@milaboratories/pl-tree';\nimport { projectFieldName } from '../model/project_model';\nimport type { ResourceId } from '@milaboratories/pl-client';\nimport { Pl } from '@milaboratories/pl-client';\nimport { ifNotUndef } from '../cfg_render/util';\nimport type { BlockPackInfo } from '../model/block_pack';\nimport type { BlockConfig } from '@platforma-sdk/model';\nimport { extractConfig } from '@platforma-sdk/model';\n\nexport type BlockPackInfoAndId = {\n readonly bpResourceId: ResourceId;\n /** To be added to computable keys, to force reload on config change */\n readonly bpId: string;\n /** Full block-pack info */\n readonly info: BlockPackInfo;\n /** Config extracted from the info */\n readonly cfg: BlockConfig;\n};\n\n/** Returns block pack info along with string representation of block-pack resource id */\nexport function getBlockPackInfo(\n prj: PlTreeNodeAccessor,\n blockId: string,\n): BlockPackInfoAndId | undefined {\n return ifNotUndef(\n prj.traverse(\n {\n field: projectFieldName(blockId, 'blockPack'),\n assertFieldType: 'Dynamic',\n errorIfFieldNotSet: true,\n },\n { field: Pl.HolderRefField, assertFieldType: 'Input', errorIfFieldNotFound: true },\n ),\n (bpAcc) => {\n const info = bpAcc.getDataAsJson<BlockPackInfo>()!;\n const cfg = extractConfig(info.config);\n return { bpResourceId: bpAcc.resourceInfo.id, bpId: bpAcc.resourceInfo.id.toString(), info, cfg };\n },\n );\n}\n"],"names":["ifNotUndef","projectFieldName","Pl","extractConfig"],"mappings":";;;;;;;AAmBA;AACM,SAAU,gBAAgB,CAC9B,GAAuB,EACvB,OAAe,EAAA;AAEf,IAAA,OAAOA,eAAU,CACf,GAAG,CAAC,QAAQ,CACV;AACE,QAAA,KAAK,EAAEC,8BAAgB,CAAC,OAAO,EAAE,WAAW,CAAC;AAC7C,QAAA,eAAe,EAAE,SAAS;AAC1B,QAAA,kBAAkB,EAAE,IAAI;KACzB,EACD,EAAE,KAAK,EAAEC,WAAE,CAAC,cAAc,EAAE,eAAe,EAAE,OAAO,EAAE,oBAAoB,EAAE,IAAI,EAAE,CACnF,EACD,CAAC,KAAK,KAAI;AACR,QAAA,MAAM,IAAI,GAAG,KAAK,CAAC,aAAa,EAAkB;QAClD,MAAM,GAAG,GAAGC,mBAAa,CAAC,IAAI,CAAC,MAAM,CAAC;QACtC,OAAO,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE;AACnG,IAAA,CAAC,CACF;AACH;;;;"}
1
+ {"version":3,"file":"util.cjs","sources":["../../src/middle_layer/util.ts"],"sourcesContent":["import type { PlTreeNodeAccessor } from \"@milaboratories/pl-tree\";\nimport { projectFieldName } from \"../model/project_model\";\nimport type { ResourceId } from \"@milaboratories/pl-client\";\nimport { Pl } from \"@milaboratories/pl-client\";\nimport { ifNotUndef } from \"../cfg_render/util\";\nimport type { BlockPackInfo } from \"../model/block_pack\";\nimport type { BlockConfig } from \"@platforma-sdk/model\";\nimport { extractConfig } from \"@platforma-sdk/model\";\n\nexport type BlockPackInfoAndId = {\n readonly bpResourceId: ResourceId;\n /** To be added to computable keys, to force reload on config change */\n readonly bpId: string;\n /** Full block-pack info */\n readonly info: BlockPackInfo;\n /** Config extracted from the info */\n readonly cfg: BlockConfig;\n};\n\n/** Returns block pack info along with string representation of block-pack resource id */\nexport function getBlockPackInfo(\n prj: PlTreeNodeAccessor,\n blockId: string,\n): BlockPackInfoAndId | undefined {\n return ifNotUndef(\n prj.traverse(\n {\n field: projectFieldName(blockId, \"blockPack\"),\n assertFieldType: \"Dynamic\",\n errorIfFieldNotSet: true,\n },\n { field: Pl.HolderRefField, assertFieldType: \"Input\", errorIfFieldNotFound: true },\n ),\n (bpAcc) => {\n const info = bpAcc.getDataAsJson<BlockPackInfo>()!;\n const cfg = extractConfig(info.config);\n return {\n bpResourceId: bpAcc.resourceInfo.id,\n bpId: bpAcc.resourceInfo.id.toString(),\n info,\n cfg,\n };\n },\n );\n}\n"],"names":["ifNotUndef","projectFieldName","Pl","extractConfig"],"mappings":";;;;;;;AAmBA;AACM,SAAU,gBAAgB,CAC9B,GAAuB,EACvB,OAAe,EAAA;AAEf,IAAA,OAAOA,eAAU,CACf,GAAG,CAAC,QAAQ,CACV;AACE,QAAA,KAAK,EAAEC,8BAAgB,CAAC,OAAO,EAAE,WAAW,CAAC;AAC7C,QAAA,eAAe,EAAE,SAAS;AAC1B,QAAA,kBAAkB,EAAE,IAAI;KACzB,EACD,EAAE,KAAK,EAAEC,WAAE,CAAC,cAAc,EAAE,eAAe,EAAE,OAAO,EAAE,oBAAoB,EAAE,IAAI,EAAE,CACnF,EACD,CAAC,KAAK,KAAI;AACR,QAAA,MAAM,IAAI,GAAG,KAAK,CAAC,aAAa,EAAkB;QAClD,MAAM,GAAG,GAAGC,mBAAa,CAAC,IAAI,CAAC,MAAM,CAAC;QACtC,OAAO;AACL,YAAA,YAAY,EAAE,KAAK,CAAC,YAAY,CAAC,EAAE;YACnC,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE;YACtC,IAAI;YACJ,GAAG;SACJ;AACH,IAAA,CAAC,CACF;AACH;;;;"}
@@ -1,7 +1,7 @@
1
- import type { PlTreeNodeAccessor } from '@milaboratories/pl-tree';
2
- import type { ResourceId } from '@milaboratories/pl-client';
3
- import type { BlockPackInfo } from '../model/block_pack';
4
- import type { BlockConfig } from '@platforma-sdk/model';
1
+ import type { PlTreeNodeAccessor } from "@milaboratories/pl-tree";
2
+ import type { ResourceId } from "@milaboratories/pl-client";
3
+ import type { BlockPackInfo } from "../model/block_pack";
4
+ import type { BlockConfig } from "@platforma-sdk/model";
5
5
  export type BlockPackInfoAndId = {
6
6
  readonly bpResourceId: ResourceId;
7
7
  /** To be added to computable keys, to force reload on config change */
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/middle_layer/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAG5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,YAAY,EAAE,UAAU,CAAC;IAClC,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,2BAA2B;IAC3B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,qCAAqC;IACrC,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,yFAAyF;AACzF,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,kBAAkB,EACvB,OAAO,EAAE,MAAM,GACd,kBAAkB,GAAG,SAAS,CAgBhC"}
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/middle_layer/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAG5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,YAAY,EAAE,UAAU,CAAC;IAClC,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,2BAA2B;IAC3B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,qCAAqC;IACrC,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,yFAAyF;AACzF,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,kBAAkB,EACvB,OAAO,EAAE,MAAM,GACd,kBAAkB,GAAG,SAAS,CAqBhC"}
@@ -6,13 +6,18 @@ import { extractConfig } from '@platforma-sdk/model';
6
6
  /** Returns block pack info along with string representation of block-pack resource id */
7
7
  function getBlockPackInfo(prj, blockId) {
8
8
  return ifNotUndef(prj.traverse({
9
- field: projectFieldName(blockId, 'blockPack'),
10
- assertFieldType: 'Dynamic',
9
+ field: projectFieldName(blockId, "blockPack"),
10
+ assertFieldType: "Dynamic",
11
11
  errorIfFieldNotSet: true,
12
- }, { field: Pl.HolderRefField, assertFieldType: 'Input', errorIfFieldNotFound: true }), (bpAcc) => {
12
+ }, { field: Pl.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: true }), (bpAcc) => {
13
13
  const info = bpAcc.getDataAsJson();
14
14
  const cfg = extractConfig(info.config);
15
- return { bpResourceId: bpAcc.resourceInfo.id, bpId: bpAcc.resourceInfo.id.toString(), info, cfg };
15
+ return {
16
+ bpResourceId: bpAcc.resourceInfo.id,
17
+ bpId: bpAcc.resourceInfo.id.toString(),
18
+ info,
19
+ cfg,
20
+ };
16
21
  });
17
22
  }
18
23
 
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sources":["../../src/middle_layer/util.ts"],"sourcesContent":["import type { PlTreeNodeAccessor } from '@milaboratories/pl-tree';\nimport { projectFieldName } from '../model/project_model';\nimport type { ResourceId } from '@milaboratories/pl-client';\nimport { Pl } from '@milaboratories/pl-client';\nimport { ifNotUndef } from '../cfg_render/util';\nimport type { BlockPackInfo } from '../model/block_pack';\nimport type { BlockConfig } from '@platforma-sdk/model';\nimport { extractConfig } from '@platforma-sdk/model';\n\nexport type BlockPackInfoAndId = {\n readonly bpResourceId: ResourceId;\n /** To be added to computable keys, to force reload on config change */\n readonly bpId: string;\n /** Full block-pack info */\n readonly info: BlockPackInfo;\n /** Config extracted from the info */\n readonly cfg: BlockConfig;\n};\n\n/** Returns block pack info along with string representation of block-pack resource id */\nexport function getBlockPackInfo(\n prj: PlTreeNodeAccessor,\n blockId: string,\n): BlockPackInfoAndId | undefined {\n return ifNotUndef(\n prj.traverse(\n {\n field: projectFieldName(blockId, 'blockPack'),\n assertFieldType: 'Dynamic',\n errorIfFieldNotSet: true,\n },\n { field: Pl.HolderRefField, assertFieldType: 'Input', errorIfFieldNotFound: true },\n ),\n (bpAcc) => {\n const info = bpAcc.getDataAsJson<BlockPackInfo>()!;\n const cfg = extractConfig(info.config);\n return { bpResourceId: bpAcc.resourceInfo.id, bpId: bpAcc.resourceInfo.id.toString(), info, cfg };\n },\n );\n}\n"],"names":[],"mappings":";;;;;AAmBA;AACM,SAAU,gBAAgB,CAC9B,GAAuB,EACvB,OAAe,EAAA;AAEf,IAAA,OAAO,UAAU,CACf,GAAG,CAAC,QAAQ,CACV;AACE,QAAA,KAAK,EAAE,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC;AAC7C,QAAA,eAAe,EAAE,SAAS;AAC1B,QAAA,kBAAkB,EAAE,IAAI;KACzB,EACD,EAAE,KAAK,EAAE,EAAE,CAAC,cAAc,EAAE,eAAe,EAAE,OAAO,EAAE,oBAAoB,EAAE,IAAI,EAAE,CACnF,EACD,CAAC,KAAK,KAAI;AACR,QAAA,MAAM,IAAI,GAAG,KAAK,CAAC,aAAa,EAAkB;QAClD,MAAM,GAAG,GAAG,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;QACtC,OAAO,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE;AACnG,IAAA,CAAC,CACF;AACH;;;;"}
1
+ {"version":3,"file":"util.js","sources":["../../src/middle_layer/util.ts"],"sourcesContent":["import type { PlTreeNodeAccessor } from \"@milaboratories/pl-tree\";\nimport { projectFieldName } from \"../model/project_model\";\nimport type { ResourceId } from \"@milaboratories/pl-client\";\nimport { Pl } from \"@milaboratories/pl-client\";\nimport { ifNotUndef } from \"../cfg_render/util\";\nimport type { BlockPackInfo } from \"../model/block_pack\";\nimport type { BlockConfig } from \"@platforma-sdk/model\";\nimport { extractConfig } from \"@platforma-sdk/model\";\n\nexport type BlockPackInfoAndId = {\n readonly bpResourceId: ResourceId;\n /** To be added to computable keys, to force reload on config change */\n readonly bpId: string;\n /** Full block-pack info */\n readonly info: BlockPackInfo;\n /** Config extracted from the info */\n readonly cfg: BlockConfig;\n};\n\n/** Returns block pack info along with string representation of block-pack resource id */\nexport function getBlockPackInfo(\n prj: PlTreeNodeAccessor,\n blockId: string,\n): BlockPackInfoAndId | undefined {\n return ifNotUndef(\n prj.traverse(\n {\n field: projectFieldName(blockId, \"blockPack\"),\n assertFieldType: \"Dynamic\",\n errorIfFieldNotSet: true,\n },\n { field: Pl.HolderRefField, assertFieldType: \"Input\", errorIfFieldNotFound: true },\n ),\n (bpAcc) => {\n const info = bpAcc.getDataAsJson<BlockPackInfo>()!;\n const cfg = extractConfig(info.config);\n return {\n bpResourceId: bpAcc.resourceInfo.id,\n bpId: bpAcc.resourceInfo.id.toString(),\n info,\n cfg,\n };\n },\n );\n}\n"],"names":[],"mappings":";;;;;AAmBA;AACM,SAAU,gBAAgB,CAC9B,GAAuB,EACvB,OAAe,EAAA;AAEf,IAAA,OAAO,UAAU,CACf,GAAG,CAAC,QAAQ,CACV;AACE,QAAA,KAAK,EAAE,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC;AAC7C,QAAA,eAAe,EAAE,SAAS;AAC1B,QAAA,kBAAkB,EAAE,IAAI;KACzB,EACD,EAAE,KAAK,EAAE,EAAE,CAAC,cAAc,EAAE,eAAe,EAAE,OAAO,EAAE,oBAAoB,EAAE,IAAI,EAAE,CACnF,EACD,CAAC,KAAK,KAAI;AACR,QAAA,MAAM,IAAI,GAAG,KAAK,CAAC,aAAa,EAAkB;QAClD,MAAM,GAAG,GAAG,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;QACtC,OAAO;AACL,YAAA,YAAY,EAAE,KAAK,CAAC,YAAY,CAAC,EAAE;YACnC,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE;YACtC,IAAI;YACJ,GAAG;SACJ;AACH,IAAA,CAAC,CACF;AACH;;;;"}
@@ -6,25 +6,25 @@ function outputRef(blockId, name, requireEnrichments) {
6
6
  return { __isRef: true, blockId, name };
7
7
  }
8
8
  function isBlockOutputReference(obj) {
9
- return (typeof obj === 'object'
10
- && obj !== null
11
- && '__isRef' in obj
12
- && obj.__isRef === true
13
- && 'blockId' in obj
14
- && 'name' in obj);
9
+ return (typeof obj === "object" &&
10
+ obj !== null &&
11
+ "__isRef" in obj &&
12
+ obj.__isRef === true &&
13
+ "blockId" in obj &&
14
+ "name" in obj);
15
15
  }
16
16
  function addAllReferencedBlocks(result, node, allowed) {
17
17
  const type = typeof node;
18
18
  switch (type) {
19
- case 'function':
20
- case 'bigint':
21
- case 'number':
22
- case 'string':
23
- case 'boolean':
24
- case 'symbol':
25
- case 'undefined':
19
+ case "function":
20
+ case "bigint":
21
+ case "number":
22
+ case "string":
23
+ case "boolean":
24
+ case "symbol":
25
+ case "undefined":
26
26
  return;
27
- case 'object':
27
+ case "object":
28
28
  if (node === null)
29
29
  return;
30
30
  if (isBlockOutputReference(node)) {
@@ -51,7 +51,11 @@ function addAllReferencedBlocks(result, node, allowed) {
51
51
  }
52
52
  /** Extracts all resource ids referenced by args object. */
53
53
  function inferAllReferencedBlocks(args, allowed) {
54
- const result = { upstreams: new Set(), upstreamsRequiringEnrichments: new Set(), missingReferences: false };
54
+ const result = {
55
+ upstreams: new Set(),
56
+ upstreamsRequiringEnrichments: new Set(),
57
+ missingReferences: false,
58
+ };
55
59
  addAllReferencedBlocks(result, args, allowed);
56
60
  return result;
57
61
  }
@@ -1 +1 @@
1
- {"version":3,"file":"args.cjs","sources":["../../src/model/args.ts"],"sourcesContent":["import { assertNever } from '@milaboratories/ts-helpers';\nimport type { PlRef } from '@platforma-sdk/model';\n\nexport function outputRef(blockId: string, name: string, requireEnrichments?: boolean): PlRef {\n if (requireEnrichments) return { __isRef: true, blockId, name, requireEnrichments };\n else return { __isRef: true, blockId, name };\n}\n\nexport function isBlockOutputReference(obj: unknown): obj is PlRef {\n return (\n typeof obj === 'object'\n && obj !== null\n && '__isRef' in obj\n && obj.__isRef === true\n && 'blockId' in obj\n && 'name' in obj\n );\n}\n\nfunction addAllReferencedBlocks(result: BlockUpstreams, node: unknown, allowed?: Set<string>) {\n const type = typeof node;\n switch (type) {\n case 'function':\n case 'bigint':\n case 'number':\n case 'string':\n case 'boolean':\n case 'symbol':\n case 'undefined':\n return;\n\n case 'object':\n if (node === null) return;\n\n if (isBlockOutputReference(node)) {\n if (allowed === undefined || allowed.has(node.blockId)) {\n result.upstreams.add(node.blockId);\n if (node.requireEnrichments)\n result.upstreamsRequiringEnrichments.add(node.blockId);\n } else result.missingReferences = true;\n } else if (Array.isArray(node)) {\n for (const child of node) addAllReferencedBlocks(result, child, allowed);\n } else {\n for (const [, child] of Object.entries(node as object))\n addAllReferencedBlocks(result, child, allowed);\n }\n\n return;\n\n default:\n assertNever(type);\n }\n}\n\nexport interface BlockUpstreams {\n /** All direct block dependencies */\n upstreams: Set<string>;\n /** Direct block dependencies which enrichments are also required by current block */\n upstreamsRequiringEnrichments: Set<string>;\n /** True if not-allowed references was encountered */\n missingReferences: boolean;\n}\n\n/** Extracts all resource ids referenced by args object. */\nexport function inferAllReferencedBlocks(args: unknown, allowed?: Set<string>): BlockUpstreams {\n const result = { upstreams: new Set<string>(), upstreamsRequiringEnrichments: new Set<string>(), missingReferences: false };\n addAllReferencedBlocks(result, args, allowed);\n return result;\n}\n"],"names":["assertNever"],"mappings":";;;;SAGgB,SAAS,CAAC,OAAe,EAAE,IAAY,EAAE,kBAA4B,EAAA;AACnF,IACK,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;AAC9C;AAEM,SAAU,sBAAsB,CAAC,GAAY,EAAA;AACjD,IAAA,QACE,OAAO,GAAG,KAAK;AACZ,WAAA,GAAG,KAAK;AACR,WAAA,SAAS,IAAI;WACb,GAAG,CAAC,OAAO,KAAK;AAChB,WAAA,SAAS,IAAI;WACb,MAAM,IAAI,GAAG;AAEpB;AAEA,SAAS,sBAAsB,CAAC,MAAsB,EAAE,IAAa,EAAE,OAAqB,EAAA;AAC1F,IAAA,MAAM,IAAI,GAAG,OAAO,IAAI;IACxB,QAAQ,IAAI;AACV,QAAA,KAAK,UAAU;AACf,QAAA,KAAK,QAAQ;AACb,QAAA,KAAK,QAAQ;AACb,QAAA,KAAK,QAAQ;AACb,QAAA,KAAK,SAAS;AACd,QAAA,KAAK,QAAQ;AACb,QAAA,KAAK,WAAW;YACd;AAEF,QAAA,KAAK,QAAQ;YACX,IAAI,IAAI,KAAK,IAAI;gBAAE;AAEnB,YAAA,IAAI,sBAAsB,CAAC,IAAI,CAAC,EAAE;AAChC,gBAAA,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;oBACtD,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;oBAClC,IAAI,IAAI,CAAC,kBAAkB;wBACzB,MAAM,CAAC,6BAA6B,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;gBAC1D;;AAAO,oBAAA,MAAM,CAAC,iBAAiB,GAAG,IAAI;YACxC;AAAO,iBAAA,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBAC9B,KAAK,MAAM,KAAK,IAAI,IAAI;AAAE,oBAAA,sBAAsB,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC;YAC1E;iBAAO;gBACL,KAAK,MAAM,GAAG,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAc,CAAC;AACpD,oBAAA,sBAAsB,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC;YAClD;YAEA;AAEF,QAAA;YACEA,qBAAW,CAAC,IAAI,CAAC;;AAEvB;AAWA;AACM,SAAU,wBAAwB,CAAC,IAAa,EAAE,OAAqB,EAAA;AAC3E,IAAA,MAAM,MAAM,GAAG,EAAE,SAAS,EAAE,IAAI,GAAG,EAAU,EAAE,6BAA6B,EAAE,IAAI,GAAG,EAAU,EAAE,iBAAiB,EAAE,KAAK,EAAE;AAC3H,IAAA,sBAAsB,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC;AAC7C,IAAA,OAAO,MAAM;AACf;;;;;;"}
1
+ {"version":3,"file":"args.cjs","sources":["../../src/model/args.ts"],"sourcesContent":["import { assertNever } from \"@milaboratories/ts-helpers\";\nimport type { PlRef } from \"@platforma-sdk/model\";\n\nexport function outputRef(blockId: string, name: string, requireEnrichments?: boolean): PlRef {\n if (requireEnrichments) return { __isRef: true, blockId, name, requireEnrichments };\n else return { __isRef: true, blockId, name };\n}\n\nexport function isBlockOutputReference(obj: unknown): obj is PlRef {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n \"__isRef\" in obj &&\n obj.__isRef === true &&\n \"blockId\" in obj &&\n \"name\" in obj\n );\n}\n\nfunction addAllReferencedBlocks(result: BlockUpstreams, node: unknown, allowed?: Set<string>) {\n const type = typeof node;\n switch (type) {\n case \"function\":\n case \"bigint\":\n case \"number\":\n case \"string\":\n case \"boolean\":\n case \"symbol\":\n case \"undefined\":\n return;\n\n case \"object\":\n if (node === null) return;\n\n if (isBlockOutputReference(node)) {\n if (allowed === undefined || allowed.has(node.blockId)) {\n result.upstreams.add(node.blockId);\n if (node.requireEnrichments) result.upstreamsRequiringEnrichments.add(node.blockId);\n } else result.missingReferences = true;\n } else if (Array.isArray(node)) {\n for (const child of node) addAllReferencedBlocks(result, child, allowed);\n } else {\n for (const [, child] of Object.entries(node as object))\n addAllReferencedBlocks(result, child, allowed);\n }\n\n return;\n\n default:\n assertNever(type);\n }\n}\n\nexport interface BlockUpstreams {\n /** All direct block dependencies */\n upstreams: Set<string>;\n /** Direct block dependencies which enrichments are also required by current block */\n upstreamsRequiringEnrichments: Set<string>;\n /** True if not-allowed references was encountered */\n missingReferences: boolean;\n}\n\n/** Extracts all resource ids referenced by args object. */\nexport function inferAllReferencedBlocks(args: unknown, allowed?: Set<string>): BlockUpstreams {\n const result = {\n upstreams: new Set<string>(),\n upstreamsRequiringEnrichments: new Set<string>(),\n missingReferences: false,\n };\n addAllReferencedBlocks(result, args, allowed);\n return result;\n}\n"],"names":["assertNever"],"mappings":";;;;SAGgB,SAAS,CAAC,OAAe,EAAE,IAAY,EAAE,kBAA4B,EAAA;AACnF,IACK,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;AAC9C;AAEM,SAAU,sBAAsB,CAAC,GAAY,EAAA;AACjD,IAAA,QACE,OAAO,GAAG,KAAK,QAAQ;AACvB,QAAA,GAAG,KAAK,IAAI;AACZ,QAAA,SAAS,IAAI,GAAG;QAChB,GAAG,CAAC,OAAO,KAAK,IAAI;AACpB,QAAA,SAAS,IAAI,GAAG;QAChB,MAA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QACb,SAAS,EAAE,IAAI,GAAG,EAAU;QAC5B,6BAA6B,EAAE,IAAI,GAAG,EAAU;AAChD,QAAA,iBAAiB,EAAE,KAAK;KACzB;AACD,IAAA,sBAAsB,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC;AAC7C,IAAA,OAAO,MAAM;AACf;;;;;;"}
@@ -1,4 +1,4 @@
1
- import type { PlRef } from '@platforma-sdk/model';
1
+ import type { PlRef } from "@platforma-sdk/model";
2
2
  export declare function outputRef(blockId: string, name: string, requireEnrichments?: boolean): PlRef;
3
3
  export declare function isBlockOutputReference(obj: unknown): obj is PlRef;
4
4
  export interface BlockUpstreams {
@@ -1 +1 @@
1
- {"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/model/args.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,OAAO,GAAG,KAAK,CAG5F;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,KAAK,CASjE;AAqCD,MAAM,WAAW,cAAc;IAC7B,oCAAoC;IACpC,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACvB,qFAAqF;IACrF,6BAA6B,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3C,qDAAqD;IACrD,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,2DAA2D;AAC3D,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,cAAc,CAI7F"}
1
+ {"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/model/args.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,OAAO,GAAG,KAAK,CAG5F;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,KAAK,CASjE;AAoCD,MAAM,WAAW,cAAc;IAC7B,oCAAoC;IACpC,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACvB,qFAAqF;IACrF,6BAA6B,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3C,qDAAqD;IACrD,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,2DAA2D;AAC3D,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,cAAc,CAQ7F"}
@@ -4,25 +4,25 @@ function outputRef(blockId, name, requireEnrichments) {
4
4
  return { __isRef: true, blockId, name };
5
5
  }
6
6
  function isBlockOutputReference(obj) {
7
- return (typeof obj === 'object'
8
- && obj !== null
9
- && '__isRef' in obj
10
- && obj.__isRef === true
11
- && 'blockId' in obj
12
- && 'name' in obj);
7
+ return (typeof obj === "object" &&
8
+ obj !== null &&
9
+ "__isRef" in obj &&
10
+ obj.__isRef === true &&
11
+ "blockId" in obj &&
12
+ "name" in obj);
13
13
  }
14
14
  function addAllReferencedBlocks(result, node, allowed) {
15
15
  const type = typeof node;
16
16
  switch (type) {
17
- case 'function':
18
- case 'bigint':
19
- case 'number':
20
- case 'string':
21
- case 'boolean':
22
- case 'symbol':
23
- case 'undefined':
17
+ case "function":
18
+ case "bigint":
19
+ case "number":
20
+ case "string":
21
+ case "boolean":
22
+ case "symbol":
23
+ case "undefined":
24
24
  return;
25
- case 'object':
25
+ case "object":
26
26
  if (node === null)
27
27
  return;
28
28
  if (isBlockOutputReference(node)) {
@@ -49,7 +49,11 @@ function addAllReferencedBlocks(result, node, allowed) {
49
49
  }
50
50
  /** Extracts all resource ids referenced by args object. */
51
51
  function inferAllReferencedBlocks(args, allowed) {
52
- const result = { upstreams: new Set(), upstreamsRequiringEnrichments: new Set(), missingReferences: false };
52
+ const result = {
53
+ upstreams: new Set(),
54
+ upstreamsRequiringEnrichments: new Set(),
55
+ missingReferences: false,
56
+ };
53
57
  addAllReferencedBlocks(result, args, allowed);
54
58
  return result;
55
59
  }
@@ -1 +1 @@
1
- {"version":3,"file":"args.js","sources":["../../src/model/args.ts"],"sourcesContent":["import { assertNever } from '@milaboratories/ts-helpers';\nimport type { PlRef } from '@platforma-sdk/model';\n\nexport function outputRef(blockId: string, name: string, requireEnrichments?: boolean): PlRef {\n if (requireEnrichments) return { __isRef: true, blockId, name, requireEnrichments };\n else return { __isRef: true, blockId, name };\n}\n\nexport function isBlockOutputReference(obj: unknown): obj is PlRef {\n return (\n typeof obj === 'object'\n && obj !== null\n && '__isRef' in obj\n && obj.__isRef === true\n && 'blockId' in obj\n && 'name' in obj\n );\n}\n\nfunction addAllReferencedBlocks(result: BlockUpstreams, node: unknown, allowed?: Set<string>) {\n const type = typeof node;\n switch (type) {\n case 'function':\n case 'bigint':\n case 'number':\n case 'string':\n case 'boolean':\n case 'symbol':\n case 'undefined':\n return;\n\n case 'object':\n if (node === null) return;\n\n if (isBlockOutputReference(node)) {\n if (allowed === undefined || allowed.has(node.blockId)) {\n result.upstreams.add(node.blockId);\n if (node.requireEnrichments)\n result.upstreamsRequiringEnrichments.add(node.blockId);\n } else result.missingReferences = true;\n } else if (Array.isArray(node)) {\n for (const child of node) addAllReferencedBlocks(result, child, allowed);\n } else {\n for (const [, child] of Object.entries(node as object))\n addAllReferencedBlocks(result, child, allowed);\n }\n\n return;\n\n default:\n assertNever(type);\n }\n}\n\nexport interface BlockUpstreams {\n /** All direct block dependencies */\n upstreams: Set<string>;\n /** Direct block dependencies which enrichments are also required by current block */\n upstreamsRequiringEnrichments: Set<string>;\n /** True if not-allowed references was encountered */\n missingReferences: boolean;\n}\n\n/** Extracts all resource ids referenced by args object. */\nexport function inferAllReferencedBlocks(args: unknown, allowed?: Set<string>): BlockUpstreams {\n const result = { upstreams: new Set<string>(), upstreamsRequiringEnrichments: new Set<string>(), missingReferences: false };\n addAllReferencedBlocks(result, args, allowed);\n return result;\n}\n"],"names":[],"mappings":";;SAGgB,SAAS,CAAC,OAAe,EAAE,IAAY,EAAE,kBAA4B,EAAA;AACnF,IACK,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;AAC9C;AAEM,SAAU,sBAAsB,CAAC,GAAY,EAAA;AACjD,IAAA,QACE,OAAO,GAAG,KAAK;AACZ,WAAA,GAAG,KAAK;AACR,WAAA,SAAS,IAAI;WACb,GAAG,CAAC,OAAO,KAAK;AAChB,WAAA,SAAS,IAAI;WACb,MAAM,IAAI,GAAG;AAEpB;AAEA,SAAS,sBAAsB,CAAC,MAAsB,EAAE,IAAa,EAAE,OAAqB,EAAA;AAC1F,IAAA,MAAM,IAAI,GAAG,OAAO,IAAI;IACxB,QAAQ,IAAI;AACV,QAAA,KAAK,UAAU;AACf,QAAA,KAAK,QAAQ;AACb,QAAA,KAAK,QAAQ;AACb,QAAA,KAAK,QAAQ;AACb,QAAA,KAAK,SAAS;AACd,QAAA,KAAK,QAAQ;AACb,QAAA,KAAK,WAAW;YACd;AAEF,QAAA,KAAK,QAAQ;YACX,IAAI,IAAI,KAAK,IAAI;gBAAE;AAEnB,YAAA,IAAI,sBAAsB,CAAC,IAAI,CAAC,EAAE;AAChC,gBAAA,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;oBACtD,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;oBAClC,IAAI,IAAI,CAAC,kBAAkB;wBACzB,MAAM,CAAC,6BAA6B,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;gBAC1D;;AAAO,oBAAA,MAAM,CAAC,iBAAiB,GAAG,IAAI;YACxC;AAAO,iBAAA,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBAC9B,KAAK,MAAM,KAAK,IAAI,IAAI;AAAE,oBAAA,sBAAsB,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC;YAC1E;iBAAO;gBACL,KAAK,MAAM,GAAG,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAc,CAAC;AACpD,oBAAA,sBAAsB,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC;YAClD;YAEA;AAEF,QAAA;YACE,WAAW,CAAC,IAAI,CAAC;;AAEvB;AAWA;AACM,SAAU,wBAAwB,CAAC,IAAa,EAAE,OAAqB,EAAA;AAC3E,IAAA,MAAM,MAAM,GAAG,EAAE,SAAS,EAAE,IAAI,GAAG,EAAU,EAAE,6BAA6B,EAAE,IAAI,GAAG,EAAU,EAAE,iBAAiB,EAAE,KAAK,EAAE;AAC3H,IAAA,sBAAsB,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC;AAC7C,IAAA,OAAO,MAAM;AACf;;;;"}
1
+ {"version":3,"file":"args.js","sources":["../../src/model/args.ts"],"sourcesContent":["import { assertNever } from \"@milaboratories/ts-helpers\";\nimport type { PlRef } from \"@platforma-sdk/model\";\n\nexport function outputRef(blockId: string, name: string, requireEnrichments?: boolean): PlRef {\n if (requireEnrichments) return { __isRef: true, blockId, name, requireEnrichments };\n else return { __isRef: true, blockId, name };\n}\n\nexport function isBlockOutputReference(obj: unknown): obj is PlRef {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n \"__isRef\" in obj &&\n obj.__isRef === true &&\n \"blockId\" in obj &&\n \"name\" in obj\n );\n}\n\nfunction addAllReferencedBlocks(result: BlockUpstreams, node: unknown, allowed?: Set<string>) {\n const type = typeof node;\n switch (type) {\n case \"function\":\n case \"bigint\":\n case \"number\":\n case \"string\":\n case \"boolean\":\n case \"symbol\":\n case \"undefined\":\n return;\n\n case \"object\":\n if (node === null) return;\n\n if (isBlockOutputReference(node)) {\n if (allowed === undefined || allowed.has(node.blockId)) {\n result.upstreams.add(node.blockId);\n if (node.requireEnrichments) result.upstreamsRequiringEnrichments.add(node.blockId);\n } else result.missingReferences = true;\n } else if (Array.isArray(node)) {\n for (const child of node) addAllReferencedBlocks(result, child, allowed);\n } else {\n for (const [, child] of Object.entries(node as object))\n addAllReferencedBlocks(result, child, allowed);\n }\n\n return;\n\n default:\n assertNever(type);\n }\n}\n\nexport interface BlockUpstreams {\n /** All direct block dependencies */\n upstreams: Set<string>;\n /** Direct block dependencies which enrichments are also required by current block */\n upstreamsRequiringEnrichments: Set<string>;\n /** True if not-allowed references was encountered */\n missingReferences: boolean;\n}\n\n/** Extracts all resource ids referenced by args object. */\nexport function inferAllReferencedBlocks(args: unknown, allowed?: Set<string>): BlockUpstreams {\n const result = {\n upstreams: new Set<string>(),\n upstreamsRequiringEnrichments: new Set<string>(),\n missingReferences: false,\n };\n addAllReferencedBlocks(result, args, allowed);\n return result;\n}\n"],"names":[],"mappings":";;SAGgB,SAAS,CAAC,OAAe,EAAE,IAAY,EAAE,kBAA4B,EAAA;AACnF,IACK,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;AAC9C;AAEM,SAAU,sBAAsB,CAAC,GAAY,EAAA;AACjD,IAAA,QACE,OAAO,GAAG,KAAK,QAAQ;AACvB,QAAA,GAAG,KAAK,IAAI;AACZ,QAAA,SAAS,IAAI,GAAG;QAChB,GAAG,CAAC,OAAO,KAAK,IAAI;AACpB,QAAA,SAAS,IAAI,GAAG;QAChB,MAAM,IAAI,GAAG;AAEjB;AAEA,SAAS,sBAAsB,CAAC,MAAsB,EAAE,IAAa,EAAE,OAAqB,EAAA;AAC1F,IAAA,MAAM,IAAI,GAAG,OAAO,IAAI;IACxB,QAAQ,IAAI;AACV,QAAA,KAAK,UAAU;AACf,QAAA,KAAK,QAAQ;AACb,QAAA,KAAK,QAAQ;AACb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 @@
1
- import type { BlockConfigContainer } from '@platforma-sdk/model';
2
- import type { BlockPackSpec } from '@milaboratories/pl-model-middle-layer';
1
+ import type { BlockConfigContainer } from "@platforma-sdk/model";
2
+ import type { BlockPackSpec } from "@milaboratories/pl-model-middle-layer";
3
3
  /** Define structure of block-pack data section */
4
4
  export interface BlockPackInfo {
5
5
  readonly source: BlockPackSpec;
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const FrontendFromUrlResourceType = { name: 'Frontend/FromUrl', version: '1' };
3
+ const FrontendFromUrlResourceType = { name: "Frontend/FromUrl", version: "1" };
4
4
  const FrontendFromFolderResourceType = {
5
- name: 'Frontend/FromFolder',
6
- version: '1',
5
+ name: "Frontend/FromFolder",
6
+ version: "1",
7
7
  };
8
8
 
9
9
  exports.FrontendFromFolderResourceType = FrontendFromFolderResourceType;
@@ -1 +1 @@
1
- {"version":3,"file":"block_pack_spec.cjs","sources":["../../src/model/block_pack_spec.ts"],"sourcesContent":["import type { ExplicitTemplate, PreparedTemplate } from './template_spec';\nimport type { ResourceType } from '@milaboratories/pl-client';\nimport type { BlockConfigContainer } from '@platforma-sdk/model';\nimport type { BlockPackSpec } from '@milaboratories/pl-model-middle-layer';\n\nexport type FrontendSpec = FrontendFromUrl | FrontendFromFolder;\n\nexport interface FrontendFromUrlData {\n url: string;\n}\n\nexport const FrontendFromUrlResourceType: ResourceType = { name: 'Frontend/FromUrl', version: '1' };\n\n/** Directs user of the block pack to download the contents from the URL\n * outside the pl infrastructure. */\nexport interface FrontendFromUrl extends FrontendFromUrlData {\n type: 'url';\n}\n\nexport interface FrontendFromFolderData {\n path: string;\n /** HMAC signature of the path using local secret encoded as hex. */\n signature: string;\n}\n\nexport const FrontendFromFolderResourceType: ResourceType = {\n name: 'Frontend/FromFolder',\n version: '1',\n};\n\n/** Directs user of the block pack to load frontend from specific local\n * folder. Signature allows to confirm that this is the same client who\n * added the resource. */\nexport interface FrontendFromFolder extends FrontendFromFolderData {\n type: 'local';\n}\n\n/** Direct instructions to create block-pack from client. Currently, this\n * is the only block-pack spec that can be directly materialized. */\nexport interface BlockPackExplicit {\n type: 'explicit';\n template: ExplicitTemplate;\n config: BlockConfigContainer;\n frontend: FrontendSpec;\n source: BlockPackSpec;\n}\n\n/** Block-pack spec that can be materialized in pl. */\nexport type BlockPackSpecPrepared = {\n type: 'prepared';\n template: PreparedTemplate;\n config: BlockConfigContainer;\n frontend: FrontendSpec;\n source: BlockPackSpec;\n};\n\n/** All block-pack specs. */\nexport type BlockPackSpecAny = BlockPackSpecPrepared | BlockPackExplicit | BlockPackSpec;\n"],"names":[],"mappings":";;AAWO,MAAM,2BAA2B,GAAiB,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,GAAG;AAc1F,MAAM,8BAA8B,GAAiB;AAC1D,IAAA,IAAI,EAAE,qBAAqB;AAC3B,IAAA,OAAO,EAAE,GAAG;;;;;;"}
1
+ {"version":3,"file":"block_pack_spec.cjs","sources":["../../src/model/block_pack_spec.ts"],"sourcesContent":["import type { ExplicitTemplate, PreparedTemplate } from \"./template_spec\";\nimport type { ResourceType } from \"@milaboratories/pl-client\";\nimport type { BlockConfigContainer } from \"@platforma-sdk/model\";\nimport type { BlockPackSpec } from \"@milaboratories/pl-model-middle-layer\";\n\nexport type FrontendSpec = FrontendFromUrl | FrontendFromFolder;\n\nexport interface FrontendFromUrlData {\n url: string;\n}\n\nexport const FrontendFromUrlResourceType: ResourceType = { name: \"Frontend/FromUrl\", version: \"1\" };\n\n/** Directs user of the block pack to download the contents from the URL\n * outside the pl infrastructure. */\nexport interface FrontendFromUrl extends FrontendFromUrlData {\n type: \"url\";\n}\n\nexport interface FrontendFromFolderData {\n path: string;\n /** HMAC signature of the path using local secret encoded as hex. */\n signature: string;\n}\n\nexport const FrontendFromFolderResourceType: ResourceType = {\n name: \"Frontend/FromFolder\",\n version: \"1\",\n};\n\n/** Directs user of the block pack to load frontend from specific local\n * folder. Signature allows to confirm that this is the same client who\n * added the resource. */\nexport interface FrontendFromFolder extends FrontendFromFolderData {\n type: \"local\";\n}\n\n/** Direct instructions to create block-pack from client. Currently, this\n * is the only block-pack spec that can be directly materialized. */\nexport interface BlockPackExplicit {\n type: \"explicit\";\n template: ExplicitTemplate;\n config: BlockConfigContainer;\n frontend: FrontendSpec;\n source: BlockPackSpec;\n}\n\n/** Block-pack spec that can be materialized in pl. */\nexport type BlockPackSpecPrepared = {\n type: \"prepared\";\n template: PreparedTemplate;\n config: BlockConfigContainer;\n frontend: FrontendSpec;\n source: BlockPackSpec;\n};\n\n/** All block-pack specs. */\nexport type BlockPackSpecAny = BlockPackSpecPrepared | BlockPackExplicit | BlockPackSpec;\n"],"names":[],"mappings":";;AAWO,MAAM,2BAA2B,GAAiB,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,GAAG;AAc1F,MAAM,8BAA8B,GAAiB;AAC1D,IAAA,IAAI,EAAE,qBAAqB;AAC3B,IAAA,OAAO,EAAE,GAAG;;;;;;"}
@@ -1,7 +1,7 @@
1
- import type { ExplicitTemplate, PreparedTemplate } from './template_spec';
2
- import type { ResourceType } from '@milaboratories/pl-client';
3
- import type { BlockConfigContainer } from '@platforma-sdk/model';
4
- import type { BlockPackSpec } from '@milaboratories/pl-model-middle-layer';
1
+ import type { ExplicitTemplate, PreparedTemplate } from "./template_spec";
2
+ import type { ResourceType } from "@milaboratories/pl-client";
3
+ import type { BlockConfigContainer } from "@platforma-sdk/model";
4
+ import type { BlockPackSpec } from "@milaboratories/pl-model-middle-layer";
5
5
  export type FrontendSpec = FrontendFromUrl | FrontendFromFolder;
6
6
  export interface FrontendFromUrlData {
7
7
  url: string;
@@ -10,7 +10,7 @@ export declare const FrontendFromUrlResourceType: ResourceType;
10
10
  /** Directs user of the block pack to download the contents from the URL
11
11
  * outside the pl infrastructure. */
12
12
  export interface FrontendFromUrl extends FrontendFromUrlData {
13
- type: 'url';
13
+ type: "url";
14
14
  }
15
15
  export interface FrontendFromFolderData {
16
16
  path: string;
@@ -22,12 +22,12 @@ export declare const FrontendFromFolderResourceType: ResourceType;
22
22
  * folder. Signature allows to confirm that this is the same client who
23
23
  * added the resource. */
24
24
  export interface FrontendFromFolder extends FrontendFromFolderData {
25
- type: 'local';
25
+ type: "local";
26
26
  }
27
27
  /** Direct instructions to create block-pack from client. Currently, this
28
28
  * is the only block-pack spec that can be directly materialized. */
29
29
  export interface BlockPackExplicit {
30
- type: 'explicit';
30
+ type: "explicit";
31
31
  template: ExplicitTemplate;
32
32
  config: BlockConfigContainer;
33
33
  frontend: FrontendSpec;
@@ -35,7 +35,7 @@ export interface BlockPackExplicit {
35
35
  }
36
36
  /** Block-pack spec that can be materialized in pl. */
37
37
  export type BlockPackSpecPrepared = {
38
- type: 'prepared';
38
+ type: "prepared";
39
39
  template: PreparedTemplate;
40
40
  config: BlockConfigContainer;
41
41
  frontend: FrontendSpec;
@@ -1,7 +1,7 @@
1
- const FrontendFromUrlResourceType = { name: 'Frontend/FromUrl', version: '1' };
1
+ const FrontendFromUrlResourceType = { name: "Frontend/FromUrl", version: "1" };
2
2
  const FrontendFromFolderResourceType = {
3
- name: 'Frontend/FromFolder',
4
- version: '1',
3
+ name: "Frontend/FromFolder",
4
+ version: "1",
5
5
  };
6
6
 
7
7
  export { FrontendFromFolderResourceType, FrontendFromUrlResourceType };
@@ -1 +1 @@
1
- {"version":3,"file":"block_pack_spec.js","sources":["../../src/model/block_pack_spec.ts"],"sourcesContent":["import type { ExplicitTemplate, PreparedTemplate } from './template_spec';\nimport type { ResourceType } from '@milaboratories/pl-client';\nimport type { BlockConfigContainer } from '@platforma-sdk/model';\nimport type { BlockPackSpec } from '@milaboratories/pl-model-middle-layer';\n\nexport type FrontendSpec = FrontendFromUrl | FrontendFromFolder;\n\nexport interface FrontendFromUrlData {\n url: string;\n}\n\nexport const FrontendFromUrlResourceType: ResourceType = { name: 'Frontend/FromUrl', version: '1' };\n\n/** Directs user of the block pack to download the contents from the URL\n * outside the pl infrastructure. */\nexport interface FrontendFromUrl extends FrontendFromUrlData {\n type: 'url';\n}\n\nexport interface FrontendFromFolderData {\n path: string;\n /** HMAC signature of the path using local secret encoded as hex. */\n signature: string;\n}\n\nexport const FrontendFromFolderResourceType: ResourceType = {\n name: 'Frontend/FromFolder',\n version: '1',\n};\n\n/** Directs user of the block pack to load frontend from specific local\n * folder. Signature allows to confirm that this is the same client who\n * added the resource. */\nexport interface FrontendFromFolder extends FrontendFromFolderData {\n type: 'local';\n}\n\n/** Direct instructions to create block-pack from client. Currently, this\n * is the only block-pack spec that can be directly materialized. */\nexport interface BlockPackExplicit {\n type: 'explicit';\n template: ExplicitTemplate;\n config: BlockConfigContainer;\n frontend: FrontendSpec;\n source: BlockPackSpec;\n}\n\n/** Block-pack spec that can be materialized in pl. */\nexport type BlockPackSpecPrepared = {\n type: 'prepared';\n template: PreparedTemplate;\n config: BlockConfigContainer;\n frontend: FrontendSpec;\n source: BlockPackSpec;\n};\n\n/** All block-pack specs. */\nexport type BlockPackSpecAny = BlockPackSpecPrepared | BlockPackExplicit | BlockPackSpec;\n"],"names":[],"mappings":"AAWO,MAAM,2BAA2B,GAAiB,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,GAAG;AAc1F,MAAM,8BAA8B,GAAiB;AAC1D,IAAA,IAAI,EAAE,qBAAqB;AAC3B,IAAA,OAAO,EAAE,GAAG;;;;;"}
1
+ {"version":3,"file":"block_pack_spec.js","sources":["../../src/model/block_pack_spec.ts"],"sourcesContent":["import type { ExplicitTemplate, PreparedTemplate } from \"./template_spec\";\nimport type { ResourceType } from \"@milaboratories/pl-client\";\nimport type { BlockConfigContainer } from \"@platforma-sdk/model\";\nimport type { BlockPackSpec } from \"@milaboratories/pl-model-middle-layer\";\n\nexport type FrontendSpec = FrontendFromUrl | FrontendFromFolder;\n\nexport interface FrontendFromUrlData {\n url: string;\n}\n\nexport const FrontendFromUrlResourceType: ResourceType = { name: \"Frontend/FromUrl\", version: \"1\" };\n\n/** Directs user of the block pack to download the contents from the URL\n * outside the pl infrastructure. */\nexport interface FrontendFromUrl extends FrontendFromUrlData {\n type: \"url\";\n}\n\nexport interface FrontendFromFolderData {\n path: string;\n /** HMAC signature of the path using local secret encoded as hex. */\n signature: string;\n}\n\nexport const FrontendFromFolderResourceType: ResourceType = {\n name: \"Frontend/FromFolder\",\n version: \"1\",\n};\n\n/** Directs user of the block pack to load frontend from specific local\n * folder. Signature allows to confirm that this is the same client who\n * added the resource. */\nexport interface FrontendFromFolder extends FrontendFromFolderData {\n type: \"local\";\n}\n\n/** Direct instructions to create block-pack from client. Currently, this\n * is the only block-pack spec that can be directly materialized. */\nexport interface BlockPackExplicit {\n type: \"explicit\";\n template: ExplicitTemplate;\n config: BlockConfigContainer;\n frontend: FrontendSpec;\n source: BlockPackSpec;\n}\n\n/** Block-pack spec that can be materialized in pl. */\nexport type BlockPackSpecPrepared = {\n type: \"prepared\";\n template: PreparedTemplate;\n config: BlockConfigContainer;\n frontend: FrontendSpec;\n source: BlockPackSpec;\n};\n\n/** All block-pack specs. */\nexport type BlockPackSpecAny = BlockPackSpecPrepared | BlockPackExplicit | BlockPackSpec;\n"],"names":[],"mappings":"AAWO,MAAM,2BAA2B,GAAiB,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,GAAG;AAc1F,MAAM,8BAA8B,GAAiB;AAC1D,IAAA,IAAI,EAAE,qBAAqB;AAC3B,IAAA,OAAO,EAAE,GAAG;;;;;"}
@@ -23,7 +23,7 @@ function parseBlockStorage(rawData) {
23
23
  return model.createBlockStorage({});
24
24
  }
25
25
  // If it's a string, parse it first
26
- if (typeof rawData === 'string') {
26
+ if (typeof rawData === "string") {
27
27
  try {
28
28
  const parsed = JSON.parse(rawData);
29
29
  return model.normalizeBlockStorage(parsed);
@@ -99,14 +99,14 @@ function migrateBlockStorage(storage, fromVersion, toVersion, handlers = model.d
99
99
  * @returns true if data is in legacy format
100
100
  */
101
101
  function isLegacyV1V2Format(rawData) {
102
- if (rawData === null || typeof rawData !== 'object')
102
+ if (rawData === null || typeof rawData !== "object")
103
103
  return false;
104
104
  // If it has the discriminator, it's BlockStorage format
105
105
  if (model.isBlockStorage(rawData))
106
106
  return false;
107
107
  const obj = rawData;
108
108
  // Legacy format has 'args' and/or 'uiState' at top level, no discriminator
109
- return ('args' in obj || 'uiState' in obj);
109
+ return "args" in obj || "uiState" in obj;
110
110
  }
111
111
  /**
112
112
  * Converts legacy V1/V2 format to BlockStorage.
@@ -133,7 +133,7 @@ function parseBlockStorageSmart(rawData) {
133
133
  }
134
134
  // If it's a string, parse it first
135
135
  let parsed = rawData;
136
- if (typeof rawData === 'string') {
136
+ if (typeof rawData === "string") {
137
137
  try {
138
138
  parsed = JSON.parse(rawData);
139
139
  }
@@ -1 +1 @@
1
- {"version":3,"file":"block_storage_helper.cjs","sources":["../../src/model/block_storage_helper.ts"],"sourcesContent":["/**\n * Block Storage Helper - Middle layer utilities for BlockStorage operations.\n *\n * This module provides the bridge between the SDK's BlockStorage abstraction\n * and the middle layer's storage operations. Block developers never interact\n * with this - they only see `state`.\n *\n * @module block_storage_helper\n */\n\nimport type {\n BlockStorage,\n BlockStorageHandlers,\n} from '@platforma-sdk/model';\nimport {\n BLOCK_STORAGE_KEY,\n BLOCK_STORAGE_SCHEMA_VERSION,\n createBlockStorage,\n defaultBlockStorageHandlers,\n getPluginData,\n getStorageData,\n getStorageDataVersion,\n isBlockStorage,\n normalizeBlockStorage,\n setPluginData,\n updateStorageData,\n updateStorageDataVersion,\n} from '@platforma-sdk/model';\n\n// Re-export types for convenience\nexport type { BlockStorage, BlockStorageHandlers };\n\n// Re-export utilities that middle layer needs\nexport {\n BLOCK_STORAGE_KEY,\n BLOCK_STORAGE_SCHEMA_VERSION,\n createBlockStorage,\n defaultBlockStorageHandlers,\n getPluginData,\n getStorageData,\n getStorageDataVersion,\n isBlockStorage,\n normalizeBlockStorage,\n setPluginData,\n updateStorageData,\n updateStorageDataVersion,\n};\n\n/**\n * Parses raw blockStorage data (from resource tree) into BlockStorage.\n * Handles both legacy format (raw state) and new format (BlockStorage).\n *\n * @param rawData - Raw data from blockStorage field (may be string or parsed object)\n * @returns Normalized BlockStorage object\n */\nexport function parseBlockStorage<TState = unknown>(rawData: unknown): BlockStorage<TState> {\n if (rawData === undefined || rawData === null) {\n return createBlockStorage<TState>({} as TState);\n }\n\n // If it's a string, parse it first\n if (typeof rawData === 'string') {\n try {\n const parsed = JSON.parse(rawData);\n return normalizeBlockStorage<TState>(parsed);\n } catch {\n // If parsing fails, treat the string as the state itself\n return createBlockStorage(rawData as unknown as TState);\n }\n }\n\n return normalizeBlockStorage<TState>(rawData);\n}\n\n/**\n * Extracts the user-facing data from BlockStorage.\n * This is what block developers see in their .args() callbacks.\n *\n * @param storage - The BlockStorage object\n * @returns The data value that developers work with\n */\nexport function extractDataForDeveloper<TState>(storage: BlockStorage<TState>): TState {\n return getStorageData(storage);\n}\n\n/**\n * Creates a new BlockStorage with updated state.\n * Used when setState is called from the frontend.\n *\n * @param currentStorage - Current BlockStorage (or undefined for new blocks)\n * @param newState - New state from developer\n * @param handlers - Optional custom handlers (defaults to standard handlers)\n * @returns Updated BlockStorage\n */\nexport function applyStateUpdate<TState>(\n currentStorage: BlockStorage<TState> | undefined,\n newState: TState,\n handlers: BlockStorageHandlers<TState> = defaultBlockStorageHandlers as BlockStorageHandlers<TState>,\n): BlockStorage<TState> {\n const storage = currentStorage ?? createBlockStorage<TState>({} as TState);\n const transform = handlers.transformStateForStorage ?? defaultBlockStorageHandlers.transformStateForStorage;\n return transform(storage, newState) as BlockStorage<TState>;\n}\n\n/**\n * Serializes BlockStorage for writing to the resource tree.\n *\n * @param storage - The BlockStorage to serialize\n * @returns JSON string\n */\nexport function serializeBlockStorage(storage: BlockStorage): string {\n return JSON.stringify(storage);\n}\n\n/**\n * Checks if the storage needs migration based on version key.\n *\n * @param storage - Current BlockStorage\n * @param targetVersion - Target version key\n * @returns true if migration is needed\n */\nexport function needsMigration(storage: BlockStorage, targetVersion: string): boolean {\n return getStorageDataVersion(storage) !== targetVersion;\n}\n\n/**\n * Migrates BlockStorage from one version to another.\n *\n * @param storage - Current BlockStorage\n * @param fromVersion - Source version key\n * @param toVersion - Target version key\n * @param handlers - Optional custom handlers\n * @returns Migrated BlockStorage\n */\nexport function migrateBlockStorage<TState>(\n storage: BlockStorage<TState>,\n fromVersion: string,\n toVersion: string,\n handlers: BlockStorageHandlers<TState> = defaultBlockStorageHandlers as BlockStorageHandlers<TState>,\n): BlockStorage<TState> {\n const migrate = handlers.migrateStorage ?? defaultBlockStorageHandlers.migrateStorage;\n return migrate(storage, fromVersion, toVersion) as BlockStorage<TState>;\n}\n\n/**\n * V1/V2 legacy format - state stored as { args, uiState }\n */\nexport interface LegacyV1V2State {\n args?: unknown;\n uiState?: unknown;\n}\n\n/**\n * Checks if the raw data is in legacy V1/V2 format.\n * V1/V2 blocks stored { args, uiState } directly, not wrapped in BlockStorage.\n *\n * @param rawData - Raw data from blockStorage field\n * @returns true if data is in legacy format\n */\nexport function isLegacyV1V2Format(rawData: unknown): rawData is LegacyV1V2State {\n if (rawData === null || typeof rawData !== 'object') return false;\n // If it has the discriminator, it's BlockStorage format\n if (isBlockStorage(rawData)) return false;\n\n const obj = rawData as Record<string, unknown>;\n // Legacy format has 'args' and/or 'uiState' at top level, no discriminator\n return ('args' in obj || 'uiState' in obj);\n}\n\n/**\n * Converts legacy V1/V2 format to BlockStorage.\n * For backward compatibility with existing blocks.\n *\n * @param legacyData - Data in { args, uiState } format\n * @returns BlockStorage with legacy data as state\n */\nexport function convertLegacyToBlockStorage(legacyData: LegacyV1V2State): BlockStorage<LegacyV1V2State> {\n return createBlockStorage(legacyData);\n}\n\n/**\n * Smart parser that handles all storage formats:\n * - New BlockStorage format\n * - Legacy V1/V2 format ({ args, uiState })\n * - Raw state (any other format)\n *\n * @param rawData - Raw data from blockStorage field\n * @returns Normalized BlockStorage\n */\nexport function parseBlockStorageSmart<TState = unknown>(rawData: unknown): BlockStorage<TState> {\n if (rawData === undefined || rawData === null) {\n return createBlockStorage<TState>({} as TState);\n }\n\n // If it's a string, parse it first\n let parsed = rawData;\n if (typeof rawData === 'string') {\n try {\n parsed = JSON.parse(rawData);\n } catch {\n // If parsing fails, treat the string as the state itself\n return createBlockStorage(rawData as unknown as TState);\n }\n }\n\n // Check for legacy V1/V2 format\n if (isLegacyV1V2Format(parsed)) {\n return convertLegacyToBlockStorage(parsed) as unknown as BlockStorage<TState>;\n }\n\n // Use standard normalization\n return normalizeBlockStorage<TState>(parsed);\n}\n"],"names":["createBlockStorage","normalizeBlockStorage","getStorageData","defaultBlockStorageHandlers","getStorageDataVersion","isBlockStorage"],"mappings":";;;;AAAA;;;;;;;;AAQG;AAwCH;;;;;;AAMG;AACG,SAAU,iBAAiB,CAAmB,OAAgB,EAAA;IAClE,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,IAAI,EAAE;AAC7C,QAAA,OAAOA,wBAAkB,CAAS,EAAY,CAAC;IACjD;;AAGA,IAAA,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AAC/B,QAAA,IAAI;YACF,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;AAClC,YAAA,OAAOC,2BAAqB,CAAS,MAAM,CAAC;QAC9C;AAAE,QAAA,MAAM;;AAEN,YAAA,OAAOD,wBAAkB,CAAC,OAA4B,CAAC;QACzD;IACF;AAEA,IAAA,OAAOC,2BAAqB,CAAS,OAAO,CAAC;AAC/C;AAEA;;;;;;AAMG;AACG,SAAU,uBAAuB,CAAS,OAA6B,EAAA;AAC3E,IAAA,OAAOC,oBAAc,CAAC,OAAO,CAAC;AAChC;AAEA;;;;;;;;AAQG;AACG,SAAU,gBAAgB,CAC9B,cAAgD,EAChD,QAAgB,EAChB,WAAyCC,iCAA2D,EAAA;IAEpG,MAAM,OAAO,GAAG,cAAc,IAAIH,wBAAkB,CAAS,EAAY,CAAC;IAC1E,MAAM,SAAS,GAAG,QAAQ,CAAC,w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,IAAA,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AAC/B,QAAA,IAAI;AACF,YAAA,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;QAC9B;AAAE,QAAA,MAAM;;AAEN,YAAA,OAAOA,wBAAkB,CAAC,OAA4B,CAAC;QACzD;IACF;;AAGA,IAAA,IAAI,kBAAkB,CAAC,MAAM,CAAC,EAAE;AAC9B,QAAA,OAAO,2BAA2B,CAAC,MAAM,CAAoC;IAC/E;;AAGA,IAAA,OAAOC,2BAAqB,CAAS,MAAM,CAAC;AAC9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"block_storage_helper.cjs","sources":["../../src/model/block_storage_helper.ts"],"sourcesContent":["/**\n * Block Storage Helper - Middle layer utilities for BlockStorage operations.\n *\n * This module provides the bridge between the SDK's BlockStorage abstraction\n * and the middle layer's storage operations. Block developers never interact\n * with this - they only see `state`.\n *\n * @module block_storage_helper\n */\n\nimport type { BlockStorage, BlockStorageHandlers } from \"@platforma-sdk/model\";\nimport {\n BLOCK_STORAGE_KEY,\n BLOCK_STORAGE_SCHEMA_VERSION,\n createBlockStorage,\n defaultBlockStorageHandlers,\n getPluginData,\n getStorageData,\n getStorageDataVersion,\n isBlockStorage,\n normalizeBlockStorage,\n setPluginData,\n updateStorageData,\n updateStorageDataVersion,\n} from \"@platforma-sdk/model\";\n\n// Re-export types for convenience\nexport type { BlockStorage, BlockStorageHandlers };\n\n// Re-export utilities that middle layer needs\nexport {\n BLOCK_STORAGE_KEY,\n BLOCK_STORAGE_SCHEMA_VERSION,\n createBlockStorage,\n defaultBlockStorageHandlers,\n getPluginData,\n getStorageData,\n getStorageDataVersion,\n isBlockStorage,\n normalizeBlockStorage,\n setPluginData,\n updateStorageData,\n updateStorageDataVersion,\n};\n\n/**\n * Parses raw blockStorage data (from resource tree) into BlockStorage.\n * Handles both legacy format (raw state) and new format (BlockStorage).\n *\n * @param rawData - Raw data from blockStorage field (may be string or parsed object)\n * @returns Normalized BlockStorage object\n */\nexport function parseBlockStorage<TState = unknown>(rawData: unknown): BlockStorage<TState> {\n if (rawData === undefined || rawData === null) {\n return createBlockStorage<TState>({} as TState);\n }\n\n // If it's a string, parse it first\n if (typeof rawData === \"string\") {\n try {\n const parsed = JSON.parse(rawData);\n return normalizeBlockStorage<TState>(parsed);\n } catch {\n // If parsing fails, treat the string as the state itself\n return createBlockStorage(rawData as unknown as TState);\n }\n }\n\n return normalizeBlockStorage<TState>(rawData);\n}\n\n/**\n * Extracts the user-facing data from BlockStorage.\n * This is what block developers see in their .args() callbacks.\n *\n * @param storage - The BlockStorage object\n * @returns The data value that developers work with\n */\nexport function extractDataForDeveloper<TState>(storage: BlockStorage<TState>): TState {\n return getStorageData(storage);\n}\n\n/**\n * Creates a new BlockStorage with updated state.\n * Used when setState is called from the frontend.\n *\n * @param currentStorage - Current BlockStorage (or undefined for new blocks)\n * @param newState - New state from developer\n * @param handlers - Optional custom handlers (defaults to standard handlers)\n * @returns Updated BlockStorage\n */\nexport function applyStateUpdate<TState>(\n currentStorage: BlockStorage<TState> | undefined,\n newState: TState,\n handlers: BlockStorageHandlers<TState> = defaultBlockStorageHandlers as BlockStorageHandlers<TState>,\n): BlockStorage<TState> {\n const storage = currentStorage ?? createBlockStorage<TState>({} as TState);\n const transform =\n handlers.transformStateForStorage ?? defaultBlockStorageHandlers.transformStateForStorage;\n return transform(storage, newState) as BlockStorage<TState>;\n}\n\n/**\n * Serializes BlockStorage for writing to the resource tree.\n *\n * @param storage - The BlockStorage to serialize\n * @returns JSON string\n */\nexport function serializeBlockStorage(storage: BlockStorage): string {\n return JSON.stringify(storage);\n}\n\n/**\n * Checks if the storage needs migration based on version key.\n *\n * @param storage - Current BlockStorage\n * @param targetVersion - Target version key\n * @returns true if migration is needed\n */\nexport function needsMigration(storage: BlockStorage, targetVersion: string): boolean {\n return getStorageDataVersion(storage) !== targetVersion;\n}\n\n/**\n * Migrates BlockStorage from one version to another.\n *\n * @param storage - Current BlockStorage\n * @param fromVersion - Source version key\n * @param toVersion - Target version key\n * @param handlers - Optional custom handlers\n * @returns Migrated BlockStorage\n */\nexport function migrateBlockStorage<TState>(\n storage: BlockStorage<TState>,\n fromVersion: string,\n toVersion: string,\n handlers: BlockStorageHandlers<TState> = defaultBlockStorageHandlers as BlockStorageHandlers<TState>,\n): BlockStorage<TState> {\n const migrate = handlers.migrateStorage ?? defaultBlockStorageHandlers.migrateStorage;\n return migrate(storage, fromVersion, toVersion) as BlockStorage<TState>;\n}\n\n/**\n * V1/V2 legacy format - state stored as { args, uiState }\n */\nexport interface LegacyV1V2State {\n args?: unknown;\n uiState?: unknown;\n}\n\n/**\n * Checks if the raw data is in legacy V1/V2 format.\n * V1/V2 blocks stored { args, uiState } directly, not wrapped in BlockStorage.\n *\n * @param rawData - Raw data from blockStorage field\n * @returns true if data is in legacy format\n */\nexport function isLegacyV1V2Format(rawData: unknown): rawData is LegacyV1V2State {\n if (rawData === null || typeof rawData !== \"object\") return false;\n // If it has the discriminator, it's BlockStorage format\n if (isBlockStorage(rawData)) return false;\n\n const obj = rawData as Record<string, unknown>;\n // Legacy format has 'args' and/or 'uiState' at top level, no discriminator\n return \"args\" in obj || \"uiState\" in obj;\n}\n\n/**\n * Converts legacy V1/V2 format to BlockStorage.\n * For backward compatibility with existing blocks.\n *\n * @param legacyData - Data in { args, uiState } format\n * @returns BlockStorage with legacy data as state\n */\nexport function convertLegacyToBlockStorage(\n legacyData: LegacyV1V2State,\n): BlockStorage<LegacyV1V2State> {\n return createBlockStorage(legacyData);\n}\n\n/**\n * Smart parser that handles all storage formats:\n * - New BlockStorage format\n * - Legacy V1/V2 format ({ args, uiState })\n * - Raw state (any other format)\n *\n * @param rawData - Raw data from blockStorage field\n * @returns Normalized BlockStorage\n */\nexport function parseBlockStorageSmart<TState = unknown>(rawData: unknown): BlockStorage<TState> {\n if (rawData === undefined || rawData === null) {\n return createBlockStorage<TState>({} as TState);\n }\n\n // If it's a string, parse it first\n let parsed = rawData;\n if (typeof rawData === \"string\") {\n try {\n parsed = JSON.parse(rawData);\n } catch {\n // If parsing fails, treat the string as the state itself\n return createBlockStorage(rawData as unknown as TState);\n }\n }\n\n // Check for legacy V1/V2 format\n if (isLegacyV1V2Format(parsed)) {\n return convertLegacyToBlockStorage(parsed) as unknown as BlockStorage<TState>;\n }\n\n // Use standard normalization\n return normalizeBlockStorage<TState>(parsed);\n}\n"],"names":["createBlockStorage","normalizeBlockStorage","getStorageData","defaultBlockStorageHandlers","getStorageDataVersion","isBlockStorage"],"mappings":";;;;AAAA;;;;;;;;AAQG;AAqCH;;;;;;AAMG;AACG,SAAU,iBAAiB,CAAmB,OAAgB,EAAA;IAClE,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,IAAI,EAAE;AAC7C,QAAA,OAAOA,wBAAkB,CAAS,EAAY,CAAC;IACjD;;AAGA,IAAA,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AAC/B,QAAA,IAAI;YACF,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;AAClC,YAAA,OAAOC,2BAAqB,CAAS,MAAM,CAAC;QAC9C;AAAE,QAAA,MAAM;;AAEN,YAAA,OAAOD,wBAAkB,CAAC,OAA4B,CAAC;QACzD;IACF;AAEA,IAAA,OAAOC,2BAAqB,CAAS,OAAO,CAAC;AAC/C;AAEA;;;;;;AAMG;AACG,SAAU,uBAAuB,CAAS,OAA6B,EAAA;AAC3E,IAAA,OAAOC,oBAAc,CAAC,OAAO,CAAC;AAChC;AAEA;;;;;;;;AAQG;AACG,SAAU,gBAAgB,CAC9B,cAAgD,EAChD,QAAgB,EAChB,WAAyCC,iCAA2D,EAAA;IAEpG,MAAM,OAAO,GAAG,cAAc,IAAIH,wBAAkB,CAAS,EAAY,CAAC;IAC1E,MAAM,SAAS,GACb,QAAQ,CAAC,wBAAwB,IAAIG,iCAA2B,CA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OAAO,KAAK,QAAQ,EAAE;AAC/B,QAAA,IAAI;AACF,YAAA,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;QAC9B;AAAE,QAAA,MAAM;;AAEN,YAAA,OAAOA,wBAAkB,CAAC,OAA4B,CAAC;QACzD;IACF;;AAGA,IAAA,IAAI,kBAAkB,CAAC,MAAM,CAAC,EAAE;AAC9B,QAAA,OAAO,2BAA2B,CAAC,MAAM,CAAoC;IAC/E;;AAGA,IAAA,OAAOC,2BAAqB,CAAS,MAAM,CAAC;AAC9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -7,8 +7,8 @@
7
7
  *
8
8
  * @module block_storage_helper
9
9
  */
10
- import type { BlockStorage, BlockStorageHandlers } from '@platforma-sdk/model';
11
- import { BLOCK_STORAGE_KEY, BLOCK_STORAGE_SCHEMA_VERSION, createBlockStorage, defaultBlockStorageHandlers, getPluginData, getStorageData, getStorageDataVersion, isBlockStorage, normalizeBlockStorage, setPluginData, updateStorageData, updateStorageDataVersion } from '@platforma-sdk/model';
10
+ import type { BlockStorage, BlockStorageHandlers } from "@platforma-sdk/model";
11
+ import { BLOCK_STORAGE_KEY, BLOCK_STORAGE_SCHEMA_VERSION, createBlockStorage, defaultBlockStorageHandlers, getPluginData, getStorageData, getStorageDataVersion, isBlockStorage, normalizeBlockStorage, setPluginData, updateStorageData, updateStorageDataVersion } from "@platforma-sdk/model";
12
12
  export type { BlockStorage, BlockStorageHandlers };
13
13
  export { BLOCK_STORAGE_KEY, BLOCK_STORAGE_SCHEMA_VERSION, createBlockStorage, defaultBlockStorageHandlers, getPluginData, getStorageData, getStorageDataVersion, isBlockStorage, normalizeBlockStorage, setPluginData, updateStorageData, updateStorageDataVersion, };
14
14
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"block_storage_helper.d.ts","sourceRoot":"","sources":["../../src/model/block_storage_helper.ts"],"names":[],"mappings":"AAAA;;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,CAAC,MAAM,CAAC,EAC7B,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,oBAAoB,CAAC,MAAM,CAA+D,GACnG,YAAY,CAAC,MAAM,CAAC,CAGtB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,eAAe,CAQ/E;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,eAAe,GAAG,YAAY,CAAC,eAAe,CAAC,CAEtG;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,GAAG,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,CAuB/F"}
1
+ {"version":3,"file":"block_storage_helper.d.ts","sourceRoot":"","sources":["../../src/model/block_storage_helper.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC5B,kBAAkB,EAClB,2BAA2B,EAC3B,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,sBAAsB,CAAC;AAG9B,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,CAAC;AAGnD,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC5B,kBAAkB,EAClB,2BAA2B,EAC3B,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,wBAAwB,GACzB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB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O,GAAG,YAAY,CAAC,MAAM,CAAC,CAuB/F"}
@@ -22,7 +22,7 @@ function parseBlockStorage(rawData) {
22
22
  return createBlockStorage({});
23
23
  }
24
24
  // If it's a string, parse it first
25
- if (typeof rawData === 'string') {
25
+ if (typeof rawData === "string") {
26
26
  try {
27
27
  const parsed = JSON.parse(rawData);
28
28
  return normalizeBlockStorage(parsed);
@@ -98,14 +98,14 @@ function migrateBlockStorage(storage, fromVersion, toVersion, handlers = default
98
98
  * @returns true if data is in legacy format
99
99
  */
100
100
  function isLegacyV1V2Format(rawData) {
101
- if (rawData === null || typeof rawData !== 'object')
101
+ if (rawData === null || typeof rawData !== "object")
102
102
  return false;
103
103
  // If it has the discriminator, it's BlockStorage format
104
104
  if (isBlockStorage(rawData))
105
105
  return false;
106
106
  const obj = rawData;
107
107
  // Legacy format has 'args' and/or 'uiState' at top level, no discriminator
108
- return ('args' in obj || 'uiState' in obj);
108
+ return "args" in obj || "uiState" in obj;
109
109
  }
110
110
  /**
111
111
  * Converts legacy V1/V2 format to BlockStorage.
@@ -132,7 +132,7 @@ function parseBlockStorageSmart(rawData) {
132
132
  }
133
133
  // If it's a string, parse it first
134
134
  let parsed = rawData;
135
- if (typeof rawData === 'string') {
135
+ if (typeof rawData === "string") {
136
136
  try {
137
137
  parsed = JSON.parse(rawData);
138
138
  }
@@ -1 +1 @@
1
- {"version":3,"file":"block_storage_helper.js","sources":["../../src/model/block_storage_helper.ts"],"sourcesContent":["/**\n * Block Storage Helper - Middle layer utilities for BlockStorage operations.\n *\n * This module provides the bridge between the SDK's BlockStorage abstraction\n * and the middle layer's storage operations. Block developers never interact\n * with this - they only see `state`.\n *\n * @module block_storage_helper\n */\n\nimport type {\n BlockStorage,\n BlockStorageHandlers,\n} from '@platforma-sdk/model';\nimport {\n BLOCK_STORAGE_KEY,\n BLOCK_STORAGE_SCHEMA_VERSION,\n createBlockStorage,\n defaultBlockStorageHandlers,\n getPluginData,\n getStorageData,\n getStorageDataVersion,\n isBlockStorage,\n normalizeBlockStorage,\n setPluginData,\n updateStorageData,\n updateStorageDataVersion,\n} from '@platforma-sdk/model';\n\n// Re-export types for convenience\nexport type { BlockStorage, BlockStorageHandlers };\n\n// Re-export utilities that middle layer needs\nexport {\n BLOCK_STORAGE_KEY,\n BLOCK_STORAGE_SCHEMA_VERSION,\n createBlockStorage,\n defaultBlockStorageHandlers,\n getPluginData,\n getStorageData,\n getStorageDataVersion,\n isBlockStorage,\n normalizeBlockStorage,\n setPluginData,\n updateStorageData,\n updateStorageDataVersion,\n};\n\n/**\n * Parses raw blockStorage data (from resource tree) into BlockStorage.\n * Handles both legacy format (raw state) and new format (BlockStorage).\n *\n * @param rawData - Raw data from blockStorage field (may be string or parsed object)\n * @returns Normalized BlockStorage object\n */\nexport function parseBlockStorage<TState = unknown>(rawData: unknown): BlockStorage<TState> {\n if (rawData === undefined || rawData === null) {\n return createBlockStorage<TState>({} as TState);\n }\n\n // If it's a string, parse it first\n if (typeof rawData === 'string') {\n try {\n const parsed = JSON.parse(rawData);\n return normalizeBlockStorage<TState>(parsed);\n } catch {\n // If parsing fails, treat the string as the state itself\n return createBlockStorage(rawData as unknown as TState);\n }\n }\n\n return normalizeBlockStorage<TState>(rawData);\n}\n\n/**\n * Extracts the user-facing data from BlockStorage.\n * This is what block developers see in their .args() callbacks.\n *\n * @param storage - The BlockStorage object\n * @returns The data value that developers work with\n */\nexport function extractDataForDeveloper<TState>(storage: BlockStorage<TState>): TState {\n return getStorageData(storage);\n}\n\n/**\n * Creates a new BlockStorage with updated state.\n * Used when setState is called from the frontend.\n *\n * @param currentStorage - Current BlockStorage (or undefined for new blocks)\n * @param newState - New state from developer\n * @param handlers - Optional custom handlers (defaults to standard handlers)\n * @returns Updated BlockStorage\n */\nexport function applyStateUpdate<TState>(\n currentStorage: BlockStorage<TState> | undefined,\n newState: TState,\n handlers: BlockStorageHandlers<TState> = defaultBlockStorageHandlers as BlockStorageHandlers<TState>,\n): BlockStorage<TState> {\n const storage = currentStorage ?? createBlockStorage<TState>({} as TState);\n const transform = handlers.transformStateForStorage ?? defaultBlockStorageHandlers.transformStateForStorage;\n return transform(storage, newState) as BlockStorage<TState>;\n}\n\n/**\n * Serializes BlockStorage for writing to the resource tree.\n *\n * @param storage - The BlockStorage to serialize\n * @returns JSON string\n */\nexport function serializeBlockStorage(storage: BlockStorage): string {\n return JSON.stringify(storage);\n}\n\n/**\n * Checks if the storage needs migration based on version key.\n *\n * @param storage - Current BlockStorage\n * @param targetVersion - Target version key\n * @returns true if migration is needed\n */\nexport function needsMigration(storage: BlockStorage, targetVersion: string): boolean {\n return getStorageDataVersion(storage) !== targetVersion;\n}\n\n/**\n * Migrates BlockStorage from one version to another.\n *\n * @param storage - Current BlockStorage\n * @param fromVersion - Source version key\n * @param toVersion - Target version key\n * @param handlers - Optional custom handlers\n * @returns Migrated BlockStorage\n */\nexport function migrateBlockStorage<TState>(\n storage: BlockStorage<TState>,\n fromVersion: string,\n toVersion: string,\n handlers: BlockStorageHandlers<TState> = defaultBlockStorageHandlers as BlockStorageHandlers<TState>,\n): BlockStorage<TState> {\n const migrate = handlers.migrateStorage ?? defaultBlockStorageHandlers.migrateStorage;\n return migrate(storage, fromVersion, toVersion) as BlockStorage<TState>;\n}\n\n/**\n * V1/V2 legacy format - state stored as { args, uiState }\n */\nexport interface LegacyV1V2State {\n args?: unknown;\n uiState?: unknown;\n}\n\n/**\n * Checks if the raw data is in legacy V1/V2 format.\n * V1/V2 blocks stored { args, uiState } directly, not wrapped in BlockStorage.\n *\n * @param rawData - Raw data from blockStorage field\n * @returns true if data is in legacy format\n */\nexport function isLegacyV1V2Format(rawData: unknown): rawData is LegacyV1V2State {\n if (rawData === null || typeof rawData !== 'object') return false;\n // If it has the discriminator, it's BlockStorage format\n if (isBlockStorage(rawData)) return false;\n\n const obj = rawData as Record<string, unknown>;\n // Legacy format has 'args' and/or 'uiState' at top level, no discriminator\n return ('args' in obj || 'uiState' in obj);\n}\n\n/**\n * Converts legacy V1/V2 format to BlockStorage.\n * For backward compatibility with existing blocks.\n *\n * @param legacyData - Data in { args, uiState } format\n * @returns BlockStorage with legacy data as state\n */\nexport function convertLegacyToBlockStorage(legacyData: LegacyV1V2State): BlockStorage<LegacyV1V2State> {\n return createBlockStorage(legacyData);\n}\n\n/**\n * Smart parser that handles all storage formats:\n * - New BlockStorage format\n * - Legacy V1/V2 format ({ args, uiState })\n * - Raw state (any other format)\n *\n * @param rawData - Raw data from blockStorage field\n * @returns Normalized BlockStorage\n */\nexport function parseBlockStorageSmart<TState = unknown>(rawData: unknown): BlockStorage<TState> {\n if (rawData === undefined || rawData === null) {\n return createBlockStorage<TState>({} as TState);\n }\n\n // If it's a string, parse it first\n let parsed = rawData;\n if (typeof rawData === 'string') {\n try {\n parsed = JSON.parse(rawData);\n } catch {\n // If parsing fails, treat the string as the state itself\n return createBlockStorage(rawData as unknown as TState);\n }\n }\n\n // Check for legacy V1/V2 format\n if (isLegacyV1V2Format(parsed)) {\n return convertLegacyToBlockStorage(parsed) as unknown as BlockStorage<TState>;\n }\n\n // Use standard normalization\n return normalizeBlockStorage<TState>(parsed);\n}\n"],"names":[],"mappings":";;;AAAA;;;;;;;;AAQG;AAwCH;;;;;;AAMG;AACG,SAAU,iBAAiB,CAAmB,OAAgB,EAAA;IAClE,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,IAAI,EAAE;AAC7C,QAAA,OAAO,kBAAkB,CAAS,EAAY,CAAC;IACjD;;AAGA,IAAA,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AAC/B,QAAA,IAAI;YACF,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;AAClC,YAAA,OAAO,qBAAqB,CAAS,MAAM,CAAC;QAC9C;AAAE,QAAA,MAAM;;AAEN,YAAA,OAAO,kBAAkB,CAAC,OAA4B,CAAC;QACzD;IACF;AAEA,IAAA,OAAO,qBAAqB,CAAS,OAAO,CAAC;AAC/C;AAEA;;;;;;AAMG;AACG,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UAA2B,EAAA;AACrE,IAAA,OAAO,kBAAkB,CAAC,UAAU,CAAC;AACvC;AAEA;;;;;;;;AAQG;AACG,SAAU,sBAAsB,CAAmB,OAAgB,EAAA;IACvE,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,IAAI,EAAE;AAC7C,QAAA,OAAO,kBAAkB,CAAS,EAAY,CAAC;IACjD;;IAGA,IAAI,MAAM,GAAG,OAAO;AACpB,IAAA,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AAC/B,QAAA,IAAI;AACF,YAAA,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;QAC9B;AAAE,QAAA,MAAM;;AAEN,YAAA,OAAO,kBAAkB,CAAC,OAA4B,CAAC;QACzD;IACF;;AAGA,IAAA,IAAI,kBAAkB,CAAC,MAAM,CAAC,EAAE;AAC9B,QAAA,OAAO,2BAA2B,CAAC,MAAM,CAAoC;IAC/E;;AAGA,IAAA,OAAO,qBAAqB,CAAS,MAAM,CAAC;AAC9C;;;;"}
1
+ {"version":3,"file":"block_storage_helper.js","sources":["../../src/model/block_storage_helper.ts"],"sourcesContent":["/**\n * Block Storage Helper - Middle layer utilities for BlockStorage operations.\n *\n * This module provides the bridge between the SDK's BlockStorage abstraction\n * and the middle layer's storage operations. Block developers never interact\n * with this - they only see `state`.\n *\n * @module block_storage_helper\n */\n\nimport type { BlockStorage, BlockStorageHandlers } from \"@platforma-sdk/model\";\nimport {\n BLOCK_STORAGE_KEY,\n BLOCK_STORAGE_SCHEMA_VERSION,\n createBlockStorage,\n defaultBlockStorageHandlers,\n getPluginData,\n getStorageData,\n getStorageDataVersion,\n isBlockStorage,\n normalizeBlockStorage,\n setPluginData,\n updateStorageData,\n updateStorageDataVersion,\n} from \"@platforma-sdk/model\";\n\n// Re-export types for convenience\nexport type { BlockStorage, BlockStorageHandlers };\n\n// Re-export utilities that middle layer needs\nexport {\n BLOCK_STORAGE_KEY,\n BLOCK_STORAGE_SCHEMA_VERSION,\n createBlockStorage,\n defaultBlockStorageHandlers,\n getPluginData,\n getStorageData,\n getStorageDataVersion,\n isBlockStorage,\n normalizeBlockStorage,\n setPluginData,\n updateStorageData,\n updateStorageDataVersion,\n};\n\n/**\n * Parses raw blockStorage data (from resource tree) into BlockStorage.\n * Handles both legacy format (raw state) and new format (BlockStorage).\n *\n * @param rawData - Raw data from blockStorage field (may be string or parsed object)\n * @returns Normalized BlockStorage object\n */\nexport function parseBlockStorage<TState = unknown>(rawData: unknown): BlockStorage<TState> {\n if (rawData === undefined || rawData === null) {\n return createBlockStorage<TState>({} as TState);\n }\n\n // If it's a string, parse it first\n if (typeof rawData === \"string\") {\n try {\n const parsed = JSON.parse(rawData);\n return normalizeBlockStorage<TState>(parsed);\n } catch {\n // If parsing fails, treat the string as the state itself\n return createBlockStorage(rawData as unknown as TState);\n }\n }\n\n return normalizeBlockStorage<TState>(rawData);\n}\n\n/**\n * Extracts the user-facing data from BlockStorage.\n * This is what block developers see in their .args() callbacks.\n *\n * @param storage - The BlockStorage object\n * @returns The data value that developers work with\n */\nexport function extractDataForDeveloper<TState>(storage: BlockStorage<TState>): TState {\n return getStorageData(storage);\n}\n\n/**\n * Creates a new BlockStorage with updated state.\n * Used when setState is called from the frontend.\n *\n * @param currentStorage - Current BlockStorage (or undefined for new blocks)\n * @param newState - New state from developer\n * @param handlers - Optional custom handlers (defaults to standard handlers)\n * @returns Updated BlockStorage\n */\nexport function applyStateUpdate<TState>(\n currentStorage: BlockStorage<TState> | undefined,\n newState: TState,\n handlers: BlockStorageHandlers<TState> = defaultBlockStorageHandlers as BlockStorageHandlers<TState>,\n): BlockStorage<TState> {\n const storage = currentStorage ?? createBlockStorage<TState>({} as TState);\n const transform =\n handlers.transformStateForStorage ?? defaultBlockStorageHandlers.transformStateForStorage;\n return transform(storage, newState) as BlockStorage<TState>;\n}\n\n/**\n * Serializes BlockStorage for writing to the resource tree.\n *\n * @param storage - The BlockStorage to serialize\n * @returns JSON string\n */\nexport function serializeBlockStorage(storage: BlockStorage): string {\n return JSON.stringify(storage);\n}\n\n/**\n * Checks if the storage needs migration based on version key.\n *\n * @param storage - Current BlockStorage\n * @param targetVersion - Target version key\n * @returns true if migration is needed\n */\nexport function needsMigration(storage: BlockStorage, targetVersion: string): boolean {\n return getStorageDataVersion(storage) !== targetVersion;\n}\n\n/**\n * Migrates BlockStorage from one version to another.\n *\n * @param storage - Current BlockStorage\n * @param fromVersion - Source version key\n * @param toVersion - Target version key\n * @param handlers - Optional custom handlers\n * @returns Migrated BlockStorage\n */\nexport function migrateBlockStorage<TState>(\n storage: BlockStorage<TState>,\n fromVersion: string,\n toVersion: string,\n handlers: BlockStorageHandlers<TState> = defaultBlockStorageHandlers as BlockStorageHandlers<TState>,\n): BlockStorage<TState> {\n const migrate = handlers.migrateStorage ?? defaultBlockStorageHandlers.migrateStorage;\n return migrate(storage, fromVersion, toVersion) as BlockStorage<TState>;\n}\n\n/**\n * V1/V2 legacy format - state stored as { args, uiState }\n */\nexport interface LegacyV1V2State {\n args?: unknown;\n uiState?: unknown;\n}\n\n/**\n * Checks if the raw data is in legacy V1/V2 format.\n * V1/V2 blocks stored { args, uiState } directly, not wrapped in BlockStorage.\n *\n * @param rawData - Raw data from blockStorage field\n * @returns true if data is in legacy format\n */\nexport function isLegacyV1V2Format(rawData: unknown): rawData is LegacyV1V2State {\n if (rawData === null || typeof rawData !== \"object\") return false;\n // If it has the discriminator, it's BlockStorage format\n if (isBlockStorage(rawData)) return false;\n\n const obj = rawData as Record<string, unknown>;\n // Legacy format has 'args' and/or 'uiState' at top level, no discriminator\n return \"args\" in obj || \"uiState\" in obj;\n}\n\n/**\n * Converts legacy V1/V2 format to BlockStorage.\n * For backward compatibility with existing blocks.\n *\n * @param legacyData - Data in { args, uiState } format\n * @returns BlockStorage with legacy data as state\n */\nexport function convertLegacyToBlockStorage(\n legacyData: LegacyV1V2State,\n): BlockStorage<LegacyV1V2State> {\n return createBlockStorage(legacyData);\n}\n\n/**\n * Smart parser that handles all storage formats:\n * - New BlockStorage format\n * - Legacy V1/V2 format ({ args, uiState })\n * - Raw state (any other format)\n *\n * @param rawData - Raw data from blockStorage field\n * @returns Normalized BlockStorage\n */\nexport function parseBlockStorageSmart<TState = unknown>(rawData: unknown): BlockStorage<TState> {\n if (rawData === undefined || rawData === null) {\n return createBlockStorage<TState>({} as TState);\n }\n\n // If it's a string, parse it first\n let parsed = rawData;\n if (typeof rawData === \"string\") {\n try {\n parsed = JSON.parse(rawData);\n } catch {\n // If parsing fails, treat the string as the state itself\n return createBlockStorage(rawData as unknown as TState);\n }\n }\n\n // Check for legacy V1/V2 format\n if (isLegacyV1V2Format(parsed)) {\n return convertLegacyToBlockStorage(parsed) as unknown as BlockStorage<TState>;\n }\n\n // Use standard normalization\n return normalizeBlockStorage<TState>(parsed);\n}\n"],"names":[],"mappings":";;;AAAA;;;;;;;;AAQG;AAqCH;;;;;;AAMG;AACG,SAAU,iBAAiB,CAAmB,OAAgB,EAAA;IAClE,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,IAAI,EAAE;AAC7C,QAAA,OAAO,kBAAkB,CAAS,EAAY,CAAC;IACjD;;AAGA,IAAA,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AAC/B,QAAA,IAAI;YACF,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;AAClC,YAAA,OAAO,qBAAqB,CAAS,MAAM,CAAC;QAC9C;AAAE,QAAA,MAAM;;AAEN,YAAA,OAAO,kBAAkB,CAAC,OAA4B,CAAC;QACzD;IACF;AAEA,IAAA,OAAO,qBAAqB,CAAS,OAAO,CAAC;AAC/C;AAEA;;;;;;AAMG;AACG,SAAU,uBAAuB,CAAS,OAA6B,EAAA;AAC3E,IAAA,OAAO,cAAc,CAAC,OAAO,CAAC;AAChC;AAEA;;;;;;;;AAQG;AACG,SAAU,gBAAgB,CAC9B,cAAgD,EAChD,QAAgB,EAChB,WAAyC,2BAA2D,EAAA;IAEpG,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AE;AAC7C,QAAA,OAAO,kBAAkB,CAAS,EAAY,CAAC;IACjD;;IAGA,IAAI,MAAM,GAAG,OAAO;AACpB,IAAA,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AAC/B,QAAA,IAAI;AACF,YAAA,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;QAC9B;AAAE,QAAA,MAAM;;AAEN,YAAA,OAAO,kBAAkB,CAAC,OAA4B,CAAC;QACzD;IACF;;AAGA,IAAA,IAAI,kBAAkB,CAAC,MAAM,CAAC,EAAE;AAC9B,QAAA,OAAO,2BAA2B,CAAC,MAAM,CAAoC;IAC/E;;AAGA,IAAA,OAAO,qBAAqB,CAAS,MAAM,CAAC;AAC9C;;;;"}
@@ -1,4 +1,4 @@
1
- export * from './block_pack_spec';
2
- export * from './block_storage_helper';
3
- export { type ProjectListEntry, type ProjectField } from './project_model';
1
+ export * from "./block_pack_spec";
2
+ export * from "./block_storage_helper";
3
+ export { type ProjectListEntry, type ProjectField } from "./project_model";
4
4
  //# sourceMappingURL=index.d.ts.map