@osovitny/anatoly 3.20.17 → 3.20.19

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,9 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, EventEmitter, Component, Output, Input, Inject, Pipe, NgModule, Directive, ChangeDetectionStrategy, ViewChild, ViewEncapsulation, HostListener, HostBinding, provideAppInitializer, inject, APP_INITIALIZER } from '@angular/core';
2
+ import { Injectable, EventEmitter, Component, Output, Input, Inject, Pipe, NgModule, Directive, ChangeDetectionStrategy, ViewChild, ViewEncapsulation, HostListener, HostBinding, provideAppInitializer, inject } from '@angular/core';
3
3
  import { BehaviorSubject, forkJoin, Subject, filter, takeUntil, map as map$1, catchError, of, merge, timer, fromEvent, firstValueFrom, lastValueFrom } from 'rxjs';
4
4
  import { map, tap, mergeMap } from 'rxjs/operators';
5
5
  import * as i1 from '@angular/common/http';
6
- import { HttpResponse, HttpClient, provideHttpClient, HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
6
+ import { HttpResponse, HttpClient, HTTP_INTERCEPTORS, provideHttpClient } from '@angular/common/http';
7
7
  import * as i1$1 from '@angular/common';
8
8
  import { DOCUMENT, CommonModule } from '@angular/common';
9
9
  import { format, formatDistance, formatDistanceToNow } from 'date-fns';
@@ -12,7 +12,7 @@ import * as i1$2 from '@angular/router';
12
12
  import { NavigationEnd, NavigationStart, NavigationCancel, NavigationError, RouterModule } from '@angular/router';
13
13
  import { v4 } from 'uuid';
14
14
  import * as i1$3 from '@azure/msal-angular';
15
- import { MSAL_GUARD_CONFIG, MsalGuard, MsalService, MsalBroadcastService, MsalInterceptor, MSAL_INSTANCE, MsalModule } from '@azure/msal-angular';
15
+ import { MSAL_GUARD_CONFIG, MsalGuard, MsalService, MsalBroadcastService, MsalInterceptor, MsalModule } from '@azure/msal-angular';
16
16
  import { BrowserUtils, EventType, InteractionStatus, InteractionType, InteractionRequiredAuthError, PromptValue, PublicClientApplication, LogLevel } from '@azure/msal-browser';
17
17
  import { enUS } from 'date-fns/locale/en-US';
18
18
  import * as i1$4 from '@ngx-translate/core';
@@ -105,12 +105,6 @@ const AppContextStorageKeys = {
105
105
  </file>
106
106
  */
107
107
  //App
108
- //VadimOS: old approach
109
- /*
110
- export const AppCoreSettings = JSON.parse(
111
- ((document.getElementById('appCoreSettings')) as HTMLInputElement).getAttribute('data-appcoresettings')
112
- );
113
- */
114
108
  function getAppCoreSettings() {
115
109
  const json = sessionStorage.getItem(SessionStorageKeys.appCoreSettings);
116
110
  return json ? JSON.parse(json) : null;
@@ -140,9 +134,9 @@ let AppVersion;
140
134
  let IsDevMode = true;
141
135
  let IsProdMode = !IsDevMode;
142
136
  let ClientApps;
143
- resetAppCoreSettings();
144
137
  const AppName = g_AppName;
145
138
  const ApiUrl = g_ApiUrl;
139
+ resetAppCoreSettings();
146
140
 
147
141
  /*
148
142
  <file>
@@ -2562,6 +2556,7 @@ class LoadingService extends BehaviorSubject {
2562
2556
  Authors:
2563
2557
  Vadim Osovitny vadim.osovitny@osovitny.com
2564
2558
  Anatoly Osovitny anatoly.osovitny@osovitny.com
2559
+ Leon Malyan leon.malyan@osovitny.com
2565
2560
 
2566
2561
  Created:
2567
2562
  25 March 2020
@@ -10230,40 +10225,6 @@ class SafeHtmlPipe {
10230
10225
  </file>
10231
10226
  */
10232
10227
 
10233
- class AppService extends ApiServiceBase {
10234
- constructor(http) {
10235
- super(http);
10236
- this.http = http;
10237
- this.baseUrl = `${ApiUrl}/app`;
10238
- }
10239
- loadAppInitializerSettings() {
10240
- //Logging
10241
- let stopwatch = new Stopwatch("@osovitny/anatoly. AppService: loadAppInitializerSettings");
10242
- stopwatch.start();
10243
- return this.get('loadAppInitializerSettings').pipe(map$1(data => {
10244
- //Logging
10245
- stopwatch.stop();
10246
- stopwatch.printElapsedAsMilliseconds();
10247
- if (data) {
10248
- let appCoreSettings = JSON.stringify(data.core);
10249
- let appMSALSettings = JSON.stringify(data.msal);
10250
- appCoreSettings = appCoreSettings.replace(/--APPNAME--/g, g_AppName);
10251
- sessionStorage.setItem(SessionStorageKeys.appCoreSettings, appCoreSettings);
10252
- sessionStorage.setItem(SessionStorageKeys.appMSALSettings, appMSALSettings);
10253
- resetAppCoreSettings();
10254
- }
10255
- }));
10256
- }
10257
- static { this.ɵfac = function AppService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AppService)(i0.ɵɵinject(i1.HttpClient)); }; }
10258
- static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AppService, factory: AppService.ɵfac, providedIn: 'root' }); }
10259
- }
10260
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AppService, [{
10261
- type: Injectable,
10262
- args: [{
10263
- providedIn: 'root'
10264
- }]
10265
- }], () => [{ type: i1.HttpClient }], null); })();
10266
-
10267
10228
  /*
10268
10229
  <file>
10269
10230
  Project:
@@ -10280,30 +10241,18 @@ class AppService extends ApiServiceBase {
10280
10241
  </file>
10281
10242
  */
