easywork-common-lib 1.0.111 → 1.0.113
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/common/dtos/send-notification.dto.d.ts +4 -2
- package/dist/common/dtos/send-notification.dto.js +14 -4
- package/dist/common/dtos/send-notification.dto.js.map +1 -1
- package/dist/common/enums/notification.enum.d.ts +11 -0
- package/dist/common/enums/notification.enum.js +13 -1
- package/dist/common/enums/notification.enum.js.map +1 -1
- package/dist/entities/notifications/notification.entity.d.ts +4 -2
- package/dist/entities/notifications/notification.entity.js +17 -2
- package/dist/entities/notifications/notification.entity.js.map +1 -1
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { NotificationCategory, NotificationChannel } from "../../common";
|
|
1
|
+
import { NotificationCategory, NotificationChannel, NotificationSubcategory } from "../../common";
|
|
2
2
|
export declare class SendNotificationDto {
|
|
3
3
|
title: string;
|
|
4
4
|
recipientsId: string[];
|
|
5
|
+
entityId: string;
|
|
5
6
|
content: string;
|
|
6
|
-
|
|
7
|
+
channels: NotificationChannel[];
|
|
7
8
|
category?: NotificationCategory;
|
|
9
|
+
subCategory?: NotificationSubcategory;
|
|
8
10
|
}
|
|
@@ -15,9 +15,11 @@ const common_1 = require("../../common");
|
|
|
15
15
|
class SendNotificationDto {
|
|
16
16
|
title;
|
|
17
17
|
recipientsId;
|
|
18
|
+
entityId;
|
|
18
19
|
content;
|
|
19
|
-
|
|
20
|
+
channels;
|
|
20
21
|
category;
|
|
22
|
+
subCategory;
|
|
21
23
|
}
|
|
22
24
|
exports.SendNotificationDto = SendNotificationDto;
|
|
23
25
|
__decorate([
|
|
@@ -28,16 +30,24 @@ __decorate([
|
|
|
28
30
|
(0, class_validator_1.IsUUID)("all", { each: true }),
|
|
29
31
|
__metadata("design:type", Array)
|
|
30
32
|
], SendNotificationDto.prototype, "recipientsId", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsUUID)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], SendNotificationDto.prototype, "entityId", void 0);
|
|
31
37
|
__decorate([
|
|
32
38
|
(0, class_validator_1.IsString)(),
|
|
33
39
|
__metadata("design:type", String)
|
|
34
40
|
], SendNotificationDto.prototype, "content", void 0);
|
|
35
41
|
__decorate([
|
|
36
|
-
(0, class_validator_1.IsEnum)(common_1.NotificationChannel),
|
|
37
|
-
__metadata("design:type",
|
|
38
|
-
], SendNotificationDto.prototype, "
|
|
42
|
+
(0, class_validator_1.IsEnum)(common_1.NotificationChannel, { each: true }),
|
|
43
|
+
__metadata("design:type", Array)
|
|
44
|
+
], SendNotificationDto.prototype, "channels", void 0);
|
|
39
45
|
__decorate([
|
|
40
46
|
(0, class_validator_1.IsEnum)(common_1.NotificationCategory),
|
|
41
47
|
__metadata("design:type", String)
|
|
42
48
|
], SendNotificationDto.prototype, "category", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, class_validator_1.IsEnum)(common_1.NotificationSubcategory),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], SendNotificationDto.prototype, "subCategory", void 0);
|
|
43
53
|
//# sourceMappingURL=send-notification.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send-notification.dto.js","sourceRoot":"","sources":["../../../src/common/dtos/send-notification.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA2D;AAC3D,
|
|
1
|
+
{"version":3,"file":"send-notification.dto.js","sourceRoot":"","sources":["../../../src/common/dtos/send-notification.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA2D;AAC3D,yCAAkG;AAElG,MAAa,mBAAmB;IAE5B,KAAK,CAAS;IAGd,YAAY,CAAW;IAGvB,QAAQ,CAAS;IAGjB,OAAO,CAAS;IAGhB,QAAQ,CAAwB;IAGhC,QAAQ,CAAwB;IAGhC,WAAW,CAA2B;CACzC;AArBD,kDAqBC;AAnBG;IADC,IAAA,0BAAQ,GAAE;;kDACG;AAGd;IADC,IAAA,wBAAM,EAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;yDACP;AAGvB;IADC,IAAA,wBAAM,GAAE;;qDACQ;AAGjB;IADC,IAAA,0BAAQ,GAAE;;oDACK;AAGhB;IADC,IAAA,wBAAM,EAAC,4BAAmB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;qDACZ;AAGhC;IADC,IAAA,wBAAM,EAAC,6BAAoB,CAAC;;qDACG;AAGhC;IADC,IAAA,wBAAM,EAAC,gCAAuB,CAAC;;wDACM"}
|
|
@@ -4,6 +4,17 @@ export declare enum NotificationChannel {
|
|
|
4
4
|
PUSH = "push",
|
|
5
5
|
APP = "app"
|
|
6
6
|
}
|
|
7
|
+
export declare enum NotificationSubcategory {
|
|
8
|
+
NEW_TASK = "new-task",
|
|
9
|
+
TASK_COMPLETED = "task-complete",
|
|
10
|
+
TASK_OVERDUE = "task-overdue",
|
|
11
|
+
TASK_REMINDER = "task-reminder",
|
|
12
|
+
TASK_NEW_COMMNET = "task-new-comment",
|
|
13
|
+
TASK_APPROVED = "task-approved",
|
|
14
|
+
TASK_REJECTED = "task-rejected",
|
|
15
|
+
TASK_UPDATED = "task-updated",
|
|
16
|
+
DEFAULT = "default"
|
|
17
|
+
}
|
|
7
18
|
export declare enum NotificationCategory {
|
|
8
19
|
TASK = "task",
|
|
9
20
|
CRM = "crm",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NotificationCategory = exports.NotificationChannel = void 0;
|
|
3
|
+
exports.NotificationCategory = exports.NotificationSubcategory = exports.NotificationChannel = void 0;
|
|
4
4
|
var NotificationChannel;
|
|
5
5
|
(function (NotificationChannel) {
|
|
6
6
|
NotificationChannel["EMAIL"] = "email";
|
|
@@ -8,6 +8,18 @@ var NotificationChannel;
|
|
|
8
8
|
NotificationChannel["PUSH"] = "push";
|
|
9
9
|
NotificationChannel["APP"] = "app";
|
|
10
10
|
})(NotificationChannel || (exports.NotificationChannel = NotificationChannel = {}));
|
|
11
|
+
var NotificationSubcategory;
|
|
12
|
+
(function (NotificationSubcategory) {
|
|
13
|
+
NotificationSubcategory["NEW_TASK"] = "new-task";
|
|
14
|
+
NotificationSubcategory["TASK_COMPLETED"] = "task-complete";
|
|
15
|
+
NotificationSubcategory["TASK_OVERDUE"] = "task-overdue";
|
|
16
|
+
NotificationSubcategory["TASK_REMINDER"] = "task-reminder";
|
|
17
|
+
NotificationSubcategory["TASK_NEW_COMMNET"] = "task-new-comment";
|
|
18
|
+
NotificationSubcategory["TASK_APPROVED"] = "task-approved";
|
|
19
|
+
NotificationSubcategory["TASK_REJECTED"] = "task-rejected";
|
|
20
|
+
NotificationSubcategory["TASK_UPDATED"] = "task-updated";
|
|
21
|
+
NotificationSubcategory["DEFAULT"] = "default";
|
|
22
|
+
})(NotificationSubcategory || (exports.NotificationSubcategory = NotificationSubcategory = {}));
|
|
11
23
|
var NotificationCategory;
|
|
12
24
|
(function (NotificationCategory) {
|
|
13
25
|
NotificationCategory["TASK"] = "task";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.enum.js","sourceRoot":"","sources":["../../../src/common/enums/notification.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC3B,sCAAe,CAAA;IACf,kCAAW,CAAA;IACX,oCAAa,CAAA;IACb,kCAAW,CAAA;AACf,CAAC,EALW,mBAAmB,mCAAnB,mBAAmB,QAK9B;AAED,IAAY,oBAUX;AAVD,WAAY,oBAAoB;IAC5B,qCAAa,CAAA;IACb,mCAAW,CAAA;IACX,uCAAe,CAAA;IACf,uCAAe,CAAA;IACf,uCAAe,CAAA;IACf,6CAAqB,CAAA;IACrB,uCAAe,CAAA;IACf,qCAAa,CAAA;IACb,2CAAmB,CAAA;AACvB,CAAC,EAVW,oBAAoB,oCAApB,oBAAoB,QAU/B"}
|
|
1
|
+
{"version":3,"file":"notification.enum.js","sourceRoot":"","sources":["../../../src/common/enums/notification.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC3B,sCAAe,CAAA;IACf,kCAAW,CAAA;IACX,oCAAa,CAAA;IACb,kCAAW,CAAA;AACf,CAAC,EALW,mBAAmB,mCAAnB,mBAAmB,QAK9B;AAED,IAAY,uBAUX;AAVD,WAAY,uBAAuB;IAC/B,gDAAqB,CAAA;IACrB,2DAAgC,CAAA;IAChC,wDAA6B,CAAA;IAC7B,0DAA+B,CAAA;IAC/B,gEAAqC,CAAA;IACrC,0DAA+B,CAAA;IAC/B,0DAA+B,CAAA;IAC/B,wDAA6B,CAAA;IAC7B,8CAAmB,CAAA;AACvB,CAAC,EAVW,uBAAuB,uCAAvB,uBAAuB,QAUlC;AAED,IAAY,oBAUX;AAVD,WAAY,oBAAoB;IAC5B,qCAAa,CAAA;IACb,mCAAW,CAAA;IACX,uCAAe,CAAA;IACf,uCAAe,CAAA;IACf,uCAAe,CAAA;IACf,6CAAqB,CAAA;IACrB,uCAAe,CAAA;IACf,qCAAa,CAAA;IACb,2CAAmB,CAAA;AACvB,CAAC,EAVW,oBAAoB,oCAApB,oBAAoB,QAU/B"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { User } from "../user.entity";
|
|
2
|
-
import { BaseEntitySimple, NotificationCategory, NotificationChannel } from "../../common";
|
|
2
|
+
import { BaseEntitySimple, NotificationCategory, NotificationChannel, NotificationSubcategory } from "../../common";
|
|
3
3
|
export declare class Notification extends BaseEntitySimple {
|
|
4
4
|
content: string;
|
|
5
5
|
title: string;
|
|
6
6
|
category: NotificationCategory;
|
|
7
|
-
|
|
7
|
+
subCategory: NotificationSubcategory;
|
|
8
|
+
channels: NotificationChannel[];
|
|
9
|
+
entityId: string;
|
|
8
10
|
readAt: Date;
|
|
9
11
|
canceledAt: Date;
|
|
10
12
|
recipient?: User;
|
|
@@ -17,7 +17,9 @@ let Notification = class Notification extends common_1.BaseEntitySimple {
|
|
|
17
17
|
content;
|
|
18
18
|
title;
|
|
19
19
|
category;
|
|
20
|
-
|
|
20
|
+
subCategory;
|
|
21
|
+
channels;
|
|
22
|
+
entityId;
|
|
21
23
|
readAt;
|
|
22
24
|
canceledAt;
|
|
23
25
|
recipient;
|
|
@@ -39,13 +41,26 @@ __decorate([
|
|
|
39
41
|
}),
|
|
40
42
|
__metadata("design:type", String)
|
|
41
43
|
], Notification.prototype, "category", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({
|
|
46
|
+
type: "enum",
|
|
47
|
+
enum: common_1.NotificationSubcategory,
|
|
48
|
+
default: common_1.NotificationSubcategory.DEFAULT
|
|
49
|
+
}),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], Notification.prototype, "subCategory", void 0);
|
|
42
52
|
__decorate([
|
|
43
53
|
(0, typeorm_1.Column)({
|
|
44
54
|
type: "enum",
|
|
45
55
|
enum: common_1.NotificationChannel,
|
|
56
|
+
array: true,
|
|
46
57
|
}),
|
|
58
|
+
__metadata("design:type", Array)
|
|
59
|
+
], Notification.prototype, "channels", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
47
62
|
__metadata("design:type", String)
|
|
48
|
-
], Notification.prototype, "
|
|
63
|
+
], Notification.prototype, "entityId", void 0);
|
|
49
64
|
__decorate([
|
|
50
65
|
(0, typeorm_1.Column)({ type: "timestamp", nullable: true }),
|
|
51
66
|
__metadata("design:type", Date)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.entity.js","sourceRoot":"","sources":["../../../src/entities/notifications/notification.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAAsC;AACtC,
|
|
1
|
+
{"version":3,"file":"notification.entity.js","sourceRoot":"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