@platforma-sdk/model 1.53.11 → 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 +24 -22
  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
@@ -1 +1 @@
1
- {"version":3,"file":"sdk_info.cjs","sources":["../src/sdk_info.ts"],"sourcesContent":["import { PlatformaSDKVersion } from './version';\n\nexport type SdkInfo = {\n readonly sdkVersion: string;\n};\n\nexport const CurrentSdkInfo: SdkInfo = {\n sdkVersion: PlatformaSDKVersion,\n};\n"],"names":["PlatformaSDKVersion"],"mappings":";;;;AAMO,MAAM,cAAc,GAAY;AACrC,IAAA,UAAU,EAAEA,2BAAmB;;;;;"}
1
+ {"version":3,"file":"sdk_info.cjs","sources":["../src/sdk_info.ts"],"sourcesContent":["import { PlatformaSDKVersion } from \"./version\";\n\nexport type SdkInfo = {\n readonly sdkVersion: string;\n};\n\nexport const CurrentSdkInfo: SdkInfo = {\n sdkVersion: PlatformaSDKVersion,\n};\n"],"names":["PlatformaSDKVersion"],"mappings":";;;;AAMO,MAAM,cAAc,GAAY;AACrC,IAAA,UAAU,EAAEA,2BAAmB;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"sdk_info.js","sources":["../src/sdk_info.ts"],"sourcesContent":["import { PlatformaSDKVersion } from './version';\n\nexport type SdkInfo = {\n readonly sdkVersion: string;\n};\n\nexport const CurrentSdkInfo: SdkInfo = {\n sdkVersion: PlatformaSDKVersion,\n};\n"],"names":[],"mappings":";;AAMO,MAAM,cAAc,GAAY;AACrC,IAAA,UAAU,EAAE,mBAAmB;;;;;"}
1
+ {"version":3,"file":"sdk_info.js","sources":["../src/sdk_info.ts"],"sourcesContent":["import { PlatformaSDKVersion } from \"./version\";\n\nexport type SdkInfo = {\n readonly sdkVersion: string;\n};\n\nexport const CurrentSdkInfo: SdkInfo = {\n sdkVersion: PlatformaSDKVersion,\n};\n"],"names":[],"mappings":";;AAMO,MAAM,cAAc,GAAY;AACrC,IAAA,UAAU,EAAE,mBAAmB;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"version.cjs","sources":["../src/version.ts"],"sourcesContent":["import { version } from '../package.json';\nexport const PlatformaSDKVersion = version;\n"],"names":["version"],"mappings":";;;;AACO,MAAM,mBAAmB,GAAGA;;;;"}
1
+ {"version":3,"file":"version.cjs","sources":["../src/version.ts"],"sourcesContent":["import { version } from \"../package.json\";\nexport const PlatformaSDKVersion = version;\n"],"names":["version"],"mappings":";;;;AACO,MAAM,mBAAmB,GAAGA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sources":["../src/version.ts"],"sourcesContent":["import { version } from '../package.json';\nexport const PlatformaSDKVersion = version;\n"],"names":[],"mappings":";;AACO,MAAM,mBAAmB,GAAG;;;;"}
1
+ {"version":3,"file":"version.js","sources":["../src/version.ts"],"sourcesContent":["import { version } from \"../package.json\";\nexport const PlatformaSDKVersion = version;\n"],"names":[],"mappings":";;AACO,MAAM,mBAAmB,GAAG;;;;"}
package/package.json CHANGED
@@ -1,49 +1,51 @@
1
1
  {
2
2
  "name": "@platforma-sdk/model",
3
- "version": "1.53.11",
3
+ "version": "1.53.13",
4
4
  "description": "Platforma.bio SDK / Block Model",
5
+ "files": [
6
+ "./dist/**/*",
7
+ "./src/**/*",
8
+ "README.md"
9
+ ],
5
10
  "type": "module",
6
- "types": "./dist/index.d.ts",
7
11
  "main": "./dist/index.js",
12
+ "types": "./dist/index.d.ts",
8
13
  "exports": {
9
14
  ".": {
10
- "sources": "./src/index.ts",
11
15
  "types": "./dist/index.d.ts",
16
+ "sources": "./src/index.ts",
12
17
  "import": "./dist/index.js",
13
18
  "require": "./dist/index.cjs"
14
19
  }
15
20
  },
16
- "files": [
17
- "./dist/**/*",
18
- "./src/**/*",
19
- "README.md"
20
- ],
21
21
  "dependencies": {
22
- "fast-json-patch": "^3.1.1",
23
- "utility-types": "^3.11.0",
24
22
  "canonicalize": "~2.1.0",
25
23
  "es-toolkit": "^1.39.10",
24
+ "fast-json-patch": "^3.1.1",
25
+ "utility-types": "^3.11.0",
26
26
  "zod": "~3.23.8",
27
- "@milaboratories/pl-model-common": "1.24.3",
28
- "@milaboratories/ptabler-expression-js": "1.1.13",
29
- "@milaboratories/pl-error-like": "1.12.5"
27
+ "@milaboratories/pl-error-like": "1.12.6",
28
+ "@milaboratories/pl-model-common": "1.24.4",
29
+ "@milaboratories/ptabler-expression-js": "1.1.14"
30
30
  },
31
31
  "devDependencies": {
32
+ "@vitest/coverage-istanbul": "^4.0.16",
32
33
  "typescript": "~5.6.3",
33
34
  "vitest": "^4.0.16",
34
- "@vitest/coverage-istanbul": "^4.0.16",
35
- "@milaboratories/eslint-config": "1.0.5",
36
- "@milaboratories/build-configs": "1.4.0",
37
- "@milaboratories/helpers": "1.13.0",
38
- "@milaboratories/ts-builder": "1.2.4",
39
- "@milaboratories/ts-configs": "1.2.0"
35
+ "@milaboratories/build-configs": "1.4.1",
36
+ "@milaboratories/ts-configs": "1.2.0",
37
+ "@milaboratories/ts-builder": "1.2.5",
38
+ "@milaboratories/helpers": "1.13.1"
40
39
  },
41
40
  "scripts": {
42
- "type-check": "ts-builder types --target node",
43
41
  "build": "ts-builder build --target node",
44
42
  "watch": "ts-builder build --target node --watch",
45
- "lint": "eslint .",
43
+ "check": "ts-builder check --target node",
44
+ "formatter:check": "ts-builder formatter --check",
45
+ "linter:check": "ts-builder linter --check",
46
+ "types:check": "ts-builder type-check --target node",
46
47
  "test": "vitest run --coverage",
47
- "do-pack": "rm -f *.tgz && pnpm pack && mv *.tgz package.tgz"
48
+ "do-pack": "rm -f *.tgz && pnpm pack && mv *.tgz package.tgz",
49
+ "fmt": "ts-builder format"
48
50
  }
49
51
  }
@@ -1,132 +1,129 @@
1
- import { describe, expect, test } from 'vitest';
2
- import { convertFilterSpecsToExpressionSpecs } from './converter';
3
- import { FilterSpecUi } from './types';
1
+ import { describe, expect, test } from "vitest";
2
+ import { convertFilterSpecsToExpressionSpecs } from "./converter";
3
+ import { FilterSpecUi } from "./types";
4
4
 
5
- describe('convertFilterSpecsToExpressionSpecs', () => {
6
- test('should compile an empty annotation script', () => {
5
+ describe("convertFilterSpecsToExpressionSpecs", () => {
6
+ test("should compile an empty annotation script", () => {
7
7
  const script = convertFilterSpecsToExpressionSpecs([]);
8
8
  expect(script).toEqual([]);
9
9
  });
10
10
 
11
- test('should compile an annotation script with steps', () => {
11
+ test("should compile an annotation script with steps", () => {
12
12
  const filters: FilterSpecUi[] = [
13
- {
14
- label: 'Step 1',
15
- filter: {
16
- type: 'and',
17
- filters: [
18
- { type: 'isNA', column: 'colA' } as any,
19
- { type: 'patternEquals', column: 'colB', value: 'abc' } as any,
20
- ],
21
- },
13
+ {
14
+ label: "Step 1",
15
+ filter: {
16
+ type: "and",
17
+ filters: [
18
+ { type: "isNA", column: "colA" } as any,
19
+ { type: "patternEquals", column: "colB", value: "abc" } as any,
20
+ ],
22
21
  },
23
- ];
22
+ },
23
+ ];
24
24
  const expected = [
25
25
  {
26
- "name": "Step 1",
27
- "type": "alias",
28
- "value": {
29
- "conditions": [
26
+ name: "Step 1",
27
+ type: "alias",
28
+ value: {
29
+ conditions: [
30
30
  {
31
- "then": {
32
- "type": "const",
33
- "value": true,
31
+ then: {
32
+ type: "const",
33
+ value: true,
34
34
  },
35
- "when": {
36
- "operands": [
35
+ when: {
36
+ operands: [
37
37
  {
38
- "type": "is_na",
39
- "value": {
40
- "name": "colA",
41
- "type": "col",
38
+ type: "is_na",
39
+ value: {
40
+ name: "colA",
41
+ type: "col",
42
42
  },
43
43
  },
44
44
  {
45
- "lhs": {
46
- "name": "colB",
47
- "type": "col",
45
+ lhs: {
46
+ name: "colB",
47
+ type: "col",
48
48
  },
49
- "rhs": {
50
- "type": "const",
51
- "value": "abc",
49
+ rhs: {
50
+ type: "const",
51
+ value: "abc",
52
52
  },
53
- "type": "eq",
53
+ type: "eq",
54
54
  },
55
55
  ],
56
- "type": "and",
56
+ type: "and",
57
57
  },
58
58
  },
59
59
  ],
60
- "otherwise": {
61
- "type": "const",
62
- "value": false,
60
+ otherwise: {
61
+ type: "const",
62
+ value: false,
63
63
  },
64
- "type": "when_then_otherwise",
65
- }
64
+ type: "when_then_otherwise",
65
+ },
66
66
  },
67
67
  ];
68
68
  const script = convertFilterSpecsToExpressionSpecs(filters);
69
69
  expect(script).toEqual(expected);
70
70
  });
71
71
 
72
- test('should filter out empty/unset filter conditions', () => {
72
+ test("should filter out empty/unset filter conditions", () => {
73
73
  const filters: FilterSpecUi[] = [
74
74
  {
75
- label: 'Step with various unset filters',
75
+ label: "Step with various unset filters",
76
76
  filter: {
77
- type: 'and',
77
+ type: "and",
78
78
  filters: [
79
79
  {} as any,
80
80
  { type: undefined } as any,
81
- { type: 'isNA', column: 'colA' },
82
- { type: 'isNA', column: undefined } as any,
83
- { type: 'isNotNA', column: undefined } as any,
84
- { type: 'patternEquals', column: undefined, value: 'test' },
85
- { type: 'patternEquals', column: 'colX', value: undefined } as any,
86
- { type: 'patternNotEquals', column: undefined, value: 'test' } as any,
87
- { type: 'patternNotEquals', column: 'colX', value: undefined } as any,
88
- { type: 'patternContainSubsequence', column: undefined, value: 'test' } as any,
89
- { type: 'patternContainSubsequence', column: 'colX', value: undefined } as any,
90
- { type: 'equal', column: undefined, x: 5 } as any,
91
- { type: 'equal', column: 'colX', x: undefined } as any,
92
- { type: 'lessThan', column: undefined, x: 5 } as any,
93
- { type: 'lessThan', column: 'colX', x: undefined } as any,
94
- { type: 'greaterThan', column: undefined, x: 5 } as any,
95
- { type: 'greaterThan', column: 'colX', x: undefined } as any,
96
- { type: 'topN', column: undefined, n: 5 } as any,
97
- { type: 'topN', column: 'colX', n: undefined } as any,
98
- { type: 'bottomN', column: undefined, n: 5 } as any,
99
- { type: 'bottomN', column: 'colX', n: undefined } as any,
100
- { type: 'equalToColumn', column: undefined, rhs: 'colY' } as any,
101
- { type: 'equalToColumn', column: 'colX', rhs: undefined } as any,
102
- { type: 'greaterThanColumn', column: undefined, rhs: 'colY' } as any,
103
- { type: 'greaterThanColumn', column: 'colX', rhs: undefined } as any,
104
- { type: 'lessThanColumn', column: undefined, rhs: 'colY' } as any,
105
- { type: 'lessThanColumn', column: 'colX', rhs: undefined } as any,
106
- { type: undefined, column: 'colX', value: 'someValue' } as any,
81
+ { type: "isNA", column: "colA" },
82
+ { type: "isNA", column: undefined } as any,
83
+ { type: "isNotNA", column: undefined } as any,
84
+ { type: "patternEquals", column: undefined, value: "test" },
85
+ { type: "patternEquals", column: "colX", value: undefined } as any,
86
+ { type: "patternNotEquals", column: undefined, value: "test" } as any,
87
+ { type: "patternNotEquals", column: "colX", value: undefined } as any,
88
+ { type: "patternContainSubsequence", column: undefined, value: "test" } as any,
89
+ { type: "patternContainSubsequence", column: "colX", value: undefined } as any,
90
+ { type: "equal", column: undefined, x: 5 } as any,
91
+ { type: "equal", column: "colX", x: undefined } as any,
92
+ { type: "lessThan", column: undefined, x: 5 } as any,
93
+ { type: "lessThan", column: "colX", x: undefined } as any,
94
+ { type: "greaterThan", column: undefined, x: 5 } as any,
95
+ { type: "greaterThan", column: "colX", x: undefined } as any,
96
+ { type: "topN", column: undefined, n: 5 } as any,
97
+ { type: "topN", column: "colX", n: undefined } as any,
98
+ { type: "bottomN", column: undefined, n: 5 } as any,
99
+ { type: "bottomN", column: "colX", n: undefined } as any,
100
+ { type: "equalToColumn", column: undefined, rhs: "colY" } as any,
101
+ { type: "equalToColumn", column: "colX", rhs: undefined } as any,
102
+ { type: "greaterThanColumn", column: undefined, rhs: "colY" } as any,
103
+ { type: "greaterThanColumn", column: "colX", rhs: undefined } as any,
104
+ { type: "lessThanColumn", column: undefined, rhs: "colY" } as any,
105
+ { type: "lessThanColumn", column: "colX", rhs: undefined } as any,
106
+ { type: undefined, column: "colX", value: "someValue" } as any,
107
107
  ],
108
108
  },
109
109
  },
110
110
  {
111
- label: 'Step with nested unset filters',
111
+ label: "Step with nested unset filters",
112
112
  filter: {
113
- type: 'or',
113
+ type: "or",
114
114
  filters: [
115
115
  {
116
- type: 'and',
116
+ type: "and",
117
117
  filters: [
118
118
  { type: undefined } as any,
119
- { type: 'patternEquals', column: 'colB', value: 'test' },
119
+ { type: "patternEquals", column: "colB", value: "test" },
120
120
  { type: undefined, column: undefined } as any,
121
121
  ],
122
122
  },
123
123
  { type: undefined } as any,
124
124
  {
125
- type: 'or',
126
- filters: [
127
- { type: undefined } as any,
128
- { type: undefined, value: undefined } as any,
129
- ],
125
+ type: "or",
126
+ filters: [{ type: undefined } as any, { type: undefined, value: undefined } as any],
130
127
  } as any,
131
128
  ],
132
129
  },
@@ -134,23 +131,23 @@ describe('convertFilterSpecsToExpressionSpecs', () => {
134
131
  ];
135
132
  const expected = [
136
133
  {
137
- name: 'Step with various unset filters',
138
- type: 'alias',
134
+ name: "Step with various unset filters",
135
+ type: "alias",
139
136
  value: {
140
137
  conditions: [
141
138
  {
142
139
  then: {
143
- type: 'const',
140
+ type: "const",
144
141
  value: true,
145
142
  },
146
143
  when: {
147
- type: 'and',
144
+ type: "and",
148
145
  operands: [
149
146
  {
150
- type: 'is_na',
147
+ type: "is_na",
151
148
  value: {
152
- name: 'colA',
153
- type: 'col',
149
+ name: "colA",
150
+ type: "col",
154
151
  },
155
152
  },
156
153
  ],
@@ -158,38 +155,38 @@ describe('convertFilterSpecsToExpressionSpecs', () => {
158
155
  },
159
156
  ],
160
157
  otherwise: {
161
- type: 'const',
158
+ type: "const",
162
159
  value: false,
163
160
  },
164
- type: 'when_then_otherwise',
161
+ type: "when_then_otherwise",
165
162
  },
166
163
  },
167
164
  {
168
- name: 'Step with nested unset filters',
169
- type: 'alias',
165
+ name: "Step with nested unset filters",
166
+ type: "alias",
170
167
  value: {
171
168
  conditions: [
172
169
  {
173
170
  then: {
174
- type: 'const',
171
+ type: "const",
175
172
  value: true,
176
173
  },
177
174
  when: {
178
- type: 'or',
175
+ type: "or",
179
176
  operands: [
180
177
  {
181
- type: 'and',
178
+ type: "and",
182
179
  operands: [
183
180
  {
184
181
  lhs: {
185
- name: 'colB',
186
- type: 'col',
182
+ name: "colB",
183
+ type: "col",
187
184
  },
188
185
  rhs: {
189
- type: 'const',
190
- value: 'test',
186
+ type: "const",
187
+ value: "test",
191
188
  },
192
- type: 'eq',
189
+ type: "eq",
193
190
  },
194
191
  ],
195
192
  },
@@ -198,10 +195,10 @@ describe('convertFilterSpecsToExpressionSpecs', () => {
198
195
  },
199
196
  ],
200
197
  otherwise: {
201
- type: 'const',
198
+ type: "const",
202
199
  value: false,
203
200
  },
204
- type: 'when_then_otherwise',
201
+ type: "when_then_otherwise",
205
202
  },
206
203
  },
207
204
  ];
@@ -1,7 +1,7 @@
1
- import { when } from '@milaboratories/ptabler-expression-js';
2
- import type { FilterSpec } from '../filters';
3
- import { convertFilterUiToExpressionImpl } from '../filters/converter';
4
- import type { ExpressionSpec, FilterSpecUi } from './types';
1
+ import { when } from "@milaboratories/ptabler-expression-js";
2
+ import type { FilterSpec } from "../filters";
3
+ import { convertFilterUiToExpressionImpl } from "../filters/converter";
4
+ import type { ExpressionSpec, FilterSpecUi } from "./types";
5
5
 
6
6
  function filterPredicate(item: FilterSpec): boolean {
7
7
  // No need to convert empty steps
@@ -9,15 +9,15 @@ function filterPredicate(item: FilterSpec): boolean {
9
9
  return false;
10
10
  }
11
11
 
12
- if (item.type === 'or') {
12
+ if (item.type === "or") {
13
13
  return item.filters.length > 0;
14
14
  }
15
15
 
16
- if (item.type === 'and') {
16
+ if (item.type === "and") {
17
17
  return item.filters.length > 0;
18
18
  }
19
19
 
20
- if (item.type === 'not') {
20
+ if (item.type === "not") {
21
21
  return filterPredicate(item.filter);
22
22
  }
23
23
 
@@ -26,10 +26,8 @@ function filterPredicate(item: FilterSpec): boolean {
26
26
  }
27
27
 
28
28
  function filterEmptyPeaces(item: FilterSpec): FilterSpec {
29
- if (item.type === 'or' || item.type === 'and') {
30
- const filtered = item.filters
31
- .map(filterEmptyPeaces)
32
- .filter(filterPredicate);
29
+ if (item.type === "or" || item.type === "and") {
30
+ const filtered = item.filters.map(filterEmptyPeaces).filter(filterPredicate);
33
31
  return {
34
32
  ...item,
35
33
  filters: filtered,
@@ -39,15 +37,21 @@ function filterEmptyPeaces(item: FilterSpec): FilterSpec {
39
37
  return item;
40
38
  }
41
39
 
42
- export function convertFilterSpecsToExpressionSpecs(annotationsUI: FilterSpecUi[]): ExpressionSpec[] {
40
+ export function convertFilterSpecsToExpressionSpecs(
41
+ annotationsUI: FilterSpecUi[],
42
+ ): ExpressionSpec[] {
43
43
  const validAnnotationsUI = annotationsUI.map((step) => ({
44
44
  label: step.label,
45
45
  filter: filterEmptyPeaces(step.filter),
46
46
  }));
47
- return validAnnotationsUI
48
- .map((step): ExpressionSpec => ({
49
- type: 'alias',
47
+ return validAnnotationsUI.map(
48
+ (step): ExpressionSpec => ({
49
+ type: "alias",
50
50
  name: step.label.trim(),
51
- value: when(convertFilterUiToExpressionImpl(step.filter)).then(true).otherwise(false).toJSON(),
52
- }));
51
+ value: when(convertFilterUiToExpressionImpl(step.filter))
52
+ .then(true)
53
+ .otherwise(false)
54
+ .toJSON(),
55
+ }),
56
+ );
53
57
  }
@@ -1,2 +1,2 @@
1
- export * from './converter';
2
- export * from './types';
1
+ export * from "./converter";
2
+ export * from "./types";
@@ -1,5 +1,5 @@
1
- import type { Expression } from '@milaboratories/ptabler-expression-js';
2
- import type { FilterSpec } from '../filters';
1
+ import type { Expression } from "@milaboratories/ptabler-expression-js";
2
+ import type { FilterSpec } from "../filters";
3
3
 
4
4
  export type AnnotationSpec<T extends ExpressionSpec = ExpressionSpec> = {
5
5
  title: string;
@@ -7,7 +7,7 @@ export type AnnotationSpec<T extends ExpressionSpec = ExpressionSpec> = {
7
7
  };
8
8
 
9
9
  export type ExpressionSpec<T extends Expression = Expression> = {
10
- type: 'alias';
10
+ type: "alias";
11
11
  name: string;
12
12
  value: T;
13
13
  }; // | OtherExpressionSpecTypesInFuture;
@@ -17,7 +17,7 @@ export type AnnotationSpecUi<T extends FilterSpecUi = FilterSpecUi> = {
17
17
  steps: T[];
18
18
  };
19
19
 
20
- export type FilterSpecUi<T extends FilterSpec = Extract<FilterSpec, { type: 'and' | 'or' }>> = {
20
+ export type FilterSpecUi<T extends FilterSpec = Extract<FilterSpec, { type: "and" | "or" }>> = {
21
21
  label: string;
22
22
  filter: T;
23
23
  };
@@ -1,5 +1,5 @@
1
- export * from './lambdas';
2
- export * from './normalization';
3
- export * from './util';
4
- export * from './v3';
5
- export * from './types';
1
+ export * from "./lambdas";
2
+ export * from "./normalization";
3
+ export * from "./util";
4
+ export * from "./v3";
5
+ export * from "./types";
@@ -1,6 +1,6 @@
1
- import type { ConfigResult, PlResourceEntry, TypedConfig } from '../config';
2
- import type { OutputWithStatus } from '@milaboratories/pl-model-common';
3
- import type { TypedConfigOrConfigLambda } from './types';
1
+ import type { ConfigResult, PlResourceEntry, TypedConfig } from "../config";
2
+ import type { OutputWithStatus } from "@milaboratories/pl-model-common";
3
+ import type { TypedConfigOrConfigLambda } from "./types";
4
4
 
5
5
  export type StdCtxArgsOnly<Args, Data = undefined> = {
6
6
  readonly $blockId: string;
@@ -69,16 +69,14 @@ export type InferOutputsFromConfigs<
69
69
  OutputsCfg extends Record<string, TypedConfigOrConfigLambda>,
70
70
  UiState,
71
71
  > = {
72
- [Key in keyof OutputsCfg]:
73
- & OutputWithStatus<InferOutputType<OutputsCfg[Key], Args, UiState>>
74
- & { __unwrap: (OutputsCfg[Key] extends { withStatus: true } ? false : true) };
72
+ [Key in keyof OutputsCfg]: OutputWithStatus<InferOutputType<OutputsCfg[Key], Args, UiState>> & {
73
+ __unwrap: OutputsCfg[Key] extends { withStatus: true } ? false : true;
74
+ };
75
75
  };
76
76
 
77
77
  /** Maps lambda-only outputs configuration to inferred output types (for V3 blocks) */
78
- export type InferOutputsFromLambdas<
79
- OutputsCfg extends Record<string, ConfigRenderLambda>,
80
- > = {
81
- [Key in keyof OutputsCfg]:
82
- & OutputWithStatus<ExtractFunctionHandleReturn<OutputsCfg[Key]>>
83
- & { __unwrap: (OutputsCfg[Key] extends { withStatus: true } ? false : true) };
78
+ export type InferOutputsFromLambdas<OutputsCfg extends Record<string, ConfigRenderLambda>> = {
79
+ [Key in keyof OutputsCfg]: OutputWithStatus<ExtractFunctionHandleReturn<OutputsCfg[Key]>> & {
80
+ __unwrap: OutputsCfg[Key] extends { withStatus: true } ? false : true;
81
+ };
84
82
  };
@@ -1,11 +1,11 @@
1
- import { extractConfigGeneric, type BlockConfigContainer } from '@milaboratories/pl-model-common';
2
- import type { TypedConfigOrConfigLambda, TypedConfigOrString } from './types';
3
- import { isConfigLambda } from './types';
4
- import type { BlockConfig } from './v3';
1
+ import { extractConfigGeneric, type BlockConfigContainer } from "@milaboratories/pl-model-common";
2
+ import type { TypedConfigOrConfigLambda, TypedConfigOrString } from "./types";
3
+ import { isConfigLambda } from "./types";
4
+ import type { BlockConfig } from "./v3";
5
5
 
6
6
  export function downgradeCfgOrLambda(data: TypedConfigOrConfigLambda): TypedConfigOrString;
7
7
  export function downgradeCfgOrLambda(
8
- data: TypedConfigOrConfigLambda | undefined
8
+ data: TypedConfigOrConfigLambda | undefined,
9
9
  ): TypedConfigOrString | undefined;
10
10
  export function downgradeCfgOrLambda(
11
11
  data: TypedConfigOrConfigLambda | undefined,
@@ -1,9 +1,7 @@
1
- import type { TypedConfig } from '../config';
2
- import type { ConfigRenderLambda } from './lambdas';
1
+ import type { TypedConfig } from "../config";
2
+ import type { ConfigRenderLambda } from "./lambdas";
3
3
 
4
- export function isConfigLambda(
5
- cfgOrFh: TypedConfigOrConfigLambda,
6
- ): cfgOrFh is ConfigRenderLambda {
4
+ export function isConfigLambda(cfgOrFh: TypedConfigOrConfigLambda): cfgOrFh is ConfigRenderLambda {
7
5
  return (cfgOrFh as any).__renderLambda === true;
8
6
  }
9
7
 
@@ -1,7 +1,7 @@
1
- import type { BlockSection } from '@milaboratories/pl-model-common';
1
+ import type { BlockSection } from "@milaboratories/pl-model-common";
2
2
 
3
- type OnlyString<S> = S extends string ? S : '';
3
+ type OnlyString<S> = S extends string ? S : "";
4
4
 
5
5
  export type DeriveHref<S> = S extends readonly BlockSection[]
6
- ? OnlyString<Extract<S[number], { type: 'link' }>['href']>
6
+ ? OnlyString<Extract<S[number], { type: "link" }>["href"]>
7
7
  : never;
package/src/bconfig/v3.ts CHANGED
@@ -1,6 +1,6 @@
1
- import type { BlockConfigV3Generic, BlockConfigV4Generic } from '@milaboratories/pl-model-common';
2
- import type { TypedConfigOrConfigLambda } from './types';
3
- import type { ConfigRenderLambda } from './lambdas';
1
+ import type { BlockConfigV3Generic, BlockConfigV4Generic } from "@milaboratories/pl-model-common";
2
+ import type { TypedConfigOrConfigLambda } from "./types";
3
+ import type { ConfigRenderLambda } from "./lambdas";
4
4
 
5
5
  export type BlockConfigV3<
6
6
  Args = unknown,
@@ -1,5 +1,9 @@
1
- import type { BlockOutputsBase, BlockState, NavigationState } from '@milaboratories/pl-model-common';
2
- import type { BlockStatePatch } from './block_state_patch';
1
+ import type {
2
+ BlockOutputsBase,
3
+ BlockState,
4
+ NavigationState,
5
+ } from "@milaboratories/pl-model-common";
6
+ import type { BlockStatePatch } from "./block_state_patch";
3
7
 
4
8
  /** Returned by state subscription methods to be able to cancel the subscription. */
5
9
  export type CancelSubscription = () => void;
@@ -35,7 +39,7 @@ export interface BlockApiV1<
35
39
  * @return function that cancels created subscription
36
40
  * */
37
41
  onStateUpdates(
38
- cb: (updates: BlockStatePatch<Args, Outputs, UiState, Href>[]) => Promise<void>
42
+ cb: (updates: BlockStatePatch<Args, Outputs, UiState, Href>[]) => Promise<void>,
39
43
  ): CancelSubscription;
40
44
 
41
45
  /**