@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,811 @@
|
|
|
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 service_utils_exports = {};
|
|
38
|
+
__export(service_utils_exports, {
|
|
39
|
+
assertFlowSurfaceComposeUniqueKeys: () => assertFlowSurfaceComposeUniqueKeys,
|
|
40
|
+
assertSupportedSimpleChanges: () => assertSupportedSimpleChanges,
|
|
41
|
+
buildBlockTitleDescriptionFromSemanticChanges: () => buildBlockTitleDescriptionFromSemanticChanges,
|
|
42
|
+
buildChartCardSettingsFromSemanticChanges: () => buildChartCardSettingsFromSemanticChanges,
|
|
43
|
+
buildDefaultFieldState: () => buildDefaultFieldState,
|
|
44
|
+
buildDefinedPayload: () => buildDefinedPayload,
|
|
45
|
+
buildPopupTabTree: () => buildPopupTabTree,
|
|
46
|
+
ensureNoDirectActionScopeKey: () => ensureNoDirectActionScopeKey,
|
|
47
|
+
ensureNoRawDirectAddKeys: () => ensureNoRawDirectAddKeys,
|
|
48
|
+
ensureNoRawSimpleChangeKeys: () => ensureNoRawSimpleChangeKeys,
|
|
49
|
+
flattenModel: () => flattenModel,
|
|
50
|
+
getCatalogRecordActionContainerUse: () => getCatalogRecordActionContainerUse,
|
|
51
|
+
getFieldBindingDefaultProps: () => getFieldBindingDefaultProps,
|
|
52
|
+
getNodeSubModelList: () => getNodeSubModelList,
|
|
53
|
+
getSingleNodeSubModel: () => getSingleNodeSubModel,
|
|
54
|
+
hasDefinedValue: () => hasDefinedValue,
|
|
55
|
+
hasLegacyLocatorFields: () => hasLegacyLocatorFields,
|
|
56
|
+
hasMeaningfulChartSemanticPatch: () => hasMeaningfulChartSemanticPatch,
|
|
57
|
+
hasOwnDefined: () => hasOwnDefined,
|
|
58
|
+
isFieldNodeUse: () => isFieldNodeUse,
|
|
59
|
+
isMissingRequiredResourceInitValue: () => isMissingRequiredResourceInitValue,
|
|
60
|
+
joinRequiredFieldPaths: () => joinRequiredFieldPaths,
|
|
61
|
+
normalizeBlockTitleDescription: () => normalizeBlockTitleDescription,
|
|
62
|
+
normalizeBlockTitleDescriptionValue: () => normalizeBlockTitleDescriptionValue,
|
|
63
|
+
normalizeChartCardHeightModeForWrite: () => normalizeChartCardHeightModeForWrite,
|
|
64
|
+
normalizeChartCardSettings: () => normalizeChartCardSettings,
|
|
65
|
+
normalizeComposeActionSpec: () => normalizeComposeActionSpec,
|
|
66
|
+
normalizeComposeFieldSpec: () => normalizeComposeFieldSpec,
|
|
67
|
+
normalizeFlowSurfaceComposeKey: () => normalizeFlowSurfaceComposeKey,
|
|
68
|
+
normalizeGridCardColumns: () => normalizeGridCardColumns,
|
|
69
|
+
normalizePublicBlockHeightMode: () => normalizePublicBlockHeightMode,
|
|
70
|
+
normalizeRowSpans: () => normalizeRowSpans,
|
|
71
|
+
normalizeSimpleConfirm: () => normalizeSimpleConfirm,
|
|
72
|
+
normalizeSimpleLayoutValue: () => normalizeSimpleLayoutValue,
|
|
73
|
+
normalizeSimpleResourceInit: () => normalizeSimpleResourceInit,
|
|
74
|
+
normalizeStoredChartCardHeightMode: () => normalizeStoredChartCardHeightMode,
|
|
75
|
+
rethrowInlineConfigurationError: () => rethrowInlineConfigurationError,
|
|
76
|
+
splitComposeFieldChanges: () => splitComposeFieldChanges,
|
|
77
|
+
toFlowSurfaceBatchItemError: () => toFlowSurfaceBatchItemError
|
|
78
|
+
});
|
|
79
|
+
module.exports = __toCommonJS(service_utils_exports);
|
|
80
|
+
var import_utils = require("@nocobase/utils");
|
|
81
|
+
var import_lodash = __toESM(require("lodash"));
|
|
82
|
+
var import_configure_options = require("./configure-options");
|
|
83
|
+
var import_defaults = require("./blueprint/defaults");
|
|
84
|
+
var import_errors = require("./errors");
|
|
85
|
+
var import_service_helpers = require("./service-helpers");
|
|
86
|
+
var import_key_registry = require("./planning/key-registry");
|
|
87
|
+
function buildDefinedPayload(payload) {
|
|
88
|
+
return import_lodash.default.pickBy(payload, (value) => !import_lodash.default.isUndefined(value));
|
|
89
|
+
}
|
|
90
|
+
function normalizeFlowSurfaceComposeKey(key, context) {
|
|
91
|
+
const normalized = typeof key === "string" ? key.trim() : String(key || "").trim();
|
|
92
|
+
if (!normalized) {
|
|
93
|
+
(0, import_errors.throwBadRequest)(`${context} key cannot be empty`);
|
|
94
|
+
}
|
|
95
|
+
if (import_key_registry.FLOW_SURFACE_RESERVED_KEYS.has(normalized)) {
|
|
96
|
+
(0, import_errors.throwBadRequest)(`${context} key '${normalized}' is reserved`);
|
|
97
|
+
}
|
|
98
|
+
return normalized;
|
|
99
|
+
}
|
|
100
|
+
function assertFlowSurfaceComposeUniqueKeys(items, context) {
|
|
101
|
+
const seen = /* @__PURE__ */ new Map();
|
|
102
|
+
items.forEach((item, index) => {
|
|
103
|
+
const key = typeof (item == null ? void 0 : item.key) === "string" ? item.key.trim() : "";
|
|
104
|
+
if (!key) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const previousIndex = seen.get(key);
|
|
108
|
+
if (previousIndex) {
|
|
109
|
+
(0, import_errors.throwBadRequest)(`${context} key '${key}' is duplicated at #${previousIndex} and #${index + 1}`);
|
|
110
|
+
}
|
|
111
|
+
seen.set(key, index + 1);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function normalizeChartCardSettings(cardSettings) {
|
|
115
|
+
if (!import_lodash.default.isPlainObject(cardSettings)) {
|
|
116
|
+
return {};
|
|
117
|
+
}
|
|
118
|
+
const nextCardSettings = import_lodash.default.cloneDeep(cardSettings);
|
|
119
|
+
const titleDescription = normalizeBlockTitleDescription(import_lodash.default.get(nextCardSettings, ["titleDescription"]));
|
|
120
|
+
if (titleDescription) {
|
|
121
|
+
import_lodash.default.set(nextCardSettings, ["titleDescription"], titleDescription);
|
|
122
|
+
} else {
|
|
123
|
+
import_lodash.default.unset(nextCardSettings, ["titleDescription"]);
|
|
124
|
+
}
|
|
125
|
+
const rawHeightMode = import_lodash.default.get(nextCardSettings, ["blockHeight", "heightMode"]);
|
|
126
|
+
const rawHeight = import_lodash.default.get(nextCardSettings, ["blockHeight", "height"]);
|
|
127
|
+
const normalizedHeightMode = import_lodash.default.isUndefined(rawHeightMode) ? !import_lodash.default.isUndefined(rawHeight) ? "specifyValue" : void 0 : normalizeChartCardHeightModeForWrite(rawHeightMode);
|
|
128
|
+
if (normalizedHeightMode) {
|
|
129
|
+
import_lodash.default.set(nextCardSettings, ["blockHeight", "heightMode"], normalizedHeightMode);
|
|
130
|
+
if (normalizedHeightMode === "specifyValue" && !import_lodash.default.isUndefined(rawHeight)) {
|
|
131
|
+
import_lodash.default.set(nextCardSettings, ["blockHeight", "height"], rawHeight);
|
|
132
|
+
} else {
|
|
133
|
+
import_lodash.default.unset(nextCardSettings, ["blockHeight", "height"]);
|
|
134
|
+
}
|
|
135
|
+
} else {
|
|
136
|
+
import_lodash.default.unset(nextCardSettings, ["blockHeight"]);
|
|
137
|
+
}
|
|
138
|
+
if (import_lodash.default.isEmpty(import_lodash.default.get(nextCardSettings, ["blockHeight"]))) {
|
|
139
|
+
import_lodash.default.unset(nextCardSettings, ["blockHeight"]);
|
|
140
|
+
}
|
|
141
|
+
return nextCardSettings;
|
|
142
|
+
}
|
|
143
|
+
function normalizeBlockTitleDescriptionValue(value) {
|
|
144
|
+
if (import_lodash.default.isNull(value)) {
|
|
145
|
+
return "";
|
|
146
|
+
}
|
|
147
|
+
return typeof value === "string" ? value.trim() : value;
|
|
148
|
+
}
|
|
149
|
+
function normalizeBlockTitleDescription(titleDescription) {
|
|
150
|
+
if (!import_lodash.default.isPlainObject(titleDescription)) {
|
|
151
|
+
return void 0;
|
|
152
|
+
}
|
|
153
|
+
const nextTitleDescription = import_lodash.default.cloneDeep(titleDescription);
|
|
154
|
+
const title = normalizeBlockTitleDescriptionValue(nextTitleDescription.title);
|
|
155
|
+
const description = normalizeBlockTitleDescriptionValue(nextTitleDescription.description);
|
|
156
|
+
if (title) {
|
|
157
|
+
nextTitleDescription.title = title;
|
|
158
|
+
} else {
|
|
159
|
+
delete nextTitleDescription.title;
|
|
160
|
+
}
|
|
161
|
+
if (description) {
|
|
162
|
+
nextTitleDescription.description = description;
|
|
163
|
+
} else {
|
|
164
|
+
delete nextTitleDescription.description;
|
|
165
|
+
}
|
|
166
|
+
return Object.keys(nextTitleDescription).length ? nextTitleDescription : void 0;
|
|
167
|
+
}
|
|
168
|
+
function buildBlockTitleDescriptionFromSemanticChanges(changes) {
|
|
169
|
+
if (!hasDefinedValue(changes, ["title", "description"])) {
|
|
170
|
+
return void 0;
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
titleDescription: buildDefinedPayload({
|
|
174
|
+
...hasOwnDefined(changes, "title") ? { title: normalizeBlockTitleDescriptionValue(changes.title) } : {},
|
|
175
|
+
...hasOwnDefined(changes, "description") ? { description: normalizeBlockTitleDescriptionValue(changes.description) } : {}
|
|
176
|
+
})
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
function buildChartCardSettingsFromSemanticChanges(currentCardSettings, changes) {
|
|
180
|
+
const nextCardSettings = import_lodash.default.cloneDeep(currentCardSettings || {});
|
|
181
|
+
const currentTitleDescription = import_lodash.default.get(currentCardSettings, ["titleDescription"]);
|
|
182
|
+
const nextTitleDescription = normalizeBlockTitleDescription(
|
|
183
|
+
buildDefinedPayload({
|
|
184
|
+
title: hasOwnDefined(changes, "title") ? normalizeBlockTitleDescriptionValue(changes.title) : import_lodash.default.get(currentTitleDescription, ["title"]),
|
|
185
|
+
description: hasOwnDefined(changes, "description") ? normalizeBlockTitleDescriptionValue(changes.description) : import_lodash.default.get(currentTitleDescription, ["description"])
|
|
186
|
+
})
|
|
187
|
+
);
|
|
188
|
+
if (nextTitleDescription) {
|
|
189
|
+
import_lodash.default.set(nextCardSettings, ["titleDescription"], nextTitleDescription);
|
|
190
|
+
} else {
|
|
191
|
+
import_lodash.default.unset(nextCardSettings, ["titleDescription"]);
|
|
192
|
+
}
|
|
193
|
+
const currentHeight = import_lodash.default.get(currentCardSettings, ["blockHeight", "height"]);
|
|
194
|
+
const nextHeight = hasOwnDefined(changes, "height") ? changes.height : currentHeight;
|
|
195
|
+
const currentHeightMode = normalizeStoredChartCardHeightMode(
|
|
196
|
+
import_lodash.default.get(currentCardSettings, ["blockHeight", "heightMode"])
|
|
197
|
+
);
|
|
198
|
+
const nextHeightMode = hasOwnDefined(changes, "heightMode") ? normalizePublicBlockHeightMode(changes.heightMode) : hasOwnDefined(changes, "height") ? !import_lodash.default.isUndefined(nextHeight) ? "specifyValue" : void 0 : currentHeightMode ?? (!import_lodash.default.isUndefined(nextHeight) ? "specifyValue" : void 0);
|
|
199
|
+
if (nextHeightMode) {
|
|
200
|
+
import_lodash.default.set(nextCardSettings, ["blockHeight", "heightMode"], nextHeightMode);
|
|
201
|
+
if (nextHeightMode === "specifyValue" && !import_lodash.default.isUndefined(nextHeight)) {
|
|
202
|
+
import_lodash.default.set(nextCardSettings, ["blockHeight", "height"], nextHeight);
|
|
203
|
+
} else {
|
|
204
|
+
import_lodash.default.unset(nextCardSettings, ["blockHeight", "height"]);
|
|
205
|
+
}
|
|
206
|
+
} else {
|
|
207
|
+
import_lodash.default.unset(nextCardSettings, ["blockHeight"]);
|
|
208
|
+
}
|
|
209
|
+
if (import_lodash.default.isEmpty(import_lodash.default.get(nextCardSettings, ["blockHeight"]))) {
|
|
210
|
+
import_lodash.default.unset(nextCardSettings, ["blockHeight"]);
|
|
211
|
+
}
|
|
212
|
+
return normalizeChartCardSettings(nextCardSettings);
|
|
213
|
+
}
|
|
214
|
+
function buildPopupTabTree(options) {
|
|
215
|
+
const tabUid = options.tabUid || (0, import_utils.uid)();
|
|
216
|
+
const gridUid = options.gridUid || (0, import_utils.uid)();
|
|
217
|
+
const title = options.title || "Untitled";
|
|
218
|
+
return {
|
|
219
|
+
uid: tabUid,
|
|
220
|
+
use: "ChildPageTabModel",
|
|
221
|
+
props: buildDefinedPayload({
|
|
222
|
+
title,
|
|
223
|
+
icon: options.icon
|
|
224
|
+
}),
|
|
225
|
+
stepParams: {
|
|
226
|
+
pageTabSettings: {
|
|
227
|
+
tab: buildDefinedPayload({
|
|
228
|
+
title,
|
|
229
|
+
icon: options.icon,
|
|
230
|
+
documentTitle: options.documentTitle
|
|
231
|
+
})
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
...typeof options.flowRegistry !== "undefined" ? { flowRegistry: import_lodash.default.cloneDeep(options.flowRegistry) } : {},
|
|
235
|
+
subModels: {
|
|
236
|
+
grid: {
|
|
237
|
+
uid: gridUid,
|
|
238
|
+
use: "BlockGridModel"
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
function getSingleNodeSubModel(subModel) {
|
|
244
|
+
if (!subModel || Array.isArray(subModel)) {
|
|
245
|
+
return void 0;
|
|
246
|
+
}
|
|
247
|
+
return subModel;
|
|
248
|
+
}
|
|
249
|
+
function getNodeSubModelList(subModel) {
|
|
250
|
+
if (!subModel) {
|
|
251
|
+
return [];
|
|
252
|
+
}
|
|
253
|
+
return Array.isArray(subModel) ? subModel : [subModel];
|
|
254
|
+
}
|
|
255
|
+
function flattenModel(node, carry = {}) {
|
|
256
|
+
if (!(node == null ? void 0 : node.uid)) {
|
|
257
|
+
return carry;
|
|
258
|
+
}
|
|
259
|
+
carry[node.uid] = {
|
|
260
|
+
uid: node.uid,
|
|
261
|
+
use: node.use,
|
|
262
|
+
props: node.props,
|
|
263
|
+
decoratorProps: node.decoratorProps,
|
|
264
|
+
stepParams: node.stepParams,
|
|
265
|
+
flowRegistry: node.flowRegistry,
|
|
266
|
+
...node.template ? { template: node.template } : {},
|
|
267
|
+
...node.fieldsTemplate ? { fieldsTemplate: node.fieldsTemplate } : {},
|
|
268
|
+
...node.popup ? { popup: node.popup } : {}
|
|
269
|
+
};
|
|
270
|
+
Object.values(node.subModels || {}).forEach((value) => {
|
|
271
|
+
import_lodash.default.castArray(value).forEach((child) => flattenModel(child, carry));
|
|
272
|
+
});
|
|
273
|
+
return carry;
|
|
274
|
+
}
|
|
275
|
+
function buildDefaultFieldState(containerUse, fieldUse, field) {
|
|
276
|
+
const bindingDefaults = getFieldBindingDefaultProps(containerUse, fieldUse, field);
|
|
277
|
+
return {
|
|
278
|
+
wrapperProps: {},
|
|
279
|
+
fieldProps: import_lodash.default.cloneDeep(bindingDefaults)
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
function hasOwnDefined(input, key) {
|
|
283
|
+
return Object.prototype.hasOwnProperty.call(input, key) && !import_lodash.default.isUndefined(input[key]);
|
|
284
|
+
}
|
|
285
|
+
function hasMeaningfulChartSemanticPatch(input, key) {
|
|
286
|
+
if (!Object.prototype.hasOwnProperty.call(input, key)) {
|
|
287
|
+
return false;
|
|
288
|
+
}
|
|
289
|
+
const value = input[key];
|
|
290
|
+
if (import_lodash.default.isNull(value)) {
|
|
291
|
+
return true;
|
|
292
|
+
}
|
|
293
|
+
if (import_lodash.default.isPlainObject(value)) {
|
|
294
|
+
return Object.keys(value).length > 0;
|
|
295
|
+
}
|
|
296
|
+
return !import_lodash.default.isUndefined(value);
|
|
297
|
+
}
|
|
298
|
+
function hasDefinedValue(input, keys) {
|
|
299
|
+
return keys.some((key) => hasOwnDefined(input, key));
|
|
300
|
+
}
|
|
301
|
+
function ensureNoRawSimpleChangeKeys(changes) {
|
|
302
|
+
const rawKeys = ["props", "decoratorProps", "stepParams", "flowRegistry", "use", "fieldUse"];
|
|
303
|
+
const forbidden = Object.keys(changes).filter((key) => rawKeys.includes(key));
|
|
304
|
+
if (forbidden.length) {
|
|
305
|
+
(0, import_errors.throwBadRequest)(
|
|
306
|
+
`flowSurfaces configure does not accept raw keys: ${forbidden.join(
|
|
307
|
+
", "
|
|
308
|
+
)}; use catalog.configureOptions and configure.changes instead`
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
function ensureNoRawDirectAddKeys(actionName, values, rawKeys) {
|
|
313
|
+
const forbidden = rawKeys.filter((key) => hasOwnDefined(values || {}, key));
|
|
314
|
+
if (!forbidden.length) {
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
(0, import_errors.throwBadRequest)(
|
|
318
|
+
`flowSurfaces ${actionName} does not accept raw keys: ${forbidden.join(
|
|
319
|
+
", "
|
|
320
|
+
)}; use settings with catalog.configureOptions or fall back to updateSettings/apply for low-level control`
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
function ensureNoDirectActionScopeKey(actionName, values) {
|
|
324
|
+
if (import_lodash.default.isUndefined(values == null ? void 0 : values.scope)) {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
(0, import_errors.throwBadRequest)(
|
|
328
|
+
`flowSurfaces ${actionName} does not support scope; use addAction for non-record actions and addRecordAction for record actions`
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
function normalizeComposeFieldSpec(input, index) {
|
|
332
|
+
if (typeof input === "string") {
|
|
333
|
+
const fieldPath2 = String(input || "").trim();
|
|
334
|
+
if (!fieldPath2) {
|
|
335
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces compose field #${index + 1} cannot be empty`);
|
|
336
|
+
}
|
|
337
|
+
return {
|
|
338
|
+
index: index + 1,
|
|
339
|
+
key: fieldPath2,
|
|
340
|
+
fieldPath: fieldPath2,
|
|
341
|
+
settings: {},
|
|
342
|
+
popup: void 0,
|
|
343
|
+
__autoPopupForRelationField: true
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
if (!import_lodash.default.isPlainObject(input)) {
|
|
347
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces compose field #${index + 1} must be a string or object`);
|
|
348
|
+
}
|
|
349
|
+
if (input.use || input.fieldUse || input.stepParams || input.props || input.decoratorProps) {
|
|
350
|
+
(0, import_errors.throwBadRequest)("flowSurfaces compose field only accepts public semantic field fields");
|
|
351
|
+
}
|
|
352
|
+
const semanticType = String(input.type || "").trim() || void 0;
|
|
353
|
+
const fieldPath = String(input.fieldPath || "").trim();
|
|
354
|
+
const renderer = typeof input.renderer === "undefined" ? void 0 : String(input.renderer || "").trim();
|
|
355
|
+
if (!import_lodash.default.isUndefined(input.popup) && !import_lodash.default.isPlainObject(input.popup)) {
|
|
356
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces compose field #${index + 1} popup must be an object`);
|
|
357
|
+
}
|
|
358
|
+
if (!fieldPath && !semanticType) {
|
|
359
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces compose field #${index + 1} requires fieldPath`);
|
|
360
|
+
}
|
|
361
|
+
if (semanticType && fieldPath) {
|
|
362
|
+
(0, import_errors.throwBadRequest)(
|
|
363
|
+
`flowSurfaces compose field #${index + 1} cannot mix fieldPath with synthetic field type '${semanticType}'`
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
if (!import_lodash.default.isUndefined(input.target) && typeof input.target !== "string") {
|
|
367
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces compose field #${index + 1} target must be a string block key`);
|
|
368
|
+
}
|
|
369
|
+
const rawKey = String(input.key || semanticType || (renderer === "js" ? `js:${fieldPath}` : fieldPath)).trim();
|
|
370
|
+
const key = normalizeFlowSurfaceComposeKey(rawKey, `flowSurfaces compose field #${index + 1}`);
|
|
371
|
+
const popupDefaultsMetadata = import_lodash.default.isPlainObject(input[import_defaults.FLOW_SURFACE_APPLY_BLUEPRINT_POPUP_DEFAULTS_KEY]) ? input[import_defaults.FLOW_SURFACE_APPLY_BLUEPRINT_POPUP_DEFAULTS_KEY] : void 0;
|
|
372
|
+
return {
|
|
373
|
+
index: index + 1,
|
|
374
|
+
key,
|
|
375
|
+
...fieldPath ? { fieldPath } : {},
|
|
376
|
+
associationPathName: String(input.associationPathName || "").trim() || void 0,
|
|
377
|
+
...renderer ? { renderer } : {},
|
|
378
|
+
...semanticType ? { type: semanticType } : {},
|
|
379
|
+
target: typeof input.target === "string" ? String(input.target || "").trim() || void 0 : void 0,
|
|
380
|
+
settings: import_lodash.default.isPlainObject(input.settings) ? input.settings : {},
|
|
381
|
+
popup: import_lodash.default.isPlainObject(input.popup) ? input.popup : void 0,
|
|
382
|
+
__autoPopupForRelationField: input.__autoPopupForRelationField === true,
|
|
383
|
+
...popupDefaultsMetadata ? { [import_defaults.FLOW_SURFACE_APPLY_BLUEPRINT_POPUP_DEFAULTS_KEY]: popupDefaultsMetadata } : {}
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
function normalizeComposeActionSpec(input, index) {
|
|
387
|
+
if (typeof input === "string") {
|
|
388
|
+
const type2 = String(input || "").trim();
|
|
389
|
+
if (!type2) {
|
|
390
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces compose action #${index + 1} cannot be empty`);
|
|
391
|
+
}
|
|
392
|
+
return {
|
|
393
|
+
key: type2,
|
|
394
|
+
type: type2,
|
|
395
|
+
settings: {}
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
if (!import_lodash.default.isPlainObject(input)) {
|
|
399
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces compose action #${index + 1} must be a string or object`);
|
|
400
|
+
}
|
|
401
|
+
if (input.use || input.fieldUse || input.stepParams || input.props || input.decoratorProps || input.flowRegistry) {
|
|
402
|
+
(0, import_errors.throwBadRequest)("flowSurfaces compose action only accepts public semantic action fields");
|
|
403
|
+
}
|
|
404
|
+
const type = String(input.type || "").trim();
|
|
405
|
+
if (!type) {
|
|
406
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces compose action #${index + 1} requires type`);
|
|
407
|
+
}
|
|
408
|
+
if (!import_lodash.default.isUndefined(input.scope)) {
|
|
409
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces compose action #${index + 1} does not support scope, use actions or recordActions`);
|
|
410
|
+
}
|
|
411
|
+
const key = normalizeFlowSurfaceComposeKey(
|
|
412
|
+
String(input.key || type).trim(),
|
|
413
|
+
`flowSurfaces compose action #${index + 1}`
|
|
414
|
+
);
|
|
415
|
+
const popup = import_lodash.default.isPlainObject(input.popup) ? input.popup : void 0;
|
|
416
|
+
return {
|
|
417
|
+
key,
|
|
418
|
+
type,
|
|
419
|
+
settings: import_lodash.default.isPlainObject(input.settings) ? input.settings : {},
|
|
420
|
+
...popup ? { popup } : {}
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
function normalizeSimpleResourceInit(input) {
|
|
424
|
+
if (!input) {
|
|
425
|
+
return void 0;
|
|
426
|
+
}
|
|
427
|
+
if (!import_lodash.default.isPlainObject(input)) {
|
|
428
|
+
(0, import_errors.throwBadRequest)("flowSurfaces simple resource must be an object");
|
|
429
|
+
}
|
|
430
|
+
const normalized = buildDefinedPayload({
|
|
431
|
+
dataSourceKey: input.dataSourceKey,
|
|
432
|
+
collectionName: input.collectionName,
|
|
433
|
+
associationName: input.associationName,
|
|
434
|
+
associationPathName: input.associationPathName,
|
|
435
|
+
sourceId: input.sourceId,
|
|
436
|
+
filterByTk: input.filterByTk
|
|
437
|
+
});
|
|
438
|
+
if (!Object.keys(normalized).length) {
|
|
439
|
+
(0, import_errors.throwBadRequest)("flowSurfaces simple resource cannot be empty");
|
|
440
|
+
}
|
|
441
|
+
return normalized;
|
|
442
|
+
}
|
|
443
|
+
function isMissingRequiredResourceInitValue(value) {
|
|
444
|
+
if (import_lodash.default.isNil(value)) {
|
|
445
|
+
return true;
|
|
446
|
+
}
|
|
447
|
+
if (typeof value === "string") {
|
|
448
|
+
return !value.trim();
|
|
449
|
+
}
|
|
450
|
+
return false;
|
|
451
|
+
}
|
|
452
|
+
function joinRequiredFieldPaths(paths) {
|
|
453
|
+
if (paths.length <= 1) {
|
|
454
|
+
return paths[0] || "";
|
|
455
|
+
}
|
|
456
|
+
if (paths.length === 2) {
|
|
457
|
+
return `${paths[0]} and ${paths[1]}`;
|
|
458
|
+
}
|
|
459
|
+
return `${paths.slice(0, -1).join(", ")}, and ${paths[paths.length - 1]}`;
|
|
460
|
+
}
|
|
461
|
+
function normalizeSimpleLayoutValue(layout) {
|
|
462
|
+
if (import_lodash.default.isUndefined(layout)) {
|
|
463
|
+
return void 0;
|
|
464
|
+
}
|
|
465
|
+
if (import_lodash.default.isPlainObject(layout)) {
|
|
466
|
+
return layout.layout;
|
|
467
|
+
}
|
|
468
|
+
return layout;
|
|
469
|
+
}
|
|
470
|
+
function normalizeGridCardColumns(columns) {
|
|
471
|
+
if (import_lodash.default.isUndefined(columns)) {
|
|
472
|
+
return void 0;
|
|
473
|
+
}
|
|
474
|
+
if (import_lodash.default.isNumber(columns) && columns > 0) {
|
|
475
|
+
return {
|
|
476
|
+
xs: columns,
|
|
477
|
+
sm: columns,
|
|
478
|
+
md: columns,
|
|
479
|
+
lg: columns,
|
|
480
|
+
xl: columns,
|
|
481
|
+
xxl: columns
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
if (import_lodash.default.isPlainObject(columns)) {
|
|
485
|
+
const requiredBreakpoints = ["xs", "sm", "md", "lg", "xl", "xxl"];
|
|
486
|
+
const missingBreakpoints = requiredBreakpoints.filter((key) => import_lodash.default.isUndefined(columns[key]));
|
|
487
|
+
if (missingBreakpoints.length) {
|
|
488
|
+
(0, import_errors.throwBadRequest)(
|
|
489
|
+
`flowSurfaces configure gridCard columns responsive object must include xs, sm, md, lg, xl, xxl; missing: ${missingBreakpoints.join(
|
|
490
|
+
", "
|
|
491
|
+
)}`
|
|
492
|
+
);
|
|
493
|
+
}
|
|
494
|
+
const invalidBreakpoints = requiredBreakpoints.filter((key) => !import_lodash.default.isNumber(columns[key]) || columns[key] <= 0);
|
|
495
|
+
if (invalidBreakpoints.length) {
|
|
496
|
+
(0, import_errors.throwBadRequest)(
|
|
497
|
+
`flowSurfaces configure gridCard columns responsive object values must be positive numbers; invalid: ${invalidBreakpoints.join(
|
|
498
|
+
", "
|
|
499
|
+
)}`
|
|
500
|
+
);
|
|
501
|
+
}
|
|
502
|
+
const normalized = buildDefinedPayload({
|
|
503
|
+
xs: columns.xs,
|
|
504
|
+
sm: columns.sm,
|
|
505
|
+
md: columns.md,
|
|
506
|
+
lg: columns.lg,
|
|
507
|
+
xl: columns.xl,
|
|
508
|
+
xxl: columns.xxl
|
|
509
|
+
});
|
|
510
|
+
if (!Object.keys(normalized).length) {
|
|
511
|
+
(0, import_errors.throwBadRequest)("flowSurfaces configure gridCard columns cannot be empty");
|
|
512
|
+
}
|
|
513
|
+
return normalized;
|
|
514
|
+
}
|
|
515
|
+
(0, import_errors.throwBadRequest)("flowSurfaces configure gridCard columns must be a number or responsive object");
|
|
516
|
+
}
|
|
517
|
+
function normalizeSimpleConfirm(confirm) {
|
|
518
|
+
if (import_lodash.default.isBoolean(confirm)) {
|
|
519
|
+
return {
|
|
520
|
+
enable: confirm
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
if (import_lodash.default.isPlainObject(confirm)) {
|
|
524
|
+
return buildDefinedPayload({
|
|
525
|
+
enable: confirm.enable,
|
|
526
|
+
title: confirm.title,
|
|
527
|
+
content: confirm.content
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
(0, import_errors.throwBadRequest)("flowSurfaces configure confirm must be a boolean or object");
|
|
531
|
+
}
|
|
532
|
+
function assertSupportedSimpleChanges(context, changes, allowedKeys) {
|
|
533
|
+
const unknownKeys = Object.keys(changes).filter((key) => !allowedKeys.includes(key));
|
|
534
|
+
if (!unknownKeys.length) {
|
|
535
|
+
return;
|
|
536
|
+
}
|
|
537
|
+
(0, import_errors.throwBadRequest)(
|
|
538
|
+
`flowSurfaces configure ${context} does not support: ${unknownKeys.join(
|
|
539
|
+
", "
|
|
540
|
+
)}; supported configureOptions: ${allowedKeys.join(", ")}`
|
|
541
|
+
);
|
|
542
|
+
}
|
|
543
|
+
function hasLegacyLocatorFields(input, options = {}) {
|
|
544
|
+
if (!import_lodash.default.isPlainObject(input)) {
|
|
545
|
+
return false;
|
|
546
|
+
}
|
|
547
|
+
const keys = ["pageSchemaUid", "tabSchemaUid", "routeId", "schemaUid"];
|
|
548
|
+
if (options.allowRootUid) {
|
|
549
|
+
keys.push("uid");
|
|
550
|
+
}
|
|
551
|
+
return keys.some((key) => Object.prototype.hasOwnProperty.call(input, key));
|
|
552
|
+
}
|
|
553
|
+
function rethrowInlineConfigurationError(error, prefix) {
|
|
554
|
+
const message = `${prefix}: ${(error == null ? void 0 : error.message) || String(error)}`;
|
|
555
|
+
if ((0, import_errors.isFlowSurfaceError)(error)) {
|
|
556
|
+
const normalized = (0, import_errors.normalizeFlowSurfaceError)(error);
|
|
557
|
+
if (normalized.type === "bad_request") {
|
|
558
|
+
(0, import_errors.throwBadRequest)(message, normalized.code);
|
|
559
|
+
}
|
|
560
|
+
if (normalized.type === "conflict") {
|
|
561
|
+
(0, import_errors.throwConflict)(message, normalized.code);
|
|
562
|
+
}
|
|
563
|
+
if (normalized.type === "forbidden") {
|
|
564
|
+
(0, import_errors.throwForbidden)(message, normalized.code);
|
|
565
|
+
}
|
|
566
|
+
(0, import_errors.throwInternalError)(message, normalized.code);
|
|
567
|
+
}
|
|
568
|
+
(0, import_errors.throwInternalError)(message);
|
|
569
|
+
}
|
|
570
|
+
function toFlowSurfaceBatchItemError(error) {
|
|
571
|
+
const normalized = (0, import_errors.normalizeFlowSurfaceError)(error);
|
|
572
|
+
return {
|
|
573
|
+
code: normalized.code,
|
|
574
|
+
message: normalized.message,
|
|
575
|
+
status: normalized.status,
|
|
576
|
+
type: normalized.type
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
function splitComposeFieldChanges(changes, wrapperUse) {
|
|
580
|
+
ensureNoRawSimpleChangeKeys(changes);
|
|
581
|
+
const supportedKeys = (0, import_configure_options.getConfigureOptionKeysForUse)(wrapperUse || "FormItemModel");
|
|
582
|
+
assertSupportedSimpleChanges("field", changes, supportedKeys);
|
|
583
|
+
const wrapperChanges = import_lodash.default.pick(changes, [
|
|
584
|
+
"label",
|
|
585
|
+
"tooltip",
|
|
586
|
+
"extra",
|
|
587
|
+
"showLabel",
|
|
588
|
+
"width",
|
|
589
|
+
"fixed",
|
|
590
|
+
"sorter",
|
|
591
|
+
"fieldPath",
|
|
592
|
+
"associationPathName",
|
|
593
|
+
"initialValue",
|
|
594
|
+
"required",
|
|
595
|
+
"disabled",
|
|
596
|
+
"maxCount",
|
|
597
|
+
"pattern",
|
|
598
|
+
"titleField",
|
|
599
|
+
"dataIndex",
|
|
600
|
+
"editable",
|
|
601
|
+
"labelWidth",
|
|
602
|
+
"labelWrap",
|
|
603
|
+
"name",
|
|
604
|
+
"fieldComponent",
|
|
605
|
+
...wrapperUse === "TableColumnModel" ? ["title"] : []
|
|
606
|
+
]);
|
|
607
|
+
const fieldChanges = import_lodash.default.pick(changes, [
|
|
608
|
+
"clickToOpen",
|
|
609
|
+
"openView",
|
|
610
|
+
...wrapperUse === "TableColumnModel" ? [] : ["title"],
|
|
611
|
+
"icon",
|
|
612
|
+
"autoSize",
|
|
613
|
+
"allowClear",
|
|
614
|
+
"multiple",
|
|
615
|
+
"allowMultiple",
|
|
616
|
+
"quickCreate",
|
|
617
|
+
"displayStyle",
|
|
618
|
+
"options",
|
|
619
|
+
"code",
|
|
620
|
+
"version"
|
|
621
|
+
]);
|
|
622
|
+
return {
|
|
623
|
+
wrapperChanges: import_lodash.default.pickBy(wrapperChanges, (value) => !import_lodash.default.isUndefined(value)),
|
|
624
|
+
fieldChanges: import_lodash.default.pickBy(fieldChanges, (value) => !import_lodash.default.isUndefined(value))
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
function getCatalogRecordActionContainerUse(use) {
|
|
628
|
+
switch (String(use || "").trim()) {
|
|
629
|
+
case "TableBlockModel":
|
|
630
|
+
case "TableActionsColumnModel":
|
|
631
|
+
return "TableActionsColumnModel";
|
|
632
|
+
case "DetailsBlockModel":
|
|
633
|
+
return "DetailsBlockModel";
|
|
634
|
+
case "ListBlockModel":
|
|
635
|
+
case "ListItemModel":
|
|
636
|
+
return "ListItemModel";
|
|
637
|
+
case "GridCardBlockModel":
|
|
638
|
+
case "GridCardItemModel":
|
|
639
|
+
return "GridCardItemModel";
|
|
640
|
+
default:
|
|
641
|
+
return null;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
function normalizeRowSpans(spans) {
|
|
645
|
+
const numericSpans = import_lodash.default.castArray(spans || []).map((span) => {
|
|
646
|
+
if (import_lodash.default.isNumber(span) && span > 0) {
|
|
647
|
+
return span;
|
|
648
|
+
}
|
|
649
|
+
return 1;
|
|
650
|
+
});
|
|
651
|
+
const total = numericSpans.reduce((sum, value) => sum + value, 0);
|
|
652
|
+
if (!total) {
|
|
653
|
+
return numericSpans.map(() => 24);
|
|
654
|
+
}
|
|
655
|
+
if (total === 24 && numericSpans.every((value) => Number.isInteger(value))) {
|
|
656
|
+
return numericSpans;
|
|
657
|
+
}
|
|
658
|
+
const raw = numericSpans.map((value) => value / total * 24);
|
|
659
|
+
const base = raw.map((value) => Math.max(1, Math.floor(value)));
|
|
660
|
+
let remainder = 24 - base.reduce((sum, value) => sum + value, 0);
|
|
661
|
+
const order = raw.map((value, index) => ({
|
|
662
|
+
index,
|
|
663
|
+
fraction: value - Math.floor(value)
|
|
664
|
+
})).sort((left, right) => right.fraction - left.fraction || left.index - right.index);
|
|
665
|
+
let cursor = 0;
|
|
666
|
+
while (remainder > 0 && order.length) {
|
|
667
|
+
base[order[cursor % order.length].index] += 1;
|
|
668
|
+
remainder -= 1;
|
|
669
|
+
cursor += 1;
|
|
670
|
+
}
|
|
671
|
+
while (remainder < 0 && order.length) {
|
|
672
|
+
const target = order[(cursor + order.length - 1) % order.length].index;
|
|
673
|
+
if (base[target] > 1) {
|
|
674
|
+
base[target] -= 1;
|
|
675
|
+
remainder += 1;
|
|
676
|
+
}
|
|
677
|
+
cursor += 1;
|
|
678
|
+
}
|
|
679
|
+
return base;
|
|
680
|
+
}
|
|
681
|
+
function normalizePublicBlockHeightMode(input) {
|
|
682
|
+
if (import_lodash.default.isUndefined(input)) {
|
|
683
|
+
return void 0;
|
|
684
|
+
}
|
|
685
|
+
if (import_lodash.default.isNull(input)) {
|
|
686
|
+
(0, import_errors.throwBadRequest)("flowSurfaces configure heightMode cannot be null");
|
|
687
|
+
}
|
|
688
|
+
const normalized = String(input || "").trim();
|
|
689
|
+
if (!normalized) {
|
|
690
|
+
(0, import_errors.throwBadRequest)("flowSurfaces configure heightMode cannot be empty");
|
|
691
|
+
}
|
|
692
|
+
const aliased = normalized === "fixed" ? "specifyValue" : normalized;
|
|
693
|
+
if (!["defaultHeight", "specifyValue", "fullHeight"].includes(aliased)) {
|
|
694
|
+
(0, import_errors.throwBadRequest)("flowSurfaces configure heightMode must be one of: defaultHeight, specifyValue, fullHeight");
|
|
695
|
+
}
|
|
696
|
+
return aliased;
|
|
697
|
+
}
|
|
698
|
+
function normalizeStoredChartCardHeightMode(input) {
|
|
699
|
+
if (import_lodash.default.isUndefined(input) || import_lodash.default.isNull(input) || String(input).trim() === "") {
|
|
700
|
+
return void 0;
|
|
701
|
+
}
|
|
702
|
+
try {
|
|
703
|
+
return normalizePublicBlockHeightMode(input);
|
|
704
|
+
} catch {
|
|
705
|
+
return void 0;
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
function normalizeChartCardHeightModeForWrite(input) {
|
|
709
|
+
if (import_lodash.default.isUndefined(input)) {
|
|
710
|
+
return void 0;
|
|
711
|
+
}
|
|
712
|
+
if (import_lodash.default.isNull(input)) {
|
|
713
|
+
(0, import_errors.throwBadRequest)("flowSurfaces updateSettings chart stepParams.cardSettings.blockHeight.heightMode cannot be null");
|
|
714
|
+
}
|
|
715
|
+
const normalized = String(input).trim();
|
|
716
|
+
if (!normalized) {
|
|
717
|
+
(0, import_errors.throwBadRequest)("flowSurfaces updateSettings chart stepParams.cardSettings.blockHeight.heightMode cannot be empty");
|
|
718
|
+
}
|
|
719
|
+
try {
|
|
720
|
+
return normalizePublicBlockHeightMode(normalized);
|
|
721
|
+
} catch {
|
|
722
|
+
(0, import_errors.throwBadRequest)(
|
|
723
|
+
"flowSurfaces updateSettings chart stepParams.cardSettings.blockHeight.heightMode must be one of: defaultHeight, specifyValue, fullHeight"
|
|
724
|
+
);
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
function isFieldNodeUse(use) {
|
|
728
|
+
return !!use && use.endsWith("FieldModel");
|
|
729
|
+
}
|
|
730
|
+
function getFieldBindingDefaultProps(containerUse, fieldUse, field) {
|
|
731
|
+
const fieldInterface = (0, import_service_helpers.getFieldInterface)(field);
|
|
732
|
+
const defaults = {};
|
|
733
|
+
const isFilterField = ["FilterFormBlockModel", "FilterFormGridModel", "FilterFormItemModel"].includes(containerUse);
|
|
734
|
+
if (fieldUse === "TextareaFieldModel") {
|
|
735
|
+
defaults.autoSize = {
|
|
736
|
+
maxRows: 10,
|
|
737
|
+
minRows: 3
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
if (fieldUse === "FilterFormRecordSelectFieldModel") {
|
|
741
|
+
defaults.allowMultiple = true;
|
|
742
|
+
defaults.multiple = true;
|
|
743
|
+
defaults.quickCreate = "none";
|
|
744
|
+
}
|
|
745
|
+
if (fieldUse === "SelectFieldModel") {
|
|
746
|
+
if (["select", "multipleSelect", "radioGroup"].includes(fieldInterface)) {
|
|
747
|
+
defaults.allowClear = true;
|
|
748
|
+
}
|
|
749
|
+
if (fieldInterface === "checkboxGroup") {
|
|
750
|
+
defaults.allowClear = true;
|
|
751
|
+
defaults.mode = "tags";
|
|
752
|
+
}
|
|
753
|
+
if (isFilterField && fieldInterface === "checkbox") {
|
|
754
|
+
defaults.allowClear = true;
|
|
755
|
+
defaults.multiple = false;
|
|
756
|
+
defaults.options = [
|
|
757
|
+
{
|
|
758
|
+
label: '{{t("Yes")}}',
|
|
759
|
+
value: true
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
label: '{{t("No")}}',
|
|
763
|
+
value: false
|
|
764
|
+
}
|
|
765
|
+
];
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
return defaults;
|
|
769
|
+
}
|
|
770
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
771
|
+
0 && (module.exports = {
|
|
772
|
+
assertFlowSurfaceComposeUniqueKeys,
|
|
773
|
+
assertSupportedSimpleChanges,
|
|
774
|
+
buildBlockTitleDescriptionFromSemanticChanges,
|
|
775
|
+
buildChartCardSettingsFromSemanticChanges,
|
|
776
|
+
buildDefaultFieldState,
|
|
777
|
+
buildDefinedPayload,
|
|
778
|
+
buildPopupTabTree,
|
|
779
|
+
ensureNoDirectActionScopeKey,
|
|
780
|
+
ensureNoRawDirectAddKeys,
|
|
781
|
+
ensureNoRawSimpleChangeKeys,
|
|
782
|
+
flattenModel,
|
|
783
|
+
getCatalogRecordActionContainerUse,
|
|
784
|
+
getFieldBindingDefaultProps,
|
|
785
|
+
getNodeSubModelList,
|
|
786
|
+
getSingleNodeSubModel,
|
|
787
|
+
hasDefinedValue,
|
|
788
|
+
hasLegacyLocatorFields,
|
|
789
|
+
hasMeaningfulChartSemanticPatch,
|
|
790
|
+
hasOwnDefined,
|
|
791
|
+
isFieldNodeUse,
|
|
792
|
+
isMissingRequiredResourceInitValue,
|
|
793
|
+
joinRequiredFieldPaths,
|
|
794
|
+
normalizeBlockTitleDescription,
|
|
795
|
+
normalizeBlockTitleDescriptionValue,
|
|
796
|
+
normalizeChartCardHeightModeForWrite,
|
|
797
|
+
normalizeChartCardSettings,
|
|
798
|
+
normalizeComposeActionSpec,
|
|
799
|
+
normalizeComposeFieldSpec,
|
|
800
|
+
normalizeFlowSurfaceComposeKey,
|
|
801
|
+
normalizeGridCardColumns,
|
|
802
|
+
normalizePublicBlockHeightMode,
|
|
803
|
+
normalizeRowSpans,
|
|
804
|
+
normalizeSimpleConfirm,
|
|
805
|
+
normalizeSimpleLayoutValue,
|
|
806
|
+
normalizeSimpleResourceInit,
|
|
807
|
+
normalizeStoredChartCardHeightMode,
|
|
808
|
+
rethrowInlineConfigurationError,
|
|
809
|
+
splitComposeFieldChanges,
|
|
810
|
+
toFlowSurfaceBatchItemError
|
|
811
|
+
});
|