sea-backend-helpers 1.5.1 → 1.5.2
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/constants/index.d.ts +2 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +37 -0
- package/dist/constants/queue/index.d.ts +6 -0
- package/dist/constants/queue/index.d.ts.map +1 -0
- package/dist/constants/queue/index.js +9 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +5 -0
- package/dist/services/queue.service.d.ts +8 -0
- package/dist/services/queue.service.d.ts.map +1 -0
- package/dist/services/queue.service.js +45 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +38 -0
- package/dist/types/notification/index.d.ts +34 -0
- package/dist/types/notification/index.d.ts.map +1 -0
- package/dist/types/notification/index.js +3 -0
- package/dist/types/queue/dto.d.ts +19 -0
- package/dist/types/queue/dto.d.ts.map +1 -0
- package/dist/types/queue/dto.js +2 -0
- package/dist/types/queue/index.d.ts +23 -0
- package/dist/types/queue/index.d.ts.map +1 -0
- package/dist/types/queue/index.js +3 -0
- package/package.json +5 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Queue = void 0;
|
|
37
|
+
exports.Queue = __importStar(require("./queue"));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/queue/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,WAAW,CAAC;AAE7B,oBAAY,QAAQ;IAClB,YAAY,iBAAiB;IAC7B,KAAK,UAAU;CAChB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Messages = exports.Name = void 0;
|
|
4
|
+
exports.Name = "alerts";
|
|
5
|
+
var Messages;
|
|
6
|
+
(function (Messages) {
|
|
7
|
+
Messages["Notification"] = "Notification";
|
|
8
|
+
Messages["Email"] = "Email";
|
|
9
|
+
})(Messages || (exports.Messages = Messages = {}));
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export * as Utils from "./utils";
|
|
2
2
|
export * as Decorators from "./decorators";
|
|
3
3
|
export * as Validators from "./validators";
|
|
4
|
+
export * as Constants from "./constants";
|
|
5
|
+
export * as Types from "./types";
|
|
6
|
+
export * as Services from "./services";
|
|
4
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAGjC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAG3C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAGjC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAG3C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAG3C,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAGzC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAGjC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -33,10 +33,16 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.Validators = exports.Decorators = exports.Utils = void 0;
|
|
36
|
+
exports.Services = exports.Types = exports.Constants = exports.Validators = exports.Decorators = exports.Utils = void 0;
|
|
37
37
|
// Utils
|
|
38
38
|
exports.Utils = __importStar(require("./utils"));
|
|
39
39
|
// Decorators
|
|
40
40
|
exports.Decorators = __importStar(require("./decorators"));
|
|
41
41
|
// Validators
|
|
42
42
|
exports.Validators = __importStar(require("./validators"));
|
|
43
|
+
// Constants
|
|
44
|
+
exports.Constants = __importStar(require("./constants"));
|
|
45
|
+
// Types
|
|
46
|
+
exports.Types = __importStar(require("./types"));
|
|
47
|
+
// Services
|
|
48
|
+
exports.Services = __importStar(require("./services"));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QueueService = void 0;
|
|
4
|
+
var queue_service_1 = require("./queue.service");
|
|
5
|
+
Object.defineProperty(exports, "QueueService", { enumerable: true, get: function () { return queue_service_1.QueueService; } });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { JobsOptions, Queue } from "bullmq";
|
|
2
|
+
import { Types } from "../";
|
|
3
|
+
export declare class QueueService {
|
|
4
|
+
private readonly jobQueue;
|
|
5
|
+
constructor(jobQueue: Queue);
|
|
6
|
+
addJob<N extends keyof Types.Queue.MessageJobMap, T extends keyof Types.Queue.MessageJobMap[N]>(name: N, type: T, data: Types.Queue.MessageJobMap[N][T], options?: JobsOptions): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=queue.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue.service.d.ts","sourceRoot":"","sources":["../../src/services/queue.service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAa,KAAK,EAAE,MAAM,KAAK,CAAC;AAEvC,qBACa,YAAY;IAEc,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,KAAK;IAG/D,MAAM,CACV,CAAC,SAAS,MAAM,KAAK,CAAC,KAAK,CAAC,aAAa,EACzC,CAAC,SAAS,MAAM,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EAE5C,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EACrC,OAAO,CAAC,EAAE,WAAW;CAIxB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.QueueService = void 0;
|
|
25
|
+
// libs/shared/queue/queue.service.ts
|
|
26
|
+
const common_1 = require("@nestjs/common");
|
|
27
|
+
const bullmq_1 = require("@nestjs/bullmq");
|
|
28
|
+
const bullmq_2 = require("bullmq");
|
|
29
|
+
const __1 = require("../");
|
|
30
|
+
let QueueService = class QueueService {
|
|
31
|
+
constructor(jobQueue) {
|
|
32
|
+
this.jobQueue = jobQueue;
|
|
33
|
+
}
|
|
34
|
+
addJob(name, type, data, options) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
yield this.jobQueue.add(`${String(name)}:${String(type)}`, data, options);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.QueueService = QueueService;
|
|
41
|
+
exports.QueueService = QueueService = __decorate([
|
|
42
|
+
(0, common_1.Injectable)(),
|
|
43
|
+
__param(0, (0, bullmq_1.InjectQueue)(__1.Constants.Queue.Name)),
|
|
44
|
+
__metadata("design:paramtypes", [bullmq_2.Queue])
|
|
45
|
+
], QueueService);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Notification = exports.Queue = void 0;
|
|
37
|
+
exports.Queue = __importStar(require("./queue"));
|
|
38
|
+
exports.Notification = __importStar(require("./notification"));
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DTO, CONSTANTS } from "sea-platform-helpers";
|
|
2
|
+
export interface TaskAssignedToYouMetadata {
|
|
3
|
+
taskId: string;
|
|
4
|
+
}
|
|
5
|
+
export interface TaskUnassignedFromYouMetadata {
|
|
6
|
+
taskId: string;
|
|
7
|
+
}
|
|
8
|
+
export interface NewCommentAddedMetadata {
|
|
9
|
+
commentId: string;
|
|
10
|
+
objectId: string;
|
|
11
|
+
model: DTO.Comment.CommentSupportedModels;
|
|
12
|
+
addedById: string;
|
|
13
|
+
}
|
|
14
|
+
export interface NewEventShownToEndUserMetadata {
|
|
15
|
+
eventId: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Map each Notification type to its metadata type
|
|
19
|
+
*/
|
|
20
|
+
export type NotificationMetadataMap = {
|
|
21
|
+
[CONSTANTS.Notification.NotificationTypes
|
|
22
|
+
.TaskAssignedToYou]: TaskAssignedToYouMetadata;
|
|
23
|
+
[CONSTANTS.Notification.NotificationTypes
|
|
24
|
+
.TaskUnassignedFromYou]: TaskUnassignedFromYouMetadata;
|
|
25
|
+
[CONSTANTS.Notification.NotificationTypes
|
|
26
|
+
.NewCommentAdded]: NewCommentAddedMetadata;
|
|
27
|
+
[CONSTANTS.Notification.NotificationTypes
|
|
28
|
+
.NewEventShownToEndUser]: NewEventShownToEndUserMetadata;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Generic Metadata type resolver
|
|
32
|
+
*/
|
|
33
|
+
export type NotificationMetadata<T extends CONSTANTS.Notification.NotificationTypes> = NotificationMetadataMap[T];
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/notification/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,sBAAsB,CAAC;IAC1C,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,CAAC,SAAS,CAAC,YAAY,CAAC,iBAAiB;SACtC,iBAAiB,CAAC,EAAE,yBAAyB,CAAC;IACjD,CAAC,SAAS,CAAC,YAAY,CAAC,iBAAiB;SACtC,qBAAqB,CAAC,EAAE,6BAA6B,CAAC;IACzD,CAAC,SAAS,CAAC,YAAY,CAAC,iBAAiB;SACtC,eAAe,CAAC,EAAE,uBAAuB,CAAC;IAC7C,CAAC,SAAS,CAAC,YAAY,CAAC,iBAAiB;SACtC,sBAAsB,CAAC,EAAE,8BAA8B,CAAC;CAC5D,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,CAC9B,CAAC,SAAS,SAAS,CAAC,YAAY,CAAC,iBAAiB,IAChD,uBAAuB,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CONSTANTS } from "sea-platform-helpers";
|
|
2
|
+
import { NotificationMetadata } from "../notification";
|
|
3
|
+
interface IBaseNotification {
|
|
4
|
+
applicationKey: CONSTANTS.Application.ApplicationKeys;
|
|
5
|
+
}
|
|
6
|
+
export interface ITaskAssignedToYou<T extends CONSTANTS.Notification.NotificationTypes = CONSTANTS.Notification.NotificationTypes> extends IBaseNotification {
|
|
7
|
+
accountId: string;
|
|
8
|
+
metadata: NotificationMetadata<T>;
|
|
9
|
+
}
|
|
10
|
+
export interface ITaskUnAssignedFromYou<T extends CONSTANTS.Notification.NotificationTypes = CONSTANTS.Notification.NotificationTypes> extends IBaseNotification {
|
|
11
|
+
accountId: string;
|
|
12
|
+
metadata: NotificationMetadata<T>;
|
|
13
|
+
}
|
|
14
|
+
export interface INewCommentAdded<T extends CONSTANTS.Notification.NotificationTypes = CONSTANTS.Notification.NotificationTypes> extends IBaseNotification {
|
|
15
|
+
accountId: string;
|
|
16
|
+
metadata: NotificationMetadata<T>;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dto.d.ts","sourceRoot":"","sources":["../../../src/types/queue/dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,UAAU,iBAAiB;IACzB,cAAc,EAAE,SAAS,CAAC,WAAW,CAAC,eAAe,CAAC;CACvD;AAED,MAAM,WAAW,kBAAkB,CACjC,CAAC,SAAS,SAAS,CAAC,YAAY,CAAC,iBAAiB,GAAG,SAAS,CAAC,YAAY,CAAC,iBAAiB,CAC7F,SAAQ,iBAAiB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,sBAAsB,CACrC,CAAC,SAAS,SAAS,CAAC,YAAY,CAAC,iBAAiB,GAAG,SAAS,CAAC,YAAY,CAAC,iBAAiB,CAC7F,SAAQ,iBAAiB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,gBAAgB,CAC/B,CAAC,SAAS,SAAS,CAAC,YAAY,CAAC,iBAAiB,GAAG,SAAS,CAAC,YAAY,CAAC,iBAAiB,CAC7F,SAAQ,iBAAiB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;CACnC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Messages } from "../../constants/queue";
|
|
2
|
+
import * as DTO from "./dto";
|
|
3
|
+
export type NotificationJobTypes = {
|
|
4
|
+
TaskAssignedToYou: DTO.ITaskAssignedToYou;
|
|
5
|
+
TaskUnAssignedFromYou: DTO.ITaskUnAssignedFromYou;
|
|
6
|
+
NewCommentAdded: DTO.INewCommentAdded;
|
|
7
|
+
};
|
|
8
|
+
export type EmailJobTypes = {};
|
|
9
|
+
export type MessageJobMap = {
|
|
10
|
+
[Messages.Notification]: NotificationJobTypes;
|
|
11
|
+
[Messages.Email]: EmailJobTypes;
|
|
12
|
+
};
|
|
13
|
+
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
14
|
+
type FlattenJobMap<T> = {
|
|
15
|
+
[K in keyof T]: {
|
|
16
|
+
[P in keyof T[K] as `${K & string}:${P & string}`]: T[K][P];
|
|
17
|
+
};
|
|
18
|
+
}[keyof T];
|
|
19
|
+
export type Jobs = UnionToIntersection<FlattenJobMap<MessageJobMap>>;
|
|
20
|
+
export type JobName = keyof Jobs;
|
|
21
|
+
export type JobPayload<Name extends JobName> = Jobs[Name];
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/queue/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAE7B,MAAM,MAAM,oBAAoB,GAAG;IACjC,iBAAiB,EAAE,GAAG,CAAC,kBAAkB,CAAC;IAC1C,qBAAqB,EAAE,GAAG,CAAC,sBAAsB,CAAC;IAClD,eAAe,EAAE,GAAG,CAAC,gBAAgB,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,EAAE,CAAC;AAE/B,MAAM,MAAM,aAAa,GAAG;IAC1B,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,oBAAoB,CAAC;IAC9C,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC;CACjC,CAAC;AAGF,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,GAAG,KAAK,CAAC,SAAS,CAC7E,CAAC,EAAE,MAAM,CAAC,KACP,IAAI,GACL,CAAC,GACD,KAAK,CAAC;AAGV,KAAK,aAAa,CAAC,CAAC,IAAI;KACrB,CAAC,IAAI,MAAM,CAAC,GAAG;SACb,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,MAAM,IAAI,CAAC,GAAG,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC5D;CACF,CAAC,MAAM,CAAC,CAAC,CAAC;AAGX,MAAM,MAAM,IAAI,GAAG,mBAAmB,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;AAGrE,MAAM,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC;AACjC,MAAM,MAAM,UAAU,CAAC,IAAI,SAAS,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sea-backend-helpers",
|
|
3
3
|
"description": "SEA Backend helpers library",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.2",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc --build",
|
|
@@ -20,21 +20,22 @@
|
|
|
20
20
|
"author": "",
|
|
21
21
|
"license": "ISC",
|
|
22
22
|
"dependencies": {
|
|
23
|
+
"@nestjs/bullmq": "^10.2.3",
|
|
23
24
|
"bcrypt": "^5.1.1",
|
|
25
|
+
"bullmq": "^5.56.8",
|
|
24
26
|
"class-transformer": "^0.5.1",
|
|
25
27
|
"class-validator": "^0.14.1",
|
|
26
28
|
"moment": "^2.30.1",
|
|
27
29
|
"reflect-metadata": "^0.1.13",
|
|
28
30
|
"rxjs": "^7.0.0",
|
|
29
31
|
"sea-backend-helpers": "file:",
|
|
30
|
-
"sea-platform-helpers": "^1.5.
|
|
32
|
+
"sea-platform-helpers": "^1.5.1"
|
|
31
33
|
},
|
|
32
34
|
"peerDependencies": {
|
|
33
35
|
"@nestjs/common": "^10.0.0",
|
|
34
36
|
"@nestjs/jwt": "^10.0.0"
|
|
35
37
|
},
|
|
36
38
|
"devDependencies": {
|
|
37
|
-
"@types/bcrypt": "^5.0.2"
|
|
38
|
-
"@types/numeral": "^2.0.5"
|
|
39
|
+
"@types/bcrypt": "^5.0.2"
|
|
39
40
|
}
|
|
40
41
|
}
|