Create server-side docLinks service (#123818)

* extract docLinks service to a package

* adapt unit tests for docLinks service

* initial server-side docLinks implementation

* add server-side service mock

* fix internal mocks

* update generated doc

* add unit tests for server-side service

* adapt server mocks

* update links due to rebase

* add base tests for new package

* update links from merge

* set kibana-docs team as owners for new package

* split concrete and type import

* update tsdoc

* update links due to merge

* update generated doc
This commit is contained in:
Pierre Gayvallet 2022-02-01 10:37:15 +01:00 committed by GitHub
parent a22b948cb5
commit b4e53f44c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 1702 additions and 1631 deletions

3
.github/CODEOWNERS vendored
View file

@ -284,6 +284,9 @@
#CC# /src/plugins/home/ @elastic/kibana-core
#CC# /x-pack/plugins/global_search_providers/ @elastic/kibana-core
# Kibana Docs
/packages/kbn-doc-links/ @elastic/kibana-docs
# Kibana Telemetry
/packages/kbn-analytics/ @elastic/kibana-core
/packages/kbn-telemetry-tools/ @elastic/kibana-core

View file

@ -7,350 +7,5 @@
<b>Signature:</b>
```typescript
readonly links: {
readonly settings: string;
readonly elasticStackGetStarted: string;
readonly upgrade: {
readonly upgradingStackOnPrem: string;
readonly upgradingStackOnCloud: string;
};
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
readonly customLinks: string;
readonly droppedTransactionSpans: string;
readonly upgrading: string;
readonly metaData: string;
};
readonly canvas: {
readonly guide: string;
};
readonly cloud: {
readonly indexManagement: string;
};
readonly console: {
readonly guide: string;
};
readonly dashboard: {
readonly guide: string;
readonly drilldowns: string;
readonly drilldownsTriggerPicker: string;
readonly urlDrilldownTemplateSyntax: string;
readonly urlDrilldownVariables: string;
};
readonly discover: Record<string, string>;
readonly filebeat: {
readonly base: string;
readonly installation: string;
readonly configuration: string;
readonly elasticsearchOutput: string;
readonly elasticsearchModule: string;
readonly startup: string;
readonly exportedFields: string;
readonly suricataModule: string;
readonly zeekModule: string;
};
readonly auditbeat: {
readonly base: string;
readonly auditdModule: string;
readonly systemModule: string;
};
readonly metricbeat: {
readonly base: string;
readonly configure: string;
readonly httpEndpoint: string;
readonly install: string;
readonly start: string;
};
readonly appSearch: {
readonly apiRef: string;
readonly apiClients: string;
readonly apiKeys: string;
readonly authentication: string;
readonly crawlRules: string;
readonly curations: string;
readonly duplicateDocuments: string;
readonly entryPoints: string;
readonly guide: string;
readonly indexingDocuments: string;
readonly indexingDocumentsSchema: string;
readonly logSettings: string;
readonly metaEngines: string;
readonly precisionTuning: string;
readonly relevanceTuning: string;
readonly resultSettings: string;
readonly searchUI: string;
readonly security: string;
readonly synonyms: string;
readonly webCrawler: string;
readonly webCrawlerEventLogs: string;
};
readonly enterpriseSearch: {
readonly configuration: string;
readonly licenseManagement: string;
readonly mailService: string;
readonly usersAccess: string;
};
readonly workplaceSearch: {
readonly apiKeys: string;
readonly box: string;
readonly confluenceCloud: string;
readonly confluenceServer: string;
readonly customSources: string;
readonly customSourcePermissions: string;
readonly documentPermissions: string;
readonly dropbox: string;
readonly externalIdentities: string;
readonly gitHub: string;
readonly gettingStarted: string;
readonly gmail: string;
readonly googleDrive: string;
readonly indexingSchedule: string;
readonly jiraCloud: string;
readonly jiraServer: string;
readonly oneDrive: string;
readonly permissions: string;
readonly salesforce: string;
readonly security: string;
readonly serviceNow: string;
readonly sharePoint: string;
readonly slack: string;
readonly synch: string;
readonly zendesk: string;
};
readonly heartbeat: {
readonly base: string;
};
readonly libbeat: {
readonly getStarted: string;
};
readonly logstash: {
readonly base: string;
};
readonly functionbeat: {
readonly base: string;
};
readonly winlogbeat: {
readonly base: string;
};
readonly aggs: {
readonly composite: string;
readonly composite_missing_bucket: string;
readonly date_histogram: string;
readonly date_range: string;
readonly date_format_pattern: string;
readonly filter: string;
readonly filters: string;
readonly geohash_grid: string;
readonly histogram: string;
readonly ip_range: string;
readonly range: string;
readonly significant_terms: string;
readonly terms: string;
readonly terms_doc_count_error: string;
readonly rare_terms: string;
readonly avg: string;
readonly avg_bucket: string;
readonly max_bucket: string;
readonly min_bucket: string;
readonly sum_bucket: string;
readonly cardinality: string;
readonly count: string;
readonly cumulative_sum: string;
readonly derivative: string;
readonly geo_bounds: string;
readonly geo_centroid: string;
readonly max: string;
readonly median: string;
readonly min: string;
readonly moving_avg: string;
readonly percentile_ranks: string;
readonly serial_diff: string;
readonly std_dev: string;
readonly sum: string;
readonly top_hits: string;
};
readonly runtimeFields: {
readonly overview: string;
readonly mapping: string;
};
readonly scriptedFields: {
readonly scriptFields: string;
readonly scriptAggs: string;
readonly painless: string;
readonly painlessApi: string;
readonly painlessLangSpec: string;
readonly painlessSyntax: string;
readonly painlessWalkthrough: string;
readonly luceneExpressions: string;
};
readonly search: {
readonly sessions: string;
readonly sessionLimits: string;
};
readonly indexPatterns: {
readonly introduction: string;
readonly fieldFormattersNumber: string;
readonly fieldFormattersString: string;
readonly runtimeFields: string;
};
readonly addData: string;
readonly kibana: {
readonly guide: string;
readonly autocompleteSuggestions: string;
readonly xpackSecurity: string;
};
readonly upgradeAssistant: {
readonly overview: string;
readonly batchReindex: string;
readonly remoteReindex: string;
};
readonly rollupJobs: string;
readonly elasticsearch: Record<string, string>;
readonly siem: {
readonly privileges: string;
readonly guide: string;
readonly gettingStarted: string;
readonly ml: string;
readonly ruleChangeLog: string;
readonly detectionsReq: string;
readonly networkMap: string;
readonly troubleshootGaps: string;
};
readonly securitySolution: {
readonly trustedApps: string;
readonly eventFilters: string;
};
readonly query: {
readonly eql: string;
readonly kueryQuerySyntax: string;
readonly luceneQuery: string;
readonly luceneQuerySyntax: string;
readonly percolate: string;
readonly queryDsl: string;
};
readonly date: {
readonly dateMath: string;
readonly dateMathIndexNames: string;
};
readonly management: Record<string, string>;
readonly ml: Record<string, string>;
readonly transforms: Record<string, string>;
readonly visualize: Record<string, string>;
readonly apis: Readonly<{
bulkIndexAlias: string;
byteSizeUnits: string;
createAutoFollowPattern: string;
createFollower: string;
createIndex: string;
createSnapshotLifecyclePolicy: string;
createRoleMapping: string;
createRoleMappingTemplates: string;
createRollupJobsRequest: string;
createApiKey: string;
createPipeline: string;
createTransformRequest: string;
cronExpressions: string;
executeWatchActionModes: string;
indexExists: string;
multiSearch: string;
openIndex: string;
putComponentTemplate: string;
painlessExecute: string;
painlessExecuteAPIContexts: string;
putComponentTemplateMetadata: string;
putSnapshotLifecyclePolicy: string;
putIndexTemplateV1: string;
putWatch: string;
searchPreference: string;
simulatePipeline: string;
timeUnits: string;
unfreezeIndex: string;
updateTransform: string;
}>;
readonly observability: Readonly<{
guide: string;
infrastructureThreshold: string;
logsThreshold: string;
metricsThreshold: string;
monitorStatus: string;
monitorUptime: string;
tlsCertificate: string;
uptimeDurationAnomaly: string;
}>;
readonly alerting: Record<string, string>;
readonly maps: Readonly<{
guide: string;
importGeospatialPrivileges: string;
gdalTutorial: string;
}>;
readonly monitoring: Record<string, string>;
readonly security: Readonly<{
apiKeyServiceSettings: string;
clusterPrivileges: string;
elasticsearchSettings: string;
elasticsearchEnableSecurity: string;
elasticsearchEnableApiKeys: string;
indicesPrivileges: string;
kibanaTLS: string;
kibanaPrivileges: string;
mappingRoles: string;
mappingRolesFieldRules: string;
runAsPrivilege: string;
}>;
readonly spaces: Readonly<{
kibanaLegacyUrlAliases: string;
kibanaDisableLegacyUrlAliasesApi: string;
}>;
readonly watcher: Record<string, string>;
readonly ccs: Record<string, string>;
readonly plugins: {
azureRepo: string;
gcsRepo: string;
hdfsRepo: string;
s3Repo: string;
snapshotRestoreRepos: string;
mapperSize: string;
};
readonly snapshotRestore: Record<string, string>;
readonly ingest: Record<string, string>;
readonly fleet: Readonly<{
beatsAgentComparison: string;
guide: string;
fleetServer: string;
fleetServerAddFleetServer: string;
settings: string;
settingsFleetServerHostSettings: string;
settingsFleetServerProxySettings: string;
troubleshooting: string;
elasticAgent: string;
datastreams: string;
datastreamsNamingScheme: string;
installElasticAgent: string;
installElasticAgentStandalone: string;
upgradeElasticAgent: string;
upgradeElasticAgent712lower: string;
learnMoreBlog: string;
apiKeysLearnMore: string;
onPremRegistry: string;
}>;
readonly ecs: {
readonly guide: string;
};
readonly clients: {
readonly guide: string;
readonly goOverview: string;
readonly javaIndex: string;
readonly jsIntro: string;
readonly netGuide: string;
readonly perlGuide: string;
readonly phpGuide: string;
readonly pythonGuide: string;
readonly rubyOverview: string;
readonly rustGuide: string;
};
readonly endpoints: {
readonly troubleshooting: string;
};
};
readonly links: DocLinks;
```

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [CoreSetup](./kibana-plugin-core-server.coresetup.md) &gt; [docLinks](./kibana-plugin-core-server.coresetup.doclinks.md)
## CoreSetup.docLinks property
[DocLinksServiceSetup](./kibana-plugin-core-server.doclinksservicesetup.md)
<b>Signature:</b>
```typescript
docLinks: DocLinksServiceSetup;
```

View file

@ -19,6 +19,7 @@ export interface CoreSetup<TPluginsStart extends object = object, TStart = unkno
| [capabilities](./kibana-plugin-core-server.coresetup.capabilities.md) | CapabilitiesSetup | [CapabilitiesSetup](./kibana-plugin-core-server.capabilitiessetup.md) |
| [context](./kibana-plugin-core-server.coresetup.context.md) | ContextSetup | [ContextSetup](./kibana-plugin-core-server.contextsetup.md) |
| [deprecations](./kibana-plugin-core-server.coresetup.deprecations.md) | DeprecationsServiceSetup | [DeprecationsServiceSetup](./kibana-plugin-core-server.deprecationsservicesetup.md) |
| [docLinks](./kibana-plugin-core-server.coresetup.doclinks.md) | DocLinksServiceSetup | [DocLinksServiceSetup](./kibana-plugin-core-server.doclinksservicesetup.md) |
| [elasticsearch](./kibana-plugin-core-server.coresetup.elasticsearch.md) | ElasticsearchServiceSetup | [ElasticsearchServiceSetup](./kibana-plugin-core-server.elasticsearchservicesetup.md) |
| [executionContext](./kibana-plugin-core-server.coresetup.executioncontext.md) | ExecutionContextSetup | [ExecutionContextSetup](./kibana-plugin-core-server.executioncontextsetup.md) |
| [getStartServices](./kibana-plugin-core-server.coresetup.getstartservices.md) | StartServicesAccessor&lt;TPluginsStart, TStart&gt; | [StartServicesAccessor](./kibana-plugin-core-server.startservicesaccessor.md) |

View file

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [CoreStart](./kibana-plugin-core-server.corestart.md) &gt; [docLinks](./kibana-plugin-core-server.corestart.doclinks.md)
## CoreStart.docLinks property
[DocLinksServiceStart](./kibana-plugin-core-server.doclinksservicestart.md)
<b>Signature:</b>
```typescript
docLinks: DocLinksServiceStart;
```

View file

@ -17,6 +17,7 @@ export interface CoreStart
| Property | Type | Description |
| --- | --- | --- |
| [capabilities](./kibana-plugin-core-server.corestart.capabilities.md) | CapabilitiesStart | [CapabilitiesStart](./kibana-plugin-core-server.capabilitiesstart.md) |
| [docLinks](./kibana-plugin-core-server.corestart.doclinks.md) | DocLinksServiceStart | [DocLinksServiceStart](./kibana-plugin-core-server.doclinksservicestart.md) |
| [elasticsearch](./kibana-plugin-core-server.corestart.elasticsearch.md) | ElasticsearchServiceStart | [ElasticsearchServiceStart](./kibana-plugin-core-server.elasticsearchservicestart.md) |
| [executionContext](./kibana-plugin-core-server.corestart.executioncontext.md) | ExecutionContextStart | [ExecutionContextStart](./kibana-plugin-core-server.executioncontextstart.md) |
| [http](./kibana-plugin-core-server.corestart.http.md) | HttpServiceStart | [HttpServiceStart](./kibana-plugin-core-server.httpservicestart.md) |

View file

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DocLinksServiceSetup](./kibana-plugin-core-server.doclinksservicesetup.md) &gt; [elasticWebsiteUrl](./kibana-plugin-core-server.doclinksservicesetup.elasticwebsiteurl.md)
## DocLinksServiceSetup.elasticWebsiteUrl property
The base url for the elastic website
<b>Signature:</b>
```typescript
readonly elasticWebsiteUrl: string;
```

View file

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DocLinksServiceSetup](./kibana-plugin-core-server.doclinksservicesetup.md) &gt; [links](./kibana-plugin-core-server.doclinksservicesetup.links.md)
## DocLinksServiceSetup.links property
A record of all registered doc links
<b>Signature:</b>
```typescript
readonly links: DocLinks;
```

View file

