@milaboratories/pl-middle-layer 1.15.13 → 1.16.0
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/cfg_render/executor.d.ts.map +1 -1
- package/dist/index.js +16 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +512 -511
- package/dist/index.mjs.map +1 -1
- package/dist/js_render/index.d.ts +1 -1
- package/dist/js_render/index.d.ts.map +1 -1
- package/dist/middle_layer/active_cfg.d.ts.map +1 -1
- package/dist/middle_layer/block.d.ts.map +1 -1
- package/dist/middle_layer/frontend_path.d.ts.map +1 -1
- package/dist/middle_layer/project_overview.d.ts +1 -1
- package/dist/middle_layer/project_overview.d.ts.map +1 -1
- package/dist/middle_layer/render.d.ts +1 -1
- package/dist/middle_layer/render.d.ts.map +1 -1
- package/dist/middle_layer/types.d.ts.map +1 -1
- package/dist/middle_layer/util.d.ts +11 -1
- package/dist/middle_layer/util.d.ts.map +1 -1
- package/dist/pool/driver.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/cfg_render/executor.ts +0 -1
- package/src/js_render/index.ts +3 -1
- package/src/middle_layer/active_cfg.ts +7 -15
- package/src/middle_layer/block.ts +3 -6
- package/src/middle_layer/frontend_path.ts +6 -3
- package/src/middle_layer/project_overview.ts +18 -26
- package/src/middle_layer/render.ts +2 -1
- package/src/middle_layer/types.ts +2 -2
- package/src/middle_layer/util.ts +27 -12
- package/src/pool/driver.ts +9 -3
|
@@ -2,5 +2,5 @@ import { MiddleLayerEnvironment } from '../middle_layer/middle_layer';
|
|
|
2
2
|
import { Code, ConfigRenderLambda } from '@platforma-sdk/model';
|
|
3
3
|
import { Computable, ComputableRenderingOps } from '@milaboratories/computable';
|
|
4
4
|
import { BlockContextAny } from '../middle_layer/block_ctx';
|
|
5
|
-
export declare function computableFromRF(env: MiddleLayerEnvironment, ctx: BlockContextAny, fh: ConfigRenderLambda, code: Code, ops?: Partial<ComputableRenderingOps>): Computable<unknown>;
|
|
5
|
+
export declare function computableFromRF(env: MiddleLayerEnvironment, ctx: BlockContextAny, fh: ConfigRenderLambda, code: Code, configKey: string, ops?: Partial<ComputableRenderingOps>): Computable<unknown>;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/js_render/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGhF,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAG5D,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,sBAAsB,EAC3B,GAAG,EAAE,eAAe,EACpB,EAAE,EAAE,kBAAkB,EACtB,IAAI,EAAE,IAAI,EACV,GAAG,GAAE,OAAO,CAAC,sBAAsB,CAAM,GACxC,UAAU,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/js_render/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGhF,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAG5D,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,sBAAsB,EAC3B,GAAG,EAAE,eAAe,EACpB,EAAE,EAAE,kBAAkB,EACtB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,MAAM,EACjB,GAAG,GAAE,OAAO,CAAC,sBAAsB,CAAM,GACxC,UAAU,CAAC,OAAO,CAAC,CAmDrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"active_cfg.d.ts","sourceRoot":"","sources":["../../src/middle_layer/active_cfg.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"active_cfg.d.ts","sourceRoot":"","sources":["../../src/middle_layer/active_cfg.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAUxD,sEAAsE;AACtE,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,WAAW,EACrB,GAAG,EAAE,sBAAsB,GAC1B,UAAU,CAAC,OAAO,EAAE,CAAC,CA2BvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../src/middle_layer/block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EACL,UAAU,EACV,aAAa,EACb,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAgB,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAIzF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,kBAAkB,EAAE,SAAS,GAAG,iBAAiB,CAAC,CAAC;AAE1F,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,WAAW,EACzB,OAAO,EAAE,MAAM,GACd,UAAU,CAAC,mBAAmB,CAAC,CAAC;AACnC,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,WAAW,EACzB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,aAAa,GAClB,mBAAmB,CAAC;AAqBvB,wBAAgB,YAAY,CAC1B,YAAY,EAAE,WAAW,EACzB,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,sBAAsB,GAC1B,uBAAuB,CAAC,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,OAAO,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../src/middle_layer/block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EACL,UAAU,EACV,aAAa,EACb,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAgB,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAIzF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,kBAAkB,EAAE,SAAS,GAAG,iBAAiB,CAAC,CAAC;AAE1F,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,WAAW,EACzB,OAAO,EAAE,MAAM,GACd,UAAU,CAAC,mBAAmB,CAAC,CAAC;AACnC,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,WAAW,EACzB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,aAAa,GAClB,mBAAmB,CAAC;AAqBvB,wBAAgB,YAAY,CAC1B,YAAY,EAAE,WAAW,EACzB,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,sBAAsB,GAC1B,uBAAuB,CAAC,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,OAAO,CAAC,CAAC,CAAC,CAiB3E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontend_path.d.ts","sourceRoot":"","sources":["../../src/middle_layer/frontend_path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAc,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAYjF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AA6CjD,wBAAgB,YAAY,CAC1B,YAAY,EAAE,WAAW,EACzB,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,sBAAsB,GAC1B,uBAAuB,CAAC,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"frontend_path.d.ts","sourceRoot":"","sources":["../../src/middle_layer/frontend_path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAc,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAYjF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AA6CjD,wBAAgB,YAAY,CAC1B,YAAY,EAAE,WAAW,EACzB,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,sBAAsB,GAC1B,uBAAuB,CAAC,YAAY,CAAC,CAsBvC"}
|
|
@@ -4,5 +4,5 @@ import { MiddleLayerEnvironment } from './middle_layer';
|
|
|
4
4
|
import { ProjectOverview } from '@milaboratories/pl-model-middle-layer';
|
|
5
5
|
import { NavigationStates } from './navigation_states';
|
|
6
6
|
/** Returns derived general project state form the project resource */
|
|
7
|
-
export declare function projectOverview(
|
|
7
|
+
export declare function projectOverview(prjEntry: PlTreeEntry, navigationStates: NavigationStates, env: MiddleLayerEnvironment): ComputableStableDefined<ProjectOverview>;
|
|
8
8
|
//# sourceMappingURL=project_overview.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project_overview.d.ts","sourceRoot":"","sources":["../../src/middle_layer/project_overview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAc,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAcjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"project_overview.d.ts","sourceRoot":"","sources":["../../src/middle_layer/project_overview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAc,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAcjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAIL,eAAe,EAChB,MAAM,uCAAuC,CAAC;AAM/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAyBvD,sEAAsE;AACtE,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,WAAW,EACrB,gBAAgB,EAAE,gBAAgB,EAClC,GAAG,EAAE,sBAAsB,GAC1B,uBAAuB,CAAC,eAAe,CAAC,CAqK1C"}
|
|
@@ -3,5 +3,5 @@ import { Computable, ComputableRenderingOps } from '@milaboratories/computable';
|
|
|
3
3
|
import { MiddleLayerEnvironment } from './middle_layer';
|
|
4
4
|
import { BlockContextAny } from './block_ctx';
|
|
5
5
|
export declare function isActive(cfg: TypedConfigOrConfigLambda): boolean;
|
|
6
|
-
export declare function computableFromCfgOrRF(env: MiddleLayerEnvironment, ctx: BlockContextAny, cfgOrFh: TypedConfigOrConfigLambda, code: Code | undefined, ops?: Partial<ComputableRenderingOps>): Computable<unknown>;
|
|
6
|
+
export declare function computableFromCfgOrRF(env: MiddleLayerEnvironment, ctx: BlockContextAny, cfgOrFh: TypedConfigOrConfigLambda, code: Code | undefined, configKey: string, ops?: Partial<ComputableRenderingOps>): Computable<unknown>;
|
|
7
7
|
//# sourceMappingURL=render.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/middle_layer/render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEhF,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,wBAAgB,QAAQ,CAAC,GAAG,EAAE,yBAAyB,GAAG,OAAO,CAGhE;AAED,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,sBAAsB,EAC3B,GAAG,EAAE,eAAe,EACpB,OAAO,EAAE,yBAAyB,EAClC,IAAI,EAAE,IAAI,GAAG,SAAS,EACtB,GAAG,GAAE,OAAO,CAAC,sBAAsB,CAAM,GACxC,UAAU,CAAC,OAAO,CAAC,CAKrB"}
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/middle_layer/render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEhF,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,wBAAgB,QAAQ,CAAC,GAAG,EAAE,yBAAyB,GAAG,OAAO,CAGhE;AAED,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,sBAAsB,EAC3B,GAAG,EAAE,eAAe,EACpB,OAAO,EAAE,yBAAyB,EAClC,IAAI,EAAE,IAAI,GAAG,SAAS,EACtB,SAAS,EAAE,MAAM,EACjB,GAAG,GAAE,OAAO,CAAC,sBAAsB,CAAM,GACxC,UAAU,CAAC,OAAO,CAAC,CAKrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/middle_layer/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/middle_layer/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAE,UAAU,EAA0B,MAAM,4BAA4B,CAAC;AAEhF,MAAM,MAAM,2BAA2B,GAAG,IAAI,CAC5C,mBAAmB,EACnB,iBAAiB,GAAG,kBAAkB,GAAG,SAAS,CACnD,CAAC;AAEF,MAAM,WAAW,iBAAiB,CAAC,CAAC,EAAE,EAAE,SAAS,CAAC,GAAG,CAAC;IACpD,IAAI,EAAE,qBAAqB,CAAC;IAC5B,UAAU,EAAE,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;CAC/B;AAED;wDACwD;AACxD,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,iBAAiB,CAAC,CAAC,GAAG,SAAS,EAAE,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { PlTreeNodeAccessor } from '@milaboratories/pl-tree';
|
|
2
|
+
import { BlockPackInfo } from '../model/block_pack';
|
|
2
3
|
import { BlockConfig } from '@platforma-sdk/model';
|
|
3
|
-
export
|
|
4
|
+
export type BlockPackInfoAndId = {
|
|
5
|
+
/** To be added to computable keys, to force reload on config change */
|
|
6
|
+
readonly bpId: string;
|
|
7
|
+
/** Full block-pack info */
|
|
8
|
+
readonly info: BlockPackInfo;
|
|
9
|
+
/** Config extracted from the info */
|
|
10
|
+
readonly cfg: BlockConfig;
|
|
11
|
+
};
|
|
12
|
+
/** Returns block pack info along with string representation of block-pack resource id */
|
|
13
|
+
export declare function getBlockPackInfo(prj: PlTreeNodeAccessor, blockId: string): BlockPackInfoAndId | undefined;
|
|
4
14
|
export declare const LogOutputStatus: string | undefined;
|
|
5
15
|
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/middle_layer/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/middle_layer/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAI7D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAiB,MAAM,sBAAsB,CAAC;AAElE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,2BAA2B;IAC3B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,qCAAqC;IACrC,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,yFAAyF;AACzF,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,kBAAkB,EACvB,OAAO,EAAE,MAAM,GACd,kBAAkB,GAAG,SAAS,CAgBhC;AAED,eAAO,MAAM,eAAe,oBAAmC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/pool/driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAgB,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAA2B,MAAM,4BAA4B,CAAC;AACpF,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,EAEnB,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,IAAI,eAAe,EAC/B,OAAO,EAEP,SAAS,EACT,SAAS,EACT,SAAS,EAGV,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/pool/driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAgB,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAA2B,MAAM,4BAA4B,CAAC;AACpF,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,EAEnB,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,IAAI,eAAe,EAC/B,OAAO,EAEP,SAAS,EACT,SAAS,EACT,SAAS,EAGV,MAAM,sBAAsB,CAAC;AAgG9B,qBAAa,YAAa,YAAW,eAAe;IAOtC,OAAO,CAAC,QAAQ,CAAC,UAAU;IANvC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyD;IACjF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsE;IAC9F,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA+B;IAChE,0FAA0F;IAC1F,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA8B;gBAEpC,UAAU,EAAE,cAAc;IAmDhD,YAAY,CAAC,GAAG,EAAE,SAAS,CAAC,kBAAkB,CAAC,EAAE,GAAG,EAAE,aAAa,GAAG,YAAY;IAQlF,YAAY,CACjB,GAAG,EAAE,SAAS,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,EAC3C,GAAG,EAAE,aAAa,GACjB,YAAY;IAYF,WAAW,CACtB,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,mBAAmB,CAAC;IAiBlB,aAAa,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC;IAM9E,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAM9D,kBAAkB,CAC7B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,yBAAyB,CAAC,SAAS,CAAC,GAC5C,OAAO,CAAC,0BAA0B,CAAC;IA6BzB,eAAe,CAC1B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,oBAAoB,CAAC;IAUnB,QAAQ,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;IAKpD,OAAO,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAK1D,OAAO,CAClB,MAAM,EAAE,YAAY,EACpB,aAAa,EAAE,MAAM,EAAE,EACvB,KAAK,CAAC,EAAE,UAAU,GACjB,OAAO,CAAC,YAAY,EAAE,CAAC;CAM3B;AA+CD,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAI/E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-middle-layer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"description": "Pl Middle Layer",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -29,18 +29,18 @@
|
|
|
29
29
|
"yaml": "^2.6.0",
|
|
30
30
|
"zod": "^3.23.8",
|
|
31
31
|
"@milaboratories/resolve-helper": "^1.0.1",
|
|
32
|
-
"@milaboratories/pl-client": "^2.6.0",
|
|
33
32
|
"@platforma-sdk/block-tools": "^2.3.25",
|
|
33
|
+
"@milaboratories/pl-client": "^2.6.0",
|
|
34
34
|
"@milaboratories/pl-drivers": "^1.3.19",
|
|
35
35
|
"@milaboratories/pl-model-common": "^1.6.2",
|
|
36
|
-
"@milaboratories/pl-model-middle-layer": "^1.5.9",
|
|
37
36
|
"@milaboratories/computable": "^2.3.1",
|
|
38
|
-
"@platforma-sdk/model": "^1.10.12",
|
|
39
|
-
"@milaboratories/ts-helpers": "^1.1.1",
|
|
40
37
|
"@milaboratories/pl-tree": "^1.4.14",
|
|
38
|
+
"@platforma-sdk/model": "^1.10.12",
|
|
41
39
|
"@platforma-sdk/workflow-tengo": "2.2.1",
|
|
42
40
|
"@milaboratories/pl-config": "^1.3.1",
|
|
43
|
-
"@milaboratories/
|
|
41
|
+
"@milaboratories/ts-helpers": "^1.1.1",
|
|
42
|
+
"@milaboratories/pl-local": "^1.7.1",
|
|
43
|
+
"@milaboratories/pl-model-middle-layer": "^1.5.9"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"typescript": "~5.5.4",
|
|
@@ -14,7 +14,6 @@ import canonicalize from 'canonicalize';
|
|
|
14
14
|
import { BlockContextAny } from '../middle_layer/block_ctx';
|
|
15
15
|
import { MiddleLayerDriverKit } from '../middle_layer/driver_kit';
|
|
16
16
|
import { NonKeyCtxFields, toCfgContext } from '../middle_layer/block_ctx_unsafe';
|
|
17
|
-
import { LogOutputStatus } from '../middle_layer/util';
|
|
18
17
|
|
|
19
18
|
/** Addresses pending subroutines inside the stack */
|
|
20
19
|
type SubroutineKey = symbol;
|
package/src/js_render/index.ts
CHANGED
|
@@ -11,9 +11,11 @@ export function computableFromRF(
|
|
|
11
11
|
ctx: BlockContextAny,
|
|
12
12
|
fh: ConfigRenderLambda,
|
|
13
13
|
code: Code,
|
|
14
|
+
configKey: string,
|
|
14
15
|
ops: Partial<ComputableRenderingOps> = {}
|
|
15
16
|
): Computable<unknown> {
|
|
16
|
-
|
|
17
|
+
// adding configKey to reload all outputs on block-pack update
|
|
18
|
+
const key = `${ctx.blockId}#lambda#${configKey}#${fh.handle}`;
|
|
17
19
|
ops = { ...ops, key };
|
|
18
20
|
if (ops.mode === undefined && fh.retentive === true) ops.mode = 'StableOnlyRetentive';
|
|
19
21
|
return Computable.makeRaw((cCtx) => {
|
|
@@ -9,6 +9,7 @@ import { BlockPackInfo } from '../model/block_pack';
|
|
|
9
9
|
import { extractConfig, TypedConfigOrConfigLambda } from '@platforma-sdk/model';
|
|
10
10
|
import { constructBlockContext } from './block_ctx';
|
|
11
11
|
import { computableFromCfgOrRF, isActive } from './render';
|
|
12
|
+
import { getBlockPackInfo } from './util';
|
|
12
13
|
|
|
13
14
|
/** Returns derived general project state form the project resource */
|
|
14
15
|
export function activeConfigs(
|
|
@@ -21,21 +22,10 @@ export function activeConfigs(
|
|
|
21
22
|
const structure = notEmpty(prj.getKeyValueAsJson<ProjectStructure>(ProjectStructureKey));
|
|
22
23
|
const ret: Computable<unknown>[] = [];
|
|
23
24
|
for (const { id, renderingMode } of allBlocks(structure)) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
{
|
|
27
|
-
field: projectFieldName(id, 'blockPack'),
|
|
28
|
-
assertFieldType: 'Dynamic',
|
|
29
|
-
errorIfFieldNotSet: true
|
|
30
|
-
},
|
|
31
|
-
{ field: Pl.HolderRefField, assertFieldType: 'Input', errorIfFieldNotFound: true }
|
|
32
|
-
);
|
|
25
|
+
const bp = getBlockPackInfo(prj, id);
|
|
26
|
+
if (bp === undefined) continue;
|
|
33
27
|
|
|
34
|
-
const
|
|
35
|
-
if (bpInfo?.config === undefined) continue;
|
|
36
|
-
|
|
37
|
-
const blockConf = extractConfig(bpInfo.config);
|
|
38
|
-
const activeOutputConfigs = Object.entries(blockConf.outputs)
|
|
28
|
+
const activeOutputConfigs = Object.entries(bp.cfg.outputs)
|
|
39
29
|
.map(([, cfg]) => cfg)
|
|
40
30
|
.filter((cfg) => isActive(cfg))
|
|
41
31
|
.map((cfg) => cfg as TypedConfigOrConfigLambda);
|
|
@@ -45,7 +35,9 @@ export function activeConfigs(
|
|
|
45
35
|
const blockCtx = constructBlockContext(prj.persist(), id);
|
|
46
36
|
|
|
47
37
|
for (const cfg of activeOutputConfigs)
|
|
48
|
-
ret.push(
|
|
38
|
+
ret.push(
|
|
39
|
+
Computable.wrapError(computableFromCfgOrRF(env, blockCtx, cfg, bp.cfg.code, bp.bpId))
|
|
40
|
+
);
|
|
49
41
|
}
|
|
50
42
|
|
|
51
43
|
return ret;
|
|
@@ -9,7 +9,7 @@ import { constructBlockContext, constructBlockContextArgsOnly } from './block_ct
|
|
|
9
9
|
import { blockArgsAuthorKey } from '../model/project_model';
|
|
10
10
|
import { ifNotUndef } from '../cfg_render/util';
|
|
11
11
|
import { MiddleLayerEnvironment } from './middle_layer';
|
|
12
|
-
import {
|
|
12
|
+
import { getBlockPackInfo } from './util';
|
|
13
13
|
import { AuthorMarker, BlockStateInternal } from '@milaboratories/pl-model-middle-layer';
|
|
14
14
|
import { computableFromCfgOrRF } from './render';
|
|
15
15
|
import { resourceIdToString } from '@milaboratories/pl-client';
|
|
@@ -55,14 +55,11 @@ export function blockOutputs(
|
|
|
55
55
|
const prj = c.accessor(projectEntry).node();
|
|
56
56
|
const ctx = constructBlockContext(projectEntry, blockId);
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return ifNotUndef(blockCfg, (cfg) => {
|
|
58
|
+
return ifNotUndef(getBlockPackInfo(prj, blockId), ({ cfg, bpId }) => {
|
|
61
59
|
const outputs: Record<string, Computable<any>> = {};
|
|
62
60
|
for (const [cellId, cellCfg] of Object.entries(cfg.outputs)) {
|
|
63
|
-
const computableOutput = computableFromCfgOrRF(env, ctx, cellCfg, cfg.code);
|
|
61
|
+
const computableOutput = computableFromCfgOrRF(env, ctx, cellCfg, cfg.code, bpId);
|
|
64
62
|
outputs[cellId] = Computable.wrapError(computableOutput);
|
|
65
|
-
console.log(`${cellId}: ${(computableOutput as any).___wrapped_kernel___.key}`);
|
|
66
63
|
}
|
|
67
64
|
return outputs;
|
|
68
65
|
});
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import { PathResult } from '@milaboratories/pl-drivers';
|
|
12
12
|
import { projectFieldName } from '../model/project_model';
|
|
13
13
|
import { BlockPackFrontendField } from '../mutator/block-pack/block_pack';
|
|
14
|
-
import {
|
|
14
|
+
import { getBlockPackInfo } from './util';
|
|
15
15
|
import { FrontendData } from '../model/frontend';
|
|
16
16
|
|
|
17
17
|
function kernel(
|
|
@@ -65,7 +65,7 @@ export function frontendData(
|
|
|
65
65
|
return Computable.make(
|
|
66
66
|
(ctx) => {
|
|
67
67
|
const prj = ctx.accessor(projectEntry).node();
|
|
68
|
-
const
|
|
68
|
+
const bp = getBlockPackInfo(prj, id);
|
|
69
69
|
const frontendEntry = prj
|
|
70
70
|
.traverse(
|
|
71
71
|
{
|
|
@@ -76,7 +76,10 @@ export function frontendData(
|
|
|
76
76
|
{ field: BlockPackFrontendField, assertFieldType: 'Input' }
|
|
77
77
|
)
|
|
78
78
|
?.persist();
|
|
79
|
-
return {
|
|
79
|
+
return {
|
|
80
|
+
path: frontendPathComputable(frontendEntry, env),
|
|
81
|
+
sdkVersion: bp?.cfg.sdkVersion
|
|
82
|
+
};
|
|
80
83
|
},
|
|
81
84
|
{ mode: 'StableOnlyLive' }
|
|
82
85
|
) as ComputableStableDefined<FrontendData>;
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
import { notEmpty } from '@milaboratories/ts-helpers';
|
|
15
15
|
import { allBlocks, productionGraph } from '../model/project_model_util';
|
|
16
16
|
import { MiddleLayerEnvironment } from './middle_layer';
|
|
17
|
-
import { Pl } from '@milaboratories/pl-client';
|
|
18
17
|
import {
|
|
19
18
|
AuthorMarker,
|
|
20
19
|
BlockCalculationStatus,
|
|
@@ -27,6 +26,7 @@ import { BlockPackInfo } from '../model/block_pack';
|
|
|
27
26
|
import { BlockSection, extractConfig } from '@platforma-sdk/model';
|
|
28
27
|
import { computableFromCfgOrRF } from './render';
|
|
29
28
|
import { NavigationStates } from './navigation_states';
|
|
29
|
+
import { getBlockPackInfo } from './util';
|
|
30
30
|
|
|
31
31
|
type BlockInfo = {
|
|
32
32
|
currentArguments: any;
|
|
@@ -52,13 +52,13 @@ type ProdState = {
|
|
|
52
52
|
|
|
53
53
|
/** Returns derived general project state form the project resource */
|
|
54
54
|
export function projectOverview(
|
|
55
|
-
|
|
55
|
+
prjEntry: PlTreeEntry,
|
|
56
56
|
navigationStates: NavigationStates,
|
|
57
57
|
env: MiddleLayerEnvironment
|
|
58
58
|
): ComputableStableDefined<ProjectOverview> {
|
|
59
59
|
return Computable.make(
|
|
60
60
|
(ctx) => {
|
|
61
|
-
const prj = ctx.accessor(
|
|
61
|
+
const prj = ctx.accessor(prjEntry).node();
|
|
62
62
|
|
|
63
63
|
const created = notEmpty(prj.getKeyValueAsJson<number>(ProjectCreatedTimestamp));
|
|
64
64
|
const lastModified = notEmpty(prj.getKeyValueAsJson<number>(ProjectLastModifiedTimestamp));
|
|
@@ -130,50 +130,42 @@ export function projectOverview(
|
|
|
130
130
|
else calculationStatus = info.prod.finished ? 'Done' : 'Running';
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
|
|
134
|
-
const blockPack = prj.traverse(
|
|
135
|
-
{
|
|
136
|
-
field: projectFieldName(id, 'blockPack'),
|
|
137
|
-
assertFieldType: 'Dynamic',
|
|
138
|
-
errorIfFieldNotSet: true
|
|
139
|
-
},
|
|
140
|
-
{ field: Pl.HolderRefField, assertFieldType: 'Input', errorIfFieldNotFound: true }
|
|
141
|
-
);
|
|
133
|
+
const bp = getBlockPackInfo(prj, id);
|
|
142
134
|
|
|
143
|
-
// sections
|
|
144
|
-
const bpInfo = blockPack?.getDataAsJson<BlockPackInfo>();
|
|
145
135
|
const { sections, title, inputsValid, sdkVersion } =
|
|
146
|
-
ifNotUndef(
|
|
147
|
-
const
|
|
148
|
-
const blockCtxArgsOnly = constructBlockContextArgsOnly(entry, id);
|
|
136
|
+
ifNotUndef(bp, ({ bpId, cfg, info }) => {
|
|
137
|
+
const blockCtxArgsOnly = constructBlockContextArgsOnly(prjEntry, id);
|
|
149
138
|
return {
|
|
150
139
|
sections: computableFromCfgOrRF(
|
|
151
140
|
env,
|
|
152
141
|
blockCtxArgsOnly,
|
|
153
|
-
|
|
154
|
-
|
|
142
|
+
cfg.sections,
|
|
143
|
+
cfg.code,
|
|
144
|
+
bpId
|
|
155
145
|
) as ComputableStableDefined<BlockSection[]>,
|
|
156
146
|
title: ifNotUndef(
|
|
157
|
-
|
|
147
|
+
cfg.title,
|
|
158
148
|
(title) =>
|
|
159
149
|
computableFromCfgOrRF(
|
|
160
150
|
env,
|
|
161
151
|
blockCtxArgsOnly,
|
|
162
152
|
title,
|
|
163
|
-
|
|
153
|
+
cfg.code,
|
|
154
|
+
bpId
|
|
164
155
|
) as ComputableStableDefined<string>
|
|
165
156
|
),
|
|
166
157
|
inputsValid: computableFromCfgOrRF(
|
|
167
158
|
env,
|
|
168
159
|
blockCtxArgsOnly,
|
|
169
|
-
|
|
170
|
-
|
|
160
|
+
cfg.inputsValid,
|
|
161
|
+
cfg.code,
|
|
162
|
+
bpId
|
|
171
163
|
) as ComputableStableDefined<boolean>,
|
|
172
|
-
sdkVersion:
|
|
164
|
+
sdkVersion: cfg.sdkVersion
|
|
173
165
|
};
|
|
174
166
|
}) || {};
|
|
175
167
|
|
|
176
|
-
const updatedBlockPack = ifNotUndef(
|
|
168
|
+
const updatedBlockPack = ifNotUndef(bp, ({ info }) =>
|
|
177
169
|
env.blockUpdateWatcher.get(info.source)
|
|
178
170
|
);
|
|
179
171
|
|
|
@@ -192,7 +184,7 @@ export function projectOverview(
|
|
|
192
184
|
exportsError: info.prod?.exportsError,
|
|
193
185
|
sections,
|
|
194
186
|
inputsValid,
|
|
195
|
-
currentBlockPack:
|
|
187
|
+
currentBlockPack: bp?.info?.source,
|
|
196
188
|
updatedBlockPack,
|
|
197
189
|
sdkVersion,
|
|
198
190
|
navigationState: navigationStates.getState(id)
|
|
@@ -16,10 +16,11 @@ export function computableFromCfgOrRF(
|
|
|
16
16
|
ctx: BlockContextAny,
|
|
17
17
|
cfgOrFh: TypedConfigOrConfigLambda,
|
|
18
18
|
code: Code | undefined,
|
|
19
|
+
configKey: string,
|
|
19
20
|
ops: Partial<ComputableRenderingOps> = {}
|
|
20
21
|
): Computable<unknown> {
|
|
21
22
|
if (isConfigLambda(cfgOrFh)) {
|
|
22
23
|
if (code === undefined) throw new Error('No code bundle.');
|
|
23
|
-
return computableFromRF(env, ctx, cfgOrFh, code, ops);
|
|
24
|
+
return computableFromRF(env, ctx, cfgOrFh, code, configKey, ops);
|
|
24
25
|
} else return computableFromCfg(env.driverKit, ctx, cfgOrFh, ops);
|
|
25
26
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SynchronizedTreeOps, SynchronizedTreeState } from '@milaboratories/pl-tree';
|
|
2
|
-
import { Computable } from '@milaboratories/computable';
|
|
2
|
+
import { Computable, ComputableRenderingOps } from '@milaboratories/computable';
|
|
3
3
|
|
|
4
4
|
export type TemporalSynchronizedTreeOps = Pick<
|
|
5
5
|
SynchronizedTreeOps,
|
|
@@ -13,4 +13,4 @@ export interface TreeAndComputable<T, ST extends T = T> {
|
|
|
13
13
|
|
|
14
14
|
/** Helper type to express a TreeAndComputable with computable
|
|
15
15
|
* with standard non-undefined-stable type signature. */
|
|
16
|
-
export type TreeAndComputableU<T> = TreeAndComputable<T | undefined, T>;
|
|
16
|
+
export type TreeAndComputableU<T> = TreeAndComputable<T | undefined, T>;
|
package/src/middle_layer/util.ts
CHANGED
|
@@ -5,19 +5,34 @@ import { ifNotUndef } from '../cfg_render/util';
|
|
|
5
5
|
import { BlockPackInfo } from '../model/block_pack';
|
|
6
6
|
import { BlockConfig, extractConfig } from '@platforma-sdk/model';
|
|
7
7
|
|
|
8
|
-
export
|
|
8
|
+
export type BlockPackInfoAndId = {
|
|
9
|
+
/** To be added to computable keys, to force reload on config change */
|
|
10
|
+
readonly bpId: string;
|
|
11
|
+
/** Full block-pack info */
|
|
12
|
+
readonly info: BlockPackInfo;
|
|
13
|
+
/** Config extracted from the info */
|
|
14
|
+
readonly cfg: BlockConfig;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** Returns block pack info along with string representation of block-pack resource id */
|
|
18
|
+
export function getBlockPackInfo(
|
|
19
|
+
prj: PlTreeNodeAccessor,
|
|
20
|
+
blockId: string
|
|
21
|
+
): BlockPackInfoAndId | undefined {
|
|
9
22
|
return ifNotUndef(
|
|
10
|
-
prj
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
prj.traverse(
|
|
24
|
+
{
|
|
25
|
+
field: projectFieldName(blockId, 'blockPack'),
|
|
26
|
+
assertFieldType: 'Dynamic',
|
|
27
|
+
errorIfFieldNotSet: true
|
|
28
|
+
},
|
|
29
|
+
{ field: Pl.HolderRefField, assertFieldType: 'Input', errorIfFieldNotFound: true }
|
|
30
|
+
),
|
|
31
|
+
(bpAcc) => {
|
|
32
|
+
const info = bpAcc.getDataAsJson<BlockPackInfo>()!;
|
|
33
|
+
const cfg = extractConfig(info.config);
|
|
34
|
+
return { bpId: bpAcc.resourceInfo.id.toString(), info, cfg };
|
|
35
|
+
}
|
|
21
36
|
);
|
|
22
37
|
}
|
|
23
38
|
|
package/src/pool/driver.ts
CHANGED
|
@@ -101,9 +101,15 @@ class PFrameHolder implements PFrameInternal.PFrameDataSource, Disposable {
|
|
|
101
101
|
};
|
|
102
102
|
|
|
103
103
|
public readonly resolveBlobContent = async (blobId: string): Promise<Uint8Array> => {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
try {
|
|
105
|
+
const computable = this.getOrCreateComputableForBlob(blobId);
|
|
106
|
+
const path = this.blobDriver.getLocalPath((await computable.awaitStableValue()).handle);
|
|
107
|
+
return await this.blobContentCache.forceFetch(path);
|
|
108
|
+
} catch (err: unknown) {
|
|
109
|
+
const error = JSON.stringify(err);
|
|
110
|
+
console.log(`resolveBlobContent catched error: ${error}`);
|
|
111
|
+
throw err;
|
|
112
|
+
}
|
|
107
113
|
};
|
|
108
114
|
|
|
109
115
|
[Symbol.dispose](): void {
|