Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import ServiceElectronIpc from './environment/services/service.electron.ipc';
import { IPCMessages, Subscription } from './environment/services/service.electron.ipc';
import PluginsService from './environment/services/service.plugins';
import LoaderService from './environment/services/service.loader';
import * as Toolkit from 'chipmunk.client.toolkit';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.less']
})
export class AppComponent implements AfterViewInit {
private _logger: Toolkit.Logger = new Toolkit.Logger('AppComponent');
private _ready: boolean = false;
constructor(
private _cdRef: ChangeDetectorRef,
private _compiler: Compiler,
private _injector: Injector,
private _notifications: NotificationsService) {
PluginsService.defineCompilerAndInjector(_compiler, _injector);
}
ngAfterViewInit() {
LoaderService.init().then(() => {
// Subscribe to plugins load event
PluginsService.subscribe(PluginsService.Events.pluginsLoaded, () => {
PluginsService.unsubscribeAll();
this._ready = true;
constructor(params: IControllerSessionStream) {
this._guid = params.guid;
this._transports = params.transports;
this._scope = params.scope;
this._logger = new Toolkit.Logger(`ControllerSessionTabStream: ${params.guid}`);
this._bookmarks = new ControllerSessionTabStreamBookmarks(params.guid);
this._output = new ControllerSessionTabStreamOutput({
guid: params.guid,
requestDataHandler: this._requestData.bind(this),
bookmarks: this._bookmarks,
scope: this._scope,
});
this._queue = new Toolkit.Queue(this._logger.error.bind(this._logger), 0);
// Subscribe to queue events
this._queue_onDone = this._queue_onDone.bind(this);
this._queue_onNext = this._queue_onNext.bind(this);
this._queue.subscribe(Toolkit.Queue.Events.done, this._queue_onDone);
this._queue.subscribe(Toolkit.Queue.Events.next, this._queue_onNext);
// Subscribe to streams data
this._subscriptions.onStreamUpdated = ServiceElectronIpc.subscribe(IPCMessages.StreamUpdated, this._ipc_onStreamUpdated.bind(this));
}
constructor(params: IControllerSessionStreamFilters) {
this._guid = params.guid;
this._logger = new Toolkit.Logger(`ControllerSessionTabSearchFilters: ${params.guid}`);
this._scope = params.scope;
this._output = new ControllerSessionTabSearchOutput({
guid: params.guid,
requestDataHandler: this._requestStreamData.bind(this),
stream: params.stream,
getActiveSearchRequests: this.getActiveAsRegs.bind(this),
scope: this._scope,
});
this._queue = new Toolkit.Queue(this._logger.error.bind(this._logger), 0);
this._state = new ControllerSessionTabSearchState(params.guid);
// Subscribe to queue events
this._queue_onDone = this._queue_onDone.bind(this);
this._queue_onNext = this._queue_onNext.bind(this);
this._queue.subscribe(Toolkit.Queue.Events.done, this._queue_onDone);
this._queue.subscribe(Toolkit.Queue.Events.next, this._queue_onNext);
this._subscriptions.SearchUpdated = ServiceElectronIpc.subscribe(IPCMessages.SearchUpdated, this._ipc_onSearchUpdated.bind(this));
constructor(params: IParamerters) {
this._guid = params.guid;
this._requestDataHandler = params.requestDataHandler;
this._bookmarks = params.bookmarks;
this._scope = params.scope;
this._sources = new ControllerSessionTabSourcesState(this._guid);
this._logger = new Toolkit.Logger(`ControllerSessionTabStreamOutput: ${this._guid}`);
this._subscriptions.onRowSelected = OutputRedirectionsService.subscribe(this._guid, this._onRowSelected.bind(this));
this._subscriptions.onBookmarkRowSelected = this._bookmarks.getObservable().onSelected.subscribe(this._onRowSelected.bind(this, 'bookmark'));
}
constructor(params: IParameters) {
this._guid = params.guid;
this._stream = params.stream;
this._bookmakrs = params.stream.getBookmarks();
this._sources = new ControllerSessionTabSourcesState(this._guid);
this._requestDataHandler = params.requestDataHandler;
this._getActiveSearchRequests = params.getActiveSearchRequests;
this._scope = params.scope;
this._logger = new Toolkit.Logger(`ControllerSessionTabSearchOutput: ${this._guid}`);
this._subscriptions.onRowSelected = OutputRedirectionsService.subscribe(this._guid, this._onRowSelected.bind(this));
this._subscriptions.onAddedBookmark = this._bookmakrs.getObservable().onAdded.subscribe(this._onUpdateBookmarksState.bind(this));
this._subscriptions.onRemovedBookmark = this._bookmakrs.getObservable().onRemoved.subscribe(this._onUpdateBookmarksState.bind(this));
}
constructor(params: IControllerSessionTabMap) {
this._guid = params.guid;
this._logger = new Toolkit.Logger(`ControllerSessionTabMap: ${this._guid}`);
this._search = params.search;
this._search = params.search;
this._stream = params.stream;
this._subscriptions.SearchResultMap = ServiceElectronIpc.subscribe(IPCMessages.SearchResultMap, this._ipc_SearchResultMap.bind(this));
this._subscriptions.StreamUpdated = ServiceElectronIpc.subscribe(IPCMessages.StreamUpdated, this._ipc_onStreamUpdated.bind(this));
this._subscriptions.onSearchDropped = this._search.getFiltersAPI().getObservable().onDropped.subscribe(this._onSearchDropped.bind(this));
this._subscriptions.onPositionChanged = this._stream.getOutputStream().getObservable().onPositionChanged.subscribe(this._onPositionChanged.bind(this));
}
constructor(params: IControllerSession) {
this._sessionId = params.guid;
this._transports = params.transports;
this._scope = new ControllerSessionScope(this._sessionId, params.sessionsEventsHub);
this._logger = new Toolkit.Logger(`ControllerSession: ${params.guid}`);
this._stream = new ControllerSessionTabStream({
guid: params.guid,
transports: params.transports.slice(),
scope: this._scope,
});
this._search = new ControllerSessionTabSearch({
guid: params.guid,
transports: params.transports.slice(),
stream: this._stream.getOutputStream(),
scope: this._scope,
});
this._map = new ControllerSessionTabMap({
guid: params.guid,
search: this._search,
stream: this._stream,
});
@Injectable({ providedIn: 'root' })
export class NotificationsService {
private subjects: {
new: Subject,
updated: Subject,
} = {
new: new Subject(),
updated: new Subject(),
};
private _subscriptions: { [key: string]: Subscription } = {};
private _onceHashes: Map = new Map();
private _storage: Map = new Map();
private _logger: Toolkit.Logger = new Toolkit.Logger('NotificationsService');
constructor() {
this._subscriptions.onProcessNotification = ServiceElectronIpc.subscribe(IPCMessages.Notification, this._onProcessNotification.bind(this));
}
public destroy() {
Object.keys(this._subscriptions).forEach((key: string) => {
this._subscriptions[key].destroy();
});
}
public add(notification: INotification) {
const notific: INotification | Error = this._validate(notification);
if (notific instanceof Error) {
return this._logger.warn(`Fail to add notification due error: ${notific.message}`);
}
constructor(params: IControllerSessionStream) {
this._guid = params.guid;
this._logger = new Toolkit.Logger(`ControllerSessionTabSearch: ${params.guid}`);
this._filters = new ControllerSessionTabSearchFilters(params);
this._charts = new ControllerSessionTabSearchCharts(params);
}
constructor(session: string) {
this._sessionId = session;
this._logger = new Toolkit.Logger(`ControllerSessionTabSourcesState: ${session}`);
}