diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 370f377d74c893..d5c569ac9d552f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -94,6 +94,18 @@ # Observability Shared /x-pack/plugins/observability/ @elastic/observability-ui +# Unified Observability +/x-pack/plugins/observability/public/pages/overview @elastic/unified-observability +/x-pack/plugins/observability/public/pages/home @elastic/unified-observability +/x-pack/plugins/observability/public/pages/landing @elastic/unified-observability +/x-pack/plugins/observability/public/context @elastic/unified-observability + +# Actionable Observability +/x-pack/plugins/observability/common/rules @elastic/actionable-observability +/x-pack/plugins/observability/public/rules @elastic/actionable-observability +/x-pack/plugins/observability/public/pages/alerts @elastic/actionable-observability +/x-pack/plugins/observability/public/pages/cases @elastic/actionable-observability + # Infra Monitoring /x-pack/plugins/infra/ @elastic/infra-monitoring-ui /x-pack/test/functional/apps/infra @elastic/infra-monitoring-ui diff --git a/docs/development/core/public/kibana-plugin-core-public.app.deeplinks.md b/docs/development/core/public/kibana-plugin-core-public.app.deeplinks.md index 8186996b63fe55..d9f76fb38a55de 100644 --- a/docs/development/core/public/kibana-plugin-core-public.app.deeplinks.md +++ b/docs/development/core/public/kibana-plugin-core-public.app.deeplinks.md @@ -44,6 +44,5 @@ core.application.register({ ], mount: () => { ... } }) - ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.app.exactroute.md b/docs/development/core/public/kibana-plugin-core-public.app.exactroute.md index eb050b62c7d43b..71f6352ec006c6 100644 --- a/docs/development/core/public/kibana-plugin-core-public.app.exactroute.md +++ b/docs/development/core/public/kibana-plugin-core-public.app.exactroute.md @@ -25,6 +25,5 @@ core.application.register({ // '[basePath]/app/my_app' will be matched // '[basePath]/app/my_app/some/path' will not be matched - ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.app.md b/docs/development/core/public/kibana-plugin-core-public.app.md index d79a12a83367d0..7af32efcb9c124 100644 --- a/docs/development/core/public/kibana-plugin-core-public.app.md +++ b/docs/development/core/public/kibana-plugin-core-public.app.md @@ -10,24 +10,25 @@ ```typescript export interface App extends AppNavOptions ``` +Extends: AppNavOptions ## Properties | Property | Type | Description | | --- | --- | --- | -| [appRoute](./kibana-plugin-core-public.app.approute.md) | string | Override the application's routing path from /app/${id}. Must be unique across registered applications. Should not include the base path from HTTP. | -| [capabilities](./kibana-plugin-core-public.app.capabilities.md) | Partial<Capabilities> | Custom capabilities defined by the app. | -| [category](./kibana-plugin-core-public.app.category.md) | AppCategory | The category definition of the product See [AppCategory](./kibana-plugin-core-public.appcategory.md) See DEFAULT\_APP\_CATEGORIES for more reference | -| [chromeless](./kibana-plugin-core-public.app.chromeless.md) | boolean | Hide the UI chrome when the application is mounted. Defaults to false. Takes precedence over chrome service visibility settings. | -| [deepLinks](./kibana-plugin-core-public.app.deeplinks.md) | AppDeepLink[] | Input type for registering secondary in-app locations for an application.Deep links must include at least one of path or deepLinks. A deep link that does not have a path represents a topological level in the application's hierarchy, but does not have a destination URL that is user-accessible. | -| [defaultPath](./kibana-plugin-core-public.app.defaultpath.md) | string | Allow to define the default path a user should be directed to when navigating to the app. When defined, this value will be used as a default for the path option when calling [navigateToApp](./kibana-plugin-core-public.applicationstart.navigatetoapp.md)\`, and will also be appended to the [application navLink](./kibana-plugin-core-public.chromenavlink.md) in the navigation bar. | -| [exactRoute](./kibana-plugin-core-public.app.exactroute.md) | boolean | If set to true, the application's route will only be checked against an exact match. Defaults to false. | -| [id](./kibana-plugin-core-public.app.id.md) | string | The unique identifier of the application | -| [keywords](./kibana-plugin-core-public.app.keywords.md) | string[] | Optional keywords to match with in deep links search. Omit if this part of the hierarchy does not have a page URL. | -| [mount](./kibana-plugin-core-public.app.mount.md) | AppMount<HistoryLocationState> | A mount function called when the user navigates to this app's route. | -| [navLinkStatus](./kibana-plugin-core-public.app.navlinkstatus.md) | AppNavLinkStatus | The initial status of the application's navLink. Defaulting to visible if status is accessible and hidden if status is inaccessible See [AppNavLinkStatus](./kibana-plugin-core-public.appnavlinkstatus.md) | -| [searchable](./kibana-plugin-core-public.app.searchable.md) | boolean | The initial flag to determine if the application is searchable in the global search. Defaulting to true if navLinkStatus is visible or omitted. | -| [status](./kibana-plugin-core-public.app.status.md) | AppStatus | The initial status of the application. Defaulting to accessible | -| [title](./kibana-plugin-core-public.app.title.md) | string | The title of the application. | -| [updater$](./kibana-plugin-core-public.app.updater_.md) | Observable<AppUpdater> | An [AppUpdater](./kibana-plugin-core-public.appupdater.md) observable that can be used to update the application [AppUpdatableFields](./kibana-plugin-core-public.appupdatablefields.md) at runtime. | +| [appRoute?](./kibana-plugin-core-public.app.approute.md) | string | (Optional) Override the application's routing path from /app/${id}. Must be unique across registered applications. Should not include the base path from HTTP. | +| [capabilities?](./kibana-plugin-core-public.app.capabilities.md) | Partial<Capabilities> | (Optional) Custom capabilities defined by the app. | +| [category?](./kibana-plugin-core-public.app.category.md) | AppCategory | (Optional) The category definition of the product See [AppCategory](./kibana-plugin-core-public.appcategory.md) See DEFAULT\_APP\_CATEGORIES for more reference | +| [chromeless?](./kibana-plugin-core-public.app.chromeless.md) | boolean | (Optional) Hide the UI chrome when the application is mounted. Defaults to false. Takes precedence over chrome service visibility settings. | +| [deepLinks?](./kibana-plugin-core-public.app.deeplinks.md) | AppDeepLink\[\] | (Optional) Input type for registering secondary in-app locations for an application.Deep links must include at least one of path or deepLinks. A deep link that does not have a path represents a topological level in the application's hierarchy, but does not have a destination URL that is user-accessible. | +| [defaultPath?](./kibana-plugin-core-public.app.defaultpath.md) | string | (Optional) Allow to define the default path a user should be directed to when navigating to the app. When defined, this value will be used as a default for the path option when calling [navigateToApp](./kibana-plugin-core-public.applicationstart.navigatetoapp.md)\`, and will also be appended to the [application navLink](./kibana-plugin-core-public.chromenavlink.md) in the navigation bar. | +| [exactRoute?](./kibana-plugin-core-public.app.exactroute.md) | boolean | (Optional) If set to true, the application's route will only be checked against an exact match. Defaults to false. | +| [id](./kibana-plugin-core-public.app.id.md) | string | The unique identifier of the application | +| [keywords?](./kibana-plugin-core-public.app.keywords.md) | string\[\] | (Optional) Optional keywords to match with in deep links search. Omit if this part of the hierarchy does not have a page URL. | +| [mount](./kibana-plugin-core-public.app.mount.md) | AppMount<HistoryLocationState> | A mount function called when the user navigates to this app's route. | +| [navLinkStatus?](./kibana-plugin-core-public.app.navlinkstatus.md) | AppNavLinkStatus | (Optional) The initial status of the application's navLink. Defaulting to visible if status is accessible and hidden if status is inaccessible See [AppNavLinkStatus](./kibana-plugin-core-public.appnavlinkstatus.md) | +| [searchable?](./kibana-plugin-core-public.app.searchable.md) | boolean | (Optional) The initial flag to determine if the application is searchable in the global search. Defaulting to true if navLinkStatus is visible or omitted. | +| [status?](./kibana-plugin-core-public.app.status.md) | AppStatus | (Optional) The initial status of the application. Defaulting to accessible | +| [title](./kibana-plugin-core-public.app.title.md) | string | The title of the application. | +| [updater$?](./kibana-plugin-core-public.app.updater_.md) | Observable<AppUpdater> | (Optional) An [AppUpdater](./kibana-plugin-core-public.appupdater.md) observable that can be used to update the application [AppUpdatableFields](./kibana-plugin-core-public.appupdatablefields.md) at runtime. | diff --git a/docs/development/core/public/kibana-plugin-core-public.app.updater_.md b/docs/development/core/public/kibana-plugin-core-public.app.updater_.md index 67acccbd02965d..e6789a38f12f73 100644 --- a/docs/development/core/public/kibana-plugin-core-public.app.updater_.md +++ b/docs/development/core/public/kibana-plugin-core-public.app.updater_.md @@ -39,6 +39,5 @@ export class MyPlugin implements Plugin { navLinkStatus: AppNavLinkStatus.disabled, }) } - ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.appcategory.md b/docs/development/core/public/kibana-plugin-core-public.appcategory.md index b0ec377e165b6a..40c714b51b8bd5 100644 --- a/docs/development/core/public/kibana-plugin-core-public.appcategory.md +++ b/docs/development/core/public/kibana-plugin-core-public.appcategory.md @@ -16,9 +16,9 @@ export interface AppCategory | Property | Type | Description | | --- | --- | --- | -| [ariaLabel](./kibana-plugin-core-public.appcategory.arialabel.md) | string | If the visual label isn't appropriate for screen readers, can override it here | -| [euiIconType](./kibana-plugin-core-public.appcategory.euiicontype.md) | string | Define an icon to be used for the category If the category is only 1 item, and no icon is defined, will default to the product icon Defaults to initials if no icon is defined | -| [id](./kibana-plugin-core-public.appcategory.id.md) | string | Unique identifier for the categories | -| [label](./kibana-plugin-core-public.appcategory.label.md) | string | Label used for category name. Also used as aria-label if one isn't set. | -| [order](./kibana-plugin-core-public.appcategory.order.md) | number | The order that categories will be sorted in Prefer large steps between categories to allow for further editing (Default categories are in steps of 1000) | +| [ariaLabel?](./kibana-plugin-core-public.appcategory.arialabel.md) | string | (Optional) If the visual label isn't appropriate for screen readers, can override it here | +| [euiIconType?](./kibana-plugin-core-public.appcategory.euiicontype.md) | string | (Optional) Define an icon to be used for the category If the category is only 1 item, and no icon is defined, will default to the product icon Defaults to initials if no icon is defined | +| [id](./kibana-plugin-core-public.appcategory.id.md) | string | Unique identifier for the categories | +| [label](./kibana-plugin-core-public.appcategory.label.md) | string | Label used for category name. Also used as aria-label if one isn't set. | +| [order?](./kibana-plugin-core-public.appcategory.order.md) | number | (Optional) The order that categories will be sorted in Prefer large steps between categories to allow for further editing (Default categories are in steps of 1000) | diff --git a/docs/development/core/public/kibana-plugin-core-public.appleaveconfirmaction.md b/docs/development/core/public/kibana-plugin-core-public.appleaveconfirmaction.md index 8650cd98689401..e44fe49c27c8cc 100644 --- a/docs/development/core/public/kibana-plugin-core-public.appleaveconfirmaction.md +++ b/docs/development/core/public/kibana-plugin-core-public.appleaveconfirmaction.md @@ -18,8 +18,8 @@ export interface AppLeaveConfirmAction | Property | Type | Description | | --- | --- | --- | -| [callback](./kibana-plugin-core-public.appleaveconfirmaction.callback.md) | () => void | | -| [text](./kibana-plugin-core-public.appleaveconfirmaction.text.md) | string | | -| [title](./kibana-plugin-core-public.appleaveconfirmaction.title.md) | string | | -| [type](./kibana-plugin-core-public.appleaveconfirmaction.type.md) | AppLeaveActionType.confirm | | +| [callback?](./kibana-plugin-core-public.appleaveconfirmaction.callback.md) | () => void | (Optional) | +| [text](./kibana-plugin-core-public.appleaveconfirmaction.text.md) | string | | +| [title?](./kibana-plugin-core-public.appleaveconfirmaction.title.md) | string | (Optional) | +| [type](./kibana-plugin-core-public.appleaveconfirmaction.type.md) | AppLeaveActionType.confirm | | diff --git a/docs/development/core/public/kibana-plugin-core-public.appleavedefaultaction.md b/docs/development/core/public/kibana-plugin-core-public.appleavedefaultaction.md index f6df1c0516bd47..5d0e0d2a216e13 100644 --- a/docs/development/core/public/kibana-plugin-core-public.appleavedefaultaction.md +++ b/docs/development/core/public/kibana-plugin-core-public.appleavedefaultaction.md @@ -18,5 +18,5 @@ export interface AppLeaveDefaultAction | Property | Type | Description | | --- | --- | --- | -| [type](./kibana-plugin-core-public.appleavedefaultaction.type.md) | AppLeaveActionType.default | | +| [type](./kibana-plugin-core-public.appleavedefaultaction.type.md) | AppLeaveActionType.default | | diff --git a/docs/development/core/public/kibana-plugin-core-public.applicationsetup.register.md b/docs/development/core/public/kibana-plugin-core-public.applicationsetup.register.md index 6f4ecdc855df8c..e53b28e88d6ea9 100644 --- a/docs/development/core/public/kibana-plugin-core-public.applicationsetup.register.md +++ b/docs/development/core/public/kibana-plugin-core-public.applicationsetup.register.md @@ -16,9 +16,9 @@ register(app: App): void; | Parameter | Type | Description | | --- | --- | --- | -| app | App<HistoryLocationState> | an [App](./kibana-plugin-core-public.app.md) | +| app | App<HistoryLocationState> | an [App](./kibana-plugin-core-public.app.md) | Returns: -`void` +void diff --git a/docs/development/core/public/kibana-plugin-core-public.applicationsetup.registerappupdater.md b/docs/development/core/public/kibana-plugin-core-public.applicationsetup.registerappupdater.md index 88800913364fa8..6e8203fd68197a 100644 --- a/docs/development/core/public/kibana-plugin-core-public.applicationsetup.registerappupdater.md +++ b/docs/development/core/public/kibana-plugin-core-public.applicationsetup.registerappupdater.md @@ -18,11 +18,11 @@ registerAppUpdater(appUpdater$: Observable): void; | Parameter | Type | Description | | --- | --- | --- | -| appUpdater$ | Observable<AppUpdater> | | +| appUpdater$ | Observable<AppUpdater> | | Returns: -`void` +void ## Example @@ -42,6 +42,5 @@ export class MyPlugin implements Plugin { ); } } - ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.applicationstart.geturlforapp.md b/docs/development/core/public/kibana-plugin-core-public.applicationstart.geturlforapp.md index 6229aeb9238e8d..8bc89f617e1579 100644 --- a/docs/development/core/public/kibana-plugin-core-public.applicationstart.geturlforapp.md +++ b/docs/development/core/public/kibana-plugin-core-public.applicationstart.geturlforapp.md @@ -24,10 +24,10 @@ getUrlForApp(appId: string, options?: { | Parameter | Type | Description | | --- | --- | --- | -| appId | string | | -| options | {
path?: string;
absolute?: boolean;
deepLinkId?: string;
} | | +| appId | string | | +| options | { path?: string; absolute?: boolean; deepLinkId?: string; } | | Returns: -`string` +string diff --git a/docs/development/core/public/kibana-plugin-core-public.applicationstart.md b/docs/development/core/public/kibana-plugin-core-public.applicationstart.md index 993234d4c6e098..cadf0f91b01d67 100644 --- a/docs/development/core/public/kibana-plugin-core-public.applicationstart.md +++ b/docs/development/core/public/kibana-plugin-core-public.applicationstart.md @@ -15,9 +15,9 @@ export interface ApplicationStart | Property | Type | Description | | --- | --- | --- | -| [applications$](./kibana-plugin-core-public.applicationstart.applications_.md) | Observable<ReadonlyMap<string, PublicAppInfo>> | Observable emitting the list of currently registered apps and their associated status. | -| [capabilities](./kibana-plugin-core-public.applicationstart.capabilities.md) | RecursiveReadonly<Capabilities> | Gets the read-only capabilities. | -| [currentAppId$](./kibana-plugin-core-public.applicationstart.currentappid_.md) | Observable<string | undefined> | An observable that emits the current application id and each subsequent id update. | +| [applications$](./kibana-plugin-core-public.applicationstart.applications_.md) | Observable<ReadonlyMap<string, PublicAppInfo>> | Observable emitting the list of currently registered apps and their associated status. | +| [capabilities](./kibana-plugin-core-public.applicationstart.capabilities.md) | RecursiveReadonly<Capabilities> | Gets the read-only capabilities. | +| [currentAppId$](./kibana-plugin-core-public.applicationstart.currentappid_.md) | Observable<string \| undefined> | An observable that emits the current application id and each subsequent id update. | ## Methods diff --git a/docs/development/core/public/kibana-plugin-core-public.applicationstart.navigatetoapp.md b/docs/development/core/public/kibana-plugin-core-public.applicationstart.navigatetoapp.md index e1f08c7b381337..a6f87209148fd4 100644 --- a/docs/development/core/public/kibana-plugin-core-public.applicationstart.navigatetoapp.md +++ b/docs/development/core/public/kibana-plugin-core-public.applicationstart.navigatetoapp.md @@ -16,10 +16,10 @@ navigateToApp(appId: string, options?: NavigateToAppOptions): Promise; | Parameter | Type | Description | | --- | --- | --- | -| appId | string | | -| options | NavigateToAppOptions | navigation options | +| appId | string | | +| options | NavigateToAppOptions | navigation options | Returns: -`Promise` +Promise<void> diff --git a/docs/development/core/public/kibana-plugin-core-public.applicationstart.navigatetourl.md b/docs/development/core/public/kibana-plugin-core-public.applicationstart.navigatetourl.md index 8639394cbc4212..9e6644e2b1ca73 100644 --- a/docs/development/core/public/kibana-plugin-core-public.applicationstart.navigatetourl.md +++ b/docs/development/core/public/kibana-plugin-core-public.applicationstart.navigatetourl.md @@ -22,11 +22,11 @@ navigateToUrl(url: string): Promise; | Parameter | Type | Description | | --- | --- | --- | -| url | string | an absolute URL, an absolute path or a relative path, to navigate to. | +| url | string | an absolute URL, an absolute path or a relative path, to navigate to. | Returns: -`Promise` +Promise<void> ## Example @@ -45,6 +45,5 @@ application.navigateToUrl('/app/discover/some-path') // does not include the cur application.navigateToUrl('/base-path/s/my-space/app/unknown-app/some-path') // unknown application application.navigateToUrl('../discover') // resolve to `/base-path/s/my-space/discover` which is not a path of a known app. application.navigateToUrl('../../other-space/discover') // resolve to `/base-path/s/other-space/discover` which is not within the current basePath. - ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.appmountparameters.appbasepath.md b/docs/development/core/public/kibana-plugin-core-public.appmountparameters.appbasepath.md index b9ebcec6fa8e4c..fd16c78d4cbbf0 100644 --- a/docs/development/core/public/kibana-plugin-core-public.appmountparameters.appbasepath.md +++ b/docs/development/core/public/kibana-plugin-core-public.appmountparameters.appbasepath.md @@ -35,7 +35,6 @@ export class MyPlugin implements Plugin { }); } } - ``` ```ts @@ -58,6 +57,5 @@ export renderApp = ({ appBasePath, element }: AppMountParameters) => { return () => ReactDOM.unmountComponentAtNode(element); } - ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.appmountparameters.history.md b/docs/development/core/public/kibana-plugin-core-public.appmountparameters.history.md index 84f2c2564bfd9e..c22267eadbe285 100644 --- a/docs/development/core/public/kibana-plugin-core-public.appmountparameters.history.md +++ b/docs/development/core/public/kibana-plugin-core-public.appmountparameters.history.md @@ -30,7 +30,6 @@ export class MyPlugin implements Plugin { }); } } - ``` ```ts @@ -52,6 +51,5 @@ export renderApp = ({ element, history }: AppMountParameters) => { return () => ReactDOM.unmountComponentAtNode(element); } - ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.appmountparameters.md b/docs/development/core/public/kibana-plugin-core-public.appmountparameters.md index f6c57603beddec..d32faa55a5f868 100644 --- a/docs/development/core/public/kibana-plugin-core-public.appmountparameters.md +++ b/docs/development/core/public/kibana-plugin-core-public.appmountparameters.md @@ -15,9 +15,9 @@ export interface AppMountParameters | Property | Type | Description | | --- | --- | --- | -| [appBasePath](./kibana-plugin-core-public.appmountparameters.appbasepath.md) | string | The route path for configuring navigation to the application. This string should not include the base path from HTTP. | -| [element](./kibana-plugin-core-public.appmountparameters.element.md) | HTMLElement | The container element to render the application into. | -| [history](./kibana-plugin-core-public.appmountparameters.history.md) | ScopedHistory<HistoryLocationState> | A scoped history instance for your application. Should be used to wire up your applications Router. | -| [onAppLeave](./kibana-plugin-core-public.appmountparameters.onappleave.md) | (handler: AppLeaveHandler) => void | A function that can be used to register a handler that will be called when the user is leaving the current application, allowing to prompt a confirmation message before actually changing the page.This will be called either when the user goes to another application, or when trying to close the tab or manually changing the url. | -| [setHeaderActionMenu](./kibana-plugin-core-public.appmountparameters.setheaderactionmenu.md) | (menuMount: MountPoint | undefined) => void | A function that can be used to set the mount point used to populate the application action container in the chrome header.Calling the handler multiple time will erase the current content of the action menu with the mount from the latest call. Calling the handler with undefined will unmount the current mount point. Calling the handler after the application has been unmounted will have no effect. | +| [appBasePath](./kibana-plugin-core-public.appmountparameters.appbasepath.md) | string | The route path for configuring navigation to the application. This string should not include the base path from HTTP. | +| [element](./kibana-plugin-core-public.appmountparameters.element.md) | HTMLElement | The container element to render the application into. | +| [history](./kibana-plugin-core-public.appmountparameters.history.md) | ScopedHistory<HistoryLocationState> | A scoped history instance for your application. Should be used to wire up your applications Router. | +| [onAppLeave](./kibana-plugin-core-public.appmountparameters.onappleave.md) | (handler: AppLeaveHandler) => void | A function that can be used to register a handler that will be called when the user is leaving the current application, allowing to prompt a confirmation message before actually changing the page.This will be called either when the user goes to another application, or when trying to close the tab or manually changing the url. | +| [setHeaderActionMenu](./kibana-plugin-core-public.appmountparameters.setheaderactionmenu.md) | (menuMount: MountPoint \| undefined) => void | A function that can be used to set the mount point used to populate the application action container in the chrome header.Calling the handler multiple time will erase the current content of the action menu with the mount from the latest call. Calling the handler with undefined will unmount the current mount point. Calling the handler after the application has been unmounted will have no effect. | diff --git a/docs/development/core/public/kibana-plugin-core-public.appmountparameters.onappleave.md b/docs/development/core/public/kibana-plugin-core-public.appmountparameters.onappleave.md index e64e40a49e44e0..fa75e3e4084a69 100644 --- a/docs/development/core/public/kibana-plugin-core-public.appmountparameters.onappleave.md +++ b/docs/development/core/public/kibana-plugin-core-public.appmountparameters.onappleave.md @@ -41,6 +41,5 @@ export renderApp = ({ element, history, onAppLeave }: AppMountParameters) => { }); return renderApp({ element, history }); } - ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.appmountparameters.setheaderactionmenu.md b/docs/development/core/public/kibana-plugin-core-public.appmountparameters.setheaderactionmenu.md index ca9cee64bb1f92..715e1ba4bf2914 100644 --- a/docs/development/core/public/kibana-plugin-core-public.appmountparameters.setheaderactionmenu.md +++ b/docs/development/core/public/kibana-plugin-core-public.appmountparameters.setheaderactionmenu.md @@ -34,6 +34,5 @@ export renderApp = ({ element, history, setHeaderActionMenu }: AppMountParameter }) return renderApp({ element, history }); } - ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.appnavoptions.md b/docs/development/core/public/kibana-plugin-core-public.appnavoptions.md index cb5ae936988dc8..c6c583b7a90986 100644 --- a/docs/development/core/public/kibana-plugin-core-public.appnavoptions.md +++ b/docs/development/core/public/kibana-plugin-core-public.appnavoptions.md @@ -16,8 +16,8 @@ export interface AppNavOptions | Property | Type | Description | | --- | --- | --- | -| [euiIconType](./kibana-plugin-core-public.appnavoptions.euiicontype.md) | string | A EUI iconType that will be used for the app's icon. This icon takes precedence over the icon property. | -| [icon](./kibana-plugin-core-public.appnavoptions.icon.md) | string | A URL to an image file used as an icon. Used as a fallback if euiIconType is not provided. | -| [order](./kibana-plugin-core-public.appnavoptions.order.md) | number | An ordinal used to sort nav links relative to one another for display. | -| [tooltip](./kibana-plugin-core-public.appnavoptions.tooltip.md) | string | A tooltip shown when hovering over app link. | +| [euiIconType?](./kibana-plugin-core-public.appnavoptions.euiicontype.md) | string | (Optional) A EUI iconType that will be used for the app's icon. This icon takes precedence over the icon property. | +| [icon?](./kibana-plugin-core-public.appnavoptions.icon.md) | string | (Optional) A URL to an image file used as an icon. Used as a fallback if euiIconType is not provided. | +| [order?](./kibana-plugin-core-public.appnavoptions.order.md) | number | (Optional) An ordinal used to sort nav links relative to one another for display. | +| [tooltip?](./kibana-plugin-core-public.appnavoptions.tooltip.md) | string | (Optional) A tooltip shown when hovering over app link. | diff --git a/docs/development/core/public/kibana-plugin-core-public.asyncplugin.md b/docs/development/core/public/kibana-plugin-core-public.asyncplugin.md index cf315e1fd337e3..cb9559dddc6849 100644 --- a/docs/development/core/public/kibana-plugin-core-public.asyncplugin.md +++ b/docs/development/core/public/kibana-plugin-core-public.asyncplugin.md @@ -6,7 +6,7 @@ > Warning: This API is now obsolete. > -> Asynchronous lifecycles are deprecated, and should be migrated to sync [plugin](./kibana-plugin-core-public.plugin.md) +> Asynchronous lifecycles are deprecated, and should be migrated to sync > A plugin with asynchronous lifecycle methods. @@ -23,5 +23,5 @@ export interface AsyncPlugin(Optional) | diff --git a/docs/development/core/public/kibana-plugin-core-public.asyncplugin.setup.md b/docs/development/core/public/kibana-plugin-core-public.asyncplugin.setup.md index 54507b44cdd72a..67a5dad22a0a20 100644 --- a/docs/development/core/public/kibana-plugin-core-public.asyncplugin.setup.md +++ b/docs/development/core/public/kibana-plugin-core-public.asyncplugin.setup.md @@ -14,10 +14,10 @@ setup(core: CoreSetup, plugins: TPluginsSetup): TSetup | | Parameter | Type | Description | | --- | --- | --- | -| core | CoreSetup<TPluginsStart, TStart> | | -| plugins | TPluginsSetup | | +| core | CoreSetup<TPluginsStart, TStart> | | +| plugins | TPluginsSetup | | Returns: -`TSetup | Promise` +TSetup \| Promise<TSetup> diff --git a/docs/development/core/public/kibana-plugin-core-public.asyncplugin.start.md b/docs/development/core/public/kibana-plugin-core-public.asyncplugin.start.md index f16d3c46bf8499..89554a1afaf1a2 100644 --- a/docs/development/core/public/kibana-plugin-core-public.asyncplugin.start.md +++ b/docs/development/core/public/kibana-plugin-core-public.asyncplugin.start.md @@ -14,10 +14,10 @@ start(core: CoreStart, plugins: TPluginsStart): TStart | Promise; | Parameter | Type | Description | | --- | --- | --- | -| core | CoreStart | | -| plugins | TPluginsStart | | +| core | CoreStart | | +| plugins | TPluginsStart | | Returns: -`TStart | Promise` +TStart \| Promise<TStart> diff --git a/docs/development/core/public/kibana-plugin-core-public.asyncplugin.stop.md b/docs/development/core/public/kibana-plugin-core-public.asyncplugin.stop.md index f809f75783c26c..3fb7504879cf66 100644 --- a/docs/development/core/public/kibana-plugin-core-public.asyncplugin.stop.md +++ b/docs/development/core/public/kibana-plugin-core-public.asyncplugin.stop.md @@ -11,5 +11,5 @@ stop?(): void; ``` Returns: -`void` +void diff --git a/docs/development/core/public/kibana-plugin-core-public.capabilities.md b/docs/development/core/public/kibana-plugin-core-public.capabilities.md index 077899a4847d5d..e908bd554d88dc 100644 --- a/docs/development/core/public/kibana-plugin-core-public.capabilities.md +++ b/docs/development/core/public/kibana-plugin-core-public.capabilities.md @@ -16,7 +16,7 @@ export interface Capabilities | Property | Type | Description | | --- | --- | --- | -| [catalogue](./kibana-plugin-core-public.capabilities.catalogue.md) | Record<string, boolean> | Catalogue capabilities. Catalogue entries drive the visibility of the Kibana homepage options. | -| [management](./kibana-plugin-core-public.capabilities.management.md) | {
[sectionId: string]: Record<string, boolean>;
} | Management section capabilities. | -| [navLinks](./kibana-plugin-core-public.capabilities.navlinks.md) | Record<string, boolean> | Navigation link capabilities. | +| [catalogue](./kibana-plugin-core-public.capabilities.catalogue.md) | Record<string, boolean> | Catalogue capabilities. Catalogue entries drive the visibility of the Kibana homepage options. | +| [management](./kibana-plugin-core-public.capabilities.management.md) | { \[sectionId: string\]: Record<string, boolean>; } | Management section capabilities. | +| [navLinks](./kibana-plugin-core-public.capabilities.navlinks.md) | Record<string, boolean> | Navigation link capabilities. | diff --git a/docs/development/core/public/kibana-plugin-core-public.chromebadge.md b/docs/development/core/public/kibana-plugin-core-public.chromebadge.md index 0af3e5f367556c..e2e4d1910fdd51 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromebadge.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromebadge.md @@ -15,7 +15,7 @@ export interface ChromeBadge | Property | Type | Description | | --- | --- | --- | -| [iconType](./kibana-plugin-core-public.chromebadge.icontype.md) | IconType | | -| [text](./kibana-plugin-core-public.chromebadge.text.md) | string | | -| [tooltip](./kibana-plugin-core-public.chromebadge.tooltip.md) | string | | +| [iconType?](./kibana-plugin-core-public.chromebadge.icontype.md) | IconType | (Optional) | +| [text](./kibana-plugin-core-public.chromebadge.text.md) | string | | +| [tooltip](./kibana-plugin-core-public.chromebadge.tooltip.md) | string | | diff --git a/docs/development/core/public/kibana-plugin-core-public.chromedoctitle.change.md b/docs/development/core/public/kibana-plugin-core-public.chromedoctitle.change.md index aa44f38df15a97..cf31d16cae0e0e 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromedoctitle.change.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromedoctitle.change.md @@ -16,11 +16,11 @@ change(newTitle: string | string[]): void; | Parameter | Type | Description | | --- | --- | --- | -| newTitle | string | string[] | | +| newTitle | string \| string\[\] | The new title to set, either a string or string array | Returns: -`void` +void ## Example @@ -29,6 +29,5 @@ How to change the title of the document ```ts chrome.docTitle.change('My application title') chrome.docTitle.change(['My application', 'My section']) - ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.chromedoctitle.md b/docs/development/core/public/kibana-plugin-core-public.chromedoctitle.md index 5a6ab40d52d7ae..48e04b648e8d82 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromedoctitle.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromedoctitle.md @@ -18,7 +18,6 @@ How to change the title of the document ```ts chrome.docTitle.change('My application') - ``` ## Example 2 @@ -27,7 +26,6 @@ How to reset the title of the document to it's initial value ```ts chrome.docTitle.reset() - ``` ## Methods diff --git a/docs/development/core/public/kibana-plugin-core-public.chromedoctitle.reset.md b/docs/development/core/public/kibana-plugin-core-public.chromedoctitle.reset.md index ac38db8d289352..e11635fd6d3f89 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromedoctitle.reset.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromedoctitle.reset.md @@ -13,5 +13,5 @@ reset(): void; ``` Returns: -`void` +void diff --git a/docs/development/core/public/kibana-plugin-core-public.chromehelpextension.md b/docs/development/core/public/kibana-plugin-core-public.chromehelpextension.md index d90a9bf70486fa..07fda8d926a299 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromehelpextension.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromehelpextension.md @@ -15,7 +15,7 @@ export interface ChromeHelpExtension | Property | Type | Description | | --- | --- | --- | -| [appName](./kibana-plugin-core-public.chromehelpextension.appname.md) | string | Provide your plugin's name to create a header for separation | -| [content](./kibana-plugin-core-public.chromehelpextension.content.md) | (element: HTMLDivElement) => () => void | Custom content to occur below the list of links | -| [links](./kibana-plugin-core-public.chromehelpextension.links.md) | ChromeHelpExtensionMenuLink[] | Creates unified links for sending users to documentation, GitHub, Discuss, or a custom link/button | +| [appName](./kibana-plugin-core-public.chromehelpextension.appname.md) | string | Provide your plugin's name to create a header for separation | +| [content?](./kibana-plugin-core-public.chromehelpextension.content.md) | (element: HTMLDivElement) => () => void | (Optional) Custom content to occur below the list of links | +| [links?](./kibana-plugin-core-public.chromehelpextension.links.md) | ChromeHelpExtensionMenuLink\[\] | (Optional) Creates unified links for sending users to documentation, GitHub, Discuss, or a custom link/button | diff --git a/docs/development/core/public/kibana-plugin-core-public.chromehelpextensionmenucustomlink.md b/docs/development/core/public/kibana-plugin-core-public.chromehelpextensionmenucustomlink.md index ff4978e69df62a..daf724c72c23e3 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromehelpextensionmenucustomlink.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromehelpextensionmenucustomlink.md @@ -10,12 +10,13 @@ ```typescript export interface ChromeHelpExtensionMenuCustomLink extends ChromeHelpExtensionLinkBase ``` +Extends: ChromeHelpExtensionLinkBase ## Properties | Property | Type | Description | | --- | --- | --- | -| [content](./kibana-plugin-core-public.chromehelpextensionmenucustomlink.content.md) | React.ReactNode | Content of the button (in lieu of children) | -| [href](./kibana-plugin-core-public.chromehelpextensionmenucustomlink.href.md) | string | URL of the link | -| [linkType](./kibana-plugin-core-public.chromehelpextensionmenucustomlink.linktype.md) | 'custom' | Extend EuiButtonEmpty to provide extra functionality | +| [content](./kibana-plugin-core-public.chromehelpextensionmenucustomlink.content.md) | React.ReactNode | Content of the button (in lieu of children) | +| [href](./kibana-plugin-core-public.chromehelpextensionmenucustomlink.href.md) | string | URL of the link | +| [linkType](./kibana-plugin-core-public.chromehelpextensionmenucustomlink.linktype.md) | 'custom' | Extend EuiButtonEmpty to provide extra functionality | diff --git a/docs/development/core/public/kibana-plugin-core-public.chromehelpextensionmenudiscusslink.md b/docs/development/core/public/kibana-plugin-core-public.chromehelpextensionmenudiscusslink.md index a73f6daad28c23..3dc32fcb6d87ff 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromehelpextensionmenudiscusslink.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromehelpextensionmenudiscusslink.md @@ -10,11 +10,12 @@ ```typescript export interface ChromeHelpExtensionMenuDiscussLink extends ChromeHelpExtensionLinkBase ``` +Extends: ChromeHelpExtensionLinkBase ## Properties | Property | Type | Description | | --- | --- | --- | -| [href](./kibana-plugin-core-public.chromehelpextensionmenudiscusslink.href.md) | string | URL to discuss page. i.e. https://discuss.elastic.co/c/${appName} | -| [linkType](./kibana-plugin-core-public.chromehelpextensionmenudiscusslink.linktype.md) | 'discuss' | Creates a generic give feedback link with comment icon | +| [href](./kibana-plugin-core-public.chromehelpextensionmenudiscusslink.href.md) | string | URL to discuss page. i.e. https://discuss.elastic.co/c/${appName} | +| [linkType](./kibana-plugin-core-public.chromehelpextensionmenudiscusslink.linktype.md) | 'discuss' | Creates a generic give feedback link with comment icon | diff --git a/docs/development/core/public/kibana-plugin-core-public.chromehelpextensionmenudocumentationlink.md b/docs/development/core/public/kibana-plugin-core-public.chromehelpextensionmenudocumentationlink.md index fab49d06d47748..d20b513b1c5500 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromehelpextensionmenudocumentationlink.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromehelpextensionmenudocumentationlink.md @@ -10,11 +10,12 @@ ```typescript export interface ChromeHelpExtensionMenuDocumentationLink extends ChromeHelpExtensionLinkBase ``` +Extends: ChromeHelpExtensionLinkBase ## Properties | Property | Type | Description | | --- | --- | --- | -| [href](./kibana-plugin-core-public.chromehelpextensionmenudocumentationlink.href.md) | string | URL to documentation page. i.e. ${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/${appName}.html, | -| [linkType](./kibana-plugin-core-public.chromehelpextensionmenudocumentationlink.linktype.md) | 'documentation' | Creates a deep-link to app-specific documentation | +| [href](./kibana-plugin-core-public.chromehelpextensionmenudocumentationlink.href.md) | string | URL to documentation page. i.e. ${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/${appName}.html, | +| [linkType](./kibana-plugin-core-public.chromehelpextensionmenudocumentationlink.linktype.md) | 'documentation' | Creates a deep-link to app-specific documentation | diff --git a/docs/development/core/public/kibana-plugin-core-public.chromehelpextensionmenugithublink.md b/docs/development/core/public/kibana-plugin-core-public.chromehelpextensionmenugithublink.md index ca9ceecffa6f13..56eee43d26902d 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromehelpextensionmenugithublink.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromehelpextensionmenugithublink.md @@ -10,12 +10,13 @@ ```typescript export interface ChromeHelpExtensionMenuGitHubLink extends ChromeHelpExtensionLinkBase ``` +Extends: ChromeHelpExtensionLinkBase ## Properties | Property | Type | Description | | --- | --- | --- | -| [labels](./kibana-plugin-core-public.chromehelpextensionmenugithublink.labels.md) | string[] | Include at least one app-specific label to be applied to the new github issue | -| [linkType](./kibana-plugin-core-public.chromehelpextensionmenugithublink.linktype.md) | 'github' | Creates a link to a new github issue in the Kibana repo | -| [title](./kibana-plugin-core-public.chromehelpextensionmenugithublink.title.md) | string | Provides initial text for the title of the issue | +| [labels](./kibana-plugin-core-public.chromehelpextensionmenugithublink.labels.md) | string\[\] | Include at least one app-specific label to be applied to the new github issue | +| [linkType](./kibana-plugin-core-public.chromehelpextensionmenugithublink.linktype.md) | 'github' | Creates a link to a new github issue in the Kibana repo | +| [title?](./kibana-plugin-core-public.chromehelpextensionmenugithublink.title.md) | string | (Optional) Provides initial text for the title of the issue | diff --git a/docs/development/core/public/kibana-plugin-core-public.chromenavcontrol.md b/docs/development/core/public/kibana-plugin-core-public.chromenavcontrol.md index 0fad08fdbce819..c0371078c28a4a 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromenavcontrol.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromenavcontrol.md @@ -15,6 +15,6 @@ export interface ChromeNavControl | Property | Type | Description | | --- | --- | --- | -| [mount](./kibana-plugin-core-public.chromenavcontrol.mount.md) | MountPoint | | -| [order](./kibana-plugin-core-public.chromenavcontrol.order.md) | number | | +| [mount](./kibana-plugin-core-public.chromenavcontrol.mount.md) | MountPoint | | +| [order?](./kibana-plugin-core-public.chromenavcontrol.order.md) | number | (Optional) | diff --git a/docs/development/core/public/kibana-plugin-core-public.chromenavcontrols.md b/docs/development/core/public/kibana-plugin-core-public.chromenavcontrols.md index 47365782599eda..72018d46428a48 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromenavcontrols.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromenavcontrols.md @@ -23,7 +23,6 @@ chrome.navControls.registerLeft({ return () => ReactDOM.unmountComponentAtNode(targetDomElement); } }) - ``` ## Methods diff --git a/docs/development/core/public/kibana-plugin-core-public.chromenavcontrols.registercenter.md b/docs/development/core/public/kibana-plugin-core-public.chromenavcontrols.registercenter.md index 2f921050e58dd3..68b243bf47f85e 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromenavcontrols.registercenter.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromenavcontrols.registercenter.md @@ -16,9 +16,9 @@ registerCenter(navControl: ChromeNavControl): void; | Parameter | Type | Description | | --- | --- | --- | -| navControl | ChromeNavControl | | +| navControl | ChromeNavControl | | Returns: -`void` +void diff --git a/docs/development/core/public/kibana-plugin-core-public.chromenavcontrols.registerleft.md b/docs/development/core/public/kibana-plugin-core-public.chromenavcontrols.registerleft.md index 514c44bd9d7102..ee0789c285f0ba 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromenavcontrols.registerleft.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromenavcontrols.registerleft.md @@ -16,9 +16,9 @@ registerLeft(navControl: ChromeNavControl): void; | Parameter | Type | Description | | --- | --- | --- | -| navControl | ChromeNavControl | | +| navControl | ChromeNavControl | | Returns: -`void` +void diff --git a/docs/development/core/public/kibana-plugin-core-public.chromenavcontrols.registerright.md b/docs/development/core/public/kibana-plugin-core-public.chromenavcontrols.registerright.md index eb56e0e38c6c9e..9091736c62eebd 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromenavcontrols.registerright.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromenavcontrols.registerright.md @@ -16,9 +16,9 @@ registerRight(navControl: ChromeNavControl): void; | Parameter | Type | Description | | --- | --- | --- | -| navControl | ChromeNavControl | | +| navControl | ChromeNavControl | | Returns: -`void` +void diff --git a/docs/development/core/public/kibana-plugin-core-public.chromenavlink.md b/docs/development/core/public/kibana-plugin-core-public.chromenavlink.md index c7dd461617e344..964f4d4b86aaa4 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromenavlink.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromenavlink.md @@ -15,16 +15,16 @@ export interface ChromeNavLink | Property | Type | Description | | --- | --- | --- | -| [baseUrl](./kibana-plugin-core-public.chromenavlink.baseurl.md) | string | The base route used to open the root of an application. | -| [category](./kibana-plugin-core-public.chromenavlink.category.md) | AppCategory | The category the app lives in | -| [disabled](./kibana-plugin-core-public.chromenavlink.disabled.md) | boolean | Disables a link from being clickable. | -| [euiIconType](./kibana-plugin-core-public.chromenavlink.euiicontype.md) | string | A EUI iconType that will be used for the app's icon. This icon takes precedence over the icon property. | -| [hidden](./kibana-plugin-core-public.chromenavlink.hidden.md) | boolean | Hides a link from the navigation. | -| [href](./kibana-plugin-core-public.chromenavlink.href.md) | string | Settled state between url, baseUrl, and active | -| [icon](./kibana-plugin-core-public.chromenavlink.icon.md) | string | A URL to an image file used as an icon. Used as a fallback if euiIconType is not provided. | -| [id](./kibana-plugin-core-public.chromenavlink.id.md) | string | A unique identifier for looking up links. | -| [order](./kibana-plugin-core-public.chromenavlink.order.md) | number | An ordinal used to sort nav links relative to one another for display. | -| [title](./kibana-plugin-core-public.chromenavlink.title.md) | string | The title of the application. | -| [tooltip](./kibana-plugin-core-public.chromenavlink.tooltip.md) | string | A tooltip shown when hovering over an app link. | -| [url](./kibana-plugin-core-public.chromenavlink.url.md) | string | The route used to open the default path and the deep links of an application. | +| [baseUrl](./kibana-plugin-core-public.chromenavlink.baseurl.md) | string | The base route used to open the root of an application. | +| [category?](./kibana-plugin-core-public.chromenavlink.category.md) | AppCategory | (Optional) The category the app lives in | +| [disabled?](./kibana-plugin-core-public.chromenavlink.disabled.md) | boolean | (Optional) Disables a link from being clickable. | +| [euiIconType?](./kibana-plugin-core-public.chromenavlink.euiicontype.md) | string | (Optional) A EUI iconType that will be used for the app's icon. This icon takes precedence over the icon property. | +| [hidden?](./kibana-plugin-core-public.chromenavlink.hidden.md) | boolean | (Optional) Hides a link from the navigation. | +| [href](./kibana-plugin-core-public.chromenavlink.href.md) | string | Settled state between url, baseUrl, and active | +| [icon?](./kibana-plugin-core-public.chromenavlink.icon.md) | string | (Optional) A URL to an image file used as an icon. Used as a fallback if euiIconType is not provided. | +| [id](./kibana-plugin-core-public.chromenavlink.id.md) | string | A unique identifier for looking up links. | +| [order?](./kibana-plugin-core-public.chromenavlink.order.md) | number | (Optional) An ordinal used to sort nav links relative to one another for display. | +| [title](./kibana-plugin-core-public.chromenavlink.title.md) | string | The title of the application. | +| [tooltip?](./kibana-plugin-core-public.chromenavlink.tooltip.md) | string | (Optional) A tooltip shown when hovering over an app link. | +| [url](./kibana-plugin-core-public.chromenavlink.url.md) | string | The route used to open the default path and the deep links of an application. | diff --git a/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.enableforcedappswitchernavigation.md b/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.enableforcedappswitchernavigation.md index b65ad2b17c1e12..4f9b6aaada5dbe 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.enableforcedappswitchernavigation.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.enableforcedappswitchernavigation.md @@ -13,7 +13,7 @@ enableForcedAppSwitcherNavigation(): void; ``` Returns: -`void` +void ## Remarks diff --git a/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.get.md b/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.get.md index f616f99f639ee2..796d99b9b0e0c5 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.get.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.get.md @@ -16,9 +16,9 @@ get(id: string): ChromeNavLink | undefined; | Parameter | Type | Description | | --- | --- | --- | -| id | string | | +| id | string | | Returns: -`ChromeNavLink | undefined` +ChromeNavLink \| undefined diff --git a/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.getall.md b/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.getall.md index 94a7b25160af7f..08d5707fe32515 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.getall.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.getall.md @@ -13,5 +13,5 @@ getAll(): Array>; ``` Returns: -`Array>` +Array<Readonly<ChromeNavLink>> diff --git a/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.getforceappswitchernavigation_.md b/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.getforceappswitchernavigation_.md index ded2c8c08ba497..3b87790c37297b 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.getforceappswitchernavigation_.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.getforceappswitchernavigation_.md @@ -13,5 +13,5 @@ getForceAppSwitcherNavigation$(): Observable; ``` Returns: -`Observable` +Observable<boolean> diff --git a/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.getnavlinks_.md b/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.getnavlinks_.md index d93b4381271e08..8ee5c0fb83081b 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.getnavlinks_.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.getnavlinks_.md @@ -13,5 +13,5 @@ getNavLinks$(): Observable>>; ``` Returns: -`Observable>>` +Observable<Array<Readonly<ChromeNavLink>>> diff --git a/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.has.md b/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.has.md index abef76582cef16..dfaae86a9d8910 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.has.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.has.md @@ -16,9 +16,9 @@ has(id: string): boolean; | Parameter | Type | Description | | --- | --- | --- | -| id | string | | +| id | string | | Returns: -`boolean` +boolean diff --git a/docs/development/core/public/kibana-plugin-core-public.chromerecentlyaccessed.add.md b/docs/development/core/public/kibana-plugin-core-public.chromerecentlyaccessed.add.md index 329105394e41c9..5c99c6bf7fbcb6 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromerecentlyaccessed.add.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromerecentlyaccessed.add.md @@ -16,19 +16,18 @@ add(link: string, label: string, id: string): void; | Parameter | Type | Description | | --- | --- | --- | -| link | string | | -| label | string | | -| id | string | | +| link | string | a relative URL to the resource (not including the ) | +| label | string | the label to display in the UI | +| id | string | a unique string used to de-duplicate the recently accessed list. | Returns: -`void` +void ## Example ```js chrome.recentlyAccessed.add('/app/map/1234', 'Map 1234', '1234'); - ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.chromerecentlyaccessed.get.md b/docs/development/core/public/kibana-plugin-core-public.chromerecentlyaccessed.get.md index b0d66e25d1fe09..da696737b3bb7c 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromerecentlyaccessed.get.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromerecentlyaccessed.get.md @@ -13,13 +13,12 @@ get(): ChromeRecentlyAccessedHistoryItem[]; ``` Returns: -`ChromeRecentlyAccessedHistoryItem[]` +ChromeRecentlyAccessedHistoryItem\[\] ## Example ```js chrome.recentlyAccessed.get().forEach(console.log); - ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.chromerecentlyaccessed.get_.md b/docs/development/core/public/kibana-plugin-core-public.chromerecentlyaccessed.get_.md index da53c6535b25d4..4655289642f997 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromerecentlyaccessed.get_.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromerecentlyaccessed.get_.md @@ -13,13 +13,12 @@ get$(): Observable; ``` Returns: -`Observable` +Observable<ChromeRecentlyAccessedHistoryItem\[\]> ## Example ```js chrome.recentlyAccessed.get$().subscribe(console.log); - ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.chromerecentlyaccessedhistoryitem.md b/docs/development/core/public/kibana-plugin-core-public.chromerecentlyaccessedhistoryitem.md index e07492f883e534..3b67b41d37a35e 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromerecentlyaccessedhistoryitem.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromerecentlyaccessedhistoryitem.md @@ -15,7 +15,7 @@ export interface ChromeRecentlyAccessedHistoryItem | Property | Type | Description | | --- | --- | --- | -| [id](./kibana-plugin-core-public.chromerecentlyaccessedhistoryitem.id.md) | string | | -| [label](./kibana-plugin-core-public.chromerecentlyaccessedhistoryitem.label.md) | string | | -| [link](./kibana-plugin-core-public.chromerecentlyaccessedhistoryitem.link.md) | string | | +| [id](./kibana-plugin-core-public.chromerecentlyaccessedhistoryitem.id.md) | string | | +| [label](./kibana-plugin-core-public.chromerecentlyaccessedhistoryitem.label.md) | string | | +| [link](./kibana-plugin-core-public.chromerecentlyaccessedhistoryitem.link.md) | string | | diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.getbadge_.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.getbadge_.md index 586a61a9f214ac..d3dc459bae9deb 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.getbadge_.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromestart.getbadge_.md @@ -13,5 +13,5 @@ getBadge$(): Observable; ``` Returns: -`Observable` +Observable<ChromeBadge \| undefined> diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.getbreadcrumbs_.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.getbreadcrumbs_.md index 155f3423d69e4b..c4d3751549b162 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.getbreadcrumbs_.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromestart.getbreadcrumbs_.md @@ -13,5 +13,5 @@ getBreadcrumbs$(): Observable; ``` Returns: -`Observable` +Observable<ChromeBreadcrumb\[\]> diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.getbreadcrumbsappendextension_.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.getbreadcrumbsappendextension_.md index dfe25c5c9e42d0..21c12514debecb 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.getbreadcrumbsappendextension_.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromestart.getbreadcrumbsappendextension_.md @@ -13,5 +13,5 @@ getBreadcrumbsAppendExtension$(): ObservableReturns: -`Observable` +Observable<ChromeBreadcrumbsAppendExtension \| undefined> diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.getcustomnavlink_.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.getcustomnavlink_.md index 64805eefbfea1f..59346a409562ea 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.getcustomnavlink_.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromestart.getcustomnavlink_.md @@ -13,5 +13,5 @@ getCustomNavLink$(): Observable | undefined>; ``` Returns: -`Observable | undefined>` +Observable<Partial<ChromeNavLink> \| undefined> diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.gethelpextension_.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.gethelpextension_.md index 90c42a98bd60a4..052bbe2630f706 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.gethelpextension_.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromestart.gethelpextension_.md @@ -13,5 +13,5 @@ getHelpExtension$(): Observable; ``` Returns: -`Observable` +Observable<ChromeHelpExtension \| undefined> diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.getisnavdrawerlocked_.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.getisnavdrawerlocked_.md index 78a4442a651e6a..12aa71366aaac9 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.getisnavdrawerlocked_.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromestart.getisnavdrawerlocked_.md @@ -13,5 +13,5 @@ getIsNavDrawerLocked$(): Observable; ``` Returns: -`Observable` +Observable<boolean> diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.getisvisible_.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.getisvisible_.md index b6204a19139091..70a9c832926e11 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.getisvisible_.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromestart.getisvisible_.md @@ -13,5 +13,5 @@ getIsVisible$(): Observable; ``` Returns: -`Observable` +Observable<boolean> diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.hasheaderbanner_.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.hasheaderbanner_.md index 6ce0671eb52305..66dd1e2562f50d 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.hasheaderbanner_.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromestart.hasheaderbanner_.md @@ -13,5 +13,5 @@ hasHeaderBanner$(): Observable; ``` Returns: -`Observable` +Observable<boolean> diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.md index ffc77dd653c0f8..3e672fbc14d754 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromestart.md @@ -22,7 +22,6 @@ How to add a recently accessed item to the sidebar: ```ts core.chrome.recentlyAccessed.add('/app/map/1234', 'Map 1234', '1234'); - ``` ## Example 2 @@ -34,17 +33,16 @@ core.chrome.setHelpExtension(elem => { ReactDOM.render(, elem); return () => ReactDOM.unmountComponentAtNode(elem); }); - ``` ## Properties | Property | Type | Description | | --- | --- | --- | -| [docTitle](./kibana-plugin-core-public.chromestart.doctitle.md) | ChromeDocTitle | APIs for accessing and updating the document title. | -| [navControls](./kibana-plugin-core-public.chromestart.navcontrols.md) | ChromeNavControls | [APIs](./kibana-plugin-core-public.chromenavcontrols.md) for registering new controls to be displayed in the navigation bar. | -| [navLinks](./kibana-plugin-core-public.chromestart.navlinks.md) | ChromeNavLinks | [APIs](./kibana-plugin-core-public.chromenavlinks.md) for manipulating nav links. | -| [recentlyAccessed](./kibana-plugin-core-public.chromestart.recentlyaccessed.md) | ChromeRecentlyAccessed | [APIs](./kibana-plugin-core-public.chromerecentlyaccessed.md) for recently accessed history. | +| [docTitle](./kibana-plugin-core-public.chromestart.doctitle.md) | ChromeDocTitle | APIs for accessing and updating the document title. | +| [navControls](./kibana-plugin-core-public.chromestart.navcontrols.md) | ChromeNavControls | [APIs](./kibana-plugin-core-public.chromenavcontrols.md) for registering new controls to be displayed in the navigation bar. | +| [navLinks](./kibana-plugin-core-public.chromestart.navlinks.md) | ChromeNavLinks | [APIs](./kibana-plugin-core-public.chromenavlinks.md) for manipulating nav links. | +| [recentlyAccessed](./kibana-plugin-core-public.chromestart.recentlyaccessed.md) | ChromeRecentlyAccessed | [APIs](./kibana-plugin-core-public.chromerecentlyaccessed.md) for recently accessed history. | ## Methods diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.setbadge.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.setbadge.md index 52e807658d238d..7e974b139d1416 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.setbadge.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromestart.setbadge.md @@ -16,9 +16,9 @@ setBadge(badge?: ChromeBadge): void; | Parameter | Type | Description | | --- | --- | --- | -| badge | ChromeBadge | | +| badge | ChromeBadge | | Returns: -`void` +void diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.setbreadcrumbs.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.setbreadcrumbs.md index 80a1514ef7652c..f44e3e6cfd5621 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.setbreadcrumbs.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromestart.setbreadcrumbs.md @@ -16,9 +16,9 @@ setBreadcrumbs(newBreadcrumbs: ChromeBreadcrumb[]): void; | Parameter | Type | Description | | --- | --- | --- | -| newBreadcrumbs | ChromeBreadcrumb[] | | +| newBreadcrumbs | ChromeBreadcrumb\[\] | | Returns: -`void` +void diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.setbreadcrumbsappendextension.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.setbreadcrumbsappendextension.md index 02adb9b4d325d5..b8fa965f2726ea 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.setbreadcrumbsappendextension.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromestart.setbreadcrumbsappendextension.md @@ -16,9 +16,9 @@ setBreadcrumbsAppendExtension(breadcrumbsAppendExtension?: ChromeBreadcrumbsAppe | Parameter | Type | Description | | --- | --- | --- | -| breadcrumbsAppendExtension | ChromeBreadcrumbsAppendExtension | | +| breadcrumbsAppendExtension | ChromeBreadcrumbsAppendExtension | | Returns: -`void` +void diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.setcustomnavlink.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.setcustomnavlink.md index adfb57f9c5ff25..7b100a25a4b2ba 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.setcustomnavlink.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromestart.setcustomnavlink.md @@ -16,9 +16,9 @@ setCustomNavLink(newCustomNavLink?: Partial): void; | Parameter | Type | Description | | --- | --- | --- | -| newCustomNavLink | Partial<ChromeNavLink> | | +| newCustomNavLink | Partial<ChromeNavLink> | | Returns: -`void` +void diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.setheaderbanner.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.setheaderbanner.md index 02a2fa65ed4781..75f711c0bf10b6 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.setheaderbanner.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromestart.setheaderbanner.md @@ -16,11 +16,11 @@ setHeaderBanner(headerBanner?: ChromeUserBanner): void; | Parameter | Type | Description | | --- | --- | --- | -| headerBanner | ChromeUserBanner | | +| headerBanner | ChromeUserBanner | | Returns: -`void` +void ## Remarks diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.sethelpextension.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.sethelpextension.md index c03cf2e9203bc4..c2bc691349f3cb 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.sethelpextension.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromestart.sethelpextension.md @@ -16,9 +16,9 @@ setHelpExtension(helpExtension?: ChromeHelpExtension): void; | Parameter | Type | Description | | --- | --- | --- | -| helpExtension | ChromeHelpExtension | | +| helpExtension | ChromeHelpExtension | | Returns: -`void` +void diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.sethelpsupporturl.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.sethelpsupporturl.md index a08c54c1f37c75..baeb37a89ca446 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.sethelpsupporturl.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromestart.sethelpsupporturl.md @@ -16,9 +16,9 @@ setHelpSupportUrl(url: string): void; | Parameter | Type | Description | | --- | --- | --- | -| url | string | | +| url | string | The updated support URL | Returns: -`void` +void diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.setisvisible.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.setisvisible.md index 76e2dc666fc82c..9c8cc737bea4f6 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.setisvisible.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromestart.setisvisible.md @@ -16,9 +16,9 @@ setIsVisible(isVisible: boolean): void; | Parameter | Type | Description | | --- | --- | --- | -| isVisible | boolean | | +| isVisible | boolean | | Returns: -`void` +void diff --git a/docs/development/core/public/kibana-plugin-core-public.chromeuserbanner.md b/docs/development/core/public/kibana-plugin-core-public.chromeuserbanner.md index 8617c5c4d2b12f..0417197ab55f3e 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromeuserbanner.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromeuserbanner.md @@ -15,5 +15,5 @@ export interface ChromeUserBanner | Property | Type | Description | | --- | --- | --- | -| [content](./kibana-plugin-core-public.chromeuserbanner.content.md) | MountPoint<HTMLDivElement> | | +| [content](./kibana-plugin-core-public.chromeuserbanner.content.md) | MountPoint<HTMLDivElement> | | diff --git a/docs/development/core/public/kibana-plugin-core-public.coresetup.md b/docs/development/core/public/kibana-plugin-core-public.coresetup.md index 5d2288120da055..18af0c7ea58550 100644 --- a/docs/development/core/public/kibana-plugin-core-public.coresetup.md +++ b/docs/development/core/public/kibana-plugin-core-public.coresetup.md @@ -16,11 +16,11 @@ export interface CoreSetupApplicationSetup | [ApplicationSetup](./kibana-plugin-core-public.applicationsetup.md) | -| [fatalErrors](./kibana-plugin-core-public.coresetup.fatalerrors.md) | FatalErrorsSetup | [FatalErrorsSetup](./kibana-plugin-core-public.fatalerrorssetup.md) | -| [getStartServices](./kibana-plugin-core-public.coresetup.getstartservices.md) | StartServicesAccessor<TPluginsStart, TStart> | [StartServicesAccessor](./kibana-plugin-core-public.startservicesaccessor.md) | -| [http](./kibana-plugin-core-public.coresetup.http.md) | HttpSetup | [HttpSetup](./kibana-plugin-core-public.httpsetup.md) | -| [injectedMetadata](./kibana-plugin-core-public.coresetup.injectedmetadata.md) | {
getInjectedVar: (name: string, defaultValue?: any) => unknown;
} | exposed temporarily until https://github.com/elastic/kibana/issues/41990 done use \*only\* to retrieve config values. There is no way to set injected values in the new platform. | -| [notifications](./kibana-plugin-core-public.coresetup.notifications.md) | NotificationsSetup | [NotificationsSetup](./kibana-plugin-core-public.notificationssetup.md) | -| [uiSettings](./kibana-plugin-core-public.coresetup.uisettings.md) | IUiSettingsClient | [IUiSettingsClient](./kibana-plugin-core-public.iuisettingsclient.md) | +| [application](./kibana-plugin-core-public.coresetup.application.md) | ApplicationSetup | [ApplicationSetup](./kibana-plugin-core-public.applicationsetup.md) | +| [fatalErrors](./kibana-plugin-core-public.coresetup.fatalerrors.md) | FatalErrorsSetup | [FatalErrorsSetup](./kibana-plugin-core-public.fatalerrorssetup.md) | +| [getStartServices](./kibana-plugin-core-public.coresetup.getstartservices.md) | StartServicesAccessor<TPluginsStart, TStart> | [StartServicesAccessor](./kibana-plugin-core-public.startservicesaccessor.md) | +| [http](./kibana-plugin-core-public.coresetup.http.md) | HttpSetup | [HttpSetup](./kibana-plugin-core-public.httpsetup.md) | +| [injectedMetadata](./kibana-plugin-core-public.coresetup.injectedmetadata.md) | { getInjectedVar: (name: string, defaultValue?: any) => unknown; } | exposed temporarily until https://github.com/elastic/kibana/issues/41990 done use \*only\* to retrieve config values. There is no way to set injected values in the new platform. | +| [notifications](./kibana-plugin-core-public.coresetup.notifications.md) | NotificationsSetup | [NotificationsSetup](./kibana-plugin-core-public.notificationssetup.md) | +| [uiSettings](./kibana-plugin-core-public.coresetup.uisettings.md) | IUiSettingsClient | [IUiSettingsClient](./kibana-plugin-core-public.iuisettingsclient.md) | diff --git a/docs/development/core/public/kibana-plugin-core-public.corestart.md b/docs/development/core/public/kibana-plugin-core-public.corestart.md index 6ad9adca53ef5c..e0f6a687824106 100644 --- a/docs/development/core/public/kibana-plugin-core-public.corestart.md +++ b/docs/development/core/public/kibana-plugin-core-public.corestart.md @@ -16,16 +16,16 @@ export interface CoreStart | Property | Type | Description | | --- | --- | --- | -| [application](./kibana-plugin-core-public.corestart.application.md) | ApplicationStart | [ApplicationStart](./kibana-plugin-core-public.applicationstart.md) | -| [chrome](./kibana-plugin-core-public.corestart.chrome.md) | ChromeStart | [ChromeStart](./kibana-plugin-core-public.chromestart.md) | -| [deprecations](./kibana-plugin-core-public.corestart.deprecations.md) | DeprecationsServiceStart | [DeprecationsServiceStart](./kibana-plugin-core-public.deprecationsservicestart.md) | -| [docLinks](./kibana-plugin-core-public.corestart.doclinks.md) | DocLinksStart | [DocLinksStart](./kibana-plugin-core-public.doclinksstart.md) | -| [fatalErrors](./kibana-plugin-core-public.corestart.fatalerrors.md) | FatalErrorsStart | [FatalErrorsStart](./kibana-plugin-core-public.fatalerrorsstart.md) | -| [http](./kibana-plugin-core-public.corestart.http.md) | HttpStart | [HttpStart](./kibana-plugin-core-public.httpstart.md) | -| [i18n](./kibana-plugin-core-public.corestart.i18n.md) | I18nStart | [I18nStart](./kibana-plugin-core-public.i18nstart.md) | -| [injectedMetadata](./kibana-plugin-core-public.corestart.injectedmetadata.md) | {
getInjectedVar: (name: string, defaultValue?: any) => unknown;
} | exposed temporarily until https://github.com/elastic/kibana/issues/41990 done use \*only\* to retrieve config values. There is no way to set injected values in the new platform. | -| [notifications](./kibana-plugin-core-public.corestart.notifications.md) | NotificationsStart | [NotificationsStart](./kibana-plugin-core-public.notificationsstart.md) | -| [overlays](./kibana-plugin-core-public.corestart.overlays.md) | OverlayStart | [OverlayStart](./kibana-plugin-core-public.overlaystart.md) | -| [savedObjects](./kibana-plugin-core-public.corestart.savedobjects.md) | SavedObjectsStart | [SavedObjectsStart](./kibana-plugin-core-public.savedobjectsstart.md) | -| [uiSettings](./kibana-plugin-core-public.corestart.uisettings.md) | IUiSettingsClient | [IUiSettingsClient](./kibana-plugin-core-public.iuisettingsclient.md) | +| [application](./kibana-plugin-core-public.corestart.application.md) | ApplicationStart | [ApplicationStart](./kibana-plugin-core-public.applicationstart.md) | +| [chrome](./kibana-plugin-core-public.corestart.chrome.md) | ChromeStart | [ChromeStart](./kibana-plugin-core-public.chromestart.md) | +| [deprecations](./kibana-plugin-core-public.corestart.deprecations.md) | DeprecationsServiceStart | [DeprecationsServiceStart](./kibana-plugin-core-public.deprecationsservicestart.md) | +| [docLinks](./kibana-plugin-core-public.corestart.doclinks.md) | DocLinksStart | [DocLinksStart](./kibana-plugin-core-public.doclinksstart.md) | +| [fatalErrors](./kibana-plugin-core-public.corestart.fatalerrors.md) | FatalErrorsStart | [FatalErrorsStart](./kibana-plugin-core-public.fatalerrorsstart.md) | +| [http](./kibana-plugin-core-public.corestart.http.md) | HttpStart | [HttpStart](./kibana-plugin-core-public.httpstart.md) | +| [i18n](./kibana-plugin-core-public.corestart.i18n.md) | I18nStart | [I18nStart](./kibana-plugin-core-public.i18nstart.md) | +| [injectedMetadata](./kibana-plugin-core-public.corestart.injectedmetadata.md) | { getInjectedVar: (name: string, defaultValue?: any) => unknown; } | exposed temporarily until https://github.com/elastic/kibana/issues/41990 done use \*only\* to retrieve config values. There is no way to set injected values in the new platform. | +| [notifications](./kibana-plugin-core-public.corestart.notifications.md) | NotificationsStart | [NotificationsStart](./kibana-plugin-core-public.notificationsstart.md) | +| [overlays](./kibana-plugin-core-public.corestart.overlays.md) | OverlayStart | [OverlayStart](./kibana-plugin-core-public.overlaystart.md) | +| [savedObjects](./kibana-plugin-core-public.corestart.savedobjects.md) | SavedObjectsStart | [SavedObjectsStart](./kibana-plugin-core-public.savedobjectsstart.md) | +| [uiSettings](./kibana-plugin-core-public.corestart.uisettings.md) | IUiSettingsClient | [IUiSettingsClient](./kibana-plugin-core-public.iuisettingsclient.md) | diff --git a/docs/development/core/public/kibana-plugin-core-public.deprecationsservicestart.md b/docs/development/core/public/kibana-plugin-core-public.deprecationsservicestart.md index 0d2c963ec55477..bfc1d78f4d045d 100644 --- a/docs/development/core/public/kibana-plugin-core-public.deprecationsservicestart.md +++ b/docs/development/core/public/kibana-plugin-core-public.deprecationsservicestart.md @@ -16,8 +16,8 @@ export interface DeprecationsServiceStart | Property | Type | Description | | --- | --- | --- | -| [getAllDeprecations](./kibana-plugin-core-public.deprecationsservicestart.getalldeprecations.md) | () => Promise<DomainDeprecationDetails[]> | Grabs deprecations details for all domains. | -| [getDeprecations](./kibana-plugin-core-public.deprecationsservicestart.getdeprecations.md) | (domainId: string) => Promise<DomainDeprecationDetails[]> | Grabs deprecations for a specific domain. | -| [isDeprecationResolvable](./kibana-plugin-core-public.deprecationsservicestart.isdeprecationresolvable.md) | (details: DomainDeprecationDetails) => boolean | Returns a boolean if the provided deprecation can be automatically resolvable. | -| [resolveDeprecation](./kibana-plugin-core-public.deprecationsservicestart.resolvedeprecation.md) | (details: DomainDeprecationDetails) => Promise<ResolveDeprecationResponse> | Calls the correctiveActions.api to automatically resolve the depprecation. | +| [getAllDeprecations](./kibana-plugin-core-public.deprecationsservicestart.getalldeprecations.md) | () => Promise<DomainDeprecationDetails\[\]> | Grabs deprecations details for all domains. | +| [getDeprecations](./kibana-plugin-core-public.deprecationsservicestart.getdeprecations.md) | (domainId: string) => Promise<DomainDeprecationDetails\[\]> | Grabs deprecations for a specific domain. | +| [isDeprecationResolvable](./kibana-plugin-core-public.deprecationsservicestart.isdeprecationresolvable.md) | (details: DomainDeprecationDetails) => boolean | Returns a boolean if the provided deprecation can be automatically resolvable. | +| [resolveDeprecation](./kibana-plugin-core-public.deprecationsservicestart.resolvedeprecation.md) | (details: DomainDeprecationDetails) => Promise<ResolveDeprecationResponse> | Calls the correctiveActions.api to automatically resolve the depprecation. | diff --git a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md index d0df23f35ab9ef..a1363b7a519d1c 100644 --- a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md +++ b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md @@ -15,7 +15,7 @@ export interface DocLinksStart | Property | Type | Description | | --- | --- | --- | -| [DOC\_LINK\_VERSION](./kibana-plugin-core-public.doclinksstart.doc_link_version.md) | string | | -| [ELASTIC\_WEBSITE\_URL](./kibana-plugin-core-public.doclinksstart.elastic_website_url.md) | string | | -| [links](./kibana-plugin-core-public.doclinksstart.links.md) | {
readonly settings: string;
readonly elasticStackGetStarted: 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 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 enterpriseSearch: {
readonly base: string;
readonly appSearchBase: string;
readonly workplaceSearchBase: 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 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: string;
readonly upgradeAssistant: 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 query: {
readonly eql: string;
readonly kueryQuerySyntax: string;
readonly luceneQuerySyntax: string;
readonly percolate: string;
readonly queryDsl: string;
readonly autocompleteChanges: 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;
openIndex: string;
putComponentTemplate: string;
painlessExecute: string;
painlessExecuteAPIContexts: string;
putComponentTemplateMetadata: string;
putSnapshotLifecyclePolicy: string;
putIndexTemplateV1: string;
putWatch: string;
simulatePipeline: string;
timeUnits: 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: Record<string, 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: Record<string, string>;
readonly snapshotRestore: Record<string, string>;
readonly ingest: Record<string, string>;
readonly fleet: Readonly<{
datastreamsILM: string;
beatsAgentComparison: string;
guide: string;
fleetServer: string;
fleetServerAddFleetServer: string;
settings: string;
settingsFleetServerHostSettings: string;
troubleshooting: string;
elasticAgent: string;
datastreams: string;
datastreamsNamingScheme: string;
installElasticAgent: string;
upgradeElasticAgent: string;
upgradeElasticAgent712lower: string;
learnMoreBlog: string;
apiKeysLearnMore: 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;
};
} | | +| [DOC\_LINK\_VERSION](./kibana-plugin-core-public.doclinksstart.doc_link_version.md) | string | | +| [ELASTIC\_WEBSITE\_URL](./kibana-plugin-core-public.doclinksstart.elastic_website_url.md) | string | | +| [links](./kibana-plugin-core-public.doclinksstart.links.md) | { readonly settings: string; readonly elasticStackGetStarted: string; readonly upgrade: { readonly upgradingElasticStack: 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 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 enterpriseSearch: { readonly base: string; readonly appSearchBase: string; readonly workplaceSearchBase: 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 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: 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 query: { readonly eql: string; readonly kueryQuerySyntax: string; readonly luceneQuerySyntax: string; readonly percolate: string; readonly queryDsl: string; readonly autocompleteChanges: 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; openIndex: string; putComponentTemplate: string; painlessExecute: string; painlessExecuteAPIContexts: string; putComponentTemplateMetadata: string; putSnapshotLifecyclePolicy: string; putIndexTemplateV1: string; putWatch: string; simulatePipeline: string; timeUnits: 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: Record<string, 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: Record<string, string>; readonly snapshotRestore: Record<string, string>; readonly ingest: Record<string, string>; readonly fleet: Readonly<{ datastreamsILM: string; beatsAgentComparison: string; guide: string; fleetServer: string; fleetServerAddFleetServer: string; settings: string; settingsFleetServerHostSettings: string; settingsFleetServerProxySettings: string; troubleshooting: string; elasticAgent: string; datastreams: string; datastreamsNamingScheme: string; installElasticAgent: 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; }; } | | diff --git a/docs/development/core/public/kibana-plugin-core-public.errortoastoptions.md b/docs/development/core/public/kibana-plugin-core-public.errortoastoptions.md index dc256e6f5bc067..c2bddc58d9c3be 100644 --- a/docs/development/core/public/kibana-plugin-core-public.errortoastoptions.md +++ b/docs/development/core/public/kibana-plugin-core-public.errortoastoptions.md @@ -11,11 +11,12 @@ Options available for [IToasts](./kibana-plugin-core-public.itoasts.md) error AP ```typescript export interface ErrorToastOptions extends ToastOptions ``` +Extends: ToastOptions ## Properties | Property | Type | Description | | --- | --- | --- | -| [title](./kibana-plugin-core-public.errortoastoptions.title.md) | string | The title of the toast and the dialog when expanding the message. | -| [toastMessage](./kibana-plugin-core-public.errortoastoptions.toastmessage.md) | string | The message to be shown in the toast. If this is not specified the error's message will be shown in the toast instead. Overwriting that message can be used to provide more user-friendly toasts. If you specify this, the error message will still be shown in the detailed error modal. | +| [title](./kibana-plugin-core-public.errortoastoptions.title.md) | string | The title of the toast and the dialog when expanding the message. | +| [toastMessage?](./kibana-plugin-core-public.errortoastoptions.toastmessage.md) | string | (Optional) The message to be shown in the toast. If this is not specified the error's message will be shown in the toast instead. Overwriting that message can be used to provide more user-friendly toasts. If you specify this, the error message will still be shown in the detailed error modal. | diff --git a/docs/development/core/public/kibana-plugin-core-public.fatalerrorinfo.md b/docs/development/core/public/kibana-plugin-core-public.fatalerrorinfo.md index 51facf549bd010..9b2803e4f12ead 100644 --- a/docs/development/core/public/kibana-plugin-core-public.fatalerrorinfo.md +++ b/docs/development/core/public/kibana-plugin-core-public.fatalerrorinfo.md @@ -16,6 +16,6 @@ export interface FatalErrorInfo | Property | Type | Description | | --- | --- | --- | -| [message](./kibana-plugin-core-public.fatalerrorinfo.message.md) | string | | -| [stack](./kibana-plugin-core-public.fatalerrorinfo.stack.md) | string | undefined | | +| [message](./kibana-plugin-core-public.fatalerrorinfo.message.md) | string | | +| [stack](./kibana-plugin-core-public.fatalerrorinfo.stack.md) | string \| undefined | | diff --git a/docs/development/core/public/kibana-plugin-core-public.fatalerrorssetup.md b/docs/development/core/public/kibana-plugin-core-public.fatalerrorssetup.md index 31abcf13b820eb..1f27fd52b7e321 100644 --- a/docs/development/core/public/kibana-plugin-core-public.fatalerrorssetup.md +++ b/docs/development/core/public/kibana-plugin-core-public.fatalerrorssetup.md @@ -16,6 +16,6 @@ export interface FatalErrorsSetup | Property | Type | Description | | --- | --- | --- | -| [add](./kibana-plugin-core-public.fatalerrorssetup.add.md) | (error: string | Error, source?: string) => never | Add a new fatal error. This will stop the Kibana Public Core and display a fatal error screen with details about the Kibana build and the error. | -| [get$](./kibana-plugin-core-public.fatalerrorssetup.get_.md) | () => Rx.Observable<FatalErrorInfo> | An Observable that will emit whenever a fatal error is added with add() | +| [add](./kibana-plugin-core-public.fatalerrorssetup.add.md) | (error: string \| Error, source?: string) => never | Add a new fatal error. This will stop the Kibana Public Core and display a fatal error screen with details about the Kibana build and the error. | +| [get$](./kibana-plugin-core-public.fatalerrorssetup.get_.md) | () => Rx.Observable<FatalErrorInfo> | An Observable that will emit whenever a fatal error is added with add() | diff --git a/docs/development/core/public/kibana-plugin-core-public.httpfetchoptions.md b/docs/development/core/public/kibana-plugin-core-public.httpfetchoptions.md index 45a48372b45125..9a7f05ab9cd3ed 100644 --- a/docs/development/core/public/kibana-plugin-core-public.httpfetchoptions.md +++ b/docs/development/core/public/kibana-plugin-core-public.httpfetchoptions.md @@ -11,15 +11,16 @@ All options that may be used with a [HttpHandler](./kibana-plugin-core-public.ht ```typescript export interface HttpFetchOptions extends HttpRequestInit ``` +Extends: HttpRequestInit ## Properties | Property | Type | Description | | --- | --- | --- | -| [asResponse](./kibana-plugin-core-public.httpfetchoptions.asresponse.md) | boolean | When true the return type of [HttpHandler](./kibana-plugin-core-public.httphandler.md) will be an [HttpResponse](./kibana-plugin-core-public.httpresponse.md) with detailed request and response information. When false, the return type will just be the parsed response body. Defaults to false. | -| [asSystemRequest](./kibana-plugin-core-public.httpfetchoptions.assystemrequest.md) | boolean | Whether or not the request should include the "system request" header to differentiate an end user request from Kibana internal request. Can be read on the server-side using KibanaRequest\#isSystemRequest. Defaults to false. | -| [context](./kibana-plugin-core-public.httpfetchoptions.context.md) | KibanaExecutionContext | | -| [headers](./kibana-plugin-core-public.httpfetchoptions.headers.md) | HttpHeadersInit | Headers to send with the request. See [HttpHeadersInit](./kibana-plugin-core-public.httpheadersinit.md). | -| [prependBasePath](./kibana-plugin-core-public.httpfetchoptions.prependbasepath.md) | boolean | Whether or not the request should automatically prepend the basePath. Defaults to true. | -| [query](./kibana-plugin-core-public.httpfetchoptions.query.md) | HttpFetchQuery | The query string for an HTTP request. See [HttpFetchQuery](./kibana-plugin-core-public.httpfetchquery.md). | +| [asResponse?](./kibana-plugin-core-public.httpfetchoptions.asresponse.md) | boolean | (Optional) When true the return type of [HttpHandler](./kibana-plugin-core-public.httphandler.md) will be an [HttpResponse](./kibana-plugin-core-public.httpresponse.md) with detailed request and response information. When false, the return type will just be the parsed response body. Defaults to false. | +| [asSystemRequest?](./kibana-plugin-core-public.httpfetchoptions.assystemrequest.md) | boolean | (Optional) Whether or not the request should include the "system request" header to differentiate an end user request from Kibana internal request. Can be read on the server-side using KibanaRequest\#isSystemRequest. Defaults to false. | +| [context?](./kibana-plugin-core-public.httpfetchoptions.context.md) | KibanaExecutionContext | (Optional) | +| [headers?](./kibana-plugin-core-public.httpfetchoptions.headers.md) | HttpHeadersInit | (Optional) Headers to send with the request. See [HttpHeadersInit](./kibana-plugin-core-public.httpheadersinit.md). | +| [prependBasePath?](./kibana-plugin-core-public.httpfetchoptions.prependbasepath.md) | boolean | (Optional) Whether or not the request should automatically prepend the basePath. Defaults to true. | +| [query?](./kibana-plugin-core-public.httpfetchoptions.query.md) | HttpFetchQuery | (Optional) The query string for an HTTP request. See [HttpFetchQuery](./kibana-plugin-core-public.httpfetchquery.md). | diff --git a/docs/development/core/public/kibana-plugin-core-public.httpfetchoptionswithpath.md b/docs/development/core/public/kibana-plugin-core-public.httpfetchoptionswithpath.md index 37ea559605d3c9..78155adaf627ea 100644 --- a/docs/development/core/public/kibana-plugin-core-public.httpfetchoptionswithpath.md +++ b/docs/development/core/public/kibana-plugin-core-public.httpfetchoptionswithpath.md @@ -11,10 +11,11 @@ Similar to [HttpFetchOptions](./kibana-plugin-core-public.httpfetchoptions.md) b ```typescript export interface HttpFetchOptionsWithPath extends HttpFetchOptions ``` +Extends: HttpFetchOptions ## Properties | Property | Type | Description | | --- | --- | --- | -| [path](./kibana-plugin-core-public.httpfetchoptionswithpath.path.md) | string | | +| [path](./kibana-plugin-core-public.httpfetchoptionswithpath.path.md) | string | | diff --git a/docs/development/core/public/kibana-plugin-core-public.httpinterceptor.md b/docs/development/core/public/kibana-plugin-core-public.httpinterceptor.md index 84dd88eff9e4c2..e1843b1a529884 100644 --- a/docs/development/core/public/kibana-plugin-core-public.httpinterceptor.md +++ b/docs/development/core/public/kibana-plugin-core-public.httpinterceptor.md @@ -16,8 +16,8 @@ export interface HttpInterceptor | Method | Description | | --- | --- | -| [request(fetchOptions, controller)](./kibana-plugin-core-public.httpinterceptor.request.md) | Define an interceptor to be executed before a request is sent. | -| [requestError(httpErrorRequest, controller)](./kibana-plugin-core-public.httpinterceptor.requesterror.md) | Define an interceptor to be executed if a request interceptor throws an error or returns a rejected Promise. | -| [response(httpResponse, controller)](./kibana-plugin-core-public.httpinterceptor.response.md) | Define an interceptor to be executed after a response is received. | -| [responseError(httpErrorResponse, controller)](./kibana-plugin-core-public.httpinterceptor.responseerror.md) | Define an interceptor to be executed if a response interceptor throws an error or returns a rejected Promise. | +| [request(fetchOptions, controller)?](./kibana-plugin-core-public.httpinterceptor.request.md) | (Optional) Define an interceptor to be executed before a request is sent. | +| [requestError(httpErrorRequest, controller)?](./kibana-plugin-core-public.httpinterceptor.requesterror.md) | (Optional) Define an interceptor to be executed if a request interceptor throws an error or returns a rejected Promise. | +| [response(httpResponse, controller)?](./kibana-plugin-core-public.httpinterceptor.response.md) | (Optional) Define an interceptor to be executed after a response is received. | +| [responseError(httpErrorResponse, controller)?](./kibana-plugin-core-public.httpinterceptor.responseerror.md) | (Optional) Define an interceptor to be executed if a response interceptor throws an error or returns a rejected Promise. | diff --git a/docs/development/core/public/kibana-plugin-core-public.httpinterceptor.request.md b/docs/development/core/public/kibana-plugin-core-public.httpinterceptor.request.md index d9051c5f8d72c0..95181e6d509f19 100644 --- a/docs/development/core/public/kibana-plugin-core-public.httpinterceptor.request.md +++ b/docs/development/core/public/kibana-plugin-core-public.httpinterceptor.request.md @@ -16,10 +16,10 @@ request?(fetchOptions: Readonly, controller: IHttpInte | Parameter | Type | Description | | --- | --- | --- | -| fetchOptions | Readonly<HttpFetchOptionsWithPath> | | -| controller | IHttpInterceptController | | +| fetchOptions | Readonly<HttpFetchOptionsWithPath> | | +| controller | IHttpInterceptController | [IHttpInterceptController](./kibana-plugin-core-public.ihttpinterceptcontroller.md) | Returns: -`MaybePromise> | void` +MaybePromise<Partial<HttpFetchOptionsWithPath>> \| void diff --git a/docs/development/core/public/kibana-plugin-core-public.httpinterceptor.requesterror.md b/docs/development/core/public/kibana-plugin-core-public.httpinterceptor.requesterror.md index 16980d67fd81ea..c2bd14a6d1ead5 100644 --- a/docs/development/core/public/kibana-plugin-core-public.httpinterceptor.requesterror.md +++ b/docs/development/core/public/kibana-plugin-core-public.httpinterceptor.requesterror.md @@ -16,10 +16,10 @@ requestError?(httpErrorRequest: HttpInterceptorRequestError, controller: IHttpIn | Parameter | Type | Description | | --- | --- | --- | -| httpErrorRequest | HttpInterceptorRequestError | | -| controller | IHttpInterceptController | | +| httpErrorRequest | HttpInterceptorRequestError | [HttpInterceptorRequestError](./kibana-plugin-core-public.httpinterceptorrequesterror.md) | +| controller | IHttpInterceptController | [IHttpInterceptController](./kibana-plugin-core-public.ihttpinterceptcontroller.md) | Returns: -`MaybePromise> | void` +MaybePromise<Partial<HttpFetchOptionsWithPath>> \| void diff --git a/docs/development/core/public/kibana-plugin-core-public.httpinterceptor.response.md b/docs/development/core/public/kibana-plugin-core-public.httpinterceptor.response.md index 374c6bfe09a958..40cfeffacc0ca3 100644 --- a/docs/development/core/public/kibana-plugin-core-public.httpinterceptor.response.md +++ b/docs/development/core/public/kibana-plugin-core-public.httpinterceptor.response.md @@ -16,10 +16,10 @@ response?(httpResponse: HttpResponse, controller: IHttpInterceptController): May | Parameter | Type | Description | | --- | --- | --- | -| httpResponse | HttpResponse | | -| controller | IHttpInterceptController | | +| httpResponse | HttpResponse | [HttpResponse](./kibana-plugin-core-public.httpresponse.md) | +| controller | IHttpInterceptController | [IHttpInterceptController](./kibana-plugin-core-public.ihttpinterceptcontroller.md) | Returns: -`MaybePromise | void` +MaybePromise<IHttpResponseInterceptorOverrides> \| void diff --git a/docs/development/core/public/kibana-plugin-core-public.httpinterceptor.responseerror.md b/docs/development/core/public/kibana-plugin-core-public.httpinterceptor.responseerror.md index fa0acd323fd720..d9be2e87761fc1 100644 --- a/docs/development/core/public/kibana-plugin-core-public.httpinterceptor.responseerror.md +++ b/docs/development/core/public/kibana-plugin-core-public.httpinterceptor.responseerror.md @@ -16,10 +16,10 @@ responseError?(httpErrorResponse: HttpInterceptorResponseError, controller: IHtt | Parameter | Type | Description | | --- | --- | --- | -| httpErrorResponse | HttpInterceptorResponseError | | -| controller | IHttpInterceptController | | +| httpErrorResponse | HttpInterceptorResponseError | [HttpInterceptorResponseError](./kibana-plugin-core-public.httpinterceptorresponseerror.md) | +| controller | IHttpInterceptController | [IHttpInterceptController](./kibana-plugin-core-public.ihttpinterceptcontroller.md) | Returns: -`MaybePromise | void` +MaybePromise<IHttpResponseInterceptorOverrides> \| void diff --git a/docs/development/core/public/kibana-plugin-core-public.httpinterceptorrequesterror.md b/docs/development/core/public/kibana-plugin-core-public.httpinterceptorrequesterror.md index 69eadf43cb87b1..499bc61ce68af5 100644 --- a/docs/development/core/public/kibana-plugin-core-public.httpinterceptorrequesterror.md +++ b/docs/development/core/public/kibana-plugin-core-public.httpinterceptorrequesterror.md @@ -15,6 +15,6 @@ export interface HttpInterceptorRequestError | Property | Type | Description | | --- | --- | --- | -| [error](./kibana-plugin-core-public.httpinterceptorrequesterror.error.md) | Error | | -| [fetchOptions](./kibana-plugin-core-public.httpinterceptorrequesterror.fetchoptions.md) | Readonly<HttpFetchOptionsWithPath> | | +| [error](./kibana-plugin-core-public.httpinterceptorrequesterror.error.md) | Error | | +| [fetchOptions](./kibana-plugin-core-public.httpinterceptorrequesterror.fetchoptions.md) | Readonly<HttpFetchOptionsWithPath> | | diff --git a/docs/development/core/public/kibana-plugin-core-public.httpinterceptorresponseerror.md b/docs/development/core/public/kibana-plugin-core-public.httpinterceptorresponseerror.md index 6d2b8c6ec99656..014cebeb3ec4df 100644 --- a/docs/development/core/public/kibana-plugin-core-public.httpinterceptorresponseerror.md +++ b/docs/development/core/public/kibana-plugin-core-public.httpinterceptorresponseerror.md @@ -10,11 +10,12 @@ ```typescript export interface HttpInterceptorResponseError extends HttpResponse ``` +Extends: HttpResponse ## Properties | Property | Type | Description | | --- | --- | --- | -| [error](./kibana-plugin-core-public.httpinterceptorresponseerror.error.md) | Error | IHttpFetchError | | -| [request](./kibana-plugin-core-public.httpinterceptorresponseerror.request.md) | Readonly<Request> | | +| [error](./kibana-plugin-core-public.httpinterceptorresponseerror.error.md) | Error \| IHttpFetchError | | +| [request](./kibana-plugin-core-public.httpinterceptorresponseerror.request.md) | Readonly<Request> | | diff --git a/docs/development/core/public/kibana-plugin-core-public.httprequestinit.md b/docs/development/core/public/kibana-plugin-core-public.httprequestinit.md index 496fba97491ed1..6b0e054ff1eb30 100644 --- a/docs/development/core/public/kibana-plugin-core-public.httprequestinit.md +++ b/docs/development/core/public/kibana-plugin-core-public.httprequestinit.md @@ -16,17 +16,17 @@ export interface HttpRequestInit | Property | Type | Description | | --- | --- | --- | -| [body](./kibana-plugin-core-public.httprequestinit.body.md) | BodyInit | null | A BodyInit object or null to set request's body. | -| [cache](./kibana-plugin-core-public.httprequestinit.cache.md) | RequestCache | The cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. | -| [credentials](./kibana-plugin-core-public.httprequestinit.credentials.md) | RequestCredentials | The credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. | -| [headers](./kibana-plugin-core-public.httprequestinit.headers.md) | HttpHeadersInit | [HttpHeadersInit](./kibana-plugin-core-public.httpheadersinit.md) | -| [integrity](./kibana-plugin-core-public.httprequestinit.integrity.md) | string | Subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. | -| [keepalive](./kibana-plugin-core-public.httprequestinit.keepalive.md) | boolean | Whether or not request can outlive the global in which it was created. | -| [method](./kibana-plugin-core-public.httprequestinit.method.md) | string | HTTP method, which is "GET" by default. | -| [mode](./kibana-plugin-core-public.httprequestinit.mode.md) | RequestMode | The mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs. | -| [redirect](./kibana-plugin-core-public.httprequestinit.redirect.md) | RequestRedirect | The redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default. | -| [referrer](./kibana-plugin-core-public.httprequestinit.referrer.md) | string | The referrer of request. Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and "about:client" when defaulting to the global's default. This is used during fetching to determine the value of the Referer header of the request being made. | -| [referrerPolicy](./kibana-plugin-core-public.httprequestinit.referrerpolicy.md) | ReferrerPolicy | The referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. | -| [signal](./kibana-plugin-core-public.httprequestinit.signal.md) | AbortSignal | null | Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler. | -| [window](./kibana-plugin-core-public.httprequestinit.window.md) | null | Can only be null. Used to disassociate request from any Window. | +| [body?](./kibana-plugin-core-public.httprequestinit.body.md) | BodyInit \| null | (Optional) A BodyInit object or null to set request's body. | +| [cache?](./kibana-plugin-core-public.httprequestinit.cache.md) | RequestCache | (Optional) The cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. | +| [credentials?](./kibana-plugin-core-public.httprequestinit.credentials.md) | RequestCredentials | (Optional) The credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. | +| [headers?](./kibana-plugin-core-public.httprequestinit.headers.md) | HttpHeadersInit | (Optional) [HttpHeadersInit](./kibana-plugin-core-public.httpheadersinit.md) | +| [integrity?](./kibana-plugin-core-public.httprequestinit.integrity.md) | string | (Optional) Subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. | +| [keepalive?](./kibana-plugin-core-public.httprequestinit.keepalive.md) | boolean | (Optional) Whether or not request can outlive the global in which it was created. | +| [method?](./kibana-plugin-core-public.httprequestinit.method.md) | string | (Optional) HTTP method, which is "GET" by default. | +| [mode?](./kibana-plugin-core-public.httprequestinit.mode.md) | RequestMode | (Optional) The mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs. | +| [redirect?](./kibana-plugin-core-public.httprequestinit.redirect.md) | RequestRedirect | (Optional) The redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default. | +| [referrer?](./kibana-plugin-core-public.httprequestinit.referrer.md) | string | (Optional) The referrer of request. Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and "about:client" when defaulting to the global's default. This is used during fetching to determine the value of the Referer header of the request being made. | +| [referrerPolicy?](./kibana-plugin-core-public.httprequestinit.referrerpolicy.md) | ReferrerPolicy | (Optional) The referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. | +| [signal?](./kibana-plugin-core-public.httprequestinit.signal.md) | AbortSignal \| null | (Optional) Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler. | +| [window?](./kibana-plugin-core-public.httprequestinit.window.md) | null | (Optional) Can only be null. Used to disassociate request from any Window. | diff --git a/docs/development/core/public/kibana-plugin-core-public.httpresponse.md b/docs/development/core/public/kibana-plugin-core-public.httpresponse.md index dcbfa556da65df..c0a3644ecaf2fd 100644 --- a/docs/development/core/public/kibana-plugin-core-public.httpresponse.md +++ b/docs/development/core/public/kibana-plugin-core-public.httpresponse.md @@ -15,8 +15,8 @@ export interface HttpResponse | Property | Type | Description | | --- | --- | --- | -| [body](./kibana-plugin-core-public.httpresponse.body.md) | TResponseBody | Parsed body received, may be undefined if there was an error. | -| [fetchOptions](./kibana-plugin-core-public.httpresponse.fetchoptions.md) | Readonly<HttpFetchOptionsWithPath> | The original [HttpFetchOptionsWithPath](./kibana-plugin-core-public.httpfetchoptionswithpath.md) used to send this request. | -| [request](./kibana-plugin-core-public.httpresponse.request.md) | Readonly<Request> | Raw request sent to Kibana server. | -| [response](./kibana-plugin-core-public.httpresponse.response.md) | Readonly<Response> | Raw response received, may be undefined if there was an error. | +| [body?](./kibana-plugin-core-public.httpresponse.body.md) | TResponseBody | (Optional) Parsed body received, may be undefined if there was an error. | +| [fetchOptions](./kibana-plugin-core-public.httpresponse.fetchoptions.md) | Readonly<HttpFetchOptionsWithPath> | The original [HttpFetchOptionsWithPath](./kibana-plugin-core-public.httpfetchoptionswithpath.md) used to send this request. | +| [request](./kibana-plugin-core-public.httpresponse.request.md) | Readonly<Request> | Raw request sent to Kibana server. | +| [response?](./kibana-plugin-core-public.httpresponse.response.md) | Readonly<Response> | (Optional) Raw response received, may be undefined if there was an error. | diff --git a/docs/development/core/public/kibana-plugin-core-public.httpsetup.addloadingcountsource.md b/docs/development/core/public/kibana-plugin-core-public.httpsetup.addloadingcountsource.md index 71746b7b1b73f4..7962772dbaa5cd 100644 --- a/docs/development/core/public/kibana-plugin-core-public.httpsetup.addloadingcountsource.md +++ b/docs/development/core/public/kibana-plugin-core-public.httpsetup.addloadingcountsource.md @@ -16,9 +16,9 @@ addLoadingCountSource(countSource$: Observable): void; | Parameter | Type | Description | | --- | --- | --- | -| countSource$ | Observable<number> | | +| countSource$ | Observable<number> | an Observable to subscribe to for loading count updates. | Returns: -`void` +void diff --git a/docs/development/core/public/kibana-plugin-core-public.httpsetup.getloadingcount_.md b/docs/development/core/public/kibana-plugin-core-public.httpsetup.getloadingcount_.md index d60826f3ce5fa6..e10278470f542e 100644 --- a/docs/development/core/public/kibana-plugin-core-public.httpsetup.getloadingcount_.md +++ b/docs/development/core/public/kibana-plugin-core-public.httpsetup.getloadingcount_.md @@ -13,5 +13,5 @@ getLoadingCount$(): Observable; ``` Returns: -`Observable` +Observable<number> diff --git a/docs/development/core/public/kibana-plugin-core-public.httpsetup.intercept.md b/docs/development/core/public/kibana-plugin-core-public.httpsetup.intercept.md index d774d9896a92bc..27962d3c3867bf 100644 --- a/docs/development/core/public/kibana-plugin-core-public.httpsetup.intercept.md +++ b/docs/development/core/public/kibana-plugin-core-public.httpsetup.intercept.md @@ -16,11 +16,11 @@ intercept(interceptor: HttpInterceptor): () => void; | Parameter | Type | Description | | --- | --- | --- | -| interceptor | HttpInterceptor | | +| interceptor | HttpInterceptor | a [HttpInterceptor](./kibana-plugin-core-public.httpinterceptor.md) | Returns: -`() => void` +() => void a function for removing the attached interceptor. diff --git a/docs/development/core/public/kibana-plugin-core-public.httpsetup.md b/docs/development/core/public/kibana-plugin-core-public.httpsetup.md index a921110018c700..2d8116b0eeba65 100644 --- a/docs/development/core/public/kibana-plugin-core-public.httpsetup.md +++ b/docs/development/core/public/kibana-plugin-core-public.httpsetup.md @@ -15,17 +15,17 @@ export interface HttpSetup | Property | Type | Description | | --- | --- | --- | -| [anonymousPaths](./kibana-plugin-core-public.httpsetup.anonymouspaths.md) | IAnonymousPaths | APIs for denoting certain paths for not requiring authentication | -| [basePath](./kibana-plugin-core-public.httpsetup.basepath.md) | IBasePath | APIs for manipulating the basePath on URL segments. See [IBasePath](./kibana-plugin-core-public.ibasepath.md) | -| [delete](./kibana-plugin-core-public.httpsetup.delete.md) | HttpHandler | Makes an HTTP request with the DELETE method. See [HttpHandler](./kibana-plugin-core-public.httphandler.md) for options. | -| [externalUrl](./kibana-plugin-core-public.httpsetup.externalurl.md) | IExternalUrl | | -| [fetch](./kibana-plugin-core-public.httpsetup.fetch.md) | HttpHandler | Makes an HTTP request. Defaults to a GET request unless overridden. See [HttpHandler](./kibana-plugin-core-public.httphandler.md) for options. | -| [get](./kibana-plugin-core-public.httpsetup.get.md) | HttpHandler | Makes an HTTP request with the GET method. See [HttpHandler](./kibana-plugin-core-public.httphandler.md) for options. | -| [head](./kibana-plugin-core-public.httpsetup.head.md) | HttpHandler | Makes an HTTP request with the HEAD method. See [HttpHandler](./kibana-plugin-core-public.httphandler.md) for options. | -| [options](./kibana-plugin-core-public.httpsetup.options.md) | HttpHandler | Makes an HTTP request with the OPTIONS method. See [HttpHandler](./kibana-plugin-core-public.httphandler.md) for options. | -| [patch](./kibana-plugin-core-public.httpsetup.patch.md) | HttpHandler | Makes an HTTP request with the PATCH method. See [HttpHandler](./kibana-plugin-core-public.httphandler.md) for options. | -| [post](./kibana-plugin-core-public.httpsetup.post.md) | HttpHandler | Makes an HTTP request with the POST method. See [HttpHandler](./kibana-plugin-core-public.httphandler.md) for options. | -| [put](./kibana-plugin-core-public.httpsetup.put.md) | HttpHandler | Makes an HTTP request with the PUT method. See [HttpHandler](./kibana-plugin-core-public.httphandler.md) for options. | +| [anonymousPaths](./kibana-plugin-core-public.httpsetup.anonymouspaths.md) | IAnonymousPaths | APIs for denoting certain paths for not requiring authentication | +| [basePath](./kibana-plugin-core-public.httpsetup.basepath.md) | IBasePath | APIs for manipulating the basePath on URL segments. See [IBasePath](./kibana-plugin-core-public.ibasepath.md) | +| [delete](./kibana-plugin-core-public.httpsetup.delete.md) | HttpHandler | Makes an HTTP request with the DELETE method. See [HttpHandler](./kibana-plugin-core-public.httphandler.md) for options. | +| [externalUrl](./kibana-plugin-core-public.httpsetup.externalurl.md) | IExternalUrl | | +| [fetch](./kibana-plugin-core-public.httpsetup.fetch.md) | HttpHandler | Makes an HTTP request. Defaults to a GET request unless overridden. See [HttpHandler](./kibana-plugin-core-public.httphandler.md) for options. | +| [get](./kibana-plugin-core-public.httpsetup.get.md) | HttpHandler | Makes an HTTP request with the GET method. See [HttpHandler](./kibana-plugin-core-public.httphandler.md) for options. | +| [head](./kibana-plugin-core-public.httpsetup.head.md) | HttpHandler | Makes an HTTP request with the HEAD method. See [HttpHandler](./kibana-plugin-core-public.httphandler.md) for options. | +| [options](./kibana-plugin-core-public.httpsetup.options.md) | HttpHandler | Makes an HTTP request with the OPTIONS method. See [HttpHandler](./kibana-plugin-core-public.httphandler.md) for options. | +| [patch](./kibana-plugin-core-public.httpsetup.patch.md) | HttpHandler | Makes an HTTP request with the PATCH method. See [HttpHandler](./kibana-plugin-core-public.httphandler.md) for options. | +| [post](./kibana-plugin-core-public.httpsetup.post.md) | HttpHandler | Makes an HTTP request with the POST method. See [HttpHandler](./kibana-plugin-core-public.httphandler.md) for options. | +| [put](./kibana-plugin-core-public.httpsetup.put.md) | HttpHandler | Makes an HTTP request with the PUT method. See [HttpHandler](./kibana-plugin-core-public.httphandler.md) for options. | ## Methods diff --git a/docs/development/core/public/kibana-plugin-core-public.i18nstart.md b/docs/development/core/public/kibana-plugin-core-public.i18nstart.md index 5aff9d69c45901..586f5797abe6c1 100644 --- a/docs/development/core/public/kibana-plugin-core-public.i18nstart.md +++ b/docs/development/core/public/kibana-plugin-core-public.i18nstart.md @@ -16,5 +16,5 @@ export interface I18nStart | Property | Type | Description | | --- | --- | --- | -| [Context](./kibana-plugin-core-public.i18nstart.context.md) | ({ children }: {
children: React.ReactNode;
}) => JSX.Element | React Context provider required as the topmost component for any i18n-compatible React tree. | +| [Context](./kibana-plugin-core-public.i18nstart.context.md) | ({ children }: { children: React.ReactNode; }) => JSX.Element | React Context provider required as the topmost component for any i18n-compatible React tree. | diff --git a/docs/development/core/public/kibana-plugin-core-public.ianonymouspaths.isanonymous.md b/docs/development/core/public/kibana-plugin-core-public.ianonymouspaths.isanonymous.md index 179b4e0e8663ef..115285c84ea780 100644 --- a/docs/development/core/public/kibana-plugin-core-public.ianonymouspaths.isanonymous.md +++ b/docs/development/core/public/kibana-plugin-core-public.ianonymouspaths.isanonymous.md @@ -16,9 +16,9 @@ isAnonymous(path: string): boolean; | Parameter | Type | Description | | --- | --- | --- | -| path | string | | +| path | string | | Returns: -`boolean` +boolean diff --git a/docs/development/core/public/kibana-plugin-core-public.ianonymouspaths.register.md b/docs/development/core/public/kibana-plugin-core-public.ianonymouspaths.register.md index 5188ffd24f7f15..bfcc0f6decd5d1 100644 --- a/docs/development/core/public/kibana-plugin-core-public.ianonymouspaths.register.md +++ b/docs/development/core/public/kibana-plugin-core-public.ianonymouspaths.register.md @@ -16,9 +16,9 @@ register(path: string): void; | Parameter | Type | Description | | --- | --- | --- | -| path | string | | +| path | string | | Returns: -`void` +void diff --git a/docs/development/core/public/kibana-plugin-core-public.ibasepath.md b/docs/development/core/public/kibana-plugin-core-public.ibasepath.md index 3afce9fee2a7cd..72a863f7d515ce 100644 --- a/docs/development/core/public/kibana-plugin-core-public.ibasepath.md +++ b/docs/development/core/public/kibana-plugin-core-public.ibasepath.md @@ -16,9 +16,9 @@ export interface IBasePath | Property | Type | Description | | --- | --- | --- | -| [get](./kibana-plugin-core-public.ibasepath.get.md) | () => string | Gets the basePath string. | -| [prepend](./kibana-plugin-core-public.ibasepath.prepend.md) | (url: string) => string | Prepends path with the basePath. | -| [publicBaseUrl](./kibana-plugin-core-public.ibasepath.publicbaseurl.md) | string | The server's publicly exposed base URL, if configured. Includes protocol, host, port (optional) and the [IBasePath.serverBasePath](./kibana-plugin-core-public.ibasepath.serverbasepath.md). | -| [remove](./kibana-plugin-core-public.ibasepath.remove.md) | (url: string) => string | Removes the prepended basePath from the path. | -| [serverBasePath](./kibana-plugin-core-public.ibasepath.serverbasepath.md) | string | Returns the server's root basePath as configured, without any namespace prefix.See for getting the basePath value for a specific request | +| [get](./kibana-plugin-core-public.ibasepath.get.md) | () => string | Gets the basePath string. | +| [prepend](./kibana-plugin-core-public.ibasepath.prepend.md) | (url: string) => string | Prepends path with the basePath. | +| [publicBaseUrl?](./kibana-plugin-core-public.ibasepath.publicbaseurl.md) | string | (Optional) The server's publicly exposed base URL, if configured. Includes protocol, host, port (optional) and the [IBasePath.serverBasePath](./kibana-plugin-core-public.ibasepath.serverbasepath.md). | +| [remove](./kibana-plugin-core-public.ibasepath.remove.md) | (url: string) => string | Removes the prepended basePath from the path. | +| [serverBasePath](./kibana-plugin-core-public.ibasepath.serverbasepath.md) | string | Returns the server's root basePath as configured, without any namespace prefix.See for getting the basePath value for a specific request | diff --git a/docs/development/core/public/kibana-plugin-core-public.iexternalurl.validateurl.md b/docs/development/core/public/kibana-plugin-core-public.iexternalurl.validateurl.md index 466d7cfebf547a..24140effc45d98 100644 --- a/docs/development/core/public/kibana-plugin-core-public.iexternalurl.validateurl.md +++ b/docs/development/core/public/kibana-plugin-core-public.iexternalurl.validateurl.md @@ -18,9 +18,9 @@ validateUrl(relativeOrAbsoluteUrl: string): URL | null; | Parameter | Type | Description | | --- | --- | --- | -| relativeOrAbsoluteUrl | string | | +| relativeOrAbsoluteUrl | string | | Returns: -`URL | null` +URL \| null diff --git a/docs/development/core/public/kibana-plugin-core-public.iexternalurlpolicy.host.md b/docs/development/core/public/kibana-plugin-core-public.iexternalurlpolicy.host.md index 842d86db45d73c..1d3c9fc9bbaf16 100644 --- a/docs/development/core/public/kibana-plugin-core-public.iexternalurlpolicy.host.md +++ b/docs/development/core/public/kibana-plugin-core-public.iexternalurlpolicy.host.md @@ -19,6 +19,5 @@ host?: string; // allows access to all of google.com, using any protocol. allow: true, host: 'google.com' - ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.iexternalurlpolicy.md b/docs/development/core/public/kibana-plugin-core-public.iexternalurlpolicy.md index 3a1e5714609741..6623fec18d9768 100644 --- a/docs/development/core/public/kibana-plugin-core-public.iexternalurlpolicy.md +++ b/docs/development/core/public/kibana-plugin-core-public.iexternalurlpolicy.md @@ -16,7 +16,7 @@ export interface IExternalUrlPolicy | Property | Type | Description | | --- | --- | --- | -| [allow](./kibana-plugin-core-public.iexternalurlpolicy.allow.md) | boolean | Indicates if this policy allows or denies access to the described destination. | -| [host](./kibana-plugin-core-public.iexternalurlpolicy.host.md) | string | Optional host describing the external destination. May be combined with protocol. | -| [protocol](./kibana-plugin-core-public.iexternalurlpolicy.protocol.md) | string | Optional protocol describing the external destination. May be combined with host. | +| [allow](./kibana-plugin-core-public.iexternalurlpolicy.allow.md) | boolean | Indicates if this policy allows or denies access to the described destination. | +| [host?](./kibana-plugin-core-public.iexternalurlpolicy.host.md) | string | (Optional) Optional host describing the external destination. May be combined with protocol. | +| [protocol?](./kibana-plugin-core-public.iexternalurlpolicy.protocol.md) | string | (Optional) Optional protocol describing the external destination. May be combined with host. | diff --git a/docs/development/core/public/kibana-plugin-core-public.iexternalurlpolicy.protocol.md b/docs/development/core/public/kibana-plugin-core-public.iexternalurlpolicy.protocol.md index ac73412b6e1437..6b6f8b9638bb80 100644 --- a/docs/development/core/public/kibana-plugin-core-public.iexternalurlpolicy.protocol.md +++ b/docs/development/core/public/kibana-plugin-core-public.iexternalurlpolicy.protocol.md @@ -19,6 +19,5 @@ protocol?: string; // allows access to all destinations over the `https` protocol. allow: true, protocol: 'https' - ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.ihttpfetcherror.md b/docs/development/core/public/kibana-plugin-core-public.ihttpfetcherror.md index 8c21d1636711f3..9aaae1be720287 100644 --- a/docs/development/core/public/kibana-plugin-core-public.ihttpfetcherror.md +++ b/docs/development/core/public/kibana-plugin-core-public.ihttpfetcherror.md @@ -10,15 +10,16 @@ ```typescript export interface IHttpFetchError extends Error ``` +Extends: Error ## Properties | Property | Type | Description | | --- | --- | --- | -| [body](./kibana-plugin-core-public.ihttpfetcherror.body.md) | TResponseBody | | -| [name](./kibana-plugin-core-public.ihttpfetcherror.name.md) | string | | -| [req](./kibana-plugin-core-public.ihttpfetcherror.req.md) | Request | | -| [request](./kibana-plugin-core-public.ihttpfetcherror.request.md) | Request | | -| [res](./kibana-plugin-core-public.ihttpfetcherror.res.md) | Response | | -| [response](./kibana-plugin-core-public.ihttpfetcherror.response.md) | Response | | +| [body?](./kibana-plugin-core-public.ihttpfetcherror.body.md) | TResponseBody | (Optional) | +| [name](./kibana-plugin-core-public.ihttpfetcherror.name.md) | string | | +| [req](./kibana-plugin-core-public.ihttpfetcherror.req.md) | Request | | +| [request](./kibana-plugin-core-public.ihttpfetcherror.request.md) | Request | | +| [res?](./kibana-plugin-core-public.ihttpfetcherror.res.md) | Response | (Optional) | +| [response?](./kibana-plugin-core-public.ihttpfetcherror.response.md) | Response | (Optional) | diff --git a/docs/development/core/public/kibana-plugin-core-public.ihttpinterceptcontroller.halt.md b/docs/development/core/public/kibana-plugin-core-public.ihttpinterceptcontroller.halt.md index 012805d22ba4e4..b982e4dbac8a65 100644 --- a/docs/development/core/public/kibana-plugin-core-public.ihttpinterceptcontroller.halt.md +++ b/docs/development/core/public/kibana-plugin-core-public.ihttpinterceptcontroller.halt.md @@ -13,5 +13,5 @@ halt(): void; ``` Returns: -`void` +void diff --git a/docs/development/core/public/kibana-plugin-core-public.ihttpinterceptcontroller.md b/docs/development/core/public/kibana-plugin-core-public.ihttpinterceptcontroller.md index 5b720fda34f4b9..15a66ef569e7dd 100644 --- a/docs/development/core/public/kibana-plugin-core-public.ihttpinterceptcontroller.md +++ b/docs/development/core/public/kibana-plugin-core-public.ihttpinterceptcontroller.md @@ -16,7 +16,7 @@ export interface IHttpInterceptController | Property | Type | Description | | --- | --- | --- | -| [halted](./kibana-plugin-core-public.ihttpinterceptcontroller.halted.md) | boolean | Whether or not this chain has been halted. | +| [halted](./kibana-plugin-core-public.ihttpinterceptcontroller.halted.md) | boolean | Whether or not this chain has been halted. | ## Methods diff --git a/docs/development/core/public/kibana-plugin-core-public.ihttpresponseinterceptoroverrides.md b/docs/development/core/public/kibana-plugin-core-public.ihttpresponseinterceptoroverrides.md index 4b55cec8f3a2f3..57a4555cd6da5a 100644 --- a/docs/development/core/public/kibana-plugin-core-public.ihttpresponseinterceptoroverrides.md +++ b/docs/development/core/public/kibana-plugin-core-public.ihttpresponseinterceptoroverrides.md @@ -16,6 +16,6 @@ export interface IHttpResponseInterceptorOverrides | Property | Type | Description | | --- | --- | --- | -| [body](./kibana-plugin-core-public.ihttpresponseinterceptoroverrides.body.md) | TResponseBody | Parsed body received, may be undefined if there was an error. | -| [response](./kibana-plugin-core-public.ihttpresponseinterceptoroverrides.response.md) | Readonly<Response> | Raw response received, may be undefined if there was an error. | +| [body?](./kibana-plugin-core-public.ihttpresponseinterceptoroverrides.body.md) | TResponseBody | (Optional) Parsed body received, may be undefined if there was an error. | +| [response?](./kibana-plugin-core-public.ihttpresponseinterceptoroverrides.response.md) | Readonly<Response> | (Optional) Raw response received, may be undefined if there was an error. | diff --git a/docs/development/core/public/kibana-plugin-core-public.iuisettingsclient.md b/docs/development/core/public/kibana-plugin-core-public.iuisettingsclient.md index d6f3b3186b5426..5d2429a799fe67 100644 --- a/docs/development/core/public/kibana-plugin-core-public.iuisettingsclient.md +++ b/docs/development/core/public/kibana-plugin-core-public.iuisettingsclient.md @@ -16,15 +16,15 @@ export interface IUiSettingsClient | Property | Type | Description | | --- | --- | --- | -| [get](./kibana-plugin-core-public.iuisettingsclient.get.md) | <T = any>(key: string, defaultOverride?: T) => T | Gets the value for a specific uiSetting. If this setting has no user-defined value then the defaultOverride parameter is returned (and parsed if setting is of type "json" or "number). If the parameter is not defined and the key is not registered by any plugin then an error is thrown, otherwise reads the default value defined by a plugin. | -| [get$](./kibana-plugin-core-public.iuisettingsclient.get_.md) | <T = any>(key: string, defaultOverride?: T) => Observable<T> | Gets an observable of the current value for a config key, and all updates to that config key in the future. Providing a defaultOverride argument behaves the same as it does in \#get() | -| [getAll](./kibana-plugin-core-public.iuisettingsclient.getall.md) | () => Readonly<Record<string, PublicUiSettingsParams & UserProvidedValues>> | Gets the metadata about all uiSettings, including the type, default value, and user value for each key. | -| [getUpdate$](./kibana-plugin-core-public.iuisettingsclient.getupdate_.md) | <T = any>() => Observable<{
key: string;
newValue: T;
oldValue: T;
}> | Returns an Observable that notifies subscribers of each update to the uiSettings, including the key, newValue, and oldValue of the setting that changed. | -| [getUpdateErrors$](./kibana-plugin-core-public.iuisettingsclient.getupdateerrors_.md) | () => Observable<Error> | Returns an Observable that notifies subscribers of each error while trying to update the settings, containing the actual Error class. | -| [isCustom](./kibana-plugin-core-public.iuisettingsclient.iscustom.md) | (key: string) => boolean | Returns true if the setting wasn't registered by any plugin, but was either added directly via set(), or is an unknown setting found in the uiSettings saved object | -| [isDeclared](./kibana-plugin-core-public.iuisettingsclient.isdeclared.md) | (key: string) => boolean | Returns true if the key is a "known" uiSetting, meaning it is either registered by any plugin or was previously added as a custom setting via the set() method. | -| [isDefault](./kibana-plugin-core-public.iuisettingsclient.isdefault.md) | (key: string) => boolean | Returns true if the setting has no user-defined value or is unknown | -| [isOverridden](./kibana-plugin-core-public.iuisettingsclient.isoverridden.md) | (key: string) => boolean | Shows whether the uiSettings value set by the user. | -| [remove](./kibana-plugin-core-public.iuisettingsclient.remove.md) | (key: string) => Promise<boolean> | Removes the user-defined value for a setting, causing it to revert to the default. This method behaves the same as calling set(key, null), including the synchronization, custom setting, and error behavior of that method. | -| [set](./kibana-plugin-core-public.iuisettingsclient.set.md) | (key: string, value: any) => Promise<boolean> | Sets the value for a uiSetting. If the setting is not registered by any plugin it will be stored as a custom setting. The new value will be synchronously available via the get() method and sent to the server in the background. If the request to the server fails then a updateErrors$ will be notified and the setting will be reverted to its value before set() was called. | +| [get](./kibana-plugin-core-public.iuisettingsclient.get.md) | <T = any>(key: string, defaultOverride?: T) => T | Gets the value for a specific uiSetting. If this setting has no user-defined value then the defaultOverride parameter is returned (and parsed if setting is of type "json" or "number). If the parameter is not defined and the key is not registered by any plugin then an error is thrown, otherwise reads the default value defined by a plugin. | +| [get$](./kibana-plugin-core-public.iuisettingsclient.get_.md) | <T = any>(key: string, defaultOverride?: T) => Observable<T> | Gets an observable of the current value for a config key, and all updates to that config key in the future. Providing a defaultOverride argument behaves the same as it does in \#get() | +| [getAll](./kibana-plugin-core-public.iuisettingsclient.getall.md) | () => Readonly<Record<string, PublicUiSettingsParams & UserProvidedValues>> | Gets the metadata about all uiSettings, including the type, default value, and user value for each key. | +| [getUpdate$](./kibana-plugin-core-public.iuisettingsclient.getupdate_.md) | <T = any>() => Observable<{ key: string; newValue: T; oldValue: T; }> | Returns an Observable that notifies subscribers of each update to the uiSettings, including the key, newValue, and oldValue of the setting that changed. | +| [getUpdateErrors$](./kibana-plugin-core-public.iuisettingsclient.getupdateerrors_.md) | () => Observable<Error> | Returns an Observable that notifies subscribers of each error while trying to update the settings, containing the actual Error class. | +| [isCustom](./kibana-plugin-core-public.iuisettingsclient.iscustom.md) | (key: string) => boolean | Returns true if the setting wasn't registered by any plugin, but was either added directly via set(), or is an unknown setting found in the uiSettings saved object | +| [isDeclared](./kibana-plugin-core-public.iuisettingsclient.isdeclared.md) | (key: string) => boolean | Returns true if the key is a "known" uiSetting, meaning it is either registered by any plugin or was previously added as a custom setting via the set() method. | +| [isDefault](./kibana-plugin-core-public.iuisettingsclient.isdefault.md) | (key: string) => boolean | Returns true if the setting has no user-defined value or is unknown | +| [isOverridden](./kibana-plugin-core-public.iuisettingsclient.isoverridden.md) | (key: string) => boolean | Shows whether the uiSettings value set by the user. | +| [remove](./kibana-plugin-core-public.iuisettingsclient.remove.md) | (key: string) => Promise<boolean> | Removes the user-defined value for a setting, causing it to revert to the default. This method behaves the same as calling set(key, null), including the synchronization, custom setting, and error behavior of that method. | +| [set](./kibana-plugin-core-public.iuisettingsclient.set.md) | (key: string, value: any) => Promise<boolean> | Sets the value for a uiSetting. If the setting is not registered by any plugin it will be stored as a custom setting. The new value will be synchronously available via the get() method and sent to the server in the background. If the request to the server fails then a updateErrors$ will be notified and the setting will be reverted to its value before set() was called. | diff --git a/docs/development/core/public/kibana-plugin-core-public.md b/docs/development/core/public/kibana-plugin-core-public.md index a32dceafd74a9d..dee77e89941554 100644 --- a/docs/development/core/public/kibana-plugin-core-public.md +++ b/docs/development/core/public/kibana-plugin-core-public.md @@ -6,7 +6,7 @@ The Kibana Core APIs for client-side plugins. -A plugin's `public/index` file must contain a named import, `plugin`, that implements [PluginInitializer](./kibana-plugin-core-public.plugininitializer.md) which returns an object that implements [Plugin](./kibana-plugin-core-public.plugin.md). +A plugin's `public/index` file must contain a named import, `plugin`, that implements [PluginInitializer](./kibana-plugin-core-public.plugininitializer.md) which returns an object that implements . The plugin integrates with the core system via lifecycle events: `setup`, `start`, and `stop`. In each lifecycle method, the plugin will receive the corresponding core services available (either [CoreSetup](./kibana-plugin-core-public.coresetup.md) or [CoreStart](./kibana-plugin-core-public.corestart.md)) and any interfaces returned by dependency plugins' lifecycle method. Anything returned by the plugin's lifecycle method will be exposed to downstream dependencies when their corresponding lifecycle methods are invoked. @@ -94,7 +94,7 @@ The plugin integrates with the core system via lifecycle events: `setup` | [OverlayModalStart](./kibana-plugin-core-public.overlaymodalstart.md) | APIs to open and manage modal dialogs. | | [OverlayRef](./kibana-plugin-core-public.overlayref.md) | Returned by [OverlayStart](./kibana-plugin-core-public.overlaystart.md) methods for closing a mounted overlay. | | [OverlayStart](./kibana-plugin-core-public.overlaystart.md) | | -| [Plugin](./kibana-plugin-core-public.plugin.md) | The interface that should be returned by a PluginInitializer. | +| [Plugin\_2](./kibana-plugin-core-public.plugin_2.md) | The interface that should be returned by a PluginInitializer. | | [PluginInitializerContext](./kibana-plugin-core-public.plugininitializercontext.md) | The available core services passed to a PluginInitializer | | [ResolvedSimpleSavedObject](./kibana-plugin-core-public.resolvedsimplesavedobject.md) | This interface is a very simple wrapper for SavedObjects resolved from the server with the [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md). | | [ResponseErrorBody](./kibana-plugin-core-public.responseerrorbody.md) | | diff --git a/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.md b/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.md index 7b01bab056d843..c8ec5bdaf8c0df 100644 --- a/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.md +++ b/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.md @@ -16,9 +16,9 @@ export interface NavigateToAppOptions | Property | Type | Description | | --- | --- | --- | -| [deepLinkId](./kibana-plugin-core-public.navigatetoappoptions.deeplinkid.md) | string | optional [deep link](./kibana-plugin-core-public.app.deeplinks.md) id inside the application to navigate to. If an additional [path](./kibana-plugin-core-public.navigatetoappoptions.path.md) is defined it will be appended to the deep link path. | -| [openInNewTab](./kibana-plugin-core-public.navigatetoappoptions.openinnewtab.md) | boolean | if true, will open the app in new tab, will share session information via window.open if base | -| [path](./kibana-plugin-core-public.navigatetoappoptions.path.md) | string | optional path inside application to deep link to. If undefined, will use [the app's default path](./kibana-plugin-core-public.app.defaultpath.md) as default. | -| [replace](./kibana-plugin-core-public.navigatetoappoptions.replace.md) | boolean | if true, will not create a new history entry when navigating (using replace instead of push) | -| [state](./kibana-plugin-core-public.navigatetoappoptions.state.md) | unknown | optional state to forward to the application | +| [deepLinkId?](./kibana-plugin-core-public.navigatetoappoptions.deeplinkid.md) | string | (Optional) optional [deep link](./kibana-plugin-core-public.app.deeplinks.md) id inside the application to navigate to. If an additional [path](./kibana-plugin-core-public.navigatetoappoptions.path.md) is defined it will be appended to the deep link path. | +| [openInNewTab?](./kibana-plugin-core-public.navigatetoappoptions.openinnewtab.md) | boolean | (Optional) if true, will open the app in new tab, will share session information via window.open if base | +| [path?](./kibana-plugin-core-public.navigatetoappoptions.path.md) | string | (Optional) optional path inside application to deep link to. If undefined, will use [the app's default path](./kibana-plugin-core-public.app.defaultpath.md) as default. | +| [replace?](./kibana-plugin-core-public.navigatetoappoptions.replace.md) | boolean | (Optional) if true, will not create a new history entry when navigating (using replace instead of push) | +| [state?](./kibana-plugin-core-public.navigatetoappoptions.state.md) | unknown | (Optional) optional state to forward to the application | diff --git a/docs/development/core/public/kibana-plugin-core-public.notificationssetup.md b/docs/development/core/public/kibana-plugin-core-public.notificationssetup.md index fb78fb055a79dd..efaeafa1afb1a2 100644 --- a/docs/development/core/public/kibana-plugin-core-public.notificationssetup.md +++ b/docs/development/core/public/kibana-plugin-core-public.notificationssetup.md @@ -15,5 +15,5 @@ export interface NotificationsSetup | Property | Type | Description | | --- | --- | --- | -| [toasts](./kibana-plugin-core-public.notificationssetup.toasts.md) | ToastsSetup | [ToastsSetup](./kibana-plugin-core-public.toastssetup.md) | +| [toasts](./kibana-plugin-core-public.notificationssetup.toasts.md) | ToastsSetup | [ToastsSetup](./kibana-plugin-core-public.toastssetup.md) | diff --git a/docs/development/core/public/kibana-plugin-core-public.notificationsstart.md b/docs/development/core/public/kibana-plugin-core-public.notificationsstart.md index 9b1f6e62400f03..0e77badd51235e 100644 --- a/docs/development/core/public/kibana-plugin-core-public.notificationsstart.md +++ b/docs/development/core/public/kibana-plugin-core-public.notificationsstart.md @@ -15,5 +15,5 @@ export interface NotificationsStart | Property | Type | Description | | --- | --- | --- | -| [toasts](./kibana-plugin-core-public.notificationsstart.toasts.md) | ToastsStart | [ToastsStart](./kibana-plugin-core-public.toastsstart.md) | +| [toasts](./kibana-plugin-core-public.notificationsstart.toasts.md) | ToastsStart | [ToastsStart](./kibana-plugin-core-public.toastsstart.md) | diff --git a/docs/development/core/public/kibana-plugin-core-public.overlaybannersstart.add.md b/docs/development/core/public/kibana-plugin-core-public.overlaybannersstart.add.md index 4cedda4e8092af..fd3ce0b3a42923 100644 --- a/docs/development/core/public/kibana-plugin-core-public.overlaybannersstart.add.md +++ b/docs/development/core/public/kibana-plugin-core-public.overlaybannersstart.add.md @@ -16,12 +16,12 @@ add(mount: MountPoint, priority?: number): string; | Parameter | Type | Description | | --- | --- | --- | -| mount | MountPoint | | -| priority | number | | +| mount | MountPoint | [MountPoint](./kibana-plugin-core-public.mountpoint.md) | +| priority | number | optional priority order to display this banner. Higher priority values are shown first. | Returns: -`string` +string a unique identifier for the given banner to be used with [OverlayBannersStart.remove()](./kibana-plugin-core-public.overlaybannersstart.remove.md) and [OverlayBannersStart.replace()](./kibana-plugin-core-public.overlaybannersstart.replace.md) diff --git a/docs/development/core/public/kibana-plugin-core-public.overlaybannersstart.getcomponent.md b/docs/development/core/public/kibana-plugin-core-public.overlaybannersstart.getcomponent.md index dc167f4f8fb8d7..b5f0ab1d012995 100644 --- a/docs/development/core/public/kibana-plugin-core-public.overlaybannersstart.getcomponent.md +++ b/docs/development/core/public/kibana-plugin-core-public.overlaybannersstart.getcomponent.md @@ -11,5 +11,5 @@ getComponent(): JSX.Element; ``` Returns: -`JSX.Element` +JSX.Element diff --git a/docs/development/core/public/kibana-plugin-core-public.overlaybannersstart.remove.md b/docs/development/core/public/kibana-plugin-core-public.overlaybannersstart.remove.md index 2c69506afb612b..ce1e3ee08bd51b 100644 --- a/docs/development/core/public/kibana-plugin-core-public.overlaybannersstart.remove.md +++ b/docs/development/core/public/kibana-plugin-core-public.overlaybannersstart.remove.md @@ -16,11 +16,11 @@ remove(id: string): boolean; | Parameter | Type | Description | | --- | --- | --- | -| id | string | | +| id | string | the unique identifier for the banner returned by [OverlayBannersStart.add()](./kibana-plugin-core-public.overlaybannersstart.add.md) | Returns: -`boolean` +boolean if the banner was found or not diff --git a/docs/development/core/public/kibana-plugin-core-public.overlaybannersstart.replace.md b/docs/development/core/public/kibana-plugin-core-public.overlaybannersstart.replace.md index 1112d781bae4fe..ea16c739cc8470 100644 --- a/docs/development/core/public/kibana-plugin-core-public.overlaybannersstart.replace.md +++ b/docs/development/core/public/kibana-plugin-core-public.overlaybannersstart.replace.md @@ -16,13 +16,13 @@ replace(id: string | undefined, mount: MountPoint, priority?: number): string; | Parameter | Type | Description | | --- | --- | --- | -| id | string | undefined | | -| mount | MountPoint | | -| priority | number | | +| id | string \| undefined | the unique identifier for the banner returned by [OverlayBannersStart.add()](./kibana-plugin-core-public.overlaybannersstart.add.md) | +| mount | MountPoint | [MountPoint](./kibana-plugin-core-public.mountpoint.md) | +| priority | number | optional priority order to display this banner. Higher priority values are shown first. | Returns: -`string` +string a new identifier for the given banner to be used with [OverlayBannersStart.remove()](./kibana-plugin-core-public.overlaybannersstart.remove.md) and [OverlayBannersStart.replace()](./kibana-plugin-core-public.overlaybannersstart.replace.md) diff --git a/docs/development/core/public/kibana-plugin-core-public.overlayflyoutopenoptions.md b/docs/development/core/public/kibana-plugin-core-public.overlayflyoutopenoptions.md index 611b2206bccdca..defbf79b0ffe2f 100644 --- a/docs/development/core/public/kibana-plugin-core-public.overlayflyoutopenoptions.md +++ b/docs/development/core/public/kibana-plugin-core-public.overlayflyoutopenoptions.md @@ -15,14 +15,14 @@ export interface OverlayFlyoutOpenOptions | Property | Type | Description | | --- | --- | --- | -| ["aria-label"](./kibana-plugin-core-public.overlayflyoutopenoptions._aria-label_.md) | string | | -| ["data-test-subj"](./kibana-plugin-core-public.overlayflyoutopenoptions._data-test-subj_.md) | string | | -| [className](./kibana-plugin-core-public.overlayflyoutopenoptions.classname.md) | string | | -| [closeButtonAriaLabel](./kibana-plugin-core-public.overlayflyoutopenoptions.closebuttonarialabel.md) | string | | -| [hideCloseButton](./kibana-plugin-core-public.overlayflyoutopenoptions.hideclosebutton.md) | boolean | | -| [maskProps](./kibana-plugin-core-public.overlayflyoutopenoptions.maskprops.md) | EuiOverlayMaskProps | | -| [maxWidth](./kibana-plugin-core-public.overlayflyoutopenoptions.maxwidth.md) | boolean | number | string | | -| [onClose](./kibana-plugin-core-public.overlayflyoutopenoptions.onclose.md) | (flyout: OverlayRef) => void | EuiFlyout onClose handler. If provided the consumer is responsible for calling flyout.close() to close the flyout; | -| [ownFocus](./kibana-plugin-core-public.overlayflyoutopenoptions.ownfocus.md) | boolean | | -| [size](./kibana-plugin-core-public.overlayflyoutopenoptions.size.md) | EuiFlyoutSize | | +| ["aria-label"?](./kibana-plugin-core-public.overlayflyoutopenoptions._aria-label_.md) | string | (Optional) | +| ["data-test-subj"?](./kibana-plugin-core-public.overlayflyoutopenoptions._data-test-subj_.md) | string | (Optional) | +| [className?](./kibana-plugin-core-public.overlayflyoutopenoptions.classname.md) | string | (Optional) | +| [closeButtonAriaLabel?](./kibana-plugin-core-public.overlayflyoutopenoptions.closebuttonarialabel.md) | string | (Optional) | +| [hideCloseButton?](./kibana-plugin-core-public.overlayflyoutopenoptions.hideclosebutton.md) | boolean | (Optional) | +| [maskProps?](./kibana-plugin-core-public.overlayflyoutopenoptions.maskprops.md) | EuiOverlayMaskProps | (Optional) | +| [maxWidth?](./kibana-plugin-core-public.overlayflyoutopenoptions.maxwidth.md) | boolean \| number \| string | (Optional) | +| [onClose?](./kibana-plugin-core-public.overlayflyoutopenoptions.onclose.md) | (flyout: OverlayRef) => void | (Optional) EuiFlyout onClose handler. If provided the consumer is responsible for calling flyout.close() to close the flyout; | +| [ownFocus?](./kibana-plugin-core-public.overlayflyoutopenoptions.ownfocus.md) | boolean | (Optional) | +| [size?](./kibana-plugin-core-public.overlayflyoutopenoptions.size.md) | EuiFlyoutSize | (Optional) | diff --git a/docs/development/core/public/kibana-plugin-core-public.overlayflyoutstart.open.md b/docs/development/core/public/kibana-plugin-core-public.overlayflyoutstart.open.md index 1f740410ca282a..94290eb91f9421 100644 --- a/docs/development/core/public/kibana-plugin-core-public.overlayflyoutstart.open.md +++ b/docs/development/core/public/kibana-plugin-core-public.overlayflyoutstart.open.md @@ -16,10 +16,10 @@ open(mount: MountPoint, options?: OverlayFlyoutOpenOptions): OverlayRef; | Parameter | Type | Description | | --- | --- | --- | -| mount | MountPoint | | -| options | OverlayFlyoutOpenOptions | | +| mount | MountPoint | [MountPoint](./kibana-plugin-core-public.mountpoint.md) - Mounts the children inside a flyout panel | +| options | OverlayFlyoutOpenOptions | [OverlayFlyoutOpenOptions](./kibana-plugin-core-public.overlayflyoutopenoptions.md) - options for the flyout [OverlayRef](./kibana-plugin-core-public.overlayref.md) A reference to the opened flyout panel. | Returns: -`OverlayRef` +OverlayRef diff --git a/docs/development/core/public/kibana-plugin-core-public.overlaymodalconfirmoptions.md b/docs/development/core/public/kibana-plugin-core-public.overlaymodalconfirmoptions.md index 83405a151a3729..2f672e551ba51a 100644 --- a/docs/development/core/public/kibana-plugin-core-public.overlaymodalconfirmoptions.md +++ b/docs/development/core/public/kibana-plugin-core-public.overlaymodalconfirmoptions.md @@ -15,13 +15,13 @@ export interface OverlayModalConfirmOptions | Property | Type | Description | | --- | --- | --- | -| ["data-test-subj"](./kibana-plugin-core-public.overlaymodalconfirmoptions._data-test-subj_.md) | string | | -| [buttonColor](./kibana-plugin-core-public.overlaymodalconfirmoptions.buttoncolor.md) | EuiConfirmModalProps['buttonColor'] | | -| [cancelButtonText](./kibana-plugin-core-public.overlaymodalconfirmoptions.cancelbuttontext.md) | string | | -| [className](./kibana-plugin-core-public.overlaymodalconfirmoptions.classname.md) | string | | -| [closeButtonAriaLabel](./kibana-plugin-core-public.overlaymodalconfirmoptions.closebuttonarialabel.md) | string | | -| [confirmButtonText](./kibana-plugin-core-public.overlaymodalconfirmoptions.confirmbuttontext.md) | string | | -| [defaultFocusedButton](./kibana-plugin-core-public.overlaymodalconfirmoptions.defaultfocusedbutton.md) | EuiConfirmModalProps['defaultFocusedButton'] | | -| [maxWidth](./kibana-plugin-core-public.overlaymodalconfirmoptions.maxwidth.md) | boolean | number | string | Sets the max-width of the modal. Set to true to use the default (euiBreakpoints 'm'), set to false to not restrict the width, set to a number for a custom width in px, set to a string for a custom width in custom measurement. | -| [title](./kibana-plugin-core-public.overlaymodalconfirmoptions.title.md) | string | | +| ["data-test-subj"?](./kibana-plugin-core-public.overlaymodalconfirmoptions._data-test-subj_.md) | string | (Optional) | +| [buttonColor?](./kibana-plugin-core-public.overlaymodalconfirmoptions.buttoncolor.md) | EuiConfirmModalProps\['buttonColor'\] | (Optional) | +| [cancelButtonText?](./kibana-plugin-core-public.overlaymodalconfirmoptions.cancelbuttontext.md) | string | (Optional) | +| [className?](./kibana-plugin-core-public.overlaymodalconfirmoptions.classname.md) | string | (Optional) | +| [closeButtonAriaLabel?](./kibana-plugin-core-public.overlaymodalconfirmoptions.closebuttonarialabel.md) | string | (Optional) | +| [confirmButtonText?](./kibana-plugin-core-public.overlaymodalconfirmoptions.confirmbuttontext.md) | string | (Optional) | +| [defaultFocusedButton?](./kibana-plugin-core-public.overlaymodalconfirmoptions.defaultfocusedbutton.md) | EuiConfirmModalProps\['defaultFocusedButton'\] | (Optional) | +| [maxWidth?](./kibana-plugin-core-public.overlaymodalconfirmoptions.maxwidth.md) | boolean \| number \| string | (Optional) Sets the max-width of the modal. Set to true to use the default (euiBreakpoints 'm'), set to false to not restrict the width, set to a number for a custom width in px, set to a string for a custom width in custom measurement. | +| [title?](./kibana-plugin-core-public.overlaymodalconfirmoptions.title.md) | string | (Optional) | diff --git a/docs/development/core/public/kibana-plugin-core-public.overlaymodalopenoptions.md b/docs/development/core/public/kibana-plugin-core-public.overlaymodalopenoptions.md index 5307a8357a8142..5fc978ea26262f 100644 --- a/docs/development/core/public/kibana-plugin-core-public.overlaymodalopenoptions.md +++ b/docs/development/core/public/kibana-plugin-core-public.overlaymodalopenoptions.md @@ -15,8 +15,8 @@ export interface OverlayModalOpenOptions | Property | Type | Description | | --- | --- | --- | -| ["data-test-subj"](./kibana-plugin-core-public.overlaymodalopenoptions._data-test-subj_.md) | string | | -| [className](./kibana-plugin-core-public.overlaymodalopenoptions.classname.md) | string | | -| [closeButtonAriaLabel](./kibana-plugin-core-public.overlaymodalopenoptions.closebuttonarialabel.md) | string | | -| [maxWidth](./kibana-plugin-core-public.overlaymodalopenoptions.maxwidth.md) | boolean | number | string | | +| ["data-test-subj"?](./kibana-plugin-core-public.overlaymodalopenoptions._data-test-subj_.md) | string | (Optional) | +| [className?](./kibana-plugin-core-public.overlaymodalopenoptions.classname.md) | string | (Optional) | +| [closeButtonAriaLabel?](./kibana-plugin-core-public.overlaymodalopenoptions.closebuttonarialabel.md) | string | (Optional) | +| [maxWidth?](./kibana-plugin-core-public.overlaymodalopenoptions.maxwidth.md) | boolean \| number \| string | (Optional) | diff --git a/docs/development/core/public/kibana-plugin-core-public.overlaymodalstart.open.md b/docs/development/core/public/kibana-plugin-core-public.overlaymodalstart.open.md index 1c6b82e37a6244..35bfa406b4d171 100644 --- a/docs/development/core/public/kibana-plugin-core-public.overlaymodalstart.open.md +++ b/docs/development/core/public/kibana-plugin-core-public.overlaymodalstart.open.md @@ -16,10 +16,10 @@ open(mount: MountPoint, options?: OverlayModalOpenOptions): OverlayRef; | Parameter | Type | Description | | --- | --- | --- | -| mount | MountPoint | | -| options | OverlayModalOpenOptions | | +| mount | MountPoint | [MountPoint](./kibana-plugin-core-public.mountpoint.md) - Mounts the children inside the modal | +| options | OverlayModalOpenOptions | [OverlayModalOpenOptions](./kibana-plugin-core-public.overlaymodalopenoptions.md) - options for the modal [OverlayRef](./kibana-plugin-core-public.overlayref.md) A reference to the opened modal. | Returns: -`OverlayRef` +OverlayRef diff --git a/docs/development/core/public/kibana-plugin-core-public.overlaymodalstart.openconfirm.md b/docs/development/core/public/kibana-plugin-core-public.overlaymodalstart.openconfirm.md index b0052c0f6460ed..056f512de87bfb 100644 --- a/docs/development/core/public/kibana-plugin-core-public.overlaymodalstart.openconfirm.md +++ b/docs/development/core/public/kibana-plugin-core-public.overlaymodalstart.openconfirm.md @@ -16,10 +16,10 @@ openConfirm(message: MountPoint | string, options?: OverlayModalConfirmOptions): | Parameter | Type | Description | | --- | --- | --- | -| message | MountPoint | string | | -| options | OverlayModalConfirmOptions | | +| message | MountPoint \| string | [MountPoint](./kibana-plugin-core-public.mountpoint.md) - string or mountpoint to be used a the confirm message body | +| options | OverlayModalConfirmOptions | [OverlayModalConfirmOptions](./kibana-plugin-core-public.overlaymodalconfirmoptions.md) - options for the confirm modal | Returns: -`Promise` +Promise<boolean> diff --git a/docs/development/core/public/kibana-plugin-core-public.overlayref.close.md b/docs/development/core/public/kibana-plugin-core-public.overlayref.close.md index 656afa64e5490d..454723f6ffd09c 100644 --- a/docs/development/core/public/kibana-plugin-core-public.overlayref.close.md +++ b/docs/development/core/public/kibana-plugin-core-public.overlayref.close.md @@ -13,5 +13,5 @@ close(): Promise; ``` Returns: -`Promise` +Promise<void> diff --git a/docs/development/core/public/kibana-plugin-core-public.overlayref.md b/docs/development/core/public/kibana-plugin-core-public.overlayref.md index 0fc76057d03903..da11e284f285d6 100644 --- a/docs/development/core/public/kibana-plugin-core-public.overlayref.md +++ b/docs/development/core/public/kibana-plugin-core-public.overlayref.md @@ -16,7 +16,7 @@ export interface OverlayRef | Property | Type | Description | | --- | --- | --- | -| [onClose](./kibana-plugin-core-public.overlayref.onclose.md) | Promise<void> | A Promise that will resolve once this overlay is closed.Overlays can close from user interaction, calling close() on the overlay reference or another overlay replacing yours via openModal or openFlyout. | +| [onClose](./kibana-plugin-core-public.overlayref.onclose.md) | Promise<void> | A Promise that will resolve once this overlay is closed.Overlays can close from user interaction, calling close() on the overlay reference or another overlay replacing yours via openModal or openFlyout. | ## Methods diff --git a/docs/development/core/public/kibana-plugin-core-public.overlaystart.md b/docs/development/core/public/kibana-plugin-core-public.overlaystart.md index 2cc4d89dda6436..3bbdd4ab9b9189 100644 --- a/docs/development/core/public/kibana-plugin-core-public.overlaystart.md +++ b/docs/development/core/public/kibana-plugin-core-public.overlaystart.md @@ -15,8 +15,8 @@ export interface OverlayStart | Property | Type | Description | | --- | --- | --- | -| [banners](./kibana-plugin-core-public.overlaystart.banners.md) | OverlayBannersStart | [OverlayBannersStart](./kibana-plugin-core-public.overlaybannersstart.md) | -| [openConfirm](./kibana-plugin-core-public.overlaystart.openconfirm.md) | OverlayModalStart['openConfirm'] | | -| [openFlyout](./kibana-plugin-core-public.overlaystart.openflyout.md) | OverlayFlyoutStart['open'] | | -| [openModal](./kibana-plugin-core-public.overlaystart.openmodal.md) | OverlayModalStart['open'] | | +| [banners](./kibana-plugin-core-public.overlaystart.banners.md) | OverlayBannersStart | [OverlayBannersStart](./kibana-plugin-core-public.overlaybannersstart.md) | +| [openConfirm](./kibana-plugin-core-public.overlaystart.openconfirm.md) | OverlayModalStart\['openConfirm'\] | | +| [openFlyout](./kibana-plugin-core-public.overlaystart.openflyout.md) | OverlayFlyoutStart\['open'\] | | +| [openModal](./kibana-plugin-core-public.overlaystart.openmodal.md) | OverlayModalStart\['open'\] | | diff --git a/docs/development/core/public/kibana-plugin-core-public.plugin.md b/docs/development/core/public/kibana-plugin-core-public.plugin_2.md similarity index 56% rename from docs/development/core/public/kibana-plugin-core-public.plugin.md rename to docs/development/core/public/kibana-plugin-core-public.plugin_2.md index 4de46ae55797c9..da8cef9b83cc75 100644 --- a/docs/development/core/public/kibana-plugin-core-public.plugin.md +++ b/docs/development/core/public/kibana-plugin-core-public.plugin_2.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [Plugin](./kibana-plugin-core-public.plugin.md) +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [Plugin\_2](./kibana-plugin-core-public.plugin_2.md) -## Plugin interface +## Plugin\_2 interface The interface that should be returned by a `PluginInitializer`. @@ -16,7 +16,7 @@ export interface Plugin(Optional) | diff --git a/docs/development/core/public/kibana-plugin-core-public.plugin.setup.md b/docs/development/core/public/kibana-plugin-core-public.plugin_2.setup.md similarity index 56% rename from docs/development/core/public/kibana-plugin-core-public.plugin.setup.md rename to docs/development/core/public/kibana-plugin-core-public.plugin_2.setup.md index 232851cd342cee..5ebb5a1a74811e 100644 --- a/docs/development/core/public/kibana-plugin-core-public.plugin.setup.md +++ b/docs/development/core/public/kibana-plugin-core-public.plugin_2.setup.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [Plugin](./kibana-plugin-core-public.plugin.md) > [setup](./kibana-plugin-core-public.plugin.setup.md) +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [Plugin\_2](./kibana-plugin-core-public.plugin_2.md) > [setup](./kibana-plugin-core-public.plugin_2.setup.md) -## Plugin.setup() method +## Plugin\_2.setup() method Signature: @@ -14,10 +14,10 @@ setup(core: CoreSetup, plugins: TPluginsSetup): TSetup; | Parameter | Type | Description | | --- | --- | --- | -| core | CoreSetup<TPluginsStart, TStart> | | -| plugins | TPluginsSetup | | +| core | CoreSetup<TPluginsStart, TStart> | | +| plugins | TPluginsSetup | | Returns: -`TSetup` +TSetup diff --git a/docs/development/core/public/kibana-plugin-core-public.plugin.start.md b/docs/development/core/public/kibana-plugin-core-public.plugin_2.start.md similarity index 57% rename from docs/development/core/public/kibana-plugin-core-public.plugin.start.md rename to docs/development/core/public/kibana-plugin-core-public.plugin_2.start.md index ec5ed211a9d2ba..f4979ee033aaca 100644 --- a/docs/development/core/public/kibana-plugin-core-public.plugin.start.md +++ b/docs/development/core/public/kibana-plugin-core-public.plugin_2.start.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [Plugin](./kibana-plugin-core-public.plugin.md) > [start](./kibana-plugin-core-public.plugin.start.md) +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [Plugin\_2](./kibana-plugin-core-public.plugin_2.md) > [start](./kibana-plugin-core-public.plugin_2.start.md) -## Plugin.start() method +## Plugin\_2.start() method Signature: @@ -14,10 +14,10 @@ start(core: CoreStart, plugins: TPluginsStart): TStart; | Parameter | Type | Description | | --- | --- | --- | -| core | CoreStart | | -| plugins | TPluginsStart | | +| core | CoreStart | | +| plugins | TPluginsStart | | Returns: -`TStart` +TStart diff --git a/docs/development/core/public/kibana-plugin-core-public.plugin.stop.md b/docs/development/core/public/kibana-plugin-core-public.plugin_2.stop.md similarity index 56% rename from docs/development/core/public/kibana-plugin-core-public.plugin.stop.md rename to docs/development/core/public/kibana-plugin-core-public.plugin_2.stop.md index b509d1ae25340f..69532f2d0e09db 100644 --- a/docs/development/core/public/kibana-plugin-core-public.plugin.stop.md +++ b/docs/development/core/public/kibana-plugin-core-public.plugin_2.stop.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [Plugin](./kibana-plugin-core-public.plugin.md) > [stop](./kibana-plugin-core-public.plugin.stop.md) +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [Plugin\_2](./kibana-plugin-core-public.plugin_2.md) > [stop](./kibana-plugin-core-public.plugin_2.stop.md) -## Plugin.stop() method +## Plugin\_2.stop() method Signature: @@ -11,5 +11,5 @@ stop?(): void; ``` Returns: -`void` +void diff --git a/docs/development/core/public/kibana-plugin-core-public.plugininitializercontext.md b/docs/development/core/public/kibana-plugin-core-public.plugininitializercontext.md index 422bf5a71cddca..3304b4bf3def42 100644 --- a/docs/development/core/public/kibana-plugin-core-public.plugininitializercontext.md +++ b/docs/development/core/public/kibana-plugin-core-public.plugininitializercontext.md @@ -16,7 +16,7 @@ export interface PluginInitializerContext | Property | Type | Description | | --- | --- | --- | -| [config](./kibana-plugin-core-public.plugininitializercontext.config.md) | {
get: <T extends object = ConfigSchema>() => T;
} | | -| [env](./kibana-plugin-core-public.plugininitializercontext.env.md) | {
mode: Readonly<EnvironmentMode>;
packageInfo: Readonly<PackageInfo>;
} | | -| [opaqueId](./kibana-plugin-core-public.plugininitializercontext.opaqueid.md) | PluginOpaqueId | A symbol used to identify this plugin in the system. Needed when registering handlers or context providers. | +| [config](./kibana-plugin-core-public.plugininitializercontext.config.md) | { get: <T extends object = ConfigSchema>() => T; } | | +| [env](./kibana-plugin-core-public.plugininitializercontext.env.md) | { mode: Readonly<EnvironmentMode>; packageInfo: Readonly<PackageInfo>; } | | +| [opaqueId](./kibana-plugin-core-public.plugininitializercontext.opaqueid.md) | PluginOpaqueId | A symbol used to identify this plugin in the system. Needed when registering handlers or context providers. | diff --git a/docs/development/core/public/kibana-plugin-core-public.resolvedsimplesavedobject.md b/docs/development/core/public/kibana-plugin-core-public.resolvedsimplesavedobject.md index 4936598c587999..2844bd97db7f27 100644 --- a/docs/development/core/public/kibana-plugin-core-public.resolvedsimplesavedobject.md +++ b/docs/development/core/public/kibana-plugin-core-public.resolvedsimplesavedobject.md @@ -16,7 +16,7 @@ export interface ResolvedSimpleSavedObject | Property | Type | Description | | --- | --- | --- | -| [alias\_target\_id](./kibana-plugin-core-public.resolvedsimplesavedobject.alias_target_id.md) | SavedObjectsResolveResponse['alias_target_id'] | The ID of the object that the legacy URL alias points to. This is only defined when the outcome is 'aliasMatch' or 'conflict'. | -| [outcome](./kibana-plugin-core-public.resolvedsimplesavedobject.outcome.md) | SavedObjectsResolveResponse['outcome'] | The outcome for a successful resolve call is one of the following values:\* 'exactMatch' -- One document exactly matched the given ID. \* 'aliasMatch' -- One document with a legacy URL alias matched the given ID; in this case the saved_object.id field is different than the given ID. \* 'conflict' -- Two documents matched the given ID, one was an exact match and another with a legacy URL alias; in this case the saved_object object is the exact match, and the saved_object.id field is the same as the given ID. | -| [saved\_object](./kibana-plugin-core-public.resolvedsimplesavedobject.saved_object.md) | SimpleSavedObject<T> | The saved object that was found. | +| [alias\_target\_id?](./kibana-plugin-core-public.resolvedsimplesavedobject.alias_target_id.md) | SavedObjectsResolveResponse\['alias\_target\_id'\] | (Optional) The ID of the object that the legacy URL alias points to. This is only defined when the outcome is 'aliasMatch' or 'conflict'. | +| [outcome](./kibana-plugin-core-public.resolvedsimplesavedobject.outcome.md) | SavedObjectsResolveResponse\['outcome'\] | The outcome for a successful resolve call is one of the following values:\* 'exactMatch' -- One document exactly matched the given ID. \* 'aliasMatch' -- One document with a legacy URL alias matched the given ID; in this case the saved_object.id field is different than the given ID. \* 'conflict' -- Two documents matched the given ID, one was an exact match and another with a legacy URL alias; in this case the saved_object object is the exact match, and the saved_object.id field is the same as the given ID. | +| [saved\_object](./kibana-plugin-core-public.resolvedsimplesavedobject.saved_object.md) | SimpleSavedObject<T> | The saved object that was found. | diff --git a/docs/development/core/public/kibana-plugin-core-public.responseerrorbody.md b/docs/development/core/public/kibana-plugin-core-public.responseerrorbody.md index 8a990909fac3ec..5bc9103691014a 100644 --- a/docs/development/core/public/kibana-plugin-core-public.responseerrorbody.md +++ b/docs/development/core/public/kibana-plugin-core-public.responseerrorbody.md @@ -15,7 +15,7 @@ export interface ResponseErrorBody | Property | Type | Description | | --- | --- | --- | -| [attributes](./kibana-plugin-core-public.responseerrorbody.attributes.md) | Record<string, unknown> | | -| [message](./kibana-plugin-core-public.responseerrorbody.message.md) | string | | -| [statusCode](./kibana-plugin-core-public.responseerrorbody.statuscode.md) | number | | +| [attributes?](./kibana-plugin-core-public.responseerrorbody.attributes.md) | Record<string, unknown> | (Optional) | +| [message](./kibana-plugin-core-public.responseerrorbody.message.md) | string | | +| [statusCode](./kibana-plugin-core-public.responseerrorbody.statuscode.md) | number | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobject.md b/docs/development/core/public/kibana-plugin-core-public.savedobject.md index 26f472b741268a..283a960013305d 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobject.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobject.md @@ -14,15 +14,15 @@ export interface SavedObject | Property | Type | Description | | --- | --- | --- | -| [attributes](./kibana-plugin-core-public.savedobject.attributes.md) | T | The data for a Saved Object is stored as an object in the attributes property. | -| [coreMigrationVersion](./kibana-plugin-core-public.savedobject.coremigrationversion.md) | string | A semver value that is used when upgrading objects between Kibana versions. | -| [error](./kibana-plugin-core-public.savedobject.error.md) | SavedObjectError | | -| [id](./kibana-plugin-core-public.savedobject.id.md) | string | The ID of this Saved Object, guaranteed to be unique for all objects of the same type | -| [migrationVersion](./kibana-plugin-core-public.savedobject.migrationversion.md) | SavedObjectsMigrationVersion | Information about the migrations that have been applied to this SavedObject. When Kibana starts up, KibanaMigrator detects outdated documents and migrates them based on this value. For each migration that has been applied, the plugin's name is used as a key and the latest migration version as the value. | -| [namespaces](./kibana-plugin-core-public.savedobject.namespaces.md) | string[] | Space(s) that this saved object exists in. This attribute is not used for "global" saved object types which are registered with namespaceType: 'agnostic'. | -| [originId](./kibana-plugin-core-public.savedobject.originid.md) | string | The ID of the saved object this originated from. This is set if this object's id was regenerated; that can happen during migration from a legacy single-namespace type, or during import. It is only set during migration or create operations. This is used during import to ensure that ID regeneration is deterministic, so saved objects will be overwritten if they are imported multiple times into a given space. | -| [references](./kibana-plugin-core-public.savedobject.references.md) | SavedObjectReference[] | A reference to another saved object. | -| [type](./kibana-plugin-core-public.savedobject.type.md) | string | The type of Saved Object. Each plugin can define it's own custom Saved Object types. | -| [updated\_at](./kibana-plugin-core-public.savedobject.updated_at.md) | string | Timestamp of the last time this document had been updated. | -| [version](./kibana-plugin-core-public.savedobject.version.md) | string | An opaque version number which changes on each successful write operation. Can be used for implementing optimistic concurrency control. | +| [attributes](./kibana-plugin-core-public.savedobject.attributes.md) | T | The data for a Saved Object is stored as an object in the attributes property. | +| [coreMigrationVersion?](./kibana-plugin-core-public.savedobject.coremigrationversion.md) | string | (Optional) A semver value that is used when upgrading objects between Kibana versions. | +| [error?](./kibana-plugin-core-public.savedobject.error.md) | SavedObjectError | (Optional) | +| [id](./kibana-plugin-core-public.savedobject.id.md) | string | The ID of this Saved Object, guaranteed to be unique for all objects of the same type | +| [migrationVersion?](./kibana-plugin-core-public.savedobject.migrationversion.md) | SavedObjectsMigrationVersion | (Optional) Information about the migrations that have been applied to this SavedObject. When Kibana starts up, KibanaMigrator detects outdated documents and migrates them based on this value. For each migration that has been applied, the plugin's name is used as a key and the latest migration version as the value. | +| [namespaces?](./kibana-plugin-core-public.savedobject.namespaces.md) | string\[\] | (Optional) Space(s) that this saved object exists in. This attribute is not used for "global" saved object types which are registered with namespaceType: 'agnostic'. | +| [originId?](./kibana-plugin-core-public.savedobject.originid.md) | string | (Optional) The ID of the saved object this originated from. This is set if this object's id was regenerated; that can happen during migration from a legacy single-namespace type, or during import. It is only set during migration or create operations. This is used during import to ensure that ID regeneration is deterministic, so saved objects will be overwritten if they are imported multiple times into a given space. | +| [references](./kibana-plugin-core-public.savedobject.references.md) | SavedObjectReference\[\] | A reference to another saved object. | +| [type](./kibana-plugin-core-public.savedobject.type.md) | string | The type of Saved Object. Each plugin can define it's own custom Saved Object types. | +| [updated\_at?](./kibana-plugin-core-public.savedobject.updated_at.md) | string | (Optional) Timestamp of the last time this document had been updated. | +| [version?](./kibana-plugin-core-public.savedobject.version.md) | string | (Optional) An opaque version number which changes on each successful write operation. Can be used for implementing optimistic concurrency control. | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjecterror.md b/docs/development/core/public/kibana-plugin-core-public.savedobjecterror.md index 2117cea433b5c6..f6e8874b212b07 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjecterror.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjecterror.md @@ -14,8 +14,8 @@ export interface SavedObjectError | Property | Type | Description | | --- | --- | --- | -| [error](./kibana-plugin-core-public.savedobjecterror.error.md) | string | | -| [message](./kibana-plugin-core-public.savedobjecterror.message.md) | string | | -| [metadata](./kibana-plugin-core-public.savedobjecterror.metadata.md) | Record<string, unknown> | | -| [statusCode](./kibana-plugin-core-public.savedobjecterror.statuscode.md) | number | | +| [error](./kibana-plugin-core-public.savedobjecterror.error.md) | string | | +| [message](./kibana-plugin-core-public.savedobjecterror.message.md) | string | | +| [metadata?](./kibana-plugin-core-public.savedobjecterror.metadata.md) | Record<string, unknown> | (Optional) | +| [statusCode](./kibana-plugin-core-public.savedobjecterror.statuscode.md) | number | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectreference.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectreference.md index 410ab23f0b6044..e63ba254602db4 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectreference.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectreference.md @@ -16,7 +16,7 @@ export interface SavedObjectReference | Property | Type | Description | | --- | --- | --- | -| [id](./kibana-plugin-core-public.savedobjectreference.id.md) | string | | -| [name](./kibana-plugin-core-public.savedobjectreference.name.md) | string | | -| [type](./kibana-plugin-core-public.savedobjectreference.type.md) | string | | +| [id](./kibana-plugin-core-public.savedobjectreference.id.md) | string | | +| [name](./kibana-plugin-core-public.savedobjectreference.name.md) | string | | +| [type](./kibana-plugin-core-public.savedobjectreference.type.md) | string | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectreferencewithcontext.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectreferencewithcontext.md index a79fa96695e36b..39e14607d861f1 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectreferencewithcontext.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectreferencewithcontext.md @@ -16,10 +16,10 @@ export interface SavedObjectReferenceWithContext | Property | Type | Description | | --- | --- | --- | -| [id](./kibana-plugin-core-public.savedobjectreferencewithcontext.id.md) | string | The ID of the referenced object | -| [inboundReferences](./kibana-plugin-core-public.savedobjectreferencewithcontext.inboundreferences.md) | Array<{
type: string;
id: string;
name: string;
}> | References to this object; note that this does not contain \_all inbound references everywhere for this object\_, it only contains inbound references for the scope of this operation | -| [isMissing](./kibana-plugin-core-public.savedobjectreferencewithcontext.ismissing.md) | boolean | Whether or not this object or reference is missing | -| [spaces](./kibana-plugin-core-public.savedobjectreferencewithcontext.spaces.md) | string[] | The space(s) that the referenced object exists in | -| [spacesWithMatchingAliases](./kibana-plugin-core-public.savedobjectreferencewithcontext.spaceswithmatchingaliases.md) | string[] | The space(s) that legacy URL aliases matching this type/id exist in | -| [type](./kibana-plugin-core-public.savedobjectreferencewithcontext.type.md) | string | The type of the referenced object | +| [id](./kibana-plugin-core-public.savedobjectreferencewithcontext.id.md) | string | The ID of the referenced object | +| [inboundReferences](./kibana-plugin-core-public.savedobjectreferencewithcontext.inboundreferences.md) | Array<{ type: string; id: string; name: string; }> | References to this object; note that this does not contain \_all inbound references everywhere for this object\_, it only contains inbound references for the scope of this operation | +| [isMissing?](./kibana-plugin-core-public.savedobjectreferencewithcontext.ismissing.md) | boolean | (Optional) Whether or not this object or reference is missing | +| [spaces](./kibana-plugin-core-public.savedobjectreferencewithcontext.spaces.md) | string\[\] | The space(s) that the referenced object exists in | +| [spacesWithMatchingAliases?](./kibana-plugin-core-public.savedobjectreferencewithcontext.spaceswithmatchingaliases.md) | string\[\] | (Optional) The space(s) that legacy URL aliases matching this type/id exist in | +| [type](./kibana-plugin-core-public.savedobjectreferencewithcontext.type.md) | string | The type of the referenced object | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsbaseoptions.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsbaseoptions.md index 838d8fb1979a89..f86d3b5afc04ec 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsbaseoptions.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsbaseoptions.md @@ -15,5 +15,5 @@ export interface SavedObjectsBaseOptions | Property | Type | Description | | --- | --- | --- | -| [namespace](./kibana-plugin-core-public.savedobjectsbaseoptions.namespace.md) | string | Specify the namespace for this operation | +| [namespace?](./kibana-plugin-core-public.savedobjectsbaseoptions.namespace.md) | string | (Optional) Specify the namespace for this operation | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsbatchresponse.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsbatchresponse.md index 1551836008700d..3926231db17b5b 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsbatchresponse.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsbatchresponse.md @@ -15,5 +15,5 @@ export interface SavedObjectsBatchResponse | Property | Type | Description | | --- | --- | --- | -| [savedObjects](./kibana-plugin-core-public.savedobjectsbatchresponse.savedobjects.md) | Array<SimpleSavedObject<T>> | | +| [savedObjects](./kibana-plugin-core-public.savedobjectsbatchresponse.savedobjects.md) | Array<SimpleSavedObject<T>> | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkcreateobject.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkcreateobject.md index 20d137819a90ef..f9ff61859b1a86 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkcreateobject.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkcreateobject.md @@ -9,11 +9,12 @@ ```typescript export interface SavedObjectsBulkCreateObject extends SavedObjectsCreateOptions ``` +Extends: SavedObjectsCreateOptions ## Properties | Property | Type | Description | | --- | --- | --- | -| [attributes](./kibana-plugin-core-public.savedobjectsbulkcreateobject.attributes.md) | T | | -| [type](./kibana-plugin-core-public.savedobjectsbulkcreateobject.type.md) | string | | +| [attributes](./kibana-plugin-core-public.savedobjectsbulkcreateobject.attributes.md) | T | | +| [type](./kibana-plugin-core-public.savedobjectsbulkcreateobject.type.md) | string | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkcreateoptions.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkcreateoptions.md index 02e659bd858f72..ada12c064e0a1b 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkcreateoptions.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkcreateoptions.md @@ -15,5 +15,5 @@ export interface SavedObjectsBulkCreateOptions | Property | Type | Description | | --- | --- | --- | -| [overwrite](./kibana-plugin-core-public.savedobjectsbulkcreateoptions.overwrite.md) | boolean | If a document with the given id already exists, overwrite it's contents (default=false). | +| [overwrite?](./kibana-plugin-core-public.savedobjectsbulkcreateoptions.overwrite.md) | boolean | (Optional) If a document with the given id already exists, overwrite it's contents (default=false). | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkresolveobject.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkresolveobject.md index 8ca5da9d7db4fc..fbff3d3bd8f258 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkresolveobject.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkresolveobject.md @@ -15,6 +15,6 @@ export interface SavedObjectsBulkResolveObject | Property | Type | Description | | --- | --- | --- | -| [id](./kibana-plugin-core-public.savedobjectsbulkresolveobject.id.md) | string | | -| [type](./kibana-plugin-core-public.savedobjectsbulkresolveobject.type.md) | string | | +| [id](./kibana-plugin-core-public.savedobjectsbulkresolveobject.id.md) | string | | +| [type](./kibana-plugin-core-public.savedobjectsbulkresolveobject.type.md) | string | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkresolveresponse.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkresolveresponse.md index 36a92d02b8aaa1..e34bf6fe326185 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkresolveresponse.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkresolveresponse.md @@ -15,5 +15,5 @@ export interface SavedObjectsBulkResolveResponse | Property | Type | Description | | --- | --- | --- | -| [resolved\_objects](./kibana-plugin-core-public.savedobjectsbulkresolveresponse.resolved_objects.md) | Array<SavedObjectsResolveResponse<T>> | | +| [resolved\_objects](./kibana-plugin-core-public.savedobjectsbulkresolveresponse.resolved_objects.md) | Array<SavedObjectsResolveResponse<T>> | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkupdateobject.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkupdateobject.md index fd6572f2c0cbe3..f28d99cb110c67 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkupdateobject.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkupdateobject.md @@ -15,9 +15,9 @@ export interface SavedObjectsBulkUpdateObject | Property | Type | Description | | --- | --- | --- | -| [attributes](./kibana-plugin-core-public.savedobjectsbulkupdateobject.attributes.md) | T | | -| [id](./kibana-plugin-core-public.savedobjectsbulkupdateobject.id.md) | string | | -| [references](./kibana-plugin-core-public.savedobjectsbulkupdateobject.references.md) | SavedObjectReference[] | | -| [type](./kibana-plugin-core-public.savedobjectsbulkupdateobject.type.md) | string | | -| [version](./kibana-plugin-core-public.savedobjectsbulkupdateobject.version.md) | string | | +| [attributes](./kibana-plugin-core-public.savedobjectsbulkupdateobject.attributes.md) | T | | +| [id](./kibana-plugin-core-public.savedobjectsbulkupdateobject.id.md) | string | | +| [references?](./kibana-plugin-core-public.savedobjectsbulkupdateobject.references.md) | SavedObjectReference\[\] | (Optional) | +| [type](./kibana-plugin-core-public.savedobjectsbulkupdateobject.type.md) | string | | +| [version?](./kibana-plugin-core-public.savedobjectsbulkupdateobject.version.md) | string | (Optional) | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkupdateoptions.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkupdateoptions.md index 35cc72baa0ef6e..a2cdd3eb801e62 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkupdateoptions.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsbulkupdateoptions.md @@ -15,5 +15,5 @@ export interface SavedObjectsBulkUpdateOptions | Property | Type | Description | | --- | --- | --- | -| [namespace](./kibana-plugin-core-public.savedobjectsbulkupdateoptions.namespace.md) | string | | +| [namespace?](./kibana-plugin-core-public.savedobjectsbulkupdateoptions.namespace.md) | string | (Optional) | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.bulkupdate.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.bulkupdate.md index 05c84d9c271923..0e3bfb2bd896b5 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.bulkupdate.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.bulkupdate.md @@ -16,11 +16,11 @@ bulkUpdate(objects?: SavedObjectsBulkUpdateObject[]): PromiseSavedObjectsBulkUpdateObject[] | | +| objects | SavedObjectsBulkUpdateObject\[\] | \[{ type, id, attributes, options: { version, references } }\] | Returns: -`Promise>` +Promise<SavedObjectsBatchResponse<unknown>> The result of the update operation containing both failed and updated saved objects. diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.md index 1a630ebe8c9ae1..d18d680feffd59 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.md @@ -20,14 +20,14 @@ The constructor for this class is marked as internal. Third-party code should no | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [bulkCreate](./kibana-plugin-core-public.savedobjectsclient.bulkcreate.md) | | (objects?: SavedObjectsBulkCreateObject[], options?: SavedObjectsBulkCreateOptions) => Promise<SavedObjectsBatchResponse<unknown>> | Creates multiple documents at once | -| [bulkGet](./kibana-plugin-core-public.savedobjectsclient.bulkget.md) | | (objects?: Array<{
id: string;
type: string;
}>) => Promise<SavedObjectsBatchResponse<unknown>> | Returns an array of objects by id | -| [bulkResolve](./kibana-plugin-core-public.savedobjectsclient.bulkresolve.md) | | <T = unknown>(objects?: Array<{
id: string;
type: string;
}>) => Promise<{
resolved_objects: ResolvedSimpleSavedObject<T>[];
}> | Resolves an array of objects by id, using any legacy URL aliases if they exist | -| [create](./kibana-plugin-core-public.savedobjectsclient.create.md) | | <T = unknown>(type: string, attributes: T, options?: SavedObjectsCreateOptions) => Promise<SimpleSavedObject<T>> | Persists an object | -| [delete](./kibana-plugin-core-public.savedobjectsclient.delete.md) | | (type: string, id: string, options?: SavedObjectsDeleteOptions | undefined) => ReturnType<SavedObjectsApi['delete']> | Deletes an object | -| [find](./kibana-plugin-core-public.savedobjectsclient.find.md) | | <T = unknown, A = unknown>(options: SavedObjectsFindOptions) => Promise<SavedObjectsFindResponsePublic<T, unknown>> | Search for objects | -| [get](./kibana-plugin-core-public.savedobjectsclient.get.md) | | <T = unknown>(type: string, id: string) => Promise<SimpleSavedObject<T>> | Fetches a single object | -| [resolve](./kibana-plugin-core-public.savedobjectsclient.resolve.md) | | <T = unknown>(type: string, id: string) => Promise<ResolvedSimpleSavedObject<T>> | Resolves a single object | +| [bulkCreate](./kibana-plugin-core-public.savedobjectsclient.bulkcreate.md) | | (objects?: SavedObjectsBulkCreateObject\[\], options?: SavedObjectsBulkCreateOptions) => Promise<SavedObjectsBatchResponse<unknown>> | Creates multiple documents at once | +| [bulkGet](./kibana-plugin-core-public.savedobjectsclient.bulkget.md) | | (objects?: Array<{ id: string; type: string; }>) => Promise<SavedObjectsBatchResponse<unknown>> | Returns an array of objects by id | +| [bulkResolve](./kibana-plugin-core-public.savedobjectsclient.bulkresolve.md) | | <T = unknown>(objects?: Array<{ id: string; type: string; }>) => Promise<{ resolved\_objects: ResolvedSimpleSavedObject<T>\[\]; }> | Resolves an array of objects by id, using any legacy URL aliases if they exist | +| [create](./kibana-plugin-core-public.savedobjectsclient.create.md) | | <T = unknown>(type: string, attributes: T, options?: SavedObjectsCreateOptions) => Promise<SimpleSavedObject<T>> | Persists an object | +| [delete](./kibana-plugin-core-public.savedobjectsclient.delete.md) | | (type: string, id: string, options?: SavedObjectsDeleteOptions \| undefined) => ReturnType<SavedObjectsApi\['delete'\]> | Deletes an object | +| [find](./kibana-plugin-core-public.savedobjectsclient.find.md) | | <T = unknown, A = unknown>(options: SavedObjectsFindOptions) => Promise<SavedObjectsFindResponsePublic<T, unknown>> | Search for objects | +| [get](./kibana-plugin-core-public.savedobjectsclient.get.md) | | <T = unknown>(type: string, id: string) => Promise<SimpleSavedObject<T>> | Fetches a single object | +| [resolve](./kibana-plugin-core-public.savedobjectsclient.resolve.md) | | <T = unknown>(type: string, id: string) => Promise<ResolvedSimpleSavedObject<T>> | Resolves a single object | ## Methods diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.update.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.update.md index a5847d6a26198a..dec84fb58bf5e5 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.update.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.update.md @@ -16,13 +16,13 @@ update(type: string, id: string, attributes: T, { version, referenc | Parameter | Type | Description | | --- | --- | --- | -| type | string | | -| id | string | | -| attributes | T | | -| { version, references, upsert } | SavedObjectsUpdateOptions | | +| type | string | | +| id | string | | +| attributes | T | | +| { version, references, upsert } | SavedObjectsUpdateOptions | | Returns: -`Promise>` +Promise<SimpleSavedObject<T>> diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectscollectmultinamespacereferencesresponse.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectscollectmultinamespacereferencesresponse.md index a6e0a274008a65..a356850fa1ad4f 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectscollectmultinamespacereferencesresponse.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectscollectmultinamespacereferencesresponse.md @@ -16,5 +16,5 @@ export interface SavedObjectsCollectMultiNamespaceReferencesResponse | Property | Type | Description | | --- | --- | --- | -| [objects](./kibana-plugin-core-public.savedobjectscollectmultinamespacereferencesresponse.objects.md) | SavedObjectReferenceWithContext[] | | +| [objects](./kibana-plugin-core-public.savedobjectscollectmultinamespacereferencesresponse.objects.md) | SavedObjectReferenceWithContext\[\] | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectscreateoptions.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectscreateoptions.md index a039b9f5b4fe45..835a9e87a1dbaa 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectscreateoptions.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectscreateoptions.md @@ -15,9 +15,9 @@ export interface SavedObjectsCreateOptions | Property | Type | Description | | --- | --- | --- | -| [coreMigrationVersion](./kibana-plugin-core-public.savedobjectscreateoptions.coremigrationversion.md) | string | A semver value that is used when upgrading objects between Kibana versions. | -| [id](./kibana-plugin-core-public.savedobjectscreateoptions.id.md) | string | (Not recommended) Specify an id instead of having the saved objects service generate one for you. | -| [migrationVersion](./kibana-plugin-core-public.savedobjectscreateoptions.migrationversion.md) | SavedObjectsMigrationVersion | Information about the migrations that have been applied to this SavedObject. When Kibana starts up, KibanaMigrator detects outdated documents and migrates them based on this value. For each migration that has been applied, the plugin's name is used as a key and the latest migration version as the value. | -| [overwrite](./kibana-plugin-core-public.savedobjectscreateoptions.overwrite.md) | boolean | If a document with the given id already exists, overwrite it's contents (default=false). | -| [references](./kibana-plugin-core-public.savedobjectscreateoptions.references.md) | SavedObjectReference[] | | +| [coreMigrationVersion?](./kibana-plugin-core-public.savedobjectscreateoptions.coremigrationversion.md) | string | (Optional) A semver value that is used when upgrading objects between Kibana versions. | +| [id?](./kibana-plugin-core-public.savedobjectscreateoptions.id.md) | string | (Optional) (Not recommended) Specify an id instead of having the saved objects service generate one for you. | +| [migrationVersion?](./kibana-plugin-core-public.savedobjectscreateoptions.migrationversion.md) | SavedObjectsMigrationVersion | (Optional) Information about the migrations that have been applied to this SavedObject. When Kibana starts up, KibanaMigrator detects outdated documents and migrates them based on this value. For each migration that has been applied, the plugin's name is used as a key and the latest migration version as the value. | +| [overwrite?](./kibana-plugin-core-public.savedobjectscreateoptions.overwrite.md) | boolean | (Optional) If a document with the given id already exists, overwrite it's contents (default=false). | +| [references?](./kibana-plugin-core-public.savedobjectscreateoptions.references.md) | SavedObjectReference\[\] | (Optional) | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.md index 706408f81f02a8..f429911476307d 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.md @@ -15,22 +15,22 @@ export interface SavedObjectsFindOptions | Property | Type | Description | | --- | --- | --- | -| [defaultSearchOperator](./kibana-plugin-core-public.savedobjectsfindoptions.defaultsearchoperator.md) | 'AND' | 'OR' | The search operator to use with the provided filter. Defaults to OR | -| [fields](./kibana-plugin-core-public.savedobjectsfindoptions.fields.md) | string[] | An array of fields to include in the results | -| [filter](./kibana-plugin-core-public.savedobjectsfindoptions.filter.md) | string | KueryNode | | -| [hasReference](./kibana-plugin-core-public.savedobjectsfindoptions.hasreference.md) | SavedObjectsFindOptionsReference | SavedObjectsFindOptionsReference[] | Search for documents having a reference to the specified objects. Use hasReferenceOperator to specify the operator to use when searching for multiple references. | -| [hasReferenceOperator](./kibana-plugin-core-public.savedobjectsfindoptions.hasreferenceoperator.md) | 'AND' | 'OR' | The operator to use when searching by multiple references using the hasReference option. Defaults to OR | -| [namespaces](./kibana-plugin-core-public.savedobjectsfindoptions.namespaces.md) | string[] | | -| [page](./kibana-plugin-core-public.savedobjectsfindoptions.page.md) | number | | -| [perPage](./kibana-plugin-core-public.savedobjectsfindoptions.perpage.md) | number | | -| [pit](./kibana-plugin-core-public.savedobjectsfindoptions.pit.md) | SavedObjectsPitParams | Search against a specific Point In Time (PIT) that you've opened with . | -| [preference](./kibana-plugin-core-public.savedobjectsfindoptions.preference.md) | string | An optional ES preference value to be used for the query \* | -| [rootSearchFields](./kibana-plugin-core-public.savedobjectsfindoptions.rootsearchfields.md) | string[] | The fields to perform the parsed query against. Unlike the searchFields argument, these are expected to be root fields and will not be modified. If used in conjunction with searchFields, both are concatenated together. | -| [search](./kibana-plugin-core-public.savedobjectsfindoptions.search.md) | string | Search documents using the Elasticsearch Simple Query String syntax. See Elasticsearch Simple Query String query argument for more information | -| [searchAfter](./kibana-plugin-core-public.savedobjectsfindoptions.searchafter.md) | estypes.Id[] | Use the sort values from the previous page to retrieve the next page of results. | -| [searchFields](./kibana-plugin-core-public.savedobjectsfindoptions.searchfields.md) | string[] | The fields to perform the parsed query against. See Elasticsearch Simple Query String fields argument for more information | -| [sortField](./kibana-plugin-core-public.savedobjectsfindoptions.sortfield.md) | string | | -| [sortOrder](./kibana-plugin-core-public.savedobjectsfindoptions.sortorder.md) | estypes.SearchSortOrder | | -| [type](./kibana-plugin-core-public.savedobjectsfindoptions.type.md) | string | string[] | | -| [typeToNamespacesMap](./kibana-plugin-core-public.savedobjectsfindoptions.typetonamespacesmap.md) | Map<string, string[] | undefined> | This map defines each type to search for, and the namespace(s) to search for the type in; this is only intended to be used by a saved object client wrapper. If this is defined, it supersedes the type and namespaces fields when building the Elasticsearch query. Any types that are not included in this map will be excluded entirely. If a type is included but its value is undefined, the operation will search for that type in the Default namespace. | +| [defaultSearchOperator?](./kibana-plugin-core-public.savedobjectsfindoptions.defaultsearchoperator.md) | 'AND' \| 'OR' | (Optional) The search operator to use with the provided filter. Defaults to OR | +| [fields?](./kibana-plugin-core-public.savedobjectsfindoptions.fields.md) | string\[\] | (Optional) An array of fields to include in the results | +| [filter?](./kibana-plugin-core-public.savedobjectsfindoptions.filter.md) | string \| KueryNode | (Optional) | +| [hasReference?](./kibana-plugin-core-public.savedobjectsfindoptions.hasreference.md) | SavedObjectsFindOptionsReference \| SavedObjectsFindOptionsReference\[\] | (Optional) Search for documents having a reference to the specified objects. Use hasReferenceOperator to specify the operator to use when searching for multiple references. | +| [hasReferenceOperator?](./kibana-plugin-core-public.savedobjectsfindoptions.hasreferenceoperator.md) | 'AND' \| 'OR' | (Optional) The operator to use when searching by multiple references using the hasReference option. Defaults to OR | +| [namespaces?](./kibana-plugin-core-public.savedobjectsfindoptions.namespaces.md) | string\[\] | (Optional) | +| [page?](./kibana-plugin-core-public.savedobjectsfindoptions.page.md) | number | (Optional) | +| [perPage?](./kibana-plugin-core-public.savedobjectsfindoptions.perpage.md) | number | (Optional) | +| [pit?](./kibana-plugin-core-public.savedobjectsfindoptions.pit.md) | SavedObjectsPitParams | (Optional) Search against a specific Point In Time (PIT) that you've opened with . | +| [preference?](./kibana-plugin-core-public.savedobjectsfindoptions.preference.md) | string | (Optional) An optional ES preference value to be used for the query \* | +| [rootSearchFields?](./kibana-plugin-core-public.savedobjectsfindoptions.rootsearchfields.md) | string\[\] | (Optional) The fields to perform the parsed query against. Unlike the searchFields argument, these are expected to be root fields and will not be modified. If used in conjunction with searchFields, both are concatenated together. | +| [search?](./kibana-plugin-core-public.savedobjectsfindoptions.search.md) | string | (Optional) Search documents using the Elasticsearch Simple Query String syntax. See Elasticsearch Simple Query String query argument for more information | +| [searchAfter?](./kibana-plugin-core-public.savedobjectsfindoptions.searchafter.md) | estypes.Id\[\] | (Optional) Use the sort values from the previous page to retrieve the next page of results. | +| [searchFields?](./kibana-plugin-core-public.savedobjectsfindoptions.searchfields.md) | string\[\] | (Optional) The fields to perform the parsed query against. See Elasticsearch Simple Query String fields argument for more information | +| [sortField?](./kibana-plugin-core-public.savedobjectsfindoptions.sortfield.md) | string | (Optional) | +| [sortOrder?](./kibana-plugin-core-public.savedobjectsfindoptions.sortorder.md) | estypes.SearchSortOrder | (Optional) | +| [type](./kibana-plugin-core-public.savedobjectsfindoptions.type.md) | string \| string\[\] | | +| [typeToNamespacesMap?](./kibana-plugin-core-public.savedobjectsfindoptions.typetonamespacesmap.md) | Map<string, string\[\] \| undefined> | (Optional) This map defines each type to search for, and the namespace(s) to search for the type in; this is only intended to be used by a saved object client wrapper. If this is defined, it supersedes the type and namespaces fields when building the Elasticsearch query. Any types that are not included in this map will be excluded entirely. If a type is included but its value is undefined, the operation will search for that type in the Default namespace. | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptionsreference.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptionsreference.md index cdfefd01e6f83d..cab03bf71393c6 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptionsreference.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptionsreference.md @@ -15,6 +15,6 @@ export interface SavedObjectsFindOptionsReference | Property | Type | Description | | --- | --- | --- | -| [id](./kibana-plugin-core-public.savedobjectsfindoptionsreference.id.md) | string | | -| [type](./kibana-plugin-core-public.savedobjectsfindoptionsreference.type.md) | string | | +| [id](./kibana-plugin-core-public.savedobjectsfindoptionsreference.id.md) | string | | +| [type](./kibana-plugin-core-public.savedobjectsfindoptionsreference.type.md) | string | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindresponsepublic.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindresponsepublic.md index 6f2276194f054f..dd26960a957661 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindresponsepublic.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindresponsepublic.md @@ -13,13 +13,14 @@ Return type of the Saved Objects `find()` method. ```typescript export interface SavedObjectsFindResponsePublic extends SavedObjectsBatchResponse ``` +Extends: SavedObjectsBatchResponse<T> ## Properties | Property | Type | Description | | --- | --- | --- | -| [aggregations](./kibana-plugin-core-public.savedobjectsfindresponsepublic.aggregations.md) | A | | -| [page](./kibana-plugin-core-public.savedobjectsfindresponsepublic.page.md) | number | | -| [perPage](./kibana-plugin-core-public.savedobjectsfindresponsepublic.perpage.md) | number | | -| [total](./kibana-plugin-core-public.savedobjectsfindresponsepublic.total.md) | number | | +| [aggregations?](./kibana-plugin-core-public.savedobjectsfindresponsepublic.aggregations.md) | A | (Optional) | +| [page](./kibana-plugin-core-public.savedobjectsfindresponsepublic.page.md) | number | | +| [perPage](./kibana-plugin-core-public.savedobjectsfindresponsepublic.perpage.md) | number | | +| [total](./kibana-plugin-core-public.savedobjectsfindresponsepublic.total.md) | number | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportactionrequiredwarning.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportactionrequiredwarning.md index 2ecce7233aa57b..fe148fdc2ff1a6 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportactionrequiredwarning.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportactionrequiredwarning.md @@ -18,8 +18,8 @@ export interface SavedObjectsImportActionRequiredWarning | Property | Type | Description | | --- | --- | --- | -| [actionPath](./kibana-plugin-core-public.savedobjectsimportactionrequiredwarning.actionpath.md) | string | The path (without the basePath) that the user should be redirect to address this warning. | -| [buttonLabel](./kibana-plugin-core-public.savedobjectsimportactionrequiredwarning.buttonlabel.md) | string | An optional label to use for the link button. If unspecified, a default label will be used. | -| [message](./kibana-plugin-core-public.savedobjectsimportactionrequiredwarning.message.md) | string | The translated message to display to the user. | -| [type](./kibana-plugin-core-public.savedobjectsimportactionrequiredwarning.type.md) | 'action_required' | | +| [actionPath](./kibana-plugin-core-public.savedobjectsimportactionrequiredwarning.actionpath.md) | string | The path (without the basePath) that the user should be redirect to address this warning. | +| [buttonLabel?](./kibana-plugin-core-public.savedobjectsimportactionrequiredwarning.buttonlabel.md) | string | (Optional) An optional label to use for the link button. If unspecified, a default label will be used. | +| [message](./kibana-plugin-core-public.savedobjectsimportactionrequiredwarning.message.md) | string | The translated message to display to the user. | +| [type](./kibana-plugin-core-public.savedobjectsimportactionrequiredwarning.type.md) | 'action\_required' | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportambiguousconflicterror.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportambiguousconflicterror.md index 76dfacf132f0a4..2d136bb870de7a 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportambiguousconflicterror.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportambiguousconflicterror.md @@ -16,6 +16,6 @@ export interface SavedObjectsImportAmbiguousConflictError | Property | Type | Description | | --- | --- | --- | -| [destinations](./kibana-plugin-core-public.savedobjectsimportambiguousconflicterror.destinations.md) | Array<{
id: string;
title?: string;
updatedAt?: string;
}> | | -| [type](./kibana-plugin-core-public.savedobjectsimportambiguousconflicterror.type.md) | 'ambiguous_conflict' | | +| [destinations](./kibana-plugin-core-public.savedobjectsimportambiguousconflicterror.destinations.md) | Array<{ id: string; title?: string; updatedAt?: string; }> | | +| [type](./kibana-plugin-core-public.savedobjectsimportambiguousconflicterror.type.md) | 'ambiguous\_conflict' | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportconflicterror.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportconflicterror.md index b0320b05ecadc8..57737986ba4ca9 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportconflicterror.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportconflicterror.md @@ -16,6 +16,6 @@ export interface SavedObjectsImportConflictError | Property | Type | Description | | --- | --- | --- | -| [destinationId](./kibana-plugin-core-public.savedobjectsimportconflicterror.destinationid.md) | string | | -| [type](./kibana-plugin-core-public.savedobjectsimportconflicterror.type.md) | 'conflict' | | +| [destinationId?](./kibana-plugin-core-public.savedobjectsimportconflicterror.destinationid.md) | string | (Optional) | +| [type](./kibana-plugin-core-public.savedobjectsimportconflicterror.type.md) | 'conflict' | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportfailure.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportfailure.md index f9219c9037e0a2..be1a20b3c71a4e 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportfailure.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportfailure.md @@ -16,10 +16,10 @@ export interface SavedObjectsImportFailure | Property | Type | Description | | --- | --- | --- | -| [error](./kibana-plugin-core-public.savedobjectsimportfailure.error.md) | SavedObjectsImportConflictError | SavedObjectsImportAmbiguousConflictError | SavedObjectsImportUnsupportedTypeError | SavedObjectsImportMissingReferencesError | SavedObjectsImportUnknownError | | -| [id](./kibana-plugin-core-public.savedobjectsimportfailure.id.md) | string | | -| [meta](./kibana-plugin-core-public.savedobjectsimportfailure.meta.md) | {
title?: string;
icon?: string;
} | | -| [overwrite](./kibana-plugin-core-public.savedobjectsimportfailure.overwrite.md) | boolean | If overwrite is specified, an attempt was made to overwrite an existing object. | -| [title](./kibana-plugin-core-public.savedobjectsimportfailure.title.md) | string | | -| [type](./kibana-plugin-core-public.savedobjectsimportfailure.type.md) | string | | +| [error](./kibana-plugin-core-public.savedobjectsimportfailure.error.md) | SavedObjectsImportConflictError \| SavedObjectsImportAmbiguousConflictError \| SavedObjectsImportUnsupportedTypeError \| SavedObjectsImportMissingReferencesError \| SavedObjectsImportUnknownError | | +| [id](./kibana-plugin-core-public.savedobjectsimportfailure.id.md) | string | | +| [meta](./kibana-plugin-core-public.savedobjectsimportfailure.meta.md) | { title?: string; icon?: string; } | | +| [overwrite?](./kibana-plugin-core-public.savedobjectsimportfailure.overwrite.md) | boolean | (Optional) If overwrite is specified, an attempt was made to overwrite an existing object. | +| [title?](./kibana-plugin-core-public.savedobjectsimportfailure.title.md) | string | (Optional) | +| [type](./kibana-plugin-core-public.savedobjectsimportfailure.type.md) | string | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportmissingreferenceserror.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportmissingreferenceserror.md index 1fea85ea239d5d..6c03ab263084ca 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportmissingreferenceserror.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportmissingreferenceserror.md @@ -16,6 +16,6 @@ export interface SavedObjectsImportMissingReferencesError | Property | Type | Description | | --- | --- | --- | -| [references](./kibana-plugin-core-public.savedobjectsimportmissingreferenceserror.references.md) | Array<{
type: string;
id: string;
}> | | -| [type](./kibana-plugin-core-public.savedobjectsimportmissingreferenceserror.type.md) | 'missing_references' | | +| [references](./kibana-plugin-core-public.savedobjectsimportmissingreferenceserror.references.md) | Array<{ type: string; id: string; }> | | +| [type](./kibana-plugin-core-public.savedobjectsimportmissingreferenceserror.type.md) | 'missing\_references' | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportresponse.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportresponse.md index 3be800498a9b7d..5b6139723a101e 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportresponse.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportresponse.md @@ -16,9 +16,9 @@ export interface SavedObjectsImportResponse | Property | Type | Description | | --- | --- | --- | -| [errors](./kibana-plugin-core-public.savedobjectsimportresponse.errors.md) | SavedObjectsImportFailure[] | | -| [success](./kibana-plugin-core-public.savedobjectsimportresponse.success.md) | boolean | | -| [successCount](./kibana-plugin-core-public.savedobjectsimportresponse.successcount.md) | number | | -| [successResults](./kibana-plugin-core-public.savedobjectsimportresponse.successresults.md) | SavedObjectsImportSuccess[] | | -| [warnings](./kibana-plugin-core-public.savedobjectsimportresponse.warnings.md) | SavedObjectsImportWarning[] | | +| [errors?](./kibana-plugin-core-public.savedobjectsimportresponse.errors.md) | SavedObjectsImportFailure\[\] | (Optional) | +| [success](./kibana-plugin-core-public.savedobjectsimportresponse.success.md) | boolean | | +| [successCount](./kibana-plugin-core-public.savedobjectsimportresponse.successcount.md) | number | | +| [successResults?](./kibana-plugin-core-public.savedobjectsimportresponse.successresults.md) | SavedObjectsImportSuccess\[\] | (Optional) | +| [warnings](./kibana-plugin-core-public.savedobjectsimportresponse.warnings.md) | SavedObjectsImportWarning\[\] | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportretry.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportretry.md index b0bda93ef8b720..80a3145ae7e55f 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportretry.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportretry.md @@ -16,11 +16,11 @@ export interface SavedObjectsImportRetry | Property | Type | Description | | --- | --- | --- | -| [createNewCopy](./kibana-plugin-core-public.savedobjectsimportretry.createnewcopy.md) | boolean | If createNewCopy is specified, the new object has a new (undefined) origin ID. This is only needed for the case where createNewCopies mode is disabled and ambiguous source conflicts are detected. | -| [destinationId](./kibana-plugin-core-public.savedobjectsimportretry.destinationid.md) | string | The object ID that will be created or overwritten. If not specified, the id field will be used. | -| [id](./kibana-plugin-core-public.savedobjectsimportretry.id.md) | string | | -| [ignoreMissingReferences](./kibana-plugin-core-public.savedobjectsimportretry.ignoremissingreferences.md) | boolean | If ignoreMissingReferences is specified, reference validation will be skipped for this object. | -| [overwrite](./kibana-plugin-core-public.savedobjectsimportretry.overwrite.md) | boolean | | -| [replaceReferences](./kibana-plugin-core-public.savedobjectsimportretry.replacereferences.md) | Array<{
type: string;
from: string;
to: string;
}> | | -| [type](./kibana-plugin-core-public.savedobjectsimportretry.type.md) | string | | +| [createNewCopy?](./kibana-plugin-core-public.savedobjectsimportretry.createnewcopy.md) | boolean | (Optional) If createNewCopy is specified, the new object has a new (undefined) origin ID. This is only needed for the case where createNewCopies mode is disabled and ambiguous source conflicts are detected. | +| [destinationId?](./kibana-plugin-core-public.savedobjectsimportretry.destinationid.md) | string | (Optional) The object ID that will be created or overwritten. If not specified, the id field will be used. | +| [id](./kibana-plugin-core-public.savedobjectsimportretry.id.md) | string | | +| [ignoreMissingReferences?](./kibana-plugin-core-public.savedobjectsimportretry.ignoremissingreferences.md) | boolean | (Optional) If ignoreMissingReferences is specified, reference validation will be skipped for this object. | +| [overwrite](./kibana-plugin-core-public.savedobjectsimportretry.overwrite.md) | boolean | | +| [replaceReferences](./kibana-plugin-core-public.savedobjectsimportretry.replacereferences.md) | Array<{ type: string; from: string; to: string; }> | | +| [type](./kibana-plugin-core-public.savedobjectsimportretry.type.md) | string | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportsimplewarning.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportsimplewarning.md index 4d6d984777c80e..304779a1589f98 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportsimplewarning.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportsimplewarning.md @@ -16,6 +16,6 @@ export interface SavedObjectsImportSimpleWarning | Property | Type | Description | | --- | --- | --- | -| [message](./kibana-plugin-core-public.savedobjectsimportsimplewarning.message.md) | string | The translated message to display to the user | -| [type](./kibana-plugin-core-public.savedobjectsimportsimplewarning.type.md) | 'simple' | | +| [message](./kibana-plugin-core-public.savedobjectsimportsimplewarning.message.md) | string | The translated message to display to the user | +| [type](./kibana-plugin-core-public.savedobjectsimportsimplewarning.type.md) | 'simple' | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportsuccess.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportsuccess.md index 4872deb5ee0db2..57ca4b7a787f6e 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportsuccess.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportsuccess.md @@ -16,10 +16,10 @@ export interface SavedObjectsImportSuccess | Property | Type | Description | | --- | --- | --- | -| [createNewCopy](./kibana-plugin-core-public.savedobjectsimportsuccess.createnewcopy.md) | boolean | | -| [destinationId](./kibana-plugin-core-public.savedobjectsimportsuccess.destinationid.md) | string | If destinationId is specified, the new object has a new ID that is different from the import ID. | -| [id](./kibana-plugin-core-public.savedobjectsimportsuccess.id.md) | string | | -| [meta](./kibana-plugin-core-public.savedobjectsimportsuccess.meta.md) | {
title?: string;
icon?: string;
} | | -| [overwrite](./kibana-plugin-core-public.savedobjectsimportsuccess.overwrite.md) | boolean | If overwrite is specified, this object overwrote an existing one (or will do so, in the case of a pending resolution). | -| [type](./kibana-plugin-core-public.savedobjectsimportsuccess.type.md) | string | | +| [createNewCopy?](./kibana-plugin-core-public.savedobjectsimportsuccess.createnewcopy.md) | boolean | (Optional) | +| [destinationId?](./kibana-plugin-core-public.savedobjectsimportsuccess.destinationid.md) | string | (Optional) If destinationId is specified, the new object has a new ID that is different from the import ID. | +| [id](./kibana-plugin-core-public.savedobjectsimportsuccess.id.md) | string | | +| [meta](./kibana-plugin-core-public.savedobjectsimportsuccess.meta.md) | { title?: string; icon?: string; } | | +| [overwrite?](./kibana-plugin-core-public.savedobjectsimportsuccess.overwrite.md) | boolean | (Optional) If overwrite is specified, this object overwrote an existing one (or will do so, in the case of a pending resolution). | +| [type](./kibana-plugin-core-public.savedobjectsimportsuccess.type.md) | string | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportunknownerror.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportunknownerror.md index 8ed3369d50d740..fc78e04dee8ac3 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportunknownerror.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportunknownerror.md @@ -16,7 +16,7 @@ export interface SavedObjectsImportUnknownError | Property | Type | Description | | --- | --- | --- | -| [message](./kibana-plugin-core-public.savedobjectsimportunknownerror.message.md) | string | | -| [statusCode](./kibana-plugin-core-public.savedobjectsimportunknownerror.statuscode.md) | number | | -| [type](./kibana-plugin-core-public.savedobjectsimportunknownerror.type.md) | 'unknown' | | +| [message](./kibana-plugin-core-public.savedobjectsimportunknownerror.message.md) | string | | +| [statusCode](./kibana-plugin-core-public.savedobjectsimportunknownerror.statuscode.md) | number | | +| [type](./kibana-plugin-core-public.savedobjectsimportunknownerror.type.md) | 'unknown' | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportunsupportedtypeerror.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportunsupportedtypeerror.md index afd5ae3110087b..de805f05a12e9b 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportunsupportedtypeerror.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportunsupportedtypeerror.md @@ -16,5 +16,5 @@ export interface SavedObjectsImportUnsupportedTypeError | Property | Type | Description | | --- | --- | --- | -| [type](./kibana-plugin-core-public.savedobjectsimportunsupportedtypeerror.type.md) | 'unsupported_type' | | +| [type](./kibana-plugin-core-public.savedobjectsimportunsupportedtypeerror.type.md) | 'unsupported\_type' | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsresolveresponse.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsresolveresponse.md index cdc79d8ac363de..6364493a9ef09a 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsresolveresponse.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsresolveresponse.md @@ -15,7 +15,7 @@ export interface SavedObjectsResolveResponse | Property | Type | Description | | --- | --- | --- | -| [alias\_target\_id](./kibana-plugin-core-public.savedobjectsresolveresponse.alias_target_id.md) | string | The ID of the object that the legacy URL alias points to. This is only defined when the outcome is 'aliasMatch' or 'conflict'. | -| [outcome](./kibana-plugin-core-public.savedobjectsresolveresponse.outcome.md) | 'exactMatch' | 'aliasMatch' | 'conflict' | The outcome for a successful resolve call is one of the following values:\* 'exactMatch' -- One document exactly matched the given ID. \* 'aliasMatch' -- One document with a legacy URL alias matched the given ID; in this case the saved_object.id field is different than the given ID. \* 'conflict' -- Two documents matched the given ID, one was an exact match and another with a legacy URL alias; in this case the saved_object object is the exact match, and the saved_object.id field is the same as the given ID. | -| [saved\_object](./kibana-plugin-core-public.savedobjectsresolveresponse.saved_object.md) | SavedObject<T> | The saved object that was found. | +| [alias\_target\_id?](./kibana-plugin-core-public.savedobjectsresolveresponse.alias_target_id.md) | string | (Optional) The ID of the object that the legacy URL alias points to. This is only defined when the outcome is 'aliasMatch' or 'conflict'. | +| [outcome](./kibana-plugin-core-public.savedobjectsresolveresponse.outcome.md) | 'exactMatch' \| 'aliasMatch' \| 'conflict' | The outcome for a successful resolve call is one of the following values:\* 'exactMatch' -- One document exactly matched the given ID. \* 'aliasMatch' -- One document with a legacy URL alias matched the given ID; in this case the saved_object.id field is different than the given ID. \* 'conflict' -- Two documents matched the given ID, one was an exact match and another with a legacy URL alias; in this case the saved_object object is the exact match, and the saved_object.id field is the same as the given ID. | +| [saved\_object](./kibana-plugin-core-public.savedobjectsresolveresponse.saved_object.md) | SavedObject<T> | The saved object that was found. | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsstart.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsstart.md index 0aa47301e8eb14..0ce0da309afbd1 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsstart.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsstart.md @@ -15,5 +15,5 @@ export interface SavedObjectsStart | Property | Type | Description | | --- | --- | --- | -| [client](./kibana-plugin-core-public.savedobjectsstart.client.md) | SavedObjectsClientContract | [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md) | +| [client](./kibana-plugin-core-public.savedobjectsstart.client.md) | SavedObjectsClientContract | [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md) | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsupdateoptions.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsupdateoptions.md index d9cc801148d9e7..4a9b85e7b67e6b 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsupdateoptions.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsupdateoptions.md @@ -15,7 +15,7 @@ export interface SavedObjectsUpdateOptions | Property | Type | Description | | --- | --- | --- | -| [references](./kibana-plugin-core-public.savedobjectsupdateoptions.references.md) | SavedObjectReference[] | | -| [upsert](./kibana-plugin-core-public.savedobjectsupdateoptions.upsert.md) | Attributes | | -| [version](./kibana-plugin-core-public.savedobjectsupdateoptions.version.md) | string | | +| [references?](./kibana-plugin-core-public.savedobjectsupdateoptions.references.md) | SavedObjectReference\[\] | (Optional) | +| [upsert?](./kibana-plugin-core-public.savedobjectsupdateoptions.upsert.md) | Attributes | (Optional) | +| [version?](./kibana-plugin-core-public.savedobjectsupdateoptions.version.md) | string | (Optional) | diff --git a/docs/development/core/public/kibana-plugin-core-public.scopedhistory._constructor_.md b/docs/development/core/public/kibana-plugin-core-public.scopedhistory._constructor_.md index 2cf647086b3e24..32b0950aa1065d 100644 --- a/docs/development/core/public/kibana-plugin-core-public.scopedhistory._constructor_.md +++ b/docs/development/core/public/kibana-plugin-core-public.scopedhistory._constructor_.md @@ -16,6 +16,6 @@ constructor(parentHistory: History, basePath: string); | Parameter | Type | Description | | --- | --- | --- | -| parentHistory | History | | -| basePath | string | | +| parentHistory | History | | +| basePath | string | | diff --git a/docs/development/core/public/kibana-plugin-core-public.scopedhistory.md b/docs/development/core/public/kibana-plugin-core-public.scopedhistory.md index 15ed4e74c4dc5f..0d04fc3d6a8603 100644 --- a/docs/development/core/public/kibana-plugin-core-public.scopedhistory.md +++ b/docs/development/core/public/kibana-plugin-core-public.scopedhistory.md @@ -15,6 +15,7 @@ The [createSubHistory](./kibana-plugin-core-public.scopedhistory.createsubhistor ```typescript export declare class ScopedHistory implements History ``` +Implements: History<HistoryLocationState> ## Constructors @@ -26,16 +27,16 @@ export declare class ScopedHistory implements Hi | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [action](./kibana-plugin-core-public.scopedhistory.action.md) | | Action | The last action dispatched on the history stack. | -| [block](./kibana-plugin-core-public.scopedhistory.block.md) | | (prompt?: string | boolean | History.TransitionPromptHook<HistoryLocationState> | undefined) => UnregisterCallback | Add a block prompt requesting user confirmation when navigating away from the current page. | -| [createHref](./kibana-plugin-core-public.scopedhistory.createhref.md) | | (location: LocationDescriptorObject<HistoryLocationState>, { prependBasePath }?: {
prependBasePath?: boolean | undefined;
}) => Href | Creates an href (string) to the location. If prependBasePath is true (default), it will prepend the location's path with the scoped history basePath. | -| [createSubHistory](./kibana-plugin-core-public.scopedhistory.createsubhistory.md) | | <SubHistoryLocationState = unknown>(basePath: string) => ScopedHistory<SubHistoryLocationState> | Creates a ScopedHistory for a subpath of this ScopedHistory. Useful for applications that may have sub-apps that do not need access to the containing application's history. | -| [go](./kibana-plugin-core-public.scopedhistory.go.md) | | (n: number) => void | Send the user forward or backwards in the history stack. | -| [goBack](./kibana-plugin-core-public.scopedhistory.goback.md) | | () => void | Send the user one location back in the history stack. Equivalent to calling [ScopedHistory.go(-1)](./kibana-plugin-core-public.scopedhistory.go.md). If no more entries are available backwards, this is a no-op. | -| [goForward](./kibana-plugin-core-public.scopedhistory.goforward.md) | | () => void | Send the user one location forward in the history stack. Equivalent to calling [ScopedHistory.go(1)](./kibana-plugin-core-public.scopedhistory.go.md). If no more entries are available forwards, this is a no-op. | -| [length](./kibana-plugin-core-public.scopedhistory.length.md) | | number | The number of entries in the history stack, including all entries forwards and backwards from the current location. | -| [listen](./kibana-plugin-core-public.scopedhistory.listen.md) | | (listener: (location: Location<HistoryLocationState>, action: Action) => void) => UnregisterCallback | Adds a listener for location updates. | -| [location](./kibana-plugin-core-public.scopedhistory.location.md) | | Location<HistoryLocationState> | The current location of the history stack. | -| [push](./kibana-plugin-core-public.scopedhistory.push.md) | | (pathOrLocation: Path | LocationDescriptorObject<HistoryLocationState>, state?: HistoryLocationState | undefined) => void | Pushes a new location onto the history stack. If there are forward entries in the stack, they will be removed. | -| [replace](./kibana-plugin-core-public.scopedhistory.replace.md) | | (pathOrLocation: Path | LocationDescriptorObject<HistoryLocationState>, state?: HistoryLocationState | undefined) => void | Replaces the current location in the history stack. Does not remove forward or backward entries. | +| [action](./kibana-plugin-core-public.scopedhistory.action.md) | | Action | The last action dispatched on the history stack. | +| [block](./kibana-plugin-core-public.scopedhistory.block.md) | | (prompt?: string \| boolean \| History.TransitionPromptHook<HistoryLocationState> \| undefined) => UnregisterCallback | Add a block prompt requesting user confirmation when navigating away from the current page. | +| [createHref](./kibana-plugin-core-public.scopedhistory.createhref.md) | | (location: LocationDescriptorObject<HistoryLocationState>, { prependBasePath }?: { prependBasePath?: boolean \| undefined; }) => Href | Creates an href (string) to the location. If prependBasePath is true (default), it will prepend the location's path with the scoped history basePath. | +| [createSubHistory](./kibana-plugin-core-public.scopedhistory.createsubhistory.md) | | <SubHistoryLocationState = unknown>(basePath: string) => ScopedHistory<SubHistoryLocationState> | Creates a ScopedHistory for a subpath of this ScopedHistory. Useful for applications that may have sub-apps that do not need access to the containing application's history. | +| [go](./kibana-plugin-core-public.scopedhistory.go.md) | | (n: number) => void | Send the user forward or backwards in the history stack. | +| [goBack](./kibana-plugin-core-public.scopedhistory.goback.md) | | () => void | Send the user one location back in the history stack. Equivalent to calling [ScopedHistory.go(-1)](./kibana-plugin-core-public.scopedhistory.go.md). If no more entries are available backwards, this is a no-op. | +| [goForward](./kibana-plugin-core-public.scopedhistory.goforward.md) | | () => void | Send the user one location forward in the history stack. Equivalent to calling [ScopedHistory.go(1)](./kibana-plugin-core-public.scopedhistory.go.md). If no more entries are available forwards, this is a no-op. | +| [length](./kibana-plugin-core-public.scopedhistory.length.md) | | number | The number of entries in the history stack, including all entries forwards and backwards from the current location. | +| [listen](./kibana-plugin-core-public.scopedhistory.listen.md) | | (listener: (location: Location<HistoryLocationState>, action: Action) => void) => UnregisterCallback | Adds a listener for location updates. | +| [location](./kibana-plugin-core-public.scopedhistory.location.md) | | Location<HistoryLocationState> | The current location of the history stack. | +| [push](./kibana-plugin-core-public.scopedhistory.push.md) | | (pathOrLocation: Path \| LocationDescriptorObject<HistoryLocationState>, state?: HistoryLocationState \| undefined) => void | Pushes a new location onto the history stack. If there are forward entries in the stack, they will be removed. | +| [replace](./kibana-plugin-core-public.scopedhistory.replace.md) | | (pathOrLocation: Path \| LocationDescriptorObject<HistoryLocationState>, state?: HistoryLocationState \| undefined) => void | Replaces the current location in the history stack. Does not remove forward or backward entries. | diff --git a/docs/development/core/public/kibana-plugin-core-public.simplesavedobject._constructor_.md b/docs/development/core/public/kibana-plugin-core-public.simplesavedobject._constructor_.md index c73a3a200cc24b..f53b6e52928615 100644 --- a/docs/development/core/public/kibana-plugin-core-public.simplesavedobject._constructor_.md +++ b/docs/development/core/public/kibana-plugin-core-public.simplesavedobject._constructor_.md @@ -16,6 +16,6 @@ constructor(client: SavedObjectsClientContract, { id, type, version, attributes, | Parameter | Type | Description | | --- | --- | --- | -| client | SavedObjectsClientContract | | -| { id, type, version, attributes, error, references, migrationVersion, coreMigrationVersion, namespaces, } | SavedObjectType<T> | | +| client | SavedObjectsClientContract | | +| { id, type, version, attributes, error, references, migrationVersion, coreMigrationVersion, namespaces, } | SavedObjectType<T> | | diff --git a/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.delete.md b/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.delete.md index 909ff2e7d34358..cb848bff564307 100644 --- a/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.delete.md +++ b/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.delete.md @@ -11,5 +11,5 @@ delete(): Promise<{}>; ``` Returns: -`Promise<{}>` +Promise<{}> diff --git a/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.get.md b/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.get.md index caa9ab9857a6fc..9a9c27d78c06c3 100644 --- a/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.get.md +++ b/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.get.md @@ -14,9 +14,9 @@ get(key: string): any; | Parameter | Type | Description | | --- | --- | --- | -| key | string | | +| key | string | | Returns: -`any` +any diff --git a/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.has.md b/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.has.md index 960a7b6cfd16a6..acd0ff02c7d233 100644 --- a/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.has.md +++ b/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.has.md @@ -14,9 +14,9 @@ has(key: string): boolean; | Parameter | Type | Description | | --- | --- | --- | -| key | string | | +| key | string | | Returns: -`boolean` +boolean diff --git a/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.md b/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.md index e15a4d4ea6d092..2aac93f9b5bc10 100644 --- a/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.md +++ b/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.md @@ -24,15 +24,15 @@ export declare class SimpleSavedObject | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [\_version](./kibana-plugin-core-public.simplesavedobject._version.md) | | SavedObjectType<T>['version'] | | -| [attributes](./kibana-plugin-core-public.simplesavedobject.attributes.md) | | T | | -| [coreMigrationVersion](./kibana-plugin-core-public.simplesavedobject.coremigrationversion.md) | | SavedObjectType<T>['coreMigrationVersion'] | | -| [error](./kibana-plugin-core-public.simplesavedobject.error.md) | | SavedObjectType<T>['error'] | | -| [id](./kibana-plugin-core-public.simplesavedobject.id.md) | | SavedObjectType<T>['id'] | | -| [migrationVersion](./kibana-plugin-core-public.simplesavedobject.migrationversion.md) | | SavedObjectType<T>['migrationVersion'] | | -| [namespaces](./kibana-plugin-core-public.simplesavedobject.namespaces.md) | | SavedObjectType<T>['namespaces'] | Space(s) that this saved object exists in. This attribute is not used for "global" saved object types which are registered with namespaceType: 'agnostic'. | -| [references](./kibana-plugin-core-public.simplesavedobject.references.md) | | SavedObjectType<T>['references'] | | -| [type](./kibana-plugin-core-public.simplesavedobject.type.md) | | SavedObjectType<T>['type'] | | +| [\_version?](./kibana-plugin-core-public.simplesavedobject._version.md) | | SavedObjectType<T>\['version'\] | (Optional) | +| [attributes](./kibana-plugin-core-public.simplesavedobject.attributes.md) | | T | | +| [coreMigrationVersion](./kibana-plugin-core-public.simplesavedobject.coremigrationversion.md) | | SavedObjectType<T>\['coreMigrationVersion'\] | | +| [error](./kibana-plugin-core-public.simplesavedobject.error.md) | | SavedObjectType<T>\['error'\] | | +| [id](./kibana-plugin-core-public.simplesavedobject.id.md) | | SavedObjectType<T>\['id'\] | | +| [migrationVersion](./kibana-plugin-core-public.simplesavedobject.migrationversion.md) | | SavedObjectType<T>\['migrationVersion'\] | | +| [namespaces](./kibana-plugin-core-public.simplesavedobject.namespaces.md) | | SavedObjectType<T>\['namespaces'\] | Space(s) that this saved object exists in. This attribute is not used for "global" saved object types which are registered with namespaceType: 'agnostic'. | +| [references](./kibana-plugin-core-public.simplesavedobject.references.md) | | SavedObjectType<T>\['references'\] | | +| [type](./kibana-plugin-core-public.simplesavedobject.type.md) | | SavedObjectType<T>\['type'\] | | ## Methods diff --git a/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.save.md b/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.save.md index c985c714b9c5c6..fdd262c70d4e6f 100644 --- a/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.save.md +++ b/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.save.md @@ -11,5 +11,5 @@ save(): Promise>; ``` Returns: -`Promise>` +Promise<SimpleSavedObject<T>> diff --git a/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.set.md b/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.set.md index 09549e92b6a058..e3a6621f520bda 100644 --- a/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.set.md +++ b/docs/development/core/public/kibana-plugin-core-public.simplesavedobject.set.md @@ -14,10 +14,10 @@ set(key: string, value: any): T; | Parameter | Type | Description | | --- | --- | --- | -| key | string | | -| value | any | | +| key | string | | +| value | any | | Returns: -`T` +T diff --git a/docs/development/core/public/kibana-plugin-core-public.toastoptions.md b/docs/development/core/public/kibana-plugin-core-public.toastoptions.md index 0d85c482c2288c..c140a2e52b0367 100644 --- a/docs/development/core/public/kibana-plugin-core-public.toastoptions.md +++ b/docs/development/core/public/kibana-plugin-core-public.toastoptions.md @@ -16,5 +16,5 @@ export interface ToastOptions | Property | Type | Description | | --- | --- | --- | -| [toastLifeTimeMs](./kibana-plugin-core-public.toastoptions.toastlifetimems.md) | number | How long should the toast remain on screen. | +| [toastLifeTimeMs?](./kibana-plugin-core-public.toastoptions.toastlifetimems.md) | number | (Optional) How long should the toast remain on screen. | diff --git a/docs/development/core/public/kibana-plugin-core-public.toastsapi._constructor_.md b/docs/development/core/public/kibana-plugin-core-public.toastsapi._constructor_.md index 71faf9a13b6406..c50cc4d6469eaf 100644 --- a/docs/development/core/public/kibana-plugin-core-public.toastsapi._constructor_.md +++ b/docs/development/core/public/kibana-plugin-core-public.toastsapi._constructor_.md @@ -18,5 +18,5 @@ constructor(deps: { | Parameter | Type | Description | | --- | --- | --- | -| deps | {
uiSettings: IUiSettingsClient;
} | | +| deps | { uiSettings: IUiSettingsClient; } | | diff --git a/docs/development/core/public/kibana-plugin-core-public.toastsapi.add.md b/docs/development/core/public/kibana-plugin-core-public.toastsapi.add.md index 8cd3829c6f6acf..7bee5af0c3be46 100644 --- a/docs/development/core/public/kibana-plugin-core-public.toastsapi.add.md +++ b/docs/development/core/public/kibana-plugin-core-public.toastsapi.add.md @@ -16,11 +16,11 @@ add(toastOrTitle: ToastInput): Toast; | Parameter | Type | Description | | --- | --- | --- | -| toastOrTitle | ToastInput | a [ToastInput](./kibana-plugin-core-public.toastinput.md) | +| toastOrTitle | ToastInput | a [ToastInput](./kibana-plugin-core-public.toastinput.md) | Returns: -`Toast` +Toast a [Toast](./kibana-plugin-core-public.toast.md) diff --git a/docs/development/core/public/kibana-plugin-core-public.toastsapi.adddanger.md b/docs/development/core/public/kibana-plugin-core-public.toastsapi.adddanger.md index 420100a1209ab9..f73a84996ff92d 100644 --- a/docs/development/core/public/kibana-plugin-core-public.toastsapi.adddanger.md +++ b/docs/development/core/public/kibana-plugin-core-public.toastsapi.adddanger.md @@ -16,12 +16,12 @@ addDanger(toastOrTitle: ToastInput, options?: ToastOptions): Toast; | Parameter | Type | Description | | --- | --- | --- | -| toastOrTitle | ToastInput | a [ToastInput](./kibana-plugin-core-public.toastinput.md) | -| options | ToastOptions | a [ToastOptions](./kibana-plugin-core-public.toastoptions.md) | +| toastOrTitle | ToastInput | a [ToastInput](./kibana-plugin-core-public.toastinput.md) | +| options | ToastOptions | a [ToastOptions](./kibana-plugin-core-public.toastoptions.md) | Returns: -`Toast` +Toast a [Toast](./kibana-plugin-core-public.toast.md) diff --git a/docs/development/core/public/kibana-plugin-core-public.toastsapi.adderror.md b/docs/development/core/public/kibana-plugin-core-public.toastsapi.adderror.md index e5f851a225664a..c1520ea392f703 100644 --- a/docs/development/core/public/kibana-plugin-core-public.toastsapi.adderror.md +++ b/docs/development/core/public/kibana-plugin-core-public.toastsapi.adderror.md @@ -16,12 +16,12 @@ addError(error: Error, options: ErrorToastOptions): Toast; | Parameter | Type | Description | | --- | --- | --- | -| error | Error | an Error instance. | -| options | ErrorToastOptions | [ErrorToastOptions](./kibana-plugin-core-public.errortoastoptions.md) | +| error | Error | an Error instance. | +| options | ErrorToastOptions | [ErrorToastOptions](./kibana-plugin-core-public.errortoastoptions.md) | Returns: -`Toast` +Toast a [Toast](./kibana-plugin-core-public.toast.md) diff --git a/docs/development/core/public/kibana-plugin-core-public.toastsapi.addinfo.md b/docs/development/core/public/kibana-plugin-core-public.toastsapi.addinfo.md index 76508d26b4ae98..70294826631552 100644 --- a/docs/development/core/public/kibana-plugin-core-public.toastsapi.addinfo.md +++ b/docs/development/core/public/kibana-plugin-core-public.toastsapi.addinfo.md @@ -16,12 +16,12 @@ addInfo(toastOrTitle: ToastInput, options?: ToastOptions): Toast; | Parameter | Type | Description | | --- | --- | --- | -| toastOrTitle | ToastInput | a [ToastInput](./kibana-plugin-core-public.toastinput.md) | -| options | ToastOptions | a [ToastOptions](./kibana-plugin-core-public.toastoptions.md) | +| toastOrTitle | ToastInput | a [ToastInput](./kibana-plugin-core-public.toastinput.md) | +| options | ToastOptions | a [ToastOptions](./kibana-plugin-core-public.toastoptions.md) | Returns: -`Toast` +Toast a [Toast](./kibana-plugin-core-public.toast.md) diff --git a/docs/development/core/public/kibana-plugin-core-public.toastsapi.addsuccess.md b/docs/development/core/public/kibana-plugin-core-public.toastsapi.addsuccess.md index c79f48042514ae..b9cf4da3b43afc 100644 --- a/docs/development/core/public/kibana-plugin-core-public.toastsapi.addsuccess.md +++ b/docs/development/core/public/kibana-plugin-core-public.toastsapi.addsuccess.md @@ -16,12 +16,12 @@ addSuccess(toastOrTitle: ToastInput, options?: ToastOptions): Toast; | Parameter | Type | Description | | --- | --- | --- | -| toastOrTitle | ToastInput | a [ToastInput](./kibana-plugin-core-public.toastinput.md) | -| options | ToastOptions | a [ToastOptions](./kibana-plugin-core-public.toastoptions.md) | +| toastOrTitle | ToastInput | a [ToastInput](./kibana-plugin-core-public.toastinput.md) | +| options | ToastOptions | a [ToastOptions](./kibana-plugin-core-public.toastoptions.md) | Returns: -`Toast` +Toast a [Toast](./kibana-plugin-core-public.toast.md) diff --git a/docs/development/core/public/kibana-plugin-core-public.toastsapi.addwarning.md b/docs/development/core/public/kibana-plugin-core-public.toastsapi.addwarning.md index 6154af148332da..790af0d26220ac 100644 --- a/docs/development/core/public/kibana-plugin-core-public.toastsapi.addwarning.md +++ b/docs/development/core/public/kibana-plugin-core-public.toastsapi.addwarning.md @@ -16,12 +16,12 @@ addWarning(toastOrTitle: ToastInput, options?: ToastOptions): Toast; | Parameter | Type | Description | | --- | --- | --- | -| toastOrTitle | ToastInput | a [ToastInput](./kibana-plugin-core-public.toastinput.md) | -| options | ToastOptions | a [ToastOptions](./kibana-plugin-core-public.toastoptions.md) | +| toastOrTitle | ToastInput | a [ToastInput](./kibana-plugin-core-public.toastinput.md) | +| options | ToastOptions | a [ToastOptions](./kibana-plugin-core-public.toastoptions.md) | Returns: -`Toast` +Toast a [Toast](./kibana-plugin-core-public.toast.md) diff --git a/docs/development/core/public/kibana-plugin-core-public.toastsapi.get_.md b/docs/development/core/public/kibana-plugin-core-public.toastsapi.get_.md index 90b32a8b48e5cf..275d30fd54e0f1 100644 --- a/docs/development/core/public/kibana-plugin-core-public.toastsapi.get_.md +++ b/docs/development/core/public/kibana-plugin-core-public.toastsapi.get_.md @@ -13,5 +13,5 @@ get$(): Rx.Observable; ``` Returns: -`Rx.Observable` +Rx.Observable<Toast\[\]> diff --git a/docs/development/core/public/kibana-plugin-core-public.toastsapi.md b/docs/development/core/public/kibana-plugin-core-public.toastsapi.md index ca4c08989128aa..4d7f9dcacfa6fb 100644 --- a/docs/development/core/public/kibana-plugin-core-public.toastsapi.md +++ b/docs/development/core/public/kibana-plugin-core-public.toastsapi.md @@ -11,6 +11,7 @@ Methods for adding and removing global toast messages. ```typescript export declare class ToastsApi implements IToasts ``` +Implements: IToasts ## Constructors diff --git a/docs/development/core/public/kibana-plugin-core-public.toastsapi.remove.md b/docs/development/core/public/kibana-plugin-core-public.toastsapi.remove.md index 360fb945228215..aeac9f46b79010 100644 --- a/docs/development/core/public/kibana-plugin-core-public.toastsapi.remove.md +++ b/docs/development/core/public/kibana-plugin-core-public.toastsapi.remove.md @@ -16,9 +16,9 @@ remove(toastOrId: Toast | string): void; | Parameter | Type | Description | | --- | --- | --- | -| toastOrId | Toast | string | a [Toast](./kibana-plugin-core-public.toast.md) returned by [ToastsApi.add()](./kibana-plugin-core-public.toastsapi.add.md) or its id | +| toastOrId | Toast \| string | a [Toast](./kibana-plugin-core-public.toast.md) returned by [ToastsApi.add()](./kibana-plugin-core-public.toastsapi.add.md) or its id | Returns: -`void` +void diff --git a/docs/development/core/public/kibana-plugin-core-public.uisettingsparams.md b/docs/development/core/public/kibana-plugin-core-public.uisettingsparams.md index 54d1a6612f4bab..325ce96f36ca3f 100644 --- a/docs/development/core/public/kibana-plugin-core-public.uisettingsparams.md +++ b/docs/development/core/public/kibana-plugin-core-public.uisettingsparams.md @@ -16,18 +16,18 @@ export interface UiSettingsParams | Property | Type | Description | | --- | --- | --- | -| [category](./kibana-plugin-core-public.uisettingsparams.category.md) | string[] | used to group the configured setting in the UI | -| [deprecation](./kibana-plugin-core-public.uisettingsparams.deprecation.md) | DeprecationSettings | optional deprecation information. Used to generate a deprecation warning. | -| [description](./kibana-plugin-core-public.uisettingsparams.description.md) | string | description provided to a user in UI | -| [metric](./kibana-plugin-core-public.uisettingsparams.metric.md) | {
type: UiCounterMetricType;
name: string;
} | Metric to track once this property changes | -| [name](./kibana-plugin-core-public.uisettingsparams.name.md) | string | title in the UI | -| [optionLabels](./kibana-plugin-core-public.uisettingsparams.optionlabels.md) | Record<string, string> | text labels for 'select' type UI element | -| [options](./kibana-plugin-core-public.uisettingsparams.options.md) | string[] | array of permitted values for this setting | -| [order](./kibana-plugin-core-public.uisettingsparams.order.md) | number | index of the settings within its category (ascending order, smallest will be displayed first). Used for ordering in the UI. settings without order defined will be displayed last and ordered by name | -| [readonly](./kibana-plugin-core-public.uisettingsparams.readonly.md) | boolean | a flag indicating that value cannot be changed | -| [requiresPageReload](./kibana-plugin-core-public.uisettingsparams.requirespagereload.md) | boolean | a flag indicating whether new value applying requires page reloading | -| [schema](./kibana-plugin-core-public.uisettingsparams.schema.md) | Type<T> | | -| [sensitive](./kibana-plugin-core-public.uisettingsparams.sensitive.md) | boolean | a flag indicating that value might contain user sensitive data. used by telemetry to mask the value of the setting when sent. | -| [type](./kibana-plugin-core-public.uisettingsparams.type.md) | UiSettingsType | defines a type of UI element [UiSettingsType](./kibana-plugin-core-public.uisettingstype.md) | -| [value](./kibana-plugin-core-public.uisettingsparams.value.md) | T | default value to fall back to if a user doesn't provide any | +| [category?](./kibana-plugin-core-public.uisettingsparams.category.md) | string\[\] | (Optional) used to group the configured setting in the UI | +| [deprecation?](./kibana-plugin-core-public.uisettingsparams.deprecation.md) | DeprecationSettings | (Optional) optional deprecation information. Used to generate a deprecation warning. | +| [description?](./kibana-plugin-core-public.uisettingsparams.description.md) | string | (Optional) description provided to a user in UI | +| [metric?](./kibana-plugin-core-public.uisettingsparams.metric.md) | { type: UiCounterMetricType; name: string; } | (Optional) Metric to track once this property changes | +| [name?](./kibana-plugin-core-public.uisettingsparams.name.md) | string | (Optional) title in the UI | +| [optionLabels?](./kibana-plugin-core-public.uisettingsparams.optionlabels.md) | Record<string, string> | (Optional) text labels for 'select' type UI element | +| [options?](./kibana-plugin-core-public.uisettingsparams.options.md) | string\[\] | (Optional) array of permitted values for this setting | +| [order?](./kibana-plugin-core-public.uisettingsparams.order.md) | number | (Optional) index of the settings within its category (ascending order, smallest will be displayed first). Used for ordering in the UI. settings without order defined will be displayed last and ordered by name | +| [readonly?](./kibana-plugin-core-public.uisettingsparams.readonly.md) | boolean | (Optional) a flag indicating that value cannot be changed | +| [requiresPageReload?](./kibana-plugin-core-public.uisettingsparams.requirespagereload.md) | boolean | (Optional) a flag indicating whether new value applying requires page reloading | +| [schema](./kibana-plugin-core-public.uisettingsparams.schema.md) | Type<T> | | +| [sensitive?](./kibana-plugin-core-public.uisettingsparams.sensitive.md) | boolean | (Optional) a flag indicating that value might contain user sensitive data. used by telemetry to mask the value of the setting when sent. | +| [type?](./kibana-plugin-core-public.uisettingsparams.type.md) | UiSettingsType | (Optional) defines a type of UI element [UiSettingsType](./kibana-plugin-core-public.uisettingstype.md) | +| [value?](./kibana-plugin-core-public.uisettingsparams.value.md) | T | (Optional) default value to fall back to if a user doesn't provide any | diff --git a/docs/development/core/public/kibana-plugin-core-public.userprovidedvalues.md b/docs/development/core/public/kibana-plugin-core-public.userprovidedvalues.md index e59a75500f5581..eb8f0124c33411 100644 --- a/docs/development/core/public/kibana-plugin-core-public.userprovidedvalues.md +++ b/docs/development/core/public/kibana-plugin-core-public.userprovidedvalues.md @@ -16,6 +16,6 @@ export interface UserProvidedValues | Property | Type | Description | | --- | --- | --- | -| [isOverridden](./kibana-plugin-core-public.userprovidedvalues.isoverridden.md) | boolean | | -| [userValue](./kibana-plugin-core-public.userprovidedvalues.uservalue.md) | T | | +| [isOverridden?](./kibana-plugin-core-public.userprovidedvalues.isoverridden.md) | boolean | (Optional) | +| [userValue?](./kibana-plugin-core-public.userprovidedvalues.uservalue.md) | T | (Optional) | diff --git a/docs/development/core/server/kibana-plugin-core-server.appcategory.md b/docs/development/core/server/kibana-plugin-core-server.appcategory.md index a761bf4e5b3937..ca5e8b354d451b 100644 --- a/docs/development/core/server/kibana-plugin-core-server.appcategory.md +++ b/docs/development/core/server/kibana-plugin-core-server.appcategory.md @@ -16,9 +16,9 @@ export interface AppCategory | Property | Type | Description | | --- | --- | --- | -| [ariaLabel](./kibana-plugin-core-server.appcategory.arialabel.md) | string | If the visual label isn't appropriate for screen readers, can override it here | -| [euiIconType](./kibana-plugin-core-server.appcategory.euiicontype.md) | string | Define an icon to be used for the category If the category is only 1 item, and no icon is defined, will default to the product icon Defaults to initials if no icon is defined | -| [id](./kibana-plugin-core-server.appcategory.id.md) | string | Unique identifier for the categories | -| [label](./kibana-plugin-core-server.appcategory.label.md) | string | Label used for category name. Also used as aria-label if one isn't set. | -| [order](./kibana-plugin-core-server.appcategory.order.md) | number | The order that categories will be sorted in Prefer large steps between categories to allow for further editing (Default categories are in steps of 1000) | +| [ariaLabel?](./kibana-plugin-core-server.appcategory.arialabel.md) | string | (Optional) If the visual label isn't appropriate for screen readers, can override it here | +| [euiIconType?](./kibana-plugin-core-server.appcategory.euiicontype.md) | string | (Optional) Define an icon to be used for the category If the category is only 1 item, and no icon is defined, will default to the product icon Defaults to initials if no icon is defined | +| [id](./kibana-plugin-core-server.appcategory.id.md) | string | Unique identifier for the categories | +| [label](./kibana-plugin-core-server.appcategory.label.md) | string | Label used for category name. Also used as aria-label if one isn't set. | +| [order?](./kibana-plugin-core-server.appcategory.order.md) | number | (Optional) The order that categories will be sorted in Prefer large steps between categories to allow for further editing (Default categories are in steps of 1000) | diff --git a/docs/development/core/server/kibana-plugin-core-server.asyncplugin.md b/docs/development/core/server/kibana-plugin-core-server.asyncplugin.md index 1ad1d87220b748..c5c664e07f297d 100644 --- a/docs/development/core/server/kibana-plugin-core-server.asyncplugin.md +++ b/docs/development/core/server/kibana-plugin-core-server.asyncplugin.md @@ -6,7 +6,7 @@ > Warning: This API is now obsolete. > -> Asynchronous lifecycles are deprecated, and should be migrated to sync [plugin](./kibana-plugin-core-server.plugin.md) +> Asynchronous lifecycles are deprecated, and should be migrated to sync > A plugin with asynchronous lifecycle methods. @@ -23,5 +23,5 @@ export interface AsyncPlugin(Optional) | diff --git a/docs/development/core/server/kibana-plugin-core-server.asyncplugin.setup.md b/docs/development/core/server/kibana-plugin-core-server.asyncplugin.setup.md index 1d033b7b88b051..73752d6c9bd206 100644 --- a/docs/development/core/server/kibana-plugin-core-server.asyncplugin.setup.md +++ b/docs/development/core/server/kibana-plugin-core-server.asyncplugin.setup.md @@ -14,10 +14,10 @@ setup(core: CoreSetup, plugins: TPluginsSetup): TSetup | Promise; | Parameter | Type | Description | | --- | --- | --- | -| core | CoreSetup | | -| plugins | TPluginsSetup | | +| core | CoreSetup | | +| plugins | TPluginsSetup | | Returns: -`TSetup | Promise` +TSetup \| Promise<TSetup> diff --git a/docs/development/core/server/kibana-plugin-core-server.asyncplugin.start.md b/docs/development/core/server/kibana-plugin-core-server.asyncplugin.start.md index 3cce90f01603bb..98cf74341062a5 100644 --- a/docs/development/core/server/kibana-plugin-core-server.asyncplugin.start.md +++ b/docs/development/core/server/kibana-plugin-core-server.asyncplugin.start.md @@ -14,10 +14,10 @@ start(core: CoreStart, plugins: TPluginsStart): TStart | Promise; | Parameter | Type | Description | | --- | --- | --- | -| core | CoreStart | | -| plugins | TPluginsStart | | +| core | CoreStart | | +| plugins | TPluginsStart | | Returns: -`TStart | Promise` +TStart \| Promise<TStart> diff --git a/docs/development/core/server/kibana-plugin-core-server.asyncplugin.stop.md b/docs/development/core/server/kibana-plugin-core-server.asyncplugin.stop.md index 9272fc2c4eba06..80c554f3433469 100644 --- a/docs/development/core/server/kibana-plugin-core-server.asyncplugin.stop.md +++ b/docs/development/core/server/kibana-plugin-core-server.asyncplugin.stop.md @@ -11,5 +11,5 @@ stop?(): void; ``` Returns: -`void` +void diff --git a/docs/development/core/server/kibana-plugin-core-server.authenticated.md b/docs/development/core/server/kibana-plugin-core-server.authenticated.md index ffbf9429260159..90b480d4a026c8 100644 --- a/docs/development/core/server/kibana-plugin-core-server.authenticated.md +++ b/docs/development/core/server/kibana-plugin-core-server.authenticated.md @@ -10,10 +10,11 @@ ```typescript export interface Authenticated extends AuthResultParams ``` +Extends: AuthResultParams ## Properties | Property | Type | Description | | --- | --- | --- | -| [type](./kibana-plugin-core-server.authenticated.type.md) | AuthResultType.authenticated | | +| [type](./kibana-plugin-core-server.authenticated.type.md) | AuthResultType.authenticated | | diff --git a/docs/development/core/server/kibana-plugin-core-server.authnothandled.md b/docs/development/core/server/kibana-plugin-core-server.authnothandled.md index c1eaa6899135bd..297f60e4bd8ac5 100644 --- a/docs/development/core/server/kibana-plugin-core-server.authnothandled.md +++ b/docs/development/core/server/kibana-plugin-core-server.authnothandled.md @@ -15,5 +15,5 @@ export interface AuthNotHandled | Property | Type | Description | | --- | --- | --- | -| [type](./kibana-plugin-core-server.authnothandled.type.md) | AuthResultType.notHandled | | +| [type](./kibana-plugin-core-server.authnothandled.type.md) | AuthResultType.notHandled | | diff --git a/docs/development/core/server/kibana-plugin-core-server.authredirected.md b/docs/development/core/server/kibana-plugin-core-server.authredirected.md index 7b5a4d60fb0bb9..4da08e49056f78 100644 --- a/docs/development/core/server/kibana-plugin-core-server.authredirected.md +++ b/docs/development/core/server/kibana-plugin-core-server.authredirected.md @@ -10,10 +10,11 @@ ```typescript export interface AuthRedirected extends AuthRedirectedParams ``` +Extends: AuthRedirectedParams ## Properties | Property | Type | Description | | --- | --- | --- | -| [type](./kibana-plugin-core-server.authredirected.type.md) | AuthResultType.redirected | | +| [type](./kibana-plugin-core-server.authredirected.type.md) | AuthResultType.redirected | | diff --git a/docs/development/core/server/kibana-plugin-core-server.authredirectedparams.md b/docs/development/core/server/kibana-plugin-core-server.authredirectedparams.md index 2e1f04ef4efc6d..2f6ef7c6f6ba4f 100644 --- a/docs/development/core/server/kibana-plugin-core-server.authredirectedparams.md +++ b/docs/development/core/server/kibana-plugin-core-server.authredirectedparams.md @@ -16,5 +16,5 @@ export interface AuthRedirectedParams | Property | Type | Description | | --- | --- | --- | -| [headers](./kibana-plugin-core-server.authredirectedparams.headers.md) | {
location: string;
} & ResponseHeaders | Headers to attach for auth redirect. Must include "location" header | +| [headers](./kibana-plugin-core-server.authredirectedparams.headers.md) | { location: string; } & ResponseHeaders | Headers to attach for auth redirect. Must include "location" header | diff --git a/docs/development/core/server/kibana-plugin-core-server.authresultparams.md b/docs/development/core/server/kibana-plugin-core-server.authresultparams.md index db4ead393c0478..7e907a9bf7a77d 100644 --- a/docs/development/core/server/kibana-plugin-core-server.authresultparams.md +++ b/docs/development/core/server/kibana-plugin-core-server.authresultparams.md @@ -16,7 +16,7 @@ export interface AuthResultParams | Property | Type | Description | | --- | --- | --- | -| [requestHeaders](./kibana-plugin-core-server.authresultparams.requestheaders.md) | AuthHeaders | Auth specific headers to attach to a request object. Used to perform a request to Elasticsearch on behalf of an authenticated user. | -| [responseHeaders](./kibana-plugin-core-server.authresultparams.responseheaders.md) | AuthHeaders | Auth specific headers to attach to a response object. Used to send back authentication mechanism related headers to a client when needed. | -| [state](./kibana-plugin-core-server.authresultparams.state.md) | Record<string, any> | Data to associate with an incoming request. Any downstream plugin may get access to the data. | +| [requestHeaders?](./kibana-plugin-core-server.authresultparams.requestheaders.md) | AuthHeaders | (Optional) Auth specific headers to attach to a request object. Used to perform a request to Elasticsearch on behalf of an authenticated user. | +| [responseHeaders?](./kibana-plugin-core-server.authresultparams.responseheaders.md) | AuthHeaders | (Optional) Auth specific headers to attach to a response object. Used to send back authentication mechanism related headers to a client when needed. | +| [state?](./kibana-plugin-core-server.authresultparams.state.md) | Record<string, any> | (Optional) Data to associate with an incoming request. Any downstream plugin may get access to the data. | diff --git a/docs/development/core/server/kibana-plugin-core-server.authtoolkit.md b/docs/development/core/server/kibana-plugin-core-server.authtoolkit.md index 5f8b98ab2e8948..24b561d04bbb71 100644 --- a/docs/development/core/server/kibana-plugin-core-server.authtoolkit.md +++ b/docs/development/core/server/kibana-plugin-core-server.authtoolkit.md @@ -16,7 +16,7 @@ export interface AuthToolkit | Property | Type | Description | | --- | --- | --- | -| [authenticated](./kibana-plugin-core-server.authtoolkit.authenticated.md) | (data?: AuthResultParams) => AuthResult | Authentication is successful with given credentials, allow request to pass through | -| [notHandled](./kibana-plugin-core-server.authtoolkit.nothandled.md) | () => AuthResult | User has no credentials. Allows user to access a resource when authRequired is 'optional' Rejects a request when authRequired: true | -| [redirected](./kibana-plugin-core-server.authtoolkit.redirected.md) | (headers: {
location: string;
} & ResponseHeaders) => AuthResult | Redirects user to another location to complete authentication when authRequired: true Allows user to access a resource without redirection when authRequired: 'optional' | +| [authenticated](./kibana-plugin-core-server.authtoolkit.authenticated.md) | (data?: AuthResultParams) => AuthResult | Authentication is successful with given credentials, allow request to pass through | +| [notHandled](./kibana-plugin-core-server.authtoolkit.nothandled.md) | () => AuthResult | User has no credentials. Allows user to access a resource when authRequired is 'optional' Rejects a request when authRequired: true | +| [redirected](./kibana-plugin-core-server.authtoolkit.redirected.md) | (headers: { location: string; } & ResponseHeaders) => AuthResult | Redirects user to another location to complete authentication when authRequired: true Allows user to access a resource without redirection when authRequired: 'optional' | diff --git a/docs/development/core/server/kibana-plugin-core-server.basedeprecationdetails.md b/docs/development/core/server/kibana-plugin-core-server.basedeprecationdetails.md index 3e47865062352e..bcd96e35295ac5 100644 --- a/docs/development/core/server/kibana-plugin-core-server.basedeprecationdetails.md +++ b/docs/development/core/server/kibana-plugin-core-server.basedeprecationdetails.md @@ -16,11 +16,11 @@ export interface BaseDeprecationDetails | Property | Type | Description | | --- | --- | --- | -| [correctiveActions](./kibana-plugin-core-server.basedeprecationdetails.correctiveactions.md) | {
api?: {
path: string;
method: 'POST' | 'PUT';
body?: {
[key: string]: any;
};
omitContextFromBody?: boolean;
};
manualSteps: string[];
} | corrective action needed to fix this deprecation. | -| [deprecationType](./kibana-plugin-core-server.basedeprecationdetails.deprecationtype.md) | 'config' | 'feature' | (optional) Used to identify between different deprecation types. Example use case: in Upgrade Assistant, we may want to allow the user to sort by deprecation type or show each type in a separate tab.Feel free to add new types if necessary. Predefined types are necessary to reduce having similar definitions with different keywords across kibana deprecations. | -| [documentationUrl](./kibana-plugin-core-server.basedeprecationdetails.documentationurl.md) | string | (optional) link to the documentation for more details on the deprecation. | -| [level](./kibana-plugin-core-server.basedeprecationdetails.level.md) | 'warning' | 'critical' | 'fetch_error' | levels: - warning: will not break deployment upon upgrade - critical: needs to be addressed before upgrade. - fetch\_error: Deprecations service failed to grab the deprecation details for the domain. | -| [message](./kibana-plugin-core-server.basedeprecationdetails.message.md) | string | The description message to be displayed for the deprecation. Check the README for writing deprecations in src/core/server/deprecations/README.mdx | -| [requireRestart](./kibana-plugin-core-server.basedeprecationdetails.requirerestart.md) | boolean | (optional) specify the fix for this deprecation requires a full kibana restart. | -| [title](./kibana-plugin-core-server.basedeprecationdetails.title.md) | string | The title of the deprecation. Check the README for writing deprecations in src/core/server/deprecations/README.mdx | +| [correctiveActions](./kibana-plugin-core-server.basedeprecationdetails.correctiveactions.md) | { api?: { path: string; method: 'POST' \| 'PUT'; body?: { \[key: string\]: any; }; omitContextFromBody?: boolean; }; manualSteps: string\[\]; } | corrective action needed to fix this deprecation. | +| [deprecationType?](./kibana-plugin-core-server.basedeprecationdetails.deprecationtype.md) | 'config' \| 'feature' | (Optional) (optional) Used to identify between different deprecation types. Example use case: in Upgrade Assistant, we may want to allow the user to sort by deprecation type or show each type in a separate tab.Feel free to add new types if necessary. Predefined types are necessary to reduce having similar definitions with different keywords across kibana deprecations. | +| [documentationUrl?](./kibana-plugin-core-server.basedeprecationdetails.documentationurl.md) | string | (Optional) (optional) link to the documentation for more details on the deprecation. | +| [level](./kibana-plugin-core-server.basedeprecationdetails.level.md) | 'warning' \| 'critical' \| 'fetch\_error' | levels: - warning: will not break deployment upon upgrade - critical: needs to be addressed before upgrade. - fetch\_error: Deprecations service failed to grab the deprecation details for the domain. | +| [message](./kibana-plugin-core-server.basedeprecationdetails.message.md) | string | The description message to be displayed for the deprecation. Check the README for writing deprecations in src/core/server/deprecations/README.mdx | +| [requireRestart?](./kibana-plugin-core-server.basedeprecationdetails.requirerestart.md) | boolean | (Optional) (optional) specify the fix for this deprecation requires a full kibana restart. | +| [title](./kibana-plugin-core-server.basedeprecationdetails.title.md) | string | The title of the deprecation. Check the README for writing deprecations in src/core/server/deprecations/README.mdx | diff --git a/docs/development/core/server/kibana-plugin-core-server.basepath.md b/docs/development/core/server/kibana-plugin-core-server.basepath.md index f4bac88cd85f5b..4fae861cf16590 100644 --- a/docs/development/core/server/kibana-plugin-core-server.basepath.md +++ b/docs/development/core/server/kibana-plugin-core-server.basepath.md @@ -20,10 +20,10 @@ The constructor for this class is marked as internal. Third-party code should no | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [get](./kibana-plugin-core-server.basepath.get.md) | | (request: KibanaRequest) => string | returns basePath value, specific for an incoming request. | -| [prepend](./kibana-plugin-core-server.basepath.prepend.md) | | (path: string) => string | Prepends path with the basePath. | -| [publicBaseUrl](./kibana-plugin-core-server.basepath.publicbaseurl.md) | | string | The server's publicly exposed base URL, if configured. Includes protocol, host, port (optional) and the [BasePath.serverBasePath](./kibana-plugin-core-server.basepath.serverbasepath.md). | -| [remove](./kibana-plugin-core-server.basepath.remove.md) | | (path: string) => string | Removes the prepended basePath from the path. | -| [serverBasePath](./kibana-plugin-core-server.basepath.serverbasepath.md) | | string | returns the server's basePathSee [BasePath.get](./kibana-plugin-core-server.basepath.get.md) for getting the basePath value for a specific request | -| [set](./kibana-plugin-core-server.basepath.set.md) | | (request: KibanaRequest, requestSpecificBasePath: string) => void | sets basePath value, specific for an incoming request. | +| [get](./kibana-plugin-core-server.basepath.get.md) | | (request: KibanaRequest) => string | returns basePath value, specific for an incoming request. | +| [prepend](./kibana-plugin-core-server.basepath.prepend.md) | | (path: string) => string | Prepends path with the basePath. | +| [publicBaseUrl?](./kibana-plugin-core-server.basepath.publicbaseurl.md) | | string | (Optional) The server's publicly exposed base URL, if configured. Includes protocol, host, port (optional) and the [BasePath.serverBasePath](./kibana-plugin-core-server.basepath.serverbasepath.md). | +| [remove](./kibana-plugin-core-server.basepath.remove.md) | | (path: string) => string | Removes the prepended basePath from the path. | +| [serverBasePath](./kibana-plugin-core-server.basepath.serverbasepath.md) | | string | returns the server's basePathSee [BasePath.get](./kibana-plugin-core-server.basepath.get.md) for getting the basePath value for a specific request | +| [set](./kibana-plugin-core-server.basepath.set.md) | | (request: KibanaRequest, requestSpecificBasePath: string) => void | sets basePath value, specific for an incoming request. | diff --git a/docs/development/core/server/kibana-plugin-core-server.capabilities.md b/docs/development/core/server/kibana-plugin-core-server.capabilities.md index cf47ce4609ea10..a5900e96a86b50 100644 --- a/docs/development/core/server/kibana-plugin-core-server.capabilities.md +++ b/docs/development/core/server/kibana-plugin-core-server.capabilities.md @@ -16,7 +16,7 @@ export interface Capabilities | Property | Type | Description | | --- | --- | --- | -| [catalogue](./kibana-plugin-core-server.capabilities.catalogue.md) | Record<string, boolean> | Catalogue capabilities. Catalogue entries drive the visibility of the Kibana homepage options. | -| [management](./kibana-plugin-core-server.capabilities.management.md) | {
[sectionId: string]: Record<string, boolean>;
} | Management section capabilities. | -| [navLinks](./kibana-plugin-core-server.capabilities.navlinks.md) | Record<string, boolean> | Navigation link capabilities. | +| [catalogue](./kibana-plugin-core-server.capabilities.catalogue.md) | Record<string, boolean> | Catalogue capabilities. Catalogue entries drive the visibility of the Kibana homepage options. | +| [management](./kibana-plugin-core-server.capabilities.management.md) | { \[sectionId: string\]: Record<string, boolean>; } | Management section capabilities. | +| [navLinks](./kibana-plugin-core-server.capabilities.navlinks.md) | Record<string, boolean> | Navigation link capabilities. | diff --git a/docs/development/core/server/kibana-plugin-core-server.capabilitiessetup.registerprovider.md b/docs/development/core/server/kibana-plugin-core-server.capabilitiessetup.registerprovider.md index 01a6f3562e77e8..9122f7e0f11ede 100644 --- a/docs/development/core/server/kibana-plugin-core-server.capabilitiessetup.registerprovider.md +++ b/docs/development/core/server/kibana-plugin-core-server.capabilitiessetup.registerprovider.md @@ -16,11 +16,11 @@ registerProvider(provider: CapabilitiesProvider): void; | Parameter | Type | Description | | --- | --- | --- | -| provider | CapabilitiesProvider | | +| provider | CapabilitiesProvider | | Returns: -`void` +void ## Example @@ -41,6 +41,5 @@ public setup(core: CoreSetup, deps: {}) { } }); } - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.capabilitiessetup.registerswitcher.md b/docs/development/core/server/kibana-plugin-core-server.capabilitiessetup.registerswitcher.md index 715f15ec812a3d..c07703c1f365f0 100644 --- a/docs/development/core/server/kibana-plugin-core-server.capabilitiessetup.registerswitcher.md +++ b/docs/development/core/server/kibana-plugin-core-server.capabilitiessetup.registerswitcher.md @@ -18,11 +18,11 @@ registerSwitcher(switcher: CapabilitiesSwitcher): void; | Parameter | Type | Description | | --- | --- | --- | -| switcher | CapabilitiesSwitcher | | +| switcher | CapabilitiesSwitcher | | Returns: -`void` +void ## Example @@ -54,6 +54,5 @@ public setup(core: CoreSetup, deps: {}) { return {}; // All capabilities will remain unchanged. }); } - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.capabilitiesstart.resolvecapabilities.md b/docs/development/core/server/kibana-plugin-core-server.capabilitiesstart.resolvecapabilities.md index d0e02499c580e0..a9dc279526065e 100644 --- a/docs/development/core/server/kibana-plugin-core-server.capabilitiesstart.resolvecapabilities.md +++ b/docs/development/core/server/kibana-plugin-core-server.capabilitiesstart.resolvecapabilities.md @@ -16,10 +16,10 @@ resolveCapabilities(request: KibanaRequest, options?: ResolveCapabilitiesOptions | Parameter | Type | Description | | --- | --- | --- | -| request | KibanaRequest | | -| options | ResolveCapabilitiesOptions | | +| request | KibanaRequest | | +| options | ResolveCapabilitiesOptions | | Returns: -`Promise` +Promise<Capabilities> diff --git a/docs/development/core/server/kibana-plugin-core-server.configdeprecationdetails.md b/docs/development/core/server/kibana-plugin-core-server.configdeprecationdetails.md index d1ccbb0b6164a5..6065d1fc1889f5 100644 --- a/docs/development/core/server/kibana-plugin-core-server.configdeprecationdetails.md +++ b/docs/development/core/server/kibana-plugin-core-server.configdeprecationdetails.md @@ -10,11 +10,12 @@ ```typescript export interface ConfigDeprecationDetails extends BaseDeprecationDetails ``` +Extends: BaseDeprecationDetails ## Properties | Property | Type | Description | | --- | --- | --- | -| [configPath](./kibana-plugin-core-server.configdeprecationdetails.configpath.md) | string | | -| [deprecationType](./kibana-plugin-core-server.configdeprecationdetails.deprecationtype.md) | 'config' | | +| [configPath](./kibana-plugin-core-server.configdeprecationdetails.configpath.md) | string | | +| [deprecationType](./kibana-plugin-core-server.configdeprecationdetails.deprecationtype.md) | 'config' | | diff --git a/docs/development/core/server/kibana-plugin-core-server.contextsetup.createcontextcontainer.md b/docs/development/core/server/kibana-plugin-core-server.contextsetup.createcontextcontainer.md index 0d12fc16af4232..5e60dd7e2ffd71 100644 --- a/docs/development/core/server/kibana-plugin-core-server.contextsetup.createcontextcontainer.md +++ b/docs/development/core/server/kibana-plugin-core-server.contextsetup.createcontextcontainer.md @@ -13,5 +13,5 @@ createContextContainer(): IContextContainer; ``` Returns: -`IContextContainer` +IContextContainer diff --git a/docs/development/core/server/kibana-plugin-core-server.contextsetup.md b/docs/development/core/server/kibana-plugin-core-server.contextsetup.md index df3ee924fbccaf..a15adccc97714a 100644 --- a/docs/development/core/server/kibana-plugin-core-server.contextsetup.md +++ b/docs/development/core/server/kibana-plugin-core-server.contextsetup.md @@ -68,7 +68,6 @@ class MyPlugin { } } } - ``` ## Example @@ -127,7 +126,6 @@ class VizRenderingPlugin { }; } } - ``` ## Methods diff --git a/docs/development/core/server/kibana-plugin-core-server.corepreboot.md b/docs/development/core/server/kibana-plugin-core-server.corepreboot.md index 475b5f109d58c3..3ac97d2ca3b373 100644 --- a/docs/development/core/server/kibana-plugin-core-server.corepreboot.md +++ b/docs/development/core/server/kibana-plugin-core-server.corepreboot.md @@ -16,7 +16,7 @@ export interface CorePreboot | Property | Type | Description | | --- | --- | --- | -| [elasticsearch](./kibana-plugin-core-server.corepreboot.elasticsearch.md) | ElasticsearchServicePreboot | [ElasticsearchServicePreboot](./kibana-plugin-core-server.elasticsearchservicepreboot.md) | -| [http](./kibana-plugin-core-server.corepreboot.http.md) | HttpServicePreboot | [HttpServicePreboot](./kibana-plugin-core-server.httpservicepreboot.md) | -| [preboot](./kibana-plugin-core-server.corepreboot.preboot.md) | PrebootServicePreboot | [PrebootServicePreboot](./kibana-plugin-core-server.prebootservicepreboot.md) | +| [elasticsearch](./kibana-plugin-core-server.corepreboot.elasticsearch.md) | ElasticsearchServicePreboot | [ElasticsearchServicePreboot](./kibana-plugin-core-server.elasticsearchservicepreboot.md) | +| [http](./kibana-plugin-core-server.corepreboot.http.md) | HttpServicePreboot | [HttpServicePreboot](./kibana-plugin-core-server.httpservicepreboot.md) | +| [preboot](./kibana-plugin-core-server.corepreboot.preboot.md) | PrebootServicePreboot | [PrebootServicePreboot](./kibana-plugin-core-server.prebootservicepreboot.md) | diff --git a/docs/development/core/server/kibana-plugin-core-server.coresetup.md b/docs/development/core/server/kibana-plugin-core-server.coresetup.md index b03101b4d9fe64..f4a8ece97e0139 100644 --- a/docs/development/core/server/kibana-plugin-core-server.coresetup.md +++ b/docs/development/core/server/kibana-plugin-core-server.coresetup.md @@ -16,17 +16,17 @@ export interface CoreSetupCapabilitiesSetup | [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) | -| [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<TPluginsStart, TStart> | [StartServicesAccessor](./kibana-plugin-core-server.startservicesaccessor.md) | -| [http](./kibana-plugin-core-server.coresetup.http.md) | HttpServiceSetup & {
resources: HttpResources;
} | [HttpServiceSetup](./kibana-plugin-core-server.httpservicesetup.md) | -| [i18n](./kibana-plugin-core-server.coresetup.i18n.md) | I18nServiceSetup | [I18nServiceSetup](./kibana-plugin-core-server.i18nservicesetup.md) | -| [logging](./kibana-plugin-core-server.coresetup.logging.md) | LoggingServiceSetup | [LoggingServiceSetup](./kibana-plugin-core-server.loggingservicesetup.md) | -| [metrics](./kibana-plugin-core-server.coresetup.metrics.md) | MetricsServiceSetup | [MetricsServiceSetup](./kibana-plugin-core-server.metricsservicesetup.md) | -| [savedObjects](./kibana-plugin-core-server.coresetup.savedobjects.md) | SavedObjectsServiceSetup | [SavedObjectsServiceSetup](./kibana-plugin-core-server.savedobjectsservicesetup.md) | -| [status](./kibana-plugin-core-server.coresetup.status.md) | StatusServiceSetup | [StatusServiceSetup](./kibana-plugin-core-server.statusservicesetup.md) | -| [uiSettings](./kibana-plugin-core-server.coresetup.uisettings.md) | UiSettingsServiceSetup | [UiSettingsServiceSetup](./kibana-plugin-core-server.uisettingsservicesetup.md) | +| [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) | +| [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<TPluginsStart, TStart> | [StartServicesAccessor](./kibana-plugin-core-server.startservicesaccessor.md) | +| [http](./kibana-plugin-core-server.coresetup.http.md) | HttpServiceSetup & { resources: HttpResources; } | [HttpServiceSetup](./kibana-plugin-core-server.httpservicesetup.md) | +| [i18n](./kibana-plugin-core-server.coresetup.i18n.md) | I18nServiceSetup | [I18nServiceSetup](./kibana-plugin-core-server.i18nservicesetup.md) | +| [logging](./kibana-plugin-core-server.coresetup.logging.md) | LoggingServiceSetup | [LoggingServiceSetup](./kibana-plugin-core-server.loggingservicesetup.md) | +| [metrics](./kibana-plugin-core-server.coresetup.metrics.md) | MetricsServiceSetup | [MetricsServiceSetup](./kibana-plugin-core-server.metricsservicesetup.md) | +| [savedObjects](./kibana-plugin-core-server.coresetup.savedobjects.md) | SavedObjectsServiceSetup | [SavedObjectsServiceSetup](./kibana-plugin-core-server.savedobjectsservicesetup.md) | +| [status](./kibana-plugin-core-server.coresetup.status.md) | StatusServiceSetup | [StatusServiceSetup](./kibana-plugin-core-server.statusservicesetup.md) | +| [uiSettings](./kibana-plugin-core-server.coresetup.uisettings.md) | UiSettingsServiceSetup | [UiSettingsServiceSetup](./kibana-plugin-core-server.uisettingsservicesetup.md) | diff --git a/docs/development/core/server/kibana-plugin-core-server.corestart.md b/docs/development/core/server/kibana-plugin-core-server.corestart.md index d7aaba9149cf5e..8a4a9b2c33f4b8 100644 --- a/docs/development/core/server/kibana-plugin-core-server.corestart.md +++ b/docs/development/core/server/kibana-plugin-core-server.corestart.md @@ -16,11 +16,11 @@ export interface CoreStart | Property | Type | Description | | --- | --- | --- | -| [capabilities](./kibana-plugin-core-server.corestart.capabilities.md) | CapabilitiesStart | [CapabilitiesStart](./kibana-plugin-core-server.capabilitiesstart.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) | -| [metrics](./kibana-plugin-core-server.corestart.metrics.md) | MetricsServiceStart | [MetricsServiceStart](./kibana-plugin-core-server.metricsservicestart.md) | -| [savedObjects](./kibana-plugin-core-server.corestart.savedobjects.md) | SavedObjectsServiceStart | [SavedObjectsServiceStart](./kibana-plugin-core-server.savedobjectsservicestart.md) | -| [uiSettings](./kibana-plugin-core-server.corestart.uisettings.md) | UiSettingsServiceStart | [UiSettingsServiceStart](./kibana-plugin-core-server.uisettingsservicestart.md) | +| [capabilities](./kibana-plugin-core-server.corestart.capabilities.md) | CapabilitiesStart | [CapabilitiesStart](./kibana-plugin-core-server.capabilitiesstart.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) | +| [metrics](./kibana-plugin-core-server.corestart.metrics.md) | MetricsServiceStart | [MetricsServiceStart](./kibana-plugin-core-server.metricsservicestart.md) | +| [savedObjects](./kibana-plugin-core-server.corestart.savedobjects.md) | SavedObjectsServiceStart | [SavedObjectsServiceStart](./kibana-plugin-core-server.savedobjectsservicestart.md) | +| [uiSettings](./kibana-plugin-core-server.corestart.uisettings.md) | UiSettingsServiceStart | [UiSettingsServiceStart](./kibana-plugin-core-server.uisettingsservicestart.md) | diff --git a/docs/development/core/server/kibana-plugin-core-server.corestatus.md b/docs/development/core/server/kibana-plugin-core-server.corestatus.md index 3fde86a18c58bd..8d44ab49dfcb70 100644 --- a/docs/development/core/server/kibana-plugin-core-server.corestatus.md +++ b/docs/development/core/server/kibana-plugin-core-server.corestatus.md @@ -16,6 +16,6 @@ export interface CoreStatus | Property | Type | Description | | --- | --- | --- | -| [elasticsearch](./kibana-plugin-core-server.corestatus.elasticsearch.md) | ServiceStatus | | -| [savedObjects](./kibana-plugin-core-server.corestatus.savedobjects.md) | ServiceStatus | | +| [elasticsearch](./kibana-plugin-core-server.corestatus.elasticsearch.md) | ServiceStatus | | +| [savedObjects](./kibana-plugin-core-server.corestatus.savedobjects.md) | ServiceStatus | | diff --git a/docs/development/core/server/kibana-plugin-core-server.countresponse.md b/docs/development/core/server/kibana-plugin-core-server.countresponse.md index f8664f4878f46a..53793dc87bf338 100644 --- a/docs/development/core/server/kibana-plugin-core-server.countresponse.md +++ b/docs/development/core/server/kibana-plugin-core-server.countresponse.md @@ -15,6 +15,6 @@ export interface CountResponse | Property | Type | Description | | --- | --- | --- | -| [\_shards](./kibana-plugin-core-server.countresponse._shards.md) | ShardsInfo | | -| [count](./kibana-plugin-core-server.countresponse.count.md) | number | | +| [\_shards](./kibana-plugin-core-server.countresponse._shards.md) | ShardsInfo | | +| [count](./kibana-plugin-core-server.countresponse.count.md) | number | | diff --git a/docs/development/core/server/kibana-plugin-core-server.cspconfig.__private_.md b/docs/development/core/server/kibana-plugin-core-server.cspconfig.__private_.md deleted file mode 100644 index 217066481d33c1..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.cspconfig.__private_.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [CspConfig](./kibana-plugin-core-server.cspconfig.md) > ["\#private"](./kibana-plugin-core-server.cspconfig.__private_.md) - -## CspConfig."\#private" property - -Signature: - -```typescript -#private; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.cspconfig.md b/docs/development/core/server/kibana-plugin-core-server.cspconfig.md index 46f24dfda67391..3d2f4bb683742d 100644 --- a/docs/development/core/server/kibana-plugin-core-server.cspconfig.md +++ b/docs/development/core/server/kibana-plugin-core-server.cspconfig.md @@ -11,6 +11,7 @@ CSP configuration for use in Kibana. ```typescript export declare class CspConfig implements ICspConfig ``` +Implements: ICspConfig ## Remarks @@ -20,10 +21,9 @@ The constructor for this class is marked as internal. Third-party code should no | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| ["\#private"](./kibana-plugin-core-server.cspconfig.__private_.md) | | | | -| [DEFAULT](./kibana-plugin-core-server.cspconfig.default.md) | static | CspConfig | | -| [disableEmbedding](./kibana-plugin-core-server.cspconfig.disableembedding.md) | | boolean | | -| [header](./kibana-plugin-core-server.cspconfig.header.md) | | string | | -| [strict](./kibana-plugin-core-server.cspconfig.strict.md) | | boolean | | -| [warnLegacyBrowsers](./kibana-plugin-core-server.cspconfig.warnlegacybrowsers.md) | | boolean | | +| [DEFAULT](./kibana-plugin-core-server.cspconfig.default.md) | static | CspConfig | | +| [disableEmbedding](./kibana-plugin-core-server.cspconfig.disableembedding.md) | | boolean | | +| [header](./kibana-plugin-core-server.cspconfig.header.md) | | string | | +| [strict](./kibana-plugin-core-server.cspconfig.strict.md) | | boolean | | +| [warnLegacyBrowsers](./kibana-plugin-core-server.cspconfig.warnlegacybrowsers.md) | | boolean | | diff --git a/docs/development/core/server/kibana-plugin-core-server.customhttpresponseoptions.md b/docs/development/core/server/kibana-plugin-core-server.customhttpresponseoptions.md index 82089c831d718d..84cb55f5c1054e 100644 --- a/docs/development/core/server/kibana-plugin-core-server.customhttpresponseoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.customhttpresponseoptions.md @@ -16,8 +16,8 @@ export interface CustomHttpResponseOptionsT | HTTP message to send to the client | -| [bypassErrorFormat](./kibana-plugin-core-server.customhttpresponseoptions.bypasserrorformat.md) | boolean | Bypass the default error formatting | -| [headers](./kibana-plugin-core-server.customhttpresponseoptions.headers.md) | ResponseHeaders | HTTP Headers with additional information about response | -| [statusCode](./kibana-plugin-core-server.customhttpresponseoptions.statuscode.md) | number | | +| [body?](./kibana-plugin-core-server.customhttpresponseoptions.body.md) | T | (Optional) HTTP message to send to the client | +| [bypassErrorFormat?](./kibana-plugin-core-server.customhttpresponseoptions.bypasserrorformat.md) | boolean | (Optional) Bypass the default error formatting | +| [headers?](./kibana-plugin-core-server.customhttpresponseoptions.headers.md) | ResponseHeaders | (Optional) HTTP Headers with additional information about response | +| [statusCode](./kibana-plugin-core-server.customhttpresponseoptions.statuscode.md) | number | | diff --git a/docs/development/core/server/kibana-plugin-core-server.deletedocumentresponse.md b/docs/development/core/server/kibana-plugin-core-server.deletedocumentresponse.md index e8ac7d2fd8ec1c..fe6712ea3b61cc 100644 --- a/docs/development/core/server/kibana-plugin-core-server.deletedocumentresponse.md +++ b/docs/development/core/server/kibana-plugin-core-server.deletedocumentresponse.md @@ -15,12 +15,12 @@ export interface DeleteDocumentResponse | Property | Type | Description | | --- | --- | --- | -| [\_id](./kibana-plugin-core-server.deletedocumentresponse._id.md) | string | | -| [\_index](./kibana-plugin-core-server.deletedocumentresponse._index.md) | string | | -| [\_shards](./kibana-plugin-core-server.deletedocumentresponse._shards.md) | ShardsResponse | | -| [\_type](./kibana-plugin-core-server.deletedocumentresponse._type.md) | string | | -| [\_version](./kibana-plugin-core-server.deletedocumentresponse._version.md) | number | | -| [error](./kibana-plugin-core-server.deletedocumentresponse.error.md) | {
type: string;
} | | -| [found](./kibana-plugin-core-server.deletedocumentresponse.found.md) | boolean | | -| [result](./kibana-plugin-core-server.deletedocumentresponse.result.md) | string | | +| [\_id](./kibana-plugin-core-server.deletedocumentresponse._id.md) | string | | +| [\_index](./kibana-plugin-core-server.deletedocumentresponse._index.md) | string | | +| [\_shards](./kibana-plugin-core-server.deletedocumentresponse._shards.md) | ShardsResponse | | +| [\_type](./kibana-plugin-core-server.deletedocumentresponse._type.md) | string | | +| [\_version](./kibana-plugin-core-server.deletedocumentresponse._version.md) | number | | +| [error?](./kibana-plugin-core-server.deletedocumentresponse.error.md) | { type: string; } | (Optional) | +| [found](./kibana-plugin-core-server.deletedocumentresponse.found.md) | boolean | | +| [result](./kibana-plugin-core-server.deletedocumentresponse.result.md) | string | | diff --git a/docs/development/core/server/kibana-plugin-core-server.deprecationsclient.md b/docs/development/core/server/kibana-plugin-core-server.deprecationsclient.md index 920dc820f7f81e..0e724e251b266f 100644 --- a/docs/development/core/server/kibana-plugin-core-server.deprecationsclient.md +++ b/docs/development/core/server/kibana-plugin-core-server.deprecationsclient.md @@ -16,5 +16,5 @@ export interface DeprecationsClient | Property | Type | Description | | --- | --- | --- | -| [getAllDeprecations](./kibana-plugin-core-server.deprecationsclient.getalldeprecations.md) | () => Promise<DomainDeprecationDetails[]> | | +| [getAllDeprecations](./kibana-plugin-core-server.deprecationsclient.getalldeprecations.md) | () => Promise<DomainDeprecationDetails\[\]> | | diff --git a/docs/development/core/server/kibana-plugin-core-server.deprecationsettings.md b/docs/development/core/server/kibana-plugin-core-server.deprecationsettings.md index 90fd8192b544be..917ca933d63a16 100644 --- a/docs/development/core/server/kibana-plugin-core-server.deprecationsettings.md +++ b/docs/development/core/server/kibana-plugin-core-server.deprecationsettings.md @@ -16,6 +16,6 @@ export interface DeprecationSettings | Property | Type | Description | | --- | --- | --- | -| [docLinksKey](./kibana-plugin-core-server.deprecationsettings.doclinkskey.md) | string | Key to documentation links | -| [message](./kibana-plugin-core-server.deprecationsettings.message.md) | string | Deprecation message | +| [docLinksKey](./kibana-plugin-core-server.deprecationsettings.doclinkskey.md) | string | Key to documentation links | +| [message](./kibana-plugin-core-server.deprecationsettings.message.md) | string | Deprecation message | diff --git a/docs/development/core/server/kibana-plugin-core-server.deprecationsservicesetup.md b/docs/development/core/server/kibana-plugin-core-server.deprecationsservicesetup.md index 7b2cbdecd146a8..1fcefeea9b0baf 100644 --- a/docs/development/core/server/kibana-plugin-core-server.deprecationsservicesetup.md +++ b/docs/development/core/server/kibana-plugin-core-server.deprecationsservicesetup.md @@ -75,12 +75,11 @@ export class Plugin() { core.deprecations.registerDeprecations({ getDeprecations }); } } - ``` ## Properties | Property | Type | Description | | --- | --- | --- | -| [registerDeprecations](./kibana-plugin-core-server.deprecationsservicesetup.registerdeprecations.md) | (deprecationContext: RegisterDeprecationsConfig) => void | | +| [registerDeprecations](./kibana-plugin-core-server.deprecationsservicesetup.registerdeprecations.md) | (deprecationContext: RegisterDeprecationsConfig) => void | | diff --git a/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.md b/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.md index 042f2d1485618e..cf98a0cd68dbd1 100644 --- a/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.md +++ b/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.md @@ -16,10 +16,10 @@ export interface DiscoveredPlugin | Property | Type | Description | | --- | --- | --- | -| [configPath](./kibana-plugin-core-server.discoveredplugin.configpath.md) | ConfigPath | Root configuration path used by the plugin, defaults to "id" in snake\_case format. | -| [id](./kibana-plugin-core-server.discoveredplugin.id.md) | PluginName | Identifier of the plugin. | -| [optionalPlugins](./kibana-plugin-core-server.discoveredplugin.optionalplugins.md) | readonly PluginName[] | An optional list of the other plugins that if installed and enabled \*\*may be\*\* leveraged by this plugin for some additional functionality but otherwise are not required for this plugin to work properly. | -| [requiredBundles](./kibana-plugin-core-server.discoveredplugin.requiredbundles.md) | readonly PluginName[] | List of plugin ids that this plugin's UI code imports modules from that are not in requiredPlugins. | -| [requiredPlugins](./kibana-plugin-core-server.discoveredplugin.requiredplugins.md) | readonly PluginName[] | An optional list of the other plugins that \*\*must be\*\* installed and enabled for this plugin to function properly. | -| [type](./kibana-plugin-core-server.discoveredplugin.type.md) | PluginType | Type of the plugin, defaults to standard. | +| [configPath](./kibana-plugin-core-server.discoveredplugin.configpath.md) | ConfigPath | Root configuration path used by the plugin, defaults to "id" in snake\_case format. | +| [id](./kibana-plugin-core-server.discoveredplugin.id.md) | PluginName | Identifier of the plugin. | +| [optionalPlugins](./kibana-plugin-core-server.discoveredplugin.optionalplugins.md) | readonly PluginName\[\] | An optional list of the other plugins that if installed and enabled \*\*may be\*\* leveraged by this plugin for some additional functionality but otherwise are not required for this plugin to work properly. | +| [requiredBundles](./kibana-plugin-core-server.discoveredplugin.requiredbundles.md) | readonly PluginName\[\] | List of plugin ids that this plugin's UI code imports modules from that are not in requiredPlugins. | +| [requiredPlugins](./kibana-plugin-core-server.discoveredplugin.requiredplugins.md) | readonly PluginName\[\] | An optional list of the other plugins that \*\*must be\*\* installed and enabled for this plugin to function properly. | +| [type](./kibana-plugin-core-server.discoveredplugin.type.md) | PluginType | Type of the plugin, defaults to standard. | diff --git a/docs/development/core/server/kibana-plugin-core-server.elasticsearchconfig._constructor_.md b/docs/development/core/server/kibana-plugin-core-server.elasticsearchconfig._constructor_.md index 6661970725f758..a8d9f1183b3e56 100644 --- a/docs/development/core/server/kibana-plugin-core-server.elasticsearchconfig._constructor_.md +++ b/docs/development/core/server/kibana-plugin-core-server.elasticsearchconfig._constructor_.md @@ -16,5 +16,5 @@ constructor(rawConfig: ElasticsearchConfigType); | Parameter | Type | Description | | --- | --- | --- | -| rawConfig | ElasticsearchConfigType | | +| rawConfig | ElasticsearchConfigType | | diff --git a/docs/development/core/server/kibana-plugin-core-server.elasticsearchconfig.md b/docs/development/core/server/kibana-plugin-core-server.elasticsearchconfig.md index a9ed614ba7552b..c75f6377f40389 100644 --- a/docs/development/core/server/kibana-plugin-core-server.elasticsearchconfig.md +++ b/docs/development/core/server/kibana-plugin-core-server.elasticsearchconfig.md @@ -22,20 +22,20 @@ export declare class ElasticsearchConfig | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [apiVersion](./kibana-plugin-core-server.elasticsearchconfig.apiversion.md) | | string | Version of the Elasticsearch (6.7, 7.1 or master) client will be connecting to. | -| [customHeaders](./kibana-plugin-core-server.elasticsearchconfig.customheaders.md) | | ElasticsearchConfigType['customHeaders'] | Header names and values to send to Elasticsearch with every request. These headers cannot be overwritten by client-side headers and aren't affected by requestHeadersWhitelist configuration. | -| [healthCheckDelay](./kibana-plugin-core-server.elasticsearchconfig.healthcheckdelay.md) | | Duration | The interval between health check requests Kibana sends to the Elasticsearch. | -| [hosts](./kibana-plugin-core-server.elasticsearchconfig.hosts.md) | | string[] | Hosts that the client will connect to. If sniffing is enabled, this list will be used as seeds to discover the rest of your cluster. | -| [ignoreVersionMismatch](./kibana-plugin-core-server.elasticsearchconfig.ignoreversionmismatch.md) | | boolean | Whether to allow kibana to connect to a non-compatible elasticsearch node. | -| [password](./kibana-plugin-core-server.elasticsearchconfig.password.md) | | string | If Elasticsearch is protected with basic authentication, this setting provides the password that the Kibana server uses to perform its administrative functions. | -| [pingTimeout](./kibana-plugin-core-server.elasticsearchconfig.pingtimeout.md) | | Duration | Timeout after which PING HTTP request will be aborted and retried. | -| [requestHeadersWhitelist](./kibana-plugin-core-server.elasticsearchconfig.requestheaderswhitelist.md) | | string[] | List of Kibana client-side headers to send to Elasticsearch when request scoped cluster client is used. If this is an empty array then \*no\* client-side will be sent. | -| [requestTimeout](./kibana-plugin-core-server.elasticsearchconfig.requesttimeout.md) | | Duration | Timeout after which HTTP request will be aborted and retried. | -| [serviceAccountToken](./kibana-plugin-core-server.elasticsearchconfig.serviceaccounttoken.md) | | string | If Elasticsearch security features are enabled, this setting provides the service account token that the Kibana server users to perform its administrative functions.This is an alternative to specifying a username and password. | -| [shardTimeout](./kibana-plugin-core-server.elasticsearchconfig.shardtimeout.md) | | Duration | Timeout for Elasticsearch to wait for responses from shards. Set to 0 to disable. | -| [sniffInterval](./kibana-plugin-core-server.elasticsearchconfig.sniffinterval.md) | | false | Duration | Interval to perform a sniff operation and make sure the list of nodes is complete. If false then sniffing is disabled. | -| [sniffOnConnectionFault](./kibana-plugin-core-server.elasticsearchconfig.sniffonconnectionfault.md) | | boolean | Specifies whether the client should immediately sniff for a more current list of nodes when a connection dies. | -| [sniffOnStart](./kibana-plugin-core-server.elasticsearchconfig.sniffonstart.md) | | boolean | Specifies whether the client should attempt to detect the rest of the cluster when it is first instantiated. | -| [ssl](./kibana-plugin-core-server.elasticsearchconfig.ssl.md) | | Pick<SslConfigSchema, Exclude<keyof SslConfigSchema, 'certificateAuthorities' | 'keystore' | 'truststore'>> & {
certificateAuthorities?: string[];
} | Set of settings configure SSL connection between Kibana and Elasticsearch that are required when xpack.ssl.verification_mode in Elasticsearch is set to either certificate or full. | -| [username](./kibana-plugin-core-server.elasticsearchconfig.username.md) | | string | If Elasticsearch is protected with basic authentication, this setting provides the username that the Kibana server uses to perform its administrative functions. Cannot be used in conjunction with serviceAccountToken. | +| [apiVersion](./kibana-plugin-core-server.elasticsearchconfig.apiversion.md) | | string | Version of the Elasticsearch (6.7, 7.1 or master) client will be connecting to. | +| [customHeaders](./kibana-plugin-core-server.elasticsearchconfig.customheaders.md) | | ElasticsearchConfigType\['customHeaders'\] | Header names and values to send to Elasticsearch with every request. These headers cannot be overwritten by client-side headers and aren't affected by requestHeadersWhitelist configuration. | +| [healthCheckDelay](./kibana-plugin-core-server.elasticsearchconfig.healthcheckdelay.md) | | Duration | The interval between health check requests Kibana sends to the Elasticsearch. | +| [hosts](./kibana-plugin-core-server.elasticsearchconfig.hosts.md) | | string\[\] | Hosts that the client will connect to. If sniffing is enabled, this list will be used as seeds to discover the rest of your cluster. | +| [ignoreVersionMismatch](./kibana-plugin-core-server.elasticsearchconfig.ignoreversionmismatch.md) | | boolean | Whether to allow kibana to connect to a non-compatible elasticsearch node. | +| [password?](./kibana-plugin-core-server.elasticsearchconfig.password.md) | | string | (Optional) If Elasticsearch is protected with basic authentication, this setting provides the password that the Kibana server uses to perform its administrative functions. | +| [pingTimeout](./kibana-plugin-core-server.elasticsearchconfig.pingtimeout.md) | | Duration | Timeout after which PING HTTP request will be aborted and retried. | +| [requestHeadersWhitelist](./kibana-plugin-core-server.elasticsearchconfig.requestheaderswhitelist.md) | | string\[\] | List of Kibana client-side headers to send to Elasticsearch when request scoped cluster client is used. If this is an empty array then \*no\* client-side will be sent. | +| [requestTimeout](./kibana-plugin-core-server.elasticsearchconfig.requesttimeout.md) | | Duration | Timeout after which HTTP request will be aborted and retried. | +| [serviceAccountToken?](./kibana-plugin-core-server.elasticsearchconfig.serviceaccounttoken.md) | | string | (Optional) If Elasticsearch security features are enabled, this setting provides the service account token that the Kibana server users to perform its administrative functions.This is an alternative to specifying a username and password. | +| [shardTimeout](./kibana-plugin-core-server.elasticsearchconfig.shardtimeout.md) | | Duration | Timeout for Elasticsearch to wait for responses from shards. Set to 0 to disable. | +| [sniffInterval](./kibana-plugin-core-server.elasticsearchconfig.sniffinterval.md) | | false \| Duration | Interval to perform a sniff operation and make sure the list of nodes is complete. If false then sniffing is disabled. | +| [sniffOnConnectionFault](./kibana-plugin-core-server.elasticsearchconfig.sniffonconnectionfault.md) | | boolean | Specifies whether the client should immediately sniff for a more current list of nodes when a connection dies. | +| [sniffOnStart](./kibana-plugin-core-server.elasticsearchconfig.sniffonstart.md) | | boolean | Specifies whether the client should attempt to detect the rest of the cluster when it is first instantiated. | +| [ssl](./kibana-plugin-core-server.elasticsearchconfig.ssl.md) | | Pick<SslConfigSchema, Exclude<keyof SslConfigSchema, 'certificateAuthorities' \| 'keystore' \| 'truststore'>> & { certificateAuthorities?: string\[\]; } | Set of settings configure SSL connection between Kibana and Elasticsearch that are required when xpack.ssl.verification_mode in Elasticsearch is set to either certificate or full. | +| [username?](./kibana-plugin-core-server.elasticsearchconfig.username.md) | | string | (Optional) If Elasticsearch is protected with basic authentication, this setting provides the username that the Kibana server uses to perform its administrative functions. Cannot be used in conjunction with serviceAccountToken. | diff --git a/docs/development/core/server/kibana-plugin-core-server.elasticsearchconfigpreboot.md b/docs/development/core/server/kibana-plugin-core-server.elasticsearchconfigpreboot.md index bbccea80b672fe..d7d3e8d70e8d79 100644 --- a/docs/development/core/server/kibana-plugin-core-server.elasticsearchconfigpreboot.md +++ b/docs/development/core/server/kibana-plugin-core-server.elasticsearchconfigpreboot.md @@ -16,6 +16,6 @@ export interface ElasticsearchConfigPreboot | Property | Type | Description | | --- | --- | --- | -| [credentialsSpecified](./kibana-plugin-core-server.elasticsearchconfigpreboot.credentialsspecified.md) | boolean | Indicates whether Elasticsearch configuration includes credentials (username, password or serviceAccountToken). | -| [hosts](./kibana-plugin-core-server.elasticsearchconfigpreboot.hosts.md) | string[] | Hosts that the client will connect to. If sniffing is enabled, this list will be used as seeds to discover the rest of your cluster. | +| [credentialsSpecified](./kibana-plugin-core-server.elasticsearchconfigpreboot.credentialsspecified.md) | boolean | Indicates whether Elasticsearch configuration includes credentials (username, password or serviceAccountToken). | +| [hosts](./kibana-plugin-core-server.elasticsearchconfigpreboot.hosts.md) | string\[\] | Hosts that the client will connect to. If sniffing is enabled, this list will be used as seeds to discover the rest of your cluster. | diff --git a/docs/development/core/server/kibana-plugin-core-server.elasticsearcherrordetails.md b/docs/development/core/server/kibana-plugin-core-server.elasticsearcherrordetails.md index 7dbf9e89f9b7c4..570a161db20e07 100644 --- a/docs/development/core/server/kibana-plugin-core-server.elasticsearcherrordetails.md +++ b/docs/development/core/server/kibana-plugin-core-server.elasticsearcherrordetails.md @@ -15,5 +15,5 @@ export interface ElasticsearchErrorDetails | Property | Type | Description | | --- | --- | --- | -| [error](./kibana-plugin-core-server.elasticsearcherrordetails.error.md) | {
type: string;
reason?: string;
} | | +| [error?](./kibana-plugin-core-server.elasticsearcherrordetails.error.md) | { type: string; reason?: string; } | (Optional) | diff --git a/docs/development/core/server/kibana-plugin-core-server.elasticsearchservicepreboot.config.md b/docs/development/core/server/kibana-plugin-core-server.elasticsearchservicepreboot.config.md index 12a32b4544abaf..c4284248ea8943 100644 --- a/docs/development/core/server/kibana-plugin-core-server.elasticsearchservicepreboot.config.md +++ b/docs/development/core/server/kibana-plugin-core-server.elasticsearchservicepreboot.config.md @@ -17,6 +17,5 @@ readonly config: Readonly; ```js const { hosts, credentialsSpecified } = core.elasticsearch.config; - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.elasticsearchservicepreboot.createclient.md b/docs/development/core/server/kibana-plugin-core-server.elasticsearchservicepreboot.createclient.md index d14e3e4efa400a..070cb7905b5859 100644 --- a/docs/development/core/server/kibana-plugin-core-server.elasticsearchservicepreboot.createclient.md +++ b/docs/development/core/server/kibana-plugin-core-server.elasticsearchservicepreboot.createclient.md @@ -18,6 +18,5 @@ readonly createClient: (type: string, clientConfig?: PartialReadonly<ElasticsearchConfigPreboot> | A limited set of Elasticsearch configuration entries. | -| [createClient](./kibana-plugin-core-server.elasticsearchservicepreboot.createclient.md) | (type: string, clientConfig?: Partial<ElasticsearchClientConfig>) => ICustomClusterClient | Create application specific Elasticsearch cluster API client with customized config. See [IClusterClient](./kibana-plugin-core-server.iclusterclient.md). | +| [config](./kibana-plugin-core-server.elasticsearchservicepreboot.config.md) | Readonly<ElasticsearchConfigPreboot> | A limited set of Elasticsearch configuration entries. | +| [createClient](./kibana-plugin-core-server.elasticsearchservicepreboot.createclient.md) | (type: string, clientConfig?: Partial<ElasticsearchClientConfig>) => ICustomClusterClient | Create application specific Elasticsearch cluster API client with customized config. See [IClusterClient](./kibana-plugin-core-server.iclusterclient.md). | diff --git a/docs/development/core/server/kibana-plugin-core-server.elasticsearchservicesetup.md b/docs/development/core/server/kibana-plugin-core-server.elasticsearchservicesetup.md index e6a4161674f5bc..d18620992075d7 100644 --- a/docs/development/core/server/kibana-plugin-core-server.elasticsearchservicesetup.md +++ b/docs/development/core/server/kibana-plugin-core-server.elasticsearchservicesetup.md @@ -15,5 +15,5 @@ export interface ElasticsearchServiceSetup | Property | Type | Description | | --- | --- | --- | -| [legacy](./kibana-plugin-core-server.elasticsearchservicesetup.legacy.md) | {
readonly config$: Observable<ElasticsearchConfig>;
} | | +| [legacy](./kibana-plugin-core-server.elasticsearchservicesetup.legacy.md) | { readonly config$: Observable<ElasticsearchConfig>; } | | diff --git a/docs/development/core/server/kibana-plugin-core-server.elasticsearchservicestart.client.md b/docs/development/core/server/kibana-plugin-core-server.elasticsearchservicestart.client.md index 591f126c423e3c..59f302170c53ab 100644 --- a/docs/development/core/server/kibana-plugin-core-server.elasticsearchservicestart.client.md +++ b/docs/development/core/server/kibana-plugin-core-server.elasticsearchservicestart.client.md @@ -17,6 +17,5 @@ readonly client: IClusterClient; ```js const client = core.elasticsearch.client; - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.elasticsearchservicestart.createclient.md b/docs/development/core/server/kibana-plugin-core-server.elasticsearchservicestart.createclient.md index d4a13812ab5338..26930c6f02b325 100644 --- a/docs/development/core/server/kibana-plugin-core-server.elasticsearchservicestart.createclient.md +++ b/docs/development/core/server/kibana-plugin-core-server.elasticsearchservicestart.createclient.md @@ -18,6 +18,5 @@ readonly createClient: (type: string, clientConfig?: PartialIClusterClient | A pre-configured [Elasticsearch client](./kibana-plugin-core-server.iclusterclient.md) | -| [createClient](./kibana-plugin-core-server.elasticsearchservicestart.createclient.md) | (type: string, clientConfig?: Partial<ElasticsearchClientConfig>) => ICustomClusterClient | Create application specific Elasticsearch cluster API client with customized config. See [IClusterClient](./kibana-plugin-core-server.iclusterclient.md). | -| [legacy](./kibana-plugin-core-server.elasticsearchservicestart.legacy.md) | {
readonly config$: Observable<ElasticsearchConfig>;
} | | +| [client](./kibana-plugin-core-server.elasticsearchservicestart.client.md) | IClusterClient | A pre-configured [Elasticsearch client](./kibana-plugin-core-server.iclusterclient.md) | +| [createClient](./kibana-plugin-core-server.elasticsearchservicestart.createclient.md) | (type: string, clientConfig?: Partial<ElasticsearchClientConfig>) => ICustomClusterClient | Create application specific Elasticsearch cluster API client with customized config. See [IClusterClient](./kibana-plugin-core-server.iclusterclient.md). | +| [legacy](./kibana-plugin-core-server.elasticsearchservicestart.legacy.md) | { readonly config$: Observable<ElasticsearchConfig>; } | | diff --git a/docs/development/core/server/kibana-plugin-core-server.elasticsearchstatusmeta.md b/docs/development/core/server/kibana-plugin-core-server.elasticsearchstatusmeta.md index 90aa2f0100d883..82748932c2102b 100644 --- a/docs/development/core/server/kibana-plugin-core-server.elasticsearchstatusmeta.md +++ b/docs/development/core/server/kibana-plugin-core-server.elasticsearchstatusmeta.md @@ -15,7 +15,7 @@ export interface ElasticsearchStatusMeta | Property | Type | Description | | --- | --- | --- | -| [incompatibleNodes](./kibana-plugin-core-server.elasticsearchstatusmeta.incompatiblenodes.md) | NodesVersionCompatibility['incompatibleNodes'] | | -| [nodesInfoRequestError](./kibana-plugin-core-server.elasticsearchstatusmeta.nodesinforequesterror.md) | NodesVersionCompatibility['nodesInfoRequestError'] | | -| [warningNodes](./kibana-plugin-core-server.elasticsearchstatusmeta.warningnodes.md) | NodesVersionCompatibility['warningNodes'] | | +| [incompatibleNodes](./kibana-plugin-core-server.elasticsearchstatusmeta.incompatiblenodes.md) | NodesVersionCompatibility\['incompatibleNodes'\] | | +| [nodesInfoRequestError?](./kibana-plugin-core-server.elasticsearchstatusmeta.nodesinforequesterror.md) | NodesVersionCompatibility\['nodesInfoRequestError'\] | (Optional) | +| [warningNodes](./kibana-plugin-core-server.elasticsearchstatusmeta.warningnodes.md) | NodesVersionCompatibility\['warningNodes'\] | | diff --git a/docs/development/core/server/kibana-plugin-core-server.errorhttpresponseoptions.md b/docs/development/core/server/kibana-plugin-core-server.errorhttpresponseoptions.md index 8a3a9e3cc29f45..3a037e71ac1e22 100644 --- a/docs/development/core/server/kibana-plugin-core-server.errorhttpresponseoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.errorhttpresponseoptions.md @@ -16,6 +16,6 @@ export interface ErrorHttpResponseOptions | Property | Type | Description | | --- | --- | --- | -| [body](./kibana-plugin-core-server.errorhttpresponseoptions.body.md) | ResponseError | HTTP message to send to the client | -| [headers](./kibana-plugin-core-server.errorhttpresponseoptions.headers.md) | ResponseHeaders | HTTP Headers with additional information about response | +| [body?](./kibana-plugin-core-server.errorhttpresponseoptions.body.md) | ResponseError | (Optional) HTTP message to send to the client | +| [headers?](./kibana-plugin-core-server.errorhttpresponseoptions.headers.md) | ResponseHeaders | (Optional) HTTP Headers with additional information about response | diff --git a/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.collect.md b/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.collect.md index 0e07497baf8875..36cb2d2d209442 100644 --- a/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.collect.md +++ b/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.collect.md @@ -13,7 +13,7 @@ collect(): IntervalHistogram; ``` Returns: -`IntervalHistogram` +IntervalHistogram {IntervalHistogram} diff --git a/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.reset.md b/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.reset.md index fdba7a79ebda0d..a65cc7c99842df 100644 --- a/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.reset.md +++ b/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.reset.md @@ -13,5 +13,5 @@ reset(): void; ``` Returns: -`void` +void diff --git a/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.stop.md b/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.stop.md index 25b61434b00612..d63c963b384e6b 100644 --- a/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.stop.md +++ b/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.stop.md @@ -13,5 +13,5 @@ stop(): void; ``` Returns: -`void` +void diff --git a/docs/development/core/server/kibana-plugin-core-server.executioncontextsetup.withcontext.md b/docs/development/core/server/kibana-plugin-core-server.executioncontextsetup.withcontext.md index 87da0712030185..2bfef6db2f9073 100644 --- a/docs/development/core/server/kibana-plugin-core-server.executioncontextsetup.withcontext.md +++ b/docs/development/core/server/kibana-plugin-core-server.executioncontextsetup.withcontext.md @@ -16,10 +16,10 @@ withContext(context: KibanaExecutionContext | undefined, fn: (...args: any[]) | Parameter | Type | Description | | --- | --- | --- | -| context | KibanaExecutionContext | undefined | | -| fn | (...args: any[]) => R | | +| context | KibanaExecutionContext \| undefined | | +| fn | (...args: any\[\]) => R | | Returns: -`R` +R diff --git a/docs/development/core/server/kibana-plugin-core-server.fakerequest.md b/docs/development/core/server/kibana-plugin-core-server.fakerequest.md index 93ab54f9ba7532..6b8bfe33d19c40 100644 --- a/docs/development/core/server/kibana-plugin-core-server.fakerequest.md +++ b/docs/development/core/server/kibana-plugin-core-server.fakerequest.md @@ -16,5 +16,5 @@ export interface FakeRequest | Property | Type | Description | | --- | --- | --- | -| [headers](./kibana-plugin-core-server.fakerequest.headers.md) | Headers | Headers used for authentication against Elasticsearch | +| [headers](./kibana-plugin-core-server.fakerequest.headers.md) | Headers | Headers used for authentication against Elasticsearch | diff --git a/docs/development/core/server/kibana-plugin-core-server.featuredeprecationdetails.md b/docs/development/core/server/kibana-plugin-core-server.featuredeprecationdetails.md index bed3356e361295..c92f352ce7e5e2 100644 --- a/docs/development/core/server/kibana-plugin-core-server.featuredeprecationdetails.md +++ b/docs/development/core/server/kibana-plugin-core-server.featuredeprecationdetails.md @@ -10,10 +10,11 @@ ```typescript export interface FeatureDeprecationDetails extends BaseDeprecationDetails ``` +Extends: BaseDeprecationDetails ## Properties | Property | Type | Description | | --- | --- | --- | -| [deprecationType](./kibana-plugin-core-server.featuredeprecationdetails.deprecationtype.md) | 'feature' | undefined | | +| [deprecationType?](./kibana-plugin-core-server.featuredeprecationdetails.deprecationtype.md) | 'feature' \| undefined | (Optional) | diff --git a/docs/development/core/server/kibana-plugin-core-server.getdeprecationscontext.md b/docs/development/core/server/kibana-plugin-core-server.getdeprecationscontext.md index 96dd2ceb524cee..2362966866852f 100644 --- a/docs/development/core/server/kibana-plugin-core-server.getdeprecationscontext.md +++ b/docs/development/core/server/kibana-plugin-core-server.getdeprecationscontext.md @@ -15,6 +15,6 @@ export interface GetDeprecationsContext | Property | Type | Description | | --- | --- | --- | -| [esClient](./kibana-plugin-core-server.getdeprecationscontext.esclient.md) | IScopedClusterClient | | -| [savedObjectsClient](./kibana-plugin-core-server.getdeprecationscontext.savedobjectsclient.md) | SavedObjectsClientContract | | +| [esClient](./kibana-plugin-core-server.getdeprecationscontext.esclient.md) | IScopedClusterClient | | +| [savedObjectsClient](./kibana-plugin-core-server.getdeprecationscontext.savedobjectsclient.md) | SavedObjectsClientContract | | diff --git a/docs/development/core/server/kibana-plugin-core-server.getresponse.md b/docs/development/core/server/kibana-plugin-core-server.getresponse.md index bab3092c6b1fa5..5068be8a5689a4 100644 --- a/docs/development/core/server/kibana-plugin-core-server.getresponse.md +++ b/docs/development/core/server/kibana-plugin-core-server.getresponse.md @@ -15,13 +15,13 @@ export interface GetResponse | Property | Type | Description | | --- | --- | --- | -| [\_id](./kibana-plugin-core-server.getresponse._id.md) | string | | -| [\_index](./kibana-plugin-core-server.getresponse._index.md) | string | | -| [\_primary\_term](./kibana-plugin-core-server.getresponse._primary_term.md) | number | | -| [\_routing](./kibana-plugin-core-server.getresponse._routing.md) | string | | -| [\_seq\_no](./kibana-plugin-core-server.getresponse._seq_no.md) | number | | -| [\_source](./kibana-plugin-core-server.getresponse._source.md) | T | | -| [\_type](./kibana-plugin-core-server.getresponse._type.md) | string | | -| [\_version](./kibana-plugin-core-server.getresponse._version.md) | number | | -| [found](./kibana-plugin-core-server.getresponse.found.md) | boolean | | +| [\_id](./kibana-plugin-core-server.getresponse._id.md) | string | | +| [\_index](./kibana-plugin-core-server.getresponse._index.md) | string | | +| [\_primary\_term](./kibana-plugin-core-server.getresponse._primary_term.md) | number | | +| [\_routing?](./kibana-plugin-core-server.getresponse._routing.md) | string | (Optional) | +| [\_seq\_no](./kibana-plugin-core-server.getresponse._seq_no.md) | number | | +| [\_source](./kibana-plugin-core-server.getresponse._source.md) | T | | +| [\_type](./kibana-plugin-core-server.getresponse._type.md) | string | | +| [\_version](./kibana-plugin-core-server.getresponse._version.md) | number | | +| [found](./kibana-plugin-core-server.getresponse.found.md) | boolean | | diff --git a/docs/development/core/server/kibana-plugin-core-server.headers.md b/docs/development/core/server/kibana-plugin-core-server.headers_2.md similarity index 78% rename from docs/development/core/server/kibana-plugin-core-server.headers.md rename to docs/development/core/server/kibana-plugin-core-server.headers_2.md index 5b2c40a81878e1..398827f2bf3d1b 100644 --- a/docs/development/core/server/kibana-plugin-core-server.headers.md +++ b/docs/development/core/server/kibana-plugin-core-server.headers_2.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [Headers](./kibana-plugin-core-server.headers.md) +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [Headers\_2](./kibana-plugin-core-server.headers_2.md) -## Headers type +## Headers\_2 type Http request headers to read. diff --git a/docs/development/core/server/kibana-plugin-core-server.httpauth.md b/docs/development/core/server/kibana-plugin-core-server.httpauth.md index d9d77809570abd..4b47be615c79cc 100644 --- a/docs/development/core/server/kibana-plugin-core-server.httpauth.md +++ b/docs/development/core/server/kibana-plugin-core-server.httpauth.md @@ -15,6 +15,6 @@ export interface HttpAuth | Property | Type | Description | | --- | --- | --- | -| [get](./kibana-plugin-core-server.httpauth.get.md) | GetAuthState | Gets authentication state for a request. Returned by auth interceptor. [GetAuthState](./kibana-plugin-core-server.getauthstate.md) | -| [isAuthenticated](./kibana-plugin-core-server.httpauth.isauthenticated.md) | IsAuthenticated | Returns authentication status for a request. [IsAuthenticated](./kibana-plugin-core-server.isauthenticated.md) | +| [get](./kibana-plugin-core-server.httpauth.get.md) | GetAuthState | Gets authentication state for a request. Returned by auth interceptor. [GetAuthState](./kibana-plugin-core-server.getauthstate.md) | +| [isAuthenticated](./kibana-plugin-core-server.httpauth.isauthenticated.md) | IsAuthenticated | Returns authentication status for a request. [IsAuthenticated](./kibana-plugin-core-server.isauthenticated.md) | diff --git a/docs/development/core/server/kibana-plugin-core-server.httpresources.md b/docs/development/core/server/kibana-plugin-core-server.httpresources.md index 25acffc1a040fc..0b1854d7cbcd99 100644 --- a/docs/development/core/server/kibana-plugin-core-server.httpresources.md +++ b/docs/development/core/server/kibana-plugin-core-server.httpresources.md @@ -16,5 +16,5 @@ export interface HttpResources | Property | Type | Description | | --- | --- | --- | -| [register](./kibana-plugin-core-server.httpresources.register.md) | <P, Q, B, Context extends RequestHandlerContext = RequestHandlerContext>(route: RouteConfig<P, Q, B, 'get'>, handler: HttpResourcesRequestHandler<P, Q, B, Context>) => void | To register a route handler executing passed function to form response. | +| [register](./kibana-plugin-core-server.httpresources.register.md) | <P, Q, B, Context extends RequestHandlerContext = RequestHandlerContext>(route: RouteConfig<P, Q, B, 'get'>, handler: HttpResourcesRequestHandler<P, Q, B, Context>) => void | To register a route handler executing passed function to form response. | diff --git a/docs/development/core/server/kibana-plugin-core-server.httpresourcesrenderoptions.md b/docs/development/core/server/kibana-plugin-core-server.httpresourcesrenderoptions.md index 6563e3c636a99e..9fcdc1b3387839 100644 --- a/docs/development/core/server/kibana-plugin-core-server.httpresourcesrenderoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.httpresourcesrenderoptions.md @@ -16,5 +16,5 @@ export interface HttpResourcesRenderOptions | Property | Type | Description | | --- | --- | --- | -| [headers](./kibana-plugin-core-server.httpresourcesrenderoptions.headers.md) | ResponseHeaders | HTTP Headers with additional information about response. | +| [headers?](./kibana-plugin-core-server.httpresourcesrenderoptions.headers.md) | ResponseHeaders | (Optional) HTTP Headers with additional information about response. | diff --git a/docs/development/core/server/kibana-plugin-core-server.httpresourcesservicetoolkit.md b/docs/development/core/server/kibana-plugin-core-server.httpresourcesservicetoolkit.md index 1c221e13f534fd..05e7af5dcbedf0 100644 --- a/docs/development/core/server/kibana-plugin-core-server.httpresourcesservicetoolkit.md +++ b/docs/development/core/server/kibana-plugin-core-server.httpresourcesservicetoolkit.md @@ -16,8 +16,8 @@ export interface HttpResourcesServiceToolkit | Property | Type | Description | | --- | --- | --- | -| [renderAnonymousCoreApp](./kibana-plugin-core-server.httpresourcesservicetoolkit.renderanonymouscoreapp.md) | (options?: HttpResourcesRenderOptions) => Promise<IKibanaResponse> | To respond with HTML page bootstrapping Kibana application without retrieving user-specific information. | -| [renderCoreApp](./kibana-plugin-core-server.httpresourcesservicetoolkit.rendercoreapp.md) | (options?: HttpResourcesRenderOptions) => Promise<IKibanaResponse> | To respond with HTML page bootstrapping Kibana application. | -| [renderHtml](./kibana-plugin-core-server.httpresourcesservicetoolkit.renderhtml.md) | (options: HttpResourcesResponseOptions) => IKibanaResponse | To respond with a custom HTML page. | -| [renderJs](./kibana-plugin-core-server.httpresourcesservicetoolkit.renderjs.md) | (options: HttpResourcesResponseOptions) => IKibanaResponse | To respond with a custom JS script file. | +| [renderAnonymousCoreApp](./kibana-plugin-core-server.httpresourcesservicetoolkit.renderanonymouscoreapp.md) | (options?: HttpResourcesRenderOptions) => Promise<IKibanaResponse> | To respond with HTML page bootstrapping Kibana application without retrieving user-specific information. | +| [renderCoreApp](./kibana-plugin-core-server.httpresourcesservicetoolkit.rendercoreapp.md) | (options?: HttpResourcesRenderOptions) => Promise<IKibanaResponse> | To respond with HTML page bootstrapping Kibana application. | +| [renderHtml](./kibana-plugin-core-server.httpresourcesservicetoolkit.renderhtml.md) | (options: HttpResourcesResponseOptions) => IKibanaResponse | To respond with a custom HTML page. | +| [renderJs](./kibana-plugin-core-server.httpresourcesservicetoolkit.renderjs.md) | (options: HttpResourcesResponseOptions) => IKibanaResponse | To respond with a custom JS script file. | diff --git a/docs/development/core/server/kibana-plugin-core-server.httpresponseoptions.md b/docs/development/core/server/kibana-plugin-core-server.httpresponseoptions.md index 497adc6a5ec5d1..9d10d912441575 100644 --- a/docs/development/core/server/kibana-plugin-core-server.httpresponseoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.httpresponseoptions.md @@ -16,7 +16,7 @@ export interface HttpResponseOptions | Property | Type | Description | | --- | --- | --- | -| [body](./kibana-plugin-core-server.httpresponseoptions.body.md) | HttpResponsePayload | HTTP message to send to the client | -| [bypassErrorFormat](./kibana-plugin-core-server.httpresponseoptions.bypasserrorformat.md) | boolean | Bypass the default error formatting | -| [headers](./kibana-plugin-core-server.httpresponseoptions.headers.md) | ResponseHeaders | HTTP Headers with additional information about response | +| [body?](./kibana-plugin-core-server.httpresponseoptions.body.md) | HttpResponsePayload | (Optional) HTTP message to send to the client | +| [bypassErrorFormat?](./kibana-plugin-core-server.httpresponseoptions.bypasserrorformat.md) | boolean | (Optional) Bypass the default error formatting | +| [headers?](./kibana-plugin-core-server.httpresponseoptions.headers.md) | ResponseHeaders | (Optional) HTTP Headers with additional information about response | diff --git a/docs/development/core/server/kibana-plugin-core-server.httpserverinfo.md b/docs/development/core/server/kibana-plugin-core-server.httpserverinfo.md index 890bfaa834dc56..151cb5d272403f 100644 --- a/docs/development/core/server/kibana-plugin-core-server.httpserverinfo.md +++ b/docs/development/core/server/kibana-plugin-core-server.httpserverinfo.md @@ -16,8 +16,8 @@ export interface HttpServerInfo | Property | Type | Description | | --- | --- | --- | -| [hostname](./kibana-plugin-core-server.httpserverinfo.hostname.md) | string | The hostname of the server | -| [name](./kibana-plugin-core-server.httpserverinfo.name.md) | string | The name of the Kibana server | -| [port](./kibana-plugin-core-server.httpserverinfo.port.md) | number | The port the server is listening on | -| [protocol](./kibana-plugin-core-server.httpserverinfo.protocol.md) | 'http' | 'https' | 'socket' | The protocol used by the server | +| [hostname](./kibana-plugin-core-server.httpserverinfo.hostname.md) | string | The hostname of the server | +| [name](./kibana-plugin-core-server.httpserverinfo.name.md) | string | The name of the Kibana server | +| [port](./kibana-plugin-core-server.httpserverinfo.port.md) | number | The port the server is listening on | +| [protocol](./kibana-plugin-core-server.httpserverinfo.protocol.md) | 'http' \| 'https' \| 'socket' | The protocol used by the server | diff --git a/docs/development/core/server/kibana-plugin-core-server.httpservicepreboot.md b/docs/development/core/server/kibana-plugin-core-server.httpservicepreboot.md index ab0fc365fc6519..87c62b63014e19 100644 --- a/docs/development/core/server/kibana-plugin-core-server.httpservicepreboot.md +++ b/docs/development/core/server/kibana-plugin-core-server.httpservicepreboot.md @@ -23,7 +23,6 @@ const validate = { id: schema.string(), }), }; - ``` - Declare a function to respond to incoming request. The function will receive `request` object containing request details: url, headers, matched route, as well as validated `params`, `query`, `body`. And `response` object instructing HTTP server to create HTTP response with information sent back to the client as the response body, headers, and HTTP status. Any exception raised during the handler call will generate `500 Server error` response and log error details for further investigation. See below for returning custom error responses. @@ -40,7 +39,6 @@ const handler = async (context: RequestHandlerContext, request: KibanaRequest, r headers: { 'content-type': 'application/json' } }); } - ``` \* - Acquire `preboot` [IRouter](./kibana-plugin-core-server.irouter.md) instance and register route handler for GET request to 'path/{id}' path. @@ -65,15 +63,14 @@ httpPreboot.registerRoutes('my-plugin', (router) => { }); }); }); - ``` ## Properties | Property | Type | Description | | --- | --- | --- | -| [basePath](./kibana-plugin-core-server.httpservicepreboot.basepath.md) | IBasePath | Access or manipulate the Kibana base path See [IBasePath](./kibana-plugin-core-server.ibasepath.md). | -| [getServerInfo](./kibana-plugin-core-server.httpservicepreboot.getserverinfo.md) | () => HttpServerInfo | Provides common [information](./kibana-plugin-core-server.httpserverinfo.md) about the running preboot http server. | +| [basePath](./kibana-plugin-core-server.httpservicepreboot.basepath.md) | IBasePath | Access or manipulate the Kibana base path See [IBasePath](./kibana-plugin-core-server.ibasepath.md). | +| [getServerInfo](./kibana-plugin-core-server.httpservicepreboot.getserverinfo.md) | () => HttpServerInfo | Provides common [information](./kibana-plugin-core-server.httpserverinfo.md) about the running preboot http server. | ## Methods diff --git a/docs/development/core/server/kibana-plugin-core-server.httpservicepreboot.registerroutes.md b/docs/development/core/server/kibana-plugin-core-server.httpservicepreboot.registerroutes.md index c188f0ba0ce944..dd90074fad39a1 100644 --- a/docs/development/core/server/kibana-plugin-core-server.httpservicepreboot.registerroutes.md +++ b/docs/development/core/server/kibana-plugin-core-server.httpservicepreboot.registerroutes.md @@ -16,12 +16,12 @@ registerRoutes(path: string, callback: (router: IRouter) => void): void; | Parameter | Type | Description | | --- | --- | --- | -| path | string | | -| callback | (router: IRouter) => void | | +| path | string | | +| callback | (router: IRouter) => void | | Returns: -`void` +void ## Remarks @@ -35,6 +35,5 @@ registerRoutes('my-plugin', (router) => { // handler is called when '/my-plugin/path' resource is requested with `GET` method router.get({ path: '/path', validate: false }, (context, req, res) => res.ok({ content: 'ok' })); }); - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.createrouter.md b/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.createrouter.md index f009dd3fc2b16e..7bdc7cd2e4e331 100644 --- a/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.createrouter.md +++ b/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.createrouter.md @@ -23,6 +23,5 @@ Each route can have only one handler function, which is executed when the route const router = createRouter(); // handler is called when '/path' resource is requested with `GET` method router.get({ path: '/path', validate: false }, (context, req, res) => res.ok({ content: 'ok' })); - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.md b/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.md index dbc2a516fa17ba..81ddeaaaa5a128 100644 --- a/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.md +++ b/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.md @@ -18,7 +18,6 @@ To handle an incoming request in your plugin you should: - Create a `Router` ins ```ts const router = httpSetup.createRouter(); - ``` - Use `@kbn/config-schema` package to create a schema to validate the request `params`, `query`, and `body`. Every incoming request will be validated against the created schema. If validation failed, the request is rejected with `400` status and `Bad request` error without calling the route's handler. To opt out of validating the request, specify `false`. @@ -29,7 +28,6 @@ const validate = { id: schema.string(), }), }; - ``` - Declare a function to respond to incoming request. The function will receive `request` object containing request details: url, headers, matched route, as well as validated `params`, `query`, `body`. And `response` object instructing HTTP server to create HTTP response with information sent back to the client as the response body, headers, and HTTP status. Unlike, `hapi` route handler in the Legacy platform, any exception raised during the handler call will generate `500 Server error` response and log error details for further investigation. See below for returning custom error responses. @@ -46,7 +44,6 @@ const handler = async (context: RequestHandlerContext, request: KibanaRequest, r } }); } - ``` - Register route handler for GET request to 'path/{id}' path @@ -74,23 +71,22 @@ async (context, request, response) => { } }); }); - ``` ## Properties | Property | Type | Description | | --- | --- | --- | -| [auth](./kibana-plugin-core-server.httpservicesetup.auth.md) | HttpAuth | Auth status. See [HttpAuth](./kibana-plugin-core-server.httpauth.md) | -| [basePath](./kibana-plugin-core-server.httpservicesetup.basepath.md) | IBasePath | Access or manipulate the Kibana base path See [IBasePath](./kibana-plugin-core-server.ibasepath.md). | -| [createCookieSessionStorageFactory](./kibana-plugin-core-server.httpservicesetup.createcookiesessionstoragefactory.md) | <T>(cookieOptions: SessionStorageCookieOptions<T>) => Promise<SessionStorageFactory<T>> | Creates cookie based session storage factory [SessionStorageFactory](./kibana-plugin-core-server.sessionstoragefactory.md) | -| [createRouter](./kibana-plugin-core-server.httpservicesetup.createrouter.md) | <Context extends RequestHandlerContext = RequestHandlerContext>() => IRouter<Context> | Provides ability to declare a handler function for a particular path and HTTP request method. | -| [csp](./kibana-plugin-core-server.httpservicesetup.csp.md) | ICspConfig | The CSP config used for Kibana. | -| [getServerInfo](./kibana-plugin-core-server.httpservicesetup.getserverinfo.md) | () => HttpServerInfo | Provides common [information](./kibana-plugin-core-server.httpserverinfo.md) about the running http server. | -| [registerAuth](./kibana-plugin-core-server.httpservicesetup.registerauth.md) | (handler: AuthenticationHandler) => void | To define custom authentication and/or authorization mechanism for incoming requests. | -| [registerOnPostAuth](./kibana-plugin-core-server.httpservicesetup.registeronpostauth.md) | (handler: OnPostAuthHandler) => void | To define custom logic after Auth interceptor did make sure a user has access to the requested resource. | -| [registerOnPreAuth](./kibana-plugin-core-server.httpservicesetup.registeronpreauth.md) | (handler: OnPreAuthHandler) => void | To define custom logic to perform for incoming requests before the Auth interceptor performs a check that user has access to requested resources. | -| [registerOnPreResponse](./kibana-plugin-core-server.httpservicesetup.registeronpreresponse.md) | (handler: OnPreResponseHandler) => void | To define custom logic to perform for the server response. | -| [registerOnPreRouting](./kibana-plugin-core-server.httpservicesetup.registeronprerouting.md) | (handler: OnPreRoutingHandler) => void | To define custom logic to perform for incoming requests before server performs a route lookup. | -| [registerRouteHandlerContext](./kibana-plugin-core-server.httpservicesetup.registerroutehandlercontext.md) | <Context extends RequestHandlerContext, ContextName extends keyof Context>(contextName: ContextName, provider: RequestHandlerContextProvider<Context, ContextName>) => RequestHandlerContextContainer | Register a context provider for a route handler. | +| [auth](./kibana-plugin-core-server.httpservicesetup.auth.md) | HttpAuth | Auth status. See [HttpAuth](./kibana-plugin-core-server.httpauth.md) | +| [basePath](./kibana-plugin-core-server.httpservicesetup.basepath.md) | IBasePath | Access or manipulate the Kibana base path See [IBasePath](./kibana-plugin-core-server.ibasepath.md). | +| [createCookieSessionStorageFactory](./kibana-plugin-core-server.httpservicesetup.createcookiesessionstoragefactory.md) | <T>(cookieOptions: SessionStorageCookieOptions<T>) => Promise<SessionStorageFactory<T>> | Creates cookie based session storage factory [SessionStorageFactory](./kibana-plugin-core-server.sessionstoragefactory.md) | +| [createRouter](./kibana-plugin-core-server.httpservicesetup.createrouter.md) | <Context extends RequestHandlerContext = RequestHandlerContext>() => IRouter<Context> | Provides ability to declare a handler function for a particular path and HTTP request method. | +| [csp](./kibana-plugin-core-server.httpservicesetup.csp.md) | ICspConfig | The CSP config used for Kibana. | +| [getServerInfo](./kibana-plugin-core-server.httpservicesetup.getserverinfo.md) | () => HttpServerInfo | Provides common [information](./kibana-plugin-core-server.httpserverinfo.md) about the running http server. | +| [registerAuth](./kibana-plugin-core-server.httpservicesetup.registerauth.md) | (handler: AuthenticationHandler) => void | To define custom authentication and/or authorization mechanism for incoming requests. | +| [registerOnPostAuth](./kibana-plugin-core-server.httpservicesetup.registeronpostauth.md) | (handler: OnPostAuthHandler) => void | To define custom logic after Auth interceptor did make sure a user has access to the requested resource. | +| [registerOnPreAuth](./kibana-plugin-core-server.httpservicesetup.registeronpreauth.md) | (handler: OnPreAuthHandler) => void | To define custom logic to perform for incoming requests before the Auth interceptor performs a check that user has access to requested resources. | +| [registerOnPreResponse](./kibana-plugin-core-server.httpservicesetup.registeronpreresponse.md) | (handler: OnPreResponseHandler) => void | To define custom logic to perform for the server response. | +| [registerOnPreRouting](./kibana-plugin-core-server.httpservicesetup.registeronprerouting.md) | (handler: OnPreRoutingHandler) => void | To define custom logic to perform for incoming requests before server performs a route lookup. | +| [registerRouteHandlerContext](./kibana-plugin-core-server.httpservicesetup.registerroutehandlercontext.md) | <Context extends RequestHandlerContext, ContextName extends keyof Context>(contextName: ContextName, provider: RequestHandlerContextProvider<Context, ContextName>) => RequestHandlerContextContainer | Register a context provider for a route handler. | diff --git a/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.registerroutehandlercontext.md b/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.registerroutehandlercontext.md index df3f80580f6dad..c793080305d0cd 100644 --- a/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.registerroutehandlercontext.md +++ b/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.registerroutehandlercontext.md @@ -37,6 +37,5 @@ registerRouteHandlerContext: HttpAuth | Auth status. See [HttpAuth](./kibana-plugin-core-server.httpauth.md) | -| [basePath](./kibana-plugin-core-server.httpservicestart.basepath.md) | IBasePath | Access or manipulate the Kibana base path See [IBasePath](./kibana-plugin-core-server.ibasepath.md). | -| [getServerInfo](./kibana-plugin-core-server.httpservicestart.getserverinfo.md) | () => HttpServerInfo | Provides common [information](./kibana-plugin-core-server.httpserverinfo.md) about the running http server. | +| [auth](./kibana-plugin-core-server.httpservicestart.auth.md) | HttpAuth | Auth status. See [HttpAuth](./kibana-plugin-core-server.httpauth.md) | +| [basePath](./kibana-plugin-core-server.httpservicestart.basepath.md) | IBasePath | Access or manipulate the Kibana base path See [IBasePath](./kibana-plugin-core-server.ibasepath.md). | +| [getServerInfo](./kibana-plugin-core-server.httpservicestart.getserverinfo.md) | () => HttpServerInfo | Provides common [information](./kibana-plugin-core-server.httpserverinfo.md) about the running http server. | diff --git a/docs/development/core/server/kibana-plugin-core-server.i18nservicesetup.getlocale.md b/docs/development/core/server/kibana-plugin-core-server.i18nservicesetup.getlocale.md index 2fe8e564e7ce52..fa98f34c6ac5e6 100644 --- a/docs/development/core/server/kibana-plugin-core-server.i18nservicesetup.getlocale.md +++ b/docs/development/core/server/kibana-plugin-core-server.i18nservicesetup.getlocale.md @@ -13,5 +13,5 @@ getLocale(): string; ``` Returns: -`string` +string diff --git a/docs/development/core/server/kibana-plugin-core-server.i18nservicesetup.gettranslationfiles.md b/docs/development/core/server/kibana-plugin-core-server.i18nservicesetup.gettranslationfiles.md index 81caed287454ee..ebdb0babc3af7b 100644 --- a/docs/development/core/server/kibana-plugin-core-server.i18nservicesetup.gettranslationfiles.md +++ b/docs/development/core/server/kibana-plugin-core-server.i18nservicesetup.gettranslationfiles.md @@ -13,5 +13,5 @@ getTranslationFiles(): string[]; ``` Returns: -`string[]` +string\[\] diff --git a/docs/development/core/server/kibana-plugin-core-server.iclusterclient.md b/docs/development/core/server/kibana-plugin-core-server.iclusterclient.md index f6bacee322538d..969a32d96a3a01 100644 --- a/docs/development/core/server/kibana-plugin-core-server.iclusterclient.md +++ b/docs/development/core/server/kibana-plugin-core-server.iclusterclient.md @@ -16,6 +16,6 @@ export interface IClusterClient | Property | Type | Description | | --- | --- | --- | -| [asInternalUser](./kibana-plugin-core-server.iclusterclient.asinternaluser.md) | ElasticsearchClient | A [client](./kibana-plugin-core-server.elasticsearchclient.md) to be used to query the ES cluster on behalf of the Kibana internal user | -| [asScoped](./kibana-plugin-core-server.iclusterclient.asscoped.md) | (request: ScopeableRequest) => IScopedClusterClient | Creates a [scoped cluster client](./kibana-plugin-core-server.iscopedclusterclient.md) bound to given [request](./kibana-plugin-core-server.scopeablerequest.md) | +| [asInternalUser](./kibana-plugin-core-server.iclusterclient.asinternaluser.md) | ElasticsearchClient | A [client](./kibana-plugin-core-server.elasticsearchclient.md) to be used to query the ES cluster on behalf of the Kibana internal user | +| [asScoped](./kibana-plugin-core-server.iclusterclient.asscoped.md) | (request: ScopeableRequest) => IScopedClusterClient | Creates a [scoped cluster client](./kibana-plugin-core-server.iscopedclusterclient.md) bound to given [request](./kibana-plugin-core-server.scopeablerequest.md) | diff --git a/docs/development/core/server/kibana-plugin-core-server.icontextcontainer.createhandler.md b/docs/development/core/server/kibana-plugin-core-server.icontextcontainer.createhandler.md index 7d7368426b1c2d..ac13b86295f6d4 100644 --- a/docs/development/core/server/kibana-plugin-core-server.icontextcontainer.createhandler.md +++ b/docs/development/core/server/kibana-plugin-core-server.icontextcontainer.createhandler.md @@ -16,12 +16,12 @@ createHandler(pluginOpaqueId: PluginOpaqueId, handler: RequestHandler): (...rest | Parameter | Type | Description | | --- | --- | --- | -| pluginOpaqueId | PluginOpaqueId | The plugin opaque ID for the plugin that registers this handler. | -| handler | RequestHandler | Handler function to pass context object to. | +| pluginOpaqueId | PluginOpaqueId | The plugin opaque ID for the plugin that registers this handler. | +| handler | RequestHandler | Handler function to pass context object to. | Returns: -`(...rest: HandlerParameters) => ShallowPromise>` +(...rest: HandlerParameters<RequestHandler>) => ShallowPromise<ReturnType<RequestHandler>> A function that takes `RequestHandler` parameters, calls `handler` with a new context, and returns a Promise of the `handler` return value. diff --git a/docs/development/core/server/kibana-plugin-core-server.icontextcontainer.md b/docs/development/core/server/kibana-plugin-core-server.icontextcontainer.md index 8b4d3f39e345e0..99cddecb38d436 100644 --- a/docs/development/core/server/kibana-plugin-core-server.icontextcontainer.md +++ b/docs/development/core/server/kibana-plugin-core-server.icontextcontainer.md @@ -68,7 +68,6 @@ class MyPlugin { } } } - ``` ## Methods diff --git a/docs/development/core/server/kibana-plugin-core-server.icontextcontainer.registercontext.md b/docs/development/core/server/kibana-plugin-core-server.icontextcontainer.registercontext.md index 7f531fa8ba0d2d..32b177df2b2ed8 100644 --- a/docs/development/core/server/kibana-plugin-core-server.icontextcontainer.registercontext.md +++ b/docs/development/core/server/kibana-plugin-core-server.icontextcontainer.registercontext.md @@ -16,13 +16,13 @@ registerContextPluginOpaqueId | The plugin opaque ID for the plugin that registers this context. | -| contextName | ContextName | The key of the TContext object this provider supplies the value for. | -| provider | IContextProvider<Context, ContextName> | A [IContextProvider](./kibana-plugin-core-server.icontextprovider.md) to be called each time a new context is created. | +| pluginOpaqueId | PluginOpaqueId | The plugin opaque ID for the plugin that registers this context. | +| contextName | ContextName | The key of the TContext object this provider supplies the value for. | +| provider | IContextProvider<Context, ContextName> | A [IContextProvider](./kibana-plugin-core-server.icontextprovider.md) to be called each time a new context is created. | Returns: -`this` +this The [IContextContainer](./kibana-plugin-core-server.icontextcontainer.md) for method chaining. diff --git a/docs/development/core/server/kibana-plugin-core-server.icspconfig.md b/docs/development/core/server/kibana-plugin-core-server.icspconfig.md index 9da31cdc11e364..d5667900a41e26 100644 --- a/docs/development/core/server/kibana-plugin-core-server.icspconfig.md +++ b/docs/development/core/server/kibana-plugin-core-server.icspconfig.md @@ -16,8 +16,8 @@ export interface ICspConfig | Property | Type | Description | | --- | --- | --- | -| [disableEmbedding](./kibana-plugin-core-server.icspconfig.disableembedding.md) | boolean | Whether or not embedding (using iframes) should be allowed by the CSP. If embedding is disabled, a restrictive 'frame-ancestors' rule will be added to the default CSP rules. | -| [header](./kibana-plugin-core-server.icspconfig.header.md) | string | The CSP rules in a formatted directives string for use in a Content-Security-Policy header. | -| [strict](./kibana-plugin-core-server.icspconfig.strict.md) | boolean | Specify whether browsers that do not support CSP should be able to use Kibana. Use true to block and false to allow. | -| [warnLegacyBrowsers](./kibana-plugin-core-server.icspconfig.warnlegacybrowsers.md) | boolean | Specify whether users with legacy browsers should be warned about their lack of Kibana security compliance. | +| [disableEmbedding](./kibana-plugin-core-server.icspconfig.disableembedding.md) | boolean | Whether or not embedding (using iframes) should be allowed by the CSP. If embedding is disabled, a restrictive 'frame-ancestors' rule will be added to the default CSP rules. | +| [header](./kibana-plugin-core-server.icspconfig.header.md) | string | The CSP rules in a formatted directives string for use in a Content-Security-Policy header. | +| [strict](./kibana-plugin-core-server.icspconfig.strict.md) | boolean | Specify whether browsers that do not support CSP should be able to use Kibana. Use true to block and false to allow. | +| [warnLegacyBrowsers](./kibana-plugin-core-server.icspconfig.warnlegacybrowsers.md) | boolean | Specify whether users with legacy browsers should be warned about their lack of Kibana security compliance. | diff --git a/docs/development/core/server/kibana-plugin-core-server.icustomclusterclient.md b/docs/development/core/server/kibana-plugin-core-server.icustomclusterclient.md index 189a50b5d6c20a..1c65137d1ddc1a 100644 --- a/docs/development/core/server/kibana-plugin-core-server.icustomclusterclient.md +++ b/docs/development/core/server/kibana-plugin-core-server.icustomclusterclient.md @@ -11,10 +11,11 @@ See [IClusterClient](./kibana-plugin-core-server.iclusterclient.md) ```typescript export interface ICustomClusterClient extends IClusterClient ``` +Extends: IClusterClient ## Properties | Property | Type | Description | | --- | --- | --- | -| [close](./kibana-plugin-core-server.icustomclusterclient.close.md) | () => Promise<void> | Closes the cluster client. After that client cannot be used and one should create a new client instance to be able to interact with Elasticsearch API. | +| [close](./kibana-plugin-core-server.icustomclusterclient.close.md) | () => Promise<void> | Closes the cluster client. After that client cannot be used and one should create a new client instance to be able to interact with Elasticsearch API. | diff --git a/docs/development/core/server/kibana-plugin-core-server.iexecutioncontextcontainer.tojson.md b/docs/development/core/server/kibana-plugin-core-server.iexecutioncontextcontainer.tojson.md index 6b643f7f72c957..a561e6c3194082 100644 --- a/docs/development/core/server/kibana-plugin-core-server.iexecutioncontextcontainer.tojson.md +++ b/docs/development/core/server/kibana-plugin-core-server.iexecutioncontextcontainer.tojson.md @@ -11,5 +11,5 @@ toJSON(): Readonly; ``` Returns: -`Readonly` +Readonly<KibanaExecutionContext> diff --git a/docs/development/core/server/kibana-plugin-core-server.iexecutioncontextcontainer.tostring.md b/docs/development/core/server/kibana-plugin-core-server.iexecutioncontextcontainer.tostring.md index 60f9f499cf36c8..666da5bef39691 100644 --- a/docs/development/core/server/kibana-plugin-core-server.iexecutioncontextcontainer.tostring.md +++ b/docs/development/core/server/kibana-plugin-core-server.iexecutioncontextcontainer.tostring.md @@ -11,5 +11,5 @@ toString(): string; ``` Returns: -`string` +string diff --git a/docs/development/core/server/kibana-plugin-core-server.iexternalurlconfig.md b/docs/development/core/server/kibana-plugin-core-server.iexternalurlconfig.md index 8df4db4aa9b5e9..b5490a9548dc1a 100644 --- a/docs/development/core/server/kibana-plugin-core-server.iexternalurlconfig.md +++ b/docs/development/core/server/kibana-plugin-core-server.iexternalurlconfig.md @@ -16,5 +16,5 @@ export interface IExternalUrlConfig | Property | Type | Description | | --- | --- | --- | -| [policy](./kibana-plugin-core-server.iexternalurlconfig.policy.md) | IExternalUrlPolicy[] | A set of policies describing which external urls are allowed. | +| [policy](./kibana-plugin-core-server.iexternalurlconfig.policy.md) | IExternalUrlPolicy\[\] | A set of policies describing which external urls are allowed. | diff --git a/docs/development/core/server/kibana-plugin-core-server.iexternalurlpolicy.host.md b/docs/development/core/server/kibana-plugin-core-server.iexternalurlpolicy.host.md index d1380d9a37846c..a549f805094743 100644 --- a/docs/development/core/server/kibana-plugin-core-server.iexternalurlpolicy.host.md +++ b/docs/development/core/server/kibana-plugin-core-server.iexternalurlpolicy.host.md @@ -19,6 +19,5 @@ host?: string; // allows access to all of google.com, using any protocol. allow: true, host: 'google.com' - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.iexternalurlpolicy.md b/docs/development/core/server/kibana-plugin-core-server.iexternalurlpolicy.md index d7fcc1d96bdfe7..45f7798eaf3369 100644 --- a/docs/development/core/server/kibana-plugin-core-server.iexternalurlpolicy.md +++ b/docs/development/core/server/kibana-plugin-core-server.iexternalurlpolicy.md @@ -16,7 +16,7 @@ export interface IExternalUrlPolicy | Property | Type | Description | | --- | --- | --- | -| [allow](./kibana-plugin-core-server.iexternalurlpolicy.allow.md) | boolean | Indicates if this policy allows or denies access to the described destination. | -| [host](./kibana-plugin-core-server.iexternalurlpolicy.host.md) | string | Optional host describing the external destination. May be combined with protocol. | -| [protocol](./kibana-plugin-core-server.iexternalurlpolicy.protocol.md) | string | Optional protocol describing the external destination. May be combined with host. | +| [allow](./kibana-plugin-core-server.iexternalurlpolicy.allow.md) | boolean | Indicates if this policy allows or denies access to the described destination. | +| [host?](./kibana-plugin-core-server.iexternalurlpolicy.host.md) | string | (Optional) Optional host describing the external destination. May be combined with protocol. | +| [protocol?](./kibana-plugin-core-server.iexternalurlpolicy.protocol.md) | string | (Optional) Optional protocol describing the external destination. May be combined with host. | diff --git a/docs/development/core/server/kibana-plugin-core-server.iexternalurlpolicy.protocol.md b/docs/development/core/server/kibana-plugin-core-server.iexternalurlpolicy.protocol.md index 54e5eb5bc68f53..86f6e6164de4e3 100644 --- a/docs/development/core/server/kibana-plugin-core-server.iexternalurlpolicy.protocol.md +++ b/docs/development/core/server/kibana-plugin-core-server.iexternalurlpolicy.protocol.md @@ -19,6 +19,5 @@ protocol?: string; // allows access to all destinations over the `https` protocol. allow: true, protocol: 'https' - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.ikibanaresponse.md b/docs/development/core/server/kibana-plugin-core-server.ikibanaresponse.md index 339ae189f1513e..c71f5360834e82 100644 --- a/docs/development/core/server/kibana-plugin-core-server.ikibanaresponse.md +++ b/docs/development/core/server/kibana-plugin-core-server.ikibanaresponse.md @@ -16,7 +16,7 @@ export interface IKibanaResponseHttpResponseOptions | | -| [payload](./kibana-plugin-core-server.ikibanaresponse.payload.md) | T | | -| [status](./kibana-plugin-core-server.ikibanaresponse.status.md) | number | | +| [options](./kibana-plugin-core-server.ikibanaresponse.options.md) | HttpResponseOptions | | +| [payload?](./kibana-plugin-core-server.ikibanaresponse.payload.md) | T | (Optional) | +| [status](./kibana-plugin-core-server.ikibanaresponse.status.md) | number | | diff --git a/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.getpeercertificate.md b/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.getpeercertificate.md index 79dca660a5f30d..9f0dce061bcfc0 100644 --- a/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.getpeercertificate.md +++ b/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.getpeercertificate.md @@ -14,9 +14,9 @@ getPeerCertificate(detailed: true): DetailedPeerCertificate | null; | Parameter | Type | Description | | --- | --- | --- | -| detailed | true | | +| detailed | true | | Returns: -`DetailedPeerCertificate | null` +DetailedPeerCertificate \| null diff --git a/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.getpeercertificate_1.md b/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.getpeercertificate_1.md index 28c126fc4f733d..363fce50251d8b 100644 --- a/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.getpeercertificate_1.md +++ b/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.getpeercertificate_1.md @@ -14,9 +14,9 @@ getPeerCertificate(detailed: false): PeerCertificate | null; | Parameter | Type | Description | | --- | --- | --- | -| detailed | false | | +| detailed | false | | Returns: -`PeerCertificate | null` +PeerCertificate \| null diff --git a/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.getpeercertificate_2.md b/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.getpeercertificate_2.md index afeb36a9d5f3e1..24b11b69660001 100644 --- a/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.getpeercertificate_2.md +++ b/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.getpeercertificate_2.md @@ -16,11 +16,11 @@ getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificat | Parameter | Type | Description | | --- | --- | --- | -| detailed | boolean | If true; the full chain with issuer property will be returned. | +| detailed | boolean | If true; the full chain with issuer property will be returned. | Returns: -`PeerCertificate | DetailedPeerCertificate | null` +PeerCertificate \| DetailedPeerCertificate \| null An object representing the peer's certificate. diff --git a/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.getprotocol.md b/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.getprotocol.md index 720091174629a3..d605f2fd21bef0 100644 --- a/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.getprotocol.md +++ b/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.getprotocol.md @@ -13,5 +13,5 @@ getProtocol(): string | null; ``` Returns: -`string | null` +string \| null diff --git a/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.md b/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.md index 99923aecef8df5..bc8f59df9d211f 100644 --- a/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.md +++ b/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.md @@ -16,8 +16,8 @@ export interface IKibanaSocket | Property | Type | Description | | --- | --- | --- | -| [authorizationError](./kibana-plugin-core-server.ikibanasocket.authorizationerror.md) | Error | The reason why the peer's certificate has not been verified. This property becomes available only when authorized is false. | -| [authorized](./kibana-plugin-core-server.ikibanasocket.authorized.md) | boolean | Indicates whether or not the peer certificate was signed by one of the specified CAs. When TLS isn't used the value is undefined. | +| [authorizationError?](./kibana-plugin-core-server.ikibanasocket.authorizationerror.md) | Error | (Optional) The reason why the peer's certificate has not been verified. This property becomes available only when authorized is false. | +| [authorized?](./kibana-plugin-core-server.ikibanasocket.authorized.md) | boolean | (Optional) Indicates whether or not the peer certificate was signed by one of the specified CAs. When TLS isn't used the value is undefined. | ## Methods diff --git a/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.renegotiate.md b/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.renegotiate.md index f39d3c08d9f0b3..b4addde9b3179b 100644 --- a/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.renegotiate.md +++ b/docs/development/core/server/kibana-plugin-core-server.ikibanasocket.renegotiate.md @@ -19,11 +19,11 @@ renegotiate(options: { | Parameter | Type | Description | | --- | --- | --- | -| options | {
rejectUnauthorized?: boolean;
requestCert?: boolean;
} | The options may contain the following fields: rejectUnauthorized, requestCert (See tls.createServer() for details). | +| options | { rejectUnauthorized?: boolean; requestCert?: boolean; } | The options may contain the following fields: rejectUnauthorized, requestCert (See tls.createServer() for details). | Returns: -`Promise` +Promise<void> A Promise that will be resolved if renegotiation succeeded, or will be rejected if renegotiation failed. diff --git a/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.md b/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.md index d7fb889dce3223..39f2d570cd259c 100644 --- a/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.md +++ b/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.md @@ -16,12 +16,12 @@ export interface IntervalHistogram | Property | Type | Description | | --- | --- | --- | -| [exceeds](./kibana-plugin-core-server.intervalhistogram.exceeds.md) | number | | -| [fromTimestamp](./kibana-plugin-core-server.intervalhistogram.fromtimestamp.md) | string | | -| [lastUpdatedAt](./kibana-plugin-core-server.intervalhistogram.lastupdatedat.md) | string | | -| [max](./kibana-plugin-core-server.intervalhistogram.max.md) | number | | -| [mean](./kibana-plugin-core-server.intervalhistogram.mean.md) | number | | -| [min](./kibana-plugin-core-server.intervalhistogram.min.md) | number | | -| [percentiles](./kibana-plugin-core-server.intervalhistogram.percentiles.md) | {
50: number;
75: number;
95: number;
99: number;
} | | -| [stddev](./kibana-plugin-core-server.intervalhistogram.stddev.md) | number | | +| [exceeds](./kibana-plugin-core-server.intervalhistogram.exceeds.md) | number | | +| [fromTimestamp](./kibana-plugin-core-server.intervalhistogram.fromtimestamp.md) | string | | +| [lastUpdatedAt](./kibana-plugin-core-server.intervalhistogram.lastupdatedat.md) | string | | +| [max](./kibana-plugin-core-server.intervalhistogram.max.md) | number | | +| [mean](./kibana-plugin-core-server.intervalhistogram.mean.md) | number | | +| [min](./kibana-plugin-core-server.intervalhistogram.min.md) | number | | +| [percentiles](./kibana-plugin-core-server.intervalhistogram.percentiles.md) | { 50: number; 75: number; 95: number; 99: number; } | | +| [stddev](./kibana-plugin-core-server.intervalhistogram.stddev.md) | number | | diff --git a/docs/development/core/server/kibana-plugin-core-server.irenderoptions.md b/docs/development/core/server/kibana-plugin-core-server.irenderoptions.md index 51712a3ea18712..b7c43bc77867d4 100644 --- a/docs/development/core/server/kibana-plugin-core-server.irenderoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.irenderoptions.md @@ -15,5 +15,5 @@ export interface IRenderOptions | Property | Type | Description | | --- | --- | --- | -| [includeUserSettings](./kibana-plugin-core-server.irenderoptions.includeusersettings.md) | boolean | Set whether to output user settings in the page metadata. true by default. | +| [includeUserSettings?](./kibana-plugin-core-server.irenderoptions.includeusersettings.md) | boolean | (Optional) Set whether to output user settings in the page metadata. true by default. | diff --git a/docs/development/core/server/kibana-plugin-core-server.irouter.md b/docs/development/core/server/kibana-plugin-core-server.irouter.md index a0a27e828f8656..a751ea399c5a98 100644 --- a/docs/development/core/server/kibana-plugin-core-server.irouter.md +++ b/docs/development/core/server/kibana-plugin-core-server.irouter.md @@ -16,11 +16,11 @@ export interface IRouterRouteRegistrar<'delete', Context> | Register a route handler for DELETE request. | -| [get](./kibana-plugin-core-server.irouter.get.md) | RouteRegistrar<'get', Context> | Register a route handler for GET request. | -| [handleLegacyErrors](./kibana-plugin-core-server.irouter.handlelegacyerrors.md) | RequestHandlerWrapper | Wrap a router handler to catch and converts legacy boom errors to proper custom errors. | -| [patch](./kibana-plugin-core-server.irouter.patch.md) | RouteRegistrar<'patch', Context> | Register a route handler for PATCH request. | -| [post](./kibana-plugin-core-server.irouter.post.md) | RouteRegistrar<'post', Context> | Register a route handler for POST request. | -| [put](./kibana-plugin-core-server.irouter.put.md) | RouteRegistrar<'put', Context> | Register a route handler for PUT request. | -| [routerPath](./kibana-plugin-core-server.irouter.routerpath.md) | string | Resulted path | +| [delete](./kibana-plugin-core-server.irouter.delete.md) | RouteRegistrar<'delete', Context> | Register a route handler for DELETE request. | +| [get](./kibana-plugin-core-server.irouter.get.md) | RouteRegistrar<'get', Context> | Register a route handler for GET request. | +| [handleLegacyErrors](./kibana-plugin-core-server.irouter.handlelegacyerrors.md) | RequestHandlerWrapper | Wrap a router handler to catch and converts legacy boom errors to proper custom errors. | +| [patch](./kibana-plugin-core-server.irouter.patch.md) | RouteRegistrar<'patch', Context> | Register a route handler for PATCH request. | +| [post](./kibana-plugin-core-server.irouter.post.md) | RouteRegistrar<'post', Context> | Register a route handler for POST request. | +| [put](./kibana-plugin-core-server.irouter.put.md) | RouteRegistrar<'put', Context> | Register a route handler for PUT request. | +| [routerPath](./kibana-plugin-core-server.irouter.routerpath.md) | string | Resulted path | diff --git a/docs/development/core/server/kibana-plugin-core-server.isavedobjectspointintimefinder.md b/docs/development/core/server/kibana-plugin-core-server.isavedobjectspointintimefinder.md index 950d6c078654ca..748ffbdc3c4e86 100644 --- a/docs/development/core/server/kibana-plugin-core-server.isavedobjectspointintimefinder.md +++ b/docs/development/core/server/kibana-plugin-core-server.isavedobjectspointintimefinder.md @@ -15,6 +15,6 @@ export interface ISavedObjectsPointInTimeFinder | Property | Type | Description | | --- | --- | --- | -| [close](./kibana-plugin-core-server.isavedobjectspointintimefinder.close.md) | () => Promise<void> | Closes the Point-In-Time associated with this finder instance.Once you have retrieved all of the results you need, it is recommended to call close() to clean up the PIT and prevent Elasticsearch from consuming resources unnecessarily. This is only required if you are done iterating and have not yet paged through all of the results: the PIT will automatically be closed for you once you reach the last page of results, or if the underlying call to find fails for any reason. | -| [find](./kibana-plugin-core-server.isavedobjectspointintimefinder.find.md) | () => AsyncGenerator<SavedObjectsFindResponse<T, A>> | An async generator which wraps calls to savedObjectsClient.find and iterates over multiple pages of results using _pit and search_after. This will open a new Point-In-Time (PIT), and continue paging until a set of results is received that's smaller than the designated perPage size. | +| [close](./kibana-plugin-core-server.isavedobjectspointintimefinder.close.md) | () => Promise<void> | Closes the Point-In-Time associated with this finder instance.Once you have retrieved all of the results you need, it is recommended to call close() to clean up the PIT and prevent Elasticsearch from consuming resources unnecessarily. This is only required if you are done iterating and have not yet paged through all of the results: the PIT will automatically be closed for you once you reach the last page of results, or if the underlying call to find fails for any reason. | +| [find](./kibana-plugin-core-server.isavedobjectspointintimefinder.find.md) | () => AsyncGenerator<SavedObjectsFindResponse<T, A>> | An async generator which wraps calls to savedObjectsClient.find and iterates over multiple pages of results using _pit and search_after. This will open a new Point-In-Time (PIT), and continue paging until a set of results is received that's smaller than the designated perPage size. | diff --git a/docs/development/core/server/kibana-plugin-core-server.iscopedclusterclient.md b/docs/development/core/server/kibana-plugin-core-server.iscopedclusterclient.md index f39db268288a6f..f0d75f2f08fe48 100644 --- a/docs/development/core/server/kibana-plugin-core-server.iscopedclusterclient.md +++ b/docs/development/core/server/kibana-plugin-core-server.iscopedclusterclient.md @@ -16,6 +16,6 @@ export interface IScopedClusterClient | Property | Type | Description | | --- | --- | --- | -| [asCurrentUser](./kibana-plugin-core-server.iscopedclusterclient.ascurrentuser.md) | ElasticsearchClient | A [client](./kibana-plugin-core-server.elasticsearchclient.md) to be used to query the elasticsearch cluster on behalf of the user that initiated the request to the Kibana server. | -| [asInternalUser](./kibana-plugin-core-server.iscopedclusterclient.asinternaluser.md) | ElasticsearchClient | A [client](./kibana-plugin-core-server.elasticsearchclient.md) to be used to query the elasticsearch cluster on behalf of the internal Kibana user. | +| [asCurrentUser](./kibana-plugin-core-server.iscopedclusterclient.ascurrentuser.md) | ElasticsearchClient | A [client](./kibana-plugin-core-server.elasticsearchclient.md) to be used to query the elasticsearch cluster on behalf of the user that initiated the request to the Kibana server. | +| [asInternalUser](./kibana-plugin-core-server.iscopedclusterclient.asinternaluser.md) | ElasticsearchClient | A [client](./kibana-plugin-core-server.elasticsearchclient.md) to be used to query the elasticsearch cluster on behalf of the internal Kibana user. | diff --git a/docs/development/core/server/kibana-plugin-core-server.iuisettingsclient.md b/docs/development/core/server/kibana-plugin-core-server.iuisettingsclient.md index dd4a69c13a2d92..ad7819719e14a5 100644 --- a/docs/development/core/server/kibana-plugin-core-server.iuisettingsclient.md +++ b/docs/development/core/server/kibana-plugin-core-server.iuisettingsclient.md @@ -16,14 +16,14 @@ export interface IUiSettingsClient | Property | Type | Description | | --- | --- | --- | -| [get](./kibana-plugin-core-server.iuisettingsclient.get.md) | <T = any>(key: string) => Promise<T> | Retrieves uiSettings values set by the user with fallbacks to default values if not specified. | -| [getAll](./kibana-plugin-core-server.iuisettingsclient.getall.md) | <T = any>() => Promise<Record<string, T>> | Retrieves a set of all uiSettings values set by the user with fallbacks to default values if not specified. | -| [getRegistered](./kibana-plugin-core-server.iuisettingsclient.getregistered.md) | () => Readonly<Record<string, PublicUiSettingsParams>> | Returns registered uiSettings values [UiSettingsParams](./kibana-plugin-core-server.uisettingsparams.md) | -| [getUserProvided](./kibana-plugin-core-server.iuisettingsclient.getuserprovided.md) | <T = any>() => Promise<Record<string, UserProvidedValues<T>>> | Retrieves a set of all uiSettings values set by the user. | -| [isOverridden](./kibana-plugin-core-server.iuisettingsclient.isoverridden.md) | (key: string) => boolean | Shows whether the uiSettings value set by the user. | -| [isSensitive](./kibana-plugin-core-server.iuisettingsclient.issensitive.md) | (key: string) => boolean | Shows whether the uiSetting is a sensitive value. Used by telemetry to not send sensitive values. | -| [remove](./kibana-plugin-core-server.iuisettingsclient.remove.md) | (key: string) => Promise<void> | Removes uiSettings value by key. | -| [removeMany](./kibana-plugin-core-server.iuisettingsclient.removemany.md) | (keys: string[]) => Promise<void> | Removes multiple uiSettings values by keys. | -| [set](./kibana-plugin-core-server.iuisettingsclient.set.md) | (key: string, value: any) => Promise<void> | Writes uiSettings value and marks it as set by the user. | -| [setMany](./kibana-plugin-core-server.iuisettingsclient.setmany.md) | (changes: Record<string, any>) => Promise<void> | Writes multiple uiSettings values and marks them as set by the user. | +| [get](./kibana-plugin-core-server.iuisettingsclient.get.md) | <T = any>(key: string) => Promise<T> | Retrieves uiSettings values set by the user with fallbacks to default values if not specified. | +| [getAll](./kibana-plugin-core-server.iuisettingsclient.getall.md) | <T = any>() => Promise<Record<string, T>> | Retrieves a set of all uiSettings values set by the user with fallbacks to default values if not specified. | +| [getRegistered](./kibana-plugin-core-server.iuisettingsclient.getregistered.md) | () => Readonly<Record<string, PublicUiSettingsParams>> | Returns registered uiSettings values [UiSettingsParams](./kibana-plugin-core-server.uisettingsparams.md) | +| [getUserProvided](./kibana-plugin-core-server.iuisettingsclient.getuserprovided.md) | <T = any>() => Promise<Record<string, UserProvidedValues<T>>> | Retrieves a set of all uiSettings values set by the user. | +| [isOverridden](./kibana-plugin-core-server.iuisettingsclient.isoverridden.md) | (key: string) => boolean | Shows whether the uiSettings value set by the user. | +| [isSensitive](./kibana-plugin-core-server.iuisettingsclient.issensitive.md) | (key: string) => boolean | Shows whether the uiSetting is a sensitive value. Used by telemetry to not send sensitive values. | +| [remove](./kibana-plugin-core-server.iuisettingsclient.remove.md) | (key: string) => Promise<void> | Removes uiSettings value by key. | +| [removeMany](./kibana-plugin-core-server.iuisettingsclient.removemany.md) | (keys: string\[\]) => Promise<void> | Removes multiple uiSettings values by keys. | +| [set](./kibana-plugin-core-server.iuisettingsclient.set.md) | (key: string, value: any) => Promise<void> | Writes uiSettings value and marks it as set by the user. | +| [setMany](./kibana-plugin-core-server.iuisettingsclient.setmany.md) | (changes: Record<string, any>) => Promise<void> | Writes multiple uiSettings values and marks them as set by the user. | diff --git a/docs/development/core/server/kibana-plugin-core-server.kibanarequest._constructor_.md b/docs/development/core/server/kibana-plugin-core-server.kibanarequest._constructor_.md index b44607c1c41358..682d6c87629fca 100644 --- a/docs/development/core/server/kibana-plugin-core-server.kibanarequest._constructor_.md +++ b/docs/development/core/server/kibana-plugin-core-server.kibanarequest._constructor_.md @@ -16,9 +16,9 @@ constructor(request: Request, params: Params, query: Query, body: Body, withoutS | Parameter | Type | Description | | --- | --- | --- | -| request | Request | | -| params | Params | | -| query | Query | | -| body | Body | | -| withoutSecretHeaders | boolean | | +| request | Request | | +| params | Params | | +| query | Query | | +| body | Body | | +| withoutSecretHeaders | boolean | | diff --git a/docs/development/core/server/kibana-plugin-core-server.kibanarequest.md b/docs/development/core/server/kibana-plugin-core-server.kibanarequest.md index 4129662acb2b1d..f4e2dda2d54999 100644 --- a/docs/development/core/server/kibana-plugin-core-server.kibanarequest.md +++ b/docs/development/core/server/kibana-plugin-core-server.kibanarequest.md @@ -22,17 +22,17 @@ export declare class KibanaRequest{
isAuthenticated: boolean;
} | | -| [body](./kibana-plugin-core-server.kibanarequest.body.md) | | Body | | -| [events](./kibana-plugin-core-server.kibanarequest.events.md) | | KibanaRequestEvents | Request events [KibanaRequestEvents](./kibana-plugin-core-server.kibanarequestevents.md) | -| [headers](./kibana-plugin-core-server.kibanarequest.headers.md) | | Headers | Readonly copy of incoming request headers. | -| [id](./kibana-plugin-core-server.kibanarequest.id.md) | | string | A identifier to identify this request. | -| [isSystemRequest](./kibana-plugin-core-server.kibanarequest.issystemrequest.md) | | boolean | Whether or not the request is a "system request" rather than an application-level request. Can be set on the client using the HttpFetchOptions#asSystemRequest option. | -| [params](./kibana-plugin-core-server.kibanarequest.params.md) | | Params | | -| [query](./kibana-plugin-core-server.kibanarequest.query.md) | | Query | | -| [rewrittenUrl](./kibana-plugin-core-server.kibanarequest.rewrittenurl.md) | | URL | URL rewritten in onPreRouting request interceptor. | -| [route](./kibana-plugin-core-server.kibanarequest.route.md) | | RecursiveReadonly<KibanaRequestRoute<Method>> | matched route details | -| [socket](./kibana-plugin-core-server.kibanarequest.socket.md) | | IKibanaSocket | [IKibanaSocket](./kibana-plugin-core-server.ikibanasocket.md) | -| [url](./kibana-plugin-core-server.kibanarequest.url.md) | | URL | a WHATWG URL standard object. | -| [uuid](./kibana-plugin-core-server.kibanarequest.uuid.md) | | string | A UUID to identify this request. | +| [auth](./kibana-plugin-core-server.kibanarequest.auth.md) | | { isAuthenticated: boolean; } | | +| [body](./kibana-plugin-core-server.kibanarequest.body.md) | | Body | | +| [events](./kibana-plugin-core-server.kibanarequest.events.md) | | KibanaRequestEvents | Request events [KibanaRequestEvents](./kibana-plugin-core-server.kibanarequestevents.md) | +| [headers](./kibana-plugin-core-server.kibanarequest.headers.md) | | Headers | Readonly copy of incoming request headers. | +| [id](./kibana-plugin-core-server.kibanarequest.id.md) | | string | A identifier to identify this request. | +| [isSystemRequest](./kibana-plugin-core-server.kibanarequest.issystemrequest.md) | | boolean | Whether or not the request is a "system request" rather than an application-level request. Can be set on the client using the HttpFetchOptions#asSystemRequest option. | +| [params](./kibana-plugin-core-server.kibanarequest.params.md) | | Params | | +| [query](./kibana-plugin-core-server.kibanarequest.query.md) | | Query | | +| [rewrittenUrl?](./kibana-plugin-core-server.kibanarequest.rewrittenurl.md) | | URL | (Optional) URL rewritten in onPreRouting request interceptor. | +| [route](./kibana-plugin-core-server.kibanarequest.route.md) | | RecursiveReadonly<KibanaRequestRoute<Method>> | matched route details | +| [socket](./kibana-plugin-core-server.kibanarequest.socket.md) | | IKibanaSocket | [IKibanaSocket](./kibana-plugin-core-server.ikibanasocket.md) | +| [url](./kibana-plugin-core-server.kibanarequest.url.md) | | URL | a WHATWG URL standard object. | +| [uuid](./kibana-plugin-core-server.kibanarequest.uuid.md) | | string | A UUID to identify this request. | diff --git a/docs/development/core/server/kibana-plugin-core-server.kibanarequestevents.md b/docs/development/core/server/kibana-plugin-core-server.kibanarequestevents.md index dfd7efd27cb5a4..c61e4aeec7c851 100644 --- a/docs/development/core/server/kibana-plugin-core-server.kibanarequestevents.md +++ b/docs/development/core/server/kibana-plugin-core-server.kibanarequestevents.md @@ -16,6 +16,6 @@ export interface KibanaRequestEvents | Property | Type | Description | | --- | --- | --- | -| [aborted$](./kibana-plugin-core-server.kibanarequestevents.aborted_.md) | Observable<void> | Observable that emits once if and when the request has been aborted. | -| [completed$](./kibana-plugin-core-server.kibanarequestevents.completed_.md) | Observable<void> | Observable that emits once if and when the request has been completely handled. | +| [aborted$](./kibana-plugin-core-server.kibanarequestevents.aborted_.md) | Observable<void> | Observable that emits once if and when the request has been aborted. | +| [completed$](./kibana-plugin-core-server.kibanarequestevents.completed_.md) | Observable<void> | Observable that emits once if and when the request has been completely handled. | diff --git a/docs/development/core/server/kibana-plugin-core-server.kibanarequestroute.md b/docs/development/core/server/kibana-plugin-core-server.kibanarequestroute.md index 480b580abc8a74..196c352e21f8a0 100644 --- a/docs/development/core/server/kibana-plugin-core-server.kibanarequestroute.md +++ b/docs/development/core/server/kibana-plugin-core-server.kibanarequestroute.md @@ -16,7 +16,7 @@ export interface KibanaRequestRoute | Property | Type | Description | | --- | --- | --- | -| [method](./kibana-plugin-core-server.kibanarequestroute.method.md) | Method | | -| [options](./kibana-plugin-core-server.kibanarequestroute.options.md) | KibanaRequestRouteOptions<Method> | | -| [path](./kibana-plugin-core-server.kibanarequestroute.path.md) | string | | +| [method](./kibana-plugin-core-server.kibanarequestroute.method.md) | Method | | +| [options](./kibana-plugin-core-server.kibanarequestroute.options.md) | KibanaRequestRouteOptions<Method> | | +| [path](./kibana-plugin-core-server.kibanarequestroute.path.md) | string | | diff --git a/docs/development/core/server/kibana-plugin-core-server.kibanaresponsefactory.md b/docs/development/core/server/kibana-plugin-core-server.kibanaresponsefactory.md index 8ddc0da5f1b285..b2e2b4bc6003f0 100644 --- a/docs/development/core/server/kibana-plugin-core-server.kibanaresponsefactory.md +++ b/docs/development/core/server/kibana-plugin-core-server.kibanaresponsefactory.md @@ -40,7 +40,6 @@ return response.ok({ body: Buffer.from(...) }); const stream = new Stream.PassThrough(); fs.createReadStream('./file').pipe(stream); return res.ok({ body: stream }); - ``` HTTP headers are configurable via response factory parameter `options` [HttpResponseOptions](./kibana-plugin-core-server.httpresponseoptions.md). @@ -51,7 +50,6 @@ return response.ok({ 'content-type': 'application/json' } }); - ``` 2. Redirection response. Redirection URL is configures via 'Location' header. @@ -62,7 +60,6 @@ return response.redirected({ location: '/new-url', }, }); - ``` 3. Error response. You may pass an error message to the client, where error message can be: - `string` send message text - `Error` send the message text of given Error object. - `{ message: string | Error, attributes: {data: Record, ...} }` - send message text and attach additional error data. @@ -100,7 +97,6 @@ try { }); } - ``` 4. Custom response. `ResponseFactory` may not cover your use case, so you can use the `custom` function to customize the response. @@ -112,6 +108,5 @@ return response.custom({ location: '/created-url' } }) - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.loggercontextconfiginput.md b/docs/development/core/server/kibana-plugin-core-server.loggercontextconfiginput.md index fb6922d839cb85..2628d1ada88f8b 100644 --- a/docs/development/core/server/kibana-plugin-core-server.loggercontextconfiginput.md +++ b/docs/development/core/server/kibana-plugin-core-server.loggercontextconfiginput.md @@ -15,6 +15,6 @@ export interface LoggerContextConfigInput | Property | Type | Description | | --- | --- | --- | -| [appenders](./kibana-plugin-core-server.loggercontextconfiginput.appenders.md) | Record<string, AppenderConfigType> | Map<string, AppenderConfigType> | | -| [loggers](./kibana-plugin-core-server.loggercontextconfiginput.loggers.md) | LoggerConfigType[] | | +| [appenders?](./kibana-plugin-core-server.loggercontextconfiginput.appenders.md) | Record<string, AppenderConfigType> \| Map<string, AppenderConfigType> | (Optional) | +| [loggers?](./kibana-plugin-core-server.loggercontextconfiginput.loggers.md) | LoggerConfigType\[\] | (Optional) | diff --git a/docs/development/core/server/kibana-plugin-core-server.loggingservicesetup.configure.md b/docs/development/core/server/kibana-plugin-core-server.loggingservicesetup.configure.md index 52ab5f1098457c..022cbb3b7cbaeb 100644 --- a/docs/development/core/server/kibana-plugin-core-server.loggingservicesetup.configure.md +++ b/docs/development/core/server/kibana-plugin-core-server.loggingservicesetup.configure.md @@ -16,11 +16,11 @@ configure(config$: Observable): void; | Parameter | Type | Description | | --- | --- | --- | -| config$ | Observable<LoggerContextConfigInput> | | +| config$ | Observable<LoggerContextConfigInput> | | Returns: -`void` +void ## Remarks @@ -37,6 +37,5 @@ core.logging.configure( loggers: [{ name: 'search', appenders: ['default'] }] }) ) - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.md b/docs/development/core/server/kibana-plugin-core-server.md index f22a0fb8283d71..2eed71cc6ecead 100644 --- a/docs/development/core/server/kibana-plugin-core-server.md +++ b/docs/development/core/server/kibana-plugin-core-server.md @@ -8,7 +8,7 @@ The Kibana Core APIs for server-side plugins. A plugin requires a `kibana.json` file at it's root directory that follows [the manfiest schema](./kibana-plugin-core-server.pluginmanifest.md) to define static plugin information required to load the plugin. -A plugin's `server/index` file must contain a named import, `plugin`, that implements [PluginInitializer](./kibana-plugin-core-server.plugininitializer.md) which returns an object that implements [Plugin](./kibana-plugin-core-server.plugin.md). +A plugin's `server/index` file must contain a named import, `plugin`, that implements [PluginInitializer](./kibana-plugin-core-server.plugininitializer.md) which returns an object that implements . The plugin integrates with the core system via lifecycle events: `setup`, `start`, and `stop`. In each lifecycle method, the plugin will receive the corresponding core services available (either [CoreSetup](./kibana-plugin-core-server.coresetup.md) or [CoreStart](./kibana-plugin-core-server.corestart.md)) and any interfaces returned by dependency plugins' lifecycle method. Anything returned by the plugin's lifecycle method will be exposed to downstream dependencies when their corresponding lifecycle methods are invoked. @@ -124,7 +124,7 @@ The plugin integrates with the core system via lifecycle events: `setup` | [OpsOsMetrics](./kibana-plugin-core-server.opsosmetrics.md) | OS related metrics | | [OpsProcessMetrics](./kibana-plugin-core-server.opsprocessmetrics.md) | Process related metrics | | [OpsServerMetrics](./kibana-plugin-core-server.opsservermetrics.md) | server related metrics | -| [Plugin](./kibana-plugin-core-server.plugin.md) | The interface that should be returned by a PluginInitializer for a standard plugin. | +| [Plugin\_2](./kibana-plugin-core-server.plugin_2.md) | The interface that should be returned by a PluginInitializer for a standard plugin. | | [PluginConfigDescriptor](./kibana-plugin-core-server.pluginconfigdescriptor.md) | Describes a plugin configuration properties. | | [PluginInitializerContext](./kibana-plugin-core-server.plugininitializercontext.md) | Context that's available to plugins during initialization stage. | | [PluginManifest](./kibana-plugin-core-server.pluginmanifest.md) | Describes the set of required and optional properties plugin can define in its mandatory JSON manifest file. | @@ -259,7 +259,7 @@ The plugin integrates with the core system via lifecycle events: `setup` | [HandlerContextType](./kibana-plugin-core-server.handlercontexttype.md) | Extracts the type of the first argument of a [HandlerFunction](./kibana-plugin-core-server.handlerfunction.md) to represent the type of the context. | | [HandlerFunction](./kibana-plugin-core-server.handlerfunction.md) | A function that accepts a context object and an optional number of additional arguments. Used for the generic types in [IContextContainer](./kibana-plugin-core-server.icontextcontainer.md) | | [HandlerParameters](./kibana-plugin-core-server.handlerparameters.md) | Extracts the types of the additional arguments of a [HandlerFunction](./kibana-plugin-core-server.handlerfunction.md), excluding the [HandlerContextType](./kibana-plugin-core-server.handlercontexttype.md). | -| [Headers](./kibana-plugin-core-server.headers.md) | Http request headers to read. | +| [Headers\_2](./kibana-plugin-core-server.headers_2.md) | Http request headers to read. | | [HttpResourcesRequestHandler](./kibana-plugin-core-server.httpresourcesrequesthandler.md) | Extended version of [RequestHandler](./kibana-plugin-core-server.requesthandler.md) having access to [HttpResourcesServiceToolkit](./kibana-plugin-core-server.httpresourcesservicetoolkit.md) to respond with HTML or JS resources. | | [HttpResourcesResponseOptions](./kibana-plugin-core-server.httpresourcesresponseoptions.md) | HTTP Resources response parameters | | [HttpResponsePayload](./kibana-plugin-core-server.httpresponsepayload.md) | Data send to the client as a response payload. | diff --git a/docs/development/core/server/kibana-plugin-core-server.metricsservicesetup.getopsmetrics_.md b/docs/development/core/server/kibana-plugin-core-server.metricsservicesetup.getopsmetrics_.md index 61107fbf20ad92..0db06b231f60ea 100644 --- a/docs/development/core/server/kibana-plugin-core-server.metricsservicesetup.getopsmetrics_.md +++ b/docs/development/core/server/kibana-plugin-core-server.metricsservicesetup.getopsmetrics_.md @@ -19,6 +19,5 @@ getOpsMetrics$: () => Observable; core.metrics.getOpsMetrics$().subscribe(metrics => { // do something with the metrics }) - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.metricsservicesetup.md b/docs/development/core/server/kibana-plugin-core-server.metricsservicesetup.md index 5fcb1417dea0e8..d9b05589ab6a73 100644 --- a/docs/development/core/server/kibana-plugin-core-server.metricsservicesetup.md +++ b/docs/development/core/server/kibana-plugin-core-server.metricsservicesetup.md @@ -16,6 +16,6 @@ export interface MetricsServiceSetup | Property | Type | Description | | --- | --- | --- | -| [collectionInterval](./kibana-plugin-core-server.metricsservicesetup.collectioninterval.md) | number | Interval metrics are collected in milliseconds | -| [getOpsMetrics$](./kibana-plugin-core-server.metricsservicesetup.getopsmetrics_.md) | () => Observable<OpsMetrics> | Retrieve an observable emitting the [OpsMetrics](./kibana-plugin-core-server.opsmetrics.md) gathered. The observable will emit an initial value during core's start phase, and a new value every fixed interval of time, based on the opts.interval configuration property. | +| [collectionInterval](./kibana-plugin-core-server.metricsservicesetup.collectioninterval.md) | number | Interval metrics are collected in milliseconds | +| [getOpsMetrics$](./kibana-plugin-core-server.metricsservicesetup.getopsmetrics_.md) | () => Observable<OpsMetrics> | Retrieve an observable emitting the [OpsMetrics](./kibana-plugin-core-server.opsmetrics.md) gathered. The observable will emit an initial value during core's start phase, and a new value every fixed interval of time, based on the opts.interval configuration property. | diff --git a/docs/development/core/server/kibana-plugin-core-server.nodesversioncompatibility.md b/docs/development/core/server/kibana-plugin-core-server.nodesversioncompatibility.md index cbdac9d5455b01..a282bf4b7b4b6c 100644 --- a/docs/development/core/server/kibana-plugin-core-server.nodesversioncompatibility.md +++ b/docs/development/core/server/kibana-plugin-core-server.nodesversioncompatibility.md @@ -14,10 +14,10 @@ export interface NodesVersionCompatibility | Property | Type | Description | | --- | --- | --- | -| [incompatibleNodes](./kibana-plugin-core-server.nodesversioncompatibility.incompatiblenodes.md) | NodeInfo[] | | -| [isCompatible](./kibana-plugin-core-server.nodesversioncompatibility.iscompatible.md) | boolean | | -| [kibanaVersion](./kibana-plugin-core-server.nodesversioncompatibility.kibanaversion.md) | string | | -| [message](./kibana-plugin-core-server.nodesversioncompatibility.message.md) | string | | -| [nodesInfoRequestError](./kibana-plugin-core-server.nodesversioncompatibility.nodesinforequesterror.md) | Error | | -| [warningNodes](./kibana-plugin-core-server.nodesversioncompatibility.warningnodes.md) | NodeInfo[] | | +| [incompatibleNodes](./kibana-plugin-core-server.nodesversioncompatibility.incompatiblenodes.md) | NodeInfo\[\] | | +| [isCompatible](./kibana-plugin-core-server.nodesversioncompatibility.iscompatible.md) | boolean | | +| [kibanaVersion](./kibana-plugin-core-server.nodesversioncompatibility.kibanaversion.md) | string | | +| [message?](./kibana-plugin-core-server.nodesversioncompatibility.message.md) | string | (Optional) | +| [nodesInfoRequestError?](./kibana-plugin-core-server.nodesversioncompatibility.nodesinforequesterror.md) | Error | (Optional) | +| [warningNodes](./kibana-plugin-core-server.nodesversioncompatibility.warningnodes.md) | NodeInfo\[\] | | diff --git a/docs/development/core/server/kibana-plugin-core-server.onpostauthtoolkit.md b/docs/development/core/server/kibana-plugin-core-server.onpostauthtoolkit.md index ba9f7d60667ac5..069f63fe01b77a 100644 --- a/docs/development/core/server/kibana-plugin-core-server.onpostauthtoolkit.md +++ b/docs/development/core/server/kibana-plugin-core-server.onpostauthtoolkit.md @@ -16,5 +16,5 @@ export interface OnPostAuthToolkit | Property | Type | Description | | --- | --- | --- | -| [next](./kibana-plugin-core-server.onpostauthtoolkit.next.md) | () => OnPostAuthResult | To pass request to the next handler | +| [next](./kibana-plugin-core-server.onpostauthtoolkit.next.md) | () => OnPostAuthResult | To pass request to the next handler | diff --git a/docs/development/core/server/kibana-plugin-core-server.onpreauthtoolkit.md b/docs/development/core/server/kibana-plugin-core-server.onpreauthtoolkit.md index 8031dbc64fa6db..44eed5818c6104 100644 --- a/docs/development/core/server/kibana-plugin-core-server.onpreauthtoolkit.md +++ b/docs/development/core/server/kibana-plugin-core-server.onpreauthtoolkit.md @@ -16,5 +16,5 @@ export interface OnPreAuthToolkit | Property | Type | Description | | --- | --- | --- | -| [next](./kibana-plugin-core-server.onpreauthtoolkit.next.md) | () => OnPreAuthResult | To pass request to the next handler | +| [next](./kibana-plugin-core-server.onpreauthtoolkit.next.md) | () => OnPreAuthResult | To pass request to the next handler | diff --git a/docs/development/core/server/kibana-plugin-core-server.onpreresponseextensions.md b/docs/development/core/server/kibana-plugin-core-server.onpreresponseextensions.md index eaaa94b936fd8b..078ccc38a70c15 100644 --- a/docs/development/core/server/kibana-plugin-core-server.onpreresponseextensions.md +++ b/docs/development/core/server/kibana-plugin-core-server.onpreresponseextensions.md @@ -16,5 +16,5 @@ export interface OnPreResponseExtensions | Property | Type | Description | | --- | --- | --- | -| [headers](./kibana-plugin-core-server.onpreresponseextensions.headers.md) | ResponseHeaders | additional headers to attach to the response | +| [headers?](./kibana-plugin-core-server.onpreresponseextensions.headers.md) | ResponseHeaders | (Optional) additional headers to attach to the response | diff --git a/docs/development/core/server/kibana-plugin-core-server.onpreresponseinfo.md b/docs/development/core/server/kibana-plugin-core-server.onpreresponseinfo.md index 3e5c882b2fb29f..60f7f39ed30a6a 100644 --- a/docs/development/core/server/kibana-plugin-core-server.onpreresponseinfo.md +++ b/docs/development/core/server/kibana-plugin-core-server.onpreresponseinfo.md @@ -16,5 +16,5 @@ export interface OnPreResponseInfo | Property | Type | Description | | --- | --- | --- | -| [statusCode](./kibana-plugin-core-server.onpreresponseinfo.statuscode.md) | number | | +| [statusCode](./kibana-plugin-core-server.onpreresponseinfo.statuscode.md) | number | | diff --git a/docs/development/core/server/kibana-plugin-core-server.onpreresponserender.md b/docs/development/core/server/kibana-plugin-core-server.onpreresponserender.md index 0a7ce2d5467013..a5afa1a709326b 100644 --- a/docs/development/core/server/kibana-plugin-core-server.onpreresponserender.md +++ b/docs/development/core/server/kibana-plugin-core-server.onpreresponserender.md @@ -16,6 +16,6 @@ export interface OnPreResponseRender | Property | Type | Description | | --- | --- | --- | -| [body](./kibana-plugin-core-server.onpreresponserender.body.md) | string | the body to use in the response | -| [headers](./kibana-plugin-core-server.onpreresponserender.headers.md) | ResponseHeaders | additional headers to attach to the response | +| [body](./kibana-plugin-core-server.onpreresponserender.body.md) | string | the body to use in the response | +| [headers?](./kibana-plugin-core-server.onpreresponserender.headers.md) | ResponseHeaders | (Optional) additional headers to attach to the response | diff --git a/docs/development/core/server/kibana-plugin-core-server.onpreresponsetoolkit.md b/docs/development/core/server/kibana-plugin-core-server.onpreresponsetoolkit.md index 14070038132dac..197b7b692e7341 100644 --- a/docs/development/core/server/kibana-plugin-core-server.onpreresponsetoolkit.md +++ b/docs/development/core/server/kibana-plugin-core-server.onpreresponsetoolkit.md @@ -16,6 +16,6 @@ export interface OnPreResponseToolkit | Property | Type | Description | | --- | --- | --- | -| [next](./kibana-plugin-core-server.onpreresponsetoolkit.next.md) | (responseExtensions?: OnPreResponseExtensions) => OnPreResponseResult | To pass request to the next handler | -| [render](./kibana-plugin-core-server.onpreresponsetoolkit.render.md) | (responseRender: OnPreResponseRender) => OnPreResponseResult | To override the response with a different body | +| [next](./kibana-plugin-core-server.onpreresponsetoolkit.next.md) | (responseExtensions?: OnPreResponseExtensions) => OnPreResponseResult | To pass request to the next handler | +| [render](./kibana-plugin-core-server.onpreresponsetoolkit.render.md) | (responseRender: OnPreResponseRender) => OnPreResponseResult | To override the response with a different body | diff --git a/docs/development/core/server/kibana-plugin-core-server.onpreroutingtoolkit.md b/docs/development/core/server/kibana-plugin-core-server.onpreroutingtoolkit.md index c564896b46a27e..e3bdeb3c451c4d 100644 --- a/docs/development/core/server/kibana-plugin-core-server.onpreroutingtoolkit.md +++ b/docs/development/core/server/kibana-plugin-core-server.onpreroutingtoolkit.md @@ -16,6 +16,6 @@ export interface OnPreRoutingToolkit | Property | Type | Description | | --- | --- | --- | -| [next](./kibana-plugin-core-server.onpreroutingtoolkit.next.md) | () => OnPreRoutingResult | To pass request to the next handler | -| [rewriteUrl](./kibana-plugin-core-server.onpreroutingtoolkit.rewriteurl.md) | (url: string) => OnPreRoutingResult | Rewrite requested resources url before is was authenticated and routed to a handler | +| [next](./kibana-plugin-core-server.onpreroutingtoolkit.next.md) | () => OnPreRoutingResult | To pass request to the next handler | +| [rewriteUrl](./kibana-plugin-core-server.onpreroutingtoolkit.rewriteurl.md) | (url: string) => OnPreRoutingResult | Rewrite requested resources url before is was authenticated and routed to a handler | diff --git a/docs/development/core/server/kibana-plugin-core-server.opsmetrics.md b/docs/development/core/server/kibana-plugin-core-server.opsmetrics.md index 4774215cef071d..dcecfd35a8d2d5 100644 --- a/docs/development/core/server/kibana-plugin-core-server.opsmetrics.md +++ b/docs/development/core/server/kibana-plugin-core-server.opsmetrics.md @@ -16,11 +16,11 @@ export interface OpsMetrics | Property | Type | Description | | --- | --- | --- | -| [collected\_at](./kibana-plugin-core-server.opsmetrics.collected_at.md) | Date | Time metrics were recorded at. | -| [concurrent\_connections](./kibana-plugin-core-server.opsmetrics.concurrent_connections.md) | OpsServerMetrics['concurrent_connections'] | number of current concurrent connections to the server | -| [os](./kibana-plugin-core-server.opsmetrics.os.md) | OpsOsMetrics | OS related metrics | -| [process](./kibana-plugin-core-server.opsmetrics.process.md) | OpsProcessMetrics | Process related metrics. | -| [processes](./kibana-plugin-core-server.opsmetrics.processes.md) | OpsProcessMetrics[] | Process related metrics. Reports an array of objects for each kibana pid. | -| [requests](./kibana-plugin-core-server.opsmetrics.requests.md) | OpsServerMetrics['requests'] | server requests stats | -| [response\_times](./kibana-plugin-core-server.opsmetrics.response_times.md) | OpsServerMetrics['response_times'] | server response time stats | +| [collected\_at](./kibana-plugin-core-server.opsmetrics.collected_at.md) | Date | Time metrics were recorded at. | +| [concurrent\_connections](./kibana-plugin-core-server.opsmetrics.concurrent_connections.md) | OpsServerMetrics\['concurrent\_connections'\] | number of current concurrent connections to the server | +| [os](./kibana-plugin-core-server.opsmetrics.os.md) | OpsOsMetrics | OS related metrics | +| [process](./kibana-plugin-core-server.opsmetrics.process.md) | OpsProcessMetrics | Process related metrics. | +| [processes](./kibana-plugin-core-server.opsmetrics.processes.md) | OpsProcessMetrics\[\] | Process related metrics. Reports an array of objects for each kibana pid. | +| [requests](./kibana-plugin-core-server.opsmetrics.requests.md) | OpsServerMetrics\['requests'\] | server requests stats | +| [response\_times](./kibana-plugin-core-server.opsmetrics.response_times.md) | OpsServerMetrics\['response\_times'\] | server response time stats | diff --git a/docs/development/core/server/kibana-plugin-core-server.opsosmetrics.md b/docs/development/core/server/kibana-plugin-core-server.opsosmetrics.md index 89386085311394..08f205d48dd095 100644 --- a/docs/development/core/server/kibana-plugin-core-server.opsosmetrics.md +++ b/docs/development/core/server/kibana-plugin-core-server.opsosmetrics.md @@ -16,13 +16,13 @@ export interface OpsOsMetrics | Property | Type | Description | | --- | --- | --- | -| [cpu](./kibana-plugin-core-server.opsosmetrics.cpu.md) | {
control_group: string;
cfs_period_micros: number;
cfs_quota_micros: number;
stat: {
number_of_elapsed_periods: number;
number_of_times_throttled: number;
time_throttled_nanos: number;
};
} | cpu cgroup metrics, undefined when not running in a cgroup | -| [cpuacct](./kibana-plugin-core-server.opsosmetrics.cpuacct.md) | {
control_group: string;
usage_nanos: number;
} | cpu accounting metrics, undefined when not running in a cgroup | -| [distro](./kibana-plugin-core-server.opsosmetrics.distro.md) | string | The os distrib. Only present for linux platforms | -| [distroRelease](./kibana-plugin-core-server.opsosmetrics.distrorelease.md) | string | The os distrib release, prefixed by the os distrib. Only present for linux platforms | -| [load](./kibana-plugin-core-server.opsosmetrics.load.md) | {
'1m': number;
'5m': number;
'15m': number;
} | cpu load metrics | -| [memory](./kibana-plugin-core-server.opsosmetrics.memory.md) | {
total_in_bytes: number;
free_in_bytes: number;
used_in_bytes: number;
} | system memory usage metrics | -| [platform](./kibana-plugin-core-server.opsosmetrics.platform.md) | NodeJS.Platform | The os platform | -| [platformRelease](./kibana-plugin-core-server.opsosmetrics.platformrelease.md) | string | The os platform release, prefixed by the platform name | -| [uptime\_in\_millis](./kibana-plugin-core-server.opsosmetrics.uptime_in_millis.md) | number | the OS uptime | +| [cpu?](./kibana-plugin-core-server.opsosmetrics.cpu.md) | { control\_group: string; cfs\_period\_micros: number; cfs\_quota\_micros: number; stat: { number\_of\_elapsed\_periods: number; number\_of\_times\_throttled: number; time\_throttled\_nanos: number; }; } | (Optional) cpu cgroup metrics, undefined when not running in a cgroup | +| [cpuacct?](./kibana-plugin-core-server.opsosmetrics.cpuacct.md) | { control\_group: string; usage\_nanos: number; } | (Optional) cpu accounting metrics, undefined when not running in a cgroup | +| [distro?](./kibana-plugin-core-server.opsosmetrics.distro.md) | string | (Optional) The os distrib. Only present for linux platforms | +| [distroRelease?](./kibana-plugin-core-server.opsosmetrics.distrorelease.md) | string | (Optional) The os distrib release, prefixed by the os distrib. Only present for linux platforms | +| [load](./kibana-plugin-core-server.opsosmetrics.load.md) | { '1m': number; '5m': number; '15m': number; } | cpu load metrics | +| [memory](./kibana-plugin-core-server.opsosmetrics.memory.md) | { total\_in\_bytes: number; free\_in\_bytes: number; used\_in\_bytes: number; } | system memory usage metrics | +| [platform](./kibana-plugin-core-server.opsosmetrics.platform.md) | NodeJS.Platform | The os platform | +| [platformRelease](./kibana-plugin-core-server.opsosmetrics.platformrelease.md) | string | The os platform release, prefixed by the platform name | +| [uptime\_in\_millis](./kibana-plugin-core-server.opsosmetrics.uptime_in_millis.md) | number | the OS uptime | diff --git a/docs/development/core/server/kibana-plugin-core-server.opsprocessmetrics.md b/docs/development/core/server/kibana-plugin-core-server.opsprocessmetrics.md index 198b668afca60b..43a4333d7bd2ce 100644 --- a/docs/development/core/server/kibana-plugin-core-server.opsprocessmetrics.md +++ b/docs/development/core/server/kibana-plugin-core-server.opsprocessmetrics.md @@ -16,9 +16,9 @@ export interface OpsProcessMetrics | Property | Type | Description | | --- | --- | --- | -| [event\_loop\_delay\_histogram](./kibana-plugin-core-server.opsprocessmetrics.event_loop_delay_histogram.md) | IntervalHistogram | node event loop delay histogram since last collection | -| [event\_loop\_delay](./kibana-plugin-core-server.opsprocessmetrics.event_loop_delay.md) | number | mean event loop delay since last collection | -| [memory](./kibana-plugin-core-server.opsprocessmetrics.memory.md) | {
heap: {
total_in_bytes: number;
used_in_bytes: number;
size_limit: number;
};
resident_set_size_in_bytes: number;
} | process memory usage | -| [pid](./kibana-plugin-core-server.opsprocessmetrics.pid.md) | number | pid of the kibana process | -| [uptime\_in\_millis](./kibana-plugin-core-server.opsprocessmetrics.uptime_in_millis.md) | number | uptime of the kibana process | +| [event\_loop\_delay\_histogram](./kibana-plugin-core-server.opsprocessmetrics.event_loop_delay_histogram.md) | IntervalHistogram | node event loop delay histogram since last collection | +| [event\_loop\_delay](./kibana-plugin-core-server.opsprocessmetrics.event_loop_delay.md) | number | mean event loop delay since last collection | +| [memory](./kibana-plugin-core-server.opsprocessmetrics.memory.md) | { heap: { total\_in\_bytes: number; used\_in\_bytes: number; size\_limit: number; }; resident\_set\_size\_in\_bytes: number; } | process memory usage | +| [pid](./kibana-plugin-core-server.opsprocessmetrics.pid.md) | number | pid of the kibana process | +| [uptime\_in\_millis](./kibana-plugin-core-server.opsprocessmetrics.uptime_in_millis.md) | number | uptime of the kibana process | diff --git a/docs/development/core/server/kibana-plugin-core-server.opsservermetrics.md b/docs/development/core/server/kibana-plugin-core-server.opsservermetrics.md index ad6f64600a96e9..ddabbd124627bc 100644 --- a/docs/development/core/server/kibana-plugin-core-server.opsservermetrics.md +++ b/docs/development/core/server/kibana-plugin-core-server.opsservermetrics.md @@ -16,7 +16,7 @@ export interface OpsServerMetrics | Property | Type | Description | | --- | --- | --- | -| [concurrent\_connections](./kibana-plugin-core-server.opsservermetrics.concurrent_connections.md) | number | number of current concurrent connections to the server | -| [requests](./kibana-plugin-core-server.opsservermetrics.requests.md) | {
disconnects: number;
total: number;
statusCodes: Record<number, number>;
} | server requests stats | -| [response\_times](./kibana-plugin-core-server.opsservermetrics.response_times.md) | {
avg_in_millis: number;
max_in_millis: number;
} | server response time stats | +| [concurrent\_connections](./kibana-plugin-core-server.opsservermetrics.concurrent_connections.md) | number | number of current concurrent connections to the server | +| [requests](./kibana-plugin-core-server.opsservermetrics.requests.md) | { disconnects: number; total: number; statusCodes: Record<number, number>; } | server requests stats | +| [response\_times](./kibana-plugin-core-server.opsservermetrics.response_times.md) | { avg\_in\_millis: number; max\_in\_millis: number; } | server response time stats | diff --git a/docs/development/core/server/kibana-plugin-core-server.plugin.md b/docs/development/core/server/kibana-plugin-core-server.plugin_2.md similarity index 57% rename from docs/development/core/server/kibana-plugin-core-server.plugin.md rename to docs/development/core/server/kibana-plugin-core-server.plugin_2.md index b1fce06d46f3a7..79dbbb56c86fd3 100644 --- a/docs/development/core/server/kibana-plugin-core-server.plugin.md +++ b/docs/development/core/server/kibana-plugin-core-server.plugin_2.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [Plugin](./kibana-plugin-core-server.plugin.md) +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [Plugin\_2](./kibana-plugin-core-server.plugin_2.md) -## Plugin interface +## Plugin\_2 interface The interface that should be returned by a `PluginInitializer` for a `standard` plugin. @@ -16,7 +16,7 @@ export interface Plugin(Optional) | diff --git a/docs/development/core/server/kibana-plugin-core-server.plugin.setup.md b/docs/development/core/server/kibana-plugin-core-server.plugin_2.setup.md similarity index 57% rename from docs/development/core/server/kibana-plugin-core-server.plugin.setup.md rename to docs/development/core/server/kibana-plugin-core-server.plugin_2.setup.md index a8b0aae28d251b..cedce40b580005 100644 --- a/docs/development/core/server/kibana-plugin-core-server.plugin.setup.md +++ b/docs/development/core/server/kibana-plugin-core-server.plugin_2.setup.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [Plugin](./kibana-plugin-core-server.plugin.md) > [setup](./kibana-plugin-core-server.plugin.setup.md) +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [Plugin\_2](./kibana-plugin-core-server.plugin_2.md) > [setup](./kibana-plugin-core-server.plugin_2.setup.md) -## Plugin.setup() method +## Plugin\_2.setup() method Signature: @@ -14,10 +14,10 @@ setup(core: CoreSetup, plugins: TPluginsSetup): TSetup; | Parameter | Type | Description | | --- | --- | --- | -| core | CoreSetup | | -| plugins | TPluginsSetup | | +| core | CoreSetup | | +| plugins | TPluginsSetup | | Returns: -`TSetup` +TSetup diff --git a/docs/development/core/server/kibana-plugin-core-server.plugin.start.md b/docs/development/core/server/kibana-plugin-core-server.plugin_2.start.md similarity index 57% rename from docs/development/core/server/kibana-plugin-core-server.plugin.start.md rename to docs/development/core/server/kibana-plugin-core-server.plugin_2.start.md index 851f84474fe11f..08eb5431a2cf27 100644 --- a/docs/development/core/server/kibana-plugin-core-server.plugin.start.md +++ b/docs/development/core/server/kibana-plugin-core-server.plugin_2.start.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [Plugin](./kibana-plugin-core-server.plugin.md) > [start](./kibana-plugin-core-server.plugin.start.md) +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [Plugin\_2](./kibana-plugin-core-server.plugin_2.md) > [start](./kibana-plugin-core-server.plugin_2.start.md) -## Plugin.start() method +## Plugin\_2.start() method Signature: @@ -14,10 +14,10 @@ start(core: CoreStart, plugins: TPluginsStart): TStart; | Parameter | Type | Description | | --- | --- | --- | -| core | CoreStart | | -| plugins | TPluginsStart | | +| core | CoreStart | | +| plugins | TPluginsStart | | Returns: -`TStart` +TStart diff --git a/docs/development/core/server/kibana-plugin-core-server.plugin.stop.md b/docs/development/core/server/kibana-plugin-core-server.plugin_2.stop.md similarity index 56% rename from docs/development/core/server/kibana-plugin-core-server.plugin.stop.md rename to docs/development/core/server/kibana-plugin-core-server.plugin_2.stop.md index 5396e3d9c59f24..5b62a5e82b2ed7 100644 --- a/docs/development/core/server/kibana-plugin-core-server.plugin.stop.md +++ b/docs/development/core/server/kibana-plugin-core-server.plugin_2.stop.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [Plugin](./kibana-plugin-core-server.plugin.md) > [stop](./kibana-plugin-core-server.plugin.stop.md) +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [Plugin\_2](./kibana-plugin-core-server.plugin_2.md) > [stop](./kibana-plugin-core-server.plugin_2.stop.md) -## Plugin.stop() method +## Plugin\_2.stop() method Signature: @@ -11,5 +11,5 @@ stop?(): void; ``` Returns: -`void` +void diff --git a/docs/development/core/server/kibana-plugin-core-server.pluginconfigdescriptor.md b/docs/development/core/server/kibana-plugin-core-server.pluginconfigdescriptor.md index 80e807a1361fd8..b9cf0eea3362d3 100644 --- a/docs/development/core/server/kibana-plugin-core-server.pluginconfigdescriptor.md +++ b/docs/development/core/server/kibana-plugin-core-server.pluginconfigdescriptor.md @@ -37,15 +37,14 @@ export const config: PluginConfigDescriptor = { unused('deprecatedProperty'), ], }; - ``` ## Properties | Property | Type | Description | | --- | --- | --- | -| [deprecations](./kibana-plugin-core-server.pluginconfigdescriptor.deprecations.md) | ConfigDeprecationProvider | Provider for the to apply to the plugin configuration. | -| [exposeToBrowser](./kibana-plugin-core-server.pluginconfigdescriptor.exposetobrowser.md) | {
[P in keyof T]?: boolean;
} | List of configuration properties that will be available on the client-side plugin. | -| [exposeToUsage](./kibana-plugin-core-server.pluginconfigdescriptor.exposetousage.md) | MakeUsageFromSchema<T> | Expose non-default configs to usage collection to be sent via telemetry. set a config to true to report the actual changed config value. set a config to false to report the changed config value as \[redacted\].All changed configs except booleans and numbers will be reported as \[redacted\] unless otherwise specified.[MakeUsageFromSchema](./kibana-plugin-core-server.makeusagefromschema.md) | -| [schema](./kibana-plugin-core-server.pluginconfigdescriptor.schema.md) | PluginConfigSchema<T> | Schema to use to validate the plugin configuration.[PluginConfigSchema](./kibana-plugin-core-server.pluginconfigschema.md) | +| [deprecations?](./kibana-plugin-core-server.pluginconfigdescriptor.deprecations.md) | ConfigDeprecationProvider | (Optional) Provider for the to apply to the plugin configuration. | +| [exposeToBrowser?](./kibana-plugin-core-server.pluginconfigdescriptor.exposetobrowser.md) | { \[P in keyof T\]?: boolean; } | (Optional) List of configuration properties that will be available on the client-side plugin. | +| [exposeToUsage?](./kibana-plugin-core-server.pluginconfigdescriptor.exposetousage.md) | MakeUsageFromSchema<T> | (Optional) Expose non-default configs to usage collection to be sent via telemetry. set a config to true to report the actual changed config value. set a config to false to report the changed config value as \[redacted\].All changed configs except booleans and numbers will be reported as \[redacted\] unless otherwise specified.[MakeUsageFromSchema](./kibana-plugin-core-server.makeusagefromschema.md) | +| [schema](./kibana-plugin-core-server.pluginconfigdescriptor.schema.md) | PluginConfigSchema<T> | Schema to use to validate the plugin configuration.[PluginConfigSchema](./kibana-plugin-core-server.pluginconfigschema.md) | diff --git a/docs/development/core/server/kibana-plugin-core-server.plugininitializercontext.logger.md b/docs/development/core/server/kibana-plugin-core-server.plugininitializercontext.logger.md index e5de046eccf1da..74bf5b0c1384ca 100644 --- a/docs/development/core/server/kibana-plugin-core-server.plugininitializercontext.logger.md +++ b/docs/development/core/server/kibana-plugin-core-server.plugininitializercontext.logger.md @@ -27,6 +27,5 @@ export class MyPlugin implements Plugin { // `mySubLogger` context: `plugins.myPlugin.sub` } } - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.plugininitializercontext.md b/docs/development/core/server/kibana-plugin-core-server.plugininitializercontext.md index 9bc9d6d83674c3..e2d115578d7c1d 100644 --- a/docs/development/core/server/kibana-plugin-core-server.plugininitializercontext.md +++ b/docs/development/core/server/kibana-plugin-core-server.plugininitializercontext.md @@ -16,8 +16,8 @@ export interface PluginInitializerContext | Property | Type | Description | | --- | --- | --- | -| [config](./kibana-plugin-core-server.plugininitializercontext.config.md) | {
legacy: {
globalConfig$: Observable<SharedGlobalConfig>;
get: () => SharedGlobalConfig;
};
create: <T = ConfigSchema>() => Observable<T>;
get: <T = ConfigSchema>() => T;
} | Accessors for the plugin's configuration | -| [env](./kibana-plugin-core-server.plugininitializercontext.env.md) | {
mode: EnvironmentMode;
packageInfo: Readonly<PackageInfo>;
instanceUuid: string;
configs: readonly string[];
} | | -| [logger](./kibana-plugin-core-server.plugininitializercontext.logger.md) | LoggerFactory | instance already bound to the plugin's logging context | -| [opaqueId](./kibana-plugin-core-server.plugininitializercontext.opaqueid.md) | PluginOpaqueId | | +| [config](./kibana-plugin-core-server.plugininitializercontext.config.md) | { legacy: { globalConfig$: Observable<SharedGlobalConfig>; get: () => SharedGlobalConfig; }; create: <T = ConfigSchema>() => Observable<T>; get: <T = ConfigSchema>() => T; } | Accessors for the plugin's configuration | +| [env](./kibana-plugin-core-server.plugininitializercontext.env.md) | { mode: EnvironmentMode; packageInfo: Readonly<PackageInfo>; instanceUuid: string; configs: readonly string\[\]; } | | +| [logger](./kibana-plugin-core-server.plugininitializercontext.logger.md) | LoggerFactory | instance already bound to the plugin's logging context | +| [opaqueId](./kibana-plugin-core-server.plugininitializercontext.opaqueid.md) | PluginOpaqueId | | diff --git a/docs/development/core/server/kibana-plugin-core-server.pluginmanifest.md b/docs/development/core/server/kibana-plugin-core-server.pluginmanifest.md index e82599c11f51ac..4c7c63b791a790 100644 --- a/docs/development/core/server/kibana-plugin-core-server.pluginmanifest.md +++ b/docs/development/core/server/kibana-plugin-core-server.pluginmanifest.md @@ -20,18 +20,18 @@ Should never be used in code outside of Core but is exported for documentation p | Property | Type | Description | | --- | --- | --- | -| [configPath](./kibana-plugin-core-server.pluginmanifest.configpath.md) | ConfigPath | Root used by the plugin, defaults to "id" in snake\_case format. | -| [description](./kibana-plugin-core-server.pluginmanifest.description.md) | string | TODO: make required once all plugins specify this. A brief description of what this plugin does and any capabilities it provides. | -| [extraPublicDirs](./kibana-plugin-core-server.pluginmanifest.extrapublicdirs.md) | string[] | Specifies directory names that can be imported by other ui-plugins built using the same instance of the @kbn/optimizer. A temporary measure we plan to replace with better mechanisms for sharing static code between plugins | -| [id](./kibana-plugin-core-server.pluginmanifest.id.md) | PluginName | Identifier of the plugin. Must be a string in camelCase. Part of a plugin public contract. Other plugins leverage it to access plugin API, navigate to the plugin, etc. | -| [kibanaVersion](./kibana-plugin-core-server.pluginmanifest.kibanaversion.md) | string | The version of Kibana the plugin is compatible with, defaults to "version". | -| [optionalPlugins](./kibana-plugin-core-server.pluginmanifest.optionalplugins.md) | readonly PluginName[] | An optional list of the other plugins that if installed and enabled \*\*may be\*\* leveraged by this plugin for some additional functionality but otherwise are not required for this plugin to work properly. | -| [owner](./kibana-plugin-core-server.pluginmanifest.owner.md) | {
readonly name: string;
readonly githubTeam?: string;
} | | -| [requiredBundles](./kibana-plugin-core-server.pluginmanifest.requiredbundles.md) | readonly string[] | List of plugin ids that this plugin's UI code imports modules from that are not in requiredPlugins. | -| [requiredPlugins](./kibana-plugin-core-server.pluginmanifest.requiredplugins.md) | readonly PluginName[] | An optional list of the other plugins that \*\*must be\*\* installed and enabled for this plugin to function properly. | -| [server](./kibana-plugin-core-server.pluginmanifest.server.md) | boolean | Specifies whether plugin includes some server-side specific functionality. | -| [serviceFolders](./kibana-plugin-core-server.pluginmanifest.servicefolders.md) | readonly string[] | Only used for the automatically generated API documentation. Specifying service folders will cause your plugin API reference to be broken up into sub sections. | -| [type](./kibana-plugin-core-server.pluginmanifest.type.md) | PluginType | Type of the plugin, defaults to standard. | -| [ui](./kibana-plugin-core-server.pluginmanifest.ui.md) | boolean | Specifies whether plugin includes some client/browser specific functionality that should be included into client bundle via public/ui_plugin.js file. | -| [version](./kibana-plugin-core-server.pluginmanifest.version.md) | string | Version of the plugin. | +| [configPath](./kibana-plugin-core-server.pluginmanifest.configpath.md) | ConfigPath | Root used by the plugin, defaults to "id" in snake\_case format. | +| [description?](./kibana-plugin-core-server.pluginmanifest.description.md) | string | (Optional) TODO: make required once all plugins specify this. A brief description of what this plugin does and any capabilities it provides. | +| [extraPublicDirs?](./kibana-plugin-core-server.pluginmanifest.extrapublicdirs.md) | string\[\] | (Optional) Specifies directory names that can be imported by other ui-plugins built using the same instance of the @kbn/optimizer. A temporary measure we plan to replace with better mechanisms for sharing static code between plugins | +| [id](./kibana-plugin-core-server.pluginmanifest.id.md) | PluginName | Identifier of the plugin. Must be a string in camelCase. Part of a plugin public contract. Other plugins leverage it to access plugin API, navigate to the plugin, etc. | +| [kibanaVersion](./kibana-plugin-core-server.pluginmanifest.kibanaversion.md) | string | The version of Kibana the plugin is compatible with, defaults to "version". | +| [optionalPlugins](./kibana-plugin-core-server.pluginmanifest.optionalplugins.md) | readonly PluginName\[\] | An optional list of the other plugins that if installed and enabled \*\*may be\*\* leveraged by this plugin for some additional functionality but otherwise are not required for this plugin to work properly. | +| [owner](./kibana-plugin-core-server.pluginmanifest.owner.md) | { readonly name: string; readonly githubTeam?: string; } | | +| [requiredBundles](./kibana-plugin-core-server.pluginmanifest.requiredbundles.md) | readonly string\[\] | List of plugin ids that this plugin's UI code imports modules from that are not in requiredPlugins. | +| [requiredPlugins](./kibana-plugin-core-server.pluginmanifest.requiredplugins.md) | readonly PluginName\[\] | An optional list of the other plugins that \*\*must be\*\* installed and enabled for this plugin to function properly. | +| [server](./kibana-plugin-core-server.pluginmanifest.server.md) | boolean | Specifies whether plugin includes some server-side specific functionality. | +| [serviceFolders?](./kibana-plugin-core-server.pluginmanifest.servicefolders.md) | readonly string\[\] | (Optional) Only used for the automatically generated API documentation. Specifying service folders will cause your plugin API reference to be broken up into sub sections. | +| [type](./kibana-plugin-core-server.pluginmanifest.type.md) | PluginType | Type of the plugin, defaults to standard. | +| [ui](./kibana-plugin-core-server.pluginmanifest.ui.md) | boolean | Specifies whether plugin includes some client/browser specific functionality that should be included into client bundle via public/ui_plugin.js file. | +| [version](./kibana-plugin-core-server.pluginmanifest.version.md) | string | Version of the plugin. | diff --git a/docs/development/core/server/kibana-plugin-core-server.prebootplugin.md b/docs/development/core/server/kibana-plugin-core-server.prebootplugin.md index df851daab78068..8bbb042965dde8 100644 --- a/docs/development/core/server/kibana-plugin-core-server.prebootplugin.md +++ b/docs/development/core/server/kibana-plugin-core-server.prebootplugin.md @@ -17,5 +17,5 @@ export interface PrebootPlugin(Optional) | diff --git a/docs/development/core/server/kibana-plugin-core-server.prebootplugin.setup.md b/docs/development/core/server/kibana-plugin-core-server.prebootplugin.setup.md index 0ee2a26293e980..f55819eeaca572 100644 --- a/docs/development/core/server/kibana-plugin-core-server.prebootplugin.setup.md +++ b/docs/development/core/server/kibana-plugin-core-server.prebootplugin.setup.md @@ -14,10 +14,10 @@ setup(core: CorePreboot, plugins: TPluginsSetup): TSetup; | Parameter | Type | Description | | --- | --- | --- | -| core | CorePreboot | | -| plugins | TPluginsSetup | | +| core | CorePreboot | | +| plugins | TPluginsSetup | | Returns: -`TSetup` +TSetup diff --git a/docs/development/core/server/kibana-plugin-core-server.prebootplugin.stop.md b/docs/development/core/server/kibana-plugin-core-server.prebootplugin.stop.md index 89566b2ae66878..c93dcb7709a110 100644 --- a/docs/development/core/server/kibana-plugin-core-server.prebootplugin.stop.md +++ b/docs/development/core/server/kibana-plugin-core-server.prebootplugin.stop.md @@ -11,5 +11,5 @@ stop?(): void; ``` Returns: -`void` +void diff --git a/docs/development/core/server/kibana-plugin-core-server.prebootservicepreboot.md b/docs/development/core/server/kibana-plugin-core-server.prebootservicepreboot.md index bf503499b6298d..c9c7c15ac3275b 100644 --- a/docs/development/core/server/kibana-plugin-core-server.prebootservicepreboot.md +++ b/docs/development/core/server/kibana-plugin-core-server.prebootservicepreboot.md @@ -22,7 +22,6 @@ core.preboot.holdSetupUntilResolved('Just waiting for 5 seconds', setTimeout(resolve, 5000); }) ); - ``` If the supplied `Promise` resolves to an object with the `shouldReloadConfig` property set to `true`, Kibana will also reload its configuration from disk. @@ -33,13 +32,12 @@ core.preboot.holdSetupUntilResolved('Just waiting for 5 seconds before reloading setTimeout(() => resolve({ shouldReloadConfig: true }), 5000); }) ); - ``` ## Properties | Property | Type | Description | | --- | --- | --- | -| [holdSetupUntilResolved](./kibana-plugin-core-server.prebootservicepreboot.holdsetupuntilresolved.md) | (reason: string, promise: Promise<{
shouldReloadConfig: boolean;
} | undefined>) => void | Registers a Promise as a precondition before Kibana can proceed to setup. This method can be invoked multiple times and from multiple preboot plugins. Kibana will proceed to setup only when all registered Promises instances are resolved, or it will shut down if any of them is rejected. | -| [isSetupOnHold](./kibana-plugin-core-server.prebootservicepreboot.issetuponhold.md) | () => boolean | Indicates whether Kibana is currently on hold and cannot proceed to setup yet. | +| [holdSetupUntilResolved](./kibana-plugin-core-server.prebootservicepreboot.holdsetupuntilresolved.md) | (reason: string, promise: Promise<{ shouldReloadConfig: boolean; } \| undefined>) => void | Registers a Promise as a precondition before Kibana can proceed to setup. This method can be invoked multiple times and from multiple preboot plugins. Kibana will proceed to setup only when all registered Promises instances are resolved, or it will shut down if any of them is rejected. | +| [isSetupOnHold](./kibana-plugin-core-server.prebootservicepreboot.issetuponhold.md) | () => boolean | Indicates whether Kibana is currently on hold and cannot proceed to setup yet. | diff --git a/docs/development/core/server/kibana-plugin-core-server.registerdeprecationsconfig.md b/docs/development/core/server/kibana-plugin-core-server.registerdeprecationsconfig.md index 444c2653512de1..b7787a1406319d 100644 --- a/docs/development/core/server/kibana-plugin-core-server.registerdeprecationsconfig.md +++ b/docs/development/core/server/kibana-plugin-core-server.registerdeprecationsconfig.md @@ -15,5 +15,5 @@ export interface RegisterDeprecationsConfig | Property | Type | Description | | --- | --- | --- | -| [getDeprecations](./kibana-plugin-core-server.registerdeprecationsconfig.getdeprecations.md) | (context: GetDeprecationsContext) => MaybePromise<DeprecationsDetails[]> | | +| [getDeprecations](./kibana-plugin-core-server.registerdeprecationsconfig.getdeprecations.md) | (context: GetDeprecationsContext) => MaybePromise<DeprecationsDetails\[\]> | | diff --git a/docs/development/core/server/kibana-plugin-core-server.requesthandler.md b/docs/development/core/server/kibana-plugin-core-server.requesthandler.md index d32ac4d80c337b..0ba0f72d7ab2f5 100644 --- a/docs/development/core/server/kibana-plugin-core-server.requesthandler.md +++ b/docs/development/core/server/kibana-plugin-core-server.requesthandler.md @@ -37,6 +37,5 @@ router.get( return response.ok(data); } ); - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.md b/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.md index 15a2e235fff29c..0d705c9daa3338 100644 --- a/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.md +++ b/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.md @@ -18,5 +18,5 @@ export interface RequestHandlerContext | Property | Type | Description | | --- | --- | --- | -| [core](./kibana-plugin-core-server.requesthandlercontext.core.md) | {
savedObjects: {
client: SavedObjectsClientContract;
typeRegistry: ISavedObjectTypeRegistry;
getClient: (options?: SavedObjectsClientProviderOptions) => SavedObjectsClientContract;
getExporter: (client: SavedObjectsClientContract) => ISavedObjectsExporter;
getImporter: (client: SavedObjectsClientContract) => ISavedObjectsImporter;
};
elasticsearch: {
client: IScopedClusterClient;
};
uiSettings: {
client: IUiSettingsClient;
};
deprecations: {
client: DeprecationsClient;
};
} | | +| [core](./kibana-plugin-core-server.requesthandlercontext.core.md) | { savedObjects: { client: SavedObjectsClientContract; typeRegistry: ISavedObjectTypeRegistry; getClient: (options?: SavedObjectsClientProviderOptions) => SavedObjectsClientContract; getExporter: (client: SavedObjectsClientContract) => ISavedObjectsExporter; getImporter: (client: SavedObjectsClientContract) => ISavedObjectsImporter; }; elasticsearch: { client: IScopedClusterClient; }; uiSettings: { client: IUiSettingsClient; }; deprecations: { client: DeprecationsClient; }; } | | diff --git a/docs/development/core/server/kibana-plugin-core-server.requesthandlerwrapper.md b/docs/development/core/server/kibana-plugin-core-server.requesthandlerwrapper.md index 76c7ee4f229027..6ae585b4eeb04e 100644 --- a/docs/development/core/server/kibana-plugin-core-server.requesthandlerwrapper.md +++ b/docs/development/core/server/kibana-plugin-core-server.requesthandlerwrapper.md @@ -22,6 +22,5 @@ export const wrapper: RequestHandlerWrapper = handler => { ... }; } - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.resolvecapabilitiesoptions.md b/docs/development/core/server/kibana-plugin-core-server.resolvecapabilitiesoptions.md index f118c34c9be0f7..e23d07d7683dee 100644 --- a/docs/development/core/server/kibana-plugin-core-server.resolvecapabilitiesoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.resolvecapabilitiesoptions.md @@ -16,5 +16,5 @@ export interface ResolveCapabilitiesOptions | Property | Type | Description | | --- | --- | --- | -| [useDefaultCapabilities](./kibana-plugin-core-server.resolvecapabilitiesoptions.usedefaultcapabilities.md) | boolean | Indicates if capability switchers are supposed to return a default set of capabilities. | +| [useDefaultCapabilities](./kibana-plugin-core-server.resolvecapabilitiesoptions.usedefaultcapabilities.md) | boolean | Indicates if capability switchers are supposed to return a default set of capabilities. | diff --git a/docs/development/core/server/kibana-plugin-core-server.routeconfig.md b/docs/development/core/server/kibana-plugin-core-server.routeconfig.md index b61ac23e68cb80..6297e2745cd31b 100644 --- a/docs/development/core/server/kibana-plugin-core-server.routeconfig.md +++ b/docs/development/core/server/kibana-plugin-core-server.routeconfig.md @@ -16,7 +16,7 @@ export interface RouteConfig | Property | Type | Description | | --- | --- | --- | -| [options](./kibana-plugin-core-server.routeconfig.options.md) | RouteConfigOptions<Method> | Additional route options [RouteConfigOptions](./kibana-plugin-core-server.routeconfigoptions.md). | -| [path](./kibana-plugin-core-server.routeconfig.path.md) | string | The endpoint \_within\_ the router path to register the route. | -| [validate](./kibana-plugin-core-server.routeconfig.validate.md) | RouteValidatorFullConfig<P, Q, B> | false | A schema created with @kbn/config-schema that every request will be validated against. | +| [options?](./kibana-plugin-core-server.routeconfig.options.md) | RouteConfigOptions<Method> | (Optional) Additional route options [RouteConfigOptions](./kibana-plugin-core-server.routeconfigoptions.md). | +| [path](./kibana-plugin-core-server.routeconfig.path.md) | string | The endpoint \_within\_ the router path to register the route. | +| [validate](./kibana-plugin-core-server.routeconfig.validate.md) | RouteValidatorFullConfig<P, Q, B> \| false | A schema created with @kbn/config-schema that every request will be validated against. | diff --git a/docs/development/core/server/kibana-plugin-core-server.routeconfig.validate.md b/docs/development/core/server/kibana-plugin-core-server.routeconfig.validate.md index 3bbabc04f25000..1f9cc216cad352 100644 --- a/docs/development/core/server/kibana-plugin-core-server.routeconfig.validate.md +++ b/docs/development/core/server/kibana-plugin-core-server.routeconfig.validate.md @@ -57,6 +57,5 @@ router.get({ console.log(req.params.id); // value myValidationLibrary.validate({ params: req.params }); }); - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.routeconfigoptions.md b/docs/development/core/server/kibana-plugin-core-server.routeconfigoptions.md index cf0fe32c14d1d3..2dcd8ee5420ab4 100644 --- a/docs/development/core/server/kibana-plugin-core-server.routeconfigoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.routeconfigoptions.md @@ -16,9 +16,9 @@ export interface RouteConfigOptions | Property | Type | Description | | --- | --- | --- | -| [authRequired](./kibana-plugin-core-server.routeconfigoptions.authrequired.md) | boolean | 'optional' | Defines authentication mode for a route: - true. A user has to have valid credentials to access a resource - false. A user can access a resource without any credentials. - 'optional'. A user can access a resource, and will be authenticated if provided credentials are valid. Can be useful when we grant access to a resource but want to identify a user if possible.Defaults to true if an auth mechanism is registered. | -| [body](./kibana-plugin-core-server.routeconfigoptions.body.md) | Method extends 'get' | 'options' ? undefined : RouteConfigOptionsBody | Additional body options [RouteConfigOptionsBody](./kibana-plugin-core-server.routeconfigoptionsbody.md). | -| [tags](./kibana-plugin-core-server.routeconfigoptions.tags.md) | readonly string[] | Additional metadata tag strings to attach to the route. | -| [timeout](./kibana-plugin-core-server.routeconfigoptions.timeout.md) | {
payload?: Method extends 'get' | 'options' ? undefined : number;
idleSocket?: number;
} | Defines per-route timeouts. | -| [xsrfRequired](./kibana-plugin-core-server.routeconfigoptions.xsrfrequired.md) | Method extends 'get' ? never : boolean | Defines xsrf protection requirements for a route: - true. Requires an incoming POST/PUT/DELETE request to contain kbn-xsrf header. - false. Disables xsrf protection.Set to true by default | +| [authRequired?](./kibana-plugin-core-server.routeconfigoptions.authrequired.md) | boolean \| 'optional' | (Optional) Defines authentication mode for a route: - true. A user has to have valid credentials to access a resource - false. A user can access a resource without any credentials. - 'optional'. A user can access a resource, and will be authenticated if provided credentials are valid. Can be useful when we grant access to a resource but want to identify a user if possible.Defaults to true if an auth mechanism is registered. | +| [body?](./kibana-plugin-core-server.routeconfigoptions.body.md) | Method extends 'get' \| 'options' ? undefined : RouteConfigOptionsBody | (Optional) Additional body options [RouteConfigOptionsBody](./kibana-plugin-core-server.routeconfigoptionsbody.md). | +| [tags?](./kibana-plugin-core-server.routeconfigoptions.tags.md) | readonly string\[\] | (Optional) Additional metadata tag strings to attach to the route. | +| [timeout?](./kibana-plugin-core-server.routeconfigoptions.timeout.md) | { payload?: Method extends 'get' \| 'options' ? undefined : number; idleSocket?: number; } | (Optional) Defines per-route timeouts. | +| [xsrfRequired?](./kibana-plugin-core-server.routeconfigoptions.xsrfrequired.md) | Method extends 'get' ? never : boolean | (Optional) Defines xsrf protection requirements for a route: - true. Requires an incoming POST/PUT/DELETE request to contain kbn-xsrf header. - false. Disables xsrf protection.Set to true by default | diff --git a/docs/development/core/server/kibana-plugin-core-server.routeconfigoptionsbody.md b/docs/development/core/server/kibana-plugin-core-server.routeconfigoptionsbody.md index d27c67891161a3..fdae03f7cd7c96 100644 --- a/docs/development/core/server/kibana-plugin-core-server.routeconfigoptionsbody.md +++ b/docs/development/core/server/kibana-plugin-core-server.routeconfigoptionsbody.md @@ -16,8 +16,8 @@ export interface RouteConfigOptionsBody | Property | Type | Description | | --- | --- | --- | -| [accepts](./kibana-plugin-core-server.routeconfigoptionsbody.accepts.md) | RouteContentType | RouteContentType[] | string | string[] | A string or an array of strings with the allowed mime types for the endpoint. Use this settings to limit the set of allowed mime types. Note that allowing additional mime types not listed above will not enable them to be parsed, and if parse is true, the request will result in an error response.Default value: allows parsing of the following mime types: \* application/json \* application/\*+json \* application/octet-stream \* application/x-www-form-urlencoded \* multipart/form-data \* text/\* | -| [maxBytes](./kibana-plugin-core-server.routeconfigoptionsbody.maxbytes.md) | number | Limits the size of incoming payloads to the specified byte count. Allowing very large payloads may cause the server to run out of memory.Default value: The one set in the kibana.yml config file under the parameter server.maxPayload. | -| [output](./kibana-plugin-core-server.routeconfigoptionsbody.output.md) | typeof validBodyOutput[number] | The processed payload format. The value must be one of: \* 'data' - the incoming payload is read fully into memory. If parse is true, the payload is parsed (JSON, form-decoded, multipart) based on the 'Content-Type' header. If parse is false, a raw Buffer is returned. \* 'stream' - the incoming payload is made available via a Stream.Readable interface. If the payload is 'multipart/form-data' and parse is true, field values are presented as text while files are provided as streams. File streams from a 'multipart/form-data' upload will also have a hapi property containing the filename and headers properties. Note that payload streams for multipart payloads are a synthetic interface created on top of the entire multipart content loaded into memory. To avoid loading large multipart payloads into memory, set parse to false and handle the multipart payload in the handler using a streaming parser (e.g. pez).Default value: 'data', unless no validation.body is provided in the route definition. In that case the default is 'stream' to alleviate memory pressure. | -| [parse](./kibana-plugin-core-server.routeconfigoptionsbody.parse.md) | boolean | 'gunzip' | Determines if the incoming payload is processed or presented raw. Available values: \* true - if the request 'Content-Type' matches the allowed mime types set by allow (for the whole payload as well as parts), the payload is converted into an object when possible. If the format is unknown, a Bad Request (400) error response is sent. Any known content encoding is decoded. \* false - the raw payload is returned unmodified. \* 'gunzip' - the raw payload is returned unmodified after any known content encoding is decoded.Default value: true, unless no validation.body is provided in the route definition. In that case the default is false to alleviate memory pressure. | +| [accepts?](./kibana-plugin-core-server.routeconfigoptionsbody.accepts.md) | RouteContentType \| RouteContentType\[\] \| string \| string\[\] | (Optional) A string or an array of strings with the allowed mime types for the endpoint. Use this settings to limit the set of allowed mime types. Note that allowing additional mime types not listed above will not enable them to be parsed, and if parse is true, the request will result in an error response.Default value: allows parsing of the following mime types: \* application/json \* application/\*+json \* application/octet-stream \* application/x-www-form-urlencoded \* multipart/form-data \* text/\* | +| [maxBytes?](./kibana-plugin-core-server.routeconfigoptionsbody.maxbytes.md) | number | (Optional) Limits the size of incoming payloads to the specified byte count. Allowing very large payloads may cause the server to run out of memory.Default value: The one set in the kibana.yml config file under the parameter server.maxPayload. | +| [output?](./kibana-plugin-core-server.routeconfigoptionsbody.output.md) | typeof validBodyOutput\[number\] | (Optional) The processed payload format. The value must be one of: \* 'data' - the incoming payload is read fully into memory. If parse is true, the payload is parsed (JSON, form-decoded, multipart) based on the 'Content-Type' header. If parse is false, a raw Buffer is returned. \* 'stream' - the incoming payload is made available via a Stream.Readable interface. If the payload is 'multipart/form-data' and parse is true, field values are presented as text while files are provided as streams. File streams from a 'multipart/form-data' upload will also have a hapi property containing the filename and headers properties. Note that payload streams for multipart payloads are a synthetic interface created on top of the entire multipart content loaded into memory. To avoid loading large multipart payloads into memory, set parse to false and handle the multipart payload in the handler using a streaming parser (e.g. pez).Default value: 'data', unless no validation.body is provided in the route definition. In that case the default is 'stream' to alleviate memory pressure. | +| [parse?](./kibana-plugin-core-server.routeconfigoptionsbody.parse.md) | boolean \| 'gunzip' | (Optional) Determines if the incoming payload is processed or presented raw. Available values: \* true - if the request 'Content-Type' matches the allowed mime types set by allow (for the whole payload as well as parts), the payload is converted into an object when possible. If the format is unknown, a Bad Request (400) error response is sent. Any known content encoding is decoded. \* false - the raw payload is returned unmodified. \* 'gunzip' - the raw payload is returned unmodified after any known content encoding is decoded.Default value: true, unless no validation.body is provided in the route definition. In that case the default is false to alleviate memory pressure. | diff --git a/docs/development/core/server/kibana-plugin-core-server.routevalidationerror._constructor_.md b/docs/development/core/server/kibana-plugin-core-server.routevalidationerror._constructor_.md index ddacc1f7af2e67..ad1a4bae0dab13 100644 --- a/docs/development/core/server/kibana-plugin-core-server.routevalidationerror._constructor_.md +++ b/docs/development/core/server/kibana-plugin-core-server.routevalidationerror._constructor_.md @@ -16,6 +16,6 @@ constructor(error: Error | string, path?: string[]); | Parameter | Type | Description | | --- | --- | --- | -| error | Error | string | | -| path | string[] | | +| error | Error \| string | | +| path | string\[\] | | diff --git a/docs/development/core/server/kibana-plugin-core-server.routevalidationerror.md b/docs/development/core/server/kibana-plugin-core-server.routevalidationerror.md index 037e53c32bbc04..60a47236b4be51 100644 --- a/docs/development/core/server/kibana-plugin-core-server.routevalidationerror.md +++ b/docs/development/core/server/kibana-plugin-core-server.routevalidationerror.md @@ -11,6 +11,7 @@ Error to return when the validation is not successful. ```typescript export declare class RouteValidationError extends SchemaTypeError ``` +Extends: SchemaTypeError ## Constructors diff --git a/docs/development/core/server/kibana-plugin-core-server.routevalidationfunction.md b/docs/development/core/server/kibana-plugin-core-server.routevalidationfunction.md index 3ee61a07987b87..e3fd33552f7df2 100644 --- a/docs/development/core/server/kibana-plugin-core-server.routevalidationfunction.md +++ b/docs/development/core/server/kibana-plugin-core-server.routevalidationfunction.md @@ -37,6 +37,5 @@ const myBodyValidation: RouteValidationFunction = (data, validat return badRequest('Wrong payload', ['body']); } } - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.routevalidationresultfactory.md b/docs/development/core/server/kibana-plugin-core-server.routevalidationresultfactory.md index eee77a91d73de8..69e8b5e73136ee 100644 --- a/docs/development/core/server/kibana-plugin-core-server.routevalidationresultfactory.md +++ b/docs/development/core/server/kibana-plugin-core-server.routevalidationresultfactory.md @@ -18,6 +18,6 @@ export interface RouteValidationResultFactory | Property | Type | Description | | --- | --- | --- | -| [badRequest](./kibana-plugin-core-server.routevalidationresultfactory.badrequest.md) | (error: Error | string, path?: string[]) => {
error: RouteValidationError;
} | | -| [ok](./kibana-plugin-core-server.routevalidationresultfactory.ok.md) | <T>(value: T) => {
value: T;
} | | +| [badRequest](./kibana-plugin-core-server.routevalidationresultfactory.badrequest.md) | (error: Error \| string, path?: string\[\]) => { error: RouteValidationError; } | | +| [ok](./kibana-plugin-core-server.routevalidationresultfactory.ok.md) | <T>(value: T) => { value: T; } | | diff --git a/docs/development/core/server/kibana-plugin-core-server.routevalidatorconfig.md b/docs/development/core/server/kibana-plugin-core-server.routevalidatorconfig.md index c8ed3612ec9f13..848bf6aa4b15e2 100644 --- a/docs/development/core/server/kibana-plugin-core-server.routevalidatorconfig.md +++ b/docs/development/core/server/kibana-plugin-core-server.routevalidatorconfig.md @@ -16,7 +16,7 @@ export interface RouteValidatorConfig | Property | Type | Description | | --- | --- | --- | -| [body](./kibana-plugin-core-server.routevalidatorconfig.body.md) | RouteValidationSpec<B> | Validation logic for the body payload | -| [params](./kibana-plugin-core-server.routevalidatorconfig.params.md) | RouteValidationSpec<P> | Validation logic for the URL params | -| [query](./kibana-plugin-core-server.routevalidatorconfig.query.md) | RouteValidationSpec<Q> | Validation logic for the Query params | +| [body?](./kibana-plugin-core-server.routevalidatorconfig.body.md) | RouteValidationSpec<B> | (Optional) Validation logic for the body payload | +| [params?](./kibana-plugin-core-server.routevalidatorconfig.params.md) | RouteValidationSpec<P> | (Optional) Validation logic for the URL params | +| [query?](./kibana-plugin-core-server.routevalidatorconfig.query.md) | RouteValidationSpec<Q> | (Optional) Validation logic for the Query params | diff --git a/docs/development/core/server/kibana-plugin-core-server.routevalidatoroptions.md b/docs/development/core/server/kibana-plugin-core-server.routevalidatoroptions.md index 0d9a1369c3c3b2..f054ca388762a3 100644 --- a/docs/development/core/server/kibana-plugin-core-server.routevalidatoroptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.routevalidatoroptions.md @@ -16,5 +16,5 @@ export interface RouteValidatorOptions | Property | Type | Description | | --- | --- | --- | -| [unsafe](./kibana-plugin-core-server.routevalidatoroptions.unsafe.md) | {
params?: boolean;
query?: boolean;
body?: boolean;
} | Set the unsafe config to avoid running some additional internal \*safe\* validations on top of your custom validation | +| [unsafe?](./kibana-plugin-core-server.routevalidatoroptions.unsafe.md) | { params?: boolean; query?: boolean; body?: boolean; } | (Optional) Set the unsafe config to avoid running some additional internal \*safe\* validations on top of your custom validation | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobject.md b/docs/development/core/server/kibana-plugin-core-server.savedobject.md index 4c62b359b284dd..cffb47659dc23a 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobject.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobject.md @@ -14,15 +14,15 @@ export interface SavedObject | Property | Type | Description | | --- | --- | --- | -| [attributes](./kibana-plugin-core-server.savedobject.attributes.md) | T | The data for a Saved Object is stored as an object in the attributes property. | -| [coreMigrationVersion](./kibana-plugin-core-server.savedobject.coremigrationversion.md) | string | A semver value that is used when upgrading objects between Kibana versions. | -| [error](./kibana-plugin-core-server.savedobject.error.md) | SavedObjectError | | -| [id](./kibana-plugin-core-server.savedobject.id.md) | string | The ID of this Saved Object, guaranteed to be unique for all objects of the same type | -| [migrationVersion](./kibana-plugin-core-server.savedobject.migrationversion.md) | SavedObjectsMigrationVersion | Information about the migrations that have been applied to this SavedObject. When Kibana starts up, KibanaMigrator detects outdated documents and migrates them based on this value. For each migration that has been applied, the plugin's name is used as a key and the latest migration version as the value. | -| [namespaces](./kibana-plugin-core-server.savedobject.namespaces.md) | string[] | Space(s) that this saved object exists in. This attribute is not used for "global" saved object types which are registered with namespaceType: 'agnostic'. | -| [originId](./kibana-plugin-core-server.savedobject.originid.md) | string | The ID of the saved object this originated from. This is set if this object's id was regenerated; that can happen during migration from a legacy single-namespace type, or during import. It is only set during migration or create operations. This is used during import to ensure that ID regeneration is deterministic, so saved objects will be overwritten if they are imported multiple times into a given space. | -| [references](./kibana-plugin-core-server.savedobject.references.md) | SavedObjectReference[] | A reference to another saved object. | -| [type](./kibana-plugin-core-server.savedobject.type.md) | string | The type of Saved Object. Each plugin can define it's own custom Saved Object types. | -| [updated\_at](./kibana-plugin-core-server.savedobject.updated_at.md) | string | Timestamp of the last time this document had been updated. | -| [version](./kibana-plugin-core-server.savedobject.version.md) | string | An opaque version number which changes on each successful write operation. Can be used for implementing optimistic concurrency control. | +| [attributes](./kibana-plugin-core-server.savedobject.attributes.md) | T | The data for a Saved Object is stored as an object in the attributes property. | +| [coreMigrationVersion?](./kibana-plugin-core-server.savedobject.coremigrationversion.md) | string | (Optional) A semver value that is used when upgrading objects between Kibana versions. | +| [error?](./kibana-plugin-core-server.savedobject.error.md) | SavedObjectError | (Optional) | +| [id](./kibana-plugin-core-server.savedobject.id.md) | string | The ID of this Saved Object, guaranteed to be unique for all objects of the same type | +| [migrationVersion?](./kibana-plugin-core-server.savedobject.migrationversion.md) | SavedObjectsMigrationVersion | (Optional) Information about the migrations that have been applied to this SavedObject. When Kibana starts up, KibanaMigrator detects outdated documents and migrates them based on this value. For each migration that has been applied, the plugin's name is used as a key and the latest migration version as the value. | +| [namespaces?](./kibana-plugin-core-server.savedobject.namespaces.md) | string\[\] | (Optional) Space(s) that this saved object exists in. This attribute is not used for "global" saved object types which are registered with namespaceType: 'agnostic'. | +| [originId?](./kibana-plugin-core-server.savedobject.originid.md) | string | (Optional) The ID of the saved object this originated from. This is set if this object's id was regenerated; that can happen during migration from a legacy single-namespace type, or during import. It is only set during migration or create operations. This is used during import to ensure that ID regeneration is deterministic, so saved objects will be overwritten if they are imported multiple times into a given space. | +| [references](./kibana-plugin-core-server.savedobject.references.md) | SavedObjectReference\[\] | A reference to another saved object. | +| [type](./kibana-plugin-core-server.savedobject.type.md) | string | The type of Saved Object. Each plugin can define it's own custom Saved Object types. | +| [updated\_at?](./kibana-plugin-core-server.savedobject.updated_at.md) | string | (Optional) Timestamp of the last time this document had been updated. | +| [version?](./kibana-plugin-core-server.savedobject.version.md) | string | (Optional) An opaque version number which changes on each successful write operation. Can be used for implementing optimistic concurrency control. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectexportbaseoptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectexportbaseoptions.md index cd0c352086425c..d2749cb85cd3a6 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectexportbaseoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectexportbaseoptions.md @@ -15,9 +15,9 @@ export interface SavedObjectExportBaseOptions | Property | Type | Description | | --- | --- | --- | -| [excludeExportDetails](./kibana-plugin-core-server.savedobjectexportbaseoptions.excludeexportdetails.md) | boolean | flag to not append [export details](./kibana-plugin-core-server.savedobjectsexportresultdetails.md) to the end of the export stream. | -| [includeNamespaces](./kibana-plugin-core-server.savedobjectexportbaseoptions.includenamespaces.md) | boolean | Flag to also include namespace information in the export stream. By default, namespace information is not included in exported objects. This is only intended to be used internally during copy-to-space operations, and it is not exposed as an option for the external HTTP route for exports. | -| [includeReferencesDeep](./kibana-plugin-core-server.savedobjectexportbaseoptions.includereferencesdeep.md) | boolean | flag to also include all related saved objects in the export stream. | -| [namespace](./kibana-plugin-core-server.savedobjectexportbaseoptions.namespace.md) | string | optional namespace to override the namespace used by the savedObjectsClient. | -| [request](./kibana-plugin-core-server.savedobjectexportbaseoptions.request.md) | KibanaRequest | The http request initiating the export. | +| [excludeExportDetails?](./kibana-plugin-core-server.savedobjectexportbaseoptions.excludeexportdetails.md) | boolean | (Optional) flag to not append [export details](./kibana-plugin-core-server.savedobjectsexportresultdetails.md) to the end of the export stream. | +| [includeNamespaces?](./kibana-plugin-core-server.savedobjectexportbaseoptions.includenamespaces.md) | boolean | (Optional) Flag to also include namespace information in the export stream. By default, namespace information is not included in exported objects. This is only intended to be used internally during copy-to-space operations, and it is not exposed as an option for the external HTTP route for exports. | +| [includeReferencesDeep?](./kibana-plugin-core-server.savedobjectexportbaseoptions.includereferencesdeep.md) | boolean | (Optional) flag to also include all related saved objects in the export stream. | +| [namespace?](./kibana-plugin-core-server.savedobjectexportbaseoptions.namespace.md) | string | (Optional) optional namespace to override the namespace used by the savedObjectsClient. | +| [request](./kibana-plugin-core-server.savedobjectexportbaseoptions.request.md) | KibanaRequest | The http request initiating the export. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectmigrationcontext.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectmigrationcontext.md index 21ca234fde185c..3a265cc8e1d425 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectmigrationcontext.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectmigrationcontext.md @@ -16,8 +16,8 @@ export interface SavedObjectMigrationContext | Property | Type | Description | | --- | --- | --- | -| [convertToMultiNamespaceTypeVersion](./kibana-plugin-core-server.savedobjectmigrationcontext.converttomultinamespacetypeversion.md) | string | The version in which this object type is being converted to a multi-namespace type | -| [isSingleNamespaceType](./kibana-plugin-core-server.savedobjectmigrationcontext.issinglenamespacetype.md) | boolean | Whether this is a single-namespace type or not | -| [log](./kibana-plugin-core-server.savedobjectmigrationcontext.log.md) | SavedObjectsMigrationLogger | logger instance to be used by the migration handler | -| [migrationVersion](./kibana-plugin-core-server.savedobjectmigrationcontext.migrationversion.md) | string | The migration version that this migration function is defined for | +| [convertToMultiNamespaceTypeVersion?](./kibana-plugin-core-server.savedobjectmigrationcontext.converttomultinamespacetypeversion.md) | string | (Optional) The version in which this object type is being converted to a multi-namespace type | +| [isSingleNamespaceType](./kibana-plugin-core-server.savedobjectmigrationcontext.issinglenamespacetype.md) | boolean | Whether this is a single-namespace type or not | +| [log](./kibana-plugin-core-server.savedobjectmigrationcontext.log.md) | SavedObjectsMigrationLogger | logger instance to be used by the migration handler | +| [migrationVersion](./kibana-plugin-core-server.savedobjectmigrationcontext.migrationversion.md) | string | The migration version that this migration function is defined for | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectmigrationfn.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectmigrationfn.md index a3294fb0a087ae..1c96c63a3d4fe2 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectmigrationfn.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectmigrationfn.md @@ -39,6 +39,5 @@ const migrateToV2: SavedObjectMigrationFn = }, }; }; - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectmigrationmap.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectmigrationmap.md index c07a41e28d45ba..64575d34bfb10f 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectmigrationmap.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectmigrationmap.md @@ -22,6 +22,5 @@ const migrationsMap: SavedObjectMigrationMap = { '1.0.0': migrateToV1, '2.1.0': migrateToV21 } - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectreference.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectreference.md index 1c8b580187395d..bf21b13acfcfc3 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectreference.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectreference.md @@ -16,7 +16,7 @@ export interface SavedObjectReference | Property | Type | Description | | --- | --- | --- | -| [id](./kibana-plugin-core-server.savedobjectreference.id.md) | string | | -| [name](./kibana-plugin-core-server.savedobjectreference.name.md) | string | | -| [type](./kibana-plugin-core-server.savedobjectreference.type.md) | string | | +| [id](./kibana-plugin-core-server.savedobjectreference.id.md) | string | | +| [name](./kibana-plugin-core-server.savedobjectreference.name.md) | string | | +| [type](./kibana-plugin-core-server.savedobjectreference.type.md) | string | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectreferencewithcontext.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectreferencewithcontext.md index 1f8b33c6e94e8d..8cdfbb4fde4807 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectreferencewithcontext.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectreferencewithcontext.md @@ -16,10 +16,10 @@ export interface SavedObjectReferenceWithContext | Property | Type | Description | | --- | --- | --- | -| [id](./kibana-plugin-core-server.savedobjectreferencewithcontext.id.md) | string | The ID of the referenced object | -| [inboundReferences](./kibana-plugin-core-server.savedobjectreferencewithcontext.inboundreferences.md) | Array<{
type: string;
id: string;
name: string;
}> | References to this object; note that this does not contain \_all inbound references everywhere for this object\_, it only contains inbound references for the scope of this operation | -| [isMissing](./kibana-plugin-core-server.savedobjectreferencewithcontext.ismissing.md) | boolean | Whether or not this object or reference is missing | -| [spaces](./kibana-plugin-core-server.savedobjectreferencewithcontext.spaces.md) | string[] | The space(s) that the referenced object exists in | -| [spacesWithMatchingAliases](./kibana-plugin-core-server.savedobjectreferencewithcontext.spaceswithmatchingaliases.md) | string[] | The space(s) that legacy URL aliases matching this type/id exist in | -| [type](./kibana-plugin-core-server.savedobjectreferencewithcontext.type.md) | string | The type of the referenced object | +| [id](./kibana-plugin-core-server.savedobjectreferencewithcontext.id.md) | string | The ID of the referenced object | +| [inboundReferences](./kibana-plugin-core-server.savedobjectreferencewithcontext.inboundreferences.md) | Array<{ type: string; id: string; name: string; }> | References to this object; note that this does not contain \_all inbound references everywhere for this object\_, it only contains inbound references for the scope of this operation | +| [isMissing?](./kibana-plugin-core-server.savedobjectreferencewithcontext.ismissing.md) | boolean | (Optional) Whether or not this object or reference is missing | +| [spaces](./kibana-plugin-core-server.savedobjectreferencewithcontext.spaces.md) | string\[\] | The space(s) that the referenced object exists in | +| [spacesWithMatchingAliases?](./kibana-plugin-core-server.savedobjectreferencewithcontext.spaceswithmatchingaliases.md) | string\[\] | (Optional) The space(s) that legacy URL aliases matching this type/id exist in | +| [type](./kibana-plugin-core-server.savedobjectreferencewithcontext.type.md) | string | The type of the referenced object | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsbaseoptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsbaseoptions.md index 72f07c42949d1e..6686ad7ca8badb 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsbaseoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsbaseoptions.md @@ -15,5 +15,5 @@ export interface SavedObjectsBaseOptions | Property | Type | Description | | --- | --- | --- | -| [namespace](./kibana-plugin-core-server.savedobjectsbaseoptions.namespace.md) | string | Specify the namespace for this operation | +| [namespace?](./kibana-plugin-core-server.savedobjectsbaseoptions.namespace.md) | string | (Optional) Specify the namespace for this operation | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkcreateobject.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkcreateobject.md index 463c3fe81b7029..441df5d50c612d 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkcreateobject.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkcreateobject.md @@ -15,13 +15,13 @@ export interface SavedObjectsBulkCreateObject | Property | Type | Description | | --- | --- | --- | -| [attributes](./kibana-plugin-core-server.savedobjectsbulkcreateobject.attributes.md) | T | | -| [coreMigrationVersion](./kibana-plugin-core-server.savedobjectsbulkcreateobject.coremigrationversion.md) | string | A semver value that is used when upgrading objects between Kibana versions. If undefined, this will be automatically set to the current Kibana version when the object is created. If this is set to a non-semver value, or it is set to a semver value greater than the current Kibana version, it will result in an error. | -| [id](./kibana-plugin-core-server.savedobjectsbulkcreateobject.id.md) | string | | -| [initialNamespaces](./kibana-plugin-core-server.savedobjectsbulkcreateobject.initialnamespaces.md) | string[] | Optional initial namespaces for the object to be created in. If this is defined, it will supersede the namespace ID that is in [SavedObjectsCreateOptions](./kibana-plugin-core-server.savedobjectscreateoptions.md).\* For shareable object types (registered with namespaceType: 'multiple'): this option can be used to specify one or more spaces, including the "All spaces" identifier ('*'). \* For isolated object types (registered with namespaceType: 'single' or namespaceType: 'multiple-isolated'): this option can only be used to specify a single space, and the "All spaces" identifier ('*') is not allowed. \* For global object types (registered with namespaceType: 'agnostic'): this option cannot be used. | -| [migrationVersion](./kibana-plugin-core-server.savedobjectsbulkcreateobject.migrationversion.md) | SavedObjectsMigrationVersion | Information about the migrations that have been applied to this SavedObject. When Kibana starts up, KibanaMigrator detects outdated documents and migrates them based on this value. For each migration that has been applied, the plugin's name is used as a key and the latest migration version as the value. | -| [originId](./kibana-plugin-core-server.savedobjectsbulkcreateobject.originid.md) | string | Optional ID of the original saved object, if this object's id was regenerated | -| [references](./kibana-plugin-core-server.savedobjectsbulkcreateobject.references.md) | SavedObjectReference[] | | -| [type](./kibana-plugin-core-server.savedobjectsbulkcreateobject.type.md) | string | | -| [version](./kibana-plugin-core-server.savedobjectsbulkcreateobject.version.md) | string | | +| [attributes](./kibana-plugin-core-server.savedobjectsbulkcreateobject.attributes.md) | T | | +| [coreMigrationVersion?](./kibana-plugin-core-server.savedobjectsbulkcreateobject.coremigrationversion.md) | string | (Optional) A semver value that is used when upgrading objects between Kibana versions. If undefined, this will be automatically set to the current Kibana version when the object is created. If this is set to a non-semver value, or it is set to a semver value greater than the current Kibana version, it will result in an error. | +| [id?](./kibana-plugin-core-server.savedobjectsbulkcreateobject.id.md) | string | (Optional) | +| [initialNamespaces?](./kibana-plugin-core-server.savedobjectsbulkcreateobject.initialnamespaces.md) | string\[\] | (Optional) Optional initial namespaces for the object to be created in. If this is defined, it will supersede the namespace ID that is in [SavedObjectsCreateOptions](./kibana-plugin-core-server.savedobjectscreateoptions.md).\* For shareable object types (registered with namespaceType: 'multiple'): this option can be used to specify one or more spaces, including the "All spaces" identifier ('*'). \* For isolated object types (registered with namespaceType: 'single' or namespaceType: 'multiple-isolated'): this option can only be used to specify a single space, and the "All spaces" identifier ('*') is not allowed. \* For global object types (registered with namespaceType: 'agnostic'): this option cannot be used. | +| [migrationVersion?](./kibana-plugin-core-server.savedobjectsbulkcreateobject.migrationversion.md) | SavedObjectsMigrationVersion | (Optional) Information about the migrations that have been applied to this SavedObject. When Kibana starts up, KibanaMigrator detects outdated documents and migrates them based on this value. For each migration that has been applied, the plugin's name is used as a key and the latest migration version as the value. | +| [originId?](./kibana-plugin-core-server.savedobjectsbulkcreateobject.originid.md) | string | (Optional) Optional ID of the original saved object, if this object's id was regenerated | +| [references?](./kibana-plugin-core-server.savedobjectsbulkcreateobject.references.md) | SavedObjectReference\[\] | (Optional) | +| [type](./kibana-plugin-core-server.savedobjectsbulkcreateobject.type.md) | string | | +| [version?](./kibana-plugin-core-server.savedobjectsbulkcreateobject.version.md) | string | (Optional) | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkgetobject.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkgetobject.md index 0ad5f1d66ee52e..0eb5b507a1f038 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkgetobject.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkgetobject.md @@ -15,8 +15,8 @@ export interface SavedObjectsBulkGetObject | Property | Type | Description | | --- | --- | --- | -| [fields](./kibana-plugin-core-server.savedobjectsbulkgetobject.fields.md) | string[] | SavedObject fields to include in the response | -| [id](./kibana-plugin-core-server.savedobjectsbulkgetobject.id.md) | string | | -| [namespaces](./kibana-plugin-core-server.savedobjectsbulkgetobject.namespaces.md) | string[] | Optional namespace(s) for the object to be retrieved in. If this is defined, it will supersede the namespace ID that is in the top-level options.\* For shareable object types (registered with namespaceType: 'multiple'): this option can be used to specify one or more spaces, including the "All spaces" identifier ('*'). \* For isolated object types (registered with namespaceType: 'single' or namespaceType: 'multiple-isolated'): this option can only be used to specify a single space, and the "All spaces" identifier ('*') is not allowed. \* For global object types (registered with namespaceType: 'agnostic'): this option cannot be used. | -| [type](./kibana-plugin-core-server.savedobjectsbulkgetobject.type.md) | string | | +| [fields?](./kibana-plugin-core-server.savedobjectsbulkgetobject.fields.md) | string\[\] | (Optional) SavedObject fields to include in the response | +| [id](./kibana-plugin-core-server.savedobjectsbulkgetobject.id.md) | string | | +| [namespaces?](./kibana-plugin-core-server.savedobjectsbulkgetobject.namespaces.md) | string\[\] | (Optional) Optional namespace(s) for the object to be retrieved in. If this is defined, it will supersede the namespace ID that is in the top-level options.\* For shareable object types (registered with namespaceType: 'multiple'): this option can be used to specify one or more spaces, including the "All spaces" identifier ('*'). \* For isolated object types (registered with namespaceType: 'single' or namespaceType: 'multiple-isolated'): this option can only be used to specify a single space, and the "All spaces" identifier ('*') is not allowed. \* For global object types (registered with namespaceType: 'agnostic'): this option cannot be used. | +| [type](./kibana-plugin-core-server.savedobjectsbulkgetobject.type.md) | string | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkresolveobject.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkresolveobject.md index 3960511b21434b..a81e18cf3593a6 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkresolveobject.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkresolveobject.md @@ -15,6 +15,6 @@ export interface SavedObjectsBulkResolveObject | Property | Type | Description | | --- | --- | --- | -| [id](./kibana-plugin-core-server.savedobjectsbulkresolveobject.id.md) | string | | -| [type](./kibana-plugin-core-server.savedobjectsbulkresolveobject.type.md) | string | | +| [id](./kibana-plugin-core-server.savedobjectsbulkresolveobject.id.md) | string | | +| [type](./kibana-plugin-core-server.savedobjectsbulkresolveobject.type.md) | string | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkresolveresponse.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkresolveresponse.md index 8384ecc1861f42..e280877d77cd6b 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkresolveresponse.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkresolveresponse.md @@ -15,5 +15,5 @@ export interface SavedObjectsBulkResolveResponse | Property | Type | Description | | --- | --- | --- | -| [resolved\_objects](./kibana-plugin-core-server.savedobjectsbulkresolveresponse.resolved_objects.md) | Array<SavedObjectsResolveResponse<T>> | | +| [resolved\_objects](./kibana-plugin-core-server.savedobjectsbulkresolveresponse.resolved_objects.md) | Array<SavedObjectsResolveResponse<T>> | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkresponse.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkresponse.md index bf08ae7816b93e..e47350e4bf8888 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkresponse.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkresponse.md @@ -15,5 +15,5 @@ export interface SavedObjectsBulkResponse | Property | Type | Description | | --- | --- | --- | -| [saved\_objects](./kibana-plugin-core-server.savedobjectsbulkresponse.saved_objects.md) | Array<SavedObject<T>> | | +| [saved\_objects](./kibana-plugin-core-server.savedobjectsbulkresponse.saved_objects.md) | Array<SavedObject<T>> | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkupdateobject.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkupdateobject.md index dc30400bbd7412..fa20d5d13d8f25 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkupdateobject.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkupdateobject.md @@ -10,13 +10,14 @@ ```typescript export interface SavedObjectsBulkUpdateObject extends Pick, 'version' | 'references'> ``` +Extends: Pick<SavedObjectsUpdateOptions<T>, 'version' \| 'references'> ## Properties | Property | Type | Description | | --- | --- | --- | -| [attributes](./kibana-plugin-core-server.savedobjectsbulkupdateobject.attributes.md) | Partial<T> | The data for a Saved Object is stored as an object in the attributes property. | -| [id](./kibana-plugin-core-server.savedobjectsbulkupdateobject.id.md) | string | The ID of this Saved Object, guaranteed to be unique for all objects of the same type | -| [namespace](./kibana-plugin-core-server.savedobjectsbulkupdateobject.namespace.md) | string | Optional namespace string to use when searching for this object. If this is defined, it will supersede the namespace ID that is in [SavedObjectsBulkUpdateOptions](./kibana-plugin-core-server.savedobjectsbulkupdateoptions.md).Note: the default namespace's string representation is 'default', and its ID representation is undefined. | -| [type](./kibana-plugin-core-server.savedobjectsbulkupdateobject.type.md) | string | The type of this Saved Object. Each plugin can define it's own custom Saved Object types. | +| [attributes](./kibana-plugin-core-server.savedobjectsbulkupdateobject.attributes.md) | Partial<T> | The data for a Saved Object is stored as an object in the attributes property. | +| [id](./kibana-plugin-core-server.savedobjectsbulkupdateobject.id.md) | string | The ID of this Saved Object, guaranteed to be unique for all objects of the same type | +| [namespace?](./kibana-plugin-core-server.savedobjectsbulkupdateobject.namespace.md) | string | (Optional) Optional namespace string to use when searching for this object. If this is defined, it will supersede the namespace ID that is in [SavedObjectsBulkUpdateOptions](./kibana-plugin-core-server.savedobjectsbulkupdateoptions.md).Note: the default namespace's string representation is 'default', and its ID representation is undefined. | +| [type](./kibana-plugin-core-server.savedobjectsbulkupdateobject.type.md) | string | The type of this Saved Object. Each plugin can define it's own custom Saved Object types. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkupdateoptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkupdateoptions.md index bf5d1fc536f949..97285b326dbae9 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkupdateoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkupdateoptions.md @@ -10,10 +10,11 @@ ```typescript export interface SavedObjectsBulkUpdateOptions extends SavedObjectsBaseOptions ``` +Extends: SavedObjectsBaseOptions ## Properties | Property | Type | Description | | --- | --- | --- | -| [refresh](./kibana-plugin-core-server.savedobjectsbulkupdateoptions.refresh.md) | MutatingOperationRefreshSetting | The Elasticsearch Refresh setting for this operation | +| [refresh?](./kibana-plugin-core-server.savedobjectsbulkupdateoptions.refresh.md) | MutatingOperationRefreshSetting | (Optional) The Elasticsearch Refresh setting for this operation | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkupdateresponse.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkupdateresponse.md index 361575b3b1ce23..e1a1af2da25cc3 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkupdateresponse.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsbulkupdateresponse.md @@ -15,5 +15,5 @@ export interface SavedObjectsBulkUpdateResponse | Property | Type | Description | | --- | --- | --- | -| [saved\_objects](./kibana-plugin-core-server.savedobjectsbulkupdateresponse.saved_objects.md) | Array<SavedObjectsUpdateResponse<T>> | | +| [saved\_objects](./kibana-plugin-core-server.savedobjectsbulkupdateresponse.saved_objects.md) | Array<SavedObjectsUpdateResponse<T>> | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscheckconflictsobject.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscheckconflictsobject.md index c327cc4a205516..af7d9ff74db250 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscheckconflictsobject.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectscheckconflictsobject.md @@ -15,6 +15,6 @@ export interface SavedObjectsCheckConflictsObject | Property | Type | Description | | --- | --- | --- | -| [id](./kibana-plugin-core-server.savedobjectscheckconflictsobject.id.md) | string | | -| [type](./kibana-plugin-core-server.savedobjectscheckconflictsobject.type.md) | string | | +| [id](./kibana-plugin-core-server.savedobjectscheckconflictsobject.id.md) | string | | +| [type](./kibana-plugin-core-server.savedobjectscheckconflictsobject.type.md) | string | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscheckconflictsresponse.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscheckconflictsresponse.md index 499398586e7dd8..68bbdbe67c2737 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscheckconflictsresponse.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectscheckconflictsresponse.md @@ -15,5 +15,5 @@ export interface SavedObjectsCheckConflictsResponse | Property | Type | Description | | --- | --- | --- | -| [errors](./kibana-plugin-core-server.savedobjectscheckconflictsresponse.errors.md) | Array<{
id: string;
type: string;
error: SavedObjectError;
}> | | +| [errors](./kibana-plugin-core-server.savedobjectscheckconflictsresponse.errors.md) | Array<{ id: string; type: string; error: SavedObjectError; }> | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.bulkcreate.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.bulkcreate.md index b175fe84fc4c33..a88d82ef49e7d9 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.bulkcreate.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.bulkcreate.md @@ -16,10 +16,10 @@ bulkCreate(objects: Array>, options | Parameter | Type | Description | | --- | --- | --- | -| objects | Array<SavedObjectsBulkCreateObject<T>> | | -| options | SavedObjectsCreateOptions | | +| objects | Array<SavedObjectsBulkCreateObject<T>> | | +| options | SavedObjectsCreateOptions | | Returns: -`Promise>` +Promise<SavedObjectsBulkResponse<T>> diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.bulkget.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.bulkget.md index 82cf65a78bcffb..077cb08843acc8 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.bulkget.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.bulkget.md @@ -16,12 +16,12 @@ bulkGet(objects?: SavedObjectsBulkGetObject[], options?: SavedObjec | Parameter | Type | Description | | --- | --- | --- | -| objects | SavedObjectsBulkGetObject[] | an array of ids, or an array of objects containing id, type and optionally fields | -| options | SavedObjectsBaseOptions | | +| objects | SavedObjectsBulkGetObject\[\] | an array of ids, or an array of objects containing id, type and optionally fields | +| options | SavedObjectsBaseOptions | | Returns: -`Promise>` +Promise<SavedObjectsBulkResponse<T>> ## Example diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.bulkresolve.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.bulkresolve.md index 0525b361ebecf9..3cf6e4d8d76a50 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.bulkresolve.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.bulkresolve.md @@ -16,12 +16,12 @@ bulkResolve(objects: SavedObjectsBulkResolveObject[], options?: Sav | Parameter | Type | Description | | --- | --- | --- | -| objects | SavedObjectsBulkResolveObject[] | an array of objects containing id, type | -| options | SavedObjectsBaseOptions | | +| objects | SavedObjectsBulkResolveObject\[\] | an array of objects containing id, type | +| options | SavedObjectsBaseOptions | | Returns: -`Promise>` +Promise<SavedObjectsBulkResolveResponse<T>> ## Example diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.bulkupdate.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.bulkupdate.md index cfd178a03f98fc..6c4034357a4eab 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.bulkupdate.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.bulkupdate.md @@ -16,10 +16,10 @@ bulkUpdate(objects: Array>, options | Parameter | Type | Description | | --- | --- | --- | -| objects | Array<SavedObjectsBulkUpdateObject<T>> | | -| options | SavedObjectsBulkUpdateOptions | | +| objects | Array<SavedObjectsBulkUpdateObject<T>> | | +| options | SavedObjectsBulkUpdateOptions | | Returns: -`Promise>` +Promise<SavedObjectsBulkUpdateResponse<T>> diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.checkconflicts.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.checkconflicts.md index 5cffb0c498b0b5..69d52ee098a305 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.checkconflicts.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.checkconflicts.md @@ -16,10 +16,10 @@ checkConflicts(objects?: SavedObjectsCheckConflictsObject[], options?: SavedObje | Parameter | Type | Description | | --- | --- | --- | -| objects | SavedObjectsCheckConflictsObject[] | | -| options | SavedObjectsBaseOptions | | +| objects | SavedObjectsCheckConflictsObject\[\] | | +| options | SavedObjectsBaseOptions | | Returns: -`Promise` +Promise<SavedObjectsCheckConflictsResponse> diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.closepointintime.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.closepointintime.md index 79c7d18adf3066..beb5ea847bf45c 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.closepointintime.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.closepointintime.md @@ -18,10 +18,10 @@ closePointInTime(id: string, options?: SavedObjectsClosePointInTimeOptions): Pro | Parameter | Type | Description | | --- | --- | --- | -| id | string | | -| options | SavedObjectsClosePointInTimeOptions | | +| id | string | | +| options | SavedObjectsClosePointInTimeOptions | | Returns: -`Promise` +Promise<SavedObjectsClosePointInTimeResponse> diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.collectmultinamespacereferences.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.collectmultinamespacereferences.md index 155167d32a7383..64ccd4187597cb 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.collectmultinamespacereferences.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.collectmultinamespacereferences.md @@ -16,10 +16,10 @@ collectMultiNamespaceReferences(objects: SavedObjectsCollectMultiNamespaceRefere | Parameter | Type | Description | | --- | --- | --- | -| objects | SavedObjectsCollectMultiNamespaceReferencesObject[] | | -| options | SavedObjectsCollectMultiNamespaceReferencesOptions | | +| objects | SavedObjectsCollectMultiNamespaceReferencesObject\[\] | | +| options | SavedObjectsCollectMultiNamespaceReferencesOptions | | Returns: -`Promise` +Promise<SavedObjectsCollectMultiNamespaceReferencesResponse> diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.create.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.create.md index e2575c20b31f8f..9f9b72984bbb65 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.create.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.create.md @@ -16,11 +16,11 @@ create(type: string, attributes: T, options?: SavedObjectsCreateOpt | Parameter | Type | Description | | --- | --- | --- | -| type | string | | -| attributes | T | | -| options | SavedObjectsCreateOptions | | +| type | string | | +| attributes | T | | +| options | SavedObjectsCreateOptions | | Returns: -`Promise>` +Promise<SavedObject<T>> diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.createpointintimefinder.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.createpointintimefinder.md index 39d09807e4f3b0..eab4312b1daa40 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.createpointintimefinder.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.createpointintimefinder.md @@ -22,12 +22,12 @@ createPointInTimeFinder(findOptions: SavedObjectsCreat | Parameter | Type | Description | | --- | --- | --- | -| findOptions | SavedObjectsCreatePointInTimeFinderOptions | | -| dependencies | SavedObjectsCreatePointInTimeFinderDependencies | | +| findOptions | SavedObjectsCreatePointInTimeFinderOptions | | +| dependencies | SavedObjectsCreatePointInTimeFinderDependencies | | Returns: -`ISavedObjectsPointInTimeFinder` +ISavedObjectsPointInTimeFinder<T, A> ## Example @@ -48,6 +48,5 @@ for await (const response of finder.find()) { await finder.close(); } } - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.delete.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.delete.md index 07e635efd0e8c9..64ed7778d3bece 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.delete.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.delete.md @@ -16,11 +16,11 @@ delete(type: string, id: string, options?: SavedObjectsDeleteOptions): Promise<{ | Parameter | Type | Description | | --- | --- | --- | -| type | string | | -| id | string | | -| options | SavedObjectsDeleteOptions | | +| type | string | | +| id | string | | +| options | SavedObjectsDeleteOptions | | Returns: -`Promise<{}>` +Promise<{}> diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.find.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.find.md index 56d76125108d1d..dc48f7481dc018 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.find.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.find.md @@ -16,9 +16,9 @@ find(options: SavedObjectsFindOptions): PromiseSavedObjectsFindOptions | | +| options | SavedObjectsFindOptions | | Returns: -`Promise>` +Promise<SavedObjectsFindResponse<T, A>> diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.get.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.get.md index 166265ca320b8e..00b6dd28bb7aa2 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.get.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.get.md @@ -16,11 +16,11 @@ get(type: string, id: string, options?: SavedObjectsBaseOptions): P | Parameter | Type | Description | | --- | --- | --- | -| type | string | The type of SavedObject to retrieve | -| id | string | The ID of the SavedObject to retrieve | -| options | SavedObjectsBaseOptions | | +| type | string | The type of SavedObject to retrieve | +| id | string | The ID of the SavedObject to retrieve | +| options | SavedObjectsBaseOptions | | Returns: -`Promise>` +Promise<SavedObject<T>> diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.md index e92b6d8e151b1c..c77bcfac2f0e78 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.md @@ -18,8 +18,8 @@ The constructor for this class is marked as internal. Third-party code should no | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [errors](./kibana-plugin-core-server.savedobjectsclient.errors.md) | | typeof SavedObjectsErrorHelpers | | -| [errors](./kibana-plugin-core-server.savedobjectsclient.errors.md) | static | typeof SavedObjectsErrorHelpers | | +| [errors](./kibana-plugin-core-server.savedobjectsclient.errors.md) | | typeof SavedObjectsErrorHelpers | | +| [errors](./kibana-plugin-core-server.savedobjectsclient.errors.md) | static | typeof SavedObjectsErrorHelpers | | ## Methods diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.openpointintimefortype.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.openpointintimefortype.md index c76159ffa50323..c449fc7b1c3f64 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.openpointintimefortype.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.openpointintimefortype.md @@ -18,10 +18,10 @@ openPointInTimeForType(type: string | string[], options?: SavedObjectsOpenPointI | Parameter | Type | Description | | --- | --- | --- | -| type | string | string[] | | -| options | SavedObjectsOpenPointInTimeOptions | | +| type | string \| string\[\] | | +| options | SavedObjectsOpenPointInTimeOptions | | Returns: -`Promise` +Promise<SavedObjectsOpenPointInTimeResponse> diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.removereferencesto.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.removereferencesto.md index 002992a17c3134..560c210b0105b6 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.removereferencesto.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.removereferencesto.md @@ -16,11 +16,11 @@ removeReferencesTo(type: string, id: string, options?: SavedObjectsRemoveReferen | Parameter | Type | Description | | --- | --- | --- | -| type | string | | -| id | string | | -| options | SavedObjectsRemoveReferencesToOptions | | +| type | string | | +| id | string | | +| options | SavedObjectsRemoveReferencesToOptions | | Returns: -`Promise` +Promise<SavedObjectsRemoveReferencesToResponse> diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.resolve.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.resolve.md index b9a63f0b8c05ac..31eabe46d6cb35 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.resolve.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.resolve.md @@ -16,11 +16,11 @@ resolve(type: string, id: string, options?: SavedObjectsBaseOptions | Parameter | Type | Description | | --- | --- | --- | -| type | string | The type of SavedObject to retrieve | -| id | string | The ID of the SavedObject to retrieve | -| options | SavedObjectsBaseOptions | | +| type | string | The type of SavedObject to retrieve | +| id | string | The ID of the SavedObject to retrieve | +| options | SavedObjectsBaseOptions | | Returns: -`Promise>` +Promise<SavedObjectsResolveResponse<T>> diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.update.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.update.md index 8c4e5962e1dbae..20a67387813ffa 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.update.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.update.md @@ -16,12 +16,12 @@ update(type: string, id: string, attributes: Partial, options?: | Parameter | Type | Description | | --- | --- | --- | -| type | string | | -| id | string | | -| attributes | Partial<T> | | -| options | SavedObjectsUpdateOptions<T> | | +| type | string | | +| id | string | | +| attributes | Partial<T> | | +| options | SavedObjectsUpdateOptions<T> | | Returns: -`Promise>` +Promise<SavedObjectsUpdateResponse<T>> diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.updateobjectsspaces.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.updateobjectsspaces.md index 7ababbbe1f535e..09012607fd932d 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.updateobjectsspaces.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.updateobjectsspaces.md @@ -16,12 +16,12 @@ updateObjectsSpaces(objects: SavedObjectsUpdateObjectsSpacesObject[], spacesToAd | Parameter | Type | Description | | --- | --- | --- | -| objects | SavedObjectsUpdateObjectsSpacesObject[] | | -| spacesToAdd | string[] | | -| spacesToRemove | string[] | | -| options | SavedObjectsUpdateObjectsSpacesOptions | | +| objects | SavedObjectsUpdateObjectsSpacesObject\[\] | | +| spacesToAdd | string\[\] | | +| spacesToRemove | string\[\] | | +| options | SavedObjectsUpdateObjectsSpacesOptions | | Returns: -`Promise` +Promise<import("./lib").SavedObjectsUpdateObjectsSpacesResponse> diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclientprovideroptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclientprovideroptions.md index be1f73f0648439..a02f54214163bb 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclientprovideroptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclientprovideroptions.md @@ -16,6 +16,6 @@ export interface SavedObjectsClientProviderOptions | Property | Type | Description | | --- | --- | --- | -| [excludedWrappers](./kibana-plugin-core-server.savedobjectsclientprovideroptions.excludedwrappers.md) | string[] | | -| [includedHiddenTypes](./kibana-plugin-core-server.savedobjectsclientprovideroptions.includedhiddentypes.md) | string[] | | +| [excludedWrappers?](./kibana-plugin-core-server.savedobjectsclientprovideroptions.excludedwrappers.md) | string\[\] | (Optional) | +| [includedHiddenTypes?](./kibana-plugin-core-server.savedobjectsclientprovideroptions.includedhiddentypes.md) | string\[\] | (Optional) | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclientwrapperoptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclientwrapperoptions.md index 5b0a9edd24f353..16d104e4a8dff9 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclientwrapperoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclientwrapperoptions.md @@ -16,7 +16,7 @@ export interface SavedObjectsClientWrapperOptions | Property | Type | Description | | --- | --- | --- | -| [client](./kibana-plugin-core-server.savedobjectsclientwrapperoptions.client.md) | SavedObjectsClientContract | | -| [request](./kibana-plugin-core-server.savedobjectsclientwrapperoptions.request.md) | KibanaRequest | | -| [typeRegistry](./kibana-plugin-core-server.savedobjectsclientwrapperoptions.typeregistry.md) | ISavedObjectTypeRegistry | | +| [client](./kibana-plugin-core-server.savedobjectsclientwrapperoptions.client.md) | SavedObjectsClientContract | | +| [request](./kibana-plugin-core-server.savedobjectsclientwrapperoptions.request.md) | KibanaRequest | | +| [typeRegistry](./kibana-plugin-core-server.savedobjectsclientwrapperoptions.typeregistry.md) | ISavedObjectTypeRegistry | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclosepointintimeresponse.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclosepointintimeresponse.md index 43ecd1298d5d97..27010232bd46b1 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsclosepointintimeresponse.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsclosepointintimeresponse.md @@ -15,6 +15,6 @@ export interface SavedObjectsClosePointInTimeResponse | Property | Type | Description | | --- | --- | --- | -| [num\_freed](./kibana-plugin-core-server.savedobjectsclosepointintimeresponse.num_freed.md) | number | The number of search contexts that have been successfully closed. | -| [succeeded](./kibana-plugin-core-server.savedobjectsclosepointintimeresponse.succeeded.md) | boolean | If true, all search contexts associated with the PIT id are successfully closed. | +| [num\_freed](./kibana-plugin-core-server.savedobjectsclosepointintimeresponse.num_freed.md) | number | The number of search contexts that have been successfully closed. | +| [succeeded](./kibana-plugin-core-server.savedobjectsclosepointintimeresponse.succeeded.md) | boolean | If true, all search contexts associated with the PIT id are successfully closed. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesobject.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesobject.md index b4e6379234f792..5f419a63e8c702 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesobject.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesobject.md @@ -18,6 +18,6 @@ export interface SavedObjectsCollectMultiNamespaceReferencesObject | Property | Type | Description | | --- | --- | --- | -| [id](./kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesobject.id.md) | string | | -| [type](./kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesobject.type.md) | string | | +| [id](./kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesobject.id.md) | string | | +| [type](./kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesobject.type.md) | string | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesoptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesoptions.md index 9311a662697533..57298e40a88ba2 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesoptions.md @@ -11,10 +11,11 @@ Options for collecting references. ```typescript export interface SavedObjectsCollectMultiNamespaceReferencesOptions extends SavedObjectsBaseOptions ``` +Extends: SavedObjectsBaseOptions ## Properties | Property | Type | Description | | --- | --- | --- | -| [purpose](./kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesoptions.purpose.md) | 'collectMultiNamespaceReferences' | 'updateObjectsSpaces' | Optional purpose used to determine filtering and authorization checks; default is 'collectMultiNamespaceReferences' | +| [purpose?](./kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesoptions.purpose.md) | 'collectMultiNamespaceReferences' \| 'updateObjectsSpaces' | (Optional) Optional purpose used to determine filtering and authorization checks; default is 'collectMultiNamespaceReferences' | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesresponse.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesresponse.md index bc72e739944681..514e9271aa17ea 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesresponse.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesresponse.md @@ -16,5 +16,5 @@ export interface SavedObjectsCollectMultiNamespaceReferencesResponse | Property | Type | Description | | --- | --- | --- | -| [objects](./kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesresponse.objects.md) | SavedObjectReferenceWithContext[] | | +| [objects](./kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesresponse.objects.md) | SavedObjectReferenceWithContext\[\] | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscreateoptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscreateoptions.md index 7eaa9c51f5c82c..646a0f6fcf548f 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscreateoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectscreateoptions.md @@ -10,18 +10,19 @@ ```typescript export interface SavedObjectsCreateOptions extends SavedObjectsBaseOptions ``` +Extends: SavedObjectsBaseOptions ## Properties | Property | Type | Description | | --- | --- | --- | -| [coreMigrationVersion](./kibana-plugin-core-server.savedobjectscreateoptions.coremigrationversion.md) | string | A semver value that is used when upgrading objects between Kibana versions. If undefined, this will be automatically set to the current Kibana version when the object is created. If this is set to a non-semver value, or it is set to a semver value greater than the current Kibana version, it will result in an error. | -| [id](./kibana-plugin-core-server.savedobjectscreateoptions.id.md) | string | (not recommended) Specify an id for the document | -| [initialNamespaces](./kibana-plugin-core-server.savedobjectscreateoptions.initialnamespaces.md) | string[] | Optional initial namespaces for the object to be created in. If this is defined, it will supersede the namespace ID that is in [SavedObjectsCreateOptions](./kibana-plugin-core-server.savedobjectscreateoptions.md).\* For shareable object types (registered with namespaceType: 'multiple'): this option can be used to specify one or more spaces, including the "All spaces" identifier ('*'). \* For isolated object types (registered with namespaceType: 'single' or namespaceType: 'multiple-isolated'): this option can only be used to specify a single space, and the "All spaces" identifier ('*') is not allowed. \* For global object types (registered with namespaceType: 'agnostic'): this option cannot be used. | -| [migrationVersion](./kibana-plugin-core-server.savedobjectscreateoptions.migrationversion.md) | SavedObjectsMigrationVersion | Information about the migrations that have been applied to this SavedObject. When Kibana starts up, KibanaMigrator detects outdated documents and migrates them based on this value. For each migration that has been applied, the plugin's name is used as a key and the latest migration version as the value. | -| [originId](./kibana-plugin-core-server.savedobjectscreateoptions.originid.md) | string | Optional ID of the original saved object, if this object's id was regenerated | -| [overwrite](./kibana-plugin-core-server.savedobjectscreateoptions.overwrite.md) | boolean | Overwrite existing documents (defaults to false) | -| [references](./kibana-plugin-core-server.savedobjectscreateoptions.references.md) | SavedObjectReference[] | | -| [refresh](./kibana-plugin-core-server.savedobjectscreateoptions.refresh.md) | MutatingOperationRefreshSetting | The Elasticsearch Refresh setting for this operation | -| [version](./kibana-plugin-core-server.savedobjectscreateoptions.version.md) | string | An opaque version number which changes on each successful write operation. Can be used in conjunction with overwrite for implementing optimistic concurrency control. | +| [coreMigrationVersion?](./kibana-plugin-core-server.savedobjectscreateoptions.coremigrationversion.md) | string | (Optional) A semver value that is used when upgrading objects between Kibana versions. If undefined, this will be automatically set to the current Kibana version when the object is created. If this is set to a non-semver value, or it is set to a semver value greater than the current Kibana version, it will result in an error. | +| [id?](./kibana-plugin-core-server.savedobjectscreateoptions.id.md) | string | (Optional) (not recommended) Specify an id for the document | +| [initialNamespaces?](./kibana-plugin-core-server.savedobjectscreateoptions.initialnamespaces.md) | string\[\] | (Optional) Optional initial namespaces for the object to be created in. If this is defined, it will supersede the namespace ID that is in [SavedObjectsCreateOptions](./kibana-plugin-core-server.savedobjectscreateoptions.md).\* For shareable object types (registered with namespaceType: 'multiple'): this option can be used to specify one or more spaces, including the "All spaces" identifier ('*'). \* For isolated object types (registered with namespaceType: 'single' or namespaceType: 'multiple-isolated'): this option can only be used to specify a single space, and the "All spaces" identifier ('*') is not allowed. \* For global object types (registered with namespaceType: 'agnostic'): this option cannot be used. | +| [migrationVersion?](./kibana-plugin-core-server.savedobjectscreateoptions.migrationversion.md) | SavedObjectsMigrationVersion | (Optional) Information about the migrations that have been applied to this SavedObject. When Kibana starts up, KibanaMigrator detects outdated documents and migrates them based on this value. For each migration that has been applied, the plugin's name is used as a key and the latest migration version as the value. | +| [originId?](./kibana-plugin-core-server.savedobjectscreateoptions.originid.md) | string | (Optional) Optional ID of the original saved object, if this object's id was regenerated | +| [overwrite?](./kibana-plugin-core-server.savedobjectscreateoptions.overwrite.md) | boolean | (Optional) Overwrite existing documents (defaults to false) | +| [references?](./kibana-plugin-core-server.savedobjectscreateoptions.references.md) | SavedObjectReference\[\] | (Optional) | +| [refresh?](./kibana-plugin-core-server.savedobjectscreateoptions.refresh.md) | MutatingOperationRefreshSetting | (Optional) The Elasticsearch Refresh setting for this operation | +| [version?](./kibana-plugin-core-server.savedobjectscreateoptions.version.md) | string | (Optional) An opaque version number which changes on each successful write operation. Can be used in conjunction with overwrite for implementing optimistic concurrency control. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscreatepointintimefinderdependencies.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscreatepointintimefinderdependencies.md index 47c640bfabcb07..f647a9c1367b33 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscreatepointintimefinderdependencies.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectscreatepointintimefinderdependencies.md @@ -15,5 +15,5 @@ export interface SavedObjectsCreatePointInTimeFinderDependencies | Property | Type | Description | | --- | --- | --- | -| [client](./kibana-plugin-core-server.savedobjectscreatepointintimefinderdependencies.client.md) | Pick<SavedObjectsClientContract, 'find' | 'openPointInTimeForType' | 'closePointInTime'> | | +| [client](./kibana-plugin-core-server.savedobjectscreatepointintimefinderdependencies.client.md) | Pick<SavedObjectsClientContract, 'find' \| 'openPointInTimeForType' \| 'closePointInTime'> | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsdeletebynamespaceoptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsdeletebynamespaceoptions.md index ba81a3e8c32d0b..49b6c36cf3ed22 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsdeletebynamespaceoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsdeletebynamespaceoptions.md @@ -10,10 +10,11 @@ ```typescript export interface SavedObjectsDeleteByNamespaceOptions extends SavedObjectsBaseOptions ``` +Extends: SavedObjectsBaseOptions ## Properties | Property | Type | Description | | --- | --- | --- | -| [refresh](./kibana-plugin-core-server.savedobjectsdeletebynamespaceoptions.refresh.md) | boolean | The Elasticsearch supports only boolean flag for this operation | +| [refresh?](./kibana-plugin-core-server.savedobjectsdeletebynamespaceoptions.refresh.md) | boolean | (Optional) The Elasticsearch supports only boolean flag for this operation | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsdeleteoptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsdeleteoptions.md index 245819e44d37d6..e1bc1fcec3f2d7 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsdeleteoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsdeleteoptions.md @@ -10,11 +10,12 @@ ```typescript export interface SavedObjectsDeleteOptions extends SavedObjectsBaseOptions ``` +Extends: SavedObjectsBaseOptions ## Properties | Property | Type | Description | | --- | --- | --- | -| [force](./kibana-plugin-core-server.savedobjectsdeleteoptions.force.md) | boolean | Force deletion of an object that exists in multiple namespaces | -| [refresh](./kibana-plugin-core-server.savedobjectsdeleteoptions.refresh.md) | MutatingOperationRefreshSetting | The Elasticsearch Refresh setting for this operation | +| [force?](./kibana-plugin-core-server.savedobjectsdeleteoptions.force.md) | boolean | (Optional) Force deletion of an object that exists in multiple namespaces | +| [refresh?](./kibana-plugin-core-server.savedobjectsdeleteoptions.refresh.md) | MutatingOperationRefreshSetting | (Optional) The Elasticsearch Refresh setting for this operation | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createbadrequesterror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createbadrequesterror.md index 03d5aceec6127e..f101aa98d8bd30 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createbadrequesterror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createbadrequesterror.md @@ -14,9 +14,9 @@ static createBadRequestError(reason?: string): DecoratedError; | Parameter | Type | Description | | --- | --- | --- | -| reason | string | | +| reason | string | | Returns: -`DecoratedError` +DecoratedError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createconflicterror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createconflicterror.md index 97d33c3060bb02..426de67ded2dc7 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createconflicterror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createconflicterror.md @@ -14,11 +14,11 @@ static createConflictError(type: string, id: string, reason?: string): Decorated | Parameter | Type | Description | | --- | --- | --- | -| type | string | | -| id | string | | -| reason | string | | +| type | string | | +| id | string | | +| reason | string | | Returns: -`DecoratedError` +DecoratedError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.creategenericnotfounderror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.creategenericnotfounderror.md index 9df39c82745d9d..6ac403b442367c 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.creategenericnotfounderror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.creategenericnotfounderror.md @@ -14,10 +14,10 @@ static createGenericNotFoundError(type?: string | null, id?: string | null): Dec | Parameter | Type | Description | | --- | --- | --- | -| type | string | null | | -| id | string | null | | +| type | string \| null | | +| id | string \| null | | Returns: -`DecoratedError` +DecoratedError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createindexaliasnotfounderror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createindexaliasnotfounderror.md index 2b897db7bba4c3..4f9fa9d4484bdc 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createindexaliasnotfounderror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createindexaliasnotfounderror.md @@ -14,9 +14,9 @@ static createIndexAliasNotFoundError(alias: string): DecoratedError; | Parameter | Type | Description | | --- | --- | --- | -| alias | string | | +| alias | string | | Returns: -`DecoratedError` +DecoratedError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createinvalidversionerror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createinvalidversionerror.md index c3eca80ef3efe0..59e2a656940088 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createinvalidversionerror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createinvalidversionerror.md @@ -14,9 +14,9 @@ static createInvalidVersionError(versionInput?: string): DecoratedError; | Parameter | Type | Description | | --- | --- | --- | -| versionInput | string | | +| versionInput | string | | Returns: -`DecoratedError` +DecoratedError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createtoomanyrequestserror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createtoomanyrequestserror.md index 6d93dc97a107e8..3d4903c3482ed8 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createtoomanyrequestserror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createtoomanyrequestserror.md @@ -14,10 +14,10 @@ static createTooManyRequestsError(type: string, id: string): DecoratedError; | Parameter | Type | Description | | --- | --- | --- | -| type | string | | -| id | string | | +| type | string | | +| id | string | | Returns: -`DecoratedError` +DecoratedError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createunsupportedtypeerror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createunsupportedtypeerror.md index bcfd5d4296a45e..4ca95c1565db6a 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createunsupportedtypeerror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createunsupportedtypeerror.md @@ -14,9 +14,9 @@ static createUnsupportedTypeError(type: string): DecoratedError; | Parameter | Type | Description | | --- | --- | --- | -| type | string | | +| type | string | | Returns: -`DecoratedError` +DecoratedError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decoratebadrequesterror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decoratebadrequesterror.md index 604f2bd93cc74b..043950407519fb 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decoratebadrequesterror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decoratebadrequesterror.md @@ -14,10 +14,10 @@ static decorateBadRequestError(error: Error, reason?: string): DecoratedError; | Parameter | Type | Description | | --- | --- | --- | -| error | Error | | -| reason | string | | +| error | Error | | +| reason | string | | Returns: -`DecoratedError` +DecoratedError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorateconflicterror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorateconflicterror.md index 172f8f5ee6b4d4..dfb981a0a656e3 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorateconflicterror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorateconflicterror.md @@ -14,10 +14,10 @@ static decorateConflictError(error: Error, reason?: string): DecoratedError; | Parameter | Type | Description | | --- | --- | --- | -| error | Error | | -| reason | string | | +| error | Error | | +| reason | string | | Returns: -`DecoratedError` +DecoratedError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorateescannotexecutescripterror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorateescannotexecutescripterror.md index 94060bba500670..18b019f1b53641 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorateescannotexecutescripterror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorateescannotexecutescripterror.md @@ -14,10 +14,10 @@ static decorateEsCannotExecuteScriptError(error: Error, reason?: string): Decora | Parameter | Type | Description | | --- | --- | --- | -| error | Error | | -| reason | string | | +| error | Error | | +| reason | string | | Returns: -`DecoratedError` +DecoratedError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorateesunavailableerror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorateesunavailableerror.md index 54135f9875f5f8..9d272b1e78454c 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorateesunavailableerror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorateesunavailableerror.md @@ -14,10 +14,10 @@ static decorateEsUnavailableError(error: Error, reason?: string): DecoratedError | Parameter | Type | Description | | --- | --- | --- | -| error | Error | | -| reason | string | | +| error | Error | | +| reason | string | | Returns: -`DecoratedError` +DecoratedError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorateforbiddenerror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorateforbiddenerror.md index 82d84defba6f79..11b53ec2193345 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorateforbiddenerror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorateforbiddenerror.md @@ -14,10 +14,10 @@ static decorateForbiddenError(error: Error, reason?: string): DecoratedError; | Parameter | Type | Description | | --- | --- | --- | -| error | Error | | -| reason | string | | +| error | Error | | +| reason | string | | Returns: -`DecoratedError` +DecoratedError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorategeneralerror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorategeneralerror.md index 310258bc9a6e9f..595789611b5c38 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorategeneralerror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorategeneralerror.md @@ -14,10 +14,10 @@ static decorateGeneralError(error: Error, reason?: string): DecoratedError; | Parameter | Type | Description | | --- | --- | --- | -| error | Error | | -| reason | string | | +| error | Error | | +| reason | string | | Returns: -`DecoratedError` +DecoratedError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorateindexaliasnotfounderror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorateindexaliasnotfounderror.md index c7e10fc42ead19..a2e74ca7769e0b 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorateindexaliasnotfounderror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decorateindexaliasnotfounderror.md @@ -14,10 +14,10 @@ static decorateIndexAliasNotFoundError(error: Error, alias: string): DecoratedEr | Parameter | Type | Description | | --- | --- | --- | -| error | Error | | -| alias | string | | +| error | Error | | +| alias | string | | Returns: -`DecoratedError` +DecoratedError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decoratenotauthorizederror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decoratenotauthorizederror.md index 81405a6597f77a..d50d5d9ebf45f8 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decoratenotauthorizederror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decoratenotauthorizederror.md @@ -14,10 +14,10 @@ static decorateNotAuthorizedError(error: Error, reason?: string): DecoratedError | Parameter | Type | Description | | --- | --- | --- | -| error | Error | | -| reason | string | | +| error | Error | | +| reason | string | | Returns: -`DecoratedError` +DecoratedError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decoraterequestentitytoolargeerror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decoraterequestentitytoolargeerror.md index edfa466aa97265..487d64f83ca30f 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decoraterequestentitytoolargeerror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decoraterequestentitytoolargeerror.md @@ -14,10 +14,10 @@ static decorateRequestEntityTooLargeError(error: Error, reason?: string): Decora | Parameter | Type | Description | | --- | --- | --- | -| error | Error | | -| reason | string | | +| error | Error | | +| reason | string | | Returns: -`DecoratedError` +DecoratedError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decoratetoomanyrequestserror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decoratetoomanyrequestserror.md index 46c94e1756eddf..b85cf196c3cdb5 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decoratetoomanyrequestserror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.decoratetoomanyrequestserror.md @@ -14,10 +14,10 @@ static decorateTooManyRequestsError(error: Error, reason?: string): DecoratedErr | Parameter | Type | Description | | --- | --- | --- | -| error | Error | | -| reason | string | | +| error | Error | | +| reason | string | | Returns: -`DecoratedError` +DecoratedError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isbadrequesterror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isbadrequesterror.md index 2fd613920fb103..5dd6a50b61e55f 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isbadrequesterror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isbadrequesterror.md @@ -14,9 +14,9 @@ static isBadRequestError(error: Error | DecoratedError): boolean; | Parameter | Type | Description | | --- | --- | --- | -| error | Error | DecoratedError | | +| error | Error \| DecoratedError | | Returns: -`boolean` +boolean diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isconflicterror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isconflicterror.md index c8066c396f835b..9762462af9ef3d 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isconflicterror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isconflicterror.md @@ -14,9 +14,9 @@ static isConflictError(error: Error | DecoratedError): boolean; | Parameter | Type | Description | | --- | --- | --- | -| error | Error | DecoratedError | | +| error | Error \| DecoratedError | | Returns: -`boolean` +boolean diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isescannotexecutescripterror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isescannotexecutescripterror.md index debb94fe4f8d83..e007dd30f2bb03 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isescannotexecutescripterror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isescannotexecutescripterror.md @@ -14,9 +14,9 @@ static isEsCannotExecuteScriptError(error: Error | DecoratedError): boolean; | Parameter | Type | Description | | --- | --- | --- | -| error | Error | DecoratedError | | +| error | Error \| DecoratedError | | Returns: -`boolean` +boolean diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isesunavailableerror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isesunavailableerror.md index 6f38d414b30c34..a6fb911f5e0ebf 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isesunavailableerror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isesunavailableerror.md @@ -14,9 +14,9 @@ static isEsUnavailableError(error: Error | DecoratedError): boolean; | Parameter | Type | Description | | --- | --- | --- | -| error | Error | DecoratedError | | +| error | Error \| DecoratedError | | Returns: -`boolean` +boolean diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isforbiddenerror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isforbiddenerror.md index 74cfecd49f4a9b..e45ef7a7ed3f35 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isforbiddenerror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isforbiddenerror.md @@ -14,9 +14,9 @@ static isForbiddenError(error: Error | DecoratedError): boolean; | Parameter | Type | Description | | --- | --- | --- | -| error | Error | DecoratedError | | +| error | Error \| DecoratedError | | Returns: -`boolean` +boolean diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isgeneralerror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isgeneralerror.md index 4b4ede2f77a7e2..cbec5d3b36a803 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isgeneralerror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isgeneralerror.md @@ -14,9 +14,9 @@ static isGeneralError(error: Error | DecoratedError): boolean; | Parameter | Type | Description | | --- | --- | --- | -| error | Error | DecoratedError | | +| error | Error \| DecoratedError | | Returns: -`boolean` +boolean diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isinvalidversionerror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isinvalidversionerror.md index 8fde00aad394a2..8ad480147adf62 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isinvalidversionerror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isinvalidversionerror.md @@ -14,9 +14,9 @@ static isInvalidVersionError(error: Error | DecoratedError): boolean; | Parameter | Type | Description | | --- | --- | --- | -| error | Error | DecoratedError | | +| error | Error \| DecoratedError | | Returns: -`boolean` +boolean diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isnotauthorizederror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isnotauthorizederror.md index 39811943abe456..5e85718bde511b 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isnotauthorizederror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isnotauthorizederror.md @@ -14,9 +14,9 @@ static isNotAuthorizedError(error: Error | DecoratedError): boolean; | Parameter | Type | Description | | --- | --- | --- | -| error | Error | DecoratedError | | +| error | Error \| DecoratedError | | Returns: -`boolean` +boolean diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isnotfounderror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isnotfounderror.md index d37fec7ca08bec..05e848322ae9fc 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isnotfounderror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isnotfounderror.md @@ -14,9 +14,9 @@ static isNotFoundError(error: Error | DecoratedError): boolean; | Parameter | Type | Description | | --- | --- | --- | -| error | Error | DecoratedError | | +| error | Error \| DecoratedError | | Returns: -`boolean` +boolean diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isrequestentitytoolargeerror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isrequestentitytoolargeerror.md index e2699c53b3836a..d6674f0a588e91 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isrequestentitytoolargeerror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.isrequestentitytoolargeerror.md @@ -14,9 +14,9 @@ static isRequestEntityTooLargeError(error: Error | DecoratedError): boolean; | Parameter | Type | Description | | --- | --- | --- | -| error | Error | DecoratedError | | +| error | Error \| DecoratedError | | Returns: -`boolean` +boolean diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.issavedobjectsclienterror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.issavedobjectsclienterror.md index 0dc0df0401b7b3..0505c3a450a328 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.issavedobjectsclienterror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.issavedobjectsclienterror.md @@ -14,9 +14,9 @@ static isSavedObjectsClientError(error: any): error is DecoratedError; | Parameter | Type | Description | | --- | --- | --- | -| error | any | | +| error | any | | Returns: -`error is DecoratedError` +error is DecoratedError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.istoomanyrequestserror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.istoomanyrequestserror.md index 4422966ee3e50f..3f9c360710ae3c 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.istoomanyrequestserror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.istoomanyrequestserror.md @@ -14,9 +14,9 @@ static isTooManyRequestsError(error: Error | DecoratedError): boolean; | Parameter | Type | Description | | --- | --- | --- | -| error | Error | DecoratedError | | +| error | Error \| DecoratedError | | Returns: -`boolean` +boolean diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexportbyobjectoptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexportbyobjectoptions.md index cb20fc54001257..853125f2d1d1f1 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexportbyobjectoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexportbyobjectoptions.md @@ -11,10 +11,11 @@ Options for the [export by objects API](./kibana-plugin-core-server.savedobjects ```typescript export interface SavedObjectsExportByObjectOptions extends SavedObjectExportBaseOptions ``` +Extends: SavedObjectExportBaseOptions ## Properties | Property | Type | Description | | --- | --- | --- | -| [objects](./kibana-plugin-core-server.savedobjectsexportbyobjectoptions.objects.md) | Array<{
id: string;
type: string;
}> | optional array of objects to export. | +| [objects](./kibana-plugin-core-server.savedobjectsexportbyobjectoptions.objects.md) | Array<{ id: string; type: string; }> | optional array of objects to export. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexportbytypeoptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexportbytypeoptions.md index 26ebfd658f19bb..707db0dca30a7a 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexportbytypeoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexportbytypeoptions.md @@ -11,12 +11,13 @@ Options for the [export by type API](./kibana-plugin-core-server.savedobjectsexp ```typescript export interface SavedObjectsExportByTypeOptions extends SavedObjectExportBaseOptions ``` +Extends: SavedObjectExportBaseOptions ## Properties | Property | Type | Description | | --- | --- | --- | -| [hasReference](./kibana-plugin-core-server.savedobjectsexportbytypeoptions.hasreference.md) | SavedObjectsFindOptionsReference[] | optional array of references to search object for. | -| [search](./kibana-plugin-core-server.savedobjectsexportbytypeoptions.search.md) | string | optional query string to filter exported objects. | -| [types](./kibana-plugin-core-server.savedobjectsexportbytypeoptions.types.md) | string[] | array of saved object types. | +| [hasReference?](./kibana-plugin-core-server.savedobjectsexportbytypeoptions.hasreference.md) | SavedObjectsFindOptionsReference\[\] | (Optional) optional array of references to search object for. | +| [search?](./kibana-plugin-core-server.savedobjectsexportbytypeoptions.search.md) | string | (Optional) optional query string to filter exported objects. | +| [types](./kibana-plugin-core-server.savedobjectsexportbytypeoptions.types.md) | string\[\] | array of saved object types. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporter.__private_.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporter.__private_.md deleted file mode 100644 index 23f49a703814f6..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporter.__private_.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExporter](./kibana-plugin-core-server.savedobjectsexporter.md) > ["\#private"](./kibana-plugin-core-server.savedobjectsexporter.__private_.md) - -## SavedObjectsExporter."\#private" property - -Signature: - -```typescript -#private; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporter._constructor_.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporter._constructor_.md index 3f3d708c590ee8..1c2f60570348ee 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporter._constructor_.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporter._constructor_.md @@ -21,5 +21,5 @@ constructor({ savedObjectsClient, typeRegistry, exportSizeLimit, logger, }: { | Parameter | Type | Description | | --- | --- | --- | -| { savedObjectsClient, typeRegistry, exportSizeLimit, logger, } | {
savedObjectsClient: SavedObjectsClientContract;
typeRegistry: ISavedObjectTypeRegistry;
exportSizeLimit: number;
logger: Logger;
} | | +| { savedObjectsClient, typeRegistry, exportSizeLimit, logger, } | { savedObjectsClient: SavedObjectsClientContract; typeRegistry: ISavedObjectTypeRegistry; exportSizeLimit: number; logger: Logger; } | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporter.exportbyobjects.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporter.exportbyobjects.md index a7dc5a71b835d5..b143d17fa59bdd 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporter.exportbyobjects.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporter.exportbyobjects.md @@ -18,11 +18,11 @@ exportByObjects(options: SavedObjectsExportByObjectOptions): PromiseSavedObjectsExportByObjectOptions | | +| options | SavedObjectsExportByObjectOptions | | Returns: -`Promise` +Promise<import("stream").Readable> ## Exceptions diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporter.exportbytypes.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporter.exportbytypes.md index 83da41bad7fe01..cf32d988f6eca0 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporter.exportbytypes.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporter.exportbytypes.md @@ -18,11 +18,11 @@ exportByTypes(options: SavedObjectsExportByTypeOptions): PromiseSavedObjectsExportByTypeOptions | | +| options | SavedObjectsExportByTypeOptions | | Returns: -`Promise` +Promise<import("stream").Readable> ## Exceptions diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporter.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporter.md index ce23e91633b078..66f52f4aa49029 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporter.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporter.md @@ -17,12 +17,6 @@ export declare class SavedObjectsExporter | --- | --- | --- | | [(constructor)({ savedObjectsClient, typeRegistry, exportSizeLimit, logger, })](./kibana-plugin-core-server.savedobjectsexporter._constructor_.md) | | Constructs a new instance of the SavedObjectsExporter class | -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| ["\#private"](./kibana-plugin-core-server.savedobjectsexporter.__private_.md) | | | | - ## Methods | Method | Modifiers | Description | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror._constructor_.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror._constructor_.md index 33bc6113d56e15..ee25dbf8c22e78 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror._constructor_.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror._constructor_.md @@ -16,7 +16,7 @@ constructor(type: string, message: string, attributes?: Record | un | Parameter | Type | Description | | --- | --- | --- | -| type | string | | -| message | string | | -| attributes | Record<string, any> | undefined | | +| type | string | | +| message | string | | +| attributes | Record<string, any> \| undefined | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror.exportsizeexceeded.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror.exportsizeexceeded.md index c4097724b193dd..b69c46383aae45 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror.exportsizeexceeded.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror.exportsizeexceeded.md @@ -14,9 +14,9 @@ static exportSizeExceeded(limit: number): SavedObjectsExportError; | Parameter | Type | Description | | --- | --- | --- | -| limit | number | | +| limit | number | | Returns: -`SavedObjectsExportError` +SavedObjectsExportError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror.invalidtransformerror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror.invalidtransformerror.md index 103d1ff8a912ba..a6f0190f27fb6c 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror.invalidtransformerror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror.invalidtransformerror.md @@ -16,9 +16,9 @@ static invalidTransformError(objectKeys: string[]): SavedObjectsExportError; | Parameter | Type | Description | | --- | --- | --- | -| objectKeys | string[] | | +| objectKeys | string\[\] | | Returns: -`SavedObjectsExportError` +SavedObjectsExportError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror.md index 2a503f9377daca..4c70b8395d8a65 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror.md @@ -10,6 +10,7 @@ ```typescript export declare class SavedObjectsExportError extends Error ``` +Extends: Error ## Constructors @@ -21,8 +22,8 @@ export declare class SavedObjectsExportError extends Error | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [attributes](./kibana-plugin-core-server.savedobjectsexporterror.attributes.md) | | Record<string, any> | undefined | | -| [type](./kibana-plugin-core-server.savedobjectsexporterror.type.md) | | string | | +| [attributes?](./kibana-plugin-core-server.savedobjectsexporterror.attributes.md) | | Record<string, any> \| undefined | (Optional) | +| [type](./kibana-plugin-core-server.savedobjectsexporterror.type.md) | | string | | ## Methods diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror.objectfetcherror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror.objectfetcherror.md index afaa4693f3c703..172b9e0f3ef185 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror.objectfetcherror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror.objectfetcherror.md @@ -14,9 +14,9 @@ static objectFetchError(objects: SavedObject[]): SavedObjectsExportError; | Parameter | Type | Description | | --- | --- | --- | -| objects | SavedObject[] | | +| objects | SavedObject\[\] | | Returns: -`SavedObjectsExportError` +SavedObjectsExportError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror.objecttransformerror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror.objecttransformerror.md index 393cf20dbae16b..46d415068e9e54 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror.objecttransformerror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporterror.objecttransformerror.md @@ -16,10 +16,10 @@ static objectTransformError(objects: SavedObject[], cause: Error): SavedObjectsE | Parameter | Type | Description | | --- | --- | --- | -| objects | SavedObject[] | | -| cause | Error | | +| objects | SavedObject\[\] | | +| cause | Error | | Returns: -`SavedObjectsExportError` +SavedObjectsExportError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexportexcludedobject.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexportexcludedobject.md index 4766ae25a936df..053e9b8bec4637 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexportexcludedobject.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexportexcludedobject.md @@ -15,7 +15,7 @@ export interface SavedObjectsExportExcludedObject | Property | Type | Description | | --- | --- | --- | -| [id](./kibana-plugin-core-server.savedobjectsexportexcludedobject.id.md) | string | id of the excluded object | -| [reason](./kibana-plugin-core-server.savedobjectsexportexcludedobject.reason.md) | string | optional cause of the exclusion | -| [type](./kibana-plugin-core-server.savedobjectsexportexcludedobject.type.md) | string | type of the excluded object | +| [id](./kibana-plugin-core-server.savedobjectsexportexcludedobject.id.md) | string | id of the excluded object | +| [reason?](./kibana-plugin-core-server.savedobjectsexportexcludedobject.reason.md) | string | (Optional) optional cause of the exclusion | +| [type](./kibana-plugin-core-server.savedobjectsexportexcludedobject.type.md) | string | type of the excluded object | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexportresultdetails.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexportresultdetails.md index f017f2329170ba..872147dc81456d 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexportresultdetails.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexportresultdetails.md @@ -16,9 +16,9 @@ export interface SavedObjectsExportResultDetails | Property | Type | Description | | --- | --- | --- | -| [excludedObjects](./kibana-plugin-core-server.savedobjectsexportresultdetails.excludedobjects.md) | SavedObjectsExportExcludedObject[] | excluded objects details | -| [excludedObjectsCount](./kibana-plugin-core-server.savedobjectsexportresultdetails.excludedobjectscount.md) | number | number of objects that were excluded from the export | -| [exportedCount](./kibana-plugin-core-server.savedobjectsexportresultdetails.exportedcount.md) | number | number of successfully exported objects | -| [missingRefCount](./kibana-plugin-core-server.savedobjectsexportresultdetails.missingrefcount.md) | number | number of missing references | -| [missingReferences](./kibana-plugin-core-server.savedobjectsexportresultdetails.missingreferences.md) | Array<{
id: string;
type: string;
}> | missing references details | +| [excludedObjects](./kibana-plugin-core-server.savedobjectsexportresultdetails.excludedobjects.md) | SavedObjectsExportExcludedObject\[\] | excluded objects details | +| [excludedObjectsCount](./kibana-plugin-core-server.savedobjectsexportresultdetails.excludedobjectscount.md) | number | number of objects that were excluded from the export | +| [exportedCount](./kibana-plugin-core-server.savedobjectsexportresultdetails.exportedcount.md) | number | number of successfully exported objects | +| [missingRefCount](./kibana-plugin-core-server.savedobjectsexportresultdetails.missingrefcount.md) | number | number of missing references | +| [missingReferences](./kibana-plugin-core-server.savedobjectsexportresultdetails.missingreferences.md) | Array<{ id: string; type: string; }> | missing references details | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporttransform.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporttransform.md index 2effed1ae9d70e..2f83d5188e8919 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporttransform.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporttransform.md @@ -45,7 +45,6 @@ export class Plugin() { }); } } - ``` ## Example 2 @@ -81,6 +80,5 @@ export class Plugin() { }); } } - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporttransformcontext.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporttransformcontext.md index 271f0048842b28..c277308c6fc3bc 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporttransformcontext.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsexporttransformcontext.md @@ -16,5 +16,5 @@ export interface SavedObjectsExportTransformContext | Property | Type | Description | | --- | --- | --- | -| [request](./kibana-plugin-core-server.savedobjectsexporttransformcontext.request.md) | KibanaRequest | The request that initiated the export request. Can be used to create scoped services or client inside the [transformation](./kibana-plugin-core-server.savedobjectsexporttransform.md) | +| [request](./kibana-plugin-core-server.savedobjectsexporttransformcontext.request.md) | KibanaRequest | The request that initiated the export request. Can be used to create scoped services or client inside the [transformation](./kibana-plugin-core-server.savedobjectsexporttransform.md) | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.md index d3696ee71049a2..5f3bb46cc7a99b 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.md @@ -15,22 +15,22 @@ export interface SavedObjectsFindOptions | Property | Type | Description | | --- | --- | --- | -| [defaultSearchOperator](./kibana-plugin-core-server.savedobjectsfindoptions.defaultsearchoperator.md) | 'AND' | 'OR' | The search operator to use with the provided filter. Defaults to OR | -| [fields](./kibana-plugin-core-server.savedobjectsfindoptions.fields.md) | string[] | An array of fields to include in the results | -| [filter](./kibana-plugin-core-server.savedobjectsfindoptions.filter.md) | string | KueryNode | | -| [hasReference](./kibana-plugin-core-server.savedobjectsfindoptions.hasreference.md) | SavedObjectsFindOptionsReference | SavedObjectsFindOptionsReference[] | Search for documents having a reference to the specified objects. Use hasReferenceOperator to specify the operator to use when searching for multiple references. | -| [hasReferenceOperator](./kibana-plugin-core-server.savedobjectsfindoptions.hasreferenceoperator.md) | 'AND' | 'OR' | The operator to use when searching by multiple references using the hasReference option. Defaults to OR | -| [namespaces](./kibana-plugin-core-server.savedobjectsfindoptions.namespaces.md) | string[] | | -| [page](./kibana-plugin-core-server.savedobjectsfindoptions.page.md) | number | | -| [perPage](./kibana-plugin-core-server.savedobjectsfindoptions.perpage.md) | number | | -| [pit](./kibana-plugin-core-server.savedobjectsfindoptions.pit.md) | SavedObjectsPitParams | Search against a specific Point In Time (PIT) that you've opened with [SavedObjectsClient.openPointInTimeForType()](./kibana-plugin-core-server.savedobjectsclient.openpointintimefortype.md). | -| [preference](./kibana-plugin-core-server.savedobjectsfindoptions.preference.md) | string | An optional ES preference value to be used for the query \* | -| [rootSearchFields](./kibana-plugin-core-server.savedobjectsfindoptions.rootsearchfields.md) | string[] | The fields to perform the parsed query against. Unlike the searchFields argument, these are expected to be root fields and will not be modified. If used in conjunction with searchFields, both are concatenated together. | -| [search](./kibana-plugin-core-server.savedobjectsfindoptions.search.md) | string | Search documents using the Elasticsearch Simple Query String syntax. See Elasticsearch Simple Query String query argument for more information | -| [searchAfter](./kibana-plugin-core-server.savedobjectsfindoptions.searchafter.md) | estypes.Id[] | Use the sort values from the previous page to retrieve the next page of results. | -| [searchFields](./kibana-plugin-core-server.savedobjectsfindoptions.searchfields.md) | string[] | The fields to perform the parsed query against. See Elasticsearch Simple Query String fields argument for more information | -| [sortField](./kibana-plugin-core-server.savedobjectsfindoptions.sortfield.md) | string | | -| [sortOrder](./kibana-plugin-core-server.savedobjectsfindoptions.sortorder.md) | estypes.SearchSortOrder | | -| [type](./kibana-plugin-core-server.savedobjectsfindoptions.type.md) | string | string[] | | -| [typeToNamespacesMap](./kibana-plugin-core-server.savedobjectsfindoptions.typetonamespacesmap.md) | Map<string, string[] | undefined> | This map defines each type to search for, and the namespace(s) to search for the type in; this is only intended to be used by a saved object client wrapper. If this is defined, it supersedes the type and namespaces fields when building the Elasticsearch query. Any types that are not included in this map will be excluded entirely. If a type is included but its value is undefined, the operation will search for that type in the Default namespace. | +| [defaultSearchOperator?](./kibana-plugin-core-server.savedobjectsfindoptions.defaultsearchoperator.md) | 'AND' \| 'OR' | (Optional) The search operator to use with the provided filter. Defaults to OR | +| [fields?](./kibana-plugin-core-server.savedobjectsfindoptions.fields.md) | string\[\] | (Optional) An array of fields to include in the results | +| [filter?](./kibana-plugin-core-server.savedobjectsfindoptions.filter.md) | string \| KueryNode | (Optional) | +| [hasReference?](./kibana-plugin-core-server.savedobjectsfindoptions.hasreference.md) | SavedObjectsFindOptionsReference \| SavedObjectsFindOptionsReference\[\] | (Optional) Search for documents having a reference to the specified objects. Use hasReferenceOperator to specify the operator to use when searching for multiple references. | +| [hasReferenceOperator?](./kibana-plugin-core-server.savedobjectsfindoptions.hasreferenceoperator.md) | 'AND' \| 'OR' | (Optional) The operator to use when searching by multiple references using the hasReference option. Defaults to OR | +| [namespaces?](./kibana-plugin-core-server.savedobjectsfindoptions.namespaces.md) | string\[\] | (Optional) | +| [page?](./kibana-plugin-core-server.savedobjectsfindoptions.page.md) | number | (Optional) | +| [perPage?](./kibana-plugin-core-server.savedobjectsfindoptions.perpage.md) | number | (Optional) | +| [pit?](./kibana-plugin-core-server.savedobjectsfindoptions.pit.md) | SavedObjectsPitParams | (Optional) Search against a specific Point In Time (PIT) that you've opened with [SavedObjectsClient.openPointInTimeForType()](./kibana-plugin-core-server.savedobjectsclient.openpointintimefortype.md). | +| [preference?](./kibana-plugin-core-server.savedobjectsfindoptions.preference.md) | string | (Optional) An optional ES preference value to be used for the query \* | +| [rootSearchFields?](./kibana-plugin-core-server.savedobjectsfindoptions.rootsearchfields.md) | string\[\] | (Optional) The fields to perform the parsed query against. Unlike the searchFields argument, these are expected to be root fields and will not be modified. If used in conjunction with searchFields, both are concatenated together. | +| [search?](./kibana-plugin-core-server.savedobjectsfindoptions.search.md) | string | (Optional) Search documents using the Elasticsearch Simple Query String syntax. See Elasticsearch Simple Query String query argument for more information | +| [searchAfter?](./kibana-plugin-core-server.savedobjectsfindoptions.searchafter.md) | estypes.Id\[\] | (Optional) Use the sort values from the previous page to retrieve the next page of results. | +| [searchFields?](./kibana-plugin-core-server.savedobjectsfindoptions.searchfields.md) | string\[\] | (Optional) The fields to perform the parsed query against. See Elasticsearch Simple Query String fields argument for more information | +| [sortField?](./kibana-plugin-core-server.savedobjectsfindoptions.sortfield.md) | string | (Optional) | +| [sortOrder?](./kibana-plugin-core-server.savedobjectsfindoptions.sortorder.md) | estypes.SearchSortOrder | (Optional) | +| [type](./kibana-plugin-core-server.savedobjectsfindoptions.type.md) | string \| string\[\] | | +| [typeToNamespacesMap?](./kibana-plugin-core-server.savedobjectsfindoptions.typetonamespacesmap.md) | Map<string, string\[\] \| undefined> | (Optional) This map defines each type to search for, and the namespace(s) to search for the type in; this is only intended to be used by a saved object client wrapper. If this is defined, it supersedes the type and namespaces fields when building the Elasticsearch query. Any types that are not included in this map will be excluded entirely. If a type is included but its value is undefined, the operation will search for that type in the Default namespace. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptionsreference.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptionsreference.md index db04ef7b162a05..21eb9f06cc11dd 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptionsreference.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptionsreference.md @@ -15,6 +15,6 @@ export interface SavedObjectsFindOptionsReference | Property | Type | Description | | --- | --- | --- | -| [id](./kibana-plugin-core-server.savedobjectsfindoptionsreference.id.md) | string | | -| [type](./kibana-plugin-core-server.savedobjectsfindoptionsreference.type.md) | string | | +| [id](./kibana-plugin-core-server.savedobjectsfindoptionsreference.id.md) | string | | +| [type](./kibana-plugin-core-server.savedobjectsfindoptionsreference.type.md) | string | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindresponse.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindresponse.md index 8176baf44acbd3..4afb825fd0f440 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindresponse.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindresponse.md @@ -18,10 +18,10 @@ export interface SavedObjectsFindResponse | Property | Type | Description | | --- | --- | --- | -| [aggregations](./kibana-plugin-core-server.savedobjectsfindresponse.aggregations.md) | A | | -| [page](./kibana-plugin-core-server.savedobjectsfindresponse.page.md) | number | | -| [per\_page](./kibana-plugin-core-server.savedobjectsfindresponse.per_page.md) | number | | -| [pit\_id](./kibana-plugin-core-server.savedobjectsfindresponse.pit_id.md) | string | | -| [saved\_objects](./kibana-plugin-core-server.savedobjectsfindresponse.saved_objects.md) | Array<SavedObjectsFindResult<T>> | | -| [total](./kibana-plugin-core-server.savedobjectsfindresponse.total.md) | number | | +| [aggregations?](./kibana-plugin-core-server.savedobjectsfindresponse.aggregations.md) | A | (Optional) | +| [page](./kibana-plugin-core-server.savedobjectsfindresponse.page.md) | number | | +| [per\_page](./kibana-plugin-core-server.savedobjectsfindresponse.per_page.md) | number | | +| [pit\_id?](./kibana-plugin-core-server.savedobjectsfindresponse.pit_id.md) | string | (Optional) | +| [saved\_objects](./kibana-plugin-core-server.savedobjectsfindresponse.saved_objects.md) | Array<SavedObjectsFindResult<T>> | | +| [total](./kibana-plugin-core-server.savedobjectsfindresponse.total.md) | number | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindresult.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindresult.md index a729ce32e1c802..f2ba01697da176 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindresult.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindresult.md @@ -10,11 +10,12 @@ ```typescript export interface SavedObjectsFindResult extends SavedObject ``` +Extends: SavedObject<T> ## Properties | Property | Type | Description | | --- | --- | --- | -| [score](./kibana-plugin-core-server.savedobjectsfindresult.score.md) | number | The Elasticsearch _score of this result. | -| [sort](./kibana-plugin-core-server.savedobjectsfindresult.sort.md) | string[] | The Elasticsearch sort value of this result. | +| [score](./kibana-plugin-core-server.savedobjectsfindresult.score.md) | number | The Elasticsearch _score of this result. | +| [sort?](./kibana-plugin-core-server.savedobjectsfindresult.sort.md) | string\[\] | (Optional) The Elasticsearch sort value of this result. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindresult.sort.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindresult.sort.md index e73d6b4926d893..5df1b3291b072e 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindresult.sort.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindresult.sort.md @@ -36,6 +36,5 @@ const page2 = await savedObjectsClient.find({ searchAfter: lastHit.sort, }); await savedObjectsClient.closePointInTime(page2.pit_id); - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportactionrequiredwarning.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportactionrequiredwarning.md index c8b96004662d40..c4ec5fdd2f8e6a 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportactionrequiredwarning.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportactionrequiredwarning.md @@ -18,8 +18,8 @@ export interface SavedObjectsImportActionRequiredWarning | Property | Type | Description | | --- | --- | --- | -| [actionPath](./kibana-plugin-core-server.savedobjectsimportactionrequiredwarning.actionpath.md) | string | The path (without the basePath) that the user should be redirect to address this warning. | -| [buttonLabel](./kibana-plugin-core-server.savedobjectsimportactionrequiredwarning.buttonlabel.md) | string | An optional label to use for the link button. If unspecified, a default label will be used. | -| [message](./kibana-plugin-core-server.savedobjectsimportactionrequiredwarning.message.md) | string | The translated message to display to the user. | -| [type](./kibana-plugin-core-server.savedobjectsimportactionrequiredwarning.type.md) | 'action_required' | | +| [actionPath](./kibana-plugin-core-server.savedobjectsimportactionrequiredwarning.actionpath.md) | string | The path (without the basePath) that the user should be redirect to address this warning. | +| [buttonLabel?](./kibana-plugin-core-server.savedobjectsimportactionrequiredwarning.buttonlabel.md) | string | (Optional) An optional label to use for the link button. If unspecified, a default label will be used. | +| [message](./kibana-plugin-core-server.savedobjectsimportactionrequiredwarning.message.md) | string | The translated message to display to the user. | +| [type](./kibana-plugin-core-server.savedobjectsimportactionrequiredwarning.type.md) | 'action\_required' | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportambiguousconflicterror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportambiguousconflicterror.md index d2c0a397ebe8a8..7d275fa199c5ba 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportambiguousconflicterror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportambiguousconflicterror.md @@ -16,6 +16,6 @@ export interface SavedObjectsImportAmbiguousConflictError | Property | Type | Description | | --- | --- | --- | -| [destinations](./kibana-plugin-core-server.savedobjectsimportambiguousconflicterror.destinations.md) | Array<{
id: string;
title?: string;
updatedAt?: string;
}> | | -| [type](./kibana-plugin-core-server.savedobjectsimportambiguousconflicterror.type.md) | 'ambiguous_conflict' | | +| [destinations](./kibana-plugin-core-server.savedobjectsimportambiguousconflicterror.destinations.md) | Array<{ id: string; title?: string; updatedAt?: string; }> | | +| [type](./kibana-plugin-core-server.savedobjectsimportambiguousconflicterror.type.md) | 'ambiguous\_conflict' | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportconflicterror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportconflicterror.md index 153cd55c9199e1..9456e042035fed 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportconflicterror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportconflicterror.md @@ -16,6 +16,6 @@ export interface SavedObjectsImportConflictError | Property | Type | Description | | --- | --- | --- | -| [destinationId](./kibana-plugin-core-server.savedobjectsimportconflicterror.destinationid.md) | string | | -| [type](./kibana-plugin-core-server.savedobjectsimportconflicterror.type.md) | 'conflict' | | +| [destinationId?](./kibana-plugin-core-server.savedobjectsimportconflicterror.destinationid.md) | string | (Optional) | +| [type](./kibana-plugin-core-server.savedobjectsimportconflicterror.type.md) | 'conflict' | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporter.__private_.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporter.__private_.md deleted file mode 100644 index 2d780a957e0871..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporter.__private_.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImporter](./kibana-plugin-core-server.savedobjectsimporter.md) > ["\#private"](./kibana-plugin-core-server.savedobjectsimporter.__private_.md) - -## SavedObjectsImporter."\#private" property - -Signature: - -```typescript -#private; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporter._constructor_.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporter._constructor_.md index 67df4dbf09ad69..8451e35d1518e8 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporter._constructor_.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporter._constructor_.md @@ -20,5 +20,5 @@ constructor({ savedObjectsClient, typeRegistry, importSizeLimit, }: { | Parameter | Type | Description | | --- | --- | --- | -| { savedObjectsClient, typeRegistry, importSizeLimit, } | {
savedObjectsClient: SavedObjectsClientContract;
typeRegistry: ISavedObjectTypeRegistry;
importSizeLimit: number;
} | | +| { savedObjectsClient, typeRegistry, importSizeLimit, } | { savedObjectsClient: SavedObjectsClientContract; typeRegistry: ISavedObjectTypeRegistry; importSizeLimit: number; } | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporter.import.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporter.import.md index 5b1b2d733fa0e8..1ca6058e7d742d 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporter.import.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporter.import.md @@ -16,11 +16,11 @@ import({ readStream, createNewCopies, namespace, overwrite, }: SavedObjectsImpor | Parameter | Type | Description | | --- | --- | --- | -| { readStream, createNewCopies, namespace, overwrite, } | SavedObjectsImportOptions | | +| { readStream, createNewCopies, namespace, overwrite, } | SavedObjectsImportOptions | | Returns: -`Promise` +Promise<SavedObjectsImportResponse> ## Exceptions diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporter.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporter.md index cd5c71077e6660..18ce27ca2c0dcb 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporter.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporter.md @@ -17,12 +17,6 @@ export declare class SavedObjectsImporter | --- | --- | --- | | [(constructor)({ savedObjectsClient, typeRegistry, importSizeLimit, })](./kibana-plugin-core-server.savedobjectsimporter._constructor_.md) | | Constructs a new instance of the SavedObjectsImporter class | -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| ["\#private"](./kibana-plugin-core-server.savedobjectsimporter.__private_.md) | | | | - ## Methods | Method | Modifiers | Description | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporter.resolveimporterrors.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporter.resolveimporterrors.md index 9418b581ad5b20..e1c95723ed3a59 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporter.resolveimporterrors.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporter.resolveimporterrors.md @@ -16,11 +16,11 @@ resolveImportErrors({ readStream, createNewCopies, namespace, retries, }: SavedO | Parameter | Type | Description | | --- | --- | --- | -| { readStream, createNewCopies, namespace, retries, } | SavedObjectsResolveImportErrorsOptions | | +| { readStream, createNewCopies, namespace, retries, } | SavedObjectsResolveImportErrorsOptions | | Returns: -`Promise` +Promise<SavedObjectsImportResponse> ## Exceptions diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.importsizeexceeded.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.importsizeexceeded.md index 9dcc43633d9eb2..421557445670ec 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.importsizeexceeded.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.importsizeexceeded.md @@ -14,9 +14,9 @@ static importSizeExceeded(limit: number): SavedObjectsImportError; | Parameter | Type | Description | | --- | --- | --- | -| limit | number | | +| limit | number | | Returns: -`SavedObjectsImportError` +SavedObjectsImportError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.md index b37b6143e7b73a..2e4fd1a01eb040 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.md @@ -10,13 +10,14 @@ ```typescript export declare class SavedObjectsImportError extends Error ``` +Extends: Error ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [attributes](./kibana-plugin-core-server.savedobjectsimporterror.attributes.md) | | Record<string, any> | undefined | | -| [type](./kibana-plugin-core-server.savedobjectsimporterror.type.md) | | string | | +| [attributes?](./kibana-plugin-core-server.savedobjectsimporterror.attributes.md) | | Record<string, any> \| undefined | (Optional) | +| [type](./kibana-plugin-core-server.savedobjectsimporterror.type.md) | | string | | ## Methods diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.nonuniqueimportobjects.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.nonuniqueimportobjects.md index a4a1975af0b4c4..29533db10302c9 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.nonuniqueimportobjects.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.nonuniqueimportobjects.md @@ -14,9 +14,9 @@ static nonUniqueImportObjects(nonUniqueEntries: string[]): SavedObjectsImportErr | Parameter | Type | Description | | --- | --- | --- | -| nonUniqueEntries | string[] | | +| nonUniqueEntries | string\[\] | | Returns: -`SavedObjectsImportError` +SavedObjectsImportError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.nonuniqueretrydestinations.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.nonuniqueretrydestinations.md index a60f6c34cb7e25..4fd23c3f6d62db 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.nonuniqueretrydestinations.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.nonuniqueretrydestinations.md @@ -14,9 +14,9 @@ static nonUniqueRetryDestinations(nonUniqueRetryDestinations: string[]): SavedOb | Parameter | Type | Description | | --- | --- | --- | -| nonUniqueRetryDestinations | string[] | | +| nonUniqueRetryDestinations | string\[\] | | Returns: -`SavedObjectsImportError` +SavedObjectsImportError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.nonuniqueretryobjects.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.nonuniqueretryobjects.md index 187904ccf59a23..bf8a2c2c01760f 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.nonuniqueretryobjects.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.nonuniqueretryobjects.md @@ -14,9 +14,9 @@ static nonUniqueRetryObjects(nonUniqueRetryObjects: string[]): SavedObjectsImpor | Parameter | Type | Description | | --- | --- | --- | -| nonUniqueRetryObjects | string[] | | +| nonUniqueRetryObjects | string\[\] | | Returns: -`SavedObjectsImportError` +SavedObjectsImportError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.referencesfetcherror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.referencesfetcherror.md index c9392739838dc2..4202f164900b31 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.referencesfetcherror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporterror.referencesfetcherror.md @@ -14,9 +14,9 @@ static referencesFetchError(objects: SavedObject[]): SavedObjectsImportError; | Parameter | Type | Description | | --- | --- | --- | -| objects | SavedObject[] | | +| objects | SavedObject\[\] | | Returns: -`SavedObjectsImportError` +SavedObjectsImportError diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportfailure.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportfailure.md index 536f48f45e0c5d..52db837479cf66 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportfailure.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportfailure.md @@ -16,10 +16,10 @@ export interface SavedObjectsImportFailure | Property | Type | Description | | --- | --- | --- | -| [error](./kibana-plugin-core-server.savedobjectsimportfailure.error.md) | SavedObjectsImportConflictError | SavedObjectsImportAmbiguousConflictError | SavedObjectsImportUnsupportedTypeError | SavedObjectsImportMissingReferencesError | SavedObjectsImportUnknownError | | -| [id](./kibana-plugin-core-server.savedobjectsimportfailure.id.md) | string | | -| [meta](./kibana-plugin-core-server.savedobjectsimportfailure.meta.md) | {
title?: string;
icon?: string;
} | | -| [overwrite](./kibana-plugin-core-server.savedobjectsimportfailure.overwrite.md) | boolean | If overwrite is specified, an attempt was made to overwrite an existing object. | -| [title](./kibana-plugin-core-server.savedobjectsimportfailure.title.md) | string | | -| [type](./kibana-plugin-core-server.savedobjectsimportfailure.type.md) | string | | +| [error](./kibana-plugin-core-server.savedobjectsimportfailure.error.md) | SavedObjectsImportConflictError \| SavedObjectsImportAmbiguousConflictError \| SavedObjectsImportUnsupportedTypeError \| SavedObjectsImportMissingReferencesError \| SavedObjectsImportUnknownError | | +| [id](./kibana-plugin-core-server.savedobjectsimportfailure.id.md) | string | | +| [meta](./kibana-plugin-core-server.savedobjectsimportfailure.meta.md) | { title?: string; icon?: string; } | | +| [overwrite?](./kibana-plugin-core-server.savedobjectsimportfailure.overwrite.md) | boolean | (Optional) If overwrite is specified, an attempt was made to overwrite an existing object. | +| [title?](./kibana-plugin-core-server.savedobjectsimportfailure.title.md) | string | (Optional) | +| [type](./kibana-plugin-core-server.savedobjectsimportfailure.type.md) | string | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporthookresult.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporthookresult.md index 9756ce7fac3501..eb16aa2fb02855 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporthookresult.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimporthookresult.md @@ -16,5 +16,5 @@ export interface SavedObjectsImportHookResult | Property | Type | Description | | --- | --- | --- | -| [warnings](./kibana-plugin-core-server.savedobjectsimporthookresult.warnings.md) | SavedObjectsImportWarning[] | An optional list of warnings to display in the UI when the import succeeds. | +| [warnings?](./kibana-plugin-core-server.savedobjectsimporthookresult.warnings.md) | SavedObjectsImportWarning\[\] | (Optional) An optional list of warnings to display in the UI when the import succeeds. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportmissingreferenceserror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportmissingreferenceserror.md index 01557eff549f64..25d2a88e87e8b5 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportmissingreferenceserror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportmissingreferenceserror.md @@ -16,6 +16,6 @@ export interface SavedObjectsImportMissingReferencesError | Property | Type | Description | | --- | --- | --- | -| [references](./kibana-plugin-core-server.savedobjectsimportmissingreferenceserror.references.md) | Array<{
type: string;
id: string;
}> | | -| [type](./kibana-plugin-core-server.savedobjectsimportmissingreferenceserror.type.md) | 'missing_references' | | +| [references](./kibana-plugin-core-server.savedobjectsimportmissingreferenceserror.references.md) | Array<{ type: string; id: string; }> | | +| [type](./kibana-plugin-core-server.savedobjectsimportmissingreferenceserror.type.md) | 'missing\_references' | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportoptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportoptions.md index ddda72938b13aa..58d0f4bf982c36 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportoptions.md @@ -16,8 +16,8 @@ export interface SavedObjectsImportOptions | Property | Type | Description | | --- | --- | --- | -| [createNewCopies](./kibana-plugin-core-server.savedobjectsimportoptions.createnewcopies.md) | boolean | If true, will create new copies of import objects, each with a random id and undefined originId. | -| [namespace](./kibana-plugin-core-server.savedobjectsimportoptions.namespace.md) | string | if specified, will import in given namespace, else will import as global object | -| [overwrite](./kibana-plugin-core-server.savedobjectsimportoptions.overwrite.md) | boolean | If true, will override existing object if present. Note: this has no effect when used with the createNewCopies option. | -| [readStream](./kibana-plugin-core-server.savedobjectsimportoptions.readstream.md) | Readable | The stream of [saved objects](./kibana-plugin-core-server.savedobject.md) to import | +| [createNewCopies](./kibana-plugin-core-server.savedobjectsimportoptions.createnewcopies.md) | boolean | If true, will create new copies of import objects, each with a random id and undefined originId. | +| [namespace?](./kibana-plugin-core-server.savedobjectsimportoptions.namespace.md) | string | (Optional) if specified, will import in given namespace, else will import as global object | +| [overwrite](./kibana-plugin-core-server.savedobjectsimportoptions.overwrite.md) | boolean | If true, will override existing object if present. Note: this has no effect when used with the createNewCopies option. | +| [readStream](./kibana-plugin-core-server.savedobjectsimportoptions.readstream.md) | Readable | The stream of [saved objects](./kibana-plugin-core-server.savedobject.md) to import | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportresponse.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportresponse.md index 55f651197490f7..e39b4b02bb55d6 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportresponse.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportresponse.md @@ -16,9 +16,9 @@ export interface SavedObjectsImportResponse | Property | Type | Description | | --- | --- | --- | -| [errors](./kibana-plugin-core-server.savedobjectsimportresponse.errors.md) | SavedObjectsImportFailure[] | | -| [success](./kibana-plugin-core-server.savedobjectsimportresponse.success.md) | boolean | | -| [successCount](./kibana-plugin-core-server.savedobjectsimportresponse.successcount.md) | number | | -| [successResults](./kibana-plugin-core-server.savedobjectsimportresponse.successresults.md) | SavedObjectsImportSuccess[] | | -| [warnings](./kibana-plugin-core-server.savedobjectsimportresponse.warnings.md) | SavedObjectsImportWarning[] | | +| [errors?](./kibana-plugin-core-server.savedobjectsimportresponse.errors.md) | SavedObjectsImportFailure\[\] | (Optional) | +| [success](./kibana-plugin-core-server.savedobjectsimportresponse.success.md) | boolean | | +| [successCount](./kibana-plugin-core-server.savedobjectsimportresponse.successcount.md) | number | | +| [successResults?](./kibana-plugin-core-server.savedobjectsimportresponse.successresults.md) | SavedObjectsImportSuccess\[\] | (Optional) | +| [warnings](./kibana-plugin-core-server.savedobjectsimportresponse.warnings.md) | SavedObjectsImportWarning\[\] | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportretry.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportretry.md index 70693e6f43a391..b79ec63ed86c06 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportretry.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportretry.md @@ -16,11 +16,11 @@ export interface SavedObjectsImportRetry | Property | Type | Description | | --- | --- | --- | -| [createNewCopy](./kibana-plugin-core-server.savedobjectsimportretry.createnewcopy.md) | boolean | If createNewCopy is specified, the new object has a new (undefined) origin ID. This is only needed for the case where createNewCopies mode is disabled and ambiguous source conflicts are detected. | -| [destinationId](./kibana-plugin-core-server.savedobjectsimportretry.destinationid.md) | string | The object ID that will be created or overwritten. If not specified, the id field will be used. | -| [id](./kibana-plugin-core-server.savedobjectsimportretry.id.md) | string | | -| [ignoreMissingReferences](./kibana-plugin-core-server.savedobjectsimportretry.ignoremissingreferences.md) | boolean | If ignoreMissingReferences is specified, reference validation will be skipped for this object. | -| [overwrite](./kibana-plugin-core-server.savedobjectsimportretry.overwrite.md) | boolean | | -| [replaceReferences](./kibana-plugin-core-server.savedobjectsimportretry.replacereferences.md) | Array<{
type: string;
from: string;
to: string;
}> | | -| [type](./kibana-plugin-core-server.savedobjectsimportretry.type.md) | string | | +| [createNewCopy?](./kibana-plugin-core-server.savedobjectsimportretry.createnewcopy.md) | boolean | (Optional) If createNewCopy is specified, the new object has a new (undefined) origin ID. This is only needed for the case where createNewCopies mode is disabled and ambiguous source conflicts are detected. | +| [destinationId?](./kibana-plugin-core-server.savedobjectsimportretry.destinationid.md) | string | (Optional) The object ID that will be created or overwritten. If not specified, the id field will be used. | +| [id](./kibana-plugin-core-server.savedobjectsimportretry.id.md) | string | | +| [ignoreMissingReferences?](./kibana-plugin-core-server.savedobjectsimportretry.ignoremissingreferences.md) | boolean | (Optional) If ignoreMissingReferences is specified, reference validation will be skipped for this object. | +| [overwrite](./kibana-plugin-core-server.savedobjectsimportretry.overwrite.md) | boolean | | +| [replaceReferences](./kibana-plugin-core-server.savedobjectsimportretry.replacereferences.md) | Array<{ type: string; from: string; to: string; }> | | +| [type](./kibana-plugin-core-server.savedobjectsimportretry.type.md) | string | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportsimplewarning.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportsimplewarning.md index 52d46e4f8db805..7dc42854004784 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportsimplewarning.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportsimplewarning.md @@ -16,6 +16,6 @@ export interface SavedObjectsImportSimpleWarning | Property | Type | Description | | --- | --- | --- | -| [message](./kibana-plugin-core-server.savedobjectsimportsimplewarning.message.md) | string | The translated message to display to the user | -| [type](./kibana-plugin-core-server.savedobjectsimportsimplewarning.type.md) | 'simple' | | +| [message](./kibana-plugin-core-server.savedobjectsimportsimplewarning.message.md) | string | The translated message to display to the user | +| [type](./kibana-plugin-core-server.savedobjectsimportsimplewarning.type.md) | 'simple' | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportsuccess.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportsuccess.md index 18a226f636b1db..74242ba6d75be2 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportsuccess.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportsuccess.md @@ -16,10 +16,10 @@ export interface SavedObjectsImportSuccess | Property | Type | Description | | --- | --- | --- | -| [createNewCopy](./kibana-plugin-core-server.savedobjectsimportsuccess.createnewcopy.md) | boolean | | -| [destinationId](./kibana-plugin-core-server.savedobjectsimportsuccess.destinationid.md) | string | If destinationId is specified, the new object has a new ID that is different from the import ID. | -| [id](./kibana-plugin-core-server.savedobjectsimportsuccess.id.md) | string | | -| [meta](./kibana-plugin-core-server.savedobjectsimportsuccess.meta.md) | {
title?: string;
icon?: string;
} | | -| [overwrite](./kibana-plugin-core-server.savedobjectsimportsuccess.overwrite.md) | boolean | If overwrite is specified, this object overwrote an existing one (or will do so, in the case of a pending resolution). | -| [type](./kibana-plugin-core-server.savedobjectsimportsuccess.type.md) | string | | +| [createNewCopy?](./kibana-plugin-core-server.savedobjectsimportsuccess.createnewcopy.md) | boolean | (Optional) | +| [destinationId?](./kibana-plugin-core-server.savedobjectsimportsuccess.destinationid.md) | string | (Optional) If destinationId is specified, the new object has a new ID that is different from the import ID. | +| [id](./kibana-plugin-core-server.savedobjectsimportsuccess.id.md) | string | | +| [meta](./kibana-plugin-core-server.savedobjectsimportsuccess.meta.md) | { title?: string; icon?: string; } | | +| [overwrite?](./kibana-plugin-core-server.savedobjectsimportsuccess.overwrite.md) | boolean | (Optional) If overwrite is specified, this object overwrote an existing one (or will do so, in the case of a pending resolution). | +| [type](./kibana-plugin-core-server.savedobjectsimportsuccess.type.md) | string | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportunknownerror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportunknownerror.md index c178d363761ef3..158afd45752fcf 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportunknownerror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportunknownerror.md @@ -16,7 +16,7 @@ export interface SavedObjectsImportUnknownError | Property | Type | Description | | --- | --- | --- | -| [message](./kibana-plugin-core-server.savedobjectsimportunknownerror.message.md) | string | | -| [statusCode](./kibana-plugin-core-server.savedobjectsimportunknownerror.statuscode.md) | number | | -| [type](./kibana-plugin-core-server.savedobjectsimportunknownerror.type.md) | 'unknown' | | +| [message](./kibana-plugin-core-server.savedobjectsimportunknownerror.message.md) | string | | +| [statusCode](./kibana-plugin-core-server.savedobjectsimportunknownerror.statuscode.md) | number | | +| [type](./kibana-plugin-core-server.savedobjectsimportunknownerror.type.md) | 'unknown' | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportunsupportedtypeerror.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportunsupportedtypeerror.md index 3f580b27b7fde3..48aff60c69d139 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportunsupportedtypeerror.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportunsupportedtypeerror.md @@ -16,5 +16,5 @@ export interface SavedObjectsImportUnsupportedTypeError | Property | Type | Description | | --- | --- | --- | -| [type](./kibana-plugin-core-server.savedobjectsimportunsupportedtypeerror.type.md) | 'unsupported_type' | | +| [type](./kibana-plugin-core-server.savedobjectsimportunsupportedtypeerror.type.md) | 'unsupported\_type' | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsincrementcounterfield.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsincrementcounterfield.md index 10615c7da4c34c..a45d48523f4613 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsincrementcounterfield.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsincrementcounterfield.md @@ -15,6 +15,6 @@ export interface SavedObjectsIncrementCounterField | Property | Type | Description | | --- | --- | --- | -| [fieldName](./kibana-plugin-core-server.savedobjectsincrementcounterfield.fieldname.md) | string | The field name to increment the counter by. | -| [incrementBy](./kibana-plugin-core-server.savedobjectsincrementcounterfield.incrementby.md) | number | The number to increment the field by (defaults to 1). | +| [fieldName](./kibana-plugin-core-server.savedobjectsincrementcounterfield.fieldname.md) | string | The field name to increment the counter by. | +| [incrementBy?](./kibana-plugin-core-server.savedobjectsincrementcounterfield.incrementby.md) | number | (Optional) The number to increment the field by (defaults to 1). | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsincrementcounteroptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsincrementcounteroptions.md index 8da2458cf007ed..8740ffb1be185c 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsincrementcounteroptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsincrementcounteroptions.md @@ -10,13 +10,14 @@ ```typescript export interface SavedObjectsIncrementCounterOptions extends SavedObjectsBaseOptions ``` +Extends: SavedObjectsBaseOptions ## Properties | Property | Type | Description | | --- | --- | --- | -| [initialize](./kibana-plugin-core-server.savedobjectsincrementcounteroptions.initialize.md) | boolean | (default=false) If true, sets all the counter fields to 0 if they don't already exist. Existing fields will be left as-is and won't be incremented. | -| [migrationVersion](./kibana-plugin-core-server.savedobjectsincrementcounteroptions.migrationversion.md) | SavedObjectsMigrationVersion | [SavedObjectsMigrationVersion](./kibana-plugin-core-server.savedobjectsmigrationversion.md) | -| [refresh](./kibana-plugin-core-server.savedobjectsincrementcounteroptions.refresh.md) | MutatingOperationRefreshSetting | (default='wait\_for') The Elasticsearch refresh setting for this operation. See [MutatingOperationRefreshSetting](./kibana-plugin-core-server.mutatingoperationrefreshsetting.md) | -| [upsertAttributes](./kibana-plugin-core-server.savedobjectsincrementcounteroptions.upsertattributes.md) | Attributes | Attributes to use when upserting the document if it doesn't exist. | +| [initialize?](./kibana-plugin-core-server.savedobjectsincrementcounteroptions.initialize.md) | boolean | (Optional) (default=false) If true, sets all the counter fields to 0 if they don't already exist. Existing fields will be left as-is and won't be incremented. | +| [migrationVersion?](./kibana-plugin-core-server.savedobjectsincrementcounteroptions.migrationversion.md) | SavedObjectsMigrationVersion | (Optional) [SavedObjectsMigrationVersion](./kibana-plugin-core-server.savedobjectsmigrationversion.md) | +| [refresh?](./kibana-plugin-core-server.savedobjectsincrementcounteroptions.refresh.md) | MutatingOperationRefreshSetting | (Optional) (default='wait\_for') The Elasticsearch refresh setting for this operation. See [MutatingOperationRefreshSetting](./kibana-plugin-core-server.mutatingoperationrefreshsetting.md) | +| [upsertAttributes?](./kibana-plugin-core-server.savedobjectsincrementcounteroptions.upsertattributes.md) | Attributes | (Optional) Attributes to use when upserting the document if it doesn't exist. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsmigrationlogger.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsmigrationlogger.md index 697f8823c4966c..80f332c395159c 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsmigrationlogger.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsmigrationlogger.md @@ -15,9 +15,9 @@ export interface SavedObjectsMigrationLogger | Property | Type | Description | | --- | --- | --- | -| [debug](./kibana-plugin-core-server.savedobjectsmigrationlogger.debug.md) | (msg: string) => void | | -| [error](./kibana-plugin-core-server.savedobjectsmigrationlogger.error.md) | <Meta extends LogMeta = LogMeta>(msg: string, meta: Meta) => void | | -| [info](./kibana-plugin-core-server.savedobjectsmigrationlogger.info.md) | (msg: string) => void | | -| [warn](./kibana-plugin-core-server.savedobjectsmigrationlogger.warn.md) | (msg: string) => void | | -| [warning](./kibana-plugin-core-server.savedobjectsmigrationlogger.warning.md) | (msg: string) => void | | +| [debug](./kibana-plugin-core-server.savedobjectsmigrationlogger.debug.md) | (msg: string) => void | | +| [error](./kibana-plugin-core-server.savedobjectsmigrationlogger.error.md) | <Meta extends LogMeta = LogMeta>(msg: string, meta: Meta) => void | | +| [info](./kibana-plugin-core-server.savedobjectsmigrationlogger.info.md) | (msg: string) => void | | +| [warn](./kibana-plugin-core-server.savedobjectsmigrationlogger.warn.md) | (msg: string) => void | | +| [warning](./kibana-plugin-core-server.savedobjectsmigrationlogger.warning.md) | (msg: string) => void | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsopenpointintimeoptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsopenpointintimeoptions.md index fc825e3bf29370..331fb6cbe0a6e1 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsopenpointintimeoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsopenpointintimeoptions.md @@ -15,7 +15,7 @@ export interface SavedObjectsOpenPointInTimeOptions | Property | Type | Description | | --- | --- | --- | -| [keepAlive](./kibana-plugin-core-server.savedobjectsopenpointintimeoptions.keepalive.md) | string | Optionally specify how long ES should keep the PIT alive until the next request. Defaults to 5m. | -| [namespaces](./kibana-plugin-core-server.savedobjectsopenpointintimeoptions.namespaces.md) | string[] | An optional list of namespaces to be used when opening the PIT.When the spaces plugin is enabled: - this will default to the user's current space (as determined by the URL) - if specified, the user's current space will be ignored - ['*'] will search across all available spaces | -| [preference](./kibana-plugin-core-server.savedobjectsopenpointintimeoptions.preference.md) | string | An optional ES preference value to be used for the query. | +| [keepAlive?](./kibana-plugin-core-server.savedobjectsopenpointintimeoptions.keepalive.md) | string | (Optional) Optionally specify how long ES should keep the PIT alive until the next request. Defaults to 5m. | +| [namespaces?](./kibana-plugin-core-server.savedobjectsopenpointintimeoptions.namespaces.md) | string\[\] | (Optional) An optional list of namespaces to be used when opening the PIT.When the spaces plugin is enabled: - this will default to the user's current space (as determined by the URL) - if specified, the user's current space will be ignored - ['*'] will search across all available spaces | +| [preference?](./kibana-plugin-core-server.savedobjectsopenpointintimeoptions.preference.md) | string | (Optional) An optional ES preference value to be used for the query. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsopenpointintimeresponse.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsopenpointintimeresponse.md index c4be2692763a5f..e3804d63a1e6c9 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsopenpointintimeresponse.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsopenpointintimeresponse.md @@ -15,5 +15,5 @@ export interface SavedObjectsOpenPointInTimeResponse | Property | Type | Description | | --- | --- | --- | -| [id](./kibana-plugin-core-server.savedobjectsopenpointintimeresponse.id.md) | string | PIT ID returned from ES. | +| [id](./kibana-plugin-core-server.savedobjectsopenpointintimeresponse.id.md) | string | PIT ID returned from ES. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectspitparams.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectspitparams.md index 7bffca7cda281f..3109a6bd88f7ee 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectspitparams.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectspitparams.md @@ -15,6 +15,6 @@ export interface SavedObjectsPitParams | Property | Type | Description | | --- | --- | --- | -| [id](./kibana-plugin-core-server.savedobjectspitparams.id.md) | string | | -| [keepAlive](./kibana-plugin-core-server.savedobjectspitparams.keepalive.md) | string | | +| [id](./kibana-plugin-core-server.savedobjectspitparams.id.md) | string | | +| [keepAlive?](./kibana-plugin-core-server.savedobjectspitparams.keepalive.md) | string | (Optional) | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrawdoc.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrawdoc.md index 54bca496b9930b..8bce7fac941afd 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrawdoc.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrawdoc.md @@ -16,8 +16,8 @@ export interface SavedObjectsRawDoc | Property | Type | Description | | --- | --- | --- | -| [\_id](./kibana-plugin-core-server.savedobjectsrawdoc._id.md) | string | | -| [\_primary\_term](./kibana-plugin-core-server.savedobjectsrawdoc._primary_term.md) | number | | -| [\_seq\_no](./kibana-plugin-core-server.savedobjectsrawdoc._seq_no.md) | number | | -| [\_source](./kibana-plugin-core-server.savedobjectsrawdoc._source.md) | SavedObjectsRawDocSource | | +| [\_id](./kibana-plugin-core-server.savedobjectsrawdoc._id.md) | string | | +| [\_primary\_term?](./kibana-plugin-core-server.savedobjectsrawdoc._primary_term.md) | number | (Optional) | +| [\_seq\_no?](./kibana-plugin-core-server.savedobjectsrawdoc._seq_no.md) | number | (Optional) | +| [\_source](./kibana-plugin-core-server.savedobjectsrawdoc._source.md) | SavedObjectsRawDocSource | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrawdocparseoptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrawdocparseoptions.md index 708d1bc9c514dd..dc2166258d0c01 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrawdocparseoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrawdocparseoptions.md @@ -16,5 +16,5 @@ export interface SavedObjectsRawDocParseOptions | Property | Type | Description | | --- | --- | --- | -| [namespaceTreatment](./kibana-plugin-core-server.savedobjectsrawdocparseoptions.namespacetreatment.md) | 'strict' | 'lax' | Optional setting to allow for lax handling of the raw document ID and namespace field. This is needed when a previously single-namespace object type is converted to a multi-namespace object type, and it is only intended to be used during upgrade migrations.If not specified, the default treatment is strict. | +| [namespaceTreatment?](./kibana-plugin-core-server.savedobjectsrawdocparseoptions.namespacetreatment.md) | 'strict' \| 'lax' | (Optional) Optional setting to allow for lax handling of the raw document ID and namespace field. This is needed when a previously single-namespace object type is converted to a multi-namespace object type, and it is only intended to be used during upgrade migrations.If not specified, the default treatment is strict. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsremovereferencestooptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsremovereferencestooptions.md index 0874aa460e2206..c10f74297305d0 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsremovereferencestooptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsremovereferencestooptions.md @@ -10,10 +10,11 @@ ```typescript export interface SavedObjectsRemoveReferencesToOptions extends SavedObjectsBaseOptions ``` +Extends: SavedObjectsBaseOptions ## Properties | Property | Type | Description | | --- | --- | --- | -| [refresh](./kibana-plugin-core-server.savedobjectsremovereferencestooptions.refresh.md) | boolean | The Elasticsearch Refresh setting for this operation. Defaults to true | +| [refresh?](./kibana-plugin-core-server.savedobjectsremovereferencestooptions.refresh.md) | boolean | (Optional) The Elasticsearch Refresh setting for this operation. Defaults to true | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsremovereferencestoresponse.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsremovereferencestoresponse.md index b5468a300d51d1..cd10a9f916b037 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsremovereferencestoresponse.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsremovereferencestoresponse.md @@ -10,10 +10,11 @@ ```typescript export interface SavedObjectsRemoveReferencesToResponse extends SavedObjectsBaseOptions ``` +Extends: SavedObjectsBaseOptions ## Properties | Property | Type | Description | | --- | --- | --- | -| [updated](./kibana-plugin-core-server.savedobjectsremovereferencestoresponse.updated.md) | number | The number of objects that have been updated by this operation | +| [updated](./kibana-plugin-core-server.savedobjectsremovereferencestoresponse.updated.md) | number | The number of objects that have been updated by this operation | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.bulkcreate.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.bulkcreate.md index 17daf3ab1f0423..e71a9d266a3db7 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.bulkcreate.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.bulkcreate.md @@ -16,12 +16,12 @@ bulkCreate(objects: Array>, options | Parameter | Type | Description | | --- | --- | --- | -| objects | Array<SavedObjectsBulkCreateObject<T>> | | -| options | SavedObjectsCreateOptions | | +| objects | Array<SavedObjectsBulkCreateObject<T>> | \[{ type, id, attributes, references, migrationVersion }\] | +| options | SavedObjectsCreateOptions | {boolean} \[options.overwrite=false\] - overwrites existing documents {string} \[options.namespace\] | Returns: -`Promise>` +Promise<SavedObjectsBulkResponse<T>> {promise} - {saved\_objects: \[\[{ id, type, version, references, attributes, error: { message } }\]} diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.bulkget.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.bulkget.md index 354ee4dfff62c6..ab265132d606fa 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.bulkget.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.bulkget.md @@ -16,12 +16,12 @@ bulkGet(objects?: SavedObjectsBulkGetObject[], options?: SavedObjec | Parameter | Type | Description | | --- | --- | --- | -| objects | SavedObjectsBulkGetObject[] | | -| options | SavedObjectsBaseOptions | | +| objects | SavedObjectsBulkGetObject\[\] | an array of objects containing id, type and optionally fields | +| options | SavedObjectsBaseOptions | {string} \[options.namespace\] | Returns: -`Promise>` +Promise<SavedObjectsBulkResponse<T>> {promise} - { saved\_objects: \[{ id, type, version, attributes }\] } diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.bulkresolve.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.bulkresolve.md index f489972207a61c..a67521753892da 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.bulkresolve.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.bulkresolve.md @@ -16,12 +16,12 @@ bulkResolve(objects: SavedObjectsBulkResolveObject[], options?: Sav | Parameter | Type | Description | | --- | --- | --- | -| objects | SavedObjectsBulkResolveObject[] | | -| options | SavedObjectsBaseOptions | | +| objects | SavedObjectsBulkResolveObject\[\] | an array of objects containing id, type | +| options | SavedObjectsBaseOptions | {string} \[options.namespace\] | Returns: -`Promise>` +Promise<SavedObjectsBulkResolveResponse<T>> {promise} - { resolved\_objects: \[{ saved\_object, outcome }\] } diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.bulkupdate.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.bulkupdate.md index de61549b7680d7..c4244a8e34e3c4 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.bulkupdate.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.bulkupdate.md @@ -16,12 +16,12 @@ bulkUpdate(objects: Array>, options | Parameter | Type | Description | | --- | --- | --- | -| objects | Array<SavedObjectsBulkUpdateObject<T>> | | -| options | SavedObjectsBulkUpdateOptions | | +| objects | Array<SavedObjectsBulkUpdateObject<T>> | \[{ type, id, attributes, options: { version, namespace } references }\] {string} options.version - ensures version matches that of persisted object {string} \[options.namespace\] | +| options | SavedObjectsBulkUpdateOptions | | Returns: -`Promise>` +Promise<SavedObjectsBulkUpdateResponse<T>> {promise} - {saved\_objects: \[\[{ id, type, version, references, attributes, error: { message } }\]} diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.checkconflicts.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.checkconflicts.md index 6e44bd704d6a7d..48adf6a2dba4a9 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.checkconflicts.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.checkconflicts.md @@ -16,10 +16,10 @@ checkConflicts(objects?: SavedObjectsCheckConflictsObject[], options?: SavedObje | Parameter | Type | Description | | --- | --- | --- | -| objects | SavedObjectsCheckConflictsObject[] | | -| options | SavedObjectsBaseOptions | | +| objects | SavedObjectsCheckConflictsObject\[\] | | +| options | SavedObjectsBaseOptions | | Returns: -`Promise` +Promise<SavedObjectsCheckConflictsResponse> diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.closepointintime.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.closepointintime.md index b9d81c89bffd74..e25cd9dfcaae70 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.closepointintime.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.closepointintime.md @@ -18,12 +18,12 @@ closePointInTime(id: string, options?: SavedObjectsClosePointInTimeOptions): Pro | Parameter | Type | Description | | --- | --- | --- | -| id | string | | -| options | SavedObjectsClosePointInTimeOptions | | +| id | string | | +| options | SavedObjectsClosePointInTimeOptions | [SavedObjectsClosePointInTimeOptions](./kibana-plugin-core-server.savedobjectsclosepointintimeoptions.md) | Returns: -`Promise` +Promise<SavedObjectsClosePointInTimeResponse> {promise} - [SavedObjectsClosePointInTimeResponse](./kibana-plugin-core-server.savedobjectsclosepointintimeresponse.md) @@ -55,6 +55,5 @@ const response = await repository.find({ }); await repository.closePointInTime(response.pit_id); - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.collectmultinamespacereferences.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.collectmultinamespacereferences.md index 450cd14a205243..b22b3bd8c0b533 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.collectmultinamespacereferences.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.collectmultinamespacereferences.md @@ -16,10 +16,10 @@ collectMultiNamespaceReferences(objects: SavedObjectsCollectMultiNamespaceRefere | Parameter | Type | Description | | --- | --- | --- | -| objects | SavedObjectsCollectMultiNamespaceReferencesObject[] | | -| options | SavedObjectsCollectMultiNamespaceReferencesOptions | | +| objects | SavedObjectsCollectMultiNamespaceReferencesObject\[\] | The objects to get the references for. | +| options | SavedObjectsCollectMultiNamespaceReferencesOptions | | Returns: -`Promise` +Promise<import("./collect\_multi\_namespace\_references").SavedObjectsCollectMultiNamespaceReferencesResponse> diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.create.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.create.md index 316f72f6261014..0c5412e2cd2dfa 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.create.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.create.md @@ -16,13 +16,13 @@ create(type: string, attributes: T, options?: SavedObjectsCreateOpt | Parameter | Type | Description | | --- | --- | --- | -| type | string | | -| attributes | T | | -| options | SavedObjectsCreateOptions | | +| type | string | | +| attributes | T | | +| options | SavedObjectsCreateOptions | {string} \[options.id\] - force id on creation, not recommended {boolean} \[options.overwrite=false\] {object} \[options.migrationVersion=undefined\] {string} \[options.namespace\] {array} \[options.references=\[\]\] - \[{ name, type, id }\] | Returns: -`Promise>` +Promise<SavedObject<T>> {promise} - { id, type, version, attributes } diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.createpointintimefinder.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.createpointintimefinder.md index c92a1986966fd8..4cbf51b85f26da 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.createpointintimefinder.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.createpointintimefinder.md @@ -22,12 +22,12 @@ createPointInTimeFinder(findOptions: SavedObjectsCreat | Parameter | Type | Description | | --- | --- | --- | -| findOptions | SavedObjectsCreatePointInTimeFinderOptions | | -| dependencies | SavedObjectsCreatePointInTimeFinderDependencies | | +| findOptions | SavedObjectsCreatePointInTimeFinderOptions | | +| dependencies | SavedObjectsCreatePointInTimeFinderDependencies | | Returns: -`ISavedObjectsPointInTimeFinder` +ISavedObjectsPointInTimeFinder<T, A> ## Example @@ -48,6 +48,5 @@ for await (const response of finder.find()) { await finder.close(); } } - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.delete.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.delete.md index c10ab0ab57eb36..2caa59210b9d30 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.delete.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.delete.md @@ -16,13 +16,13 @@ delete(type: string, id: string, options?: SavedObjectsDeleteOptions): Promise<{ | Parameter | Type | Description | | --- | --- | --- | -| type | string | | -| id | string | | -| options | SavedObjectsDeleteOptions | | +| type | string | | +| id | string | | +| options | SavedObjectsDeleteOptions | {string} \[options.namespace\] | Returns: -`Promise<{}>` +Promise<{}> {promise} diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.deletebynamespace.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.deletebynamespace.md index 3cdfb095d13340..2e9048bcbe1882 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.deletebynamespace.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.deletebynamespace.md @@ -16,12 +16,12 @@ deleteByNamespace(namespace: string, options?: SavedObjectsDeleteByNamespaceOpti | Parameter | Type | Description | | --- | --- | --- | -| namespace | string | | -| options | SavedObjectsDeleteByNamespaceOptions | | +| namespace | string | | +| options | SavedObjectsDeleteByNamespaceOptions | | Returns: -`Promise` +Promise<any> {promise} - { took, timed\_out, total, deleted, batches, version\_conflicts, noops, retries, failures } diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.find.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.find.md index 5c823b7567918b..58c14917aa2c95 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.find.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.find.md @@ -14,11 +14,11 @@ find(options: SavedObjectsFindOptions): PromiseSavedObjectsFindOptions | | +| options | SavedObjectsFindOptions | {(string\|Array)} \[options.type\] {string} \[options.search\] {string} \[options.defaultSearchOperator\] {Array} \[options.searchFields\] - see Elasticsearch Simple Query String Query field argument for more information {integer} \[options.page=1\] {integer} \[options.perPage=20\] {Array} \[options.searchAfter\] {string} \[options.sortField\] {string} \[options.sortOrder\] {Array} \[options.fields\] {string} \[options.namespace\] {object} \[options.hasReference\] - { type, id } {string} \[options.pit\] {string} \[options.preference\] | Returns: -`Promise>` +Promise<SavedObjectsFindResponse<T, A>> {promise} - { saved\_objects: \[{ id, type, version, attributes }\], total, per\_page, page } diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.get.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.get.md index f9368a1b400cba..9f2b1b924857bd 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.get.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.get.md @@ -16,13 +16,13 @@ get(type: string, id: string, options?: SavedObjectsBaseOptions): P | Parameter | Type | Description | | --- | --- | --- | -| type | string | | -| id | string | | -| options | SavedObjectsBaseOptions | | +| type | string | | +| id | string | | +| options | SavedObjectsBaseOptions | {string} \[options.namespace\] | Returns: -`Promise>` +Promise<SavedObject<T>> {promise} - { id, type, version, attributes } diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.incrementcounter.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.incrementcounter.md index 007b453817c8dd..0a51ec9429fe97 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.incrementcounter.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.incrementcounter.md @@ -16,14 +16,14 @@ incrementCounter(type: string, id: string, counterFields: Arraystring | The type of saved object whose fields should be incremented | -| id | string | The id of the document whose fields should be incremented | -| counterFields | Array<string | SavedObjectsIncrementCounterField> | An array of field names to increment or an array of [SavedObjectsIncrementCounterField](./kibana-plugin-core-server.savedobjectsincrementcounterfield.md) | -| options | SavedObjectsIncrementCounterOptions<T> | [SavedObjectsIncrementCounterOptions](./kibana-plugin-core-server.savedobjectsincrementcounteroptions.md) | +| type | string | The type of saved object whose fields should be incremented | +| id | string | The id of the document whose fields should be incremented | +| counterFields | Array<string \| SavedObjectsIncrementCounterField> | An array of field names to increment or an array of [SavedObjectsIncrementCounterField](./kibana-plugin-core-server.savedobjectsincrementcounterfield.md) | +| options | SavedObjectsIncrementCounterOptions<T> | [SavedObjectsIncrementCounterOptions](./kibana-plugin-core-server.savedobjectsincrementcounteroptions.md) | Returns: -`Promise>` +Promise<SavedObject<T>> The saved object after the specified fields were incremented @@ -65,6 +65,5 @@ repository.incrementCounter<{ appId: string }>( [ 'stats.apiCalls'], { upsertAttributes: { appId: 'myId' } } ) - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.openpointintimefortype.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.openpointintimefortype.md index b33765bb79dd8e..e0eb4bc603a2d1 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.openpointintimefortype.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.openpointintimefortype.md @@ -18,12 +18,12 @@ openPointInTimeForType(type: string | string[], { keepAlive, preference }?: Save | Parameter | Type | Description | | --- | --- | --- | -| type | string | string[] | | -| { keepAlive, preference } | SavedObjectsOpenPointInTimeOptions | | +| type | string \| string\[\] | | +| { keepAlive, preference } | SavedObjectsOpenPointInTimeOptions | | Returns: -`Promise` +Promise<SavedObjectsOpenPointInTimeResponse> {promise} - { id: string } @@ -50,6 +50,5 @@ const page2 = await savedObjectsClient.find({ searchAfter: lastHit.sort, }); await savedObjectsClient.closePointInTime(page2.pit_id); - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.removereferencesto.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.removereferencesto.md index ff05926360938f..6691bf69e58dc3 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.removereferencesto.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.removereferencesto.md @@ -16,13 +16,13 @@ removeReferencesTo(type: string, id: string, options?: SavedObjectsRemoveReferen | Parameter | Type | Description | | --- | --- | --- | -| type | string | | -| id | string | | -| options | SavedObjectsRemoveReferencesToOptions | | +| type | string | | +| id | string | | +| options | SavedObjectsRemoveReferencesToOptions | | Returns: -`Promise` +Promise<SavedObjectsRemoveReferencesToResponse> ## Remarks diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.resolve.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.resolve.md index 7d0a1c7d204be6..bf558eca975fd3 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.resolve.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.resolve.md @@ -16,13 +16,13 @@ resolve(type: string, id: string, options?: SavedObjectsBaseOptions | Parameter | Type | Description | | --- | --- | --- | -| type | string | | -| id | string | | -| options | SavedObjectsBaseOptions | | +| type | string | | +| id | string | | +| options | SavedObjectsBaseOptions | {string} \[options.namespace\] | Returns: -`Promise>` +Promise<SavedObjectsResolveResponse<T>> {promise} - { saved\_object, outcome } diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.update.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.update.md index d0d48b8938db8b..681ba9eb3f014b 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.update.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.update.md @@ -16,14 +16,14 @@ update(type: string, id: string, attributes: Partial, options?: | Parameter | Type | Description | | --- | --- | --- | -| type | string | | -| id | string | | -| attributes | Partial<T> | | -| options | SavedObjectsUpdateOptions<T> | | +| type | string | | +| id | string | | +| attributes | Partial<T> | | +| options | SavedObjectsUpdateOptions<T> | {string} options.version - ensures version matches that of persisted object {string} \[options.namespace\] {array} \[options.references\] - \[{ name, type, id }\] | Returns: -`Promise>` +Promise<SavedObjectsUpdateResponse<T>> {promise} diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.updateobjectsspaces.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.updateobjectsspaces.md index 6914c1b46b8296..c226e8d2d2b1dd 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.updateobjectsspaces.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.updateobjectsspaces.md @@ -16,12 +16,12 @@ updateObjectsSpaces(objects: SavedObjectsUpdateObjectsSpacesObject[], spacesToAd | Parameter | Type | Description | | --- | --- | --- | -| objects | SavedObjectsUpdateObjectsSpacesObject[] | | -| spacesToAdd | string[] | | -| spacesToRemove | string[] | | -| options | SavedObjectsUpdateObjectsSpacesOptions | | +| objects | SavedObjectsUpdateObjectsSpacesObject\[\] | | +| spacesToAdd | string\[\] | | +| spacesToRemove | string\[\] | | +| options | SavedObjectsUpdateObjectsSpacesOptions | | Returns: -`Promise` +Promise<import("./update\_objects\_spaces").SavedObjectsUpdateObjectsSpacesResponse> diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepositoryfactory.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepositoryfactory.md index dec768b68cd3af..72aa79ed4df290 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepositoryfactory.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepositoryfactory.md @@ -16,6 +16,6 @@ export interface SavedObjectsRepositoryFactory | Property | Type | Description | | --- | --- | --- | -| [createInternalRepository](./kibana-plugin-core-server.savedobjectsrepositoryfactory.createinternalrepository.md) | (includedHiddenTypes?: string[]) => ISavedObjectsRepository | Creates a [Saved Objects repository](./kibana-plugin-core-server.isavedobjectsrepository.md) that uses the internal Kibana user for authenticating with Elasticsearch. | -| [createScopedRepository](./kibana-plugin-core-server.savedobjectsrepositoryfactory.createscopedrepository.md) | (req: KibanaRequest, includedHiddenTypes?: string[]) => ISavedObjectsRepository | Creates a [Saved Objects repository](./kibana-plugin-core-server.isavedobjectsrepository.md) that uses the credentials from the passed in request to authenticate with Elasticsearch. | +| [createInternalRepository](./kibana-plugin-core-server.savedobjectsrepositoryfactory.createinternalrepository.md) | (includedHiddenTypes?: string\[\]) => ISavedObjectsRepository | Creates a [Saved Objects repository](./kibana-plugin-core-server.isavedobjectsrepository.md) that uses the internal Kibana user for authenticating with Elasticsearch. | +| [createScopedRepository](./kibana-plugin-core-server.savedobjectsrepositoryfactory.createscopedrepository.md) | (req: KibanaRequest, includedHiddenTypes?: string\[\]) => ISavedObjectsRepository | Creates a [Saved Objects repository](./kibana-plugin-core-server.isavedobjectsrepository.md) that uses the credentials from the passed in request to authenticate with Elasticsearch. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.md index dcd2305c831f44..7a005db4334ba5 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.md @@ -16,8 +16,8 @@ export interface SavedObjectsResolveImportErrorsOptions | Property | Type | Description | | --- | --- | --- | -| [createNewCopies](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.createnewcopies.md) | boolean | If true, will create new copies of import objects, each with a random id and undefined originId. | -| [namespace](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.namespace.md) | string | if specified, will import in given namespace | -| [readStream](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.readstream.md) | Readable | The stream of [saved objects](./kibana-plugin-core-server.savedobject.md) to resolve errors from | -| [retries](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.retries.md) | SavedObjectsImportRetry[] | saved object import references to retry | +| [createNewCopies](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.createnewcopies.md) | boolean | If true, will create new copies of import objects, each with a random id and undefined originId. | +| [namespace?](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.namespace.md) | string | (Optional) if specified, will import in given namespace | +| [readStream](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.readstream.md) | Readable | The stream of [saved objects](./kibana-plugin-core-server.savedobject.md) to resolve errors from | +| [retries](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.retries.md) | SavedObjectsImportRetry\[\] | saved object import references to retry | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsresolveresponse.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsresolveresponse.md index bbffd9902c0e73..1eab71a7d7e750 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsresolveresponse.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsresolveresponse.md @@ -15,7 +15,7 @@ export interface SavedObjectsResolveResponse | Property | Type | Description | | --- | --- | --- | -| [alias\_target\_id](./kibana-plugin-core-server.savedobjectsresolveresponse.alias_target_id.md) | string | The ID of the object that the legacy URL alias points to. This is only defined when the outcome is 'aliasMatch' or 'conflict'. | -| [outcome](./kibana-plugin-core-server.savedobjectsresolveresponse.outcome.md) | 'exactMatch' | 'aliasMatch' | 'conflict' | The outcome for a successful resolve call is one of the following values:\* 'exactMatch' -- One document exactly matched the given ID. \* 'aliasMatch' -- One document with a legacy URL alias matched the given ID; in this case the saved_object.id field is different than the given ID. \* 'conflict' -- Two documents matched the given ID, one was an exact match and another with a legacy URL alias; in this case the saved_object object is the exact match, and the saved_object.id field is the same as the given ID. | -| [saved\_object](./kibana-plugin-core-server.savedobjectsresolveresponse.saved_object.md) | SavedObject<T> | The saved object that was found. | +| [alias\_target\_id?](./kibana-plugin-core-server.savedobjectsresolveresponse.alias_target_id.md) | string | (Optional) The ID of the object that the legacy URL alias points to. This is only defined when the outcome is 'aliasMatch' or 'conflict'. | +| [outcome](./kibana-plugin-core-server.savedobjectsresolveresponse.outcome.md) | 'exactMatch' \| 'aliasMatch' \| 'conflict' | The outcome for a successful resolve call is one of the following values:\* 'exactMatch' -- One document exactly matched the given ID. \* 'aliasMatch' -- One document with a legacy URL alias matched the given ID; in this case the saved_object.id field is different than the given ID. \* 'conflict' -- Two documents matched the given ID, one was an exact match and another with a legacy URL alias; in this case the saved_object object is the exact match, and the saved_object.id field is the same as the given ID. | +| [saved\_object](./kibana-plugin-core-server.savedobjectsresolveresponse.saved_object.md) | SavedObject<T> | The saved object that was found. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsserializer.generaterawid.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsserializer.generaterawid.md index a9dfd84cf0b427..6172a05d5c8fa2 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsserializer.generaterawid.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsserializer.generaterawid.md @@ -16,11 +16,11 @@ generateRawId(namespace: string | undefined, type: string, id: string): string; | Parameter | Type | Description | | --- | --- | --- | -| namespace | string | undefined | | -| type | string | | -| id | string | | +| namespace | string \| undefined | The namespace of the saved object | +| type | string | The saved object type | +| id | string | The id of the saved object | Returns: -`string` +string diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsserializer.generaterawlegacyurlaliasid.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsserializer.generaterawlegacyurlaliasid.md index d33f42ee2cf5f4..a0465b96f05b58 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsserializer.generaterawlegacyurlaliasid.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsserializer.generaterawlegacyurlaliasid.md @@ -16,11 +16,11 @@ generateRawLegacyUrlAliasId(namespace: string, type: string, id: string): string | Parameter | Type | Description | | --- | --- | --- | -| namespace | string | | -| type | string | | -| id | string | | +| namespace | string | The namespace of the saved object | +| type | string | The saved object type | +| id | string | The id of the saved object | Returns: -`string` +string diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsserializer.israwsavedobject.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsserializer.israwsavedobject.md index 1094cc25ab557e..00963e353aa209 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsserializer.israwsavedobject.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsserializer.israwsavedobject.md @@ -16,10 +16,10 @@ isRawSavedObject(doc: SavedObjectsRawDoc, options?: SavedObjectsRawDocParseOptio | Parameter | Type | Description | | --- | --- | --- | -| doc | SavedObjectsRawDoc | | -| options | SavedObjectsRawDocParseOptions | | +| doc | SavedObjectsRawDoc | The raw ES document to be tested | +| options | SavedObjectsRawDocParseOptions | Options for parsing the raw document. | Returns: -`boolean` +boolean diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsserializer.rawtosavedobject.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsserializer.rawtosavedobject.md index d71db9caf6a3b8..9ac0ae0feee09b 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsserializer.rawtosavedobject.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsserializer.rawtosavedobject.md @@ -16,10 +16,10 @@ rawToSavedObject(doc: SavedObjectsRawDoc, options?: SavedObjectsRaw | Parameter | Type | Description | | --- | --- | --- | -| doc | SavedObjectsRawDoc | | -| options | SavedObjectsRawDocParseOptions | | +| doc | SavedObjectsRawDoc | The raw ES document to be converted to saved object format. | +| options | SavedObjectsRawDocParseOptions | Options for parsing the raw document. | Returns: -`SavedObjectSanitizedDoc` +SavedObjectSanitizedDoc<T> diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsserializer.savedobjecttoraw.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsserializer.savedobjecttoraw.md index 16d499a7b7b389..560011fc096382 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsserializer.savedobjecttoraw.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsserializer.savedobjecttoraw.md @@ -16,9 +16,9 @@ savedObjectToRaw(savedObj: SavedObjectSanitizedDoc): SavedObjectsRawDoc; | Parameter | Type | Description | | --- | --- | --- | -| savedObj | SavedObjectSanitizedDoc | | +| savedObj | SavedObjectSanitizedDoc | The saved object to be converted to raw ES format. | Returns: -`SavedObjectsRawDoc` +SavedObjectsRawDoc diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsservicesetup.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsservicesetup.md index 336d9f63f0cede..28afaacce7ce63 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsservicesetup.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsservicesetup.md @@ -29,7 +29,6 @@ export class Plugin() { }) } } - ``` ## Example 2 @@ -44,15 +43,14 @@ export class Plugin() { core.savedObjects.registerType(mySoType); } } - ``` ## Properties | Property | Type | Description | | --- | --- | --- | -| [addClientWrapper](./kibana-plugin-core-server.savedobjectsservicesetup.addclientwrapper.md) | (priority: number, id: string, factory: SavedObjectsClientWrapperFactory) => void | Add a [client wrapper factory](./kibana-plugin-core-server.savedobjectsclientwrapperfactory.md) with the given priority. | -| [getKibanaIndex](./kibana-plugin-core-server.savedobjectsservicesetup.getkibanaindex.md) | () => string | Returns the default index used for saved objects. | -| [registerType](./kibana-plugin-core-server.savedobjectsservicesetup.registertype.md) | <Attributes = any>(type: SavedObjectsType<Attributes>) => void | Register a [savedObjects type](./kibana-plugin-core-server.savedobjectstype.md) definition.See the [mappings format](./kibana-plugin-core-server.savedobjectstypemappingdefinition.md) and [migration format](./kibana-plugin-core-server.savedobjectmigrationmap.md) for more details about these. | -| [setClientFactoryProvider](./kibana-plugin-core-server.savedobjectsservicesetup.setclientfactoryprovider.md) | (clientFactoryProvider: SavedObjectsClientFactoryProvider) => void | Set the default [factory provider](./kibana-plugin-core-server.savedobjectsclientfactoryprovider.md) for creating Saved Objects clients. Only one provider can be set, subsequent calls to this method will fail. | +| [addClientWrapper](./kibana-plugin-core-server.savedobjectsservicesetup.addclientwrapper.md) | (priority: number, id: string, factory: SavedObjectsClientWrapperFactory) => void | Add a [client wrapper factory](./kibana-plugin-core-server.savedobjectsclientwrapperfactory.md) with the given priority. | +| [getKibanaIndex](./kibana-plugin-core-server.savedobjectsservicesetup.getkibanaindex.md) | () => string | Returns the default index used for saved objects. | +| [registerType](./kibana-plugin-core-server.savedobjectsservicesetup.registertype.md) | <Attributes = any>(type: SavedObjectsType<Attributes>) => void | Register a [savedObjects type](./kibana-plugin-core-server.savedobjectstype.md) definition.See the [mappings format](./kibana-plugin-core-server.savedobjectstypemappingdefinition.md) and [migration format](./kibana-plugin-core-server.savedobjectmigrationmap.md) for more details about these. | +| [setClientFactoryProvider](./kibana-plugin-core-server.savedobjectsservicesetup.setclientfactoryprovider.md) | (clientFactoryProvider: SavedObjectsClientFactoryProvider) => void | Set the default [factory provider](./kibana-plugin-core-server.savedobjectsclientfactoryprovider.md) for creating Saved Objects clients. Only one provider can be set, subsequent calls to this method will fail. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsservicesetup.registertype.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsservicesetup.registertype.md index 7f74ce4d7bea75..3085224fdaa6b3 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsservicesetup.registertype.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsservicesetup.registertype.md @@ -51,6 +51,5 @@ export class Plugin() { core.savedObjects.registerType(myType); } } - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsservicestart.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsservicestart.md index 075a363fe1aa23..ae7480ab1e65b5 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsservicestart.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsservicestart.md @@ -16,11 +16,11 @@ export interface SavedObjectsServiceStart | Property | Type | Description | | --- | --- | --- | -| [createExporter](./kibana-plugin-core-server.savedobjectsservicestart.createexporter.md) | (client: SavedObjectsClientContract) => ISavedObjectsExporter | Creates an [exporter](./kibana-plugin-core-server.isavedobjectsexporter.md) bound to given client. | -| [createImporter](./kibana-plugin-core-server.savedobjectsservicestart.createimporter.md) | (client: SavedObjectsClientContract) => ISavedObjectsImporter | Creates an [importer](./kibana-plugin-core-server.isavedobjectsimporter.md) bound to given client. | -| [createInternalRepository](./kibana-plugin-core-server.savedobjectsservicestart.createinternalrepository.md) | (includedHiddenTypes?: string[]) => ISavedObjectsRepository | Creates a [Saved Objects repository](./kibana-plugin-core-server.isavedobjectsrepository.md) that uses the internal Kibana user for authenticating with Elasticsearch. | -| [createScopedRepository](./kibana-plugin-core-server.savedobjectsservicestart.createscopedrepository.md) | (req: KibanaRequest, includedHiddenTypes?: string[]) => ISavedObjectsRepository | Creates a [Saved Objects repository](./kibana-plugin-core-server.isavedobjectsrepository.md) that uses the credentials from the passed in request to authenticate with Elasticsearch. | -| [createSerializer](./kibana-plugin-core-server.savedobjectsservicestart.createserializer.md) | () => SavedObjectsSerializer | Creates a [serializer](./kibana-plugin-core-server.savedobjectsserializer.md) that is aware of all registered types. | -| [getScopedClient](./kibana-plugin-core-server.savedobjectsservicestart.getscopedclient.md) | (req: KibanaRequest, options?: SavedObjectsClientProviderOptions) => SavedObjectsClientContract | Creates a [Saved Objects client](./kibana-plugin-core-server.savedobjectsclientcontract.md) that uses the credentials from the passed in request to authenticate with Elasticsearch. If other plugins have registered Saved Objects client wrappers, these will be applied to extend the functionality of the client.A client that is already scoped to the incoming request is also exposed from the route handler context see [RequestHandlerContext](./kibana-plugin-core-server.requesthandlercontext.md). | -| [getTypeRegistry](./kibana-plugin-core-server.savedobjectsservicestart.gettyperegistry.md) | () => ISavedObjectTypeRegistry | Returns the [registry](./kibana-plugin-core-server.isavedobjecttyperegistry.md) containing all registered [saved object types](./kibana-plugin-core-server.savedobjectstype.md) | +| [createExporter](./kibana-plugin-core-server.savedobjectsservicestart.createexporter.md) | (client: SavedObjectsClientContract) => ISavedObjectsExporter | Creates an [exporter](./kibana-plugin-core-server.isavedobjectsexporter.md) bound to given client. | +| [createImporter](./kibana-plugin-core-server.savedobjectsservicestart.createimporter.md) | (client: SavedObjectsClientContract) => ISavedObjectsImporter | Creates an [importer](./kibana-plugin-core-server.isavedobjectsimporter.md) bound to given client. | +| [createInternalRepository](./kibana-plugin-core-server.savedobjectsservicestart.createinternalrepository.md) | (includedHiddenTypes?: string\[\]) => ISavedObjectsRepository | Creates a [Saved Objects repository](./kibana-plugin-core-server.isavedobjectsrepository.md) that uses the internal Kibana user for authenticating with Elasticsearch. | +| [createScopedRepository](./kibana-plugin-core-server.savedobjectsservicestart.createscopedrepository.md) | (req: KibanaRequest, includedHiddenTypes?: string\[\]) => ISavedObjectsRepository | Creates a [Saved Objects repository](./kibana-plugin-core-server.isavedobjectsrepository.md) that uses the credentials from the passed in request to authenticate with Elasticsearch. | +| [createSerializer](./kibana-plugin-core-server.savedobjectsservicestart.createserializer.md) | () => SavedObjectsSerializer | Creates a [serializer](./kibana-plugin-core-server.savedobjectsserializer.md) that is aware of all registered types. | +| [getScopedClient](./kibana-plugin-core-server.savedobjectsservicestart.getscopedclient.md) | (req: KibanaRequest, options?: SavedObjectsClientProviderOptions) => SavedObjectsClientContract | Creates a [Saved Objects client](./kibana-plugin-core-server.savedobjectsclientcontract.md) that uses the credentials from the passed in request to authenticate with Elasticsearch. If other plugins have registered Saved Objects client wrappers, these will be applied to extend the functionality of the client.A client that is already scoped to the incoming request is also exposed from the route handler context see [RequestHandlerContext](./kibana-plugin-core-server.requesthandlercontext.md). | +| [getTypeRegistry](./kibana-plugin-core-server.savedobjectsservicestart.gettyperegistry.md) | () => ISavedObjectTypeRegistry | Returns the [registry](./kibana-plugin-core-server.isavedobjecttyperegistry.md) containing all registered [saved object types](./kibana-plugin-core-server.savedobjectstype.md) | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectstatusmeta.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectstatusmeta.md index 3a0b23d18632f1..890ed36535b3f5 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectstatusmeta.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectstatusmeta.md @@ -16,5 +16,5 @@ export interface SavedObjectStatusMeta | Property | Type | Description | | --- | --- | --- | -| [migratedIndices](./kibana-plugin-core-server.savedobjectstatusmeta.migratedindices.md) | {
[status: string]: number;
skipped: number;
migrated: number;
} | | +| [migratedIndices](./kibana-plugin-core-server.savedobjectstatusmeta.migratedindices.md) | { \[status: string\]: number; skipped: number; migrated: number; } | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.converttomultinamespacetypeversion.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.converttomultinamespacetypeversion.md index 20346919fc652e..a3fac341536334 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.converttomultinamespacetypeversion.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.converttomultinamespacetypeversion.md @@ -19,7 +19,6 @@ Example of a single-namespace type in 7.12: namespaceType: 'single', mappings: {...} } - ``` Example after converting to a multi-namespace (isolated) type in 8.0: @@ -31,7 +30,6 @@ Example after converting to a multi-namespace (isolated) type in 8.0: mappings: {...}, convertToMultiNamespaceTypeVersion: '8.0.0' } - ``` Example after converting to a multi-namespace (shareable) type in 8.1: @@ -43,7 +41,6 @@ Example after converting to a multi-namespace (shareable) type in 8.1: mappings: {...}, convertToMultiNamespaceTypeVersion: '8.0.0' } - ``` Note: migration function(s) can be optionally specified for any of these versions and will not interfere with the conversion process. diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.md index bdb90be2bc8fca..3c76a898d06f66 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.md @@ -18,8 +18,8 @@ This is only internal for now, and will only be public when we expose the regist | Property | Type | Description | | --- | --- | --- | -| [convertToAliasScript](./kibana-plugin-core-server.savedobjectstype.converttoaliasscript.md) | string | If defined, will be used to convert the type to an alias. | -| [convertToMultiNamespaceTypeVersion](./kibana-plugin-core-server.savedobjectstype.converttomultinamespacetypeversion.md) | string | If defined, objects of this type will be converted to a 'multiple' or 'multiple-isolated' namespace type when migrating to this version.Requirements:1. This string value must be a valid semver version 2. This type must have previously specified [\`namespaceType: 'single'\`](./kibana-plugin-core-server.savedobjectsnamespacetype.md) 3. This type must also specify [\`namespaceType: 'multiple'\`](./kibana-plugin-core-server.savedobjectsnamespacetype.md) \*or\* [\`namespaceType: 'multiple-isolated'\`](./kibana-plugin-core-server.savedobjectsnamespacetype.md)Example of a single-namespace type in 7.12: +| [convertToAliasScript?](./kibana-plugin-core-server.savedobjectstype.converttoaliasscript.md) | string | (Optional) If defined, will be used to convert the type to an alias. | +| [convertToMultiNamespaceTypeVersion?](./kibana-plugin-core-server.savedobjectstype.converttomultinamespacetypeversion.md) | string | (Optional) If defined, objects of this type will be converted to a 'multiple' or 'multiple-isolated' namespace type when migrating to this version.Requirements:1. This string value must be a valid semver version 2. This type must have previously specified [\`namespaceType: 'single'\`](./kibana-plugin-core-server.savedobjectsnamespacetype.md) 3. This type must also specify [\`namespaceType: 'multiple'\`](./kibana-plugin-core-server.savedobjectsnamespacetype.md) \*or\* [\`namespaceType: 'multiple-isolated'\`](./kibana-plugin-core-server.savedobjectsnamespacetype.md)Example of a single-namespace type in 7.12: ```ts { name: 'foo', @@ -27,7 +27,6 @@ This is only internal for now, and will only be public when we expose the regist namespaceType: 'single', mappings: {...} } - ``` Example after converting to a multi-namespace (isolated) type in 8.0: ```ts @@ -38,7 +37,6 @@ Example after converting to a multi-namespace (isolated) type in 8.0: mappings: {...}, convertToMultiNamespaceTypeVersion: '8.0.0' } - ``` Example after converting to a multi-namespace (shareable) type in 8.1: ```ts @@ -49,15 +47,14 @@ Example after converting to a multi-namespace (shareable) type in 8.1: mappings: {...}, convertToMultiNamespaceTypeVersion: '8.0.0' } - ``` Note: migration function(s) can be optionally specified for any of these versions and will not interfere with the conversion process. | -| [excludeOnUpgrade](./kibana-plugin-core-server.savedobjectstype.excludeonupgrade.md) | SavedObjectTypeExcludeFromUpgradeFilterHook | If defined, allows a type to exclude unneeded documents from the migration process and effectively be deleted. See [SavedObjectTypeExcludeFromUpgradeFilterHook](./kibana-plugin-core-server.savedobjecttypeexcludefromupgradefilterhook.md) for more details. | -| [hidden](./kibana-plugin-core-server.savedobjectstype.hidden.md) | boolean | Is the type hidden by default. If true, repositories will not have access to this type unless explicitly declared as an extraType when creating the repository.See [createInternalRepository](./kibana-plugin-core-server.savedobjectsservicestart.createinternalrepository.md). | -| [indexPattern](./kibana-plugin-core-server.savedobjectstype.indexpattern.md) | string | If defined, the type instances will be stored in the given index instead of the default one. | -| [management](./kibana-plugin-core-server.savedobjectstype.management.md) | SavedObjectsTypeManagementDefinition<Attributes> | An optional [saved objects management section](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.md) definition for the type. | -| [mappings](./kibana-plugin-core-server.savedobjectstype.mappings.md) | SavedObjectsTypeMappingDefinition | The [mapping definition](./kibana-plugin-core-server.savedobjectstypemappingdefinition.md) for the type. | -| [migrations](./kibana-plugin-core-server.savedobjectstype.migrations.md) | SavedObjectMigrationMap | (() => SavedObjectMigrationMap) | An optional map of [migrations](./kibana-plugin-core-server.savedobjectmigrationfn.md) or a function returning a map of [migrations](./kibana-plugin-core-server.savedobjectmigrationfn.md) to be used to migrate the type. | -| [name](./kibana-plugin-core-server.savedobjectstype.name.md) | string | The name of the type, which is also used as the internal id. | -| [namespaceType](./kibana-plugin-core-server.savedobjectstype.namespacetype.md) | SavedObjectsNamespaceType | The [namespace type](./kibana-plugin-core-server.savedobjectsnamespacetype.md) for the type. | +| [excludeOnUpgrade?](./kibana-plugin-core-server.savedobjectstype.excludeonupgrade.md) | SavedObjectTypeExcludeFromUpgradeFilterHook | (Optional) If defined, allows a type to exclude unneeded documents from the migration process and effectively be deleted. See [SavedObjectTypeExcludeFromUpgradeFilterHook](./kibana-plugin-core-server.savedobjecttypeexcludefromupgradefilterhook.md) for more details. | +| [hidden](./kibana-plugin-core-server.savedobjectstype.hidden.md) | boolean | Is the type hidden by default. If true, repositories will not have access to this type unless explicitly declared as an extraType when creating the repository.See [createInternalRepository](./kibana-plugin-core-server.savedobjectsservicestart.createinternalrepository.md). | +| [indexPattern?](./kibana-plugin-core-server.savedobjectstype.indexpattern.md) | string | (Optional) If defined, the type instances will be stored in the given index instead of the default one. | +| [management?](./kibana-plugin-core-server.savedobjectstype.management.md) | SavedObjectsTypeManagementDefinition<Attributes> | (Optional) An optional [saved objects management section](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.md) definition for the type. | +| [mappings](./kibana-plugin-core-server.savedobjectstype.mappings.md) | SavedObjectsTypeMappingDefinition | The [mapping definition](./kibana-plugin-core-server.savedobjectstypemappingdefinition.md) for the type. | +| [migrations?](./kibana-plugin-core-server.savedobjectstype.migrations.md) | SavedObjectMigrationMap \| (() => SavedObjectMigrationMap) | (Optional) An optional map of [migrations](./kibana-plugin-core-server.savedobjectmigrationfn.md) or a function returning a map of [migrations](./kibana-plugin-core-server.savedobjectmigrationfn.md) to be used to migrate the type. | +| [name](./kibana-plugin-core-server.savedobjectstype.name.md) | string | The name of the type, which is also used as the internal id. | +| [namespaceType](./kibana-plugin-core-server.savedobjectstype.namespacetype.md) | SavedObjectsNamespaceType | The [namespace type](./kibana-plugin-core-server.savedobjectsnamespacetype.md) for the type. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemanagementdefinition.isexportable.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemanagementdefinition.isexportable.md index fef178e1d98475..c6dff606109903 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemanagementdefinition.isexportable.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemanagementdefinition.isexportable.md @@ -44,6 +44,5 @@ export class Plugin() { }); } } - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemanagementdefinition.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemanagementdefinition.md index 057eb6284bf9ed..eeda40cd596645 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemanagementdefinition.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemanagementdefinition.md @@ -16,15 +16,15 @@ export interface SavedObjectsTypeManagementDefinition | Property | Type | Description | | --- | --- | --- | -| [defaultSearchField](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.defaultsearchfield.md) | string | The default search field to use for this type. Defaults to id. | -| [displayName](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.displayname.md) | string | When specified, will be used instead of the type's name in SO management section's labels. | -| [getEditUrl](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.getediturl.md) | (savedObject: SavedObject<Attributes>) => string | Function returning the url to use to redirect to the editing page of this object. If not defined, editing will not be allowed. | -| [getInAppUrl](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.getinappurl.md) | (savedObject: SavedObject<Attributes>) => {
path: string;
uiCapabilitiesPath: string;
} | Function returning the url to use to redirect to this object from the management section. If not defined, redirecting to the object will not be allowed. | -| [getTitle](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.gettitle.md) | (savedObject: SavedObject<Attributes>) => string | Function returning the title to display in the management table. If not defined, will use the object's type and id to generate a label. | -| [icon](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.icon.md) | string | The eui icon name to display in the management table. If not defined, the default icon will be used. | -| [importableAndExportable](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.importableandexportable.md) | boolean | Is the type importable or exportable. Defaults to false. | -| [isExportable](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.isexportable.md) | SavedObjectsExportablePredicate<Attributes> | Optional hook to specify whether an object should be exportable.If specified, isExportable will be called during export for each of this type's objects in the export, and the ones not matching the predicate will be excluded from the export.When implementing both isExportable and onExport, it is mandatory that isExportable returns the same value for an object before and after going though the export transform. E.g isExportable(objectBeforeTransform) === isExportable(objectAfterTransform) | -| [onExport](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.onexport.md) | SavedObjectsExportTransform<Attributes> | An optional export transform function that can be used transform the objects of the registered type during the export process.It can be used to either mutate the exported objects, or add additional objects (of any type) to the export list.See [the transform type documentation](./kibana-plugin-core-server.savedobjectsexporttransform.md) for more info and examples.When implementing both isExportable and onExport, it is mandatory that isExportable returns the same value for an object before and after going though the export transform. E.g isExportable(objectBeforeTransform) === isExportable(objectAfterTransform) | -| [onImport](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.onimport.md) | SavedObjectsImportHook<Attributes> | An optional [import hook](./kibana-plugin-core-server.savedobjectsimporthook.md) to use when importing given type.Import hooks are executed during the savedObjects import process and allow to interact with the imported objects. See the [hook documentation](./kibana-plugin-core-server.savedobjectsimporthook.md) for more info. | -| [visibleInManagement](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.visibleinmanagement.md) | boolean | When set to false, the type will not be listed or searchable in the SO management section. Main usage of setting this property to false for a type is when objects from the type should be included in the export via references or export hooks, but should not directly appear in the SOM. Defaults to true. | +| [defaultSearchField?](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.defaultsearchfield.md) | string | (Optional) The default search field to use for this type. Defaults to id. | +| [displayName?](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.displayname.md) | string | (Optional) When specified, will be used instead of the type's name in SO management section's labels. | +| [getEditUrl?](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.getediturl.md) | (savedObject: SavedObject<Attributes>) => string | (Optional) Function returning the url to use to redirect to the editing page of this object. If not defined, editing will not be allowed. | +| [getInAppUrl?](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.getinappurl.md) | (savedObject: SavedObject<Attributes>) => { path: string; uiCapabilitiesPath: string; } | (Optional) Function returning the url to use to redirect to this object from the management section. If not defined, redirecting to the object will not be allowed. | +| [getTitle?](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.gettitle.md) | (savedObject: SavedObject<Attributes>) => string | (Optional) Function returning the title to display in the management table. If not defined, will use the object's type and id to generate a label. | +| [icon?](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.icon.md) | string | (Optional) The eui icon name to display in the management table. If not defined, the default icon will be used. | +| [importableAndExportable?](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.importableandexportable.md) | boolean | (Optional) Is the type importable or exportable. Defaults to false. | +| [isExportable?](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.isexportable.md) | SavedObjectsExportablePredicate<Attributes> | (Optional) Optional hook to specify whether an object should be exportable.If specified, isExportable will be called during export for each of this type's objects in the export, and the ones not matching the predicate will be excluded from the export.When implementing both isExportable and onExport, it is mandatory that isExportable returns the same value for an object before and after going though the export transform. E.g isExportable(objectBeforeTransform) === isExportable(objectAfterTransform) | +| [onExport?](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.onexport.md) | SavedObjectsExportTransform<Attributes> | (Optional) An optional export transform function that can be used transform the objects of the registered type during the export process.It can be used to either mutate the exported objects, or add additional objects (of any type) to the export list.See [the transform type documentation](./kibana-plugin-core-server.savedobjectsexporttransform.md) for more info and examples.When implementing both isExportable and onExport, it is mandatory that isExportable returns the same value for an object before and after going though the export transform. E.g isExportable(objectBeforeTransform) === isExportable(objectAfterTransform) | +| [onImport?](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.onimport.md) | SavedObjectsImportHook<Attributes> | (Optional) An optional [import hook](./kibana-plugin-core-server.savedobjectsimporthook.md) to use when importing given type.Import hooks are executed during the savedObjects import process and allow to interact with the imported objects. See the [hook documentation](./kibana-plugin-core-server.savedobjectsimporthook.md) for more info. | +| [visibleInManagement?](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.visibleinmanagement.md) | boolean | (Optional) When set to false, the type will not be listed or searchable in the SO management section. Main usage of setting this property to false for a type is when objects from the type should be included in the export via references or export hooks, but should not directly appear in the SOM. Defaults to true. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemanagementdefinition.onimport.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemanagementdefinition.onimport.md index 332247b8eb8e17..c54570d79a7e27 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemanagementdefinition.onimport.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemanagementdefinition.onimport.md @@ -50,6 +50,5 @@ export class Plugin() { }); } } - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemappingdefinition.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemappingdefinition.md index 3d3b73880fa7fa..7f4c82c23e2ca8 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemappingdefinition.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemappingdefinition.md @@ -34,13 +34,12 @@ const typeDefinition: SavedObjectsTypeMappingDefinition = { }, } } - ``` ## Properties | Property | Type | Description | | --- | --- | --- | -| [dynamic](./kibana-plugin-core-server.savedobjectstypemappingdefinition.dynamic.md) | false | 'strict' | The dynamic property of the mapping, either false or 'strict'. If unspecified dynamic: 'strict' will be inherited from the top-level index mappings. | -| [properties](./kibana-plugin-core-server.savedobjectstypemappingdefinition.properties.md) | SavedObjectsMappingProperties | The underlying properties of the type mapping | +| [dynamic?](./kibana-plugin-core-server.savedobjectstypemappingdefinition.dynamic.md) | false \| 'strict' | (Optional) The dynamic property of the mapping, either false or 'strict'. If unspecified dynamic: 'strict' will be inherited from the top-level index mappings. | +| [properties](./kibana-plugin-core-server.savedobjectstypemappingdefinition.properties.md) | SavedObjectsMappingProperties | The underlying properties of the type mapping | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateobjectsspacesobject.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateobjectsspacesobject.md index 847e40a8896b43..6fa04623c96a62 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateobjectsspacesobject.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateobjectsspacesobject.md @@ -16,6 +16,6 @@ export interface SavedObjectsUpdateObjectsSpacesObject | Property | Type | Description | | --- | --- | --- | -| [id](./kibana-plugin-core-server.savedobjectsupdateobjectsspacesobject.id.md) | string | The type of the object to update | -| [type](./kibana-plugin-core-server.savedobjectsupdateobjectsspacesobject.type.md) | string | The ID of the object to update | +| [id](./kibana-plugin-core-server.savedobjectsupdateobjectsspacesobject.id.md) | string | The type of the object to update | +| [type](./kibana-plugin-core-server.savedobjectsupdateobjectsspacesobject.type.md) | string | The ID of the object to update | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateobjectsspacesoptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateobjectsspacesoptions.md index 49ee013c5d2da9..b8f17699b18411 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateobjectsspacesoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateobjectsspacesoptions.md @@ -11,10 +11,11 @@ Options for the update operation. ```typescript export interface SavedObjectsUpdateObjectsSpacesOptions extends SavedObjectsBaseOptions ``` +Extends: SavedObjectsBaseOptions ## Properties | Property | Type | Description | | --- | --- | --- | -| [refresh](./kibana-plugin-core-server.savedobjectsupdateobjectsspacesoptions.refresh.md) | MutatingOperationRefreshSetting | The Elasticsearch Refresh setting for this operation | +| [refresh?](./kibana-plugin-core-server.savedobjectsupdateobjectsspacesoptions.refresh.md) | MutatingOperationRefreshSetting | (Optional) The Elasticsearch Refresh setting for this operation | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateobjectsspacesresponse.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateobjectsspacesresponse.md index bf53277887bda3..aff67e0c54e667 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateobjectsspacesresponse.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateobjectsspacesresponse.md @@ -16,5 +16,5 @@ export interface SavedObjectsUpdateObjectsSpacesResponse | Property | Type | Description | | --- | --- | --- | -| [objects](./kibana-plugin-core-server.savedobjectsupdateobjectsspacesresponse.objects.md) | SavedObjectsUpdateObjectsSpacesResponseObject[] | | +| [objects](./kibana-plugin-core-server.savedobjectsupdateobjectsspacesresponse.objects.md) | SavedObjectsUpdateObjectsSpacesResponseObject\[\] | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateobjectsspacesresponseobject.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateobjectsspacesresponseobject.md index 03802278ee5a3f..5078473e9e6bdd 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateobjectsspacesresponseobject.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateobjectsspacesresponseobject.md @@ -16,8 +16,8 @@ export interface SavedObjectsUpdateObjectsSpacesResponseObject | Property | Type | Description | | --- | --- | --- | -| [error](./kibana-plugin-core-server.savedobjectsupdateobjectsspacesresponseobject.error.md) | SavedObjectError | Included if there was an error updating this object's spaces | -| [id](./kibana-plugin-core-server.savedobjectsupdateobjectsspacesresponseobject.id.md) | string | The ID of the referenced object | -| [spaces](./kibana-plugin-core-server.savedobjectsupdateobjectsspacesresponseobject.spaces.md) | string[] | The space(s) that the referenced object exists in | -| [type](./kibana-plugin-core-server.savedobjectsupdateobjectsspacesresponseobject.type.md) | string | The type of the referenced object | +| [error?](./kibana-plugin-core-server.savedobjectsupdateobjectsspacesresponseobject.error.md) | SavedObjectError | (Optional) Included if there was an error updating this object's spaces | +| [id](./kibana-plugin-core-server.savedobjectsupdateobjectsspacesresponseobject.id.md) | string | The ID of the referenced object | +| [spaces](./kibana-plugin-core-server.savedobjectsupdateobjectsspacesresponseobject.spaces.md) | string\[\] | The space(s) that the referenced object exists in | +| [type](./kibana-plugin-core-server.savedobjectsupdateobjectsspacesresponseobject.type.md) | string | The type of the referenced object | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateoptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateoptions.md index 3111c1c8e65f17..b81a59c745e7bf 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateoptions.md @@ -10,13 +10,14 @@ ```typescript export interface SavedObjectsUpdateOptions extends SavedObjectsBaseOptions ``` +Extends: SavedObjectsBaseOptions ## Properties | Property | Type | Description | | --- | --- | --- | -| [references](./kibana-plugin-core-server.savedobjectsupdateoptions.references.md) | SavedObjectReference[] | A reference to another saved object. | -| [refresh](./kibana-plugin-core-server.savedobjectsupdateoptions.refresh.md) | MutatingOperationRefreshSetting | The Elasticsearch Refresh setting for this operation | -| [upsert](./kibana-plugin-core-server.savedobjectsupdateoptions.upsert.md) | Attributes | If specified, will be used to perform an upsert if the document doesn't exist | -| [version](./kibana-plugin-core-server.savedobjectsupdateoptions.version.md) | string | An opaque version number which changes on each successful write operation. Can be used for implementing optimistic concurrency control. | +| [references?](./kibana-plugin-core-server.savedobjectsupdateoptions.references.md) | SavedObjectReference\[\] | (Optional) A reference to another saved object. | +| [refresh?](./kibana-plugin-core-server.savedobjectsupdateoptions.refresh.md) | MutatingOperationRefreshSetting | (Optional) The Elasticsearch Refresh setting for this operation | +| [upsert?](./kibana-plugin-core-server.savedobjectsupdateoptions.upsert.md) | Attributes | (Optional) If specified, will be used to perform an upsert if the document doesn't exist | +| [version?](./kibana-plugin-core-server.savedobjectsupdateoptions.version.md) | string | (Optional) An opaque version number which changes on each successful write operation. Can be used for implementing optimistic concurrency control. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateresponse.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateresponse.md index d8130830eb1f7a..5c773d92c63644 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateresponse.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsupdateresponse.md @@ -10,11 +10,12 @@ ```typescript export interface SavedObjectsUpdateResponse extends Omit, 'attributes' | 'references'> ``` +Extends: Omit<SavedObject<T>, 'attributes' \| 'references'> ## Properties | Property | Type | Description | | --- | --- | --- | -| [attributes](./kibana-plugin-core-server.savedobjectsupdateresponse.attributes.md) | Partial<T> | | -| [references](./kibana-plugin-core-server.savedobjectsupdateresponse.references.md) | SavedObjectReference[] | undefined | | +| [attributes](./kibana-plugin-core-server.savedobjectsupdateresponse.attributes.md) | Partial<T> | | +| [references](./kibana-plugin-core-server.savedobjectsupdateresponse.references.md) | SavedObjectReference\[\] \| undefined | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsutils.generateid.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsutils.generateid.md index f0951844849927..887f2fb5d9fe10 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsutils.generateid.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsutils.generateid.md @@ -13,5 +13,5 @@ static generateId(): string; ``` Returns: -`string` +string diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsutils.getconvertedobjectid.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsutils.getconvertedobjectid.md index c6a429d345ed1e..502d9dcab8cf71 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsutils.getconvertedobjectid.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsutils.getconvertedobjectid.md @@ -16,13 +16,13 @@ static getConvertedObjectId(namespace: string | undefined, type: string, id: str | Parameter | Type | Description | | --- | --- | --- | -| namespace | string | undefined | | -| type | string | | -| id | string | | +| namespace | string \| undefined | The namespace of the saved object before it is converted. | +| type | string | The type of the saved object before it is converted. | +| id | string | The ID of the saved object before it is converted. | Returns: -`string` +string {string} The ID of the saved object after it is converted. diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsutils.israndomid.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsutils.israndomid.md index 5a44321ee060f1..75db00c449654e 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsutils.israndomid.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsutils.israndomid.md @@ -16,9 +16,9 @@ static isRandomId(id: string | undefined): boolean; | Parameter | Type | Description | | --- | --- | --- | -| id | string | undefined | | +| id | string \| undefined | The ID of a saved object. Use uuid.validate once upgraded to v5.3+ | Returns: -`boolean` +boolean diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsutils.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsutils.md index ab6382aca6a52b..9a8c5cf9889b25 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsutils.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsutils.md @@ -15,9 +15,9 @@ export declare class SavedObjectsUtils | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [createEmptyFindResponse](./kibana-plugin-core-server.savedobjectsutils.createemptyfindresponse.md) | static | <T, A>({ page, perPage, }: SavedObjectsFindOptions) => SavedObjectsFindResponse<T, A> | Creates an empty response for a find operation. This is only intended to be used by saved objects client wrappers. | -| [namespaceIdToString](./kibana-plugin-core-server.savedobjectsutils.namespaceidtostring.md) | static | (namespace?: string | undefined) => string | Converts a given saved object namespace ID to its string representation. All namespace IDs have an identical string representation, with the exception of the undefined namespace ID (which has a namespace string of 'default'). | -| [namespaceStringToId](./kibana-plugin-core-server.savedobjectsutils.namespacestringtoid.md) | static | (namespace: string) => string | undefined | Converts a given saved object namespace string to its ID representation. All namespace strings have an identical ID representation, with the exception of the 'default' namespace string (which has a namespace ID of undefined). | +| [createEmptyFindResponse](./kibana-plugin-core-server.savedobjectsutils.createemptyfindresponse.md) | static | <T, A>({ page, perPage, }: SavedObjectsFindOptions) => SavedObjectsFindResponse<T, A> | Creates an empty response for a find operation. This is only intended to be used by saved objects client wrappers. | +| [namespaceIdToString](./kibana-plugin-core-server.savedobjectsutils.namespaceidtostring.md) | static | (namespace?: string \| undefined) => string | Converts a given saved object namespace ID to its string representation. All namespace IDs have an identical string representation, with the exception of the undefined namespace ID (which has a namespace string of 'default'). | +| [namespaceStringToId](./kibana-plugin-core-server.savedobjectsutils.namespacestringtoid.md) | static | (namespace: string) => string \| undefined | Converts a given saved object namespace string to its ID representation. All namespace strings have an identical ID representation, with the exception of the 'default' namespace string (which has a namespace ID of undefined). | ## Methods diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.getalltypes.md b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.getalltypes.md index 20d631ff74acac..7e4733f892955d 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.getalltypes.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.getalltypes.md @@ -15,5 +15,5 @@ getAllTypes(): SavedObjectsType[]; ``` Returns: -`SavedObjectsType[]` +SavedObjectsType<any>\[\] diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.getimportableandexportabletypes.md b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.getimportableandexportabletypes.md index 1e29e632a6ec32..a20360128406ac 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.getimportableandexportabletypes.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.getimportableandexportabletypes.md @@ -13,5 +13,5 @@ getImportableAndExportableTypes(): SavedObjectsType[]; ``` Returns: -`SavedObjectsType[]` +SavedObjectsType<any>\[\] diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.getindex.md b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.getindex.md index dca43c48ec46d9..9da28c7f01278e 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.getindex.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.getindex.md @@ -16,9 +16,9 @@ getIndex(type: string): string | undefined; | Parameter | Type | Description | | --- | --- | --- | -| type | string | | +| type | string | | Returns: -`string | undefined` +string \| undefined diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.gettype.md b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.gettype.md index 160aadb73cced3..d6fc255958c8c5 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.gettype.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.gettype.md @@ -16,9 +16,9 @@ getType(type: string): SavedObjectsType | undefined; | Parameter | Type | Description | | --- | --- | --- | -| type | string | | +| type | string | | Returns: -`SavedObjectsType | undefined` +SavedObjectsType<any> \| undefined diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.getvisibletypes.md b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.getvisibletypes.md index 05f22dcf7010bc..9588e77e646fc4 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.getvisibletypes.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.getvisibletypes.md @@ -15,5 +15,5 @@ getVisibleTypes(): SavedObjectsType[]; ``` Returns: -`SavedObjectsType[]` +SavedObjectsType<any>\[\] diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.ishidden.md b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.ishidden.md index aa19fa9b4364c8..2d29e753218d74 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.ishidden.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.ishidden.md @@ -16,9 +16,9 @@ isHidden(type: string): boolean; | Parameter | Type | Description | | --- | --- | --- | -| type | string | | +| type | string | | Returns: -`boolean` +boolean diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.isimportableandexportable.md b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.isimportableandexportable.md index aeefc207da4fed..8487af6a589116 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.isimportableandexportable.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.isimportableandexportable.md @@ -16,9 +16,9 @@ isImportableAndExportable(type: string): boolean; | Parameter | Type | Description | | --- | --- | --- | -| type | string | | +| type | string | | Returns: -`boolean` +boolean diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.ismultinamespace.md b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.ismultinamespace.md index 0ff07ae2804ff8..d4ec6de2392dd1 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.ismultinamespace.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.ismultinamespace.md @@ -16,9 +16,9 @@ isMultiNamespace(type: string): boolean; | Parameter | Type | Description | | --- | --- | --- | -| type | string | | +| type | string | | Returns: -`boolean` +boolean diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.isnamespaceagnostic.md b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.isnamespaceagnostic.md index 859c7b9711816f..d6eca4981f7ab4 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.isnamespaceagnostic.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.isnamespaceagnostic.md @@ -16,9 +16,9 @@ isNamespaceAgnostic(type: string): boolean; | Parameter | Type | Description | | --- | --- | --- | -| type | string | | +| type | string | | Returns: -`boolean` +boolean diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.isshareable.md b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.isshareable.md index ee240268f9d67a..0b67992e530800 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.isshareable.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.isshareable.md @@ -16,9 +16,9 @@ isShareable(type: string): boolean; | Parameter | Type | Description | | --- | --- | --- | -| type | string | | +| type | string | | Returns: -`boolean` +boolean diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.issinglenamespace.md b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.issinglenamespace.md index 18146b2fd6ea17..d1db00d0c8162f 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.issinglenamespace.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.issinglenamespace.md @@ -16,9 +16,9 @@ isSingleNamespace(type: string): boolean; | Parameter | Type | Description | | --- | --- | --- | -| type | string | | +| type | string | | Returns: -`boolean` +boolean diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.registertype.md b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.registertype.md index 7108805852c864..c0442e2aaa4ced 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.registertype.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjecttyperegistry.registertype.md @@ -16,9 +16,9 @@ registerType(type: SavedObjectsType): void; | Parameter | Type | Description | | --- | --- | --- | -| type | SavedObjectsType | | +| type | SavedObjectsType | | Returns: -`void` +void diff --git a/docs/development/core/server/kibana-plugin-core-server.searchresponse.md b/docs/development/core/server/kibana-plugin-core-server.searchresponse.md index cbaab4632014d9..7deca96e4054ca 100644 --- a/docs/development/core/server/kibana-plugin-core-server.searchresponse.md +++ b/docs/development/core/server/kibana-plugin-core-server.searchresponse.md @@ -15,11 +15,11 @@ export interface SearchResponse | Property | Type | Description | | --- | --- | --- | -| [\_scroll\_id](./kibana-plugin-core-server.searchresponse._scroll_id.md) | string | | -| [\_shards](./kibana-plugin-core-server.searchresponse._shards.md) | ShardsResponse | | -| [aggregations](./kibana-plugin-core-server.searchresponse.aggregations.md) | any | | -| [hits](./kibana-plugin-core-server.searchresponse.hits.md) | {
total: number;
max_score: number;
hits: Array<{
_index: string;
_type: string;
_id: string;
_score: number;
_source: T;
_version?: number;
_explanation?: Explanation;
fields?: any;
highlight?: any;
inner_hits?: any;
matched_queries?: string[];
sort?: unknown[];
}>;
} | | -| [pit\_id](./kibana-plugin-core-server.searchresponse.pit_id.md) | string | | -| [timed\_out](./kibana-plugin-core-server.searchresponse.timed_out.md) | boolean | | -| [took](./kibana-plugin-core-server.searchresponse.took.md) | number | | +| [\_scroll\_id?](./kibana-plugin-core-server.searchresponse._scroll_id.md) | string | (Optional) | +| [\_shards](./kibana-plugin-core-server.searchresponse._shards.md) | ShardsResponse | | +| [aggregations?](./kibana-plugin-core-server.searchresponse.aggregations.md) | any | (Optional) | +| [hits](./kibana-plugin-core-server.searchresponse.hits.md) | { total: number; max\_score: number; hits: Array<{ \_index: string; \_type: string; \_id: string; \_score: number; \_source: T; \_version?: number; \_explanation?: Explanation; fields?: any; highlight?: any; inner\_hits?: any; matched\_queries?: string\[\]; sort?: unknown\[\]; }>; } | | +| [pit\_id?](./kibana-plugin-core-server.searchresponse.pit_id.md) | string | (Optional) | +| [timed\_out](./kibana-plugin-core-server.searchresponse.timed_out.md) | boolean | | +| [took](./kibana-plugin-core-server.searchresponse.took.md) | number | | diff --git a/docs/development/core/server/kibana-plugin-core-server.servicestatus.md b/docs/development/core/server/kibana-plugin-core-server.servicestatus.md index d35fc951c57ffb..5c04cb33a75299 100644 --- a/docs/development/core/server/kibana-plugin-core-server.servicestatus.md +++ b/docs/development/core/server/kibana-plugin-core-server.servicestatus.md @@ -16,9 +16,9 @@ export interface ServiceStatus | unknown = unkn | Property | Type | Description | | --- | --- | --- | -| [detail](./kibana-plugin-core-server.servicestatus.detail.md) | string | A more detailed description of the service status. | -| [documentationUrl](./kibana-plugin-core-server.servicestatus.documentationurl.md) | string | A URL to open in a new tab about how to resolve or troubleshoot the problem. | -| [level](./kibana-plugin-core-server.servicestatus.level.md) | ServiceStatusLevel | The current availability level of the service. | -| [meta](./kibana-plugin-core-server.servicestatus.meta.md) | Meta | Any JSON-serializable data to be included in the HTTP API response. Useful for providing more fine-grained, machine-readable information about the service status. May include status information for underlying features. | -| [summary](./kibana-plugin-core-server.servicestatus.summary.md) | string | A high-level summary of the service status. | +| [detail?](./kibana-plugin-core-server.servicestatus.detail.md) | string | (Optional) A more detailed description of the service status. | +| [documentationUrl?](./kibana-plugin-core-server.servicestatus.documentationurl.md) | string | (Optional) A URL to open in a new tab about how to resolve or troubleshoot the problem. | +| [level](./kibana-plugin-core-server.servicestatus.level.md) | ServiceStatusLevel | The current availability level of the service. | +| [meta?](./kibana-plugin-core-server.servicestatus.meta.md) | Meta | (Optional) Any JSON-serializable data to be included in the HTTP API response. Useful for providing more fine-grained, machine-readable information about the service status. May include status information for underlying features. | +| [summary](./kibana-plugin-core-server.servicestatus.summary.md) | string | A high-level summary of the service status. | diff --git a/docs/development/core/server/kibana-plugin-core-server.sessioncookievalidationresult.md b/docs/development/core/server/kibana-plugin-core-server.sessioncookievalidationresult.md index 0c190c4819b5b7..6c1a5e7af78a73 100644 --- a/docs/development/core/server/kibana-plugin-core-server.sessioncookievalidationresult.md +++ b/docs/development/core/server/kibana-plugin-core-server.sessioncookievalidationresult.md @@ -16,6 +16,6 @@ export interface SessionCookieValidationResult | Property | Type | Description | | --- | --- | --- | -| [isValid](./kibana-plugin-core-server.sessioncookievalidationresult.isvalid.md) | boolean | Whether the cookie is valid or not. | -| [path](./kibana-plugin-core-server.sessioncookievalidationresult.path.md) | string | The "Path" attribute of the cookie; if the cookie is invalid, this is used to clear it. | +| [isValid](./kibana-plugin-core-server.sessioncookievalidationresult.isvalid.md) | boolean | Whether the cookie is valid or not. | +| [path?](./kibana-plugin-core-server.sessioncookievalidationresult.path.md) | string | (Optional) The "Path" attribute of the cookie; if the cookie is invalid, this is used to clear it. | diff --git a/docs/development/core/server/kibana-plugin-core-server.sessionstorage.clear.md b/docs/development/core/server/kibana-plugin-core-server.sessionstorage.clear.md index 731050a4880754..ac34c9b17be8d9 100644 --- a/docs/development/core/server/kibana-plugin-core-server.sessionstorage.clear.md +++ b/docs/development/core/server/kibana-plugin-core-server.sessionstorage.clear.md @@ -13,5 +13,5 @@ clear(): void; ``` Returns: -`void` +void diff --git a/docs/development/core/server/kibana-plugin-core-server.sessionstorage.get.md b/docs/development/core/server/kibana-plugin-core-server.sessionstorage.get.md index 4e4b2d9aa21cad..9e867b9e0fcc8d 100644 --- a/docs/development/core/server/kibana-plugin-core-server.sessionstorage.get.md +++ b/docs/development/core/server/kibana-plugin-core-server.sessionstorage.get.md @@ -13,5 +13,5 @@ get(): Promise; ``` Returns: -`Promise` +Promise<T \| null> diff --git a/docs/development/core/server/kibana-plugin-core-server.sessionstorage.set.md b/docs/development/core/server/kibana-plugin-core-server.sessionstorage.set.md index 15a4d9ec759484..a17aadf8fb9847 100644 --- a/docs/development/core/server/kibana-plugin-core-server.sessionstorage.set.md +++ b/docs/development/core/server/kibana-plugin-core-server.sessionstorage.set.md @@ -16,9 +16,9 @@ set(sessionValue: T): void; | Parameter | Type | Description | | --- | --- | --- | -| sessionValue | T | value to put | +| sessionValue | T | value to put | Returns: -`void` +void diff --git a/docs/development/core/server/kibana-plugin-core-server.sessionstoragecookieoptions.md b/docs/development/core/server/kibana-plugin-core-server.sessionstoragecookieoptions.md index b5dad111173598..425daf32f5cb32 100644 --- a/docs/development/core/server/kibana-plugin-core-server.sessionstoragecookieoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.sessionstoragecookieoptions.md @@ -16,9 +16,9 @@ export interface SessionStorageCookieOptions | Property | Type | Description | | --- | --- | --- | -| [encryptionKey](./kibana-plugin-core-server.sessionstoragecookieoptions.encryptionkey.md) | string | A key used to encrypt a cookie's value. Should be at least 32 characters long. | -| [isSecure](./kibana-plugin-core-server.sessionstoragecookieoptions.issecure.md) | boolean | Flag indicating whether the cookie should be sent only via a secure connection. | -| [name](./kibana-plugin-core-server.sessionstoragecookieoptions.name.md) | string | Name of the session cookie. | -| [sameSite](./kibana-plugin-core-server.sessionstoragecookieoptions.samesite.md) | 'Strict' | 'Lax' | 'None' | Defines SameSite attribute of the Set-Cookie Header. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite | -| [validate](./kibana-plugin-core-server.sessionstoragecookieoptions.validate.md) | (sessionValue: T | T[]) => SessionCookieValidationResult | Function called to validate a cookie's decrypted value. | +| [encryptionKey](./kibana-plugin-core-server.sessionstoragecookieoptions.encryptionkey.md) | string | A key used to encrypt a cookie's value. Should be at least 32 characters long. | +| [isSecure](./kibana-plugin-core-server.sessionstoragecookieoptions.issecure.md) | boolean | Flag indicating whether the cookie should be sent only via a secure connection. | +| [name](./kibana-plugin-core-server.sessionstoragecookieoptions.name.md) | string | Name of the session cookie. | +| [sameSite?](./kibana-plugin-core-server.sessionstoragecookieoptions.samesite.md) | 'Strict' \| 'Lax' \| 'None' | (Optional) Defines SameSite attribute of the Set-Cookie Header. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite | +| [validate](./kibana-plugin-core-server.sessionstoragecookieoptions.validate.md) | (sessionValue: T \| T\[\]) => SessionCookieValidationResult | Function called to validate a cookie's decrypted value. | diff --git a/docs/development/core/server/kibana-plugin-core-server.sessionstoragefactory.md b/docs/development/core/server/kibana-plugin-core-server.sessionstoragefactory.md index 848558291eb0e2..7bdea28beeda1d 100644 --- a/docs/development/core/server/kibana-plugin-core-server.sessionstoragefactory.md +++ b/docs/development/core/server/kibana-plugin-core-server.sessionstoragefactory.md @@ -16,5 +16,5 @@ export interface SessionStorageFactory | Property | Type | Description | | --- | --- | --- | -| [asScoped](./kibana-plugin-core-server.sessionstoragefactory.asscoped.md) | (request: KibanaRequest) => SessionStorage<T> | | +| [asScoped](./kibana-plugin-core-server.sessionstoragefactory.asscoped.md) | (request: KibanaRequest) => SessionStorage<T> | | diff --git a/docs/development/core/server/kibana-plugin-core-server.shardsinfo.md b/docs/development/core/server/kibana-plugin-core-server.shardsinfo.md index 9eafe3792c14ac..6c006c020d3fbc 100644 --- a/docs/development/core/server/kibana-plugin-core-server.shardsinfo.md +++ b/docs/development/core/server/kibana-plugin-core-server.shardsinfo.md @@ -15,8 +15,8 @@ export interface ShardsInfo | Property | Type | Description | | --- | --- | --- | -| [failed](./kibana-plugin-core-server.shardsinfo.failed.md) | number | | -| [skipped](./kibana-plugin-core-server.shardsinfo.skipped.md) | number | | -| [successful](./kibana-plugin-core-server.shardsinfo.successful.md) | number | | -| [total](./kibana-plugin-core-server.shardsinfo.total.md) | number | | +| [failed](./kibana-plugin-core-server.shardsinfo.failed.md) | number | | +| [skipped](./kibana-plugin-core-server.shardsinfo.skipped.md) | number | | +| [successful](./kibana-plugin-core-server.shardsinfo.successful.md) | number | | +| [total](./kibana-plugin-core-server.shardsinfo.total.md) | number | | diff --git a/docs/development/core/server/kibana-plugin-core-server.shardsresponse.md b/docs/development/core/server/kibana-plugin-core-server.shardsresponse.md index 722ffd8efdb571..65e113f05212fb 100644 --- a/docs/development/core/server/kibana-plugin-core-server.shardsresponse.md +++ b/docs/development/core/server/kibana-plugin-core-server.shardsresponse.md @@ -15,8 +15,8 @@ export interface ShardsResponse | Property | Type | Description | | --- | --- | --- | -| [failed](./kibana-plugin-core-server.shardsresponse.failed.md) | number | | -| [skipped](./kibana-plugin-core-server.shardsresponse.skipped.md) | number | | -| [successful](./kibana-plugin-core-server.shardsresponse.successful.md) | number | | -| [total](./kibana-plugin-core-server.shardsresponse.total.md) | number | | +| [failed](./kibana-plugin-core-server.shardsresponse.failed.md) | number | | +| [skipped](./kibana-plugin-core-server.shardsresponse.skipped.md) | number | | +| [successful](./kibana-plugin-core-server.shardsresponse.successful.md) | number | | +| [total](./kibana-plugin-core-server.shardsresponse.total.md) | number | | diff --git a/docs/development/core/server/kibana-plugin-core-server.statusservicesetup.md b/docs/development/core/server/kibana-plugin-core-server.statusservicesetup.md index f522d11a7ffefb..5409772c369c27 100644 --- a/docs/development/core/server/kibana-plugin-core-server.statusservicesetup.md +++ b/docs/development/core/server/kibana-plugin-core-server.statusservicesetup.md @@ -30,7 +30,6 @@ core.status.set( }) ; ); ); - ``` ## Example 2 @@ -64,18 +63,17 @@ core.status.set( }) ) ); - ``` ## Properties | Property | Type | Description | | --- | --- | --- | -| [core$](./kibana-plugin-core-server.statusservicesetup.core_.md) | Observable<CoreStatus> | Current status for all Core services. | -| [dependencies$](./kibana-plugin-core-server.statusservicesetup.dependencies_.md) | Observable<Record<string, ServiceStatus>> | Current status for all plugins this plugin depends on. Each key of the Record is a plugin id. | -| [derivedStatus$](./kibana-plugin-core-server.statusservicesetup.derivedstatus_.md) | Observable<ServiceStatus> | The status of this plugin as derived from its dependencies. | -| [isStatusPageAnonymous](./kibana-plugin-core-server.statusservicesetup.isstatuspageanonymous.md) | () => boolean | Whether or not the status HTTP APIs are available to unauthenticated users when an authentication provider is present. | -| [overall$](./kibana-plugin-core-server.statusservicesetup.overall_.md) | Observable<ServiceStatus> | Overall system status for all of Kibana. | +| [core$](./kibana-plugin-core-server.statusservicesetup.core_.md) | Observable<CoreStatus> | Current status for all Core services. | +| [dependencies$](./kibana-plugin-core-server.statusservicesetup.dependencies_.md) | Observable<Record<string, ServiceStatus>> | Current status for all plugins this plugin depends on. Each key of the Record is a plugin id. | +| [derivedStatus$](./kibana-plugin-core-server.statusservicesetup.derivedstatus_.md) | Observable<ServiceStatus> | The status of this plugin as derived from its dependencies. | +| [isStatusPageAnonymous](./kibana-plugin-core-server.statusservicesetup.isstatuspageanonymous.md) | () => boolean | Whether or not the status HTTP APIs are available to unauthenticated users when an authentication provider is present. | +| [overall$](./kibana-plugin-core-server.statusservicesetup.overall_.md) | Observable<ServiceStatus> | Overall system status for all of Kibana. | ## Methods diff --git a/docs/development/core/server/kibana-plugin-core-server.statusservicesetup.set.md b/docs/development/core/server/kibana-plugin-core-server.statusservicesetup.set.md index bf08ca1682f3b1..b60319e19529a2 100644 --- a/docs/development/core/server/kibana-plugin-core-server.statusservicesetup.set.md +++ b/docs/development/core/server/kibana-plugin-core-server.statusservicesetup.set.md @@ -16,11 +16,11 @@ set(status$: Observable): void; | Parameter | Type | Description | | --- | --- | --- | -| status$ | Observable<ServiceStatus> | | +| status$ | Observable<ServiceStatus> | | Returns: -`void` +void ## Remarks diff --git a/docs/development/core/server/kibana-plugin-core-server.uisettingsparams.md b/docs/development/core/server/kibana-plugin-core-server.uisettingsparams.md index c0da909cfe5ec5..531a0e75c97b0c 100644 --- a/docs/development/core/server/kibana-plugin-core-server.uisettingsparams.md +++ b/docs/development/core/server/kibana-plugin-core-server.uisettingsparams.md @@ -16,18 +16,18 @@ export interface UiSettingsParams | Property | Type | Description | | --- | --- | --- | -| [category](./kibana-plugin-core-server.uisettingsparams.category.md) | string[] | used to group the configured setting in the UI | -| [deprecation](./kibana-plugin-core-server.uisettingsparams.deprecation.md) | DeprecationSettings | optional deprecation information. Used to generate a deprecation warning. | -| [description](./kibana-plugin-core-server.uisettingsparams.description.md) | string | description provided to a user in UI | -| [metric](./kibana-plugin-core-server.uisettingsparams.metric.md) | {
type: UiCounterMetricType;
name: string;
} | Metric to track once this property changes | -| [name](./kibana-plugin-core-server.uisettingsparams.name.md) | string | title in the UI | -| [optionLabels](./kibana-plugin-core-server.uisettingsparams.optionlabels.md) | Record<string, string> | text labels for 'select' type UI element | -| [options](./kibana-plugin-core-server.uisettingsparams.options.md) | string[] | array of permitted values for this setting | -| [order](./kibana-plugin-core-server.uisettingsparams.order.md) | number | index of the settings within its category (ascending order, smallest will be displayed first). Used for ordering in the UI. settings without order defined will be displayed last and ordered by name | -| [readonly](./kibana-plugin-core-server.uisettingsparams.readonly.md) | boolean | a flag indicating that value cannot be changed | -| [requiresPageReload](./kibana-plugin-core-server.uisettingsparams.requirespagereload.md) | boolean | a flag indicating whether new value applying requires page reloading | -| [schema](./kibana-plugin-core-server.uisettingsparams.schema.md) | Type<T> | | -| [sensitive](./kibana-plugin-core-server.uisettingsparams.sensitive.md) | boolean | a flag indicating that value might contain user sensitive data. used by telemetry to mask the value of the setting when sent. | -| [type](./kibana-plugin-core-server.uisettingsparams.type.md) | UiSettingsType | defines a type of UI element [UiSettingsType](./kibana-plugin-core-server.uisettingstype.md) | -| [value](./kibana-plugin-core-server.uisettingsparams.value.md) | T | default value to fall back to if a user doesn't provide any | +| [category?](./kibana-plugin-core-server.uisettingsparams.category.md) | string\[\] | (Optional) used to group the configured setting in the UI | +| [deprecation?](./kibana-plugin-core-server.uisettingsparams.deprecation.md) | DeprecationSettings | (Optional) optional deprecation information. Used to generate a deprecation warning. | +| [description?](./kibana-plugin-core-server.uisettingsparams.description.md) | string | (Optional) description provided to a user in UI | +| [metric?](./kibana-plugin-core-server.uisettingsparams.metric.md) | { type: UiCounterMetricType; name: string; } | (Optional) Metric to track once this property changes | +| [name?](./kibana-plugin-core-server.uisettingsparams.name.md) | string | (Optional) title in the UI | +| [optionLabels?](./kibana-plugin-core-server.uisettingsparams.optionlabels.md) | Record<string, string> | (Optional) text labels for 'select' type UI element | +| [options?](./kibana-plugin-core-server.uisettingsparams.options.md) | string\[\] | (Optional) array of permitted values for this setting | +| [order?](./kibana-plugin-core-server.uisettingsparams.order.md) | number | (Optional) index of the settings within its category (ascending order, smallest will be displayed first). Used for ordering in the UI. settings without order defined will be displayed last and ordered by name | +| [readonly?](./kibana-plugin-core-server.uisettingsparams.readonly.md) | boolean | (Optional) a flag indicating that value cannot be changed | +| [requiresPageReload?](./kibana-plugin-core-server.uisettingsparams.requirespagereload.md) | boolean | (Optional) a flag indicating whether new value applying requires page reloading | +| [schema](./kibana-plugin-core-server.uisettingsparams.schema.md) | Type<T> | | +| [sensitive?](./kibana-plugin-core-server.uisettingsparams.sensitive.md) | boolean | (Optional) a flag indicating that value might contain user sensitive data. used by telemetry to mask the value of the setting when sent. | +| [type?](./kibana-plugin-core-server.uisettingsparams.type.md) | UiSettingsType | (Optional) defines a type of UI element [UiSettingsType](./kibana-plugin-core-server.uisettingstype.md) | +| [value?](./kibana-plugin-core-server.uisettingsparams.value.md) | T | (Optional) default value to fall back to if a user doesn't provide any | diff --git a/docs/development/core/server/kibana-plugin-core-server.uisettingsservicesetup.register.md b/docs/development/core/server/kibana-plugin-core-server.uisettingsservicesetup.register.md index 24bfc32cb1139f..97b06ddb00e70a 100644 --- a/docs/development/core/server/kibana-plugin-core-server.uisettingsservicesetup.register.md +++ b/docs/development/core/server/kibana-plugin-core-server.uisettingsservicesetup.register.md @@ -16,11 +16,11 @@ register(settings: Record): void; | Parameter | Type | Description | | --- | --- | --- | -| settings | Record<string, UiSettingsParams> | | +| settings | Record<string, UiSettingsParams> | | Returns: -`void` +void ## Example @@ -35,6 +35,5 @@ setup(core: CoreSetup){ }, }]); } - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.uisettingsservicestart.asscopedtoclient.md b/docs/development/core/server/kibana-plugin-core-server.uisettingsservicestart.asscopedtoclient.md index 1703df00a5e713..1d76bc26a41501 100644 --- a/docs/development/core/server/kibana-plugin-core-server.uisettingsservicestart.asscopedtoclient.md +++ b/docs/development/core/server/kibana-plugin-core-server.uisettingsservicestart.asscopedtoclient.md @@ -18,11 +18,11 @@ asScopedToClient(savedObjectsClient: SavedObjectsClientContract): IUiSettingsCli | Parameter | Type | Description | | --- | --- | --- | -| savedObjectsClient | SavedObjectsClientContract | | +| savedObjectsClient | SavedObjectsClientContract | | Returns: -`IUiSettingsClient` +IUiSettingsClient ## Example @@ -32,6 +32,5 @@ start(core: CoreStart) { const soClient = core.savedObjects.getScopedClient(arbitraryRequest); const uiSettingsClient = core.uiSettings.asScopedToClient(soClient); } - ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.userprovidedvalues.md b/docs/development/core/server/kibana-plugin-core-server.userprovidedvalues.md index eddfcb456826ee..fe8aaf233fbf75 100644 --- a/docs/development/core/server/kibana-plugin-core-server.userprovidedvalues.md +++ b/docs/development/core/server/kibana-plugin-core-server.userprovidedvalues.md @@ -16,6 +16,6 @@ export interface UserProvidedValues | Property | Type | Description | | --- | --- | --- | -| [isOverridden](./kibana-plugin-core-server.userprovidedvalues.isoverridden.md) | boolean | | -| [userValue](./kibana-plugin-core-server.userprovidedvalues.uservalue.md) | T | | +| [isOverridden?](./kibana-plugin-core-server.userprovidedvalues.isoverridden.md) | boolean | (Optional) | +| [userValue?](./kibana-plugin-core-server.userprovidedvalues.uservalue.md) | T | (Optional) | diff --git a/package.json b/package.json index 5eba8a9265d708..c30294bf86718d 100644 --- a/package.json +++ b/package.json @@ -184,8 +184,6 @@ "@turf/distance": "6.0.1", "@turf/helpers": "6.0.1", "@turf/length": "^6.0.2", - "@types/react-router-config": "^5.0.2", - "@types/redux-logger": "^3.0.8", "JSONStream": "1.3.5", "abort-controller": "^3.0.0", "abortcontroller-polyfill": "^1.7.3", @@ -193,7 +191,6 @@ "archiver": "^5.2.0", "axios": "^0.21.1", "base64-js": "^1.3.1", - "bluebird": "3.5.5", "brace": "0.11.1", "broadcast-channel": "^4.2.0", "chalk": "^4.1.0", @@ -466,8 +463,8 @@ "@kbn/test-subj-selector": "link:bazel-bin/packages/kbn-test-subj-selector", "@loaders.gl/polyfills": "^2.3.5", "@mapbox/vector-tile": "1.3.1", - "@microsoft/api-documenter": "7.7.2", - "@microsoft/api-extractor": "7.7.0", + "@microsoft/api-documenter": "7.13.68", + "@microsoft/api-extractor": "7.18.19", "@octokit/rest": "^16.35.0", "@percy/agent": "^0.28.6", "@storybook/addon-a11y": "^6.1.20", @@ -494,7 +491,6 @@ "@types/archiver": "^5.1.0", "@types/babel__core": "^7.1.16", "@types/base64-js": "^1.2.5", - "@types/bluebird": "^3.1.1", "@types/chance": "^1.0.0", "@types/chroma-js": "^1.4.2", "@types/chromedriver": "^81.0.0", @@ -598,6 +594,7 @@ "@types/react-redux": "^7.1.9", "@types/react-resize-detector": "^4.0.1", "@types/react-router": "^5.1.7", + "@types/react-router-config": "^5.0.2", "@types/react-router-dom": "^5.1.5", "@types/react-test-renderer": "^16.9.1", "@types/react-virtualized": "^9.18.7", @@ -606,6 +603,7 @@ "@types/recompose": "^0.30.6", "@types/reduce-reducers": "^1.0.0", "@types/redux-actions": "^2.6.1", + "@types/redux-logger": "^3.0.8", "@types/seedrandom": ">=2.0.0 <4.0.0", "@types/selenium-webdriver": "^4.0.15", "@types/semver": "^7", diff --git a/packages/kbn-es-archiver/BUILD.bazel b/packages/kbn-es-archiver/BUILD.bazel index 90c63f82b72fad..2dc311ed744061 100644 --- a/packages/kbn-es-archiver/BUILD.bazel +++ b/packages/kbn-es-archiver/BUILD.bazel @@ -34,7 +34,6 @@ RUNTIME_DEPS = [ "//packages/kbn-utils", "@npm//@elastic/elasticsearch", "@npm//aggregate-error", - "@npm//bluebird", "@npm//chance", "@npm//globby", "@npm//json-stable-stringify", @@ -51,7 +50,6 @@ TYPES_DEPS = [ "@npm//aggregate-error", "@npm//globby", "@npm//zlib", - "@npm//@types/bluebird", "@npm//@types/chance", "@npm//@types/jest", "@npm//@types/json-stable-stringify", diff --git a/packages/kbn-es-archiver/src/actions/rebuild_all.ts b/packages/kbn-es-archiver/src/actions/rebuild_all.ts index f286f9719bdf1f..360fdb438f2dbc 100644 --- a/packages/kbn-es-archiver/src/actions/rebuild_all.ts +++ b/packages/kbn-es-archiver/src/actions/rebuild_all.ts @@ -7,9 +7,9 @@ */ import { resolve, relative } from 'path'; -import { stat, Stats, rename, createReadStream, createWriteStream } from 'fs'; +import { Stats, createReadStream, createWriteStream } from 'fs'; +import { stat, rename } from 'fs/promises'; import { Readable, Writable } from 'stream'; -import { fromNode } from 'bluebird'; import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils'; import { createPromiseFromStreams } from '@kbn/utils'; import { @@ -21,7 +21,7 @@ import { } from '../lib'; async function isDirectory(path: string): Promise { - const stats: Stats = await fromNode((cb) => stat(path, cb)); + const stats: Stats = await stat(path); return stats.isDirectory(); } @@ -50,7 +50,7 @@ export async function rebuildAllAction({ dataDir, log }: { dataDir: string; log: createWriteStream(tempFile), ] as [Readable, ...Writable[]]); - await fromNode((cb) => rename(tempFile, childPath, cb)); + await rename(tempFile, childPath); log.info('[%s] Rebuilt %j', archiveName, childName); } } diff --git a/packages/kbn-es-archiver/src/lib/directory.ts b/packages/kbn-es-archiver/src/lib/directory.ts index f82e59a0ed2528..2ff5b7e704edfa 100644 --- a/packages/kbn-es-archiver/src/lib/directory.ts +++ b/packages/kbn-es-archiver/src/lib/directory.ts @@ -6,10 +6,9 @@ * Side Public License, v 1. */ -import { readdir } from 'fs'; -import { fromNode } from 'bluebird'; +import { readdir } from 'fs/promises'; export async function readDirectory(path: string) { - const allNames = await fromNode((cb) => readdir(path, cb)); + const allNames = await readdir(path); return allNames.filter((name) => !name.startsWith('.')); } diff --git a/packages/kbn-logging/src/log_record.ts b/packages/kbn-logging/src/log_record.ts index ee9ed0d69b7496..a212a50b8c98aa 100644 --- a/packages/kbn-logging/src/log_record.ts +++ b/packages/kbn-logging/src/log_record.ts @@ -6,7 +6,8 @@ * Side Public License, v 1. */ -import { LogLevel } from './log_level'; +import type { LogLevel } from './log_level'; +import type { LogMeta } from './log_meta'; /** * Essential parts of every log message. @@ -18,7 +19,7 @@ export interface LogRecord { context: string; message: string; error?: Error; - meta?: { [name: string]: any }; + meta?: LogMeta; pid: number; spanId?: string; traceId?: string; diff --git a/packages/kbn-test/src/functional_test_runner/integration_tests/__fixtures__/failure_hooks/config.js b/packages/kbn-test/src/functional_test_runner/integration_tests/__fixtures__/failure_hooks/config.js index 0b9cfd88b4cbbf..1375e5a3df2fd5 100644 --- a/packages/kbn-test/src/functional_test_runner/integration_tests/__fixtures__/failure_hooks/config.js +++ b/packages/kbn-test/src/functional_test_runner/integration_tests/__fixtures__/failure_hooks/config.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { delay } from 'bluebird'; +import { setTimeout as setTimeoutAsync } from 'timers/promises'; export default function () { return { @@ -22,13 +22,13 @@ export default function () { lifecycle.testFailure.add(async (err, test) => { log.info('testFailure %s %s', err.message, test.fullTitle()); - await delay(10); + await setTimeoutAsync(10); log.info('testFailureAfterDelay %s %s', err.message, test.fullTitle()); }); lifecycle.testHookFailure.add(async (err, test) => { log.info('testHookFailure %s %s', err.message, test.fullTitle()); - await delay(10); + await setTimeoutAsync(10); log.info('testHookFailureAfterDelay %s %s', err.message, test.fullTitle()); }); }, diff --git a/packages/kbn-test/src/jest/setup/polyfills.js b/packages/kbn-test/src/jest/setup/polyfills.js index 48b597d280b4a7..ebe6178dbdd917 100644 --- a/packages/kbn-test/src/jest/setup/polyfills.js +++ b/packages/kbn-test/src/jest/setup/polyfills.js @@ -6,13 +6,6 @@ * Side Public License, v 1. */ -// bluebird < v3.3.5 does not work with MutationObserver polyfill -// when MutationObserver exists, bluebird avoids using node's builtin async schedulers -const bluebird = require('bluebird'); -bluebird.Promise.setScheduler(function (fn) { - global.setImmediate.call(global, fn); -}); - const MutationObserver = require('mutation-observer'); Object.defineProperty(window, 'MutationObserver', { value: MutationObserver }); diff --git a/packages/kbn-test/src/jest/utils/testbed/index.ts b/packages/kbn-test/src/jest/utils/testbed/index.ts index dfa5f011853c05..0e839c180b6b6c 100644 --- a/packages/kbn-test/src/jest/utils/testbed/index.ts +++ b/packages/kbn-test/src/jest/utils/testbed/index.ts @@ -7,4 +7,12 @@ */ export { registerTestBed } from './testbed'; -export type { TestBed, TestBedConfig, SetupFunc, UnwrapPromise } from './types'; +export type { + TestBed, + TestBedConfig, + AsyncTestBedConfig, + SetupFunc, + UnwrapPromise, + SyncSetupFunc, + AsyncSetupFunc, +} from './types'; diff --git a/packages/kbn-test/src/jest/utils/testbed/testbed.ts b/packages/kbn-test/src/jest/utils/testbed/testbed.ts index 472b9f2df939cf..240ec25a9c2963 100644 --- a/packages/kbn-test/src/jest/utils/testbed/testbed.ts +++ b/packages/kbn-test/src/jest/utils/testbed/testbed.ts @@ -16,7 +16,14 @@ import { mountComponentAsync, getJSXComponentWithProps, } from './mount_component'; -import { TestBedConfig, TestBed, SetupFunc } from './types'; +import { + TestBedConfig, + AsyncTestBedConfig, + TestBed, + SetupFunc, + SyncSetupFunc, + AsyncSetupFunc, +} from './types'; const defaultConfig: TestBedConfig = { defaultProps: {}, @@ -48,10 +55,18 @@ const defaultConfig: TestBedConfig = { }); ``` */ -export const registerTestBed = ( +export function registerTestBed( + Component: ComponentType, + config: AsyncTestBedConfig +): AsyncSetupFunc; +export function registerTestBed( Component: ComponentType, config?: TestBedConfig -): SetupFunc => { +): SyncSetupFunc; +export function registerTestBed( + Component: ComponentType, + config?: AsyncTestBedConfig | TestBedConfig +): SetupFunc { const { defaultProps = defaultConfig.defaultProps, memoryRouter = defaultConfig.memoryRouter!, @@ -188,7 +203,7 @@ export const registerTestBed = ( value, isAsync = false ) => { - const formInput = typeof input === 'string' ? find(input) : (input as ReactWrapper); + const formInput = typeof input === 'string' ? find(input) : input; if (!formInput.length) { throw new Error(`Input "${input}" was not found.`); @@ -207,7 +222,7 @@ export const registerTestBed = ( value, doUpdateComponent = true ) => { - const formSelect = typeof select === 'string' ? find(select) : (select as ReactWrapper); + const formSelect = typeof select === 'string' ? find(select) : select; if (!formSelect.length) { throw new Error(`Select "${select}" was not found.`); @@ -314,7 +329,7 @@ export const registerTestBed = ( router.history.push(url); }; - return { + const testBed: TestBed = { component, exists, find, @@ -336,8 +351,10 @@ export const registerTestBed = ( navigateTo, }, }; + + return testBed; } }; return setup; -}; +} diff --git a/packages/kbn-test/src/jest/utils/testbed/types.ts b/packages/kbn-test/src/jest/utils/testbed/types.ts index bba504951c0bc6..121b848e51b519 100644 --- a/packages/kbn-test/src/jest/utils/testbed/types.ts +++ b/packages/kbn-test/src/jest/utils/testbed/types.ts @@ -7,10 +7,13 @@ */ import { Store } from 'redux'; -import { ReactWrapper } from 'enzyme'; +import { ReactWrapper as GenericReactWrapper } from 'enzyme'; import { LocationDescriptor } from 'history'; +export type AsyncSetupFunc = (props?: any) => Promise>; +export type SyncSetupFunc = (props?: any) => TestBed; export type SetupFunc = (props?: any) => TestBed | Promise>; +export type ReactWrapper = GenericReactWrapper; export interface EuiTableMetaData { /** Array of rows of the table. Each row exposes its reactWrapper and its columns */ @@ -51,7 +54,7 @@ export interface TestBed { find('myForm.nameInput'); ``` */ - find: (testSubject: T, reactWrapper?: ReactWrapper) => ReactWrapper; + find: (testSubject: T, reactWrapper?: ReactWrapper) => ReactWrapper; /** * Update the props of the mounted component * @@ -147,15 +150,23 @@ export interface TestBed { }; } -export interface TestBedConfig { +export interface BaseTestBedConfig { /** The default props to pass to the mounted component. */ defaultProps?: Record; /** Configuration object for the react-router `MemoryRouter. */ memoryRouter?: MemoryRouterConfig; /** An optional redux store. You can also provide a function that returns a store. */ store?: (() => Store) | Store | null; +} + +export interface AsyncTestBedConfig extends BaseTestBedConfig { + /* Mount the component asynchronously. When using "hooked" components with _useEffect()_ calls, you need to set this to "true". */ + doMountAsync: true; +} + +export interface TestBedConfig extends BaseTestBedConfig { /* Mount the component asynchronously. When using "hooked" components with _useEffect()_ calls, you need to set this to "true". */ - doMountAsync?: boolean; + doMountAsync?: false; } export interface MemoryRouterConfig { diff --git a/packages/kbn-test/src/mocha/junit_report_generation.test.js b/packages/kbn-test/src/mocha/junit_report_generation.test.js index e4e4499f556fd0..c19550349fd85c 100644 --- a/packages/kbn-test/src/mocha/junit_report_generation.test.js +++ b/packages/kbn-test/src/mocha/junit_report_generation.test.js @@ -7,9 +7,9 @@ */ import { resolve } from 'path'; -import { readFileSync } from 'fs'; +import { readFile } from 'fs/promises'; +import { promisify } from 'util'; -import { fromNode as fcb } from 'bluebird'; import { parseString } from 'xml2js'; import del from 'del'; import Mocha from 'mocha'; @@ -22,6 +22,8 @@ const DURATION_REGEX = /^\d+\.\d{3}$/; const ISO_DATE_SEC_REGEX = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/; const XML_PATH = getUniqueJunitReportPath(PROJECT_DIR, 'test'); +const parseStringAsync = promisify(parseString); + describe('dev/mocha/junit report generation', () => { afterEach(() => { del.sync(resolve(PROJECT_DIR, 'target')); @@ -39,7 +41,7 @@ describe('dev/mocha/junit report generation', () => { mocha.addFile(resolve(PROJECT_DIR, 'test.js')); await new Promise((resolve) => mocha.run(resolve)); - const report = await fcb((cb) => parseString(readFileSync(XML_PATH), cb)); + const report = await parseStringAsync(await readFile(XML_PATH)); // test case results are wrapped in expect(report).toEqual({ diff --git a/packages/kbn-utils/src/streams/map_stream.test.ts b/packages/kbn-utils/src/streams/map_stream.test.ts index 2c3df67fdf35c0..94c01d04f7dc96 100644 --- a/packages/kbn-utils/src/streams/map_stream.test.ts +++ b/packages/kbn-utils/src/streams/map_stream.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { delay } from 'bluebird'; +import { setTimeout as setTimeoutAsync } from 'timers/promises'; import { createPromiseFromStreams } from './promise_from_streams'; import { createListStream } from './list_stream'; @@ -39,7 +39,7 @@ describe('createMapStream()', () => { const result = await createPromiseFromStreams([ createListStream([1, 2, 3]), createMapStream(async (n: number, i: number) => { - await delay(n); + await setTimeoutAsync(n); return n * i; }), createConcatStream([]), diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md index 67edf0cf37614a..1dc7ead2829276 100644 --- a/src/core/public/public.api.md +++ b/src/core/public/public.api.md @@ -4,8 +4,11 @@ ```ts +/// + import { Action } from 'history'; import Boom from '@hapi/boom'; +import { ByteSizeValue } from '@kbn/config-schema'; import { ConfigPath } from '@kbn/config'; import { DetailedPeerCertificate } from 'tls'; import { EnvironmentMode } from '@kbn/config'; @@ -16,12 +19,12 @@ import { EuiConfirmModalProps } from '@elastic/eui'; import { EuiFlyoutSize } from '@elastic/eui'; import { EuiGlobalToastListToast } from '@elastic/eui'; import { EuiOverlayMaskProps } from '@elastic/eui'; -import { History } from 'history'; +import { History as History_2 } from 'history'; import { Href } from 'history'; import { IconType } from '@elastic/eui'; import { IncomingHttpHeaders } from 'http'; -import { KibanaClient } from '@elastic/elasticsearch/lib/api/kibana'; -import { Location } from 'history'; +import type { KibanaClient } from '@elastic/elasticsearch/lib/api/kibana'; +import { Location as Location_2 } from 'history'; import { LocationDescriptorObject } from 'history'; import { Logger } from '@kbn/logging'; import { LogMeta } from '@kbn/logging'; @@ -31,21 +34,21 @@ import { Observable } from 'rxjs'; import { PackageInfo } from '@kbn/config'; import { Path } from 'history'; import { PeerCertificate } from 'tls'; -import { PublicMethodsOf } from '@kbn/utility-types'; +import type { PublicMethodsOf } from '@kbn/utility-types'; import { PublicUiSettingsParams as PublicUiSettingsParams_2 } from 'src/core/server/types'; -import React from 'react'; +import { default as React_2 } from 'react'; import { RecursiveReadonly } from '@kbn/utility-types'; -import { Request } from '@hapi/hapi'; +import { Request as Request_2 } from '@hapi/hapi'; import * as Rx from 'rxjs'; import { SchemaTypeError } from '@kbn/config-schema'; -import { TransportRequestOptions } from '@elastic/elasticsearch'; -import { TransportRequestParams } from '@elastic/elasticsearch'; -import { TransportResult } from '@elastic/elasticsearch'; +import type { TransportRequestOptions } from '@elastic/elasticsearch'; +import type { TransportRequestParams } from '@elastic/elasticsearch'; +import type { TransportResult } from '@elastic/elasticsearch'; import { Type } from '@kbn/config-schema'; import { TypeOf } from '@kbn/config-schema'; import { UiCounterMetricType } from '@kbn/analytics'; import { UnregisterCallback } from 'history'; -import { URL } from 'url'; +import { URL as URL_2 } from 'url'; import { UserProvidedValues as UserProvidedValues_2 } from 'src/core/server/types'; // @internal (undocumented) @@ -251,7 +254,7 @@ export type ChromeHelpExtensionLinkBase = Pick; // (undocumented) stop(): void; - } +} // @internal (undocumented) export const DEFAULT_APP_CATEGORIES: Record; @@ -913,7 +916,7 @@ export type HttpStart = HttpSetup; // @public export interface I18nStart { Context: ({ children }: { - children: React.ReactNode; + children: React_2.ReactNode; }) => JSX.Element; } @@ -1137,7 +1140,7 @@ export interface OverlayStart { export { PackageInfo } // @public -export interface Plugin { +interface Plugin_2 { // (undocumented) setup(core: CoreSetup, plugins: TPluginsSetup): TSetup; // (undocumented) @@ -1145,9 +1148,10 @@ export interface Plugin = (core: PluginInitializerContext) => Plugin | AsyncPlugin; +export type PluginInitializer = (core: PluginInitializerContext) => Plugin_2 | AsyncPlugin; // @public export interface PluginInitializerContext { @@ -1608,10 +1612,10 @@ export interface SavedObjectsUpdateOptions { } // @public -export class ScopedHistory implements History { - constructor(parentHistory: History, basePath: string); +export class ScopedHistory implements History_2 { + constructor(parentHistory: History_2, basePath: string); get action(): Action; - block: (prompt?: string | boolean | History.TransitionPromptHook | undefined) => UnregisterCallback; + block: (prompt?: string | boolean | History_2.TransitionPromptHook | undefined) => UnregisterCallback; createHref: (location: LocationDescriptorObject, { prependBasePath }?: { prependBasePath?: boolean | undefined; }) => Href; @@ -1620,11 +1624,11 @@ export class ScopedHistory implements History void; goForward: () => void; get length(): number; - listen: (listener: (location: Location, action: Action) => void) => UnregisterCallback; - get location(): Location; + listen: (listener: (location: Location_2, action: Action) => void) => UnregisterCallback; + get location(): Location_2; push: (pathOrLocation: Path | LocationDescriptorObject, state?: HistoryLocationState | undefined) => void; replace: (pathOrLocation: Path | LocationDescriptorObject, state?: HistoryLocationState | undefined) => void; - } +} // @public export class SimpleSavedObject { @@ -1700,7 +1704,7 @@ export class ToastsApi implements IToasts { overlays: OverlayStart; i18n: I18nStart; }): void; - } +} // @public (undocumented) export type ToastsSetup = IToasts; @@ -1755,7 +1759,6 @@ export interface UserProvidedValues { userValue?: T; } - // Warnings were encountered during analysis: // // src/core/public/core_system.ts:168:21 - (ae-forgotten-export) The symbol "InternalApplicationStart" needs to be exported by the entry point index.d.ts diff --git a/src/core/server/logging/appenders/rewrite/policies/meta/meta_policy.test.ts b/src/core/server/logging/appenders/rewrite/policies/meta/meta_policy.test.ts index f03c5bd9d1f8f2..47799ef5d43357 100644 --- a/src/core/server/logging/appenders/rewrite/policies/meta/meta_policy.test.ts +++ b/src/core/server/logging/appenders/rewrite/policies/meta/meta_policy.test.ts @@ -29,26 +29,27 @@ describe('MetaRewritePolicy', () => { // @ts-expect-error ECS custom meta const log = createLogRecord({ a: 'before' }); const policy = createPolicy('update', [{ path: 'a', value: 'after' }]); + // @ts-expect-error ECS custom meta expect(policy.rewrite(log).meta!.a).toBe('after'); }); it('updates nested properties in LogMeta', () => { - // @ts-expect-error ECS custom meta - const log = createLogRecord({ a: 'before a', b: { c: 'before b.c' }, d: [0, 1] }); + const log = createLogRecord({ + error: { message: 'before b.c' }, + tags: ['0', '1'], + }); const policy = createPolicy('update', [ - { path: 'a', value: 'after a' }, - { path: 'b.c', value: 'after b.c' }, - { path: 'd[1]', value: 2 }, + { path: 'error.message', value: 'after b.c' }, + { path: 'tags[1]', value: '2' }, ]); expect(policy.rewrite(log).meta).toMatchInlineSnapshot(` Object { - "a": "after a", - "b": Object { - "c": "after b.c", + "error": Object { + "message": "after b.c", }, - "d": Array [ - 0, - 2, + "tags": Array [ + "0", + "2", ], } `); @@ -80,14 +81,13 @@ describe('MetaRewritePolicy', () => { it(`does not add properties which don't exist yet`, () => { const policy = createPolicy('update', [ - { path: 'a.b', value: 'foo' }, - { path: 'a.c', value: 'bar' }, + { path: 'error.message', value: 'foo' }, + { path: 'error.id', value: 'bar' }, ]); - // @ts-expect-error ECS custom meta - const log = createLogRecord({ a: { b: 'existing meta' } }); + const log = createLogRecord({ error: { message: 'existing meta' } }); const { meta } = policy.rewrite(log); - expect(meta!.a.b).toBe('foo'); - expect(meta!.a.c).toBeUndefined(); + expect(meta?.error?.message).toBe('foo'); + expect(meta?.error?.id).toBeUndefined(); }); it('does not touch anything outside of LogMeta', () => { @@ -110,22 +110,19 @@ describe('MetaRewritePolicy', () => { describe('mode: remove', () => { it('removes existing properties in LogMeta', () => { - // @ts-expect-error ECS custom meta - const log = createLogRecord({ a: 'goodbye' }); - const policy = createPolicy('remove', [{ path: 'a' }]); - expect(policy.rewrite(log).meta!.a).toBeUndefined(); + const log = createLogRecord({ error: { message: 'before' } }); + const policy = createPolicy('remove', [{ path: 'error' }]); + expect(policy.rewrite(log).meta?.error).toBeUndefined(); }); it('removes nested properties in LogMeta', () => { - // @ts-expect-error ECS custom meta - const log = createLogRecord({ a: 'a', b: { c: 'b.c' }, d: [0, 1] }); - const policy = createPolicy('remove', [{ path: 'b.c' }, { path: 'd[1]' }]); + const log = createLogRecord({ error: { message: 'reason' }, tags: ['0', '1'] }); + const policy = createPolicy('remove', [{ path: 'error.message' }, { path: 'tags[1]' }]); expect(policy.rewrite(log).meta).toMatchInlineSnapshot(` Object { - "a": "a", - "b": Object {}, - "d": Array [ - 0, + "error": Object {}, + "tags": Array [ + "0", undefined, ], } @@ -133,12 +130,11 @@ describe('MetaRewritePolicy', () => { }); it('has no effect if property does not exist', () => { - // @ts-expect-error ECS custom meta - const log = createLogRecord({ a: 'a' }); + const log = createLogRecord({ error: {} }); const policy = createPolicy('remove', [{ path: 'b' }]); expect(policy.rewrite(log).meta).toMatchInlineSnapshot(` Object { - "a": "a", + "error": Object {}, } `); }); diff --git a/src/core/server/logging/layouts/json_layout.test.ts b/src/core/server/logging/layouts/json_layout.test.ts index 84546f777ed0b8..d3bf2eab473a4d 100644 --- a/src/core/server/logging/layouts/json_layout.test.ts +++ b/src/core/server/logging/layouts/json_layout.test.ts @@ -98,6 +98,7 @@ test('`format()` correctly formats record with meta-data', () => { timestamp, pid: 5355, meta: { + // @ts-expect-error ECS custom meta version: { from: 'v7', to: 'v8', @@ -140,6 +141,7 @@ test('`format()` correctly formats error record with meta-data', () => { timestamp, pid: 5355, meta: { + // @ts-expect-error ECS custom meta version: { from: 'v7', to: 'v8', @@ -182,6 +184,7 @@ test('format() meta can merge override logs', () => { pid: 3, meta: { log: { + // @ts-expect-error ECS custom meta kbn_custom_field: 'hello', }, }, @@ -213,6 +216,7 @@ test('format() meta can not override message', () => { context: 'bar', pid: 3, meta: { + // @ts-expect-error cannot override message message: 'baz', }, }) @@ -242,7 +246,8 @@ test('format() meta can not override ecs version', () => { context: 'bar', pid: 3, meta: { - message: 'baz', + // @ts-expect-error cannot override ecs version + ecs: 1, }, }) ) @@ -272,6 +277,7 @@ test('format() meta can not override logger or level', () => { pid: 3, meta: { log: { + // @ts-expect-error cannot override log.level level: 'IGNORE', logger: 'me', }, @@ -303,6 +309,7 @@ test('format() meta can not override timestamp', () => { context: 'bar', pid: 3, meta: { + // @ts-expect-error cannot override @timestamp '@timestamp': '2099-02-01T09:30:22.011-05:00', }, }) @@ -332,9 +339,9 @@ test('format() meta can not override tracing properties', () => { context: 'bar', pid: 3, meta: { - span: 'span_override', - trace: 'trace_override', - transaction: 'transaction_override', + span: { id: 'span_override' }, + trace: { id: 'trace_override' }, + transaction: { id: 'transaction_override' }, }, spanId: 'spanId-1', traceId: 'traceId-1', diff --git a/src/core/server/logging/layouts/pattern_layout.test.ts b/src/core/server/logging/layouts/pattern_layout.test.ts index bb66722d4c2d09..22495736227b3f 100644 --- a/src/core/server/logging/layouts/pattern_layout.test.ts +++ b/src/core/server/logging/layouts/pattern_layout.test.ts @@ -118,6 +118,7 @@ test('`format()` correctly formats record with meta data.', () => { timestamp, pid: 5355, meta: { + // @ts-expect-error not valid ECS field from: 'v7', to: 'v8', }, @@ -177,6 +178,7 @@ test('`format()` allows specifying pattern with meta.', () => { to: 'v8', }, }; + // @ts-expect-error not valid ECS field expect(layout.format(record)).toBe('context-{"from":"v7","to":"v8"}-message'); }); diff --git a/src/core/server/saved_objects/migrations/__snapshots__/migrations_state_action_machine.test.ts.snap b/src/core/server/saved_objects/migrations/__snapshots__/migrations_state_action_machine.test.ts.snap index c3512d8fd50bd0..760a83fa65cf1f 100644 --- a/src/core/server/saved_objects/migrations/__snapshots__/migrations_state_action_machine.test.ts.snap +++ b/src/core/server/saved_objects/migrations/__snapshots__/migrations_state_action_machine.test.ts.snap @@ -84,11 +84,26 @@ Object { "type": "file-upload-telemetry", }, }, + Object { + "term": Object { + "type": "fleet-agent-actions", + }, + }, Object { "term": Object { "type": "fleet-agent-events", }, }, + Object { + "term": Object { + "type": "fleet-agents", + }, + }, + Object { + "term": Object { + "type": "fleet-enrollment-api-keys", + }, + }, Object { "term": Object { "type": "ml-telemetry", @@ -225,11 +240,26 @@ Object { "type": "file-upload-telemetry", }, }, + Object { + "term": Object { + "type": "fleet-agent-actions", + }, + }, Object { "term": Object { "type": "fleet-agent-events", }, }, + Object { + "term": Object { + "type": "fleet-agents", + }, + }, + Object { + "term": Object { + "type": "fleet-enrollment-api-keys", + }, + }, Object { "term": Object { "type": "ml-telemetry", @@ -370,11 +400,26 @@ Object { "type": "file-upload-telemetry", }, }, + Object { + "term": Object { + "type": "fleet-agent-actions", + }, + }, Object { "term": Object { "type": "fleet-agent-events", }, }, + Object { + "term": Object { + "type": "fleet-agents", + }, + }, + Object { + "term": Object { + "type": "fleet-enrollment-api-keys", + }, + }, Object { "term": Object { "type": "ml-telemetry", @@ -519,11 +564,26 @@ Object { "type": "file-upload-telemetry", }, }, + Object { + "term": Object { + "type": "fleet-agent-actions", + }, + }, Object { "term": Object { "type": "fleet-agent-events", }, }, + Object { + "term": Object { + "type": "fleet-agents", + }, + }, + Object { + "term": Object { + "type": "fleet-enrollment-api-keys", + }, + }, Object { "term": Object { "type": "ml-telemetry", @@ -705,11 +765,26 @@ Object { "type": "file-upload-telemetry", }, }, + Object { + "term": Object { + "type": "fleet-agent-actions", + }, + }, Object { "term": Object { "type": "fleet-agent-events", }, }, + Object { + "term": Object { + "type": "fleet-agents", + }, + }, + Object { + "term": Object { + "type": "fleet-enrollment-api-keys", + }, + }, Object { "term": Object { "type": "ml-telemetry", @@ -857,11 +932,26 @@ Object { "type": "file-upload-telemetry", }, }, + Object { + "term": Object { + "type": "fleet-agent-actions", + }, + }, Object { "term": Object { "type": "fleet-agent-events", }, }, + Object { + "term": Object { + "type": "fleet-agents", + }, + }, + Object { + "term": Object { + "type": "fleet-enrollment-api-keys", + }, + }, Object { "term": Object { "type": "ml-telemetry", diff --git a/src/core/server/saved_objects/migrations/core/unused_types.ts b/src/core/server/saved_objects/migrations/core/unused_types.ts index f5f6647201bbfb..ddcadc09502f43 100644 --- a/src/core/server/saved_objects/migrations/core/unused_types.ts +++ b/src/core/server/saved_objects/migrations/core/unused_types.ts @@ -18,6 +18,10 @@ export const REMOVED_TYPES: string[] = [ 'file-upload-telemetry', // https://github.com/elastic/kibana/issues/91869 'fleet-agent-events', + // https://github.com/elastic/obs-dc-team/issues/334 + 'fleet-agents', + 'fleet-agent-actions', + 'fleet-enrollment-api-keys', // Was removed in 7.12 'ml-telemetry', 'server', diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md index f135d8caaf54eb..18d1e479dddee8 100644 --- a/src/core/server/server.api.md +++ b/src/core/server/server.api.md @@ -4,11 +4,14 @@ ```ts +/// + import { AddConfigDeprecation } from '@kbn/config'; import Boom from '@hapi/boom'; import { ByteSizeValue } from '@kbn/config-schema'; import { CliArgs } from '@kbn/config'; -import { ClientOptions } from '@elastic/elasticsearch/lib/client'; +import type { ClientOptions } from '@elastic/elasticsearch/lib/client'; +import { ConditionalType } from '@kbn/config-schema/target_types/types'; import { ConfigDeprecation } from '@kbn/config'; import { ConfigDeprecationContext } from '@kbn/config'; import { ConfigDeprecationFactory } from '@kbn/config'; @@ -26,13 +29,14 @@ import { EcsEventType } from '@kbn/logging'; import { EnvironmentMode } from '@kbn/config'; import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { IncomingHttpHeaders } from 'http'; -import { KibanaClient } from '@elastic/elasticsearch/lib/api/kibana'; +import type { KibanaClient } from '@elastic/elasticsearch/lib/api/kibana'; import { Logger } from '@kbn/logging'; import { LoggerFactory } from '@kbn/logging'; -import { LogLevel } from '@kbn/logging'; +import { LogLevel as LogLevel_2 } from '@kbn/logging'; +import { LogLevelId } from '@kbn/logging'; import { LogMeta } from '@kbn/logging'; import { LogRecord } from '@kbn/logging'; -import { MaybePromise } from '@kbn/utility-types'; +import type { MaybePromise } from '@kbn/utility-types'; import { ObjectType } from '@kbn/config-schema'; import { Observable } from 'rxjs'; import { PackageInfo } from '@kbn/config'; @@ -41,20 +45,20 @@ import { PeerCertificate } from 'tls'; import { PublicMethodsOf } from '@kbn/utility-types'; import { Readable } from 'stream'; import { RecursiveReadonly } from '@kbn/utility-types'; -import { Request } from '@hapi/hapi'; -import { RequestHandlerContext as RequestHandlerContext_2 } from 'src/core/server'; +import { Request as Request_2 } from '@hapi/hapi'; +import type { RequestHandlerContext as RequestHandlerContext_2 } from 'src/core/server'; import { ResponseObject } from '@hapi/hapi'; import { ResponseToolkit } from '@hapi/hapi'; import { SchemaTypeError } from '@kbn/config-schema'; import { ShallowPromise } from '@kbn/utility-types'; import { Stream } from 'stream'; -import { TransportRequestOptions } from '@elastic/elasticsearch'; -import { TransportRequestParams } from '@elastic/elasticsearch'; -import { TransportResult } from '@elastic/elasticsearch'; +import type { TransportRequestOptions } from '@elastic/elasticsearch'; +import type { TransportRequestParams } from '@elastic/elasticsearch'; +import type { TransportResult } from '@elastic/elasticsearch'; import { Type } from '@kbn/config-schema'; import { TypeOf } from '@kbn/config-schema'; import { UiCounterMetricType } from '@kbn/analytics'; -import { URL } from 'url'; +import { URL as URL_2 } from 'url'; export { AddConfigDeprecation } @@ -223,42 +227,42 @@ export type CapabilitiesSwitcher = (request: KibanaRequest, uiCapabilities: Capa // @alpha export const config: { elasticsearch: { - schema: import("@kbn/config-schema").ObjectType<{ - sniffOnStart: Type; - sniffInterval: Type; - sniffOnConnectionFault: Type; - hosts: Type; - username: Type; - password: Type; - serviceAccountToken: Type; - requestHeadersWhitelist: Type; - customHeaders: Type>; - shardTimeout: Type; - requestTimeout: Type; - pingTimeout: Type; - logQueries: Type; - ssl: import("@kbn/config-schema").ObjectType<{ - verificationMode: Type<"none" | "certificate" | "full">; - certificateAuthorities: Type; - certificate: Type; - key: Type; - keyPassphrase: Type; - keystore: import("@kbn/config-schema").ObjectType<{ - path: Type; - password: Type; - }>; - truststore: import("@kbn/config-schema").ObjectType<{ - path: Type; - password: Type; - }>; - alwaysPresentCertificate: Type; - }>; - apiVersion: Type; - healthCheck: import("@kbn/config-schema").ObjectType<{ - delay: Type; - }>; - ignoreVersionMismatch: import("@kbn/config-schema/target_types/types").ConditionalType; - skipStartupConnectionCheck: import("@kbn/config-schema/target_types/types").ConditionalType; + schema: ObjectType< { + sniffOnStart: Type; + sniffInterval: Type; + sniffOnConnectionFault: Type; + hosts: Type; + username: Type; + password: Type; + serviceAccountToken: Type; + requestHeadersWhitelist: Type; + customHeaders: Type>; + shardTimeout: Type; + requestTimeout: Type; + pingTimeout: Type; + logQueries: Type; + ssl: ObjectType< { + verificationMode: Type<"none" | "certificate" | "full">; + certificateAuthorities: Type; + certificate: Type; + key: Type; + keyPassphrase: Type; + keystore: ObjectType< { + path: Type; + password: Type; + }>; + truststore: ObjectType< { + path: Type; + password: Type; + }>; + alwaysPresentCertificate: Type; + }>; + apiVersion: Type; + healthCheck: ObjectType< { + delay: Type; + }>; + ignoreVersionMismatch: ConditionalType; + skipStartupConnectionCheck: ConditionalType; }>; }; logging: { @@ -770,8 +774,6 @@ export interface CountResponse { // @public export class CspConfig implements ICspConfig { - // (undocumented) - #private; // Warning: (ae-forgotten-export) The symbol "CspConfigType" needs to be exported by the entry point index.d.ts // // @internal @@ -988,7 +990,7 @@ export type ExecutionContextStart = ExecutionContextSetup; // @public export interface FakeRequest { - headers: Headers; + headers: Headers_2; } // @public (undocumented) @@ -1046,11 +1048,12 @@ export type HandlerFunction = (context: T, ...args: any[]) => export type HandlerParameters> = T extends (context: any, ...args: infer U) => any ? U : never; // @public -export type Headers = { +type Headers_2 = { [header in KnownHeaders]?: string | string[] | undefined; } & { [header: string]: string | string[] | undefined; }; +export { Headers_2 as Headers } // @public (undocumented) export interface HttpAuth { @@ -1315,8 +1318,8 @@ export type KibanaExecutionContext = { // @public export class KibanaRequest { // @internal (undocumented) - protected readonly [requestSymbol]: Request; - constructor(request: Request, params: Params, query: Query, body: Body, withoutSecretHeaders: boolean); + protected readonly [requestSymbol]: Request_2; + constructor(request: Request_2, params: Params, query: Query, body: Body, withoutSecretHeaders: boolean); // (undocumented) readonly auth: { isAuthenticated: boolean; @@ -1327,21 +1330,21 @@ export class KibanaRequest(req: Request, routeSchemas?: RouteValidator | RouteValidatorFullConfig, withoutSecretHeaders?: boolean): KibanaRequest; - readonly headers: Headers; + static from(req: Request_2, routeSchemas?: RouteValidator | RouteValidatorFullConfig, withoutSecretHeaders?: boolean): KibanaRequest; + readonly headers: Headers_2; readonly id: string; readonly isSystemRequest: boolean; // (undocumented) readonly params: Params; // (undocumented) readonly query: Query; - readonly rewrittenUrl?: URL; + readonly rewrittenUrl?: URL_2; readonly route: RecursiveReadonly>; // (undocumented) readonly socket: IKibanaSocket; - readonly url: URL; + readonly url: URL_2; readonly uuid: string; - } +} // @public export interface KibanaRequestEvents { @@ -1415,7 +1418,7 @@ export interface LoggingServiceSetup { configure(config$: Observable): void; } -export { LogLevel } +export { LogLevel_2 as LogLevel } export { LogMeta } @@ -1597,7 +1600,7 @@ export interface OpsServerMetrics { export { PackageInfo } // @public -export interface Plugin { +interface Plugin_2 { // (undocumented) setup(core: CoreSetup, plugins: TPluginsSetup): TSetup; // (undocumented) @@ -1605,10 +1608,11 @@ export interface Plugin { - // Warning: (ae-unresolved-link) The @link reference could not be resolved: Reexported declarations are not supported + // Warning: (ae-unresolved-link) The @link reference could not be resolved: This type of declaration is not supported yet by the resolver deprecations?: ConfigDeprecationProvider; exposeToBrowser?: { [P in keyof T]?: boolean; @@ -1621,7 +1625,7 @@ export interface PluginConfigDescriptor { export type PluginConfigSchema = Type; // @public -export type PluginInitializer = (core: PluginInitializerContext) => Plugin | PrebootPlugin | AsyncPlugin; +export type PluginInitializer = (core: PluginInitializerContext) => Plugin_2 | PrebootPlugin | AsyncPlugin; // @public export interface PluginInitializerContext { @@ -1640,7 +1644,7 @@ export interface PluginInitializerContext { instanceUuid: string; configs: readonly string[]; }; - // Warning: (ae-unresolved-link) The @link reference could not be resolved: Reexported declarations are not supported + // Warning: (ae-unresolved-link) The @link reference could not be resolved: This type of declaration is not supported yet by the resolver logger: LoggerFactory; // (undocumented) opaqueId: PluginOpaqueId; @@ -1648,7 +1652,7 @@ export interface PluginInitializerContext { // @public export interface PluginManifest { - // Warning: (ae-unresolved-link) The @link reference could not be resolved: Reexported declarations are not supported + // Warning: (ae-unresolved-link) The @link reference could not be resolved: This type of declaration is not supported yet by the resolver readonly configPath: ConfigPath; readonly description?: string; // @deprecated @@ -2072,7 +2076,7 @@ export class SavedObjectsClient { removeReferencesTo(type: string, id: string, options?: SavedObjectsRemoveReferencesToOptions): Promise; resolve(type: string, id: string, options?: SavedObjectsBaseOptions): Promise>; update(type: string, id: string, attributes: Partial, options?: SavedObjectsUpdateOptions): Promise>; - updateObjectsSpaces(objects: SavedObjectsUpdateObjectsSpacesObject[], spacesToAdd: string[], spacesToRemove: string[], options?: SavedObjectsUpdateObjectsSpacesOptions): Promise; + updateObjectsSpaces(objects: SavedObjectsUpdateObjectsSpacesObject[], spacesToAdd: string[], spacesToRemove: string[], options?: SavedObjectsUpdateObjectsSpacesOptions): Promise; } // @public @@ -2251,17 +2255,15 @@ export interface SavedObjectsExportByTypeOptions extends SavedObjectExportBaseOp // @public (undocumented) export class SavedObjectsExporter { - // (undocumented) - #private; constructor({ savedObjectsClient, typeRegistry, exportSizeLimit, logger, }: { savedObjectsClient: SavedObjectsClientContract; typeRegistry: ISavedObjectTypeRegistry; exportSizeLimit: number; logger: Logger; }); - exportByObjects(options: SavedObjectsExportByObjectOptions): Promise; - exportByTypes(options: SavedObjectsExportByTypeOptions): Promise; - } + exportByObjects(options: SavedObjectsExportByObjectOptions): Promise; + exportByTypes(options: SavedObjectsExportByTypeOptions): Promise; +} // @public (undocumented) export class SavedObjectsExportError extends Error { @@ -2404,8 +2406,6 @@ export interface SavedObjectsImportConflictError { // @public (undocumented) export class SavedObjectsImporter { - // (undocumented) - #private; constructor({ savedObjectsClient, typeRegistry, importSizeLimit, }: { savedObjectsClient: SavedObjectsClientContract; typeRegistry: ISavedObjectTypeRegistry; @@ -2655,7 +2655,7 @@ export class SavedObjectsRepository { bulkUpdate(objects: Array>, options?: SavedObjectsBulkUpdateOptions): Promise>; checkConflicts(objects?: SavedObjectsCheckConflictsObject[], options?: SavedObjectsBaseOptions): Promise; closePointInTime(id: string, options?: SavedObjectsClosePointInTimeOptions): Promise; - collectMultiNamespaceReferences(objects: SavedObjectsCollectMultiNamespaceReferencesObject[], options?: SavedObjectsCollectMultiNamespaceReferencesOptions): Promise; + collectMultiNamespaceReferences(objects: SavedObjectsCollectMultiNamespaceReferencesObject[], options?: SavedObjectsCollectMultiNamespaceReferencesOptions): Promise; create(type: string, attributes: T, options?: SavedObjectsCreateOptions): Promise>; createPointInTimeFinder(findOptions: SavedObjectsCreatePointInTimeFinderOptions, dependencies?: SavedObjectsCreatePointInTimeFinderDependencies): ISavedObjectsPointInTimeFinder; // Warning: (ae-forgotten-export) The symbol "IKibanaMigrator" needs to be exported by the entry point index.d.ts @@ -2672,8 +2672,8 @@ export class SavedObjectsRepository { removeReferencesTo(type: string, id: string, options?: SavedObjectsRemoveReferencesToOptions): Promise; resolve(type: string, id: string, options?: SavedObjectsBaseOptions): Promise>; update(type: string, id: string, attributes: Partial, options?: SavedObjectsUpdateOptions): Promise>; - updateObjectsSpaces(objects: SavedObjectsUpdateObjectsSpacesObject[], spacesToAdd: string[], spacesToRemove: string[], options?: SavedObjectsUpdateObjectsSpacesOptions): Promise; - } + updateObjectsSpaces(objects: SavedObjectsUpdateObjectsSpacesObject[], spacesToAdd: string[], spacesToRemove: string[], options?: SavedObjectsUpdateObjectsSpacesOptions): Promise; +} // @public export interface SavedObjectsRepositoryFactory { @@ -2705,7 +2705,7 @@ export class SavedObjectsSerializer { isRawSavedObject(doc: SavedObjectsRawDoc, options?: SavedObjectsRawDocParseOptions): boolean; rawToSavedObject(doc: SavedObjectsRawDoc, options?: SavedObjectsRawDocParseOptions): SavedObjectSanitizedDoc; savedObjectToRaw(savedObj: SavedObjectSanitizedDoc): SavedObjectsRawDoc; - } +} // @public export interface SavedObjectsServiceSetup { @@ -2851,7 +2851,7 @@ export class SavedObjectTypeRegistry { isShareable(type: string): boolean; isSingleNamespace(type: string): boolean; registerType(type: SavedObjectsType): void; - } +} // @public export type SavedObjectUnsanitizedDoc = SavedObjectDoc & Partial; @@ -3053,7 +3053,6 @@ export interface UserProvidedValues { // @public export const validBodyOutput: readonly ["data", "stream"]; - // Warnings were encountered during analysis: // // src/core/server/elasticsearch/client/types.ts:93:7 - (ae-forgotten-export) The symbol "Explanation" needs to be exported by the entry point index.d.ts diff --git a/src/dev/notice/bundled_notices.js b/src/dev/notice/bundled_notices.js index 7ab2a5b3f03feb..00b044e9053f7f 100644 --- a/src/dev/notice/bundled_notices.js +++ b/src/dev/notice/bundled_notices.js @@ -7,18 +7,20 @@ */ import { resolve } from 'path'; -import { readFile } from 'fs'; +import { readFile } from 'fs/promises'; +import { promisify } from 'util'; -import { fromNode as fcb } from 'bluebird'; import glob from 'glob'; +const globAsync = promisify(glob); + export async function getBundledNotices(packageDirectory) { const pattern = resolve(packageDirectory, '*{LICENSE,NOTICE}*'); - const paths = await fcb((cb) => glob(pattern, cb)); + const paths = await globAsync(pattern); return Promise.all( paths.map(async (path) => ({ path, - text: await fcb((cb) => readFile(path, 'utf8', cb)), + text: await readFile(path, 'utf8'), })) ); } diff --git a/src/dev/precommit_hook/get_files_for_commit.js b/src/dev/precommit_hook/get_files_for_commit.js index 44c8c9d5e6bc0b..366575ad15ae7c 100644 --- a/src/dev/precommit_hook/get_files_for_commit.js +++ b/src/dev/precommit_hook/get_files_for_commit.js @@ -6,8 +6,7 @@ * Side Public License, v 1. */ -import SimpleGit from 'simple-git'; -import { fromNode as fcb } from 'bluebird'; +import SimpleGit from 'simple-git/promise'; import { REPO_ROOT } from '@kbn/utils'; import { File } from '../file'; @@ -22,7 +21,7 @@ import { File } from '../file'; export async function getFilesForCommit(gitRef) { const simpleGit = new SimpleGit(REPO_ROOT); const gitRefForDiff = gitRef ? gitRef : '--cached'; - const output = await fcb((cb) => simpleGit.diff(['--name-status', gitRefForDiff], cb)); + const output = await simpleGit.diff(['--name-status', gitRefForDiff]); return ( output diff --git a/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx index 1f4cd3952e7a5a..611a426dd4d716 100644 --- a/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx +++ b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { Subscription } from 'rxjs'; -import { PanelState, ViewMode } from '../../../services/embeddable'; +import { ViewMode } from '../../../services/embeddable'; import { DashboardContainer, DashboardReactContextValue } from '../dashboard_container'; import { DashboardGrid } from '../grid'; import { context } from '../../../services/kibana_react'; @@ -26,7 +26,7 @@ interface State { useMargins: boolean; title: string; description?: string; - panels: { [key: string]: PanelState }; + panelCount: number; isEmbeddedExternally?: boolean; } @@ -48,7 +48,7 @@ export class DashboardViewport extends React.Component { - const { isFullScreenMode, useMargins, title, description, isEmbeddedExternally } = + const { isFullScreenMode, useMargins, title, description, isEmbeddedExternally, panels } = this.props.container.getInput(); if (this.mounted) { this.setState({ + panelCount: Object.values(panels).length, + isEmbeddedExternally, isFullScreenMode, description, useMargins, title, - isEmbeddedExternally, }); } }); @@ -94,13 +95,13 @@ export class DashboardViewport extends React.Component
{ - if (nextUrl.includes(DASHBOARD_STATE_STORAGE_KEY)) { - return replaceUrlHashQuery(nextUrl, (query) => { - delete query[DASHBOARD_STATE_STORAGE_KEY]; - return query; - }); - } - return nextUrl; - }, true); + if (!awaitingRemoval) { + awaitingRemoval = true; + kbnUrlStateStorage.kbnUrlControls.updateAsync((nextUrl) => { + if (nextUrl.includes(DASHBOARD_STATE_STORAGE_KEY)) { + return replaceUrlHashQuery(nextUrl, (query) => { + delete query[DASHBOARD_STATE_STORAGE_KEY]; + return query; + }); + } + awaitingRemoval = false; + return nextUrl; + }, true); + } return { ..._.omit(rawAppStateInUrl, ['panels', 'query']), diff --git a/src/plugins/data/common/search/search_source/mocks.ts b/src/plugins/data/common/search/search_source/mocks.ts index a0897a2dacf2a2..dee5c09a6b8584 100644 --- a/src/plugins/data/common/search/search_source/mocks.ts +++ b/src/plugins/data/common/search/search_source/mocks.ts @@ -14,7 +14,7 @@ import { SearchSource } from './search_source'; import { ISearchStartSearchSource, ISearchSource, SearchSourceFields } from './types'; export const searchSourceInstanceMock: MockedKeys = { - setPreferredSearchStrategyId: jest.fn(), + setOverwriteDataViewType: jest.fn(), setFields: jest.fn().mockReturnThis(), setField: jest.fn().mockReturnThis(), removeField: jest.fn().mockReturnThis(), diff --git a/src/plugins/data/common/search/search_source/search_source.ts b/src/plugins/data/common/search/search_source/search_source.ts index 50752523403cf5..a3979ffa6e9432 100644 --- a/src/plugins/data/common/search/search_source/search_source.ts +++ b/src/plugins/data/common/search/search_source/search_source.ts @@ -124,7 +124,8 @@ export interface SearchSourceDependencies extends FetchHandlers { /** @public **/ export class SearchSource { private id: string = uniqueId('data_source'); - private searchStrategyId?: string; + private shouldOverwriteDataViewType: boolean = false; + private overwriteDataViewType?: string; private parent?: SearchSource; private requestStartHandlers: Array< (searchSource: SearchSource, options?: ISearchOptions) => Promise @@ -149,11 +150,22 @@ export class SearchSource { *****/ /** - * internal, dont use - * @param searchStrategyId + * Used to make the search source overwrite the actual data view type for the + * specific requests done. This should only be needed very rarely, since it means + * e.g. we'd be treating a rollup index pattern as a regular one. Be very sure + * you understand the consequences of using this method before using it. + * + * @param overwriteType If `false` is passed in it will disable the overwrite, otherwise + * the passed in value will be used as the data view type for this search source. */ - setPreferredSearchStrategyId(searchStrategyId: string) { - this.searchStrategyId = searchStrategyId; + setOverwriteDataViewType(overwriteType: string | undefined | false) { + if (overwriteType === false) { + this.shouldOverwriteDataViewType = false; + this.overwriteDataViewType = undefined; + } else { + this.shouldOverwriteDataViewType = true; + this.overwriteDataViewType = overwriteType; + } } /** @@ -609,11 +621,7 @@ export class SearchSource { } private getIndexType(index?: IIndexPattern) { - if (this.searchStrategyId) { - return this.searchStrategyId === 'default' ? undefined : this.searchStrategyId; - } else { - return index?.type; - } + return this.shouldOverwriteDataViewType ? this.overwriteDataViewType : index?.type; } private readonly getFieldName = (fld: string | Record): string => diff --git a/src/plugins/discover/public/application/main/components/chart/discover_chart.test.tsx b/src/plugins/discover/public/application/main/components/chart/discover_chart.test.tsx index cb6d96f049c51c..673d831f3fc96e 100644 --- a/src/plugins/discover/public/application/main/components/chart/discover_chart.test.tsx +++ b/src/plugins/discover/public/application/main/components/chart/discover_chart.test.tsx @@ -23,7 +23,7 @@ import { VIEW_MODE } from '../../../../components/view_mode_toggle'; setHeaderActionMenuMounter(jest.fn()); -function getProps(timefield?: string) { +function getProps(isTimeBased: boolean = false) { const searchSourceMock = createSearchSourceMock({}); const services = discoverServiceMock; services.data.query.timefilter.timefilter.getAbsoluteTime = () => { @@ -85,6 +85,7 @@ function getProps(timefield?: string) { }) as DataCharts$; return { + isTimeBased, resetSavedSearch: jest.fn(), savedSearch: savedSearchMock, savedSearchDataChart$: charts$, @@ -94,7 +95,6 @@ function getProps(timefield?: string) { services, state: { columns: [] }, stateContainer: {} as GetStateReturn, - timefield, viewMode: VIEW_MODE.DOCUMENT_LEVEL, setDiscoverViewMode: jest.fn(), }; @@ -106,7 +106,7 @@ describe('Discover chart', () => { expect(component.find('[data-test-subj="discoverChartOptionsToggle"]').exists()).toBeFalsy(); }); test('render with filefield', () => { - const component = mountWithIntl(); + const component = mountWithIntl(); expect(component.find('[data-test-subj="discoverChartOptionsToggle"]').exists()).toBeTruthy(); }); }); diff --git a/src/plugins/discover/public/application/main/components/chart/discover_chart.tsx b/src/plugins/discover/public/application/main/components/chart/discover_chart.tsx index 1c382dbdf6b5a7..abda176ab7b760 100644 --- a/src/plugins/discover/public/application/main/components/chart/discover_chart.tsx +++ b/src/plugins/discover/public/application/main/components/chart/discover_chart.tsx @@ -37,7 +37,7 @@ export function DiscoverChart({ services, state, stateContainer, - timefield, + isTimeBased, viewMode, setDiscoverViewMode, }: { @@ -48,7 +48,7 @@ export function DiscoverChart({ services: DiscoverServices; state: AppState; stateContainer: GetStateReturn; - timefield?: string; + isTimeBased: boolean; viewMode: VIEW_MODE; setDiscoverViewMode: (viewMode: VIEW_MODE) => void; }) { @@ -123,7 +123,7 @@ export function DiscoverChart({ /> )} - {timefield && ( + {isTimeBased && ( - {timefield && !state.hideChart && ( + {isTimeBased && !state.hideChart && (
(chartRef.current.element = element)} diff --git a/src/plugins/discover/public/application/main/components/layout/discover_layout.tsx b/src/plugins/discover/public/application/main/components/layout/discover_layout.tsx index d9d0c2f064bdc5..d71e99fd2b9a88 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_layout.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_layout.tsx @@ -49,6 +49,7 @@ import { DOCUMENTS_VIEW_CLICK, FIELD_STATISTICS_VIEW_CLICK, } from '../../../components/field_stats_table/constants'; +import { DataViewType } from '../../../../../../data_views/common'; /** * Local storage key for sidebar persistence state @@ -122,8 +123,12 @@ export function DiscoverLayout({ useSavedSearchAliasMatchRedirect({ savedSearch, spaces, history }); - const timeField = useMemo(() => { - return indexPattern.type !== 'rollup' ? indexPattern.timeFieldName : undefined; + // We treat rollup v1 data views as non time based in Discover, since we query them + // in a non time based way using the regular _search API, since the internal + // representation of those documents does not have the time field that _field_caps + // reports us. + const isTimeBased = useMemo(() => { + return indexPattern.type !== DataViewType.ROLLUP && indexPattern.isTimeBased(); }, [indexPattern]); const initialSidebarClosed = Boolean(storage.get(SIDEBAR_CLOSED_KEY)); @@ -276,7 +281,7 @@ export function DiscoverLayout({ > {resultState === 'none' && ( diff --git a/src/plugins/discover/public/application/main/components/no_results/no_results.test.tsx b/src/plugins/discover/public/application/main/components/no_results/no_results.test.tsx index 1f6a2235b916f8..ef63e178ecefc7 100644 --- a/src/plugins/discover/public/application/main/components/no_results/no_results.test.tsx +++ b/src/plugins/discover/public/application/main/components/no_results/no_results.test.tsx @@ -62,7 +62,7 @@ describe('DiscoverNoResults', () => { describe('timeFieldName', () => { test('renders time range feedback', () => { const result = mountAndFindSubjects({ - timeFieldName: 'awesome_time_field', + isTimeBased: true, }); expect(result).toMatchInlineSnapshot(` Object { @@ -94,7 +94,7 @@ describe('DiscoverNoResults', () => { test('renders error message', () => { const error = new Error('Fatal error'); const result = mountAndFindSubjects({ - timeFieldName: 'awesome_time_field', + isTimeBased: true, error, }); expect(result).toMatchInlineSnapshot(` diff --git a/src/plugins/discover/public/application/main/components/no_results/no_results.tsx b/src/plugins/discover/public/application/main/components/no_results/no_results.tsx index 38dce654f0daa4..558760f9c0035c 100644 --- a/src/plugins/discover/public/application/main/components/no_results/no_results.tsx +++ b/src/plugins/discover/public/application/main/components/no_results/no_results.tsx @@ -22,7 +22,7 @@ import './_no_results.scss'; import { NoResultsIllustration } from './assets/no_results_illustration'; export interface DiscoverNoResultsProps { - timeFieldName?: string; + isTimeBased?: boolean; error?: Error; data?: DataPublicPluginStart; hasQuery?: boolean; @@ -31,7 +31,7 @@ export interface DiscoverNoResultsProps { } export function DiscoverNoResults({ - timeFieldName, + isTimeBased, error, data, hasFilters, @@ -54,7 +54,7 @@ export function DiscoverNoResults({ - {!!timeFieldName && getTimeFieldMessage()} + {isTimeBased && getTimeFieldMessage()} {(hasFilters || hasQuery) && ( { const history = useHistory(); - const showDatePicker = useMemo(() => indexPattern.isTimeBased(), [indexPattern]); + const showDatePicker = useMemo( + () => indexPattern.isTimeBased() && indexPattern.type !== DataViewType.ROLLUP, + [indexPattern] + ); const { TopNavMenu } = services.navigation.ui; const onOpenSavedSearch = useCallback( diff --git a/src/plugins/discover/public/application/main/utils/fetch_all.ts b/src/plugins/discover/public/application/main/utils/fetch_all.ts index efaa349181fb64..471616c9d4261c 100644 --- a/src/plugins/discover/public/application/main/utils/fetch_all.ts +++ b/src/plugins/discover/public/application/main/utils/fetch_all.ts @@ -26,6 +26,7 @@ import { DataPublicPluginStart } from '../../../../../data/public'; import { SavedSearchData } from './use_saved_search'; import { DiscoverServices } from '../../../build_services'; import { ReduxLikeStateContainer } from '../../../../../kibana_utils/common'; +import { DataViewType } from '../../../../../data_views/common'; export function fetchAll( dataSubjects: SavedSearchData, @@ -72,16 +73,17 @@ export function fetchAll( }, }; + const isChartVisible = + !hideChart && indexPattern.isTimeBased() && indexPattern.type !== DataViewType.ROLLUP; + const all = forkJoin({ documents: fetchDocuments(dataSubjects, searchSource.createCopy(), subFetchDeps), - totalHits: - hideChart || !indexPattern.timeFieldName - ? fetchTotalHits(dataSubjects, searchSource.createCopy(), subFetchDeps) - : of(null), - chart: - !hideChart && indexPattern.timeFieldName - ? fetchChart(dataSubjects, searchSource.createCopy(), subFetchDeps) - : of(null), + totalHits: !isChartVisible + ? fetchTotalHits(dataSubjects, searchSource.createCopy(), subFetchDeps) + : of(null), + chart: isChartVisible + ? fetchChart(dataSubjects, searchSource.createCopy(), subFetchDeps) + : of(null), }); all.subscribe( diff --git a/src/plugins/discover/public/application/main/utils/fetch_documents.ts b/src/plugins/discover/public/application/main/utils/fetch_documents.ts index 0c80aee3f909d8..b23dd3a0ed9323 100644 --- a/src/plugins/discover/public/application/main/utils/fetch_documents.ts +++ b/src/plugins/discover/public/application/main/utils/fetch_documents.ts @@ -38,6 +38,13 @@ export const fetchDocuments = ( searchSource.setField('trackTotalHits', false); searchSource.setField('highlightAll', true); searchSource.setField('version', true); + if (searchSource.getField('index')?.type === 'rollup') { + // We treat that index pattern as "normal" even if it was a rollup index pattern, + // since the rollup endpoint does not support querying individual documents, but we + // can get them from the regular _search API that will be used if the index pattern + // not a rollup index pattern. + searchSource.setOverwriteDataViewType(undefined); + } sendLoadingMsg(documents$); diff --git a/src/plugins/discover/public/application/main/utils/fetch_total_hits.ts b/src/plugins/discover/public/application/main/utils/fetch_total_hits.ts index b80dfa9b31e7e1..197e00ce0449f5 100644 --- a/src/plugins/discover/public/application/main/utils/fetch_total_hits.ts +++ b/src/plugins/discover/public/application/main/utils/fetch_total_hits.ts @@ -13,6 +13,7 @@ import { isCompleteResponse, ISearchSource, } from '../../../../../data/public'; +import { DataViewType } from '../../../../../data_views/common'; import { Adapters } from '../../../../../inspector/common'; import { FetchStatus } from '../../types'; import { SavedSearchData } from './use_saved_search'; @@ -36,13 +37,18 @@ export function fetchTotalHits( } ) { const { totalHits$ } = data$; - const indexPattern = searchSource.getField('index'); searchSource.setField('trackTotalHits', true); - searchSource.setField('filter', data.query.timefilter.timefilter.createFilter(indexPattern!)); searchSource.setField('size', 0); searchSource.removeField('sort'); searchSource.removeField('fields'); searchSource.removeField('aggs'); + if (searchSource.getField('index')?.type === DataViewType.ROLLUP) { + // We treat that index pattern as "normal" even if it was a rollup index pattern, + // since the rollup endpoint does not support querying individual documents, but we + // can get them from the regular _search API that will be used if the index pattern + // not a rollup index pattern. + searchSource.setOverwriteDataViewType(undefined); + } sendLoadingMsg(totalHits$); diff --git a/src/plugins/discover/public/application/main/utils/update_search_source.ts b/src/plugins/discover/public/application/main/utils/update_search_source.ts index a08f180f1816cb..1ee15790077cc6 100644 --- a/src/plugins/discover/public/application/main/utils/update_search_source.ts +++ b/src/plugins/discover/public/application/main/utils/update_search_source.ts @@ -8,6 +8,7 @@ import { SORT_DEFAULT_ORDER_SETTING } from '../../../../common'; import { IndexPattern, ISearchSource } from '../../../../../data/common'; +import { DataViewType } from '../../../../../data_views/common'; import type { SortOrder } from '../../../services/saved_searches'; import { DiscoverServices } from '../../../build_services'; import { getSortForSearchSource } from '../../../components/doc_table'; @@ -44,14 +45,9 @@ export function updateSearchSource( indexPattern, uiSettings.get(SORT_DEFAULT_ORDER_SETTING) ); - searchSource - .setField('trackTotalHits', true) - .setField('sort', usedSort) - // Even when searching rollups, we want to use the default strategy so that we get back a - // document-like response. - .setPreferredSearchStrategyId('default'); + searchSource.setField('trackTotalHits', true).setField('sort', usedSort); - if (indexPattern.type !== 'rollup') { + if (indexPattern.type !== DataViewType.ROLLUP) { // Set the date range filter fields from timeFilter using the absolute format. Search sessions requires that it be converted from a relative range searchSource.setField('filter', data.query.timefilter.timefilter.createFilter(indexPattern)); } diff --git a/src/plugins/discover/public/services/saved_searches/get_saved_searches.test.ts b/src/plugins/discover/public/services/saved_searches/get_saved_searches.test.ts index 1ac5f2d9653aaa..1159320c9a09f4 100644 --- a/src/plugins/discover/public/services/saved_searches/get_saved_searches.test.ts +++ b/src/plugins/discover/public/services/saved_searches/get_saved_searches.test.ts @@ -124,8 +124,8 @@ describe('getSavedSearch', () => { "serialize": [MockFunction], "setField": [MockFunction], "setFields": [MockFunction], + "setOverwriteDataViewType": [MockFunction], "setParent": [MockFunction], - "setPreferredSearchStrategyId": [MockFunction], }, "sharingSavedObjectProps": Object { "aliasTargetId": undefined, diff --git a/src/plugins/discover/public/services/saved_searches/saved_searches_utils.test.ts b/src/plugins/discover/public/services/saved_searches/saved_searches_utils.test.ts index 3d7d053bd1ec52..f2ad8b92adbc80 100644 --- a/src/plugins/discover/public/services/saved_searches/saved_searches_utils.test.ts +++ b/src/plugins/discover/public/services/saved_searches/saved_searches_utils.test.ts @@ -68,9 +68,10 @@ describe('saved_searches_utils', () => { "history": Array [], "id": "data_source1", "inheritOptions": Object {}, + "overwriteDataViewType": undefined, "parent": undefined, "requestStartHandlers": Array [], - "searchStrategyId": undefined, + "shouldOverwriteDataViewType": false, }, "sharingSavedObjectProps": Object {}, "sort": Array [], diff --git a/src/plugins/kibana_react/public/code_editor/languages/constants.ts b/src/plugins/kibana_react/public/code_editor/languages/constants.ts index af80e4ccc56e22..510cc91cf5e76c 100644 --- a/src/plugins/kibana_react/public/code_editor/languages/constants.ts +++ b/src/plugins/kibana_react/public/code_editor/languages/constants.ts @@ -10,3 +10,4 @@ export { LANG as CssLang } from './css/constants'; export { LANG as MarkdownLang } from './markdown/constants'; export { LANG as YamlLang } from './yaml/constants'; export { LANG as HandlebarsLang } from './handlebars/constants'; +export { LANG as HJsonLang } from './hjson/constants'; diff --git a/src/plugins/kibana_react/public/code_editor/languages/hjson/constants.ts b/src/plugins/kibana_react/public/code_editor/languages/hjson/constants.ts new file mode 100644 index 00000000000000..61e851e0b6f583 --- /dev/null +++ b/src/plugins/kibana_react/public/code_editor/languages/hjson/constants.ts @@ -0,0 +1,9 @@ +/* + * 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 LANG = 'hjson'; diff --git a/src/plugins/kibana_react/public/code_editor/languages/hjson/index.ts b/src/plugins/kibana_react/public/code_editor/languages/hjson/index.ts new file mode 100644 index 00000000000000..ff3c08267da9bb --- /dev/null +++ b/src/plugins/kibana_react/public/code_editor/languages/hjson/index.ts @@ -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. + */ + +import { LangModuleType } from '@kbn/monaco'; +import { languageConfiguration, lexerRules } from './language'; +import { LANG } from './constants'; + +export const Lang: LangModuleType = { ID: LANG, languageConfiguration, lexerRules }; diff --git a/src/plugins/kibana_react/public/code_editor/languages/hjson/language.ts b/src/plugins/kibana_react/public/code_editor/languages/hjson/language.ts new file mode 100644 index 00000000000000..d93cdfe4c4a22b --- /dev/null +++ b/src/plugins/kibana_react/public/code_editor/languages/hjson/language.ts @@ -0,0 +1,90 @@ +/* + * 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 { monaco } from '@kbn/monaco'; + +export const languageConfiguration: monaco.languages.LanguageConfiguration = { + brackets: [ + ['{', '}'], + ['[', ']'], + ], + autoClosingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '"', close: '"', notIn: ['string'] }, + ], + comments: { + lineComment: '//', + blockComment: ['/*', '*/'], + }, +}; + +export const lexerRules: monaco.languages.IMonarchLanguage = { + defaultToken: '', + tokenPostfix: '', + escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/, + digits: /-?(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:[eE][+-]?\d+)?)?/, + symbols: /[,:]+/, + tokenizer: { + root: [ + [/(@digits)n?/, 'number'], + [/(@symbols)n?/, 'delimiter'], + + { include: '@keyword' }, + { include: '@url' }, + { include: '@whitespace' }, + { include: '@brackets' }, + { include: '@keyName' }, + { include: '@string' }, + ], + + keyword: [[/(?:true|false|null)\b/, 'keyword']], + + url: [ + [ + /(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/, + 'string', + ], + ], + + keyName: [[/(?:[^,\{\[\}\]\s]+|"(?:[^"\\]|\\.)*")\s*(?=:)/, 'variable']], + + brackets: [[/{/, '@push'], [/}/, '@pop'], [/[[(]/], [/[\])]/]], + + whitespace: [ + [/[ \t\r\n]+/, ''], + [/\/\*/, 'comment', '@comment'], + [/\/\/.*$/, 'comment'], + ], + + comment: [ + [/[^\/*]+/, 'comment'], + [/\*\//, 'comment', '@pop'], + [/[\/*]/, 'comment'], + ], + + string: [ + [/(?:[^,\{\[\}\]\s]+|"(?:[^"\\]|\\.)*")\s*/, 'string'], + [/"""/, 'string', '@stringLiteral'], + [/"/, 'string', '@stringDouble'], + ], + + stringDouble: [ + [/[^\\"]+/, 'string'], + [/@escapes/, 'string.escape'], + [/\\./, 'string.escape.invalid'], + [/"/, 'string', '@pop'], + ], + + stringLiteral: [ + [/"""/, 'string', '@pop'], + [/\\""""/, 'string', '@pop'], + [/./, 'string'], + ], + }, +} as monaco.languages.IMonarchLanguage; diff --git a/src/plugins/kibana_react/public/code_editor/languages/index.ts b/src/plugins/kibana_react/public/code_editor/languages/index.ts index b797ea44d1f919..f862997fdc2e3c 100644 --- a/src/plugins/kibana_react/public/code_editor/languages/index.ts +++ b/src/plugins/kibana_react/public/code_editor/languages/index.ts @@ -10,5 +10,6 @@ import { Lang as CssLang } from './css'; import { Lang as HandlebarsLang } from './handlebars'; import { Lang as MarkdownLang } from './markdown'; import { Lang as YamlLang } from './yaml'; +import { Lang as HJson } from './hjson'; -export { CssLang, HandlebarsLang, MarkdownLang, YamlLang }; +export { CssLang, HandlebarsLang, MarkdownLang, YamlLang, HJson }; diff --git a/src/plugins/kibana_react/public/code_editor/register_languages.ts b/src/plugins/kibana_react/public/code_editor/register_languages.ts index a32318a7e4b20f..62eccdabb5d98e 100644 --- a/src/plugins/kibana_react/public/code_editor/register_languages.ts +++ b/src/plugins/kibana_react/public/code_editor/register_languages.ts @@ -6,9 +6,10 @@ * Side Public License, v 1. */ import { registerLanguage } from '@kbn/monaco'; -import { CssLang, HandlebarsLang, MarkdownLang, YamlLang } from './languages'; +import { CssLang, HandlebarsLang, MarkdownLang, YamlLang, HJson } from './languages'; registerLanguage(CssLang); registerLanguage(HandlebarsLang); registerLanguage(MarkdownLang); registerLanguage(YamlLang); +registerLanguage(HJson); diff --git a/src/plugins/saved_objects/public/saved_object/saved_object.test.ts b/src/plugins/saved_objects/public/saved_object/saved_object.test.ts index bd8d69d6b693eb..01fc75df459bcc 100644 --- a/src/plugins/saved_objects/public/saved_object/saved_object.test.ts +++ b/src/plugins/saved_objects/public/saved_object/saved_object.test.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import Bluebird from 'bluebird'; import { createSavedObjectClass } from './saved_object'; import { SavedObject, @@ -55,16 +54,16 @@ describe('Saved Object', () => { */ function stubESResponse(mockDocResponse: SimpleSavedObject) { // Stub out search for duplicate title: - savedObjectsClientStub.get = jest.fn().mockReturnValue(Bluebird.resolve(mockDocResponse)); - savedObjectsClientStub.update = jest.fn().mockReturnValue(Bluebird.resolve(mockDocResponse)); + savedObjectsClientStub.get = jest.fn().mockReturnValue(Promise.resolve(mockDocResponse)); + savedObjectsClientStub.update = jest.fn().mockReturnValue(Promise.resolve(mockDocResponse)); savedObjectsClientStub.find = jest .fn() - .mockReturnValue(Bluebird.resolve({ savedObjects: [], total: 0 })); + .mockReturnValue(Promise.resolve({ savedObjects: [], total: 0 })); savedObjectsClientStub.bulkGet = jest .fn() - .mockReturnValue(Bluebird.resolve({ savedObjects: [mockDocResponse] })); + .mockReturnValue(Promise.resolve({ savedObjects: [mockDocResponse] })); } function stubSavedObjectsClientCreate( @@ -73,7 +72,7 @@ describe('Saved Object', () => { ) { savedObjectsClientStub.create = jest .fn() - .mockReturnValue(resolve ? Bluebird.resolve(resp) : Bluebird.reject(resp)); + .mockReturnValue(resolve ? Promise.resolve(resp) : Promise.reject(resp)); } /** @@ -262,7 +261,7 @@ describe('Saved Object', () => { return createInitializedSavedObject({ type: 'dashboard', id: myId }).then((savedObject) => { savedObjectsClientStub.create = jest.fn().mockImplementation(() => { expect(savedObject.id).toBe(myId); - return Bluebird.resolve({ id: myId }); + return Promise.resolve({ id: myId }); }); savedObject.copyOnSave = false; @@ -296,7 +295,7 @@ describe('Saved Object', () => { return createInitializedSavedObject({ type: 'dashboard', id }).then((savedObject) => { savedObjectsClientStub.create = jest.fn().mockImplementation(() => { expect(savedObject.isSaving).toBe(true); - return Bluebird.resolve({ + return Promise.resolve({ type: 'dashboard', id, _version: 'foo', @@ -315,7 +314,7 @@ describe('Saved Object', () => { return createInitializedSavedObject({ type: 'dashboard' }).then((savedObject) => { savedObjectsClientStub.create = jest.fn().mockImplementation(() => { expect(savedObject.isSaving).toBe(true); - return Bluebird.reject(''); + return Promise.reject(''); }); expect(savedObject.isSaving).toBe(false); @@ -745,7 +744,7 @@ describe('Saved Object', () => { }, }); savedObject.searchSource!.setField('index', indexPattern); - return Bluebird.resolve(indexPattern); + return Promise.resolve(indexPattern); }); expect(!!savedObject.searchSource!.getField('index')).toBe(false); diff --git a/src/plugins/vis_type_markdown/server/index.ts b/src/plugins/vis_type_markdown/server/index.ts index d9665a0902317d..cc1c995a185f9e 100644 --- a/src/plugins/vis_type_markdown/server/index.ts +++ b/src/plugins/vis_type_markdown/server/index.ts @@ -13,7 +13,7 @@ import { configSchema, ConfigSchema } from '../config'; export const config: PluginConfigDescriptor = { schema: configSchema, deprecations: ({ renameFromRoot }) => [ - renameFromRoot('markdown_vis.enabled', 'vis_type_markdown.enabled'), + renameFromRoot('markdown_vis.enabled', 'vis_type_markdown.enabled', { level: 'warning' }), ], }; diff --git a/src/plugins/vis_types/timelion/server/handlers/chain_runner.js b/src/plugins/vis_types/timelion/server/handlers/chain_runner.js index 3710d015f3f694..fac1a68acc9076 100644 --- a/src/plugins/vis_types/timelion/server/handlers/chain_runner.js +++ b/src/plugins/vis_types/timelion/server/handlers/chain_runner.js @@ -7,7 +7,6 @@ */ import _ from 'lodash'; -import Bluebird from 'bluebird'; import { i18n } from '@kbn/i18n'; import moment from 'moment'; @@ -42,7 +41,7 @@ export default function chainRunner(tlConfig) { function resolveArgument(item) { if (Array.isArray(item)) { - return Bluebird.all(_.map(item, resolveArgument)); + return Promise.all(_.map(item, resolveArgument)); } if (_.isObject(item)) { @@ -51,7 +50,7 @@ export default function chainRunner(tlConfig) { const itemFunctionDef = tlConfig.getFunction(item.function); if (itemFunctionDef.cacheKey && queryCache[itemFunctionDef.cacheKey(item)]) { stats.queryCount++; - return Bluebird.resolve(_.cloneDeep(queryCache[itemFunctionDef.cacheKey(item)])); + return Promise.resolve(_.cloneDeep(queryCache[itemFunctionDef.cacheKey(item)])); } return invoke(item.function, item.arguments); } @@ -94,7 +93,7 @@ export default function chainRunner(tlConfig) { args = _.map(args, resolveArgument); - return Bluebird.all(args).then(function (args) { + return Promise.all(args).then(function (args) { args.byName = indexArguments(functionDef, args); return functionDef.fn(args, tlConfig); }); @@ -128,7 +127,7 @@ export default function chainRunner(tlConfig) { return args; }); }); - return Bluebird.all(seriesList).then(function (args) { + return Promise.all(seriesList).then(function (args) { const list = _.chain(args).map('list').flatten().value(); const seriesList = _.merge.apply(this, _.flatten([{}, args])); seriesList.list = list; @@ -158,22 +157,22 @@ export default function chainRunner(tlConfig) { }) .value(); - return Bluebird.settle(promises).then(function (resolvedDatasources) { + return Promise.allSettled(promises).then(function (resolvedDatasources) { stats.queryTime = new Date().getTime(); _.each(queries, function (query, i) { const functionDef = tlConfig.getFunction(query.function); const resolvedDatasource = resolvedDatasources[i]; - if (resolvedDatasource.isRejected()) { - if (resolvedDatasource.reason().isBoom) { - throw resolvedDatasource.reason(); + if (resolvedDatasource.status === 'rejected') { + if (resolvedDatasource.reason.isBoom) { + throw resolvedDatasource.reason; } else { - throwWithCell(query.cell, resolvedDatasource.reason()); + throwWithCell(query.cell, resolvedDatasource.reason); } } - queryCache[functionDef.cacheKey(query)] = resolvedDatasource.value(); + queryCache[functionDef.cacheKey(query)] = resolvedDatasource.value; }); stats.cacheCount = _.keys(queryCache).length; diff --git a/src/plugins/vis_types/timelion/server/lib/alter.js b/src/plugins/vis_types/timelion/server/lib/alter.js index 2e234f3405c217..47a57f213cdbb3 100644 --- a/src/plugins/vis_types/timelion/server/lib/alter.js +++ b/src/plugins/vis_types/timelion/server/lib/alter.js @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import Bluebird from 'bluebird'; import _ from 'lodash'; /* @param {Array} args @@ -18,7 +17,7 @@ import _ from 'lodash'; export default function alter(args, fn) { // In theory none of the args should ever be promises. This is probably a waste. - return Bluebird.all(args) + return Promise.all(args) .then(function (args) { const seriesList = args.shift(); diff --git a/src/plugins/vis_types/timelion/server/routes/run.ts b/src/plugins/vis_types/timelion/server/routes/run.ts index b8c0ce4ea65998..d615302253a1d1 100644 --- a/src/plugins/vis_types/timelion/server/routes/run.ts +++ b/src/plugins/vis_types/timelion/server/routes/run.ts @@ -8,7 +8,6 @@ import { IRouter, Logger, CoreSetup } from 'kibana/server'; import { schema } from '@kbn/config-schema'; -import Bluebird from 'bluebird'; import _ from 'lodash'; // @ts-ignore import chainRunnerFn from '../handlers/chain_runner.js'; @@ -96,7 +95,7 @@ export function runRoute( }); try { const chainRunner = chainRunnerFn(tlConfig); - const sheet = await Bluebird.all(chainRunner.processRequest(request.body)); + const sheet = await Promise.all(await chainRunner.processRequest(request.body)); return response.ok({ body: { sheet, diff --git a/src/plugins/vis_types/timelion/server/series_functions/quandl.js b/src/plugins/vis_types/timelion/server/series_functions/quandl.js index 7e3a0f6de9aba2..3c209879d7a4cb 100644 --- a/src/plugins/vis_types/timelion/server/series_functions/quandl.js +++ b/src/plugins/vis_types/timelion/server/series_functions/quandl.js @@ -10,7 +10,6 @@ import { i18n } from '@kbn/i18n'; import _ from 'lodash'; import fetch from 'node-fetch'; import moment from 'moment'; -fetch.Promise = require('bluebird'); import Datasource from '../lib/classes/datasource'; diff --git a/src/plugins/vis_types/timelion/server/series_functions/static.js b/src/plugins/vis_types/timelion/server/series_functions/static.js index b5e8dd6df66824..afc1bd5afbbb87 100644 --- a/src/plugins/vis_types/timelion/server/series_functions/static.js +++ b/src/plugins/vis_types/timelion/server/series_functions/static.js @@ -9,7 +9,6 @@ import { i18n } from '@kbn/i18n'; import _ from 'lodash'; import Datasource from '../lib/classes/datasource'; -import Bluebird from 'bluebird'; export default new Datasource('static', { aliases: ['value'], @@ -51,7 +50,7 @@ export default new Datasource('static', { }); } - return Bluebird.resolve({ + return Promise.resolve({ type: 'seriesList', list: [ { diff --git a/src/plugins/vis_types/timelion/server/series_functions/worldbank_indicators.js b/src/plugins/vis_types/timelion/server/series_functions/worldbank_indicators.js index ba28a823455225..c2eb07890a1029 100644 --- a/src/plugins/vis_types/timelion/server/series_functions/worldbank_indicators.js +++ b/src/plugins/vis_types/timelion/server/series_functions/worldbank_indicators.js @@ -9,7 +9,6 @@ import { i18n } from '@kbn/i18n'; import _ from 'lodash'; import worldbank from './worldbank.js'; -import Bluebird from 'bluebird'; import Datasource from '../lib/classes/datasource'; export default new Datasource('worldbank_indicators', { @@ -61,9 +60,11 @@ export default new Datasource('worldbank_indicators', { return worldbank.timelionFn(wbArgs, tlConfig); }); - return Bluebird.map(seriesLists, function (seriesList) { - return seriesList.list[0]; - }).then(function (list) { + return Promise.all( + seriesLists.map(function (seriesList) { + return seriesList.list[0]; + }) + ).then(function (list) { return { type: 'seriesList', list: list, diff --git a/src/plugins/vis_types/timelion/server/series_functions/yaxis.test.js b/src/plugins/vis_types/timelion/server/series_functions/yaxis.test.js index 6d627832544de4..d68aa7ac701174 100644 --- a/src/plugins/vis_types/timelion/server/series_functions/yaxis.test.js +++ b/src/plugins/vis_types/timelion/server/series_functions/yaxis.test.js @@ -7,7 +7,6 @@ */ import fn from './yaxis'; -import Bluebird from 'bluebird'; const expect = require('chai').expect; import invoke from './helpers/invoke_series_fn.js'; @@ -25,7 +24,7 @@ describe('yaxis.js', () => { }); it('puts odd numbers of the left, even on the right, by default', () => { - return Bluebird.all([ + return Promise.all([ invoke(fn, [seriesList, 1]).then((r) => { expect(r.output.list[0]._global.yaxes[0].position).to.equal('left'); }), @@ -39,7 +38,7 @@ describe('yaxis.js', () => { }); it('it lets you override default positions', () => { - return Bluebird.all([ + return Promise.all([ invoke(fn, [seriesList, 1, null, null, 'right']).then((r) => { expect(r.output.list[0]._global.yaxes[0].position).to.equal('right'); }), @@ -50,7 +49,7 @@ describe('yaxis.js', () => { }); it('sets the minimum (default: no min)', () => { - return Bluebird.all([ + return Promise.all([ invoke(fn, [seriesList, 1, null]).then((r) => { expect(r.output.list[0]._global.yaxes[0].min).to.equal(null); }), @@ -61,7 +60,7 @@ describe('yaxis.js', () => { }); it('sets the max (default: no max)', () => { - return Bluebird.all([ + return Promise.all([ invoke(fn, [seriesList, 1, null]).then((r) => { expect(r.output.list[0]._global.yaxes[0].max).to.equal(undefined); }), @@ -72,7 +71,7 @@ describe('yaxis.js', () => { }); it('sets the units (default: no unit', () => { - return Bluebird.all([ + return Promise.all([ invoke(fn, [seriesList, 1, null, null, null, null, null, null]).then((r) => { expect(r.output.list[0]._global.yaxes[0].units).to.equal(undefined); }), diff --git a/src/plugins/vis_types/vega/kibana.json b/src/plugins/vis_types/vega/kibana.json index 1a499e284c1a80..cedd73cc6d3989 100644 --- a/src/plugins/vis_types/vega/kibana.json +++ b/src/plugins/vis_types/vega/kibana.json @@ -5,7 +5,7 @@ "ui": true, "requiredPlugins": ["data", "visualizations", "mapsEms", "expressions", "inspector"], "optionalPlugins": ["home","usageCollection"], - "requiredBundles": ["kibanaUtils", "kibanaReact", "visDefaultEditor", "esUiShared"], + "requiredBundles": ["kibanaUtils", "kibanaReact", "visDefaultEditor"], "owner": { "name": "Vis Editors", "githubTeam": "kibana-vis-editors" diff --git a/src/plugins/vis_types/vega/public/components/vega_editor.scss b/src/plugins/vis_types/vega/public/components/vega_editor.scss index 709aaa2030f68d..4381c0097f96d5 100644 --- a/src/plugins/vis_types/vega/public/components/vega_editor.scss +++ b/src/plugins/vis_types/vega/public/components/vega_editor.scss @@ -1,18 +1,28 @@ .visEditor--vega { .visEditorSidebar__config { padding: 0; + display: flex; + flex-direction: row; + overflow: hidden; + + min-height: $euiSize * 15; + + @include euiBreakpoint('xs', 's', 'm') { + max-height: $euiSize * 15; + } } } .vgaEditor { - @include euiBreakpoint('xs', 's', 'm') { - @include euiScrollBar; - max-height: $euiSize * 15; - overflow-y: auto; + width: 100%; + flex-grow: 1; + + .kibanaCodeEditor { + width: 100%; } } -.vgaEditor__aceEditorActions { +.vgaEditor__editorActions { position: absolute; z-index: $euiZLevel1; top: $euiSizeS; diff --git a/src/plugins/vis_types/vega/public/components/vega_vis_editor.tsx b/src/plugins/vis_types/vega/public/components/vega_vis_editor.tsx index d2f586eac98854..46e5e331c94554 100644 --- a/src/plugins/vis_types/vega/public/components/vega_vis_editor.tsx +++ b/src/plugins/vis_types/vega/public/components/vega_vis_editor.tsx @@ -6,14 +6,16 @@ * Side Public License, v 1. */ -import React, { useCallback } from 'react'; -import compactStringify from 'json-stringify-pretty-compact'; +import { XJsonLang } from '@kbn/monaco'; +import useMount from 'react-use/lib/useMount'; import hjson from 'hjson'; -import 'brace/mode/hjson'; + +import React, { useCallback, useState } from 'react'; +import compactStringify from 'json-stringify-pretty-compact'; import { i18n } from '@kbn/i18n'; import { VisEditorOptionsProps } from 'src/plugins/visualizations/public'; -import { EuiCodeEditor } from '../../../../es_ui_shared/public'; +import { CodeEditor, HJsonLang } from '../../../../kibana_react/public'; import { getNotifications } from '../services'; import { VisParams } from '../vega_fn'; import { VegaHelpMenu } from './vega_help_menu'; @@ -21,20 +23,6 @@ import { VegaActionsMenu } from './vega_actions_menu'; import './vega_editor.scss'; -const aceOptions = { - maxLines: Infinity, - highlightActiveLine: false, - showPrintMargin: false, - tabSize: 2, - useSoftTabs: true, - wrap: true, -}; - -const hjsonStringifyOptions = { - bracesSameLine: true, - keepWsc: true, -}; - function format( value: string, stringify: typeof hjson.stringify | typeof compactStringify, @@ -42,7 +30,11 @@ function format( ) { try { const spec = hjson.parse(value, { legacyRoot: false, keepWsc: true }); - return stringify(spec, options); + + return { + value: stringify(spec, options), + isValid: true, + }; } catch (err) { // This is a common case - user tries to format an invalid HJSON text getNotifications().toasts.addError(err, { @@ -51,44 +43,82 @@ function format( }), }); - return value; + return { value, isValid: false }; } } function VegaVisEditor({ stateParams, setValue }: VisEditorOptionsProps) { - const onChange = useCallback( - (value: string) => { + const [languageId, setLanguageId] = useState(); + + useMount(() => { + let specLang = XJsonLang.ID; + try { + JSON.parse(stateParams.spec); + } catch { + specLang = HJsonLang; + } + setLanguageId(specLang); + }); + + const setSpec = useCallback( + (value: string, specLang?: string) => { setValue('spec', value); + if (specLang) { + setLanguageId(specLang); + } }, [setValue] ); - const formatJson = useCallback( - () => setValue('spec', format(stateParams.spec, compactStringify)), - [setValue, stateParams.spec] - ); + const onChange = useCallback((value: string) => setSpec(value), [setSpec]); - const formatHJson = useCallback( - () => setValue('spec', format(stateParams.spec, hjson.stringify, hjsonStringifyOptions)), - [setValue, stateParams.spec] - ); + const formatJson = useCallback(() => { + const { value, isValid } = format(stateParams.spec, compactStringify); + + if (isValid) { + setSpec(value, XJsonLang.ID); + } + }, [setSpec, stateParams.spec]); + + const formatHJson = useCallback(() => { + const { value, isValid } = format(stateParams.spec, hjson.stringify, { + bracesSameLine: true, + keepWsc: true, + }); + + if (isValid) { + setSpec(value, HJsonLang); + } + }, [setSpec, stateParams.spec]); + + if (!languageId) { + return null; + } return ( -
- -
+
+
+
); } diff --git a/test/api_integration/apis/kql_telemetry/kql_telemetry.ts b/test/api_integration/apis/kql_telemetry/kql_telemetry.ts index 4825b454bc42f5..310b99a5fb7813 100644 --- a/test/api_integration/apis/kql_telemetry/kql_telemetry.ts +++ b/test/api_integration/apis/kql_telemetry/kql_telemetry.ts @@ -7,7 +7,6 @@ */ import expect from '@kbn/expect'; -import Bluebird from 'bluebird'; import { get } from 'lodash'; import { FtrProviderContext } from '../../ftr_provider_context'; @@ -89,7 +88,7 @@ export default function ({ getService }: FtrProviderContext) { }); it('should only accept literal boolean values for the opt_in POST body param', function () { - return Bluebird.all([ + return Promise.all([ supertest .post('/api/kibana/kql_opt_in_stats') .set('content-type', 'application/json') diff --git a/test/functional/apps/dashboard/dashboard_filtering.ts b/test/functional/apps/dashboard/dashboard_filtering.ts index acb04b4946fad2..73a53281df16d4 100644 --- a/test/functional/apps/dashboard/dashboard_filtering.ts +++ b/test/functional/apps/dashboard/dashboard_filtering.ts @@ -28,8 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const dashboardPanelActions = getService('dashboardPanelActions'); const PageObjects = getPageObjects(['common', 'dashboard', 'header', 'visualize', 'timePicker']); - // Failing: See https://github.com/elastic/kibana/issues/92522 - describe.skip('dashboard filtering', function () { + describe('dashboard filtering', function () { this.tags('includeFirefox'); const populateDashboard = async () => { @@ -115,13 +114,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('saved search is filtered', async () => { - await dashboardExpect.savedSearchRowCount(0); + await dashboardExpect.savedSearchRowsMissing(); }); - // TODO: Uncomment once https://github.com/elastic/kibana/issues/22561 is fixed - // it('timelion is filtered', async () => { - // await dashboardExpect.timelionLegendCount(0); - // }); + it('timelion is filtered', async () => { + await dashboardExpect.timelionLegendCount(0); + }); it('vega is filtered', async () => { await dashboardExpect.vegaTextsDoNotExist(['5,000']); @@ -177,13 +175,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('saved search is filtered', async () => { - await dashboardExpect.savedSearchRowCount(0); + await dashboardExpect.savedSearchRowsMissing(); }); - // TODO: Uncomment once https://github.com/elastic/kibana/issues/22561 is fixed - // it('timelion is filtered', async () => { - // await dashboardExpect.timelionLegendCount(0); - // }); + it('timelion is filtered', async () => { + await dashboardExpect.timelionLegendCount(0); + }); it('vega is filtered', async () => { await dashboardExpect.vegaTextsDoNotExist(['5,000']); @@ -206,7 +203,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('area, bar and heatmap charts', async () => { - await dashboardExpect.seriesElementCount(3); + await dashboardExpect.seriesElementCount(2); }); it('data tables', async () => { @@ -238,7 +235,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('saved searches', async () => { - await dashboardExpect.savedSearchRowCount(1); + await dashboardExpect.savedSearchRowsExist(); }); it('vega', async () => { diff --git a/test/functional/apps/management/_index_pattern_create_delete.js b/test/functional/apps/management/_index_pattern_create_delete.js index acb554fa7310b9..62612ad5a90804 100644 --- a/test/functional/apps/management/_index_pattern_create_delete.js +++ b/test/functional/apps/management/_index_pattern_create_delete.js @@ -9,6 +9,7 @@ import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { + const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); const browser = getService('browser'); const log = getService('log'); @@ -18,16 +19,11 @@ export default function ({ getService, getPageObjects }) { const PageObjects = getPageObjects(['settings', 'common', 'header']); describe('creating and deleting default index', function describeIndexTests() { - before(function () { - // Delete .kibana index and then wait for Kibana to re-create it - return kibanaServer.uiSettings - .replace({}) - .then(function () { - return PageObjects.settings.navigateTo(); - }) - .then(function () { - return PageObjects.settings.clickKibanaIndexPatterns(); - }); + before(async function () { + await esArchiver.emptyKibanaIndex(); + await kibanaServer.uiSettings.replace({}); + await PageObjects.settings.navigateTo(); + await PageObjects.settings.clickKibanaIndexPatterns(); }); describe('can open and close editor', function () { @@ -39,17 +35,16 @@ export default function ({ getService, getPageObjects }) { }); }); - // FLAKY: https://github.com/elastic/kibana/issues/107831 - describe.skip('validation', function () { + describe('validation', function () { it('can display errors', async function () { await PageObjects.settings.clickAddNewIndexPatternButton(); - await PageObjects.settings.setIndexPatternField('log*'); + await PageObjects.settings.setIndexPatternField('log-fake*'); await (await PageObjects.settings.getSaveIndexPatternButton()).click(); await find.byClassName('euiFormErrorText'); }); it('can resolve errors and submit', async function () { - await PageObjects.settings.selectTimeFieldOption('@timestamp'); + await PageObjects.settings.setIndexPatternField('log*'); await (await PageObjects.settings.getSaveIndexPatternButton()).click(); await PageObjects.settings.removeIndexPattern(); }); diff --git a/test/functional/apps/management/_runtime_fields.js b/test/functional/apps/management/_runtime_fields.js index 09fa924b0b8705..3a70df81b55d96 100644 --- a/test/functional/apps/management/_runtime_fields.js +++ b/test/functional/apps/management/_runtime_fields.js @@ -16,8 +16,7 @@ export default function ({ getService, getPageObjects }) { const PageObjects = getPageObjects(['settings']); const testSubjects = getService('testSubjects'); - // FLAKY: https://github.com/elastic/kibana/issues/95376 - describe.skip('runtime fields', function () { + describe('runtime fields', function () { this.tags(['skipFirefox']); before(async function () { @@ -60,7 +59,7 @@ export default function ({ getService, getPageObjects }) { await PageObjects.settings.filterField(fieldName); await testSubjects.click('editFieldFormat'); await PageObjects.settings.setFieldType('Long'); - await PageObjects.settings.changeFieldScript('emit(6);'); + await PageObjects.settings.setFieldScript('emit(6);'); await testSubjects.find('changeWarning'); await PageObjects.settings.clickSaveField(); await PageObjects.settings.confirmSave(); diff --git a/test/functional/apps/management/_scripted_fields_preview.js b/test/functional/apps/management/_scripted_fields_preview.js index 6347531b0cda8f..12a6cb9537c8d6 100644 --- a/test/functional/apps/management/_scripted_fields_preview.js +++ b/test/functional/apps/management/_scripted_fields_preview.js @@ -13,10 +13,11 @@ export default function ({ getService, getPageObjects }) { const PageObjects = getPageObjects(['settings']); const SCRIPTED_FIELD_NAME = 'myScriptedField'; - // FLAKY: https://github.com/elastic/kibana/issues/89475 - describe.skip('scripted fields preview', () => { + describe('scripted fields preview', () => { before(async function () { await browser.setWindowSize(1200, 800); + await PageObjects.settings.navigateTo(); + await PageObjects.settings.clickKibanaIndexPatterns(); await PageObjects.settings.createIndexPattern(); await PageObjects.settings.navigateTo(); diff --git a/test/functional/fixtures/es_archiver/dashboard/current/kibana/data.json b/test/functional/fixtures/es_archiver/dashboard/current/kibana/data.json index 599ffbadaaea77..45e26f1599b6c0 100644 --- a/test/functional/fixtures/es_archiver/dashboard/current/kibana/data.json +++ b/test/functional/fixtures/es_archiver/dashboard/current/kibana/data.json @@ -2316,7 +2316,7 @@ "title": "Filter Bytes Test: tsvb top n with bytes filter", "uiStateJSON": "{}", "version": 1, - "visState": "{\"title\":\"Filter Bytes Test: tsvb top n with bytes filter\",\"type\":\"metrics\",\"params\":{\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"top_n\",\"series\":[{\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"#68BC00\",\"split_mode\":\"filters\",\"metrics\":[{\"id\":\"482d6560-4194-11e8-a461-7d278185cba4\",\"type\":\"avg\",\"field\":\"bytes\"}],\"seperate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"terms_field\":\"clientip\",\"filter\":{\"query\":\"Filter Bytes Test:>1000\",\"language\":\"lucene\"},\"override_index_pattern\":0,\"series_index_pattern\":\"logstash-*\",\"series_time_field\":\"utc_time\",\"series_interval\":\"1m\",\"value_template\":\"\",\"split_filters\":[{\"filter\":{\"query\":\"Filter Bytes Test:>100\",\"language\":\"lucene\"},\"label\":\"\",\"color\":\"#68BC00\",\"id\":\"39a107e0-4194-11e8-a461-7d278185cba4\"}],\"split_color_mode\":\"gradient\"},{\"id\":\"4fd5b150-4194-11e8-a461-7d278185cba4\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"4fd5b151-4194-11e8-a461-7d278185cba4\",\"type\":\"avg\",\"field\":\"bytes\"}],\"seperate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"filter\":{\"query\":\"Filter Bytes Test:>3000\",\"language\":\"lucene\"},\"split_color_mode\":\"gradient\"}],\"time_field\":\"@timestamp\",\"index_pattern\":\"logstash-*\",\"interval\":\"auto\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"show_legend\":1,\"show_grid\":1,\"background_color_rules\":[{\"id\":\"06893260-4194-11e8-a461-7d278185cba4\"}],\"bar_color_rules\":[{\"id\":\"36a0e740-4194-11e8-a461-7d278185cba4\"}],\"use_kibana_indexes\":false,\"hide_last_value_indicator\":true},\"aggs\":[]}" + "visState":"{\"title\":\"Filter Bytes Test: tsvb top n with bytes filter\",\"type\":\"metrics\",\"aggs\":[],\"params\":{\"time_range_mode\":\"last_value\",\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"top_n\",\"series\":[{\"time_range_mode\":\"entire_time_range\",\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"#68BC00\",\"split_mode\":\"filters\",\"metrics\":[{\"id\":\"482d6560-4194-11e8-a461-7d278185cba4\",\"type\":\"avg\",\"field\":\"bytes\"}],\"seperate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"terms_field\":\"clientip\",\"filter\":{\"query\":\"Filter Bytes Test:>1000\",\"language\":\"lucene\"},\"override_index_pattern\":0,\"series_index_pattern\":\"logstash-*\",\"series_time_field\":\"utc_time\",\"series_interval\":\"1m\",\"value_template\":\"\",\"split_filters\":[{\"filter\":{\"query\":\"Filter Bytes Test:>100\",\"language\":\"lucene\"},\"label\":\"\",\"color\":\"#68BC00\",\"id\":\"39a107e0-4194-11e8-a461-7d278185cba4\"}],\"split_color_mode\":\"gradient\"},{\"time_range_mode\":\"entire_time_range\",\"id\":\"4fd5b150-4194-11e8-a461-7d278185cba4\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"4fd5b151-4194-11e8-a461-7d278185cba4\",\"type\":\"avg\",\"field\":\"bytes\"}],\"seperate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"filter\":{\"query\":\"Filter Bytes Test:>3000\",\"language\":\"lucene\"},\"split_color_mode\":\"gradient\"}],\"time_field\":\"@timestamp\",\"index_pattern\":\"logstash-*\",\"interval\":\"auto\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"show_legend\":1,\"show_grid\":1,\"background_color_rules\":[{\"id\":\"06893260-4194-11e8-a461-7d278185cba4\"}],\"bar_color_rules\":[{\"id\":\"36a0e740-4194-11e8-a461-7d278185cba4\"}],\"use_kibana_indexes\":false,\"hide_last_value_indicator\":true,\"axis_scale\":\"normal\",\"truncate_legend\":1,\"max_lines_legend\":1,\"tooltip_mode\":\"show_all\",\"drop_last_bucket\":1,\"isModelInvalid\":false}}" } }, "type": "_doc" @@ -2379,7 +2379,7 @@ "title": "Filter Bytes Test: tsvb time series with bytes filter split by clientip", "uiStateJSON": "{}", "version": 1, - "visState": "{\"title\":\"Filter Bytes Test: tsvb time series with bytes filter split by clientip\",\"type\":\"metrics\",\"params\":{\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"timeseries\",\"series\":[{\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"#68BC00\",\"split_mode\":\"terms\",\"metrics\":[{\"value\":\"\",\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"sum\",\"field\":\"bytes\"}],\"seperate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"terms_field\":\"clientip\",\"filter\":{\"query\":\"Filter Bytes Test:>1000\",\"language\":\"lucene\"},\"split_color_mode\":\"gradient\"}],\"time_field\":\"@timestamp\",\"index_pattern\":\"logstash-*\",\"interval\":\"auto\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"show_legend\":1,\"show_grid\":1,\"use_kibana_indexes\":false},\"aggs\":[]}" + "visState":"{\"title\":\"Filter Bytes Test: tsvb time series with bytes filter split by clientip\",\"type\":\"metrics\",\"aggs\":[],\"params\":{\"time_range_mode\":\"entire_time_range\",\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"timeseries\",\"series\":[{\"time_range_mode\":\"entire_time_range\",\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"#68BC00\",\"split_mode\":\"terms\",\"metrics\":[{\"value\":\"\",\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"sum\",\"field\":\"bytes\"}],\"seperate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"terms_field\":\"clientip\",\"filter\":{\"query\":\"Filter Bytes Test:>1000\",\"language\":\"lucene\"},\"split_color_mode\":\"gradient\"}],\"time_field\":\"@timestamp\",\"index_pattern\":\"logstash-*\",\"interval\":\"auto\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"show_legend\":1,\"show_grid\":1,\"use_kibana_indexes\":false,\"axis_scale\":\"normal\",\"truncate_legend\":1,\"max_lines_legend\":1,\"tooltip_mode\":\"show_all\",\"drop_last_bucket\":1,\"isModelInvalid\":false}}" } }, "type": "_doc" @@ -2600,45 +2600,6 @@ } } -{ - "type": "doc", - "value": { - "id": "visualization:63983430-4192-11e8-bb13-d53698fb349a", - "index": ".kibana", - "source": { - "coreMigrationVersion": "7.14.0", - "migrationVersion": { - "visualization": "7.14.0" - }, - "references": [ - { - "id": "0bf35f60-3dc9-11e8-8660-4d65aa086b3c", - "name": "kibanaSavedObjectMeta.searchSourceJSON.index", - "type": "index-pattern" - }, - { - "id": "0bf35f60-3dc9-11e8-8660-4d65aa086b3c", - "name": "kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index", - "type": "index-pattern" - } - ], - "type": "visualization", - "updated_at": "2018-04-17T15:06:36.275Z", - "visualization": { - "description": "", - "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"filter\":[{\"meta\":{\"negate\":false,\"disabled\":false,\"alias\":null,\"type\":\"phrase\",\"key\":\"geo.src\",\"value\":\"US\",\"params\":{\"query\":\"US\",\"type\":\"phrase\"},\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index\"},\"query\":{\"match\":{\"geo.src\":{\"query\":\"US\",\"type\":\"phrase\"}}},\"$state\":{\"store\":\"appState\"}}],\"query\":{\"query\":\"Filter Bytes Test:>5000\",\"language\":\"lucene\"},\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" - }, - "title": "Filter Bytes Test: geo map with filter and query bytes > 5000 in US geo.src, heatmap setting", - "uiStateJSON": "{\"mapZoom\":7,\"mapCenter\":[42.98857645832184,-75.49804687500001]}", - "version": 1, - "visState": "{\"title\":\"Filter Bytes Test: geo map with filter and query bytes > 5000 in US geo.src, heatmap setting\",\"type\":\"tile_map\",\"params\":{\"mapType\":\"Heatmap\",\"isDesaturated\":true,\"addTooltip\":true,\"heatClusterSize\":1.5,\"legendPosition\":\"bottomright\",\"mapZoom\":2,\"mapCenter\":[0,0],\"wms\":{\"enabled\":false,\"options\":{\"format\":\"image/png\",\"transparent\":true},\"baseLayersAreLoaded\":{},\"tmsLayers\":[{\"id\":\"road_map\",\"url\":\"https://tiles-stage.elastic.co/v2/default/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=6.3.0\",\"minZoom\":0,\"maxZoom\":10,\"attribution\":\"

© OpenStreetMap contributors | Elastic Maps Service

\",\"subdomains\":[]}],\"selectedTmsLayer\":{\"id\":\"road_map\",\"url\":\"https://tiles-stage.elastic.co/v2/default/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=6.3.0\",\"minZoom\":0,\"maxZoom\":10,\"attribution\":\"

© OpenStreetMap contributors | Elastic Maps Service

\",\"subdomains\":[]}}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"geohash_grid\",\"schema\":\"segment\",\"params\":{\"field\":\"geo.coordinates\",\"autoPrecision\":true,\"isFilteredByCollar\":true,\"useGeocentroid\":true,\"precision\":4}}]}" - } - }, - "type": "_doc" - } -} - { "type": "doc", "value": { @@ -2817,7 +2778,7 @@ "title": "Filter Bytes Test: tsvb metric with custom interval and bytes filter", "uiStateJSON": "{}", "version": 1, - "visState": "{\"title\":\"Filter Bytes Test: tsvb metric with custom interval and bytes filter\",\"type\":\"metrics\",\"params\":{\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"metric\",\"series\":[{\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"value\":\"\",\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"sum\",\"field\":\"bytes\"}],\"seperate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"terms_field\":\"clientip\",\"filter\":{\"query\":\"Filter Bytes Test:>1000\",\"language\":\"lucene\"},\"override_index_pattern\":1,\"series_index_pattern\":\"logstash-*\",\"series_time_field\":\"utc_time\",\"series_interval\":\"1d\",\"value_template\":\"{{value}} custom template\",\"split_color_mode\":\"gradient\"}],\"time_field\":\"@timestamp\",\"index_pattern\":\"logstash-*\",\"interval\":\"auto\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"show_legend\":1,\"show_grid\":1,\"background_color_rules\":[{\"id\":\"06893260-4194-11e8-a461-7d278185cba4\"}],\"use_kibana_indexes\":false,\"hide_last_value_indicator\":true},\"aggs\":[]}" + "visState":"{\"title\":\"Filter Bytes Test: tsvb metric with custom interval and bytes filter\",\"type\":\"metrics\",\"aggs\":[],\"params\":{\"time_range_mode\":\"last_value\",\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"metric\",\"series\":[{\"time_range_mode\":\"last_value\",\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"value\":\"\",\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"sum\",\"field\":\"bytes\"}],\"seperate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"terms_field\":\"clientip\",\"filter\":{\"query\":\"Filter Bytes Test:>1000\",\"language\":\"lucene\"},\"override_index_pattern\":1,\"series_index_pattern\":\"logstash-*\",\"series_time_field\":\"utc_time\",\"series_interval\":\"1d\",\"value_template\":\"{{value}} custom template\",\"split_color_mode\":\"gradient\",\"series_drop_last_bucket\":1}],\"time_field\":\"@timestamp\",\"index_pattern\":\"logstash-*\",\"interval\":\"auto\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"show_legend\":1,\"show_grid\":1,\"background_color_rules\":[{\"id\":\"06893260-4194-11e8-a461-7d278185cba4\"}],\"use_kibana_indexes\":false,\"hide_last_value_indicator\":true,\"axis_scale\":\"normal\",\"truncate_legend\":1,\"max_lines_legend\":1,\"tooltip_mode\":\"show_all\",\"drop_last_bucket\":0,\"isModelInvalid\":false,\"bar_color_rules\":[{\"id\":\"71f4e260-4186-11ec-8262-619fbabeae59\"}]}}" } }, "type": "_doc" @@ -2846,7 +2807,7 @@ "title": "Filter Bytes Test: tsvb markdown", "uiStateJSON": "{}", "version": 1, - "visState": "{\"title\":\"Filter Bytes Test: tsvb markdown\",\"type\":\"metrics\",\"params\":{\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"markdown\",\"series\":[{\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"#68BC00\",\"split_mode\":\"filters\",\"metrics\":[{\"id\":\"482d6560-4194-11e8-a461-7d278185cba4\",\"type\":\"avg\",\"field\":\"bytes\"}],\"seperate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"terms_field\":\"clientip\",\"filter\":{\"query\":\"Filter Bytes Test:>1000\",\"language\":\"lucene\"},\"override_index_pattern\":0,\"series_index_pattern\":\"logstash-*\",\"series_time_field\":\"utc_time\",\"series_interval\":\"1m\",\"value_template\":\"\",\"split_filters\":[{\"filter\":{\"query\":\"bytes:>1000\",\"language\":\"lucene\"},\"label\":\"\",\"color\":\"#68BC00\",\"id\":\"39a107e0-4194-11e8-a461-7d278185cba4\"}],\"label\":\"\",\"var_name\":\"\",\"split_color_mode\":\"gradient\"}],\"time_field\":\"@timestamp\",\"index_pattern\":\"logstash-*\",\"interval\":\"auto\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"show_legend\":1,\"show_grid\":1,\"background_color_rules\":[{\"id\":\"06893260-4194-11e8-a461-7d278185cba4\"}],\"bar_color_rules\":[{\"id\":\"36a0e740-4194-11e8-a461-7d278185cba4\"}],\"markdown\":\"{{bytes_1000.last.formatted}}\",\"use_kibana_indexes\":false,\"hide_last_value_indicator\":true},\"aggs\":[]}" + "visState":"{\"title\":\"Filter Bytes Test: tsvb markdown\",\"type\":\"metrics\",\"aggs\":[],\"params\":{\"time_range_mode\":\"last_value\",\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"markdown\",\"series\":[{\"time_range_mode\":\"last_value\",\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"#68BC00\",\"split_mode\":\"filters\",\"metrics\":[{\"id\":\"482d6560-4194-11e8-a461-7d278185cba4\",\"type\":\"avg\",\"field\":\"bytes\"}],\"seperate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"terms_field\":\"clientip\",\"filter\":{\"query\":\"Filter Bytes Test:>1000\",\"language\":\"lucene\"},\"override_index_pattern\":0,\"series_index_pattern\":\"logstash-*\",\"series_time_field\":\"utc_time\",\"series_interval\":\"1m\",\"value_template\":\"\",\"split_filters\":[{\"filter\":{\"query\":\"bytes:>1000\",\"language\":\"lucene\"},\"label\":\"\",\"color\":\"#68BC00\",\"id\":\"39a107e0-4194-11e8-a461-7d278185cba4\"}],\"label\":\"\",\"var_name\":\"\",\"split_color_mode\":\"gradient\",\"series_drop_last_bucket\":1}],\"time_field\":\"@timestamp\",\"index_pattern\":\"logstash-*\",\"interval\":\"auto\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"show_legend\":1,\"show_grid\":1,\"background_color_rules\":[{\"id\":\"06893260-4194-11e8-a461-7d278185cba4\"}],\"bar_color_rules\":[{\"id\":\"36a0e740-4194-11e8-a461-7d278185cba4\"}],\"markdown\":\"{{bytes_1000.last.formatted}}\",\"use_kibana_indexes\":false,\"hide_last_value_indicator\":true,\"axis_scale\":\"normal\",\"truncate_legend\":1,\"max_lines_legend\":1,\"tooltip_mode\":\"show_all\",\"drop_last_bucket\":1,\"isModelInvalid\":false}}" } }, "type": "_doc" diff --git a/test/functional/fixtures/es_archiver/date_nested/data.json b/test/functional/fixtures/es_archiver/date_nested/data.json index 0bdb3fc510a63a..bb623f93627c7f 100644 --- a/test/functional/fixtures/es_archiver/date_nested/data.json +++ b/test/functional/fixtures/es_archiver/date_nested/data.json @@ -6,7 +6,7 @@ "source": { "index-pattern": { "fields":"[]", - "timeFieldName": "@timestamp", + "timeFieldName": "nested.timestamp", "title": "date-nested" }, "type": "index-pattern" diff --git a/test/functional/page_objects/common_page.ts b/test/functional/page_objects/common_page.ts index 3955e457b5ffce..0150daec3afb5c 100644 --- a/test/functional/page_objects/common_page.ts +++ b/test/functional/page_objects/common_page.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { delay } from 'bluebird'; +import { setTimeout as setTimeoutAsync } from 'timers/promises'; import expect from '@kbn/expect'; // @ts-ignore import fetch from 'node-fetch'; @@ -214,7 +214,7 @@ export class CommonPageObject extends FtrService { async sleep(sleepMilliseconds: number) { this.log.debug(`... sleep(${sleepMilliseconds}) start`); - await delay(sleepMilliseconds); + await setTimeoutAsync(sleepMilliseconds); this.log.debug(`... sleep(${sleepMilliseconds}) end`); } diff --git a/test/functional/page_objects/login_page.ts b/test/functional/page_objects/login_page.ts index 5318a2b2d0c154..74e85e60d1a691 100644 --- a/test/functional/page_objects/login_page.ts +++ b/test/functional/page_objects/login_page.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { delay } from 'bluebird'; +import { setTimeout as setTimeoutAsync } from 'timers/promises'; import { FtrService } from '../ftr_provider_context'; export class LoginPageObject extends FtrService { @@ -40,7 +40,7 @@ export class LoginPageObject extends FtrService { async sleep(sleepMilliseconds: number) { this.log.debug(`... sleep(${sleepMilliseconds}) start`); - await delay(sleepMilliseconds); + await setTimeoutAsync(sleepMilliseconds); this.log.debug(`... sleep(${sleepMilliseconds}) end`); } diff --git a/test/functional/page_objects/management/saved_objects_page.ts b/test/functional/page_objects/management/saved_objects_page.ts index 21af7aa477abd8..87d5537d53ca31 100644 --- a/test/functional/page_objects/management/saved_objects_page.ts +++ b/test/functional/page_objects/management/saved_objects_page.ts @@ -7,7 +7,6 @@ */ import { keyBy } from 'lodash'; -import { map as mapAsync } from 'bluebird'; import { FtrService } from '../../ftr_provider_context'; export class SavedObjectsPageObject extends FtrService { @@ -201,51 +200,55 @@ export class SavedObjectsPageObject extends FtrService { async getElementsInTable() { const rows = await this.testSubjects.findAll('~savedObjectsTableRow'); - return mapAsync(rows, async (row) => { - const checkbox = await row.findByCssSelector('[data-test-subj*="checkboxSelectRow"]'); - // return the object type aria-label="index patterns" - const objectType = await row.findByTestSubject('objectType'); - const titleElement = await row.findByTestSubject('savedObjectsTableRowTitle'); - // not all rows have inspect button - Advanced Settings objects don't - // Advanced Settings has 2 actions, - // data-test-subj="savedObjectsTableAction-relationships" - // data-test-subj="savedObjectsTableAction-copy_saved_objects_to_space" - // Some other objects have the ... - // data-test-subj="euiCollapsedItemActionsButton" - // Maybe some objects still have the inspect element visible? - // !!! Also note that since we don't have spaces on OSS, the actions for the same object can be different depending on OSS or not - let menuElement = null; - let inspectElement = null; - let relationshipsElement = null; - let copySaveObjectsElement = null; - const actions = await row.findByClassName('euiTableRowCell--hasActions'); - // getting the innerHTML and checking if it 'includes' a string is faster than a timeout looking for each element - const actionsHTML = await actions.getAttribute('innerHTML'); - if (actionsHTML.includes('euiCollapsedItemActionsButton')) { - menuElement = await row.findByTestSubject('euiCollapsedItemActionsButton'); - } - if (actionsHTML.includes('savedObjectsTableAction-inspect')) { - inspectElement = await row.findByTestSubject('savedObjectsTableAction-inspect'); - } - if (actionsHTML.includes('savedObjectsTableAction-relationships')) { - relationshipsElement = await row.findByTestSubject('savedObjectsTableAction-relationships'); - } - if (actionsHTML.includes('savedObjectsTableAction-copy_saved_objects_to_space')) { - copySaveObjectsElement = await row.findByTestSubject( - 'savedObjectsTableAction-copy_saved_objects_to_space' - ); - } - return { - checkbox, - objectType: await objectType.getAttribute('aria-label'), - titleElement, - title: await titleElement.getVisibleText(), - menuElement, - inspectElement, - relationshipsElement, - copySaveObjectsElement, - }; - }); + return await Promise.all( + rows.map(async (row) => { + const checkbox = await row.findByCssSelector('[data-test-subj*="checkboxSelectRow"]'); + // return the object type aria-label="index patterns" + const objectType = await row.findByTestSubject('objectType'); + const titleElement = await row.findByTestSubject('savedObjectsTableRowTitle'); + // not all rows have inspect button - Advanced Settings objects don't + // Advanced Settings has 2 actions, + // data-test-subj="savedObjectsTableAction-relationships" + // data-test-subj="savedObjectsTableAction-copy_saved_objects_to_space" + // Some other objects have the ... + // data-test-subj="euiCollapsedItemActionsButton" + // Maybe some objects still have the inspect element visible? + // !!! Also note that since we don't have spaces on OSS, the actions for the same object can be different depending on OSS or not + let menuElement = null; + let inspectElement = null; + let relationshipsElement = null; + let copySaveObjectsElement = null; + const actions = await row.findByClassName('euiTableRowCell--hasActions'); + // getting the innerHTML and checking if it 'includes' a string is faster than a timeout looking for each element + const actionsHTML = await actions.getAttribute('innerHTML'); + if (actionsHTML.includes('euiCollapsedItemActionsButton')) { + menuElement = await row.findByTestSubject('euiCollapsedItemActionsButton'); + } + if (actionsHTML.includes('savedObjectsTableAction-inspect')) { + inspectElement = await row.findByTestSubject('savedObjectsTableAction-inspect'); + } + if (actionsHTML.includes('savedObjectsTableAction-relationships')) { + relationshipsElement = await row.findByTestSubject( + 'savedObjectsTableAction-relationships' + ); + } + if (actionsHTML.includes('savedObjectsTableAction-copy_saved_objects_to_space')) { + copySaveObjectsElement = await row.findByTestSubject( + 'savedObjectsTableAction-copy_saved_objects_to_space' + ); + } + return { + checkbox, + objectType: await objectType.getAttribute('aria-label'), + titleElement, + title: await titleElement.getVisibleText(), + menuElement, + inspectElement, + relationshipsElement, + copySaveObjectsElement, + }; + }) + ); } async getRowTitles() { @@ -259,35 +262,39 @@ export class SavedObjectsPageObject extends FtrService { async getRelationshipFlyout() { const rows = await this.testSubjects.findAll('relationshipsTableRow'); - return mapAsync(rows, async (row) => { - const objectType = await row.findByTestSubject('relationshipsObjectType'); - const relationship = await row.findByTestSubject('directRelationship'); - const titleElement = await row.findByTestSubject('relationshipsTitle'); - const inspectElement = await row.findByTestSubject('relationshipsTableAction-inspect'); - return { - objectType: await objectType.getAttribute('aria-label'), - relationship: await relationship.getVisibleText(), - titleElement, - title: await titleElement.getVisibleText(), - inspectElement, - }; - }); + return await Promise.all( + rows.map(async (row) => { + const objectType = await row.findByTestSubject('relationshipsObjectType'); + const relationship = await row.findByTestSubject('directRelationship'); + const titleElement = await row.findByTestSubject('relationshipsTitle'); + const inspectElement = await row.findByTestSubject('relationshipsTableAction-inspect'); + return { + objectType: await objectType.getAttribute('aria-label'), + relationship: await relationship.getVisibleText(), + titleElement, + title: await titleElement.getVisibleText(), + inspectElement, + }; + }) + ); } async getInvalidRelations() { const rows = await this.testSubjects.findAll('invalidRelationshipsTableRow'); - return mapAsync(rows, async (row) => { - const objectType = await row.findByTestSubject('relationshipsObjectType'); - const objectId = await row.findByTestSubject('relationshipsObjectId'); - const relationship = await row.findByTestSubject('directRelationship'); - const error = await row.findByTestSubject('relationshipsError'); - return { - type: await objectType.getVisibleText(), - id: await objectId.getVisibleText(), - relationship: await relationship.getVisibleText(), - error: await error.getVisibleText(), - }; - }); + return await Promise.all( + rows.map(async (row) => { + const objectType = await row.findByTestSubject('relationshipsObjectType'); + const objectId = await row.findByTestSubject('relationshipsObjectId'); + const relationship = await row.findByTestSubject('directRelationship'); + const error = await row.findByTestSubject('relationshipsError'); + return { + type: await objectType.getVisibleText(), + id: await objectId.getVisibleText(), + relationship: await relationship.getVisibleText(), + error: await error.getVisibleText(), + }; + }) + ); } async getTableSummary() { diff --git a/test/functional/page_objects/settings_page.ts b/test/functional/page_objects/settings_page.ts index d3443f9cf49252..54728e1db3f55d 100644 --- a/test/functional/page_objects/settings_page.ts +++ b/test/functional/page_objects/settings_page.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import { map as mapAsync } from 'bluebird'; import expect from '@kbn/expect'; import { FtrService } from '../ftr_provider_context'; @@ -234,23 +233,29 @@ export class SettingsPageObject extends FtrService { async getFieldNames() { const fieldNameCells = await this.testSubjects.findAll('editIndexPattern > indexedFieldName'); - return await mapAsync(fieldNameCells, async (cell) => { - return (await cell.getVisibleText()).trim(); - }); + return await Promise.all( + fieldNameCells.map(async (cell) => { + return (await cell.getVisibleText()).trim(); + }) + ); } async getFieldTypes() { const fieldNameCells = await this.testSubjects.findAll('editIndexPattern > indexedFieldType'); - return await mapAsync(fieldNameCells, async (cell) => { - return (await cell.getVisibleText()).trim(); - }); + return await Promise.all( + fieldNameCells.map(async (cell) => { + return (await cell.getVisibleText()).trim(); + }) + ); } async getScriptedFieldLangs() { const fieldNameCells = await this.testSubjects.findAll('editIndexPattern > scriptedFieldLang'); - return await mapAsync(fieldNameCells, async (cell) => { - return (await cell.getVisibleText()).trim(); - }); + return await Promise.all( + fieldNameCells.map(async (cell) => { + return (await cell.getVisibleText()).trim(); + }) + ); } async setFieldTypeFilter(type: string) { @@ -327,9 +332,11 @@ export class SettingsPageObject extends FtrService { async getAllIndexPatternNames() { const indexPatterns = await this.getIndexPatternList(); - return await mapAsync(indexPatterns, async (index) => { - return await index.getVisibleText(); - }); + return await Promise.all( + indexPatterns.map(async (index) => { + return await index.getVisibleText(); + }) + ); } async isIndexPatternListEmpty() { @@ -437,7 +444,8 @@ export class SettingsPageObject extends FtrService { async setIndexPatternField(indexPatternName = 'logstash-*') { this.log.debug(`setIndexPatternField(${indexPatternName})`); const field = await this.getIndexPatternField(); - await field.clearValue(); + await field.clearValueWithKeyboard(); + if ( indexPatternName.charAt(0) === '*' && indexPatternName.charAt(indexPatternName.length - 1) === '*' @@ -565,9 +573,11 @@ export class SettingsPageObject extends FtrService { const table = await this.find.byClassName('euiTable'); await this.retry.waitFor('field filter to be added', async () => { const tableCells = await table.findAllByCssSelector('td'); - const fieldNames = await mapAsync(tableCells, async (cell) => { - return (await cell.getVisibleText()).trim(); - }); + const fieldNames = await Promise.all( + tableCells.map(async (cell) => { + return (await cell.getVisibleText()).trim(); + }) + ); return fieldNames.includes(name); }); } @@ -618,23 +628,9 @@ export class SettingsPageObject extends FtrService { async setFieldScript(script: string) { this.log.debug('set script = ' + script); - const valueRow = await this.toggleRow('valueRow'); - const getMonacoTextArea = async () => (await valueRow.findAllByCssSelector('textarea'))[0]; - this.retry.waitFor('monaco editor is ready', async () => !!(await getMonacoTextArea())); - const monacoTextArea = await getMonacoTextArea(); - await monacoTextArea.focus(); - this.browser.pressKeys(script); - } - - async changeFieldScript(script: string) { - this.log.debug('set script = ' + script); - const valueRow = await this.testSubjects.find('valueRow'); - const getMonacoTextArea = async () => (await valueRow.findAllByCssSelector('textarea'))[0]; - this.retry.waitFor('monaco editor is ready', async () => !!(await getMonacoTextArea())); - const monacoTextArea = await getMonacoTextArea(); - await monacoTextArea.focus(); - this.browser.pressKeys(this.browser.keys.DELETE.repeat(30)); - this.browser.pressKeys(script); + await this.toggleRow('valueRow'); + await this.monacoEditor.waitCodeEditorReady('valueRow'); + await this.monacoEditor.setCodeEditorValue(script); } async clickAddScriptedField() { diff --git a/test/functional/page_objects/vega_chart_page.ts b/test/functional/page_objects/vega_chart_page.ts index f83c5e193034eb..045e5eedb86f01 100644 --- a/test/functional/page_objects/vega_chart_page.ts +++ b/test/functional/page_objects/vega_chart_page.ts @@ -19,6 +19,7 @@ export class VegaChartPageObject extends FtrService { private readonly testSubjects = this.ctx.getService('testSubjects'); private readonly browser = this.ctx.getService('browser'); private readonly retry = this.ctx.getService('retry'); + private readonly monacoEditor = this.ctx.getService('monacoEditor'); public getEditor() { return this.testSubjects.find('vega-editor'); @@ -36,63 +37,31 @@ export class VegaChartPageObject extends FtrService { return this.find.byCssSelector('[aria-label^="Y-axis"]'); } - public async getAceGutterContainer() { - const editor = await this.getEditor(); - return editor.findByClassName('ace_gutter'); - } - - public async getRawSpec() { - // Adapted from console_page.js:getVisibleTextFromAceEditor(). Is there a common utilities file? - const editor = await this.getEditor(); - const lines = await editor.findAllByClassName('ace_line_group'); - - return await Promise.all( - lines.map(async (line) => { - return await line.getVisibleText(); - }) - ); - } - public async getSpec() { - return (await this.getRawSpec()).join('\n'); - } - - public async focusEditor() { - const editor = await this.getEditor(); - const textarea = await editor.findByClassName('ace_content'); - - await textarea.click(); + return this.monacoEditor.getCodeEditorValue(); } public async fillSpec(newSpec: string) { await this.retry.try(async () => { await this.cleanSpec(); - await this.focusEditor(); - await this.browser.pressKeys(newSpec); + await this.monacoEditor.setCodeEditorValue(newSpec); expect(compareSpecs(await this.getSpec(), newSpec)).to.be(true); }); } public async typeInSpec(text: string) { - const aceGutter = await this.getAceGutterContainer(); + const editor = await this.testSubjects.find('vega-editor'); + const textarea = await editor.findByCssSelector('textarea'); - await aceGutter.doubleClick(); + await textarea.focus(); + await this.browser.pressKeys(this.browser.keys.RIGHT); await this.browser.pressKeys(this.browser.keys.RIGHT); - await this.browser.pressKeys(this.browser.keys.LEFT); - await this.browser.pressKeys(this.browser.keys.LEFT); - await this.browser.pressKeys(text); + await textarea.type(text); } public async cleanSpec() { - const aceGutter = await this.getAceGutterContainer(); - - await this.retry.try(async () => { - await aceGutter.doubleClick(); - await this.browser.pressKeys(this.browser.keys.BACK_SPACE); - - expect(await this.getSpec()).to.be(''); - }); + await this.monacoEditor.setCodeEditorValue(''); } public async getYAxisLabels() { diff --git a/test/functional/services/common/browser.ts b/test/functional/services/common/browser.ts index 73d92f8ff722bb..7581c17a58ebf1 100644 --- a/test/functional/services/common/browser.ts +++ b/test/functional/services/common/browser.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { delay } from 'bluebird'; +import { setTimeout as setTimeoutAsync } from 'timers/promises'; import { cloneDeepWith } from 'lodash'; import { Key, Origin, WebDriver } from 'selenium-webdriver'; // @ts-ignore internal modules are not typed @@ -303,7 +303,7 @@ class BrowserService extends FtrService { to ); // wait for 150ms to make sure the script has run - await delay(150); + await setTimeoutAsync(150); } /** diff --git a/test/functional/services/common/test_subjects.ts b/test/functional/services/common/test_subjects.ts index 3f47c6155f1753..09c54af7b8811c 100644 --- a/test/functional/services/common/test_subjects.ts +++ b/test/functional/services/common/test_subjects.ts @@ -7,7 +7,6 @@ */ import testSubjSelector from '@kbn/test-subj-selector'; -import { map as mapAsync } from 'bluebird'; import { WebElementWrapper } from '../lib/web_element_wrapper'; import { FtrService } from '../../ftr_provider_context'; @@ -271,11 +270,11 @@ export class TestSubjects extends FtrService { private async _mapAll( selectorAll: string, - mapFn: (element: WebElementWrapper, index?: number, arrayLength?: number) => Promise + mapFn: (element: WebElementWrapper, index: number, array: WebElementWrapper[]) => Promise ): Promise { return await this.retry.try(async () => { const elements = await this.findAll(selectorAll); - return await mapAsync(elements, mapFn); + return await Promise.all(elements.map(mapFn)); }); } diff --git a/test/functional/services/dashboard/expectations.ts b/test/functional/services/dashboard/expectations.ts index 0a689c0091edc5..d4b462d2a68f47 100644 --- a/test/functional/services/dashboard/expectations.ts +++ b/test/functional/services/dashboard/expectations.ts @@ -155,30 +155,34 @@ export class DashboardExpectService extends FtrService { async emptyTagCloudFound() { this.log.debug(`DashboardExpect.emptyTagCloudFound()`); const tagCloudVisualizations = await this.testSubjects.findAll('tagCloudVisualization'); - const tagCloudsHaveContent = await Promise.all( - tagCloudVisualizations.map(async (tagCloud) => { - return await this.find.descendantExistsByCssSelector('text', tagCloud); - }) - ); - expect(tagCloudsHaveContent.indexOf(false)).to.be.greaterThan(-1); + if (tagCloudVisualizations.length > 0) { + const tagCloudsHaveContent = await Promise.all( + tagCloudVisualizations.map(async (tagCloud) => { + return await this.find.descendantExistsByCssSelector('text', tagCloud); + }) + ); + expect(tagCloudsHaveContent.indexOf(false)).to.be.greaterThan(-1); + } } async tagCloudWithValuesFound(values: string[]) { this.log.debug(`DashboardExpect.tagCloudWithValuesFound(${values})`); const tagCloudVisualizations = await this.testSubjects.findAll('tagCloudVisualization'); - const matches = await Promise.all( - tagCloudVisualizations.map(async (tagCloud) => { - const tagCloudData = await this.tagCloud.getTextTagByElement(tagCloud); - for (let i = 0; i < values.length; i++) { - const valueExists = tagCloudData.includes(values[i]); - if (!valueExists) { - return false; + if (tagCloudVisualizations.length > 0) { + const matches = await Promise.all( + tagCloudVisualizations.map(async (tagCloud) => { + const tagCloudData = await this.tagCloud.getTextTagByElement(tagCloud); + for (let i = 0; i < values.length; i++) { + const valueExists = tagCloudData.includes(values[i]); + if (!valueExists) { + return false; + } } - } - return true; - }) - ); - expect(matches.indexOf(true)).to.be.greaterThan(-1); + return true; + }) + ); + expect(matches.indexOf(true)).to.be.greaterThan(-1); + } } async goalAndGuageLabelsExist(labels: string[]) { @@ -232,6 +236,14 @@ export class DashboardExpectService extends FtrService { }); } + async savedSearchRowsExist() { + this.testSubjects.existOrFail('docTableExpandToggleColumn'); + } + + async savedSearchRowsMissing() { + this.testSubjects.missingOrFail('docTableExpandToggleColumn'); + } + async dataTableRowCount(expectedCount: number) { this.log.debug(`DashboardExpect.dataTableRowCount(${expectedCount})`); await this.retry.try(async () => { diff --git a/test/functional/services/lib/web_element_wrapper/web_element_wrapper.ts b/test/functional/services/lib/web_element_wrapper/web_element_wrapper.ts index 4b164402bfb70a..d4fe5080bdfefb 100644 --- a/test/functional/services/lib/web_element_wrapper/web_element_wrapper.ts +++ b/test/functional/services/lib/web_element_wrapper/web_element_wrapper.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { delay } from 'bluebird'; +import { setTimeout as setTimeoutAsync } from 'timers/promises'; import { WebElement, WebDriver, By, Key } from 'selenium-webdriver'; import { PNG } from 'pngjs'; import cheerio from 'cheerio'; @@ -121,7 +121,7 @@ export class WebElementWrapper { `finding element '${this.locator.toString()}' again, ${attemptsRemaining - 1} attempts left` ); - await delay(200); + await setTimeoutAsync(200); this._webElement = await this.driver.findElement(this.locator); return await this.retryCall(fn, attemptsRemaining - 1); } @@ -240,7 +240,7 @@ export class WebElementWrapper { const value = await this.getAttribute('value'); for (let i = 0; i <= value.length; i++) { await this.pressKeys(this.Keys.BACK_SPACE); - await delay(100); + await setTimeoutAsync(100); } } else { if (this.isChromium) { @@ -279,7 +279,7 @@ export class WebElementWrapper { for (const char of value) { await this.retryCall(async function type(wrapper) { await wrapper._webElement.sendKeys(char); - await delay(100); + await setTimeoutAsync(100); }); } } else { diff --git a/test/functional/services/monaco_editor.ts b/test/functional/services/monaco_editor.ts index 63a5a7105ddb8a..821c334b01c090 100644 --- a/test/functional/services/monaco_editor.ts +++ b/test/functional/services/monaco_editor.ts @@ -13,6 +13,11 @@ export class MonacoEditorService extends FtrService { private readonly browser = this.ctx.getService('browser'); private readonly testSubjects = this.ctx.getService('testSubjects'); + public async waitCodeEditorReady(containerTestSubjId: string) { + const editorContainer = await this.testSubjects.find(containerTestSubjId); + await editorContainer.findByCssSelector('textarea'); + } + public async getCodeEditorValue(nthIndex: number = 0) { let values: string[] = []; @@ -31,7 +36,7 @@ export class MonacoEditorService extends FtrService { public async typeCodeEditorValue(value: string, testSubjId: string) { const editor = await this.testSubjects.find(testSubjId); const textarea = await editor.findByCssSelector('textarea'); - textarea.type(value); + await textarea.type(value); } public async setCodeEditorValue(value: string, nthIndex = 0) { diff --git a/test/interactive_setup_api_integration/fixtures/test_helpers.ts b/test/interactive_setup_api_integration/fixtures/test_helpers.ts index f1e72785af02d6..6001f12b0a5519 100644 --- a/test/interactive_setup_api_integration/fixtures/test_helpers.ts +++ b/test/interactive_setup_api_integration/fixtures/test_helpers.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { delay } from 'bluebird'; +import { setTimeout as setTimeoutAsync } from 'timers/promises'; import expect from '@kbn/expect'; @@ -19,7 +19,7 @@ export async function hasKibanaBooted(context: FtrProviderContext) { // Run 30 consecutive requests with 1.5s delay to check if Kibana is up and running. let kibanaHasBooted = false; for (const counter of [...Array(30).keys()]) { - await delay(1500); + await setTimeoutAsync(1500); try { expect((await supertest.get('/api/status').expect(200)).body).to.have.keys([ diff --git a/x-pack/plugins/alerting/README.md b/x-pack/plugins/alerting/README.md index 343960aee9dfb5..9c4f27fa945be9 100644 --- a/x-pack/plugins/alerting/README.md +++ b/x-pack/plugins/alerting/README.md @@ -75,29 +75,6 @@ To change the schedule for the invalidation task, use the kibana.yml configurati To change the default delay for the API key invalidation, use the kibana.yml configuration option `xpack.alerting.invalidateApiKeysTask.removalDelay`. -## Plugin Status - -The plugin status of the Alerting Framework is customized by including information about checking for failures during framework decryption: - -```js -core.status.set( - combineLatest([ - core.status.derivedStatus$, - getHealthStatusStream(startPlugins.taskManager), - ]).pipe( - map(([derivedStatus, healthStatus]) => { - if (healthStatus.level > derivedStatus.level) { - return healthStatus as ServiceStatus; - } else { - return derivedStatus; - } - }) - ) - ); -``` - -To check for framework decryption failures, we use the task `alerting_health_check`, which runs every 60 minutes by default. To change the default schedule, use the kibana.yml configuration option `xpack.alerting.healthCheck.interval`. - ## Rule Types ### Methods diff --git a/x-pack/plugins/alerting/server/health/get_state.test.ts b/x-pack/plugins/alerting/server/health/get_state.test.ts deleted file mode 100644 index f4306b8250b81b..00000000000000 --- a/x-pack/plugins/alerting/server/health/get_state.test.ts +++ /dev/null @@ -1,328 +0,0 @@ -/* - * 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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { ServiceStatusLevels } from '../../../../../src/core/server'; -import { taskManagerMock } from '../../../task_manager/server/mocks'; -import { - getHealthStatusStream, - getHealthServiceStatusWithRetryAndErrorHandling, - MAX_RETRY_ATTEMPTS, -} from './get_state'; -import { ConcreteTaskInstance, TaskStatus } from '../../../task_manager/server'; -import { HealthStatus } from '../types'; -import { loggingSystemMock, savedObjectsServiceMock } from 'src/core/server/mocks'; - -jest.mock('./get_health', () => ({ - getAlertingHealthStatus: jest.fn().mockReturnValue({ - state: { - runs: 0, - health_status: 'warn', - }, - }), -})); - -const tick = () => new Promise((resolve) => setImmediate(resolve)); - -const getHealthCheckTask = (overrides = {}): ConcreteTaskInstance => ({ - id: 'test', - attempts: 0, - status: TaskStatus.Running, - version: '123', - runAt: new Date(), - scheduledAt: new Date(), - startedAt: new Date(), - retryAt: new Date(Date.now() + 5 * 60 * 1000), - state: { - runs: 1, - health_status: HealthStatus.OK, - }, - taskType: 'alerting:alerting_health_check', - params: { - alertId: '1', - }, - ownerId: null, - ...overrides, -}); - -const logger = loggingSystemMock.create().get(); -const savedObjects = savedObjectsServiceMock.createStartContract(); - -describe('getHealthServiceStatusWithRetryAndErrorHandling', () => { - beforeEach(() => jest.useFakeTimers()); - - it('should get status at each interval', async () => { - const mockTaskManager = taskManagerMock.createStart(); - mockTaskManager.get.mockResolvedValue(getHealthCheckTask()); - const pollInterval = 100; - - getHealthStatusStream( - mockTaskManager, - logger, - savedObjects, - Promise.resolve({ - healthCheck: { - interval: '5m', - }, - invalidateApiKeysTask: { - interval: '5m', - removalDelay: '1h', - }, - maxEphemeralActionsPerAlert: 100, - defaultRuleTaskTimeout: '20m', - }), - pollInterval - ).subscribe(); - - // should fire before poll interval passes - // should fire once each poll interval - expect(mockTaskManager.get).toHaveBeenCalledTimes(1); - jest.advanceTimersByTime(pollInterval); - expect(mockTaskManager.get).toHaveBeenCalledTimes(2); - jest.advanceTimersByTime(pollInterval); - expect(mockTaskManager.get).toHaveBeenCalledTimes(3); - jest.advanceTimersByTime(pollInterval); - expect(mockTaskManager.get).toHaveBeenCalledTimes(4); - }); - - it('should retry on error', async () => { - const mockTaskManager = taskManagerMock.createStart(); - mockTaskManager.get.mockRejectedValue(new Error('Failure')); - const retryDelay = 10; - const pollInterval = 100; - - getHealthStatusStream( - mockTaskManager, - logger, - savedObjects, - Promise.resolve({ - healthCheck: { - interval: '5m', - }, - invalidateApiKeysTask: { - interval: '5m', - removalDelay: '1h', - }, - maxEphemeralActionsPerAlert: 100, - defaultRuleTaskTimeout: '20m', - }), - pollInterval, - retryDelay - ).subscribe(); - - expect(mockTaskManager.get).toHaveBeenCalledTimes(1); - jest.advanceTimersByTime(pollInterval); - expect(mockTaskManager.get).toHaveBeenCalledTimes(2); - - // Retry on failure - let numTimesCalled = 1; - for (let i = 0; i < MAX_RETRY_ATTEMPTS; i++) { - await tick(); - jest.advanceTimersByTime(retryDelay); - expect(mockTaskManager.get).toHaveBeenCalledTimes(numTimesCalled++ + 2); - } - - // Once we've exceeded max retries, should not try again - await tick(); - jest.advanceTimersByTime(retryDelay); - expect(mockTaskManager.get).toHaveBeenCalledTimes(numTimesCalled + 1); - - // Once another poll interval passes, should call fn again - await tick(); - jest.advanceTimersByTime(pollInterval - MAX_RETRY_ATTEMPTS * retryDelay); - expect(mockTaskManager.get).toHaveBeenCalledTimes(numTimesCalled + 2); - }); - - it('should return healthy status when health status is "ok"', async () => { - const mockTaskManager = taskManagerMock.createStart(); - mockTaskManager.get.mockResolvedValue(getHealthCheckTask()); - - const status = await getHealthServiceStatusWithRetryAndErrorHandling( - mockTaskManager, - logger, - savedObjects, - Promise.resolve({ - healthCheck: { - interval: '5m', - }, - invalidateApiKeysTask: { - interval: '5m', - removalDelay: '1h', - }, - maxEphemeralActionsPerAlert: 100, - defaultRuleTaskTimeout: '20m', - }) - ).toPromise(); - - expect(status.level).toEqual(ServiceStatusLevels.available); - expect(status.summary).toEqual('Alerting framework is available'); - }); - - it('should return degraded status when health status is "warn"', async () => { - const mockTaskManager = taskManagerMock.createStart(); - mockTaskManager.get.mockResolvedValue( - getHealthCheckTask({ - state: { - runs: 1, - health_status: HealthStatus.Warning, - }, - }) - ); - - const status = await getHealthServiceStatusWithRetryAndErrorHandling( - mockTaskManager, - logger, - savedObjects, - Promise.resolve({ - healthCheck: { - interval: '5m', - }, - invalidateApiKeysTask: { - interval: '5m', - removalDelay: '1h', - }, - maxEphemeralActionsPerAlert: 100, - defaultRuleTaskTimeout: '20m', - }) - ).toPromise(); - - expect(status.level).toEqual(ServiceStatusLevels.degraded); - expect(status.summary).toEqual('Alerting framework is degraded'); - }); - - it('should return unavailable status when health status is "error"', async () => { - const mockTaskManager = taskManagerMock.createStart(); - mockTaskManager.get.mockResolvedValue( - getHealthCheckTask({ - state: { - runs: 1, - health_status: HealthStatus.Error, - }, - }) - ); - - const status = await getHealthServiceStatusWithRetryAndErrorHandling( - mockTaskManager, - logger, - savedObjects, - Promise.resolve({ - healthCheck: { - interval: '5m', - }, - invalidateApiKeysTask: { - interval: '5m', - removalDelay: '1h', - }, - maxEphemeralActionsPerAlert: 100, - defaultRuleTaskTimeout: '20m', - }) - ).toPromise(); - - expect(status.level).toEqual(ServiceStatusLevels.degraded); - expect(status.summary).toEqual('Alerting framework is degraded'); - expect(status.meta).toBeUndefined(); - }); - - it('should retry on error and return healthy status if retry succeeds', async () => { - const retryDelay = 10; - const mockTaskManager = taskManagerMock.createStart(); - mockTaskManager.get - .mockRejectedValueOnce(new Error('Failure')) - .mockResolvedValue(getHealthCheckTask()); - - getHealthServiceStatusWithRetryAndErrorHandling( - mockTaskManager, - logger, - savedObjects, - Promise.resolve({ - healthCheck: { - interval: '5m', - }, - invalidateApiKeysTask: { - interval: '5m', - removalDelay: '1h', - }, - maxEphemeralActionsPerAlert: 100, - defaultRuleTaskTimeout: '20m', - }), - retryDelay - ).subscribe((status) => { - expect(status.level).toEqual(ServiceStatusLevels.available); - expect(logger.warn).toHaveBeenCalledTimes(1); - expect(status.summary).toEqual('Alerting framework is available'); - }); - - await tick(); - jest.advanceTimersByTime(retryDelay * 2); - }); - - it('should retry on error and return unavailable status if retry fails', async () => { - const retryDelay = 10; - const err = new Error('Failure'); - const mockTaskManager = taskManagerMock.createStart(); - mockTaskManager.get.mockRejectedValue(err); - - getHealthServiceStatusWithRetryAndErrorHandling( - mockTaskManager, - logger, - savedObjects, - Promise.resolve({ - healthCheck: { - interval: '5m', - }, - invalidateApiKeysTask: { - interval: '5m', - removalDelay: '1h', - }, - maxEphemeralActionsPerAlert: 100, - defaultRuleTaskTimeout: '20m', - }), - retryDelay - ).subscribe((status) => { - expect(status.level).toEqual(ServiceStatusLevels.degraded); - expect(status.summary).toEqual('Alerting framework is degraded'); - expect(status.meta).toEqual({ error: err }); - }); - - for (let i = 0; i < MAX_RETRY_ATTEMPTS + 1; i++) { - await tick(); - jest.advanceTimersByTime(retryDelay); - } - expect(mockTaskManager.get).toHaveBeenCalledTimes(MAX_RETRY_ATTEMPTS + 1); - }); - - it('should schedule a new health check task if it does not exist without throwing an error', async () => { - const mockTaskManager = taskManagerMock.createStart(); - mockTaskManager.get.mockRejectedValue({ - output: { - statusCode: 404, - message: 'Not Found', - }, - }); - - const status = await getHealthServiceStatusWithRetryAndErrorHandling( - mockTaskManager, - logger, - savedObjects, - Promise.resolve({ - healthCheck: { - interval: '5m', - }, - invalidateApiKeysTask: { - interval: '5m', - removalDelay: '1h', - }, - maxEphemeralActionsPerAlert: 100, - defaultRuleTaskTimeout: '20m', - }) - ).toPromise(); - - expect(mockTaskManager.ensureScheduled).toHaveBeenCalledTimes(1); - expect(status.level).toEqual(ServiceStatusLevels.degraded); - expect(status.summary).toEqual('Alerting framework is degraded'); - expect(status.meta).toBeUndefined(); - }); -}); diff --git a/x-pack/plugins/alerting/server/health/get_state.ts b/x-pack/plugins/alerting/server/health/get_state.ts deleted file mode 100644 index 34f897ad5b73cb..00000000000000 --- a/x-pack/plugins/alerting/server/health/get_state.ts +++ /dev/null @@ -1,142 +0,0 @@ -/* - * 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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; -import { defer, of, interval, Observable, throwError, timer } from 'rxjs'; -import { catchError, mergeMap, retryWhen, startWith, switchMap } from 'rxjs/operators'; -import { - Logger, - SavedObjectsServiceStart, - ServiceStatus, - ServiceStatusLevels, -} from '../../../../../src/core/server'; -import { TaskManagerStartContract } from '../../../task_manager/server'; -import { HEALTH_TASK_ID, scheduleAlertingHealthCheck } from './task'; -import { HealthStatus } from '../types'; -import { getAlertingHealthStatus } from './get_health'; -import { AlertsConfig } from '../config'; - -export const MAX_RETRY_ATTEMPTS = 3; -const HEALTH_STATUS_INTERVAL = 60000 * 5; // Five minutes -const RETRY_DELAY = 5000; // Wait 5 seconds before retrying on errors - -async function getLatestTaskState( - taskManager: TaskManagerStartContract, - logger: Logger, - savedObjects: SavedObjectsServiceStart, - config: Promise -) { - try { - return await taskManager.get(HEALTH_TASK_ID); - } catch (err) { - // if task is not found - if (err?.output?.statusCode === 404) { - await scheduleAlertingHealthCheck(logger, config, taskManager); - return await getAlertingHealthStatus(savedObjects); - } - throw err; - } -} - -const LEVEL_SUMMARY = { - [ServiceStatusLevels.available.toString()]: i18n.translate( - 'xpack.alerting.server.healthStatus.available', - { - defaultMessage: 'Alerting framework is available', - } - ), - [ServiceStatusLevels.degraded.toString()]: i18n.translate( - 'xpack.alerting.server.healthStatus.degraded', - { - defaultMessage: 'Alerting framework is degraded', - } - ), - [ServiceStatusLevels.unavailable.toString()]: i18n.translate( - 'xpack.alerting.server.healthStatus.unavailable', - { - defaultMessage: 'Alerting framework is unavailable', - } - ), -}; - -const getHealthServiceStatus = async ( - taskManager: TaskManagerStartContract, - logger: Logger, - savedObjects: SavedObjectsServiceStart, - config: Promise -): Promise> => { - const doc = await getLatestTaskState(taskManager, logger, savedObjects, config); - const level = - doc.state?.health_status === HealthStatus.OK - ? ServiceStatusLevels.available - : ServiceStatusLevels.degraded; - return { - level, - summary: LEVEL_SUMMARY[level.toString()], - }; -}; - -export const getHealthServiceStatusWithRetryAndErrorHandling = ( - taskManager: TaskManagerStartContract, - logger: Logger, - savedObjects: SavedObjectsServiceStart, - config: Promise, - retryDelay?: number -): Observable> => { - return defer(() => getHealthServiceStatus(taskManager, logger, savedObjects, config)).pipe( - retryWhen((errors) => { - return errors.pipe( - mergeMap((error, i) => { - const retryAttempt = i + 1; - if (retryAttempt > MAX_RETRY_ATTEMPTS) { - return throwError(error); - } - return timer(retryDelay ?? RETRY_DELAY); - }) - ); - }), - catchError((error) => { - logger.warn(`Alerting framework is degraded due to the error: ${error}`); - return of({ - level: ServiceStatusLevels.degraded, - summary: LEVEL_SUMMARY[ServiceStatusLevels.degraded.toString()], - meta: { error }, - }); - }) - ); -}; - -export const getHealthStatusStream = ( - taskManager: TaskManagerStartContract, - logger: Logger, - savedObjects: SavedObjectsServiceStart, - config: Promise, - healthStatusInterval?: number, - retryDelay?: number -): Observable> => - interval(healthStatusInterval ?? HEALTH_STATUS_INTERVAL).pipe( - // Emit an initial check - startWith( - getHealthServiceStatusWithRetryAndErrorHandling( - taskManager, - logger, - savedObjects, - config, - retryDelay - ) - ), - // On each interval do a new check - switchMap(() => - getHealthServiceStatusWithRetryAndErrorHandling( - taskManager, - logger, - savedObjects, - config, - retryDelay - ) - ) - ); diff --git a/x-pack/plugins/alerting/server/health/index.ts b/x-pack/plugins/alerting/server/health/index.ts index 8ac0e7be6867c2..f7f8e15b6f36f5 100644 --- a/x-pack/plugins/alerting/server/health/index.ts +++ b/x-pack/plugins/alerting/server/health/index.ts @@ -5,5 +5,4 @@ * 2.0. */ -export { getHealthStatusStream } from './get_state'; export { scheduleAlertingHealthCheck, initializeAlertingHealth } from './task'; diff --git a/x-pack/plugins/alerting/server/plugin.ts b/x-pack/plugins/alerting/server/plugin.ts index 982d8907d9b9dd..bd3eab19d220dd 100644 --- a/x-pack/plugins/alerting/server/plugin.ts +++ b/x-pack/plugins/alerting/server/plugin.ts @@ -244,29 +244,6 @@ export class AlertingPlugin { }); core.status.set(serviceStatus$); - // core.getStartServices().then(async ([coreStart, startPlugins]) => { - // combineLatest([ - // core.status.derivedStatus$, - // getHealthStatusStream( - // startPlugins.taskManager, - // this.logger, - // coreStart.savedObjects, - // this.config - // ), - // ]) - // .pipe( - // map(([derivedStatus, healthStatus]) => { - // if (healthStatus.level > derivedStatus.level) { - // return healthStatus as ServiceStatus; - // } else { - // return derivedStatus; - // } - // }), - // share() - // ) - // .subscribe(serviceStatus$); - // }); - initializeAlertingHealth(this.logger, plugins.taskManager, core.getStartServices()); core.http.registerRouteHandlerContext( diff --git a/x-pack/plugins/alerting/server/rules_client/rules_client.ts b/x-pack/plugins/alerting/server/rules_client/rules_client.ts index d8a42aa78d9100..e10af37e0936bb 100644 --- a/x-pack/plugins/alerting/server/rules_client/rules_client.ts +++ b/x-pack/plugins/alerting/server/rules_client/rules_client.ts @@ -377,10 +377,11 @@ export class RulesClient { if (data.enabled) { let scheduledTask; try { - scheduledTask = await this.scheduleAlert( + scheduledTask = await this.scheduleRule( createdAlert.id, rawAlert.alertTypeId, - data.schedule + data.schedule, + true ); } catch (e) { // Cleanup data, something went wrong scheduling the task @@ -1149,10 +1150,11 @@ export class RulesClient { ); throw e; } - const scheduledTask = await this.scheduleAlert( + const scheduledTask = await this.scheduleRule( id, attributes.alertTypeId, - attributes.schedule as IntervalSchedule + attributes.schedule as IntervalSchedule, + false ); await this.unsecuredSavedObjectsClient.update('alert', id, { scheduledTaskId: scheduledTask.id, @@ -1563,9 +1565,15 @@ export class RulesClient { return this.spaceId; } - private async scheduleAlert(id: string, alertTypeId: string, schedule: IntervalSchedule) { - return await this.taskManager.schedule({ - taskType: `alerting:${alertTypeId}`, + private async scheduleRule( + id: string, + ruleTypeId: string, + schedule: IntervalSchedule, + throwOnConflict: boolean // whether to throw conflict errors or swallow them + ) { + const taskInstance = { + id, // use the same ID for task document as the rule + taskType: `alerting:${ruleTypeId}`, schedule, params: { alertId: id, @@ -1577,7 +1585,15 @@ export class RulesClient { alertInstances: {}, }, scope: ['alerting'], - }); + }; + try { + return await this.taskManager.schedule(taskInstance); + } catch (err) { + if (err.statusCode === 409 && !throwOnConflict) { + return taskInstance; + } + throw err; + } } private injectReferencesIntoActions( diff --git a/x-pack/plugins/alerting/server/rules_client/tests/create.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/create.test.ts index fc8f272702e0d3..aa8ecfd73bb611 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/create.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/create.test.ts @@ -441,6 +441,7 @@ describe('create()', () => { expect(taskManager.schedule.mock.calls[0]).toMatchInlineSnapshot(` Array [ Object { + "id": "1", "params": Object { "alertId": "1", "spaceId": "default", @@ -1923,6 +1924,52 @@ describe('create()', () => { }); }); + test('fails if task scheduling fails due to conflict', async () => { + const data = getMockData(); + unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ + id: '1', + type: 'alert', + attributes: { + alertTypeId: '123', + schedule: { interval: '10s' }, + params: { + bar: true, + }, + actions: [ + { + group: 'default', + actionRef: 'action_0', + actionTypeId: 'test', + params: { + foo: true, + }, + }, + ], + }, + references: [ + { + name: 'action_0', + type: 'action', + id: '1', + }, + ], + }); + taskManager.schedule.mockRejectedValueOnce( + Object.assign(new Error('Conflict!'), { statusCode: 409 }) + ); + unsecuredSavedObjectsClient.delete.mockResolvedValueOnce({}); + await expect(rulesClient.create({ data })).rejects.toThrowErrorMatchingInlineSnapshot( + `"Conflict!"` + ); + expect(unsecuredSavedObjectsClient.delete).toHaveBeenCalledTimes(1); + expect(unsecuredSavedObjectsClient.delete.mock.calls[0]).toMatchInlineSnapshot(` + Array [ + "alert", + "1", + ] + `); + }); + test('attempts to remove saved object if scheduling failed', async () => { const data = getMockData(); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ diff --git a/x-pack/plugins/alerting/server/rules_client/tests/enable.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/enable.test.ts index 5e3f148c2fc116..afa7db98cab083 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/enable.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/enable.test.ts @@ -98,7 +98,7 @@ describe('enable()', () => { }, }); taskManager.schedule.mockResolvedValue({ - id: 'task-123', + id: '1', scheduledAt: new Date(), attempts: 0, status: TaskStatus.Idle, @@ -113,27 +113,6 @@ describe('enable()', () => { }); describe('authorization', () => { - beforeEach(() => { - encryptedSavedObjects.getDecryptedAsInternalUser.mockResolvedValue(existingAlert); - unsecuredSavedObjectsClient.get.mockResolvedValue(existingAlert); - rulesClientParams.createAPIKey.mockResolvedValue({ - apiKeysEnabled: false, - }); - taskManager.schedule.mockResolvedValue({ - id: 'task-123', - scheduledAt: new Date(), - attempts: 0, - status: TaskStatus.Idle, - runAt: new Date(), - state: {}, - params: {}, - taskType: '', - startedAt: null, - retryAt: null, - ownerId: null, - }); - }); - test('ensures user is authorised to enable this type of alert under the consumer', async () => { await rulesClient.enable({ id: '1' }); @@ -203,7 +182,7 @@ describe('enable()', () => { }); }); - test('enables an alert', async () => { + test('enables a rule', async () => { const createdAt = new Date().toISOString(); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ ...existingAlert, @@ -270,6 +249,7 @@ describe('enable()', () => { } ); expect(taskManager.schedule).toHaveBeenCalledWith({ + id: '1', taskType: `alerting:myType`, params: { alertId: '1', @@ -286,7 +266,7 @@ describe('enable()', () => { scope: ['alerting'], }); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledWith('alert', '1', { - scheduledTaskId: 'task-123', + scheduledTaskId: '1', }); }); @@ -477,4 +457,95 @@ describe('enable()', () => { expect(rulesClientParams.createAPIKey).toHaveBeenCalled(); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalled(); }); + + test('enables a rule if conflict errors received when scheduling a task', async () => { + const createdAt = new Date().toISOString(); + unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ + ...existingAlert, + attributes: { + ...existingAlert.attributes, + enabled: true, + apiKey: null, + apiKeyOwner: null, + updatedBy: 'elastic', + }, + }); + unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ + id: '1', + type: 'api_key_pending_invalidation', + attributes: { + apiKeyId: '123', + createdAt, + }, + references: [], + }); + taskManager.schedule.mockRejectedValueOnce( + Object.assign(new Error('Conflict!'), { statusCode: 409 }) + ); + + await rulesClient.enable({ id: '1' }); + expect(unsecuredSavedObjectsClient.get).not.toHaveBeenCalled(); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { + namespace: 'default', + }); + expect(unsecuredSavedObjectsClient.create).not.toBeCalledWith('api_key_pending_invalidation'); + expect(rulesClientParams.createAPIKey).toHaveBeenCalled(); + expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledWith( + 'alert', + '1', + { + schedule: { interval: '10s' }, + alertTypeId: 'myType', + consumer: 'myApp', + enabled: true, + meta: { + versionApiKeyLastmodified: kibanaVersion, + }, + updatedAt: '2019-02-12T21:01:22.479Z', + updatedBy: 'elastic', + apiKey: null, + apiKeyOwner: null, + actions: [ + { + group: 'default', + id: '1', + actionTypeId: '1', + actionRef: '1', + params: { + foo: true, + }, + }, + ], + executionStatus: { + status: 'pending', + lastDuration: 0, + lastExecutionDate: '2019-02-12T21:01:22.479Z', + error: null, + }, + }, + { + version: '123', + } + ); + expect(taskManager.schedule).toHaveBeenCalledWith({ + id: '1', + taskType: `alerting:myType`, + params: { + alertId: '1', + spaceId: 'default', + }, + schedule: { + interval: '10s', + }, + state: { + alertInstances: {}, + alertTypeState: {}, + previousStartedAt: null, + }, + scope: ['alerting'], + }); + expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledWith('alert', '1', { + scheduledTaskId: '1', + }); + }); }); diff --git a/x-pack/plugins/apm/public/components/fleet_integration/apm_agents/replace_template_strings.ts b/x-pack/plugins/apm/public/components/fleet_integration/apm_agents/replace_template_strings.ts index 2e0c0da8d0fb72..d36d76d466308d 100644 --- a/x-pack/plugins/apm/public/components/fleet_integration/apm_agents/replace_template_strings.ts +++ b/x-pack/plugins/apm/public/components/fleet_integration/apm_agents/replace_template_strings.ts @@ -16,8 +16,6 @@ export function replaceTemplateStrings( ) { Mustache.parse(text, TEMPLATE_TAGS); return Mustache.render(text, { - curlyOpen: '{', - curlyClose: '}', config: { docs: { base_url: docLinks?.ELASTIC_WEBSITE_URL, diff --git a/x-pack/plugins/apm/public/tutorial/config_agent/commands/django.ts b/x-pack/plugins/apm/public/tutorial/config_agent/commands/django.ts index 97b5f3315bcdbf..18fed9d329cd04 100644 --- a/x-pack/plugins/apm/public/tutorial/config_agent/commands/django.ts +++ b/x-pack/plugins/apm/public/tutorial/config_agent/commands/django.ts @@ -18,7 +18,7 @@ INSTALLED_APPS = ( # ... ) -ELASTIC_APM = {curlyOpen} +ELASTIC_APM = { # ${i18n.translate( 'xpack.apm.tutorial.djangoClient.configure.commands.setRequiredServiceNameComment', { @@ -58,7 +58,7 @@ ELASTIC_APM = {curlyOpen} } )} 'ENVIRONMENT': 'production', -{curlyClose} +} # ${i18n.translate( 'xpack.apm.tutorial.djangoClient.configure.commands.addTracingMiddlewareComment', diff --git a/x-pack/plugins/apm/public/tutorial/config_agent/commands/flask.ts b/x-pack/plugins/apm/public/tutorial/config_agent/commands/flask.ts index e4d7fd188e7c6f..dbcd6f29225c1a 100644 --- a/x-pack/plugins/apm/public/tutorial/config_agent/commands/flask.ts +++ b/x-pack/plugins/apm/public/tutorial/config_agent/commands/flask.ts @@ -25,7 +25,7 @@ apm = ElasticAPM(app) } )} from elasticapm.contrib.flask import ElasticAPM -app.config['ELASTIC_APM'] = {curlyOpen} +app.config['ELASTIC_APM'] = { # ${i18n.translate( 'xpack.apm.tutorial.flaskClient.configure.commands.setRequiredServiceNameComment', { @@ -65,6 +65,6 @@ app.config['ELASTIC_APM'] = {curlyOpen} } )} 'ENVIRONMENT': 'production', -{curlyClose} +} apm = ElasticAPM(app)`; diff --git a/x-pack/plugins/apm/public/tutorial/config_agent/commands/get_commands.test.ts b/x-pack/plugins/apm/public/tutorial/config_agent/commands/get_commands.test.ts index 5dc66e22305248..bb6593ae7acb83 100644 --- a/x-pack/plugins/apm/public/tutorial/config_agent/commands/get_commands.test.ts +++ b/x-pack/plugins/apm/public/tutorial/config_agent/commands/get_commands.test.ts @@ -178,7 +178,7 @@ describe('getCommands', () => { # ... ) - ELASTIC_APM = {curlyOpen} + ELASTIC_APM = { # Set the required service name. Allowed characters: # a-z, A-Z, 0-9, -, _, and space 'SERVICE_NAME': '', @@ -191,7 +191,7 @@ describe('getCommands', () => { # Set the service environment 'ENVIRONMENT': 'production', - {curlyClose} + } # To send performance metrics, add our tracing middleware: MIDDLEWARE = ( @@ -216,7 +216,7 @@ describe('getCommands', () => { # ... ) - ELASTIC_APM = {curlyOpen} + ELASTIC_APM = { # Set the required service name. Allowed characters: # a-z, A-Z, 0-9, -, _, and space 'SERVICE_NAME': '', @@ -229,7 +229,7 @@ describe('getCommands', () => { # Set the service environment 'ENVIRONMENT': 'production', - {curlyClose} + } # To send performance metrics, add our tracing middleware: MIDDLEWARE = ( @@ -254,7 +254,7 @@ describe('getCommands', () => { # or configure to use ELASTIC_APM in your application's settings from elasticapm.contrib.flask import ElasticAPM - app.config['ELASTIC_APM'] = {curlyOpen} + app.config['ELASTIC_APM'] = { # Set the required service name. Allowed characters: # a-z, A-Z, 0-9, -, _, and space 'SERVICE_NAME': '', @@ -267,7 +267,7 @@ describe('getCommands', () => { # Set the service environment 'ENVIRONMENT': 'production', - {curlyClose} + } apm = ElasticAPM(app)" `); @@ -289,7 +289,7 @@ describe('getCommands', () => { # or configure to use ELASTIC_APM in your application's settings from elasticapm.contrib.flask import ElasticAPM - app.config['ELASTIC_APM'] = {curlyOpen} + app.config['ELASTIC_APM'] = { # Set the required service name. Allowed characters: # a-z, A-Z, 0-9, -, _, and space 'SERVICE_NAME': '', @@ -302,7 +302,7 @@ describe('getCommands', () => { # Set the service environment 'ENVIRONMENT': 'production', - {curlyClose} + } apm = ElasticAPM(app)" `); diff --git a/x-pack/plugins/canvas/canvas_plugin_src/elements/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/index.ts index 667854bf3e7e21..b73957b5001968 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/elements/index.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/elements/index.ts @@ -32,6 +32,7 @@ import { verticalBarChart } from './vert_bar_chart'; import { verticalProgressBar } from './vertical_progress_bar'; import { verticalProgressPill } from './vertical_progress_pill'; import { tagCloud } from './tag_cloud'; +import { metricVis } from './metric_vis'; import { SetupInitializer } from '../plugin'; import { ElementFactory } from '../../types'; @@ -73,3 +74,9 @@ export const initializeElements: SetupInitializer = (core, plu ]; return applyElementStrings(specs); }; + +// For testing purpose. Will be removed after exposing `metricVis` element. +export const initializeElementsSpec: SetupInitializer = (core, plugins) => { + const specs = initializeElements(core, plugins); + return [...applyElementStrings([metricVis]), ...specs]; +}; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/elements/metric_vis/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/metric_vis/index.ts new file mode 100644 index 00000000000000..3f01a8ccb3e731 --- /dev/null +++ b/x-pack/plugins/canvas/canvas_plugin_src/elements/metric_vis/index.ts @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { ElementFactory } from '../../../types'; + +export const metricVis: ElementFactory = () => ({ + name: 'metricVis', + displayName: '(New) Metric Vis', + type: 'chart', + help: 'Metric visualization', + icon: 'visMetric', + expression: `filters + | demodata + | head 1 + | metricVis metric={visdimension "percent_uptime"} colorMode="Labels" + | render`, +}); diff --git a/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/__stories__/palette.stories.tsx b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/__stories__/palette.stories.tsx index ed9a47ad974841..27bec267508742 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/__stories__/palette.stories.tsx +++ b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/__stories__/palette.stories.tsx @@ -29,6 +29,7 @@ storiesOf('arguments/Palette', module).add('default', () => ( }} onValueChange={action('onValueChange')} renderError={action('renderError')} + typeInstance={{}} />
)); diff --git a/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/index.ts index dd013116bb8086..c6a220062227e8 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/index.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/index.ts @@ -16,7 +16,7 @@ import { imageUpload } from './image_upload'; // @ts-expect-error untyped local import { number } from './number'; import { numberFormatInitializer } from './number_format'; -import { palette } from './palette'; +import { palette, stopsPalette } from './palette'; // @ts-expect-error untyped local import { percentage } from './percentage'; // @ts-expect-error untyped local @@ -42,6 +42,7 @@ export const args = [ imageUpload, number, palette, + stopsPalette, percentage, range, select, diff --git a/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/palette.tsx b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/palette.tsx deleted file mode 100644 index d01424af3a5846..00000000000000 --- a/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/palette.tsx +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { FC } from 'react'; -import PropTypes from 'prop-types'; -import { get } from 'lodash'; -import { getType } from '@kbn/interpreter/common'; -import { ExpressionAstFunction, ExpressionAstExpression } from 'src/plugins/expressions'; -import { PalettePicker } from '../../../public/components/palette_picker'; -import { templateFromReactComponent } from '../../../public/lib/template_from_react_component'; -import { ArgumentStrings } from '../../../i18n'; -import { identifyPalette, ColorPalette } from '../../../common/lib'; - -const { Palette: strings } = ArgumentStrings; - -interface Props { - onValueChange: (value: ExpressionAstExpression) => void; - argValue: ExpressionAstExpression; - renderError: () => void; - argId?: string; -} - -export const PaletteArgInput: FC = ({ onValueChange, argId, argValue, renderError }) => { - // TODO: This is weird, its basically a reimplementation of what the interpretter would return. - // Probably a better way todo this, and maybe a better way to handle template type objects in general? - const astToPalette = ({ chain }: { chain: ExpressionAstFunction[] }): ColorPalette | null => { - if (chain.length !== 1 || chain[0].function !== 'palette') { - renderError(); - return null; - } - - try { - const colors = chain[0].arguments._.map((astObj) => { - if (getType(astObj) !== 'string') { - renderError(); - } - return astObj; - }) as string[]; - - const gradient = get(chain[0].arguments.gradient, '[0]') as boolean; - const palette = identifyPalette({ colors, gradient }); - - if (palette) { - return palette; - } - - return { - id: 'custom', - label: strings.getCustomPaletteLabel(), - colors, - gradient, - } as any as ColorPalette; - } catch (e) { - renderError(); - } - return null; - }; - - const handleChange = (palette: ColorPalette): void => { - const astObj: ExpressionAstExpression = { - type: 'expression', - chain: [ - { - type: 'function', - function: 'palette', - arguments: { - _: palette.colors, - gradient: [palette.gradient], - }, - }, - ], - }; - - onValueChange(astObj); - }; - - const palette = astToPalette(argValue); - - if (!palette) { - renderError(); - return null; - } - - return ; -}; - -PaletteArgInput.propTypes = { - argId: PropTypes.string, - onValueChange: PropTypes.func.isRequired, - argValue: PropTypes.any.isRequired, - renderError: PropTypes.func, -}; - -export const palette = () => ({ - name: 'palette', - displayName: strings.getDisplayName(), - help: strings.getHelp(), - default: - '{palette #882E72 #B178A6 #D6C1DE #1965B0 #5289C7 #7BAFDE #4EB265 #90C987 #CAE0AB #F7EE55 #F6C141 #F1932D #E8601C #DC050C}', - simpleTemplate: templateFromReactComponent(PaletteArgInput), -}); diff --git a/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/palette/index.tsx b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/palette/index.tsx new file mode 100644 index 00000000000000..2eb756d34fff3c --- /dev/null +++ b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/palette/index.tsx @@ -0,0 +1,8 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { PaletteArgInput, SimplePaletteArgInput, palette, stopsPalette } from './palette'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/palette/palette.tsx b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/palette/palette.tsx new file mode 100644 index 00000000000000..eddefb8dadd2c3 --- /dev/null +++ b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/palette/palette.tsx @@ -0,0 +1,121 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { FC } from 'react'; +import PropTypes from 'prop-types'; +import { ExpressionAstExpression } from 'src/plugins/expressions'; +import { templateFromReactComponent } from '../../../../public/lib/template_from_react_component'; +import { ArgumentStrings } from '../../../../i18n'; +import { ColorPalette } from '../../../../common/lib'; +import { astToPalette } from './utils'; +import { ColorPaletteName, getPaletteType } from './palette_types'; +import { CustomColorPalette } from '../../../../public/components/palette_picker'; + +const { Palette: strings, StopsPalette: stopsPaletteStrings } = ArgumentStrings; + +interface Props { + onValueChange: (value: ExpressionAstExpression) => void; + argValue: ExpressionAstExpression; + renderError: () => void; + argId?: string; + typeInstance: { + options?: { + type?: ColorPaletteName; + }; + }; +} + +export const PaletteArgInput: FC = ({ + onValueChange, + argId, + argValue, + renderError, + typeInstance, +}) => { + const handleChange = (palette: ColorPalette | CustomColorPalette): void => { + let colorStopsPaletteConfig = {}; + if (palette.stops?.length) { + colorStopsPaletteConfig = { + stop: palette.stops, + ...(palette.range ? { range: [palette.range] } : {}), + ...(palette.continuity ? { continuity: [palette.continuity] } : {}), + }; + } + + const astObj: ExpressionAstExpression = { + type: 'expression', + chain: [ + { + type: 'function', + function: 'palette', + arguments: { + _: palette.colors, + gradient: [palette.gradient], + ...colorStopsPaletteConfig, + }, + }, + ], + }; + + onValueChange(astObj); + }; + + const palette = astToPalette(argValue, renderError); + if (!palette) { + renderError(); + return null; + } + + const PalettePicker = getPaletteType(typeInstance.options?.type); + return ; +}; + +export const SimplePaletteArgInput: FC = (props) => { + const { typeInstance } = props; + const { type, ...restOptions } = typeInstance.options ?? {}; + return ( + + ); +}; + +export const StopsPaletteArgInput: FC = (props) => ( + +); + +PaletteArgInput.propTypes = { + argId: PropTypes.string, + onValueChange: PropTypes.func.isRequired, + argValue: PropTypes.any.isRequired, + renderError: PropTypes.func, +}; + +const defaultPaletteOptions = { + default: + '{palette #882E72 #B178A6 #D6C1DE #1965B0 #5289C7 #7BAFDE #4EB265 #90C987 #CAE0AB #F7EE55 #F6C141 #F1932D #E8601C #DC050C}', +}; + +export const palette = () => ({ + name: 'palette', + displayName: strings.getDisplayName(), + help: strings.getHelp(), + simpleTemplate: templateFromReactComponent(SimplePaletteArgInput), + ...defaultPaletteOptions, +}); + +export const stopsPalette = () => ({ + name: 'stops_palette', + help: stopsPaletteStrings.getHelp(), + displayName: stopsPaletteStrings.getDisplayName(), + template: templateFromReactComponent(StopsPaletteArgInput), + ...defaultPaletteOptions, +}); diff --git a/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/palette/palette_types.ts b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/palette/palette_types.ts new file mode 100644 index 00000000000000..8a0ec11af3448c --- /dev/null +++ b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/palette/palette_types.ts @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { PalettePicker, StopsPalettePicker } from '../../../../public/components/palette_picker'; + +const DEFAULT_PALETTE = 'default'; +const STOPS_PALETTE = 'stops'; + +export type ColorPaletteName = typeof DEFAULT_PALETTE | typeof STOPS_PALETTE; + +const paletteTypes = { + [DEFAULT_PALETTE]: PalettePicker, + [STOPS_PALETTE]: StopsPalettePicker, +}; + +export const getPaletteType = (type: ColorPaletteName = DEFAULT_PALETTE) => + paletteTypes[type] ?? paletteTypes[DEFAULT_PALETTE]; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/palette/utils.ts b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/palette/utils.ts new file mode 100644 index 00000000000000..5734bf7ce4f661 --- /dev/null +++ b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/palette/utils.ts @@ -0,0 +1,91 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { getType } from '@kbn/interpreter/common'; +import { ExpressionAstArgument, ExpressionAstFunction } from 'src/plugins/expressions'; +import { identifyPalette, ColorPalette, identifyPartialPalette } from '../../../../common/lib'; +import { ArgumentStrings } from '../../../../i18n'; + +const { Palette: strings } = ArgumentStrings; + +export const CUSTOM_PALETTE = 'custom'; + +interface PaletteParams { + colors: string[]; + gradient: boolean; + stops?: number[]; +} + +export const createCustomPalette = ( + paletteParams: PaletteParams +): ColorPalette => ({ + id: CUSTOM_PALETTE, + label: strings.getCustomPaletteLabel(), + ...paletteParams, +}); + +type UnboxArray = T extends Array ? U : T; + +function reduceElementsWithType( + arr: any[], + arg: ExpressionAstArgument, + type: string, + onError: () => void +) { + if (getType(arg) !== type) { + onError(); + } + return [...arr, arg as UnboxArray]; +} + +// TODO: This is weird, its basically a reimplementation of what the interpretter would return. +// Probably a better way todo this, and maybe a better way to handle template type objects in general? +export const astToPalette = ( + { chain }: { chain: ExpressionAstFunction[] }, + onError: () => void +): ColorPalette | ColorPalette | null => { + if (chain.length !== 1 || chain[0].function !== 'palette') { + onError(); + return null; + } + + const { _, stop: argStops, gradient: argGradient, ...restArgs } = chain[0].arguments ?? {}; + + try { + const colors = + _?.reduce((args, arg) => { + return reduceElementsWithType(args, arg, 'string', onError); + }, []) ?? []; + + const stops = + argStops?.reduce((args, arg) => { + return reduceElementsWithType(args, arg, 'number', onError); + }, []) ?? []; + + const gradient = !!argGradient?.[0]; + const palette = (stops.length ? identifyPartialPalette : identifyPalette)({ colors, gradient }); + const restPreparedArgs = Object.keys(restArgs).reduce< + Record + >((acc, argName) => { + acc[argName] = restArgs[argName]?.length > 1 ? restArgs[argName] : restArgs[argName]?.[0]; + return acc; + }, {}); + + if (palette) { + return { + ...palette, + ...restPreparedArgs, + stops, + }; + } + + return createCustomPalette({ colors, gradient, stops, ...restPreparedArgs }); + } catch (e) { + onError(); + } + return null; +}; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/vis_dimension.tsx b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/vis_dimension.tsx index df75704ababb54..312457b658ad9b 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/vis_dimension.tsx +++ b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/vis_dimension.tsx @@ -31,9 +31,6 @@ const VisDimensionArgInput: React.FC = ({ onValueChange, argId, columns, -}: { - // @todo define types - [key: string]: any; }) => { const [value, setValue] = useState(argValue); const confirm = typeInstance?.options?.confirm; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/uis/datasources/esdocs.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/datasources/esdocs.js index 817851b53c1868..150b7c06168875 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/uis/datasources/esdocs.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/uis/datasources/esdocs.js @@ -5,7 +5,7 @@ * 2.0. */ -import React from 'react'; +import React, { useEffect, useCallback } from 'react'; import PropTypes from 'prop-types'; import { EuiFormRow, @@ -27,13 +27,16 @@ import { DataSourceStrings, LUCENE_QUERY_URL } from '../../../i18n'; const { ESDocs: strings } = DataSourceStrings; const EsdocsDatasource = ({ args, updateArgs, defaultIndex }) => { - const setArg = (name, value) => { - updateArgs && - updateArgs({ - ...args, - ...setSimpleArg(name, value), - }); - }; + const setArg = useCallback( + (name, value) => { + updateArgs && + updateArgs({ + ...args, + ...setSimpleArg(name, value), + }); + }, + [args, updateArgs] + ); // TODO: This is a terrible way of doing defaults. We need to find a way to read the defaults for the function // and set them for the data source UI. @@ -73,6 +76,12 @@ const EsdocsDatasource = ({ args, updateArgs, defaultIndex }) => { const index = getIndex(); + useEffect(() => { + if (getSimpleArg('index', args)[0] !== index) { + setArg('index', index); + } + }, [args, index, setArg]); + const sortOptions = [ { value: 'asc', text: strings.getAscendingOption() }, { value: 'desc', text: strings.getDescendingOption() }, diff --git a/x-pack/plugins/canvas/canvas_plugin_src/uis/models/index.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/models/index.js index 0762f70b198584..8fadc9e2e6c8a8 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/uis/models/index.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/uis/models/index.js @@ -8,5 +8,6 @@ import { pointseries } from './point_series'; import { math } from './math'; import { tagcloud } from './tagcloud'; +import { metricVis } from './metric_vis'; -export const modelSpecs = [pointseries, math, tagcloud]; +export const modelSpecs = [pointseries, math, tagcloud, metricVis]; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/uis/models/metric_vis.ts b/x-pack/plugins/canvas/canvas_plugin_src/uis/models/metric_vis.ts new file mode 100644 index 00000000000000..9796c4553978e2 --- /dev/null +++ b/x-pack/plugins/canvas/canvas_plugin_src/uis/models/metric_vis.ts @@ -0,0 +1,79 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { get } from 'lodash'; + +import { ViewStrings } from '../../../i18n'; +import { getState, getValue } from '../../../public/lib/resolved_arg'; + +const { MetricVis: strings } = ViewStrings; + +export const metricVis = () => ({ + name: 'metricVis', + displayName: strings.getDisplayName(), + args: [ + { + name: 'metric', + displayName: strings.getMetricColumnDisplayName(), + help: strings.getMetricColumnHelp(), + argType: 'vis_dimension', + multi: true, + default: `{visdimension}`, + }, + { + name: 'bucket', + displayName: strings.getBucketColumnDisplayName(), + help: strings.getBucketColumnHelp(), + argType: 'vis_dimension', + default: `{visdimension}`, + }, + { + name: 'palette', + argType: 'stops_palette', + }, + { + name: 'font', + displayName: strings.getFontColumnDisplayName(), + help: strings.getFontColumnHelp(), + argType: 'font', + default: `{font size=60 align="center"}`, + }, + { + name: 'colorMode', + displayName: strings.getColorModeColumnDisplayName(), + help: strings.getColorModeColumnHelp(), + argType: 'select', + default: 'Labels', + options: { + choices: [ + { value: 'None', name: strings.getColorModeNoneOption() }, + { value: 'Labels', name: strings.getColorModeLabelOption() }, + { value: 'Background', name: strings.getColorModeBackgroundOption() }, + ], + }, + }, + { + name: 'showLabels', + displayName: strings.getShowLabelsColumnDisplayName(), + help: strings.getShowLabelsColumnHelp(), + argType: 'toggle', + default: true, + }, + { + name: 'percentageMode', + displayName: strings.getPercentageModeColumnDisplayName(), + help: strings.getPercentageModeColumnHelp(), + argType: 'toggle', + }, + ], + resolve({ context }: any) { + if (getState(context) !== 'ready') { + return { columns: [] }; + } + return { columns: get(getValue(context), 'columns', []) }; + }, +}); diff --git a/x-pack/plugins/canvas/common/lib/palettes.ts b/x-pack/plugins/canvas/common/lib/palettes.ts index e9c2f23b62dfb7..2e7eac1e1a84a2 100644 --- a/x-pack/plugins/canvas/common/lib/palettes.ts +++ b/x-pack/plugins/canvas/common/lib/palettes.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { isEqual } from 'lodash'; +import { difference, isEqual } from 'lodash'; import { LibStrings } from '../../i18n'; const { Palettes: strings } = LibStrings; @@ -19,11 +19,14 @@ export type PaletteID = typeof palettes[number]['id']; * An interface representing a color palette in Canvas, with a textual label and a set of * hex values. */ -export interface ColorPalette { - id: PaletteID; +export interface ColorPalette { + id: PaletteID | AdditionalPaletteID; label: string; colors: string[]; gradient: boolean; + stops?: number[]; + range?: 'number' | 'percent'; + continuity?: 'above' | 'below' | 'all' | 'none'; } // This function allows one to create a strongly-typed palette for inclusion in @@ -52,6 +55,15 @@ export const identifyPalette = ( }); }; +export const identifyPartialPalette = ( + input: Pick +): ColorPalette | undefined => { + return palettes.find((palette) => { + const { colors, gradient } = palette; + return gradient === input.gradient && difference(input.colors, colors).length === 0; + }); +}; + export const paulTor14 = createPalette({ id: 'paul_tor_14', label: 'Paul Tor 14', diff --git a/x-pack/plugins/canvas/i18n/elements/element_strings.test.ts b/x-pack/plugins/canvas/i18n/elements/element_strings.test.ts index 8070e86b7d7fd8..6589bf36cbec5e 100644 --- a/x-pack/plugins/canvas/i18n/elements/element_strings.test.ts +++ b/x-pack/plugins/canvas/i18n/elements/element_strings.test.ts @@ -6,10 +6,10 @@ */ import { getElementStrings } from './element_strings'; -import { initializeElements } from '../../canvas_plugin_src/elements'; +import { initializeElementsSpec } from '../../canvas_plugin_src/elements'; import { coreMock } from '../../../../../src/core/public/mocks'; -const elementSpecs = initializeElements(coreMock.createSetup() as any, {} as any); +const elementSpecs = initializeElementsSpec(coreMock.createSetup() as any, {} as any); describe('ElementStrings', () => { const elementStrings = getElementStrings(); diff --git a/x-pack/plugins/canvas/i18n/elements/element_strings.ts b/x-pack/plugins/canvas/i18n/elements/element_strings.ts index e1540572f4af6a..c97dd1b434d51d 100644 --- a/x-pack/plugins/canvas/i18n/elements/element_strings.ts +++ b/x-pack/plugins/canvas/i18n/elements/element_strings.ts @@ -230,4 +230,12 @@ export const getElementStrings = (): ElementStringDict => ({ defaultMessage: 'Tagcloud visualization', }), }, + metricVis: { + displayName: i18n.translate('xpack.canvas.elements.metricVisDisplayName', { + defaultMessage: '(New) Metric Vis', + }), + help: i18n.translate('xpack.canvas.elements.metricVisHelpText', { + defaultMessage: 'Metric visualization', + }), + }, }); diff --git a/x-pack/plugins/canvas/i18n/ui.ts b/x-pack/plugins/canvas/i18n/ui.ts index 30a09d51ffab40..4856de96885e72 100644 --- a/x-pack/plugins/canvas/i18n/ui.ts +++ b/x-pack/plugins/canvas/i18n/ui.ts @@ -328,6 +328,16 @@ export const ArgumentStrings = { defaultMessage: 'Select column', }), }, + StopsPalette: { + getDisplayName: () => + i18n.translate('xpack.canvas.uis.arguments.stopsPaletteTitle', { + defaultMessage: 'Palette picker with bounds', + }), + getHelp: () => + i18n.translate('xpack.canvas.uis.arguments.stopsPaletteLabel', { + defaultMessage: 'Provides colors for the values, based on the bounds', + }), + }, }; export const DataSourceStrings = { @@ -1273,4 +1283,70 @@ export const ViewStrings = { defaultMessage: 'Bucket dimension configuration', }), }, + MetricVis: { + getDisplayName: () => + i18n.translate('xpack.canvas.uis.views.metricVisTitle', { + defaultMessage: 'Metric Vis', + }), + getMetricColumnDisplayName: () => + i18n.translate('xpack.canvas.uis.views.metricVis.args.metricDisplayName', { + defaultMessage: 'Metric', + }), + getMetricColumnHelp: () => + i18n.translate('xpack.canvas.uis.views.metricVis.args.metricHelp', { + defaultMessage: 'Metric dimension configuration', + }), + getBucketColumnDisplayName: () => + i18n.translate('xpack.canvas.uis.views.metricVis.args.bucketDisplayName', { + defaultMessage: 'Bucket', + }), + getBucketColumnHelp: () => + i18n.translate('xpack.canvas.uis.views.metricVis.args.bucketHelp', { + defaultMessage: 'Bucket dimension configuration', + }), + getFontColumnDisplayName: () => + i18n.translate('xpack.canvas.uis.views.metricVis.args.fontDisplayName', { + defaultMessage: 'Font', + }), + getFontColumnHelp: () => + i18n.translate('xpack.canvas.uis.views.metricVis.args.fontHelp', { + defaultMessage: 'Metric font configuration', + }), + getPercentageModeColumnDisplayName: () => + i18n.translate('xpack.canvas.uis.views.metricVis.args.percentageModeDisplayName', { + defaultMessage: 'Enable percentage mode', + }), + getPercentageModeColumnHelp: () => + i18n.translate('xpack.canvas.uis.views.metricVis.args.percentageModeHelp', { + defaultMessage: 'Shows metric in percentage mode.', + }), + getShowLabelsColumnDisplayName: () => + i18n.translate('xpack.canvas.uis.views.metricVis.args.showLabelsDisplayName', { + defaultMessage: 'Show metric labels', + }), + getShowLabelsColumnHelp: () => + i18n.translate('xpack.canvas.uis.views.metricVis.args.showLabelsHelp', { + defaultMessage: 'Shows labels under the metric values.', + }), + getColorModeColumnDisplayName: () => + i18n.translate('xpack.canvas.uis.views.metricVis.args.colorModeDisplayName', { + defaultMessage: 'Metric color mode', + }), + getColorModeColumnHelp: () => + i18n.translate('xpack.canvas.uis.views.metricVis.args.colorModeHelp', { + defaultMessage: 'Which part of metric to fill with color.', + }), + getColorModeNoneOption: () => + i18n.translate('xpack.canvas.uis.views.metricVis.args.colorMode.noneOption', { + defaultMessage: 'None', + }), + getColorModeLabelOption: () => + i18n.translate('xpack.canvas.uis.views.metricVis.args.colorMode.labelsOption', { + defaultMessage: 'Labels', + }), + getColorModeBackgroundOption: () => + i18n.translate('xpack.canvas.uis.views.metricVis.args.colorMode.backgroundOption', { + defaultMessage: 'Background', + }), + }, }; diff --git a/x-pack/plugins/canvas/public/components/arg_form/arg_form.js b/x-pack/plugins/canvas/public/components/arg_form/arg_form.js index 1e79b8152c9d1e..0bbac0e4dd25d4 100644 --- a/x-pack/plugins/canvas/public/components/arg_form/arg_form.js +++ b/x-pack/plugins/canvas/public/components/arg_form/arg_form.js @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useRef, useEffect } from 'react'; +import React, { useRef, useEffect, useState } from 'react'; import PropTypes from 'prop-types'; import { ErrorBoundary } from '../enhance/error_boundary'; import { ArgSimpleForm } from './arg_simple_form'; @@ -39,11 +39,9 @@ export const ArgForm = (props) => { onValueRemove, workpad, assets, - renderError, - setRenderError, resolvedArgValue, } = props; - + const [renderError, setRenderError] = useState(false); const isMounted = useRef(); useEffect(() => { @@ -62,21 +60,15 @@ export const ArgForm = (props) => { {({ error, resetErrorState }) => { const { template, simpleTemplate } = argTypeInstance.argType; const hasError = Boolean(error) || renderError; - const argumentProps = { ...templateProps, resolvedArgValue, defaultValue: argTypeInstance.default, renderError: () => { - // TODO: don't do this - // It's an ugly hack to avoid React's render cycle and ensure the error happens on the next tick - // This is important; Otherwise we end up updating state in the middle of a render cycle - Promise.resolve().then(() => { - // Provide templates with a renderError method, and wrap the error in a known error type - // to stop Kibana's window.error from being called - isMounted.current && setRenderError(true); - }); + // Provide templates with a renderError method, and wrap the error in a known error type + // to stop Kibana's window.error from being called + isMounted.current && setRenderError(true); }, error: hasError, setLabel: (label) => isMounted.current && setLabel(label), @@ -154,7 +146,5 @@ ArgForm.propTypes = { expand: PropTypes.bool, setExpand: PropTypes.func, onValueRemove: PropTypes.func, - renderError: PropTypes.bool.isRequired, - setRenderError: PropTypes.func.isRequired, resolvedArgValue: PropTypes.any, }; diff --git a/x-pack/plugins/canvas/public/components/arg_form/arg_template_form.tsx b/x-pack/plugins/canvas/public/components/arg_form/arg_template_form.tsx index aec68993df98cb..172b3f1a590e69 100644 --- a/x-pack/plugins/canvas/public/components/arg_form/arg_template_form.tsx +++ b/x-pack/plugins/canvas/public/components/arg_form/arg_template_form.tsx @@ -7,14 +7,17 @@ import React, { useState, useEffect, useCallback, useRef } from 'react'; import usePrevious from 'react-use/lib/usePrevious'; +import useEffectOnce from 'react-use/lib/useEffectOnce'; import { RenderToDom } from '../render_to_dom'; import { ExpressionFormHandlers } from '../../../common/lib/expression_form_handlers'; +import { UpdatePropsRef } from '../../../types/arguments'; interface ArgTemplateFormProps { template?: ( domNode: HTMLElement, config: ArgTemplateFormProps['argumentProps'], - handlers: ArgTemplateFormProps['handlers'] + handlers: ArgTemplateFormProps['handlers'], + onMount?: (ref: UpdatePropsRef | null) => void ) => void; argumentProps: { valueMissing?: boolean; @@ -42,11 +45,27 @@ export const ArgTemplateForm: React.FunctionComponent = ({ errorTemplate, }) => { const [updatedHandlers, setHandlers] = useState(mergeWithFormHandlers(handlers)); - const previousError = usePrevious(error); + const [mounted, setMounted] = useState(false); + const prevError = usePrevious(error); + const prevMounted = usePrevious(mounted); + const mountedArgumentRef = useRef>(); + const domNodeRef = useRef(); + + useEffectOnce(() => () => { + mountedArgumentRef.current = undefined; + }); + const renderTemplate = useCallback( - (domNode) => template && template(domNode, argumentProps, updatedHandlers), - [template, argumentProps, updatedHandlers] + (domNode) => + template && + template(domNode, argumentProps, updatedHandlers, (ref) => { + if (!mountedArgumentRef.current && ref) { + mountedArgumentRef.current = ref; + setMounted(true); + } + }), + [argumentProps, template, updatedHandlers] ); const renderErrorTemplate = useCallback( @@ -59,22 +78,30 @@ export const ArgTemplateForm: React.FunctionComponent = ({ }, [handlers]); useEffect(() => { - if (previousError !== error) { + if (!prevError && error) { updatedHandlers.destroy(); } - }, [previousError, error, updatedHandlers]); + }, [prevError, error, updatedHandlers]); useEffect(() => { - if (!error) { + if ((!error && prevError && mounted) || (mounted && !prevMounted && !error)) { renderTemplate(domNodeRef.current); } - }, [error, renderTemplate, domNodeRef]); + }, [error, mounted, prevError, prevMounted, renderTemplate]); + + useEffect(() => { + if (mountedArgumentRef.current) { + mountedArgumentRef.current?.updateProps(argumentProps); + } + }, [argumentProps]); if (error) { + mountedArgumentRef.current = undefined; return renderErrorTemplate(); } if (!template) { + mountedArgumentRef.current = undefined; return null; } @@ -82,7 +109,7 @@ export const ArgTemplateForm: React.FunctionComponent = ({ { domNodeRef.current = domNode; - renderTemplate(domNode); + setMounted(true); }} /> ); diff --git a/x-pack/plugins/canvas/public/components/arg_form/index.js b/x-pack/plugins/canvas/public/components/arg_form/index.js index 5dbc6c33db7068..4ba510c1205523 100644 --- a/x-pack/plugins/canvas/public/components/arg_form/index.js +++ b/x-pack/plugins/canvas/public/components/arg_form/index.js @@ -19,12 +19,10 @@ export const ArgForm = (props) => { const { argTypeInstance, label: labelFromProps, templateProps } = props; const [label, setLabel] = useState(getLabel(labelFromProps, argTypeInstance)); const [resolvedArgValue, setResolvedArgValue] = useState(null); - const [renderError, setRenderError] = useState(false); const workpad = useSelector(getWorkpadInfo); const assets = useSelector(getAssets); useEffect(() => { - setRenderError(false); setResolvedArgValue(); }, [templateProps?.argValue]); @@ -37,8 +35,6 @@ export const ArgForm = (props) => { setLabel={setLabel} resolvedArgValue={resolvedArgValue} setResolvedArgValue={setResolvedArgValue} - renderError={renderError} - setRenderError={setRenderError} /> ); }; diff --git a/x-pack/plugins/canvas/public/components/function_form/function_form.tsx b/x-pack/plugins/canvas/public/components/function_form/function_form.tsx index abe31f01051087..491bb6becf9889 100644 --- a/x-pack/plugins/canvas/public/components/function_form/function_form.tsx +++ b/x-pack/plugins/canvas/public/components/function_form/function_form.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FunctionFormComponent } from './function_form_component'; +import { FunctionFormComponent as Component } from './function_form_component'; import { FunctionUnknown } from './function_unknown'; import { FunctionFormContextPending } from './function_form_context_pending'; import { FunctionFormContextError } from './function_form_context_error'; @@ -56,5 +56,5 @@ export const FunctionForm: React.FunctionComponent = (props) ); } - return ; + return ; }; diff --git a/x-pack/plugins/canvas/public/components/function_form/index.tsx b/x-pack/plugins/canvas/public/components/function_form/index.tsx index aff019d1cb69ce..47c6925f6fbbb6 100644 --- a/x-pack/plugins/canvas/public/components/function_form/index.tsx +++ b/x-pack/plugins/canvas/public/components/function_form/index.tsx @@ -6,8 +6,9 @@ */ import React, { useCallback } from 'react'; -import { useDispatch, useSelector } from 'react-redux'; +import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { Ast } from '@kbn/interpreter/common'; +import deepEqual from 'react-fast-compare'; import { ExpressionAstExpression, ExpressionValue, @@ -49,15 +50,21 @@ interface FunctionFormProps { export const FunctionForm: React.FunctionComponent = (props) => { const { expressionIndex, argType, nextArgType } = props; const dispatch = useDispatch(); - const context = useSelector((state) => - getContextForIndex(state, expressionIndex) + const context = useSelector( + (state) => getContextForIndex(state, expressionIndex), + deepEqual ); - const element = useSelector((state) => - getSelectedElement(state) + const element = useSelector( + (state) => getSelectedElement(state), + deepEqual ); - const pageId = useSelector((state) => getSelectedPage(state)); - const assets = useSelector((state) => getAssets(state)); - const filterGroups = useSelector((state) => getGlobalFilterGroups(state)); + const pageId = useSelector((state) => getSelectedPage(state), shallowEqual); + const assets = useSelector((state) => getAssets(state), shallowEqual); + const filterGroups = useSelector( + (state) => getGlobalFilterGroups(state), + shallowEqual + ); + const addArgument = useCallback( (argName: string, argValue: string | Ast | null) => () => { dispatch( @@ -131,7 +138,6 @@ export const FunctionForm: React.FunctionComponent = (props) }, [assets, onAssetAddDispatch] ); - return ( - i18n.translate('xpack.canvas.palettePicker.emptyPaletteLabel', { - defaultMessage: 'None', - }), - getNoPaletteFoundErrorTitle: () => - i18n.translate('xpack.canvas.palettePicker.noPaletteFoundErrorTitle', { - defaultMessage: 'Color palette not found', - }), -}; - -interface RequiredProps { - id?: string; - onChange?: (palette: ColorPalette) => void; - palette: ColorPalette; - clearable?: false; -} - -interface ClearableProps { - id?: string; - onChange?: (palette: ColorPalette | null) => void; - palette: ColorPalette | null; - clearable: true; -} - -type Props = RequiredProps | ClearableProps; - -const findPalette = (colorPalette: ColorPalette | null, colorPalettes: ColorPalette[] = []) => { - const palette = colorPalettes.filter((cp) => cp.id === colorPalette?.id)[0] ?? null; - if (palette === null) { - return colorPalettes.filter((cp) => isEqual(cp.colors, colorPalette?.colors))[0] ?? null; - } - - return palette; -}; - -export const PalettePicker: FC = (props) => { - const colorPalettes: EuiColorPalettePickerPaletteProps[] = palettes.map((item) => ({ - value: item.id, - title: item.label, - type: item.gradient ? 'gradient' : 'fixed', - palette: item.colors, - })); - - if (props.clearable) { - const { palette, onChange = () => {} } = props; - - colorPalettes.unshift({ - value: 'clear', - title: strings.getEmptyPaletteLabel(), - type: 'text', - }); - - const onPickerChange = (value: string) => { - const canvasPalette = palettes.find((item) => item.id === value); - onChange(canvasPalette || null); - }; - - const foundPalette = findPalette(palette, palettes); - - return ( - - ); - } - - const { palette, onChange = () => {} } = props; - - const onPickerChange = (value: string) => { - const canvasPalette = palettes.find((item) => item.id === value); - - if (!canvasPalette) { - throw new Error(strings.getNoPaletteFoundErrorTitle()); - } - - onChange(canvasPalette); - }; - - const foundPalette = findPalette(palette, palettes); - - return ( - - ); -}; - -PalettePicker.propTypes = { - id: PropTypes.string, - palette: PropTypes.object, - onChange: PropTypes.func, - clearable: PropTypes.bool, -}; diff --git a/x-pack/plugins/canvas/public/components/palette_picker/__stories__/__snapshots__/palette_picker.stories.storyshot b/x-pack/plugins/canvas/public/components/palette_picker/palette_picker/__stories__/__snapshots__/palette_picker.stories.storyshot similarity index 100% rename from x-pack/plugins/canvas/public/components/palette_picker/__stories__/__snapshots__/palette_picker.stories.storyshot rename to x-pack/plugins/canvas/public/components/palette_picker/palette_picker/__stories__/__snapshots__/palette_picker.stories.storyshot diff --git a/x-pack/plugins/canvas/public/components/palette_picker/__stories__/palette_picker.stories.tsx b/x-pack/plugins/canvas/public/components/palette_picker/palette_picker/__stories__/palette_picker.stories.tsx similarity index 76% rename from x-pack/plugins/canvas/public/components/palette_picker/__stories__/palette_picker.stories.tsx rename to x-pack/plugins/canvas/public/components/palette_picker/palette_picker/__stories__/palette_picker.stories.tsx index d097556285a6e5..3c1b5f3537ac09 100644 --- a/x-pack/plugins/canvas/public/components/palette_picker/__stories__/palette_picker.stories.tsx +++ b/x-pack/plugins/canvas/public/components/palette_picker/palette_picker/__stories__/palette_picker.stories.tsx @@ -8,12 +8,13 @@ import React, { FC, useState } from 'react'; import { action } from '@storybook/addon-actions'; import { storiesOf } from '@storybook/react'; -import { PalettePicker } from '../palette_picker'; +import { PalettePicker } from '../../palette_picker'; -import { paulTor14, ColorPalette } from '../../../../common/lib/palettes'; +import { paulTor14, ColorPalette } from '../../../../../common/lib/palettes'; +import { CustomColorPalette } from '../../types'; const Interactive: FC = () => { - const [palette, setPalette] = useState(paulTor14); + const [palette, setPalette] = useState(paulTor14); return ; }; diff --git a/x-pack/plugins/canvas/public/components/palette_picker/palette_picker/clearable_palette_picker.tsx b/x-pack/plugins/canvas/public/components/palette_picker/palette_picker/clearable_palette_picker.tsx new file mode 100644 index 00000000000000..1dd4d7355050da --- /dev/null +++ b/x-pack/plugins/canvas/public/components/palette_picker/palette_picker/clearable_palette_picker.tsx @@ -0,0 +1,48 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiColorPalettePicker } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React, { FC } from 'react'; +import { ClearableComponentProps } from '../types'; +import { findPalette, prepareColorPalette } from '../utils'; + +const strings = { + getEmptyPaletteLabel: () => + i18n.translate('xpack.canvas.palettePicker.emptyPaletteLabel', { + defaultMessage: 'None', + }), +}; + +export const ClearablePalettePicker: FC = (props) => { + const { palette, palettes, onChange = () => {} } = props; + const colorPalettes = palettes.map(prepareColorPalette); + + const onPickerChange = (value: string) => { + const canvasPalette = palettes.find((item) => item.id === value); + onChange(canvasPalette || null); + }; + + const foundPalette = findPalette(palette ?? null, palettes); + + return ( + + ); +}; diff --git a/x-pack/plugins/canvas/public/components/palette_picker/palette_picker/default_palette_picker.tsx b/x-pack/plugins/canvas/public/components/palette_picker/palette_picker/default_palette_picker.tsx new file mode 100644 index 00000000000000..c63964075e5b41 --- /dev/null +++ b/x-pack/plugins/canvas/public/components/palette_picker/palette_picker/default_palette_picker.tsx @@ -0,0 +1,45 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiColorPalettePicker } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React, { FC } from 'react'; +import { RequiredComponentProps } from '../types'; +import { findPalette, prepareColorPalette } from '../utils'; + +const strings = { + getNoPaletteFoundErrorTitle: () => + i18n.translate('xpack.canvas.palettePicker.noPaletteFoundErrorTitle', { + defaultMessage: 'Color palette not found', + }), +}; + +export const DefaultPalettePicker: FC = (props) => { + const { palette, palettes, onChange = () => {} } = props; + const colorPalettes = palettes.map(prepareColorPalette); + + const onPickerChange = (value: string) => { + const canvasPalette = palettes.find((item) => item.id === value); + if (!canvasPalette) { + throw new Error(strings.getNoPaletteFoundErrorTitle()); + } + + onChange(canvasPalette); + }; + + const foundPalette = findPalette(palette ?? null, palettes); + + return ( + + ); +}; diff --git a/x-pack/plugins/canvas/public/components/palette_picker/palette_picker/index.ts b/x-pack/plugins/canvas/public/components/palette_picker/palette_picker/index.ts new file mode 100644 index 00000000000000..ac9085abf0a5a2 --- /dev/null +++ b/x-pack/plugins/canvas/public/components/palette_picker/palette_picker/index.ts @@ -0,0 +1,8 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { PalettePicker } from './palette_picker'; diff --git a/x-pack/plugins/canvas/public/components/palette_picker/palette_picker/palette_picker.tsx b/x-pack/plugins/canvas/public/components/palette_picker/palette_picker/palette_picker.tsx new file mode 100644 index 00000000000000..064a9bd217abd9 --- /dev/null +++ b/x-pack/plugins/canvas/public/components/palette_picker/palette_picker/palette_picker.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { FC } from 'react'; +import PropTypes from 'prop-types'; +import { ClearablePalettePicker } from './clearable_palette_picker'; +import { palettes as defaultPalettes } from '../../../../common/lib/palettes'; +import { PalettePickerProps } from '../types'; +import { DefaultPalettePicker } from './default_palette_picker'; + +export const PalettePicker: FC = (props) => { + const { additionalPalettes = [] } = props; + const palettes = [...defaultPalettes, ...additionalPalettes]; + + if (props.clearable) { + return ( + + ); + } + + return ( + + ); +}; + +PalettePicker.propTypes = { + id: PropTypes.string, + palette: PropTypes.object, + onChange: PropTypes.func, + clearable: PropTypes.bool, +}; diff --git a/x-pack/plugins/canvas/public/components/palette_picker/stops_palette_picker/index.ts b/x-pack/plugins/canvas/public/components/palette_picker/stops_palette_picker/index.ts new file mode 100644 index 00000000000000..8782055147c494 --- /dev/null +++ b/x-pack/plugins/canvas/public/components/palette_picker/stops_palette_picker/index.ts @@ -0,0 +1,8 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { StopsPalettePicker } from './stops_palette_picker'; diff --git a/x-pack/plugins/canvas/public/components/palette_picker/stops_palette_picker/stop_color_picker.tsx b/x-pack/plugins/canvas/public/components/palette_picker/stops_palette_picker/stop_color_picker.tsx new file mode 100644 index 00000000000000..6c5ff2923c8d25 --- /dev/null +++ b/x-pack/plugins/canvas/public/components/palette_picker/stops_palette_picker/stop_color_picker.tsx @@ -0,0 +1,133 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + EuiButtonIcon, + EuiColorPicker, + EuiFieldNumber, + EuiFlexGroup, + EuiFlexItem, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React, { FC, useEffect, useState } from 'react'; +import useDebounce from 'react-use/lib/useDebounce'; +import { ColorStop } from '../types'; + +interface Props { + removable?: boolean; + stop?: number; + color?: string; + onDelete: () => void; + onChange: (colorStop: ColorStop) => void; +} + +interface ValidationResult { + color: boolean; + stop: boolean; +} + +const strings = { + getDeleteStopColorLabel: () => + i18n.translate('xpack.canvas.stopsColorPicker.deleteColorStopLabel', { + defaultMessage: 'Delete', + }), +}; + +const isValidColorStop = (colorStop: ColorStop): ValidationResult & { valid: boolean } => { + const valid = !isNaN(colorStop.stop); + return { + valid, + stop: valid, + color: true, + }; +}; + +export const StopColorPicker: FC = (props) => { + const { stop, color, onDelete, onChange, removable = true } = props; + + const [colorStop, setColorStop] = useState({ stop: stop ?? 0, color: color ?? '' }); + const [areValidFields, setAreValidFields] = useState({ + stop: true, + color: true, + }); + + const onChangeInput = (updatedColorStop: ColorStop) => { + setColorStop(updatedColorStop); + }; + + const [, cancel] = useDebounce( + () => { + if (color === colorStop.color && stop === colorStop.stop) { + return; + } + + const { valid, ...validationResult } = isValidColorStop(colorStop); + if (!valid) { + setAreValidFields(validationResult); + return; + } + + onChange(colorStop); + }, + 150, + [colorStop] + ); + + useEffect(() => { + const newColorStop = { stop: stop ?? 0, color: color ?? '' }; + setColorStop(newColorStop); + + const { valid, ...validationResult } = isValidColorStop(newColorStop); + setAreValidFields(validationResult); + }, [color, stop]); + + useEffect(() => { + return () => { + cancel(); + }; + }, [cancel]); + + return ( + + + + onChangeInput({ ...colorStop, stop: valueAsNumber }) + } + isInvalid={!areValidFields.stop} + /> + + + + { + onChangeInput({ ...colorStop, color: newColor }); + }} + isInvalid={!areValidFields.color} + /> + + + + + + + ); +}; diff --git a/x-pack/plugins/canvas/public/components/palette_picker/stops_palette_picker/stops_palette_picker.tsx b/x-pack/plugins/canvas/public/components/palette_picker/stops_palette_picker/stops_palette_picker.tsx new file mode 100644 index 00000000000000..aab48528770cb6 --- /dev/null +++ b/x-pack/plugins/canvas/public/components/palette_picker/stops_palette_picker/stops_palette_picker.tsx @@ -0,0 +1,147 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { FC, useCallback, useMemo } from 'react'; +import { flowRight, identity } from 'lodash'; +import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiSpacer } from '@elastic/eui'; +import useEffectOnce from 'react-use/lib/useEffectOnce'; +import { i18n } from '@kbn/i18n'; +import { ColorStop, CustomColorPalette, StopsPalettePickerProps } from '../types'; +import { PalettePicker } from '../palette_picker'; +import { StopColorPicker } from './stop_color_picker'; +import { Palette } from './types'; +import { + reduceColorsByStopsSize, + transformPaletteToColorStops, + mergeColorStopsWithPalette, + deleteColorStop, + updateColorStop, + addNewColorStop, + getOverridenPaletteOptions, +} from './utils'; +import { ColorPalette } from '../../../../common/lib/palettes'; + +const strings = { + getAddColorStopLabel: () => + i18n.translate('xpack.canvas.stopsPalettePicker.addColorStopLabel', { + defaultMessage: 'Add color stop', + }), + getColorStopsLabel: () => + i18n.translate('xpack.canvas.stopsPalettePicker.colorStopsLabel', { + defaultMessage: 'Color stops', + }), +}; + +const defaultStops = [0, 1]; +const MIN_STOPS = 2; + +export const StopsPalettePicker: FC = (props) => { + const { palette, onChange } = props; + const stops = useMemo( + () => (!palette?.stops || !palette.stops.length ? defaultStops : palette.stops), + [palette?.stops] + ); + + const colors = useMemo( + () => reduceColorsByStopsSize(palette?.colors, stops.length), + [palette?.colors, stops.length] + ); + + const onChangePalette = useCallback( + (newPalette: ColorPalette | CustomColorPalette | null) => { + if (newPalette) { + const newColors = reduceColorsByStopsSize(newPalette?.colors, stops.length); + props.onChange?.({ + ...palette, + ...newPalette, + colors: newColors, + stops, + }); + } + }, + [palette, props, stops] + ); + + useEffectOnce(() => { + onChangePalette({ ...getOverridenPaletteOptions(), ...palette }); + }); + + const paletteColorStops = useMemo( + () => transformPaletteToColorStops({ stops, colors }), + [colors, stops] + ); + + const updatePalette = useCallback( + (fn: (colorStops: ColorStop[]) => ColorStop[]) => + flowRight( + onChange ?? identity, + mergeColorStopsWithPalette(palette), + fn + ), + [onChange, palette] + ); + + const deleteColorStopAndApply = useCallback( + (index: number) => updatePalette(deleteColorStop(index))(paletteColorStops), + [paletteColorStops, updatePalette] + ); + + const updateColorStopAndApply = useCallback( + (index: number, colorStop: ColorStop) => + updatePalette(updateColorStop(index, colorStop))(paletteColorStops), + [paletteColorStops, updatePalette] + ); + + const addColorStopAndApply = useCallback( + () => updatePalette(addNewColorStop(palette))(paletteColorStops), + [palette, paletteColorStops, updatePalette] + ); + + const stopColorPickers = paletteColorStops.map(({ id, ...rest }, index) => ( + + = MIN_STOPS} + onDelete={() => deleteColorStopAndApply(index)} + onChange={(cp: ColorStop) => updateColorStopAndApply(index, cp)} + /> + + )); + + return ( + <> + + + + + + + {stopColorPickers} + + + + + + + {strings.getAddColorStopLabel()} + + + ); +}; diff --git a/x-pack/plugins/canvas/public/components/palette_picker/stops_palette_picker/types.ts b/x-pack/plugins/canvas/public/components/palette_picker/stops_palette_picker/types.ts new file mode 100644 index 00000000000000..fab6fd218608d6 --- /dev/null +++ b/x-pack/plugins/canvas/public/components/palette_picker/stops_palette_picker/types.ts @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { CustomColorPalette } from '../types'; +import { ColorPalette } from '../../../../common/lib/palettes'; + +export type Palette = ColorPalette | CustomColorPalette; +export type PaletteColorStops = Pick; diff --git a/x-pack/plugins/canvas/public/components/palette_picker/stops_palette_picker/utils.ts b/x-pack/plugins/canvas/public/components/palette_picker/stops_palette_picker/utils.ts new file mode 100644 index 00000000000000..0dad7f7c3abe38 --- /dev/null +++ b/x-pack/plugins/canvas/public/components/palette_picker/stops_palette_picker/utils.ts @@ -0,0 +1,82 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { zip, take } from 'lodash'; +import { htmlIdGenerator } from '@elastic/eui'; +import { ColorPalette } from '../../../../common/lib'; +import { ColorStop } from '../types'; +import { Palette, PaletteColorStops } from './types'; + +const id = htmlIdGenerator(); + +export const getOverridenPaletteOptions = (): Pick => ({ + range: 'number', + continuity: 'below', +}); + +export const createColorStop = (stop: number = 0, color: string = '') => ({ + stop, + color, + id: id(), +}); + +export const transformPaletteToColorStops = ({ stops = [], colors }: PaletteColorStops) => + zip(stops, colors).map(([stop, color]) => createColorStop(stop, color)); + +export const mergeColorStopsWithPalette = + (palette: Palette) => + (colorStops: ColorStop[]): Palette => { + const stopsWithColors = colorStops.reduce<{ colors: string[]; stops: number[] }>( + (acc, { color, stop }) => { + acc.colors.push(color ?? ''); + acc.stops.push(stop); + return acc; + }, + { colors: [], stops: [] } + ); + return { ...palette, ...stopsWithColors }; + }; + +export const updateColorStop = + (index: number, colorStop: ColorStop) => (colorStops: ColorStop[]) => { + colorStops.splice(index, 1, colorStop); + return colorStops; + }; + +export const deleteColorStop = (index: number) => (colorStops: ColorStop[]) => { + colorStops.splice(index, 1); + return colorStops; +}; + +export const addNewColorStop = (palette: Palette) => (colorStops: ColorStop[]) => { + const lastColorStopIndex = colorStops.length - 1; + const lastStop = lastColorStopIndex >= 0 ? colorStops[lastColorStopIndex].stop + 1 : 0; + const newIndex = lastColorStopIndex + 1; + return [ + ...colorStops, + { + stop: lastStop, + color: + palette.colors.length > newIndex + 1 + ? palette.colors[newIndex] + : palette.colors[palette.colors.length - 1], + }, + ]; +}; + +export const reduceColorsByStopsSize = (colors: string[] = [], stopsSize: number) => { + const reducedColors = take(colors, stopsSize); + const colorsLength = reducedColors.length; + if (colorsLength === stopsSize) { + return reducedColors; + } + + return [ + ...reducedColors, + ...Array(stopsSize - colorsLength).fill(reducedColors[colorsLength - 1] ?? ''), + ]; +}; diff --git a/x-pack/plugins/canvas/public/components/palette_picker/types.ts b/x-pack/plugins/canvas/public/components/palette_picker/types.ts new file mode 100644 index 00000000000000..f297c0064a2651 --- /dev/null +++ b/x-pack/plugins/canvas/public/components/palette_picker/types.ts @@ -0,0 +1,43 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ColorPalette } from '../../../common/lib/palettes'; + +export type CustomColorPalette = ColorPalette<'custom'>; + +export interface RequiredProps { + id?: string; + onChange?: (palette: ColorPalette | CustomColorPalette) => void; + palette: ColorPalette | CustomColorPalette; + clearable?: false; + additionalPalettes?: Array; +} + +export interface ClearableProps { + id?: string; + onChange?: (palette: ColorPalette | CustomColorPalette | null) => void; + palette: ColorPalette | CustomColorPalette | null; + clearable: true; + additionalPalettes?: Array; +} + +export type PalettePickerProps = RequiredProps | ClearableProps; +export type StopsPalettePickerProps = RequiredProps; + +export type ClearableComponentProps = { + palettes: Array; +} & Partial> & + Pick; + +export type RequiredComponentProps = { + palettes: Array; +} & Partial>; + +export interface ColorStop { + color: string; + stop: number; +} diff --git a/x-pack/plugins/canvas/public/components/palette_picker/utils.ts b/x-pack/plugins/canvas/public/components/palette_picker/utils.ts new file mode 100644 index 00000000000000..57d9220069ffdf --- /dev/null +++ b/x-pack/plugins/canvas/public/components/palette_picker/utils.ts @@ -0,0 +1,34 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { EuiColorPalettePickerPaletteProps } from '@elastic/eui'; +import { isEqual } from 'lodash'; +import { ColorPalette } from '../../../common/lib/palettes'; +import { CustomColorPalette } from './types'; + +export const findPalette = ( + colorPalette: ColorPalette | CustomColorPalette | null, + colorPalettes: Array = [] +) => { + const palette = colorPalettes.filter((cp) => cp.id === colorPalette?.id)[0] ?? null; + if (palette === null) { + return colorPalettes.filter((cp) => isEqual(cp.colors, colorPalette?.colors))[0] ?? null; + } + + return palette; +}; + +export const prepareColorPalette = ({ + id, + label, + gradient, + colors, +}: ColorPalette | CustomColorPalette): EuiColorPalettePickerPaletteProps => ({ + value: id, + title: label, + type: gradient ? 'gradient' : 'fixed', + palette: colors, +}); diff --git a/x-pack/plugins/canvas/public/components/sidebar/element_settings/element_settings.component.tsx b/x-pack/plugins/canvas/public/components/sidebar/element_settings/element_settings.component.tsx index e8f2c7a559f581..a912668d914320 100644 --- a/x-pack/plugins/canvas/public/components/sidebar/element_settings/element_settings.component.tsx +++ b/x-pack/plugins/canvas/public/components/sidebar/element_settings/element_settings.component.tsx @@ -61,7 +61,6 @@ export const ElementSettings: FunctionComponent = ({ element }) => { ), }, ]; - return ; }; diff --git a/x-pack/plugins/canvas/public/components/sidebar/element_settings/element_settings.tsx b/x-pack/plugins/canvas/public/components/sidebar/element_settings/element_settings.tsx index 4935647ca6810b..2de52c996e7dd8 100644 --- a/x-pack/plugins/canvas/public/components/sidebar/element_settings/element_settings.tsx +++ b/x-pack/plugins/canvas/public/components/sidebar/element_settings/element_settings.tsx @@ -6,31 +6,24 @@ */ import React from 'react'; -import { connect } from 'react-redux'; +import deepEqual from 'react-fast-compare'; +import { useSelector } from 'react-redux'; import { getElementById, getSelectedPage } from '../../../state/selectors/workpad'; import { ElementSettings as Component } from './element_settings.component'; -import { State, PositionedElement } from '../../../../types'; +import { State } from '../../../../types'; interface Props { selectedElementId: string | null; } -const mapStateToProps = (state: State, { selectedElementId }: Props): StateProps => ({ - element: getElementById(state, selectedElementId, getSelectedPage(state)), -}); +export const ElementSettings: React.FC = ({ selectedElementId }) => { + const element = useSelector((state: State) => { + return getElementById(state, selectedElementId, getSelectedPage(state)); + }, deepEqual); -interface StateProps { - element: PositionedElement | undefined; -} - -const renderIfElement: React.FunctionComponent = (props) => { - if (props.element) { - return ; + if (element) { + return ; } return null; }; - -export const ElementSettings = connect(mapStateToProps)( - renderIfElement -); diff --git a/x-pack/plugins/canvas/public/components/sidebar/sidebar_content/sidebar_content.tsx b/x-pack/plugins/canvas/public/components/sidebar/sidebar_content/sidebar_content.tsx index e53f5d6d515dfe..cc7bfa7d111951 100644 --- a/x-pack/plugins/canvas/public/components/sidebar/sidebar_content/sidebar_content.tsx +++ b/x-pack/plugins/canvas/public/components/sidebar/sidebar_content/sidebar_content.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { useSelector } from 'react-redux'; +import { shallowEqual, useSelector } from 'react-redux'; import { getSelectedToplevelNodes, getSelectedElementId } from '../../../state/selectors/workpad'; import { State } from '../../../../types'; import { SidebarContent as Component } from './sidebar_content.component'; @@ -16,12 +16,14 @@ interface SidebarContentProps { } export const SidebarContent: React.FC = ({ commit }) => { - const selectedToplevelNodes = useSelector((state) => - getSelectedToplevelNodes(state) + const selectedToplevelNodes = useSelector( + (state) => getSelectedToplevelNodes(state), + shallowEqual ); - const selectedElementId = useSelector((state) => - getSelectedElementId(state) + const selectedElementId = useSelector( + (state) => getSelectedElementId(state), + shallowEqual ); return ( diff --git a/x-pack/plugins/canvas/public/components/workpad_app/workpad_app.component.tsx b/x-pack/plugins/canvas/public/components/workpad_app/workpad_app.component.tsx index 6e380088bd84b8..0d9ff68c9f46fa 100644 --- a/x-pack/plugins/canvas/public/components/workpad_app/workpad_app.component.tsx +++ b/x-pack/plugins/canvas/public/components/workpad_app/workpad_app.component.tsx @@ -16,7 +16,7 @@ import { CommitFn } from '../../../types'; export const WORKPAD_CONTAINER_ID = 'canvasWorkpadContainer'; -interface Props { +export interface Props { deselectElement?: MouseEventHandler; isWriteable: boolean; } diff --git a/x-pack/plugins/canvas/public/components/workpad_app/workpad_app.ts b/x-pack/plugins/canvas/public/components/workpad_app/workpad_app.ts index fe98e0f4b1bffc..bf859ceb431613 100644 --- a/x-pack/plugins/canvas/public/components/workpad_app/workpad_app.ts +++ b/x-pack/plugins/canvas/public/components/workpad_app/workpad_app.ts @@ -6,8 +6,8 @@ */ import { MouseEventHandler } from 'react'; -import { Dispatch } from 'redux'; import { connect } from 'react-redux'; +import { Dispatch } from 'redux'; // @ts-expect-error untyped local import { selectToplevelNodes } from '../../state/actions/transient'; import { canUserWrite } from '../../state/selectors/app'; @@ -18,6 +18,8 @@ import { State } from '../../../types'; export { WORKPAD_CONTAINER_ID } from './workpad_app.component'; +const WorkpadAppComponent = withElementsLoadedTelemetry(Component); + const mapDispatchToProps = (dispatch: Dispatch): { deselectElement: MouseEventHandler } => ({ deselectElement: (ev) => { ev.stopPropagation(); @@ -31,4 +33,4 @@ export const WorkpadApp = connect( workpad: getWorkpad(state), }), mapDispatchToProps -)(withElementsLoadedTelemetry(Component)); +)(WorkpadAppComponent); diff --git a/x-pack/plugins/canvas/public/components/workpad_app/workpad_telemetry.test.tsx b/x-pack/plugins/canvas/public/components/workpad_app/workpad_telemetry.test.tsx index 54fd871203f1fe..3c2ab0bf8175f2 100644 --- a/x-pack/plugins/canvas/public/components/workpad_app/workpad_telemetry.test.tsx +++ b/x-pack/plugins/canvas/public/components/workpad_app/workpad_telemetry.test.tsx @@ -6,6 +6,7 @@ */ import React from 'react'; +import { useSelector } from 'react-redux'; import { render } from '@testing-library/react'; import { withUnconnectedElementsLoadedTelemetry, @@ -13,148 +14,137 @@ import { WorkpadLoadedWithErrorsMetric, } from './workpad_telemetry'; import { METRIC_TYPE } from '../../lib/ui_metric'; -import { ResolvedArgType } from '../../../types'; +import { ExpressionContext, ResolvedArgType } from '../../../types'; + +jest.mock('react-redux', () => { + const originalModule = jest.requireActual('react-redux'); + + return { + ...originalModule, + useSelector: jest.fn(), + }; +}); const trackMetric = jest.fn(); +const useSelectorMock = useSelector as jest.Mock; + const Component = withUnconnectedElementsLoadedTelemetry(() =>
, trackMetric); const mockWorkpad = { id: 'workpadid', pages: [ { - elements: [{ id: '1' }, { id: '2' }, { id: '3' }, { id: '4' }], + elements: [{ id: '0' }, { id: '1' }, { id: '2' }, { id: '3' }], }, { - elements: [{ id: '5' }], + elements: [{ id: '4' }], }, ], }; -const resolvedArgsMatchWorkpad = { - '1': {} as ResolvedArgType, - '2': {} as ResolvedArgType, - '3': {} as ResolvedArgType, - '4': {} as ResolvedArgType, - '5': {} as ResolvedArgType, -}; +const getMockState = (resolvedArgs: Record) => ({ + transient: { resolvedArgs }, +}); -const resolvedArgsNotMatchWorkpad = { - 'non-matching-id': {} as ResolvedArgType, -}; +const getResolveArgWithState = (state: 'pending' | 'ready' | 'error') => + ({ + expressionRenderable: { value: { as: state, type: 'render' }, state, error: null }, + expressionContext: {} as ExpressionContext, + } as ResolvedArgType); -const pendingCounts = { - pending: 5, - error: 0, - ready: 0, -}; +const arrayToObject = (array: ResolvedArgType[]) => + array.reduce>((acc, el, index) => { + acc[index] = el; + return acc; + }, {}); -const readyCounts = { - pending: 0, - error: 0, - ready: 5, -}; +const pendingMockState = getMockState( + arrayToObject(Array(5).fill(getResolveArgWithState('pending'))) +); -const errorCounts = { - pending: 0, - error: 1, - ready: 4, -}; +const readyMockState = getMockState(arrayToObject(Array(5).fill(getResolveArgWithState('ready')))); + +const errorMockState = getMockState( + arrayToObject([ + ...Array(4).fill(getResolveArgWithState('ready')), + ...Array(1).fill(getResolveArgWithState('error')), + ]) +); + +const emptyElementsMockState = getMockState({}); + +const notMatchedMockState = getMockState({ + 'non-matching-id': getResolveArgWithState('ready'), +}); describe('Elements Loaded Telemetry', () => { beforeEach(() => { trackMetric.mockReset(); }); + afterEach(() => { + useSelectorMock.mockClear(); + }); + it('tracks when all resolvedArgs are completed', () => { - const { rerender } = render( - - ); + useSelectorMock.mockImplementation((callback) => { + return callback(pendingMockState); + }); + const { rerender } = render(); expect(trackMetric).not.toBeCalled(); - rerender( - - ); + useSelectorMock.mockClear(); + useSelectorMock.mockImplementation((callback) => { + return callback(readyMockState); + }); + rerender(); expect(trackMetric).toBeCalledWith(METRIC_TYPE.LOADED, WorkpadLoadedMetric); }); it('only tracks loaded once', () => { - const { rerender } = render( - - ); + useSelectorMock.mockImplementation((callback) => { + return callback(pendingMockState); + }); + const { rerender } = render(); expect(trackMetric).not.toBeCalled(); - rerender( - - ); - rerender( - - ); + useSelectorMock.mockClear(); + useSelectorMock.mockImplementation((callback) => { + return callback(readyMockState); + }); + rerender(); + rerender(); expect(trackMetric).toBeCalledTimes(1); }); it('does not track if resolvedArgs are never pending', () => { - const { rerender } = render( - - ); - - rerender( - - ); + useSelectorMock.mockImplementation((callback) => { + return callback(readyMockState); + }); + const { rerender } = render(); + rerender(); expect(trackMetric).not.toBeCalled(); }); it('tracks if elements are in error state after load', () => { - const { rerender } = render( - - ); + useSelectorMock.mockImplementation((callback) => { + return callback(pendingMockState); + }); + const { rerender } = render(); expect(trackMetric).not.toBeCalled(); - rerender( - - ); + useSelectorMock.mockClear(); + useSelectorMock.mockImplementation((callback) => { + return callback(errorMockState); + }); + rerender(); expect(trackMetric).toBeCalledWith(METRIC_TYPE.LOADED, [ WorkpadLoadedMetric, WorkpadLoadedWithErrorsMetric, @@ -166,42 +156,30 @@ describe('Elements Loaded Telemetry', () => { id: 'otherworkpad', pages: [ { - elements: [{ id: '1' }, { id: '2' }, { id: '3' }, { id: '4' }], + elements: [{ id: '0' }, { id: '1' }, { id: '2' }, { id: '3' }], }, { - elements: [{ id: '5' }], + elements: [{ id: '4' }], }, ], }; - const { rerender } = render( - - ); + useSelectorMock.mockImplementation((callback) => { + return callback(notMatchedMockState); + }); + const { rerender } = render(); expect(trackMetric).not.toBeCalled(); - rerender( - - ); - + rerender(); expect(trackMetric).not.toBeCalled(); - rerender( - - ); + useSelectorMock.mockClear(); + useSelectorMock.mockImplementation((callback) => { + return callback(readyMockState); + }); + rerender(); expect(trackMetric).toBeCalledWith(METRIC_TYPE.LOADED, WorkpadLoadedMetric); }); @@ -211,24 +189,12 @@ describe('Elements Loaded Telemetry', () => { pages: [], }; - const resolvedArgs = {}; - - const { rerender } = render( - - ); - - rerender( - - ); + useSelectorMock.mockImplementation((callback) => { + return callback(emptyElementsMockState); + }); + const { rerender } = render(); + rerender(); expect(trackMetric).not.toBeCalled(); }); }); diff --git a/x-pack/plugins/canvas/public/components/workpad_app/workpad_telemetry.tsx b/x-pack/plugins/canvas/public/components/workpad_app/workpad_telemetry.tsx index 0915c757ff8936..d74f8693bc9bd7 100644 --- a/x-pack/plugins/canvas/public/components/workpad_app/workpad_telemetry.tsx +++ b/x-pack/plugins/canvas/public/components/workpad_app/workpad_telemetry.tsx @@ -6,21 +6,18 @@ */ import React, { useState, useEffect } from 'react'; -import { connect, ConnectedProps } from 'react-redux'; +import { shallowEqual, useSelector } from 'react-redux'; +import deepEqual from 'react-fast-compare'; import { trackCanvasUiMetric, METRIC_TYPE } from '../../lib/ui_metric'; import { getElementCounts } from '../../state/selectors/workpad'; import { getArgs } from '../../state/selectors/resolved_args'; +import { State } from '../../../types'; const WorkpadLoadedMetric = 'workpad-loaded'; const WorkpadLoadedWithErrorsMetric = 'workpad-loaded-with-errors'; export { WorkpadLoadedMetric, WorkpadLoadedWithErrorsMetric }; -const mapStateToProps = (state: any) => ({ - telemetryElementCounts: getElementCounts(state), - telemetryResolvedArgs: getArgs(state), -}); - // TODO: Build out full workpad types /** Individual Page of a Workpad @@ -47,7 +44,7 @@ interface ResolvedArgs { [keys: string]: any; } -export interface ElementsLoadedTelemetryProps extends PropsFromRedux { +export interface ElementsLoadedTelemetryProps { workpad: Workpad; } @@ -65,33 +62,32 @@ export const withUnconnectedElementsLoadedTelemetry =

( Component: React.ComponentType

, trackMetric = trackCanvasUiMetric ) => - function ElementsLoadedTelemetry(props: ElementsLoadedTelemetryProps) { - const { telemetryElementCounts, workpad, telemetryResolvedArgs, ...other } = props; - const { error, pending } = telemetryElementCounts; + function ElementsLoadedTelemetry(props: P & ElementsLoadedTelemetryProps) { + const { workpad } = props; const [currentWorkpadId, setWorkpadId] = useState(undefined); const [hasReported, setHasReported] = useState(false); + const telemetryElementCounts = useSelector( + (state: State) => getElementCounts(state), + shallowEqual + ); - useEffect(() => { - const resolvedArgsAreForWorkpad = areAllElementsInResolvedArgs( - workpad, - telemetryResolvedArgs - ); + const telemetryResolvedArgs = useSelector((state: State) => getArgs(state), deepEqual); - if (workpad.id !== currentWorkpadId) { - setWorkpadId(workpad.id); + const resolvedArgsAreForWorkpad = areAllElementsInResolvedArgs(workpad, telemetryResolvedArgs); + const { error, pending } = telemetryElementCounts; + const resolved = resolvedArgsAreForWorkpad && pending === 0; + useEffect(() => { + if (workpad.id !== currentWorkpadId) { const workpadElementCount = workpad.pages.reduce( (reduction, page) => reduction + page.elements.length, 0 ); - if (workpadElementCount === 0 || (resolvedArgsAreForWorkpad && pending === 0)) { - setHasReported(true); - } else { - setHasReported(false); - } - } else if (!hasReported && pending === 0 && resolvedArgsAreForWorkpad) { + setWorkpadId(workpad.id); + setHasReported(workpadElementCount === 0 || resolved); + } else if (!hasReported && resolved) { if (error > 0) { trackMetric(METRIC_TYPE.LOADED, [WorkpadLoadedMetric, WorkpadLoadedWithErrorsMetric]); } else { @@ -99,16 +95,9 @@ export const withUnconnectedElementsLoadedTelemetry =

( } setHasReported(true); } - }, [currentWorkpadId, hasReported, error, pending, telemetryResolvedArgs, workpad]); - - return ; + }, [currentWorkpadId, hasReported, error, workpad.id, resolved, workpad.pages]); + return ; }; -const connector = connect(mapStateToProps, {}); - -type PropsFromRedux = ConnectedProps; - -export const withElementsLoadedTelemetry =

(Component: React.ComponentType

) => { - const telemetry = withUnconnectedElementsLoadedTelemetry(Component); - return connector(telemetry); -}; +export const withElementsLoadedTelemetry =

(Component: React.ComponentType

) => + withUnconnectedElementsLoadedTelemetry(Component); diff --git a/x-pack/plugins/canvas/public/expression_types/datasource.tsx b/x-pack/plugins/canvas/public/expression_types/datasource.tsx index 7566c473a720a9..8ecfedbf948d78 100644 --- a/x-pack/plugins/canvas/public/expression_types/datasource.tsx +++ b/x-pack/plugins/canvas/public/expression_types/datasource.tsx @@ -12,6 +12,7 @@ import { RenderToDom } from '../components/render_to_dom'; import { BaseForm, BaseFormProps } from './base_form'; import { ExpressionFormHandlers } from '../../common/lib'; import { ExpressionFunction } from '../../types'; +import { UpdatePropsRef } from '../../types/arguments'; const defaultTemplate = () => (

@@ -22,7 +23,8 @@ const defaultTemplate = () => ( type TemplateFn = ( domNode: HTMLElement, config: DatasourceRenderProps, - handlers: ExpressionFormHandlers + handlers: ExpressionFormHandlers, + onMount?: (ref: UpdatePropsRef | null) => void ) => void; export type DatasourceProps = { @@ -49,6 +51,8 @@ interface DatasourceWrapperProps { const DatasourceWrapper: React.FunctionComponent = (props) => { const domNodeRef = useRef(); + const datasourceRef = useRef>(); + const { spec, datasourceProps, handlers } = props; const callRenderFn = useCallback(() => { @@ -58,14 +62,23 @@ const DatasourceWrapper: React.FunctionComponent = (prop return; } - template(domNodeRef.current, datasourceProps, handlers); + template(domNodeRef.current, datasourceProps, handlers, (ref) => { + datasourceRef.current = ref ?? undefined; + }); }, [datasourceProps, handlers, spec]); useEffect(() => { callRenderFn(); - }, [callRenderFn, props]); + }, [callRenderFn]); + + useEffect(() => { + if (datasourceRef.current) { + datasourceRef.current.updateProps(datasourceProps); + } + }, [datasourceProps]); useEffectOnce(() => () => { + datasourceRef.current = undefined; handlers.destroy(); }); diff --git a/x-pack/plugins/canvas/public/expression_types/function_form.tsx b/x-pack/plugins/canvas/public/expression_types/function_form.tsx index 70279453ac658d..9028a0999149cd 100644 --- a/x-pack/plugins/canvas/public/expression_types/function_form.tsx +++ b/x-pack/plugins/canvas/public/expression_types/function_form.tsx @@ -140,7 +140,6 @@ export class FunctionForm extends BaseForm { // Don't instaniate these until render time, to give the registries a chance to populate. const argInstances = this.args.map((argSpec) => new Arg(argSpec)); - if (args === null || !isPlainObject(args)) { throw new Error(`Form "${this.name}" expects "args" object`); } @@ -153,7 +152,6 @@ export class FunctionForm extends BaseForm { // otherwise, leave the value alone (including if the arg is not defined) const isMulti = arg && arg.multi; const argValues = args[argName] && !isMulti ? [last(args[argName]) ?? null] : args[argName]; - return { arg, argValues }; }); diff --git a/x-pack/plugins/canvas/public/lib/template_from_react_component.tsx b/x-pack/plugins/canvas/public/lib/template_from_react_component.tsx index b2dfd67a2d34e5..a783d6de2916d5 100644 --- a/x-pack/plugins/canvas/public/lib/template_from_react_component.tsx +++ b/x-pack/plugins/canvas/public/lib/template_from_react_component.tsx @@ -5,42 +5,72 @@ * 2.0. */ -import React, { ComponentType, FC } from 'react'; +import React, { + ComponentType, + forwardRef, + ForwardRefRenderFunction, + useImperativeHandle, + useState, +} from 'react'; import { unmountComponentAtNode, render } from 'react-dom'; import PropTypes from 'prop-types'; import { I18nProvider } from '@kbn/i18n/react'; import { ErrorBoundary } from '../components/enhance/error_boundary'; -import { ArgumentHandlers } from '../../types/arguments'; +import { ArgumentHandlers, UpdatePropsRef } from '../../types/arguments'; export interface Props { renderError: Function; } export const templateFromReactComponent = (Component: ComponentType) => { - const WrappedComponent: FC = (props) => ( - - {({ error }) => { - if (error) { - props.renderError(); - return null; - } - - return ( - - - - ); - }} - - ); - - WrappedComponent.propTypes = { + const WrappedComponent: ForwardRefRenderFunction, Props> = (props, ref) => { + const [updatedProps, setUpdatedProps] = useState(props); + + useImperativeHandle(ref, () => ({ + updateProps: (newProps: Props) => { + setUpdatedProps(newProps); + }, + })); + + return ( + + {({ error }) => { + if (error) { + props.renderError(); + return null; + } + + return ( + + + + ); + }} + + ); + }; + + const ForwardRefWrappedComponent = forwardRef(WrappedComponent); + + ForwardRefWrappedComponent.propTypes = { renderError: PropTypes.func, }; - return (domNode: HTMLElement, config: Props, handlers: ArgumentHandlers) => { + return ( + domNode: HTMLElement, + config: Props, + handlers: ArgumentHandlers, + onMount?: (ref: UpdatePropsRef | null) => void + ) => { try { - const el = React.createElement(WrappedComponent, config); + const el = ( + { + onMount?.(ref); + }} + /> + ); render(el, domNode, () => { handlers.done(); }); diff --git a/x-pack/plugins/canvas/types/arguments.ts b/x-pack/plugins/canvas/types/arguments.ts index 5dfaa3f8e67595..0ecc696165919c 100644 --- a/x-pack/plugins/canvas/types/arguments.ts +++ b/x-pack/plugins/canvas/types/arguments.ts @@ -19,6 +19,10 @@ export interface ArgumentHandlers { onDestroy: GenericCallback; } +export interface UpdatePropsRef { + updateProps: (newProps: Props) => void; +} + export interface ArgumentSpec { /** The argument type */ name: string; @@ -33,13 +37,19 @@ export interface ArgumentSpec { simpleTemplate?: ( domNode: HTMLElement, config: ArgumentConfig, - handlers: ArgumentHandlers + handlers: ArgumentHandlers, + onMount: (ref: UpdatePropsRef | null) => void ) => void; /** * A function that renders a complex/large argument * This is nested in an accordian so it can be expanded/collapsed */ - template?: (domNode: HTMLElement, config: ArgumentConfig, handlers: ArgumentHandlers) => void; + template?: ( + domNode: HTMLElement, + config: ArgumentConfig, + handlers: ArgumentHandlers, + onMount: (ref: UpdatePropsRef | null) => void + ) => void; } export type ArgumentFactory = () => ArgumentSpec; diff --git a/x-pack/plugins/cases/public/components/all_cases/all_cases_generic.tsx b/x-pack/plugins/cases/public/components/all_cases/all_cases_generic.tsx index 4a4e31230030e1..54867c333c2e28 100644 --- a/x-pack/plugins/cases/public/components/all_cases/all_cases_generic.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/all_cases_generic.tsx @@ -7,7 +7,7 @@ import React, { useCallback, useMemo, useRef, useState } from 'react'; import { EuiProgress, EuiBasicTable, EuiTableSelectionType } from '@elastic/eui'; -import { difference, head, isEmpty, memoize } from 'lodash/fp'; +import { difference, head, isEmpty } from 'lodash/fp'; import styled, { css } from 'styled-components'; import classnames from 'classnames'; @@ -17,7 +17,6 @@ import { CaseType, CommentRequestAlertType, CaseStatusWithAllStatus, - CommentType, FilterOptions, SortFieldCase, SubCase, @@ -207,6 +206,10 @@ export const AllCasesGeneric = React.memo( isSelectorView: !!isSelectorView, userCanCrud, connectors, + onRowClick, + alertData, + postComment, + updateCase, }); const itemIdToExpandedRowMap = useMemo( @@ -241,32 +244,11 @@ export const AllCasesGeneric = React.memo( const isDataEmpty = useMemo(() => data.total === 0, [data]); const tableRowProps = useCallback( - (theCase: Case) => { - const onTableRowClick = memoize(async () => { - if (alertData != null) { - await postComment({ - caseId: theCase.id, - data: { - type: CommentType.alert, - ...alertData, - }, - updateCase, - }); - } - if (onRowClick) { - onRowClick(theCase); - } - }); - - return { - 'data-test-subj': `cases-table-row-${theCase.id}`, - className: classnames({ isDisabled: theCase.type === CaseType.collection }), - ...(isSelectorView && theCase.type !== CaseType.collection - ? { onClick: onTableRowClick } - : {}), - }; - }, - [isSelectorView, alertData, onRowClick, postComment, updateCase] + (theCase: Case) => ({ + 'data-test-subj': `cases-table-row-${theCase.id}`, + className: classnames({ isDisabled: theCase.type === CaseType.collection }), + }), + [] ); return ( diff --git a/x-pack/plugins/cases/public/components/all_cases/columns.tsx b/x-pack/plugins/cases/public/components/all_cases/columns.tsx index c0bd6536f1b730..6a23a293bfb834 100644 --- a/x-pack/plugins/cases/public/components/all_cases/columns.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/columns.tsx @@ -10,6 +10,7 @@ import { EuiAvatar, EuiBadgeGroup, EuiBadge, + EuiButton, EuiLink, EuiTableActionsColumnType, EuiTableComputedColumnType, @@ -24,6 +25,8 @@ import styled from 'styled-components'; import { CaseStatuses, CaseType, + CommentType, + CommentRequestAlertType, DeleteCase, Case, SubCase, @@ -43,6 +46,7 @@ import { useKibana } from '../../common/lib/kibana'; import { StatusContextMenu } from '../case_action_bar/status_context_menu'; import { TruncatedText } from '../truncated_text'; import { getConnectorIcon } from '../utils'; +import { PostComment } from '../../containers/use_post_comment'; export type CasesColumns = | EuiTableActionsColumnType @@ -75,6 +79,10 @@ export interface GetCasesColumn { isSelectorView: boolean; userCanCrud: boolean; connectors?: ActionConnector[]; + onRowClick?: (theCase: Case) => void; + alertData?: Omit; + postComment?: (args: PostComment) => Promise; + updateCase?: (newCase: Case) => void; } export const useCasesColumns = ({ caseDetailsNavigation, @@ -87,6 +95,10 @@ export const useCasesColumns = ({ isSelectorView, userCanCrud, connectors = [], + onRowClick, + alertData, + postComment, + updateCase, }: GetCasesColumn): CasesColumns[] => { // Delete case const { @@ -132,6 +144,25 @@ export const useCasesColumns = ({ [toggleDeleteModal] ); + const assignCaseAction = useCallback( + async (theCase: Case) => { + if (alertData != null) { + await postComment?.({ + caseId: theCase.id, + data: { + type: CommentType.alert, + ...alertData, + }, + updateCase, + }); + } + if (onRowClick) { + onRowClick(theCase); + } + }, + [alertData, onRowClick, postComment, updateCase] + ); + useEffect(() => { handleIsLoading(isDeleting || isLoadingCases.indexOf('caseUpdate') > -1); }, [handleIsLoading, isDeleting, isLoadingCases]); @@ -281,6 +312,30 @@ export const useCasesColumns = ({ return getEmptyTagValue(); }, }, + ...(isSelectorView + ? [ + { + align: RIGHT_ALIGNMENT, + render: (theCase: Case) => { + if (theCase.id != null) { + return ( + { + assignCaseAction(theCase); + }} + size="s" + fill={true} + > + {i18n.SELECT} + + ); + } + return getEmptyTagValue(); + }, + }, + ] + : []), ...(!isSelectorView ? [ { diff --git a/x-pack/plugins/cases/public/components/all_cases/index.test.tsx b/x-pack/plugins/cases/public/components/all_cases/index.test.tsx index f55c871f4922a6..7e3ca8729ef631 100644 --- a/x-pack/plugins/cases/public/components/all_cases/index.test.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/index.test.tsx @@ -749,7 +749,7 @@ describe('AllCasesGeneric', () => { /> ); - wrapper.find('[data-test-subj="cases-table-row-1"]').first().simulate('click'); + wrapper.find('[data-test-subj="cases-table-row-select-1"]').first().simulate('click'); await waitFor(() => { expect(onRowClick).toHaveBeenCalledWith({ closedAt: null, diff --git a/x-pack/plugins/cases/public/components/all_cases/selector_modal/index.tsx b/x-pack/plugins/cases/public/components/all_cases/selector_modal/index.tsx index cbfb24f18c97e0..7356764802550a 100644 --- a/x-pack/plugins/cases/public/components/all_cases/selector_modal/index.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/selector_modal/index.tsx @@ -6,7 +6,14 @@ */ import React, { useState, useCallback } from 'react'; -import { EuiModal, EuiModalBody, EuiModalHeader, EuiModalHeaderTitle } from '@elastic/eui'; +import { + EuiButton, + EuiModal, + EuiModalBody, + EuiModalFooter, + EuiModalHeader, + EuiModalHeaderTitle, +} from '@elastic/eui'; import styled from 'styled-components'; import { Case, @@ -76,6 +83,11 @@ const AllCasesSelectorModalComponent: React.FC = ({ updateCase={updateCase} /> + + + {i18n.CANCEL} + + ) : null; }; diff --git a/x-pack/plugins/cases/public/components/all_cases/translations.ts b/x-pack/plugins/cases/public/components/all_cases/translations.ts index be1aa256db657a..5f5cb274ebf772 100644 --- a/x-pack/plugins/cases/public/components/all_cases/translations.ts +++ b/x-pack/plugins/cases/public/components/all_cases/translations.ts @@ -75,6 +75,10 @@ export const DELETE = i18n.translate('xpack.cases.caseTable.delete', { defaultMessage: 'Delete', }); +export const SELECT = i18n.translate('xpack.cases.caseTable.select', { + defaultMessage: 'Select', +}); + export const REQUIRES_UPDATE = i18n.translate('xpack.cases.caseTable.requiresUpdate', { defaultMessage: ' requires update', }); diff --git a/x-pack/plugins/cases/public/components/case_action_bar/index.tsx b/x-pack/plugins/cases/public/components/case_action_bar/index.tsx index af17ea0dca8959..8149fd6591645c 100644 --- a/x-pack/plugins/cases/public/components/case_action_bar/index.tsx +++ b/x-pack/plugins/cases/public/components/case_action_bar/index.tsx @@ -86,7 +86,7 @@ const CaseActionBarComponent: React.FC = ({ {caseData.type !== CaseType.collection && ( - + {i18n.STATUS} = ({ )} - + {title} ( return ( <> - - - } - title={caseData.title} - > - - - + } + title={caseData.title} + > + + + diff --git a/x-pack/plugins/cases/public/components/truncated_text/index.tsx b/x-pack/plugins/cases/public/components/truncated_text/index.tsx index 8a480ed9dbdd18..3cf7f8322d797e 100644 --- a/x-pack/plugins/cases/public/components/truncated_text/index.tsx +++ b/x-pack/plugins/cases/public/components/truncated_text/index.tsx @@ -16,6 +16,7 @@ const Text = styled.span` -webkit-line-clamp: ${LINE_CLAMP}; -webkit-box-orient: vertical; overflow: hidden; + word-break: normal; `; interface Props { diff --git a/x-pack/plugins/cases/public/components/wrappers/index.tsx b/x-pack/plugins/cases/public/components/wrappers/index.tsx index 4c8a3a681f0248..7a3d611413be65 100644 --- a/x-pack/plugins/cases/public/components/wrappers/index.tsx +++ b/x-pack/plugins/cases/public/components/wrappers/index.tsx @@ -20,24 +20,10 @@ export const SectionWrapper = styled.div` width: 100%; `; -export const HeaderWrapper = styled.div` - ${({ theme }) => - ` - padding: ${theme.eui.paddingSizes.l} ${theme.eui.paddingSizes.l} 0 ${theme.eui.paddingSizes.l}; - @media only screen and (max-width: ${theme.eui.euiBreakpoints.s}) { - padding: ${theme.eui.paddingSizes.s} ${theme.eui.paddingSizes.s} 0 - ${theme.eui.paddingSizes.s}; - } - `}; -`; const gutterTimeline = '70px'; // seems to be a timeline reference from the original file export const ContentWrapper = styled.div` ${({ theme }) => ` - padding: ${theme.eui.paddingSizes.l} ${theme.eui.paddingSizes.l} ${gutterTimeline} ${theme.eui.paddingSizes.l}; - @media only screen and (max-width: ${theme.eui.euiBreakpoints.s}) { - padding: ${theme.eui.paddingSizes.s} ${theme.eui.paddingSizes.s} ${gutterTimeline} - ${theme.eui.paddingSizes.s}; - } + padding: ${theme.eui.paddingSizes.l} 0 ${gutterTimeline} 0; `}; `; diff --git a/x-pack/plugins/cases/public/containers/use_post_comment.tsx b/x-pack/plugins/cases/public/containers/use_post_comment.tsx index 8677787fd9af46..2d4437826092ae 100644 --- a/x-pack/plugins/cases/public/containers/use_post_comment.tsx +++ b/x-pack/plugins/cases/public/containers/use_post_comment.tsx @@ -41,7 +41,7 @@ const dataFetchReducer = (state: NewCommentState, action: Action): NewCommentSta } }; -interface PostComment { +export interface PostComment { caseId: string; data: CommentRequest; updateCase?: (newCase: Case) => void; diff --git a/x-pack/plugins/cases/server/index.ts b/x-pack/plugins/cases/server/index.ts index 57db6e5565fff3..765d21af8538c5 100644 --- a/x-pack/plugins/cases/server/index.ts +++ b/x-pack/plugins/cases/server/index.ts @@ -16,7 +16,7 @@ export const config: PluginConfigDescriptor = { markdownPlugins: true, }, deprecations: ({ renameFromRoot }) => [ - renameFromRoot('xpack.case.enabled', 'xpack.cases.enabled'), + renameFromRoot('xpack.case.enabled', 'xpack.cases.enabled', { level: 'critical' }), ], }; export const plugin = (initializerContext: PluginInitializerContext) => diff --git a/x-pack/plugins/enterprise_search/public/applications/__mocks__/kea_logic/flash_messages_logic.mock.ts b/x-pack/plugins/enterprise_search/public/applications/__mocks__/kea_logic/flash_messages_logic.mock.ts index 36a10fd234bfe0..d55c69d478b16f 100644 --- a/x-pack/plugins/enterprise_search/public/applications/__mocks__/kea_logic/flash_messages_logic.mock.ts +++ b/x-pack/plugins/enterprise_search/public/applications/__mocks__/kea_logic/flash_messages_logic.mock.ts @@ -27,6 +27,7 @@ export const mockFlashMessageHelpers = { clearFlashMessages: jest.fn(), flashSuccessToast: jest.fn(), flashErrorToast: jest.fn(), + toastAPIErrors: jest.fn(), }; jest.mock('../../shared/flash_messages', () => ({ diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/flash_messages/handle_api_errors.test.ts b/x-pack/plugins/enterprise_search/public/applications/shared/flash_messages/handle_api_errors.test.ts index 47cbef0bfd9536..1e3705a3800edc 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/flash_messages/handle_api_errors.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/flash_messages/handle_api_errors.test.ts @@ -5,11 +5,14 @@ * 2.0. */ +jest.mock('./set_message_helpers', () => ({ + flashErrorToast: jest.fn(), +})); import '../../__mocks__/kea_logic/kibana_logic.mock'; import { FlashMessagesLogic } from './flash_messages_logic'; - -import { flashAPIErrors, getErrorsFromHttpResponse } from './handle_api_errors'; +import { flashAPIErrors, getErrorsFromHttpResponse, toastAPIErrors } from './handle_api_errors'; +import { flashErrorToast } from './set_message_helpers'; describe('flashAPIErrors', () => { const mockHttpError = { @@ -75,6 +78,56 @@ describe('flashAPIErrors', () => { }); }); +describe('toastAPIErrors', () => { + const mockHttpError = { + body: { + statusCode: 404, + error: 'Not Found', + message: 'Could not find X,Could not find Y,Something else bad happened', + attributes: { + errors: ['Could not find X', 'Could not find Y', 'Something else bad happened'], + }, + }, + } as any; + + beforeEach(() => { + jest.clearAllMocks(); + FlashMessagesLogic.mount(); + jest.spyOn(FlashMessagesLogic.actions, 'setFlashMessages'); + jest.spyOn(FlashMessagesLogic.actions, 'setQueuedMessages'); + }); + + it('converts API errors into flash messages', () => { + toastAPIErrors(mockHttpError); + + expect(flashErrorToast).toHaveBeenNthCalledWith(1, 'Could not find X'); + expect(flashErrorToast).toHaveBeenNthCalledWith(2, 'Could not find Y'); + expect(flashErrorToast).toHaveBeenNthCalledWith(3, 'Something else bad happened'); + }); + + it('falls back to the basic message for http responses without an errors array', () => { + toastAPIErrors({ + body: { + statusCode: 404, + error: 'Not Found', + message: 'Not Found', + }, + } as any); + + expect(flashErrorToast).toHaveBeenCalledWith('Not Found'); + }); + + it('displays a generic error message and re-throws non-API errors', () => { + const error = Error('whatever'); + + expect(() => { + toastAPIErrors(error as any); + }).toThrowError(error); + + expect(flashErrorToast).toHaveBeenCalledWith(expect.any(String)); + }); +}); + describe('getErrorsFromHttpResponse', () => { it('should return errors from the response if present', () => { expect( diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/flash_messages/handle_api_errors.ts b/x-pack/plugins/enterprise_search/public/applications/shared/flash_messages/handle_api_errors.ts index abaa67e06f6061..40863087004d68 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/flash_messages/handle_api_errors.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/flash_messages/handle_api_errors.ts @@ -10,6 +10,7 @@ import { i18n } from '@kbn/i18n'; import { HttpResponse } from 'src/core/public'; import { FlashMessagesLogic } from './flash_messages_logic'; +import { flashErrorToast } from './set_message_helpers'; import { IFlashMessage } from './types'; /** @@ -69,3 +70,16 @@ export const flashAPIErrors = ( throw response; } }; + +export const toastAPIErrors = (response: HttpResponse) => { + const messages = getErrorsFromHttpResponse(response); + + for (const message of messages) { + flashErrorToast(message); + } + // If this was a programming error or a failed request (such as a CORS) error, + // we rethrow the error so it shows up in the developer console + if (!response?.body?.message) { + throw response; + } +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/flash_messages/index.ts b/x-pack/plugins/enterprise_search/public/applications/shared/flash_messages/index.ts index 097d38e0691c59..3d3775aee9607f 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/flash_messages/index.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/flash_messages/index.ts @@ -8,7 +8,7 @@ export { FlashMessages, Toasts } from './flash_messages'; export { FlashMessagesLogic, mountFlashMessagesLogic } from './flash_messages_logic'; export type { IFlashMessage } from './types'; -export { flashAPIErrors } from './handle_api_errors'; +export { flashAPIErrors, toastAPIErrors } from './handle_api_errors'; export { setSuccessMessage, setErrorMessage, diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/tables/generic_endpoint_inline_editable_table/generic_endpoint_inline_editable_table_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/shared/tables/generic_endpoint_inline_editable_table/generic_endpoint_inline_editable_table_logic.test.ts index a77892a70d525b..481013d91bf6fe 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/tables/generic_endpoint_inline_editable_table/generic_endpoint_inline_editable_table_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/tables/generic_endpoint_inline_editable_table/generic_endpoint_inline_editable_table_logic.test.ts @@ -5,6 +5,16 @@ * 2.0. */ +const MOCK_SET_ROW_ERRORS = jest.fn(); + +jest.mock('../inline_editable_table/inline_editable_table_logic', () => ({ + InlineEditableTableLogic: () => ({ + actions: { + setRowErrors: MOCK_SET_ROW_ERRORS, + }, + }), +})); + import { LogicMounter, mockFlashMessageHelpers, @@ -13,14 +23,12 @@ import { import { nextTick } from '@kbn/test/jest'; -import { itShowsServerErrorAsFlashMessage } from '../../../test_helpers'; - import { GenericEndpointInlineEditableTableLogic } from './generic_endpoint_inline_editable_table_logic'; describe('GenericEndpointInlineEditableTableLogic', () => { const { mount } = new LogicMounter(GenericEndpointInlineEditableTableLogic); const { http } = mockHttpValues; - const { flashAPIErrors } = mockFlashMessageHelpers; + const { toastAPIErrors } = mockFlashMessageHelpers; const DEFAULT_VALUES = { isLoading: false, @@ -121,9 +129,13 @@ describe('GenericEndpointInlineEditableTableLogic', () => { expect(logic.actions.clearLoading).toHaveBeenCalled(); }); - itShowsServerErrorAsFlashMessage(http.post, () => { + it('passes API errors to the nested inline editable table', async () => { + http.post.mockReturnValueOnce(Promise.reject('error')); const logic = mountLogic(); logic.actions.addItem(item, onSuccess); + await nextTick(); + + expect(MOCK_SET_ROW_ERRORS).toHaveBeenCalledWith(['An unexpected error occurred']); }); }); @@ -164,9 +176,13 @@ describe('GenericEndpointInlineEditableTableLogic', () => { expect(logic.actions.clearLoading).toHaveBeenCalled(); }); - itShowsServerErrorAsFlashMessage(http.delete, () => { + it('passes errors to the nested inline editable table', async () => { + http.delete.mockReturnValueOnce(Promise.reject('error')); const logic = mountLogic(); logic.actions.deleteItem(item, onSuccess); + await nextTick(); + + expect(MOCK_SET_ROW_ERRORS).toHaveBeenCalledWith(['An unexpected error occurred']); }); }); @@ -213,9 +229,13 @@ describe('GenericEndpointInlineEditableTableLogic', () => { expect(logic.actions.clearLoading).toHaveBeenCalled(); }); - itShowsServerErrorAsFlashMessage(http.put, () => { + it('passes errors to the nested inline editable table', async () => { + http.put.mockReturnValueOnce(Promise.reject('error')); const logic = mountLogic(); logic.actions.updateItem(item, onSuccess); + await nextTick(); + + expect(MOCK_SET_ROW_ERRORS).toHaveBeenCalledWith(['An unexpected error occurred']); }); }); @@ -281,7 +301,7 @@ describe('GenericEndpointInlineEditableTableLogic', () => { // It again calls back to the configured 'onReorder' to reset the order expect(DEFAULT_LOGIC_PARAMS.onReorder).toHaveBeenCalledWith(oldItems); - expect(flashAPIErrors).toHaveBeenCalledWith('error'); + expect(toastAPIErrors).toHaveBeenCalledWith('error'); }); it('does nothing if there are no reorder props', async () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/tables/generic_endpoint_inline_editable_table/generic_endpoint_inline_editable_table_logic.ts b/x-pack/plugins/enterprise_search/public/applications/shared/tables/generic_endpoint_inline_editable_table/generic_endpoint_inline_editable_table_logic.ts index 71c993dca9cb95..b5beb2a74757e7 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/tables/generic_endpoint_inline_editable_table/generic_endpoint_inline_editable_table_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/tables/generic_endpoint_inline_editable_table/generic_endpoint_inline_editable_table_logic.ts @@ -7,9 +7,14 @@ import { kea, MakeLogicType } from 'kea'; -import { flashAPIErrors } from '../../flash_messages'; +import { toastAPIErrors } from '../../flash_messages'; +import { getErrorsFromHttpResponse } from '../../flash_messages/handle_api_errors'; import { HttpLogic } from '../../http'; +import { + InlineEditableTableLogic, + InlineEditableTableProps as InlineEditableTableLogicProps, +} from '../inline_editable_table/inline_editable_table_logic'; import { ItemWithAnID } from '../types'; @@ -91,7 +96,10 @@ export const GenericEndpointInlineEditableTableLogic = kea< onAdd(item, itemsFromResponse); onSuccess(); } catch (e) { - flashAPIErrors(e); + const errors = getErrorsFromHttpResponse(e); + InlineEditableTableLogic({ + instanceId: props.instanceId, + } as InlineEditableTableLogicProps).actions.setRowErrors(errors); } finally { actions.clearLoading(); } @@ -107,7 +115,10 @@ export const GenericEndpointInlineEditableTableLogic = kea< onDelete(item, itemsFromResponse); onSuccess(); } catch (e) { - flashAPIErrors(e); + const errors = getErrorsFromHttpResponse(e); + InlineEditableTableLogic({ + instanceId: props.instanceId, + } as InlineEditableTableLogicProps).actions.setRowErrors(errors); } finally { actions.clearLoading(); } @@ -126,7 +137,10 @@ export const GenericEndpointInlineEditableTableLogic = kea< onUpdate(item, itemsFromResponse); onSuccess(); } catch (e) { - flashAPIErrors(e); + const errors = getErrorsFromHttpResponse(e); + InlineEditableTableLogic({ + instanceId: props.instanceId, + } as InlineEditableTableLogicProps).actions.setRowErrors(errors); } finally { actions.clearLoading(); } @@ -152,7 +166,7 @@ export const GenericEndpointInlineEditableTableLogic = kea< onSuccess(); } catch (e) { onReorder(oldItems); - flashAPIErrors(e); + toastAPIErrors(e); } actions.clearLoading(); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/action_column.test.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/action_column.test.tsx index 6328b01cd2be7a..4c9532b038a8c0 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/action_column.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/action_column.test.tsx @@ -23,9 +23,10 @@ describe('ActionColumn', () => { const mockValues = { doesEditingItemValueContainEmptyProperty: false, editingItemId: 1, - formErrors: [], + fieldErrors: {}, isEditing: false, isEditingUnsavedItem: false, + rowErrors: [], }; const mockActions = { editExistingItem: jest.fn(), @@ -87,10 +88,20 @@ describe('ActionColumn', () => { expect(subject(wrapper).prop('disabled')).toBe(true); }); - it('which is disabled if there are form errors', () => { + it('which is disabled if there are field errors', () => { setMockValues({ ...mockValues, - formErrors: ['I am an error'], + fieldErrors: { foo: ['I am an error for foo'] }, + }); + + const wrapper = shallow(); + expect(subject(wrapper).prop('disabled')).toBe(true); + }); + + it('which is disabled if there are row errors', () => { + setMockValues({ + ...mockValues, + rowErrors: ['I am a row error'], }); const wrapper = shallow(); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/action_column.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/action_column.tsx index ec52b18adf6481..3293e8c5021d5b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/action_column.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/action_column.tsx @@ -41,7 +41,7 @@ export const ActionColumn = ({ lastItemWarning, uneditableItems, }: ActionColumnProps) => { - const { doesEditingItemValueContainEmptyProperty, formErrors, isEditingUnsavedItem } = + const { doesEditingItemValueContainEmptyProperty, fieldErrors, rowErrors, isEditingUnsavedItem } = useValues(InlineEditableTableLogic); const { editExistingItem, deleteItem, doneEditing, saveExistingItem, saveNewItem } = useActions(InlineEditableTableLogic); @@ -50,6 +50,8 @@ export const ActionColumn = ({ return null; } + const isInvalid = Object.keys(fieldErrors).length > 0 || rowErrors.length > 0; + if (isActivelyEditing(item)) { return ( @@ -59,11 +61,7 @@ export const ActionColumn = ({ color="primary" iconType="checkInCircleFilled" onClick={isEditingUnsavedItem ? saveNewItem : saveExistingItem} - disabled={ - isLoading || - Object.keys(formErrors).length > 0 || - doesEditingItemValueContainEmptyProperty - } + disabled={isLoading || isInvalid || doesEditingItemValueContainEmptyProperty} > {SAVE_BUTTON_LABEL} diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/editing_column.test.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/editing_column.test.tsx index 43ced1bd87492e..3dcdc8a84ce385 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/editing_column.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/editing_column.test.tsx @@ -28,8 +28,9 @@ describe('EditingColumn', () => { }; const mockValues = { - formErrors: [], editingItemValue: { id: 1 }, + fieldErrors: {}, + rowErrors: [], }; const mockActions = { @@ -52,7 +53,7 @@ describe('EditingColumn', () => { beforeEach(() => { setMockValues({ ...mockValues, - formErrors: { + fieldErrors: { foo: 'I am an error for foo and should be displayed', }, }); @@ -70,7 +71,7 @@ describe('EditingColumn', () => { ); }); - it('renders form errors for this field if any are present', () => { + it('renders field errors for this field if any are present', () => { expect(shallow(wrapper.find(EuiFormRow).prop('helpText') as any).html()).toContain( 'I am an error for foo and should be displayed' ); @@ -81,6 +82,22 @@ describe('EditingColumn', () => { }); }); + describe('when there is a form error for this row', () => { + let wrapper: ShallowWrapper; + beforeEach(() => { + setMockValues({ + ...mockValues, + rowErrors: ['I am an error for this row'], + }); + + wrapper = shallow(); + }); + + it('renders as invalid', () => { + expect(wrapper.find(EuiFormRow).prop('isInvalid')).toBe(true); + }); + }); + it('renders nothing if there is no editingItemValue in state', () => { setMockValues({ ...mockValues, @@ -95,7 +112,7 @@ describe('EditingColumn', () => { setMockValues({ ...mockValues, editingItemValue: { id: 1, foo: 'foo', bar: 'bar' }, - formErrors: { foo: ['I am an error for foo'] }, + fieldErrors: { foo: ['I am an error for foo'] }, }); const wrapper = shallow( diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/editing_column.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/editing_column.tsx index d3d36046dc0a6d..99b06ef827ded4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/editing_column.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/editing_column.tsx @@ -25,20 +25,25 @@ export const EditingColumn = ({ column, isLoading = false, }: EditingColumnProps) => { - const { formErrors, editingItemValue } = useValues(InlineEditableTableLogic); + const { fieldErrors, rowErrors, editingItemValue } = useValues(InlineEditableTableLogic); const { setEditingItemValue } = useActions(InlineEditableTableLogic); if (!editingItemValue) return null; + const fieldError = fieldErrors[column.field]; + const isInvalid = !!fieldError || rowErrors.length > 0; + return ( - {formErrors[column.field]} - + fieldError && ( + + {fieldError} + + ) } - isInvalid={!!formErrors[column.field]} + isInvalid={isInvalid} > <> {column.editingRender( @@ -50,7 +55,7 @@ export const EditingColumn = ({ }); }, { - isInvalid: !!formErrors[column.field], + isInvalid, isLoading, } )} diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/inline_editable_table.test.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/inline_editable_table.test.tsx index ab59616e9ce786..c8d3079b033c05 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/inline_editable_table.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/inline_editable_table.test.tsx @@ -153,6 +153,21 @@ describe('InlineEditableTable', () => { expect(rowProps(items[1])).toEqual({ className: 'is-being-edited' }); }); + it('will pass errors for row that is currently being edited', () => { + setMockValues({ + ...mockValues, + isEditing: true, + editingItemId: 2, + rowErrors: ['first error', 'second error'], + }); + const itemList = [{ id: 1 }, { id: 2 }]; + const wrapper = shallow(); + const rowErrors = wrapper.find(ReorderableTable).prop('rowErrors') as (item: any) => object; + expect(rowErrors(items[0])).toEqual(undefined); + // Since editingItemId is 2 and the second item (position 1) in item list has an id of 2, it gets the errors + expect(rowErrors(items[1])).toEqual(['first error', 'second error']); + }); + it('will update the passed columns and pass them through to the underlying table', () => { const updatedColumns = {}; const canRemoveLastItem = true; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/inline_editable_table.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/inline_editable_table.tsx index 093692dfde3351..3c670264dff220 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/inline_editable_table.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/inline_editable_table.tsx @@ -95,7 +95,8 @@ export const InlineEditableTableContents = ({ uneditableItems, ...rest }: InlineEditableTableProps) => { - const { editingItemId, isEditing, isEditingUnsavedItem } = useValues(InlineEditableTableLogic); + const { editingItemId, isEditing, isEditingUnsavedItem, rowErrors } = + useValues(InlineEditableTableLogic); const { editNewItem, reorderItems } = useActions(InlineEditableTableLogic); // TODO These two things shoud just be selectors @@ -168,6 +169,7 @@ export const InlineEditableTableContents = ({ 'is-being-edited': isActivelyEditing(item), }), })} + rowErrors={(item) => (isActivelyEditing(item) ? rowErrors : undefined)} noItemsMessage={noItemsMessage(editNewItem)} onReorder={reorderItems} disableDragging={isEditing} diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/inline_editable_table_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/inline_editable_table_logic.test.ts index f690a38620ecba..5a8a724076223c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/inline_editable_table_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/inline_editable_table_logic.test.ts @@ -29,8 +29,9 @@ describe('InlineEditableTableLogic', () => { const DEFAULT_VALUES = { editingItemId: null, editingItemValue: null, - formErrors: {}, + fieldErrors: {}, isEditing: false, + rowErrors: [], }; const SELECTORS = { @@ -91,7 +92,7 @@ describe('InlineEditableTableLogic', () => { isEditing: true, editingItemId: 1, editingItemValue: {}, - formErrors: { foo: 'I am error' }, + fieldErrors: { foo: 'I am error for foo' }, }); logic.actions.doneEditing(); expect(logicValuesWithoutSelectors(logic)).toEqual(DEFAULT_VALUES); @@ -152,29 +153,41 @@ describe('InlineEditableTableLogic', () => { }); }); - describe('setFormErrors', () => { - it('sets formErrors', () => { - const formErrors = { - bar: 'I am an error', + describe('setFieldErrors', () => { + it('sets fieldErrors', () => { + const fieldErrors = { + foo: 'I am an error for foo', }; const logic = mountLogic(); - logic.actions.setFormErrors(formErrors); + logic.actions.setFieldErrors(fieldErrors); expect(logicValuesWithoutSelectors(logic)).toEqual({ ...DEFAULT_VALUES, - formErrors, + fieldErrors, + }); + }); + }); + + describe('setRowErrors', () => { + it('sets rowErrors', () => { + const rowErrors = ['I am a row error']; + const logic = mountLogic(); + logic.actions.setRowErrors(rowErrors); + expect(logicValuesWithoutSelectors(logic)).toEqual({ + ...DEFAULT_VALUES, + rowErrors, }); }); }); describe('setEditingItemValue', () => { - it('updates the state of the item currently being edited and resets form errors', () => { + it('updates the state of the item currently being edited and resets field errors', () => { const logic = mountLogic({ editingItemValue: { id: 1, foo: '', bar: '', }, - formErrors: { foo: 'I am error' }, + fieldErrors: { foo: 'I am error for foo' }, }); logic.actions.setEditingItemValue({ id: 1, @@ -188,7 +201,7 @@ describe('InlineEditableTableLogic', () => { foo: 'blah blah', bar: '', }, - formErrors: {}, + fieldErrors: {}, }); }); }); @@ -297,20 +310,20 @@ describe('InlineEditableTableLogic', () => { ); }); - it('will set form errors and not call the provided onUpdate callback if the item being edited does not validate', () => { + it('will set field errors and not call the provided onUpdate callback if the item being edited does not validate', () => { const editingItemValue = {}; - const formErrors = { + const fieldErrors = { foo: 'some error', }; - DEFAULT_LOGIC_PARAMS.validateItem.mockReturnValue(formErrors); + DEFAULT_LOGIC_PARAMS.validateItem.mockReturnValue(fieldErrors); const logic = mountLogic({ ...DEFAULT_VALUES, editingItemValue, }); - jest.spyOn(logic.actions, 'setFormErrors'); + jest.spyOn(logic.actions, 'setFieldErrors'); logic.actions.saveExistingItem(); expect(DEFAULT_LOGIC_PARAMS.onUpdate).not.toHaveBeenCalled(); - expect(logic.actions.setFormErrors).toHaveBeenCalledWith(formErrors); + expect(logic.actions.setFieldErrors).toHaveBeenCalledWith(fieldErrors); }); it('will do neither if no value is currently being edited', () => { @@ -319,10 +332,10 @@ describe('InlineEditableTableLogic', () => { ...DEFAULT_VALUES, editingItemValue, }); - jest.spyOn(logic.actions, 'setFormErrors'); + jest.spyOn(logic.actions, 'setFieldErrors'); logic.actions.saveExistingItem(); expect(DEFAULT_LOGIC_PARAMS.onUpdate).not.toHaveBeenCalled(); - expect(logic.actions.setFormErrors).not.toHaveBeenCalled(); + expect(logic.actions.setFieldErrors).not.toHaveBeenCalled(); }); it('will always call the provided onUpdate callback if no validateItem param was provided', () => { @@ -382,20 +395,20 @@ describe('InlineEditableTableLogic', () => { ); }); - it('will set form errors and not call the provided onAdd callback if the item being edited does not validate', () => { + it('will set field errors and not call the provided onAdd callback if the item being edited does not validate', () => { const editingItemValue = {}; - const formErrors = { + const fieldErrors = { foo: 'some error', }; - DEFAULT_LOGIC_PARAMS.validateItem.mockReturnValue(formErrors); + DEFAULT_LOGIC_PARAMS.validateItem.mockReturnValue(fieldErrors); const logic = mountLogic({ ...DEFAULT_VALUES, editingItemValue, }); - jest.spyOn(logic.actions, 'setFormErrors'); + jest.spyOn(logic.actions, 'setFieldErrors'); logic.actions.saveNewItem(); expect(DEFAULT_LOGIC_PARAMS.onAdd).not.toHaveBeenCalled(); - expect(logic.actions.setFormErrors).toHaveBeenCalledWith(formErrors); + expect(logic.actions.setFieldErrors).toHaveBeenCalledWith(fieldErrors); }); it('will do nothing if no value is currently being edited', () => { @@ -404,10 +417,10 @@ describe('InlineEditableTableLogic', () => { ...DEFAULT_VALUES, editingItemValue, }); - jest.spyOn(logic.actions, 'setFormErrors'); + jest.spyOn(logic.actions, 'setFieldErrors'); logic.actions.saveNewItem(); expect(DEFAULT_LOGIC_PARAMS.onAdd).not.toHaveBeenCalled(); - expect(logic.actions.setFormErrors).not.toHaveBeenCalled(); + expect(logic.actions.setFieldErrors).not.toHaveBeenCalled(); }); it('will always call the provided onAdd callback if no validateItem param was provided', () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/inline_editable_table_logic.ts b/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/inline_editable_table_logic.ts index 0230fc07541200..04b5ceb9988511 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/inline_editable_table_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/inline_editable_table_logic.ts @@ -20,7 +20,8 @@ interface InlineEditableTableActions { saveExistingItem(): void; saveNewItem(): void; setEditingItemValue(newValue: Item): { item: Item }; - setFormErrors(formErrors: FormErrors): { formErrors: FormErrors }; + setFieldErrors(fieldErrors: FormErrors): { fieldErrors: FormErrors }; + setRowErrors(rowErrors: string[]): { rowErrors: string[] }; } const generateEmptyItem = ( @@ -39,12 +40,13 @@ interface InlineEditableTableValues { // TODO we should editingItemValue have editingItemValue and editingItemId should be a selector editingItemId: Item['id'] | null; // editingItem is null when the user is editing a new but not saved item editingItemValue: Item | null; - formErrors: FormErrors; + fieldErrors: FormErrors; + rowErrors: string[]; isEditingUnsavedItem: boolean; doesEditingItemValueContainEmptyProperty: boolean; } -interface InlineEditableTableProps { +export interface InlineEditableTableProps { columns: Array>; instanceId: string; // TODO Because these callbacks are params, they are only set on the logic once (i.e., they are cached) @@ -75,7 +77,8 @@ export const InlineEditableTableLogic = kea ({ item: newValue }), - setFormErrors: (formErrors) => ({ formErrors }), + setFieldErrors: (fieldErrors) => ({ fieldErrors }), + setRowErrors: (rowErrors) => ({ rowErrors }), }), reducers: ({ props: { columns } }) => ({ isEditing: [ @@ -103,12 +106,20 @@ export const InlineEditableTableLogic = kea item, }, ], - formErrors: [ + fieldErrors: [ {}, { doneEditing: () => ({}), setEditingItemValue: () => ({}), - setFormErrors: (_, { formErrors }) => formErrors, + setFieldErrors: (_, { fieldErrors }) => fieldErrors, + }, + ], + rowErrors: [ + [], + { + doneEditing: () => [], + setEditingItemValue: () => [], + setRowErrors: (_, { rowErrors }) => rowErrors, }, ], }), @@ -144,7 +155,7 @@ export const InlineEditableTableLogic = kea { const cells = wrapper.find(Cell); expect(cells.length).toBe(3); }); + + it('will render row errors', () => { + const wrapper = shallow( + + ); + const callouts = wrapper.find(EuiCallOut); + expect(callouts.length).toBe(2); + expect(callouts.at(0).prop('title')).toEqual('first error'); + expect(callouts.at(1).prop('title')).toEqual('second error'); + }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/tables/reorderable_table/body_row.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/tables/reorderable_table/body_row.tsx index 474d49f5eef0f6..588f14190d274c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/tables/reorderable_table/body_row.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/tables/reorderable_table/body_row.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { EuiCallOut, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { Cell } from './cell'; import { DRAGGABLE_UX_STYLE } from './constants'; @@ -19,6 +19,7 @@ export interface BodyRowProps { additionalProps?: object; // Cell to put in first column before other columns leftAction?: React.ReactNode; + errors?: string[]; } export const BodyRow = ({ @@ -26,6 +27,7 @@ export const BodyRow = ({ item, additionalProps, leftAction, + errors = [], }: BodyRowProps) => { return (
@@ -46,6 +48,15 @@ export const BodyRow = ({ + {errors.length > 0 && ( + + {errors.map((errorMessage, errorMessageIndex) => ( + + + + ))} + + )}
); }; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/tables/reorderable_table/draggable_body_row.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/tables/reorderable_table/draggable_body_row.tsx index 191843a2e6e78a..9a21d5a9c8c25d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/tables/reorderable_table/draggable_body_row.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/tables/reorderable_table/draggable_body_row.tsx @@ -18,6 +18,7 @@ export interface DraggableBodyRowProps { rowIndex: number; additionalProps?: object; disableDragging?: boolean; + errors?: string[]; } export const DraggableBodyRow = ({ @@ -26,6 +27,7 @@ export const DraggableBodyRow = ({ rowIndex, additionalProps, disableDragging = false, + errors, }: DraggableBodyRowProps) => { const draggableId = `draggable_row_${rowIndex}`; @@ -42,6 +44,7 @@ export const DraggableBodyRow = ({ item={item} additionalProps={additionalProps} leftAction={!disableDragging ? : <>} + errors={errors} /> ); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/tables/reorderable_table/reorderable_table.scss b/x-pack/plugins/enterprise_search/public/applications/shared/tables/reorderable_table/reorderable_table.scss index d2ea90bbbfec82..81ae229dcdd482 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/tables/reorderable_table/reorderable_table.scss +++ b/x-pack/plugins/enterprise_search/public/applications/shared/tables/reorderable_table/reorderable_table.scss @@ -9,14 +9,18 @@ border-top: $euiBorderThin; background-color: $euiColorEmptyShade; - > .euiFlexGroup--directionRow.euiFlexGroup--gutterLarge { + > .euiFlexGroup { margin: 0; } + + > .euiFlexGroup:nth-child(2) > .euiFlexItem { + margin-top: 0; + } } &Header { - > .euiFlexGroup--directionRow.euiFlexGroup--gutterLarge { - margin: -12px 0; + > .euiFlexGroup { + margin: ($euiSizeM * -1) 0; } } diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/tables/reorderable_table/reorderable_table.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/tables/reorderable_table/reorderable_table.tsx index 4cb12321bdfcfc..88e80f1d5401bb 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/tables/reorderable_table/reorderable_table.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/tables/reorderable_table/reorderable_table.tsx @@ -30,6 +30,7 @@ interface ReorderableTableProps { disableReordering?: boolean; onReorder?: (items: Item[], oldItems: Item[]) => void; rowProps?: (item: Item) => object; + rowErrors?: (item: Item) => string[] | undefined; } export const ReorderableTable = ({ @@ -42,6 +43,7 @@ export const ReorderableTable = ({ disableReordering = false, onReorder = () => undefined, rowProps = () => ({}), + rowErrors = () => undefined, }: ReorderableTableProps) => { return (
@@ -67,6 +69,7 @@ export const ReorderableTable = ({ additionalProps={rowProps(item)} disableDragging={disableDragging} rowIndex={itemIndex} + errors={rowErrors(item)} /> )} onReorder={onReorder} @@ -83,6 +86,7 @@ export const ReorderableTable = ({ columns={columns} item={item} additionalProps={rowProps(item)} + errors={rowErrors(item)} /> )} /> @@ -97,6 +101,7 @@ export const ReorderableTable = ({ columns={columns} item={item} additionalProps={rowProps(item)} + errors={rowErrors(item)} leftAction={<>} /> )} diff --git a/x-pack/plugins/fleet/common/constants/agent.ts b/x-pack/plugins/fleet/common/constants/agent.ts index e38b7a6b5832b8..832a9027c6517e 100644 --- a/x-pack/plugins/fleet/common/constants/agent.ts +++ b/x-pack/plugins/fleet/common/constants/agent.ts @@ -5,8 +5,7 @@ * 2.0. */ -export const AGENT_SAVED_OBJECT_TYPE = 'fleet-agents'; -export const AGENT_ACTION_SAVED_OBJECT_TYPE = 'fleet-agent-actions'; +export const AGENTS_PREFIX = 'fleet-agents'; export const AGENT_TYPE_PERMANENT = 'PERMANENT'; export const AGENT_TYPE_EPHEMERAL = 'EPHEMERAL'; diff --git a/x-pack/plugins/fleet/common/constants/enrollment_api_key.ts b/x-pack/plugins/fleet/common/constants/enrollment_api_key.ts index 25d395893aaecd..c9a449939ef3fe 100644 --- a/x-pack/plugins/fleet/common/constants/enrollment_api_key.ts +++ b/x-pack/plugins/fleet/common/constants/enrollment_api_key.ts @@ -5,6 +5,4 @@ * 2.0. */ -export const ENROLLMENT_API_KEYS_SAVED_OBJECT_TYPE = 'fleet-enrollment-api-keys'; - export const ENROLLMENT_API_KEYS_INDEX = '.fleet-enrollment-api-keys'; diff --git a/x-pack/plugins/fleet/common/constants/routes.ts b/x-pack/plugins/fleet/common/constants/routes.ts index aa5e0dbcd5ed17..be4103c549f1ae 100644 --- a/x-pack/plugins/fleet/common/constants/routes.ts +++ b/x-pack/plugins/fleet/common/constants/routes.ts @@ -12,7 +12,6 @@ export const EPM_API_ROOT = `${API_ROOT}/epm`; export const DATA_STREAM_API_ROOT = `${API_ROOT}/data_streams`; export const PACKAGE_POLICY_API_ROOT = `${API_ROOT}/package_policies`; export const AGENT_POLICY_API_ROOT = `${API_ROOT}/agent_policies`; -export const FLEET_API_ROOT_7_9 = `/api/ingest_manager/fleet`; export const LIMITED_CONCURRENCY_ROUTE_TAG = 'ingest:limited-concurrency'; diff --git a/x-pack/plugins/fleet/common/types/models/agent.ts b/x-pack/plugins/fleet/common/types/models/agent.ts index 6913fc52d8c62d..018f591fef79c8 100644 --- a/x-pack/plugins/fleet/common/types/models/agent.ts +++ b/x-pack/plugins/fleet/common/types/models/agent.ts @@ -66,15 +66,6 @@ export interface AgentPolicyAction extends NewAgentAction { ack_data?: any; } -// Make policy change action renaming BWC with agent version <= 7.9 -// eslint-disable-next-line @typescript-eslint/naming-convention -export type AgentPolicyActionV7_9 = Omit & { - type: 'CONFIG_CHANGE'; - data: { - config: FullAgentPolicy; - }; -}; - interface CommonAgentActionSOAttributes { type: AgentActionType; sent_at?: string; diff --git a/x-pack/plugins/fleet/dev_docs/data_model.md b/x-pack/plugins/fleet/dev_docs/data_model.md index ec9fa031d09d36..be0e06e5439dc6 100644 --- a/x-pack/plugins/fleet/dev_docs/data_model.md +++ b/x-pack/plugins/fleet/dev_docs/data_model.md @@ -37,8 +37,6 @@ All of the code that interacts with this index is currently located in [`x-pack/plugins/fleet/server/services/agents/crud.ts`](../server/services/agents/crud.ts) and the schema of these documents is maintained by the `FleetServerAgent` TypeScript interface. -Prior to Fleet Server, this data was stored in the `fleet-agents` Saved Object type which is now obsolete. - ### `.fleet-actions` index Each document in this index represents an action that was initiated by a user and needs to be processed by Fleet Server @@ -167,46 +165,3 @@ represents the relative file path of the file from the package contents Used as "tombstone record" to indicate that a package that was installed by default through preconfiguration was explicitly deleted by user. Used to avoid recreating a preconfiguration policy that a user explicitly does not want. - -### `fleet-agents` - -**DEPRECATED in favor of `.fleet-agents` index.** - -- Constant in code: `AGENT_SAVED_OBJECT_TYPE` -- Introduced in ? -- [Code Link](../server/saved_objects/index.ts#76) -- Migrations: 7.10.0, 7.12.0 -- References to other objects: - - `policy_id` - ID that points to the policy (`ingest-agent-policies`) this agent is assigned to. - - `access_api_key_id` - - `default_api_key_id` - -Tracks an individual Elastic Agent's enrollment in the Fleet, which policy it is current assigned to, its check in -status, which packages are currently installed, and other metadata about the Agent. - -### `fleet-agent-actions` - -**DEPRECATED in favor of `.fleet-agent-actions` index.** - -- Constant in code: `AGENT_ACTION_SAVED_OBJECT_TYPE` -- Introduced in ? -- [Code Link](../server/saved_objects/index.ts#113) -- Migrations: 7.10.0 -- References to other objects: - - `agent_id` - ID that points to the agent for this action (`fleet-agents`) - - `policy_id`- ID that points to the policy for this action (`ingest-agent-policies`) - - -### `fleet-enrollment-api-keys` - -**DEPRECATED in favor of `.fleet-enrollment-api-keys` index.** - -- Constant in code: `ENROLLMENT_API_KEYS_SAVED_OBJECT_TYPE` -- Introduced in ? -- [Code Link](../server/saved_objects/index.ts#166) -- Migrations: 7.10.0 -- References to other objects: - - `api_key_id` - - `policy_id` - ID that points to an agent policy (`ingest-agent-policies`) - -Contains an enrollment key that can be used to enroll a new agent in a specific agent policy. \ No newline at end of file diff --git a/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx b/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx index 70becfe40d8e29..f1a23ea759defb 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx @@ -12,9 +12,9 @@ import { fromKueryExpression } from '@kbn/es-query'; import type { IFieldType } from '../../../../../../../src/plugins/data/public'; import { QueryStringInput } from '../../../../../../../src/plugins/data/public'; import { useStartServices } from '../hooks'; -import { INDEX_NAME, AGENT_SAVED_OBJECT_TYPE } from '../constants'; +import { INDEX_NAME, AGENTS_PREFIX } from '../constants'; -const HIDDEN_FIELDS = [`${AGENT_SAVED_OBJECT_TYPE}.actions`, '_id', '_index']; +const HIDDEN_FIELDS = [`${AGENTS_PREFIX}.actions`, '_id', '_index']; interface Props { value: string; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_delete_provider.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_delete_provider.tsx index c5d0e5279220e0..b8d8f212a54516 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_delete_provider.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_delete_provider.tsx @@ -10,7 +10,7 @@ import { EuiConfirmModal, EuiCallOut } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; -import { AGENT_SAVED_OBJECT_TYPE } from '../../../constants'; +import { AGENTS_PREFIX } from '../../../constants'; import { sendDeleteAgentPolicy, useStartServices, useConfig, sendRequest } from '../../../hooks'; interface Props { @@ -98,7 +98,7 @@ export const AgentPolicyDeleteProvider: React.FunctionComponent = ({ chil path: `/api/fleet/agents`, method: 'get', query: { - kuery: `${AGENT_SAVED_OBJECT_TYPE}.policy_id : ${agentPolicyToCheck}`, + kuery: `${AGENTS_PREFIX}.policy_id : ${agentPolicyToCheck}`, }, }); setAgentsCount(data?.total || 0); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx index c6e92cbce8d184..9ba63475aaaad1 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx @@ -42,7 +42,7 @@ import { ContextMenuActions, } from '../../../components'; import { AgentStatusKueryHelper, isAgentUpgradeable } from '../../../services'; -import { AGENT_SAVED_OBJECT_TYPE, FLEET_SERVER_PACKAGE } from '../../../constants'; +import { AGENTS_PREFIX, FLEET_SERVER_PACKAGE } from '../../../constants'; import { AgentReassignAgentPolicyModal, AgentHealth, @@ -207,7 +207,7 @@ export const AgentListPage: React.FunctionComponent<{}> = () => { if (kueryBuilder) { kueryBuilder = `(${kueryBuilder}) and`; } - kueryBuilder = `${kueryBuilder} ${AGENT_SAVED_OBJECT_TYPE}.policy_id : (${selectedAgentPolicies + kueryBuilder = `${kueryBuilder} ${AGENTS_PREFIX}.policy_id : (${selectedAgentPolicies .map((agentPolicy) => `"${agentPolicy}"`) .join(' or ')})`; } diff --git a/x-pack/plugins/fleet/public/components/linked_agent_count.tsx b/x-pack/plugins/fleet/public/components/linked_agent_count.tsx index f9b2727f48935a..dcbda2e1445c75 100644 --- a/x-pack/plugins/fleet/public/components/linked_agent_count.tsx +++ b/x-pack/plugins/fleet/public/components/linked_agent_count.tsx @@ -11,7 +11,7 @@ import type { EuiLinkAnchorProps } from '@elastic/eui'; import { EuiLink } from '@elastic/eui'; import { useLink } from '../hooks'; -import { AGENT_SAVED_OBJECT_TYPE } from '../constants'; +import { AGENTS_PREFIX } from '../constants'; /** * Displays the provided `count` number as a link to the Agents list if it is greater than zero @@ -37,7 +37,7 @@ export const LinkedAgentCount = memo< {displayValue} diff --git a/x-pack/plugins/fleet/public/components/package_policy_delete_provider.tsx b/x-pack/plugins/fleet/public/components/package_policy_delete_provider.tsx index e2522f40ef966c..7c2703ec8437bb 100644 --- a/x-pack/plugins/fleet/public/components/package_policy_delete_provider.tsx +++ b/x-pack/plugins/fleet/public/components/package_policy_delete_provider.tsx @@ -11,7 +11,7 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { useStartServices, sendRequest, sendDeletePackagePolicy, useConfig } from '../hooks'; -import { AGENT_API_ROUTES, AGENT_SAVED_OBJECT_TYPE } from '../../common/constants'; +import { AGENT_API_ROUTES, AGENTS_PREFIX } from '../../common/constants'; import type { AgentPolicy } from '../types'; interface Props { @@ -53,7 +53,7 @@ export const PackagePolicyDeleteProvider: React.FunctionComponent = ({ query: { page: 1, perPage: 1, - kuery: `${AGENT_SAVED_OBJECT_TYPE}.policy_id : ${agentPolicy.id}`, + kuery: `${AGENTS_PREFIX}.policy_id : ${agentPolicy.id}`, }, }); setAgentsCount(data?.total || 0); diff --git a/x-pack/plugins/fleet/public/constants/index.ts b/x-pack/plugins/fleet/public/constants/index.ts index 32dd732c53decf..38b7875c93b3bc 100644 --- a/x-pack/plugins/fleet/public/constants/index.ts +++ b/x-pack/plugins/fleet/public/constants/index.ts @@ -12,8 +12,7 @@ export { AGENT_API_ROUTES, SO_SEARCH_LIMIT, AGENT_POLICY_SAVED_OBJECT_TYPE, - AGENT_SAVED_OBJECT_TYPE, - ENROLLMENT_API_KEYS_SAVED_OBJECT_TYPE, + AGENTS_PREFIX, PACKAGE_POLICY_SAVED_OBJECT_TYPE, FLEET_SERVER_PACKAGE, // Fleet Server index diff --git a/x-pack/plugins/fleet/server/collectors/agent_collectors.ts b/x-pack/plugins/fleet/server/collectors/agent_collectors.ts index 43c15e603a87af..9b7d48328467d6 100644 --- a/x-pack/plugins/fleet/server/collectors/agent_collectors.ts +++ b/x-pack/plugins/fleet/server/collectors/agent_collectors.ts @@ -9,7 +9,6 @@ import type { SavedObjectsClient, ElasticsearchClient } from 'kibana/server'; import type { FleetConfigType } from '../../common/types'; import * as AgentService from '../services/agents'; -import { isFleetServerSetup } from '../services/fleet_server'; export interface AgentUsage { total_enrolled: number; @@ -26,7 +25,7 @@ export const getAgentUsage = async ( esClient?: ElasticsearchClient ): Promise => { // TODO: unsure if this case is possible at all. - if (!soClient || !esClient || !(await isFleetServerSetup())) { + if (!soClient || !esClient) { return { total_enrolled: 0, healthy: 0, diff --git a/x-pack/plugins/fleet/server/collectors/fleet_server_collector.ts b/x-pack/plugins/fleet/server/collectors/fleet_server_collector.ts index 47440e791747cd..a08ed450b5b30d 100644 --- a/x-pack/plugins/fleet/server/collectors/fleet_server_collector.ts +++ b/x-pack/plugins/fleet/server/collectors/fleet_server_collector.ts @@ -10,7 +10,6 @@ import type { SavedObjectsClient, ElasticsearchClient } from 'kibana/server'; import { packagePolicyService, settingsService } from '../services'; import { getAgentStatusForAgentPolicy } from '../services/agents'; -import { isFleetServerSetup } from '../services/fleet_server'; const DEFAULT_USAGE = { total_all_statuses: 0, @@ -36,7 +35,7 @@ export const getFleetServerUsage = async ( soClient?: SavedObjectsClient, esClient?: ElasticsearchClient ): Promise => { - if (!soClient || !esClient || !(await isFleetServerSetup())) { + if (!soClient || !esClient) { return DEFAULT_USAGE; } diff --git a/x-pack/plugins/fleet/server/constants/index.ts b/x-pack/plugins/fleet/server/constants/index.ts index bfb1f3ec433f2e..633390c368957f 100644 --- a/x-pack/plugins/fleet/server/constants/index.ts +++ b/x-pack/plugins/fleet/server/constants/index.ts @@ -35,14 +35,12 @@ export { PRECONFIGURATION_API_ROUTES, // Saved object types SO_SEARCH_LIMIT, - AGENT_SAVED_OBJECT_TYPE, - AGENT_ACTION_SAVED_OBJECT_TYPE, + AGENTS_PREFIX, AGENT_POLICY_SAVED_OBJECT_TYPE, PACKAGE_POLICY_SAVED_OBJECT_TYPE, OUTPUT_SAVED_OBJECT_TYPE, PACKAGES_SAVED_OBJECT_TYPE, ASSETS_SAVED_OBJECT_TYPE, - ENROLLMENT_API_KEYS_SAVED_OBJECT_TYPE, GLOBAL_SETTINGS_SAVED_OBJECT_TYPE, // Defaults DEFAULT_AGENT_POLICY, diff --git a/x-pack/plugins/fleet/server/index.test.ts b/x-pack/plugins/fleet/server/index.test.ts deleted file mode 100644 index 724bb9ad91ab67..00000000000000 --- a/x-pack/plugins/fleet/server/index.test.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { applyDeprecations, configDeprecationFactory } from '@kbn/config'; - -import { configDeprecationsMock } from '../../../../src/core/server/mocks'; - -import { config } from '.'; - -const deprecationContext = configDeprecationsMock.createContext(); - -const applyConfigDeprecations = (settings: Record = {}) => { - if (!config.deprecations) { - throw new Error('Config is not valid no deprecations'); - } - const deprecations = config.deprecations(configDeprecationFactory); - const deprecationMessages: string[] = []; - const migrated = applyDeprecations( - settings, - deprecations.map((deprecation) => ({ - deprecation, - path: '', - context: deprecationContext, - })), - () => - ({ message }) => - deprecationMessages.push(message) - ); - return { - messages: deprecationMessages, - migrated: migrated.config, - }; -}; - -describe('Config depreciation test', () => { - it('should migrate old xpack.ingestManager.fleet settings to xpack.fleet.agents', () => { - const { migrated } = applyConfigDeprecations({ - xpack: { - ingestManager: { - fleet: { enabled: true, elasticsearch: { host: 'http://testes.fr:9200' } }, - }, - }, - }); - - expect(migrated).toMatchInlineSnapshot(` - Object { - "xpack": Object { - "fleet": Object { - "agents": Object { - "elasticsearch": Object { - "hosts": Array [ - "http://testes.fr:9200", - ], - }, - "enabled": true, - }, - }, - }, - } - `); - }); - - it('should support mixing xpack.ingestManager config and xpack.fleet config', () => { - const { migrated } = applyConfigDeprecations({ - xpack: { - ingestManager: { registryUrl: 'http://registrytest.fr' }, - fleet: { registryProxyUrl: 'http://registryProxy.fr' }, - }, - }); - - expect(migrated).toMatchInlineSnapshot(` - Object { - "xpack": Object { - "fleet": Object { - "registryProxyUrl": "http://registryProxy.fr", - "registryUrl": "http://registrytest.fr", - }, - }, - } - `); - }); -}); diff --git a/x-pack/plugins/fleet/server/index.ts b/x-pack/plugins/fleet/server/index.ts index e1ee2652594cc6..c3dd408925cf01 100644 --- a/x-pack/plugins/fleet/server/index.ts +++ b/x-pack/plugins/fleet/server/index.ts @@ -44,52 +44,6 @@ export const config: PluginConfigDescriptor = { agents: true, }, deprecations: ({ renameFromRoot, unused, unusedFromRoot }) => [ - // Fleet plugin was named ingestManager before - renameFromRoot('xpack.ingestManager.enabled', 'xpack.fleet.enabled', { level: 'critical' }), - renameFromRoot('xpack.ingestManager.registryUrl', 'xpack.fleet.registryUrl', { - level: 'critical', - }), - renameFromRoot('xpack.ingestManager.registryProxyUrl', 'xpack.fleet.registryProxyUrl', { - level: 'critical', - }), - renameFromRoot('xpack.ingestManager.fleet', 'xpack.ingestManager.agents', { - level: 'critical', - }), - renameFromRoot('xpack.ingestManager.agents.enabled', 'xpack.fleet.agents.enabled', { - level: 'critical', - }), - renameFromRoot('xpack.ingestManager.agents.elasticsearch', 'xpack.fleet.agents.elasticsearch', { - level: 'critical', - }), - renameFromRoot( - 'xpack.ingestManager.agents.tlsCheckDisabled', - 'xpack.fleet.agents.tlsCheckDisabled', - { level: 'critical' } - ), - renameFromRoot( - 'xpack.ingestManager.agents.pollingRequestTimeout', - 'xpack.fleet.agents.pollingRequestTimeout', - { level: 'critical' } - ), - renameFromRoot( - 'xpack.ingestManager.agents.maxConcurrentConnections', - 'xpack.fleet.agents.maxConcurrentConnections', - { level: 'critical' } - ), - renameFromRoot('xpack.ingestManager.agents.kibana', 'xpack.fleet.agents.kibana', { - level: 'critical', - }), - renameFromRoot( - 'xpack.ingestManager.agents.agentPolicyRolloutRateLimitIntervalMs', - 'xpack.fleet.agents.agentPolicyRolloutRateLimitIntervalMs', - { level: 'critical' } - ), - renameFromRoot( - 'xpack.ingestManager.agents.agentPolicyRolloutRateLimitRequestPerInterval', - 'xpack.fleet.agents.agentPolicyRolloutRateLimitRequestPerInterval', - { level: 'critical' } - ), - unusedFromRoot('xpack.ingestManager', { level: 'critical' }), // Unused settings before Fleet server exists unused('agents.kibana', { level: 'critical' }), unused('agents.maxConcurrentConnections', { level: 'critical' }), diff --git a/x-pack/plugins/fleet/server/integration_tests/router.test.ts b/x-pack/plugins/fleet/server/integration_tests/router.test.ts index 55518923e65f28..eb002f5d731d8b 100644 --- a/x-pack/plugins/fleet/server/integration_tests/router.test.ts +++ b/x-pack/plugins/fleet/server/integration_tests/router.test.ts @@ -30,7 +30,7 @@ function createXPackRoot(config: {} = {}) { }); } -describe('ingestManager', () => { +describe('fleet', () => { describe('default. manager, EPM, and Fleet all disabled', () => { let root: ReturnType; @@ -64,11 +64,11 @@ describe('ingestManager', () => { let root: ReturnType; beforeAll(async () => { - const ingestManagerConfig = { + const fleetConfig = { enabled: true, }; root = createXPackRoot({ - ingestManager: ingestManagerConfig, + fleet: fleetConfig, }); await root.preboot(); await root.setup(); @@ -103,12 +103,12 @@ describe('ingestManager', () => { let root: ReturnType; beforeAll(async () => { - const ingestManagerConfig = { + const fleetConfig = { enabled: true, epm: { enabled: true }, }; root = createXPackRoot({ - ingestManager: ingestManagerConfig, + fleet: fleetConfig, }); await root.preboot(); await root.setup(); @@ -138,12 +138,12 @@ describe('ingestManager', () => { let root: ReturnType; beforeAll(async () => { - const ingestManagerConfig = { + const fleetConfig = { enabled: true, fleet: { enabled: true }, }; root = createXPackRoot({ - ingestManager: ingestManagerConfig, + fleet: fleetConfig, }); await root.preboot(); await root.setup(); @@ -173,13 +173,13 @@ describe('ingestManager', () => { let root: ReturnType; beforeAll(async () => { - const ingestManagerConfig = { + const fleetConfig = { enabled: true, epm: { enabled: true }, fleet: { enabled: true }, }; root = createXPackRoot({ - ingestManager: ingestManagerConfig, + fleet: fleetConfig, }); await root.preboot(); await root.setup(); diff --git a/x-pack/plugins/fleet/server/plugin.ts b/x-pack/plugins/fleet/server/plugin.ts index 7cc1b8b1cfcc9a..d0c73a0fe42a79 100644 --- a/x-pack/plugins/fleet/server/plugin.ts +++ b/x-pack/plugins/fleet/server/plugin.ts @@ -40,8 +40,6 @@ import { PACKAGE_POLICY_SAVED_OBJECT_TYPE, PACKAGES_SAVED_OBJECT_TYPE, ASSETS_SAVED_OBJECT_TYPE, - AGENT_SAVED_OBJECT_TYPE, - ENROLLMENT_API_KEYS_SAVED_OBJECT_TYPE, PRECONFIGURATION_DELETION_RECORD_SAVED_OBJECT_TYPE, } from './constants'; import { registerSavedObjects, registerEncryptedSavedObjects } from './saved_objects'; @@ -82,7 +80,6 @@ import { import { registerFleetUsageCollector } from './collectors/register'; import { getInstallation, ensureInstalledPackage } from './services/epm/packages'; import { RouterWrappers } from './routes/security'; -import { startFleetServerSetup } from './services/fleet_server'; import { FleetArtifactsClient } from './services/artifacts'; import type { FleetRouter } from './types/request_context'; import { TelemetryEventsSender } from './telemetry/sender'; @@ -131,8 +128,6 @@ const allSavedObjectTypes = [ PACKAGE_POLICY_SAVED_OBJECT_TYPE, PACKAGES_SAVED_OBJECT_TYPE, ASSETS_SAVED_OBJECT_TYPE, - AGENT_SAVED_OBJECT_TYPE, - ENROLLMENT_API_KEYS_SAVED_OBJECT_TYPE, PRECONFIGURATION_DELETION_RECORD_SAVED_OBJECT_TYPE, ]; @@ -335,15 +330,10 @@ export class FleetPlugin }); licenseService.start(this.licensing$); - const fleetServerSetup = startFleetServerSetup(); - this.telemetryEventsSender.start(plugins.telemetry, core); return { - fleetSetupCompleted: () => - new Promise((resolve) => { - Promise.all([fleetServerSetup]).finally(() => resolve()); - }), + fleetSetupCompleted: () => Promise.resolve(), esIndexPatternService: new ESIndexPatternSavedObjectService(), packageService: { getInstallation, diff --git a/x-pack/plugins/fleet/server/routes/agent_policy/handlers.ts b/x-pack/plugins/fleet/server/routes/agent_policy/handlers.ts index c3da75183f5812..5f9ff51dadf656 100644 --- a/x-pack/plugins/fleet/server/routes/agent_policy/handlers.ts +++ b/x-pack/plugins/fleet/server/routes/agent_policy/handlers.ts @@ -7,13 +7,13 @@ import type { TypeOf } from '@kbn/config-schema'; import type { RequestHandler, ResponseHeaders } from 'src/core/server'; -import bluebird from 'bluebird'; +import pMap from 'p-map'; import { safeDump } from 'js-yaml'; import { fullAgentPolicyToYaml } from '../../../common/services'; import { appContextService, agentPolicyService, packagePolicyService } from '../../services'; import { getAgentsByKuery } from '../../services/agents'; -import { AGENT_SAVED_OBJECT_TYPE } from '../../constants'; +import { AGENTS_PREFIX } from '../../constants'; import type { GetAgentPoliciesRequestSchema, GetOneAgentPolicyRequestSchema, @@ -57,14 +57,14 @@ export const getAgentPoliciesHandler: RequestHandler< perPage, }; - await bluebird.map( + await pMap( items, (agentPolicy: GetAgentPoliciesResponseItem) => getAgentsByKuery(esClient, { showInactive: false, perPage: 0, page: 1, - kuery: `${AGENT_SAVED_OBJECT_TYPE}.policy_id:${agentPolicy.id}`, + kuery: `${AGENTS_PREFIX}.policy_id:${agentPolicy.id}`, }).then(({ total: agentTotal }) => (agentPolicy.agents = agentTotal)), { concurrency: 10 } ); diff --git a/x-pack/plugins/fleet/server/saved_objects/index.ts b/x-pack/plugins/fleet/server/saved_objects/index.ts index 19998c8d8bdbbb..3b459c938b5f07 100644 --- a/x-pack/plugins/fleet/server/saved_objects/index.ts +++ b/x-pack/plugins/fleet/server/saved_objects/index.ts @@ -14,29 +14,19 @@ import { PACKAGE_POLICY_SAVED_OBJECT_TYPE, PACKAGES_SAVED_OBJECT_TYPE, ASSETS_SAVED_OBJECT_TYPE, - AGENT_SAVED_OBJECT_TYPE, - AGENT_ACTION_SAVED_OBJECT_TYPE, - ENROLLMENT_API_KEYS_SAVED_OBJECT_TYPE, GLOBAL_SETTINGS_SAVED_OBJECT_TYPE, PRECONFIGURATION_DELETION_RECORD_SAVED_OBJECT_TYPE, } from '../constants'; import { - migrateAgentActionToV7100, migrateAgentPolicyToV7100, - migrateAgentToV7100, - migrateEnrollmentApiKeysToV7100, migratePackagePolicyToV7100, migrateSettingsToV7100, } from './migrations/to_v7_10_0'; import { migratePackagePolicyToV7110 } from './migrations/to_v7_11_0'; -import { - migrateAgentPolicyToV7120, - migrateAgentToV7120, - migratePackagePolicyToV7120, -} from './migrations/to_v7_12_0'; +import { migrateAgentPolicyToV7120, migratePackagePolicyToV7120 } from './migrations/to_v7_12_0'; import { migratePackagePolicyToV7130, migrateSettingsToV7130, @@ -75,66 +65,6 @@ const getSavedObjectTypes = ( '7.13.0': migrateSettingsToV7130, }, }, - [AGENT_SAVED_OBJECT_TYPE]: { - name: AGENT_SAVED_OBJECT_TYPE, - hidden: false, - namespaceType: 'agnostic', - management: { - importableAndExportable: false, - }, - mappings: { - properties: { - type: { type: 'keyword' }, - active: { type: 'boolean' }, - enrolled_at: { type: 'date' }, - unenrolled_at: { type: 'date' }, - unenrollment_started_at: { type: 'date' }, - upgraded_at: { type: 'date' }, - upgrade_started_at: { type: 'date' }, - access_api_key_id: { type: 'keyword' }, - version: { type: 'keyword' }, - user_provided_metadata: { type: 'flattened' }, - local_metadata: { type: 'flattened' }, - policy_id: { type: 'keyword' }, - policy_revision: { type: 'integer' }, - last_updated: { type: 'date' }, - last_checkin: { type: 'date' }, - last_checkin_status: { type: 'keyword' }, - default_api_key_id: { type: 'keyword' }, - default_api_key: { type: 'binary' }, - updated_at: { type: 'date' }, - current_error_events: { type: 'text', index: false }, - packages: { type: 'keyword' }, - }, - }, - migrations: { - '7.10.0': migrateAgentToV7100, - '7.12.0': migrateAgentToV7120, - }, - }, - [AGENT_ACTION_SAVED_OBJECT_TYPE]: { - name: AGENT_ACTION_SAVED_OBJECT_TYPE, - hidden: false, - namespaceType: 'agnostic', - management: { - importableAndExportable: false, - }, - mappings: { - properties: { - agent_id: { type: 'keyword' }, - policy_id: { type: 'keyword' }, - policy_revision: { type: 'integer' }, - type: { type: 'keyword' }, - data: { type: 'binary' }, - ack_data: { type: 'text' }, - sent_at: { type: 'date' }, - created_at: { type: 'date' }, - }, - }, - migrations: { - '7.10.0': migrateAgentActionToV7100(encryptedSavedObjects), - }, - }, [AGENT_POLICY_SAVED_OBJECT_TYPE]: { name: AGENT_POLICY_SAVED_OBJECT_TYPE, hidden: false, @@ -167,30 +97,6 @@ const getSavedObjectTypes = ( '7.12.0': migrateAgentPolicyToV7120, }, }, - [ENROLLMENT_API_KEYS_SAVED_OBJECT_TYPE]: { - name: ENROLLMENT_API_KEYS_SAVED_OBJECT_TYPE, - hidden: false, - namespaceType: 'agnostic', - management: { - importableAndExportable: false, - }, - mappings: { - properties: { - name: { type: 'keyword' }, - type: { type: 'keyword' }, - api_key: { type: 'binary' }, - api_key_id: { type: 'keyword' }, - policy_id: { type: 'keyword' }, - created_at: { type: 'date' }, - updated_at: { type: 'date' }, - expire_at: { type: 'date' }, - active: { type: 'boolean' }, - }, - }, - migrations: { - '7.10.0': migrateEnrollmentApiKeysToV7100, - }, - }, [OUTPUT_SAVED_OBJECT_TYPE]: { name: OUTPUT_SAVED_OBJECT_TYPE, hidden: false, @@ -399,48 +305,4 @@ export function registerEncryptedSavedObjects( encryptedSavedObjects: EncryptedSavedObjectsPluginSetup ) { // Encrypted saved objects - encryptedSavedObjects.registerType({ - type: ENROLLMENT_API_KEYS_SAVED_OBJECT_TYPE, - attributesToEncrypt: new Set(['api_key']), - attributesToExcludeFromAAD: new Set([ - 'name', - 'type', - 'api_key_id', - 'policy_id', - 'created_at', - 'updated_at', - 'expire_at', - 'active', - ]), - }); - encryptedSavedObjects.registerType({ - type: AGENT_SAVED_OBJECT_TYPE, - attributesToEncrypt: new Set(['default_api_key']), - attributesToExcludeFromAAD: new Set([ - 'type', - 'active', - 'enrolled_at', - 'access_api_key_id', - 'version', - 'user_provided_metadata', - 'local_metadata', - 'policy_id', - 'policy_revision', - 'last_updated', - 'last_checkin', - 'last_checkin_status', - 'updated_at', - 'current_error_events', - 'unenrolled_at', - 'unenrollment_started_at', - 'packages', - 'upgraded_at', - 'upgrade_started_at', - ]), - }); - encryptedSavedObjects.registerType({ - type: AGENT_ACTION_SAVED_OBJECT_TYPE, - attributesToEncrypt: new Set(['data']), - attributesToExcludeFromAAD: new Set(['agent_id', 'type', 'sent_at', 'created_at']), - }); } diff --git a/x-pack/plugins/fleet/server/saved_objects/migrations/to_v7_10_0.ts b/x-pack/plugins/fleet/server/saved_objects/migrations/to_v7_10_0.ts index 64338690977c96..bb54c55ac75a64 100644 --- a/x-pack/plugins/fleet/server/saved_objects/migrations/to_v7_10_0.ts +++ b/x-pack/plugins/fleet/server/saved_objects/migrations/to_v7_10_0.ts @@ -5,33 +5,9 @@ * 2.0. */ -import type { SavedObjectMigrationFn, SavedObjectUnsanitizedDoc } from 'kibana/server'; +import type { SavedObjectMigrationFn } from 'kibana/server'; -import type { EncryptedSavedObjectsPluginSetup } from '../../../../encrypted_saved_objects/server'; -import type { - Agent, - AgentPolicy, - PackagePolicy, - EnrollmentAPIKey, - Settings, - AgentAction, -} from '../../types'; - -export const migrateAgentToV7100: SavedObjectMigrationFn< - Exclude & { - config_id?: string; - config_revision?: number | null; - }, - Agent -> = (agentDoc) => { - agentDoc.attributes.policy_id = agentDoc.attributes.config_id; - delete agentDoc.attributes.config_id; - - agentDoc.attributes.policy_revision = agentDoc.attributes.config_revision; - delete agentDoc.attributes.config_revision; - - return agentDoc; -}; +import type { AgentPolicy, PackagePolicy, Settings } from '../../types'; export const migrateAgentPolicyToV7100: SavedObjectMigrationFn< Exclude & { @@ -46,18 +22,6 @@ export const migrateAgentPolicyToV7100: SavedObjectMigrationFn< return agentPolicyDoc; }; -export const migrateEnrollmentApiKeysToV7100: SavedObjectMigrationFn< - Exclude & { - config_id?: string; - }, - EnrollmentAPIKey -> = (enrollmentApiKeyDoc) => { - enrollmentApiKeyDoc.attributes.policy_id = enrollmentApiKeyDoc.attributes.config_id; - delete enrollmentApiKeyDoc.attributes.config_id; - - return enrollmentApiKeyDoc; -}; - export const migratePackagePolicyToV7100: SavedObjectMigrationFn< Exclude & { config_id: string; @@ -84,45 +48,3 @@ export const migrateSettingsToV7100: SavedObjectMigrationFn< return settingsDoc; }; - -export const migrateAgentActionToV7100 = ( - encryptedSavedObjects: EncryptedSavedObjectsPluginSetup -): SavedObjectMigrationFn => { - return encryptedSavedObjects.createMigration({ - isMigrationNeededPredicate: ( - agentActionDoc - ): agentActionDoc is SavedObjectUnsanitizedDoc => { - // @ts-expect-error - return agentActionDoc.attributes.type === 'CONFIG_CHANGE'; - }, - migration: (agentActionDoc) => { - let agentActionData; - try { - agentActionData = agentActionDoc.attributes.data - ? JSON.parse(agentActionDoc.attributes.data) - : undefined; - } catch (e) { - // Silently swallow JSON parsing error - } - if (agentActionData && agentActionData.config) { - const { - attributes: { data, ...restOfAttributes }, - } = agentActionDoc; - const { config, ...restOfData } = agentActionData; - return { - ...agentActionDoc, - attributes: { - ...restOfAttributes, - type: 'POLICY_CHANGE', - data: JSON.stringify({ - ...restOfData, - policy: config, - }), - }, - }; - } else { - return agentActionDoc; - } - }, - }); -}; diff --git a/x-pack/plugins/fleet/server/saved_objects/migrations/to_v7_12_0.ts b/x-pack/plugins/fleet/server/saved_objects/migrations/to_v7_12_0.ts index ad7a179f50766e..fde71388cbbdeb 100644 --- a/x-pack/plugins/fleet/server/saved_objects/migrations/to_v7_12_0.ts +++ b/x-pack/plugins/fleet/server/saved_objects/migrations/to_v7_12_0.ts @@ -7,18 +7,10 @@ import type { SavedObjectMigrationFn } from 'kibana/server'; -import type { Agent, AgentPolicy } from '../../types'; +import type { AgentPolicy } from '../../types'; export { migratePackagePolicyToV7120 } from './security_solution/to_v7_12_0'; -export const migrateAgentToV7120: SavedObjectMigrationFn = ( - agentDoc -) => { - delete agentDoc.attributes.shared_id; - - return agentDoc; -}; - export const migrateAgentPolicyToV7120: SavedObjectMigrationFn< Exclude, AgentPolicy diff --git a/x-pack/plugins/fleet/server/services/agent_policy.ts b/x-pack/plugins/fleet/server/services/agent_policy.ts index b1a45b5a92421d..bb9360b834b37f 100644 --- a/x-pack/plugins/fleet/server/services/agent_policy.ts +++ b/x-pack/plugins/fleet/server/services/agent_policy.ts @@ -20,7 +20,7 @@ import { SavedObjectsErrorHelpers } from '../../../../../src/core/server'; import type { AuthenticatedUser } from '../../../security/server'; import { AGENT_POLICY_SAVED_OBJECT_TYPE, - AGENT_SAVED_OBJECT_TYPE, + AGENTS_PREFIX, PRECONFIGURATION_DELETION_RECORD_SAVED_OBJECT_TYPE, } from '../constants'; import type { @@ -626,7 +626,7 @@ class AgentPolicyService { showInactive: false, perPage: 0, page: 1, - kuery: `${AGENT_SAVED_OBJECT_TYPE}.policy_id:${id}`, + kuery: `${AGENTS_PREFIX}.policy_id:${id}`, }); if (total > 0) { diff --git a/x-pack/plugins/fleet/server/services/agents/crud.ts b/x-pack/plugins/fleet/server/services/agents/crud.ts index b8d7c284309df4..516acf5a120dea 100644 --- a/x-pack/plugins/fleet/server/services/agents/crud.ts +++ b/x-pack/plugins/fleet/server/services/agents/crud.ts @@ -16,7 +16,7 @@ import type { AgentSOAttributes, Agent, BulkActionResult, ListWithKuery } from ' import { appContextService, agentPolicyService } from '../../services'; import type { FleetServerAgent } from '../../../common'; import { isAgentUpgradeable, SO_SEARCH_LIMIT } from '../../../common'; -import { AGENT_SAVED_OBJECT_TYPE, AGENTS_INDEX } from '../../constants'; +import { AGENTS_PREFIX, AGENTS_INDEX } from '../../constants'; import { escapeSearchQueryPhrase, normalizeKuery } from '../saved_object'; import { IngestManagerError, isESClientError, AgentNotFoundError } from '../../errors'; @@ -176,7 +176,7 @@ export async function countInactiveAgents( const filters = [INACTIVE_AGENT_CONDITION]; if (kuery && kuery !== '') { - filters.push(normalizeKuery(AGENT_SAVED_OBJECT_TYPE, kuery)); + filters.push(normalizeKuery(AGENTS_PREFIX, kuery)); } const kueryNode = _joinFilters(filters); diff --git a/x-pack/plugins/fleet/server/services/agents/crud_so.ts b/x-pack/plugins/fleet/server/services/agents/crud_so.ts deleted file mode 100644 index aa3cb4e4ec1a75..00000000000000 --- a/x-pack/plugins/fleet/server/services/agents/crud_so.ts +++ /dev/null @@ -1,255 +0,0 @@ -/* - * 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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import Boom from '@hapi/boom'; -import type { SavedObjectsBulkUpdateObject, SavedObjectsClientContract } from 'src/core/server'; - -import type { KueryNode } from '@kbn/es-query'; -import { fromKueryExpression } from '@kbn/es-query'; - -import { isAgentUpgradeable } from '../../../common'; -import { AGENT_SAVED_OBJECT_TYPE } from '../../constants'; -import type { AgentSOAttributes, Agent, ListWithKuery } from '../../types'; -import { escapeSearchQueryPhrase, normalizeKuery, findAllSOs } from '../saved_object'; -import { appContextService } from '../../services'; - -import { savedObjectToAgent } from './saved_objects'; - -const ACTIVE_AGENT_CONDITION = `${AGENT_SAVED_OBJECT_TYPE}.attributes.active:true`; -const INACTIVE_AGENT_CONDITION = `NOT (${ACTIVE_AGENT_CONDITION})`; - -function _joinFilters(filters: Array) { - return filters - .filter((filter) => filter !== undefined) - .reduce( - ( - acc: KueryNode | undefined, - kuery: string | KueryNode | undefined - ): KueryNode | undefined => { - if (kuery === undefined) { - return acc; - } - const kueryNode: KueryNode = - typeof kuery === 'string' - ? fromKueryExpression(normalizeKuery(AGENT_SAVED_OBJECT_TYPE, kuery)) - : kuery; - - if (!acc) { - return kueryNode; - } - - return { - type: 'function', - function: 'and', - arguments: [acc, kueryNode], - }; - }, - undefined as KueryNode | undefined - ); -} - -export async function listAgents( - soClient: SavedObjectsClientContract, - options: ListWithKuery & { - showInactive: boolean; - } -): Promise<{ - agents: Agent[]; - total: number; - page: number; - perPage: number; -}> { - const { - page = 1, - perPage = 20, - sortField = 'enrolled_at', - sortOrder = 'desc', - kuery, - showInactive = false, - showUpgradeable, - } = options; - const filters: Array = []; - - if (kuery && kuery !== '') { - filters.push(kuery); - } - - if (showInactive === false) { - filters.push(ACTIVE_AGENT_CONDITION); - } - try { - let { saved_objects: agentSOs, total } = await soClient.find({ - type: AGENT_SAVED_OBJECT_TYPE, - filter: _joinFilters(filters) || '', - sortField, - sortOrder, - page, - perPage, - }); - // filtering for a range on the version string will not work, - // nor does filtering on a flattened field (local_metadata), so filter here - if (showUpgradeable) { - agentSOs = agentSOs.filter((agent) => - isAgentUpgradeable(savedObjectToAgent(agent), appContextService.getKibanaVersion()) - ); - total = agentSOs.length; - } - - return { - agents: agentSOs.map(savedObjectToAgent), - total, - page, - perPage, - }; - } catch (e) { - if (e.output?.payload?.message?.startsWith('The key is empty')) { - return { - agents: [], - total: 0, - page: 0, - perPage: 0, - }; - } else { - throw e; - } - } -} - -export async function listAllAgents( - soClient: SavedObjectsClientContract, - options: Omit & { - showInactive: boolean; - } -): Promise<{ - agents: Agent[]; - total: number; -}> { - const { sortField = 'enrolled_at', sortOrder = 'desc', kuery, showInactive = false } = options; - const filters = []; - - if (kuery && kuery !== '') { - filters.push(kuery); - } - - if (showInactive === false) { - filters.push(ACTIVE_AGENT_CONDITION); - } - - const { saved_objects: agentSOs, total } = await findAllSOs(soClient, { - type: AGENT_SAVED_OBJECT_TYPE, - kuery: _joinFilters(filters), - sortField, - sortOrder, - }); - - return { - agents: agentSOs.map(savedObjectToAgent), - total, - }; -} - -export async function countInactiveAgents( - soClient: SavedObjectsClientContract, - options: Pick -): Promise { - const { kuery } = options; - const filters = [INACTIVE_AGENT_CONDITION]; - - if (kuery && kuery !== '') { - filters.push(normalizeKuery(AGENT_SAVED_OBJECT_TYPE, kuery)); - } - - const { total } = await soClient.find({ - type: AGENT_SAVED_OBJECT_TYPE, - filter: _joinFilters(filters), - perPage: 0, - }); - - return total; -} - -export async function getAgent(soClient: SavedObjectsClientContract, agentId: string) { - const agent = savedObjectToAgent( - await soClient.get(AGENT_SAVED_OBJECT_TYPE, agentId) - ); - return agent; -} - -export async function getAgents(soClient: SavedObjectsClientContract, agentIds: string[]) { - const agentSOs = await soClient.bulkGet( - agentIds.map((agentId) => ({ - id: agentId, - type: AGENT_SAVED_OBJECT_TYPE, - })) - ); - const agents = agentSOs.saved_objects.map(savedObjectToAgent); - return agents; -} - -export async function getAgentByAccessAPIKeyId( - soClient: SavedObjectsClientContract, - accessAPIKeyId: string -): Promise { - const response = await soClient.find({ - type: AGENT_SAVED_OBJECT_TYPE, - searchFields: ['access_api_key_id'], - search: escapeSearchQueryPhrase(accessAPIKeyId), - }); - const [agent] = response.saved_objects.map(savedObjectToAgent); - - if (!agent) { - throw Boom.notFound('Agent not found'); - } - if (agent.access_api_key_id !== accessAPIKeyId) { - throw new Error('Agent api key id is not matching'); - } - if (!agent.active) { - throw Boom.forbidden('Agent inactive'); - } - - return agent; -} - -export async function updateAgent( - soClient: SavedObjectsClientContract, - agentId: string, - data: Partial -) { - await soClient.update(AGENT_SAVED_OBJECT_TYPE, agentId, data); -} - -export async function bulkUpdateAgents( - soClient: SavedObjectsClientContract, - updateData: Array<{ - agentId: string; - data: Partial; - }> -) { - const updates: Array> = updateData.map( - ({ agentId, data }) => ({ - type: AGENT_SAVED_OBJECT_TYPE, - id: agentId, - attributes: data, - }) - ); - - const res = await soClient.bulkUpdate(updates); - - return { - items: res.saved_objects.map((so) => ({ - id: so.id, - success: !so.error, - error: so.error, - })), - }; -} - -export async function deleteAgent(soClient: SavedObjectsClientContract, agentId: string) { - await soClient.update(AGENT_SAVED_OBJECT_TYPE, agentId, { - active: false, - }); -} diff --git a/x-pack/plugins/fleet/server/services/agents/status.ts b/x-pack/plugins/fleet/server/services/agents/status.ts index ee30843e74e1a9..5c5176ec413520 100644 --- a/x-pack/plugins/fleet/server/services/agents/status.ts +++ b/x-pack/plugins/fleet/server/services/agents/status.ts @@ -11,7 +11,7 @@ import pMap from 'p-map'; import type { KueryNode } from '@kbn/es-query'; import { fromKueryExpression } from '@kbn/es-query'; -import { AGENT_SAVED_OBJECT_TYPE } from '../../constants'; +import { AGENTS_PREFIX } from '../../constants'; import type { AgentStatus } from '../../types'; import { AgentStatusKueryHelper } from '../../../common/services'; @@ -70,8 +70,8 @@ export async function getAgentStatusForAgentPolicy( ...[ kuery, filterKuery, - `${AGENT_SAVED_OBJECT_TYPE}.attributes.active:true`, - agentPolicyId ? `${AGENT_SAVED_OBJECT_TYPE}.policy_id:"${agentPolicyId}"` : undefined, + `${AGENTS_PREFIX}.attributes.active:true`, + agentPolicyId ? `${AGENTS_PREFIX}.policy_id:"${agentPolicyId}"` : undefined, ] ), }), diff --git a/x-pack/plugins/fleet/server/services/agents/update.ts b/x-pack/plugins/fleet/server/services/agents/update.ts index 74386efe65613d..cbe7853425fa6d 100644 --- a/x-pack/plugins/fleet/server/services/agents/update.ts +++ b/x-pack/plugins/fleet/server/services/agents/update.ts @@ -7,7 +7,7 @@ import type { ElasticsearchClient, SavedObjectsClientContract } from 'src/core/server'; -import { AGENT_SAVED_OBJECT_TYPE } from '../../constants'; +import { AGENTS_PREFIX } from '../../constants'; import { getAgentsByKuery } from './crud'; import { unenrollAgent } from './unenroll'; @@ -21,7 +21,7 @@ export async function unenrollForAgentPolicyId( let page = 1; while (hasMore) { const { agents } = await getAgentsByKuery(esClient, { - kuery: `${AGENT_SAVED_OBJECT_TYPE}.policy_id:"${policyId}"`, + kuery: `${AGENTS_PREFIX}.policy_id:"${policyId}"`, page: page++, perPage: 1000, showInactive: false, diff --git a/x-pack/plugins/fleet/server/services/agents/upgrade.ts b/x-pack/plugins/fleet/server/services/agents/upgrade.ts index 988d3c63223f49..ce5536df359ba9 100644 --- a/x-pack/plugins/fleet/server/services/agents/upgrade.ts +++ b/x-pack/plugins/fleet/server/services/agents/upgrade.ts @@ -7,8 +7,7 @@ import type { ElasticsearchClient, SavedObjectsClientContract } from 'src/core/server'; -import type { Agent, AgentAction, AgentActionSOAttributes, BulkActionResult } from '../../types'; -import { AGENT_ACTION_SAVED_OBJECT_TYPE } from '../../constants'; +import type { Agent, BulkActionResult } from '../../types'; import { agentPolicyService } from '../../services'; import { AgentReassignmentError, @@ -68,23 +67,6 @@ export async function sendUpgradeAgentAction({ }); } -export async function ackAgentUpgraded( - soClient: SavedObjectsClientContract, - esClient: ElasticsearchClient, - agentAction: AgentAction -) { - const { - attributes: { ack_data: ackData }, - } = await soClient.get(AGENT_ACTION_SAVED_OBJECT_TYPE, agentAction.id); - if (!ackData) throw new Error('data missing from UPGRADE action'); - const { version } = JSON.parse(ackData); - if (!version) throw new Error('version missing from UPGRADE action'); - await updateAgent(esClient, agentAction.agent_id, { - upgraded_at: new Date().toISOString(), - upgrade_started_at: null, - }); -} - export async function sendUpgradeAgentsActions( soClient: SavedObjectsClientContract, esClient: ElasticsearchClient, diff --git a/x-pack/plugins/fleet/server/services/api_keys/enrollment_api_key_so.ts b/x-pack/plugins/fleet/server/services/api_keys/enrollment_api_key_so.ts deleted file mode 100644 index a2b40200fe1367..00000000000000 --- a/x-pack/plugins/fleet/server/services/api_keys/enrollment_api_key_so.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { SavedObjectsClientContract, SavedObject } from 'src/core/server'; - -import type { EnrollmentAPIKey, EnrollmentAPIKeySOAttributes } from '../../types'; -import { ENROLLMENT_API_KEYS_SAVED_OBJECT_TYPE } from '../../constants'; -import { appContextService } from '../app_context'; -import { normalizeKuery } from '../saved_object'; - -export async function listEnrollmentApiKeys( - soClient: SavedObjectsClientContract, - options: { - page?: number; - perPage?: number; - kuery?: string; - showInactive?: boolean; - } -): Promise<{ items: EnrollmentAPIKey[]; total: any; page: any; perPage: any }> { - const { page = 1, perPage = 20, kuery } = options; - - // eslint-disable-next-line @typescript-eslint/naming-convention - const { saved_objects, total } = await soClient.find({ - type: ENROLLMENT_API_KEYS_SAVED_OBJECT_TYPE, - page, - perPage, - sortField: 'created_at', - sortOrder: 'desc', - filter: - kuery && kuery !== '' - ? normalizeKuery(ENROLLMENT_API_KEYS_SAVED_OBJECT_TYPE, kuery) - : undefined, - }); - - const items = saved_objects.map(savedObjectToEnrollmentApiKey); - - return { - items, - total, - page, - perPage, - }; -} - -export async function getEnrollmentAPIKey(soClient: SavedObjectsClientContract, id: string) { - const so = await appContextService - .getEncryptedSavedObjects() - .getDecryptedAsInternalUser( - ENROLLMENT_API_KEYS_SAVED_OBJECT_TYPE, - id - ); - return savedObjectToEnrollmentApiKey(so); -} - -function savedObjectToEnrollmentApiKey({ - error, - attributes, - id, -}: SavedObject): EnrollmentAPIKey { - if (error) { - throw new Error(error.message); - } - - return { - id, - ...attributes, - }; -} diff --git a/x-pack/plugins/fleet/server/services/fleet_server/index.ts b/x-pack/plugins/fleet/server/services/fleet_server/index.ts index 0d386b9ba49959..55b0fb0dff2254 100644 --- a/x-pack/plugins/fleet/server/services/fleet_server/index.ts +++ b/x-pack/plugins/fleet/server/services/fleet_server/index.ts @@ -6,23 +6,9 @@ */ import type { ElasticsearchClient } from 'kibana/server'; -import { first } from 'rxjs/operators'; -import { appContextService } from '../app_context'; -import { licenseService } from '../license'; import { FLEET_SERVER_SERVERS_INDEX } from '../../constants'; -import { runFleetServerMigration } from './saved_object_migrations'; - -let _isFleetServerSetup = false; -let _isPending = false; -let _status: Promise | undefined; -let _onResolve: (arg?: any) => void; - -export function isFleetServerSetup() { - return _isFleetServerSetup; -} - /** * Check if at least one fleet server is connected */ @@ -35,48 +21,3 @@ export async function hasFleetServers(esClient: ElasticsearchClient) { // @ts-expect-error value is number | TotalHits return res.body.hits.total.value > 0; } - -export async function awaitIfFleetServerSetupPending() { - if (!_isPending) { - return; - } - - return _status; -} - -export async function startFleetServerSetup() { - _isPending = true; - _status = new Promise((resolve) => { - _onResolve = resolve; - }); - const logger = appContextService.getLogger(); - - // Check for security - if (!appContextService.hasSecurity()) { - // Fleet will not work if security is not enabled - logger?.warn('Fleet requires the security plugin to be enabled.'); - return; - } - - // Log information about custom registry URL - const customUrl = appContextService.getConfig()?.registryUrl; - if (customUrl) { - logger.info( - `Custom registry url is an experimental feature and is unsupported. Using custom registry at ${customUrl}` - ); - } - - try { - // We need licence to be initialized before using the SO service. - await licenseService.getLicenseInformation$()?.pipe(first())?.toPromise(); - await runFleetServerMigration(); - _isFleetServerSetup = true; - } catch (err) { - logger?.error('Setup for central management of agents failed.'); - logger?.error(err); - } - _isPending = false; - if (_onResolve) { - _onResolve(); - } -} diff --git a/x-pack/plugins/fleet/server/services/fleet_server/saved_object_migrations.ts b/x-pack/plugins/fleet/server/services/fleet_server/saved_object_migrations.ts deleted file mode 100644 index bbaf9c9479eb42..00000000000000 --- a/x-pack/plugins/fleet/server/services/fleet_server/saved_object_migrations.ts +++ /dev/null @@ -1,201 +0,0 @@ -/* - * 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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { isBoom } from '@hapi/boom'; -import type { KibanaRequest } from 'src/core/server'; - -import { - ENROLLMENT_API_KEYS_INDEX, - ENROLLMENT_API_KEYS_SAVED_OBJECT_TYPE, - AGENT_POLICY_INDEX, - AGENTS_INDEX, - AGENT_SAVED_OBJECT_TYPE, - SO_SEARCH_LIMIT, -} from '../../../common'; -import type { - FleetServerEnrollmentAPIKey, - AgentSOAttributes, - FleetServerAgent, -} from '../../../common'; -import { listEnrollmentApiKeys, getEnrollmentAPIKey } from '../api_keys/enrollment_api_key_so'; -import { appContextService } from '../app_context'; -import { agentPolicyService } from '../agent_policy'; -import { invalidateAPIKeys } from '../api_keys'; -import { settingsService } from '..'; - -export async function runFleetServerMigration() { - await settingsService.settingsSetup(getInternalUserSOClient()); - await Promise.all([migrateEnrollmentApiKeys(), migrateAgentPolicies(), migrateAgents()]); -} - -function getInternalUserSOClient() { - const fakeRequest = { - headers: {}, - getBasePath: () => '', - path: '/', - route: { settings: {} }, - url: { - href: '/', - }, - raw: { - req: { - url: '/', - }, - }, - } as unknown as KibanaRequest; - - return appContextService.getInternalUserSOClient(fakeRequest); -} - -async function migrateAgents() { - const esClient = appContextService.getInternalUserESClient(); - const soClient = getInternalUserSOClient(); - const logger = appContextService.getLogger(); - let hasMore = true; - - let hasAgents = false; - - while (hasMore) { - const res = await soClient.find({ - type: AGENT_SAVED_OBJECT_TYPE, - page: 1, - perPage: 100, - }); - - if (res.total === 0) { - hasMore = false; - } else { - hasAgents = true; - } - - for (const so of res.saved_objects) { - try { - const { attributes } = await appContextService - .getEncryptedSavedObjects() - .getDecryptedAsInternalUser(AGENT_SAVED_OBJECT_TYPE, so.id); - - await invalidateAPIKeys( - [attributes.access_api_key_id, attributes.default_api_key_id].filter( - (keyId): keyId is string => keyId !== undefined - ) - ).catch((error) => { - logger.error(`Invalidating API keys for agent ${so.id} failed: ${error.message}`); - }); - - const body: FleetServerAgent = { - type: attributes.type, - active: false, - enrolled_at: attributes.enrolled_at, - unenrolled_at: new Date().toISOString(), - unenrollment_started_at: attributes.unenrollment_started_at, - upgraded_at: attributes.upgraded_at, - upgrade_started_at: attributes.upgrade_started_at, - access_api_key_id: attributes.access_api_key_id, - user_provided_metadata: attributes.user_provided_metadata, - local_metadata: attributes.local_metadata, - policy_id: attributes.policy_id, - policy_revision_idx: attributes.policy_revision || undefined, - last_checkin: attributes.last_checkin, - last_checkin_status: attributes.last_checkin_status, - default_api_key_id: attributes.default_api_key_id, - default_api_key: attributes.default_api_key, - packages: attributes.packages, - }; - await esClient.create({ - index: AGENTS_INDEX, - body, - id: so.id, - refresh: 'wait_for', - }); - - await soClient.delete(AGENT_SAVED_OBJECT_TYPE, so.id); - } catch (error) { - // swallow 404 error has multiple Kibana can run the migration at the same time - if (!is404Error(error)) { - throw error; - } - } - } - } - - // Update settings to show migration modal - if (hasAgents) { - await settingsService.saveSettings(soClient, { - has_seen_fleet_migration_notice: false, - }); - } -} - -async function migrateEnrollmentApiKeys() { - const esClient = appContextService.getInternalUserESClient(); - const soClient = getInternalUserSOClient(); - let hasMore = true; - while (hasMore) { - const res = await listEnrollmentApiKeys(soClient, { - page: 1, - perPage: 100, - }); - if (res.total === 0) { - hasMore = false; - } - for (const item of res.items) { - try { - const key = await getEnrollmentAPIKey(soClient, item.id); - - const body: FleetServerEnrollmentAPIKey = { - api_key: key.api_key, - api_key_id: key.api_key_id, - active: key.active, - created_at: key.created_at, - name: key.name, - policy_id: key.policy_id, - }; - await esClient.create({ - index: ENROLLMENT_API_KEYS_INDEX, - body, - id: key.id, - refresh: 'wait_for', - }); - - await soClient.delete(ENROLLMENT_API_KEYS_SAVED_OBJECT_TYPE, key.id); - } catch (error) { - // swallow 404 error has multiple Kibana can run the migration at the same time - if (!is404Error(error)) { - throw error; - } - } - } - } -} - -async function migrateAgentPolicies() { - const esClient = appContextService.getInternalUserESClient(); - const soClient = getInternalUserSOClient(); - const { items: agentPolicies } = await agentPolicyService.list(soClient, { - perPage: SO_SEARCH_LIMIT, - }); - - await Promise.all( - agentPolicies.map(async (agentPolicy) => { - const res = await esClient.search({ - index: AGENT_POLICY_INDEX, - q: `policy_id:${agentPolicy.id}`, - track_total_hits: true, - ignore_unavailable: true, - }); - - // @ts-expect-error value is number | TotalHits - if (res.body.hits.total.value === 0) { - return agentPolicyService.createFleetServerPolicy(soClient, agentPolicy.id); - } - }) - ); -} - -function is404Error(error: any) { - return isBoom(error) && error.output.statusCode === 404; -} diff --git a/x-pack/plugins/fleet/server/services/setup.ts b/x-pack/plugins/fleet/server/services/setup.ts index 37d79c1bb691d2..7cde9c4c052d65 100644 --- a/x-pack/plugins/fleet/server/services/setup.ts +++ b/x-pack/plugins/fleet/server/services/setup.ts @@ -26,7 +26,6 @@ import { generateEnrollmentAPIKey, hasEnrollementAPIKeysForPolicy } from './api_ import { settingsService } from '.'; import { awaitIfPending } from './setup_utils'; import { ensureFleetServerAgentPoliciesExists } from './agents'; -import { awaitIfFleetServerSetupPending } from './fleet_server'; import { ensureFleetFinalPipelineIsInstalled } from './epm/elasticsearch/ingest_pipeline/install'; import { ensureDefaultComponentTemplate } from './epm/elasticsearch/template/install'; import { getInstallations, installPackage } from './epm/packages'; @@ -68,7 +67,6 @@ async function createSetupSideEffects( const defaultOutput = await outputService.ensureDefaultOutput(soClient); - await awaitIfFleetServerSetupPending(); if (appContextService.getConfig()?.agentIdVerificationEnabled) { await ensureFleetGlobalEsAssets(soClient, esClient); } diff --git a/x-pack/plugins/fleet/server/types/index.tsx b/x-pack/plugins/fleet/server/types/index.tsx index 174aac03d6a3cf..9d3e9128647855 100644 --- a/x-pack/plugins/fleet/server/types/index.tsx +++ b/x-pack/plugins/fleet/server/types/index.tsx @@ -13,7 +13,6 @@ export type { AgentType, AgentAction, AgentPolicyAction, - AgentPolicyActionV7_9, BaseAgentActionSOAttributes, AgentActionSOAttributes, AgentPolicyActionSOAttributes, diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.helpers.ts index 311acb13d3f061..e3184cadbdc499 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.helpers.ts @@ -9,7 +9,7 @@ import { act } from 'react-dom/test-utils'; import { ReactWrapper } from 'enzyme'; import { EuiDescriptionListDescription } from '@elastic/eui'; -import { registerTestBed, TestBed, TestBedConfig, findTestSubject } from '@kbn/test/jest'; +import { registerTestBed, TestBed, AsyncTestBedConfig, findTestSubject } from '@kbn/test/jest'; import { DataStream } from '../../../common'; import { IndexManagementHome } from '../../../public/application/sections/home'; import { indexManagementStore } from '../../../public/application/store'; @@ -42,7 +42,7 @@ export interface DataStreamsTabTestBed extends TestBed { } export const setup = async (overridingDependencies: any = {}): Promise => { - const testBedConfig: TestBedConfig = { + const testBedConfig: AsyncTestBedConfig = { store: () => indexManagementStore(services as any), memoryRouter: { initialEntries: [`/indices`], diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home/home.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/home.helpers.ts index a15e4f2a613d3e..ad8aceb7d56b81 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/home/home.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/home.helpers.ts @@ -5,12 +5,12 @@ * 2.0. */ -import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest'; import { IndexManagementHome } from '../../../public/application/sections/home'; import { indexManagementStore } from '../../../public/application/store'; import { WithAppDependencies, services, TestSubjects } from '../helpers'; -const testBedConfig: TestBedConfig = { +const testBedConfig: AsyncTestBedConfig = { store: () => indexManagementStore(services as any), memoryRouter: { initialEntries: [`/indices?includeHidden=true`], diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home/index_templates_tab.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/index_templates_tab.helpers.ts index 7431686c02bbfe..4ddd14562577ab 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/home/index_templates_tab.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/index_templates_tab.helpers.ts @@ -7,12 +7,12 @@ import { act } from 'react-dom/test-utils'; -import { registerTestBed, TestBed, TestBedConfig, findTestSubject } from '@kbn/test/jest'; +import { registerTestBed, TestBed, AsyncTestBedConfig, findTestSubject } from '@kbn/test/jest'; import { TemplateList } from '../../../public/application/sections/home/template_list'; import { TemplateDeserialized } from '../../../common'; import { WithAppDependencies, TestSubjects } from '../helpers'; -const testBedConfig: TestBedConfig = { +const testBedConfig: AsyncTestBedConfig = { memoryRouter: { initialEntries: [`/templates`], componentRoutePath: `/templates/:templateName?`, diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home/indices_tab.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/indices_tab.helpers.ts index 2576b5f92b7b2c..0e4564163c5534 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/home/indices_tab.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/indices_tab.helpers.ts @@ -8,12 +8,12 @@ import { act } from 'react-dom/test-utils'; import { ReactWrapper } from 'enzyme'; -import { registerTestBed, TestBed, TestBedConfig, findTestSubject } from '@kbn/test/jest'; +import { registerTestBed, TestBed, AsyncTestBedConfig, findTestSubject } from '@kbn/test/jest'; import { IndexManagementHome } from '../../../public/application/sections/home'; import { indexManagementStore } from '../../../public/application/store'; import { WithAppDependencies, services, TestSubjects } from '../helpers'; -const testBedConfig: TestBedConfig = { +const testBedConfig: AsyncTestBedConfig = { store: () => indexManagementStore(services as any), memoryRouter: { initialEntries: [`/indices?includeHiddenIndices=true`], diff --git a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_clone.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_clone.helpers.ts index 222bee28aef4b9..dffa6fee19d061 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_clone.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_clone.helpers.ts @@ -5,14 +5,14 @@ * 2.0. */ -import { registerTestBed, TestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, AsyncTestBedConfig } from '@kbn/test/jest'; import { TemplateClone } from '../../../public/application/sections/template_clone'; import { WithAppDependencies } from '../helpers'; import { formSetup } from './template_form.helpers'; import { TEMPLATE_NAME } from './constants'; -const testBedConfig: TestBedConfig = { +const testBedConfig: AsyncTestBedConfig = { memoryRouter: { initialEntries: [`/clone_template/${TEMPLATE_NAME}`], componentRoutePath: `/clone_template/:name`, diff --git a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_create.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_create.helpers.ts index 7d3b34a6b82387..450d2c524b4455 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_create.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_create.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, TestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, AsyncTestBedConfig } from '@kbn/test/jest'; import { TemplateCreate } from '../../../public/application/sections/template_create'; import { WithAppDependencies } from '../helpers'; @@ -16,7 +16,7 @@ export const setup: any = (isLegacy: boolean = false) => { ? { pathname: '/create_template', search: '?legacy=true' } : { pathname: '/create_template' }; - const testBedConfig: TestBedConfig = { + const testBedConfig: AsyncTestBedConfig = { memoryRouter: { initialEntries: [route], componentRoutePath: route, diff --git a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_edit.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_edit.helpers.ts index e087c9432c4c2b..6c73da3b3379d4 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_edit.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_edit.helpers.ts @@ -5,14 +5,14 @@ * 2.0. */ -import { registerTestBed, TestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, AsyncTestBedConfig } from '@kbn/test/jest'; import { TemplateEdit } from '../../../public/application/sections/template_edit'; import { WithAppDependencies } from '../helpers'; import { formSetup, TestSubjects } from './template_form.helpers'; import { TEMPLATE_NAME } from './constants'; -const testBedConfig: TestBedConfig = { +const testBedConfig: AsyncTestBedConfig = { memoryRouter: { initialEntries: [`/edit_template/${TEMPLATE_NAME}`], componentRoutePath: `/edit_template/:name`, diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_create.helpers.ts b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_create.helpers.ts index 9d28d57e531cb7..06f0036cc5c77b 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_create.helpers.ts +++ b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_create.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest'; import { BASE_PATH } from '../../../../../../../common'; import { ComponentTemplateCreate } from '../../../component_template_wizard'; @@ -19,7 +19,7 @@ export type ComponentTemplateCreateTestBed = TestBed; }; -const testBedConfig: TestBedConfig = { +const testBedConfig: AsyncTestBedConfig = { memoryRouter: { initialEntries: [`${BASE_PATH}/create_component_template`], componentRoutePath: `${BASE_PATH}/create_component_template`, diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_edit.helpers.ts b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_edit.helpers.ts index 093a01d8db41c1..e7b8df245aaa9f 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_edit.helpers.ts +++ b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_edit.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest'; import { BASE_PATH } from '../../../../../../../common'; import { ComponentTemplateEdit } from '../../../component_template_wizard'; @@ -19,7 +19,7 @@ export type ComponentTemplateEditTestBed = TestBed; }; -const testBedConfig: TestBedConfig = { +const testBedConfig: AsyncTestBedConfig = { memoryRouter: { initialEntries: [`${BASE_PATH}/edit_component_template/comp-1`], componentRoutePath: `${BASE_PATH}/edit_component_template/:name`, diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_list.helpers.ts b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_list.helpers.ts index a8d548a9bf2b8f..680550d16096b7 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_list.helpers.ts +++ b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_list.helpers.ts @@ -7,12 +7,18 @@ import { act } from 'react-dom/test-utils'; -import { registerTestBed, TestBed, TestBedConfig, findTestSubject, nextTick } from '@kbn/test/jest'; +import { + registerTestBed, + TestBed, + AsyncTestBedConfig, + findTestSubject, + nextTick, +} from '@kbn/test/jest'; import { BASE_PATH } from '../../../../../../../common'; import { WithAppDependencies } from './setup_environment'; import { ComponentTemplateList } from '../../../component_template_list/component_template_list'; -const testBedConfig: TestBedConfig = { +const testBedConfig: AsyncTestBedConfig = { memoryRouter: { initialEntries: [`${BASE_PATH}component_templates`], componentRoutePath: `${BASE_PATH}component_templates`, diff --git a/x-pack/plugins/infra/public/components/autocomplete_field/autocomplete_field.tsx b/x-pack/plugins/infra/public/components/autocomplete_field/autocomplete_field.tsx index 0e3e2018c963ba..4aa0edb406856a 100644 --- a/x-pack/plugins/infra/public/components/autocomplete_field/autocomplete_field.tsx +++ b/x-pack/plugins/infra/public/components/autocomplete_field/autocomplete_field.tsx @@ -73,6 +73,7 @@ export class AutocompleteField extends React.Component< placeholder={placeholder} value={value} aria-label={ariaLabel} + data-test-subj="infraSearchField" /> {areSuggestionsVisible && !isLoadingSuggestions && suggestions.length > 0 ? ( diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/bottom_drawer.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/bottom_drawer.tsx index 31bc09f9d4dd8d..3681d740d93d07 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/bottom_drawer.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/bottom_drawer.tsx @@ -52,6 +52,7 @@ export const BottomDrawer: React.FC<{ aria-expanded={isOpen} iconType={isOpen ? 'arrowDown' : 'arrowRight'} onClick={onClick} + data-test-subj="toggleTimelineButton" > {isOpen ? hideHistory : showHistory} diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx index 65c3136cb48a6b..0a511589298d06 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx @@ -210,7 +210,9 @@ export const Timeline: React.FC = ({ interval, yAxisFormatter, isVisible } return ( - + diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.tsx index acc6ae7af2727a..7d2a327a50826e 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.tsx @@ -55,6 +55,7 @@ export class CustomFieldPanel extends React.PureComponent { fullWidth > { /> { - + {group.name} diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/legend_controls.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/legend_controls.tsx index 06b7739e03c54a..bd7d0ad2f2a491 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/legend_controls.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/legend_controls.tsx @@ -84,6 +84,7 @@ export const LegendControls = ({ defaultMessage: 'configure legend', })} onClick={() => setPopoverState(true)} + data-test-subj="openLegendControlsButton" /> ); @@ -131,6 +132,7 @@ export const LegendControls = ({ bounds: { min: draftBounds.min / 100, max: draftBounds.max / 100 }, legend: draftLegend, }); + setPopoverState(false); }, [onChange, draftAuto, draftBounds, draftLegend]); const handleCancelClick = useCallback(() => { @@ -179,7 +181,7 @@ export const LegendControls = ({ : []; return ( - + { {valueMode ? ( - - {value} + + + {value} + ) : ( ellipsisMode && ( diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx index 9f350610b1366d..ff40a269aed42d 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx @@ -134,6 +134,7 @@ export class WaffleGroupByControls extends React.PureComponent { {buttonBody} @@ -147,7 +148,11 @@ export class WaffleGroupByControls extends React.PureComponent { panelPaddingSize="none" closePopover={this.handleClose} > - + ); } diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_sort_controls.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_sort_controls.tsx index dfa293041d64ad..dd5b1857e1e64a 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_sort_controls.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_sort_controls.tsx @@ -39,6 +39,7 @@ export const WaffleSortControls = ({ sort, onChange }: Props) => { {label} @@ -59,7 +60,8 @@ export const WaffleSortControls = ({ sort, onChange }: Props) => { ...sort, direction: sort.direction === 'asc' ? 'desc' : 'asc', }); - }, [sort, onChange]); + closePopover(); + }, [closePopover, sort, onChange]); const panels = useMemo( () => [ @@ -71,11 +73,13 @@ export const WaffleSortControls = ({ sort, onChange }: Props) => { name: LABELS.name, icon: sort.by === 'name' ? 'check' : 'empty', onClick: selectName, + 'data-test-subj': 'waffleSortByName', }, { name: LABELS.value, icon: sort.by === 'value' ? 'check' : 'empty', onClick: selectValue, + 'data-test-subj': 'waffleSortByValue', }, ], }, @@ -101,6 +105,7 @@ export const WaffleSortControls = ({ sort, onChange }: Props) => { })} checked={sort.direction === 'desc'} onChange={toggleSort} + data-test-subj={'waffleSortByDirection'} /> diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_clone.helpers.ts b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_clone.helpers.ts index cf30870cefbbde..51f6d9bd96bd6a 100644 --- a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_clone.helpers.ts +++ b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_clone.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, TestBedConfig, TestBed } from '@kbn/test/jest'; +import { registerTestBed, AsyncTestBedConfig, TestBed } from '@kbn/test/jest'; import { PipelinesClone } from '../../../public/application/sections/pipelines_clone'; import { getFormActions, PipelineFormTestSubjects } from './pipeline_form.helpers'; import { WithAppDependencies } from './setup_environment'; @@ -28,7 +28,7 @@ export const PIPELINE_TO_CLONE = { ], }; -const testBedConfig: TestBedConfig = { +const testBedConfig: AsyncTestBedConfig = { memoryRouter: { initialEntries: [getClonePath({ clonedPipelineName: PIPELINE_TO_CLONE.name })], componentRoutePath: ROUTES.clone, diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_create.helpers.ts b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_create.helpers.ts index 06c880bbceda40..faf1b42042ec1e 100644 --- a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_create.helpers.ts +++ b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_create.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, TestBedConfig, TestBed } from '@kbn/test/jest'; +import { registerTestBed, AsyncTestBedConfig, TestBed } from '@kbn/test/jest'; import { PipelinesCreate } from '../../../public/application/sections/pipelines_create'; import { getFormActions, PipelineFormTestSubjects } from './pipeline_form.helpers'; import { WithAppDependencies } from './setup_environment'; @@ -15,7 +15,7 @@ export type PipelinesCreateTestBed = TestBed & { actions: ReturnType; }; -const testBedConfig: TestBedConfig = { +const testBedConfig: AsyncTestBedConfig = { memoryRouter: { initialEntries: [getCreatePath()], componentRoutePath: ROUTES.create, diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_edit.helpers.ts b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_edit.helpers.ts index 913eb1355a6d74..9a3c41196653f4 100644 --- a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_edit.helpers.ts +++ b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_edit.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, TestBedConfig, TestBed } from '@kbn/test/jest'; +import { registerTestBed, AsyncTestBedConfig, TestBed } from '@kbn/test/jest'; import { PipelinesEdit } from '../../../public/application/sections/pipelines_edit'; import { getFormActions, PipelineFormTestSubjects } from './pipeline_form.helpers'; import { WithAppDependencies } from './setup_environment'; @@ -28,7 +28,7 @@ export const PIPELINE_TO_EDIT = { ], }; -const testBedConfig: TestBedConfig = { +const testBedConfig: AsyncTestBedConfig = { memoryRouter: { initialEntries: [getEditPath({ pipelineName: PIPELINE_TO_EDIT.name })], componentRoutePath: ROUTES.edit, diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_list.helpers.ts b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_list.helpers.ts index 5f340b645f9544..3cd768104203a0 100644 --- a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_list.helpers.ts +++ b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_list.helpers.ts @@ -7,12 +7,12 @@ import { act } from 'react-dom/test-utils'; -import { registerTestBed, TestBed, TestBedConfig, findTestSubject } from '@kbn/test/jest'; +import { registerTestBed, TestBed, AsyncTestBedConfig, findTestSubject } from '@kbn/test/jest'; import { PipelinesList } from '../../../public/application/sections/pipelines_list'; import { WithAppDependencies } from './setup_environment'; import { getListPath, ROUTES } from '../../../public/application/services/navigation'; -const testBedConfig: TestBedConfig = { +const testBedConfig: AsyncTestBedConfig = { memoryRouter: { initialEntries: [getListPath()], componentRoutePath: ROUTES.list, diff --git a/x-pack/plugins/lens/public/datatable_visualization/components/__snapshots__/table_basic.test.tsx.snap b/x-pack/plugins/lens/public/datatable_visualization/components/__snapshots__/table_basic.test.tsx.snap index 7e3c8c3342e4ca..bf8497e686e969 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/components/__snapshots__/table_basic.test.tsx.snap +++ b/x-pack/plugins/lens/public/datatable_visualization/components/__snapshots__/table_basic.test.tsx.snap @@ -487,7 +487,7 @@ exports[`DatatableComponent it renders the title and value 1`] = ` `; -exports[`DatatableComponent it should render hide and reset actions on header even when it is in read only mode 1`] = ` +exports[`DatatableComponent it should render hide, reset, and sort actions on header even when it is in read only mode 1`] = ` { ).toMatchSnapshot(); }); - test('it should render hide and reset actions on header even when it is in read only mode', () => { + test('it should render hide, reset, and sort actions on header even when it is in read only mode', () => { const { data, args } = sampleArgs(); expect( diff --git a/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.tsx b/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.tsx index 6be69e5d4d2368..f627a3ef8ff91d 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.tsx @@ -103,11 +103,9 @@ export const DatatableComponent = (props: DatatableRenderProps) => { const onEditAction = useCallback( (data: LensSortAction['data'] | LensResizeAction['data'] | LensToggleAction['data']) => { - if (renderMode === 'edit') { - dispatchEvent({ name: 'edit', data }); - } + dispatchEvent({ name: 'edit', data }); }, - [dispatchEvent, renderMode] + [dispatchEvent] ); const onRowContextMenuClick = useCallback( (data: LensTableRowContextMenuEvent['data']) => { diff --git a/x-pack/plugins/lens/public/editor_frame_service/service.tsx b/x-pack/plugins/lens/public/editor_frame_service/service.tsx index d97cfd3cbca23b..b585d03e12f8ff 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/service.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/service.tsx @@ -61,16 +61,19 @@ export class EditorFrameService { private readonly datasources: Array Promise)> = []; private readonly visualizations: Array Promise)> = []; + private loadDatasources = () => collectAsyncDefinitions(this.datasources); + public loadVisualizations = () => collectAsyncDefinitions(this.visualizations); + /** * This method takes a Lens saved object as returned from the persistence helper, * initializes datsources and visualization and creates the current expression. - * This is an asynchronous process and should only be triggered once for a saved object. + * This is an asynchronous process. * @param doc parsed Lens saved object */ public documentToExpression = async (doc: Document) => { const [resolvedDatasources, resolvedVisualizations] = await Promise.all([ - collectAsyncDefinitions(this.datasources), - collectAsyncDefinitions(this.visualizations), + this.loadDatasources(), + this.loadVisualizations(), ]); const { persistedStateToExpression } = await import('../async_services'); @@ -92,8 +95,8 @@ export class EditorFrameService { public start(core: CoreStart, plugins: EditorFrameStartPlugins): EditorFrameStart { const createInstance = async (): Promise => { const [resolvedDatasources, resolvedVisualizations] = await Promise.all([ - collectAsyncDefinitions(this.datasources), - collectAsyncDefinitions(this.visualizations), + this.loadDatasources(), + this.loadVisualizations(), ]); const { EditorFrame } = await import('../async_services'); diff --git a/x-pack/plugins/lens/public/embeddable/embeddable.test.tsx b/x-pack/plugins/lens/public/embeddable/embeddable.test.tsx index 4c247c031eac08..59d6325e1c0ce8 100644 --- a/x-pack/plugins/lens/public/embeddable/embeddable.test.tsx +++ b/x-pack/plugins/lens/public/embeddable/embeddable.test.tsx @@ -25,6 +25,7 @@ import { LensAttributeService } from '../lens_attribute_service'; import { OnSaveProps } from '../../../../../src/plugins/saved_objects/public/save_modal'; import { act } from 'react-dom/test-utils'; import { inspectorPluginMock } from '../../../../../src/plugins/inspector/public/mocks'; +import { Visualization } from '../types'; jest.mock('../../../../../src/plugins/inspector/public/', () => ({ isAvailable: false, @@ -125,6 +126,7 @@ describe('embeddable', () => { }, inspector: inspectorPluginMock.createStartContract(), getTrigger, + visualizationMap: {}, documentToExpression: () => Promise.resolve({ ast: { @@ -165,6 +167,7 @@ describe('embeddable', () => { inspector: inspectorPluginMock.createStartContract(), capabilities: { canSaveDashboards: true, canSaveVisualizations: true }, getTrigger, + visualizationMap: {}, documentToExpression: () => Promise.resolve({ ast: { @@ -209,6 +212,7 @@ describe('embeddable', () => { canSaveVisualizations: true, }, getTrigger, + visualizationMap: {}, documentToExpression: () => Promise.resolve({ ast: { @@ -255,6 +259,7 @@ describe('embeddable', () => { canSaveVisualizations: true, }, getTrigger, + visualizationMap: {}, documentToExpression: () => Promise.resolve({ ast: { @@ -297,6 +302,7 @@ describe('embeddable', () => { canSaveVisualizations: true, }, getTrigger, + visualizationMap: {}, documentToExpression: () => Promise.resolve({ ast: { @@ -336,6 +342,7 @@ describe('embeddable', () => { canSaveVisualizations: true, }, getTrigger, + visualizationMap: {}, documentToExpression: () => Promise.resolve({ ast: { @@ -378,6 +385,7 @@ describe('embeddable', () => { indexPatternService: {} as IndexPatternsContract, capabilities: { canSaveDashboards: true, canSaveVisualizations: true }, getTrigger, + visualizationMap: {}, documentToExpression: () => Promise.resolve({ ast: { @@ -427,6 +435,7 @@ describe('embeddable', () => { canSaveVisualizations: true, }, getTrigger, + visualizationMap: {}, documentToExpression: () => Promise.resolve({ ast: { @@ -474,6 +483,7 @@ describe('embeddable', () => { canSaveVisualizations: true, }, getTrigger, + visualizationMap: {}, documentToExpression: () => Promise.resolve({ ast: { @@ -528,6 +538,7 @@ describe('embeddable', () => { canSaveVisualizations: true, }, getTrigger, + visualizationMap: {}, documentToExpression: () => Promise.resolve({ ast: { @@ -583,6 +594,7 @@ describe('embeddable', () => { canSaveVisualizations: true, }, getTrigger, + visualizationMap: {}, documentToExpression: () => Promise.resolve({ ast: { @@ -641,6 +653,7 @@ describe('embeddable', () => { canSaveVisualizations: true, }, getTrigger, + visualizationMap: {}, documentToExpression: () => Promise.resolve({ ast: { @@ -683,6 +696,7 @@ describe('embeddable', () => { canSaveVisualizations: true, }, getTrigger, + visualizationMap: {}, documentToExpression: () => Promise.resolve({ ast: { @@ -725,6 +739,7 @@ describe('embeddable', () => { canSaveVisualizations: true, }, getTrigger, + visualizationMap: {}, documentToExpression: () => Promise.resolve({ ast: { @@ -767,6 +782,7 @@ describe('embeddable', () => { canSaveVisualizations: true, }, getTrigger, + visualizationMap: {}, documentToExpression: () => Promise.resolve({ ast: { @@ -824,6 +840,7 @@ describe('embeddable', () => { canSaveVisualizations: true, }, getTrigger, + visualizationMap: {}, documentToExpression: () => Promise.resolve({ ast: { @@ -897,6 +914,7 @@ describe('embeddable', () => { canSaveVisualizations: true, }, getTrigger, + visualizationMap: {}, documentToExpression: () => Promise.resolve({ ast: { @@ -945,6 +963,7 @@ describe('embeddable', () => { canSaveVisualizations: true, }, getTrigger, + visualizationMap: {}, documentToExpression: () => Promise.resolve({ ast: { @@ -993,6 +1012,7 @@ describe('embeddable', () => { canSaveVisualizations: true, }, getTrigger, + visualizationMap: {}, documentToExpression: () => Promise.resolve({ ast: { @@ -1016,4 +1036,82 @@ describe('embeddable', () => { expect(onTableRowClick).toHaveBeenCalledWith({ name: 'test' }); expect(onTableRowClick).toHaveBeenCalledTimes(1); }); + + it('handles edit actions ', async () => { + const editedVisualizationState = { value: 'edited' }; + const onEditActionMock = jest.fn().mockReturnValue(editedVisualizationState); + const documentToExpressionMock = jest.fn().mockImplementation(async (document) => { + const isStateEdited = document.state.visualization.value === 'edited'; + return { + ast: { + type: 'expression', + chain: [ + { + type: 'function', + function: isStateEdited ? 'edited' : 'not_edited', + arguments: {}, + }, + ], + }, + errors: undefined, + }; + }); + + const visDocument: Document = { + state: { + visualization: {}, + datasourceStates: {}, + query: { query: '', language: 'lucene' }, + filters: [], + }, + references: [], + title: 'My title', + visualizationType: 'lensDatatable', + }; + + const embeddable = new Embeddable( + { + timefilter: dataPluginMock.createSetupContract().query.timefilter.timefilter, + attributeService: attributeServiceMockFromSavedVis(visDocument), + expressionRenderer, + basePath, + inspector: inspectorPluginMock.createStartContract(), + indexPatternService: {} as IndexPatternsContract, + capabilities: { + canSaveDashboards: true, + canSaveVisualizations: true, + }, + getTrigger, + visualizationMap: { + [visDocument.visualizationType as string]: { + onEditAction: onEditActionMock, + } as unknown as Visualization, + }, + documentToExpression: documentToExpressionMock, + }, + { id: '123' } as unknown as LensEmbeddableInput + ); + + // SETUP FRESH STATE + await embeddable.initializeSavedVis({ id: '123' } as LensEmbeddableInput); + embeddable.render(mountpoint); + + await new Promise((resolve) => setTimeout(resolve, 0)); + + expect(expressionRenderer).toHaveBeenCalledTimes(1); + expect(expressionRenderer.mock.calls[0][0]!.expression).toBe(`not_edited`); + + // TEST EDIT EVENT + await embeddable.handleEvent({ name: 'edit' }); + + expect(onEditActionMock).toHaveBeenCalledTimes(1); + expect(documentToExpressionMock).toHaveBeenCalled(); + + const docToExpCalls = documentToExpressionMock.mock.calls; + const editedVisDocument = docToExpCalls[docToExpCalls.length - 1][0]; + expect(editedVisDocument.state.visualization).toEqual(editedVisualizationState); + + expect(expressionRenderer).toHaveBeenCalledTimes(2); + expect(expressionRenderer.mock.calls[1][0]!.expression).toBe(`edited`); + }); }); diff --git a/x-pack/plugins/lens/public/embeddable/embeddable.tsx b/x-pack/plugins/lens/public/embeddable/embeddable.tsx index 7faf873cf0b0a9..563e10bb03abd9 100644 --- a/x-pack/plugins/lens/public/embeddable/embeddable.tsx +++ b/x-pack/plugins/lens/public/embeddable/embeddable.tsx @@ -47,10 +47,13 @@ import { UiActionsStart } from '../../../../../src/plugins/ui_actions/public'; import { isLensBrushEvent, isLensFilterEvent, + isLensEditEvent, isLensTableRowContextMenuClickEvent, LensBrushEvent, LensFilterEvent, LensTableRowContextMenuEvent, + VisualizationMap, + Visualization, } from '../types'; import { IndexPatternsContract } from '../../../../../src/plugins/data/public'; @@ -97,6 +100,7 @@ export interface LensEmbeddableDeps { documentToExpression: ( doc: Document ) => Promise<{ ast: Ast | null; errors: ErrorMessage[] | undefined }>; + visualizationMap: VisualizationMap; indexPatternService: IndexPatternsContract; expressionRenderer: ReactExpressionRendererType; timefilter: TimefilterContract; @@ -109,6 +113,17 @@ export interface LensEmbeddableDeps { spaces?: SpacesPluginStart; } +const getExpressionFromDocument = async ( + document: Document, + documentToExpression: LensEmbeddableDeps['documentToExpression'] +) => { + const { ast, errors } = await documentToExpression(document); + return { + expression: ast ? toExpression(ast) : null, + errors, + }; +}; + export class Embeddable extends AbstractEmbeddable implements ReferenceOrValueEmbeddable @@ -260,6 +275,29 @@ export class Embeddable return this.lensInspector.adapters; } + private maybeAddConflictError( + errors: ErrorMessage[], + sharingSavedObjectProps?: SharingSavedObjectProps + ) { + const ret = [...errors]; + + if (sharingSavedObjectProps?.outcome === 'conflict' && !!this.deps.spaces) { + ret.push({ + shortMessage: i18n.translate('xpack.lens.embeddable.legacyURLConflict.shortMessage', { + defaultMessage: `You've encountered a URL conflict`, + }), + longMessage: ( + + ), + }); + } + + return ret; + } + async initializeSavedVis(input: LensEmbeddableInput) { const attrs: ResolvedLensSavedObjectAttributes | false = await this.deps.attributeService .unwrapAttributes(input) @@ -278,23 +316,14 @@ export class Embeddable type: this.type, savedObjectId: (input as LensByReferenceInput)?.savedObjectId, }; - const { ast, errors } = await this.deps.documentToExpression(this.savedVis); - this.errors = errors; - if (sharingSavedObjectProps?.outcome === 'conflict' && this.deps.spaces) { - const conflictError = { - shortMessage: i18n.translate('xpack.lens.embeddable.legacyURLConflict.shortMessage', { - defaultMessage: `You've encountered a URL conflict`, - }), - longMessage: ( - - ), - }; - this.errors = this.errors ? [...this.errors, conflictError] : [conflictError]; - } - this.expression = ast ? toExpression(ast) : null; + + const { expression, errors } = await getExpressionFromDocument( + this.savedVis, + this.deps.documentToExpression + ); + this.expression = expression; + this.errors = errors && this.maybeAddConflictError(errors, sharingSavedObjectProps); + if (this.errors) { this.logError('validation'); } @@ -432,7 +461,17 @@ export class Embeddable return output; } - handleEvent = (event: ExpressionRendererEvent) => { + private get onEditAction(): Visualization['onEditAction'] { + const visType = this.savedVis?.visualizationType; + + if (!visType) { + return; + } + + return this.deps.visualizationMap[visType].onEditAction; + } + + handleEvent = async (event: ExpressionRendererEvent) => { if (!this.deps.getTrigger || this.input.disableTriggers) { return; } @@ -468,9 +507,29 @@ export class Embeddable this.input.onTableRowClick(event.data as unknown as LensTableRowContextMenuEvent['data']); } } + + // We allow for edit actions in the Embeddable for display purposes only (e.g. changing the datatable sort order). + // No state changes made here with an edit action are persisted. + if (isLensEditEvent(event) && this.onEditAction) { + if (!this.savedVis) return; + + // have to dance since this.savedVis.state is readonly + const newVis = JSON.parse(JSON.stringify(this.savedVis)) as Document; + newVis.state.visualization = this.onEditAction(newVis.state.visualization, event); + this.savedVis = newVis; + + const { expression, errors } = await getExpressionFromDocument( + this.savedVis, + this.deps.documentToExpression + ); + this.expression = expression; + this.errors = errors; + + this.reload(); + } }; - async reload() { + reload() { if (!this.savedVis || !this.isInitialized || this.isDestroyed) { return; } diff --git a/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts b/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts index e51ec4c3e55882..811f391e32f9af 100644 --- a/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts +++ b/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts @@ -25,6 +25,7 @@ import { DOC_TYPE } from '../../common/constants'; import { ErrorMessage } from '../editor_frame_service/types'; import { extract, inject } from '../../common/embeddable_factory'; import type { SpacesPluginStart } from '../../../spaces/public'; +import { VisualizationMap } from '../types'; export interface LensEmbeddableStartServices { timefilter: TimefilterContract; @@ -39,6 +40,7 @@ export interface LensEmbeddableStartServices { documentToExpression: ( doc: Document ) => Promise<{ ast: Ast | null; errors: ErrorMessage[] | undefined }>; + visualizationMap: VisualizationMap; spaces?: SpacesPluginStart; } @@ -85,6 +87,7 @@ export class EmbeddableFactory implements EmbeddableFactoryDefinition { timefilter, expressionRenderer, documentToExpression, + visualizationMap, uiActions, coreHttp, attributeService, @@ -108,6 +111,7 @@ export class EmbeddableFactory implements EmbeddableFactoryDefinition { getTrigger: uiActions?.getTrigger, getTriggerCompatibleActions: uiActions?.getTriggerCompatibleActions, documentToExpression, + visualizationMap, capabilities: { canSaveDashboards: Boolean(capabilities.dashboard?.showWriteControls), canSaveVisualizations: Boolean(capabilities.visualize.save), diff --git a/x-pack/plugins/lens/public/plugin.ts b/x-pack/plugins/lens/public/plugin.ts index 1532b2b0991048..fb0a922c7e9a29 100644 --- a/x-pack/plugins/lens/public/plugin.ts +++ b/x-pack/plugins/lens/public/plugin.ts @@ -201,6 +201,8 @@ export class LensPlugin { plugins.fieldFormats.deserialize ); + const visualizationMap = await this.editorFrameService!.loadVisualizations(); + return { attributeService: getLensAttributeService(coreStart, plugins), capabilities: coreStart.application.capabilities, @@ -208,6 +210,7 @@ export class LensPlugin { timefilter: plugins.data.query.timefilter.timefilter, expressionRenderer: plugins.expressions.ReactExpressionRenderer, documentToExpression: this.editorFrameService!.documentToExpression, + visualizationMap, indexPatternService: plugins.data.indexPatterns, uiActions: plugins.uiActions, usageCollection, diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx index 21090ce671d02a..720dcd232d2f37 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx @@ -667,17 +667,6 @@ export const ConfigurationStepForm: FC = ({ )} - - - - = ({ setUnsupportedFieldsError={setUnsupportedFieldsError} setFormState={setFormState} /> + + + + {showScatterplotMatrix && ( <> { const mlLocator = useMlLocator()!; const navigateToPath = useNavigateToPath(); - const clickHandler = useCallback(async (item: DataFrameAnalyticsListRow) => { - const path = await mlLocator.getUrl({ - page: ML_PAGES.DATA_FRAME_ANALYTICS_MAP, - pageState: { jobId: item.id }, - }); + const [globalState] = useUrlState('_g'); - await navigateToPath(path, false); - }, []); + const clickHandler = useCallback( + async (item: DataFrameAnalyticsListRow) => { + const globalStateClone = cloneDeep(globalState || {}); + delete globalStateClone.ml; + + const path = await mlLocator.getUrl({ + page: ML_PAGES.DATA_FRAME_ANALYTICS_MAP, + pageState: { + jobId: item.id, + globalState: globalStateClone, + }, + }); + + await navigateToPath(path, false); + }, + [globalState] + ); const action: DataFrameAnalyticsListAction = useMemo( () => ({ diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx index 8423e569a99f24..a773fffdac9971 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx @@ -39,6 +39,7 @@ import { useTableSettings } from './use_table_settings'; import { RefreshAnalyticsListButton } from '../refresh_analytics_list_button'; import { ListingPageUrlState } from '../../../../../../../common/types/common'; import { JobsAwaitingNodeWarning } from '../../../../../components/jobs_awaiting_node_warning'; +import { useRefresh } from '../../../../../routing/use_refresh'; const filters: EuiSearchBarProps['filters'] = [ { @@ -119,6 +120,8 @@ export const DataFrameAnalyticsList: FC = ({ const [errorMessage, setErrorMessage] = useState(undefined); const [jobsAwaitingNodeCount, setJobsAwaitingNodeCount] = useState(0); + const refreshObs = useRefresh(); + const disabled = !checkPermission('canCreateDataFrameAnalytics') || !checkPermission('canStartStopDataFrameAnalytics'); @@ -174,6 +177,13 @@ export const DataFrameAnalyticsList: FC = ({ isManagementTable ); + useEffect( + function updateOnTimerRefresh() { + getAnalyticsCallback(); + }, + [refreshObs] + ); + const { columns, modals } = useColumns( expandedRowItemIds, setExpandedRowItemIds, diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/use_refresh_interval.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/use_refresh_interval.ts index c2335e4d5d0177..0f236984f587cb 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/use_refresh_interval.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/use_refresh_interval.ts @@ -8,6 +8,7 @@ import React, { useEffect } from 'react'; import { useMlKibana } from '../../../../../contexts/kibana'; +import { useUrlState } from '../../../../../util/url_state'; import { DEFAULT_REFRESH_INTERVAL_MS, @@ -20,6 +21,7 @@ export const useRefreshInterval = ( setBlockRefresh: React.Dispatch> ) => { const { services } = useMlKibana(); + const [globalState] = useUrlState('_g'); const { timefilter } = services.data.query.timefilter; const { refresh } = useRefreshAnalyticsList(); @@ -35,7 +37,9 @@ export const useRefreshInterval = ( initAutoRefresh(); function initAutoRefresh() { - const { value } = timefilter.getRefreshInterval(); + const interval = globalState?.refreshInterval ?? timefilter.getRefreshInterval(); + const { value } = interval; + if (value === 0) { // the auto refresher starts in an off state // so switch it on and set the interval to 30s diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.js index fe09ed45f1274a..d6926950dce7d2 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.js @@ -220,9 +220,21 @@ export async function cloneJob(jobId) { ]); const dataViewNames = await getDataViewNames(); - const jobIndicesAvailable = dataViewNames.includes(datafeed.indices.join(',')); + const dataViewTitle = datafeed.indices.join(','); + const jobIndicesAvailable = dataViewNames.includes(dataViewTitle); if (jobIndicesAvailable === false) { + const warningText = i18n.translate( + 'xpack.ml.jobsList.managementActions.noSourceDataViewForClone', + { + defaultMessage: + 'Unable to clone the anomaly detection job {jobId}. No data view exists for index {dataViewTitle}.', + values: { jobId, dataViewTitle }, + } + ); + getToastNotificationService().displayDangerToast(warningText, { + 'data-test-subj': 'mlCloneJobNoDataViewExistsWarningToast', + }); return; } diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js index cad5bb68fb62b7..31cdfa5df05762 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js @@ -1203,15 +1203,16 @@ class TimeseriesChartIntl extends Component { .call(brush) .selectAll('rect') .attr('y', -1) - .attr('height', contextChartHeight + swimlaneHeight + 1); + .attr('height', contextChartHeight + swimlaneHeight + 1) + .attr('width', this.vizWidth); + + const handleBrushExtent = brush.extent(); // move the left and right resize areas over to // be under the handles contextGroup.selectAll('.w rect').attr('x', -10).attr('width', 10); - contextGroup.selectAll('.e rect').attr('x', 0).attr('width', 10); - - const handleBrushExtent = brush.extent(); + contextGroup.selectAll('.e rect').attr('transform', null).attr('width', 10); const topBorder = contextGroup .append('rect') @@ -1247,6 +1248,7 @@ class TimeseriesChartIntl extends Component { function brushing() { const brushExtent = brush.extent(); mask.reveal(brushExtent); + leftHandle.attr('x', contextXScale(brushExtent[0]) - 10); rightHandle.attr('x', contextXScale(brushExtent[1]) + 0); diff --git a/x-pack/plugins/monitoring/server/lib/details/get_metrics.ts b/x-pack/plugins/monitoring/server/lib/details/get_metrics.ts index 83bb18169ae1e6..a8de5529d8ca61 100644 --- a/x-pack/plugins/monitoring/server/lib/details/get_metrics.ts +++ b/x-pack/plugins/monitoring/server/lib/details/get_metrics.ts @@ -6,7 +6,6 @@ */ import moment from 'moment'; -import Bluebird from 'bluebird'; import { checkParam } from '../error_missing_required'; import { getSeries } from './get_series'; import { calculateTimeseriesInterval } from '../calculate_timeseries_interval'; @@ -40,25 +39,29 @@ export async function getMetrics( min = max - numOfBuckets * bucketSize * 1000; } - return Bluebird.map(metricSet, (metric: Metric) => { - // metric names match the literal metric name, but they can be supplied in groups or individually - let metricNames; + return Promise.all( + metricSet.map((metric: Metric) => { + // metric names match the literal metric name, but they can be supplied in groups or individually + let metricNames; - if (typeof metric !== 'string') { - metricNames = metric.keys; - } else { - metricNames = [metric]; - } + if (typeof metric !== 'string') { + metricNames = typeof metric.keys === 'string' ? [metric.keys] : metric.keys; + } else { + metricNames = [metric]; + } - return Bluebird.map(metricNames, (metricName) => { - return getSeries(req, indexPattern, metricName, metricOptions, filters, groupBy, { - min, - max, - bucketSize, - timezone, - }); - }); - }).then((rows) => { + return Promise.all( + metricNames.map((metricName) => { + return getSeries(req, indexPattern, metricName, metricOptions, filters, groupBy, { + min, + max, + bucketSize, + timezone, + }); + }) + ); + }) + ).then((rows) => { const data: Record = {}; metricSet.forEach((key, index) => { // keyName must match the value stored in the html template diff --git a/x-pack/plugins/monitoring/server/lib/kibana/get_kibanas_for_clusters.ts b/x-pack/plugins/monitoring/server/lib/kibana/get_kibanas_for_clusters.ts index 4e806c07ee660b..5326976ec99acf 100644 --- a/x-pack/plugins/monitoring/server/lib/kibana/get_kibanas_for_clusters.ts +++ b/x-pack/plugins/monitoring/server/lib/kibana/get_kibanas_for_clusters.ts @@ -5,7 +5,6 @@ * 2.0. */ -import Bluebird from 'bluebird'; import { chain, find } from 'lodash'; import { LegacyRequest, Cluster, Bucket } from '../../types'; import { checkParam } from '../error_missing_required'; @@ -36,182 +35,184 @@ export function getKibanasForClusters( const start = req.payload.timeRange.min; const end = req.payload.timeRange.max; - return Bluebird.map(clusters, (cluster) => { - const clusterUuid = cluster.elasticsearch?.cluster?.id ?? cluster.cluster_uuid; - const metric = KibanaClusterMetric.getMetricFields(); - const params = { - index: kbnIndexPattern, - size: 0, - ignore_unavailable: true, - body: { - query: createQuery({ - types: ['stats', 'kibana_stats'], - start, - end, - clusterUuid, - metric, - }), - aggs: { - kibana_uuids: { - terms: { - field: 'kibana_stats.kibana.uuid', - size: config.get('monitoring.ui.max_bucket_size'), - }, - aggs: { - latest_report: { - terms: { - field: 'kibana_stats.timestamp', - size: 1, - order: { - _key: 'desc', - }, - }, - aggs: { - response_time_max: { - max: { - field: 'kibana_stats.response_times.max', + return Promise.all( + clusters.map((cluster) => { + const clusterUuid = cluster.elasticsearch?.cluster?.id ?? cluster.cluster_uuid; + const metric = KibanaClusterMetric.getMetricFields(); + const params = { + index: kbnIndexPattern, + size: 0, + ignore_unavailable: true, + body: { + query: createQuery({ + types: ['stats', 'kibana_stats'], + start, + end, + clusterUuid, + metric, + }), + aggs: { + kibana_uuids: { + terms: { + field: 'kibana_stats.kibana.uuid', + size: config.get('monitoring.ui.max_bucket_size'), + }, + aggs: { + latest_report: { + terms: { + field: 'kibana_stats.timestamp', + size: 1, + order: { + _key: 'desc', }, }, - memory_rss: { - max: { - field: 'kibana_stats.process.memory.resident_set_size_in_bytes', + aggs: { + response_time_max: { + max: { + field: 'kibana_stats.response_times.max', + }, }, - }, - memory_heap_size_limit: { - max: { - field: 'kibana_stats.process.memory.heap.size_limit', + memory_rss: { + max: { + field: 'kibana_stats.process.memory.resident_set_size_in_bytes', + }, }, - }, - concurrent_connections: { - max: { - field: 'kibana_stats.concurrent_connections', + memory_heap_size_limit: { + max: { + field: 'kibana_stats.process.memory.heap.size_limit', + }, }, - }, - requests_total: { - max: { - field: 'kibana_stats.requests.total', + concurrent_connections: { + max: { + field: 'kibana_stats.concurrent_connections', + }, + }, + requests_total: { + max: { + field: 'kibana_stats.requests.total', + }, }, }, }, - }, - response_time_max_per: { - max_bucket: { - buckets_path: 'latest_report>response_time_max', + response_time_max_per: { + max_bucket: { + buckets_path: 'latest_report>response_time_max', + }, }, - }, - memory_rss_per: { - max_bucket: { - buckets_path: 'latest_report>memory_rss', + memory_rss_per: { + max_bucket: { + buckets_path: 'latest_report>memory_rss', + }, }, - }, - memory_heap_size_limit_per: { - max_bucket: { - buckets_path: 'latest_report>memory_heap_size_limit', + memory_heap_size_limit_per: { + max_bucket: { + buckets_path: 'latest_report>memory_heap_size_limit', + }, }, - }, - concurrent_connections_per: { - max_bucket: { - buckets_path: 'latest_report>concurrent_connections', + concurrent_connections_per: { + max_bucket: { + buckets_path: 'latest_report>concurrent_connections', + }, }, - }, - requests_total_per: { - max_bucket: { - buckets_path: 'latest_report>requests_total', + requests_total_per: { + max_bucket: { + buckets_path: 'latest_report>requests_total', + }, }, }, }, - }, - response_time_max: { - max_bucket: { - buckets_path: 'kibana_uuids>response_time_max_per', - }, - }, - memory_rss: { - sum_bucket: { - buckets_path: 'kibana_uuids>memory_rss_per', + response_time_max: { + max_bucket: { + buckets_path: 'kibana_uuids>response_time_max_per', + }, }, - }, - memory_heap_size_limit: { - sum_bucket: { - buckets_path: 'kibana_uuids>memory_heap_size_limit_per', + memory_rss: { + sum_bucket: { + buckets_path: 'kibana_uuids>memory_rss_per', + }, }, - }, - concurrent_connections: { - sum_bucket: { - buckets_path: 'kibana_uuids>concurrent_connections_per', + memory_heap_size_limit: { + sum_bucket: { + buckets_path: 'kibana_uuids>memory_heap_size_limit_per', + }, }, - }, - requests_total: { - sum_bucket: { - buckets_path: 'kibana_uuids>requests_total_per', + concurrent_connections: { + sum_bucket: { + buckets_path: 'kibana_uuids>concurrent_connections_per', + }, }, - }, - status: { - terms: { - field: 'kibana_stats.kibana.status', - order: { - max_timestamp: 'desc', + requests_total: { + sum_bucket: { + buckets_path: 'kibana_uuids>requests_total_per', }, }, - aggs: { - max_timestamp: { - max: { - field: 'timestamp', + status: { + terms: { + field: 'kibana_stats.kibana.status', + order: { + max_timestamp: 'desc', + }, + }, + aggs: { + max_timestamp: { + max: { + field: 'timestamp', + }, }, }, }, }, }, - }, - }; + }; - const { callWithRequest } = req.server.plugins.elasticsearch.getCluster('monitoring'); - return callWithRequest(req, 'search', params).then((result) => { - const aggregations = result.aggregations ?? {}; - const kibanaUuids = aggregations.kibana_uuids?.buckets ?? []; - const statusBuckets = aggregations.status?.buckets ?? []; + const { callWithRequest } = req.server.plugins.elasticsearch.getCluster('monitoring'); + return callWithRequest(req, 'search', params).then((result) => { + const aggregations = result.aggregations ?? {}; + const kibanaUuids = aggregations.kibana_uuids?.buckets ?? []; + const statusBuckets = aggregations.status?.buckets ?? []; - // everything is initialized such that it won't impact any rollup - let status = null; - let requestsTotal = 0; - let connections = 0; - let responseTime = 0; - let memorySize = 0; - let memoryLimit = 0; + // everything is initialized such that it won't impact any rollup + let status = null; + let requestsTotal = 0; + let connections = 0; + let responseTime = 0; + let memorySize = 0; + let memoryLimit = 0; - // if the cluster has kibana instances at all - if (kibanaUuids.length) { - // get instance status by finding the latest status bucket - const latestTimestamp = chain(statusBuckets) - .map((bucket) => bucket.max_timestamp.value) - .max() - .value(); - const latestBucket = find( - statusBuckets, - (bucket) => bucket.max_timestamp.value === latestTimestamp - ); - status = latestBucket.key; + // if the cluster has kibana instances at all + if (kibanaUuids.length) { + // get instance status by finding the latest status bucket + const latestTimestamp = chain(statusBuckets) + .map((bucket) => bucket.max_timestamp.value) + .max() + .value(); + const latestBucket = find( + statusBuckets, + (bucket) => bucket.max_timestamp.value === latestTimestamp + ); + status = latestBucket.key; - requestsTotal = aggregations.requests_total?.value; - connections = aggregations.concurrent_connections?.value; - responseTime = aggregations.response_time_max?.value; - memorySize = aggregations.memory_rss?.value; - memoryLimit = aggregations.memory_heap_size_limit?.value; - } + requestsTotal = aggregations.requests_total?.value; + connections = aggregations.concurrent_connections?.value; + responseTime = aggregations.response_time_max?.value; + memorySize = aggregations.memory_rss?.value; + memoryLimit = aggregations.memory_heap_size_limit?.value; + } - return { - clusterUuid, - stats: { - uuids: kibanaUuids.map(({ key }: Bucket) => key), - status, - requests_total: requestsTotal, - concurrent_connections: connections, - response_time_max: responseTime, - memory_size: memorySize, - memory_limit: memoryLimit, - count: kibanaUuids.length, - }, - }; - }); - }); + return { + clusterUuid, + stats: { + uuids: kibanaUuids.map(({ key }: Bucket) => key), + status, + requests_total: requestsTotal, + concurrent_connections: connections, + response_time_max: responseTime, + memory_size: memorySize, + memory_limit: memoryLimit, + count: kibanaUuids.length, + }, + }; + }); + }) + ); } diff --git a/x-pack/plugins/monitoring/server/lib/logstash/get_logstash_for_clusters.ts b/x-pack/plugins/monitoring/server/lib/logstash/get_logstash_for_clusters.ts index 480b7176b7abae..03c87bfdde1ac2 100644 --- a/x-pack/plugins/monitoring/server/lib/logstash/get_logstash_for_clusters.ts +++ b/x-pack/plugins/monitoring/server/lib/logstash/get_logstash_for_clusters.ts @@ -5,7 +5,6 @@ * 2.0. */ -import Bluebird from 'bluebird'; import { get } from 'lodash'; import { LegacyRequest, Cluster, Bucket } from '../../types'; import { LOGSTASH } from '../../../common/constants'; @@ -48,208 +47,210 @@ export function getLogstashForClusters( const end = req.payload.timeRange.max; const config = req.server.config(); - return Bluebird.map(clusters, (cluster) => { - const clusterUuid = get(cluster, 'elasticsearch.cluster.id', cluster.cluster_uuid); - const params = { - index: lsIndexPattern, - size: 0, - ignore_unavailable: true, - body: { - query: createQuery({ - types: ['stats', 'logstash_stats'], - start, - end, - clusterUuid, - metric: LogstashClusterMetric.getMetricFields(), - }), - aggs: { - logstash_uuids: { - terms: { - field: 'logstash_stats.logstash.uuid', - size: config.get('monitoring.ui.max_bucket_size'), - }, - aggs: { - latest_report: { - terms: { - field: 'logstash_stats.timestamp', - size: 1, - order: { - _key: 'desc', - }, - }, - aggs: { - memory_used: { - max: { - field: 'logstash_stats.jvm.mem.heap_used_in_bytes', + return Promise.all( + clusters.map((cluster) => { + const clusterUuid = get(cluster, 'elasticsearch.cluster.id', cluster.cluster_uuid); + const params = { + index: lsIndexPattern, + size: 0, + ignore_unavailable: true, + body: { + query: createQuery({ + types: ['stats', 'logstash_stats'], + start, + end, + clusterUuid, + metric: LogstashClusterMetric.getMetricFields(), + }), + aggs: { + logstash_uuids: { + terms: { + field: 'logstash_stats.logstash.uuid', + size: config.get('monitoring.ui.max_bucket_size'), + }, + aggs: { + latest_report: { + terms: { + field: 'logstash_stats.timestamp', + size: 1, + order: { + _key: 'desc', }, }, - memory: { - max: { - field: 'logstash_stats.jvm.mem.heap_max_in_bytes', + aggs: { + memory_used: { + max: { + field: 'logstash_stats.jvm.mem.heap_used_in_bytes', + }, }, - }, - events_in_total: { - max: { - field: 'logstash_stats.events.in', + memory: { + max: { + field: 'logstash_stats.jvm.mem.heap_max_in_bytes', + }, }, - }, - events_out_total: { - max: { - field: 'logstash_stats.events.out', + events_in_total: { + max: { + field: 'logstash_stats.events.in', + }, + }, + events_out_total: { + max: { + field: 'logstash_stats.events.out', + }, }, }, }, - }, - memory_used_per_node: { - max_bucket: { - buckets_path: 'latest_report>memory_used', + memory_used_per_node: { + max_bucket: { + buckets_path: 'latest_report>memory_used', + }, }, - }, - memory_per_node: { - max_bucket: { - buckets_path: 'latest_report>memory', + memory_per_node: { + max_bucket: { + buckets_path: 'latest_report>memory', + }, }, - }, - events_in_total_per_node: { - max_bucket: { - buckets_path: 'latest_report>events_in_total', + events_in_total_per_node: { + max_bucket: { + buckets_path: 'latest_report>events_in_total', + }, }, - }, - events_out_total_per_node: { - max_bucket: { - buckets_path: 'latest_report>events_out_total', + events_out_total_per_node: { + max_bucket: { + buckets_path: 'latest_report>events_out_total', + }, }, }, }, - }, - logstash_versions: { - terms: { - field: 'logstash_stats.logstash.version', - size: config.get('monitoring.ui.max_bucket_size'), - }, - }, - pipelines_nested: { - nested: { - path: 'logstash_stats.pipelines', + logstash_versions: { + terms: { + field: 'logstash_stats.logstash.version', + size: config.get('monitoring.ui.max_bucket_size'), + }, }, - aggs: { - pipelines: { - sum_bucket: { - buckets_path: 'queue_types>num_pipelines', - }, + pipelines_nested: { + nested: { + path: 'logstash_stats.pipelines', }, - queue_types: { - terms: { - field: 'logstash_stats.pipelines.queue.type', - size: config.get('monitoring.ui.max_bucket_size'), + aggs: { + pipelines: { + sum_bucket: { + buckets_path: 'queue_types>num_pipelines', + }, }, - aggs: { - num_pipelines: { - cardinality: { - field: 'logstash_stats.pipelines.id', + queue_types: { + terms: { + field: 'logstash_stats.pipelines.queue.type', + size: config.get('monitoring.ui.max_bucket_size'), + }, + aggs: { + num_pipelines: { + cardinality: { + field: 'logstash_stats.pipelines.id', + }, }, }, }, }, }, - }, - pipelines_nested_mb: { - nested: { - path: 'logstash.node.stats.pipelines', - }, - aggs: { - pipelines: { - sum_bucket: { - buckets_path: 'queue_types>num_pipelines', - }, + pipelines_nested_mb: { + nested: { + path: 'logstash.node.stats.pipelines', }, - queue_types: { - terms: { - field: 'logstash.node.stats.pipelines.queue.type', - size: config.get('monitoring.ui.max_bucket_size'), + aggs: { + pipelines: { + sum_bucket: { + buckets_path: 'queue_types>num_pipelines', + }, }, - aggs: { - num_pipelines: { - cardinality: { - field: 'logstash.node.stats.pipelines.id', + queue_types: { + terms: { + field: 'logstash.node.stats.pipelines.queue.type', + size: config.get('monitoring.ui.max_bucket_size'), + }, + aggs: { + num_pipelines: { + cardinality: { + field: 'logstash.node.stats.pipelines.id', + }, }, }, }, }, }, - }, - events_in_total: { - sum_bucket: { - buckets_path: 'logstash_uuids>events_in_total_per_node', + events_in_total: { + sum_bucket: { + buckets_path: 'logstash_uuids>events_in_total_per_node', + }, }, - }, - events_out_total: { - sum_bucket: { - buckets_path: 'logstash_uuids>events_out_total_per_node', + events_out_total: { + sum_bucket: { + buckets_path: 'logstash_uuids>events_out_total_per_node', + }, }, - }, - memory_used: { - sum_bucket: { - buckets_path: 'logstash_uuids>memory_used_per_node', + memory_used: { + sum_bucket: { + buckets_path: 'logstash_uuids>memory_used_per_node', + }, }, - }, - memory: { - sum_bucket: { - buckets_path: 'logstash_uuids>memory_per_node', + memory: { + sum_bucket: { + buckets_path: 'logstash_uuids>memory_per_node', + }, }, - }, - max_uptime: { - max: { - field: 'logstash_stats.jvm.uptime_in_millis', + max_uptime: { + max: { + field: 'logstash_stats.jvm.uptime_in_millis', + }, }, }, }, - }, - }; + }; - const { callWithRequest } = req.server.plugins.elasticsearch.getCluster('monitoring'); - return callWithRequest(req, 'search', params).then((result) => { - const aggregations = get(result, 'aggregations', {}); - const logstashUuids = get(aggregations, 'logstash_uuids.buckets', []); - const logstashVersions = get(aggregations, 'logstash_versions.buckets', []); + const { callWithRequest } = req.server.plugins.elasticsearch.getCluster('monitoring'); + return callWithRequest(req, 'search', params).then((result) => { + const aggregations = get(result, 'aggregations', {}); + const logstashUuids = get(aggregations, 'logstash_uuids.buckets', []); + const logstashVersions = get(aggregations, 'logstash_versions.buckets', []); - // everything is initialized such that it won't impact any rollup - let eventsInTotal = 0; - let eventsOutTotal = 0; - let memory = 0; - let memoryUsed = 0; - let maxUptime = 0; + // everything is initialized such that it won't impact any rollup + let eventsInTotal = 0; + let eventsOutTotal = 0; + let memory = 0; + let memoryUsed = 0; + let maxUptime = 0; - // if the cluster has logstash instances at all - if (logstashUuids.length) { - eventsInTotal = get(aggregations, 'events_in_total.value'); - eventsOutTotal = get(aggregations, 'events_out_total.value'); - memory = get(aggregations, 'memory.value'); - memoryUsed = get(aggregations, 'memory_used.value'); - maxUptime = get(aggregations, 'max_uptime.value'); - } + // if the cluster has logstash instances at all + if (logstashUuids.length) { + eventsInTotal = get(aggregations, 'events_in_total.value'); + eventsOutTotal = get(aggregations, 'events_out_total.value'); + memory = get(aggregations, 'memory.value'); + memoryUsed = get(aggregations, 'memory_used.value'); + maxUptime = get(aggregations, 'max_uptime.value'); + } - let types = get(aggregations, 'pipelines_nested_mb.queue_types.buckets', []); - if (!types || types.length === 0) { - types = aggregations.pipelines_nested?.queue_types.buckets ?? []; - } + let types = get(aggregations, 'pipelines_nested_mb.queue_types.buckets', []); + if (!types || types.length === 0) { + types = aggregations.pipelines_nested?.queue_types.buckets ?? []; + } - return { - clusterUuid, - stats: { - node_count: logstashUuids.length, - events_in_total: eventsInTotal, - events_out_total: eventsOutTotal, - avg_memory: memory, - avg_memory_used: memoryUsed, - max_uptime: maxUptime, - pipeline_count: - get(aggregations, 'pipelines_nested_mb.pipelines.value') || - get(aggregations, 'pipelines_nested.pipelines.value', 0), - queue_types: getQueueTypes(types), - versions: logstashVersions.map((versionBucket: Bucket) => versionBucket.key), - }, - }; - }); - }); + return { + clusterUuid, + stats: { + node_count: logstashUuids.length, + events_in_total: eventsInTotal, + events_out_total: eventsOutTotal, + avg_memory: memory, + avg_memory_used: memoryUsed, + max_uptime: maxUptime, + pipeline_count: + get(aggregations, 'pipelines_nested_mb.pipelines.value') || + get(aggregations, 'pipelines_nested.pipelines.value', 0), + queue_types: getQueueTypes(types), + versions: logstashVersions.map((versionBucket: Bucket) => versionBucket.key), + }, + }; + }); + }) + ); } diff --git a/x-pack/plugins/observability/public/components/app/cases/all_cases/index.tsx b/x-pack/plugins/observability/public/components/app/cases/all_cases/index.tsx index bc0151052434af..4b574753436058 100644 --- a/x-pack/plugins/observability/public/components/app/cases/all_cases/index.tsx +++ b/x-pack/plugins/observability/public/components/app/cases/all_cases/index.tsx @@ -61,7 +61,7 @@ export const AllCases = React.memo(({ userCanCrud }) => { }, }, disableAlerts: true, - showTitle: false, + showTitle: true, userCanCrud, owner: [CASES_OWNER], }); diff --git a/x-pack/plugins/observability/public/components/app/cases/translations.ts b/x-pack/plugins/observability/public/components/app/cases/translations.ts index a85b0bc744e66a..af016be0182a35 100644 --- a/x-pack/plugins/observability/public/components/app/cases/translations.ts +++ b/x-pack/plugins/observability/public/components/app/cases/translations.ts @@ -92,10 +92,6 @@ export const OPTIONAL = i18n.translate('xpack.observability.cases.caseView.optio defaultMessage: 'Optional', }); -export const PAGE_TITLE = i18n.translate('xpack.observability.cases.pageTitle', { - defaultMessage: 'Cases', -}); - export const CREATE_CASE = i18n.translate('xpack.observability.cases.caseView.createCase', { defaultMessage: 'Create case', }); diff --git a/x-pack/plugins/observability/public/pages/cases/all_cases.tsx b/x-pack/plugins/observability/public/pages/cases/all_cases.tsx index 4ac7c4cfd92a59..76c54a470ff837 100644 --- a/x-pack/plugins/observability/public/pages/cases/all_cases.tsx +++ b/x-pack/plugins/observability/public/pages/cases/all_cases.tsx @@ -8,7 +8,6 @@ import React from 'react'; import { AllCases } from '../../components/app/cases/all_cases'; -import * as i18n from '../../components/app/cases/translations'; import { CaseFeatureNoPermissions } from './feature_no_permissions'; import { useGetUserCasesPermissions } from '../../hooks/use_get_user_cases_permissions'; @@ -45,9 +44,6 @@ export const AllCasesPage = React.memo(() => { {i18n.PAGE_TITLE}, - }} > diff --git a/x-pack/plugins/osquery/public/agents/use_agent_policy_agent_ids.ts b/x-pack/plugins/osquery/public/agents/use_agent_policy_agent_ids.ts index 65a2520e07d0bc..77ca08e284182a 100644 --- a/x-pack/plugins/osquery/public/agents/use_agent_policy_agent_ids.ts +++ b/x-pack/plugins/osquery/public/agents/use_agent_policy_agent_ids.ts @@ -9,7 +9,7 @@ import { map } from 'lodash'; import { i18n } from '@kbn/i18n'; import { useQuery } from 'react-query'; -import { AGENT_SAVED_OBJECT_TYPE, Agent } from '../../../fleet/common'; +import { AGENTS_PREFIX, Agent } from '../../../fleet/common'; import { useErrorToast } from '../common/hooks/use_error_toast'; import { useKibana } from '../common/lib/kibana'; @@ -30,7 +30,7 @@ export const useAgentPolicyAgentIds = ({ return useQuery<{ agents: Agent[] }, unknown, string[]>( ['agentPolicyAgentIds', agentPolicyId], () => { - const kuery = `${AGENT_SAVED_OBJECT_TYPE}.policy_id:${agentPolicyId}`; + const kuery = `${AGENTS_PREFIX}.policy_id:${agentPolicyId}`; return http.get(`/internal/osquery/fleet_wrapper/agents`, { query: { diff --git a/x-pack/plugins/osquery/server/routes/fleet_wrapper/get_agent_policies.ts b/x-pack/plugins/osquery/server/routes/fleet_wrapper/get_agent_policies.ts index accfc2d9ef4dae..06641cc60e13dd 100644 --- a/x-pack/plugins/osquery/server/routes/fleet_wrapper/get_agent_policies.ts +++ b/x-pack/plugins/osquery/server/routes/fleet_wrapper/get_agent_policies.ts @@ -5,7 +5,7 @@ * 2.0. */ -import bluebird from 'bluebird'; +import pMap from 'p-map'; import { schema } from '@kbn/config-schema'; import { filter, uniq, map } from 'lodash'; import { satisfies } from 'semver'; @@ -47,7 +47,7 @@ export const getAgentPoliciesRoute = (router: IRouter, osqueryContext: OsqueryAp const agentPolicies = await agentPolicyService?.getByIds(soClient, agentPolicyIds); if (agentPolicies?.length) { - await bluebird.map( + await pMap( agentPolicies, (agentPolicy: GetAgentPoliciesResponseItem) => agentService diff --git a/x-pack/plugins/security_solution/common/endpoint/constants.ts b/x-pack/plugins/security_solution/common/endpoint/constants.ts index 178a2b68a4aabb..fc418df95602bf 100644 --- a/x-pack/plugins/security_solution/common/endpoint/constants.ts +++ b/x-pack/plugins/security_solution/common/endpoint/constants.ts @@ -15,6 +15,9 @@ export const ENDPOINT_ACTION_RESPONSES_INDEX = `${ENDPOINT_ACTION_RESPONSES_DS}- export const eventsIndexPattern = 'logs-endpoint.events.*'; export const alertsIndexPattern = 'logs-endpoint.alerts-*'; +// metadata datastream +export const METADATA_DATASTREAM = 'metrics-endpoint.metadata-default'; + /** index pattern for the data source index (data stream) that the Endpoint streams documents to */ export const metadataIndexPattern = 'metrics-endpoint.metadata-*'; diff --git a/x-pack/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_hosts.ts b/x-pack/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_hosts.ts index de564019db6d07..ed75823cd30d3e 100644 --- a/x-pack/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_hosts.ts +++ b/x-pack/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_hosts.ts @@ -8,6 +8,7 @@ import { Client } from '@elastic/elasticsearch'; import { cloneDeep, merge } from 'lodash'; import { AxiosResponse } from 'axios'; +import uuid from 'uuid'; // eslint-disable-next-line import/no-extraneous-dependencies import { KbnClient } from '@kbn/test'; import { DeleteByQueryResponse } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; @@ -139,12 +140,13 @@ export async function indexEndpointHostDocs({ if (enrollFleet) { const { id: appliedPolicyId, name: appliedPolicyName } = hostMetadata.Endpoint.policy.applied; + const uniqueAppliedPolicyName = `${appliedPolicyName}-${uuid.v4()}`; // If we don't yet have a "real" policy record, then create it now in ingest (package config) if (!realPolicies[appliedPolicyId]) { const createdPolicies = await indexFleetEndpointPolicy( kbnClient, - appliedPolicyName, + uniqueAppliedPolicyName, epmEndpointPackage.version ); diff --git a/x-pack/plugins/security_solution/cypress/integration/detection_alerts/alerts_details.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detection_alerts/alerts_details.spec.ts index 033a12dd9de3ee..116ee4d3820f95 100644 --- a/x-pack/plugins/security_solution/cypress/integration/detection_alerts/alerts_details.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/detection_alerts/alerts_details.spec.ts @@ -5,7 +5,13 @@ * 2.0. */ -import { ALERT_FLYOUT, CELL_TEXT, JSON_TEXT, TABLE_ROWS } from '../../screens/alerts_details'; +import { + ALERT_FLYOUT, + CELL_TEXT, + JSON_TEXT, + TABLE_CONTAINER, + TABLE_ROWS, +} from '../../screens/alerts_details'; import { expandFirstAlert, @@ -65,4 +71,20 @@ describe('Alert details with unmapped fields', () => { cy.get(CELL_TEXT).eq(4).should('have.text', expectedUnmmappedField.text); }); }); + + // This test makes sure that the table does not overflow horizontally + it('Table does not scroll horizontally', () => { + openTable(); + + cy.get(ALERT_FLYOUT) + .find(TABLE_CONTAINER) + .within(($tableContainer) => { + expect($tableContainer[0].scrollLeft).to.equal(0); + + // Try to scroll left and make sure that the table hasn't actually scrolled + $tableContainer[0].scroll({ left: 1000 }); + + expect($tableContainer[0].scrollLeft).to.equal(0); + }); + }); }); diff --git a/x-pack/plugins/security_solution/cypress/screens/alerts.ts b/x-pack/plugins/security_solution/cypress/screens/alerts.ts index a46f65acaf971f..0d2eab221b49a8 100644 --- a/x-pack/plugins/security_solution/cypress/screens/alerts.ts +++ b/x-pack/plugins/security_solution/cypress/screens/alerts.ts @@ -12,7 +12,7 @@ export const ALERTS = '[data-test-subj="events-viewer-panel"] [data-test-subj="e export const ALERTS_COUNT = '[data-test-subj="events-viewer-panel"] [data-test-subj="server-side-event-count"]'; -export const ALERT_CHECKBOX = '[data-test-subj="select-event"].euiCheckbox__input'; +export const ALERT_CHECKBOX = '[data-test-subj~="select-event"].euiCheckbox__input'; export const ALERT_GRID_CELL = '[data-test-subj="dataGridRowCell"]'; diff --git a/x-pack/plugins/security_solution/cypress/screens/alerts_details.ts b/x-pack/plugins/security_solution/cypress/screens/alerts_details.ts index 584fba05452f05..85a4fa257a9573 100644 --- a/x-pack/plugins/security_solution/cypress/screens/alerts_details.ts +++ b/x-pack/plugins/security_solution/cypress/screens/alerts_details.ts @@ -34,6 +34,8 @@ export const TABLE_CELL = '.euiTableRowCell'; export const TABLE_TAB = '[data-test-subj="tableTab"]'; +export const TABLE_CONTAINER = '[data-test-subj="event-fields-browser"]'; + export const TABLE_ROWS = '.euiTableRow'; export const THREAT_DETAILS_ACCORDION = '.euiAccordion__triggerWrapper'; diff --git a/x-pack/plugins/security_solution/cypress/screens/timeline.ts b/x-pack/plugins/security_solution/cypress/screens/timeline.ts index 81e025fa6db8f4..a37cd5e22ca07b 100644 --- a/x-pack/plugins/security_solution/cypress/screens/timeline.ts +++ b/x-pack/plugins/security_solution/cypress/screens/timeline.ts @@ -20,8 +20,8 @@ export const ATTACH_TIMELINE_TO_EXISTING_CASE_ICON = export const BULK_ACTIONS = '[data-test-subj="utility-bar-action-button"]'; -export const CASE = (id: string) => { - return `[data-test-subj="cases-table-row-${id}"]`; +export const SELECT_CASE = (id: string) => { + return `[data-test-subj="cases-table-row-select-${id}"]`; }; export const CELL = '[data-test-subj="statefulCell"]'; diff --git a/x-pack/plugins/security_solution/cypress/tasks/timeline.ts b/x-pack/plugins/security_solution/cypress/tasks/timeline.ts index 03b931bc74d77e..24eb2e325d32c2 100644 --- a/x-pack/plugins/security_solution/cypress/tasks/timeline.ts +++ b/x-pack/plugins/security_solution/cypress/tasks/timeline.ts @@ -17,7 +17,6 @@ import { ATTACH_TIMELINE_TO_CASE_BUTTON, ATTACH_TIMELINE_TO_EXISTING_CASE_ICON, ATTACH_TIMELINE_TO_NEW_CASE_ICON, - CASE, CLOSE_TIMELINE_BTN, COMBO_BOX, COMBO_BOX_INPUT, @@ -35,6 +34,7 @@ import { RESET_FIELDS, SAVE_FILTER_BTN, SEARCH_OR_FILTER_CONTAINER, + SELECT_CASE, SERVER_SIDE_EVENT_COUNT, STAR_ICON, TIMELINE_CHANGES_IN_PROGRESS, @@ -346,7 +346,7 @@ export const resetFields = () => { }; export const selectCase = (caseId: string) => { - cy.get(CASE(caseId)).click(); + cy.get(SELECT_CASE(caseId)).click(); }; export const waitForTimelineChanges = () => { diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/event_fields_browser.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/event_fields_browser.tsx index b0e818d08678e3..384e9d72b07875 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/event_fields_browser.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/event_fields_browser.tsx @@ -281,6 +281,7 @@ export const EventFieldsBrowser = React.memo( rowProps={onSetRowProps} search={search} sorting={false} + data-test-subj="event-fields-browser" /> ); diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/table/field_value_cell.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/table/field_value_cell.tsx index 0685582b338828..62aad517852061 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/table/field_value_cell.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/table/field_value_cell.tsx @@ -72,6 +72,7 @@ export const FieldValueCell = React.memo( isObjectArray={data.isObjectArray} value={value} linkValue={(getLinkValue && getLinkValue(data.field)) ?? linkValue} + truncate={false} /> )} diff --git a/x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts b/x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts index e0dd108769305e..15758b5afd209d 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts +++ b/x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts @@ -8,7 +8,7 @@ import { run, RunFn, createFailError } from '@kbn/dev-utils'; import { KbnClient } from '@kbn/test'; import { AxiosError } from 'axios'; -import bluebird from 'bluebird'; +import pMap from 'p-map'; import type { CreateExceptionListSchema } from '@kbn/securitysolution-io-ts-list-types'; import { ENDPOINT_EVENT_FILTERS_LIST_DESCRIPTION, @@ -70,7 +70,7 @@ const createEventFilters: RunFn = async ({ flags, log }) => { await ensureCreateEndpointEventFiltersList(kbn); - await bluebird.map( + await pMap( Array.from({ length: flags.count as unknown as number }), () => kbn diff --git a/x-pack/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts b/x-pack/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts index 15f0b2f65cb956..779aee0bb1dc18 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts +++ b/x-pack/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts @@ -8,7 +8,7 @@ import { run, RunFn, createFailError } from '@kbn/dev-utils'; import { KbnClient } from '@kbn/test'; import { AxiosError } from 'axios'; -import bluebird from 'bluebird'; +import pMap from 'p-map'; import type { CreateExceptionListSchema } from '@kbn/securitysolution-io-ts-list-types'; import { ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_DESCRIPTION, @@ -70,7 +70,7 @@ const createHostIsolationException: RunFn = async ({ flags, log }) => { await ensureCreateEndpointHostIsolationExceptionList(kbn); - await bluebird.map( + await pMap( Array.from({ length: flags.count as unknown as number }), () => kbn diff --git a/x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts b/x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts index d20d29a34754cd..97695ec60062c2 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts +++ b/x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts @@ -8,7 +8,7 @@ import minimist from 'minimist'; import { ToolingLog } from '@kbn/dev-utils'; import { KbnClient } from '@kbn/test'; -import bluebird from 'bluebird'; +import pMap from 'p-map'; import { basename } from 'path'; import { AxiosResponse } from 'axios'; import { TRUSTED_APPS_CREATE_API, TRUSTED_APPS_LIST_API } from '../../../common/endpoint/constants'; @@ -113,7 +113,7 @@ export const run: (options?: RunOptions) => Promise = async ({ return () => policyIds[randomN(policyIds.length)]; })(); - return bluebird.map( + return pMap( Array.from({ length: count }), async () => { const body = trustedAppGenerator.generateTrustedAppForCreate(); diff --git a/x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts b/x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts index d06739d9b859ad..68ee826eca01c7 100644 --- a/x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts +++ b/x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts @@ -123,7 +123,10 @@ export class EndpointAppContextService { return this.startDependencies?.agentService; } - public getPackagePolicyService(): PackagePolicyServiceInterface | undefined { + public getPackagePolicyService(): PackagePolicyServiceInterface { + if (!this.startDependencies?.packagePolicyService) { + throw new EndpointAppContentServicesNotStartedError(); + } return this.startDependencies?.packagePolicyService; } diff --git a/x-pack/plugins/security_solution/server/endpoint/mocks.ts b/x-pack/plugins/security_solution/server/endpoint/mocks.ts index 6c2df2d09f6d52..c428cf49b1e11c 100644 --- a/x-pack/plugins/security_solution/server/endpoint/mocks.ts +++ b/x-pack/plugins/security_solution/server/endpoint/mocks.ts @@ -87,22 +87,36 @@ export const createMockEndpointAppContextServiceStartContract = (): jest.Mocked => { const config = createMockConfig(); + const logger = loggingSystemMock.create().get('mock_endpoint_app_context'); const casesClientMock = createCasesClientMock(); const savedObjectsStart = savedObjectsServiceMock.createStartContract(); const agentService = createMockAgentService(); const agentPolicyService = createMockAgentPolicyService(); + const packagePolicyService = createPackagePolicyServiceMock(); const endpointMetadataService = new EndpointMetadataService( savedObjectsStart, agentService, - agentPolicyService + agentPolicyService, + packagePolicyService, + logger ); + packagePolicyService.list.mockImplementation(async (_, options) => { + return { + items: [], + total: 0, + page: options.page ?? 1, + perPage: options.perPage ?? 10, + }; + }); + return { agentService, agentPolicyService, endpointMetadataService, + packagePolicyService, + logger, packageService: createMockPackageService(), - logger: loggingSystemMock.create().get('mock_endpoint_app_context'), manifestManager: getManifestManagerMock(), security: securityMock.createStart(), alerting: alertsMock.createStart(), @@ -113,7 +127,6 @@ export const createMockEndpointAppContextServiceStartContract = Parameters >(), exceptionListsClient: listMock.getExceptionListClient(), - packagePolicyService: createPackagePolicyServiceMock(), cases: { getCasesClientWithRequest: jest.fn(async () => casesClientMock), }, diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts b/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts index a483a33ea4c8d2..29a4e5ce0b2996 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts @@ -45,7 +45,7 @@ import { LogsEndpointAction, } from '../../../../common/endpoint/types'; import { EndpointDocGenerator } from '../../../../common/endpoint/generate_data'; -import { legacyMetadataSearchResponse } from '../metadata/support/test_support'; +import { legacyMetadataSearchResponseMock } from '../metadata/support/test_support'; import { AGENT_ACTIONS_INDEX, ElasticsearchAssetType } from '../../../../../fleet/common'; import { CasesClientMock } from '../../../../../cases/server/client/mocks'; @@ -211,7 +211,7 @@ describe('Host Isolation', () => { const mockSearchResponse = jest .fn() .mockImplementation(() => - Promise.resolve({ body: legacyMetadataSearchResponse(searchResponse) }) + Promise.resolve({ body: legacyMetadataSearchResponseMock(searchResponse) }) ); if (indexExists) { ctx.core.elasticsearch.client.asInternalUser.index = mockIndexResponse; diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/handlers.ts b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/handlers.ts index c72b1307d04b7a..384fde6c7ceac4 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/handlers.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/handlers.ts @@ -6,8 +6,6 @@ */ import Boom from '@hapi/boom'; -import type { TransportResult } from '@elastic/elasticsearch'; -import { SearchResponse, SearchTotalHits } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { TypeOf } from '@kbn/config-schema'; import { @@ -22,7 +20,6 @@ import { import { HostInfo, HostMetadata, - UnitedAgentMetadata, HostResultList, HostStatus, } from '../../../../common/endpoint/types'; @@ -30,10 +27,10 @@ import type { SecuritySolutionRequestHandlerContext } from '../../../types'; import { getESQueryHostMetadataByID, + getPagingProperties, kibanaRequestToMetadataListESQuery, - buildUnitedIndexQuery, } from './query_builders'; -import { Agent, AgentPolicy, PackagePolicy } from '../../../../../fleet/common/types/models'; +import { Agent, PackagePolicy } from '../../../../../fleet/common/types/models'; import { AgentNotFoundError } from '../../../../../fleet/server'; import { EndpointAppContext, HostListQueryResult } from '../../types'; import { GetMetadataListRequestSchema, GetMetadataRequestSchema } from './index'; @@ -46,9 +43,8 @@ import { queryResponseToHostListResult, queryResponseToHostResult, } from './support/query_strategies'; -import { NotFoundError } from '../../errors'; +import { EndpointError, NotFoundError } from '../../errors'; import { EndpointHostUnEnrolledError } from '../../services/metadata'; -import { getAgentStatus } from '../../../../../fleet/common/services/agent_status'; export interface MetadataRequestContext { esClient?: IScopedClusterClient; @@ -58,16 +54,6 @@ export interface MetadataRequestContext { savedObjectsClient?: SavedObjectsClientContract; } -/** - * 00000000-0000-0000-0000-000000000000 is initial Elastic Agent id sent by Endpoint before policy is configured - * 11111111-1111-1111-1111-111111111111 is Elastic Agent id sent by Endpoint when policy does not contain an id - */ - -const IGNORED_ELASTIC_AGENT_IDS = [ - '00000000-0000-0000-0000-000000000000', - '11111111-1111-1111-1111-111111111111', -]; - export const getLogger = (endpointAppContext: EndpointAppContext): Logger => { return endpointAppContext.logFactory.get('metadata'); }; @@ -109,39 +95,69 @@ export const getMetadataListRequestHandler = function ( SecuritySolutionRequestHandlerContext > { return async (context, request, response) => { - const agentService = endpointAppContext.service.getAgentService(); - if (agentService === undefined) { - throw new Error('agentService not available'); + const endpointMetadataService = endpointAppContext.service.getEndpointMetadataService(); + if (!endpointMetadataService) { + throw new EndpointError('endpoint metadata service not available'); } - const endpointPolicies = await getAllEndpointPackagePolicies( - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - endpointAppContext.service.getPackagePolicyService()!, - context.core.savedObjects.client - ); + let doesUnitedIndexExist = false; + let didUnitedIndexError = false; + let body: HostResultList = { + hosts: [], + total: 0, + request_page_size: 0, + request_page_index: 0, + }; - const { unitedIndexExists, unitedQueryResponse } = await queryUnitedIndex( - context, - request, - endpointAppContext, - logger, - endpointPolicies - ); - if (unitedIndexExists) { - return response.ok({ - body: unitedQueryResponse, - }); + try { + doesUnitedIndexExist = await endpointMetadataService.doesUnitedIndexExist( + context.core.elasticsearch.client.asCurrentUser + ); + } catch (error) { + // for better UX, try legacy query instead of immediately failing on united index error + didUnitedIndexError = true; } - return response.ok({ - body: await legacyListMetadataQuery( + // If no unified Index present, then perform a search using the legacy approach + if (!doesUnitedIndexExist || didUnitedIndexError) { + const endpointPolicies = await getAllEndpointPackagePolicies( + endpointAppContext.service.getPackagePolicyService(), + context.core.savedObjects.client + ); + + body = await legacyListMetadataQuery( context, request, endpointAppContext, logger, endpointPolicies - ), - }); + ); + return response.ok({ body }); + } + + // Unified index is installed and being used - perform search using new approach + try { + const pagingProperties = await getPagingProperties(request, endpointAppContext); + const { data, page, total, pageSize } = await endpointMetadataService.getHostMetadataList( + context.core.elasticsearch.client.asCurrentUser, + { + page: pagingProperties.pageIndex + 1, + pageSize: pagingProperties.pageSize, + filters: request.body?.filters || {}, + } + ); + + body = { + hosts: data, + request_page_index: page - 1, + total, + request_page_size: pageSize, + }; + } catch (error) { + return errorHandler(logger, response, error); + } + + return response.ok({ body }); }; }; @@ -412,6 +428,9 @@ async function legacyListMetadataQuery( ): Promise { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const agentService = endpointAppContext.service.getAgentService()!; + if (agentService === undefined) { + throw new Error('agentService not available'); + } const metadataRequestContext: MetadataRequestContext = { esClient: context.core.elasticsearch.client, @@ -429,15 +448,15 @@ async function legacyListMetadataQuery( ); const statusesToFilter = request?.body?.filters?.host_status ?? []; - const statusIds = await findAgentIdsByStatus( + const statusAgentIds = await findAgentIdsByStatus( agentService, context.core.elasticsearch.client.asCurrentUser, statusesToFilter ); const queryParams = await kibanaRequestToMetadataListESQuery(request, endpointAppContext, { - unenrolledAgentIds: unenrolledAgentIds.concat(IGNORED_ELASTIC_AGENT_IDS), - statusAgentIds: statusIds, + unenrolledAgentIds, + statusAgentIds, }); const result = await context.core.elasticsearch.client.asCurrentUser.search( @@ -446,118 +465,3 @@ async function legacyListMetadataQuery( const hostListQueryResult = queryResponseToHostListResult(result.body); return mapToHostResultList(queryParams, hostListQueryResult, metadataRequestContext); } - -async function queryUnitedIndex( - context: SecuritySolutionRequestHandlerContext, - request: KibanaRequest, - endpointAppContext: EndpointAppContext, - logger: Logger, - endpointPolicies: PackagePolicy[] -): Promise<{ - unitedIndexExists: boolean; - unitedQueryResponse: HostResultList; -}> { - const endpointPolicyIds = endpointPolicies.map((policy) => policy.policy_id); - const unitedIndexQuery = await buildUnitedIndexQuery( - request, - endpointAppContext, - IGNORED_ELASTIC_AGENT_IDS, - endpointPolicyIds - ); - - let unitedMetadataQueryResponse: TransportResult, unknown>; - try { - unitedMetadataQueryResponse = - await context.core.elasticsearch.client.asCurrentUser.search( - unitedIndexQuery - ); - } catch (error) { - const errorType = error?.meta?.body?.error?.type ?? ''; - - // no united index means that the endpoint package hasn't been upgraded yet - // this is expected so we fall back to the legacy query - // errors other than index_not_found_exception are unexpected - if (errorType !== 'index_not_found_exception') { - logger.error(error); - throw error; - } - return { - unitedIndexExists: false, - unitedQueryResponse: {} as HostResultList, - }; - } - - const { hits: docs, total: docsCount } = unitedMetadataQueryResponse?.body?.hits || {}; - const agentPolicyIds: string[] = docs.map((doc) => doc._source?.united?.agent?.policy_id ?? ''); - - const agentPolicies = - (await endpointAppContext.service - .getAgentPolicyService() - ?.getByIds(context.core.savedObjects.client, agentPolicyIds)) ?? []; - - const agentPoliciesMap: Record = agentPolicies.reduce( - (acc, agentPolicy) => ({ - ...acc, - [agentPolicy.id]: { - ...agentPolicy, - }, - }), - {} - ); - - const endpointPoliciesMap: Record = endpointPolicies.reduce( - (acc, packagePolicy) => ({ - ...acc, - [packagePolicy.policy_id]: packagePolicy, - }), - {} - ); - - const hosts = docs - .filter((doc) => { - const { endpoint: metadata, agent } = doc?._source?.united ?? {}; - return metadata && agent; - }) - .map((doc) => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const { endpoint: metadata, agent } = doc!._source!.united!; - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const agentPolicy = agentPoliciesMap[agent.policy_id!]; - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const endpointPolicy = endpointPoliciesMap[agent.policy_id!]; - const fleetAgentStatus = getAgentStatus(agent as Agent); - - return { - metadata, - host_status: fleetAgentStatusToEndpointHostStatus(fleetAgentStatus), - policy_info: { - agent: { - applied: { - id: agent.policy_id || '', - revision: agent.policy_revision || 0, - }, - configured: { - id: agentPolicy?.id || '', - revision: agentPolicy?.revision || 0, - }, - }, - endpoint: { - id: endpointPolicy?.id || '', - revision: endpointPolicy?.revision || 0, - }, - }, - } as HostInfo; - }); - - const unitedQueryResponse: HostResultList = { - request_page_size: unitedIndexQuery.size, - request_page_index: unitedIndexQuery.from, - total: (docsCount as SearchTotalHits).value, - hosts, - }; - - return { - unitedIndexExists: true, - unitedQueryResponse, - }; -} diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/metadata.test.ts b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/metadata.test.ts index 7c2e5de9284846..c0be1c7530cb4b 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/metadata.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/metadata.test.ts @@ -34,7 +34,10 @@ import { import { createMockConfig } from '../../../lib/detection_engine/routes/__mocks__'; import { EndpointDocGenerator } from '../../../../common/endpoint/generate_data'; import { Agent, ElasticsearchAssetType } from '../../../../../fleet/common/types/models'; -import { legacyMetadataSearchResponse, unitedMetadataSearchResponse } from './support/test_support'; +import { + legacyMetadataSearchResponseMock, + unitedMetadataSearchResponseMock, +} from './support/test_support'; import { PackageService } from '../../../../../fleet/server/services'; import { HOST_METADATA_LIST_ROUTE, @@ -76,6 +79,9 @@ describe('test endpoint route', () => { let mockAgentService: Required< ReturnType >['agentService']; + let mockAgentPolicyService: Required< + ReturnType + >['agentPolicyService']; let endpointAppContextService: EndpointAppContextService; let startContract: EndpointAppContextServiceStartContract; const noUnenrolledAgent = { @@ -138,6 +144,7 @@ describe('test endpoint route', () => { endpointAppContextService.setup(createMockEndpointAppContextServiceSetupContract()); endpointAppContextService.start({ ...startContract, packageService: mockPackageService }); mockAgentService = startContract.agentService!; + mockAgentPolicyService = startContract.agentPolicyService!; registerEndpointRoutes(routerMock, { logFactory: loggingSystemMock.create(), @@ -151,7 +158,7 @@ describe('test endpoint route', () => { it('should fallback to legacy index if index not found', async () => { const mockRequest = httpServerMock.createKibanaRequest({}); - const response = legacyMetadataSearchResponse( + const response = legacyMetadataSearchResponseMock( new EndpointDocGenerator().generateHostMetadata() ); (mockScopedClient.asCurrentUser.search as jest.Mock) @@ -195,7 +202,7 @@ describe('test endpoint route', () => { page_size: 10, }, { - page_index: 1, + page_index: 0, }, ], @@ -208,13 +215,13 @@ describe('test endpoint route', () => { mockAgentService.getAgentStatusById = jest.fn().mockReturnValue('error'); mockAgentService.listAgents = jest.fn().mockReturnValue(noUnenrolledAgent); + mockAgentPolicyService.getByIds = jest.fn().mockResolvedValueOnce([]); const metadata = new EndpointDocGenerator().generateHostMetadata(); const esSearchMock = mockScopedClient.asCurrentUser.search as jest.Mock; - esSearchMock.mockImplementationOnce(() => - Promise.resolve({ - body: unitedMetadataSearchResponse(metadata), - }) - ); + esSearchMock.mockResolvedValueOnce({}); + esSearchMock.mockResolvedValueOnce({ + body: unitedMetadataSearchResponseMock(metadata), + }); [routeConfig, routeHandler] = routerMock.post.mock.calls.find(([{ path }]) => path.startsWith(`${HOST_METADATA_LIST_ROUTE}`) )!; @@ -225,9 +232,11 @@ describe('test endpoint route', () => { mockResponse ); - expect(esSearchMock).toHaveBeenCalledTimes(1); + expect(esSearchMock).toHaveBeenCalledTimes(2); expect(esSearchMock.mock.calls[0][0]?.index).toEqual(METADATA_UNITED_INDEX); - expect(esSearchMock.mock.calls[0][0]?.body?.query).toEqual({ + expect(esSearchMock.mock.calls[0][0]?.size).toEqual(1); + expect(esSearchMock.mock.calls[1][0]?.index).toEqual(METADATA_UNITED_INDEX); + expect(esSearchMock.mock.calls[1][0]?.body?.query).toEqual({ bool: { must: [ { @@ -363,7 +372,7 @@ describe('test endpoint route', () => { expect(endpointResultList.hosts.length).toEqual(1); expect(endpointResultList.hosts[0].metadata).toEqual(metadata); expect(endpointResultList.total).toEqual(1); - expect(endpointResultList.request_page_index).toEqual(10); + expect(endpointResultList.request_page_index).toEqual(0); expect(endpointResultList.request_page_size).toEqual(10); }); }); @@ -412,7 +421,7 @@ describe('test endpoint route', () => { it('test find the latest of all endpoints', async () => { const mockRequest = httpServerMock.createKibanaRequest({}); - const response = legacyMetadataSearchResponse( + const response = legacyMetadataSearchResponseMock( new EndpointDocGenerator().generateHostMetadata() ); (mockScopedClient.asCurrentUser.search as jest.Mock) @@ -466,7 +475,9 @@ describe('test endpoint route', () => { }) .mockImplementationOnce(() => Promise.resolve({ - body: legacyMetadataSearchResponse(new EndpointDocGenerator().generateHostMetadata()), + body: legacyMetadataSearchResponseMock( + new EndpointDocGenerator().generateHostMetadata() + ), }) ); [routeConfig, routeHandler] = routerMock.post.mock.calls.find(([{ path }]) => @@ -526,7 +537,9 @@ describe('test endpoint route', () => { }) .mockImplementationOnce(() => Promise.resolve({ - body: legacyMetadataSearchResponse(new EndpointDocGenerator().generateHostMetadata()), + body: legacyMetadataSearchResponseMock( + new EndpointDocGenerator().generateHostMetadata() + ), }) ); [routeConfig, routeHandler] = routerMock.post.mock.calls.find(([{ path }]) => @@ -602,7 +615,7 @@ describe('test endpoint route', () => { const mockRequest = httpServerMock.createKibanaRequest({ params: { id: 'BADID' } }); (mockScopedClient.asCurrentUser.search as jest.Mock).mockImplementationOnce(() => - Promise.resolve({ body: legacyMetadataSearchResponse() }) + Promise.resolve({ body: legacyMetadataSearchResponseMock() }) ); mockAgentService.getAgentStatusById = jest.fn().mockReturnValue('error'); @@ -630,7 +643,7 @@ describe('test endpoint route', () => { }); it('should return a single endpoint with status healthy', async () => { - const response = legacyMetadataSearchResponse( + const response = legacyMetadataSearchResponseMock( new EndpointDocGenerator().generateHostMetadata() ); const mockRequest = httpServerMock.createKibanaRequest({ @@ -666,7 +679,7 @@ describe('test endpoint route', () => { }); it('should return a single endpoint with status unhealthy when AgentService throw 404', async () => { - const response = legacyMetadataSearchResponse( + const response = legacyMetadataSearchResponseMock( new EndpointDocGenerator().generateHostMetadata() ); @@ -703,7 +716,7 @@ describe('test endpoint route', () => { }); it('should return a single endpoint with status unhealthy when status is not offline, online or enrolling', async () => { - const response = legacyMetadataSearchResponse( + const response = legacyMetadataSearchResponseMock( new EndpointDocGenerator().generateHostMetadata() ); @@ -741,7 +754,7 @@ describe('test endpoint route', () => { }); it('should throw error when endpoint agent is not active', async () => { - const response = legacyMetadataSearchResponse( + const response = legacyMetadataSearchResponseMock( new EndpointDocGenerator().generateHostMetadata() ); diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.fixtures.ts b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.fixtures.ts index d2ad9831748b3d..67a1b162110982 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.fixtures.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.fixtures.ts @@ -11,7 +11,10 @@ export const expectedCompleteUnitedIndexQuery = { bool: { must_not: { terms: { - 'agent.id': ['test-agent-id'], + 'agent.id': [ + '00000000-0000-0000-0000-000000000000', + '11111111-1111-1111-1111-111111111111', + ], }, }, filter: [ diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.test.ts b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.test.ts index 46a16e48c7edfc..a0cb5aad552d25 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.test.ts @@ -16,8 +16,6 @@ import { createMockConfig } from '../../../lib/detection_engine/routes/__mocks__ import { metadataCurrentIndexPattern } from '../../../../common/endpoint/constants'; import { parseExperimentalConfigValue } from '../../../../common/experimental_features'; import { get } from 'lodash'; -import { KibanaRequest } from 'kibana/server'; -import { EndpointAppContext } from '../../types'; import { expectedCompleteUnitedIndexQuery } from './query_builders.fixtures'; describe('query builder', () => { @@ -55,19 +53,6 @@ describe('query builder', () => { }); }); - it('queries for all endpoints when no specific parameters requested', async () => { - const mockRequest = httpServerMock.createKibanaRequest({ - body: {}, - }); - const query = await kibanaRequestToMetadataListESQuery(mockRequest, { - logFactory: loggingSystemMock.create(), - service: new EndpointAppContextService(), - config: () => Promise.resolve(createMockConfig()), - experimentalFeatures: parseExperimentalConfigValue(createMockConfig().enableExperimental), - }); - expect(query.body.query).toHaveProperty('match_all'); - }); - it('excludes unenrolled elastic agents when they exist, by default', async () => { const unenrolledElasticAgentId = '1fdca33f-799f-49f4-939c-ea4383c77672'; const mockRequest = httpServerMock.createKibanaRequest({ @@ -89,8 +74,24 @@ describe('query builder', () => { expect(query.body.query).toEqual({ bool: { must_not: [ - { terms: { 'elastic.agent.id': [unenrolledElasticAgentId] } }, - { terms: { 'HostDetails.elastic.agent.id': [unenrolledElasticAgentId] } }, + { + terms: { + 'elastic.agent.id': [ + '00000000-0000-0000-0000-000000000000', + '11111111-1111-1111-1111-111111111111', + unenrolledElasticAgentId, + ], + }, + }, + { + terms: { + 'HostDetails.elastic.agent.id': [ + '00000000-0000-0000-0000-000000000000', + '11111111-1111-1111-1111-111111111111', + unenrolledElasticAgentId, + ], + }, + }, ], }, }); @@ -154,31 +155,42 @@ describe('query builder', () => { } ); - expect(query.body.query.bool.must).toContainEqual({ - bool: { - must_not: [ - // both of these should exist, since the schema can be *either* - { terms: { 'elastic.agent.id': [unenrolledElasticAgentId] } }, - { terms: { 'HostDetails.elastic.agent.id': [unenrolledElasticAgentId] } }, - ], - }, - }); - expect(query.body.query.bool.must).toContainEqual({ - bool: { - must_not: { - bool: { - should: [ - { - match: { - 'host.ip': '10.140.73.246', - }, + expect(query.body.query.bool.must).toEqual([ + { + bool: { + must_not: [ + { + terms: { + 'elastic.agent.id': [ + '00000000-0000-0000-0000-000000000000', + '11111111-1111-1111-1111-111111111111', + '1fdca33f-799f-49f4-939c-ea4383c77672', + ], }, - ], - minimum_should_match: 1, + }, + { + terms: { + 'HostDetails.elastic.agent.id': [ + '00000000-0000-0000-0000-000000000000', + '11111111-1111-1111-1111-111111111111', + '1fdca33f-799f-49f4-939c-ea4383c77672', + ], + }, + }, + ], + }, + }, + { + bool: { + must_not: { + bool: { + minimum_should_match: 1, + should: [{ match: { 'host.ip': '10.140.73.246' } }], + }, }, }, }, - }); + ]); } ); }); @@ -209,24 +221,18 @@ describe('query builder', () => { }); describe('buildUnitedIndexQuery', () => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - let mockRequest: KibanaRequest; - let mockEndpointAppContext: EndpointAppContext; - const filters = { kql: '', host_status: [] }; - beforeEach(() => { - mockRequest = httpServerMock.createKibanaRequest({ body: { filters } }); - mockEndpointAppContext = { - logFactory: loggingSystemMock.create(), - service: new EndpointAppContextService(), - config: () => Promise.resolve(createMockConfig()), - experimentalFeatures: parseExperimentalConfigValue(createMockConfig().enableExperimental), - }; - }); - it('correctly builds empty query', async () => { - const query = await buildUnitedIndexQuery(mockRequest, mockEndpointAppContext, [], []); + const query = await buildUnitedIndexQuery({ page: 1, pageSize: 10, filters: {} }, []); const expected = { bool: { + must_not: { + terms: { + 'agent.id': [ + '00000000-0000-0000-0000-000000000000', + '11111111-1111-1111-1111-111111111111', + ], + }, + }, filter: [ { terms: { @@ -257,15 +263,16 @@ describe('query builder', () => { }); it('correctly builds query', async () => { - mockRequest.body.filters.kql = 'united.endpoint.host.os.name : *'; - mockRequest.body.filters.host_status = ['healthy']; - const ignoredAgentIds: string[] = ['test-agent-id']; - const endpointPolicyIds: string[] = ['test-endpoint-policy-id']; const query = await buildUnitedIndexQuery( - mockRequest, - mockEndpointAppContext, - ignoredAgentIds, - endpointPolicyIds + { + page: 1, + pageSize: 10, + filters: { + kql: 'united.endpoint.host.os.name : *', + host_status: ['healthy'], + }, + }, + ['test-endpoint-policy-id'] ); const expected = expectedCompleteUnitedIndexQuery; expect(query.body.query).toEqual(expected); diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.ts b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.ts index 8f10bc79bc0ff0..73325a92a33243 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.ts @@ -12,9 +12,18 @@ import { METADATA_UNITED_INDEX, } from '../../../../common/endpoint/constants'; import { KibanaRequest } from '../../../../../../../src/core/server'; -import { EndpointAppContext } from '../../types'; +import { EndpointAppContext, GetHostMetadataListQuery } from '../../types'; import { buildStatusesKuery } from './support/agent_status'; +/** + * 00000000-0000-0000-0000-000000000000 is initial Elastic Agent id sent by Endpoint before policy is configured + * 11111111-1111-1111-1111-111111111111 is Elastic Agent id sent by Endpoint when policy does not contain an id + */ +const IGNORED_ELASTIC_AGENT_IDS = [ + '00000000-0000-0000-0000-000000000000', + '11111111-1111-1111-1111-111111111111', +]; + export interface QueryBuilderOptions { unenrolledAgentIds?: string[]; statusAgentIds?: string[]; @@ -53,7 +62,7 @@ export async function kibanaRequestToMetadataListESQuery( body: { query: buildQueryBody( request, - queryBuilderOptions?.unenrolledAgentIds, + IGNORED_ELASTIC_AGENT_IDS.concat(queryBuilderOptions?.unenrolledAgentIds ?? []), queryBuilderOptions?.statusAgentIds ), track_total_hits: true, @@ -65,7 +74,7 @@ export async function kibanaRequestToMetadataListESQuery( }; } -async function getPagingProperties( +export async function getPagingProperties( // eslint-disable-next-line @typescript-eslint/no-explicit-any request: KibanaRequest, endpointAppContext: EndpointAppContext @@ -82,7 +91,7 @@ async function getPagingProperties( } return { pageSize: pagingProperties.page_size || config.endpointResultListDefaultPageSize, - pageIndex: pagingProperties.page_index || config.endpointResultListDefaultFirstPageIndex, + pageIndex: pagingProperties.page_index ?? config.endpointResultListDefaultFirstPageIndex, }; } @@ -214,24 +223,26 @@ export function getESQueryHostMetadataByIDs(agentIDs: string[]) { }; } +interface BuildUnitedIndexQueryResponse { + body: { + query: Record; + track_total_hits: boolean; + sort: estypes.SearchSortContainer[]; + }; + from: number; + size: number; + index: string; +} export async function buildUnitedIndexQuery( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - request: KibanaRequest, - endpointAppContext: EndpointAppContext, - ignoredAgentIds: string[] | undefined, + { page = 1, pageSize = 10, filters = {} }: GetHostMetadataListQuery, endpointPolicyIds: string[] = [] - // eslint-disable-next-line @typescript-eslint/no-explicit-any -): Promise> { - const pagingProperties = await getPagingProperties(request, endpointAppContext); - const statusesToFilter = request?.body?.filters?.host_status ?? []; +): Promise { + const statusesToFilter = filters?.host_status ?? []; const statusesKuery = buildStatusesKuery(statusesToFilter); - const filterIgnoredAgents = - ignoredAgentIds && ignoredAgentIds.length > 0 - ? { - must_not: { terms: { 'agent.id': ignoredAgentIds } }, - } - : null; + const filterIgnoredAgents = { + must_not: { terms: { 'agent.id': IGNORED_ELASTIC_AGENT_IDS } }, + }; const filterEndpointPolicyAgents = { filter: [ // must contain an endpoint policy id @@ -259,20 +270,16 @@ export async function buildUnitedIndexQuery( }, }; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - let query: Record = - filterIgnoredAgents || filterEndpointPolicyAgents - ? idFilter - : { - match_all: {}, - }; + let query: BuildUnitedIndexQueryResponse['body']['query'] = idFilter; - if (statusesKuery || request?.body?.filters?.kql) { - const kqlQuery = toElasticsearchQuery(fromKueryExpression(request.body.filters.kql)); + if (statusesKuery || filters?.kql) { + const kqlQuery = toElasticsearchQuery(fromKueryExpression(filters.kql ?? '')); const q = []; + if (filterIgnoredAgents || filterEndpointPolicyAgents) { q.push(idFilter); } + if (statusesKuery) { q.push(toElasticsearchQuery(fromKueryExpression(statusesKuery))); } @@ -288,8 +295,8 @@ export async function buildUnitedIndexQuery( track_total_hits: true, sort: MetadataSortMethod, }, - from: pagingProperties.pageIndex * pagingProperties.pageSize, - size: pagingProperties.pageSize, + from: (page - 1) * pageSize, + size: pageSize, index: METADATA_UNITED_INDEX, }; } diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/test_support.ts b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/test_support.ts index 2ffcc06915e734..6f8a0f83bf8468 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/test_support.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/test_support.ts @@ -6,10 +6,11 @@ */ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { Agent } from '../../../../../../fleet/common'; import { METADATA_UNITED_INDEX } from '../../../../../common/endpoint/constants'; import { HostMetadata, UnitedAgentMetadata } from '../../../../../common/endpoint/types'; -export function legacyMetadataSearchResponse( +export function legacyMetadataSearchResponseMock( hostMetadata?: HostMetadata ): estypes.SearchResponse { return { @@ -44,8 +45,9 @@ export function legacyMetadataSearchResponse( } as unknown as estypes.SearchResponse; } -export function unitedMetadataSearchResponse( - hostMetadata?: HostMetadata +export function unitedMetadataSearchResponseMock( + hostMetadata: HostMetadata = {} as HostMetadata, + agent: Agent = {} as Agent ): estypes.SearchResponse { return { took: 15, @@ -73,7 +75,9 @@ export function unitedMetadataSearchResponse( id: 'test-agent-id', }, united: { - agent: {}, + agent: { + ...agent, + }, endpoint: { ...hostMetadata, }, diff --git a/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts b/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts index c175fedda388e9..d3cc7b32bbc1c4 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts @@ -12,18 +12,28 @@ import { import { elasticsearchServiceMock } from '../../../../../../../src/core/server/mocks'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { ElasticsearchClientMock } from '../../../../../../../src/core/server/elasticsearch/client/mocks'; -import { legacyMetadataSearchResponse } from '../../routes/metadata/support/test_support'; +import { + legacyMetadataSearchResponseMock, + unitedMetadataSearchResponseMock, +} from '../../routes/metadata/support/test_support'; import { EndpointDocGenerator } from '../../../../common/endpoint/generate_data'; -import { getESQueryHostMetadataByFleetAgentIds } from '../../routes/metadata/query_builders'; +import { + getESQueryHostMetadataByFleetAgentIds, + buildUnitedIndexQuery, +} from '../../routes/metadata/query_builders'; import { EndpointError } from '../../errors'; import { HostMetadata } from '../../../../common/endpoint/types'; +import { Agent } from '../../../../../fleet/common'; +import { AgentPolicyServiceInterface } from '../../../../../fleet/server/services'; describe('EndpointMetadataService', () => { let testMockedContext: EndpointMetadataServiceTestContextMock; let metadataService: EndpointMetadataServiceTestContextMock['endpointMetadataService']; let esClient: ElasticsearchClientMock; + let endpointDocGenerator: EndpointDocGenerator; beforeEach(() => { + endpointDocGenerator = new EndpointDocGenerator('seed'); testMockedContext = createEndpointMetadataServiceTestContextMock(); metadataService = testMockedContext.endpointMetadataService; esClient = elasticsearchServiceMock.createScopedClusterClient().asInternalUser; @@ -35,10 +45,10 @@ describe('EndpointMetadataService', () => { beforeEach(() => { fleetAgentIds = ['one', 'two']; - endpointMetadataDoc = new EndpointDocGenerator().generateHostMetadata(); + endpointMetadataDoc = endpointDocGenerator.generateHostMetadata(); esClient.search.mockReturnValue( elasticsearchServiceMock.createSuccessTransportRequestPromise( - legacyMetadataSearchResponse(endpointMetadataDoc) + legacyMetadataSearchResponseMock(endpointMetadataDoc) ) ); }); @@ -66,4 +76,133 @@ describe('EndpointMetadataService', () => { expect(response).toEqual([endpointMetadataDoc]); }); }); + + describe('#doesUnitedIndexExist', () => { + it('should return true if united index found', async () => { + const esMockResponse = elasticsearchServiceMock.createSuccessTransportRequestPromise( + unitedMetadataSearchResponseMock() + ); + esClient.search.mockResolvedValue(esMockResponse); + const doesIndexExist = await metadataService.doesUnitedIndexExist(esClient); + + expect(doesIndexExist).toEqual(true); + }); + + it('should return false if united index not found', async () => { + const esMockResponse = elasticsearchServiceMock.createErrorTransportRequestPromise({ + meta: { body: { error: { type: 'index_not_found_exception' } } }, + }); + esClient.search.mockResolvedValue(esMockResponse); + const doesIndexExist = await metadataService.doesUnitedIndexExist(esClient); + + expect(doesIndexExist).toEqual(false); + }); + + it('should throw wrapped error if es error other than index not found', async () => { + const esMockResponse = elasticsearchServiceMock.createErrorTransportRequestPromise({}); + esClient.search.mockResolvedValue(esMockResponse); + const response = metadataService.doesUnitedIndexExist(esClient); + await expect(response).rejects.toThrow(EndpointError); + }); + }); + + describe('#getHostMetadataList', () => { + let agentPolicyServiceMock: jest.Mocked; + + beforeEach(() => { + agentPolicyServiceMock = testMockedContext.agentPolicyService; + esClient = elasticsearchServiceMock.createScopedClusterClient().asCurrentUser; + }); + + it('should throw wrapped error if es error', async () => { + const esMockResponse = elasticsearchServiceMock.createErrorTransportRequestPromise({}); + esClient.search.mockResolvedValue(esMockResponse); + const metadataListResponse = metadataService.getHostMetadataList(esClient); + await expect(metadataListResponse).rejects.toThrow(EndpointError); + }); + + it('should correctly list HostMetadata', async () => { + const policyId = 'test-agent-policy-id'; + const packagePolicies = [ + Object.assign(endpointDocGenerator.generatePolicyPackagePolicy(), { + id: 'test-package-policy-id', + policy_id: policyId, + revision: 1, + }), + ]; + const packagePolicyIds = packagePolicies.map((policy) => policy.policy_id); + const agentPolicies = [ + Object.assign(endpointDocGenerator.generateAgentPolicy(), { + id: policyId, + revision: 2, + package_policies: packagePolicies, + }), + ]; + const agentPolicyIds = agentPolicies.map((policy) => policy.id); + const endpointMetadataDoc = endpointDocGenerator.generateHostMetadata(); + const mockAgent = { + policy_id: agentPolicies[0].id, + policy_revision: agentPolicies[0].revision, + } as unknown as Agent; + const mockDoc = unitedMetadataSearchResponseMock(endpointMetadataDoc, mockAgent); + const esMockResponse = await elasticsearchServiceMock.createSuccessTransportRequestPromise( + mockDoc + ); + + esClient.search.mockResolvedValue(esMockResponse); + agentPolicyServiceMock.getByIds.mockResolvedValue(agentPolicies); + testMockedContext.packagePolicyService.list.mockImplementation( + async (_, { page, perPage }) => { + const response = { + items: packagePolicies, + page: page ?? 1, + total: packagePolicies.length, + perPage: packagePolicies.length, + }; + + if ((page ?? 1) > 1) { + response.items = []; + } + + return response; + } + ); + + const metadataListResponse = await metadataService.getHostMetadataList(esClient); + const unitedIndexQuery = await buildUnitedIndexQuery( + { page: 1, pageSize: 10, filters: {} }, + packagePolicyIds + ); + + expect(esClient.search).toBeCalledWith(unitedIndexQuery); + expect(agentPolicyServiceMock.getByIds).toBeCalledWith(expect.anything(), agentPolicyIds); + expect(metadataListResponse).toEqual({ + pageSize: 10, + page: 1, + total: 1, + data: [ + { + metadata: endpointMetadataDoc, + host_status: 'inactive', + policy_info: { + agent: { + applied: { + id: mockAgent.policy_id, + revision: mockAgent.policy_revision, + }, + configured: { + id: agentPolicies[0].id, + revision: agentPolicies[0].revision, + }, + }, + endpoint: { + id: packagePolicies[0].id, + revision: packagePolicies[0].revision, + }, + }, + }, + ], + }); + }); + }); }); diff --git a/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.ts b/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.ts index 23c21e431a3445..be8a6625c111e9 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.ts @@ -11,22 +11,34 @@ import { SavedObjectsClientContract, SavedObjectsServiceStart, } from 'kibana/server'; -import { HostInfo, HostMetadata } from '../../../../common/endpoint/types'; + +import { TransportResult } from '@elastic/elasticsearch'; +import { SearchTotalHits, SearchResponse } from '@elastic/elasticsearch/lib/api/types'; +import { + HostInfo, + HostMetadata, + MaybeImmutable, + PolicyData, + UnitedAgentMetadata, +} from '../../../../common/endpoint/types'; import { Agent, AgentPolicy, PackagePolicy } from '../../../../../fleet/common'; import { AgentNotFoundError, AgentPolicyServiceInterface, AgentService, + PackagePolicyServiceInterface, } from '../../../../../fleet/server'; import { EndpointHostNotFoundError, EndpointHostUnEnrolledError, FleetAgentNotFoundError, FleetAgentPolicyNotFoundError, + FleetEndpointPackagePolicyNotFoundError, } from './errors'; import { getESQueryHostMetadataByFleetAgentIds, getESQueryHostMetadataByID, + buildUnitedIndexQuery, } from '../../routes/metadata/query_builders'; import { queryResponseToHostListResult, @@ -40,11 +52,28 @@ import { } from '../../utils'; import { EndpointError } from '../../errors'; import { createInternalReadonlySoClient } from '../../utils/create_internal_readonly_so_client'; +import { GetHostMetadataListQuery } from '../../types'; +import { METADATA_UNITED_INDEX } from '../../../../common/endpoint/constants'; +import { getAllEndpointPackagePolicies } from '../../routes/metadata/support/endpoint_package_policies'; +import { getAgentStatus } from '../../../../../fleet/common/services/agent_status'; type AgentPolicyWithPackagePolicies = Omit & { package_policies: PackagePolicy[]; }; +const isAgentPolicyWithPackagePolicies = ( + agentPolicy: AgentPolicy | AgentPolicyWithPackagePolicies +): agentPolicy is AgentPolicyWithPackagePolicies => { + if ( + agentPolicy.package_policies.length === 0 || + typeof agentPolicy.package_policies[0] !== 'string' + ) { + return true; + } + + return false; +}; + export class EndpointMetadataService { /** * For internal use only by the `this.DANGEROUS_INTERNAL_SO_CLIENT` @@ -56,6 +85,7 @@ export class EndpointMetadataService { private savedObjectsStart: SavedObjectsServiceStart, private readonly agentService: AgentService, private readonly agentPolicyService: AgentPolicyServiceInterface, + private readonly packagePolicyService: PackagePolicyServiceInterface, private readonly logger?: Logger ) {} @@ -161,52 +191,119 @@ export class EndpointMetadataService { ); } - // ------------------------------------------------------------------------------ - // Any failures in enriching the Host form this point should NOT cause an error - // ------------------------------------------------------------------------------ - try { - let fleetAgentPolicy: AgentPolicyWithPackagePolicies | undefined; - let endpointPackagePolicy: PackagePolicy | undefined; - - // Get Agent Policy and Endpoint Package Policy - if (fleetAgent) { - try { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - fleetAgentPolicy = await this.getFleetAgentPolicy(fleetAgent.policy_id!); - endpointPackagePolicy = fleetAgentPolicy.package_policies.find( - (policy) => policy.package?.name === 'endpoint' + return this.enrichHostMetadata(esClient, endpointMetadata, fleetAgent); + } + + /** + * Enriches a host metadata document with data from fleet + * @param esClient + * @param endpointMetadata + * @param _fleetAgent + * @param _fleetAgentPolicy + * @param _endpointPackagePolicy + * @private + */ + // eslint-disable-next-line complexity + private async enrichHostMetadata( + esClient: ElasticsearchClient, + endpointMetadata: HostMetadata, + /** + * If undefined, it will be retrieved from Fleet using the ID in the endpointMetadata. + * If passing in an `Agent` record that was retrieved from the Endpoint Unified transform index, + * ensure that its `.status` property is properly set to the calculated value done by + * fleet `getAgentStatus()` method. + */ + _fleetAgent?: MaybeImmutable, + /** If undefined, it will be retrieved from Fleet using data from the endpointMetadata */ + _fleetAgentPolicy?: + | MaybeImmutable + | MaybeImmutable, + /** If undefined, it will be retrieved from Fleet using the ID in the endpointMetadata */ + _endpointPackagePolicy?: MaybeImmutable + ): Promise { + let fleetAgentId = endpointMetadata.elastic.agent.id; + // casting below is done only to remove `immutable<>` from the object if they are defined as such + let fleetAgent = _fleetAgent as Agent | undefined; + let fleetAgentPolicy = _fleetAgentPolicy as + | AgentPolicy + | AgentPolicyWithPackagePolicies + | undefined; + let endpointPackagePolicy = _endpointPackagePolicy as PackagePolicy | undefined; + + if (!fleetAgent) { + try { + if (!fleetAgentId) { + fleetAgentId = endpointMetadata.agent.id; + this.logger?.warn( + new EndpointError( + `Missing elastic fleet agent id on Endpoint Metadata doc - using Endpoint agent.id instead: ${fleetAgentId}` + ) ); - } catch (error) { - this.logger?.error(error); + } + + fleetAgent = await this.getFleetAgent(esClient, fleetAgentId); + } catch (error) { + if (error instanceof FleetAgentNotFoundError) { + this.logger?.warn(`agent with id ${fleetAgentId} not found`); + } else { + throw error; } } + } - return { - metadata: endpointMetadata, - host_status: fleetAgent - ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - fleetAgentStatusToEndpointHostStatus(fleetAgent.status!) - : DEFAULT_ENDPOINT_HOST_STATUS, - policy_info: { - agent: { - applied: { - revision: fleetAgent?.policy_revision ?? 0, - id: fleetAgent?.policy_id ?? '', - }, - configured: { - revision: fleetAgentPolicy?.revision ?? 0, - id: fleetAgentPolicy?.id ?? '', - }, + if (!fleetAgentPolicy && fleetAgent) { + try { + fleetAgentPolicy = await this.getFleetAgentPolicy(fleetAgent.policy_id ?? ''); + } catch (error) { + this.logger?.error(error); + } + } + + // The fleetAgentPolicy might have the endpoint policy in the `package_policies`, lets check that first + if ( + !endpointPackagePolicy && + fleetAgentPolicy && + isAgentPolicyWithPackagePolicies(fleetAgentPolicy) + ) { + endpointPackagePolicy = fleetAgentPolicy.package_policies.find( + (policy) => policy.package?.name === 'endpoint' + ); + } + + // if we still don't have an endpoint package policy, try retrieving it from fleet + if (!endpointPackagePolicy) { + try { + endpointPackagePolicy = await this.getFleetEndpointPackagePolicy( + endpointMetadata.Endpoint.policy.applied.id + ); + } catch (error) { + this.logger?.error(error); + } + } + + return { + metadata: endpointMetadata, + host_status: fleetAgent + ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + fleetAgentStatusToEndpointHostStatus(fleetAgent.status!) + : DEFAULT_ENDPOINT_HOST_STATUS, + policy_info: { + agent: { + applied: { + revision: fleetAgent?.policy_revision ?? 0, + id: fleetAgent?.policy_id ?? '', }, - endpoint: { - revision: endpointPackagePolicy?.revision ?? 0, - id: endpointPackagePolicy?.id ?? '', + configured: { + revision: fleetAgentPolicy?.revision ?? 0, + id: fleetAgentPolicy?.id ?? '', }, }, - }; - } catch (error) { - throw wrapErrorIfNeeded(error); - } + endpoint: { + revision: endpointPackagePolicy?.revision ?? 0, + id: endpointPackagePolicy?.id ?? '', + }, + }, + }; } /** @@ -247,4 +344,139 @@ export class EndpointMetadataService { `Fleet agent policy with id ${agentPolicyId} not found` ); } + + /** + * Retrieve an endpoint policy from fleet + * @param endpointPolicyId + * @throws + */ + async getFleetEndpointPackagePolicy(endpointPolicyId: string): Promise { + const endpointPackagePolicy = await this.packagePolicyService + .get(this.DANGEROUS_INTERNAL_SO_CLIENT, endpointPolicyId) + .catch(catchAndWrapError); + + if (!endpointPackagePolicy) { + throw new FleetEndpointPackagePolicyNotFoundError( + `Fleet endpoint package policy with id ${endpointPolicyId} not found` + ); + } + + return endpointPackagePolicy as PolicyData; + } + + /** + * Returns whether the united metadata index exists + * + * @param esClient + * + * @throws + */ + async doesUnitedIndexExist(esClient: ElasticsearchClient): Promise { + try { + await esClient.search({ + index: METADATA_UNITED_INDEX, + size: 1, + }); + return true; + } catch (error) { + const errorType = error?.meta?.body?.error?.type ?? ''; + // only index not found is expected + if (errorType !== 'index_not_found_exception') { + const err = wrapErrorIfNeeded(error); + this.logger?.error(err); + throw err; + } + } + + return false; + } + + /** + * Retrieve list of host metadata. Only supports new united index. + * + * @param esClient + * @param queryOptions + * + * @throws + */ + async getHostMetadataList( + esClient: ElasticsearchClient, + queryOptions: GetHostMetadataListQuery = {} + ): Promise<{ data: HostInfo[]; total: number; page: number; pageSize: number }> { + const endpointPolicies = await getAllEndpointPackagePolicies( + this.packagePolicyService, + this.DANGEROUS_INTERNAL_SO_CLIENT + ); + const endpointPolicyIds = endpointPolicies.map((policy) => policy.policy_id); + const unitedIndexQuery = await buildUnitedIndexQuery(queryOptions, endpointPolicyIds); + + let unitedMetadataQueryResponse: TransportResult, unknown>; + + try { + unitedMetadataQueryResponse = await esClient.search(unitedIndexQuery); + } catch (error) { + const err = wrapErrorIfNeeded(error); + this.logger?.error(err); + throw err; + } + + const { hits: docs, total: docsCount } = unitedMetadataQueryResponse?.body?.hits || {}; + const agentPolicyIds: string[] = docs.map((doc) => doc._source?.united?.agent?.policy_id ?? ''); + + const agentPolicies = + (await this.agentPolicyService + .getByIds(this.DANGEROUS_INTERNAL_SO_CLIENT, agentPolicyIds) + .catch(catchAndWrapError)) ?? []; + + const agentPoliciesMap: Record = agentPolicies.reduce( + (acc, agentPolicy) => ({ + ...acc, + [agentPolicy.id]: { + ...agentPolicy, + }, + }), + {} + ); + + const endpointPoliciesMap: Record = endpointPolicies.reduce( + (acc, packagePolicy) => ({ + ...acc, + [packagePolicy.policy_id]: packagePolicy, + }), + {} + ); + + const hosts: HostInfo[] = []; + + for (const doc of docs) { + const { endpoint: metadata, agent: _agent } = doc?._source?.united ?? {}; + + if (metadata && _agent) { + // `_agent: Agent` here is the record stored in the unified index, whose `status` **IS NOT** the + // calculated status returned by the normal fleet API/Service. So lets calculated it before + // passing this on to other methods that expect an `Agent` type + const agent: typeof _agent = { + ..._agent, + // Casting below necessary to remove `Immutable<>` from the type + status: getAgentStatus(_agent as Agent), + }; + + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const agentPolicy = agentPoliciesMap[agent.policy_id!]; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const endpointPolicy = endpointPoliciesMap[agent.policy_id!]; + + hosts.push( + await this.enrichHostMetadata(esClient, metadata, agent, agentPolicy, endpointPolicy) + ); + } + } + + return { + data: hosts, + pageSize: unitedIndexQuery.size, + page: unitedIndexQuery.from + 1, + total: (docsCount as unknown as SearchTotalHits).value, + }; + } } diff --git a/x-pack/plugins/security_solution/server/endpoint/services/metadata/errors.ts b/x-pack/plugins/security_solution/server/endpoint/services/metadata/errors.ts index f61ad79a4c92b8..c825211fede2da 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/metadata/errors.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/metadata/errors.ts @@ -16,3 +16,5 @@ export class EndpointHostUnEnrolledError extends EndpointError {} export class FleetAgentNotFoundError extends NotFoundError {} export class FleetAgentPolicyNotFoundError extends NotFoundError {} + +export class FleetEndpointPackagePolicyNotFoundError extends NotFoundError {} diff --git a/x-pack/plugins/security_solution/server/endpoint/services/metadata/mocks.ts b/x-pack/plugins/security_solution/server/endpoint/services/metadata/mocks.ts index 147d8e11b567c4..166f8345009279 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/metadata/mocks.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/metadata/mocks.ts @@ -11,9 +11,23 @@ import { savedObjectsServiceMock } from '../../../../../../../src/core/server/mo import { createMockAgentPolicyService, createMockAgentService, + createPackagePolicyServiceMock, } from '../../../../../fleet/server/mocks'; import { AgentPolicyServiceInterface, AgentService } from '../../../../../fleet/server'; +const createCustomizedPackagePolicyService = () => { + const service = createPackagePolicyServiceMock(); + service.list.mockImplementation(async (_, options) => { + return { + items: [], + total: 0, + page: options.page ?? 1, + perPage: options.perPage ?? 10, + }; + }); + return service; +}; + /** * Endpoint Metadata Service test context. Includes an instance of `EndpointMetadataService` along with the * dependencies that were used to initialize that instance. @@ -22,24 +36,30 @@ export interface EndpointMetadataServiceTestContextMock { savedObjectsStart: jest.Mocked; agentService: jest.Mocked; agentPolicyService: jest.Mocked; + packagePolicyService: ReturnType; endpointMetadataService: EndpointMetadataService; } export const createEndpointMetadataServiceTestContextMock = ( savedObjectsStart: jest.Mocked = savedObjectsServiceMock.createStartContract(), agentService: jest.Mocked = createMockAgentService(), - agentPolicyService: jest.Mocked = createMockAgentPolicyService() + agentPolicyService: jest.Mocked = createMockAgentPolicyService(), + packagePolicyService: ReturnType< + typeof createPackagePolicyServiceMock + > = createCustomizedPackagePolicyService() ): EndpointMetadataServiceTestContextMock => { const endpointMetadataService = new EndpointMetadataService( savedObjectsStart, agentService, - agentPolicyService + agentPolicyService, + packagePolicyService ); return { savedObjectsStart, agentService, agentPolicyService, + packagePolicyService, endpointMetadataService, }; }; diff --git a/x-pack/plugins/security_solution/server/endpoint/types.ts b/x-pack/plugins/security_solution/server/endpoint/types.ts index bc52b759b9f0ab..919e62785f698e 100644 --- a/x-pack/plugins/security_solution/server/endpoint/types.ts +++ b/x-pack/plugins/security_solution/server/endpoint/types.ts @@ -7,10 +7,12 @@ import { LoggerFactory } from 'kibana/server'; +import { TypeOf } from '@kbn/config-schema'; import { ConfigType } from '../config'; import { EndpointAppContextService } from './endpoint_app_context_services'; import { HostMetadata } from '../../common/endpoint/types'; import { ExperimentalFeatures } from '../../common/experimental_features'; +import { endpointFilters } from './routes/metadata'; /** * The context for Endpoint apps. @@ -35,3 +37,11 @@ export interface HostQueryResult { resultLength: number; result: HostMetadata | undefined; } + +// FIXME: when new Host Metadata list API is created (and existing one deprecated - 8.0?), move this type out of here and created it from Schema +export interface GetHostMetadataListQuery { + /* page number 1 based - not an index */ + page?: number; + pageSize?: number; + filters?: Partial>; +} diff --git a/x-pack/plugins/security_solution/server/index.ts b/x-pack/plugins/security_solution/server/index.ts index 16a4992e68698c..43da8f5d8f0ef0 100644 --- a/x-pack/plugins/security_solution/server/index.ts +++ b/x-pack/plugins/security_solution/server/index.ts @@ -21,26 +21,31 @@ export const config: PluginConfigDescriptor = { }, schema: configSchema, deprecations: ({ renameFromRoot }) => [ - renameFromRoot('xpack.siem.enabled', 'xpack.securitySolution.enabled'), + renameFromRoot('xpack.siem.enabled', 'xpack.securitySolution.enabled', { level: 'critical' }), renameFromRoot( 'xpack.siem.maxRuleImportExportSize', - 'xpack.securitySolution.maxRuleImportExportSize' + 'xpack.securitySolution.maxRuleImportExportSize', + { level: 'critical' } ), renameFromRoot( 'xpack.siem.maxRuleImportPayloadBytes', - 'xpack.securitySolution.maxRuleImportPayloadBytes' + 'xpack.securitySolution.maxRuleImportPayloadBytes', + { level: 'critical' } ), renameFromRoot( 'xpack.siem.maxTimelineImportExportSize', - 'xpack.securitySolution.maxTimelineImportExportSize' + 'xpack.securitySolution.maxTimelineImportExportSize', + { level: 'critical' } ), renameFromRoot( 'xpack.siem.maxTimelineImportPayloadBytes', - 'xpack.securitySolution.maxTimelineImportPayloadBytes' + 'xpack.securitySolution.maxTimelineImportPayloadBytes', + { level: 'critical' } ), renameFromRoot( `xpack.siem.${SIGNALS_INDEX_KEY}`, - `xpack.securitySolution.${SIGNALS_INDEX_KEY}` + `xpack.securitySolution.${SIGNALS_INDEX_KEY}`, + { level: 'critical' } ), ], }; diff --git a/x-pack/plugins/security_solution/server/plugin.ts b/x-pack/plugins/security_solution/server/plugin.ts index 843bd0ed7019d2..87f0ed7193a67f 100644 --- a/x-pack/plugins/security_solution/server/plugin.ts +++ b/x-pack/plugins/security_solution/server/plugin.ts @@ -405,6 +405,8 @@ export class Plugin implements ISecuritySolutionPlugin { plugins.fleet?.agentService!, // eslint-disable-next-line @typescript-eslint/no-non-null-assertion plugins.fleet?.agentPolicyService!, + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + plugins.fleet?.packagePolicyService!, logger ), security: plugins.security, diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/home.helpers.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/home.helpers.ts index 71930efe129530..1e16fa2a401299 100644 --- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/home.helpers.ts +++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/home.helpers.ts @@ -7,12 +7,18 @@ import { act } from 'react-dom/test-utils'; -import { registerTestBed, findTestSubject, TestBed, TestBedConfig, delay } from '@kbn/test/jest'; +import { + registerTestBed, + findTestSubject, + TestBed, + AsyncTestBedConfig, + delay, +} from '@kbn/test/jest'; import { SnapshotRestoreHome } from '../../../public/application/sections/home/home'; import { BASE_PATH } from '../../../public/application/constants'; import { WithAppDependencies } from './setup_environment'; -const testBedConfig: TestBedConfig = { +const testBedConfig: AsyncTestBedConfig = { memoryRouter: { initialEntries: [`${BASE_PATH}/repositories`], componentRoutePath: `${BASE_PATH}/:section(repositories|snapshots)/:repositoryName?/:snapshotId*`, diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_add.helpers.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_add.helpers.ts index b3eeaeedbbe52b..a6e7c4a4c10569 100644 --- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_add.helpers.ts +++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_add.helpers.ts @@ -5,12 +5,12 @@ * 2.0. */ -import { registerTestBed, TestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, AsyncTestBedConfig } from '@kbn/test/jest'; import { PolicyAdd } from '../../../public/application/sections/policy_add'; import { formSetup, PolicyFormTestSubjects } from './policy_form.helpers'; import { WithAppDependencies } from './setup_environment'; -const testBedConfig: TestBedConfig = { +const testBedConfig: AsyncTestBedConfig = { memoryRouter: { initialEntries: ['/add_policy'], componentRoutePath: '/add_policy', diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_edit.helpers.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_edit.helpers.ts index 71b500ac73263a..2014d22ffbfbce 100644 --- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_edit.helpers.ts +++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_edit.helpers.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { registerTestBed, TestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, AsyncTestBedConfig } from '@kbn/test/jest'; import { PolicyEdit } from '../../../public/application/sections/policy_edit'; import { WithAppDependencies } from './setup_environment'; import { POLICY_NAME } from './constant'; import { formSetup, PolicyFormTestSubjects } from './policy_form.helpers'; -const testBedConfig: TestBedConfig = { +const testBedConfig: AsyncTestBedConfig = { memoryRouter: { initialEntries: [`/edit_policy/${POLICY_NAME}`], componentRoutePath: '/edit_policy/:name', diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_edit.helpers.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_edit.helpers.ts index 9a6f0d9a76bd13..f0563f2831a986 100644 --- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_edit.helpers.ts +++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_edit.helpers.ts @@ -5,12 +5,12 @@ * 2.0. */ -import { registerTestBed, TestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, AsyncTestBedConfig } from '@kbn/test/jest'; import { RepositoryEdit } from '../../../public/application/sections/repository_edit'; import { WithAppDependencies } from './setup_environment'; import { REPOSITORY_NAME } from './constant'; -const testBedConfig: TestBedConfig = { +const testBedConfig: AsyncTestBedConfig = { memoryRouter: { initialEntries: [`/${REPOSITORY_NAME}`], componentRoutePath: '/:name', diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/restore_snapshot.helpers.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/restore_snapshot.helpers.ts index 9b82c1d5b6364c..123ae0cbb1c2ed 100644 --- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/restore_snapshot.helpers.ts +++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/restore_snapshot.helpers.ts @@ -6,11 +6,11 @@ */ import { act } from 'react-dom/test-utils'; -import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest'; import { RestoreSnapshot } from '../../../public/application/sections/restore_snapshot'; import { WithAppDependencies } from './setup_environment'; -const testBedConfig: TestBedConfig = { +const testBedConfig: AsyncTestBedConfig = { memoryRouter: { initialEntries: ['/add_policy'], componentRoutePath: '/add_policy', diff --git a/x-pack/plugins/spaces/public/nav_control/components/spaces_menu.scss b/x-pack/plugins/spaces/public/nav_control/components/spaces_menu.scss index 1f272260fc9c2b..f444b45192f8bf 100644 --- a/x-pack/plugins/spaces/public/nav_control/components/spaces_menu.scss +++ b/x-pack/plugins/spaces/public/nav_control/components/spaces_menu.scss @@ -3,8 +3,8 @@ } .spcMenu__spacesList { + @include euiYScrollWithShadows; max-height: $euiSizeXL * 10; - overflow-y: auto; } .spcMenu__searchFieldWrapper { @@ -18,4 +18,4 @@ .spcMenu__item { margin-left: $euiSizeM; -} \ No newline at end of file +} diff --git a/x-pack/plugins/task_manager/server/plugin.ts b/x-pack/plugins/task_manager/server/plugin.ts index 9a43cd5b8c1d6c..4e1db9c274b5e6 100644 --- a/x-pack/plugins/task_manager/server/plugin.ts +++ b/x-pack/plugins/task_manager/server/plugin.ts @@ -159,7 +159,7 @@ export class TaskManagerPlugin const taskStore = new TaskStore({ serializer, savedObjectsRepository, - esClient: elasticsearch.createClient('taskManager').asInternalUser, + esClient: elasticsearch.client.asInternalUser, index: TASK_MANAGER_INDEX, definitions: this.definitions, taskManagerId: `kibana:${this.taskManagerId!}`, diff --git a/x-pack/plugins/timelines/public/components/t_grid/body/control_columns/checkbox.test.tsx b/x-pack/plugins/timelines/public/components/t_grid/body/control_columns/checkbox.test.tsx index c5aba4506f39d5..56d2df3754fa80 100644 --- a/x-pack/plugins/timelines/public/components/t_grid/body/control_columns/checkbox.test.tsx +++ b/x-pack/plugins/timelines/public/components/t_grid/body/control_columns/checkbox.test.tsx @@ -45,8 +45,8 @@ describe('checkbox control column', () => { const { getByTestId } = render( ); - - fireEvent.click(getByTestId('select-event')); + const checkbox = getByTestId(/^select-event/); + fireEvent.click(checkbox); expect(onRowSelected).toHaveBeenCalled(); }); diff --git a/x-pack/plugins/timelines/public/components/t_grid/body/control_columns/checkbox.tsx b/x-pack/plugins/timelines/public/components/t_grid/body/control_columns/checkbox.tsx index 0d750a002914b0..6feb972b9a8134 100644 --- a/x-pack/plugins/timelines/public/components/t_grid/body/control_columns/checkbox.tsx +++ b/x-pack/plugins/timelines/public/components/t_grid/body/control_columns/checkbox.tsx @@ -7,6 +7,7 @@ import { EuiCheckbox, EuiLoadingSpinner } from '@elastic/eui'; import React, { useCallback } from 'react'; +import { ALERT_RULE_PRODUCER } from '@kbn/rule-data-utils'; import { ActionProps, HeaderActionProps } from '../../../../../common'; import * as i18n from './translations'; @@ -18,7 +19,10 @@ export const RowCheckBox = ({ columnValues, disabled, loadingEventIds, + data, }: ActionProps) => { + const ruleProducers = data.find((d) => d.field === ALERT_RULE_PRODUCER)?.value ?? []; + const ruleProducer = ruleProducers[0]; const handleSelectEvent = useCallback( (event: React.ChangeEvent) => { if (!disabled) { @@ -35,7 +39,7 @@ export const RowCheckBox = ({ ) : ( = ({ size }) => ( - + diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.tsx index 162f41605e91e7..27623654245ebc 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.tsx @@ -111,6 +111,8 @@ export const AlertsList: React.FunctionComponent = () => { } = useKibana().services; const canExecuteActions = hasExecuteActionsCapability(capabilities); + const [initialLoad, setInitialLoad] = useState(true); + const [noData, setNoData] = useState(true); const [actionTypes, setActionTypes] = useState([]); const [selectedIds, setSelectedIds] = useState([]); const [isPerformingAction, setIsPerformingAction] = useState(false); @@ -220,7 +222,8 @@ export const AlertsList: React.FunctionComponent = () => { }, []); async function loadAlertsData() { - const hasAnyAuthorizedAlertType = alertTypesState.data.size > 0; + const hasAnyAuthorizedAlertType = + alertTypesState.isInitialized && alertTypesState.data.size > 0; if (hasAnyAuthorizedAlertType) { setAlertsState({ ...alertsState, isLoading: true }); try { @@ -243,6 +246,15 @@ export const AlertsList: React.FunctionComponent = () => { if (!alertsResponse.data?.length && page.index > 0) { setPage({ ...page, index: 0 }); } + + const isFilterApplied = !( + isEmpty(searchText) && + isEmpty(typesFilter) && + isEmpty(actionTypesFilter) && + isEmpty(alertStatusesFilter) + ); + + setNoData(alertsResponse.data.length === 0 && !isFilterApplied); } catch (e) { toasts.addDanger({ title: i18n.translate( @@ -254,6 +266,7 @@ export const AlertsList: React.FunctionComponent = () => { }); setAlertsState({ ...alertsState, isLoading: false }); } + setInitialLoad(false); } } @@ -946,18 +959,22 @@ export const AlertsList: React.FunctionComponent = () => { ); - const loadedItems = convertAlertsToTableItems( - alertsState.data, - alertTypesState.data, - canExecuteActions - ); + // if initial load, show spinner + const getRulesList = () => { + if (noData && !alertsState.isLoading && !alertTypesState.isLoading) { + return authorizedToCreateAnyAlerts ? ( + setAlertFlyoutVisibility(true)} /> + ) : ( + noPermissionPrompt + ); + } - const isFilterApplied = !( - isEmpty(searchText) && - isEmpty(typesFilter) && - isEmpty(actionTypesFilter) && - isEmpty(alertStatusesFilter) - ); + if (initialLoad) { + return ; + } + + return table; + }; return (
@@ -988,15 +1005,7 @@ export const AlertsList: React.FunctionComponent = () => { }} /> - {loadedItems.length || isFilterApplied ? ( - table - ) : alertTypesState.isLoading || alertsState.isLoading ? ( - - ) : authorizedToCreateAnyAlerts ? ( - setAlertFlyoutVisibility(true)} /> - ) : ( - noPermissionPrompt - )} + {getRulesList()} {alertFlyoutVisible && ( registerRouter(router), initialEntries: [`${ROUTES.API_ROOT}/watches/new-watch/${WATCH_TYPES.JSON}`], diff --git a/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_create_threshold.helpers.ts b/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_create_threshold.helpers.ts index caddf1df93d405..320f88eef2651b 100644 --- a/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_create_threshold.helpers.ts +++ b/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_create_threshold.helpers.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest'; import { WatchEdit } from '../../../public/application/sections/watch_edit/components/watch_edit'; import { registerRouter } from '../../../public/application/lib/navigation'; import { ROUTES, WATCH_TYPES } from '../../../common/constants'; import { withAppContext } from './app_context.mock'; -const testBedConfig: TestBedConfig = { +const testBedConfig: AsyncTestBedConfig = { memoryRouter: { onRouter: (router) => registerRouter(router), initialEntries: [`${ROUTES.API_ROOT}/watches/new-watch/${WATCH_TYPES.THRESHOLD}`], diff --git a/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_edit.helpers.ts b/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_edit.helpers.ts index 957755c9e5361e..15489fa0a864d2 100644 --- a/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_edit.helpers.ts +++ b/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_edit.helpers.ts @@ -5,14 +5,14 @@ * 2.0. */ -import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest'; import { WatchEdit } from '../../../public/application/sections/watch_edit/components/watch_edit'; import { registerRouter } from '../../../public/application/lib/navigation'; import { ROUTES } from '../../../common/constants'; import { WATCH_ID } from './jest_constants'; import { withAppContext } from './app_context.mock'; -const testBedConfig: TestBedConfig = { +const testBedConfig: AsyncTestBedConfig = { memoryRouter: { onRouter: (router) => registerRouter(router), initialEntries: [`${ROUTES.API_ROOT}/watches/watch/${WATCH_ID}/edit`], diff --git a/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_list.helpers.ts b/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_list.helpers.ts index c0643e70dded9c..d048a55422f6e9 100644 --- a/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_list.helpers.ts +++ b/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_list.helpers.ts @@ -7,12 +7,12 @@ import { act } from 'react-dom/test-utils'; -import { registerTestBed, findTestSubject, TestBed, TestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, findTestSubject, TestBed, AsyncTestBedConfig } from '@kbn/test/jest'; import { WatchList } from '../../../public/application/sections/watch_list/components/watch_list'; import { ROUTES, REFRESH_INTERVALS } from '../../../common/constants'; import { withAppContext } from './app_context.mock'; -const testBedConfig: TestBedConfig = { +const testBedConfig: AsyncTestBedConfig = { memoryRouter: { initialEntries: [`${ROUTES.API_ROOT}/watches`], }, diff --git a/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_status.helpers.ts b/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_status.helpers.ts index 02b6908fc1d4c9..0578f9f1092a17 100644 --- a/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_status.helpers.ts +++ b/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_status.helpers.ts @@ -7,13 +7,13 @@ import { act } from 'react-dom/test-utils'; -import { registerTestBed, findTestSubject, TestBed, TestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, findTestSubject, TestBed, AsyncTestBedConfig } from '@kbn/test/jest'; import { WatchStatus } from '../../../public/application/sections/watch_status/components/watch_status'; import { ROUTES } from '../../../common/constants'; import { WATCH_ID } from './jest_constants'; import { withAppContext } from './app_context.mock'; -const testBedConfig: TestBedConfig = { +const testBedConfig: AsyncTestBedConfig = { memoryRouter: { initialEntries: [`${ROUTES.API_ROOT}/watches/watch/${WATCH_ID}/status`], componentRoutePath: `${ROUTES.API_ROOT}/watches/watch/:id/status`, diff --git a/x-pack/test/accessibility/apps/ml.ts b/x-pack/test/accessibility/apps/ml.ts index fd05d2af07747c..eb086b86b91462 100644 --- a/x-pack/test/accessibility/apps/ml.ts +++ b/x-pack/test/accessibility/apps/ml.ts @@ -13,7 +13,8 @@ export default function ({ getService }: FtrProviderContext) { const a11y = getService('a11y'); const ml = getService('ml'); - describe('ml', () => { + // FLAKY https://github.com/elastic/kibana/issues/118417 + describe.skip('ml', () => { const esArchiver = getService('esArchiver'); before(async () => { diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/index.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/index.ts index f9cb6175e6fa68..f739d9d956cb5f 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/index.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/index.ts @@ -40,6 +40,7 @@ export default function alertingTests({ loadTestFile, getService }: FtrProviderC loadTestFile(require.resolve('./notify_when')); loadTestFile(require.resolve('./ephemeral')); loadTestFile(require.resolve('./event_log_alerts')); + loadTestFile(require.resolve('./scheduled_task_id')); // note that this test will destroy existing spaces loadTestFile(require.resolve('./migrations')); diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/scheduled_task_id.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/scheduled_task_id.ts new file mode 100644 index 00000000000000..9f087b73921325 --- /dev/null +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/scheduled_task_id.ts @@ -0,0 +1,112 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from '@kbn/expect'; +import { getUrlPrefix, TaskManagerDoc, ObjectRemover, getTestAlertData } from '../../../common/lib'; +import { FtrProviderContext } from '../../../common/ftr_provider_context'; + +const MIGRATED_RULE_ID = '74f3e6d7-b7bb-477d-ac28-92ee22728e6e'; +const MIGRATED_TASK_ID = '329798f0-b0b0-11ea-9510-fdf248d5f2a4'; + +// eslint-disable-next-line import/no-default-export +export default function createScheduledTaskIdTests({ getService }: FtrProviderContext) { + const es = getService('es'); + const supertest = getService('supertest'); + const supertestWithoutAuth = getService('supertestWithoutAuth'); + const esArchiver = getService('esArchiver'); + + describe('scheduled task id', () => { + const objectRemover = new ObjectRemover(supertest); + async function getScheduledTask(id: string): Promise { + const scheduledTask = await es.get({ + id: `task:${id}`, + index: '.kibana_task_manager', + }); + return scheduledTask._source!; + } + + before(async () => { + await esArchiver.load('x-pack/test/functional/es_archives/rules_scheduled_task_id'); + }); + + after(async () => { + await esArchiver.unload('x-pack/test/functional/es_archives/rules_scheduled_task_id'); + }); + + it('cannot create rule with same ID as a scheduled task ID used by another rule', async () => { + const response = await supertest.get( + `${getUrlPrefix(``)}/api/alerting/rule/${MIGRATED_RULE_ID}` + ); + expect(response.status).to.eql(200); + expect(response.body.scheduled_task_id).to.eql(MIGRATED_TASK_ID); + + await supertest + .post(`${getUrlPrefix(``)}/api/alerting/rule/${MIGRATED_TASK_ID}`) + .set('kbn-xsrf', 'foo') + .send(getTestAlertData()) + .expect(409); + }); + + it('for migrated rules - sets scheduled task id to match rule id when rule is disabled then enabled', async () => { + const response = await supertest.get( + `${getUrlPrefix(``)}/api/alerting/rule/${MIGRATED_RULE_ID}` + ); + expect(response.status).to.eql(200); + expect(response.body.scheduled_task_id).to.eql(MIGRATED_TASK_ID); + + // scheduled task id should exist + const taskRecordLoaded = await getScheduledTask(MIGRATED_TASK_ID); + expect(JSON.parse(taskRecordLoaded.task.params)).to.eql({ + alertId: MIGRATED_RULE_ID, + spaceId: 'default', + }); + + await supertestWithoutAuth + .post(`${getUrlPrefix(``)}/api/alerting/rule/${MIGRATED_RULE_ID}/_disable`) + .set('kbn-xsrf', 'foo') + .expect(204); + + await supertestWithoutAuth + .post(`${getUrlPrefix(``)}/api/alerting/rule/${MIGRATED_RULE_ID}/_enable`) + .set('kbn-xsrf', 'foo') + .expect(204); + + try { + await getScheduledTask(MIGRATED_TASK_ID); + throw new Error('Should have removed scheduled task'); + } catch (e) { + expect(e.meta.statusCode).to.eql(404); + } + + // scheduled task id that is same as rule id should exist + const taskRecordNew = await getScheduledTask(MIGRATED_RULE_ID); + expect(JSON.parse(taskRecordNew.task.params)).to.eql({ + alertId: MIGRATED_RULE_ID, + spaceId: 'default', + }); + }); + + it('sets scheduled task id to rule id when rule is created', async () => { + const response = await supertestWithoutAuth + .post(`${getUrlPrefix(``)}/api/alerting/rule`) + .set('kbn-xsrf', 'foo') + .send(getTestAlertData()); + + expect(response.status).to.eql(200); + objectRemover.add('default', response.body.id, 'rule', 'alerting'); + + expect(response.body.scheduled_task_id).to.eql(response.body.id); + const taskRecord = await getScheduledTask(response.body.scheduled_task_id); + expect(taskRecord.type).to.eql('task'); + expect(taskRecord.task.taskType).to.eql('alerting:test.noop'); + expect(JSON.parse(taskRecord.task.params)).to.eql({ + alertId: response.body.id, + spaceId: 'default', + }); + }); + }); +} diff --git a/x-pack/test/api_integration/apis/ml/modules/recognize_module.ts b/x-pack/test/api_integration/apis/ml/modules/recognize_module.ts index 00b820a025c8b7..2a7266e50d2c7a 100644 --- a/x-pack/test/api_integration/apis/ml/modules/recognize_module.ts +++ b/x-pack/test/api_integration/apis/ml/modules/recognize_module.ts @@ -202,6 +202,16 @@ export default ({ getService }: FtrProviderContext) => { moduleIds: ['nginx_data_stream'], }, }, + { + testTitleSuffix: 'for apm transaction dataset', + sourceDataArchive: 'x-pack/test/functional/es_archives/ml/module_apm_transaction', + indexPattern: 'ft_module_apm_transaction', + user: USER.ML_POWERUSER, + expected: { + responseCode: 200, + moduleIds: ['apm_transaction'], + }, + }, ]; async function executeRecognizeModuleRequest(indexPattern: string, user: USER, rspCode: number) { diff --git a/x-pack/test/api_integration/apis/ml/modules/setup_module.ts b/x-pack/test/api_integration/apis/ml/modules/setup_module.ts index 07a02911c67787..7c9c2ff185ea89 100644 --- a/x-pack/test/api_integration/apis/ml/modules/setup_module.ts +++ b/x-pack/test/api_integration/apis/ml/modules/setup_module.ts @@ -187,20 +187,18 @@ export default ({ getService }: FtrProviderContext) => { dashboards: [] as string[], }, }, - // Set startDatafeed and estimateModelMemory to false for the APM transaction test - // until there is a new data set available with metric data. { testTitleSuffix: - 'for apm_transaction with prefix, startDatafeed false and estimateModelMemory false', - sourceDataArchive: 'x-pack/test/functional/es_archives/ml/module_apm', - indexPattern: { name: 'ft_module_apm', timeField: '@timestamp' }, + 'for apm_transaction with prefix, startDatafeed true and estimateModelMemory true', + sourceDataArchive: 'x-pack/test/functional/es_archives/ml/module_apm_transaction', + indexPattern: { name: 'ft_module_apm_transaction', timeField: '@timestamp' }, module: 'apm_transaction', user: USER.ML_POWERUSER, requestBody: { prefix: 'pf5_', - indexPatternName: 'ft_module_apm', - startDatafeed: false, - estimateModelMemory: false, + indexPatternName: 'ft_module_apm_transaction', + startDatafeed: true, + end: Date.now(), }, expected: { responseCode: 200, diff --git a/x-pack/test/fleet_api_integration/apis/epm/setup.ts b/x-pack/test/fleet_api_integration/apis/epm/setup.ts index ce967160f33e14..0b669c96bb0ea0 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/setup.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/setup.ts @@ -24,8 +24,10 @@ export default function (providerContext: FtrProviderContext) { describe('setup performs upgrades', async () => { const oldEndpointVersion = '0.13.0'; beforeEach(async () => { + const url = '/api/fleet/epm/packages/endpoint'; + await supertest.delete(url).set('kbn-xsrf', 'xxxx').send({ force: true }).expect(200); await supertest - .post(`/api/fleet/epm/packages/endpoint-${oldEndpointVersion}`) + .post(`${url}-${oldEndpointVersion}`) .set('kbn-xsrf', 'xxxx') .send({ force: true }) .expect(200); diff --git a/x-pack/test/fleet_api_integration/apis/package_policy/create.ts b/x-pack/test/fleet_api_integration/apis/package_policy/create.ts index 6817289d389f35..d568e7224fd200 100644 --- a/x-pack/test/fleet_api_integration/apis/package_policy/create.ts +++ b/x-pack/test/fleet_api_integration/apis/package_policy/create.ts @@ -199,7 +199,8 @@ export default function (providerContext: FtrProviderContext) { .expect(400); }); - it('should not allow multiple limited packages on the same agent policy', async function () { + // https://github.com/elastic/kibana/issues/118257 + it.skip('should not allow multiple limited packages on the same agent policy', async function () { await supertest .post(`/api/fleet/package_policies`) .set('kbn-xsrf', 'xxxx') diff --git a/x-pack/test/fleet_api_integration/config.ts b/x-pack/test/fleet_api_integration/config.ts index d2b61a3f5c3214..308c4ab66f15c1 100644 --- a/x-pack/test/fleet_api_integration/config.ts +++ b/x-pack/test/fleet_api_integration/config.ts @@ -15,7 +15,7 @@ import { defineDockerServersConfig } from '@kbn/test'; // example: https://beats-ci.elastic.co/blue/organizations/jenkins/Ingest-manager%2Fpackage-storage/detail/snapshot/74/pipeline/257#step-302-log-1. // It should be updated any time there is a new Docker image published for the Snapshot Distribution of the Package Registry. export const dockerImage = - 'docker.elastic.co/package-registry/distribution@sha256:42dbdbb7fbc7ea61d0c38c0df6dad977ca2ad9cf01e247543054377aef33d377'; + 'docker.elastic.co/package-registry/distribution@sha256:13d9996dd24161624784704e080f5f5b7f0ef34ff0d9259f8f05010ccae00058'; export default async function ({ readConfigFile }: FtrConfigProviderContext) { const xPackAPITestsConfig = await readConfigFile(require.resolve('../api_integration/config.ts')); diff --git a/x-pack/test/functional/apps/infra/home_page.ts b/x-pack/test/functional/apps/infra/home_page.ts index c0bcee5f78966b..ff27b5fe4e370c 100644 --- a/x-pack/test/functional/apps/infra/home_page.ts +++ b/x-pack/test/functional/apps/infra/home_page.ts @@ -5,6 +5,7 @@ * 2.0. */ +import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; import { DATES } from './constants'; @@ -44,15 +45,86 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await esArchiver.unload('x-pack/test/functional/es_archives/infra/metrics_and_logs') ); + it('renders an empty data prompt for dates with no data', async () => { + await pageObjects.infraHome.goToTime(DATE_WITHOUT_DATA); + await pageObjects.infraHome.getNoMetricsDataPrompt(); + }); + it('renders the waffle map and tooltips for dates with data', async () => { await pageObjects.infraHome.goToTime(DATE_WITH_DATA); await pageObjects.infraHome.getWaffleMap(); await pageObjects.infraHome.getWaffleMapTooltips(); }); - it('renders an empty data prompt for dates with no data', async () => { - await pageObjects.infraHome.goToTime(DATE_WITHOUT_DATA); - await pageObjects.infraHome.getNoMetricsDataPrompt(); + it('sort nodes by descending value', async () => { + await pageObjects.infraHome.goToTime(DATE_WITH_DATA); + await pageObjects.infraHome.getWaffleMap(); + await pageObjects.infraHome.sortNodesBy('value'); + const nodesWithValue = await pageObjects.infraHome.getNodesWithValues(); + expect(nodesWithValue).to.eql([ + { name: 'demo-stack-apache-01', value: 1.4, color: '#6092c0' }, + { name: 'demo-stack-mysql-01', value: 1.2, color: '#82a7cd' }, + { name: 'demo-stack-nginx-01', value: 1.1, color: '#93b1d3' }, + { name: 'demo-stack-redis-01', value: 1, color: '#a2bcd9' }, + { name: 'demo-stack-haproxy-01', value: 0.8, color: '#c2d2e6' }, + { name: 'demo-stack-client-01', value: 0.6, color: '#f0f4f9' }, + ]); + }); + + it('sort nodes by ascending value', async () => { + await pageObjects.infraHome.goToTime(DATE_WITH_DATA); + await pageObjects.infraHome.getWaffleMap(); + await pageObjects.infraHome.sortNodesBy('value'); + await pageObjects.infraHome.toggleReverseSort(); + const nodesWithValue = await pageObjects.infraHome.getNodesWithValues(); + expect(nodesWithValue).to.eql([ + { name: 'demo-stack-client-01', value: 0.6, color: '#f0f4f9' }, + { name: 'demo-stack-haproxy-01', value: 0.8, color: '#c2d2e6' }, + { name: 'demo-stack-redis-01', value: 1, color: '#a2bcd9' }, + { name: 'demo-stack-nginx-01', value: 1.1, color: '#93b1d3' }, + { name: 'demo-stack-mysql-01', value: 1.2, color: '#82a7cd' }, + { name: 'demo-stack-apache-01', value: 1.4, color: '#6092c0' }, + ]); + }); + + it('group nodes by custom field', async () => { + await pageObjects.infraHome.goToTime(DATE_WITH_DATA); + await pageObjects.infraHome.getWaffleMap(); + const groups = await pageObjects.infraHome.groupByCustomField('host.os.platform'); + expect(groups).to.eql(['ubuntu']); + }); + + it('filter nodes by search term', async () => { + await pageObjects.infraHome.goToTime(DATE_WITH_DATA); + await pageObjects.infraHome.getWaffleMap(); + await pageObjects.infraHome.enterSearchTerm('host.name: "demo-stack-apache-01"'); + const nodesWithValue = await pageObjects.infraHome.getNodesWithValues(); + expect(nodesWithValue).to.eql([ + { name: 'demo-stack-apache-01', value: 1.4, color: '#6092c0' }, + ]); + await pageObjects.infraHome.clearSearchTerm(); + }); + + it('change color palette', async () => { + await pageObjects.infraHome.openLegendControls(); + await pageObjects.infraHome.changePalette('temperature'); + await pageObjects.infraHome.applyLegendControls(); + const nodesWithValue = await pageObjects.infraHome.getNodesWithValues(); + expect(nodesWithValue).to.eql([ + { name: 'demo-stack-client-01', value: 0.6, color: '#6092c0' }, + { name: 'demo-stack-haproxy-01', value: 0.8, color: '#b5c9df' }, + { name: 'demo-stack-redis-01', value: 1, color: '#f1d9b9' }, + { name: 'demo-stack-nginx-01', value: 1.1, color: '#eec096' }, + { name: 'demo-stack-mysql-01', value: 1.2, color: '#eba47a' }, + { name: 'demo-stack-apache-01', value: 1.4, color: '#e7664c' }, + ]); + }); + + it('toggle the timeline', async () => { + await pageObjects.infraHome.goToTime(DATE_WITH_DATA); + await pageObjects.infraHome.getWaffleMap(); + await pageObjects.infraHome.openTimeline(); + await pageObjects.infraHome.closeTimeline(); }); }); diff --git a/x-pack/test/functional/apps/lens/index.ts b/x-pack/test/functional/apps/lens/index.ts index 79f9b8f645c1a6..26fb100adf133d 100644 --- a/x-pack/test/functional/apps/lens/index.ts +++ b/x-pack/test/functional/apps/lens/index.ts @@ -70,6 +70,7 @@ export default function ({ getService, loadTestFile, getPageObjects }: FtrProvid this.tags(['ciGroup16', 'skipFirefox']); loadTestFile(require.resolve('./add_to_dashboard')); + loadTestFile(require.resolve('./table_dashboard')); loadTestFile(require.resolve('./table')); loadTestFile(require.resolve('./runtime_fields')); loadTestFile(require.resolve('./dashboard')); diff --git a/x-pack/test/functional/apps/lens/table_dashboard.ts b/x-pack/test/functional/apps/lens/table_dashboard.ts new file mode 100644 index 00000000000000..6e76d816fa6a6a --- /dev/null +++ b/x-pack/test/functional/apps/lens/table_dashboard.ts @@ -0,0 +1,55 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../ftr_provider_context'; + +export default function ({ getService, getPageObjects }: FtrProviderContext) { + const PageObjects = getPageObjects(['lens', 'visualize', 'dashboard']); + const listingTable = getService('listingTable'); + const retry = getService('retry'); + + const checkTableSorting = async () => { + // Sort by number + await PageObjects.lens.changeTableSortingBy(2, 'ascending'); + await PageObjects.lens.waitForVisualization(); + expect(await PageObjects.lens.getDatatableCellText(0, 2)).to.eql('17,246'); + // Now sort by IP + await PageObjects.lens.changeTableSortingBy(0, 'ascending'); + await PageObjects.lens.waitForVisualization(); + expect(await PageObjects.lens.getDatatableCellText(0, 0)).to.eql('78.83.247.30'); + // Change the sorting + await PageObjects.lens.changeTableSortingBy(0, 'descending'); + await PageObjects.lens.waitForVisualization(); + expect(await PageObjects.lens.getDatatableCellText(0, 0)).to.eql('169.228.188.120'); + // Remove the sorting + await retry.try(async () => { + await PageObjects.lens.changeTableSortingBy(0, 'none'); + await PageObjects.lens.waitForVisualization(); + expect(await PageObjects.lens.isDatatableHeaderSorted(0)).to.eql(false); + }); + }; + + describe('lens table on dashboard', () => { + it('should sort a table by column in dashboard edit mode', async () => { + await PageObjects.visualize.gotoVisualizationLandingPage(); + await listingTable.searchForItemWithName('lnsXYvis'); + await PageObjects.lens.clickVisualizeListItemTitle('lnsXYvis'); + await PageObjects.lens.goToTimeRange(); + await PageObjects.lens.switchToVisualization('lnsDatatable'); + await PageObjects.lens.save('New Table', true, false, false, 'new'); + + await checkTableSorting(); + }); + + it('should sort a table by column in dashboard view mode', async () => { + await PageObjects.dashboard.saveDashboard('Dashboard with a Lens Table'); + + await checkTableSorting(); + }); + }); +} diff --git a/x-pack/test/functional/apps/ml/anomaly_detection/single_metric_job.ts b/x-pack/test/functional/apps/ml/anomaly_detection/single_metric_job.ts index 97b340c0819580..3c3d27ebd5244f 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection/single_metric_job.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection/single_metric_job.ts @@ -10,6 +10,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const ml = getService('ml'); + const browser = getService('browser'); const jobId = `fq_single_1_${Date.now()}`; const jobIdClone = `${jobId}_clone`; @@ -201,7 +202,26 @@ export default function ({ getService }: FtrProviderContext) { await ml.api.assertDetectorResultsExist(jobId, 0); }); + it('job cloning fails in the single metric wizard if a matching data view does not exist', async () => { + await ml.testExecution.logTestStep('delete data view used by job'); + await ml.testResources.deleteIndexPatternByTitle('ft_farequote'); + + // Refresh page to ensure page has correct cache of data views + await browser.refresh(); + + await ml.testExecution.logTestStep( + 'job cloning clicks the clone action and displays an error toast' + ); + await ml.jobTable.clickCloneJobActionWhenNoDataViewExists(jobId); + }); + it('job cloning opens the existing job in the single metric wizard', async () => { + await ml.testExecution.logTestStep('recreate data view used by job'); + await ml.testResources.createIndexPatternIfNeeded('ft_farequote', '@timestamp'); + + // Refresh page to ensure page has correct cache of data views + await browser.refresh(); + await ml.testExecution.logTestStep( 'job cloning clicks the clone action and loads the single metric wizard' ); diff --git a/x-pack/test/functional/apps/ml/data_visualizer/index_data_visualizer_grid_in_dashboard.ts b/x-pack/test/functional/apps/ml/data_visualizer/index_data_visualizer_grid_in_dashboard.ts index 97c6c06bc32251..5684c2acd5bace 100644 --- a/x-pack/test/functional/apps/ml/data_visualizer/index_data_visualizer_grid_in_dashboard.ts +++ b/x-pack/test/functional/apps/ml/data_visualizer/index_data_visualizer_grid_in_dashboard.ts @@ -12,7 +12,14 @@ import { farequoteLuceneFiltersSearchTestData } from './index_test_data'; const SHOW_FIELD_STATISTICS = 'discover:showFieldStatistics'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const esArchiver = getService('esArchiver'); - const PageObjects = getPageObjects(['common', 'discover', 'timePicker', 'settings', 'dashboard']); + const PageObjects = getPageObjects([ + 'common', + 'discover', + 'timePicker', + 'settings', + 'dashboard', + 'header', + ]); const ml = getService('ml'); const retry = getService('retry'); const dashboardAddPanel = getService('dashboardAddPanel'); @@ -55,10 +62,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.clickNewDashboard(); await dashboardAddPanel.addSavedSearch(savedSearchTitle); - await PageObjects.dashboard.waitForRenderComplete(); + await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.timePicker.setAbsoluteRange(startTime, endTime); - await PageObjects.dashboard.waitForRenderComplete(); + await PageObjects.header.waitUntilLoadingHasFinished(); for (const fieldRow of testData.expected.metricFields as Array< Required @@ -91,13 +98,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.common.navigateToApp('dashboard'); await PageObjects.dashboard.gotoDashboardEditMode(dashboardTitle); - await PageObjects.dashboard.waitForRenderComplete(); + await PageObjects.header.waitUntilLoadingHasFinished(); await dashboardAddPanel.addSavedSearch(savedSearchTitle); - await PageObjects.dashboard.waitForRenderComplete(); + await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.timePicker.setAbsoluteRange(startTime, endTime); - await PageObjects.dashboard.waitForRenderComplete(); + await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.discover.assertFieldStatsTableNotExists(); await PageObjects.dashboard.saveDashboard(dashboardTitle); diff --git a/x-pack/test/functional/es_archives/ml/module_apm_transaction/data.json.gz b/x-pack/test/functional/es_archives/ml/module_apm_transaction/data.json.gz new file mode 100644 index 00000000000000..56c3e0ebc5e17c Binary files /dev/null and b/x-pack/test/functional/es_archives/ml/module_apm_transaction/data.json.gz differ diff --git a/x-pack/test/functional/es_archives/ml/module_apm_transaction/mappings.json b/x-pack/test/functional/es_archives/ml/module_apm_transaction/mappings.json new file mode 100644 index 00000000000000..92c1fcdb3ed4ad --- /dev/null +++ b/x-pack/test/functional/es_archives/ml/module_apm_transaction/mappings.json @@ -0,0 +1,501 @@ +{ + "type": "index", + "value": { + "aliases": { + }, + "index": "ft_module_apm_transaction", + "mappings": { + "properties": { + "@timestamp": { + "type": "date" + }, + "agent": { + "properties": { + "name": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "ecs": { + "properties": { + "version": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "event": { + "properties": { + "action": { + "ignore_above": 1024, + "type": "keyword" + }, + "category": { + "ignore_above": 1024, + "type": "keyword" + }, + "code": { + "ignore_above": 1024, + "type": "keyword" + }, + "created": { + "type": "date" + }, + "dataset": { + "ignore_above": 1024, + "type": "keyword" + }, + "duration": { + "type": "long" + }, + "end": { + "type": "date" + }, + "hash": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "ingested": { + "type": "date" + }, + "kind": { + "ignore_above": 1024, + "type": "keyword" + }, + "module": { + "ignore_above": 1024, + "type": "keyword" + }, + "original": { + "ignore_above": 1024, + "index": false, + "type": "keyword" + }, + "outcome": { + "ignore_above": 1024, + "type": "keyword" + }, + "provider": { + "ignore_above": 1024, + "type": "keyword" + }, + "reason": { + "ignore_above": 1024, + "type": "keyword" + }, + "reference": { + "ignore_above": 1024, + "type": "keyword" + }, + "risk_score": { + "type": "float" + }, + "risk_score_norm": { + "type": "float" + }, + "sequence": { + "type": "long" + }, + "severity": { + "type": "long" + }, + "start": { + "type": "date" + }, + "timezone": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "url": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "host": { + "properties": { + "hostname": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "name": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "metricset": { + "properties": { + "name": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "observer": { + "properties": { + "ephemeral_id": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "hostname": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "id": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "name": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "type": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "version": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "version_major": { + "type": "long" + } + } + }, + "processor": { + "properties": { + "event": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "name": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "service": { + "dynamic": "false", + "properties": { + "environment": { + "ignore_above": 1024, + "type": "keyword" + }, + "ephemeral_id": { + "ignore_above": 1024, + "type": "keyword" + }, + "framework": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "language": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "node": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "runtime": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "state": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "timeseries": { + "properties": { + "instance": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "transaction": { + "properties": { + "breakdown": { + "properties": { + "count": { + "type": "long" + } + } + }, + "duration": { + "properties": { + "count": { + "type": "long" + }, + "histogram": { + "type": "histogram" + }, + "sum": { + "properties": { + "us": { + "meta": { + "unit": "micros" + }, + "type": "long" + } + } + }, + "us": { + "type": "long" + } + } + }, + "experience": { + "properties": { + "cls": { + "scaling_factor": 1000000, + "type": "scaled_float" + }, + "fid": { + "scaling_factor": 1000000, + "type": "scaled_float" + }, + "longtask": { + "properties": { + "count": { + "type": "long" + }, + "max": { + "scaling_factor": 1000000, + "type": "scaled_float" + }, + "sum": { + "scaling_factor": 1000000, + "type": "scaled_float" + } + } + }, + "tbt": { + "scaling_factor": 1000000, + "type": "scaled_float" + } + } + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "marks": { + "dynamic": "true", + "properties": { + "*": { + "properties": { + "*": { + "dynamic": "true", + "type": "object" + } + } + } + } + }, + "message": { + "dynamic": "false", + "properties": { + "age": { + "properties": { + "ms": { + "type": "long" + } + } + }, + "queue": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "name": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "result": { + "ignore_above": 1024, + "type": "keyword" + }, + "root": { + "type": "boolean" + }, + "sampled": { + "type": "boolean" + }, + "self_time": { + "properties": { + "count": { + "type": "long" + }, + "sum": { + "properties": { + "us": { + "meta": { + "unit": "micros" + }, + "type": "long" + } + } + } + } + }, + "span_count": { + "properties": { + "dropped": { + "type": "long" + } + } + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "settings": { + "index": { + "number_of_replicas": "1", + "number_of_shards": "1" + } + } + } +} \ No newline at end of file diff --git a/x-pack/test/functional/es_archives/rules_scheduled_task_id/data.json b/x-pack/test/functional/es_archives/rules_scheduled_task_id/data.json new file mode 100644 index 00000000000000..159380a281de5a --- /dev/null +++ b/x-pack/test/functional/es_archives/rules_scheduled_task_id/data.json @@ -0,0 +1,74 @@ +{ + "type": "doc", + "value": { + "id": "alert:74f3e6d7-b7bb-477d-ac28-92ee22728e6e", + "index": ".kibana_1", + "source": { + "alert": { + "actions": [ + ], + "alertTypeId": "example.always-firing", + "apiKey": "QIUT8u0/kbOakEHSj50jDpVR90MrqOxanEscboYOoa8PxQvcA5jfHash+fqH3b+KNjJ1LpnBcisGuPkufY9j1e32gKzwGZV5Bfys87imHvygJvIM8uKiFF8bQ8Y4NTaxOJO9fAmZPrFy07ZcQMCAQz+DUTgBFqs=", + "apiKeyOwner": "elastic", + "consumer": "alerts", + "createdAt": "2020-06-17T15:35:38.497Z", + "createdBy": "elastic", + "enabled": true, + "muteAll": false, + "mutedInstanceIds": [ + ], + "name": "always-firing-alert", + "params": { + }, + "schedule": { + "interval": "1m" + }, + "scheduledTaskId": "329798f0-b0b0-11ea-9510-fdf248d5f2a4", + "tags": [ + ], + "throttle": null, + "updatedBy": "elastic" + }, + "migrationVersion": { + "alert": "7.16.0" + }, + "references": [ + ], + "type": "alert", + "updated_at": "2020-06-17T15:35:39.839Z" + } + } +} + +{ + "type": "doc", + "value": { + "id": "task:329798f0-b0b0-11ea-9510-fdf248d5f2a4", + "index": ".kibana_task_manager_1", + "source": { + "migrationVersion": { + "task": "7.16.0" + }, + "task": { + "attempts": 0, + "ownerId": null, + "params": "{\"alertId\":\"74f3e6d7-b7bb-477d-ac28-92ee22728e6e\",\"spaceId\":\"default\"}", + "retryAt": null, + "runAt": "2021-11-05T16:21:52.148Z", + "schedule": { + "interval": "1m" + }, + "scheduledAt": "2021-11-05T15:28:42.055Z", + "scope": [ + "alerting" + ], + "startedAt": null, + "status": "idle", + "taskType": "alerting:example.always-firing" + }, + "references": [], + "type": "task", + "updated_at": "2021-11-05T16:21:37.629Z" + } + } +} \ No newline at end of file diff --git a/x-pack/test/functional/es_archives/rules_scheduled_task_id/mappings.json b/x-pack/test/functional/es_archives/rules_scheduled_task_id/mappings.json new file mode 100644 index 00000000000000..45adfd491a09b6 --- /dev/null +++ b/x-pack/test/functional/es_archives/rules_scheduled_task_id/mappings.json @@ -0,0 +1,460 @@ +{ + "type": "index", + "value": { + "aliases": { + ".kibana": { + } + }, + "index": ".kibana_1", + "mappings": { + "_meta": { + "migrationMappingPropertyHashes": { + "action": "6e96ac5e648f57523879661ea72525b7", + "action_task_params": "a9d49f184ee89641044be0ca2950fa3a", + "alert": "7b44fba6773e37c806ce290ea9b7024e", + "apm-indices": "9bb9b2bf1fa636ed8619cbab5ce6a1dd", + "apm-telemetry": "3525d7c22c42bc80f5e6e9cb3f2b26a2", + "application_usage_totals": "c897e4310c5f24b07caaff3db53ae2c1", + "application_usage_transactional": "965839e75f809fefe04f92dc4d99722a", + "canvas-element": "7390014e1091044523666d97247392fc", + "canvas-workpad": "b0a1706d356228dbdcb4a17e6b9eb231", + "cases": "32aa96a6d3855ddda53010ae2048ac22", + "cases-comments": "c2061fb929f585df57425102fa928b4b", + "cases-configure": "42711cbb311976c0687853f4c1354572", + "cases-user-actions": "32277330ec6b721abe3b846cfd939a71", + "config": "ae24d22d5986d04124cc6568f771066f", + "dashboard": "d00f614b29a80360e1190193fd333bab", + "file-upload-telemetry": "0ed4d3e1983d1217a30982630897092e", + "graph-workspace": "cd7ba1330e6682e9cc00b78850874be1", + "index-pattern": "66eccb05066c5a89924f48a9e9736499", + "infrastructure-ui-source": "ddc0ecb18383f6b26101a2fadb2dab0c", + "inventory-view": "88fc7e12fd1b45b6f0787323ce4f18d2", + "kql-telemetry": "d12a98a6f19a2d273696597547e064ee", + "lens": "d33c68a69ff1e78c9888dedd2164ac22", + "lens-ui-telemetry": "509bfa5978586998e05f9e303c07a327", + "map": "23d7aa4a720d4938ccde3983f87bd58d", + "maps-telemetry": "bfd39d88aadadb4be597ea984d433dbe", + "metrics-explorer-view": "428e319af3e822c80a84cf87123ca35c", + "migrationVersion": "4a1746014a75ade3a714e1db5763276f", + "ml-telemetry": "257fd1d4b4fdbb9cb4b8a3b27da201e9", + "namespace": "2f4316de49999235636386fe51dc06c1", + "namespaces": "2f4316de49999235636386fe51dc06c1", + "query": "11aaeb7f5f7fa5bb43f25e18ce26e7d9", + "references": "7997cf5a56cc02bdc9c93361bde732b0", + "sample-data-telemetry": "7d3cfeb915303c9641c59681967ffeb4", + "search": "181661168bbadd1eff5902361e2a0d5c", + "space": "c5ca8acafa0beaa4d08d014a97b6bc6b", + "telemetry": "36a616f7026dfa617d6655df850fe16d", + "todo": "082a2cc96a590268344d5cd74c159ac4", + "tsvb-validation-telemetry": "3a37ef6c8700ae6fc97d5c7da00e9215", + "type": "2f4316de49999235636386fe51dc06c1", + "ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3", + "updated_at": "00da57df13e94e9d98437d13ace4bfe0", + "upgrade-assistant-reindex-operation": "296a89039fc4260292be36b1b005d8f2", + "upgrade-assistant-telemetry": "56702cec857e0a9dacfb696655b4ff7b", + "uptime-dynamic-settings": "fcdb453a30092f022f2642db29523d80", + "url": "b675c3be8d76ecf029294d51dc7ec65d", + "visualization": "52d7a13ad68a150c4525b292d23e12cc" + } + }, + "dynamic": "strict", + "properties": { + "action": { + "properties": { + "actionTypeId": { + "type": "keyword" + }, + "config": { + "enabled": false, + "type": "object" + }, + "name": { + "fields": { + "keyword": { + "type": "keyword" + } + }, + "type": "text" + }, + "secrets": { + "type": "binary" + } + } + }, + "action_task_params": { + "properties": { + "actionId": { + "type": "keyword" + }, + "apiKey": { + "type": "binary" + }, + "params": { + "enabled": false, + "type": "object" + } + } + }, + "alert": { + "properties": { + "actions": { + "properties": { + "actionRef": { + "type": "keyword" + }, + "actionTypeId": { + "type": "keyword" + }, + "group": { + "type": "keyword" + }, + "params": { + "enabled": false, + "type": "object" + } + }, + "type": "nested" + }, + "alertTypeId": { + "type": "keyword" + }, + "apiKey": { + "type": "binary" + }, + "apiKeyOwner": { + "type": "keyword" + }, + "consumer": { + "type": "keyword" + }, + "createdAt": { + "type": "date" + }, + "createdBy": { + "type": "keyword" + }, + "enabled": { + "type": "boolean" + }, + "muteAll": { + "type": "boolean" + }, + "mutedInstanceIds": { + "type": "keyword" + }, + "name": { + "fields": { + "keyword": { + "type": "keyword" + } + }, + "type": "text" + }, + "params": { + "enabled": false, + "type": "object" + }, + "schedule": { + "properties": { + "interval": { + "type": "keyword" + } + } + }, + "scheduledTaskId": { + "type": "keyword" + }, + "tags": { + "type": "keyword" + }, + "throttle": { + "type": "keyword" + }, + "updatedBy": { + "type": "keyword" + } + } + }, + "config": { + "dynamic": "true", + "properties": { + "buildNum": { + "type": "keyword" + } + } + }, + "migrationVersion": { + "dynamic": "true", + "properties": { + "alert": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "config": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "space": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "namespace": { + "type": "keyword" + }, + "namespaces": { + "type": "keyword" + }, + "query": { + "properties": { + "description": { + "type": "text" + }, + "filters": { + "enabled": false, + "type": "object" + }, + "query": { + "properties": { + "language": { + "type": "keyword" + }, + "query": { + "index": false, + "type": "keyword" + } + } + }, + "timefilter": { + "enabled": false, + "type": "object" + }, + "title": { + "type": "text" + } + } + }, + "references": { + "properties": { + "id": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "type": { + "type": "keyword" + } + }, + "type": "nested" + }, + "search": { + "properties": { + "columns": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" + } + } + }, + "sort": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" + } + } + }, + "space": { + "properties": { + "_reserved": { + "type": "boolean" + }, + "color": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "disabledFeatures": { + "type": "keyword" + }, + "imageUrl": { + "index": false, + "type": "text" + }, + "initials": { + "type": "keyword" + }, + "name": { + "fields": { + "keyword": { + "ignore_above": 2048, + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "type": { + "type": "keyword" + }, + "updated_at": { + "type": "date" + } + } + }, + "settings": { + "index": { + "auto_expand_replicas": "0-1", + "number_of_replicas": "1", + "number_of_shards": "1" + } + } + } +} + +{ + "type": "index", + "value": { + "aliases": { + ".kibana_task_manager": { + } + }, + "index": ".kibana_task_manager_1", + "mappings": { + "_meta": { + "migrationMappingPropertyHashes": { + "migrationVersion": "4a1746014a75ade3a714e1db5763276f", + "namespace": "2f4316de49999235636386fe51dc06c1", + "namespaces": "2f4316de49999235636386fe51dc06c1", + "originId": "2f4316de49999235636386fe51dc06c1", + "references": "7997cf5a56cc02bdc9c93361bde732b0", + "task": "235412e52d09e7165fac8a67a43ad6b4", + "type": "2f4316de49999235636386fe51dc06c1", + "updated_at": "00da57df13e94e9d98437d13ace4bfe0" + } + }, + "dynamic": "strict", + "properties": { + "migrationVersion": { + "dynamic": "true", + "properties": { + "task": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "references": { + "properties": { + "id": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "type": { + "type": "keyword" + } + }, + "type": "nested" + }, + "task": { + "properties": { + "attempts": { + "type": "integer" + }, + "ownerId": { + "type": "keyword" + }, + "params": { + "type": "text" + }, + "retryAt": { + "type": "date" + }, + "runAt": { + "type": "date" + }, + "schedule": { + "properties": { + "interval": { + "type": "keyword" + } + } + }, + "scheduledAt": { + "type": "date" + }, + "scope": { + "type": "keyword" + }, + "startedAt": { + "type": "date" + }, + "state": { + "type": "text" + }, + "status": { + "type": "keyword" + }, + "taskType": { + "type": "keyword" + }, + "user": { + "type": "keyword" + } + } + }, + "type": { + "type": "keyword" + }, + "updated_at": { + "type": "date" + } + } + }, + "settings": { + "index": { + "auto_expand_replicas": "0-1", + "number_of_replicas": "0", + "number_of_shards": "1" + } + } + } +} diff --git a/x-pack/test/functional/page_objects/infra_home_page.ts b/x-pack/test/functional/page_objects/infra_home_page.ts index 726668e3b1b0ac..2f2c1407fc0414 100644 --- a/x-pack/test/functional/page_objects/infra_home_page.ts +++ b/x-pack/test/functional/page_objects/infra_home_page.ts @@ -16,6 +16,7 @@ export function InfraHomePageProvider({ getService, getPageObjects }: FtrProvide const find = getService('find'); const browser = getService('browser'); const pageObjects = getPageObjects(['common']); + const comboBox = getService('comboBox'); return { async goToTime(time: string) { @@ -65,6 +66,85 @@ export function InfraHomePageProvider({ getService, getPageObjects }: FtrProvide expect(await values2[3].getVisibleText()).to.be('255.1kbit/s'); }, + async getNodesWithValues() { + const nodes = await testSubjects.findAll('nodeContainer'); + const promises = nodes.map(async (node) => { + const nodeName = await node.findByTestSubject('nodeName'); + const name = await nodeName.getVisibleText(); + const nodeValue = await node.findByTestSubject('nodeValue'); + const value = await nodeValue.getVisibleText(); + const color = await nodeValue.getAttribute('color'); + return { name, value: parseFloat(value), color }; + }); + return await Promise.all(promises); + }, + + async sortNodesBy(sort: string) { + await testSubjects.click('waffleSortByDropdown'); + if (sort === 'value') { + await testSubjects.find('waffleSortByValue'); + await testSubjects.click('waffleSortByValue'); + } else { + await testSubjects.find('waffleSortByName'); + await testSubjects.click('waffleSortByName'); + } + }, + + async groupByCustomField(field: string) { + await testSubjects.click('waffleGroupByDropdown'); + const contextMenu = await testSubjects.find('groupByContextMenu'); + const menuItems = await contextMenu.findAllByCssSelector('button.euiContextMenuItem'); + await menuItems[0].click(); + const groupByCustomField = await testSubjects.find('groupByCustomField'); + await comboBox.setElement(groupByCustomField, field); + await testSubjects.click('groupByCustomFieldAddButton'); + await this.waitForLoading(); + const groupNameLinks = await testSubjects.findAll('groupNameLink'); + return Promise.all(groupNameLinks.map(async (link) => link.getVisibleText())); + }, + + async enterSearchTerm(query: string) { + const input = await this.clearSearchTerm(); + await input.type([query, browser.keys.RETURN]); + await this.waitForLoading(); + }, + + async clearSearchTerm() { + const input = await testSubjects.find('infraSearchField'); + await input.clearValueWithKeyboard({ charByChar: true }); + return input; + }, + + async openLegendControls() { + await testSubjects.click('openLegendControlsButton'); + await testSubjects.find('legendControls'); + }, + + async changePalette(paletteId: string) { + await testSubjects.find('legendControlsPalette'); + await testSubjects.selectValue('legendControlsPalette', paletteId); + }, + + async applyLegendControls() { + await testSubjects.click('applyLegendControlsButton'); + }, + + async toggleReverseSort() { + await testSubjects.click('waffleSortByDropdown'); + await testSubjects.find('waffleSortByDirection'); + await testSubjects.click('waffleSortByDirection'); + }, + + async openTimeline() { + await testSubjects.click('toggleTimelineButton'); + await testSubjects.existOrFail('timelineContainerOpen'); + }, + + async closeTimeline() { + await testSubjects.click('toggleTimelineButton'); + await testSubjects.existOrFail('timelineContainerClosed'); + }, + async openInvenotrySwitcher() { await testSubjects.click('openInventorySwitcher'); return await testSubjects.find('goToHost'); diff --git a/x-pack/test/functional/page_objects/lens_page.ts b/x-pack/test/functional/page_objects/lens_page.ts index 247dc607c00386..710d11d3f75864 100644 --- a/x-pack/test/functional/page_objects/lens_page.ts +++ b/x-pack/test/functional/page_objects/lens_page.ts @@ -6,7 +6,7 @@ */ import expect from '@kbn/expect'; -import { delay } from 'bluebird'; +import { setTimeout as setTimeoutAsync } from 'timers/promises'; import { FtrProviderContext } from '../ftr_provider_context'; import { logWrapper } from './log_wrapper'; @@ -20,6 +20,8 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont const browser = getService('browser'); const dashboardAddPanel = getService('dashboardAddPanel'); + const FORMULA_TAB_HEIGHT = 40; + const PageObjects = getPageObjects([ 'common', 'header', @@ -131,7 +133,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont : `lns-indexPatternDimension-${opts.operation}`; await retry.try(async () => { await testSubjects.exists(operationSelector); - await testSubjects.click(operationSelector); + await testSubjects.click(operationSelector, undefined, FORMULA_TAB_HEIGHT); }); } if (opts.field) { @@ -1094,7 +1096,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont draggedOver, dropTarget ); - await delay(150); + await setTimeoutAsync(150); }, /** diff --git a/x-pack/test/functional/page_objects/rollup_page.ts b/x-pack/test/functional/page_objects/rollup_page.ts index 0740a8f015da18..28ad65f60a49b3 100644 --- a/x-pack/test/functional/page_objects/rollup_page.ts +++ b/x-pack/test/functional/page_objects/rollup_page.ts @@ -6,7 +6,6 @@ */ import expect from '@kbn/expect'; -import { map as mapAsync } from 'bluebird'; import { FtrService } from '../ftr_provider_context'; export class RollupPageObject extends FtrService { @@ -111,26 +110,32 @@ export class RollupPageObject extends FtrService { async getJobList() { const jobs = await this.testSubjects.findAll('jobTableRow'); - return mapAsync(jobs, async (job) => { - const jobNameElement = await job.findByTestSubject('jobTableCell-id'); - const jobStatusElement = await job.findByTestSubject('jobTableCell-status'); - const jobIndexPatternElement = await job.findByTestSubject('jobTableCell-indexPattern'); - const jobRollUpIndexPatternElement = await job.findByTestSubject('jobTableCell-rollupIndex'); - const jobDelayElement = await job.findByTestSubject('jobTableCell-rollupDelay'); - const jobIntervalElement = await job.findByTestSubject('jobTableCell-dateHistogramInterval'); - const jobGroupElement = await job.findByTestSubject('jobTableCell-groups'); - const jobMetricsElement = await job.findByTestSubject('jobTableCell-metrics'); - - return { - jobName: await jobNameElement.getVisibleText(), - jobStatus: await jobStatusElement.getVisibleText(), - jobIndexPattern: await jobIndexPatternElement.getVisibleText(), - jobRollUpIndexPattern: await jobRollUpIndexPatternElement.getVisibleText(), - jobDelayElement: await jobDelayElement.getVisibleText(), - jobInterval: await jobIntervalElement.getVisibleText(), - jobGroup: await jobGroupElement.getVisibleText(), - jobMetrics: await jobMetricsElement.getVisibleText(), - }; - }); + return await Promise.all( + jobs.map(async (job) => { + const jobNameElement = await job.findByTestSubject('jobTableCell-id'); + const jobStatusElement = await job.findByTestSubject('jobTableCell-status'); + const jobIndexPatternElement = await job.findByTestSubject('jobTableCell-indexPattern'); + const jobRollUpIndexPatternElement = await job.findByTestSubject( + 'jobTableCell-rollupIndex' + ); + const jobDelayElement = await job.findByTestSubject('jobTableCell-rollupDelay'); + const jobIntervalElement = await job.findByTestSubject( + 'jobTableCell-dateHistogramInterval' + ); + const jobGroupElement = await job.findByTestSubject('jobTableCell-groups'); + const jobMetricsElement = await job.findByTestSubject('jobTableCell-metrics'); + + return { + jobName: await jobNameElement.getVisibleText(), + jobStatus: await jobStatusElement.getVisibleText(), + jobIndexPattern: await jobIndexPatternElement.getVisibleText(), + jobRollUpIndexPattern: await jobRollUpIndexPatternElement.getVisibleText(), + jobDelayElement: await jobDelayElement.getVisibleText(), + jobInterval: await jobIntervalElement.getVisibleText(), + jobGroup: await jobGroupElement.getVisibleText(), + jobMetrics: await jobMetricsElement.getVisibleText(), + }; + }) + ); } } diff --git a/x-pack/test/functional/page_objects/watcher_page.ts b/x-pack/test/functional/page_objects/watcher_page.ts index 5aeaddffff581d..ad5153a933466d 100644 --- a/x-pack/test/functional/page_objects/watcher_page.ts +++ b/x-pack/test/functional/page_objects/watcher_page.ts @@ -5,7 +5,6 @@ * 2.0. */ -import { map as mapAsync } from 'bluebird'; import { FtrService } from '../ftr_provider_context'; export class WatcherPageObject extends FtrService { @@ -51,16 +50,18 @@ export class WatcherPageObject extends FtrService { // get all the watches in the list async getWatches() { const watches = await this.find.allByCssSelector('.euiTableRow'); - return mapAsync(watches, async (watch) => { - const checkBox = await watch.findByCssSelector('td:nth-child(1)'); - const id = await watch.findByCssSelector('td:nth-child(2)'); - const name = await watch.findByCssSelector('td:nth-child(3)'); + return await Promise.all( + watches.map(async (watch) => { + const checkBox = await watch.findByCssSelector('td:nth-child(1)'); + const id = await watch.findByCssSelector('td:nth-child(2)'); + const name = await watch.findByCssSelector('td:nth-child(3)'); - return { - checkBox: (await checkBox.getAttribute('innerHTML')).includes('input'), - id: await id.getVisibleText(), - name: (await name.getVisibleText()).split(',').map((role) => role.trim()), - }; - }); + return { + checkBox: (await checkBox.getAttribute('innerHTML')).includes('input'), + id: await id.getVisibleText(), + name: (await name.getVisibleText()).split(',').map((role) => role.trim()), + }; + }) + ); } } diff --git a/x-pack/test/functional/services/ace_editor.js b/x-pack/test/functional/services/ace_editor.js index 589f05695e0650..2b2adde74ecc72 100644 --- a/x-pack/test/functional/services/ace_editor.js +++ b/x-pack/test/functional/services/ace_editor.js @@ -5,8 +5,6 @@ * 2.0. */ -import { map as mapAsync } from 'bluebird'; - export function AceEditorProvider({ getService }) { const testSubjects = getService('testSubjects'); const find = getService('find'); @@ -35,7 +33,7 @@ export function AceEditorProvider({ getService }) { return await retry.try(async () => { const editor = await testSubjects.find(testSubjectSelector); const lines = await editor.findAllByClassName('ace_line'); - const linesText = await mapAsync(lines, (line) => line.getVisibleText()); + const linesText = await Promise.all(lines.map((line) => line.getVisibleText())); return linesText.join('\n'); }); } diff --git a/x-pack/test/functional/services/ml/data_frame_analytics_table.ts b/x-pack/test/functional/services/ml/data_frame_analytics_table.ts index 0bfb37c6c94f8d..18e3c4d898bd6a 100644 --- a/x-pack/test/functional/services/ml/data_frame_analytics_table.ts +++ b/x-pack/test/functional/services/ml/data_frame_analytics_table.ts @@ -163,9 +163,11 @@ export function MachineLearningDataFrameAnalyticsTableProvider({ getService }: F } public async openMapView(analyticsId: string) { - await this.assertJobRowMapButtonExists(analyticsId); - await testSubjects.click(this.rowSelector(analyticsId, 'mlAnalyticsJobMapButton')); - await testSubjects.existOrFail('mlPageDataFrameAnalyticsMap', { timeout: 20 * 1000 }); + await retry.tryForTime(20 * 1000, async () => { + await this.assertJobRowMapButtonExists(analyticsId); + await testSubjects.click(this.rowSelector(analyticsId, 'mlAnalyticsJobMapButton')); + await testSubjects.existOrFail('mlPageDataFrameAnalyticsMap', { timeout: 5 * 1000 }); + }); } public async assertAnalyticsSearchInputValue(expectedSearchValue: string) { diff --git a/x-pack/test/functional/services/ml/job_table.ts b/x-pack/test/functional/services/ml/job_table.ts index 67488d88aa120b..e2d50c52c55ba1 100644 --- a/x-pack/test/functional/services/ml/job_table.ts +++ b/x-pack/test/functional/services/ml/job_table.ts @@ -373,6 +373,16 @@ export function MachineLearningJobTableProvider( await testSubjects.existOrFail('~mlPageJobWizard'); } + public async clickCloneJobActionWhenNoDataViewExists(jobId: string) { + await this.ensureJobActionsMenuOpen(jobId); + await testSubjects.click('mlActionButtonCloneJob'); + await this.assertNoDataViewForCloneJobWarningToastExist(); + } + + public async assertNoDataViewForCloneJobWarningToastExist() { + await testSubjects.existOrFail('mlCloneJobNoDataViewExistsWarningToast', { timeout: 5000 }); + } + public async clickEditJobAction(jobId: string) { await this.ensureJobActionsMenuOpen(jobId); await testSubjects.click('mlActionButtonEditJob'); diff --git a/x-pack/test/functional/services/monitoring/cluster_alerts.js b/x-pack/test/functional/services/monitoring/cluster_alerts.js index cbeb537b08016d..4f70903bda1c26 100644 --- a/x-pack/test/functional/services/monitoring/cluster_alerts.js +++ b/x-pack/test/functional/services/monitoring/cluster_alerts.js @@ -6,7 +6,6 @@ */ import { range } from 'lodash'; -import { map as mapAsync } from 'bluebird'; export function MonitoringClusterAlertsProvider({ getService, getPageObjects }) { const testSubjects = getService('testSubjects'); @@ -61,9 +60,11 @@ export function MonitoringClusterAlertsProvider({ getService, getPageObjects }) const listingRows = await this.getOverviewAlerts(); const alertIcons = await retry.try(async () => { const elements = await find.allByCssSelector(SUBJ_OVERVIEW_ICONS); - return await mapAsync(elements, async (element) => { - return await element.getVisibleText(); - }); + return await Promise.all( + elements.map(async (element) => { + return await element.getVisibleText(); + }) + ); }); return await this._getAlertSetAll({ diff --git a/x-pack/test/functional/services/observability/alerts/bulk_actions.ts b/x-pack/test/functional/services/observability/alerts/bulk_actions.ts new file mode 100644 index 00000000000000..1fa411a2f4fbf9 --- /dev/null +++ b/x-pack/test/functional/services/observability/alerts/bulk_actions.ts @@ -0,0 +1,52 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { FtrProviderContext } from '../../../ftr_provider_context'; +const CHECKBOX_SELECTOR = 'select-event'; +const CHECKBOX_PRODUCER_SELECTOR = 'select-event-rule-producer'; +const BULK_ACTIONS_CONTAINER = 'bulk-actions-button-container'; +const SELECTED_BULK_ACTIONS_BUTTON = 'selectedShowBulkActionsButton'; + +export function ObservabilityAlertsBulkActionsProvider({ getService }: FtrProviderContext) { + const find = getService('find'); + const testSubjects = getService('testSubjects'); + + const getCheckboxSelector = async () => { + return await find.allByCssSelector(testSubjects.getCssSelector(`~${CHECKBOX_SELECTOR}`)); + }; + + const missingCheckboxSelectorOrFail = async () => { + return await testSubjects.missingOrFail(`~${CHECKBOX_SELECTOR}`); + }; + + const getCheckboxSelectorPerProducer = async (producer: string) => { + return await find.allByCssSelector( + testSubjects.getCssSelector(`~${CHECKBOX_PRODUCER_SELECTOR}-${producer}`) + ); + }; + + const getBulkActionsContainer = async () => { + return await testSubjects.find(BULK_ACTIONS_CONTAINER); + }; + + const getBulkActionsContainerOrFail = async () => { + return await testSubjects.existOrFail(BULK_ACTIONS_CONTAINER); + }; + + const getBulkActionsButton = async () => { + return await testSubjects.find(SELECTED_BULK_ACTIONS_BUTTON); + }; + + return { + getCheckboxSelector, + getCheckboxSelectorPerProducer, + missingCheckboxSelectorOrFail, + getBulkActionsContainer, + getBulkActionsContainerOrFail, + getBulkActionsButton, + }; +} diff --git a/x-pack/test/functional/services/observability/alerts/index.ts b/x-pack/test/functional/services/observability/alerts/index.ts index f2b5173dfe5b0d..b2873888565242 100644 --- a/x-pack/test/functional/services/observability/alerts/index.ts +++ b/x-pack/test/functional/services/observability/alerts/index.ts @@ -8,6 +8,7 @@ import { ObservabilityAlertsPaginationProvider } from './pagination'; import { ObservabilityAlertsCommonProvider } from './common'; import { ObservabilityAlertsAddToCaseProvider } from './add_to_case'; +import { ObservabilityAlertsBulkActionsProvider } from './bulk_actions'; import { FtrProviderContext } from '../../../ftr_provider_context'; @@ -15,9 +16,12 @@ export function ObservabilityAlertsProvider(context: FtrProviderContext) { const common = ObservabilityAlertsCommonProvider(context); const pagination = ObservabilityAlertsPaginationProvider(context); const addToCase = ObservabilityAlertsAddToCaseProvider(context); + const bulkActions = ObservabilityAlertsBulkActionsProvider(context); + return { common, pagination, addToCase, + bulkActions, }; } diff --git a/x-pack/test/functional/services/observability/users.ts b/x-pack/test/functional/services/observability/users.ts index 78e8b3346cc674..7cb98603548ba5 100644 --- a/x-pack/test/functional/services/observability/users.ts +++ b/x-pack/test/functional/services/observability/users.ts @@ -72,7 +72,20 @@ const defineBasicObservabilityRole = ( ...((features.infrastructure?.length ?? 0) > 0 ? [{ names: ['metricbeat-*', 'metrics-*'], privileges: ['all'] }] : []), - ...((features.apm?.length ?? 0) > 0 ? [{ names: ['apm-*'], privileges: ['all'] }] : []), + ...((features.apm?.length ?? 0) > 0 + ? [ + { + names: [ + 'apm-*', + 'logs-apm*', + 'metrics-apm*', + 'traces-apm*', + 'observability-annotations', + ], + privileges: ['read', 'view_index_metadata'], + }, + ] + : []), ...((features.uptime?.length ?? 0) > 0 ? [{ names: ['heartbeat-*,synthetics-*'], privileges: ['all'] }] : []), diff --git a/x-pack/test/functional/services/pipeline_editor.js b/x-pack/test/functional/services/pipeline_editor.js index ece7ec5b3ecbcc..bb1f122b988bde 100644 --- a/x-pack/test/functional/services/pipeline_editor.js +++ b/x-pack/test/functional/services/pipeline_editor.js @@ -6,7 +6,6 @@ */ import expect from '@kbn/expect'; -import { props as propsAsync } from 'bluebird'; export function PipelineEditorProvider({ getService }) { const retry = getService('retry'); @@ -125,20 +124,27 @@ export function PipelineEditorProvider({ getService }) { * @return {Promise} */ async assertInputs(expectedValues) { - const values = await propsAsync({ - id: testSubjects.getAttribute(SUBJ_INPUT_ID, 'value'), - description: testSubjects.getAttribute(SUBJ_INPUT_DESCRIPTION, 'value'), - pipeline: aceEditor.getValue(SUBJ_UI_ACE_PIPELINE), - workers: testSubjects.getAttribute(SUBJ_INPUT_WORKERS, 'value'), - batchSize: testSubjects.getAttribute(SUBJ_INPUT_BATCH_SIZE, 'value'), - queueType: testSubjects.getAttribute(SUBJ_SELECT_QUEUE_TYPE, 'value'), - queueMaxBytesNumber: testSubjects.getAttribute(SUBJ_INPUT_QUEUE_MAX_BYTES_NUMBER, 'value'), - queueMaxBytesUnits: testSubjects.getAttribute(SUBJ_SELECT_QUEUE_MAX_BYTES_UNITS, 'value'), - queueCheckpointWrites: testSubjects.getAttribute( - SUBJ_INPUT_QUEUE_CHECKPOINT_WRITES, - 'value' - ), - }); + const values = await Promise.all([ + testSubjects.getAttribute(SUBJ_INPUT_ID, 'value'), + testSubjects.getAttribute(SUBJ_INPUT_DESCRIPTION, 'value'), + aceEditor.getValue(SUBJ_UI_ACE_PIPELINE), + testSubjects.getAttribute(SUBJ_INPUT_WORKERS, 'value'), + testSubjects.getAttribute(SUBJ_INPUT_BATCH_SIZE, 'value'), + testSubjects.getAttribute(SUBJ_SELECT_QUEUE_TYPE, 'value'), + testSubjects.getAttribute(SUBJ_INPUT_QUEUE_MAX_BYTES_NUMBER, 'value'), + testSubjects.getAttribute(SUBJ_SELECT_QUEUE_MAX_BYTES_UNITS, 'value'), + testSubjects.getAttribute(SUBJ_INPUT_QUEUE_CHECKPOINT_WRITES, 'value'), + ]).then((values) => ({ + id: values[0], + description: values[1], + pipeline: values[2], + workers: values[3], + batchSize: values[4], + queueType: values[5], + queueMaxBytesNumber: values[6], + queueMaxBytesUnits: values[7], + queueCheckpointWrites: values[8], + })); expect(values).to.eql(expectedValues); } diff --git a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alert_create_flyout.ts b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alert_create_flyout.ts index 1140f9c17a9f71..b208826ec7aa44 100644 --- a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alert_create_flyout.ts +++ b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alert_create_flyout.ts @@ -296,7 +296,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { it('should show all rule types on click euiFormControlLayoutClearButton', async () => { await pageObjects.triggersActionsUI.clickCreateAlertButton(); await testSubjects.setValue('alertNameInput', 'alertName'); - const ruleTypeSearchBox = await find.byCssSelector('.alertSearchField'); + const ruleTypeSearchBox = await find.byCssSelector('[data-test-subj="alertSearchField"]'); await ruleTypeSearchBox.type('notexisting rule type'); await ruleTypeSearchBox.pressKeys(browser.keys.ENTER); diff --git a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts index eb4c0fbe425c40..04b9b1b45b6335 100644 --- a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts +++ b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts @@ -479,6 +479,13 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { expect(filterWithSlackOnlyResults[0].interval).to.equal('1 min'); expect(filterWithSlackOnlyResults[0].duration).to.match(/\d{2}:\d{2}:\d{2}.\d{3}/); }); + await testSubjects.click('alertTypeFilterButton'); + + // de-select action type filter + await testSubjects.click('actionTypeFilterButton'); + await testSubjects.click('actionType.slackFilterOption'); + + await testSubjects.missingOrFail('centerJustifiedSpinner'); }); }); }; diff --git a/x-pack/test/functional_with_es_ssl/apps/uptime/alert_flyout.ts b/x-pack/test/functional_with_es_ssl/apps/uptime/alert_flyout.ts index f08867b445f75f..d657db443e4ec7 100644 --- a/x-pack/test/functional_with_es_ssl/apps/uptime/alert_flyout.ts +++ b/x-pack/test/functional_with_es_ssl/apps/uptime/alert_flyout.ts @@ -6,7 +6,7 @@ */ import expect from '@kbn/expect'; -import { delay } from 'bluebird'; +import { setTimeout as setTimeoutAsync } from 'timers/promises'; import { FtrProviderContext } from '../../ftr_provider_context'; @@ -99,7 +99,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { let alert: any; await retry.tryForTime(60 * 1000, async () => { // add a delay before next call to not overload the server - await delay(1500); + await setTimeoutAsync(1500); const apiResponse = await supertest.get('/api/alerts/_find?search=uptime-test'); const alertsFromThisTest = apiResponse.body.data.filter( ({ name }: { name: string }) => name === 'uptime-test' diff --git a/x-pack/test/load/runner.ts b/x-pack/test/load/runner.ts index c48a8e33d6eef6..e9750bd19881a2 100644 --- a/x-pack/test/load/runner.ts +++ b/x-pack/test/load/runner.ts @@ -10,7 +10,7 @@ import { resolve } from 'path'; import { REPO_ROOT } from '@kbn/utils'; import Fs from 'fs'; import { createFlagError } from '@kbn/dev-utils'; -import { delay } from 'bluebird'; +import { setTimeout as setTimeoutAsync } from 'timers/promises'; import { FtrProviderContext } from './../functional/ftr_provider_context'; const baseSimulationPath = 'src/test/scala/org/kibanaLoadTest/simulation'; @@ -82,7 +82,7 @@ export async function GatlingTestRunner({ getService }: FtrProviderContext) { }); // wait a minute between simulations, skip for the last one if (i < simulationClasses.length - 1) { - await delay(60 * 1000); + await setTimeoutAsync(60 * 1000); } } }); diff --git a/x-pack/test/observability_functional/apps/observability/alerts/bulk_actions.ts b/x-pack/test/observability_functional/apps/observability/alerts/bulk_actions.ts new file mode 100644 index 00000000000000..749324a39ba207 --- /dev/null +++ b/x-pack/test/observability_functional/apps/observability/alerts/bulk_actions.ts @@ -0,0 +1,203 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../ftr_provider_context'; + +async function asyncForEach(array: T[], callback: (item: T, index: number) => void) { + for (let index = 0; index < array.length; index++) { + await callback(array[index], index); + } +} + +export default ({ getService, getPageObjects }: FtrProviderContext) => { + const esArchiver = getService('esArchiver'); + const observability = getService('observability'); + + const retry = getService('retry'); + + describe('Observability alerts / Bulk actions', function () { + this.tags('includeFirefox'); + before(async () => { + await esArchiver.load('x-pack/test/functional/es_archives/observability/alerts'); + await esArchiver.load('x-pack/test/functional/es_archives/infra/metrics_and_logs'); + await esArchiver.load( + 'x-pack/test/apm_api_integration/common/fixtures/es_archiver/apm_8.0.0' + ); + }); + + after(async () => { + await esArchiver.unload('x-pack/test/functional/es_archives/infra/metrics_and_logs'); + await esArchiver.unload('x-pack/test/functional/es_archives/observability/alerts'); + await esArchiver.unload( + 'x-pack/test/apm_api_integration/common/fixtures/es_archiver/apm_8.0.0' + ); + }); + + describe('When user has all priviledges for logs app', () => { + before(async () => { + await observability.users.setTestUserRole( + observability.users.defineBasicObservabilityRole({ + logs: ['all'], + }) + ); + await observability.alerts.common.navigateToTimeWithData(); + }); + + after(async () => { + await observability.users.restoreDefaultTestUserRole(); + }); + + it('logs checkboxes are enabled', async () => { + const logsCheckboxes = + await observability.alerts.bulkActions.getCheckboxSelectorPerProducer('logs'); + + await asyncForEach(logsCheckboxes, async (checkbox, index) => { + expect(await checkbox.isEnabled()).to.be(true); + }); + }); + + describe('when checkbox is clicked', async () => { + it('shows bulk actions container', async () => { + const logsCheckboxes = + await observability.alerts.bulkActions.getCheckboxSelectorPerProducer('logs'); + await logsCheckboxes[0].click(); + await observability.alerts.bulkActions.getBulkActionsContainerOrFail(); + }); + + describe('when selected bulk action button is clicked', async () => { + it('opens overflow menu with workflow status options', async () => { + await retry.try(async () => { + await (await observability.alerts.bulkActions.getBulkActionsButton()).click(); + }); + }); + }); + }); + }); + + describe('When user has all priviledges for apm app', () => { + before(async () => { + await observability.users.setTestUserRole( + observability.users.defineBasicObservabilityRole({ + apm: ['all'], + }) + ); + await observability.alerts.common.navigateToTimeWithData(); + }); + + after(async () => { + await observability.users.restoreDefaultTestUserRole(); + }); + + it('apm checkboxes are enabled', async () => { + const apmCheckboxes = await observability.alerts.bulkActions.getCheckboxSelectorPerProducer( + 'apm' + ); + + await asyncForEach(apmCheckboxes, async (checkbox, index) => { + expect(await checkbox.isEnabled()).to.be(true); + }); + }); + + describe('when checkbox is clicked', async () => { + it('shows bulk actions container', async () => { + const apmCheckboxes = + await observability.alerts.bulkActions.getCheckboxSelectorPerProducer('apm'); + await apmCheckboxes[0].click(); + await observability.alerts.bulkActions.getBulkActionsContainerOrFail(); + }); + + describe('when selected bulk action button is clicked', async () => { + it('opens overflow menu with workflow status options', async () => { + await retry.try(async () => { + await (await observability.alerts.bulkActions.getBulkActionsButton()).click(); + }); + }); + }); + }); + }); + + describe('When user has read permissions for logs', () => { + before(async () => { + await observability.users.setTestUserRole( + observability.users.defineBasicObservabilityRole({ + logs: ['read'], + }) + ); + await observability.alerts.common.navigateToTimeWithData(); + }); + + after(async () => { + await observability.users.restoreDefaultTestUserRole(); + }); + + it('checkbox is not visible', async () => { + await observability.alerts.bulkActions.missingCheckboxSelectorOrFail(); + }); + }); + + describe('When user has read permissions for apm', () => { + before(async () => { + await observability.users.setTestUserRole( + observability.users.defineBasicObservabilityRole({ + apm: ['read'], + }) + ); + await observability.alerts.common.navigateToTimeWithData(); + }); + + after(async () => { + await observability.users.restoreDefaultTestUserRole(); + }); + + it('checkbox is not displayed', async () => { + await observability.alerts.bulkActions.missingCheckboxSelectorOrFail(); + }); + }); + + describe('When user has mixed permissions for observability apps', () => { + before(async () => { + await observability.users.setTestUserRole( + observability.users.defineBasicObservabilityRole({ + logs: ['all'], + apm: ['read'], + observabilityCases: ['read'], + }) + ); + await observability.alerts.common.navigateToTimeWithData(); + }); + + after(async () => { + await observability.users.restoreDefaultTestUserRole(); + }); + + it('apm checkboxes are disabled', async () => { + const apmCheckboxes = await observability.alerts.bulkActions.getCheckboxSelectorPerProducer( + 'apm' + ); + + await asyncForEach(apmCheckboxes, async (checkbox, index) => { + expect(await checkbox.isEnabled()).to.be(false); + }); + }); + + it('logs checkboxes are enabled', async () => { + const logsCheckboxes = + await observability.alerts.bulkActions.getCheckboxSelectorPerProducer('logs'); + + await asyncForEach(logsCheckboxes, async (checkbox, index) => { + expect(await checkbox.isEnabled()).to.be(true); + }); + }); + }); + }); +}; diff --git a/x-pack/test/observability_functional/apps/observability/index.ts b/x-pack/test/observability_functional/apps/observability/index.ts index 898c7afb9a7264..f2483e5f1401b3 100644 --- a/x-pack/test/observability_functional/apps/observability/index.ts +++ b/x-pack/test/observability_functional/apps/observability/index.ts @@ -18,5 +18,6 @@ export default function ({ loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./alerts/pagination')); loadTestFile(require.resolve('./alerts/add_to_case')); loadTestFile(require.resolve('./alerts/state_synchronization')); + loadTestFile(require.resolve('./alerts/bulk_actions')); }); } diff --git a/x-pack/test/security_api_integration/tests/kerberos/kerberos_login.ts b/x-pack/test/security_api_integration/tests/kerberos/kerberos_login.ts index ed1a1f3c16fcc6..84673c7b68f2ef 100644 --- a/x-pack/test/security_api_integration/tests/kerberos/kerberos_login.ts +++ b/x-pack/test/security_api_integration/tests/kerberos/kerberos_login.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { parse as parseCookie, Cookie } from 'tough-cookie'; -import { delay } from 'bluebird'; +import { setTimeout as setTimeoutAsync } from 'timers/promises'; import { adminTestUser } from '@kbn/test'; import { FtrProviderContext } from '../../ftr_provider_context'; import { @@ -319,7 +319,7 @@ export default function ({ getService }: FtrProviderContext) { // Access token expiration is set to 15s for API integration tests. // Let's wait for 20s to make sure token expires. - await delay(20000); + await setTimeoutAsync(20000); // This api call should succeed and automatically refresh token. Returned cookie will contain // the new access and refresh token pair. @@ -350,7 +350,7 @@ export default function ({ getService }: FtrProviderContext) { // Access token expiration is set to 15s for API integration tests. // Let's wait for 20s to make sure token expires. - await delay(20000); + await setTimeoutAsync(20000); // This request should succeed and automatically refresh token. Returned cookie will contain // the new access and refresh token pair. diff --git a/x-pack/test/security_api_integration/tests/oidc/authorization_code_flow/oidc_auth.ts b/x-pack/test/security_api_integration/tests/oidc/authorization_code_flow/oidc_auth.ts index a7a8702894482b..eb12d4240a372d 100644 --- a/x-pack/test/security_api_integration/tests/oidc/authorization_code_flow/oidc_auth.ts +++ b/x-pack/test/security_api_integration/tests/oidc/authorization_code_flow/oidc_auth.ts @@ -8,7 +8,7 @@ import expect from '@kbn/expect'; import { parse as parseCookie, Cookie } from 'tough-cookie'; import url from 'url'; -import { delay } from 'bluebird'; +import { setTimeout as setTimeoutAsync } from 'timers/promises'; import { adminTestUser } from '@kbn/test'; import { getStateAndNonce } from '../../../fixtures/oidc/oidc_tools'; import { FtrProviderContext } from '../../../ftr_provider_context'; @@ -494,7 +494,7 @@ export default function ({ getService }: FtrProviderContext) { // Access token expiration is set to 15s for API integration tests. // Let's wait for 20s to make sure token expires. - await delay(20000); + await setTimeoutAsync(20000); // This api call should succeed and automatically refresh token. Returned cookie will contain // the new access and refresh token pair. diff --git a/x-pack/test/security_api_integration/tests/pki/pki_auth.ts b/x-pack/test/security_api_integration/tests/pki/pki_auth.ts index f857e5c149be48..76e3cb22488158 100644 --- a/x-pack/test/security_api_integration/tests/pki/pki_auth.ts +++ b/x-pack/test/security_api_integration/tests/pki/pki_auth.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { parse as parseCookie, Cookie } from 'tough-cookie'; -import { delay } from 'bluebird'; +import { setTimeout as setTimeoutAsync } from 'timers/promises'; import { readFileSync } from 'fs'; import { resolve } from 'path'; import { CA_CERT_PATH } from '@kbn/dev-utils'; @@ -358,7 +358,7 @@ export default function ({ getService }: FtrProviderContext) { // Access token expiration is set to 15s for API integration tests. // Let's wait for 20s to make sure token expires. - await delay(20000); + await setTimeoutAsync(20000); // This api call should succeed and automatically refresh token. Returned cookie will contain // the new access token. @@ -382,7 +382,7 @@ export default function ({ getService }: FtrProviderContext) { // Access token expiration is set to 15s for API integration tests. // Let's wait for 20s to make sure token expires. - await delay(20000); + await setTimeoutAsync(20000); // This request should succeed and automatically refresh token. Returned cookie will contain // the new access and refresh token pair. diff --git a/x-pack/test/security_api_integration/tests/saml/saml_login.ts b/x-pack/test/security_api_integration/tests/saml/saml_login.ts index 97fdcb77f4d660..c0ea296297fe66 100644 --- a/x-pack/test/security_api_integration/tests/saml/saml_login.ts +++ b/x-pack/test/security_api_integration/tests/saml/saml_login.ts @@ -7,7 +7,7 @@ import { stringify } from 'query-string'; import url from 'url'; -import { delay } from 'bluebird'; +import { setTimeout as setTimeoutAsync } from 'timers/promises'; import expect from '@kbn/expect'; import { parse as parseCookie, Cookie } from 'tough-cookie'; import { adminTestUser } from '@kbn/test'; @@ -468,7 +468,7 @@ export default function ({ getService }: FtrProviderContext) { // Access token expiration is set to 15s for API integration tests. // Let's wait for 20s to make sure token expires. - await delay(20000); + await setTimeoutAsync(20000); }); const expectNewSessionCookie = (cookie: Cookie) => { @@ -639,7 +639,7 @@ export default function ({ getService }: FtrProviderContext) { ['when access token is valid', async () => {}], // Scenario when active cookie has an expired access token. Access token expiration is set // to 15s for API integration tests so we need to wait for 20s to make sure token expires. - ['when access token is expired', async () => await delay(20000)], + ['when access token is expired', async () => await setTimeoutAsync(20000)], // Scenario when active cookie references to access/refresh token pair that were already // removed from Elasticsearch (to simulate 24h when expired tokens are removed). [ diff --git a/x-pack/test/security_api_integration/tests/session_idle/cleanup.ts b/x-pack/test/security_api_integration/tests/session_idle/cleanup.ts index beb7bdfbdfccc4..39231df307a9e0 100644 --- a/x-pack/test/security_api_integration/tests/session_idle/cleanup.ts +++ b/x-pack/test/security_api_integration/tests/session_idle/cleanup.ts @@ -6,7 +6,7 @@ */ import { parse as parseCookie, Cookie } from 'tough-cookie'; -import { delay } from 'bluebird'; +import { setTimeout as setTimeoutAsync } from 'timers/promises'; import expect from '@kbn/expect'; import { adminTestUser } from '@kbn/test'; import type { AuthenticationProvider } from '../../../../plugins/security/common/model'; @@ -101,7 +101,7 @@ export default function ({ getService }: FtrProviderContext) { // Cleanup routine runs every 10s, and idle timeout threshold is three times larger than 5s // idle timeout, let's wait for 40s to make sure cleanup routine runs when idle timeout // threshold is exceeded. - await delay(40000); + await setTimeoutAsync(40000); // Session info is removed from the index and cookie isn't valid anymore expect(await getNumberOfSessionDocuments()).to.be(0); @@ -143,7 +143,7 @@ export default function ({ getService }: FtrProviderContext) { // Cleanup routine runs every 10s, and idle timeout threshold is three times larger than 5s // idle timeout, let's wait for 40s to make sure cleanup routine runs when idle timeout // threshold is exceeded. - await delay(40000); + await setTimeoutAsync(40000); // Session for basic and SAML that used global session settings should not be valid anymore. expect(await getNumberOfSessionDocuments()).to.be(2); @@ -191,7 +191,7 @@ export default function ({ getService }: FtrProviderContext) { // least twice. for (const counter of [...Array(20).keys()]) { // Session idle timeout is 15s, let's wait 10s and make a new request that would extend the session. - await delay(1500); + await setTimeoutAsync(1500); sessionCookie = (await checkSessionCookie(sessionCookie, basicUsername, { type: 'basic', diff --git a/x-pack/test/security_api_integration/tests/session_lifespan/cleanup.ts b/x-pack/test/security_api_integration/tests/session_lifespan/cleanup.ts index 6b5308f6238052..32222794ac23ba 100644 --- a/x-pack/test/security_api_integration/tests/session_lifespan/cleanup.ts +++ b/x-pack/test/security_api_integration/tests/session_lifespan/cleanup.ts @@ -6,7 +6,7 @@ */ import { parse as parseCookie, Cookie } from 'tough-cookie'; -import { delay } from 'bluebird'; +import { setTimeout as setTimeoutAsync } from 'timers/promises'; import expect from '@kbn/expect'; import { adminTestUser } from '@kbn/test'; import type { AuthenticationProvider } from '../../../../plugins/security/common/model'; @@ -98,7 +98,7 @@ export default function ({ getService }: FtrProviderContext) { // Cleanup routine runs every 10s, let's wait for 40s to make sure it runs multiple times and // when lifespan is exceeded. - await delay(40000); + await setTimeoutAsync(40000); // Session info is removed from the index and cookie isn't valid anymore expect(await getNumberOfSessionDocuments()).to.be(0); @@ -138,7 +138,7 @@ export default function ({ getService }: FtrProviderContext) { // Cleanup routine runs every 10s, let's wait for 40s to make sure it runs multiple times and // when lifespan is exceeded. - await delay(40000); + await setTimeoutAsync(40000); // Session for basic and SAML that used global session settings should not be valid anymore. expect(await getNumberOfSessionDocuments()).to.be(2); diff --git a/x-pack/test/security_solution_endpoint/apps/endpoint/index.ts b/x-pack/test/security_solution_endpoint/apps/endpoint/index.ts index d1cfddbca3a9c7..70d60ba5c1b67f 100644 --- a/x-pack/test/security_solution_endpoint/apps/endpoint/index.ts +++ b/x-pack/test/security_solution_endpoint/apps/endpoint/index.ts @@ -15,8 +15,7 @@ import { export default function (providerContext: FtrProviderContext) { const { loadTestFile, getService } = providerContext; - // FAILING: https://github.com/elastic/kibana/issues/72874 - describe.skip('endpoint', function () { + describe('endpoint', function () { const ingestManager = getService('ingestManager'); const log = getService('log'); const endpointTestResources = getService('endpointTestResources'); diff --git a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts index 02c08b1d7a915a..88462a2872fe46 100644 --- a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts +++ b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts @@ -402,6 +402,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(agentFullPolicy.inputs).to.eql([ getExpectedAgentPolicyEndpointInput({ id: policyInfo.packagePolicy.id, + name: policyInfo.packagePolicy.name, meta: { package: { version: policyInfo.packageInfo.version, @@ -448,6 +449,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(agentFullPolicy.inputs).to.eql([ getExpectedAgentPolicyEndpointInput({ id: policyInfo.packagePolicy.id, + name: policyInfo.packagePolicy.name, meta: { package: { version: policyInfo.packageInfo.version, @@ -486,6 +488,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(agentFullPolicyUpdated.inputs).to.eql([ getExpectedAgentPolicyEndpointInput({ id: policyInfo.packagePolicy.id, + name: policyInfo.packagePolicy.name, revision: 3, meta: { package: { diff --git a/x-pack/test/security_solution_endpoint/services/endpoint_policy.ts b/x-pack/test/security_solution_endpoint/services/endpoint_policy.ts index 26b6c5c0b5546f..f718390dc291a2 100644 --- a/x-pack/test/security_solution_endpoint/services/endpoint_policy.ts +++ b/x-pack/test/security_solution_endpoint/services/endpoint_policy.ts @@ -5,6 +5,7 @@ * 2.0. */ +import uuid from 'uuid'; import { FtrProviderContext } from '../ftr_provider_context'; import { CreateAgentPolicyRequest, @@ -161,7 +162,7 @@ export function EndpointPolicyTestResourcesProvider({ getService }: FtrProviderC let agentPolicy: CreateAgentPolicyResponse['item']; try { const newAgentPolicyData: CreateAgentPolicyRequest['body'] = { - name: 'East Coast', + name: `East Coast ${uuid.v4()}`, description: 'East Coast call center', namespace: 'default', }; @@ -182,7 +183,7 @@ export function EndpointPolicyTestResourcesProvider({ getService }: FtrProviderC let packagePolicy: CreatePackagePolicyResponse['item']; try { const newPackagePolicyData: CreatePackagePolicyRequest['body'] = { - name: 'Protect East Coast', + name: `Protect East Coast ${uuid.v4()}`, description: 'Protect the worlds data - but in the East Coast', policy_id: agentPolicy!.id, enabled: true, diff --git a/x-pack/test/security_solution_endpoint_api_int/apis/data_stream_helper.ts b/x-pack/test/security_solution_endpoint_api_int/apis/data_stream_helper.ts index f848d4bf418e95..dc4b4113c6b115 100644 --- a/x-pack/test/security_solution_endpoint_api_int/apis/data_stream_helper.ts +++ b/x-pack/test/security_solution_endpoint_api_int/apis/data_stream_helper.ts @@ -6,6 +6,7 @@ */ import { Client } from '@elastic/elasticsearch'; +import { AGENTS_INDEX } from '../../../plugins/fleet/common'; import { metadataIndexPattern, eventsIndexPattern, @@ -14,6 +15,7 @@ import { metadataCurrentIndexPattern, telemetryIndexPattern, METADATA_UNITED_INDEX, + METADATA_DATASTREAM, } from '../../../plugins/security_solution/common/endpoint/constants'; export function deleteDataStream(getService: (serviceName: 'es') => Client, index: string) { @@ -41,7 +43,7 @@ export async function deleteAllDocsFromIndex( match_all: {}, }, }, - index: `${index}`, + index, wait_for_completion: true, refresh: true, }, @@ -60,8 +62,10 @@ export async function deleteMetadataStream(getService: (serviceName: 'es') => Cl await deleteDataStream(getService, metadataIndexPattern); } -export async function deleteAllDocsFromMetadataIndex(getService: (serviceName: 'es') => Client) { - await deleteAllDocsFromIndex(getService, metadataIndexPattern); +export async function deleteAllDocsFromMetadataDatastream( + getService: (serviceName: 'es') => Client +) { + await deleteAllDocsFromIndex(getService, METADATA_DATASTREAM); } export async function deleteAllDocsFromMetadataCurrentIndex( @@ -92,6 +96,10 @@ export async function deleteTelemetryStream(getService: (serviceName: 'es') => C await deleteDataStream(getService, telemetryIndexPattern); } +export function deleteAllDocsFromFleetAgents(getService: (serviceName: 'es') => Client) { + return deleteAllDocsFromIndex(getService, AGENTS_INDEX); +} + export function stopTransform(getService: (serviceName: 'es') => Client, transformId: string) { const client = getService('es'); const stopRequest = { @@ -102,3 +110,32 @@ export function stopTransform(getService: (serviceName: 'es') => Client, transfo }; return client.transform.stopTransform(stopRequest); } + +export async function startTransform( + getService: (serviceName: 'es') => Client, + transformId: string +) { + const client = getService('es'); + const transformsResponse = await client.transform.getTransform({ + transform_id: `${transformId}*`, + }); + return transformsResponse.transforms.map((transform) => { + const t = transform as unknown as { id: string }; + return client.transform.startTransform({ transform_id: t.id }); + }); +} + +export function bulkIndex( + getService: (serviceName: 'es') => Client, + index: string, + docs: unknown[] +) { + const body = docs.flatMap((doc) => [{ create: { _index: index } }, doc]); + const client = getService('es'); + + return client.bulk({ + index, + refresh: true, + body, + }); +} diff --git a/x-pack/test/security_solution_endpoint_api_int/apis/metadata.fixtures.ts b/x-pack/test/security_solution_endpoint_api_int/apis/metadata.fixtures.ts new file mode 100644 index 00000000000000..281ba95d8e0cb6 --- /dev/null +++ b/x-pack/test/security_solution_endpoint_api_int/apis/metadata.fixtures.ts @@ -0,0 +1,571 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export function generateAgentDocs(timestamp: number, policyId: string) { + return [ + { + access_api_key_id: 'w4zJBHwBfQcM6aSYIRjO', + action_seq_no: [-1], + active: true, + agent: { + id: '963b081e-60d1-482c-befd-a5815fa8290f', + version: '8.0.0', + }, + enrolled_at: timestamp, + local_metadata: { + elastic: { + agent: { + 'build.original': + '8.0.0-SNAPSHOT (build: 0ee910f4df6653dc9557090946b392533621c2a3 at 2021-09-15 04:59:01 +0000 UTC)', + id: '963b081e-60d1-482c-befd-a5815fa8290f', + log_level: 'info', + snapshot: true, + upgradeable: false, + version: '8.0.0', + }, + }, + host: { + architecture: 'x86_64', + hostname: 'cf83e321af8a', + id: 'e57bde2886b8bb9f91f9143c3b123e98', + ip: ['127.0.0.1/8', '172.17.0.2/16'], + mac: ['02:42:ac:11:00:02'], + name: 'cf83e321af8a', + }, + os: { + family: 'redhat', + full: 'CentOS Linux Core(7 (Core))', + kernel: '5.10.47-linuxkit', + name: 'CentOS Linux', + platform: 'centos', + version: '7 (Core)', + }, + }, + policy_id: policyId, + type: 'PERMANENT', + default_api_key: 'x4zJBHwBfQcM6aSYYxiY:hhIFN3vSTGWFft7z0MbAhQ', + policy_output_permissions_hash: + 'cf54971b4d01d194757802052525463fe2f52ffaaf37755c9ab94fdd43c76e9c', + default_api_key_id: 'x4zJBHwBfQcM6aSYYxiY', + policy_revision_idx: 1, + policy_coordinator_idx: 1, + updated_at: timestamp, + last_checkin_status: 'online', + last_checkin: timestamp, + }, + { + access_api_key_id: 'w4zJBHwBfQcM6aSYIRjO', + action_seq_no: [-1], + active: true, + agent: { + id: '3838df35-a095-4af4-8fce-0b6d78793f2e', + version: '8.0.0', + }, + enrolled_at: timestamp, + local_metadata: { + elastic: { + agent: { + 'build.original': + '8.0.0-SNAPSHOT (build: 0ee910f4df6653dc9557090946b392533621c2a3 at 2021-09-15 04:59:01 +0000 UTC)', + id: '3838df35-a095-4af4-8fce-0b6d78793f2e', + log_level: 'info', + snapshot: true, + upgradeable: false, + version: '8.0.0', + }, + }, + host: { + architecture: 'x86_64', + hostname: 'cf83e321af8a', + id: 'e57bde2886b8bb9f91f9143c3b123e98', + ip: ['127.0.0.1/8', '172.17.0.2/16'], + mac: ['02:42:ac:11:00:02'], + name: 'cf83e321af8a', + }, + os: { + family: 'Windows', + full: 'Windows Server 2016', + kernel: '5.10.47-linuxkit', + name: 'windows 10.0', + platform: 'Windows', + version: '10.0', + }, + }, + policy_id: policyId, + type: 'PERMANENT', + default_api_key: 'x4zJBHwBfQcM6aSYYxiY:hhIFN3vSTGWFft7z0MbAhQ', + policy_output_permissions_hash: + 'cf54971b4d01d194757802052525463fe2f52ffaaf37755c9ab94fdd43c76e9c', + default_api_key_id: 'x4zJBHwBfQcM6aSYYxiY', + policy_revision_idx: 1, + policy_coordinator_idx: 1, + updated_at: timestamp, + last_checkin_status: 'online', + last_checkin: timestamp, + }, + ]; +} + +export function generateMetadataDocs(timestamp: number) { + return [ + { + '@timestamp': timestamp, + agent: { + id: '963b081e-60d1-482c-befd-a5815fa8290f', + version: '6.6.1', + name: 'Elastic Endpoint', + }, + elastic: { + agent: { + id: '11488bae-880b-4e7b-8d28-aac2aa9de816', + }, + }, + Endpoint: { + status: 'enrolled', + policy: { + applied: { + name: 'Default', + id: 'C2A9093E-E289-4C0A-AA44-8C32A414FA7A', + status: 'failure', + }, + }, + }, + event: { + created: timestamp, + id: '32f5fda2-48e4-4fae-b89e-a18038294d14', + kind: 'metric', + category: ['host'], + type: ['info'], + module: 'endpoint', + action: 'endpoint_metadata', + dataset: 'endpoint.metadata', + }, + host: { + architecture: 'x86', + hostname: 'cadmann-4.example.com', + name: 'cadmann-4.example.com', + id: '1fb3e58f-6ab0-4406-9d2a-91911207a712', + ip: ['10.192.213.130', '10.70.28.129'], + mac: ['a9-71-6a-cc-93-85', 'f7-31-84-d3-21-68', '2-95-12-39-ca-71'], + os: { + full: 'Windows 10', + name: 'windows 10.0', + platform: 'Windows', + family: 'Windows', + version: '10.0', + Ext: { + variant: 'Windows Pro', + }, + }, + }, + }, + { + '@timestamp': timestamp, + agent: { + id: 'b3412d6f-b022-4448-8fee-21cc936ea86b', + version: '6.0.0', + name: 'Elastic Endpoint', + }, + elastic: { + agent: { + id: '92ac1ce0-e1f7-409e-8af6-f17e97b1fc71', + }, + }, + Endpoint: { + status: 'enrolled', + policy: { + applied: { + name: 'Default', + id: 'C2A9093E-E289-4C0A-AA44-8C32A414FA7A', + status: 'success', + }, + }, + }, + event: { + created: timestamp, + id: '32f5fda2-48e4-4fae-b89e-a18038294d15', + kind: 'metric', + category: ['host'], + type: ['info'], + module: 'endpoint', + action: 'endpoint_metadata', + dataset: 'endpoint.metadata', + }, + host: { + architecture: 'x86_64', + hostname: 'thurlow-9.example.com', + name: 'thurlow-9.example.com', + id: '2f735e3d-be14-483b-9822-bad06e9045ca', + ip: ['10.46.229.234'], + mac: ['30-8c-45-55-69-b8', 'e5-36-7e-8f-a3-84', '39-a1-37-20-18-74'], + os: { + full: 'Windows Server 2016', + name: 'windows 10.0', + platform: 'Windows', + family: 'Windows', + version: '10.0', + Ext: { + variant: 'Windows Server', + }, + }, + }, + }, + { + '@timestamp': timestamp, + agent: { + id: '3838df35-a095-4af4-8fce-0b6d78793f2e', + version: '6.8.0', + name: 'Elastic Endpoint', + }, + elastic: { + agent: { + id: '023fa40c-411d-4188-a941-4147bfadd095', + }, + }, + Endpoint: { + status: 'enrolled', + policy: { + applied: { + name: 'Default', + id: '00000000-0000-0000-0000-000000000000', + status: 'failure', + }, + }, + }, + event: { + created: timestamp, + id: '32f5fda2-48e4-4fae-b89e-a18038294d16', + kind: 'metric', + category: ['host'], + type: ['info'], + module: 'endpoint', + action: 'endpoint_metadata', + dataset: 'endpoint.metadata', + }, + host: { + hostname: 'rezzani-7.example.com', + name: 'rezzani-7.example.com', + id: 'fc0ff548-feba-41b6-8367-65e8790d0eaf', + ip: ['10.101.149.26', '2606:a000:ffc0:39:11ef:37b9:3371:578c'], + mac: ['e2-6d-f9-0-46-2e'], + os: { + full: 'Windows 10', + name: 'windows 10.0', + platform: 'Windows', + family: 'Windows', + version: '10.0', + Ext: { + variant: 'Windows Pro', + }, + }, + }, + }, + { + '@timestamp': timestamp, + agent: { + id: '963b081e-60d1-482c-befd-a5815fa8290f', + version: '6.6.1', + name: 'Elastic Endpoint', + }, + elastic: { + agent: { + id: '11488bae-880b-4e7b-8d28-aac2aa9de816', + }, + }, + Endpoint: { + status: 'enrolled', + policy: { + applied: { + name: 'Default', + id: 'C2A9093E-E289-4C0A-AA44-8C32A414FA7A', + status: 'failure', + }, + }, + }, + event: { + created: timestamp, + id: '32f5fda2-48e4-4fae-b89e-a18038294d18', + kind: 'metric', + category: ['host'], + type: ['info'], + module: 'endpoint', + action: 'endpoint_metadata', + dataset: 'endpoint.metadata', + }, + host: { + architecture: 'x86', + hostname: 'cadmann-4.example.com', + name: 'cadmann-4.example.com', + id: '1fb3e58f-6ab0-4406-9d2a-91911207a712', + ip: ['10.192.213.130', '10.70.28.129'], + mac: ['a9-71-6a-cc-93-85', 'f7-31-84-d3-21-68', '2-95-12-39-ca-71'], + os: { + full: 'Windows Server 2016', + name: 'windows 10.0', + platform: 'Windows', + family: 'Windows', + version: '10.0', + Ext: { + variant: 'Windows Server 2016', + }, + }, + }, + }, + { + '@timestamp': timestamp, + agent: { + id: 'b3412d6f-b022-4448-8fee-21cc936ea86b', + version: '6.0.0', + name: 'Elastic Endpoint', + }, + elastic: { + agent: { + id: '92ac1ce0-e1f7-409e-8af6-f17e97b1fc71', + }, + }, + Endpoint: { + status: 'enrolled', + policy: { + applied: { + name: 'Default', + id: 'C2A9093E-E289-4C0A-AA44-8C32A414FA7A', + status: 'success', + }, + }, + }, + event: { + created: timestamp, + id: '32f5fda2-48e4-4fae-b89e-a18038294d19', + kind: 'metric', + category: ['host'], + type: ['info'], + module: 'endpoint', + action: 'endpoint_metadata', + dataset: 'endpoint.metadata', + }, + host: { + hostname: 'thurlow-9.example.com', + name: 'thurlow-9.example.com', + id: '2f735e3d-be14-483b-9822-bad06e9045ca', + ip: ['10.46.229.234'], + mac: ['30-8c-45-55-69-b8', 'e5-36-7e-8f-a3-84', '39-a1-37-20-18-74'], + os: { + full: 'Windows Server 2012', + name: 'windows 6.2', + platform: 'Windows', + family: 'Windows', + version: '6.2', + Ext: { + variant: 'Windows Server 2012', + }, + }, + }, + }, + { + '@timestamp': timestamp, + agent: { + id: '3838df35-a095-4af4-8fce-0b6d78793f2e', + version: '6.8.0', + name: 'Elastic Endpoint', + }, + elastic: { + agent: { + id: '023fa40c-411d-4188-a941-4147bfadd095', + }, + }, + Endpoint: { + status: 'enrolled', + policy: { + applied: { + name: 'With Eventing', + id: '00000000-0000-0000-0000-000000000000', + status: 'failure', + }, + }, + }, + event: { + created: timestamp, + id: '32f5fda2-48e4-4fae-b89e-a18038294d39', + kind: 'metric', + category: ['host'], + type: ['info'], + module: 'endpoint', + action: 'endpoint_metadata', + dataset: 'endpoint.metadata', + }, + host: { + architecture: 'x86', + hostname: 'rezzani-7.example.com', + name: 'rezzani-7.example.com', + id: 'fc0ff548-feba-41b6-8367-65e8790d0eaf', + ip: ['10.101.149.26', '2606:a000:ffc0:39:11ef:37b9:3371:578c'], + mac: ['e2-6d-f9-0-46-2e'], + os: { + full: 'Windows Server 2012', + name: 'windows 6.2', + platform: 'Windows', + family: 'Windows', + version: '6.2', + Ext: { + variant: 'Windows Server 2012', + }, + }, + }, + }, + { + '@timestamp': timestamp, + agent: { + id: '963b081e-60d1-482c-befd-a5815fa8290f', + version: '6.6.1', + name: 'Elastic Endpoint', + }, + elastic: { + agent: { + id: '11488bae-880b-4e7b-8d28-aac2aa9de816', + }, + }, + Endpoint: { + status: 'enrolled', + policy: { + applied: { + name: 'With Eventing', + id: '00000000-0000-0000-0000-000000000000', + status: 'failure', + }, + }, + }, + event: { + created: timestamp, + id: '32f5fda2-48e4-4fae-b89e-a18038294d31', + kind: 'metric', + category: ['host'], + type: ['info'], + module: 'endpoint', + action: 'endpoint_metadata', + dataset: 'endpoint.metadata', + }, + host: { + hostname: 'cadmann-4.example.com', + name: 'cadmann-4.example.com', + id: '1fb3e58f-6ab0-4406-9d2a-91911207a712', + ip: ['10.192.213.130', '10.70.28.129'], + mac: ['a9-71-6a-cc-93-85', 'f7-31-84-d3-21-68', '2-95-12-39-ca-71'], + os: { + full: 'Windows Server 2012R2', + name: 'windows 6.3', + platform: 'Windows', + family: 'Windows', + version: '6.3', + Ext: { + variant: 'Windows Server 2012 R2', + }, + }, + }, + }, + { + '@timestamp': timestamp, + agent: { + id: 'b3412d6f-b022-4448-8fee-21cc936ea86b', + version: '6.0.0', + name: 'Elastic Endpoint', + }, + elastic: { + agent: { + id: '92ac1ce0-e1f7-409e-8af6-f17e97b1fc71', + }, + }, + Endpoint: { + status: 'enrolled', + policy: { + applied: { + name: 'Default', + id: 'C2A9093E-E289-4C0A-AA44-8C32A414FA7A', + status: 'success', + }, + }, + }, + event: { + created: timestamp, + id: '32f5fda2-48e4-4fae-b89e-a18038294d23', + kind: 'metric', + category: ['host'], + type: ['info'], + module: 'endpoint', + action: 'endpoint_metadata', + dataset: 'endpoint.metadata', + }, + host: { + hostname: 'thurlow-9.example.com', + name: 'thurlow-9.example.com', + id: '2f735e3d-be14-483b-9822-bad06e9045ca', + ip: ['10.46.229.234'], + mac: ['30-8c-45-55-69-b8', 'e5-36-7e-8f-a3-84', '39-a1-37-20-18-74'], + os: { + full: 'Windows Server 2012R2', + name: 'windows 6.3', + platform: 'Windows', + family: 'Windows', + version: '6.3', + Ext: { + variant: 'Windows Server 2012 R2', + }, + }, + }, + }, + { + '@timestamp': timestamp, + agent: { + id: '3838df35-a095-4af4-8fce-0b6d78793f2e', + version: '6.8.0', + name: 'Elastic Endpoint', + }, + elastic: { + agent: { + id: '023fa40c-411d-4188-a941-4147bfadd095', + }, + }, + Endpoint: { + status: 'enrolled', + policy: { + applied: { + name: 'With Eventing', + id: '00000000-0000-0000-0000-000000000000', + status: 'success', + }, + }, + }, + event: { + created: timestamp, + id: '32f5fda2-48e4-4fae-b89e-a18038294d35', + kind: 'metric', + category: ['host'], + type: ['info'], + module: 'endpoint', + action: 'endpoint_metadata', + dataset: 'endpoint.metadata', + }, + host: { + architecture: 'x86', + hostname: 'rezzani-7.example.com', + name: 'rezzani-7.example.com', + id: 'fc0ff548-feba-41b6-8367-65e8790d0eaf', + ip: ['10.101.149.26', '2606:a000:ffc0:39:11ef:37b9:3371:578c'], + mac: ['e2-6d-f9-0-46-2e'], + os: { + full: 'Windows Server 2012', + name: 'windows 6.2', + version: '6.2', + platform: 'Windows', + family: 'Windows', + Ext: { + variant: 'Windows Server 2012', + }, + }, + }, + }, + ]; +} diff --git a/x-pack/test/security_solution_endpoint_api_int/apis/metadata.ts b/x-pack/test/security_solution_endpoint_api_int/apis/metadata.ts index afdc364ffd970f..35e316f309d7fc 100644 --- a/x-pack/test/security_solution_endpoint_api_int/apis/metadata.ts +++ b/x-pack/test/security_solution_endpoint_api_int/apis/metadata.ts @@ -9,25 +9,289 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../ftr_provider_context'; import { deleteAllDocsFromMetadataCurrentIndex, - deleteAllDocsFromMetadataIndex, + deleteAllDocsFromMetadataDatastream, deleteMetadataStream, deleteIndex, stopTransform, + startTransform, + deleteAllDocsFromFleetAgents, + deleteAllDocsFromIndex, + bulkIndex, } from './data_stream_helper'; import { + METADATA_DATASTREAM, HOST_METADATA_LIST_ROUTE, METADATA_UNITED_INDEX, METADATA_UNITED_TRANSFORM, } from '../../../plugins/security_solution/common/endpoint/constants'; +import { AGENTS_INDEX } from '../../../plugins/fleet/common'; +import { generateAgentDocs, generateMetadataDocs } from './metadata.fixtures'; +import { indexFleetEndpointPolicy } from '../../../plugins/security_solution/common/endpoint/data_loaders/index_fleet_endpoint_policy'; export default function ({ getService }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); const supertest = getService('supertest'); describe('test metadata api', () => { - // TODO add this after endpoint package changes are merged and in snapshot - // describe('with .metrics-endpoint.metadata_united_default index', () => { - // }); + describe('with .metrics-endpoint.metadata_united_default index', () => { + const numberOfHostsInFixture = 2; + + before(async () => { + await stopTransform(getService, `${METADATA_UNITED_TRANSFORM}*`); + await deleteAllDocsFromFleetAgents(getService); + await deleteAllDocsFromMetadataDatastream(getService); + await deleteAllDocsFromMetadataCurrentIndex(getService); + await deleteAllDocsFromIndex(getService, METADATA_UNITED_INDEX); + + // generate an endpoint policy and attach id to agents since + // metadata list api filters down to endpoint policies only + const policy = await indexFleetEndpointPolicy( + getService('kibanaServer'), + 'Default', + '1.1.1' + ); + const policyId = policy.integrationPolicies[0].policy_id; + const currentTime = new Date().getTime(); + + await Promise.all([ + bulkIndex(getService, AGENTS_INDEX, generateAgentDocs(currentTime, policyId)), + bulkIndex(getService, METADATA_DATASTREAM, generateMetadataDocs(currentTime)), + ]); + + // wait for latest metadata transform to run + await new Promise((r) => setTimeout(r, 30000)); + await startTransform(getService, METADATA_UNITED_TRANSFORM); + + // wait for united metadata transform to run + await new Promise((r) => setTimeout(r, 15000)); + }); + + after(async () => { + await deleteAllDocsFromFleetAgents(getService); + await deleteAllDocsFromMetadataDatastream(getService); + await deleteAllDocsFromMetadataCurrentIndex(getService); + await stopTransform(getService, `${METADATA_UNITED_TRANSFORM}*`); + await deleteAllDocsFromIndex(getService, METADATA_UNITED_INDEX); + }); + + it('should return one entry for each host with default paging', async () => { + const res = await supertest + .post(HOST_METADATA_LIST_ROUTE) + .set('kbn-xsrf', 'xxx') + .send() + .expect(200); + const { body } = res; + expect(body.total).to.eql(numberOfHostsInFixture); + expect(body.hosts.length).to.eql(numberOfHostsInFixture); + expect(body.request_page_size).to.eql(10); + expect(body.request_page_index).to.eql(0); + }); + + it('metadata api should return page based on paging properties passed.', async () => { + const { body } = await supertest + .post(HOST_METADATA_LIST_ROUTE) + .set('kbn-xsrf', 'xxx') + .send({ + paging_properties: [ + { + page_size: 1, + }, + { + page_index: 1, + }, + ], + }) + .expect(200); + expect(body.total).to.eql(numberOfHostsInFixture); + expect(body.hosts.length).to.eql(1); + expect(body.request_page_size).to.eql(1); + expect(body.request_page_index).to.eql(1); + }); + + it('metadata api should return accurate total metadata if page index produces no result', async () => { + const { body } = await supertest + .post(HOST_METADATA_LIST_ROUTE) + .set('kbn-xsrf', 'xxx') + .send({ + paging_properties: [ + { + page_size: 10, + }, + { + page_index: 3, + }, + ], + }) + .expect(200); + expect(body.total).to.eql(numberOfHostsInFixture); + expect(body.hosts.length).to.eql(0); + expect(body.request_page_size).to.eql(10); + expect(body.request_page_index).to.eql(30); + }); + + it('metadata api should return 400 when pagingProperties is below boundaries.', async () => { + const { body } = await supertest + .post(HOST_METADATA_LIST_ROUTE) + .set('kbn-xsrf', 'xxx') + .send({ + paging_properties: [ + { + page_size: 0, + }, + { + page_index: 1, + }, + ], + }) + .expect(400); + expect(body.message).to.contain('Value must be equal to or greater than [1]'); + }); + + it('metadata api should return page based on filters passed.', async () => { + const { body } = await supertest + .post(HOST_METADATA_LIST_ROUTE) + .set('kbn-xsrf', 'xxx') + .send({ + filters: { + kql: 'not (united.endpoint.host.ip:10.101.149.26)', + }, + }) + .expect(200); + expect(body.total).to.eql(1); + expect(body.hosts.length).to.eql(1); + expect(body.request_page_size).to.eql(10); + expect(body.request_page_index).to.eql(0); + }); + + it('metadata api should return page based on filters and paging passed.', async () => { + const notIncludedIp = '10.101.149.26'; + const { body } = await supertest + .post(HOST_METADATA_LIST_ROUTE) + .set('kbn-xsrf', 'xxx') + .send({ + paging_properties: [ + { + page_size: 10, + }, + { + page_index: 0, + }, + ], + filters: { + kql: `not (united.endpoint.host.ip:${notIncludedIp})`, + }, + }) + .expect(200); + expect(body.total).to.eql(1); + const resultIps: string[] = [].concat( + ...body.hosts.map((hostInfo: Record) => hostInfo.metadata.host.ip) + ); + expect(resultIps.sort()).to.eql(['10.192.213.130', '10.70.28.129'].sort()); + expect(resultIps).not.include.eql(notIncludedIp); + expect(body.hosts.length).to.eql(1); + expect(body.request_page_size).to.eql(10); + expect(body.request_page_index).to.eql(0); + }); + + it('metadata api should return page based on host.os.Ext.variant filter.', async () => { + const variantValue = 'Windows Pro'; + const { body } = await supertest + .post(HOST_METADATA_LIST_ROUTE) + .set('kbn-xsrf', 'xxx') + .send({ + filters: { + kql: `united.endpoint.host.os.Ext.variant:${variantValue}`, + }, + }) + .expect(200); + expect(body.total).to.eql(2); + const resultOsVariantValue: Set = new Set( + body.hosts.map((hostInfo: Record) => hostInfo.metadata.host.os.Ext.variant) + ); + expect(Array.from(resultOsVariantValue)).to.eql([variantValue]); + expect(body.hosts.length).to.eql(2); + expect(body.request_page_size).to.eql(10); + expect(body.request_page_index).to.eql(0); + }); + + it('metadata api should return the latest event for all the events for an endpoint', async () => { + const targetEndpointIp = '10.101.149.26'; + const { body } = await supertest + .post(HOST_METADATA_LIST_ROUTE) + .set('kbn-xsrf', 'xxx') + .send({ + filters: { + kql: `united.endpoint.host.ip:${targetEndpointIp}`, + }, + }) + .expect(200); + expect(body.total).to.eql(1); + const resultIp: string = body.hosts[0].metadata.host.ip.filter( + (ip: string) => ip === targetEndpointIp + ); + expect(resultIp).to.eql([targetEndpointIp]); + expect(body.hosts.length).to.eql(1); + expect(body.request_page_size).to.eql(10); + expect(body.request_page_index).to.eql(0); + }); + + it('metadata api should return the latest event for all the events where policy status is not success', async () => { + const { body } = await supertest + .post(HOST_METADATA_LIST_ROUTE) + .set('kbn-xsrf', 'xxx') + .send({ + filters: { + kql: `not (united.endpoint.Endpoint.policy.applied.status:success)`, + }, + }) + .expect(200); + const statuses: Set = new Set( + body.hosts.map( + (hostInfo: Record) => hostInfo.metadata.Endpoint.policy.applied.status + ) + ); + expect(statuses.size).to.eql(1); + expect(Array.from(statuses)).to.eql(['failure']); + }); + + it('metadata api should return the endpoint based on the elastic agent id, and status should be healthy', async () => { + const targetEndpointId = 'fc0ff548-feba-41b6-8367-65e8790d0eaf'; + const targetElasticAgentId = '023fa40c-411d-4188-a941-4147bfadd095'; + const { body } = await supertest + .post(HOST_METADATA_LIST_ROUTE) + .set('kbn-xsrf', 'xxx') + .send({ + filters: { + kql: `united.endpoint.elastic.agent.id:${targetElasticAgentId}`, + }, + }) + .expect(200); + expect(body.total).to.eql(1); + const resultHostId: string = body.hosts[0].metadata.host.id; + const resultElasticAgentId: string = body.hosts[0].metadata.elastic.agent.id; + expect(resultHostId).to.eql(targetEndpointId); + expect(resultElasticAgentId).to.eql(targetElasticAgentId); + expect(body.hosts[0].host_status).to.eql('healthy'); + expect(body.hosts.length).to.eql(1); + expect(body.request_page_size).to.eql(10); + expect(body.request_page_index).to.eql(0); + }); + + it('metadata api should return all hosts when filter is empty string', async () => { + const { body } = await supertest + .post(HOST_METADATA_LIST_ROUTE) + .set('kbn-xsrf', 'xxx') + .send({ + filters: { + kql: '', + }, + }) + .expect(200); + expect(body.total).to.eql(numberOfHostsInFixture); + expect(body.hosts.length).to.eql(numberOfHostsInFixture); + expect(body.request_page_size).to.eql(10); + expect(body.request_page_index).to.eql(0); + }); + }); describe('with metrics-endpoint.metadata_current_default index', () => { /** @@ -40,10 +304,10 @@ export default function ({ getService }: FtrProviderContext) { await stopTransform(getService, `${METADATA_UNITED_TRANSFORM}*`); await deleteIndex(getService, METADATA_UNITED_INDEX); await deleteMetadataStream(getService); - await deleteAllDocsFromMetadataIndex(getService); + await deleteAllDocsFromMetadataDatastream(getService); await deleteAllDocsFromMetadataCurrentIndex(getService); const { body } = await supertest - .post(`${HOST_METADATA_LIST_ROUTE}`) + .post(HOST_METADATA_LIST_ROUTE) .set('kbn-xsrf', 'xxx') .send() .expect(200); @@ -55,30 +319,26 @@ export default function ({ getService }: FtrProviderContext) { }); describe(`POST ${HOST_METADATA_LIST_ROUTE} when index is not empty`, () => { + const timestamp = new Date().getTime(); before(async () => { // stop the united transform and delete the index // otherwise it won't hit metrics-endpoint.metadata_current_default index await stopTransform(getService, `${METADATA_UNITED_TRANSFORM}*`); await deleteIndex(getService, METADATA_UNITED_INDEX); - await esArchiver.load( - 'x-pack/test/functional/es_archives/endpoint/metadata/api_feature', - { - useCreate: true, - } - ); + await bulkIndex(getService, METADATA_DATASTREAM, generateMetadataDocs(timestamp)); // wait for transform - await new Promise((r) => setTimeout(r, 120000)); + await new Promise((r) => setTimeout(r, 60000)); }); // the endpoint uses data streams and es archiver does not support deleting them at the moment so we need // to do it manually after(async () => { await deleteMetadataStream(getService); - await deleteAllDocsFromMetadataIndex(getService); + await deleteAllDocsFromMetadataDatastream(getService); await deleteAllDocsFromMetadataCurrentIndex(getService); }); it('metadata api should return one entry for each host with default paging', async () => { const { body } = await supertest - .post(`${HOST_METADATA_LIST_ROUTE}`) + .post(HOST_METADATA_LIST_ROUTE) .set('kbn-xsrf', 'xxx') .send() .expect(200); @@ -90,7 +350,7 @@ export default function ({ getService }: FtrProviderContext) { it('metadata api should return page based on paging properties passed.', async () => { const { body } = await supertest - .post(`${HOST_METADATA_LIST_ROUTE}`) + .post(HOST_METADATA_LIST_ROUTE) .set('kbn-xsrf', 'xxx') .send({ paging_properties: [ @@ -114,7 +374,7 @@ export default function ({ getService }: FtrProviderContext) { */ it('metadata api should return accurate total metadata if page index produces no result', async () => { const { body } = await supertest - .post(`${HOST_METADATA_LIST_ROUTE}`) + .post(HOST_METADATA_LIST_ROUTE) .set('kbn-xsrf', 'xxx') .send({ paging_properties: [ @@ -135,7 +395,7 @@ export default function ({ getService }: FtrProviderContext) { it('metadata api should return 400 when pagingProperties is below boundaries.', async () => { const { body } = await supertest - .post(`${HOST_METADATA_LIST_ROUTE}`) + .post(HOST_METADATA_LIST_ROUTE) .set('kbn-xsrf', 'xxx') .send({ paging_properties: [ @@ -153,7 +413,7 @@ export default function ({ getService }: FtrProviderContext) { it('metadata api should return page based on filters passed.', async () => { const { body } = await supertest - .post(`${HOST_METADATA_LIST_ROUTE}`) + .post(HOST_METADATA_LIST_ROUTE) .set('kbn-xsrf', 'xxx') .send({ filters: { @@ -170,7 +430,7 @@ export default function ({ getService }: FtrProviderContext) { it('metadata api should return page based on filters and paging passed.', async () => { const notIncludedIp = '10.46.229.234'; const { body } = await supertest - .post(`${HOST_METADATA_LIST_ROUTE}`) + .post(HOST_METADATA_LIST_ROUTE) .set('kbn-xsrf', 'xxx') .send({ paging_properties: [ @@ -207,7 +467,7 @@ export default function ({ getService }: FtrProviderContext) { it('metadata api should return page based on host.os.Ext.variant filter.', async () => { const variantValue = 'Windows Pro'; const { body } = await supertest - .post(`${HOST_METADATA_LIST_ROUTE}`) + .post(HOST_METADATA_LIST_ROUTE) .set('kbn-xsrf', 'xxx') .send({ filters: { @@ -228,7 +488,7 @@ export default function ({ getService }: FtrProviderContext) { it('metadata api should return the latest event for all the events for an endpoint', async () => { const targetEndpointIp = '10.46.229.234'; const { body } = await supertest - .post(`${HOST_METADATA_LIST_ROUTE}`) + .post(HOST_METADATA_LIST_ROUTE) .set('kbn-xsrf', 'xxx') .send({ filters: { @@ -241,7 +501,7 @@ export default function ({ getService }: FtrProviderContext) { (ip: string) => ip === targetEndpointIp ); expect(resultIp).to.eql([targetEndpointIp]); - expect(body.hosts[0].metadata.event.created).to.eql(1634656952181); + expect(body.hosts[0].metadata.event.created).to.eql(timestamp); expect(body.hosts.length).to.eql(1); expect(body.request_page_size).to.eql(10); expect(body.request_page_index).to.eql(0); @@ -249,7 +509,7 @@ export default function ({ getService }: FtrProviderContext) { it('metadata api should return the latest event for all the events where policy status is not success', async () => { const { body } = await supertest - .post(`${HOST_METADATA_LIST_ROUTE}`) + .post(HOST_METADATA_LIST_ROUTE) .set('kbn-xsrf', 'xxx') .send({ filters: { @@ -270,7 +530,7 @@ export default function ({ getService }: FtrProviderContext) { const targetEndpointId = 'fc0ff548-feba-41b6-8367-65e8790d0eaf'; const targetElasticAgentId = '023fa40c-411d-4188-a941-4147bfadd095'; const { body } = await supertest - .post(`${HOST_METADATA_LIST_ROUTE}`) + .post(HOST_METADATA_LIST_ROUTE) .set('kbn-xsrf', 'xxx') .send({ filters: { @@ -283,7 +543,7 @@ export default function ({ getService }: FtrProviderContext) { const resultElasticAgentId: string = body.hosts[0].metadata.elastic.agent.id; expect(resultHostId).to.eql(targetEndpointId); expect(resultElasticAgentId).to.eql(targetElasticAgentId); - expect(body.hosts[0].metadata.event.created).to.eql(1634656952181); + expect(body.hosts[0].metadata.event.created).to.eql(timestamp); expect(body.hosts[0].host_status).to.eql('unhealthy'); expect(body.hosts.length).to.eql(1); expect(body.request_page_size).to.eql(10); @@ -292,7 +552,7 @@ export default function ({ getService }: FtrProviderContext) { it('metadata api should return all hosts when filter is empty string', async () => { const { body } = await supertest - .post(`${HOST_METADATA_LIST_ROUTE}`) + .post(HOST_METADATA_LIST_ROUTE) .set('kbn-xsrf', 'xxx') .send({ filters: { diff --git a/yarn.lock b/yarn.lock index 533f1cbd894561..7a66ff2bf4127d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4204,68 +4204,60 @@ resolved "https://registry.yarnpkg.com/@mdx-js/util/-/util-1.6.22.tgz#219dfd89ae5b97a8801f015323ffa4b62f45718b" integrity sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA== -"@microsoft/api-documenter@7.7.2": - version "7.7.2" - resolved "https://registry.yarnpkg.com/@microsoft/api-documenter/-/api-documenter-7.7.2.tgz#b6897f052ad447d6bb74f806287e8846c64691da" - integrity sha512-4mWE5G3grYd4PX5D6awiKa3B3GOXumkyGspgeTwlOBxrmj0FuVFRNPVZxGU0NqYnaw/bW4cg4ftUnSDzycrW+A== - dependencies: - "@microsoft/api-extractor-model" "7.7.0" - "@microsoft/node-core-library" "3.18.0" - "@microsoft/ts-command-line" "4.3.5" - "@microsoft/tsdoc" "0.12.14" +"@microsoft/api-documenter@7.13.68": + version "7.13.68" + resolved "https://registry.yarnpkg.com/@microsoft/api-documenter/-/api-documenter-7.13.68.tgz#c1e144764cac0684adefe78fd848d78c3f374681" + integrity sha512-cRjwK1TDyGxFGgCsRG8G0Yi3Z4akvfWgw1pWAxKFbm7ajlQQGZcHPnb+n4lKlSeQ5g/cxc7hcdw54Mvisne9Bg== + dependencies: + "@microsoft/api-extractor-model" "7.13.16" + "@microsoft/tsdoc" "0.13.2" + "@rushstack/node-core-library" "3.43.2" + "@rushstack/ts-command-line" "4.10.4" colors "~1.2.1" js-yaml "~3.13.1" - resolve "1.8.1" - -"@microsoft/api-extractor-model@7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.7.0.tgz#a5e86a638fa3fea283aeebc4785d8150652f30c6" - integrity sha512-9yrSr9LpdNnx7X8bXVb/YbcQopizsr43McAG7Xno5CMNFzbSkmIr8FJL0L+WGfrSWSTms9Bngfz7d1ScP6zbWQ== - dependencies: - "@microsoft/node-core-library" "3.18.0" - "@microsoft/tsdoc" "0.12.14" - -"@microsoft/api-extractor@7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@microsoft/api-extractor/-/api-extractor-7.7.0.tgz#1550a5b88ca927d57e9c9698356a2f9375c5984c" - integrity sha512-1ngy95VA1s7GTE+bkS7QoYTg/TZs54CdJ46uAhl6HlyDJut4p/aH46W70g2XQs9VniIymW1Qe6fqNmcQUx5CVg== - dependencies: - "@microsoft/api-extractor-model" "7.7.0" - "@microsoft/node-core-library" "3.18.0" - "@microsoft/ts-command-line" "4.3.5" - "@microsoft/tsdoc" "0.12.14" + resolve "~1.17.0" + +"@microsoft/api-extractor-model@7.13.16": + version "7.13.16" + resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.13.16.tgz#1d67541ebbcea32672c5fdd9392dc1579b2fc23a" + integrity sha512-ttdxVXsTWL5dd26W1YNLe3LgDsE0EE273aZlcLe58W0opymBybCYU1Mn+OHQM8BuErrdvdN8LdpWAAbkiOEN/Q== + dependencies: + "@microsoft/tsdoc" "0.13.2" + "@microsoft/tsdoc-config" "~0.15.2" + "@rushstack/node-core-library" "3.43.2" + +"@microsoft/api-extractor@7.18.19": + version "7.18.19" + resolved "https://registry.yarnpkg.com/@microsoft/api-extractor/-/api-extractor-7.18.19.tgz#f09afc1c210aa67e2f3f34b0a68281a12f144541" + integrity sha512-aY+/XR7PtQXtnqNPFRs3/+iVRlQJpo6uLTjO2g7PqmnMywl3GBU3bCgAlV/khZtAQbIs6Le57XxmSE6rOqbcfg== + dependencies: + "@microsoft/api-extractor-model" "7.13.16" + "@microsoft/tsdoc" "0.13.2" + "@microsoft/tsdoc-config" "~0.15.2" + "@rushstack/node-core-library" "3.43.2" + "@rushstack/rig-package" "0.3.5" + "@rushstack/ts-command-line" "4.10.4" colors "~1.2.1" lodash "~4.17.15" - resolve "1.8.1" + resolve "~1.17.0" + semver "~7.3.0" source-map "~0.6.1" - typescript "~3.7.2" + typescript "~4.4.2" -"@microsoft/node-core-library@3.18.0": - version "3.18.0" - resolved "https://registry.yarnpkg.com/@microsoft/node-core-library/-/node-core-library-3.18.0.tgz#9a9123354b3e067bb8a975ba791959ffee1322ed" - integrity sha512-VzzSHtcwgHVW1xbHqpngfn+OS1trAZ1Tw3XXBlMsEKe7Wz7FF2gLr0hZa6x9Pemk5pkd4tu4+GTSOJjCKGjrgg== +"@microsoft/tsdoc-config@~0.15.2": + version "0.15.2" + resolved "https://registry.yarnpkg.com/@microsoft/tsdoc-config/-/tsdoc-config-0.15.2.tgz#eb353c93f3b62ab74bdc9ab6f4a82bcf80140f14" + integrity sha512-mK19b2wJHSdNf8znXSMYVShAHktVr/ib0Ck2FA3lsVBSEhSI/TfXT7DJQkAYgcztTuwazGcg58ZjYdk0hTCVrA== dependencies: - "@types/node" "8.10.54" - colors "~1.2.1" - fs-extra "~7.0.1" + "@microsoft/tsdoc" "0.13.2" + ajv "~6.12.6" jju "~1.4.0" - semver "~5.3.0" - timsort "~0.3.0" - z-schema "~3.18.3" - -"@microsoft/ts-command-line@4.3.5": - version "4.3.5" - resolved "https://registry.yarnpkg.com/@microsoft/ts-command-line/-/ts-command-line-4.3.5.tgz#78026d20244f39978d3397849ac8c40c0c2d4079" - integrity sha512-CN3j86apNOmllUmeJ0AyRfTYA2BP2xlnfgmnyp1HWLqcJmR/zLe/fk/+gohGnNt7o5/qHta3681LQhO2Yy3GFw== - dependencies: - "@types/argparse" "1.0.33" - argparse "~1.0.9" - colors "~1.2.1" + resolve "~1.19.0" -"@microsoft/tsdoc@0.12.14": - version "0.12.14" - resolved "https://registry.yarnpkg.com/@microsoft/tsdoc/-/tsdoc-0.12.14.tgz#0e0810a0a174e50e22dfe8edb30599840712f22d" - integrity sha512-518yewjSga1jLdiLrcmpMFlaba5P+50b0TWNFUpC+SL9Yzf0kMi57qw+bMl+rQ08cGqH1vLx4eg9YFUbZXgZ0Q== +"@microsoft/tsdoc@0.13.2": + version "0.13.2" + resolved "https://registry.yarnpkg.com/@microsoft/tsdoc/-/tsdoc-0.13.2.tgz#3b0efb6d3903bd49edb073696f60e90df08efb26" + integrity sha512-WrHvO8PDL8wd8T2+zBGKrMwVL5IyzR3ryWUsl0PXgEV0QHup4mTLi0QcATefGI6Gx9Anu7vthPyyyLpY0EpiQg== "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1" @@ -4786,6 +4778,39 @@ redux-thunk "^2.3.0" reselect "^4.0.0" +"@rushstack/node-core-library@3.43.2": + version "3.43.2" + resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.43.2.tgz#f067371a94fd92ed8f9d9aa8201c5e9e17a19f0f" + integrity sha512-b7AEhSf6CvZgvuDcWMFDeKx2mQSn9AVnMQVyxNxFeHCtLz3gJicqCOlw2GOXM8HKh6PInLdil/NVCDcstwSrIw== + dependencies: + "@types/node" "12.20.24" + colors "~1.2.1" + fs-extra "~7.0.1" + import-lazy "~4.0.0" + jju "~1.4.0" + resolve "~1.17.0" + semver "~7.3.0" + timsort "~0.3.0" + z-schema "~3.18.3" + +"@rushstack/rig-package@0.3.5": + version "0.3.5" + resolved "https://registry.yarnpkg.com/@rushstack/rig-package/-/rig-package-0.3.5.tgz#7ddab0994647837bab8fdef26f990f1774d82e78" + integrity sha512-CvqWw+E81U5lRBN/lUj7Ngr/XQa/PPb2jAS5QcLP7WL+IMUl+3+Cc2qYrsDoB4zke81kz+usWGmBQpBzGMLmAA== + dependencies: + resolve "~1.17.0" + strip-json-comments "~3.1.1" + +"@rushstack/ts-command-line@4.10.4": + version "4.10.4" + resolved "https://registry.yarnpkg.com/@rushstack/ts-command-line/-/ts-command-line-4.10.4.tgz#05142b74e5cb207d3dd9b935c82f80d7fcb68042" + integrity sha512-4T5ao4UgDb6LmiRj4GumvG3VT/p6RSMgl7TN7S58ifaAGN2GeTNBajFCDdJs9QQP0d/4tA5p0SFzT7Ps5Byirg== + dependencies: + "@types/argparse" "1.0.38" + argparse "~1.0.9" + colors "~1.2.1" + string-argv "~0.3.1" + "@samverschueren/stream-to-observable@^0.3.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f" @@ -5846,10 +5871,10 @@ dependencies: "@types/glob" "*" -"@types/argparse@1.0.33": - version "1.0.33" - resolved "https://registry.yarnpkg.com/@types/argparse/-/argparse-1.0.33.tgz#2728669427cdd74a99e53c9f457ca2866a37c52d" - integrity sha512-VQgHxyPMTj3hIlq9SY1mctqx+Jj8kpQfoLvDlVSDNOyuYs8JYfkuY3OW/4+dO657yPmNhHpePRx0/Tje5ImNVQ== +"@types/argparse@1.0.38": + version "1.0.38" + resolved "https://registry.yarnpkg.com/@types/argparse/-/argparse-1.0.38.tgz#a81fd8606d481f873a3800c6ebae4f1d768a56a9" + integrity sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA== "@types/aria-query@^4.2.0": version "4.2.0" @@ -5905,11 +5930,6 @@ resolved "https://registry.yarnpkg.com/@types/base64-js/-/base64-js-1.2.5.tgz#582b2476169a6cba460a214d476c744441d873d5" integrity sha1-WCskdhaabLpGCiFNR2x0REHYc9U= -"@types/bluebird@^3.1.1": - version "3.5.30" - resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.30.tgz#ee034a0eeea8b84ed868b1aa60d690b08a6cfbc5" - integrity sha512-8LhzvcjIoqoi1TghEkRMkbbmM+jhHnBokPGkJWjclMK+Ks0MxEBow3/p2/iFTZ+OIbJHQDSfpgdZEb+af3gfVw== - "@types/braces@*": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/braces/-/braces-3.0.0.tgz#7da1c0d44ff1c7eb660a36ec078ea61ba7eb42cb" @@ -6679,7 +6699,7 @@ dependencies: "@types/node" "*" -"@types/node@*", "@types/node@16.10.2", "@types/node@8.10.54", "@types/node@>= 8", "@types/node@>=8.9.0", "@types/node@^10.1.0", "@types/node@^14.14.31": +"@types/node@*", "@types/node@12.20.24", "@types/node@16.10.2", "@types/node@>= 8", "@types/node@>=8.9.0", "@types/node@^10.1.0", "@types/node@^14.14.31": version "16.10.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.2.tgz#5764ca9aa94470adb4e1185fe2e9f19458992b2e" integrity sha512-zCclL4/rx+W5SQTzFs9wyvvyCwoK9QtBpratqz2IYJ3O8Umrn0m3nsTv0wQBk9sRGpvUe9CwPDrQFB10f1FIjQ== @@ -7906,7 +7926,7 @@ ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.2, ajv@^6.12.4, ajv@^6.5.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^6.11.0, ajv@^6.12.5: +ajv@^6.11.0, ajv@^6.12.5, ajv@~6.12.6: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -9422,11 +9442,6 @@ bluebird@3.5.3: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.3.tgz#7d01c6f9616c9a51ab0f8c549a79dfe6ec33efa7" integrity sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw== -bluebird@3.5.5: - version "3.5.5" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.5.tgz#a8d0afd73251effbbd5fe384a77d73003c17a71f" - integrity sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w== - bluebird@3.7.2, bluebird@^3.3.5, bluebird@^3.4.1, bluebird@^3.5.0, bluebird@^3.5.1, bluebird@^3.5.5, bluebird@^3.7.1, bluebird@^3.7.2: version "3.7.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" @@ -16827,7 +16842,7 @@ import-lazy@^2.1.0: resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM= -import-lazy@^4.0.0: +import-lazy@^4.0.0, import-lazy@~4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-4.0.0.tgz#e8eb627483a0a43da3c03f3e35548be5cb0cc153" integrity sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw== @@ -17201,7 +17216,7 @@ is-color-stop@^1.0.0: rgb-regex "^1.0.1" rgba-regex "^1.0.0" -is-core-module@^2.2.0: +is-core-module@^2.1.0, is-core-module@^2.2.0: version "2.7.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.7.0.tgz#3c0ef7d31b4acfc574f80c58409d568a836848e3" integrity sha512-ByY+tjCciCr+9nLryBYcSD50EOGWt95c7tIsKTG1J2ixKKXPvF7Ej3AVd+UfDydAJom3biBGDBALaO79ktwgEQ== @@ -22295,7 +22310,7 @@ path-key@^3.0.0, path-key@^3.1.0: resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.0.tgz#99a10d870a803bdd5ee6f0470e58dfcd2f9a54d3" integrity sha512-8cChqz0RP6SHJkMt48FW0A7+qUOn+OsnOsVtzI59tZ8m+5bCSk7hzwET0pulwOM2YMn9J1efb07KB9l9f30SGg== -path-parse@^1.0.5, path-parse@^1.0.6: +path-parse@^1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== @@ -25352,13 +25367,6 @@ resolve@1.1.7: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" - integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA== - dependencies: - path-parse "^1.0.5" - resolve@^1.1.10, resolve@^1.1.4, resolve@^1.1.5, resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.20.0, resolve@^1.3.2, resolve@^1.3.3, resolve@^1.4.0, resolve@^1.7.1, resolve@^1.8.1: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" @@ -25382,6 +25390,21 @@ resolve@~1.10.1: dependencies: path-parse "^1.0.6" +resolve@~1.17.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== + dependencies: + path-parse "^1.0.6" + +resolve@~1.19.0: + version "1.19.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.19.0.tgz#1af5bf630409734a067cae29318aac7fa29a267c" + integrity sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg== + dependencies: + is-core-module "^2.1.0" + path-parse "^1.0.6" + responselike@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" @@ -25850,18 +25873,13 @@ semver@^7.2.1, semver@^7.3.2, semver@~7.3.2: resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938" integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== -semver@^7.3.4, semver@^7.3.5: +semver@^7.3.4, semver@^7.3.5, semver@~7.3.0: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== dependencies: lru-cache "^6.0.0" -semver@~5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" - integrity sha1-myzl094C0XxgEq0yaqa00M9U+U8= - send@0.17.1: version "0.17.1" resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" @@ -26900,6 +26918,11 @@ string-argv@0.0.2: resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.0.2.tgz#dac30408690c21f3c3630a3ff3a05877bdcbd736" integrity sha1-2sMECGkMIfPDYwo/86BYd73L1zY= +string-argv@~0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" + integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg== + string-length@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/string-length/-/string-length-1.0.1.tgz#56970fb1c38558e9e70b728bf3de269ac45adfac" @@ -27126,7 +27149,7 @@ strip-indent@^3.0.0: dependencies: min-indent "^1.0.0" -strip-json-comments@3.1.1, strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: +strip-json-comments@3.1.1, strip-json-comments@^3.1.0, strip-json-comments@^3.1.1, strip-json-comments@~3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== @@ -28478,7 +28501,7 @@ typescript-tuple@^2.2.1: dependencies: typescript-compare "^0.0.2" -typescript@4.1.3, typescript@^3.3.3333, typescript@^3.5.3, typescript@^4.3.5, typescript@~3.7.2, typescript@~4.1.2: +typescript@4.1.3, typescript@^3.3.3333, typescript@^3.5.3, typescript@^4.3.5, typescript@~4.1.2, typescript@~4.4.2: version "4.1.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.3.tgz#519d582bd94cba0cf8934c7d8e8467e473f53bb7" integrity sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==