@nocobase/plugin-workflow 1.6.0-alpha.17 → 1.6.0-alpha.19

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.
@@ -6,7 +6,7 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- /// <reference types="react" />
9
+ import React from 'react';
10
10
  import { SchemaInitializerItemType } from '@nocobase/client';
11
11
  import { RadioWithTooltip } from '../components/RadioWithTooltip';
12
12
  import { WorkflowVariableTextArea } from '../variable';
@@ -16,6 +16,7 @@ export default class extends Instruction {
16
16
  type: string;
17
17
  group: string;
18
18
  description: string;
19
+ icon: React.JSX.Element;
19
20
  fieldset: {
20
21
  engine: {
21
22
  type: string;
@@ -51,7 +52,7 @@ export default class extends Instruction {
51
52
  };
52
53
  };
53
54
  scope: {
54
- renderEngineReference: (key: string) => import("react").JSX.Element;
55
+ renderEngineReference: (key: string) => React.JSX.Element;
55
56
  };
56
57
  components: {
57
58
  WorkflowVariableTextArea: typeof WorkflowVariableTextArea;
@@ -16,6 +16,7 @@ export default class extends Instruction {
16
16
  type: string;
17
17
  group: string;
18
18
  description: string;
19
+ icon: React.JSX.Element;
19
20
  fieldset: {
20
21
  rejectOnFalse: {
21
22
  type: string;
@@ -6,7 +6,7 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- /// <reference types="react" />
9
+ import React from 'react';
10
10
  import { SchemaInitializerItemType, useCollectionDataSource } from '@nocobase/client';
11
11
  import { AssignedFieldsFormSchemaConfig } from '../components/AssignedFieldsFormSchemaConfig';
12
12
  import { Instruction, useNodeSavedConfig } from '.';
@@ -20,6 +20,7 @@ export default class extends Instruction {
20
20
  type: string;
21
21
  group: string;
22
22
  description: string;
23
+ icon: React.JSX.Element;
23
24
  fieldset: {
24
25
  collection: {
25
26
  'x-disabled': string;
@@ -101,7 +102,7 @@ export default class extends Instruction {
101
102
  useNodeSavedConfig: typeof useNodeSavedConfig;
102
103
  };
103
104
  components: {
104
- CollectionFieldset: import("react").MemoExoticComponent<import("@formily/reactive-react").ReactFC<Omit<any, "ref">>>;
105
+ CollectionFieldset: React.MemoExoticComponent<import("@formily/reactive-react").ReactFC<Omit<any, "ref">>>;
105
106
  AssignedFieldsFormSchemaConfig: typeof AssignedFieldsFormSchemaConfig;
106
107
  };
107
108
  useVariables: typeof useVariables;
@@ -6,6 +6,7 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
+ import React from 'react';
9
10
  import { useCollectionDataSource } from '@nocobase/client';
10
11
  import { FilterDynamicComponent } from '../components/FilterDynamicComponent';
11
12
  import { Instruction, useNodeSavedConfig } from '.';
@@ -14,6 +15,7 @@ export default class extends Instruction {
14
15
  type: string;
15
16
  group: string;
16
17
  description: string;
18
+ icon: React.JSX.Element;
17
19
  fieldset: {
18
20
  collection: {
19
21
  'x-disabled': string;
@@ -6,12 +6,14 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
+ import React from 'react';
9
10
  import { Instruction } from '.';
10
11
  export default class extends Instruction {
11
12
  title: string;
12
13
  type: string;
13
14
  group: string;
14
15
  description: string;
16
+ icon: React.JSX.Element;
15
17
  fieldset: {
16
18
  endStatus: {
17
19
  type: string;
@@ -27,6 +27,7 @@ export declare abstract class Instruction {
27
27
  type: string;
28
28
  group: string;
29
29
  description?: string;
30
+ icon?: JSX.Element;
30
31
  /**
31
32
  * @deprecated migrate to `presetFieldset` instead
32
33
  */
@@ -6,7 +6,7 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- /// <reference types="react" />
9
+ import React from 'react';
10
10
  import { SchemaInitializerItemType, useCollectionDataSource } from '@nocobase/client';
11
11
  import { FilterDynamicComponent } from '../components/FilterDynamicComponent';
12
12
  import { WorkflowVariableInput } from '../variable';
@@ -22,6 +22,7 @@ export default class extends Instruction {
22
22
  type: string;
23
23
  group: string;
24
24
  description: string;
25
+ icon: React.JSX.Element;
25
26
  fieldset: {
26
27
  collection: {
27
28
  'x-disabled': string;
@@ -219,13 +220,13 @@ export default class extends Instruction {
219
220
  }[];
220
221
  };
221
222
  components: {
222
- ArrayItems: import("@formily/react").ReactFC<import("react").HTMLAttributes<HTMLDivElement>> & import("@formily/antd-v5").ArrayBaseMixins & {
223
- Item: import("@formily/react").ReactFC<import("react").HTMLAttributes<HTMLDivElement> & {
223
+ ArrayItems: import("@formily/react").ReactFC<React.HTMLAttributes<HTMLDivElement>> & import("@formily/antd-v5").ArrayBaseMixins & {
224
+ Item: import("@formily/react").ReactFC<React.HTMLAttributes<HTMLDivElement> & {
224
225
  type?: "divide" | "card";
225
226
  }>;
226
227
  };
227
228
  FilterDynamicComponent: typeof FilterDynamicComponent;
228
- SchemaComponentContext: import("react").Context<import("@nocobase/client").ISchemaComponentContext>;
229
+ SchemaComponentContext: React.Context<import("@nocobase/client").ISchemaComponentContext>;
229
230
  WorkflowVariableInput: typeof WorkflowVariableInput;
230
231
  RadioWithTooltip: typeof RadioWithTooltip;
231
232
  };
@@ -6,7 +6,7 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- /// <reference types="react" />
9
+ import React from 'react';
10
10
  import { useCollectionDataSource } from '@nocobase/client';
11
11
  import { AssignedFieldsFormSchemaConfig } from '../components/AssignedFieldsFormSchemaConfig';
12
12
  import { FilterDynamicComponent } from '../components/FilterDynamicComponent';
@@ -17,6 +17,7 @@ export default class extends Instruction {
17
17
  type: string;
18
18
  group: string;
19
19
  description: string;
20
+ icon: React.JSX.Element;
20
21
  fieldset: {
21
22
  collection: {
22
23
  'x-disabled': string;
@@ -107,7 +108,7 @@ export default class extends Instruction {
107
108
  };
108
109
  components: {
109
110
  FilterDynamicComponent: typeof FilterDynamicComponent;
110
- CollectionFieldset: import("react").MemoExoticComponent<import("@formily/reactive-react").ReactFC<Omit<any, "ref">>>;
111
+ CollectionFieldset: React.MemoExoticComponent<import("@formily/reactive-react").ReactFC<Omit<any, "ref">>>;
111
112
  AssignedFieldsFormSchemaConfig: typeof AssignedFieldsFormSchemaConfig;
112
113
  RadioWithTooltip: typeof RadioWithTooltip;
113
114
  };
@@ -11,8 +11,8 @@ module.exports = {
11
11
  "react": "18.2.0",
12
12
  "@formily/core": "2.3.0",
13
13
  "@formily/react": "2.3.0",
14
- "@nocobase/client": "1.6.0-alpha.17",
15
- "@nocobase/utils": "1.6.0-alpha.17",
14
+ "@nocobase/client": "1.6.0-alpha.19",
15
+ "@nocobase/utils": "1.6.0-alpha.19",
16
16
  "antd": "5.12.8",
17
17
  "@ant-design/icons": "5.2.6",
18
18
  "react-router-dom": "6.21.0",
@@ -20,15 +20,15 @@ module.exports = {
20
20
  "@formily/shared": "2.3.2",
21
21
  "lodash": "4.17.21",
22
22
  "sequelize": "6.35.2",
23
- "@nocobase/database": "1.6.0-alpha.17",
24
- "@nocobase/server": "1.6.0-alpha.17",
25
- "@nocobase/logger": "1.6.0-alpha.17",
26
- "@nocobase/actions": "1.6.0-alpha.17",
27
- "@nocobase/data-source-manager": "1.6.0-alpha.17",
28
- "@nocobase/evaluators": "1.6.0-alpha.17",
23
+ "@nocobase/database": "1.6.0-alpha.19",
24
+ "@nocobase/server": "1.6.0-alpha.19",
25
+ "@nocobase/logger": "1.6.0-alpha.19",
26
+ "@nocobase/actions": "1.6.0-alpha.19",
27
+ "@nocobase/data-source-manager": "1.6.0-alpha.19",
28
+ "@nocobase/evaluators": "1.6.0-alpha.19",
29
29
  "@formily/antd-v5": "1.1.9",
30
30
  "@formily/reactive": "2.3.0",
31
31
  "dayjs": "1.11.10",
32
- "@nocobase/plugin-workflow-test": "1.6.0-alpha.17",
33
- "@nocobase/test": "1.6.0-alpha.17"
32
+ "@nocobase/plugin-workflow-test": "1.6.0-alpha.19",
33
+ "@nocobase/test": "1.6.0-alpha.19"
34
34
  };
@@ -31,8 +31,8 @@
31
31
  "Data operation nodes in workflow will run in a same transaction until any interruption. Any failure will cause data rollback, and will also rollback the history of the execution.":
32
32
  "工作流中的节点将在同一个事务中运行。任何失败都会导致数据回滚,同时也会回滚相应的执行历史。",
33
33
  "Auto delete history when execution is on end status": "执行结束后自动删除对应状态的历史记录",
34
- "Maximum number of loop calls": "最大循环调用次数",
35
- "If the number of loop calls is too large, there will be performance issues.": "如果循环调用次数过大,会有性能问题",
34
+ "Maximum number of cycling triggers": "最大循环触发次数",
35
+ "The triggers of same workflow by some node (create, update and sub-flow etc.) more than this number will be ignored. Large number may cause performance issues. Please use with caution.": "由某个节点(创建、更新和子流程等)触发同一个工作流超过这个次数时将被忽略。设置过高的次数可能会导致性能问题,请谨慎使用。",
36
36
  "Trigger": "触发器",
37
37
  "Unknown trigger": "未知触发器",
38
38
  "Workflow with unknown type will cause error. Please delete it or check plugin which provide this type.": "未知类型的工作流会导致错误,请删除或检查提供该类型的插件。",
@@ -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":"2025-01-19T13:21:10.970Z"}
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":"2025-01-25T13:20:37.806Z"}
@@ -1 +1 @@
1
- {"name":"lru-cache","description":"A cache object that deletes the least-recently-used items.","version":"8.0.5","author":"Isaac Z. Schlueter <i@izs.me>","keywords":["mru","lru","cache"],"sideEffects":false,"scripts":{"build":"npm run prepare","preprepare":"rm -rf dist","prepare":"tsc -p tsconfig.json && tsc -p tsconfig-esm.json","postprepare":"bash fixup.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"c8 tap","snap":"c8 tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write .","typedoc":"typedoc --tsconfig tsconfig-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"},"main":"./dist/cjs/index-cjs.js","module":"./dist/mjs/index.js","types":"./dist/mjs/index.d.ts","exports":{"./min":{"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.min.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.min.js"}},".":{"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index-cjs.js"}}},"repository":"git://github.com/isaacs/node-lru-cache.git","devDependencies":{"@size-limit/preset-small-lib":"^7.0.8","@types/node":"^17.0.31","@types/tap":"^15.0.6","benchmark":"^2.1.4","c8":"^7.11.2","clock-mock":"^1.0.6","esbuild":"^0.17.11","eslint-config-prettier":"^8.5.0","marked":"^4.2.12","mkdirp":"^2.1.5","prettier":"^2.6.2","size-limit":"^7.0.8","tap":"^16.3.4","ts-node":"^10.7.0","tslib":"^2.4.0","typedoc":"^0.23.24","typescript":"^4.6.4"},"license":"ISC","files":["dist"],"engines":{"node":">=16.14"},"prettier":{"semi":false,"printWidth":70,"tabWidth":2,"useTabs":false,"singleQuote":true,"jsxSingleQuote":false,"bracketSameLine":true,"arrowParens":"avoid","endOfLine":"lf"},"tap":{"coverage":false,"node-arg":["--expose-gc","--no-warnings","--loader","ts-node/esm"],"ts":false},"size-limit":[{"path":"./dist/mjs/index.js"}],"_lastModified":"2025-01-19T13:21:10.586Z"}
1
+ {"name":"lru-cache","description":"A cache object that deletes the least-recently-used items.","version":"8.0.5","author":"Isaac Z. Schlueter <i@izs.me>","keywords":["mru","lru","cache"],"sideEffects":false,"scripts":{"build":"npm run prepare","preprepare":"rm -rf dist","prepare":"tsc -p tsconfig.json && tsc -p tsconfig-esm.json","postprepare":"bash fixup.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"c8 tap","snap":"c8 tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write .","typedoc":"typedoc --tsconfig tsconfig-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"},"main":"./dist/cjs/index-cjs.js","module":"./dist/mjs/index.js","types":"./dist/mjs/index.d.ts","exports":{"./min":{"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.min.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.min.js"}},".":{"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index-cjs.js"}}},"repository":"git://github.com/isaacs/node-lru-cache.git","devDependencies":{"@size-limit/preset-small-lib":"^7.0.8","@types/node":"^17.0.31","@types/tap":"^15.0.6","benchmark":"^2.1.4","c8":"^7.11.2","clock-mock":"^1.0.6","esbuild":"^0.17.11","eslint-config-prettier":"^8.5.0","marked":"^4.2.12","mkdirp":"^2.1.5","prettier":"^2.6.2","size-limit":"^7.0.8","tap":"^16.3.4","ts-node":"^10.7.0","tslib":"^2.4.0","typedoc":"^0.23.24","typescript":"^4.6.4"},"license":"ISC","files":["dist"],"engines":{"node":">=16.14"},"prettier":{"semi":false,"printWidth":70,"tabWidth":2,"useTabs":false,"singleQuote":true,"jsxSingleQuote":false,"bracketSameLine":true,"arrowParens":"avoid","endOfLine":"lf"},"tap":{"coverage":false,"node-arg":["--expose-gc","--no-warnings","--loader","ts-node/esm"],"ts":false},"size-limit":[{"path":"./dist/mjs/index.js"}],"_lastModified":"2025-01-25T13:20:37.427Z"}
@@ -33,7 +33,7 @@ var executions_default = {
33
33
  dumpRules: {
34
34
  group: "log"
35
35
  },
36
- migrationRules: ["schema-only", "skip"],
36
+ migrationRules: ["schema-only"],
37
37
  name: "executions",
38
38
  shared: true,
39
39
  fields: [
@@ -31,7 +31,7 @@ __export(flow_nodes_exports, {
31
31
  module.exports = __toCommonJS(flow_nodes_exports);
32
32
  var flow_nodes_default = {
33
33
  dumpRules: "required",
34
- migrationRules: ["overwrite", "skip"],
34
+ migrationRules: ["overwrite", "schema-only"],
35
35
  name: "flow_nodes",
36
36
  shared: true,
37
37
  fields: [
@@ -33,7 +33,7 @@ var jobs_default = {
33
33
  dumpRules: {
34
34
  group: "log"
35
35
  },
36
- migrationRules: ["schema-only", "skip"],
36
+ migrationRules: ["schema-only"],
37
37
  name: "jobs",
38
38
  shared: true,
39
39
  fields: [
@@ -32,7 +32,7 @@ module.exports = __toCommonJS(workflows_exports);
32
32
  function workflows_default() {
33
33
  return {
34
34
  dumpRules: "required",
35
- migrationRules: ["overwrite", "skip"],
35
+ migrationRules: ["overwrite", "schema-only"],
36
36
  name: "workflows",
37
37
  shared: true,
38
38
  repository: "WorkflowRepository",
@@ -186,7 +186,7 @@ class DateFieldScheduleTrigger {
186
186
  const modExp = (0, import_database.fn)(
187
187
  "MOD",
188
188
  (0, import_database.literal)(
189
- `${Math.round(timestamp / 1e3)} - ${db.sequelize.getQueryInterface().quoteIdentifiers(tsFn(field))}`
189
+ `${Math.round(timestamp / 1e3)} - ${tsFn(db.sequelize.getQueryInterface().quoteIdentifiers(field))}`
190
190
  ),
191
191
  Math.round(repeat / 1e3)
192
192
  );
package/package.json CHANGED
@@ -4,13 +4,13 @@
4
4
  "displayName.zh-CN": "工作流",
5
5
  "description": "A powerful BPM tool that provides foundational support for business automation, with the capability to extend unlimited triggers and nodes.",
6
6
  "description.zh-CN": "一个强大的 BPM 工具,为业务自动化提供基础支持,并且可任意扩展更多的触发器和节点。",
7
- "version": "1.6.0-alpha.17",
7
+ "version": "1.6.0-alpha.19",
8
8
  "license": "AGPL-3.0",
9
9
  "main": "./dist/server/index.js",
10
10
  "homepage": "https://docs.nocobase.com/handbook/workflow",
11
11
  "homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/workflow",
12
12
  "dependencies": {
13
- "@nocobase/plugin-workflow-test": "1.6.0-alpha.17"
13
+ "@nocobase/plugin-workflow-test": "1.6.0-alpha.19"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@ant-design/icons": "5.x",
@@ -44,7 +44,7 @@
44
44
  "@nocobase/test": "1.x",
45
45
  "@nocobase/utils": "1.x"
46
46
  },
47
- "gitHead": "7212bf5f8f59bc3fcfa1e62387c60665112310fb",
47
+ "gitHead": "667b67a161c841c01d4ab337afa42cd29d6cf540",
48
48
  "keywords": [
49
49
  "Workflow"
50
50
  ]
@@ -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([["923"],{1837:function(e,t,o){o.r(t),o.d(t,{WorkflowPane:function(){return V}});var n,r,c=o("8156"),i=o.n(c),l=o("2721"),a=o("8563"),p=o("3505"),s=o("3772"),u=o("8958");function m(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{},n=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),n.forEach(function(t){var n,r,c;n=e,r=t,c=o[t],r in n?Object.defineProperty(n,r,{value:c,enumerable:!0,configurable:!0,writable:!0}):n[r]=c})}return e}function d(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o.push.apply(o,n)}return o})(Object(t)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))}),e}var y=function(e){var t,o=e.request,n=(e.filter,function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},c=Object.keys(e);for(n=0;n<c.length;n++)o=c[n],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++){if(o=c[n],!(t.indexOf(o)>=0))Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}}return r}(e,["request","filter"])),r=(0,s.useRecord)(),c=d(m({},n),{request:d(m({},o),{params:d(m({},null==o?void 0:o.params),{filter:d(m({},null==o?void 0:null===(t=o.params)||void 0===t?void 0:t.filter),{key:r.key})})})});return i().createElement(s.ResourceActionProvider,c)},f=o("3238"),b=o("6128"),x=o("7893"),v=function(){var e=(0,f.useTranslation)().t,t=(0,s.useRecord)().id,o=(0,s.useActionContext)().setVisible,n=(0,s.useGetAriaLabelOfAction)("Configure").getAriaLabel;return i().createElement(b.Link,{"aria-label":n(),to:(0,x.SI)(t),onClick:function(){return o(!1)}},e("Configure"))};function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}function g(e){var t,o,n,r,l=e.component,a=e.children,u=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},c=Object.keys(e);for(n=0;n<c.length;n++)o=c[n],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++){if(o=c[n],!(t.indexOf(o)>=0))Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}}return r}(e,["component","children"]);var m=(t=(0,c.useState)(!1),o=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var o,n,r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var c=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(c.push(o.value),!t||c.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{!i&&null!=r.return&&r.return()}finally{if(l)throw n}}return c}}(t,2)||function(e,t){if(e){if("string"==typeof e)return O(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);if("Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o)return Array.from(o);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return O(e,t)}}(t,o)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),d=m[0],y=m[1],f=(0,p.useFieldSchema)();return i().createElement(s.ActionContextProvider,{value:{visible:d,setVisible:y,fieldSchema:f}},i().createElement(void 0===l?"div":l,(n=function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{},n=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),n.forEach(function(t){var n,r,c;n=e,r=t,c=o[t],r in n?Object.defineProperty(n,r,{value:c,enumerable:!0,configurable:!0,writable:!0}):n[r]=c})}return e}({},u),r=(r={onClick:function(){y(!0)}},r),Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o.push.apply(o,n)}return o})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n),a),i().createElement(s.SchemaComponent,{schema:f,onlyRenderProperties:!0}))}var h=o("573"),A=o("2659");function w(e,t,o,n,r,c,i){try{var l=e[c](i),a=l.value}catch(e){o(e);return}l.done?t(a):Promise.resolve(a).then(n,r)}function S(e){return function(){var t=this,o=arguments;return new Promise(function(n,r){var c=e.apply(t,o);function i(e){w(c,n,r,i,l,"next",e)}function l(e){w(c,n,r,i,l,"throw",e)}i(void 0)})}}function P(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function j(e,t){var o,n,r,c,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return c={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function l(c){return function(l){return function(c){if(o)throw TypeError("Generator is already executing.");for(;i;)try{if(o=1,n&&(r=2&c[0]?n.return:c[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,c[1])).done)return r;switch(n=0,r&&(c=[2&c[0],r.value]),c[0]){case 0:case 1:r=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,n=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(r=(r=i.trys).length>0&&r[r.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!r||c[1]>r[0]&&c[1]<r[3])){i.label=c[1];break}if(6===c[0]&&i.label<r[1]){i.label=r[1],r=c;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(c);break}r[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],n=0}finally{o=r=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,l])}}}var C={name:"workflows",fields:[{type:"string",name:"title",interface:"input",uiSchema:{title:'{{t("Name")}}',type:"string","x-component":"Input",required:!0}},{type:"string",name:"type",interface:"select",uiSchema:{title:'{{t("Trigger type", { ns: "'.concat(h.A7,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"Select",enum:"{{useTriggersOptions()}}","x-component-props":{optionRender:function(e){var t=e.data,o=t.label,n=t.color,r=t.options,c=(0,s.useCompile)();return i().createElement(l.Space,{direction:"vertical"},i().createElement(l.Tag,{color:n},c(o)),i().createElement(l.Typography.Text,{type:"secondary",style:{whiteSpace:"normal"}},c(r.description)))},popupMatchSelectWidth:!0,listHeight:300},required:!0}},{type:"boolean",name:"sync",interface:"radioGroup",uiSchema:{title:'{{t("Mode", { ns: "'.concat(h.A7,'" })}}'),type:"boolean","x-decorator":"FormItem","x-component":"Radio.Group",enum:[{label:'{{ t("Asynchronously", { ns: "'.concat(h.A7,'" }) }}'),value:!1,color:"cyan"},{label:'{{ t("Synchronously", { ns: "'.concat(h.A7,'" }) }}'),value:!0,color:"orange"}],required:!0}},{type:"string",name:"description",interface:"textarea",uiSchema:{title:'{{t("Description")}}',type:"string","x-component":"Input.TextArea"}},{type:"boolean",name:"enabled",interface:"radioGroup",uiSchema:{title:'{{t("Status", { ns: "'.concat(h.A7,'" })}}'),type:"string",enum:[{label:'{{t("On", { ns: "'.concat(h.A7,'" })}}'),value:!0,color:"#52c41a"},{label:'{{t("Off", { ns: "'.concat(h.A7,'" })}}'),value:!1}],"x-component":"Radio.Group","x-decorator":"FormItem",default:!1}},{type:"number",name:"allExecuted",interface:"integer",uiSchema:{title:'{{t("Executed", { ns: "'.concat(h.A7,'" })}}'),type:"number","x-component":"InputNumber","x-decorator":"FormItem"}},{type:"object",name:"options"}]},k={title:{"x-component":"CollectionField","x-decorator":"FormItem"},type:{"x-component":"CollectionField","x-decorator":"FormItem"},sync:{type:"boolean",title:'{{ t("Execute mode", { ns: "'.concat(h.A7,'" }) }}'),description:'{{ t("Execute workflow asynchronously or synchronously based on trigger type, and could not be changed after created.", { ns: "'.concat(h.A7,'" }) }}'),"x-decorator":"FormItem","x-component":"SyncOptionSelect","x-component-props":{options:[{label:'{{ t("Asynchronously", { ns: "'.concat(h.A7,'" }) }}'),value:!1,tooltip:'{{ t("Will be executed in the background as a queued task.", { ns: "'.concat(h.A7,'" }) }}')},{label:'{{ t("Synchronously", { ns: "'.concat(h.A7,'" }) }}'),value:!0,tooltip:'{{ t("For user actions that require immediate feedback. Can not use asynchronous nodes in such mode, and it is not recommended to perform time-consuming operations under synchronous mode.", { ns: "'.concat(h.A7,'" }) }}')}]}},enabled:{"x-component":"CollectionField","x-decorator":"FormItem"},description:{"x-component":"CollectionField","x-decorator":"FormItem"},options:{type:"object","x-component":"fieldset",properties:{deleteExecutionOnStatus:{type:"array",title:'{{ t("Auto delete history when execution is on end status", { ns: "'.concat(h.A7,'" }) }}'),"x-decorator":"FormItem","x-component":"ExecutionStatusSelect","x-component-props":{multiple:!0}},stackLimit:{type:"number",title:'{{ t("Maximum number of loop calls", { ns: "'.concat(h.A7,'" }) }}'),description:'{{ t("If the number of loop calls is too large, there will be performance issues.", { ns: "'.concat(h.A7,'" }) }}'),"x-decorator":"FormItem",default:1,"x-component":"InputNumber","x-component-props":{min:1,precision:0}}}}},E=P({name:"workflow",type:"void"},"properties",P({},"provider",P({type:"void","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:C,resourceName:"workflows",request:{resource:"workflows",action:"list",params:{filter:{current:!0},sort:["-createdAt"],except:["config"]}}},"x-component":"CollectionProvider_deprecated","x-component-props":{collection:C}},"properties",P({actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{filter:{type:"void",title:'{{ t("Filter") }}',default:{$and:[{title:{$includes:""}}]},"x-action":"filter","x-component":"Filter.Action","x-use-component-props":"cm.useFilterActionProps","x-component-props":{icon:"FilterOutlined"},"x-align":"left"},refresher:{type:"void",title:'{{ t("Refresh") }}',"x-component":"Action","x-use-component-props":"useRefreshActionProps","x-component-props":{icon:"ReloadOutlined"}},sync:{type:"void",title:'{{t("Sync", { ns: "'.concat(h.A7,'" })}}'),"x-decorator":"Tooltip","x-decorator-props":{title:'{{ t("Sync enabled status of all workflows from database", { ns: "'.concat(h.A7,'" }) }}')},"x-component":"Action","x-component-props":{icon:"SyncOutlined",useAction:function(){var e=(0,f.useTranslation)().t,t=(0,s.useResourceContext)().resource,o=(0,s.useResourceActionContext)();return{run:function(){return S(function(){return j(this,function(n){switch(n.label){case 0:return[4,t.sync()];case 1:return n.sent(),[4,null==o?void 0:o.refresh()];case 2:return n.sent(),l.message.success(e("Operation succeeded")),[2]}})})()}}}},"x-reactions":["{{useWorkflowSyncAction}}"]},delete:{type:"void",title:'{{t("Delete")}}',"x-component":"Action","x-component-props":{icon:"DeleteOutlined",useAction:"{{ cm.useBulkDestroyAction }}",confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}}},create:{type:"void",title:'{{t("Add new")}}',"x-component":"Action","x-component-props":{type:"primary",icon:"PlusOutlined"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{initialValue:{current:!0}},title:'{{t("Add new")}}',properties:{title:k.title,type:k.type,sync:k.sync,description:k.description,options:k.options,footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useCreateAction }}"}}}}}}}}}}},"table",P({type:"void","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useDataSource:"{{ cm.useDataSourceFromRAC }}"}},"properties",P({title:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{title:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},type:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{type:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},sync:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{sync:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0}}},enabled:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{enabled:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0,default:!1}}},allExecuted:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{allExecuted:{type:"number","x-decorator":"OpenDrawer","x-decorator-props":{component:function(e){var t=(0,s.useRecord)();return i().createElement("a",function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{},n=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),n.forEach(function(t){P(e,t,o[t])})}return e}({"aria-label":"executed-".concat(t.title)},e))}},"x-component":"CollectionField","x-read-pretty":!0,properties:{drawer:A.V}}}}},"actions",P({type:"void",title:'{{ t("Actions") }}',"x-component":"Table.Column"},"properties",P({},"actions",P({type:"void","x-component":"Space","x-component-props":{split:"|"}},"properties",(P(r={configure:{type:"void","x-component":"WorkflowLink"},update:{type:"void",title:'{{ t("Edit") }}',"x-component":"Action.Link","x-component-props":{type:"primary"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues:"{{ cm.useValuesFromRecord }}"},title:'{{ t("Edit") }}',properties:{title:k.title,enabled:k.enabled,sync:k.sync,description:k.description,options:k.options,footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useUpdateAction }}"}}}}}}}}},"revision",P({type:"void",title:'{{t("Duplicate", { ns: "'.concat(h.A7,'" })}}'),"x-component":"Action.Link","x-component-props":{openSize:"small"}},"properties",P({},"modal",P({type:"void",title:'{{t("Duplicate to new workflow", { ns: "'.concat(h.A7,'" })}}'),"x-decorator":"FormV2","x-component":"Action.Modal"},"properties",P({title:{type:"string",title:'{{t("Title")}}',"x-decorator":"FormItem","x-component":"Input"}},"footer",P({type:"void","x-component":"Action.Modal.Footer"},"properties",(P(n={},"submit",P({type:"void",title:'{{t("Submit")}}',"x-component":"Action"},"x-component-props",P({type:"primary"},"useAction",function(){var e=(0,f.useTranslation)().t,t=(0,s.useResourceActionContext)().refresh,o=(0,s.useResourceContext)(),n=o.resource,r=o.targetKey,c=(0,s.useActionContext)().setVisible,i=(0,s.useRecord)()[r],a=(0,p.useForm)().values;return{run:function(){return S(function(){return j(this,function(o){switch(o.label){case 0:return[4,n.revision({filterByTk:i,values:a})];case 1:return o.sent(),l.message.success(e("Operation succeeded")),t(),c(!1),[2]}})})()}}}))),P(n,"cancel",{type:"void",title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}}),n))))))),P(r,"delete",{type:"void",title:'{{ t("Delete") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"},useAction:"{{ cm.useDestroyActionAndRefreshCM }}"}}),r)))))))))),F=o("2266"),D=o("3552"),T=o("8327");function I(e){var t=(0,p.useField)(),o=(0,s.useRecord)(),n=(0,s.usePlugin)(D.default);return(0,p.useFormEffects)(function(e){(0,a.onFieldChange)("type",function(e){var r=o.id||!e.value;if(e.value){var c=n.triggers.get(e.value);null!=c.sync?(r=!0,t.setValue(c.sync)):t.setInitialValue(!1)}t.setPattern(r?"disabled":"editable")})}),(0,c.useEffect)(function(){if(o.id){t.setPattern("disabled");var e=n.triggers.get(o.type);null!=e.sync?t.setValue(e.sync):t.setInitialValue(!1)}},[o.id,t,n.triggers]),i().createElement(D.RadioWithTooltip,e)}function R(e){var t=(0,s.useApp)();e.visible=!!((0,s.usePlugin)("multi-app-share-collection")||"main"!==t.name)}function V(){var e,t,o=(0,c.useContext)(s.SchemaComponentContext),n=(0,s.usePlugin)(D.default).useTriggersOptions;return i().createElement(l.Card,{bordered:!1},i().createElement(s.SchemaComponentContext.Provider,{value:(e=function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{},n=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),n.forEach(function(t){var n,r,c;n=e,r=t,c=o[t],r in n?Object.defineProperty(n,r,{value:c,enumerable:!0,configurable:!0,writable:!0}):n[r]=c})}return e}({},o),t=(t={designable:!1},t),Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o.push.apply(o,n)}return o})(Object(t)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))}),e)},i().createElement(s.SchemaComponent,{schema:E,components:{WorkflowLink:v,ExecutionResourceProvider:y,ExecutionLink:u.a,OpenDrawer:g,ExecutionStatusSelect:F.P,SyncOptionSelect:I,ExecutionStatusColumn:F.r,Tooltip:l.Tooltip},scope:{useTriggersOptions:n,useWorkflowSyncAction:R,useRefreshActionProps:T.X}})))}}}]);