@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DocLinksServiceSetup](./kibana-plugin-core-server.doclinksservicesetup.md)
## DocLinksServiceSetup interface
<b>Signature:</b>
```typescript
export interface DocLinksServiceSetup
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [elasticWebsiteUrl](./kibana-plugin-core-server.doclinksservicesetup.elasticwebsiteurl.md) | string | The base url for the elastic website |
| [links](./kibana-plugin-core-server.doclinksservicesetup.links.md) | DocLinks | A record of all registered doc links |
| [version](./kibana-plugin-core-server.doclinksservicesetup.version.md) | string | The branch/version the docLinks are pointing to |

View file

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DocLinksServiceSetup](./kibana-plugin-core-server.doclinksservicesetup.md) &gt; [version](./kibana-plugin-core-server.doclinksservicesetup.version.md)
## DocLinksServiceSetup.version property
The branch/version the docLinks are pointing to
<b>Signature:</b>
```typescript
readonly version: string;
```

View file

@ -0,0 +1,12 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DocLinksServiceStart](./kibana-plugin-core-server.doclinksservicestart.md)
## DocLinksServiceStart type
<b>Signature:</b>
```typescript
export declare type DocLinksServiceStart = DocLinksServiceSetup;
```

View file

@ -70,6 +70,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [DeprecationSettings](./kibana-plugin-core-server.deprecationsettings.md) | UiSettings deprecation field options. |
| [DeprecationsServiceSetup](./kibana-plugin-core-server.deprecationsservicesetup.md) | The deprecations service provides a way for the Kibana platform to communicate deprecated features and configs with its users. These deprecations are only communicated if the deployment is using these features. Allowing for a user tailored experience for upgrading the stack version.<!-- -->The Deprecation service is consumed by the upgrade assistant to assist with the upgrade experience.<!-- -->If a deprecated feature can be resolved without manual user intervention. Using correctiveActions.api allows the Upgrade Assistant to use this api to correct the deprecation upon a user trigger. |
| [DiscoveredPlugin](./kibana-plugin-core-server.discoveredplugin.md) | Small container object used to expose information about discovered plugins that may or may not have been started. |
| [DocLinksServiceSetup](./kibana-plugin-core-server.doclinksservicesetup.md) | |
| [ElasticsearchConfigPreboot](./kibana-plugin-core-server.elasticsearchconfigpreboot.md) | A limited set of Elasticsearch configuration entries exposed to the <code>preboot</code> plugins at <code>setup</code>. |
| [ElasticsearchErrorDetails](./kibana-plugin-core-server.elasticsearcherrordetails.md) | |
| [ElasticsearchServicePreboot](./kibana-plugin-core-server.elasticsearchservicepreboot.md) | |
@ -259,6 +260,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [CapabilitiesSwitcher](./kibana-plugin-core-server.capabilitiesswitcher.md) | See [CapabilitiesSetup](./kibana-plugin-core-server.capabilitiessetup.md) |
| [DeprecationsDetails](./kibana-plugin-core-server.deprecationsdetails.md) | |
| [DestructiveRouteMethod](./kibana-plugin-core-server.destructiveroutemethod.md) | Set of HTTP methods changing the state of the server. |
| [DocLinksServiceStart](./kibana-plugin-core-server.doclinksservicestart.md) | |
| [ElasticsearchClient](./kibana-plugin-core-server.elasticsearchclient.md) | Client used to query the elasticsearch cluster. |
| [ElasticsearchClientConfig](./kibana-plugin-core-server.elasticsearchclientconfig.md) | Configuration options to be used to create a [cluster client](./kibana-plugin-core-server.iclusterclient.md) using the [createClient API](./kibana-plugin-core-server.elasticsearchservicestart.createclient.md) |
| [ExecutionContextStart](./kibana-plugin-core-server.executioncontextstart.md) | |

View file

@ -135,6 +135,7 @@
"@kbn/config": "link:bazel-bin/packages/kbn-config",
"@kbn/config-schema": "link:bazel-bin/packages/kbn-config-schema",
"@kbn/crypto": "link:bazel-bin/packages/kbn-crypto",
"@kbn/doc-links": "link:bazel-bin/packages/kbn-doc-links",
"@kbn/es-query": "link:bazel-bin/packages/kbn-es-query",
"@kbn/field-types": "link:bazel-bin/packages/kbn-field-types",
"@kbn/flot-charts": "link:bazel-bin/packages/kbn-flot-charts",
@ -573,6 +574,7 @@
"@types/kbn__config-schema": "link:bazel-bin/packages/kbn-config-schema/npm_module_types",
"@types/kbn__crypto": "link:bazel-bin/packages/kbn-crypto/npm_module_types",
"@types/kbn__dev-utils": "link:bazel-bin/packages/kbn-dev-utils/npm_module_types",
"@types/kbn__doc-links": "link:bazel-bin/packages/kbn-doc-links/npm_module_types",
"@types/kbn__docs-utils": "link:bazel-bin/packages/kbn-docs-utils/npm_module_types",
"@types/kbn__es-archiver": "link:bazel-bin/packages/kbn-es-archiver/npm_module_types",
"@types/kbn__es-query": "link:bazel-bin/packages/kbn-es-query/npm_module_types",

View file

@ -18,6 +18,7 @@ filegroup(
"//packages/kbn-config-schema:build",
"//packages/kbn-crypto:build",
"//packages/kbn-dev-utils:build",
"//packages/kbn-doc-links:build",
"//packages/kbn-docs-utils:build",
"//packages/kbn-es:build",
"//packages/kbn-es-archiver:build",
@ -90,6 +91,7 @@ filegroup(
"//packages/kbn-config-schema:build_types",
"//packages/kbn-crypto:build_types",
"//packages/kbn-dev-utils:build_types",
"//packages/kbn-doc-links:build_types",
"//packages/kbn-docs-utils:build_types",
"//packages/kbn-es-archiver:build_types",
"//packages/kbn-es-query:build_types",

View file

@ -0,0 +1,110 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")
PKG_BASE_NAME = "kbn-doc-links"
PKG_REQUIRE_NAME = "@kbn/doc-links"
TYPES_PKG_REQUIRE_NAME = "@types/kbn__doc-links"
SOURCE_FILES = glob(
[
"src/**/*.ts",
],
exclude = [
"**/*.test.*",
"**/__fixtures__",
"**/__mocks__",
"**/__snapshots__"
],
)
SRCS = SOURCE_FILES
filegroup(
name = "srcs",
srcs = SRCS,
)
NPM_MODULE_EXTRA_FILES = [
"package.json",
"README.md"
]
RUNTIME_DEPS = [
"//packages/kbn-std",
]
TYPES_DEPS = [
"//packages/kbn-std:npm_module_types",
"@npm//@types/jest",
"@npm//@types/node",
]
jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
)
ts_config(
name = "tsconfig",
src = "tsconfig.json",
deps = [
"//:tsconfig.base.json",
"//:tsconfig.bazel.json",
],
)
ts_project(
name = "tsc_types",
args = ['--pretty'],
srcs = SRCS,
deps = TYPES_DEPS,
declaration = True,
declaration_map = True,
emit_declaration_only = True,
out_dir = "target_types",
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig",
)
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = RUNTIME_DEPS + [":target_node"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
pkg_npm(
name = "npm_module",
deps = [
":%s" % PKG_BASE_NAME,
]
)
filegroup(
name = "build",
srcs = [
":npm_module",
],
visibility = ["//visibility:public"],
)
pkg_npm_types(
name = "npm_module_types",
srcs = SRCS,
deps = [":tsc_types"],
package_name = TYPES_PKG_REQUIRE_NAME,
tsconfig = ":tsconfig",
visibility = ["//visibility:public"],
)
filegroup(
name = "build_types",
srcs = [
":npm_module_types",
],
visibility = ["//visibility:public"],
)

View file

@ -0,0 +1,3 @@
# `@kbn/doc-links` — Kibana documentation links registry
This package contains the service used to access all registered Kibana documentation links

View file

@ -0,0 +1,13 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
module.exports = {
preset: '@kbn/test',
rootDir: '../..',
roots: ['<rootDir>/packages/kbn-doc-links'],
};

View file

@ -0,0 +1,7 @@
{
"name": "@kbn/doc-links",
"main": "./target_node/index.js",
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0",
"private": true
}

View file

@ -0,0 +1,21 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { getDocLinks } from './get_doc_links';
describe('getDocLinks', () => {
it('returns an immutable object', () => {
const links = getDocLinks({ kibanaBranch: 'test.branch' });
expect(() => {
(links as unknown as Record<string, unknown>).settings = 'override';
}).toThrowErrorMatchingInlineSnapshot(
`"Cannot assign to read only property 'settings' of object '#<Object>'"`
);
});
});

View file

@ -0,0 +1,599 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { deepFreeze } from '@kbn/std';
import type { DocLinks } from './types';
import { getDocLinksMeta } from './get_doc_meta';
export interface GetDocLinkOptions {
kibanaBranch: string;
}
export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
const meta = getDocLinksMeta({ kibanaBranch });
const DOC_LINK_VERSION = meta.version;
const ELASTIC_WEBSITE_URL = meta.elasticWebsiteUrl;
const ELASTICSEARCH_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}/`;
const KIBANA_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/`;
const FLEET_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/fleet/${DOC_LINK_VERSION}/`;
const PLUGIN_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/plugins/${DOC_LINK_VERSION}/`;
const APM_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/apm/`;
const SECURITY_SOLUTION_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/`;
const STACK_GETTING_STARTED = `${ELASTIC_WEBSITE_URL}guide/en/elastic-stack-get-started/${DOC_LINK_VERSION}/`;
const APP_SEARCH_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/app-search/${DOC_LINK_VERSION}/`;
const ENTERPRISE_SEARCH_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/enterprise-search/${DOC_LINK_VERSION}/`;
const WORKPLACE_SEARCH_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/workplace-search/${DOC_LINK_VERSION}/`;
return deepFreeze({
settings: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/settings.html`,
elasticStackGetStarted: `${STACK_GETTING_STARTED}get-started-elastic-stack.html`,
upgrade: {
upgradingStackOnPrem: `${ELASTIC_WEBSITE_URL}guide/en/elastic-stack/8.0/upgrading-elastic-stack-on-prem.html`,
upgradingStackOnCloud: `${ELASTIC_WEBSITE_URL}guide/en/elastic-stack/8.0/upgrade-elastic-stack-for-elastic-cloud.html`,
},
apm: {
kibanaSettings: `${KIBANA_DOCS}apm-settings-in-kibana.html`,
supportedServiceMaps: `${KIBANA_DOCS}service-maps.html#service-maps-supported`,
customLinks: `${KIBANA_DOCS}custom-links.html`,
droppedTransactionSpans: `${APM_DOCS}guide/${DOC_LINK_VERSION}/data-model-spans.html#data-model-dropped-spans`,
upgrading: `${APM_DOCS}guide/${DOC_LINK_VERSION}/upgrade.html`,
metaData: `${APM_DOCS}guide/${DOC_LINK_VERSION}/data-model-metadata.html`,
},
canvas: {
guide: `${KIBANA_DOCS}canvas.html`,
},
cloud: {
indexManagement: `${ELASTIC_WEBSITE_URL}/guide/en/cloud/current/ec-configure-index-management.html`,
},
console: {
guide: `${KIBANA_DOCS}console-kibana.html`,
},
dashboard: {
guide: `${KIBANA_DOCS}dashboard.html`,
drilldowns: `${KIBANA_DOCS}drilldowns.html`,
drilldownsTriggerPicker: `${KIBANA_DOCS}drilldowns.html#url-drilldowns`,
urlDrilldownTemplateSyntax: `${KIBANA_DOCS}url_templating-language.html`,
urlDrilldownVariables: `${KIBANA_DOCS}url_templating-language.html#url-template-variables`,
},
discover: {
guide: `${KIBANA_DOCS}discover.html`,
},
filebeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}`,
installation: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/filebeat-installation-configuration.html`,
configuration: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/configuring-howto-filebeat.html`,
elasticsearchModule: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/filebeat-module-elasticsearch.html`,
elasticsearchOutput: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/elasticsearch-output.html`,
startup: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/filebeat-starting.html`,
exportedFields: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/exported-fields.html`,
suricataModule: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/filebeat-module-suricata.html`,
zeekModule: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/filebeat-module-zeek.html`,
},
auditbeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/auditbeat/${DOC_LINK_VERSION}`,
auditdModule: `${ELASTIC_WEBSITE_URL}guide/en/beats/auditbeat/${DOC_LINK_VERSION}/auditbeat-module-auditd.html`,
systemModule: `${ELASTIC_WEBSITE_URL}guide/en/beats/auditbeat/${DOC_LINK_VERSION}/auditbeat-module-system.html`,
},
appSearch: {
apiRef: `${APP_SEARCH_DOCS}api-reference.html`,
apiClients: `${APP_SEARCH_DOCS}api-clients.html`,
apiKeys: `${APP_SEARCH_DOCS}authentication.html#authentication-api-keys`,
authentication: `${APP_SEARCH_DOCS}authentication.html`,
crawlRules: `${APP_SEARCH_DOCS}crawl-web-content.html#crawl-web-content-manage-crawl-rules`,
curations: `${APP_SEARCH_DOCS}curations-guide.html`,
duplicateDocuments: `${APP_SEARCH_DOCS}web-crawler-reference.html#web-crawler-reference-content-deduplication`,
entryPoints: `${APP_SEARCH_DOCS}crawl-web-content.html#crawl-web-content-manage-entry-points`,
guide: `${APP_SEARCH_DOCS}index.html`,
indexingDocuments: `${APP_SEARCH_DOCS}indexing-documents-guide.html`,
indexingDocumentsSchema: `${APP_SEARCH_DOCS}indexing-documents-guide.html#indexing-documents-guide-schema`,
logSettings: `${APP_SEARCH_DOCS}logs.html`,
metaEngines: `${APP_SEARCH_DOCS}meta-engines-guide.html`,
precisionTuning: `${APP_SEARCH_DOCS}precision-tuning.html`,
relevanceTuning: `${APP_SEARCH_DOCS}relevance-tuning-guide.html`,
resultSettings: `${APP_SEARCH_DOCS}result-settings-guide.html`,
searchUI: `${APP_SEARCH_DOCS}reference-ui-guide.html`,
security: `${APP_SEARCH_DOCS}security-and-users.html`,
synonyms: `${APP_SEARCH_DOCS}synonyms-guide.html`,
webCrawler: `${APP_SEARCH_DOCS}web-crawler.html`,
webCrawlerEventLogs: `${APP_SEARCH_DOCS}view-web-crawler-events-logs.html`,
},
enterpriseSearch: {
configuration: `${ENTERPRISE_SEARCH_DOCS}configuration.html`,
licenseManagement: `${ENTERPRISE_SEARCH_DOCS}license-management.html`,
mailService: `${ENTERPRISE_SEARCH_DOCS}mailer-configuration.html`,
usersAccess: `${ENTERPRISE_SEARCH_DOCS}users-access.html`,
},
workplaceSearch: {
apiKeys: `${WORKPLACE_SEARCH_DOCS}workplace-search-api-authentication.html`,
box: `${WORKPLACE_SEARCH_DOCS}workplace-search-box-connector.html`,
confluenceCloud: `${WORKPLACE_SEARCH_DOCS}workplace-search-confluence-cloud-connector.html`,
confluenceServer: `${WORKPLACE_SEARCH_DOCS}workplace-search-confluence-server-connector.html`,
customSources: `${WORKPLACE_SEARCH_DOCS}workplace-search-custom-api-sources.html`,
customSourcePermissions: `${WORKPLACE_SEARCH_DOCS}workplace-search-custom-api-sources.html#custom-api-source-document-level-access-control`,
documentPermissions: `${WORKPLACE_SEARCH_DOCS}workplace-search-sources-document-permissions.html`,
dropbox: `${WORKPLACE_SEARCH_DOCS}workplace-search-dropbox-connector.html`,
externalIdentities: `${WORKPLACE_SEARCH_DOCS}workplace-search-external-identities-api.html`,
gettingStarted: `${WORKPLACE_SEARCH_DOCS}workplace-search-getting-started.html`,
gitHub: `${WORKPLACE_SEARCH_DOCS}workplace-search-github-connector.html`,
gmail: `${WORKPLACE_SEARCH_DOCS}workplace-search-gmail-connector.html`,
googleDrive: `${WORKPLACE_SEARCH_DOCS}workplace-search-google-drive-connector.html`,
indexingSchedule: `${WORKPLACE_SEARCH_DOCS}workplace-search-customizing-indexing-rules.html#_indexing_schedule`,
jiraCloud: `${WORKPLACE_SEARCH_DOCS}workplace-search-jira-cloud-connector.html`,
jiraServer: `${WORKPLACE_SEARCH_DOCS}workplace-search-jira-server-connector.html`,
oneDrive: `${WORKPLACE_SEARCH_DOCS}workplace-search-onedrive-connector.html`,
permissions: `${WORKPLACE_SEARCH_DOCS}workplace-search-permissions.html#organizational-sources-private-sources`,
salesforce: `${WORKPLACE_SEARCH_DOCS}workplace-search-salesforce-connector.html`,
security: `${WORKPLACE_SEARCH_DOCS}workplace-search-security.html`,
serviceNow: `${WORKPLACE_SEARCH_DOCS}workplace-search-servicenow-connector.html`,
sharePoint: `${WORKPLACE_SEARCH_DOCS}workplace-search-sharepoint-online-connector.html`,
slack: `${WORKPLACE_SEARCH_DOCS}workplace-search-slack-connector.html`,
synch: `${WORKPLACE_SEARCH_DOCS}workplace-search-customizing-indexing-rules.html`,
zendesk: `${WORKPLACE_SEARCH_DOCS}workplace-search-zendesk-connector.html`,
},
metricbeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/metricbeat/${DOC_LINK_VERSION}`,
configure: `${ELASTIC_WEBSITE_URL}guide/en/beats/metricbeat/${DOC_LINK_VERSION}/configuring-howto-metricbeat.html`,
httpEndpoint: `${ELASTIC_WEBSITE_URL}guide/en/beats/metricbeat/${DOC_LINK_VERSION}/http-endpoint.html`,
install: `${ELASTIC_WEBSITE_URL}guide/en/beats/metricbeat/${DOC_LINK_VERSION}/metricbeat-installation-configuration.html`,
start: `${ELASTIC_WEBSITE_URL}guide/en/beats/metricbeat/${DOC_LINK_VERSION}/metricbeat-starting.html`,
},
heartbeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/heartbeat/${DOC_LINK_VERSION}`,
},
libbeat: {
getStarted: `${ELASTIC_WEBSITE_URL}guide/en/beats/libbeat/${DOC_LINK_VERSION}/getting-started.html`,
},
logstash: {
base: `${ELASTIC_WEBSITE_URL}guide/en/logstash/${DOC_LINK_VERSION}`,
},
functionbeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/functionbeat/${DOC_LINK_VERSION}`,
},
winlogbeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/winlogbeat/${DOC_LINK_VERSION}`,
},
aggs: {
composite: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-composite-aggregation.html`,
composite_missing_bucket: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-composite-aggregation.html#_missing_bucket`,
date_histogram: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-datehistogram-aggregation.html`,
date_range: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-daterange-aggregation.html`,
date_format_pattern: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-daterange-aggregation.html#date-format-pattern`,
filter: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-filter-aggregation.html`,
filters: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-filters-aggregation.html`,
geohash_grid: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-geohashgrid-aggregation.html`,
histogram: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-histogram-aggregation.html`,
ip_range: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-iprange-aggregation.html`,
range: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-range-aggregation.html`,
significant_terms: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-significantterms-aggregation.html`,
terms: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-terms-aggregation.html`,
terms_doc_count_error: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-terms-aggregation.html#_per_bucket_document_count_error`,
rare_terms: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-rare-terms-aggregation.html`,
avg: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-avg-aggregation.html`,
avg_bucket: `${ELASTICSEARCH_DOCS}search-aggregations-pipeline-avg-bucket-aggregation.html`,
max_bucket: `${ELASTICSEARCH_DOCS}search-aggregations-pipeline-max-bucket-aggregation.html`,
min_bucket: `${ELASTICSEARCH_DOCS}search-aggregations-pipeline-min-bucket-aggregation.html`,
sum_bucket: `${ELASTICSEARCH_DOCS}search-aggregations-pipeline-sum-bucket-aggregation.html`,
cardinality: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-cardinality-aggregation.html`,
count: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-valuecount-aggregation.html`,
cumulative_sum: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-sum-aggregation.html`,
derivative: `${ELASTICSEARCH_DOCS}search-aggregations-pipeline-derivative-aggregation.html`,
geo_bounds: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-geobounds-aggregation.html`,
geo_centroid: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-geocentroid-aggregation.html`,
max: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-max-aggregation.html`,
median: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-percentile-aggregation.html`,
min: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-min-aggregation.html`,
moving_avg: `${ELASTICSEARCH_DOCS}search-aggregations-pipeline-movfn-aggregation.html`,
percentile_ranks: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-percentile-rank-aggregation.html`,
serial_diff: `${ELASTICSEARCH_DOCS}search-aggregations-pipeline-serialdiff-aggregation.html`,
std_dev: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-extendedstats-aggregation.html`,
sum: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-sum-aggregation.html`,
top_hits: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-top-hits-aggregation.html`,
},
runtimeFields: {
overview: `${ELASTICSEARCH_DOCS}runtime.html`,
mapping: `${ELASTICSEARCH_DOCS}runtime-mapping-fields.html`,
},
scriptedFields: {
scriptFields: `${ELASTICSEARCH_DOCS}search-request-script-fields.html`,
scriptAggs: `${ELASTICSEARCH_DOCS}search-aggregations.html`,
painless: `${ELASTICSEARCH_DOCS}modules-scripting-painless.html`,
painlessApi: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/painless/${DOC_LINK_VERSION}/painless-api-reference.html`,
painlessLangSpec: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/painless/${DOC_LINK_VERSION}/painless-lang-spec.html`,
painlessSyntax: `${ELASTICSEARCH_DOCS}modules-scripting-painless-syntax.html`,
painlessWalkthrough: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/painless/${DOC_LINK_VERSION}/painless-walkthrough.html`,
painlessLanguage: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/painless/${DOC_LINK_VERSION}/painless-lang-spec.html`,
luceneExpressions: `${ELASTICSEARCH_DOCS}modules-scripting-expression.html`,
},
indexPatterns: {
introduction: `${KIBANA_DOCS}data-views.html`,
fieldFormattersNumber: `${KIBANA_DOCS}numeral.html`,
fieldFormattersString: `${KIBANA_DOCS}field-formatters-string.html`,
runtimeFields: `${KIBANA_DOCS}managing-data-views.html#runtime-fields`,
},
addData: `${KIBANA_DOCS}connect-to-elasticsearch.html`,
kibana: {
guide: `${KIBANA_DOCS}index.html`,
autocompleteSuggestions: `${KIBANA_DOCS}kibana-concepts-analysts.html#autocomplete-suggestions`,
xpackSecurity: `${KIBANA_DOCS}xpack-security.html`,
},
upgradeAssistant: {
overview: `${KIBANA_DOCS}upgrade-assistant.html`,
batchReindex: `${KIBANA_DOCS}batch-start-resume-reindex.html`,
remoteReindex: `${ELASTICSEARCH_DOCS}docs-reindex.html#reindex-from-remote`,
},
rollupJobs: `${KIBANA_DOCS}data-rollups.html`,
elasticsearch: {
docsBase: `${ELASTICSEARCH_DOCS}`,
asyncSearch: `${ELASTICSEARCH_DOCS}async-search-intro.html`,
dataStreams: `${ELASTICSEARCH_DOCS}data-streams.html`,
deprecationLogging: `${ELASTICSEARCH_DOCS}logging.html#deprecation-logging`,
hiddenIndices: `${ELASTICSEARCH_DOCS}multi-index.html#hidden`,
ilm: `${ELASTICSEARCH_DOCS}index-lifecycle-management.html`,
ilmForceMerge: `${ELASTICSEARCH_DOCS}ilm-forcemerge.html`,
ilmFreeze: `${ELASTICSEARCH_DOCS}ilm-freeze.html`,
ilmPhaseTransitions: `${ELASTICSEARCH_DOCS}ilm-index-lifecycle.html#ilm-phase-transitions`,
ilmReadOnly: `${ELASTICSEARCH_DOCS}ilm-readonly.html`,
ilmRollover: `${ELASTICSEARCH_DOCS}ilm-rollover.html`,
ilmSearchableSnapshot: `${ELASTICSEARCH_DOCS}ilm-searchable-snapshot.html`,
ilmSetPriority: `${ELASTICSEARCH_DOCS}ilm-set-priority.html`,
ilmShrink: `${ELASTICSEARCH_DOCS}ilm-shrink.html`,
ilmWaitForSnapshot: `${ELASTICSEARCH_DOCS}ilm-wait-for-snapshot.html`,
indexModules: `${ELASTICSEARCH_DOCS}index-modules.html`,
indexSettings: `${ELASTICSEARCH_DOCS}index-modules.html#index-modules-settings`,
dynamicIndexSettings: `${ELASTICSEARCH_DOCS}index-modules.html#dynamic-index-settings`,
indexTemplates: `${ELASTICSEARCH_DOCS}index-templates.html`,
mapping: `${ELASTICSEARCH_DOCS}mapping.html`,
mappingAnalyzer: `${ELASTICSEARCH_DOCS}analyzer.html`,
mappingCoerce: `${ELASTICSEARCH_DOCS}coerce.html`,
mappingCopyTo: `${ELASTICSEARCH_DOCS}copy-to.html`,
mappingDocValues: `${ELASTICSEARCH_DOCS}doc-values.html`,
mappingDynamic: `${ELASTICSEARCH_DOCS}dynamic.html`,
mappingDynamicFields: `${ELASTICSEARCH_DOCS}dynamic-field-mapping.html`,
mappingDynamicTemplates: `${ELASTICSEARCH_DOCS}dynamic-templates.html`,
mappingEagerGlobalOrdinals: `${ELASTICSEARCH_DOCS}eager-global-ordinals.html`,
mappingEnabled: `${ELASTICSEARCH_DOCS}enabled.html`,
mappingFieldData: `${ELASTICSEARCH_DOCS}text.html#fielddata-mapping-param`,
mappingFieldDataEnable: `${ELASTICSEARCH_DOCS}text.html#before-enabling-fielddata`,
mappingFieldDataFilter: `${ELASTICSEARCH_DOCS}text.html#field-data-filtering`,
mappingFieldDataTypes: `${ELASTICSEARCH_DOCS}mapping-types.html`,
mappingFormat: `${ELASTICSEARCH_DOCS}mapping-date-format.html`,
mappingIgnoreAbove: `${ELASTICSEARCH_DOCS}ignore-above.html`,
mappingIgnoreMalformed: `${ELASTICSEARCH_DOCS}ignore-malformed.html`,
mappingIndex: `${ELASTICSEARCH_DOCS}mapping-index.html`,
mappingIndexOptions: `${ELASTICSEARCH_DOCS}index-options.html`,
mappingIndexPhrases: `${ELASTICSEARCH_DOCS}index-phrases.html`,
mappingIndexPrefixes: `${ELASTICSEARCH_DOCS}index-prefixes.html`,
mappingJoinFieldsPerformance: `${ELASTICSEARCH_DOCS}parent-join.html#_parent_join_and_performance`,
mappingMeta: `${ELASTICSEARCH_DOCS}mapping-field-meta.html`,
mappingMetaFields: `${ELASTICSEARCH_DOCS}mapping-meta-field.html`,
mappingMultifields: `${ELASTICSEARCH_DOCS}multi-fields.html`,
mappingNormalizer: `${ELASTICSEARCH_DOCS}normalizer.html`,
mappingNorms: `${ELASTICSEARCH_DOCS}norms.html`,
mappingNullValue: `${ELASTICSEARCH_DOCS}null-value.html`,
mappingParameters: `${ELASTICSEARCH_DOCS}mapping-params.html`,
mappingPositionIncrementGap: `${ELASTICSEARCH_DOCS}position-increment-gap.html`,
mappingRankFeatureFields: `${ELASTICSEARCH_DOCS}rank-feature.html`,
mappingRouting: `${ELASTICSEARCH_DOCS}mapping-routing-field.html`,
mappingSimilarity: `${ELASTICSEARCH_DOCS}similarity.html`,
mappingSourceFields: `${ELASTICSEARCH_DOCS}mapping-source-field.html`,
mappingSourceFieldsDisable: `${ELASTICSEARCH_DOCS}mapping-source-field.html#disable-source-field`,
mappingStore: `${ELASTICSEARCH_DOCS}mapping-store.html`,
mappingTermVector: `${ELASTICSEARCH_DOCS}term-vector.html`,
mappingTypesRemoval: `${ELASTICSEARCH_DOCS}removal-of-types.html`,
migrateIndexAllocationFilters: `${ELASTICSEARCH_DOCS}migrate-index-allocation-filters.html`,
migrationApiDeprecation: `${ELASTICSEARCH_DOCS}migration-api-deprecation.html`,
nodeRoles: `${ELASTICSEARCH_DOCS}modules-node.html#node-roles`,
releaseHighlights: `${ELASTICSEARCH_DOCS}release-highlights.html`,
version8ReleaseHighlights: `${ELASTIC_WEBSITE_URL}guide/en/elastic-stack/8.0/elastic-stack-highlights.html`,
remoteClusters: `${ELASTICSEARCH_DOCS}remote-clusters.html`,
remoteClustersProxy: `${ELASTICSEARCH_DOCS}remote-clusters.html#proxy-mode`,
remoteClusersProxySettings: `${ELASTICSEARCH_DOCS}remote-clusters-settings.html#remote-cluster-proxy-settings`,
scriptParameters: `${ELASTICSEARCH_DOCS}modules-scripting-using.html#prefer-params`,
shardAllocationSettings: `${ELASTICSEARCH_DOCS}modules-cluster.html#cluster-shard-allocation-settings`,
sortSearch: `${ELASTICSEARCH_DOCS}sort-search-results.html`,
transportSettings: `${ELASTICSEARCH_DOCS}modules-network.html#common-network-settings`,
typesRemoval: `${ELASTICSEARCH_DOCS}removal-of-types.html`,
setupUpgrade: `${ELASTICSEARCH_DOCS}setup-upgrade.html`,
apiCompatibilityHeader: `${ELASTICSEARCH_DOCS}api-conventions.html#api-compatibility`,
},
siem: {
guide: `${SECURITY_SOLUTION_DOCS}index.html`,
gettingStarted: `${SECURITY_SOLUTION_DOCS}index.html`,
privileges: `${SECURITY_SOLUTION_DOCS}sec-requirements.html`,
ml: `${SECURITY_SOLUTION_DOCS}machine-learning.html`,
ruleChangeLog: `${SECURITY_SOLUTION_DOCS}prebuilt-rules-changelog.html`,
detectionsReq: `${SECURITY_SOLUTION_DOCS}detections-permissions-section.html`,
networkMap: `${SECURITY_SOLUTION_DOCS}conf-map-ui.html`,
troubleshootGaps: `${SECURITY_SOLUTION_DOCS}alerts-ui-monitor.html#troubleshoot-gaps`,
},
securitySolution: {
trustedApps: `${ELASTIC_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/trusted-apps-ov.html`,
eventFilters: `${ELASTIC_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/event-filters.html`,
},
query: {
eql: `${ELASTICSEARCH_DOCS}eql.html`,
kueryQuerySyntax: `${KIBANA_DOCS}kuery-query.html`,
luceneQuery: `${ELASTICSEARCH_DOCS}query-dsl-query-string-query.html`,
luceneQuerySyntax: `${ELASTICSEARCH_DOCS}query-dsl-query-string-query.html#query-string-syntax`,
percolate: `${ELASTICSEARCH_DOCS}query-dsl-percolate-query.html`,
queryDsl: `${ELASTICSEARCH_DOCS}query-dsl.html`,
},
search: {
sessions: `${KIBANA_DOCS}search-sessions.html`,
sessionLimits: `${KIBANA_DOCS}search-sessions.html#_limitations`,
},
date: {
dateMath: `${ELASTICSEARCH_DOCS}common-options.html#date-math`,
dateMathIndexNames: `${ELASTICSEARCH_DOCS}date-math-index-names.html`,
},
management: {
dashboardSettings: `${KIBANA_DOCS}advanced-options.html#kibana-dashboard-settings`,
indexManagement: `${ELASTICSEARCH_DOCS}index-mgmt.html`,
kibanaSearchSettings: `${KIBANA_DOCS}advanced-options.html#kibana-search-settings`,
visualizationSettings: `${KIBANA_DOCS}advanced-options.html#kibana-visualization-settings`,
timelionSettings: `${KIBANA_DOCS}advanced-options.html#kibana-timelion-settings`,
savedObjectsApiList: `${KIBANA_DOCS}saved-objects-api.html#saved-objects-api`,
},
ml: {
guide: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/index.html`,
aggregations: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-configuring-aggregation.html`,
anomalyDetection: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-ad-overview.html`,
anomalyDetectionJobs: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-ad-finding-anomalies.html`,
anomalyDetectionConfiguringCategories: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-configuring-categories.html`,
anomalyDetectionBucketSpan: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-ad-run-jobs.html#ml-ad-bucket-span`,
anomalyDetectionCardinality: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-ad-run-jobs.html#ml-ad-cardinality`,
anomalyDetectionCreateJobs: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-ad-run-jobs.html#ml-ad-create-job`,
anomalyDetectionDetectors: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-ad-run-jobs.html#ml-ad-detectors`,
anomalyDetectionInfluencers: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-ad-run-jobs.html#ml-ad-influencers`,
anomalyDetectionJobResource: `${ELASTICSEARCH_DOCS}ml-put-job.html#ml-put-job-path-parms`,
anomalyDetectionJobResourceAnalysisConfig: `${ELASTICSEARCH_DOCS}ml-put-job.html#put-analysisconfig`,
anomalyDetectionJobTips: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-ad-run-jobs.html#ml-ad-job-tips`,
alertingRules: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-configuring-alerts.html`,
anomalyDetectionModelMemoryLimits: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-ad-run-jobs.html#ml-ad-model-memory-limits`,
calendars: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-ad-run-jobs.html#ml-ad-calendars`,
classificationEvaluation: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-dfa-classification.html#ml-dfanalytics-classification-evaluation`,
customRules: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-ad-run-jobs.html#ml-ad-rules`,
customUrls: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-configuring-url.html`,
dataFrameAnalytics: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-dfanalytics.html`,
featureImportance: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-feature-importance.html`,
outlierDetectionRoc: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-dfa-finding-outliers.html#ml-dfanalytics-roc`,
regressionEvaluation: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-dfa-regression.html#ml-dfanalytics-regression-evaluation`,
classificationAucRoc: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-dfa-classification.html#ml-dfanalytics-class-aucroc`,
setUpgradeMode: `${ELASTICSEARCH_DOCS}ml-set-upgrade-mode.html`,
},
transforms: {
guide: `${ELASTICSEARCH_DOCS}transforms.html`,
// TODO add valid docs URL
alertingRules: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-configuring-alerts.html`,
},
visualize: {
guide: `${KIBANA_DOCS}dashboard.html`,
lens: `${ELASTIC_WEBSITE_URL}what-is/kibana-lens`,
lensPanels: `${KIBANA_DOCS}lens.html`,
maps: `${ELASTIC_WEBSITE_URL}maps`,
vega: `${KIBANA_DOCS}vega.html`,
tsvbIndexPatternMode: `${KIBANA_DOCS}tsvb.html#tsvb-index-pattern-mode`,
},
observability: {
guide: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/index.html`,
infrastructureThreshold: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/infrastructure-threshold-alert.html`,
logsThreshold: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/logs-threshold-alert.html`,
metricsThreshold: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/metrics-threshold-alert.html`,
monitorStatus: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/monitor-status-alert.html`,
monitorUptime: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/monitor-uptime.html`,
tlsCertificate: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/tls-certificate-alert.html`,
uptimeDurationAnomaly: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/duration-anomaly-alert.html`,
},
alerting: {
guide: `${KIBANA_DOCS}create-and-manage-rules.html`,
actionTypes: `${KIBANA_DOCS}action-types.html`,
apmRules: `${KIBANA_DOCS}apm-alerts.html`,
emailAction: `${KIBANA_DOCS}email-action-type.html`,
emailActionConfig: `${KIBANA_DOCS}email-action-type.html`,
emailExchangeClientSecretConfig: `${KIBANA_DOCS}email-action-type.html#exchange-client-secret`,
emailExchangeClientIdConfig: `${KIBANA_DOCS}email-action-type.html#exchange-client-tenant-id`,
generalSettings: `${KIBANA_DOCS}alert-action-settings-kb.html#general-alert-action-settings`,
indexAction: `${KIBANA_DOCS}index-action-type.html`,
esQuery: `${KIBANA_DOCS}rule-type-es-query.html`,
indexThreshold: `${KIBANA_DOCS}rule-type-index-threshold.html`,
pagerDutyAction: `${KIBANA_DOCS}pagerduty-action-type.html`,
preconfiguredConnectors: `${KIBANA_DOCS}pre-configured-connectors.html`,
preconfiguredAlertHistoryConnector: `${KIBANA_DOCS}index-action-type.html#preconfigured-connector-alert-history`,
serviceNowAction: `${KIBANA_DOCS}servicenow-action-type.html#configuring-servicenow`,
serviceNowSIRAction: `${KIBANA_DOCS}servicenow-sir-action-type.html`,
setupPrerequisites: `${KIBANA_DOCS}alerting-setup.html#alerting-prerequisites`,
slackAction: `${KIBANA_DOCS}slack-action-type.html#configuring-slack`,
teamsAction: `${KIBANA_DOCS}teams-action-type.html#configuring-teams`,
},
maps: {
guide: `${KIBANA_DOCS}maps.html`,
importGeospatialPrivileges: `${KIBANA_DOCS}import-geospatial-data.html#import-geospatial-privileges`,
gdalTutorial: `${ELASTIC_WEBSITE_URL}blog/how-to-ingest-geospatial-data-into-elasticsearch-with-gdal`,
},
monitoring: {
alertsKibana: `${KIBANA_DOCS}kibana-alerts.html`,
alertsKibanaCpuThreshold: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-cpu-threshold`,
alertsKibanaDiskThreshold: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-disk-usage-threshold`,
alertsKibanaJvmThreshold: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-jvm-memory-threshold`,
alertsKibanaMissingData: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-missing-monitoring-data`,
alertsKibanaThreadpoolRejections: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-thread-pool-rejections`,
alertsKibanaCCRReadExceptions: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-ccr-read-exceptions`,
alertsKibanaLargeShardSize: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-large-shard-size`,
alertsKibanaClusterAlerts: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-cluster-alerts`,
metricbeatBlog: `${ELASTIC_WEBSITE_URL}blog/external-collection-for-elastic-stack-monitoring-is-now-available-via-metricbeat`,
monitorElasticsearch: `${ELASTICSEARCH_DOCS}configuring-metricbeat.html`,
monitorKibana: `${KIBANA_DOCS}monitoring-metricbeat.html`,
monitorLogstash: `${ELASTIC_WEBSITE_URL}guide/en/logstash/${DOC_LINK_VERSION}/monitoring-with-metricbeat.html`,
troubleshootKibana: `${KIBANA_DOCS}monitor-troubleshooting.html`,
},
security: {
apiKeyServiceSettings: `${ELASTICSEARCH_DOCS}security-settings.html#api-key-service-settings`,
clusterPrivileges: `${ELASTICSEARCH_DOCS}security-privileges.html#privileges-list-cluster`,
elasticsearchSettings: `${ELASTICSEARCH_DOCS}security-settings.html`,
elasticsearchEnableSecurity: `${ELASTICSEARCH_DOCS}configuring-stack-security.html`,
elasticsearchEnableApiKeys: `${ELASTICSEARCH_DOCS}security-settings.html#api-key-service-settings`,
indicesPrivileges: `${ELASTICSEARCH_DOCS}security-privileges.html#privileges-list-indices`,
kibanaTLS: `${ELASTICSEARCH_DOCS}security-basic-setup.html#encrypt-internode-communication`,
kibanaPrivileges: `${KIBANA_DOCS}kibana-privileges.html`,
mappingRoles: `${ELASTICSEARCH_DOCS}mapping-roles.html`,
mappingRolesFieldRules: `${ELASTICSEARCH_DOCS}role-mapping-resources.html#mapping-roles-rule-field`,
runAsPrivilege: `${ELASTICSEARCH_DOCS}security-privileges.html#_run_as_privilege`,
},
spaces: {
kibanaLegacyUrlAliases: `${KIBANA_DOCS}legacy-url-aliases.html`,
kibanaDisableLegacyUrlAliasesApi: `${KIBANA_DOCS}spaces-api-disable-legacy-url-aliases.html`,
},
watcher: {
jiraAction: `${ELASTICSEARCH_DOCS}actions-jira.html`,
pagerDutyAction: `${ELASTICSEARCH_DOCS}actions-pagerduty.html`,
slackAction: `${ELASTICSEARCH_DOCS}actions-slack.html`,
ui: `${KIBANA_DOCS}watcher-ui.html`,
},
ccs: {
guide: `${ELASTICSEARCH_DOCS}modules-cross-cluster-search.html`,
skippingDisconnectedClusters: `${ELASTICSEARCH_DOCS}modules-cross-cluster-search.html#skip-unavailable-clusters`,
},
apis: {
bulkIndexAlias: `${ELASTICSEARCH_DOCS}indices-aliases.html`,
byteSizeUnits: `${ELASTICSEARCH_DOCS}api-conventions.html#byte-units`,
createAutoFollowPattern: `${ELASTICSEARCH_DOCS}ccr-put-auto-follow-pattern.html`,
createFollower: `${ELASTICSEARCH_DOCS}ccr-put-follow.html`,
createIndex: `${ELASTICSEARCH_DOCS}indices-create-index.html`,
createSnapshotLifecyclePolicy: `${ELASTICSEARCH_DOCS}slm-api-put-policy.html`,
createRoleMapping: `${ELASTICSEARCH_DOCS}security-api-put-role-mapping.html`,
createRoleMappingTemplates: `${ELASTICSEARCH_DOCS}security-api-put-role-mapping.html#_role_templates`,
createRollupJobsRequest: `${ELASTICSEARCH_DOCS}rollup-put-job.html#rollup-put-job-api-request-body`,
createApiKey: `${ELASTICSEARCH_DOCS}security-api-create-api-key.html`,
createPipeline: `${ELASTICSEARCH_DOCS}put-pipeline-api.html`,
createTransformRequest: `${ELASTICSEARCH_DOCS}put-transform.html#put-transform-request-body`,
cronExpressions: `${ELASTICSEARCH_DOCS}cron-expressions.html`,
executeWatchActionModes: `${ELASTICSEARCH_DOCS}watcher-api-execute-watch.html#watcher-api-execute-watch-action-mode`,
indexExists: `${ELASTICSEARCH_DOCS}indices-exists.html`,
multiSearch: `${ELASTICSEARCH_DOCS}search-multi-search.html`,
openIndex: `${ELASTICSEARCH_DOCS}indices-open-close.html`,
putComponentTemplate: `${ELASTICSEARCH_DOCS}indices-component-template.html`,
painlessExecute: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/painless/${DOC_LINK_VERSION}/painless-execute-api.html`,
painlessExecuteAPIContexts: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/painless/${DOC_LINK_VERSION}/painless-execute-api.html#_contexts`,
putComponentTemplateMetadata: `${ELASTICSEARCH_DOCS}indices-component-template.html#component-templates-metadata`,
putEnrichPolicy: `${ELASTICSEARCH_DOCS}put-enrich-policy-api.html`,
putIndexTemplateV1: `${ELASTICSEARCH_DOCS}indices-templates-v1.html`,
putSnapshotLifecyclePolicy: `${ELASTICSEARCH_DOCS}slm-api-put-policy.html`,
putWatch: `${ELASTICSEARCH_DOCS}watcher-api-put-watch.html`,
searchPreference: `${ELASTICSEARCH_DOCS}search-search.html#search-preference`,
simulatePipeline: `${ELASTICSEARCH_DOCS}simulate-pipeline-api.html`,
timeUnits: `${ELASTICSEARCH_DOCS}api-conventions.html#time-units`,
unfreezeIndex: `${ELASTICSEARCH_DOCS}unfreeze-index-api.html`,
updateTransform: `${ELASTICSEARCH_DOCS}update-transform.html`,
},
plugins: {
azureRepo: `${ELASTICSEARCH_DOCS}repository-azure.html`,
gcsRepo: `${ELASTICSEARCH_DOCS}repository-gcs.html`,
hdfsRepo: `${PLUGIN_DOCS}repository-hdfs.html`,
s3Repo: `${ELASTICSEARCH_DOCS}repository-s3.html`,
snapshotRestoreRepos: `${ELASTICSEARCH_DOCS}snapshots-register-repository.html`,
mapperSize: `${PLUGIN_DOCS}mapper-size-usage.html`,
},
snapshotRestore: {
guide: `${ELASTICSEARCH_DOCS}snapshot-restore.html`,
changeIndexSettings: `${ELASTICSEARCH_DOCS}index-modules.html`,
createSnapshot: `${ELASTICSEARCH_DOCS}snapshots-take-snapshot.html`,
getSnapshot: `${ELASTICSEARCH_DOCS}get-snapshot-api.html`,
registerSharedFileSystem: `${ELASTICSEARCH_DOCS}snapshots-filesystem-repository.html#filesystem-repository-settings`,
registerSourceOnly: `${ELASTICSEARCH_DOCS}snapshots-source-only-repository.html#source-only-repository-settings`,
registerUrl: `${ELASTICSEARCH_DOCS}snapshots-read-only-repository.html#read-only-url-repository-settings`,
restoreSnapshot: `${ELASTICSEARCH_DOCS}snapshots-restore-snapshot.html`,
restoreSnapshotApi: `${ELASTICSEARCH_DOCS}restore-snapshot-api.html#restore-snapshot-api-request-body`,
searchableSnapshotSharedCache: `${ELASTICSEARCH_DOCS}searchable-snapshots.html#searchable-snapshots-shared-cache`,
},
ingest: {
append: `${ELASTICSEARCH_DOCS}append-processor.html`,
bytes: `${ELASTICSEARCH_DOCS}bytes-processor.html`,
circle: `${ELASTICSEARCH_DOCS}ingest-circle-processor.html`,
convert: `${ELASTICSEARCH_DOCS}convert-processor.html`,
csv: `${ELASTICSEARCH_DOCS}csv-processor.html`,
date: `${ELASTICSEARCH_DOCS}date-processor.html`,
dateIndexName: `${ELASTICSEARCH_DOCS}date-index-name-processor.html`,
dissect: `${ELASTICSEARCH_DOCS}dissect-processor.html`,
dissectKeyModifiers: `${ELASTICSEARCH_DOCS}dissect-processor.html#dissect-key-modifiers`,
dotExpander: `${ELASTICSEARCH_DOCS}dot-expand-processor.html`,
drop: `${ELASTICSEARCH_DOCS}drop-processor.html`,
enrich: `${ELASTICSEARCH_DOCS}ingest-enriching-data.html`,
fail: `${ELASTICSEARCH_DOCS}fail-processor.html`,
foreach: `${ELASTICSEARCH_DOCS}foreach-processor.html`,
geoIp: `${ELASTICSEARCH_DOCS}geoip-processor.html`,
geoMatch: `${ELASTICSEARCH_DOCS}geo-match-enrich-policy-type.html`,
grok: `${ELASTICSEARCH_DOCS}grok-processor.html`,
gsub: `${ELASTICSEARCH_DOCS}gsub-processor.html`,
htmlString: `${ELASTICSEARCH_DOCS}htmlstrip-processor.html`,
inference: `${ELASTICSEARCH_DOCS}inference-processor.html`,
inferenceClassification: `${ELASTICSEARCH_DOCS}inference-processor.html#inference-processor-classification-opt`,
inferenceRegression: `${ELASTICSEARCH_DOCS}inference-processor.html#inference-processor-regression-opt`,
join: `${ELASTICSEARCH_DOCS}join-processor.html`,
json: `${ELASTICSEARCH_DOCS}json-processor.html`,
kv: `${ELASTICSEARCH_DOCS}kv-processor.html`,
lowercase: `${ELASTICSEARCH_DOCS}lowercase-processor.html`,
pipeline: `${ELASTICSEARCH_DOCS}pipeline-processor.html`,
pipelines: `${ELASTICSEARCH_DOCS}ingest.html`,
pipelineFailure: `${ELASTICSEARCH_DOCS}ingest.html#handling-pipeline-failures`,
processors: `${ELASTICSEARCH_DOCS}processors.html`,
remove: `${ELASTICSEARCH_DOCS}remove-processor.html`,
rename: `${ELASTICSEARCH_DOCS}rename-processor.html`,
script: `${ELASTICSEARCH_DOCS}script-processor.html`,
set: `${ELASTICSEARCH_DOCS}set-processor.html`,
setSecurityUser: `${ELASTICSEARCH_DOCS}ingest-node-set-security-user-processor.html`,
sort: `${ELASTICSEARCH_DOCS}sort-processor.html`,
split: `${ELASTICSEARCH_DOCS}split-processor.html`,
trim: `${ELASTICSEARCH_DOCS}trim-processor.html`,
uppercase: `${ELASTICSEARCH_DOCS}uppercase-processor.html`,
uriParts: `${ELASTICSEARCH_DOCS}uri-parts-processor.html`,
urlDecode: `${ELASTICSEARCH_DOCS}urldecode-processor.html`,
userAgent: `${ELASTICSEARCH_DOCS}user-agent-processor.html`,
},
fleet: {
guide: `${FLEET_DOCS}index.html`,
fleetServer: `${FLEET_DOCS}fleet-server.html`,
fleetServerAddFleetServer: `${FLEET_DOCS}add-a-fleet-server.html`,
settings: `${FLEET_DOCS}fleet-settings.html#fleet-server-hosts-setting`,
settingsFleetServerHostSettings: `${FLEET_DOCS}fleet-settings.html#fleet-server-hosts-setting`,
settingsFleetServerProxySettings: `${KIBANA_DOCS}fleet-settings-kb.html#fleet-data-visualizer-settings`,
troubleshooting: `${FLEET_DOCS}fleet-troubleshooting.html`,
elasticAgent: `${FLEET_DOCS}elastic-agent-installation.html`,
beatsAgentComparison: `${FLEET_DOCS}beats-agent-comparison.html`,
datastreams: `${FLEET_DOCS}data-streams.html`,
datastreamsNamingScheme: `${FLEET_DOCS}data-streams.html#data-streams-naming-scheme`,
installElasticAgent: `${FLEET_DOCS}install-fleet-managed-elastic-agent.html`,
installElasticAgentStandalone: `${FLEET_DOCS}install-standalone-elastic-agent.html`,
upgradeElasticAgent: `${FLEET_DOCS}upgrade-elastic-agent.html`,
upgradeElasticAgent712lower: `${FLEET_DOCS}upgrade-elastic-agent.html#upgrade-7.12-lower`,
learnMoreBlog: `${ELASTIC_WEBSITE_URL}blog/elastic-agent-and-fleet-make-it-easier-to-integrate-your-systems-with-elastic`,
apiKeysLearnMore: `${KIBANA_DOCS}api-keys.html`,
onPremRegistry: `${FLEET_DOCS}air-gapped.html`,
},
ecs: {
guide: `${ELASTIC_WEBSITE_URL}guide/en/ecs/current/index.html`,
},
clients: {
/** Changes to these URLs must also be synched in src/plugins/custom_integrations/server/language_clients/index.ts */
guide: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/index.html`,
goOverview: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/go-api/${DOC_LINK_VERSION}/overview.html`,
javaIndex: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/java-api-client/${DOC_LINK_VERSION}/index.html`,
jsIntro: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/javascript-api/${DOC_LINK_VERSION}/introduction.html`,
netGuide: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/net-api/${DOC_LINK_VERSION}/index.html`,
perlGuide: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/perl-api/${DOC_LINK_VERSION}/index.html`,
phpGuide: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/php-api/${DOC_LINK_VERSION}/index.html`,
pythonGuide: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/python-api/${DOC_LINK_VERSION}/index.html`,
rubyOverview: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/ruby-api/${DOC_LINK_VERSION}/ruby_client.html`,
rustGuide: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/rust-api/${DOC_LINK_VERSION}/index.html`,
},
endpoints: {
troubleshooting: `${ELASTIC_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/ts-management.html#ts-endpoints`,
},
});
};

