@vasrefil/api-toolkit 1.10.0 → 1.10.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/background-jobs/common.d.ts +0 -4
- package/dist/background-jobs/common.js +1 -6
- package/dist/background-jobs/queue.js +3 -3
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/index.js +1 -0
- package/dist/interfaces/job.interface.d.ts +10 -0
- package/dist/interfaces/job.interface.js +8 -0
- package/package.json +1 -1
|
@@ -3,14 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.BullmqClient =
|
|
6
|
+
exports.BullmqClient = void 0;
|
|
7
7
|
const ioredis_1 = __importDefault(require("ioredis"));
|
|
8
8
|
const env_1 = __importDefault(require("../env"));
|
|
9
|
-
var JOB;
|
|
10
|
-
(function (JOB) {
|
|
11
|
-
JOB["EMAIL"] = "EMAIL";
|
|
12
|
-
JOB["IN_APP_NOTIFICATION"] = "IN_APP_NOTIFICATION";
|
|
13
|
-
})(JOB || (exports.JOB = JOB = {}));
|
|
14
9
|
class BullmqClient_ {
|
|
15
10
|
constructor() {
|
|
16
11
|
this.init = () => {
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.InAppNotificationQueue = exports.EmailQueue = void 0;
|
|
7
7
|
const bullmq_1 = require("bullmq");
|
|
8
8
|
const common_1 = require("./common");
|
|
9
|
-
const common_2 = require("./common");
|
|
10
9
|
const env_1 = __importDefault(require("../env"));
|
|
10
|
+
const job_interface_1 = require("src/interfaces/job.interface");
|
|
11
11
|
const attempts = env_1.default.NODE_ENV === env_1.default.NODE_ENVS.PROD ? 10 : 1;
|
|
12
12
|
const removeOnComplete = {
|
|
13
13
|
age: (3600 * 24) * 3, // 3 days
|
|
@@ -23,7 +23,7 @@ const EmailQueue = () => {
|
|
|
23
23
|
backoff,
|
|
24
24
|
removeOnComplete
|
|
25
25
|
};
|
|
26
|
-
return new bullmq_1.Queue(
|
|
26
|
+
return new bullmq_1.Queue(job_interface_1.JOB.EMAIL, { connection, defaultJobOptions });
|
|
27
27
|
};
|
|
28
28
|
exports.EmailQueue = EmailQueue;
|
|
29
29
|
const InAppNotificationQueue = () => {
|
|
@@ -34,6 +34,6 @@ const InAppNotificationQueue = () => {
|
|
|
34
34
|
removeOnComplete,
|
|
35
35
|
removeOnFail: removeOnComplete
|
|
36
36
|
};
|
|
37
|
-
return new bullmq_1.Queue(
|
|
37
|
+
return new bullmq_1.Queue(job_interface_1.JOB.IN_APP_NOTIFICATION, { connection, defaultJobOptions });
|
|
38
38
|
};
|
|
39
39
|
exports.InAppNotificationQueue = InAppNotificationQueue;
|
package/dist/interfaces/index.js
CHANGED
|
@@ -21,3 +21,4 @@ __exportStar(require("./interface"), exports);
|
|
|
21
21
|
__exportStar(require("./env.interface"), exports);
|
|
22
22
|
__exportStar(require("./transaction.interface"), exports);
|
|
23
23
|
__exportStar(require("./voucher.interface"), exports);
|
|
24
|
+
__exportStar(require("./job.interface"), exports);
|