@transcommerce/cwm-shared 1.1.35 → 1.1.37

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.
@@ -1004,6 +1004,72 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
1004
1004
  type: Injectable
1005
1005
  }] });
1006
1006
 
1007
+ const DEFAULT_API_CONFIG = {
1008
+ "apiBaseUrl": "https://cheap-weed-menus-webapi.azurewebsites.net",
1009
+ "addCustomerApiRoute": "/AddCustomer",
1010
+ "addSubscriptionApiRoute": "/subscription",
1011
+ "getInventoryApiRoute": "/inventory",
1012
+ "apiKey": "8b66d117-5d23-4b81-8c2f-52142c67d0cd",
1013
+ "clientId": "5dd15878-aa4c-4adf-8650-b931f32a7b67",
1014
+ "locationId": "10f19fc5-31d0-4d76-bad4-ad593c9803ae"
1015
+ };
1016
+
1017
+ const DEFAULT_AUTH_CONFIG = {
1018
+ logLevel: "Info",
1019
+ clientId: "af1486e0-a27f-4c8d-8503-0752d90ce72d",
1020
+ tenantId: "72950c7a-314c-4ce9-87e5-a9866db20070",
1021
+ authority: "https://cwmcustomers.ciamlogin.com/72950c7a-314c-4ce9-87e5-a9866db20070",
1022
+ scopes: "openid,email,profile",
1023
+ redirect_uri: window.location.origin,
1024
+ logout_redirect_uri: window.location.origin + '/logout',
1025
+ prompt: "login",
1026
+ msalDiagnosticsEnabled: true,
1027
+ showPii: true,
1028
+ configConnectString: "Endpoint=https://cheap-weed-menus-appconfig.azconfig.io;Id=7F0m;Secret=7X8pkinp53tA8d4o2LfGUMHBWo54o68jYUSS7JcOnyQmh2lDXetkJQQJ99BEAC8vTInIcYexAAACAZAC2P1s"
1029
+ };
1030
+
1031
+ const DEFAULT_CAROUSEL_CONFIG = {
1032
+ "slidesToShow": 3,
1033
+ "slidesToScroll": 1,
1034
+ "dots": false,
1035
+ "infinite": true,
1036
+ "autoplay": true,
1037
+ "autoplaySpeed": 10000,
1038
+ "speed": 500,
1039
+ "arrows": false
1040
+ };
1041
+
1042
+ const DEFAULT_MENU_BOARD_CONFIG = {
1043
+ "amountToScroll": 1,
1044
+ "autoScrollTimeout": 20,
1045
+ "dataAgeThreshold": 300000
1046
+ };
1047
+
1048
+ const DEFAULT_SLIDE = {
1049
+ "image": "../../../assets/images/tuesday.png",
1050
+ "title": "Doobie Tuesday",
1051
+ "description": "10% off all pre-rolls & packs<",
1052
+ "highlighted": false,
1053
+ "textColor": "black",
1054
+ "backgroundColor": "white"
1055
+ };
1056
+
1057
+ const DEFAULT_CONFIGURATION = {
1058
+ companyName: 'Test Weed Dispensary',
1059
+ authConfig: DEFAULT_AUTH_CONFIG,
1060
+ apiConfig: DEFAULT_API_CONFIG,
1061
+ menuBoardConfig: DEFAULT_MENU_BOARD_CONFIG,
1062
+ footerCarouselConfig: DEFAULT_CAROUSEL_CONFIG,
1063
+ footerCarouselSlideConfig: [DEFAULT_SLIDE]
1064
+ };
1065
+
1066
+ const DEFAULT_SUBSCRIPTION_CONFIG = {
1067
+ amount: 0.01,
1068
+ days: 30,
1069
+ totalOccurrences: 12,
1070
+ trialOccurrences: 0
1071
+ };
1072
+
1007
1073
  var CardTypes;
