@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 +1,269 @@
1
- export * from './notification.module';
1
+ import { NOTIFICATION_ADAPTER } from "@flusys/nestjs-shared/interfaces";
2
+ export const __rspack_esm_id = 900;
3
+ export const __rspack_esm_ids = [900];
4
+ export const __webpack_modules__ = {
5
+ 295(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
6
+
7
+ // EXPORTS
8
+ __webpack_require__.d(__webpack_exports__, {
9
+ b: () => (/* reexport */ NotificationAdapter)
10
+ });
11
+
12
+ // EXTERNAL MODULE: external "@nestjs/common"
13
+ var common_ = __webpack_require__(157);
14
+ // EXTERNAL MODULE: ./projects/nestjs-notification/src/services/notification-helper.service.ts
15
+ var notification_helper_service = __webpack_require__(487);
16
+ ;// CONCATENATED MODULE: ./projects/nestjs-notification/src/adapters/notification.adapter.ts
17
+ function _ts_decorate(decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
20
+ r = Reflect.decorate(decorators, target, key, desc);
21
+ } else {
22
+ for(var i = decorators.length - 1; i >= 0; i--){
23
+ if (d = decorators[i]) {
24
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
25
+ }
26
+ }
27
+ }
28
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
29
+ }
30
+ function _ts_metadata(metadataKey, metadataValue) {
31
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
32
+ return Reflect.metadata(metadataKey, metadataValue);
33
+ }
34
+ }
35
+ function _ts_param(paramIndex, decorator) {
36
+ return function(target, key) {
37
+ decorator(target, key, paramIndex);
38
+ };
39
+ }
40
+
41
+
42
+ class NotificationAdapter {
43
+ notificationHelper;
44
+ constructor(notificationHelper){
45
+ this.notificationHelper = notificationHelper;
46
+ }
47
+ async send(options) {
48
+ await this.notificationHelper.send(options);
49
+ }
50
+ async sendToMany(options) {
51
+ await this.notificationHelper.sendToMany(options);
52
+ }
53
+ isUserOnline(userId) {
54
+ return this.notificationHelper.isUserOnline(userId);
55
+ }
56
+ }
57
+ NotificationAdapter = _ts_decorate([
58
+ (0,common_.Injectable)(),
59
+ _ts_param(0, (0,common_.Inject)(notification_helper_service/* .NotificationHelperService */.T)),
60
+ _ts_metadata("design:type", Function),
61
+ _ts_metadata("design:paramtypes", [
62
+ typeof notification_helper_service/* .NotificationHelperService */.T === "undefined" ? Object : notification_helper_service/* .NotificationHelperService */.T
63
+ ])
64
+ ], NotificationAdapter);
65
+
66
+ ;// CONCATENATED MODULE: ./projects/nestjs-notification/src/adapters/index.ts
67
+
68
+
69
+
70
+ },
71
+ 540(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
72
+
73
+ // EXPORTS
74
+ __webpack_require__.d(__webpack_exports__, {
75
+ C: () => (/* reexport */ NotificationModule)
76
+ });
77
+
78
+ // EXTERNAL MODULE: external "@flusys/nestjs-shared/modules"
79
+ var modules_ = __webpack_require__(236);
80
+ ;// CONCATENATED MODULE: external "@flusys/nestjs-shared/interfaces"
81
+
82
+ // EXTERNAL MODULE: external "@nestjs/common"
83
+ var common_ = __webpack_require__(157);
84
+ // EXTERNAL MODULE: external "@nestjs/jwt"
85
+ var jwt_ = __webpack_require__(125);
86
+ // EXTERNAL MODULE: ./projects/nestjs-notification/src/config/notification.constants.ts
87
+ var notification_constants = __webpack_require__(608);
88
+ // EXTERNAL MODULE: ./projects/nestjs-notification/src/controllers/index.ts + 4 modules
89
+ var controllers = __webpack_require__(101);
90
+ // EXTERNAL MODULE: ./projects/nestjs-notification/src/adapters/index.ts + 1 modules
91
+ var adapters = __webpack_require__(295);
92
+ // EXTERNAL MODULE: ./projects/nestjs-notification/src/services/index.ts
93
+ var services = __webpack_require__(816);
94
+ // EXTERNAL MODULE: ./projects/nestjs-notification/src/gateways/index.ts + 4 modules
95
+ var gateways = __webpack_require__(31);
96
+ ;// CONCATENATED MODULE: ./projects/nestjs-notification/src/modules/notification.module.ts
97
+ function _ts_decorate(decorators, target, key, desc) {
98
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
99
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
100
+ r = Reflect.decorate(decorators, target, key, desc);
101
+ } else {
102
+ for(var i = decorators.length - 1; i >= 0; i--){
103
+ if (d = decorators[i]) {
104
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
105
+ }
106
+ }
107
+ }
108
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
109
+ }
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+ const CONTROLLERS = [
120
+ controllers/* .NotificationController */.e
121
+ ];
122
+ const EXPORTED_SERVICES = [
123
+ services/* .NotificationConfigService */.vM,
124
+ services/* .NotificationDataSourceProvider */.MK,
125
+ services/* .NotificationService */.JE,
126
+ services/* .NotificationHelperService */.Tf
127
+ ];
128
+ const ADAPTER_PROVIDER = {
129
+ provide: NOTIFICATION_ADAPTER,
130
+ useClass: adapters/* .NotificationAdapter */.b
131
+ };
132
+ class NotificationModule {
133
+ static forRoot(options) {
134
+ return {
135
+ module: NotificationModule,
136
+ global: options.global ?? false,
137
+ imports: [
138
+ modules_.CacheModule,
139
+ modules_.UtilsModule
140
+ ],
141
+ controllers: options.includeController !== false ? CONTROLLERS : [],
142
+ providers: [
143
+ ...this.buildProviders(options),
144
+ jwt_.JwtService,
145
+ gateways/* .NotificationGateway */.g,
146
+ adapters/* .NotificationAdapter */.b,
147
+ ADAPTER_PROVIDER
148
+ ],
149
+ exports: [
150
+ ...EXPORTED_SERVICES,
151
+ gateways/* .NotificationGateway */.g,
152
+ NOTIFICATION_ADAPTER
153
+ ]
154
+ };
155
+ }
156
+ static forRootAsync(options) {
157
+ return {
158
+ module: NotificationModule,
159
+ global: options.global ?? false,
160
+ imports: [
161
+ ...options.imports || [],
162
+ modules_.CacheModule,
163
+ modules_.UtilsModule
164
+ ],
165
+ controllers: options.includeController !== false ? CONTROLLERS : [],
166
+ providers: [
167
+ ...this.createAsyncProviders(options),
168
+ ...this.buildProviders(),
169
+ jwt_.JwtService,
170
+ gateways/* .NotificationGateway */.g,
171
+ adapters/* .NotificationAdapter */.b,
172
+ ADAPTER_PROVIDER
173
+ ],
174
+ exports: [
175
+ ...EXPORTED_SERVICES,
176
+ gateways/* .NotificationGateway */.g,
177
+ NOTIFICATION_ADAPTER
178
+ ]
179
+ };
180
+ }
181
+ static buildProviders(options) {
182
+ const providers = [
183
+ ...EXPORTED_SERVICES
184
+ ];
185
+ if (options) {
186
+ providers.unshift({
187
+ provide: notification_constants/* .NOTIFICATION_MODULE_OPTIONS */.G,
188
+ useValue: options
189
+ });
190
+ }
191
+ providers.push((0,modules_.createModuleEventsProvider)('notification', notification_constants/* .NOTIFICATION_MODULE_OPTIONS */.G));
192
+ return providers;
193
+ }
194
+ static createAsyncProviders(options) {
195
+ if (options.useFactory) {
196
+ return [
197
+ {
198
+ provide: notification_constants/* .NOTIFICATION_MODULE_OPTIONS */.G,
199
+ useFactory: async (...args)=>({
200
+ ...options,
201
+ config: await options.useFactory(...args)
202
+ }),
203
+ inject: options.inject || []
204
+ }
205
+ ];
206
+ }
207
+ const factoryClass = options.useClass || options.useExisting;
208
+ if (!factoryClass) return [];
209
+ const providers = [
210
+ {
211
+ provide: notification_constants/* .NOTIFICATION_MODULE_OPTIONS */.G,
212
+ useFactory: async (factory)=>({
213
+ ...options,
214
+ config: await factory.createNotificationOptions()
215
+ }),
216
+ inject: [
217
+ factoryClass
218
+ ]
219
+ }
220
+ ];
221
+ if (options.useClass) {
222
+ providers.push({
223
+ provide: options.useClass,
224
+ useClass: options.useClass
225
+ });
226
+ }
227
+ return providers;
228
+ }
229
+ }
230
+ NotificationModule = _ts_decorate([
231
+ (0,common_.Module)({})
232
+ ], NotificationModule);
233
+
234
+ ;// CONCATENATED MODULE: ./projects/nestjs-notification/src/modules/index.ts
235
+
236
+
237
+
238
+ },
239
+ 816(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
240
+ /* import */ var _notification_config_service_js__rspack_import_0 = __webpack_require__(53);
241
+ /* import */ var _notification_datasource_provider_js__rspack_import_1 = __webpack_require__(335);
242
+ /* import */ var _notification_service_js__rspack_import_2 = __webpack_require__(305);
243
+ /* import */ var _notification_helper_service_js__rspack_import_3 = __webpack_require__(487);
244
+
245
+
246
+
247
+
248
+
249
+ __webpack_require__.d(__webpack_exports__, {
250
+ JE: () => (/* reexport safe */ _notification_service_js__rspack_import_2.J),
251
+ MK: () => (/* reexport safe */ _notification_datasource_provider_js__rspack_import_1.M),
252
+ Tf: () => (/* reexport safe */ _notification_helper_service_js__rspack_import_3.T),
253
+ vM: () => (/* reexport safe */ _notification_config_service_js__rspack_import_0.v)
254
+ });
255
+
256
+
257
+ },
258
+
259
+ };
260
+ import { __webpack_require__ } from '../runtime.js';
261
+ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
262
+ import * as __rspack_chunk_1 from '../244.js';
263
+ __webpack_require__.C(__rspack_chunk_1);
264
+ import * as __rspack_chunk_2 from '../446.js';
265
+ __webpack_require__.C(__rspack_chunk_2);
266
+ import * as __rspack_chunk_3 from './index.js';
267
+ __webpack_require__.C(__rspack_chunk_3);
268
+ var __webpack_exports__ = __webpack_exec__(540);var __webpack_exports__NotificationModule = __webpack_exports__.C;
269
+ export { __webpack_exports__NotificationModule as NotificationModule };
@@ -0,0 +1,85 @@
1
+ var __webpack_modules__ = ({});
2
+ // The module cache
3
+ var __webpack_module_cache__ = {};
4
+
5
+ // The require function
6
+ function __webpack_require__(moduleId) {
7
+
8
+ // Check if module is in cache
9
+ var cachedModule = __webpack_module_cache__[moduleId];
10
+ if (cachedModule !== undefined) {
11
+ return cachedModule.exports;
12
+ }
13
+ // Create a new module (and put it into the cache)
14
+ var module = (__webpack_module_cache__[moduleId] = {
15
+ exports: {}
16
+ });
17
+ // Execute the module function
18
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
19
+
20
+ // Return the exports of the module
21
+ return module.exports;
22
+
23
+ }
24
+
25
+ // expose the modules object (__webpack_modules__)
26
+ __webpack_require__.m = __webpack_modules__;
27
+
28
+ // webpack/runtime/define_property_getters
29
+ (() => {
30
+ __webpack_require__.d = (exports, getters, values) => {
31
+ var define = (defs, kind) => {
32
+ for(var key in defs) {
33
+ if(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {
34
+ Object.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });
35
+ }
36
+ }
37
+ };
38
+ define(getters, "get");
39
+ define(values, "value");
40
+ };
41
+ })();
42
+ // webpack/runtime/export_webpack_require
43
+ var __webpack_require__temp = __webpack_require__;
44
+ export { __webpack_require__temp as __webpack_require__ };
45
+ // webpack/runtime/has_own_property
46
+ (() => {
47
+ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
48
+ })();
49
+ // webpack/runtime/module_chunk_loading
50
+ (() => {
51
+ // no BaseURI
52
+ // object to store loaded and loading chunks
53
+ // undefined = chunk not loaded, null = chunk preloaded/prefetched
54
+ // [resolve, Promise] = chunk loading, 0 = chunk loaded
55
+ var moduleInstalledChunks = {146: 0,};
56
+ var moduleInstallChunk = (data) => {
57
+ var __rspack_esm_ids = data.__rspack_esm_ids;
58
+ var moreModules = data.__webpack_modules__;
59
+ var __rspack_esm_runtime = data.__rspack_esm_runtime;
60
+ // add "modules" to the modules object,
61
+ // then flag all "ids" as loaded and fire callback
62
+ var moduleId, chunkId, i = 0;
63
+ for (moduleId in moreModules) {
64
+ if (__webpack_require__.o(moreModules, moduleId)) {
65
+ __webpack_require__.m[moduleId] = moreModules[moduleId];
66
+ }
67
+ }
68
+ if (__rspack_esm_runtime) __rspack_esm_runtime(__webpack_require__);
69
+ for (; i < __rspack_esm_ids.length; i++) {
70
+ chunkId = __rspack_esm_ids[i];
71
+ if (__webpack_require__.o(moduleInstalledChunks, chunkId) && moduleInstalledChunks[chunkId]) {
72
+ moduleInstalledChunks[chunkId][0]();
73
+ }
74
+ moduleInstalledChunks[__rspack_esm_ids[i]] = 0;
75
+ }
76
+
77
+ };
78
+ // no chunk on demand loading
79
+
80
+ __webpack_require__.C = moduleInstallChunk;
81
+ // no on chunks loaded
82
+ // no HMR
83
+ // no HMR manifest
84
+
85
+ })();