import { MwIconLoaderService, MwNotificationService } from './services'; import { environment } from './environment'; import { MwAppConfigService } from './config'; import { MwHttpService } from './http'; import { Inject, Injectable, InjectionToken, Optional } from '@angular/core'; import { MwUserService, MwUserApiService, MwCompanyService, MwCompanyApiService, MwUserAccessService, } from './auth'; export const MW_HTTP_SERVICE = new InjectionToken('MW_HTTP_SERVICE'); export const MW_CONFIG_SERVICE = new InjectionToken('MW_CONFIG_SERVICE'); export const MW_USER_SERVICE = new InjectionToken('MW_USER_SERVICE'); export const MW_USER_ACCESS_SERVICE = new InjectionToken( 'MW_USER_ACCESS_SERVICE' ); export const MW_USER_API_SERVICE = new InjectionToken( 'MW_USER_API_SERVICE' ); export const MW_COMPANY_API_SERVICE = new InjectionToken( 'MW_COMPANY_API_SERVICE' ); export const MW_ICON_LOADER_SERVICE = new InjectionToken( 'MW_ICON_LOADER_SERVICE' ); export const MW_COMPANY_SERVICE = new InjectionToken('MW_COMPANY_SERVICE'); export const MW_NOTIFICATION_SERVICE = new InjectionToken( 'MW_NOTIFICATION_SERVICE' ); @Injectable() export class SharedMfeService { static nextId = 0; id: string = `${environment.clientId}-${SharedMfeService.nextId++}`; constructor( @Inject(MW_USER_API_SERVICE) public userApiService: MwUserApiService, @Optional() @Inject(MW_HTTP_SERVICE) public httpService?: MwHttpService, @Inject(MW_CONFIG_SERVICE) public configService?: MwAppConfigService, @Inject(MW_USER_SERVICE) public userService?: MwUserService, @Inject(MW_USER_ACCESS_SERVICE) public userAccessService?: MwUserAccessService, @Inject(MW_ICON_LOADER_SERVICE) public iconLoader?: MwIconLoaderService, @Inject(MW_COMPANY_API_SERVICE) public companyApiService?: MwCompanyApiService, @Inject(MW_COMPANY_SERVICE) public companyService?: MwCompanyService, @Inject(MW_NOTIFICATION_SERVICE) public notificationService?: MwNotificationService ) {} }