1008
1074
  (function (CardTypes) {
1009
1075
  CardTypes["Amex"] = "Amex";
@@ -1072,6 +1138,20 @@ class Profile {
1072
1138
  return to;
1073
1139
  }
1074
1140
  }
1141
+ const DEFAULT_PROFILE = {
1142
+ "companyName": "Test Weed Dispensary",
1143
+ "businessPhones": ["503.555.1212"],
1144
+ "displayName": "Demo User",
1145
+ "givenName": "Demo",
1146
+ "id": "1",
1147
+ "jobTitle": "Budtender",
1148
+ "mail": "demo@app.cheapweedmenu.com",
1149
+ "mobilePhone": "503.555.1212",
1150
+ "photoUrl": "",
1151
+ "preferredLanguage": "en-us",
1152
+ "surname": "User",
1153
+ "userPrincipalName": "demo@app.cheapweedmenu.com"
1154
+ };
1075
1155
 
1076
1156
  class Customer {
1077
1157
  id;
@@ -1120,131 +1200,27 @@ class Customer {
1120
1200
  return to;
1121
1201
  }
1122
1202
  }
1203
+ const DEFAULT_CUSTOMER = {
1204
+ "apiClientId": "5dd15878-aa4c-4adf-8650-b931f32a7b67",
1205
+ "apiLocationId": "10f19fc5-31d0-4d76-bad4-ad593c9803ae",
1206
+ "companyName": "Test Weed Dispensary",
1207
+ "emailAddress": "demo@app.cheapweedmenu.com",
1208
+ "id": "1",
1209
+ "phoneNumber": "5035551212",
1210
+ "jobTitle": "Budtender",
1211
+ "userType": UserTypes.Administrator,
1212
+ "displayName": "Demo User",
1213
+ "givenName": "Demo",
1214
+ "surName": "User",
1215
+ "streetAddress": "123 Any Street",
1216
+ "city": "Anytown",
1217
+ "state": "OR",
1218
+ "postalCode": "12345",
1219
+ "country": "USA",
1220
+ "subscriptionId": "1"
1221
+ };
1123
1222
 
1124
- var Justifications;
1125
- (function (Justifications) {
1126
- Justifications["Left"] = "left";
1127
- Justifications["Right"] = "right";
1128
- Justifications["Center"] = "center";
1129
- Justifications["Absolute"] = "absolute";
1130
- })(Justifications || (Justifications = {}));
1131
-
1132
- var LoggingVerbosity;
1133
- (function (LoggingVerbosity) {
1134
- LoggingVerbosity["Error"] = "Error";
1135
- LoggingVerbosity["Warning"] = "Warn";
1136
- LoggingVerbosity["Debug"] = "Debug";
1137
- LoggingVerbosity["Information"] = "Info";
1138
- LoggingVerbosity["None"] = "None";
1139
- })(LoggingVerbosity || (LoggingVerbosity = {}));
1140
-
1141
- var NamedColors;
1142
- (function (NamedColors) {
1143
- NamedColors["Red"] = "red";
1144
- NamedColors["Green"] = "green";
1145
- NamedColors["Blue"] = "blue";
1146
- NamedColors["Yellow"] = "yellow";
1147
- NamedColors["Black"] = "black";
1148
- NamedColors["White"] = "white";
1149
- })(NamedColors || (NamedColors = {}));
1150
-
1151
- class OnElementStyle {
1152
- }
1153
-
1154
- class Product {
1155
- id;
1156
- name;
1157
- description;
1158
- brand;
1159
- price;
1160
- thcPercentage;
1161
- category;
1162
- quantity;
1163
- type;
1164
- pictureURL;
1165
- terpenes;
1166
- static FromFlowhubProduct(from) {
1167
- const to = new Product();
1168
- to.id = from.productId;
1169
- to.name = from.productName;
1170
- to.description = from.productDescription;
1171
- to.brand = from.brand;
1172
- to.price = from.postTaxPriceInPennies;
1173
- to.thcPercentage = 30;
1174
- to.category = from.category;
1175
- to.quantity = from.quantity;
1176
- to.pictureURL = from.productPictureURL;
1177
- to.terpenes = from.terpenes;
1178
- return to;
1179
- }
1180
- }
1181
-
1182
- class SafeHtmlPipe {
1183
- sanitizer;
1184
- constructor(sanitizer) {
1185
- this.sanitizer = sanitizer;
1186
- }
1187
- transform(value) {
1188
- return this.sanitizer.bypassSecurityTrustHtml(value);
1189
- }
1190
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
1191
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: SafeHtmlPipe, isStandalone: false, name: "safeHtml" });
1192
- }
1193
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SafeHtmlPipe, decorators: [{
1194
- type: Pipe,
1195
- args: [{
1196
- name: 'safeHtml',
1197
- standalone: false
1198
- }]
1199
- }], ctorParameters: () => [{ type: i1$1.DomSanitizer }] });
1200
-
1201
- class CwmSharedModule {
1202
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CwmSharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1203
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: CwmSharedModule, declarations: [ExternalNavigationComponent,
1204
- NavigateToRouteComponent,
1205
- PageNotFoundComponent,
1206
- SafeHtmlPipe], imports: [CommonModule,
1207
- MsalModule,
1208
- BrowserModule,
1209
- FormsModule], exports: [CommonModule,
1210
- MsalModule,
1211
- ExternalNavigationComponent,
1212
- NavigateToRouteComponent,
1213
- PageNotFoundComponent,
1214
- SafeHtmlPipe] });
1215
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CwmSharedModule, imports: [CommonModule,
1216
- MsalModule,
1217
- BrowserModule,
1218
- FormsModule, CommonModule,
1219
- MsalModule] });
1220
- }
1221
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CwmSharedModule, decorators: [{
1222
- type: NgModule,
1223
- args: [{
1224
- declarations: [
1225
- ExternalNavigationComponent,
1226
- NavigateToRouteComponent,
1227
- PageNotFoundComponent,
1228
- SafeHtmlPipe
1229
- ],
1230
- imports: [
1231
- CommonModule,
1232
- MsalModule,
1233
- BrowserModule,
1234
- FormsModule
1235
- ],
1236
- exports: [
1237
- CommonModule,
1238
- MsalModule,
1239
- ExternalNavigationComponent,
1240
- NavigateToRouteComponent,
1241
- PageNotFoundComponent,
1242
- SafeHtmlPipe
1243
- ]
1244
- }]
1245
- }] });
1246
-
1247
- const MockInventoryApiResponse = {
1223
+ const DEFAULT_INVENTORY_API_RESPONSE = {
1248
1224
  "status": 200,
1249
1225
  "data": [
1250
1226
  {
@@ -26990,178 +26966,172 @@ const MockInventoryApiResponse = {
26990
26966
  ]
26991
26967
  };
26992
26968
 
26993
- const MockConfig = {
26994
- "companyName": "Test Weed Dispensary",
26995
- "authConfig": {
26996
- "logLevel": "Info",
26997
- "configConnectString": "Endpoint=https://cheap-weed-menus-appconfig.azconfig.io;Id=tyjA;Secret=1FgL95lHkXViZX4Qf2GcRqn26mhTYDVYany8ToXpTnO68AzrdUUEJQQJ99AHAC8vTInIcYexAAACAZACsteF",
26998
- "clientId": "af1486e0-a27f-4c8d-8503-0752d90ce72d",
26999
- "tenantId": "72950c7a-314c-4ce9-87e5-a9866db20070",
27000
- "authority": "https://cwmcustomers.ciamlogin.com/72950c7a-314c-4ce9-87e5-a9866db20070",
27001
- "scopes": "openid,email,profile",
27002
- "redirect_uri": "https://localhost:4280",
27003
- "logout_redirect_uri": "https://localhost:4280/logout",
27004
- "msalDiagnosticsEnabled": true,
27005
- "showPii": true,
27006
- "prompt": "login"
27007
- },
27008
- "apiConfig": {
27009
- "apiBaseUrl": "https://cheap-weed-menus-webapi.azurewebsites.net",
27010
- "addCustomerApiRoute": "/AddCustomer",
27011
- "addSubscriptionApiRoute": "/subscription",
27012
- "getInventoryApiRoute": "/inventory",
27013
- "apiKey": "8b66d117-5d23-4b81-8c2f-52142c67d0cd",
27014
- "clientId": "5dd15878-aa4c-4adf-8650-b931f32a7b67",
27015
- "locationId": "10f19fc5-31d0-4d76-bad4-ad593c9803ae"
27016
- },
27017
- "menuBoardConfig": {
27018
- "amountToScroll": 1,
27019
- "autoScrollTimeout": 20,
27020
- "dataAgeThreshold": 300000
27021
- },
27022
- "footerCarouselConfig": {
27023
- "slidesToShow": 3,
27024
- "slidesToScroll": 1,
27025
- "dots": false,
27026
- "infinite": true,
27027
- "autoplay": true,
27028
- "autoplaySpeed": 10000,
27029
- "speed": 500,
27030
- "arrows": false
27031
- },
27032
- "footerCarouselSlideConfig": [
27033
- {
27034
- "image": "../../../assets/images/sunday.png",
27035
- "title": "CBD Sunday",
27036
- "description": "20% off all CBD products & house pre-rolls",
27037
- "highlighted": false,
27038
- "textColor": "white",
27039
- "backgroundColor": "black"
27040
- },
27041
- {
27042
- "image": "../../../assets/images/new-monday.jpg",
27043
- "title": "Edible Monday",
27044
- "description": "10% off edibles",
27045
- "highlighted": false,
27046
- "textColor": "white",
27047
- "backgroundColor": "black"
27048
- },
27049
- {
27050
- "image": "../../../assets/images/tuesday.png",
27051
- "title": "Doobie Tuesday",
27052
- "description": "10% off all pre-rolls & packs<",
27053
- "highlighted": false,
27054
- "textColor": "black",
27055
- "backgroundColor": "white"
27056
- },
27057
- {
27058
- "image": "../../../assets/images/wednesday.png",
27059
- "title": "Weed Crush Wednesday",
27060
- "description": "10% off all jar bud",
27061
- "highlighted": false,
27062
- "textColor": "black",
27063
- "backgroundColor": "white"
27064
- },
27065
- {
27066
- "image": "../../../assets/images/thursday.png",
27067
- "title": "Thirsty Thursday",
27068
- "description": "10% off Tinctures, RSO & cartridges",
27069
- "highlighted": false,
27070
- "textColor": "black",
27071
- "backgroundColor": "white"
27072
- },
27073
- {
27074
- "image": "../../../assets/images/friday.png",
27075
- "title": "Fire Friday",
27076
- "description": "10% off all jar bud",
27077
- "highlighted": false,
27078
- "textColor": "black",
27079
- "backgroundColor": "white"
27080
- },
27081
- {
27082
- "image": "../../../assets/images/saturday.png",
27083
- "title": "Shatterday Saturday",
27084
- "description": "10% off all concentrate",
27085
- "highlighted": false,
27086
- "textColor": "white",
27087
- "backgroundColor": "black"
27088
- }
27089
- ]
27090
- };
26969
+ var Justifications;
26970
+ (function (Justifications) {
26971
+ Justifications["Left"] = "left";
26972
+ Justifications["Right"] = "right";
26973
+ Justifications["Center"] = "center";
26974
+ Justifications["Absolute"] = "absolute";
26975
+ })(Justifications || (Justifications = {}));
27091
26976
 
27092
- const MockProfile = {
27093
- "companyName": "Test Weed Dispensary",
27094
- "businessPhones": ["503.555.1212"],
27095
- "displayName": "Demo User",
27096
- "givenName": "Demo",
27097
- "id": "1",
27098
- "jobTitle": "Budtender",
27099
- "mail": "demo@app.cheapweedmenu.com",
27100
- "mobilePhone": "503.555.1212",
27101
- "photoUrl": "",
27102
- "preferredLanguage": "en-us",
27103
- "surname": "User",
27104
- "userPrincipalName": "demo@app.cheapweedmenu.com"
27105
- };
26977
+ var LoggingVerbosity;
26978
+ (function (LoggingVerbosity) {
26979
+ LoggingVerbosity["Error"] = "Error";
26980
+ LoggingVerbosity["Warning"] = "Warn";
26981
+ LoggingVerbosity["Debug"] = "Debug";
26982
+ LoggingVerbosity["Information"] = "Info";
26983
+ LoggingVerbosity["None"] = "None";
26984
+ })(LoggingVerbosity || (LoggingVerbosity = {}));
27106
26985
 
27107
- const MockCustomer = {
27108
- "apiClientId": "5dd15878-aa4c-4adf-8650-b931f32a7b67",
27109
- "apiLocationId": "10f19fc5-31d0-4d76-bad4-ad593c9803ae",
27110
- "companyName": "Test Weed Dispensary",
27111
- "emailAddress": "demo@app.cheapweedmenu.com",
27112
- "id": "1",
27113
- "phoneNumber": "5035551212",
27114
- "jobTitle": "Budtender",
27115
- "userType": UserTypes.Administrator,
27116
- "displayName": "Demo User",
27117
- "givenName": "Demo",
27118
- "surName": "User",
27119
- "streetAddress": "123 Any Street",
27120
- "city": "Anytown",
27121
- "state": "OR",
27122
- "postalCode": "12345",
27123
- "country": "USA",
27124
- "subscriptionId": "1"
27125
- };
26986
+ var NamedColors;
26987
+ (function (NamedColors) {
26988
+ NamedColors["Red"] = "red";
26989
+ NamedColors["Green"] = "green";
26990
+ NamedColors["Blue"] = "blue";
26991
+ NamedColors["Yellow"] = "yellow";
26992
+ NamedColors["Black"] = "black";
26993
+ NamedColors["White"] = "white";
26994
+ })(NamedColors || (NamedColors = {}));
27126
26995
 
27127
- /*
27128
- The LogService is really just a wrapper around the existing console logging functionality
27129
- The three main reasons for using this service are:
27130
- 1. The abstraction layer will allow us to pick a different logging endpoint if needed
27131
- 2. This service allows you to specify what level verbosity you want this service tp log with
27132
- 3. Has logic to log method entry and exit points automagically
27133
- 4. Keeps track of call stack for nested method calls
27134
- 02*/
27135
- class LogService {
27136
- logLevel = 'Info';
27137
- _classStack = new Stack();
27138
- get className() {
27139
- return this._classStack.peek() ?? "";
27140
- }
27141
- set className(value) {
27142
- if (this.logLevel === 'None') {
27143
- return;
27144
- }
27145
- if (this._classStack.size > 0 && this._classStack.peek() !== value) {
27146
- //console.groupCollapsed(this.targetName + " - " + value + " - " + new Date().toLocaleString())
27147
- console.groupEnd();
27148
- console.timeEnd(this.targetName);
27149
- this._classStack.pop();
27150
- }
27151
- if (this._classStack.size === 0 || this._classStack.peek() !== value) {
27152
- this._classStack.push(value);
27153
- this.methodName = "constructor()";
27154
- }
27155
- else {
27156
- this._classStack.push(value);
27157
- console.groupCollapsed(this.targetName);
27158
- console.time(this.targetName);
27159
- }
26996
+ class OnElementStyle {
26997
+ }
26998
+
26999
+ class Product {
27000
+ id;
27001
+ name;
27002
+ description;
27003
+ brand;
27004
+ price;
27005
+ thcPercentage;
27006
+ category;
27007
+ quantity;
27008
+ type;
27009
+ pictureURL;
27010
+ terpenes;
27011
+ static FromFlowhubProduct(from) {
27012
+ const to = new Product();
27013
+ to.id = from.productId;
27014
+ to.name = from.productName;
27015
+ to.description = from.productDescription;
27016
+ to.brand = from.brand;
27017
+ to.price = from.postTaxPriceInPennies;
27018
+ to.thcPercentage = 30;
27019
+ to.category = from.category;
27020
+ to.quantity = from.quantity;
27021
+ to.pictureURL = from.productPictureURL;
27022
+ to.terpenes = from.terpenes;
27023
+ return to;
27160
27024
  }
27161
- _methodStack = new Stack();
27025
+ }
27026
+
27027
+ class SafeHtmlPipe {
27028
+ sanitizer;
27029
+ constructor(sanitizer) {
27030
+ this.sanitizer = sanitizer;
27031
+ }
27032
+ transform(value) {
27033
+ return this.sanitizer.bypassSecurityTrustHtml(value);
27034
+ }
27035
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
27036
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: SafeHtmlPipe, isStandalone: false, name: "safeHtml" });
27037
+ }
27038
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SafeHtmlPipe, decorators: [{
27039
+ type: Pipe,
27040
+ args: [{
27041
+ name: 'safeHtml',
27042
+ standalone: false
27043
+ }]
27044
+ }], ctorParameters: () => [{ type: i1$1.DomSanitizer }] });
27045
+
27046
+ class CwmSharedModule {
27047
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CwmSharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
27048
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: CwmSharedModule, declarations: [ExternalNavigationComponent,
27049
+ NavigateToRouteComponent,
27050
+ PageNotFoundComponent,
27051
+ SafeHtmlPipe], imports: [CommonModule,
27052
+ MsalModule,
27053
+ BrowserModule,
27054
+ FormsModule], exports: [CommonModule,
27055
+ MsalModule,
27056
+ ExternalNavigationComponent,
27057
+ NavigateToRouteComponent,
27058
+ PageNotFoundComponent,
27059
+ SafeHtmlPipe] });
27060
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CwmSharedModule, imports: [CommonModule,
27061
+ MsalModule,
27062
+ BrowserModule,
27063
+ FormsModule, CommonModule,
27064
+ MsalModule] });
27065
+ }
27066
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CwmSharedModule, decorators: [{
27067
+ type: NgModule,
27068
+ args: [{
27069
+ declarations: [
27070
+ ExternalNavigationComponent,
27071
+ NavigateToRouteComponent,
27072
+ PageNotFoundComponent,
27073
+ SafeHtmlPipe
27074
+ ],
27075
+ imports: [
27076
+ CommonModule,
27077
+ MsalModule,
27078
+ BrowserModule,
27079
+ FormsModule
27080
+ ],
27081
+ exports: [
27082
+ CommonModule,
27083
+ MsalModule,
27084
+ ExternalNavigationComponent,
27085
+ NavigateToRouteComponent,
27086
+ PageNotFoundComponent,
27087
+ SafeHtmlPipe
27088
+ ]
27089
+ }]
27090
+ }] });
27091
+
27092
+ const MockInventoryApiResponse = DEFAULT_INVENTORY_API_RESPONSE;
27093
+
27094
+ const MockConfig = DEFAULT_CONFIGURATION;
27095
+
27096
+ const MockProfile = DEFAULT_PROFILE;
27097
+
27098
+ const MockCustomer = DEFAULT_CUSTOMER;
27099
+
27100
+ /*
27101
+ * The ClassLoggerService is really just a wrapper around the existing console logging functionality
27102
+ * It is not intended to be used as a singleton service, but rather to be instantiated for each class that needs logging.
27103
+ * For that reason, it is registered with DI as a plain Injectable service, not a Root Injectable service.
27104
+ * The four main reasons for using this service are:
27105
+ * 1. The abstraction layer will allow us to pick a different logging endpoint if needed
27106
+ * 2. This service allows you to specify what level of verbosity you want this service to log with
27107
+ * 3. Has logic to log classname, method entry, and method exit points automagically
27108
+ * 4. Keeps track of the call stack and can group nested method calls if collapseGroups is set to true
27109
+ */
27110
+ class ClassLoggerService {
27111
+ // Determines what level of verbosity you want this service to log with.
27112
+ // This can be set to 'None', 'Error', 'Warn', 'Info', 'Debug', or 'Trace'.
27113
+ logLevel = 'Info';
27114
+ // Determine if method entry and exit points should be logged in collapsed groups
27115
+ collapseGroups = true;
27116
+ // This will contain the class name.
27117
+ _className = "";
27118
+ // Gets the class name
27119
+ get className() {
27120
+ return this._className;
27121
+ }
27122
+ // Sets the class name and logs the method name as the constructor.
27123
+ set className(value) {
27124
+ this._className = value;
27125
+ this.methodName = "constructor()";
27126
+ }
27127
+ // This will contain the call stack of all the method names from this class that got ua to this method.
27128
+ // The top of the stack will be the method that called the current method, and so on down the call stack
27129
+ callStack = new Stack();
27130
+ // This gets the method name that is currently being executed for the top of the call stack.
27162
27131
  get methodName() {
27163
- return this._methodStack.peek() ?? "";
27132
+ return this.callStack.peek() ?? "";
27164
27133
  }
27134
+ // This sets the method name that is currently being executed for the top of the call stack amd logs the method entry point.
27165
27135
  set methodName(value) {
27166
27136
  if (this.logLevel === 'None') {
27167
27137
  return;
@@ -27170,64 +27140,76 @@ class LogService {
27170
27140
  this.endOfMethod();
27171
27141
  }
27172
27142
  else {
27173
- this._methodStack.push(value);
27174
- console.groupCollapsed(this.targetName);
27143
+ this.callStack.push(value);
27144
+ if (this.collapseGroups)
27145
+ console.groupCollapsed(this.targetName);
27146
+ else
27147
+ console.group(this.targetName);
27175
27148
  console.time(this.targetName);
27176
- this.info("Start of method");
27149
+ this.trace("Start of method");
27177
27150
  }
27178
27151
  }
27152
+ // This is used to signal the end of a method and logs the method exit point.
27153
+ // It also pops the current method off the top of the call stack
27179
27154
  endOfMethod() {
27180
- this.info("End of method");
27155
+ this.trace("End of method");
27181
27156
  console.groupEnd();
27182
27157
  console.timeEnd(this.targetName);
27183
- this._methodStack.pop();
27158
+ this.callStack.pop();
27184
27159
  }
27160
+ // This will contain the class name and method name.
27185
27161
  get targetName() {
27186
27162
  if (this.methodName === "")
27187
27163
  return this.className;
27188
27164
  else
27189
- return this.className + "." + this.methodName;
27165
+ return `${this.className}.${this.methodName}`;
27190
27166
  }
27167
+ // Prefix used for all log messages.
27168
+ // It contains the date and time of the log message, the class name, and the method name.
27191
27169
  get prefix() {
27192
- return Date.now().toLocaleString() + " " + this.targetName + "> ";
27170
+ return `${new Date().toLocaleString()} ${this.targetName}> `;
27193
27171
  }
27194
- log(message, ...optionalParams) {
27195
- if (this.logLevel != 'None') {
27196
- console.log(this.prefix + " " + message, optionalParams);
27172
+ // This will only contain Errors
27173
+ error(message, ...optionalParams) {
27174
+ if (this.logLevel === 'Error') {
27175
+ console.error(`${this.prefix} Error: ${message}`, optionalParams);
27197
27176
  }
27198
27177
  }
27199
- debug(message, ...optionalParams) {
27200
- if (this.logLevel === 'Debug') {
27201
- console.debug(this.prefix + " Debug: " + message, optionalParams);
27178
+ // This will Warnings and Errors
27179
+ warn(message, ...optionalParams) {
27180
+ if (this.logLevel === 'Warn' || this.logLevel === 'Error') {
27181
+ console.warn(`${this.prefix} Warning: ${message}`, optionalParams);
27202
27182
  }
27203
27183
  }
27184
+ // Default log level. This will contain Information, Warnings, and Error.
27185
+ // This is used to provide general information about app flow but shouldn't contain values.
27204
27186
  info(message, ...optionalParams) {
27205
- if (this.logLevel === 'Debug' || this.logLevel === 'Info') {
27206
- console.info(this.prefix + " Information: " + message, optionalParams);
27187
+ if (this.logLevel === 'Info' || this.logLevel === 'Warn' || this.logLevel === 'Error') {
27188
+ console.info(`${this.prefix} Information: ${message}`, optionalParams);
27207
27189
  }
27208
27190
  }
27209
- warn(message, ...optionalParams) {
27210
- if (this.logLevel === 'Warn' || this.logLevel === 'Debug' || this.logLevel === 'Info') {
27211
- console.warn(this.prefix + " Warning: " + message, optionalParams);
27191
+ // Useful for debugging, This will contain Debug, Information, Warnings, and Error.
27192
+ // If actual values are put in the logs, this should be chosen; they may need to be sanitized
27193
+ debug(message, ...optionalParams) {
27194
+ if (this.logLevel === 'Debug' || this.logLevel === 'Info' || this.logLevel === 'Warn' || this.logLevel === 'Error') {
27195
+ console.debug(`${this.prefix} Debug: ${message}`, optionalParams);
27212
27196
  }
27213
27197
  }
27214
- error(message, ...optionalParams) {
27198
+ // The highest verbosity should log a crazy number of records. This will contain Trace, Debug, Information, Warnings, and Error (Any level other than None). they may need to be sanitized
27199
+ trace(message, ...optionalParams) {
27215
27200
  if (this.logLevel != 'None') {
27216
- console.error(this.prefix + " Error: " + message, optionalParams);
27201
+ console.log(`${this.prefix} Trace: ${message}`, optionalParams);
27217
27202
  }
27218
27203
  }
27219
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: LogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
27220
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: LogService, providedIn: 'root' });
27204
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ClassLoggerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
27205
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ClassLoggerService });
27221
27206
  }
27222
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: LogService, decorators: [{
27223
- type: Injectable,
27224
- args: [{
27225
- providedIn: 'root'
27226
- }]
27207
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ClassLoggerService, decorators: [{
27208
+ type: Injectable
27227
27209
  }] });
27228
27210
 
27229
27211
  class ConfigService {
27230
- logService;
27212
+ logger;
27231
27213
  mockData = false;
27232
27214
  configClient;
27233
27215
  configConnectString;
@@ -27238,40 +27220,41 @@ class ConfigService {
27238
27220
  set configCache(value) {
27239
27221
  this._configCache = value;
27240
27222
  }
27241
- constructor(logService) {
27242
- this.logService = logService;
27243
- this.logService.className = "ConfigService";
27223
+ constructor(logger) {
27224
+ this.logger = logger;
27225
+ this.logger.className = "ConfigService";
27244
27226
  this.configConnectString = "Endpoint=https://cheap-weed-menus-appconfig.azconfig.io;Id=tyjA;Secret=1FgL95lHkXViZX4Qf2GcRqn26mhTYDVYany8ToXpTnO68AzrdUUEJQQJ99AHAC8vTInIcYexAAACAZACsteF";
27245
27227
  this.configClient = new AppConfigurationClient(this.configConnectString);
27246
- this.logService.log("Config Client", this.configClient);
27247
- this.logService.methodName = "";
27228
+ this.logger.info("Config Client", this.configClient);
27229
+ this.logger.methodName = "";
27248
27230
  }
27249
27231
  async getConfigurationSettingAsync(key, label) {
27250
- this.logService.methodName = "getConfigurationSettingAsync()";
27232
+ this.logger.methodName = "getConfigurationSettingAsync()";
27251
27233
  let setting = {};
27252
- this.logService.log("Get Configuration Setting for Key/Label requested", key, label);
27234
+ this.logger.info("Get Configuration Setting for Key/Label requested", key, label);
27253
27235
  if (this.mockData || this.configCache != undefined) {
27254
27236
  if (this.configCache == undefined) {
27255
27237
  this.configCache = MockConfig;
27256
- this.logService.log("Configuration Cache was undefined and Mock Data Enabled. Mock Config will be cached and used for this and all subsequent calls", this.configCache);
27238
+ this.logger.info("Configuration Cache was undefined and Mock Data Enabled. Mock Config will be cached and used for this and all subsequent calls", this.configCache);
27257
27239
  }
27258
27240
  setting.key = key;
27259
27241
  setting.value = JSON.stringify(this.configCache);
27260
27242
  if (this.mockData)
27261
- this.logService.log("Mock Data Enabled, Skipping getConfigurationSetting() and using Mock Config from the Configuration Cache", this.configCache);
27262
- this.logService.log("Configuration Cache was available, skipping getConfigurationSetting() and using Cached Configuration", this.configCache);
27243
+ this.logger.info("Mock Data Enabled, Skipping getConfigurationSetting() and using Mock Config from the Configuration Cache", this.configCache);
27244
+ else
27245
+ this.logger.info("Configuration Cache was available, skipping getConfigurationSetting() and using Cached Configuration", this.configCache);
27263
27246
  }
27264
27247
  else if (this.configCache == undefined) {
27265
- this.logService.log("Configuration Cache was undefined and Mock Data disabled. Getting Configuration Setting Key/Label. Configuration will be cached and used for this and all subsequent calls", key, label);
27248
+ this.logger.info("Configuration Cache was undefined and Mock Data disabled. Getting Configuration Setting Key/Label. Configuration will be cached and used for this and all subsequent calls", key, label);
27266
27249
  setting = await this.configClient.getConfigurationSetting({ key: key, label: label.replace(".", "") });
27267
27250
  }
27268
27251
  return setting.value;
27269
27252
  }
27270
27253
  async setConfigurationSettingAsync(templateName, label, setting, contentType = "Text") {
27271
- this.logService.className = "ConfigService";
27272
- this.logService.methodName = "setConfigurationSettingAsync()";
27254
+ this.logger.methodName = "setConfigurationSettingAsync()";
27273
27255
  if (this.mockData) {
27274
- this.logService.log("Mock Data Enabled, Skipping setConfigurationSettingAsync()");
27256
+ this.logger.info("Mock Data Enabled, Skipping setConfigurationSettingAsync()");
27257
+ this.logger.methodName = "";
27275
27258
  return;
27276
27259
  }
27277
27260
  const configurationSetting = {
@@ -27280,46 +27263,45 @@ class ConfigService {
27280
27263
  value: setting,
27281
27264
  contentType: contentType,
27282
27265
  };
27283
- this.logService.log("Setting", configurationSetting);
27266
+ this.logger.info("Calling configClient.setConfigurationSetting", configurationSetting);
27284
27267
  await this.configClient.setConfigurationSetting(configurationSetting);
27285
- this.logService.methodName = "";
27268
+ this.logger.methodName = "";
27286
27269
  }
27287
27270
  async getConfigAsync(company) {
27288
- this.logService.className = "ConfigService";
27289
- this.logService.methodName = "getConfigAsync()";
27271
+ this.logger.methodName = "getConfigAsync()";
27290
27272
  if (this.mockData) {
27291
27273
  this.configCache = MockConfig;
27292
- this.logService.log("Mock Data Enabled, Using Mock Config", this.configCache);
27274
+ this.logger.info("Mock Data Enabled, Using Mock Config", this.configCache);
27293
27275
  }
27294
27276
  else if (this.configCache == undefined) {
27295
- this.logService.log("Loading Configuration from Azure App Configuration");
27277
+ this.logger.info("Config Cache was undefined. Loading Configuration from Azure App Configuration");
27296
27278
  const jsonConfig = await this.getConfigurationSettingAsync("App.Config.Json", company) ?? "{ }";
27297
27279
  this.configCache = JSON.parse(jsonConfig);
27298
- this.logService.log("Loaded and Cached Configuration from Azure App Configuration", this.configCache);
27280
+ this.logger.debug("Loaded and Cached Configuration from Azure App Configuration", this.configCache);
27299
27281
  }
27300
27282
  else {
27301
- this.logService.log("Using Cached Configuration", this.configCache);
27283
+ this.logger.info("Using Cached Configuration", this.configCache);
27302
27284
  }
27303
27285
  const config = this.configCache;
27304
- this.logService.methodName = "";
27286
+ this.logger.methodName = "";
27305
27287
  return config;
27306
27288
  }
27307
27289
  async saveConfigAsync(config, company) {
27308
- this.logService.className = "ConfigService";
27309
- this.logService.methodName = "saveConfigAsync()";
27290
+ this.logger.methodName = "saveConfigAsync()";
27310
27291
  // Update configuration cache
27311
27292
  this.configCache = config;
27312
- this.logService.log("Updated Config Cache", this.configCache);
27293
+ this.logger.info("Updated Config Cache", this.configCache);
27313
27294
  if (this.mockData) {
27314
- this.logService.log("Mock Data Enabled, Skipping setConfigurationSettingAsync()");
27295
+ this.logger.info("Mock Data Enabled, Skipping setConfigurationSettingAsync()");
27296
+ this.logger.methodName = "";
27315
27297
  return;
27316
27298
  }
27317
- this.logService.log("Saving Configuration to Azure App Configuration");
27299
+ this.logger.info("Saving Configuration to Azure App Configuration");
27318
27300
  await this.setConfigurationSettingAsync("App.Config.Json", company, config, "JSON");
27319
- this.logService.log("Saved Configuration to Azure App Configuration");
27320
- this.logService.methodName = "";
27301
+ this.logger.debug("Saved Configuration to Azure App Configuration");
27302
+ this.logger.methodName = "";
27321
27303
  }
27322
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ConfigService, deps: [{ token: LogService }], target: i0.ɵɵFactoryTarget.Injectable });
27304
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ConfigService, deps: [{ token: ClassLoggerService }], target: i0.ɵɵFactoryTarget.Injectable });
27323
27305
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ConfigService, providedIn: 'root' });
27324
27306
  }
27325
27307
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ConfigService, decorators: [{
@@ -27327,12 +27309,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
27327
27309
  args: [{
27328
27310
  providedIn: 'root'
27329
27311
  }]
27330
- }], ctorParameters: () => [{ type: LogService }] });
27312
+ }], ctorParameters: () => [{ type: ClassLoggerService }] });
27331
27313
 
