@osovitny/anatoly 2.16.6 → 3.16.0

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.
Files changed (41) hide show
  1. package/esm2022/lib/core/consts/settings.mjs +2 -1
  2. package/esm2022/lib/core/core.module.mjs +17 -15
  3. package/esm2022/lib/core/index.mjs +6 -4
  4. package/esm2022/lib/core/models/appcontext.service.mjs +17 -0
  5. package/esm2022/lib/core/notifications/services/notification-service.mjs +4 -155
  6. package/esm2022/lib/core/services/appcontext.service.mjs +5 -4
  7. package/esm2022/lib/core/services/starter.service.mjs +77 -0
  8. package/esm2022/lib/data/base/api.service.mjs +99 -0
  9. package/esm2022/lib/data/base/grid/grid-edit.service.mjs +83 -0
  10. package/esm2022/lib/data/base/grid/grid-read.service.mjs +64 -0
  11. package/esm2022/lib/data/data.module.mjs +2 -1
  12. package/esm2022/lib/data/index.mjs +7 -6
  13. package/esm2022/lib/data/services/core-api.service.mjs +6 -6
  14. package/esm2022/lib/data/services/emails-api.service.mjs +5 -5
  15. package/esm2022/lib/data/urls.mjs +22 -0
  16. package/esm2022/public-api.mjs +10 -10
  17. package/fesm2022/osovitny-anatoly.mjs +349 -466
  18. package/fesm2022/osovitny-anatoly.mjs.map +1 -1
  19. package/lib/core/consts/settings.d.ts +1 -0
  20. package/lib/core/index.d.ts +4 -3
  21. package/lib/core/models/appcontext.service.d.ts +6 -0
  22. package/lib/core/notifications/services/notification-service.d.ts +0 -12
  23. package/lib/core/services/appcontext.service.d.ts +2 -2
  24. package/lib/core/services/starter.service.d.ts +11 -0
  25. package/lib/data/base/{base-api.service.d.ts → api.service.d.ts} +3 -3
  26. package/lib/data/base/grid/{base-grid-edit.service.d.ts → grid-edit.service.d.ts} +4 -4
  27. package/lib/data/base/grid/{base-grid-read.service.d.ts → grid-read.service.d.ts} +3 -3
  28. package/lib/data/index.d.ts +4 -5
  29. package/lib/data/services/core-api.service.d.ts +2 -2
  30. package/lib/data/services/emails-api.service.d.ts +2 -2
  31. package/lib/data/urls.d.ts +4 -0
  32. package/package.json +1 -1
  33. package/esm2022/lib/core/consts/urls.mjs +0 -19
  34. package/esm2022/lib/data/base/base-api.service.mjs +0 -99
  35. package/esm2022/lib/data/base/grid/base-grid-edit.service.mjs +0 -83
  36. package/esm2022/lib/data/base/grid/base-grid-read.service.mjs +0 -65
  37. package/esm2022/lib/data/consts.mjs +0 -24
  38. package/esm2022/lib/data/services/notifications/notifications-api-service.mjs +0 -41
  39. package/lib/core/consts/urls.d.ts +0 -3
  40. package/lib/data/consts.d.ts +0 -5
  41. package/lib/data/services/notifications/notifications-api-service.d.ts +0 -12
