@nocobase/plugin-flow-engine 2.1.0-alpha.14 → 2.1.0-alpha.16
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/externalVersion.js +10 -10
- package/dist/locale/en-US.json +1 -0
- package/dist/locale/index.d.ts +2 -0
- package/dist/locale/zh-CN.json +1 -0
- package/dist/node_modules/ses/package.json +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/flow-surfaces/{compiler.d.ts → apply/compiler.d.ts} +1 -10
- package/dist/server/flow-surfaces/{compiler.js → apply/compiler.js} +41 -280
- package/dist/server/flow-surfaces/apply/layout.d.ts +34 -0
- package/dist/server/flow-surfaces/apply/layout.js +175 -0
- package/dist/server/flow-surfaces/apply/matching.d.ts +16 -0
- package/dist/server/flow-surfaces/apply/matching.js +181 -0
- package/dist/server/flow-surfaces/association-title-field.d.ts +20 -0
- package/dist/server/flow-surfaces/association-title-field.js +158 -0
- package/dist/server/flow-surfaces/blueprint/compile-blocks.d.ts +14 -0
- package/dist/server/flow-surfaces/blueprint/compile-blocks.js +706 -0
- package/dist/server/flow-surfaces/blueprint/compile-plan.d.ts +13 -0
- package/dist/server/flow-surfaces/blueprint/compile-plan.js +308 -0
- package/dist/server/flow-surfaces/blueprint/compile-reaction.d.ts +11 -0
- package/dist/server/flow-surfaces/blueprint/compile-reaction.js +72 -0
- package/dist/server/flow-surfaces/blueprint/index.d.ts +12 -0
- package/dist/server/flow-surfaces/blueprint/index.js +44 -0
- package/dist/server/flow-surfaces/blueprint/normalize-document.d.ts +10 -0
- package/dist/server/flow-surfaces/blueprint/normalize-document.js +296 -0
- package/dist/server/flow-surfaces/blueprint/private-utils.d.ts +26 -0
- package/dist/server/flow-surfaces/blueprint/private-utils.js +182 -0
- package/dist/server/flow-surfaces/blueprint/public-types.d.ts +153 -0
- package/dist/server/flow-surfaces/blueprint/public-types.js +24 -0
- package/dist/server/flow-surfaces/catalog-smart.d.ts +18 -0
- package/dist/server/flow-surfaces/catalog-smart.js +239 -0
- package/dist/server/flow-surfaces/catalog-smart.projector.d.ts +15 -0
- package/dist/server/flow-surfaces/catalog-smart.projector.js +157 -0
- package/dist/server/flow-surfaces/catalog-smart.types.d.ts +99 -0
- package/dist/server/flow-surfaces/catalog-smart.types.js +24 -0
- package/dist/server/flow-surfaces/catalog.d.ts +3 -0
- package/dist/server/flow-surfaces/catalog.js +163 -34
- package/dist/server/flow-surfaces/compose-compiler.d.ts +104 -0
- package/dist/server/flow-surfaces/compose-compiler.js +162 -0
- package/dist/server/flow-surfaces/compose-runtime.d.ts +89 -0
- package/dist/server/flow-surfaces/compose-runtime.js +338 -0
- package/dist/server/flow-surfaces/configure-options.js +12 -3
- package/dist/server/flow-surfaces/constants.d.ts +3 -2
- package/dist/server/flow-surfaces/constants.js +36 -3
- package/dist/server/flow-surfaces/default-action-popup.d.ts +52 -0
- package/dist/server/flow-surfaces/default-action-popup.js +258 -0
- package/dist/server/flow-surfaces/executor.d.ts +10 -0
- package/dist/server/flow-surfaces/executor.js +59 -24
- package/dist/server/flow-surfaces/field-binding-registry.d.ts +23 -0
- package/dist/server/flow-surfaces/field-binding-registry.js +391 -0
- package/dist/server/flow-surfaces/field-semantics.d.ts +1 -1
- package/dist/server/flow-surfaces/index.js +75 -0
- package/dist/server/flow-surfaces/node-use-sets.d.ts +15 -0
- package/dist/server/flow-surfaces/node-use-sets.js +114 -0
- package/dist/server/flow-surfaces/payload-shape.d.ts +9 -0
- package/dist/server/flow-surfaces/payload-shape.js +64 -0
- package/dist/server/flow-surfaces/placement.js +2 -6
- package/dist/server/flow-surfaces/planning/action-specs.d.ts +179 -0
- package/dist/server/flow-surfaces/planning/action-specs.js +190 -0
- package/dist/server/flow-surfaces/planning/compiler.d.ts +37 -0
- package/dist/server/flow-surfaces/planning/compiler.js +376 -0
- package/dist/server/flow-surfaces/planning/context.d.ts +30 -0
- package/dist/server/flow-surfaces/planning/context.js +139 -0
- package/dist/server/flow-surfaces/planning/created-keys.d.ts +34 -0
- package/dist/server/flow-surfaces/planning/created-keys.js +375 -0
- package/dist/server/flow-surfaces/planning/key-kind.d.ts +11 -0
- package/dist/server/flow-surfaces/planning/key-kind.js +86 -0
- package/dist/server/flow-surfaces/planning/key-persistence.d.ts +34 -0
- package/dist/server/flow-surfaces/planning/key-persistence.js +148 -0
- package/dist/server/flow-surfaces/planning/key-registry.d.ts +40 -0
- package/dist/server/flow-surfaces/planning/key-registry.js +206 -0
- package/dist/server/flow-surfaces/planning/runtime.d.ts +37 -0
- package/dist/server/flow-surfaces/planning/runtime.js +259 -0
- package/dist/server/flow-surfaces/planning/step-link.d.ts +14 -0
- package/dist/server/flow-surfaces/planning/step-link.js +104 -0
- package/dist/server/flow-surfaces/planning/types.d.ts +55 -0
- package/dist/server/flow-surfaces/planning/types.js +24 -0
- package/dist/server/flow-surfaces/reaction/errors.d.ts +20 -0
- package/dist/server/flow-surfaces/reaction/errors.js +69 -0
- package/dist/server/flow-surfaces/reaction/field-value.d.ts +34 -0
- package/dist/server/flow-surfaces/reaction/field-value.js +181 -0
- package/dist/server/flow-surfaces/reaction/fingerprint.d.ts +16 -0
- package/dist/server/flow-surfaces/reaction/fingerprint.js +71 -0
- package/dist/server/flow-surfaces/reaction/linkage.d.ts +136 -0
- package/dist/server/flow-surfaces/reaction/linkage.js +882 -0
- package/dist/server/flow-surfaces/reaction/meta.d.ts +11 -0
- package/dist/server/flow-surfaces/reaction/meta.js +451 -0
- package/dist/server/flow-surfaces/reaction/registry.d.ts +136 -0
- package/dist/server/flow-surfaces/reaction/registry.js +186 -0
- package/dist/server/flow-surfaces/reaction/resolver.d.ts +22 -0
- package/dist/server/flow-surfaces/reaction/resolver.js +202 -0
- package/dist/server/flow-surfaces/reaction/types.d.ts +241 -0
- package/dist/server/flow-surfaces/reaction/types.js +24 -0
- package/dist/server/flow-surfaces/reaction/utils.d.ts +17 -0
- package/dist/server/flow-surfaces/reaction/utils.js +67 -0
- package/dist/server/flow-surfaces/reaction/value-expr.d.ts +15 -0
- package/dist/server/flow-surfaces/reaction/value-expr.js +209 -0
- package/dist/server/flow-surfaces/reference-guards.d.ts +19 -0
- package/dist/server/flow-surfaces/reference-guards.js +103 -0
- package/dist/server/flow-surfaces/service-helpers.d.ts +42 -0
- package/dist/server/flow-surfaces/service-helpers.js +377 -0
- package/dist/server/flow-surfaces/service-utils.d.ts +105 -0
- package/dist/server/flow-surfaces/service-utils.js +760 -0
- package/dist/server/flow-surfaces/service.d.ts +189 -103
- package/dist/server/flow-surfaces/service.js +3975 -1770
- package/dist/server/flow-surfaces/template-compatibility.d.ts +42 -0
- package/dist/server/flow-surfaces/template-compatibility.js +189 -0
- package/dist/server/flow-surfaces/template-service-utils.d.ts +62 -0
- package/dist/server/flow-surfaces/template-service-utils.js +281 -0
- package/dist/server/flow-surfaces/types.d.ts +129 -37
- package/dist/swagger/flow-surfaces.d.ts +3773 -1581
- package/dist/swagger/flow-surfaces.examples.d.ts +1215 -0
- package/dist/swagger/flow-surfaces.examples.js +1363 -0
- package/dist/swagger/flow-surfaces.js +2209 -1684
- package/dist/swagger/flow-surfaces.template-action-docs.d.ts +62 -0
- package/dist/swagger/flow-surfaces.template-action-docs.js +121 -0
- package/dist/swagger/flow-surfaces.template-schemas.d.ts +239 -0
- package/dist/swagger/flow-surfaces.template-schemas.js +255 -0
- package/dist/swagger/index.d.ts +3773 -1581
- package/package.json +2 -2
|
@@ -49,6 +49,7 @@ __export(placement_exports, {
|
|
|
49
49
|
isTabsRouteType: () => isTabsRouteType
|
|
50
50
|
});
|
|
51
51
|
module.exports = __toCommonJS(placement_exports);
|
|
52
|
+
var import_node_use_sets = require("./node-use-sets");
|
|
52
53
|
const FLOW_SURFACE_POPUP_HOST_USES = /* @__PURE__ */ new Set([
|
|
53
54
|
"AddNewActionModel",
|
|
54
55
|
"ViewActionModel",
|
|
@@ -81,12 +82,7 @@ const FLOW_SURFACE_GRID_USES = /* @__PURE__ */ new Set([
|
|
|
81
82
|
"FilterFormGridModel",
|
|
82
83
|
"AssignFormGridModel"
|
|
83
84
|
]);
|
|
84
|
-
const FLOW_SURFACE_FIELD_WRAPPER_USES =
|
|
85
|
-
"FormItemModel",
|
|
86
|
-
"DetailsItemModel",
|
|
87
|
-
"FilterFormItemModel",
|
|
88
|
-
"TableColumnModel"
|
|
89
|
-
]);
|
|
85
|
+
const FLOW_SURFACE_FIELD_WRAPPER_USES = import_node_use_sets.FIELD_WRAPPER_USES;
|
|
90
86
|
const FLOW_SURFACE_PAGE_MODEL_USES = /* @__PURE__ */ new Set([
|
|
91
87
|
"RootPageModel",
|
|
92
88
|
"ChildPageModel",
|
|
@@ -0,0 +1,179 @@
|
|
|
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
|
+
export type FlowSurfacePlanSelectorMode = 'none' | 'target' | 'rootUidTarget' | 'sourceTarget';
|
|
10
|
+
export type FlowSurfacePlanActionSpec = {
|
|
11
|
+
selectorMode: FlowSurfacePlanSelectorMode;
|
|
12
|
+
};
|
|
13
|
+
export type FlowSurfacePlanMutateActionSpec = FlowSurfacePlanActionSpec & {
|
|
14
|
+
executionKind: 'mutate';
|
|
15
|
+
};
|
|
16
|
+
export type FlowSurfacePlanOnlyActionSpec = FlowSurfacePlanActionSpec & {
|
|
17
|
+
executionKind: 'planOnly';
|
|
18
|
+
};
|
|
19
|
+
export type FlowSurfaceResolvedPlanActionSpec = FlowSurfacePlanMutateActionSpec | FlowSurfacePlanOnlyActionSpec;
|
|
20
|
+
export declare const FLOW_SURFACE_PLAN_ACTION_SPECS: {
|
|
21
|
+
readonly createMenu: {
|
|
22
|
+
readonly selectorMode: "none";
|
|
23
|
+
readonly executionKind: "mutate";
|
|
24
|
+
};
|
|
25
|
+
readonly createPage: {
|
|
26
|
+
readonly selectorMode: "none";
|
|
27
|
+
readonly executionKind: "mutate";
|
|
28
|
+
};
|
|
29
|
+
readonly compose: {
|
|
30
|
+
readonly selectorMode: "target";
|
|
31
|
+
readonly executionKind: "planOnly";
|
|
32
|
+
};
|
|
33
|
+
readonly configure: {
|
|
34
|
+
readonly selectorMode: "target";
|
|
35
|
+
readonly executionKind: "planOnly";
|
|
36
|
+
};
|
|
37
|
+
readonly setFieldValueRules: {
|
|
38
|
+
readonly selectorMode: "target";
|
|
39
|
+
readonly executionKind: "planOnly";
|
|
40
|
+
};
|
|
41
|
+
readonly setBlockLinkageRules: {
|
|
42
|
+
readonly selectorMode: "target";
|
|
43
|
+
readonly executionKind: "planOnly";
|
|
44
|
+
};
|
|
45
|
+
readonly setFieldLinkageRules: {
|
|
46
|
+
readonly selectorMode: "target";
|
|
47
|
+
readonly executionKind: "planOnly";
|
|
48
|
+
};
|
|
49
|
+
readonly setActionLinkageRules: {
|
|
50
|
+
readonly selectorMode: "target";
|
|
51
|
+
readonly executionKind: "planOnly";
|
|
52
|
+
};
|
|
53
|
+
readonly updateSettings: {
|
|
54
|
+
readonly selectorMode: "target";
|
|
55
|
+
readonly executionKind: "mutate";
|
|
56
|
+
};
|
|
57
|
+
readonly setEventFlows: {
|
|
58
|
+
readonly selectorMode: "target";
|
|
59
|
+
readonly executionKind: "mutate";
|
|
60
|
+
};
|
|
61
|
+
readonly setLayout: {
|
|
62
|
+
readonly selectorMode: "target";
|
|
63
|
+
readonly executionKind: "mutate";
|
|
64
|
+
};
|
|
65
|
+
readonly addTab: {
|
|
66
|
+
readonly selectorMode: "target";
|
|
67
|
+
readonly executionKind: "mutate";
|
|
68
|
+
};
|
|
69
|
+
readonly updateTab: {
|
|
70
|
+
readonly selectorMode: "target";
|
|
71
|
+
readonly executionKind: "mutate";
|
|
72
|
+
};
|
|
73
|
+
readonly moveTab: {
|
|
74
|
+
readonly selectorMode: "sourceTarget";
|
|
75
|
+
readonly executionKind: "mutate";
|
|
76
|
+
};
|
|
77
|
+
readonly removeTab: {
|
|
78
|
+
readonly selectorMode: "rootUidTarget";
|
|
79
|
+
readonly executionKind: "mutate";
|
|
80
|
+
};
|
|
81
|
+
readonly addPopupTab: {
|
|
82
|
+
readonly selectorMode: "target";
|
|
83
|
+
readonly executionKind: "mutate";
|
|
84
|
+
};
|
|
85
|
+
readonly updatePopupTab: {
|
|
86
|
+
readonly selectorMode: "target";
|
|
87
|
+
readonly executionKind: "mutate";
|
|
88
|
+
};
|
|
89
|
+
readonly movePopupTab: {
|
|
90
|
+
readonly selectorMode: "sourceTarget";
|
|
91
|
+
readonly executionKind: "mutate";
|
|
92
|
+
};
|
|
93
|
+
readonly removePopupTab: {
|
|
94
|
+
readonly selectorMode: "target";
|
|
95
|
+
readonly executionKind: "mutate";
|
|
96
|
+
};
|
|
97
|
+
readonly addBlock: {
|
|
98
|
+
readonly selectorMode: "target";
|
|
99
|
+
readonly executionKind: "mutate";
|
|
100
|
+
};
|
|
101
|
+
readonly addField: {
|
|
102
|
+
readonly selectorMode: "target";
|
|
103
|
+
readonly executionKind: "mutate";
|
|
104
|
+
};
|
|
105
|
+
readonly addAction: {
|
|
106
|
+
readonly selectorMode: "target";
|
|
107
|
+
readonly executionKind: "mutate";
|
|
108
|
+
};
|
|
109
|
+
readonly addRecordAction: {
|
|
110
|
+
readonly selectorMode: "target";
|
|
111
|
+
readonly executionKind: "mutate";
|
|
112
|
+
};
|
|
113
|
+
readonly moveNode: {
|
|
114
|
+
readonly selectorMode: "sourceTarget";
|
|
115
|
+
readonly executionKind: "mutate";
|
|
116
|
+
};
|
|
117
|
+
readonly removeNode: {
|
|
118
|
+
readonly selectorMode: "target";
|
|
119
|
+
readonly executionKind: "mutate";
|
|
120
|
+
};
|
|
121
|
+
readonly convertTemplateToCopy: {
|
|
122
|
+
readonly selectorMode: "target";
|
|
123
|
+
readonly executionKind: "planOnly";
|
|
124
|
+
};
|
|
125
|
+
readonly destroyPage: {
|
|
126
|
+
readonly selectorMode: "rootUidTarget";
|
|
127
|
+
readonly executionKind: "mutate";
|
|
128
|
+
};
|
|
129
|
+
} & {
|
|
130
|
+
readonly createMenu: unknown;
|
|
131
|
+
readonly createPage: unknown;
|
|
132
|
+
readonly compose: unknown;
|
|
133
|
+
readonly configure: unknown;
|
|
134
|
+
readonly setFieldValueRules: unknown;
|
|
135
|
+
readonly setBlockLinkageRules: unknown;
|
|
136
|
+
readonly setFieldLinkageRules: unknown;
|
|
137
|
+
readonly setActionLinkageRules: unknown;
|
|
138
|
+
readonly updateSettings: unknown;
|
|
139
|
+
readonly setEventFlows: unknown;
|
|
140
|
+
readonly setLayout: unknown;
|
|
141
|
+
readonly addTab: unknown;
|
|
142
|
+
readonly updateTab: unknown;
|
|
143
|
+
readonly moveTab: unknown;
|
|
144
|
+
readonly removeTab: unknown;
|
|
145
|
+
readonly addPopupTab: unknown;
|
|
146
|
+
readonly updatePopupTab: unknown;
|
|
147
|
+
readonly movePopupTab: unknown;
|
|
148
|
+
readonly removePopupTab: unknown;
|
|
149
|
+
readonly addBlock: unknown;
|
|
150
|
+
readonly addField: unknown;
|
|
151
|
+
readonly addAction: unknown;
|
|
152
|
+
readonly addRecordAction: unknown;
|
|
153
|
+
readonly moveNode: unknown;
|
|
154
|
+
readonly removeNode: unknown;
|
|
155
|
+
readonly convertTemplateToCopy: unknown;
|
|
156
|
+
readonly destroyPage: unknown;
|
|
157
|
+
};
|
|
158
|
+
export type FlowSurfacePlanStepActionName = keyof typeof FLOW_SURFACE_PLAN_ACTION_SPECS;
|
|
159
|
+
export type FlowSurfacePlanOnlyActionName = {
|
|
160
|
+
[K in FlowSurfacePlanStepActionName]: (typeof FLOW_SURFACE_PLAN_ACTION_SPECS)[K] extends {
|
|
161
|
+
executionKind: 'planOnly';
|
|
162
|
+
} ? K : never;
|
|
163
|
+
}[FlowSurfacePlanStepActionName];
|
|
164
|
+
export declare const FLOW_SURFACE_PLAN_STEP_ACTIONS: ("createMenu" | "createPage" | "destroyPage" | "addTab" | "updateTab" | "moveTab" | "removeTab" | "addPopupTab" | "updatePopupTab" | "movePopupTab" | "removePopupTab" | "addBlock" | "addField" | "addAction" | "addRecordAction" | "updateSettings" | "setEventFlows" | "setLayout" | "moveNode" | "removeNode" | "compose" | "configure" | "setFieldValueRules" | "setBlockLinkageRules" | "setFieldLinkageRules" | "setActionLinkageRules" | "convertTemplateToCopy")[];
|
|
165
|
+
export declare function getFlowSurfacePlanSelectorRequirements(selectorMode: FlowSurfacePlanSelectorMode): {
|
|
166
|
+
readonly requiresTarget: false;
|
|
167
|
+
readonly requiresSource: false;
|
|
168
|
+
} | {
|
|
169
|
+
readonly requiresTarget: true;
|
|
170
|
+
readonly requiresSource: false;
|
|
171
|
+
} | {
|
|
172
|
+
readonly requiresTarget: true;
|
|
173
|
+
readonly requiresSource: false;
|
|
174
|
+
} | {
|
|
175
|
+
readonly requiresTarget: true;
|
|
176
|
+
readonly requiresSource: true;
|
|
177
|
+
};
|
|
178
|
+
export declare function getFlowSurfacePlanActionSpec(action: string): FlowSurfaceResolvedPlanActionSpec | undefined;
|
|
179
|
+
export declare function isFlowSurfacePlanOnlyAction(action: string): action is FlowSurfacePlanOnlyActionName;
|
|
@@ -0,0 +1,190 @@
|
|
|
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
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var action_specs_exports = {};
|
|
28
|
+
__export(action_specs_exports, {
|
|
29
|
+
FLOW_SURFACE_PLAN_ACTION_SPECS: () => FLOW_SURFACE_PLAN_ACTION_SPECS,
|
|
30
|
+
FLOW_SURFACE_PLAN_STEP_ACTIONS: () => FLOW_SURFACE_PLAN_STEP_ACTIONS,
|
|
31
|
+
getFlowSurfacePlanActionSpec: () => getFlowSurfacePlanActionSpec,
|
|
32
|
+
getFlowSurfacePlanSelectorRequirements: () => getFlowSurfacePlanSelectorRequirements,
|
|
33
|
+
isFlowSurfacePlanOnlyAction: () => isFlowSurfacePlanOnlyAction
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(action_specs_exports);
|
|
36
|
+
const FLOW_SURFACE_PLAN_SELECTOR_REQUIREMENTS = {
|
|
37
|
+
none: {
|
|
38
|
+
requiresTarget: false,
|
|
39
|
+
requiresSource: false
|
|
40
|
+
},
|
|
41
|
+
target: {
|
|
42
|
+
requiresTarget: true,
|
|
43
|
+
requiresSource: false
|
|
44
|
+
},
|
|
45
|
+
rootUidTarget: {
|
|
46
|
+
requiresTarget: true,
|
|
47
|
+
requiresSource: false
|
|
48
|
+
},
|
|
49
|
+
sourceTarget: {
|
|
50
|
+
requiresTarget: true,
|
|
51
|
+
requiresSource: true
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
function defineFlowSurfacePlanActionSpecs(specs) {
|
|
55
|
+
return specs;
|
|
56
|
+
}
|
|
57
|
+
const FLOW_SURFACE_PLAN_ACTION_SPECS = defineFlowSurfacePlanActionSpecs({
|
|
58
|
+
createMenu: {
|
|
59
|
+
selectorMode: "none",
|
|
60
|
+
executionKind: "mutate"
|
|
61
|
+
},
|
|
62
|
+
createPage: {
|
|
63
|
+
selectorMode: "none",
|
|
64
|
+
executionKind: "mutate"
|
|
65
|
+
},
|
|
66
|
+
compose: {
|
|
67
|
+
selectorMode: "target",
|
|
68
|
+
executionKind: "planOnly"
|
|
69
|
+
},
|
|
70
|
+
configure: {
|
|
71
|
+
selectorMode: "target",
|
|
72
|
+
executionKind: "planOnly"
|
|
73
|
+
},
|
|
74
|
+
setFieldValueRules: {
|
|
75
|
+
selectorMode: "target",
|
|
76
|
+
executionKind: "planOnly"
|
|
77
|
+
},
|
|
78
|
+
setBlockLinkageRules: {
|
|
79
|
+
selectorMode: "target",
|
|
80
|
+
executionKind: "planOnly"
|
|
81
|
+
},
|
|
82
|
+
setFieldLinkageRules: {
|
|
83
|
+
selectorMode: "target",
|
|
84
|
+
executionKind: "planOnly"
|
|
85
|
+
},
|
|
86
|
+
setActionLinkageRules: {
|
|
87
|
+
selectorMode: "target",
|
|
88
|
+
executionKind: "planOnly"
|
|
89
|
+
},
|
|
90
|
+
updateSettings: {
|
|
91
|
+
selectorMode: "target",
|
|
92
|
+
executionKind: "mutate"
|
|
93
|
+
},
|
|
94
|
+
setEventFlows: {
|
|
95
|
+
selectorMode: "target",
|
|
96
|
+
executionKind: "mutate"
|
|
97
|
+
},
|
|
98
|
+
setLayout: {
|
|
99
|
+
selectorMode: "target",
|
|
100
|
+
executionKind: "mutate"
|
|
101
|
+
},
|
|
102
|
+
addTab: {
|
|
103
|
+
selectorMode: "target",
|
|
104
|
+
executionKind: "mutate"
|
|
105
|
+
},
|
|
106
|
+
updateTab: {
|
|
107
|
+
selectorMode: "target",
|
|
108
|
+
executionKind: "mutate"
|
|
109
|
+
},
|
|
110
|
+
moveTab: {
|
|
111
|
+
selectorMode: "sourceTarget",
|
|
112
|
+
executionKind: "mutate"
|
|
113
|
+
},
|
|
114
|
+
removeTab: {
|
|
115
|
+
selectorMode: "rootUidTarget",
|
|
116
|
+
executionKind: "mutate"
|
|
117
|
+
},
|
|
118
|
+
addPopupTab: {
|
|
119
|
+
selectorMode: "target",
|
|
120
|
+
executionKind: "mutate"
|
|
121
|
+
},
|
|
122
|
+
updatePopupTab: {
|
|
123
|
+
selectorMode: "target",
|
|
124
|
+
executionKind: "mutate"
|
|
125
|
+
},
|
|
126
|
+
movePopupTab: {
|
|
127
|
+
selectorMode: "sourceTarget",
|
|
128
|
+
executionKind: "mutate"
|
|
129
|
+
},
|
|
130
|
+
removePopupTab: {
|
|
131
|
+
selectorMode: "target",
|
|
132
|
+
executionKind: "mutate"
|
|
133
|
+
},
|
|
134
|
+
addBlock: {
|
|
135
|
+
selectorMode: "target",
|
|
136
|
+
executionKind: "mutate"
|
|
137
|
+
},
|
|
138
|
+
addField: {
|
|
139
|
+
selectorMode: "target",
|
|
140
|
+
executionKind: "mutate"
|
|
141
|
+
},
|
|
142
|
+
addAction: {
|
|
143
|
+
selectorMode: "target",
|
|
144
|
+
executionKind: "mutate"
|
|
145
|
+
},
|
|
146
|
+
addRecordAction: {
|
|
147
|
+
selectorMode: "target",
|
|
148
|
+
executionKind: "mutate"
|
|
149
|
+
},
|
|
150
|
+
moveNode: {
|
|
151
|
+
selectorMode: "sourceTarget",
|
|
152
|
+
executionKind: "mutate"
|
|
153
|
+
},
|
|
154
|
+
removeNode: {
|
|
155
|
+
selectorMode: "target",
|
|
156
|
+
executionKind: "mutate"
|
|
157
|
+
},
|
|
158
|
+
convertTemplateToCopy: {
|
|
159
|
+
selectorMode: "target",
|
|
160
|
+
executionKind: "planOnly"
|
|
161
|
+
},
|
|
162
|
+
destroyPage: {
|
|
163
|
+
selectorMode: "rootUidTarget",
|
|
164
|
+
executionKind: "mutate"
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
const FLOW_SURFACE_PLAN_STEP_ACTIONS = Object.freeze(
|
|
168
|
+
Object.keys(FLOW_SURFACE_PLAN_ACTION_SPECS)
|
|
169
|
+
);
|
|
170
|
+
function getFlowSurfacePlanSelectorRequirements(selectorMode) {
|
|
171
|
+
return FLOW_SURFACE_PLAN_SELECTOR_REQUIREMENTS[selectorMode];
|
|
172
|
+
}
|
|
173
|
+
function getFlowSurfacePlanActionSpec(action) {
|
|
174
|
+
if (!Object.prototype.hasOwnProperty.call(FLOW_SURFACE_PLAN_ACTION_SPECS, action)) {
|
|
175
|
+
return void 0;
|
|
176
|
+
}
|
|
177
|
+
return FLOW_SURFACE_PLAN_ACTION_SPECS[action];
|
|
178
|
+
}
|
|
179
|
+
function isFlowSurfacePlanOnlyAction(action) {
|
|
180
|
+
var _a;
|
|
181
|
+
return ((_a = getFlowSurfacePlanActionSpec(action)) == null ? void 0 : _a.executionKind) === "planOnly";
|
|
182
|
+
}
|
|
183
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
184
|
+
0 && (module.exports = {
|
|
185
|
+
FLOW_SURFACE_PLAN_ACTION_SPECS,
|
|
186
|
+
FLOW_SURFACE_PLAN_STEP_ACTIONS,
|
|
187
|
+
getFlowSurfacePlanActionSpec,
|
|
188
|
+
getFlowSurfacePlanSelectorRequirements,
|
|
189
|
+
isFlowSurfacePlanOnlyAction
|
|
190
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
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 _ from 'lodash';
|
|
10
|
+
import type { FlowSurfacePlanSelector, FlowSurfacePlanRequestValues, FlowSurfacePlanStep, FlowSurfaceReadLocator, FlowSurfaceResolvedTarget } from '../types';
|
|
11
|
+
import type { FlowSurfaceCompiledPlanStep, FlowSurfacePlanSurfaceContext } from './types';
|
|
12
|
+
type NormalizePlanSelectorDeps = {
|
|
13
|
+
normalizeGetTarget: (value: any) => FlowSurfaceReadLocator;
|
|
14
|
+
};
|
|
15
|
+
type NormalizePlanSelectorOptions = {
|
|
16
|
+
allowKey?: boolean;
|
|
17
|
+
};
|
|
18
|
+
type NormalizePlanStepsDeps = NormalizePlanSelectorDeps & {
|
|
19
|
+
validatePayloadShape: (actionName: string, value: any, path: string) => void;
|
|
20
|
+
};
|
|
21
|
+
type CompilePlanStepDeps = NormalizePlanSelectorDeps & {
|
|
22
|
+
resolveLocator: (target: FlowSurfaceReadLocator, options?: {
|
|
23
|
+
transaction?: any;
|
|
24
|
+
}) => Promise<FlowSurfaceResolvedTarget>;
|
|
25
|
+
buildPlanKeyKind: (node: any, resolvedKind?: string) => string;
|
|
26
|
+
};
|
|
27
|
+
export declare function normalizePlanSelector(actionName: string, selector: any, deps: NormalizePlanSelectorDeps, fieldName?: string, options?: NormalizePlanSelectorOptions): FlowSurfacePlanSelector;
|
|
28
|
+
export declare function normalizePlanSteps(actionName: string, values: FlowSurfacePlanRequestValues, deps: NormalizePlanStepsDeps): {
|
|
29
|
+
id: string;
|
|
30
|
+
action: "createMenu" | "createPage" | "destroyPage" | "addTab" | "updateTab" | "moveTab" | "removeTab" | "addPopupTab" | "updatePopupTab" | "movePopupTab" | "removePopupTab" | "addBlock" | "addField" | "addAction" | "addRecordAction" | "updateSettings" | "setEventFlows" | "setLayout" | "moveNode" | "removeNode" | "compose" | "configure" | "setFieldValueRules" | "setBlockLinkageRules" | "setFieldLinkageRules" | "setActionLinkageRules" | "convertTemplateToCopy";
|
|
31
|
+
selectors: _.Dictionary<any>;
|
|
32
|
+
values: Record<string, any>;
|
|
33
|
+
}[];
|
|
34
|
+
export declare function compilePlanStep(actionName: string, step: FlowSurfacePlanStep, index: number, context: FlowSurfacePlanSurfaceContext, deps: CompilePlanStepDeps, priorStepIds: Set<string>, priorCreatedKeys: Set<string>, options?: {
|
|
35
|
+
transaction?: any;
|
|
36
|
+
}): Promise<FlowSurfaceCompiledPlanStep>;
|
|
37
|
+
export {};
|