@webitel/ui-sdk 26.4.69 → 26.4.70

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "26.4.69",
3
+ "version": "26.4.70",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "make-all": "npm version patch --git-tag-version false && npm run build && (npm run build:types || true) && (npm run biome:format:all || true) && npm run publish-lib",
@@ -1,16 +1,33 @@
1
1
  import { ApiUserWarningId } from '@webitel/api-services/gen/models';
2
- import type { UserNotificationsConfigsMap } from '../types/UserWarnings';
2
+ import type { NotificationsType } from '../types/UserNotifications';
3
+
4
+ const HOURS_IN_DAY = 24;
3
5
 
4
6
  export const USER_NOTIFICATION_CONFIGS_MAP = new Map<
5
- string,
6
- UserNotificationsConfigsMap
7
+ ApiUserWarningId,
8
+ (warningId: ApiUserWarningId) => NotificationsType
7
9
  >([
8
10
  [
9
11
  ApiUserWarningId.PasswordExpiresSoon,
10
- {
12
+ ({ warningData: data }) => ({
13
+ type: 'info',
14
+ localeKey: data.passwordExpiry.daysRemaining
15
+ ? 'passwordExpirationMessageDays'
16
+ : 'passwordExpirationMessageHours',
17
+ params: {
18
+ amount: data.passwordExpiry.daysRemaining || HOURS_IN_DAY,
19
+ },
20
+ }),
21
+ ],
22
+ [
23
+ ApiUserWarningId.LicenseExpiresSoon,
24
+ ({ warningData: data }) => ({
11
25
  type: 'info',
12
- localeKey: 'passwordExpirationMessage',
13
- getDays: (warningData) => warningData.passwordExpiry.daysRemaining || 0,
14
- },
26
+ localeKey: 'licenseExpirationSoonMessage',
27
+ params: {
28
+ amount: data.licenseExpiry.daysRemaining,
29
+ name: data.licenseExpiry.licenseName,
30
+ },
31
+ }),
15
32
  ],
16
33
  ]);
@@ -1,118 +1,185 @@
1
1
  import { ApiUserWarningId } from '@webitel/api-services/gen/models';
2
2
  import { createPinia, setActivePinia } from 'pinia';
3
3
  import { beforeEach, describe, expect, it, vi } from 'vitest';
4
- import { createApp } from 'vue';
5
-
6
- type ViMock = ReturnType<typeof vi.fn>;
4
+ import eventBus from '../../../../scripts/eventBus';
5
+ import { getUserWarnings } from '../../api/UserNotifications';
6
+ import { createUserNotificationsStore } from '../userNotificationsStore';
7
7
 
8
- // Mocks for modules used by the store
9
8
  vi.mock('../../api/UserNotifications', () => {
10
9
  return {
11
10
  getUserWarnings: vi.fn(),
12
11
  };
13
12
  });
