@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.
- package/dist/annotations/converter.cjs +11 -11
- package/dist/annotations/converter.cjs.map +1 -1
- package/dist/annotations/converter.d.ts +1 -1
- package/dist/annotations/converter.d.ts.map +1 -1
- package/dist/annotations/converter.js +11 -11
- package/dist/annotations/converter.js.map +1 -1
- package/dist/annotations/index.d.ts +2 -2
- package/dist/annotations/types.d.ts +4 -4
- package/dist/bconfig/index.d.ts +5 -5
- package/dist/bconfig/lambdas.d.ts +7 -7
- package/dist/bconfig/lambdas.d.ts.map +1 -1
- package/dist/bconfig/normalization.cjs.map +1 -1
- package/dist/bconfig/normalization.d.ts +3 -3
- package/dist/bconfig/normalization.js.map +1 -1
- package/dist/bconfig/types.cjs.map +1 -1
- package/dist/bconfig/types.d.ts +2 -2
- package/dist/bconfig/types.d.ts.map +1 -1
- package/dist/bconfig/types.js.map +1 -1
- package/dist/bconfig/util.d.ts +4 -4
- package/dist/bconfig/v3.d.ts +3 -3
- package/dist/block_api_v1.d.ts +2 -2
- package/dist/block_api_v1.d.ts.map +1 -1
- package/dist/block_api_v2.d.ts +2 -2
- package/dist/block_api_v2.d.ts.map +1 -1
- package/dist/block_api_v3.d.ts +3 -3
- package/dist/block_migrations.cjs +10 -10
- package/dist/block_migrations.cjs.map +1 -1
- package/dist/block_migrations.d.ts.map +1 -1
- package/dist/block_migrations.js +10 -10
- package/dist/block_migrations.js.map +1 -1
- package/dist/block_model.cjs +11 -11
- package/dist/block_model.cjs.map +1 -1
- package/dist/block_model.d.ts +8 -8
- package/dist/block_model.d.ts.map +1 -1
- package/dist/block_model.js +11 -11
- package/dist/block_model.js.map +1 -1
- package/dist/block_state_patch.d.ts +2 -2
- package/dist/block_state_util.cjs +1 -1
- package/dist/block_state_util.cjs.map +1 -1
- package/dist/block_state_util.d.ts +3 -3
- package/dist/block_state_util.js +1 -1
- package/dist/block_state_util.js.map +1 -1
- package/dist/block_storage.cjs +10 -10
- package/dist/block_storage.cjs.map +1 -1
- package/dist/block_storage.d.ts +2 -2
- package/dist/block_storage.d.ts.map +1 -1
- package/dist/block_storage.js +10 -10
- package/dist/block_storage.js.map +1 -1
- package/dist/block_storage_vm.cjs +22 -22
- package/dist/block_storage_vm.cjs.map +1 -1
- package/dist/block_storage_vm.d.ts +1 -1
- package/dist/block_storage_vm.d.ts.map +1 -1
- package/dist/block_storage_vm.js +22 -22
- package/dist/block_storage_vm.js.map +1 -1
- package/dist/builder.cjs +32 -23
- package/dist/builder.cjs.map +1 -1
- package/dist/builder.d.ts +7 -7
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +32 -23
- package/dist/builder.js.map +1 -1
- package/dist/components/PFrameForGraphs.cjs +7 -6
- package/dist/components/PFrameForGraphs.cjs.map +1 -1
- package/dist/components/PFrameForGraphs.d.ts +4 -4
- package/dist/components/PFrameForGraphs.d.ts.map +1 -1
- package/dist/components/PFrameForGraphs.js +7 -6
- package/dist/components/PFrameForGraphs.js.map +1 -1
- package/dist/components/PlAnnotations/filter.d.ts +14 -14
- package/dist/components/PlAnnotations/filter.d.ts.map +1 -1
- package/dist/components/PlAnnotations/filters_ui.cjs +46 -46
- package/dist/components/PlAnnotations/filters_ui.cjs.map +1 -1
- package/dist/components/PlAnnotations/filters_ui.d.ts +10 -34
- package/dist/components/PlAnnotations/filters_ui.d.ts.map +1 -1
- package/dist/components/PlAnnotations/filters_ui.js +46 -46
- package/dist/components/PlAnnotations/filters_ui.js.map +1 -1
- package/dist/components/PlAnnotations/index.d.ts +2 -2
- package/dist/components/PlAnnotations/types.d.ts +2 -2
- package/dist/components/PlDataTable.cjs +19 -20
- package/dist/components/PlDataTable.cjs.map +1 -1
- package/dist/components/PlDataTable.d.ts +27 -27
- package/dist/components/PlDataTable.d.ts.map +1 -1
- package/dist/components/PlDataTable.js +19 -20
- package/dist/components/PlDataTable.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment.cjs +2 -2
- package/dist/components/PlMultiSequenceAlignment.cjs.map +1 -1
- package/dist/components/PlMultiSequenceAlignment.d.ts +6 -6
- package/dist/components/PlMultiSequenceAlignment.d.ts.map +1 -1
- package/dist/components/PlMultiSequenceAlignment.js +2 -2
- package/dist/components/PlMultiSequenceAlignment.js.map +1 -1
- package/dist/components/PlSelectionModel.cjs.map +1 -1
- package/dist/components/PlSelectionModel.d.ts +1 -1
- package/dist/components/PlSelectionModel.js.map +1 -1
- package/dist/components/index.d.ts +5 -5
- package/dist/config/actions.cjs +39 -39
- package/dist/config/actions.cjs.map +1 -1
- package/dist/config/actions.d.ts +9 -9
- package/dist/config/actions.d.ts.map +1 -1
- package/dist/config/actions.js +39 -39
- package/dist/config/actions.js.map +1 -1
- package/dist/config/actions_kinds.d.ts +30 -30
- package/dist/config/actions_kinds.d.ts.map +1 -1
- package/dist/config/index.d.ts +6 -6
- package/dist/config/model.d.ts +28 -28
- package/dist/config/model_meta.d.ts +1 -1
- package/dist/config/type_engine.d.ts +3 -3
- package/dist/config/type_util.d.ts +2 -2
- package/dist/env_value.cjs +1 -1
- package/dist/env_value.cjs.map +1 -1
- package/dist/env_value.js +1 -1
- package/dist/env_value.js.map +1 -1
- package/dist/filters/converter.cjs +36 -32
- package/dist/filters/converter.cjs.map +1 -1
- package/dist/filters/converter.d.ts +2 -2
- package/dist/filters/converter.d.ts.map +1 -1
- package/dist/filters/converter.js +36 -32
- package/dist/filters/converter.js.map +1 -1
- package/dist/filters/index.d.ts +2 -2
- package/dist/filters/types.d.ts +33 -33
- package/dist/filters/types.d.ts.map +1 -1
- package/dist/index.d.ts +24 -24
- package/dist/internal.cjs +7 -7
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.ts +4 -4
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +7 -7
- package/dist/internal.js.map +1 -1
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.js +1 -1
- package/dist/pframe.cjs +1 -1
- package/dist/pframe.cjs.map +1 -1
- package/dist/pframe.d.ts +1 -1
- package/dist/pframe.js +1 -1
- package/dist/pframe.js.map +1 -1
- package/dist/pframe_utils/columns.cjs +23 -15
- package/dist/pframe_utils/columns.cjs.map +1 -1
- package/dist/pframe_utils/columns.d.ts +3 -3
- package/dist/pframe_utils/columns.d.ts.map +1 -1
- package/dist/pframe_utils/columns.js +23 -15
- package/dist/pframe_utils/columns.js.map +1 -1
- package/dist/pframe_utils/index.cjs +25 -25
- package/dist/pframe_utils/index.cjs.map +1 -1
- package/dist/pframe_utils/index.d.ts +3 -3
- package/dist/pframe_utils/index.d.ts.map +1 -1
- package/dist/pframe_utils/index.js +25 -25
- package/dist/pframe_utils/index.js.map +1 -1
- package/dist/platforma.d.ts +7 -7
- package/dist/platforma.d.ts.map +1 -1
- package/dist/raw_globals.cjs +4 -1
- package/dist/raw_globals.cjs.map +1 -1
- package/dist/raw_globals.d.ts +2 -2
- package/dist/raw_globals.d.ts.map +1 -1
- package/dist/raw_globals.js +4 -1
- package/dist/raw_globals.js.map +1 -1
- package/dist/ref_util.cjs +4 -4
- package/dist/ref_util.cjs.map +1 -1
- package/dist/ref_util.d.ts +1 -1
- package/dist/ref_util.js +4 -4
- package/dist/ref_util.js.map +1 -1
- package/dist/render/accessor.cjs +24 -24
- package/dist/render/accessor.cjs.map +1 -1
- package/dist/render/accessor.d.ts +10 -10
- package/dist/render/accessor.d.ts.map +1 -1
- package/dist/render/accessor.js +24 -24
- package/dist/render/accessor.js.map +1 -1
- package/dist/render/api.cjs +23 -23
- package/dist/render/api.cjs.map +1 -1
- package/dist/render/api.d.ts +11 -11
- package/dist/render/api.d.ts.map +1 -1
- package/dist/render/api.js +23 -23
- package/dist/render/api.js.map +1 -1
- package/dist/render/future.cjs.map +1 -1
- package/dist/render/future.d.ts +1 -1
- package/dist/render/future.js.map +1 -1
- package/dist/render/index.d.ts +6 -6
- package/dist/render/internal.cjs +4 -4
- package/dist/render/internal.cjs.map +1 -1
- package/dist/render/internal.d.ts +7 -7
- package/dist/render/internal.d.ts.map +1 -1
- package/dist/render/internal.js +4 -4
- package/dist/render/internal.js.map +1 -1
- package/dist/render/traversal_ops.d.ts +1 -1
- package/dist/render/util/axis_filtering.cjs +48 -44
- package/dist/render/util/axis_filtering.cjs.map +1 -1
- package/dist/render/util/axis_filtering.d.ts +2 -2
- package/dist/render/util/axis_filtering.js +48 -44
- package/dist/render/util/axis_filtering.js.map +1 -1
- package/dist/render/util/column_collection.cjs +42 -35
- package/dist/render/util/column_collection.cjs.map +1 -1
- package/dist/render/util/column_collection.d.ts +4 -4
- package/dist/render/util/column_collection.d.ts.map +1 -1
- package/dist/render/util/column_collection.js +42 -35
- package/dist/render/util/column_collection.js.map +1 -1
- package/dist/render/util/index.d.ts +4 -4
- package/dist/render/util/label.cjs +15 -21
- package/dist/render/util/label.cjs.map +1 -1
- package/dist/render/util/label.d.ts +2 -2
- package/dist/render/util/label.d.ts.map +1 -1
- package/dist/render/util/label.js +15 -21
- package/dist/render/util/label.js.map +1 -1
- package/dist/render/util/pcolumn_data.cjs +56 -54
- package/dist/render/util/pcolumn_data.cjs.map +1 -1
- package/dist/render/util/pcolumn_data.d.ts +5 -5
- package/dist/render/util/pcolumn_data.d.ts.map +1 -1
- package/dist/render/util/pcolumn_data.js +56 -54
- package/dist/render/util/pcolumn_data.js.map +1 -1
- package/dist/render/util/pframe_upgraders.cjs +6 -6
- package/dist/render/util/pframe_upgraders.cjs.map +1 -1
- package/dist/render/util/pframe_upgraders.d.ts +1 -1
- package/dist/render/util/pframe_upgraders.d.ts.map +1 -1
- package/dist/render/util/pframe_upgraders.js +6 -6
- package/dist/render/util/pframe_upgraders.js.map +1 -1
- package/dist/render/util/split_selectors.d.ts +1 -1
- package/dist/render/util/split_selectors.d.ts.map +1 -1
- package/dist/sdk_info.cjs.map +1 -1
- package/dist/sdk_info.js.map +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +23 -21
- package/src/annotations/converter.test.ts +98 -101
- package/src/annotations/converter.ts +21 -17
- package/src/annotations/index.ts +2 -2
- package/src/annotations/types.ts +4 -4
- package/src/bconfig/index.ts +5 -5
- package/src/bconfig/lambdas.ts +10 -12
- package/src/bconfig/normalization.ts +5 -5
- package/src/bconfig/types.ts +3 -5
- package/src/bconfig/util.ts +3 -3
- package/src/bconfig/v3.ts +3 -3
- package/src/block_api_v1.ts +7 -3
- package/src/block_api_v2.ts +7 -3
- package/src/block_api_v3.ts +3 -3
- package/src/block_migrations.test.ts +66 -67
- package/src/block_migrations.ts +16 -16
- package/src/block_model.ts +76 -140
- package/src/block_state_patch.ts +2 -2
- package/src/block_state_util.ts +4 -4
- package/src/block_storage.test.ts +106 -99
- package/src/block_storage.ts +22 -25
- package/src/block_storage_vm.ts +41 -35
- package/src/builder.ts +107 -95
- package/src/components/PFrameForGraphs.test.ts +261 -255
- package/src/components/PFrameForGraphs.ts +35 -22
- package/src/components/PlAnnotations/filter.ts +21 -15
- package/src/components/PlAnnotations/filters_ui.test.ts +230 -73
- package/src/components/PlAnnotations/filters_ui.ts +138 -105
- package/src/components/PlAnnotations/index.ts +2 -2
- package/src/components/PlAnnotations/types.ts +2 -2
- package/src/components/PlDataTable.ts +177 -164
- package/src/components/PlMultiSequenceAlignment.ts +11 -18
- package/src/components/PlSelectionModel.ts +1 -1
- package/src/components/index.ts +5 -5
- package/src/config/actions.ts +64 -59
- package/src/config/actions_kinds.ts +38 -34
- package/src/config/index.ts +6 -6
- package/src/config/model.ts +28 -28
- package/src/config/model_meta.ts +1 -1
- package/src/config/type_engine.ts +3 -3
- package/src/config/type_util.ts +2 -2
- package/src/env_value.ts +2 -2
- package/src/filters/converter.test.ts +185 -144
- package/src/filters/converter.ts +47 -35
- package/src/filters/index.ts +2 -2
- package/src/filters/types.ts +44 -39
- package/src/global.d.ts +1 -1
- package/src/index.ts +24 -24
- package/src/internal.ts +27 -17
- package/src/pframe.ts +3 -3
- package/src/pframe_utils/columns.ts +81 -31
- package/src/pframe_utils/index.ts +65 -43
- package/src/platforma.ts +44 -21
- package/src/raw_globals.ts +13 -7
- package/src/ref_util.ts +6 -6
- package/src/render/accessor.ts +43 -44
- package/src/render/api.ts +102 -78
- package/src/render/future.ts +2 -2
- package/src/render/index.ts +6 -6
- package/src/render/internal.ts +11 -12
- package/src/render/traversal_ops.ts +1 -1
- package/src/render/util/axis_filtering.ts +67 -52
- package/src/render/util/column_collection.ts +171 -91
- package/src/render/util/index.ts +4 -4
- package/src/render/util/label.test.ts +139 -139
- package/src/render/util/label.ts +42 -33
- package/src/render/util/pcolumn_data.ts +111 -75
- package/src/render/util/pframe_upgraders.ts +24 -13
- package/src/render/util/split_selectors.ts +6 -1
- package/src/sdk_info.ts +1 -1
- package/src/typing.test.ts +56 -56
- package/src/version.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { flatten, uniq } from
|
|
1
|
+
import { flatten, uniq } from "es-toolkit";
|
|
2
2
|
|
|
3
3
|
import type {
|
|
4
4
|
AxisSpec,
|
|
@@ -16,10 +16,17 @@ import type {
|
|
|
16
16
|
PObjectId,
|
|
17
17
|
PTableRecordSingleValueFilterV2,
|
|
18
18
|
ValueType,
|
|
19
|
-
} from
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
} from "@milaboratories/pl-model-common";
|
|
20
|
+
import {
|
|
21
|
+
pTableValue,
|
|
22
|
+
Annotation,
|
|
23
|
+
canonicalizeAxisId,
|
|
24
|
+
getAxisId,
|
|
25
|
+
readAnnotation,
|
|
26
|
+
PColumnName,
|
|
27
|
+
} from "@milaboratories/pl-model-common";
|
|
28
|
+
|
|
29
|
+
export * from "./columns";
|
|
23
30
|
|
|
24
31
|
// Types
|
|
25
32
|
type PValue = string | number | null;
|
|
@@ -62,7 +69,7 @@ type GetColumnsFullParams = {
|
|
|
62
69
|
strictlyCompatible: boolean;
|
|
63
70
|
types?: ValueType[];
|
|
64
71
|
names?: string[];
|
|
65
|
-
annotations?: FindColumnsRequest[
|
|
72
|
+
annotations?: FindColumnsRequest["columnFilter"]["annotationValue"];
|
|
66
73
|
annotationsNotEmpty?: string[];
|
|
67
74
|
};
|
|
68
75
|
|
|
@@ -71,10 +78,14 @@ const UNIQUE_VALUES_LIMIT = 1000000;
|
|
|
71
78
|
|
|
72
79
|
// Helper functions
|
|
73
80
|
const sortValuesPredicate = (a: { label: string }, b: { label: string }) =>
|
|
74
|
-
a.label.localeCompare(b.label,
|
|
75
|
-
|
|
76
|
-
function convertColumnData(
|
|
77
|
-
|
|
81
|
+
a.label.localeCompare(b.label, "en", { numeric: true });
|
|
82
|
+
|
|
83
|
+
function convertColumnData(
|
|
84
|
+
type: ValueType,
|
|
85
|
+
response: PTableVector,
|
|
86
|
+
absentValue: number | null = null,
|
|
87
|
+
): PValue[] {
|
|
88
|
+
if (type === "String") {
|
|
78
89
|
return response.data as PValue[];
|
|
79
90
|
}
|
|
80
91
|
const res: PValue[] = new Array(response.data.length);
|
|
@@ -89,13 +100,13 @@ function createSearchFilter(
|
|
|
89
100
|
substring: string,
|
|
90
101
|
): PTableRecordSingleValueFilterV2 {
|
|
91
102
|
return {
|
|
92
|
-
type:
|
|
103
|
+
type: "bySingleColumnV2",
|
|
93
104
|
column: {
|
|
94
|
-
type:
|
|
105
|
+
type: "column",
|
|
95
106
|
id: columnId,
|
|
96
107
|
},
|
|
97
108
|
predicate: {
|
|
98
|
-
operator:
|
|
109
|
+
operator: "StringIContains",
|
|
99
110
|
substring,
|
|
100
111
|
},
|
|
101
112
|
};
|
|
@@ -106,16 +117,16 @@ function createAxisSearchFilter(
|
|
|
106
117
|
substring: string,
|
|
107
118
|
): PTableRecordSingleValueFilterV2 {
|
|
108
119
|
return {
|
|
109
|
-
type:
|
|
120
|
+
type: "bySingleColumnV2",
|
|
110
121
|
column: {
|
|
111
|
-
type:
|
|
122
|
+
type: "axis",
|
|
112
123
|
id: {
|
|
113
124
|
type: axisSpec.type,
|
|
114
125
|
name: axisSpec.name,
|
|
115
126
|
},
|
|
116
127
|
},
|
|
117
128
|
predicate: {
|
|
118
|
-
operator:
|
|
129
|
+
operator: "StringIContains",
|
|
119
130
|
substring,
|
|
120
131
|
},
|
|
121
132
|
};
|
|
@@ -126,22 +137,25 @@ function mapValuesToSuggestions(values: string[]): { value: string; label: strin
|
|
|
126
137
|
}
|
|
127
138
|
|
|
128
139
|
function getPFrameDriver() {
|
|
129
|
-
if (typeof platforma ===
|
|
130
|
-
throw new Error(
|
|
140
|
+
if (typeof platforma === "undefined") {
|
|
141
|
+
throw new Error("Platforma instance is not available");
|
|
131
142
|
}
|
|
132
|
-
if (typeof platforma.pFrameDriver ===
|
|
133
|
-
throw new Error(
|
|
143
|
+
if (typeof platforma.pFrameDriver === "undefined") {
|
|
144
|
+
throw new Error("PFrame driver is not available in the current Platforma instance");
|
|
134
145
|
}
|
|
135
146
|
return platforma.pFrameDriver;
|
|
136
147
|
}
|
|
137
148
|
|
|
138
149
|
// Core functions
|
|
139
|
-
export async function getColumnSpecById(
|
|
150
|
+
export async function getColumnSpecById(
|
|
151
|
+
handle: PFrameHandle,
|
|
152
|
+
id: PObjectId,
|
|
153
|
+
): Promise<PColumnSpec | null> {
|
|
140
154
|
try {
|
|
141
155
|
const response = await getPFrameDriver().getColumnSpec(handle, id);
|
|
142
156
|
return response ?? null;
|
|
143
157
|
} catch (err) {
|
|
144
|
-
console.error(
|
|
158
|
+
console.error("PFrame: get single column error", err);
|
|
145
159
|
return null;
|
|
146
160
|
}
|
|
147
161
|
}
|
|
@@ -154,15 +168,15 @@ export async function getSingleColumnData(
|
|
|
154
168
|
try {
|
|
155
169
|
const response: FullPTableColumnData[] = await getPFrameDriver().calculateTableData(handle, {
|
|
156
170
|
src: {
|
|
157
|
-
type:
|
|
171
|
+
type: "column",
|
|
158
172
|
column: id,
|
|
159
173
|
},
|
|
160
174
|
filters,
|
|
161
175
|
sorting: [],
|
|
162
176
|
} as CalculateTableDataRequest<PObjectId>);
|
|
163
177
|
|
|
164
|
-
const axes = response.filter((item) => item.spec.type ===
|
|
165
|
-
const columns = response.filter((item) => item.spec.type ===
|
|
178
|
+
const axes = response.filter((item) => item.spec.type === "axis");
|
|
179
|
+
const columns = response.filter((item) => item.spec.type === "column");
|
|
166
180
|
|
|
167
181
|
return {
|
|
168
182
|
axesData: axes.reduce((res: Record<string, PValue[]>, item) => {
|
|
@@ -173,7 +187,7 @@ export async function getSingleColumnData(
|
|
|
173
187
|
data: columns.length ? convertColumnData(columns[0].data.type, columns[0].data) : [],
|
|
174
188
|
};
|
|
175
189
|
} catch (err) {
|
|
176
|
-
console.error(
|
|
190
|
+
console.error("PFrame: calculateTableData error");
|
|
177
191
|
throw err;
|
|
178
192
|
}
|
|
179
193
|
}
|
|
@@ -200,7 +214,7 @@ export async function getColumnUniqueValues(
|
|
|
200
214
|
overflow: response.overflow,
|
|
201
215
|
};
|
|
202
216
|
} catch (err) {
|
|
203
|
-
console.error(
|
|
217
|
+
console.error("PFrame: getUniqueValues for column error");
|
|
204
218
|
throw err;
|
|
205
219
|
}
|
|
206
220
|
}
|
|
@@ -214,14 +228,14 @@ export async function getAxisUniqueValues(
|
|
|
214
228
|
|
|
215
229
|
const parentsSpecs = (await Promise.all(parentColumnIds.map((p) => getColumnSpecById(handle, p))))
|
|
216
230
|
.flatMap((spec, i): [PObjectId, PColumnSpec][] =>
|
|
217
|
-
spec != null && spec.kind ===
|
|
231
|
+
spec != null && spec.kind === "PColumn" ? [[parentColumnIds[i], spec]] : [],
|
|
218
232
|
)
|
|
219
233
|
.filter(([_, spec]) =>
|
|
220
234
|
spec.axesSpec.some((axisSpec) => canonicalizeAxisId(getAxisId(axisSpec)) === strAxisId),
|
|
221
235
|
);
|
|
222
236
|
|
|
223
237
|
if (parentsSpecs.length === 0) {
|
|
224
|
-
console.warn(
|
|
238
|
+
console.warn("Axis unique values requested without parent columns");
|
|
225
239
|
return { values: [], overflow: false };
|
|
226
240
|
}
|
|
227
241
|
|
|
@@ -240,14 +254,12 @@ export async function getAxisUniqueValues(
|
|
|
240
254
|
const overflow = responses.some((r) => r.overflow);
|
|
241
255
|
return {
|
|
242
256
|
values: uniq(
|
|
243
|
-
flatten(responses.map((r) =>
|
|
244
|
-
Array.from(r.values.data as ArrayLike<unknown>).map(String),
|
|
245
|
-
)),
|
|
257
|
+
flatten(responses.map((r) => Array.from(r.values.data as ArrayLike<unknown>).map(String))),
|
|
246
258
|
),
|
|
247
259
|
overflow,
|
|
248
260
|
};
|
|
249
261
|
} catch (err) {
|
|
250
|
-
console.error(
|
|
262
|
+
console.error("PFrame: getUniqueValues for axis error", err);
|
|
251
263
|
return { values: [], overflow: false };
|
|
252
264
|
}
|
|
253
265
|
}
|
|
@@ -259,7 +271,7 @@ export async function getRequestColumnsFromSelectedSources(
|
|
|
259
271
|
const result: AxisId[] = [];
|
|
260
272
|
for (const item of sources) {
|
|
261
273
|
const spec = await getColumnSpecById(handle, item);
|
|
262
|
-
if (spec?.kind ===
|
|
274
|
+
if (spec?.kind === "PColumn") {
|
|
263
275
|
result.push(...spec.axesSpec.map((spec) => getAxisId(spec)));
|
|
264
276
|
}
|
|
265
277
|
}
|
|
@@ -270,7 +282,8 @@ export async function getColumnsFull(
|
|
|
270
282
|
handle: PFrameHandle,
|
|
271
283
|
params: GetColumnsFullParams,
|
|
272
284
|
): Promise<PColumnIdAndSpec[]> {
|
|
273
|
-
const { selectedSources, strictlyCompatible, types, names, annotations, annotationsNotEmpty } =
|
|
285
|
+
const { selectedSources, strictlyCompatible, types, names, annotations, annotationsNotEmpty } =
|
|
286
|
+
params;
|
|
274
287
|
|
|
275
288
|
try {
|
|
276
289
|
const request: FindColumnsRequest = {
|
|
@@ -278,10 +291,13 @@ export async function getColumnsFull(
|
|
|
278
291
|
type: types,
|
|
279
292
|
name: names,
|
|
280
293
|
annotationValue: annotations,
|
|
281
|
-
annotationPattern: annotationsNotEmpty?.reduce(
|
|
282
|
-
res
|
|
283
|
-
|
|
284
|
-
|
|
294
|
+
annotationPattern: annotationsNotEmpty?.reduce(
|
|
295
|
+
(res, v) => {
|
|
296
|
+
res[v] = ".+";
|
|
297
|
+
return res;
|
|
298
|
+
},
|
|
299
|
+
{} as Record<string, string>,
|
|
300
|
+
),
|
|
285
301
|
},
|
|
286
302
|
compatibleWith: await getRequestColumnsFromSelectedSources(handle, selectedSources),
|
|
287
303
|
strictlyCompatible,
|
|
@@ -290,7 +306,7 @@ export async function getColumnsFull(
|
|
|
290
306
|
const response: FindColumnsResponse = await getPFrameDriver().findColumns(handle, request);
|
|
291
307
|
return response.hits;
|
|
292
308
|
} catch (err) {
|
|
293
|
-
console.error(
|
|
309
|
+
console.error("PFrame: findColumns error");
|
|
294
310
|
throw err;
|
|
295
311
|
}
|
|
296
312
|
}
|
|
@@ -319,7 +335,9 @@ function getDiscreteValuesFromAnnotation(columnSpec: PColumnSpec): undefined | S
|
|
|
319
335
|
}
|
|
320
336
|
|
|
321
337
|
try {
|
|
322
|
-
const discreteValues: string[] = (JSON.parse(discreteValuesStr) as (string | number)[]).map(
|
|
338
|
+
const discreteValues: string[] = (JSON.parse(discreteValuesStr) as (string | number)[]).map(
|
|
339
|
+
(v) => String(v),
|
|
340
|
+
);
|
|
323
341
|
const values = discreteValues.map((v) => ({ value: v, label: v })).sort(sortValuesPredicate);
|
|
324
342
|
return { values, overflow: false };
|
|
325
343
|
} catch {
|
|
@@ -352,7 +370,11 @@ async function getAxisValuesWithLabels(
|
|
|
352
370
|
filters = [createAxisSearchFilter(axisSpec, searchQueryValue)];
|
|
353
371
|
}
|
|
354
372
|
|
|
355
|
-
const { data: dataValues, axesData } = await getSingleColumnData(
|
|
373
|
+
const { data: dataValues, axesData } = await getSingleColumnData(
|
|
374
|
+
handle,
|
|
375
|
+
labelsColumnId,
|
|
376
|
+
filters,
|
|
377
|
+
);
|
|
356
378
|
const axisKeys = axesData[strAxisId];
|
|
357
379
|
const values: { value: string; label: string }[] = [];
|
|
358
380
|
|
|
@@ -408,7 +430,7 @@ export async function getUniqueSourceValuesWithLabels(
|
|
|
408
430
|
const { columnId, axisIdx, limit, searchQuery, searchQueryValue } = params;
|
|
409
431
|
|
|
410
432
|
const selectedSourceSpec = await getColumnSpecById(handle, columnId);
|
|
411
|
-
if (selectedSourceSpec == null || selectedSourceSpec.kind !==
|
|
433
|
+
if (selectedSourceSpec == null || selectedSourceSpec.kind !== "PColumn") {
|
|
412
434
|
return { values: [], overflow: false };
|
|
413
435
|
}
|
|
414
436
|
|
package/src/platforma.ts
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
import type { BlockApiV1 } from
|
|
2
|
-
import type { BlockApiV2 } from
|
|
3
|
-
import type { BlockApiV3 } from
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import type { BlockApiV1 } from "./block_api_v1";
|
|
2
|
+
import type { BlockApiV2 } from "./block_api_v2";
|
|
3
|
+
import type { BlockApiV3 } from "./block_api_v3";
|
|
4
|
+
import type {
|
|
5
|
+
BlockOutputsBase,
|
|
6
|
+
BlockStateV3,
|
|
7
|
+
DriverKit,
|
|
8
|
+
OutputWithStatus,
|
|
9
|
+
} from "@milaboratories/pl-model-common";
|
|
10
|
+
import type { SdkInfo } from "./sdk_info";
|
|
11
|
+
import type { BlockStatePatch } from "./block_state_patch";
|
|
7
12
|
|
|
8
13
|
/** Defines all methods to interact with the platform environment from within a block UI. @deprecated */
|
|
9
14
|
export interface PlatformaV1<
|
|
10
15
|
Args = unknown,
|
|
11
|
-
Outputs extends Record<string, OutputWithStatus<unknown>> = Record<
|
|
16
|
+
Outputs extends Record<string, OutputWithStatus<unknown>> = Record<
|
|
17
|
+
string,
|
|
18
|
+
OutputWithStatus<unknown>
|
|
19
|
+
>,
|
|
12
20
|
UiState = unknown,
|
|
13
21
|
Href extends `/${string}` = `/${string}`,
|
|
14
|
-
>
|
|
15
|
-
DriverKit {
|
|
22
|
+
>
|
|
23
|
+
extends BlockApiV1<Args, Outputs, UiState, Href>, DriverKit {
|
|
16
24
|
/** Information about SDK version current platforma environment was compiled with. */
|
|
17
25
|
readonly sdkInfo: SdkInfo;
|
|
18
26
|
readonly apiVersion?: 1;
|
|
@@ -21,11 +29,14 @@ export interface PlatformaV1<
|
|
|
21
29
|
/** V2 version based on effective json patches pulling API */
|
|
22
30
|
export interface PlatformaV2<
|
|
23
31
|
Args = unknown,
|
|
24
|
-
Outputs extends Record<string, OutputWithStatus<unknown>> = Record<
|
|
32
|
+
Outputs extends Record<string, OutputWithStatus<unknown>> = Record<
|
|
33
|
+
string,
|
|
34
|
+
OutputWithStatus<unknown>
|
|
35
|
+
>,
|
|
25
36
|
UiState = unknown,
|
|
26
37
|
Href extends `/${string}` = `/${string}`,
|
|
27
|
-
>
|
|
28
|
-
DriverKit {
|
|
38
|
+
>
|
|
39
|
+
extends BlockApiV2<Args, Outputs, UiState, Href>, DriverKit {
|
|
29
40
|
/** Information about SDK version current platforma environment was compiled with. */
|
|
30
41
|
readonly sdkInfo: SdkInfo;
|
|
31
42
|
readonly apiVersion: 2;
|
|
@@ -33,11 +44,14 @@ export interface PlatformaV2<
|
|
|
33
44
|
|
|
34
45
|
export interface PlatformaV3<
|
|
35
46
|
Args = unknown,
|
|
36
|
-
Outputs extends Record<string, OutputWithStatus<unknown>> = Record<
|
|
47
|
+
Outputs extends Record<string, OutputWithStatus<unknown>> = Record<
|
|
48
|
+
string,
|
|
49
|
+
OutputWithStatus<unknown>
|
|
50
|
+
>,
|
|
37
51
|
Data = unknown,
|
|
38
52
|
Href extends `/${string}` = `/${string}`,
|
|
39
|
-
>
|
|
40
|
-
DriverKit {
|
|
53
|
+
>
|
|
54
|
+
extends BlockApiV3<Args, Outputs, Data, Href>, DriverKit {
|
|
41
55
|
/** Information about SDK version current platforma environment was compiled with. */
|
|
42
56
|
readonly sdkInfo: SdkInfo;
|
|
43
57
|
readonly apiVersion: 3;
|
|
@@ -45,22 +59,31 @@ export interface PlatformaV3<
|
|
|
45
59
|
|
|
46
60
|
export type Platforma<
|
|
47
61
|
Args = unknown,
|
|
48
|
-
Outputs extends Record<string, OutputWithStatus<unknown>> = Record<
|
|
62
|
+
Outputs extends Record<string, OutputWithStatus<unknown>> = Record<
|
|
63
|
+
string,
|
|
64
|
+
OutputWithStatus<unknown>
|
|
65
|
+
>,
|
|
49
66
|
UiState = unknown,
|
|
50
67
|
Href extends `/${string}` = `/${string}`,
|
|
51
|
-
> =
|
|
68
|
+
> =
|
|
69
|
+
| PlatformaV1<Args, Outputs, UiState, Href>
|
|
70
|
+
| PlatformaV2<Args, Outputs, UiState, Href>
|
|
71
|
+
| PlatformaV3<Args, Outputs, UiState, Href>;
|
|
52
72
|
|
|
53
73
|
export type PlatformaExtended<Pl extends Platforma = Platforma> = Pl & {
|
|
54
74
|
blockModelInfo: BlockModelInfo;
|
|
55
75
|
};
|
|
56
76
|
|
|
57
77
|
export type BlockModelInfo = {
|
|
58
|
-
outputs: Record<
|
|
59
|
-
|
|
60
|
-
|
|
78
|
+
outputs: Record<
|
|
79
|
+
string,
|
|
80
|
+
{
|
|
81
|
+
withStatus: boolean;
|
|
82
|
+
}
|
|
83
|
+
>;
|
|
61
84
|
};
|
|
62
85
|
|
|
63
|
-
export type PlatformaApiVersion = Platforma[
|
|
86
|
+
export type PlatformaApiVersion = Platforma["apiVersion"];
|
|
64
87
|
|
|
65
88
|
export type InferArgsType<Pl extends Platforma> = Pl extends Platforma<infer Args> ? Args : never;
|
|
66
89
|
|
package/src/raw_globals.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { OutputWithStatus } from
|
|
2
|
-
import {} from
|
|
3
|
-
import { getPlatformaInstance } from
|
|
4
|
-
import type { Platforma, PlatformaApiVersion } from
|
|
5
|
-
import { PlatformaSDKVersion } from
|
|
1
|
+
import type { OutputWithStatus } from "@milaboratories/pl-model-common";
|
|
2
|
+
import {} from "./global";
|
|
3
|
+
import { getPlatformaInstance } from "./internal";
|
|
4
|
+
import type { Platforma, PlatformaApiVersion } from "./platforma";
|
|
5
|
+
import { PlatformaSDKVersion } from "./version";
|
|
6
6
|
|
|
7
7
|
export function getPlatformaApiVersion(): PlatformaApiVersion {
|
|
8
8
|
return platformaApiVersion ?? 1; // undefined means 1 for backward compatibility
|
|
@@ -10,11 +10,17 @@ export function getPlatformaApiVersion(): PlatformaApiVersion {
|
|
|
10
10
|
|
|
11
11
|
export function getRawPlatformaInstance<
|
|
12
12
|
Args = unknown,
|
|
13
|
-
Outputs extends Record<string, OutputWithStatus<unknown>> = Record<
|
|
13
|
+
Outputs extends Record<string, OutputWithStatus<unknown>> = Record<
|
|
14
|
+
string,
|
|
15
|
+
OutputWithStatus<unknown>
|
|
16
|
+
>,
|
|
14
17
|
UiState = unknown,
|
|
15
18
|
Href extends `/${string}` = `/${string}`,
|
|
16
19
|
>(): Platforma<Args, Outputs, UiState, Href> {
|
|
17
|
-
return getPlatformaInstance<Args, Outputs, UiState, Href>({
|
|
20
|
+
return getPlatformaInstance<Args, Outputs, UiState, Href>({
|
|
21
|
+
sdkVersion: PlatformaSDKVersion,
|
|
22
|
+
apiVersion: platformaApiVersion,
|
|
23
|
+
});
|
|
18
24
|
}
|
|
19
25
|
|
|
20
26
|
/** Returns a global platforma instance or a provided fallback if it's not available. */
|
package/src/ref_util.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { TypedConfig } from
|
|
2
|
-
import { getJsonField, makeObject } from
|
|
1
|
+
import type { TypedConfig } from "./config";
|
|
2
|
+
import { getJsonField, makeObject } from "./config";
|
|
3
3
|
|
|
4
4
|
export function fromPlRef<Source extends TypedConfig>(source: Source) {
|
|
5
5
|
return makeObject({
|
|
6
6
|
__isRef: true,
|
|
7
|
-
blockId: getJsonField(source,
|
|
8
|
-
name: getJsonField(source,
|
|
7
|
+
blockId: getJsonField(source, "blockId"),
|
|
8
|
+
name: getJsonField(source, "name"),
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export function fromPlOption<Source extends TypedConfig>(source: Source) {
|
|
13
13
|
return makeObject({
|
|
14
|
-
ref: fromPlRef(getJsonField(source,
|
|
15
|
-
label: getJsonField(source,
|
|
14
|
+
ref: fromPlRef(getJsonField(source, "ref")),
|
|
15
|
+
label: getJsonField(source, "label"),
|
|
16
16
|
});
|
|
17
17
|
}
|
package/src/render/accessor.ts
CHANGED
|
@@ -9,15 +9,12 @@ import type {
|
|
|
9
9
|
ArchiveFormat,
|
|
10
10
|
ProgressLogWithInfo,
|
|
11
11
|
RangeBytes,
|
|
12
|
-
} from
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} from
|
|
17
|
-
import {
|
|
18
|
-
import { FutureRef } from './future';
|
|
19
|
-
import type { AccessorHandle } from './internal';
|
|
20
|
-
import type { CommonFieldTraverseOps, FieldTraversalStep, ResourceType } from './traversal_ops';
|
|
12
|
+
} from "@milaboratories/pl-model-common";
|
|
13
|
+
import { isPColumn, mapPObjectData } from "@milaboratories/pl-model-common";
|
|
14
|
+
import { getCfgRenderCtx } from "../internal";
|
|
15
|
+
import { FutureRef } from "./future";
|
|
16
|
+
import type { AccessorHandle } from "./internal";
|
|
17
|
+
import type { CommonFieldTraverseOps, FieldTraversalStep, ResourceType } from "./traversal_ops";
|
|
21
18
|
|
|
22
19
|
export function ifDef<T, R>(value: T | undefined, cb: (value: T) => R): R | undefined {
|
|
23
20
|
return value === undefined ? undefined : cb(value);
|
|
@@ -28,7 +25,7 @@ type FieldMapOps = {
|
|
|
28
25
|
* Type of fields to iterate over.
|
|
29
26
|
* (default 'Input')
|
|
30
27
|
* */
|
|
31
|
-
readonly fieldType?:
|
|
28
|
+
readonly fieldType?: "Input" | "Output" | "Dynamic";
|
|
32
29
|
/**
|
|
33
30
|
* If not locked, `undefined` value will be returned. Do nothing if mapping `Dynamic` fields.
|
|
34
31
|
* (default true)
|
|
@@ -51,7 +48,7 @@ export class TreeNodeAccessor {
|
|
|
51
48
|
/** Shortcut for {@link resolveInput} */
|
|
52
49
|
public resolve(
|
|
53
50
|
...steps: [
|
|
54
|
-
Omit<FieldTraversalStep,
|
|
51
|
+
Omit<FieldTraversalStep, "errorIfFieldNotSet"> & {
|
|
55
52
|
errorIfFieldNotAssigned: true;
|
|
56
53
|
},
|
|
57
54
|
]
|
|
@@ -62,8 +59,8 @@ export class TreeNodeAccessor {
|
|
|
62
59
|
const transformedSteps = steps.map(
|
|
63
60
|
(s) =>
|
|
64
61
|
({
|
|
65
|
-
assertFieldType:
|
|
66
|
-
...(typeof s ===
|
|
62
|
+
assertFieldType: "Input",
|
|
63
|
+
...(typeof s === "string" ? { field: s } : s),
|
|
67
64
|
}) satisfies FieldTraversalStep,
|
|
68
65
|
);
|
|
69
66
|
return this.resolveWithCommon({}, ...transformedSteps);
|
|
@@ -72,7 +69,7 @@ export class TreeNodeAccessor {
|
|
|
72
69
|
/** If field type assertion is not specified for the step, default is Output. */
|
|
73
70
|
public resolveOutput(
|
|
74
71
|
...steps: [
|
|
75
|
-
Omit<FieldTraversalStep,
|
|
72
|
+
Omit<FieldTraversalStep, "errorIfFieldNotSet"> & {
|
|
76
73
|
errorIfFieldNotAssigned: true;
|
|
77
74
|
},
|
|
78
75
|
]
|
|
@@ -83,8 +80,8 @@ export class TreeNodeAccessor {
|
|
|
83
80
|
const transformedSteps = steps.map(
|
|
84
81
|
(s) =>
|
|
85
82
|
({
|
|
86
|
-
assertFieldType:
|
|
87
|
-
...(typeof s ===
|
|
83
|
+
assertFieldType: "Output",
|
|
84
|
+
...(typeof s === "string" ? { field: s } : s),
|
|
88
85
|
}) satisfies FieldTraversalStep,
|
|
89
86
|
);
|
|
90
87
|
return this.resolveWithCommon({}, ...transformedSteps);
|
|
@@ -93,7 +90,7 @@ export class TreeNodeAccessor {
|
|
|
93
90
|
/** If field type assertion is not specified for the step, default is Input. */
|
|
94
91
|
public resolveInput(
|
|
95
92
|
...steps: [
|
|
96
|
-
Omit<FieldTraversalStep,
|
|
93
|
+
Omit<FieldTraversalStep, "errorIfFieldNotSet"> & {
|
|
97
94
|
errorIfFieldNotAssigned: true;
|
|
98
95
|
},
|
|
99
96
|
]
|
|
@@ -104,8 +101,8 @@ export class TreeNodeAccessor {
|
|
|
104
101
|
const transformedSteps = steps.map(
|
|
105
102
|
(s) =>
|
|
106
103
|
({
|
|
107
|
-
assertFieldType:
|
|
108
|
-
...(typeof s ===
|
|
104
|
+
assertFieldType: "Input",
|
|
105
|
+
...(typeof s === "string" ? { field: s } : s),
|
|
109
106
|
}) satisfies FieldTraversalStep,
|
|
110
107
|
);
|
|
111
108
|
return this.resolveWithCommon({}, ...transformedSteps);
|
|
@@ -113,7 +110,7 @@ export class TreeNodeAccessor {
|
|
|
113
110
|
|
|
114
111
|
public resolveAny(
|
|
115
112
|
...steps: [
|
|
116
|
-
Omit<FieldTraversalStep,
|
|
113
|
+
Omit<FieldTraversalStep, "errorIfFieldNotSet"> & {
|
|
117
114
|
errorIfFieldNotAssigned: true;
|
|
118
115
|
},
|
|
119
116
|
]
|
|
@@ -129,7 +126,7 @@ export class TreeNodeAccessor {
|
|
|
129
126
|
): TreeNodeAccessor | undefined {
|
|
130
127
|
const resolvePath = [
|
|
131
128
|
...this.resolvePath,
|
|
132
|
-
...steps.map((step) => typeof step ===
|
|
129
|
+
...steps.map((step) => (typeof step === "string" ? step : step.field)),
|
|
133
130
|
];
|
|
134
131
|
return ifDef(
|
|
135
132
|
getCfgRenderCtx().resolveWithCommon(this.handle, commonOptions, ...steps),
|
|
@@ -158,7 +155,7 @@ export class TreeNodeAccessor {
|
|
|
158
155
|
}
|
|
159
156
|
|
|
160
157
|
public getError(): TreeNodeAccessor | undefined {
|
|
161
|
-
const resolvePath = [...this.resolvePath,
|
|
158
|
+
const resolvePath = [...this.resolvePath, "error"];
|
|
162
159
|
return ifDef(
|
|
163
160
|
getCfgRenderCtx().getError(this.handle),
|
|
164
161
|
(accsessor) => new TreeNodeAccessor(accsessor, resolvePath),
|
|
@@ -187,7 +184,7 @@ export class TreeNodeAccessor {
|
|
|
187
184
|
|
|
188
185
|
public getKeyValueAsJson<T>(key: string): T {
|
|
189
186
|
const content = this.getKeyValueAsString(key);
|
|
190
|
-
if (content == undefined) throw new Error(
|
|
187
|
+
if (content == undefined) throw new Error("Resource has no content.");
|
|
191
188
|
return JSON.parse(content);
|
|
192
189
|
}
|
|
193
190
|
|
|
@@ -201,7 +198,7 @@ export class TreeNodeAccessor {
|
|
|
201
198
|
|
|
202
199
|
public getDataAsJson<T>(): T {
|
|
203
200
|
const content = this.getDataAsString();
|
|
204
|
-
if (content == undefined) throw new Error(
|
|
201
|
+
if (content == undefined) throw new Error("Resource has no content.");
|
|
205
202
|
return JSON.parse(content);
|
|
206
203
|
}
|
|
207
204
|
|
|
@@ -210,7 +207,7 @@ export class TreeNodeAccessor {
|
|
|
210
207
|
*/
|
|
211
208
|
public getPColumns(
|
|
212
209
|
errorOnUnknownField: boolean = false,
|
|
213
|
-
prefix: string =
|
|
210
|
+
prefix: string = "",
|
|
214
211
|
): PColumn<TreeNodeAccessor>[] | undefined {
|
|
215
212
|
const result = this.parsePObjectCollection(errorOnUnknownField, prefix);
|
|
216
213
|
if (result === undefined) return undefined;
|
|
@@ -228,7 +225,7 @@ export class TreeNodeAccessor {
|
|
|
228
225
|
*/
|
|
229
226
|
public parsePObjectCollection(
|
|
230
227
|
errorOnUnknownField: boolean = false,
|
|
231
|
-
prefix: string =
|
|
228
|
+
prefix: string = "",
|
|
232
229
|
): Record<string, PObject<TreeNodeAccessor>> | undefined {
|
|
233
230
|
const pObjects = getCfgRenderCtx().parsePObjectCollection(
|
|
234
231
|
this.handle,
|
|
@@ -320,7 +317,9 @@ export class TreeNodeAccessor {
|
|
|
320
317
|
return new FutureRef(getCfgRenderCtx().getProgressLog(this.handle, patternToSearch));
|
|
321
318
|
}
|
|
322
319
|
|
|
323
|
-
public getProgressLogWithInfo(
|
|
320
|
+
public getProgressLogWithInfo(
|
|
321
|
+
patternToSearch: string,
|
|
322
|
+
): FutureRef<ProgressLogWithInfo | undefined> {
|
|
324
323
|
return new FutureRef(getCfgRenderCtx().getProgressLogWithInfo(this.handle, patternToSearch));
|
|
325
324
|
}
|
|
326
325
|
|
|
@@ -328,20 +327,20 @@ export class TreeNodeAccessor {
|
|
|
328
327
|
return new FutureRef(getCfgRenderCtx().getLogHandle(this.handle));
|
|
329
328
|
}
|
|
330
329
|
|
|
331
|
-
public allFieldsResolved(fieldType:
|
|
330
|
+
public allFieldsResolved(fieldType: "Input" | "Output" = "Input"): boolean {
|
|
332
331
|
switch (fieldType) {
|
|
333
|
-
case
|
|
332
|
+
case "Input":
|
|
334
333
|
return (
|
|
335
|
-
this.getInputsLocked()
|
|
336
|
-
|
|
337
|
-
(field) => this.resolve({ field, assertFieldType:
|
|
334
|
+
this.getInputsLocked() &&
|
|
335
|
+
this.listInputFields().every(
|
|
336
|
+
(field) => this.resolve({ field, assertFieldType: "Input" }) !== undefined,
|
|
338
337
|
)
|
|
339
338
|
);
|
|
340
|
-
case
|
|
339
|
+
case "Output":
|
|
341
340
|
return (
|
|
342
|
-
this.getOutputsLocked()
|
|
343
|
-
|
|
344
|
-
(field) => this.resolve({ field, assertFieldType:
|
|
341
|
+
this.getOutputsLocked() &&
|
|
342
|
+
this.listOutputFields().every(
|
|
343
|
+
(field) => this.resolve({ field, assertFieldType: "Output" }) !== undefined,
|
|
345
344
|
)
|
|
346
345
|
);
|
|
347
346
|
}
|
|
@@ -349,31 +348,31 @@ export class TreeNodeAccessor {
|
|
|
349
348
|
|
|
350
349
|
public mapFields<T>(
|
|
351
350
|
_mapping: (name: string, value: TreeNodeAccessor) => T,
|
|
352
|
-
_ops: FieldMapOps & { skipUnresolved: true }
|
|
351
|
+
_ops: FieldMapOps & { skipUnresolved: true },
|
|
353
352
|
): T[] | undefined;
|
|
354
353
|
public mapFields<T>(
|
|
355
354
|
_mapping: (name: string, value: TreeNodeAccessor | undefined) => T,
|
|
356
|
-
_ops?: FieldMapOps
|
|
355
|
+
_ops?: FieldMapOps,
|
|
357
356
|
): T[] | undefined;
|
|
358
357
|
public mapFields<T>(
|
|
359
358
|
_mapping: (name: string, value: TreeNodeAccessor) => T,
|
|
360
359
|
_ops?: FieldMapOps,
|
|
361
360
|
): T[] | undefined {
|
|
362
361
|
const { fieldType, requireLocked, skipUnresolved } = {
|
|
363
|
-
fieldType:
|
|
362
|
+
fieldType: "Input" as const,
|
|
364
363
|
requireLocked: true,
|
|
365
364
|
skipUnresolved: false,
|
|
366
365
|
..._ops,
|
|
367
366
|
};
|
|
368
367
|
const mapping = _mapping as (name: string, value: TreeNodeAccessor | undefined) => T;
|
|
369
368
|
if (requireLocked) {
|
|
370
|
-
if (fieldType ===
|
|
371
|
-
if (fieldType ===
|
|
369
|
+
if (fieldType === "Input" && !this.getInputsLocked()) return undefined;
|
|
370
|
+
if (fieldType === "Output" && !this.getOutputsLocked()) return undefined;
|
|
372
371
|
}
|
|
373
|
-
const fieldList
|
|
374
|
-
|
|
372
|
+
const fieldList =
|
|
373
|
+
fieldType === "Input"
|
|
375
374
|
? this.listInputFields()
|
|
376
|
-
: fieldType ===
|
|
375
|
+
: fieldType === "Output"
|
|
377
376
|
? this.listOutputFields()
|
|
378
377
|
: this.listDynamicFields();
|
|
379
378
|
let fieldEntries = fieldList.map(
|