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

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 (72) 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 +639 -59
  17. package/dist/server/flow-surfaces/blueprint/compile-blocks.js +7 -3
  18. package/dist/server/flow-surfaces/blueprint/compile-plan.js +19 -15
  19. package/dist/server/flow-surfaces/blueprint/export-document.d.ts +50 -0
  20. package/dist/server/flow-surfaces/blueprint/export-document.js +2510 -0
  21. package/dist/server/flow-surfaces/blueprint/normalize-document.js +2 -1
  22. package/dist/server/flow-surfaces/blueprint/public-types.d.ts +1 -0
  23. package/dist/server/flow-surfaces/builder.js +43 -5
  24. package/dist/server/flow-surfaces/catalog.js +13 -2
  25. package/dist/server/flow-surfaces/configure-options.js +5 -3
  26. package/dist/server/flow-surfaces/constants.d.ts +9 -2
  27. package/dist/server/flow-surfaces/constants.js +1 -0
  28. package/dist/server/flow-surfaces/contract-guard.js +37 -5
  29. package/dist/server/flow-surfaces/default-action-popup.d.ts +2 -0
  30. package/dist/server/flow-surfaces/default-action-popup.js +27 -13
  31. package/dist/server/flow-surfaces/filter-group.d.ts +19 -2
  32. package/dist/server/flow-surfaces/filter-group.js +232 -3
  33. package/dist/server/flow-surfaces/planning/compiler.d.ts +1 -0
  34. package/dist/server/flow-surfaces/planning/compiler.js +205 -82
  35. package/dist/server/flow-surfaces/planning/key-registry.d.ts +1 -1
  36. package/dist/server/flow-surfaces/planning/runtime.js +1 -0
  37. package/dist/server/flow-surfaces/planning/step-link.d.ts +1 -1
  38. package/dist/server/flow-surfaces/planning/step-link.js +22 -3
  39. package/dist/server/flow-surfaces/public-data-surface-default-filter.js +0 -9
  40. package/dist/server/flow-surfaces/reaction/field-value.d.ts +9 -0
  41. package/dist/server/flow-surfaces/reaction/field-value.js +51 -2
  42. package/dist/server/flow-surfaces/reaction/linkage.d.ts +6 -1
  43. package/dist/server/flow-surfaces/reaction/linkage.js +18 -3
  44. package/dist/server/flow-surfaces/reaction/meta.js +19 -1
  45. package/dist/server/flow-surfaces/reaction/types.d.ts +19 -0
  46. package/dist/server/flow-surfaces/relation-backing-foreign-key.d.ts +10 -0
  47. package/dist/server/flow-surfaces/relation-backing-foreign-key.js +79 -0
  48. package/dist/server/flow-surfaces/runjs-authoring/ast/source.d.ts +1 -0
  49. package/dist/server/flow-surfaces/runjs-authoring/ast/source.js +20 -0
  50. package/dist/server/flow-surfaces/runjs-authoring/rules.js +0 -2
  51. package/dist/server/flow-surfaces/runjs-authoring/runtime/constants.d.ts +0 -1
  52. package/dist/server/flow-surfaces/runjs-authoring/runtime/constants.js +11 -19
  53. package/dist/server/flow-surfaces/runjs-authoring/runtime/types.d.ts +0 -12
  54. package/dist/server/flow-surfaces/runjs-authoring/scan/filter.js +12 -2
  55. package/dist/server/flow-surfaces/runjs-authoring/scan/index.d.ts +0 -14
  56. package/dist/server/flow-surfaces/runjs-authoring/scan/index.js +10 -8
  57. package/dist/server/flow-surfaces/runjs-authoring/scan/source-patterns.d.ts +0 -14
  58. package/dist/server/flow-surfaces/runjs-authoring/scan/source-patterns.js +18 -73
  59. package/dist/server/flow-surfaces/runjs-authoring/types.d.ts +1 -1
  60. package/dist/server/flow-surfaces/runjs-authoring/validators/index.js +9 -53
  61. package/dist/server/flow-surfaces/service.d.ts +53 -0
  62. package/dist/server/flow-surfaces/service.js +997 -127
  63. package/dist/server/flow-surfaces/types.d.ts +2 -1
  64. package/dist/server/variables/records.js +7 -2
  65. package/dist/server/variables/registry.js +3 -0
  66. package/dist/swagger/flow-surfaces.d.ts +193 -0
  67. package/dist/swagger/flow-surfaces.examples.d.ts +11 -0
  68. package/dist/swagger/flow-surfaces.examples.js +11 -0
  69. package/dist/swagger/flow-surfaces.js +179 -10
  70. package/dist/swagger/index.d.ts +193 -0
  71. package/package.json +2 -2
  72. package/dist/server/flow-surfaces/runjs-authoring/blocked-global-stop/index.js +0 -40
