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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/client/index.js +1 -1
  2. package/dist/externalVersion.js +9 -9
  3. package/dist/locale/en-US.json +1 -0
  4. package/dist/locale/index.d.ts +2 -0
  5. package/dist/locale/zh-CN.json +1 -0
  6. package/dist/node_modules/@ant-design/icons-svg/package.json +1 -1
  7. package/dist/node_modules/acorn/package.json +1 -1
  8. package/dist/node_modules/acorn-jsx/package.json +1 -1
  9. package/dist/node_modules/acorn-walk/package.json +1 -1
  10. package/dist/node_modules/ses/package.json +1 -1
  11. package/dist/node_modules/zod/package.json +1 -1
  12. package/dist/server/flow-surfaces/{runjs-authoring/blocked-global-stop/index.d.ts → approval/authoring-validation.d.ts} +1 -2
  13. package/dist/server/flow-surfaces/approval/authoring-validation.js +1151 -0
  14. package/dist/server/flow-surfaces/approval/blueprint-service.js +2 -0
  15. package/dist/server/flow-surfaces/authoring-validation.d.ts +2 -1
  16. package/dist/server/flow-surfaces/authoring-validation.js +495 -57
  17. package/dist/server/flow-surfaces/blueprint/compile-plan.js +19 -15
  18. package/dist/server/flow-surfaces/blueprint/export-document.d.ts +50 -0
  19. package/dist/server/flow-surfaces/blueprint/export-document.js +2510 -0
  20. package/dist/server/flow-surfaces/blueprint/normalize-document.js +2 -1
  21. package/dist/server/flow-surfaces/blueprint/public-types.d.ts +1 -0
  22. package/dist/server/flow-surfaces/builder.js +40 -5
  23. package/dist/server/flow-surfaces/catalog.js +13 -2
  24. package/dist/server/flow-surfaces/configure-options.js +5 -3
  25. package/dist/server/flow-surfaces/constants.d.ts +9 -2
  26. package/dist/server/flow-surfaces/constants.js +1 -0
  27. package/dist/server/flow-surfaces/contract-guard.js +24 -2
  28. package/dist/server/flow-surfaces/default-action-popup.d.ts +2 -0
  29. package/dist/server/flow-surfaces/default-action-popup.js +27 -13
  30. package/dist/server/flow-surfaces/filter-group.d.ts +19 -2
  31. package/dist/server/flow-surfaces/filter-group.js +232 -3
  32. package/dist/server/flow-surfaces/planning/compiler.d.ts +1 -0
  33. package/dist/server/flow-surfaces/planning/compiler.js +205 -82
  34. package/dist/server/flow-surfaces/planning/key-registry.d.ts +1 -1
  35. package/dist/server/flow-surfaces/planning/runtime.js +1 -0
  36. package/dist/server/flow-surfaces/planning/step-link.d.ts +1 -1
  37. package/dist/server/flow-surfaces/planning/step-link.js +22 -3
  38. package/dist/server/flow-surfaces/public-data-surface-default-filter.js +0 -9
  39. package/dist/server/flow-surfaces/reaction/field-value.d.ts +9 -0
  40. package/dist/server/flow-surfaces/reaction/field-value.js +51 -2
  41. package/dist/server/flow-surfaces/reaction/linkage.d.ts +6 -1
  42. package/dist/server/flow-surfaces/reaction/linkage.js +18 -3
  43. package/dist/server/flow-surfaces/reaction/meta.js +19 -1
  44. package/dist/server/flow-surfaces/reaction/types.d.ts +19 -0
  45. package/dist/server/flow-surfaces/relation-backing-foreign-key.d.ts +10 -0
  46. package/dist/server/flow-surfaces/relation-backing-foreign-key.js +79 -0
  47. package/dist/server/flow-surfaces/runjs-authoring/ast/source.d.ts +1 -0
  48. package/dist/server/flow-surfaces/runjs-authoring/ast/source.js +20 -0
  49. package/dist/server/flow-surfaces/runjs-authoring/rules.js +0 -2
  50. package/dist/server/flow-surfaces/runjs-authoring/runtime/constants.d.ts +0 -1
  51. package/dist/server/flow-surfaces/runjs-authoring/runtime/constants.js +11 -19
  52. package/dist/server/flow-surfaces/runjs-authoring/runtime/types.d.ts +0 -12
  53. package/dist/server/flow-surfaces/runjs-authoring/scan/filter.js +12 -2
  54. package/dist/server/flow-surfaces/runjs-authoring/scan/index.d.ts +0 -14
  55. package/dist/server/flow-surfaces/runjs-authoring/scan/index.js +10 -8
  56. package/dist/server/flow-surfaces/runjs-authoring/scan/source-patterns.d.ts +0 -14
  57. package/dist/server/flow-surfaces/runjs-authoring/scan/source-patterns.js +18 -73
  58. package/dist/server/flow-surfaces/runjs-authoring/types.d.ts +1 -1
  59. package/dist/server/flow-surfaces/runjs-authoring/validators/index.js +9 -53
  60. package/dist/server/flow-surfaces/service.d.ts +53 -0
  61. package/dist/server/flow-surfaces/service.js +990 -122
  62. package/dist/server/flow-surfaces/types.d.ts +2 -1
  63. package/dist/server/variables/registry.js +3 -0
  64. package/dist/swagger/flow-surfaces.d.ts +193 -0
  65. package/dist/swagger/flow-surfaces.examples.d.ts +11 -0
  66. package/dist/swagger/flow-surfaces.examples.js +11 -0
  67. package/dist/swagger/flow-surfaces.js +179 -10
  68. package/dist/swagger/index.d.ts +193 -0
  69. package/package.json +2 -2
  70. package/dist/server/flow-surfaces/runjs-authoring/blocked-global-stop/index.js +0 -40