@@ -6,7 +6,7 @@ import { NavigationEnd, NavigationStart, NavigationCancel, NavigationError, Rout
6
6
  import * as i1$3 from '@angular/common/http';
7
7
  import { HttpResponse, HttpClient } from '@angular/common/http';
8
8
  import { tap, map } from 'rxjs/operators';
9
- import { BehaviorSubject, Subject, timer, merge, fromEvent } from 'rxjs';
9
+ import { BehaviorSubject, Subject, timer, merge, fromEvent, of, forkJoin } from 'rxjs';
10
10
  import { isValid, format, formatDistance, formatDistanceToNow } from 'date-fns';
11
11
  import { utcToZonedTime } from 'date-fns-tz';
12
12
  import enUS from 'date-fns/locale/en-US';
@@ -16,10 +16,10 @@ import * as i1$5 from '@angular/common';
16
16
  import { LOCATION_INITIALIZED, DOCUMENT, CommonModule } from '@angular/common';
17
17
  import { TranslateHttpLoader } from '@ngx-translate/http-loader';
18
18
  import Swal from 'sweetalert2';
19
- import { v4 } from 'uuid';
20
19
  import * as i1$2 from 'ngx-toastr';
21
20
  import { ToastrModule } from 'ngx-toastr';
22
21
  import * as i1$4 from '@angular/platform-browser';
22
+ import { v4 } from 'uuid';
23
23
  import * as i1$6 from '@fortawesome/angular-fontawesome';
24
24
  import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
25
25
  import * as i1$7 from '@progress/kendo-angular-pager';
@@ -61,25 +61,7 @@ import { IconsModule } from '@progress/kendo-angular-icons';
61
61
  */
62
62
  const AppName = document.getElementById('appName').getAttribute('data-appname');
63
63
  const AppCoreSettings = JSON.parse((document.getElementById('appCoreSettings')).getAttribute('data-appcoresettings'));
64
-
65
- /*
66
- <file>
67
- Project:
68
- MICE
69
-
70
- Authors:
71
- Vadim Osovitny vadim@osovitny.com vaosovitny@deloitte.com
72
-
73
- Created:
74
- 5 May 2020
75
-
76
- Copyright (c) 2020 Deloitte Tax. All rights reserved.
77
- </file>
78
- */
79
- const Urls = {
80
- // SignalR Notifications
81
- notificationsSocketUrl: '/hubs/notifications'
82
- };
64
+ const ApiUrl = `${AppCoreSettings.apiUrl}`;
83
65
 
84
66
  /*
85
67
  <file>
@@ -889,6 +871,22 @@ class GlobalErrorHandler {
889
871
  type: Injectable
890
872
  }], function () { return [{ type: i0.Injector }]; }, null); })();
891
873
 
874
+ /*
875
+ <file>
876
+ Project:
877
+ @osovitny/anatoly
878
+
879
+ Authors:
880
+ Vadim Osovitny vadim@osovitny.com
881
+ Anatoly Osovitny anatoly@osovitny.com
882
+
883
+ Created:
884
+ 11 Nov 2023
885
+
886
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
887
+ </file>
888
+ */
889
+
892
890
  /*
893
891
  <file>
894
892
  Project:
@@ -1049,27 +1047,6 @@ class Alerts {
1049
1047
  </file>
1050
1048
  */
1051
1049
 
1052
- /*
1053
- <file>
1054
- Project:
1055
- @osovitny/anatoly
1056
-
1057
- Authors:
1058
- Vadim Osovitny vadim@osovitny.com
1059
- Anatoly Osovitny anatoly@osovitny.com
1060
-
1061
- Created:
1062
- 26 Jun 2020
1063
-
1064
- Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1065
- </file>
1066
- */
1067
- class Guid {
1068
- static newGuid() {
1069
- return v4();
1070
- }
1071
- }
1072
-
1073
1050
  /*
1074
1051
  <file>
1075
1052
  Project:
@@ -1085,141 +1062,13 @@ class Guid {
1085
1062
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1086
1063
  </file>
1087
1064
  */
1088
- // Node
1089
- // SignalR
1090
- // import * as signalR from '@microsoft/signalr';
1091
- // import { NotificationsApiService } from '../../../data/services/notifications/notifications-api-service';
1065
+ //Node
1092
1066
  class NotificationService {
1093
1067
  toastrService;
1094
- // SignalR
1095
- // private hubConnection: signalR.HubConnection;
1096
- // private socketUrl: string;
1097
- // Notifications
1098
- _sessionNotifications = new BehaviorSubject([]);
1099
- _serverNotifications = new BehaviorSubject([]);
1100
- // Public
1101
- sessionNotifications$ = this._sessionNotifications.asObservable();
1102
- serverNotifications$ = this._serverNotifications.asObservable();
1103
1068
  constructor(toastrService) {
1104
1069
  this.toastrService = toastrService;
1105
- // this.onInit();
1106
- }
1107
- /*
1108
- onInit() {
1109
- if (AppCoreSettings.AzureAD) {
1110
- this.authService.getAuthToken().subscribe((token: string) => {
1111
- this.startSignalRConnection(token);
1112
- });
1113
-
1114
- return;
1115
- }
1116
-
1117
- this.startSignalRConnection();
1118
- }
1119
-
1120
- ngOnDestroy() {
1121
- this.stopSignalRConnection();
1122
- }
1123
-
1124
- // SignalR
1125
- private startSignalRConnection(accessToken?) {
1126
- const cskii = AppCoreSettings.selectedClientID;
1127
- // tslint:disable-next-line:variable-name
1128
- const cskii_upn = AppCoreSettings.CSKII_UPN;
1129
- // tslint:disable-next-line:variable-name
1130
- const cli_sessionguid = AppCoreSettings.CLI_SessionGUID;
1131
-
1132
- const url = this.socketUrl + '?cskii=' + cskii + '&cskii_upn=' + cskii_upn + '&cli_sessionguid=' + cli_sessionguid;
1133
-
1134
- if (accessToken) {
1135
- this.hubConnection = new signalR.HubConnectionBuilder()
1136
- .withUrl(url, {
1137
- skipNegotiation: false,
1138
- transport: signalR.HttpTransportType.WebSockets,
1139
- accessTokenFactory: () => accessToken
1140
- })
1141
- .withAutomaticReconnect()
1142
- .configureLogging(signalR.LogLevel.Debug)
1143
- .build();
1144
- }
1145
- else {
1146
- this.hubConnection = new signalR.HubConnectionBuilder()
1147
- .withUrl(this.socketUrl, {
1148
- skipNegotiation: true,
1149
- transport: signalR.HttpTransportType.WebSockets
1150
- })
1151
- .withAutomaticReconnect()
1152
- .configureLogging(signalR.LogLevel.Debug)
1153
- .build();
1154
- }
1155
-
1156
- this.hubConnection
1157
- .start()
1158
- .then(() => this.signalRConnection_onSuccess())
1159
- .catch(err => {
1160
- console.error('Connection failed to SignalR Notification Hub')
1161
- })
1162
- }
1163
-
1164
- private signalRConnection_onSuccess() {
1165
- this.addReceiveMessageDataListener();
1166
-
1167
- this.notificationsApiService.retrieveNotifications().subscribe(data => {
1168
- this.serverNotifications = data;
1169
- });
1170
- }
1171
-
1172
- stopSignalRConnection() {
1173
- if (this.hubConnection) {
1174
- this.hubConnection.stop();
1175
- this.hubConnection = null;
1176
- }
1177
- }
1178
-
1179
- private addReceiveMessageDataListener = () => {
1180
- this.hubConnection.on('ReceiveMessage', (message) => {
1181
- if (message) {
1182
- if (message.type === 'error') {
1183
- this.error(message.text, null, null, false);
1184
- }
1185
- else {
1186
- this.success(message.text, null, null, false);
1187
- }
1188
-
1189
- const notification = {
1190
- id: message.id,
1191
- isNew: message.isNew,
1192
- isSession: true,
1193
- text: message.text,
1194
- type: message.type,
1195
- createdDate: message.createdDate
1196
- };
1197
-
1198
- this.addSessionNotificationToList(notification);
1199
- }
1200
- });
1201
- }
1202
- */
1203
- addSessionNotification(text, type) {
1204
- const id = Guid.newGuid();
1205
- const notification = { id, isNew: true, isSession: true, text, type, createdDate: new Date(Date.now()).toISOString() };
1206
- this.addSessionNotificationToList(notification);
1207
- }
1208
- addSessionNotificationToList(notification) {
1209
- this.sessionNotifications = [
1210
- notification,
1211
- ...this.sessionNotifications,
1212
- ];
1213
- }
1214
- // Public API
1215
- removeNotification(id, isSession) {
1216
- if (isSession) {
1217
- this.sessionNotifications = this.sessionNotifications.filter(notifications => notifications.id !== id);
1218
- }
1219
- else {
1220
- this.serverNotifications = this.serverNotifications.filter(notifications => notifications.id !== id);
1221
- }
1222
1070
  }
1071
+ //Public
1223
1072
  success(text, params, title, createSessionNotification = true) {
1224
1073
  text = L10nUtils.getLocalizedValue(text, params, 'OperationSuccessFull');
1225
1074
  title = L10nUtils.getLocalizedValue(title);
@@ -1227,9 +1076,6 @@ class NotificationService {
1227
1076
  timeOut: 3000,
1228
1077
  progressBar: true
1229
1078
  });
1230
- if (createSessionNotification) {
1231
- this.addSessionNotification(text, 'success');
1232
- }
1233
1079
  }
1234
1080
  info(text, params, title) {
1235
1081
  text = L10nUtils.getLocalizedValue(text, params);
@@ -1254,9 +1100,6 @@ class NotificationService {
1254
1100
  timeOut: 3000,
1255
1101
  progressBar: true
1256
1102
  });
1257
- if (createSessionNotification) {
1258
- this.addSessionNotification(text, 'error');
1259
- }
1260
1103
  }
1261
1104
  cancel(text, params, title) {
1262
1105
  text = L10nUtils.getLocalizedValue(text, params, 'OperationCancelled');
@@ -1266,20 +1109,6 @@ class NotificationService {
1266
1109
  progressBar: true
1267
1110
  });
