@nocobase/plugin-flow-engine 2.1.0-beta.15 → 2.1.0-beta.17
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,187 @@
|
|
|
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 blueprint_exports = {};
|
|
38
|
+
__export(blueprint_exports, {
|
|
39
|
+
FLOW_SURFACE_APPROVAL_BLUEPRINT_SURFACES: () => FLOW_SURFACE_APPROVAL_BLUEPRINT_SURFACES,
|
|
40
|
+
prepareFlowSurfaceApplyApprovalBlueprintDocument: () => prepareFlowSurfaceApplyApprovalBlueprintDocument
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(blueprint_exports);
|
|
43
|
+
var import_lodash = __toESM(require("lodash"));
|
|
44
|
+
var import_errors = require("../errors");
|
|
45
|
+
const FLOW_SURFACE_APPROVAL_BLUEPRINT_SURFACES = ["initiator", "approver", "taskCard"];
|
|
46
|
+
function normalizeApprovalBlueprintVersion(value) {
|
|
47
|
+
const normalized = import_lodash.default.isUndefined(value) ? "1" : String(value || "").trim();
|
|
48
|
+
if (normalized !== "1") {
|
|
49
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces applyApprovalBlueprint only supports version '1'`);
|
|
50
|
+
}
|
|
51
|
+
return "1";
|
|
52
|
+
}
|
|
53
|
+
function normalizeApprovalBlueprintMode(value) {
|
|
54
|
+
const normalized = import_lodash.default.isUndefined(value) ? "replace" : String(value || "").trim();
|
|
55
|
+
if (normalized !== "replace") {
|
|
56
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces applyApprovalBlueprint only supports mode 'replace'`);
|
|
57
|
+
}
|
|
58
|
+
return "replace";
|
|
59
|
+
}
|
|
60
|
+
function normalizeApprovalBlueprintSurface(value) {
|
|
61
|
+
const normalized = String(value || "").trim();
|
|
62
|
+
if (!FLOW_SURFACE_APPROVAL_BLUEPRINT_SURFACES.includes(normalized)) {
|
|
63
|
+
(0, import_errors.throwBadRequest)(
|
|
64
|
+
`flowSurfaces applyApprovalBlueprint surface must be one of ${FLOW_SURFACE_APPROVAL_BLUEPRINT_SURFACES.map(
|
|
65
|
+
(item) => `'${item}'`
|
|
66
|
+
).join(", ")}`
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
return normalized;
|
|
70
|
+
}
|
|
71
|
+
function normalizeOptionalBindingId(value, fieldName) {
|
|
72
|
+
if (import_lodash.default.isUndefined(value) || import_lodash.default.isNull(value) || String(value).trim() === "") {
|
|
73
|
+
return void 0;
|
|
74
|
+
}
|
|
75
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
76
|
+
return value;
|
|
77
|
+
}
|
|
78
|
+
const normalized = String(value).trim();
|
|
79
|
+
if (!normalized) {
|
|
80
|
+
return void 0;
|
|
81
|
+
}
|
|
82
|
+
if (/^\d+$/.test(normalized)) {
|
|
83
|
+
return Number(normalized);
|
|
84
|
+
}
|
|
85
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces applyApprovalBlueprint ${fieldName} must be an integer identifier`);
|
|
86
|
+
}
|
|
87
|
+
function normalizeBlocks(input) {
|
|
88
|
+
if (import_lodash.default.isUndefined(input)) {
|
|
89
|
+
return [];
|
|
90
|
+
}
|
|
91
|
+
if (!Array.isArray(input)) {
|
|
92
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces applyApprovalBlueprint blocks must be an array`);
|
|
93
|
+
}
|
|
94
|
+
const normalized = import_lodash.default.cloneDeep(input);
|
|
95
|
+
normalized.forEach((block, index) => {
|
|
96
|
+
if (!import_lodash.default.isPlainObject(block)) {
|
|
97
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces applyApprovalBlueprint blocks[${index}] must be an object`);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
return normalized;
|
|
101
|
+
}
|
|
102
|
+
function normalizeFields(input) {
|
|
103
|
+
if (import_lodash.default.isUndefined(input)) {
|
|
104
|
+
return [];
|
|
105
|
+
}
|
|
106
|
+
if (!Array.isArray(input)) {
|
|
107
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces applyApprovalBlueprint fields must be an array`);
|
|
108
|
+
}
|
|
109
|
+
return import_lodash.default.cloneDeep(input);
|
|
110
|
+
}
|
|
111
|
+
function normalizeLayout(input) {
|
|
112
|
+
if (import_lodash.default.isUndefined(input)) {
|
|
113
|
+
return void 0;
|
|
114
|
+
}
|
|
115
|
+
if (!import_lodash.default.isPlainObject(input)) {
|
|
116
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces applyApprovalBlueprint layout must be an object`);
|
|
117
|
+
}
|
|
118
|
+
return import_lodash.default.cloneDeep(input);
|
|
119
|
+
}
|
|
120
|
+
function prepareFlowSurfaceApplyApprovalBlueprintDocument(values) {
|
|
121
|
+
const version = normalizeApprovalBlueprintVersion(values == null ? void 0 : values.version);
|
|
122
|
+
const mode = normalizeApprovalBlueprintMode(values == null ? void 0 : values.mode);
|
|
123
|
+
const surface = normalizeApprovalBlueprintSurface(values == null ? void 0 : values.surface);
|
|
124
|
+
const workflowId = normalizeOptionalBindingId(values == null ? void 0 : values.workflowId, "workflowId");
|
|
125
|
+
const nodeId = normalizeOptionalBindingId(values == null ? void 0 : values.nodeId, "nodeId");
|
|
126
|
+
const layout = normalizeLayout(values == null ? void 0 : values.layout);
|
|
127
|
+
if (surface === "initiator") {
|
|
128
|
+
if (import_lodash.default.isUndefined(workflowId)) {
|
|
129
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces applyApprovalBlueprint surface 'initiator' requires workflowId`);
|
|
130
|
+
}
|
|
131
|
+
if (!import_lodash.default.isUndefined(nodeId)) {
|
|
132
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces applyApprovalBlueprint surface 'initiator' does not accept nodeId`);
|
|
133
|
+
}
|
|
134
|
+
if (!import_lodash.default.isUndefined(values == null ? void 0 : values.fields)) {
|
|
135
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces applyApprovalBlueprint surface 'initiator' does not accept fields`);
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
version,
|
|
139
|
+
mode,
|
|
140
|
+
surface,
|
|
141
|
+
workflowId,
|
|
142
|
+
blocks: normalizeBlocks(values == null ? void 0 : values.blocks),
|
|
143
|
+
layout
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
if (surface === "approver") {
|
|
147
|
+
if (import_lodash.default.isUndefined(nodeId)) {
|
|
148
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces applyApprovalBlueprint surface 'approver' requires nodeId`);
|
|
149
|
+
}
|
|
150
|
+
if (!import_lodash.default.isUndefined(workflowId)) {
|
|
151
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces applyApprovalBlueprint surface 'approver' does not accept workflowId`);
|
|
152
|
+
}
|
|
153
|
+
if (!import_lodash.default.isUndefined(values == null ? void 0 : values.fields)) {
|
|
154
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces applyApprovalBlueprint surface 'approver' does not accept fields`);
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
version,
|
|
158
|
+
mode,
|
|
159
|
+
surface,
|
|
160
|
+
nodeId,
|
|
161
|
+
blocks: normalizeBlocks(values == null ? void 0 : values.blocks),
|
|
162
|
+
layout
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
if (import_lodash.default.isUndefined(workflowId) === import_lodash.default.isUndefined(nodeId)) {
|
|
166
|
+
(0, import_errors.throwBadRequest)(
|
|
167
|
+
`flowSurfaces applyApprovalBlueprint surface 'taskCard' requires exactly one of workflowId or nodeId`
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
if (!import_lodash.default.isUndefined(values == null ? void 0 : values.blocks)) {
|
|
171
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces applyApprovalBlueprint surface 'taskCard' does not accept blocks`);
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
version,
|
|
175
|
+
mode,
|
|
176
|
+
surface,
|
|
177
|
+
...typeof workflowId !== "undefined" ? { workflowId } : {},
|
|
178
|
+
...typeof nodeId !== "undefined" ? { nodeId } : {},
|
|
179
|
+
fields: normalizeFields(values == null ? void 0 : values.fields),
|
|
180
|
+
layout
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
184
|
+
0 && (module.exports = {
|
|
185
|
+
FLOW_SURFACE_APPROVAL_BLUEPRINT_SURFACES,
|
|
186
|
+
prepareFlowSurfaceApplyApprovalBlueprintDocument
|
|
187
|
+
});
|
|
@@ -0,0 +1,225 @@
|
|
|
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 { FlowSurfaceNodeDefaults } from '../types';
|
|
11
|
+
type ApprovalFieldTreeParams = {
|
|
12
|
+
wrapperUse: string;
|
|
13
|
+
fieldUse: string;
|
|
14
|
+
fieldPath: string;
|
|
15
|
+
dataSourceKey: string;
|
|
16
|
+
collectionName: string;
|
|
17
|
+
associationPathName?: string;
|
|
18
|
+
filterFormInit?: Record<string, any>;
|
|
19
|
+
wrapperProps?: Record<string, any>;
|
|
20
|
+
fieldProps?: Record<string, any>;
|
|
21
|
+
uid: string;
|
|
22
|
+
innerUid: string;
|
|
23
|
+
fieldDefaults?: {
|
|
24
|
+
props?: Record<string, any>;
|
|
25
|
+
stepParams?: Record<string, any>;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
type ApprovalActionDefaults = {
|
|
29
|
+
props?: Record<string, any>;
|
|
30
|
+
stepParams?: Record<string, any>;
|
|
31
|
+
subModels?: Record<string, any>;
|
|
32
|
+
};
|
|
33
|
+
export declare function buildApprovalFieldTree(params: ApprovalFieldTreeParams): {
|
|
34
|
+
wrapperUid: string;
|
|
35
|
+
innerUid: string;
|
|
36
|
+
model: {
|
|
37
|
+
uid: string;
|
|
38
|
+
use: string;
|
|
39
|
+
props: Record<string, any>;
|
|
40
|
+
stepParams: Record<string, any>;
|
|
41
|
+
subModels: {
|
|
42
|
+
field: {
|
|
43
|
+
uid: string;
|
|
44
|
+
use: string;
|
|
45
|
+
props: Record<string, any>;
|
|
46
|
+
stepParams: Record<string, any> & {
|
|
47
|
+
fieldSettings: {
|
|
48
|
+
init: _.Dictionary<string>;
|
|
49
|
+
};
|
|
50
|
+
fieldBinding: {
|
|
51
|
+
use: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export declare function buildApprovalBlockDefaults(use: string): FlowSurfaceNodeDefaults | null;
|
|
59
|
+
export declare function buildApprovalActionDefaults(use: string): ApprovalActionDefaults | null;
|
|
60
|
+
export declare function buildApprovalInitiatorSurfaceTree(options: {
|
|
61
|
+
dataSourceKey: string;
|
|
62
|
+
collectionName: string;
|
|
63
|
+
pageUid?: string;
|
|
64
|
+
tabUid?: string;
|
|
65
|
+
gridUid?: string;
|
|
66
|
+
}): {
|
|
67
|
+
uid: string;
|
|
68
|
+
async: boolean;
|
|
69
|
+
subType: string;
|
|
70
|
+
use: string;
|
|
71
|
+
sortIndex: number;
|
|
72
|
+
flowRegistry: {};
|
|
73
|
+
stepParams: {
|
|
74
|
+
pageSettings: {
|
|
75
|
+
general: {
|
|
76
|
+
displayTitle: boolean;
|
|
77
|
+
enableTabs: boolean;
|
|
78
|
+
title: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
TriggerChildPageSettings: {
|
|
82
|
+
init: {
|
|
83
|
+
dataSourceKey: string;
|
|
84
|
+
collectionName: string;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
subModels: {
|
|
89
|
+
tabs: {
|
|
90
|
+
uid: string;
|
|
91
|
+
parentId: string;
|
|
92
|
+
use: string;
|
|
93
|
+
subKey: string;
|
|
94
|
+
subType: string;
|
|
95
|
+
sortIndex: number;
|
|
96
|
+
flowRegistry: {};
|
|
97
|
+
stepParams: {
|
|
98
|
+
pageTabSettings: {
|
|
99
|
+
tab: {
|
|
100
|
+
title: string;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
subModels: {
|
|
105
|
+
grid: {
|
|
106
|
+
uid: string;
|
|
107
|
+
parentId: string;
|
|
108
|
+
async: boolean;
|
|
109
|
+
use: string;
|
|
110
|
+
subKey: string;
|
|
111
|
+
subType: string;
|
|
112
|
+
sortIndex: number;
|
|
113
|
+
flowRegistry: {};
|
|
114
|
+
filterManager: any[];
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
}[];
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
export declare function buildApprovalApproverSurfaceTree(options: {
|
|
121
|
+
dataSourceKey: string;
|
|
122
|
+
collectionName: string;
|
|
123
|
+
pageUid?: string;
|
|
124
|
+
tabUid?: string;
|
|
125
|
+
gridUid?: string;
|
|
126
|
+
}): {
|
|
127
|
+
uid: string;
|
|
128
|
+
async: boolean;
|
|
129
|
+
subType: string;
|
|
130
|
+
use: string;
|
|
131
|
+
sortIndex: number;
|
|
132
|
+
flowRegistry: {};
|
|
133
|
+
stepParams: {
|
|
134
|
+
pageSettings: {
|
|
135
|
+
general: {
|
|
136
|
+
displayTitle: boolean;
|
|
137
|
+
enableTabs: boolean;
|
|
138
|
+
title: string;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
ApprovalChildPageSettings: {
|
|
142
|
+
init: {
|
|
143
|
+
dataSourceKey: string;
|
|
144
|
+
collectionName: string;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
resourceSettings: {
|
|
148
|
+
init: {
|
|
149
|
+
dataSourceKey: string;
|
|
150
|
+
collectionName: string;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
subModels: {
|
|
155
|
+
tabs: {
|
|
156
|
+
uid: string;
|
|
157
|
+
parentId: string;
|
|
158
|
+
use: string;
|
|
159
|
+
subKey: string;
|
|
160
|
+
subType: string;
|
|
161
|
+
sortIndex: number;
|
|
162
|
+
flowRegistry: {};
|
|
163
|
+
stepParams: {
|
|
164
|
+
pageTabSettings: {
|
|
165
|
+
tab: {
|
|
166
|
+
title: string;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
subModels: {
|
|
171
|
+
grid: {
|
|
172
|
+
uid: string;
|
|
173
|
+
parentId: string;
|
|
174
|
+
async: boolean;
|
|
175
|
+
use: string;
|
|
176
|
+
subKey: string;
|
|
177
|
+
subType: string;
|
|
178
|
+
sortIndex: number;
|
|
179
|
+
flowRegistry: {};
|
|
180
|
+
filterManager: any[];
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
}[];
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
export declare function buildApprovalTaskCardSurfaceTree(options: {
|
|
187
|
+
detailsUse: 'ApplyTaskCardDetailsModel' | 'ApprovalTaskCardDetailsModel';
|
|
188
|
+
gridUse: 'ApplyTaskCardGridModel' | 'ApprovalTaskCardGridModel';
|
|
189
|
+
dataSourceKey: string;
|
|
190
|
+
collectionName: string;
|
|
191
|
+
detailsUid?: string;
|
|
192
|
+
gridUid?: string;
|
|
193
|
+
}): {
|
|
194
|
+
uid: string;
|
|
195
|
+
async: boolean;
|
|
196
|
+
subType: string;
|
|
197
|
+
use: "ApplyTaskCardDetailsModel" | "ApprovalTaskCardDetailsModel";
|
|
198
|
+
sortIndex: number;
|
|
199
|
+
flowRegistry: {};
|
|
200
|
+
stepParams: {
|
|
201
|
+
resourceSettings: {
|
|
202
|
+
init: {
|
|
203
|
+
dataSourceKey: string;
|
|
204
|
+
collectionName: string;
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
detailsSettings: {
|
|
208
|
+
layout: {
|
|
209
|
+
layout: string;
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
subModels: {
|
|
214
|
+
grid: {
|
|
215
|
+
uid: string;
|
|
216
|
+
parentId: string;
|
|
217
|
+
use: "ApplyTaskCardGridModel" | "ApprovalTaskCardGridModel";
|
|
218
|
+
subKey: string;
|
|
219
|
+
subType: string;
|
|
220
|
+
sortIndex: number;
|
|
221
|
+
flowRegistry: {};
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
export {};
|