@nocobase/plugin-flow-engine 2.1.0-beta.15 → 2.1.0-beta.16

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 (229) hide show
  1. package/dist/ai/ai-employees/nathan/index.d.ts +10 -0
  2. package/dist/ai/ai-employees/nathan/index.js +41 -0
  3. package/dist/ai/ai-employees/nathan/prompt.md +132 -0
  4. package/dist/ai/ai-employees/nathan/skills/frontend-developer/SKILLS.md +69 -0
  5. package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextApis.js +2 -2
  6. package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextEnvs.js +2 -2
  7. package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextVars.js +2 -2
  8. package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/lintAndTestJS.js +2 -2
  9. package/dist/ai/docs/runjs/context/block-model.md +35 -35
  10. package/dist/ai/docs/runjs/context/collection-field.md +53 -51
  11. package/dist/ai/docs/runjs/context/collection.md +39 -39
  12. package/dist/ai/docs/runjs/context/data-source-manager.md +40 -30
  13. package/dist/ai/docs/runjs/context/data-source.md +52 -44
  14. package/dist/ai/docs/runjs/context/element.md +44 -38
  15. package/dist/ai/docs/runjs/context/exit-all.md +37 -35
  16. package/dist/ai/docs/runjs/context/exit.md +38 -35
  17. package/dist/ai/docs/runjs/context/filter-manager.md +36 -30
  18. package/dist/ai/docs/runjs/context/form.md +57 -57
  19. package/dist/ai/docs/runjs/context/get-model.md +22 -21
  20. package/dist/ai/docs/runjs/context/get-value.md +20 -19
  21. package/dist/ai/docs/runjs/context/get-var.md +61 -55
  22. package/dist/ai/docs/runjs/context/i18n.md +17 -14
  23. package/dist/ai/docs/runjs/context/import-async.md +333 -45
  24. package/dist/ai/docs/runjs/context/init-resource.md +20 -20
  25. package/dist/ai/docs/runjs/context/libs.md +31 -31
  26. package/dist/ai/docs/runjs/context/location.md +34 -31
  27. package/dist/ai/docs/runjs/context/logger.md +41 -40
  28. package/dist/ai/docs/runjs/context/make-resource.md +27 -26
  29. package/dist/ai/docs/runjs/context/message.md +42 -41
  30. package/dist/ai/docs/runjs/context/modal.md +44 -44
  31. package/dist/ai/docs/runjs/context/model.md +36 -33
  32. package/dist/ai/docs/runjs/context/notification.md +41 -40
  33. package/dist/ai/docs/runjs/context/off.md +14 -14
  34. package/dist/ai/docs/runjs/context/on.md +30 -29
  35. package/dist/ai/docs/runjs/context/open-view.md +40 -40
  36. package/dist/ai/docs/runjs/context/render.md +37 -32
  37. package/dist/ai/docs/runjs/context/request.md +46 -45
  38. package/dist/ai/docs/runjs/context/require-async.md +28 -25
  39. package/dist/ai/docs/runjs/context/resource.md +34 -34
  40. package/dist/ai/docs/runjs/context/route.md +36 -34
  41. package/dist/ai/docs/runjs/context/router.md +43 -31
  42. package/dist/ai/docs/runjs/context/set-value.md +18 -17
  43. package/dist/ai/docs/runjs/context/t.md +20 -17
  44. package/dist/ai/docs/runjs/context/view.md +49 -46
  45. package/dist/ai/docs/runjs/document.md +1 -0
  46. package/dist/ai/docs/runjs/import-modules.md +32 -32
  47. package/dist/ai/docs/runjs/index.md +13 -13
  48. package/dist/ai/docs/runjs/jsx.md +19 -19
  49. package/dist/ai/docs/runjs/model/form-block-model.md +1 -3
  50. package/dist/ai/docs/runjs/render.md +15 -15
  51. package/dist/ai/docs/runjs/resource/api-resource.md +53 -53
  52. package/dist/ai/docs/runjs/resource/multi-record-resource.md +64 -64
  53. package/dist/ai/docs/runjs/resource/single-record-resource.md +55 -55
  54. package/dist/ai/docs/runjs/resource/sql-resource.md +57 -57
  55. package/dist/ai/docs/runjs/window.md +5 -5
  56. package/dist/client/index.js +1 -1
  57. package/dist/externalVersion.js +11 -10
  58. package/dist/node_modules/ses/dist/ses.cjs +1 -1
  59. package/dist/node_modules/ses/package.json +1 -1
  60. package/dist/node_modules/zod/index.cjs +1 -1
  61. package/dist/node_modules/zod/package.json +1 -1
  62. package/dist/server/flow-surfaces/action-scope.d.ts +38 -0
  63. package/dist/server/flow-surfaces/action-scope.js +152 -0
  64. package/dist/server/flow-surfaces/apply/compiler.d.ts +13 -0
  65. package/dist/server/flow-surfaces/apply/compiler.js +969 -0
  66. package/dist/server/flow-surfaces/apply/layout.d.ts +34 -0
  67. package/dist/server/flow-surfaces/apply/layout.js +175 -0
  68. package/dist/server/flow-surfaces/apply/matching.d.ts +16 -0
  69. package/dist/server/flow-surfaces/apply/matching.js +181 -0
  70. package/dist/server/flow-surfaces/approval/blueprint-service.d.ts +84 -0
  71. package/dist/server/flow-surfaces/approval/blueprint-service.js +589 -0
  72. package/dist/server/flow-surfaces/approval/blueprint.d.ts +21 -0
  73. package/dist/server/flow-surfaces/approval/blueprint.js +187 -0
  74. package/dist/server/flow-surfaces/approval/builder.d.ts +225 -0
  75. package/dist/server/flow-surfaces/approval/builder.js +384 -0
  76. package/dist/server/flow-surfaces/approval/catalog-specs.d.ts +33 -0
  77. package/dist/server/flow-surfaces/approval/catalog-specs.js +156 -0
  78. package/dist/server/flow-surfaces/approval/index.d.ts +14 -0
  79. package/dist/server/flow-surfaces/approval/index.js +40 -0
  80. package/dist/server/flow-surfaces/approval/runtime-config.d.ts +44 -0
  81. package/dist/server/flow-surfaces/approval/runtime-config.js +299 -0
  82. package/dist/server/flow-surfaces/approval/semantic-use.d.ts +23 -0
  83. package/dist/server/flow-surfaces/approval/semantic-use.js +155 -0
  84. package/dist/server/flow-surfaces/association-title-field.d.ts +20 -0
  85. package/dist/server/flow-surfaces/association-title-field.js +158 -0
  86. package/dist/server/flow-surfaces/blueprint/compile-blocks.d.ts +14 -0
  87. package/dist/server/flow-surfaces/blueprint/compile-blocks.js +1007 -0
  88. package/dist/server/flow-surfaces/blueprint/compile-plan.d.ts +13 -0
  89. package/dist/server/flow-surfaces/blueprint/compile-plan.js +308 -0
  90. package/dist/server/flow-surfaces/blueprint/compile-reaction.d.ts +11 -0
  91. package/dist/server/flow-surfaces/blueprint/compile-reaction.js +72 -0
  92. package/dist/server/flow-surfaces/blueprint/defaults.d.ts +26 -0
  93. package/dist/server/flow-surfaces/blueprint/defaults.js +133 -0
  94. package/dist/server/flow-surfaces/blueprint/index.d.ts +12 -0
  95. package/dist/server/flow-surfaces/blueprint/index.js +44 -0
  96. package/dist/server/flow-surfaces/blueprint/normalize-document.d.ts +10 -0
  97. package/dist/server/flow-surfaces/blueprint/normalize-document.js +416 -0
  98. package/dist/server/flow-surfaces/blueprint/private-utils.d.ts +26 -0
  99. package/dist/server/flow-surfaces/blueprint/private-utils.js +182 -0
  100. package/dist/server/flow-surfaces/blueprint/public-types.d.ts +193 -0
  101. package/dist/server/flow-surfaces/blueprint/public-types.js +24 -0
  102. package/dist/server/flow-surfaces/builder.d.ts +211 -0
  103. package/dist/server/flow-surfaces/builder.js +1029 -0
  104. package/dist/server/flow-surfaces/catalog-smart.d.ts +18 -0
  105. package/dist/server/flow-surfaces/catalog-smart.js +239 -0
  106. package/dist/server/flow-surfaces/catalog-smart.projector.d.ts +15 -0
  107. package/dist/server/flow-surfaces/catalog-smart.projector.js +157 -0
  108. package/dist/server/flow-surfaces/catalog-smart.types.d.ts +99 -0
  109. package/dist/server/flow-surfaces/catalog-smart.types.js +24 -0
  110. package/dist/server/flow-surfaces/catalog.d.ts +78 -0
  111. package/dist/server/flow-surfaces/catalog.js +3496 -0
  112. package/dist/server/flow-surfaces/chart-config.d.ts +121 -0
  113. package/dist/server/flow-surfaces/chart-config.js +1394 -0
  114. package/dist/server/flow-surfaces/compose-compiler.d.ts +108 -0
  115. package/dist/server/flow-surfaces/compose-compiler.js +167 -0
  116. package/dist/server/flow-surfaces/compose-runtime.d.ts +93 -0
  117. package/dist/server/flow-surfaces/compose-runtime.js +375 -0
  118. package/dist/server/flow-surfaces/configure-options.d.ts +23 -0
  119. package/dist/server/flow-surfaces/configure-options.js +827 -0
  120. package/dist/server/flow-surfaces/constants.d.ts +351 -0
  121. package/dist/server/flow-surfaces/constants.js +104 -0
  122. package/dist/server/flow-surfaces/context.d.ts +72 -0
  123. package/dist/server/flow-surfaces/context.js +556 -0
  124. package/dist/server/flow-surfaces/contract-guard.d.ts +19 -0
  125. package/dist/server/flow-surfaces/contract-guard.js +402 -0
  126. package/dist/server/flow-surfaces/default-action-popup.d.ts +63 -0
  127. package/dist/server/flow-surfaces/default-action-popup.js +322 -0
  128. package/dist/server/flow-surfaces/default-block-actions.d.ts +32 -0
  129. package/dist/server/flow-surfaces/default-block-actions.js +185 -0
  130. package/dist/server/flow-surfaces/errors.d.ts +47 -0
  131. package/dist/server/flow-surfaces/errors.js +145 -0
  132. package/dist/server/flow-surfaces/executor.d.ts +23 -0
  133. package/dist/server/flow-surfaces/executor.js +132 -0
  134. package/dist/server/flow-surfaces/field-binding-registry.d.ts +23 -0
  135. package/dist/server/flow-surfaces/field-binding-registry.js +391 -0
  136. package/dist/server/flow-surfaces/field-semantics.d.ts +15 -0
  137. package/dist/server/flow-surfaces/field-semantics.js +81 -0
  138. package/dist/server/flow-surfaces/filter-group.d.ts +15 -0
  139. package/dist/server/flow-surfaces/filter-group.js +94 -0
  140. package/dist/server/flow-surfaces/index.d.ts +11 -0
  141. package/dist/server/flow-surfaces/index.js +243 -0
  142. package/dist/server/flow-surfaces/locator.d.ts +28 -0
  143. package/dist/server/flow-surfaces/locator.js +240 -0
  144. package/dist/server/flow-surfaces/node-use-sets.d.ts +15 -0
  145. package/dist/server/flow-surfaces/node-use-sets.js +131 -0
  146. package/dist/server/flow-surfaces/payload-shape.d.ts +9 -0
  147. package/dist/server/flow-surfaces/payload-shape.js +61 -0
  148. package/dist/server/flow-surfaces/placement.d.ts +33 -0
  149. package/dist/server/flow-surfaces/placement.js +195 -0
  150. package/dist/server/flow-surfaces/planning/action-specs.d.ts +179 -0
  151. package/dist/server/flow-surfaces/planning/action-specs.js +190 -0
  152. package/dist/server/flow-surfaces/planning/compiler.d.ts +37 -0
  153. package/dist/server/flow-surfaces/planning/compiler.js +376 -0
  154. package/dist/server/flow-surfaces/planning/context.d.ts +30 -0
  155. package/dist/server/flow-surfaces/planning/context.js +139 -0
  156. package/dist/server/flow-surfaces/planning/created-keys.d.ts +34 -0
  157. package/dist/server/flow-surfaces/planning/created-keys.js +375 -0
  158. package/dist/server/flow-surfaces/planning/key-kind.d.ts +11 -0
  159. package/dist/server/flow-surfaces/planning/key-kind.js +88 -0
  160. package/dist/server/flow-surfaces/planning/key-persistence.d.ts +34 -0
  161. package/dist/server/flow-surfaces/planning/key-persistence.js +148 -0
  162. package/dist/server/flow-surfaces/planning/key-registry.d.ts +40 -0
  163. package/dist/server/flow-surfaces/planning/key-registry.js +206 -0
  164. package/dist/server/flow-surfaces/planning/runtime.d.ts +37 -0
  165. package/dist/server/flow-surfaces/planning/runtime.js +259 -0
  166. package/dist/server/flow-surfaces/planning/step-link.d.ts +14 -0
  167. package/dist/server/flow-surfaces/planning/step-link.js +104 -0
  168. package/dist/server/flow-surfaces/planning/types.d.ts +55 -0
  169. package/dist/server/flow-surfaces/planning/types.js +24 -0
  170. package/dist/server/flow-surfaces/public-data-surface-default-filter.d.ts +20 -0
  171. package/dist/server/flow-surfaces/public-data-surface-default-filter.js +111 -0
  172. package/dist/server/flow-surfaces/reaction/errors.d.ts +20 -0
  173. package/dist/server/flow-surfaces/reaction/errors.js +69 -0
  174. package/dist/server/flow-surfaces/reaction/field-value.d.ts +34 -0
  175. package/dist/server/flow-surfaces/reaction/field-value.js +181 -0
  176. package/dist/server/flow-surfaces/reaction/fingerprint.d.ts +16 -0
  177. package/dist/server/flow-surfaces/reaction/fingerprint.js +71 -0
  178. package/dist/server/flow-surfaces/reaction/linkage.d.ts +136 -0
  179. package/dist/server/flow-surfaces/reaction/linkage.js +882 -0
  180. package/dist/server/flow-surfaces/reaction/meta.d.ts +11 -0
  181. package/dist/server/flow-surfaces/reaction/meta.js +451 -0
  182. package/dist/server/flow-surfaces/reaction/registry.d.ts +156 -0
  183. package/dist/server/flow-surfaces/reaction/registry.js +206 -0
  184. package/dist/server/flow-surfaces/reaction/resolver.d.ts +22 -0
  185. package/dist/server/flow-surfaces/reaction/resolver.js +202 -0
  186. package/dist/server/flow-surfaces/reaction/types.d.ts +241 -0
  187. package/dist/server/flow-surfaces/reaction/types.js +24 -0
  188. package/dist/server/flow-surfaces/reaction/utils.d.ts +17 -0
  189. package/dist/server/flow-surfaces/reaction/utils.js +67 -0
  190. package/dist/server/flow-surfaces/reaction/value-expr.d.ts +15 -0
  191. package/dist/server/flow-surfaces/reaction/value-expr.js +209 -0
  192. package/dist/server/flow-surfaces/reference-guards.d.ts +19 -0
  193. package/dist/server/flow-surfaces/reference-guards.js +103 -0
  194. package/dist/server/flow-surfaces/route-sync.d.ts +47 -0
  195. package/dist/server/flow-surfaces/route-sync.js +392 -0
  196. package/dist/server/flow-surfaces/service-helpers.d.ts +42 -0
  197. package/dist/server/flow-surfaces/service-helpers.js +377 -0
  198. package/dist/server/flow-surfaces/service-utils.d.ts +108 -0
  199. package/dist/server/flow-surfaces/service-utils.js +811 -0
  200. package/dist/server/flow-surfaces/service.d.ts +773 -0
  201. package/dist/server/flow-surfaces/service.js +13008 -0
  202. package/dist/server/flow-surfaces/support-matrix.d.ts +31 -0
  203. package/dist/server/flow-surfaces/support-matrix.js +259 -0
  204. package/dist/server/flow-surfaces/surface-context.d.ts +52 -0
  205. package/dist/server/flow-surfaces/surface-context.js +437 -0
  206. package/dist/server/flow-surfaces/template-compatibility.d.ts +42 -0
  207. package/dist/server/flow-surfaces/template-compatibility.js +189 -0
  208. package/dist/server/flow-surfaces/template-display.d.ts +20 -0
  209. package/dist/server/flow-surfaces/template-display.js +289 -0
  210. package/dist/server/flow-surfaces/template-service-utils.d.ts +62 -0
  211. package/dist/server/flow-surfaces/template-service-utils.js +281 -0
  212. package/dist/server/flow-surfaces/types.d.ts +288 -0
  213. package/dist/server/flow-surfaces/types.js +24 -0
  214. package/dist/server/plugin.js +2 -0
  215. package/dist/swagger/flow-surfaces.d.ts +5964 -0
  216. package/dist/swagger/flow-surfaces.examples.d.ts +1533 -0
  217. package/dist/swagger/flow-surfaces.examples.js +1758 -0
  218. package/dist/swagger/flow-surfaces.js +5315 -0
  219. package/dist/swagger/flow-surfaces.template-action-docs.d.ts +62 -0
  220. package/dist/swagger/flow-surfaces.template-action-docs.js +121 -0
  221. package/dist/swagger/flow-surfaces.template-schemas.d.ts +239 -0
  222. package/dist/swagger/flow-surfaces.template-schemas.js +255 -0
  223. package/dist/swagger/index.d.ts +5969 -0
  224. package/dist/swagger/index.js +50 -0
  225. package/package.json +2 -2
  226. /package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextApis.d.ts +0 -0
  227. /package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextEnvs.d.ts +0 -0
  228. /package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextVars.d.ts +0 -0
  229. /package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/lintAndTestJS.d.ts +0 -0
