@kuzntsv/uikit 1.0.25 → 1.0.27

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.
@@ -1,207 +1,192 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken } from '@angular/core';
3
- import { HttpContextToken } from '@angular/common/http';
4
- import * as rxjs from 'rxjs';
5
- import { Observable } from 'rxjs';
6
-
7
- interface UikitConfig {
8
- apiUrls: {
9
- default: string;
10
- auth: string;
11
- [key: string]: string;
12
- };
13
- auth: {
14
- disabled?: boolean;
15
- userStorageKey: string;
16
- tokenRoute: string;
17
- loginRoute: string;
18
- publicUrls: string[];
19
- };
1
+ import * as i0 from "@angular/core";
2
+ import { InjectionToken } from "@angular/core";
3
+ import { HttpContextToken } from "@angular/common/http";
4
+ import { Observable } from "rxjs";
5
+ export interface UikitConfig {
6
+ apiUrls: {
7
+ default: string;
8
+ auth: string;
9
+ [key: string]: string;
10
+ };
11
+ auth: {
12
+ disabled?: boolean;
13
+ userStorageKey: string;
14
+ tokenRoute: string;
15
+ loginRoute: string;
16
+ publicUrls: string[];
17
+ };
20
18
  }
21
- declare const UIKIT_CONFIG: InjectionToken<UikitConfig>;
22
-
19
+ export declare const UIKIT_CONFIG: InjectionToken<UikitConfig>;
23
20
  /**
24
21
  * Специальный маркер-роль в массиве ограничений,
25
22
  * который полностью скрывает элемент от обычных пользователей.
26
23
  */
27
- declare const HIDE_ROLE_MARKER = "HIDE";
24
+ export declare const HIDE_ROLE_MARKER = "HIDE";
28
25
  /**
29
26
  * Системная роль Администратора, которая игнорирует любые ограничения прав.
30
27
  */
31
- declare const ADMIN_ROLE = "ADMIN";
32
-
33
- declare const API_NAME: HttpContextToken<string>;
34
- declare const BYPASS_AUTH: HttpContextToken<boolean>;
35
- declare const DEFAULT_TIMEOUT: InjectionToken<number>;
36
- declare const REQUEST_TIMEOUT: HttpContextToken<number>;
37
-
38
- interface AppEnvironment {
39
- appVersion: string;
40
- production: boolean;
41
- apiUrls: {
42
- default: string;
43
- auth: string;
44
- [key: string]: string;
45
- };
28
+ export declare const ADMIN_ROLE = "ADMIN";
29
+ export declare const API_NAME: HttpContextToken<string>;
30
+ export declare const BYPASS_AUTH: HttpContextToken<boolean>;
31
+ export declare const DEFAULT_TIMEOUT: InjectionToken<number>;
32
+ export declare const REQUEST_TIMEOUT: HttpContextToken<number>;
33
+ export interface AppEnvironment {
34
+ appVersion: string;
35
+ production: boolean;
36
+ apiUrls: {
37
+ default: string;
38
+ auth: string;
39
+ [key: string]: string;
40
+ };
46
41
  }
47
- declare const APP_ENVIRONMENT: InjectionToken<AppEnvironment>;
48
-
42
+ export declare const APP_ENVIRONMENT: InjectionToken<AppEnvironment>;
49
43
  /**
50
- * Сервис уведомлений.
44
+ * Сервис уведомлений.
45
+ */
46
+ export interface INotificationService {
47
+ /**
48
+ * Показ всплывашки с сообщением.
49
+ *
50
+ * @param message сообщение.
51
+ * @param duration задержка в миллисекундах.
52
+ */
53
+ openSnackBar(message: string, action: string, duration?: number): void;
54
+ /**
55
+ * Уведомление о успехе.
56
+ *
57
+ * @param message сообщение
58
+ * @param duration задержка в миллисекундах
59
+ */
60
+ success(message: string, duration?: number): void;
61
+ /**
62
+ * Уведомление о информации.
63
+ *
64
+ * @param message сообщение.
65
+ * @param duration задержка в миллисекундах.
66
+ */
67
+ info(message: string, duration?: number): void;
68
+ /**
69
+ * Уведомление о сообщения помощи.
70
+ *
71
+ * @param message сообщение.
72
+ * @param duration задержка в миллисекундах.
51
73
  */
52
- interface INotificationService {
53
- /**
54
- * Показ всплывашки с сообщением.
55
- *
56
- * @param message сообщение.
57
- * @param duration задержка в миллисекундах.
58
- */
59
- openSnackBar(message: string, action: string, duration?: number): void;
60
- /**
61
- * Уведомление о успехе.
62
- *
63
- * @param message сообщение
64
- * @param duration задержка в миллисекундах
65
- */
66
- success(message: string, duration?: number): void;
67
- /**
68
- * Уведомление о информации.
69
- *
70
- * @param message сообщение.
71
- * @param duration задержка в миллисекундах.
72
- */
73
- info(message: string, duration?: number): void;
74
- /**
75
- * Уведомление о сообщения помощи.
76
- *
77
- * @param message сообщение.
78
- * @param duration задержка в миллисекундах.
79
- */
80
- helper(message: string, duration?: number): void;
81
- /**
82
- * Уведомление о предупреждении.
83
- *
84
- * @param message сообщение.
85
- * @param duration задержка в миллисекундах.
86
- */
87
- warning(message: string, duration?: number): void;
88
- /**
89
- * Уведомление об ошибке.
90
- *
91
- * @param message сообщение.
92
- * @param duration задержка в миллисекундах.
93
- */
94
- error(message: string, duration?: number): void;
74
+ helper(message: string, duration?: number): void;
75
+ /**
76
+ * Уведомление о предупреждении.
77
+ *
78
+ * @param message сообщение.
79
+ * @param duration задержка в миллисекундах.
80
+ */
81
+ warning(message: string, duration?: number): void;
82
+ /**
83
+ * Уведомление об ошибке.
84
+ *
85
+ * @param message сообщение.
86
+ * @param duration задержка в миллисекундах.
87
+ */
88
+ error(message: string, duration?: number): void;
95
89
  }
96
- declare const UIKIT_NOTIFICATION_TOKEN: InjectionToken<INotificationService>;
97
-
98
- declare class AuthEventService {
99
- private readonly authErrorSource;
100
- readonly authError$: rxjs.Observable<void>;
101
- /** Вызывается в интерцепторе при 401 ошибке */
102
- notify401(): void;
103
- static ɵfac: i0.ɵɵFactoryDeclaration<AuthEventService, never>;
104
- static ɵprov: i0.ɵɵInjectableDeclaration<AuthEventService>;
90
+ export declare const UIKIT_NOTIFICATION_TOKEN: InjectionToken<INotificationService>;
91
+ export declare class AuthEventService {
92
+ private readonly authErrorSource;
93
+ readonly authError$: import("rxjs").Observable<void>;
94
+ /** Вызывается в интерцепторе при 401 ошибке */
95
+ notify401(): void;
96
+ static ɵfac: i0.ɵɵFactoryDeclaration<AuthEventService, never>;
97
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
105
98
  }
106
-
107
- declare class RoleService {
108
- private readonly authService;
109
- /**
110
- * Проверяет, заблокирован ли доступ к элементу на основе списка ограничений.
111
- * Возвращает true, если у пользователя есть запрещенная роль или передан маркер 'HIDE'.
112
- * Администратор (ADMIN) всегда игнорирует любые запреты и маркер 'HIDE'.
113
- */
114
- hasForbiddenRole(forbiddenRoles: string[]): boolean;
115
- /**
99
+ export declare class RoleService {
100
+ private readonly authService;
101
+ /**
102
+ * Проверяет, заблокирован ли доступ к элементу на основе списка ограничений.
103
+ * Возвращает true, если у пользователя есть запрещенная роль или передан маркер 'HIDE'.
104
+ * Администратор (ADMIN) всегда игнорирует любые запреты и маркер 'HIDE'.
105
+ */
106
+ hasForbiddenRole(forbiddenRoles: string[]): boolean;
107
+ /**
116
108
  * Проверяет, есть ли у пользователя хотя бы одна из разрешенных ролей.
117
109
  * ADMIN всегда возвращает true.
118
110
  */
119
- hasAnyRole(allowedRoles: string[]): boolean;
120
- static ɵfac: i0.ɵɵFactoryDeclaration<RoleService, never>;
121
- static ɵprov: i0.ɵɵInjectableDeclaration<RoleService>;
111
+ hasAnyRole(allowedRoles: string[]): boolean;
112
+ static ɵfac: i0.ɵɵFactoryDeclaration<RoleService, never>;
113
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
122
114
  }
123
-
124
115
  /**
125
116
  * Сущность пользователя из API
126
117
  */
127
- declare class User {
128
- id: number;
129
- username: string;
130
- firstName: string;
131
- lastName: string;
132
- prof: string;
133
- depart: number;
134
- area: string;
135
- tabnum: string;
136
- mail: string;
137
- phone: string;
138
- roles: string;
139
- rolesArray: string[];
140
- roleList: string[];
141
- idHuman: string;
142
- token: string;
143
- expires_in: number;
118
+ export declare class User {
119
+ id: number;
120
+ username: string;
121
+ firstName: string;
122
+ lastName: string;
123
+ prof: string;
124
+ depart: number;
125
+ area: string;
126
+ tabnum: string;
127
+ mail: string;
128
+ phone: string;
129
+ roles: string;
130
+ rolesArray: string[];
131
+ roleList: string[];
132
+ idHuman: string;
133
+ token: string;
134
+ expires_in: number;
144
135
  }
145
- declare class UserService {
146
- private user;
147
- private config;
148
- constructor();
149
- get dept(): number;
150
- /** Получить данные о пользователе */
151
- get userData(): User;
152
- /** Изменить данные пользователя в localStorage */
153
- set userData(user: User);
154
- /** Удаляет данные о пользователе из localStorage. */
155
- removeUser(): void;
156
- static ɵfac: i0.ɵɵFactoryDeclaration<UserService, never>;
157
- static ɵprov: i0.ɵɵInjectableDeclaration<UserService>;
136
+ export declare class UserService {
137
+ private user;
138
+ private config;
139
+ constructor();
140
+ get dept(): number;
141
+ /** Получить данные о пользователе */
142
+ get userData(): User;
143
+ /** Изменить данные пользователя в localStorage */
144
+ set userData(user: User);
145
+ /** Удаляет данные о пользователе из localStorage. */
146
+ removeUser(): void;
147
+ static ɵfac: i0.ɵɵFactoryDeclaration<UserService, never>;
148
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
158
149
  }
159
-
160
- declare class AuthService {
161
- private readonly _roles;
162
- private readonly _loggedIn;
163
- readonly roles: i0.Signal<string[]>;
164
- readonly loggedIn: i0.Signal<boolean>;
165
- private readonly defaultOptions;
166
- private readonly notificationService;
167
- private readonly userService;
168
- private readonly eventService;
169
- private readonly destroyRef;
170
- private readonly http;
171
- private readonly config;
172
- private readonly router;
173
- constructor();
174
- /**
175
- * Запрос авторизации
176
- * Возвращает Observable, позволяя компоненту реагировать на статус запроса.
177
- */
178
- login(username: string, password: string, idCas: number): Observable<User>;
179
- /** Aвторизация по пропуску */
180
- loginByPermit(permit: string, idCas: number): Observable<User>;
181
- logout(): void;
182
- /** При успешной авторизации */
183
- private successLoginAction;
184
- static ɵfac: i0.ɵɵFactoryDeclaration<AuthService, never>;
185
- static ɵprov: i0.ɵɵInjectableDeclaration<AuthService>;
150
+ export declare class AuthService {
151
+ private readonly _roles;
152
+ private readonly _loggedIn;
153
+ readonly roles: import("@angular/core").Signal<string[]>;
154
+ readonly loggedIn: import("@angular/core").Signal<boolean>;
155
+ private readonly defaultOptions;
156
+ private readonly notificationService;
157
+ private readonly userService;
158
+ private readonly eventService;
159
+ private readonly destroyRef;
160
+ private readonly http;
161
+ private readonly config;
162
+ private readonly router;
163
+ constructor();
164
+ /**
165
+ * Запрос авторизации
166
+ * Возвращает Observable, позволяя компоненту реагировать на статус запроса.
167
+ */
168
+ login(username: string, password: string, idCas: number): Observable<User>;
169
+ /** Aвторизация по пропуску */
170
+ loginByPermit(permit: string, idCas: number): Observable<User>;
171
+ logout(): void;
172
+ /** При успешной авторизации */
173
+ private successLoginAction;
174
+ static ɵfac: i0.ɵɵFactoryDeclaration<AuthService, never>;
175
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
186
176
  }
187
-
188
- declare class NotificationService implements INotificationService {
189
- private readonly duration;
190
- private readonly _snackBar;
191
- openSnackBar(message: string, action: string, duration?: number): void;
192
- success(message: string, duration?: number): void;
193
- info(message: string, duration?: number): void;
194
- helper(message: string, duration?: number): void;
195
- warning(message: string, duration?: number): void;
196
- error(message: string, duration?: number): void;
197
- static ɵfac: i0.ɵɵFactoryDeclaration<NotificationService, never>;
198
- static ɵprov: i0.ɵɵInjectableDeclaration<NotificationService>;
177
+ export declare class NotificationService implements INotificationService {
178
+ private readonly duration;
179
+ private readonly _snackBar;
180
+ openSnackBar(message: string, action: string, duration?: number): void;
181
+ success(message: string, duration?: number): void;
182
+ info(message: string, duration?: number): void;
183
+ helper(message: string, duration?: number): void;
184
+ warning(message: string, duration?: number): void;
185
+ error(message: string, duration?: number): void;
186
+ static ɵfac: i0.ɵɵFactoryDeclaration<NotificationService, never>;
187
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
199
188
  }
200
-
201
189
  /**
202
190
  * Проверяет, пересекаются ли два массива (есть ли хотя бы один общий элемент).
203
191
  */
204
- declare function hasArrayIntersection<T>(arrayA: T[], arrayB: T[]): boolean;
205
-
206
- export { ADMIN_ROLE, API_NAME, APP_ENVIRONMENT, AuthEventService, AuthService, BYPASS_AUTH, DEFAULT_TIMEOUT, HIDE_ROLE_MARKER, NotificationService, REQUEST_TIMEOUT, RoleService, UIKIT_CONFIG, UIKIT_NOTIFICATION_TOKEN, User, UserService, hasArrayIntersection };
207
- export type { AppEnvironment, INotificationService, UikitConfig };
192
+ export declare function hasArrayIntersection<T>(arrayA: T[], arrayB: T[]): boolean;