10282
10243
  //Node
10283
- let InjectorInstance;
10244
+ let InjectorInstance$1;
10284
10245
  class AnatolyCoreModule {
10285
10246
  constructor(injector) {
10286
10247
  this.injector = injector;
10287
- InjectorInstance = this.injector;
10248
+ InjectorInstance$1 = this.injector;
10288
10249
  }
10289
10250
  static { this.ɵfac = function AnatolyCoreModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AnatolyCoreModule)(i0.ɵɵinject(i0.Injector)); }; }
10290
10251
  static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AnatolyCoreModule }); }
10291
10252
  static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
10292
- provideHttpClient(),
10293
- provideAppInitializer(() => {
10294
- const appService = inject(AppService);
10295
- return lastValueFrom(appService.loadAppInitializerSettings().pipe(map$1(() => {
10296
- //Localization
10297
- const translate = InjectorInstance.get(TranslateService);
10298
- const localizationService = InjectorInstance.get(LocalizationService);
10299
- const lang = localizationService.configureSettings(translate);
10300
- translate.use(lang);
10301
- })));
10302
- }),
10303
10253
  //Guards
10304
10254
  StarterGuard,
10305
10255
  //Services
10306
- AppService,
10307
10256
  BrowserService,
10308
10257
  DigitalMarketingService,
10309
10258
  GoogleAnalyticsService,
@@ -10336,21 +10285,9 @@ class AnatolyCoreModule {
10336
10285
  LocalizationModule
10337
10286
  ],
10338
10287
  providers: [
10339
- provideHttpClient(),
10340
- provideAppInitializer(() => {
10341
- const appService = inject(AppService);
10342
- return lastValueFrom(appService.loadAppInitializerSettings().pipe(map$1(() => {
10343
- //Localization
10344
- const translate = InjectorInstance.get(TranslateService);
10345
- const localizationService = InjectorInstance.get(LocalizationService);
10346
- const lang = localizationService.configureSettings(translate);
10347
- translate.use(lang);
10348
- })));
10349
- }),
10350
10288
  //Guards
10351
10289
  StarterGuard,
10352
10290
  //Services
10353
- AppService,
10354
10291
  BrowserService,
10355
10292
  DigitalMarketingService,
10356
10293
  GoogleAnalyticsService,
@@ -10545,36 +10482,27 @@ function loggerCallback(logLevel, message, containsPii) {
10545
10482
  </file>
10546
10483
  */
10547
10484
  //Node
10548
- function initializeMsalFactory(msalInstance, auth) {
10549
- return () => msalInstance.initialize().then(() => auth.init());
10550
- }
10551
10485
  const MSALProviders = [
10552
10486
  MsalService,
10553
10487
  MsalBroadcastService,
10554
- //App
10555
- AuthService,
10556
- AuthenticationGuard,
10557
- AdminGuard,
10558
10488
  {
10559
10489
  provide: HTTP_INTERCEPTORS,
10560
10490
  useClass: MsalInterceptor,
10561
10491
  multi: true
10562
10492
  },
10563
- {
10564
- provide: APP_INITIALIZER,
10565
- useFactory: initializeMsalFactory,
10566
- deps: [MSAL_INSTANCE, AuthService],
10567
- multi: true
10568
- }
10493
+ //App
10494
+ AuthService,
10495
+ AuthenticationGuard,
10496
+ AdminGuard
10569
10497
  ];
10570
10498
  class AnatolyIAMModule {
10571
10499
  static { this.ɵfac = function AnatolyIAMModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AnatolyIAMModule)(); }; }
10572
10500
  static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AnatolyIAMModule }); }
