@transcommerce/cwm-shared 1.1.60 → 1.1.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component,
|
|
2
|
+
import { Component, InjectionToken, Inject, Injectable, Pipe, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/router';
|
|
4
4
|
import * as i2 from '@angular/forms';
|
|
5
5
|
import { FormsModule } from '@angular/forms';
|
|
@@ -152,6 +152,21 @@ class Stack {
|
|
|
152
152
|
toString() { return this.items.toString(); }
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
+
const DEFAULT_AUTH_CONFIG = {
|
|
156
|
+
logLevel: "Info",
|
|
157
|
+
clientId: "af1486e0-a27f-4c8d-8503-0752d90ce72d",
|
|
158
|
+
tenantId: "445012c4-563a-4795-84d0-f7473a3197e0",
|
|
159
|
+
authority: "https://login.microsoft.com/445012c4-563a-4795-84d0-f7473a3197e0",
|
|
160
|
+
scopes: "openid,email,profile",
|
|
161
|
+
redirect_uri: window.location.origin,
|
|
162
|
+
logout_redirect_uri: window.location.origin + '/logout',
|
|
163
|
+
prompt: "login",
|
|
164
|
+
msalDiagnosticsEnabled: false,
|
|
165
|
+
showPii: false,
|
|
166
|
+
configConnectString: "Endpoint=https://cheap-weed-menus-appconfig.azconfig.io;Id=7F0m;Secret=7X8pkinp53tA8d4o2LfGUMHBWo54o68jYUSS7JcOnyQmh2lDXetkJQQJ99BEAC8vTInIcYexAAACAZAC2P1s"
|
|
167
|
+
};
|
|
168
|
+
const AUTH_CONFIG = new InjectionToken('AUTH_CONFIG');
|
|
169
|
+
|
|
155
170
|
/*
|
|
156
171
|
* The ClassLoggerService is really just a wrapper around the existing console logging functionality
|
|
157
172
|
* It is not intended to be used as a singleton service, but rather to be instantiated for each class that needs logging.
|
|
@@ -163,11 +178,17 @@ class Stack {
|
|
|
163
178
|
* 4. Keeps track of the call stack and can group nested method calls if collapseGroups is set to true
|
|
164
179
|
*/
|
|
165
180
|
class ClassLoggerService {
|
|
181
|
+
authConfig;
|
|
182
|
+
constructor(authConfig) {
|
|
183
|
+
this.authConfig = authConfig;
|
|
184
|
+
this.logLevel = this.authConfig.logLevel;
|
|
185
|
+
this.className = this.constructor.name;
|
|
186
|
+
}
|
|
166
187
|
/*
|
|
167
188
|
* Determines what level of verbosity you want this service to log with.
|
|
168
189
|
* This can be set to 'None', 'Error', 'Warn', 'Info', 'Debug', or 'Trace'.
|
|
169
190
|
*/
|
|
170
|
-
logLevel =
|
|
191
|
+
logLevel = "Info";
|
|
171
192
|
/*
|
|
172
193
|
* Determine if method entry and exit points should be logged in collapsed groups
|
|
173
194
|
*/
|
|
@@ -214,7 +235,7 @@ class ClassLoggerService {
|
|
|
214
235
|
}
|
|
215
236
|
else {
|
|
216
237
|
this.callStack.push(value);
|
|
217
|
-
if (this.logLevel === '
|
|
238
|
+
if (this.logLevel === 'Trace') {
|
|
218
239
|
if (this.collapseGroups)
|
|
219
240
|
console.groupCollapsed(this.targetName);
|
|
220
241
|
else
|
|
@@ -230,7 +251,7 @@ class ClassLoggerService {
|
|
|
230
251
|
*/
|
|
231
252
|
endOfMethod() {
|
|
232
253
|
this.trace("End of method");
|
|
233
|
-
if (this.logLevel === '
|
|
254
|
+
if (this.logLevel === 'Trace') {
|
|
234
255
|
console.groupEnd();
|
|
235
256
|
console.timeEnd(this.targetName);
|
|
236
257
|
}
|
|
@@ -309,12 +330,15 @@ class ClassLoggerService {
|
|
|
309
330
|
console.log(`${this.prefix} Trace: ${message}`, optionalParams);
|
|
310
331
|
}
|
|
311
332
|
}
|
|
312
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ClassLoggerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
333
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ClassLoggerService, deps: [{ token: AUTH_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
313
334
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ClassLoggerService });
|
|
314
335
|
}
|
|
315
336
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ClassLoggerService, decorators: [{
|
|
316
337
|
type: Injectable
|
|
317
|
-
}]
|
|
338
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
339
|
+
type: Inject,
|
|
340
|
+
args: [AUTH_CONFIG]
|
|
341
|
+
}] }] });
|
|
318
342
|
|
|
319
343
|
function msalGuardConfigFactory(authConfig, injector) {
|
|
320
344
|
const logService = injector ? injector.get(ClassLoggerService, null) : null;
|
|
@@ -1207,21 +1231,6 @@ const DEFAULT_API_CONFIG = {
|
|
|
1207
1231
|
"locationId": "10f19fc5-31d0-4d76-bad4-ad593c9803ae"
|
|
1208
1232
|
};
|
|
1209
1233
|
|
|
1210
|
-
const DEFAULT_AUTH_CONFIG = {
|
|
1211
|
-
logLevel: "Info",
|
|
1212
|
-
clientId: "af1486e0-a27f-4c8d-8503-0752d90ce72d",
|
|
1213
|
-
tenantId: "445012c4-563a-4795-84d0-f7473a3197e0",
|
|
1214
|
-
authority: "https://login.microsoft.com/445012c4-563a-4795-84d0-f7473a3197e0",
|
|
1215
|
-
scopes: "openid,email,profile",
|
|
1216
|
-
redirect_uri: window.location.origin,
|
|
1217
|
-
logout_redirect_uri: window.location.origin + '/logout',
|
|
1218
|
-
prompt: "login",
|
|
1219
|
-
msalDiagnosticsEnabled: true,
|
|
1220
|
-
showPii: true,
|
|
1221
|
-
configConnectString: "Endpoint=https://cheap-weed-menus-appconfig.azconfig.io;Id=7F0m;Secret=7X8pkinp53tA8d4o2LfGUMHBWo54o68jYUSS7JcOnyQmh2lDXetkJQQJ99BEAC8vTInIcYexAAACAZAC2P1s"
|
|
1222
|
-
};
|
|
1223
|
-
const AUTH_CONFIG = new InjectionToken('AUTH_CONFIG');
|
|
1224
|
-
|
|
1225
1234
|
const DEFAULT_CAROUSEL_CONFIG = {
|
|
1226
1235
|
"slidesToShow": 3,
|
|
1227
1236
|
"slidesToScroll": 1,
|
|
@@ -27377,7 +27386,7 @@ class ConfigService {
|
|
|
27377
27386
|
}
|
|
27378
27387
|
constructor(logger) {
|
|
27379
27388
|
this.logger = logger;
|
|
27380
|
-
this.logger.className = "ConfigService";
|
|
27389
|
+
this.logger.className = this.constructor.name; //"ConfigService";
|
|
27381
27390
|
this.configConnectString = "Endpoint=https://cheap-weed-menus-appconfig.azconfig.io;Id=tyjA;Secret=1FgL95lHkXViZX4Qf2GcRqn26mhTYDVYany8ToXpTnO68AzrdUUEJQQJ99AHAC8vTInIcYexAAACAZACsteF";
|
|
27382
27391
|
this.configClient = new AppConfigurationClient(this.configConnectString);
|
|
27383
27392
|
this.logger.debug("Config Client", this.configClient);
|
|
@@ -27438,10 +27447,12 @@ class ConfigService {
|
|
|
27438
27447
|
this.logger.debug("Using Cached Configuration", this.configCache);
|
|
27439
27448
|
}
|
|
27440
27449
|
const config = this.configCache;
|
|
27450
|
+
this.logger.logLevel = config.authConfig.logLevel;
|
|
27441
27451
|
this.logger.methodName = "";
|
|
27442
27452
|
return config;
|
|
27443
27453
|
}
|
|
27444
27454
|
async saveConfigAsync(config, company) {
|
|
27455
|
+
this.logger.logLevel = config.authConfig.logLevel;
|
|
27445
27456
|
this.logger.methodName = "saveConfigAsync()";
|
|
27446
27457
|
// Update configuration cache
|
|
27447
27458
|
this.configCache = config;
|
|
@@ -27504,7 +27515,7 @@ class InventoryApiService extends BaseApiService {
|
|
|
27504
27515
|
useMockData = false;
|
|
27505
27516
|
constructor(document, configService, httpClient, logger) {
|
|
27506
27517
|
super(document, configService, httpClient, logger);
|
|
27507
|
-
logger.className = "InventoryApiService";
|
|
27518
|
+
logger.className = this.constructor.name; //"InventoryApiService";
|
|
27508
27519
|
}
|
|
27509
27520
|
get httpHeaders() {
|
|
27510
27521
|
return new HttpHeaders()
|
|
@@ -27955,7 +27966,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
|
|
|
27955
27966
|
class SubscriptionApiService extends BaseApiService {
|
|
27956
27967
|
constructor(document, configService, httpClient, logger) {
|
|
27957
27968
|
super(document, configService, httpClient, logger);
|
|
27958
|
-
logger.className = "SubscriptionApiService";
|
|
27969
|
+
logger.className = this.constructor.name; //"SubscriptionApiService";
|
|
27959
27970
|
}
|
|
27960
27971
|
get apiFullUrl() {
|
|
27961
27972
|
return `${this.apiBaseUrl}${(this.config ?? DEFAULT_API_CONFIG).createSubscriptionApiRoute}`;
|