-
Notifications
You must be signed in to change notification settings - Fork 8.3k
/
Copy pathplugin.js
27 lines (23 loc) · 998 Bytes
/
plugin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { initRoutes } from './routes/file_upload';
import { setElasticsearchClientServices, setInternalRepository } from './kibana_server_services';
import { registerFileUploadUsageCollector, fileUploadTelemetryMappingsType } from './telemetry';
export class FileUploadPlugin {
constructor() {
this.router = null;
}
setup(core, plugins) {
core.savedObjects.registerType(fileUploadTelemetryMappingsType);
setElasticsearchClientServices(core.elasticsearch);
this.router = core.http.createRouter();
registerFileUploadUsageCollector(plugins.usageCollection);
}
start(core) {
initRoutes(this.router, core.savedObjects.getSavedObjectsRepository);
setInternalRepository(core.savedObjects.createInternalRepository);
}
}