@nocobase/plugin-workflow 2.0.0-alpha.40 → 2.0.0-alpha.42
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/externalVersion.js +11 -11
- 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/Dispatcher.d.ts +0 -1
- package/dist/server/Dispatcher.js +3 -8
- package/dist/server/Plugin.d.ts +2 -0
- package/dist/server/Plugin.js +15 -7
- package/dist/server/triggers/CollectionTrigger.js +15 -3
- package/dist/server/triggers/ScheduleTrigger/DateFieldScheduleTrigger.js +8 -0
- package/package.json +2 -2
package/dist/externalVersion.js
CHANGED
|
@@ -11,8 +11,8 @@ module.exports = {
|
|
|
11
11
|
"react": "18.2.0",
|
|
12
12
|
"@formily/core": "2.3.7",
|
|
13
13
|
"@formily/react": "2.3.7",
|
|
14
|
-
"@nocobase/client": "2.0.0-alpha.
|
|
15
|
-
"@nocobase/utils": "2.0.0-alpha.
|
|
14
|
+
"@nocobase/client": "2.0.0-alpha.42",
|
|
15
|
+
"@nocobase/utils": "2.0.0-alpha.42",
|
|
16
16
|
"antd": "5.24.2",
|
|
17
17
|
"@ant-design/icons": "5.6.1",
|
|
18
18
|
"react-router-dom": "6.30.1",
|
|
@@ -20,17 +20,17 @@ module.exports = {
|
|
|
20
20
|
"lodash": "4.17.21",
|
|
21
21
|
"@dnd-kit/core": "6.1.0",
|
|
22
22
|
"@formily/shared": "2.3.7",
|
|
23
|
-
"@nocobase/plugin-mobile": "2.0.0-alpha.
|
|
23
|
+
"@nocobase/plugin-mobile": "2.0.0-alpha.42",
|
|
24
24
|
"sequelize": "6.35.2",
|
|
25
|
-
"@nocobase/database": "2.0.0-alpha.
|
|
26
|
-
"@nocobase/server": "2.0.0-alpha.
|
|
27
|
-
"@nocobase/data-source-manager": "2.0.0-alpha.
|
|
28
|
-
"@nocobase/logger": "2.0.0-alpha.
|
|
29
|
-
"@nocobase/evaluators": "2.0.0-alpha.
|
|
25
|
+
"@nocobase/database": "2.0.0-alpha.42",
|
|
26
|
+
"@nocobase/server": "2.0.0-alpha.42",
|
|
27
|
+
"@nocobase/data-source-manager": "2.0.0-alpha.42",
|
|
28
|
+
"@nocobase/logger": "2.0.0-alpha.42",
|
|
29
|
+
"@nocobase/evaluators": "2.0.0-alpha.42",
|
|
30
30
|
"@formily/antd-v5": "1.2.3",
|
|
31
31
|
"@formily/reactive": "2.3.7",
|
|
32
|
-
"@nocobase/actions": "2.0.0-alpha.
|
|
32
|
+
"@nocobase/actions": "2.0.0-alpha.42",
|
|
33
33
|
"dayjs": "1.11.13",
|
|
34
|
-
"@nocobase/plugin-workflow-test": "2.0.0-alpha.
|
|
35
|
-
"@nocobase/test": "2.0.0-alpha.
|
|
34
|
+
"@nocobase/plugin-workflow-test": "2.0.0-alpha.42",
|
|
35
|
+
"@nocobase/test": "2.0.0-alpha.42"
|
|
36
36
|
};
|
|
@@ -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-11-
|
|
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-11-19T05:49:51.661Z"}
|
|
@@ -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-11-
|
|
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-11-19T05:49:51.307Z"}
|
|
@@ -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":"2025-11-
|
|
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":"2025-11-19T05:49:51.096Z"}
|
|
@@ -26,14 +26,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
26
26
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
27
|
var Dispatcher_exports = {};
|
|
28
28
|
__export(Dispatcher_exports, {
|
|
29
|
-
WORKER_JOB_WORKFLOW_PROCESS: () => WORKER_JOB_WORKFLOW_PROCESS,
|
|
30
29
|
default: () => Dispatcher
|
|
31
30
|
});
|
|
32
31
|
module.exports = __toCommonJS(Dispatcher_exports);
|
|
33
32
|
var import_crypto = require("crypto");
|
|
34
33
|
var import_sequelize = require("sequelize");
|
|
35
34
|
var import_constants = require("./constants");
|
|
36
|
-
|
|
35
|
+
var import_Plugin = require("./Plugin");
|
|
37
36
|
class Dispatcher {
|
|
38
37
|
constructor(plugin) {
|
|
39
38
|
this.plugin = plugin;
|
|
@@ -156,7 +155,7 @@ class Dispatcher {
|
|
|
156
155
|
next = [execution];
|
|
157
156
|
}
|
|
158
157
|
} else {
|
|
159
|
-
this.plugin.getLogger("dispatcher").warn(`${WORKER_JOB_WORKFLOW_PROCESS} is not serving on this instance, new dispatching will be ignored`);
|
|
158
|
+
this.plugin.getLogger("dispatcher").warn(`${import_Plugin.WORKER_JOB_WORKFLOW_PROCESS} is not serving on this instance, new dispatching will be ignored`);
|
|
160
159
|
}
|
|
161
160
|
}
|
|
162
161
|
if (next) {
|
|
@@ -292,7 +291,7 @@ class Dispatcher {
|
|
|
292
291
|
`instance is not serving as worker or local pending list is not empty, sending execution (${execution.id}) to queue`
|
|
293
292
|
);
|
|
294
293
|
if (this.ready) {
|
|
295
|
-
this.plugin.app.
|
|
294
|
+
this.plugin.app.eventQueue.publish(this.plugin.channelPendingExecution, {
|
|
296
295
|
executionId: execution.id
|
|
297
296
|
});
|
|
298
297
|
}
|
|
@@ -399,7 +398,3 @@ class Dispatcher {
|
|
|
399
398
|
return processor;
|
|
400
399
|
}
|
|
401
400
|
}
|
|
402
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
403
|
-
0 && (module.exports = {
|
|
404
|
-
WORKER_JOB_WORKFLOW_PROCESS
|
|
405
|
-
});
|
package/dist/server/Plugin.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ import Trigger from './triggers';
|
|
|
18
18
|
import { InstructionInterface } from './instructions';
|
|
19
19
|
import type { ExecutionModel, WorkflowModel } from './types';
|
|
20
20
|
type ID = number | string;
|
|
21
|
+
export declare const WORKER_JOB_WORKFLOW_PROCESS = "workflow:process";
|
|
21
22
|
export default class PluginWorkflowServer extends Plugin {
|
|
22
23
|
instructions: Registry<InstructionInterface>;
|
|
23
24
|
triggers: Registry<Trigger>;
|
|
@@ -25,6 +26,7 @@ export default class PluginWorkflowServer extends Plugin {
|
|
|
25
26
|
enabledCache: Map<number, WorkflowModel>;
|
|
26
27
|
snowflake: Snowflake;
|
|
27
28
|
private dispatcher;
|
|
29
|
+
get channelPendingExecution(): string;
|
|
28
30
|
private loggerCache;
|
|
29
31
|
private meter;
|
|
30
32
|
private checker;
|
package/dist/server/Plugin.js
CHANGED
|
@@ -36,6 +36,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
36
36
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
37
|
var Plugin_exports = {};
|
|
38
38
|
__export(Plugin_exports, {
|
|
39
|
+
WORKER_JOB_WORKFLOW_PROCESS: () => WORKER_JOB_WORKFLOW_PROCESS,
|
|
39
40
|
default: () => PluginWorkflowServer
|
|
40
41
|
});
|
|
41
42
|
module.exports = __toCommonJS(Plugin_exports);
|
|
@@ -59,6 +60,7 @@ var import_DestroyInstruction = __toESM(require("./instructions/DestroyInstructi
|
|
|
59
60
|
var import_QueryInstruction = __toESM(require("./instructions/QueryInstruction"));
|
|
60
61
|
var import_UpdateInstruction = __toESM(require("./instructions/UpdateInstruction"));
|
|
61
62
|
var import_WorkflowRepository = __toESM(require("./repositories/WorkflowRepository"));
|
|
63
|
+
const WORKER_JOB_WORKFLOW_PROCESS = "workflow:process";
|
|
62
64
|
class PluginWorkflowServer extends import_server.Plugin {
|
|
63
65
|
instructions = new import_utils.Registry();
|
|
64
66
|
triggers = new import_utils.Registry();
|
|
@@ -66,6 +68,9 @@ class PluginWorkflowServer extends import_server.Plugin {
|
|
|
66
68
|
enabledCache = /* @__PURE__ */ new Map();
|
|
67
69
|
snowflake;
|
|
68
70
|
dispatcher = new import_Dispatcher.default(this);
|
|
71
|
+
get channelPendingExecution() {
|
|
72
|
+
return `${this.name}.pendingExecution`;
|
|
73
|
+
}
|
|
69
74
|
loggerCache;
|
|
70
75
|
meter = null;
|
|
71
76
|
checker = null;
|
|
@@ -170,6 +175,7 @@ class PluginWorkflowServer extends import_server.Plugin {
|
|
|
170
175
|
};
|
|
171
176
|
onBeforeStop = async () => {
|
|
172
177
|
this.dispatcher.setReady(false);
|
|
178
|
+
this.app.eventQueue.unsubscribe(this.channelPendingExecution);
|
|
173
179
|
this.app.logger.info(`stopping workflow plugin before app (${this.app.name}) shutdown...`);
|
|
174
180
|
for (const workflow of this.enabledCache.values()) {
|
|
175
181
|
this.toggle(workflow, false, { silent: true });
|
|
@@ -203,7 +209,7 @@ class PluginWorkflowServer extends import_server.Plugin {
|
|
|
203
209
|
}
|
|
204
210
|
}
|
|
205
211
|
serving() {
|
|
206
|
-
return this.app.serving(
|
|
212
|
+
return this.app.serving(WORKER_JOB_WORKFLOW_PROCESS);
|
|
207
213
|
}
|
|
208
214
|
/**
|
|
209
215
|
* @experimental
|
|
@@ -341,12 +347,10 @@ class PluginWorkflowServer extends import_server.Plugin {
|
|
|
341
347
|
db.on("workflows.afterDestroy", this.onAfterDestroy);
|
|
342
348
|
this.app.on("afterStart", this.onAfterStart);
|
|
343
349
|
this.app.on("beforeStop", this.onBeforeStop);
|
|
344
|
-
|
|
345
|
-
this.
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
});
|
|
349
|
-
}
|
|
350
|
+
this.app.eventQueue.subscribe(this.channelPendingExecution, {
|
|
351
|
+
idle: () => this.serving() && this.dispatcher.idle,
|
|
352
|
+
process: this.dispatcher.onQueueExecution
|
|
353
|
+
});
|
|
350
354
|
}
|
|
351
355
|
toggle(workflow, enable, { silent, transaction } = {}) {
|
|
352
356
|
const type = workflow.get("type");
|
|
@@ -475,3 +479,7 @@ class PluginWorkflowServer extends import_server.Plugin {
|
|
|
475
479
|
}
|
|
476
480
|
}
|
|
477
481
|
}
|
|
482
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
483
|
+
0 && (module.exports = {
|
|
484
|
+
WORKER_JOB_WORKFLOW_PROCESS
|
|
485
|
+
});
|
|
@@ -147,14 +147,20 @@ class CollectionTrigger extends import__.default {
|
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
149
|
on(workflow) {
|
|
150
|
-
var _a
|
|
150
|
+
var _a;
|
|
151
151
|
const { collection, mode } = workflow.config;
|
|
152
152
|
if (!collection) {
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
155
|
const [dataSourceName, collectionName] = (0, import_data_source_manager.parseCollectionName)(collection);
|
|
156
|
-
const
|
|
156
|
+
const dataSource = (_a = this.workflow.app.dataSourceManager) == null ? void 0 : _a.dataSources.get(dataSourceName);
|
|
157
|
+
if (!dataSource) {
|
|
158
|
+
this.workflow.getLogger().warn(`[CollectionTrigger] data source not exists: ${dataSourceName}`);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const { db } = dataSource.collectionManager;
|
|
157
162
|
if (!db || !db.getCollection(collectionName)) {
|
|
163
|
+
this.workflow.getLogger().warn(`[CollectionTrigger] collection not exists: ${dataSourceName}`);
|
|
158
164
|
return;
|
|
159
165
|
}
|
|
160
166
|
for (const [key, type] of MODE_BITMAP_EVENTS.entries()) {
|
|
@@ -182,8 +188,14 @@ class CollectionTrigger extends import__.default {
|
|
|
182
188
|
return;
|
|
183
189
|
}
|
|
184
190
|
const [dataSourceName, collectionName] = (0, import_data_source_manager.parseCollectionName)(collection);
|
|
185
|
-
const
|
|
191
|
+
const dataSource = (_a = this.workflow.app.dataSourceManager) == null ? void 0 : _a.dataSources.get(dataSourceName);
|
|
192
|
+
if (!dataSource) {
|
|
193
|
+
this.workflow.getLogger().warn(`[CollectionTrigger] data source not exists: ${dataSourceName}`);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
const { db } = dataSource.collectionManager;
|
|
186
197
|
if (!db || !db.getCollection(collectionName)) {
|
|
198
|
+
this.workflow.getLogger().warn(`[CollectionTrigger] collection not exists: ${dataSourceName}`);
|
|
187
199
|
return;
|
|
188
200
|
}
|
|
189
201
|
for (const [key, type] of MODE_BITMAP_EVENTS.entries()) {
|
|
@@ -379,6 +379,10 @@ class DateFieldScheduleTrigger {
|
|
|
379
379
|
};
|
|
380
380
|
this.events.set(name, listener);
|
|
381
381
|
const dataSource = this.workflow.app.dataSourceManager.dataSources.get(dataSourceName);
|
|
382
|
+
if (!dataSource) {
|
|
383
|
+
this.workflow.getLogger().warn(`[Schedule on date field] data source not exists: ${dataSourceName}`);
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
382
386
|
const { db } = dataSource.collectionManager;
|
|
383
387
|
db.on(event, listener);
|
|
384
388
|
}
|
|
@@ -396,6 +400,10 @@ class DateFieldScheduleTrigger {
|
|
|
396
400
|
const listener = this.events.get(name);
|
|
397
401
|
if (listener) {
|
|
398
402
|
const dataSource = this.workflow.app.dataSourceManager.dataSources.get(dataSourceName);
|
|
403
|
+
if (!dataSource) {
|
|
404
|
+
this.workflow.getLogger().warn(`[Schedule on date field] data source not exists: ${dataSourceName}`);
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
399
407
|
const { db } = dataSource.collectionManager;
|
|
400
408
|
db.off(event, listener);
|
|
401
409
|
this.events.delete(name);
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "工作流",
|
|
5
5
|
"description": "A powerful BPM tool that provides foundational support for business automation, with the capability to extend unlimited triggers and nodes.",
|
|
6
6
|
"description.zh-CN": "一个强大的 BPM 工具,为业务自动化提供基础支持,并且可任意扩展更多的触发器和节点。",
|
|
7
|
-
"version": "2.0.0-alpha.
|
|
7
|
+
"version": "2.0.0-alpha.42",
|
|
8
8
|
"license": "AGPL-3.0",
|
|
9
9
|
"main": "./dist/server/index.js",
|
|
10
10
|
"homepage": "https://docs.nocobase.com/handbook/workflow",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@nocobase/test": "2.x",
|
|
46
46
|
"@nocobase/utils": "2.x"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "9e96dd78d0c1445c8da76863e30f046be5b48d90",
|
|
49
49
|
"keywords": [
|
|
50
50
|
"Workflow"
|
|
51
51
|
]
|