@nocobase/plugin-flow-engine 2.1.0-alpha.20 → 2.1.0-alpha.21

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 (50) hide show
  1. package/dist/externalVersion.js +11 -10
  2. package/dist/node_modules/ses/dist/ses.cjs +1 -1
  3. package/dist/node_modules/ses/package.json +1 -1
  4. package/dist/node_modules/zod/index.cjs +1 -1
  5. package/dist/node_modules/zod/package.json +1 -1
  6. package/dist/server/flow-surfaces/action-scope.d.ts +1 -0
  7. package/dist/server/flow-surfaces/action-scope.js +4 -0
  8. package/dist/server/flow-surfaces/apply/compiler.js +1 -1
  9. package/dist/server/flow-surfaces/approval/builder.js +8 -8
  10. package/dist/server/flow-surfaces/blueprint/compile-blocks.js +192 -29
  11. package/dist/server/flow-surfaces/blueprint/defaults.d.ts +26 -0
  12. package/dist/server/flow-surfaces/blueprint/defaults.js +133 -0
  13. package/dist/server/flow-surfaces/blueprint/index.d.ts +1 -1
  14. package/dist/server/flow-surfaces/blueprint/normalize-document.js +121 -1
  15. package/dist/server/flow-surfaces/blueprint/public-types.d.ts +32 -0
  16. package/dist/server/flow-surfaces/builder.d.ts +2 -2
  17. package/dist/server/flow-surfaces/builder.js +148 -50
  18. package/dist/server/flow-surfaces/catalog.js +276 -34
  19. package/dist/server/flow-surfaces/compose-compiler.d.ts +2 -0
  20. package/dist/server/flow-surfaces/compose-compiler.js +5 -1
  21. package/dist/server/flow-surfaces/configure-options.js +88 -12
  22. package/dist/server/flow-surfaces/contract-guard.js +60 -69
  23. package/dist/server/flow-surfaces/default-action-popup.d.ts +11 -1
  24. package/dist/server/flow-surfaces/default-action-popup.js +72 -12
  25. package/dist/server/flow-surfaces/default-block-actions.js +8 -1
  26. package/dist/server/flow-surfaces/filter-group.d.ts +15 -0
  27. package/dist/server/flow-surfaces/filter-group.js +94 -0
  28. package/dist/server/flow-surfaces/index.js +70 -2
  29. package/dist/server/flow-surfaces/node-use-sets.js +6 -1
  30. package/dist/server/flow-surfaces/placement.js +3 -0
  31. package/dist/server/flow-surfaces/public-data-surface-default-filter.d.ts +20 -0
  32. package/dist/server/flow-surfaces/public-data-surface-default-filter.js +111 -0
  33. package/dist/server/flow-surfaces/reaction/registry.d.ts +7 -0
  34. package/dist/server/flow-surfaces/reaction/registry.js +7 -0
  35. package/dist/server/flow-surfaces/service-utils.d.ts +7 -0
  36. package/dist/server/flow-surfaces/service-utils.js +58 -9
  37. package/dist/server/flow-surfaces/service.d.ts +73 -3
  38. package/dist/server/flow-surfaces/service.js +1794 -162
  39. package/dist/server/flow-surfaces/support-matrix.d.ts +5 -2
  40. package/dist/server/flow-surfaces/support-matrix.js +16 -3
  41. package/dist/server/flow-surfaces/surface-context.js +2 -1
  42. package/dist/server/flow-surfaces/template-display.d.ts +20 -0
  43. package/dist/server/flow-surfaces/template-display.js +289 -0
  44. package/dist/server/flow-surfaces/types.d.ts +1 -0
  45. package/dist/swagger/flow-surfaces.d.ts +160 -0
  46. package/dist/swagger/flow-surfaces.examples.d.ts +117 -11
  47. package/dist/swagger/flow-surfaces.examples.js +152 -1
  48. package/dist/swagger/flow-surfaces.js +141 -21
  49. package/dist/swagger/index.d.ts +160 -0
  50. package/package.json +2 -2
