@flusys/nestjs-notification 7.1.0 → 8.0.0

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.
Files changed (103) hide show
  1. package/adapters/index.d.ts +1 -1
  2. package/adapters/notification.adapter.d.ts +2 -2
  3. package/config/index.d.ts +3 -3
  4. package/controllers/index.d.ts +1 -1
  5. package/controllers/notification.controller.d.ts +4 -4
  6. package/docs/index.d.ts +1 -1
  7. package/docs/notification-swagger.config.d.ts +2 -2
  8. package/dtos/index.d.ts +1 -1
  9. package/entities/index.d.ts +5 -5
  10. package/entities/notification-with-company.entity.d.ts +1 -1
  11. package/fesm/244.js +816 -0
  12. package/fesm/446.js +939 -0
  13. package/fesm/adapters/index.js +79 -1
  14. package/fesm/config/index.js +84 -3
  15. package/fesm/controllers/index.js +13 -1
  16. package/fesm/docs/index.js +112 -1
  17. package/fesm/dtos/index.js +311 -1
  18. package/fesm/entities/index.js +211 -8
  19. package/fesm/gateways/index.js +286 -1
  20. package/fesm/index.js +467 -10
  21. package/fesm/interfaces/index.js +16 -2
  22. package/fesm/modules/index.js +269 -1
  23. package/fesm/runtime.js +85 -0
  24. package/fesm/services/index.js +357 -4
  25. package/gateways/index.d.ts +1 -1
  26. package/gateways/notification.gateway.d.ts +2 -2
  27. package/index.d.ts +10 -10
  28. package/interfaces/index.d.ts +2 -2
  29. package/interfaces/notification-module.interface.d.ts +3 -3
  30. package/interfaces/notification.interface.d.ts +1 -1
  31. package/modules/index.d.ts +1 -1
  32. package/modules/notification.module.d.ts +2 -2
  33. package/package.json +33 -44
  34. package/services/index.d.ts +4 -4
  35. package/services/notification-config.service.d.ts +3 -3
  36. package/services/notification-datasource.provider.d.ts +3 -3
  37. package/services/notification-helper.service.d.ts +5 -5
  38. package/services/notification.service.d.ts +8 -8
  39. package/cjs/adapters/index.js +0 -18
  40. package/cjs/adapters/notification.adapter.js +0 -62
  41. package/cjs/adapters/notification.adapter.spec.js +0 -73
  42. package/cjs/config/event-actions.js +0 -33
  43. package/cjs/config/index.js +0 -20
  44. package/cjs/config/message-keys.js +0 -19
  45. package/cjs/config/notification.constants.js +0 -11
  46. package/cjs/controllers/index.js +0 -18
  47. package/cjs/controllers/notification.controller.js +0 -299
  48. package/cjs/controllers/notification.controller.spec.js +0 -214
  49. package/cjs/docs/index.js +0 -18
  50. package/cjs/docs/notification-swagger.config.js +0 -97
  51. package/cjs/docs/notification-swagger.config.spec.js +0 -68
  52. package/cjs/dtos/index.js +0 -18
  53. package/cjs/dtos/notification.dto.js +0 -295
  54. package/cjs/entities/index.js +0 -48
  55. package/cjs/entities/index.spec.js +0 -13
  56. package/cjs/entities/notification-with-company.entity.js +0 -57
  57. package/cjs/entities/notification.entity.js +0 -112
  58. package/cjs/gateways/index.js +0 -18
  59. package/cjs/gateways/notification.gateway.js +0 -172
  60. package/cjs/gateways/notification.gateway.spec.js +0 -359
  61. package/cjs/index.js +0 -28
  62. package/cjs/interfaces/index.js +0 -19
  63. package/cjs/interfaces/notification-module.interface.js +0 -4
  64. package/cjs/interfaces/notification.interface.js +0 -4
  65. package/cjs/modules/index.js +0 -18
  66. package/cjs/modules/notification.module.js +0 -139
  67. package/cjs/modules/notification.module.spec.js +0 -152
  68. package/cjs/services/index.js +0 -21
  69. package/cjs/services/notification-config.service.js +0 -69
  70. package/cjs/services/notification-config.service.spec.js +0 -113
  71. package/cjs/services/notification-datasource.provider.js +0 -133
  72. package/cjs/services/notification-datasource.provider.spec.js +0 -136
  73. package/cjs/services/notification-helper.service.js +0 -197
  74. package/cjs/services/notification-helper.service.spec.js +0 -392
  75. package/cjs/services/notification.service.js +0 -281
  76. package/cjs/services/notification.service.spec.js +0 -560
  77. package/fesm/adapters/notification.adapter.js +0 -52
  78. package/fesm/adapters/notification.adapter.spec.js +0 -69
  79. package/fesm/config/event-actions.js +0 -12
  80. package/fesm/config/message-keys.js +0 -9
  81. package/fesm/config/notification.constants.js +0 -1
  82. package/fesm/controllers/notification.controller.js +0 -289
  83. package/fesm/controllers/notification.controller.spec.js +0 -210
  84. package/fesm/docs/notification-swagger.config.js +0 -87
  85. package/fesm/docs/notification-swagger.config.spec.js +0 -64
  86. package/fesm/dtos/notification.dto.js +0 -262
  87. package/fesm/entities/index.spec.js +0 -9
  88. package/fesm/entities/notification-with-company.entity.js +0 -47
  89. package/fesm/entities/notification.entity.js +0 -102
  90. package/fesm/gateways/notification.gateway.js +0 -162
  91. package/fesm/gateways/notification.gateway.spec.js +0 -355
  92. package/fesm/interfaces/notification-module.interface.js +0 -1
  93. package/fesm/interfaces/notification.interface.js +0 -1
  94. package/fesm/modules/notification.module.js +0 -129
  95. package/fesm/modules/notification.module.spec.js +0 -148
  96. package/fesm/services/notification-config.service.js +0 -59
  97. package/fesm/services/notification-config.service.spec.js +0 -109
  98. package/fesm/services/notification-datasource.provider.js +0 -82
  99. package/fesm/services/notification-datasource.provider.spec.js +0 -132
  100. package/fesm/services/notification-helper.service.js +0 -187
  101. package/fesm/services/notification-helper.service.spec.js +0 -388
  102. package/fesm/services/notification.service.js +0 -271
  103. package/fesm/services/notification.service.spec.js +0 -556
