@nocobase/plugin-flow-engine 2.1.0-beta.24 → 2.1.0-beta.26
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 +134 -14
- 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 -0
- 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 +58 -3
- package/dist/server/flow-surfaces/configure-options.js +4 -0
- package/dist/server/flow-surfaces/default-block-actions.js +11 -10
- 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 +12 -0
- package/dist/server/flow-surfaces/public-compatibility.js +24 -2
- package/dist/server/flow-surfaces/service.d.ts +54 -10
- package/dist/server/flow-surfaces/service.js +1355 -765
- package/dist/swagger/flow-surfaces.js +6 -6
- package/package.json +2 -2
|
@@ -36,6 +36,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
36
36
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
37
|
var public_compatibility_exports = {};
|
|
38
38
|
__export(public_compatibility_exports, {
|
|
39
|
+
FLOW_SURFACE_DEFAULT_SORTING: () => FLOW_SURFACE_DEFAULT_SORTING,
|
|
40
|
+
normalizeFlowSurfaceDefaultSorting: () => normalizeFlowSurfaceDefaultSorting,
|
|
41
|
+
normalizeFlowSurfaceEmptySortingAsDefault: () => normalizeFlowSurfaceEmptySortingAsDefault,
|
|
39
42
|
normalizeFlowSurfacePublicSortingAlias: () => normalizeFlowSurfacePublicSortingAlias
|
|
40
43
|
});
|
|
41
44
|
module.exports = __toCommonJS(public_compatibility_exports);
|
|
@@ -43,6 +46,7 @@ var import_lodash = __toESM(require("lodash"));
|
|
|
43
46
|
var import_configure_options = require("./configure-options");
|
|
44
47
|
var import_errors = require("./errors");
|
|
45
48
|
var import_support_matrix = require("./support-matrix");
|
|
49
|
+
const FLOW_SURFACE_DEFAULT_SORTING = [{ field: "createdAt", direction: "desc" }];
|
|
46
50
|
function resolveBlockUse(input) {
|
|
47
51
|
var _a;
|
|
48
52
|
const explicitUse = String(input.use || "").trim();
|
|
@@ -105,6 +109,21 @@ function normalizeSortingArray(input, context) {
|
|
|
105
109
|
}
|
|
106
110
|
return input.map((item, index) => normalizeSortingEntry(item, `${context}[${index}]`));
|
|
107
111
|
}
|
|
112
|
+
function normalizeFlowSurfaceDefaultSorting(input, context) {
|
|
113
|
+
if (Array.isArray(input)) {
|
|
114
|
+
return normalizeSortingArray(input, context);
|
|
115
|
+
}
|
|
116
|
+
if (import_lodash.default.isUndefined(input) || import_lodash.default.isNull(input)) {
|
|
117
|
+
return import_lodash.default.cloneDeep(FLOW_SURFACE_DEFAULT_SORTING);
|
|
118
|
+
}
|
|
119
|
+
(0, import_errors.throwBadRequest)(`${context} must be an array`);
|
|
120
|
+
}
|
|
121
|
+
function normalizeFlowSurfaceEmptySortingAsDefault(input, context) {
|
|
122
|
+
if (Array.isArray(input) && !input.length) {
|
|
123
|
+
return import_lodash.default.cloneDeep(FLOW_SURFACE_DEFAULT_SORTING);
|
|
124
|
+
}
|
|
125
|
+
return normalizeFlowSurfaceDefaultSorting(input, context);
|
|
126
|
+
}
|
|
108
127
|
function normalizeFlowSurfacePublicSortingAlias(input) {
|
|
109
128
|
if (import_lodash.default.isUndefined(input.settings)) {
|
|
110
129
|
return input.settings;
|
|
@@ -120,9 +139,9 @@ function normalizeFlowSurfacePublicSortingAlias(input) {
|
|
|
120
139
|
return input.settings;
|
|
121
140
|
}
|
|
122
141
|
const nextSettings = import_lodash.default.cloneDeep(input.settings);
|
|
123
|
-
const sortingFromSort =
|
|
142
|
+
const sortingFromSort = normalizeFlowSurfaceDefaultSorting(nextSettings.sort, `${input.context}.sort`);
|
|
124
143
|
if (Object.prototype.hasOwnProperty.call(nextSettings, "sorting")) {
|
|
125
|
-
const canonicalSorting =
|
|
144
|
+
const canonicalSorting = normalizeFlowSurfaceDefaultSorting(nextSettings.sorting, `${input.context}.sorting`);
|
|
126
145
|
if (!import_lodash.default.isEqual(sortingFromSort, canonicalSorting)) {
|
|
127
146
|
(0, import_errors.throwBadRequest)(`${input.context}.sort conflicts with ${input.context}.sorting; use canonical sorting`);
|
|
128
147
|
}
|
|
@@ -135,5 +154,8 @@ function normalizeFlowSurfacePublicSortingAlias(input) {
|
|
|
135
154
|
}
|
|
136
155
|
// Annotate the CommonJS export names for ESM import in node:
|
|
137
156
|
0 && (module.exports = {
|
|
157
|
+
FLOW_SURFACE_DEFAULT_SORTING,
|
|
158
|
+
normalizeFlowSurfaceDefaultSorting,
|
|
159
|
+
normalizeFlowSurfaceEmptySortingAsDefault,
|
|
138
160
|
normalizeFlowSurfacePublicSortingAlias
|
|
139
161
|
});
|
|
@@ -10,9 +10,9 @@ import type { Plugin } from '@nocobase/server';
|
|
|
10
10
|
import _ from 'lodash';
|
|
11
11
|
import FlowModelRepository from '../repository';
|
|
12
12
|
import { SurfaceLocator } from './locator';
|
|
13
|
-
import {
|
|
13
|
+
import type { TemplateTranslate } from './template-display';
|
|
14
14
|
import type { FlowSurfaceActionLinkageRule, FlowSurfaceBlockLinkageRule, FlowSurfaceFieldLinkageRule, FlowSurfaceFieldValueRule, FlowSurfaceGetReactionMetaResult, FlowSurfaceGetReactionMetaValues, FlowSurfaceReactionWriteResult, FlowSurfaceReactionWriteValues } from './reaction/types';
|
|
15
|
-
import {
|
|
15
|
+
import type { FlowSurfaceTemplateListPopupActionContext, FlowSurfaceTemplateListValues, FlowSurfaceTemplateRow } from './template-service-utils';
|
|
16
16
|
import type { FlowSurfaceApplyValues, FlowSurfaceCatalogResponse, FlowSurfaceCatalogValues, FlowSurfaceComposeValues, FlowSurfaceConfigureValues, FlowSurfaceContextValues, FlowSurfaceDescribeValues, FlowSurfaceMutateValues } from './types';
|
|
17
17
|
type FlowSurfacePopupTemplateAliasSession = Map<string, string>;
|
|
18
18
|
type FlowSurfaceAddFieldResult = {
|
|
@@ -48,6 +48,7 @@ export declare class FlowSurfacesService {
|
|
|
48
48
|
private get surfaceContext();
|
|
49
49
|
private get approvalRuntimeConfigService();
|
|
50
50
|
private get approvalBlueprintService();
|
|
51
|
+
private get hiddenPopupRuntime();
|
|
51
52
|
private setFlowModelNodeAsyncFlag;
|
|
52
53
|
private loadEnabledPluginPackages;
|
|
53
54
|
private resolveEnabledPluginPackages;
|
|
@@ -98,6 +99,7 @@ export declare class FlowSurfacesService {
|
|
|
98
99
|
private buildPopupBlockResourceBindings;
|
|
99
100
|
private listPopupAssociatedRecordFields;
|
|
100
101
|
private resolvePopupBlockProfile;
|
|
102
|
+
private resolvePopupCurrentRecordResourceFilterByTk;
|
|
101
103
|
private resolvePopupAssociationFields;
|
|
102
104
|
private findPopupHostNode;
|
|
103
105
|
private getBlockKeyByUse;
|
|
@@ -229,6 +231,9 @@ export declare class FlowSurfacesService {
|
|
|
229
231
|
private inferSaveTemplateTarget;
|
|
230
232
|
private createFlowTemplateReferenceBlockModel;
|
|
231
233
|
private buildPopupTemplateReferenceOpenView;
|
|
234
|
+
private shouldHydrateDetachedPopupTemplateBlockResourceContext;
|
|
235
|
+
private collectDetachedPopupTemplateBlockResourceContextPatches;
|
|
236
|
+
private hydrateDetachedPopupTemplateBlockResourceContext;
|
|
232
237
|
private hydrateDetachedPopupTemplateSourceContext;
|
|
233
238
|
private clearFlowTemplateUsagesByModelUids;
|
|
234
239
|
private clearFlowTemplateUsagesForNodeTree;
|
|
@@ -436,6 +441,9 @@ export declare class FlowSurfacesService {
|
|
|
436
441
|
private validateComposePopupTemplateAliases;
|
|
437
442
|
private validateApplyBlueprintPopupTemplateAliases;
|
|
438
443
|
private normalizeInlineSettings;
|
|
444
|
+
private shouldEnableCreatedAtDefaultSorting;
|
|
445
|
+
private normalizeBlockSortingInput;
|
|
446
|
+
private normalizeMapSortingInput;
|
|
439
447
|
private normalizeInlinePopup;
|
|
440
448
|
private normalizePopupSaveAsTemplate;
|
|
441
449
|
private hasInlinePopupSaveAsTemplateSource;
|
|
@@ -447,6 +455,9 @@ export declare class FlowSurfacesService {
|
|
|
447
455
|
private resolveFieldBindingContext;
|
|
448
456
|
private resolveAutoGeneratedFieldPopupTemplateMetadata;
|
|
449
457
|
private shouldAutoSaveDefaultActionPopupTemplate;
|
|
458
|
+
private resolveDefaultActionPopupSemanticUse;
|
|
459
|
+
private getDefaultActionPopupConfigForNode;
|
|
460
|
+
private isDefaultActionPopupUseForNode;
|
|
450
461
|
private shouldImplicitlyTemplateDefaultActionPopup;
|
|
451
462
|
private buildImplicitTemplateDefaultActionPopup;
|
|
452
463
|
private resolveAutoGeneratedActionPopupTemplateMetadata;
|
|
@@ -464,6 +475,7 @@ export declare class FlowSurfacesService {
|
|
|
464
475
|
private getDefaultFlowTemplateSort;
|
|
465
476
|
private getPopupTryTemplateExpectedAssociationName;
|
|
466
477
|
private getPopupTryTemplatePriority;
|
|
478
|
+
private shouldRequireExactPopupTryTemplateAssociation;
|
|
467
479
|
private getRequestedPopupDefaultType;
|
|
468
480
|
private getPopupTryTemplateAllowedDefaultTypes;
|
|
469
481
|
private inferPopupDefaultTypeFromTemplateTree;
|
|
@@ -472,6 +484,7 @@ export declare class FlowSurfacesService {
|
|
|
472
484
|
private getFlowTemplateOrThrow;
|
|
473
485
|
private buildPopupTemplateOpenView;
|
|
474
486
|
private isReferencedPopupTemplateOpenView;
|
|
487
|
+
private isPopupTemplateReferenceOpenViewState;
|
|
475
488
|
private isEditableDefaultActionPopupTemplateReference;
|
|
476
489
|
private resolveExternalPopupHostUid;
|
|
477
490
|
private resolveDetachedPopupCopyUid;
|
|
@@ -533,9 +546,11 @@ export declare class FlowSurfacesService {
|
|
|
533
546
|
updateSettings(values: Record<string, any>, options?: {
|
|
534
547
|
transaction?: any;
|
|
535
548
|
replaceChartCardSettings?: boolean;
|
|
549
|
+
replacePopupStepParamSubtrees?: boolean;
|
|
536
550
|
openViewActionName?: string;
|
|
537
551
|
popupTemplateHostUid?: string;
|
|
538
552
|
popupActionContext?: FlowSurfaceTemplateListPopupActionContext;
|
|
553
|
+
skipHiddenPopupHostEnsure?: boolean;
|
|
539
554
|
}): Promise<{
|
|
540
555
|
uid: any;
|
|
541
556
|
updated?: undefined;
|
|
@@ -543,6 +558,12 @@ export declare class FlowSurfacesService {
|
|
|
543
558
|
uid: any;
|
|
544
559
|
updated: string[];
|
|
545
560
|
}>;
|
|
561
|
+
private syncCalendarPopupPropsForUpdateSettings;
|
|
562
|
+
private replaceExplicitPopupStepParamSubtreesForUpdateSettings;
|
|
563
|
+
private normalizePopupStepParamReplacementForUpdateSettings;
|
|
564
|
+
private stripPopupPropsFromPayload;
|
|
565
|
+
private syncDefaultSortingForUpdateSettings;
|
|
566
|
+
private syncKanbanPopupPropsForUpdateSettings;
|
|
546
567
|
private syncFilterActionSettingsForUpdateSettings;
|
|
547
568
|
private syncMirroredStepParamsForUpdateSettings;
|
|
548
569
|
private syncUpdateActionAssignedValuesForUpdateSettings;
|
|
@@ -640,10 +661,15 @@ export declare class FlowSurfacesService {
|
|
|
640
661
|
private resolveComposeBlockActionCatalogItem;
|
|
641
662
|
private resolveComposeRecordActionCatalogItem;
|
|
642
663
|
private isAddChildCatalogItem;
|
|
664
|
+
private resolveTreeChildrenField;
|
|
665
|
+
private resolveTreeChildrenAssociationName;
|
|
643
666
|
private isTreeCollection;
|
|
644
667
|
private isTreeTableEnabled;
|
|
645
668
|
private resolveAddChildOwnerNode;
|
|
669
|
+
private resolveAddChildOwnerResourceContext;
|
|
646
670
|
private resolveOwnerCollectionForAddChild;
|
|
671
|
+
private resolveAddChildResourceInitForOwnerNode;
|
|
672
|
+
private normalizeAddChildOpenViewForAction;
|
|
647
673
|
private canUseAddChildOnOwnerNode;
|
|
648
674
|
private assertAddChildSupportedForOwnerNode;
|
|
649
675
|
private filterTargetRecordActions;
|
|
@@ -745,6 +771,12 @@ export declare class FlowSurfacesService {
|
|
|
745
771
|
private resolveContextOwnerCollection;
|
|
746
772
|
private resolveItemContextCollection;
|
|
747
773
|
private resolvePopupHostOpenView;
|
|
774
|
+
private popupHostHasLocalContent;
|
|
775
|
+
private shouldAutoBindPopupTemplate;
|
|
776
|
+
private patchPopupOpenViewIfChanged;
|
|
777
|
+
private buildPopupOpenViewWithTemplate;
|
|
778
|
+
private completePopupHostDefaultContent;
|
|
779
|
+
private ensurePopupHostDefaultContent;
|
|
748
780
|
private resolvePopupSourceRecordCollectionName;
|
|
749
781
|
private resolvePopupContextLevel;
|
|
750
782
|
private getCollection;
|
|
@@ -769,10 +801,14 @@ export declare class FlowSurfacesService {
|
|
|
769
801
|
private buildKanbanInlineGroupOptions;
|
|
770
802
|
private mergeKanbanInlineGroupOptions;
|
|
771
803
|
private normalizeKanbanPopupSettings;
|
|
772
|
-
private getKanbanPopupActionUse;
|
|
773
804
|
private getKanbanPopupActionUid;
|
|
774
805
|
private getKanbanBlockResourceInit;
|
|
806
|
+
private buildKanbanInitialStepParams;
|
|
807
|
+
private buildKanbanInitialItemProps;
|
|
808
|
+
private buildKanbanInitialItemStepParams;
|
|
775
809
|
private getKanbanPopupStoredSettings;
|
|
810
|
+
private mergeKanbanPopupSettings;
|
|
811
|
+
private stripKanbanPopupTargetSettingsForResourceChange;
|
|
776
812
|
private buildKanbanPopupOpenView;
|
|
777
813
|
private normalizeKanbanPopupConfigureValue;
|
|
778
814
|
private buildKanbanInitialBlockProps;
|
|
@@ -793,21 +829,27 @@ export declare class FlowSurfacesService {
|
|
|
793
829
|
private assertCalendarFieldBinding;
|
|
794
830
|
private normalizeCalendarFieldNamesForCollection;
|
|
795
831
|
private normalizeCalendarPopupSettings;
|
|
796
|
-
private getCalendarPopupActionUse;
|
|
797
|
-
private getCalendarPopupPropKey;
|
|
798
|
-
private getCalendarPopupActionUid;
|
|
799
832
|
private getCalendarBlockResourceInit;
|
|
833
|
+
private getCalendarPopupStoredSettings;
|
|
834
|
+
private getCalendarPopupPropKey;
|
|
835
|
+
private buildCalendarInitialStepParams;
|
|
800
836
|
private buildCalendarPopupOpenView;
|
|
837
|
+
private mergeCalendarPopupSettings;
|
|
838
|
+
private stripCalendarPopupTargetSettingsForResourceChange;
|
|
801
839
|
private normalizeCalendarPopupConfigureValue;
|
|
840
|
+
private normalizeCalendarInlineSettingsForConfigure;
|
|
841
|
+
private omitHiddenPopupSettingsForConfigure;
|
|
842
|
+
private resolveCalendarInitialPopupOverride;
|
|
843
|
+
private resolveKanbanInitialPopupOverride;
|
|
802
844
|
private buildCalendarInitialBlockProps;
|
|
803
845
|
private ensureCalendarBlockPopupHosts;
|
|
804
|
-
private ensureCalendarBlockPopupHostsInTree;
|
|
805
|
-
private projectCalendarBlockPopupHosts;
|
|
806
846
|
private projectCalendarBlockPopupHostsInTree;
|
|
847
|
+
private replaceKanbanStoredPopupSettings;
|
|
807
848
|
private ensureKanbanBlockPopupHosts;
|
|
808
|
-
private ensureKanbanBlockPopupHostsInTree;
|
|
809
|
-
private projectKanbanBlockPopupHosts;
|
|
810
849
|
private projectKanbanBlockPopupHostsInTree;
|
|
850
|
+
private resolveManagedPopupTargetUidForHiddenPopupBackfill;
|
|
851
|
+
private ensureHiddenPopupBlockHostsInManagedPopupTarget;
|
|
852
|
+
private ensureHiddenPopupBlockHostsInTree;
|
|
811
853
|
private getCalendarSettingValue;
|
|
812
854
|
private validateCalendarSettingValues;
|
|
813
855
|
private validateCalendarBlockState;
|
|
@@ -826,6 +868,8 @@ export declare class FlowSurfacesService {
|
|
|
826
868
|
private ensureFlowRoutePageSchemaShell;
|
|
827
869
|
private removeFlowRoutePageSchemaShell;
|
|
828
870
|
private normalizeDisplayFieldBinding;
|
|
871
|
+
private collectionFieldHasRequiredValidation;
|
|
872
|
+
private buildRequiredCollectionFieldFormWrapperDefaults;
|
|
829
873
|
private getCollectionFieldOrBadRequest;
|
|
830
874
|
private buildRelationTargetFieldInit;
|
|
831
875
|
private buildRelationTargetTableColumnNode;
|