27332
27314
  class BaseApiService {
27333
27315
  configService;
27334
27316
  httpClient;
27335
- logService;
27317
+ logger;
27336
27318
  config;
27337
27319
  get apiBaseUrl() {
27338
27320
  if (this.config)
@@ -27343,12 +27325,12 @@ class BaseApiService {
27343
27325
  get apiFullUrl() {
27344
27326
  return this.apiBaseUrl;
27345
27327
  }
27346
- constructor(configService, httpClient, logService) {
27328
+ constructor(configService, httpClient, logger) {
27347
27329
  this.configService = configService;
27348
27330
  this.httpClient = httpClient;
27349
- this.logService = logService;
27331
+ this.logger = logger;
27350
27332
  }
27351
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: BaseApiService, deps: [{ token: ConfigService }, { token: i2$1.HttpClient }, { token: LogService }], target: i0.ɵɵFactoryTarget.Injectable });
27333
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: BaseApiService, deps: [{ token: ConfigService }, { token: i2$1.HttpClient }, { token: ClassLoggerService }], target: i0.ɵɵFactoryTarget.Injectable });
27352
27334
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: BaseApiService, providedIn: 'root' });
27353
27335
  }
27354
27336
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: BaseApiService, decorators: [{
@@ -27356,94 +27338,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
27356
27338
  args: [{
27357
27339
  providedIn: 'root'
27358
27340
  }]
27359
- }], ctorParameters: () => [{ type: ConfigService }, { type: i2$1.HttpClient }, { type: LogService }] });
27360
-
27361
- /*
27362
- *The ClassLoggerService is really just a wrapper around the existing console logging functionality
27363
- *The four main reasons for using this service are:
27364
- * 1. The abstraction layer will allow us to pick a different logging endpoint if needed
27365
- * 2. This service allows you to specify what level of verbosity you want this service to log with
27366
- * 3. Has logic to log classname, method entry, and method exit points automagically
27367
- * 4. Keeps track of the call stack to group nested method calls
27368
- */
27369
- class ClassLoggerService {
27370
- logLevel = 'Info';
27371
- collapseGroups = true;
27372
- _className = "";
27373
- get className() {
27374
- return this._className;
27375
- }
27376
- set className(value) {
27377
- this._className = value;
27378
- this.methodName = "constructor()";
27379
- }
27380
- callStack = new Stack();
27381
- get methodName() {
27382
- return this.callStack.peek() ?? "";
27383
- }
27384
- set methodName(value) {
27385
- if (this.logLevel === 'None') {
27386
- return;
27387
- }
27388
- if (value === "") {
27389
- this.endOfMethod();
27390
- }
27391
- else {
27392
- this.callStack.push(value);
27393
- if (this.collapseGroups)
27394
- console.groupCollapsed(this.targetName);
27395
- else
27396
- console.group(this.targetName);
27397
- console.time(this.targetName);
27398
- this.info("Start of method");
27399
- }
27400
- }
27401
- endOfMethod() {
27402
- this.info("End of method");
27403
- console.groupEnd();
27404
- console.timeEnd(this.targetName);
27405
- this.callStack.pop();
27406
- }
27407
- get targetName() {
27408
- if (this.methodName === "")
27409
- return this.className;
27410
- else
27411
- return `${this.className}.${this.methodName}`;
27412
- }
27413
- get prefix() {
27414
- return `${new Date().toLocaleString()} ${this.targetName}> `;
27415
- }
27416
- log(message, ...optionalParams) {
27417
- if (this.logLevel != 'None') {
27418
- console.log(`${this.prefix} ${message}`, optionalParams);
27419
- }
27420
- }
27421
- debug(message, ...optionalParams) {
27422
- if (this.logLevel === 'Debug') {
27423
- console.debug(`${this.prefix} Debug: ${message}`, optionalParams);
27424
- }
27425
- }
27426
- info(message, ...optionalParams) {
27427
- if (this.logLevel === 'Debug' || this.logLevel === 'Info') {
27428
- console.info(`${this.prefix} Information: ${message}`, optionalParams);
27429
- }
27430
- }
27431
- warn(message, ...optionalParams) {
27432
- if (this.logLevel === 'Warn' || this.logLevel === 'Debug' || this.logLevel === 'Info') {
27433
- console.warn(`${this.prefix} Warning: ${message}`, optionalParams);
27434
- }
27435
- }
27436
- error(message, ...optionalParams) {
27437
- if (this.logLevel != 'None') {
27438
- console.error(`${this.prefix} Error: ${message}`, optionalParams);
27439
- }
27440
- }
27441
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ClassLoggerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
27442
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ClassLoggerService });
27443
- }
27444
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ClassLoggerService, decorators: [{
27445
- type: Injectable
27446
- }] });
27341
+ }], ctorParameters: () => [{ type: ConfigService }, { type: i2$1.HttpClient }, { type: ClassLoggerService }] });
27447
27342
 
