@nocobase/plugin-flow-engine 2.1.0-alpha.23 → 2.1.0-alpha.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.
Files changed (49) hide show
  1. package/dist/ai/ai-employees/nathan/skills/frontend-developer/SKILLS.md +2 -2
  2. package/dist/externalVersion.js +10 -10
  3. package/dist/node_modules/ses/package.json +1 -1
  4. package/dist/node_modules/zod/package.json +1 -1
  5. package/dist/server/flow-surfaces/action-scope.d.ts +1 -0
  6. package/dist/server/flow-surfaces/action-scope.js +4 -0
  7. package/dist/server/flow-surfaces/apply/compiler.js +4 -2
  8. package/dist/server/flow-surfaces/association-interfaces.d.ts +10 -0
  9. package/dist/server/flow-surfaces/association-interfaces.js +39 -0
  10. package/dist/server/flow-surfaces/association-title-field.d.ts +1 -1
  11. package/dist/server/flow-surfaces/association-title-field.js +38 -4
  12. package/dist/server/flow-surfaces/blueprint/compile-blocks.js +72 -5
  13. package/dist/server/flow-surfaces/blueprint/public-types.d.ts +9 -1
  14. package/dist/server/flow-surfaces/builder.d.ts +27 -1
  15. package/dist/server/flow-surfaces/builder.js +105 -5
  16. package/dist/server/flow-surfaces/catalog.d.ts +2 -1
  17. package/dist/server/flow-surfaces/catalog.js +316 -119
  18. package/dist/server/flow-surfaces/compose-compiler.d.ts +8 -0
  19. package/dist/server/flow-surfaces/compose-compiler.js +9 -1
  20. package/dist/server/flow-surfaces/configure-options.js +72 -6
  21. package/dist/server/flow-surfaces/core-field-default-bindings.d.ts +12 -0
  22. package/dist/server/flow-surfaces/core-field-default-bindings.js +157 -0
  23. package/dist/server/flow-surfaces/default-action-popup.js +2 -2
  24. package/dist/server/flow-surfaces/default-block-actions.js +24 -0
  25. package/dist/server/flow-surfaces/field-binding-registry.d.ts +1 -0
  26. package/dist/server/flow-surfaces/field-binding-registry.js +5 -0
  27. package/dist/server/flow-surfaces/field-semantics.d.ts +1 -1
  28. package/dist/server/flow-surfaces/field-semantics.js +7 -4
  29. package/dist/server/flow-surfaces/field-type-resolver.d.ts +46 -0
  30. package/dist/server/flow-surfaces/field-type-resolver.js +322 -0
  31. package/dist/server/flow-surfaces/index.js +61 -2
  32. package/dist/server/flow-surfaces/node-use-sets.js +4 -0
  33. package/dist/server/flow-surfaces/placement.js +3 -0
  34. package/dist/server/flow-surfaces/public-data-surface-default-filter.d.ts +4 -0
  35. package/dist/server/flow-surfaces/public-data-surface-default-filter.js +45 -4
  36. package/dist/server/flow-surfaces/service-helpers.js +3 -70
  37. package/dist/server/flow-surfaces/service-utils.d.ts +13 -1
  38. package/dist/server/flow-surfaces/service-utils.js +58 -6
  39. package/dist/server/flow-surfaces/service.d.ts +59 -2
  40. package/dist/server/flow-surfaces/service.js +2269 -234
  41. package/dist/server/flow-surfaces/support-matrix.d.ts +1 -1
  42. package/dist/server/flow-surfaces/support-matrix.js +23 -0
  43. package/dist/server/flow-surfaces/surface-context.js +8 -5
  44. package/dist/swagger/flow-surfaces.d.ts +173 -2
  45. package/dist/swagger/flow-surfaces.examples.d.ts +59 -15
  46. package/dist/swagger/flow-surfaces.examples.js +69 -11
  47. package/dist/swagger/flow-surfaces.js +86 -17
  48. package/dist/swagger/index.d.ts +173 -2
  49. package/package.json +2 -2
