@nocobase/plugin-flow-engine 2.1.0-alpha.30 → 2.1.0-alpha.32

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.
@@ -8,16 +8,16 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "2.1.0-alpha.30",
11
+ "@nocobase/client": "2.1.0-alpha.32",
12
12
  "lodash": "4.18.1",
13
- "@nocobase/database": "2.1.0-alpha.30",
14
- "@nocobase/data-source-manager": "2.1.0-alpha.30",
15
- "@nocobase/resourcer": "2.1.0-alpha.30",
16
- "@nocobase/utils": "2.1.0-alpha.30",
17
- "@nocobase/cache": "2.1.0-alpha.30",
18
- "@nocobase/plugin-localization": "2.1.0-alpha.30",
19
- "@nocobase/server": "2.1.0-alpha.30",
20
- "@nocobase/actions": "2.1.0-alpha.30",
13
+ "@nocobase/database": "2.1.0-alpha.32",
14
+ "@nocobase/data-source-manager": "2.1.0-alpha.32",
15
+ "@nocobase/resourcer": "2.1.0-alpha.32",
16
+ "@nocobase/utils": "2.1.0-alpha.32",
17
+ "@nocobase/cache": "2.1.0-alpha.32",
18
+ "@nocobase/plugin-localization": "2.1.0-alpha.32",
19
+ "@nocobase/server": "2.1.0-alpha.32",
20
+ "@nocobase/actions": "2.1.0-alpha.32",
21
21
  "@formily/json-schema": "2.3.7",
22
- "@nocobase/ai": "2.1.0-alpha.30"
22
+ "@nocobase/ai": "2.1.0-alpha.32"
23
23
  };
