@nocobase/plugin-flow-engine 2.1.0-beta.15 → 2.1.0-beta.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/ai/ai-employees/nathan/index.d.ts +10 -0
- package/dist/ai/ai-employees/nathan/index.js +41 -0
- package/dist/ai/ai-employees/nathan/prompt.md +132 -0
- package/dist/ai/ai-employees/nathan/skills/frontend-developer/SKILLS.md +69 -0
- package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextApis.js +2 -2
- package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextEnvs.js +2 -2
- package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextVars.js +2 -2
- package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/lintAndTestJS.js +2 -2
- package/dist/ai/docs/runjs/context/block-model.md +35 -35
- package/dist/ai/docs/runjs/context/collection-field.md +53 -51
- package/dist/ai/docs/runjs/context/collection.md +39 -39
- package/dist/ai/docs/runjs/context/data-source-manager.md +40 -30
- package/dist/ai/docs/runjs/context/data-source.md +52 -44
- package/dist/ai/docs/runjs/context/element.md +44 -38
- package/dist/ai/docs/runjs/context/exit-all.md +37 -35
- package/dist/ai/docs/runjs/context/exit.md +38 -35
- package/dist/ai/docs/runjs/context/filter-manager.md +36 -30
- package/dist/ai/docs/runjs/context/form.md +57 -57
- package/dist/ai/docs/runjs/context/get-model.md +22 -21
- package/dist/ai/docs/runjs/context/get-value.md +20 -19
- package/dist/ai/docs/runjs/context/get-var.md +61 -55
- package/dist/ai/docs/runjs/context/i18n.md +17 -14
- package/dist/ai/docs/runjs/context/import-async.md +333 -45
- package/dist/ai/docs/runjs/context/init-resource.md +20 -20
- package/dist/ai/docs/runjs/context/libs.md +31 -31
- package/dist/ai/docs/runjs/context/location.md +34 -31
- package/dist/ai/docs/runjs/context/logger.md +41 -40
- package/dist/ai/docs/runjs/context/make-resource.md +27 -26
- package/dist/ai/docs/runjs/context/message.md +42 -41
- package/dist/ai/docs/runjs/context/modal.md +44 -44
- package/dist/ai/docs/runjs/context/model.md +36 -33
- package/dist/ai/docs/runjs/context/notification.md +41 -40
- package/dist/ai/docs/runjs/context/off.md +14 -14
- package/dist/ai/docs/runjs/context/on.md +30 -29
- package/dist/ai/docs/runjs/context/open-view.md +40 -40
- package/dist/ai/docs/runjs/context/render.md +37 -32
- package/dist/ai/docs/runjs/context/request.md +46 -45
- package/dist/ai/docs/runjs/context/require-async.md +28 -25
- package/dist/ai/docs/runjs/context/resource.md +34 -34
- package/dist/ai/docs/runjs/context/route.md +36 -34
- package/dist/ai/docs/runjs/context/router.md +43 -31
- package/dist/ai/docs/runjs/context/set-value.md +18 -17
- package/dist/ai/docs/runjs/context/t.md +20 -17
- package/dist/ai/docs/runjs/context/view.md +49 -46
- package/dist/ai/docs/runjs/document.md +1 -0
- package/dist/ai/docs/runjs/import-modules.md +32 -32
- package/dist/ai/docs/runjs/index.md +13 -13
- package/dist/ai/docs/runjs/jsx.md +19 -19
- package/dist/ai/docs/runjs/model/form-block-model.md +1 -3
- package/dist/ai/docs/runjs/render.md +15 -15
- package/dist/ai/docs/runjs/resource/api-resource.md +53 -53
- package/dist/ai/docs/runjs/resource/multi-record-resource.md +64 -64
- package/dist/ai/docs/runjs/resource/single-record-resource.md +55 -55
- package/dist/ai/docs/runjs/resource/sql-resource.md +57 -57
- package/dist/ai/docs/runjs/window.md +5 -5
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +11 -10
- package/dist/node_modules/ses/dist/ses.cjs +1 -1
- package/dist/node_modules/ses/package.json +1 -1
- package/dist/node_modules/zod/index.cjs +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/flow-surfaces/action-scope.d.ts +38 -0
- package/dist/server/flow-surfaces/action-scope.js +152 -0
- package/dist/server/flow-surfaces/apply/compiler.d.ts +13 -0
- package/dist/server/flow-surfaces/apply/compiler.js +969 -0
- 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/approval/blueprint-service.d.ts +84 -0
- package/dist/server/flow-surfaces/approval/blueprint-service.js +589 -0
- package/dist/server/flow-surfaces/approval/blueprint.d.ts +21 -0
- package/dist/server/flow-surfaces/approval/blueprint.js +187 -0
- package/dist/server/flow-surfaces/approval/builder.d.ts +225 -0
- package/dist/server/flow-surfaces/approval/builder.js +384 -0
- package/dist/server/flow-surfaces/approval/catalog-specs.d.ts +33 -0
- package/dist/server/flow-surfaces/approval/catalog-specs.js +156 -0
- package/dist/server/flow-surfaces/approval/index.d.ts +14 -0
- package/dist/server/flow-surfaces/approval/index.js +40 -0
- package/dist/server/flow-surfaces/approval/runtime-config.d.ts +44 -0
- package/dist/server/flow-surfaces/approval/runtime-config.js +299 -0
- package/dist/server/flow-surfaces/approval/semantic-use.d.ts +23 -0
- package/dist/server/flow-surfaces/approval/semantic-use.js +155 -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 +1007 -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/defaults.d.ts +26 -0
- package/dist/server/flow-surfaces/blueprint/defaults.js +133 -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 +416 -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 +193 -0
- package/dist/server/flow-surfaces/blueprint/public-types.js +24 -0
- package/dist/server/flow-surfaces/builder.d.ts +211 -0
- package/dist/server/flow-surfaces/builder.js +1029 -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 +78 -0
- package/dist/server/flow-surfaces/catalog.js +3496 -0
- package/dist/server/flow-surfaces/chart-config.d.ts +121 -0
- package/dist/server/flow-surfaces/chart-config.js +1394 -0
- package/dist/server/flow-surfaces/compose-compiler.d.ts +108 -0
- package/dist/server/flow-surfaces/compose-compiler.js +167 -0
- package/dist/server/flow-surfaces/compose-runtime.d.ts +93 -0
- package/dist/server/flow-surfaces/compose-runtime.js +375 -0
- package/dist/server/flow-surfaces/configure-options.d.ts +23 -0
- package/dist/server/flow-surfaces/configure-options.js +827 -0
- package/dist/server/flow-surfaces/constants.d.ts +351 -0
- package/dist/server/flow-surfaces/constants.js +104 -0
- package/dist/server/flow-surfaces/context.d.ts +72 -0
- package/dist/server/flow-surfaces/context.js +556 -0
- package/dist/server/flow-surfaces/contract-guard.d.ts +19 -0
- package/dist/server/flow-surfaces/contract-guard.js +402 -0
- package/dist/server/flow-surfaces/default-action-popup.d.ts +63 -0
- package/dist/server/flow-surfaces/default-action-popup.js +322 -0
- package/dist/server/flow-surfaces/default-block-actions.d.ts +32 -0
- package/dist/server/flow-surfaces/default-block-actions.js +185 -0
- package/dist/server/flow-surfaces/errors.d.ts +47 -0
- package/dist/server/flow-surfaces/errors.js +145 -0
- package/dist/server/flow-surfaces/executor.d.ts +23 -0
- package/dist/server/flow-surfaces/executor.js +132 -0
- 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 +15 -0
- package/dist/server/flow-surfaces/field-semantics.js +81 -0
- package/dist/server/flow-surfaces/filter-group.d.ts +15 -0
- package/dist/server/flow-surfaces/filter-group.js +94 -0
- package/dist/server/flow-surfaces/index.d.ts +11 -0
- package/dist/server/flow-surfaces/index.js +243 -0
- package/dist/server/flow-surfaces/locator.d.ts +28 -0
- package/dist/server/flow-surfaces/locator.js +240 -0
- package/dist/server/flow-surfaces/node-use-sets.d.ts +15 -0
- package/dist/server/flow-surfaces/node-use-sets.js +131 -0
- package/dist/server/flow-surfaces/payload-shape.d.ts +9 -0
- package/dist/server/flow-surfaces/payload-shape.js +61 -0
- package/dist/server/flow-surfaces/placement.d.ts +33 -0
- package/dist/server/flow-surfaces/placement.js +195 -0
- 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 +88 -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/public-data-surface-default-filter.d.ts +20 -0
- package/dist/server/flow-surfaces/public-data-surface-default-filter.js +111 -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 +156 -0
- package/dist/server/flow-surfaces/reaction/registry.js +206 -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/route-sync.d.ts +47 -0
- package/dist/server/flow-surfaces/route-sync.js +392 -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 +108 -0
- package/dist/server/flow-surfaces/service-utils.js +811 -0
- package/dist/server/flow-surfaces/service.d.ts +773 -0
- package/dist/server/flow-surfaces/service.js +13008 -0
- package/dist/server/flow-surfaces/support-matrix.d.ts +31 -0
- package/dist/server/flow-surfaces/support-matrix.js +259 -0
- package/dist/server/flow-surfaces/surface-context.d.ts +52 -0
- package/dist/server/flow-surfaces/surface-context.js +437 -0
- 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-display.d.ts +20 -0
- package/dist/server/flow-surfaces/template-display.js +289 -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 +288 -0
- package/dist/server/flow-surfaces/types.js +24 -0
- package/dist/server/plugin.js +2 -0
- package/dist/swagger/flow-surfaces.d.ts +5964 -0
- package/dist/swagger/flow-surfaces.examples.d.ts +1533 -0
- package/dist/swagger/flow-surfaces.examples.js +1758 -0
- package/dist/swagger/flow-surfaces.js +5315 -0
- 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 +5969 -0
- package/dist/swagger/index.js +50 -0
- package/package.json +2 -2
- /package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextApis.d.ts +0 -0
- /package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextEnvs.d.ts +0 -0
- /package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextVars.d.ts +0 -0
- /package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/lintAndTestJS.d.ts +0 -0
|
@@ -0,0 +1,206 @@
|
|
|
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 registry_exports = {};
|
|
28
|
+
__export(registry_exports, {
|
|
29
|
+
FLOW_SURFACE_ACTION_LINKAGE_STATES: () => FLOW_SURFACE_ACTION_LINKAGE_STATES,
|
|
30
|
+
FLOW_SURFACE_BLOCK_LINKAGE_STATES: () => FLOW_SURFACE_BLOCK_LINKAGE_STATES,
|
|
31
|
+
FLOW_SURFACE_FIELD_LINKAGE_ACTION_TYPES_BY_SCENE: () => FLOW_SURFACE_FIELD_LINKAGE_ACTION_TYPES_BY_SCENE,
|
|
32
|
+
FLOW_SURFACE_FIELD_LINKAGE_STATES_BY_SCENE: () => FLOW_SURFACE_FIELD_LINKAGE_STATES_BY_SCENE,
|
|
33
|
+
FLOW_SURFACE_LINKAGE_CANONICAL_ACTION_NAMES: () => FLOW_SURFACE_LINKAGE_CANONICAL_ACTION_NAMES,
|
|
34
|
+
FLOW_SURFACE_REACTION_SLOT_REGISTRY: () => FLOW_SURFACE_REACTION_SLOT_REGISTRY,
|
|
35
|
+
FLOW_SURFACE_REACTION_SUPPORTED_KINDS_BY_USE: () => FLOW_SURFACE_REACTION_SUPPORTED_KINDS_BY_USE,
|
|
36
|
+
getReactionKindsForUse: () => getReactionKindsForUse,
|
|
37
|
+
getReactionSlot: () => getReactionSlot
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(registry_exports);
|
|
40
|
+
const FLOW_SURFACE_REACTION_SLOT_REGISTRY = {
|
|
41
|
+
fieldValue: {
|
|
42
|
+
form: {
|
|
43
|
+
flowKey: "formModelSettings",
|
|
44
|
+
stepKey: "assignRules",
|
|
45
|
+
valuePath: "value"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
blockLinkage: {
|
|
49
|
+
block: {
|
|
50
|
+
flowKey: "cardSettings",
|
|
51
|
+
stepKey: "linkageRules",
|
|
52
|
+
valuePath: null
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
fieldLinkage: {
|
|
56
|
+
form: {
|
|
57
|
+
flowKey: "eventSettings",
|
|
58
|
+
stepKey: "linkageRules",
|
|
59
|
+
valuePath: "value"
|
|
60
|
+
},
|
|
61
|
+
details: {
|
|
62
|
+
flowKey: "detailsSettings",
|
|
63
|
+
stepKey: "linkageRules",
|
|
64
|
+
valuePath: "value"
|
|
65
|
+
},
|
|
66
|
+
subForm: {
|
|
67
|
+
flowKey: "eventSettings",
|
|
68
|
+
stepKey: "linkageRules",
|
|
69
|
+
valuePath: "value"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
actionLinkage: {
|
|
73
|
+
action: {
|
|
74
|
+
flowKey: "buttonSettings",
|
|
75
|
+
stepKey: "linkageRules",
|
|
76
|
+
valuePath: null
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const FLOW_SURFACE_REACTION_SUPPORTED_KINDS_BY_USE = {
|
|
81
|
+
CreateFormModel: ["fieldValue", "blockLinkage", "fieldLinkage"],
|
|
82
|
+
EditFormModel: ["fieldValue", "blockLinkage", "fieldLinkage"],
|
|
83
|
+
FormBlockModel: ["blockLinkage", "fieldLinkage"],
|
|
84
|
+
ApplyFormModel: ["fieldValue", "blockLinkage", "fieldLinkage"],
|
|
85
|
+
ProcessFormModel: ["fieldValue", "blockLinkage", "fieldLinkage"],
|
|
86
|
+
DetailsBlockModel: ["blockLinkage", "fieldLinkage"],
|
|
87
|
+
ApprovalDetailsModel: ["blockLinkage", "fieldLinkage"],
|
|
88
|
+
ApplyTaskCardDetailsModel: ["blockLinkage", "fieldLinkage"],
|
|
89
|
+
ApprovalTaskCardDetailsModel: ["blockLinkage", "fieldLinkage"],
|
|
90
|
+
TableBlockModel: ["blockLinkage"],
|
|
91
|
+
CalendarBlockModel: ["blockLinkage"],
|
|
92
|
+
ListBlockModel: ["blockLinkage"],
|
|
93
|
+
GridCardBlockModel: ["blockLinkage"],
|
|
94
|
+
MarkdownBlockModel: ["blockLinkage"],
|
|
95
|
+
IframeBlockModel: ["blockLinkage"],
|
|
96
|
+
MapBlockModel: ["blockLinkage"],
|
|
97
|
+
CommentsBlockModel: ["blockLinkage"],
|
|
98
|
+
ChartBlockModel: ["blockLinkage"],
|
|
99
|
+
ActionPanelBlockModel: ["blockLinkage"],
|
|
100
|
+
AddNewActionModel: ["actionLinkage"],
|
|
101
|
+
ViewActionModel: ["actionLinkage"],
|
|
102
|
+
EditActionModel: ["actionLinkage"],
|
|
103
|
+
PopupCollectionActionModel: ["actionLinkage"],
|
|
104
|
+
DeleteActionModel: ["actionLinkage"],
|
|
105
|
+
UpdateRecordActionModel: ["actionLinkage"],
|
|
106
|
+
BulkUpdateActionModel: ["actionLinkage"],
|
|
107
|
+
BulkDeleteActionModel: ["actionLinkage"],
|
|
108
|
+
BulkEditActionModel: ["actionLinkage"],
|
|
109
|
+
DuplicateActionModel: ["actionLinkage"],
|
|
110
|
+
AddChildActionModel: ["actionLinkage"],
|
|
111
|
+
MailSendActionModel: ["actionLinkage"],
|
|
112
|
+
JSCollectionActionModel: ["actionLinkage"],
|
|
113
|
+
JSRecordActionModel: ["actionLinkage"],
|
|
114
|
+
JSFormActionModel: ["actionLinkage"],
|
|
115
|
+
JSItemActionModel: ["actionLinkage"],
|
|
116
|
+
FilterFormJSActionModel: ["actionLinkage"],
|
|
117
|
+
JSActionModel: ["actionLinkage"],
|
|
118
|
+
CalendarTodayActionModel: ["actionLinkage"],
|
|
119
|
+
CalendarNavActionModel: ["actionLinkage"],
|
|
120
|
+
CalendarTitleActionModel: ["actionLinkage"],
|
|
121
|
+
CalendarViewSelectActionModel: ["actionLinkage"],
|
|
122
|
+
LinkActionModel: ["actionLinkage"],
|
|
123
|
+
ExportActionModel: ["actionLinkage"],
|
|
124
|
+
ExportAttachmentActionModel: ["actionLinkage"],
|
|
125
|
+
ImportActionModel: ["actionLinkage"],
|
|
126
|
+
CollectionTriggerWorkflowActionModel: ["actionLinkage"],
|
|
127
|
+
RecordTriggerWorkflowActionModel: ["actionLinkage"],
|
|
128
|
+
FormTriggerWorkflowActionModel: ["actionLinkage"],
|
|
129
|
+
WorkbenchTriggerWorkflowActionModel: ["actionLinkage"],
|
|
130
|
+
RefreshActionModel: ["actionLinkage"],
|
|
131
|
+
FilterActionModel: ["actionLinkage"],
|
|
132
|
+
ExpandCollapseActionModel: ["actionLinkage"],
|
|
133
|
+
FormSubmitActionModel: ["actionLinkage"],
|
|
134
|
+
ApplyFormSubmitModel: ["actionLinkage"],
|
|
135
|
+
ApplyFormSaveDraftModel: ["actionLinkage"],
|
|
136
|
+
ApplyFormWithdrawModel: ["actionLinkage"],
|
|
137
|
+
ProcessFormApproveModel: ["actionLinkage"],
|
|
138
|
+
ProcessFormRejectModel: ["actionLinkage"],
|
|
139
|
+
ProcessFormReturnModel: ["actionLinkage"],
|
|
140
|
+
ProcessFormDelegateModel: ["actionLinkage"],
|
|
141
|
+
ProcessFormAddAssigneeModel: ["actionLinkage"],
|
|
142
|
+
FilterFormSubmitActionModel: ["actionLinkage"],
|
|
143
|
+
FilterFormResetActionModel: ["actionLinkage"],
|
|
144
|
+
FilterFormCollapseActionModel: ["actionLinkage"],
|
|
145
|
+
SubFormFieldModel: ["fieldLinkage"],
|
|
146
|
+
SubFormListFieldModel: ["fieldLinkage"]
|
|
147
|
+
};
|
|
148
|
+
const FLOW_SURFACE_BLOCK_LINKAGE_STATES = ["visible", "hidden"];
|
|
149
|
+
const FLOW_SURFACE_ACTION_LINKAGE_STATES = ["visible", "hidden", "hiddenText", "enabled", "disabled"];
|
|
150
|
+
const FLOW_SURFACE_FIELD_LINKAGE_STATES_BY_SCENE = {
|
|
151
|
+
form: ["visible", "hidden", "hiddenReservedValue", "required", "notRequired", "disabled", "enabled"],
|
|
152
|
+
details: ["visible", "hidden", "hiddenReservedValue"],
|
|
153
|
+
subForm: ["visible", "hidden", "hiddenReservedValue", "required", "notRequired", "disabled", "enabled"]
|
|
154
|
+
};
|
|
155
|
+
const FLOW_SURFACE_FIELD_LINKAGE_ACTION_TYPES_BY_SCENE = {
|
|
156
|
+
form: ["setFieldState", "assignField", "setFieldDefaultValue", "runjs"],
|
|
157
|
+
details: ["setFieldState", "runjs"],
|
|
158
|
+
subForm: ["setFieldState", "assignField", "runjs"]
|
|
159
|
+
};
|
|
160
|
+
const FLOW_SURFACE_LINKAGE_CANONICAL_ACTION_NAMES = {
|
|
161
|
+
block: {
|
|
162
|
+
setBlockState: "linkageSetBlockProps",
|
|
163
|
+
runjs: "linkageRunjs"
|
|
164
|
+
},
|
|
165
|
+
action: {
|
|
166
|
+
setActionState: "linkageSetActionProps",
|
|
167
|
+
runjs: "linkageRunjs"
|
|
168
|
+
},
|
|
169
|
+
form: {
|
|
170
|
+
setFieldState: "linkageSetFieldProps",
|
|
171
|
+
assignField: "linkageAssignField",
|
|
172
|
+
setFieldDefaultValue: "setFieldsDefaultValue",
|
|
173
|
+
runjs: "linkageRunjs"
|
|
174
|
+
},
|
|
175
|
+
details: {
|
|
176
|
+
setFieldState: "linkageSetDetailsFieldProps",
|
|
177
|
+
runjs: "linkageRunjs"
|
|
178
|
+
},
|
|
179
|
+
subForm: {
|
|
180
|
+
setFieldState: "subFormLinkageSetFieldProps",
|
|
181
|
+
assignField: "subFormLinkageAssignField",
|
|
182
|
+
runjs: "linkageRunjs"
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
function getReactionKindsForUse(use) {
|
|
186
|
+
if (!use) {
|
|
187
|
+
return [];
|
|
188
|
+
}
|
|
189
|
+
return [...FLOW_SURFACE_REACTION_SUPPORTED_KINDS_BY_USE[use] || []];
|
|
190
|
+
}
|
|
191
|
+
function getReactionSlot(kind, scene) {
|
|
192
|
+
var _a;
|
|
193
|
+
return (_a = FLOW_SURFACE_REACTION_SLOT_REGISTRY[kind]) == null ? void 0 : _a[scene];
|
|
194
|
+
}
|
|
195
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
196
|
+
0 && (module.exports = {
|
|
197
|
+
FLOW_SURFACE_ACTION_LINKAGE_STATES,
|
|
198
|
+
FLOW_SURFACE_BLOCK_LINKAGE_STATES,
|
|
199
|
+
FLOW_SURFACE_FIELD_LINKAGE_ACTION_TYPES_BY_SCENE,
|
|
200
|
+
FLOW_SURFACE_FIELD_LINKAGE_STATES_BY_SCENE,
|
|
201
|
+
FLOW_SURFACE_LINKAGE_CANONICAL_ACTION_NAMES,
|
|
202
|
+
FLOW_SURFACE_REACTION_SLOT_REGISTRY,
|
|
203
|
+
FLOW_SURFACE_REACTION_SUPPORTED_KINDS_BY_USE,
|
|
204
|
+
getReactionKindsForUse,
|
|
205
|
+
getReactionSlot
|
|
206
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
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 { FlowSurfaceReactionKind, FlowSurfaceResolveReactionCapabilityResult, FlowSurfaceResolveReactionTargetValues, FlowSurfaceResolvedReactionCapability, FlowSurfaceResolvedReactionTarget } from './types';
|
|
10
|
+
type FlowSurfaceReactionReadbackLike = {
|
|
11
|
+
tree?: any;
|
|
12
|
+
nodeMap?: Record<string, any>;
|
|
13
|
+
};
|
|
14
|
+
type FlowSurfaceResolveReactionTargetFromReadbackValues = Omit<FlowSurfaceResolveReactionTargetValues, 'node' | 'use'> & {
|
|
15
|
+
readback: FlowSurfaceReactionReadbackLike;
|
|
16
|
+
};
|
|
17
|
+
export declare function findReactionTargetNodeInReadback(readback: FlowSurfaceReactionReadbackLike, uid: string): any;
|
|
18
|
+
export declare function resolveReactionTarget(values: FlowSurfaceResolveReactionTargetValues): FlowSurfaceResolvedReactionTarget;
|
|
19
|
+
export declare function resolveReactionTargetFromReadback(values: FlowSurfaceResolveReactionTargetFromReadbackValues): FlowSurfaceResolvedReactionTarget;
|
|
20
|
+
export declare function resolveReactionCapability(resolvedTarget: FlowSurfaceResolvedReactionTarget, kind: FlowSurfaceReactionKind): FlowSurfaceResolveReactionCapabilityResult;
|
|
21
|
+
export declare function resolveReactionStorageNode(resolvedTarget: FlowSurfaceResolvedReactionTarget, capability: FlowSurfaceResolvedReactionCapability): any;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,202 @@
|
|
|
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 resolver_exports = {};
|
|
28
|
+
__export(resolver_exports, {
|
|
29
|
+
findReactionTargetNodeInReadback: () => findReactionTargetNodeInReadback,
|
|
30
|
+
resolveReactionCapability: () => resolveReactionCapability,
|
|
31
|
+
resolveReactionStorageNode: () => resolveReactionStorageNode,
|
|
32
|
+
resolveReactionTarget: () => resolveReactionTarget,
|
|
33
|
+
resolveReactionTargetFromReadback: () => resolveReactionTargetFromReadback
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(resolver_exports);
|
|
36
|
+
var import_errors = require("../errors");
|
|
37
|
+
var import_errors2 = require("./errors");
|
|
38
|
+
var import_registry = require("./registry");
|
|
39
|
+
const FORM_REACTION_USES = /* @__PURE__ */ new Set(["CreateFormModel", "EditFormModel", "FormBlockModel"]);
|
|
40
|
+
const DETAILS_REACTION_USES = /* @__PURE__ */ new Set(["DetailsBlockModel"]);
|
|
41
|
+
const SUB_FORM_REACTION_USES = /* @__PURE__ */ new Set(["SubFormFieldModel", "SubFormListFieldModel"]);
|
|
42
|
+
const FORM_GRID_STORAGE_KINDS = /* @__PURE__ */ new Set(["fieldValue", "fieldLinkage"]);
|
|
43
|
+
function normalizeTargetUid(input) {
|
|
44
|
+
const uid = String((input == null ? void 0 : input.uid) || "").trim();
|
|
45
|
+
if (!uid) {
|
|
46
|
+
(0, import_errors.throwBadRequest)("flowSurfaces reaction requires target.uid");
|
|
47
|
+
}
|
|
48
|
+
return uid;
|
|
49
|
+
}
|
|
50
|
+
function inferReactionTargetKind(use, supportedKinds) {
|
|
51
|
+
if (SUB_FORM_REACTION_USES.has(use || "")) {
|
|
52
|
+
return "fieldHost";
|
|
53
|
+
}
|
|
54
|
+
if (supportedKinds.includes("actionLinkage") && supportedKinds.length === 1) {
|
|
55
|
+
return "action";
|
|
56
|
+
}
|
|
57
|
+
return "block";
|
|
58
|
+
}
|
|
59
|
+
function inferReactionScene(kind, use) {
|
|
60
|
+
switch (kind) {
|
|
61
|
+
case "fieldValue":
|
|
62
|
+
return FORM_REACTION_USES.has(use || "") ? "form" : void 0;
|
|
63
|
+
case "blockLinkage":
|
|
64
|
+
return "block";
|
|
65
|
+
case "actionLinkage":
|
|
66
|
+
return "action";
|
|
67
|
+
case "fieldLinkage":
|
|
68
|
+
if (FORM_REACTION_USES.has(use || "")) {
|
|
69
|
+
return "form";
|
|
70
|
+
}
|
|
71
|
+
if (DETAILS_REACTION_USES.has(use || "")) {
|
|
72
|
+
return "details";
|
|
73
|
+
}
|
|
74
|
+
if (SUB_FORM_REACTION_USES.has(use || "")) {
|
|
75
|
+
return "subForm";
|
|
76
|
+
}
|
|
77
|
+
return void 0;
|
|
78
|
+
default:
|
|
79
|
+
return void 0;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function buildUnsupportedTargetMessage(kind, use) {
|
|
83
|
+
if (kind === "fieldValue") {
|
|
84
|
+
return "flowSurfaces reaction field values are only available on create/edit form blocks";
|
|
85
|
+
}
|
|
86
|
+
return `flowSurfaces reaction target '${use || "unknown"}' does not support ${kind}`;
|
|
87
|
+
}
|
|
88
|
+
function findReactionTargetNodeInReadback(readback, uid) {
|
|
89
|
+
var _a;
|
|
90
|
+
const normalizedUid = String(uid || "").trim();
|
|
91
|
+
if (!normalizedUid) {
|
|
92
|
+
return void 0;
|
|
93
|
+
}
|
|
94
|
+
const visit = (node) => {
|
|
95
|
+
if (!node || typeof node !== "object") {
|
|
96
|
+
return void 0;
|
|
97
|
+
}
|
|
98
|
+
if (node.uid === normalizedUid) {
|
|
99
|
+
return node;
|
|
100
|
+
}
|
|
101
|
+
for (const child of Object.values(node.subModels || {})) {
|
|
102
|
+
const children = Array.isArray(child) ? child : [child];
|
|
103
|
+
for (const item of children) {
|
|
104
|
+
const matched = visit(item);
|
|
105
|
+
if (matched) {
|
|
106
|
+
return matched;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return void 0;
|
|
111
|
+
};
|
|
112
|
+
return visit(readback == null ? void 0 : readback.tree) || ((_a = readback == null ? void 0 : readback.nodeMap) == null ? void 0 : _a[normalizedUid]);
|
|
113
|
+
}
|
|
114
|
+
function resolveReactionTarget(values) {
|
|
115
|
+
const uid = normalizeTargetUid(values.target);
|
|
116
|
+
const node = values.node || {};
|
|
117
|
+
const use = String(values.use || (node == null ? void 0 : node.use) || "").trim() || void 0;
|
|
118
|
+
const supportedKinds = (0, import_registry.getReactionKindsForUse)(use);
|
|
119
|
+
if (!supportedKinds.length) {
|
|
120
|
+
(0, import_errors.throwBadRequest)(
|
|
121
|
+
`flowSurfaces reaction target '${use || uid}' does not support advanced reaction capabilities`,
|
|
122
|
+
import_errors2.FLOW_SURFACE_REACTION_UNSUPPORTED_TARGET_KIND
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
const capabilities = supportedKinds.map((kind) => {
|
|
126
|
+
const resolvedScene = inferReactionScene(kind, use);
|
|
127
|
+
if (!resolvedScene) {
|
|
128
|
+
(0, import_errors.throwBadRequest)(
|
|
129
|
+
`flowSurfaces reaction target '${use || uid}' cannot uniquely resolve scene for ${kind}`,
|
|
130
|
+
import_errors2.FLOW_SURFACE_REACTION_AMBIGUOUS_SCENE
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
const resolvedSlot = (0, import_registry.getReactionSlot)(kind, resolvedScene);
|
|
134
|
+
if (!resolvedSlot) {
|
|
135
|
+
(0, import_errors.throwBadRequest)(
|
|
136
|
+
`flowSurfaces reaction target '${use || uid}' cannot resolve storage slot for ${kind}`,
|
|
137
|
+
import_errors2.FLOW_SURFACE_REACTION_AMBIGUOUS_SCENE
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
kind,
|
|
142
|
+
resolvedScene,
|
|
143
|
+
resolvedSlot
|
|
144
|
+
};
|
|
145
|
+
});
|
|
146
|
+
return {
|
|
147
|
+
target: {
|
|
148
|
+
uid,
|
|
149
|
+
publicPath: String(
|
|
150
|
+
values.publicPath || ("publicPath" in values.target && typeof values.target.publicPath === "string" ? values.target.publicPath : "")
|
|
151
|
+
).trim() || void 0
|
|
152
|
+
},
|
|
153
|
+
node,
|
|
154
|
+
use,
|
|
155
|
+
targetKind: inferReactionTargetKind(use, supportedKinds),
|
|
156
|
+
capabilities
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
function resolveReactionTargetFromReadback(values) {
|
|
160
|
+
const uid = normalizeTargetUid(values.target);
|
|
161
|
+
const node = findReactionTargetNodeInReadback(values.readback, uid);
|
|
162
|
+
return resolveReactionTarget({
|
|
163
|
+
node,
|
|
164
|
+
use: node == null ? void 0 : node.use,
|
|
165
|
+
target: values.target,
|
|
166
|
+
publicPath: values.publicPath
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
function resolveReactionCapability(resolvedTarget, kind) {
|
|
170
|
+
const matched = resolvedTarget.capabilities.find((item) => item.kind === kind);
|
|
171
|
+
if (!matched) {
|
|
172
|
+
(0, import_errors.throwBadRequest)(
|
|
173
|
+
buildUnsupportedTargetMessage(kind, resolvedTarget.use),
|
|
174
|
+
kind === "fieldValue" ? import_errors2.FLOW_SURFACE_REACTION_FORM_ONLY : import_errors2.FLOW_SURFACE_REACTION_UNSUPPORTED_TARGET_KIND
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
return {
|
|
178
|
+
...resolvedTarget,
|
|
179
|
+
...matched
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
function resolveReactionStorageNode(resolvedTarget, capability) {
|
|
183
|
+
var _a, _b;
|
|
184
|
+
if (FORM_REACTION_USES.has(resolvedTarget.use || "") && capability.resolvedScene === "form" && FORM_GRID_STORAGE_KINDS.has(capability.kind)) {
|
|
185
|
+
const gridNode = (_b = (_a = resolvedTarget.node) == null ? void 0 : _a.subModels) == null ? void 0 : _b.grid;
|
|
186
|
+
if (gridNode && typeof gridNode === "object" && String(gridNode.uid || "").trim()) {
|
|
187
|
+
return gridNode;
|
|
188
|
+
}
|
|
189
|
+
(0, import_errors.throwBadRequest)(
|
|
190
|
+
`flowSurfaces reaction target '${resolvedTarget.use || resolvedTarget.target.uid}' is missing form grid storage node for ${capability.kind}`
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
return resolvedTarget.node;
|
|
194
|
+
}
|
|
195
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
196
|
+
0 && (module.exports = {
|
|
197
|
+
findReactionTargetNodeInReadback,
|
|
198
|
+
resolveReactionCapability,
|
|
199
|
+
resolveReactionStorageNode,
|
|
200
|
+
resolveReactionTarget,
|
|
201
|
+
resolveReactionTargetFromReadback
|
|
202
|
+
});
|
|
@@ -0,0 +1,241 @@
|
|
|
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 { FlowSurfaceContextResponse, FlowSurfaceWriteTarget } from '../types';
|
|
10
|
+
export type FlowSurfaceReactionKind = 'fieldValue' | 'blockLinkage' | 'fieldLinkage' | 'actionLinkage';
|
|
11
|
+
export type FlowSurfaceReactionScene = 'form' | 'block' | 'action' | 'details' | 'subForm';
|
|
12
|
+
export type FlowSurfaceFieldLinkageScene = Extract<FlowSurfaceReactionScene, 'form' | 'details' | 'subForm'>;
|
|
13
|
+
export type FlowSurfaceReactionSlot = {
|
|
14
|
+
flowKey: string;
|
|
15
|
+
stepKey: string;
|
|
16
|
+
valuePath?: string | null;
|
|
17
|
+
};
|
|
18
|
+
export type FlowSurfaceReactionFilter = Record<string, any>;
|
|
19
|
+
export type FlowSurfaceValueExpr = {
|
|
20
|
+
source: 'literal';
|
|
21
|
+
value: any;
|
|
22
|
+
} | {
|
|
23
|
+
source: 'path';
|
|
24
|
+
path: string;
|
|
25
|
+
} | {
|
|
26
|
+
source: 'runjs';
|
|
27
|
+
code: string;
|
|
28
|
+
version?: 'v1' | 'v2';
|
|
29
|
+
};
|
|
30
|
+
export type FlowSurfaceFieldValueRule = {
|
|
31
|
+
key?: string;
|
|
32
|
+
title?: string;
|
|
33
|
+
enabled?: boolean;
|
|
34
|
+
targetPath: string;
|
|
35
|
+
mode?: 'default' | 'assign';
|
|
36
|
+
when?: FlowSurfaceReactionFilter;
|
|
37
|
+
value: FlowSurfaceValueExpr;
|
|
38
|
+
};
|
|
39
|
+
export type FlowSurfaceBlockLinkageAction = {
|
|
40
|
+
key?: string;
|
|
41
|
+
type: 'setBlockState';
|
|
42
|
+
state: 'visible' | 'hidden';
|
|
43
|
+
} | {
|
|
44
|
+
key?: string;
|
|
45
|
+
type: 'runjs';
|
|
46
|
+
code: string;
|
|
47
|
+
version?: 'v1' | 'v2';
|
|
48
|
+
};
|
|
49
|
+
export type FlowSurfaceActionLinkageAction = {
|
|
50
|
+
key?: string;
|
|
51
|
+
type: 'setActionState';
|
|
52
|
+
state: 'visible' | 'hidden' | 'hiddenText' | 'enabled' | 'disabled';
|
|
53
|
+
} | {
|
|
54
|
+
key?: string;
|
|
55
|
+
type: 'runjs';
|
|
56
|
+
code: string;
|
|
57
|
+
version?: 'v1' | 'v2';
|
|
58
|
+
};
|
|
59
|
+
export type FlowSurfaceFieldLinkageAssignItem = {
|
|
60
|
+
key?: string;
|
|
61
|
+
enabled?: boolean;
|
|
62
|
+
targetPath: string;
|
|
63
|
+
when?: FlowSurfaceReactionFilter;
|
|
64
|
+
value: FlowSurfaceValueExpr;
|
|
65
|
+
};
|
|
66
|
+
export type FlowSurfaceFieldLinkageAction = {
|
|
67
|
+
key?: string;
|
|
68
|
+
type: 'setFieldState';
|
|
69
|
+
fieldPaths: string[];
|
|
70
|
+
state: 'visible' | 'hidden' | 'hiddenReservedValue' | 'required' | 'notRequired' | 'disabled' | 'enabled';
|
|
71
|
+
} | {
|
|
72
|
+
key?: string;
|
|
73
|
+
type: 'assignField';
|
|
74
|
+
items: FlowSurfaceFieldLinkageAssignItem[];
|
|
75
|
+
} | {
|
|
76
|
+
key?: string;
|
|
77
|
+
type: 'setFieldDefaultValue';
|
|
78
|
+
items: FlowSurfaceFieldLinkageAssignItem[];
|
|
79
|
+
} | {
|
|
80
|
+
key?: string;
|
|
81
|
+
type: 'runjs';
|
|
82
|
+
code: string;
|
|
83
|
+
version?: 'v1' | 'v2';
|
|
84
|
+
};
|
|
85
|
+
export type FlowSurfaceFieldUidToPathResolver = (fieldUid: string) => string | undefined;
|
|
86
|
+
export type FlowSurfaceFieldPathToUidResolver = (fieldPath: string) => string | undefined;
|
|
87
|
+
export type FlowSurfaceBlockLinkageRule = {
|
|
88
|
+
key?: string;
|
|
89
|
+
title?: string;
|
|
90
|
+
enabled?: boolean;
|
|
91
|
+
when?: FlowSurfaceReactionFilter;
|
|
92
|
+
then: FlowSurfaceBlockLinkageAction[];
|
|
93
|
+
};
|
|
94
|
+
export type FlowSurfaceActionLinkageRule = {
|
|
95
|
+
key?: string;
|
|
96
|
+
title?: string;
|
|
97
|
+
enabled?: boolean;
|
|
98
|
+
when?: FlowSurfaceReactionFilter;
|
|
99
|
+
then: FlowSurfaceActionLinkageAction[];
|
|
100
|
+
};
|
|
101
|
+
export type FlowSurfaceFieldLinkageRule = {
|
|
102
|
+
key?: string;
|
|
103
|
+
title?: string;
|
|
104
|
+
enabled?: boolean;
|
|
105
|
+
when?: FlowSurfaceReactionFilter;
|
|
106
|
+
then: FlowSurfaceFieldLinkageAction[];
|
|
107
|
+
};
|
|
108
|
+
export type FlowSurfaceReactionTargetSummary = {
|
|
109
|
+
uid: string;
|
|
110
|
+
publicPath?: string;
|
|
111
|
+
};
|
|
112
|
+
export type FlowSurfaceReactionResolvedTargetKind = 'block' | 'action' | 'fieldHost';
|
|
113
|
+
export type FlowSurfaceResolvedReactionCapability = {
|
|
114
|
+
kind: FlowSurfaceReactionKind;
|
|
115
|
+
resolvedScene: FlowSurfaceReactionScene;
|
|
116
|
+
resolvedSlot: FlowSurfaceReactionSlot;
|
|
117
|
+
};
|
|
118
|
+
export type FlowSurfaceResolvedReactionTarget = {
|
|
119
|
+
target: FlowSurfaceReactionTargetSummary;
|
|
120
|
+
node: any;
|
|
121
|
+
use?: string;
|
|
122
|
+
targetKind: FlowSurfaceReactionResolvedTargetKind;
|
|
123
|
+
capabilities: FlowSurfaceResolvedReactionCapability[];
|
|
124
|
+
};
|
|
125
|
+
export type FlowSurfaceResolveReactionTargetValues = {
|
|
126
|
+
target: FlowSurfaceWriteTarget | FlowSurfaceReactionTargetSummary;
|
|
127
|
+
node?: any;
|
|
128
|
+
use?: string;
|
|
129
|
+
publicPath?: string;
|
|
130
|
+
};
|
|
131
|
+
export type FlowSurfaceResolveReactionCapabilityResult = FlowSurfaceResolvedReactionTarget & FlowSurfaceResolvedReactionCapability;
|
|
132
|
+
export type FlowSurfaceReactionWriteValues<T> = {
|
|
133
|
+
target: FlowSurfaceWriteTarget;
|
|
134
|
+
rules: T[];
|
|
135
|
+
expectedFingerprint?: string;
|
|
136
|
+
verify?: boolean;
|
|
137
|
+
};
|
|
138
|
+
export type FlowSurfaceReactionWriteResult<T> = {
|
|
139
|
+
target: FlowSurfaceReactionTargetSummary;
|
|
140
|
+
resolvedScene: FlowSurfaceReactionScene;
|
|
141
|
+
resolvedSlot: FlowSurfaceReactionSlot;
|
|
142
|
+
fingerprint: string;
|
|
143
|
+
normalizedRules: T[];
|
|
144
|
+
canonicalRules: any[];
|
|
145
|
+
};
|
|
146
|
+
export type FlowSurfaceFieldOption = {
|
|
147
|
+
path: string;
|
|
148
|
+
label: string;
|
|
149
|
+
interface?: string;
|
|
150
|
+
type?: string;
|
|
151
|
+
supportsDefault?: boolean;
|
|
152
|
+
supportsAssign?: boolean;
|
|
153
|
+
supportsState?: string[];
|
|
154
|
+
};
|
|
155
|
+
export type FlowSurfaceReactionCapabilityBase<TKind extends FlowSurfaceReactionKind, TRule> = {
|
|
156
|
+
kind: TKind;
|
|
157
|
+
resolvedScene: FlowSurfaceReactionScene;
|
|
158
|
+
resolvedSlot: FlowSurfaceReactionSlot;
|
|
159
|
+
fingerprint: string;
|
|
160
|
+
normalizedRules: TRule[];
|
|
161
|
+
canonicalRules: any[];
|
|
162
|
+
context: FlowSurfaceContextResponse;
|
|
163
|
+
};
|
|
164
|
+
export type FlowSurfaceFieldValueCapability = FlowSurfaceReactionCapabilityBase<'fieldValue', FlowSurfaceFieldValueRule> & {
|
|
165
|
+
targetFields: FlowSurfaceFieldOption[];
|
|
166
|
+
valueExprMeta: {
|
|
167
|
+
supportedSources: Array<'literal' | 'path' | 'runjs'>;
|
|
168
|
+
runjsScene: 'fieldValue';
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
export type FlowSurfaceLinkageCapability = (FlowSurfaceReactionCapabilityBase<'blockLinkage', FlowSurfaceBlockLinkageRule> & {
|
|
172
|
+
supportedActions: Array<Record<string, any>>;
|
|
173
|
+
conditionMeta: {
|
|
174
|
+
operatorsByPath: Record<string, string[]>;
|
|
175
|
+
};
|
|
176
|
+
}) | (FlowSurfaceReactionCapabilityBase<'actionLinkage', FlowSurfaceActionLinkageRule> & {
|
|
177
|
+
supportedActions: Array<Record<string, any>>;
|
|
178
|
+
conditionMeta: {
|
|
179
|
+
operatorsByPath: Record<string, string[]>;
|
|
180
|
+
};
|
|
181
|
+
}) | (FlowSurfaceReactionCapabilityBase<'fieldLinkage', FlowSurfaceFieldLinkageRule> & {
|
|
182
|
+
supportedActions: Array<Record<string, any>>;
|
|
183
|
+
targetFields: FlowSurfaceFieldOption[];
|
|
184
|
+
conditionMeta: {
|
|
185
|
+
operatorsByPath: Record<string, string[]>;
|
|
186
|
+
};
|
|
187
|
+
valueExprMeta?: {
|
|
188
|
+
supportedSources: Array<'literal' | 'path' | 'runjs'>;
|
|
189
|
+
runjsScene: 'linkage';
|
|
190
|
+
};
|
|
191
|
+
});
|
|
192
|
+
export type FlowSurfaceReactionCapability = FlowSurfaceFieldValueCapability | FlowSurfaceLinkageCapability;
|
|
193
|
+
export type FlowSurfaceReactionUnavailableCapability = {
|
|
194
|
+
kind: FlowSurfaceReactionKind;
|
|
195
|
+
code: string;
|
|
196
|
+
reason: string;
|
|
197
|
+
};
|
|
198
|
+
export type FlowSurfaceReactionRuleNormalizerInput = {
|
|
199
|
+
kind: FlowSurfaceReactionKind;
|
|
200
|
+
resolvedScene: FlowSurfaceReactionScene;
|
|
201
|
+
resolvedSlot: FlowSurfaceReactionSlot;
|
|
202
|
+
canonicalRules: any[];
|
|
203
|
+
node: any;
|
|
204
|
+
context: FlowSurfaceContextResponse;
|
|
205
|
+
};
|
|
206
|
+
export type FlowSurfaceReactionRuleNormalizer = (input: FlowSurfaceReactionRuleNormalizerInput) => any[];
|
|
207
|
+
export type FlowSurfaceReactionRuleNormalizers = Partial<Record<FlowSurfaceReactionKind, FlowSurfaceReactionRuleNormalizer>>;
|
|
208
|
+
export type FlowSurfaceGetReactionMetaValues = {
|
|
209
|
+
target: FlowSurfaceWriteTarget;
|
|
210
|
+
};
|
|
211
|
+
export type FlowSurfaceGetReactionMetaResult = {
|
|
212
|
+
target: FlowSurfaceReactionTargetSummary;
|
|
213
|
+
capabilities: FlowSurfaceReactionCapability[];
|
|
214
|
+
unavailable: FlowSurfaceReactionUnavailableCapability[];
|
|
215
|
+
};
|
|
216
|
+
export type FlowSurfaceApplyBlueprintReactionItem = {
|
|
217
|
+
type: 'setFieldValueRules';
|
|
218
|
+
target: string;
|
|
219
|
+
rules: FlowSurfaceFieldValueRule[];
|
|
220
|
+
expectedFingerprint?: string;
|
|
221
|
+
} | {
|
|
222
|
+
type: 'setBlockLinkageRules';
|
|
223
|
+
target: string;
|
|
224
|
+
rules: FlowSurfaceBlockLinkageRule[];
|
|
225
|
+
expectedFingerprint?: string;
|
|
226
|
+
} | {
|
|
227
|
+
type: 'setFieldLinkageRules';
|
|
228
|
+
target: string;
|
|
229
|
+
rules: FlowSurfaceFieldLinkageRule[];
|
|
230
|
+
expectedFingerprint?: string;
|
|
231
|
+
} | {
|
|
232
|
+
type: 'setActionLinkageRules';
|
|
233
|
+
target: string;
|
|
234
|
+
rules: FlowSurfaceActionLinkageRule[];
|
|
235
|
+
expectedFingerprint?: string;
|
|
236
|
+
};
|
|
237
|
+
export type FlowSurfaceBuildReactionMetaCapabilitiesInput = {
|
|
238
|
+
resolvedTarget: FlowSurfaceResolvedReactionTarget;
|
|
239
|
+
context: FlowSurfaceContextResponse;
|
|
240
|
+
normalizeRules?: FlowSurfaceReactionRuleNormalizers;
|
|
241
|
+
};
|