View file

@ -0,0 +1,25 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { getDocLinksMeta } from './get_doc_meta';
describe('getDocLinksMeta', () => {
it('returns the correct version for the `main` branch', () => {
expect(getDocLinksMeta({ kibanaBranch: 'main' }).version).toEqual('master');
});
it('returns the correct version for other branches', () => {
expect(getDocLinksMeta({ kibanaBranch: '7.x' }).version).toEqual('7.x');
});
it('returns the correct website url', () => {
expect(getDocLinksMeta({ kibanaBranch: '7.x' }).elasticWebsiteUrl).toEqual(
'https://www.elastic.co/'
);
});
});

View file

@ -0,0 +1,20 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { DocLinksMeta } from './types';
export interface GetDocLinksMetaOptions {
kibanaBranch: string;
}
export const getDocLinksMeta = ({ kibanaBranch }: GetDocLinksMetaOptions): DocLinksMeta => {
return {
version: kibanaBranch === 'main' ? 'master' : kibanaBranch,
elasticWebsiteUrl: 'https://www.elastic.co/',
};
};

View file

@ -0,0 +1,11 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
export type { DocLinks, DocLinksMeta } from './types';
export { getDocLinks } from './get_doc_links';
export { getDocLinksMeta } from './get_doc_meta';

