@nocobase/plugin-flow-engine 2.1.0-beta.36 → 2.1.0-beta.38

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.
Files changed (32) hide show
  1. package/dist/externalVersion.js +9 -9
  2. package/dist/node_modules/@ant-design/icons-svg/package.json +1 -1
  3. package/dist/node_modules/acorn/package.json +1 -1
  4. package/dist/node_modules/acorn-jsx/package.json +1 -1
  5. package/dist/node_modules/acorn-walk/package.json +1 -1
  6. package/dist/node_modules/ses/package.json +1 -1
  7. package/dist/node_modules/zod/package.json +1 -1
  8. package/dist/server/flow-surfaces/apply/compiler.js +18 -3
  9. package/dist/server/flow-surfaces/apply/matching.js +2 -0
  10. package/dist/server/flow-surfaces/authoring-validation.js +621 -66
  11. package/dist/server/flow-surfaces/blueprint/compile-blocks.js +21 -3
  12. package/dist/server/flow-surfaces/blueprint/compile-plan.js +9 -9
  13. package/dist/server/flow-surfaces/catalog.js +17 -4
  14. package/dist/server/flow-surfaces/chart-config.js +14 -1
  15. package/dist/server/flow-surfaces/compose-compiler.d.ts +2 -0
  16. package/dist/server/flow-surfaces/compose-compiler.js +2 -0
  17. package/dist/server/flow-surfaces/compose-runtime.js +4 -7
  18. package/dist/server/flow-surfaces/configure-options.js +19 -8
  19. package/dist/server/flow-surfaces/locator.js +16 -2
  20. package/dist/server/flow-surfaces/runjs-authoring/ctx-libs-member-mismatch-stop/index.js +1 -1
  21. package/dist/server/flow-surfaces/runjs-authoring/index.js +6224 -2119
  22. package/dist/server/flow-surfaces/service-utils.d.ts +2 -0
  23. package/dist/server/flow-surfaces/service-utils.js +8 -0
  24. package/dist/server/flow-surfaces/service.d.ts +67 -14
  25. package/dist/server/flow-surfaces/service.js +1316 -122
  26. package/dist/server/flow-surfaces/template-service-utils.d.ts +1 -0
  27. package/dist/swagger/flow-surfaces.d.ts +5 -2
  28. package/dist/swagger/flow-surfaces.examples.d.ts +11 -37
  29. package/dist/swagger/flow-surfaces.examples.js +6 -6
  30. package/dist/swagger/flow-surfaces.js +6 -3
  31. package/dist/swagger/index.d.ts +5 -2
  32. package/package.json +2 -2
