@nocobase/plugin-workflow 2.1.0-beta.22 → 2.1.0-beta.23

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.
@@ -12,6 +12,10 @@ declare const _default: {
12
12
  name: string;
13
13
  shared: boolean;
14
14
  repository: string;
15
+ createdBy: boolean;
16
+ updatedBy: boolean;
17
+ createdAt: boolean;
18
+ updatedAt: boolean;
15
19
  fields: ({
16
20
  name: string;
17
21
  type: string;
@@ -323,6 +327,39 @@ declare const _default: {
323
327
  defaultValue?: undefined;
324
328
  required?: undefined;
325
329
  onDelete?: undefined;
330
+ } | {
331
+ type: string;
332
+ name: string;
333
+ target: string;
334
+ foreignKey: string;
335
+ interface: string;
336
+ uiSchema: {
337
+ type: string;
338
+ title: string;
339
+ 'x-component': string;
340
+ 'x-component-props': {
341
+ fieldNames: {
342
+ label: string;
343
+ value: string;
344
+ color?: undefined;
345
+ };
346
+ multiple?: undefined;
347
+ mode?: undefined;
348
+ };
349
+ 'x-read-pretty'?: undefined;
350
+ required?: undefined;
351
+ enum?: undefined;
352
+ default?: undefined;
353
+ };
354
+ primaryKey?: undefined;
355
+ allowNull?: undefined;
356
+ defaultValue?: undefined;
357
+ required?: undefined;
358
+ onDelete?: undefined;
359
+ sourceKey?: undefined;
360
+ constraints?: undefined;
361
+ through?: undefined;
362
+ otherKey?: undefined;
326
363
  })[];
327
364
  indexes: {
328
365
  unique: boolean;
@@ -36,6 +36,10 @@ var workflows_default = {
36
36
  name: "workflows",
37
37
  shared: true,
38
38
  repository: "WorkflowRepository",
39
+ createdBy: true,
40
+ updatedBy: true,
41
+ createdAt: true,
42
+ updatedAt: true,
39
43
  fields: [
40
44
  {
41
45
  name: "id",
@@ -245,6 +249,24 @@ var workflows_default = {
245
249
  },
246
250
  "x-read-pretty": true
247
251
  }
252
+ },
253
+ {
254
+ type: "belongsTo",
255
+ name: "createdBy",
256
+ target: "users",
257
+ foreignKey: "createdById",
258
+ interface: "m2o",
259
+ uiSchema: {
260
+ type: "number",
261
+ title: `{{t("Created by")}}`,
262
+ "x-component": "AssociationField",
263
+ "x-component-props": {
264
+ fieldNames: {
265
+ label: "nickname",
266
+ value: "id"
267
+ }
268
+ }
269
+ }
248
270
  }
249
271
  ],
250
272
  // NOTE: use unique index for avoiding deadlock in mysql when setCurrent
@@ -11,8 +11,8 @@ module.exports = {
11
11
  "react": "18.2.0",
12
12
  "@formily/core": "2.3.7",
13
13
  "@formily/react": "2.3.7",
14
- "@nocobase/client": "2.1.0-beta.22",
15
- "@nocobase/utils": "2.1.0-beta.22",
14
+ "@nocobase/client": "2.1.0-beta.23",
15
+ "@nocobase/utils": "2.1.0-beta.23",
16
16
  "antd": "5.24.2",
17
17
  "@ant-design/icons": "5.6.1",
18
18
  "react-router-dom": "6.30.1",
@@ -20,20 +20,20 @@ module.exports = {
20
20
  "lodash": "4.18.1",
21
21
  "@dnd-kit/core": "6.1.0",
22
22
  "@formily/shared": "2.3.7",
23
- "@nocobase/flow-engine": "2.1.0-beta.22",
24
- "@nocobase/plugin-mobile": "2.1.0-beta.22",
23
+ "@nocobase/flow-engine": "2.1.0-beta.23",
24
+ "@nocobase/plugin-mobile": "2.1.0-beta.23",
25
25
  "sequelize": "6.35.2",
26
- "@nocobase/server": "2.1.0-beta.22",
27
- "@nocobase/database": "2.1.0-beta.22",
28
- "@nocobase/data-source-manager": "2.1.0-beta.22",
29
- "@nocobase/logger": "2.1.0-beta.22",
30
- "@nocobase/evaluators": "2.1.0-beta.22",
26
+ "@nocobase/server": "2.1.0-beta.23",
27
+ "@nocobase/database": "2.1.0-beta.23",
28
+ "@nocobase/data-source-manager": "2.1.0-beta.23",
29
+ "@nocobase/logger": "2.1.0-beta.23",
30
+ "@nocobase/evaluators": "2.1.0-beta.23",
31
31
  "@formily/antd-v5": "1.2.3",
32
32
  "@formily/reactive": "2.3.7",
33
33
  "@emotion/css": "11.13.0",
34
34
  "@formily/json-schema": "2.3.7",
35
- "@nocobase/actions": "2.1.0-beta.22",
35
+ "@nocobase/actions": "2.1.0-beta.23",
36
36
  "dayjs": "1.11.13",
37
- "@nocobase/plugin-workflow-test": "2.1.0-beta.22",
38
- "@nocobase/test": "2.1.0-beta.22"
37
+ "@nocobase/plugin-workflow-test": "2.1.0-beta.23",
38
+ "@nocobase/test": "2.1.0-beta.23"
39
39
  };
@@ -1 +1 @@
1
- {"name":"cron-parser","version":"4.4.0","description":"Node.js library for parsing crontab instructions","main":"lib/parser.js","types":"index.d.ts","typesVersions":{"<4.1":{"*":["types/ts3/*"]}},"directories":{"test":"test"},"scripts":{"test:tsd":"tsd","test:unit":"TZ=UTC tap ./test/*.js","test:cover":"TZ=UTC tap --coverage-report=html ./test/*.js","lint":"eslint .","lint:fix":"eslint --fix .","test":"npm run lint && npm run test:unit && npm run test:tsd"},"repository":{"type":"git","url":"https://github.com/harrisiirak/cron-parser.git"},"keywords":["cron","crontab","parser"],"author":"Harri Siirak","contributors":["Nicholas Clawson","Daniel Prentis <daniel@salsitasoft.com>","Renault John Lecoultre","Richard Astbury <richard.astbury@gmail.com>","Meaglin Wasabi <Meaglin.wasabi@gmail.com>","Mike Kusold <hello@mikekusold.com>","Alex Kit <alex.kit@atmajs.com>","Santiago Gimeno <santiago.gimeno@gmail.com>","Daniel <darc.tec@gmail.com>","Christian Steininger <christian.steininger.cs@gmail.com>","Mykola Piskovyi <m.piskovyi@gmail.com>","Brian Vaughn <brian.david.vaughn@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Yasuhiroki <yasuhiroki.duck@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Brendan Warkentin <faazshift@gmail.com>","Charlie Fish <fishcharlie.code@gmail.com>","Ian Graves <ian+diskimage@iangrav.es>","Andy Thompson <me@andytson.com>","Regev Brody <regevbr@gmail.com>"],"license":"MIT","dependencies":{"luxon":"^1.28.0"},"devDependencies":{"eslint":"^8.2.0","sinon":"^10.0.0","tap":"^16.0.1","tsd":"^0.19.0"},"engines":{"node":">=0.8"},"browser":{"fs":false},"tap":{"check-coverage":false},"tsd":{"directory":"test","compilerOptions":{"lib":["es2017","dom"]}},"_lastModified":"2026-04-28T10:18:58.627Z"}
1
+ {"name":"cron-parser","version":"4.4.0","description":"Node.js library for parsing crontab instructions","main":"lib/parser.js","types":"index.d.ts","typesVersions":{"<4.1":{"*":["types/ts3/*"]}},"directories":{"test":"test"},"scripts":{"test:tsd":"tsd","test:unit":"TZ=UTC tap ./test/*.js","test:cover":"TZ=UTC tap --coverage-report=html ./test/*.js","lint":"eslint .","lint:fix":"eslint --fix .","test":"npm run lint && npm run test:unit && npm run test:tsd"},"repository":{"type":"git","url":"https://github.com/harrisiirak/cron-parser.git"},"keywords":["cron","crontab","parser"],"author":"Harri Siirak","contributors":["Nicholas Clawson","Daniel Prentis <daniel@salsitasoft.com>","Renault John Lecoultre","Richard Astbury <richard.astbury@gmail.com>","Meaglin Wasabi <Meaglin.wasabi@gmail.com>","Mike Kusold <hello@mikekusold.com>","Alex Kit <alex.kit@atmajs.com>","Santiago Gimeno <santiago.gimeno@gmail.com>","Daniel <darc.tec@gmail.com>","Christian Steininger <christian.steininger.cs@gmail.com>","Mykola Piskovyi <m.piskovyi@gmail.com>","Brian Vaughn <brian.david.vaughn@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Yasuhiroki <yasuhiroki.duck@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Brendan Warkentin <faazshift@gmail.com>","Charlie Fish <fishcharlie.code@gmail.com>","Ian Graves <ian+diskimage@iangrav.es>","Andy Thompson <me@andytson.com>","Regev Brody <regevbr@gmail.com>"],"license":"MIT","dependencies":{"luxon":"^1.28.0"},"devDependencies":{"eslint":"^8.2.0","sinon":"^10.0.0","tap":"^16.0.1","tsd":"^0.19.0"},"engines":{"node":">=0.8"},"browser":{"fs":false},"tap":{"check-coverage":false},"tsd":{"directory":"test","compilerOptions":{"lib":["es2017","dom"]}},"_lastModified":"2026-04-28T15:59:57.433Z"}
@@ -1 +1 @@
1
- {"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-04-28T10:18:58.369Z"}
1
+ {"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-04-28T15:59:57.175Z"}
@@ -1 +1 @@
1
- {"name":"lru-cache","description":"A cache object that deletes the least-recently-used items.","version":"11.3.5","author":"Isaac Z. Schlueter <i@izs.me>","keywords":["mru","lru","cache"],"sideEffects":false,"scripts":{"build":"npm run prepare","prepare":"tshy && bash scripts/build.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"tap","snap":"tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write .","typedoc":"typedoc --tsconfig ./.tshy/esm.json ./src/*.ts","benchmark-results-typedoc":"bash scripts/benchmark-results-typedoc.sh","prebenchmark":"npm run prepare","benchmark":"make -C benchmark","preprofile":"npm run prepare","profile":"make -C benchmark profile","lint":"oxlint --fix src test","postsnap":"npm run lint","postlint":"npm run format"},"main":"./dist/commonjs/index.min.js","types":"./dist/commonjs/index.d.ts","tshy":{"esmDialects":["node","browser"],"exports":{"./raw":"./src/index.ts",".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"selfLink":false},"repository":{"type":"git","url":"git+ssh://git@github.com/isaacs/node-lru-cache.git"},"devDependencies":{"benchmark":"^2.1.4","esbuild":"^0.25.9","marked":"^4.2.12","mkdirp":"^3.0.1","oxlint":"^1.58.0","oxlint-tsgolint":"^0.19.0","prettier":"^3.8.1","tap":"^21.6.3","tshy":"^4.1.1","typedoc":"^0.28.18"},"license":"BlueOak-1.0.0","files":["dist"],"engines":{"node":"20 || >=22"},"exports":{"./raw":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"type":"module","module":"./dist/esm/index.min.js","_lastModified":"2026-04-28T10:18:57.607Z"}
1
+ {"name":"lru-cache","description":"A cache object that deletes the least-recently-used items.","version":"11.3.5","author":"Isaac Z. Schlueter <i@izs.me>","keywords":["mru","lru","cache"],"sideEffects":false,"scripts":{"build":"npm run prepare","prepare":"tshy && bash scripts/build.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"tap","snap":"tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write .","typedoc":"typedoc --tsconfig ./.tshy/esm.json ./src/*.ts","benchmark-results-typedoc":"bash scripts/benchmark-results-typedoc.sh","prebenchmark":"npm run prepare","benchmark":"make -C benchmark","preprofile":"npm run prepare","profile":"make -C benchmark profile","lint":"oxlint --fix src test","postsnap":"npm run lint","postlint":"npm run format"},"main":"./dist/commonjs/index.min.js","types":"./dist/commonjs/index.d.ts","tshy":{"esmDialects":["node","browser"],"exports":{"./raw":"./src/index.ts",".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"selfLink":false},"repository":{"type":"git","url":"git+ssh://git@github.com/isaacs/node-lru-cache.git"},"devDependencies":{"benchmark":"^2.1.4","esbuild":"^0.25.9","marked":"^4.2.12","mkdirp":"^3.0.1","oxlint":"^1.58.0","oxlint-tsgolint":"^0.19.0","prettier":"^3.8.1","tap":"^21.6.3","tshy":"^4.1.1","typedoc":"^0.28.18"},"license":"BlueOak-1.0.0","files":["dist"],"engines":{"node":"20 || >=22"},"exports":{"./raw":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"type":"module","module":"./dist/esm/index.min.js","_lastModified":"2026-04-28T15:59:56.426Z"}
@@ -1 +1 @@
1
- {"name":"nodejs-snowflake","collaborators":["Utkarsh Srivastava <utkarsh@sagacious.dev>"],"description":"Generate time sortable 64 bits unique ids for distributed systems (inspired from twitter snowflake)","version":"2.0.1","license":"Apache 2.0","repository":{"type":"git","url":"https://github.com/utkarsh-pro/nodejs-snowflake.git"},"files":["nodejs_snowflake_bg.wasm","nodejs_snowflake.js","nodejs_snowflake.d.ts"],"main":"nodejs_snowflake.js","types":"nodejs_snowflake.d.ts","_lastModified":"2026-04-28T10:18:57.442Z"}
1
+ {"name":"nodejs-snowflake","collaborators":["Utkarsh Srivastava <utkarsh@sagacious.dev>"],"description":"Generate time sortable 64 bits unique ids for distributed systems (inspired from twitter snowflake)","version":"2.0.1","license":"Apache 2.0","repository":{"type":"git","url":"https://github.com/utkarsh-pro/nodejs-snowflake.git"},"files":["nodejs_snowflake_bg.wasm","nodejs_snowflake.js","nodejs_snowflake.d.ts"],"main":"nodejs_snowflake.js","types":"nodejs_snowflake.d.ts","_lastModified":"2026-04-28T15:59:56.249Z"}
@@ -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
+ appVersion: string;
12
+ up(): Promise<void>;
13
+ }
@@ -0,0 +1,57 @@
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 fill_workflow_created_updated_by_exports = {};
28
+ __export(fill_workflow_created_updated_by_exports, {
29
+ default: () => fill_workflow_created_updated_by_default
30
+ });
31
+ module.exports = __toCommonJS(fill_workflow_created_updated_by_exports);
32
+ var import_sequelize = require("sequelize");
33
+ var import_server = require("@nocobase/server");
34
+ class fill_workflow_created_updated_by_default extends import_server.Migration {
35
+ appVersion = "<2.1.0-beta.23";
36
+ async up() {
37
+ const { db } = this.context;
38
+ const WorkflowModel = db.getModel("workflows");
39
+ await db.sequelize.transaction(async (transaction) => {
40
+ await WorkflowModel.update(
41
+ {
42
+ createdById: 1,
43
+ updatedById: 1
44
+ },
45
+ {
46
+ where: {
47
+ createdById: {
48
+ [import_sequelize.Op.is]: null
49
+ }
50
+ },
51
+ silent: true,
52
+ transaction
53
+ }
54
+ );
55
+ });
56
+ }
57
+ }
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "description": "A powerful BPM tool that provides foundational support for business automation, with the capability to extend unlimited triggers and nodes.",
7
7
  "description.zh-CN": "一个强大的 BPM 工具,为业务自动化提供基础支持,并且可任意扩展更多的触发器和节点。",
8
8
  "description.ru-RU": "Мощный инструмент BPM, обеспечивающий базовую поддержку автоматизации бизнес-процессов с возможностью неограниченного расширения триггеров и узлов.",
9
- "version": "2.1.0-beta.22",
9
+ "version": "2.1.0-beta.23",
10
10
  "license": "Apache-2.0",
11
11
  "main": "./dist/server/index.js",
12
12
  "homepage": "https://docs.nocobase.com/handbook/workflow",
@@ -49,7 +49,7 @@
49
49
  "@nocobase/test": "2.x",
50
50
  "@nocobase/utils": "2.x"
51
51
  },
52
- "gitHead": "53ad02861ed8e813103f59659804417118c85b4c",
52
+ "gitHead": "bb4c0d3551bf9eff505b63756dd24a0813231f16",
53
53
  "keywords": [
54
54
  "Workflow"
55
55
  ]
@@ -1,10 +0,0 @@
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
- "use strict";(self.webpackChunk_nocobase_plugin_workflow=self.webpackChunk_nocobase_plugin_workflow||[]).push([["67"],{2596:function(e,t,r){r.d(t,{i:function(){return x}});var n=r(2059),o=r(9155),l=r.n(o);let a=(0,o.createContext)(null),i={didCatch:!1,error:null};class c extends o.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=i}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){let{error:e}=this.state;if(null!==e){for(var t,r,n=arguments.length,o=Array(n),l=0;l<n;l++)o[l]=arguments[l];null==(t=(r=this.props).onReset)||t.call(r,{args:o,reason:"imperative-api"}),this.setState(i)}}componentDidCatch(e,t){var r,n;null==(r=(n=this.props).onError)||r.call(n,e,t)}componentDidUpdate(e,t){let{didCatch:r}=this.state,{resetKeys:n}=this.props;if(r&&null!==t.error&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some((e,r)=>!Object.is(e,t[r]))}(e.resetKeys,n)){var o,l;null==(o=(l=this.props).onReset)||o.call(l,{next:n,prev:e.resetKeys,reason:"keys"}),this.setState(i)}}render(){let{children:e,fallbackRender:t,FallbackComponent:r,fallback:n}=this.props,{didCatch:l,error:i}=this.state,c=e;if(l){let e={error:i,resetErrorBoundary:this.resetErrorBoundary};if((0,o.isValidElement)(n))c=n;else if("function"==typeof t)c=t(e);else if(r)c=(0,o.createElement)(r,e);else throw i}return(0,o.createElement)(a.Provider,{value:{didCatch:l,error:i,resetErrorBoundary:this.resetErrorBoundary}},c)}}var s=r(7375),u=r(3342),d=r(5324),f=r(8083),p=r(404),m=r(3872),v=r(6660),y=r(8201),b=r(4562);function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function w(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function g(){var e=w(["\n margin-top: 0 !important;\n "]);return g=function(){return e},e}function E(){var e=w(["\n margin-bottom: 1em;\n "]);return E=function(){return e},e}function k(){var e=w(["\n margin-top: 0 !important;\n "]);return k=function(){return e},e}function x(e){var t,r,o=e.entry,a=(0,v.A)().styles,i=(0,b.sD)(),w=(0,p.x)(),x=(0,u.useCompile)(),C=(0,u.usePlugin)(d.default),O=function(e){if(Array.isArray(e))return e}(t=l().useState(100))||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(t=n.next()).done)&&(o.push(t.value),2!==o.length);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==n.return||n.return()}finally{if(a)throw r}}return o}}(t)||function(e){if(e){if("string"==typeof e)return h(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),A=O[0],S=O[1],j=null==w?void 0:w.clipboard,P=j?C.instructions.get(j.type):null,V=j?P?x(P.title):j.type:"";return l().createElement("div",{className:"workflow-canvas-wrapper"},l().createElement(c,{FallbackComponent:u.ErrorFallback,onError:console.error},l().createElement("div",{className:"workflow-canvas",style:{zoom:A/100}},l().createElement("div",{className:(0,u.cx)(a.branchBlockClass,(0,u.css)(g()))},l().createElement("div",{className:a.branchClass},i?l().createElement(n.Alert,{type:"warning",message:(0,m.vV)("Executed workflow cannot be modified. Could be copied to a new version to modify."),showIcon:!0,className:(0,u.css)(E())}):null,l().createElement(y.Vo,null),l().createElement("div",{className:(0,u.cx)(a.branchBlockClass,(0,u.css)(k()))},l().createElement(f.lg,{entry:o})),l().createElement("div",{className:a.terminalClass},(0,m.vV)("End")))))),j?l().createElement("div",{className:a.clipboardPreviewClass},l().createElement("div",{className:"workflow-clipboard-header"},l().createElement("span",null,(0,m.vV)("Copied node")),l().createElement(n.Button,{type:"text",size:"small",icon:l().createElement(s.CloseOutlined,null),onClick:function(){var e;return null==w||null==(e=w.clearClipboard)?void 0:e.call(w)}})),l().createElement("div",{className:"workflow-clipboard-card"},l().createElement("div",{className:"workflow-clipboard-type"},V),l().createElement("div",{className:"workflow-clipboard-title"},null!=(r=j.title)?r:j.type))):null,l().createElement("div",{className:"workflow-canvas-zoomer"},l().createElement(n.Slider,{vertical:!0,reverse:!0,defaultValue:100,step:10,min:10,value:A,onChange:S})))}},1110:function(e,t,r){r.r(t),r.d(t,{WorkflowPage:function(){return G}});var n=r(3342),o=r(9155),l=r.n(o),a=r(4442),i=r(6660),c=r(5953),s=r(2059),u=r(7375),d=r(5230),f=r(7768),p=r(2596),m=r(2662),v=r(4421),y=r(7846),b=r(3872),h=r(6481),w=r(6072),g=r(6864),E=r(512),k=r(8201),x=r(7428),C=r(7107),O=r(4562),A=r(5433),S=r(3610),j=r(3312),P=r(404),V=r(2815);function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function R(e,t,r,n,o,l,a){try{var i=e[l](a),c=i.value}catch(e){r(e);return}i.done?t(c):Promise.resolve(c).then(n,o)}function T(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var l=e.apply(t,r);function a(e){R(l,n,o,a,i,"next",e)}function i(e){R(l,n,o,a,i,"throw",e)}a(void 0)})}}function D(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function B(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function F(e,t){if(null==e)return{};var r,n,o,l={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,r=Reflect.ownKeys(Object(e));o<r.length;o++)n=r[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(l[n]=e[n]);return l}if(l=function(e,t){if(null==e)return{};var r,n,o={},l=Object.getOwnPropertyNames(e);for(n=0;n<l.length;n++)r=l[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n=r[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(l[n]=e[n]);return l}function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],a=!0,i=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(l.push(r.value),!t||l.length!==t);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(i)throw n}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return N(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return N(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z(e,t){var r,n,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:c(0)}),i(a,"throw",{value:c(1)}),i(a,"return",{value:c(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function c(i){return function(c){var s=[i,c];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(l=0)),l;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return l.label++,{value:s[1],done:!1};case 5:l.label++,n=s[1],s=[0];continue;case 7:s=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){l=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){l.label=s[1];break}if(6===s[0]&&l.label<o[1]){l.label=o[1],o=s;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(s);break}o[2]&&l.ops.pop(),l.trys.pop();continue}s=t.call(e,l)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}function K(){var e,t,r=(e=["\n margin-bottom: 1em;\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return K=function(){return r},r}function U(e){var t,r=e.request,o=(e.filter,F(e,["request","filter"])),a=(0,y.$K)().workflow,i=B(D({},o),{request:B(D({},r),{params:B(D({},null==r?void 0:r.params),{filter:B(D({},null==r||null==(t=r.params)?void 0:t.filter),{key:a.key})})})});return l().createElement(n.ResourceActionProvider,i)}function $(e){var t=e.data,r=e.option,o=(0,n.useCompile)()(r.label);return l().createElement(c.Trans,{ns:b.CU,values:{statusText:o}},"Workflow executed, the result status is ",l().createElement(s.Tag,{color:r.color},"{{statusText}}"),l().createElement(a.Link,{to:(0,w.mz)(t.id)},"View the execution"))}function M(){var e=(0,y.$K)().workflow,t=(0,d.useForm)(),r=(0,n.useResourceContext)().resource,o=(0,n.useActionContext)(),a=(0,n.useNavigateNoUpdate)(),i=s.App.useApp().message,c=(0,O.sD)();return{run:function(){return T(function(){var n,s,u,d;return z(this,function(f){switch(f.label){case 0:return s=(n=t.values).autoRevision,u=F(n,["autoRevision"]),[4,t.submit()];case 1:return f.sent(),[4,r.execute(D({filterByTk:e.id,values:u},!c&&s?{autoRevision:1}:{}))];case 2:var p,m,v,y;return d=f.sent().data.data,t.reset(),o.setFormValueChanged(!1),o.setVisible(!1),null==i||i.open((m=(p=d.execution).id,v=p.status,(y=x.$Y[v])?{type:"info",content:l().createElement($,{data:{id:m},option:y})}:null)),d.newVersionId&&a((0,w.Yz)(d.newVersionId)),[2]}})})()}}}function _(e){var t=e.children,r=(0,d.useField)(),n=(0,y.$K)().workflow,o=(0,k.s5)(),a=o.validate(n.config),i="";switch(!0){case!a:i=(0,b.vV)("The trigger is not configured correctly, please check the trigger configuration.");break;case!o.triggerFieldset:i=(0,b.vV)("This type of trigger has not been supported to be executed manually.")}return r.setPattern(i?"disabled":"editable"),i?l().createElement(s.Tooltip,{title:i},t):t}function W(){var e,t=(0,y.$K)().workflow,r=(0,O.sD)(),o=(0,k.s5)();return l().createElement(y.AA.Provider,{value:t},l().createElement(C.Ws.Provider,{value:!0},l().createElement(n.SchemaComponent,{components:D({Alert:s.Alert,Fieldset:g.L,ActionDisabledProvider:_},o.components),scope:D({useCancelAction:n.useCancelAction,useExecuteConfirmAction:M},o.scope),schema:{name:"trigger-modal-".concat(t.type,"-").concat(t.id),type:"void","x-decorator":"ActionDisabledProvider","x-component":"Action","x-component-props":{openSize:"small"},title:"{{t('Execute manually', { ns: \"".concat(b.CU,'" })}}'),properties:{drawer:{type:"void","x-decorator":"FormV2","x-component":"Action.Modal",title:"{{t('Execute manually', { ns: \"".concat(b.CU,'" })}}'),properties:B(D(B(D({},Object.keys(null!=(e=o.triggerFieldset)?e:{}).length?{alert:{type:"void","x-component":"Alert","x-component-props":{message:"{{t('Trigger variables need to be filled for executing.', { ns: \"".concat(b.CU,'" })}}'),className:(0,n.css)(K())}}}:{description:{type:"void","x-component":"p","x-content":"{{t('This will perform all the actions configured in the workflow. Are you sure you want to continue?', { ns: \"".concat(b.CU,'" })}}')}}),{fieldset:{type:"void","x-decorator":"FormItem","x-component":"Fieldset",title:"{{t('Trigger variables', { ns: \"".concat(b.CU,'" })}}'),properties:o.triggerFieldset}}),r?{}:{autoRevision:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":"{{t('Automatically create a new version after execution', { ns: \"".concat(b.CU,'" })}}'),default:!0}}),{footer:{type:"void","x-component":"Action.Modal.Footer",properties:{cancel:{type:"void",title:"{{t('Cancel')}}","x-component":"Action","x-component-props":{useAction:"{{useCancelAction}}"}},submit:{type:"void",title:"{{t('Confirm')}}","x-component":"Action","x-component-props":{type:"primary",useAction:"{{useExecuteConfirmAction}}"}}}}})}}}})))}function Y(){var e=(0,y.$K)(),t=e.workflow,r=e.revisions,i=void 0===r?[]:r,d=I((0,o.useState)(!1),2),f=d[0],p=d[1],g=(0,a.useNavigate)(),k=(0,c.useTranslation)().t,C=s.App.useApp().modal,A=(0,n.useApp)(),S=(0,n.useResourceContext)().resource,j=(0,n.useResourceActionContext)().refresh,P=s.App.useApp().message,N=(0,O.Eh)(),R=(0,o.useCallback)(function(){return T(function(){var e;return z(this,function(r){switch(r.label){case 0:return[4,S.revision({filterByTk:t.id,filter:{key:t.key}})];case 1:return e=r.sent().data.data,P.success(k("Operation succeeded")),g((0,w.Yz)(e.id)),[2]}})})()},[S,t.id,t.key,P,k,g]),D=(0,o.useCallback)(function(){return T(function(){var e;return z(this,function(r){return e=t.current?(0,b.vV)("This is a main version, delete it will cause the whole workflow to be deleted (including all other revisions)."):(0,b.vV)("Current version will be deleted (without affecting other versions)."),C.confirm({title:k("Are you sure you want to delete it?"),content:e,onOk:function(){return T(function(){var e,r,n,o;return z(this,function(l){switch(l.label){case 0:return[4,S.destroy({filterByTk:t.id})];case 1:if(l.sent(),P.success(k("Operation succeeded")),e=A.pluginSettingsManager.getRoutePath("workflow"),t.current)return[2,g(e)];return i.length&&g((0,w.Yz)(null==(r=i.find(function(e){return e.current}))?void 0:r.id)),[4,S.list({filter:{key:t.key,current:!0},fields:["id"],pageSize:1})];case 2:if(200!==(n=l.sent()).status)return[2];if(!(o=I(n.data.data,1)[0]))return[2,g(e)];return[2,g((0,w.Yz)(o.id))]}})})()}}),[2]})})()},[t,C,k,S,P,g,A.pluginSettingsManager,i]),B=(0,o.useCallback)(function(e){switch(e.key){case"refresh":j();return;case"history":p(!0);return;case"revision":return R();case"delete":return D()}},[D,R,j]);return l().createElement(l().Fragment,null,l().createElement(s.Dropdown,{menu:{items:[{key:"key",label:"Key: ".concat(t.key),disabled:!0},{type:"divider"},{role:"button","aria-label":"refresh",key:"refresh",label:k("Refresh")},{role:"button","aria-label":"history",key:"history",label:(0,b.vV)("Execution history"),disabled:!N},{role:"button","aria-label":"revision",key:"revision",label:(0,b.vV)("Copy to new version")},{type:"divider"},{role:"button","aria-label":"delete",danger:!0,key:"delete",label:k("Delete")}],onClick:B}},l().createElement(s.Button,{"aria-label":"more",type:"text",icon:l().createElement(u.EllipsisOutlined,null)})),l().createElement(n.ActionContextProvider,{value:{visible:f,setVisible:p}},l().createElement(n.SchemaComponent,{schema:h.M,components:{ExecutionResourceProvider:U,ExecutionLink:v.d,ExecutionStatusColumn:m.t_},scope:{useRefreshActionProps:E.t,useResourceFilterActionProps:V.A,ExecutionStatusOptions:x.$A}})))}function q(){var e,t=(0,i.A)().styles,r=(0,a.useNavigate)(),c=(0,y.$K)().workflow,d=(0,o.useCallback)(function(e){var t=e.key;t!=c.id&&r((0,w.Yz)(t))},[c.id,r]),p=(0,n.useRequest)({resource:"workflows",action:"list",params:{filter:{key:c.key},fields:["id","createdAt","current","enabled","versionStats.executed"],sort:"-id"}},{refreshDeps:[c.id],manual:!0}),m=p.data,v=p.run,h=(0,o.useCallback)(function(e){e&&v()},[v]),g=null!=(e=null==m?void 0:m.data)?e:[];return l().createElement(s.Dropdown,{className:"workflow-versions",trigger:["click"],onOpenChange:h,menu:{onClick:d,defaultSelectedKeys:["".concat(c.id)],className:(0,n.cx)(t.dropdownClass,t.workflowVersionDropdownClass),items:g.sort(function(e,t){return t.id-e.id}).map(function(e,t){return{role:"button","aria-label":"version-".concat(t),key:"".concat(e.id),icon:e.current?l().createElement(u.RightOutlined,null):null,className:(0,n.cx)({executed:e.versionStats.executed>0,unexecuted:0==e.versionStats.executed,enabled:e.enabled}),label:l().createElement(l().Fragment,null,l().createElement("strong",null,"#".concat(e.id)),l().createElement("time",null,(0,f.dayjs)(e.createdAt).fromNow()))}})}},l().createElement(s.Button,{type:"text","aria-label":"version"},l().createElement("label",null,(0,b.vV)("Version")),l().createElement("span",null,(null==c?void 0:c.id)?"#".concat(c.id):null),l().createElement(u.DownOutlined,null)))}function L(){var e,t,r,i=(0,a.useNavigate)(),c=(0,n.useApp)(),u=(0,n.useResourceActionContext)(),d=u.data,f=u.refresh,m=u.loading,v=(0,n.useResourceContext)().resource,h=(0,n.useDocumentTitle)().setTitle,g=I((0,o.useState)(null!=(e=null==d||null==(r=d.data)?void 0:r.enabled)&&e),2),E=g[0],k=g[1],x=I((0,o.useState)(!1),2),C=x[0],O=x[1],V=null!=(t=null==d?void 0:d.data)?t:{},N=V.nodes,R=void 0===N?[]:N,D=F(V,["nodes"]);(0,w.KD)(R),(0,o.useEffect)(function(){var e,t=null!=(e=null==d?void 0:d.data)?e:{},r=t.title,n=t.enabled;null==h||h("".concat((0,b.vV)("Workflow")).concat(r?": ".concat(r):"")),k(n)},[null==d?void 0:d.data,h]);var B=(0,o.useCallback)(function(e){return T(function(){return z(this,function(t){switch(t.label){case 0:return O(!0),[4,v.update({filterByTk:D.id,values:{enabled:e}})];case 1:return t.sent(),O(!1),k(e),[2]}})})()},[v,D.id]);if(!(null==d?void 0:d.data))return m?l().createElement(s.Spin,null):l().createElement(s.Result,{status:"404",title:"Not found",extra:l().createElement(s.Button,{onClick:function(){return i(-1)}},(0,b.vV)("Go back"))});var K=R.find(function(e){return!e.upstream});return l().createElement(y.cB.Provider,{value:{workflow:D,nodes:R,refresh:f}},l().createElement("div",{className:"workflow-toolbar"},l().createElement("header",null,l().createElement(s.Breadcrumb,{items:[{title:l().createElement(a.Link,{to:c.pluginSettingsManager.getRoutePath("workflow")},(0,b.vV)("Workflow"))},{title:l().createElement(s.Tooltip,{title:"Key: ".concat(D.key)},l().createElement("strong",null,D.title))}]}),D.sync?l().createElement(s.Tag,{color:"orange"},(0,b.vV)("Synchronously")):l().createElement(s.Tag,{color:"cyan"},(0,b.vV)("Asynchronously"))),l().createElement("aside",null,l().createElement(W,null),l().createElement(q,null),l().createElement(s.Switch,{checked:E,onChange:B,checkedChildren:(0,b.vV)("On"),unCheckedChildren:(0,b.vV)("Off"),loading:C}),l().createElement(Y,null))),l().createElement(A.yf,null,l().createElement(S.J,null,l().createElement(j.b,null,l().createElement(P.L,null,l().createElement(p.i,{entry:K}))))))}var G=function(){var e,t,r,o=(0,a.useParams)(),c=(0,i.A)().styles;return l().createElement("div",{className:(0,n.cx)(c.workflowPageClass)},l().createElement(n.SchemaComponent,{schema:{type:"void",properties:(e={},t="provider_".concat(o.id),r={type:"void","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:{name:"workflows",fields:[]},resourceName:"workflows",request:{resource:"workflows",action:"get",params:{filter:{id:o.id},appends:["nodes","stats.executed","versionStats.executed"]}}},"x-component":"WorkflowCanvas"},t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e)},components:{WorkflowCanvas:L}}))}}}]);