@@ -1,295 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: Object.getOwnPropertyDescriptor(all, name).get
9
- });
10
- }
11
- _export(exports, {
12
- get CreateNotificationDto () {
13
- return CreateNotificationDto;
14
- },
15
- get MarkReadDto () {
16
- return MarkReadDto;
17
- },
18
- get NotificationResponseDto () {
19
- return NotificationResponseDto;
20
- },
21
- get SendBulkNotificationDto () {
22
- return SendBulkNotificationDto;
23
- },
24
- get SendNotificationDto () {
25
- return SendNotificationDto;
26
- },
27
- get UnreadCountResponseDto () {
28
- return UnreadCountResponseDto;
29
- },
30
- get UpdateNotificationDto () {
31
- return UpdateNotificationDto;
32
- }
33
- });
34
- const _enums = require("@flusys/nestjs-shared/enums");
35
- const _swagger = require("@nestjs/swagger");
36
- const _classtransformer = require("class-transformer");
37
- const _classvalidator = require("class-validator");
38
- function _define_property(obj, key, value) {
39
- if (key in obj) {
40
- Object.defineProperty(obj, key, {
41
- value: value,
42
- enumerable: true,
43
- configurable: true,
44
- writable: true
45
- });
46
- } else {
47
- obj[key] = value;
48
- }
49
- return obj;
50
- }
51
- function _ts_decorate(decorators, target, key, desc) {
52
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
53
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
54
- 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;
55
- return c > 3 && r && Object.defineProperty(target, key, r), r;
56
- }
57
- function _ts_metadata(k, v) {
58
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
59
- }
60
- let NotificationContentDto = class NotificationContentDto {
61
- constructor(){
62
- _define_property(this, "title", void 0);
63
- _define_property(this, "message", void 0);
64
- _define_property(this, "type", void 0);
65
- _define_property(this, "data", void 0);
66
- _define_property(this, "companyId", void 0);
67
- }
68
- };
69
- _ts_decorate([
70
- (0, _swagger.ApiProperty)({
71
- maxLength: 255
72
- }),
73
- (0, _classvalidator.IsNotEmpty)(),
74
- (0, _classvalidator.IsString)(),
75
- (0, _classvalidator.MaxLength)(255),
76
- _ts_metadata("design:type", String)
77
- ], NotificationContentDto.prototype, "title", void 0);
78
- _ts_decorate([
79
- (0, _swagger.ApiPropertyOptional)(),
80
- (0, _classvalidator.IsOptional)(),
81
- (0, _classvalidator.IsString)(),
82
- _ts_metadata("design:type", String)
83
- ], NotificationContentDto.prototype, "message", void 0);
84
- _ts_decorate([
85
- (0, _swagger.ApiPropertyOptional)({
86
- enum: _enums.NotificationType,
87
- default: _enums.NotificationType.INFO
88
- }),
89
- (0, _classvalidator.IsOptional)(),
90
- (0, _classvalidator.IsEnum)(_enums.NotificationType),
91
- _ts_metadata("design:type", typeof _enums.NotificationType === "undefined" ? Object : _enums.NotificationType)
92
- ], NotificationContentDto.prototype, "type", void 0);
93
- _ts_decorate([
94
- (0, _swagger.ApiPropertyOptional)(),
95
- (0, _classvalidator.IsOptional)(),
96
- (0, _classvalidator.IsObject)(),
97
- _ts_metadata("design:type", typeof Record === "undefined" ? Object : Record)
98
- ], NotificationContentDto.prototype, "data", void 0);
99
- _ts_decorate([
100
- (0, _swagger.ApiPropertyOptional)(),
101
- (0, _classvalidator.IsOptional)(),
102
- (0, _classvalidator.IsUUID)(),
103
- _ts_metadata("design:type", String)
104
- ], NotificationContentDto.prototype, "companyId", void 0);
105
- let UserIdDto = class UserIdDto {
106
- constructor(){
107
- _define_property(this, "userId", void 0);
108
- }
109
- };
110
- _ts_decorate([
111
- (0, _swagger.ApiProperty)(),
112
- (0, _classvalidator.IsNotEmpty)(),
113
- (0, _classvalidator.IsUUID)(),
114
- _ts_metadata("design:type", String)
115
- ], UserIdDto.prototype, "userId", void 0);
116
- let UserIdsDto = class UserIdsDto {
117
- constructor(){
118
- _define_property(this, "userIds", void 0);
119
- }
120
- };
121
- _ts_decorate([
122
- (0, _swagger.ApiProperty)({
123
- type: [
124
- String
125
- ]
126
- }),
127
- (0, _classvalidator.IsNotEmpty)(),
128
- (0, _classvalidator.IsUUID)('4', {
129
- each: true
130
- }),
131
- _ts_metadata("design:type", Array)
132
- ], UserIdsDto.prototype, "userIds", void 0);
133
- let CreateNotificationDto = class CreateNotificationDto extends (0, _swagger.IntersectionType)(UserIdDto, NotificationContentDto) {
134
- };
135
- let UpdateNotificationDto = class UpdateNotificationDto extends (0, _swagger.PartialType)((0, _swagger.OmitType)(CreateNotificationDto, [
136
- 'userId'
137
- ])) {
138
- constructor(...args){
139
- super(...args), _define_property(this, "id", void 0);
140
- }
141
- };
142
- _ts_decorate([
143
- (0, _swagger.ApiProperty)(),
144
- (0, _classvalidator.IsUUID)(),
145
- (0, _classvalidator.IsNotEmpty)(),
146
- _ts_metadata("design:type", String)
147
- ], UpdateNotificationDto.prototype, "id", void 0);
148
- let MarkReadDto = class MarkReadDto {
149
- constructor(){
150
- _define_property(this, "id", void 0);
151
- }
152
- };
153
- _ts_decorate([
154
- (0, _swagger.ApiProperty)(),
155
- (0, _classvalidator.IsUUID)(),
156
- (0, _classvalidator.IsNotEmpty)(),
157
- _ts_metadata("design:type", String)
158
- ], MarkReadDto.prototype, "id", void 0);
159
- let NotificationResponseDto = class NotificationResponseDto {
160
- constructor(){
161
- _define_property(this, "id", void 0);
162
- _define_property(this, "userId", void 0);
163
- _define_property(this, "type", void 0);
164
- _define_property(this, "title", void 0);
165
- _define_property(this, "message", void 0);
166
- _define_property(this, "data", void 0);
167
- _define_property(this, "isRead", void 0);
168
- _define_property(this, "readAt", void 0);
169
- _define_property(this, "companyId", void 0);
170
- _define_property(this, "createdAt", void 0);
171
- _define_property(this, "updatedAt", void 0);
172
- }
173
- };
174
- _ts_decorate([
175
- (0, _classtransformer.Expose)(),
176
- (0, _swagger.ApiProperty)({
177
- description: 'Unique identifier of the notification',
178
- example: '018e1b2c-3d4e-5f6a-7b8c-9d0e1f2a3b4c'
179
- }),
180
- _ts_metadata("design:type", String)
181
- ], NotificationResponseDto.prototype, "id", void 0);
182
- _ts_decorate([
183
- (0, _classtransformer.Expose)(),
184
- (0, _swagger.ApiProperty)({
185
- description: 'ID of the user this notification belongs to',
186
- example: '018e1b2c-3d4e-5f6a-7b8c-9d0e1f2a3b4c'
187
- }),
188
- _ts_metadata("design:type", String)
189
- ], NotificationResponseDto.prototype, "userId", void 0);
190
- _ts_decorate([
191
- (0, _classtransformer.Expose)(),
192
- (0, _swagger.ApiProperty)({
193
- description: 'Category of the notification',
194
- enum: _enums.NotificationType,
195
- example: _enums.NotificationType.SUCCESS
196
- }),
197
- _ts_metadata("design:type", typeof _enums.NotificationType === "undefined" ? Object : _enums.NotificationType)
198
- ], NotificationResponseDto.prototype, "type", void 0);
199
- _ts_decorate([
200
- (0, _classtransformer.Expose)(),
201
- (0, _swagger.ApiProperty)({
202
- description: 'Short title of the notification',
203
- example: 'Your export is ready'
204
- }),
205
- _ts_metadata("design:type", String)
206
- ], NotificationResponseDto.prototype, "title", void 0);
207
- _ts_decorate([
208
- (0, _classtransformer.Expose)(),
209
- (0, _swagger.ApiPropertyOptional)({
210
- description: 'Optional longer body text for the notification',
211
- example: 'Your CSV export has finished processing and is ready to download.',
212
- nullable: true
213
- }),
214
- _ts_metadata("design:type", Object)
215
- ], NotificationResponseDto.prototype, "message", void 0);
216
- _ts_decorate([
217
- (0, _classtransformer.Expose)(),
218
- (0, _swagger.ApiPropertyOptional)({
219
- description: 'Arbitrary JSON payload attached to the notification',
220
- type: 'object',
221
- additionalProperties: true,
222
- nullable: true,
223
- example: {
224
- exportId: 'abc123',
225
- fileUrl: 'https://cdn.example.com/export.csv'
226
- }
227
- }),
228
- _ts_metadata("design:type", Object)
229
- ], NotificationResponseDto.prototype, "data", void 0);
230
- _ts_decorate([
231
- (0, _classtransformer.Expose)(),
232
- (0, _swagger.ApiProperty)({
233
- description: 'Whether the user has read this notification',
234
- example: false
235
- }),
236
- _ts_metadata("design:type", Boolean)
237
- ], NotificationResponseDto.prototype, "isRead", void 0);
238
- _ts_decorate([
239
- (0, _classtransformer.Expose)(),
240
- (0, _swagger.ApiPropertyOptional)({
241
- description: 'Timestamp when the notification was marked as read; null if unread',
242
- type: 'string',
243
- format: 'date-time',
244
- nullable: true,
245
- example: '2024-03-15T10:30:00.000Z'
246
- }),
247
- _ts_metadata("design:type", Object)
248
- ], NotificationResponseDto.prototype, "readAt", void 0);
249
- _ts_decorate([
250
- (0, _classtransformer.Expose)(),
251
- (0, _swagger.ApiPropertyOptional)({
252
- description: 'Company scope for the notification; null for personal notifications',
253
- example: '018e1b2c-3d4e-5f6a-7b8c-9d0e1f2a3b4c',
254
- nullable: true
255
- }),
256
- _ts_metadata("design:type", Object)
257
- ], NotificationResponseDto.prototype, "companyId", void 0);
258
- _ts_decorate([
259
- (0, _classtransformer.Expose)(),
260
- (0, _swagger.ApiProperty)({
261
- description: 'Timestamp when the notification was created',
262
- type: 'string',
263
- format: 'date-time',
264
- example: '2024-03-15T10:00:00.000Z'
265
- }),
266
- _ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
267
- ], NotificationResponseDto.prototype, "createdAt", void 0);
268
- _ts_decorate([
269
- (0, _classtransformer.Expose)(),
270
- (0, _swagger.ApiProperty)({
271
- description: 'Timestamp when the notification was last updated',
272
- type: 'string',
273
- format: 'date-time',
274
- example: '2024-03-15T10:30:00.000Z'
275
- }),
276
- _ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
277
- ], NotificationResponseDto.prototype, "updatedAt", void 0);
278
- let UnreadCountResponseDto = class UnreadCountResponseDto {
279
- constructor(){
280
- _define_property(this, "count", void 0);
281
- }
282
- };
283
- _ts_decorate([
284
- (0, _classtransformer.Expose)(),
285
- (0, _swagger.ApiProperty)({
286
- description: 'Total number of unread notifications for the user',
287
- example: 5,
288
- minimum: 0
289
- }),
290
- _ts_metadata("design:type", Number)
291
- ], UnreadCountResponseDto.prototype, "count", void 0);
292
- let SendNotificationDto = class SendNotificationDto extends (0, _swagger.IntersectionType)(UserIdDto, NotificationContentDto) {
293
- };
294
- let SendBulkNotificationDto = class SendBulkNotificationDto extends (0, _swagger.IntersectionType)(UserIdsDto, NotificationContentDto) {
295
- };
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: Object.getOwnPropertyDescriptor(all, name).get
9
- });
10
- }
11
- _export(exports, {
12
- get NotificationBase () {
13
- return _notificationentity.Notification;
14
- },
15
- get NotificationCompanyEntities () {
16
- return NotificationCompanyEntities;
17
- },
18
- get NotificationCoreEntities () {
19
- return NotificationCoreEntities;
20
- },
21
- get getNotificationEntitiesByConfig () {
22
- return getNotificationEntitiesByConfig;
23
- }
24
- });
25
- const _notificationentity = _export_star(require("./notification.entity"), exports);
26
- const _notificationwithcompanyentity = _export_star(require("./notification-with-company.entity"), exports);
27
- function _export_star(from, to) {
28
- Object.keys(from).forEach(function(k) {
29
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
30
- Object.defineProperty(to, k, {
31
- enumerable: true,
32
- get: function() {
33
- return from[k];
34
- }
35
- });
36
- }
37
- });
38
- return from;
39
- }
40
- const NotificationCoreEntities = [
41
- _notificationentity.Notification
42
- ];
43
- const NotificationCompanyEntities = [
44
- _notificationwithcompanyentity.NotificationWithCompany
45
- ];
46
- function getNotificationEntitiesByConfig(enableCompanyFeature) {
47
- return enableCompanyFeature ? NotificationCompanyEntities : NotificationCoreEntities;
48
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- const _index = require("./index");
6
- describe('getNotificationEntitiesByConfig', ()=>{
7
- it('returns the core entities when the company feature is disabled', ()=>{
8
- expect((0, _index.getNotificationEntitiesByConfig)(false)).toBe(_index.NotificationCoreEntities);
9
- });
10
- it('returns the company-scoped entities when the company feature is enabled', ()=>{
11
- expect((0, _index.getNotificationEntitiesByConfig)(true)).toBe(_index.NotificationCompanyEntities);
12
- });
13
- });
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "NotificationWithCompany", {
6
- enumerable: true,
7
- get: function() {
8
- return NotificationWithCompany;
9
- }
10
- });
11
- const _typeorm = require("typeorm");
12
- const _notificationentity = require("./notification.entity");
13
- function _define_property(obj, key, value) {
14
- if (key in obj) {
15
- Object.defineProperty(obj, key, {
16
- value: value,
17
- enumerable: true,
18
- configurable: true,
19
- writable: true
20
- });
21
- } else {
22
- obj[key] = value;
23
- }
24
- return obj;
25
- }
26
- function _ts_decorate(decorators, target, key, desc) {
27
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
28
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
29
- 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;
30
- return c > 3 && r && Object.defineProperty(target, key, r), r;
31
- }
32
- function _ts_metadata(k, v) {
33
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
34
- }
35
- let NotificationWithCompany = class NotificationWithCompany extends _notificationentity.Notification {
36
- constructor(...args){
37
- super(...args), _define_property(this, "companyId", void 0);
38
- }
39
- };
40
- _ts_decorate([
41
- (0, _typeorm.Column)({
42
- name: 'company_id',
43
- type: 'uuid',
44
- nullable: true
45
- }),
46
- _ts_metadata("design:type", Object)
47
- ], NotificationWithCompany.prototype, "companyId", void 0);
48
- NotificationWithCompany = _ts_decorate([
49
- (0, _typeorm.Entity)({
50
- name: 'notification'
51
- }),
52
- (0, _typeorm.Index)([
53
- 'companyId',
54
- 'userId',
55
- 'isRead'
56
- ])
57
- ], NotificationWithCompany);
@@ -1,112 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "Notification", {
6
- enumerable: true,
7
- get: function() {
8
- return Notification;
9
- }
10
- });
11
- const _nestjsshared = require("@flusys/nestjs-shared");
12
- const _entities = require("@flusys/nestjs-shared/entities");
13
- const _enums = require("@flusys/nestjs-shared/enums");
14
- const _typeorm = require("typeorm");
15
- function _define_property(obj, key, value) {
16
- if (key in obj) {
17
- Object.defineProperty(obj, key, {
18
- value: value,
19
- enumerable: true,
20
- configurable: true,
21
- writable: true
22
- });
23
- } else {
24
- obj[key] = value;
25
- }
26
- return obj;
27
- }
28
- function _ts_decorate(decorators, target, key, desc) {
29
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
30
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
31
- 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;
32
- return c > 3 && r && Object.defineProperty(target, key, r), r;
33
- }
34
- function _ts_metadata(k, v) {
35
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
36
- }
37
- let Notification = class Notification extends _entities.Identity {
38
- constructor(...args){
39
- super(...args), _define_property(this, "userId", void 0), _define_property(this, "type", void 0), _define_property(this, "title", void 0), _define_property(this, "message", void 0), _define_property(this, "data", void 0), _define_property(this, "isRead", void 0), _define_property(this, "readAt", void 0);
40
- }
41
- };
42
- _ts_decorate([
43
- (0, _typeorm.Column)({
44
- name: 'user_id',
45
- type: 'uuid',
46
- nullable: false
47
- }),
48
- (0, _typeorm.Index)(),
49
- _ts_metadata("design:type", String)
50
- ], Notification.prototype, "userId", void 0);
51
- _ts_decorate([
52
- (0, _typeorm.Column)({
53
- type: 'varchar',
54
- length: 50,
55
- nullable: false,
56
- default: _enums.NotificationType.INFO
57
- }),
58
- _ts_metadata("design:type", String)
59
- ], Notification.prototype, "type", void 0);
60
- _ts_decorate([
61
- (0, _typeorm.Column)({
62
- type: 'varchar',
63
- length: 255,
64
- nullable: false
65
- }),
66
- _ts_metadata("design:type", String)
67
- ], Notification.prototype, "title", void 0);
68
- _ts_decorate([
69
- (0, _typeorm.Column)({
70
- type: 'text',
71
- nullable: true
72
- }),
73
- _ts_metadata("design:type", Object)
74
- ], Notification.prototype, "message", void 0);
75
- _ts_decorate([
76
- (0, _typeorm.Column)({
77
- type: (0, _nestjsshared.getJsonColumnType)(),
78
- nullable: true
79
- }),
80
- _ts_metadata("design:type", Object)
81
- ], Notification.prototype, "data", void 0);
82
- _ts_decorate([
83
- (0, _typeorm.Column)({
84
- name: 'is_read',
85
- type: 'boolean',
86
- nullable: false,
87
- default: false
88
- }),
89
- (0, _typeorm.Index)(),
90
- _ts_metadata("design:type", Boolean)
91
- ], Notification.prototype, "isRead", void 0);
92
- _ts_decorate([
93
- (0, _typeorm.Column)({
94
- name: 'read_at',
95
- type: 'timestamp',
96
- nullable: true
97
- }),
98
- _ts_metadata("design:type", Object)
99
- ], Notification.prototype, "readAt", void 0);
100
- Notification = _ts_decorate([
101
- (0, _typeorm.Entity)({
102
- name: 'notification'
103
- }),
104
- (0, _typeorm.Index)([
105
- 'userId',
106
- 'isRead'
107
- ]),
108
- (0, _typeorm.Index)([
109
- 'userId',
110
- 'createdAt'
111
- ])
112
- ], Notification);
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- _export_star(require("./notification.gateway"), exports);
6
- function _export_star(from, to) {
7
- Object.keys(from).forEach(function(k) {
8
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
9
- Object.defineProperty(to, k, {
10
- enumerable: true,
11
- get: function() {
12
- return from[k];
13
- }
14
- });
15
- }
16
- });
17
- return from;
18
- }