monkey-front-core 0.0.562 → 0.0.565

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.
@@ -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';
@@ -25,7 +26,6 @@ import { __decorate } from 'tslib';
25
26
  import esCL from '@angular/common/locales/es-CL';
26
27
  import esMX from '@angular/common/locales/es-MX';
27
28
  import ptBr from '@angular/common/locales/pt';
28
- import { datadogLogs } from '@datadog/browser-logs';
29
29
  import { datadogRum } from '@datadog/browser-rum';
30
30
  import * as i1$4 from '@angular/service-worker';
31
31
  import { ServiceWorkerModule } from '@angular/service-worker';
@@ -400,6 +400,7 @@ class MonkeyEcxUtils {
400
400
  const month = dateStr.slice(2, 4);
401
401
  const day = dateStr.slice(4, 6);
402
402
  const date = new Date(`20${year}-${month}-${day}`);
403
+ // eslint-disable-next-line no-restricted-globals
403
404
  return !isNaN(date.getTime());
404
405
  };
405
406
  const validateVerificationDigit = (doc) => {
@@ -567,6 +568,17 @@ class MonkeyEcxUtils {
567
568
  return ret;
568
569
  }
569
570
  }
571
+ class MonkeyEcxLogs {
572
+ static log(params) {
573
+ try {
574
+ const { type, message, context, error } = params;
575
+ datadogLogs.logger[type || 'error'](message, context, error);
576
+ }
577
+ catch (e) {
578
+ // not to do
579
+ }
580
+ }
581
+ }
570
582
  function bufferToBase64(buffer) {
571
583
  let binary = '';
572
584
  const bytes = new Uint8Array(buffer);
@@ -3927,18 +3939,20 @@ class MonkeyEcxLogsConfigService {
3927
3939
  defaultPrivacyLevel: 'mask-user-input'
3928
3940
  });
3929
3941
  datadogRum.startSessionReplayRecording();
3930
- datadogLogs.init({
3931
- clientToken: environment?.dataDogClientToken,
3932
- service: program?.token,
3933
- site: 'datadoghq.com',
3934
- env: `monkey-front-${identifyCode}-${environment.environment}`,
3935
- version: configBootstrap?.version,
3936
- trackSessionAcrossSubdomains: true,
3937
- useSecureSessionCookie: true,
3938
- forwardErrorsToLogs: true,
3939
- sessionSampleRate: 100,
3940
- forwardConsoleLogs: 'all'
3941
- });
3942
+ if (environment.dataDogBrowserLogsEnable) {
3943
+ datadogLogs.init({
3944
+ clientToken: environment?.dataDogClientToken,
3945
+ service: program?.token,
3946
+ site: 'datadoghq.com',
3947
+ env: `monkey-front-${identifyCode}-${environment.environment}`,
3948
+ version: configBootstrap?.version,
3949
+ trackSessionAcrossSubdomains: true,
3950
+ useSecureSessionCookie: true,
3951
+ forwardErrorsToLogs: true,
3952
+ sessionSampleRate: 100,
3953
+ forwardConsoleLogs: 'all'
3954
+ });
3955
+ }
3942
3956
  this.allSet = true;
3943
3957
  }
3944
3958
  this.applyInfoToDataDog(environment);