n8n/packages/cli/src/InternalHooksManager.ts
Ahsan Virani 57016624b8
Improve telemetry (#2604)
* add node positions in node graph

* add hover events

* add tag count in save event

* populate properties when default

* fix delete and enable node events

* add node and workflow exec events

* lint

* add node graph

* add node id
2022-01-07 17:14:59 +01:00

29 lines
769 B
TypeScript

/* eslint-disable import/no-cycle */
import { INodeTypes } from 'n8n-workflow';
import { InternalHooksClass } from './InternalHooks';
import { Telemetry } from './telemetry';
export class InternalHooksManager {
private static internalHooksInstance: InternalHooksClass;
static getInstance(): InternalHooksClass {
if (this.internalHooksInstance) {
return this.internalHooksInstance;
}
throw new Error('InternalHooks not initialized');
}
static init(instanceId: string, versionCli: string, nodeTypes: INodeTypes): InternalHooksClass {
if (!this.internalHooksInstance) {
this.internalHooksInstance = new InternalHooksClass(
new Telemetry(instanceId, versionCli),
versionCli,
nodeTypes,
);
}
return this.internalHooksInstance;
}
}