View file

@ -0,0 +1,365 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/**
* @public
*/
export interface DocLinksMeta {
version: string;
elasticWebsiteUrl: string;
}
/**
* @public
*/
export interface DocLinks {
readonly settings: string;
readonly elasticStackGetStarted: string;
readonly upgrade: {
readonly upgradingStackOnPrem: string;
readonly upgradingStackOnCloud: string;
};
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
readonly customLinks: string;
readonly droppedTransactionSpans: string;
readonly upgrading: string;
readonly metaData: string;
};
readonly canvas: {
readonly guide: string;
};
readonly cloud: {
readonly indexManagement: string;
};
readonly console: {
readonly guide: string;
};
readonly dashboard: {
readonly guide: string;
readonly drilldowns: string;
readonly drilldownsTriggerPicker: string;
readonly urlDrilldownTemplateSyntax: string;
readonly urlDrilldownVariables: string;
};
readonly discover: Record<string, string>;
readonly filebeat: {
readonly base: string;
readonly installation: string;
readonly configuration: string;
readonly elasticsearchOutput: string;
readonly elasticsearchModule: string;
readonly startup: string;
readonly exportedFields: string;
readonly suricataModule: string;
readonly zeekModule: string;
};
readonly auditbeat: {
readonly base: string;
readonly auditdModule: string;
readonly systemModule: string;
};
readonly metricbeat: {
readonly base: string;
readonly configure: string;
readonly httpEndpoint: string;
readonly install: string;
readonly start: string;
};
readonly appSearch: {
readonly apiRef: string;
readonly apiClients: string;
readonly apiKeys: string;
readonly authentication: string;
readonly crawlRules: string;
readonly curations: string;
readonly duplicateDocuments: string;
readonly entryPoints: string;
readonly guide: string;
readonly indexingDocuments: string;
readonly indexingDocumentsSchema: string;
readonly logSettings: string;
readonly metaEngines: string;
readonly precisionTuning: string;
readonly relevanceTuning: string;
readonly resultSettings: string;
readonly searchUI: string;
readonly security: string;
readonly synonyms: string;
readonly webCrawler: string;
readonly webCrawlerEventLogs: string;
};
readonly enterpriseSearch: {
readonly configuration: string;
readonly licenseManagement: string;
readonly mailService: string;
readonly usersAccess: string;
};
readonly workplaceSearch: {
readonly apiKeys: string;
readonly box: string;
readonly confluenceCloud: string;
readonly confluenceServer: string;
readonly customSources: string;
readonly customSourcePermissions: string;
readonly documentPermissions: string;
readonly dropbox: string;
readonly externalIdentities: string;
readonly gitHub: string;
readonly gettingStarted: string;
readonly gmail: string;
readonly googleDrive: string;
readonly indexingSchedule: string;
readonly jiraCloud: string;
readonly jiraServer: string;
readonly oneDrive: string;
readonly permissions: string;
readonly salesforce: string;
readonly security: string;
readonly serviceNow: string;
readonly sharePoint: string;
readonly slack: string;
readonly synch: string;
readonly zendesk: string;
};
readonly heartbeat: {
readonly base: string;
};
readonly libbeat: {
readonly getStarted: string;
};
readonly logstash: {
readonly base: string;
};
readonly functionbeat: {
readonly base: string;
};
readonly winlogbeat: {
readonly base: string;
};
readonly aggs: {
readonly composite: string;
readonly composite_missing_bucket: string;
readonly date_histogram: string;
readonly date_range: string;
readonly date_format_pattern: string;
readonly filter: string;
readonly filters: string;
readonly geohash_grid: string;
readonly histogram: string;
readonly ip_range: string;
readonly range: string;
readonly significant_terms: string;
readonly terms: string;
readonly terms_doc_count_error: string;
readonly rare_terms: string;
readonly avg: string;
readonly avg_bucket: string;
readonly max_bucket: string;
readonly min_bucket: string;
readonly sum_bucket: string;
readonly cardinality: string;
readonly count: string;
readonly cumulative_sum: string;
readonly derivative: string;
readonly geo_bounds: string;
readonly geo_centroid: string;
readonly max: string;
readonly median: string;
readonly min: string;
readonly moving_avg: string;
readonly percentile_ranks: string;
readonly serial_diff: string;
readonly std_dev: string;
readonly sum: string;
readonly top_hits: string;
};
readonly runtimeFields: {
readonly overview: string;
readonly mapping: string;
};
readonly scriptedFields: {
readonly scriptFields: string;
readonly scriptAggs: string;
readonly painless: string;
readonly painlessApi: string;
readonly painlessLangSpec: string;
readonly painlessSyntax: string;
readonly painlessWalkthrough: string;
readonly luceneExpressions: string;
};
readonly search: {
readonly sessions: string;
readonly sessionLimits: string;
};
readonly indexPatterns: {
readonly introduction: string;
readonly fieldFormattersNumber: string;
readonly fieldFormattersString: string;
readonly runtimeFields: string;
};
readonly addData: string;
readonly kibana: {
readonly guide: string;
readonly autocompleteSuggestions: string;
readonly xpackSecurity: string;
};
readonly upgradeAssistant: {
readonly overview: string;
readonly batchReindex: string;
readonly remoteReindex: string;
};
readonly rollupJobs: string;
readonly elasticsearch: Record<string, string>;
readonly siem: {
readonly privileges: string;
readonly guide: string;
readonly gettingStarted: string;
readonly ml: string;
readonly ruleChangeLog: string;
readonly detectionsReq: string;
readonly networkMap: string;
readonly troubleshootGaps: string;
};
readonly securitySolution: {
readonly trustedApps: string;
readonly eventFilters: string;
};
readonly query: {
readonly eql: string;
readonly kueryQuerySyntax: string;
readonly luceneQuery: string;
readonly luceneQuerySyntax: string;
readonly percolate: string;
readonly queryDsl: string;
};
readonly date: {
readonly dateMath: string;
readonly dateMathIndexNames: string;
};
readonly management: Record<string, string>;
readonly ml: Record<string, string>;
readonly transforms: Record<string, string>;
readonly visualize: Record<string, string>;
readonly apis: Readonly<{
bulkIndexAlias: string;
byteSizeUnits: string;
createAutoFollowPattern: string;
createFollower: string;
createIndex: string;
createSnapshotLifecyclePolicy: string;
createRoleMapping: string;
createRoleMappingTemplates: string;
createRollupJobsRequest: string;
createApiKey: string;
createPipeline: string;
createTransformRequest: string;
cronExpressions: string;
executeWatchActionModes: string;
indexExists: string;
multiSearch: string;
openIndex: string;
putComponentTemplate: string;
painlessExecute: string;
painlessExecuteAPIContexts: string;
putComponentTemplateMetadata: string;
putSnapshotLifecyclePolicy: string;
putIndexTemplateV1: string;
putWatch: string;
searchPreference: string;
simulatePipeline: string;
timeUnits: string;
unfreezeIndex: string;
updateTransform: string;
}>;
readonly observability: Readonly<{
guide: string;
infrastructureThreshold: string;
logsThreshold: string;
metricsThreshold: string;
monitorStatus: string;
monitorUptime: string;
tlsCertificate: string;
uptimeDurationAnomaly: string;
}>;
readonly alerting: Record<string, string>;
readonly maps: Readonly<{
guide: string;
importGeospatialPrivileges: string;
gdalTutorial: string;
}>;
readonly monitoring: Record<string, string>;
readonly security: Readonly<{
apiKeyServiceSettings: string;
clusterPrivileges: string;
elasticsearchSettings: string;
elasticsearchEnableSecurity: string;
elasticsearchEnableApiKeys: string;
indicesPrivileges: string;
kibanaTLS: string;
kibanaPrivileges: string;
mappingRoles: string;
mappingRolesFieldRules: string;
runAsPrivilege: string;
}>;
readonly spaces: Readonly<{
kibanaLegacyUrlAliases: string;
kibanaDisableLegacyUrlAliasesApi: string;
}>;
readonly watcher: Record<string, string>;
readonly ccs: Record<string, string>;
readonly plugins: {
azureRepo: string;
gcsRepo: string;
hdfsRepo: string;
s3Repo: string;
snapshotRestoreRepos: string;
mapperSize: string;
};
readonly snapshotRestore: Record<string, string>;
readonly ingest: Record<string, string>;
readonly fleet: Readonly<{
beatsAgentComparison: string;
guide: string;
fleetServer: string;
fleetServerAddFleetServer: string;
settings: string;
settingsFleetServerHostSettings: string;
settingsFleetServerProxySettings: string;
troubleshooting: string;
elasticAgent: string;
datastreams: string;
datastreamsNamingScheme: string;
installElasticAgent: string;
installElasticAgentStandalone: string;
upgradeElasticAgent: string;
upgradeElasticAgent712lower: string;
learnMoreBlog: string;
apiKeysLearnMore: string;
onPremRegistry: string;
}>;
readonly ecs: {
readonly guide: string;
};
readonly clients: {
readonly guide: string;
readonly goOverview: string;
readonly javaIndex: string;
readonly jsIntro: string;
readonly netGuide: string;
readonly perlGuide: string;
readonly phpGuide: string;
readonly pythonGuide: string;
readonly rubyOverview: string;
readonly rustGuide: string;
};
readonly endpoints: {
readonly troubleshooting: string;
};
}

View file

@ -0,0 +1,23 @@
{
"extends": "../../tsconfig.bazel.json",
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"outDir": "./target_types",
"rootDir": "src",
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-doc-links/src",
"stripInternal": false,
"types": [
"jest",
"node"
]
},
"include": [
"src/**/*.ts"
],
"exclude": [
"**/__fixtures__/**/*"
]
}

View file

@ -0,0 +1,15 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
export const getDocLinksMock = jest.fn();
export const getDocLinksMetaMock = jest.fn();
jest.doMock('@kbn/doc-links', () => ({
getDocLinks: getDocLinksMock,
getDocLinksMeta: getDocLinksMetaMock,
}));

View file