27448
27343
  class CustomerApiService extends BaseApiService {
27449
27344
  get apiFullUrl() {
@@ -27467,9 +27362,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
27467
27362
 
27468
27363
  class InventoryApiService extends BaseApiService {
27469
27364
  useMockData = false;
27470
- constructor(configService, httpClient, logService) {
27471
- super(configService, httpClient, logService);
27472
- logService.className = "InventoryApiService";
27365
+ constructor(configService, httpClient, logger) {
27366
+ super(configService, httpClient, logger);
27367
+ logger.className = "InventoryApiService";
27473
27368
  }
27474
27369
  get httpHeaders() {
27475
27370
  return new HttpHeaders()
@@ -27481,21 +27376,21 @@ class InventoryApiService extends BaseApiService {
27481
27376
  return this.apiBaseUrl + (this.config ?? MockConfig.apiConfig).getInventoryApiRoute;
27482
27377
  }
27483
27378
  async getProductsAsync(companyName) {
27484
- this.logService.methodName = "getProductsAsync()";
27379
+ this.logger.methodName = "getProductsAsync()";
27485
27380
  let response;
27486
27381
  this.configService.mockData = this.useMockData;
27487
- this.logService.log("Fetching Configuration for Company", companyName);
27382
+ this.logger.debug("Fetching Configuration for Company", companyName);
27488
27383
  this.config = (await this.configService.getConfigAsync(companyName)).apiConfig;
27489
- this.logService.log("Fetching Products for Company", companyName);
27384
+ this.logger.debug("Fetching Products for Company", companyName);
27490
27385
  if (this.useMockData) {
27491
27386
  response = Promise.resolve(MockInventoryApiResponse);
27492
- this.logService.log("Mock Data Returned", response);
27387
+ this.logger.debug("Mock Data Returned", response);
27493
27388
  }
27494
27389
  else {
27495
27390
  response = firstValueFrom(this.httpClient.get(this.apiFullUrl, { headers: this.httpHeaders }));
27496
- this.logService.log("Inventory API Response", response);
27391
+ this.logger.debug("Inventory API Response", response);
27497
27392
  }
27498
- this.logService.methodName = "";
27393
+ this.logger.methodName = "";
27499
27394
  return response;
27500
27395
  }
27501
27396
  async getCategoriesAsync(companyName) {
@@ -27521,7 +27416,7 @@ class InventoryApiService extends BaseApiService {
27521
27416
  return productsByAllCategories;
27522
27417
  }
27523
27418
  ;
27524
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: InventoryApiService, deps: [{ token: ConfigService }, { token: i2$1.HttpClient }, { token: LogService }], target: i0.ɵɵFactoryTarget.Injectable });
27419
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: InventoryApiService, deps: [{ token: ConfigService }, { token: i2$1.HttpClient }, { token: ClassLoggerService }], target: i0.ɵɵFactoryTarget.Injectable });
27525
27420
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: InventoryApiService, providedIn: 'root' });
27526
27421
  }
