@nocobase/plugin-flow-engine 2.2.0-beta.9 → 3.0.0-alpha.1

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 (42) 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 +396 -0
  11. package/dist/externalVersion.js +9 -9
  12. package/dist/locale/en-US.json +2 -0
  13. package/dist/locale/index.d.ts +4 -0
  14. package/dist/locale/zh-CN.json +2 -0
  15. package/dist/node_modules/@ant-design/icons-svg/package.json +1 -1
  16. package/dist/node_modules/acorn/package.json +1 -1
  17. package/dist/node_modules/acorn-jsx/package.json +1 -1
  18. package/dist/node_modules/acorn-walk/package.json +1 -1
  19. package/dist/node_modules/ses/package.json +1 -1
  20. package/dist/node_modules/zod/package.json +1 -1
  21. package/dist/server/flow-surfaces/authoring-validation.d.ts +2 -1
  22. package/dist/server/flow-surfaces/authoring-validation.js +167 -19
  23. package/dist/server/flow-surfaces/blueprint/compile-blocks.js +7 -3
  24. package/dist/server/flow-surfaces/blueprint/compile-plan.js +19 -15
  25. package/dist/server/flow-surfaces/blueprint/normalize-document.js +18 -2
  26. package/dist/server/flow-surfaces/blueprint/public-types.d.ts +1 -0
  27. package/dist/server/flow-surfaces/builder.js +3 -0
  28. package/dist/server/flow-surfaces/constants.d.ts +9 -2
  29. package/dist/server/flow-surfaces/constants.js +1 -0
  30. package/dist/server/flow-surfaces/contract-guard.js +20 -10
  31. package/dist/server/flow-surfaces/errors.d.ts +2 -2
  32. package/dist/server/flow-surfaces/errors.js +4 -4
  33. package/dist/server/flow-surfaces/navigation-targets.d.ts +80 -0
  34. package/dist/server/flow-surfaces/navigation-targets.js +546 -0
  35. package/dist/server/flow-surfaces/runjs-authoring/runtime/constants.js +1 -0
  36. package/dist/server/flow-surfaces/service.d.ts +21 -2
  37. package/dist/server/flow-surfaces/service.js +610 -121
  38. package/dist/server/variables/records.js +7 -2
  39. package/dist/swagger/flow-surfaces.d.ts +96 -0
  40. package/dist/swagger/flow-surfaces.js +88 -7
  41. package/dist/swagger/index.d.ts +96 -0
  42. package/package.json +2 -2
@@ -63,9 +63,14 @@ function mergeFieldsWithExtras(fields, extras = []) {
63
63
  if (!Array.isArray(fields) || fields.length === 0 || extras.length === 0) return fields;
64
64
  return uniqStrings([...fields, ...extras]);
65
65
  }
66
+ function toJsonRecord(record) {
67
+ if (!record || typeof record !== "object") return record;
68
+ const toJSON = record.toJSON;
69
+ return typeof toJSON === "function" ? toJSON.call(record) : record;
70
+ }
66
71
  function toJsonArray(rows) {
67
72
  if (!Array.isArray(rows)) return [];
68
- return rows.map((r) => (r == null ? void 0 : r.toJSON) ? r.toJSON() : r);
73
+ return rows.map(toJsonRecord);
69
74
  }
