@flusys/nestjs-notification 7.0.2 → 8.0.0-beta.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.
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 +1,79 @@
1
- export * from './notification.adapter';
1
+ export const __rspack_esm_id = 795;
2
+ export const __rspack_esm_ids = [795];
3
+ export const __webpack_modules__ = {
4
+ 295(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
5
+
6
+ // EXPORTS
7
+ __webpack_require__.d(__webpack_exports__, {
8
+ b: () => (/* reexport */ NotificationAdapter)
9
+ });
10
+
11
+ // EXTERNAL MODULE: external "@nestjs/common"
12
+ var common_ = __webpack_require__(157);
13
+ // EXTERNAL MODULE: ./projects/nestjs-notification/src/services/notification-helper.service.ts
14
+ var notification_helper_service = __webpack_require__(487);
15
+ ;// CONCATENATED MODULE: ./projects/nestjs-notification/src/adapters/notification.adapter.ts
16
+ function _ts_decorate(decorators, target, key, desc) {
17
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
18
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
19
+ r = Reflect.decorate(decorators, target, key, desc);
20
+ } else {
21
+ for(var i = decorators.length - 1; i >= 0; i--){
22
+ if (d = decorators[i]) {
23
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
24
+ }
25
+ }
26
+ }
27
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
28
+ }
29
+ function _ts_metadata(metadataKey, metadataValue) {
30
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
31
+ return Reflect.metadata(metadataKey, metadataValue);
32
+ }
33
+ }
34
+ function _ts_param(paramIndex, decorator) {
35
+ return function(target, key) {
36
+ decorator(target, key, paramIndex);
37
+ };
38
+ }
39
+
40
+
41
+ class NotificationAdapter {
42
+ notificationHelper;
43
+ constructor(notificationHelper){
44
+ this.notificationHelper = notificationHelper;
45
+ }
46
+ async send(options) {
47
+ await this.notificationHelper.send(options);
48
+ }
49
+ async sendToMany(options) {
50
+ await this.notificationHelper.sendToMany(options);
51
+ }
52
+ isUserOnline(userId) {
53
+ return this.notificationHelper.isUserOnline(userId);
54
+ }
55
+ }
56
+ NotificationAdapter = _ts_decorate([
57
+ (0,common_.Injectable)(),
58
+ _ts_param(0, (0,common_.Inject)(notification_helper_service/* .NotificationHelperService */.T)),
59
+ _ts_metadata("design:type", Function),
60
+ _ts_metadata("design:paramtypes", [
61
+ typeof notification_helper_service/* .NotificationHelperService */.T === "undefined" ? Object : notification_helper_service/* .NotificationHelperService */.T
62
+ ])
63
+ ], NotificationAdapter);
64
+
65
+ ;// CONCATENATED MODULE: ./projects/nestjs-notification/src/adapters/index.ts
66
+
67
+
68
+
69
+ },
70
+
71
+ };
72
+ import { __webpack_require__ } from '../runtime.js';
73
+ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
74
+ import * as __rspack_chunk_1 from '../244.js';
75
+ __webpack_require__.C(__rspack_chunk_1);
76
+ import * as __rspack_chunk_2 from './index.js';
77
+ __webpack_require__.C(__rspack_chunk_2);
78
+ var __webpack_exports__ = __webpack_exec__(295);var __webpack_exports__NotificationAdapter = __webpack_exports__.b;
79
+ export { __webpack_exports__NotificationAdapter as NotificationAdapter };
@@ -1,3 +1,84 @@
1
- export * from './event-actions';
2
- export * from './message-keys';
3
- export * from './notification.constants';
1
+ export const __rspack_esm_id = 565;
2
+ export const __rspack_esm_ids = [565];
3
+ export const __webpack_modules__ = {
4
+ 360(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
5
+ /**
6
+ * Domain event actions published by the notification module, alongside the CRUD
7
+ * lifecycle actions every ApiService emits.
8
+ */ const NOTIFICATION_EVENT_ACTIONS = {
9
+ SENT: 'sent',
10
+ READ: 'read',
11
+ ALL_READ: 'all-read'
12
+ };
13
+ const NOTIFICATION_EVENT_ENTITIES = {
14
+ NOTIFICATION: 'notification'
15
+ };
16
+ const NOTIFICATION_EVENT_MODULE = 'notification';
17
+
18
+ __webpack_require__.d(__webpack_exports__, {
19
+ }, {
20
+ BA: NOTIFICATION_EVENT_ENTITIES,
21
+ R: NOTIFICATION_EVENT_ACTIONS,
22
+ Wx: NOTIFICATION_EVENT_MODULE
23
+ });
24
+
25
+
26
+ },
27
+ 222(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
28
+ /* import */ var _event_actions_js__rspack_import_0 = __webpack_require__(360);
29
+ /* import */ var _message_keys_js__rspack_import_1 = __webpack_require__(158);
30
+ /* import */ var _notification_constants_js__rspack_import_2 = __webpack_require__(608);
31
+
32
+
33
+
34
+
35
+ __webpack_require__.d(__webpack_exports__, {
36
+ BA: () => (/* reexport safe */ _event_actions_js__rspack_import_0.BA),
37
+ GJ: () => (/* reexport safe */ _notification_constants_js__rspack_import_2.G),
38
+ R: () => (/* reexport safe */ _event_actions_js__rspack_import_0.R),
39
+ Wx: () => (/* reexport safe */ _event_actions_js__rspack_import_0.Wx),
40
+ x7: () => (/* reexport safe */ _message_keys_js__rspack_import_1.x)
41
+ });
42
+
43
+
44
+ },
45
+ 158(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
46
+ // ==================== NOTIFICATION MODULE MESSAGE KEYS ====================
47
+ const NOTIFICATION_MESSAGES = {
48
+ NOT_FOUND: 'notification.not.found',
49
+ MARK_READ_SUCCESS: 'notification.mark.read.success',
50
+ MARK_ALL_READ_SUCCESS: 'notification.mark.all.read.success',
51
+ UNREAD_COUNT_SUCCESS: 'notification.unread.count.success',
52
+ SEND_SUCCESS: 'notification.send.success',
53
+ BROADCAST_SUCCESS: 'notification.broadcast.success'
54
+ };
55
+
56
+ __webpack_require__.d(__webpack_exports__, {
57
+ }, {
58
+ x: NOTIFICATION_MESSAGES
59
+ });
60
+
61
+
62
+ },
63
+ 608(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
64
+ const NOTIFICATION_MODULE_OPTIONS = 'NOTIFICATION_MODULE_OPTIONS';
65
+
66
+ __webpack_require__.d(__webpack_exports__, {
67
+ }, {
68
+ G: NOTIFICATION_MODULE_OPTIONS
69
+ });
70
+
71
+
72
+ },
73
+
74
+ };
75
+ import { __webpack_require__ } from '../runtime.js';
76
+ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
77
+ import * as __rspack_chunk_1 from './index.js';
78
+ __webpack_require__.C(__rspack_chunk_1);
79
+ var __webpack_exports__ = __webpack_exec__(222);var __webpack_exports__NOTIFICATION_EVENT_ACTIONS = __webpack_exports__.R;
80
+ var __webpack_exports__NOTIFICATION_EVENT_ENTITIES = __webpack_exports__.BA;
81
+ var __webpack_exports__NOTIFICATION_EVENT_MODULE = __webpack_exports__.Wx;
82
+ var __webpack_exports__NOTIFICATION_MESSAGES = __webpack_exports__.x7;
83
+ var __webpack_exports__NOTIFICATION_MODULE_OPTIONS = __webpack_exports__.GJ;
84
+ export { __webpack_exports__NOTIFICATION_EVENT_ACTIONS as NOTIFICATION_EVENT_ACTIONS, __webpack_exports__NOTIFICATION_EVENT_ENTITIES as NOTIFICATION_EVENT_ENTITIES, __webpack_exports__NOTIFICATION_EVENT_MODULE as NOTIFICATION_EVENT_MODULE, __webpack_exports__NOTIFICATION_MESSAGES as NOTIFICATION_MESSAGES, __webpack_exports__NOTIFICATION_MODULE_OPTIONS as NOTIFICATION_MODULE_OPTIONS };
@@ -1 +1,13 @@
1
- export * from './notification.controller';
1
+ export const __rspack_esm_id = 24;
2
+ export const __rspack_esm_ids = [24];
3
+ export const __webpack_modules__ = {};
4
+ import { __webpack_require__ } from '../runtime.js';
5
+ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
6
+ import * as __rspack_chunk_1 from '../244.js';
7
+ __webpack_require__.C(__rspack_chunk_1);
8
+ import * as __rspack_chunk_2 from '../446.js';
9
+ __webpack_require__.C(__rspack_chunk_2);
10
+ import * as __rspack_chunk_3 from './index.js';
11
+ __webpack_require__.C(__rspack_chunk_3);
12
+ var __webpack_exports__ = __webpack_exec__(101);var __webpack_exports__NotificationController = __webpack_exports__.e;
13
+ export { __webpack_exports__NotificationController as NotificationController };
@@ -1 +1,112 @@
1
- export * from './notification-swagger.config';
1
+ export const __rspack_esm_id = 428;
2
+ export const __rspack_esm_ids = [428];
3
+ export const __webpack_modules__ = {
4
+ 674(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
5
+
6
+ // EXPORTS
7
+ __webpack_require__.d(__webpack_exports__, {
8
+ M: () => (/* reexport */ notificationSwaggerConfig)
9
+ });
10
+
11
+ ;// CONCATENATED MODULE: ./projects/nestjs-notification/src/docs/notification-swagger.config.ts
12
+ /** Schema properties to exclude when company feature is disabled */ const COMPANY_SCHEMA_EXCLUSIONS = [
13
+ {
14
+ schemaName: 'NotificationResponseDto',
15
+ properties: [
16
+ 'companyId'
17
+ ]
18
+ },
19
+ {
20
+ schemaName: 'CreateNotificationDto',
21
+ properties: [
22
+ 'companyId'
23
+ ]
24
+ },
25
+ {
26
+ schemaName: 'SendNotificationDto',
27
+ properties: [
28
+ 'companyId'
29
+ ]
30
+ },
31
+ {
32
+ schemaName: 'SendBulkNotificationDto',
33
+ properties: [
34
+ 'companyId'
35
+ ]
36
+ },
37
+ {
38
+ schemaName: 'UpdateNotificationDto',
39
+ properties: [
40
+ 'companyId'
41
+ ]
42
+ }
43
+ ];
44
+ function notificationSwaggerConfig(bootstrapConfig) {
45
+ const enableCompanyFeature = bootstrapConfig?.enableCompanyFeature ?? true;
46
+ const isMultiTenant = bootstrapConfig?.databaseMode === 'multi-tenant';
47
+ const multiTenantNote = isMultiTenant ? `\n> **Multi-Tenant Mode**: Include \`x-tenant-id\` header to target a specific tenant database.\n` : '';
48
+ return {
49
+ title: 'Notification API',
50
+ description: `
51
+ ## Notification API
52
+ ${multiTenantNote}
53
+ Real-time notification system with WebSocket support.
54
+
55
+ ### Features
56
+ - Push notifications to users
57
+ - Mark notifications as read
58
+ - Unread count tracking
59
+ - Real-time delivery via WebSocket
60
+ - Bulk notification sending
61
+
62
+ ### Endpoints
63
+
64
+ #### User Notifications
65
+ - \`POST /notification/get-all\` - Get user's notifications (paginated, sorted by newest)
66
+ - \`POST /notification/get/:id\` - Get single notification
67
+ - \`POST /notification/mark-read\` - Mark notification as read
68
+ - \`POST /notification/mark-all-read\` - Mark all notifications as read
69
+ - \`POST /notification/unread-count\` - Get unread notification count
70
+
71
+ #### Admin/System
72
+ - \`POST /notification/send\` - Send notification to a user
73
+ - \`POST /notification/send-bulk\` - Send notification to multiple users
74
+
75
+ ### WebSocket Events
76
+
77
+ Connect to WebSocket with JWT authentication:
78
+ \`\`\`
79
+ ws://localhost:2002/notification?token=<jwt>
80
+ \`\`\`
81
+
82
+ **Events:**
83
+ - \`notification:new\` - New notification received
84
+ - \`notification:read\` - Notification marked as read
85
+ - \`notification:read-all\` - All notifications marked as read
86
+
87
+ ### Notification Types
88
+ - \`info\` - General information
89
+ - \`success\` - Success message
90
+ - \`warning\` - Warning message
91
+ - \`error\` - Error message
92
+ `,
93
+ version: '1.0',
94
+ path: 'api/docs/notification',
95
+ bearerAuth: true,
96
+ excludeSchemaProperties: enableCompanyFeature ? undefined : COMPANY_SCHEMA_EXCLUSIONS
97
+ };
98
+ }
99
+
100
+ ;// CONCATENATED MODULE: ./projects/nestjs-notification/src/docs/index.ts
101
+
102
+
103
+
104
+ },
105
+
106
+ };
107
+ import { __webpack_require__ } from '../runtime.js';
108
+ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
109
+ import * as __rspack_chunk_1 from './index.js';
110
+ __webpack_require__.C(__rspack_chunk_1);
111
+ var __webpack_exports__ = __webpack_exec__(674);var __webpack_exports__notificationSwaggerConfig = __webpack_exports__.M;
112
+ export { __webpack_exports__notificationSwaggerConfig as notificationSwaggerConfig };
@@ -1 +1,311 @@
1
- export * from './notification.dto';
1
+ import { IsEnum, IsNotEmpty, IsObject, IsOptional, IsString, IsUUID, MaxLength } from "class-validator";
2
+ import * as __rspack_external__flusys_nestjs_shared_enums_327421f8 from "@flusys/nestjs-shared/enums";
3
+ import * as __rspack_external__nestjs_swagger_7cd450b5 from "@nestjs/swagger";
4
+ import * as __rspack_external_class_transformer_c5a479fb from "class-transformer";
5
+ export const __rspack_esm_id = 685;
6
+ export const __rspack_esm_ids = [685];
7
+ export const __webpack_modules__ = {
8
+ 733(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
9
+
10
+ // EXPORTS
11
+ __webpack_require__.d(__webpack_exports__, {
12
+ X0: () => (/* reexport */ CreateNotificationDto),
13
+ xo: () => (/* reexport */ MarkReadDto),
14
+ eB: () => (/* reexport */ NotificationResponseDto),
15
+ HD: () => (/* reexport */ SendBulkNotificationDto),
16
+ Zs: () => (/* reexport */ SendNotificationDto),
17
+ vi: () => (/* reexport */ UnreadCountResponseDto),
18
+ Oc: () => (/* reexport */ UpdateNotificationDto)
19
+ });
20
+
21
+ // EXTERNAL MODULE: external "@flusys/nestjs-shared/enums"
22
+ var enums_ = __webpack_require__(471);
23
+ // EXTERNAL MODULE: external "@nestjs/swagger"
24
+ var swagger_ = __webpack_require__(176);
25
+ // EXTERNAL MODULE: external "class-transformer"
26
+ var external_class_transformer_ = __webpack_require__(812);
27
+ ;// CONCATENATED MODULE: external "class-validator"
28
+
29
+ ;// CONCATENATED MODULE: ./projects/nestjs-notification/src/dtos/notification.dto.ts
30
+ function _ts_decorate(decorators, target, key, desc) {
31
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
32
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
33
+ r = Reflect.decorate(decorators, target, key, desc);
34
+ } else {
35
+ for(var i = decorators.length - 1; i >= 0; i--){
36
+ if (d = decorators[i]) {
37
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
38
+ }
39
+ }
40
+ }
41
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
42
+ }
43
+ function _ts_metadata(metadataKey, metadataValue) {
44
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
45
+ return Reflect.metadata(metadataKey, metadataValue);
46
+ }
47
+ }
48
+
49
+
50
+
51
+
52
+ let NotificationContentDto = class NotificationContentDto {
53
+ title;
54
+ message;
55
+ type;
56
+ data;
57
+ companyId;
58
+ };
59
+ _ts_decorate([
60
+ (0,swagger_.ApiProperty)({
61
+ maxLength: 255
62
+ }),
63
+ IsNotEmpty(),
64
+ IsString(),
65
+ MaxLength(255),
66
+ _ts_metadata("design:type", String)
67
+ ], NotificationContentDto.prototype, "title", void 0);
68
+ _ts_decorate([
69
+ (0,swagger_.ApiPropertyOptional)(),
70
+ IsOptional(),
71
+ IsString(),
72
+ _ts_metadata("design:type", String)
73
+ ], NotificationContentDto.prototype, "message", void 0);
74
+ _ts_decorate([
75
+ (0,swagger_.ApiPropertyOptional)({
76
+ enum: enums_.NotificationType,
77
+ default: enums_.NotificationType.INFO
78
+ }),
79
+ IsOptional(),
80
+ IsEnum(enums_.NotificationType),
81
+ _ts_metadata("design:type", typeof enums_.NotificationType === "undefined" ? Object : enums_.NotificationType)
82
+ ], NotificationContentDto.prototype, "type", void 0);
83
+ _ts_decorate([
84
+ (0,swagger_.ApiPropertyOptional)(),
85
+ IsOptional(),
86
+ IsObject(),
87
+ _ts_metadata("design:type", typeof Record === "undefined" ? Object : Record)
88
+ ], NotificationContentDto.prototype, "data", void 0);
89
+ _ts_decorate([
90
+ (0,swagger_.ApiPropertyOptional)(),
91
+ IsOptional(),
92
+ IsUUID(),
93
+ _ts_metadata("design:type", String)
94
+ ], NotificationContentDto.prototype, "companyId", void 0);
95
+ let UserIdDto = class UserIdDto {
96
+ userId;
97
+ };
98
+ _ts_decorate([
99
+ (0,swagger_.ApiProperty)(),
100
+ IsNotEmpty(),
101
+ IsUUID(),
102
+ _ts_metadata("design:type", String)
103
+ ], UserIdDto.prototype, "userId", void 0);
104
+ let UserIdsDto = class UserIdsDto {
105
+ userIds;
106
+ };
107
+ _ts_decorate([
108
+ (0,swagger_.ApiProperty)({
109
+ type: [
110
+ String
111
+ ]
112
+ }),
113
+ IsNotEmpty(),
114
+ IsUUID('4', {
115
+ each: true
116
+ }),
117
+ _ts_metadata("design:type", Array)
118
+ ], UserIdsDto.prototype, "userIds", void 0);
119
+ class CreateNotificationDto extends (0,swagger_.IntersectionType)(UserIdDto, NotificationContentDto) {
120
+ }
121
+ class UpdateNotificationDto extends (0,swagger_.PartialType)((0,swagger_.OmitType)(CreateNotificationDto, [
122
+ 'userId'
123
+ ])) {
124
+ id;
125
+ }
126
+ _ts_decorate([
127
+ (0,swagger_.ApiProperty)(),
128
+ IsUUID(),
129
+ IsNotEmpty(),
130
+ _ts_metadata("design:type", String)
131
+ ], UpdateNotificationDto.prototype, "id", void 0);
132
+ class MarkReadDto {
133
+ id;
134
+ }
135
+ _ts_decorate([
136
+ (0,swagger_.ApiProperty)(),
137
+ IsUUID(),
138
+ IsNotEmpty(),
139
+ _ts_metadata("design:type", String)
140
+ ], MarkReadDto.prototype, "id", void 0);
141
+ class NotificationResponseDto {
142
+ id;
143
+ userId;
144
+ type;
145
+ title;
146
+ message;
147
+ data;
148
+ isRead;
149
+ readAt;
150
+ companyId;
151
+ createdAt;
152
+ updatedAt;
153
+ }
154
+ _ts_decorate([
155
+ (0,external_class_transformer_.Expose)(),
156
+ (0,swagger_.ApiProperty)({
157
+ description: 'Unique identifier of the notification',
158
+ example: '018e1b2c-3d4e-5f6a-7b8c-9d0e1f2a3b4c'
159
+ }),
160
+ _ts_metadata("design:type", String)
161
+ ], NotificationResponseDto.prototype, "id", void 0);
162
+ _ts_decorate([
163
+ (0,external_class_transformer_.Expose)(),
164
+ (0,swagger_.ApiProperty)({
165
+ description: 'ID of the user this notification belongs to',
166
+ example: '018e1b2c-3d4e-5f6a-7b8c-9d0e1f2a3b4c'
167
+ }),
168
+ _ts_metadata("design:type", String)
169
+ ], NotificationResponseDto.prototype, "userId", void 0);
170
+ _ts_decorate([
171
+ (0,external_class_transformer_.Expose)(),
172
+ (0,swagger_.ApiProperty)({
173
+ description: 'Category of the notification',
174
+ enum: enums_.NotificationType,
175
+ example: enums_.NotificationType.SUCCESS
176
+ }),
177
+ _ts_metadata("design:type", typeof enums_.NotificationType === "undefined" ? Object : enums_.NotificationType)
178
+ ], NotificationResponseDto.prototype, "type", void 0);
179
+ _ts_decorate([
180
+ (0,external_class_transformer_.Expose)(),
181
+ (0,swagger_.ApiProperty)({
182
+ description: 'Short title of the notification',
183
+ example: 'Your export is ready'
184
+ }),
185
+ _ts_metadata("design:type", String)
186
+ ], NotificationResponseDto.prototype, "title", void 0);
187
+ _ts_decorate([
188
+ (0,external_class_transformer_.Expose)(),
189
+ (0,swagger_.ApiPropertyOptional)({
190
+ description: 'Optional longer body text for the notification',
191
+ example: 'Your CSV export has finished processing and is ready to download.',
192
+ nullable: true
193
+ }),
194
+ _ts_metadata("design:type", Object)
195
+ ], NotificationResponseDto.prototype, "message", void 0);
196
+ _ts_decorate([
197
+ (0,external_class_transformer_.Expose)(),
198
+ (0,swagger_.ApiPropertyOptional)({
199
+ description: 'Arbitrary JSON payload attached to the notification',
200
+ type: 'object',
201
+ additionalProperties: true,
202
+ nullable: true,
203
+ example: {
204
+ exportId: 'abc123',
205
+ fileUrl: 'https://cdn.example.com/export.csv'
206
+ }
207
+ }),
208
+ _ts_metadata("design:type", Object)
209
+ ], NotificationResponseDto.prototype, "data", void 0);
210
+ _ts_decorate([
211
+ (0,external_class_transformer_.Expose)(),
212
+ (0,swagger_.ApiProperty)({
213
+ description: 'Whether the user has read this notification',
214
+ example: false
215
+ }),
216
+ _ts_metadata("design:type", Boolean)
217
+ ], NotificationResponseDto.prototype, "isRead", void 0);
218
+ _ts_decorate([
219
+ (0,external_class_transformer_.Expose)(),
220
+ (0,swagger_.ApiPropertyOptional)({
221
+ description: 'Timestamp when the notification was marked as read; null if unread',
222
+ type: 'string',
223
+ format: 'date-time',
224
+ nullable: true,
225
+ example: '2024-03-15T10:30:00.000Z'
226
+ }),
227
+ _ts_metadata("design:type", Object)
228
+ ], NotificationResponseDto.prototype, "readAt", void 0);
229
+ _ts_decorate([
230
+ (0,external_class_transformer_.Expose)(),
231
+ (0,swagger_.ApiPropertyOptional)({
232
+ description: 'Company scope for the notification; null for personal notifications',
233
+ example: '018e1b2c-3d4e-5f6a-7b8c-9d0e1f2a3b4c',
234
+ nullable: true
235
+ }),
236
+ _ts_metadata("design:type", Object)
237
+ ], NotificationResponseDto.prototype, "companyId", void 0);
238
+ _ts_decorate([
239
+ (0,external_class_transformer_.Expose)(),
240
+ (0,swagger_.ApiProperty)({
241
+ description: 'Timestamp when the notification was created',
242
+ type: 'string',
243
+ format: 'date-time',
244
+ example: '2024-03-15T10:00:00.000Z'
245
+ }),
246
+ _ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
247
+ ], NotificationResponseDto.prototype, "createdAt", void 0);
248
+ _ts_decorate([
249
+ (0,external_class_transformer_.Expose)(),
250
+ (0,swagger_.ApiProperty)({
251
+ description: 'Timestamp when the notification was last updated',
252
+ type: 'string',
253
+ format: 'date-time',
254
+ example: '2024-03-15T10:30:00.000Z'
255
+ }),
256
+ _ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
257
+ ], NotificationResponseDto.prototype, "updatedAt", void 0);
258
+ class UnreadCountResponseDto {
259
+ count;
260
+ }
261
+ _ts_decorate([
262
+ (0,external_class_transformer_.Expose)(),
263
+ (0,swagger_.ApiProperty)({
264
+ description: 'Total number of unread notifications for the user',
265
+ example: 5,
266
+ minimum: 0
267
+ }),
268
+ _ts_metadata("design:type", Number)
269
+ ], UnreadCountResponseDto.prototype, "count", void 0);
270
+ class SendNotificationDto extends (0,swagger_.IntersectionType)(UserIdDto, NotificationContentDto) {
271
+ }
272
+ class SendBulkNotificationDto extends (0,swagger_.IntersectionType)(UserIdsDto, NotificationContentDto) {
273
+ }
274
+
275
+ ;// CONCATENATED MODULE: ./projects/nestjs-notification/src/dtos/index.ts
276
+
277
+
278
+
279
+ },
280
+ 471(module) {
281
+
282
+ module.exports = __rspack_external__flusys_nestjs_shared_enums_327421f8;
283
+
284
+
285
+ },
286
+ 176(module) {
287
+
288
+ module.exports = __rspack_external__nestjs_swagger_7cd450b5;
289
+
290
+
291
+ },
292
+ 812(module) {
293
+
294
+ module.exports = __rspack_external_class_transformer_c5a479fb;
295
+
296
+
297
+ },
298
+
299
+ };
300
+ import { __webpack_require__ } from '../runtime.js';
301
+ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
302
+ import * as __rspack_chunk_1 from './index.js';
303
+ __webpack_require__.C(__rspack_chunk_1);
304
+ var __webpack_exports__ = __webpack_exec__(733);var __webpack_exports__CreateNotificationDto = __webpack_exports__.X0;
305
+ var __webpack_exports__MarkReadDto = __webpack_exports__.xo;
306
+ var __webpack_exports__NotificationResponseDto = __webpack_exports__.eB;
307
+ var __webpack_exports__SendBulkNotificationDto = __webpack_exports__.HD;
308
+ var __webpack_exports__SendNotificationDto = __webpack_exports__.Zs;
309
+ var __webpack_exports__UnreadCountResponseDto = __webpack_exports__.vi;
310
+ var __webpack_exports__UpdateNotificationDto = __webpack_exports__.Oc;
311
+ export { __webpack_exports__CreateNotificationDto as CreateNotificationDto, __webpack_exports__MarkReadDto as MarkReadDto, __webpack_exports__NotificationResponseDto as NotificationResponseDto, __webpack_exports__SendBulkNotificationDto as SendBulkNotificationDto, __webpack_exports__SendNotificationDto as SendNotificationDto, __webpack_exports__UnreadCountResponseDto as UnreadCountResponseDto, __webpack_exports__UpdateNotificationDto as UpdateNotificationDto };