@platforma-sdk/model 1.53.10 → 1.53.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. package/dist/annotations/converter.cjs +11 -11
  2. package/dist/annotations/converter.cjs.map +1 -1
  3. package/dist/annotations/converter.d.ts +1 -1
  4. package/dist/annotations/converter.d.ts.map +1 -1
  5. package/dist/annotations/converter.js +11 -11
  6. package/dist/annotations/converter.js.map +1 -1
  7. package/dist/annotations/index.d.ts +2 -2
  8. package/dist/annotations/types.d.ts +4 -4
  9. package/dist/bconfig/index.d.ts +5 -5
  10. package/dist/bconfig/lambdas.d.ts +7 -7
  11. package/dist/bconfig/lambdas.d.ts.map +1 -1
  12. package/dist/bconfig/normalization.cjs.map +1 -1
  13. package/dist/bconfig/normalization.d.ts +3 -3
  14. package/dist/bconfig/normalization.js.map +1 -1
  15. package/dist/bconfig/types.cjs.map +1 -1
  16. package/dist/bconfig/types.d.ts +2 -2
  17. package/dist/bconfig/types.d.ts.map +1 -1
  18. package/dist/bconfig/types.js.map +1 -1
  19. package/dist/bconfig/util.d.ts +4 -4
  20. package/dist/bconfig/v3.d.ts +3 -3
  21. package/dist/block_api_v1.d.ts +2 -2
  22. package/dist/block_api_v1.d.ts.map +1 -1
  23. package/dist/block_api_v2.d.ts +2 -2
  24. package/dist/block_api_v2.d.ts.map +1 -1
  25. package/dist/block_api_v3.d.ts +3 -3
  26. package/dist/block_migrations.cjs +10 -10
  27. package/dist/block_migrations.cjs.map +1 -1
  28. package/dist/block_migrations.d.ts.map +1 -1
  29. package/dist/block_migrations.js +10 -10
  30. package/dist/block_migrations.js.map +1 -1
  31. package/dist/block_model.cjs +11 -11
  32. package/dist/block_model.cjs.map +1 -1
  33. package/dist/block_model.d.ts +8 -8
  34. package/dist/block_model.d.ts.map +1 -1
  35. package/dist/block_model.js +11 -11
  36. package/dist/block_model.js.map +1 -1
  37. package/dist/block_state_patch.d.ts +2 -2
  38. package/dist/block_state_util.cjs +1 -1
  39. package/dist/block_state_util.cjs.map +1 -1
  40. package/dist/block_state_util.d.ts +3 -3
  41. package/dist/block_state_util.js +1 -1
  42. package/dist/block_state_util.js.map +1 -1
  43. package/dist/block_storage.cjs +10 -10
  44. package/dist/block_storage.cjs.map +1 -1
  45. package/dist/block_storage.d.ts +2 -2
  46. package/dist/block_storage.d.ts.map +1 -1
  47. package/dist/block_storage.js +10 -10
  48. package/dist/block_storage.js.map +1 -1
  49. package/dist/block_storage_vm.cjs +22 -22
  50. package/dist/block_storage_vm.cjs.map +1 -1
  51. package/dist/block_storage_vm.d.ts +1 -1
  52. package/dist/block_storage_vm.d.ts.map +1 -1
  53. package/dist/block_storage_vm.js +22 -22
  54. package/dist/block_storage_vm.js.map +1 -1
  55. package/dist/builder.cjs +32 -23
  56. package/dist/builder.cjs.map +1 -1
  57. package/dist/builder.d.ts +7 -7
  58. package/dist/builder.d.ts.map +1 -1
  59. package/dist/builder.js +32 -23
  60. package/dist/builder.js.map +1 -1
  61. package/dist/components/PFrameForGraphs.cjs +7 -6
  62. package/dist/components/PFrameForGraphs.cjs.map +1 -1
  63. package/dist/components/PFrameForGraphs.d.ts +4 -4
  64. package/dist/components/PFrameForGraphs.d.ts.map +1 -1
  65. package/dist/components/PFrameForGraphs.js +7 -6
  66. package/dist/components/PFrameForGraphs.js.map +1 -1
  67. package/dist/components/PlAnnotations/filter.d.ts +14 -14
  68. package/dist/components/PlAnnotations/filter.d.ts.map +1 -1
  69. package/dist/components/PlAnnotations/filters_ui.cjs +46 -46
  70. package/dist/components/PlAnnotations/filters_ui.cjs.map +1 -1
  71. package/dist/components/PlAnnotations/filters_ui.d.ts +10 -34
  72. package/dist/components/PlAnnotations/filters_ui.d.ts.map +1 -1
  73. package/dist/components/PlAnnotations/filters_ui.js +46 -46
  74. package/dist/components/PlAnnotations/filters_ui.js.map +1 -1
  75. package/dist/components/PlAnnotations/index.d.ts +2 -2
  76. package/dist/components/PlAnnotations/types.d.ts +2 -2
  77. package/dist/components/PlDataTable.cjs +19 -20
  78. package/dist/components/PlDataTable.cjs.map +1 -1
  79. package/dist/components/PlDataTable.d.ts +27 -27
  80. package/dist/components/PlDataTable.d.ts.map +1 -1
  81. package/dist/components/PlDataTable.js +19 -20
  82. package/dist/components/PlDataTable.js.map +1 -1
  83. package/dist/components/PlMultiSequenceAlignment.cjs +2 -2
  84. package/dist/components/PlMultiSequenceAlignment.cjs.map +1 -1
  85. package/dist/components/PlMultiSequenceAlignment.d.ts +6 -6
  86. package/dist/components/PlMultiSequenceAlignment.d.ts.map +1 -1
  87. package/dist/components/PlMultiSequenceAlignment.js +2 -2
  88. package/dist/components/PlMultiSequenceAlignment.js.map +1 -1
  89. package/dist/components/PlSelectionModel.cjs.map +1 -1
  90. package/dist/components/PlSelectionModel.d.ts +1 -1
  91. package/dist/components/PlSelectionModel.js.map +1 -1
  92. package/dist/components/index.d.ts +5 -5
  93. package/dist/config/actions.cjs +39 -39
  94. package/dist/config/actions.cjs.map +1 -1
  95. package/dist/config/actions.d.ts +9 -9
  96. package/dist/config/actions.d.ts.map +1 -1
  97. package/dist/config/actions.js +39 -39
  98. package/dist/config/actions.js.map +1 -1
  99. package/dist/config/actions_kinds.d.ts +30 -30
  100. package/dist/config/actions_kinds.d.ts.map +1 -1
  101. package/dist/config/index.d.ts +6 -6
  102. package/dist/config/model.d.ts +28 -28
  103. package/dist/config/model_meta.d.ts +1 -1
  104. package/dist/config/type_engine.d.ts +3 -3
  105. package/dist/config/type_util.d.ts +2 -2
  106. package/dist/env_value.cjs +1 -1
  107. package/dist/env_value.cjs.map +1 -1
  108. package/dist/env_value.js +1 -1
  109. package/dist/env_value.js.map +1 -1
  110. package/dist/filters/converter.cjs +36 -32
  111. package/dist/filters/converter.cjs.map +1 -1
  112. package/dist/filters/converter.d.ts +2 -2
  113. package/dist/filters/converter.d.ts.map +1 -1
  114. package/dist/filters/converter.js +36 -32
  115. package/dist/filters/converter.js.map +1 -1
  116. package/dist/filters/index.d.ts +2 -2
  117. package/dist/filters/types.d.ts +33 -33
  118. package/dist/filters/types.d.ts.map +1 -1
  119. package/dist/index.d.ts +24 -24
  120. package/dist/internal.cjs +7 -7
  121. package/dist/internal.cjs.map +1 -1
  122. package/dist/internal.d.ts +4 -4
  123. package/dist/internal.d.ts.map +1 -1
  124. package/dist/internal.js +7 -7
  125. package/dist/internal.js.map +1 -1
  126. package/dist/package.json.cjs +1 -1
  127. package/dist/package.json.js +1 -1
  128. package/dist/pframe.cjs +1 -1
  129. package/dist/pframe.cjs.map +1 -1
  130. package/dist/pframe.d.ts +1 -1
  131. package/dist/pframe.js +1 -1
  132. package/dist/pframe.js.map +1 -1
  133. package/dist/pframe_utils/columns.cjs +23 -15
  134. package/dist/pframe_utils/columns.cjs.map +1 -1
  135. package/dist/pframe_utils/columns.d.ts +3 -3
  136. package/dist/pframe_utils/columns.d.ts.map +1 -1
  137. package/dist/pframe_utils/columns.js +23 -15
  138. package/dist/pframe_utils/columns.js.map +1 -1
  139. package/dist/pframe_utils/index.cjs +25 -25
  140. package/dist/pframe_utils/index.cjs.map +1 -1
  141. package/dist/pframe_utils/index.d.ts +3 -3
  142. package/dist/pframe_utils/index.d.ts.map +1 -1
  143. package/dist/pframe_utils/index.js +25 -25
  144. package/dist/pframe_utils/index.js.map +1 -1
  145. package/dist/platforma.d.ts +7 -7
  146. package/dist/platforma.d.ts.map +1 -1
  147. package/dist/raw_globals.cjs +4 -1
  148. package/dist/raw_globals.cjs.map +1 -1
  149. package/dist/raw_globals.d.ts +2 -2
  150. package/dist/raw_globals.d.ts.map +1 -1
  151. package/dist/raw_globals.js +4 -1
  152. package/dist/raw_globals.js.map +1 -1
  153. package/dist/ref_util.cjs +4 -4
  154. package/dist/ref_util.cjs.map +1 -1
  155. package/dist/ref_util.d.ts +1 -1
  156. package/dist/ref_util.js +4 -4
  157. package/dist/ref_util.js.map +1 -1
  158. package/dist/render/accessor.cjs +24 -24
  159. package/dist/render/accessor.cjs.map +1 -1
  160. package/dist/render/accessor.d.ts +10 -10
  161. package/dist/render/accessor.d.ts.map +1 -1
  162. package/dist/render/accessor.js +24 -24
  163. package/dist/render/accessor.js.map +1 -1
  164. package/dist/render/api.cjs +23 -23
  165. package/dist/render/api.cjs.map +1 -1
  166. package/dist/render/api.d.ts +11 -11
  167. package/dist/render/api.d.ts.map +1 -1
  168. package/dist/render/api.js +23 -23
  169. package/dist/render/api.js.map +1 -1
  170. package/dist/render/future.cjs.map +1 -1
  171. package/dist/render/future.d.ts +1 -1
  172. package/dist/render/future.js.map +1 -1
  173. package/dist/render/index.d.ts +6 -6
  174. package/dist/render/internal.cjs +4 -4
  175. package/dist/render/internal.cjs.map +1 -1
  176. package/dist/render/internal.d.ts +7 -7
  177. package/dist/render/internal.d.ts.map +1 -1
  178. package/dist/render/internal.js +4 -4
  179. package/dist/render/internal.js.map +1 -1
  180. package/dist/render/traversal_ops.d.ts +1 -1
  181. package/dist/render/util/axis_filtering.cjs +48 -44
  182. package/dist/render/util/axis_filtering.cjs.map +1 -1
  183. package/dist/render/util/axis_filtering.d.ts +2 -2
  184. package/dist/render/util/axis_filtering.js +48 -44
  185. package/dist/render/util/axis_filtering.js.map +1 -1
  186. package/dist/render/util/column_collection.cjs +42 -35
  187. package/dist/render/util/column_collection.cjs.map +1 -1
  188. package/dist/render/util/column_collection.d.ts +4 -4
  189. package/dist/render/util/column_collection.d.ts.map +1 -1
  190. package/dist/render/util/column_collection.js +42 -35
  191. package/dist/render/util/column_collection.js.map +1 -1
  192. package/dist/render/util/index.d.ts +4 -4
  193. package/dist/render/util/label.cjs +15 -21
  194. package/dist/render/util/label.cjs.map +1 -1
  195. package/dist/render/util/label.d.ts +2 -2
  196. package/dist/render/util/label.d.ts.map +1 -1
  197. package/dist/render/util/label.js +15 -21
  198. package/dist/render/util/label.js.map +1 -1
  199. package/dist/render/util/pcolumn_data.cjs +56 -54
  200. package/dist/render/util/pcolumn_data.cjs.map +1 -1
  201. package/dist/render/util/pcolumn_data.d.ts +5 -5
  202. package/dist/render/util/pcolumn_data.d.ts.map +1 -1
  203. package/dist/render/util/pcolumn_data.js +56 -54
  204. package/dist/render/util/pcolumn_data.js.map +1 -1
  205. package/dist/render/util/pframe_upgraders.cjs +6 -6
  206. package/dist/render/util/pframe_upgraders.cjs.map +1 -1
  207. package/dist/render/util/pframe_upgraders.d.ts +1 -1
  208. package/dist/render/util/pframe_upgraders.d.ts.map +1 -1
  209. package/dist/render/util/pframe_upgraders.js +6 -6
  210. package/dist/render/util/pframe_upgraders.js.map +1 -1
  211. package/dist/render/util/split_selectors.d.ts +1 -1
  212. package/dist/render/util/split_selectors.d.ts.map +1 -1
  213. package/dist/sdk_info.cjs.map +1 -1
  214. package/dist/sdk_info.js.map +1 -1
  215. package/dist/version.cjs.map +1 -1
  216. package/dist/version.js.map +1 -1
  217. package/package.json +23 -21
  218. package/src/annotations/converter.test.ts +98 -101
  219. package/src/annotations/converter.ts +21 -17
  220. package/src/annotations/index.ts +2 -2
  221. package/src/annotations/types.ts +4 -4
  222. package/src/bconfig/index.ts +5 -5
  223. package/src/bconfig/lambdas.ts +10 -12
  224. package/src/bconfig/normalization.ts +5 -5
  225. package/src/bconfig/types.ts +3 -5
  226. package/src/bconfig/util.ts +3 -3
  227. package/src/bconfig/v3.ts +3 -3
  228. package/src/block_api_v1.ts +7 -3
  229. package/src/block_api_v2.ts +7 -3
  230. package/src/block_api_v3.ts +3 -3
  231. package/src/block_migrations.test.ts +66 -67
  232. package/src/block_migrations.ts +16 -16
  233. package/src/block_model.ts +76 -140
  234. package/src/block_state_patch.ts +2 -2
  235. package/src/block_state_util.ts +4 -4
  236. package/src/block_storage.test.ts +106 -99
  237. package/src/block_storage.ts +22 -25
  238. package/src/block_storage_vm.ts +41 -35
  239. package/src/builder.ts +107 -95
  240. package/src/components/PFrameForGraphs.test.ts +261 -255
  241. package/src/components/PFrameForGraphs.ts +35 -22
  242. package/src/components/PlAnnotations/filter.ts +21 -15
  243. package/src/components/PlAnnotations/filters_ui.test.ts +230 -73
  244. package/src/components/PlAnnotations/filters_ui.ts +138 -105
  245. package/src/components/PlAnnotations/index.ts +2 -2
  246. package/src/components/PlAnnotations/types.ts +2 -2
  247. package/src/components/PlDataTable.ts +177 -164
  248. package/src/components/PlMultiSequenceAlignment.ts +11 -18
  249. package/src/components/PlSelectionModel.ts +1 -1
  250. package/src/components/index.ts +5 -5
  251. package/src/config/actions.ts +64 -59
  252. package/src/config/actions_kinds.ts +38 -34
  253. package/src/config/index.ts +6 -6
  254. package/src/config/model.ts +28 -28
  255. package/src/config/model_meta.ts +1 -1
  256. package/src/config/type_engine.ts +3 -3
  257. package/src/config/type_util.ts +2 -2
  258. package/src/env_value.ts +2 -2
  259. package/src/filters/converter.test.ts +185 -144
  260. package/src/filters/converter.ts +47 -35
  261. package/src/filters/index.ts +2 -2
  262. package/src/filters/types.ts +44 -39
  263. package/src/global.d.ts +1 -1
  264. package/src/index.ts +24 -24
  265. package/src/internal.ts +27 -17
  266. package/src/pframe.ts +3 -3
  267. package/src/pframe_utils/columns.ts +81 -31
  268. package/src/pframe_utils/index.ts +65 -43
  269. package/src/platforma.ts +44 -21
  270. package/src/raw_globals.ts +13 -7
  271. package/src/ref_util.ts +6 -6
  272. package/src/render/accessor.ts +43 -44
  273. package/src/render/api.ts +102 -78
  274. package/src/render/future.ts +2 -2
  275. package/src/render/index.ts +6 -6
  276. package/src/render/internal.ts +11 -12
  277. package/src/render/traversal_ops.ts +1 -1
  278. package/src/render/util/axis_filtering.ts +67 -52
  279. package/src/render/util/column_collection.ts +171 -91
  280. package/src/render/util/index.ts +4 -4
  281. package/src/render/util/label.test.ts +139 -139
  282. package/src/render/util/label.ts +42 -33
  283. package/src/render/util/pcolumn_data.ts +111 -75
  284. package/src/render/util/pframe_upgraders.ts +24 -13
  285. package/src/render/util/split_selectors.ts +6 -1
  286. package/src/sdk_info.ts +1 -1
  287. package/src/typing.test.ts +56 -56
  288. package/src/version.ts +1 -1
