@ts-core/angular 15.0.28 → 15.0.30

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.
@@ -3290,6 +3290,62 @@ 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
+ }
3304
+ //--------------------------------------------------------------------------
3305
+ //
3306
+ // Public Methods
3307
+ //
3308
+ //--------------------------------------------------------------------------
3309
+ get() {
3310
+ let value = null;
3311
+ try {
3312
+ value = this.storage.get(LoginTokenStorage.TOKEN_KEY);
3313
+ }
3314
+ catch (error) { }
3315
+ return !_.isNil(value) ? value : this.cookies.get(LoginTokenStorage.TOKEN_KEY);
3316
+ }
3317
+ save(value) {
3318
+ try {
3319
+ this.storage.set(LoginTokenStorage.TOKEN_KEY, value);
3320
+ }
3321
+ finally {
3322
+ this.cookies.put(LoginTokenStorage.TOKEN_KEY, value);
3323
+ }
3324
+ }
3325
+ remove() {
3326
+ try {
3327
+ this.storage.remove(LoginTokenStorage.TOKEN_KEY);
3328
+ }
3329
+ finally {
3330
+ this.cookies.remove(LoginTokenStorage.TOKEN_KEY);
3331
+ }
3332
+ }
3333
+ destroy() {
3334
+ if (this.isDestroyed) {
3335
+ return;
3336
+ }
3337
+ super.destroy();
3338
+ this.storage = null;
3339
+ this.cookies = null;
3340
+ }
3341
+ }
3342
+ //--------------------------------------------------------------------------
3343
+ //
3344
+ // Properties
3345
+ //
3346
+ //--------------------------------------------------------------------------
3347
+ LoginTokenStorage.TOKEN_KEY = 'sid';
3348
+
3293
3349
  class MenuItemBase {
3294
3350
  // --------------------------------------------------------------------------
3295
3351
  //
@@ -6281,7 +6337,7 @@ class StorageService extends DestroyableContainer {
6281
6337
  //
6282
6338
  //--------------------------------------------------------------------------
6283
6339
  get(key, defaultValue) {
6284
- return this.has(key) ? this.storage.get(key) : defaultValue;
6340
+ return this.has(key) ? this.storage.getItem(key) : defaultValue;
6285
6341
  }
6286
6342
  has(key) {
6287
6343
  return !_.isNil(this.storage.getItem(key));
@@ -6587,6 +6643,7 @@ class VIModule {
6587
6643
  { provide: Logger, deps: [VI_ANGULAR_OPTIONS], useFactory: loggerServiceFactory },
6588
6644
  { provide: NativeWindowService, deps: [DOCUMENT], useFactory: nativeWindowServiceFactory },
6589
6645
  { provide: StorageService, deps: [NativeWindowService], useFactory: storageServiceFactory },
6646
+ { provide: LoginTokenStorage, deps: [StorageService, CookieService], useFactory: loginTokenStorageServiceFactory },
6590
6647
  ...CookieModule.forRoot(options).providers,
6591
6648
  ...ThemeModule.forRoot(options ? options.themeOptions : null).providers,
6592
6649
  ...LanguageModule.forRoot(options ? options.languageOptions : null).providers
@@ -6671,6 +6728,9 @@ function nativeWindowServiceFactory(document) {
6671
6728
  function storageServiceFactory(nativeWindow) {
6672
6729
  return new StorageService(nativeWindow);
6673
6730
  }
6731
+ function loginTokenStorageServiceFactory(storage, cookies) {
6732
+ return new LoginTokenStorage(storage, cookies);
6733
+ }
6674
6734
  const VI_ANGULAR_OPTIONS = new InjectionToken(`VI_ANGULAR_OPTIONS`);
6675
6735
 
6676
6736
  //
@@ -6679,5 +6739,5 @@ const VI_ANGULAR_OPTIONS = new InjectionToken(`VI_ANGULAR_OPTIONS`);
6679
6739
  * Generated bundle index. Do not edit.
6680
6740
  */
6681
6741
 
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 };
6742
+ 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
6743
  //# sourceMappingURL=ts-core-angular.mjs.map