1268
1111
  }
1269
- // SessionNotifications
1270
- get sessionNotifications() {
1271
- return this._sessionNotifications.getValue();
1272
- }
1273
- set sessionNotifications(val) {
1274
- this._sessionNotifications.next(val);
1275
- }
1276
- // ServerNotifications
1277
- get serverNotifications() {
1278
- return this._serverNotifications.getValue();
1279
- }
1280
- set serverNotifications(val) {
1281
- this._serverNotifications.next(val);
1282
- }
1283
1112
  static ɵfac = function NotificationService_Factory(t) { return new (t || NotificationService)(i0.ɵɵinject(i1$2.ToastrService)); };
1284
1113
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: NotificationService, factory: NotificationService.ɵfac, providedIn: 'root' });
1285
1114
  }
@@ -1358,8 +1187,8 @@ class Stopwatch {
1358
1187
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1359
1188
  </file>
1360
1189
  */
1361
- // Node
1362
- class BaseApiService {
1190
+ //Node
1191
+ class ApiServiceBase {
1363
1192
  http;
1364
1193
  baseUrl;
1365
1194
  constructor(http) {
@@ -1402,8 +1231,8 @@ class BaseApiService {
1402
1231
  return this.http.get(url);
1403
1232
  }
1404
1233
  getJsonFile(fileName) {
1234
+ const appVersion = AppCoreSettings.appVersion;
1405
1235
  const jsonsUrl = AppCoreSettings.jsonsUrl;
1406
- const jsonVersion = AppCoreSettings.jsonVersion;
1407
1236
  const isCDNEnabled = AppCoreSettings.isCDNEnabled;
1408
1237
  const cdnSasToken = AppCoreSettings.cdnSasToken;
1409
1238
  let url = "";
@@ -1411,13 +1240,13 @@ class BaseApiService {
1411
1240
  url = jsonsUrl + "/" + fileName + cdnSasToken;
1412
1241
  }
1413
1242
  else {
1414
- url = jsonsUrl + "/" + fileName + '?' + jsonVersion;
1243
+ url = jsonsUrl + "/" + fileName + '?v=' + appVersion;
1415
1244
  }
1416
1245
  return this.http.get(url);
1417
1246
  }
1418
1247
  getExternalJsonFile(libname, fileName) {
1248
+ const appVersion = AppCoreSettings.appVersion;
1419
1249
  const externalUrl = AppCoreSettings.externalUrl;
1420
- const jsonVersion = AppCoreSettings.jsonVersion;
1421
1250
  const isCDNEnabled = AppCoreSettings.isCDNEnabled;
1422
1251
  const cdnSasToken = AppCoreSettings.cdnSasToken;
1423
1252
  let url = "";
@@ -1425,14 +1254,14 @@ class BaseApiService {
1425
1254
  url = externalUrl + "/" + libname + "/jsons/" + fileName + cdnSasToken;
1426
1255
  }
1427
1256
  else {
1428
- url = externalUrl + "/" + libname + "/jsons/" + fileName + '?' + jsonVersion;
1257
+ url = externalUrl + "/" + libname + "/jsons/" + fileName + '?v=' + appVersion;
1429
1258
  }
1430
1259
  return this.http.get(url);
1431
1260
  }
1432
- static ɵfac = function BaseApiService_Factory(t) { return new (t || BaseApiService)(i0.ɵɵinject(i1$3.HttpClient)); };
1433
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: BaseApiService, factory: BaseApiService.ɵfac });
1261
+ static ɵfac = function ApiServiceBase_Factory(t) { return new (t || ApiServiceBase)(i0.ɵɵinject(i1$3.HttpClient)); };
1262
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ApiServiceBase, factory: ApiServiceBase.ɵfac });
1434
1263
  }
1435
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseApiService, [{
1264
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ApiServiceBase, [{
1436
1265
  type: Injectable
1437
1266
  }], function () { return [{ type: i1$3.HttpClient }]; }, null); })();
1438
1267
 
@@ -1517,7 +1346,7 @@ class SessionStorageService extends WebStorageService {
1517
1346
  </file>
1518
1347
  */
1519
1348
  //Node
1520
- class AppContextService extends BaseApiService {
1349
+ class AppContextService extends ApiServiceBase {
1521
1350
  http;
1522
1351
  localStorage;
1523
1352
  sessionStorage;
@@ -1534,7 +1363,7 @@ class AppContextService extends BaseApiService {
1534
1363
  this.http = http;
1535
1364
  this.localStorage = localStorage;
1536
1365
  this.sessionStorage = sessionStorage;
1537
- this.baseUrl = '/api/appContext';
1366
+ this.baseUrl = `${ApiUrl}/appContext`;
1538
1367
  }
1539
1368
  //Session
1540
1369
  getCurrentFromSession() {
@@ -1649,6 +1478,125 @@ class AppContextService extends BaseApiService {
1649
1478
  type: Injectable
1650
1479
  }], function () { return [{ type: i1$3.HttpClient }, { type: LocalStorageService }, { type: SessionStorageService }]; }, null); })();
1651
1480
 