10573
10501
  static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
10502
+ provideHttpClient(),
10574
10503
  ...MSALProviders
10575
10504
  ], imports: [CommonModule,
10576
10505
  RouterModule,
10577
- HttpClientModule,
10578
10506
  MsalModule.forRoot(MSALInstanceFactory(), MSALGuardConfigFactory(), MSALInterceptorConfigFactory())] }); }
10579
10507
  }
10580
10508
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AnatolyIAMModule, [{
@@ -10583,18 +10511,17 @@ class AnatolyIAMModule {
10583
10511
  imports: [
10584
10512
  CommonModule,
10585
10513
  RouterModule,
10586
- HttpClientModule,
10587
10514
  MsalModule.forRoot(MSALInstanceFactory(), MSALGuardConfigFactory(), MSALInterceptorConfigFactory())
10588
10515
  ],
10589
10516
  exports: [],
10590
10517
  providers: [
10518
+ provideHttpClient(),
10591
10519
  ...MSALProviders
10592
10520
  ]
10593
10521
  }]
10594
10522
  }], null, null); })();
10595
10523
  (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AnatolyIAMModule, { imports: [CommonModule,
10596
- RouterModule,
10597
- HttpClientModule, i1$3.MsalModule] }); })();
10524
+ RouterModule, i1$3.MsalModule] }); })();
10598
10525
 
10599
10526
  /*
10600
10527
  <file>
@@ -11287,6 +11214,40 @@ class AnatolyBillingModule {
11287
11214
  KendoModule,
11288
11215
  AnatolyUIModule], exports: [BuyAccessButtonComponent, SubscribePlanButtonComponent, OrderSummaryComponent, PaymentMethodsComponent, PaymentOptionsComponent, BraintreeDialog, PaypalButtonComponent, PaypalSubscribeButtonComponent, PayPalComponent, StripeDialog] }); })();
11289
11216
 
11217
+ class AppService extends ApiServiceBase {
11218
+ constructor(http) {
11219
+ super(http);
11220
+ this.http = http;
11221
+ this.baseUrl = `${ApiUrl}/app`;
11222
+ }
11223
+ loadAppInitializerSettings() {
11224
+ //Logging
11225
+ let stopwatch = new Stopwatch("@osovitny/anatoly. AppService: loadAppInitializerSettings");
11226
+ stopwatch.start();
11227
+ return this.get('loadAppInitializerSettings').pipe(map$1(data => {
11228
+ //Logging
11229
+ stopwatch.stop();
11230
+ stopwatch.printElapsedAsMilliseconds();
11231
+ if (data) {
11232
+ let appCoreSettings = JSON.stringify(data.core);
11233
+ let appMSALSettings = JSON.stringify(data.msal);
11234
+ appCoreSettings = appCoreSettings.replace(/--APPNAME--/g, g_AppName);
11235
+ sessionStorage.setItem(SessionStorageKeys.appCoreSettings, appCoreSettings);
11236
+ sessionStorage.setItem(SessionStorageKeys.appMSALSettings, appMSALSettings);
11237
+ resetAppCoreSettings();
11238
+ }
11239
+ }));
11240
+ }
11241
+ static { this.ɵfac = function AppService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AppService)(i0.ɵɵinject(i1.HttpClient)); }; }
11242
+ static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AppService, factory: AppService.ɵfac, providedIn: 'root' }); }
11243
+ }
11244
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AppService, [{
11245
+ type: Injectable,
11246
+ args: [{
11247
+ providedIn: 'root'
11248
+ }]
11249
+ }], () => [{ type: i1.HttpClient }], null); })();
11250
+
11290
11251
  /*
11291
11252
  <file>
11292
11253
  Project:
@@ -11302,10 +11263,34 @@ class AnatolyBillingModule {
11302
11263
  </file>
11303
11264
  */
11304
11265
  //Node
11266
+ let InjectorInstance;
11305
11267
  class AnatolyModule {
11306
- static { this.ɵfac = function AnatolyModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AnatolyModule)(); }; }
11268
+ constructor(injector) {
11269
+ this.injector = injector;
11270
+ InjectorInstance = this.injector;
11271
+ }
11272
+ static { this.ɵfac = function AnatolyModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AnatolyModule)(i0.ɵɵinject(i0.Injector)); }; }
11307
11273
  static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AnatolyModule }); }
