@platforma-sdk/model 1.58.3 → 1.58.9

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 (366) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +43 -0
  2. package/dist/_virtual/_rolldown/runtime.js +18 -0
  3. package/dist/annotations/converter.cjs +15 -20
  4. package/dist/annotations/converter.cjs.map +1 -1
  5. package/dist/annotations/converter.d.ts +6 -2
  6. package/dist/annotations/converter.js +14 -18
  7. package/dist/annotations/converter.js.map +1 -1
  8. package/dist/annotations/index.cjs +1 -0
  9. package/dist/annotations/index.d.ts +2 -3
  10. package/dist/annotations/index.js +1 -0
  11. package/dist/annotations/types.d.ts +21 -16
  12. package/dist/bconfig/index.cjs +2 -0
  13. package/dist/bconfig/index.d.ts +5 -6
  14. package/dist/bconfig/index.js +2 -0
  15. package/dist/bconfig/lambdas.d.ts +52 -52
  16. package/dist/bconfig/normalization.cjs +13 -18
  17. package/dist/bconfig/normalization.cjs.map +1 -1
  18. package/dist/bconfig/normalization.d.ts +10 -6
  19. package/dist/bconfig/normalization.js +12 -16
  20. package/dist/bconfig/normalization.js.map +1 -1
  21. package/dist/bconfig/types.cjs +4 -3
  22. package/dist/bconfig/types.cjs.map +1 -1
  23. package/dist/bconfig/types.d.ts +10 -5
  24. package/dist/bconfig/types.js +4 -2
  25. package/dist/bconfig/types.js.map +1 -1
  26. package/dist/bconfig/util.d.ts +7 -4
  27. package/dist/bconfig/v3.d.ts +10 -6
  28. package/dist/block_api_v1.d.ts +62 -58
  29. package/dist/block_api_v2.d.ts +51 -47
  30. package/dist/block_api_v3.d.ts +33 -29
  31. package/dist/block_migrations.cjs +481 -413
  32. package/dist/block_migrations.cjs.map +1 -1
  33. package/dist/block_migrations.d.ts +258 -204
  34. package/dist/block_migrations.js +482 -408
  35. package/dist/block_migrations.js.map +1 -1
  36. package/dist/block_model.cjs +312 -343
  37. package/dist/block_model.cjs.map +1 -1
  38. package/dist/block_model.d.ts +143 -147
  39. package/dist/block_model.js +312 -341
  40. package/dist/block_model.js.map +1 -1
  41. package/dist/block_model_legacy.cjs +231 -255
  42. package/dist/block_model_legacy.cjs.map +1 -1
  43. package/dist/block_model_legacy.d.ts +108 -106
  44. package/dist/block_model_legacy.js +231 -253
  45. package/dist/block_model_legacy.js.map +1 -1
  46. package/dist/block_state_patch.d.ts +10 -10
  47. package/dist/block_state_util.cjs +15 -19
  48. package/dist/block_state_util.cjs.map +1 -1
  49. package/dist/block_state_util.d.ts +14 -13
  50. package/dist/block_state_util.js +15 -18
  51. package/dist/block_state_util.js.map +1 -1
  52. package/dist/block_storage.cjs +233 -238
  53. package/dist/block_storage.cjs.map +1 -1
  54. package/dist/block_storage.d.ts +62 -78
  55. package/dist/block_storage.js +234 -237
  56. package/dist/block_storage.js.map +1 -1
  57. package/dist/block_storage_callbacks.cjs +156 -195
  58. package/dist/block_storage_callbacks.cjs.map +1 -1
  59. package/dist/block_storage_callbacks.js +156 -192
  60. package/dist/block_storage_callbacks.js.map +1 -1
  61. package/dist/block_storage_facade.cjs +29 -85
  62. package/dist/block_storage_facade.cjs.map +1 -1
  63. package/dist/block_storage_facade.d.ts +83 -126
  64. package/dist/block_storage_facade.js +29 -83
  65. package/dist/block_storage_facade.js.map +1 -1
  66. package/dist/components/PFrameForGraphs.cjs +26 -24
  67. package/dist/components/PFrameForGraphs.cjs.map +1 -1
  68. package/dist/components/PFrameForGraphs.d.ts +12 -7
  69. package/dist/components/PFrameForGraphs.js +25 -22
  70. package/dist/components/PFrameForGraphs.js.map +1 -1
  71. package/dist/components/PlAnnotations/filter.d.ts +62 -79
  72. package/dist/components/PlAnnotations/filters_ui.cjs +135 -171
  73. package/dist/components/PlAnnotations/filters_ui.cjs.map +1 -1
  74. package/dist/components/PlAnnotations/filters_ui.d.ts +48 -46
  75. package/dist/components/PlAnnotations/filters_ui.js +135 -170
  76. package/dist/components/PlAnnotations/filters_ui.js.map +1 -1
  77. package/dist/components/PlAnnotations/index.d.ts +2 -3
  78. package/dist/components/PlDataTable/index.cjs +2 -0
  79. package/dist/components/PlDataTable/index.d.ts +3 -5
  80. package/dist/components/PlDataTable/index.js +2 -0
  81. package/dist/components/PlDataTable/labels.cjs +59 -81
  82. package/dist/components/PlDataTable/labels.cjs.map +1 -1
  83. package/dist/components/PlDataTable/labels.js +58 -79
  84. package/dist/components/PlDataTable/labels.js.map +1 -1
  85. package/dist/components/PlDataTable/state-migration.cjs +186 -144
  86. package/dist/components/PlDataTable/state-migration.cjs.map +1 -1
  87. package/dist/components/PlDataTable/state-migration.d.ts +85 -82
  88. package/dist/components/PlDataTable/state-migration.js +185 -142
  89. package/dist/components/PlDataTable/state-migration.js.map +1 -1
  90. package/dist/components/PlDataTable/table.cjs +172 -194
  91. package/dist/components/PlDataTable/table.cjs.map +1 -1
  92. package/dist/components/PlDataTable/table.d.ts +16 -12
  93. package/dist/components/PlDataTable/table.js +171 -192
  94. package/dist/components/PlDataTable/table.js.map +1 -1
  95. package/dist/components/PlDataTable/v4.d.ts +84 -119
  96. package/dist/components/PlDataTable/v5.d.ts +80 -103
  97. package/dist/components/PlMultiSequenceAlignment.cjs +27 -29
  98. package/dist/components/PlMultiSequenceAlignment.cjs.map +1 -1
  99. package/dist/components/PlMultiSequenceAlignment.d.ts +36 -27
  100. package/dist/components/PlMultiSequenceAlignment.js +26 -27
  101. package/dist/components/PlMultiSequenceAlignment.js.map +1 -1
  102. package/dist/components/PlSelectionModel.cjs +7 -6
  103. package/dist/components/PlSelectionModel.cjs.map +1 -1
  104. package/dist/components/PlSelectionModel.d.ts +10 -8
  105. package/dist/components/PlSelectionModel.js +7 -5
  106. package/dist/components/PlSelectionModel.js.map +1 -1
  107. package/dist/components/index.cjs +8 -0
  108. package/dist/components/index.d.ts +11 -6
  109. package/dist/components/index.js +8 -0
  110. package/dist/config/actions.cjs +138 -171
  111. package/dist/config/actions.cjs.map +1 -1
  112. package/dist/config/actions.d.ts +47 -47
  113. package/dist/config/actions.js +146 -178
  114. package/dist/config/actions.js.map +1 -1
  115. package/dist/config/actions_kinds.d.ts +114 -121
  116. package/dist/config/index.cjs +1 -0
  117. package/dist/config/index.d.ts +6 -7
  118. package/dist/config/index.js +1 -0
  119. package/dist/config/model.d.ts +131 -127
  120. package/dist/config/model_meta.d.ts +4 -1
  121. package/dist/config/type_engine.d.ts +22 -21
  122. package/dist/config/type_util.d.ts +12 -10
  123. package/dist/env_value.cjs +5 -6
  124. package/dist/env_value.cjs.map +1 -1
  125. package/dist/env_value.d.ts +4 -1
  126. package/dist/env_value.js +5 -5
  127. package/dist/env_value.js.map +1 -1
  128. package/dist/filters/converters/filterToQuery.cjs +273 -239
  129. package/dist/filters/converters/filterToQuery.cjs.map +1 -1
  130. package/dist/filters/converters/filterToQuery.d.ts +6 -2
  131. package/dist/filters/converters/filterToQuery.js +272 -237
  132. package/dist/filters/converters/filterToQuery.js.map +1 -1
  133. package/dist/filters/converters/filterUiToExpressionImpl.cjs +56 -85
  134. package/dist/filters/converters/filterUiToExpressionImpl.cjs.map +1 -1
  135. package/dist/filters/converters/filterUiToExpressionImpl.d.ts +8 -4
  136. package/dist/filters/converters/filterUiToExpressionImpl.js +55 -83
  137. package/dist/filters/converters/filterUiToExpressionImpl.js.map +1 -1
  138. package/dist/filters/converters/index.cjs +2 -0
  139. package/dist/filters/converters/index.d.ts +2 -3
  140. package/dist/filters/converters/index.js +2 -0
  141. package/dist/filters/distill.cjs +59 -50
  142. package/dist/filters/distill.cjs.map +1 -1
  143. package/dist/filters/distill.d.ts +6 -3
  144. package/dist/filters/distill.js +58 -48
  145. package/dist/filters/distill.js.map +1 -1
  146. package/dist/filters/index.cjs +4 -0
  147. package/dist/filters/index.d.ts +5 -4
  148. package/dist/filters/index.js +4 -0
  149. package/dist/filters/traverse.cjs +31 -40
  150. package/dist/filters/traverse.cjs.map +1 -1
  151. package/dist/filters/traverse.js +31 -39
  152. package/dist/filters/traverse.js.map +1 -1
  153. package/dist/filters/types.d.ts +10 -7
  154. package/dist/index.cjs +193 -187
  155. package/dist/index.d.ts +61 -28
  156. package/dist/index.js +49 -41
  157. package/dist/internal.cjs +48 -62
  158. package/dist/internal.cjs.map +1 -1
  159. package/dist/internal.js +49 -60
  160. package/dist/internal.js.map +1 -1
  161. package/dist/package.cjs +12 -0
  162. package/dist/package.cjs.map +1 -0
  163. package/dist/package.js +6 -0
  164. package/dist/package.js.map +1 -0
  165. package/dist/pframe.cjs +32 -37
  166. package/dist/pframe.cjs.map +1 -1
  167. package/dist/pframe.d.ts +14 -10
  168. package/dist/pframe.js +32 -35
  169. package/dist/pframe.js.map +1 -1
  170. package/dist/pframe_utils/axes.cjs +81 -114
  171. package/dist/pframe_utils/axes.cjs.map +1 -1
  172. package/dist/pframe_utils/axes.d.ts +10 -13
  173. package/dist/pframe_utils/axes.js +80 -112
  174. package/dist/pframe_utils/axes.js.map +1 -1
  175. package/dist/pframe_utils/columns.cjs +61 -81
  176. package/dist/pframe_utils/columns.cjs.map +1 -1
  177. package/dist/pframe_utils/columns.d.ts +15 -6
  178. package/dist/pframe_utils/columns.js +60 -79
  179. package/dist/pframe_utils/columns.js.map +1 -1
  180. package/dist/pframe_utils/index.cjs +232 -253
  181. package/dist/pframe_utils/index.cjs.map +1 -1
  182. package/dist/pframe_utils/index.d.ts +39 -35
  183. package/dist/pframe_utils/index.js +231 -251
  184. package/dist/pframe_utils/index.js.map +1 -1
  185. package/dist/platforma.d.ts +48 -46
  186. package/dist/plugin_handle.cjs +6 -14
  187. package/dist/plugin_handle.cjs.map +1 -1
  188. package/dist/plugin_handle.d.ts +20 -25
  189. package/dist/plugin_handle.js +6 -13
  190. package/dist/plugin_handle.js.map +1 -1
  191. package/dist/plugin_model.cjs +364 -163
  192. package/dist/plugin_model.cjs.map +1 -1
  193. package/dist/plugin_model.d.ts +280 -129
  194. package/dist/plugin_model.js +362 -163
  195. package/dist/plugin_model.js.map +1 -1
  196. package/dist/raw_globals.cjs +10 -22
  197. package/dist/raw_globals.cjs.map +1 -1
  198. package/dist/raw_globals.d.ts +8 -5
  199. package/dist/raw_globals.js +10 -20
  200. package/dist/raw_globals.js.map +1 -1
  201. package/dist/ref_util.cjs +14 -13
  202. package/dist/ref_util.cjs.map +1 -1
  203. package/dist/ref_util.d.ts +18 -12
  204. package/dist/ref_util.js +14 -11
  205. package/dist/ref_util.js.map +1 -1
  206. package/dist/render/accessor.cjs +213 -226
  207. package/dist/render/accessor.cjs.map +1 -1
  208. package/dist/render/accessor.d.ts +115 -120
  209. package/dist/render/accessor.js +212 -224
  210. package/dist/render/accessor.js.map +1 -1
  211. package/dist/render/api.cjs +478 -580
  212. package/dist/render/api.cjs.map +1 -1
  213. package/dist/render/api.d.ts +207 -209
  214. package/dist/render/api.js +476 -578
  215. package/dist/render/api.js.map +1 -1
  216. package/dist/render/future.cjs +28 -32
  217. package/dist/render/future.cjs.map +1 -1
  218. package/dist/render/future.d.ts +15 -11
  219. package/dist/render/future.js +28 -30
  220. package/dist/render/future.js.map +1 -1
  221. package/dist/render/index.cjs +8 -0
  222. package/dist/render/index.d.ts +10 -8
  223. package/dist/render/index.js +8 -0
  224. package/dist/render/internal.cjs +33 -29
  225. package/dist/render/internal.cjs.map +1 -1
  226. package/dist/render/internal.d.ts +78 -72
  227. package/dist/render/internal.js +29 -26
  228. package/dist/render/internal.js.map +1 -1
  229. package/dist/render/traversal_ops.d.ts +42 -43
  230. package/dist/render/util/axis_filtering.cjs +63 -86
  231. package/dist/render/util/axis_filtering.cjs.map +1 -1
  232. package/dist/render/util/axis_filtering.d.ts +10 -7
  233. package/dist/render/util/axis_filtering.js +63 -85
  234. package/dist/render/util/axis_filtering.js.map +1 -1
  235. package/dist/render/util/column_collection.cjs +266 -321
  236. package/dist/render/util/column_collection.cjs.map +1 -1
  237. package/dist/render/util/column_collection.d.ts +47 -47
  238. package/dist/render/util/column_collection.js +264 -319
  239. package/dist/render/util/column_collection.js.map +1 -1
  240. package/dist/render/util/index.cjs +4 -0
  241. package/dist/render/util/index.d.ts +4 -5
  242. package/dist/render/util/index.js +4 -0
  243. package/dist/render/util/label.cjs +129 -163
  244. package/dist/render/util/label.cjs.map +1 -1
  245. package/dist/render/util/label.d.ts +45 -46
  246. package/dist/render/util/label.js +128 -161
  247. package/dist/render/util/label.js.map +1 -1
  248. package/dist/render/util/pcolumn_data.cjs +315 -375
  249. package/dist/render/util/pcolumn_data.cjs.map +1 -1
  250. package/dist/render/util/pcolumn_data.d.ts +33 -32
  251. package/dist/render/util/pcolumn_data.js +314 -373
  252. package/dist/render/util/pcolumn_data.js.map +1 -1
  253. package/dist/render/util/pframe_upgraders.cjs +37 -42
  254. package/dist/render/util/pframe_upgraders.cjs.map +1 -1
  255. package/dist/render/util/pframe_upgraders.js +37 -41
  256. package/dist/render/util/pframe_upgraders.js.map +1 -1
  257. package/dist/render/util/split_selectors.d.ts +13 -9
  258. package/dist/version.cjs +6 -8
  259. package/dist/version.cjs.map +1 -1
  260. package/dist/version.d.ts +7 -4
  261. package/dist/version.js +5 -5
  262. package/dist/version.js.map +1 -1
  263. package/package.json +9 -3
  264. package/src/block_migrations.test.ts +184 -14
  265. package/src/block_migrations.ts +185 -30
  266. package/src/block_model.ts +111 -66
  267. package/src/block_storage.test.ts +147 -3
  268. package/src/block_storage.ts +43 -8
  269. package/src/block_storage_callbacks.ts +9 -4
  270. package/src/env_value.ts +0 -2
  271. package/src/filters/distill.ts +17 -6
  272. package/src/index.ts +12 -11
  273. package/src/internal.ts +0 -1
  274. package/src/platforma.ts +4 -4
  275. package/src/plugin_handle.ts +1 -1
  276. package/src/plugin_model.test.ts +217 -21
  277. package/src/plugin_model.ts +450 -55
  278. package/src/raw_globals.ts +0 -1
  279. package/dist/annotations/converter.d.ts.map +0 -1
  280. package/dist/annotations/index.d.ts.map +0 -1
  281. package/dist/annotations/types.d.ts.map +0 -1
  282. package/dist/bconfig/index.d.ts.map +0 -1
  283. package/dist/bconfig/lambdas.d.ts.map +0 -1
  284. package/dist/bconfig/normalization.d.ts.map +0 -1
  285. package/dist/bconfig/types.d.ts.map +0 -1
  286. package/dist/bconfig/util.d.ts.map +0 -1
  287. package/dist/bconfig/v3.d.ts.map +0 -1
  288. package/dist/block_api_v1.d.ts.map +0 -1
  289. package/dist/block_api_v2.d.ts.map +0 -1
  290. package/dist/block_api_v3.d.ts.map +0 -1
  291. package/dist/block_migrations.d.ts.map +0 -1
  292. package/dist/block_model.d.ts.map +0 -1
  293. package/dist/block_model_legacy.d.ts.map +0 -1
  294. package/dist/block_state_patch.d.ts.map +0 -1
  295. package/dist/block_state_util.d.ts.map +0 -1
  296. package/dist/block_storage.d.ts.map +0 -1
  297. package/dist/block_storage_callbacks.d.ts +0 -115
  298. package/dist/block_storage_callbacks.d.ts.map +0 -1
  299. package/dist/block_storage_facade.d.ts.map +0 -1
  300. package/dist/components/PFrameForGraphs.d.ts.map +0 -1
  301. package/dist/components/PlAnnotations/filter.d.ts.map +0 -1
  302. package/dist/components/PlAnnotations/filters_ui.d.ts.map +0 -1
  303. package/dist/components/PlAnnotations/index.d.ts.map +0 -1
  304. package/dist/components/PlAnnotations/types.d.ts +0 -3
  305. package/dist/components/PlAnnotations/types.d.ts.map +0 -1
  306. package/dist/components/PlDataTable/index.d.ts.map +0 -1
  307. package/dist/components/PlDataTable/labels.d.ts +0 -7
  308. package/dist/components/PlDataTable/labels.d.ts.map +0 -1
  309. package/dist/components/PlDataTable/state-migration.d.ts.map +0 -1
  310. package/dist/components/PlDataTable/table.d.ts.map +0 -1
  311. package/dist/components/PlDataTable/v4.d.ts.map +0 -1
  312. package/dist/components/PlDataTable/v5.d.ts.map +0 -1
  313. package/dist/components/PlMultiSequenceAlignment.d.ts.map +0 -1
  314. package/dist/components/PlSelectionModel.d.ts.map +0 -1
  315. package/dist/components/index.d.ts.map +0 -1
  316. package/dist/config/actions.d.ts.map +0 -1
  317. package/dist/config/actions_kinds.d.ts.map +0 -1
  318. package/dist/config/index.d.ts.map +0 -1
  319. package/dist/config/model.d.ts.map +0 -1
  320. package/dist/config/model_meta.d.ts.map +0 -1
  321. package/dist/config/type_engine.d.ts.map +0 -1
  322. package/dist/config/type_util.d.ts.map +0 -1
  323. package/dist/env_value.d.ts.map +0 -1
  324. package/dist/filters/converters/filterToQuery.d.ts.map +0 -1
  325. package/dist/filters/converters/filterUiToExpressionImpl.d.ts.map +0 -1
  326. package/dist/filters/converters/index.d.ts.map +0 -1
  327. package/dist/filters/distill.d.ts.map +0 -1
  328. package/dist/filters/index.d.ts.map +0 -1
  329. package/dist/filters/traverse.d.ts +0 -27
  330. package/dist/filters/traverse.d.ts.map +0 -1
  331. package/dist/filters/types.d.ts.map +0 -1
  332. package/dist/index.cjs.map +0 -1
  333. package/dist/index.d.ts.map +0 -1
  334. package/dist/index.js.map +0 -1
  335. package/dist/internal.d.ts +0 -36
  336. package/dist/internal.d.ts.map +0 -1
  337. package/dist/package.json.cjs +0 -6
  338. package/dist/package.json.cjs.map +0 -1
  339. package/dist/package.json.js +0 -4
  340. package/dist/package.json.js.map +0 -1
  341. package/dist/pframe.d.ts.map +0 -1
  342. package/dist/pframe_utils/axes.d.ts.map +0 -1
  343. package/dist/pframe_utils/columns.d.ts.map +0 -1
  344. package/dist/pframe_utils/index.d.ts.map +0 -1
  345. package/dist/pframe_utils/querySpec.d.ts +0 -2
  346. package/dist/pframe_utils/querySpec.d.ts.map +0 -1
  347. package/dist/platforma.d.ts.map +0 -1
  348. package/dist/plugin_handle.d.ts.map +0 -1
  349. package/dist/plugin_model.d.ts.map +0 -1
  350. package/dist/raw_globals.d.ts.map +0 -1
  351. package/dist/ref_util.d.ts.map +0 -1
  352. package/dist/render/accessor.d.ts.map +0 -1
  353. package/dist/render/api.d.ts.map +0 -1
  354. package/dist/render/future.d.ts.map +0 -1
  355. package/dist/render/index.d.ts.map +0 -1
  356. package/dist/render/internal.d.ts.map +0 -1
  357. package/dist/render/traversal_ops.d.ts.map +0 -1
  358. package/dist/render/util/axis_filtering.d.ts.map +0 -1
  359. package/dist/render/util/column_collection.d.ts.map +0 -1
  360. package/dist/render/util/index.d.ts.map +0 -1
  361. package/dist/render/util/label.d.ts.map +0 -1
  362. package/dist/render/util/pcolumn_data.d.ts.map +0 -1
  363. package/dist/render/util/pframe_upgraders.d.ts +0 -3
  364. package/dist/render/util/pframe_upgraders.d.ts.map +0 -1
  365. package/dist/render/util/split_selectors.d.ts.map +0 -1
  366. package/dist/version.d.ts.map +0 -1