@ -6,18 +6,73 @@
* Side Public License, v 1.
*/
import { getDocLinksMock, getDocLinksMetaMock } from './doc_links_service.test.mocks';
import { DocLinksService } from './doc_links_service';
import { injectedMetadataServiceMock } from '../injected_metadata/injected_metadata_service.mock';
describe('DocLinksService#start()', () => {
it('templates the doc links with the branch information from injectedMetadata', () => {
const injectedMetadata = injectedMetadataServiceMock.createStartContract();
describe('DocLinksService', () => {
let injectedMetadata: ReturnType<typeof injectedMetadataServiceMock.createStartContract>;
let service: DocLinksService;
beforeEach(() => {
injectedMetadata = injectedMetadataServiceMock.createStartContract();
injectedMetadata.getKibanaBranch.mockReturnValue('test-branch');
const service = new DocLinksService();
const api = service.start({ injectedMetadata });
expect(api.DOC_LINK_VERSION).toEqual('test-branch');
expect(api.links.kibana.guide).toEqual(
'https://www.elastic.co/guide/en/kibana/test-branch/index.html'
);
getDocLinksMetaMock.mockReturnValue({
version: 'test-version',
elasticWebsiteUrl: 'http://elastic.test.url',
});
getDocLinksMock.mockReturnValue({
settings: 'http://settings.test.url',
});
service = new DocLinksService();
});
afterEach(() => {
getDocLinksMock.mockReset();
getDocLinksMetaMock.mockReset();
});
describe('#start', () => {
it('calls `getDocLinksMeta` with the correct parameters', () => {
expect(getDocLinksMetaMock).not.toHaveBeenCalled();
service.start({ injectedMetadata });
expect(getDocLinksMetaMock).toHaveBeenCalledTimes(1);
expect(getDocLinksMetaMock).toHaveBeenCalledWith({
kibanaBranch: 'test-branch',
});
});
it('return the values from `getDocLinksMeta`', () => {
const start = service.start({ injectedMetadata });
expect(start).toEqual({
DOC_LINK_VERSION: 'test-version',
ELASTIC_WEBSITE_URL: 'http://elastic.test.url',
links: expect.any(Object),
});
});
it('calls `getDocLinks` with the correct parameters', () => {
expect(getDocLinksMock).not.toHaveBeenCalled();
service.start({ injectedMetadata });
expect(getDocLinksMock).toHaveBeenCalledTimes(1);
expect(getDocLinksMock).toHaveBeenCalledWith({
kibanaBranch: 'test-branch',
});
});
it('return the values from `getDocLinks`', () => {
const start = service.start({ injectedMetadata });
expect(start.links).toEqual({
settings: 'http://settings.test.url',
});
});
});
});

View file

@ -6,7 +6,8 @@
* Side Public License, v 1.
*/
import { deepFreeze } from '@kbn/std';
import { getDocLinks, getDocLinksMeta } from '@kbn/doc-links';
import type { DocLinks } from '@kbn/doc-links';
import { InjectedMetadataSetup } from '../injected_metadata';
export interface StartDeps {
@ -19,589 +20,14 @@ export class DocLinksService {
public start({ injectedMetadata }: StartDeps): DocLinksStart {
const kibanaBranch = injectedMetadata.getKibanaBranch();
// Documentation for `main` branches is still published at a `master` URL.
const DOC_LINK_VERSION = kibanaBranch === 'main' ? 'master' : kibanaBranch;
const ELASTIC_WEBSITE_URL = 'https://www.elastic.co/';
const ELASTICSEARCH_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}/`;
const KIBANA_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/`;
const FLEET_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/fleet/${DOC_LINK_VERSION}/`;
const PLUGIN_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/plugins/${DOC_LINK_VERSION}/`;
const APM_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/apm/`;
const SECURITY_SOLUTION_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/`;
const STACK_GETTING_STARTED = `${ELASTIC_WEBSITE_URL}guide/en/elastic-stack-get-started/${DOC_LINK_VERSION}/`;
const APP_SEARCH_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/app-search/${DOC_LINK_VERSION}/`;
const ENTERPRISE_SEARCH_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/enterprise-search/${DOC_LINK_VERSION}/`;
const WORKPLACE_SEARCH_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/workplace-search/${DOC_LINK_VERSION}/`;
const docMeta = getDocLinksMeta({ kibanaBranch });
const docLinks = getDocLinks({ kibanaBranch });
return deepFreeze({
DOC_LINK_VERSION,
ELASTIC_WEBSITE_URL,
links: {
settings: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/settings.html`,
elasticStackGetStarted: `${STACK_GETTING_STARTED}get-started-elastic-stack.html`,
upgrade: {
upgradingStackOnPrem: `${ELASTIC_WEBSITE_URL}guide/en/elastic-stack/8.0/upgrading-elastic-stack-on-prem.html`,
upgradingStackOnCloud: `${ELASTIC_WEBSITE_URL}guide/en/elastic-stack/8.0/upgrade-elastic-stack-for-elastic-cloud.html`,
},
apm: {
kibanaSettings: `${KIBANA_DOCS}apm-settings-in-kibana.html`,
supportedServiceMaps: `${KIBANA_DOCS}service-maps.html#service-maps-supported`,
customLinks: `${KIBANA_DOCS}custom-links.html`,
droppedTransactionSpans: `${APM_DOCS}guide/${DOC_LINK_VERSION}/data-model-spans.html#data-model-dropped-spans`,
upgrading: `${APM_DOCS}guide/${DOC_LINK_VERSION}/upgrade.html`,
metaData: `${APM_DOCS}guide/${DOC_LINK_VERSION}/data-model-metadata.html`,
},
canvas: {
guide: `${KIBANA_DOCS}canvas.html`,
},
cloud: {
indexManagement: `${ELASTIC_WEBSITE_URL}/guide/en/cloud/current/ec-configure-index-management.html`,
},
console: {
guide: `${KIBANA_DOCS}console-kibana.html`,
},
dashboard: {
guide: `${KIBANA_DOCS}dashboard.html`,
drilldowns: `${KIBANA_DOCS}drilldowns.html`,
drilldownsTriggerPicker: `${KIBANA_DOCS}drilldowns.html#url-drilldowns`,
urlDrilldownTemplateSyntax: `${KIBANA_DOCS}url_templating-language.html`,
urlDrilldownVariables: `${KIBANA_DOCS}url_templating-language.html#url-template-variables`,
},
discover: {
guide: `${KIBANA_DOCS}discover.html`,
},
filebeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}`,
installation: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/filebeat-installation-configuration.html`,
configuration: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/configuring-howto-filebeat.html`,
elasticsearchModule: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/filebeat-module-elasticsearch.html`,
elasticsearchOutput: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/elasticsearch-output.html`,
startup: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/filebeat-starting.html`,
exportedFields: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/exported-fields.html`,
suricataModule: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/filebeat-module-suricata.html`,
zeekModule: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/filebeat-module-zeek.html`,
},
auditbeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/auditbeat/${DOC_LINK_VERSION}`,
auditdModule: `${ELASTIC_WEBSITE_URL}guide/en/beats/auditbeat/${DOC_LINK_VERSION}/auditbeat-module-auditd.html`,
systemModule: `${ELASTIC_WEBSITE_URL}guide/en/beats/auditbeat/${DOC_LINK_VERSION}/auditbeat-module-system.html`,
},
appSearch: {
apiRef: `${APP_SEARCH_DOCS}api-reference.html`,
apiClients: `${APP_SEARCH_DOCS}api-clients.html`,
apiKeys: `${APP_SEARCH_DOCS}authentication.html#authentication-api-keys`,
authentication: `${APP_SEARCH_DOCS}authentication.html`,
crawlRules: `${APP_SEARCH_DOCS}crawl-web-content.html#crawl-web-content-manage-crawl-rules`,
curations: `${APP_SEARCH_DOCS}curations-guide.html`,
duplicateDocuments: `${APP_SEARCH_DOCS}web-crawler-reference.html#web-crawler-reference-content-deduplication`,
entryPoints: `${APP_SEARCH_DOCS}crawl-web-content.html#crawl-web-content-manage-entry-points`,
guide: `${APP_SEARCH_DOCS}index.html`,
indexingDocuments: `${APP_SEARCH_DOCS}indexing-documents-guide.html`,
indexingDocumentsSchema: `${APP_SEARCH_DOCS}indexing-documents-guide.html#indexing-documents-guide-schema`,
logSettings: `${APP_SEARCH_DOCS}logs.html`,
metaEngines: `${APP_SEARCH_DOCS}meta-engines-guide.html`,
precisionTuning: `${APP_SEARCH_DOCS}precision-tuning.html`,
relevanceTuning: `${APP_SEARCH_DOCS}relevance-tuning-guide.html`,
resultSettings: `${APP_SEARCH_DOCS}result-settings-guide.html`,
searchUI: `${APP_SEARCH_DOCS}reference-ui-guide.html`,
security: `${APP_SEARCH_DOCS}security-and-users.html`,
synonyms: `${APP_SEARCH_DOCS}synonyms-guide.html`,
webCrawler: `${APP_SEARCH_DOCS}web-crawler.html`,
webCrawlerEventLogs: `${APP_SEARCH_DOCS}view-web-crawler-events-logs.html`,
},
enterpriseSearch: {
configuration: `${ENTERPRISE_SEARCH_DOCS}configuration.html`,
licenseManagement: `${ENTERPRISE_SEARCH_DOCS}license-management.html`,
mailService: `${ENTERPRISE_SEARCH_DOCS}mailer-configuration.html`,
usersAccess: `${ENTERPRISE_SEARCH_DOCS}users-access.html`,
},
workplaceSearch: {
apiKeys: `${WORKPLACE_SEARCH_DOCS}workplace-search-api-authentication.html`,
box: `${WORKPLACE_SEARCH_DOCS}workplace-search-box-connector.html`,
confluenceCloud: `${WORKPLACE_SEARCH_DOCS}workplace-search-confluence-cloud-connector.html`,
confluenceServer: `${WORKPLACE_SEARCH_DOCS}workplace-search-confluence-server-connector.html`,
customSources: `${WORKPLACE_SEARCH_DOCS}workplace-search-custom-api-sources.html`,
customSourcePermissions: `${WORKPLACE_SEARCH_DOCS}workplace-search-custom-api-sources.html#custom-api-source-document-level-access-control`,
documentPermissions: `${WORKPLACE_SEARCH_DOCS}workplace-search-sources-document-permissions.html`,
dropbox: `${WORKPLACE_SEARCH_DOCS}workplace-search-dropbox-connector.html`,
externalIdentities: `${WORKPLACE_SEARCH_DOCS}workplace-search-external-identities-api.html`,
gettingStarted: `${WORKPLACE_SEARCH_DOCS}workplace-search-getting-started.html`,
gitHub: `${WORKPLACE_SEARCH_DOCS}workplace-search-github-connector.html`,
gmail: `${WORKPLACE_SEARCH_DOCS}workplace-search-gmail-connector.html`,
googleDrive: `${WORKPLACE_SEARCH_DOCS}workplace-search-google-drive-connector.html`,
indexingSchedule: `${WORKPLACE_SEARCH_DOCS}workplace-search-customizing-indexing-rules.html#_indexing_schedule`,
jiraCloud: `${WORKPLACE_SEARCH_DOCS}workplace-search-jira-cloud-connector.html`,
jiraServer: `${WORKPLACE_SEARCH_DOCS}workplace-search-jira-server-connector.html`,
oneDrive: `${WORKPLACE_SEARCH_DOCS}workplace-search-onedrive-connector.html`,
permissions: `${WORKPLACE_SEARCH_DOCS}workplace-search-permissions.html#organizational-sources-private-sources`,
salesforce: `${WORKPLACE_SEARCH_DOCS}workplace-search-salesforce-connector.html`,
security: `${WORKPLACE_SEARCH_DOCS}workplace-search-security.html`,
serviceNow: `${WORKPLACE_SEARCH_DOCS}workplace-search-servicenow-connector.html`,
sharePoint: `${WORKPLACE_SEARCH_DOCS}workplace-search-sharepoint-online-connector.html`,
slack: `${WORKPLACE_SEARCH_DOCS}workplace-search-slack-connector.html`,
synch: `${WORKPLACE_SEARCH_DOCS}workplace-search-customizing-indexing-rules.html`,
zendesk: `${WORKPLACE_SEARCH_DOCS}workplace-search-zendesk-connector.html`,
},
metricbeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/metricbeat/${DOC_LINK_VERSION}`,
configure: `${ELASTIC_WEBSITE_URL}guide/en/beats/metricbeat/${DOC_LINK_VERSION}/configuring-howto-metricbeat.html`,
httpEndpoint: `${ELASTIC_WEBSITE_URL}guide/en/beats/metricbeat/${DOC_LINK_VERSION}/http-endpoint.html`,
install: `${ELASTIC_WEBSITE_URL}guide/en/beats/metricbeat/${DOC_LINK_VERSION}/metricbeat-installation-configuration.html`,
start: `${ELASTIC_WEBSITE_URL}guide/en/beats/metricbeat/${DOC_LINK_VERSION}/metricbeat-starting.html`,
},
heartbeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/heartbeat/${DOC_LINK_VERSION}`,
},
libbeat: {
getStarted: `${ELASTIC_WEBSITE_URL}guide/en/beats/libbeat/${DOC_LINK_VERSION}/getting-started.html`,
},
logstash: {
base: `${ELASTIC_WEBSITE_URL}guide/en/logstash/${DOC_LINK_VERSION}`,
},
functionbeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/functionbeat/${DOC_LINK_VERSION}`,
},
winlogbeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/winlogbeat/${DOC_LINK_VERSION}`,
},
aggs: {
composite: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-composite-aggregation.html`,
composite_missing_bucket: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-composite-aggregation.html#_missing_bucket`,
date_histogram: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-datehistogram-aggregation.html`,
date_range: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-daterange-aggregation.html`,
date_format_pattern: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-daterange-aggregation.html#date-format-pattern`,
filter: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-filter-aggregation.html`,
filters: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-filters-aggregation.html`,
geohash_grid: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-geohashgrid-aggregation.html`,
histogram: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-histogram-aggregation.html`,
ip_range: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-iprange-aggregation.html`,
range: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-range-aggregation.html`,
significant_terms: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-significantterms-aggregation.html`,
terms: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-terms-aggregation.html`,
terms_doc_count_error: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-terms-aggregation.html#_per_bucket_document_count_error`,
rare_terms: `${ELASTICSEARCH_DOCS}search-aggregations-bucket-rare-terms-aggregation.html`,
avg: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-avg-aggregation.html`,
avg_bucket: `${ELASTICSEARCH_DOCS}search-aggregations-pipeline-avg-bucket-aggregation.html`,
max_bucket: `${ELASTICSEARCH_DOCS}search-aggregations-pipeline-max-bucket-aggregation.html`,
min_bucket: `${ELASTICSEARCH_DOCS}search-aggregations-pipeline-min-bucket-aggregation.html`,
sum_bucket: `${ELASTICSEARCH_DOCS}search-aggregations-pipeline-sum-bucket-aggregation.html`,
cardinality: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-cardinality-aggregation.html`,
count: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-valuecount-aggregation.html`,
cumulative_sum: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-sum-aggregation.html`,
derivative: `${ELASTICSEARCH_DOCS}search-aggregations-pipeline-derivative-aggregation.html`,
geo_bounds: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-geobounds-aggregation.html`,
geo_centroid: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-geocentroid-aggregation.html`,
max: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-max-aggregation.html`,
median: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-percentile-aggregation.html`,
min: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-min-aggregation.html`,
moving_avg: `${ELASTICSEARCH_DOCS}search-aggregations-pipeline-movfn-aggregation.html`,
percentile_ranks: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-percentile-rank-aggregation.html`,
serial_diff: `${ELASTICSEARCH_DOCS}search-aggregations-pipeline-serialdiff-aggregation.html`,
std_dev: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-extendedstats-aggregation.html`,
sum: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-sum-aggregation.html`,
top_hits: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-top-hits-aggregation.html`,
},
runtimeFields: {
overview: `${ELASTICSEARCH_DOCS}runtime.html`,
mapping: `${ELASTICSEARCH_DOCS}runtime-mapping-fields.html`,
},
scriptedFields: {
scriptFields: `${ELASTICSEARCH_DOCS}search-request-script-fields.html`,
scriptAggs: `${ELASTICSEARCH_DOCS}search-aggregations.html`,
painless: `${ELASTICSEARCH_DOCS}modules-scripting-painless.html`,
painlessApi: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/painless/${DOC_LINK_VERSION}/painless-api-reference.html`,
painlessLangSpec: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/painless/${DOC_LINK_VERSION}/painless-lang-spec.html`,
painlessSyntax: `${ELASTICSEARCH_DOCS}modules-scripting-painless-syntax.html`,
painlessWalkthrough: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/painless/${DOC_LINK_VERSION}/painless-walkthrough.html`,
painlessLanguage: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/painless/${DOC_LINK_VERSION}/painless-lang-spec.html`,
luceneExpressions: `${ELASTICSEARCH_DOCS}modules-scripting-expression.html`,
},
indexPatterns: {
introduction: `${KIBANA_DOCS}data-views.html`,
fieldFormattersNumber: `${KIBANA_DOCS}numeral.html`,
fieldFormattersString: `${KIBANA_DOCS}field-formatters-string.html`,
runtimeFields: `${KIBANA_DOCS}managing-data-views.html#runtime-fields`,
},
addData: `${KIBANA_DOCS}connect-to-elasticsearch.html`,
kibana: {
guide: `${KIBANA_DOCS}index.html`,
autocompleteSuggestions: `${KIBANA_DOCS}kibana-concepts-analysts.html#autocomplete-suggestions`,
xpackSecurity: `${KIBANA_DOCS}xpack-security.html`,
},
upgradeAssistant: {
overview: `${KIBANA_DOCS}upgrade-assistant.html`,
batchReindex: `${KIBANA_DOCS}batch-start-resume-reindex.html`,
remoteReindex: `${ELASTICSEARCH_DOCS}docs-reindex.html#reindex-from-remote`,
},
rollupJobs: `${KIBANA_DOCS}data-rollups.html`,
elasticsearch: {
docsBase: `${ELASTICSEARCH_DOCS}`,
asyncSearch: `${ELASTICSEARCH_DOCS}async-search-intro.html`,
dataStreams: `${ELASTICSEARCH_DOCS}data-streams.html`,
deprecationLogging: `${ELASTICSEARCH_DOCS}logging.html#deprecation-logging`,
hiddenIndices: `${ELASTICSEARCH_DOCS}multi-index.html#hidden`,
ilm: `${ELASTICSEARCH_DOCS}index-lifecycle-management.html`,
ilmForceMerge: `${ELASTICSEARCH_DOCS}ilm-forcemerge.html`,
ilmFreeze: `${ELASTICSEARCH_DOCS}ilm-freeze.html`,
ilmPhaseTransitions: `${ELASTICSEARCH_DOCS}ilm-index-lifecycle.html#ilm-phase-transitions`,
ilmReadOnly: `${ELASTICSEARCH_DOCS}ilm-readonly.html`,
ilmRollover: `${ELASTICSEARCH_DOCS}ilm-rollover.html`,
ilmSearchableSnapshot: `${ELASTICSEARCH_DOCS}ilm-searchable-snapshot.html`,
ilmSetPriority: `${ELASTICSEARCH_DOCS}ilm-set-priority.html`,
ilmShrink: `${ELASTICSEARCH_DOCS}ilm-shrink.html`,
ilmWaitForSnapshot: `${ELASTICSEARCH_DOCS}ilm-wait-for-snapshot.html`,
indexModules: `${ELASTICSEARCH_DOCS}index-modules.html`,
indexSettings: `${ELASTICSEARCH_DOCS}index-modules.html#index-modules-settings`,
dynamicIndexSettings: `${ELASTICSEARCH_DOCS}index-modules.html#dynamic-index-settings`,
indexTemplates: `${ELASTICSEARCH_DOCS}index-templates.html`,
mapping: `${ELASTICSEARCH_DOCS}mapping.html`,
mappingAnalyzer: `${ELASTICSEARCH_DOCS}analyzer.html`,
mappingCoerce: `${ELASTICSEARCH_DOCS}coerce.html`,
mappingCopyTo: `${ELASTICSEARCH_DOCS}copy-to.html`,
mappingDocValues: `${ELASTICSEARCH_DOCS}doc-values.html`,
mappingDynamic: `${ELASTICSEARCH_DOCS}dynamic.html`,
mappingDynamicFields: `${ELASTICSEARCH_DOCS}dynamic-field-mapping.html`,
mappingDynamicTemplates: `${ELASTICSEARCH_DOCS}dynamic-templates.html`,
mappingEagerGlobalOrdinals: `${ELASTICSEARCH_DOCS}eager-global-ordinals.html`,
mappingEnabled: `${ELASTICSEARCH_DOCS}enabled.html`,
mappingFieldData: `${ELASTICSEARCH_DOCS}text.html#fielddata-mapping-param`,
mappingFieldDataEnable: `${ELASTICSEARCH_DOCS}text.html#before-enabling-fielddata`,
mappingFieldDataFilter: `${ELASTICSEARCH_DOCS}text.html#field-data-filtering`,
mappingFieldDataTypes: `${ELASTICSEARCH_DOCS}mapping-types.html`,
mappingFormat: `${ELASTICSEARCH_DOCS}mapping-date-format.html`,
mappingIgnoreAbove: `${ELASTICSEARCH_DOCS}ignore-above.html`,
mappingIgnoreMalformed: `${ELASTICSEARCH_DOCS}ignore-malformed.html`,
mappingIndex: `${ELASTICSEARCH_DOCS}mapping-index.html`,
mappingIndexOptions: `${ELASTICSEARCH_DOCS}index-options.html`,
mappingIndexPhrases: `${ELASTICSEARCH_DOCS}index-phrases.html`,
mappingIndexPrefixes: `${ELASTICSEARCH_DOCS}index-prefixes.html`,
mappingJoinFieldsPerformance: `${ELASTICSEARCH_DOCS}parent-join.html#_parent_join_and_performance`,
mappingMeta: `${ELASTICSEARCH_DOCS}mapping-field-meta.html`,
mappingMetaFields: `${ELASTICSEARCH_DOCS}mapping-meta-field.html`,
mappingMultifields: `${ELASTICSEARCH_DOCS}multi-fields.html`,
mappingNormalizer: `${ELASTICSEARCH_DOCS}normalizer.html`,
mappingNorms: `${ELASTICSEARCH_DOCS}norms.html`,
mappingNullValue: `${ELASTICSEARCH_DOCS}null-value.html`,
mappingParameters: `${ELASTICSEARCH_DOCS}mapping-params.html`,
mappingPositionIncrementGap: `${ELASTICSEARCH_DOCS}position-increment-gap.html`,
mappingRankFeatureFields: `${ELASTICSEARCH_DOCS}rank-feature.html`,
mappingRouting: `${ELASTICSEARCH_DOCS}mapping-routing-field.html`,
mappingSimilarity: `${ELASTICSEARCH_DOCS}similarity.html`,
mappingSourceFields: `${ELASTICSEARCH_DOCS}mapping-source-field.html`,
mappingSourceFieldsDisable: `${ELASTICSEARCH_DOCS}mapping-source-field.html#disable-source-field`,
mappingStore: `${ELASTICSEARCH_DOCS}mapping-store.html`,
mappingTermVector: `${ELASTICSEARCH_DOCS}term-vector.html`,
mappingTypesRemoval: `${ELASTICSEARCH_DOCS}removal-of-types.html`,
migrateIndexAllocationFilters: `${ELASTICSEARCH_DOCS}migrate-index-allocation-filters.html`,
migrationApiDeprecation: `${ELASTICSEARCH_DOCS}migration-api-deprecation.html`,
nodeRoles: `${ELASTICSEARCH_DOCS}modules-node.html#node-roles`,
releaseHighlights: `${ELASTICSEARCH_DOCS}release-highlights.html`,
version8ReleaseHighlights: `${ELASTIC_WEBSITE_URL}guide/en/elastic-stack/8.0/elastic-stack-highlights.html`,
remoteClusters: `${ELASTICSEARCH_DOCS}remote-clusters.html`,
remoteClustersProxy: `${ELASTICSEARCH_DOCS}remote-clusters.html#proxy-mode`,
remoteClusersProxySettings: `${ELASTICSEARCH_DOCS}remote-clusters-settings.html#remote-cluster-proxy-settings`,
scriptParameters: `${ELASTICSEARCH_DOCS}modules-scripting-using.html#prefer-params`,
shardAllocationSettings: `${ELASTICSEARCH_DOCS}modules-cluster.html#cluster-shard-allocation-settings`,
sortSearch: `${ELASTICSEARCH_DOCS}sort-search-results.html`,
transportSettings: `${ELASTICSEARCH_DOCS}modules-network.html#common-network-settings`,
typesRemoval: `${ELASTICSEARCH_DOCS}removal-of-types.html`,
setupUpgrade: `${ELASTICSEARCH_DOCS}setup-upgrade.html`,
apiCompatibilityHeader: `${ELASTICSEARCH_DOCS}api-conventions.html#api-compatibility`,
},
siem: {
guide: `${SECURITY_SOLUTION_DOCS}index.html`,
gettingStarted: `${SECURITY_SOLUTION_DOCS}index.html`,
privileges: `${SECURITY_SOLUTION_DOCS}sec-requirements.html`,
ml: `${SECURITY_SOLUTION_DOCS}machine-learning.html`,
ruleChangeLog: `${SECURITY_SOLUTION_DOCS}prebuilt-rules-changelog.html`,
detectionsReq: `${SECURITY_SOLUTION_DOCS}detections-permissions-section.html`,
networkMap: `${SECURITY_SOLUTION_DOCS}conf-map-ui.html`,
troubleshootGaps: `${SECURITY_SOLUTION_DOCS}alerts-ui-monitor.html#troubleshoot-gaps`,
},
securitySolution: {
trustedApps: `${ELASTIC_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/trusted-apps-ov.html`,
eventFilters: `${ELASTIC_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/event-filters.html`,
},
query: {
eql: `${ELASTICSEARCH_DOCS}eql.html`,
kueryQuerySyntax: `${KIBANA_DOCS}kuery-query.html`,
luceneQuery: `${ELASTICSEARCH_DOCS}query-dsl-query-string-query.html`,
luceneQuerySyntax: `${ELASTICSEARCH_DOCS}query-dsl-query-string-query.html#query-string-syntax`,
percolate: `${ELASTICSEARCH_DOCS}query-dsl-percolate-query.html`,
queryDsl: `${ELASTICSEARCH_DOCS}query-dsl.html`,
},
search: {
sessions: `${KIBANA_DOCS}search-sessions.html`,
sessionLimits: `${KIBANA_DOCS}search-sessions.html#_limitations`,
},
date: {
dateMath: `${ELASTICSEARCH_DOCS}common-options.html#date-math`,
dateMathIndexNames: `${ELASTICSEARCH_DOCS}date-math-index-names.html`,
},
management: {
dashboardSettings: `${KIBANA_DOCS}advanced-options.html#kibana-dashboard-settings`,
indexManagement: `${ELASTICSEARCH_DOCS}index-mgmt.html`,
kibanaSearchSettings: `${KIBANA_DOCS}advanced-options.html#kibana-search-settings`,
visualizationSettings: `${KIBANA_DOCS}advanced-options.html#kibana-visualization-settings`,
timelionSettings: `${KIBANA_DOCS}advanced-options.html#kibana-timelion-settings`,
savedObjectsApiList: `${KIBANA_DOCS}saved-objects-api.html#saved-objects-api`,
},
ml: {
guide: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/index.html`,
aggregations: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-configuring-aggregation.html`,
anomalyDetection: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-ad-overview.html`,
anomalyDetectionJobs: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-ad-finding-anomalies.html`,
anomalyDetectionConfiguringCategories: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-configuring-categories.html`,
anomalyDetectionBucketSpan: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-ad-run-jobs.html#ml-ad-bucket-span`,
anomalyDetectionCardinality: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-ad-run-jobs.html#ml-ad-cardinality`,
anomalyDetectionCreateJobs: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-ad-run-jobs.html#ml-ad-create-job`,
anomalyDetectionDetectors: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-ad-run-jobs.html#ml-ad-detectors`,
anomalyDetectionInfluencers: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-ad-run-jobs.html#ml-ad-influencers`,
anomalyDetectionJobResource: `${ELASTICSEARCH_DOCS}ml-put-job.html#ml-put-job-path-parms`,
anomalyDetectionJobResourceAnalysisConfig: `${ELASTICSEARCH_DOCS}ml-put-job.html#put-analysisconfig`,
anomalyDetectionJobTips: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-ad-run-jobs.html#ml-ad-job-tips`,
alertingRules: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-configuring-alerts.html`,
anomalyDetectionModelMemoryLimits: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-ad-run-jobs.html#ml-ad-model-memory-limits`,
calendars: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-ad-run-jobs.html#ml-ad-calendars`,
classificationEvaluation: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-dfa-classification.html#ml-dfanalytics-classification-evaluation`,
customRules: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-ad-run-jobs.html#ml-ad-rules`,
customUrls: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-configuring-url.html`,
dataFrameAnalytics: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-dfanalytics.html`,
featureImportance: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-feature-importance.html`,
outlierDetectionRoc: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-dfa-finding-outliers.html#ml-dfanalytics-roc`,
regressionEvaluation: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-dfa-regression.html#ml-dfanalytics-regression-evaluation`,
classificationAucRoc: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-dfa-classification.html#ml-dfanalytics-class-aucroc`,
setUpgradeMode: `${ELASTICSEARCH_DOCS}ml-set-upgrade-mode.html`,
},
transforms: {
guide: `${ELASTICSEARCH_DOCS}transforms.html`,
// TODO add valid docs URL
alertingRules: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-configuring-alerts.html`,
},
visualize: {
guide: `${KIBANA_DOCS}dashboard.html`,
lens: `${ELASTIC_WEBSITE_URL}what-is/kibana-lens`,
lensPanels: `${KIBANA_DOCS}lens.html`,
maps: `${ELASTIC_WEBSITE_URL}maps`,
vega: `${KIBANA_DOCS}vega.html`,
tsvbIndexPatternMode: `${KIBANA_DOCS}tsvb.html#tsvb-index-pattern-mode`,
},
observability: {
guide: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/index.html`,
infrastructureThreshold: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/infrastructure-threshold-alert.html`,
logsThreshold: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/logs-threshold-alert.html`,
metricsThreshold: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/metrics-threshold-alert.html`,
monitorStatus: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/monitor-status-alert.html`,
monitorUptime: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/monitor-uptime.html`,
tlsCertificate: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/tls-certificate-alert.html`,
uptimeDurationAnomaly: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/duration-anomaly-alert.html`,
},
alerting: {
guide: `${KIBANA_DOCS}create-and-manage-rules.html`,
actionTypes: `${KIBANA_DOCS}action-types.html`,
apmRules: `${KIBANA_DOCS}apm-alerts.html`,
emailAction: `${KIBANA_DOCS}email-action-type.html`,
emailActionConfig: `${KIBANA_DOCS}email-action-type.html`,
emailExchangeClientSecretConfig: `${KIBANA_DOCS}email-action-type.html#exchange-client-secret`,
emailExchangeClientIdConfig: `${KIBANA_DOCS}email-action-type.html#exchange-client-tenant-id`,
generalSettings: `${KIBANA_DOCS}alert-action-settings-kb.html#general-alert-action-settings`,
indexAction: `${KIBANA_DOCS}index-action-type.html`,
esQuery: `${KIBANA_DOCS}rule-type-es-query.html`,
indexThreshold: `${KIBANA_DOCS}rule-type-index-threshold.html`,
pagerDutyAction: `${KIBANA_DOCS}pagerduty-action-type.html`,
preconfiguredConnectors: `${KIBANA_DOCS}pre-configured-connectors.html`,
preconfiguredAlertHistoryConnector: `${KIBANA_DOCS}index-action-type.html#preconfigured-connector-alert-history`,
serviceNowAction: `${KIBANA_DOCS}servicenow-action-type.html#configuring-servicenow`,
serviceNowSIRAction: `${KIBANA_DOCS}servicenow-sir-action-type.html`,
setupPrerequisites: `${KIBANA_DOCS}alerting-setup.html#alerting-prerequisites`,
slackAction: `${KIBANA_DOCS}slack-action-type.html#configuring-slack`,
teamsAction: `${KIBANA_DOCS}teams-action-type.html#configuring-teams`,
},
maps: {
guide: `${KIBANA_DOCS}maps.html`,
importGeospatialPrivileges: `${KIBANA_DOCS}import-geospatial-data.html#import-geospatial-privileges`,
gdalTutorial: `${ELASTIC_WEBSITE_URL}blog/how-to-ingest-geospatial-data-into-elasticsearch-with-gdal`,
},
monitoring: {
alertsKibana: `${KIBANA_DOCS}kibana-alerts.html`,
alertsKibanaCpuThreshold: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-cpu-threshold`,
alertsKibanaDiskThreshold: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-disk-usage-threshold`,
alertsKibanaJvmThreshold: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-jvm-memory-threshold`,
alertsKibanaMissingData: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-missing-monitoring-data`,
alertsKibanaThreadpoolRejections: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-thread-pool-rejections`,
alertsKibanaCCRReadExceptions: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-ccr-read-exceptions`,
alertsKibanaLargeShardSize: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-large-shard-size`,
alertsKibanaClusterAlerts: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-cluster-alerts`,
metricbeatBlog: `${ELASTIC_WEBSITE_URL}blog/external-collection-for-elastic-stack-monitoring-is-now-available-via-metricbeat`,
monitorElasticsearch: `${ELASTICSEARCH_DOCS}configuring-metricbeat.html`,
monitorKibana: `${KIBANA_DOCS}monitoring-metricbeat.html`,
monitorLogstash: `${ELASTIC_WEBSITE_URL}guide/en/logstash/${DOC_LINK_VERSION}/monitoring-with-metricbeat.html`,
troubleshootKibana: `${KIBANA_DOCS}monitor-troubleshooting.html`,
},
security: {
apiKeyServiceSettings: `${ELASTICSEARCH_DOCS}security-settings.html#api-key-service-settings`,
clusterPrivileges: `${ELASTICSEARCH_DOCS}security-privileges.html#privileges-list-cluster`,
elasticsearchSettings: `${ELASTICSEARCH_DOCS}security-settings.html`,
elasticsearchEnableSecurity: `${ELASTICSEARCH_DOCS}configuring-stack-security.html`,
elasticsearchEnableApiKeys: `${ELASTICSEARCH_DOCS}security-settings.html#api-key-service-settings`,
indicesPrivileges: `${ELASTICSEARCH_DOCS}security-privileges.html#privileges-list-indices`,
kibanaTLS: `${ELASTICSEARCH_DOCS}security-basic-setup.html#encrypt-internode-communication`,
kibanaPrivileges: `${KIBANA_DOCS}kibana-privileges.html`,
mappingRoles: `${ELASTICSEARCH_DOCS}mapping-roles.html`,
mappingRolesFieldRules: `${ELASTICSEARCH_DOCS}role-mapping-resources.html#mapping-roles-rule-field`,
runAsPrivilege: `${ELASTICSEARCH_DOCS}security-privileges.html#_run_as_privilege`,
},
spaces: {
kibanaLegacyUrlAliases: `${KIBANA_DOCS}legacy-url-aliases.html`,
kibanaDisableLegacyUrlAliasesApi: `${KIBANA_DOCS}spaces-api-disable-legacy-url-aliases.html`,
},
watcher: {
jiraAction: `${ELASTICSEARCH_DOCS}actions-jira.html`,
pagerDutyAction: `${ELASTICSEARCH_DOCS}actions-pagerduty.html`,
slackAction: `${ELASTICSEARCH_DOCS}actions-slack.html`,
ui: `${KIBANA_DOCS}watcher-ui.html`,
},
ccs: {
guide: `${ELASTICSEARCH_DOCS}modules-cross-cluster-search.html`,
skippingDisconnectedClusters: `${ELASTICSEARCH_DOCS}modules-cross-cluster-search.html#skip-unavailable-clusters`,
},
apis: {
bulkIndexAlias: `${ELASTICSEARCH_DOCS}indices-aliases.html`,
byteSizeUnits: `${ELASTICSEARCH_DOCS}api-conventions.html#byte-units`,
createAutoFollowPattern: `${ELASTICSEARCH_DOCS}ccr-put-auto-follow-pattern.html`,
createFollower: `${ELASTICSEARCH_DOCS}ccr-put-follow.html`,
createIndex: `${ELASTICSEARCH_DOCS}indices-create-index.html`,
createSnapshotLifecyclePolicy: `${ELASTICSEARCH_DOCS}slm-api-put-policy.html`,
createRoleMapping: `${ELASTICSEARCH_DOCS}security-api-put-role-mapping.html`,
createRoleMappingTemplates: `${ELASTICSEARCH_DOCS}security-api-put-role-mapping.html#_role_templates`,
createRollupJobsRequest: `${ELASTICSEARCH_DOCS}rollup-put-job.html#rollup-put-job-api-request-body`,
createApiKey: `${ELASTICSEARCH_DOCS}security-api-create-api-key.html`,
createPipeline: `${ELASTICSEARCH_DOCS}put-pipeline-api.html`,
createTransformRequest: `${ELASTICSEARCH_DOCS}put-transform.html#put-transform-request-body`,
cronExpressions: `${ELASTICSEARCH_DOCS}cron-expressions.html`,
executeWatchActionModes: `${ELASTICSEARCH_DOCS}watcher-api-execute-watch.html#watcher-api-execute-watch-action-mode`,
indexExists: `${ELASTICSEARCH_DOCS}indices-exists.html`,
multiSearch: `${ELASTICSEARCH_DOCS}search-multi-search.html`,
openIndex: `${ELASTICSEARCH_DOCS}indices-open-close.html`,
putComponentTemplate: `${ELASTICSEARCH_DOCS}indices-component-template.html`,
painlessExecute: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/painless/${DOC_LINK_VERSION}/painless-execute-api.html`,
painlessExecuteAPIContexts: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/painless/${DOC_LINK_VERSION}/painless-execute-api.html#_contexts`,
putComponentTemplateMetadata: `${ELASTICSEARCH_DOCS}indices-component-template.html#component-templates-metadata`,
putEnrichPolicy: `${ELASTICSEARCH_DOCS}put-enrich-policy-api.html`,
putIndexTemplateV1: `${ELASTICSEARCH_DOCS}indices-templates-v1.html`,
putSnapshotLifecyclePolicy: `${ELASTICSEARCH_DOCS}slm-api-put-policy.html`,
putWatch: `${ELASTICSEARCH_DOCS}watcher-api-put-watch.html`,
searchPreference: `${ELASTICSEARCH_DOCS}search-search.html#search-preference`,
simulatePipeline: `${ELASTICSEARCH_DOCS}simulate-pipeline-api.html`,
timeUnits: `${ELASTICSEARCH_DOCS}api-conventions.html#time-units`,
unfreezeIndex: `${ELASTICSEARCH_DOCS}unfreeze-index-api.html`,
updateTransform: `${ELASTICSEARCH_DOCS}update-transform.html`,
},
plugins: {
azureRepo: `${ELASTICSEARCH_DOCS}repository-azure.html`,
gcsRepo: `${ELASTICSEARCH_DOCS}repository-gcs.html`,
hdfsRepo: `${PLUGIN_DOCS}repository-hdfs.html`,
s3Repo: `${ELASTICSEARCH_DOCS}repository-s3.html`,
snapshotRestoreRepos: `${ELASTICSEARCH_DOCS}snapshots-register-repository.html`,
mapperSize: `${PLUGIN_DOCS}mapper-size-usage.html`,
},
snapshotRestore: {
guide: `${ELASTICSEARCH_DOCS}snapshot-restore.html`,
changeIndexSettings: `${ELASTICSEARCH_DOCS}index-modules.html`,
createSnapshot: `${ELASTICSEARCH_DOCS}snapshots-take-snapshot.html`,
getSnapshot: `${ELASTICSEARCH_DOCS}get-snapshot-api.html`,
registerSharedFileSystem: `${ELASTICSEARCH_DOCS}snapshots-filesystem-repository.html#filesystem-repository-settings`,
registerSourceOnly: `${ELASTICSEARCH_DOCS}snapshots-source-only-repository.html#source-only-repository-settings`,
registerUrl: `${ELASTICSEARCH_DOCS}snapshots-read-only-repository.html#read-only-url-repository-settings`,
restoreSnapshot: `${ELASTICSEARCH_DOCS}snapshots-restore-snapshot.html`,
restoreSnapshotApi: `${ELASTICSEARCH_DOCS}restore-snapshot-api.html#restore-snapshot-api-request-body`,
searchableSnapshotSharedCache: `${ELASTICSEARCH_DOCS}searchable-snapshots.html#searchable-snapshots-shared-cache`,
},
ingest: {
append: `${ELASTICSEARCH_DOCS}append-processor.html`,
bytes: `${ELASTICSEARCH_DOCS}bytes-processor.html`,
circle: `${ELASTICSEARCH_DOCS}ingest-circle-processor.html`,
convert: `${ELASTICSEARCH_DOCS}convert-processor.html`,
csv: `${ELASTICSEARCH_DOCS}csv-processor.html`,
date: `${ELASTICSEARCH_DOCS}date-processor.html`,
dateIndexName: `${ELASTICSEARCH_DOCS}date-index-name-processor.html`,
dissect: `${ELASTICSEARCH_DOCS}dissect-processor.html`,
dissectKeyModifiers: `${ELASTICSEARCH_DOCS}dissect-processor.html#dissect-key-modifiers`,
dotExpander: `${ELASTICSEARCH_DOCS}dot-expand-processor.html`,
drop: `${ELASTICSEARCH_DOCS}drop-processor.html`,
enrich: `${ELASTICSEARCH_DOCS}ingest-enriching-data.html`,
fail: `${ELASTICSEARCH_DOCS}fail-processor.html`,
foreach: `${ELASTICSEARCH_DOCS}foreach-processor.html`,
geoIp: `${ELASTICSEARCH_DOCS}geoip-processor.html`,
geoMatch: `${ELASTICSEARCH_DOCS}geo-match-enrich-policy-type.html`,
grok: `${ELASTICSEARCH_DOCS}grok-processor.html`,
gsub: `${ELASTICSEARCH_DOCS}gsub-processor.html`,
htmlString: `${ELASTICSEARCH_DOCS}htmlstrip-processor.html`,
inference: `${ELASTICSEARCH_DOCS}inference-processor.html`,
inferenceClassification: `${ELASTICSEARCH_DOCS}inference-processor.html#inference-processor-classification-opt`,
inferenceRegression: `${ELASTICSEARCH_DOCS}inference-processor.html#inference-processor-regression-opt`,
join: `${ELASTICSEARCH_DOCS}join-processor.html`,
json: `${ELASTICSEARCH_DOCS}json-processor.html`,
kv: `${ELASTICSEARCH_DOCS}kv-processor.html`,
lowercase: `${ELASTICSEARCH_DOCS}lowercase-processor.html`,
pipeline: `${ELASTICSEARCH_DOCS}pipeline-processor.html`,
pipelines: `${ELASTICSEARCH_DOCS}ingest.html`,
pipelineFailure: `${ELASTICSEARCH_DOCS}ingest.html#handling-pipeline-failures`,
processors: `${ELASTICSEARCH_DOCS}processors.html`,
remove: `${ELASTICSEARCH_DOCS}remove-processor.html`,
rename: `${ELASTICSEARCH_DOCS}rename-processor.html`,
script: `${ELASTICSEARCH_DOCS}script-processor.html`,
set: `${ELASTICSEARCH_DOCS}set-processor.html`,
setSecurityUser: `${ELASTICSEARCH_DOCS}ingest-node-set-security-user-processor.html`,
sort: `${ELASTICSEARCH_DOCS}sort-processor.html`,
split: `${ELASTICSEARCH_DOCS}split-processor.html`,
trim: `${ELASTICSEARCH_DOCS}trim-processor.html`,
uppercase: `${ELASTICSEARCH_DOCS}uppercase-processor.html`,
uriParts: `${ELASTICSEARCH_DOCS}uri-parts-processor.html`,
urlDecode: `${ELASTICSEARCH_DOCS}urldecode-processor.html`,
userAgent: `${ELASTICSEARCH_DOCS}user-agent-processor.html`,
},
fleet: {
guide: `${FLEET_DOCS}index.html`,
fleetServer: `${FLEET_DOCS}fleet-server.html`,
fleetServerAddFleetServer: `${FLEET_DOCS}add-a-fleet-server.html`,
settings: `${FLEET_DOCS}fleet-settings.html#fleet-server-hosts-setting`,
settingsFleetServerHostSettings: `${FLEET_DOCS}fleet-settings.html#fleet-server-hosts-setting`,
settingsFleetServerProxySettings: `${KIBANA_DOCS}fleet-settings-kb.html#fleet-data-visualizer-settings`,
troubleshooting: `${FLEET_DOCS}fleet-troubleshooting.html`,
elasticAgent: `${FLEET_DOCS}elastic-agent-installation.html`,
beatsAgentComparison: `${FLEET_DOCS}beats-agent-comparison.html`,
datastreams: `${FLEET_DOCS}data-streams.html`,
datastreamsNamingScheme: `${FLEET_DOCS}data-streams.html#data-streams-naming-scheme`,
installElasticAgent: `${FLEET_DOCS}install-fleet-managed-elastic-agent.html`,
installElasticAgentStandalone: `${FLEET_DOCS}install-standalone-elastic-agent.html`,
upgradeElasticAgent: `${FLEET_DOCS}upgrade-elastic-agent.html`,
upgradeElasticAgent712lower: `${FLEET_DOCS}upgrade-elastic-agent.html#upgrade-7.12-lower`,
learnMoreBlog: `${ELASTIC_WEBSITE_URL}blog/elastic-agent-and-fleet-make-it-easier-to-integrate-your-systems-with-elastic`,
apiKeysLearnMore: `${KIBANA_DOCS}api-keys.html`,
onPremRegistry: `${FLEET_DOCS}air-gapped.html`,
},
ecs: {
guide: `${ELASTIC_WEBSITE_URL}guide/en/ecs/current/index.html`,
},
clients: {
/** Changes to these URLs must also be synched in src/plugins/custom_integrations/server/language_clients/index.ts */
guide: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/index.html`,
goOverview: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/go-api/${DOC_LINK_VERSION}/overview.html`,
javaIndex: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/java-api-client/${DOC_LINK_VERSION}/index.html`,
jsIntro: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/javascript-api/${DOC_LINK_VERSION}/introduction.html`,
netGuide: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/net-api/${DOC_LINK_VERSION}/index.html`,
perlGuide: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/perl-api/${DOC_LINK_VERSION}/index.html`,
phpGuide: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/php-api/${DOC_LINK_VERSION}/index.html`,
pythonGuide: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/python-api/${DOC_LINK_VERSION}/index.html`,
rubyOverview: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/ruby-api/${DOC_LINK_VERSION}/ruby_client.html`,
rustGuide: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/client/rust-api/${DOC_LINK_VERSION}/index.html`,
},
endpoints: {
troubleshooting: `${ELASTIC_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/ts-management.html#ts-endpoints`,
},
},
});
return {
DOC_LINK_VERSION: docMeta.version,
ELASTIC_WEBSITE_URL: docMeta.elasticWebsiteUrl,
links: docLinks,
};
}
}
@ -609,350 +35,5 @@ export class DocLinksService {
export interface DocLinksStart {
readonly DOC_LINK_VERSION: string;
readonly ELASTIC_WEBSITE_URL: string;
readonly links: {
readonly settings: string;
readonly elasticStackGetStarted: string;
readonly upgrade: {
readonly upgradingStackOnPrem: string;
readonly upgradingStackOnCloud: string;
};
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
readonly customLinks: string;
readonly droppedTransactionSpans: string;
readonly upgrading: string;
readonly metaData: string;
};
readonly canvas: {
readonly guide: string;
};
readonly cloud: {
readonly indexManagement: string;
};
readonly console: {
readonly guide: string;
};
readonly dashboard: {
readonly guide: string;
readonly drilldowns: string;
readonly drilldownsTriggerPicker: string;
readonly urlDrilldownTemplateSyntax: string;
readonly urlDrilldownVariables: string;
};
readonly discover: Record<string, string>;
readonly filebeat: {
readonly base: string;
readonly installation: string;
readonly configuration: string;
readonly elasticsearchOutput: string;
readonly elasticsearchModule: string;
readonly startup: string;
readonly exportedFields: string;
readonly suricataModule: string;
readonly zeekModule: string;
};
readonly auditbeat: {
readonly base: string;
readonly auditdModule: string;
readonly systemModule: string;
};
readonly metricbeat: {
readonly base: string;
readonly configure: string;
readonly httpEndpoint: string;
readonly install: string;
readonly start: string;
};
readonly appSearch: {
readonly apiRef: string;
readonly apiClients: string;
readonly apiKeys: string;
readonly authentication: string;
readonly crawlRules: string;
readonly curations: string;
readonly duplicateDocuments: string;
readonly entryPoints: string;
readonly guide: string;
readonly indexingDocuments: string;
readonly indexingDocumentsSchema: string;
readonly logSettings: string;
readonly metaEngines: string;
readonly precisionTuning: string;
readonly relevanceTuning: string;
readonly resultSettings: string;
readonly searchUI: string;
readonly security: string;
readonly synonyms: string;
readonly webCrawler: string;
readonly webCrawlerEventLogs: string;
};
readonly enterpriseSearch: {
readonly configuration: string;
readonly licenseManagement: string;
readonly mailService: string;
readonly usersAccess: string;
};
readonly workplaceSearch: {
readonly apiKeys: string;
readonly box: string;
readonly confluenceCloud: string;
readonly confluenceServer: string;
readonly customSources: string;
readonly customSourcePermissions: string;
readonly documentPermissions: string;
readonly dropbox: string;
readonly externalIdentities: string;
readonly gitHub: string;
readonly gettingStarted: string;
readonly gmail: string;
readonly googleDrive: string;
readonly indexingSchedule: string;
readonly jiraCloud: string;
readonly jiraServer: string;
readonly oneDrive: string;
readonly permissions: string;
readonly salesforce: string;
readonly security: string;
readonly serviceNow: string;
readonly sharePoint: string;
readonly slack: string;
readonly synch: string;
readonly zendesk: string;
};
readonly heartbeat: {
readonly base: string;
};
readonly libbeat: {
readonly getStarted: string;
};
readonly logstash: {
readonly base: string;
};
readonly functionbeat: {
readonly base: string;
};
readonly winlogbeat: {
readonly base: string;
};
readonly aggs: {
readonly composite: string;
readonly composite_missing_bucket: string;
readonly date_histogram: string;
readonly date_range: string;
readonly date_format_pattern: string;
readonly filter: string;
readonly filters: string;
readonly geohash_grid: string;
readonly histogram: string;
readonly ip_range: string;
readonly range: string;
readonly significant_terms: string;
readonly terms: string;
readonly terms_doc_count_error: string;
readonly rare_terms: string;
readonly avg: string;
readonly avg_bucket: string;
readonly max_bucket: string;
readonly min_bucket: string;
readonly sum_bucket: string;
readonly cardinality: string;
readonly count: string;
readonly cumulative_sum: string;
readonly derivative: string;
readonly geo_bounds: string;
readonly geo_centroid: string;
readonly max: string;
readonly median: string;
readonly min: string;
readonly moving_avg: string;
readonly percentile_ranks: string;
readonly serial_diff: string;
readonly std_dev: string;
readonly sum: string;
readonly top_hits: string;
};
readonly runtimeFields: {
readonly overview: string;
readonly mapping: string;
};
readonly scriptedFields: {
readonly scriptFields: string;
readonly scriptAggs: string;
readonly painless: string;
readonly painlessApi: string;
readonly painlessLangSpec: string;
readonly painlessSyntax: string;
readonly painlessWalkthrough: string;
readonly luceneExpressions: string;
};
readonly search: {
readonly sessions: string;
readonly sessionLimits: string;
};
readonly indexPatterns: {
readonly introduction: string;
readonly fieldFormattersNumber: string;
readonly fieldFormattersString: string;
readonly runtimeFields: string;
};
readonly addData: string;
readonly kibana: {
readonly guide: string;
readonly autocompleteSuggestions: string;
readonly xpackSecurity: string;
};
readonly upgradeAssistant: {
readonly overview: string;
readonly batchReindex: string;
readonly remoteReindex: string;
};
readonly rollupJobs: string;
readonly elasticsearch: Record<string, string>;
readonly siem: {
readonly privileges: string;
readonly guide: string;
readonly gettingStarted: string;
readonly ml: string;
readonly ruleChangeLog: string;
readonly detectionsReq: string;
readonly networkMap: string;
readonly troubleshootGaps: string;
};
readonly securitySolution: {
readonly trustedApps: string;
readonly eventFilters: string;
};
readonly query: {
readonly eql: string;
readonly kueryQuerySyntax: string;
readonly luceneQuery: string;
readonly luceneQuerySyntax: string;
readonly percolate: string;
readonly queryDsl: string;
};
readonly date: {
readonly dateMath: string;
readonly dateMathIndexNames: string;
};
readonly management: Record<string, string>;
readonly ml: Record<string, string>;
readonly transforms: Record<string, string>;
readonly visualize: Record<string, string>;
readonly apis: Readonly<{
bulkIndexAlias: string;
byteSizeUnits: string;
createAutoFollowPattern: string;
createFollower: string;
createIndex: string;
createSnapshotLifecyclePolicy: string;
createRoleMapping: string;
createRoleMappingTemplates: string;
createRollupJobsRequest: string;
createApiKey: string;
createPipeline: string;
createTransformRequest: string;
cronExpressions: string;
executeWatchActionModes: string;
indexExists: string;
multiSearch: string;
openIndex: string;
putComponentTemplate: string;
painlessExecute: string;
painlessExecuteAPIContexts: string;
putComponentTemplateMetadata: string;
putSnapshotLifecyclePolicy: string;
putIndexTemplateV1: string;
putWatch: string;
searchPreference: string;
simulatePipeline: string;
timeUnits: string;
unfreezeIndex: string;
updateTransform: string;
}>;
readonly observability: Readonly<{
guide: string;
infrastructureThreshold: string;
logsThreshold: string;
metricsThreshold: string;
monitorStatus: string;
monitorUptime: string;
tlsCertificate: string;
uptimeDurationAnomaly: string;
}>;
readonly alerting: Record<string, string>;
readonly maps: Readonly<{
guide: string;
importGeospatialPrivileges: string;
gdalTutorial: string;
}>;
readonly monitoring: Record<string, string>;
readonly security: Readonly<{
apiKeyServiceSettings: string;
clusterPrivileges: string;
elasticsearchSettings: string;
elasticsearchEnableSecurity: string;
elasticsearchEnableApiKeys: string;
indicesPrivileges: string;
kibanaTLS: string;
kibanaPrivileges: string;
mappingRoles: string;
mappingRolesFieldRules: string;
runAsPrivilege: string;
}>;
readonly spaces: Readonly<{
kibanaLegacyUrlAliases: string;
kibanaDisableLegacyUrlAliasesApi: string;
}>;
readonly watcher: Record<string, string>;
readonly ccs: Record<string, string>;
readonly plugins: {
azureRepo: string;
gcsRepo: string;
hdfsRepo: string;
s3Repo: string;
snapshotRestoreRepos: string;
mapperSize: string;
};
readonly snapshotRestore: Record<string, string>;
readonly ingest: Record<string, string>;
readonly fleet: Readonly<{
beatsAgentComparison: string;
guide: string;
fleetServer: string;
fleetServerAddFleetServer: string;
settings: string;
settingsFleetServerHostSettings: string;
settingsFleetServerProxySettings: string;
troubleshooting: string;
elasticAgent: string;
datastreams: string;
datastreamsNamingScheme: string;
installElasticAgent: string;
installElasticAgentStandalone: string;
upgradeElasticAgent: string;
upgradeElasticAgent712lower: string;
learnMoreBlog: string;
apiKeysLearnMore: string;
onPremRegistry: string;
}>;
readonly ecs: {
readonly guide: string;
};
readonly clients: {
readonly guide: string;
readonly goOverview: string;
readonly javaIndex: string;
readonly jsIntro: string;
readonly netGuide: string;
readonly perlGuide: string;
readonly phpGuide: string;
readonly pythonGuide: string;
readonly rubyOverview: string;
readonly rustGuide: string;
};
readonly endpoints: {
readonly troubleshooting: string;
};
};
readonly links: DocLinks;
}

