@nocobase/plugin-workflow 2.1.0-beta.13 → 2.1.0-beta.15
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.
- package/dist/client/10.54a0831f49cae121.js +10 -0
- package/dist/client/781.d46db08dcfead1b0.js +10 -0
- package/dist/client/index.js +1 -1
- package/dist/client/schemas/executions.d.ts +0 -1
- package/dist/externalVersion.js +13 -13
- package/dist/node_modules/cron-parser/package.json +1 -1
- package/dist/node_modules/lru-cache/package.json +1 -1
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/server/instructions/index.d.ts +9 -1
- package/dist/swagger/index.d.ts +44 -75
- package/dist/swagger/index.js +36 -67
- package/package.json +3 -3
- package/dist/client/46ff6b84722c73a7.js +0 -10
- package/dist/client/f8056df738a9f579.js +0 -10
- /package/dist/client/{70e9dec82e952acf.js → 626.7d24ff2a47742f1b.js} +0 -0
- /package/dist/client/{f39e94207f92e352.js → 771.5e7be8b4d4ac579f.js} +0 -0
package/dist/externalVersion.js
CHANGED
|
@@ -11,29 +11,29 @@ 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.
|
|
15
|
-
"@nocobase/utils": "2.1.0-beta.
|
|
14
|
+
"@nocobase/client": "2.1.0-beta.15",
|
|
15
|
+
"@nocobase/utils": "2.1.0-beta.15",
|
|
16
16
|
"antd": "5.24.2",
|
|
17
17
|
"@ant-design/icons": "5.6.1",
|
|
18
18
|
"react-router-dom": "6.30.1",
|
|
19
19
|
"react-i18next": "11.18.6",
|
|
20
|
-
"lodash": "4.
|
|
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.
|
|
24
|
-
"@nocobase/plugin-mobile": "2.1.0-beta.
|
|
23
|
+
"@nocobase/flow-engine": "2.1.0-beta.15",
|
|
24
|
+
"@nocobase/plugin-mobile": "2.1.0-beta.15",
|
|
25
25
|
"sequelize": "6.35.2",
|
|
26
|
-
"@nocobase/server": "2.1.0-beta.
|
|
27
|
-
"@nocobase/database": "2.1.0-beta.
|
|
28
|
-
"@nocobase/data-source-manager": "2.1.0-beta.
|
|
29
|
-
"@nocobase/logger": "2.1.0-beta.
|
|
30
|
-
"@nocobase/evaluators": "2.1.0-beta.
|
|
26
|
+
"@nocobase/server": "2.1.0-beta.15",
|
|
27
|
+
"@nocobase/database": "2.1.0-beta.15",
|
|
28
|
+
"@nocobase/data-source-manager": "2.1.0-beta.15",
|
|
29
|
+
"@nocobase/logger": "2.1.0-beta.15",
|
|
30
|
+
"@nocobase/evaluators": "2.1.0-beta.15",
|
|
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.
|
|
35
|
+
"@nocobase/actions": "2.1.0-beta.15",
|
|
36
36
|
"dayjs": "1.11.13",
|
|
37
|
-
"@nocobase/plugin-workflow-test": "2.1.0-beta.
|
|
38
|
-
"@nocobase/test": "2.1.0-beta.
|
|
37
|
+
"@nocobase/plugin-workflow-test": "2.1.0-beta.15",
|
|
38
|
+
"@nocobase/test": "2.1.0-beta.15"
|
|
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-
|
|
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-24T08:10:18.224Z"}
|
|
@@ -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":"2026-04-
|
|
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":"2026-04-24T08:10:17.890Z"}
|
|
@@ -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-
|
|
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-24T08:10:17.690Z"}
|
|
@@ -15,7 +15,15 @@ export interface IJob {
|
|
|
15
15
|
result?: unknown;
|
|
16
16
|
[key: string]: unknown;
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* The result of an instruction execution.
|
|
20
|
+
*
|
|
21
|
+
* Different type of result will cause according behavior in the workflow engine:
|
|
22
|
+
* 1. IJob | Promise<IJob>: processor will continue default processing by checking the status.
|
|
23
|
+
* 2. `null` | Promise<null>: processor will do exit process.
|
|
24
|
+
* 3. `void` | Promise<void>: processor will do nothing, and terminate the current execution without any action.
|
|
25
|
+
*/
|
|
26
|
+
export type InstructionResult = IJob | Promise<IJob> | Promise<void> | Promise<null> | null | void;
|
|
19
27
|
export type Runner = (node: FlowNodeModel, input: any, processor: Processor) => InstructionResult;
|
|
20
28
|
export type InstructionInterface = {
|
|
21
29
|
run: Runner;
|
package/dist/swagger/index.d.ts
CHANGED
|
@@ -329,24 +329,19 @@ declare const _default: {
|
|
|
329
329
|
'application/json': {
|
|
330
330
|
schema: {
|
|
331
331
|
type: string;
|
|
332
|
+
description: string;
|
|
332
333
|
properties: {
|
|
333
|
-
|
|
334
|
+
title: {
|
|
335
|
+
type: string;
|
|
336
|
+
description: string;
|
|
337
|
+
};
|
|
338
|
+
enabled: {
|
|
339
|
+
type: string;
|
|
340
|
+
description: string;
|
|
341
|
+
};
|
|
342
|
+
current: {
|
|
334
343
|
type: string;
|
|
335
344
|
description: string;
|
|
336
|
-
properties: {
|
|
337
|
-
title: {
|
|
338
|
-
type: string;
|
|
339
|
-
description: string;
|
|
340
|
-
};
|
|
341
|
-
enabled: {
|
|
342
|
-
type: string;
|
|
343
|
-
description: string;
|
|
344
|
-
};
|
|
345
|
-
current: {
|
|
346
|
-
type: string;
|
|
347
|
-
description: string;
|
|
348
|
-
};
|
|
349
|
-
};
|
|
350
345
|
};
|
|
351
346
|
};
|
|
352
347
|
};
|
|
@@ -417,13 +412,8 @@ declare const _default: {
|
|
|
417
412
|
'application/json': {
|
|
418
413
|
schema: {
|
|
419
414
|
type: string;
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
values: {
|
|
423
|
-
type: string;
|
|
424
|
-
description: string;
|
|
425
|
-
};
|
|
426
|
-
};
|
|
415
|
+
description: string;
|
|
416
|
+
additionalProperties: boolean;
|
|
427
417
|
};
|
|
428
418
|
};
|
|
429
419
|
};
|
|
@@ -704,21 +694,16 @@ declare const _default: {
|
|
|
704
694
|
'application/json': {
|
|
705
695
|
schema: {
|
|
706
696
|
type: string;
|
|
697
|
+
description: string;
|
|
707
698
|
properties: {
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
$ref: string;
|
|
717
|
-
};
|
|
718
|
-
config: {
|
|
719
|
-
$ref: string;
|
|
720
|
-
};
|
|
721
|
-
};
|
|
699
|
+
upstreamId: {
|
|
700
|
+
$ref: string;
|
|
701
|
+
};
|
|
702
|
+
branchIndex: {
|
|
703
|
+
$ref: string;
|
|
704
|
+
};
|
|
705
|
+
config: {
|
|
706
|
+
$ref: string;
|
|
722
707
|
};
|
|
723
708
|
};
|
|
724
709
|
};
|
|
@@ -764,22 +749,17 @@ declare const _default: {
|
|
|
764
749
|
'application/json': {
|
|
765
750
|
schema: {
|
|
766
751
|
type: string;
|
|
752
|
+
description: string;
|
|
767
753
|
properties: {
|
|
768
|
-
|
|
754
|
+
upstreamId: {
|
|
769
755
|
type: string;
|
|
756
|
+
nullable: boolean;
|
|
757
|
+
description: string;
|
|
758
|
+
};
|
|
759
|
+
branchIndex: {
|
|
760
|
+
type: string;
|
|
761
|
+
nullable: boolean;
|
|
770
762
|
description: string;
|
|
771
|
-
properties: {
|
|
772
|
-
upstreamId: {
|
|
773
|
-
type: string;
|
|
774
|
-
nullable: boolean;
|
|
775
|
-
description: string;
|
|
776
|
-
};
|
|
777
|
-
branchIndex: {
|
|
778
|
-
type: string;
|
|
779
|
-
nullable: boolean;
|
|
780
|
-
description: string;
|
|
781
|
-
};
|
|
782
|
-
};
|
|
783
763
|
};
|
|
784
764
|
};
|
|
785
765
|
};
|
|
@@ -820,17 +800,11 @@ declare const _default: {
|
|
|
820
800
|
type: string;
|
|
821
801
|
required: string[];
|
|
822
802
|
properties: {
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
$ref: string;
|
|
829
|
-
};
|
|
830
|
-
config: {
|
|
831
|
-
$ref: string;
|
|
832
|
-
};
|
|
833
|
-
};
|
|
803
|
+
type: {
|
|
804
|
+
$ref: string;
|
|
805
|
+
};
|
|
806
|
+
config: {
|
|
807
|
+
$ref: string;
|
|
834
808
|
};
|
|
835
809
|
};
|
|
836
810
|
};
|
|
@@ -1116,24 +1090,19 @@ declare const _default: {
|
|
|
1116
1090
|
'application/json': {
|
|
1117
1091
|
schema: {
|
|
1118
1092
|
type: string;
|
|
1093
|
+
description: string;
|
|
1119
1094
|
properties: {
|
|
1120
|
-
|
|
1095
|
+
status: {
|
|
1096
|
+
type: string;
|
|
1097
|
+
description: string;
|
|
1098
|
+
};
|
|
1099
|
+
result: {
|
|
1100
|
+
type: string;
|
|
1101
|
+
description: string;
|
|
1102
|
+
};
|
|
1103
|
+
meta: {
|
|
1121
1104
|
type: string;
|
|
1122
1105
|
description: string;
|
|
1123
|
-
properties: {
|
|
1124
|
-
status: {
|
|
1125
|
-
type: string;
|
|
1126
|
-
description: string;
|
|
1127
|
-
};
|
|
1128
|
-
result: {
|
|
1129
|
-
type: string;
|
|
1130
|
-
description: string;
|
|
1131
|
-
};
|
|
1132
|
-
meta: {
|
|
1133
|
-
type: string;
|
|
1134
|
-
description: string;
|
|
1135
|
-
};
|
|
1136
|
-
};
|
|
1137
1106
|
};
|
|
1138
1107
|
};
|
|
1139
1108
|
};
|
package/dist/swagger/index.js
CHANGED
|
@@ -327,16 +327,11 @@ var swagger_default = {
|
|
|
327
327
|
"application/json": {
|
|
328
328
|
schema: {
|
|
329
329
|
type: "object",
|
|
330
|
+
description: "Override fields for the new workflow/version",
|
|
330
331
|
properties: {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
properties: {
|
|
335
|
-
title: { type: "string", description: "Override title" },
|
|
336
|
-
enabled: { type: "boolean", description: "Override enabled state" },
|
|
337
|
-
current: { type: "boolean", description: "Set as current version" }
|
|
338
|
-
}
|
|
339
|
-
}
|
|
332
|
+
title: { type: "string", description: "Override title" },
|
|
333
|
+
enabled: { type: "boolean", description: "Override enabled state" },
|
|
334
|
+
current: { type: "boolean", description: "Set as current version" }
|
|
340
335
|
}
|
|
341
336
|
}
|
|
342
337
|
}
|
|
@@ -394,7 +389,7 @@ var swagger_default = {
|
|
|
394
389
|
"",
|
|
395
390
|
"**Requirements:**",
|
|
396
391
|
"- `filterByTk` (query param) is required.",
|
|
397
|
-
"-
|
|
392
|
+
"- Request body is required \u2014 the **entire JSON body** is treated as trigger context/input.",
|
|
398
393
|
"",
|
|
399
394
|
"**autoRevision:** When set to `1`, if the workflow has never been executed",
|
|
400
395
|
"(`executed === 0`), a new revision is created automatically after execution.",
|
|
@@ -422,13 +417,8 @@ var swagger_default = {
|
|
|
422
417
|
"application/json": {
|
|
423
418
|
schema: {
|
|
424
419
|
type: "object",
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
values: {
|
|
428
|
-
type: "object",
|
|
429
|
-
description: "Context/input data for the workflow trigger. Structure depends on the trigger type."
|
|
430
|
-
}
|
|
431
|
-
}
|
|
420
|
+
description: "Trigger context/input data. The body itself is mapped to `params.values` on the server. Structure depends on trigger type.",
|
|
421
|
+
additionalProperties: true
|
|
432
422
|
}
|
|
433
423
|
}
|
|
434
424
|
}
|
|
@@ -459,7 +449,7 @@ var swagger_default = {
|
|
|
459
449
|
}
|
|
460
450
|
},
|
|
461
451
|
400: {
|
|
462
|
-
description: "Bad Request.
|
|
452
|
+
description: "Bad Request. Request body or `filterByTk` is missing/invalid, or workflow not triggered."
|
|
463
453
|
},
|
|
464
454
|
404: { description: "Not Found. Workflow does not exist." }
|
|
465
455
|
}
|
|
@@ -713,16 +703,11 @@ var swagger_default = {
|
|
|
713
703
|
"application/json": {
|
|
714
704
|
schema: {
|
|
715
705
|
type: "object",
|
|
706
|
+
description: "Target position and optional config override for the new node",
|
|
716
707
|
properties: {
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
properties: {
|
|
721
|
-
upstreamId: { $ref: "#/components/schemas/node/properties/upstreamId" },
|
|
722
|
-
branchIndex: { $ref: "#/components/schemas/node/properties/branchIndex" },
|
|
723
|
-
config: { $ref: "#/components/schemas/node/properties/config" }
|
|
724
|
-
}
|
|
725
|
-
}
|
|
708
|
+
upstreamId: { $ref: "#/components/schemas/node/properties/upstreamId" },
|
|
709
|
+
branchIndex: { $ref: "#/components/schemas/node/properties/branchIndex" },
|
|
710
|
+
config: { $ref: "#/components/schemas/node/properties/config" }
|
|
726
711
|
}
|
|
727
712
|
}
|
|
728
713
|
}
|
|
@@ -773,22 +758,17 @@ var swagger_default = {
|
|
|
773
758
|
"application/json": {
|
|
774
759
|
schema: {
|
|
775
760
|
type: "object",
|
|
761
|
+
description: "Target position descriptor",
|
|
776
762
|
properties: {
|
|
777
|
-
|
|
778
|
-
type: "
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
branchIndex: {
|
|
787
|
-
type: "integer",
|
|
788
|
-
nullable: true,
|
|
789
|
-
description: "Branch index at the target upstream. `null` = main chain."
|
|
790
|
-
}
|
|
791
|
-
}
|
|
763
|
+
upstreamId: {
|
|
764
|
+
type: "integer",
|
|
765
|
+
nullable: true,
|
|
766
|
+
description: "Target upstream node ID. `null` = move to head position."
|
|
767
|
+
},
|
|
768
|
+
branchIndex: {
|
|
769
|
+
type: "integer",
|
|
770
|
+
nullable: true,
|
|
771
|
+
description: "Branch index at the target upstream. `null` = main chain."
|
|
792
772
|
}
|
|
793
773
|
}
|
|
794
774
|
}
|
|
@@ -828,16 +808,10 @@ var swagger_default = {
|
|
|
828
808
|
"application/json": {
|
|
829
809
|
schema: {
|
|
830
810
|
type: "object",
|
|
831
|
-
required: ["
|
|
811
|
+
required: ["type", "config"],
|
|
832
812
|
properties: {
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
required: ["type"],
|
|
836
|
-
properties: {
|
|
837
|
-
type: { $ref: "#/components/schemas/node/properties/type" },
|
|
838
|
-
config: { $ref: "#/components/schemas/node/properties/config" }
|
|
839
|
-
}
|
|
840
|
-
}
|
|
813
|
+
type: { $ref: "#/components/schemas/node/properties/type" },
|
|
814
|
+
config: { $ref: "#/components/schemas/node/properties/config" }
|
|
841
815
|
}
|
|
842
816
|
}
|
|
843
817
|
}
|
|
@@ -1154,24 +1128,19 @@ var swagger_default = {
|
|
|
1154
1128
|
"application/json": {
|
|
1155
1129
|
schema: {
|
|
1156
1130
|
type: "object",
|
|
1131
|
+
description: "Fields to update on the job before resuming",
|
|
1157
1132
|
properties: {
|
|
1158
|
-
|
|
1133
|
+
status: {
|
|
1134
|
+
type: "integer",
|
|
1135
|
+
description: "Job status: 1=RESOLVED, -1=FAILED, -3=ABORTED, -4=CANCELED, -5=REJECTED"
|
|
1136
|
+
},
|
|
1137
|
+
result: {
|
|
1159
1138
|
type: "object",
|
|
1160
|
-
description: "
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
},
|
|
1166
|
-
result: {
|
|
1167
|
-
type: "object",
|
|
1168
|
-
description: "Result data to store on the job"
|
|
1169
|
-
},
|
|
1170
|
-
meta: {
|
|
1171
|
-
type: "object",
|
|
1172
|
-
description: "Metadata to store on the job"
|
|
1173
|
-
}
|
|
1174
|
-
}
|
|
1139
|
+
description: "Result data to store on the job"
|
|
1140
|
+
},
|
|
1141
|
+
meta: {
|
|
1142
|
+
type: "object",
|
|
1143
|
+
description: "Metadata to store on the job"
|
|
1175
1144
|
}
|
|
1176
1145
|
}
|
|
1177
1146
|
}
|
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.
|
|
9
|
+
"version": "2.1.0-beta.15",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"main": "./dist/server/index.js",
|
|
12
12
|
"homepage": "https://docs.nocobase.com/handbook/workflow",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"classnames": "^2.3.1",
|
|
23
23
|
"cron-parser": "4.4.0",
|
|
24
24
|
"dayjs": "^1.11.8",
|
|
25
|
-
"lodash": "4.
|
|
25
|
+
"lodash": "4.x",
|
|
26
26
|
"lru-cache": "8.0.5",
|
|
27
27
|
"nodejs-snowflake": "2.0.1",
|
|
28
28
|
"react": "18.x",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@nocobase/test": "2.x",
|
|
49
49
|
"@nocobase/utils": "2.x"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "dc1aceea6357e6ab149976c2a236fc4b6bee1370",
|
|
52
52
|
"keywords": [
|
|
53
53
|
"Workflow"
|
|
54
54
|
]
|
|
@@ -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([["10"],{5783:function(e,t,r){r.r(t),r.d(t,{WorkflowPane:function(){return ep}});var n=r(8156),o=r.n(n),i=r(2721),c=r(8563),a=r(3505),l=r(3772),s=r(1113);function u(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 p(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var m=function(e){var t,r=e.request,n=(e.filter,function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["request","filter"])),i=(0,l.useRecord)(),c=p(u({},n),{request:p(u({},r),{params:p(u({},null==r?void 0:r.params),{filter:p(u({},null==r||null==(t=r.params)?void 0:t.filter),{key:i.key})})})});return o().createElement(l.ResourceActionProvider,c)},d=r(3238),f=r(6128),y=r(9315),b=function(){var e=(0,d.useTranslation)().t,t=(0,l.useRecord)().id,r=(0,l.useActionContext)().setVisible,n=(0,l.useGetAriaLabelOfAction)("Configure").getAriaLabel;return o().createElement(f.Link,{"aria-label":n(),to:(0,y.SI)(t),onClick:function(){return r(!1)}},e("Configure"))};function v(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 g(e){var t,r,i,c=e.component,s=e.children,u=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["component","children"]),p=(t=(0,n.useState)(!1),function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],c=!0,a=!1;try{for(o=o.call(e);!(c=(r=o.next()).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(e){a=!0,n=e}finally{try{c||null==o.return||o.return()}finally{if(a)throw n}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return v(e,2);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 v(e,t)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),m=p[0],d=p[1],f=(0,a.useFieldSchema)();return o().createElement(l.ActionContextProvider,{value:{visible:m,setVisible:d,fieldSchema:f}},o().createElement(void 0===c?"div":c,(r=function(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}({},u),i=i={onClick:function(){d(!0)}},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))}),r),s),o().createElement(l.SchemaComponent,{schema:f,onlyRenderProperties:!0}))}var x=r(8551),h=r(1685),A=r(1682),O=r(8833),w=r(4665),C={title:{"x-component":"CollectionField","x-decorator":"FormItem"},type:{"x-decorator":"FormItem",title:'{{t("Trigger type", { ns: "'.concat(x.A7,'" })}}'),"x-component":"Select","x-component-props":{optionRender:"{{TriggerOptionRender}}",popupMatchSelectWidth:!0,listHeight:300},enum:"{{useTriggersOptions()}}",required:!0},sync:{type:"boolean",title:'{{ t("Execute mode", { ns: "'.concat(x.A7,'" }) }}'),description:'{{ t("Execute workflow asynchronously or synchronously based on trigger type, and could not be changed after created.", { ns: "'.concat(x.A7,'" }) }}'),"x-decorator":"FormItem","x-component":"SyncOptionSelect","x-component-props":{options:[{label:'{{ t("Asynchronously", { ns: "'.concat(x.A7,'" }) }}'),value:!1,tooltip:'{{ t("Will be executed in the background as a queued task.", { ns: "'.concat(x.A7,'" }) }}')},{label:'{{ t("Synchronously", { ns: "'.concat(x.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(x.A7,'" }) }}')}]}},enabled:{"x-component":"CollectionField","x-decorator":"FormItem"},description:{"x-component":"CollectionField","x-decorator":"FormItem"},categories:{type:"array",title:'{{ t("Category", { ns: "'.concat(x.A7,'" }) }}'),"x-decorator":"FormItem","x-component":"CollectionField","x-collection-field":"workflows.categories"},options:{type:"object","x-component":"fieldset",properties:{deleteExecutionOnStatus:{type:"array",title:'{{ t("Auto delete history when execution is on end status", { ns: "'.concat(x.A7,'" }) }}'),"x-decorator":"FormItem","x-component":"Select","x-component-props":{multiple:!0,optionRender:w.uL,tagRender:w.qo},enum:A.C6.filter(function(e){return!!e.value})},stackLimit:{type:"number",title:'{{ t("Maximum number of cycling triggers", { ns: "'.concat(x.A7,'" }) }}'),description:'{{ t("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.", { ns: "'.concat(x.A7,'" }) }}'),"x-decorator":"FormItem",default:1,"x-component":"InputNumber","x-component-props":{min:1,precision:0,className:"auto-width"}}}}},S={name:"workflow",type:"void",properties:{provider:{type:"void","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:O.Z,resourceName:"workflows",request:{resource:"workflows",action:"list",params:{filter:{current:!0},sort:["-createdAt"],except:["config"]}}},"x-component":"CategoryTabs",properties:{main:{type:"void","x-component":"CardItem",properties:{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":"useResourceFilterActionProps","x-component-props":{icon:"FilterOutlined",nonfilterable:["id","description","categories"]},"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(x.A7,'" })}}'),"x-decorator":"Tooltip","x-decorator-props":{title:'{{ t("Sync enabled status of all workflows from database", { ns: "'.concat(x.A7,'" }) }}')},"x-component":"Action","x-component-props":{icon:"SyncOutlined",useAction:"{{ useSyncAction }}"},"x-reactions":["{{useWorkflowSyncReaction}}"]},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:C.title,type:C.type,sync:C.sync,categories:C.categories,description:C.description,options:C.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:{type:"array","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useDataSource:"{{cm.useDataSourceFromRAC }}"},properties:{title:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{ t("Title") }}',properties:{title:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},categories:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{ t("Category", { ns: "'.concat(x.A7,'" }) }}'),properties:{categories:{type:"array","x-component":"EnumerationField","x-component-props":{multiple:!0,fieldNames:{label:"title",value:"id",color:"color"}}}}},type:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{ t("Trigger type", { ns: "'.concat(x.A7,'" }) }}'),properties:{type:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},sync:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{ t("Execute mode", { ns: "'.concat(x.A7,'" }) }}'),properties:{sync:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0}}},enabled:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{ t("Enabled", { ns: "'.concat(x.A7,'" }) }}'),properties:{enabled:{type:"boolean","x-component":"WorkflowEnabledSwitch",default:!1}}},"stats.executed":{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{ t("Executed", { ns: "'.concat(x.A7,'" }) }}'),properties:{"stats.executed":{type:"number","x-decorator":"OpenDrawer","x-decorator-props":{component:function(e){var t=(0,l.useCollectionRecordData)();return o().createElement("a",function(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}({"aria-label":"executed-".concat(t.title)},e))}},"x-component":"InputNumber","x-read-pretty":!0,properties:{drawer:h.V}}}},actions:{type:"void",title:'{{ t("Actions") }}',"x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{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:C.title,sync:C.sync,categories:C.categories,description:C.description,options:C.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:{type:"void",title:'{{t("Duplicate", { ns: "'.concat(x.A7,'" })}}'),"x-component":"Action.Link","x-component-props":{openSize:"small"},properties:{modal:{type:"void",title:'{{t("Duplicate to new workflow", { ns: "'.concat(x.A7,'" })}}'),"x-decorator":"FormV2","x-component":"Action.Modal",properties:{title:{type:"string",title:'{{t("Title")}}',"x-decorator":"FormItem","x-component":"Input"},footer:{type:"void","x-component":"Action.Modal.Footer",properties:{submit:{type:"void",title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useRevisionAction }}"}},cancel:{type:"void",title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}}}}}}}},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 }}"}}}}}}}}}}}}}},P=r(8218),E=r(5588),j=r(1600);function k(e){var t=e.data,r=t.label,n=t.color,c=t.options,a=(0,l.useCompile)();return o().createElement(i.Space,{direction:"vertical"},o().createElement(i.Tag,{color:n},a(r)),o().createElement(i.Typography.Text,{type:"secondary",style:{whiteSpace:"normal"}},a(c.description)))}var T=r(482),F=r(2948),D=r(8875),R=r(467);function I(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 V(e,t,r,n,o,i,c){try{var a=e[i](c),l=a.value}catch(e){r(e);return}a.done?t(l):Promise.resolve(l).then(n,o)}function M(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function c(e){V(i,n,o,c,a,"next",e)}function a(e){V(i,n,o,c,a,"throw",e)}c(void 0)})}}function q(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 L(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function N(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],c=!0,a=!1;try{for(o=o.call(e);!(c=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);c=!0);}catch(e){a=!0,n=e}finally{try{c||null==o.return||o.return()}finally{if(a)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return I(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 I(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 W(e,t){var r,n,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){var l=[i,a];if(r)throw TypeError("Generator is already executing.");for(;c;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return c.label++,{value:l[1],done:!1};case 5:c.label++,n=l[1],l=[0];continue;case 7:l=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){c=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){c.label=l[1];break}if(6===l[0]&&c.label<o[1]){c.label=o[1],o=l;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(l);break}o[2]&&c.ops.pop(),c.trys.pop();continue}l=t.call(e,c)}catch(e){l=[6,e],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}function B(){var e,t,r=(e=["\n .ant-tabs-nav-list > :first-child {\n border: none;\n }\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return B=function(){return r},r}function z(e){var t=(0,F.useDraggable)({id:e.id,data:e.data}),r=t.attributes,n=t.listeners,i=t.setNodeRef;return o().createElement("div",q({ref:i},n,r),o().createElement("div",null,e.children))}function K(e){var t=(0,F.useDroppable)({id:e.id,data:e.data}),r=t.isOver,n=t.setNodeRef;return o().createElement("div",{ref:n,style:r?{color:"green"}:void 0},e.children)}var $=(0,a.observer)(function(e){var t=e.item;return o().createElement(K,{id:t.id.toString(),data:t},o().createElement("div",null,o().createElement(z,{id:t.id.toString(),data:t},o().createElement(_,{item:t}))))},{displayName:"TabTitle"}),_=function(e){var t=e.item,r=(0,d.useTranslation)().t,n=(0,l.useCompile)();return o().createElement(i.Space,null,o().createElement(i.Badge,{color:t.color}),r(n(t.title)))},U=(0,a.observer)(function(e){var t,r=N((0,n.useState)(null),2),i=r[0],c=r[1],a=(0,n.useContext)(G).refresh,s=(0,l.useAPIClient)(),u=(t=M(function(e){var t,r;return W(this,function(n){switch(n.label){case 0:if(t=e.active,r=e.over,setTimeout(function(){c(null)}),!(r&&r.id!==t.id))return[3,2];return[4,s.resource("workflowCategories").move({sourceId:t.id,targetId:r.id})];case 1:n.sent(),a(),n.label=2;case 2:return[2]}})}),function(e){return t.apply(this,arguments)}),p=(0,F.useSensor)(F.MouseSensor,{activationConstraint:{distance:10}}),m=(0,F.useSensors)(p);return o().createElement(F.DndContext,{sensors:m,onDragEnd:u,onDragStart:function(e){var t;c(null==(t=e.active)?void 0:t.data.current)}},e.children,o().createElement(F.DragOverlay,null,i?o().createElement("span",{style:{whiteSpace:"nowrap"}},o().createElement(_,{item:i})):null))},{displayName:"DndProvider"}),G=(0,n.createContext)({});function Q(e){var t=e.values,r=e.onEdit,c=e.onRemove,a=(0,l.useCompile)(),s=(0,n.useCallback)(function(e){switch(e.key){case"edit":r(t);break;case"delete":c(t.id)}},[r,c,t]);return o().createElement(i.Dropdown,{menu:{items:[{key:"edit",label:(0,x.KQ)("Edit category")},{key:"delete",label:(0,x.KQ)("Delete category")}],onClick:s}},o().createElement(T.MenuOutlined,{role:"button","aria-label":a(t.title),style:{padding:8,margin:"-8px"}}))}function H(){var e,t=(0,l.useResourceActionContext)(),r=t.run,s=t.setState,u=t.defaultRequest,p=N((0,n.useState)({tab:"all"}),2),m=p[0],d=p[1],f=N((0,n.useState)(m.tab),2),y=f[0],b=f[1],v=(0,l.useCompile)(),g=(0,l.useAPIClient)(),h=(0,a.useFieldSchema)(),A=i.App.useApp().modal,O=(0,l.useRequest)({resource:"workflowCategories",action:"list",params:{paginate:!1,sort:["sort"]}}),w=O.data,C=O.refresh,S=N((0,n.useState)(!1),2),P=S[0],E=S[1],j=(0,n.useMemo)(function(){return(0,c.createForm)()},[]),k=(0,n.useCallback)(function(e){E(!0);var t=(0,R.cloneDeep)(e);j.setValues(t)},[j]),T=(0,n.useCallback)(function(){E(!1),j.reset()},[j]),F=(0,n.useCallback)(function(e){A.confirm({title:v("{{t('Delete category')}}"),content:v("{{t('Are you sure you want to delete it?')}}"),onOk:M(function(){return W(this,function(t){switch(t.label){case 0:return[4,g.resource("workflowCategories").destroy({filter:{id:e}})];case 1:return t.sent(),e===+m.tab&&d({tab:"all"}),C(),r(),[2]}})})})},[m.tab]),I=(0,n.useMemo)(function(){if(!(null==w?void 0:w.data))return[];var e=w.data.sort(function(e,t){return e.sort-t.sort}).concat().map(function(e){return L(q({},e),{schema:h.properties.main})});return e.find(function(e){return"all"===e.id})||e.unshift({title:'{{t("All", { ns: "'.concat(x.A7,'" })}}'),id:"all",sort:0,closable:!1,schema:h.properties.main}),e.map(function(e){return{label:"all"!==e.id?o().createElement("div",{"data-no-dnd":"true"},o().createElement($,{item:e})):v(e.title),key:String(e.id),closable:e.closable,closeIcon:o().createElement(Q,{values:e,onEdit:k,onRemove:F}),children:o().createElement(i.Card,{variant:"borderless",style:{borderRadius:"0 0.5em 0.5em 0.5em"}},o().createElement(a.RecursionField,{name:y,schema:e.schema,onlyRenderProperties:!0}))}})},[v,null==w?void 0:w.data,y,k,F,h.properties.main]),V=(0,n.useCallback)(function(e){if(d({tab:e}),b((0,D.uid)()),"all"!==e){var t,n={$and:[null==u||null==(t=u.params)?void 0:t.filter,{"categories.id":e}]};r({filter:n}),null==s||s({categories:[+e],params:[{filter:n}]})}else r(),null==s||s({categories:[],params:[]})},[null==u||null==(e=u.params)?void 0:e.filter,r,s]);return((0,n.useEffect)(function(){"all"!==m.tab&&V(m.tab)},[m.tab,V]),w)?o().createElement(G.Provider,{value:{refresh:C}},o().createElement(U,null,o().createElement(i.Tabs,{addIcon:o().createElement(l.SchemaComponent,{components:{AddCategory:Y},schema:{type:"void",properties:{addCategories:{type:"void",title:'{{ t("Add category", { ns: "'.concat(x.A7,'" }) }}'),"x-component":"AddCategory","x-component-props":{type:"primary"}}}}}),onChange:V,defaultActiveKey:m.tab||"all",type:"editable-card",destroyInactiveTabPane:!0,tabBarStyle:{marginBottom:"0px"},className:(0,l.css)(B()),items:I})),o().createElement(l.ActionContextProvider,{value:{visible:P,setVisible:T,openSize:"small"}},o().createElement(l.SchemaComponent,{scope:{useFormProviderProps:Z,useCancelAction:l.useCancelAction,useEditSubmit:X},schema:{name:(0,D.uid)(),type:"void","x-decorator":"FormV2","x-decorator-props":{form:j},title:'{{ t("Edit category", { ns: "'.concat(x.A7,'" }) }}'),"x-component":"Action.Modal","x-component-props":{delay:0},properties:{title:{type:"string",title:'{{t("Title")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},color:{type:"string",title:'{{t("Color")}}',required:!1,"x-decorator":"FormItem","x-component":"ColorSelect"},footer:{type:"void","x-component":"Action.Modal.Footer",properties:{cancel:{title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ useCancelAction }}"}},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useEditSubmit }}",style:{marginLeft:"8px"}}}}}}}}))):null}function X(){var e=(0,a.useForm)(),t=(0,l.useActionContext)(),r=(0,l.useResourceActionContext)(),o=(0,n.useContext)(G).refresh,i=(0,l.useAPIClient)();return{run:function(){return M(function(){var n;return W(this,function(c){switch(c.label){case 0:return[4,e.submit()];case 1:return c.sent(),[4,i.resource("workflowCategories").update({filterByTk:null==(n=e.values)?void 0:n.id,values:e.values})];case 2:return c.sent(),t.setVisible(!1),[4,e.reset()];case 3:return c.sent(),null==o||o(),null==r||r.refresh(),[2]}})})()}}}function Z(){return{form:(0,a.useForm)()}}function J(){var e=(0,a.useForm)(),t=(0,l.useActionContext)().setVisible,r=(0,n.useContext)(G).refresh,o=(0,l.useAPIClient)();return{run:function(){return M(function(){var n;return W(this,function(i){switch(i.label){case 0:return[4,e.submit()];case 1:return i.sent(),n=(0,R.cloneDeep)(e.values),[4,o.resource("workflowCategories").create({values:n})];case 2:return i.sent(),t(!1),e.reset(),r(),[2]}})})()}}}function Y(e){var t=N((0,n.useState)(!1),2),r=t[0],i=t[1],a=(0,d.useTranslation)().t,s=(0,n.useMemo)(function(){return(0,c.createForm)()},[]);return o().createElement(l.ActionContextProvider,{value:{visible:r,setVisible:i,openSize:"small"}},o().createElement("div",{onClick:function(){return i(!0)},title:a("Add category")},o().createElement(T.PlusOutlined,null)),o().createElement(l.SchemaComponent,{schema:{name:"modal",type:"void","x-decorator":"FormV2","x-decorator-props":{form:s},title:'{{ t("Add category") }}',"x-component":"Action.Modal","x-component-props":L(q({},e),{delay:0}),properties:{title:{type:"string",title:'{{t("Title")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},color:{type:"string",title:'{{t("Color")}}',required:!1,"x-decorator":"FormItem","x-component":"ColorSelect"},footer:{type:"void","x-component":"Action.Modal.Footer",properties:{cancel:{title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ useCancelAction }}"}},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useCreateSubmit }}",style:{marginLeft:"8px"}}}}}}},scope:{useCancelAction:l.useCancelAction,useCreateSubmit:J}}))}function ee(e){var t=e.value,r=e.multiple,n=e.fieldNames,c=void 0===n?l.defaultFieldNames:n,a=(0,l.useCompile)();return(r?null!=t?t:[]:t?[t]:[]).map(function(e){return o().createElement(i.Tag,{key:e[c.value],color:e[c.color]},a(e[c.label]))})}var et=r(6871);function er(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 en(e,t,r,n,o,i,c){try{var a=e[i](c),l=a.value}catch(e){r(e);return}a.done?t(l):Promise.resolve(l).then(n,o)}function eo(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function c(e){en(i,n,o,c,a,"next",e)}function a(e){en(i,n,o,c,a,"throw",e)}c(void 0)})}}function ei(e,t){var r,n,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){var l=[i,a];if(r)throw TypeError("Generator is already executing.");for(;c;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return c.label++,{value:l[1],done:!1};case 5:c.label++,n=l[1],l=[0];continue;case 7:l=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){c=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){c.label=l[1];break}if(6===l[0]&&c.label<o[1]){c.label=o[1],o=l;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(l);break}o[2]&&c.ops.pop(),c.trys.pop();continue}l=t.call(e,c)}catch(e){l=[6,e],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}function ec(e){var t=(0,a.useField)(),r=(0,l.useRecord)(),i=(0,l.usePlugin)(P.default);return(0,a.useFormEffects)(function(e){(0,c.onFieldChange)("type",function(e){var n=r.id||!e.value;if(e.value){var o=i.triggers.get(e.value);null!=o.sync?(n=!0,t.setValue(o.sync)):t.setInitialValue(!1)}t.setPattern(n?"disabled":"editable")})}),(0,n.useEffect)(function(){if(r.id){t.setPattern("disabled");var n,o=i.triggers.get(r.type);null!=o.sync?t.setValue(o.sync):t.setInitialValue(null!=(n=e.value)&&n)}},[r.id,t,i.triggers,r.type,e.value]),o().createElement(E.W5,e)}function ea(e){var t=(0,l.useApp)();e.visible=!!((0,l.usePlugin)("multi-app-share-collection")||"main"!==t.name)}function el(){var e=i.App.useApp().message,t=(0,d.useTranslation)().t,r=(0,l.useResourceContext)().resource;return{run:function(){return eo(function(){return ei(this,function(n){switch(n.label){case 0:return[4,r.sync()];case 1:return n.sent(),e.success(t("Operation succeeded")),[2]}})})()}}}function es(){var e=i.App.useApp().message,t=(0,d.useTranslation)().t,r=(0,l.useResourceActionContext)().refresh,n=(0,l.useResourceContext)(),o=n.resource,c=n.targetKey,s=(0,l.useActionContext)().setVisible,u=(0,l.useRecord)()[c],p=(0,a.useForm)(),m=(0,a.useField)();return{run:function(){return eo(function(){return ei(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,4,5]),[4,p.submit()];case 1:return n.sent(),m.data=m.data||{},m.data.loading=!0,[4,o.revision({filterByTk:u,values:p.values})];case 2:return n.sent(),e.success(t("Operation succeeded")),r(),s(!1),[3,5];case 3:return console.error(n.sent()),[3,5];case 4:return m.data&&(m.data.loading=!1),[7];case 5:return[2]}})})()}}}function eu(){var e,t,r=i.App.useApp().message,c=(0,d.useTranslation)().t,a=(0,l.useRecord)(),s=(0,l.useResourceContext)().resource,u=(0,l.useResourceActionContext)().refresh,p=(e=(0,n.useState)(!1),function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],c=!0,a=!1;try{for(o=o.call(e);!(c=(r=o.next()).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(e){a=!0,n=e}finally{try{c||null==o.return||o.return()}finally{if(a)throw n}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return er(e,2);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 er(e,t)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),m=p[0],f=p[1],y=(0,n.useCallback)((t=eo(function(e){return ei(this,function(t){switch(t.label){case 0:if(!(null==a?void 0:a.id))return[2];f(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,s.update({filterByTk:a.id,values:{enabled:e}})];case 2:return t.sent(),setTimeout(function(){return null==u?void 0:u()},0),[3,5];case 3:return console.error(t.sent()),r.error(c("Operation failed")),[3,5];case 4:return f(!1),[7];case 5:return[2]}})}),function(e){return t.apply(this,arguments)}),[r,a,u,s,c]);return o().createElement(i.Switch,{checked:!!(null==a?void 0:a.enabled),size:"small",disabled:m||!(null==a?void 0:a.id),loading:m,onClick:function(e,t){var r;return null==t||null==(r=t.stopPropagation)?void 0:r.call(t)},onChange:y})}function ep(){var e,t,r=(0,n.useContext)(l.SchemaComponentContext),c=(0,l.usePlugin)(P.default).useTriggersOptions;return o().createElement(l.SchemaComponentContext.Provider,{value:(e=function(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}({},r),t=t={designable:!1},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e)},o().createElement(l.SchemaComponent,{schema:S,components:{CollectionProvider:l.CollectionProvider,WorkflowLink:b,ExecutionResourceProvider:m,ExecutionLink:s.a,OpenDrawer:g,SyncOptionSelect:ec,ExecutionStatusColumn:w.rV,Tooltip:i.Tooltip,CategoryTabs:H,EnumerationField:ee,WorkflowEnabledSwitch:eu},scope:{useTriggersOptions:c,useWorkflowSyncReaction:ea,useSyncAction:el,useResourceFilterActionProps:et.K,useRefreshActionProps:j.X,useRevisionAction:es,TriggerOptionRender:k,ExecutionStatusOptions:A.C6}}))}}}]);
|
|
@@ -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([["781"],{1113:function(e,t,n){n.d(t,{a:function(){return a}});var o=n(8156),r=n.n(o),c=n(3238),i=n(6128),l=n(3772),u=n(9315),a=function(){var e=(0,c.useTranslation)().t,t=(0,l.useRecord)().id,n=(0,l.useActionContext)().setVisible;return r().createElement(i.Link,{to:(0,u.s_)(t),onClick:function(){return n(!1)}},e("View"))}},4665:function(e,t,n){n.d(t,{qo:function(){return f},rV:function(){return m},uL:function(){return d}});var o=n(8156),r=n.n(o),c=n(2721),i=n(482),l=n(3238),u=n(3772),a=n(1682),s=n(8551);function p(){var e,t,n=(e=["\n display: flex;\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return p=function(){return n},n}function f(e){var t,n=(0,u.useCompile)()(e.label),o=(null!=(t=a.uy[e.value])?t:{}).color;return r().createElement(c.Tag,{color:o,closable:e.closable,onClose:e.onClose},n)}function d(e){var t=(0,u.useCompile)();return r().createElement(r().Fragment,null,r().createElement(f,e.data),e.data.description?r().createElement("span",null,t(e.data.description)):null)}function m(e){var t=(0,l.useTranslation)().t,n=(0,u.useResourceActionContext)().refresh,a=(0,u.useResourceContext)().resource,f=(0,u.useRecord)(),d=(0,o.useCallback)(function(){c.Modal.confirm({title:(0,s.KQ)("Cancel the execution"),icon:r().createElement(i.ExclamationCircleFilled,null),content:(0,s.KQ)("Are you sure you want to cancel the execution?"),onOk:function(){a.cancel({filterByTk:f.id}).then(function(){c.message.success(t("Operation succeeded")),n()}).catch(function(e){console.error(e.data.error)})}})},[f]);return r().createElement("div",{className:(0,u.css)(p())},e.children,f.status?null:r().createElement(c.Tooltip,{title:(0,s.KQ)("Cancel the execution")},r().createElement(c.Button,{type:"link",danger:!0,onClick:d,shape:"circle",size:"small",icon:r().createElement(i.StopOutlined,null)})))}},1685:function(e,t,n){n.d(t,{V:function(){return y}});var o,r=n(8156),c=n.n(r),i=n(6128),l=n(3238),u=n(2721),a=n(3772),s=n(9601),p=n(1682),f=n(8551),d=n(9315);function m(e,t,n,o,r,c,i){try{var l=e[c](i),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(o,r)}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y={type:"void",name:"executionHistoryDrawer",title:'{{t("Execution history", { ns: "'.concat(f.A7,'" })}}'),"x-component":"Action.Drawer",properties:{content:{type:"void","x-decorator":"ExecutionResourceProvider","x-decorator-props":{collection:s.Z,resourceName:"executions",request:{resource:"executions",action:"list",params:{appends:["workflow.id","workflow.title"],pageSize:20,sort:["-createdAt"],except:["context","output"],filter:{}}}},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{filter:{type:"void",title:'{{ t("Filter") }}',"x-action":"filter","x-component":"Filter.Action","x-use-component-props":"useResourceFilterActionProps","x-component-props":{icon:"FilterOutlined",nonfilterable:["workflow"]},"x-align":"left",default:{$and:[{status:{$eq:void 0}}]}},refresher:{type:"void",title:'{{ t("Refresh") }}',"x-component":"Action","x-use-component-props":"useRefreshActionProps","x-component-props":{icon:"ReloadOutlined"}},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?')}}"}}},clear:{type:"void",title:'{{t("Clear")}}',"x-component":"Action","x-component-props":{useAction:function(){var e=(0,l.useTranslation)().t,t=(0,a.useResourceActionContext)(),n=t.refresh,o=t.defaultRequest,r=(0,a.useResourceContext)().resource,c=(0,a.useActionContext)().setVisible;return{run:function(){var t;return(t=function(){var t;return function(e,t){var n,o,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){var u=[c,l];if(n)throw TypeError("Generator is already executing.");for(;i;)try{if(n=1,o&&(r=2&u[0]?o.return:u[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;switch(o=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,o=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(r=(r=i.trys).length>0&&r[r.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!r||u[1]>r[0]&&u[1]<r[3])){i.label=u[1];break}if(6===u[0]&&i.label<r[1]){i.label=r[1],r=u;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(u);break}r[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],o=0}finally{n=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(i){switch(i.label){case 0:return[4,r.destroy({filter:null==(t=o.params)?void 0:t.filter})];case 1:return i.sent(),u.message.success(e("Operation succeeded")),n(),c(!1),[2]}})},function(){var e=this,n=arguments;return new Promise(function(o,r){var c=t.apply(e,n);function i(e){m(c,o,r,i,l,"next",e)}function l(e){m(c,o,r,i,l,"throw",e)}i(void 0)})})()}}},confirm:{title:'{{t("Clear all executions", { ns: "'.concat(f.A7,'" })}}'),content:'{{t("Clear executions will not reset executed count, and started executions will not be deleted, are you sure you want to delete them all?", { ns: "'.concat(f.A7,'" })}}')}}}}},table:{type:"void","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useDataSource:"{{ cm.useDataSourceFromRAC }}"},properties:{id:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{id:{type:"number","x-component":"CollectionField","x-read-pretty":!0}}},createdAt:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{createdAt:{type:"string","x-component":"CollectionField","x-component-props":{showTime:!0},"x-read-pretty":!0}}},workflowId:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{t("Version", { ns: "'.concat(f.A7,'" })}}'),properties:{workflowId:(x(o={type:"number"},"x-component",function(e){var t=e.value,n=(0,a.useActionContext)().setVisible;return c().createElement(i.Link,{to:(0,d.SI)(t),onClick:function(){return n(!1)}},"#".concat(t))}),x(o,"x-read-pretty",!0),o)}},status:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{t("Status", { ns: "'.concat(f.A7,'" })}}'),properties:{status:{type:"number","x-decorator":"ExecutionStatusColumn","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{ t("Actions") }}',"x-component":"Table.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{link:{type:"void","x-component":"ExecutionLink"},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 }}"},"x-reactions":[{dependencies:["..status"],fulfill:{state:{visible:"{{ $deps[0] !== ".concat(p.r9.STARTED," }}")}}}]}}}}}}}}}}}},1600:function(e,t,n){n.d(t,{X:function(){return c}});var o=n(3772);function r(e,t,n,o,r,c,i){try{var l=e[c](i),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(o,r)}function c(){var e=(0,o.useResourceActionContext)();return{onClick:function(){var t;return(t=function(){var t;return function(e,t){var n,o,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){var u=[c,l];if(n)throw TypeError("Generator is already executing.");for(;i;)try{if(n=1,o&&(r=2&u[0]?o.return:u[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;switch(o=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,o=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(r=(r=i.trys).length>0&&r[r.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!r||u[1]>r[0]&&u[1]<r[3])){i.label=u[1];break}if(6===u[0]&&i.label<r[1]){i.label=r[1],r=u;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(u);break}r[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],o=0}finally{n=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(n){return null==e||null==(t=e.refresh)||t.call(e),[2]})},function(){var e=this,n=arguments;return new Promise(function(o,c){var i=t.apply(e,n);function l(e){r(i,o,c,l,u,"next",e)}function u(e){r(i,o,c,l,u,"throw",e)}l(void 0)})})()}}}},6871:function(e,t,n){n.d(t,{K:function(){return r}});var o=n(3772),r=function(){var e,t,n=(0,o.useResourceContext)().collection,r=(0,o.useFilterFieldOptions)(n.fields),c=(0,o.useResourceActionContext)();return(0,o.useFilterFieldProps)({options:r,params:(null==(t=c.state)||null==(e=t.params)?void 0:e[0])||c.params,service:c})}}}]);
|
|
File without changes
|
|
File without changes
|