@@ -4,7 +4,7 @@ import type {
4
4
  PColumn,
5
5
  PColumnLazy,
6
6
  PColumnValues,
7
- } from '@milaboratories/pl-model-common';
7
+ } from "@milaboratories/pl-model-common";
8
8
  import {
9
9
  dataInfoToEntries,
10
10
  isDataInfo,
@@ -14,23 +14,23 @@ import {
14
14
  type DataInfoEntries,
15
15
  type PColumnDataEntry,
16
16
  type PColumnKey,
17
- } from '@milaboratories/pl-model-common';
18
- import { TreeNodeAccessor } from '../accessor';
19
- import type { PColumnDataUniversal } from '../api';
17
+ } from "@milaboratories/pl-model-common";
18
+ import { TreeNodeAccessor } from "../accessor";
19
+ import type { PColumnDataUniversal } from "../api";
20
20
 
21
- const PCD_PREFIX = 'PColumnData/';
21
+ const PCD_PREFIX = "PColumnData/";
22
22
 
23
- export const RT_RESOURCE_MAP = PCD_PREFIX + 'ResourceMap';
24
- export const RT_RESOURCE_MAP_PARTITIONED = PCD_PREFIX + 'Partitioned/ResourceMap';
23
+ export const RT_RESOURCE_MAP = PCD_PREFIX + "ResourceMap";
24
+ export const RT_RESOURCE_MAP_PARTITIONED = PCD_PREFIX + "Partitioned/ResourceMap";
25
25
 
