@osovitny/anatoly 3.21.37 → 3.21.39

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.
@@ -73,7 +73,7 @@ import { UploadsModule } from '@progress/kendo-angular-upload';
73
73
  </file>
74
74
  */
75
75
  const SessionStorageKeys = {
76
- appCoreSettings: 'appCoreSettings',
76
+ appSettings: 'appSettings',
77
77
  appMSALSettings: 'appMSALSettings'
78
78
  };
79
79
  const AppContextStorageKeys = {
@@ -105,18 +105,79 @@ const AppContextStorageKeys = {
105
105
  </file>
106
106
  */
107
107
  //App
108
- function getAppCoreSettings() {
109
- const json = sessionStorage.getItem(SessionStorageKeys.appCoreSettings);
108
+ function getAppSettings() {
109
+ const json = sessionStorage.getItem(SessionStorageKeys.appSettings);
110
110
  return json ? JSON.parse(json) : null;
111
111
  }
112
- function resetAppCoreSettings() {
113
- AppCoreSettings = getAppCoreSettings();
114
- let isDevMode = `${AppCoreSettings?.isDevMode}`;
115
- AppVersion = `${AppCoreSettings?.version}`;
112
+ function resetAppSettings() {
113
+ AppSettings = getAppSettings();
114
+ let isDevMode = `${AppSettings?.isDevMode}`;
115
+ AppVersion = `${AppSettings?.version}`;
116
116
  IsDevMode = (isDevMode && (isDevMode == 'True' || isDevMode == 'true'));
117
117
  IsProdMode = !IsDevMode;
118
- ClientApps = AppCoreSettings?.clientApps;
118
+ ClientApps = AppSettings?.clientApps;
119
119
  }
120
+ function getAppSettingsById(id) {
121
+ let apps = ClientApps;
122
+ if (apps && id) {
123
+ for (let i = 0; i < apps.length; i++) {
124
+ let app = apps[i];
125
+ if (app.id == id) {
126
+ return app;
127
+ }
128
+ }
129
+ }
130
+ return null;
131
+ }
132
+ function getAppSettingsByName(name) {
133
+ let apps = ClientApps;
134
+ if (apps && name) {
135
+ for (let i = 0; i < apps.length; i++) {
136
+ let app = apps[i];
137
+ if (app.name == name) {
138
+ return app;
139
+ }
140
+ }
141
+ }
142
+ return null;
143
+ }
144
+ function getCurrentApp() {
145
+ let appSettings = getAppSettingsByName(AppName);
146
+ let appOne = getAppSettingsById(1);
147
+ if (!appSettings || !appOne) {
148
+ return null;
149
+ }
150
+ return {
151
+ id: appSettings.id,
152
+ root: appSettings.root,
153
+ one: appOne,
154
+ oneUrl: appOne?.baseUrl + appOne?.root
155
+ };
156
+ }
157
+ let AppSettings;
158
+ let AppVersion;
159
+ let IsDevMode = true;
160
+ let IsProdMode = !IsDevMode;
161
+ let ClientApps;
162
+ const AppName = g_AppName;
163
+ const LibName = g_LibName;
164
+ const ApiUrl = g_ApiUrl;
165
+ resetAppSettings();
166
+
167
+ /*
168
+ <file>
169
+ Project:
170
+ @osovitny/anatoly
171
+
172
+ Authors:
173
+ Vadim Osovitny vadim.osovitny@osovitny.com
174
+
175
+ Created:
176
+ 2 Jun 2026
177
+
178
+ Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
179
+ </file>
180
+ */
120
181
  var AssetGroupType;
121
182
  (function (AssetGroupType) {
122
183
  AssetGroupType[AssetGroupType["App"] = 1] = "App";
@@ -129,9 +190,9 @@ var AssetGroupType;
129
190
  Output pattern: {base}/{AppName}/assets/{assetGroup}/{assetType}/{file}
130
191
 
131
192
  assetGroup tokens:
132
- App {AppName} e.g. "am"
133
- Lib {LibName} e.g. "@nexl"
134
- External external/{libname}
193
+ App -> {AppName} e.g. "am"
194
+ Lib -> {LibName} e.g. "@nexl"
195
+ External -> external/{libname}
135
196
 
136
197
  assetType:
137
198
  jsons - JSON data files
@@ -139,14 +200,14 @@ var AssetGroupType;
139
200
  images - image files
140
201
 
141
202
  Examples (AppName = "am", LibName = "@nexl", CDN disabled):
142
- App /am/assets/am/jsons/countries.json?v=1
143
- Lib /am/assets/@nexl/l10n/en.json?v=1
144
- External /am/assets/external/anatoly/jsons/file.json?v=1
203
+ App -> /am/assets/am/jsons/countries.json?v=1
204
+ Lib -> /am/assets/@nexl/l10n/en.json?v=1
205
+ External-> /am/assets/external/anatoly/jsons/file.json?v=1
145
206
 
146
207
  Examples (CDN = "https://cdn.novaexpress.ai"):
147
- App https://cdn.novaexpress.ai/am/assets/am/jsons/countries.json
148
- Lib https://cdn.novaexpress.ai/am/assets/@nexl/l10n/en.json
149
- External https://cdn.novaexpress.ai/am/assets/external/anatoly/jsons/file.json
208
+ App -> https://cdn.novaexpress.ai/am/assets/am/jsons/countries.json
209
+ Lib -> https://cdn.novaexpress.ai/am/assets/@nexl/l10n/en.json
210
+ External-> https://cdn.novaexpress.ai/am/assets/external/anatoly/jsons/file.json
150
211
  */
151
212
  function formatAssetsUrl(assetGroupType, url) {
152
213
  const path = url.replace(/^\/+/, '');
@@ -167,12 +228,12 @@ function formatAssetsUrl(assetGroupType, url) {
167
228
  Output pattern: {base}/{AppName}/{url}
168
229
 
169
230
  Tokens in url are resolved before building the path:
170
- {AppName} AppName (e.g. "am")
171
- {LibName} LibName (e.g. "@nexl")
231
+ {AppName} -> AppName (e.g. "am")
232
+ {LibName} -> LibName (e.g. "@nexl")
172
233
 
173
234
  base:
174
- CDN disabled "" (relative URL, e.g. /am/assets/...)
175
- CDN enabled "https://cdn.novaexpress.ai"
235
+ CDN disabled -> "" (relative URL, e.g. /am/assets/...)
236
+ CDN enabled -> "https://cdn.novaexpress.ai"
176
237
 
177
238
  Absolute URLs (starting with "http") are returned as-is.
178
239
  */
@@ -183,12 +244,12 @@ function formatUrl(url) {
183
244
  if (url.startsWith("http")) {
184
245
  return url;
185
246
  }
186
- if (!AppCoreSettings) {
247
+ if (!AppSettings) {
187
248
  return url;
188
249
  }
189
- const version = AppCoreSettings.version;
190
- const isCDNEnabled = AppCoreSettings.cdn?.enabled;
191
- const cdnUrl = AppCoreSettings.cdn?.url;
250
+ const version = AppSettings.version;
251
+ const isCDNEnabled = AppSettings.cdn?.enabled;
252
+ const cdnUrl = AppSettings.cdn?.url;
192
253
  const resolved = url
193
254
  .replace('{AppName}', AppName ?? '')
194
255
  .replace('{LibName}', LibName ?? '');
@@ -201,15 +262,6 @@ function formatUrl(url) {
201
262
  }
202
263
  return fullUrl;
203
264
  }
204
- let AppCoreSettings;
205
- let AppVersion;
206
- let IsDevMode = true;
207
- let IsProdMode = !IsDevMode;
208
- let ClientApps;
209
- const AppName = g_AppName;
210
- const LibName = g_LibName;
211
- const ApiUrl = g_ApiUrl;
212
- resetAppCoreSettings();
213
265
 
214
266
  /*
215
267
  <file>
@@ -332,23 +384,23 @@ class LoggingService {
332
384
  return [info, ...optionalParams];
333
385
  }
334
386
  static getConfiguredLogLevel() {
335
- const appCoreSettings = AppCoreSettings;
336
- const configuredValue = appCoreSettings?.logging?.logLevel?.default
337
- ?? appCoreSettings?.logging?.logLevel?.Default
338
- ?? appCoreSettings?.logging?.logLevel
339
- ?? appCoreSettings?.logging?.default
340
- ?? appCoreSettings?.logging?.Default
341
- ?? appCoreSettings?.diagnostics?.logLevel
342
- ?? appCoreSettings?.logLevel;
387
+ const appSettings = AppSettings;
388
+ const configuredValue = appSettings?.logging?.logLevel?.default
389
+ ?? appSettings?.logging?.logLevel?.Default
390
+ ?? appSettings?.logging?.logLevel
391
+ ?? appSettings?.logging?.default
392
+ ?? appSettings?.logging?.Default
393
+ ?? appSettings?.diagnostics?.logLevel
394
+ ?? appSettings?.logLevel;
343
395
  if (configuredValue !== null && typeof configuredValue !== 'undefined') {
344
396
  return LoggingService.toLogLevel(configuredValue);
345
397
  }
346
- return LoggingService.isDevMode(appCoreSettings)
398
+ return LoggingService.isDevMode(appSettings)
347
399
  ? AnatolyLogLevel.Verbose
348
400
  : AnatolyLogLevel.Off;
349
401
  }
350
- static isDevMode(appCoreSettings) {
351
- const value = appCoreSettings?.isDevMode ?? appCoreSettings?.IsDevMode;
402
+ static isDevMode(appSettings) {
403
+ const value = appSettings?.isDevMode ?? appSettings?.IsDevMode;
352
404
  return value === true || `${value}`.toLowerCase() === 'true';
353
405
  }
354
406
  static toLogLevel(value) {
@@ -804,58 +856,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
804
856
  type: Injectable
805
857
  }], ctorParameters: () => [{ type: i1.HttpClient }, { type: LocalStorageService }, { type: SessionStorageService }] });
806
858
 
807
- /*
808
- <file>
809
- Project:
810
- @osovitny/anatoly
811
-
812
- Authors:
813
- Vadim Osovitny vadim.osovitny@osovitny.com
814
-
815
- Created:
816
- 1 Apr 2024
817
-
818
- Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
819
- </file>
820
- */
821
- function getAppSettingsById(id) {
822
- let apps = ClientApps;
823
- if (apps && id) {
824
- for (let i = 0; i < apps.length; i++) {
825
- let app = apps[i];
826
- if (app.id == id) {
827
- return app;
828
- }
829
- }
830
- }
831
- return null;
832
- }
833
- function getAppSettingsByName(name) {
834
- let apps = ClientApps;
835
- if (apps && name) {
836
- for (let i = 0; i < apps.length; i++) {
837
- let app = apps[i];
838
- if (app.name == name) {
839
- return app;
840
- }
841
- }
842
- }
843
- return null;
844
- }
845
- function getCurrentApp() {
846
- let appSettings = getAppSettingsByName(AppName);
847
- let appOne = getAppSettingsById(1);
848
- if (!appSettings || !appOne) {
849
- return null;
850
- }
851
- return {
852
- id: appSettings.id,
853
- root: appSettings.root,
854
- one: appOne,
855
- oneUrl: appOne?.baseUrl + appOne?.root
856
- };
857
- }
858
-
859
859
  /*
860
860
  <file>
861
861
  Project:
@@ -2645,8 +2645,8 @@ class AnatolyHttpInterceptor {
2645
2645
  return url + '?' + value;
2646
2646
  }
2647
2647
  intercept(req, next) {
2648
- let isCDNEnabled = AppCoreSettings?.cdn?.enabled;
2649
- let cdnSasToken = AppCoreSettings?.cdn?.sasToken;
2648
+ let isCDNEnabled = AppSettings?.cdn?.enabled;
2649
+ let cdnSasToken = AppSettings?.cdn?.sasToken;
2650
2650
  let isLoadingFreezed = this.loadingService.isFreezed;
2651
2651
  let loadingRequired = !isLoadingFreezed;
2652
2652
  let isExternalSite = false;
@@ -6019,7 +6019,7 @@ class PaypalButtonComponent extends ComponentBase {
6019
6019
  }
6020
6020
  initPayPal() {
6021
6021
  let that = this;
6022
- let payPalSettings = AppCoreSettings.externalApi.pm.payPal;
6022
+ let payPalSettings = AppSettings.externalApi.pm.payPal;
6023
6023
  let clientId = payPalSettings.clientId;
6024
6024
  let totalPrice = this.ps.getTotal().toString();
6025
6025
  let currency = this.ps.currency;
@@ -6156,7 +6156,7 @@ class PaypalSubscribeButtonComponent extends ComponentBase {
6156
6156
  }
6157
6157
  initPayPal() {
6158
6158
  let that = this;
6159
- let payPalSettings = AppCoreSettings.externalApi.pm.payPal;
6159
+ let payPalSettings = AppSettings.externalApi.pm.payPal;
6160
6160
  let clientId = payPalSettings.clientId;
6161
6161
  let planId = this.payPalPlanId;
6162
6162
  this.payPalConfig = {
@@ -6266,7 +6266,7 @@ class StripeDialog extends DialogBase {
6266
6266
  });
6267
6267
  }
6268
6268
  async initializeEmbedForm() {
6269
- let stripePk = AppCoreSettings.external.pm.stripe.publishableKey;
6269
+ let stripePk = AppSettings.external.pm.stripe.publishableKey;
6270
6270
  const that = this;
6271
6271
  this.stripe = await loadStripe(stripePk);
6272
6272
  this.stripeCheckout = await this.stripe.initEmbeddedCheckout({
@@ -7559,7 +7559,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
7559
7559
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
7560
7560
  </file>
7561
7561
  */
7562
- let imageUploadUrl = AppCoreSettings?.api?.url + AppCoreSettings?.api?.imageUploadPath;
7562
+ let imageUploadUrl = AppSettings?.api?.url + AppSettings?.api?.imageUploadPath;
7563
7563
  const DefaultEditorOptions = {
7564
7564
  placeholderText: "Edit Your Content Here",
7565
7565
  charCounterCount: true,
@@ -7648,7 +7648,7 @@ class HtmlEditorComponentBase extends EditComponentBase {
7648
7648
  opt = JSON.parse(this.editorOptions);
7649
7649
  }
7650
7650
  let newOptions = $.extend({}, DefaultEditorOptions, opt);
7651
- const key = AppCoreSettings.froalaEditorKey;
7651
+ const key = AppSettings.froalaEditorKey;
7652
7652
  if (key) {
7653
7653
  newOptions = $.extend({}, newOptions, JSON.parse('{ "key": "' + key + '" }'));
7654
7654
  }
@@ -10108,12 +10108,12 @@ class AppService extends ApiServiceBase {
10108
10108
  stopwatch.stop();
10109
10109
  stopwatch.printElapsedAsMilliseconds();
10110
10110
  if (data) {
10111
- let appCoreSettings = JSON.stringify(data.core);
10111
+ let appSettings = JSON.stringify(data.app);
10112
10112
  let appMSALSettings = JSON.stringify(data.msal);
10113
- appCoreSettings = appCoreSettings.replace(/--APPNAME--/g, g_AppName);
10114
- sessionStorage.setItem(SessionStorageKeys.appCoreSettings, appCoreSettings);
10113
+ appSettings = appSettings.replace(/--APPNAME--/g, g_AppName);
10114
+ sessionStorage.setItem(SessionStorageKeys.appSettings, appSettings);
10115
10115
  sessionStorage.setItem(SessionStorageKeys.appMSALSettings, appMSALSettings);
10116
- resetAppCoreSettings();
10116
+ resetAppSettings();
10117
10117
  resetMsalSettings();
10118
10118
  }
10119
10119
  }));
@@ -10249,5 +10249,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
10249
10249
  * Generated bundle index. Do not edit.
10250
10250
  */
10251
10251
 
10252
- export { AReplacerDirective, AddressComponent, AdminGuard, Alerts, AnatolyBillingModule, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyIAMModule, AnatolyIAMPagesModule, AnatolyLogLevel, AnatolyModule, AnatolyUIModule, ApiServiceBase, ApiUrl, AppContextService, AppCoreSettings, AppName, AppVersion, AppsGoServiceBase, AssetGroupType, 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, LibName, ListBase, LoadingComponent, LoadingService, LocalStorageService, LocalizationModule, LocalizationService, LocalizePipe, LoggingService, MSALUtils, Message2User, Message2UserComponent, Message2UserService, 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, ServiceBase, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, StarterGuard, StarterService, Stopwatch, StripeDialog, Subs, SubscribePlanButtonComponent, SubscriptionProvider, SubscriptionsApiService, TimezoneDropdownlist, TransactionsApiService, UrlSlugComponent, Utils, ValidationSummaryComponent, XmlFormatter, YouAgreeToOurTermsComponent, dateFormats, dateTimeFormats, formatAssetsUrl, formatUrl, getAppCoreSettings, getAppSettingsById, getAppSettingsByName, getCurrentApp, getLocalizationInjector, is, resetAppCoreSettings, throwIfAlreadyLoaded, timeFormats, translateLoaderFactory };
10252
+ export { AReplacerDirective, AddressComponent, AdminGuard, Alerts, AnatolyBillingModule, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyIAMModule, AnatolyIAMPagesModule, AnatolyLogLevel, AnatolyModule, AnatolyUIModule, ApiServiceBase, ApiUrl, AppContextService, AppName, AppSettings, AppVersion, AppsGoServiceBase, AssetGroupType, 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, LibName, ListBase, LoadingComponent, LoadingService, LocalStorageService, LocalizationModule, LocalizationService, LocalizePipe, LoggingService, MSALUtils, Message2User, Message2UserComponent, Message2UserService, 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, ServiceBase, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, StarterGuard, StarterService, Stopwatch, StripeDialog, Subs, SubscribePlanButtonComponent, SubscriptionProvider, SubscriptionsApiService, TimezoneDropdownlist, TransactionsApiService, UrlSlugComponent, Utils, ValidationSummaryComponent, XmlFormatter, YouAgreeToOurTermsComponent, dateFormats, dateTimeFormats, formatAssetsUrl, formatUrl, getAppSettings, getAppSettingsById, getAppSettingsByName, getCurrentApp, getLocalizationInjector, is, resetAppSettings, throwIfAlreadyLoaded, timeFormats, translateLoaderFactory };
10253
10253
  //# sourceMappingURL=osovitny-anatoly.mjs.map