@osovitny/anatoly 3.21.37 → 3.21.38
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
|
-
|
|
76
|
+
appSettings: 'appSettings',
|
|
77
77
|
appMSALSettings: 'appMSALSettings'
|
|
78
78
|
};
|
|
79
79
|
const AppContextStorageKeys = {
|
|
@@ -106,7 +106,7 @@ const AppContextStorageKeys = {
|
|
|
106
106
|
*/
|
|
107
107
|
//App
|
|
108
108
|
function getAppCoreSettings() {
|
|
109
|
-
const json = sessionStorage.getItem(SessionStorageKeys.
|
|
109
|
+
const json = sessionStorage.getItem(SessionStorageKeys.appSettings);
|
|
110
110
|
return json ? JSON.parse(json) : null;
|
|
111
111
|
}
|
|
112
112
|
function resetAppCoreSettings() {
|
|
@@ -117,6 +117,67 @@ function resetAppCoreSettings() {
|
|
|
117
117
|
IsProdMode = !IsDevMode;
|
|
118
118
|
ClientApps = AppCoreSettings?.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 AppCoreSettings;
|
|
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
|
+
resetAppCoreSettings();
|
|
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
|
|
133
|
-
Lib
|
|
134
|
-
External
|
|
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
|
|
143
|
-
Lib
|
|
144
|
-
External
|
|
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
|
|
148
|
-
Lib
|
|
149
|
-
External
|
|
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}
|
|
171
|
-
{LibName}
|
|
231
|
+
{AppName} -> AppName (e.g. "am")
|
|
232
|
+
{LibName} -> LibName (e.g. "@nexl")
|
|
172
233
|
|
|
173
234
|
base:
|
|
174
|
-
CDN disabled
|
|
175
|
-
CDN enabled
|
|
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
|
*/
|
|
@@ -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>
|
|
@@ -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:
|
|
@@ -10108,10 +10108,10 @@ class AppService extends ApiServiceBase {
|
|
|
10108
10108
|
stopwatch.stop();
|
|
10109
10109
|
stopwatch.printElapsedAsMilliseconds();
|
|
10110
10110
|
if (data) {
|
|
10111
|
-
let
|
|
10111
|
+
let appSettings = JSON.stringify(data.app);
|
|
10112
10112
|
let appMSALSettings = JSON.stringify(data.msal);
|
|
10113
|
-
|
|
10114
|
-
sessionStorage.setItem(SessionStorageKeys.
|
|
10113
|
+
appSettings = appSettings.replace(/--APPNAME--/g, g_AppName);
|
|
10114
|
+
sessionStorage.setItem(SessionStorageKeys.appSettings, appSettings);
|
|
10115
10115
|
sessionStorage.setItem(SessionStorageKeys.appMSALSettings, appMSALSettings);
|
|
10116
10116
|
resetAppCoreSettings();
|
|
10117
10117
|
resetMsalSettings();
|