monkey-front-core 0.0.561 → 0.0.564
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.
- package/esm2020/lib/core/services/config/monkeyecx-logs-config.service.mjs +16 -1
- package/esm2020/lib/core/utils/utils.mjs +20 -1
- package/fesm2015/monkey-front-core.mjs +33 -0
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +33 -0
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/utils/utils.d.ts +11 -0
- package/monkey-front-core-0.0.564.tgz +0 -0
- package/package.json +2 -1
- package/monkey-front-core-0.0.561.tgz +0 -0
|
@@ -7,6 +7,7 @@ import { CommonModule, formatNumber, CurrencyPipe, DatePipe, registerLocaleData
|
|
|
7
7
|
import * as i1$1 from '@ngx-translate/core';
|
|
8
8
|
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
|
9
9
|
import * as moment_ from 'moment';
|
|
10
|
+
import { datadogLogs } from '@datadog/browser-logs';
|
|
10
11
|
import { map, catchError, filter, takeWhile, take, first, takeUntil, mergeMap, finalize } from 'rxjs/operators';
|
|
11
12
|
import { throwError, BehaviorSubject, Subscription, interval, concat, Subject, of, from } from 'rxjs';
|
|
12
13
|
import * as i1$2 from '@angular/common/http';
|
|
@@ -399,6 +400,7 @@ class MonkeyEcxUtils {
|
|
|
399
400
|
const month = dateStr.slice(2, 4);
|
|
400
401
|
const day = dateStr.slice(4, 6);
|
|
401
402
|
const date = new Date(`20${year}-${month}-${day}`);
|
|
403
|
+
// eslint-disable-next-line no-restricted-globals
|
|
402
404
|
return !isNaN(date.getTime());
|
|
403
405
|
};
|
|
404
406
|
const validateVerificationDigit = (doc) => {
|
|
@@ -566,6 +568,23 @@ class MonkeyEcxUtils {
|
|
|
566
568
|
return ret;
|
|
567
569
|
}
|
|
568
570
|
}
|
|
571
|
+
class MonkeyEcxLogParams {
|
|
572
|
+
constructor() {
|
|
573
|
+
this.message = '';
|
|
574
|
+
this.type = 'error';
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
class MonkeyEcxLogs {
|
|
578
|
+
static log(params) {
|
|
579
|
+
try {
|
|
580
|
+
const { type, message, context, error } = params;
|
|
581
|
+
datadogLogs.logger[type](message, context, error);
|
|
582
|
+
}
|
|
583
|
+
catch (e) {
|
|
584
|
+
// not to do
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
}
|
|
569
588
|
function bufferToBase64(buffer) {
|
|
570
589
|
let binary = '';
|
|
571
590
|
const bytes = new Uint8Array(buffer);
|
|
@@ -3926,6 +3945,20 @@ class MonkeyEcxLogsConfigService {
|
|
|
3926
3945
|
defaultPrivacyLevel: 'mask-user-input'
|
|
3927
3946
|
});
|
|
3928
3947
|
datadogRum.startSessionReplayRecording();
|
|
3948
|
+
if (environment.dataDogBrowserLogsEnable) {
|
|
3949
|
+
datadogLogs.init({
|
|
3950
|
+
clientToken: environment?.dataDogClientToken,
|
|
3951
|
+
service: program?.token,
|
|
3952
|
+
site: 'datadoghq.com',
|
|
3953
|
+
env: `monkey-front-${identifyCode}-${environment.environment}`,
|
|
3954
|
+
version: configBootstrap?.version,
|
|
3955
|
+
trackSessionAcrossSubdomains: true,
|
|
3956
|
+
useSecureSessionCookie: true,
|
|
3957
|
+
forwardErrorsToLogs: true,
|
|
3958
|
+
sessionSampleRate: 100,
|
|
3959
|
+
forwardConsoleLogs: 'all'
|
|
3960
|
+
});
|
|
3961
|
+
}
|
|
3929
3962
|
this.allSet = true;
|
|
3930
3963
|
}
|
|
3931
3964
|
this.applyInfoToDataDog(environment);
|