View file

@ -11,6 +11,7 @@ import Boom from '@hapi/boom';
import { ByteSizeValue } from '@kbn/config-schema';
import { ConfigPath } from '@kbn/config';
import { DetailedPeerCertificate } from 'tls';
import type { DocLinks } from '@kbn/doc-links';
import { EnvironmentMode } from '@kbn/config';
import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { EuiBreadcrumb } from '@elastic/eui';
@ -490,352 +491,7 @@ export interface DocLinksStart {
// (undocumented)
readonly ELASTIC_WEBSITE_URL: string;
// (undocumented)
readonly links: {
readonly settings: string;
readonly elasticStackGetStarted: string;
readonly upgrade: {
readonly upgradingStackOnPrem: string;
readonly upgradingStackOnCloud: string;
};
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
readonly customLinks: string;
readonly droppedTransactionSpans: string;
readonly upgrading: string;
readonly metaData: string;
};
readonly canvas: {
readonly guide: string;
};
readonly cloud: {
readonly indexManagement: string;
};
readonly console: {
readonly guide: string;
};
readonly dashboard: {
readonly guide: string;
readonly drilldowns: string;
readonly drilldownsTriggerPicker: string;
readonly urlDrilldownTemplateSyntax: string;
readonly urlDrilldownVariables: string;
};
readonly discover: Record<string, string>;
readonly filebeat: {
readonly base: string;
readonly installation: string;
readonly configuration: string;
readonly elasticsearchOutput: string;
readonly elasticsearchModule: string;
readonly startup: string;
readonly exportedFields: string;
readonly suricataModule: string;
readonly zeekModule: string;
};
readonly auditbeat: {
readonly base: string;
readonly auditdModule: string;
readonly systemModule: string;
};
readonly metricbeat: {
readonly base: string;
readonly configure: string;
readonly httpEndpoint: string;
readonly install: string;
readonly start: string;
};
readonly appSearch: {
readonly apiRef: string;
readonly apiClients: string;
readonly apiKeys: string;
readonly authentication: string;
readonly crawlRules: string;
readonly curations: string;
readonly duplicateDocuments: string;
readonly entryPoints: string;
readonly guide: string;
readonly indexingDocuments: string;
readonly indexingDocumentsSchema: string;
readonly logSettings: string;
readonly metaEngines: string;
readonly precisionTuning: string;
readonly relevanceTuning: string;
readonly resultSettings: string;
readonly searchUI: string;
readonly security: string;
readonly synonyms: string;
readonly webCrawler: string;
readonly webCrawlerEventLogs: string;
};
readonly enterpriseSearch: {
readonly configuration: string;
readonly licenseManagement: string;
readonly mailService: string;
readonly usersAccess: string;
};
readonly workplaceSearch: {
readonly apiKeys: string;
readonly box: string;
readonly confluenceCloud: string;
readonly confluenceServer: string;
readonly customSources: string;
readonly customSourcePermissions: string;
readonly documentPermissions: string;
readonly dropbox: string;
readonly externalIdentities: string;
readonly gitHub: string;
readonly gettingStarted: string;
readonly gmail: string;
readonly googleDrive: string;
readonly indexingSchedule: string;
readonly jiraCloud: string;
readonly jiraServer: string;
readonly oneDrive: string;
readonly permissions: string;
readonly salesforce: string;
readonly security: string;
readonly serviceNow: string;
readonly sharePoint: string;
readonly slack: string;
readonly synch: string;
readonly zendesk: string;
};
readonly heartbeat: {
readonly base: string;
};
readonly libbeat: {
readonly getStarted: string;
};
readonly logstash: {
readonly base: string;
};
readonly functionbeat: {
readonly base: string;
};
readonly winlogbeat: {
readonly base: string;
};
readonly aggs: {
readonly composite: string;
readonly composite_missing_bucket: string;
readonly date_histogram: string;
readonly date_range: string;
readonly date_format_pattern: string;
readonly filter: string;
readonly filters: string;
readonly geohash_grid: string;
readonly histogram: string;
readonly ip_range: string;
readonly range: string;
readonly significant_terms: string;
readonly terms: string;
readonly terms_doc_count_error: string;
readonly rare_terms: string;
readonly avg: string;
readonly avg_bucket: string;
readonly max_bucket: string;
readonly min_bucket: string;
readonly sum_bucket: string;
readonly cardinality: string;
readonly count: string;
readonly cumulative_sum: string;
readonly derivative: string;
readonly geo_bounds: string;
readonly geo_centroid: string;
readonly max: string;
readonly median: string;
readonly min: string;
readonly moving_avg: string;
readonly percentile_ranks: string;
readonly serial_diff: string;
readonly std_dev: string;
readonly sum: string;
readonly top_hits: string;
};
readonly runtimeFields: {
readonly overview: string;
readonly mapping: string;
};
readonly scriptedFields: {
readonly scriptFields: string;
readonly scriptAggs: string;
readonly painless: string;
readonly painlessApi: string;
readonly painlessLangSpec: string;
readonly painlessSyntax: string;
readonly painlessWalkthrough: string;
readonly luceneExpressions: string;
};
readonly search: {
readonly sessions: string;
readonly sessionLimits: string;
};
readonly indexPatterns: {
readonly introduction: string;
readonly fieldFormattersNumber: string;
readonly fieldFormattersString: string;
readonly runtimeFields: string;
};
readonly addData: string;
readonly kibana: {
readonly guide: string;
readonly autocompleteSuggestions: string;
readonly xpackSecurity: string;
};
readonly upgradeAssistant: {
readonly overview: string;
readonly batchReindex: string;
readonly remoteReindex: string;
};
readonly rollupJobs: string;
readonly elasticsearch: Record<string, string>;
readonly siem: {
readonly privileges: string;
readonly guide: string;
readonly gettingStarted: string;
readonly ml: string;
readonly ruleChangeLog: string;
readonly detectionsReq: string;
readonly networkMap: string;
readonly troubleshootGaps: string;
};
readonly securitySolution: {
readonly trustedApps: string;
readonly eventFilters: string;
};
readonly query: {
readonly eql: string;
readonly kueryQuerySyntax: string;
readonly luceneQuery: string;
readonly luceneQuerySyntax: string;
readonly percolate: string;
readonly queryDsl: string;
};
readonly date: {
readonly dateMath: string;
readonly dateMathIndexNames: string;
};
readonly management: Record<string, string>;
readonly ml: Record<string, string>;
readonly transforms: Record<string, string>;
readonly visualize: Record<string, string>;
readonly apis: Readonly<{
bulkIndexAlias: string;
byteSizeUnits: string;
createAutoFollowPattern: string;
createFollower: string;
createIndex: string;
createSnapshotLifecyclePolicy: string;
createRoleMapping: string;
createRoleMappingTemplates: string;
createRollupJobsRequest: string;
createApiKey: string;
createPipeline: string;
createTransformRequest: string;
cronExpressions: string;
executeWatchActionModes: string;
indexExists: string;
multiSearch: string;
openIndex: string;
putComponentTemplate: string;
painlessExecute: string;
painlessExecuteAPIContexts: string;
putComponentTemplateMetadata: string;
putSnapshotLifecyclePolicy: string;
putIndexTemplateV1: string;
putWatch: string;
searchPreference: string;
simulatePipeline: string;
timeUnits: string;
unfreezeIndex: string;
updateTransform: string;
}>;
readonly observability: Readonly<{
guide: string;
infrastructureThreshold: string;
logsThreshold: string;
metricsThreshold: string;
monitorStatus: string;
monitorUptime: string;
tlsCertificate: string;
uptimeDurationAnomaly: string;
}>;
readonly alerting: Record<string, string>;
readonly maps: Readonly<{
guide: string;
importGeospatialPrivileges: string;
gdalTutorial: string;
}>;
readonly monitoring: Record<string, string>;
readonly security: Readonly<{
apiKeyServiceSettings: string;
clusterPrivileges: string;
elasticsearchSettings: string;
elasticsearchEnableSecurity: string;
elasticsearchEnableApiKeys: string;
indicesPrivileges: string;
kibanaTLS: string;
kibanaPrivileges: string;
mappingRoles: string;
mappingRolesFieldRules: string;
runAsPrivilege: string;
}>;
readonly spaces: Readonly<{
kibanaLegacyUrlAliases: string;
kibanaDisableLegacyUrlAliasesApi: string;
}>;
readonly watcher: Record<string, string>;
readonly ccs: Record<string, string>;
readonly plugins: {
azureRepo: string;
gcsRepo: string;
hdfsRepo: string;
s3Repo: string;
snapshotRestoreRepos: string;
mapperSize: string;
};
readonly snapshotRestore: Record<string, string>;
readonly ingest: Record<string, string>;
readonly fleet: Readonly<{
beatsAgentComparison: string;
guide: string;
fleetServer: string;
fleetServerAddFleetServer: string;
settings: string;
settingsFleetServerHostSettings: string;
settingsFleetServerProxySettings: string;
troubleshooting: string;
elasticAgent: string;
datastreams: string;
datastreamsNamingScheme: string;
installElasticAgent: string;
installElasticAgentStandalone: string;
upgradeElasticAgent: string;
upgradeElasticAgent712lower: string;
learnMoreBlog: string;
apiKeysLearnMore: string;
onPremRegistry: string;
}>;
readonly ecs: {
readonly guide: string;
};
readonly clients: {
readonly guide: string;
readonly goOverview: string;
readonly javaIndex: string;
readonly jsIntro: string;
readonly netGuide: string;
readonly perlGuide: string;
readonly phpGuide: string;
readonly pythonGuide: string;
readonly rubyOverview: string;
readonly rustGuide: string;
};
readonly endpoints: {
readonly troubleshooting: string;
};
};
readonly links: DocLinks;
}
// Warning: (ae-forgotten-export) The symbol "DeprecationsDetails" needs to be exported by the entry point index.d.ts

