@platforma-sdk/model 1.58.5 → 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 (365) 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 -60
  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 -58
  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 +10 -4
  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/index.ts +12 -11
  272. package/src/internal.ts +0 -1
  273. package/src/platforma.ts +4 -4
  274. package/src/plugin_handle.ts +1 -1
  275. package/src/plugin_model.test.ts +217 -21
  276. package/src/plugin_model.ts +450 -55
  277. package/src/raw_globals.ts +0 -1
  278. package/dist/annotations/converter.d.ts.map +0 -1
  279. package/dist/annotations/index.d.ts.map +0 -1
  280. package/dist/annotations/types.d.ts.map +0 -1
  281. package/dist/bconfig/index.d.ts.map +0 -1
  282. package/dist/bconfig/lambdas.d.ts.map +0 -1
  283. package/dist/bconfig/normalization.d.ts.map +0 -1
  284. package/dist/bconfig/types.d.ts.map +0 -1
  285. package/dist/bconfig/util.d.ts.map +0 -1
  286. package/dist/bconfig/v3.d.ts.map +0 -1
  287. package/dist/block_api_v1.d.ts.map +0 -1
  288. package/dist/block_api_v2.d.ts.map +0 -1
  289. package/dist/block_api_v3.d.ts.map +0 -1
  290. package/dist/block_migrations.d.ts.map +0 -1
  291. package/dist/block_model.d.ts.map +0 -1
  292. package/dist/block_model_legacy.d.ts.map +0 -1
  293. package/dist/block_state_patch.d.ts.map +0 -1
  294. package/dist/block_state_util.d.ts.map +0 -1
  295. package/dist/block_storage.d.ts.map +0 -1
  296. package/dist/block_storage_callbacks.d.ts +0 -115
  297. package/dist/block_storage_callbacks.d.ts.map +0 -1
  298. package/dist/block_storage_facade.d.ts.map +0 -1
  299. package/dist/components/PFrameForGraphs.d.ts.map +0 -1
  300. package/dist/components/PlAnnotations/filter.d.ts.map +0 -1
  301. package/dist/components/PlAnnotations/filters_ui.d.ts.map +0 -1
  302. package/dist/components/PlAnnotations/index.d.ts.map +0 -1
  303. package/dist/components/PlAnnotations/types.d.ts +0 -3
  304. package/dist/components/PlAnnotations/types.d.ts.map +0 -1
  305. package/dist/components/PlDataTable/index.d.ts.map +0 -1
  306. package/dist/components/PlDataTable/labels.d.ts +0 -7
  307. package/dist/components/PlDataTable/labels.d.ts.map +0 -1
  308. package/dist/components/PlDataTable/state-migration.d.ts.map +0 -1
  309. package/dist/components/PlDataTable/table.d.ts.map +0 -1
  310. package/dist/components/PlDataTable/v4.d.ts.map +0 -1
  311. package/dist/components/PlDataTable/v5.d.ts.map +0 -1
  312. package/dist/components/PlMultiSequenceAlignment.d.ts.map +0 -1
  313. package/dist/components/PlSelectionModel.d.ts.map +0 -1
  314. package/dist/components/index.d.ts.map +0 -1
  315. package/dist/config/actions.d.ts.map +0 -1
  316. package/dist/config/actions_kinds.d.ts.map +0 -1
  317. package/dist/config/index.d.ts.map +0 -1
  318. package/dist/config/model.d.ts.map +0 -1
  319. package/dist/config/model_meta.d.ts.map +0 -1
  320. package/dist/config/type_engine.d.ts.map +0 -1
  321. package/dist/config/type_util.d.ts.map +0 -1
  322. package/dist/env_value.d.ts.map +0 -1
  323. package/dist/filters/converters/filterToQuery.d.ts.map +0 -1
  324. package/dist/filters/converters/filterUiToExpressionImpl.d.ts.map +0 -1
  325. package/dist/filters/converters/index.d.ts.map +0 -1
  326. package/dist/filters/distill.d.ts.map +0 -1
  327. package/dist/filters/index.d.ts.map +0 -1
  328. package/dist/filters/traverse.d.ts +0 -27
  329. package/dist/filters/traverse.d.ts.map +0 -1
  330. package/dist/filters/types.d.ts.map +0 -1
  331. package/dist/index.cjs.map +0 -1
  332. package/dist/index.d.ts.map +0 -1
  333. package/dist/index.js.map +0 -1
  334. package/dist/internal.d.ts +0 -36
  335. package/dist/internal.d.ts.map +0 -1
  336. package/dist/package.json.cjs +0 -6
  337. package/dist/package.json.cjs.map +0 -1
  338. package/dist/package.json.js +0 -4
  339. package/dist/package.json.js.map +0 -1
  340. package/dist/pframe.d.ts.map +0 -1
  341. package/dist/pframe_utils/axes.d.ts.map +0 -1
  342. package/dist/pframe_utils/columns.d.ts.map +0 -1
  343. package/dist/pframe_utils/index.d.ts.map +0 -1
  344. package/dist/pframe_utils/querySpec.d.ts +0 -2
  345. package/dist/pframe_utils/querySpec.d.ts.map +0 -1
  346. package/dist/platforma.d.ts.map +0 -1
  347. package/dist/plugin_handle.d.ts.map +0 -1
  348. package/dist/plugin_model.d.ts.map +0 -1
  349. package/dist/raw_globals.d.ts.map +0 -1
  350. package/dist/ref_util.d.ts.map +0 -1
  351. package/dist/render/accessor.d.ts.map +0 -1
  352. package/dist/render/api.d.ts.map +0 -1
  353. package/dist/render/future.d.ts.map +0 -1
  354. package/dist/render/index.d.ts.map +0 -1
  355. package/dist/render/internal.d.ts.map +0 -1
  356. package/dist/render/traversal_ops.d.ts.map +0 -1
  357. package/dist/render/util/axis_filtering.d.ts.map +0 -1
  358. package/dist/render/util/column_collection.d.ts.map +0 -1
  359. package/dist/render/util/index.d.ts.map +0 -1
  360. package/dist/render/util/label.d.ts.map +0 -1
  361. package/dist/render/util/pcolumn_data.d.ts.map +0 -1
  362. package/dist/render/util/pframe_upgraders.d.ts +0 -3
  363. package/dist/render/util/pframe_upgraders.d.ts.map +0 -1
  364. package/dist/render/util/split_selectors.d.ts.map +0 -1
  365. package/dist/version.d.ts.map +0 -1