1481
+ /*
1482
+ <file>
1483
+ Project:
1484
+ @osovitny/anatoly
1485
+
1486
+ Authors:
1487
+ Vadim Osovitny vadim@osovitny.com
1488
+ Anatoly Osovitny anatoly@osovitny.com
1489
+
1490
+ Created:
1491
+ 29 Nov 2020
1492
+
1493
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1494
+ </file>
1495
+ */
1496
+ // Node
1497
+ class DigitalMarketingService {
1498
+ title;
1499
+ meta;
1500
+ dom;
1501
+ constructor(title, meta, dom) {
1502
+ this.title = title;
1503
+ this.meta = meta;
1504
+ this.dom = dom;
1505
+ }
1506
+ updateTitle(title) {
1507
+ this.title.setTitle(title);
1508
+ }
1509
+ updateDescription(desc) {
1510
+ this.meta.updateTag({ name: 'description', content: desc });
1511
+ }
1512
+ updateKeywords(keywords) {
1513
+ this.meta.updateTag({ name: 'keywords', content: keywords });
1514
+ }
1515
+ updateMetaTags(meta) {
1516
+ meta.forEach(m => this.meta.updateTag(m));
1517
+ }
1518
+ setCanonicalUrl(url) {
1519
+ const canUrl = url === undefined ? this.dom.URL : url;
1520
+ const link = this.dom.createElement('link');
1521
+ link.setAttribute('rel', 'canonical');
1522
+ this.dom.head.appendChild(link);
1523
+ link.setAttribute('href', canUrl);
1524
+ }
1525
+ updateCanonicalUrl(url) {
1526
+ const canUrl = url === undefined ? this.dom.URL : url;
1527
+ const head = this.dom.getElementsByTagName('head')[0];
1528
+ let link = this.dom.querySelector(`link[rel='canonical']`) || null;
1529
+ if (link == null) {
1530
+ link = this.dom.createElement('link');
1531
+ head.appendChild(link);
1532
+ }
1533
+ link.setAttribute('rel', 'canonical');
1534
+ link.setAttribute('href', canUrl);
1535
+ }
1536
+ static ɵfac = function DigitalMarketingService_Factory(t) { return new (t || DigitalMarketingService)(i0.ɵɵinject(i1$4.Title), i0.ɵɵinject(i1$4.Meta), i0.ɵɵinject(DOCUMENT)); };
1537
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: DigitalMarketingService, factory: DigitalMarketingService.ɵfac, providedIn: 'root' });
1538
+ }
1539
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DigitalMarketingService, [{
1540
+ type: Injectable,
1541
+ args: [{
1542
+ providedIn: 'root'
1543
+ }]
1544
+ }], function () { return [{ type: i1$4.Title }, { type: i1$4.Meta }, { type: undefined, decorators: [{
1545
+ type: Inject,
1546
+ args: [DOCUMENT]
1547
+ }] }]; }, null); })();
1548
+
1549
+ /*
1550
+ <file>
1551
+ Project:
1552
+ @osovitny/anatoly
1553
+
1554
+ Authors:
1555
+ Vadim Osovitny vadim@osovitny.com
1556
+ Anatoly Osovitny anatoly@osovitny.com
1557
+
1558
+ Created:
1559
+ 29 Nov 2020
1560
+
1561
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1562
+ </file>
1563
+ */
1564
+ // Node
1565
+ class GoogleAnalyticsService {
1566
+ router;
1567
+ subscription;
1568
+ constructor(router) {
1569
+ this.router = router;
1570
+ /*
1571
+ https://yashints.dev/blog/2019/02/12/angular-ga-tagmanager
1572
+ https://developers.google.com/analytics/devguides/collection/gtagjs/pages
1573
+ https://developers.google.com/analytics/devguides/collection/upgrade/analyticsjs
1574
+ */
1575
+ }
1576
+ subscribe() {
1577
+ this.subscription = this.router.events.subscribe({
1578
+ next: (event) => {
1579
+ if (event instanceof NavigationEnd) {
1580
+ if (window.ga) {
1581
+ window.ga('set', 'page', event.urlAfterRedirects);
1582
+ window.ga('send', 'pageview');
1583
+ }
1584
+ }
1585
+ }
1586
+ });
1587
+ }
1588
+ unsubscribe() {
1589
+ if (this.subscription) {
1590
+ this.subscription.unsubscribe();
1591
+ }
1592
+ }
1593
+ static ɵfac = function GoogleAnalyticsService_Factory(t) { return new (t || GoogleAnalyticsService)(i0.ɵɵinject(i1.Router)); };
1594
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: GoogleAnalyticsService, factory: GoogleAnalyticsService.ɵfac });
1595
+ }
1596
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GoogleAnalyticsService, [{
1597
+ type: Injectable
1598
+ }], function () { return [{ type: i1.Router }]; }, null); })();
1599
+
1652
1600
  /*
1653
1601
  <file>
1654
1602
  Project:
@@ -1737,63 +1685,89 @@ class IdleService {
1737
1685
  Anatoly Osovitny anatoly@osovitny.com
1738
1686
 
1739
1687
  Created:
1740
- 29 Nov 2020
1741
-
1688
+ 19 March 2020
1689
+
1742
1690
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1743
1691
  </file>
1744
1692
  */
