UNPKG

@microsoft/windows-admin-center-sdk

Version:

Microsoft - Windows Admin Center Shell

103 lines (101 loc) 3.79 kB
import { forkJoin, of } from 'rxjs'; import { map, take } from 'rxjs/operators'; import { ErrorMonitor } from '../diagnostics/error-monitor'; import { Logging } from '../diagnostics/logging'; import { PerformanceProfile } from '../performance/performance-profile'; import { PerformanceTracker } from '../performance/performance-tracker'; /** * The application context class. */ export class AppContext { activeConnection; authorizationManager; azureManagerService; cim; cimStream; connectionManager; credSSPManager; fileTransfer; frame; gateway; node; notification; powerShell; powerShellStream; resourceCache; rpc; settingsManager; sshStream; workItem; /** * Initializes a new instance of the AppContext class. * * @param activeConnection the active connection. * @param authorizationManager the authorization manager. * @param cim the cim connection. * @param cimStream the cim stream. * @param connectionManager the connection manager. * @param fileTransfer the file transfer connection. * @param frame the frame connection. * @param gateway the gateway connection. * @param node the node connection. * @param notification the notification connection. * @param powerShell the powerShell connection. * @param powerShellStream the powerShell stream. * @param resourceCache the resource cache. * @param rpc the Rpc. * @param settingsManager the user profile. * @param sshStream the SSH stream * @param workItem the work item connection */ constructor(activeConnection, authorizationManager, azureManagerService, cim, cimStream, connectionManager, credSSPManager, fileTransfer, frame, gateway, node, notification, powerShell, powerShellStream, resourceCache, rpc, settingsManager, sshStream, workItem) { this.activeConnection = activeConnection; this.authorizationManager = authorizationManager; this.azureManagerService = azureManagerService; this.cim = cim; this.cimStream = cimStream; this.connectionManager = connectionManager; this.credSSPManager = credSSPManager; this.fileTransfer = fileTransfer; this.frame = frame; this.gateway = gateway; this.node = node; this.notification = notification; this.powerShell = powerShell; this.powerShellStream = powerShellStream; this.resourceCache = resourceCache; this.rpc = rpc; this.settingsManager = settingsManager; this.sshStream = sshStream; this.workItem = workItem; PerformanceTracker.appContextServiceStarted(); Logging.current.registerRpc(this.rpc, this.gateway); PerformanceProfile.current.registerRpc(this.rpc); ErrorMonitor.current.registerRpc(this.rpc); PerformanceTracker.appContextRpcInitStarted(); rpc.init(); PerformanceTracker.appContextRpcInitComplete(); } get servicesReady() { if (!MsftSme.self().Environment.configuration.gateway.disabled) { return forkJoin([ this.authorizationManager.initialize(), this.connectionManager.initialize(), this.gateway.initialize() ]) .pipe(map(() => true), take(1)); } return of(true); } /** * Reinitialized all forwarder services to get latest data. */ reinitializeServices() { return forkJoin([ this.authorizationManager.reinitializeForwardedData(), this.connectionManager.reinitializeForwardedData(), this.gateway.initialize() ]).pipe(map(() => true)); } } //# sourceMappingURL=app-context.js.map