@@ -6,7 +6,7 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- export type FormalFlowSurfaceBlockKey = 'js-block' | 'table' | 'create-form' | 'edit-form' | 'details' | 'filter-form' | 'list' | 'grid-card' | 'markdown' | 'iframe' | 'map' | 'chart' | 'comments' | 'action-panel';
9
+ export type FormalFlowSurfaceBlockKey = 'js-block' | 'table' | 'calendar' | 'create-form' | 'edit-form' | 'details' | 'filter-form' | 'list' | 'grid-card' | 'markdown' | 'iframe' | 'map' | 'chart' | 'comments' | 'action-panel';
10
10
  export type FlowSurfaceBlockSupportEntry = {
11
11
  key: string;
12
12
  formalKey?: FormalFlowSurfaceBlockKey;
@@ -19,8 +19,11 @@ export type FlowSurfaceBlockSupportEntry = {
19
19
  readbackSupported: boolean;
20
20
  createSupported: boolean;
21
21
  };
22
+ export type FormalFlowSurfaceBlockSupportEntry = FlowSurfaceBlockSupportEntry & {
23
+ formalKey: FormalFlowSurfaceBlockKey;
24
+ };
22
25
  export declare const FLOW_SURFACE_BLOCK_SUPPORT_MATRIX: FlowSurfaceBlockSupportEntry[];
23
- export declare const FORMAL_FLOW_SURFACE_BLOCK_SUPPORT_MATRIX: FlowSurfaceBlockSupportEntry[];
26
+ export declare const FORMAL_FLOW_SURFACE_BLOCK_SUPPORT_MATRIX: FormalFlowSurfaceBlockSupportEntry[];
24
27
  export declare const FORMAL_FLOW_SURFACE_BLOCK_KEYS: FormalFlowSurfaceBlockKey[];
25
28
  export declare const FLOW_SURFACE_BLOCK_SUPPORT_BY_KEY: Map<string, FlowSurfaceBlockSupportEntry>;
26
29
  export declare const FLOW_SURFACE_BLOCK_SUPPORT_BY_USE: Map<string, FlowSurfaceBlockSupportEntry>;
@@ -60,6 +60,18 @@ const FLOW_SURFACE_BLOCK_SUPPORT_MATRIX = [
60
60
  readbackSupported: true,
61
61
  createSupported: true
62
62
  },
63
+ {
64
+ key: "calendar",
65
+ formalKey: "calendar",
66
+ label: "Calendar",
67
+ modelUse: "CalendarBlockModel",
68
+ ownerPlugin: "@nocobase/plugin-calendar",
69
+ topLevelAddable: true,
70
+ formalBuiltin: true,
71
+ fixtureCaptured: true,
72
+ readbackSupported: true,
73
+ createSupported: true
74
+ },
63
75
  {
64
76
  key: "createForm",
65
77
  formalKey: "create-form",
@@ -216,9 +228,10 @@ const FLOW_SURFACE_BLOCK_SUPPORT_MATRIX = [
216
228
  createSupported: true
217
229
  }
218
230
  ];
219
- const FORMAL_FLOW_SURFACE_BLOCK_SUPPORT_MATRIX = FLOW_SURFACE_BLOCK_SUPPORT_MATRIX.filter(
220
- (entry) => entry.formalBuiltin
221
- );
231
+ function hasFormalFlowSurfaceBlockKey(entry) {
232
+ return entry.formalBuiltin && !!entry.formalKey;
233
+ }
234
+ const FORMAL_FLOW_SURFACE_BLOCK_SUPPORT_MATRIX = FLOW_SURFACE_BLOCK_SUPPORT_MATRIX.filter(hasFormalFlowSurfaceBlockKey);
222
235
  const FORMAL_FLOW_SURFACE_BLOCK_KEYS = FORMAL_FLOW_SURFACE_BLOCK_SUPPORT_MATRIX.map(
223
236
  (entry) => entry.formalKey
224
237
  );
@@ -47,6 +47,7 @@ var import_approval = require("./approval");
47
47
  var import_placement = require("./placement");
48
48
  const FILTER_TARGET_BLOCK_USES = /* @__PURE__ */ new Set([
49
49
  "TableBlockModel",
50
+ "CalendarBlockModel",
50
51
  "DetailsBlockModel",
51
52
  "ListBlockModel",
52
53
  "GridCardBlockModel",
@@ -330,7 +331,7 @@ class FlowSurfaceContextResolver {
330
331
  var _a;
331
332
  const resolved = await this.locator.resolve(target, { transaction });
332
333
  const node = resolved.node || await this.repository.findModelById(resolved.uid, { transaction, includeAsyncNode: true });
333
- if (["TableBlockModel", "TableActionsColumnModel"].includes(node == null ? void 0 : node.use) || (node == null ? void 0 : node.use) === "ActionPanelBlockModel" || LIST_LIKE_BLOCK_USES.has(node == null ? void 0 : node.use) || LIST_LIKE_ITEM_USES.has(node == null ? void 0 : node.use)) {
334
+ if (["TableBlockModel", "CalendarBlockModel", "TableActionsColumnModel"].includes(node == null ? void 0 : node.use) || (node == null ? void 0 : node.use) === "ActionPanelBlockModel" || LIST_LIKE_BLOCK_USES.has(node == null ? void 0 : node.use) || LIST_LIKE_ITEM_USES.has(node == null ? void 0 : node.use)) {
334
335
  return {
335
336
  parentUid: node.uid,
336
337
  subKey: "actions",
@@ -0,0 +1,20 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import type { Database } from '@nocobase/database';
10
+ import type { FlowSurfaceTemplateRow } from './template-service-utils';
11
+ export type TemplateTranslate = (key: string, options?: Record<string, any>) => string;
12
+ export declare function compileTemplateString(value: any, t?: TemplateTranslate): any;
13
+ export declare function resolveFlowTemplateDisplayRow(db: Database, row: FlowSurfaceTemplateRow, options?: {
14
+ t?: TemplateTranslate;
15
+ transaction?: any;
16
+ }): Promise<FlowSurfaceTemplateRow>;
17
+ export declare function resolveFlowTemplateDisplayRows(db: Database, rows: FlowSurfaceTemplateRow[], options?: {
18
+ t?: TemplateTranslate;
19
+ transaction?: any;
20
+ }): Promise<FlowSurfaceTemplateRow[]>;
@@ -0,0 +1,289 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __create = Object.create;
11
+ var __defProp = Object.defineProperty;
12
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
+ var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __getProtoOf = Object.getPrototypeOf;
15
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
16
+ var __export = (target, all) => {
17
+ for (var name in all)
18
+ __defProp(target, name, { get: all[name], enumerable: true });
19
+ };
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if (from && typeof from === "object" || typeof from === "function") {
22
+ for (let key of __getOwnPropNames(from))
23
+ if (!__hasOwnProp.call(to, key) && key !== except)
24
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
+ // If the importer is in node compatibility mode or this is not an ESM
30
+ // file that has been converted to a CommonJS file using a Babel-
31
+ // compatible transform (i.e. "__esModule" has not been set), then set
32
+ // "default" to the CommonJS "module.exports" for node compatibility.
33
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
+ mod
35
+ ));
36
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
+ var template_display_exports = {};
38
+ __export(template_display_exports, {
39
+ compileTemplateString: () => compileTemplateString,
40
+ resolveFlowTemplateDisplayRow: () => resolveFlowTemplateDisplayRow,
41
+ resolveFlowTemplateDisplayRows: () => resolveFlowTemplateDisplayRows
42
+ });
43
+ module.exports = __toCommonJS(template_display_exports);
44
+ var import_json_schema = require("@formily/json-schema");
45
+ var import_lodash = __toESM(require("lodash"));
46
+ var import_service_helpers = require("./service-helpers");
47
+ var import_service_utils = require("./service-utils");
48
+ const AUTO_GENERATED_SUFFIX = " (Auto generated)";
49
+ const LEGACY_AUTO_POPUP_PREFIX = "Auto popup ";
50
+ const LEGACY_AUTO_POPUP_DESCRIPTION_PREFIX = "Auto-generated popup template ";
51
+ function getFallbackTranslate() {
52
+ return (key, options) => key.replace(/\{\{\s*([^}\s]+)\s*\}\}/g, (_match, name) => {
53
+ const value = options == null ? void 0 : options[name];
54
+ return import_lodash.default.isUndefined(value) || import_lodash.default.isNull(value) ? "" : String(value);
55
+ });
56
+ }
57
+ function extractTranslationKey(tokenContent) {
58
+ var _a;
59
+ const matched = tokenContent.match(/["'`]([^"'`]+)["'`]/);
60
+ return ((_a = matched == null ? void 0 : matched[1]) == null ? void 0 : _a.trim()) || "";
61
+ }
62
+ function sanitizePendingTranslationTokens(value) {
63
+ if (!value.includes("{{")) {
64
+ return value;
65
+ }
66
+ return value.replace(/\{\{\s*t\(([\s\S]*?)\)\s*\}\}/g, (_match, tokenContent) => extractTranslationKey(tokenContent));
67
+ }
68
+ function compileTemplateString(value, t) {
69
+ if (typeof value !== "string" || !value) {
70
+ return value;
71
+ }
72
+ try {
73
+ const compiled = import_json_schema.Schema.compile(value, { t: t || getFallbackTranslate() });
74
+ if (typeof compiled === "string") {
75
+ return sanitizePendingTranslationTokens(compiled).trim();
76
+ }
77
+ return compiled;
78
+ } catch (error) {
79
+ return sanitizePendingTranslationTokens(value).trim();
80
+ }
81
+ }
82
+ function inferPopupDefaultTypeFromTargetTree(node) {
83
+ var _a, _b, _c, _d;
84
+ const popupPage = (0, import_service_utils.getSingleNodeSubModel)((_a = node == null ? void 0 : node.subModels) == null ? void 0 : _a.page);
85
+ const popupTab = import_lodash.default.castArray(((_b = popupPage == null ? void 0 : popupPage.subModels) == null ? void 0 : _b.tabs) || [])[0];
86
+ const popupGrid = (0, import_service_utils.getSingleNodeSubModel)((_c = popupTab == null ? void 0 : popupTab.subModels) == null ? void 0 : _c.grid);
87
+ const popupBlock = (0, import_service_utils.getNodeSubModelList)((_d = popupGrid == null ? void 0 : popupGrid.subModels) == null ? void 0 : _d.items)[0];
88
+ if ((popupBlock == null ? void 0 : popupBlock.use) === "DetailsBlockModel") {
89
+ return "view";
90
+ }
91
+ if ((popupBlock == null ? void 0 : popupBlock.use) === "EditFormModel") {
92
+ return "edit";
93
+ }
94
+ if ((popupBlock == null ? void 0 : popupBlock.use) === "CreateFormModel") {
95
+ return "addNew";
96
+ }
97
+ return "generic";
98
+ }
99
+ function getPopupLabelKey(defaultType) {
100
+ switch (defaultType) {
101
+ case "addNew":
102
+ return "Popup for Add New";
103
+ case "edit":
104
+ return "Popup for Edit";
105
+ case "view":
106
+ return "Popup for Details";
107
+ default:
108
+ return "popup";
109
+ }
110
+ }
111
+ function getAutoGeneratedDisplaySuffix(t) {
112
+ const translate = t || getFallbackTranslate();
113
+ return ` (${translate("Auto generated")})`;
114
+ }
115
+ function isAutoGeneratedPopupTemplateName(name) {
116
+ return name.endsWith(AUTO_GENERATED_SUFFIX) || name.startsWith(LEGACY_AUTO_POPUP_PREFIX);
117
+ }
118
+ function isAutoGeneratedPopupTemplateDescription(description) {
119
+ return description.startsWith(LEGACY_AUTO_POPUP_DESCRIPTION_PREFIX) || description.startsWith("Automatically generated popup template for ");
120
+ }
121
+ function buildAutoGeneratedActionPopupMetadata(input) {
122
+ const translate = input.t || getFallbackTranslate();
123
+ const popupLabel = translate(getPopupLabelKey(input.popupType));
124
+ return {
125
+ name: `${input.collectionLabel} ${popupLabel}${getAutoGeneratedDisplaySuffix(input.t)}`,
126
+ description: translate(
127
+ 'Automatically generated popup template for collection "{{collectionLabel}}" ({{popupLabel}}).',
128
+ {
129
+ collectionLabel: input.collectionLabel,
130
+ popupLabel
131
+ }
132
+ )
133
+ };
134
+ }
135
+ function buildAutoGeneratedAssociationPopupMetadata(input) {
136
+ const translate = input.t || getFallbackTranslate();
137
+ const popupLabel = translate(getPopupLabelKey(input.popupType));
138
+ return {
139
+ name: `${input.sourceCollectionLabel} -> ${input.associationFieldLabel} ${popupLabel}${getAutoGeneratedDisplaySuffix(input.t)}`,
140
+ description: translate(
141
+ 'Automatically generated popup template for relation field "{{associationFieldLabel}}" in collection "{{sourceCollectionLabel}}", targeting "{{targetCollectionLabel}}" ({{popupLabel}}).',
142
+ {
143
+ associationFieldLabel: input.associationFieldLabel,
144
+ sourceCollectionLabel: input.sourceCollectionLabel,
145
+ targetCollectionLabel: input.targetCollectionLabel,
146
+ popupLabel
147
+ }
148
+ )
149
+ };
150
+ }
151
+ async function getTargetTree(db, targetUid, transaction) {
152
+ var _a;
153
+ const normalizedTargetUid = String(targetUid || "").trim();
154
+ if (!normalizedTargetUid) {
155
+ return null;
156
+ }
157
+ const repo = (_a = db.getCollection("flowModels")) == null ? void 0 : _a.repository;
158
+ if (!repo) {
159
+ return null;
160
+ }
161
+ return repo.findModelById(normalizedTargetUid, {
162
+ transaction,
163
+ includeAsyncNode: true
164
+ });
165
+ }
166
+ function getCollection(db, dataSourceKey, collectionName) {
167
+ var _a, _b, _c, _d, _e, _f, _g, _h;
168
+ const normalizedDataSourceKey = dataSourceKey || "main";
169
+ const mainCollection = normalizedDataSourceKey === "main" ? (_a = db.getCollection) == null ? void 0 : _a.call(db, collectionName) : null;
170
+ if (mainCollection) {
171
+ return mainCollection;
172
+ }
173
+ const dataSourceManager = ((_b = db.app) == null ? void 0 : _b.dataSourceManager) || db.dataSourceManager;
174
+ const ds = ((_c = dataSourceManager == null ? void 0 : dataSourceManager.get) == null ? void 0 : _c.call(dataSourceManager, normalizedDataSourceKey)) || ((_e = (_d = dataSourceManager == null ? void 0 : dataSourceManager.dataSources) == null ? void 0 : _d.get) == null ? void 0 : _e.call(_d, normalizedDataSourceKey));
175
+ return ((_g = (_f = ds == null ? void 0 : ds.collectionManager) == null ? void 0 : _f.getCollection) == null ? void 0 : _g.call(_f, collectionName)) || ((_h = db.getCollection) == null ? void 0 : _h.call(db, collectionName));
176
+ }
177
+ function getAssociationField(collection, associationName) {
178
+ var _a;
179
+ const normalized = String(associationName || "").trim();
180
+ if (!normalized) {
181
+ return null;
182
+ }
183
+ const fieldName = normalized.split(".").slice(-1)[0];
184
+ return ((_a = collection == null ? void 0 : collection.getField) == null ? void 0 : _a.call(collection, fieldName)) || null;
185
+ }
186
+ function parseAssociationSource(associationName) {
187
+ const normalized = String(associationName || "").trim();
188
+ if (!normalized || !normalized.includes(".")) {
189
+ return null;
190
+ }
191
+ const parts = normalized.split(".").filter(Boolean);
192
+ if (parts.length < 2) {
193
+ return null;
194
+ }
195
+ return {
196
+ sourceCollectionName: parts[0],
197
+ associationFieldName: parts[parts.length - 1]
198
+ };
199
+ }
200
+ async function buildAutoGeneratedPopupMetadata(db, row, t, transaction) {
201
+ var _a, _b;
202
+ const targetTree = await getTargetTree(db, row.targetUid, transaction);
203
+ const popupType = inferPopupDefaultTypeFromTargetTree(targetTree);
204
+ const dataSourceKey = String(row.dataSourceKey || "main").trim() || "main";
205
+ const collectionName = String(row.collectionName || "").trim();
206
+ const associationName = String(row.associationName || "").trim();
207
+ const collection = getCollection(db, dataSourceKey, collectionName);
208
+ const collectionLabel = String(
209
+ compileTemplateString((0, import_service_helpers.getCollectionTitle)(collection) || collectionName, t) || ""
210
+ ).trim();
211
+ if (associationName) {
212
+ const associationSource = parseAssociationSource(associationName);
213
+ const sourceCollectionName = (associationSource == null ? void 0 : associationSource.sourceCollectionName) || collectionName;
214
+ const sourceCollection = getCollection(db, dataSourceKey, sourceCollectionName) || collection;
215
+ const associationField = getAssociationField(sourceCollection, associationName) || ((_a = sourceCollection == null ? void 0 : sourceCollection.getField) == null ? void 0 : _a.call(sourceCollection, (associationSource == null ? void 0 : associationSource.associationFieldName) || ""));
216
+ const targetCollectionName = String((associationField == null ? void 0 : associationField.target) || ((_b = associationField == null ? void 0 : associationField.options) == null ? void 0 : _b.target) || collectionName || "").trim() || collectionName;
217
+ const targetCollection = getCollection(db, dataSourceKey, targetCollectionName) || collection;
218
+ const sourceCollectionLabel = String(
219
+ compileTemplateString(
220
+ (0, import_service_helpers.getCollectionTitle)(sourceCollection) || (0, import_service_helpers.getCollectionName)(sourceCollection) || sourceCollectionName,
221
+ t
222
+ ) || ""
223
+ ).trim();
224
+ const associationFieldLabel = String(
225
+ compileTemplateString(
226
+ (0, import_service_helpers.getFieldTitle)(associationField) || (0, import_service_helpers.getFieldName)(associationField) || (associationSource == null ? void 0 : associationSource.associationFieldName) || "",
227
+ t
228
+ ) || ""
229
+ ).trim();
230
+ const targetCollectionLabel = String(
231
+ compileTemplateString(
232
+ (0, import_service_helpers.getCollectionTitle)(targetCollection) || (0, import_service_helpers.getCollectionName)(targetCollection) || targetCollectionName,
233
+ t
234
+ ) || ""
235
+ ).trim();
236
+ if (sourceCollectionLabel && associationFieldLabel && targetCollectionLabel) {
237
+ return buildAutoGeneratedAssociationPopupMetadata({
238
+ popupType,
239
+ sourceCollectionLabel,
240
+ associationFieldLabel,
241
+ targetCollectionLabel,
242
+ t
243
+ });
244
+ }
245
+ }
246
+ if (collectionLabel) {
247
+ return buildAutoGeneratedActionPopupMetadata({
248
+ popupType,
249
+ collectionLabel,
250
+ t
251
+ });
252
+ }
253
+ return null;
254
+ }
255
+ async function resolveFlowTemplateDisplayRow(db, row, options = {}) {
256
+ const plainRow = typeof (row == null ? void 0 : row.toJSON) === "function" ? row.toJSON() : row;
257
+ if (!plainRow) {
258
+ return plainRow;
259
+ }
260
+ const t = options.t || getFallbackTranslate();
261
+ const nextRow = {
262
+ ...plainRow,
263
+ name: compileTemplateString(plainRow.name, t),
264
+ description: compileTemplateString(plainRow.description, t)
265
+ };
266
+ const hasAutoGeneratedName = isAutoGeneratedPopupTemplateName(String(nextRow.name || "").trim());
267
+ const hasAutoGeneratedDescription = isAutoGeneratedPopupTemplateDescription(String(nextRow.description || "").trim());
268
+ if (String(nextRow.type || "").trim() !== "popup" || !hasAutoGeneratedName && !hasAutoGeneratedDescription) {
269
+ return nextRow;
270
+ }
271
+ const rewritten = await buildAutoGeneratedPopupMetadata(db, nextRow, t, options.transaction);
272
+ if (!rewritten) {
273
+ return nextRow;
274
+ }
275
+ return {
276
+ ...nextRow,
277
+ name: hasAutoGeneratedName ? rewritten.name : nextRow.name,
278
+ description: hasAutoGeneratedDescription ? rewritten.description : nextRow.description
279
+ };
280
+ }
281
+ async function resolveFlowTemplateDisplayRows(db, rows, options = {}) {
282
+ return Promise.all(rows.map((row) => resolveFlowTemplateDisplayRow(db, row, options)));
283
+ }
284
+ // Annotate the CommonJS export names for ESM import in node:
285
+ 0 && (module.exports = {
286
+ compileTemplateString,
287
+ resolveFlowTemplateDisplayRow,
288
+ resolveFlowTemplateDisplayRows
289
+ });
@@ -58,6 +58,7 @@ export type FlowSurfaceDomainContract = {
58
58
  wildcard?: boolean;
59
59
  mergeStrategy: FlowSurfaceMergeStrategy;
60
60
  schema: Record<string, any>;
61
+ pathSchemas?: Record<string, Record<string, any>>;
61
62
  groups?: Record<string, FlowSurfaceDomainGroupContract>;
62
63
  };
63
64
  export type FlowSurfaceEventCapabilities = {
@@ -563,6 +563,12 @@ declare const _default: {
563
563
  type: string;
564
564
  additionalProperties: boolean;
565
565
  };
566
+ defaultFilter: {
567
+ allOf: {
568
+ $ref: string;
569
+ }[];
570
+ description: string;
571
+ };
566
572
  fields: {
567
573
  type: string;
568
574
  items: {
@@ -2170,6 +2176,12 @@ declare const _default: {
2170
2176
  type: string;
2171
2177
  additionalProperties: boolean;
2172
2178
  };
2179
+ defaultFilter: {
2180
+ allOf: {
2181
+ $ref: string;
2182
+ }[];
2183
+ description: string;
2184
+ };
2173
2185
  fields: {
2174
2186
  type: string;
2175
2187
  items: {
@@ -2326,6 +2338,108 @@ declare const _default: {
2326
2338
  };
2327
2339
  additionalProperties: boolean;
2328
2340
  };
2341
+ FlowSurfaceApplyBlueprintDefaultFieldGroup: {
2342
+ type: string;
2343
+ required: string[];
2344
+ description: string;
2345
+ properties: {
2346
+ key: {
2347
+ type: string;
2348
+ };
2349
+ title: {
2350
+ type: string;
2351
+ };
2352
+ fields: {
2353
+ type: string;
2354
+ minItems: number;
2355
+ items: {
2356
+ type: string;
2357
+ };
2358
+ };
2359
+ };
2360
+ additionalProperties: boolean;
2361
+ };
2362
+ FlowSurfaceApplyBlueprintDefaultPopupName: {
2363
+ type: string;
2364
+ required: string[];
2365
+ description: string;
2366
+ properties: {
2367
+ name: {
2368
+ type: string;
2369
+ };
2370
+ description: {
2371
+ type: string;
2372
+ };
2373
+ };
2374
+ additionalProperties: boolean;
2375
+ };
2376
+ FlowSurfaceApplyBlueprintDefaultPopupActionMap: {
2377
+ type: string;
2378
+ properties: {
2379
+ view: {
2380
+ $ref: string;
2381
+ };
2382
+ addNew: {
2383
+ $ref: string;
2384
+ };
2385
+ edit: {
2386
+ $ref: string;
2387
+ };
2388
+ };
2389
+ additionalProperties: boolean;
2390
+ };
2391
+ FlowSurfaceApplyBlueprintDefaultPopups: {
2392
+ type: string;
2393
+ description: string;
2394
+ properties: {
2395
+ view: {
2396
+ $ref: string;
2397
+ };
2398
+ addNew: {
2399
+ $ref: string;
2400
+ };
2401
+ edit: {
2402
+ $ref: string;
2403
+ };
2404
+ associations: {
2405
+ type: string;
2406
+ additionalProperties: {
2407
+ $ref: string;
2408
+ };
2409
+ };
2410
+ };
2411
+ additionalProperties: boolean;
2412
+ };
2413
+ FlowSurfaceApplyBlueprintDefaultCollection: {
2414
+ type: string;
2415
+ description: string;
2416
+ properties: {
2417
+ fieldGroups: {
2418
+ type: string;
2419
+ minItems: number;
2420
+ items: {
2421
+ $ref: string;
2422
+ };
2423
+ };
2424
+ popups: {
2425
+ $ref: string;
2426
+ };
2427
+ };
2428
+ additionalProperties: boolean;
2429
+ };
2430
+ FlowSurfaceApplyBlueprintDefaults: {
2431
+ type: string;
2432
+ description: string;
2433
+ properties: {
2434
+ collections: {
2435
+ type: string;
2436
+ additionalProperties: {
2437
+ $ref: string;
2438
+ };
2439
+ };
2440
+ };
2441
+ additionalProperties: boolean;
2442
+ };
2329
2443
  FlowSurfaceApplyBlueprintRequest: {
2330
2444
  type: string;
2331
2445
  required: string[];
@@ -2348,6 +2462,9 @@ declare const _default: {
2348
2462
  page: {
2349
2463
  $ref: string;
2350
2464
  };
2465
+ defaults: {
2466
+ $ref: string;
2467
+ };
2351
2468
  tabs: {
2352
2469
  type: string;
2353
2470
  minItems: number;
@@ -3088,6 +3205,15 @@ declare const _default: {
3088
3205
  type: string;
3089
3206
  additionalProperties: boolean;
3090
3207
  };
3208
+ defaultFilter: {
3209
+ allOf: {
3210
+ $ref: string;
3211
+ }[];
3212
+ description: string;
3213
+ };
3214
+ defaultActionSettings: {
3215
+ $ref: string;
3216
+ };
3091
3217
  };
3092
3218
  additionalProperties: boolean;
3093
3219
  };
@@ -3391,6 +3517,15 @@ declare const _default: {
3391
3517
  type: string;
3392
3518
  additionalProperties: boolean;
3393
3519
  };
3520
+ defaultFilter: {
3521
+ allOf: {
3522
+ $ref: string;
3523
+ }[];
3524
+ description: string;
3525
+ };
3526
+ defaultActionSettings: {
3527
+ $ref: string;
3528
+ };
3394
3529
  };
3395
3530
  additionalProperties: boolean;
3396
3531
  };
@@ -4862,6 +4997,31 @@ declare const _default: {
4862
4997
  items: any[];
4863
4998
  };
4864
4999
  };
5000
+ FlowSurfaceDefaultFilterActionSettings: {
5001
+ type: string;
5002
+ properties: {
5003
+ filterableFieldNames: {
5004
+ type: string;
5005
+ items: {
5006
+ type: string;
5007
+ };
5008
+ };
5009
+ defaultFilter: {
5010
+ $ref: string;
5011
+ };
5012
+ };
5013
+ additionalProperties: boolean;
5014
+ };
5015
+ FlowSurfaceDefaultActionSettings: {
5016
+ type: string;
5017
+ description: string;
5018
+ properties: {
5019
+ filter: {
5020
+ $ref: string;
5021
+ };
5022
+ };
5023
+ additionalProperties: boolean;
5024
+ };
4865
5025
  FlowSurfaceEventCapabilities: {
4866
5026
  type: string;
4867
5027
  properties: {