1745
- // Node
1746
- class DigitalMarketingService {
1747
- title;
1748
- meta;
1749
- dom;
1750
- constructor(title, meta, dom) {
1751
- this.title = title;
1752
- this.meta = meta;
1753
- this.dom = dom;
1754
- }
1755
- updateTitle(title) {
1756
- this.title.setTitle(title);
1693
+ class Utils {
1694
+ static idExistsInQS() {
1695
+ let id = Utils.getValueByNameInQS("id");
1696
+ if (id)
1697
+ return true;
1698
+ return false;
1757
1699
  }
1758
- updateDescription(desc) {
1759
- this.meta.updateTag({ name: 'description', content: desc });
1700
+ static getValueByNameInQS(name) {
1701
+ return Utils.getValueByName(location.search, name);
1760
1702
  }
1761
- updateKeywords(keywords) {
1762
- this.meta.updateTag({ name: 'keywords', content: keywords });
1703
+ static getValueByName(url, name) {
1704
+ name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
1705
+ // tslint:disable-next-line:one-variable-per-declaration
1706
+ const regex = new RegExp('[\\?&]' + name + '=([^&#]*)'), results = regex.exec(url);
1707
+ return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
1763
1708
  }
1764
- updateMetaTags(meta) {
1765
- meta.forEach(m => this.meta.updateTag(m));
1709
+ static copyToClipBoard(event, val) {
1710
+ event.preventDefault();
1711
+ const selBox = document.createElement('textarea');
1712
+ selBox.style.position = 'fixed';
1713
+ selBox.style.left = '0';
1714
+ selBox.style.top = '0';
1715
+ selBox.style.opacity = '0';
1716
+ selBox.value = val;
1717
+ document.body.appendChild(selBox);
1718
+ selBox.focus();
1719
+ selBox.select();
1720
+ document.execCommand('copy');
1721
+ document.body.removeChild(selBox);
1766
1722
  }
1767
- setCanonicalUrl(url) {
1768
- const canUrl = url === undefined ? this.dom.URL : url;
1769
- const link = this.dom.createElement('link');
1770
- link.setAttribute('rel', 'canonical');
1771
- this.dom.head.appendChild(link);
1772
- link.setAttribute('href', canUrl);
1723
+ static downloadFile(name, url) {
1724
+ const link = document.createElement('a');
1725
+ link.download = name;
1726
+ link.href = url;
1727
+ link.click();
1773
1728
  }
1774
- updateCanonicalUrl(url) {
1775
- const canUrl = url === undefined ? this.dom.URL : url;
1776
- const head = this.dom.getElementsByTagName('head')[0];
1777
- let link = this.dom.querySelector(`link[rel='canonical']`) || null;
1778
- if (link == null) {
1779
- link = this.dom.createElement('link');
1780
- head.appendChild(link);
1729
+ static downloadBlobFile(value, fileName) {
1730
+ const nav = window.navigator;
1731
+ if (nav.msSaveOrOpenBlob) {
1732
+ nav.msSaveOrOpenBlob(value, fileName);
1733
+ }
1734
+ else {
1735
+ const downloadURL = window.URL.createObjectURL(value);
1736
+ Utils.downloadFile(fileName, downloadURL);
1781
1737
  }
1782
- link.setAttribute('rel', 'canonical');
1783
- link.setAttribute('href', canUrl);
1784
1738
  }
1785
- static ɵfac = function DigitalMarketingService_Factory(t) { return new (t || DigitalMarketingService)(i0.ɵɵinject(i1$4.Title), i0.ɵɵinject(i1$4.Meta), i0.ɵɵinject(DOCUMENT)); };
1786
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: DigitalMarketingService, factory: DigitalMarketingService.ɵfac, providedIn: 'root' });
1739
+ /*
1740
+ Author:
1741
+ https://medium.com/@mhagemann/the-ultimate-way-to-slugify-a-url-string-in-javascript-b8e4a0d849e1
1742
+ */
1743
+ static slugify(text, prefix = '', postfix = '') {
1744
+ const a = 'àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;';
1745
+ const b = 'aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------';
1746
+ const p = new RegExp(a.split('').join('|'), 'g');
1747
+ /*
1748
+ https://css-tricks.com/snippets/javascript/strip-html-tags-in-javascript/
1749
+ https://stackoverflow.com/questions/822452/strip-html-from-text-javascript
1750
+ */
1751
+ text = text.replace(/(<([^>]+)>)/gi, '');
1752
+ let result = text
1753
+ .toString()
1754
+ .toLowerCase()
1755
+ .replace(/\s+/g, '-') // Replace spaces with -
1756
+ .replace(p, c => b.charAt(a.indexOf(c))) // Replace special characters
1757
+ .replace(/&/g, '-and-') // Replace & with 'and'
1758
+ .replace(/[^\w\-]+/g, '') // Remove all non-word characters
1759
+ .replace(/\-\-+/g, '-') // Replace multiple - with single -
1760
+ .replace(/^-+/, '') // Trim - from start of text
1761
+ .replace(/-+$/, ''); // Trim - from end of text
1762
+ return prefix + result + postfix;
1763
+ }
1764
+ static generateRandom(start, end) {
1765
+ return Math.floor(Math.random() * (end - start + 1)) + start;
1766
+ }
1767
+ static isObjectNullOrEmpty(obj) {
1768
+ return !obj || Object.keys(obj).length == 0;
1769
+ }
1787
1770
  }
1788
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DigitalMarketingService, [{
1789
- type: Injectable,
1790
- args: [{
1791
- providedIn: 'root'
1792
- }]
1793
- }], function () { return [{ type: i1$4.Title }, { type: i1$4.Meta }, { type: undefined, decorators: [{
1794
- type: Inject,
1795
- args: [DOCUMENT]
1796
- }] }]; }, null); })();
1797
1771
 
1798
1772
  /*
1799
1773
  <file>
@@ -1805,46 +1779,65 @@ class DigitalMarketingService {
1805
1779
  Anatoly Osovitny anatoly@osovitny.com
1806
1780
 
1807
1781
  Created:
1808
- 29 Nov 2020
1782
+ 15 Nov 2023
1809
1783
 
1810
1784
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1811
1785
  </file>
1812
1786
  */
1813
- // Node
1814
- class GoogleAnalyticsService {
1815
- router;
1816
- subscription;
1817
- constructor(router) {
1818
- this.router = router;
1819
- /*
1820
- https://yashints.dev/blog/2019/02/12/angular-ga-tagmanager
1821
- https://developers.google.com/analytics/devguides/collection/gtagjs/pages
1822
- https://developers.google.com/analytics/devguides/collection/upgrade/analyticsjs
1823
- */
1787
+ class StarterServiceBase extends ApiServiceBase {
1788
+ http;
1789
+ appContext;
1790
+ constructor(http, appContext) {
1791
+ super(http);
1792
+ this.http = http;
1793
+ this.appContext = appContext;
1794
+ this.baseUrl = ApiUrl;
1824
1795
  }
1825
- subscribe() {
1826
- this.subscription = this.router.events.subscribe({
1827
- next: (event) => {
1828
- if (event instanceof NavigationEnd) {
1829
- if (window.ga) {
1830
- window.ga('set', 'page', event.urlAfterRedirects);
1831
- window.ga('send', 'pageview');
1832
- }
1833
- }
1834
- }
1835
- });
1796
+ applicationStarting() {
1797
+ let context = this.appContext.current;
1798
+ if (!Utils.isObjectNullOrEmpty(context)) {
1799
+ this.appContext.init(context);
1800
+ return of(context);
1801
+ }
1802
+ //Log
1803
+ let stopwatch = new Stopwatch("applicationStarting");
1804
+ stopwatch.start();
1805
+ this.baseUrl = `${this.baseUrl}/appContext`;
1806
+ return this.get('applicationStarting').pipe(map(data => {
1807
+ //Log
1808
+ stopwatch.stop();
1809
+ stopwatch.printElapsedAsMilliseconds();
1810
+ this.appContext.init(data);
1811
+ }));
1836
1812
  }
1837
- unsubscribe() {
1838
- if (this.subscription) {
1839
- this.subscription.unsubscribe();
1840
- }
1813
+ ensureApplicationStarted() {
1814
+ //1. Application Starting
1815
+ let applicationStarting$ = this.applicationStarting();
1816
+ //2. Load json files
1817
+ let jsonFiles$ = this.appContext.loadRequiredJsonFiles();
1818
+ //3. Load required items, like settings
1819
+ let requiredItems$ = this.appContext.loadRequiredItems();
1820
+ //Tasks to execute
1821
+ let parallelTasks = [];
1822
+ if (jsonFiles$)
1823
+ parallelTasks.push(jsonFiles$);
1824
+ if (requiredItems$)
1825
+ parallelTasks.push(requiredItems$);
1826
+ let parallelTasks$ = merge(...parallelTasks);
1827
+ let tasks$ = forkJoin([applicationStarting$, parallelTasks$]);
1828
+ //VadimOS:
1829
+ //concat is NOT wokring here, no idea why. Just executing first task
1830
+ //let tasks$ = concat(applicationStarting$, parallelTasks$);
1831
+ //Log
1832
+ let stopwatch = new Stopwatch("ensureApplicationStarted");
1833
+ stopwatch.start();
1834
+ return tasks$.pipe(map(() => {
1835
+ //Log
1836
+ stopwatch.stop();
1837
+ stopwatch.printElapsedAsMilliseconds();
1838
+ }));
1841
1839
  }
1842
- static ɵfac = function GoogleAnalyticsService_Factory(t) { return new (t || GoogleAnalyticsService)(i0.ɵɵinject(i1.Router)); };
1843
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: GoogleAnalyticsService, factory: GoogleAnalyticsService.ɵfac });
1844
1840
  }
1845
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GoogleAnalyticsService, [{
1846
- type: Injectable
1847
- }], function () { return [{ type: i1.Router }]; }, null); })();
1848
1841
 
1849
1842
  /*
1850
1843
  <file>
@@ -2038,18 +2031,9 @@ class DOM {
2038
2031
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2039
2032
  </file>
2040
2033
  */
2041
- class Subs {
2042
- subs = [];
2043
- constructor() { }
2044
- add(...subscriptions) {
2045
- this.subs = this.subs.concat(subscriptions);
2046
- }
2047
- set sink(subscription) {
2048
- this.subs.push(subscription);
2049
- }
2050
- unsubscribe() {
2051
- this.subs.forEach((sub) => sub && sub.unsubscribe());
2052
- this.subs = [];
2034
+ class Guid {
2035
+ static newGuid() {
2036
+ return v4();
2053
2037
  }
2054
2038
  }
2055
2039
 
@@ -2063,87 +2047,23 @@ class Subs {
2063
2047
  Anatoly Osovitny anatoly@osovitny.com
2064
2048
 
2065
2049
  Created:
2066
- 19 March 2020
2050
+ 26 Jun 2020
2067
2051
 
2068
2052
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2069
2053
  </file>
2070
2054
  */
2071
- class Utils {
2072
- static idExistsInQS() {
2073
- let id = Utils.getValueByNameInQS("id");
2074
- if (id)
2075
- return true;
2076
- return false;
2077
- }
2078
- static getValueByNameInQS(name) {
2079
- return Utils.getValueByName(location.search, name);
2080
- }
2081
- static getValueByName(url, name) {
2082
- name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
2083
- // tslint:disable-next-line:one-variable-per-declaration
2084
- const regex = new RegExp('[\\?&]' + name + '=([^&#]*)'), results = regex.exec(url);
2085
- return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
2086
- }
2087
- static copyToClipBoard(event, val) {
2088
- event.preventDefault();
2089
- const selBox = document.createElement('textarea');
2090
- selBox.style.position = 'fixed';
2091
- selBox.style.left = '0';
2092
- selBox.style.top = '0';
2093
- selBox.style.opacity = '0';
2094
- selBox.value = val;
2095
- document.body.appendChild(selBox);
2096
- selBox.focus();
2097
- selBox.select();
2098
- document.execCommand('copy');
2099
- document.body.removeChild(selBox);
2100
- }
2101
- static downloadFile(name, url) {
2102
- const link = document.createElement('a');
2103
- link.download = name;
2104
- link.href = url;
2105
- link.click();
2106
- }
2107
- static downloadBlobFile(value, fileName) {
2108
- const nav = window.navigator;
2109
- if (nav.msSaveOrOpenBlob) {
2110
- nav.msSaveOrOpenBlob(value, fileName);
2111
- }
2112
- else {
2113
- const downloadURL = window.URL.createObjectURL(value);
2114
- Utils.downloadFile(fileName, downloadURL);
2115
- }
2116
- }
2117
- /*
2118
- Author:
2119
- https://medium.com/@mhagemann/the-ultimate-way-to-slugify-a-url-string-in-javascript-b8e4a0d849e1
2120
- */
2121
- static slugify(text, prefix = '', postfix = '') {
2122
- const a = 'àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;';
2123
- const b = 'aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------';
2124
- const p = new RegExp(a.split('').join('|'), 'g');
2125
- /*
2126
- https://css-tricks.com/snippets/javascript/strip-html-tags-in-javascript/
2127
- https://stackoverflow.com/questions/822452/strip-html-from-text-javascript
2128
- */
2129
- text = text.replace(/(<([^>]+)>)/gi, '');
2130
- let result = text
2131
- .toString()
2132
- .toLowerCase()
2133
- .replace(/\s+/g, '-') // Replace spaces with -
2134
- .replace(p, c => b.charAt(a.indexOf(c))) // Replace special characters
2135
- .replace(/&/g, '-and-') // Replace & with 'and'
2136
- .replace(/[^\w\-]+/g, '') // Remove all non-word characters
2137
- .replace(/\-\-+/g, '-') // Replace multiple - with single -
2138
- .replace(/^-+/, '') // Trim - from start of text
2139
- .replace(/-+$/, ''); // Trim - from end of text
2140
- return prefix + result + postfix;
2055
+ class Subs {
2056
+ subs = [];
2057
+ constructor() { }
2058
+ add(...subscriptions) {
2059
+ this.subs = this.subs.concat(subscriptions);
2141
2060
  }
2142
- static generateRandom(start, end) {
2143
- return Math.floor(Math.random() * (end - start + 1)) + start;
2061
+ set sink(subscription) {
2062
+ this.subs.push(subscription);
2144
2063
  }
2145
- static isObjectNullOrEmpty(obj) {
2146
- return !obj || Object.keys(obj).length == 0;
2064
+ unsubscribe() {
2065
+ this.subs.forEach((sub) => sub && sub.unsubscribe());
2066
+ this.subs = [];
2147
2067
  }
2148
2068
  }
2149
2069
 
@@ -2175,12 +2095,12 @@ class Utils {
2175
2095
 
2176
2096
  Created:
2177
2097
  29 Apr 2018
2178
-
2098
+
2179
2099
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2180
2100
  </file>
2181
2101
  */
2182
2102
  //Node
2183
- class BaseGridReadService extends BehaviorSubject {
2103
+ class GridReadServiceBase extends BehaviorSubject {
2184
2104
  http;
2185
2105
  data = [];
2186
2106
  baseReadUrl;
@@ -2216,10 +2136,10 @@ class BaseGridReadService extends BehaviorSubject {
2216
2136
  }
2217
2137
  });
2218
2138
  }
2219
- static ɵfac = function BaseGridReadService_Factory(t) { return new (t || BaseGridReadService)(i0.ɵɵinject(i1$3.HttpClient)); };
2220
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: BaseGridReadService, factory: BaseGridReadService.ɵfac });
2139
+ static ɵfac = function GridReadServiceBase_Factory(t) { return new (t || GridReadServiceBase)(i0.ɵɵinject(i1$3.HttpClient)); };
2140
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: GridReadServiceBase, factory: GridReadServiceBase.ɵfac });
2221
2141
  }
2222
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseGridReadService, [{
2142
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GridReadServiceBase, [{
2223
2143
  type: Injectable
2224
2144
  }], function () { return [{ type: i1$3.HttpClient }]; }, null); })();
2225
2145
 
@@ -2234,12 +2154,12 @@ class BaseGridReadService extends BehaviorSubject {
2234
2154
 
2235
2155
  Created:
2236
2156
  29 Apr 2018
2237
-
2157
+
2238
2158
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2239
2159
  </file>
2240
2160
  */
2241
2161
  //Node
2242
- class BaseGridEditService extends BaseGridReadService {
2162
+ class GridEditServiceBase extends GridReadServiceBase {
2243
2163
  http;
2244
2164
  baseUrl;
2245
2165
  constructor(http) {
@@ -2293,10 +2213,10 @@ class BaseGridEditService extends BaseGridReadService {
2293
2213
  const url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
2294
2214
  return this.http.post(url, data).pipe(map(res => res));
2295
2215
  }
2296
- static ɵfac = function BaseGridEditService_Factory(t) { return new (t || BaseGridEditService)(i0.ɵɵinject(i1$3.HttpClient)); };
2297
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: BaseGridEditService, factory: BaseGridEditService.ɵfac });
2216
+ static ɵfac = function GridEditServiceBase_Factory(t) { return new (t || GridEditServiceBase)(i0.ɵɵinject(i1$3.HttpClient)); };
2217
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: GridEditServiceBase, factory: GridEditServiceBase.ɵfac });
2298
2218
  }
2299
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseGridEditService, [{
2219
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GridEditServiceBase, [{
2300
2220
  type: Injectable
2301
2221
  }], function () { return [{ type: i1$3.HttpClient }]; }, null); })();
2302
2222
 
@@ -2315,13 +2235,10 @@ class BaseGridEditService extends BaseGridReadService {
2315
2235
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2316
2236
  </file>
2317
2237
  */
2318
- const Consts = {
2319
- //core
2320
- coreApiPath: 'api/core',
2321
- //emails
2322
- emailsApiPath: 'api/emails',
2323
- //notifications
2324
- notificationsApiPath: 'api/notifications'
2238
+ //App
2239
+ const Urls = {
2240
+ coreApiUrl: `${ApiUrl}/core`,
2241
+ emailsApiUrl: `${ApiUrl}/emails`
2325
2242
  };
2326
2243
 
2327
2244
  /*
@@ -2334,30 +2251,48 @@ const Consts = {
2334
2251
  Anatoly Osovitny anatoly@osovitny.com
2335
2252
 
2336
2253
  Created:
2337
- 30 April 2020
2254
+ 02 Aug 2022
2338
2255
 
2339
- Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2256
+ Copyright (c) 2017-2022 Osovitny Inc. All rights reserved.
2340
2257
  </file>
2341
2258
  */
2342
- // Node
2343
- class NotificationsApiService extends BaseApiService {
2259
+ //Node
2260
+ class CoreApiService extends ApiServiceBase {
2344
2261
  http;
2345
2262
  constructor(http) {
2346
2263
  super(http);
2347
2264
  this.http = http;
2348
- this.baseUrl = Consts.notificationsApiPath;
2265
+ this.baseUrl = Urls.coreApiUrl;
2266
+ }
2267
+ getTimezonesJsonFile(done) {
2268
+ this.getExternalJsonFile('anatoly', 'timezones.json').subscribe({
2269
+ next: (data) => {
2270
+ if (done)
2271
+ done(data);
2272
+ }
2273
+ });
2274
+ }
2275
+ getUSStatesJsonFile(done) {
2276
+ this.getExternalJsonFile('anatoly', 'usStates.json').subscribe({
2277
+ next: (data) => {
2278
+ if (done)
2279
+ done(data);
2280
+ }
2281
+ });
2349
2282
  }
2350
- retrieveNotifications() {
2351
- return this.get('retrieveNotifications');
2283
+ getCountriesJsonFile(done) {
2284
+ this.getExternalJsonFile('anatoly', 'countries.json').subscribe({
2285
+ next: (data) => {
2286
+ if (done)
2287
+ done(data);
2288
+ }
2289
+ });
2352
2290
  }
2353
- static ɵfac = function NotificationsApiService_Factory(t) { return new (t || NotificationsApiService)(i0.ɵɵinject(i1$3.HttpClient)); };
2354
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: NotificationsApiService, factory: NotificationsApiService.ɵfac, providedIn: 'root' });
2291
+ static ɵfac = function CoreApiService_Factory(t) { return new (t || CoreApiService)(i0.ɵɵinject(i1$3.HttpClient)); };
2292
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CoreApiService, factory: CoreApiService.ɵfac });
2355
2293
  }
2356
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NotificationsApiService, [{
2357
- type: Injectable,
2358
- args: [{
2359
- providedIn: 'root'
2360
- }]
2294
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CoreApiService, [{
2295
+ type: Injectable
2361
2296
  }], function () { return [{ type: i1$3.HttpClient }]; }, null); })();