@@ -83,19 +83,21 @@ function buildTabSelectorFromUid(uid) {
83
83
  };
84
84
  }
85
85
  function compileCreatePlan(document, getCollection) {
86
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B;
86
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C;
87
87
  const steps = [];
88
88
  const chrome = buildPageChrome(document);
89
- if (import_lodash.default.isPlainObject((_a = document.navigation) == null ? void 0 : _a.group) && import_lodash.default.isUndefined(document.navigation.group.routeId)) {
89
+ const layoutUid = (_a = document.navigation) == null ? void 0 : _a.layoutUid;
90
+ if (import_lodash.default.isPlainObject((_b = document.navigation) == null ? void 0 : _b.group) && import_lodash.default.isUndefined(document.navigation.group.routeId)) {
90
91
  steps.push({
91
92
  id: CREATE_MENU_GROUP_STEP_ID,
92
93
  action: "createMenu",
93
94
  values: (0, import_service_utils.buildDefinedPayload)({
94
- title: (_c = (_b = document.navigation) == null ? void 0 : _b.group) == null ? void 0 : _c.title,
95
+ layoutUid,
96
+ title: (_d = (_c = document.navigation) == null ? void 0 : _c.group) == null ? void 0 : _d.title,
95
97
  type: "group",
96
- icon: (_e = (_d = document.navigation) == null ? void 0 : _d.group) == null ? void 0 : _e.icon,
97
- tooltip: (_g = (_f = document.navigation) == null ? void 0 : _f.group) == null ? void 0 : _g.tooltip,
98
- hideInMenu: (_i = (_h = document.navigation) == null ? void 0 : _h.group) == null ? void 0 : _i.hideInMenu
98
+ icon: (_f = (_e = document.navigation) == null ? void 0 : _e.group) == null ? void 0 : _f.icon,
99
+ tooltip: (_h = (_g = document.navigation) == null ? void 0 : _g.group) == null ? void 0 : _h.tooltip,
100
+ hideInMenu: (_j = (_i = document.navigation) == null ? void 0 : _i.group) == null ? void 0 : _j.hideInMenu
99
101
  })
100
102
  });
101
103
  }
@@ -103,25 +105,27 @@ function compileCreatePlan(document, getCollection) {
103
105
  id: CREATE_MENU_ITEM_STEP_ID,
104
106
  action: "createMenu",
105
107
  values: (0, import_service_utils.buildDefinedPayload)({
106
- title: ((_k = (_j = document.navigation) == null ? void 0 : _j.item) == null ? void 0 : _k.title) || chrome.pageTitle,
108
+ layoutUid,
109
+ title: ((_l = (_k = document.navigation) == null ? void 0 : _k.item) == null ? void 0 : _l.title) || chrome.pageTitle,
107
110
  type: "item",
108
- icon: ((_m = (_l = document.navigation) == null ? void 0 : _l.item) == null ? void 0 : _m.icon) || ((_n = document.page) == null ? void 0 : _n.icon) || "FileOutlined",
109
- tooltip: (_p = (_o = document.navigation) == null ? void 0 : _o.item) == null ? void 0 : _p.tooltip,
110
- hideInMenu: (_r = (_q = document.navigation) == null ? void 0 : _q.item) == null ? void 0 : _r.hideInMenu,
111
- parentMenuRouteId: import_lodash.default.isUndefined((_t = (_s = document.navigation) == null ? void 0 : _s.group) == null ? void 0 : _t.routeId) ? ((_v = (_u = document.navigation) == null ? void 0 : _u.group) == null ? void 0 : _v.title) ? { step: CREATE_MENU_GROUP_STEP_ID, path: "routeId" } : void 0 : (_x = (_w = document.navigation) == null ? void 0 : _w.group) == null ? void 0 : _x.routeId
111
+ icon: ((_n = (_m = document.navigation) == null ? void 0 : _m.item) == null ? void 0 : _n.icon) || ((_o = document.page) == null ? void 0 : _o.icon) || "FileOutlined",
112
+ tooltip: (_q = (_p = document.navigation) == null ? void 0 : _p.item) == null ? void 0 : _q.tooltip,
113
+ hideInMenu: (_s = (_r = document.navigation) == null ? void 0 : _r.item) == null ? void 0 : _s.hideInMenu,
114
+ parentMenuRouteId: import_lodash.default.isUndefined((_u = (_t = document.navigation) == null ? void 0 : _t.group) == null ? void 0 : _u.routeId) ? ((_w = (_v = document.navigation) == null ? void 0 : _v.group) == null ? void 0 : _w.title) ? { step: CREATE_MENU_GROUP_STEP_ID, path: "routeId" } : void 0 : (_y = (_x = document.navigation) == null ? void 0 : _x.group) == null ? void 0 : _y.routeId
112
115
  })
113
116
  });
114
117
  steps.push({
115
118
  id: CREATE_PAGE_STEP_ID,
116
119
  action: "createPage",
117
120
  values: (0, import_service_utils.buildDefinedPayload)({
121
+ layoutUid,
118
122
  menuRouteId: { step: CREATE_MENU_ITEM_STEP_ID, path: "routeId" },
119
123
  title: chrome.pageTitle,
120
- icon: (_y = document.page) == null ? void 0 : _y.icon,
121
- documentTitle: (_z = document.page) == null ? void 0 : _z.documentTitle,
122
- enableHeader: (_A = document.page) == null ? void 0 : _A.enableHeader,
124
+ icon: (_z = document.page) == null ? void 0 : _z.icon,
125
+ documentTitle: (_A = document.page) == null ? void 0 : _A.documentTitle,
126
+ enableHeader: (_B = document.page) == null ? void 0 : _B.enableHeader,
123
127
  enableTabs: chrome.enableTabs,
124
- displayTitle: (_B = document.page) == null ? void 0 : _B.displayTitle,
128
+ displayTitle: (_C = document.page) == null ? void 0 : _C.displayTitle,
125
129
  tabTitle: chrome.tabTitle,
126
130
  tabIcon: chrome.tabIcon,
127
131
  tabDocumentTitle: chrome.tabDocumentTitle,
@@ -0,0 +1,50 @@
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 { FlowSurfaceApplyBlueprintDocument } from './public-types';
10
+ export type FlowSurfaceExportBlueprintUnsupportedPolicy = 'error' | 'warn';
11
+ export type FlowSurfaceExportBlueprintUnsupportedItem = {
12
+ kind: 'page' | 'tab' | 'block' | 'field' | 'action' | 'recordAction' | 'reaction' | 'layout' | 'popup';
13
+ use?: string;
14
+ type?: string;
15
+ path: string;
16
+ reasonCode: string;
17
+ manualAction: string;
18
+ };
19
+ export type FlowSurfaceExportBlueprintResult = {
20
+ document: FlowSurfaceApplyBlueprintDocument;
21
+ source: {
22
+ target: {
23
+ pageSchemaUid: string;
24
+ };
25
+ pageTitle?: string;
26
+ };
27
+ warnings: string[];
28
+ unsupported: FlowSurfaceExportBlueprintUnsupportedItem[];
29
+ };
30
+ type FlowSurfaceExportNode = Record<string, unknown> & {
31
+ uid?: string;
32
+ use?: string;
33
+ props?: Record<string, unknown>;
34
+ decoratorProps?: Record<string, unknown>;
35
+ stepParams?: Record<string, unknown>;
36
+ flowRegistry?: Record<string, unknown>;
37
+ template?: Record<string, unknown>;
38
+ fieldsTemplate?: Record<string, unknown>;
39
+ popup?: Record<string, unknown>;
40
+ subModels?: Record<string, unknown>;
41
+ };
42
+ export declare function exportFlowSurfaceBlueprintDocument(input: {
43
+ page: FlowSurfaceExportNode;
44
+ pageRoute?: Record<string, unknown>;
45
+ target: {
46
+ pageSchemaUid: string;
47
+ };
48
+ unsupportedPolicy?: FlowSurfaceExportBlueprintUnsupportedPolicy;
49
+ }): FlowSurfaceExportBlueprintResult;
50
+ export {};