@milaboratories/pl-middle-layer 1.67.4 → 1.67.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/block_registry/registry-v2-provider.d.ts +1 -3
- package/dist/block_registry/registry-v2-provider.d.ts.map +1 -1
- package/dist/block_registry/registry.d.ts +5 -9
- package/dist/block_registry/registry.d.ts.map +1 -1
- package/dist/block_registry/template_provider.d.ts +3 -5
- package/dist/block_registry/template_provider.d.ts.map +1 -1
- package/dist/block_registry/watcher.d.ts +4 -6
- package/dist/block_registry/watcher.d.ts.map +1 -1
- package/dist/block_registry/well_known_registries.d.ts +3 -5
- package/dist/block_registry/well_known_registries.d.ts.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/middle_layer/driver_kit.d.ts +3 -4
- package/dist/middle_layer/driver_kit.d.ts.map +1 -1
- package/dist/middle_layer/middle_layer.d.ts +4 -4
- package/dist/middle_layer/middle_layer.d.ts.map +1 -1
- package/dist/middle_layer/ops.d.ts +37 -26
- package/dist/middle_layer/ops.d.ts.map +1 -1
- package/dist/middle_layer/project.d.ts +5 -6
- package/dist/middle_layer/project.d.ts.map +1 -1
- package/dist/middle_layer/project_list.d.ts +5 -3
- package/dist/middle_layer/project_list.d.ts.map +1 -1
- package/dist/middle_layer/sharing_list.d.ts +3 -4
- package/dist/middle_layer/sharing_list.d.ts.map +1 -1
- package/dist/middle_layer/types.d.ts +1 -3
- package/dist/middle_layer/types.d.ts.map +1 -1
- package/dist/model/block_pack_spec.d.ts +13 -15
- package/dist/model/block_pack_spec.d.ts.map +1 -1
- package/dist/model/frontend.d.ts +1 -2
- package/dist/model/frontend.d.ts.map +1 -1
- package/dist/model/project_helper.d.ts +2 -4
- package/dist/model/project_helper.d.ts.map +1 -1
- package/dist/model/project_model.d.ts +12 -12
- package/dist/model/project_model.d.ts.map +1 -1
- package/dist/model/sharing_model.d.ts +24 -26
- package/dist/model/sharing_model.d.ts.map +1 -1
- package/dist/model/template_apply.d.ts +9 -8
- package/dist/model/template_apply.d.ts.map +1 -1
- package/dist/model/template_export.d.ts +2 -2
- package/dist/model/template_export.d.ts.map +1 -1
- package/dist/model/template_parser.d.ts +2 -4
- package/dist/model/template_parser.d.ts.map +1 -1
- package/dist/model/template_resolve.d.ts +10 -11
- package/dist/model/template_resolve.d.ts.map +1 -1
- package/dist/model/template_serializer.d.ts +6 -5
- package/dist/model/template_serializer.d.ts.map +1 -1
- package/dist/model/template_spec.d.ts +7 -9
- package/dist/model/template_spec.d.ts.map +1 -1
- package/dist/mutator/block-pack/block_pack.d.ts +2 -3
- package/dist/mutator/block-pack/block_pack.d.ts.map +1 -1
- package/dist/mutator/project.cjs +20 -3
- package/dist/mutator/project.cjs.map +1 -1
- package/dist/mutator/project.d.ts +4 -3
- package/dist/mutator/project.d.ts.map +1 -1
- package/dist/mutator/project.js +20 -3
- package/dist/mutator/project.js.map +1 -1
- package/dist/mutator/template/render_template.d.ts +1 -3
- package/dist/mutator/template/render_template.d.ts.map +1 -1
- package/dist/mutator/template/template_cache.d.ts +15 -16
- package/dist/mutator/template/template_cache.d.ts.map +1 -1
- package/dist/mutator/template/template_loading.d.ts +10 -12
- package/dist/mutator/template/template_loading.d.ts.map +1 -1
- package/dist/network_check/network_check.d.ts +3 -5
- package/dist/network_check/network_check.d.ts.map +1 -1
- package/dist/pool/data.d.ts +2 -4
- package/dist/pool/data.d.ts.map +1 -1
- package/dist/pool/driver.d.ts +6 -6
- package/dist/pool/driver.d.ts.map +1 -1
- package/dist/pool/index.d.ts +1 -0
- package/dist/pool/p_object_collection.d.ts +1 -3
- package/dist/pool/p_object_collection.d.ts.map +1 -1
- package/dist/pool/result_pool.d.ts +3 -1
- package/dist/worker/worker.d.ts +1 -1
- package/package.json +16 -16
- package/src/cfg_render/executor.test.ts +42 -60
- package/src/mutator/project.ts +27 -5
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { TemplateSpecPrepared } from "../../model/template_spec.js";
|
|
2
2
|
import { BlockPackSpecPrepared } from "../../model/block_pack_spec.js";
|
|
3
|
+
import "../../model/index.js";
|
|
3
4
|
import { AnyResourceRef, PlClient, PlTransaction, ResourceRef, SignedResourceId } from "@milaboratories/pl-client";
|
|
4
5
|
import { CompiledTemplateV3, TemplateData } from "@milaboratories/pl-model-backend";
|
|
5
|
-
|
|
6
6
|
//#region src/mutator/template/template_cache.d.ts
|
|
7
|
-
declare const TemplateCacheType: import("@milaboratories/pl-client").ResourceType;
|
|
8
|
-
declare const TemplateCacheFieldName = "__templateCache";
|
|
7
|
+
export declare const TemplateCacheType: import("@milaboratories/pl-client").ResourceType;
|
|
8
|
+
export declare const TemplateCacheFieldName = "__templateCache";
|
|
9
9
|
/** @internal exported for testing */
|
|
10
|
-
declare const GC_ACCESS_THRESHOLD = 30;
|
|
10
|
+
export declare const GC_ACCESS_THRESHOLD = 30;
|
|
11
11
|
/** @internal exported for testing */
|
|
12
|
-
declare const GC_MAX_ENTRIES = 3000;
|
|
12
|
+
export declare const GC_MAX_ENTRIES = 3000;
|
|
13
13
|
/** @internal exported for testing */
|
|
14
|
-
declare const ACCESS_COUNT_KEY = "_accessCount";
|
|
14
|
+
export declare const ACCESS_COUNT_KEY = "_accessCount";
|
|
15
15
|
/** @internal exported for testing */
|
|
16
|
-
declare const ACCESS_KEY_PREFIX = "access_";
|
|
17
|
-
type TemplateCacheStat = {
|
|
16
|
+
export declare const ACCESS_KEY_PREFIX = "access_";
|
|
17
|
+
export type TemplateCacheStat = {
|
|
18
18
|
totalMs: number;
|
|
19
19
|
flattenMs: number;
|
|
20
20
|
cacheInitMs: number;
|
|
@@ -38,13 +38,13 @@ interface CacheableNode {
|
|
|
38
38
|
childHashes: string[];
|
|
39
39
|
}
|
|
40
40
|
/** Flatten template tree into a topologically ordered list of cacheable nodes (leaves first). */
|
|
41
|
-
declare function flattenTemplateTree(data: TemplateData | CompiledTemplateV3): CacheableNode[];
|
|
41
|
+
export declare function flattenTemplateTree(data: TemplateData | CompiledTemplateV3): CacheableNode[];
|
|
42
42
|
/** Clear the in-memory cacheRid entry (call on errors referencing the cache resource). */
|
|
43
|
-
declare function invalidateTemplateCacheId(pl: PlClient): void;
|
|
43
|
+
export declare function invalidateTemplateCacheId(pl: PlClient): void;
|
|
44
44
|
/** Find or create the TemplateCache/1 resource on user root. */
|
|
45
|
-
declare function getOrCreateTemplateCache(pl: PlClient): Promise<SignedResourceId>;
|
|
45
|
+
export declare function getOrCreateTemplateCache(pl: PlClient): Promise<SignedResourceId>;
|
|
46
46
|
/** Remove the template cache from user root. */
|
|
47
|
-
declare function dropTemplateCache(pl: PlClient): Promise<void>;
|
|
47
|
+
export declare function dropTemplateCache(pl: PlClient): Promise<void>;
|
|
48
48
|
/**
|
|
49
49
|
* Run count-based garbage collection on the template cache.
|
|
50
50
|
* Evicts least-recently-used entries when the cache exceeds maxEntries.
|
|
@@ -53,14 +53,14 @@ declare function dropTemplateCache(pl: PlClient): Promise<void>;
|
|
|
53
53
|
* @internal exported for testing (maxEntries parameter allows low thresholds in tests)
|
|
54
54
|
* @returns true if entries were evicted
|
|
55
55
|
*/
|
|
56
|
-
declare function runGc(pl: PlClient, cacheRid: SignedResourceId, maxEntries?: number): Promise<boolean>;
|
|
56
|
+
export declare function runGc(pl: PlClient, cacheRid: SignedResourceId, maxEntries?: number): Promise<boolean>;
|
|
57
57
|
/**
|
|
58
58
|
* Materialize a template tree via the cache.
|
|
59
59
|
* Manages its own transactions internally — do NOT call inside an existing tx.
|
|
60
60
|
*
|
|
61
61
|
* @returns concrete SignedResourceId of the root template
|
|
62
62
|
*/
|
|
63
|
-
declare function loadTemplateCached(pl: PlClient, spec: TemplateSpecPrepared, options?: {
|
|
63
|
+
export declare function loadTemplateCached(pl: PlClient, spec: TemplateSpecPrepared, options?: {
|
|
64
64
|
cacheResourceId?: SignedResourceId;
|
|
65
65
|
}): Promise<SignedResourceId>;
|
|
66
66
|
/**
|
|
@@ -68,9 +68,8 @@ declare function loadTemplateCached(pl: PlClient, spec: TemplateSpecPrepared, op
|
|
|
68
68
|
* Returns a copy of the spec with the template replaced by a cached reference.
|
|
69
69
|
* If the template is already cached, returns the spec unchanged.
|
|
70
70
|
*/
|
|
71
|
-
declare function cacheBlockPackTemplate(pl: PlClient, spec: BlockPackSpecPrepared, options?: {
|
|
71
|
+
export declare function cacheBlockPackTemplate(pl: PlClient, spec: BlockPackSpecPrepared, options?: {
|
|
72
72
|
cacheResourceId?: SignedResourceId;
|
|
73
73
|
}): Promise<BlockPackSpecPrepared>;
|
|
74
74
|
//#endregion
|
|
75
|
-
export { ACCESS_COUNT_KEY, ACCESS_KEY_PREFIX, GC_ACCESS_THRESHOLD, GC_MAX_ENTRIES, TemplateCacheFieldName, TemplateCacheStat, TemplateCacheType, cacheBlockPackTemplate, dropTemplateCache, flattenTemplateTree, getOrCreateTemplateCache, invalidateTemplateCacheId, loadTemplateCached, runGc };
|
|
76
75
|
//# sourceMappingURL=template_cache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template_cache.d.ts","names":[],"sources":["../../../src/mutator/template/template_cache.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"template_cache.d.ts","names":[],"sources":["../../../src/mutator/template/template_cache.ts"],"mappings":";;;;;;qBAqCa,uDAAiB;qBAEjB;;qBAGA;;qBAEA;;qBAEA;;qBAEA;YAED;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAoBQ;;EAER;;;EAGA,SAAS,IAAI,eAAe,WAAW,oBAAoB,oBAAoB;;EAE/E;;;wBA2Vc,oBAAoB,MAAM,eAAe,qBAAqB;;wBAY9D,0BAA0B,IAAI;;wBAKxB,yBAAyB,IAAI,WAAW,QAAQ;;wBA+BhD,kBAAkB,IAAI,WAAW;;;;;;;;;wBAoBjC,MACpB,IAAI,UACJ,UAAU,kBACV,sBACC;;;;;;;wBA8LmB,mBACpB,IAAI,UACJ,MAAM,sBACN;EAAY,kBAAkB;IAC7B,QAAQ;;;;;;wBAiFW,uBACpB,IAAI,UACJ,MAAM,uBACN;EAAY,kBAAkB;IAC7B,QAAQ"}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { TemplateSpecAny, TemplateSpecPrepared } from "../../model/template_spec.js";
|
|
2
2
|
import { AnyRef, PlTransaction, ResourceType } from "@milaboratories/pl-client";
|
|
3
|
-
|
|
4
3
|
//#region src/mutator/template/template_loading.d.ts
|
|
5
|
-
declare const TengoTemplateGet: ResourceType;
|
|
6
|
-
declare const TengoTemplateGetRegistry = "registry";
|
|
7
|
-
declare const TengoTemplateGetTemplateURI = "templateURI";
|
|
8
|
-
declare const TengoTemplateGetTemplate = "template";
|
|
9
|
-
declare const TengoTemplatePack: ResourceType;
|
|
10
|
-
declare const TengoTemplatePackConvert: ResourceType;
|
|
11
|
-
declare const TengoTemplatePackConvertTemplatePack = "templatePack";
|
|
12
|
-
declare const TengoTemplatePackConvertTemplate = "template";
|
|
13
|
-
declare function prepareTemplateSpec(tpl: TemplateSpecAny): Promise<TemplateSpecPrepared>;
|
|
14
|
-
declare function loadTemplate(tx: PlTransaction, spec: TemplateSpecPrepared): AnyRef;
|
|
4
|
+
export declare const TengoTemplateGet: ResourceType;
|
|
5
|
+
export declare const TengoTemplateGetRegistry = "registry";
|
|
6
|
+
export declare const TengoTemplateGetTemplateURI = "templateURI";
|
|
7
|
+
export declare const TengoTemplateGetTemplate = "template";
|
|
8
|
+
export declare const TengoTemplatePack: ResourceType;
|
|
9
|
+
export declare const TengoTemplatePackConvert: ResourceType;
|
|
10
|
+
export declare const TengoTemplatePackConvertTemplatePack = "templatePack";
|
|
11
|
+
export declare const TengoTemplatePackConvertTemplate = "template";
|
|
12
|
+
export declare function prepareTemplateSpec(tpl: TemplateSpecAny): Promise<TemplateSpecPrepared>;
|
|
13
|
+
export declare function loadTemplate(tx: PlTransaction, spec: TemplateSpecPrepared): AnyRef;
|
|
15
14
|
//#endregion
|
|
16
|
-
export { TengoTemplateGet, TengoTemplateGetRegistry, TengoTemplateGetTemplate, TengoTemplateGetTemplateURI, TengoTemplatePack, TengoTemplatePackConvert, TengoTemplatePackConvertTemplate, TengoTemplatePackConvertTemplatePack, loadTemplate, prepareTemplateSpec };
|
|
17
15
|
//# sourceMappingURL=template_loading.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template_loading.d.ts","names":[],"sources":["../../../src/mutator/template/template_loading.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"template_loading.d.ts","names":[],"sources":["../../../src/mutator/template/template_loading.ts"],"mappings":";;;qBAea,kBAAkB;qBAClB;qBACA;qBACA;qBAEA,mBAAmB;qBACnB,0BAA0B;qBAI1B;qBACA;wBAES,oBAAoB,KAAK,kBAAkB,QAAQ;wBAgCzD,aAAa,IAAI,eAAe,MAAM,uBAAuB"}
|
|
@@ -2,9 +2,8 @@ import { Dispatcher } from "undici";
|
|
|
2
2
|
import { MiLogger, Signer } from "@milaboratories/ts-helpers";
|
|
3
3
|
import { PlClient, PlClientConfig } from "@milaboratories/pl-client";
|
|
4
4
|
import { ClientDownload, ClientUpload, LsDriver } from "@milaboratories/pl-drivers";
|
|
5
|
-
|
|
6
5
|
//#region src/network_check/network_check.d.ts
|
|
7
|
-
interface CheckNetworkOpts {
|
|
6
|
+
export interface CheckNetworkOpts {
|
|
8
7
|
/** Signal to abort all network checks. */
|
|
9
8
|
signal?: AbortSignal;
|
|
10
9
|
/** Platforma Backend pings options. */
|
|
@@ -40,8 +39,8 @@ interface CheckNetworkOpts {
|
|
|
40
39
|
/** Checks connectivity to Platforma Backend, to block registry
|
|
41
40
|
* and to auto-update CDN,
|
|
42
41
|
* and generates a string report. */
|
|
43
|
-
declare function checkNetwork(plCredentials: string, plUser: string | undefined, plPassword: string | undefined, optsOverrides?: Partial<CheckNetworkOpts>): Promise<string>;
|
|
44
|
-
declare function initNetworkCheck(plCredentials: string, plUser: string | undefined, plPassword: string | undefined, optsOverrides?: Partial<CheckNetworkOpts>): Promise<{
|
|
42
|
+
export declare function checkNetwork(plCredentials: string, plUser: string | undefined, plPassword: string | undefined, optsOverrides?: Partial<CheckNetworkOpts>): Promise<string>;
|
|
43
|
+
export declare function initNetworkCheck(plCredentials: string, plUser: string | undefined, plPassword: string | undefined, optsOverrides?: Partial<CheckNetworkOpts>): Promise<{
|
|
45
44
|
logger: MiLogger;
|
|
46
45
|
plConfig: PlClientConfig;
|
|
47
46
|
signer: Signer;
|
|
@@ -54,5 +53,4 @@ declare function initNetworkCheck(plCredentials: string, plUser: string | undefi
|
|
|
54
53
|
terminate: () => Promise<void>;
|
|
55
54
|
}>;
|
|
56
55
|
//#endregion
|
|
57
|
-
export { CheckNetworkOpts, checkNetwork, initNetworkCheck };
|
|
58
56
|
//# sourceMappingURL=network_check.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network_check.d.ts","names":[],"sources":["../../src/network_check/network_check.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"network_check.d.ts","names":[],"sources":["../../src/network_check/network_check.ts"],"mappings":";;;;;iBAqEiB;;EAEf,SAAS;;EAGT;EACA;EACA;;EAGA;;EAGA;EACA;EACA;EACA;EACA;EACA;;EAGA;EACA;EACA;;EAGA;;EAGA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;wBAMoB,aACpB,uBACA,4BACA,gCACA,gBAAe,QAAQ,oBACtB;wBA2FmB,iBACpB,uBACA,4BACA,gCACA,gBAAe,QAAQ,oBACtB;EACD,QAAQ;EACR,UAAU;EACV,QAAQ;EACR,QAAQ;EACR,gBAAgB;EAChB,kBAAkB;EAClB,UAAU;EACV,YAAY;EACZ,KAAK;EACL,iBAAiB"}
|
package/dist/pool/data.d.ts
CHANGED
|
@@ -3,10 +3,8 @@ import { PFrameInternal } from "@milaboratories/pl-model-middle-layer";
|
|
|
3
3
|
import { ResourceType, SignedResourceId } from "@milaboratories/pl-client";
|
|
4
4
|
import { PlTreeNodeAccessor } from "@milaboratories/pl-tree";
|
|
5
5
|
import { OnDemandBlobResourceSnapshot } from "@milaboratories/pl-drivers";
|
|
6
|
-
|
|
7
6
|
//#region src/pool/data.d.ts
|
|
8
|
-
declare function deriveGlobalPObjectId(blockId: string, exportName: string): PObjectId;
|
|
9
|
-
declare function deriveLocalPObjectId(resolvePath: string[], outputName: string): PObjectId;
|
|
7
|
+
export declare function deriveGlobalPObjectId(blockId: string, exportName: string): PObjectId;
|
|
8
|
+
export declare function deriveLocalPObjectId(resolvePath: string[], outputName: string): PObjectId;
|
|
10
9
|
//#endregion
|
|
11
|
-
export { deriveGlobalPObjectId, deriveLocalPObjectId };
|
|
12
10
|
//# sourceMappingURL=data.d.ts.map
|
package/dist/pool/data.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","names":[],"sources":["../../src/pool/data.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"data.d.ts","names":[],"sources":["../../src/pool/data.ts"],"mappings":";;;;;;wBA6UgB,sBAAsB,iBAAiB,qBAAqB;wBAI5D,qBAAqB,uBAAuB,qBAAqB"}
|
package/dist/pool/driver.d.ts
CHANGED
|
@@ -2,19 +2,19 @@ import { PColumnDataUniversal } from "@platforma-sdk/model";
|
|
|
2
2
|
import { PFrameInternal } from "@milaboratories/pl-model-middle-layer";
|
|
3
3
|
import { PlTreeNodeAccessor } from "@milaboratories/pl-tree";
|
|
4
4
|
import { DownloadDriver } from "@milaboratories/pl-drivers";
|
|
5
|
+
import "@milaboratories/helpers";
|
|
5
6
|
import { AbstractInternalPFrameDriver, AbstractPFrameDriverOps } from "@milaboratories/pf-driver";
|
|
6
|
-
|
|
7
7
|
//#region src/pool/driver.d.ts
|
|
8
|
-
interface InternalPFrameDriver extends AbstractInternalPFrameDriver<PColumnDataUniversal<PlTreeNodeAccessor>> {}
|
|
9
|
-
type PFrameDriverOps = AbstractPFrameDriverOps & {
|
|
10
|
-
/** Port to run parquet HTTP server on. */
|
|
8
|
+
export interface InternalPFrameDriver extends AbstractInternalPFrameDriver<PColumnDataUniversal<PlTreeNodeAccessor>> {}
|
|
9
|
+
export type PFrameDriverOps = AbstractPFrameDriverOps & {
|
|
10
|
+
/** Port to run parquet HTTP server on. */
|
|
11
|
+
parquetServerPort: number;
|
|
11
12
|
};
|
|
12
13
|
/**
|
|
13
14
|
* Tuning for the persistent parquet blob cache, minus its filesystem path (which
|
|
14
15
|
* is supplied separately - see {@link createPFrameDriver}'s `cachePath`). Carries
|
|
15
16
|
* only the size/eviction knobs of {@link PFrameInternal.CacheConfig}.
|
|
16
17
|
*/
|
|
17
|
-
type ParquetCacheOps = Omit<PFrameInternal.CacheConfig, "cachePath">;
|
|
18
|
+
export type ParquetCacheOps = Omit<PFrameInternal.CacheConfig, "cachePath">;
|
|
18
19
|
//#endregion
|
|
19
|
-
export { InternalPFrameDriver, PFrameDriverOps, ParquetCacheOps };
|
|
20
20
|
//# sourceMappingURL=driver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","names":[],"sources":["../../src/pool/driver.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"driver.d.ts","names":[],"sources":["../../src/pool/driver.ts"],"mappings":";;;;;;;iBA4SiB,6BAA6B,6BAC5C,qBAAqB;YAGX,kBAAkB;;EAE5B;;;;;;;YAaU,kBAAkB,KAAK,eAAe"}
|
package/dist/pool/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { PObject } from "@platforma-sdk/model";
|
|
2
2
|
import { PlTreeNodeAccessor } from "@milaboratories/pl-tree";
|
|
3
|
-
|
|
4
3
|
//#region src/pool/p_object_collection.d.ts
|
|
5
|
-
declare function parseFinalPObjectCollection(node: PlTreeNodeAccessor, errorOnUnknownField: boolean | undefined, prefix: string | undefined, resolvePath: string[]): Record<string, PObject<PlTreeNodeAccessor>>;
|
|
4
|
+
export declare function parseFinalPObjectCollection(node: PlTreeNodeAccessor, errorOnUnknownField: boolean | undefined, prefix: string | undefined, resolvePath: string[]): Record<string, PObject<PlTreeNodeAccessor>>;
|
|
6
5
|
//#endregion
|
|
7
|
-
export { parseFinalPObjectCollection };
|
|
8
6
|
//# sourceMappingURL=p_object_collection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p_object_collection.d.ts","names":[],"sources":["../../src/pool/p_object_collection.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"p_object_collection.d.ts","names":[],"sources":["../../src/pool/p_object_collection.ts"],"mappings":";;;wBA+FgB,4BACd,MAAM,oBACN,0CACA,4BACA,wBACC,eAAe,QAAQ"}
|
package/dist/worker/worker.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-middle-layer",
|
|
3
|
-
"version": "1.67.
|
|
3
|
+
"version": "1.67.6",
|
|
4
4
|
"description": "Pl Middle Layer",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -30,34 +30,34 @@
|
|
|
30
30
|
"utility-types": "^3.11.0",
|
|
31
31
|
"yaml": "^2.8.0",
|
|
32
32
|
"zod": "~3.25.76",
|
|
33
|
-
"@milaboratories/columns-collection-driver": "0.2.4",
|
|
34
33
|
"@milaboratories/computable": "2.9.8",
|
|
34
|
+
"@milaboratories/pl-drivers": "1.16.16",
|
|
35
35
|
"@milaboratories/pf-driver": "1.9.1",
|
|
36
|
-
"@milaboratories/pl-deployments": "3.0.16",
|
|
37
|
-
"@milaboratories/helpers": "1.14.5",
|
|
38
|
-
"@milaboratories/pl-client": "3.14.7",
|
|
39
36
|
"@milaboratories/pf-spec-driver": "1.5.1",
|
|
37
|
+
"@milaboratories/pl-client": "3.14.7",
|
|
38
|
+
"@milaboratories/columns-collection-driver": "0.2.4",
|
|
39
|
+
"@milaboratories/pl-deployments": "3.0.16",
|
|
40
40
|
"@milaboratories/pl-errors": "1.4.36",
|
|
41
|
-
"@milaboratories/pl-drivers": "1.16.16",
|
|
42
|
-
"@milaboratories/pl-model-common": "1.48.0",
|
|
43
|
-
"@milaboratories/pl-model-backend": "1.4.21",
|
|
44
|
-
"@milaboratories/pl-model-middle-layer": "1.32.0",
|
|
45
41
|
"@milaboratories/pl-http": "1.2.4",
|
|
42
|
+
"@milaboratories/pl-model-backend": "1.4.21",
|
|
43
|
+
"@milaboratories/pl-model-common": "1.48.0",
|
|
46
44
|
"@milaboratories/pl-tree": "1.13.7",
|
|
47
|
-
"@milaboratories/
|
|
48
|
-
"@
|
|
49
|
-
"@platforma-sdk/block-tools": "2.14.3",
|
|
45
|
+
"@milaboratories/pl-model-middle-layer": "1.32.0",
|
|
46
|
+
"@milaboratories/helpers": "1.14.5",
|
|
50
47
|
"@milaboratories/ts-helpers": "1.8.6",
|
|
51
|
-
"@
|
|
48
|
+
"@milaboratories/resolve-helper": "1.1.3",
|
|
49
|
+
"@platforma-sdk/workflow-tengo": "6.8.3",
|
|
50
|
+
"@platforma-sdk/model": "1.83.0",
|
|
51
|
+
"@platforma-sdk/block-tools": "2.14.3"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/node": "~24.5.2",
|
|
55
55
|
"@types/semver": "^7.7.0",
|
|
56
56
|
"@vitest/coverage-istanbul": "^4.1.3",
|
|
57
|
-
"typescript": "
|
|
57
|
+
"typescript": "7.0.2",
|
|
58
58
|
"vitest": "^4.1.3",
|
|
59
|
-
"@milaboratories/
|
|
60
|
-
"@milaboratories/
|
|
59
|
+
"@milaboratories/build-configs": "2.0.1",
|
|
60
|
+
"@milaboratories/ts-builder": "1.7.1",
|
|
61
61
|
"@milaboratories/ts-configs": "1.4.0"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
@@ -1,64 +1,52 @@
|
|
|
1
1
|
import { Computable } from "@milaboratories/computable";
|
|
2
2
|
import { field, Pl, TestHelpers } from "@milaboratories/pl-client";
|
|
3
3
|
import { SynchronizedTreeState } from "@milaboratories/pl-tree";
|
|
4
|
-
import {
|
|
5
|
-
Args,
|
|
6
|
-
BlockConfigGeneric,
|
|
7
|
-
BlockModel,
|
|
8
|
-
getJsonField,
|
|
9
|
-
getResourceField,
|
|
10
|
-
getResourceValueAsJson,
|
|
11
|
-
InferOutputType,
|
|
12
|
-
isolate,
|
|
13
|
-
It,
|
|
14
|
-
MainOutputs,
|
|
15
|
-
makeObject,
|
|
16
|
-
mapArrayValues,
|
|
17
|
-
PlResourceEntry,
|
|
18
|
-
TypedConfig,
|
|
19
|
-
} from "@platforma-sdk/model";
|
|
4
|
+
import type { Cfg, PlResourceEntry } from "@platforma-sdk/model";
|
|
20
5
|
import { expect, test } from "vitest";
|
|
21
6
|
import { MiddleLayerDriverKit } from "../middle_layer/driver_kit";
|
|
22
7
|
import { computableFromCfgUnsafe } from "./executor";
|
|
23
8
|
|
|
9
|
+
// The SDK no longer ships a builder for these configs — it went away with the v1/v2
|
|
10
|
+
// block model — but the executor still has to render configs of blocks published
|
|
11
|
+
// before that. So the fixtures below are spelled out as plain `Cfg` trees.
|
|
12
|
+
|
|
13
|
+
const ctxVar = (variable: string): Cfg => ({ type: "GetFromCtx", variable });
|
|
14
|
+
const imm = (value: unknown): Cfg => ({ type: "Immediate", value });
|
|
15
|
+
const jsonField = (source: Cfg, field: Cfg): Cfg => ({ type: "GetJsonField", source, field });
|
|
16
|
+
const resourceField = (source: Cfg, field: Cfg): Cfg => ({
|
|
17
|
+
type: "GetResourceField",
|
|
18
|
+
source,
|
|
19
|
+
field,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const Args = ctxVar("$args");
|
|
23
|
+
const It = ctxVar("$it");
|
|
24
|
+
const MainOutputs = ctxVar("$prod");
|
|
25
|
+
|
|
24
26
|
test("local cfg test (no pl)", async () => {
|
|
25
27
|
const args = {
|
|
26
28
|
theC: "c",
|
|
27
29
|
a: { c: "hi" },
|
|
28
30
|
b: ["a", "b", "c"],
|
|
29
31
|
};
|
|
30
|
-
const theCValue =
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
).config as BlockConfigGeneric;
|
|
32
|
+
const theCValue = jsonField(Args, imm("theC"));
|
|
33
|
+
|
|
34
|
+
const outputs = {
|
|
35
|
+
out1: jsonField(jsonField(Args, imm("a")), theCValue),
|
|
36
|
+
out2: {
|
|
37
|
+
type: "MapArrayValues",
|
|
38
|
+
source: jsonField(Args, imm("b")),
|
|
39
|
+
itVar: "$it",
|
|
40
|
+
mapping: { type: "Isolate", cfg: { type: "MakeObject", template: { theField: It } } },
|
|
41
|
+
},
|
|
42
|
+
} satisfies Record<string, Cfg>;
|
|
42
43
|
|
|
43
44
|
const ctx = { $args: args };
|
|
44
45
|
|
|
45
|
-
const computable1 = computableFromCfgUnsafe(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
);
|
|
50
|
-
const out1 = (await computable1.getValue()) as InferOutputType<
|
|
51
|
-
(typeof cfg.outputs)["out1"],
|
|
52
|
-
typeof args,
|
|
53
|
-
unknown
|
|
54
|
-
>;
|
|
55
|
-
expect(out1).toEqual("hi");
|
|
56
|
-
|
|
57
|
-
const computable2 = computableFromCfgUnsafe(
|
|
58
|
-
{} as MiddleLayerDriverKit,
|
|
59
|
-
ctx,
|
|
60
|
-
cfg.outputs["out2"] as TypedConfig,
|
|
61
|
-
);
|
|
46
|
+
const computable1 = computableFromCfgUnsafe({} as MiddleLayerDriverKit, ctx, outputs.out1);
|
|
47
|
+
expect(await computable1.getValue()).toEqual("hi");
|
|
48
|
+
|
|
49
|
+
const computable2 = computableFromCfgUnsafe({} as MiddleLayerDriverKit, ctx, outputs.out2);
|
|
62
50
|
const out2 = await computable2.getValue();
|
|
63
51
|
expect(out2).toStrictEqual([{ theField: "a" }, { theField: "b" }, { theField: "c" }]);
|
|
64
52
|
});
|
|
@@ -71,20 +59,14 @@ test("cfg test with pl, simple", async () => {
|
|
|
71
59
|
const input = {
|
|
72
60
|
theC: "c",
|
|
73
61
|
};
|
|
74
|
-
const theCValue =
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
getResourceValueAsJson<TestResourceValue>()(getResourceField(MainOutputs, theCValue)),
|
|
83
|
-
"someField",
|
|
84
|
-
),
|
|
85
|
-
)
|
|
86
|
-
.done() as any
|
|
87
|
-
).config as BlockConfigGeneric;
|
|
62
|
+
const theCValue = jsonField(Args, imm("theC"));
|
|
63
|
+
|
|
64
|
+
const outputs = {
|
|
65
|
+
out1: jsonField(
|
|
66
|
+
{ type: "GetResourceValueAsJson", source: resourceField(MainOutputs, theCValue) },
|
|
67
|
+
imm("someField"),
|
|
68
|
+
),
|
|
69
|
+
} satisfies Record<string, Cfg>;
|
|
88
70
|
|
|
89
71
|
await TestHelpers.withTempRoot(async (pl) => {
|
|
90
72
|
const tree = await SynchronizedTreeState.init(pl, pl.clientRoot, {
|
|
@@ -100,7 +82,7 @@ test("cfg test with pl, simple", async () => {
|
|
|
100
82
|
const computable: Computable<unknown> = computableFromCfgUnsafe(
|
|
101
83
|
{} as MiddleLayerDriverKit,
|
|
102
84
|
ctx,
|
|
103
|
-
|
|
85
|
+
outputs.out1,
|
|
104
86
|
) as any;
|
|
105
87
|
|
|
106
88
|
expect(await computable.getValue()).toBeUndefined();
|
package/src/mutator/project.ts
CHANGED
|
@@ -107,6 +107,17 @@ interface BlockFieldState {
|
|
|
107
107
|
ref?: AnyRef;
|
|
108
108
|
status?: FieldStatus;
|
|
109
109
|
value?: Uint8Array;
|
|
110
|
+
/**
|
|
111
|
+
* True when the project field's own error slot is filled, i.e. the render failed outright
|
|
112
|
+
* and left no value resource behind. Distinct from `status === "Error"`, which describes a
|
|
113
|
+
* value resource that exists but carries an error.
|
|
114
|
+
*/
|
|
115
|
+
fieldError?: boolean;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Either failure shape a production field can be in: no value resource, or an errored one. */
|
|
119
|
+
function hasError(state: BlockFieldState | undefined): boolean {
|
|
120
|
+
return state?.fieldError === true || state?.status === "Error";
|
|
110
121
|
}
|
|
111
122
|
|
|
112
123
|
type BlockFieldStates = Partial<Record<ProjectField["fieldName"], BlockFieldState>>;
|
|
@@ -270,11 +281,19 @@ class BlockInfo {
|
|
|
270
281
|
return this.fields.prodCtx !== undefined;
|
|
271
282
|
}
|
|
272
283
|
|
|
284
|
+
/**
|
|
285
|
+
* True if the rendered production failed, in either shape {@link hasError} covers.
|
|
286
|
+
*
|
|
287
|
+
* Must stay in step with the `outputError` the desktop derives in
|
|
288
|
+
* `middle_layer/project_overview.ts`, because that flag is what enables the Run button.
|
|
289
|
+
* Any failure counted there but not here leaves Run enabled yet inert: `renderProduction`
|
|
290
|
+
* finds nothing to re-render and commits an empty transaction.
|
|
291
|
+
*/
|
|
273
292
|
get productionHasErrors(): boolean {
|
|
274
293
|
return (
|
|
275
|
-
this.fields.prodUiCtx
|
|
276
|
-
this.fields.prodOutput
|
|
277
|
-
this.fields.prodCtx
|
|
294
|
+
hasError(this.fields.prodUiCtx) ||
|
|
295
|
+
hasError(this.fields.prodOutput) ||
|
|
296
|
+
hasError(this.fields.prodCtx)
|
|
278
297
|
);
|
|
279
298
|
}
|
|
280
299
|
|
|
@@ -1886,9 +1905,12 @@ export class ProjectMutator {
|
|
|
1886
1905
|
blockInfoStates.set(projectField.blockId, info);
|
|
1887
1906
|
}
|
|
1888
1907
|
|
|
1908
|
+
// `f.error` is carried separately from `f.value`: a field that errored has no value
|
|
1909
|
+
// resource to read a status off, so this is the only trace the failure leaves here.
|
|
1910
|
+
const fieldError = isNotNullSignedResourceId(f.error);
|
|
1889
1911
|
info.fields[projectField.fieldName] = isNullSignedResourceId(f.value)
|
|
1890
|
-
? { modCount: 0 }
|
|
1891
|
-
: { modCount: 0, ref: f.value };
|
|
1912
|
+
? { modCount: 0, fieldError }
|
|
1913
|
+
: { modCount: 0, ref: f.value, fieldError };
|
|
1892
1914
|
}
|
|
1893
1915
|
|
|
1894
1916
|
//
|