2362
2297
 
2363
2298
  /*
@@ -2376,12 +2311,12 @@ class NotificationsApiService extends BaseApiService {
2376
2311
  </file>
2377
2312
  */
2378
2313
  //Node
2379
- class EmailsApiService extends BaseApiService {
2314
+ class EmailsApiService extends ApiServiceBase {
2380
2315
  http;
2381
2316
  constructor(http) {
2382
2317
  super(http);
2383
2318
  this.http = http;
2384
- this.baseUrl = Consts.emailsApiPath;
2319
+ this.baseUrl = Urls.emailsApiUrl;
2385
2320
  }
2386
2321
  sendContactUs(captcha, name, email, topic, subject, message, success, error) {
2387
2322
  return this.post('sendContactUs', { captcha, name, email, topic, subject, message }).subscribe({
@@ -2402,60 +2337,6 @@ class EmailsApiService extends BaseApiService {
2402
2337
  type: Injectable
2403
2338
  }], function () { return [{ type: i1$3.HttpClient }]; }, null); })();
2404
2339
 
2405
- /*
2406
- <file>
2407
- Project:
2408
- @osovitny/anatoly
2409
-
2410
- Authors:
2411
- Vadim Osovitny vadim@osovitny.com
2412
- Anatoly Osovitny anatoly@osovitny.com
2413
-
2414
- Created:
2415
- 02 Aug 2022
2416
-
2417
- Copyright (c) 2017-2022 Osovitny Inc. All rights reserved.
2418
- </file>
2419
- */
2420
- //Node
2421
- class CoreApiService extends BaseApiService {
2422
- http;
2423
- constructor(http) {
2424
- super(http);
2425
- this.http = http;
2426
- this.baseUrl = Consts.coreApiPath;
2427
- }
2428
- getTimezonesJsonFile(done) {
2429
- this.getExternalJsonFile('anatoly', 'timezones.json').subscribe({
2430
- next: (data) => {
2431
- if (done)
2432
- done(data);
2433
- }
2434
- });
2435
- }
2436
- getUSStatesJsonFile(done) {
2437
- this.getExternalJsonFile('anatoly', 'usStates.json').subscribe({
2438
- next: (data) => {
2439
- if (done)
2440
- done(data);
2441
- }
2442
- });
2443
- }
2444
- getCountriesJsonFile(done) {
2445
- this.getExternalJsonFile('anatoly', 'countries.json').subscribe({
2446
- next: (data) => {
2447
- if (done)
2448
- done(data);
2449
- }
2450
- });
2451
- }
2452
- static ɵfac = function CoreApiService_Factory(t) { return new (t || CoreApiService)(i0.ɵɵinject(i1$3.HttpClient)); };
2453
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CoreApiService, factory: CoreApiService.ɵfac });
2454
- }
2455
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CoreApiService, [{
2456
- type: Injectable
2457
- }], function () { return [{ type: i1$3.HttpClient }]; }, null); })();
2458
-
2459
2340
  /*
2460
2341
  <file>
2461
2342
  Project:
@@ -2471,6 +2352,7 @@ class CoreApiService extends BaseApiService {
2471
2352
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2472
2353
  </file>
2473
2354
  */
