@milaboratories/pl-middle-layer 1.67.5 → 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 +13 -13
- package/src/mutator/project.ts +27 -5
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import "../model/project_model.js";
|
|
2
|
+
import "../model/template_serializer.js";
|
|
3
|
+
import "../model/index.js";
|
|
1
4
|
import { ProjectHelper } from "../model/project_helper.js";
|
|
2
5
|
import { BlockConfig } from "@platforma-sdk/model";
|
|
3
6
|
import { AuthorMarker, BlockPackSpec, BlockSettings, ProjectMeta } from "@milaboratories/pl-model-middle-layer";
|
|
4
7
|
import { MiLogger } from "@milaboratories/ts-helpers";
|
|
5
8
|
import { AnyRef, AnyResourceRef, PlClient, PlTransaction, ResourceRef, SignedResourceId } from "@milaboratories/pl-client";
|
|
6
|
-
|
|
7
9
|
//#region src/mutator/project.d.ts
|
|
8
10
|
/**
|
|
9
11
|
* Duplicates an existing project resource within a transaction.
|
|
@@ -17,7 +19,7 @@ import { AnyRef, AnyResourceRef, PlClient, PlTransaction, ResourceRef, SignedRes
|
|
|
17
19
|
* @param sourceRid - resource id of the project to duplicate
|
|
18
20
|
* @param options.label - optional label override for the new project; if omitted, copies the source label
|
|
19
21
|
*/
|
|
20
|
-
declare function duplicateProject(tx: PlTransaction, sourceRid: SignedResourceId, options?: {
|
|
22
|
+
export declare function duplicateProject(tx: PlTransaction, sourceRid: SignedResourceId, options?: {
|
|
21
23
|
label?: string;
|
|
22
24
|
},
|
|
23
25
|
/**
|
|
@@ -28,5 +30,4 @@ declare function duplicateProject(tx: PlTransaction, sourceRid: SignedResourceId
|
|
|
28
30
|
*/
|
|
29
31
|
projectHelper?: ProjectHelper): Promise<ResourceRef>;
|
|
30
32
|
//#endregion
|
|
31
|
-
export { duplicateProject };
|
|
32
33
|
//# sourceMappingURL=project.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","names":[],"sources":["../../src/mutator/project.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"project.d.ts","names":[],"sources":["../../src/mutator/project.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;wBAukEsB,iBACpB,IAAI,eACJ,WAAW,kBACX;EAAY;GAOZ;;;;;;;AAAA,gBAAgB,gBACf,QAAQ"}
|
package/dist/mutator/project.js
CHANGED
|
@@ -23,6 +23,10 @@ import Denque from "denque";
|
|
|
23
23
|
function isProductionFieldSettled(status) {
|
|
24
24
|
return status === "Ready" || status === "Error";
|
|
25
25
|
}
|
|
26
|
+
/** Either failure shape a production field can be in: no value resource, or an errored one. */
|
|
27
|
+
function hasError(state) {
|
|
28
|
+
return state?.fieldError === true || state?.status === "Error";
|
|
29
|
+
}
|
|
26
30
|
function cached(modIdCb, valueCb) {
|
|
27
31
|
let initialized = false;
|
|
28
32
|
let lastModId = void 0;
|
|
@@ -117,8 +121,16 @@ var BlockInfo = class {
|
|
|
117
121
|
get productionRendered() {
|
|
118
122
|
return this.fields.prodCtx !== void 0;
|
|
119
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* True if the rendered production failed, in either shape {@link hasError} covers.
|
|
126
|
+
*
|
|
127
|
+
* Must stay in step with the `outputError` the desktop derives in
|
|
128
|
+
* `middle_layer/project_overview.ts`, because that flag is what enables the Run button.
|
|
129
|
+
* Any failure counted there but not here leaves Run enabled yet inert: `renderProduction`
|
|
130
|
+
* finds nothing to re-render and commits an empty transaction.
|
|
131
|
+
*/
|
|
120
132
|
get productionHasErrors() {
|
|
121
|
-
return this.fields.prodUiCtx
|
|
133
|
+
return hasError(this.fields.prodUiCtx) || hasError(this.fields.prodOutput) || hasError(this.fields.prodCtx);
|
|
122
134
|
}
|
|
123
135
|
productionStaleC = cached(() => `${this.fields.currentArgs.modCount}_${this.fields.prodArgs?.modCount}`, () => this.fields.prodArgs === void 0 || Buffer.compare(this.fields.currentArgs.value, this.fields.prodArgs.value) !== 0);
|
|
124
136
|
get requireProductionRendering() {
|
|
@@ -972,9 +984,14 @@ var ProjectMutator = class ProjectMutator {
|
|
|
972
984
|
};
|
|
973
985
|
blockInfoStates.set(projectField.blockId, info);
|
|
974
986
|
}
|
|
975
|
-
|
|
987
|
+
const fieldError = isNotNullSignedResourceId(f.error);
|
|
988
|
+
info.fields[projectField.fieldName] = isNullSignedResourceId(f.value) ? {
|
|
989
|
+
modCount: 0,
|
|
990
|
+
fieldError
|
|
991
|
+
} : {
|
|
976
992
|
modCount: 0,
|
|
977
|
-
ref: f.value
|
|
993
|
+
ref: f.value,
|
|
994
|
+
fieldError
|
|
978
995
|
};
|
|
979
996
|
}
|
|
980
997
|
const blockFieldRequests = [];
|