From f47005892d8a193e75a912d1f8d7812ad7905d16 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Wed, 28 Dec 2022 10:03:11 +0200 Subject: [PATCH] UI: Add notification service --- .../src/app/core/http/notification.service.ts | 132 +++++++++++++ ui-ngx/src/app/core/http/public-api.ts | 1 + .../core/notification/notification.effects.ts | 4 +- ui-ngx/src/app/core/services/public-api.ts | 2 +- ...rvice.ts => toast-notification.service.ts} | 2 +- .../app/modules/home/models/services.map.ts | 4 +- .../app/shared/components/toast.directive.ts | 4 +- .../app/shared/models/entity-type.models.ts | 6 +- .../app/shared/models/id/notification-id.ts | 22 +++ .../models/id/notification-request-id.ts | 26 +++ .../shared/models/id/notification-rule-id.ts | 26 +++ .../models/id/notification-target-id.ts | 26 +++ .../models/id/notification-template-id.ts | 26 +++ ui-ngx/src/app/shared/models/id/public-api.ts | 5 + .../app/shared/models/notification.models.ts | 186 ++++++++++++++++++ ui-ngx/src/app/shared/models/public-api.ts | 1 + 16 files changed, 465 insertions(+), 8 deletions(-) create mode 100644 ui-ngx/src/app/core/http/notification.service.ts rename ui-ngx/src/app/core/services/{notification.service.ts => toast-notification.service.ts} (97%) create mode 100644 ui-ngx/src/app/shared/models/id/notification-id.ts create mode 100644 ui-ngx/src/app/shared/models/id/notification-request-id.ts create mode 100644 ui-ngx/src/app/shared/models/id/notification-rule-id.ts create mode 100644 ui-ngx/src/app/shared/models/id/notification-target-id.ts create mode 100644 ui-ngx/src/app/shared/models/id/notification-template-id.ts create mode 100644 ui-ngx/src/app/shared/models/notification.models.ts diff --git a/ui-ngx/src/app/core/http/notification.service.ts b/ui-ngx/src/app/core/http/notification.service.ts new file mode 100644 index 0000000000..f55f08bae1 --- /dev/null +++ b/ui-ngx/src/app/core/http/notification.service.ts @@ -0,0 +1,132 @@ +/// +/// Copyright © 2016-2022 The Thingsboard Authors +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// + +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { defaultHttpOptionsFromConfig, RequestConfig } from '@core/http/http-utils'; +import { Observable } from 'rxjs'; +import { PageLink } from '@shared/models/page/page-link'; +import { PageData } from '@shared/models/page/page-data'; +import { + Notification, + NotificationRequest, + NotificationRule, + NotificationSettings, + NotificationTarget, + NotificationTemplate, + SlackChanelType, + SlackConversation +} from '@shared/models/notification.models'; +import { User } from '@shared/models/user.model'; + +@Injectable({ + providedIn: 'root' +}) +export class NotificationService { + + constructor( + private http: HttpClient + ) { + } + + public getNotifications(pageLink: PageLink, config?: RequestConfig): Observable> { + return this.http.get>(`/api/notifications${pageLink.toQuery()}`, defaultHttpOptionsFromConfig(config)); + } + + public markNotificationAsRead(id: string, config?: RequestConfig): Observable { + return this.http.put(`/api/notification/${id}/read`, defaultHttpOptionsFromConfig(config)); + } + + public createNotificationRequest(notification: NotificationRequest, config?: RequestConfig): Observable { + return this.http.post('/api/notification/request', notification, defaultHttpOptionsFromConfig(config)); + } + + public getNotificationRequestById(id: string, config?: RequestConfig): Observable { + return this.http.get(`/api/notification/request/${id}`, defaultHttpOptionsFromConfig(config)); + } + + public deleteNotificationRequest(id: string, config?: RequestConfig): Observable { + return this.http.delete(`/api/notification/request/${id}`, defaultHttpOptionsFromConfig(config)); + } + + public getNotificationRequests(pageLink: PageLink, config?: RequestConfig): Observable> { + return this.http.get>('/api/notification/request/', defaultHttpOptionsFromConfig(config)); + } + + public getNotificationSettings(config?: RequestConfig): Observable { + return this.http.get('/api/notification/settings', defaultHttpOptionsFromConfig(config)); + } + + public saveNotificationSettings(notificationSettings: NotificationSettings, config?: RequestConfig): Observable { + return this.http.post('/api/notification/settings', notificationSettings, defaultHttpOptionsFromConfig(config)); + } + + public listSlackConversations(type: SlackChanelType, config?: RequestConfig): Observable> { + return this.http.get>(`/api/notification/slack/conversations?type=${type}`, + defaultHttpOptionsFromConfig(config)); + } + + public saveNotificationRule(notificationRule: NotificationRule, config?: RequestConfig): Observable { + return this.http.post('/api/notification/rule', notificationRule, defaultHttpOptionsFromConfig(config)); + } + + public getNotificationRuleById(id: string, config?: RequestConfig): Observable { + return this.http.get(`/api/notification/rule/${id}`, defaultHttpOptionsFromConfig(config)); + } + + public deleteNotificationRule(id: string, config?: RequestConfig): Observable { + return this.http.delete(`/api/notification/rule/${id}`, defaultHttpOptionsFromConfig(config)); + } + + public getNotificationRules(pageLink: PageLink, config?: RequestConfig): Observable> { + return this.http.get>(`/api/notification/rules${pageLink.toQuery()}`, defaultHttpOptionsFromConfig(config)); + } + + public saveNotificationTarget(notificationTarget: NotificationTarget, config?: RequestConfig): Observable { + return this.http.post('/api/notification/target', notificationTarget, defaultHttpOptionsFromConfig(config)); + } + + public getNotificationTargetById(id: string, config?: RequestConfig): Observable { + return this.http.get(`/api/notification/target/${id}`, defaultHttpOptionsFromConfig(config)); + } + + public deleteNotificationTarget(id: string, config?: RequestConfig): Observable { + return this.http.delete(`/api/notification/target/${id}`, defaultHttpOptionsFromConfig(config)); + } + + public getNotificationTargets(pageLink: PageLink, config?: RequestConfig): Observable> { + return this.http.get>(`/api/notification/targets${pageLink.toQuery()}`, + defaultHttpOptionsFromConfig(config)); + } + + public getRecipientsForNotificationTargetConfig(notificationTarget: NotificationTarget, pageLink: PageLink, + config?: RequestConfig): Observable> { + return this.http.post>(`/api/notification/target/recipients${pageLink.toQuery()}`, notificationTarget, + defaultHttpOptionsFromConfig(config)); + } + + public saveNotificationTemplate(notificationTarget: NotificationTemplate, config?: RequestConfig): Observable { + return this.http.post('/api/notification/template', notificationTarget, defaultHttpOptionsFromConfig(config)); + } + + public getNotificationTemplateById(id: string, config?: RequestConfig): Observable { + return this.http.get(`/api/notification/template/${id}`, defaultHttpOptionsFromConfig(config)); + } + + public deleteNotificationTemplate(id: string, config?: RequestConfig): Observable { + return this.http.delete(`/api/notification/template/${id}`, defaultHttpOptionsFromConfig(config)); + } +} diff --git a/ui-ngx/src/app/core/http/public-api.ts b/ui-ngx/src/app/core/http/public-api.ts index c06889ad4c..df46599bba 100644 --- a/ui-ngx/src/app/core/http/public-api.ts +++ b/ui-ngx/src/app/core/http/public-api.ts @@ -30,6 +30,7 @@ export * from './entity-relation.service'; export * from './entity-view.service'; export * from './event.service'; export * from './http-utils'; +export * from './notification.service'; export * from './oauth2.service'; export * from './ota-package.service'; export * from './queue.service'; diff --git a/ui-ngx/src/app/core/notification/notification.effects.ts b/ui-ngx/src/app/core/notification/notification.effects.ts index ec33d9da72..de6c408730 100644 --- a/ui-ngx/src/app/core/notification/notification.effects.ts +++ b/ui-ngx/src/app/core/notification/notification.effects.ts @@ -19,13 +19,13 @@ import { Actions, Effect, ofType } from '@ngrx/effects'; import { map } from 'rxjs/operators'; import { NotificationActions, NotificationActionTypes } from '@app/core/notification/notification.actions'; -import { NotificationService } from '@app/core/services/notification.service'; +import { ToastNotificationService } from '@core/services/toast-notification.service'; @Injectable() export class NotificationEffects { constructor( private actions$: Actions, - private notificationService: NotificationService + private notificationService: ToastNotificationService ) { } diff --git a/ui-ngx/src/app/core/services/public-api.ts b/ui-ngx/src/app/core/services/public-api.ts index 5afb622462..ca80a65acd 100644 --- a/ui-ngx/src/app/core/services/public-api.ts +++ b/ui-ngx/src/app/core/services/public-api.ts @@ -23,7 +23,7 @@ export * from './dynamic-component-factory.service'; export * from './item-buffer.service'; export * from './menu.models'; export * from './menu.service'; -export * from './notification.service'; +export * from './toast-notification.service'; export * from './raf.service'; export * from './resources.service'; export * from './time.service'; diff --git a/ui-ngx/src/app/core/services/notification.service.ts b/ui-ngx/src/app/core/services/toast-notification.service.ts similarity index 97% rename from ui-ngx/src/app/core/services/notification.service.ts rename to ui-ngx/src/app/core/services/toast-notification.service.ts index 1e79351801..d26255a93e 100644 --- a/ui-ngx/src/app/core/services/notification.service.ts +++ b/ui-ngx/src/app/core/services/toast-notification.service.ts @@ -24,7 +24,7 @@ import { Observable, Subject } from 'rxjs'; providedIn: 'root' } ) -export class NotificationService { +export class ToastNotificationService { private notificationSubject: Subject = new Subject(); diff --git a/ui-ngx/src/app/modules/home/models/services.map.ts b/ui-ngx/src/app/modules/home/models/services.map.ts index 7514e972b5..36607b47dd 100644 --- a/ui-ngx/src/app/modules/home/models/services.map.ts +++ b/ui-ngx/src/app/modules/home/models/services.map.ts @@ -40,6 +40,7 @@ import { AuthService } from '@core/auth/auth.service'; import { ResourceService } from '@core/http/resource.service'; import { TwoFactorAuthenticationService } from '@core/http/two-factor-authentication.service'; import { TelemetryWebsocketService } from '@core/ws/telemetry-websocket.service'; +import { NotificationService } from '@core/http/notification.service'; export const ServicesMap = new Map>( [ @@ -67,6 +68,7 @@ export const ServicesMap = new Map>( ['authService', AuthService], ['resourceService', ResourceService], ['twoFactorAuthenticationService', TwoFactorAuthenticationService], - ['telemetryWsService', TelemetryWebsocketService] + ['telemetryWsService', TelemetryWebsocketService], + ['notificationService', NotificationService] ] ); diff --git a/ui-ngx/src/app/shared/components/toast.directive.ts b/ui-ngx/src/app/shared/components/toast.directive.ts index 2d42978ca3..a20cc27688 100644 --- a/ui-ngx/src/app/shared/components/toast.directive.ts +++ b/ui-ngx/src/app/shared/components/toast.directive.ts @@ -31,7 +31,7 @@ import { import { MAT_SNACK_BAR_DATA, MatSnackBar, MatSnackBarConfig, MatSnackBarRef } from '@angular/material/snack-bar'; import { NotificationMessage } from '@app/core/notification/notification.models'; import { Subscription } from 'rxjs'; -import { NotificationService } from '@app/core/services/notification.service'; +import { ToastNotificationService } from '@core/services/toast-notification.service'; import { BreakpointObserver } from '@angular/cdk/layout'; import { MediaBreakpoints } from '@shared/models/constants'; import { MatButton } from '@angular/material/button'; @@ -56,7 +56,7 @@ export class ToastDirective implements AfterViewInit, OnDestroy { constructor(private elementRef: ElementRef, private viewContainerRef: ViewContainerRef, - private notificationService: NotificationService, + private notificationService: ToastNotificationService, private componentFactoryResolver: ComponentFactoryResolver, private snackBar: MatSnackBar, private ngZone: NgZone, diff --git a/ui-ngx/src/app/shared/models/entity-type.models.ts b/ui-ngx/src/app/shared/models/entity-type.models.ts index 83a7ebebf8..d8b1d78437 100644 --- a/ui-ngx/src/app/shared/models/entity-type.models.ts +++ b/ui-ngx/src/app/shared/models/entity-type.models.ts @@ -38,7 +38,11 @@ export enum EntityType { TB_RESOURCE = 'TB_RESOURCE', OTA_PACKAGE = 'OTA_PACKAGE', RPC = 'RPC', - QUEUE = 'QUEUE' + QUEUE = 'QUEUE', + NOTIFICATION_REQUEST = 'NOTIFICATION_REQUEST', + NOTIFICATION_RULE = 'NOTIFICATION_RULE', + NOTIFICATION_TARGET = 'NOTIFICATION_TARGET', + NOTIFICATION_TEMPLATE = 'NOTIFICATION_TEMPLATE' } export enum AliasEntityType { diff --git a/ui-ngx/src/app/shared/models/id/notification-id.ts b/ui-ngx/src/app/shared/models/id/notification-id.ts new file mode 100644 index 0000000000..211cb7a6bc --- /dev/null +++ b/ui-ngx/src/app/shared/models/id/notification-id.ts @@ -0,0 +1,22 @@ +/// +/// Copyright © 2016-2022 The Thingsboard Authors +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// + +export class NotificationId { + id: string; + constructor(id: string) { + this.id = id; + } +} diff --git a/ui-ngx/src/app/shared/models/id/notification-request-id.ts b/ui-ngx/src/app/shared/models/id/notification-request-id.ts new file mode 100644 index 0000000000..518d3a7bdc --- /dev/null +++ b/ui-ngx/src/app/shared/models/id/notification-request-id.ts @@ -0,0 +1,26 @@ +/// +/// Copyright © 2016-2022 The Thingsboard Authors +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// + +import { EntityId } from '@shared/models/id/entity-id'; +import { EntityType } from '@shared/models/entity-type.models'; + +export class NotificationRequestId implements EntityId { + entityType = EntityType.NOTIFICATION_REQUEST; + id: string; + constructor(id: string) { + this.id = id; + } +} diff --git a/ui-ngx/src/app/shared/models/id/notification-rule-id.ts b/ui-ngx/src/app/shared/models/id/notification-rule-id.ts new file mode 100644 index 0000000000..3d32dc3ef5 --- /dev/null +++ b/ui-ngx/src/app/shared/models/id/notification-rule-id.ts @@ -0,0 +1,26 @@ +/// +/// Copyright © 2016-2022 The Thingsboard Authors +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// + +import { EntityId } from '@shared/models/id/entity-id'; +import { EntityType } from '@shared/models/entity-type.models'; + +export class NotificationRuleId implements EntityId { + entityType = EntityType.NOTIFICATION_RULE; + id: string; + constructor(id: string) { + this.id = id; + } +} diff --git a/ui-ngx/src/app/shared/models/id/notification-target-id.ts b/ui-ngx/src/app/shared/models/id/notification-target-id.ts new file mode 100644 index 0000000000..d2006abd32 --- /dev/null +++ b/ui-ngx/src/app/shared/models/id/notification-target-id.ts @@ -0,0 +1,26 @@ +/// +/// Copyright © 2016-2022 The Thingsboard Authors +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// + +import { EntityId } from '@shared/models/id/entity-id'; +import { EntityType } from '@shared/models/entity-type.models'; + +export class NotificationTargetId implements EntityId { + entityType = EntityType.NOTIFICATION_TARGET; + id: string; + constructor(id: string) { + this.id = id; + } +} diff --git a/ui-ngx/src/app/shared/models/id/notification-template-id.ts b/ui-ngx/src/app/shared/models/id/notification-template-id.ts new file mode 100644 index 0000000000..2d723124e0 --- /dev/null +++ b/ui-ngx/src/app/shared/models/id/notification-template-id.ts @@ -0,0 +1,26 @@ +/// +/// Copyright © 2016-2022 The Thingsboard Authors +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// + +import { EntityId } from '@shared/models/id/entity-id'; +import { EntityType } from '@shared/models/entity-type.models'; + +export class NotificationTemplateId implements EntityId { + entityType = EntityType.NOTIFICATION_TEMPLATE; + id: string; + constructor(id: string) { + this.id = id; + } +} diff --git a/ui-ngx/src/app/shared/models/id/public-api.ts b/ui-ngx/src/app/shared/models/id/public-api.ts index f30a5ffbcf..3aa8320302 100644 --- a/ui-ngx/src/app/shared/models/id/public-api.ts +++ b/ui-ngx/src/app/shared/models/id/public-api.ts @@ -26,6 +26,11 @@ export * from './entity-id'; export * from './entity-view-id'; export * from './event-id'; export * from './has-uuid'; +export * from './notification-id'; +export * from './notification-request-id'; +export * from './notification-rule-id'; +export * from './notification-target-id'; +export * from './notification-template-id'; export * from './ota-package-id'; export * from './rpc-id'; export * from './rule-chain-id'; diff --git a/ui-ngx/src/app/shared/models/notification.models.ts b/ui-ngx/src/app/shared/models/notification.models.ts new file mode 100644 index 0000000000..c355249122 --- /dev/null +++ b/ui-ngx/src/app/shared/models/notification.models.ts @@ -0,0 +1,186 @@ +/// +/// Copyright © 2016-2022 The Thingsboard Authors +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// + +import { NotificationId } from '@shared/models/id/notification-id'; +import { NotificationRequestId } from '@shared/models/id/notification-request-id'; +import { UserId } from '@shared/models/id/user-id'; +import { DashboardId } from '@shared/models/id/dashboard-id'; +import { BaseData } from '@shared/models/base-data'; +import { TenantId } from '@shared/models/id/tenant-id'; +import { NotificationTargetId } from '@shared/models/id/notification-target-id'; +import { NotificationTemplateId } from '@shared/models/id/notification-template-id'; +import { EntityId } from '@shared/models/id/entity-id'; +import { NotificationRuleId } from '@shared/models/id/notification-rule-id'; + +export interface Notification { + readonly id: NotificationId; + readonly requestId: NotificationRequestId; + readonly recipientId: UserId; + readonly type: string; + readonly text: string; + readonly info: NotificationInfo; + readonly originatorType: NotificationOriginatorType; + readonly status: NotificationStatus; +} + +export interface NotificationInfo { + description: string; + dashboardId: DashboardId; + originatorType: NotificationOriginatorType; +} + +export interface NotificationRequest extends Omit, 'label'> { + tenantId?: TenantId; + targets: Array; + templateId: NotificationTemplateId; + info?: NotificationInfo; + deliveryMethods: Array; + originatorEntityId: EntityId; + originatorType: NotificationOriginatorType; + status: NotificationRequestStatus; + stats: NotificationRequestStats; + additionalConfig: NotificationRequestConfig; +} + +export interface NotificationRequestStats { + sent: Map; + errors: Map>; + processedRecipients: Map>; +} + +export interface NotificationRequestConfig { + sendingDelayInSec: number; +} + +export interface NotificationSettings { + deliveryMethodsConfigs: Map; +} + +export interface NotificationDeliveryMethodConfig { + enabled: boolean; + method: NotificationDeliveryMethod; +} + +export interface SlackConversation { + id: string; + name: string; +} + +export interface NotificationRule extends Omit, 'label'>{ + tenantId: TenantId; + templateId: NotificationTemplateId; + deliveryMethods: Array; + configuration: NotificationRuleConfig; +} + +export interface NotificationRuleConfig { + initialNotificationTargetId: NotificationTargetId; + escalationConfig: NotificationEscalationConfig; +} + +export interface NotificationEscalationConfig { + escalations: Array; +} + +export interface NonConfirmedNotificationEscalation { + delayInSec: number; + notificationTargetId: NotificationTargetId; +} + +export interface NotificationTarget extends Omit, 'label'>{ + tenantId: TenantId; + configuration: NotificationTargetConfig; +} + +export interface NotificationTargetConfig extends + Partial{ + type: NotificationTargetConfigType; +} + +interface SingleUserNotificationTargetConfig { + userId: string; +} + +interface UserListNotificationTargetConfig { + usersIds: Array; +} + +interface CustomerUsersNotificationTargetConfig { + customerId: string; + getCustomerIdFromOriginatorEntity: boolean; +} + +export interface NotificationTemplate extends Omit, 'label'>{ + tenantId: TenantId; + notificationType: string; + configuration: NotificationTemplateConfig; +} + +interface NotificationTemplateConfig { + defaultTextTemplate: string; + templates: Map; +} + +interface DeliveryMethodNotificationTemplate extends + Partial{ + body: string; + method: NotificationDeliveryMethod; +} + +interface EmailDeliveryMethodNotificationTemplate { + subject: string; +} + +interface SlackDeliveryMethodNotificationTemplate { + conversationType: SlackChanelType; + conversationId: string; +} + +export enum NotificationOriginatorType { + ADMIN = 'ADMIN', + ALARM = 'ALARM', + RULE_NODE = 'RULE_NODE' +} + +export enum NotificationStatus { + SENT = 'SENT', + READ = 'READ' +} + +export enum NotificationDeliveryMethod { + WEBSOCKET = 'WEBSOCKET', + SMS = 'SMS', + EMAIL = 'EMAIL', + SLACK = 'SLACK' +} + +export enum NotificationRequestStatus { + PROCESSED = 'PROCESSED', + SCHEDULED = 'SCHEDULED' +} + +export enum SlackChanelType { + USER= 'USER', + PUBLIC_CHANNEL = 'PUBLIC_CHANNEL', + PRIVATE_CHANNEL = 'PRIVATE_CHANNEL' +} + +export enum NotificationTargetConfigType { + SINGLE_USER = 'SINGLE_USER', + USER_LIST = 'USER_LIST', + CUSTOMER_USERS = 'CUSTOMER_USERS', + ALL_USERS = 'ALL_USERS' +} diff --git a/ui-ngx/src/app/shared/models/public-api.ts b/ui-ngx/src/app/shared/models/public-api.ts index 8c97669481..4c45802c2a 100644 --- a/ui-ngx/src/app/shared/models/public-api.ts +++ b/ui-ngx/src/app/shared/models/public-api.ts @@ -38,6 +38,7 @@ export * from './error.models'; export * from './event.models'; export * from './login.models'; export * from './material.models'; +export * from './notification.models'; export * from './oauth2.models'; export * from './queue.models'; export * from './relation.models';