2355
+ //base
2474
2356
 
2475
2357
  /*
2476
2358
  <file>
@@ -5454,6 +5336,7 @@ class SafeHtmlPipe {
5454
5336
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
5455
5337
  </file>
5456
5338
  */
5339
+ //Node
5457
5340
  let InjectorInstance;
5458
5341
  class AnatolyCoreModule {
5459
5342
  injector;
@@ -5464,14 +5347,14 @@ class AnatolyCoreModule {
5464
5347
  static ɵfac = function AnatolyCoreModule_Factory(t) { return new (t || AnatolyCoreModule)(i0.ɵɵinject(i0.Injector), i0.ɵɵinject(AnatolyCoreModule, 12)); };
5465
5348
  static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AnatolyCoreModule });
5466
5349
  static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
5467
- LoggingService,
5468
- NotificationService,
5469
5350
  AppContextService,
5470
- LoadingService,
5471
5351
  DigitalMarketingService,
5472
5352
  GoogleAnalyticsService,
5353
+ LoadingService,
5473
5354
  LocalStorageService,
5474
- SessionStorageService
5355
+ SessionStorageService,
5356
+ LoggingService,
5357
+ NotificationService
5475
5358
  ], imports: [CommonModule,
5476
5359
  ToastrModule.forRoot(),
5477
5360
  LocalizationSettingsModule,
@@ -5492,15 +5375,15 @@ class AnatolyCoreModule {
5492
5375
  LocalizationModule,
5493
5376
  ],
5494
5377
  providers: [
5495
- LoggingService,
5496
- NotificationService,
5497
5378
  AppContextService,
5498
- LoadingService,
5499
5379
  DigitalMarketingService,
5500
5380
  GoogleAnalyticsService,
5381
+ LoadingService,
5501
5382
  LocalStorageService,
5502
- SessionStorageService
5503
- ],
5383
+ SessionStorageService,
5384
+ LoggingService,
5385
+ NotificationService
5386
+ ]
5504
5387
  }]