@@ -1 +1 @@
1
- {"name":"ses","version":"1.14.0","description":"Hardened JavaScript for Fearless Cooperation","keywords":["lockdown","harden","Compartment","assert","security","confinement","isolation","object capabilities","ocaps","secure execution","third-party code","prototype pollution","supply-chain attack","plugin"],"author":"Agoric","license":"Apache-2.0","homepage":"https://github.com/Agoric/SES-shim/tree/master/packages/ses#readme","repository":{"type":"git","url":"git+https://github.com/endojs/endo.git","directory":"packages/ses"},"bugs":{"url":"https://github.com/endojs/endo/issues"},"type":"module","main":"./dist/ses.cjs","module":"./index.js","unpkg":"./dist/ses.umd.js","types":"./types.d.ts","exports":{".":{"import":{"types":"./types.d.ts","xs":"./src-xs/index.js","default":"./index.js"},"require":{"types":"./dist/types.d.cts","default":"./dist/ses.cjs"}},"./lockdown":{"import":{"types":"./types.d.ts","default":"./index.js"},"require":{"types":"./dist/types.d.cts","default":"./dist/ses.cjs"}},"./hermes":{"require":{"types":"./dist/types.d.cts","default":"./dist/ses-hermes.cjs"}},"./tools.js":"./tools.js","./assert-shim.js":"./assert-shim.js","./lockdown-shim.js":{"xs":"./src-xs/lockdown-shim.js","default":"./lockdown-shim.js"},"./compartment-shim.js":{"xs":"./src-xs/compartment-shim.js","default":"./compartment-shim.js"},"./console-shim.js":"./console-shim.js","./package.json":"./package.json"},"scripts":{"build:vanilla":"node scripts/bundle.js","build:hermes":"node scripts/bundle.js hermes","build":"yarn build:vanilla && yarn build:hermes","clean":"rm -rf dist","cover":"c8 ava","demo":"python3 -m http.server","lint":"yarn lint:types && yarn lint:eslint","lint-fix":"eslint --fix .","lint:eslint":"eslint .","lint:types":"tsc","prepare":"npm run clean && npm run build","qt":"ava","test":"tsd && ava","test:hermes":"./scripts/hermes-test.sh","test:xs":"xst dist/ses.umd.js test/_lockdown-safe.js && node scripts/generate-test-xs.js && xst tmp/test-xs.js && rm -rf tmp","postpack":"git clean -fX \"*.d.ts*\" \"*.d.cts*\" \"*.d.mts*\" \"*.tsbuildinfo\""},"dependencies":{"@endo/cache-map":"^1.1.0","@endo/env-options":"^1.1.11","@endo/immutable-arraybuffer":"^1.1.2"},"devDependencies":{"@babel/generator":"^7.26.3","@babel/parser":"~7.26.2","@babel/traverse":"~7.25.9","@babel/types":"~7.26.0","@endo/compartment-mapper":"^1.6.3","@endo/module-source":"^1.3.3","@endo/test262-runner":"^0.1.48","@types/babel__traverse":"^7.20.5","ava":"^6.1.3","babel-eslint":"^10.1.0","c8":"^7.14.0","core-js":"^3.31.0","eslint":"^8.57.1","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^9.1.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-import":"^2.31.0","hermes-engine-cli":"^0.12.0","prettier":"^3.5.3","terser":"^5.16.6","tsd":"^0.31.2","typescript":"~5.8.3"},"files":["./*.d.ts","./*.js","./*.map","LICENSE*","SECURITY*","dist","lib","src","tools"],"publishConfig":{"access":"public"},"eslintConfig":{"extends":["plugin:@endo/ses"]},"ava":{"files":["test/**/*.test.*"],"timeout":"2m"},"typeCoverage":{"atLeast":81.17},"gitHead":"9815aea9541f241389d2135c6097a7442bdffa17","_lastModified":"2026-05-06T11:13:43.577Z"}
1
+ {"name":"ses","version":"1.14.0","description":"Hardened JavaScript for Fearless Cooperation","keywords":["lockdown","harden","Compartment","assert","security","confinement","isolation","object capabilities","ocaps","secure execution","third-party code","prototype pollution","supply-chain attack","plugin"],"author":"Agoric","license":"Apache-2.0","homepage":"https://github.com/Agoric/SES-shim/tree/master/packages/ses#readme","repository":{"type":"git","url":"git+https://github.com/endojs/endo.git","directory":"packages/ses"},"bugs":{"url":"https://github.com/endojs/endo/issues"},"type":"module","main":"./dist/ses.cjs","module":"./index.js","unpkg":"./dist/ses.umd.js","types":"./types.d.ts","exports":{".":{"import":{"types":"./types.d.ts","xs":"./src-xs/index.js","default":"./index.js"},"require":{"types":"./dist/types.d.cts","default":"./dist/ses.cjs"}},"./lockdown":{"import":{"types":"./types.d.ts","default":"./index.js"},"require":{"types":"./dist/types.d.cts","default":"./dist/ses.cjs"}},"./hermes":{"require":{"types":"./dist/types.d.cts","default":"./dist/ses-hermes.cjs"}},"./tools.js":"./tools.js","./assert-shim.js":"./assert-shim.js","./lockdown-shim.js":{"xs":"./src-xs/lockdown-shim.js","default":"./lockdown-shim.js"},"./compartment-shim.js":{"xs":"./src-xs/compartment-shim.js","default":"./compartment-shim.js"},"./console-shim.js":"./console-shim.js","./package.json":"./package.json"},"scripts":{"build:vanilla":"node scripts/bundle.js","build:hermes":"node scripts/bundle.js hermes","build":"yarn build:vanilla && yarn build:hermes","clean":"rm -rf dist","cover":"c8 ava","demo":"python3 -m http.server","lint":"yarn lint:types && yarn lint:eslint","lint-fix":"eslint --fix .","lint:eslint":"eslint .","lint:types":"tsc","prepare":"npm run clean && npm run build","qt":"ava","test":"tsd && ava","test:hermes":"./scripts/hermes-test.sh","test:xs":"xst dist/ses.umd.js test/_lockdown-safe.js && node scripts/generate-test-xs.js && xst tmp/test-xs.js && rm -rf tmp","postpack":"git clean -fX \"*.d.ts*\" \"*.d.cts*\" \"*.d.mts*\" \"*.tsbuildinfo\""},"dependencies":{"@endo/cache-map":"^1.1.0","@endo/env-options":"^1.1.11","@endo/immutable-arraybuffer":"^1.1.2"},"devDependencies":{"@babel/generator":"^7.26.3","@babel/parser":"~7.26.2","@babel/traverse":"~7.25.9","@babel/types":"~7.26.0","@endo/compartment-mapper":"^1.6.3","@endo/module-source":"^1.3.3","@endo/test262-runner":"^0.1.48","@types/babel__traverse":"^7.20.5","ava":"^6.1.3","babel-eslint":"^10.1.0","c8":"^7.14.0","core-js":"^3.31.0","eslint":"^8.57.1","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^9.1.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-import":"^2.31.0","hermes-engine-cli":"^0.12.0","prettier":"^3.5.3","terser":"^5.16.6","tsd":"^0.31.2","typescript":"~5.8.3"},"files":["./*.d.ts","./*.js","./*.map","LICENSE*","SECURITY*","dist","lib","src","tools"],"publishConfig":{"access":"public"},"eslintConfig":{"extends":["plugin:@endo/ses"]},"ava":{"files":["test/**/*.test.*"],"timeout":"2m"},"typeCoverage":{"atLeast":81.17},"gitHead":"9815aea9541f241389d2135c6097a7442bdffa17","_lastModified":"2026-05-10T15:49:28.968Z"}
@@ -1 +1 @@
1
- {"name":"zod","version":"4.3.5","type":"module","license":"MIT","author":"Colin McDonnell <zod@colinhacks.com>","description":"TypeScript-first schema declaration and validation library with static type inference","homepage":"https://zod.dev","llms":"https://zod.dev/llms.txt","llmsFull":"https://zod.dev/llms-full.txt","mcpServer":"https://mcp.inkeep.com/zod/mcp","funding":"https://github.com/sponsors/colinhacks","sideEffects":false,"files":["src","**/*.js","**/*.mjs","**/*.cjs","**/*.d.ts","**/*.d.mts","**/*.d.cts","**/package.json"],"keywords":["typescript","schema","validation","type","inference"],"main":"./index.cjs","types":"./index.d.cts","module":"./index.js","zshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts","./mini":"./src/mini/index.ts","./locales":"./src/locales/index.ts","./v3":"./src/v3/index.ts","./v4":"./src/v4/index.ts","./v4-mini":"./src/v4-mini/index.ts","./v4/mini":"./src/v4/mini/index.ts","./v4/core":"./src/v4/core/index.ts","./v4/locales":"./src/v4/locales/index.ts","./v4/locales/*":"./src/v4/locales/*"},"conditions":{"@zod/source":"src"}},"exports":{"./package.json":"./package.json",".":{"@zod/source":"./src/index.ts","types":"./index.d.cts","import":"./index.js","require":"./index.cjs"},"./mini":{"@zod/source":"./src/mini/index.ts","types":"./mini/index.d.cts","import":"./mini/index.js","require":"./mini/index.cjs"},"./locales":{"@zod/source":"./src/locales/index.ts","types":"./locales/index.d.cts","import":"./locales/index.js","require":"./locales/index.cjs"},"./v3":{"@zod/source":"./src/v3/index.ts","types":"./v3/index.d.cts","import":"./v3/index.js","require":"./v3/index.cjs"},"./v4":{"@zod/source":"./src/v4/index.ts","types":"./v4/index.d.cts","import":"./v4/index.js","require":"./v4/index.cjs"},"./v4-mini":{"@zod/source":"./src/v4-mini/index.ts","types":"./v4-mini/index.d.cts","import":"./v4-mini/index.js","require":"./v4-mini/index.cjs"},"./v4/mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./v4/mini/index.d.cts","import":"./v4/mini/index.js","require":"./v4/mini/index.cjs"},"./v4/core":{"@zod/source":"./src/v4/core/index.ts","types":"./v4/core/index.d.cts","import":"./v4/core/index.js","require":"./v4/core/index.cjs"},"./v4/locales":{"@zod/source":"./src/v4/locales/index.ts","types":"./v4/locales/index.d.cts","import":"./v4/locales/index.js","require":"./v4/locales/index.cjs"},"./v4/locales/*":{"@zod/source":"./src/v4/locales/*","types":"./v4/locales/*","import":"./v4/locales/*","require":"./v4/locales/*"}},"repository":{"type":"git","url":"git+https://github.com/colinhacks/zod.git"},"bugs":{"url":"https://github.com/colinhacks/zod/issues"},"support":{"backing":{"npm-funding":true}},"scripts":{"clean":"git clean -xdf . -e node_modules","build":"zshy --project tsconfig.build.json","postbuild":"tsx ../../scripts/write-stub-package-jsons.ts && pnpm biome check --write .","test:watch":"pnpm vitest","test":"pnpm vitest run","prepublishOnly":"tsx ../../scripts/check-versions.ts"},"_lastModified":"2026-05-06T11:13:44.622Z"}
1
+ {"name":"zod","version":"4.3.5","type":"module","license":"MIT","author":"Colin McDonnell <zod@colinhacks.com>","description":"TypeScript-first schema declaration and validation library with static type inference","homepage":"https://zod.dev","llms":"https://zod.dev/llms.txt","llmsFull":"https://zod.dev/llms-full.txt","mcpServer":"https://mcp.inkeep.com/zod/mcp","funding":"https://github.com/sponsors/colinhacks","sideEffects":false,"files":["src","**/*.js","**/*.mjs","**/*.cjs","**/*.d.ts","**/*.d.mts","**/*.d.cts","**/package.json"],"keywords":["typescript","schema","validation","type","inference"],"main":"./index.cjs","types":"./index.d.cts","module":"./index.js","zshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts","./mini":"./src/mini/index.ts","./locales":"./src/locales/index.ts","./v3":"./src/v3/index.ts","./v4":"./src/v4/index.ts","./v4-mini":"./src/v4-mini/index.ts","./v4/mini":"./src/v4/mini/index.ts","./v4/core":"./src/v4/core/index.ts","./v4/locales":"./src/v4/locales/index.ts","./v4/locales/*":"./src/v4/locales/*"},"conditions":{"@zod/source":"src"}},"exports":{"./package.json":"./package.json",".":{"@zod/source":"./src/index.ts","types":"./index.d.cts","import":"./index.js","require":"./index.cjs"},"./mini":{"@zod/source":"./src/mini/index.ts","types":"./mini/index.d.cts","import":"./mini/index.js","require":"./mini/index.cjs"},"./locales":{"@zod/source":"./src/locales/index.ts","types":"./locales/index.d.cts","import":"./locales/index.js","require":"./locales/index.cjs"},"./v3":{"@zod/source":"./src/v3/index.ts","types":"./v3/index.d.cts","import":"./v3/index.js","require":"./v3/index.cjs"},"./v4":{"@zod/source":"./src/v4/index.ts","types":"./v4/index.d.cts","import":"./v4/index.js","require":"./v4/index.cjs"},"./v4-mini":{"@zod/source":"./src/v4-mini/index.ts","types":"./v4-mini/index.d.cts","import":"./v4-mini/index.js","require":"./v4-mini/index.cjs"},"./v4/mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./v4/mini/index.d.cts","import":"./v4/mini/index.js","require":"./v4/mini/index.cjs"},"./v4/core":{"@zod/source":"./src/v4/core/index.ts","types":"./v4/core/index.d.cts","import":"./v4/core/index.js","require":"./v4/core/index.cjs"},"./v4/locales":{"@zod/source":"./src/v4/locales/index.ts","types":"./v4/locales/index.d.cts","import":"./v4/locales/index.js","require":"./v4/locales/index.cjs"},"./v4/locales/*":{"@zod/source":"./src/v4/locales/*","types":"./v4/locales/*","import":"./v4/locales/*","require":"./v4/locales/*"}},"repository":{"type":"git","url":"git+https://github.com/colinhacks/zod.git"},"bugs":{"url":"https://github.com/colinhacks/zod/issues"},"support":{"backing":{"npm-funding":true}},"scripts":{"clean":"git clean -xdf . -e node_modules","build":"zshy --project tsconfig.build.json","postbuild":"tsx ../../scripts/write-stub-package-jsons.ts && pnpm biome check --write .","test:watch":"pnpm vitest","test":"pnpm vitest run","prepublishOnly":"tsx ../../scripts/check-versions.ts"},"_lastModified":"2026-05-10T15:49:30.059Z"}
@@ -10,7 +10,10 @@ import FlowModelRepository from '../repository';
10
10
  export declare class FlowSurfaceRouteSync {
11
11
  private readonly db;
12
12
  private readonly repository;
13
- constructor(db: any, repository: FlowModelRepository);
13
+ private readonly patchModel;
14
+ constructor(db: any, repository: FlowModelRepository, patchModel?: (values: Record<string, any>, options?: {
15
+ transaction?: any;
16
+ }) => Promise<any>);
14
17
  buildPageTree(pageRouteLike: any, transaction?: any): Promise<any>;
15
18
  buildTabAnchor(tabRouteLike: any, transaction?: any): Promise<{
16
19
  subModels?: {
@@ -42,9 +42,10 @@ module.exports = __toCommonJS(route_sync_exports);
42
42
  var import_lodash = __toESM(require("lodash"));
43
43
  var import_builder = require("./builder");
44
44
  class FlowSurfaceRouteSync {
45
- constructor(db, repository) {
45
+ constructor(db, repository, patchModel = (values, options) => repository.patch(values, options)) {
46
46
  this.db = db;
47
47
  this.repository = repository;
48
+ this.patchModel = patchModel;
48
49
  }
49
50
  async buildPageTree(pageRouteLike, transaction) {
50
51
  var _a, _b, _c, _d, _e, _f, _g;
@@ -182,7 +183,7 @@ class FlowSurfaceRouteSync {
182
183
  includeAsyncNode: true
183
184
  }) : null);
184
185
  if (pageModel == null ? void 0 : pageModel.uid) {
185
- await this.repository.patch(
186
+ await this.patchModel(
186
187
  {
187
188
  ...this.normalizePagePayload(current, nextPayload, routeValues),
188
189
  uid: pageModel.uid
@@ -206,7 +207,7 @@ class FlowSurfaceRouteSync {
206
207
  return;
207
208
  }
208
209
  const latestRoute = await this.hydrateRoute(target.tabRoute, transaction);
209
- await this.repository.patch(
210
+ await this.patchModel(
210
211
  this.normalizeTabPayload(await this.buildTabAnchor(latestRoute, transaction), nextPayload, routeValues),
211
212
  { transaction }
212
213
  );
@@ -49,6 +49,8 @@ export declare class FlowSurfacesService {
49
49
  private get approvalRuntimeConfigService();
50
50
  private get approvalBlueprintService();
51
51
  private get hiddenPopupRuntime();
52
+ private normalizeFlowSurfaceModelOptionsPatch;
53
+ private patchFlowSurfaceModelOptions;
52
54
  private setFlowModelNodeAsyncFlag;
53
55
  private loadEnabledPluginPackages;
54
56
  private resolveEnabledPluginPackages;
@@ -296,6 +296,7 @@ const POPUP_ASSOCIATED_RECORDS_BLOCK_USES = /* @__PURE__ */ new Set([
296
296
  "MapBlockModel",
297
297
  "CommentsBlockModel"
298
298
  ]);
299
+ const FLOW_SURFACE_MODEL_OPTION_PATCH_OMIT_KEYS = ["uid", "name", "options"];
299
300
  const POPUP_COLLECTION_BLOCK_SCENES = {
300
301
  CreateFormModel: ["new"],
301
302
  EditFormModel: ["one", "many"],
@@ -448,7 +449,11 @@ class FlowSurfacesService {
448
449
  return new import_locator.SurfaceLocator(this.db, this.repository);
449
450
  }
450
451
  get routeSync() {
451
- return new import_route_sync.FlowSurfaceRouteSync(this.db, this.repository);
452
+ return new import_route_sync.FlowSurfaceRouteSync(
453
+ this.db,
454
+ this.repository,
455
+ (values, options) => this.patchFlowSurfaceModelOptions(values, options)
456
+ );
452
457
  }
453
458
  getFlowTemplateRepository(actionName) {
454
459
  try {
@@ -524,7 +529,13 @@ class FlowSurfacesService {
524
529
  var _a, _b;
525
530
  return !!((_b = (_a = this.plugin.app.dataSourceManager) == null ? void 0 : _a.get) == null ? void 0 : _b.call(_a, dataSourceKey));
526
531
  },
527
- repository: this.repository,
532
+ repository: {
533
+ findModelById: (uid2, options) => this.repository.findModelById(uid2, options),
534
+ findModelByParentId: (parentUid, options) => this.repository.findModelByParentId(parentUid, options),
535
+ insertModel: (model, options) => this.repository.insertModel(model, options),
536
+ upsertModel: (model, options) => this.repository.upsertModel(model, options),
537
+ patch: (values, options) => this.patchFlowSurfaceModelOptions(values, options)
538
+ },
528
539
  setNodeAsyncFlag: (uid2, asyncFlag, transaction) => this.setFlowModelNodeAsyncFlag(uid2, asyncFlag, transaction),
529
540
  removeNodeTreeWithBindings: (uid2, transaction) => this.removeNodeTreeWithBindings(uid2, transaction),
530
541
  surfaceContext: this.surfaceContext,
@@ -538,7 +549,11 @@ class FlowSurfacesService {
538
549
  }
539
550
  get hiddenPopupRuntime() {
540
551
  return {
541
- repository: this.repository,
552
+ repository: {
553
+ findModelById: (uid2, options) => this.repository.findModelById(uid2, options),
554
+ patch: (values, options) => this.patchFlowSurfaceModelOptions(values, options),
555
+ upsertModel: (model, options) => this.repository.upsertModel(model, options)
556
+ },
542
557
  buildPopupOpenViewWithTemplate: (input) => this.buildPopupOpenViewWithTemplate(input),
543
558
  clearFlowTemplateUsagesForNodeTree: (uid2, transaction) => this.clearFlowTemplateUsagesForNodeTree(uid2, transaction),
544
559
  ensurePopupHostDefaultContent: (input) => this.ensurePopupHostDefaultContent(input),
@@ -547,6 +562,39 @@ class FlowSurfacesService {
547
562
  syncFlowTemplateUsagesForNodeTree: (uid2, transaction) => this.syncFlowTemplateUsagesForNodeTree(uid2, transaction)
548
563
  };
549
564
  }
565
+ normalizeFlowSurfaceModelOptionsPatch(values) {
566
+ return import_lodash.default.omit(import_lodash.default.cloneDeep(values || {}), FLOW_SURFACE_MODEL_OPTION_PATCH_OMIT_KEYS);
567
+ }
568
+ async patchFlowSurfaceModelOptions(values, options = {}) {
569
+ const normalizedUid = String((values == null ? void 0 : values.uid) || "").trim();
570
+ if (!normalizedUid) {
571
+ (0, import_errors.throwBadRequest)("flowSurfaces model patch requires uid");
572
+ }
573
+ const model = await this.repository.model.findByPk(normalizedUid, {
574
+ transaction: options.transaction
575
+ });
576
+ if (!model) {
577
+ (0, import_errors.throwBadRequest)(`flowSurfaces model '${normalizedUid}' does not exist`);
578
+ }
579
+ const currentOptions = import_repository.default.optionsToJson(model.get("options") || {});
580
+ const nextOptions = {
581
+ ...currentOptions,
582
+ ...this.normalizeFlowSurfaceModelOptionsPatch(values)
583
+ };
584
+ delete nextOptions.uid;
585
+ delete nextOptions.name;
586
+ delete nextOptions.options;
587
+ model.set("options", nextOptions);
588
+ await model.save({
589
+ transaction: options.transaction,
590
+ hooks: false
591
+ });
592
+ await this.repository.clearXUidPathCache(normalizedUid, options.transaction);
593
+ await this.repository.emitAfterSaveEvent(model, options);
594
+ if (values == null ? void 0 : values["x-server-hooks"]) {
595
+ await this.db.emitAsync(`${this.repository.collection.name}.afterSave`, model, options);
596
+ }
597
+ }
550
598
  async setFlowModelNodeAsyncFlag(uid2, asyncFlag, transaction) {
551
599
  var _a, _b;
552
600
  const sequelize = (_a = this.db) == null ? void 0 : _a.sequelize;
@@ -2048,7 +2096,7 @@ class FlowSurfacesService {
2048
2096
  } else {
2049
2097
  import_lodash.default.set(nextStepParams, [slot.flowKey, slot.stepKey, slot.valuePath], import_lodash.default.cloneDeep(canonicalRules));
2050
2098
  }
2051
- await this.repository.patch(
2099
+ await this.patchFlowSurfaceModelOptions(
2052
2100
  {
2053
2101
  uid: targetUid,
2054
2102
  stepParams: nextStepParams
@@ -2351,13 +2399,13 @@ class FlowSurfacesService {
2351
2399
  async patchDeclaredKeyModel(values, options) {
2352
2400
  const normalizedUid = String((values == null ? void 0 : values.uid) || "").trim();
2353
2401
  if (!normalizedUid) {
2354
- return this.repository.patch(values, options);
2402
+ return this.patchFlowSurfaceModelOptions(values, options);
2355
2403
  }
2356
2404
  const persisted = await this.repository.model.findByPk(normalizedUid, {
2357
2405
  transaction: options == null ? void 0 : options.transaction
2358
2406
  });
2359
2407
  if (persisted) {
2360
- return this.repository.patch(values, options);
2408
+ return this.patchFlowSurfaceModelOptions(values, options);
2361
2409
  }
2362
2410
  const currentNode = await this.repository.findModelById(normalizedUid, {
2363
2411
  transaction: options == null ? void 0 : options.transaction,
@@ -2379,7 +2427,7 @@ class FlowSurfacesService {
2379
2427
  );
2380
2428
  return;
2381
2429
  }
2382
- return this.repository.patch(values, options);
2430
+ return this.patchFlowSurfaceModelOptions(values, options);
2383
2431
  }
2384
2432
  async persistCreatedKeysForAction(actionName, values, result, transaction) {
2385
2433
  const keyPersistenceDeps = this.getDeclaredKeyPersistenceDeps();
@@ -3199,7 +3247,7 @@ class FlowSurfacesService {
3199
3247
  async hydrateDetachedPopupTemplateBlockResourceContext(detachedTarget, context, transaction) {
3200
3248
  const patches = this.collectDetachedPopupTemplateBlockResourceContextPatches(detachedTarget, context);
3201
3249
  for (const patch of patches) {
3202
- await this.repository.patch(
3250
+ await this.patchFlowSurfaceModelOptions(
3203
3251
  {
3204
3252
  uid: patch.uid,
3205
3253
  stepParams: patch.stepParams
@@ -3239,7 +3287,7 @@ class FlowSurfacesService {
3239
3287
  if (!import_lodash.default.isEqual(nextOpenView, currentOpenView)) {
3240
3288
  currentGroup[resolvedOpenViewStep.stepKey] = nextOpenView;
3241
3289
  nextStepParams[resolvedOpenViewStep.flowKey] = currentGroup;
3242
- await this.repository.patch(
3290
+ await this.patchFlowSurfaceModelOptions(
3243
3291
  {
3244
3292
  uid: detachedTarget.uid,
3245
3293
  stepParams: nextStepParams
@@ -3482,7 +3530,7 @@ class FlowSurfacesService {
3482
3530
  currentGroup[openViewStep.stepKey] = nextOpenView;
3483
3531
  nextStepParams[openViewStep.flowKey] = currentGroup;
3484
3532
  await this.cleanupLocalPopupSurfaceForHost(sourceNode.uid, transaction, sourceNode);
3485
- await this.repository.patch(
3533
+ await this.patchFlowSurfaceModelOptions(
3486
3534
  {
3487
3535
  uid: sourceNode.uid,
3488
3536
  stepParams: nextStepParams
@@ -3780,7 +3828,7 @@ class FlowSurfacesService {
3780
3828
  }
3781
3829
  nextStepParams[resolved.openViewStep.flowKey] = currentGroup;
3782
3830
  await this.cleanupLocalPopupSurfaceForHost(node.uid, options.transaction, node);
3783
- await this.repository.patch(
3831
+ await this.patchFlowSurfaceModelOptions(
3784
3832
  {
3785
3833
  uid: node.uid,
3786
3834
  stepParams: nextStepParams
@@ -4648,7 +4696,7 @@ class FlowSurfacesService {
4648
4696
  if (Object.keys(nextPayload).length === 1) {
4649
4697
  return { uid: popupTab.uid };
4650
4698
  }
4651
- await this.repository.patch(nextPayload, { transaction: options.transaction });
4699
+ await this.patchFlowSurfaceModelOptions(nextPayload, { transaction: options.transaction });
4652
4700
  return (0, import_service_utils.buildDefinedPayload)({
4653
4701
  uid: popupTab.uid,
4654
4702
  title: values.title,
@@ -8067,7 +8115,7 @@ class FlowSurfacesService {
8067
8115
  const currentGroup = import_lodash.default.isPlainObject(nextStepParams[openViewStep.flowKey]) ? import_lodash.default.cloneDeep(nextStepParams[openViewStep.flowKey]) : {};
8068
8116
  currentGroup[openViewStep.stepKey] = nextOpenView;
8069
8117
  nextStepParams[openViewStep.flowKey] = currentGroup;
8070
- await this.repository.patch(
8118
+ await this.patchFlowSurfaceModelOptions(
8071
8119
  {
8072
8120
  uid: actionNode.uid,
8073
8121
  stepParams: nextStepParams
@@ -8117,7 +8165,7 @@ class FlowSurfacesService {
8117
8165
  }
8118
8166
  currentGroup[stepKey] = nextOpenView;
8119
8167
  nextStepParams[flowKey] = currentGroup;
8120
- await this.repository.patch(
8168
+ await this.patchFlowSurfaceModelOptions(
8121
8169
  {
8122
8170
  uid: actionNode.uid,
8123
8171
  stepParams: nextStepParams
@@ -8380,7 +8428,7 @@ class FlowSurfacesService {
8380
8428
  updated: Object.keys(import_lodash.default.omit(nextPayload, ["uid"]))
8381
8429
  };
8382
8430
  }
8383
- await this.repository.patch(nextPayload, { transaction: options.transaction });
8431
+ await this.patchFlowSurfaceModelOptions(nextPayload, { transaction: options.transaction });
8384
8432
  if (!import_lodash.default.isUndefined(updateActionAssignedValues)) {
8385
8433
  await this.syncUpdateActionAssignFormItems(current.uid, updateActionAssignedValues, options.transaction);
8386
8434
  }
@@ -9286,7 +9334,7 @@ class FlowSurfacesService {
9286
9334
  flowRegistry: flows
9287
9335
  };
9288
9336
  }
9289
- await this.repository.patch(
9337
+ await this.patchFlowSurfaceModelOptions(
9290
9338
  {
9291
9339
  uid: target.uid,
9292
9340
  flowRegistry: flows
@@ -9311,7 +9359,7 @@ class FlowSurfacesService {
9311
9359
  const sizes = values.sizes || {};
9312
9360
  const rowOrder = values.rowOrder || Object.keys(rows);
9313
9361
  this.contractGuard.validateLayout(grid, { rows, sizes, rowOrder });
9314
- await this.repository.patch(
9362
+ await this.patchFlowSurfaceModelOptions(
9315
9363
  {
9316
9364
  uid: grid.uid,
9317
9365
  props: {
@@ -13539,7 +13587,7 @@ class FlowSurfacesService {
13539
13587
  if (import_lodash.default.isEqual(nextConfigs, currentConfigs)) {
13540
13588
  return;
13541
13589
  }
13542
- await this.repository.patch(
13590
+ await this.patchFlowSurfaceModelOptions(
13543
13591
  {
13544
13592
  uid: blockGrid.uid,
13545
13593
  filterManager: nextConfigs
@@ -13569,7 +13617,7 @@ class FlowSurfacesService {
13569
13617
  targetId: input.targetBlockUid,
13570
13618
  filterPaths: this.buildFilterFormTargetPaths(input.resourceInit, input.fieldPath, input.associationPathName)
13571
13619
  });
13572
- await this.repository.patch(
13620
+ await this.patchFlowSurfaceModelOptions(
13573
13621
  {
13574
13622
  uid: blockGrid.uid,
13575
13623
  filterManager: nextConfigs
@@ -13587,7 +13635,7 @@ class FlowSurfacesService {
13587
13635
  if (import_lodash.default.isEqual(nextConfigs, currentConfigs)) {
13588
13636
  return;
13589
13637
  }
13590
- await this.repository.patch(
13638
+ await this.patchFlowSurfaceModelOptions(
13591
13639
  {
13592
13640
  uid: blockGrid.uid,
13593
13641
  filterManager: nextConfigs
@@ -13605,7 +13653,7 @@ class FlowSurfacesService {
13605
13653
  if (import_lodash.default.isEqual(nextConfigs, currentConfigs)) {
13606
13654
  return;
13607
13655
  }
13608
- await this.repository.patch(
13656
+ await this.patchFlowSurfaceModelOptions(
13609
13657
  {
13610
13658
  uid: blockGrid.uid,
13611
13659
  filterManager: nextConfigs
@@ -13748,7 +13796,7 @@ class FlowSurfacesService {
13748
13796
  if (innerFieldUid) {
13749
13797
  const innerField = ((_f = current == null ? void 0 : current.subModels) == null ? void 0 : _f.field) || await this.repository.findModelById(innerFieldUid, { transaction, includeAsyncNode: true });
13750
13798
  if (innerField == null ? void 0 : innerField.uid) {
13751
- await this.repository.patch(
13799
+ await this.patchFlowSurfaceModelOptions(
13752
13800
  {
13753
13801
  uid: innerField.uid,
13754
13802
  stepParams: {
@@ -13783,7 +13831,7 @@ class FlowSurfacesService {
13783
13831
  fieldSettings: nextFieldSettings
13784
13832
  }
13785
13833
  };
13786
- await this.repository.patch(
13834
+ await this.patchFlowSurfaceModelOptions(
13787
13835
  {
13788
13836
  uid: parentUid,
13789
13837
  stepParams: nextWrapper.stepParams
@@ -13995,7 +14043,7 @@ class FlowSurfacesService {
13995
14043
  if (import_lodash.default.isEqual(currentOpenView, openView)) {
13996
14044
  return false;
13997
14045
  }
13998
- await this.repository.patch(
14046
+ await this.patchFlowSurfaceModelOptions(
13999
14047
  {
14000
14048
  uid: actionUid,
14001
14049
  stepParams: (0, import_hidden_popup_contract.buildHiddenPopupActionStepParams)(actionNode.stepParams, openView)
@@ -15636,7 +15684,7 @@ class FlowSurfacesService {
15636
15684
  showIndex: input.showIndex
15637
15685
  });
15638
15686
  if (Object.keys(props).length) {
15639
- await this.repository.patch(
15687
+ await this.patchFlowSurfaceModelOptions(
15640
15688
  {
15641
15689
  uid: input.fieldUid,
15642
15690
  props: {
@@ -15731,7 +15779,7 @@ class FlowSurfacesService {
15731
15779
  collectionName: (0, import_service_helpers.getCollectionName)(input.targetCollection)
15732
15780
  });
15733
15781
  if (Object.keys(openView).length > 2) {
15734
- await this.repository.patch(
15782
+ await this.patchFlowSurfaceModelOptions(
15735
15783
  {
15736
15784
  uid: input.fieldUid,
15737
15785
  stepParams: import_lodash.default.merge({}, (fieldNode == null ? void 0 : fieldNode.stepParams) || {}, {
@@ -15820,7 +15868,7 @@ class FlowSurfacesService {
15820
15868
  },
15821
15869
  rowOrder: ["row1"]
15822
15870
  };
15823
- await this.repository.patch(
15871
+ await this.patchFlowSurfaceModelOptions(
15824
15872
  {
15825
15873
  uid: grid.uid,
15826
15874
  props: {
@@ -15870,7 +15918,7 @@ class FlowSurfacesService {
15870
15918
  init: this.buildExactFieldSettingsInitPayload(input)
15871
15919
  }
15872
15920
  };
15873
- await this.repository.patch(
15921
+ await this.patchFlowSurfaceModelOptions(
15874
15922
  {
15875
15923
  uid: node.uid,
15876
15924
  stepParams: nextStepParams
@@ -16032,7 +16080,7 @@ class FlowSurfacesService {
16032
16080
  }
16033
16081
  }
16034
16082
  });
16035
- await this.repository.patch(
16083
+ await this.patchFlowSurfaceModelOptions(
16036
16084
  {
16037
16085
  uid: wrapperNode.uid,
16038
16086
  stepParams: nextStepParams
@@ -16058,7 +16106,7 @@ class FlowSurfacesService {
16058
16106
  enabledPackages: input.enabledPackages
16059
16107
  });
16060
16108
  if (innerField.use === normalizedTargetUse) {
16061
- await this.repository.patch(
16109
+ await this.patchFlowSurfaceModelOptions(
16062
16110
  {
16063
16111
  uid: innerField.uid,
16064
16112
  stepParams: import_lodash.default.merge({}, innerField.stepParams || {}, {
@@ -16103,7 +16151,7 @@ class FlowSurfacesService {
16103
16151
  }),
16104
16152
  subModels: nextSubModels
16105
16153
  };
16106
- await this.repository.patch(nextFieldNode, { transaction: input.transaction });
16154
+ await this.patchFlowSurfaceModelOptions(nextFieldNode, { transaction: input.transaction });
16107
16155
  return normalizedTargetUse;
16108
16156
  }
16109
16157
  parseFieldPath(collection, fieldPath, associationPathName, dataSourceKey, collectionName) {
@@ -0,0 +1,13 @@
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 { Migration } from '@nocobase/server';
10
+ export default class extends Migration {
11
+ on: string;
12
+ up(): Promise<void>;
13
+ }
@@ -0,0 +1,67 @@
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 remove_flow_model_options_runtime_uid_exports = {};
38
+ __export(remove_flow_model_options_runtime_uid_exports, {
39
+ default: () => remove_flow_model_options_runtime_uid_default
40
+ });
41
+ module.exports = __toCommonJS(remove_flow_model_options_runtime_uid_exports);
42
+ var import_server = require("@nocobase/server");
43
+ var import_lodash = __toESM(require("lodash"));
44
+ /* istanbul ignore file -- @preserve */
45
+ class remove_flow_model_options_runtime_uid_default extends import_server.Migration {
46
+ on = "afterLoad";
47
+ async up() {
48
+ var _a, _b;
49
+ const repository = this.context.db.getRepository("flowModels");
50
+ const rows = await repository.find();
51
+ for (const row of rows) {
52
+ const rowUid = String(((_a = row.get) == null ? void 0 : _a.call(row, "uid")) || row.uid || "").trim();
53
+ const options = ((_b = row.get) == null ? void 0 : _b.call(row, "options")) || row.options;
54
+ if (!rowUid || !import_lodash.default.isPlainObject(options) || options.uid !== rowUid) {
55
+ continue;
56
+ }
57
+ await row.update(
58
+ {
59
+ options: import_lodash.default.omit(options, ["uid"])
60
+ },
61
+ {
62
+ hooks: false
63
+ }
64
+ );
65
+ }
66
+ }
67
+ }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName.zh-CN": "前端流引擎",
5
5
  "description": "",
6
6
  "description.zh-CN": "",
7
- "version": "2.1.0-alpha.30",
7
+ "version": "2.1.0-alpha.32",
8
8
  "main": "./dist/server/index.js",
9
9
  "license": "Apache-2.0",
10
10
  "devDependencies": {
@@ -24,5 +24,5 @@
24
24
  "@nocobase/test": "2.x",
25
25
  "@nocobase/utils": "2.x"
26
26
  },
27
- "gitHead": "292ae0ad87f195ed201b274902d21ecd96f5ddd0"
27
+ "gitHead": "1ba7d717e156651db17c615f9b9c48edd669d19b"
28
28
  }