Skip to content

Commit

Permalink
[7.x] Add PluginManfiest to generated docs (elastic#42795) (elastic#4…
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdover authored Aug 7, 2019
1 parent cbd1763 commit ead4645
Show file tree
Hide file tree
Showing 15 changed files with 182 additions and 5 deletions.
12 changes: 12 additions & 0 deletions docs/development/core/server/kibana-plugin-server.configpath.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ConfigPath](./kibana-plugin-server.configpath.md)

## ConfigPath type


<b>Signature:</b>

```typescript
export declare type ConfigPath = string | string[];
```
4 changes: 4 additions & 0 deletions docs/development/core/server/kibana-plugin-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

The Kibana Core APIs for server-side plugins.

A plugin requires a `kibana.json` file at it's root directory that follows [the manfiest schema](./kibana-plugin-server.pluginmanifest.md) to define static plugin information required to load the plugin.

A plugin's `server/index` file must contain a named import, `plugin`<!-- -->, that implements [PluginInitializer](./kibana-plugin-server.plugininitializer.md) which returns an object that implements [Plugin](./kibana-plugin-server.plugin.md)<!-- -->.

The plugin integrates with the core system via lifecycle events: `setup`<!-- -->, `start`<!-- -->, and `stop`<!-- -->. In each lifecycle method, the plugin will receive the corresponding core services available (either [CoreSetup](./kibana-plugin-server.coresetup.md) or [CoreStart](./kibana-plugin-server.corestart.md)<!-- -->) and any interfaces returned by dependency plugins' lifecycle method. Anything returned by the plugin's lifecycle method will be exposed to downstream dependencies when their corresponding lifecycle methods are invoked.
Expand Down Expand Up @@ -57,6 +59,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [OnPreAuthToolkit](./kibana-plugin-server.onpreauthtoolkit.md) | A tool set defining an outcome of OnPreAuth interceptor for incoming request. |
| [Plugin](./kibana-plugin-server.plugin.md) | The interface that should be returned by a <code>PluginInitializer</code>. |
| [PluginInitializerContext](./kibana-plugin-server.plugininitializercontext.md) | Context that's available to plugins during initialization stage. |
| [PluginManifest](./kibana-plugin-server.pluginmanifest.md) | Describes the set of required and optional properties plugin can define in its mandatory JSON manifest file. |
| [PluginsServiceSetup](./kibana-plugin-server.pluginsservicesetup.md) | |
| [PluginsServiceStart](./kibana-plugin-server.pluginsservicestart.md) | |
| [ResponseErrorMeta](./kibana-plugin-server.responseerrormeta.md) | Additional metadata to enhance error output or provide error details. |
Expand Down Expand Up @@ -107,6 +110,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [APICaller](./kibana-plugin-server.apicaller.md) | |
| [AuthenticationHandler](./kibana-plugin-server.authenticationhandler.md) | |
| [AuthHeaders](./kibana-plugin-server.authheaders.md) | Auth Headers map |
| [ConfigPath](./kibana-plugin-server.configpath.md) | |
| [ElasticsearchClientConfig](./kibana-plugin-server.elasticsearchclientconfig.md) | |
| [GetAuthHeaders](./kibana-plugin-server.getauthheaders.md) | Get headers to authenticate a user against Elasticsearch. |
| [GetAuthState](./kibana-plugin-server.getauthstate.md) | Get authentication state for a request. Returned by <code>auth</code> interceptor. |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [PluginManifest](./kibana-plugin-server.pluginmanifest.md) &gt; [configPath](./kibana-plugin-server.pluginmanifest.configpath.md)

## PluginManifest.configPath property

Root [configuration path](./kibana-plugin-server.configpath.md) used by the plugin, defaults to "id".

<b>Signature:</b>

```typescript
readonly configPath: ConfigPath;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [PluginManifest](./kibana-plugin-server.pluginmanifest.md) &gt; [id](./kibana-plugin-server.pluginmanifest.id.md)

## PluginManifest.id property

Identifier of the plugin.

<b>Signature:</b>

```typescript
readonly id: PluginName;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [PluginManifest](./kibana-plugin-server.pluginmanifest.md) &gt; [kibanaVersion](./kibana-plugin-server.pluginmanifest.kibanaversion.md)