27527
27422
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: InventoryApiService, decorators: [{
@@ -27529,7 +27424,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
27529
27424
  args: [{
27530
27425
  providedIn: 'root'
27531
27426
  }]
27532
- }], ctorParameters: () => [{ type: ConfigService }, { type: i2$1.HttpClient }, { type: LogService }] });
27427
+ }], ctorParameters: () => [{ type: ConfigService }, { type: i2$1.HttpClient }, { type: ClassLoggerService }] });
27533
27428
 
27534
27429
  /**
27535
27430
  * Provides a wrapper for accessing the web storage API and synchronizing session storage across tabs/windows.
@@ -27812,6 +27707,108 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
27812
27707
  }]
27813
27708
  }] });
27814
27709
 
27710
+ /*
27711
+ The ClassLoggerService is really just a wrapper around the existing console logging functionality
27712
+ The three main reasons for using this service are:
27713
+ 1. The abstraction layer will allow us to pick a different logging endpoint if needed
27714
+ 2. This service allows you to specify what level verbosity you want this service tp log with
27715
+ 3. Has logic to log method entry and exit points automagically
27716
+ 4. Keeps track of call stack for nested method calls
27717
+ 02*/
27718
+ class LogService {
27719
+ logLevel = 'Info';
27720
+ _classStack = new Stack();
27721
+ get className() {
27722
+ return this._classStack.peek() ?? "";
27723
+ }
27724
+ set className(value) {
27725
+ if (this.logLevel === 'None') {
27726
+ return;
27727
+ }
27728
+ if (this._classStack.size > 0 && this._classStack.peek() !== value) {
27729
+ //console.groupCollapsed(this.targetName + " - " + value + " - " + new Date().toLocaleString())
27730
+ console.groupEnd();
27731
+ console.timeEnd(this.targetName);
27732
+ this._classStack.pop();
27733
+ }
27734
+ if (this._classStack.size === 0 || this._classStack.peek() !== value) {
27735
+ this._classStack.push(value);
27736
+ this.methodName = "constructor()";
27737
+ }
27738
+ else {
27739
+ this._classStack.push(value);
27740
+ console.groupCollapsed(this.targetName);
27741
+ console.time(this.targetName);
27742
+ }
27743
+ }
27744
+ _methodStack = new Stack();
27745
+ get methodName() {
27746
+ return this._methodStack.peek() ?? "";
27747
+ }
27748
+ set methodName(value) {
27749
+ if (this.logLevel === 'None') {
27750
+ return;
27751
+ }
27752
+ if (value === "") {
27753
+ this.endOfMethod();
27754
+ }
27755
+ else {
27756
+ this._methodStack.push(value);
27757
+ console.groupCollapsed(this.targetName);
27758
+ console.time(this.targetName);
27759
+ this.info("Start of method");
27760
+ }
27761
+ }
27762
+ endOfMethod() {
27763
+ this.info("End of method");
27764
+ console.groupEnd();
27765
+ console.timeEnd(this.targetName);
27766
+ this._methodStack.pop();
27767
+ }
27768
+ get targetName() {
27769
+ if (this.methodName === "")
27770
+ return this.className;
27771
+ else
27772
+ return this.className + "." + this.methodName;
27773
+ }
27774
+ get prefix() {
27775
+ return Date.now().toLocaleString() + " " + this.targetName + "> ";
27776
+ }
27777
+ log(message, ...optionalParams) {
27778
+ if (this.logLevel != 'None') {
27779
+ console.log(this.prefix + " " + message, optionalParams);
27780
+ }
27781
+ }
27782
+ debug(message, ...optionalParams) {
27783
+ if (this.logLevel === 'Debug') {
27784
+ console.debug(this.prefix + " Debug: " + message, optionalParams);
27785
+ }
27786
+ }
27787
+ info(message, ...optionalParams) {
27788
+ if (this.logLevel === 'Debug' || this.logLevel === 'Info') {
27789
+ console.info(this.prefix + " Information: " + message, optionalParams);
27790
+ }
27791
+ }
27792
+ warn(message, ...optionalParams) {
27793
+ if (this.logLevel === 'Warn' || this.logLevel === 'Debug' || this.logLevel === 'Info') {
27794
+ console.warn(this.prefix + " Warning: " + message, optionalParams);
27795
+ }
27796
+ }
27797
+ error(message, ...optionalParams) {
27798
+ if (this.logLevel != 'None') {
27799
+ console.error(this.prefix + " Error: " + message, optionalParams);
27800
+ }
27801
+ }
27802
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: LogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
27803
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: LogService, providedIn: 'root' });
27804
+ }
27805
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: LogService, decorators: [{
27806
+ type: Injectable,
27807
+ args: [{
27808
+ providedIn: 'root'
27809
+ }]
27810
+ }] });
27811
+
27815
27812
  // ================================================
