@platforma-sdk/model 1.24.9 → 1.24.11
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/bconfig/container.d.ts.map +1 -1
- package/dist/bconfig/lambdas.d.ts +1 -1
- package/dist/bconfig/lambdas.d.ts.map +1 -1
- package/dist/bconfig/normalization.d.ts.map +1 -1
- package/dist/bconfig/types.d.ts.map +1 -1
- package/dist/bconfig/utils.d.ts.map +1 -1
- package/dist/bconfig/v3.d.ts.map +1 -1
- package/dist/block_api.d.ts.map +1 -1
- package/dist/block_state_patch.d.ts.map +1 -1
- package/dist/block_state_util.d.ts.map +1 -1
- package/dist/builder.d.ts.map +1 -1
- package/dist/components/PFrameForGraphs.d.ts.map +1 -1
- package/dist/config/actions.d.ts.map +1 -1
- package/dist/config/actions_kinds.d.ts.map +1 -1
- package/dist/config/model.d.ts.map +1 -1
- package/dist/config/type_engine.d.ts.map +1 -1
- package/dist/config/type_util.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/pframe.d.ts.map +1 -1
- package/dist/platforma.d.ts.map +1 -1
- package/dist/raw_globals.d.ts.map +1 -1
- package/dist/ref_util.d.ts.map +1 -1
- package/dist/render/accessor.d.ts.map +1 -1
- package/dist/render/api.d.ts +2 -2
- package/dist/render/api.d.ts.map +1 -1
- package/dist/render/future.d.ts +2 -2
- package/dist/render/future.d.ts.map +1 -1
- package/dist/render/internal.d.ts +2 -2
- package/dist/render/internal.d.ts.map +1 -1
- package/dist/render/util/label.d.ts.map +1 -1
- package/dist/render/util/resource_map.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/bconfig/container.ts +3 -3
- package/src/bconfig/lambdas.ts +2 -2
- package/src/bconfig/normalization.ts +26 -25
- package/src/bconfig/types.ts +3 -3
- package/src/bconfig/utils.ts +1 -1
- package/src/bconfig/v3.ts +4 -4
- package/src/block_api.ts +3 -3
- package/src/block_state_patch.ts +3 -3
- package/src/block_state_util.ts +4 -4
- package/src/builder.ts +50 -44
- package/src/components/PFrameForGraphs.ts +171 -169
- package/src/config/actions.ts +71 -71
- package/src/config/actions_kinds.ts +9 -9
- package/src/config/model.ts +3 -1
- package/src/config/type_engine.ts +3 -2
- package/src/config/type_util.ts +1 -1
- package/src/internal.ts +4 -4
- package/src/pframe.ts +3 -3
- package/src/platforma.ts +7 -7
- package/src/raw_globals.ts +1 -1
- package/src/ref_util.ts +4 -3
- package/src/render/accessor.ts +30 -28
- package/src/render/api.ts +10 -6
- package/src/render/future.ts +3 -3
- package/src/render/internal.ts +8 -8
- package/src/render/util/label.ts +7 -7
- package/src/render/util/resource_map.ts +6 -7
- package/src/sdk_info.ts +1 -1
package/src/render/accessor.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
AnyLogHandle,
|
|
3
3
|
ImportProgress,
|
|
4
4
|
LocalBlobHandleAndSize,
|
|
@@ -7,14 +7,16 @@ import {
|
|
|
7
7
|
RemoteBlobHandleAndSize,
|
|
8
8
|
FolderURL,
|
|
9
9
|
ArchiveFormat,
|
|
10
|
+
ProgressLogWithInfo,
|
|
11
|
+
} from '@milaboratories/pl-model-common';
|
|
12
|
+
import {
|
|
10
13
|
isPColumn,
|
|
11
14
|
mapPObjectData,
|
|
12
|
-
ProgressLogWithInfo
|
|
13
15
|
} from '@milaboratories/pl-model-common';
|
|
14
16
|
import { getCfgRenderCtx } from '../internal';
|
|
15
17
|
import { FutureRef } from './future';
|
|
16
|
-
import { AccessorHandle } from './internal';
|
|
17
|
-
import { CommonFieldTraverseOps, FieldTraversalStep, ResourceType } from './traversal_ops';
|
|
18
|
+
import type { AccessorHandle } from './internal';
|
|
19
|
+
import type { CommonFieldTraverseOps, FieldTraversalStep, ResourceType } from './traversal_ops';
|
|
18
20
|
|
|
19
21
|
export function ifDef<T, R>(value: T | undefined, cb: (value: T) => R): R | undefined {
|
|
20
22
|
return value === undefined ? undefined : cb(value);
|
|
@@ -50,7 +52,7 @@ export class TreeNodeAccessor {
|
|
|
50
52
|
...steps: [
|
|
51
53
|
Omit<FieldTraversalStep, 'errorIfFieldNotSet'> & {
|
|
52
54
|
errorIfFieldNotAssigned: true;
|
|
53
|
-
}
|
|
55
|
+
},
|
|
54
56
|
]
|
|
55
57
|
): TreeNodeAccessor;
|
|
56
58
|
/** Shortcut for {@link resolveInput} */
|
|
@@ -60,8 +62,8 @@ export class TreeNodeAccessor {
|
|
|
60
62
|
(s) =>
|
|
61
63
|
({
|
|
62
64
|
assertFieldType: 'Input',
|
|
63
|
-
...(typeof s === 'string' ? { field: s } : s)
|
|
64
|
-
}) satisfies FieldTraversalStep
|
|
65
|
+
...(typeof s === 'string' ? { field: s } : s),
|
|
66
|
+
}) satisfies FieldTraversalStep,
|
|
65
67
|
);
|
|
66
68
|
return this.resolveWithCommon({}, ...transformedSteps);
|
|
67
69
|
}
|
|
@@ -71,7 +73,7 @@ export class TreeNodeAccessor {
|
|
|
71
73
|
...steps: [
|
|
72
74
|
Omit<FieldTraversalStep, 'errorIfFieldNotSet'> & {
|
|
73
75
|
errorIfFieldNotAssigned: true;
|
|
74
|
-
}
|
|
76
|
+
},
|
|
75
77
|
]
|
|
76
78
|
): TreeNodeAccessor;
|
|
77
79
|
/** If field type assertion is not specified for the step, default is Output. */
|
|
@@ -81,8 +83,8 @@ export class TreeNodeAccessor {
|
|
|
81
83
|
(s) =>
|
|
82
84
|
({
|
|
83
85
|
assertFieldType: 'Output',
|
|
84
|
-
...(typeof s === 'string' ? { field: s } : s)
|
|
85
|
-
}) satisfies FieldTraversalStep
|
|
86
|
+
...(typeof s === 'string' ? { field: s } : s),
|
|
87
|
+
}) satisfies FieldTraversalStep,
|
|
86
88
|
);
|
|
87
89
|
return this.resolveWithCommon({}, ...transformedSteps);
|
|
88
90
|
}
|
|
@@ -92,7 +94,7 @@ export class TreeNodeAccessor {
|
|
|
92
94
|
...steps: [
|
|
93
95
|
Omit<FieldTraversalStep, 'errorIfFieldNotSet'> & {
|
|
94
96
|
errorIfFieldNotAssigned: true;
|
|
95
|
-
}
|
|
97
|
+
},
|
|
96
98
|
]
|
|
97
99
|
): TreeNodeAccessor;
|
|
98
100
|
/** If field type assertion is not specified for the step, default is Input. */
|
|
@@ -102,8 +104,8 @@ export class TreeNodeAccessor {
|
|
|
102
104
|
(s) =>
|
|
103
105
|
({
|
|
104
106
|
assertFieldType: 'Input',
|
|
105
|
-
...(typeof s === 'string' ? { field: s } : s)
|
|
106
|
-
}) satisfies FieldTraversalStep
|
|
107
|
+
...(typeof s === 'string' ? { field: s } : s),
|
|
108
|
+
}) satisfies FieldTraversalStep,
|
|
107
109
|
);
|
|
108
110
|
return this.resolveWithCommon({}, ...transformedSteps);
|
|
109
111
|
}
|
|
@@ -112,7 +114,7 @@ export class TreeNodeAccessor {
|
|
|
112
114
|
...steps: [
|
|
113
115
|
Omit<FieldTraversalStep, 'errorIfFieldNotSet'> & {
|
|
114
116
|
errorIfFieldNotAssigned: true;
|
|
115
|
-
}
|
|
117
|
+
},
|
|
116
118
|
]
|
|
117
119
|
): TreeNodeAccessor;
|
|
118
120
|
public resolveAny(...steps: (FieldTraversalStep | string)[]): TreeNodeAccessor | undefined;
|
|
@@ -207,7 +209,7 @@ export class TreeNodeAccessor {
|
|
|
207
209
|
*/
|
|
208
210
|
public getPColumns(
|
|
209
211
|
errorOnUnknownField: boolean = false,
|
|
210
|
-
prefix: string = ''
|
|
212
|
+
prefix: string = '',
|
|
211
213
|
): PColumn<TreeNodeAccessor>[] | undefined {
|
|
212
214
|
const result = this.parsePObjectCollection(errorOnUnknownField, prefix);
|
|
213
215
|
if (result === undefined) return undefined;
|
|
@@ -225,7 +227,7 @@ export class TreeNodeAccessor {
|
|
|
225
227
|
*/
|
|
226
228
|
public parsePObjectCollection(
|
|
227
229
|
errorOnUnknownField: boolean = false,
|
|
228
|
-
prefix: string = ''
|
|
230
|
+
prefix: string = '',
|
|
229
231
|
): Record<string, PObject<TreeNodeAccessor>> | undefined {
|
|
230
232
|
const pObjects = getCfgRenderCtx().parsePObjectCollection(
|
|
231
233
|
this.handle,
|
|
@@ -252,7 +254,7 @@ export class TreeNodeAccessor {
|
|
|
252
254
|
|
|
253
255
|
public getFileContentAsJson<T>(): FutureRef<T | undefined> {
|
|
254
256
|
return new FutureRef<string | undefined>(
|
|
255
|
-
getCfgRenderCtx().getBlobContentAsString(this.handle)
|
|
257
|
+
getCfgRenderCtx().getBlobContentAsString(this.handle),
|
|
256
258
|
).mapDefined((v) => JSON.parse(v) as T);
|
|
257
259
|
}
|
|
258
260
|
|
|
@@ -329,16 +331,16 @@ export class TreeNodeAccessor {
|
|
|
329
331
|
switch (fieldType) {
|
|
330
332
|
case 'Input':
|
|
331
333
|
return (
|
|
332
|
-
this.getInputsLocked()
|
|
333
|
-
this.listInputFields().every(
|
|
334
|
-
(field) => this.resolve({ field, assertFieldType: 'Input' }) !== undefined
|
|
334
|
+
this.getInputsLocked()
|
|
335
|
+
&& this.listInputFields().every(
|
|
336
|
+
(field) => this.resolve({ field, assertFieldType: 'Input' }) !== undefined,
|
|
335
337
|
)
|
|
336
338
|
);
|
|
337
339
|
case 'Output':
|
|
338
340
|
return (
|
|
339
|
-
this.getOutputsLocked()
|
|
340
|
-
this.listOutputFields().every(
|
|
341
|
-
(field) => this.resolve({ field, assertFieldType: 'Output' }) !== undefined
|
|
341
|
+
this.getOutputsLocked()
|
|
342
|
+
&& this.listOutputFields().every(
|
|
343
|
+
(field) => this.resolve({ field, assertFieldType: 'Output' }) !== undefined,
|
|
342
344
|
)
|
|
343
345
|
);
|
|
344
346
|
}
|
|
@@ -354,27 +356,27 @@ export class TreeNodeAccessor {
|
|
|
354
356
|
): T[] | undefined;
|
|
355
357
|
public mapFields<T>(
|
|
356
358
|
_mapping: (name: string, value: TreeNodeAccessor) => T,
|
|
357
|
-
_ops?: FieldMapOps
|
|
359
|
+
_ops?: FieldMapOps,
|
|
358
360
|
): T[] | undefined {
|
|
359
361
|
const { fieldType, requireLocked, skipUnresolved } = {
|
|
360
362
|
fieldType: 'Input' as const,
|
|
361
363
|
requireLocked: true,
|
|
362
364
|
skipUnresolved: false,
|
|
363
|
-
..._ops
|
|
365
|
+
..._ops,
|
|
364
366
|
};
|
|
365
367
|
const mapping = _mapping as (name: string, value: TreeNodeAccessor | undefined) => T;
|
|
366
368
|
if (requireLocked) {
|
|
367
369
|
if (fieldType === 'Input' && !this.getInputsLocked()) return undefined;
|
|
368
370
|
if (fieldType === 'Output' && !this.getOutputsLocked()) return undefined;
|
|
369
371
|
}
|
|
370
|
-
const fieldList
|
|
371
|
-
fieldType === 'Input'
|
|
372
|
+
const fieldList
|
|
373
|
+
= fieldType === 'Input'
|
|
372
374
|
? this.listInputFields()
|
|
373
375
|
: fieldType === 'Output'
|
|
374
376
|
? this.listOutputFields()
|
|
375
377
|
: this.listDynamicFields();
|
|
376
378
|
let fieldEntries = fieldList.map(
|
|
377
|
-
(field) => [field, this.resolve({ field, assertFieldType: fieldType })] as const
|
|
379
|
+
(field) => [field, this.resolve({ field, assertFieldType: fieldType })] as const,
|
|
378
380
|
);
|
|
379
381
|
if (skipUnresolved) fieldEntries = fieldEntries.filter((e) => e[1] !== undefined);
|
|
380
382
|
return fieldEntries.map(([name, value]) => mapping(name, value));
|
package/src/render/api.ts
CHANGED
|
@@ -18,10 +18,13 @@ import type {
|
|
|
18
18
|
PTableSorting,
|
|
19
19
|
PlRef,
|
|
20
20
|
ResultCollection,
|
|
21
|
-
ValueOrError
|
|
21
|
+
ValueOrError,
|
|
22
|
+
AnyFunction,
|
|
23
|
+
} from '@milaboratories/pl-model-common';
|
|
22
24
|
import {
|
|
23
25
|
AnchorIdDeriver,
|
|
24
|
-
resolveAnchors
|
|
26
|
+
resolveAnchors,
|
|
27
|
+
} from '@milaboratories/pl-model-common';
|
|
25
28
|
import {
|
|
26
29
|
ensurePColumn,
|
|
27
30
|
extractAllColumns,
|
|
@@ -52,7 +55,8 @@ export class ResultPool {
|
|
|
52
55
|
return this.ctx.calculateOptions(predicate);
|
|
53
56
|
}
|
|
54
57
|
|
|
55
|
-
|
|
58
|
+
// @TODO: unused, what is this for?
|
|
59
|
+
private defaultLabelFn = (spec: PObjectSpec, _ref: PlRef) =>
|
|
56
60
|
spec.annotations?.['pl7.app/label'] ?? `Unlabelled`;
|
|
57
61
|
|
|
58
62
|
public getOptions(
|
|
@@ -140,7 +144,7 @@ export class ResultPool {
|
|
|
140
144
|
resolvedAnchors[key] = resolvedSpec;
|
|
141
145
|
} else {
|
|
142
146
|
// It's already a PColumnSpec
|
|
143
|
-
resolvedAnchors[key] = value
|
|
147
|
+
resolvedAnchors[key] = value;
|
|
144
148
|
}
|
|
145
149
|
}
|
|
146
150
|
}
|
|
@@ -263,7 +267,7 @@ export class ResultPool {
|
|
|
263
267
|
const spec = this.getSpecByRef(ref);
|
|
264
268
|
if (!spec) return undefined;
|
|
265
269
|
if (!isPColumnSpec(spec)) throw new Error(`not a PColumn spec (kind = ${spec.kind})`);
|
|
266
|
-
return spec
|
|
270
|
+
return spec;
|
|
267
271
|
}
|
|
268
272
|
|
|
269
273
|
/**
|
|
@@ -492,6 +496,6 @@ export type UnwrapFutureRef<K> =
|
|
|
492
496
|
? K
|
|
493
497
|
: { [key in keyof K]: UnwrapFutureRef<K[key]> };
|
|
494
498
|
|
|
495
|
-
export type InferRenderFunctionReturn<RF extends
|
|
499
|
+
export type InferRenderFunctionReturn<RF extends AnyFunction> = RF extends (...args: any) => infer R
|
|
496
500
|
? UnwrapFutureRef<R>
|
|
497
501
|
: never;
|
package/src/render/future.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FutureAwait, FutureHandle } from './internal';
|
|
1
|
+
import type { FutureAwait, FutureHandle } from './internal';
|
|
2
2
|
import { registerFutureAwait } from '../internal';
|
|
3
3
|
|
|
4
4
|
export class FutureRef<T = unknown> {
|
|
@@ -7,7 +7,7 @@ export class FutureRef<T = unknown> {
|
|
|
7
7
|
|
|
8
8
|
constructor(
|
|
9
9
|
private readonly handle: FutureHandle,
|
|
10
|
-
private readonly postProcess: (value: unknown) => T = (v) => v as T
|
|
10
|
+
private readonly postProcess: (value: unknown) => T = (v) => v as T,
|
|
11
11
|
) {
|
|
12
12
|
registerFutureAwait(handle, (value) => {
|
|
13
13
|
this.resolvedValue = postProcess(value);
|
|
@@ -26,7 +26,7 @@ export class FutureRef<T = unknown> {
|
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
toJSON()
|
|
29
|
+
toJSON() {
|
|
30
30
|
return this.isResolved
|
|
31
31
|
? this.resolvedValue
|
|
32
32
|
: ({ __awaited_futures__: [this.handle] } as FutureAwait);
|
package/src/render/internal.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Optional } from 'utility-types';
|
|
2
|
-
import { Branded } from '../branding';
|
|
3
|
-
import { CommonFieldTraverseOps, FieldTraversalStep, ResourceType } from './traversal_ops';
|
|
4
|
-
import {
|
|
1
|
+
import type { Optional } from 'utility-types';
|
|
2
|
+
import type { Branded } from '../branding';
|
|
3
|
+
import type { CommonFieldTraverseOps, FieldTraversalStep, ResourceType } from './traversal_ops';
|
|
4
|
+
import type {
|
|
5
5
|
ArchiveFormat,
|
|
6
|
+
AnyFunction,
|
|
6
7
|
Option,
|
|
7
8
|
PColumn,
|
|
8
9
|
PColumnValues,
|
|
@@ -13,9 +14,8 @@ import {
|
|
|
13
14
|
PSpecPredicate,
|
|
14
15
|
PTableDef,
|
|
15
16
|
PTableHandle,
|
|
16
|
-
Ref,
|
|
17
17
|
ResultCollection,
|
|
18
|
-
ValueOrError
|
|
18
|
+
ValueOrError,
|
|
19
19
|
} from '@milaboratories/pl-model-common';
|
|
20
20
|
|
|
21
21
|
export const StagingAccessorName = 'staging';
|
|
@@ -153,7 +153,7 @@ export interface GlobalCfgRenderCtxMethods<AHandle = AccessorHandle, FHandle = F
|
|
|
153
153
|
|
|
154
154
|
export const GlobalCfgRenderCtxFeatureFlags = {
|
|
155
155
|
inlineColumnsSupport: true as const,
|
|
156
|
-
activeArgs: true as const
|
|
156
|
+
activeArgs: true as const,
|
|
157
157
|
};
|
|
158
158
|
|
|
159
159
|
export interface GlobalCfgRenderCtx extends GlobalCfgRenderCtxMethods {
|
|
@@ -163,7 +163,7 @@ export interface GlobalCfgRenderCtx extends GlobalCfgRenderCtxMethods {
|
|
|
163
163
|
readonly args: string;
|
|
164
164
|
readonly uiState: string;
|
|
165
165
|
readonly activeArgs?: string;
|
|
166
|
-
readonly callbackRegistry: Record<string,
|
|
166
|
+
readonly callbackRegistry: Record<string, AnyFunction>;
|
|
167
167
|
readonly featureFlags?: typeof GlobalCfgRenderCtxFeatureFlags;
|
|
168
168
|
}
|
|
169
169
|
|
package/src/render/util/label.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PObjectSpec } from '@milaboratories/pl-model-common';
|
|
1
|
+
import type { PObjectSpec } from '@milaboratories/pl-model-common';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
export const PAnnotationLabel = 'pl7.app/label';
|
|
@@ -22,7 +22,7 @@ export const TraceEntry = z.object({
|
|
|
22
22
|
type: z.string(),
|
|
23
23
|
importance: z.number().optional(),
|
|
24
24
|
id: z.string().optional(),
|
|
25
|
-
label: z.string()
|
|
25
|
+
label: z.string(),
|
|
26
26
|
});
|
|
27
27
|
export type TraceEntry = z.infer<typeof TraceEntry>;
|
|
28
28
|
type FullTraceEntry = TraceEntry & { fullType: string; occurenceIndex: number };
|
|
@@ -39,7 +39,7 @@ const LabelTypeFull = '__LABEL__@1';
|
|
|
39
39
|
export function deriveLabels<T>(
|
|
40
40
|
values: T[],
|
|
41
41
|
specExtractor: (obj: T) => PObjectSpec,
|
|
42
|
-
ops: LabelDerivationOps = {}
|
|
42
|
+
ops: LabelDerivationOps = {},
|
|
43
43
|
): RecordsWithLabel<T>[] {
|
|
44
44
|
const importances = new Map<string, number>();
|
|
45
45
|
|
|
@@ -72,8 +72,8 @@ export function deriveLabels<T>(
|
|
|
72
72
|
fullType,
|
|
73
73
|
Math.max(
|
|
74
74
|
importances.get(fullType) ?? Number.NEGATIVE_INFINITY,
|
|
75
|
-
importance - (trace.length - i) * DistancePenalty
|
|
76
|
-
)
|
|
75
|
+
importance - (trace.length - i) * DistancePenalty,
|
|
76
|
+
),
|
|
77
77
|
);
|
|
78
78
|
fullTrace.push({ ...trace[i], fullType, occurenceIndex });
|
|
79
79
|
}
|
|
@@ -82,7 +82,7 @@ export function deriveLabels<T>(
|
|
|
82
82
|
value,
|
|
83
83
|
spec,
|
|
84
84
|
label,
|
|
85
|
-
fullTrace
|
|
85
|
+
fullTrace,
|
|
86
86
|
};
|
|
87
87
|
});
|
|
88
88
|
|
|
@@ -109,7 +109,7 @@ export function deriveLabels<T>(
|
|
|
109
109
|
const sep = ops.separator ?? ' / ';
|
|
110
110
|
return {
|
|
111
111
|
label: labelSet.join(sep),
|
|
112
|
-
value: r.value
|
|
112
|
+
value: r.value,
|
|
113
113
|
} satisfies RecordsWithLabel<T>;
|
|
114
114
|
});
|
|
115
115
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TreeNodeAccessor } from '../accessor';
|
|
1
|
+
import type { TreeNodeAccessor } from '../accessor';
|
|
2
2
|
|
|
3
3
|
const PCD_PREFIX = 'PColumnData/';
|
|
4
4
|
|
|
@@ -29,7 +29,7 @@ function populateResourceMapData<T>(
|
|
|
29
29
|
resourceParser: (acc: TreeNodeAccessor) => T | undefined,
|
|
30
30
|
data: PColumnResourceMapEntry<T | undefined>[],
|
|
31
31
|
keyPrefix: PColumnKey = [],
|
|
32
|
-
addEntriesWithNoData: boolean
|
|
32
|
+
addEntriesWithNoData: boolean,
|
|
33
33
|
): boolean {
|
|
34
34
|
if (acc === undefined) return false;
|
|
35
35
|
switch (acc.resourceType.name) {
|
|
@@ -56,7 +56,7 @@ function populateResourceMapData<T>(
|
|
|
56
56
|
resourceParser,
|
|
57
57
|
data,
|
|
58
58
|
key,
|
|
59
|
-
addEntriesWithNoData
|
|
59
|
+
addEntriesWithNoData,
|
|
60
60
|
);
|
|
61
61
|
isComplete = isComplete && populateResult;
|
|
62
62
|
}
|
|
@@ -81,14 +81,13 @@ export function parseResourceMap<T>(
|
|
|
81
81
|
export function parseResourceMap<T>(
|
|
82
82
|
acc: TreeNodeAccessor | undefined,
|
|
83
83
|
resourceParser: (acc: TreeNodeAccessor) => T | undefined,
|
|
84
|
-
addEntriesWithNoData: boolean = false
|
|
84
|
+
addEntriesWithNoData: boolean = false,
|
|
85
85
|
): PColumnResourceMapData<T | undefined> {
|
|
86
86
|
const data: PColumnResourceMapEntry<T | undefined>[] = [];
|
|
87
87
|
const isComplete = populateResourceMapData(acc, resourceParser, data, [], addEntriesWithNoData);
|
|
88
88
|
return { isComplete, data };
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
|
|
92
91
|
export type PColumnKeyList = {
|
|
93
92
|
/** array of keys */
|
|
94
93
|
data: PColumnKey[];
|
|
@@ -109,7 +108,7 @@ const removeIndexSuffix = (keyStr: string): string | undefined => {
|
|
|
109
108
|
// @TODO define a class with various resource map operations
|
|
110
109
|
/** Returns a list of all partition keys appeared in the p-column */
|
|
111
110
|
export function getPartitionKeysList(
|
|
112
|
-
acc: TreeNodeAccessor | undefined
|
|
111
|
+
acc: TreeNodeAccessor | undefined,
|
|
113
112
|
): PColumnKeyList | undefined {
|
|
114
113
|
if (!acc) return undefined;
|
|
115
114
|
|
|
@@ -183,7 +182,7 @@ export function getPartitionKeysList(
|
|
|
183
182
|
/** 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. */
|
|
184
183
|
// @TODO define a class with various resource map operations
|
|
185
184
|
export function getUniquePartitionKeys(
|
|
186
|
-
acc: TreeNodeAccessor | undefined
|
|
185
|
+
acc: TreeNodeAccessor | undefined,
|
|
187
186
|
): (string | number)[][] | undefined {
|
|
188
187
|
const list = getPartitionKeysList(acc);
|
|
189
188
|
if (!list) return undefined;
|
package/src/sdk_info.ts
CHANGED