@ts-core/angular 15.0.28 → 15.0.29
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/VIModule.d.ts +3 -0
- package/esm2020/VIModule.mjs +7 -1
- package/esm2020/login/LoginTokenStorage.mjs +51 -0
- package/esm2020/public-api.mjs +2 -1
- package/esm2020/storage/StorageService.mjs +2 -2
- package/fesm2015/ts-core-angular.mjs +55 -2
- package/fesm2015/ts-core-angular.mjs.map +1 -1
- package/fesm2020/ts-core-angular.mjs +55 -2
- package/fesm2020/ts-core-angular.mjs.map +1 -1
- package/login/LoginTokenStorage.d.ts +12 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -3290,6 +3290,55 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
3290
3290
|
args: [LoginBaseService]
|
|
3291
3291
|
}] }]; } });
|
|
3292
3292
|
|
|
3293
|
+
class LoginTokenStorage extends DestroyableContainer {
|
|
3294
|
+
//--------------------------------------------------------------------------
|
|
3295
|
+
//
|
|
3296
|
+
// Constructor
|
|
3297
|
+
//
|
|
3298
|
+
//--------------------------------------------------------------------------
|
|
3299
|
+
constructor(storage, cookies) {
|
|
3300
|
+
super();
|
|
3301
|
+
this.storage = storage;
|
|
3302
|
+
this.cookies = cookies;
|
|
3303
|
+
console.log(storage.get);
|
|
3304
|
+
}
|
|
3305
|
+
//--------------------------------------------------------------------------
|
|
3306
|
+
//
|
|
3307
|
+
// Public Methods
|
|
3308
|
+
//
|
|
3309
|
+
//--------------------------------------------------------------------------
|
|
3310
|
+
get() {
|
|
3311
|
+
let value = null;
|
|
3312
|
+
try {
|
|
3313
|
+
value = this.storage.get(LoginTokenStorage.TOKEN_KEY);
|
|
3314
|
+
}
|
|
3315
|
+
catch (error) { }
|
|
3316
|
+
return !_.isNil(value) ? value : this.cookies.get(LoginTokenStorage.TOKEN_KEY);
|
|
3317
|
+
}
|
|
3318
|
+
save(value) {
|
|
3319
|
+
try {
|
|
3320
|
+
this.storage.set(LoginTokenStorage.TOKEN_KEY, value);
|
|
3321
|
+
}
|
|
3322
|
+
finally {
|
|
3323
|
+
this.cookies.put(LoginTokenStorage.TOKEN_KEY, value);
|
|
3324
|
+
}
|
|
3325
|
+
}
|
|
3326
|
+
remove() {
|
|
3327
|
+
try {
|
|
3328
|
+
this.storage.remove(LoginTokenStorage.TOKEN_KEY);
|
|
3329
|
+
}
|
|
3330
|
+
finally {
|
|
3331
|
+
this.cookies.remove(LoginTokenStorage.TOKEN_KEY);
|
|
3332
|
+
}
|
|
3333
|
+
}
|
|
3334
|
+
}
|
|
3335
|
+
//--------------------------------------------------------------------------
|
|
3336
|
+
//
|
|
3337
|
+
// Properties
|
|
3338
|
+
//
|
|
3339
|
+
//--------------------------------------------------------------------------
|
|
3340
|
+
LoginTokenStorage.TOKEN_KEY = 'sid';
|
|
3341
|
+
|
|
3293
3342
|
class MenuItemBase {
|
|
3294
3343
|
// --------------------------------------------------------------------------
|
|
3295
3344
|
//
|
|
@@ -6281,7 +6330,7 @@ class StorageService extends DestroyableContainer {
|
|
|
6281
6330
|
//
|
|
6282
6331
|
//--------------------------------------------------------------------------
|
|
6283
6332
|
get(key, defaultValue) {
|
|
6284
|
-
return this.has(key) ? this.storage.
|
|
6333
|
+
return this.has(key) ? this.storage.getItem(key) : defaultValue;
|
|
6285
6334
|
}
|
|
6286
6335
|
has(key) {
|
|
6287
6336
|
return !_.isNil(this.storage.getItem(key));
|
|
@@ -6587,6 +6636,7 @@ class VIModule {
|
|
|
6587
6636
|
{ provide: Logger, deps: [VI_ANGULAR_OPTIONS], useFactory: loggerServiceFactory },
|
|
6588
6637
|
{ provide: NativeWindowService, deps: [DOCUMENT], useFactory: nativeWindowServiceFactory },
|
|
6589
6638
|
{ provide: StorageService, deps: [NativeWindowService], useFactory: storageServiceFactory },
|
|
6639
|
+
{ provide: LoginTokenStorage, deps: [StorageService, CookieService], useFactory: loginTokenStorageServiceFactory },
|
|
6590
6640
|
...CookieModule.forRoot(options).providers,
|
|
6591
6641
|
...ThemeModule.forRoot(options ? options.themeOptions : null).providers,
|
|
6592
6642
|
...LanguageModule.forRoot(options ? options.languageOptions : null).providers
|
|
@@ -6671,6 +6721,9 @@ function nativeWindowServiceFactory(document) {
|
|
|
6671
6721
|
function storageServiceFactory(nativeWindow) {
|
|
6672
6722
|
return new StorageService(nativeWindow);
|
|
6673
6723
|
}
|
|
6724
|
+
function loginTokenStorageServiceFactory(storage, cookies) {
|
|
6725
|
+
return new LoginTokenStorage(storage, cookies);
|
|
6726
|
+
}
|
|
6674
6727
|
const VI_ANGULAR_OPTIONS = new InjectionToken(`VI_ANGULAR_OPTIONS`);
|
|
6675
6728
|
|
|
6676
6729
|
//
|
|
@@ -6679,5 +6732,5 @@ const VI_ANGULAR_OPTIONS = new InjectionToken(`VI_ANGULAR_OPTIONS`);
|
|
|
6679
6732
|
* Generated bundle index. Do not edit.
|
|
6680
6733
|
*/
|
|
6681
6734
|
|
|
6682
|
-
export { APPLICATION_INJECTOR, ApplicationBaseComponent, ApplicationComponent, AspectRatioResizeDirective, AssetBackgroundDirective, AssetBackgroundPipe, AssetFilePipe, AssetIconPipe, AssetImagePipe, AssetModule, AssetSoundPipe, AssetVideoPipe, AutoScrollBottomDirective, BottomSheetService, COOKIE_OPTIONS, CamelCasePipe, CanDeactivateGuard, ClickToCopyDirective, ClickToSelectDirective, CookieModule, CookieOptions, CookieService, Direction, FinancePipe, FocusDirective, FocusManager, FormElementAsync, FormElementSync, HTMLContentTitleDirective, HTMLTitleDirective, INotification, INotificationContent, IUser, IVIOptions, IWindow, IWindowContent, InfiniteScrollDirective, IsBrowserDirective, IsServerDirective, LANGUAGE_OPTIONS, LanguageDirective, LanguageHasDirective, LanguageModule, LanguagePipe, LanguagePipeHas, LanguagePipeHasPure, LanguagePipePure, LanguageRequireResolver, LanguageResolver, LazyModuleLoader, ListItem, ListItems, LoginBaseService, LoginBaseServiceEvent, LoginGuard, LoginIfCanGuard, LoginNotGuard, LoginRequireResolver, LoginResolver, MenuItem, MenuItemBase, MenuItems, MessageBaseComponent, MomentDateAdaptivePipe, MomentDateFromNowPipe, MomentDatePipe, MomentTimePipe, NavigationMenuItem, NgModelErrorPipe, NotificationConfig, NotificationEvent, NotificationService, NotificationServiceEvent, PipeBaseService, PlatformService, PrettifyPipe, QuestionEvent, QuestionManager, QuestionMode, ResizeDirective, ResizeManager, RouterBaseService, SanitizePipe, ScrollCheckDirective, ScrollDirective, SelectListItem, SelectListItems, SelectOnFocusDirective, StartCasePipe, StorageService, THEME_OPTIONS, ThemeAssetBackgroundDirective, ThemeAssetDirective, ThemeAssetIconDirective, ThemeAssetImageDirective, ThemeModule, ThemeStyleDirective, ThemeStyleHoverDirective, ThemeToggleDirective, TimePipe, TransportLazy, TransportLazyModule, TransportLazyModuleLoadedEvent, TruncatePipe, UserBaseService, UserBaseServiceEvent, VIModule, VI_ANGULAR_OPTIONS, ViewUtil, WINDOW_CONTENT_CONTAINER, WindowAlign, WindowBase, WindowClosedError, WindowConfig, WindowEvent, WindowService, WindowServiceEvent, cookieServiceFactory, initializerFactory, languageServiceFactory, loggerServiceFactory, nativeWindowServiceFactory, storageServiceFactory, themeAssetServiceFactory, themeServiceFactory };
|
|
6735
|
+
export { APPLICATION_INJECTOR, ApplicationBaseComponent, ApplicationComponent, AspectRatioResizeDirective, AssetBackgroundDirective, AssetBackgroundPipe, AssetFilePipe, AssetIconPipe, AssetImagePipe, AssetModule, AssetSoundPipe, AssetVideoPipe, AutoScrollBottomDirective, BottomSheetService, COOKIE_OPTIONS, CamelCasePipe, CanDeactivateGuard, ClickToCopyDirective, ClickToSelectDirective, CookieModule, CookieOptions, CookieService, Direction, FinancePipe, FocusDirective, FocusManager, FormElementAsync, FormElementSync, HTMLContentTitleDirective, HTMLTitleDirective, INotification, INotificationContent, IUser, IVIOptions, IWindow, IWindowContent, InfiniteScrollDirective, IsBrowserDirective, IsServerDirective, LANGUAGE_OPTIONS, LanguageDirective, LanguageHasDirective, LanguageModule, LanguagePipe, LanguagePipeHas, LanguagePipeHasPure, LanguagePipePure, LanguageRequireResolver, LanguageResolver, LazyModuleLoader, ListItem, ListItems, LoginBaseService, LoginBaseServiceEvent, LoginGuard, LoginIfCanGuard, LoginNotGuard, LoginRequireResolver, LoginResolver, LoginTokenStorage, MenuItem, MenuItemBase, MenuItems, MessageBaseComponent, MomentDateAdaptivePipe, MomentDateFromNowPipe, MomentDatePipe, MomentTimePipe, NavigationMenuItem, NgModelErrorPipe, NotificationConfig, NotificationEvent, NotificationService, NotificationServiceEvent, PipeBaseService, PlatformService, PrettifyPipe, QuestionEvent, QuestionManager, QuestionMode, ResizeDirective, ResizeManager, RouterBaseService, SanitizePipe, ScrollCheckDirective, ScrollDirective, SelectListItem, SelectListItems, SelectOnFocusDirective, StartCasePipe, StorageService, THEME_OPTIONS, ThemeAssetBackgroundDirective, ThemeAssetDirective, ThemeAssetIconDirective, ThemeAssetImageDirective, ThemeModule, ThemeStyleDirective, ThemeStyleHoverDirective, ThemeToggleDirective, TimePipe, TransportLazy, TransportLazyModule, TransportLazyModuleLoadedEvent, TruncatePipe, UserBaseService, UserBaseServiceEvent, VIModule, VI_ANGULAR_OPTIONS, ViewUtil, WINDOW_CONTENT_CONTAINER, WindowAlign, WindowBase, WindowClosedError, WindowConfig, WindowEvent, WindowService, WindowServiceEvent, cookieServiceFactory, initializerFactory, languageServiceFactory, loggerServiceFactory, loginTokenStorageServiceFactory, nativeWindowServiceFactory, storageServiceFactory, themeAssetServiceFactory, themeServiceFactory };
|
|
6683
6736
|
//# sourceMappingURL=ts-core-angular.mjs.map
|