mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* Add docLinks to CoreSetup. * Update generated docs. * Add inline snapshot for expect test error. Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
291bd4fc15
commit
90dd80e663
22 changed files with 137 additions and 53 deletions
|
@ -0,0 +1,13 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [CoreSetup](./kibana-plugin-core-public.coresetup.md) > [docLinks](./kibana-plugin-core-public.coresetup.doclinks.md)
|
||||
|
||||
## CoreSetup.docLinks property
|
||||
|
||||
[DocLinksSetup](./kibana-plugin-core-public.doclinkssetup.md)
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
docLinks: DocLinksSetup;
|
||||
```
|
|
@ -18,6 +18,7 @@ export interface CoreSetup<TPluginsStart extends object = object, TStart = unkno
|
|||
| --- | --- | --- |
|
||||
| [application](./kibana-plugin-core-public.coresetup.application.md) | <code>ApplicationSetup</code> | [ApplicationSetup](./kibana-plugin-core-public.applicationsetup.md) |
|
||||
| [context](./kibana-plugin-core-public.coresetup.context.md) | <code>ContextSetup</code> | [ContextSetup](./kibana-plugin-core-public.contextsetup.md) |
|
||||
| [docLinks](./kibana-plugin-core-public.coresetup.doclinks.md) | <code>DocLinksSetup</code> | [DocLinksSetup](./kibana-plugin-core-public.doclinkssetup.md) |
|
||||
| [fatalErrors](./kibana-plugin-core-public.coresetup.fatalerrors.md) | <code>FatalErrorsSetup</code> | [FatalErrorsSetup](./kibana-plugin-core-public.fatalerrorssetup.md) |
|
||||
| [getStartServices](./kibana-plugin-core-public.coresetup.getstartservices.md) | <code>StartServicesAccessor<TPluginsStart, TStart></code> | [StartServicesAccessor](./kibana-plugin-core-public.startservicesaccessor.md) |
|
||||
| [http](./kibana-plugin-core-public.coresetup.http.md) | <code>HttpSetup</code> | [HttpSetup](./kibana-plugin-core-public.httpsetup.md) |
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [DocLinksSetup](./kibana-plugin-core-public.doclinkssetup.md) > [DOC\_LINK\_VERSION](./kibana-plugin-core-public.doclinkssetup.doc_link_version.md)
|
||||
|
||||
## DocLinksSetup.DOC\_LINK\_VERSION property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
readonly DOC_LINK_VERSION: string;
|
||||
```
|
|
@ -0,0 +1,11 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [DocLinksSetup](./kibana-plugin-core-public.doclinkssetup.md) > [ELASTIC\_WEBSITE\_URL](./kibana-plugin-core-public.doclinkssetup.elastic_website_url.md)
|
||||
|
||||
## DocLinksSetup.ELASTIC\_WEBSITE\_URL property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
readonly ELASTIC_WEBSITE_URL: string;
|
||||
```
|
|
@ -1,8 +1,8 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [DocLinksStart](./kibana-plugin-core-public.doclinksstart.md) > [links](./kibana-plugin-core-public.doclinksstart.links.md)
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [DocLinksSetup](./kibana-plugin-core-public.doclinkssetup.md) > [links](./kibana-plugin-core-public.doclinkssetup.links.md)
|
||||
|
||||
## DocLinksStart.links property
|
||||
## DocLinksSetup.links property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [DocLinksSetup](./kibana-plugin-core-public.doclinkssetup.md)
|
||||
|
||||
## DocLinksSetup interface
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface DocLinksSetup
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [DOC\_LINK\_VERSION](./kibana-plugin-core-public.doclinkssetup.doc_link_version.md) | <code>string</code> | |
|
||||
| [ELASTIC\_WEBSITE\_URL](./kibana-plugin-core-public.doclinkssetup.elastic_website_url.md) | <code>string</code> | |
|
||||
| [links](./kibana-plugin-core-public.doclinkssetup.links.md) | <code>{</code><br/><code> readonly filebeat: {</code><br/><code> readonly base: string;</code><br/><code> readonly installation: string;</code><br/><code> readonly configuration: string;</code><br/><code> readonly elasticsearchOutput: string;</code><br/><code> readonly startup: string;</code><br/><code> readonly exportedFields: string;</code><br/><code> };</code><br/><code> readonly auditbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly metricbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly heartbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly logstash: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly functionbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly winlogbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly aggs: {</code><br/><code> readonly date_histogram: string;</code><br/><code> readonly date_range: string;</code><br/><code> readonly filter: string;</code><br/><code> readonly filters: string;</code><br/><code> readonly geohash_grid: string;</code><br/><code> readonly histogram: string;</code><br/><code> readonly ip_range: string;</code><br/><code> readonly range: string;</code><br/><code> readonly significant_terms: string;</code><br/><code> readonly terms: string;</code><br/><code> readonly avg: string;</code><br/><code> readonly avg_bucket: string;</code><br/><code> readonly max_bucket: string;</code><br/><code> readonly min_bucket: string;</code><br/><code> readonly sum_bucket: string;</code><br/><code> readonly cardinality: string;</code><br/><code> readonly count: string;</code><br/><code> readonly cumulative_sum: string;</code><br/><code> readonly derivative: string;</code><br/><code> readonly geo_bounds: string;</code><br/><code> readonly geo_centroid: string;</code><br/><code> readonly max: string;</code><br/><code> readonly median: string;</code><br/><code> readonly min: string;</code><br/><code> readonly moving_avg: string;</code><br/><code> readonly percentile_ranks: string;</code><br/><code> readonly serial_diff: string;</code><br/><code> readonly std_dev: string;</code><br/><code> readonly sum: string;</code><br/><code> readonly top_hits: string;</code><br/><code> };</code><br/><code> readonly scriptedFields: {</code><br/><code> readonly scriptFields: string;</code><br/><code> readonly scriptAggs: string;</code><br/><code> readonly painless: string;</code><br/><code> readonly painlessApi: string;</code><br/><code> readonly painlessSyntax: string;</code><br/><code> readonly luceneExpressions: string;</code><br/><code> };</code><br/><code> readonly indexPatterns: {</code><br/><code> readonly loadingData: string;</code><br/><code> readonly introduction: string;</code><br/><code> };</code><br/><code> readonly kibana: string;</code><br/><code> readonly siem: {</code><br/><code> readonly guide: string;</code><br/><code> readonly gettingStarted: string;</code><br/><code> };</code><br/><code> readonly query: {</code><br/><code> readonly luceneQuerySyntax: string;</code><br/><code> readonly queryDsl: string;</code><br/><code> readonly kueryQuerySyntax: string;</code><br/><code> };</code><br/><code> readonly date: {</code><br/><code> readonly dateMath: string;</code><br/><code> };</code><br/><code> readonly management: Record<string, string>;</code><br/><code> }</code> | |
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [DocLinksStart](./kibana-plugin-core-public.doclinksstart.md) > [DOC\_LINK\_VERSION](./kibana-plugin-core-public.doclinksstart.doc_link_version.md)
|
||||
|
||||
## DocLinksStart.DOC\_LINK\_VERSION property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
readonly DOC_LINK_VERSION: string;
|
||||
```
|
|
@ -1,11 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [DocLinksStart](./kibana-plugin-core-public.doclinksstart.md) > [ELASTIC\_WEBSITE\_URL](./kibana-plugin-core-public.doclinksstart.elastic_website_url.md)
|
||||
|
||||
## DocLinksStart.ELASTIC\_WEBSITE\_URL property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
readonly ELASTIC_WEBSITE_URL: string;
|
||||
```
|
|
@ -2,20 +2,11 @@
|
|||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [DocLinksStart](./kibana-plugin-core-public.doclinksstart.md)
|
||||
|
||||
## DocLinksStart interface
|
||||
## DocLinksStart type
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface DocLinksStart
|
||||
export declare type DocLinksStart = DocLinksSetup;
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [DOC\_LINK\_VERSION](./kibana-plugin-core-public.doclinksstart.doc_link_version.md) | <code>string</code> | |
|
||||
| [ELASTIC\_WEBSITE\_URL](./kibana-plugin-core-public.doclinksstart.elastic_website_url.md) | <code>string</code> | |
|
||||
| [links](./kibana-plugin-core-public.doclinksstart.links.md) | <code>{</code><br/><code> readonly filebeat: {</code><br/><code> readonly base: string;</code><br/><code> readonly installation: string;</code><br/><code> readonly configuration: string;</code><br/><code> readonly elasticsearchOutput: string;</code><br/><code> readonly startup: string;</code><br/><code> readonly exportedFields: string;</code><br/><code> };</code><br/><code> readonly auditbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly metricbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly heartbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly logstash: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly functionbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly winlogbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly aggs: {</code><br/><code> readonly date_histogram: string;</code><br/><code> readonly date_range: string;</code><br/><code> readonly filter: string;</code><br/><code> readonly filters: string;</code><br/><code> readonly geohash_grid: string;</code><br/><code> readonly histogram: string;</code><br/><code> readonly ip_range: string;</code><br/><code> readonly range: string;</code><br/><code> readonly significant_terms: string;</code><br/><code> readonly terms: string;</code><br/><code> readonly avg: string;</code><br/><code> readonly avg_bucket: string;</code><br/><code> readonly max_bucket: string;</code><br/><code> readonly min_bucket: string;</code><br/><code> readonly sum_bucket: string;</code><br/><code> readonly cardinality: string;</code><br/><code> readonly count: string;</code><br/><code> readonly cumulative_sum: string;</code><br/><code> readonly derivative: string;</code><br/><code> readonly geo_bounds: string;</code><br/><code> readonly geo_centroid: string;</code><br/><code> readonly max: string;</code><br/><code> readonly median: string;</code><br/><code> readonly min: string;</code><br/><code> readonly moving_avg: string;</code><br/><code> readonly percentile_ranks: string;</code><br/><code> readonly serial_diff: string;</code><br/><code> readonly std_dev: string;</code><br/><code> readonly sum: string;</code><br/><code> readonly top_hits: string;</code><br/><code> };</code><br/><code> readonly scriptedFields: {</code><br/><code> readonly scriptFields: string;</code><br/><code> readonly scriptAggs: string;</code><br/><code> readonly painless: string;</code><br/><code> readonly painlessApi: string;</code><br/><code> readonly painlessSyntax: string;</code><br/><code> readonly luceneExpressions: string;</code><br/><code> };</code><br/><code> readonly indexPatterns: {</code><br/><code> readonly loadingData: string;</code><br/><code> readonly introduction: string;</code><br/><code> };</code><br/><code> readonly kibana: string;</code><br/><code> readonly siem: {</code><br/><code> readonly guide: string;</code><br/><code> readonly gettingStarted: string;</code><br/><code> };</code><br/><code> readonly query: {</code><br/><code> readonly luceneQuerySyntax: string;</code><br/><code> readonly queryDsl: string;</code><br/><code> readonly kueryQuerySyntax: string;</code><br/><code> };</code><br/><code> readonly date: {</code><br/><code> readonly dateMath: string;</code><br/><code> };</code><br/><code> readonly management: Record<string, string>;</code><br/><code> }</code> | |
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
|
|||
| [ContextSetup](./kibana-plugin-core-public.contextsetup.md) | An object that handles registration of context providers and configuring handlers with context. |
|
||||
| [CoreSetup](./kibana-plugin-core-public.coresetup.md) | Core services exposed to the <code>Plugin</code> setup lifecycle |
|
||||
| [CoreStart](./kibana-plugin-core-public.corestart.md) | Core services exposed to the <code>Plugin</code> start lifecycle |
|
||||
| [DocLinksStart](./kibana-plugin-core-public.doclinksstart.md) | |
|
||||
| [DocLinksSetup](./kibana-plugin-core-public.doclinkssetup.md) | |
|
||||
| [EnvironmentMode](./kibana-plugin-core-public.environmentmode.md) | |
|
||||
| [ErrorToastOptions](./kibana-plugin-core-public.errortoastoptions.md) | Options available for [IToasts](./kibana-plugin-core-public.itoasts.md) error APIs. |
|
||||
| [FatalErrorInfo](./kibana-plugin-core-public.fatalerrorinfo.md) | Represents the <code>message</code> and <code>stack</code> of a fatal Error |
|
||||
|
@ -149,6 +149,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
|
|||
| [ChromeHelpExtensionMenuGitHubLink](./kibana-plugin-core-public.chromehelpextensionmenugithublink.md) | |
|
||||
| [ChromeHelpExtensionMenuLink](./kibana-plugin-core-public.chromehelpextensionmenulink.md) | |
|
||||
| [ChromeNavLinkUpdateableFields](./kibana-plugin-core-public.chromenavlinkupdateablefields.md) | |
|
||||
| [DocLinksStart](./kibana-plugin-core-public.doclinksstart.md) | |
|
||||
| [FatalErrorsStart](./kibana-plugin-core-public.fatalerrorsstart.md) | FatalErrors stop the Kibana Public Core and displays a fatal error screen with details about the Kibana build and the error. |
|
||||
| [Freezable](./kibana-plugin-core-public.freezable.md) | |
|
||||
| [HandlerContextType](./kibana-plugin-core-public.handlercontexttype.md) | Extracts the type of the first argument of a [HandlerFunction](./kibana-plugin-core-public.handlerfunction.md) to represent the type of the context. |
|
||||
|
|
|
@ -197,6 +197,11 @@ describe('#setup()', () => {
|
|||
expect(MockInjectedMetadataService.setup).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('calls docLinks#setup()', async () => {
|
||||
await setupCore();
|
||||
expect(MockDocLinksService.setup).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('calls http#setup()', async () => {
|
||||
await setupCore();
|
||||
expect(MockHttpService.setup).toHaveBeenCalledTimes(1);
|
||||
|
|
|
@ -160,6 +160,7 @@ export class CoreSystem {
|
|||
i18n: this.i18n.getContext(),
|
||||
});
|
||||
await this.integrations.setup();
|
||||
const docLinks = this.docLinks.setup({ injectedMetadata });
|
||||
const http = this.http.setup({ injectedMetadata, fatalErrors: this.fatalErrorsSetup });
|
||||
const uiSettings = this.uiSettings.setup({ http, injectedMetadata });
|
||||
const notifications = this.notifications.setup({ uiSettings });
|
||||
|
@ -180,6 +181,7 @@ export class CoreSystem {
|
|||
const core: InternalCoreSetup = {
|
||||
application,
|
||||
context,
|
||||
docLinks,
|
||||
fatalErrors: this.fatalErrorsSetup,
|
||||
http,
|
||||
injectedMetadata,
|
||||
|
@ -211,7 +213,7 @@ export class CoreSystem {
|
|||
try {
|
||||
const injectedMetadata = await this.injectedMetadata.start();
|
||||
const uiSettings = await this.uiSettings.start();
|
||||
const docLinks = await this.docLinks.start({ injectedMetadata });
|
||||
const docLinks = this.docLinks.start();
|
||||
const http = await this.http.start();
|
||||
const savedObjects = await this.savedObjects.start({ http });
|
||||
const i18n = await this.i18n.start();
|
||||
|
|
|
@ -18,21 +18,25 @@
|
|||
*/
|
||||
|
||||
import { injectedMetadataServiceMock } from '../injected_metadata/injected_metadata_service.mock';
|
||||
import { DocLinksService, DocLinksStart } from './doc_links_service';
|
||||
import { DocLinksService, DocLinksSetup, DocLinksStart } from './doc_links_service';
|
||||
|
||||
const createStartContractMock = (): DocLinksStart => {
|
||||
const createSetupContractMock = (): DocLinksSetup => {
|
||||
// This service is so simple that we actually use the real implementation
|
||||
const injectedMetadata = injectedMetadataServiceMock.createStartContract();
|
||||
injectedMetadata.getKibanaBranch.mockReturnValue('mocked-test-branch');
|
||||
return new DocLinksService().start({ injectedMetadata });
|
||||
return new DocLinksService().setup({ injectedMetadata });
|
||||
};
|
||||
|
||||
const createStartContractMock: () => DocLinksStart = createSetupContractMock;
|
||||
|
||||
type DocLinksServiceContract = PublicMethodsOf<DocLinksService>;
|
||||
const createMock = (): jest.Mocked<DocLinksServiceContract> => ({
|
||||
setup: jest.fn().mockReturnValue(createSetupContractMock()),
|
||||
start: jest.fn().mockReturnValue(createStartContractMock()),
|
||||
});
|
||||
|
||||
export const docLinksServiceMock = {
|
||||
create: createMock,
|
||||
createSetupContract: createSetupContractMock,
|
||||
createStartContract: createStartContractMock,
|
||||
};
|
||||
|
|
|
@ -20,15 +20,33 @@
|
|||
import { DocLinksService } from './doc_links_service';
|
||||
import { injectedMetadataServiceMock } from '../injected_metadata/injected_metadata_service.mock';
|
||||
|
||||
describe('DocLinksService#start()', () => {
|
||||
describe('DocLinksService#setup()', () => {
|
||||
it('templates the doc links with the branch information from injectedMetadata', () => {
|
||||
const injectedMetadata = injectedMetadataServiceMock.createStartContract();
|
||||
injectedMetadata.getKibanaBranch.mockReturnValue('test-branch');
|
||||
const service = new DocLinksService();
|
||||
const start = service.start({ injectedMetadata });
|
||||
expect(start.DOC_LINK_VERSION).toEqual('test-branch');
|
||||
expect(start.links.kibana).toEqual(
|
||||
const setup = service.setup({ injectedMetadata });
|
||||
expect(setup.DOC_LINK_VERSION).toEqual('test-branch');
|
||||
expect(setup.links.kibana).toEqual(
|
||||
'https://www.elastic.co/guide/en/kibana/test-branch/index.html'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('DocLinksService#start()', () => {
|
||||
it('returns the same data as setup', () => {
|
||||
const injectedMetadata = injectedMetadataServiceMock.createStartContract();
|
||||
injectedMetadata.getKibanaBranch.mockReturnValue('test-branch');
|
||||
const service = new DocLinksService();
|
||||
const setup = service.setup({ injectedMetadata });
|
||||
const start = service.start();
|
||||
expect(setup).toEqual(start);
|
||||
});
|
||||
|
||||
it('must be called after setup', () => {
|
||||
const service = new DocLinksService();
|
||||
expect(() => {
|
||||
service.start();
|
||||
}).toThrowErrorMatchingInlineSnapshot(`"DocLinksService#setup() must be called first!"`);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -17,21 +17,23 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import { InjectedMetadataStart } from '../injected_metadata';
|
||||
import { InjectedMetadataSetup } from '../injected_metadata';
|
||||
import { deepFreeze } from '../../utils';
|
||||
|
||||
interface StartDeps {
|
||||
injectedMetadata: InjectedMetadataStart;
|
||||
interface SetupDeps {
|
||||
injectedMetadata: InjectedMetadataSetup;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export class DocLinksService {
|
||||
public start({ injectedMetadata }: StartDeps): DocLinksStart {
|
||||
private service?: DocLinksSetup;
|
||||
|
||||
public setup({ injectedMetadata }: SetupDeps): DocLinksSetup {
|
||||
const DOC_LINK_VERSION = injectedMetadata.getKibanaBranch();
|
||||
const ELASTIC_WEBSITE_URL = 'https://www.elastic.co/';
|
||||
const ELASTICSEARCH_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}/`;
|
||||
|
||||
return deepFreeze({
|
||||
this.service = deepFreeze({
|
||||
DOC_LINK_VERSION,
|
||||
ELASTIC_WEBSITE_URL,
|
||||
links: {
|
||||
|
@ -124,11 +126,21 @@ export class DocLinksService {
|
|||
},
|
||||
},
|
||||
});
|
||||
|
||||
return this.service;
|
||||
}
|
||||
|
||||
public start(): DocLinksStart {
|
||||
if (!this.service) {
|
||||
throw new Error(`DocLinksService#setup() must be called first!`);
|
||||
}
|
||||
|
||||
return this.service;
|
||||
}
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export interface DocLinksStart {
|
||||
export interface DocLinksSetup {
|
||||
readonly DOC_LINK_VERSION: string;
|
||||
readonly ELASTIC_WEBSITE_URL: string;
|
||||
readonly links: {
|
||||
|
@ -218,3 +230,6 @@ export interface DocLinksStart {
|
|||
readonly management: Record<string, string>;
|
||||
};
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export type DocLinksStart = DocLinksSetup;
|
||||
|
|
|
@ -17,4 +17,4 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
export { DocLinksService, DocLinksStart } from './doc_links_service';
|
||||
export { DocLinksService, DocLinksSetup, DocLinksStart } from './doc_links_service';
|
||||
|
|
|
@ -65,7 +65,7 @@ import { OverlayStart } from './overlays';
|
|||
import { Plugin, PluginInitializer, PluginInitializerContext, PluginOpaqueId } from './plugins';
|
||||
import { UiSettingsState, IUiSettingsClient } from './ui_settings';
|
||||
import { ApplicationSetup, Capabilities, ApplicationStart } from './application';
|
||||
import { DocLinksStart } from './doc_links';
|
||||
import { DocLinksSetup, DocLinksStart } from './doc_links';
|
||||
import { SavedObjectsStart } from './saved_objects';
|
||||
export { PackageInfo, EnvironmentMode } from '../server/types';
|
||||
import {
|
||||
|
@ -209,6 +209,8 @@ export interface CoreSetup<TPluginsStart extends object = object, TStart = unkno
|
|||
* @deprecated
|
||||
*/
|
||||
context: ContextSetup;
|
||||
/** {@link DocLinksSetup} */
|
||||
docLinks: DocLinksSetup;
|
||||
/** {@link FatalErrorsSetup} */
|
||||
fatalErrors: FatalErrorsSetup;
|
||||
/** {@link HttpSetup} */
|
||||
|
@ -339,6 +341,7 @@ export {
|
|||
HandlerParameters,
|
||||
IContextProvider,
|
||||
ContextSetup,
|
||||
DocLinksSetup,
|
||||
DocLinksStart,
|
||||
FatalErrorInfo,
|
||||
FatalErrorsSetup,
|
||||
|
|
|
@ -35,6 +35,7 @@ import { contextServiceMock } from '../context/context_service.mock';
|
|||
|
||||
const applicationSetup = applicationServiceMock.createInternalSetupContract();
|
||||
const contextSetup = contextServiceMock.createSetupContract();
|
||||
const docLinksSetup = docLinksServiceMock.createSetupContract();
|
||||
const fatalErrorsSetup = fatalErrorsServiceMock.createSetupContract();
|
||||
const httpSetup = httpServiceMock.createSetupContract();
|
||||
const injectedMetadataSetup = injectedMetadataServiceMock.createSetupContract();
|
||||
|
@ -65,6 +66,7 @@ const defaultSetupDeps = {
|
|||
core: {
|
||||
application: applicationSetup,
|
||||
context: contextSetup,
|
||||
docLinks: docLinksSetup,
|
||||
fatalErrors: fatalErrorsSetup,
|
||||
injectedMetadata: injectedMetadataSetup,
|
||||
notifications: notificationsSetup,
|
||||
|
|
|
@ -62,6 +62,7 @@ function createCoreSetupMock({
|
|||
const mock = {
|
||||
application: applicationServiceMock.createSetupContract(),
|
||||
context: contextServiceMock.createSetupContract(),
|
||||
docLinks: docLinksServiceMock.createSetupContract(),
|
||||
fatalErrors: fatalErrorsServiceMock.createSetupContract(),
|
||||
getStartServices: jest.fn<Promise<[ReturnType<typeof createCoreStartMock>, any, any]>, []>(() =>
|
||||
Promise.resolve([createCoreStartMock({ basePath }), pluginStartDeps, pluginStartContract])
|
||||
|
|
|
@ -101,6 +101,7 @@ export function createPluginSetupContext<
|
|||
deps.application.registerMountContext(plugin.opaqueId, contextName, provider),
|
||||
},
|
||||
context: deps.context,
|
||||
docLinks: deps.docLinks,
|
||||
fatalErrors: deps.fatalErrors,
|
||||
http: deps.http,
|
||||
notifications: deps.notifications,
|
||||
|
|
|
@ -89,6 +89,7 @@ describe('PluginsService', () => {
|
|||
mockSetupDeps = {
|
||||
application: applicationServiceMock.createInternalSetupContract(),
|
||||
context: contextServiceMock.createSetupContract(),
|
||||
docLinks: docLinksServiceMock.createSetupContract(),
|
||||
fatalErrors: fatalErrorsServiceMock.createSetupContract(),
|
||||
http: httpServiceMock.createSetupContract(),
|
||||
injectedMetadata: pick(injectedMetadataServiceMock.createStartContract(), 'getInjectedVar'),
|
||||
|
|
|
@ -383,6 +383,8 @@ export interface CoreSetup<TPluginsStart extends object = object, TStart = unkno
|
|||
// @deprecated (undocumented)
|
||||
context: ContextSetup;
|
||||
// (undocumented)
|
||||
docLinks: DocLinksSetup;
|
||||
// (undocumented)
|
||||
fatalErrors: FatalErrorsSetup;
|
||||
// (undocumented)
|
||||
getStartServices: StartServicesAccessor<TPluginsStart, TStart>;
|
||||
|
@ -471,7 +473,7 @@ export const DEFAULT_APP_CATEGORIES: Readonly<{
|
|||
}>;
|
||||
|
||||
// @public (undocumented)
|
||||
export interface DocLinksStart {
|
||||
export interface DocLinksSetup {
|
||||
// (undocumented)
|
||||
readonly DOC_LINK_VERSION: string;
|
||||
// (undocumented)
|
||||
|
@ -565,6 +567,9 @@ export interface DocLinksStart {
|
|||
};
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export type DocLinksStart = DocLinksSetup;
|
||||
|
||||
// @public (undocumented)
|
||||
export interface EnvironmentMode {
|
||||
// (undocumented)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue