@nocobase/plugin-flow-engine 2.2.0-alpha.1 → 2.2.0-alpha.10

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 (86) hide show
  1. package/dist/ai/ai-employees/nathan/prompt.md +2 -0
  2. package/dist/ai/ai-employees/nathan/skills/frontend-developer/SKILLS.md +1 -0
  3. package/dist/ai/ai-employees/nathan/skills/frontend-developer/tools/getContextApis.js +2 -2
  4. package/dist/ai/ai-employees/nathan/skills/frontend-developer/tools/getContextEnvs.js +2 -2
  5. package/dist/ai/ai-employees/nathan/skills/frontend-developer/tools/getContextVars.js +2 -2
  6. package/dist/ai/ai-employees/nathan/skills/frontend-developer/tools/lintAndTestJS.js +2 -2
  7. package/dist/ai/ai-employees/nathan/skills/frontend-developer/tools/patchJSCode.js +4 -4
  8. package/dist/ai/ai-employees/nathan/skills/frontend-developer/tools/readJSCode.js +2 -2
  9. package/dist/ai/ai-employees/nathan/skills/frontend-developer/tools/writeJSCode.js +2 -2
  10. package/dist/ai/docs/runjs/context/ai.md +206 -0
  11. package/dist/client/index.js +1 -1
  12. package/dist/externalVersion.js +9 -9
  13. package/dist/locale/en-US.json +3 -0
  14. package/dist/locale/index.d.ts +6 -0
  15. package/dist/locale/zh-CN.json +3 -0
  16. package/dist/node_modules/@ant-design/icons-svg/package.json +1 -1
  17. package/dist/node_modules/acorn/package.json +1 -1
  18. package/dist/node_modules/acorn-jsx/package.json +1 -1
  19. package/dist/node_modules/acorn-walk/package.json +1 -1
  20. package/dist/node_modules/ses/package.json +1 -1
  21. package/dist/node_modules/zod/package.json +1 -1
  22. package/dist/server/flow-surfaces/{runjs-authoring/blocked-global-stop/index.d.ts → approval/authoring-validation.d.ts} +1 -2
  23. package/dist/server/flow-surfaces/approval/authoring-validation.js +1151 -0
  24. package/dist/server/flow-surfaces/approval/blueprint-service.js +2 -0
  25. package/dist/server/flow-surfaces/authoring-validation.d.ts +3 -1
  26. package/dist/server/flow-surfaces/authoring-validation.js +645 -59
  27. package/dist/server/flow-surfaces/blueprint/compile-blocks.js +7 -3
  28. package/dist/server/flow-surfaces/blueprint/compile-plan.js +23 -15
  29. package/dist/server/flow-surfaces/blueprint/export-document.d.ts +50 -0
  30. package/dist/server/flow-surfaces/blueprint/export-document.js +2510 -0
  31. package/dist/server/flow-surfaces/blueprint/normalize-document.js +18 -1
  32. package/dist/server/flow-surfaces/blueprint/public-types.d.ts +2 -0
  33. package/dist/server/flow-surfaces/builder.js +43 -5
  34. package/dist/server/flow-surfaces/catalog.js +13 -2
  35. package/dist/server/flow-surfaces/configure-options.js +5 -3
  36. package/dist/server/flow-surfaces/constants.d.ts +16 -2
  37. package/dist/server/flow-surfaces/constants.js +2 -0
  38. package/dist/server/flow-surfaces/contract-guard.js +37 -5
  39. package/dist/server/flow-surfaces/default-action-popup.d.ts +2 -0
  40. package/dist/server/flow-surfaces/default-action-popup.js +27 -13
  41. package/dist/server/flow-surfaces/errors.d.ts +2 -2
  42. package/dist/server/flow-surfaces/errors.js +4 -4
  43. package/dist/server/flow-surfaces/filter-group.d.ts +19 -2
  44. package/dist/server/flow-surfaces/filter-group.js +232 -3
  45. package/dist/server/flow-surfaces/navigation-targets.d.ts +73 -0
  46. package/dist/server/flow-surfaces/navigation-targets.js +439 -0
  47. package/dist/server/flow-surfaces/planning/compiler.d.ts +1 -0
  48. package/dist/server/flow-surfaces/planning/compiler.js +205 -82
  49. package/dist/server/flow-surfaces/planning/key-registry.d.ts +1 -1
  50. package/dist/server/flow-surfaces/planning/runtime.js +1 -0
  51. package/dist/server/flow-surfaces/planning/step-link.d.ts +1 -1
  52. package/dist/server/flow-surfaces/planning/step-link.js +22 -3
  53. package/dist/server/flow-surfaces/public-data-surface-default-filter.js +0 -9
  54. package/dist/server/flow-surfaces/reaction/field-value.d.ts +9 -0
  55. package/dist/server/flow-surfaces/reaction/field-value.js +51 -2
  56. package/dist/server/flow-surfaces/reaction/linkage.d.ts +6 -1
  57. package/dist/server/flow-surfaces/reaction/linkage.js +18 -3
  58. package/dist/server/flow-surfaces/reaction/meta.js +19 -1
  59. package/dist/server/flow-surfaces/reaction/types.d.ts +19 -0
  60. package/dist/server/flow-surfaces/relation-backing-foreign-key.d.ts +10 -0
  61. package/dist/server/flow-surfaces/relation-backing-foreign-key.js +79 -0
  62. package/dist/server/flow-surfaces/runjs-authoring/ast/source.d.ts +1 -0
  63. package/dist/server/flow-surfaces/runjs-authoring/ast/source.js +20 -0
  64. package/dist/server/flow-surfaces/runjs-authoring/rules.js +0 -2
  65. package/dist/server/flow-surfaces/runjs-authoring/runtime/constants.d.ts +0 -1
  66. package/dist/server/flow-surfaces/runjs-authoring/runtime/constants.js +12 -19
  67. package/dist/server/flow-surfaces/runjs-authoring/runtime/types.d.ts +0 -12
  68. package/dist/server/flow-surfaces/runjs-authoring/scan/filter.js +12 -2
  69. package/dist/server/flow-surfaces/runjs-authoring/scan/index.d.ts +0 -14
  70. package/dist/server/flow-surfaces/runjs-authoring/scan/index.js +10 -8
  71. package/dist/server/flow-surfaces/runjs-authoring/scan/source-patterns.d.ts +0 -14
  72. package/dist/server/flow-surfaces/runjs-authoring/scan/source-patterns.js +18 -73
  73. package/dist/server/flow-surfaces/runjs-authoring/types.d.ts +1 -1
  74. package/dist/server/flow-surfaces/runjs-authoring/validators/index.js +9 -53
  75. package/dist/server/flow-surfaces/service.d.ts +65 -0
  76. package/dist/server/flow-surfaces/service.js +1372 -148
  77. package/dist/server/flow-surfaces/types.d.ts +2 -1
  78. package/dist/server/variables/records.js +7 -2
  79. package/dist/server/variables/registry.js +3 -0
  80. package/dist/swagger/flow-surfaces.d.ts +289 -0
  81. package/dist/swagger/flow-surfaces.examples.d.ts +11 -0
  82. package/dist/swagger/flow-surfaces.examples.js +11 -0
  83. package/dist/swagger/flow-surfaces.js +261 -11
  84. package/dist/swagger/index.d.ts +289 -0
  85. package/package.json +2 -2
  86. package/dist/server/flow-surfaces/runjs-authoring/blocked-global-stop/index.js +0 -40