@@ -75,6 +75,8 @@ export type NormalizedComposeFieldSpec = {
75
75
  pageSize?: number;
76
76
  showIndex?: boolean;
77
77
  target?: string;
78
+ defaultTargetUid?: string;
79
+ targetBlockUid?: string;
78
80
  settings: Record<string, any>;
79
81
  popup?: Record<string, any>;
80
82
  __autoPopupForRelationField?: boolean;
@@ -410,6 +410,12 @@ function normalizeComposeFieldSpec(input, index) {
410
410
  if (!import_lodash.default.isUndefined(input.target) && typeof input.target !== "string") {
411
411
  (0, import_errors.throwBadRequest)(`flowSurfaces compose field #${index + 1} target must be a string block key`);
412
412
  }
413
+ if (!import_lodash.default.isUndefined(input.defaultTargetUid) && typeof input.defaultTargetUid !== "string") {
414
+ (0, import_errors.throwBadRequest)(`flowSurfaces compose field #${index + 1} defaultTargetUid must be a string`);
415
+ }
416
+ if (!import_lodash.default.isUndefined(input.targetBlockUid) && typeof input.targetBlockUid !== "string") {
417
+ (0, import_errors.throwBadRequest)(`flowSurfaces compose field #${index + 1} targetBlockUid must be a string`);
418
+ }
413
419
  const rawKey = String(input.key || semanticType || (renderer === "js" ? `js:${fieldPath}` : fieldPath)).trim();
414
420
  const key = normalizeFlowSurfaceComposeKey(rawKey, `flowSurfaces compose field #${index + 1}`);
415
421
  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;
@@ -428,6 +434,8 @@ function normalizeComposeFieldSpec(input, index) {
428
434
  ...!import_lodash.default.isUndefined(pageSize) && Number.isFinite(pageSize) ? { pageSize } : {},
429
435
  ...!import_lodash.default.isUndefined(showIndex) ? { showIndex } : {},
430
436
  target: typeof input.target === "string" ? String(input.target || "").trim() || void 0 : void 0,
437
+ defaultTargetUid: typeof input.defaultTargetUid === "string" ? String(input.defaultTargetUid || "").trim() || void 0 : void 0,
438
+ targetBlockUid: typeof input.targetBlockUid === "string" ? String(input.targetBlockUid || "").trim() || void 0 : void 0,
431
439
  settings: import_lodash.default.isPlainObject(input.settings) ? input.settings : {},
432
440
  popup: import_lodash.default.isPlainObject(input.popup) ? input.popup : void 0,
433
441
  __autoPopupForRelationField: input.__autoPopupForRelationField === true,
@@ -9,13 +9,19 @@
9
9
  import type { Plugin } from '@nocobase/server';
10
10
  import _ from 'lodash';
11
11
  import FlowModelRepository from '../repository';
12
+ import type { FlowSurfaceApplyBlueprintDocument } from './blueprint';
12
13
  import { SurfaceLocator } from './locator';
13
14
  import type { TemplateTranslate } from './template-display';
14
15
  import type { FlowSurfaceActionLinkageRule, FlowSurfaceBlockLinkageRule, FlowSurfaceFieldLinkageRule, FlowSurfaceFieldValueRule, FlowSurfaceGetReactionMetaResult, FlowSurfaceGetReactionMetaValues, FlowSurfaceReactionWriteResult, FlowSurfaceReactionWriteValues } from './reaction/types';
15
16
  import type { FlowSurfaceTemplateListPopupActionContext, FlowSurfaceTemplateListValues, FlowSurfaceTemplateRow } from './template-service-utils';
16
- import type { FlowSurfaceApplyValues, FlowSurfaceCatalogResponse, FlowSurfaceCatalogValues, FlowSurfaceComposeValues, FlowSurfaceConfigureValues, FlowSurfaceContextValues, FlowSurfaceDescribeValues, FlowSurfaceMutateValues } from './types';
17
+ import type { FlowSurfaceApplyValues, FlowSurfaceActionScope, FlowSurfaceCatalogResponse, FlowSurfaceCatalogValues, FlowSurfaceComposeValues, FlowSurfaceConfigureValues, FlowSurfaceContextValues, FlowSurfaceDescribeValues, FlowSurfaceMutateValues } from './types';
18
+ import type { FlowSurfaceContextResponse, FlowSurfaceContextVarInfo } from './types';
17
19
  type FlowSurfacePopupTemplateAliasSession = Map<string, string>;
18
20
  type FlowSurfaceRequestRoles = readonly string[] | string;
21
+ type FlowSurfaceReadOptions = {
22
+ transaction?: any;
23
+ currentRoles?: FlowSurfaceRequestRoles;
24
+ };
19
25
  type FlowSurfaceAddFieldResult = {
20
26
  uid?: string;
21
27
  parentUid?: string;
@@ -34,6 +40,12 @@ type FlowSurfaceAddFieldResult = {
34
40
  popupGridUid?: string;
35
41
  };
36
42
  type FlowSurfacePopupTemplateTreeCache = Map<string, Promise<any | null> | any | null>;
43
+ type FlowSurfaceApplyBlueprintResponse = {
44
+ version: '1';
45
+ mode: FlowSurfaceApplyBlueprintDocument['mode'];
46
+ target: Record<string, any>;
47
+ surface: any;
48
+ };
37
49
  export declare class FlowSurfacesService {
38
50
  private readonly plugin;
39
51
  constructor(plugin: Plugin);
@@ -61,12 +73,17 @@ export declare class FlowSurfacesService {
61
73
  private readRouteOptions;
62
74
  private findMenuRouteById;
63
75
  private findMenuGroupRoutesByTitle;
76
+ private routeParentIdMatches;
77
+ private findMenuGroupRoutesByParentIdAndTitle;
64
78
  private findFlowPageRoutesByParentIdAndTitle;
65
79
  private assertMenuParentIsGroup;
66
80
  private assertMenuRouteBindable;
67
81
  private assertMenuRouteUpdatable;
68
82
  private assertMenuParentNotSelfOrDescendant;
69
83
  private buildMenuResult;
84
+ private isValidMenuIconName;
85
+ private assertVisibleNavigationIcon;
86
+ private assertVisibleNavigationRouteIconUpdate;
70
87
  private createFlowMenuGroup;
71
88
  private createFlowMenuItem;
72
89
  private sanitizePublicCreateMenuValues;
@@ -129,7 +146,7 @@ export declare class FlowSurfacesService {
129
146
  private buildAssociatedRecordsResourceInit;
130
147
  context(values: FlowSurfaceContextValues, options?: {
131
148
  transaction?: any;
132
- }): Promise<import("./types").FlowSurfaceContextResponse>;
149
+ }): Promise<FlowSurfaceContextResponse>;
133
150
  private extractReactionCanonicalRules;
134
151
  private buildReactionFieldPathMaps;
135
152
  private extractReactionFieldPaths;
@@ -162,9 +179,7 @@ export declare class FlowSurfacesService {
162
179
  private stripInternalSurfaceMetaFromNodeTree;
163
180
  private buildSurfaceReadPayload;
164
181
  private buildSurfaceContextFingerprint;
165
- get(input: Record<string, any>, options?: {
166
- transaction?: any;
167
- }): Promise<Record<string, any>>;
182
+ get(input: Record<string, any>, options?: FlowSurfaceReadOptions): Promise<Record<string, any>>;
168
183
  private getDeclaredKeyPersistenceDeps;
169
184
  private patchDeclaredKeyModel;
170
185
  private persistCreatedKeysForAction;
@@ -177,6 +192,7 @@ export declare class FlowSurfacesService {
177
192
  private resolveApplyBlueprintCreateNavigationGroup;
178
193
  private resolveApplyBlueprintCreatePageIdentity;
179
194
  private prepareApplyBlueprintRequest;
195
+ private prevalidateApplyBlueprintChartAssets;
180
196
  private getApplyBlueprintKanbanBlockResourceObject;
181
197
  private normalizeApplyBlueprintKanbanResourceText;
182
198
  private getApplyBlueprintKanbanBlockBinding;
@@ -201,13 +217,11 @@ export declare class FlowSurfacesService {
201
217
  applyBlueprint(values: Record<string, any>, options?: {
202
218
  transaction?: any;
203
219
  currentRoles?: FlowSurfaceRequestRoles;
204
- }): Promise<{
205
- version: string;
206
- mode: import("./blueprint").FlowSurfaceApplyBlueprintMode;
207
- target: _.Dictionary<any>;
208
- surface: Record<string, any>;
209
- }>;
220
+ }): Promise<FlowSurfaceApplyBlueprintResponse>;
221
+ private applyBlueprintMutationWithoutExternalTransaction;
222
+ private assertApplyBlueprintAuthoringPayload;
210
223
  private applyBlueprintWithTransaction;
224
+ private buildApplyBlueprintResponse;
211
225
  private findApprovalSurfaceRootForNode;
212
226
  private syncApprovalRuntimeConfigForSurfaceRoot;
213
227
  private syncApprovalRuntimeConfigForNode;
@@ -456,7 +470,7 @@ export declare class FlowSurfacesService {
456
470
  uid: any;
457
471
  parentUid: any;
458
472
  subKey: string;
459
- scope: import("./types").FlowSurfaceActionScope;
473
+ scope: FlowSurfaceActionScope;
460
474
  }>;
461
475
  addRecordAction(values: Record<string, any>, options?: {
462
476
  transaction?: any;
@@ -469,7 +483,7 @@ export declare class FlowSurfacesService {
469
483
  uid: any;
470
484
  parentUid: any;
471
485
  subKey: string;
472
- scope: import("./types").FlowSurfaceActionScope;
486
+ scope: FlowSurfaceActionScope;
473
487
  }>;
474
488
  addBlocks(values: Record<string, any>): Promise<{
475
489
  [x: string]: number | Record<string, any>[];
@@ -559,6 +573,7 @@ export declare class FlowSurfacesService {
559
573
  private resolveDefaultActionPopupTemplateOpenViewTitle;
560
574
  private buildInlinePopupTemplateOpenView;
561
575
  private peekInlineFieldSettingsOpenView;
576
+ private isInlineFieldClickToOpenEnabled;
562
577
  private assertOpenViewUidTarget;
563
578
  private normalizeFlowTemplateMode;
564
579
  private normalizeFlowTemplateUsage;
@@ -593,6 +608,11 @@ export declare class FlowSurfacesService {
593
608
  private tryResolvePopupTemplateForHost;
594
609
  private tryResolveExistingDefaultActionPopupTemplate;
595
610
  private getFlowTemplateOrThrow;
611
+ private shouldUseRuntimeRecordFilterByTkForOpenView;
612
+ private resolveOpenViewFilterTargetKey;
613
+ private resolvePopupHostCurrentRecordFilterTargetKey;
614
+ private resolveOpenViewRuntimeRecordFilterTargetKey;
615
+ private shouldOmitRuntimeRecordFilterByTk;
596
616
  private buildPopupTemplateOpenView;
597
617
  private isReferencedPopupTemplateOpenView;
598
618
  private isPopupTemplateReferenceOpenViewState;
@@ -622,6 +642,7 @@ export declare class FlowSurfacesService {
622
642
  private getActionButtonTitle;
623
643
  private isSemanticallyEmptyInlinePopup;
624
644
  private isEmptyInlinePopupPayload;
645
+ private isInlineFieldPopupDefaultShell;
625
646
  private shouldAutoCompleteDefaultFieldPopup;
626
647
  private isInlineFieldPopupBlockMissingResource;
627
648
  private buildRelationFieldPopupCurrentRecordResource;
@@ -727,6 +748,7 @@ export declare class FlowSurfacesService {
727
748
  private normalizeChartSelectionFieldPath;
728
749
  private validateBuilderChartFieldsForRuntime;
729
750
  private resolveBuilderChartAssociationSubfieldSuggestion;
751
+ private validateChartConfigureForRuntime;
730
752
  private stripChartSqlForInspection;
731
753
  private normalizeReadOnlyChartSql;
732
754
  private buildChartSqlPreviewQuery;
@@ -773,7 +795,7 @@ export declare class FlowSurfacesService {
773
795
  additionalProperties: boolean;
774
796
  };
775
797
  }[];
776
- vars: Record<string, import("./types").FlowSurfaceContextVarInfo>;
798
+ vars: Record<string, FlowSurfaceContextVarInfo>;
777
799
  fingerprint: string;
778
800
  writeCapabilities: {
779
801
  defaultAddPhase: string;
@@ -942,6 +964,10 @@ export declare class FlowSurfacesService {
942
964
  private buildAutoComposeFieldsLayout;
943
965
  private normalizeComposeFieldGroups;
944
966
  private applyDefaultActionsForCreatedBlock;
967
+ private hasActionWithPublicType;
968
+ private ensureTableDefaultActionIntegrity;
969
+ private collectNodeTreeDescendants;
970
+ private ensureSurfaceTableDefaultActionIntegrity;
945
971
  private resolveReusableSingletonAction;
946
972
  private normalizeComposeBlock;
947
973
  private normalizeComposeBlocks;
@@ -1002,10 +1028,20 @@ export declare class FlowSurfacesService {
1002
1028
  private normalizeActionAssignValues;
1003
1029
  private normalizeActionTriggerWorkflows;
1004
1030
  private isAIEmployeeActionUse;
1031
+ private stableSerializeAIEmployeeValue;
1032
+ private buildAIEmployeeActionDedupIdentity;
1033
+ private normalizeAIEmployeeWorkContextForDedupIdentity;
1034
+ private normalizeAIEmployeeTasksForDedupIdentity;
1035
+ private assertNoDuplicateAIEmployeeAction;
1005
1036
  private hasAIEmployeePublicSettings;
1006
1037
  private assertOnlyAIEmployeePublicSettings;
1038
+ private aiEmployeeNestedRepairHint;
1007
1039
  private assertOnlyAIEmployeeNestedPublicSettings;
1008
1040
  private assertNoAIEmployeeInternalPropSettings;
1041
+ private readAIEmployeePersistedTasks;
1042
+ private buildAIEmployeeTaskStepParams;
1043
+ private mergeAIEmployeeActionSettingsPayload;
1044
+ private syncAIEmployeeTaskStepParamsForUpdateSettings;
1009
1045
  private assertAIEmployeePluginEnabled;
1010
1046
  private readRecordPlainObject;
1011
1047
  private readRecordField;
@@ -1017,6 +1053,23 @@ export declare class FlowSurfacesService {
1017
1053
  private normalizeAIEmployeeWorkContext;
1018
1054
  private normalizeAIEmployeeTaskModel;
1019
1055
  private normalizeAIEmployeeSkillSettings;
1056
+ private collectAIEmployeePromptVariables;
1057
+ private hasAIEmployeePromptVariables;
1058
+ private collectAIEmployeeContextPathEntries;
1059
+ private isAIEmployeeContextInfoPathAllowed;
1060
+ private canResolveAIEmployeeContextPath;
1061
+ private isAIEmployeeContextPathAllowed;
1062
+ private extractAIEmployeePromptContextPath;
1063
+ private buildAIEmployeePromptVariableHint;
1064
+ private throwAIEmployeePromptVariableInvalid;
1065
+ private assertAIEmployeePromptVariablesAllowed;
1066
+ private assertAIEmployeeTaskPromptVariablesAllowed;
1067
+ private appendAIEmployeeCurrentRecordPromptVariable;
1068
+ private resolveAIEmployeePromptActionTargetUid;
1069
+ private buildAIEmployeePromptValidationContext;
1070
+ private appendAIEmployeeCurrentRecordPromptVariableToTasks;
1071
+ private assertAIEmployeeStepParamTaskPromptVariablesAllowedForUpdateSettings;
1072
+ private normalizeAIEmployeeStepParamTasksForUpdateSettings;
1020
1073
  private normalizeAIEmployeeTaskMessage;
1021
1074
  private normalizeAIEmployeeTaskPatch;
1022
1075
  private normalizeAIEmployeeTasks;