@milaboratories/pl-middle-layer 2.10.0 → 2.11.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/block_registry/registry-v2-provider.cjs +8 -1
- package/dist/block_registry/registry-v2-provider.cjs.map +1 -1
- package/dist/block_registry/registry-v2-provider.d.ts.map +1 -1
- package/dist/block_registry/registry-v2-provider.js +8 -1
- package/dist/block_registry/registry-v2-provider.js.map +1 -1
- package/dist/index.cjs +25 -1
- package/dist/index.d.ts +12 -5
- package/dist/index.js +5 -3
- package/dist/js_render/bundle_bytecode_cache.cjs +6 -1
- package/dist/js_render/bundle_bytecode_cache.cjs.map +1 -1
- package/dist/js_render/bundle_bytecode_cache.js +6 -1
- package/dist/js_render/bundle_bytecode_cache.js.map +1 -1
- package/dist/js_render/column_registry.cjs +17 -0
- package/dist/js_render/column_registry.cjs.map +1 -1
- package/dist/js_render/column_registry.js +16 -1
- package/dist/js_render/column_registry.js.map +1 -1
- package/dist/js_render/computable_context.cjs +1 -1
- package/dist/js_render/computable_context.js +1 -1
- package/dist/js_render/context.cjs +3 -2
- package/dist/js_render/context.cjs.map +1 -1
- package/dist/js_render/context.js +3 -2
- package/dist/js_render/context.js.map +1 -1
- package/dist/js_render/index.cjs +1 -1
- package/dist/js_render/index.cjs.map +1 -1
- package/dist/js_render/index.js +1 -1
- package/dist/js_render/index.js.map +1 -1
- package/dist/js_render/service_injectors.cjs +2 -9
- package/dist/js_render/service_injectors.cjs.map +1 -1
- package/dist/js_render/service_injectors.js +2 -9
- package/dist/js_render/service_injectors.js.map +1 -1
- package/dist/middle_layer/block.cjs +48 -0
- package/dist/middle_layer/block.cjs.map +1 -1
- package/dist/middle_layer/block.js +51 -4
- package/dist/middle_layer/block.js.map +1 -1
- package/dist/middle_layer/block_pack_description.cjs +80 -0
- package/dist/middle_layer/block_pack_description.cjs.map +1 -0
- package/dist/middle_layer/block_pack_description.d.ts +36 -0
- package/dist/middle_layer/block_pack_description.d.ts.map +1 -0
- package/dist/middle_layer/block_pack_description.js +78 -0
- package/dist/middle_layer/block_pack_description.js.map +1 -0
- package/dist/middle_layer/build_stamp.cjs +1 -1
- package/dist/middle_layer/build_stamp.js +1 -1
- package/dist/middle_layer/index.cjs +11 -0
- package/dist/middle_layer/index.d.ts +8 -2
- package/dist/middle_layer/index.js +3 -1
- package/dist/middle_layer/legacy_project_holds.cjs +61 -0
- package/dist/middle_layer/legacy_project_holds.cjs.map +1 -0
- package/dist/middle_layer/legacy_project_holds.js +61 -0
- package/dist/middle_layer/legacy_project_holds.js.map +1 -0
- package/dist/middle_layer/middle_layer.cjs +22 -24
- package/dist/middle_layer/middle_layer.cjs.map +1 -1
- package/dist/middle_layer/middle_layer.d.ts +13 -3
- package/dist/middle_layer/middle_layer.d.ts.map +1 -1
- package/dist/middle_layer/middle_layer.js +21 -23
- package/dist/middle_layer/middle_layer.js.map +1 -1
- package/dist/middle_layer/pool_columns.cjs +160 -0
- package/dist/middle_layer/pool_columns.cjs.map +1 -0
- package/dist/middle_layer/pool_columns.d.ts +59 -0
- package/dist/middle_layer/pool_columns.d.ts.map +1 -0
- package/dist/middle_layer/pool_columns.js +157 -0
- package/dist/middle_layer/pool_columns.js.map +1 -0
- package/dist/middle_layer/pool_frame.cjs +82 -0
- package/dist/middle_layer/pool_frame.cjs.map +1 -0
- package/dist/middle_layer/pool_frame.d.ts +37 -0
- package/dist/middle_layer/pool_frame.d.ts.map +1 -0
- package/dist/middle_layer/pool_frame.js +81 -0
- package/dist/middle_layer/pool_frame.js.map +1 -0
- package/dist/middle_layer/pool_table.cjs +66 -0
- package/dist/middle_layer/pool_table.cjs.map +1 -0
- package/dist/middle_layer/pool_table.d.ts +27 -0
- package/dist/middle_layer/pool_table.d.ts.map +1 -0
- package/dist/middle_layer/pool_table.js +66 -0
- package/dist/middle_layer/pool_table.js.map +1 -0
- package/dist/middle_layer/project.cjs +89 -23
- package/dist/middle_layer/project.cjs.map +1 -1
- package/dist/middle_layer/project.d.ts +70 -4
- package/dist/middle_layer/project.d.ts.map +1 -1
- package/dist/middle_layer/project.js +89 -22
- package/dist/middle_layer/project.js.map +1 -1
- package/dist/middle_layer/rich_column_query.cjs +180 -0
- package/dist/middle_layer/rich_column_query.cjs.map +1 -0
- package/dist/middle_layer/rich_column_query.d.ts +34 -0
- package/dist/middle_layer/rich_column_query.d.ts.map +1 -0
- package/dist/middle_layer/rich_column_query.js +176 -0
- package/dist/middle_layer/rich_column_query.js.map +1 -0
- package/dist/model/args.cjs +23 -0
- package/dist/model/args.cjs.map +1 -1
- package/dist/model/args.js +24 -2
- package/dist/model/args.js.map +1 -1
- package/dist/model/args_derivation.cjs +60 -2
- package/dist/model/args_derivation.cjs.map +1 -1
- package/dist/model/args_derivation.d.ts +73 -3
- package/dist/model/args_derivation.d.ts.map +1 -1
- package/dist/model/args_derivation.js +60 -3
- package/dist/model/args_derivation.js.map +1 -1
- package/dist/model/block_pack_spec.cjs.map +1 -1
- package/dist/model/block_pack_spec.d.ts +3 -3
- package/dist/model/block_pack_spec.d.ts.map +1 -1
- package/dist/model/block_pack_spec.js.map +1 -1
- package/dist/model/block_params_model.cjs +42 -0
- package/dist/model/block_params_model.cjs.map +1 -0
- package/dist/model/block_params_model.d.ts +45 -0
- package/dist/model/block_params_model.d.ts.map +1 -0
- package/dist/model/block_params_model.js +42 -0
- package/dist/model/block_params_model.js.map +1 -0
- package/dist/model/index.d.ts +3 -1
- package/dist/model/project_helper.cjs +50 -6
- package/dist/model/project_helper.cjs.map +1 -1
- package/dist/model/project_helper.d.ts +25 -1
- package/dist/model/project_helper.d.ts.map +1 -1
- package/dist/model/project_helper.js +51 -7
- package/dist/model/project_helper.js.map +1 -1
- package/dist/model/template_spec.d.ts +18 -0
- package/dist/model/template_spec.d.ts.map +1 -1
- package/dist/mutator/block-pack/block_pack.cjs +90 -3
- package/dist/mutator/block-pack/block_pack.cjs.map +1 -1
- package/dist/mutator/block-pack/block_pack.d.ts +16 -0
- package/dist/mutator/block-pack/block_pack.d.ts.map +1 -1
- package/dist/mutator/block-pack/block_pack.js +91 -5
- package/dist/mutator/block-pack/block_pack.js.map +1 -1
- package/dist/mutator/block-pack/required_capabilities.cjs +16 -0
- package/dist/mutator/block-pack/required_capabilities.cjs.map +1 -1
- package/dist/mutator/block-pack/required_capabilities.js +16 -1
- package/dist/mutator/block-pack/required_capabilities.js.map +1 -1
- package/dist/mutator/project.cjs +4 -0
- package/dist/mutator/project.cjs.map +1 -1
- package/dist/mutator/project.d.ts +1 -1
- package/dist/mutator/project.d.ts.map +1 -1
- package/dist/mutator/project.js +4 -0
- package/dist/mutator/project.js.map +1 -1
- package/dist/mutator/template/template_cache.cjs +8 -1
- package/dist/mutator/template/template_cache.cjs.map +1 -1
- package/dist/mutator/template/template_cache.d.ts +7 -3
- package/dist/mutator/template/template_cache.d.ts.map +1 -1
- package/dist/mutator/template/template_cache.js +8 -1
- package/dist/mutator/template/template_cache.js.map +1 -1
- package/package.json +9 -9
- package/src/block_registry/registry-v2-provider.test.ts +23 -0
- package/src/block_registry/registry-v2-provider.ts +11 -1
- package/src/index.ts +2 -0
- package/src/js_render/bundle_bytecode_cache.ts +15 -4
- package/src/js_render/column_registry.ts +24 -3
- package/src/js_render/context.ts +4 -3
- package/src/js_render/index.ts +3 -2
- package/src/js_render/service_injectors.ts +2 -11
- package/src/middle_layer/block.ts +61 -2
- package/src/middle_layer/block_pack_description.test.ts +235 -0
- package/src/middle_layer/block_pack_description.ts +143 -0
- package/src/middle_layer/index.ts +9 -1
- package/src/middle_layer/legacy_project_holds.test.ts +133 -0
- package/src/middle_layer/legacy_project_holds.ts +73 -0
- package/src/middle_layer/middle_layer.ts +27 -28
- package/src/middle_layer/pool_columns.test.ts +217 -0
- package/src/middle_layer/pool_columns.ts +250 -0
- package/src/middle_layer/pool_frame.test.ts +144 -0
- package/src/middle_layer/pool_frame.ts +127 -0
- package/src/middle_layer/pool_table.test.ts +182 -0
- package/src/middle_layer/pool_table.ts +98 -0
- package/src/middle_layer/project.ts +135 -32
- package/src/middle_layer/rich_column_query.test.ts +311 -0
- package/src/middle_layer/rich_column_query.ts +214 -0
- package/src/model/args.test.ts +23 -1
- package/src/model/args.ts +29 -1
- package/src/model/args_derivation.test.ts +129 -12
- package/src/model/args_derivation.ts +112 -8
- package/src/model/block_pack_spec.ts +3 -2
- package/src/model/block_params_model.test.ts +194 -0
- package/src/model/block_params_model.ts +117 -0
- package/src/model/index.ts +6 -0
- package/src/model/project_helper.ts +101 -20
- package/src/model/template_spec.ts +21 -0
- package/src/mutator/block-pack/block_pack.test.ts +10 -1
- package/src/mutator/block-pack/block_pack.ts +102 -2
- package/src/mutator/block-pack/block_pack_load.test.ts +52 -0
- package/src/mutator/block-pack/required_capabilities.ts +25 -0
- package/src/mutator/project-v3.test.ts +27 -16
- package/src/mutator/project.ts +5 -0
- package/src/mutator/template/template_cache.ts +26 -3
- package/src/pool/result_pool_markers.test.ts +47 -0
- package/src/test/block_packs.ts +12 -0
- package/src/test/fake_project.ts +33 -6
|
@@ -14,7 +14,10 @@ const cache = new Map<string, ArrayBuffer>();
|
|
|
14
14
|
/** Sum of `cache`'s values' byte lengths, kept alongside it to avoid rescanning on evict. */
|
|
15
15
|
let heldBytes = 0;
|
|
16
16
|
|
|
17
|
-
function digestFor(cacheKey: string, code: string): string {
|
|
17
|
+
function digestFor(cacheKey: string | undefined, code: string): string {
|
|
18
|
+
// Without a key the code is hashed every time: about half a millisecond for a 500 KB bundle,
|
|
19
|
+
// against about 30 ms to compile it.
|
|
20
|
+
if (cacheKey === undefined) return createHash("sha256").update(code).digest("hex");
|
|
18
21
|
// Pack resources are immutable (mutator/project.ts creates a new one per update), so the
|
|
19
22
|
// length check only guards that invariant breaking.
|
|
20
23
|
const memoKey = `${cacheKey}:${code.length}`;
|
|
@@ -32,7 +35,7 @@ function digestFor(cacheKey: string, code: string): string {
|
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
/** Bytecode for `code`, compiled on first ask. Outlives the context that compiled it. */
|
|
35
|
-
function byteCodeFor(vm: QuickJSContext, cacheKey: string, code: string): ArrayBuffer {
|
|
38
|
+
function byteCodeFor(vm: QuickJSContext, cacheKey: string | undefined, code: string): ArrayBuffer {
|
|
36
39
|
const digest = digestFor(cacheKey, code);
|
|
37
40
|
const hit = cache.get(digest);
|
|
38
41
|
if (hit !== undefined) {
|
|
@@ -59,8 +62,16 @@ function byteCodeFor(vm: QuickJSContext, cacheKey: string, code: string): ArrayB
|
|
|
59
62
|
return compiled;
|
|
60
63
|
}
|
|
61
64
|
|
|
62
|
-
/**
|
|
63
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Evaluate a block's model bundle into `vm`, reusing bytecode compiled for the same code. A
|
|
67
|
+
* `cacheKey` that identifies the code (a block pack id) saves hashing it on every call; without
|
|
68
|
+
* one the code is identified by its hash.
|
|
69
|
+
*/
|
|
70
|
+
export function evaluateBundleCached(
|
|
71
|
+
vm: QuickJSContext,
|
|
72
|
+
cacheKey: string | undefined,
|
|
73
|
+
code: string,
|
|
74
|
+
): void {
|
|
64
75
|
const byteCode = byteCodeFor(vm, cacheKey, code);
|
|
65
76
|
// Not `consume`: it disposes only on a clean return, so a throwing bundle leaks the handle.
|
|
66
77
|
const handle = vm.newArrayBuffer(byteCode);
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
type PColumn,
|
|
20
20
|
type PColumnSpec,
|
|
21
21
|
type PObjectId,
|
|
22
|
+
type PObjectSpec,
|
|
22
23
|
type UpstreamBlockCtx,
|
|
23
24
|
} from "@milaboratories/pl-model-common";
|
|
24
25
|
|
|
@@ -56,6 +57,24 @@ export function buildColumnRegistry(
|
|
|
56
57
|
return new ColumnRegistry<PlTreeNodeAccessor>(providers);
|
|
57
58
|
}
|
|
58
59
|
|
|
60
|
+
/**
|
|
61
|
+
* The spec of a leaf column of the registry, read from its `.spec` field; `undefined` when the id
|
|
62
|
+
* is not in the registry or its spec is not readable yet.
|
|
63
|
+
*/
|
|
64
|
+
export function resolveColumnSpec(
|
|
65
|
+
registry: ColumnRegistry<PlTreeNodeAccessor>,
|
|
66
|
+
id: PObjectId,
|
|
67
|
+
): PObjectSpec | undefined {
|
|
68
|
+
const leaf = registry.resolve(id);
|
|
69
|
+
if (leaf === undefined) return undefined;
|
|
70
|
+
const specNode = leaf.accessor.traverse({
|
|
71
|
+
field: `${leaf.name}.spec`,
|
|
72
|
+
assertFieldType: "Input",
|
|
73
|
+
ignoreError: true,
|
|
74
|
+
});
|
|
75
|
+
return specNode?.getDataAsJson<PObjectSpec>();
|
|
76
|
+
}
|
|
77
|
+
|
|
59
78
|
/**
|
|
60
79
|
* Resolve a column id to a materialised {@link PColumn} backed by the
|
|
61
80
|
* underlying {@link PlTreeNodeAccessor} for the `.data` resource. Returns the
|
|
@@ -63,6 +82,7 @@ export function buildColumnRegistry(
|
|
|
63
82
|
* a rich id are NOT reconstructed here — they are applied by the query nodes
|
|
64
83
|
* (`sliceAxes` / `specOverride`) that wrap this leaf in the def, so reconstructing
|
|
65
84
|
* would double-apply them. Only the explicit `overrides` argument is folded in.
|
|
85
|
+
* The column keeps `id` as given, a rich id included: the PFrame driver takes it as the column's id.
|
|
66
86
|
*
|
|
67
87
|
* Throws when the id is not in the registry or the column has no resolved spec.
|
|
68
88
|
* A `.data` field that has not yet materialised yields an empty value list — the
|
|
@@ -71,7 +91,7 @@ export function buildColumnRegistry(
|
|
|
71
91
|
*/
|
|
72
92
|
export function resolvePColumnById(
|
|
73
93
|
registry: ColumnRegistry<PlTreeNodeAccessor>,
|
|
74
|
-
id:
|
|
94
|
+
id: ColumnUniversalId,
|
|
75
95
|
overrides?: SpecOverrides,
|
|
76
96
|
): PColumn<PColumnValues | PlTreeNodeAccessor> {
|
|
77
97
|
const pid = extractPObjectId(id);
|
|
@@ -116,7 +136,7 @@ export function resolvePColumnById(
|
|
|
116
136
|
*/
|
|
117
137
|
export function resolvePFrameColumnById(
|
|
118
138
|
registry: ColumnRegistry<PlTreeNodeAccessor>,
|
|
119
|
-
id:
|
|
139
|
+
id: ColumnUniversalId,
|
|
120
140
|
): PColumn<PColumnValues | PlTreeNodeAccessor> {
|
|
121
141
|
const column = resolvePColumnById(registry, id);
|
|
122
142
|
return { ...column, spec: pFrameColumnSpec(column.spec, id) };
|
|
@@ -130,7 +150,8 @@ export function pFrameColumnSpec(leafSpec: PColumnSpec, id: ColumnUniversalId):
|
|
|
130
150
|
return hasAxisFilters(id) ? leafSpec : reconstructSpecFromId(leafSpec, id);
|
|
131
151
|
}
|
|
132
152
|
|
|
133
|
-
|
|
153
|
+
/** Whether a layer of the id filters an axis of the column under it. */
|
|
154
|
+
export function hasAxisFilters(id: ColumnUniversalId | ColumnUniversalKey): boolean {
|
|
134
155
|
const key = typeof id !== "string" ? id : isPObjectId(id) ? undefined : parseColumnIdSafely(id);
|
|
135
156
|
if (key === undefined) return false;
|
|
136
157
|
if (isColumnFilteredKey(key)) return true;
|
package/src/js_render/context.ts
CHANGED
|
@@ -166,10 +166,11 @@ export class JsExecutionContext {
|
|
|
166
166
|
|
|
167
167
|
/**
|
|
168
168
|
* {@link evaluateBundle}, reusing bytecode compiled for an earlier context with the same
|
|
169
|
-
* `cacheKey
|
|
170
|
-
* parsing per context was the dominant cost of
|
|
169
|
+
* code (identified by `cacheKey` when given, by its hash otherwise). Every lambda gets its own
|
|
170
|
+
* context and needs the whole bundle in scope, so parsing per context was the dominant cost of
|
|
171
|
+
* rendering a block.
|
|
171
172
|
*/
|
|
172
|
-
public evaluateBundleCached(cacheKey: string, code: string) {
|
|
173
|
+
public evaluateBundleCached(cacheKey: string | undefined, code: string) {
|
|
173
174
|
const t0 = performance.now();
|
|
174
175
|
try {
|
|
175
176
|
this.deadlineSetter({
|
package/src/js_render/index.ts
CHANGED
|
@@ -253,8 +253,9 @@ export function executeSingleLambda(
|
|
|
253
253
|
featureFlags,
|
|
254
254
|
);
|
|
255
255
|
|
|
256
|
-
// Initializing the model
|
|
257
|
-
|
|
256
|
+
// Initializing the model. The bytecode cache spares compiling the bundle on every call: the
|
|
257
|
+
// args derivations of each write and readiness check run here.
|
|
258
|
+
rCtx.evaluateBundleCached(undefined, code.content);
|
|
258
259
|
|
|
259
260
|
// Running the lambda with arguments (e.g., state for args(), args for enrichmentTargets())
|
|
260
261
|
const importedResult = rCtx.importObjectUniversal(rCtx.runCallback(fh.handle, ...args));
|
|
@@ -19,7 +19,6 @@ import type {
|
|
|
19
19
|
PColumnSpec,
|
|
20
20
|
PColumnValues,
|
|
21
21
|
PObjectId,
|
|
22
|
-
PObjectSpec,
|
|
23
22
|
PTableColumnId,
|
|
24
23
|
PTableColumnSpec,
|
|
25
24
|
PTableRecordFilter,
|
|
@@ -37,6 +36,7 @@ import type {
|
|
|
37
36
|
import { PoolEntryGuard } from "@milaboratories/pl-model-common";
|
|
38
37
|
import type { JsExecutionContext } from "./context";
|
|
39
38
|
import type { ComputableContextHelper } from "./computable_context";
|
|
39
|
+
import { resolveColumnSpec } from "./column_registry";
|
|
40
40
|
|
|
41
41
|
type VmMethod = VmFunctionImplementation<QuickJSHandle>;
|
|
42
42
|
|
|
@@ -211,16 +211,7 @@ export function getServiceInjectors(): ServiceInjectorMap {
|
|
|
211
211
|
resolveAccessor: (h) => host.getAccessor(h),
|
|
212
212
|
getUpstreamBlockCtxes: () => host.getRawUpstreamBlockCtx(),
|
|
213
213
|
getSpecDriver: () => specDriver,
|
|
214
|
-
resolveSpec: (id: PObjectId) =>
|
|
215
|
-
const leaf = host.getColumnRegistry().resolve(id);
|
|
216
|
-
if (leaf === undefined) return undefined;
|
|
217
|
-
const specNode = leaf.accessor.traverse({
|
|
218
|
-
field: `${leaf.name}.spec`,
|
|
219
|
-
assertFieldType: "Input",
|
|
220
|
-
ignoreError: true,
|
|
221
|
-
});
|
|
222
|
-
return specNode?.getDataAsJson<PObjectSpec>();
|
|
223
|
-
},
|
|
214
|
+
resolveSpec: (id: PObjectId) => resolveColumnSpec(host.getColumnRegistry(), id),
|
|
224
215
|
};
|
|
225
216
|
|
|
226
217
|
const pinHandle = (entry: PoolEntry<CollectionHandle>): CollectionHandle => {
|
|
@@ -6,16 +6,22 @@ import type {
|
|
|
6
6
|
} from "@milaboratories/computable";
|
|
7
7
|
import { Computable } from "@milaboratories/computable";
|
|
8
8
|
import { constructBlockContext, constructBlockContextArgsOnly } from "./block_ctx";
|
|
9
|
-
import {
|
|
9
|
+
import type { ProjectStructure } from "../model/project_model";
|
|
10
|
+
import { blockArgsAuthorKey, ProjectStructureKey } from "../model/project_model";
|
|
11
|
+
import { allBlocks } from "../model/project_model_util";
|
|
12
|
+
import { missingBlockReferences } from "../model/args";
|
|
13
|
+
import type { BlockReadiness, DerivedArgs, DerivedPrerunArgs } from "../model/args_derivation";
|
|
14
|
+
import { BLOCK_STORAGE_FACADE_VERSION } from "@platforma-sdk/model";
|
|
10
15
|
import { ifNotUndef } from "../cfg_render/util";
|
|
11
16
|
import type { MiddleLayerEnvironment } from "./middle_layer";
|
|
12
17
|
import { getBlockPackInfo } from "./util";
|
|
13
18
|
import type { AuthorMarker, BlockStateInternalV3 } from "@milaboratories/pl-model-middle-layer";
|
|
14
19
|
import { computableFromCfgOrRF } from "./render";
|
|
15
20
|
import { resourceIdToString } from "@milaboratories/pl-client";
|
|
16
|
-
import { deepFreeze } from "@milaboratories/ts-helpers";
|
|
21
|
+
import { deepFreeze, notEmpty } from "@milaboratories/ts-helpers";
|
|
17
22
|
import { extractCodeWithInfo } from "@platforma-sdk/model";
|
|
18
23
|
import { getDebugFlags } from "../debug";
|
|
24
|
+
import type { BlockId } from "@milaboratories/pl-model-common";
|
|
19
25
|
|
|
20
26
|
export type BlockParameters = Omit<
|
|
21
27
|
BlockStateInternalV3,
|
|
@@ -90,3 +96,56 @@ export function blockOutputs(
|
|
|
90
96
|
{ key },
|
|
91
97
|
).withStableType();
|
|
92
98
|
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* What keeps a block from running or from being staged, as its model sees its current storage:
|
|
102
|
+
* runs the block's args and prerun args derivations again (nothing is written) and lists the
|
|
103
|
+
* references in the derived args to blocks it cannot read from. `undefined` for a block whose
|
|
104
|
+
* model is not on model API version 2, and while the block pack or storage is not loaded.
|
|
105
|
+
*
|
|
106
|
+
* The computable is lazy: the model runs only when the value is asked for, and again only after
|
|
107
|
+
* the project changed.
|
|
108
|
+
*/
|
|
109
|
+
export function blockReadiness(
|
|
110
|
+
projectEntry: PlTreeEntry,
|
|
111
|
+
blockId: BlockId,
|
|
112
|
+
env: MiddleLayerEnvironment,
|
|
113
|
+
): Computable<BlockReadiness | undefined> {
|
|
114
|
+
return Computable.make(
|
|
115
|
+
(c) => {
|
|
116
|
+
const prj = c.accessor(projectEntry).node();
|
|
117
|
+
const bp = getBlockPackInfo(prj, blockId);
|
|
118
|
+
if (bp === undefined || bp.cfg.modelAPIVersion !== BLOCK_STORAGE_FACADE_VERSION)
|
|
119
|
+
return undefined;
|
|
120
|
+
const storageJson = constructBlockContextArgsOnly(projectEntry, blockId).blockStorage(c);
|
|
121
|
+
if (storageJson === undefined) return undefined;
|
|
122
|
+
|
|
123
|
+
const structure = notEmpty(prj.getKeyValueAsJson<ProjectStructure>(ProjectStructureKey));
|
|
124
|
+
const blockIds = [...allBlocks(structure)].map((b) => b.id);
|
|
125
|
+
const args = env.projectHelper.deriveArgsFromStorage(bp.cfg, storageJson);
|
|
126
|
+
const prerun = env.projectHelper.derivePrerunArgsDetailedFromStorage(bp.cfg, storageJson);
|
|
127
|
+
return {
|
|
128
|
+
args: argsReadiness(args),
|
|
129
|
+
prerun: prerunReadiness(prerun),
|
|
130
|
+
missingReferences:
|
|
131
|
+
args.type === "absent" ? [] : missingBlockReferences(args.args, blockId, blockIds),
|
|
132
|
+
} satisfies BlockReadiness;
|
|
133
|
+
},
|
|
134
|
+
{ key: `readiness#${resourceIdToString(projectEntry.rid)}#${blockId}` },
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function argsReadiness(derived: DerivedArgs): BlockReadiness["args"] {
|
|
139
|
+
if (derived.type !== "absent") return { type: derived.type, issues: derived.issues };
|
|
140
|
+
const cause = derived.error.cause;
|
|
141
|
+
return {
|
|
142
|
+
type: "absent",
|
|
143
|
+
error:
|
|
144
|
+
cause instanceof Error ? `${derived.error.message}: ${cause.message}` : derived.error.message,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function prerunReadiness(derived: DerivedPrerunArgs): BlockReadiness["prerun"] {
|
|
149
|
+
if (derived.type === "staged") return { type: "staged", issues: derived.issues };
|
|
150
|
+
return derived;
|
|
151
|
+
}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
+
import fsp from "node:fs/promises";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { pathToFileURL } from "node:url";
|
|
6
|
+
import { defaultHttpDispatcher } from "@milaboratories/pl-http";
|
|
7
|
+
import type { BlockConfigContainer, BlockKindReference } from "@milaboratories/pl-model-common";
|
|
8
|
+
import { BlockPackManifest } from "@milaboratories/pl-model-middle-layer";
|
|
9
|
+
import {
|
|
10
|
+
BlockRegistryV2,
|
|
11
|
+
KindContractFileName,
|
|
12
|
+
KindDeclarationFileName,
|
|
13
|
+
storageByUrl,
|
|
14
|
+
} from "@platforma-sdk/block-tools";
|
|
15
|
+
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
|
16
|
+
import { V2RegistryProvider } from "../block_registry/registry-v2-provider";
|
|
17
|
+
import type { BlockPackSpecAny } from "../model";
|
|
18
|
+
import { describeBlockPack } from "./block_pack_description";
|
|
19
|
+
|
|
20
|
+
const kindName = "@platforma-open/testorg.numbers.kind";
|
|
21
|
+
const kind = `${kindName}@1.0.0` as BlockKindReference;
|
|
22
|
+
const blockId = { organization: "testorg", name: "numbers", version: "1.0.0" };
|
|
23
|
+
|
|
24
|
+
/** A `contract.d.ts` as kind builds now write it. */
|
|
25
|
+
const contractDts = Buffer.from(
|
|
26
|
+
`import { PlRef } from "@platforma-sdk/model";\n` +
|
|
27
|
+
`/** Numbers to sum. */\n` +
|
|
28
|
+
`type BlockParams = { numbers?: number[]; source?: PlRef };\n` +
|
|
29
|
+
`export declare const kind: import("@platforma-sdk/block-kind").CompiledBlockKind<BlockParams>;\n`,
|
|
30
|
+
);
|
|
31
|
+
/** A `kind.d.ts` of a kind built before contracts, with its dependencies inlined. */
|
|
32
|
+
const legacyDts = Buffer.from(
|
|
33
|
+
`type CompiledBlockKind<P> = { parse: (value: unknown) => P };\n` +
|
|
34
|
+
`type BlockParams = { numbers?: number[] };\n` +
|
|
35
|
+
`export declare const kind: CompiledBlockKind<BlockParams>;\n`,
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
/** The config of a BlockModelV3 block compiled against {@link kind}. */
|
|
39
|
+
const container: BlockConfigContainer = {
|
|
40
|
+
v4: {
|
|
41
|
+
configVersion: 4,
|
|
42
|
+
modelAPIVersion: 2,
|
|
43
|
+
sdkVersion: "1.0.0",
|
|
44
|
+
renderingMode: "Heavy",
|
|
45
|
+
sections: undefined,
|
|
46
|
+
outputs: {},
|
|
47
|
+
blockLifecycleCallbacks: {},
|
|
48
|
+
},
|
|
49
|
+
kind,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** Reads every block as {@link container}. */
|
|
53
|
+
const preparer = { getBlockConfigContainer: async () => container };
|
|
54
|
+
|
|
55
|
+
function sha256(bytes: Buffer): string {
|
|
56
|
+
return createHash("sha256").update(bytes).digest("hex").toUpperCase();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
let root: string;
|
|
60
|
+
beforeEach(async () => {
|
|
61
|
+
// The real path: a dev kind package is resolved to one.
|
|
62
|
+
root = await fsp.realpath(
|
|
63
|
+
await fsp.mkdtemp(path.join(os.tmpdir(), `ml-describe-${randomUUID()}`)),
|
|
64
|
+
);
|
|
65
|
+
});
|
|
66
|
+
afterEach(async () => {
|
|
67
|
+
await fsp.rm(root, { recursive: true, force: true });
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
describe("describeBlockPack of a registry block", () => {
|
|
71
|
+
async function publish(
|
|
72
|
+
fileName: string,
|
|
73
|
+
kindDts: Buffer,
|
|
74
|
+
homepage?: string,
|
|
75
|
+
): Promise<BlockPackSpecAny> {
|
|
76
|
+
const registry = new BlockRegistryV2(storageByUrl(`file://${root}`));
|
|
77
|
+
await registry.publishKind(
|
|
78
|
+
{
|
|
79
|
+
schema: "v1",
|
|
80
|
+
kind: { name: kindName, version: "1.0.0" },
|
|
81
|
+
sourceHash: "0".repeat(64),
|
|
82
|
+
files: [{ name: fileName, size: kindDts.length, sha256: sha256(kindDts) }],
|
|
83
|
+
},
|
|
84
|
+
async () => kindDts,
|
|
85
|
+
);
|
|
86
|
+
const model = Buffer.from("{}");
|
|
87
|
+
await registry.publishPackage(
|
|
88
|
+
BlockPackManifest.parse({
|
|
89
|
+
schema: "v2",
|
|
90
|
+
description: {
|
|
91
|
+
id: blockId,
|
|
92
|
+
title: "Numbers",
|
|
93
|
+
summary: "Test block",
|
|
94
|
+
kind,
|
|
95
|
+
components: {
|
|
96
|
+
workflow: { type: "workflow-v1", main: { type: "relative", path: "model.json" } },
|
|
97
|
+
model: { type: "relative", path: "model.json" },
|
|
98
|
+
ui: { type: "relative", path: "model.json" },
|
|
99
|
+
},
|
|
100
|
+
meta: {
|
|
101
|
+
title: "Numbers",
|
|
102
|
+
description: "Test block",
|
|
103
|
+
organization: { name: "Test", url: "https://test.com" },
|
|
104
|
+
...(homepage !== undefined ? { url: homepage } : {}),
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
files: [{ name: "model.json", size: model.length, sha256: sha256(model) }],
|
|
108
|
+
}),
|
|
109
|
+
async () => model,
|
|
110
|
+
);
|
|
111
|
+
return { type: "from-registry-v2", registryUrl: `file://${root}`, id: blockId };
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
test("reads the contract.d.ts whole, with its registry URL", async () => {
|
|
115
|
+
const spec = await publish(KindContractFileName, contractDts, "https://example.com/numbers");
|
|
116
|
+
|
|
117
|
+
const described = await describeBlockPack(
|
|
118
|
+
preparer,
|
|
119
|
+
new V2RegistryProvider(defaultHttpDispatcher()),
|
|
120
|
+
spec,
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
expect(described).toEqual({
|
|
124
|
+
kind,
|
|
125
|
+
declaredKind: kind,
|
|
126
|
+
declaration: {
|
|
127
|
+
text: contractDts.toString(),
|
|
128
|
+
url: `file://${root}/kinds/testorg/numbers/1.0.0/contract.d.ts`,
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
test("a kind built before contracts gives the URL of its kind.d.ts and the block's homepage", async () => {
|
|
134
|
+
const spec = await publish(KindDeclarationFileName, legacyDts, "https://example.com/numbers");
|
|
135
|
+
|
|
136
|
+
const described = await describeBlockPack(
|
|
137
|
+
preparer,
|
|
138
|
+
new V2RegistryProvider(defaultHttpDispatcher()),
|
|
139
|
+
spec,
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
expect(described).toEqual({
|
|
143
|
+
kind,
|
|
144
|
+
declaredKind: kind,
|
|
145
|
+
legacyDeclarationUrl: `file://${root}/kinds/testorg/numbers/1.0.0/kind.d.ts`,
|
|
146
|
+
homepage: "https://example.com/numbers",
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
test("a kind version without declarations has none", async () => {
|
|
151
|
+
const spec: BlockPackSpecAny = {
|
|
152
|
+
type: "from-registry-v2",
|
|
153
|
+
registryUrl: `file://${root}`,
|
|
154
|
+
id: blockId,
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const described = await describeBlockPack(
|
|
158
|
+
preparer,
|
|
159
|
+
new V2RegistryProvider(defaultHttpDispatcher()),
|
|
160
|
+
spec,
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
expect(described).toEqual({ kind, declaredKind: kind });
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
describe("describeBlockPack of a dev block", () => {
|
|
168
|
+
/** A block folder depending on a built kind package installed in its node_modules. */
|
|
169
|
+
async function devBlock(
|
|
170
|
+
fileName: string,
|
|
171
|
+
kindDts: Buffer,
|
|
172
|
+
): Promise<{ spec: BlockPackSpecAny; distDir: string }> {
|
|
173
|
+
const folder = path.join(root, "block");
|
|
174
|
+
const kindDir = path.join(folder, "node_modules", ...kindName.split("/"));
|
|
175
|
+
const distDir = path.join(kindDir, "dist");
|
|
176
|
+
await fsp.mkdir(distDir, { recursive: true });
|
|
177
|
+
await fsp.writeFile(
|
|
178
|
+
path.join(folder, "package.json"),
|
|
179
|
+
JSON.stringify({
|
|
180
|
+
name: "@platforma-open/testorg.numbers",
|
|
181
|
+
dependencies: { [kindName]: "*" },
|
|
182
|
+
}),
|
|
183
|
+
);
|
|
184
|
+
await fsp.writeFile(
|
|
185
|
+
path.join(kindDir, "package.json"),
|
|
186
|
+
JSON.stringify({ name: kindName, version: "1.1.0" }),
|
|
187
|
+
);
|
|
188
|
+
await fsp.writeFile(
|
|
189
|
+
path.join(distDir, "manifest.json"),
|
|
190
|
+
JSON.stringify({
|
|
191
|
+
schema: "v1",
|
|
192
|
+
kind: { name: kindName, version: "1.1.0" },
|
|
193
|
+
sourceHash: "0".repeat(64),
|
|
194
|
+
files: [{ name: fileName, size: kindDts.length, sha256: sha256(kindDts) }],
|
|
195
|
+
}),
|
|
196
|
+
);
|
|
197
|
+
await fsp.writeFile(path.join(distDir, fileName), kindDts);
|
|
198
|
+
return { spec: { type: "dev-v2", folder }, distDir };
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
test("reads the contract.d.ts of the kind package the folder depends on", async () => {
|
|
202
|
+
const { spec, distDir } = await devBlock(KindContractFileName, contractDts);
|
|
203
|
+
|
|
204
|
+
const described = await describeBlockPack(
|
|
205
|
+
preparer,
|
|
206
|
+
new V2RegistryProvider(defaultHttpDispatcher()),
|
|
207
|
+
spec,
|
|
208
|
+
);
|
|
209
|
+
|
|
210
|
+
expect(described).toEqual({
|
|
211
|
+
kind,
|
|
212
|
+
declaredKind: `${kindName}@1.1.0`,
|
|
213
|
+
declaration: {
|
|
214
|
+
text: contractDts.toString(),
|
|
215
|
+
url: pathToFileURL(path.join(distDir, KindContractFileName)).toString(),
|
|
216
|
+
},
|
|
217
|
+
});
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
test("a kind package built before contracts, in a folder without block meta: no homepage", async () => {
|
|
221
|
+
const { spec, distDir } = await devBlock(KindDeclarationFileName, legacyDts);
|
|
222
|
+
|
|
223
|
+
const described = await describeBlockPack(
|
|
224
|
+
preparer,
|
|
225
|
+
new V2RegistryProvider(defaultHttpDispatcher()),
|
|
226
|
+
spec,
|
|
227
|
+
);
|
|
228
|
+
|
|
229
|
+
expect(described).toEqual({
|
|
230
|
+
kind,
|
|
231
|
+
declaredKind: `${kindName}@1.1.0`,
|
|
232
|
+
legacyDeclarationUrl: pathToFileURL(path.join(distDir, KindDeclarationFileName)).toString(),
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
});
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
import type { BlockKindReference } from "@milaboratories/pl-model-common";
|
|
4
|
+
import {
|
|
5
|
+
isFileNotFound,
|
|
6
|
+
KindContractFileName,
|
|
7
|
+
KindDeclarationFileName,
|
|
8
|
+
loadPackDescriptionRaw,
|
|
9
|
+
readFacadeKindDependency,
|
|
10
|
+
resolveFacadeKind,
|
|
11
|
+
} from "@platforma-sdk/block-tools";
|
|
12
|
+
import type { BlockPackSpecAny } from "../model";
|
|
13
|
+
import type { BlockPackPreparer } from "../mutator/block-pack/block_pack";
|
|
14
|
+
import type { V2RegistryProvider } from "../block_registry/registry-v2-provider";
|
|
15
|
+
|
|
16
|
+
/** The `contract.d.ts` of a block kind: the declaration of its params agents read. */
|
|
17
|
+
export interface KindDeclaration {
|
|
18
|
+
text: string;
|
|
19
|
+
/** Where the file is: its registry URL, or a `file:` URL for a dev block. */
|
|
20
|
+
url: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** What a block pack is, read without adding it to a project. */
|
|
24
|
+
export interface DescribedBlockPack {
|
|
25
|
+
/** The kind the block's model was compiled against; absent for a block that declares none. */
|
|
26
|
+
kind?: BlockKindReference;
|
|
27
|
+
/**
|
|
28
|
+
* The kind {@link declaration} was looked up for. For a dev block it is the kind package the
|
|
29
|
+
* block folder depends on, which can differ from {@link kind} until the model is rebuilt.
|
|
30
|
+
* Absent when no declaration could be looked up: a block without a kind, or a spec type with
|
|
31
|
+
* no kind files (only `from-registry-v2` and `dev-v2` have them).
|
|
32
|
+
*/
|
|
33
|
+
declaredKind?: BlockKindReference;
|
|
34
|
+
/** The `contract.d.ts` of {@link declaredKind}, when it has one. */
|
|
35
|
+
declaration?: KindDeclaration;
|
|
36
|
+
/**
|
|
37
|
+
* A {@link declaredKind} without a `contract.d.ts` was built before kinds carried one: the URL
|
|
38
|
+
* of the `kind.d.ts` it was published with, when it has one.
|
|
39
|
+
*/
|
|
40
|
+
legacyDeclarationUrl?: string;
|
|
41
|
+
/**
|
|
42
|
+
* The homepage the block names in its meta (`url`). Read only when there is no
|
|
43
|
+
* {@link declaration}, as where to look for the params; absent when the block names none or
|
|
44
|
+
* its meta could not be read.
|
|
45
|
+
*/
|
|
46
|
+
homepage?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** `undefined` when `read` fails: a missing homepage leaves only a pointer out. */
|
|
50
|
+
async function optional<T>(read: () => Promise<T>): Promise<T | undefined> {
|
|
51
|
+
try {
|
|
52
|
+
return await read();
|
|
53
|
+
} catch {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** The files of one kind version, wherever they are, and the block's homepage. */
|
|
59
|
+
type KindFiles = {
|
|
60
|
+
/** The file's bytes; `undefined` when the version has no such file. */
|
|
61
|
+
read(fileName: string): Promise<Buffer | undefined>;
|
|
62
|
+
url(fileName: string): string;
|
|
63
|
+
homepage(): Promise<string | undefined>;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/** The `contract.d.ts` of a kind; without one, where its older declarations are. */
|
|
67
|
+
async function declarationOf(
|
|
68
|
+
declaredKind: BlockKindReference,
|
|
69
|
+
files: KindFiles,
|
|
70
|
+
): Promise<
|
|
71
|
+
Pick<DescribedBlockPack, "declaredKind" | "declaration" | "legacyDeclarationUrl" | "homepage">
|
|
72
|
+
> {
|
|
73
|
+
const contract = await files.read(KindContractFileName);
|
|
74
|
+
if (contract !== undefined)
|
|
75
|
+
return {
|
|
76
|
+
declaredKind,
|
|
77
|
+
declaration: { text: contract.toString("utf8"), url: files.url(KindContractFileName) },
|
|
78
|
+
};
|
|
79
|
+
const legacy = await files.read(KindDeclarationFileName);
|
|
80
|
+
const homepage = await optional(files.homepage);
|
|
81
|
+
return {
|
|
82
|
+
declaredKind,
|
|
83
|
+
...(legacy !== undefined ? { legacyDeclarationUrl: files.url(KindDeclarationFileName) } : {}),
|
|
84
|
+
...(homepage !== undefined ? { homepage } : {}),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
async function kindDeclaration(
|
|
89
|
+
registries: V2RegistryProvider,
|
|
90
|
+
spec: BlockPackSpecAny,
|
|
91
|
+
kind: BlockKindReference | undefined,
|
|
92
|
+
): Promise<Omit<DescribedBlockPack, "kind">> {
|
|
93
|
+
switch (spec.type) {
|
|
94
|
+
case "from-registry-v2": {
|
|
95
|
+
if (kind === undefined) return {};
|
|
96
|
+
const registry = registries.getRegistry(spec.registryUrl);
|
|
97
|
+
return await declarationOf(kind, {
|
|
98
|
+
read: async (fileName) => await registry.readKindFile(kind, fileName),
|
|
99
|
+
url: (fileName) => registry.kindFileUrl(kind, fileName),
|
|
100
|
+
homepage: async () => await registry.getBlockHomepage(spec.id),
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
case "dev-v2": {
|
|
104
|
+
const dependency = readFacadeKindDependency(spec.folder);
|
|
105
|
+
if (dependency === undefined) return {};
|
|
106
|
+
const resolved = await resolveFacadeKind(spec.folder, dependency.npmName);
|
|
107
|
+
return await declarationOf(resolved.ref, {
|
|
108
|
+
read: async (fileName) => {
|
|
109
|
+
try {
|
|
110
|
+
return await resolved.fileReader(fileName);
|
|
111
|
+
} catch (e: unknown) {
|
|
112
|
+
if (isFileNotFound(e)) return undefined;
|
|
113
|
+
throw e;
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
url: (fileName) => pathToFileURL(path.join(resolved.distDir, fileName)).toString(),
|
|
117
|
+
homepage: async () => (await loadPackDescriptionRaw(spec.folder)).meta.url,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
default:
|
|
121
|
+
return {};
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Reads what `spec` is: its kind from the model, and the `contract.d.ts` of its kind from the
|
|
127
|
+
* registry (`from-registry-v2`) or the kind package of the block folder (`dev-v2`).
|
|
128
|
+
*
|
|
129
|
+
* @throws when the model cannot be read; `RegistryReadError` when a kind file is there but
|
|
130
|
+
* cannot be read; for `dev-v2`, when the kind package is declared but not built
|
|
131
|
+
*/
|
|
132
|
+
export async function describeBlockPack(
|
|
133
|
+
preparer: Pick<BlockPackPreparer, "getBlockConfigContainer">,
|
|
134
|
+
registries: V2RegistryProvider,
|
|
135
|
+
spec: BlockPackSpecAny,
|
|
136
|
+
): Promise<DescribedBlockPack> {
|
|
137
|
+
const container = await preparer.getBlockConfigContainer(spec);
|
|
138
|
+
const kind = container.kind;
|
|
139
|
+
return {
|
|
140
|
+
kind,
|
|
141
|
+
...(await kindDeclaration(registries, spec, kind)),
|
|
142
|
+
};
|
|
143
|
+
}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
export { MiddleLayer } from "./middle_layer";
|
|
2
2
|
export { Project } from "./project";
|
|
3
|
-
export type {
|
|
3
|
+
export type { PoolColumn, PoolColumns, PoolColumnsQuery } from "./pool_columns";
|
|
4
|
+
export type { PoolTable, PoolTableIssue, PoolTableRefusal } from "./pool_table";
|
|
5
|
+
// Not the qualification helpers: the package re-exports @platforma-sdk/model, which has its own.
|
|
6
|
+
export { richColumnQuery, richColumnReferences, richTableDef } from "./rich_column_query";
|
|
7
|
+
export type { LeafSpecOf } from "./rich_column_query";
|
|
8
|
+
export type { PoolColumnIssue, PoolFrame, PoolFrameIssue, PoolFrameRefusal } from "./pool_frame";
|
|
9
|
+
export type { AddBlockOps, UpdateBlockPackOps } from "./project";
|
|
10
|
+
export type { DescribedBlockPack, KindDeclaration } from "./block_pack_description";
|
|
11
|
+
export { KindContractFileName } from "@platforma-sdk/block-tools";
|
|
4
12
|
export type { ProjectHandle, ProjectHandleEnd, ProjectHolder } from "./project_holds";
|
|
5
13
|
export { asProjectHolder, isProjectInUseError, ProjectInUseError } from "./project_holds";
|
|
6
14
|
export * from "./driver_kit";
|