@nocobase/plugin-flow-engine 2.2.0-beta.9 → 2.2.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/ai/ai-employees/nathan/prompt.md +2 -0
- package/dist/ai/ai-employees/nathan/skills/frontend-developer/SKILLS.md +1 -0
- package/dist/ai/ai-employees/nathan/skills/frontend-developer/tools/getContextApis.js +2 -2
- package/dist/ai/ai-employees/nathan/skills/frontend-developer/tools/getContextEnvs.js +2 -2
- package/dist/ai/ai-employees/nathan/skills/frontend-developer/tools/getContextVars.js +2 -2
- package/dist/ai/ai-employees/nathan/skills/frontend-developer/tools/lintAndTestJS.js +2 -2
- package/dist/ai/ai-employees/nathan/skills/frontend-developer/tools/patchJSCode.js +4 -4
- package/dist/ai/ai-employees/nathan/skills/frontend-developer/tools/readJSCode.js +2 -2
- package/dist/ai/ai-employees/nathan/skills/frontend-developer/tools/writeJSCode.js +2 -2
- package/dist/ai/docs/runjs/context/ai.md +396 -0
- package/dist/externalVersion.js +9 -9
- package/dist/locale/en-US.json +2 -0
- package/dist/locale/index.d.ts +4 -0
- package/dist/locale/zh-CN.json +2 -0
- package/dist/node_modules/@ant-design/icons-svg/package.json +1 -1
- package/dist/node_modules/acorn/package.json +1 -1
- package/dist/node_modules/acorn-jsx/package.json +1 -1
- package/dist/node_modules/acorn-walk/package.json +1 -1
- package/dist/node_modules/ses/package.json +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/flow-surfaces/authoring-validation.d.ts +2 -1
- package/dist/server/flow-surfaces/authoring-validation.js +167 -19
- package/dist/server/flow-surfaces/blueprint/compile-blocks.js +7 -3
- package/dist/server/flow-surfaces/blueprint/compile-plan.js +19 -15
- package/dist/server/flow-surfaces/blueprint/normalize-document.js +18 -2
- package/dist/server/flow-surfaces/blueprint/public-types.d.ts +1 -0
- package/dist/server/flow-surfaces/builder.js +8 -0
- package/dist/server/flow-surfaces/catalog.js +27 -8
- package/dist/server/flow-surfaces/configure-options.js +17 -1
- package/dist/server/flow-surfaces/constants.d.ts +9 -2
- package/dist/server/flow-surfaces/constants.js +1 -0
- package/dist/server/flow-surfaces/contract-guard.js +20 -10
- package/dist/server/flow-surfaces/errors.d.ts +2 -2
- package/dist/server/flow-surfaces/errors.js +4 -4
- package/dist/server/flow-surfaces/field-binding-registry.js +9 -8
- package/dist/server/flow-surfaces/navigation-targets.d.ts +73 -0
- package/dist/server/flow-surfaces/navigation-targets.js +439 -0
- package/dist/server/flow-surfaces/runjs-authoring/runtime/constants.js +1 -0
- package/dist/server/flow-surfaces/service-utils.d.ts +1 -0
- package/dist/server/flow-surfaces/service-utils.js +17 -0
- package/dist/server/flow-surfaces/service.d.ts +14 -2
- package/dist/server/flow-surfaces/service.js +480 -115
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.js +7 -0
- package/dist/server/plugin.d.ts +13 -0
- package/dist/server/plugin.js +90 -3
- package/dist/server/repository.d.ts +12 -0
- package/dist/server/repository.js +39 -2
- package/dist/server/template/context-keys.d.ts +14 -0
- package/dist/server/template/context-keys.js +86 -0
- package/dist/server/template/contexts.d.ts +5 -8
- package/dist/server/template/contexts.js +43 -51
- package/dist/server/template/resolver.d.ts +5 -13
- package/dist/server/template/resolver.js +188 -257
- package/dist/server/template/variable-expression.d.ts +72 -0
- package/dist/server/template/variable-expression.js +597 -0
- package/dist/server/variables/allow-list.d.ts +49 -0
- package/dist/server/variables/allow-list.js +492 -0
- package/dist/server/variables/form-item-record-slot-resolvers.d.ts +10 -0
- package/dist/server/variables/form-item-record-slot-resolvers.js +280 -0
- package/dist/server/variables/record-bindings.d.ts +42 -0
- package/dist/server/variables/record-bindings.js +196 -0
- package/dist/server/variables/record-projection.d.ts +10 -0
- package/dist/server/variables/record-projection.js +140 -0
- package/dist/server/variables/record-slot-policy.d.ts +23 -0
- package/dist/server/variables/record-slot-policy.js +100 -0
- package/dist/server/variables/record-slot-resolvers.d.ts +46 -0
- package/dist/server/variables/record-slot-resolvers.js +115 -0
- package/dist/server/variables/records.d.ts +49 -2
- package/dist/server/variables/records.js +316 -20
- package/dist/server/variables/registry.d.ts +33 -10
- package/dist/server/variables/registry.js +197 -362
- package/dist/server/variables/resolve.d.ts +20 -2
- package/dist/server/variables/resolve.js +85 -13
- package/dist/server/variables/runjs-variable-dependencies.d.ts +23 -0
- package/dist/server/variables/runjs-variable-dependencies.js +407 -0
- package/dist/server/variables/selects.js +6 -3
- package/dist/server/variables/utils.d.ts +3 -6
- package/dist/server/variables/utils.js +50 -111
- package/dist/swagger/flow-surfaces.d.ts +96 -0
- package/dist/swagger/flow-surfaces.js +88 -7
- package/dist/swagger/index.d.ts +96 -0
- package/package.json +2 -2
|
@@ -578,6 +578,16 @@ const ACTION_ASSIGN_OPTIONS = {
|
|
|
578
578
|
assignValues: objectOption("Bulk or single-record assigned values", { example: { status: "published" } }),
|
|
579
579
|
updateMode: stringOption("Update mode", { example: "overwrite" })
|
|
580
580
|
};
|
|
581
|
+
const ACTION_AFTER_SUCCESS_OPTIONS = {
|
|
582
|
+
afterSuccess: objectOption("Action after a successful update", {
|
|
583
|
+
example: {
|
|
584
|
+
successMessage: "Saved successfully",
|
|
585
|
+
manualClose: false,
|
|
586
|
+
actionAfterSuccess: "stay",
|
|
587
|
+
redirectTo: "/admin/example"
|
|
588
|
+
}
|
|
589
|
+
})
|
|
590
|
+
};
|
|
581
591
|
const ACTION_TRIGGER_WORKFLOWS_OPTIONS = {
|
|
582
592
|
triggerWorkflows: arrayOption("Workflow bindings for submit/update actions", {
|
|
583
593
|
example: [{ workflowKey: "workflow-key", context: "department" }]
|
|
@@ -748,11 +758,17 @@ function getActionConfigureOptionsByUse(use) {
|
|
|
748
758
|
return merged(
|
|
749
759
|
ACTION_CONFIRM_OPTIONS,
|
|
750
760
|
ACTION_ASSIGN_OPTIONS,
|
|
761
|
+
ACTION_AFTER_SUCCESS_OPTIONS,
|
|
751
762
|
ACTION_TRIGGER_WORKFLOWS_OPTIONS,
|
|
752
763
|
ACTION_LINKAGE_OPTIONS
|
|
753
764
|
);
|
|
754
765
|
case "BulkUpdateActionModel":
|
|
755
|
-
return merged(
|
|
766
|
+
return merged(
|
|
767
|
+
ACTION_CONFIRM_OPTIONS,
|
|
768
|
+
ACTION_ASSIGN_OPTIONS,
|
|
769
|
+
ACTION_AFTER_SUCCESS_OPTIONS,
|
|
770
|
+
ACTION_LINKAGE_OPTIONS
|
|
771
|
+
);
|
|
756
772
|
case "BulkEditActionModel":
|
|
757
773
|
return merged(ACTION_EDIT_MODE_OPTIONS, ACTION_LINKAGE_OPTIONS);
|
|
758
774
|
case "DuplicateActionModel":
|
|
@@ -52,6 +52,13 @@ export declare const FLOW_SURFACE_ACTION_DEFINITIONS: {
|
|
|
52
52
|
readonly mutate: false;
|
|
53
53
|
readonly valueSource: "default";
|
|
54
54
|
};
|
|
55
|
+
readonly listNavigationTargets: {
|
|
56
|
+
readonly method: "post";
|
|
57
|
+
readonly read: true;
|
|
58
|
+
readonly transaction: false;
|
|
59
|
+
readonly mutate: false;
|
|
60
|
+
readonly valueSource: "default";
|
|
61
|
+
};
|
|
55
62
|
readonly getReactionMeta: {
|
|
56
63
|
readonly method: "post";
|
|
57
64
|
readonly read: true;
|
|
@@ -380,7 +387,7 @@ type SelectFlowSurfaceActionNames<TFlag extends keyof FlowSurfaceActionDefinitio
|
|
|
380
387
|
[K in FlowSurfacesActionName]: (typeof FLOW_SURFACE_ACTION_DEFINITIONS)[K][TFlag] extends true ? K : never;
|
|
381
388
|
}[FlowSurfacesActionName];
|
|
382
389
|
type FlowSurfaceMutateActionName = SelectFlowSurfaceActionNames<'mutate'>;
|
|
383
|
-
export declare const FLOW_SURFACES_ACTION_NAMES: ("setFieldValueRules" | "setBlockLinkageRules" | "setFieldLinkageRules" | "setActionLinkageRules" | "context" | "get" | "configure" | "apply" | "createPage" | "addTab" | "addPopupTab" | "addBlock" | "addField" | "addAction" | "addRecordAction" | "compose" | "createMenu" | "catalog" | "describeSurface" | "exportBlueprint" | "getReactionMeta" | "applyBlueprint" | "applyApprovalBlueprint" | "listTemplates" | "getTemplate" | "saveTemplate" | "updateTemplate" | "destroyTemplate" | "convertTemplateToCopy" | "updateMenu" | "destroyPage" | "updateTab" | "moveTab" | "removeTab" | "updatePopupTab" | "movePopupTab" | "removePopupTab" | "addBlocks" | "addFields" | "addActions" | "addRecordActions" | "updateSettings" | "getEventFlowMeta" | "addEventFlow" | "setEventFlow" | "removeEventFlow" | "setEventFlows" | "setLayout" | "moveNode" | "removeNode" | "mutate")[];
|
|
390
|
+
export declare const FLOW_SURFACES_ACTION_NAMES: ("setFieldValueRules" | "setBlockLinkageRules" | "setFieldLinkageRules" | "setActionLinkageRules" | "context" | "get" | "configure" | "apply" | "createPage" | "addTab" | "addPopupTab" | "addBlock" | "addField" | "addAction" | "addRecordAction" | "compose" | "createMenu" | "catalog" | "describeSurface" | "exportBlueprint" | "listNavigationTargets" | "getReactionMeta" | "applyBlueprint" | "applyApprovalBlueprint" | "listTemplates" | "getTemplate" | "saveTemplate" | "updateTemplate" | "destroyTemplate" | "convertTemplateToCopy" | "updateMenu" | "destroyPage" | "updateTab" | "moveTab" | "removeTab" | "updatePopupTab" | "movePopupTab" | "removePopupTab" | "addBlocks" | "addFields" | "addActions" | "addRecordActions" | "updateSettings" | "getEventFlowMeta" | "addEventFlow" | "setEventFlow" | "removeEventFlow" | "setEventFlows" | "setLayout" | "moveNode" | "removeNode" | "mutate")[];
|
|
384
391
|
export declare const FLOW_SURFACES_READ_ACTION_NAMES: SelectFlowSurfaceActionNames<"read">[];
|
|
385
392
|
export declare const FLOW_SURFACE_MUTATE_OP_TYPES: FlowSurfaceMutateActionName[];
|
|
386
|
-
export declare const FLOW_SURFACES_ACTION_METHODS: Record<"setFieldValueRules" | "setBlockLinkageRules" | "setFieldLinkageRules" | "setActionLinkageRules" | "context" | "get" | "configure" | "apply" | "createPage" | "addTab" | "addPopupTab" | "addBlock" | "addField" | "addAction" | "addRecordAction" | "compose" | "createMenu" | "catalog" | "describeSurface" | "exportBlueprint" | "getReactionMeta" | "applyBlueprint" | "applyApprovalBlueprint" | "listTemplates" | "getTemplate" | "saveTemplate" | "updateTemplate" | "destroyTemplate" | "convertTemplateToCopy" | "updateMenu" | "destroyPage" | "updateTab" | "moveTab" | "removeTab" | "updatePopupTab" | "movePopupTab" | "removePopupTab" | "addBlocks" | "addFields" | "addActions" | "addRecordActions" | "updateSettings" | "getEventFlowMeta" | "addEventFlow" | "setEventFlow" | "removeEventFlow" | "setEventFlows" | "setLayout" | "moveNode" | "removeNode" | "mutate", FlowSurfaceActionMethod>;
|
|
393
|
+
export declare const FLOW_SURFACES_ACTION_METHODS: Record<"setFieldValueRules" | "setBlockLinkageRules" | "setFieldLinkageRules" | "setActionLinkageRules" | "context" | "get" | "configure" | "apply" | "createPage" | "addTab" | "addPopupTab" | "addBlock" | "addField" | "addAction" | "addRecordAction" | "compose" | "createMenu" | "catalog" | "describeSurface" | "exportBlueprint" | "listNavigationTargets" | "getReactionMeta" | "applyBlueprint" | "applyApprovalBlueprint" | "listTemplates" | "getTemplate" | "saveTemplate" | "updateTemplate" | "destroyTemplate" | "convertTemplateToCopy" | "updateMenu" | "destroyPage" | "updateTab" | "moveTab" | "removeTab" | "updatePopupTab" | "movePopupTab" | "removePopupTab" | "addBlocks" | "addFields" | "addActions" | "addRecordActions" | "updateSettings" | "getEventFlowMeta" | "addEventFlow" | "setEventFlow" | "removeEventFlow" | "setEventFlows" | "setLayout" | "moveNode" | "removeNode" | "mutate", FlowSurfaceActionMethod>;
|
|
@@ -41,6 +41,7 @@ const FLOW_SURFACE_ACTION_DEFINITIONS = {
|
|
|
41
41
|
get: { method: "get", read: true, transaction: false, mutate: false, valueSource: "read" },
|
|
42
42
|
describeSurface: { method: "post", read: true, transaction: false, mutate: false, valueSource: "default" },
|
|
43
43
|
exportBlueprint: { method: "post", read: true, transaction: false, mutate: false, valueSource: "default" },
|
|
44
|
+
listNavigationTargets: { method: "post", read: true, transaction: false, mutate: false, valueSource: "default" },
|
|
44
45
|
getReactionMeta: { method: "post", read: true, transaction: false, mutate: false, valueSource: "default" },
|
|
45
46
|
setFieldValueRules: { method: "post", read: false, transaction: true, mutate: false, valueSource: "default" },
|
|
46
47
|
setBlockLinkageRules: { method: "post", read: false, transaction: true, mutate: false, valueSource: "default" },
|
|
@@ -393,27 +393,35 @@ function normalizeLinkageRulesValue(value, context, path) {
|
|
|
393
393
|
return value;
|
|
394
394
|
}
|
|
395
395
|
return value.map((rule, index) => {
|
|
396
|
-
if (!import_lodash.default.isPlainObject(rule)
|
|
397
|
-
|
|
396
|
+
if (!import_lodash.default.isPlainObject(rule)) {
|
|
397
|
+
(0, import_errors.throwBadRequest)(
|
|
398
|
+
`flowSurfaces updateSettings domain '${getLinkageRuleDomainPath(context, path, index)}' on '${context.use}' expects each linkage rule to be an object`
|
|
399
|
+
);
|
|
398
400
|
}
|
|
399
401
|
const normalizedRule = import_lodash.default.cloneDeep(rule);
|
|
400
|
-
const
|
|
402
|
+
const hasCondition = import_lodash.default.has(normalizedRule, "condition");
|
|
403
|
+
const hasWhen = import_lodash.default.has(normalizedRule, "when");
|
|
404
|
+
const conditionLeaf = hasCondition ? "condition" : hasWhen ? "when" : "condition";
|
|
405
|
+
const conditionInput = hasCondition ? import_lodash.default.get(normalizedRule, "condition") : hasWhen ? import_lodash.default.get(normalizedRule, "when") : import_filter_group.FLOW_SURFACE_EMPTY_FILTER_GROUP;
|
|
401
406
|
import_lodash.default.set(
|
|
402
407
|
normalizedRule,
|
|
403
408
|
"condition",
|
|
404
409
|
(0, import_filter_group.normalizeFlowSurfaceCompatibleFilterGroupValue)(
|
|
405
|
-
|
|
406
|
-
`flowSurfaces updateSettings domain '${
|
|
410
|
+
conditionInput,
|
|
411
|
+
`flowSurfaces updateSettings domain '${getLinkageRuleDomainPath(context, path, index, conditionLeaf)}' on '${context.use}' expects FilterGroup or backend query filter like ${import_filter_group.FLOW_SURFACE_FILTER_GROUP_EXAMPLE}`,
|
|
407
412
|
{ strictDateValues: true }
|
|
408
413
|
)
|
|
409
414
|
);
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
415
|
+
const hasActions = import_lodash.default.has(normalizedRule, "actions");
|
|
416
|
+
const hasThen = import_lodash.default.has(normalizedRule, "then");
|
|
417
|
+
const actionsLeaf = hasActions ? "actions" : hasThen ? "then" : "actions";
|
|
418
|
+
const actionsInput = hasActions ? import_lodash.default.get(normalizedRule, "actions") : hasThen ? import_lodash.default.get(normalizedRule, "then") : [];
|
|
419
|
+
if (!Array.isArray(actionsInput)) {
|
|
413
420
|
(0, import_errors.throwBadRequest)(
|
|
414
|
-
`flowSurfaces updateSettings domain '${getLinkageRuleDomainPath(context, path, index,
|
|
421
|
+
`flowSurfaces updateSettings domain '${getLinkageRuleDomainPath(context, path, index, actionsLeaf)}' on '${context.use}' expects actions/then to be an array`
|
|
415
422
|
);
|
|
416
423
|
}
|
|
424
|
+
import_lodash.default.set(normalizedRule, "actions", actionsInput);
|
|
417
425
|
if (!import_lodash.default.has(normalizedRule, "key")) {
|
|
418
426
|
import_lodash.default.set(normalizedRule, "key", `linkage-rule-${index + 1}`);
|
|
419
427
|
}
|
|
@@ -425,12 +433,14 @@ function normalizeLinkageRulesValue(value, context, path) {
|
|
|
425
433
|
import_lodash.default.set(normalizedRule, "enable", typeof enabled === "boolean" ? enabled : true);
|
|
426
434
|
}
|
|
427
435
|
import_lodash.default.unset(normalizedRule, "enabled");
|
|
436
|
+
import_lodash.default.unset(normalizedRule, "when");
|
|
437
|
+
import_lodash.default.unset(normalizedRule, "then");
|
|
428
438
|
return normalizedRule;
|
|
429
439
|
});
|
|
430
440
|
}
|
|
431
441
|
function getLinkageRuleDomainPath(context, path, index, leaf) {
|
|
432
442
|
const basePath = context.groupKey ? `${context.domain}.${context.groupKey}.${path}[${index}]` : `${context.domain}.${path}[${index}]`;
|
|
433
|
-
return `${basePath}.${leaf}
|
|
443
|
+
return leaf ? `${basePath}.${leaf}` : basePath;
|
|
434
444
|
}
|
|
435
445
|
function isContractDefinedFlowGroup(groupContract) {
|
|
436
446
|
if (!groupContract) {
|
|
@@ -37,7 +37,7 @@ export declare class FlowSurfaceBadRequestError extends FlowSurfaceError {
|
|
|
37
37
|
constructor(message: string, code?: string, options?: FlowSurfaceErrorOptions);
|
|
38
38
|
}
|
|
39
39
|
export declare class FlowSurfaceForbiddenError extends FlowSurfaceError {
|
|
40
|
-
constructor(message: string, code?: string);
|
|
40
|
+
constructor(message: string, code?: string, options?: FlowSurfaceErrorOptions);
|
|
41
41
|
}
|
|
42
42
|
export declare class FlowSurfaceConflictError extends FlowSurfaceError {
|
|
43
43
|
constructor(message: string, code?: string);
|
|
@@ -76,6 +76,6 @@ export declare function toFlowSurfaceErrorItem(error: FlowSurfaceError): FlowSur
|
|
|
76
76
|
export declare function normalizeFlowSurfaceError(error: unknown): FlowSurfaceError;
|
|
77
77
|
export declare function throwBadRequest(message: string, codeOrOptions?: string | FlowSurfaceErrorOptions, options?: FlowSurfaceErrorOptions): never;
|
|
78
78
|
export declare function throwAggregateBadRequest(errors: FlowSurfaceErrorItemInput[]): never;
|
|
79
|
-
export declare function throwForbidden(message: string, code?: string): never;
|
|
79
|
+
export declare function throwForbidden(message: string, code?: string, options?: FlowSurfaceErrorOptions): never;
|
|
80
80
|
export declare function throwConflict(message: string, code?: string): never;
|
|
81
81
|
export declare function throwInternalError(message: string, code?: string): never;
|
|
@@ -69,8 +69,8 @@ class FlowSurfaceBadRequestError extends FlowSurfaceError {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
class FlowSurfaceForbiddenError extends FlowSurfaceError {
|
|
72
|
-
constructor(message, code = "FLOW_SURFACE_FORBIDDEN") {
|
|
73
|
-
super(message, 403, "forbidden", code);
|
|
72
|
+
constructor(message, code = "FLOW_SURFACE_FORBIDDEN", options = {}) {
|
|
73
|
+
super(message, 403, "forbidden", code, options);
|
|
74
74
|
this.name = "FlowSurfaceForbiddenError";
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -159,8 +159,8 @@ function throwBadRequest(message, codeOrOptions, options = {}) {
|
|
|
159
159
|
function throwAggregateBadRequest(errors) {
|
|
160
160
|
throw new FlowSurfaceAggregateError(errors);
|
|
161
161
|
}
|
|
162
|
-
function throwForbidden(message, code) {
|
|
163
|
-
throw new FlowSurfaceForbiddenError(message, code);
|
|
162
|
+
function throwForbidden(message, code, options = {}) {
|
|
163
|
+
throw new FlowSurfaceForbiddenError(message, code, options);
|
|
164
164
|
}
|
|
165
165
|
function throwConflict(message, code) {
|
|
166
166
|
throw new FlowSurfaceConflictError(message, code);
|
|
@@ -58,14 +58,7 @@ function isNumericFormulaDataType(dataType) {
|
|
|
58
58
|
return ["integer", "bigInt", "double", "decimal", "number"].includes(String(dataType || "").trim());
|
|
59
59
|
}
|
|
60
60
|
function resolveTargetCollection(input) {
|
|
61
|
-
|
|
62
|
-
if ((_a = input.field) == null ? void 0 : _a.targetCollection) {
|
|
63
|
-
return input.field.targetCollection;
|
|
64
|
-
}
|
|
65
|
-
if (!input.getCollection || !input.dataSourceKey) {
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
return (0, import_service_helpers.resolveFieldTargetCollection)(input.field, input.dataSourceKey, input.getCollection);
|
|
61
|
+
return (0, import_service_helpers.resolveFieldTargetCollection)(input.field, input.dataSourceKey || "main", input.getCollection || (() => null));
|
|
69
62
|
}
|
|
70
63
|
function normalizeBindingContainerUse(containerUse) {
|
|
71
64
|
const normalized = String(containerUse || "").trim();
|
|
@@ -100,6 +93,14 @@ function selectPreferredDefaultRule(rules) {
|
|
|
100
93
|
return rules.find((rule) => typeof rule.when === "function") || rules[0];
|
|
101
94
|
}
|
|
102
95
|
const FIELD_BINDING_RULE_DEFINITIONS = [
|
|
96
|
+
{
|
|
97
|
+
scope: "filter",
|
|
98
|
+
modelClassName: "CascadeSelectFieldModel",
|
|
99
|
+
interfaces: ["m2o", "o2o", "oho", "obo"],
|
|
100
|
+
isDefault: true,
|
|
101
|
+
order: 60,
|
|
102
|
+
when: ({ targetCollection }) => getCollectionTemplate(targetCollection) === "tree"
|
|
103
|
+
},
|
|
103
104
|
{
|
|
104
105
|
scope: "display",
|
|
105
106
|
modelClassName: "DisplayPreviewFieldModel",
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { Database, Transaction } from '@nocobase/database';
|
|
10
|
+
export declare const DEFAULT_ADMIN_UI_LAYOUT_UID = "admin-layout-model";
|
|
11
|
+
export declare const DEFAULT_MOBILE_UI_LAYOUT_UID = "mobile-layout-model";
|
|
12
|
+
export declare const DEFAULT_ADMIN_MULTI_PORTAL_UID = "__default_admin__";
|
|
13
|
+
export declare const DEFAULT_MOBILE_MULTI_PORTAL_UID = "__default_mobile__";
|
|
14
|
+
export type FlowSurfaceNavigationRequestRoles = readonly string[] | string;
|
|
15
|
+
export type FlowSurfaceResolvedMultiPortal = {
|
|
16
|
+
uid: string;
|
|
17
|
+
title: string;
|
|
18
|
+
icon?: string | null;
|
|
19
|
+
routeName?: string;
|
|
20
|
+
routePath?: string;
|
|
21
|
+
authCheck?: boolean;
|
|
22
|
+
enabled: true;
|
|
23
|
+
layoutUid: string;
|
|
24
|
+
layoutType?: string;
|
|
25
|
+
};
|
|
26
|
+
export type FlowSurfaceNavigationTarget = {
|
|
27
|
+
kind: 'layout' | 'portal';
|
|
28
|
+
uid: string;
|
|
29
|
+
title: string;
|
|
30
|
+
icon?: string | null;
|
|
31
|
+
layoutUid: string;
|
|
32
|
+
layoutType?: string;
|
|
33
|
+
routeName?: string;
|
|
34
|
+
routePath?: string;
|
|
35
|
+
authCheck?: boolean;
|
|
36
|
+
default?: boolean;
|
|
37
|
+
portalUid?: string;
|
|
38
|
+
};
|
|
39
|
+
export type FlowSurfaceNavigationTargetsResult = {
|
|
40
|
+
version: '1';
|
|
41
|
+
capabilities: {
|
|
42
|
+
multiPortal: boolean;
|
|
43
|
+
};
|
|
44
|
+
targets: FlowSurfaceNavigationTarget[];
|
|
45
|
+
};
|
|
46
|
+
type PortalResolveOptions = {
|
|
47
|
+
actionName: string;
|
|
48
|
+
path: string;
|
|
49
|
+
currentRoles?: FlowSurfaceNavigationRequestRoles;
|
|
50
|
+
transaction?: Transaction;
|
|
51
|
+
};
|
|
52
|
+
export declare class FlowSurfaceNavigationTargetsService {
|
|
53
|
+
private readonly db;
|
|
54
|
+
constructor(db: Database);
|
|
55
|
+
hasMultiPortalCapability(): boolean;
|
|
56
|
+
hasUiLayoutCapability(): boolean;
|
|
57
|
+
normalizePortalUid(value: unknown): string;
|
|
58
|
+
listNavigationTargets(currentRoles?: FlowSurfaceNavigationRequestRoles, transaction?: Transaction): Promise<FlowSurfaceNavigationTargetsResult>;
|
|
59
|
+
resolvePortal(portalUidValue: unknown, options: PortalResolveOptions): Promise<FlowSurfaceResolvedMultiPortal>;
|
|
60
|
+
readRoutePortalUids(routeId: unknown, transaction?: Transaction): Promise<string[]>;
|
|
61
|
+
assertRouteBelongsToPortal(actionName: string, routeId: unknown, portalUid: string, path: string, transaction?: Transaction): Promise<void>;
|
|
62
|
+
attachRouteTreeToPortals(routeId: unknown, portalUids: string[], options: {
|
|
63
|
+
portalOnly: boolean;
|
|
64
|
+
transaction?: Transaction;
|
|
65
|
+
}): Promise<void>;
|
|
66
|
+
private listLayoutTargets;
|
|
67
|
+
private listAccessiblePortalTargets;
|
|
68
|
+
private canAccessPortal;
|
|
69
|
+
private collectRouteTreeIds;
|
|
70
|
+
private removeDefaultLayoutRoutePermissions;
|
|
71
|
+
private grantDefaultPortalRouteAccess;
|
|
72
|
+
}
|
|
73
|
+
export {};
|