@@ -1,230 +1,218 @@
1
- import { isPColumn, mapPObjectData } from '@milaboratories/pl-model-common';
2
- import { getCfgRenderCtx } from '../internal.js';
3
- import { FutureRef } from './future.js';
1
+ import { getCfgRenderCtx } from "../internal.js";
2
+ import { FutureRef } from "./future.js";
3
+ import { isPColumn, mapPObjectData } from "@milaboratories/pl-model-common";
4
4
 
5
+ //#region src/render/accessor.ts
5
6
  function ifDef(value, cb) {
6
- return value === undefined ? undefined : cb(value);
7
+ return value === void 0 ? void 0 : cb(value);
7
8
  }
8
9
  /** Represent resource tree node accessor */
9
- class TreeNodeAccessor {
10
- handle;
11
- resolvePath;
12
- constructor(handle, resolvePath) {
13
- this.handle = handle;
14
- this.resolvePath = resolvePath;
15
- }
16
- resolve(...steps) {
17
- const transformedSteps = steps.map((s) => ({
18
- assertFieldType: "Input",
19
- ...(typeof s === "string" ? { field: s } : s),
20
- }));
21
- return this.resolveWithCommon({}, ...transformedSteps);
22
- }
23
- resolveOutput(...steps) {
24
- const transformedSteps = steps.map((s) => ({
25
- assertFieldType: "Output",
26
- ...(typeof s === "string" ? { field: s } : s),
27
- }));
28
- return this.resolveWithCommon({}, ...transformedSteps);
29
- }
30
- resolveInput(...steps) {
31
- const transformedSteps = steps.map((s) => ({
32
- assertFieldType: "Input",
33
- ...(typeof s === "string" ? { field: s } : s),
34
- }));
35
- return this.resolveWithCommon({}, ...transformedSteps);
36
- }
37
- resolveAny(...steps) {
38
- return this.resolveWithCommon({}, ...steps);
39
- }
40
- resolveWithCommon(commonOptions, ...steps) {
41
- const resolvePath = [
42
- ...this.resolvePath,
43
- ...steps.map((step) => (typeof step === "string" ? step : step.field)),
44
- ];
45
- return ifDef(getCfgRenderCtx().resolveWithCommon(this.handle, commonOptions, ...steps), (accessor) => new TreeNodeAccessor(accessor, resolvePath));
46
- }
47
- get resourceType() {
48
- return getCfgRenderCtx().getResourceType(this.handle);
49
- }
50
- getInputsLocked() {
51
- return getCfgRenderCtx().getInputsLocked(this.handle);
52
- }
53
- getOutputsLocked() {
54
- return getCfgRenderCtx().getOutputsLocked(this.handle);
55
- }
56
- getIsReadyOrError() {
57
- return getCfgRenderCtx().getIsReadyOrError(this.handle);
58
- }
59
- getIsFinal() {
60
- return getCfgRenderCtx().getIsFinal(this.handle);
61
- }
62
- getError() {
63
- const resolvePath = [...this.resolvePath, "error"];
64
- return ifDef(getCfgRenderCtx().getError(this.handle), (accsessor) => new TreeNodeAccessor(accsessor, resolvePath));
65
- }
66
- listInputFields() {
67
- return getCfgRenderCtx().listInputFields(this.handle);
68
- }
69
- listOutputFields() {
70
- return getCfgRenderCtx().listOutputFields(this.handle);
71
- }
72
- listDynamicFields() {
73
- return getCfgRenderCtx().listDynamicFields(this.handle);
74
- }
75
- getKeyValueBase64(key) {
76
- return getCfgRenderCtx().getKeyValueBase64(this.handle, key);
77
- }
78
- getKeyValueAsString(key) {
79
- return getCfgRenderCtx().getKeyValueAsString(this.handle, key);
80
- }
81
- getKeyValueAsJson(key) {
82
- const content = this.getKeyValueAsString(key);
83
- if (content == undefined)
84
- throw new Error("Resource has no content.");
85
- return JSON.parse(content);
86
- }
87
- getDataBase64() {
88
- return getCfgRenderCtx().getDataBase64(this.handle);
89
- }
90
- getDataAsString() {
91
- return getCfgRenderCtx().getDataAsString(this.handle);
92
- }
93
- getDataAsJson() {
94
- const content = this.getDataAsString();
95
- if (content == undefined)
96
- throw new Error("Resource has no content.");
97
- return JSON.parse(content);
98
- }
99
- /**
100
- *
101
- */
102
- getPColumns(errorOnUnknownField = false, prefix = "") {
103
- const result = this.parsePObjectCollection(errorOnUnknownField, prefix);
104
- if (result === undefined)
105
- return undefined;
106
- const pf = Object.entries(result).map(([, obj]) => {
107
- if (!isPColumn(obj))
108
- throw new Error(`not a PColumn (kind = ${obj.spec.kind})`);
109
- return obj;
110
- });
111
- return pf;
112
- }
113
- /**
114
- *
115
- */
116
- parsePObjectCollection(errorOnUnknownField = false, prefix = "") {
117
- const pObjects = getCfgRenderCtx().parsePObjectCollection(this.handle, errorOnUnknownField, prefix, ...this.resolvePath);
118
- if (pObjects === undefined)
119
- return undefined;
120
- const result = {};
121
- for (const [key, value] of Object.entries(pObjects)) {
122
- const resolvePath = [...this.resolvePath, key];
123
- result[key] = mapPObjectData(value, (c) => new TreeNodeAccessor(c, resolvePath));
124
- }
125
- return result;
126
- }
127
- getFileContentAsBase64(range) {
128
- return new FutureRef(getCfgRenderCtx().getBlobContentAsBase64(this.handle, range));
129
- }
130
- getFileContentAsString(range) {
131
- return new FutureRef(getCfgRenderCtx().getBlobContentAsString(this.handle, range));
132
- }
133
- getFileContentAsJson(range) {
134
- return new FutureRef(getCfgRenderCtx().getBlobContentAsString(this.handle, range)).mapDefined((v) => JSON.parse(v));
135
- }
136
- /**
137
- * @deprecated use getFileContentAsBase64
138
- */
139
- getBlobContentAsBase64() {
140
- return this.getFileContentAsBase64();
141
- }
142
- /**
143
- * @deprecated use getFileContentAsString
144
- */
145
- getBlobContentAsString() {
146
- return this.getFileContentAsString();
147
- }
148
- /**
149
- * @returns downloaded file handle
150
- */
151
- getFileHandle() {
152
- return new FutureRef(getCfgRenderCtx().getDownloadedBlobContentHandle(this.handle));
153
- }
154
- /**
155
- * @deprecated use getFileHandle
156
- */
157
- getDownloadedBlobHandle() {
158
- return this.getFileHandle();
159
- }
160
- /**
161
- * @returns downloaded file handle
162
- */
163
- getRemoteFileHandle() {
164
- return new FutureRef(getCfgRenderCtx().getOnDemandBlobContentHandle(this.handle));
165
- }
166
- /**
167
- * @deprecated use getRemoteFileHandle
168
- */
169
- getOnDemandBlobHandle() {
170
- return this.getRemoteFileHandle();
171
- }
172
- /**
173
- * @returns the url to the extracted folder
174
- */
175
- extractArchiveAndGetURL(format) {
176
- return new FutureRef(getCfgRenderCtx().extractArchiveAndGetURL(this.handle, format));
177
- }
178
- getImportProgress() {
179
- return new FutureRef(getCfgRenderCtx().getImportProgress(this.handle));
180
- }
181
- getLastLogs(nLines) {
182
- return new FutureRef(getCfgRenderCtx().getLastLogs(this.handle, nLines));
183
- }
184
- getProgressLog(patternToSearch) {
185
- return new FutureRef(getCfgRenderCtx().getProgressLog(this.handle, patternToSearch));
186
- }
187
- getProgressLogWithInfo(patternToSearch) {
188
- return new FutureRef(getCfgRenderCtx().getProgressLogWithInfo(this.handle, patternToSearch));
189
- }
190
- getLogHandle() {
191
- return new FutureRef(getCfgRenderCtx().getLogHandle(this.handle));
192
- }
193
- allFieldsResolved(fieldType = "Input") {
194
- switch (fieldType) {
195
- case "Input":
196
- return (this.getInputsLocked() &&
197
- this.listInputFields().every((field) => this.resolve({ field, assertFieldType: "Input" }) !== undefined));
198
- case "Output":
199
- return (this.getOutputsLocked() &&
200
- this.listOutputFields().every((field) => this.resolve({ field, assertFieldType: "Output" }) !== undefined));
201
- }
202
- }
203
- mapFields(_mapping, _ops) {
204
- const { fieldType, requireLocked, skipUnresolved } = {
205
- fieldType: "Input",
206
- requireLocked: true,
207
- skipUnresolved: false,
208
- ..._ops,
209
- };
210
- const mapping = _mapping;
211
- if (requireLocked) {
212
- if (fieldType === "Input" && !this.getInputsLocked())
213
- return undefined;
214
- if (fieldType === "Output" && !this.getOutputsLocked())
215
- return undefined;
216
- }
217
- const fieldList = fieldType === "Input"
218
- ? this.listInputFields()
219
- : fieldType === "Output"
220
- ? this.listOutputFields()
221
- : this.listDynamicFields();
222
- let fieldEntries = fieldList.map((field) => [field, this.resolve({ field, assertFieldType: fieldType })]);
223
- if (skipUnresolved)
224
- fieldEntries = fieldEntries.filter((e) => e[1] !== undefined);
225
- return fieldEntries.map(([name, value]) => mapping(name, value));
226
- }
227
- }
10
+ var TreeNodeAccessor = class TreeNodeAccessor {
11
+ constructor(handle, resolvePath) {
12
+ this.handle = handle;
13
+ this.resolvePath = resolvePath;
14
+ }
15
+ resolve(...steps) {
16
+ const transformedSteps = steps.map((s) => ({
17
+ assertFieldType: "Input",
18
+ ...typeof s === "string" ? { field: s } : s
19
+ }));
20
+ return this.resolveWithCommon({}, ...transformedSteps);
21
+ }
22
+ resolveOutput(...steps) {
23
+ const transformedSteps = steps.map((s) => ({
24
+ assertFieldType: "Output",
25
+ ...typeof s === "string" ? { field: s } : s
26
+ }));
27
+ return this.resolveWithCommon({}, ...transformedSteps);
28
+ }
29
+ resolveInput(...steps) {
30
+ const transformedSteps = steps.map((s) => ({
31
+ assertFieldType: "Input",
32
+ ...typeof s === "string" ? { field: s } : s
33
+ }));
34
+ return this.resolveWithCommon({}, ...transformedSteps);
35
+ }
36
+ resolveAny(...steps) {
37
+ return this.resolveWithCommon({}, ...steps);
38
+ }
39
+ resolveWithCommon(commonOptions, ...steps) {
40
+ const resolvePath = [...this.resolvePath, ...steps.map((step) => typeof step === "string" ? step : step.field)];
41
+ return ifDef(getCfgRenderCtx().resolveWithCommon(this.handle, commonOptions, ...steps), (accessor) => new TreeNodeAccessor(accessor, resolvePath));
42
+ }
43
+ get resourceType() {
44
+ return getCfgRenderCtx().getResourceType(this.handle);
45
+ }
46
+ getInputsLocked() {
47
+ return getCfgRenderCtx().getInputsLocked(this.handle);
48
+ }
49
+ getOutputsLocked() {
50
+ return getCfgRenderCtx().getOutputsLocked(this.handle);
51
+ }
52
+ getIsReadyOrError() {
53
+ return getCfgRenderCtx().getIsReadyOrError(this.handle);
54
+ }
55
+ getIsFinal() {
56
+ return getCfgRenderCtx().getIsFinal(this.handle);
57
+ }
58
+ getError() {
59
+ const resolvePath = [...this.resolvePath, "error"];
60
+ return ifDef(getCfgRenderCtx().getError(this.handle), (accsessor) => new TreeNodeAccessor(accsessor, resolvePath));
61
+ }
62
+ listInputFields() {
63
+ return getCfgRenderCtx().listInputFields(this.handle);
64
+ }
65
+ listOutputFields() {
66
+ return getCfgRenderCtx().listOutputFields(this.handle);
67
+ }
68
+ listDynamicFields() {
69
+ return getCfgRenderCtx().listDynamicFields(this.handle);
70
+ }
71
+ getKeyValueBase64(key) {
72
+ return getCfgRenderCtx().getKeyValueBase64(this.handle, key);
73
+ }
74
+ getKeyValueAsString(key) {
75
+ return getCfgRenderCtx().getKeyValueAsString(this.handle, key);
76
+ }
77
+ getKeyValueAsJson(key) {
78
+ const content = this.getKeyValueAsString(key);
79
+ if (content == void 0) throw new Error("Resource has no content.");
80
+ return JSON.parse(content);
81
+ }
82
+ getDataBase64() {
83
+ return getCfgRenderCtx().getDataBase64(this.handle);
84
+ }
85
+ getDataAsString() {
86
+ return getCfgRenderCtx().getDataAsString(this.handle);
87
+ }
88
+ getDataAsJson() {
89
+ const content = this.getDataAsString();
90
+ if (content == void 0) throw new Error("Resource has no content.");
91
+ return JSON.parse(content);
92
+ }
93
+ /**
94
+ *
95
+ */
96
+ getPColumns(errorOnUnknownField = false, prefix = "") {
97
+ const result = this.parsePObjectCollection(errorOnUnknownField, prefix);
98
+ if (result === void 0) return void 0;
99
+ return Object.entries(result).map(([, obj]) => {
100
+ if (!isPColumn(obj)) throw new Error(`not a PColumn (kind = ${obj.spec.kind})`);
101
+ return obj;
102
+ });
103
+ }
104
+ /**
105
+ *
106
+ */
107
+ parsePObjectCollection(errorOnUnknownField = false, prefix = "") {
108
+ const pObjects = getCfgRenderCtx().parsePObjectCollection(this.handle, errorOnUnknownField, prefix, ...this.resolvePath);
109
+ if (pObjects === void 0) return void 0;
110
+ const result = {};
111
+ for (const [key, value] of Object.entries(pObjects)) {
112
+ const resolvePath = [...this.resolvePath, key];
113
+ result[key] = mapPObjectData(value, (c) => new TreeNodeAccessor(c, resolvePath));
114
+ }
115
+ return result;
116
+ }
117
+ getFileContentAsBase64(range) {
118
+ return new FutureRef(getCfgRenderCtx().getBlobContentAsBase64(this.handle, range));
119
+ }
120
+ getFileContentAsString(range) {
121
+ return new FutureRef(getCfgRenderCtx().getBlobContentAsString(this.handle, range));
122
+ }
123
+ getFileContentAsJson(range) {
124
+ return new FutureRef(getCfgRenderCtx().getBlobContentAsString(this.handle, range)).mapDefined((v) => JSON.parse(v));
125
+ }
126
+ /**
127
+ * @deprecated use getFileContentAsBase64
128
+ */
129
+ getBlobContentAsBase64() {
130
+ return this.getFileContentAsBase64();
131
+ }
132
+ /**
133
+ * @deprecated use getFileContentAsString
134
+ */
135
+ getBlobContentAsString() {
136
+ return this.getFileContentAsString();
137
+ }
138
+ /**
139
+ * @returns downloaded file handle
140
+ */
141
+ getFileHandle() {
142
+ return new FutureRef(getCfgRenderCtx().getDownloadedBlobContentHandle(this.handle));
143
+ }
144
+ /**
145
+ * @deprecated use getFileHandle
146
+ */
147
+ getDownloadedBlobHandle() {
148
+ return this.getFileHandle();
149
+ }
150
+ /**
151
+ * @returns downloaded file handle
152
+ */
153
+ getRemoteFileHandle() {
154
+ return new FutureRef(getCfgRenderCtx().getOnDemandBlobContentHandle(this.handle));
155
+ }
156
+ /**
157
+ * @deprecated use getRemoteFileHandle
158
+ */
159
+ getOnDemandBlobHandle() {
160
+ return this.getRemoteFileHandle();
161
+ }
162
+ /**
163
+ * @returns the url to the extracted folder
164
+ */
165
+ extractArchiveAndGetURL(format) {
166
+ return new FutureRef(getCfgRenderCtx().extractArchiveAndGetURL(this.handle, format));
167
+ }
168
+ getImportProgress() {
169
+ return new FutureRef(getCfgRenderCtx().getImportProgress(this.handle));
170
+ }
171
+ getLastLogs(nLines) {
172
+ return new FutureRef(getCfgRenderCtx().getLastLogs(this.handle, nLines));
173
+ }
174
+ getProgressLog(patternToSearch) {
175
+ return new FutureRef(getCfgRenderCtx().getProgressLog(this.handle, patternToSearch));
176
+ }
177
+ getProgressLogWithInfo(patternToSearch) {
178
+ return new FutureRef(getCfgRenderCtx().getProgressLogWithInfo(this.handle, patternToSearch));
179
+ }
180
+ getLogHandle() {
181
+ return new FutureRef(getCfgRenderCtx().getLogHandle(this.handle));
182
+ }
183
+ allFieldsResolved(fieldType = "Input") {
184
+ switch (fieldType) {
185
+ case "Input": return this.getInputsLocked() && this.listInputFields().every((field) => this.resolve({
186
+ field,
187
+ assertFieldType: "Input"
188
+ }) !== void 0);
189
+ case "Output": return this.getOutputsLocked() && this.listOutputFields().every((field) => this.resolve({
190
+ field,
191
+ assertFieldType: "Output"
192
+ }) !== void 0);
193
+ }
194
+ }
195
+ mapFields(_mapping, _ops) {
196
+ const { fieldType, requireLocked, skipUnresolved } = {
197
+ fieldType: "Input",
198
+ requireLocked: true,
199
+ skipUnresolved: false,
200
+ ..._ops
201
+ };
202
+ const mapping = _mapping;
203
+ if (requireLocked) {
204
+ if (fieldType === "Input" && !this.getInputsLocked()) return void 0;
205
+ if (fieldType === "Output" && !this.getOutputsLocked()) return void 0;
206
+ }
207
+ let fieldEntries = (fieldType === "Input" ? this.listInputFields() : fieldType === "Output" ? this.listOutputFields() : this.listDynamicFields()).map((field) => [field, this.resolve({
208
+ field,
209
+ assertFieldType: fieldType
210
+ })]);
211
+ if (skipUnresolved) fieldEntries = fieldEntries.filter((e) => e[1] !== void 0);
212
+ return fieldEntries.map(([name, value]) => mapping(name, value));
213
+ }
214
+ };
228
215
 
