@flusys/nestjs-notification 3.0.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.
- package/README.md +998 -0
- package/adapters/index.d.ts +1 -0
- package/adapters/notification.adapter.d.ts +10 -0
- package/cjs/adapters/index.js +18 -0
- package/cjs/adapters/notification.adapter.js +79 -0
- package/cjs/config/index.js +18 -0
- package/cjs/config/notification.constants.js +11 -0
- package/cjs/controllers/index.js +18 -0
- package/cjs/controllers/notification.controller.js +278 -0
- package/cjs/docs/index.js +18 -0
- package/cjs/docs/notification-swagger.config.js +61 -0
- package/cjs/dtos/index.js +18 -0
- package/cjs/dtos/notification.dto.js +244 -0
- package/cjs/entities/index.js +48 -0
- package/cjs/entities/notification-with-company.entity.js +57 -0
- package/cjs/entities/notification.entity.js +111 -0
- package/cjs/gateways/index.js +18 -0
- package/cjs/gateways/notification.gateway.js +226 -0
- package/cjs/index.js +28 -0
- package/cjs/interfaces/index.js +19 -0
- package/cjs/interfaces/notification-module.interface.js +4 -0
- package/cjs/interfaces/notification.interface.js +4 -0
- package/cjs/modules/index.js +18 -0
- package/cjs/modules/notification.module.js +139 -0
- package/cjs/services/index.js +21 -0
- package/cjs/services/notification-config.service.js +72 -0
- package/cjs/services/notification-datasource.provider.js +174 -0
- package/cjs/services/notification-helper.service.js +186 -0
- package/cjs/services/notification.service.js +220 -0
- package/config/index.d.ts +1 -0
- package/config/notification.constants.d.ts +1 -0
- package/controllers/index.d.ts +1 -0
- package/controllers/notification.controller.d.ts +26 -0
- package/docs/index.d.ts +1 -0
- package/docs/notification-swagger.config.d.ts +2 -0
- package/dtos/index.d.ts +1 -0
- package/dtos/notification.dto.d.ts +47 -0
- package/entities/index.d.ts +8 -0
- package/entities/notification-with-company.entity.d.ts +4 -0
- package/entities/notification.entity.d.ts +10 -0
- package/fesm/adapters/index.js +1 -0
- package/fesm/adapters/notification.adapter.js +69 -0
- package/fesm/config/index.js +1 -0
- package/fesm/config/notification.constants.js +1 -0
- package/fesm/controllers/index.js +1 -0
- package/fesm/controllers/notification.controller.js +268 -0
- package/fesm/docs/index.js +1 -0
- package/fesm/docs/notification-swagger.config.js +51 -0
- package/fesm/dtos/index.js +1 -0
- package/fesm/dtos/notification.dto.js +211 -0
- package/fesm/entities/index.js +14 -0
- package/fesm/entities/notification-with-company.entity.js +47 -0
- package/fesm/entities/notification.entity.js +101 -0
- package/fesm/gateways/index.js +1 -0
- package/fesm/gateways/notification.gateway.js +175 -0
- package/fesm/index.js +20 -0
- package/fesm/interfaces/index.js +2 -0
- package/fesm/interfaces/notification-module.interface.js +1 -0
- package/fesm/interfaces/notification.interface.js +1 -0
- package/fesm/modules/index.js +1 -0
- package/fesm/modules/notification.module.js +129 -0
- package/fesm/services/index.js +4 -0
- package/fesm/services/notification-config.service.js +62 -0
- package/fesm/services/notification-datasource.provider.js +123 -0
- package/fesm/services/notification-helper.service.js +176 -0
- package/fesm/services/notification.service.js +210 -0
- package/gateways/index.d.ts +1 -0
- package/gateways/notification.gateway.d.ts +21 -0
- package/index.d.ts +10 -0
- package/interfaces/index.d.ts +2 -0
- package/interfaces/notification-module.interface.d.ts +20 -0
- package/interfaces/notification.interface.d.ts +19 -0
- package/modules/index.d.ts +1 -0
- package/modules/notification.module.d.ts +8 -0
- package/package.json +98 -0
- package/services/index.d.ts +4 -0
- package/services/notification-config.service.d.ts +13 -0
- package/services/notification-datasource.provider.d.ts +23 -0
- package/services/notification-helper.service.d.ts +44 -0
- package/services/notification.service.d.ts +35 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/classes';
|
|
2
|
+
import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
|
|
3
|
+
import { UtilsService } from '@flusys/nestjs-shared/modules';
|
|
4
|
+
import { EntityTarget, QueryRunner, Repository, SelectQueryBuilder } from 'typeorm';
|
|
5
|
+
import { CreateNotificationDto, UpdateNotificationDto } from '../dtos';
|
|
6
|
+
import { NotificationBase } from '../entities';
|
|
7
|
+
import { NotificationGateway } from '../gateways';
|
|
8
|
+
import { INotification } from '../interfaces';
|
|
9
|
+
import { NotificationConfigService } from './notification-config.service';
|
|
10
|
+
import { NotificationDataSourceProvider } from './notification-datasource.provider';
|
|
11
|
+
export declare class NotificationService extends RequestScopedApiService<CreateNotificationDto, UpdateNotificationDto, INotification, NotificationBase, Repository<NotificationBase>> {
|
|
12
|
+
protected cacheManager: HybridCache;
|
|
13
|
+
protected utilsService: UtilsService;
|
|
14
|
+
private readonly notificationConfig;
|
|
15
|
+
private readonly dataSourceProvider;
|
|
16
|
+
private readonly gateway?;
|
|
17
|
+
constructor(cacheManager: HybridCache, utilsService: UtilsService, notificationConfig: NotificationConfigService, dataSourceProvider: NotificationDataSourceProvider, gateway?: NotificationGateway);
|
|
18
|
+
protected resolveEntity(): EntityTarget<NotificationBase>;
|
|
19
|
+
protected getDataSourceProvider(): NotificationDataSourceProvider;
|
|
20
|
+
convertSingleDtoToEntity(dto: CreateNotificationDto | UpdateNotificationDto, user: ILoggedUserInfo | null): Promise<NotificationBase>;
|
|
21
|
+
protected getFilterQuery(query: SelectQueryBuilder<NotificationBase>, filter: Record<string, any>, _user: ILoggedUserInfo | null): Promise<{
|
|
22
|
+
query: SelectQueryBuilder<NotificationBase>;
|
|
23
|
+
isRaw: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
protected getExtraManipulateQuery(query: SelectQueryBuilder<NotificationBase>, filterDto: any, user: ILoggedUserInfo | null): Promise<{
|
|
26
|
+
query: SelectQueryBuilder<NotificationBase>;
|
|
27
|
+
isRaw: boolean;
|
|
28
|
+
}>;
|
|
29
|
+
protected afterInsertOperation(entities: NotificationBase[], _user: ILoggedUserInfo | null, _qr: QueryRunner): Promise<void>;
|
|
30
|
+
markAsRead(id: string, user: ILoggedUserInfo): Promise<NotificationBase>;
|
|
31
|
+
markAllAsRead(user: ILoggedUserInfo): Promise<number>;
|
|
32
|
+
getUnreadCount(user: ILoggedUserInfo): Promise<number>;
|
|
33
|
+
private toPayload;
|
|
34
|
+
private emitToUserInCompanyIfRealtime;
|
|
35
|
+
}
|