@midwayjs/bull 3.7.4 → 3.8.0

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.
@@ -4,7 +4,7 @@ import { Job, JobOptions, QueueOptions } from 'bull';
4
4
  import * as Bull from 'bull';
5
5
  export declare class BullQueue extends Bull implements IQueue<Job> {
6
6
  constructor(queueName: string, queueOptions: QueueOptions);
7
- runJob(data: Record<string, any>, options?: JobOptions): Promise<Job<any>>;
7
+ runJob(data: any, options?: JobOptions): Promise<Job>;
8
8
  getQueueName(): string;
9
9
  }
10
10
  export declare class BullFramework extends BaseFramework<Application, Context, any> implements IQueueManager<BullQueue, Job> {
@@ -22,7 +22,7 @@ export declare class BullFramework extends BaseFramework<Application, Context, a
22
22
  ensureQueue(name: string): BullQueue;
23
23
  getQueueList(): BullQueue[];
24
24
  addProcessor(processor: new (...args: any[]) => IProcessor, queueName: string | BullQueue, concurrency?: number): Promise<void>;
25
- runJob(queueName: string, jobData: any, options?: JobOptions): Promise<void>;
25
+ runJob(queueName: string, jobData: any, options?: JobOptions): Promise<Job | undefined>;
26
26
  getJob(queueName: string, jobName: string): Promise<Job>;
27
27
  }
28
28
  //# sourceMappingURL=framework.d.ts.map
package/dist/framework.js CHANGED
@@ -114,7 +114,7 @@ let BullFramework = class BullFramework extends core_1.BaseFramework {
114
114
  async runJob(queueName, jobData, options) {
115
115
  const queue = this.queueMap.get(queueName);
116
116
  if (queue) {
117
- await queue.runJob(jobData, options);
117
+ return await queue.runJob(jobData, options);
118
118
  }
119
119
  }
120
120
  async getJob(queueName, jobName) {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { BullConfiguration as Configuration } from './configuration';
2
- export { BullFramework as Framework } from './framework';
2
+ export { BullFramework as Framework, BullQueue } from './framework';
3
3
  export * from './decorator';
4
4
  export * from './interface';
5
5
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -14,11 +14,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.Framework = exports.Configuration = void 0;
17
+ exports.BullQueue = exports.Framework = exports.Configuration = void 0;
18
18
  var configuration_1 = require("./configuration");
19
19
  Object.defineProperty(exports, "Configuration", { enumerable: true, get: function () { return configuration_1.BullConfiguration; } });
20
20
  var framework_1 = require("./framework");
21
21
  Object.defineProperty(exports, "Framework", { enumerable: true, get: function () { return framework_1.BullFramework; } });
22
+ Object.defineProperty(exports, "BullQueue", { enumerable: true, get: function () { return framework_1.BullQueue; } });
22
23
  __exportStar(require("./decorator"), exports);
23
24
  __exportStar(require("./interface"), exports);
24
25
  //# sourceMappingURL=index.js.map
@@ -4,12 +4,12 @@ export interface IProcessor {
4
4
  execute(data: any): any;
5
5
  }
6
6
  export interface IQueue<Job> {
7
- runJob(data: Record<string, any>, options?: unknown): any;
7
+ runJob(data: Record<string, any>, options?: unknown): Promise<Job>;
8
8
  getJob(name: string): Promise<Job>;
9
9
  getQueueName(): string;
10
10
  }
11
11
  export interface IQueueManager<Queue extends IQueue<Job>, Job> {
12
- runJob(queueName: string, jobData: any, options?: unknown): any;
12
+ runJob(queueName: string, jobData: any, options?: unknown): Promise<Job | undefined>;
13
13
  getJob(queueName: string, jobName: string): Promise<Job>;
14
14
  createQueue(queueName: string, queueOptions?: unknown): Queue;
15
15
  getQueue(queueName: string): Queue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/bull",
3
- "version": "3.7.4",
3
+ "version": "3.8.0",
4
4
  "description": "midway component for bull",
5
5
  "main": "dist/index.js",
6
6
  "typings": "index.d.ts",
@@ -24,8 +24,8 @@
24
24
  ],
25
25
  "license": "MIT",
26
26
  "devDependencies": {
27
- "@midwayjs/core": "^3.7.0",
28
- "@midwayjs/mock": "^3.7.3"
27
+ "@midwayjs/core": "^3.8.0",
28
+ "@midwayjs/mock": "^3.8.0"
29
29
  },
30
30
  "dependencies": {
31
31
  "bull": "4.10.1"
@@ -33,5 +33,5 @@
33
33
  "engines": {
34
34
  "node": ">=12"
35
35
  },
36
- "gitHead": "bb659c7f553ee61832b87eb4c16b024749897636"
36
+ "gitHead": "5c640c7182923587139f9f9c0aecf50585798e1e"
37
37
  }