@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.
@@ -1,8 +1,4 @@
1
1
  import IORedis from 'ioredis';
2
- export declare enum JOB {
3
- EMAIL = "EMAIL",
4
- IN_APP_NOTIFICATION = "IN_APP_NOTIFICATION"
5
- }
6
2
  declare class BullmqClient_ {
7
3
  private connection;
8
4
  init: () => void;
@@ -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 = exports.JOB = void 0;
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(common_2.JOB.EMAIL, { connection, defaultJobOptions });
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(common_2.JOB.IN_APP_NOTIFICATION, { connection, defaultJobOptions });
37
+ return new bullmq_1.Queue(job_interface_1.JOB.IN_APP_NOTIFICATION, { connection, defaultJobOptions });
38
38
  };
39
39
  exports.InAppNotificationQueue = InAppNotificationQueue;
@@ -5,3 +5,4 @@ export * from './interface';
5
5
  export * from './env.interface';
6
6
  export * from './transaction.interface';
7
7
  export * from './voucher.interface';
8
+ export * from './job.interface';
@@ -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);
@@ -0,0 +1,10 @@
1
+ import { BulkJobOptions } from 'bullmq';
2
+ export interface JobI {
3
+ name: string;
4
+ data: any;
5
+ opts?: BulkJobOptions;
6
+ }
7
+ export declare enum JOB {
8
+ EMAIL = "EMAIL",
9
+ IN_APP_NOTIFICATION = "IN_APP_NOTIFICATION"
10
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JOB = void 0;
4
+ var JOB;
5
+ (function (JOB) {
6
+ JOB["EMAIL"] = "EMAIL";
7
+ JOB["IN_APP_NOTIFICATION"] = "IN_APP_NOTIFICATION";
8
+ })(JOB || (exports.JOB = JOB = {}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vasrefil/api-toolkit",
3
3
  "description": "This is Vasrefil API toolkit",
4
- "version": "1.10.0",
4
+ "version": "1.10.1",
5
5
  "author": "Sodiq Alabi",
6
6
  "main": "dist/public-api.js",
7
7
  "types": "dist/public-api.d.ts",