oip-common 0.2.1 → 0.2.2
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/assets/i18n/app-modules.en.json +23 -23
- package/assets/i18n/app-modules.ru.json +23 -23
- package/fesm2022/oip-common.mjs +412 -79
- package/fesm2022/oip-common.mjs.map +1 -1
- package/index.d.ts +51 -28
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -190,6 +190,7 @@ interface LanguageDto {
|
|
|
190
190
|
*/
|
|
191
191
|
declare class L10nService {
|
|
192
192
|
private loadedTranslations;
|
|
193
|
+
private loadingTranslations;
|
|
193
194
|
private httpClient;
|
|
194
195
|
private translateService;
|
|
195
196
|
private readonly primeNg;
|
|
@@ -199,12 +200,12 @@ declare class L10nService {
|
|
|
199
200
|
* Loads translations for a specific component
|
|
200
201
|
* @param component - Name of the component to load translations for
|
|
201
202
|
*/
|
|
202
|
-
loadComponentTranslations(component: string):
|
|
203
|
+
loadComponentTranslations(component: string): Observable<unknown>;
|
|
203
204
|
/**
|
|
204
205
|
* Gets the translated value of a key (or an array of keys)
|
|
205
206
|
* @returns the translated key, or an object of translated keys
|
|
206
207
|
*/
|
|
207
|
-
get(key: string):
|
|
208
|
+
get(key: string): Observable<any>;
|
|
208
209
|
/**
|
|
209
210
|
* Internal method to load translations from JSON files
|
|
210
211
|
* @param component - Component or translation namespace
|
|
@@ -241,6 +242,9 @@ declare class SecurityDataService extends BaseDataService {
|
|
|
241
242
|
static ɵprov: i0.ɵɵInjectableDeclaration<SecurityDataService>;
|
|
242
243
|
}
|
|
243
244
|
|
|
245
|
+
type RefreshCustomParams = {
|
|
246
|
+
[key: string]: string | number | boolean;
|
|
247
|
+
};
|
|
244
248
|
declare abstract class SecurityService {
|
|
245
249
|
abstract auth(): void;
|
|
246
250
|
abstract logout(): void;
|
|
@@ -249,7 +253,7 @@ declare abstract class SecurityService {
|
|
|
249
253
|
abstract isTokenExpired(): Observable<boolean>;
|
|
250
254
|
abstract getCurrentUser(): any;
|
|
251
255
|
abstract getCurrentUser$(): Observable<any>;
|
|
252
|
-
abstract forceRefreshSession(): Observable<LoginResponse>;
|
|
256
|
+
abstract forceRefreshSession(customParams?: RefreshCustomParams, configId?: string): Observable<LoginResponse>;
|
|
253
257
|
abstract isAdmin(): boolean;
|
|
254
258
|
abstract authorize(configId?: string, authOptions?: AuthOptions): void;
|
|
255
259
|
abstract payload: BehaviorSubject<any>;
|
|
@@ -262,6 +266,12 @@ declare abstract class SecurityService {
|
|
|
262
266
|
* determining user roles, and performing logout and refresh operations.
|
|
263
267
|
*/
|
|
264
268
|
declare class KeycloakSecurityService extends OidcSecurityService implements OnDestroy, SecurityService {
|
|
269
|
+
private readonly refreshLockKeyPrefix;
|
|
270
|
+
private readonly refreshResultKeyPrefix;
|
|
271
|
+
private readonly refreshLockTtlMs;
|
|
272
|
+
private readonly refreshWaitTimeoutMs;
|
|
273
|
+
private readonly refreshTabId;
|
|
274
|
+
private refreshSession$?;
|
|
265
275
|
/**
|
|
266
276
|
* Handles angular OIDC events.
|
|
267
277
|
*/
|
|
@@ -295,6 +305,7 @@ declare class KeycloakSecurityService extends OidcSecurityService implements OnD
|
|
|
295
305
|
* @returns A string with the id token.
|
|
296
306
|
*/
|
|
297
307
|
getAccessToken(configId?: string): Observable<string>;
|
|
308
|
+
forceRefreshSession(customParams?: RefreshCustomParams, configId?: string): Observable<LoginResponse>;
|
|
298
309
|
/**
|
|
299
310
|
* Indicates whether the current user has the 'admin' role.
|
|
300
311
|
*
|
|
@@ -323,6 +334,23 @@ declare class KeycloakSecurityService extends OidcSecurityService implements OnD
|
|
|
323
334
|
* @returns {Observable<boolean>} Observable that emits true if the token is expired.
|
|
324
335
|
*/
|
|
325
336
|
isTokenExpired(): Observable<boolean>;
|
|
337
|
+
private runSynchronizedRefresh;
|
|
338
|
+
private runSynchronizedRefreshWithStorageLock;
|
|
339
|
+
private refreshAsLockOwner;
|
|
340
|
+
private syncAuthState;
|
|
341
|
+
private applyLoginResponse;
|
|
342
|
+
private isCurrentAccessTokenExpired;
|
|
343
|
+
private tryAcquireRefreshLock;
|
|
344
|
+
private releaseRefreshLock;
|
|
345
|
+
private waitForRefreshResult;
|
|
346
|
+
private tryResolveRefreshResult;
|
|
347
|
+
private publishRefreshResult;
|
|
348
|
+
private readRefreshLock;
|
|
349
|
+
private readRefreshResult;
|
|
350
|
+
private getRefreshLockKey;
|
|
351
|
+
private getRefreshResultKey;
|
|
352
|
+
private getWebLocks;
|
|
353
|
+
private createRefreshTabId;
|
|
326
354
|
static ɵfac: i0.ɵɵFactoryDeclaration<KeycloakSecurityService, never>;
|
|
327
355
|
static ɵprov: i0.ɵɵInjectableDeclaration<KeycloakSecurityService>;
|
|
328
356
|
}
|
|
@@ -785,15 +813,22 @@ declare class MenuApi<SecurityDataType = unknown> extends HttpClient<SecurityDat
|
|
|
785
813
|
static ɵprov: i0.ɵɵInjectableDeclaration<MenuApi<any>>;
|
|
786
814
|
}
|
|
787
815
|
|
|
816
|
+
type PrimeIconOption$1 = {
|
|
817
|
+
label: string;
|
|
818
|
+
value: string;
|
|
819
|
+
};
|
|
788
820
|
declare class MenuItemCreateDialogComponent implements OnInit {
|
|
789
821
|
protected readonly menuService: MenuService;
|
|
790
822
|
protected readonly menu: MenuApi<any>;
|
|
823
|
+
private readonly msgService;
|
|
791
824
|
visible: boolean;
|
|
792
825
|
visibleChange: EventEmitter<boolean>;
|
|
793
826
|
modules: IntKeyValueDto[];
|
|
827
|
+
iconOptions: PrimeIconOption$1[];
|
|
794
828
|
selectModule: any;
|
|
795
829
|
label: string;
|
|
796
830
|
selectIcon: string;
|
|
831
|
+
saving: boolean;
|
|
797
832
|
ngOnInit(): Promise<void>;
|
|
798
833
|
changeVisible(): void;
|
|
799
834
|
save(): Promise<void>;
|
|
@@ -803,14 +838,21 @@ declare class MenuItemCreateDialogComponent implements OnInit {
|
|
|
803
838
|
static ɵcmp: i0.ɵɵComponentDeclaration<MenuItemCreateDialogComponent, "menu-item-create-dialog", never, { "visible": { "alias": "visible"; "required": false; }; }, { "visibleChange": "visibleChange"; }, never, never, true, never>;
|
|
804
839
|
}
|
|
805
840
|
|
|
841
|
+
type PrimeIconOption = {
|
|
842
|
+
label: string;
|
|
843
|
+
value: string;
|
|
844
|
+
};
|
|
806
845
|
declare class MenuItemEditDialogComponent {
|
|
807
846
|
private readonly menuService;
|
|
808
847
|
private readonly securityDataService;
|
|
848
|
+
private readonly msgService;
|
|
809
849
|
visible: boolean;
|
|
810
850
|
visibleChange: EventEmitter<boolean>;
|
|
811
851
|
modules: any[];
|
|
812
852
|
roles: string[];
|
|
853
|
+
iconOptions: PrimeIconOption[];
|
|
813
854
|
item: EditModuleInstanceDto;
|
|
855
|
+
saving: boolean;
|
|
814
856
|
changeVisible(): void;
|
|
815
857
|
save(): Promise<void>;
|
|
816
858
|
hide(): void;
|
|
@@ -897,7 +939,7 @@ declare class ProfileComponent {
|
|
|
897
939
|
static ɵcmp: i0.ɵɵComponentDeclaration<ProfileComponent, "user-profile", never, {}, {}, never, never, true, never>;
|
|
898
940
|
}
|
|
899
941
|
|
|
900
|
-
interface L10n
|
|
942
|
+
interface L10n {
|
|
901
943
|
menu: string;
|
|
902
944
|
all: string;
|
|
903
945
|
profile: string;
|
|
@@ -914,7 +956,7 @@ declare class ConfigComponent {
|
|
|
914
956
|
protected readonly userService: UserService;
|
|
915
957
|
protected readonly securityService: SecurityService;
|
|
916
958
|
protected readonly menuService: MenuService;
|
|
917
|
-
protected l10n: L10n
|
|
959
|
+
protected l10n: L10n;
|
|
918
960
|
protected readonly dateFormats: string[];
|
|
919
961
|
protected readonly timeFormats: string[];
|
|
920
962
|
protected readonly allTimeZones: any[];
|
|
@@ -955,39 +997,20 @@ declare class DbMigrationComponent extends BaseModuleComponent<NoSettingsDto, No
|
|
|
955
997
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbMigrationComponent, "db-migration", never, {}, {}, never, never, true, never>;
|
|
956
998
|
}
|
|
957
999
|
|
|
958
|
-
interface L10n {
|
|
959
|
-
confirm: {
|
|
960
|
-
header: string;
|
|
961
|
-
message: string;
|
|
962
|
-
cancel: string;
|
|
963
|
-
delete: string;
|
|
964
|
-
};
|
|
965
|
-
title: string;
|
|
966
|
-
messages: {
|
|
967
|
-
deleteSuccess: string;
|
|
968
|
-
};
|
|
969
|
-
table: {
|
|
970
|
-
deleteTooltip: string;
|
|
971
|
-
currentlyLoaded: string;
|
|
972
|
-
yes: string;
|
|
973
|
-
no: string;
|
|
974
|
-
name: string;
|
|
975
|
-
moduleId: string;
|
|
976
|
-
};
|
|
977
|
-
refreshTooltip: string;
|
|
978
|
-
}
|
|
979
1000
|
declare class AppModulesComponent implements OnInit {
|
|
980
1001
|
protected dataService: BaseDataService;
|
|
981
1002
|
protected modules: ModuleDto[];
|
|
982
1003
|
protected msgService: MsgService;
|
|
983
1004
|
protected confirmationService: ConfirmationService;
|
|
984
1005
|
protected l10nService: L10nService;
|
|
985
|
-
protected l10n: L10n;
|
|
986
1006
|
protected titleService: AppTitleService;
|
|
987
1007
|
private moduleService;
|
|
1008
|
+
private translationsReady;
|
|
1009
|
+
constructor();
|
|
988
1010
|
ngOnInit(): Promise<void>;
|
|
989
1011
|
refreshAction(): Promise<void>;
|
|
990
|
-
deleteModule(module: ModuleDto): void
|
|
1012
|
+
deleteModule(module: ModuleDto): Promise<void>;
|
|
1013
|
+
t(key: string): any;
|
|
991
1014
|
static ɵfac: i0.ɵɵFactoryDeclaration<AppModulesComponent, never>;
|
|
992
1015
|
static ɵcmp: i0.ɵɵComponentDeclaration<AppModulesComponent, "app-modules", never, {}, {}, never, never, true, never>;
|
|
993
1016
|
}
|