26
- export const RT_JSON_PARTITIONED = PCD_PREFIX + 'JsonPartitioned';
27
- export const RT_BINARY_PARTITIONED = PCD_PREFIX + 'BinaryPartitioned';
28
- export const RT_PARQUET_PARTITIONED = PCD_PREFIX + 'ParquetPartitioned';
26
+ export const RT_JSON_PARTITIONED = PCD_PREFIX + "JsonPartitioned";
27
+ export const RT_BINARY_PARTITIONED = PCD_PREFIX + "BinaryPartitioned";
28
+ export const RT_PARQUET_PARTITIONED = PCD_PREFIX + "ParquetPartitioned";
29
29
 
30
- const PCD_SUP_PREFIX = PCD_PREFIX + 'Partitioned/';
31
- export const RT_JSON_SUPER_PARTITIONED = PCD_SUP_PREFIX + 'JsonPartitioned';
32
- export const RT_BINARY_SUPER_PARTITIONED = PCD_SUP_PREFIX + 'BinaryPartitioned';
33
- export const RT_PARQUET_SUPER_PARTITIONED = PCD_SUP_PREFIX + 'ParquetPartitioned';
30
+ const PCD_SUP_PREFIX = PCD_PREFIX + "Partitioned/";
31
+ export const RT_JSON_SUPER_PARTITIONED = PCD_SUP_PREFIX + "JsonPartitioned";
32
+ export const RT_BINARY_SUPER_PARTITIONED = PCD_SUP_PREFIX + "BinaryPartitioned";
33
+ export const RT_PARQUET_SUPER_PARTITIONED = PCD_SUP_PREFIX + "ParquetPartitioned";
34
34
 