@@ -310,58 +310,7 @@ function collectDirectDomErrors(path, source, scan, modelUse, surface, errors) {
310
310
  );
311
311
  });
312
312
  }
313
- function collectGlobalErrors(path, source, scan, modelUse, surface, errors) {
314
- scan.windowDocumentNavigatorAliases.forEach((entry) => {
315
- errors.push(
316
- (0, import_errors.buildRunJsAuthoringError)({
317
- path,
318
- repairClass: "blocked-global-stop",
319
- message: `flowSurfaces authoring ${path} cannot alias forbidden global ${entry.root}`,
320
- modelUse,
321
- surface,
322
- index: entry.index,
323
- source,
324
- details: {
325
- global: entry.root,
326
- alias: entry.alias
327
- }
328
- })
329
- );
330
- });
331
- scan.windowDocumentNavigatorUses.forEach((entry) => {
332
- errors.push(
333
- (0, import_errors.buildRunJsAuthoringError)({
334
- path,
335
- repairClass: "blocked-global-stop",
336
- ruleId: `runjs-${entry.root}-property-blocked`,
337
- message: `flowSurfaces authoring ${path} cannot access ${entry.root}.${entry.member} in RunJS`,
338
- modelUse,
339
- surface,
340
- index: entry.index,
341
- source,
342
- details: {
343
- global: entry.root,
344
- member: entry.member
345
- }
346
- })
347
- );
348
- });
349
- scan.forbiddenBareGlobals.forEach((entry) => {
350
- errors.push(
351
- (0, import_errors.buildRunJsAuthoringError)({
352
- path,
353
- repairClass: "blocked-global-stop",
354
- message: `flowSurfaces authoring ${path} cannot access forbidden global ${entry.name}`,
355
- modelUse,
356
- surface,
357
- index: entry.index,
358
- source,
359
- details: {
360
- global: entry.name
361
- }
362
- })
363
- );
364
- });
313
+ function collectUnknownGlobalErrors(path, source, scan, modelUse, surface, errors) {
365
314
  scan.unknownBareGlobals.forEach((entry) => {
366
315
  const suggestion = entry.suggestedCapability ? `; use ${entry.suggestedCapability} or assign it to a local variable first` : "; declare or import it before using it";
367
316
  errors.push(
@@ -840,7 +789,14 @@ const RUNJS_INSPECTION_VALIDATORS = [
840
789
  ),
841
790
  createLegacyValidator("dom-global", (runtime, errors) => {
842
791
  collectDirectDomErrors(runtime.input.path, runtime.source, runtime.scan, runtime.modelUse, runtime.surface, errors);
843
- collectGlobalErrors(runtime.input.path, runtime.source, runtime.scan, runtime.modelUse, runtime.surface, errors);
792
+ collectUnknownGlobalErrors(
793
+ runtime.input.path,
794
+ runtime.source,
795
+ runtime.scan,
796
+ runtime.modelUse,
797
+ runtime.surface,
798
+ errors
799
+ );
844
800
  }),
845
801
  createLegacyValidator(
846
802
  "react-runtime",
@@ -54,6 +54,7 @@ export declare class FlowSurfacesService {
54
54
  get repository(): FlowModelRepository;
55
55
  get locator(): SurfaceLocator;
56
56
  private get routeSync();
57
+ private get navigationTargets();
57
58
  private getFlowTemplateRepository;
58
59
  private getFlowTemplateRepositorySafe;
59
60
  private getFlowTemplateUsageRepository;
@@ -82,6 +83,27 @@ export declare class FlowSurfacesService {
82
83
  private assertMenuRouteUpdatable;
83
84
  private assertMenuParentNotSelfOrDescendant;
84
85
  private buildMenuResult;
86
+ private hasDesktopRouteUiLayoutsRelation;
87
+ private normalizeDesktopRouteRelationId;
88
+ private readDesktopRouteUiLayoutUids;
89
+ private resolveDefaultDesktopRouteUiLayoutUids;
90
+ private findDesktopRouteUiLayoutByUid;
91
+ private getDesktopRouteUiLayoutTypeByUid;
92
+ private isMobileDesktopRouteUiLayoutUid;
93
+ private resolveInheritedDesktopRouteUiLayoutUids;
94
+ private normalizeExplicitDesktopRouteLayoutUid;
95
+ private normalizeDesktopRouteLayoutUidFilter;
96
+ private resolveDesktopRouteLayoutUidFilter;
97
+ private assertNavigationTargetIsExclusive;
98
+ private readDesktopRouteScope;
99
+ private resolveRequestedDesktopRouteScope;
100
+ private resolveExistingDesktopRouteScope;
101
+ private attachDesktopRouteScopeToRouteAndChildren;
102
+ private assertEnabledDesktopRouteUiLayoutUid;
103
+ private assertDesktopRouteBelongsToUiLayout;
104
+ private setDesktopRouteUiLayouts;
105
+ private attachDesktopRouteUiLayoutsToRouteAndChildren;
106
+ private ensureDesktopRouteUiLayouts;
85
107
  private isValidMenuIconName;
86
108
  private assertVisibleNavigationIcon;
87
109
  private assertVisibleNavigationRouteIconUpdate;
@@ -142,6 +164,7 @@ export declare class FlowSurfacesService {
142
164
  private getCollectionFilterTargetKey;
143
165
  private normalizeFlowContextTemplateValue;
144
166
  private isSameConfiguredFlowContextValue;
167
+ private isPopupCurrentRecordFilterByTkMatch;
145
168
  private isPopupAssociatedRecordsSourceIdMatch;
146
169
  private classifyPopupRawResourceInit;
147
170
  private resolvePopupAssociationField;
@@ -160,6 +183,7 @@ export declare class FlowSurfacesService {
160
183
  private persistReactionSlot;
161
184
  private buildLinkageWriteResult;
162
185
  private getLiveLinkageCapability;
186
+ private getLiveFieldValueCapability;
163
187
  getReactionMeta(values: FlowSurfaceGetReactionMetaValues, options?: {
164
188
  transaction?: any;
165
189
  }): Promise<FlowSurfaceGetReactionMetaResult>;
@@ -182,6 +206,17 @@ export declare class FlowSurfacesService {
182
206
  private buildSurfaceReadPayload;
183
207
  private buildSurfaceContextFingerprint;
184
208
  get(input: Record<string, any>, options?: FlowSurfaceReadOptions): Promise<Record<string, any>>;
209
+ exportBlueprint(input: Record<string, unknown>, options?: FlowSurfaceReadOptions): Promise<{
210
+ document: FlowSurfaceApplyBlueprintDocument;
211
+ source: {
212
+ target: {
213
+ pageSchemaUid: string;
214
+ };
215
+ pageTitle?: string;
216
+ };
217
+ warnings: string[];
218
+ unsupported: import("./blueprint/export-document").FlowSurfaceExportBlueprintUnsupportedItem[];
219
+ }>;
185
220
  private getDeclaredKeyPersistenceDeps;
186
221
  private patchDeclaredKeyModel;
187
222
  private persistCreatedKeysForAction;
@@ -192,6 +227,8 @@ export declare class FlowSurfacesService {
192
227
  private dispatchPlanOnlyAction;
193
228
  private resolveApplyBlueprintReplaceTargetInfo;
194
229
  private resolveApplyBlueprintCreateNavigationGroup;
230
+ private normalizeApplyBlueprintCreateMobileNavigation;
231
+ private assertApplyBlueprintCreateNavigationTarget;
195
232
  private resolveApplyBlueprintCreatePageIdentity;
196
233
  private prepareApplyBlueprintRequest;
197
234
  private prevalidateApplyBlueprintChartAssets;
@@ -288,6 +325,7 @@ export declare class FlowSurfacesService {
288
325
  private createFlowTemplateReferenceBlockModel;
289
326
  private buildPopupTemplateReferenceOpenView;
290
327
  private shouldHydrateDetachedPopupTemplateBlockResourceContext;
328
+ private resolveDetachedPopupTemplateBlockCurrentRecordFilterByTk;
291
329
  private collectDetachedPopupTemplateBlockResourceContextPatches;
292
330
  private hydrateDetachedPopupTemplateBlockResourceContext;
293
331
  private hydrateDetachedPopupTemplateSourceContext;
@@ -358,8 +396,13 @@ export declare class FlowSurfacesService {
358
396
  uid: any;
359
397
  updated: string[];
360
398
  }>;
399
+ listNavigationTargets(_values?: Record<string, any>, options?: {
400
+ transaction?: any;
401
+ currentRoles?: FlowSurfaceRequestRoles;
402
+ }): Promise<import("./navigation-targets").FlowSurfaceNavigationTargetsResult>;
361
403
  createMenu(values: Record<string, any>, options?: {
362
404
  transaction?: any;
405
+ currentRoles?: FlowSurfaceRequestRoles;
363
406
  }): Promise<{
364
407
  routeId: any;
365
408
  type: any;
@@ -367,6 +410,7 @@ export declare class FlowSurfacesService {
367
410
  }>;
368
411
  updateMenu(values: Record<string, any>, options?: {
369
412
  transaction?: any;
413
+ currentRoles?: FlowSurfaceRequestRoles;
370
414
  }): Promise<{
371
415
  routeId: any;
372
416
  type: any;
@@ -375,6 +419,7 @@ export declare class FlowSurfacesService {
375
419
  private initializeFlowPageForRoute;
376
420
  createPage(values: Record<string, any>, options?: {
377
421
  transaction?: any;
422
+ currentRoles?: FlowSurfaceRequestRoles;
378
423
  }): Promise<any>;
379
424
  destroyPage(values: Record<string, any>, options?: {
380
425
  transaction?: any;
@@ -736,6 +781,9 @@ export declare class FlowSurfacesService {
736
781
  private syncFilterActionSettingsForUpdateSettings;
737
782
  private resolveFilterActionDefaultFilterRequiredFieldCount;
738
783
  private syncMirroredStepParamsForUpdateSettings;
784
+ private syncActionButtonSettingsForUpdateSettings;
785
+ private supportsActionButtonSettingsSync;
786
+ private pickRequestedActionButtonSettings;
739
787
  private syncCreatedFieldWrapperTitleFieldStepParams;
740
788
  private syncUpdateActionAssignedValuesForUpdateSettings;
741
789
  private syncActionTriggerWorkflowsForUpdateSettings;
@@ -916,6 +964,12 @@ export declare class FlowSurfacesService {
916
964
  private normalizeRemoveNodeTarget;
917
965
  private assertRemoveNodeResolvedTarget;
918
966
  private normalizeGetTarget;
967
+ private normalizeExportBlueprintRequest;
968
+ private normalizeExportBlueprintUnsupportedPolicy;
969
+ private normalizeExportBlueprintLocatorValue;
970
+ private readRouteString;
971
+ private resolveExportBlueprintPageSchemaUid;
972
+ private assertExportBlueprintRootTarget;
919
973
  private normalizeContextPath;
920
974
  private normalizeContextMaxDepth;
921
975
  private buildReadTargetSummary;
@@ -1038,14 +1092,19 @@ export declare class FlowSurfacesService {
1038
1092
  private stableSerializeAIEmployeeValue;
1039
1093
  private buildAIEmployeeActionDedupIdentity;
1040
1094
  private normalizeAIEmployeeWorkContextForDedupIdentity;
1095
+ private normalizeAIEmployeeActionWorkContextForDedupIdentity;
1096
+ private normalizeAIEmployeeDefaultActionWorkContextForSelfUid;
1097
+ private normalizeAIEmployeeTaskWorkContextForDedupIdentity;
1041
1098
  private normalizeAIEmployeeTasksForDedupIdentity;
1042
1099
  private assertNoDuplicateAIEmployeeAction;
1100
+ private assertNoDuplicateAIEmployeeActionForUpdateSettings;
1043
1101
  private hasAIEmployeePublicSettings;
1044
1102
  private assertOnlyAIEmployeePublicSettings;
1045
1103
  private aiEmployeeNestedRepairHint;
1046
1104
  private assertOnlyAIEmployeeNestedPublicSettings;
1047
1105
  private assertNoAIEmployeeInternalPropSettings;
1048
1106
  private readAIEmployeePersistedTasks;
1107
+ private normalizeAIEmployeeLegacyInheritedTaskWorkContext;
1049
1108
  private buildAIEmployeeTaskStepParams;
1050
1109
  private mergeAIEmployeeActionSettingsPayload;
1051
1110
  private syncAIEmployeeTaskStepParamsForUpdateSettings;
@@ -1058,6 +1117,7 @@ export declare class FlowSurfacesService {
1058
1117
  private normalizeAIEmployeeUsername;
1059
1118
  private assertAIEmployeeWorkContextType;
1060
1119
  private normalizeAIEmployeeWorkContext;
1120
+ private normalizeAIEmployeeEffectiveActionWorkContext;
1061
1121
  private normalizeAIEmployeeTaskModel;
1062
1122
  private normalizeAIEmployeeSkillSettings;
1063
1123
  private collectAIEmployeePromptVariables;
@@ -1080,14 +1140,19 @@ export declare class FlowSurfacesService {
1080
1140
  private normalizeAIEmployeeTaskMessage;
1081
1141
  private normalizeAIEmployeeTaskPatch;
1082
1142
  private normalizeAIEmployeeTasks;
1143
+ private withAIEmployeeTaskDefaultWorkContext;
1144
+ private shouldMaterializeAIEmployeeTaskDefaultWorkContext;
1145
+ private rebaseAIEmployeeInheritedTaskWorkContext;
1083
1146
  private normalizeAIEmployeeActionSettingsReferences;
1084
1147
  private normalizeAIEmployeeActionPublicSettings;
1085
1148
  private resolveAIEmployeeActionSelfUid;
1149
+ private resolveAIEmployeeActionSelfUidFromParentNode;
1086
1150
  private configureActionNode;
1087
1151
  private normalizeActionPanelActionChanges;
1088
1152
  private buildFieldCatalog;
1089
1153
  private getFieldMenuCatalogMode;
1090
1154
  private resolveRegisteredFieldBinding;
1155
+ private isCollectionTitleField;
1091
1156
  private resolveAssociationLeafDisplaySemantics;
1092
1157
  private buildFieldMenuDirectCandidates;
1093
1158
  private collectFieldMenuAssociationLeafCandidates;