11308
- static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule,
11274
+ static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
11275
+ provideHttpClient(),
11276
+ provideAppInitializer(() => {
11277
+ const appService = inject(AppService);
11278
+ return lastValueFrom(appService.loadAppInitializerSettings().pipe(map$1(() => {
11279
+ //Localization
11280
+ const translate = InjectorInstance.get(TranslateService);
11281
+ const localizationService = InjectorInstance.get(LocalizationService);
11282
+ const lang = localizationService.configureSettings(translate);
11283
+ translate.use(lang);
11284
+ //IAM
11285
+ const msalInstance = InjectorInstance.get(MsalService);
11286
+ const auth = InjectorInstance.get(AuthService);
11287
+ msalInstance.initialize().pipe(map$1(() => {
11288
+ auth.init();
11289
+ }));
11290
+ })));
11291
+ }),
11292
+ AppService
11293
+ ], imports: [CommonModule,
11309
11294
  AnatolyCoreModule,
11310
11295
  AnatolyDataModule,
11311
11296
  AnatolyIAMModule,
@@ -11329,9 +11314,29 @@ class AnatolyModule {
11329
11314
  AnatolyDataModule,
11330
11315
  AnatolyIAMModule,
11331
11316
  AnatolyUIModule
11317
+ ],
11318
+ providers: [
11319
+ provideHttpClient(),
11320
+ provideAppInitializer(() => {
11321
+ const appService = inject(AppService);
11322
+ return lastValueFrom(appService.loadAppInitializerSettings().pipe(map$1(() => {
11323
+ //Localization
11324
+ const translate = InjectorInstance.get(TranslateService);
11325
+ const localizationService = InjectorInstance.get(LocalizationService);
11326
+ const lang = localizationService.configureSettings(translate);
11327
+ translate.use(lang);
11328
+ //IAM
11329
+ const msalInstance = InjectorInstance.get(MsalService);
11330
+ const auth = InjectorInstance.get(AuthService);
11331
+ msalInstance.initialize().pipe(map$1(() => {
11332
+ auth.init();
11333
+ }));
11334
+ })));
11335
+ }),
11336
+ AppService
11332
11337
  ]
11333
11338
  }]