View file

@ -0,0 +1,39 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { PublicMethodsOf } from '@kbn/utility-types';
import { getDocLinks, getDocLinksMeta } from '@kbn/doc-links';
import type { DocLinksServiceStart, DocLinksServiceSetup } from './types';
import type { DocLinksService } from './doc_links_service';
type DocLinksServiceContract = PublicMethodsOf<DocLinksService>;
const createSetupMock = (): DocLinksServiceSetup => {
const branch = 'test-branch';
return {
...getDocLinksMeta({ kibanaBranch: branch }),
links: getDocLinks({ kibanaBranch: branch }),
};
};
const createStartMock = (): DocLinksServiceStart => {
return createSetupMock();
};
const createServiceMock = (): jest.Mocked<DocLinksServiceContract> => {
return {
setup: jest.fn().mockImplementation(createSetupMock),
start: jest.fn().mockImplementation(createStartMock),
};
};
export const docLinksServiceMock = {
create: createServiceMock,
createSetupContract: createSetupMock,
createStartContract: createStartMock,
};

View file

@ -0,0 +1,15 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
export const getDocLinksMock = jest.fn();
export const getDocLinksMetaMock = jest.fn();
jest.doMock('@kbn/doc-links', () => ({
getDocLinks: getDocLinksMock,
getDocLinksMeta: getDocLinksMetaMock,
}));