70
75
  function reorderRecordsByFilterByTk(records, filterByTk, options) {
71
76
  if (!Array.isArray(filterByTk) || filterByTk.length === 0) return records;
@@ -110,7 +115,7 @@ async function fetchRecordOrRecordsJson(repo, params) {
110
115
  const rec = await repo.findOne(
111
116
  preferFullRecord ? { filterByTk } : { filterByTk, fields, appends }
112
117
  );
113
- return rec ? rec.toJSON() : void 0;
118
+ return rec ? toJsonRecord(rec) : void 0;
114
119
  }
115
120
  // Annotate the CommonJS export names for ESM import in node:
116
121
  0 && (module.exports = {
@@ -2604,6 +2604,86 @@ declare const _default: {
2604
2604
  };
2605
2605
  additionalProperties: boolean;
2606
2606
  };
2607
+ FlowSurfaceListNavigationTargetsRequest: {
2608
+ type: string;
2609
+ properties: {};
2610
+ additionalProperties: boolean;
2611
+ };
2612
+ FlowSurfaceNavigationTargetCapabilities: {
2613
+ type: string;
2614
+ required: string[];
2615
+ properties: {
2616
+ multiPortal: {
2617
+ type: string;
2618
+ description: string;
2619
+ };
2620
+ };
2621
+ additionalProperties: boolean;
2622
+ };
2623
+ FlowSurfaceNavigationTarget: {
2624
+ type: string;
2625
+ required: string[];
2626
+ properties: {
2627
+ kind: {
2628
+ type: string;
2629
+ enum: string[];
2630
+ };
2631
+ uid: {
2632
+ type: string;
2633
+ description: string;
2634
+ };
2635
+ title: {
2636
+ type: string;
2637
+ };
2638
+ icon: {
2639
+ type: string;
2640
+ nullable: boolean;
2641
+ };
2642
+ layoutUid: {
2643
+ type: string;
2644
+ };
2645
+ layoutType: {
2646
+ type: string;
2647
+ };
2648
+ routeName: {
2649
+ type: string;
2650
+ };
2651
+ routePath: {
2652
+ type: string;
2653
+ };
2654
+ authCheck: {
2655
+ type: string;
2656
+ };
2657
+ default: {
2658
+ type: string;
2659
+ };
2660
+ portalUid: {
2661
+ type: string;
2662
+ description: string;
2663
+ };
2664
+ };
2665
+ additionalProperties: boolean;
2666
+ };
2667
+ FlowSurfaceListNavigationTargetsResult: {
2668
+ type: string;
2669
+ required: string[];
2670
+ properties: {
2671
+ version: {
2672
+ type: string;
2673
+ enum: string[];
2674
+ };
2675
+ capabilities: {
2676
+ $ref: string;
2677
+ };
2678
+ targets: {
2679
+ type: string;
2680
+ items: {
2681
+ $ref: string;
2682
+ };
2683
+ };
2684
+ };
2685
+ additionalProperties: boolean;
2686
+ };
2607
2687
  FlowSurfaceApplyBlueprintNavigationGroup: {
2608
2688
  type: string;
2609
2689
  properties: {
@@ -2639,6 +2719,10 @@ declare const _default: {
2639
2719
  type: string;
2640
2720
  description: string;
2641
2721
  };
2722
+ portalUid: {
2723
+ type: string;
2724
+ description: string;
2725
+ };
2642
2726
  group: {
2643
2727
  $ref: string;
2644
2728
  };
@@ -3156,6 +3240,10 @@ declare const _default: {
3156
3240
  type: string;
3157
3241
  description: string;
3158
3242
  };
3243
+ portalUid: {
3244
+ type: string;
3245
+ description: string;
3246
+ };
3159
3247
  title: {
3160
3248
  type: string;
3161
3249
  };
@@ -3231,6 +3319,10 @@ declare const _default: {
3231
3319
  type: string;
3232
3320
  }[];
3233
3321
  };
3322
+ portalUid: {
3323
+ type: string;
3324
+ description: string;
3325
+ };
3234
3326
  title: {
3235
3327
  type: string;
3236
3328
  };
@@ -3282,6 +3374,10 @@ declare const _default: {
3282
3374
  type: string;
3283
3375
  description: string;
3284
3376
  };
3377
+ portalUid: {
3378
+ type: string;
3379
+ description: string;
3380
+ };
3285
3381
  menuRouteId: {
3286
3382
  oneOf: {
3287
3383
  type: string;
@@ -500,7 +500,7 @@ function buildReactionCapabilitySchema(kind, ruleSchemaName, extraProperties = {
500
500
  additionalProperties: false
501
501
  };
502
502
  }
503
- const FLOW_SURFACES_READ_ACL_NOTE = "Read actions (`get` / `describeSurface` / `exportBlueprint` / `catalog` / `context` / `getReactionMeta` / `getEventFlowMeta` / `listTemplates` / `getTemplate`) are open to `loggedIn` by default. Write actions still require the `ui.flowSurfaces` snippet.";
503
+ const FLOW_SURFACES_READ_ACL_NOTE = "Read actions (`get` / `describeSurface` / `exportBlueprint` / `listNavigationTargets` / `catalog` / `context` / `getReactionMeta` / `getEventFlowMeta` / `listTemplates` / `getTemplate`) are open to `loggedIn` by default. Write actions still require the `ui.flowSurfaces` snippet.";
504
504
  const templateActionDocs = (0, import_flow_surfaces2.createFlowSurfaceTemplateActionDocs)({
505
505
  tag: FLOW_SURFACES_TAG,
506
506
  readAclNote: FLOW_SURFACES_READ_ACL_NOTE,
@@ -619,11 +619,20 @@ const actionDocs = {
619
619
  requestBody: requestBody("FlowSurfaceExportBlueprintRequest", import_flow_surfaces.flowSurfaceExamples.exportBlueprint),
620
620
  responses: responses("FlowSurfaceExportBlueprintResponse")
621
621
  },
622
+ listNavigationTargets: {
623
+ tags: [FLOW_SURFACES_TAG],
624
+ summary: "List available UI layouts and role-accessible Multi-portal entries",
625
+ description: valuesCompatibilityNote(
626
+ `Returns the default Admin target, enabled UI layouts, and enabled custom Multi-portal targets visible to the current roles. capabilities.multiPortal=false and an empty custom-portal set are normal when the commercial Multi-portal capability is not installed. Reserved default portal records are never returned as custom workspaces; Admin and Mobile use their ordinary layout uids. Call this action only when the user explicitly names a workspace or asks to discover navigation targets. ${FLOW_SURFACES_READ_ACL_NOTE}`
627
+ ),
628
+ requestBody: requestBody("FlowSurfaceListNavigationTargetsRequest", {}),
629
+ responses: responses("FlowSurfaceListNavigationTargetsResult")
630
+ },
622
631
  applyBlueprint: {
623
632
  tags: [FLOW_SURFACES_TAG],
624
633
  summary: "Apply a page blueprint to create or replace one Modern page",
625
634
  description: valuesCompatibilityNote(
626
- `Accepts one simplified JSON page blueprint and compiles it to internal flow-surface operations. The public blueprint describes page structure (\`create\` or \`replace\`, page metadata, ordered tabs, blocks, fields, actions, inline popups, optional reusable assets) and optional top-level \`reaction.items[]\` for whole-page interaction authoring. Each reaction item targets an explicit local key / bind key produced by the same blueprint run. Only explicitly listed reaction items are written. \`rules: []\` clears the targeted slot. Repeating the same \`(type, target)\` reaction slot in one blueprint is invalid. In \`replace\`, reaction targets always bind to the newly produced blueprint result, not historical nodes from the previous page version; if a slot must exist in the resulting surface, include it explicitly instead of relying on omission. Localized reaction edits on an existing surface should use \`getReactionMeta\` + \`set*Rules\` instead of applying a whole page blueprint again. The request body is that page-document JSON object itself and must not be JSON-stringified. Wrong: \`{ "requestBody": "{\\"version\\":\\"1\\"}" }\`. Internal planning details stay hidden. In \`create\`, \`navigation.layoutUid\` optionally scopes menu group reuse, duplicate page identity checks, and newly created routes to an enabled UI layout such as \`admin-layout-model\` or \`mobile-layout-model\`; when the target layout type is mobile, applyBlueprint ignores \`navigation.group\` and creates a root-level mobile tab page. When \`layoutUid\` is omitted, routes keep the existing admin/default inheritance behavior. In non-mobile \`create\`, \`navigation.group.routeId\` has the highest priority when targeting an existing menu group. If \`routeId\` is present, applyBlueprint ignores \`title\`, \`icon\`, \`tooltip\`, and \`hideInMenu\` on \`navigation.group\`; applyBlueprint create mode does not mutate existing group metadata, so callers should use \`updateMenu\` separately when that is required. When \`routeId\` is omitted and \`navigation.group.title\` is provided, applyBlueprint reuses one existing same-title group in the target layout when it is unique, creates a new group when none exists, and rejects ambiguous multi-match cases. Metadata such as \`icon\`, \`tooltip\`, and \`hideInMenu\` is used only when a new group is created and is ignored when an existing group is reused. \`replace\` uses \`target.pageSchemaUid\`, updates only the explicit page-level fields provided in \`page\`, maps blueprint tabs to existing route-backed tab slots by index, rewrites each slot in order, removes trailing old tabs, and appends extra new tabs when needed. Tab and block keys are optional in the public blueprint; omit them unless custom layout or cross-block targeting needs a stable in-document identifier. \`layout\` is only allowed on tabs and inline popup documents; blocks themselves do not accept a \`layout\` property. Public applyBlueprint blocks do not support generic \`form\`; use \`editForm\` or \`createForm\`. AI employee actions use \`type: "aiEmployee"\` plus public \`settings.username\`, \`workContext\`, \`tasks\`, \`auto\`, and \`style\`; work context may target \`self\` or a same-blueprint block key and is persisted as real Flow Model \`uid\` values. For JS blocks/fields/actions, \`script\` is a non-empty string asset key into \`assets.scripts\`; put inline JS in \`settings.code\` and \`settings.version\`. Direct \`table\` / \`list\` / \`gridCard\` / \`calendar\` / \`kanban\` blocks may omit \`defaultFilter\`; the backend generates one from live metadata with up to 4 scalar/filterable fields. Explicit values must contain at least the smaller of 3 and the collection eligible-field count, and values with more than 4 fields are truncated before persistence. A valid explicit or generated block-level value backfills the default \`filter\` action \`settings.defaultFilter\`; explicit filter-action \`settings.defaultFilter\` still wins. ${TREE_TABLE_RECORD_ACTION_DEFAULTS_NOTE} ${APPLY_BLUEPRINT_TREE_TABLE_TITLE_FIELD_NOTE} Inline popup documents may set \`popup.tryTemplate=true\` to ask the backend for the best compatible popup template before falling back to local popup content. Inline popup documents may also combine \`popup.tryTemplate\` with \`popup.saveAsTemplate={ name, description, local? }\`: a hit binds the matched template immediately and lets later inline popups in the same blueprint reuse that final bound template through \`popup.template={ local, mode }\`, while a miss requires explicit local \`popup.blocks\` so the fallback popup can be saved and reused. Custom \`edit\` popups that provide \`popup.blocks\` must include exactly one \`editForm\` block; that \`editForm\` may omit \`resource\` and then inherits the opener's current-record context. When layout is omitted, applyBlueprint auto-generates a simple top-to-bottom layout. When a \`replace\` run expands a page to multiple tabs while the current page still has \`enableTabs=false\`, callers must set \`page.enableTabs=true\` explicitly. The response hides execution internals and returns only the resolved page target and final surface readback.`
635
+ `In create mode, \`navigation.portalUid\` targets one enabled, role-accessible Multi-portal entry and is mutually exclusive with \`navigation.layoutUid\`. Portal-backed mobile layouts ignore \`navigation.group\`, while desktop-backed portals scope group reuse and duplicate-page identity to that portal. If Multi-portal is unavailable, ordinary requests without \`portalUid\` keep their existing Admin behavior. Accepts one simplified JSON page blueprint and compiles it to internal flow-surface operations. The public blueprint describes page structure (\`create\` or \`replace\`, page metadata, ordered tabs, blocks, fields, actions, inline popups, optional reusable assets) and optional top-level \`reaction.items[]\` for whole-page interaction authoring. Each reaction item targets an explicit local key / bind key produced by the same blueprint run. Only explicitly listed reaction items are written. \`rules: []\` clears the targeted slot. Repeating the same \`(type, target)\` reaction slot in one blueprint is invalid. In \`replace\`, reaction targets always bind to the newly produced blueprint result, not historical nodes from the previous page version; if a slot must exist in the resulting surface, include it explicitly instead of relying on omission. Localized reaction edits on an existing surface should use \`getReactionMeta\` + \`set*Rules\` instead of applying a whole page blueprint again. The request body is that page-document JSON object itself and must not be JSON-stringified. Wrong: \`{ "requestBody": "{\\"version\\":\\"1\\"}" }\`. Internal planning details stay hidden. In \`create\`, \`navigation.layoutUid\` optionally scopes menu group reuse, duplicate page identity checks, and newly created routes to an enabled UI layout such as \`admin-layout-model\` or \`mobile-layout-model\`; when the target layout type is mobile, applyBlueprint ignores \`navigation.group\` and creates a root-level mobile tab page. When \`layoutUid\` is omitted, routes keep the existing admin/default inheritance behavior. In non-mobile \`create\`, \`navigation.group.routeId\` has the highest priority when targeting an existing menu group. If \`routeId\` is present, applyBlueprint ignores \`title\`, \`icon\`, \`tooltip\`, and \`hideInMenu\` on \`navigation.group\`; applyBlueprint create mode does not mutate existing group metadata, so callers should use \`updateMenu\` separately when that is required. When \`routeId\` is omitted and \`navigation.group.title\` is provided, applyBlueprint reuses one existing same-title group in the target layout when it is unique, creates a new group when none exists, and rejects ambiguous multi-match cases. Metadata such as \`icon\`, \`tooltip\`, and \`hideInMenu\` is used only when a new group is created and is ignored when an existing group is reused. \`replace\` uses \`target.pageSchemaUid\`, updates only the explicit page-level fields provided in \`page\`, maps blueprint tabs to existing route-backed tab slots by index, rewrites each slot in order, removes trailing old tabs, and appends extra new tabs when needed. Tab and block keys are optional in the public blueprint; omit them unless custom layout or cross-block targeting needs a stable in-document identifier. \`layout\` is only allowed on tabs and inline popup documents; blocks themselves do not accept a \`layout\` property. Public applyBlueprint blocks do not support generic \`form\`; use \`editForm\` or \`createForm\`. AI employee actions use \`type: "aiEmployee"\` plus public \`settings.username\`, \`workContext\`, \`tasks\`, \`auto\`, and \`style\`; work context may target \`self\` or a same-blueprint block key and is persisted as real Flow Model \`uid\` values. For JS blocks/fields/actions, \`script\` is a non-empty string asset key into \`assets.scripts\`; put inline JS in \`settings.code\` and \`settings.version\`. Direct \`table\` / \`list\` / \`gridCard\` / \`calendar\` / \`kanban\` blocks may omit \`defaultFilter\`; the backend generates one from live metadata with up to 4 scalar/filterable fields. Explicit values must contain at least the smaller of 3 and the collection eligible-field count, and values with more than 4 fields are truncated before persistence. A valid explicit or generated block-level value backfills the default \`filter\` action \`settings.defaultFilter\`; explicit filter-action \`settings.defaultFilter\` still wins. ${TREE_TABLE_RECORD_ACTION_DEFAULTS_NOTE} ${APPLY_BLUEPRINT_TREE_TABLE_TITLE_FIELD_NOTE} Inline popup documents may set \`popup.tryTemplate=true\` to ask the backend for the best compatible popup template before falling back to local popup content. Inline popup documents may also combine \`popup.tryTemplate\` with \`popup.saveAsTemplate={ name, description, local? }\`: a hit binds the matched template immediately and lets later inline popups in the same blueprint reuse that final bound template through \`popup.template={ local, mode }\`, while a miss requires explicit local \`popup.blocks\` so the fallback popup can be saved and reused. Custom \`edit\` popups that provide \`popup.blocks\` must include exactly one \`editForm\` block; that \`editForm\` may omit \`resource\` and then inherits the opener's current-record context. When layout is omitted, applyBlueprint auto-generates a simple top-to-bottom layout. When a \`replace\` run expands a page to multiple tabs while the current page still has \`enableTabs=false\`, callers must set \`page.enableTabs=true\` explicitly. The response hides execution internals and returns only the resolved page target and final surface readback.`
627
636
  ),
628
637
  requestBody: {
629
638
  required: true,
@@ -809,7 +818,7 @@ const actionDocs = {
809
818
  tags: [FLOW_SURFACES_TAG],
810
819
  summary: "Create a group menu or a bindable V2 menu item",
811
820
  description: valuesCompatibilityNote(
812
- 'Creates a FlowSurfaces menu node. `type="group"` creates a menu group. `type="item"` creates a menu item that can be bound to a modern page (v2), and automatically fills in the flowPage route, the default hidden tab route, and the RootPageModel anchor. Optional `layoutUid` scopes the route to an enabled UI layout; omitted values keep the existing parent/default admin layout inheritance.'
821
+ 'Creates a FlowSurfaces menu node. `type="group"` creates a menu group. `type="item"` creates a menu item that can be bound to a modern page (v2), and automatically fills in the flowPage route, the default hidden tab route, and the RootPageModel anchor. Optional `layoutUid` scopes the route to an enabled UI layout. Optional `portalUid` scopes it to one enabled, role-accessible Multi-portal entry and is mutually exclusive with `layoutUid`. Omitted values keep the existing parent/default admin inheritance.'
813
822
  ),
814
823
  requestBody: requestBody("FlowSurfaceCreateMenuRequest", import_flow_surfaces.flowSurfaceExamples.createMenu),
815
824
  responses: responses("FlowSurfaceCreateMenuResult")
@@ -818,7 +827,7 @@ const actionDocs = {
818
827
  tags: [FLOW_SURFACES_TAG],
819
828
  summary: "Update menu title/icon/tooltip or move it under another group",
820
829
  description: valuesCompatibilityNote(
821
- "Updates menu display information, or moves a group / item to the top level or under another group. Only `group` and `flowPage` menu nodes are supported."
830
+ "Updates menu display information, or moves a group / item to the top level or under another group. Only `group` and `flowPage` menu nodes are supported. Pass `portalUid` when explicitly targeting a Multi-portal entry; the route and new parent must already belong to that portal."
822
831
  ),
823
832
  requestBody: requestBody("FlowSurfaceUpdateMenuRequest", import_flow_surfaces.flowSurfaceExamples.updateMenu),
824
833
  responses: responses("FlowSurfaceUpdateMenuResult")
@@ -827,7 +836,7 @@ const actionDocs = {
827
836
  tags: [FLOW_SURFACES_TAG],
828
837
  summary: "Initialize a modern page for an existing bindable menu item",
829
838
  description: valuesCompatibilityNote(
830
- "Initializes a modern page (v2) for an existing bindable menu item through `menuRouteId` first, and fills in the default BlockGridModel. Optional `layoutUid` asserts that the existing menu route belongs to the target UI layout; omitted values keep the existing parent/default admin layout inheritance. In compatibility mode, if `menuRouteId` is omitted, the old behavior still applies and a top-level menu plus page will be created automatically. Before initialization, do not call page/tab lifecycle actions such as `addTab`, `updateTab`, `moveTab`, `removeTab`, or `destroyPage`."
839
+ "Initializes a modern page (v2) for an existing bindable menu item through `menuRouteId` first, and fills in the default BlockGridModel. Optional `layoutUid` asserts that the existing menu route belongs to the target UI layout. Optional `portalUid` asserts that it belongs to one enabled, role-accessible Multi-portal entry and is mutually exclusive with `layoutUid`. Omitted values preserve the route scope and keep default admin compatibility. In compatibility mode, if `menuRouteId` is omitted, the old behavior still applies and a top-level menu plus page will be created automatically. Before initialization, do not call page/tab lifecycle actions such as `addTab`, `updateTab`, `moveTab`, `removeTab`, or `destroyPage`."
831
840
  ),
832
841
  requestBody: requestBody("FlowSurfaceCreatePageRequest", import_flow_surfaces.flowSurfaceExamples.createPage),
833
842
  responses: responses("FlowSurfaceCreatePageResult")
@@ -4162,16 +4171,72 @@ const schemas = {
4162
4171
  },
4163
4172
  additionalProperties: false
4164
4173
  },
4174
+ FlowSurfaceListNavigationTargetsRequest: {
4175
+ type: "object",
4176
+ properties: {},
4177
+ additionalProperties: false
4178
+ },
4179
+ FlowSurfaceNavigationTargetCapabilities: {
4180
+ type: "object",
4181
+ required: ["multiPortal"],
4182
+ properties: {
4183
+ multiPortal: {
4184
+ type: "boolean",
4185
+ description: "Whether the optional Multi-portal collections and desktop-route relation are available."
4186
+ }
4187
+ },
4188
+ additionalProperties: false
4189
+ },
4190
+ FlowSurfaceNavigationTarget: {
4191
+ type: "object",
4192
+ required: ["kind", "uid", "title", "layoutUid"],
4193
+ properties: {
4194
+ kind: {
4195
+ type: "string",
4196
+ enum: ["layout", "portal"]
4197
+ },
4198
+ uid: {
4199
+ type: "string",
4200
+ description: "Stable target uid used for exact matching. Portal targets use their portal uid."
4201
+ },
4202
+ title: { type: "string" },
4203
+ icon: { type: "string", nullable: true },
4204
+ layoutUid: { type: "string" },
4205
+ layoutType: { type: "string" },
4206
+ routeName: { type: "string" },
4207
+ routePath: { type: "string" },
4208
+ authCheck: { type: "boolean" },
4209
+ default: { type: "boolean" },
4210
+ portalUid: {
4211
+ type: "string",
4212
+ description: "Present only for a custom Multi-portal target."
4213
+ }
4214
+ },
4215
+ additionalProperties: false
4216
+ },
4217
+ FlowSurfaceListNavigationTargetsResult: {
4218
+ type: "object",
4219
+ required: ["version", "capabilities", "targets"],
4220
+ properties: {
4221
+ version: { type: "string", enum: ["1"] },
4222
+ capabilities: ref("FlowSurfaceNavigationTargetCapabilities"),
4223
+ targets: {
4224
+ type: "array",
4225
+ items: ref("FlowSurfaceNavigationTarget")
4226
+ }
4227
+ },
4228
+ additionalProperties: false
4229
+ },
4165
4230
  FlowSurfaceApplyBlueprintNavigationGroup: {
4166
4231
  type: "object",
4167
4232
  properties: {
4168
4233
  routeId: {
4169
4234
  ...STRING_OR_INTEGER_SCHEMA,
4170
- description: "Preferred existing menu-group route id for non-mobile create mode. When present, routeId has the highest priority and title/icon/tooltip/hideInMenu are ignored. Ignored when navigation.layoutUid targets a mobile layout because mobile pages are created as root tabs. applyBlueprint create mode does not mutate existing group metadata; use low-level updateMenu separately when needed."
4235
+ description: "Preferred existing menu-group route id for non-mobile create mode. When present, routeId has the highest priority and title/icon/tooltip/hideInMenu are ignored. Ignored when navigation.layoutUid targets a mobile layout or navigation.portalUid resolves to a mobile-backed portal because mobile pages are created as root tabs. applyBlueprint create mode does not mutate existing group metadata; use low-level updateMenu separately when needed."
4171
4236
  },
4172
4237
  title: {
4173
4238
  type: "string",
4174
- description: "Group title for non-mobile create mode. When `routeId` is omitted, applyBlueprint reuses a same-title group if the match is unique, creates one when no group exists, and rejects ambiguous multi-match cases. Ignored when navigation.layoutUid targets a mobile layout because mobile pages are created as root tabs. If an existing group is reused, group metadata is ignored; use low-level updateMenu to change existing group metadata."
4239
+ description: "Group title for non-mobile create mode. When `routeId` is omitted, applyBlueprint reuses a same-title group if the match is unique, creates one when no group exists, and rejects ambiguous multi-match cases. Ignored when navigation.layoutUid targets a mobile layout or navigation.portalUid resolves to a mobile-backed portal because mobile pages are created as root tabs. If an existing group is reused, group metadata is ignored; use low-level updateMenu to change existing group metadata."
4175
4240
  },
4176
4241
  icon: {
4177
4242
  type: "string",
@@ -4195,6 +4260,10 @@ const schemas = {
4195
4260
  type: "string",
4196
4261
  description: "Optional enabled UI layout uid that scopes create-mode route lookup and newly created routes. Use `mobile-layout-model` for mobile pages; mobile layouts ignore navigation.group and create a root-level tab page. When omitted, the server preserves the existing parent/default admin layout behavior."
4197
4262
  },
4263
+ portalUid: {
4264
+ type: "string",
4265
+ description: "Optional enabled, role-accessible custom Multi-portal uid. Mutually exclusive with layoutUid. The portal backing layout decides desktop vs mobile behavior, and route lookup plus duplicate-page identity are scoped to the portal."
4266
+ },
4198
4267
  group: ref("FlowSurfaceApplyBlueprintNavigationGroup"),
4199
4268
  item: {
4200
4269
  type: "object",
@@ -4586,6 +4655,10 @@ const schemas = {
4586
4655
  type: "string",
4587
4656
  description: "Optional enabled UI layout uid for the created menu route, for example `mobile-layout-model`. When omitted, the route inherits its parent layout or the default admin layout."
4588
4657
  },
4658
+ portalUid: {
4659
+ type: "string",
4660
+ description: "Optional enabled, role-accessible custom Multi-portal uid. Mutually exclusive with layoutUid. When omitted, a portal parent is inherited and root creates keep default Admin behavior."
4661
+ },
4589
4662
  title: {
4590
4663
  type: "string"
4591
4664
  },
@@ -4643,6 +4716,10 @@ const schemas = {
4643
4716
  required: ["menuRouteId"],
4644
4717
  properties: {
4645
4718
  menuRouteId: STRING_OR_INTEGER_SCHEMA,
4719
+ portalUid: {
4720
+ type: "string",
4721
+ description: "Optional custom Multi-portal uid used to assert the route and any new parent are in the same accessible workspace."
4722
+ },
4646
4723
  title: {
4647
4724
  type: "string"
4648
4725
  },
@@ -4686,6 +4763,10 @@ const schemas = {
4686
4763
  type: "string",
4687
4764
  description: "Optional enabled UI layout uid. With `menuRouteId`, the existing route must already belong to this layout. Without `menuRouteId`, the compatibility create-menu fallback creates the route in this layout."
4688
4765
  },
4766
+ portalUid: {
4767
+ type: "string",
4768
+ description: "Optional enabled, role-accessible custom Multi-portal uid. Mutually exclusive with layoutUid. With menuRouteId, the route must already belong to this portal."
4769
+ },
4689
4770
  menuRouteId: STRING_OR_INTEGER_SCHEMA,
4690
4771
  pageSchemaUid: {
4691
4772
  type: "string"
@@ -2604,6 +2604,86 @@ declare const _default: {
2604
2604
  };
2605
2605
  additionalProperties: boolean;
2606
2606
  };
2607
+ FlowSurfaceListNavigationTargetsRequest: {
2608
+ type: string;
2609
+ properties: {};
2610
+ additionalProperties: boolean;
2611
+ };
2612
+ FlowSurfaceNavigationTargetCapabilities: {
2613
+ type: string;
2614
+ required: string[];
2615
+ properties: {
2616
+ multiPortal: {
2617
+ type: string;
2618
+ description: string;
2619
+ };
2620
+ };
2621
+ additionalProperties: boolean;
2622
+ };
2623
+ FlowSurfaceNavigationTarget: {
2624
+ type: string;
2625
+ required: string[];
2626
+ properties: {
2627
+ kind: {
2628
+ type: string;
2629
+ enum: string[];
2630
+ };
2631
+ uid: {
2632
+ type: string;
2633
+ description: string;
2634
+ };
2635
+ title: {
2636
+ type: string;
2637
+ };
2638
+ icon: {
2639
+ type: string;
2640
+ nullable: boolean;
2641
+ };
2642
+ layoutUid: {
2643
+ type: string;
2644
+ };
2645
+ layoutType: {
2646
+ type: string;
2647
+ };
2648
+ routeName: {
2649
+ type: string;
2650
+ };
2651
+ routePath: {
2652
+ type: string;
2653
+ };
2654
+ authCheck: {
2655
+ type: string;
2656
+ };
2657
+ default: {
2658
+ type: string;
2659
+ };
2660
+ portalUid: {
2661
+ type: string;
2662
+ description: string;
2663
+ };
2664
+ };
2665
+ additionalProperties: boolean;
2666
+ };
2667
+ FlowSurfaceListNavigationTargetsResult: {
2668
+ type: string;
2669
+ required: string[];
2670
+ properties: {
2671
+ version: {
2672
+ type: string;
2673
+ enum: string[];
2674
+ };
2675
+ capabilities: {
2676
+ $ref: string;
2677
+ };
2678
+ targets: {
2679
+ type: string;
2680
+ items: {
2681
+ $ref: string;
2682
+ };
2683
+ };
2684
+ };
2685
+ additionalProperties: boolean;
2686
+ };
2607
2687
  FlowSurfaceApplyBlueprintNavigationGroup: {
2608
2688
  type: string;
2609
2689
  properties: {
@@ -2639,6 +2719,10 @@ declare const _default: {
2639
2719
  type: string;
2640
2720
  description: string;
2641
2721
  };
2722
+ portalUid: {
2723
+ type: string;
2724
+ description: string;
2725
+ };
2642
2726
  group: {
2643
2727
  $ref: string;
2644
2728
  };
@@ -3156,6 +3240,10 @@ declare const _default: {
3156
3240
  type: string;
3157
3241
  description: string;
3158
3242
  };
3243
+ portalUid: {
3244
+ type: string;
3245
+ description: string;
3246
+ };
3159
3247
  title: {
3160
3248
  type: string;
3161
3249
  };
@@ -3231,6 +3319,10 @@ declare const _default: {
3231
3319
  type: string;
3232
3320
  }[];
3233
3321
  };
3322
+ portalUid: {
3323
+ type: string;
3324
+ description: string;
3325
+ };
3234
3326
  title: {
3235
3327
  type: string;
3236
3328
  };
@@ -3282,6 +3374,10 @@ declare const _default: {
3282
3374
  type: string;
3283
3375
  description: string;
3284
3376
  };
3377
+ portalUid: {
3378
+ type: string;
3379
+ description: string;
3380
+ };
3285
3381
  menuRouteId: {
3286
3382
  oneOf: {
3287
3383
  type: string;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName.zh-CN": "前端流引擎",
5
5
  "description": "",
6
6
  "description.zh-CN": "",
7
- "version": "2.2.0-beta.9",
7
+ "version": "3.0.0-alpha.1",
8
8
  "main": "./dist/server/index.js",
9
9
  "license": "Apache-2.0",
10
10
  "devDependencies": {
@@ -26,5 +26,5 @@
26
26
  "@nocobase/test": "2.x",
27
27
  "@nocobase/utils": "2.x"
28
28
  },
29
- "gitHead": "60e3d7abbaa0c7cead76f71a4f3d5eedb6b8acdb"
29
+ "gitHead": "22d8be8ece179cfa5c8a4ebb2c896c92bd418e03"
30
30
  }