easywork-common-lib 1.0.205 → 1.0.207
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 +1 -0
- package/dist/common/dtos/send-notification.dto.js +6 -0
- package/dist/common/dtos/send-notification.dto.js.map +1 -1
- package/dist/entities/notifications/notification.entity.js +27 -0
- package/dist/entities/notifications/notification.entity.js.map +1 -1
- package/package.json +2 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -20,6 +20,7 @@ class SendNotificationDto {
|
|
|
20
20
|
channels;
|
|
21
21
|
category;
|
|
22
22
|
subCategory;
|
|
23
|
+
metadata;
|
|
23
24
|
}
|
|
24
25
|
exports.SendNotificationDto = SendNotificationDto;
|
|
25
26
|
__decorate([
|
|
@@ -51,4 +52,9 @@ __decorate([
|
|
|
51
52
|
(0, class_validator_1.IsEnum)(enums_1.NotificationSubcategory),
|
|
52
53
|
__metadata("design:type", String)
|
|
53
54
|
], SendNotificationDto.prototype, "subCategory", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, class_validator_1.IsOptional)(),
|
|
57
|
+
(0, class_validator_1.IsObject)(),
|
|
58
|
+
__metadata("design:type", Object)
|
|
59
|
+
], SendNotificationDto.prototype, "metadata", void 0);
|
|
54
60
|
//# 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,
|
|
1
|
+
{"version":3,"file":"send-notification.dto.js","sourceRoot":"","sources":["../../../src/common/dtos/send-notification.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAiF;AACjF,oCAA8F;AAE9F,MAAa,mBAAmB;IAE5B,KAAK,CAAS;IAGd,YAAY,CAAW;IAIvB,QAAQ,CAAU;IAGlB,OAAO,CAAS;IAGhB,QAAQ,CAAwB;IAGhC,QAAQ,CAAwB;IAGhC,WAAW,CAA2B;IAItC,QAAQ,CAAuB;CAClC;AA1BD,kDA0BC;AAxBG;IADC,IAAA,0BAAQ,GAAE;;kDACG;AAGd;IADC,IAAA,wBAAM,EAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;yDACP;AAIvB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;qDACS;AAGlB;IADC,IAAA,0BAAQ,GAAE;;oDACK;AAGhB;IADC,IAAA,wBAAM,EAAC,2BAAmB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;qDACZ;AAGhC;IADC,IAAA,wBAAM,EAAC,4BAAoB,CAAC;;qDACG;AAGhC;IADC,IAAA,wBAAM,EAAC,+BAAuB,CAAC;;wDACM;AAItC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;qDACoB"}
|
|
@@ -14,6 +14,7 @@ const user_entity_1 = require("../user.entity");
|
|
|
14
14
|
const common_1 = require("../../common");
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
16
|
const enums_1 = require("../../common/enums");
|
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
17
18
|
let Notification = class Notification extends common_1.BaseEntitySimple {
|
|
18
19
|
content;
|
|
19
20
|
title;
|
|
@@ -28,14 +29,21 @@ let Notification = class Notification extends common_1.BaseEntitySimple {
|
|
|
28
29
|
};
|
|
29
30
|
exports.Notification = Notification;
|
|
30
31
|
__decorate([
|
|
32
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'Content of the notification' }),
|
|
31
33
|
(0, typeorm_1.Column)({ type: "text" }),
|
|
32
34
|
__metadata("design:type", String)
|
|
33
35
|
], Notification.prototype, "content", void 0);
|
|
34
36
|
__decorate([
|
|
37
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'Title of the notification' }),
|
|
35
38
|
(0, typeorm_1.Column)({ nullable: false }),
|
|
36
39
|
__metadata("design:type", String)
|
|
37
40
|
], Notification.prototype, "title", void 0);
|
|
38
41
|
__decorate([
|
|
42
|
+
(0, swagger_1.ApiProperty)({
|
|
43
|
+
enum: enums_1.NotificationCategory,
|
|
44
|
+
description: 'Category of the notification',
|
|
45
|
+
default: enums_1.NotificationCategory.DEFAULT
|
|
46
|
+
}),
|
|
39
47
|
(0, typeorm_1.Column)({
|
|
40
48
|
type: "enum",
|
|
41
49
|
enum: enums_1.NotificationCategory,
|
|
@@ -44,6 +52,11 @@ __decorate([
|
|
|
44
52
|
__metadata("design:type", String)
|
|
45
53
|
], Notification.prototype, "category", void 0);
|
|
46
54
|
__decorate([
|
|
55
|
+
(0, swagger_1.ApiProperty)({
|
|
56
|
+
enum: enums_1.NotificationSubcategory,
|
|
57
|
+
description: 'Subcategory of the notification',
|
|
58
|
+
default: enums_1.NotificationSubcategory.DEFAULT
|
|
59
|
+
}),
|
|
47
60
|
(0, typeorm_1.Column)({
|
|
48
61
|
type: "enum",
|
|
49
62
|
enum: enums_1.NotificationSubcategory,
|
|
@@ -52,6 +65,11 @@ __decorate([
|
|
|
52
65
|
__metadata("design:type", String)
|
|
53
66
|
], Notification.prototype, "subCategory", void 0);
|
|
54
67
|
__decorate([
|
|
68
|
+
(0, swagger_1.ApiProperty)({
|
|
69
|
+
type: [String],
|
|
70
|
+
enum: enums_1.NotificationChannel,
|
|
71
|
+
description: 'Channels through which the notification is sent'
|
|
72
|
+
}),
|
|
55
73
|
(0, typeorm_1.Column)({
|
|
56
74
|
type: "enum",
|
|
57
75
|
enum: enums_1.NotificationChannel,
|
|
@@ -60,6 +78,11 @@ __decorate([
|
|
|
60
78
|
__metadata("design:type", Array)
|
|
61
79
|
], Notification.prototype, "channels", void 0);
|
|
62
80
|
__decorate([
|
|
81
|
+
(0, swagger_1.ApiProperty)({
|
|
82
|
+
type: Object,
|
|
83
|
+
description: 'Additional metadata for the notification',
|
|
84
|
+
required: false
|
|
85
|
+
}),
|
|
63
86
|
(0, typeorm_1.Column)({
|
|
64
87
|
type: "simple-json",
|
|
65
88
|
nullable: true
|
|
@@ -67,18 +90,22 @@ __decorate([
|
|
|
67
90
|
__metadata("design:type", Object)
|
|
68
91
|
], Notification.prototype, "metadata", void 0);
|
|
69
92
|
__decorate([
|
|
93
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'Associated entity ID', required: false }),
|
|
70
94
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
71
95
|
__metadata("design:type", String)
|
|
72
96
|
], Notification.prototype, "entityId", void 0);
|
|
73
97
|
__decorate([
|
|
98
|
+
(0, swagger_1.ApiProperty)({ type: Date, description: 'Timestamp when the notification was read', required: false }),
|
|
74
99
|
(0, typeorm_1.Column)({ type: "timestamp", nullable: true }),
|
|
75
100
|
__metadata("design:type", Date)
|
|
76
101
|
], Notification.prototype, "readAt", void 0);
|
|
77
102
|
__decorate([
|
|
103
|
+
(0, swagger_1.ApiProperty)({ type: Date, description: 'Timestamp when the notification was canceled', required: false }),
|
|
78
104
|
(0, typeorm_1.Column)({ type: "timestamp", nullable: true }),
|
|
79
105
|
__metadata("design:type", Date)
|
|
80
106
|
], Notification.prototype, "canceledAt", void 0);
|
|
81
107
|
__decorate([
|
|
108
|
+
(0, swagger_1.ApiProperty)({ type: () => user_entity_1.User, description: 'Recipient of the notification', required: false }),
|
|
82
109
|
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, {
|
|
83
110
|
onDelete: "SET NULL",
|
|
84
111
|
onUpdate: "CASCADE",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.entity.js","sourceRoot":"","sources":["../../../src/entities/notifications/notification.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAAsC;AACtC,yCAAgD;AAChD,qCAAoD;AACpD,8CAAwG;
|
|
1
|
+
{"version":3,"file":"notification.entity.js","sourceRoot":"","sources":["../../../src/entities/notifications/notification.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAAsC;A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IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE;QACnB,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,IAAI;KACjB,CAAC;8BACU,kBAAI;+CAAC;uBA1ER,YAAY;IADxB,IAAA,gBAAM,GAAE;GACI,YAAY,CA2ExB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easywork-common-lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.207",
|
|
4
4
|
"description": "Librería común de Easywork",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"homepage": "https://github.com/criptopreto/easywork-common-lib#readme",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@nestjs/common": "^10.3.8",
|
|
25
|
+
"@nestjs/swagger": "^7.4.0",
|
|
25
26
|
"@nestjs/typeorm": "^10.0.2",
|
|
26
27
|
"class-transformer": "^0.5.1",
|
|
27
28
|
"class-validator": "^0.14.1",
|