35
35
  export type PColumnResourceMapEntry<T> = {
36
36
  key: PColumnKey;
@@ -54,7 +54,7 @@ function populateResourceMapData<T>(
54
54
  case RT_RESOURCE_MAP: {
55
55
  let isComplete = acc.getInputsLocked();
56
56
  for (const keyStr of acc.listInputFields()) {
57
- const value = acc.resolve({ field: keyStr, assertFieldType: 'Input' });
57
+ const value = acc.resolve({ field: keyStr, assertFieldType: "Input" });
58
58
  const key = [...keyPrefix, ...JSON.parse(keyStr)] as PColumnKey;
59
59
  const converted = value === undefined ? undefined : resourceParser(value);
60
60
  if (converted === undefined) isComplete = false;
@@ -65,7 +65,7 @@ function populateResourceMapData<T>(
65
65
  case RT_RESOURCE_MAP_PARTITIONED: {
66
66
  let isComplete = acc.getInputsLocked();
67
67
  for (const keyStr of acc.listInputFields()) {
68
- const value = acc.resolve({ field: keyStr, assertFieldType: 'Input' });
68
+ const value = acc.resolve({ field: keyStr, assertFieldType: "Input" });
69
69
  if (value === undefined) isComplete = false;
70
70
  else {
71
71
  const key = [...keyPrefix, ...JSON.parse(keyStr)] as PColumnKey;
@@ -89,12 +89,12 @@ function populateResourceMapData<T>(
89
89
  export function parseResourceMap<T>(
90
90
  acc: TreeNodeAccessor | undefined,
91
91
  resourceParser: (acc: TreeNodeAccessor) => T | undefined,
92
- addEntriesWithNoData: false
92
+ addEntriesWithNoData: false,
93
93
  ): PColumnResourceMapData<NonNullable<T>>;
94
94
  export function parseResourceMap<T>(
95
95
  acc: TreeNodeAccessor | undefined,
96
96
  resourceParser: (acc: TreeNodeAccessor) => T | undefined,
97
- addEntriesWithNoData: true
97
+ addEntriesWithNoData: true,
98
98
  ): PColumnResourceMapData<T | undefined>;
99
99
  export function parseResourceMap<T>(
100
100
  acc: TreeNodeAccessor | undefined,
@@ -113,11 +113,11 @@ export type PColumnKeyList = {
113
113
  keyLength: number;
114
114
  };
115
115
 
116
- const removeIndexSuffix = (keyStr: string): { baseKey: string; type: 'index' | 'values' } => {
117
- if (keyStr.endsWith('.index')) {
118
- return { baseKey: keyStr.substring(0, keyStr.length - 6), type: 'index' };
119
- } else if (keyStr.endsWith('.values')) {
120
- return { baseKey: keyStr.substring(0, keyStr.length - 7), type: 'values' };
116
+ const removeIndexSuffix = (keyStr: string): { baseKey: string; type: "index" | "values" } => {
117
+ if (keyStr.endsWith(".index")) {
118
+ return { baseKey: keyStr.substring(0, keyStr.length - 6), type: "index" };
119
+ } else if (keyStr.endsWith(".values")) {
120
+ return { baseKey: keyStr.substring(0, keyStr.length - 7), type: "values" };
121
121
  } else {
122
122
  throw new Error(`key must ends on .index/.values for binary p-column, got: ${keyStr}`);
123
123
  }
@@ -138,23 +138,23 @@ export function getPartitionKeysList(
138
138
  // @TODO validate meta shape
139
139
  switch (rt) {
140
140
  case RT_RESOURCE_MAP:
141
- keyLength = meta['keyLength'];
141
+ keyLength = meta["keyLength"];
142
142
  break;
143
143
 
144
144
  case RT_RESOURCE_MAP_PARTITIONED:
145
- keyLength = meta['partitionKeyLength'] + meta['keyLength'];
145
+ keyLength = meta["partitionKeyLength"] + meta["keyLength"];
146
146
  break;
147
147
 
148
148
  case RT_JSON_PARTITIONED:
149
149
  case RT_BINARY_PARTITIONED:
150
150
  case RT_PARQUET_PARTITIONED:
151
- keyLength = meta['partitionKeyLength'];
151
+ keyLength = meta["partitionKeyLength"];
152
152
  break;
153
153
 
154
154
  case RT_BINARY_SUPER_PARTITIONED:
155
155
  case RT_JSON_SUPER_PARTITIONED:
156
156
  case RT_PARQUET_SUPER_PARTITIONED:
157
- keyLength = meta['superPartitionKeyLength'] + meta['partitionKeyLength'];
157
+ keyLength = meta["superPartitionKeyLength"] + meta["partitionKeyLength"];
158
158
  break;
159
159
  }
160
160
 
@@ -180,7 +180,7 @@ export function getPartitionKeysList(
180
180
  for (const supKeyStr of acc.listInputFields()) {
181
181
  const keyPrefix = [...JSON.parse(supKeyStr)] as PColumnKey;
182
182
 
183
- const value = acc.resolve({ field: supKeyStr, assertFieldType: 'Input' });
183
+ const value = acc.resolve({ field: supKeyStr, assertFieldType: "Input" });
184
184
  if (value !== undefined) {
185
185
  for (let keyStr of value.listInputFields()) {
186
186
  if (rt === RT_BINARY_SUPER_PARTITIONED) {
@@ -197,8 +197,14 @@ export function getPartitionKeysList(
197
197
  return { data, keyLength };
198
198
  }
199
199
 
200
- function getUniquePartitionKeysForDataEntries(list: DataInfoEntries<unknown>): (string | number)[][] {
201
- if (list.type !== 'JsonPartitioned' && list.type !== 'BinaryPartitioned' && list.type !== 'ParquetPartitioned')
200
+ function getUniquePartitionKeysForDataEntries(
201
+ list: DataInfoEntries<unknown>,
202
+ ): (string | number)[][] {
203
+ if (
204
+ list.type !== "JsonPartitioned" &&
205
+ list.type !== "BinaryPartitioned" &&
206
+ list.type !== "ParquetPartitioned"
207
+ )
202
208
  throw new Error(`Splitting requires Partitioned DataInfoEntries, got ${list.type}`);
203
209
 
204
210
  const { parts, partitionKeyLength } = list;
@@ -227,14 +233,15 @@ function getUniquePartitionKeysForDataEntries(list: DataInfoEntries<unknown>): (
227
233
 
228
234
  /** Returns an array of unique partition keys for each column: the i-th element in the resulting 2d array contains all unique values of i-th partition axis. */
229
235
  export function getUniquePartitionKeys(acc: DataInfoEntries<unknown>): (string | number)[][];
230
- export function getUniquePartitionKeys(acc: DataInfoEntries<unknown> | TreeNodeAccessor | undefined): (string | number)[][] | undefined;
236
+ export function getUniquePartitionKeys(
237
+ acc: DataInfoEntries<unknown> | TreeNodeAccessor | undefined,
238
+ ): (string | number)[][] | undefined;
231
239
  export function getUniquePartitionKeys(
232
240
  acc: TreeNodeAccessor | DataInfoEntries<unknown> | undefined,
233
241
  ): (string | number)[][] | undefined {
234
242
  if (acc === undefined) return undefined;
235
243
 
236
- if (isDataInfoEntries(acc))
237
- return getUniquePartitionKeysForDataEntries(acc);
244
+ if (isDataInfoEntries(acc)) return getUniquePartitionKeysForDataEntries(acc);
238
245
 
239
246
  const list = getPartitionKeysList(acc);
240
247
  if (!list) return undefined;
@@ -249,7 +256,7 @@ export function getUniquePartitionKeys(
249
256
 
250
257
  for (const l of data) {
251
258
  if (l.length !== keyLength) {
252
- throw new Error('key length does not match partition length');
259
+ throw new Error("key length does not match partition length");
253
260
  }
254
261
  for (let i = 0; i < keyLength; ++i) {
255
262
  result[i].add(l[i]);
@@ -280,10 +287,12 @@ export function parsePColumnData(
280
287
  const meta = acc.getDataAsJson<Record<string, number>>();
281
288
 
282
289
  // Prevent recursive super-partitioned resources
283
- if (keyPrefix.length > 0
284
- && (resourceType === RT_JSON_SUPER_PARTITIONED
285
- || resourceType === RT_BINARY_SUPER_PARTITIONED
286
- || resourceType === RT_PARQUET_SUPER_PARTITIONED)) {
290
+ if (
291
+ keyPrefix.length > 0 &&
292
+ (resourceType === RT_JSON_SUPER_PARTITIONED ||
293
+ resourceType === RT_BINARY_SUPER_PARTITIONED ||
294
+ resourceType === RT_PARQUET_SUPER_PARTITIONED)
295
+ ) {
287
296
  throw new Error(`Unexpected nested super-partitioned resource: ${resourceType}`);
288
297
  }
289
298
 
@@ -293,13 +302,13 @@ export function parsePColumnData(
293
302
  throw new Error(`Only data columns are supported, got: ${resourceType}`);
294
303
 
295
304
  case RT_JSON_PARTITIONED: {
296
- if (typeof meta?.partitionKeyLength !== 'number') {
305
+ if (typeof meta?.partitionKeyLength !== "number") {
297
306
  throw new Error(`Missing partitionKeyLength in metadata for ${resourceType}`);
298
307
  }
299
308
 
300
309
  const parts: PColumnDataEntry<TreeNodeAccessor>[] = [];
301
310
  for (const keyStr of acc.listInputFields()) {
302
- const value = acc.resolve({ field: keyStr, assertFieldType: 'Input' });
311
+ const value = acc.resolve({ field: keyStr, assertFieldType: "Input" });
303
312
  if (value === undefined) return undefined;
304
313
 
305
314
  const key = [...keyPrefix, ...JSON.parse(keyStr)];
@@ -307,14 +316,14 @@ export function parsePColumnData(
307
316
  }
308
317
 
309
318
  return {
310
- type: 'JsonPartitioned',
319
+ type: "JsonPartitioned",
311
320
  partitionKeyLength: meta.partitionKeyLength,
312
321
  parts,
313
322
  };
314
323
  }
315
324
 
316
325
  case RT_BINARY_PARTITIONED: {
317
- if (typeof meta?.partitionKeyLength !== 'number') {
326
+ if (typeof meta?.partitionKeyLength !== "number") {
318
327
  throw new Error(`Missing partitionKeyLength in metadata for ${resourceType}`);
319
328
  }
320
329
 
@@ -325,7 +334,7 @@ export function parsePColumnData(
325
334
  for (const keyStr of acc.listInputFields()) {
326
335
  const suffix = removeIndexSuffix(keyStr);
327
336
 
328
- const value = acc.resolve({ field: keyStr, assertFieldType: 'Input' });
337
+ const value = acc.resolve({ field: keyStr, assertFieldType: "Input" });
329
338
  if (value === undefined) return undefined;
330
339
 
331
340
  let entry = baseKeys.get(suffix.baseKey);
@@ -334,7 +343,7 @@ export function parsePColumnData(
334
343
  baseKeys.set(suffix.baseKey, entry);
335
344
  }
336
345
 
337
- if (suffix.type === 'index') {
346
+ if (suffix.type === "index") {
338
347
  entry.index = value;
339
348
  } else {
340
349
  entry.values = value;
@@ -356,20 +365,20 @@ export function parsePColumnData(
356
365
  }
357
366
 
358
367
  return {
359
- type: 'BinaryPartitioned',
368
+ type: "BinaryPartitioned",
360
369
  partitionKeyLength: meta.partitionKeyLength,
361
370
  parts,
362
371
  };
363
372
  }
364
373
 
365
374
  case RT_PARQUET_PARTITIONED: {
366
- if (typeof meta?.partitionKeyLength !== 'number') {
375
+ if (typeof meta?.partitionKeyLength !== "number") {
367
376
  throw new Error(`Missing partitionKeyLength in metadata for ${resourceType}`);
368
377
  }
369
378
 
370
379
  const parts: PColumnDataEntry<TreeNodeAccessor>[] = [];
371
380
  for (const keyStr of acc.listInputFields()) {
372
- const value = acc.resolve({ field: keyStr, assertFieldType: 'Input' });
381
+ const value = acc.resolve({ field: keyStr, assertFieldType: "Input" });
373
382
  if (value === undefined) return undefined;
374
383
 
375
384
  const key = [...keyPrefix, ...JSON.parse(keyStr)];
@@ -377,16 +386,20 @@ export function parsePColumnData(
377
386
  }
378
387
 
379
388
  return {
380
- type: 'ParquetPartitioned',
389
+ type: "ParquetPartitioned",
381
390
  partitionKeyLength: meta.partitionKeyLength,
382
391
  parts,
383
392
  };
384
393
  }
385
394
 
386
395
  case RT_JSON_SUPER_PARTITIONED: {
387
- if (typeof meta?.superPartitionKeyLength !== 'number'
388
- || typeof meta?.partitionKeyLength !== 'number') {
389
- throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${resourceType}`);
396
+ if (
397
+ typeof meta?.superPartitionKeyLength !== "number" ||
398
+ typeof meta?.partitionKeyLength !== "number"
399
+ ) {
400
+ throw new Error(
401
+ `Missing superPartitionKeyLength or partitionKeyLength in metadata for ${resourceType}`,
402
+ );
390
403
  }
391
404
 
392
405
  const totalKeyLength = meta.superPartitionKeyLength + meta.partitionKeyLength;
@@ -394,35 +407,41 @@ export function parsePColumnData(
394
407
 
395
408
  // Process all super partitions
396
409
  for (const supKeyStr of acc.listInputFields()) {
397
- const superPartition = acc.resolve({ field: supKeyStr, assertFieldType: 'Input' });
410
+ const superPartition = acc.resolve({ field: supKeyStr, assertFieldType: "Input" });
398
411
  if (superPartition === undefined) return undefined;
399
412
 
400
413
  // Validate inner type
401
414
  if (superPartition.resourceType.name !== RT_JSON_PARTITIONED) {
402
- throw new Error(`Expected ${RT_JSON_PARTITIONED} inside ${resourceType}, but got ${superPartition.resourceType.name}`);
415
+ throw new Error(
416
+ `Expected ${RT_JSON_PARTITIONED} inside ${resourceType}, but got ${superPartition.resourceType.name}`,
417
+ );
403
418
  }
404
419
 
405
420
  const innerResult = parsePColumnData(superPartition, JSON.parse(supKeyStr) as PColumnKey);
406
421
 
407
422
  if (innerResult === undefined) return undefined;
408
423
 
409
- if (innerResult.type !== 'JsonPartitioned')
424
+ if (innerResult.type !== "JsonPartitioned")
410
425
  throw new Error(`Unexpected inner result type for ${resourceType}: ${innerResult.type}`);
411
426
 
412
427
  parts.push(...innerResult.parts);
413
428
  }
414
429
 
415
430
  return {
416
- type: 'JsonPartitioned',
431
+ type: "JsonPartitioned",
417
432
  partitionKeyLength: totalKeyLength,
418
433
  parts,
419
434
  };
420
435
  }
421
436
 
422
437
  case RT_BINARY_SUPER_PARTITIONED: {
423
- if (typeof meta?.superPartitionKeyLength !== 'number'
424
- || typeof meta?.partitionKeyLength !== 'number') {
425
- throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${resourceType}`);
438
+ if (
439
+ typeof meta?.superPartitionKeyLength !== "number" ||
440
+ typeof meta?.partitionKeyLength !== "number"
441
+ ) {
442
+ throw new Error(
443
+ `Missing superPartitionKeyLength or partitionKeyLength in metadata for ${resourceType}`,
444
+ );
426
445
  }
427
446
 
428
447
  const totalKeyLength = meta.superPartitionKeyLength + meta.partitionKeyLength;
@@ -430,35 +449,41 @@ export function parsePColumnData(
430
449
 
431
450
  // Process all super partitions
432
451
  for (const supKeyStr of acc.listInputFields()) {
433
- const superPartition = acc.resolve({ field: supKeyStr, assertFieldType: 'Input' });
452
+ const superPartition = acc.resolve({ field: supKeyStr, assertFieldType: "Input" });
434
453
  if (superPartition === undefined) return undefined;
435
454
 
436
455
  // Validate inner type
437
456
  if (superPartition.resourceType.name !== RT_BINARY_PARTITIONED) {
438
- throw new Error(`Expected ${RT_BINARY_PARTITIONED} inside ${resourceType}, but got ${superPartition.resourceType.name}`);
457
+ throw new Error(
458
+ `Expected ${RT_BINARY_PARTITIONED} inside ${resourceType}, but got ${superPartition.resourceType.name}`,
459
+ );
439
460
  }
440
461
 
441
462
  const innerResult = parsePColumnData(superPartition, JSON.parse(supKeyStr) as PColumnKey);
442
463
 
443
464
  if (innerResult === undefined) return undefined;
444
465
 
445
- if (innerResult.type !== 'BinaryPartitioned')
466
+ if (innerResult.type !== "BinaryPartitioned")
446
467
  throw new Error(`Unexpected inner result type for ${resourceType}: ${innerResult.type}`);
447
468
 
448
469
  parts.push(...innerResult.parts);
449
470
  }
450
471
 
451
472
  return {
452
- type: 'BinaryPartitioned',
473
+ type: "BinaryPartitioned",
453
474
  partitionKeyLength: totalKeyLength,
454
475
  parts,
455
476
  };
456
477
  }
457
478
 
458
479
  case RT_PARQUET_SUPER_PARTITIONED: {
459
- if (typeof meta?.superPartitionKeyLength !== 'number'
460
- || typeof meta?.partitionKeyLength !== 'number') {
461
- throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${resourceType}`);
480
+ if (
481
+ typeof meta?.superPartitionKeyLength !== "number" ||
482
+ typeof meta?.partitionKeyLength !== "number"
483
+ ) {
484
+ throw new Error(
485
+ `Missing superPartitionKeyLength or partitionKeyLength in metadata for ${resourceType}`,
486
+ );
462
487
  }
463
488
 
464
489
  const totalKeyLength = meta.superPartitionKeyLength + meta.partitionKeyLength;
@@ -466,26 +491,28 @@ export function parsePColumnData(
466
491
 
467
492
  // Process all super partitions
468
493
  for (const supKeyStr of acc.listInputFields()) {
469
- const superPartition = acc.resolve({ field: supKeyStr, assertFieldType: 'Input' });
494
+ const superPartition = acc.resolve({ field: supKeyStr, assertFieldType: "Input" });
470
495
  if (superPartition === undefined) return undefined;
471
496
 
472
497
  // Validate inner type
473
498
  if (superPartition.resourceType.name !== RT_PARQUET_PARTITIONED) {
474
- throw new Error(`Expected ${RT_PARQUET_PARTITIONED} inside ${resourceType}, but got ${superPartition.resourceType.name}`);
499
+ throw new Error(
500
+ `Expected ${RT_PARQUET_PARTITIONED} inside ${resourceType}, but got ${superPartition.resourceType.name}`,
501
+ );
475
502
  }
476
503
 
477
504
  const innerResult = parsePColumnData(superPartition, JSON.parse(supKeyStr) as PColumnKey);
478
505
 
479
506
  if (innerResult === undefined) return undefined;
480
507
 
481
- if (innerResult.type !== 'ParquetPartitioned')
508
+ if (innerResult.type !== "ParquetPartitioned")
482
509
  throw new Error(`Unexpected inner result type for ${resourceType}: ${innerResult.type}`);
483
510
 
484
511
  parts.push(...innerResult.parts);
485
512
  }
486
513
 
487
514
  return {
488
- type: 'ParquetPartitioned',
515
+ type: "ParquetPartitioned",
489
516
  partitionKeyLength: totalKeyLength,
490
517
  parts,
491
518
  };
@@ -503,7 +530,11 @@ export function parsePColumnData(
503
530
  * @returns The data in DataInfoEntries format, or undefined if the input was undefined or data is not ready.
504
531
  */
505
532
  export function convertOrParsePColumnData(
506
- acc: TreeNodeAccessor | DataInfoEntries<TreeNodeAccessor> | DataInfo<TreeNodeAccessor> | undefined,
533
+ acc:
534
+ | TreeNodeAccessor
535
+ | DataInfoEntries<TreeNodeAccessor>
536
+ | DataInfo<TreeNodeAccessor>
537
+ | undefined,
507
538
  ): DataInfoEntries<TreeNodeAccessor> | undefined {
508
539
  if (acc === undefined) return undefined;
509
540
 
@@ -514,18 +545,21 @@ export function convertOrParsePColumnData(
514
545
  throw new Error(`Unexpected input type: ${typeof acc}`);
515
546
  }
516
547
 
517
- export function isPColumnReady(c: (PColumn<PColumnDataUniversal> | PColumnLazy<undefined | PColumnDataUniversal>)): c is PColumn<PColumnDataUniversal> | PColumnLazy<PColumnDataUniversal> {
548
+ export function isPColumnReady(
549
+ c: PColumn<PColumnDataUniversal> | PColumnLazy<undefined | PColumnDataUniversal>,
550
+ ): c is PColumn<PColumnDataUniversal> | PColumnLazy<PColumnDataUniversal> {
518
551
  const isValues = (d: PColumnDataUniversal): d is PColumnValues => Array.isArray(d);
519
- const isAccessor = (d: PColumnDataUniversal): d is TreeNodeAccessor => d instanceof TreeNodeAccessor;
552
+ const isAccessor = (d: PColumnDataUniversal): d is TreeNodeAccessor =>
553
+ d instanceof TreeNodeAccessor;
520
554
 
521
555
  let ready = true;
522
- const data = typeof c.data === 'function' ? c.data() : c.data;
556
+ const data = typeof c.data === "function" ? c.data() : c.data;
523
557
  if (data == null) {
524
558
  return false;
525
559
  } else if (isAccessor(data)) {
526
560
  ready &&= data.getIsReadyOrError();
527
561
  } else if (isDataInfo(data)) {
528
- visitDataInfo(data, (v) => ready &&= v.getIsReadyOrError());
562
+ visitDataInfo(data, (v) => (ready &&= v.getIsReadyOrError()));
529
563
  } else if (!isValues(data)) {
530
564
  // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
531
565
  throw Error(`unsupported column data type: ${data satisfies never}`);
@@ -533,6 +567,8 @@ export function isPColumnReady(c: (PColumn<PColumnDataUniversal> | PColumnLazy<u
533
567
  return ready;
534
568
  }
535
569
 
536
- export function allPColumnsReady(columns: (PColumn<PColumnDataUniversal> | PColumnLazy<undefined | PColumnDataUniversal>)[]): columns is (PColumn<PColumnDataUniversal> | PColumnLazy<PColumnDataUniversal>)[] {
570
+ export function allPColumnsReady(
571
+ columns: (PColumn<PColumnDataUniversal> | PColumnLazy<undefined | PColumnDataUniversal>)[],
572
+ ): columns is (PColumn<PColumnDataUniversal> | PColumnLazy<PColumnDataUniversal>)[] {
537
573
  return columns.every(isPColumnReady);
538
574
  }
@@ -6,34 +6,42 @@ import {
6
6
  type SingleValueNotPredicateV2,
7
7
  type PTableRecordSingleValueFilterV2,
8
8
  type PTableRecordFilter,
9
- } from '@milaboratories/pl-model-common';
9
+ } from "@milaboratories/pl-model-common";
10
10
 
11
- export function patchInSetFilters(filters: PTableRecordSingleValueFilterV2[]): PTableRecordFilter[] {
11
+ export function patchInSetFilters(
12
+ filters: PTableRecordSingleValueFilterV2[],
13
+ ): PTableRecordFilter[] {
12
14
  const inSetToOrEqual = (predicate: SingleValuePredicateV2): SingleValuePredicateV2 => {
13
- if (predicate.operator !== 'InSet') return predicate;
15
+ if (predicate.operator !== "InSet") return predicate;
14
16
  return {
15
- operator: 'Or',
16
- operands: predicate.references.map((reference) => ({
17
- operator: 'Equal',
18
- reference,
19
- } satisfies SingleValueEqualPredicate)),
17
+ operator: "Or",
18
+ operands: predicate.references.map(
19
+ (reference) =>
20
+ ({
21
+ operator: "Equal",
22
+ reference,
23
+ }) satisfies SingleValueEqualPredicate,
24
+ ),
20
25
  } satisfies SingleValueOrPredicateV2;
21
26
  };
22
27
 
23
- const mapSingleValuePredicate = (filter: SingleValuePredicateV2, cb: (predicate: SingleValuePredicateV2) => SingleValuePredicateV2): SingleValuePredicateV2 => {
28
+ const mapSingleValuePredicate = (
29
+ filter: SingleValuePredicateV2,
30
+ cb: (predicate: SingleValuePredicateV2) => SingleValuePredicateV2,
31
+ ): SingleValuePredicateV2 => {
24
32
  const operator = filter.operator;
25
33
  switch (operator) {
26
- case 'And':
34
+ case "And":
27
35
  return {
28
36
  ...filter,
29
37
  operands: filter.operands.map((operand) => mapSingleValuePredicate(operand, cb)),
30
38
  } satisfies SingleValueAndPredicateV2;
31
- case 'Or':
39
+ case "Or":
32
40
  return {
33
41
  ...filter,
34
42
  operands: filter.operands.map((operand) => mapSingleValuePredicate(operand, cb)),
35
43
  } satisfies SingleValueOrPredicateV2;
36
- case 'Not':
44
+ case "Not":
37
45
  return {
38
46
  ...filter,
39
47
  operand: mapSingleValuePredicate(filter.operand, cb),
@@ -43,7 +51,10 @@ export function patchInSetFilters(filters: PTableRecordSingleValueFilterV2[]): P
43
51
  }
44
52
  };
45
53
 
46
- const mapFilter = (filter: PTableRecordSingleValueFilterV2, cb: (predicate: SingleValuePredicateV2) => SingleValuePredicateV2): PTableRecordSingleValueFilterV2 => {
54
+ const mapFilter = (
55
+ filter: PTableRecordSingleValueFilterV2,
56
+ cb: (predicate: SingleValuePredicateV2) => SingleValuePredicateV2,
57
+ ): PTableRecordSingleValueFilterV2 => {
47
58
  return {
48
59
  ...filter,
49
60
  predicate: mapSingleValuePredicate(filter.predicate, cb),
@@ -1,4 +1,9 @@
1
- import type { AAxisSelector, AnchoredPColumnSelector, AxisSelector, PColumnSelector } from '@milaboratories/pl-model-common';
1
+ import type {
2
+ AAxisSelector,
3
+ AnchoredPColumnSelector,
4
+ AxisSelector,
5
+ PColumnSelector,
6
+ } from "@milaboratories/pl-model-common";
2
7
 
3
8
  /**
4
9
  * AAxisSelector with an optional split flag
package/src/sdk_info.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { PlatformaSDKVersion } from './version';
1
+ import { PlatformaSDKVersion } from "./version";
2
2
 
3
3
  export type SdkInfo = {
4
4
  readonly sdkVersion: string;