@nocobase/plugin-flow-engine 2.1.0-beta.23 → 2.1.0-beta.25
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.js +1 -0
- package/dist/externalVersion.js +10 -10
- package/dist/node_modules/ses/package.json +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/flow-surfaces/blueprint/compile-blocks.d.ts +2 -1
- package/dist/server/flow-surfaces/blueprint/compile-blocks.js +142 -22
- package/dist/server/flow-surfaces/blueprint/compile-plan.d.ts +2 -1
- package/dist/server/flow-surfaces/blueprint/compile-plan.js +8 -8
- package/dist/server/flow-surfaces/blueprint/normalize-document.js +5 -14
- package/dist/server/flow-surfaces/blueprint/private-utils.d.ts +0 -1
- package/dist/server/flow-surfaces/blueprint/private-utils.js +0 -3
- package/dist/server/flow-surfaces/blueprint/public-types.d.ts +1 -1
- package/dist/server/flow-surfaces/builder.d.ts +1 -0
- package/dist/server/flow-surfaces/builder.js +167 -53
- package/dist/server/flow-surfaces/catalog.js +59 -3
- package/dist/server/flow-surfaces/compose-compiler.d.ts +0 -1
- package/dist/server/flow-surfaces/compose-compiler.js +0 -1
- package/dist/server/flow-surfaces/configure-options.js +4 -4
- package/dist/server/flow-surfaces/contract-guard.js +11 -3
- package/dist/server/flow-surfaces/default-block-actions.js +11 -10
- package/dist/server/flow-surfaces/field-type-resolver.d.ts +0 -1
- package/dist/server/flow-surfaces/field-type-resolver.js +3 -13
- package/dist/server/flow-surfaces/hidden-popup-calendar.d.ts +86 -0
- package/dist/server/flow-surfaces/hidden-popup-calendar.js +554 -0
- package/dist/server/flow-surfaces/hidden-popup-contract.d.ts +116 -0
- package/dist/server/flow-surfaces/hidden-popup-contract.js +611 -0
- package/dist/server/flow-surfaces/hidden-popup-kanban.d.ts +62 -0
- package/dist/server/flow-surfaces/hidden-popup-kanban.js +651 -0
- package/dist/server/flow-surfaces/placement.js +1 -0
- package/dist/server/flow-surfaces/public-compatibility.d.ts +28 -0
- package/dist/server/flow-surfaces/public-compatibility.js +161 -0
- package/dist/server/flow-surfaces/service-utils.d.ts +0 -1
- package/dist/server/flow-surfaces/service-utils.js +0 -6
- package/dist/server/flow-surfaces/service.d.ts +66 -10
- package/dist/server/flow-surfaces/service.js +1677 -795
- package/dist/swagger/flow-surfaces.d.ts +0 -29
- package/dist/swagger/flow-surfaces.js +8 -17
- package/dist/swagger/index.d.ts +0 -29
- package/package.json +2 -2
|
@@ -93,6 +93,7 @@ const FIELD_USE_TO_PUBLIC_FIELD_TYPE = {
|
|
|
93
93
|
PopupSubTableFieldModel: "popupSubTable"
|
|
94
94
|
};
|
|
95
95
|
const FIELD_TYPES_WITH_FIELDS = /* @__PURE__ */ new Set([
|
|
96
|
+
"picker",
|
|
96
97
|
"subForm",
|
|
97
98
|
"subFormList",
|
|
98
99
|
"subDetails",
|
|
@@ -100,7 +101,6 @@ const FIELD_TYPES_WITH_FIELDS = /* @__PURE__ */ new Set([
|
|
|
100
101
|
"subTable",
|
|
101
102
|
"popupSubTable"
|
|
102
103
|
]);
|
|
103
|
-
const FIELD_TYPES_WITH_SELECTOR_FIELDS = /* @__PURE__ */ new Set(["picker"]);
|
|
104
104
|
const FIELD_TYPES_WITH_TABLE_PROPS = /* @__PURE__ */ new Set(["subTable", "popupSubTable"]);
|
|
105
105
|
function assertNoInternalFieldKeys(input, context) {
|
|
106
106
|
if (!import_lodash.default.isPlainObject(input)) {
|
|
@@ -250,16 +250,9 @@ function resolveRelationFieldType(input) {
|
|
|
250
250
|
break;
|
|
251
251
|
}
|
|
252
252
|
const explicitFields = normalizePublicFieldNameList(input.fields, `${input.context}.fields`);
|
|
253
|
-
const explicitSelectorFields = normalizePublicFieldNameList(input.selectorFields, `${input.context}.selectorFields`);
|
|
254
|
-
if (explicitFields && explicitSelectorFields) {
|
|
255
|
-
(0, import_errors.throwBadRequest)(`flowSurfaces ${input.context} cannot mix fields and selectorFields on the same field`);
|
|
256
|
-
}
|
|
257
253
|
if (explicitFields && !FIELD_TYPES_WITH_FIELDS.has(fieldType)) {
|
|
258
254
|
(0, import_errors.throwBadRequest)(`flowSurfaces ${input.context} fieldType '${fieldType}' does not support fields`);
|
|
259
255
|
}
|
|
260
|
-
if (explicitSelectorFields && !FIELD_TYPES_WITH_SELECTOR_FIELDS.has(fieldType)) {
|
|
261
|
-
(0, import_errors.throwBadRequest)(`flowSurfaces ${input.context} fieldType '${fieldType}' does not support selectorFields`);
|
|
262
|
-
}
|
|
263
256
|
if ((!import_lodash.default.isUndefined(input.openMode) || !import_lodash.default.isUndefined(input.popupSize)) && fieldType !== "picker") {
|
|
264
257
|
(0, import_errors.throwBadRequest)(`flowSurfaces ${input.context} fieldType '${fieldType}' does not support openMode or popupSize`);
|
|
265
258
|
}
|
|
@@ -268,15 +261,12 @@ function resolveRelationFieldType(input) {
|
|
|
268
261
|
}
|
|
269
262
|
const shouldApplyDefaults = input.applyDefaults !== false;
|
|
270
263
|
const defaultTargetField = shouldApplyDefaults ? pickCollectionFallbackFieldName(targetCollection) : void 0;
|
|
271
|
-
const fields = explicitFields ?? (shouldApplyDefaults && usesNestedRelationFields(fieldUse) ? [defaultTargetField] : void 0);
|
|
272
|
-
const selectorFields =
|
|
264
|
+
const fields = explicitFields ?? (shouldApplyDefaults && (usesNestedRelationFields(fieldUse) || fieldType === "picker") ? [defaultTargetField] : void 0);
|
|
265
|
+
const selectorFields = ["picker", "popupSubTable"].includes(fieldType) ? fields : void 0;
|
|
273
266
|
const titleField = import_lodash.default.isUndefined(input.titleField) ? defaultTargetField : String(input.titleField || "").trim() || void 0;
|
|
274
267
|
if (fields == null ? void 0 : fields.length) {
|
|
275
268
|
assertTargetFieldNamesExist(targetCollection, fields, `${input.context}.fields`);
|
|
276
269
|
}
|
|
277
|
-
if (selectorFields == null ? void 0 : selectorFields.length) {
|
|
278
|
-
assertTargetFieldNamesExist(targetCollection, selectorFields, `${input.context}.selectorFields`);
|
|
279
|
-
}
|
|
280
270
|
if (titleField && !(0, import_service_helpers.resolveFieldFromCollection)(targetCollection, titleField)) {
|
|
281
271
|
(0, import_errors.throwBadRequest)(
|
|
282
272
|
`flowSurfaces ${input.context}.titleField '${titleField}' does not exist on relation target collection`
|
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
export declare const CALENDAR_POPUP_ACTION_KEYS: readonly ["quickCreateAction", "eventViewAction"];
|
|
11
|
+
export type CalendarPopupActionKey = (typeof CALENDAR_POPUP_ACTION_KEYS)[number];
|
|
12
|
+
export declare const CALENDAR_POPUP_PROP_KEYS: readonly ["quickCreatePopupSettings", "eventPopupSettings"];
|
|
13
|
+
export type HiddenPopupOpenViewNormalizer = (actionName: string, value: any, options: {
|
|
14
|
+
transaction?: any;
|
|
15
|
+
popupTemplateHostUid?: string;
|
|
16
|
+
popupActionContext?: {
|
|
17
|
+
hasCurrentRecord?: boolean;
|
|
18
|
+
};
|
|
19
|
+
}) => Promise<Record<string, any> | undefined> | Record<string, any> | undefined;
|
|
20
|
+
export type HiddenPopupTemplateOpenViewBuilder = (input: {
|
|
21
|
+
actionName: string;
|
|
22
|
+
actionUid: string;
|
|
23
|
+
openView: Record<string, any>;
|
|
24
|
+
popupSettings?: Record<string, any>;
|
|
25
|
+
existingHost?: any;
|
|
26
|
+
transaction?: any;
|
|
27
|
+
hasCurrentRecord?: boolean;
|
|
28
|
+
normalizePopupSettings: (popupSettings?: Record<string, any>) => Record<string, any>;
|
|
29
|
+
mergeDisplaySettings: (openView: Record<string, any>, popupSettings?: Record<string, any>, fallbackOpenView?: Record<string, any> | null) => Record<string, any>;
|
|
30
|
+
}) => Promise<Record<string, any>> | Record<string, any>;
|
|
31
|
+
export type HiddenPopupHostDefaultContentEnsurer = (input: {
|
|
32
|
+
actionName: string;
|
|
33
|
+
actionUid: string;
|
|
34
|
+
popupSettings?: Record<string, any>;
|
|
35
|
+
transaction?: any;
|
|
36
|
+
hasCurrentRecord?: boolean;
|
|
37
|
+
mergeDisplaySettings: (openView: Record<string, any>, popupSettings?: Record<string, any>, fallbackOpenView?: Record<string, any> | null) => Record<string, any>;
|
|
38
|
+
}) => Promise<boolean> | boolean;
|
|
39
|
+
export type HiddenPopupHostRuntime = {
|
|
40
|
+
repository: {
|
|
41
|
+
findModelById: (uid: string, options?: any) => Promise<any>;
|
|
42
|
+
patch: (payload: Record<string, any>, options?: any) => Promise<any>;
|
|
43
|
+
upsertModel: (payload: Record<string, any>, options?: any) => Promise<any>;
|
|
44
|
+
};
|
|
45
|
+
buildPopupOpenViewWithTemplate: HiddenPopupTemplateOpenViewBuilder;
|
|
46
|
+
clearFlowTemplateUsagesForNodeTree: (uid: string, transaction?: any) => Promise<any>;
|
|
47
|
+
ensurePopupHostDefaultContent: HiddenPopupHostDefaultContentEnsurer;
|
|
48
|
+
reconcilePopupOpenViewTransition: (uid: string, currentOpenView: Record<string, any> | null | undefined, nextOpenView: Record<string, any>, transaction?: any) => Promise<any>;
|
|
49
|
+
removeNodeTreeWithBindings: (uid: string, transaction?: any) => Promise<any>;
|
|
50
|
+
syncFlowTemplateUsagesForNodeTree: (uid: string, transaction?: any) => Promise<any>;
|
|
51
|
+
};
|
|
52
|
+
export declare function normalizeCalendarPopupSettings(actionKey: CalendarPopupActionKey, popupSettings?: Record<string, any>): Record<string, any>;
|
|
53
|
+
export declare function getCalendarPopupActionUse(actionKey: CalendarPopupActionKey): "CalendarQuickCreateActionModel" | "CalendarEventViewActionModel";
|
|
54
|
+
export declare function getCalendarPopupPropKey(actionKey: CalendarPopupActionKey): "quickCreatePopupSettings" | "eventPopupSettings";
|
|
55
|
+
export declare function getCalendarPopupActionUid(calendarUid: string, actionKey: CalendarPopupActionKey): string;
|
|
56
|
+
export declare function getCalendarBlockResourceInit(blockNode: any): any;
|
|
57
|
+
export declare function getCalendarPopupStoredSettings(blockNode: any, actionKey: CalendarPopupActionKey): Record<string, any>;
|
|
58
|
+
export declare function replaceCalendarStoredPopupSettings(runtime: Pick<HiddenPopupHostRuntime, 'repository'>, blockNode: any, actionKey: CalendarPopupActionKey, popupSettings: Record<string, any>, transaction?: any): Promise<void>;
|
|
59
|
+
export declare function buildCalendarInitialStepParams(input: {
|
|
60
|
+
stepParams?: Record<string, any>;
|
|
61
|
+
props?: Record<string, any>;
|
|
62
|
+
settings?: Record<string, any>;
|
|
63
|
+
}): Record<string, any>;
|
|
64
|
+
export declare function buildCalendarPopupOpenView(input: {
|
|
65
|
+
blockNode: any;
|
|
66
|
+
actionKey: CalendarPopupActionKey;
|
|
67
|
+
resourceInit?: Record<string, any>;
|
|
68
|
+
popupSettings?: Record<string, any>;
|
|
69
|
+
}): _.Dictionary<any>;
|
|
70
|
+
export declare function mergeCalendarPopupSettings(actionKey: CalendarPopupActionKey, current: any, value: any): Record<string, any>;
|
|
71
|
+
export declare function stripCalendarPopupTargetSettingsForResourceChange(actionKey: CalendarPopupActionKey, popupSettings?: Record<string, any>): Record<string, any>;
|
|
72
|
+
export declare function normalizeCalendarPopupConfigureValue(input: {
|
|
73
|
+
actionName: string;
|
|
74
|
+
blockUid: string;
|
|
75
|
+
actionKey: CalendarPopupActionKey;
|
|
76
|
+
value: any;
|
|
77
|
+
transaction?: any;
|
|
78
|
+
normalizeOpenView: HiddenPopupOpenViewNormalizer;
|
|
79
|
+
}): Promise<Record<string, any>>;
|
|
80
|
+
export declare function normalizeCalendarInlineSettingsForConfigure(settings?: Record<string, any>): Record<string, any>;
|
|
81
|
+
export declare function resolveCalendarInitialPopupOverride(settings: Record<string, any> | undefined, primaryKey: 'quickCreatePopup' | 'eventPopup', legacyKey: 'quickCreatePopupSettings' | 'eventPopupSettings'): any;
|
|
82
|
+
export declare function ensureCalendarBlockPopupHosts(runtime: HiddenPopupHostRuntime, blockNode: any, transaction?: any, popupSettingsOverrides?: Partial<Record<CalendarPopupActionKey, Record<string, any> | undefined>>, options?: {
|
|
83
|
+
displayFallbackOpenViews?: Partial<Record<CalendarPopupActionKey, Record<string, any> | undefined>>;
|
|
84
|
+
}): Promise<any>;
|
|
85
|
+
export declare function projectCalendarBlockPopupHosts<T = any>(node: T): T;
|
|
86
|
+
export declare function projectCalendarBlockPopupHostsInTree<T = any>(node: T): T;
|