@@ -960,10 +960,14 @@ function resolveApplyBlueprintAssociationContext(input) {
960
960
  }
961
961
  const targetCollection = (0, import_service_helpers.resolveFieldTargetCollection)(field, dataSourceKey, input.getCollection);
962
962
  const targetCollectionName = normalizeMetadataText(input.targetCollectionName) || normalizeMetadataText((0, import_service_helpers.getCollectionName)(targetCollection)) || normalizeMetadataText((0, import_service_helpers.getFieldTarget)(field));
963
+ const resolvedAssociationName = (0, import_service_helpers.resolveAssociationNameFromField)(
964
+ field,
965
+ associationPath.includes(".") ? void 0 : sourceCollection
966
+ );
963
967
  return {
964
968
  dataSourceKey,
965
969
  surfaceCollectionName: targetCollectionName || void 0,
966
- associationName: (associationPath.includes(".") ? `${sourceCollectionName}.${associationPath}` : void 0) || (0, import_service_helpers.resolveAssociationNameFromField)(field, sourceCollection) || `${sourceCollectionName}.${associationPath || associationFieldPath}`
970
+ associationName: resolvedAssociationName || `${sourceCollectionName}.${associationPath || associationFieldPath}`
967
971
  };
968
972
  }
969
973
  function getApplyBlueprintBlockResourceObject(block) {
@@ -1018,7 +1022,7 @@ function resolveApplyBlueprintBlockResourceContext(block, parentContext, getColl
1018
1022
  return {
1019
1023
  dataSourceKey,
1020
1024
  surfaceCollectionName: directCollectionName || (associatedContext == null ? void 0 : associatedContext.surfaceCollectionName) || (parentContext == null ? void 0 : parentContext.surfaceCollectionName),
1021
- associationName: (parentContext == null ? void 0 : parentContext.associationName) || (associatedContext == null ? void 0 : associatedContext.associationName)
1025
+ associationName: (associatedContext == null ? void 0 : associatedContext.associationName) || (parentContext == null ? void 0 : parentContext.associationName)
1022
1026
  };
1023
1027
  }
1024
1028
  return {
@@ -1665,7 +1669,7 @@ function compileField(input, index, scopePrefix, assets, localBlockKeys, context
1665
1669
  hostBlock: popupOptions.hostBlock,
1666
1670
  dataSourceKey: (fieldAssociationContext == null ? void 0 : fieldAssociationContext.dataSourceKey) || popupOptions.dataSourceKey,
1667
1671
  surfaceCollectionName: (fieldAssociationContext == null ? void 0 : fieldAssociationContext.surfaceCollectionName) || popupOptions.surfaceCollectionName,
1668
- associationName: popupOptions.associationName || (fieldAssociationContext == null ? void 0 : fieldAssociationContext.associationName)
1672
+ associationName: (fieldAssociationContext == null ? void 0 : fieldAssociationContext.associationName) || popupOptions.associationName
1669
1673
  });
1670
1674
  settings = resolvePopupTitleSettings(settings, popupResult.popupTitle);
1671
1675
  const popup = shouldAttachDefaultPopupMetadata(popupInput, void 0) ? attachCompiledPopupDefaults(popupResult.popup, popupDefaultsMetadata) : popupResult.popup;
@@ -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 {};