@nocobase/plugin-flow-engine 2.1.0-beta.2 → 2.1.0-beta.21
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/LICENSE +201 -661
- package/README.md +79 -9
- 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/sql.md +7 -15
- 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 +12 -11
- 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/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/collections/flowsql.js +1 -0
- package/dist/server/flow-surfaces/action-scope.d.ts +39 -0
- package/dist/server/flow-surfaces/action-scope.js +156 -0
- package/dist/server/flow-surfaces/apply/compiler.d.ts +13 -0
- package/dist/server/flow-surfaces/apply/compiler.js +971 -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-interfaces.d.ts +10 -0
- package/dist/server/flow-surfaces/association-interfaces.js +39 -0
- package/dist/server/flow-surfaces/association-title-field.d.ts +20 -0
- package/dist/server/flow-surfaces/association-title-field.js +192 -0
- package/dist/server/flow-surfaces/blueprint/compile-blocks.d.ts +14 -0
- package/dist/server/flow-surfaces/blueprint/compile-blocks.js +1074 -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 +201 -0
- package/dist/server/flow-surfaces/blueprint/public-types.js +24 -0
- package/dist/server/flow-surfaces/builder.d.ts +237 -0
- package/dist/server/flow-surfaces/builder.js +1129 -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 +79 -0
- package/dist/server/flow-surfaces/catalog.js +3693 -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 +116 -0
- package/dist/server/flow-surfaces/compose-compiler.js +175 -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 +893 -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/core-field-default-bindings.d.ts +12 -0
- package/dist/server/flow-surfaces/core-field-default-bindings.js +157 -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 +209 -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 +24 -0
- package/dist/server/flow-surfaces/field-binding-registry.js +396 -0
- package/dist/server/flow-surfaces/field-semantics.d.ts +15 -0
- package/dist/server/flow-surfaces/field-semantics.js +84 -0
- package/dist/server/flow-surfaces/field-type-resolver.d.ts +46 -0
- package/dist/server/flow-surfaces/field-type-resolver.js +322 -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 +302 -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 +135 -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 +198 -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 +24 -0
- package/dist/server/flow-surfaces/public-data-surface-default-filter.js +152 -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 +310 -0
- package/dist/server/flow-surfaces/service-utils.d.ts +120 -0
- package/dist/server/flow-surfaces/service-utils.js +863 -0
- package/dist/server/flow-surfaces/service.d.ts +830 -0
- package/dist/server/flow-surfaces/service.js +15043 -0
- package/dist/server/flow-surfaces/support-matrix.d.ts +31 -0
- package/dist/server/flow-surfaces/support-matrix.js +282 -0
- package/dist/server/flow-surfaces/surface-context.d.ts +52 -0
- package/dist/server/flow-surfaces/surface-context.js +440 -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/index.d.ts +1 -0
- package/dist/server/index.js +7 -2
- package/dist/server/plugin.d.ts +0 -1
- package/dist/server/plugin.js +9 -34
- package/dist/server/repository.js +0 -5
- package/dist/server/variables/resolve.d.ts +21 -0
- package/dist/server/variables/resolve.js +79 -0
- package/dist/swagger/flow-surfaces.d.ts +6135 -0
- package/dist/swagger/flow-surfaces.examples.d.ts +1577 -0
- package/dist/swagger/flow-surfaces.examples.js +1816 -0
- package/dist/swagger/flow-surfaces.js +5384 -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 +6140 -0
- package/dist/swagger/index.js +50 -0
- package/package.json +3 -3
- /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,14 @@
|
|
|
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 { isFlowSurfacePlanStepValue } from '../reference-guards';
|
|
10
|
+
import type { FlowSurfacePlanStepLink } from '../types';
|
|
11
|
+
export declare const isFlowSurfacePlanStepLink: typeof isFlowSurfacePlanStepValue;
|
|
12
|
+
export declare function normalizeFlowSurfacePlanStepLink(actionName: string, input: any, fieldName: string): FlowSurfacePlanStepLink;
|
|
13
|
+
export declare function assertFlowSurfaceKnownPlanStepLink(actionName: string, stepLink: FlowSurfacePlanStepLink, fieldName: string, knownStepIds?: Set<string>): void;
|
|
14
|
+
export declare function replaceFlowSurfacePlanStepLinks(actionName: string, input: any, path: string, knownStepIds?: Set<string>, knownRuntimeKeys?: Set<string>): any;
|
|
@@ -0,0 +1,104 @@
|
|
|
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 __create = Object.create;
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
36
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
+
var step_link_exports = {};
|
|
38
|
+
__export(step_link_exports, {
|
|
39
|
+
assertFlowSurfaceKnownPlanStepLink: () => assertFlowSurfaceKnownPlanStepLink,
|
|
40
|
+
isFlowSurfacePlanStepLink: () => isFlowSurfacePlanStepLink,
|
|
41
|
+
normalizeFlowSurfacePlanStepLink: () => normalizeFlowSurfacePlanStepLink,
|
|
42
|
+
replaceFlowSurfacePlanStepLinks: () => replaceFlowSurfacePlanStepLinks
|
|
43
|
+
});
|
|
44
|
+
module.exports = __toCommonJS(step_link_exports);
|
|
45
|
+
var import_lodash = __toESM(require("lodash"));
|
|
46
|
+
var import_errors = require("../errors");
|
|
47
|
+
var import_reference_guards = require("../reference-guards");
|
|
48
|
+
var import_created_keys = require("./created-keys");
|
|
49
|
+
const isFlowSurfacePlanStepLink = import_reference_guards.isFlowSurfacePlanStepValue;
|
|
50
|
+
function normalizeFlowSurfacePlanStepLink(actionName, input, fieldName) {
|
|
51
|
+
return (0, import_reference_guards.normalizeFlowSurfacePlanStepValue)(actionName, input, fieldName);
|
|
52
|
+
}
|
|
53
|
+
function assertFlowSurfaceKnownPlanStepLink(actionName, stepLink, fieldName, knownStepIds) {
|
|
54
|
+
if (!knownStepIds || knownStepIds.has(stepLink.step)) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces ${actionName} ${fieldName}.step '${stepLink.step}' is not a previous step id`);
|
|
58
|
+
}
|
|
59
|
+
function replaceFlowSurfacePlanStepLinks(actionName, input, path, knownStepIds, knownRuntimeKeys) {
|
|
60
|
+
if (Array.isArray(input)) {
|
|
61
|
+
return input.map(
|
|
62
|
+
(item, index) => replaceFlowSurfacePlanStepLinks(actionName, item, `${path}[${index}]`, knownStepIds, knownRuntimeKeys)
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
if (!import_lodash.default.isPlainObject(input)) {
|
|
66
|
+
return input;
|
|
67
|
+
}
|
|
68
|
+
(0, import_reference_guards.assertNoFlowSurfaceLegacyRef)(input, {
|
|
69
|
+
actionName,
|
|
70
|
+
path,
|
|
71
|
+
dollarRefAllowed: "{ step, path }",
|
|
72
|
+
refAllowed: "{ key } or { step, path }"
|
|
73
|
+
});
|
|
74
|
+
if (isFlowSurfacePlanStepLink(input)) {
|
|
75
|
+
const stepLink = normalizeFlowSurfacePlanStepLink(actionName, input, path);
|
|
76
|
+
assertFlowSurfaceKnownPlanStepLink(actionName, stepLink, path, knownStepIds);
|
|
77
|
+
return stepLink;
|
|
78
|
+
}
|
|
79
|
+
if ((0, import_created_keys.isFlowSurfacePureKeyObject)(input)) {
|
|
80
|
+
const runtimeKey = String(input.key || "").trim();
|
|
81
|
+
if (!runtimeKey) {
|
|
82
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces ${actionName} ${path}.key cannot be empty`);
|
|
83
|
+
}
|
|
84
|
+
if (!(knownRuntimeKeys == null ? void 0 : knownRuntimeKeys.has(runtimeKey))) {
|
|
85
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces ${actionName} ${path}.key '${runtimeKey}' is not defined`);
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
key: runtimeKey
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return Object.fromEntries(
|
|
92
|
+
Object.entries(input).map(([key, value]) => [
|
|
93
|
+
key,
|
|
94
|
+
replaceFlowSurfacePlanStepLinks(actionName, value, `${path}.${key}`, knownStepIds, knownRuntimeKeys)
|
|
95
|
+
])
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
99
|
+
0 && (module.exports = {
|
|
100
|
+
assertFlowSurfaceKnownPlanStepLink,
|
|
101
|
+
isFlowSurfacePlanStepLink,
|
|
102
|
+
normalizeFlowSurfacePlanStepLink,
|
|
103
|
+
replaceFlowSurfacePlanStepLinks
|
|
104
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
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 { FlowSurfaceMutateOp, FlowSurfacePlanStepLink, FlowSurfacePlanStepAction, FlowSurfaceReadLocator, FlowSurfaceReadTarget, FlowSurfaceResolvedTarget, FlowSurfaceSurfaceSelector } from '../types';
|
|
10
|
+
import type { FlowSurfaceCreatedKeySpec } from './created-keys';
|
|
11
|
+
export type FlowSurfaceResolvedKey = {
|
|
12
|
+
key: string;
|
|
13
|
+
uid: string;
|
|
14
|
+
source: 'declared' | 'request' | 'system';
|
|
15
|
+
kind: string;
|
|
16
|
+
locator: FlowSurfaceReadLocator;
|
|
17
|
+
rebind?: boolean;
|
|
18
|
+
reboundFromUid?: string;
|
|
19
|
+
};
|
|
20
|
+
export type FlowSurfaceResolvedSelectorSummary = {
|
|
21
|
+
uid?: string;
|
|
22
|
+
kind?: string;
|
|
23
|
+
key?: string;
|
|
24
|
+
step?: string;
|
|
25
|
+
path?: string;
|
|
26
|
+
source: FlowSurfaceResolvedKey['source'] | 'step' | 'created';
|
|
27
|
+
};
|
|
28
|
+
export type FlowSurfacePlanSurfaceContext = {
|
|
29
|
+
surfaceSelector?: FlowSurfaceSurfaceSelector;
|
|
30
|
+
surfaceTarget?: FlowSurfaceReadLocator;
|
|
31
|
+
surfaceResolved?: FlowSurfaceResolvedTarget;
|
|
32
|
+
rawTree?: any;
|
|
33
|
+
publicTree?: any;
|
|
34
|
+
publicNodeMap: Record<string, any>;
|
|
35
|
+
targetSummary: FlowSurfaceReadTarget | null;
|
|
36
|
+
fingerprint: string | null;
|
|
37
|
+
uidSet: Set<string>;
|
|
38
|
+
keyMap: Map<string, FlowSurfaceResolvedKey>;
|
|
39
|
+
requestKeyMap: Map<string, FlowSurfaceResolvedKey>;
|
|
40
|
+
};
|
|
41
|
+
export type FlowSurfaceCompiledPlanStepSelectorLink = FlowSurfacePlanStepLink & {
|
|
42
|
+
summary: FlowSurfaceResolvedSelectorSummary;
|
|
43
|
+
};
|
|
44
|
+
export type FlowSurfaceCompiledPlanStep = {
|
|
45
|
+
index: number;
|
|
46
|
+
id?: string;
|
|
47
|
+
action: FlowSurfacePlanStepAction;
|
|
48
|
+
payload: Record<string, any>;
|
|
49
|
+
executionPayload?: Record<string, any>;
|
|
50
|
+
resolvedSelectors: Partial<Record<'target' | 'source', FlowSurfaceResolvedSelectorSummary>>;
|
|
51
|
+
usedKeys: FlowSurfaceResolvedKey[];
|
|
52
|
+
usedStepLinks: FlowSurfaceCompiledPlanStepSelectorLink[];
|
|
53
|
+
createdKeys: FlowSurfaceCreatedKeySpec[];
|
|
54
|
+
mutateOp?: FlowSurfaceMutateOp;
|
|
55
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
|
+
var types_exports = {};
|
|
24
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -0,0 +1,24 @@
|
|
|
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 declare const FLOW_SURFACE_PUBLIC_DATA_SURFACE_BLOCK_TYPES: Set<string>;
|
|
10
|
+
export declare const FLOW_SURFACE_PUBLIC_DATA_SURFACE_BLOCK_TYPE_LABEL = "table/list/gridCard/calendar/kanban";
|
|
11
|
+
export declare function isFlowSurfacePublicDataSurfaceBlockType(blockType?: string): boolean;
|
|
12
|
+
export declare function normalizeFlowSurfacePublicBlockDefaultFilter(actionName: string, defaultFilter: any, options: {
|
|
13
|
+
blockType?: string;
|
|
14
|
+
template?: unknown;
|
|
15
|
+
path?: string;
|
|
16
|
+
}): any;
|
|
17
|
+
export declare function assertFlowSurfaceConcreteDefaultFilterItem(actionName: string, defaultFilter: any, options?: {
|
|
18
|
+
path?: string;
|
|
19
|
+
}): void;
|
|
20
|
+
export declare function backfillFlowSurfaceDefaultFilterSetting(settings: any, defaultFilter: any): any;
|
|
21
|
+
export declare function backfillFlowSurfaceFilterActionDefaultFilter<T extends {
|
|
22
|
+
type?: string;
|
|
23
|
+
settings?: Record<string, any>;
|
|
24
|
+
}>(actions: T[], defaultFilter: any): T[];
|
|
@@ -0,0 +1,152 @@
|
|
|
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 __create = Object.create;
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
36
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
+
var public_data_surface_default_filter_exports = {};
|
|
38
|
+
__export(public_data_surface_default_filter_exports, {
|
|
39
|
+
FLOW_SURFACE_PUBLIC_DATA_SURFACE_BLOCK_TYPES: () => FLOW_SURFACE_PUBLIC_DATA_SURFACE_BLOCK_TYPES,
|
|
40
|
+
FLOW_SURFACE_PUBLIC_DATA_SURFACE_BLOCK_TYPE_LABEL: () => FLOW_SURFACE_PUBLIC_DATA_SURFACE_BLOCK_TYPE_LABEL,
|
|
41
|
+
assertFlowSurfaceConcreteDefaultFilterItem: () => assertFlowSurfaceConcreteDefaultFilterItem,
|
|
42
|
+
backfillFlowSurfaceDefaultFilterSetting: () => backfillFlowSurfaceDefaultFilterSetting,
|
|
43
|
+
backfillFlowSurfaceFilterActionDefaultFilter: () => backfillFlowSurfaceFilterActionDefaultFilter,
|
|
44
|
+
isFlowSurfacePublicDataSurfaceBlockType: () => isFlowSurfacePublicDataSurfaceBlockType,
|
|
45
|
+
normalizeFlowSurfacePublicBlockDefaultFilter: () => normalizeFlowSurfacePublicBlockDefaultFilter
|
|
46
|
+
});
|
|
47
|
+
module.exports = __toCommonJS(public_data_surface_default_filter_exports);
|
|
48
|
+
var import_lodash = __toESM(require("lodash"));
|
|
49
|
+
var import_errors = require("./errors");
|
|
50
|
+
var import_filter_group = require("./filter-group");
|
|
51
|
+
const FLOW_SURFACE_PUBLIC_DATA_SURFACE_BLOCK_TYPES = /* @__PURE__ */ new Set([
|
|
52
|
+
"table",
|
|
53
|
+
"list",
|
|
54
|
+
"gridCard",
|
|
55
|
+
"calendar",
|
|
56
|
+
"kanban"
|
|
57
|
+
]);
|
|
58
|
+
const FLOW_SURFACE_PUBLIC_DATA_SURFACE_BLOCK_TYPE_LABEL = "table/list/gridCard/calendar/kanban";
|
|
59
|
+
function isFlowSurfacePublicDataSurfaceBlockType(blockType) {
|
|
60
|
+
return FLOW_SURFACE_PUBLIC_DATA_SURFACE_BLOCK_TYPES.has(String(blockType || "").trim());
|
|
61
|
+
}
|
|
62
|
+
function normalizeFlowSurfacePublicBlockDefaultFilter(actionName, defaultFilter, options) {
|
|
63
|
+
if (import_lodash.default.isUndefined(defaultFilter)) {
|
|
64
|
+
return void 0;
|
|
65
|
+
}
|
|
66
|
+
const fieldPath = buildFlowSurfaceDefaultFilterFieldPath(actionName, options.path);
|
|
67
|
+
if (!isFlowSurfacePublicDataSurfaceBlockType(options.blockType) || !import_lodash.default.isUndefined(options.template)) {
|
|
68
|
+
(0, import_errors.throwBadRequest)(
|
|
69
|
+
`flowSurfaces ${actionName} ${fieldPath} is only supported on direct ${FLOW_SURFACE_PUBLIC_DATA_SURFACE_BLOCK_TYPE_LABEL} blocks`
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
const normalized = (0, import_filter_group.normalizeFlowSurfaceFilterGroupValue)(
|
|
73
|
+
defaultFilter,
|
|
74
|
+
`flowSurfaces ${actionName} ${fieldPath} expects FilterGroup like ${import_filter_group.FLOW_SURFACE_FILTER_GROUP_EXAMPLE}`
|
|
75
|
+
);
|
|
76
|
+
return normalized;
|
|
77
|
+
}
|
|
78
|
+
function assertFlowSurfaceConcreteDefaultFilterItem(actionName, defaultFilter, options = {}) {
|
|
79
|
+
const fieldPath = buildFlowSurfaceDefaultFilterFieldPath(actionName, options.path);
|
|
80
|
+
if (!hasConcreteFlowSurfaceFilterItem(defaultFilter)) {
|
|
81
|
+
(0, import_errors.throwBadRequest)(
|
|
82
|
+
`flowSurfaces ${actionName} ${fieldPath} must include at least one concrete filter item; empty defaultFilter groups such as {}, null, or { logic, items: [] } are not allowed`
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function buildFlowSurfaceDefaultFilterFieldPath(actionName, path) {
|
|
87
|
+
if (!path) {
|
|
88
|
+
return "defaultFilter";
|
|
89
|
+
}
|
|
90
|
+
const prefix = `flowSurfaces ${actionName} `;
|
|
91
|
+
const normalizedPath = path.startsWith(prefix) ? path.slice(prefix.length) : path;
|
|
92
|
+
return normalizedPath.endsWith(".defaultFilter") ? normalizedPath : `${normalizedPath}.defaultFilter`;
|
|
93
|
+
}
|
|
94
|
+
function hasConcreteFlowSurfaceFilterItem(filter) {
|
|
95
|
+
if (!import_lodash.default.isPlainObject(filter) || !Array.isArray(filter.items)) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
return filter.items.some((item) => {
|
|
99
|
+
if (import_lodash.default.isPlainObject(item) && "logic" in item && "items" in item) {
|
|
100
|
+
return hasConcreteFlowSurfaceFilterItem(item);
|
|
101
|
+
}
|
|
102
|
+
return import_lodash.default.isPlainObject(item) && typeof item.path === "string" && typeof item.operator === "string";
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function backfillFlowSurfaceDefaultFilterSetting(settings, defaultFilter) {
|
|
106
|
+
if (import_lodash.default.isUndefined(defaultFilter)) {
|
|
107
|
+
return settings;
|
|
108
|
+
}
|
|
109
|
+
if (import_lodash.default.isUndefined(settings)) {
|
|
110
|
+
return {
|
|
111
|
+
defaultFilter: import_lodash.default.cloneDeep(defaultFilter)
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
if (!import_lodash.default.isPlainObject(settings)) {
|
|
115
|
+
return settings;
|
|
116
|
+
}
|
|
117
|
+
if (Object.prototype.hasOwnProperty.call(settings, "defaultFilter")) {
|
|
118
|
+
return settings;
|
|
119
|
+
}
|
|
120
|
+
return {
|
|
121
|
+
...import_lodash.default.cloneDeep(settings),
|
|
122
|
+
defaultFilter: import_lodash.default.cloneDeep(defaultFilter)
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
function backfillFlowSurfaceFilterActionDefaultFilter(actions, defaultFilter) {
|
|
126
|
+
if (import_lodash.default.isUndefined(defaultFilter)) {
|
|
127
|
+
return actions;
|
|
128
|
+
}
|
|
129
|
+
return actions.map((action) => {
|
|
130
|
+
if (String((action == null ? void 0 : action.type) || "").trim() !== "filter") {
|
|
131
|
+
return action;
|
|
132
|
+
}
|
|
133
|
+
const settings = backfillFlowSurfaceDefaultFilterSetting(action.settings, defaultFilter);
|
|
134
|
+
if (settings === action.settings) {
|
|
135
|
+
return action;
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
...action,
|
|
139
|
+
settings
|
|
140
|
+
};
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
144
|
+
0 && (module.exports = {
|
|
145
|
+
FLOW_SURFACE_PUBLIC_DATA_SURFACE_BLOCK_TYPES,
|
|
146
|
+
FLOW_SURFACE_PUBLIC_DATA_SURFACE_BLOCK_TYPE_LABEL,
|
|
147
|
+
assertFlowSurfaceConcreteDefaultFilterItem,
|
|
148
|
+
backfillFlowSurfaceDefaultFilterSetting,
|
|
149
|
+
backfillFlowSurfaceFilterActionDefaultFilter,
|
|
150
|
+
isFlowSurfacePublicDataSurfaceBlockType,
|
|
151
|
+
normalizeFlowSurfacePublicBlockDefaultFilter
|
|
152
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
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 declare const FLOW_SURFACE_REACTION_UNSUPPORTED_TARGET_KIND = "FLOW_SURFACE_REACTION_UNSUPPORTED_TARGET_KIND";
|
|
10
|
+
export declare const FLOW_SURFACE_REACTION_AMBIGUOUS_SCENE = "FLOW_SURFACE_REACTION_AMBIGUOUS_SCENE";
|
|
11
|
+
export declare const FLOW_SURFACE_REACTION_UNSUPPORTED_ACTION_FOR_SCENE = "FLOW_SURFACE_REACTION_UNSUPPORTED_ACTION_FOR_SCENE";
|
|
12
|
+
export declare const FLOW_SURFACE_REACTION_UNKNOWN_TARGET_KEY = "FLOW_SURFACE_REACTION_UNKNOWN_TARGET_KEY";
|
|
13
|
+
export declare const FLOW_SURFACE_REACTION_DUPLICATE_SLOT = "FLOW_SURFACE_REACTION_DUPLICATE_SLOT";
|
|
14
|
+
export declare const FLOW_SURFACE_REACTION_INVALID_CONDITION_PATH = "FLOW_SURFACE_REACTION_INVALID_CONDITION_PATH";
|
|
15
|
+
export declare const FLOW_SURFACE_REACTION_INVALID_CONDITION_OPERATOR = "FLOW_SURFACE_REACTION_INVALID_CONDITION_OPERATOR";
|
|
16
|
+
export declare const FLOW_SURFACE_REACTION_INVALID_VALUE_SOURCE = "FLOW_SURFACE_REACTION_INVALID_VALUE_SOURCE";
|
|
17
|
+
export declare const FLOW_SURFACE_REACTION_INVALID_VALUE_PATH = "FLOW_SURFACE_REACTION_INVALID_VALUE_PATH";
|
|
18
|
+
export declare const FLOW_SURFACE_REACTION_INVALID_TARGET_FIELD = "FLOW_SURFACE_REACTION_INVALID_TARGET_FIELD";
|
|
19
|
+
export declare const FLOW_SURFACE_REACTION_FINGERPRINT_CONFLICT = "FLOW_SURFACE_REACTION_FINGERPRINT_CONFLICT";
|
|
20
|
+
export declare const FLOW_SURFACE_REACTION_FORM_ONLY = "FLOW_SURFACE_REACTION_FORM_ONLY";
|
|
@@ -0,0 +1,69 @@
|
|
|
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 errors_exports = {};
|
|
28
|
+
__export(errors_exports, {
|
|
29
|
+
FLOW_SURFACE_REACTION_AMBIGUOUS_SCENE: () => FLOW_SURFACE_REACTION_AMBIGUOUS_SCENE,
|
|
30
|
+
FLOW_SURFACE_REACTION_DUPLICATE_SLOT: () => FLOW_SURFACE_REACTION_DUPLICATE_SLOT,
|
|
31
|
+
FLOW_SURFACE_REACTION_FINGERPRINT_CONFLICT: () => FLOW_SURFACE_REACTION_FINGERPRINT_CONFLICT,
|
|
32
|
+
FLOW_SURFACE_REACTION_FORM_ONLY: () => FLOW_SURFACE_REACTION_FORM_ONLY,
|
|
33
|
+
FLOW_SURFACE_REACTION_INVALID_CONDITION_OPERATOR: () => FLOW_SURFACE_REACTION_INVALID_CONDITION_OPERATOR,
|
|
34
|
+
FLOW_SURFACE_REACTION_INVALID_CONDITION_PATH: () => FLOW_SURFACE_REACTION_INVALID_CONDITION_PATH,
|
|
35
|
+
FLOW_SURFACE_REACTION_INVALID_TARGET_FIELD: () => FLOW_SURFACE_REACTION_INVALID_TARGET_FIELD,
|
|
36
|
+
FLOW_SURFACE_REACTION_INVALID_VALUE_PATH: () => FLOW_SURFACE_REACTION_INVALID_VALUE_PATH,
|
|
37
|
+
FLOW_SURFACE_REACTION_INVALID_VALUE_SOURCE: () => FLOW_SURFACE_REACTION_INVALID_VALUE_SOURCE,
|
|
38
|
+
FLOW_SURFACE_REACTION_UNKNOWN_TARGET_KEY: () => FLOW_SURFACE_REACTION_UNKNOWN_TARGET_KEY,
|
|
39
|
+
FLOW_SURFACE_REACTION_UNSUPPORTED_ACTION_FOR_SCENE: () => FLOW_SURFACE_REACTION_UNSUPPORTED_ACTION_FOR_SCENE,
|
|
40
|
+
FLOW_SURFACE_REACTION_UNSUPPORTED_TARGET_KIND: () => FLOW_SURFACE_REACTION_UNSUPPORTED_TARGET_KIND
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(errors_exports);
|
|
43
|
+
const FLOW_SURFACE_REACTION_UNSUPPORTED_TARGET_KIND = "FLOW_SURFACE_REACTION_UNSUPPORTED_TARGET_KIND";
|
|
44
|
+
const FLOW_SURFACE_REACTION_AMBIGUOUS_SCENE = "FLOW_SURFACE_REACTION_AMBIGUOUS_SCENE";
|
|
45
|
+
const FLOW_SURFACE_REACTION_UNSUPPORTED_ACTION_FOR_SCENE = "FLOW_SURFACE_REACTION_UNSUPPORTED_ACTION_FOR_SCENE";
|
|
46
|
+
const FLOW_SURFACE_REACTION_UNKNOWN_TARGET_KEY = "FLOW_SURFACE_REACTION_UNKNOWN_TARGET_KEY";
|
|
47
|
+
const FLOW_SURFACE_REACTION_DUPLICATE_SLOT = "FLOW_SURFACE_REACTION_DUPLICATE_SLOT";
|
|
48
|
+
const FLOW_SURFACE_REACTION_INVALID_CONDITION_PATH = "FLOW_SURFACE_REACTION_INVALID_CONDITION_PATH";
|
|
49
|
+
const FLOW_SURFACE_REACTION_INVALID_CONDITION_OPERATOR = "FLOW_SURFACE_REACTION_INVALID_CONDITION_OPERATOR";
|
|
50
|
+
const FLOW_SURFACE_REACTION_INVALID_VALUE_SOURCE = "FLOW_SURFACE_REACTION_INVALID_VALUE_SOURCE";
|
|
51
|
+
const FLOW_SURFACE_REACTION_INVALID_VALUE_PATH = "FLOW_SURFACE_REACTION_INVALID_VALUE_PATH";
|
|
52
|
+
const FLOW_SURFACE_REACTION_INVALID_TARGET_FIELD = "FLOW_SURFACE_REACTION_INVALID_TARGET_FIELD";
|
|
53
|
+
const FLOW_SURFACE_REACTION_FINGERPRINT_CONFLICT = "FLOW_SURFACE_REACTION_FINGERPRINT_CONFLICT";
|
|
54
|
+
const FLOW_SURFACE_REACTION_FORM_ONLY = "FLOW_SURFACE_REACTION_FORM_ONLY";
|
|
55
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
+
0 && (module.exports = {
|
|
57
|
+
FLOW_SURFACE_REACTION_AMBIGUOUS_SCENE,
|
|
58
|
+
FLOW_SURFACE_REACTION_DUPLICATE_SLOT,
|
|
59
|
+
FLOW_SURFACE_REACTION_FINGERPRINT_CONFLICT,
|
|
60
|
+
FLOW_SURFACE_REACTION_FORM_ONLY,
|
|
61
|
+
FLOW_SURFACE_REACTION_INVALID_CONDITION_OPERATOR,
|
|
62
|
+
FLOW_SURFACE_REACTION_INVALID_CONDITION_PATH,
|
|
63
|
+
FLOW_SURFACE_REACTION_INVALID_TARGET_FIELD,
|
|
64
|
+
FLOW_SURFACE_REACTION_INVALID_VALUE_PATH,
|
|
65
|
+
FLOW_SURFACE_REACTION_INVALID_VALUE_SOURCE,
|
|
66
|
+
FLOW_SURFACE_REACTION_UNKNOWN_TARGET_KEY,
|
|
67
|
+
FLOW_SURFACE_REACTION_UNSUPPORTED_ACTION_FOR_SCENE,
|
|
68
|
+
FLOW_SURFACE_REACTION_UNSUPPORTED_TARGET_KIND
|
|
69
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
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 { FlowSurfaceFieldValueRule, FlowSurfaceReactionTargetSummary, FlowSurfaceReactionWriteResult } from './types';
|
|
10
|
+
export type FlowSurfaceFieldValueTarget = FlowSurfaceReactionTargetSummary & {
|
|
11
|
+
use?: string | null;
|
|
12
|
+
collection?: any;
|
|
13
|
+
};
|
|
14
|
+
export type FlowSurfaceFieldValueCompileResult = FlowSurfaceReactionWriteResult<FlowSurfaceFieldValueRule> & {
|
|
15
|
+
updateAssociationValues: string[];
|
|
16
|
+
};
|
|
17
|
+
export declare function isFieldValueTargetUseSupported(use?: string | null): boolean;
|
|
18
|
+
export declare function assertFieldValueTargetSupported(target: FlowSurfaceFieldValueTarget): void;
|
|
19
|
+
export declare function normalizeFieldValueRules(rules: FlowSurfaceFieldValueRule[] | undefined): FlowSurfaceFieldValueRule[];
|
|
20
|
+
export declare function compileFieldValueRulesToCanonical(rules: FlowSurfaceFieldValueRule[] | undefined): {
|
|
21
|
+
key: string;
|
|
22
|
+
enable: boolean;
|
|
23
|
+
targetPath: string;
|
|
24
|
+
mode: string;
|
|
25
|
+
condition: import("./types").FlowSurfaceReactionFilter;
|
|
26
|
+
value: any;
|
|
27
|
+
}[];
|
|
28
|
+
export declare function collectUpdateAssociationValuesFromFieldValueRules(items: Array<{
|
|
29
|
+
targetPath?: string;
|
|
30
|
+
} | any>, rootCollection: any): string[];
|
|
31
|
+
export declare function buildFieldValueWriteResult(params: {
|
|
32
|
+
target: FlowSurfaceFieldValueTarget;
|
|
33
|
+
rules: FlowSurfaceFieldValueRule[] | undefined;
|
|
34
|
+
}): FlowSurfaceFieldValueCompileResult;
|