11334
- }], null, null); })();
11339
+ }], () => [{ type: i0.Injector }], null); })();
11335
11340
  (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AnatolyModule, { imports: [CommonModule,
11336
11341
  AnatolyCoreModule,
11337
11342
  AnatolyDataModule,
@@ -11350,5 +11355,5 @@ class AnatolyModule {
11350
11355
  * Generated bundle index. Do not edit.
11351
11356
  */
11352
11357
 
11353
- export { AReplacerDirective, AddressComponent, AdminGuard, Alerts, AnatolyBillingModule, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyIAMModule, AnatolyIAMPagesModule, AnatolyModule, AnatolyUIModule, ApiServiceBase, ApiUrl, AppContextService, AppCoreSettings, AppName, AppSettings, AppVersion, AppsGoServiceBase, AuthService, AuthenticationGuard, BillingService, BillingUtils, BraintreeDialog, BrowserService, BuyAccessButtonComponent, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CheckIconComponent, ClientApps, CompanyComponent, ComponentBase, ContactUsDialog, ContactUsForm, ControlPanelComponent, Convert, Copy2ClipboardComponent, CoreApiService, CountryDropdownlist, CurrenciesApiService, CurrenciesStorageService, DOM, DataPagerComponent, DataViewType, DateConvert, DefaultEditorOptions, DialogBase, DigitalMarketingService, DiscountCodeStatus, DiscountCodeType, EditComponentBase, EditPageBase, EmailsApiService, EnumEditComponentBase, FeatureWillBeReadyComponent, FileSizePipe, FormValidationSummaryComponent, GABillingEvents, GAEvents, GlobalErrorHandler, GoServiceBase, GoogleAnalyticsService, GridEditServiceBase, GridReadServiceBase, Guid, HoveringDirective, HtmlEditorComponent, HtmlEditorComponentBase, IdleService, ImageReplacerDirective, InjectorInstance, IsDevMode, IsProdMode, ItemValidationSummaryComponent, L10nUtils, LanguageDropdownlist, ListBase, LoadingComponent, LoadingService, LocalStorageService, LocalizationModule, LocalizationService, LocalizePipe, LoggingService, MSALUtils, Mode, ModerationStatus, ModerationStatusDropdownlist, NativeElementDirective, NoMobileSupportComponent, NodataComponent, NotificationService, OrderSummaryComponent, PageBase, PageSpinnerComponent, PagedPageBase, PayPalComponent, PayPalScriptService, PaymentMethod, PaymentMethodsComponent, PaymentOptionsComponent, PaymentStage, PaymentType, PaymentsApiService, PaymentsService, PaypalButtonComponent, PaypalSubscribeButtonComponent, PromoCodesApiService, PublishStatus, PublishStatusDropdownlist, QSUtils, ReplaceTextPipe, SafeHtmlPipe, ScriptService, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, StarterGuard, StarterService, Stopwatch, StripeDialog, Subs, SubscribePlanButtonComponent, SubscriptionProvider, SubscriptionsApiService, TimezoneDropdownlist, TransactionsApiService, UrlSlugComponent, Utils, ValidationSummaryComponent, XmlFormatter, YouAgreeToOurTermsComponent, dateFormats, dateTimeFormats, formatUrl, getAppCoreSettings, getAppSettingsById, getAppSettingsByName, getCurrentApp, getLocalizationInjector, initializeMsalFactory, is, resetAppCoreSettings, throwIfAlreadyLoaded, timeFormats, translateLoaderFactory };
11358
+ export { AReplacerDirective, AddressComponent, AdminGuard, Alerts, AnatolyBillingModule, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyIAMModule, AnatolyIAMPagesModule, AnatolyModule, AnatolyUIModule, ApiServiceBase, ApiUrl, AppContextService, AppCoreSettings, AppName, AppSettings, AppVersion, AppsGoServiceBase, AuthService, AuthenticationGuard, BillingService, BillingUtils, BraintreeDialog, BrowserService, BuyAccessButtonComponent, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CheckIconComponent, ClientApps, CompanyComponent, ComponentBase, ContactUsDialog, ContactUsForm, ControlPanelComponent, Convert, Copy2ClipboardComponent, CoreApiService, CountryDropdownlist, CurrenciesApiService, CurrenciesStorageService, DOM, DataPagerComponent, DataViewType, DateConvert, DefaultEditorOptions, DialogBase, DigitalMarketingService, DiscountCodeStatus, DiscountCodeType, EditComponentBase, EditPageBase, EmailsApiService, EnumEditComponentBase, FeatureWillBeReadyComponent, FileSizePipe, FormValidationSummaryComponent, GABillingEvents, GAEvents, GlobalErrorHandler, GoServiceBase, GoogleAnalyticsService, GridEditServiceBase, GridReadServiceBase, Guid, HoveringDirective, HtmlEditorComponent, HtmlEditorComponentBase, IdleService, ImageReplacerDirective, InjectorInstance$1 as InjectorInstance, IsDevMode, IsProdMode, ItemValidationSummaryComponent, L10nUtils, LanguageDropdownlist, ListBase, LoadingComponent, LoadingService, LocalStorageService, LocalizationModule, LocalizationService, LocalizePipe, LoggingService, MSALUtils, Mode, ModerationStatus, ModerationStatusDropdownlist, NativeElementDirective, NoMobileSupportComponent, NodataComponent, NotificationService, OrderSummaryComponent, PageBase, PageSpinnerComponent, PagedPageBase, PayPalComponent, PayPalScriptService, PaymentMethod, PaymentMethodsComponent, PaymentOptionsComponent, PaymentStage, PaymentType, PaymentsApiService, PaymentsService, PaypalButtonComponent, PaypalSubscribeButtonComponent, PromoCodesApiService, PublishStatus, PublishStatusDropdownlist, QSUtils, ReplaceTextPipe, SafeHtmlPipe, ScriptService, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, StarterGuard, StarterService, Stopwatch, StripeDialog, Subs, SubscribePlanButtonComponent, SubscriptionProvider, SubscriptionsApiService, TimezoneDropdownlist, TransactionsApiService, UrlSlugComponent, Utils, ValidationSummaryComponent, XmlFormatter, YouAgreeToOurTermsComponent, dateFormats, dateTimeFormats, formatUrl, getAppCoreSettings, getAppSettingsById, getAppSettingsByName, getCurrentApp, getLocalizationInjector, is, resetAppCoreSettings, throwIfAlreadyLoaded, timeFormats, translateLoaderFactory };
11354
11359
  //# sourceMappingURL=osovitny-anatoly.mjs.map