## PluginManifest.kibanaVersion property

The version of Kibana the plugin is compatible with, defaults to "version".

<b>Signature:</b>

```typescript
readonly kibanaVersion: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [PluginManifest](./kibana-plugin-server.pluginmanifest.md)

## PluginManifest interface

Describes the set of required and optional properties plugin can define in its mandatory JSON manifest file.

<b>Signature:</b>

```typescript
export interface PluginManifest
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [configPath](./kibana-plugin-server.pluginmanifest.configpath.md) | <code>ConfigPath</code> | Root [configuration path](./kibana-plugin-server.configpath.md) used by the plugin, defaults to "id". |
| [id](./kibana-plugin-server.pluginmanifest.id.md) | <code>PluginName</code> | Identifier of the plugin. |
| [kibanaVersion](./kibana-plugin-server.pluginmanifest.kibanaversion.md) | <code>string</code> | The version of Kibana the plugin is compatible with, defaults to "version". |
| [optionalPlugins](./kibana-plugin-server.pluginmanifest.optionalplugins.md) | <code>readonly PluginName[]</code> | An optional list of the other plugins that if installed and enabled \*\*may be\*\* leveraged by this plugin for some additional functionality but otherwise are not required for this plugin to work properly. |
| [requiredPlugins](./kibana-plugin-server.pluginmanifest.requiredplugins.md) | <code>readonly PluginName[]</code> | An optional list of the other plugins that \*\*must be\*\* installed and enabled for this plugin to function properly. |
| [server](./kibana-plugin-server.pluginmanifest.server.md) | <code>boolean</code> | Specifies whether plugin includes some server-side specific functionality. |
| [ui](./kibana-plugin-server.pluginmanifest.ui.md) | <code>boolean</code> | Specifies whether plugin includes some client/browser specific functionality that should be included into client bundle via <code>public/ui_plugin.js</code> file. |
| [version](./kibana-plugin-server.pluginmanifest.version.md) | <code>string</code> | Version of the plugin. |

## Remarks

Should never be used in code outside of Core but is exported for documentation purposes.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [PluginManifest](./kibana-plugin-server.pluginmanifest.md) &gt; [optionalPlugins](./kibana-plugin-server.pluginmanifest.optionalplugins.md)

## PluginManifest.optionalPlugins property

An optional list of the other plugins that if installed and enabled \*\*may be\*\* leveraged by this plugin for some additional functionality but otherwise are not required for this plugin to work properly.

<b>Signature:</b>

```typescript
readonly optionalPlugins: readonly PluginName[];
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [PluginManifest](./kibana-plugin-server.pluginmanifest.md) &gt; [requiredPlugins](./kibana-plugin-server.pluginmanifest.requiredplugins.md)

## PluginManifest.requiredPlugins property

An optional list of the other plugins that \*\*must be\*\* installed and enabled for this plugin to function properly.

<b>Signature:</b>

```typescript
readonly requiredPlugins: readonly PluginName[];
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [PluginManifest](./kibana-plugin-server.pluginmanifest.md) &gt; [server](./kibana-plugin-server.pluginmanifest.server.md)

## PluginManifest.server property

Specifies whether plugin includes some server-side specific functionality.

<b>Signature:</b>

```typescript
readonly server: boolean;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [PluginManifest](./kibana-plugin-server.pluginmanifest.md) &gt; [ui](./kibana-plugin-server.pluginmanifest.ui.md)

## PluginManifest.ui property

Specifies whether plugin includes some client/browser specific functionality that should be included into client bundle via `public/ui_plugin.js` file.

<b>Signature:</b>

```typescript
readonly ui: boolean;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [PluginManifest](./kibana-plugin-server.pluginmanifest.md) &gt; [version](./kibana-plugin-server.pluginmanifest.version.md)

## PluginManifest.version property

Version of the plugin.

<b>Signature:</b>

