@nocobase/plugin-workflow 1.6.0-beta.9 → 1.6.1
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/4d75ef32f02d7285.js +10 -0
- package/dist/client/{16cf024fbd110889.js → 56ce448358002e64.js} +1 -1
- package/dist/client/{519e616688c7e591.js → 58bb427e05b600de.js} +1 -1
- package/dist/client/WorkflowTasks.d.ts +4 -3
- package/dist/client/components/WorkflowTitle.d.ts +9 -0
- package/dist/client/components/index.d.ts +1 -0
- package/dist/client/index.d.ts +7 -8
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +12 -12
- package/dist/locale/it-IT.json +100 -0
- package/dist/locale/zh-CN.json +4 -1
- package/dist/node_modules/cron-parser/package.json +1 -1
- package/dist/node_modules/lru-cache/package.json +1 -1
- package/dist/server/Plugin.d.ts +5 -1
- package/dist/server/Plugin.js +41 -2
- package/dist/server/actions/index.js +3 -1
- package/dist/server/actions/workflowTasks.d.ts +10 -0
- package/dist/server/actions/workflowTasks.js +45 -0
- package/dist/server/collections/workflowTasks.d.ts +10 -0
- package/dist/server/collections/workflowTasks.js +64 -0
- package/dist/server/collections/workflows.js +7 -1
- package/dist/server/repositories/WorkflowTasksRepository.d.ts +12 -0
- package/dist/server/repositories/WorkflowTasksRepository.js +42 -0
- package/dist/server/triggers/CollectionTrigger.js +4 -1
- package/dist/server/types/WorkflowTask.d.ts +14 -0
- package/dist/server/types/WorkflowTask.js +24 -0
- package/dist/server/types/index.d.ts +1 -0
- package/dist/swagger/index.d.ts +3 -3
- package/dist/swagger/index.js +6 -6
- package/package.json +3 -3
- package/dist/client/ba10eeb1736d2d81.js +0 -10
package/dist/externalVersion.js
CHANGED
|
@@ -11,24 +11,24 @@ 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.
|
|
15
|
-
"@nocobase/utils": "1.6.
|
|
14
|
+
"@nocobase/client": "1.6.1",
|
|
15
|
+
"@nocobase/utils": "1.6.1",
|
|
16
16
|
"antd": "5.12.8",
|
|
17
|
-
"@ant-design/icons": "5.
|
|
18
|
-
"react-router-dom": "6.
|
|
17
|
+
"@ant-design/icons": "5.6.1",
|
|
18
|
+
"react-router-dom": "6.28.1",
|
|
19
19
|
"react-i18next": "11.18.6",
|
|
20
20
|
"lodash": "4.17.21",
|
|
21
21
|
"sequelize": "6.35.2",
|
|
22
|
-
"@nocobase/database": "1.6.
|
|
23
|
-
"@nocobase/server": "1.6.
|
|
24
|
-
"@nocobase/
|
|
25
|
-
"@nocobase/
|
|
26
|
-
"@nocobase/
|
|
27
|
-
"@nocobase/evaluators": "1.6.0-beta.9",
|
|
22
|
+
"@nocobase/database": "1.6.1",
|
|
23
|
+
"@nocobase/server": "1.6.1",
|
|
24
|
+
"@nocobase/data-source-manager": "1.6.1",
|
|
25
|
+
"@nocobase/logger": "1.6.1",
|
|
26
|
+
"@nocobase/evaluators": "1.6.1",
|
|
28
27
|
"@formily/antd-v5": "1.1.9",
|
|
29
28
|
"@formily/reactive": "2.3.0",
|
|
30
29
|
"@formily/shared": "2.3.2",
|
|
30
|
+
"@nocobase/actions": "1.6.1",
|
|
31
31
|
"dayjs": "1.11.10",
|
|
32
|
-
"@nocobase/plugin-workflow-test": "1.6.
|
|
33
|
-
"@nocobase/test": "1.6.
|
|
32
|
+
"@nocobase/plugin-workflow-test": "1.6.1",
|
|
33
|
+
"@nocobase/test": "1.6.1"
|
|
34
34
|
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Workflow": "Workflow",
|
|
3
|
+
"Execution history": "Cronologia esecuzioni",
|
|
4
|
+
"Executed": "Eseguito",
|
|
5
|
+
"Trigger type": "Tipo di trigger",
|
|
6
|
+
"Status": "Stato",
|
|
7
|
+
"On": "Attivo",
|
|
8
|
+
"Off": "Disattivo",
|
|
9
|
+
"Version": "Versione",
|
|
10
|
+
"Copy to new version": "Copia in nuova versione",
|
|
11
|
+
"Duplicate": "Duplica",
|
|
12
|
+
"Loading": "Caricamento",
|
|
13
|
+
"Load failed": "Caricamento fallito",
|
|
14
|
+
"Trigger": "Trigger",
|
|
15
|
+
"Trigger variables": "Variabili trigger",
|
|
16
|
+
"Trigger data": "Dati trigger",
|
|
17
|
+
"Trigger time": "Ora trigger",
|
|
18
|
+
"Triggered at": "Attivato alle",
|
|
19
|
+
"Collection event": "Evento raccolta",
|
|
20
|
+
"Trigger on": "Attiva su",
|
|
21
|
+
"After record added": "Dopo record aggiunto",
|
|
22
|
+
"After record updated": "Dopo record aggiornato",
|
|
23
|
+
"After record added or updated": "Dopo record aggiunto o aggiornato",
|
|
24
|
+
"After record deleted": "Dopo record eliminato",
|
|
25
|
+
"Changed fields": "Campi modificati",
|
|
26
|
+
"Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.": "Attivato solo se uno dei campi selezionati cambia. Se deselezionato, significa che verrà attivato quando qualsiasi campo cambia. Quando il record viene aggiunto o eliminato, qualsiasi campo è considerato cambiato.",
|
|
27
|
+
"Only triggers when match conditions": "Attiva solo quando le condizioni corrispondono",
|
|
28
|
+
"Schedule event": "Evento pianificato",
|
|
29
|
+
"Trigger mode": "Modalità trigger",
|
|
30
|
+
"Based on certain date": "Basato su una certa data",
|
|
31
|
+
"Based on date field of collection": "Basato sul campo data della raccolta",
|
|
32
|
+
"Starts on": "Inizia il",
|
|
33
|
+
"Ends on": "Termina il",
|
|
34
|
+
"No end": "Nessuna fine",
|
|
35
|
+
"Exactly at": "Esattamente alle",
|
|
36
|
+
"Repeat mode": "Modalità ripetizione",
|
|
37
|
+
"Repeat limit": "Limite ripetizione",
|
|
38
|
+
"No limit": "Nessun limite",
|
|
39
|
+
"Seconds": "Secondi",
|
|
40
|
+
"Minutes": "Minuti",
|
|
41
|
+
"Hours": "Ore",
|
|
42
|
+
"Days": "Giorni",
|
|
43
|
+
"Weeks": "Settimane",
|
|
44
|
+
"Months": "Mesi",
|
|
45
|
+
"No repeat": "Nessuna ripetizione",
|
|
46
|
+
"Every": "Ogni",
|
|
47
|
+
"By minute": "Per minuto",
|
|
48
|
+
"By hour": "Per ora",
|
|
49
|
+
"By day": "Per giorno",
|
|
50
|
+
"By week": "Per settimana",
|
|
51
|
+
"By month": "Per mese",
|
|
52
|
+
"By field": "Per campo",
|
|
53
|
+
"By custom date": "Per data personalizzata",
|
|
54
|
+
"Advanced": "Avanzato",
|
|
55
|
+
"End": "Fine",
|
|
56
|
+
"Node result": "Risultato nodo",
|
|
57
|
+
"Constant": "Costante",
|
|
58
|
+
"Null": "Null",
|
|
59
|
+
"Boolean": "Booleano",
|
|
60
|
+
"String": "Stringa",
|
|
61
|
+
"Operator": "Operatore",
|
|
62
|
+
"Arithmetic calculation": "Calcolo aritmetico",
|
|
63
|
+
"String operation": "Operazione stringa",
|
|
64
|
+
"Executed at": "Eseguito alle",
|
|
65
|
+
"Queueing": "In coda",
|
|
66
|
+
"On going": "In corso",
|
|
67
|
+
"Succeeded": "Riuscito",
|
|
68
|
+
"Failed": "Fallito",
|
|
69
|
+
"Pending": "In attesa",
|
|
70
|
+
"Canceled": "Annullato",
|
|
71
|
+
"This node contains branches, deleting will also be preformed to them, are you sure?": "Questo nodo contiene rami, l'eliminazione verrà eseguita anche su di essi, sei sicuro?",
|
|
72
|
+
"Control": "Controllo",
|
|
73
|
+
"Collection operations": "Operazioni raccolta",
|
|
74
|
+
"Extended types": "Tipi estesi",
|
|
75
|
+
"Node type": "Tipo nodo",
|
|
76
|
+
"Calculation": "Calcolo",
|
|
77
|
+
"Configure calculation": "Configura calcolo",
|
|
78
|
+
"Calculation result": "Risultato calcolo",
|
|
79
|
+
"True": "Vero",
|
|
80
|
+
"False": "Falso",
|
|
81
|
+
"concat": "concatena",
|
|
82
|
+
"Condition": "Condizione",
|
|
83
|
+
"Mode": "Modalità",
|
|
84
|
+
"Continue when \"Yes\"": "Continua quando \"Yes\"",
|
|
85
|
+
"Branch into \"Yes\" and \"No\"": "Dirama in \"Yes\" e \"No\"",
|
|
86
|
+
"Conditions": "Condizioni",
|
|
87
|
+
"Create record": "Crea record",
|
|
88
|
+
"Update record": "Aggiorna record",
|
|
89
|
+
"Query record": "Interroga record",
|
|
90
|
+
"Multiple records": "Record multipli",
|
|
91
|
+
"Please select collection first": "Seleziona prima la raccolta",
|
|
92
|
+
"Only update records matching conditions": "Aggiorna solo i record che corrispondono alle condizioni",
|
|
93
|
+
"Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.": "I campi a cui non è assegnato un valore verranno impostati sul valore predefinito, e quelli che non hanno un valore predefinito verranno impostati su null.",
|
|
94
|
+
"Trigger in executed workflow cannot be modified": "Il trigger nel workflow eseguito non può essere modificato",
|
|
95
|
+
"Node in executed workflow cannot be modified": "Il nodo nel workflow eseguito non può essere modificato",
|
|
96
|
+
"Can not delete": "Impossibile eliminare",
|
|
97
|
+
"The result of this node has been referenced by other nodes ({{nodes}}), please remove the usage before deleting.": "Il risultato di questo nodo è stato referenziato da altri nodi ({{nodes}}), rimuovi l'utilizzo prima di eliminare.",
|
|
98
|
+
"Maximum number of loop calls": "Numero massimo di chiamate ciclo",
|
|
99
|
+
"If the number of loop calls is too large, there will be performance issues.": "Se il numero di chiamate ciclo è troppo grande, ci saranno problemi di prestazioni."
|
|
100
|
+
}
|
package/dist/locale/zh-CN.json
CHANGED
|
@@ -133,6 +133,8 @@
|
|
|
133
133
|
"Canceled": "已取消",
|
|
134
134
|
"Rejected": "已拒绝",
|
|
135
135
|
"Retry needed": "需重试",
|
|
136
|
+
"Completed": "已完成",
|
|
137
|
+
"All": "全部",
|
|
136
138
|
"View result": "查看结果",
|
|
137
139
|
|
|
138
140
|
"Triggered but still waiting in queue to execute.": "已触发但仍在队列中等待执行。",
|
|
@@ -231,5 +233,6 @@
|
|
|
231
233
|
"After end of branches": "分支结束后",
|
|
232
234
|
"Inside of branch": "分支内",
|
|
233
235
|
|
|
234
|
-
"Workflow todos": "流程待办"
|
|
236
|
+
"Workflow todos": "流程待办",
|
|
237
|
+
"New version enabled": "已启用新版本"
|
|
235
238
|
}
|
|
@@ -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-
|
|
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-03-11T11:15:49.152Z"}
|
|
@@ -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-
|
|
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-03-11T11:15:48.791Z"}
|
package/dist/server/Plugin.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ import Processor from './Processor';
|
|
|
14
14
|
import { CustomFunction } from './functions';
|
|
15
15
|
import Trigger from './triggers';
|
|
16
16
|
import { InstructionInterface } from './instructions';
|
|
17
|
-
import type { ExecutionModel, WorkflowModel } from './types';
|
|
17
|
+
import type { ExecutionModel, WorkflowModel, WorkflowTaskModel } from './types';
|
|
18
18
|
type ID = number | string;
|
|
19
19
|
export type EventOptions = {
|
|
20
20
|
eventKey?: string;
|
|
@@ -88,5 +88,9 @@ export default class PluginWorkflowServer extends Plugin {
|
|
|
88
88
|
* @returns {Trasaction}
|
|
89
89
|
*/
|
|
90
90
|
useDataSourceTransaction(dataSourceName: string, transaction: any, create?: boolean): any;
|
|
91
|
+
/**
|
|
92
|
+
* @experimental
|
|
93
|
+
*/
|
|
94
|
+
toggleTaskStatus(task: WorkflowTaskModel, done: boolean, { transaction }: Transactionable): Promise<void>;
|
|
91
95
|
}
|
|
92
96
|
export {};
|
package/dist/server/Plugin.js
CHANGED
|
@@ -60,6 +60,7 @@ var import_DestroyInstruction = __toESM(require("./instructions/DestroyInstructi
|
|
|
60
60
|
var import_QueryInstruction = __toESM(require("./instructions/QueryInstruction"));
|
|
61
61
|
var import_UpdateInstruction = __toESM(require("./instructions/UpdateInstruction"));
|
|
62
62
|
var import_WorkflowRepository = __toESM(require("./repositories/WorkflowRepository"));
|
|
63
|
+
var import_WorkflowTasksRepository = __toESM(require("./repositories/WorkflowTasksRepository"));
|
|
63
64
|
class PluginWorkflowServer extends import_server.Plugin {
|
|
64
65
|
instructions = new import_utils.Registry();
|
|
65
66
|
triggers = new import_utils.Registry();
|
|
@@ -192,7 +193,8 @@ class PluginWorkflowServer extends import_server.Plugin {
|
|
|
192
193
|
}
|
|
193
194
|
async beforeLoad() {
|
|
194
195
|
this.db.registerRepositories({
|
|
195
|
-
WorkflowRepository: import_WorkflowRepository.default
|
|
196
|
+
WorkflowRepository: import_WorkflowRepository.default,
|
|
197
|
+
WorkflowTasksRepository: import_WorkflowTasksRepository.default
|
|
196
198
|
});
|
|
197
199
|
}
|
|
198
200
|
/**
|
|
@@ -227,13 +229,15 @@ class PluginWorkflowServer extends import_server.Plugin {
|
|
|
227
229
|
"executions:destroy",
|
|
228
230
|
"flow_nodes:update",
|
|
229
231
|
"flow_nodes:destroy",
|
|
230
|
-
"flow_nodes:test"
|
|
232
|
+
"flow_nodes:test",
|
|
233
|
+
"jobs:get"
|
|
231
234
|
]
|
|
232
235
|
});
|
|
233
236
|
this.app.acl.registerSnippet({
|
|
234
237
|
name: "ui.workflows",
|
|
235
238
|
actions: ["workflows:list"]
|
|
236
239
|
});
|
|
240
|
+
this.app.acl.allow("workflowTasks", "countMine", "loggedIn");
|
|
237
241
|
this.app.acl.allow("*", ["trigger"], "loggedIn");
|
|
238
242
|
this.db.addMigrations({
|
|
239
243
|
namespace: this.name,
|
|
@@ -625,4 +629,39 @@ class PluginWorkflowServer extends import_server.Plugin {
|
|
|
625
629
|
return db.sequelize.transaction();
|
|
626
630
|
}
|
|
627
631
|
}
|
|
632
|
+
/**
|
|
633
|
+
* @experimental
|
|
634
|
+
*/
|
|
635
|
+
async toggleTaskStatus(task, done, { transaction }) {
|
|
636
|
+
const { db } = this.app;
|
|
637
|
+
const repository = db.getRepository("workflowTasks");
|
|
638
|
+
if (done) {
|
|
639
|
+
await repository.destroy({
|
|
640
|
+
filter: {
|
|
641
|
+
type: task.type,
|
|
642
|
+
key: `${task.key}`
|
|
643
|
+
},
|
|
644
|
+
transaction
|
|
645
|
+
});
|
|
646
|
+
} else {
|
|
647
|
+
await repository.updateOrCreate({
|
|
648
|
+
filterKeys: ["key", "type"],
|
|
649
|
+
values: task,
|
|
650
|
+
transaction
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
if (task.userId) {
|
|
654
|
+
const counts = await repository.countAll({
|
|
655
|
+
where: {
|
|
656
|
+
userId: task.userId
|
|
657
|
+
},
|
|
658
|
+
transaction
|
|
659
|
+
}) || [];
|
|
660
|
+
this.app.emit("ws:sendToTag", {
|
|
661
|
+
tagKey: "userId",
|
|
662
|
+
tagValue: `${task.userId}`,
|
|
663
|
+
message: { type: "workflow:tasks:updated", payload: counts }
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
}
|
|
628
667
|
}
|
|
@@ -42,6 +42,7 @@ module.exports = __toCommonJS(actions_exports);
|
|
|
42
42
|
var workflows = __toESM(require("./workflows"));
|
|
43
43
|
var nodes = __toESM(require("./nodes"));
|
|
44
44
|
var executions = __toESM(require("./executions"));
|
|
45
|
+
var workflowTasks = __toESM(require("./workflowTasks"));
|
|
45
46
|
function make(name, mod) {
|
|
46
47
|
return Object.keys(mod).reduce(
|
|
47
48
|
(result, key) => ({
|
|
@@ -62,6 +63,7 @@ function actions_default({ app }) {
|
|
|
62
63
|
destroy: nodes.destroy,
|
|
63
64
|
test: nodes.test
|
|
64
65
|
}),
|
|
65
|
-
...make("executions", executions)
|
|
66
|
+
...make("executions", executions),
|
|
67
|
+
...make("workflowTasks", workflowTasks)
|
|
66
68
|
});
|
|
67
69
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { Context } from '@nocobase/actions';
|
|
10
|
+
export declare function countMine(context: Context, next: any): Promise<void>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var workflowTasks_exports = {};
|
|
28
|
+
__export(workflowTasks_exports, {
|
|
29
|
+
countMine: () => countMine
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(workflowTasks_exports);
|
|
32
|
+
var import_actions = require("@nocobase/actions");
|
|
33
|
+
async function countMine(context, next) {
|
|
34
|
+
const repository = import_actions.utils.getRepositoryFromParams(context);
|
|
35
|
+
context.body = await repository.countAll({
|
|
36
|
+
where: {
|
|
37
|
+
userId: context.state.currentUser.id
|
|
38
|
+
}
|
|
39
|
+
}) || [];
|
|
40
|
+
next();
|
|
41
|
+
}
|
|
42
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
+
0 && (module.exports = {
|
|
44
|
+
countMine
|
|
45
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { CollectionOptions } from '@nocobase/database';
|
|
10
|
+
export default function (): CollectionOptions;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var workflowTasks_exports = {};
|
|
28
|
+
__export(workflowTasks_exports, {
|
|
29
|
+
default: () => workflowTasks_default
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(workflowTasks_exports);
|
|
32
|
+
function workflowTasks_default() {
|
|
33
|
+
return {
|
|
34
|
+
dumpRules: "required",
|
|
35
|
+
migrationRules: ["overwrite", "schema-only"],
|
|
36
|
+
name: "workflowTasks",
|
|
37
|
+
shared: true,
|
|
38
|
+
repository: "WorkflowTasksRepository",
|
|
39
|
+
fields: [
|
|
40
|
+
{
|
|
41
|
+
name: "user",
|
|
42
|
+
type: "belongsTo"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "workflow",
|
|
46
|
+
type: "belongsTo"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type: "string",
|
|
50
|
+
name: "type"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
type: "string",
|
|
54
|
+
name: "key"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
indexes: [
|
|
58
|
+
{
|
|
59
|
+
unique: true,
|
|
60
|
+
fields: ["type", "key"]
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
};
|
|
64
|
+
}
|
|
@@ -44,7 +44,13 @@ function workflows_default() {
|
|
|
44
44
|
{
|
|
45
45
|
type: "string",
|
|
46
46
|
name: "title",
|
|
47
|
-
|
|
47
|
+
interface: "input",
|
|
48
|
+
uiSchema: {
|
|
49
|
+
title: '{{t("Name")}}',
|
|
50
|
+
type: "string",
|
|
51
|
+
"x-component": "Input",
|
|
52
|
+
required: true
|
|
53
|
+
}
|
|
48
54
|
},
|
|
49
55
|
{
|
|
50
56
|
type: "boolean",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { Repository } from '@nocobase/database';
|
|
10
|
+
export default class WorkflowTasksRepository extends Repository {
|
|
11
|
+
countAll(options: any): Promise<import("@nocobase/database").Model<any, any>[]>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var WorkflowTasksRepository_exports = {};
|
|
28
|
+
__export(WorkflowTasksRepository_exports, {
|
|
29
|
+
default: () => WorkflowTasksRepository
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(WorkflowTasksRepository_exports);
|
|
32
|
+
var import_database = require("@nocobase/database");
|
|
33
|
+
class WorkflowTasksRepository extends import_database.Repository {
|
|
34
|
+
async countAll(options) {
|
|
35
|
+
const db = this.database;
|
|
36
|
+
return this.collection.model.findAll({
|
|
37
|
+
...options,
|
|
38
|
+
attributes: ["type", [db.sequelize.fn("COUNT", db.sequelize.col("type")), "count"]],
|
|
39
|
+
group: ["type"]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -68,13 +68,16 @@ class CollectionTrigger extends import__.default {
|
|
|
68
68
|
events = /* @__PURE__ */ new Map();
|
|
69
69
|
// async function, should return promise
|
|
70
70
|
static async handler(workflow, data, options) {
|
|
71
|
+
const { skipWorkflow = false, stack } = options.context ?? {};
|
|
72
|
+
if (skipWorkflow) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
71
75
|
const [dataSourceName] = (0, import_data_source_manager.parseCollectionName)(workflow.config.collection);
|
|
72
76
|
const transaction = this.workflow.useDataSourceTransaction(dataSourceName, options.transaction);
|
|
73
77
|
const ctx = await this.prepare(workflow, data, { ...options, transaction });
|
|
74
78
|
if (!ctx) {
|
|
75
79
|
return;
|
|
76
80
|
}
|
|
77
|
-
const { stack } = options.context ?? {};
|
|
78
81
|
if (workflow.sync) {
|
|
79
82
|
await this.workflow.trigger(workflow, ctx, {
|
|
80
83
|
transaction,
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
export default interface WorkflowTaskModel {
|
|
10
|
+
type: string;
|
|
11
|
+
key: string;
|
|
12
|
+
userId: number;
|
|
13
|
+
workflowId: number;
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
|
+
var WorkflowTask_exports = {};
|
|
24
|
+
module.exports = __toCommonJS(WorkflowTask_exports);
|
|
@@ -10,3 +10,4 @@ export type { default as WorkflowModel } from './Workflow';
|
|
|
10
10
|
export type { default as FlowNodeModel } from './FlowNode';
|
|
11
11
|
export type { default as ExecutionModel } from './Execution';
|
|
12
12
|
export type { default as JobModel } from './Job';
|
|
13
|
+
export type { default as WorkflowTaskModel } from './WorkflowTask';
|
package/dist/swagger/index.d.ts
CHANGED
|
@@ -402,7 +402,7 @@ declare const _default: {
|
|
|
402
402
|
};
|
|
403
403
|
};
|
|
404
404
|
};
|
|
405
|
-
'/
|
|
405
|
+
'/workflowManualTasks:list': {
|
|
406
406
|
get: {
|
|
407
407
|
tags: string[];
|
|
408
408
|
description: string;
|
|
@@ -425,7 +425,7 @@ declare const _default: {
|
|
|
425
425
|
};
|
|
426
426
|
};
|
|
427
427
|
};
|
|
428
|
-
'/
|
|
428
|
+
'/workflowManualTasks:get': {
|
|
429
429
|
get: {
|
|
430
430
|
tags: string[];
|
|
431
431
|
description: string;
|
|
@@ -456,7 +456,7 @@ declare const _default: {
|
|
|
456
456
|
};
|
|
457
457
|
};
|
|
458
458
|
};
|
|
459
|
-
'/
|
|
459
|
+
'/workflowManualTasks:submit': {
|
|
460
460
|
post: {
|
|
461
461
|
tags: string[];
|
|
462
462
|
description: string;
|
package/dist/swagger/index.js
CHANGED
|
@@ -446,9 +446,9 @@ var swagger_default = {
|
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
448
|
},
|
|
449
|
-
"/
|
|
449
|
+
"/workflowManualTasks:list": {
|
|
450
450
|
get: {
|
|
451
|
-
tags: ["
|
|
451
|
+
tags: ["workflowManualTasks"],
|
|
452
452
|
description: "List manual jobs",
|
|
453
453
|
parameters: [],
|
|
454
454
|
responses: {
|
|
@@ -469,9 +469,9 @@ var swagger_default = {
|
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
471
|
},
|
|
472
|
-
"/
|
|
472
|
+
"/workflowManualTasks:get": {
|
|
473
473
|
get: {
|
|
474
|
-
tags: ["
|
|
474
|
+
tags: ["workflowManualTasks"],
|
|
475
475
|
description: "Single user job",
|
|
476
476
|
parameters: [],
|
|
477
477
|
responses: {
|
|
@@ -500,9 +500,9 @@ var swagger_default = {
|
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
502
|
},
|
|
503
|
-
"/
|
|
503
|
+
"/workflowManualTasks:submit": {
|
|
504
504
|
post: {
|
|
505
|
-
tags: ["
|
|
505
|
+
tags: ["workflowManualTasks"],
|
|
506
506
|
description: "",
|
|
507
507
|
parameters: [
|
|
508
508
|
{
|