diff --git a/src/plugins/vis_augmenter/README.md b/src/plugins/vis_augmenter/README.md new file mode 100644 index 000000000000..fb9d4fbdcaae --- /dev/null +++ b/src/plugins/vis_augmenter/README.md @@ -0,0 +1 @@ +Contains interfaces and type definitions used for allowing external plugins to augment Visualizations. Registers the relevant saved object types and expression functions. diff --git a/src/plugins/vis_augmenter/opensearch_dashboards.json b/src/plugins/vis_augmenter/opensearch_dashboards.json new file mode 100644 index 000000000000..e9cd25618d01 --- /dev/null +++ b/src/plugins/vis_augmenter/opensearch_dashboards.json @@ -0,0 +1,7 @@ +{ + "id": "visAugmenter", + "version": "opensearchDashboards", + "server": true, + "ui": true, + "requiredPlugins": ["data", "savedObjects", "opensearchDashboardsUtils"] +} diff --git a/src/plugins/vis_augmenter/public/index.ts b/src/plugins/vis_augmenter/public/index.ts new file mode 100644 index 000000000000..e931e2ac2e03 --- /dev/null +++ b/src/plugins/vis_augmenter/public/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { PluginInitializerContext } from 'src/core/public'; +import { VisAugmenterPlugin, VisAugmenterSetup, VisAugmenterStart } from './plugin'; + +export function plugin(initializerContext: PluginInitializerContext) { + return new VisAugmenterPlugin(initializerContext); +} +export { VisAugmenterSetup, VisAugmenterStart }; diff --git a/src/plugins/vis_augmenter/public/plugin.ts b/src/plugins/vis_augmenter/public/plugin.ts new file mode 100644 index 000000000000..cbc7a24800de --- /dev/null +++ b/src/plugins/vis_augmenter/public/plugin.ts @@ -0,0 +1,40 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '../../../core/public'; +import { DataPublicPluginSetup, DataPublicPluginStart } from '../../data/public'; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface VisAugmenterSetup {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface VisAugmenterStart {} + +export interface VisAugmenterSetupDeps { + data: DataPublicPluginSetup; +} + +export interface VisAugmenterStartDeps { + data: DataPublicPluginStart; +} + +export class VisAugmenterPlugin + implements + Plugin { + constructor(initializerContext: PluginInitializerContext) {} + + public setup( + core: CoreSetup, + { data }: VisAugmenterSetupDeps + ): VisAugmenterSetup { + return {}; + } + + public start(core: CoreStart, { data }: VisAugmenterStartDeps): VisAugmenterStart { + return {}; + } + + public stop() {} +} diff --git a/src/plugins/vis_augmenter/server/index.ts b/src/plugins/vis_augmenter/server/index.ts new file mode 100644 index 000000000000..cc6530649a8e --- /dev/null +++ b/src/plugins/vis_augmenter/server/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { PluginInitializerContext } from '../../../core/server'; +import { VisAugmenterPlugin } from './plugin'; + +export function plugin(initializerContext: PluginInitializerContext) { + return new VisAugmenterPlugin(initializerContext); +} +export { VisAugmenterPluginSetup, VisAugmenterPluginStart } from './plugin'; diff --git a/src/plugins/vis_augmenter/server/plugin.ts b/src/plugins/vis_augmenter/server/plugin.ts new file mode 100644 index 000000000000..d921126a1f66 --- /dev/null +++ b/src/plugins/vis_augmenter/server/plugin.ts @@ -0,0 +1,38 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { + PluginInitializerContext, + CoreSetup, + CoreStart, + Plugin, + Logger, +} from '../../../core/server'; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface VisAugmenterPluginSetup {} +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface VisAugmenterPluginStart {} + +export class VisAugmenterPlugin + implements Plugin { + private readonly logger: Logger; + + constructor(initializerContext: PluginInitializerContext) { + this.logger = initializerContext.logger.get(); + } + + public setup(core: CoreSetup) { + this.logger.debug('VisAugmenter: Setup'); + return {}; + } + + public start(core: CoreStart) { + this.logger.debug('VisAugmenter: Started'); + return {}; + } + + public stop() {} +}