@platforma-sdk/model 1.38.0 → 1.39.6
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/index.d.ts +2 -3
- package/dist/bconfig/index.d.ts.map +1 -1
- package/dist/bconfig/normalization.d.ts +1 -7
- package/dist/bconfig/normalization.d.ts.map +1 -1
- package/dist/bconfig/types.d.ts +0 -4
- package/dist/bconfig/types.d.ts.map +1 -1
- package/dist/bconfig/{utils.d.ts → util.d.ts} +1 -1
- package/dist/bconfig/util.d.ts.map +1 -0
- package/dist/bconfig/v3.d.ts +3 -32
- package/dist/bconfig/v3.d.ts.map +1 -1
- package/dist/builder.d.ts +3 -1
- package/dist/builder.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +607 -597
- package/dist/index.mjs.map +1 -1
- package/dist/pframe.d.ts.map +1 -1
- package/dist/render/api.d.ts +4 -2
- package/dist/render/api.d.ts.map +1 -1
- package/dist/render/internal.d.ts +4 -3
- package/dist/render/internal.d.ts.map +1 -1
- package/dist/render/util/pframe_upgraders.d.ts +3 -0
- package/dist/render/util/pframe_upgraders.d.ts.map +1 -0
- package/dist/version.d.ts +1 -1
- package/package.json +5 -5
- package/src/bconfig/index.ts +2 -3
- package/src/bconfig/normalization.ts +2 -105
- package/src/bconfig/types.ts +0 -5
- package/src/bconfig/v3.ts +3 -41
- package/src/builder.ts +21 -2
- package/src/pframe.ts +7 -0
- package/src/render/api.ts +36 -8
- package/src/render/internal.ts +15 -3
- package/src/render/util/pframe_upgraders.ts +54 -0
- package/dist/bconfig/container.d.ts +0 -46
- package/dist/bconfig/container.d.ts.map +0 -1
- package/dist/bconfig/utils.d.ts.map +0 -1
- package/src/bconfig/container.ts +0 -58
- /package/src/bconfig/{utils.ts → util.ts} +0 -0
package/dist/pframe.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pframe.d.ts","sourceRoot":"","sources":["../src/pframe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,MAAM,EACN,YAAY,EACZ,SAAS,EACT,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"pframe.d.ts","sourceRoot":"","sources":["../src/pframe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,MAAM,EACN,YAAY,EACZ,SAAS,EACT,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AAGzC,qBAAa,UAAW,YAAW,MAAM;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAEpC,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAItE,aAAa,CAAC,QAAQ,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC;IAIxD,WAAW,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAI1C,kBAAkB,CAC7B,OAAO,EAAE,yBAAyB,CAAC,SAAS,CAAC,EAC7C,KAAK,CAAC,EAAE,UAAU,GACjB,OAAO,CAAC,0BAA0B,CAAC;IAUzB,eAAe,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAG1F"}
|
package/dist/render/api.d.ts
CHANGED
|
@@ -146,9 +146,11 @@ export declare class ResultPool implements ColumnProvider, AxisLabelProvider {
|
|
|
146
146
|
/** Main entry point to the API available within model lambdas (like outputs, sections, etc..) */
|
|
147
147
|
export declare class RenderCtx<Args, UiState> {
|
|
148
148
|
private readonly ctx;
|
|
149
|
-
readonly args: Args;
|
|
150
|
-
readonly uiState: UiState;
|
|
151
149
|
constructor();
|
|
150
|
+
private _argsCache?;
|
|
151
|
+
get args(): Args;
|
|
152
|
+
private _uiStateCache?;
|
|
153
|
+
get uiState(): UiState;
|
|
152
154
|
private _activeArgsCache?;
|
|
153
155
|
/**
|
|
154
156
|
* Returns args snapshot the block was executed for (i.e. when "Run" button was pressed).
|
package/dist/render/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/render/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,WAAW,EACX,MAAM,EACN,QAAQ,EACR,MAAM,EACN,OAAO,EACP,eAAe,EACf,WAAW,EACX,aAAa,EACb,SAAS,EACT,YAAY,EACZ,OAAO,EAEP,WAAW,EACX,cAAc,EACd,SAAS,EACT,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,KAAK,EACL,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EACb,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,iBAAiB,EAalB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAS,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,OAAO,EAAqB,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1G,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/render/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,WAAW,EACX,MAAM,EACN,QAAQ,EACR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
|
+
pFrameInSetFilterSupport: true;
|
|
57
58
|
};
|
|
58
59
|
export interface GlobalCfgRenderCtx extends GlobalCfgRenderCtxMethods {
|
|
59
|
-
readonly args: string;
|
|
60
|
-
readonly uiState: string;
|
|
61
|
-
readonly activeArgs
|
|
60
|
+
readonly args: string | (() => string);
|
|
61
|
+
readonly uiState: string | (() => string);
|
|
62
|
+
readonly activeArgs: undefined | string | (() => string | undefined);
|
|
62
63
|
readonly callbackRegistry: Record<string, AnyFunction>;
|
|
63
64
|
readonly featureFlags?: typeof GlobalCfgRenderCtxFeatureFlags;
|
|
64
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/render/internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAChG,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EACX,MAAM,EACN,OAAO,EACP,aAAa,EACb,SAAS,EACT,YAAY,EACZ,OAAO,EACP,WAAW,EACX,cAAc,EACd,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,UAAU,EACX,MAAM,iCAAiC,CAAC;AAEzC,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAC7C,eAAO,MAAM,gBAAgB,SAAS,CAAC;AAEvC,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAC/D,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAE3D,MAAM,WAAW,yBAAyB,CAAC,OAAO,GAAG,cAAc,EAAE,OAAO,GAAG,YAAY;
|
|
1
|
+
{"version":3,"file":"internal.d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
|
-
export declare const PlatformaSDKVersion = "1.
|
|
1
|
+
export declare const PlatformaSDKVersion = "1.39.6";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-sdk/model",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.39.6",
|
|
4
4
|
"description": "Platforma.bio SDK / Block Model",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"utility-types": "^3.11.0",
|
|
22
22
|
"canonicalize": "~2.1.0",
|
|
23
23
|
"zod": "~3.23.8",
|
|
24
|
-
"@milaboratories/pl-
|
|
25
|
-
"@milaboratories/pl-
|
|
24
|
+
"@milaboratories/pl-error-like": "^1.12.2",
|
|
25
|
+
"@milaboratories/pl-model-common": "^1.16.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"typescript": "~5.6.3",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"@jest/globals": "^29.7.0",
|
|
33
33
|
"ts-jest": "^29.2.6",
|
|
34
34
|
"@milaboratories/build-configs": "1.0.4",
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
35
|
+
"@milaboratories/helpers": "^1.6.17",
|
|
36
|
+
"@platforma-sdk/eslint-config": "1.0.3"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"type-check": "node ./scripts/save-package-version.cjs && tsc --noEmit --composite false",
|
package/src/bconfig/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { extractConfigGeneric, type BlockConfigContainer } from '@milaboratories/pl-model-common';
|
|
2
2
|
import type { TypedConfigOrConfigLambda, TypedConfigOrString } from './types';
|
|
3
3
|
import { isConfigLambda } from './types';
|
|
4
4
|
import type { BlockConfig } from './v3';
|
|
@@ -15,109 +15,6 @@ export function downgradeCfgOrLambda(
|
|
|
15
15
|
return data;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
function upgradeCfgOrLambda(data: TypedConfigOrString): TypedConfigOrConfigLambda;
|
|
19
|
-
function upgradeCfgOrLambda(
|
|
20
|
-
data: TypedConfigOrString | undefined
|
|
21
|
-
): TypedConfigOrConfigLambda | undefined;
|
|
22
|
-
function upgradeCfgOrLambda(
|
|
23
|
-
data: TypedConfigOrString | undefined,
|
|
24
|
-
): TypedConfigOrConfigLambda | undefined {
|
|
25
|
-
if (data === undefined) return undefined;
|
|
26
|
-
if (typeof data === 'string') return { __renderLambda: true, handle: data, retentive: false };
|
|
27
|
-
return data;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Takes universal config, and converts it into latest config structure.
|
|
32
|
-
*
|
|
33
|
-
* **Important**: This operation is not meant to be executed recusively.
|
|
34
|
-
* In no circumstance result of this function should be persisted!
|
|
35
|
-
* */
|
|
36
18
|
export function extractConfig(cfg: BlockConfigContainer): BlockConfig {
|
|
37
|
-
|
|
38
|
-
// version 3
|
|
39
|
-
const {
|
|
40
|
-
initialArgs,
|
|
41
|
-
initialUiState,
|
|
42
|
-
inputsValid,
|
|
43
|
-
outputs,
|
|
44
|
-
renderingMode,
|
|
45
|
-
sdkVersion,
|
|
46
|
-
sections,
|
|
47
|
-
title,
|
|
48
|
-
enrichmentTargets,
|
|
49
|
-
} = cfg.v3;
|
|
50
|
-
const { code } = cfg;
|
|
51
|
-
return {
|
|
52
|
-
initialArgs,
|
|
53
|
-
initialUiState,
|
|
54
|
-
inputsValid,
|
|
55
|
-
outputs,
|
|
56
|
-
renderingMode,
|
|
57
|
-
sdkVersion,
|
|
58
|
-
sections,
|
|
59
|
-
title,
|
|
60
|
-
code,
|
|
61
|
-
enrichmentTargets,
|
|
62
|
-
};
|
|
63
|
-
} else if (cfg.inputsValid !== undefined) {
|
|
64
|
-
// version 2
|
|
65
|
-
const { sdkVersion, renderingMode, outputs, inputsValid, sections, initialArgs, code } = cfg;
|
|
66
|
-
const fields = Object.keys(cfg);
|
|
67
|
-
if (
|
|
68
|
-
sdkVersion === undefined
|
|
69
|
-
|| renderingMode === undefined
|
|
70
|
-
|| outputs === undefined
|
|
71
|
-
|| inputsValid === undefined
|
|
72
|
-
|| sections === undefined
|
|
73
|
-
|| initialArgs === undefined
|
|
74
|
-
)
|
|
75
|
-
throw new Error(
|
|
76
|
-
`Malformed config v2. SDK version ${sdkVersion}; Fields = ${fields.join(', ')}`,
|
|
77
|
-
);
|
|
78
|
-
return {
|
|
79
|
-
sdkVersion,
|
|
80
|
-
renderingMode,
|
|
81
|
-
initialArgs,
|
|
82
|
-
outputs: Object.fromEntries(
|
|
83
|
-
Object.entries(outputs).map(([key, value]) => [key, upgradeCfgOrLambda(value)]),
|
|
84
|
-
),
|
|
85
|
-
inputsValid: upgradeCfgOrLambda(inputsValid),
|
|
86
|
-
sections: upgradeCfgOrLambda(sections),
|
|
87
|
-
initialUiState: undefined,
|
|
88
|
-
code,
|
|
89
|
-
};
|
|
90
|
-
} else if (cfg.renderingMode !== undefined) {
|
|
91
|
-
// version 1
|
|
92
|
-
const { sdkVersion, canRun, renderingMode, outputs, sections, initialArgs, code } = cfg;
|
|
93
|
-
const fields = Object.keys(cfg);
|
|
94
|
-
if (
|
|
95
|
-
renderingMode === undefined
|
|
96
|
-
|| outputs === undefined
|
|
97
|
-
|| canRun === undefined
|
|
98
|
-
|| sections === undefined
|
|
99
|
-
|| initialArgs === undefined
|
|
100
|
-
)
|
|
101
|
-
throw new Error(
|
|
102
|
-
`Malformed config v1. SDK version ${sdkVersion}; Fields = ${fields.join(', ')}`,
|
|
103
|
-
);
|
|
104
|
-
return {
|
|
105
|
-
sdkVersion: sdkVersion ?? 'unknown',
|
|
106
|
-
renderingMode,
|
|
107
|
-
initialArgs,
|
|
108
|
-
outputs: Object.fromEntries(
|
|
109
|
-
Object.entries(outputs).map(([key, value]) => [key, upgradeCfgOrLambda(value)]),
|
|
110
|
-
),
|
|
111
|
-
inputsValid: upgradeCfgOrLambda(canRun),
|
|
112
|
-
sections: upgradeCfgOrLambda(sections),
|
|
113
|
-
initialUiState: undefined,
|
|
114
|
-
code,
|
|
115
|
-
};
|
|
116
|
-
} else {
|
|
117
|
-
const { sdkVersion } = cfg;
|
|
118
|
-
const fields = Object.keys(cfg);
|
|
119
|
-
throw new Error(
|
|
120
|
-
`Config format not supported: SDK = ${sdkVersion}; Fields = ${fields.join(', ')}`,
|
|
121
|
-
);
|
|
122
|
-
}
|
|
19
|
+
return extractConfigGeneric(cfg) as BlockConfig;
|
|
123
20
|
}
|
package/src/bconfig/types.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import type { TypedConfig } from '../config';
|
|
2
2
|
import type { ConfigRenderLambda } from './lambdas';
|
|
3
3
|
|
|
4
|
-
export type Code = {
|
|
5
|
-
type: 'plain';
|
|
6
|
-
content: string;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
4
|
export function isConfigLambda(
|
|
10
5
|
cfgOrFh: TypedConfigOrConfigLambda,
|
|
11
6
|
): cfgOrFh is ConfigRenderLambda {
|
package/src/bconfig/v3.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { BlockConfigV3Generic } from '@milaboratories/pl-model-common';
|
|
2
|
+
import type { TypedConfigOrConfigLambda } from './types';
|
|
3
3
|
import type { ConfigRenderLambda } from './lambdas';
|
|
4
4
|
|
|
5
5
|
export type BlockConfigV3<
|
|
@@ -9,44 +9,6 @@ export type BlockConfigV3<
|
|
|
9
9
|
string,
|
|
10
10
|
TypedConfigOrConfigLambda
|
|
11
11
|
>,
|
|
12
|
-
> =
|
|
13
|
-
/** SDK version used by the block */
|
|
14
|
-
readonly sdkVersion: string;
|
|
15
|
-
|
|
16
|
-
/** Main rendering mode for the block */
|
|
17
|
-
readonly renderingMode: BlockRenderingMode;
|
|
18
|
-
|
|
19
|
-
/** Initial value for the args when block is added to the project */
|
|
20
|
-
readonly initialArgs: Args;
|
|
21
|
-
|
|
22
|
-
/** Initial value for the args when block is added to the project */
|
|
23
|
-
readonly initialUiState: UiState;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Config to determine whether the block can be executed with current
|
|
27
|
-
* arguments.
|
|
28
|
-
*
|
|
29
|
-
* Optional to support earlier SDK version configs.
|
|
30
|
-
* */
|
|
31
|
-
readonly inputsValid: TypedConfigOrConfigLambda;
|
|
32
|
-
|
|
33
|
-
/** Configuration to derive list of section for the left overview panel */
|
|
34
|
-
readonly sections: TypedConfigOrConfigLambda;
|
|
35
|
-
|
|
36
|
-
/** Lambda to derive block title */
|
|
37
|
-
readonly title?: ConfigRenderLambda;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Lambda returning list of upstream blocks this block enriches with its exports,
|
|
41
|
-
* influences dependency graph construction
|
|
42
|
-
* */
|
|
43
|
-
readonly enrichmentTargets?: ConfigRenderLambda;
|
|
44
|
-
|
|
45
|
-
/** Configuration for the output cells */
|
|
46
|
-
readonly outputs: Outputs;
|
|
47
|
-
|
|
48
|
-
/** Config code bundle */
|
|
49
|
-
readonly code?: Code;
|
|
50
|
-
};
|
|
12
|
+
> = BlockConfigV3Generic<Args, UiState, TypedConfigOrConfigLambda, ConfigRenderLambda, Outputs>;
|
|
51
13
|
|
|
52
14
|
export type BlockConfig = BlockConfigV3;
|
package/src/builder.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BlockRenderingMode, BlockSection, ValueOrErrors, AnyFunction, PlRef } from '@milaboratories/pl-model-common';
|
|
1
|
+
import type { BlockRenderingMode, BlockSection, ValueOrErrors, AnyFunction, PlRef, BlockCodeKnownFeatureFlags, BlockConfigContainer } from '@milaboratories/pl-model-common';
|
|
2
2
|
import type { Checked, ConfigResult, TypedConfig } from './config';
|
|
3
3
|
import { getImmediate } from './config';
|
|
4
4
|
import { getPlatformaInstance, isInUI, tryRegisterCallback } from './internal';
|
|
@@ -13,7 +13,6 @@ import type {
|
|
|
13
13
|
DeriveHref,
|
|
14
14
|
ResolveCfgType,
|
|
15
15
|
ExtractFunctionHandleReturn,
|
|
16
|
-
BlockConfigContainer,
|
|
17
16
|
ConfigRenderLambdaFlags,
|
|
18
17
|
} from './bconfig';
|
|
19
18
|
import {
|
|
@@ -66,8 +65,15 @@ export class BlockModel<
|
|
|
66
65
|
private readonly _sections: TypedConfigOrConfigLambda,
|
|
67
66
|
private readonly _title: ConfigRenderLambda | undefined,
|
|
68
67
|
private readonly _enrichmentTargets: ConfigRenderLambda | undefined,
|
|
68
|
+
private readonly _featureFlags: BlockCodeKnownFeatureFlags,
|
|
69
69
|
) {}
|
|
70
70
|
|
|
71
|
+
public static readonly INITIAL_BLOCK_FEATURE_FLAGS: BlockCodeKnownFeatureFlags = {
|
|
72
|
+
supportsLazyState: true,
|
|
73
|
+
requiresUIAPIVersion: 1,
|
|
74
|
+
requiresModelAPIVersion: 1,
|
|
75
|
+
};
|
|
76
|
+
|
|
71
77
|
/** Initiates configuration builder */
|
|
72
78
|
public static create(renderingMode: BlockRenderingMode): BlockModel<NoOb, {}, NoOb>;
|
|
73
79
|
/** Initiates configuration builder */
|
|
@@ -92,6 +98,7 @@ export class BlockModel<
|
|
|
92
98
|
getImmediate([]),
|
|
93
99
|
undefined,
|
|
94
100
|
undefined,
|
|
101
|
+
{ ...BlockModel.INITIAL_BLOCK_FEATURE_FLAGS },
|
|
95
102
|
);
|
|
96
103
|
}
|
|
97
104
|
|
|
@@ -149,6 +156,7 @@ export class BlockModel<
|
|
|
149
156
|
this._sections,
|
|
150
157
|
this._title,
|
|
151
158
|
this._enrichmentTargets,
|
|
159
|
+
this._featureFlags,
|
|
152
160
|
);
|
|
153
161
|
} else
|
|
154
162
|
return new BlockModel(
|
|
@@ -163,6 +171,7 @@ export class BlockModel<
|
|
|
163
171
|
this._sections,
|
|
164
172
|
this._title,
|
|
165
173
|
this._enrichmentTargets,
|
|
174
|
+
this._featureFlags,
|
|
166
175
|
);
|
|
167
176
|
}
|
|
168
177
|
|
|
@@ -205,6 +214,7 @@ export class BlockModel<
|
|
|
205
214
|
this._sections,
|
|
206
215
|
this._title,
|
|
207
216
|
this._enrichmentTargets,
|
|
217
|
+
this._featureFlags,
|
|
208
218
|
);
|
|
209
219
|
} else
|
|
210
220
|
return new BlockModel<Args, OutputsCfg, UiState>(
|
|
@@ -216,6 +226,7 @@ export class BlockModel<
|
|
|
216
226
|
this._sections,
|
|
217
227
|
this._title,
|
|
218
228
|
this._enrichmentTargets,
|
|
229
|
+
this._featureFlags,
|
|
219
230
|
);
|
|
220
231
|
}
|
|
221
232
|
|
|
@@ -253,6 +264,7 @@ export class BlockModel<
|
|
|
253
264
|
{ __renderLambda: true, handle: 'sections' } as ConfigRenderLambda,
|
|
254
265
|
this._title,
|
|
255
266
|
this._enrichmentTargets,
|
|
267
|
+
this._featureFlags,
|
|
256
268
|
);
|
|
257
269
|
} else
|
|
258
270
|
return new BlockModel<Args, OutputsCfg, UiState>(
|
|
@@ -264,6 +276,7 @@ export class BlockModel<
|
|
|
264
276
|
arrOrCfgOrRf as TypedConfig,
|
|
265
277
|
this._title,
|
|
266
278
|
this._enrichmentTargets,
|
|
279
|
+
this._featureFlags,
|
|
267
280
|
);
|
|
268
281
|
}
|
|
269
282
|
|
|
@@ -281,6 +294,7 @@ export class BlockModel<
|
|
|
281
294
|
this._sections,
|
|
282
295
|
{ __renderLambda: true, handle: 'title' } as ConfigRenderLambda,
|
|
283
296
|
this._enrichmentTargets,
|
|
297
|
+
this._featureFlags,
|
|
284
298
|
);
|
|
285
299
|
}
|
|
286
300
|
|
|
@@ -298,6 +312,7 @@ export class BlockModel<
|
|
|
298
312
|
this._sections,
|
|
299
313
|
this._title,
|
|
300
314
|
this._enrichmentTargets,
|
|
315
|
+
this._featureFlags,
|
|
301
316
|
);
|
|
302
317
|
}
|
|
303
318
|
|
|
@@ -312,6 +327,7 @@ export class BlockModel<
|
|
|
312
327
|
this._sections,
|
|
313
328
|
this._title,
|
|
314
329
|
this._enrichmentTargets,
|
|
330
|
+
this._featureFlags,
|
|
315
331
|
);
|
|
316
332
|
}
|
|
317
333
|
|
|
@@ -326,6 +342,7 @@ export class BlockModel<
|
|
|
326
342
|
this._sections,
|
|
327
343
|
this._title,
|
|
328
344
|
this._enrichmentTargets,
|
|
345
|
+
this._featureFlags,
|
|
329
346
|
);
|
|
330
347
|
}
|
|
331
348
|
|
|
@@ -346,6 +363,7 @@ export class BlockModel<
|
|
|
346
363
|
this._sections,
|
|
347
364
|
this._title,
|
|
348
365
|
{ __renderLambda: true, handle: 'enrichmentTargets' } as ConfigRenderLambda,
|
|
366
|
+
this._featureFlags,
|
|
349
367
|
);
|
|
350
368
|
}
|
|
351
369
|
|
|
@@ -371,6 +389,7 @@ export class BlockModel<
|
|
|
371
389
|
title: this._title,
|
|
372
390
|
outputs: this._outputs,
|
|
373
391
|
enrichmentTargets: this._enrichmentTargets,
|
|
392
|
+
featureFlags: this._featureFlags,
|
|
374
393
|
},
|
|
375
394
|
|
|
376
395
|
// fields below are added to allow previous desktop versions read generated configs
|
package/src/pframe.ts
CHANGED
|
@@ -12,6 +12,7 @@ import type {
|
|
|
12
12
|
UniqueValuesRequest,
|
|
13
13
|
UniqueValuesResponse,
|
|
14
14
|
} from '@milaboratories/pl-model-common';
|
|
15
|
+
import { patchInSetFilters } from './render/util/pframe_upgraders';
|
|
15
16
|
|
|
16
17
|
export class PFrameImpl implements PFrame {
|
|
17
18
|
constructor(private readonly handle: PFrameHandle) {}
|
|
@@ -32,6 +33,12 @@ export class PFrameImpl implements PFrame {
|
|
|
32
33
|
request: CalculateTableDataRequest<PObjectId>,
|
|
33
34
|
range?: TableRange,
|
|
34
35
|
): Promise<CalculateTableDataResponse> {
|
|
36
|
+
if (!cfgRenderCtx.featureFlags?.pFrameInSetFilterSupport) {
|
|
37
|
+
request = {
|
|
38
|
+
...request,
|
|
39
|
+
filters: patchInSetFilters(request.filters),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
35
42
|
return await platforma.pFrameDriver.calculateTableData(this.handle, request, range);
|
|
36
43
|
}
|
|
37
44
|
|
package/src/render/api.ts
CHANGED
|
@@ -50,6 +50,7 @@ import { PColumnCollection, type AxisLabelProvider, type ColumnProvider } from '
|
|
|
50
50
|
import type { LabelDerivationOps } from './util/label';
|
|
51
51
|
import { deriveLabels } from './util/label';
|
|
52
52
|
import type { APColumnSelectorWithSplit } from './util/split_selectors';
|
|
53
|
+
import { patchInSetFilters } from './util/pframe_upgraders';
|
|
53
54
|
|
|
54
55
|
export type PColumnDataUniversal = TreeNodeAccessor | DataInfo<TreeNodeAccessor> | PColumnValues;
|
|
55
56
|
|
|
@@ -512,13 +513,30 @@ export class ResultPool implements ColumnProvider, AxisLabelProvider {
|
|
|
512
513
|
export class RenderCtx<Args, UiState> {
|
|
513
514
|
private readonly ctx: GlobalCfgRenderCtx;
|
|
514
515
|
|
|
515
|
-
public readonly args: Args;
|
|
516
|
-
public readonly uiState: UiState;
|
|
517
|
-
|
|
518
516
|
constructor() {
|
|
519
517
|
this.ctx = getCfgRenderCtx();
|
|
520
|
-
|
|
521
|
-
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
private _argsCache?: { v: Args };
|
|
521
|
+
|
|
522
|
+
public get args(): Args {
|
|
523
|
+
if (this._argsCache === undefined) {
|
|
524
|
+
const raw = this.ctx.args;
|
|
525
|
+
const value = typeof raw === 'function' ? raw() : raw;
|
|
526
|
+
this._argsCache = { v: JSON.parse(value) };
|
|
527
|
+
}
|
|
528
|
+
return this._argsCache.v;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
private _uiStateCache?: { v: UiState };
|
|
532
|
+
|
|
533
|
+
public get uiState(): UiState {
|
|
534
|
+
if (this._uiStateCache === undefined) {
|
|
535
|
+
const raw = this.ctx.uiState;
|
|
536
|
+
const value = typeof raw === 'function' ? raw() : raw;
|
|
537
|
+
this._uiStateCache = { v: value ? JSON.parse(value) : ({} as UiState) };
|
|
538
|
+
}
|
|
539
|
+
return this._uiStateCache.v;
|
|
522
540
|
}
|
|
523
541
|
|
|
524
542
|
// lazy rendering because this feature is rarely used
|
|
@@ -529,10 +547,13 @@ export class RenderCtx<Args, UiState> {
|
|
|
529
547
|
* Returns undefined, if block was never executed or stopped mid-way execution, so that the result was cleared.
|
|
530
548
|
* */
|
|
531
549
|
public get activeArgs(): Args | undefined {
|
|
532
|
-
if (this._activeArgsCache === undefined)
|
|
550
|
+
if (this._activeArgsCache === undefined) {
|
|
551
|
+
const raw = this.ctx.activeArgs;
|
|
552
|
+
const value = typeof raw === 'function' ? raw() : raw;
|
|
533
553
|
this._activeArgsCache = {
|
|
534
|
-
v:
|
|
554
|
+
v: value ? JSON.parse(value) : undefined,
|
|
535
555
|
};
|
|
556
|
+
}
|
|
536
557
|
return this._activeArgsCache.v;
|
|
537
558
|
}
|
|
538
559
|
|
|
@@ -578,12 +599,19 @@ export class RenderCtx<Args, UiState> {
|
|
|
578
599
|
private patchPTableDef(def: PTableDef<PColumn<PColumnDataUniversal>>): PTableDef<PColumn<PColumnDataUniversal>> {
|
|
579
600
|
if (!this.ctx.featureFlags?.pTablePartitionFiltersSupport) {
|
|
580
601
|
// For old desktop move all partition filters to filters field as it doesn't read partitionFilters field
|
|
581
|
-
|
|
602
|
+
def = {
|
|
582
603
|
...def,
|
|
583
604
|
partitionFilters: [],
|
|
584
605
|
filters: [...def.partitionFilters, ...def.filters],
|
|
585
606
|
};
|
|
586
607
|
}
|
|
608
|
+
if (!this.ctx.featureFlags?.pFrameInSetFilterSupport) {
|
|
609
|
+
def = {
|
|
610
|
+
...def,
|
|
611
|
+
partitionFilters: patchInSetFilters(def.partitionFilters),
|
|
612
|
+
filters: patchInSetFilters(def.filters),
|
|
613
|
+
};
|
|
614
|
+
}
|
|
587
615
|
return def;
|
|
588
616
|
}
|
|
589
617
|
|
package/src/render/internal.ts
CHANGED
|
@@ -27,6 +27,7 @@ export type AccessorHandle = Branded<string, 'AccessorHandle'>;
|
|
|
27
27
|
export type FutureHandle = Branded<string, 'FutureHandle'>;
|
|
28
28
|
|
|
29
29
|
export interface GlobalCfgRenderCtxMethods<AHandle = AccessorHandle, FHandle = FutureHandle> {
|
|
30
|
+
|
|
30
31
|
//
|
|
31
32
|
// Root accessor creation
|
|
32
33
|
//
|
|
@@ -168,15 +169,26 @@ export const GlobalCfgRenderCtxFeatureFlags = {
|
|
|
168
169
|
inlineColumnsSupport: true as const,
|
|
169
170
|
activeArgs: true as const,
|
|
170
171
|
pTablePartitionFiltersSupport: true as const,
|
|
172
|
+
pFrameInSetFilterSupport: true as const,
|
|
171
173
|
};
|
|
172
174
|
|
|
173
175
|
export interface GlobalCfgRenderCtx extends GlobalCfgRenderCtxMethods {
|
|
176
|
+
//
|
|
177
|
+
// State: Args, UI State, Active Args
|
|
178
|
+
//
|
|
179
|
+
// Old runtime injects these values as strings, new runtime injects them as functions
|
|
180
|
+
// that return strings, if block declares supportsLazyState flag.
|
|
181
|
+
// If function not called in lazy state API, then resulting output will not depend on these values,
|
|
182
|
+
// and thus will not be recalculated on corresponding state change.
|
|
183
|
+
//
|
|
184
|
+
|
|
185
|
+
readonly args: string | (() => string);
|
|
186
|
+
readonly uiState: string | (() => string);
|
|
187
|
+
readonly activeArgs: undefined | string | (() => string | undefined);
|
|
188
|
+
|
|
174
189
|
// Note: strings below are used because, anyway, using strings is the only way
|
|
175
190
|
// to get data inside the QuickJS context, as it is implemented now. With this
|
|
176
191
|
// approach deserialization can be lazily postponed until it is actually needed.
|
|
177
|
-
readonly args: string;
|
|
178
|
-
readonly uiState: string;
|
|
179
|
-
readonly activeArgs?: string;
|
|
180
192
|
readonly callbackRegistry: Record<string, AnyFunction>;
|
|
181
193
|
readonly featureFlags?: typeof GlobalCfgRenderCtxFeatureFlags;
|
|
182
194
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type SingleValuePredicateV2,
|
|
3
|
+
type SingleValueEqualPredicate,
|
|
4
|
+
type SingleValueOrPredicateV2,
|
|
5
|
+
type SingleValueAndPredicateV2,
|
|
6
|
+
type SingleValueNotPredicateV2,
|
|
7
|
+
type PTableRecordSingleValueFilterV2,
|
|
8
|
+
type PTableRecordFilter,
|
|
9
|
+
} from '@milaboratories/pl-model-common';
|
|
10
|
+
|
|
11
|
+
export function patchInSetFilters(filters: PTableRecordSingleValueFilterV2[]): PTableRecordFilter[] {
|
|
12
|
+
const inSetToOrEqual = (predicate: SingleValuePredicateV2): SingleValuePredicateV2 => {
|
|
13
|
+
if (predicate.operator !== 'InSet') return predicate;
|
|
14
|
+
return {
|
|
15
|
+
operator: 'Or',
|
|
16
|
+
operands: predicate.references.map((reference) => ({
|
|
17
|
+
operator: 'Equal',
|
|
18
|
+
reference,
|
|
19
|
+
} satisfies SingleValueEqualPredicate)),
|
|
20
|
+
} satisfies SingleValueOrPredicateV2;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const mapSingleValuePredicate = (filter: SingleValuePredicateV2, cb: (predicate: SingleValuePredicateV2) => SingleValuePredicateV2): SingleValuePredicateV2 => {
|
|
24
|
+
const operator = filter.operator;
|
|
25
|
+
switch (operator) {
|
|
26
|
+
case 'And':
|
|
27
|
+
return {
|
|
28
|
+
...filter,
|
|
29
|
+
operands: filter.operands.map((operand) => mapSingleValuePredicate(operand, cb)),
|
|
30
|
+
} satisfies SingleValueAndPredicateV2;
|
|
31
|
+
case 'Or':
|
|
32
|
+
return {
|
|
33
|
+
...filter,
|
|
34
|
+
operands: filter.operands.map((operand) => mapSingleValuePredicate(operand, cb)),
|
|
35
|
+
} satisfies SingleValueOrPredicateV2;
|
|
36
|
+
case 'Not':
|
|
37
|
+
return {
|
|
38
|
+
...filter,
|
|
39
|
+
operand: mapSingleValuePredicate(filter.operand, cb),
|
|
40
|
+
} satisfies SingleValueNotPredicateV2;
|
|
41
|
+
default:
|
|
42
|
+
return cb(filter);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const mapFilter = (filter: PTableRecordSingleValueFilterV2, cb: (predicate: SingleValuePredicateV2) => SingleValuePredicateV2): PTableRecordSingleValueFilterV2 => {
|
|
47
|
+
return {
|
|
48
|
+
...filter,
|
|
49
|
+
predicate: mapSingleValuePredicate(filter.predicate, cb),
|
|
50
|
+
} satisfies PTableRecordSingleValueFilterV2;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return filters.map((filter) => mapFilter(filter, inSetToOrEqual));
|
|
54
|
+
}
|