monkey-front-core 0.0.551 → 0.0.553

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.
@@ -3901,9 +3901,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
3901
3901
  }], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: MonkeyEcxTokenStorageService }, { type: i1$1.TranslateService }, { type: MonkeyEcxErrorConfigService }]; } });
3902
3902
 
3903
3903
  class MonkeyEcxLogsConfigService {
3904
+ constructor(tokenStorage) {
3905
+ this.tokenStorage = tokenStorage;
3906
+ this.allSet = false;
3907
+ // not to do
3908
+ }
3904
3909
  apply(params, configBootstrap, environment, identifyCode) {
3905
3910
  const { program, logs } = params;
3906
- if (logs?.enabled && environment.environment !== 'dev') {
3911
+ if (logs?.enabled && environment.environment !== 'dev' && !this.allSet) {
3907
3912
  datadogRum.init({
3908
3913
  applicationId: environment?.dataDogApplicationId,
3909
3914
  clientToken: environment?.dataDogClientToken,
@@ -3921,17 +3926,39 @@ class MonkeyEcxLogsConfigService {
3921
3926
  defaultPrivacyLevel: 'mask-user-input'
3922
3927
  });
3923
3928
  datadogRum.startSessionReplayRecording();
3929
+ this.allSet = true;
3924
3930
  }
3925
3931
  }
3932
+ async applyInfoToDataDog(environment) {
3933
+ try {
3934
+ const token = await this.tokenStorage.getToken();
3935
+ if (token.accessToken && environment.dataDogApplicationId) {
3936
+ const me = await this.tokenStorage.getMe();
3937
+ const user = {
3938
+ id: token.username,
3939
+ email: token.username,
3940
+ name: me.name,
3941
+ locale: me.locale
3942
+ };
3943
+ datadogRum.setUser(user);
3944
+ }
3945
+ }
3946
+ catch (e) {
3947
+ // not to do
3948
+ }
3949
+ }
3950
+ clearDataDogInfo() {
3951
+ datadogRum.clearUser();
3952
+ }
3926
3953
  }
3927
- MonkeyEcxLogsConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxLogsConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3954
+ MonkeyEcxLogsConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxLogsConfigService, deps: [{ token: MonkeyEcxTokenStorageService }], target: i0.ɵɵFactoryTarget.Injectable });
3928
3955
  MonkeyEcxLogsConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxLogsConfigService, providedIn: 'root' });
3929
3956
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxLogsConfigService, decorators: [{
3930
3957
  type: Injectable,
3931
3958
  args: [{
3932
3959
  providedIn: 'root'
3933
3960
  }]
3934
- }] });
3961
+ }], ctorParameters: function () { return [{ type: MonkeyEcxTokenStorageService }]; } });
3935
3962
 
3936
3963
  class MonkeyEcxServiceWorkerConfigService {
3937
3964
  constructor(appRef, updates, modalService) {