5505
5388
  }], function () { return [{ type: i0.Injector }, { type: AnatolyCoreModule, decorators: [{
5506
5389
  type: Optional
@@ -5889,11 +5772,11 @@ class AnatolyModule {
5889
5772
  /*
5890
5773
  * Public API Surface of anatoly-lib
5891
5774
  */
5892
- // Core
5775
+ //Core
5893
5776
 
5894
5777
  /**
5895
5778
  * Generated bundle index. Do not edit.
5896
5779
  */
5897
5780
 
5898
- export { AddressComponent, Alerts, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyModule, AnatolyUIModule, AppContextService, AppCoreSettings, AppName, BaseApiService, BaseComponent, BaseDialog, BaseEditComponent, BaseGoService, BaseGridEditService, BaseGridReadService, BaseHtmlEditorComponent, BaseList, BasePage, BasePagedPage, Browser, BuyAccessButtonComponent, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CheckIconComponent, CompanyComponent, ContactUsDialog, ContactUsForm, Convert, Copy2ClipboardComponent, CoreApiService, DOM, DatapagerComponent, DefaultEditorOptions, DigitalMarketingService, EmailsApiService, FileSizePipe, FormValidationSummaryComponent, FormsHtmlEditorComponent, GlobalErrorHandler, GoogleAnalyticsService, Guid, HoveringDirective, HtmlEditorComponent, IdleService, InjectorInstance, ItemValidationSummaryComponent, LoadingComponent, LoadingService, LocalStorageService, LocalizationInjectorInstance, LocalizationModule, LocalizationService, LocalizationSettingsModule, LocalizePipe, LoggingService, NativeElementDirective, NodataComponent, NotificationService, NotificationsApiService, PageSpinnerComponent, ReplaceTextPipe, SafeHtmlPipe, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, Stopwatch, Subs, SubscribePlanButtonComponent, TimezoneDropdownlist, TranslateModuleAtRoot, UrlSlugComponent, Urls, Utils, ValidationSummaryComponent, XmlFormatter, customTranslateLoaderFactory, localizationInitializerFactory, throwIfAlreadyLoaded };
5781
+ export { AddressComponent, Alerts, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyModule, AnatolyUIModule, ApiServiceBase, ApiUrl, AppContextService, AppCoreSettings, AppName, BaseComponent, BaseDialog, BaseEditComponent, BaseGoService, BaseHtmlEditorComponent, BaseList, BasePage, BasePagedPage, Browser, BuyAccessButtonComponent, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CheckIconComponent, CompanyComponent, ContactUsDialog, ContactUsForm, Convert, Copy2ClipboardComponent, CoreApiService, DOM, DatapagerComponent, DefaultEditorOptions, DigitalMarketingService, EmailsApiService, FileSizePipe, FormValidationSummaryComponent, FormsHtmlEditorComponent, GlobalErrorHandler, GoogleAnalyticsService, GridEditServiceBase, GridReadServiceBase, Guid, HoveringDirective, HtmlEditorComponent, IdleService, InjectorInstance, ItemValidationSummaryComponent, LoadingComponent, LoadingService, LocalStorageService, LocalizationInjectorInstance, LocalizationModule, LocalizationService, LocalizationSettingsModule, LocalizePipe, LoggingService, NativeElementDirective, NodataComponent, NotificationService, PageSpinnerComponent, ReplaceTextPipe, SafeHtmlPipe, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, StarterServiceBase, Stopwatch, Subs, SubscribePlanButtonComponent, TimezoneDropdownlist, TranslateModuleAtRoot, UrlSlugComponent, Utils, ValidationSummaryComponent, XmlFormatter, customTranslateLoaderFactory, localizationInitializerFactory, throwIfAlreadyLoaded };
5899
5782
  //# sourceMappingURL=osovitny-anatoly.mjs.map