14
-
15
- vi.mock('../../../../locale/i18n', () => {
16
- return {
17
- default: {
18
- global: {
19
- t: (key: string, payload?: number) =>
20
- `${key}:${JSON.stringify(payload)}`,
21
- },
13
+ vi.mock('../../../../scripts/eventBus', () => ({
14
+ default: {
15
+ $emit: vi.fn(),
16
+ },
17
+ }));
18
+
19
+ const mockedGetUserWarnings = vi.mocked(getUserWarnings);
20
+ const STORAGE_KEY = 'usersWithShownNotifications';
21
+ const TEST_USER_ID = 'user-123';
22
+
23
+ const mockPasswordWarning = {
24
+ id: ApiUserWarningId.PasswordExpiresSoon,
25
+ warningData: {
26
+ passwordExpiry: {
27
+ daysRemaining: 3,
22
28
  },
23
- };
24
- });
25
-
26
- vi.mock('../../../../scripts/eventBus', () => {
27
- const emitMock = vi.fn();
28
- return {
29
- default: {
30
- $on: vi.fn(),
31
- $off: vi.fn(),
32
- $emit: emitMock,
29
+ },
30
+ };
31
+
32
+ const mockLicenseWarning = {
33
+ id: ApiUserWarningId.LicenseExpiresSoon,
34
+ warningData: {
35
+ licenseExpiry: {
36
+ daysRemaining: 5,
37
+ licenseName: 'Enterprise',
33
38
  },
34
- };
35
- });
36
-
37
- import eventBus from '../../../../scripts/eventBus';
38
- import { getUserWarnings } from '../../api/UserNotifications';
39
- import { USER_NOTIFICATION_CONFIGS_MAP } from '../../maps/userNotificationConfigsMap';
40
- import { createUserNotificationsStore } from '../userNotificationsStore';
41
-
42
- describe('createUserNotificationsStore', () => {
43
- let useStore: ReturnType<typeof createUserNotificationsStore>;
44
- let pinia: ReturnType<typeof createPinia>;
39
+ },
40
+ };
45
41
 
42
+ describe('userNotificationsStore', () => {
46
43
  beforeEach(() => {
44
+ setActivePinia(createPinia());
45
+ localStorage.clear();
47
46
  vi.clearAllMocks();
48
-
49
- pinia = createPinia();
50
- const app = createApp({});
51
- app.use(pinia);
52
- setActivePinia(pinia);
53
-
54
- useStore = createUserNotificationsStore();
47
+ vi.useFakeTimers();
55
48
  });
56
49
 
57
- it('fetch should call API and populate notifications', async () => {
58
- // Arrange: mock API to return warnings
59
- const notificationsResponse = {
60
- warnings: [
61
- {
62
- id: ApiUserWarningId.PasswordExpiresSoon,
63
- warningData: {
64
- passwordExpiry: {
65
- daysRemaining: 5,
66
- },
50
+ describe('showNotifications', () => {
51
+ it('does not show notifications that the user is already in storage', async () => {
52
+ localStorage.setItem(
53
+ STORAGE_KEY,
54
+ JSON.stringify([
55
+ TEST_USER_ID,
56
+ ]),
57
+ );
58
+
59
+ const useStore = createUserNotificationsStore();
60
+ const store = useStore();
61
+
62
+ await store.showNotifications(TEST_USER_ID);
63
+
64
+ expect(getUserWarnings).not.toHaveBeenCalled();
65
+ });
66
+
67
+ it('shows notifications and saves the user in storage', async () => {
68
+ mockedGetUserWarnings.mockResolvedValue({
69
+ warnings: [
70
+ mockPasswordWarning,
71
+ ],
72
+ });
73
+
74
+ const useStore = createUserNotificationsStore();
75
+ const store = useStore();
76
+
77
+ await store.showNotifications(TEST_USER_ID);
78
+ vi.runAllTimers();
79
+
80
+ expect(eventBus.$emit).toHaveBeenCalledWith(
81
+ 'notification',
82
+ expect.objectContaining({
83
+ type: 'info',
84
+ }),
85
+ );
86
+
87
+ const stored = JSON.parse(localStorage.getItem(STORAGE_KEY));
88
+ expect(stored).toContain(TEST_USER_ID);
89
+ });
90
+
91
+ it('Do not ignore API notifications by turning an empty array', async () => {
92
+ mockedGetUserWarnings.mockResolvedValue({
93
+ warnings: [],
94
+ });
95
+
96
+ const useStore = createUserNotificationsStore();
97
+ const store = useStore();
98
+
99
+ await store.showNotifications(TEST_USER_ID);
100
+ vi.runAllTimers();
101
+
102
+ expect(eventBus.$emit).not.toHaveBeenCalled();
103
+ });
104
+
105
+ it('Do not save if the id is not found in the map config', async () => {
106
+ mockedGetUserWarnings.mockResolvedValue({
107
+ warnings: [
108
+ {
109
+ id: 'unknown_warning',
110
+ warningData: {},
67
111
  },
68
- },
69
- ],
70
- };
112
+ ],
113
+ });
114
+
115
+ const useStore = createUserNotificationsStore();
116
+ const store = useStore();
117
+
118
+ await store.showNotifications(TEST_USER_ID);
119
+ vi.runAllTimers();
71
120
 
72
- (getUserWarnings as ViMock).mockResolvedValue(notificationsResponse);
121
+ expect(eventBus.$emit).not.toHaveBeenCalled();
122
+ });
73
123
 
74
- const store = useStore();
124
+ it('shows some notifications', async () => {
125
+ mockedGetUserWarnings.mockResolvedValue({
126
+ warnings: [
127
+ mockPasswordWarning,
128
+ mockLicenseWarning,
129
+ ],
130
+ });
75
131
 
76
- // Act
77
- await store.initialize();
132
+ const useStore = createUserNotificationsStore();
133
+ const store = useStore();
78
134
 
79
- // Assert
80
- expect(store.notifications.length).toBe(1);
81
- expect(store.notifications[0].days).toBe(5);
82
- expect(store.notifications[0].localeKey).toBe(
83
- USER_NOTIFICATION_CONFIGS_MAP.get(ApiUserWarningId.PasswordExpiresSoon)
84
- ?.localeKey,
85
- );
86
- expect(getUserWarnings).toHaveBeenCalledOnce();
135
+ await store.showNotifications(TEST_USER_ID);
136
+ vi.runAllTimers();
137
+
138
+ expect(eventBus.$emit).toHaveBeenCalledTimes(2);
139
+ });
87
140
  });
88
141
 
89
- it('show should emit notification for mapped warnings', async () => {
90
- const notificationsResponse = {
91
- warnings: [
92
- {
93
- id: ApiUserWarningId.PasswordExpiresSoon,
94
- warningData: {
95
- passwordExpiry: {
96
- daysRemaining: 3,
97
- },
98
- },
99
- },
100
- ],
101
- };
102
-
103
- (getUserWarnings as ViMock).mockResolvedValue(notificationsResponse);
104
-
105
- const store = useStore();
106
- await store.initialize();
107
-
108
- // Act: show should emit once
109
- store.show();
110
- expect(eventBus.$emit).toHaveBeenCalledOnce();
111
- const [[eventName, payload]] = (eventBus.$emit as ViMock).mock.calls;
112
- expect(eventName).toBe('notification');
113
- expect(payload.type).toBe('info');
114
- expect(payload.text).toContain(
115
- 'systemNotifications.warnings.passwordExpirationMessage',
116
- );
142
+ describe('clearShownUserNotifications', () => {
143
+ it('clear localStorage', async () => {
144
+ localStorage.setItem(
145
+ STORAGE_KEY,
146
+ JSON.stringify([
147
+ TEST_USER_ID,
148
+ 'user-456',
149
+ ]),
150
+ );
151
+
152
+ const useStore = createUserNotificationsStore();
153
+ const store = useStore();
154
+
155
+ store.clearShownUserNotifications(TEST_USER_ID);
156
+
157
+ const stored = JSON.parse(localStorage.getItem(STORAGE_KEY));
158
+ expect(stored).not.toContain(TEST_USER_ID);
159
+ expect(stored).toContain('user-456');
160
+ });
161
+
162
+ it('after clearShownUserNotifications notifications display again', async () => {
163
+ localStorage.setItem(
164
+ STORAGE_KEY,
165
+ JSON.stringify([
166
+ TEST_USER_ID,
167
+ ]),
168
+ );
169
+ mockedGetUserWarnings.mockResolvedValue({
170
+ warnings: [
171
+ mockPasswordWarning,
172
+ ],
173
+ });
174
+
175
+ const useStore = createUserNotificationsStore();
176
+ const store = useStore();
177
+
178
+ store.clearShownUserNotifications(TEST_USER_ID);
179
+ await store.showNotifications(TEST_USER_ID);
180
+ vi.runAllTimers();
181
+
182
+ expect(eventBus.$emit).toHaveBeenCalled();
183
+ });
117
184
  });
118
185
  });
@@ -1,74 +1,107 @@
1
1
  import type { ApiUserWarning } from '@webitel/api-services/gen/models';
2
2
  import { defineStore } from 'pinia';
3
- import { computed, ref } from 'vue';
3
+ import { ref } from 'vue';
4
4
  import i18n from '../../../locale/i18n';
5
5
  import eventBus from '../../../scripts/eventBus';
6
6
  import { getUserWarnings } from '../api/UserNotifications';
7
7
  import { USER_NOTIFICATION_CONFIGS_MAP } from '../maps/userNotificationConfigsMap';
8
- import type {
9
- NotificationsType,
10
- UserNotificationsConfigsMap,
11
- } from '../types/UserNotifications';
8
+ import type { NotificationsType } from '../types/UserNotifications';
9
+
10
+ const STORAGE_KEY = 'usersWithShownNotifications';
12
11
 
13
12
  export const createUserNotificationsStore = () => {
14
13
  const namespace = 'userNotifications';
15
14
 
16
15
  const store = defineStore(namespace, () => {
17
- const rawNotifications = ref<ApiUserWarning[]>([]);
16
+ const notifications = ref<NotificationsType[]>([]);
17
+
18
+ const getStoredUsers = (): string[] => {
19
+ const stored = localStorage.getItem(STORAGE_KEY);
20
+ return stored ? JSON.parse(stored) : [];
21
+ };
22
+
23
+ const isShownUserNotifications = (userId: string): boolean =>
24
+ getStoredUsers().includes(userId);
18
25
 
19
- const initialize = async () => {
20
- await fetch();
26
+ const setShownUserNotifications = (userId: string) => {
27
+ const shown = getStoredUsers();
28
+ localStorage.setItem(
29
+ STORAGE_KEY,
30
+ JSON.stringify([
31
+ ...new Set([
32
+ ...shown,
33
+ userId,
34
+ ]),
35
+ ]),
36
+ );
21
37
  };
22
38
 
23
- const fetch = async () => {
39
+ const clearShownUserNotifications = (userId: string) => {
40
+ const shown = getStoredUsers().filter((id: string) => id !== userId);
41
+ localStorage.setItem(STORAGE_KEY, JSON.stringify(shown));
42
+ };
43
+
44
+ const fetchNotifications = async (): Promise<ApiUserWarning[]> => {
24
45
  const response = await getUserWarnings();
25
- rawNotifications.value =
26
- (response && (response.warnings as ApiUserWarning[])) ?? [];
46
+ return (response?.warnings as ApiUserWarning[]) ?? [];
27
47
  };
28
48
 
29
- const notifications = computed<NotificationsType[]>(() => {
30
- return rawNotifications.value
31
- .map((notification) => {
32
- const config: UserNotificationsConfigsMap =
33
- USER_NOTIFICATION_CONFIGS_MAP.get(notification.id);
34
- if (!config) return null;
35
-
36
- return {
37
- type: config.type,
38
- localeKey: config.localeKey,
39
- days: config.getDays(notification.warningData),
40
- shown: false,
41
- };
49
+ const mapNotifications = (array: ApiUserWarning[]) => {
50
+ return array
51
+ .map((warning) => {
52
+ const map = USER_NOTIFICATION_CONFIGS_MAP.get(warning.id);
53
+ if (!map) return null;
54
+ return map(warning);
42
55
  })
43
56
  .filter(Boolean) as NotificationsType[];
44
- });
45
-
46
- const show = () => {
47
- notifications.value.forEach((notification) => {
48
- // @author @Lera24
49
- //notification should only be displayed the first time you visit the page
50
- if (notification.shown) return;
51
-
52
- eventBus.$emit('notification', {
53
- type: notification.type,
54
- text: i18n.global.t(
55
- `systemNotifications.warnings.${notification.localeKey}`,
56
- {
57
- days: notification.days,
58
- },
59
- ),
57
+ };
58
+
59
+ const emitNotification = ({
60
+ type,
61
+ localeKey,
62
+ params,
63
+ }: NotificationsType) => {
64
+ const locale = localStorage.getItem('lang') || i18n.global.locale.value;
65
+ setTimeout(
66
+ () =>
67
+ eventBus.$emit('notification', {
68
+ type,
69
+ text: i18n.global.t(
70
+ `systemNotifications.warnings.${localeKey}`,
71
+ {
72
+ ...params,
73
+ },
74
+ {
75
+ locale,
76
+ },
77
+ ),
78
+ }),
79
+ 100,
80
+ );
81
+ };
82
+
83
+ const showNotifications = async (userId: string) => {
84
+ try {
85
+ if (isShownUserNotifications(userId)) return;
86
+
87
+ const apiNotifications = await fetchNotifications();
88
+ notifications.value = mapNotifications(apiNotifications);
89
+
90
+ if (!notifications.value?.length) return;
91
+
92
+ notifications.value.forEach((notification) => {
93
+ emitNotification(notification);
60
94
  });
61
- notification.shown = true;
62
- });
95
+
96
+ setShownUserNotifications(userId);
97
+ } catch (err) {
98
+ throw err;
99
+ }
63
100
  };
64
101
 
65
102
  return {
66
- initialize,
67
- show,
68
-
69
- /** internal for devtools/debug */
70
- rawNotifications,
71
- notifications,
103
+ showNotifications,
104
+ clearShownUserNotifications,
72
105
  };
73
106
  });
74
107
 
@@ -1,15 +1,12 @@
1
- interface UserNotificationsConfigsMap {
2
- id: string;
3
- type: 'info' | 'warning' | 'error';
4
- localeKey: string;
5
- getDays: (warningData: number) => number;
1
+ interface UserNotificationsConfigsParams {
2
+ amount?: number;
3
+ name?: string;
6
4
  }
7
5
 
8
6
  interface NotificationsType {
9
7
  type: 'info' | 'warning' | 'error';
10
8
  localeKey: string;
11
- days: number;
12
- shown?: boolean;
9
+ params?: UserNotificationsConfigsParams;
13
10
  }
14
11
 
15
- export type { NotificationsType, UserNotificationsConfigsMap };
12
+ export type { NotificationsType, UserNotificationsConfigsParams };
@@ -37,10 +37,8 @@ export const createUserinfoStore = () => {
37
37
  const { initialize: initializeSettingsStore } = settingsStore;
38
38
  const { timezone } = storeToRefs(settingsStore);
39
39
  const userNotificationsStore = useUserNotificationsStore();
40
- const {
41
- initialize: initializeUserNotificationsStore,
42
- show: showUserNotifications,
43
- } = userNotificationsStore;
40
+ const { showNotifications, clearShownUserNotifications } =
41
+ userNotificationsStore;
44
42
 
45
43
  const userId = ref();
46
44
  const userInfo = ref();
@@ -48,7 +46,6 @@ export const createUserinfoStore = () => {
48
46
  const initialize = async () => {
49
47
  const session = await getSession();
50
48
  const access = await getUiVisibilityAccess();
51
- await initializeUserNotificationsStore();
52
49
 
53
50
  userId.value = session.userId;
54
51
  userInfo.value = pick(session, [
@@ -72,10 +69,15 @@ export const createUserinfoStore = () => {
72
69
  await initializeSettingsStore();
73
70
  };
74
71
 
72
+ const showUserNotifications = () => showNotifications(userId.value);
73
+ const clearStorageNotifications = (id?: string) =>
74
+ clearShownUserNotifications(id ?? userId.value);
75
+
75
76
  const logoutUser = async () => {
76
77
  const authUrl = import.meta.env.VITE_AUTH_URL;
77
78
  if (!authUrl) throw new Error('No authUrl for LOGOUT provided');
78
79
  await logout();
80
+ clearStorageNotifications();
79
81
  window.location.href = authUrl;
80
82
  };
81
83
 
@@ -98,6 +100,7 @@ export const createUserinfoStore = () => {
98
100
  hasApplicationVisibility,
99
101
  logoutUser,
100
102
  showUserNotifications,
103
+ clearStorageNotifications,
101
104
  };
102
105
  });
103
106
 
@@ -1 +1,3 @@
1
- export declare const USER_NOTIFICATION_CONFIGS_MAP: Map<string, UserNotificationsConfigsMap>;
1
+ import { ApiUserWarningId } from '@webitel/api-services/gen/models';
2
+ import type { NotificationsType } from '../types/UserNotifications';
3
+ export declare const USER_NOTIFICATION_CONFIGS_MAP: Map<ApiUserWarningId, (warningId: ApiUserWarningId) => NotificationsType>;
@@ -1,105 +1,10 @@
1
- import type { ApiUserWarning } from '@webitel/api-services/gen/models';
2
- import type { NotificationsType } from '../types/UserNotifications';
3
1
  export declare const createUserNotificationsStore: () => import("pinia").StoreDefinition<"userNotifications", Pick<{
4
- initialize: () => Promise<void>;
5
- show: () => void;
6
- /** internal for devtools/debug */
7
- rawNotifications: import("vue").Ref<{
8
- detail?: string;
9
- id?: import("@webitel/api-services/gen/models").ApiUserWarningId;
10
- warningData?: {
11
- licenseExpiry?: {
12
- daysRemaining?: string;
13
- expiresAt?: string;
14
- licenseName?: string;
15
- };
16
- passwordExpiry?: {
17
- daysRemaining?: string;
18
- expiresAt?: string;
19
- };
20
- };
21
- }[], ApiUserWarning[] | {
22
- detail?: string;
23
- id?: import("@webitel/api-services/gen/models").ApiUserWarningId;
24
- warningData?: {
25
- licenseExpiry?: {
26
- daysRemaining?: string;
27
- expiresAt?: string;
28
- licenseName?: string;
29
- };
30
- passwordExpiry?: {
31
- daysRemaining?: string;
32
- expiresAt?: string;
33
- };
34
- };
35
- }[]>;
36
- notifications: import("vue").ComputedRef<NotificationsType[]>;
37
- }, "rawNotifications">, Pick<{
38
- initialize: () => Promise<void>;
39
- show: () => void;
40
- /** internal for devtools/debug */
41
- rawNotifications: import("vue").Ref<{
42
- detail?: string;
43
- id?: import("@webitel/api-services/gen/models").ApiUserWarningId;
44
- warningData?: {
45
- licenseExpiry?: {
46
- daysRemaining?: string;
47
- expiresAt?: string;
48
- licenseName?: string;
49
- };
50
- passwordExpiry?: {
51
- daysRemaining?: string;
52
- expiresAt?: string;
53
- };
54
- };
55
- }[], ApiUserWarning[] | {
56
- detail?: string;
57
- id?: import("@webitel/api-services/gen/models").ApiUserWarningId;
58
- warningData?: {
59
- licenseExpiry?: {
60
- daysRemaining?: string;
61
- expiresAt?: string;
62
- licenseName?: string;
63
- };
64
- passwordExpiry?: {
65
- daysRemaining?: string;
66
- expiresAt?: string;
67
- };
68
- };
69
- }[]>;
70
- notifications: import("vue").ComputedRef<NotificationsType[]>;
71
- }, "notifications">, Pick<{
72
- initialize: () => Promise<void>;
73
- show: () => void;
74
- /** internal for devtools/debug */
75
- rawNotifications: import("vue").Ref<{
76
- detail?: string;
77
- id?: import("@webitel/api-services/gen/models").ApiUserWarningId;
78
- warningData?: {
79
- licenseExpiry?: {
80
- daysRemaining?: string;
81
- expiresAt?: string;
82
- licenseName?: string;
83
- };
84
- passwordExpiry?: {
85
- daysRemaining?: string;
86
- expiresAt?: string;
87
- };
88
- };
89
- }[], ApiUserWarning[] | {
90
- detail?: string;
91
- id?: import("@webitel/api-services/gen/models").ApiUserWarningId;
92
- warningData?: {
93
- licenseExpiry?: {
94
- daysRemaining?: string;
95
- expiresAt?: string;
96
- licenseName?: string;
97
- };
98
- passwordExpiry?: {
99
- daysRemaining?: string;
100
- expiresAt?: string;
101
- };
102
- };
103
- }[]>;
104
- notifications: import("vue").ComputedRef<NotificationsType[]>;
105
- }, "show" | "initialize">>;
2
+ showNotifications: (userId: string) => Promise<void>;
3
+ clearShownUserNotifications: (userId: string) => void;
4
+ }, never>, Pick<{
5
+ showNotifications: (userId: string) => Promise<void>;
6
+ clearShownUserNotifications: (userId: string) => void;
7
+ }, never>, Pick<{
8
+ showNotifications: (userId: string) => Promise<void>;
9
+ clearShownUserNotifications: (userId: string) => void;
10
+ }, "showNotifications" | "clearShownUserNotifications">>;
@@ -1,13 +1,10 @@
1
- interface UserNotificationsConfigsMap {
2
- id: string;
3
- type: 'info' | 'warning' | 'error';
4
- localeKey: string;
5
- getDays: (warningData: number) => number;
1
+ interface UserNotificationsConfigsParams {
2
+ amount?: number;
3
+ name?: string;
6
4
  }
7
5
  interface NotificationsType {
8
6
  type: 'info' | 'warning' | 'error';
9
7
  localeKey: string;
10
- days: number;
11
- shown?: boolean;
8
+ params?: UserNotificationsConfigsParams;
12
9
  }
13
- export type { NotificationsType, UserNotificationsConfigsMap };
10
+ export type { NotificationsType, UserNotificationsConfigsParams };
@@ -19,7 +19,8 @@ export declare const createUserinfoStore: () => import("pinia").StoreDefinition<
19
19
  hasSpecialGlobalActionAccess: (id: import("..").SpecialGlobalAction) => boolean;
20
20
  hasApplicationVisibility: (app: pick) => boolean;
21
21
  logoutUser: () => Promise<void>;
22
- showUserNotifications: () => void;
22
+ showUserNotifications: () => Promise<void>;
23
+ clearStorageNotifications: (id?: string) => void;
23
24
  }, "timezone" | "userId" | "userInfo">, Pick<{
24
25
  userId: import("vue").Ref<any, any>;
25
26
  userInfo: import("vue").Ref<any, any>;
@@ -40,7 +41,8 @@ export declare const createUserinfoStore: () => import("pinia").StoreDefinition<
40
41
  hasSpecialGlobalActionAccess: (id: import("..").SpecialGlobalAction) => boolean;
41
42
  hasApplicationVisibility: (app: pick) => boolean;
42
43
  logoutUser: () => Promise<void>;
43
- showUserNotifications: () => void;
44
+ showUserNotifications: () => Promise<void>;
45
+ clearStorageNotifications: (id?: string) => void;
44
46
  }, never>, Pick<{
45
47
  userId: import("vue").Ref<any, any>;
46
48
  userInfo: import("vue").Ref<any, any>;
@@ -61,5 +63,6 @@ export declare const createUserinfoStore: () => import("pinia").StoreDefinition<
61
63
  hasSpecialGlobalActionAccess: (id: import("..").SpecialGlobalAction) => boolean;
62
64
  hasApplicationVisibility: (app: pick) => boolean;
63
65
  logoutUser: () => Promise<void>;
64
- showUserNotifications: () => void;
65
- }, "initialize" | "hasReadAccess" | "hasCreateAccess" | "hasUpdateAccess" | "hasDeleteAccess" | "routeAccessGuard" | "hasSpecialGlobalActionAccess" | "hasGlobalCrudActionAccess" | "hasLicense" | "hasApplicationVisibility" | "hasSectionVisibility" | "logoutUser" | "showUserNotifications">>;
66
+ showUserNotifications: () => Promise<void>;
67
+ clearStorageNotifications: (id?: string) => void;
68
+ }, "initialize" | "hasReadAccess" | "hasCreateAccess" | "hasUpdateAccess" | "hasDeleteAccess" | "routeAccessGuard" | "hasSpecialGlobalActionAccess" | "hasGlobalCrudActionAccess" | "hasLicense" | "hasApplicationVisibility" | "hasSectionVisibility" | "logoutUser" | "showUserNotifications" | "clearStorageNotifications">>;