View file

@ -0,0 +1,119 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { getDocLinksMock, getDocLinksMetaMock } from './doc_links_service.test.mocks';
import { DocLinksService } from './doc_links_service';
import { mockCoreContext } from '../core_context.mock';
describe('DocLinksService', () => {
let coreContext: ReturnType<typeof mockCoreContext.create>;
let service: DocLinksService;
beforeEach(() => {
getDocLinksMetaMock.mockReturnValue({
version: 'test-version',
elasticWebsiteUrl: 'http://elastic.test.url',
});
getDocLinksMock.mockReturnValue({
settings: 'http://settings.test.url',
});
coreContext = mockCoreContext.create();
service = new DocLinksService(coreContext);
});
afterEach(() => {
getDocLinksMock.mockReset();
getDocLinksMetaMock.mockReset();
});
describe('#setup', () => {
it('calls `getDocLinksMeta` with the correct parameters', () => {
expect(getDocLinksMetaMock).not.toHaveBeenCalled();
service.setup();
expect(getDocLinksMetaMock).toHaveBeenCalledTimes(1);
expect(getDocLinksMetaMock).toHaveBeenCalledWith({
kibanaBranch: coreContext.env.packageInfo.branch,
});
});
it('return the values from `getDocLinksMeta`', () => {
const setup = service.setup();
expect(setup).toEqual({
version: 'test-version',
elasticWebsiteUrl: 'http://elastic.test.url',
links: expect.any(Object),
});
});
it('calls `getDocLinks` with the correct parameters', () => {
expect(getDocLinksMock).not.toHaveBeenCalled();
service.setup();
expect(getDocLinksMock).toHaveBeenCalledTimes(1);
expect(getDocLinksMock).toHaveBeenCalledWith({
kibanaBranch: coreContext.env.packageInfo.branch,
});
});
it('return the values from `getDocLinks`', () => {
const setup = service.setup();
expect(setup.links).toEqual({
settings: 'http://settings.test.url',
});
});
});
describe('#start', () => {
it('throws if called before #setup', () => {
expect(() => service.start()).toThrowErrorMatchingInlineSnapshot(
`"#setup must be called before #start"`
);
});
it('does not recall underlying functions', () => {
expect(getDocLinksMock).not.toHaveBeenCalled();
expect(getDocLinksMetaMock).not.toHaveBeenCalled();
service.setup();
expect(getDocLinksMock).toHaveBeenCalledTimes(1);
expect(getDocLinksMetaMock).toHaveBeenCalledTimes(1);
service.start();
expect(getDocLinksMock).toHaveBeenCalledTimes(1);
expect(getDocLinksMetaMock).toHaveBeenCalledTimes(1);
});
it('return the values from `getDocLinks`', () => {
service.setup();
const start = service.start();
expect(start.links).toEqual({
settings: 'http://settings.test.url',
});
});
it('return the values from `getDocLinksMeta`', () => {
service.setup();
const start = service.start();
expect(start).toEqual({
version: 'test-version',
elasticWebsiteUrl: 'http://elastic.test.url',
links: expect.any(Object),
});
});
});
});

View file

@ -0,0 +1,38 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { getDocLinks, getDocLinksMeta } from '@kbn/doc-links';
import type { CoreContext } from '../core_context';
import type { DocLinksServiceSetup, DocLinksServiceStart } from './types';
/** @internal */
export class DocLinksService {
private readonly kibanaBranch: string;
private docLinks?: DocLinksServiceSetup;
constructor(core: CoreContext) {
this.kibanaBranch = core.env.packageInfo.branch;
}
public setup(): DocLinksServiceSetup {
const docMeta = getDocLinksMeta({ kibanaBranch: this.kibanaBranch });
const docLinks = getDocLinks({ kibanaBranch: this.kibanaBranch });
this.docLinks = {
...docMeta,
links: docLinks,
};
return this.docLinks;
}
public start(): DocLinksServiceStart {
if (!this.docLinks) {
throw new Error('#setup must be called before #start');
}
return this.docLinks;
}
}

View file

@ -0,0 +1,10 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
export { DocLinksService } from './doc_links_service';
export type { DocLinksServiceStart, DocLinksServiceSetup } from './types';

View file

@ -0,0 +1,22 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import type { DocLinks } from '@kbn/doc-links';
/** @public */
export interface DocLinksServiceSetup {
/** The branch/version the docLinks are pointing to */
readonly version: string;
/** The base url for the elastic website */
readonly elasticWebsiteUrl: string;
/** A record of all registered doc links */
readonly links: DocLinks;
}
/** @public */
export type DocLinksServiceStart = DocLinksServiceSetup;

View file

@ -69,6 +69,7 @@ import {
CoreServicesUsageData,
} from './core_usage_data';
import { PrebootServicePreboot } from './preboot';
import { DocLinksServiceStart, DocLinksServiceSetup } from './doc_links';
export type { PrebootServicePreboot } from './preboot';
@ -438,6 +439,8 @@ export type {
CoreIncrementCounterParams,
} from './core_usage_data';
export type { DocLinksServiceSetup, DocLinksServiceStart } from './doc_links';
/**
* Plugin specific context passed to a route handler.
*
@ -501,6 +504,8 @@ export interface CoreSetup<TPluginsStart extends object = object, TStart = unkno
capabilities: CapabilitiesSetup;
/** {@link ContextSetup} */
context: ContextSetup;
/** {@link DocLinksServiceSetup} */
docLinks: DocLinksServiceSetup;
/** {@link ElasticsearchServiceSetup} */
elasticsearch: ElasticsearchServiceSetup;
/** {@link ExecutionContextSetup} */
@ -551,6 +556,8 @@ export type StartServicesAccessor<
export interface CoreStart {
/** {@link CapabilitiesStart} */
capabilities: CapabilitiesStart;
/** {@link DocLinksServiceStart} */
docLinks: DocLinksServiceStart;
/** {@link ElasticsearchServiceStart} */
elasticsearch: ElasticsearchServiceStart;
/** {@link ExecutionContextStart} */

View file

@ -44,6 +44,7 @@ import type {
InternalExecutionContextStart,
} from './execution_context';
import { InternalPrebootServicePreboot } from './preboot';
import { DocLinksServiceSetup, DocLinksServiceStart } from './doc_links';
/** @internal */
export interface InternalCorePreboot {
@ -60,6 +61,7 @@ export interface InternalCorePreboot {
export interface InternalCoreSetup {
capabilities: CapabilitiesSetup;
context: ContextSetup;
docLinks: DocLinksServiceSetup;
http: InternalHttpServiceSetup;
elasticsearch: InternalElasticsearchServiceSetup;
executionContext: InternalExecutionContextSetup;
@ -82,6 +84,7 @@ export interface InternalCoreSetup {
export interface InternalCoreStart {
capabilities: CapabilitiesStart;
elasticsearch: InternalElasticsearchServiceStart;
docLinks: DocLinksServiceStart;
http: InternalHttpServiceStart;
metrics: InternalMetricsServiceStart;
savedObjects: InternalSavedObjectsServiceStart;

View file

@ -38,6 +38,7 @@ import { i18nServiceMock } from './i18n/i18n_service.mock';
import { deprecationsServiceMock } from './deprecations/deprecations_service.mock';
import { executionContextServiceMock } from './execution_context/execution_context_service.mock';
import { prebootServiceMock } from './preboot/preboot_service.mock';
import { docLinksServiceMock } from './doc_links/doc_links_service.mock';
export { configServiceMock, configDeprecationsMock } from './config/mocks';
export { httpServerMock } from './http/http_server.mocks';
@ -60,6 +61,7 @@ export { coreUsageDataServiceMock } from './core_usage_data/core_usage_data_serv
export { i18nServiceMock } from './i18n/i18n_service.mock';
export { deprecationsServiceMock } from './deprecations/deprecations_service.mock';
export { executionContextServiceMock } from './execution_context/execution_context_service.mock';
export { docLinksServiceMock } from './doc_links/doc_links_service.mock';
type MockedPluginInitializerConfig<T> = jest.Mocked<PluginInitializerContext<T>['config']>;
@ -156,6 +158,7 @@ function createCoreSetupMock({
const mock: CoreSetupMockType = {
capabilities: capabilitiesServiceMock.createSetupContract(),
context: contextServiceMock.createSetupContract(),
docLinks: docLinksServiceMock.createSetupContract(),
elasticsearch: elasticsearchServiceMock.createSetup(),
http: httpMock,
i18n: i18nServiceMock.createSetupContract(),
@ -180,6 +183,7 @@ function createCoreSetupMock({
function createCoreStartMock() {
const mock: MockedKeys<CoreStart> = {
capabilities: capabilitiesServiceMock.createStartContract(),
docLinks: docLinksServiceMock.createStartContract(),
elasticsearch: elasticsearchServiceMock.createStart(),
http: httpServiceMock.createStartContract(),
metrics: metricsServiceMock.createStartContract(),
@ -209,6 +213,7 @@ function createInternalCoreSetupMock() {
const setupDeps = {
capabilities: capabilitiesServiceMock.createSetupContract(),
context: contextServiceMock.createSetupContract(),
docLinks: docLinksServiceMock.createSetupContract(),
elasticsearch: elasticsearchServiceMock.createInternalSetup(),
http: httpServiceMock.createInternalSetupContract(),
savedObjects: savedObjectsServiceMock.createInternalSetupContract(),
@ -230,6 +235,7 @@ function createInternalCoreSetupMock() {
function createInternalCoreStartMock() {
const startDeps = {
capabilities: capabilitiesServiceMock.createStartContract(),
docLinks: docLinksServiceMock.createStartContract(),
elasticsearch: elasticsearchServiceMock.createInternalStart(),
http: httpServiceMock.createInternalStartContract(),
metrics: metricsServiceMock.createInternalStartContract(),

View file

@ -154,6 +154,7 @@ export function createPluginSetupContext<TPlugin, TPluginDependencies>(
context: {
createContextContainer: deps.context.createContextContainer,
},
docLinks: deps.docLinks,
elasticsearch: {
legacy: deps.elasticsearch.legacy,
setUnauthorizedErrorHandler: deps.elasticsearch.setUnauthorizedErrorHandler,
@ -240,6 +241,7 @@ export function createPluginStartContext<TPlugin, TPluginDependencies>(
capabilities: {
resolveCapabilities: deps.capabilities.resolveCapabilities,
},
docLinks: deps.docLinks,
elasticsearch: {
client: deps.elasticsearch.client,
createClient: deps.elasticsearch.createClient,

View file

@ -19,6 +19,7 @@ import { ConfigDeprecationProvider } from '@kbn/config';
import { ConfigPath } from '@kbn/config';
import { ConfigService } from '@kbn/config';
import { DetailedPeerCertificate } from 'tls';
import type { DocLinks } from '@kbn/doc-links';
import { Duration } from 'moment';
import { Duration as Duration_2 } from 'moment-timezone';
import { Ecs } from '@kbn/logging';
@ -446,6 +447,8 @@ export interface CoreSetup<TPluginsStart extends object = object, TStart = unkno
// (undocumented)
deprecations: DeprecationsServiceSetup;
// (undocumented)
docLinks: DocLinksServiceSetup;
// (undocumented)
elasticsearch: ElasticsearchServiceSetup;
// (undocumented)
executionContext: ExecutionContextSetup;
@ -476,6 +479,8 @@ export interface CoreStart {
// @internal (undocumented)
coreUsageData: CoreUsageDataStart;
// (undocumented)
docLinks: DocLinksServiceStart;
// (undocumented)
elasticsearch: ElasticsearchServiceStart;
// (undocumented)
executionContext: ExecutionContextStart;
@ -861,6 +866,16 @@ export interface DiscoveredPlugin {
readonly type: PluginType;
}
// @public (undocumented)
export interface DocLinksServiceSetup {
readonly elasticWebsiteUrl: string;
readonly links: DocLinks;
readonly version: string;
}
// @public (undocumented)
export type DocLinksServiceStart = DocLinksServiceSetup;
export { Ecs }
export { EcsEventCategory }

View file

@ -116,3 +116,10 @@ export const mockDeprecationService = deprecationsServiceMock.create();
jest.doMock('./deprecations/deprecations_service', () => ({
DeprecationsService: jest.fn(() => mockDeprecationService),
}));
import { docLinksServiceMock } from './doc_links/doc_links_service.mock';
export const mockDocLinksService = docLinksServiceMock.create();
jest.doMock('./doc_links/doc_links_service', () => ({
DocLinksService: jest.fn(() => mockDocLinksService),
}));

View file

@ -23,6 +23,7 @@ import {
mockEnvironmentService,
mockPrebootService,
mockDeprecationService,
mockDocLinksService,
} from './server.test.mocks';
import { BehaviorSubject } from 'rxjs';
@ -102,6 +103,7 @@ test('sets up services on "setup"', async () => {
expect(mockLoggingService.setup).not.toHaveBeenCalled();
expect(mockI18nService.setup).not.toHaveBeenCalled();
expect(mockDeprecationService.setup).not.toHaveBeenCalled();
expect(mockDocLinksService.setup).not.toHaveBeenCalled();
await server.setup();
@ -117,6 +119,7 @@ test('sets up services on "setup"', async () => {
expect(mockLoggingService.setup).toHaveBeenCalledTimes(1);
expect(mockI18nService.setup).toHaveBeenCalledTimes(1);
expect(mockDeprecationService.setup).toHaveBeenCalledTimes(1);
expect(mockDocLinksService.setup).toHaveBeenCalledTimes(1);
});
test('injects legacy dependency to context#setup()', async () => {
@ -167,6 +170,7 @@ test('runs services on "start"', async () => {
expect(mockMetricsService.start).not.toHaveBeenCalled();
expect(mockStatusService.start).not.toHaveBeenCalled();
expect(mockDeprecationService.start).not.toHaveBeenCalled();
expect(mockDocLinksService.start).not.toHaveBeenCalled();
await server.start();
@ -176,6 +180,7 @@ test('runs services on "start"', async () => {
expect(mockMetricsService.start).toHaveBeenCalledTimes(1);
expect(mockStatusService.start).toHaveBeenCalledTimes(1);
expect(mockDeprecationService.start).toHaveBeenCalledTimes(1);
expect(mockDocLinksService.start).toHaveBeenCalledTimes(1);
});
test('does not fail on "setup" if there are unused paths detected', async () => {

View file

@ -31,6 +31,7 @@ import { EnvironmentService, config as pidConfig } from './environment';
// do not try to shorten the import to `./status`, it will break server test mocking
import { StatusService } from './status/status_service';
import { ExecutionContextService } from './execution_context';
import { DocLinksService } from './doc_links';
import { config as cspConfig } from './csp';
import { config as elasticsearchConfig } from './elasticsearch';
@ -82,6 +83,7 @@ export class Server {
private readonly deprecations: DeprecationsService;
private readonly executionContext: ExecutionContextService;
private readonly prebootService: PrebootService;
private readonly docLinks: DocLinksService;
private readonly savedObjectsStartPromise: Promise<SavedObjectsServiceStart>;
private resolveSavedObjectsStartPromise?: (value: SavedObjectsServiceStart) => void;
@ -120,6 +122,7 @@ export class Server {
this.deprecations = new DeprecationsService(core);
this.executionContext = new ExecutionContextService(core);
this.prebootService = new PrebootService(core);
this.docLinks = new DocLinksService(core);
this.savedObjectsStartPromise = new Promise((resolve) => {
this.resolveSavedObjectsStartPromise = resolve;
@ -196,6 +199,7 @@ export class Server {
pluginDependencies: new Map([...pluginTree.asOpaqueIds]),
});
const executionContextSetup = this.executionContext.setup();
const docLinksSetup = this.docLinks.setup();
const httpSetup = await this.http.setup({
context: contextServiceSetup,
@ -263,6 +267,7 @@ export class Server {
const coreSetup: InternalCoreSetup = {
capabilities: capabilitiesSetup,
context: contextServiceSetup,
docLinks: docLinksSetup,
elasticsearch: elasticsearchServiceSetup,
environment: environmentSetup,
executionContext: executionContextSetup,
@ -294,6 +299,7 @@ export class Server {
const startTransaction = apm.startTransaction('server-start', 'kibana-platform');
const executionContextStart = this.executionContext.start();
const docLinkStart = this.docLinks.start();
const elasticsearchStart = await this.elasticsearch.start();
const deprecationsStart = this.deprecations.start();
const soStartSpan = startTransaction?.startSpan('saved_objects.migration', 'migration');
@ -318,6 +324,7 @@ export class Server {
this.coreStart = {
capabilities: capabilitiesStart,
docLinks: docLinkStart,
elasticsearch: elasticsearchStart,
executionContext: executionContextStart,
http: httpStart,

View file

@ -3770,6 +3770,10 @@
version "0.0.0"
uid ""
"@kbn/doc-links@link:bazel-bin/packages/kbn-doc-links":
version "0.0.0"
uid ""
"@kbn/docs-utils@link:bazel-bin/packages/kbn-docs-utils":
version "0.0.0"
uid ""
@ -6693,6 +6697,10 @@
version "0.0.0"
uid ""
"@types/kbn__doc-links@link:bazel-bin/packages/kbn-doc-links/npm_module_types":
version "0.0.0"
uid ""
"@types/kbn__docs-utils@link:bazel-bin/packages/kbn-docs-utils/npm_module_types":
version "0.0.0"
uid ""