216
+ //#endregion
229
217
  export { TreeNodeAccessor, ifDef };
230
- //# sourceMappingURL=accessor.js.map
218
+ //# sourceMappingURL=accessor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"accessor.js","sources":["../../src/render/accessor.ts"],"sourcesContent":["import type {\n AnyLogHandle,\n ImportProgress,\n LocalBlobHandleAndSize,\n PColumn,\n PObject,\n RemoteBlobHandleAndSize,\n FolderURL,\n ArchiveFormat,\n ProgressLogWithInfo,\n RangeBytes,\n} from \"@milaboratories/pl-model-common\";\nimport { isPColumn, mapPObjectData } from \"@milaboratories/pl-model-common\";\nimport { getCfgRenderCtx } from \"../internal\";\nimport { FutureRef } from \"./future\";\nimport type { AccessorHandle } from \"./internal\";\nimport type { CommonFieldTraverseOps, FieldTraversalStep, ResourceType } from \"./traversal_ops\";\n\nexport function ifDef<T, R>(value: T | undefined, cb: (value: T) => R): R | undefined {\n return value === undefined ? undefined : cb(value);\n}\n\ntype FieldMapOps = {\n /**\n * Type of fields to iterate over.\n * (default 'Input')\n * */\n readonly fieldType?: \"Input\" | \"Output\" | \"Dynamic\";\n /**\n * If not locked, `undefined` value will be returned. Do nothing if mapping `Dynamic` fields.\n * (default true)\n * */\n readonly requireLocked?: boolean;\n /**\n * Will skip unresolved fields.\n * (default false)\n * */\n readonly skipUnresolved?: boolean;\n};\n\n/** Represent resource tree node accessor */\nexport class TreeNodeAccessor {\n constructor(\n public readonly handle: AccessorHandle,\n public readonly resolvePath: string[],\n ) {}\n\n /** Shortcut for {@link resolveInput} */\n public resolve(\n ...steps: [\n Omit<FieldTraversalStep, \"errorIfFieldNotSet\"> & {\n errorIfFieldNotAssigned: true;\n },\n ]\n ): TreeNodeAccessor;\n /** Shortcut for {@link resolveInput} */\n public resolve(...steps: (FieldTraversalStep | string)[]): TreeNodeAccessor | undefined;\n public resolve(...steps: (FieldTraversalStep | string)[]): TreeNodeAccessor | undefined {\n const transformedSteps = steps.map(\n (s) =>\n ({\n assertFieldType: \"Input\",\n ...(typeof s === \"string\" ? { field: s } : s),\n }) satisfies FieldTraversalStep,\n );\n return this.resolveWithCommon({}, ...transformedSteps);\n }\n\n /** If field type assertion is not specified for the step, default is Output. */\n public resolveOutput(\n ...steps: [\n Omit<FieldTraversalStep, \"errorIfFieldNotSet\"> & {\n errorIfFieldNotAssigned: true;\n },\n ]\n ): TreeNodeAccessor;\n /** If field type assertion is not specified for the step, default is Output. */\n public resolveOutput(...steps: (FieldTraversalStep | string)[]): TreeNodeAccessor | undefined;\n public resolveOutput(...steps: (FieldTraversalStep | string)[]): TreeNodeAccessor | undefined {\n const transformedSteps = steps.map(\n (s) =>\n ({\n assertFieldType: \"Output\",\n ...(typeof s === \"string\" ? { field: s } : s),\n }) satisfies FieldTraversalStep,\n );\n return this.resolveWithCommon({}, ...transformedSteps);\n }\n\n /** If field type assertion is not specified for the step, default is Input. */\n public resolveInput(\n ...steps: [\n Omit<FieldTraversalStep, \"errorIfFieldNotSet\"> & {\n errorIfFieldNotAssigned: true;\n },\n ]\n ): TreeNodeAccessor;\n /** If field type assertion is not specified for the step, default is Input. */\n public resolveInput(...steps: (FieldTraversalStep | string)[]): TreeNodeAccessor | undefined;\n public resolveInput(...steps: (FieldTraversalStep | string)[]): TreeNodeAccessor | undefined {\n const transformedSteps = steps.map(\n (s) =>\n ({\n assertFieldType: \"Input\",\n ...(typeof s === \"string\" ? { field: s } : s),\n }) satisfies FieldTraversalStep,\n );\n return this.resolveWithCommon({}, ...transformedSteps);\n }\n\n public resolveAny(\n ...steps: [\n Omit<FieldTraversalStep, \"errorIfFieldNotSet\"> & {\n errorIfFieldNotAssigned: true;\n },\n ]\n ): TreeNodeAccessor;\n public resolveAny(...steps: (FieldTraversalStep | string)[]): TreeNodeAccessor | undefined;\n public resolveAny(...steps: (FieldTraversalStep | string)[]): TreeNodeAccessor | undefined {\n return this.resolveWithCommon({}, ...steps);\n }\n\n public resolveWithCommon(\n commonOptions: CommonFieldTraverseOps,\n ...steps: (FieldTraversalStep | string)[]\n ): TreeNodeAccessor | undefined {\n const resolvePath = [\n ...this.resolvePath,\n ...steps.map((step) => (typeof step === \"string\" ? step : step.field)),\n ];\n return ifDef(\n getCfgRenderCtx().resolveWithCommon(this.handle, commonOptions, ...steps),\n (accessor) => new TreeNodeAccessor(accessor, resolvePath),\n );\n }\n\n public get resourceType(): ResourceType {\n return getCfgRenderCtx().getResourceType(this.handle);\n }\n\n public getInputsLocked(): boolean {\n return getCfgRenderCtx().getInputsLocked(this.handle);\n }\n\n public getOutputsLocked(): boolean {\n return getCfgRenderCtx().getOutputsLocked(this.handle);\n }\n\n public getIsReadyOrError(): boolean {\n return getCfgRenderCtx().getIsReadyOrError(this.handle);\n }\n\n public getIsFinal(): boolean {\n return getCfgRenderCtx().getIsFinal(this.handle);\n }\n\n public getError(): TreeNodeAccessor | undefined {\n const resolvePath = [...this.resolvePath, \"error\"];\n return ifDef(\n getCfgRenderCtx().getError(this.handle),\n (accsessor) => new TreeNodeAccessor(accsessor, resolvePath),\n );\n }\n\n public listInputFields(): string[] {\n return getCfgRenderCtx().listInputFields(this.handle);\n }\n\n public listOutputFields(): string[] {\n return getCfgRenderCtx().listOutputFields(this.handle);\n }\n\n public listDynamicFields(): string[] {\n return getCfgRenderCtx().listDynamicFields(this.handle);\n }\n\n public getKeyValueBase64(key: string): string | undefined {\n return getCfgRenderCtx().getKeyValueBase64(this.handle, key);\n }\n\n public getKeyValueAsString(key: string): string | undefined {\n return getCfgRenderCtx().getKeyValueAsString(this.handle, key);\n }\n\n public getKeyValueAsJson<T>(key: string): T {\n const content = this.getKeyValueAsString(key);\n if (content == undefined) throw new Error(\"Resource has no content.\");\n return JSON.parse(content);\n }\n\n public getDataBase64(): string | undefined {\n return getCfgRenderCtx().getDataBase64(this.handle);\n }\n\n public getDataAsString(): string | undefined {\n return getCfgRenderCtx().getDataAsString(this.handle);\n }\n\n public getDataAsJson<T>(): T {\n const content = this.getDataAsString();\n if (content == undefined) throw new Error(\"Resource has no content.\");\n return JSON.parse(content);\n }\n\n /**\n *\n */\n public getPColumns(\n errorOnUnknownField: boolean = false,\n prefix: string = \"\",\n ): PColumn<TreeNodeAccessor>[] | undefined {\n const result = this.parsePObjectCollection(errorOnUnknownField, prefix);\n if (result === undefined) return undefined;\n\n const pf = Object.entries(result).map(([, obj]) => {\n if (!isPColumn(obj)) throw new Error(`not a PColumn (kind = ${obj.spec.kind})`);\n return obj;\n });\n\n return pf;\n }\n\n /**\n *\n */\n public parsePObjectCollection(\n errorOnUnknownField: boolean = false,\n prefix: string = \"\",\n ): Record<string, PObject<TreeNodeAccessor>> | undefined {\n const pObjects = getCfgRenderCtx().parsePObjectCollection(\n this.handle,\n errorOnUnknownField,\n prefix,\n ...this.resolvePath,\n );\n if (pObjects === undefined) return undefined;\n const result: Record<string, PObject<TreeNodeAccessor>> = {};\n for (const [key, value] of Object.entries(pObjects)) {\n const resolvePath = [...this.resolvePath, key];\n result[key] = mapPObjectData(value, (c) => new TreeNodeAccessor(c, resolvePath));\n }\n return result;\n }\n\n public getFileContentAsBase64(range?: RangeBytes): FutureRef<string | undefined> {\n return new FutureRef(getCfgRenderCtx().getBlobContentAsBase64(this.handle, range));\n }\n\n public getFileContentAsString(range?: RangeBytes): FutureRef<string | undefined> {\n return new FutureRef(getCfgRenderCtx().getBlobContentAsString(this.handle, range));\n }\n\n public getFileContentAsJson<T>(range?: RangeBytes): FutureRef<T | undefined> {\n return new FutureRef<string | undefined>(\n getCfgRenderCtx().getBlobContentAsString(this.handle, range),\n ).mapDefined((v) => JSON.parse(v) as T);\n }\n\n /**\n * @deprecated use getFileContentAsBase64\n */\n public getBlobContentAsBase64(): FutureRef<string | undefined> {\n return this.getFileContentAsBase64();\n }\n\n /**\n * @deprecated use getFileContentAsString\n */\n public getBlobContentAsString(): FutureRef<string | undefined> {\n return this.getFileContentAsString();\n }\n\n /**\n * @returns downloaded file handle\n */\n public getFileHandle(): FutureRef<LocalBlobHandleAndSize | undefined> {\n return new FutureRef(getCfgRenderCtx().getDownloadedBlobContentHandle(this.handle));\n }\n\n /**\n * @deprecated use getFileHandle\n */\n public getDownloadedBlobHandle(): FutureRef<LocalBlobHandleAndSize | undefined> {\n return this.getFileHandle();\n }\n\n /**\n * @returns downloaded file handle\n */\n public getRemoteFileHandle(): FutureRef<RemoteBlobHandleAndSize | undefined> {\n return new FutureRef(getCfgRenderCtx().getOnDemandBlobContentHandle(this.handle));\n }\n\n /**\n * @deprecated use getRemoteFileHandle\n */\n public getOnDemandBlobHandle(): FutureRef<RemoteBlobHandleAndSize | undefined> {\n return this.getRemoteFileHandle();\n }\n\n /**\n * @returns the url to the extracted folder\n */\n public extractArchiveAndGetURL(format: ArchiveFormat): FutureRef<FolderURL | undefined> {\n return new FutureRef(getCfgRenderCtx().extractArchiveAndGetURL(this.handle, format));\n }\n\n public getImportProgress(): FutureRef<ImportProgress> {\n return new FutureRef(getCfgRenderCtx().getImportProgress(this.handle));\n }\n\n public getLastLogs(nLines: number): FutureRef<string | undefined> {\n return new FutureRef(getCfgRenderCtx().getLastLogs(this.handle, nLines));\n }\n\n public getProgressLog(patternToSearch: string): FutureRef<string | undefined> {\n return new FutureRef(getCfgRenderCtx().getProgressLog(this.handle, patternToSearch));\n }\n\n public getProgressLogWithInfo(\n patternToSearch: string,\n ): FutureRef<ProgressLogWithInfo | undefined> {\n return new FutureRef(getCfgRenderCtx().getProgressLogWithInfo(this.handle, patternToSearch));\n }\n\n public getLogHandle(): FutureRef<AnyLogHandle | undefined> {\n return new FutureRef(getCfgRenderCtx().getLogHandle(this.handle));\n }\n\n public allFieldsResolved(fieldType: \"Input\" | \"Output\" = \"Input\"): boolean {\n switch (fieldType) {\n case \"Input\":\n return (\n this.getInputsLocked() &&\n this.listInputFields().every(\n (field) => this.resolve({ field, assertFieldType: \"Input\" }) !== undefined,\n )\n );\n case \"Output\":\n return (\n this.getOutputsLocked() &&\n this.listOutputFields().every(\n (field) => this.resolve({ field, assertFieldType: \"Output\" }) !== undefined,\n )\n );\n }\n }\n\n public mapFields<T>(\n _mapping: (name: string, value: TreeNodeAccessor) => T,\n _ops: FieldMapOps & { skipUnresolved: true },\n ): T[] | undefined;\n public mapFields<T>(\n _mapping: (name: string, value: TreeNodeAccessor | undefined) => T,\n _ops?: FieldMapOps,\n ): T[] | undefined;\n public mapFields<T>(\n _mapping: (name: string, value: TreeNodeAccessor) => T,\n _ops?: FieldMapOps,\n ): T[] | undefined {\n const { fieldType, requireLocked, skipUnresolved } = {\n fieldType: \"Input\" as const,\n requireLocked: true,\n skipUnresolved: false,\n ..._ops,\n };\n const mapping = _mapping as (name: string, value: TreeNodeAccessor | undefined) => T;\n if (requireLocked) {\n if (fieldType === \"Input\" && !this.getInputsLocked()) return undefined;\n if (fieldType === \"Output\" && !this.getOutputsLocked()) return undefined;\n }\n const fieldList =\n fieldType === \"Input\"\n ? this.listInputFields()\n : fieldType === \"Output\"\n ? this.listOutputFields()\n : this.listDynamicFields();\n let fieldEntries = fieldList.map(\n (field) => [field, this.resolve({ field, assertFieldType: fieldType })] as const,\n );\n if (skipUnresolved) fieldEntries = fieldEntries.filter((e) => e[1] !== undefined);\n return fieldEntries.map(([name, value]) => mapping(name, value));\n }\n}\n"],"names":[],"mappings":";;;;AAkBM,SAAU,KAAK,CAAO,KAAoB,EAAE,EAAmB,EAAA;AACnE,IAAA,OAAO,KAAK,KAAK,SAAS,GAAG,SAAS,GAAG,EAAE,CAAC,KAAK,CAAC;AACpD;AAoBA;MACa,gBAAgB,CAAA;AAET,IAAA,MAAA;AACA,IAAA,WAAA;IAFlB,WAAA,CACkB,MAAsB,EACtB,WAAqB,EAAA;QADrB,IAAA,CAAA,MAAM,GAAN,MAAM;QACN,IAAA,CAAA,WAAW,GAAX,WAAW;IAC1B;IAYI,OAAO,CAAC,GAAG,KAAsC,EAAA;QACtD,MAAM,gBAAgB,GAAG,KAAK,CAAC,GAAG,CAChC,CAAC,CAAC,MACC;AACC,YAAA,eAAe,EAAE,OAAO;AACxB,YAAA,IAAI,OAAO,CAAC,KAAK,QAAQ,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AAC9C,SAAA,CAA8B,CAClC;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAC,EAAE,EAAE,GAAG,gBAAgB,CAAC;IACxD;IAYO,aAAa,CAAC,GAAG,KAAsC,EAAA;QAC5D,MAAM,gBAAgB,GAAG,KAAK,CAAC,GAAG,CAChC,CAAC,CAAC,MACC;AACC,YAAA,eAAe,EAAE,QAAQ;AACzB,YAAA,IAAI,OAAO,CAAC,KAAK,QAAQ,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AAC9C,SAAA,CAA8B,CAClC;QACD,OAAO,IAAI,CAAC,iBAAiB,CAA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AS,EAAE,CAAC,CAAU,CACjF;AACD,QAAA,IAAI,cAAc;AAAE,YAAA,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;QACjF,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAClE;AACD;;;;"}
1
+ {"version":3,"file":"accessor.js","names":[],"sources":["../../src/render/accessor.ts"],"sourcesContent":["import type {\n AnyLogHandle,\n ImportProgress,\n LocalBlobHandleAndSize,\n PColumn,\n PObject,\n RemoteBlobHandleAndSize,\n FolderURL,\n ArchiveFormat,\n ProgressLogWithInfo,\n RangeBytes,\n} from \"@milaboratories/pl-model-common\";\nimport { isPColumn, mapPObjectData } from \"@milaboratories/pl-model-common\";\nimport { getCfgRenderCtx } from \"../internal\";\nimport { FutureRef } from \"./future\";\nimport type { AccessorHandle } from \"./internal\";\nimport type { CommonFieldTraverseOps, FieldTraversalStep, ResourceType } from \"./traversal_ops\";\n\nexport function ifDef<T, R>(value: T | undefined, cb: (value: T) => R): R | undefined {\n return value === undefined ? undefined : cb(value);\n}\n\ntype FieldMapOps = {\n /**\n * Type of fields to iterate over.\n * (default 'Input')\n * */\n readonly fieldType?: \"Input\" | \"Output\" | \"Dynamic\";\n /**\n * If not locked, `undefined` value will be returned. Do nothing if mapping `Dynamic` fields.\n * (default true)\n * */\n readonly requireLocked?: boolean;\n /**\n * Will skip unresolved fields.\n * (default false)\n * */\n readonly skipUnresolved?: boolean;\n};\n\n/** Represent resource tree node accessor */\nexport class TreeNodeAccessor {\n constructor(\n public readonly handle: AccessorHandle,\n public readonly resolvePath: string[],\n ) {}\n\n /** Shortcut for {@link resolveInput} */\n public resolve(\n ...steps: [\n Omit<FieldTraversalStep, \"errorIfFieldNotSet\"> & {\n errorIfFieldNotAssigned: true;\n },\n ]\n ): TreeNodeAccessor;\n /** Shortcut for {@link resolveInput} */\n public resolve(...steps: (FieldTraversalStep | string)[]): TreeNodeAccessor | undefined;\n public resolve(...steps: (FieldTraversalStep | string)[]): TreeNodeAccessor | undefined {\n const transformedSteps = steps.map(\n (s) =>\n ({\n assertFieldType: \"Input\",\n ...(typeof s === \"string\" ? { field: s } : s),\n }) satisfies FieldTraversalStep,\n );\n return this.resolveWithCommon({}, ...transformedSteps);\n }\n\n /** If field type assertion is not specified for the step, default is Output. */\n public resolveOutput(\n ...steps: [\n Omit<FieldTraversalStep, \"errorIfFieldNotSet\"> & {\n errorIfFieldNotAssigned: true;\n },\n ]\n ): TreeNodeAccessor;\n /** If field type assertion is not specified for the step, default is Output. */\n public resolveOutput(...steps: (FieldTraversalStep | string)[]): TreeNodeAccessor | undefined;\n public resolveOutput(...steps: (FieldTraversalStep | string)[]): TreeNodeAccessor | undefined {\n const transformedSteps = steps.map(\n (s) =>\n ({\n assertFieldType: \"Output\",\n ...(typeof s === \"string\" ? { field: s } : s),\n }) satisfies FieldTraversalStep,\n );\n return this.resolveWithCommon({}, ...transformedSteps);\n }\n\n /** If field type assertion is not specified for the step, default is Input. */\n public resolveInput(\n ...steps: [\n Omit<FieldTraversalStep, \"errorIfFieldNotSet\"> & {\n errorIfFieldNotAssigned: true;\n },\n ]\n ): TreeNodeAccessor;\n /** If field type assertion is not specified for the step, default is Input. */\n public resolveInput(...steps: (FieldTraversalStep | string)[]): TreeNodeAccessor | undefined;\n public resolveInput(...steps: (FieldTraversalStep | string)[]): TreeNodeAccessor | undefined {\n const transformedSteps = steps.map(\n (s) =>\n ({\n assertFieldType: \"Input\",\n ...(typeof s === \"string\" ? { field: s } : s),\n }) satisfies FieldTraversalStep,\n );\n return this.resolveWithCommon({}, ...transformedSteps);\n }\n\n public resolveAny(\n ...steps: [\n Omit<FieldTraversalStep, \"errorIfFieldNotSet\"> & {\n errorIfFieldNotAssigned: true;\n },\n ]\n ): TreeNodeAccessor;\n public resolveAny(...steps: (FieldTraversalStep | string)[]): TreeNodeAccessor | undefined;\n public resolveAny(...steps: (FieldTraversalStep | string)[]): TreeNodeAccessor | undefined {\n return this.resolveWithCommon({}, ...steps);\n }\n\n public resolveWithCommon(\n commonOptions: CommonFieldTraverseOps,\n ...steps: (FieldTraversalStep | string)[]\n ): TreeNodeAccessor | undefined {\n const resolvePath = [\n ...this.resolvePath,\n ...steps.map((step) => (typeof step === \"string\" ? step : step.field)),\n ];\n return ifDef(\n getCfgRenderCtx().resolveWithCommon(this.handle, commonOptions, ...steps),\n (accessor) => new TreeNodeAccessor(accessor, resolvePath),\n );\n }\n\n public get resourceType(): ResourceType {\n return getCfgRenderCtx().getResourceType(this.handle);\n }\n\n public getInputsLocked(): boolean {\n return getCfgRenderCtx().getInputsLocked(this.handle);\n }\n\n public getOutputsLocked(): boolean {\n return getCfgRenderCtx().getOutputsLocked(this.handle);\n }\n\n public getIsReadyOrError(): boolean {\n return getCfgRenderCtx().getIsReadyOrError(this.handle);\n }\n\n public getIsFinal(): boolean {\n return getCfgRenderCtx().getIsFinal(this.handle);\n }\n\n public getError(): TreeNodeAccessor | undefined {\n const resolvePath = [...this.resolvePath, \"error\"];\n return ifDef(\n getCfgRenderCtx().getError(this.handle),\n (accsessor) => new TreeNodeAccessor(accsessor, resolvePath),\n );\n }\n\n public listInputFields(): string[] {\n return getCfgRenderCtx().listInputFields(this.handle);\n }\n\n public listOutputFields(): string[] {\n return getCfgRenderCtx().listOutputFields(this.handle);\n }\n\n public listDynamicFields(): string[] {\n return getCfgRenderCtx().listDynamicFields(this.handle);\n }\n\n public getKeyValueBase64(key: string): string | undefined {\n return getCfgRenderCtx().getKeyValueBase64(this.handle, key);\n }\n\n public getKeyValueAsString(key: string): string | undefined {\n return getCfgRenderCtx().getKeyValueAsString(this.handle, key);\n }\n\n public getKeyValueAsJson<T>(key: string): T {\n const content = this.getKeyValueAsString(key);\n if (content == undefined) throw new Error(\"Resource has no content.\");\n return JSON.parse(content);\n }\n\n public getDataBase64(): string | undefined {\n return getCfgRenderCtx().getDataBase64(this.handle);\n }\n\n public getDataAsString(): string | undefined {\n return getCfgRenderCtx().getDataAsString(this.handle);\n }\n\n public getDataAsJson<T>(): T {\n const content = this.getDataAsString();\n if (content == undefined) throw new Error(\"Resource has no content.\");\n return JSON.parse(content);\n }\n\n /**\n *\n */\n public getPColumns(\n errorOnUnknownField: boolean = false,\n prefix: string = \"\",\n ): PColumn<TreeNodeAccessor>[] | undefined {\n const result = this.parsePObjectCollection(errorOnUnknownField, prefix);\n if (result === undefined) return undefined;\n\n const pf = Object.entries(result).map(([, obj]) => {\n if (!isPColumn(obj)) throw new Error(`not a PColumn (kind = ${obj.spec.kind})`);\n return obj;\n });\n\n return pf;\n }\n\n /**\n *\n */\n public parsePObjectCollection(\n errorOnUnknownField: boolean = false,\n prefix: string = \"\",\n ): Record<string, PObject<TreeNodeAccessor>> | undefined {\n const pObjects = getCfgRenderCtx().parsePObjectCollection(\n this.handle,\n errorOnUnknownField,\n prefix,\n ...this.resolvePath,\n );\n if (pObjects === undefined) return undefined;\n const result: Record<string, PObject<TreeNodeAccessor>> = {};\n for (const [key, value] of Object.entries(pObjects)) {\n const resolvePath = [...this.resolvePath, key];\n result[key] = mapPObjectData(value, (c) => new TreeNodeAccessor(c, resolvePath));\n }\n return result;\n }\n\n public getFileContentAsBase64(range?: RangeBytes): FutureRef<string | undefined> {\n return new FutureRef(getCfgRenderCtx().getBlobContentAsBase64(this.handle, range));\n }\n\n public getFileContentAsString(range?: RangeBytes): FutureRef<string | undefined> {\n return new FutureRef(getCfgRenderCtx().getBlobContentAsString(this.handle, range));\n }\n\n public getFileContentAsJson<T>(range?: RangeBytes): FutureRef<T | undefined> {\n return new FutureRef<string | undefined>(\n getCfgRenderCtx().getBlobContentAsString(this.handle, range),\n ).mapDefined((v) => JSON.parse(v) as T);\n }\n\n /**\n * @deprecated use getFileContentAsBase64\n */\n public getBlobContentAsBase64(): FutureRef<string | undefined> {\n return this.getFileContentAsBase64();\n }\n\n /**\n * @deprecated use getFileContentAsString\n */\n public getBlobContentAsString(): FutureRef<string | undefined> {\n return this.getFileContentAsString();\n }\n\n /**\n * @returns downloaded file handle\n */\n public getFileHandle(): FutureRef<LocalBlobHandleAndSize | undefined> {\n return new FutureRef(getCfgRenderCtx().getDownloadedBlobContentHandle(this.handle));\n }\n\n /**\n * @deprecated use getFileHandle\n */\n public getDownloadedBlobHandle(): FutureRef<LocalBlobHandleAndSize | undefined> {\n return this.getFileHandle();\n }\n\n /**\n * @returns downloaded file handle\n */\n public getRemoteFileHandle(): FutureRef<RemoteBlobHandleAndSize | undefined> {\n return new FutureRef(getCfgRenderCtx().getOnDemandBlobContentHandle(this.handle));\n }\n\n /**\n * @deprecated use getRemoteFileHandle\n */\n public getOnDemandBlobHandle(): FutureRef<RemoteBlobHandleAndSize | undefined> {\n return this.getRemoteFileHandle();\n }\n\n /**\n * @returns the url to the extracted folder\n */\n public extractArchiveAndGetURL(format: ArchiveFormat): FutureRef<FolderURL | undefined> {\n return new FutureRef(getCfgRenderCtx().extractArchiveAndGetURL(this.handle, format));\n }\n\n public getImportProgress(): FutureRef<ImportProgress> {\n return new FutureRef(getCfgRenderCtx().getImportProgress(this.handle));\n }\n\n public getLastLogs(nLines: number): FutureRef<string | undefined> {\n return new FutureRef(getCfgRenderCtx().getLastLogs(this.handle, nLines));\n }\n\n public getProgressLog(patternToSearch: string): FutureRef<string | undefined> {\n return new FutureRef(getCfgRenderCtx().getProgressLog(this.handle, patternToSearch));\n }\n\n public getProgressLogWithInfo(\n patternToSearch: string,\n ): FutureRef<ProgressLogWithInfo | undefined> {\n return new FutureRef(getCfgRenderCtx().getProgressLogWithInfo(this.handle, patternToSearch));\n }\n\n public getLogHandle(): FutureRef<AnyLogHandle | undefined> {\n return new FutureRef(getCfgRenderCtx().getLogHandle(this.handle));\n }\n\n public allFieldsResolved(fieldType: \"Input\" | \"Output\" = \"Input\"): boolean {\n switch (fieldType) {\n case \"Input\":\n return (\n this.getInputsLocked() &&\n this.listInputFields().every(\n (field) => this.resolve({ field, assertFieldType: \"Input\" }) !== undefined,\n )\n );\n case \"Output\":\n return (\n this.getOutputsLocked() &&\n this.listOutputFields().every(\n (field) => this.resolve({ field, assertFieldType: \"Output\" }) !== undefined,\n )\n );\n }\n }\n\n public mapFields<T>(\n _mapping: (name: string, value: TreeNodeAccessor) => T,\n _ops: FieldMapOps & { skipUnresolved: true },\n ): T[] | undefined;\n public mapFields<T>(\n _mapping: (name: string, value: TreeNodeAccessor | undefined) => T,\n _ops?: FieldMapOps,\n ): T[] | undefined;\n public mapFields<T>(\n _mapping: (name: string, value: TreeNodeAccessor) => T,\n _ops?: FieldMapOps,\n ): T[] | undefined {\n const { fieldType, requireLocked, skipUnresolved } = {\n fieldType: \"Input\" as const,\n requireLocked: true,\n skipUnresolved: false,\n ..._ops,\n };\n const mapping = _mapping as (name: string, value: TreeNodeAccessor | undefined) => T;\n if (requireLocked) {\n if (fieldType === \"Input\" && !this.getInputsLocked()) return undefined;\n if (fieldType === \"Output\" && !this.getOutputsLocked()) return undefined;\n }\n const fieldList =\n fieldType === \"Input\"\n ? this.listInputFields()\n : fieldType === \"Output\"\n ? this.listOutputFields()\n : this.listDynamicFields();\n let fieldEntries = fieldList.map(\n (field) => [field, this.resolve({ field, assertFieldType: fieldType })] as const,\n );\n if (skipUnresolved) fieldEntries = fieldEntries.filter((e) => e[1] !== undefined);\n return fieldEntries.map(([name, value]) => mapping(name, value));\n }\n}\n"],"mappings":";;;;;AAkBA,SAAgB,MAAY,OAAsB,IAAoC;AACpF,QAAO,UAAU,SAAY,SAAY,GAAG,MAAM;;;AAsBpD,IAAa,mBAAb,MAAa,iBAAiB;CAC5B,YACE,AAAgB,QAChB,AAAgB,aAChB;EAFgB;EACA;;CAalB,AAAO,QAAQ,GAAG,OAAsE;EACtF,MAAM,mBAAmB,MAAM,KAC5B,OACE;GACC,iBAAiB;GACjB,GAAI,OAAO,MAAM,WAAW,EAAE,OAAO,GAAG,GAAG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