@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,18 @@
|
|
|
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 { FlowSurfaceCatalogExpand, FlowSurfaceCatalogScenario, FlowSurfaceCatalogSection } from './types';
|
|
10
|
+
import type { FlowSurfaceCatalogAnalyzeTargetInput, FlowSurfaceCatalogAnalyzeTargetResult, FlowSurfaceCatalogExpandFlags, FlowSurfaceCatalogScenarioInput, FlowSurfaceCatalogSelectedSectionsInput } from './catalog-smart.types';
|
|
11
|
+
export * from './catalog-smart.types';
|
|
12
|
+
export { buildCatalogItemOptionalFields, buildFieldCatalogLightCandidate, expandFieldCatalogCandidate, projectCatalogItem, projectCatalogNode, } from './catalog-smart.projector';
|
|
13
|
+
export declare function normalizeCatalogSections(actionName: string, input: any): FlowSurfaceCatalogSection[];
|
|
14
|
+
export declare function normalizeCatalogExpand(actionName: string, input: any): FlowSurfaceCatalogExpand[];
|
|
15
|
+
export declare function buildCatalogExpandFlags(expands: Iterable<FlowSurfaceCatalogExpand>): FlowSurfaceCatalogExpandFlags;
|
|
16
|
+
export declare function scenario(input: FlowSurfaceCatalogScenarioInput): FlowSurfaceCatalogScenario;
|
|
17
|
+
export declare function selectedSections(input: FlowSurfaceCatalogSelectedSectionsInput): FlowSurfaceCatalogSection[];
|
|
18
|
+
export declare function analyzeCatalogTarget(input: FlowSurfaceCatalogAnalyzeTargetInput): FlowSurfaceCatalogAnalyzeTargetResult;
|
|
@@ -0,0 +1,239 @@
|
|
|
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
29
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
30
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
31
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
32
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
33
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
34
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
35
|
+
mod
|
|
36
|
+
));
|
|
37
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
|
+
var catalog_smart_exports = {};
|
|
39
|
+
__export(catalog_smart_exports, {
|
|
40
|
+
analyzeCatalogTarget: () => analyzeCatalogTarget,
|
|
41
|
+
buildCatalogExpandFlags: () => buildCatalogExpandFlags,
|
|
42
|
+
buildCatalogItemOptionalFields: () => import_catalog_smart.buildCatalogItemOptionalFields,
|
|
43
|
+
buildFieldCatalogLightCandidate: () => import_catalog_smart.buildFieldCatalogLightCandidate,
|
|
44
|
+
expandFieldCatalogCandidate: () => import_catalog_smart.expandFieldCatalogCandidate,
|
|
45
|
+
normalizeCatalogExpand: () => normalizeCatalogExpand,
|
|
46
|
+
normalizeCatalogSections: () => normalizeCatalogSections,
|
|
47
|
+
projectCatalogItem: () => import_catalog_smart.projectCatalogItem,
|
|
48
|
+
projectCatalogNode: () => import_catalog_smart.projectCatalogNode,
|
|
49
|
+
scenario: () => scenario,
|
|
50
|
+
selectedSections: () => selectedSections
|
|
51
|
+
});
|
|
52
|
+
module.exports = __toCommonJS(catalog_smart_exports);
|
|
53
|
+
var import_lodash = __toESM(require("lodash"));
|
|
54
|
+
var import_action_scope = require("./action-scope");
|
|
55
|
+
var import_errors = require("./errors");
|
|
56
|
+
var import_field_semantics = require("./field-semantics");
|
|
57
|
+
__reExport(catalog_smart_exports, require("./catalog-smart.types"), module.exports);
|
|
58
|
+
var import_catalog_smart = require("./catalog-smart.projector");
|
|
59
|
+
const FLOW_SURFACE_CATALOG_SECTION_SET = /* @__PURE__ */ new Set([
|
|
60
|
+
"blocks",
|
|
61
|
+
"fields",
|
|
62
|
+
"actions",
|
|
63
|
+
"recordActions",
|
|
64
|
+
"node"
|
|
65
|
+
]);
|
|
66
|
+
const FLOW_SURFACE_CATALOG_EXPAND_SET = /* @__PURE__ */ new Set([
|
|
67
|
+
"item.configureOptions",
|
|
68
|
+
"item.contracts",
|
|
69
|
+
"item.allowedContainerUses",
|
|
70
|
+
"node.contracts"
|
|
71
|
+
]);
|
|
72
|
+
function resolveCatalogPopupScenario(input) {
|
|
73
|
+
if (!(input == null ? void 0 : input.isPopupSurface)) {
|
|
74
|
+
return void 0;
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
kind: input.popupKind || "plainPopup",
|
|
78
|
+
scene: input.scene || "generic",
|
|
79
|
+
hasCurrentRecord: !!input.hasCurrentRecord,
|
|
80
|
+
hasAssociationContext: !!input.hasAssociationContext
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function resolveCatalogFieldContainerScenario(input) {
|
|
84
|
+
const kind = (0, import_field_semantics.normalizeFieldContainerKind)(input.ownerUse || void 0);
|
|
85
|
+
if (!kind) {
|
|
86
|
+
return void 0;
|
|
87
|
+
}
|
|
88
|
+
if (kind === "filter-form") {
|
|
89
|
+
return {
|
|
90
|
+
kind,
|
|
91
|
+
targetMode: (input.filterFormTargetCount || 0) > 1 ? "multiple" : "single"
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
return { kind };
|
|
95
|
+
}
|
|
96
|
+
function resolveCatalogActionContainerScenario(input) {
|
|
97
|
+
const ownerUse = input.ownerUse || void 0;
|
|
98
|
+
const scope = (0, import_action_scope.getActionContainerScope)(ownerUse);
|
|
99
|
+
if (!scope) {
|
|
100
|
+
return void 0;
|
|
101
|
+
}
|
|
102
|
+
return import_lodash.default.pickBy(
|
|
103
|
+
{
|
|
104
|
+
scope,
|
|
105
|
+
ownerUse,
|
|
106
|
+
recordActionContainerUse: input.recordActionContainerUse || void 0
|
|
107
|
+
},
|
|
108
|
+
(value) => !import_lodash.default.isUndefined(value)
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
function normalizeCatalogSections(actionName, input) {
|
|
112
|
+
if (import_lodash.default.isUndefined(input)) {
|
|
113
|
+
return [];
|
|
114
|
+
}
|
|
115
|
+
if (!Array.isArray(input)) {
|
|
116
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces ${actionName} sections must be an array`);
|
|
117
|
+
}
|
|
118
|
+
const seen = /* @__PURE__ */ new Set();
|
|
119
|
+
return input.map((value, index) => {
|
|
120
|
+
const normalized = String(value || "").trim();
|
|
121
|
+
if (!FLOW_SURFACE_CATALOG_SECTION_SET.has(normalized)) {
|
|
122
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces ${actionName} sections[${index}] '${String(value || "")}' is not supported`);
|
|
123
|
+
}
|
|
124
|
+
if (seen.has(normalized)) {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
seen.add(normalized);
|
|
128
|
+
return normalized;
|
|
129
|
+
}).filter(Boolean);
|
|
130
|
+
}
|
|
131
|
+
function normalizeCatalogExpand(actionName, input) {
|
|
132
|
+
if (import_lodash.default.isUndefined(input)) {
|
|
133
|
+
return [];
|
|
134
|
+
}
|
|
135
|
+
if (!Array.isArray(input)) {
|
|
136
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces ${actionName} expand must be an array`);
|
|
137
|
+
}
|
|
138
|
+
const seen = /* @__PURE__ */ new Set();
|
|
139
|
+
return input.map((value, index) => {
|
|
140
|
+
const normalized = String(value || "").trim();
|
|
141
|
+
if (!FLOW_SURFACE_CATALOG_EXPAND_SET.has(normalized)) {
|
|
142
|
+
(0, import_errors.throwBadRequest)(`flowSurfaces ${actionName} expand[${index}] '${String(value || "")}' is not supported`);
|
|
143
|
+
}
|
|
144
|
+
if (seen.has(normalized)) {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
seen.add(normalized);
|
|
148
|
+
return normalized;
|
|
149
|
+
}).filter(Boolean);
|
|
150
|
+
}
|
|
151
|
+
function buildCatalogExpandFlags(expands) {
|
|
152
|
+
const expandSet = new Set(expands);
|
|
153
|
+
return {
|
|
154
|
+
includeItemConfigureOptions: expandSet.has("item.configureOptions"),
|
|
155
|
+
includeItemContracts: expandSet.has("item.contracts"),
|
|
156
|
+
includeItemAllowedContainerUses: expandSet.has("item.allowedContainerUses"),
|
|
157
|
+
includeNodeContracts: expandSet.has("node.contracts")
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
function scenario(input) {
|
|
161
|
+
return import_lodash.default.pickBy(
|
|
162
|
+
{
|
|
163
|
+
surfaceKind: input.surfaceKind,
|
|
164
|
+
popup: input.popup,
|
|
165
|
+
fieldContainer: input.fieldContainer,
|
|
166
|
+
actionContainer: input.actionContainer
|
|
167
|
+
},
|
|
168
|
+
(value) => !import_lodash.default.isUndefined(value)
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
function selectedSections(input) {
|
|
172
|
+
if (!import_lodash.default.isUndefined(input.requestedSections)) {
|
|
173
|
+
return input.requestedSections;
|
|
174
|
+
}
|
|
175
|
+
if (!input.hasTarget) {
|
|
176
|
+
return ["blocks", "actions", "recordActions"];
|
|
177
|
+
}
|
|
178
|
+
const sections = [];
|
|
179
|
+
if (input.hasBlockSurface) {
|
|
180
|
+
sections.push("blocks");
|
|
181
|
+
}
|
|
182
|
+
if (input.hasFieldContainer) {
|
|
183
|
+
sections.push("fields");
|
|
184
|
+
}
|
|
185
|
+
if (input.hasActionContainer) {
|
|
186
|
+
sections.push("actions");
|
|
187
|
+
}
|
|
188
|
+
if (input.hasRecordActions) {
|
|
189
|
+
sections.push("recordActions");
|
|
190
|
+
}
|
|
191
|
+
sections.push("node");
|
|
192
|
+
return sections;
|
|
193
|
+
}
|
|
194
|
+
function analyzeCatalogTarget(input) {
|
|
195
|
+
var _a, _b, _c;
|
|
196
|
+
const recordActionContainerUse = input.recordActionContainerUse || null;
|
|
197
|
+
const popup = resolveCatalogPopupScenario(input.popupProfile);
|
|
198
|
+
const fieldContainer = resolveCatalogFieldContainerScenario({
|
|
199
|
+
ownerUse: (_a = input.fieldContainer) == null ? void 0 : _a.ownerUse,
|
|
200
|
+
filterFormTargetCount: input.filterFormTargetCount
|
|
201
|
+
});
|
|
202
|
+
const actionContainer = resolveCatalogActionContainerScenario({
|
|
203
|
+
ownerUse: (_b = input.actionContainer) == null ? void 0 : _b.ownerUse,
|
|
204
|
+
recordActionContainerUse
|
|
205
|
+
});
|
|
206
|
+
const hasRecordActions = import_lodash.default.isBoolean(input.hasRecordActions) ? input.hasRecordActions : !!recordActionContainerUse || !input.hasTarget;
|
|
207
|
+
return {
|
|
208
|
+
scenario: scenario({
|
|
209
|
+
surfaceKind: input.surfaceKind || ((_c = input.resolved) == null ? void 0 : _c.kind) || "global",
|
|
210
|
+
popup,
|
|
211
|
+
fieldContainer,
|
|
212
|
+
actionContainer
|
|
213
|
+
}),
|
|
214
|
+
selectedSections: selectedSections({
|
|
215
|
+
requestedSections: input.requestedSections,
|
|
216
|
+
hasTarget: input.hasTarget,
|
|
217
|
+
hasBlockSurface: input.hasBlockSurface,
|
|
218
|
+
hasFieldContainer: !!fieldContainer,
|
|
219
|
+
hasActionContainer: !!actionContainer,
|
|
220
|
+
hasRecordActions
|
|
221
|
+
}),
|
|
222
|
+
recordActionContainerUse
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
226
|
+
0 && (module.exports = {
|
|
227
|
+
analyzeCatalogTarget,
|
|
228
|
+
buildCatalogExpandFlags,
|
|
229
|
+
buildCatalogItemOptionalFields,
|
|
230
|
+
buildFieldCatalogLightCandidate,
|
|
231
|
+
expandFieldCatalogCandidate,
|
|
232
|
+
normalizeCatalogExpand,
|
|
233
|
+
normalizeCatalogSections,
|
|
234
|
+
projectCatalogItem,
|
|
235
|
+
projectCatalogNode,
|
|
236
|
+
scenario,
|
|
237
|
+
selectedSections,
|
|
238
|
+
...require("./catalog-smart.types")
|
|
239
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
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 { FlowSurfaceCatalogExpandFlags, FlowSurfaceCatalogItemOptionalFieldsOptions, FlowSurfaceCatalogItemOptionalFieldsProviders, FlowSurfaceCatalogNodeProjectInput, FlowSurfaceCatalogNodeProjectResult, FlowSurfaceCatalogProjectItemOptions, FlowSurfaceCatalogProjectableItem, FlowSurfaceCatalogProjectedItem, FlowSurfaceFieldCatalogProjectableItem, FlowSurfaceFieldCatalogLightCandidate } from './catalog-smart.types';
|
|
11
|
+
export declare function buildCatalogItemOptionalFields(use: string | undefined, options: FlowSurfaceCatalogItemOptionalFieldsOptions, providers: FlowSurfaceCatalogItemOptionalFieldsProviders): _.Dictionary<any>;
|
|
12
|
+
export declare function buildFieldCatalogLightCandidate(item: FlowSurfaceFieldCatalogProjectableItem): FlowSurfaceFieldCatalogLightCandidate;
|
|
13
|
+
export declare function projectCatalogItem(item: FlowSurfaceCatalogProjectableItem, expand: FlowSurfaceCatalogExpandFlags, options: FlowSurfaceCatalogProjectItemOptions): FlowSurfaceCatalogProjectedItem;
|
|
14
|
+
export declare function expandFieldCatalogCandidate(item: FlowSurfaceFieldCatalogProjectableItem, expand: FlowSurfaceCatalogExpandFlags, options: FlowSurfaceCatalogProjectItemOptions): FlowSurfaceCatalogProjectedItem;
|
|
15
|
+
export declare function projectCatalogNode(node: any, resolved: FlowSurfaceCatalogNodeProjectInput['resolved'], expand: FlowSurfaceCatalogExpandFlags, options: FlowSurfaceCatalogNodeProjectInput['options']): FlowSurfaceCatalogNodeProjectResult;
|
|
@@ -0,0 +1,157 @@
|
|
|
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 catalog_smart_projector_exports = {};
|
|
38
|
+
__export(catalog_smart_projector_exports, {
|
|
39
|
+
buildCatalogItemOptionalFields: () => buildCatalogItemOptionalFields,
|
|
40
|
+
buildFieldCatalogLightCandidate: () => buildFieldCatalogLightCandidate,
|
|
41
|
+
expandFieldCatalogCandidate: () => expandFieldCatalogCandidate,
|
|
42
|
+
projectCatalogItem: () => projectCatalogItem,
|
|
43
|
+
projectCatalogNode: () => projectCatalogNode
|
|
44
|
+
});
|
|
45
|
+
module.exports = __toCommonJS(catalog_smart_projector_exports);
|
|
46
|
+
var import_lodash = __toESM(require("lodash"));
|
|
47
|
+
const LIGHT_CATALOG_ITEM_KEYS = [
|
|
48
|
+
"key",
|
|
49
|
+
"label",
|
|
50
|
+
"use",
|
|
51
|
+
"kind",
|
|
52
|
+
"scope",
|
|
53
|
+
"scene",
|
|
54
|
+
"fieldUse",
|
|
55
|
+
"wrapperUse",
|
|
56
|
+
"associationPathName",
|
|
57
|
+
"defaultTargetUid",
|
|
58
|
+
"targetBlockUid",
|
|
59
|
+
"requiredInitParams",
|
|
60
|
+
"createSupported",
|
|
61
|
+
"renderer",
|
|
62
|
+
"type"
|
|
63
|
+
];
|
|
64
|
+
function pickLightCatalogItem(item) {
|
|
65
|
+
var _a;
|
|
66
|
+
const projected = import_lodash.default.pick(item, LIGHT_CATALOG_ITEM_KEYS);
|
|
67
|
+
if ((_a = item.resourceBindings) == null ? void 0 : _a.length) {
|
|
68
|
+
projected.resourceBindings = item.resourceBindings;
|
|
69
|
+
}
|
|
70
|
+
return import_lodash.default.pickBy(projected, (value) => !import_lodash.default.isUndefined(value));
|
|
71
|
+
}
|
|
72
|
+
function createNodeContractResolver(item, options) {
|
|
73
|
+
let loaded = false;
|
|
74
|
+
let cached;
|
|
75
|
+
return () => {
|
|
76
|
+
if (!loaded) {
|
|
77
|
+
cached = options.getNodeContract(item.use);
|
|
78
|
+
loaded = true;
|
|
79
|
+
}
|
|
80
|
+
return cached;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function buildCatalogItemOptionalFields(use, options = {}, providers) {
|
|
84
|
+
const projected = {};
|
|
85
|
+
if (options.includeContracts) {
|
|
86
|
+
const contract = providers.getNodeContract(use);
|
|
87
|
+
projected.editableDomains = providers.getEditableDomains(use);
|
|
88
|
+
projected.settingsSchema = providers.getSettingsSchema(use);
|
|
89
|
+
projected.settingsContract = contract == null ? void 0 : contract.domains;
|
|
90
|
+
projected.eventCapabilities = contract == null ? void 0 : contract.eventCapabilities;
|
|
91
|
+
projected.layoutCapabilities = contract == null ? void 0 : contract.layoutCapabilities;
|
|
92
|
+
}
|
|
93
|
+
if (options.includeConfigureOptions) {
|
|
94
|
+
projected.configureOptions = providers.getConfigureOptions(use);
|
|
95
|
+
}
|
|
96
|
+
return import_lodash.default.pickBy(projected, (value) => !import_lodash.default.isUndefined(value));
|
|
97
|
+
}
|
|
98
|
+
function buildFieldCatalogLightCandidate(item) {
|
|
99
|
+
return pickLightCatalogItem({
|
|
100
|
+
...item,
|
|
101
|
+
kind: "field"
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function projectCatalogItem(item, expand, options) {
|
|
105
|
+
var _a, _b, _c, _d;
|
|
106
|
+
const projected = pickLightCatalogItem(item);
|
|
107
|
+
if (expand.includeItemAllowedContainerUses && ((_a = item.allowedContainerUses) == null ? void 0 : _a.length)) {
|
|
108
|
+
projected.allowedContainerUses = item.allowedContainerUses;
|
|
109
|
+
}
|
|
110
|
+
if (expand.includeItemConfigureOptions) {
|
|
111
|
+
projected.configureOptions = !import_lodash.default.isUndefined(item.configureOptions) ? item.configureOptions : options.getConfigureOptions(item);
|
|
112
|
+
}
|
|
113
|
+
if (expand.includeItemContracts) {
|
|
114
|
+
const resolveContract = createNodeContractResolver(item, options);
|
|
115
|
+
projected.editableDomains = !import_lodash.default.isUndefined(item.editableDomains) ? item.editableDomains : options.getEditableDomains(item.use);
|
|
116
|
+
projected.settingsSchema = !import_lodash.default.isUndefined(item.settingsSchema) ? item.settingsSchema : options.getSettingsSchema(item.use);
|
|
117
|
+
projected.settingsContract = !import_lodash.default.isUndefined(item.settingsContract) ? item.settingsContract : (_b = resolveContract()) == null ? void 0 : _b.domains;
|
|
118
|
+
projected.eventCapabilities = !import_lodash.default.isUndefined(item.eventCapabilities) ? item.eventCapabilities : (_c = resolveContract()) == null ? void 0 : _c.eventCapabilities;
|
|
119
|
+
projected.layoutCapabilities = !import_lodash.default.isUndefined(item.layoutCapabilities) ? item.layoutCapabilities : (_d = resolveContract()) == null ? void 0 : _d.layoutCapabilities;
|
|
120
|
+
}
|
|
121
|
+
return import_lodash.default.pickBy(projected, (value) => !import_lodash.default.isUndefined(value));
|
|
122
|
+
}
|
|
123
|
+
function expandFieldCatalogCandidate(item, expand, options) {
|
|
124
|
+
return projectCatalogItem(buildFieldCatalogLightCandidate(item), expand, options);
|
|
125
|
+
}
|
|
126
|
+
function projectCatalogNode(node, resolved, expand, options) {
|
|
127
|
+
var _a, _b, _c, _d, _e;
|
|
128
|
+
const input = {
|
|
129
|
+
node,
|
|
130
|
+
resolved: resolved || null,
|
|
131
|
+
expand,
|
|
132
|
+
options
|
|
133
|
+
};
|
|
134
|
+
const projected = {
|
|
135
|
+
editableDomains: input.options.getEditableDomains((_a = input.node) == null ? void 0 : _a.use),
|
|
136
|
+
configureOptions: input.options.getConfigureOptionsForResolvedNode({
|
|
137
|
+
kind: (_b = input.resolved) == null ? void 0 : _b.kind,
|
|
138
|
+
use: (_c = input.node) == null ? void 0 : _c.use
|
|
139
|
+
})
|
|
140
|
+
};
|
|
141
|
+
if (input.expand.includeNodeContracts) {
|
|
142
|
+
const contract = input.options.getNodeContract((_d = input.node) == null ? void 0 : _d.use);
|
|
143
|
+
projected.settingsSchema = input.options.getSettingsSchema((_e = input.node) == null ? void 0 : _e.use);
|
|
144
|
+
projected.settingsContract = contract == null ? void 0 : contract.domains;
|
|
145
|
+
projected.eventCapabilities = contract == null ? void 0 : contract.eventCapabilities;
|
|
146
|
+
projected.layoutCapabilities = contract == null ? void 0 : contract.layoutCapabilities;
|
|
147
|
+
}
|
|
148
|
+
return projected;
|
|
149
|
+
}
|
|
150
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
151
|
+
0 && (module.exports = {
|
|
152
|
+
buildCatalogItemOptionalFields,
|
|
153
|
+
buildFieldCatalogLightCandidate,
|
|
154
|
+
expandFieldCatalogCandidate,
|
|
155
|
+
projectCatalogItem,
|
|
156
|
+
projectCatalogNode
|
|
157
|
+
});
|
|
@@ -0,0 +1,99 @@
|
|
|
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 { FlowSurfaceCatalogActionContainerScenario, FlowSurfaceCatalogFieldContainerScenario, FlowSurfaceCatalogItem, FlowSurfaceCatalogNodeInfo, FlowSurfaceCatalogPopupScenario, FlowSurfaceCatalogScenario, FlowSurfaceCatalogSection, FlowSurfaceNodeContract, FlowSurfaceNodeDomain, FlowSurfaceResolvedTarget } from './types';
|
|
10
|
+
export type FlowSurfaceCatalogExpandFlags = {
|
|
11
|
+
includeItemConfigureOptions: boolean;
|
|
12
|
+
includeItemContracts: boolean;
|
|
13
|
+
includeItemAllowedContainerUses: boolean;
|
|
14
|
+
includeNodeContracts: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type FlowSurfaceCatalogPopupLike = {
|
|
17
|
+
isPopupSurface?: boolean;
|
|
18
|
+
popupKind?: FlowSurfaceCatalogPopupScenario['kind'] | null;
|
|
19
|
+
scene?: FlowSurfaceCatalogPopupScenario['scene'];
|
|
20
|
+
hasCurrentRecord?: boolean;
|
|
21
|
+
hasAssociationContext?: boolean;
|
|
22
|
+
};
|
|
23
|
+
export type FlowSurfaceCatalogFieldContainerLike = {
|
|
24
|
+
ownerUse?: string | null;
|
|
25
|
+
};
|
|
26
|
+
export type FlowSurfaceCatalogActionContainerLike = {
|
|
27
|
+
ownerUse?: string | null;
|
|
28
|
+
};
|
|
29
|
+
export type FlowSurfaceCatalogAnalyzeTargetInput = {
|
|
30
|
+
hasTarget: boolean;
|
|
31
|
+
hasBlockSurface: boolean;
|
|
32
|
+
resolved?: Pick<FlowSurfaceResolvedTarget, 'kind'> | null;
|
|
33
|
+
surfaceKind?: FlowSurfaceCatalogScenario['surfaceKind'];
|
|
34
|
+
requestedSections?: FlowSurfaceCatalogSection[];
|
|
35
|
+
popupProfile?: FlowSurfaceCatalogPopupLike | null;
|
|
36
|
+
fieldContainer?: FlowSurfaceCatalogFieldContainerLike | null;
|
|
37
|
+
filterFormTargetCount?: number;
|
|
38
|
+
actionContainer?: FlowSurfaceCatalogActionContainerLike | null;
|
|
39
|
+
recordActionContainerUse?: string | null;
|
|
40
|
+
hasRecordActions?: boolean;
|
|
41
|
+
};
|
|
42
|
+
export type FlowSurfaceCatalogAnalyzeTargetResult = {
|
|
43
|
+
scenario: FlowSurfaceCatalogScenario;
|
|
44
|
+
selectedSections: FlowSurfaceCatalogSection[];
|
|
45
|
+
recordActionContainerUse: string | null;
|
|
46
|
+
};
|
|
47
|
+
export type FlowSurfaceCatalogScenarioInput = {
|
|
48
|
+
surfaceKind: FlowSurfaceCatalogScenario['surfaceKind'];
|
|
49
|
+
popup?: FlowSurfaceCatalogPopupScenario;
|
|
50
|
+
fieldContainer?: FlowSurfaceCatalogFieldContainerScenario;
|
|
51
|
+
actionContainer?: FlowSurfaceCatalogActionContainerScenario;
|
|
52
|
+
};
|
|
53
|
+
export type FlowSurfaceCatalogSelectedSectionsInput = {
|
|
54
|
+
requestedSections?: FlowSurfaceCatalogSection[];
|
|
55
|
+
hasTarget: boolean;
|
|
56
|
+
hasBlockSurface: boolean;
|
|
57
|
+
hasFieldContainer: boolean;
|
|
58
|
+
hasActionContainer: boolean;
|
|
59
|
+
hasRecordActions: boolean;
|
|
60
|
+
};
|
|
61
|
+
export type FlowSurfaceCatalogProjectedItem = FlowSurfaceCatalogItem & {
|
|
62
|
+
renderer?: string;
|
|
63
|
+
type?: string;
|
|
64
|
+
};
|
|
65
|
+
export type FlowSurfaceCatalogProjectableItem = Pick<FlowSurfaceCatalogItem, 'key' | 'label' | 'use' | 'kind'> & Partial<FlowSurfaceCatalogItem> & Record<string, any>;
|
|
66
|
+
export type FlowSurfaceFieldCatalogProjectableItem = Pick<FlowSurfaceCatalogItem, 'key' | 'label' | 'use'> & Partial<Omit<FlowSurfaceCatalogItem, 'kind'>> & Record<string, any>;
|
|
67
|
+
export type FlowSurfaceFieldCatalogLightCandidate = FlowSurfaceCatalogProjectedItem;
|
|
68
|
+
export type FlowSurfaceCatalogProjectItemOptions = {
|
|
69
|
+
getEditableDomains: (use?: string) => FlowSurfaceNodeDomain[];
|
|
70
|
+
getConfigureOptions: (item?: Pick<FlowSurfaceCatalogItem, 'kind' | 'use'> | null) => Record<string, any>;
|
|
71
|
+
getSettingsSchema: (use?: string) => Record<string, any>;
|
|
72
|
+
getNodeContract: (use?: string) => FlowSurfaceNodeContract;
|
|
73
|
+
};
|
|
74
|
+
export type FlowSurfaceCatalogItemOptionalFieldsOptions = {
|
|
75
|
+
includeConfigureOptions?: boolean;
|
|
76
|
+
includeContracts?: boolean;
|
|
77
|
+
};
|
|
78
|
+
export type FlowSurfaceCatalogItemOptionalFieldsProviders = {
|
|
79
|
+
getEditableDomains: (use?: string) => FlowSurfaceNodeDomain[];
|
|
80
|
+
getConfigureOptions: (use?: string) => Record<string, any>;
|
|
81
|
+
getSettingsSchema: (use?: string) => Record<string, any>;
|
|
82
|
+
getNodeContract: (use?: string) => FlowSurfaceNodeContract;
|
|
83
|
+
};
|
|
84
|
+
export type FlowSurfaceCatalogNodeProjectOptions = {
|
|
85
|
+
getEditableDomains: (use?: string) => FlowSurfaceNodeDomain[];
|
|
86
|
+
getConfigureOptionsForResolvedNode: (input: {
|
|
87
|
+
kind?: string;
|
|
88
|
+
use?: string;
|
|
89
|
+
}) => Record<string, any>;
|
|
90
|
+
getSettingsSchema: (use?: string) => Record<string, any>;
|
|
91
|
+
getNodeContract: (use?: string) => FlowSurfaceNodeContract;
|
|
92
|
+
};
|
|
93
|
+
export type FlowSurfaceCatalogNodeProjectInput = {
|
|
94
|
+
node: any;
|
|
95
|
+
resolved: Pick<FlowSurfaceResolvedTarget, 'kind'> | null;
|
|
96
|
+
expand: FlowSurfaceCatalogExpandFlags;
|
|
97
|
+
options: FlowSurfaceCatalogNodeProjectOptions;
|
|
98
|
+
};
|
|
99
|
+
export type FlowSurfaceCatalogNodeProjectResult = FlowSurfaceCatalogNodeInfo;
|
|
@@ -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 catalog_smart_types_exports = {};
|
|
24
|
+
module.exports = __toCommonJS(catalog_smart_types_exports);
|
|
@@ -0,0 +1,79 @@
|
|
|
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 { FlowSurfaceActionScope, FlowSurfaceCatalogItem, FlowSurfaceLayoutCapabilities, FlowSurfaceNodeContract, FlowSurfaceNodeDomain } from './types';
|
|
10
|
+
export declare const READONLY_NODE_CONTRACT: FlowSurfaceNodeContract;
|
|
11
|
+
export declare function getSupportedFieldComponentUseSet(input: {
|
|
12
|
+
containerUse: string;
|
|
13
|
+
field?: any;
|
|
14
|
+
enabledPackages?: ReadonlySet<string>;
|
|
15
|
+
dataSourceKey?: string;
|
|
16
|
+
getCollection?: (dataSourceKey: string, collectionName: string) => any;
|
|
17
|
+
}): Set<string>;
|
|
18
|
+
export declare function resolveSupportedFieldCapability(input: {
|
|
19
|
+
containerUse: string;
|
|
20
|
+
field?: any;
|
|
21
|
+
requestedFieldUse?: string;
|
|
22
|
+
requestedFieldUseMode?: 'fieldUse' | 'fieldType';
|
|
23
|
+
requestedWrapperUse?: string;
|
|
24
|
+
allowUnresolvedFieldUse?: boolean;
|
|
25
|
+
requestedRenderer?: string;
|
|
26
|
+
requestedType?: string;
|
|
27
|
+
enabledPackages?: ReadonlySet<string>;
|
|
28
|
+
dataSourceKey?: string;
|
|
29
|
+
getCollection?: (dataSourceKey: string, collectionName: string) => any;
|
|
30
|
+
}): {
|
|
31
|
+
wrapperUse: any;
|
|
32
|
+
fieldUse: any;
|
|
33
|
+
inferredFieldUse: any;
|
|
34
|
+
standaloneUse: string;
|
|
35
|
+
renderer: any;
|
|
36
|
+
} | {
|
|
37
|
+
wrapperUse: string;
|
|
38
|
+
fieldUse: any;
|
|
39
|
+
inferredFieldUse: any;
|
|
40
|
+
standaloneUse: any;
|
|
41
|
+
renderer: string;
|
|
42
|
+
};
|
|
43
|
+
export declare function getAvailableActionCatalogItems(containerUse?: string, scope?: FlowSurfaceActionScope, enabledPackages?: ReadonlySet<string>): FlowSurfaceCatalogItem[];
|
|
44
|
+
export declare const blockCatalog: FlowSurfaceCatalogItem[];
|
|
45
|
+
export declare function getAvailableBlockCatalogItems(containerUse?: string, enabledPackages?: ReadonlySet<string>): FlowSurfaceCatalogItem[];
|
|
46
|
+
export declare const actionCatalog: FlowSurfaceCatalogItem[];
|
|
47
|
+
export declare const ACTION_PUBLIC_KEYS: string[];
|
|
48
|
+
export declare const SERVICE_SUPPORTED_FLOW_SURFACE_BLOCK_KEYS: string[];
|
|
49
|
+
export declare const BLOCK_CATALOG_BY_KEY: Map<string, FlowSurfaceCatalogItem>;
|
|
50
|
+
export declare const BLOCK_CATALOG_BY_USE: Map<string, FlowSurfaceCatalogItem>;
|
|
51
|
+
export declare const ACTION_CATALOG_BY_KEY: Map<string, FlowSurfaceCatalogItem[]>;
|
|
52
|
+
export declare const ACTION_CATALOG_BY_USE: Map<string, FlowSurfaceCatalogItem[]>;
|
|
53
|
+
export declare const BLOCK_KEY_BY_USE: Map<string, string>;
|
|
54
|
+
export declare const ACTION_KEY_BY_USE: Map<string, string>;
|
|
55
|
+
export declare function isCatalogItemAvailable(item: Pick<FlowSurfaceCatalogItem, 'kind' | 'use'>, enabledPackages?: ReadonlySet<string>): boolean;
|
|
56
|
+
export declare function filterAvailableCatalogItems<T extends Pick<FlowSurfaceCatalogItem, 'kind' | 'use'>>(items: T[], enabledPackages?: ReadonlySet<string>): T[];
|
|
57
|
+
export declare function resolveSupportedBlockCatalogItem(input: {
|
|
58
|
+
type?: string;
|
|
59
|
+
use?: string;
|
|
60
|
+
containerUse?: string;
|
|
61
|
+
}, options?: {
|
|
62
|
+
context?: string;
|
|
63
|
+
enabledPackages?: ReadonlySet<string>;
|
|
64
|
+
requireCreateSupported?: boolean;
|
|
65
|
+
skipContainerValidation?: boolean;
|
|
66
|
+
}): FlowSurfaceCatalogItem;
|
|
67
|
+
export declare function resolveSupportedActionCatalogItem(input: {
|
|
68
|
+
type?: string;
|
|
69
|
+
use?: string;
|
|
70
|
+
containerUse?: string;
|
|
71
|
+
}, options?: {
|
|
72
|
+
context?: string;
|
|
73
|
+
enabledPackages?: ReadonlySet<string>;
|
|
74
|
+
requireCreateSupported?: boolean;
|
|
75
|
+
}): FlowSurfaceCatalogItem;
|
|
76
|
+
export declare function getNodeContract(use?: string): FlowSurfaceNodeContract;
|
|
77
|
+
export declare function getEditableDomainsForUse(use?: string): FlowSurfaceNodeDomain[];
|
|
78
|
+
export declare function getSettingsSchemaForUse(use?: string): Record<string, any>;
|
|
79
|
+
export declare function getLayoutCapabilitiesForUse(use?: string): FlowSurfaceLayoutCapabilities | undefined;
|