@@ -0,0 +1,243 @@
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 __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var flow_surfaces_exports = {};
28
+ __export(flow_surfaces_exports, {
29
+ registerFlowSurfacesResource: () => registerFlowSurfacesResource
30
+ });
31
+ module.exports = __toCommonJS(flow_surfaces_exports);
32
+ var import_resourcer = require("@nocobase/resourcer");
33
+ var import_constants = require("./constants");
34
+ var import_errors = require("./errors");
35
+ var import_service = require("./service");
36
+ const FLOW_ENGINE_LOCALE_NAMESPACE = "flow-engine";
37
+ const FLOW_SURFACE_LOCALE_FALLBACK_NAMESPACES = [
38
+ FLOW_ENGINE_LOCALE_NAMESPACE,
39
+ "@nocobase/flow-engine",
40
+ "@nocobase/plugin-flow-engine",
41
+ "client"
42
+ ];
43
+ const FLOW_SURFACE_LOCAL_TRANSLATIONS = {
44
+ "zh-CN": {
45
+ "Popup for Add New": "\u65B0\u589E\u5F39\u7A97",
46
+ "Popup for Edit": "\u7F16\u8F91\u5F39\u7A97",
47
+ "Popup for Details": "\u8BE6\u60C5\u5F39\u7A97",
48
+ "Auto generated": "\u81EA\u52A8\u751F\u6210",
49
+ 'Automatically generated popup template for collection "{{collectionLabel}}" ({{popupLabel}}).': "\u4E3A\u6570\u636E\u8868\u201C{{collectionLabel}}\u201D\u81EA\u52A8\u751F\u6210\u7684\u5F39\u7A97\u6A21\u677F\uFF08{{popupLabel}}\uFF09\u3002",
50
+ 'Automatically generated popup template for relation field "{{associationFieldLabel}}" in collection "{{sourceCollectionLabel}}", targeting "{{targetCollectionLabel}}" ({{popupLabel}}).': "\u4E3A\u6570\u636E\u8868\u201C{{sourceCollectionLabel}}\u201D\u4E2D\u7684\u5173\u7CFB\u5B57\u6BB5\u201C{{associationFieldLabel}}\u201D\u81EA\u52A8\u751F\u6210\u7684\u5F39\u7A97\u6A21\u677F\uFF0C\u76EE\u6807\u6570\u636E\u8868\u4E3A\u201C{{targetCollectionLabel}}\u201D\uFF08{{popupLabel}}\uFF09\u3002"
51
+ }
52
+ };
53
+ function getValues(ctx) {
54
+ var _a, _b, _c;
55
+ return ((_b = (_a = ctx.action) == null ? void 0 : _a.params) == null ? void 0 : _b.values) ?? ((_c = ctx.action) == null ? void 0 : _c.params) ?? {};
56
+ }
57
+ function isImplicitEmptyValuesBag(value) {
58
+ return !!value && typeof value === "object" && !Array.isArray(value) && Object.getPrototypeOf(value) === Object.prototype && Object.keys(value).length === 0;
59
+ }
60
+ function getRawReadQuery(ctx) {
61
+ var _a;
62
+ const querystring = String(((_a = ctx.request) == null ? void 0 : _a.querystring) ?? "");
63
+ if (!querystring) {
64
+ return {};
65
+ }
66
+ try {
67
+ return (0, import_resourcer.parseQuery)(querystring) || {};
68
+ } catch {
69
+ return {};
70
+ }
71
+ }
72
+ function hasExplicitQueryWrapper(ctx, key) {
73
+ const query = getRawReadQuery(ctx);
74
+ return Object.prototype.hasOwnProperty.call(query, key);
75
+ }
76
+ function hasExplicitRequestBody(ctx) {
77
+ var _a;
78
+ const headers = ((_a = ctx.request) == null ? void 0 : _a.headers) ?? {};
79
+ const contentLength = headers["content-length"];
80
+ if (Array.isArray(contentLength)) {
81
+ return contentLength.some((value) => value !== "0");
82
+ }
83
+ if (typeof contentLength === "string") {
84
+ return contentLength !== "0";
85
+ }
86
+ return Boolean(headers["transfer-encoding"]);
87
+ }
88
+ function getReadValues(ctx) {
89
+ var _a, _b, _c;
90
+ if (((_b = (_a = ctx.request) == null ? void 0 : _a.method) == null ? void 0 : _b.toUpperCase()) !== "GET") {
91
+ (0, import_errors.throwBadRequest)(
92
+ `flowSurfaces:get only supports GET with root query locator fields like /api/flowSurfaces:get?uid=...`
93
+ );
94
+ }
95
+ if (hasExplicitQueryWrapper(ctx, "target")) {
96
+ (0, import_errors.throwBadRequest)(`flowSurfaces:get only accepts root locator fields; do not wrap them in 'target'`);
97
+ }
98
+ if (hasExplicitQueryWrapper(ctx, "values")) {
99
+ (0, import_errors.throwBadRequest)(`flowSurfaces:get only accepts root locator fields; do not wrap them in 'values'`);
100
+ }
101
+ const params = ((_c = ctx.action) == null ? void 0 : _c.params) ?? {};
102
+ if (!Object.prototype.hasOwnProperty.call(params, "values")) {
103
+ return params;
104
+ }
105
+ const values = params.values;
106
+ if (typeof values !== "undefined" && !isImplicitEmptyValuesBag(values)) {
107
+ return params;
108
+ }
109
+ if (hasExplicitRequestBody(ctx)) {
110
+ return params;
111
+ }
112
+ const { values: _values, ...rest } = params;
113
+ return rest;
114
+ }
115
+ function writeFlowSurfaceErrorResponse(ctx, error) {
116
+ const normalized = (0, import_errors.normalizeFlowSurfaceError)(error);
117
+ ctx.withoutDataWrapping = true;
118
+ ctx.type = "application/json";
119
+ ctx.status = normalized.status;
120
+ ctx.body = normalized.toResponseBody();
121
+ }
122
+ function isAclPermissionDeniedForFlowSurfaces(ctx, error) {
123
+ var _a, _b;
124
+ const resourceName = ((_a = ctx.action) == null ? void 0 : _a.resourceName) ?? ((_b = ctx.permission) == null ? void 0 : _b.resourceName);
125
+ return resourceName === "flowSurfaces" && (error == null ? void 0 : error.status) === 403 && (error == null ? void 0 : error.message) === "No permissions";
126
+ }
127
+ function toFlowSurfaceForbiddenError(error) {
128
+ const message = error instanceof Error ? error.message : String(error);
129
+ return new import_errors.FlowSurfaceForbiddenError(message);
130
+ }
131
+ async function runFlowSurfaceAclErrorWrapper(ctx, next) {
132
+ try {
133
+ await next();
134
+ } catch (error) {
135
+ if (!isAclPermissionDeniedForFlowSurfaces(ctx, error)) {
136
+ throw error;
137
+ }
138
+ writeFlowSurfaceErrorResponse(ctx, toFlowSurfaceForbiddenError(error));
139
+ }
140
+ }
141
+ async function runFlowSurfaceAction(ctx, next, handler) {
142
+ try {
143
+ ctx.body = await handler();
144
+ await next();
145
+ } catch (error) {
146
+ writeFlowSurfaceErrorResponse(ctx, error);
147
+ await next();
148
+ }
149
+ }
150
+ function invokeFlowSurfaceServiceAction(service, actionName, values, options = {}) {
151
+ const handler = service[actionName];
152
+ return handler.call(service, values, options);
153
+ }
154
+ function interpolateTranslation(value, options) {
155
+ return value.replace(/\{\{\s*([^}\s]+)\s*\}\}/g, (_match, name) => {
156
+ const replacement = options == null ? void 0 : options[name];
157
+ return replacement === null || typeof replacement === "undefined" ? "" : String(replacement);
158
+ });
159
+ }
160
+ function getResourceTranslation(ctx, key, options) {
161
+ var _a, _b, _c, _d;
162
+ const locale = ((_a = ctx.getCurrentLocale) == null ? void 0 : _a.call(ctx)) || ((_b = ctx.i18n) == null ? void 0 : _b.language);
163
+ const i18n = (_c = ctx.app) == null ? void 0 : _c.i18n;
164
+ if (!locale || !i18n) {
165
+ return void 0;
166
+ }
167
+ for (const ns of FLOW_SURFACE_LOCALE_FALLBACK_NAMESPACES) {
168
+ const value = (_d = i18n.getResource) == null ? void 0 : _d.call(i18n, locale, ns, key);
169
+ if (typeof value === "string") {
170
+ return interpolateTranslation(value, options);
171
+ }
172
+ }
173
+ return void 0;
174
+ }
175
+ function getLocalTranslation(ctx, key, options) {
176
+ var _a, _b;
177
+ const locale = String(((_a = ctx.getCurrentLocale) == null ? void 0 : _a.call(ctx)) || ((_b = ctx.i18n) == null ? void 0 : _b.language) || "").trim();
178
+ const resources = FLOW_SURFACE_LOCAL_TRANSLATIONS[locale];
179
+ const value = resources == null ? void 0 : resources[key];
180
+ return typeof value === "string" ? interpolateTranslation(value, options) : void 0;
181
+ }
182
+ function getFlowSurfaceTranslate(ctx) {
183
+ var _a, _b, _c;
184
+ const translate = ((_b = (_a = ctx.i18n) == null ? void 0 : _a.t) == null ? void 0 : _b.bind(ctx.i18n)) || ((_c = ctx.t) == null ? void 0 : _c.bind(ctx));
185
+ if (typeof translate !== "function") {
186
+ return void 0;
187
+ }
188
+ return (key, options) => {
189
+ const resourceValue = getResourceTranslation(ctx, key, options);
190
+ if (typeof resourceValue === "string") {
191
+ return resourceValue;
192
+ }
193
+ const localValue = getLocalTranslation(ctx, key, options);
194
+ if (typeof localValue === "string") {
195
+ return localValue;
196
+ }
197
+ return translate(key, {
198
+ ns: [FLOW_ENGINE_LOCALE_NAMESPACE, "client"],
199
+ nsMode: "fallback",
200
+ ...options || {}
201
+ });
202
+ };
203
+ }
204
+ function registerFlowSurfacesResource(plugin) {
205
+ const service = new import_service.FlowSurfacesService(plugin);
206
+ const actions = Object.fromEntries(
207
+ import_constants.FLOW_SURFACES_ACTION_NAMES.map((actionName) => [
208
+ actionName,
209
+ async (ctx, next) => {
210
+ await runFlowSurfaceAction(ctx, next, async () => {
211
+ const definition = import_constants.FLOW_SURFACE_ACTION_DEFINITIONS[actionName];
212
+ const values = definition.valueSource === "read" ? getReadValues(ctx) : getValues(ctx);
213
+ const t = getFlowSurfaceTranslate(ctx);
214
+ if (definition.transaction) {
215
+ return service.transaction(
216
+ (transaction) => invokeFlowSurfaceServiceAction(service, actionName, values, { transaction, t })
217
+ );
218
+ }
219
+ return invokeFlowSurfaceServiceAction(service, actionName, values, { t });
220
+ });
221
+ }
222
+ ])
223
+ );
224
+ plugin.app.acl.registerSnippet({
225
+ name: "ui.flowSurfaces",
226
+ actions: ["flowSurfaces:*"]
227
+ });
228
+ plugin.app.acl.allow("flowSurfaces", [...import_constants.FLOW_SURFACES_READ_ACTION_NAMES], "loggedIn");
229
+ plugin.app.acl.use(runFlowSurfaceAclErrorWrapper, {
230
+ tag: "flow-surfaces-acl-errors",
231
+ after: "allow-manager",
232
+ before: "core"
233
+ });
234
+ plugin.app.resourceManager.define({
235
+ name: "flowSurfaces",
236
+ actions
237
+ });
238
+ return service;
239
+ }
240
+ // Annotate the CommonJS export names for ESM import in node:
241
+ 0 && (module.exports = {
242
+ registerFlowSurfacesResource
243
+ });
@@ -0,0 +1,28 @@
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 FlowModelRepository from '../repository';
10
+ import type { FlowSurfaceResolveTarget, FlowSurfaceResolvedTarget } from './types';
11
+ export declare class SurfaceLocator {
12
+ private readonly db;
13
+ private readonly repository;
14
+ constructor(db: any, repository: FlowModelRepository);
15
+ resolve(target: FlowSurfaceResolveTarget, options?: {
16
+ transaction?: any;
17
+ }): Promise<FlowSurfaceResolvedTarget>;
18
+ findParentUid(uid: string, transaction?: any): Promise<any>;
19
+ findRouteBySchemaUid(schemaUid: string, transaction?: any): Promise<any>;
20
+ resolveCollectionContext(uid: string, transaction?: any): Promise<{
21
+ ownerUid: string;
22
+ model: any;
23
+ resourceInit: any;
24
+ }>;
25
+ private resolveByUid;
26
+ private resolvePageSchemaUid;
27
+ private findPageRouteFromModel;
28
+ }
@@ -0,0 +1,240 @@
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 locator_exports = {};
38
+ __export(locator_exports, {
39
+ SurfaceLocator: () => SurfaceLocator
40
+ });
41
+ module.exports = __toCommonJS(locator_exports);
42
+ var import_lodash = __toESM(require("lodash"));
43
+ var import_approval = require("./approval");
44
+ var import_chart_config = require("./chart-config");
45
+ var import_errors = require("./errors");
46
+ class SurfaceLocator {
47
+ constructor(db, repository) {
48
+ this.db = db;
49
+ this.repository = repository;
50
+ }
51
+ async resolve(target, options = {}) {
52
+ var _a;
53
+ const transaction = options.transaction;
54
+ if (target.uid) {
55
+ return this.resolveByUid(target.uid, target, transaction);
56
+ }
57
+ if ("tabSchemaUid" in target && target.tabSchemaUid) {
58
+ return this.resolveByUid(target.tabSchemaUid, target, transaction);
59
+ }
60
+ if ("pageSchemaUid" in target && target.pageSchemaUid) {
61
+ return this.resolvePageSchemaUid(target.pageSchemaUid, target, transaction);
62
+ }
63
+ if ("routeId" in target && target.routeId) {
64
+ const route = await this.db.getRepository("desktopRoutes").findOne({
65
+ filterByTk: String(target.routeId),
66
+ transaction
67
+ });
68
+ if (isPageRoute(route)) {
69
+ return this.resolvePageSchemaUid(route.get("schemaUid"), target, transaction);
70
+ }
71
+ if ((_a = route == null ? void 0 : route.get) == null ? void 0 : _a.call(route, "schemaUid")) {
72
+ return this.resolveByUid(route.get("schemaUid"), target, transaction);
73
+ }
74
+ }
75
+ throw new import_errors.FlowSurfaceBadRequestError("flowSurfaces target not found");
76
+ }
77
+ async findParentUid(uid, transaction) {
78
+ var _a;
79
+ const parentPath = await this.db.getRepository("flowModelTreePath").findOne({
80
+ filter: {
81
+ descendant: uid,
82
+ depth: 1
83
+ },
84
+ transaction
85
+ });
86
+ return ((_a = parentPath == null ? void 0 : parentPath.get) == null ? void 0 : _a.call(parentPath, "ancestor")) || null;
87
+ }
88
+ async findRouteBySchemaUid(schemaUid, transaction) {
89
+ return this.db.getRepository("desktopRoutes").findOne({
90
+ filter: {
91
+ schemaUid
92
+ },
93
+ transaction
94
+ });
95
+ }
96
+ async resolveCollectionContext(uid, transaction) {
97
+ let cursor = uid;
98
+ while (cursor) {
99
+ const model = await this.repository.findModelById(cursor, { transaction, includeAsyncNode: true });
100
+ const resourceInit = import_lodash.default.get(model, ["stepParams", "resourceSettings", "init"]) || import_lodash.default.get(model, ["stepParams", "TriggerChildPageSettings", "init"]) || import_lodash.default.get(model, ["stepParams", "ApprovalChildPageSettings", "init"]) || ((model == null ? void 0 : model.use) === "ChartBlockModel" ? (0, import_chart_config.getChartBuilderResourceInit)(import_lodash.default.get(model, ["stepParams", "chartSettings", "configure"])) : null);
101
+ if ((resourceInit == null ? void 0 : resourceInit.dataSourceKey) && (resourceInit == null ? void 0 : resourceInit.collectionName)) {
102
+ return {
103
+ ownerUid: cursor,
104
+ model,
105
+ resourceInit
106
+ };
107
+ }
108
+ const fieldInit = import_lodash.default.get(model, ["stepParams", "fieldSettings", "init"]);
109
+ if ((fieldInit == null ? void 0 : fieldInit.dataSourceKey) && (fieldInit == null ? void 0 : fieldInit.collectionName)) {
110
+ return {
111
+ ownerUid: cursor,
112
+ model,
113
+ resourceInit: {
114
+ dataSourceKey: fieldInit.dataSourceKey,
115
+ collectionName: fieldInit.collectionName,
116
+ associationPathName: fieldInit.associationPathName
117
+ }
118
+ };
119
+ }
120
+ cursor = await this.findParentUid(cursor, transaction);
121
+ }
122
+ return null;
123
+ }
124
+ async resolveByUid(uid, target, transaction) {
125
+ var _a, _b, _c, _d, _e;
126
+ const node = await this.repository.findModelById(uid, { transaction, includeAsyncNode: true });
127
+ const route = await this.findRouteBySchemaUid(uid, transaction);
128
+ if (!(node == null ? void 0 : node.uid) && !route) {
129
+ throw new import_errors.FlowSurfaceBadRequestError(`flowSurfaces uid '${uid}' not found`);
130
+ }
131
+ let pageRoute = null;
132
+ let tabRoute = null;
133
+ if (((_a = route == null ? void 0 : route.get) == null ? void 0 : _a.call(route, "type")) === "tabs") {
134
+ tabRoute = route;
135
+ pageRoute = route.get("parentId") ? await this.db.getRepository("desktopRoutes").findOne({
136
+ filterByTk: String(route.get("parentId")),
137
+ transaction
138
+ }) : null;
139
+ } else if (((_b = route == null ? void 0 : route.get) == null ? void 0 : _b.call(route, "type")) === "flowPage" || ((_c = route == null ? void 0 : route.get) == null ? void 0 : _c.call(route, "type")) === "page") {
140
+ pageRoute = route;
141
+ } else if (node == null ? void 0 : node.uid) {
142
+ pageRoute = await this.findPageRouteFromModel(node.uid, transaction).catch(() => {
143
+ return null;
144
+ }) || null;
145
+ tabRoute = await this.findRouteBySchemaUid(node.uid, transaction);
146
+ if (((_d = tabRoute == null ? void 0 : tabRoute.get) == null ? void 0 : _d.call(tabRoute, "type")) !== "tabs") {
147
+ tabRoute = null;
148
+ }
149
+ }
150
+ return {
151
+ target,
152
+ uid: (node == null ? void 0 : node.uid) || uid,
153
+ kind: ((_e = tabRoute == null ? void 0 : tabRoute.get) == null ? void 0 : _e.call(tabRoute, "type")) === "tabs" ? "tab" : isPageRoute(pageRoute) ? "page" : inferKind(node == null ? void 0 : node.use),
154
+ node,
155
+ route,
156
+ pageRoute,
157
+ tabRoute
158
+ };
159
+ }
160
+ async resolvePageSchemaUid(pageSchemaUid, target, transaction) {
161
+ var _a;
162
+ const pageModel = await this.repository.findModelByParentId(pageSchemaUid, {
163
+ transaction,
164
+ subKey: "page",
165
+ includeAsyncNode: true
166
+ });
167
+ const route = await this.db.getRepository("desktopRoutes").findOne({
168
+ filter: {
169
+ schemaUid: pageSchemaUid
170
+ },
171
+ transaction
172
+ });
173
+ if (pageModel == null ? void 0 : pageModel.uid) {
174
+ return {
175
+ target,
176
+ uid: pageModel.uid,
177
+ kind: "page",
178
+ node: pageModel,
179
+ route,
180
+ pageRoute: route,
181
+ pageModel
182
+ };
183
+ }
184
+ if ((_a = route == null ? void 0 : route.get) == null ? void 0 : _a.call(route, "schemaUid")) {
185
+ return {
186
+ target,
187
+ uid: route.get("schemaUid"),
188
+ kind: "page",
189
+ route,
190
+ pageRoute: route,
191
+ pageModel
192
+ };
193
+ }
194
+ throw new import_errors.FlowSurfaceBadRequestError("flowSurfaces target not found");
195
+ }
196
+ async findPageRouteFromModel(uid, transaction) {
197
+ var _a, _b;
198
+ let cursor = uid;
199
+ while (cursor) {
200
+ const route = await this.findRouteBySchemaUid(cursor, transaction);
201
+ if (((_a = route == null ? void 0 : route.get) == null ? void 0 : _a.call(route, "type")) === "flowPage" || ((_b = route == null ? void 0 : route.get) == null ? void 0 : _b.call(route, "type")) === "page") {
202
+ return route;
203
+ }
204
+ const parentUid = await this.findParentUid(cursor, transaction);
205
+ if (!parentUid) {
206
+ return null;
207
+ }
208
+ cursor = parentUid;
209
+ }
210
+ return null;
211
+ }
212
+ }
213
+ function inferKind(use) {
214
+ const normalized = (0, import_approval.normalizeApprovalSemanticUse)(use);
215
+ if (normalized === "RouteModel") {
216
+ return "node";
217
+ }
218
+ if (normalized === "RootPageModel" || normalized === "ChildPageModel") {
219
+ return "page";
220
+ }
221
+ if (normalized === "RootPageTabModel" || normalized === "ChildPageTabModel") {
222
+ return "tab";
223
+ }
224
+ if (/GridModel$/.test(normalized || "")) {
225
+ return "grid";
226
+ }
227
+ if (/BlockModel$/.test(normalized || "")) {
228
+ return "block";
229
+ }
230
+ return "node";
231
+ }
232
+ function isPageRoute(route) {
233
+ var _a;
234
+ const type = ((_a = route == null ? void 0 : route.get) == null ? void 0 : _a.call(route, "type")) || (route == null ? void 0 : route.type);
235
+ return type === "flowPage" || type === "page";
236
+ }
237
+ // Annotate the CommonJS export names for ESM import in node:
238
+ 0 && (module.exports = {
239
+ SurfaceLocator
240
+ });
@@ -0,0 +1,15 @@
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
+ export declare const COLLECTION_BLOCK_USES: Set<string>;
10
+ export declare const STATIC_CONTENT_BLOCK_USES: Set<string>;
11
+ export declare const FIELD_WRAPPER_USES: Set<string>;
12
+ export declare const CREATABLE_STANDALONE_FIELD_USES: Set<string>;
13
+ export declare const STANDALONE_FIELD_NODE_USES: Set<string>;
14
+ export declare const ACTION_BUTTON_USES: Set<string>;
15
+ export declare const JS_BLOCK_USES: Set<string>;
@@ -0,0 +1,131 @@
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 __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var node_use_sets_exports = {};
28
+ __export(node_use_sets_exports, {
29
+ ACTION_BUTTON_USES: () => ACTION_BUTTON_USES,
30
+ COLLECTION_BLOCK_USES: () => COLLECTION_BLOCK_USES,
31
+ CREATABLE_STANDALONE_FIELD_USES: () => CREATABLE_STANDALONE_FIELD_USES,
32
+ FIELD_WRAPPER_USES: () => FIELD_WRAPPER_USES,
33
+ JS_BLOCK_USES: () => JS_BLOCK_USES,
34
+ STANDALONE_FIELD_NODE_USES: () => STANDALONE_FIELD_NODE_USES,
35
+ STATIC_CONTENT_BLOCK_USES: () => STATIC_CONTENT_BLOCK_USES
36
+ });
37
+ module.exports = __toCommonJS(node_use_sets_exports);
38
+ var import_approval = require("./approval");
39
+ const COLLECTION_BLOCK_USES = /* @__PURE__ */ new Set([
40
+ "TableBlockModel",
41
+ "CalendarBlockModel",
42
+ "CreateFormModel",
43
+ "EditFormModel",
44
+ "FormBlockModel",
45
+ "DetailsBlockModel",
46
+ "FilterFormBlockModel",
47
+ "ListBlockModel",
48
+ "GridCardBlockModel",
49
+ "MapBlockModel",
50
+ "CommentsBlockModel",
51
+ ...import_approval.APPROVAL_FORM_BLOCK_USES,
52
+ ...import_approval.APPROVAL_DETAILS_BLOCK_USES
53
+ ]);
54
+ const STATIC_CONTENT_BLOCK_USES = /* @__PURE__ */ new Set([
55
+ "MarkdownBlockModel",
56
+ "IframeBlockModel",
57
+ "ChartBlockModel",
58
+ "ActionPanelBlockModel",
59
+ "JSBlockModel"
60
+ ]);
61
+ const FIELD_WRAPPER_USES = /* @__PURE__ */ new Set([
62
+ "FormItemModel",
63
+ "FormAssociationItemModel",
64
+ "DetailsItemModel",
65
+ "FilterFormItemModel",
66
+ "TableColumnModel",
67
+ ...import_approval.APPROVAL_FIELD_WRAPPER_USES
68
+ ]);
69
+ const CREATABLE_STANDALONE_FIELD_USES = /* @__PURE__ */ new Set(["JSColumnModel", "JSItemModel", "DividerItemModel"]);
70
+ const STANDALONE_FIELD_NODE_USES = /* @__PURE__ */ new Set([...CREATABLE_STANDALONE_FIELD_USES, "FormJSFieldItemModel"]);
71
+ const ACTION_BUTTON_USES = /* @__PURE__ */ new Set([
72
+ "AddNewActionModel",
73
+ "ViewActionModel",
74
+ "EditActionModel",
75
+ "PopupCollectionActionModel",
76
+ "DeleteActionModel",
77
+ "BulkDeleteActionModel",
78
+ "BulkEditActionModel",
79
+ "UpdateRecordActionModel",
80
+ "BulkUpdateActionModel",
81
+ "DuplicateActionModel",
82
+ "AddChildActionModel",
83
+ "FilterActionModel",
84
+ "ExpandCollapseActionModel",
85
+ "FormSubmitActionModel",
86
+ "FilterFormSubmitActionModel",
87
+ "FilterFormResetActionModel",
88
+ "FilterFormCollapseActionModel",
89
+ "RefreshActionModel",
90
+ "LinkActionModel",
91
+ "ExportActionModel",
92
+ "ExportAttachmentActionModel",
93
+ "ImportActionModel",
94
+ "UploadActionModel",
95
+ "TemplatePrintCollectionActionModel",
96
+ "TemplatePrintRecordActionModel",
97
+ "CollectionTriggerWorkflowActionModel",
98
+ "RecordTriggerWorkflowActionModel",
99
+ "FormTriggerWorkflowActionModel",
100
+ "WorkbenchTriggerWorkflowActionModel",
101
+ "MailSendActionModel",
102
+ "JSCollectionActionModel",
103
+ "JSRecordActionModel",
104
+ "JSFormActionModel",
105
+ "JSItemActionModel",
106
+ "FilterFormJSActionModel",
107
+ "JSActionModel",
108
+ "CalendarTodayActionModel",
109
+ "CalendarNavActionModel",
110
+ "CalendarTitleActionModel",
111
+ "CalendarViewSelectActionModel",
112
+ "ApplyFormSubmitModel",
113
+ "ApplyFormSaveDraftModel",
114
+ "ApplyFormWithdrawModel",
115
+ "ProcessFormApproveModel",
116
+ "ProcessFormRejectModel",
117
+ "ProcessFormReturnModel",
118
+ "ProcessFormDelegateModel",
119
+ "ProcessFormAddAssigneeModel"
120
+ ]);
121
+ const JS_BLOCK_USES = /* @__PURE__ */ new Set(["JSBlockModel"]);
122
+ // Annotate the CommonJS export names for ESM import in node:
123
+ 0 && (module.exports = {
124
+ ACTION_BUTTON_USES,
125
+ COLLECTION_BLOCK_USES,
126
+ CREATABLE_STANDALONE_FIELD_USES,
127
+ FIELD_WRAPPER_USES,
128
+ JS_BLOCK_USES,
129
+ STANDALONE_FIELD_NODE_USES,
130
+ STATIC_CONTENT_BLOCK_USES
131
+ });
@@ -0,0 +1,9 @@
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
+ export declare function validateFlowSurfacePayloadShape(actionName: string, value: any, path: string): void;