27816
27813
  // Export every type you want this module to expose
27817
27814
  // ================================================
@@ -27820,5 +27817,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
27820
27817
  * Generated bundle index. Do not edit.
27821
27818
  */
27822
27819
 
27823
- export { BaseApiService, CardTypes, Category, ClassLoggerService, ConfigService, Customer, CustomerApiService, CwmSharedModule, DbKeys, ExternalNavigationComponent, InventoryApiService, Justifications, LocalStorageService, LogService, LoggingVerbosity, MockConfig, MockCustomer, MockInventoryApiResponse, MockProfile, NamedColors, NavigateToRouteComponent, OnElementStyle, PageNotFoundComponent, Product, Profile, SafeHtmlPipe, Stack, TimeSpan, TimeSpanOverflowError, UserTypes, Utilities, decodeToken, doWithLock, isTokenValid, msalGuardConfigFactory, msalInstanceFactory, msalInterceptorConfigFactory, waitFor };
27820
+ export { BaseApiService, CardTypes, Category, ClassLoggerService, ConfigService, Customer, CustomerApiService, CwmSharedModule, DEFAULT_API_CONFIG, DEFAULT_AUTH_CONFIG, DEFAULT_CAROUSEL_CONFIG, DEFAULT_CONFIGURATION, DEFAULT_CUSTOMER, DEFAULT_INVENTORY_API_RESPONSE, DEFAULT_MENU_BOARD_CONFIG, DEFAULT_PROFILE, DEFAULT_SLIDE, DEFAULT_SUBSCRIPTION_CONFIG, DbKeys, ExternalNavigationComponent, InventoryApiService, Justifications, LocalStorageService, LogService, LoggingVerbosity, MockConfig, MockCustomer, MockInventoryApiResponse, MockProfile, NamedColors, NavigateToRouteComponent, OnElementStyle, PageNotFoundComponent, Product, Profile, SafeHtmlPipe, Stack, TimeSpan, TimeSpanOverflowError, UserTypes, Utilities, decodeToken, doWithLock, isTokenValid, msalGuardConfigFactory, msalInstanceFactory, msalInterceptorConfigFactory, waitFor };
27824
27821
  //# sourceMappingURL=transcommerce-cwm-shared.mjs.map