@nest-boot/bullmq-mikro-orm 7.3.8 → 8.0.0-beta.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/bullmq-mikro-orm-module-options.interface.d.ts +2 -8
- package/dist/bullmq-mikro-orm-module-options.interface.js +1 -2
- package/dist/bullmq-mikro-orm.module-definition.d.ts +2 -2
- package/dist/bullmq-mikro-orm.module-definition.js +3 -7
- package/dist/bullmq-mikro-orm.module-definition.js.map +1 -1
- package/dist/bullmq-mikro-orm.module.d.ts +3 -20
- package/dist/bullmq-mikro-orm.module.js +11 -31
- package/dist/bullmq-mikro-orm.module.js.map +1 -1
- package/dist/bullmq-mikro-orm.service.d.ts +5 -5
- package/dist/bullmq-mikro-orm.service.js +27 -27
- package/dist/bullmq-mikro-orm.service.js.map +1 -1
- package/dist/entities/job.entity.d.ts +2 -22
- package/dist/entities/job.entity.js +37 -39
- package/dist/entities/job.entity.js.map +1 -1
- package/dist/enums/job-status.enum.d.ts +0 -9
- package/dist/enums/job-status.enum.js +2 -14
- package/dist/enums/job-status.enum.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -20
- package/dist/index.js.map +1 -1
- package/dist/utils/convert-bullmq-job-state-to-job-status.util.d.ts +1 -6
- package/dist/utils/convert-bullmq-job-state-to-job-status.util.js +10 -18
- package/dist/utils/convert-bullmq-job-state-to-job-status.util.js.map +1 -1
- package/dist/utils/should-include-queue.util.d.ts +0 -13
- package/dist/utils/should-include-queue.util.js +1 -20
- package/dist/utils/should-include-queue.util.js.map +1 -1
- package/package.json +43 -33
- package/dist/bullmq-mikro-orm.module.spec.d.ts +0 -1
- package/dist/bullmq-mikro-orm.module.spec.js +0 -38
- package/dist/bullmq-mikro-orm.module.spec.js.map +0 -1
- package/dist/bullmq-mikro-orm.service.spec.d.ts +0 -1
- package/dist/bullmq-mikro-orm.service.spec.js +0 -199
- package/dist/bullmq-mikro-orm.service.spec.js.map +0 -1
- package/dist/entities/job.entity.spec.d.ts +0 -1
- package/dist/entities/job.entity.spec.js +0 -42
- package/dist/entities/job.entity.spec.js.map +0 -1
- package/dist/index.spec.d.ts +0 -1
- package/dist/index.spec.js +0 -47
- package/dist/index.spec.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/dist/utils/convert-bullmq-job-state-to-job-status.util.spec.d.ts +0 -1
- package/dist/utils/convert-bullmq-job-state-to-job-status.util.spec.js +0 -22
- package/dist/utils/convert-bullmq-job-state-to-job-status.util.spec.js.map +0 -1
- package/dist/utils/should-include-queue.util.spec.d.ts +0 -1
- package/dist/utils/should-include-queue.util.spec.js +0 -62
- package/dist/utils/should-include-queue.util.spec.js.map +0 -1
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import { EntityClass, EntityData } from "@mikro-orm/core";
|
|
1
|
+
import { type EntityClass, type EntityData } from "@mikro-orm/core";
|
|
2
2
|
import { Job } from "bullmq";
|
|
3
|
-
import { JobEntity } from "./entities/job.entity";
|
|
4
|
-
/** Configuration options for the BullMQ-MikroORM integration module. */
|
|
3
|
+
import { JobEntity } from "./entities/job.entity.js";
|
|
5
4
|
export interface BullMQMikroORMModuleOptions<T extends JobEntity = JobEntity> {
|
|
6
|
-
/** The MikroORM entity class used to persist BullMQ jobs. */
|
|
7
5
|
jobEntity: EntityClass<T>;
|
|
8
|
-
/** Time-to-live (in milliseconds) after which completed/failed jobs are deleted. */
|
|
9
6
|
jobTTL?: number;
|
|
10
|
-
/** Custom function to convert a BullMQ job into entity data for persistence. */
|
|
11
7
|
convertJobToEntityData?: (job: Job) => EntityData<T> | Promise<EntityData<T>>;
|
|
12
|
-
/** Queue names to include for persistence. If unset, all queues are included. */
|
|
13
8
|
includeQueues?: string[];
|
|
14
|
-
/** Queue names to exclude from persistence. */
|
|
15
9
|
excludeQueues?: string[];
|
|
16
10
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { BullMQMikroORMModuleOptions } from "./bullmq-mikro-orm-module-options.interface";
|
|
2
|
-
export declare const ConfigurableModuleClass: import("@nestjs/common").ConfigurableModuleCls<BullMQMikroORMModuleOptions<import(".").JobEntity>, "forRoot", "create", {}>, MODULE_OPTIONS_TOKEN: string | symbol;
|
|
1
|
+
import { BullMQMikroORMModuleOptions } from "./bullmq-mikro-orm-module-options.interface.js";
|
|
2
|
+
export declare const ConfigurableModuleClass: import("@nestjs/common").ConfigurableModuleCls<BullMQMikroORMModuleOptions<import("./index.js").JobEntity>, "forRoot", "create", {}>, MODULE_OPTIONS_TOKEN: string | symbol;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.MODULE_OPTIONS_TOKEN = exports.ConfigurableModuleClass = void 0;
|
|
5
|
-
const common_1 = require("@nestjs/common");
|
|
6
|
-
_a = new common_1.ConfigurableModuleBuilder()
|
|
1
|
+
import { ConfigurableModuleBuilder } from "@nestjs/common";
|
|
2
|
+
export const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN } = new ConfigurableModuleBuilder()
|
|
7
3
|
.setClassMethodName("forRoot")
|
|
8
|
-
.build()
|
|
4
|
+
.build();
|
|
9
5
|
//# sourceMappingURL=bullmq-mikro-orm.module-definition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bullmq-mikro-orm.module-definition.js","sourceRoot":"","sources":["../src/bullmq-mikro-orm.module-definition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bullmq-mikro-orm.module-definition.js","sourceRoot":"","sources":["../src/bullmq-mikro-orm.module-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAI3D,MAAM,CAAC,MAAM,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,GAC5D,IAAI,yBAAyB,EAA+B;KACzD,kBAAkB,CAAC,SAAS,CAAC;KAC7B,KAAK,EAAE,CAAC"}
|
|
@@ -1,25 +1,8 @@
|
|
|
1
1
|
import { ConfigurableModuleAsyncOptions } from "@nestjs/common";
|
|
2
|
-
import { ConfigurableModuleClass } from "./bullmq-mikro-orm.module-definition";
|
|
3
|
-
import { BullMQMikroORMModuleOptions } from "./bullmq-mikro-orm-module-options.interface";
|
|
4
|
-
import { JobEntity } from "./entities/job.entity";
|
|
5
|
-
/**
|
|
6
|
-
* Module that integrates BullMQ job events with MikroORM persistence.
|
|
7
|
-
*
|
|
8
|
-
* @remarks
|
|
9
|
-
* Subscribes to BullMQ queue events and automatically persists job state
|
|
10
|
-
* changes to the database using the configured entity.
|
|
11
|
-
*/
|
|
2
|
+
import { ConfigurableModuleClass } from "./bullmq-mikro-orm.module-definition.js";
|
|
3
|
+
import { BullMQMikroORMModuleOptions } from "./bullmq-mikro-orm-module-options.interface.js";
|
|
4
|
+
import { JobEntity } from "./entities/job.entity.js";
|
|
12
5
|
export declare class BullMQMikroORMModule extends ConfigurableModuleClass {
|
|
13
|
-
/**
|
|
14
|
-
* Registers the module with synchronous options.
|
|
15
|
-
* @param options - Configuration including the job entity class
|
|
16
|
-
* @returns Dynamic module configuration
|
|
17
|
-
*/
|
|
18
6
|
static forRoot<T extends JobEntity = JobEntity>(options: BullMQMikroORMModuleOptions<T>): import("@nestjs/common").DynamicModule;
|
|
19
|
-
/**
|
|
20
|
-
* Registers the module with asynchronous options via factory functions.
|
|
21
|
-
* @param options - Async configuration options
|
|
22
|
-
* @returns Dynamic module configuration
|
|
23
|
-
*/
|
|
24
7
|
static forRootAsync<T extends JobEntity = JobEntity>(options: ConfigurableModuleAsyncOptions<BullMQMikroORMModuleOptions<T>>): import("@nestjs/common").DynamicModule;
|
|
25
8
|
}
|
|
@@ -1,47 +1,27 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const bullmq_mikro_orm_service_1 = require("./bullmq-mikro-orm.service");
|
|
14
|
-
/**
|
|
15
|
-
* Module that integrates BullMQ job events with MikroORM persistence.
|
|
16
|
-
*
|
|
17
|
-
* @remarks
|
|
18
|
-
* Subscribes to BullMQ queue events and automatically persists job state
|
|
19
|
-
* changes to the database using the configured entity.
|
|
20
|
-
*/
|
|
21
|
-
let BullMQMikroORMModule = class BullMQMikroORMModule extends bullmq_mikro_orm_module_definition_1.ConfigurableModuleClass {
|
|
22
|
-
/**
|
|
23
|
-
* Registers the module with synchronous options.
|
|
24
|
-
* @param options - Configuration including the job entity class
|
|
25
|
-
* @returns Dynamic module configuration
|
|
26
|
-
*/
|
|
7
|
+
import { Global, Module } from "@nestjs/common";
|
|
8
|
+
import { DiscoveryModule } from "@nestjs/core";
|
|
9
|
+
import { ConfigurableModuleClass } from "./bullmq-mikro-orm.module-definition.js";
|
|
10
|
+
import { BullMQMikroORMService } from "./bullmq-mikro-orm.service.js";
|
|
11
|
+
let BullMQMikroORMModule = class BullMQMikroORMModule extends ConfigurableModuleClass {
|
|
27
12
|
static forRoot(options) {
|
|
28
13
|
return super.forRoot(options);
|
|
29
14
|
}
|
|
30
|
-
/**
|
|
31
|
-
* Registers the module with asynchronous options via factory functions.
|
|
32
|
-
* @param options - Async configuration options
|
|
33
|
-
* @returns Dynamic module configuration
|
|
34
|
-
*/
|
|
35
15
|
static forRootAsync(options) {
|
|
36
16
|
return super.forRootAsync(options);
|
|
37
17
|
}
|
|
38
18
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
providers: [bullmq_mikro_orm_service_1.BullMQMikroORMService],
|
|
19
|
+
BullMQMikroORMModule = __decorate([
|
|
20
|
+
Global(),
|
|
21
|
+
Module({
|
|
22
|
+
imports: [DiscoveryModule],
|
|
23
|
+
providers: [BullMQMikroORMService],
|
|
45
24
|
})
|
|
46
25
|
], BullMQMikroORMModule);
|
|
26
|
+
export { BullMQMikroORMModule };
|
|
47
27
|
//# sourceMappingURL=bullmq-mikro-orm.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bullmq-mikro-orm.module.js","sourceRoot":"","sources":["../src/bullmq-mikro-orm.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bullmq-mikro-orm.module.js","sourceRoot":"","sources":["../src/bullmq-mikro-orm.module.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAkC,MAAM,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAgB/D,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,uBAAuB;IAM/D,MAAM,CAAC,OAAO,CACZ,OAAuC;QAEvC,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;IAOD,MAAM,CAAC,YAAY,CACjB,OAAuE;QAEvE,OAAO,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;CACF,CAAA;AAtBY,oBAAoB;IALhC,MAAM,EAAE;IACR,MAAM,CAAC;QACN,OAAO,EAAE,CAAC,eAAe,CAAC;QAC1B,SAAS,EAAE,CAAC,qBAAqB,CAAC;KACnC,CAAC;GACW,oBAAoB,CAsBhC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { EntityData, EntityManager } from "@mikro-orm/core";
|
|
2
|
-
import { OnApplicationBootstrap } from "@nestjs/common";
|
|
1
|
+
import { type EntityData, EntityManager } from "@mikro-orm/core";
|
|
2
|
+
import { type OnApplicationBootstrap } from "@nestjs/common";
|
|
3
3
|
import { DiscoveryService } from "@nestjs/core";
|
|
4
|
-
import { Job, JobState } from "bullmq";
|
|
5
|
-
import { BullMQMikroORMModuleOptions } from "./bullmq-mikro-orm-module-options.interface";
|
|
6
|
-
import { JobEntity } from "./entities/job.entity";
|
|
4
|
+
import { type Job, type JobState } from "bullmq";
|
|
5
|
+
import { type BullMQMikroORMModuleOptions } from "./bullmq-mikro-orm-module-options.interface.js";
|
|
6
|
+
import { JobEntity } from "./entities/job.entity.js";
|
|
7
7
|
export declare class BullMQMikroORMService implements OnApplicationBootstrap {
|
|
8
8
|
private readonly discoveryService;
|
|
9
9
|
private readonly em;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11,25 +10,26 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
10
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
12
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const convert_bullmq_job_state_to_job_status_util_1 = require("./utils/convert-bullmq-job-state-to-job-status.util");
|
|
24
|
-
const should_include_queue_util_1 = require("./utils/should-include-queue.util");
|
|
13
|
+
import { EntityManager } from "@mikro-orm/core";
|
|
14
|
+
import { WorkerHost } from "@nest-boot/bullmq";
|
|
15
|
+
import { Cron } from "@nest-boot/schedule";
|
|
16
|
+
import { Inject, Injectable, } from "@nestjs/common";
|
|
17
|
+
import { DiscoveryService } from "@nestjs/core";
|
|
18
|
+
import { Queue } from "bullmq";
|
|
19
|
+
import { MODULE_OPTIONS_TOKEN } from "./bullmq-mikro-orm.module-definition.js";
|
|
20
|
+
import { convertBullmqJobStateToJobStatus } from "./utils/convert-bullmq-job-state-to-job-status.util.js";
|
|
21
|
+
import { shouldIncludeQueue } from "./utils/should-include-queue.util.js";
|
|
25
22
|
let BullMQMikroORMService = class BullMQMikroORMService {
|
|
23
|
+
discoveryService;
|
|
24
|
+
em;
|
|
25
|
+
options;
|
|
26
|
+
jobTTL = 1000 * 60 * 60 * 24 * 30;
|
|
27
|
+
includeQueues = [];
|
|
28
|
+
excludeQueues = [];
|
|
26
29
|
constructor(discoveryService, em, options) {
|
|
27
30
|
this.discoveryService = discoveryService;
|
|
28
31
|
this.em = em;
|
|
29
32
|
this.options = options;
|
|
30
|
-
this.jobTTL = 1000 * 60 * 60 * 24 * 30;
|
|
31
|
-
this.includeQueues = [];
|
|
32
|
-
this.excludeQueues = [];
|
|
33
33
|
this.jobTTL = this.options.jobTTL ?? this.jobTTL;
|
|
34
34
|
this.includeQueues = this.options.includeQueues ?? this.includeQueues;
|
|
35
35
|
this.excludeQueues = this.options.excludeQueues ?? this.excludeQueues;
|
|
@@ -48,7 +48,7 @@ let BullMQMikroORMService = class BullMQMikroORMService {
|
|
|
48
48
|
failedReason: job.failedReason ?? null,
|
|
49
49
|
priority: job.priority,
|
|
50
50
|
progress: job.progress,
|
|
51
|
-
status:
|
|
51
|
+
status: convertBullmqJobStateToJobStatus(latestJobState),
|
|
52
52
|
startedAt: job.processedOn ? new Date(job.processedOn) : null,
|
|
53
53
|
finishedAt: job.finishedOn ? new Date(job.finishedOn) : null,
|
|
54
54
|
createdAt: new Date(job.timestamp),
|
|
@@ -75,14 +75,14 @@ let BullMQMikroORMService = class BullMQMikroORMService {
|
|
|
75
75
|
onApplicationBootstrap() {
|
|
76
76
|
const instanceWrappers = this.discoveryService.getProviders();
|
|
77
77
|
instanceWrappers
|
|
78
|
-
.filter((provider) => provider.instance instanceof
|
|
79
|
-
.filter((provider) =>
|
|
78
|
+
.filter((provider) => provider.instance instanceof Queue)
|
|
79
|
+
.filter((provider) => shouldIncludeQueue(provider.instance.name, this.includeQueues, this.excludeQueues))
|
|
80
80
|
.forEach((provider) => {
|
|
81
81
|
void provider.instance.on("waiting", (job) => void this.upsertJob(job, "waiting"));
|
|
82
82
|
});
|
|
83
83
|
instanceWrappers
|
|
84
|
-
.filter((provider) => provider.instance instanceof
|
|
85
|
-
.filter((provider) =>
|
|
84
|
+
.filter((provider) => provider.instance instanceof WorkerHost)
|
|
85
|
+
.filter((provider) => shouldIncludeQueue(provider.instance.worker.name, this.includeQueues, this.excludeQueues))
|
|
86
86
|
.forEach((provider) => {
|
|
87
87
|
provider.instance.worker.on("active", (job) => void this.upsertJob(job, "active"));
|
|
88
88
|
provider.instance.worker.on("progress", (job) => void this.upsertJob(job, "active"));
|
|
@@ -91,17 +91,17 @@ let BullMQMikroORMService = class BullMQMikroORMService {
|
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
|
-
exports.BullMQMikroORMService = BullMQMikroORMService;
|
|
95
94
|
__decorate([
|
|
96
|
-
|
|
95
|
+
Cron("0 * * * *"),
|
|
97
96
|
__metadata("design:type", Function),
|
|
98
97
|
__metadata("design:paramtypes", []),
|
|
99
98
|
__metadata("design:returntype", Promise)
|
|
100
99
|
], BullMQMikroORMService.prototype, "cleanHistoryJobs", null);
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
__param(2,
|
|
104
|
-
__metadata("design:paramtypes", [
|
|
105
|
-
|
|
100
|
+
BullMQMikroORMService = __decorate([
|
|
101
|
+
Injectable(),
|
|
102
|
+
__param(2, Inject(MODULE_OPTIONS_TOKEN)),
|
|
103
|
+
__metadata("design:paramtypes", [DiscoveryService,
|
|
104
|
+
EntityManager, Object])
|
|
106
105
|
], BullMQMikroORMService);
|
|
106
|
+
export { BullMQMikroORMService };
|
|
107
107
|
//# sourceMappingURL=bullmq-mikro-orm.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bullmq-mikro-orm.service.js","sourceRoot":"","sources":["../src/bullmq-mikro-orm.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bullmq-mikro-orm.service.js","sourceRoot":"","sources":["../src/bullmq-mikro-orm.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAmB,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EACL,MAAM,EACN,UAAU,GAEX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAA2B,KAAK,EAAE,MAAM,QAAQ,CAAC;AAExD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAG/E,OAAO,EAAE,gCAAgC,EAAE,MAAM,wDAAwD,CAAC;AAC1G,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAGnE,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAOb;IACA;IAEA;IATF,MAAM,GAAW,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IAE1C,aAAa,GAAa,EAAE,CAAC;IAC7B,aAAa,GAAa,EAAE,CAAC;IAE9C,YACmB,gBAAkC,EAClC,EAAiB,EAEjB,OAAoC;QAHpC,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AAI,CAAC,WAAW,CAAC;;;;6DAOjB;AAlEU,qBAAqB;IADjC,UAAU,EAAE;IAUR,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;qCAFM,gBAAgB;QAC9B,aAAa;GARzB,qBAAqB,CAmHjC"}
|
|
@@ -1,37 +1,17 @@
|
|
|
1
|
-
import { Opt } from "@mikro-orm/core";
|
|
2
|
-
import { JobProgress } from "bullmq";
|
|
3
|
-
/**
|
|
4
|
-
* Abstract base entity for persisting BullMQ job data in the database.
|
|
5
|
-
*
|
|
6
|
-
* @remarks
|
|
7
|
-
* Extend this entity in your application to create a concrete job table.
|
|
8
|
-
* Automatically populated by the BullMQ-MikroORM subscriber.
|
|
9
|
-
*/
|
|
1
|
+
import { type Opt } from "@mikro-orm/core";
|
|
2
|
+
import { type JobProgress } from "bullmq";
|
|
10
3
|
export declare abstract class JobEntity {
|
|
11
|
-
/** BullMQ job identifier. */
|
|
12
4
|
id: string;
|
|
13
|
-
/** Name of the BullMQ queue this job belongs to. */
|
|
14
5
|
queueName: string;
|
|
15
|
-
/** Job name (type identifier). */
|
|
16
6
|
name: string;
|
|
17
|
-
/** JSON payload of the job. */
|
|
18
7
|
data: any;
|
|
19
|
-
/** Return value from the job processor, if completed. */
|
|
20
8
|
returnValue?: any;
|
|
21
|
-
/** Error message if the job failed. */
|
|
22
9
|
failedReason?: string;
|
|
23
|
-
/** Job priority (lower values = higher priority). */
|
|
24
10
|
priority: number;
|
|
25
|
-
/** Current progress of the job (number or object). */
|
|
26
11
|
progress: Opt<JobProgress>;
|
|
27
|
-
/** Current status of the job. */
|
|
28
12
|
status: string;
|
|
29
|
-
/** Timestamp when the job started processing. */
|
|
30
13
|
startedAt?: Date;
|
|
31
|
-
/** Timestamp when the job finished processing. */
|
|
32
14
|
finishedAt?: Date;
|
|
33
|
-
/** Timestamp when the job was created. */
|
|
34
15
|
createdAt: Opt<Date>;
|
|
35
|
-
/** Timestamp of the last update. */
|
|
36
16
|
updatedAt: Opt<Date>;
|
|
37
17
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,87 +7,86 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const job_status_enum_1 = require("../enums/job-status.enum");
|
|
15
|
-
/**
|
|
16
|
-
* Abstract base entity for persisting BullMQ job data in the database.
|
|
17
|
-
*
|
|
18
|
-
* @remarks
|
|
19
|
-
* Extend this entity in your application to create a concrete job table.
|
|
20
|
-
* Automatically populated by the BullMQ-MikroORM subscriber.
|
|
21
|
-
*/
|
|
10
|
+
import { t } from "@mikro-orm/core";
|
|
11
|
+
import { Entity, Enum, Index, PrimaryKey, Property, } from "@mikro-orm/decorators/legacy";
|
|
12
|
+
import { JobStatus } from "../enums/job-status.enum.js";
|
|
22
13
|
let JobEntity = class JobEntity {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
14
|
+
id;
|
|
15
|
+
queueName;
|
|
16
|
+
name;
|
|
17
|
+
data;
|
|
18
|
+
returnValue;
|
|
19
|
+
failedReason;
|
|
20
|
+
priority;
|
|
21
|
+
progress;
|
|
22
|
+
status;
|
|
23
|
+
startedAt;
|
|
24
|
+
finishedAt;
|
|
25
|
+
createdAt = new Date();
|
|
26
|
+
updatedAt = new Date();
|
|
29
27
|
};
|
|
30
|
-
exports.JobEntity = JobEntity;
|
|
31
28
|
__decorate([
|
|
32
|
-
|
|
29
|
+
PrimaryKey({ type: t.string }),
|
|
33
30
|
__metadata("design:type", String)
|
|
34
31
|
], JobEntity.prototype, "id", void 0);
|
|
35
32
|
__decorate([
|
|
36
|
-
|
|
33
|
+
Property({ type: t.string }),
|
|
37
34
|
__metadata("design:type", String)
|
|
38
35
|
], JobEntity.prototype, "queueName", void 0);
|
|
39
36
|
__decorate([
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
Index(),
|
|
38
|
+
Property({ type: t.string }),
|
|
42
39
|
__metadata("design:type", String)
|
|
43
40
|
], JobEntity.prototype, "name", void 0);
|
|
44
41
|
__decorate([
|
|
45
|
-
|
|
42
|
+
Property({ type: t.json }),
|
|
46
43
|
__metadata("design:type", Object)
|
|
47
44
|
], JobEntity.prototype, "data", void 0);
|
|
48
45
|
__decorate([
|
|
49
|
-
|
|
46
|
+
Property({ type: t.json, nullable: true }),
|
|
50
47
|
__metadata("design:type", Object)
|
|
51
48
|
], JobEntity.prototype, "returnValue", void 0);
|
|
52
49
|
__decorate([
|
|
53
|
-
|
|
50
|
+
Property({ type: t.string, nullable: true }),
|
|
54
51
|
__metadata("design:type", String)
|
|
55
52
|
], JobEntity.prototype, "failedReason", void 0);
|
|
56
53
|
__decorate([
|
|
57
|
-
|
|
54
|
+
Property({ type: t.integer }),
|
|
58
55
|
__metadata("design:type", Number)
|
|
59
56
|
], JobEntity.prototype, "priority", void 0);
|
|
60
57
|
__decorate([
|
|
61
|
-
|
|
58
|
+
Property({ type: t.json }),
|
|
62
59
|
__metadata("design:type", Object)
|
|
63
60
|
], JobEntity.prototype, "progress", void 0);
|
|
64
61
|
__decorate([
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
Index(),
|
|
63
|
+
Enum({ items: () => JobStatus }),
|
|
67
64
|
__metadata("design:type", String)
|
|
68
65
|
], JobEntity.prototype, "status", void 0);
|
|
69
66
|
__decorate([
|
|
70
|
-
|
|
67
|
+
Property({ type: t.datetime, nullable: true }),
|
|
71
68
|
__metadata("design:type", Date)
|
|
72
69
|
], JobEntity.prototype, "startedAt", void 0);
|
|
73
70
|
__decorate([
|
|
74
|
-
|
|
71
|
+
Property({ type: t.datetime, nullable: true }),
|
|
75
72
|
__metadata("design:type", Date)
|
|
76
73
|
], JobEntity.prototype, "finishedAt", void 0);
|
|
77
74
|
__decorate([
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
Index(),
|
|
76
|
+
Property({ type: t.datetime, defaultRaw: "now()" }),
|
|
80
77
|
__metadata("design:type", Object)
|
|
81
78
|
], JobEntity.prototype, "createdAt", void 0);
|
|
82
79
|
__decorate([
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
type:
|
|
80
|
+
Index(),
|
|
81
|
+
Property({
|
|
82
|
+
type: t.datetime,
|
|
86
83
|
defaultRaw: "now()",
|
|
87
84
|
onUpdate: () => new Date(),
|
|
88
85
|
}),
|
|
89
86
|
__metadata("design:type", Object)
|
|
90
87
|
], JobEntity.prototype, "updatedAt", void 0);
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
JobEntity = __decorate([
|
|
89
|
+
Entity({ abstract: true })
|
|
93
90
|
], JobEntity);
|
|
91
|
+
export { JobEntity };
|
|
94
92
|
//# sourceMappingURL=job.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job.entity.js","sourceRoot":"","sources":["../../src/entities/job.entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"job.entity.js","sourceRoot":"","sources":["../../src/entities/job.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAY,CAAC,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EACL,MAAM,EACN,IAAI,EACJ,KAAK,EACL,UAAU,EACV,QAAQ,GACT,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAUjD,IAAe,SAAS,GAAxB,MAAe,SA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8BACnC,IAAI;4CAAC;AAIjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAClC,IAAI;6CAAC;AAKlB;IAFC,KAAK,EAAE;IACP,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;;4CAClB;AASlC;IANC,KAAK,EAAE;IACP,QAAQ,CAAC;QACR,IAAI,EAAE,CAAC,CAAC,QAAQ;QAChB,UAAU,EAAE,OAAO;QACnB,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;KAC3B,CAAC;;4CACgC;AA5Dd,SAAS;IAD9B,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;GACL,SAAS,CA6D9B"}
|
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
/** Enumeration of possible BullMQ job statuses persisted in the database. */
|
|
2
1
|
export declare enum JobStatus {
|
|
3
|
-
/** Job is actively being processed. */
|
|
4
2
|
ACTIVE = "active",
|
|
5
|
-
/** Job has completed successfully. */
|
|
6
3
|
COMPLETED = "completed",
|
|
7
|
-
/** Job is delayed and will be processed later. */
|
|
8
4
|
DELAYED = "delayed",
|
|
9
|
-
/** Job has failed after exhausting all retry attempts. */
|
|
10
5
|
FAILED = "failed",
|
|
11
|
-
/** Job is waiting in the prioritized queue. */
|
|
12
6
|
PRIORITIZED = "prioritized",
|
|
13
|
-
/** Job status is unknown. */
|
|
14
7
|
UNKNOWN = "unknown",
|
|
15
|
-
/** Job is waiting in the queue to be processed. */
|
|
16
8
|
WAITING = "waiting",
|
|
17
|
-
/** Job is waiting for its child jobs to complete. */
|
|
18
9
|
WAITING_CHILDREN = "waiting-children"
|
|
19
10
|
}
|
|
@@ -1,24 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JobStatus = void 0;
|
|
4
|
-
/** Enumeration of possible BullMQ job statuses persisted in the database. */
|
|
5
|
-
var JobStatus;
|
|
1
|
+
export var JobStatus;
|
|
6
2
|
(function (JobStatus) {
|
|
7
|
-
/** Job is actively being processed. */
|
|
8
3
|
JobStatus["ACTIVE"] = "active";
|
|
9
|
-
/** Job has completed successfully. */
|
|
10
4
|
JobStatus["COMPLETED"] = "completed";
|
|
11
|
-
/** Job is delayed and will be processed later. */
|
|
12
5
|
JobStatus["DELAYED"] = "delayed";
|
|
13
|
-
/** Job has failed after exhausting all retry attempts. */
|
|
14
6
|
JobStatus["FAILED"] = "failed";
|
|
15
|
-
/** Job is waiting in the prioritized queue. */
|
|
16
7
|
JobStatus["PRIORITIZED"] = "prioritized";
|
|
17
|
-
/** Job status is unknown. */
|
|
18
8
|
JobStatus["UNKNOWN"] = "unknown";
|
|
19
|
-
/** Job is waiting in the queue to be processed. */
|
|
20
9
|
JobStatus["WAITING"] = "waiting";
|
|
21
|
-
/** Job is waiting for its child jobs to complete. */
|
|
22
10
|
JobStatus["WAITING_CHILDREN"] = "waiting-children";
|
|
23
|
-
})(JobStatus || (
|
|
11
|
+
})(JobStatus || (JobStatus = {}));
|
|
24
12
|
//# sourceMappingURL=job-status.enum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job-status.enum.js","sourceRoot":"","sources":["../../src/enums/job-status.enum.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"job-status.enum.js","sourceRoot":"","sources":["../../src/enums/job-status.enum.ts"],"names":[],"mappings":"AACA,MAAM,CAAN,IAAY,SAiBX;AAjBD,WAAY,SAAS;IAEnB,8BAAiB,CAAA;IAEjB,oCAAuB,CAAA;IAEvB,gCAAmB,CAAA;IAEnB,8BAAiB,CAAA;IAEjB,wCAA2B,CAAA;IAE3B,gCAAmB,CAAA;IAEnB,gCAAmB,CAAA;IAEnB,kDAAqC,CAAA;AACvC,CAAC,EAjBW,SAAS,KAAT,SAAS,QAiBpB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./bullmq-mikro-orm.module";
|
|
2
|
-
export * from "./bullmq-mikro-orm-module-options.interface";
|
|
3
|
-
export * from "./entities/job.entity";
|
|
4
|
-
export * from "./enums/job-status.enum";
|
|
1
|
+
export * from "./bullmq-mikro-orm.module.js";
|
|
2
|
+
export * from "./bullmq-mikro-orm-module-options.interface.js";
|
|
3
|
+
export * from "./entities/job.entity.js";
|
|
4
|
+
export * from "./enums/job-status.enum.js";
|
package/dist/index.js
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./bullmq-mikro-orm.module"), exports);
|
|
18
|
-
__exportStar(require("./bullmq-mikro-orm-module-options.interface"), exports);
|
|
19
|
-
__exportStar(require("./entities/job.entity"), exports);
|
|
20
|
-
__exportStar(require("./enums/job-status.enum"), exports);
|
|
1
|
+
export * from "./bullmq-mikro-orm.module.js";
|
|
2
|
+
export * from "./bullmq-mikro-orm-module-options.interface.js";
|
|
3
|
+
export * from "./entities/job.entity.js";
|
|
4
|
+
export * from "./enums/job-status.enum.js";
|
|
21
5
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gDAAgD,CAAC;AAC/D,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC"}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import { JobState } from "bullmq";
|
|
2
|
-
import { JobStatus } from "../enums/job-status.enum";
|
|
3
|
-
/**
|
|
4
|
-
* Converts a BullMQ job state to the internal JobStatus enum.
|
|
5
|
-
* @param state - The BullMQ job state or "unknown".
|
|
6
|
-
* @returns The corresponding JobStatus enum value.
|
|
7
|
-
*/
|
|
2
|
+
import { JobStatus } from "../enums/job-status.enum.js";
|
|
8
3
|
export declare function convertBullmqJobStateToJobStatus(state: JobState | "unknown"): JobStatus;
|
|
@@ -1,30 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.convertBullmqJobStateToJobStatus = convertBullmqJobStateToJobStatus;
|
|
4
|
-
const job_status_enum_1 = require("../enums/job-status.enum");
|
|
5
|
-
/**
|
|
6
|
-
* Converts a BullMQ job state to the internal JobStatus enum.
|
|
7
|
-
* @param state - The BullMQ job state or "unknown".
|
|
8
|
-
* @returns The corresponding JobStatus enum value.
|
|
9
|
-
*/
|
|
10
|
-
function convertBullmqJobStateToJobStatus(state) {
|
|
1
|
+
import { JobStatus } from "../enums/job-status.enum.js";
|
|
2
|
+
export function convertBullmqJobStateToJobStatus(state) {
|
|
11
3
|
switch (state) {
|
|
12
4
|
case "active":
|
|
13
|
-
return
|
|
5
|
+
return JobStatus.ACTIVE;
|
|
14
6
|
case "completed":
|
|
15
|
-
return
|
|
7
|
+
return JobStatus.COMPLETED;
|
|
16
8
|
case "delayed":
|
|
17
|
-
return
|
|
9
|
+
return JobStatus.DELAYED;
|
|
18
10
|
case "failed":
|
|
19
|
-
return
|
|
11
|
+
return JobStatus.FAILED;
|
|
20
12
|
case "prioritized":
|
|
21
|
-
return
|
|
13
|
+
return JobStatus.PRIORITIZED;
|
|
22
14
|
case "waiting":
|
|
23
|
-
return
|
|
15
|
+
return JobStatus.WAITING;
|
|
24
16
|
case "waiting-children":
|
|
25
|
-
return
|
|
17
|
+
return JobStatus.WAITING_CHILDREN;
|
|
26
18
|
default:
|
|
27
|
-
return
|
|
19
|
+
return JobStatus.UNKNOWN;
|
|
28
20
|
}
|
|
29
21
|
}
|
|
30
22
|
//# sourceMappingURL=convert-bullmq-job-state-to-job-status.util.js.map
|