@@ -1,77 +1,83 @@
1
- import type { Optional } from "utility-types";
2
- import type { Branded, StringifiedJson } from "@milaboratories/pl-model-common";
3
- import type { CommonFieldTraverseOps, FieldTraversalStep, ResourceType } from "./traversal_ops";
4
- import type { ArchiveFormat, AnyFunction, Option, PColumn, PColumnValues, PFrameDef, PFrameHandle, PObject, PObjectSpec, PSpecPredicate, PTableDef, PTableDefV2, PTableHandle, ResultCollection, ValueOrError, DataInfo, RangeBytes } from "@milaboratories/pl-model-common";
5
- import type { TreeNodeAccessor } from "./accessor";
6
- export declare const StagingAccessorName = "staging";
7
- export declare const MainAccessorName = "main";
8
- export type AccessorHandle = Branded<string, "AccessorHandle">;
9
- export type FutureHandle = Branded<string, "FutureHandle">;
10
- export type PColumnDataUniversal<TreeEntry = TreeNodeAccessor> = TreeEntry | DataInfo<TreeEntry> | PColumnValues;
11
- export interface GlobalCfgRenderCtxMethods<AHandle = AccessorHandle, FHandle = FutureHandle> {
12
- getAccessorHandleByName(name: string): AHandle | undefined;
13
- resolveWithCommon(handle: AHandle, commonOptions: CommonFieldTraverseOps, ...steps: (FieldTraversalStep | string)[]): AHandle | undefined;
14
- getResourceType(handle: AHandle): ResourceType;
15
- getInputsLocked(handle: AHandle): boolean;
16
- getOutputsLocked(handle: AHandle): boolean;
17
- getIsReadyOrError(handle: AHandle): boolean;
18
- getIsFinal(handle: AHandle): boolean;
19
- getError(handle: AHandle): AHandle | undefined;
20
- listInputFields(handle: AHandle): string[];
21
- listOutputFields(handle: AHandle): string[];
22
- listDynamicFields(handle: AHandle): string[];
23
- getKeyValueBase64(handle: AHandle, key: string): string | undefined;
24
- getKeyValueAsString(handle: AHandle, key: string): string | undefined;
25
- getDataBase64(handle: AHandle): string | undefined;
26
- getDataAsString(handle: AHandle): string | undefined;
27
- /** If not final returns undefined */
28
- parsePObjectCollection(handle: AHandle, errorOnUnknownField: boolean, prefix: string, ...resolvePath: string[]): Record<string, PObject<AHandle>> | undefined;
29
- getBlobContentAsBase64(handle: AHandle, range?: RangeBytes): FHandle;
30
- getBlobContentAsString(handle: AHandle, range?: RangeBytes): FHandle;
31
- getDownloadedBlobContentHandle(handle: AHandle): FHandle;
32
- getOnDemandBlobContentHandle(handle: AHandle): FHandle;
33
- extractArchiveAndGetURL(handle: AHandle, format: ArchiveFormat): FHandle;
34
- getImportProgress(handle: AHandle): FHandle;
35
- getLastLogs(handle: AHandle, nLines: number): FHandle;
36
- getProgressLog(handle: AHandle, patternToSearch: string): FHandle;
37
- getProgressLogWithInfo(handle: AHandle, patternToSearch: string): FHandle;
38
- getLogHandle(handle: AHandle): FHandle;
39
- /** @deprecated at some point will stop working and will return dummy values */
40
- getBlockLabel(blockId: string): string;
41
- getDataFromResultPool(): ResultCollection<PObject<AHandle>>;
42
- getDataWithErrorsFromResultPool(): ResultCollection<Optional<PObject<ValueOrError<AHandle, Error>>, "id">>;
43
- getSpecsFromResultPool(): ResultCollection<PObjectSpec>;
44
- getSpecFromResultPoolByRef(blockId: string, exportName: string): PObjectSpec | undefined;
45
- getDataFromResultPoolByRef(blockId: string, exportName: string): PObject<AHandle> | undefined;
46
- calculateOptions(predicate: PSpecPredicate): Option[];
47
- createPFrame(def: PFrameDef<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>): PFrameHandle;
48
- createPTable(def: PTableDef<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>): PTableHandle;
49
- createPTableV2(def: PTableDefV2<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>): PTableHandle;
50
- getCurrentUnstableMarker(): string | undefined;
51
- logInfo(message: string): void;
52
- logWarn(message: string): void;
53
- logError(message: string): void;
1
+ import { CommonFieldTraverseOps, FieldTraversalStep, ResourceType } from "./traversal_ops.js";
2
+ import { TreeNodeAccessor } from "./accessor.js";
3
+ import { AnyFunction, ArchiveFormat, Branded, DataInfo, Option, PColumn, PColumnValues, PFrameDef, PFrameHandle, PObject, PObjectSpec, PSpecPredicate, PTableDef, PTableDefV2, PTableHandle, RangeBytes, ResultCollection, StringifiedJson, ValueOrError } from "@milaboratories/pl-model-common";
4
+ import { Optional } from "utility-types";
5
+
6
+ //#region src/render/internal.d.ts
7
+ declare namespace internal_d_exports {
8
+ export { AccessorHandle, FutureAwait, FutureHandle, GlobalCfgRenderCtx, GlobalCfgRenderCtxFeatureFlags, GlobalCfgRenderCtxMethods, MainAccessorName, PColumnDataUniversal, StagingAccessorName, getAllFutureAwaits, isFutureAwait };
54
9
  }
55
- export declare const GlobalCfgRenderCtxFeatureFlags: {
56
- explicitColumnsSupport: true;
57
- inlineColumnsSupport: true;
58
- activeArgs: true;
59
- pTablePartitionFiltersSupport: true;
60
- pFrameInSetFilterSupport: true;
10
+ declare const StagingAccessorName = "staging";
11
+ declare const MainAccessorName = "main";
12
+ type AccessorHandle = Branded<string, "AccessorHandle">;
13
+ type FutureHandle = Branded<string, "FutureHandle">;
14
+ type PColumnDataUniversal<TreeEntry = TreeNodeAccessor> = TreeEntry | DataInfo<TreeEntry> | PColumnValues;
15
+ interface GlobalCfgRenderCtxMethods<AHandle = AccessorHandle, FHandle = FutureHandle> {
16
+ getAccessorHandleByName(name: string): AHandle | undefined;
17
+ resolveWithCommon(handle: AHandle, commonOptions: CommonFieldTraverseOps, ...steps: (FieldTraversalStep | string)[]): AHandle | undefined;
18
+ getResourceType(handle: AHandle): ResourceType;
19
+ getInputsLocked(handle: AHandle): boolean;
20
+ getOutputsLocked(handle: AHandle): boolean;
21
+ getIsReadyOrError(handle: AHandle): boolean;
22
+ getIsFinal(handle: AHandle): boolean;
23
+ getError(handle: AHandle): AHandle | undefined;
24
+ listInputFields(handle: AHandle): string[];
25
+ listOutputFields(handle: AHandle): string[];
26
+ listDynamicFields(handle: AHandle): string[];
27
+ getKeyValueBase64(handle: AHandle, key: string): string | undefined;
28
+ getKeyValueAsString(handle: AHandle, key: string): string | undefined;
29
+ getDataBase64(handle: AHandle): string | undefined;
30
+ getDataAsString(handle: AHandle): string | undefined;
31
+ /** If not final returns undefined */
32
+ parsePObjectCollection(handle: AHandle, errorOnUnknownField: boolean, prefix: string, ...resolvePath: string[]): Record<string, PObject<AHandle>> | undefined;
33
+ getBlobContentAsBase64(handle: AHandle, range?: RangeBytes): FHandle;
34
+ getBlobContentAsString(handle: AHandle, range?: RangeBytes): FHandle;
35
+ getDownloadedBlobContentHandle(handle: AHandle): FHandle;
36
+ getOnDemandBlobContentHandle(handle: AHandle): FHandle;
37
+ extractArchiveAndGetURL(handle: AHandle, format: ArchiveFormat): FHandle;
38
+ getImportProgress(handle: AHandle): FHandle;
39
+ getLastLogs(handle: AHandle, nLines: number): FHandle;
40
+ getProgressLog(handle: AHandle, patternToSearch: string): FHandle;
41
+ getProgressLogWithInfo(handle: AHandle, patternToSearch: string): FHandle;
42
+ getLogHandle(handle: AHandle): FHandle;
43
+ /** @deprecated at some point will stop working and will return dummy values */
44
+ getBlockLabel(blockId: string): string;
45
+ getDataFromResultPool(): ResultCollection<PObject<AHandle>>;
46
+ getDataWithErrorsFromResultPool(): ResultCollection<Optional<PObject<ValueOrError<AHandle, Error>>, "id">>;
47
+ getSpecsFromResultPool(): ResultCollection<PObjectSpec>;
48
+ getSpecFromResultPoolByRef(blockId: string, exportName: string): PObjectSpec | undefined;
49
+ getDataFromResultPoolByRef(blockId: string, exportName: string): PObject<AHandle> | undefined;
50
+ calculateOptions(predicate: PSpecPredicate): Option[];
51
+ createPFrame(def: PFrameDef<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>): PFrameHandle;
52
+ createPTable(def: PTableDef<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>): PTableHandle;
53
+ createPTableV2(def: PTableDefV2<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>): PTableHandle;
54
+ getCurrentUnstableMarker(): string | undefined;
55
+ logInfo(message: string): void;
56
+ logWarn(message: string): void;
57
+ logError(message: string): void;
58
+ }
59
+ declare const GlobalCfgRenderCtxFeatureFlags: {
60
+ explicitColumnsSupport: true;
61
+ inlineColumnsSupport: true;
62
+ activeArgs: true;
63
+ pTablePartitionFiltersSupport: true;
64
+ pFrameInSetFilterSupport: true;
61
65
  };
62
- export interface GlobalCfgRenderCtx extends GlobalCfgRenderCtxMethods {
63
- readonly args: string | (() => string);
64
- /** @deprecated Use `data` instead. Optional for backward compatibility - falls back to `data` if not injected. */
65
- readonly uiState?: string | (() => string);
66
- readonly data: string | (() => string);
67
- readonly activeArgs: undefined | string | (() => string | undefined);
68
- readonly blockStorage: () => StringifiedJson;
69
- readonly callbackRegistry: Record<string, AnyFunction>;
70
- readonly featureFlags?: typeof GlobalCfgRenderCtxFeatureFlags;
66
+ interface GlobalCfgRenderCtx extends GlobalCfgRenderCtxMethods {
67
+ readonly args: string | (() => string);
68
+ /** @deprecated Use `data` instead. Optional for backward compatibility - falls back to `data` if not injected. */
69
+ readonly uiState?: string | (() => string);
70
+ readonly data: string | (() => string);
71
+ readonly activeArgs: undefined | string | (() => string | undefined);
72
+ readonly blockStorage: () => StringifiedJson;
73
+ readonly callbackRegistry: Record<string, AnyFunction>;
74
+ readonly featureFlags?: typeof GlobalCfgRenderCtxFeatureFlags;
71
75
  }
72
- export type FutureAwait = {
73
- __awaited_futures__: FutureHandle[];
76
+ type FutureAwait = {
77
+ __awaited_futures__: FutureHandle[];
74
78
  };
75
- export declare function isFutureAwait(obj: unknown): obj is FutureAwait;
76
- export declare function getAllFutureAwaits(obj: unknown): Set<string>;
79
+ declare function isFutureAwait(obj: unknown): obj is FutureAwait;
80
+ declare function getAllFutureAwaits(obj: unknown): Set<string>;
81
+ //#endregion
82
+ export { AccessorHandle, FutureAwait, FutureHandle, GlobalCfgRenderCtx, PColumnDataUniversal, internal_d_exports };
77
83
  //# sourceMappingURL=internal.d.ts.map
@@ -1,37 +1,40 @@
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+
3
+ //#region src/render/internal.ts
4
+ var internal_exports = /* @__PURE__ */ __exportAll({
5
+ GlobalCfgRenderCtxFeatureFlags: () => GlobalCfgRenderCtxFeatureFlags,
6
+ MainAccessorName: () => MainAccessorName,
7
+ StagingAccessorName: () => StagingAccessorName,
8
+ getAllFutureAwaits: () => getAllFutureAwaits,
9
+ isFutureAwait: () => isFutureAwait
10
+ });
1
11
  const StagingAccessorName = "staging";
2
12
  const MainAccessorName = "main";
3
13
  const GlobalCfgRenderCtxFeatureFlags = {
4
- explicitColumnsSupport: true,
5
- inlineColumnsSupport: true,
6
- activeArgs: true,
7
- pTablePartitionFiltersSupport: true,
8
- pFrameInSetFilterSupport: true,
14
+ explicitColumnsSupport: true,
15
+ inlineColumnsSupport: true,
16
+ activeArgs: true,
17
+ pTablePartitionFiltersSupport: true,
18
+ pFrameInSetFilterSupport: true
9
19
  };
10
20
  function isFutureAwait(obj) {
11
- return typeof obj === "object" && obj !== null && "__awaited_futures__" in obj;
21
+ return typeof obj === "object" && obj !== null && "__awaited_futures__" in obj;
12
22
  }
13
23
  function addAllFutureAwaits(set, visited, node) {
14
- if (visited.has(node))
15
- return;
16
- visited.add(node);
17
- const type = typeof node;
18
- if (type === "object") {
19
- if (isFutureAwait(node))
20
- node.__awaited_futures__.forEach((a) => set.add(a));
21
- else if (Array.isArray(node))
22
- for (const nested of node)
23
- addAllFutureAwaits(set, visited, nested);
24
- else
25
- for (const [, nested] of Object.entries(node))
26
- if (nested !== node)
27
- addAllFutureAwaits(set, visited, nested);
28
- }
24
+ if (visited.has(node)) return;
25
+ visited.add(node);
26
+ if (typeof node === "object") {
27
+ if (isFutureAwait(node)) node.__awaited_futures__.forEach((a) => set.add(a));
28
+ else if (Array.isArray(node)) for (const nested of node) addAllFutureAwaits(set, visited, nested);
29
+ else for (const [, nested] of Object.entries(node)) if (nested !== node) addAllFutureAwaits(set, visited, nested);
30
+ }
29
31
  }
30
32
  function getAllFutureAwaits(obj) {
31
- const set = new Set();
32
- addAllFutureAwaits(set, new Set(), obj);
33
- return set;
33
+ const set = /* @__PURE__ */ new Set();
34
+ addAllFutureAwaits(set, /* @__PURE__ */ new Set(), obj);
35
+ return set;
34
36
  }
35
37
 
36
- export { GlobalCfgRenderCtxFeatureFlags, MainAccessorName, StagingAccessorName, getAllFutureAwaits, isFutureAwait };
37
- //# sourceMappingURL=internal.js.map
38
+ //#endregion
39
+ export { MainAccessorName, StagingAccessorName, internal_exports };
40
+ //# sourceMappingURL=internal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sources":["../../src/render/internal.ts"],"sourcesContent":["import type { Optional } from \"utility-types\";\nimport type { Branded, StringifiedJson } from \"@milaboratories/pl-model-common\";\nimport type { CommonFieldTraverseOps, FieldTraversalStep, ResourceType } from \"./traversal_ops\";\nimport type {\n ArchiveFormat,\n AnyFunction,\n Option,\n PColumn,\n PColumnValues,\n PFrameDef,\n PFrameHandle,\n PObject,\n PObjectSpec,\n PSpecPredicate,\n PTableDef,\n PTableDefV2,\n PTableHandle,\n ResultCollection,\n ValueOrError,\n DataInfo,\n RangeBytes,\n} from \"@milaboratories/pl-model-common\";\nimport type { TreeNodeAccessor } from \"./accessor\";\n\nexport const StagingAccessorName = \"staging\";\nexport const MainAccessorName = \"main\";\n\nexport type AccessorHandle = Branded<string, \"AccessorHandle\">;\nexport type FutureHandle = Branded<string, \"FutureHandle\">;\n\nexport type PColumnDataUniversal<TreeEntry = TreeNodeAccessor> =\n | TreeEntry\n | DataInfo<TreeEntry>\n | PColumnValues;\n\nexport interface GlobalCfgRenderCtxMethods<AHandle = AccessorHandle, FHandle = FutureHandle> {\n //\n // Root accessor creation\n //\n\n getAccessorHandleByName(name: string): AHandle | undefined;\n\n //\n // Basic resource accessor actions\n //\n\n resolveWithCommon(\n handle: AHandle,\n commonOptions: CommonFieldTraverseOps,\n ...steps: (FieldTraversalStep | string)[]\n ): AHandle | undefined;\n\n getResourceType(handle: AHandle): ResourceType;\n\n getInputsLocked(handle: AHandle): boolean;\n\n getOutputsLocked(handle: AHandle): boolean;\n\n getIsReadyOrError(handle: AHandle): boolean;\n\n getIsFinal(handle: AHandle): boolean;\n\n getError(handle: AHandle): AHandle | undefined;\n\n listInputFields(handle: AHandle): string[];\n\n listOutputFields(handle: AHandle): string[];\n\n listDynamicFields(handle: AHandle): string[];\n\n getKeyValueBase64(handle: AHandle, key: string): string | undefined;\n\n getKeyValueAsString(handle: AHandle, key: string): string | undefined;\n\n getDataBase64(handle: AHandle): string | undefined;\n\n getDataAsString(handle: AHandle): string | undefined;\n\n /** If not final returns undefined */\n parsePObjectCollection(\n handle: AHandle,\n errorOnUnknownField: boolean,\n prefix: string,\n ...resolvePath: string[]\n ): Record<string, PObject<AHandle>> | undefined;\n\n //\n // Blob\n //\n\n getBlobContentAsBase64(handle: AHandle, range?: RangeBytes): FHandle; // string | undefined\n\n getBlobContentAsString(handle: AHandle, range?: RangeBytes): FHandle; // string | undefined\n\n getDownloadedBlobContentHandle(handle: AHandle): FHandle; // LocalBlobHandleAndSize | undefined;\n\n getOnDemandBlobContentHandle(handle: AHandle): FHandle; // RemoteBlobHandleAndSize | undefined;\n\n //\n // Blobs to URLs\n //\n\n extractArchiveAndGetURL(handle: AHandle, format: ArchiveFormat): FHandle;\n\n //\n // Import progress\n //\n\n getImportProgress(handle: AHandle): FHandle; // ImportProgress;\n\n //\n // Logs\n //\n\n getLastLogs(handle: AHandle, nLines: number): FHandle; // string | undefined;\n\n getProgressLog(handle: AHandle, patternToSearch: string): FHandle; // string | undefined;\n\n getProgressLogWithInfo(handle: AHandle, patternToSearch: string): FHandle; // ProgressLogWithInfo | undefined;\n\n getLogHandle(handle: AHandle): FHandle; // AnyLogHandle | undefined;\n\n //\n // Blocks\n //\n\n /** @deprecated at some point will stop working and will return dummy values */\n getBlockLabel(blockId: string): string;\n\n //\n // Result Pool\n //\n\n getDataFromResultPool(): ResultCollection<PObject<AHandle>>;\n\n getDataWithErrorsFromResultPool(): ResultCollection<\n Optional<PObject<ValueOrError<AHandle, Error>>, \"id\">\n >;\n\n getSpecsFromResultPool(): ResultCollection<PObjectSpec>;\n\n getSpecFromResultPoolByRef(blockId: string, exportName: string): PObjectSpec | undefined;\n\n getDataFromResultPoolByRef(blockId: string, exportName: string): PObject<AHandle> | undefined;\n\n calculateOptions(predicate: PSpecPredicate): Option[];\n\n //\n // PFrame / PTable\n //\n\n createPFrame(def: PFrameDef<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>): PFrameHandle;\n\n createPTable(def: PTableDef<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>): PTableHandle;\n\n createPTableV2(\n def: PTableDefV2<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>,\n ): PTableHandle;\n\n //\n // Computable\n //\n\n getCurrentUnstableMarker(): string | undefined;\n\n //\n // Logging\n //\n\n logInfo(message: string): void;\n\n logWarn(message: string): void;\n\n logError(message: string): void;\n}\n\nexport const GlobalCfgRenderCtxFeatureFlags = {\n explicitColumnsSupport: true as const,\n inlineColumnsSupport: true as const,\n activeArgs: true as const,\n pTablePartitionFiltersSupport: true as const,\n pFrameInSetFilterSupport: true as const,\n};\n\nexport interface GlobalCfgRenderCtx extends GlobalCfgRenderCtxMethods {\n //\n // State: Args, UI State, Active Args\n //\n // Old runtime injects these values as strings, new runtime injects them as functions\n // that return strings, if block declares supportsLazyState flag.\n // If function not called in lazy state API, then resulting output will not depend on these values,\n // and thus will not be recalculated on corresponding state change.\n //\n\n readonly args: string | (() => string);\n /** @deprecated Use `data` instead. Optional for backward compatibility - falls back to `data` if not injected. */\n readonly uiState?: string | (() => string);\n readonly data: string | (() => string);\n readonly activeArgs: undefined | string | (() => string | undefined);\n\n readonly blockStorage: () => StringifiedJson;\n\n // Note: strings below are used because, anyway, using strings is the only way\n // to get data inside the QuickJS context, as it is implemented now. With this\n // approach deserialization can be lazily postponed until it is actually needed.\n readonly callbackRegistry: Record<string, AnyFunction>;\n readonly featureFlags?: typeof GlobalCfgRenderCtxFeatureFlags;\n}\n\nexport type FutureAwait = {\n __awaited_futures__: FutureHandle[];\n};\n\nexport function isFutureAwait(obj: unknown): obj is FutureAwait {\n return typeof obj === \"object\" && obj !== null && \"__awaited_futures__\" in obj;\n}\n\nfunction addAllFutureAwaits(set: Set<string>, visited: Set<unknown>, node: unknown) {\n if (visited.has(node)) return;\n visited.add(node);\n\n const type = typeof node;\n if (type === \"object\") {\n if (isFutureAwait(node)) node.__awaited_futures__.forEach((a) => set.add(a));\n else if (Array.isArray(node))\n for (const nested of node) addAllFutureAwaits(set, visited, nested);\n else\n for (const [, nested] of Object.entries(node as object))\n if (nested !== node) addAllFutureAwaits(set, visited, nested);\n }\n}\n\nexport function getAllFutureAwaits(obj: unknown): Set<string> {\n const set = new Set<string>();\n addAllFutureAwaits(set, new Set(), obj);\n return set;\n}\n"],"names":[],"mappings":"AAwBO,MAAM,mBAAmB,GAAG;AAC5B,MAAM,gBAAgB,GAAG;AAuJzB,MAAM,8BAA8B,GAAG;AAC5C,IAAA,sBAAsB,EAAE,IAAa;AACrC,IAAA,oBAAoB,EAAE,IAAa;AACnC,IAAA,UAAU,EAAE,IAAa;AACzB,IAAA,6BAA6B,EAAE,IAAa;AAC5C,IAAA,wBAAwB,EAAE,IAAa;;AAgCnC,SAAU,aAAa,CAAC,GAAY,EAAA;AACxC,IAAA,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,qBAAqB,IAAI,GAAG;AAChF;AAEA,SAAS,kBAAkB,CAAC,GAAgB,EAAE,OAAqB,EAAE,IAAa,EAAA;AAChF,IAAA,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE;AACvB,IAAA,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;AAEjB,IAAA,MAAM,IAAI,GAAG,OAAO,IAAI;AACxB,IAAA,IAAI,IAAI,KAAK,QAAQ,EAAE;QACrB,IAAI,aAAa,CAAC,IAAI,CAAC;AAAE,YAAA,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACvE,aAAA,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;YAC1B,KAAK,MAAM,MAAM,IAAI,IAAI;AAAE,gBAAA,kBAAkB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC;;YAEnE,KAAK,MAAM,GAAG,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAc,CAAC;gBACrD,IAAI,MAAM,KAAK,IAAI;AAAE,oBAAA,kBAAkB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC;IACnE;AACF;AAEM,SAAU,kBAAkB,CAAC,GAAY,EAAA;AAC7C,IAAA,MAAM,GAAG,GAAG,IAAI,GAAG,EAAU;IAC7B,kBAAkB,CAAC,GAAG,EAAE,IAAI,GAAG,EAAE,EAAE,GAAG,CAAC;AACvC,IAAA,OAAO,GAAG;AACZ;;;;"}
1
+ {"version":3,"file":"internal.js","names":[],"sources":["../../src/render/internal.ts"],"sourcesContent":["import type { Optional } from \"utility-types\";\nimport type { Branded, StringifiedJson } from \"@milaboratories/pl-model-common\";\nimport type { CommonFieldTraverseOps, FieldTraversalStep, ResourceType } from \"./traversal_ops\";\nimport type {\n ArchiveFormat,\n AnyFunction,\n Option,\n PColumn,\n PColumnValues,\n PFrameDef,\n PFrameHandle,\n PObject,\n PObjectSpec,\n PSpecPredicate,\n PTableDef,\n PTableDefV2,\n PTableHandle,\n ResultCollection,\n ValueOrError,\n DataInfo,\n RangeBytes,\n} from \"@milaboratories/pl-model-common\";\nimport type { TreeNodeAccessor } from \"./accessor\";\n\nexport const StagingAccessorName = \"staging\";\nexport const MainAccessorName = \"main\";\n\nexport type AccessorHandle = Branded<string, \"AccessorHandle\">;\nexport type FutureHandle = Branded<string, \"FutureHandle\">;\n\nexport type PColumnDataUniversal<TreeEntry = TreeNodeAccessor> =\n | TreeEntry\n | DataInfo<TreeEntry>\n | PColumnValues;\n\nexport interface GlobalCfgRenderCtxMethods<AHandle = AccessorHandle, FHandle = FutureHandle> {\n //\n // Root accessor creation\n //\n\n getAccessorHandleByName(name: string): AHandle | undefined;\n\n //\n // Basic resource accessor actions\n //\n\n resolveWithCommon(\n handle: AHandle,\n commonOptions: CommonFieldTraverseOps,\n ...steps: (FieldTraversalStep | string)[]\n ): AHandle | undefined;\n\n getResourceType(handle: AHandle): ResourceType;\n\n getInputsLocked(handle: AHandle): boolean;\n\n getOutputsLocked(handle: AHandle): boolean;\n\n getIsReadyOrError(handle: AHandle): boolean;\n\n getIsFinal(handle: AHandle): boolean;\n\n getError(handle: AHandle): AHandle | undefined;\n\n listInputFields(handle: AHandle): string[];\n\n listOutputFields(handle: AHandle): string[];\n\n listDynamicFields(handle: AHandle): string[];\n\n getKeyValueBase64(handle: AHandle, key: string): string | undefined;\n\n getKeyValueAsString(handle: AHandle, key: string): string | undefined;\n\n getDataBase64(handle: AHandle): string | undefined;\n\n getDataAsString(handle: AHandle): string | undefined;\n\n /** If not final returns undefined */\n parsePObjectCollection(\n handle: AHandle,\n errorOnUnknownField: boolean,\n prefix: string,\n ...resolvePath: string[]\n ): Record<string, PObject<AHandle>> | undefined;\n\n //\n // Blob\n //\n\n getBlobContentAsBase64(handle: AHandle, range?: RangeBytes): FHandle; // string | undefined\n\n getBlobContentAsString(handle: AHandle, range?: RangeBytes): FHandle; // string | undefined\n\n getDownloadedBlobContentHandle(handle: AHandle): FHandle; // LocalBlobHandleAndSize | undefined;\n\n getOnDemandBlobContentHandle(handle: AHandle): FHandle; // RemoteBlobHandleAndSize | undefined;\n\n //\n // Blobs to URLs\n //\n\n extractArchiveAndGetURL(handle: AHandle, format: ArchiveFormat): FHandle;\n\n //\n // Import progress\n //\n\n getImportProgress(handle: AHandle): FHandle; // ImportProgress;\n\n //\n // Logs\n //\n\n getLastLogs(handle: AHandle, nLines: number): FHandle; // string | undefined;\n\n getProgressLog(handle: AHandle, patternToSearch: string): FHandle; // string | undefined;\n\n getProgressLogWithInfo(handle: AHandle, patternToSearch: string): FHandle; // ProgressLogWithInfo | undefined;\n\n getLogHandle(handle: AHandle): FHandle; // AnyLogHandle | undefined;\n\n //\n // Blocks\n //\n\n /** @deprecated at some point will stop working and will return dummy values */\n getBlockLabel(blockId: string): string;\n\n //\n // Result Pool\n //\n\n getDataFromResultPool(): ResultCollection<PObject<AHandle>>;\n\n getDataWithErrorsFromResultPool(): ResultCollection<\n Optional<PObject<ValueOrError<AHandle, Error>>, \"id\">\n >;\n\n getSpecsFromResultPool(): ResultCollection<PObjectSpec>;\n\n getSpecFromResultPoolByRef(blockId: string, exportName: string): PObjectSpec | undefined;\n\n getDataFromResultPoolByRef(blockId: string, exportName: string): PObject<AHandle> | undefined;\n\n calculateOptions(predicate: PSpecPredicate): Option[];\n\n //\n // PFrame / PTable\n //\n\n createPFrame(def: PFrameDef<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>): PFrameHandle;\n\n createPTable(def: PTableDef<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>): PTableHandle;\n\n createPTableV2(\n def: PTableDefV2<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>,\n ): PTableHandle;\n\n //\n // Computable\n //\n\n getCurrentUnstableMarker(): string | undefined;\n\n //\n // Logging\n //\n\n logInfo(message: string): void;\n\n logWarn(message: string): void;\n\n logError(message: string): void;\n}\n\nexport const GlobalCfgRenderCtxFeatureFlags = {\n explicitColumnsSupport: true as const,\n inlineColumnsSupport: true as const,\n activeArgs: true as const,\n pTablePartitionFiltersSupport: true as const,\n pFrameInSetFilterSupport: true as const,\n};\n\nexport interface GlobalCfgRenderCtx extends GlobalCfgRenderCtxMethods {\n //\n // State: Args, UI State, Active Args\n //\n // Old runtime injects these values as strings, new runtime injects them as functions\n // that return strings, if block declares supportsLazyState flag.\n // If function not called in lazy state API, then resulting output will not depend on these values,\n // and thus will not be recalculated on corresponding state change.\n //\n\n readonly args: string | (() => string);\n /** @deprecated Use `data` instead. Optional for backward compatibility - falls back to `data` if not injected. */\n readonly uiState?: string | (() => string);\n readonly data: string | (() => string);\n readonly activeArgs: undefined | string | (() => string | undefined);\n\n readonly blockStorage: () => StringifiedJson;\n\n // Note: strings below are used because, anyway, using strings is the only way\n // to get data inside the QuickJS context, as it is implemented now. With this\n // approach deserialization can be lazily postponed until it is actually needed.\n readonly callbackRegistry: Record<string, AnyFunction>;\n readonly featureFlags?: typeof GlobalCfgRenderCtxFeatureFlags;\n}\n\nexport type FutureAwait = {\n __awaited_futures__: FutureHandle[];\n};\n\nexport function isFutureAwait(obj: unknown): obj is FutureAwait {\n return typeof obj === \"object\" && obj !== null && \"__awaited_futures__\" in obj;\n}\n\nfunction addAllFutureAwaits(set: Set<string>, visited: Set<unknown>, node: unknown) {\n if (visited.has(node)) return;\n visited.add(node);\n\n const type = typeof node;\n if (type === \"object\") {\n if (isFutureAwait(node)) node.__awaited_futures__.forEach((a) => set.add(a));\n else if (Array.isArray(node))\n for (const nested of node) addAllFutureAwaits(set, visited, nested);\n else\n for (const [, nested] of Object.entries(node as object))\n if (nested !== node) addAllFutureAwaits(set, visited, nested);\n }\n}\n\nexport function getAllFutureAwaits(obj: unknown): Set<string> {\n const set = new Set<string>();\n addAllFutureAwaits(set, new Set(), obj);\n return set;\n}\n"],"mappings":";;;;;;;;;;AAwBA,MAAa,sBAAsB;AACnC,MAAa,mBAAmB;AAuJhC,MAAa,iCAAiC;CAC5C,wBAAwB;CACxB,sBAAsB;CACtB,YAAY;CACZ,+BAA+B;CAC/B,0BAA0B;CAC3B;AA+BD,SAAgB,cAAc,KAAkC;AAC9D,QAAO,OAAO,QAAQ,YAAY,QAAQ,QAAQ,yBAAyB;;AAG7E,SAAS,mBAAmB,KAAkB,SAAuB,MAAe;AAClF,KAAI,QAAQ,IAAI,KAAK,CAAE;AACvB,SAAQ,IAAI,KAAK;AAGjB,KADa,OAAO,SACP,UACX;MAAI,cAAc,KAAK,CAAE,MAAK,oBAAoB,SAAS,MAAM,IAAI,IAAI,EAAE,CAAC;WACnE,MAAM,QAAQ,KAAK,CAC1B,MAAK,MAAM,UAAU,KAAM,oBAAmB,KAAK,SAAS,OAAO;MAEnE,MAAK,MAAM,GAAG,WAAW,OAAO,QAAQ,KAAe,CACrD,KAAI,WAAW,KAAM,oBAAmB,KAAK,SAAS,OAAO;;;AAIrE,SAAgB,mBAAmB,KAA2B;CAC5D,MAAM,sBAAM,IAAI,KAAa;AAC7B,oBAAmB,qBAAK,IAAI,KAAK,EAAE,IAAI;AACvC,QAAO"}
@@ -1,49 +1,48 @@
1
- export type CommonTraversalOps = {
2
- /**
3
- * Don't terminate chain if current resource or field has an error associated
4
- * with, by default resource or field error will be thrown. If field has error
5
- * and no value, error will be thrown anyway, because this is the reason
6
- * traversal is terminated.
7
- * */
8
- ignoreError?: true;
1
+ //#region src/render/traversal_ops.d.ts
2
+ type CommonTraversalOps = {
3
+ /**
4
+ * Don't terminate chain if current resource or field has an error associated
5
+ * with, by default resource or field error will be thrown. If field has error
6
+ * and no value, error will be thrown anyway, because this is the reason
7
+ * traversal is terminated.
8
+ * */
9
+ ignoreError?: true;
9
10
  };
10
- export type CommonFieldTraverseOps = {
11
- /**
12
- * Valid only if {@link assertFieldType} is defined and equal to 'Input',
13
- * 'Service' or 'Output'. By default, if field is not found, and corresponding
14
- * field list is locked, call will fail with exception.
15
- * */
16
- allowPermanentAbsence?: true;
17
- /** Will not mark current context as unstable, if field is not found. */
18
- stableIfNotFound?: true;
11
+ type CommonFieldTraverseOps = {
12
+ /**
13
+ * Valid only if {@link assertFieldType} is defined and equal to 'Input',
14
+ * 'Service' or 'Output'. By default, if field is not found, and corresponding
15
+ * field list is locked, call will fail with exception.
16
+ * */
17
+ allowPermanentAbsence?: true; /** Will not mark current context as unstable, if field is not found. */
18
+ stableIfNotFound?: true;
19
19
  };
20
- export type FieldType = "Input" | "Output" | "Service" | "OTW" | "Dynamic" | "MTW";
21
- export interface ResourceType {
22
- readonly name: string;
23
- readonly version: string;
20
+ type FieldType = "Input" | "Output" | "Service" | "OTW" | "Dynamic" | "MTW";
21
+ interface ResourceType {
22
+ readonly name: string;
23
+ readonly version: string;
24
24
  }
25
- export type ResourceTraversalOps = CommonTraversalOps & {
26
- /**
27
- * Assert resource type of the resource the fields points to. Call will fail
28
- * with exception if this assertion is not fulfilled.
29
- * */
30
- assertResourceType?: ResourceType | ResourceType[];
25
+ type ResourceTraversalOps = CommonTraversalOps & {
26
+ /**
27
+ * Assert resource type of the resource the fields points to. Call will fail
28
+ * with exception if this assertion is not fulfilled.
29
+ * */
30
+ assertResourceType?: ResourceType | ResourceType[];
31
31
  };
32
- export type GetFieldStep = CommonFieldTraverseOps & {
33
- /** Field name */
34
- field: string;
35
- /** Field must exist, if this option is set, instead error will be thrown */
36
- errorIfFieldNotFound?: true;
37
- /** Field must be assigned a value, if this option is set, instead error will be thrown */
38
- errorIfFieldNotSet?: true;
39
- /**
40
- * Assert field type.
41
- * Call will fail with exception if this assertion is not fulfilled.
42
- * The information about expectedFieldType is also used for stability
43
- * calculation and field absence error generation, so it is always a good
44
- * ide to specify it.
45
- * */
46
- assertFieldType?: FieldType;
32
+ type GetFieldStep = CommonFieldTraverseOps & {
33
+ /** Field name */field: string; /** Field must exist, if this option is set, instead error will be thrown */
34
+ errorIfFieldNotFound?: true; /** Field must be assigned a value, if this option is set, instead error will be thrown */
35
+ errorIfFieldNotSet?: true;
36
+ /**
37
+ * Assert field type.
38
+ * Call will fail with exception if this assertion is not fulfilled.
39
+ * The information about expectedFieldType is also used for stability
40
+ * calculation and field absence error generation, so it is always a good
41
+ * ide to specify it.
42
+ * */
43
+ assertFieldType?: FieldType;
47
44
  };
48
- export type FieldTraversalStep = GetFieldStep & ResourceTraversalOps;
45
+ type FieldTraversalStep = GetFieldStep & ResourceTraversalOps;
46
+ //#endregion
47
+ export { CommonFieldTraverseOps, CommonTraversalOps, FieldTraversalStep, FieldType, GetFieldStep, ResourceTraversalOps, ResourceType };
49
48
  //# sourceMappingURL=traversal_ops.d.ts.map
@@ -1,91 +1,68 @@
1
- 'use strict';
2
1
 
2
+ //#region src/render/util/axis_filtering.ts
3
3
  function filterDataInfoEntries(dataInfoEntries, axisFilters) {
4
- // Sort filters by axis index in descending order to safely remove elements from arrays
5
- const sortedFilters = [...axisFilters].sort((a, b) => b[0] - a[0]);
6
- // Check for invalid filter axes
7
- const { type } = dataInfoEntries;
8
- switch (type) {
9
- case "Json": {
10
- const { keyLength } = dataInfoEntries;
11
- for (const [axisIdx] of axisFilters)
12
- if (axisIdx >= keyLength)
13
- throw new Error(`Can't filter on non-data axis ${axisIdx}. Must be >= ${keyLength}`);
14
- break;
15
- }
16
- case "JsonPartitioned":
17
- case "BinaryPartitioned":
18
- case "ParquetPartitioned": {
19
- const { partitionKeyLength } = dataInfoEntries;
20
- for (const [axisIdx] of axisFilters)
21
- if (axisIdx >= partitionKeyLength)
22
- throw new Error(`Can't filter on non-partitioned axis ${axisIdx}. Must be >= ${partitionKeyLength}`);
23
- break;
24
- }
25
- default:
26
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
27
- throw new Error(`Unsupported data info type: ${type}`);
28
- }
29
- const keyMatchesFilters = (key) => {
30
- for (const [axisIdx, axisValue] of sortedFilters)
31
- if (key[axisIdx] !== axisValue)
32
- return false;
33
- return true;
34
- };
35
- const removeFilteredAxes = (key) => {
36
- const newKey = [...key];
37
- // Remove axes in descending order to maintain correct indices
38
- for (const [axisIdx] of sortedFilters)
39
- newKey.splice(axisIdx, 1);
40
- return newKey;
41
- };
42
- switch (dataInfoEntries.type) {
43
- case "Json":
44
- return {
45
- type: "Json",
46
- keyLength: dataInfoEntries.keyLength - axisFilters.length,
47
- data: dataInfoEntries.data
48
- .filter((entry) => keyMatchesFilters(entry.key))
49
- .map((entry) => ({
50
- key: removeFilteredAxes(entry.key),
51
- value: entry.value,
52
- })),
53
- };
54
- case "JsonPartitioned":
55
- return {
56
- type: "JsonPartitioned",
57
- partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,
58
- parts: dataInfoEntries.parts
59
- .filter((entry) => keyMatchesFilters(entry.key))
60
- .map((entry) => ({
61
- key: removeFilteredAxes(entry.key),
62
- value: entry.value,
63
- })),
64
- };
65
- case "BinaryPartitioned":
66
- return {
67
- type: "BinaryPartitioned",
68
- partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,
69
- parts: dataInfoEntries.parts
70
- .filter((entry) => keyMatchesFilters(entry.key))
71
- .map((entry) => ({
72
- key: removeFilteredAxes(entry.key),
73
- value: entry.value,
74
- })),
75
- };
76
- case "ParquetPartitioned":
77
- return {
78
- type: "ParquetPartitioned",
79
- partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,
80
- parts: dataInfoEntries.parts
81
- .filter((entry) => keyMatchesFilters(entry.key))
82
- .map((entry) => ({
83
- key: removeFilteredAxes(entry.key),
84
- value: entry.value,
85
- })),
86
- };
87
- }
4
+ const sortedFilters = [...axisFilters].sort((a, b) => b[0] - a[0]);
5
+ const { type } = dataInfoEntries;
6
+ switch (type) {
7
+ case "Json": {
8
+ const { keyLength } = dataInfoEntries;
9
+ for (const [axisIdx] of axisFilters) if (axisIdx >= keyLength) throw new Error(`Can't filter on non-data axis ${axisIdx}. Must be >= ${keyLength}`);
10
+ break;
11
+ }
12
+ case "JsonPartitioned":
13
+ case "BinaryPartitioned":
14
+ case "ParquetPartitioned": {
15
+ const { partitionKeyLength } = dataInfoEntries;
16
+ for (const [axisIdx] of axisFilters) if (axisIdx >= partitionKeyLength) throw new Error(`Can't filter on non-partitioned axis ${axisIdx}. Must be >= ${partitionKeyLength}`);
17
+ break;
18
+ }
19
+ default: throw new Error(`Unsupported data info type: ${type}`);
20
+ }
21
+ const keyMatchesFilters = (key) => {
22
+ for (const [axisIdx, axisValue] of sortedFilters) if (key[axisIdx] !== axisValue) return false;
23
+ return true;
24
+ };
25
+ const removeFilteredAxes = (key) => {
26
+ const newKey = [...key];
27
+ for (const [axisIdx] of sortedFilters) newKey.splice(axisIdx, 1);
28
+ return newKey;
29
+ };
30
+ switch (dataInfoEntries.type) {
31
+ case "Json": return {
32
+ type: "Json",
33
+ keyLength: dataInfoEntries.keyLength - axisFilters.length,
34
+ data: dataInfoEntries.data.filter((entry) => keyMatchesFilters(entry.key)).map((entry) => ({
35
+ key: removeFilteredAxes(entry.key),
36
+ value: entry.value
37
+ }))
38
+ };
39
+ case "JsonPartitioned": return {
40
+ type: "JsonPartitioned",
41
+ partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,
42
+ parts: dataInfoEntries.parts.filter((entry) => keyMatchesFilters(entry.key)).map((entry) => ({
43
+ key: removeFilteredAxes(entry.key),
44
+ value: entry.value
45
+ }))
46
+ };
47
+ case "BinaryPartitioned": return {
48
+ type: "BinaryPartitioned",
49
+ partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,
50
+ parts: dataInfoEntries.parts.filter((entry) => keyMatchesFilters(entry.key)).map((entry) => ({
51
+ key: removeFilteredAxes(entry.key),
52
+ value: entry.value
53
+ }))
54
+ };
55
+ case "ParquetPartitioned": return {
56
+ type: "ParquetPartitioned",
57
+ partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,
58
+ parts: dataInfoEntries.parts.filter((entry) => keyMatchesFilters(entry.key)).map((entry) => ({
59
+ key: removeFilteredAxes(entry.key),
60
+ value: entry.value
61
+ }))
62
+ };
63
+ }
88
64
  }
89
65
 
66
+ //#endregion
90
67
  exports.filterDataInfoEntries = filterDataInfoEntries;
91
- //# sourceMappingURL=axis_filtering.cjs.map
68
+ //# sourceMappingURL=axis_filtering.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"axis_filtering.cjs","sources":["../../../src/render/util/axis_filtering.ts"],"sourcesContent":["import type {\n BinaryChunk,\n DataInfoEntries,\n PColumnDataEntry,\n PColumnKey,\n PColumnValue,\n JsonDataInfoEntries,\n JsonPartitionedDataInfoEntries,\n BinaryPartitionedDataInfoEntries,\n ParquetPartitionedDataInfoEntries,\n PartitionedDataInfoEntries,\n} from \"@milaboratories/pl-model-common\";\nimport type { AxisFilterByIdx } from \"@milaboratories/pl-model-common\";\n\n/**\n * Filters DataInfoEntries using axis filters, removing specified axes from keys and\n * only keeping entries that match the filter values.\n *\n * @param dataInfoEntries - The data info object to filter\n * @param axisFilters - Array of axis filters (index, value pairs)\n * @throws Error if any filter axis is outside the partitioning axes or data axes for Json data\n */\nexport function filterDataInfoEntries<Blob>(\n dataInfoEntries: ParquetPartitionedDataInfoEntries<Blob>,\n axisFilters: AxisFilterByIdx[],\n): ParquetPartitionedDataInfoEntries<Blob>;\nexport function filterDataInfoEntries<Blob>(\n dataInfoEntries: BinaryPartitionedDataInfoEntries<Blob>,\n axisFilters: AxisFilterByIdx[],\n): BinaryPartitionedDataInfoEntries<Blob>;\nexport function filterDataInfoEntries<Blob>(\n dataInfoEntries: JsonPartitionedDataInfoEntries<Blob>,\n axisFilters: AxisFilterByIdx[],\n): JsonPartitionedDataInfoEntries<Blob>;\nexport function filterDataInfoEntries<Blob>(\n dataInfoEntries: PartitionedDataInfoEntries<Blob>,\n axisFilters: AxisFilterByIdx[],\n): PartitionedDataInfoEntries<Blob>;\nexport function filterDataInfoEntries(\n dataInfoEntries: JsonDataInfoEntries,\n axisFilters: AxisFilterByIdx[],\n): JsonDataInfoEntries;\nexport function filterDataInfoEntries<Blob>(\n dataInfoEntries: DataInfoEntries<Blob>,\n axisFilters: AxisFilterByIdx[],\n): DataInfoEntries<Blob> {\n // Sort filters by axis index in descending order to safely remove elements from arrays\n const sortedFilters = [...axisFilters].sort((a, b) => b[0] - a[0]);\n\n // Check for invalid filter axes\n const { type } = dataInfoEntries;\n switch (type) {\n case \"Json\": {\n const { keyLength } = dataInfoEntries;\n for (const [axisIdx] of axisFilters)\n if (axisIdx >= keyLength)\n throw new Error(`Can't filter on non-data axis ${axisIdx}. Must be >= ${keyLength}`);\n break;\n }\n case \"JsonPartitioned\":\n case \"BinaryPartitioned\":\n case \"ParquetPartitioned\": {\n const { partitionKeyLength } = dataInfoEntries;\n for (const [axisIdx] of axisFilters)\n if (axisIdx >= partitionKeyLength)\n throw new Error(\n `Can't filter on non-partitioned axis ${axisIdx}. Must be >= ${partitionKeyLength}`,\n );\n break;\n }\n default:\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n throw new Error(`Unsupported data info type: ${type satisfies never}`);\n }\n\n const keyMatchesFilters = (key: PColumnKey): boolean => {\n for (const [axisIdx, axisValue] of sortedFilters) if (key[axisIdx] !== axisValue) return false;\n return true;\n };\n\n const removeFilteredAxes = (key: PColumnKey): PColumnKey => {\n const newKey = [...key];\n\n // Remove axes in descending order to maintain correct indices\n for (const [axisIdx] of sortedFilters) newKey.splice(axisIdx, 1);\n\n return newKey;\n };\n\n switch (dataInfoEntries.type) {\n case \"Json\":\n return {\n type: \"Json\",\n keyLength: dataInfoEntries.keyLength - axisFilters.length,\n data: dataInfoEntries.data\n .filter((entry) => keyMatchesFilters(entry.key))\n .map(\n (entry) =>\n ({\n key: removeFilteredAxes(entry.key),\n value: entry.value,\n }) satisfies PColumnDataEntry<PColumnValue>,\n ),\n };\n case \"JsonPartitioned\":\n return {\n type: \"JsonPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,\n parts: dataInfoEntries.parts\n .filter((entry) => keyMatchesFilters(entry.key))\n .map(\n (entry) =>\n ({\n key: removeFilteredAxes(entry.key),\n value: entry.value,\n }) satisfies PColumnDataEntry<Blob>,\n ),\n };\n case \"BinaryPartitioned\":\n return {\n type: \"BinaryPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,\n parts: dataInfoEntries.parts\n .filter((entry) => keyMatchesFilters(entry.key))\n .map(\n (entry) =>\n ({\n key: removeFilteredAxes(entry.key),\n value: entry.value,\n }) satisfies PColumnDataEntry<BinaryChunk<Blob>>,\n ),\n };\n case \"ParquetPartitioned\":\n return {\n type: \"ParquetPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,\n parts: dataInfoEntries.parts\n .filter((entry) => keyMatchesFilters(entry.key))\n .map(\n (entry) =>\n ({\n key: removeFilteredAxes(entry.key),\n value: entry.value,\n }) satisfies PColumnDataEntry<Blob>,\n ),\n };\n }\n}\n"],"names":[],"mappings":";;AA0CM,SAAU,qBAAqB,CACnC,eAAsC,EACtC,WAA8B,EAAA;;IAG9B,MAAM,aAAa,GAAG,CAAC,GAAG,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;;AAGlE,IAAA,MAAM,EAAE,IAAI,EAAE,GAAG,eAAe;IAChC,QAAQ,IAAI;QACV,KAAK,MAAM,EAAE;AACX,YAAA,MAAM,EAAE,SAAS,EAAE,GAAG,eAAe;AACrC,YAAA,KAAK,MAAM,CAAC,OAAO,CAAC,IAAI,WAAW;gBACjC,IAAI,OAAO,IAAI,SAAS;oBACtB,MAAM,IAAI,KAAK,CAAC,CAAA,8BAAA,EAAiC,OAAO,CAAA,aAAA,EAAgB,SAAS,CAAA,CAAE,CAAC;YACxF;QACF;AACA,QAAA,KAAK,iBAAiB;AACtB,QAAA,KAAK,mBAAmB;QACxB,KAAK,oBAAoB,EAAE;AACzB,YAAA,MAAM,EAAE,kBAAkB,EAAE,GAAG,eAAe;AAC9C,YAAA,KAAK,MAAM,CAAC,OAAO,CAAC,IAAI,WAAW;gBACjC,IAAI,OAAO,IAAI,kBAAkB;oBAC/B,MAAM,IAAI,KAAK,CACb,CAAA,qCAAA,EAAwC,OAAO,CAAA,aAAA,EAAgB,kBAAkB,CAAA,CAAE,CACpF;YACL;QACF;AACA,QAAA;;AAEE,YAAA,MAAM,IAAI,KAAK,CAAC,+BAA+B,IAAoB,CAAA,CAAE,CAAC;;AAG1E,IAAA,MAAM,iBAAiB,GAAG,CAAC,GAAe,KAAa;AACrD,QAAA,KAAK,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,aAAa;AAAE,YAAA,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,SAAS;AAAE,gBAAA,OAAO,KAAK;AAC9F,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AAED,IAAA,MAAM,kBAAkB,GAAG,CAAC,GAAe,KAAgB;AACzD,QAAA,MAAM,MAAM,GAAG,CAAC,GAAG,GAAG,CAAC;;AAGvB,QAAA,KAAK,MAAM,CAAC,OAAO,CAAC,IAAI,aAAa;AAAE,YAAA,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;AAEhE,QAAA,OAAO,MAAM;AACf,IAAA,CAAC;AAED,IAAA,QAAQ,eAAe,CAAC,IAAI;AAC1B,QAAA,KAAK,MAAM;YACT,OAAO;AACL,gBAAA,IAAI,EAAE,MAAM;AACZ,gBAAA,SAAS,EAAE,eAAe,CAAC,SAAS,GAAG,WAAW,CAAC,MAAM;gBACzD,IAAI,EAAE,eAAe,CAAC;AACnB,qBAAA,MAAM,CAAC,CAAC,KAAK,KAAK,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC;AAC9C,qBAAA,GAAG,CACF,CAAC,KAAK,MACH;AACC,oBAAA,GAAG,EAAE,kBAAkB,CAAC,KAAK,CAAC,GAAG,CAAC;oBAClC,KAAK,EAAE,KAAK,CAAC,KAAK;AACnB,iBAAA,CAA0C,CAC9C;aACJ;AACH,QAAA,KAAK,iBAAiB;YACpB,OAAO;AACL,gBAAA,IAAI,EAAE,iBAAiB;AACvB,gBAAA,kBAAkB,EAAE,eAAe,CAAC,kBAAkB,GAAG,WAAW,CAAC,MAAM;gBAC3E,KAAK,EAAE,eAAe,CAAC;AACpB,qBAAA,MAAM,CAAC,CAAC,KAAK,KAAK,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC;AAC9C,qBAAA,GAAG,CACF,CAAC,KAAK,MACH;AACC,oBAAA,GAAG,EAAE,kBAAkB,CAAC,KAAK,CAAC,GAAG,CAAC;oBAClC,KAAK,EAAE,KAAK,CAAC,KAAK;AACnB,iBAAA,CAAkC,CACtC;aACJ;AACH,QAAA,KAAK,mBAAmB;YACtB,OAAO;AACL,gBAAA,IAAI,EAAE,mBAAmB;AACzB,gBAAA,kBAAkB,EAAE,eAAe,CAAC,kBAAkB,GAAG,WAAW,CAAC,MAAM;gBAC3E,KAAK,EAAE,eAAe,CAAC;AACpB,qBAAA,MAAM,CAAC,CAAC,KAAK,KAAK,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC;AAC9C,qBAAA,GAAG,CACF,CAAC,KAAK,MACH;AACC,oBAAA,GAAG,EAAE,kBAAkB,CAAC,KAAK,CAAC,GAAG,CAAC;oBAClC,KAAK,EAAE,KAAK,CAAC,KAAK;AACnB,iBAAA,CAA+C,CACnD;aACJ;AACH,QAAA,KAAK,oBAAoB;YACvB,OAAO;AACL,gBAAA,IAAI,EAAE,oBAAoB;AAC1B,gBAAA,kBAAkB,EAAE,eAAe,CAAC,kBAAkB,GAAG,WAAW,CAAC,MAAM;gBAC3E,KAAK,EAAE,eAAe,CAAC;AACpB,qBAAA,MAAM,CAAC,CAAC,KAAK,KAAK,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC;AAC9C,qBAAA,GAAG,CACF,CAAC,KAAK,MACH;AACC,oBAAA,GAAG,EAAE,kBAAkB,CAAC,KAAK,CAAC,GAAG,CAAC;oBAClC,KAAK,EAAE,KAAK,CAAC,KAAK;AACnB,iBAAA,CAAkC,CACtC;aACJ;;AAEP;;;;"}
1
+ {"version":3,"file":"axis_filtering.cjs","names":[],"sources":["../../../src/render/util/axis_filtering.ts"],"sourcesContent":["import type {\n BinaryChunk,\n DataInfoEntries,\n PColumnDataEntry,\n PColumnKey,\n PColumnValue,\n JsonDataInfoEntries,\n JsonPartitionedDataInfoEntries,\n BinaryPartitionedDataInfoEntries,\n ParquetPartitionedDataInfoEntries,\n PartitionedDataInfoEntries,\n} from \"@milaboratories/pl-model-common\";\nimport type { AxisFilterByIdx } from \"@milaboratories/pl-model-common\";\n\n/**\n * Filters DataInfoEntries using axis filters, removing specified axes from keys and\n * only keeping entries that match the filter values.\n *\n * @param dataInfoEntries - The data info object to filter\n * @param axisFilters - Array of axis filters (index, value pairs)\n * @throws Error if any filter axis is outside the partitioning axes or data axes for Json data\n */\nexport function filterDataInfoEntries<Blob>(\n dataInfoEntries: ParquetPartitionedDataInfoEntries<Blob>,\n axisFilters: AxisFilterByIdx[],\n): ParquetPartitionedDataInfoEntries<Blob>;\nexport function filterDataInfoEntries<Blob>(\n dataInfoEntries: BinaryPartitionedDataInfoEntries<Blob>,\n axisFilters: AxisFilterByIdx[],\n): BinaryPartitionedDataInfoEntries<Blob>;\nexport function filterDataInfoEntries<Blob>(\n dataInfoEntries: JsonPartitionedDataInfoEntries<Blob>,\n axisFilters: AxisFilterByIdx[],\n): JsonPartitionedDataInfoEntries<Blob>;\nexport function filterDataInfoEntries<Blob>(\n dataInfoEntries: PartitionedDataInfoEntries<Blob>,\n axisFilters: AxisFilterByIdx[],\n): PartitionedDataInfoEntries<Blob>;\nexport function filterDataInfoEntries(\n dataInfoEntries: JsonDataInfoEntries,\n axisFilters: AxisFilterByIdx[],\n): JsonDataInfoEntries;\nexport function filterDataInfoEntries<Blob>(\n dataInfoEntries: DataInfoEntries<Blob>,\n axisFilters: AxisFilterByIdx[],\n): DataInfoEntries<Blob> {\n // Sort filters by axis index in descending order to safely remove elements from arrays\n const sortedFilters = [...axisFilters].sort((a, b) => b[0] - a[0]);\n\n // Check for invalid filter axes\n const { type } = dataInfoEntries;\n switch (type) {\n case \"Json\": {\n const { keyLength } = dataInfoEntries;\n for (const [axisIdx] of axisFilters)\n if (axisIdx >= keyLength)\n throw new Error(`Can't filter on non-data axis ${axisIdx}. Must be >= ${keyLength}`);\n break;\n }\n case \"JsonPartitioned\":\n case \"BinaryPartitioned\":\n case \"ParquetPartitioned\": {\n const { partitionKeyLength } = dataInfoEntries;\n for (const [axisIdx] of axisFilters)\n if (axisIdx >= partitionKeyLength)\n throw new Error(\n `Can't filter on non-partitioned axis ${axisIdx}. Must be >= ${partitionKeyLength}`,\n );\n break;\n }\n default:\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n throw new Error(`Unsupported data info type: ${type satisfies never}`);\n }\n\n const keyMatchesFilters = (key: PColumnKey): boolean => {\n for (const [axisIdx, axisValue] of sortedFilters) if (key[axisIdx] !== axisValue) return false;\n return true;\n };\n\n const removeFilteredAxes = (key: PColumnKey): PColumnKey => {\n const newKey = [...key];\n\n // Remove axes in descending order to maintain correct indices\n for (const [axisIdx] of sortedFilters) newKey.splice(axisIdx, 1);\n\n return newKey;\n };\n\n switch (dataInfoEntries.type) {\n case \"Json\":\n return {\n type: \"Json\",\n keyLength: dataInfoEntries.keyLength - axisFilters.length,\n data: dataInfoEntries.data\n .filter((entry) => keyMatchesFilters(entry.key))\n .map(\n (entry) =>\n ({\n key: removeFilteredAxes(entry.key),\n value: entry.value,\n }) satisfies PColumnDataEntry<PColumnValue>,\n ),\n };\n case \"JsonPartitioned\":\n return {\n type: \"JsonPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,\n parts: dataInfoEntries.parts\n .filter((entry) => keyMatchesFilters(entry.key))\n .map(\n (entry) =>\n ({\n key: removeFilteredAxes(entry.key),\n value: entry.value,\n }) satisfies PColumnDataEntry<Blob>,\n ),\n };\n case \"BinaryPartitioned\":\n return {\n type: \"BinaryPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,\n parts: dataInfoEntries.parts\n .filter((entry) => keyMatchesFilters(entry.key))\n .map(\n (entry) =>\n ({\n key: removeFilteredAxes(entry.key),\n value: entry.value,\n }) satisfies PColumnDataEntry<BinaryChunk<Blob>>,\n ),\n };\n case \"ParquetPartitioned\":\n return {\n type: \"ParquetPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,\n parts: dataInfoEntries.parts\n .filter((entry) => keyMatchesFilters(entry.key))\n .map(\n (entry) =>\n ({\n key: removeFilteredAxes(entry.key),\n value: entry.value,\n }) satisfies PColumnDataEntry<Blob>,\n ),\n };\n }\n}\n"],"mappings":";;AA0CA,SAAgB,sBACd,iBACA,aACuB;CAEvB,MAAM,gBAAgB,CAAC,GAAG,YAAY,CAAC,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,GAAG;CAGlE,MAAM,EAAE,SAAS;AACjB,SAAQ,MAAR;EACE,KAAK,QAAQ;GACX,MAAM,EAAE,cAAc;AACtB,QAAK,MAAM,CAAC,YAAY,YACtB,KAAI,WAAW,UACb,OAAM,IAAI,MAAM,iCAAiC,QAAQ,eAAe,YAAY;AACxF;;EAEF,KAAK;EACL,KAAK;EACL,KAAK,sBAAsB;GACzB,MAAM,EAAE,uBAAuB;AAC/B,QAAK,MAAM,CAAC,YAAY,YACtB,KAAI,WAAW,mBACb,OAAM,IAAI,MACR,wCAAwC,QAAQ,eAAe,qBAChE;AACL;;EAEF,QAEE,OAAM,IAAI,MAAM,+BAA+B,OAAuB;;CAG1E,MAAM,qBAAqB,QAA6B;AACtD,OAAK,MAAM,CAAC,SAAS,cAAc,cAAe,KAAI,IAAI,aAAa,UAAW,QAAO;AACzF,SAAO;;CAGT,MAAM,sBAAsB,QAAgC;EAC1D,MAAM,SAAS,CAAC,GAAG,IAAI;AAGvB,OAAK,MAAM,CAAC,YAAY,cAAe,QAAO,OAAO,SAAS,EAAE;AAEhE,SAAO;;AAGT,SAAQ,gBAAgB,MAAxB;EACE,KAAK,OACH,QAAO;GACL,MAAM;GACN,WAAW,gBAAgB,YAAY,YAAY;GACnD,MAAM,gBAAgB,KACnB,QAAQ,UAAU,kBAAkB,MAAM,IAAI,CAAC,CAC/C,KACE,WACE;IACC,KAAK,mBAAmB,MAAM,IAAI;IAClC,OAAO,MAAM;IACd,EACJ;GACJ;EACH,KAAK,kBACH,QAAO;GACL,MAAM;GACN,oBAAoB,gBAAgB,qBAAqB,YAAY;GACrE,OAAO,gBAAgB,MACpB,QAAQ,UAAU,kBAAkB,MAAM,IAAI,CAAC,CAC/C,KACE,WACE;IACC,KAAK,mBAAmB,MAAM,IAAI;IAClC,OAAO,MAAM;IACd,EACJ;GACJ;EACH,KAAK,oBACH,QAAO;GACL,MAAM;GACN,oBAAoB,gBAAgB,qBAAqB,YAAY;GACrE,OAAO,gBAAgB,MACpB,QAAQ,UAAU,kBAAkB,MAAM,IAAI,CAAC,CAC/C,KACE,WACE;IACC,KAAK,mBAAmB,MAAM,IAAI;IAClC,OAAO,MAAM;IACd,EACJ;GACJ;EACH,KAAK,qBACH,QAAO;GACL,MAAM;GACN,oBAAoB,gBAAgB,qBAAqB,YAAY;GACrE,OAAO,gBAAgB,MACpB,QAAQ,UAAU,kBAAkB,MAAM,IAAI,CAAC,CAC/C,KACE,WACE;IACC,KAAK,mBAAmB,MAAM,IAAI;IAClC,OAAO,MAAM;IACd,EACJ;GACJ"}
@@ -1,5 +1,6 @@
1
- import type { JsonDataInfoEntries, JsonPartitionedDataInfoEntries, BinaryPartitionedDataInfoEntries, ParquetPartitionedDataInfoEntries, PartitionedDataInfoEntries } from "@milaboratories/pl-model-common";
2
- import type { AxisFilterByIdx } from "@milaboratories/pl-model-common";
1
+ import { AxisFilterByIdx, BinaryPartitionedDataInfoEntries, JsonDataInfoEntries, JsonPartitionedDataInfoEntries, ParquetPartitionedDataInfoEntries, PartitionedDataInfoEntries } from "@milaboratories/pl-model-common";
2
+
3
+ //#region src/render/util/axis_filtering.d.ts
3
4
  /**
4
5
  * Filters DataInfoEntries using axis filters, removing specified axes from keys and
5
6
  * only keeping entries that match the filter values.
@@ -8,9 +9,11 @@ import type { AxisFilterByIdx } from "@milaboratories/pl-model-common";
8
9
  * @param axisFilters - Array of axis filters (index, value pairs)
9
10
  * @throws Error if any filter axis is outside the partitioning axes or data axes for Json data
10
11
  */
11
- export declare function filterDataInfoEntries<Blob>(dataInfoEntries: ParquetPartitionedDataInfoEntries<Blob>, axisFilters: AxisFilterByIdx[]): ParquetPartitionedDataInfoEntries<Blob>;
12
- export declare function filterDataInfoEntries<Blob>(dataInfoEntries: BinaryPartitionedDataInfoEntries<Blob>, axisFilters: AxisFilterByIdx[]): BinaryPartitionedDataInfoEntries<Blob>;
13
- export declare function filterDataInfoEntries<Blob>(dataInfoEntries: JsonPartitionedDataInfoEntries<Blob>, axisFilters: AxisFilterByIdx[]): JsonPartitionedDataInfoEntries<Blob>;
14
- export declare function filterDataInfoEntries<Blob>(dataInfoEntries: PartitionedDataInfoEntries<Blob>, axisFilters: AxisFilterByIdx[]): PartitionedDataInfoEntries<Blob>;
15
- export declare function filterDataInfoEntries(dataInfoEntries: JsonDataInfoEntries, axisFilters: AxisFilterByIdx[]): JsonDataInfoEntries;
12
+ declare function filterDataInfoEntries<Blob>(dataInfoEntries: ParquetPartitionedDataInfoEntries<Blob>, axisFilters: AxisFilterByIdx[]): ParquetPartitionedDataInfoEntries<Blob>;
13
+ declare function filterDataInfoEntries<Blob>(dataInfoEntries: BinaryPartitionedDataInfoEntries<Blob>, axisFilters: AxisFilterByIdx[]): BinaryPartitionedDataInfoEntries<Blob>;
14
+ declare function filterDataInfoEntries<Blob>(dataInfoEntries: JsonPartitionedDataInfoEntries<Blob>, axisFilters: AxisFilterByIdx[]): JsonPartitionedDataInfoEntries<Blob>;
15
+ declare function filterDataInfoEntries<Blob>(dataInfoEntries: PartitionedDataInfoEntries<Blob>, axisFilters: AxisFilterByIdx[]): PartitionedDataInfoEntries<Blob>;
16
+ declare function filterDataInfoEntries(dataInfoEntries: JsonDataInfoEntries, axisFilters: AxisFilterByIdx[]): JsonDataInfoEntries;
17
+ //#endregion
18
+ export { filterDataInfoEntries };
16
19
  //# sourceMappingURL=axis_filtering.d.ts.map