@nocobase/plugin-async-task-manager 1.8.0-beta.4 → 1.8.0-beta.5
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 +4 -4
- package/dist/node_modules/p-queue/package.json +1 -1
- package/dist/node_modules/uuid/package.json +1 -1
- package/dist/server/base-task-manager.d.ts +0 -1
- package/dist/server/base-task-manager.js +3 -11
- package/dist/server/interfaces/async-task-manager.d.ts +1 -2
- package/package.json +2 -2
package/dist/externalVersion.js
CHANGED
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.8.0-beta.
|
|
11
|
+
"@nocobase/client": "1.8.0-beta.5",
|
|
12
12
|
"react": "18.2.0",
|
|
13
|
-
"@nocobase/logger": "1.8.0-beta.
|
|
14
|
-
"@nocobase/server": "1.8.0-beta.
|
|
13
|
+
"@nocobase/logger": "1.8.0-beta.5",
|
|
14
|
+
"@nocobase/server": "1.8.0-beta.5",
|
|
15
15
|
"lodash": "4.17.21",
|
|
16
|
-
"@nocobase/plugin-error-handler": "1.8.0-beta.
|
|
16
|
+
"@nocobase/plugin-error-handler": "1.8.0-beta.5",
|
|
17
17
|
"antd": "5.24.2",
|
|
18
18
|
"dayjs": "1.11.13"
|
|
19
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"p-queue","version":"6.6.2","description":"Promise queue with concurrency control","license":"MIT","repository":"sindresorhus/p-queue","funding":"https://github.com/sponsors/sindresorhus","main":"dist/index.js","engines":{"node":">=8"},"scripts":{"build":"del dist && tsc","test":"xo && npm run build && nyc ava","bench":"ts-node bench.ts","prepublishOnly":"npm run build"},"files":["dist"],"types":"dist/index.d.ts","keywords":["promise","queue","enqueue","limit","limited","concurrency","throttle","throat","rate","batch","ratelimit","priority","priorityqueue","fifo","job","task","async","await","promises","bluebird"],"dependencies":{"eventemitter3":"^4.0.4","p-timeout":"^3.2.0"},"devDependencies":{"@sindresorhus/tsconfig":"^0.7.0","@types/benchmark":"^1.0.33","@types/node":"^14.6.0","ava":"^2.0.0","benchmark":"^2.1.4","codecov":"^3.7.2","del-cli":"^3.0.1","delay":"^4.4.0","in-range":"^2.0.0","nyc":"^15.1.0","random-int":"^2.0.1","time-span":"^4.0.0","ts-node":"^9.0.0","typescript":"^4.0.2","xo":"^0.33.0"},"ava":{"babel":false,"compileEnhancements":false,"extensions":["ts"],"require":["ts-node/register"],"files":["test/**"]},"xo":{"rules":{"@typescript-eslint/member-ordering":"off","node/no-unsupported-features/es-syntax":"off","@typescript-eslint/no-floating-promises":"off","import/no-named-default":"off","@typescript-eslint/no-invalid-void-type":"off"}},"nyc":{"extension":[".ts"]},"_lastModified":"2025-06-
|
|
1
|
+
{"name":"p-queue","version":"6.6.2","description":"Promise queue with concurrency control","license":"MIT","repository":"sindresorhus/p-queue","funding":"https://github.com/sponsors/sindresorhus","main":"dist/index.js","engines":{"node":">=8"},"scripts":{"build":"del dist && tsc","test":"xo && npm run build && nyc ava","bench":"ts-node bench.ts","prepublishOnly":"npm run build"},"files":["dist"],"types":"dist/index.d.ts","keywords":["promise","queue","enqueue","limit","limited","concurrency","throttle","throat","rate","batch","ratelimit","priority","priorityqueue","fifo","job","task","async","await","promises","bluebird"],"dependencies":{"eventemitter3":"^4.0.4","p-timeout":"^3.2.0"},"devDependencies":{"@sindresorhus/tsconfig":"^0.7.0","@types/benchmark":"^1.0.33","@types/node":"^14.6.0","ava":"^2.0.0","benchmark":"^2.1.4","codecov":"^3.7.2","del-cli":"^3.0.1","delay":"^4.4.0","in-range":"^2.0.0","nyc":"^15.1.0","random-int":"^2.0.1","time-span":"^4.0.0","ts-node":"^9.0.0","typescript":"^4.0.2","xo":"^0.33.0"},"ava":{"babel":false,"compileEnhancements":false,"extensions":["ts"],"require":["ts-node/register"],"files":["test/**"]},"xo":{"rules":{"@typescript-eslint/member-ordering":"off","node/no-unsupported-features/es-syntax":"off","@typescript-eslint/no-floating-promises":"off","import/no-named-default":"off","@typescript-eslint/no-invalid-void-type":"off"}},"nyc":{"extension":[".ts"]},"_lastModified":"2025-06-07T00:16:48.014Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"uuid","version":"9.0.1","description":"RFC4122 (v1, v4, and v5) UUIDs","funding":["https://github.com/sponsors/broofa","https://github.com/sponsors/ctavan"],"commitlint":{"extends":["@commitlint/config-conventional"]},"keywords":["uuid","guid","rfc4122"],"license":"MIT","bin":{"uuid":"./dist/bin/uuid"},"sideEffects":false,"main":"./dist/index.js","exports":{".":{"node":{"module":"./dist/esm-node/index.js","require":"./dist/index.js","import":"./wrapper.mjs"},"browser":{"import":"./dist/esm-browser/index.js","require":"./dist/commonjs-browser/index.js"},"default":"./dist/esm-browser/index.js"},"./package.json":"./package.json"},"module":"./dist/esm-node/index.js","browser":{"./dist/md5.js":"./dist/md5-browser.js","./dist/native.js":"./dist/native-browser.js","./dist/rng.js":"./dist/rng-browser.js","./dist/sha1.js":"./dist/sha1-browser.js","./dist/esm-node/index.js":"./dist/esm-browser/index.js"},"files":["CHANGELOG.md","CONTRIBUTING.md","LICENSE.md","README.md","dist","wrapper.mjs"],"devDependencies":{"@babel/cli":"7.18.10","@babel/core":"7.18.10","@babel/eslint-parser":"7.18.9","@babel/preset-env":"7.18.10","@commitlint/cli":"17.0.3","@commitlint/config-conventional":"17.0.3","bundlewatch":"0.3.3","eslint":"8.21.0","eslint-config-prettier":"8.5.0","eslint-config-standard":"17.0.0","eslint-plugin-import":"2.26.0","eslint-plugin-node":"11.1.0","eslint-plugin-prettier":"4.2.1","eslint-plugin-promise":"6.0.0","husky":"8.0.1","jest":"28.1.3","lint-staged":"13.0.3","npm-run-all":"4.1.5","optional-dev-dependency":"2.0.1","prettier":"2.7.1","random-seed":"0.3.0","runmd":"1.3.9","standard-version":"9.5.0"},"optionalDevDependencies":{"@wdio/browserstack-service":"7.16.10","@wdio/cli":"7.16.10","@wdio/jasmine-framework":"7.16.6","@wdio/local-runner":"7.16.10","@wdio/spec-reporter":"7.16.9","@wdio/static-server-service":"7.16.6"},"scripts":{"examples:browser:webpack:build":"cd examples/browser-webpack && npm install && npm run build","examples:browser:rollup:build":"cd examples/browser-rollup && npm install && npm run build","examples:node:commonjs:test":"cd examples/node-commonjs && npm install && npm test","examples:node:esmodules:test":"cd examples/node-esmodules && npm install && npm test","examples:node:jest:test":"cd examples/node-jest && npm install && npm test","prepare":"cd $( git rev-parse --show-toplevel ) && husky install","lint":"npm run eslint:check && npm run prettier:check","eslint:check":"eslint src/ test/ examples/ *.js","eslint:fix":"eslint --fix src/ test/ examples/ *.js","pretest":"[ -n $CI ] || npm run build","test":"BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/","pretest:browser":"optional-dev-dependency && npm run build && npm-run-all --parallel examples:browser:**","test:browser":"wdio run ./wdio.conf.js","pretest:node":"npm run build","test:node":"npm-run-all --parallel examples:node:**","test:pack":"./scripts/testpack.sh","pretest:benchmark":"npm run build","test:benchmark":"cd examples/benchmark && npm install && npm test","prettier:check":"prettier --check '**/*.{js,jsx,json,md}'","prettier:fix":"prettier --write '**/*.{js,jsx,json,md}'","bundlewatch":"npm run pretest:browser && bundlewatch --config bundlewatch.config.json","md":"runmd --watch --output=README.md README_js.md","docs":"( node --version | grep -q 'v18' ) && ( npm run build && npx runmd --output=README.md README_js.md )","docs:diff":"npm run docs && git diff --quiet README.md","build":"./scripts/build.sh","prepack":"npm run build","release":"standard-version --no-verify"},"repository":{"type":"git","url":"https://github.com/uuidjs/uuid.git"},"lint-staged":{"*.{js,jsx,json,md}":["prettier --write"],"*.{js,jsx}":["eslint --fix"]},"standard-version":{"scripts":{"postchangelog":"prettier --write CHANGELOG.md"}},"_lastModified":"2025-06-
|
|
1
|
+
{"name":"uuid","version":"9.0.1","description":"RFC4122 (v1, v4, and v5) UUIDs","funding":["https://github.com/sponsors/broofa","https://github.com/sponsors/ctavan"],"commitlint":{"extends":["@commitlint/config-conventional"]},"keywords":["uuid","guid","rfc4122"],"license":"MIT","bin":{"uuid":"./dist/bin/uuid"},"sideEffects":false,"main":"./dist/index.js","exports":{".":{"node":{"module":"./dist/esm-node/index.js","require":"./dist/index.js","import":"./wrapper.mjs"},"browser":{"import":"./dist/esm-browser/index.js","require":"./dist/commonjs-browser/index.js"},"default":"./dist/esm-browser/index.js"},"./package.json":"./package.json"},"module":"./dist/esm-node/index.js","browser":{"./dist/md5.js":"./dist/md5-browser.js","./dist/native.js":"./dist/native-browser.js","./dist/rng.js":"./dist/rng-browser.js","./dist/sha1.js":"./dist/sha1-browser.js","./dist/esm-node/index.js":"./dist/esm-browser/index.js"},"files":["CHANGELOG.md","CONTRIBUTING.md","LICENSE.md","README.md","dist","wrapper.mjs"],"devDependencies":{"@babel/cli":"7.18.10","@babel/core":"7.18.10","@babel/eslint-parser":"7.18.9","@babel/preset-env":"7.18.10","@commitlint/cli":"17.0.3","@commitlint/config-conventional":"17.0.3","bundlewatch":"0.3.3","eslint":"8.21.0","eslint-config-prettier":"8.5.0","eslint-config-standard":"17.0.0","eslint-plugin-import":"2.26.0","eslint-plugin-node":"11.1.0","eslint-plugin-prettier":"4.2.1","eslint-plugin-promise":"6.0.0","husky":"8.0.1","jest":"28.1.3","lint-staged":"13.0.3","npm-run-all":"4.1.5","optional-dev-dependency":"2.0.1","prettier":"2.7.1","random-seed":"0.3.0","runmd":"1.3.9","standard-version":"9.5.0"},"optionalDevDependencies":{"@wdio/browserstack-service":"7.16.10","@wdio/cli":"7.16.10","@wdio/jasmine-framework":"7.16.6","@wdio/local-runner":"7.16.10","@wdio/spec-reporter":"7.16.9","@wdio/static-server-service":"7.16.6"},"scripts":{"examples:browser:webpack:build":"cd examples/browser-webpack && npm install && npm run build","examples:browser:rollup:build":"cd examples/browser-rollup && npm install && npm run build","examples:node:commonjs:test":"cd examples/node-commonjs && npm install && npm test","examples:node:esmodules:test":"cd examples/node-esmodules && npm install && npm test","examples:node:jest:test":"cd examples/node-jest && npm install && npm test","prepare":"cd $( git rev-parse --show-toplevel ) && husky install","lint":"npm run eslint:check && npm run prettier:check","eslint:check":"eslint src/ test/ examples/ *.js","eslint:fix":"eslint --fix src/ test/ examples/ *.js","pretest":"[ -n $CI ] || npm run build","test":"BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/","pretest:browser":"optional-dev-dependency && npm run build && npm-run-all --parallel examples:browser:**","test:browser":"wdio run ./wdio.conf.js","pretest:node":"npm run build","test:node":"npm-run-all --parallel examples:node:**","test:pack":"./scripts/testpack.sh","pretest:benchmark":"npm run build","test:benchmark":"cd examples/benchmark && npm install && npm test","prettier:check":"prettier --check '**/*.{js,jsx,json,md}'","prettier:fix":"prettier --write '**/*.{js,jsx,json,md}'","bundlewatch":"npm run pretest:browser && bundlewatch --config bundlewatch.config.json","md":"runmd --watch --output=README.md README_js.md","docs":"( node --version | grep -q 'v18' ) && ( npm run build && npx runmd --output=README.md README_js.md )","docs:diff":"npm run docs && git diff --quiet README.md","build":"./scripts/build.sh","prepack":"npm run build","release":"standard-version --no-verify"},"repository":{"type":"git","url":"https://github.com/uuidjs/uuid.git"},"lint-staged":{"*.{js,jsx,json,md}":["prettier --write"],"*.{js,jsx}":["eslint --fix"]},"standard-version":{"scripts":{"postchangelog":"prettier --write CHANGELOG.md"}},"_lastModified":"2025-06-07T00:16:48.185Z"}
|
|
@@ -29,7 +29,6 @@ export declare class BaseTaskManager extends EventEmitter implements AsyncTasksM
|
|
|
29
29
|
resumeQueue(): void;
|
|
30
30
|
cancelTask(taskId: TaskId): Promise<boolean>;
|
|
31
31
|
createTask<T>(options: CreateTaskOptions): ITask;
|
|
32
|
-
runTask(taskId: TaskId): void;
|
|
33
32
|
getTask(taskId: TaskId): ITask | undefined;
|
|
34
33
|
getTaskStatus(taskId: TaskId): Promise<TaskStatus>;
|
|
35
34
|
registerTaskType(taskType: TaskConstructor): void;
|
|
@@ -137,6 +137,9 @@ class BaseTaskManager extends import_events.EventEmitter {
|
|
|
137
137
|
)}, tags: ${JSON.stringify(options.tags)}, title: ${task.title}`
|
|
138
138
|
);
|
|
139
139
|
this.emit("taskCreated", { task });
|
|
140
|
+
if (options.useQueue) {
|
|
141
|
+
this.enqueueTask(task);
|
|
142
|
+
}
|
|
140
143
|
task.on("progress", (progress) => {
|
|
141
144
|
this.logger.debug(`Task ${task.taskId} progress: ${progress}`);
|
|
142
145
|
this.emit("taskProgress", { task, progress });
|
|
@@ -149,19 +152,8 @@ class BaseTaskManager extends import_events.EventEmitter {
|
|
|
149
152
|
}
|
|
150
153
|
this.emit("taskStatusChange", { task, status });
|
|
151
154
|
});
|
|
152
|
-
if (options.immediateExecute !== false) {
|
|
153
|
-
this.enqueueTask(task);
|
|
154
|
-
}
|
|
155
155
|
return task;
|
|
156
156
|
}
|
|
157
|
-
runTask(taskId) {
|
|
158
|
-
const task = this.tasks.get(taskId);
|
|
159
|
-
if (task) {
|
|
160
|
-
this.enqueueTask(task);
|
|
161
|
-
} else {
|
|
162
|
-
this.logger.warn(`Attempted to enqueue non-existent task ${taskId}`);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
157
|
getTask(taskId) {
|
|
166
158
|
const task = this.tasks.get(taskId);
|
|
167
159
|
if (!task) {
|
|
@@ -22,7 +22,7 @@ export interface CreateTaskOptions {
|
|
|
22
22
|
dataSource: string;
|
|
23
23
|
};
|
|
24
24
|
context?: any;
|
|
25
|
-
|
|
25
|
+
useQueue?: boolean;
|
|
26
26
|
}
|
|
27
27
|
export type TaskId = string;
|
|
28
28
|
export type TaskStatus = PendingStatus | SuccessStatus<any> | RunningStatus | FailedStatus | CancelledStatus;
|
|
@@ -62,7 +62,6 @@ export interface AsyncTasksManager extends EventEmitter {
|
|
|
62
62
|
cancelTask(taskId: TaskId): Promise<boolean>;
|
|
63
63
|
getTaskStatus(taskId: TaskId): Promise<TaskStatus>;
|
|
64
64
|
getTask(taskId: TaskId): ITask | undefined;
|
|
65
|
-
runTask(taskId: TaskId): void;
|
|
66
65
|
}
|
|
67
66
|
export declare class CancelError extends Error {
|
|
68
67
|
constructor(message?: string);
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "异步任务管理器",
|
|
5
5
|
"description": "Manage and monitor asynchronous tasks such as data import/export. Support task progress tracking and notification.",
|
|
6
6
|
"description.zh-CN": "管理和监控数据导入导出等异步任务。支持任务进度跟踪和通知。",
|
|
7
|
-
"version": "1.8.0-beta.
|
|
7
|
+
"version": "1.8.0-beta.5",
|
|
8
8
|
"main": "dist/server/index.js",
|
|
9
9
|
"peerDependencies": {
|
|
10
10
|
"@nocobase/client": "1.x",
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"p-queue": "^6.6.2"
|
|
17
17
|
},
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "0934898138d3aecefb02842ba4cd42c5b00249f6"
|
|
19
19
|
}
|