@@ -72,6 +72,9 @@ __export(service_utils_exports, {
72
72
  normalizeSimpleLayoutValue: () => normalizeSimpleLayoutValue,
73
73
  normalizeSimpleResourceInit: () => normalizeSimpleResourceInit,
74
74
  normalizeStoredChartCardHeightMode: () => normalizeStoredChartCardHeightMode,
75
+ resolveRequestedFieldComponent: () => resolveRequestedFieldComponent,
76
+ resolveRequestedFieldUse: () => resolveRequestedFieldUse,
77
+ resolveRequestedFieldUseAlias: () => resolveRequestedFieldUseAlias,
75
78
  rethrowInlineConfigurationError: () => rethrowInlineConfigurationError,
76
79
  splitComposeFieldChanges: () => splitComposeFieldChanges,
77
80
  toFlowSurfaceBatchItemError: () => toFlowSurfaceBatchItemError
@@ -84,6 +87,7 @@ var import_defaults = require("./blueprint/defaults");
84
87
  var import_errors = require("./errors");
85
88
  var import_service_helpers = require("./service-helpers");
86
89
  var import_key_registry = require("./planning/key-registry");
90
+ var import_field_type_resolver = require("./field-type-resolver");
87
91
  function buildDefinedPayload(payload) {
88
92
  return import_lodash.default.pickBy(payload, (value) => !import_lodash.default.isUndefined(value));
89
93
  }
@@ -299,7 +303,18 @@ function hasDefinedValue(input, keys) {
299
303
  return keys.some((key) => hasOwnDefined(input, key));
300
304
  }
301
305
  function ensureNoRawSimpleChangeKeys(changes) {
302
- const rawKeys = ["props", "decoratorProps", "stepParams", "flowRegistry", "use", "fieldUse"];
306
+ const rawKeys = [
307
+ "props",
308
+ "decoratorProps",
309
+ "stepParams",
310
+ "flowRegistry",
311
+ "use",
312
+ "fieldUse",
313
+ "fieldComponent",
314
+ "fieldModel",
315
+ "componentFields",
316
+ "subModels"
317
+ ];
303
318
  const forbidden = Object.keys(changes).filter((key) => rawKeys.includes(key));
304
319
  if (forbidden.length) {
305
320
  (0, import_errors.throwBadRequest)(
@@ -346,12 +361,22 @@ function normalizeComposeFieldSpec(input, index) {
346
361
  if (!import_lodash.default.isPlainObject(input)) {
347
362
  (0, import_errors.throwBadRequest)(`flowSurfaces compose field #${index + 1} must be a string or object`);
348
363
  }
349
- if (input.use || input.fieldUse || input.stepParams || input.props || input.decoratorProps) {
350
- (0, import_errors.throwBadRequest)("flowSurfaces compose field only accepts public semantic field fields");
351
- }
364
+ (0, import_field_type_resolver.assertNoInternalFieldKeys)(input, `flowSurfaces compose field #${index + 1}`);
365
+ (0, import_field_type_resolver.assertNoInternalFieldKeys)(input.settings, `flowSurfaces compose field #${index + 1}.settings`);
352
366
  const semanticType = String(input.type || "").trim() || void 0;
353
367
  const fieldPath = String(input.fieldPath || "").trim();
354
368
  const renderer = typeof input.renderer === "undefined" ? void 0 : String(input.renderer || "").trim();
369
+ const fieldType = (0, import_field_type_resolver.normalizePublicFieldType)(input.fieldType, `compose field #${index + 1}`);
370
+ const fields = (0, import_field_type_resolver.normalizePublicFieldNameList)(input.fields, `compose field #${index + 1}.fields`);
371
+ const selectorFields = (0, import_field_type_resolver.normalizePublicFieldNameList)(
372
+ input.selectorFields,
373
+ `compose field #${index + 1}.selectorFields`
374
+ );
375
+ const titleField = typeof input.titleField === "undefined" ? void 0 : String(input.titleField || "").trim();
376
+ const openMode = typeof input.openMode === "undefined" ? void 0 : String(input.openMode || "").trim();
377
+ const popupSize = typeof input.popupSize === "undefined" ? void 0 : String(input.popupSize || "").trim();
378
+ const pageSize = typeof input.pageSize === "undefined" ? void 0 : Number(input.pageSize);
379
+ const showIndex = typeof input.showIndex === "undefined" ? void 0 : !!input.showIndex;
355
380
  if (!import_lodash.default.isUndefined(input.popup) && !import_lodash.default.isPlainObject(input.popup)) {
356
381
  (0, import_errors.throwBadRequest)(`flowSurfaces compose field #${index + 1} popup must be an object`);
357
382
  }
@@ -376,6 +401,14 @@ function normalizeComposeFieldSpec(input, index) {
376
401
  associationPathName: String(input.associationPathName || "").trim() || void 0,
377
402
  ...renderer ? { renderer } : {},
378
403
  ...semanticType ? { type: semanticType } : {},
404
+ ...fieldType ? { fieldType } : {},
405
+ ...!import_lodash.default.isUndefined(fields) ? { fields } : {},
406
+ ...!import_lodash.default.isUndefined(selectorFields) ? { selectorFields } : {},
407
+ ...titleField ? { titleField } : {},
408
+ ...openMode ? { openMode } : {},
409
+ ...popupSize ? { popupSize } : {},
410
+ ...!import_lodash.default.isUndefined(pageSize) && Number.isFinite(pageSize) ? { pageSize } : {},
411
+ ...!import_lodash.default.isUndefined(showIndex) ? { showIndex } : {},
379
412
  target: typeof input.target === "string" ? String(input.target || "").trim() || void 0 : void 0,
380
413
  settings: import_lodash.default.isPlainObject(input.settings) ? input.settings : {},
381
414
  popup: import_lodash.default.isPlainObject(input.popup) ? input.popup : void 0,
@@ -383,6 +416,16 @@ function normalizeComposeFieldSpec(input, index) {
383
416
  ...popupDefaultsMetadata ? { [import_defaults.FLOW_SURFACE_APPLY_BLUEPRINT_POPUP_DEFAULTS_KEY]: popupDefaultsMetadata } : {}
384
417
  };
385
418
  }
419
+ function resolveRequestedFieldComponent(values) {
420
+ return void 0;
421
+ }
422
+ function resolveRequestedFieldUse(values) {
423
+ return resolveRequestedFieldComponent(values) || resolveRequestedFieldUseAlias(values);
424
+ }
425
+ function resolveRequestedFieldUseAlias(values) {
426
+ const legacyFieldUse = String((values == null ? void 0 : values.fieldUse) || "").trim();
427
+ return legacyFieldUse || void 0;
428
+ }
386
429
  function normalizeComposeActionSpec(input, index) {
387
430
  if (typeof input === "string") {
388
431
  const type2 = String(input || "").trim();
@@ -595,13 +638,19 @@ function splitComposeFieldChanges(changes, wrapperUse) {
595
638
  "disabled",
596
639
  "maxCount",
597
640
  "pattern",
598
- "titleField",
599
641
  "dataIndex",
600
642
  "editable",
601
643
  "labelWidth",
602
644
  "labelWrap",
603
645
  "name",
604
- "fieldComponent",
646
+ "fieldType",
647
+ "fields",
648
+ "selectorFields",
649
+ "titleField",
650
+ "openMode",
651
+ "popupSize",
652
+ "pageSize",
653
+ "showIndex",
605
654
  ...wrapperUse === "TableColumnModel" ? ["title"] : []
606
655
  ]);
607
656
  const fieldChanges = import_lodash.default.pick(changes, [
@@ -805,6 +854,9 @@ function getFieldBindingDefaultProps(containerUse, fieldUse, field) {
805
854
  normalizeSimpleLayoutValue,
806
855
  normalizeSimpleResourceInit,
807
856
  normalizeStoredChartCardHeightMode,
857
+ resolveRequestedFieldComponent,
858
+ resolveRequestedFieldUse,
859
+ resolveRequestedFieldUseAlias,
808
860
  rethrowInlineConfigurationError,
809
861
  splitComposeFieldChanges,
810
862
  toFlowSurfaceBatchItemError
@@ -75,6 +75,9 @@ export declare class FlowSurfacesService {
75
75
  private analyzeCatalogTarget;
76
76
  private projectCatalogNode;
77
77
  private patchResolvedNodeConfigureOptions;
78
+ private buildRelationFieldTypeCandidates;
79
+ private collectRelationNestedFieldPaths;
80
+ private collectRelationSelectorFieldPaths;
78
81
  private projectCatalogItem;
79
82
  private buildCatalogBlockItem;
80
83
  private isCollectionBlockUse;
@@ -271,7 +274,7 @@ export declare class FlowSurfacesService {
271
274
  }): Promise<import("./compose-runtime").FlowSurfaceComposeExecutionResult>;
272
275
  configure(values: FlowSurfaceConfigureValues, options?: {
273
276
  transaction?: any;
274
- }): Promise<{
277
+ }): Promise<_.Dictionary<any> | {
275
278
  uid: any;
276
279
  updated?: undefined;
277
280
  } | {
@@ -607,6 +610,9 @@ export declare class FlowSurfacesService {
607
610
  private assertComposeMode;
608
611
  private assertMutateAtomicFlag;
609
612
  private normalizeWriteTarget;
613
+ private parseCalendarPopupActionTargetUid;
614
+ private parseKanbanPopupActionTargetUid;
615
+ private prepareWriteTarget;
610
616
  private normalizeRootUidValue;
611
617
  private assertRouteBackedPageUidTarget;
612
618
  private assertRouteBackedTabUidTarget;
@@ -662,6 +668,8 @@ export declare class FlowSurfacesService {
662
668
  private configureTab;
663
669
  private configureTableBlock;
664
670
  private configureCalendarBlock;
671
+ private configureTreeBlock;
672
+ private configureKanbanBlock;
665
673
  private configureFormBlock;
666
674
  private configureDetailsBlock;
667
675
  private configureFilterFormBlock;
@@ -683,6 +691,7 @@ export declare class FlowSurfacesService {
683
691
  private configureFieldNode;
684
692
  private normalizeFilterActionDefaultFilterValue;
685
693
  private configureActionNode;
694
+ private normalizeActionPanelActionChanges;
686
695
  private buildFieldCatalog;
687
696
  private getFieldMenuCatalogMode;
688
697
  private resolveRegisteredFieldBinding;
@@ -720,6 +729,34 @@ export declare class FlowSurfacesService {
720
729
  private resolvePopupSourceRecordCollectionName;
721
730
  private resolvePopupContextLevel;
722
731
  private getCollection;
732
+ private normalizeKanbanFieldNameInput;
733
+ private getKanbanCollectionFilterTargetKey;
734
+ private isKanbanMultipleGroupField;
735
+ private isKanbanAssociationGroupField;
736
+ private isKanbanGroupField;
737
+ private getKanbanGroupFieldCandidates;
738
+ private getKanbanDefaultGroupFieldName;
739
+ private getKanbanGroupField;
740
+ private getKanbanCollectionOrThrow;
741
+ private assertKanbanCollectionCompatible;
742
+ private getKanbanRelationTargetCollection;
743
+ private getKanbanRelationFieldCandidateNames;
744
+ private getKanbanDefaultRelationTitleFieldName;
745
+ private assertKanbanRelationFieldBinding;
746
+ private getKanbanGroupFieldSortScopeKeys;
747
+ private getKanbanCompatibleSortFieldNames;
748
+ private resolveKanbanCompatibleSortFieldName;
749
+ private normalizeKanbanGroupOptions;
750
+ private buildKanbanInlineGroupOptions;
751
+ private mergeKanbanInlineGroupOptions;
752
+ private normalizeKanbanPopupSettings;
753
+ private getKanbanPopupActionUse;
754
+ private getKanbanPopupActionUid;
755
+ private getKanbanBlockResourceInit;
756
+ private getKanbanPopupStoredSettings;
757
+ private buildKanbanPopupOpenView;
758
+ private normalizeKanbanPopupConfigureValue;
759
+ private buildKanbanInitialBlockProps;
723
760
  private normalizeCalendarFieldPathInput;
724
761
  private isCalendarDateField;
725
762
  private isCalendarTitleField;
@@ -746,25 +783,45 @@ export declare class FlowSurfacesService {
746
783
  private buildCalendarInitialBlockProps;
747
784
  private ensureCalendarBlockPopupHosts;
748
785
  private ensureCalendarBlockPopupHostsInTree;
786
+ private projectCalendarBlockPopupHosts;
787
+ private projectCalendarBlockPopupHostsInTree;
788
+ private ensureKanbanBlockPopupHosts;
789
+ private ensureKanbanBlockPopupHostsInTree;
790
+ private projectKanbanBlockPopupHosts;
791
+ private projectKanbanBlockPopupHostsInTree;
792
+ private getCalendarSettingValue;
793
+ private validateCalendarSettingValues;
749
794
  private validateCalendarBlockState;
795
+ private validateKanbanBlockState;
750
796
  private resolveFieldDefinition;
751
797
  private getAssociationDefaultTitleFieldName;
752
798
  private getAssociationTitleFieldTargetCollection;
753
799
  private buildAssociationTitleFieldUnavailableMessage;
754
800
  private resolveTitleFieldSyncDecision;
755
801
  private resolvePreferredFieldForCapability;
802
+ private supportsFieldTitleFieldProp;
803
+ private normalizeFieldPropsForUse;
756
804
  private ensureGridChild;
757
805
  private ensureTableActionsColumn;
758
806
  private ensurePopupSurface;
759
807
  private ensureFlowRoutePageSchemaShell;
760
808
  private removeFlowRoutePageSchemaShell;
761
809
  private normalizeDisplayFieldBinding;
810
+ private getCollectionFieldOrBadRequest;
811
+ private buildRelationTargetFieldInit;
812
+ private buildRelationTargetTableColumnNode;
813
+ private buildRelationTargetGridItemNode;
814
+ private replaceFieldSubModelArray;
815
+ private buildPopupSubTableActionsColumnNode;
816
+ private ensureFieldGridSubModel;
817
+ private applyResolvedRelationFieldType;
818
+ private applyRecordPickerFieldTypeSettings;
762
819
  private buildExactFieldSettingsInitPayload;
763
820
  private patchFieldSettingsInitExact;
764
821
  private inferFieldComponentFlowDomain;
765
822
  private resolveFieldComponentFieldSource;
766
823
  private assertSupportedFieldComponentUse;
767
- private syncFieldComponentStepParams;
824
+ private syncFieldTypeStepParams;
768
825
  private rebuildFieldSubModelOnServer;
769
826
  private parseFieldPath;
770
827
  private loadResolvedNode;