```typescript
readonly version: string;
```
1 change: 1 addition & 0 deletions src/core/server/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/

/** @public */
export type ConfigPath = string | string[];

/**
Expand Down
7 changes: 6 additions & 1 deletion src/core/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
/**
* The Kibana Core APIs for server-side plugins.
*
* A plugin requires a `kibana.json` file at it's root directory that follows
* {@link PluginManifest | the manfiest schema} to define static plugin
* information required to load the plugin.
*
* A plugin's `server/index` file must contain a named import, `plugin`, that
* implements {@link PluginInitializer} which returns an object that implements
* {@link Plugin}.
Expand All @@ -46,7 +50,7 @@ import { PluginsServiceSetup, PluginsServiceStart, PluginOpaqueId } from './plug
import { ContextSetup } from './context';

export { bootstrap } from './bootstrap';
export { ConfigService } from './config';
export { ConfigPath, ConfigService } from './config';
export { CoreId } from './core_context';
export {
CallAPIOptions,
Expand Down Expand Up @@ -101,6 +105,7 @@ export {
Plugin,
PluginInitializer,
PluginInitializerContext,
PluginManifest,
PluginName,
} from './plugins';

Expand Down
10 changes: 8 additions & 2 deletions src/core/server/plugins/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ export type PluginOpaqueId = symbol;
/**
* Describes the set of required and optional properties plugin can define in its
* mandatory JSON manifest file.
* @internal
*
* @remarks
* Should never be used in code outside of Core but is exported for
* documentation purposes.
*
* @public
*/
export interface PluginManifest {
/**
Expand All @@ -59,7 +64,8 @@ export interface PluginManifest {
readonly kibanaVersion: string;

/**
* Root configuration path used by the plugin, defaults to "id".
* Root {@link ConfigPath | configuration path} used by the plugin, defaults
* to "id".
*/
readonly configPath: ConfigPath;

Expand Down
18 changes: 16 additions & 2 deletions src/core/server/server.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ export class ClusterClient {
close(): void;
}

// @public (undocumented)
export type ConfigPath = string | string[];

// @internal (undocumented)
export class ConfigService {
// Warning: (ae-forgotten-export) The symbol "Config" needs to be exported by the entry point index.d.ts
Expand All @@ -88,7 +91,6 @@ export class ConfigService {
// (undocumented)
isEnabledAtPath(path: ConfigPath): Promise<boolean>;
optionalAtPath<TSchema>(path: ConfigPath): Observable<TSchema | undefined>;
// Warning: (ae-forgotten-export) The symbol "ConfigPath" needs to be exported by the entry point index.d.ts
setSchema(path: ConfigPath, schema: Type<unknown>): Promise<void>;
}

Expand Down Expand Up @@ -458,6 +460,18 @@ export interface PluginInitializerContext<ConfigSchema = unknown> {
opaqueId: PluginOpaqueId;
}

// @public
export interface PluginManifest {
readonly configPath: ConfigPath;
readonly id: PluginName;
readonly kibanaVersion: string;
readonly optionalPlugins: readonly PluginName[];
readonly requiredPlugins: readonly PluginName[];
readonly server: boolean;
readonly ui: boolean;
readonly version: string;
}

// @public
export type PluginName = string;

Expand Down Expand Up @@ -1017,6 +1031,6 @@ export interface SessionStorageFactory<T> {
//
// src/core/server/http/router/response.ts:188:3 - (ae-forgotten-export) The symbol "KibanaResponse" needs to be exported by the entry point index.d.ts
// src/core/server/plugins/plugins_service.ts:39:5 - (ae-forgotten-export) The symbol "DiscoveredPluginInternal" needs to be exported by the entry point index.d.ts
// src/core/server/plugins/types.ts:156:10 - (ae-forgotten-export) The symbol "EnvironmentMode" needs to be exported by the entry point index.d.ts
// src/core/server/plugins/types.ts:162:10 - (ae-forgotten-export) The symbol "EnvironmentMode" needs to be exported by the entry point index.d.ts

```

0 comments on commit ead4645

Please sign in to comment.