Migrate types to packages: Client-side HTTP service (#135562)

* Migrate types to packages: Client-side HTTP service

* Fix linting issues, compactify some imports

* Fix incorrect typing, remove unnecessary exports

* Remove unnecessary export

* Fix trailing spaces removed by mistake

* Move Sha256 to new @kbn/crypto-browser package

* Support deprecated 'req' property in isHttpFetchError() method

* Fix failing UT in lens

* Update API docs

* Reorder imports, absolute imports first

* Provide createHttpFetchError() convenience method

* Fix typing issue

* Fix rebase issues

* Fix incorrect import

* Avod using core internals for plugin testing

* Fix automerge issues

* Misc enhancements following PR review
This commit is contained in:
Gerard Soldevila 2022-07-11 21:25:55 +02:00 committed by GitHub
parent f3eedfb565
commit 4824d9da8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
248 changed files with 6420 additions and 3002 deletions

File diff suppressed because it is too large Load diff

View file

@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que
| Public API count | Any count | Items lacking comments | Missing exports |
|-------------------|-----------|------------------------|-----------------|
| 2506 | 14 | 887 | 27 |
| 2498 | 10 | 852 | 26 |
## Client

View file

@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que
| Public API count | Any count | Items lacking comments | Missing exports |
|-------------------|-----------|------------------------|-----------------|
| 2506 | 14 | 887 | 27 |
| 2498 | 10 | 852 | 26 |
## Client

View file

@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que
| Public API count | Any count | Items lacking comments | Missing exports |
|-------------------|-----------|------------------------|-----------------|
| 2506 | 14 | 887 | 27 |
| 2498 | 10 | 852 | 26 |
## Client

File diff suppressed because it is too large Load diff

View file

@ -18,15 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que
| Public API count | Any count | Items lacking comments | Missing exports |
|-------------------|-----------|------------------------|-----------------|
| 2506 | 14 | 887 | 27 |
## Client
### Interfaces
<DocDefinitionList data={coreHttpObj.client.interfaces}/>
### Consts, variables and types
<DocDefinitionList data={coreHttpObj.client.misc}/>
| 2498 | 10 | 852 | 26 |
## Server

View file

@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que
| Public API count | Any count | Items lacking comments | Missing exports |
|-------------------|-----------|------------------------|-----------------|
| 2506 | 14 | 887 | 27 |
| 2498 | 10 | 852 | 26 |
## Client

View file

@ -7067,13 +7067,7 @@
"label": "http",
"description": [],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
}
"HttpSetup"
],
"path": "src/plugins/data/public/types.ts",
"deprecated": false
@ -8295,6 +8289,9 @@
"tags": [],
"label": "ES_FIELD_TYPES",
"description": [],
"signature": [
"ES_FIELD_TYPES"
],
"path": "node_modules/@types/kbn__field-types/index.d.ts",
"deprecated": false,
"initialIsOpen": false
@ -8306,6 +8303,9 @@
"tags": [],
"label": "KBN_FIELD_TYPES",
"description": [],
"signature": [
"KBN_FIELD_TYPES"
],
"path": "node_modules/@types/kbn__field-types/index.d.ts",
"deprecated": false,
"initialIsOpen": false
@ -16654,6 +16654,9 @@
"tags": [],
"label": "ES_FIELD_TYPES",
"description": [],
"signature": [
"ES_FIELD_TYPES"
],
"path": "node_modules/@types/kbn__field-types/index.d.ts",
"deprecated": false,
"initialIsOpen": false
@ -16665,6 +16668,9 @@
"tags": [],
"label": "KBN_FIELD_TYPES",
"description": [],
"signature": [
"KBN_FIELD_TYPES"
],
"path": "node_modules/@types/kbn__field-types/index.d.ts",
"deprecated": false,
"initialIsOpen": false
@ -21445,6 +21451,9 @@
"tags": [],
"label": "KbnFieldType",
"description": [],
"signature": [
"KbnFieldType"
],
"path": "node_modules/@types/kbn__field-types/index.d.ts",
"deprecated": false,
"children": [
@ -22670,6 +22679,9 @@
"tags": [],
"label": "KbnFieldTypeOptions",
"description": [],
"signature": [
"KbnFieldTypeOptions"
],
"path": "node_modules/@types/kbn__field-types/index.d.ts",
"deprecated": false,
"children": [
@ -23069,6 +23081,9 @@
"tags": [],
"label": "ES_FIELD_TYPES",
"description": [],
"signature": [
"ES_FIELD_TYPES"
],
"path": "node_modules/@types/kbn__field-types/index.d.ts",
"deprecated": false,
"initialIsOpen": false
@ -23080,6 +23095,9 @@
"tags": [],
"label": "KBN_FIELD_TYPES",
"description": [],
"signature": [
"KBN_FIELD_TYPES"
],
"path": "node_modules/@types/kbn__field-types/index.d.ts",
"deprecated": false,
"initialIsOpen": false

View file

@ -1164,13 +1164,7 @@
"description": [],
"signature": [
"(http: ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
},
"HttpSetup",
") => { createQuery: (attributes: ",
{
"pluginId": "data",
@ -1240,13 +1234,7 @@
"label": "http",
"description": [],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
}
"HttpSetup"
],
"path": "src/plugins/data/public/query/saved_query/saved_query_service.ts",
"deprecated": false,

View file

@ -2241,13 +2241,7 @@
"http dependency"
],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
}
"HttpSetup"
],
"path": "src/plugins/data_views/public/data_views/data_views_api_client.ts",
"deprecated": false,

View file

@ -81,7 +81,11 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| <DocLink id="kibFeaturesPluginApi" section="def-server.FeatureKibanaPrivileges.disabled" text="disabled"/> | security, fleet | 8.8.0 |
| <DocLink id="kibFeaturesPluginApi" section="def-server.PluginSetupContract.getElasticsearchFeatures" text="getElasticsearchFeatures"/> | security | 8.8.0 |
| <DocLink id="kibLicensingPluginApi" section="def-server.LicensingPluginSetup.refresh" text="refresh"/> | mapsEms | 8.8.0 |
| <DocLink id="kibCorePluginApi" section="def-public.IHttpFetchError.req" text="req"/> | ml | 8.8.0
| <DocLink id="kibCorePluginApi" section="def-public.IHttpFetchError.req" text="req"/> | ml, @kbn/core-http-browser-internal | 8.8.0
Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block,
so TS and code-reference navigation might not highlight them. |
| <DocLink id="kibCorePluginApi" section="def-public.IHttpFetchError.res" text="res"/> | @kbn/core-http-browser-internal | 8.8.0
Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block,
so TS and code-reference navigation might not highlight them. |
@ -128,8 +132,9 @@ Safe to remove.
| <DocLink id="kibReportingPluginApi" section="def-common.BasePayload" text="BasePayload"/> | reporting |
| <DocLink id="kibReportingPluginApi" section="def-common.JobAppParamsPDF" text="JobAppParamsPDF"/> | reporting |
| <DocLink id="kibTaskManagerPluginApi" section="def-server.ConcreteTaskInstance.interval" text="interval"/> | taskManager |
| <DocLink id="kibCorePluginApi" section="def-public.IHttpFetchError.res" text="res"/> | core |
| <DocLink id="kibCorePluginApi" section="def-server.AsyncPlugin" text="AsyncPlugin"/> | core |
| <DocLink id="kibCorePluginApi" section="def-server.PluginManifest.extraPublicDirs" text="extraPublicDirs"/> | core |
| <DocLink id="kibKbnCoreHttpBrowserPluginApi" section="def-common.IHttpFetchError.req" text="req"/> | @kbn/core-http-browser |
| <DocLink id="kibKbnCoreHttpBrowserPluginApi" section="def-common.IHttpFetchError.res" text="res"/> | @kbn/core-http-browser |
| <DocLink id="kibKbnCoreInjectedMetadataBrowserPluginApi" section="def-common.InjectedMetadataStart" text="InjectedMetadataStart"/> | @kbn/core-injected-metadata-browser |
| <DocLink id="kibKbnCoreInjectedMetadataBrowserPluginApi" section="def-common.InjectedMetadataSetup" text="InjectedMetadataSetup"/> | @kbn/core-injected-metadata-browser |

View file

@ -9,6 +9,21 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
---
## @kbn/core-http-browser-internal
| Deprecated API | Reference location(s) | Remove By |
| ---------------|-----------|-----------|
| <DocLink id="kibCorePluginApi" section="def-public.IHttpFetchError.req" text="req"/> | [http_fetch_error.ts](https://github.com/elastic/kibana/tree/master/packages/core/http/core-http-browser-internal/src/http_fetch_error.ts#:~:text=req), [http_fetch_error.ts](https://github.com/elastic/kibana/tree/master/packages/core/http/core-http-browser-internal/src/http_fetch_error.ts#:~:text=req) | 8.8.0
Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block,
so TS and code-reference navigation might not highlight them. |
| <DocLink id="kibCorePluginApi" section="def-public.IHttpFetchError.res" text="res"/> | [http_fetch_error.ts](https://github.com/elastic/kibana/tree/master/packages/core/http/core-http-browser-internal/src/http_fetch_error.ts#:~:text=res), [http_fetch_error.ts](https://github.com/elastic/kibana/tree/master/packages/core/http/core-http-browser-internal/src/http_fetch_error.ts#:~:text=res) | 8.8.0
Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block,
so TS and code-reference navigation might not highlight them. |
## actions
| Deprecated API | Reference location(s) | Remove By |

View file

@ -186,4 +186,19 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/
| --------|-------|-----------|-----------|
| visualizations | <DocLink id="kibSavedObjectsPluginApi" section="def-public.SavedObject" text="SavedObject"/> | [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject), [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject) | 8.8.0 |
| visualizations | <DocLink id="kibCorePluginApi" section="def-public.AppMountParameters.onAppLeave" text="onAppLeave"/> | [visualize_top_nav.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/components/visualize_top_nav.tsx#:~:text=onAppLeave), [visualize_editor_common.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/components/visualize_editor_common.tsx#:~:text=onAppLeave), [app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/app.tsx#:~:text=onAppLeave), [index.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/index.tsx#:~:text=onAppLeave), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/types.ts#:~:text=onAppLeave), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/types.ts#:~:text=onAppLeave), [mounter.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/mounter.tsx#:~:text=onAppLeave) | 8.8.0 |
| management | <DocLink id="kibCorePluginApi" section="def-public.AppMountParameters.appBasePath" text="appBasePath"/> | [application.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/management/public/application.tsx#:~:text=appBasePath) | 8.8.0 |
| management | <DocLink id="kibCorePluginApi" section="def-public.AppMountParameters.appBasePath" text="appBasePath"/> | [application.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/management/public/application.tsx#:~:text=appBasePath) | 8.8.0 |
## [Owner missing]
| Plugin | Deprecated API | Reference location(s) | Remove By |
| --------|-------|-----------|-----------|
| @kbn/core-http-browser-internal | <DocLink id="kibCorePluginApi" section="def-public.IHttpFetchError.req" text="req"/> | [http_fetch_error.ts](https://github.com/elastic/kibana/tree/master/packages/core/http/core-http-browser-internal/src/http_fetch_error.ts#:~:text=req), [http_fetch_error.ts](https://github.com/elastic/kibana/tree/master/packages/core/http/core-http-browser-internal/src/http_fetch_error.ts#:~:text=req) | 8.8.0
Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block,
so TS and code-reference navigation might not highlight them. |
| @kbn/core-http-browser-internal | <DocLink id="kibCorePluginApi" section="def-public.IHttpFetchError.res" text="res"/> | [http_fetch_error.ts](https://github.com/elastic/kibana/tree/master/packages/core/http/core-http-browser-internal/src/http_fetch_error.ts#:~:text=res), [http_fetch_error.ts](https://github.com/elastic/kibana/tree/master/packages/core/http/core-http-browser-internal/src/http_fetch_error.ts#:~:text=res) | 8.8.0
Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block,
so TS and code-reference navigation might not highlight them. |

View file

@ -530,13 +530,7 @@
"description": [],
"signature": [
"<D = any, E = any>(httpClient: ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
},
"HttpSetup",
", { path, method, body, query, asSystemRequest }: ",
{
"pluginId": "esUiShared",
@ -566,13 +560,7 @@
"label": "httpClient",
"description": [],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
}
"HttpSetup"
],
"path": "src/plugins/es_ui_shared/public/request/send_request.ts",
"deprecated": false,
@ -628,13 +616,7 @@
"description": [],
"signature": [
"<D = any, E = Error>(httpClient: ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
},
"HttpSetup",
", { path, method, query, body, pollIntervalMs, initialData, deserializer }: ",
{
"pluginId": "esUiShared",
@ -664,13 +646,7 @@
"label": "httpClient",
"description": [],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
}
"HttpSetup"
],
"path": "src/plugins/es_ui_shared/public/request/use_request.ts",
"deprecated": false,
@ -1252,13 +1228,7 @@
"label": "query",
"description": [],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpFetchQuery",
"text": "HttpFetchQuery"
},
"HttpFetchQuery",
" | undefined"
],
"path": "src/plugins/es_ui_shared/public/request/send_request.ts",

View file

@ -15873,13 +15873,7 @@
"text": "ListWithKuery"
},
" extends ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpFetchQuery",
"text": "HttpFetchQuery"
}
"HttpFetchQuery"
],
"path": "x-pack/plugins/fleet/common/types/rest_spec/common.ts",
"deprecated": false,

View file

@ -260,6 +260,9 @@
"description": [
"\nOptions for the Elastic V3 shipper"
],
"signature": [
"ElasticV3ShipperOptions"
],
"path": "node_modules/@types/kbn__analytics-shippers-elastic-v3-common/index.d.ts",
"deprecated": false,
"children": [

View file

@ -252,6 +252,9 @@
"description": [
"\nOptions for the Elastic V3 shipper"
],
"signature": [
"ElasticV3ShipperOptions"
],
"path": "node_modules/@types/kbn__analytics-shippers-elastic-v3-common/index.d.ts",
"deprecated": false,
"children": [

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,33 @@
---
id: kibKbnCoreHttpBrowserPluginApi
slug: /kibana-dev-docs/api/kbn-core-http-browser
title: "@kbn/core-http-browser"
image: https://source.unsplash.com/400x175/?github
summary: API docs for the @kbn/core-http-browser plugin
date: 2022-07-08
tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser']
warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info.
---
import kbnCoreHttpBrowserObj from './kbn_core_http_browser.devdocs.json';
Contact [Owner missing] for questions regarding this plugin.
**Code health stats**
| Public API count | Any count | Items lacking comments | Missing exports |
|-------------------|-----------|------------------------|-----------------|
| 111 | 4 | 37 | 0 |
## Common
### Functions
<DocDefinitionList data={kbnCoreHttpBrowserObj.common.functions}/>
### Interfaces
<DocDefinitionList data={kbnCoreHttpBrowserObj.common.interfaces}/>
### Consts, variables and types
<DocDefinitionList data={kbnCoreHttpBrowserObj.common.misc}/>

View file

@ -0,0 +1,185 @@
{
"id": "@kbn/core-http-browser-internal",
"client": {
"classes": [],
"functions": [],
"interfaces": [],
"enums": [],
"misc": [],
"objects": []
},
"server": {
"classes": [],
"functions": [],
"interfaces": [],
"enums": [],
"misc": [],
"objects": []
},
"common": {
"classes": [
{
"parentPluginId": "@kbn/core-http-browser-internal",
"id": "def-common.BasePath",
"type": "Class",
"tags": [],
"label": "BasePath",
"description": [],
"signature": [
{
"pluginId": "@kbn/core-http-browser-internal",
"scope": "common",
"docId": "kibKbnCoreHttpBrowserInternalPluginApi",
"section": "def-common.BasePath",
"text": "BasePath"
},
" implements ",
"IBasePath"
],
"path": "packages/core/http/core-http-browser-internal/src/base_path.ts",
"deprecated": false,
"children": [
{
"parentPluginId": "@kbn/core-http-browser-internal",
"id": "def-common.BasePath.Unnamed",
"type": "Function",
"tags": [],
"label": "Constructor",
"description": [],
"signature": [
"any"
],
"path": "packages/core/http/core-http-browser-internal/src/base_path.ts",
"deprecated": false,
"children": [
{
"parentPluginId": "@kbn/core-http-browser-internal",
"id": "def-common.BasePath.Unnamed.$1",
"type": "string",
"tags": [],
"label": "basePath",
"description": [],
"signature": [
"string"
],
"path": "packages/core/http/core-http-browser-internal/src/base_path.ts",
"deprecated": false,
"isRequired": true
},
{
"parentPluginId": "@kbn/core-http-browser-internal",
"id": "def-common.BasePath.Unnamed.$2",
"type": "string",
"tags": [],
"label": "serverBasePath",
"description": [],
"signature": [
"string"
],
"path": "packages/core/http/core-http-browser-internal/src/base_path.ts",
"deprecated": false,
"isRequired": true
},
{
"parentPluginId": "@kbn/core-http-browser-internal",
"id": "def-common.BasePath.Unnamed.$3",
"type": "string",
"tags": [],
"label": "publicBaseUrl",
"description": [],
"signature": [
"string | undefined"
],
"path": "packages/core/http/core-http-browser-internal/src/base_path.ts",
"deprecated": false,
"isRequired": false
}
],
"returnComment": []
},
{
"parentPluginId": "@kbn/core-http-browser-internal",
"id": "def-common.BasePath.get",
"type": "Function",
"tags": [],
"label": "get",
"description": [],
"signature": [
"() => string"
],
"path": "packages/core/http/core-http-browser-internal/src/base_path.ts",
"deprecated": false,
"children": [],
"returnComment": []
},
{
"parentPluginId": "@kbn/core-http-browser-internal",
"id": "def-common.BasePath.prepend",
"type": "Function",
"tags": [],
"label": "prepend",
"description": [],
"signature": [
"(path: string) => string"
],
"path": "packages/core/http/core-http-browser-internal/src/base_path.ts",
"deprecated": false,
"children": [
{
"parentPluginId": "@kbn/core-http-browser-internal",
"id": "def-common.BasePath.prepend.$1",
"type": "string",
"tags": [],
"label": "path",
"description": [],
"signature": [
"string"
],
"path": "packages/core/http/core-http-browser-internal/src/base_path.ts",
"deprecated": false,
"isRequired": true
}
],
"returnComment": []
},
{
"parentPluginId": "@kbn/core-http-browser-internal",
"id": "def-common.BasePath.remove",
"type": "Function",
"tags": [],
"label": "remove",
"description": [],
"signature": [
"(path: string) => string"
],
"path": "packages/core/http/core-http-browser-internal/src/base_path.ts",
"deprecated": false,
"children": [
{
"parentPluginId": "@kbn/core-http-browser-internal",
"id": "def-common.BasePath.remove.$1",
"type": "string",
"tags": [],
"label": "path",
"description": [],
"signature": [
"string"
],
"path": "packages/core/http/core-http-browser-internal/src/base_path.ts",
"deprecated": false,
"isRequired": true
}
],
"returnComment": []
}
],
"initialIsOpen": false
}
],
"functions": [],
"interfaces": [],
"enums": [],
"misc": [],
"objects": []
}
}

View file

@ -0,0 +1,27 @@
---
id: kibKbnCoreHttpBrowserInternalPluginApi
slug: /kibana-dev-docs/api/kbn-core-http-browser-internal
title: "@kbn/core-http-browser-internal"
image: https://source.unsplash.com/400x175/?github
summary: API docs for the @kbn/core-http-browser-internal plugin
date: 2022-07-08
tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-internal']
warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info.
---
import kbnCoreHttpBrowserInternalObj from './kbn_core_http_browser_internal.devdocs.json';
Contact [Owner missing] for questions regarding this plugin.
**Code health stats**
| Public API count | Any count | Items lacking comments | Missing exports |
|-------------------|-----------|------------------------|-----------------|
| 10 | 0 | 10 | 0 |
## Common
### Classes
<DocDefinitionList data={kbnCoreHttpBrowserInternalObj.common.classes}/>

View file

@ -0,0 +1,316 @@
{
"id": "@kbn/core-http-browser-mocks",
"client": {
"classes": [],
"functions": [],
"interfaces": [],
"enums": [],
"misc": [],
"objects": []
},
"server": {
"classes": [],
"functions": [],
"interfaces": [],
"enums": [],
"misc": [],
"objects": []
},
"common": {
"classes": [],
"functions": [
{
"parentPluginId": "@kbn/core-http-browser-mocks",
"id": "def-common.createHttpFetchError",
"type": "Function",
"tags": [],
"label": "createHttpFetchError",
"description": [],
"signature": [
"(message: string, name: string, request: Request, response: Response | undefined, body: TResponseBody | undefined) => ",
"IHttpFetchError",
"<unknown>"
],
"path": "packages/core/http/core-http-browser-mocks/src/fetch_error.mock.ts",
"deprecated": false,
"children": [
{
"parentPluginId": "@kbn/core-http-browser-mocks",
"id": "def-common.createHttpFetchError.$1",
"type": "string",
"tags": [],
"label": "message",
"description": [],
"signature": [
"string"
],
"path": "packages/core/http/core-http-browser-mocks/src/fetch_error.mock.ts",
"deprecated": false,
"isRequired": true
},
{
"parentPluginId": "@kbn/core-http-browser-mocks",
"id": "def-common.createHttpFetchError.$2",
"type": "string",
"tags": [],
"label": "name",
"description": [],
"signature": [
"string"
],
"path": "packages/core/http/core-http-browser-mocks/src/fetch_error.mock.ts",
"deprecated": false,
"isRequired": true
},
{
"parentPluginId": "@kbn/core-http-browser-mocks",
"id": "def-common.createHttpFetchError.$3",
"type": "Object",
"tags": [],
"label": "request",
"description": [],
"signature": [
"Request"
],
"path": "packages/core/http/core-http-browser-mocks/src/fetch_error.mock.ts",
"deprecated": false,
"isRequired": true
},
{
"parentPluginId": "@kbn/core-http-browser-mocks",
"id": "def-common.createHttpFetchError.$4",
"type": "Object",
"tags": [],
"label": "response",
"description": [],
"signature": [
"Response | undefined"
],
"path": "packages/core/http/core-http-browser-mocks/src/fetch_error.mock.ts",
"deprecated": false,
"isRequired": false
},
{
"parentPluginId": "@kbn/core-http-browser-mocks",
"id": "def-common.createHttpFetchError.$5",
"type": "Uncategorized",
"tags": [],
"label": "body",
"description": [],
"signature": [
"TResponseBody | undefined"
],
"path": "packages/core/http/core-http-browser-mocks/src/fetch_error.mock.ts",
"deprecated": false,
"isRequired": false
}
],
"returnComment": [],
"initialIsOpen": false
}
],
"interfaces": [],
"enums": [],
"misc": [
{
"parentPluginId": "@kbn/core-http-browser-mocks",
"id": "def-common.HttpSetupMock",
"type": "Type",
"tags": [],
"label": "HttpSetupMock",
"description": [],
"signature": [
"{ basePath: ",
"IBasePath",
"; anonymousPaths: ",
"IAnonymousPaths",
"; externalUrl: ",
"IExternalUrl",
"; intercept: jest.MockInstance<() => void, [interceptor: ",
"HttpInterceptor",
"]>; fetch: jest.MockInstance<Promise<unknown>, [options: ",
"HttpFetchOptionsWithPath",
"]>; delete: jest.MockInstance<Promise<unknown>, [options: ",
"HttpFetchOptionsWithPath",
"]>; get: jest.MockInstance<Promise<unknown>, [options: ",
"HttpFetchOptionsWithPath",
"]>; head: jest.MockInstance<Promise<unknown>, [options: ",
"HttpFetchOptionsWithPath",
"]>; options: jest.MockInstance<Promise<unknown>, [options: ",
"HttpFetchOptionsWithPath",
"]>; patch: jest.MockInstance<Promise<unknown>, [options: ",
"HttpFetchOptionsWithPath",
"]>; post: jest.MockInstance<Promise<unknown>, [options: ",
"HttpFetchOptionsWithPath",
"]>; put: jest.MockInstance<Promise<unknown>, [options: ",
"HttpFetchOptionsWithPath",
"]>; addLoadingCountSource: jest.MockInstance<void, [countSource$: ",
"Observable",
"<number>]>; getLoadingCount$: jest.MockInstance<",
"Observable",
"<number>, []>; } & ",
"HttpSetup",
" & { basePath: ",
"BasePath",
"; anonymousPaths: jest.Mocked<",
"IAnonymousPaths",
">; }"
],
"path": "packages/core/http/core-http-browser-mocks/src/http_service.mock.ts",
"deprecated": false,
"initialIsOpen": false
}
],
"objects": [
{
"parentPluginId": "@kbn/core-http-browser-mocks",
"id": "def-common.httpServiceMock",
"type": "Object",
"tags": [],
"label": "httpServiceMock",
"description": [],
"path": "packages/core/http/core-http-browser-mocks/src/http_service.mock.ts",
"deprecated": false,
"children": [
{
"parentPluginId": "@kbn/core-http-browser-mocks",
"id": "def-common.httpServiceMock.create",
"type": "Function",
"tags": [],
"label": "create",
"description": [],
"signature": [
"({ basePath }?: { basePath?: string | undefined; }) => jest.Mocked<",
"PublicMethodsOf",
"<",
"HttpService",
">>"
],
"path": "packages/core/http/core-http-browser-mocks/src/http_service.mock.ts",
"deprecated": false,
"returnComment": [],
"children": [
{
"parentPluginId": "@kbn/core-http-browser-mocks",
"id": "def-common.httpServiceMock.create.$1",
"type": "Object",
"tags": [],
"label": "__0",
"description": [],
"signature": [
"{ basePath?: string | undefined; }"
],
"path": "packages/core/http/core-http-browser-mocks/src/http_service.mock.ts",
"deprecated": false
}
]
},
{
"parentPluginId": "@kbn/core-http-browser-mocks",
"id": "def-common.httpServiceMock.createSetupContract",
"type": "Function",
"tags": [],
"label": "createSetupContract",
"description": [],
"signature": [
"({ basePath, publicBaseUrl, }?: { basePath?: string | undefined; publicBaseUrl?: string | undefined; }) => ",
{
"pluginId": "@kbn/core-http-browser-mocks",
"scope": "common",
"docId": "kibKbnCoreHttpBrowserMocksPluginApi",
"section": "def-common.HttpSetupMock",
"text": "HttpSetupMock"
}
],
"path": "packages/core/http/core-http-browser-mocks/src/http_service.mock.ts",
"deprecated": false,
"returnComment": [],
"children": [
{
"parentPluginId": "@kbn/core-http-browser-mocks",
"id": "def-common.httpServiceMock.createSetupContract.$1",
"type": "Object",
"tags": [],
"label": "__0",
"description": [],
"signature": [
"{ basePath?: string | undefined; publicBaseUrl?: string | undefined; }"
],
"path": "packages/core/http/core-http-browser-mocks/src/http_service.mock.ts",
"deprecated": false
}
]
},
{
"parentPluginId": "@kbn/core-http-browser-mocks",
"id": "def-common.httpServiceMock.createStartContract",
"type": "Function",
"tags": [],
"label": "createStartContract",
"description": [],
"signature": [
"({ basePath, publicBaseUrl, }?: { basePath?: string | undefined; publicBaseUrl?: string | undefined; }) => ",
{
"pluginId": "@kbn/core-http-browser-mocks",
"scope": "common",
"docId": "kibKbnCoreHttpBrowserMocksPluginApi",
"section": "def-common.HttpSetupMock",
"text": "HttpSetupMock"
}
],
"path": "packages/core/http/core-http-browser-mocks/src/http_service.mock.ts",
"deprecated": false,
"returnComment": [],
"children": [
{
"parentPluginId": "@kbn/core-http-browser-mocks",
"id": "def-common.httpServiceMock.createStartContract.$1",
"type": "Object",
"tags": [],
"label": "__0",
"description": [],
"signature": [
"{ basePath?: string | undefined; publicBaseUrl?: string | undefined; }"
],
"path": "packages/core/http/core-http-browser-mocks/src/http_service.mock.ts",
"deprecated": false
}
]
},
{
"parentPluginId": "@kbn/core-http-browser-mocks",
"id": "def-common.httpServiceMock.createBasePath",
"type": "Function",
"tags": [],
"label": "createBasePath",
"description": [],
"signature": [
"({ publicBaseUrl, serverBasePath, }?: { publicBaseUrl?: string | undefined; serverBasePath?: string | undefined; }) => jest.Mocked<",
"IBasePath",
">"
],
"path": "packages/core/http/core-http-browser-mocks/src/http_service.mock.ts",
"deprecated": false,
"returnComment": [],
"children": [
{
"parentPluginId": "@kbn/core-http-browser-mocks",
"id": "def-common.httpServiceMock.createBasePath.$1",
"type": "Object",
"tags": [],
"label": "__0",
"description": [],
"signature": [
"{ publicBaseUrl?: string | undefined; serverBasePath?: string | undefined; }"
],
"path": "packages/core/http/core-http-browser-mocks/src/base_path.mock.ts",
"deprecated": false
}
]
}
],
"initialIsOpen": false
}
]
}
}

View file

@ -0,0 +1,33 @@
---
id: kibKbnCoreHttpBrowserMocksPluginApi
slug: /kibana-dev-docs/api/kbn-core-http-browser-mocks
title: "@kbn/core-http-browser-mocks"
image: https://source.unsplash.com/400x175/?github
summary: API docs for the @kbn/core-http-browser-mocks plugin
date: 2022-07-08
tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-mocks']
warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info.
---
import kbnCoreHttpBrowserMocksObj from './kbn_core_http_browser_mocks.devdocs.json';
Contact [Owner missing] for questions regarding this plugin.
**Code health stats**
| Public API count | Any count | Items lacking comments | Missing exports |
|-------------------|-----------|------------------------|-----------------|
| 16 | 0 | 16 | 0 |
## Common
### Objects
<DocDefinitionList data={kbnCoreHttpBrowserMocksObj.common.objects}/>
### Functions
<DocDefinitionList data={kbnCoreHttpBrowserMocksObj.common.functions}/>
### Consts, variables and types
<DocDefinitionList data={kbnCoreHttpBrowserMocksObj.common.misc}/>

View file

@ -0,0 +1,85 @@
{
"id": "@kbn/core-http-common",
"client": {
"classes": [],
"functions": [],
"interfaces": [],
"enums": [],
"misc": [],
"objects": []
},
"server": {
"classes": [],
"functions": [],
"interfaces": [],
"enums": [],
"misc": [],
"objects": []
},
"common": {
"classes": [],
"functions": [],
"interfaces": [
{
"parentPluginId": "@kbn/core-http-common",
"id": "def-common.IExternalUrlPolicy",
"type": "Interface",
"tags": [],
"label": "IExternalUrlPolicy",
"description": [
"\nA policy describing whether access to an external destination is allowed."
],
"path": "packages/core/http/core-http-common/src/external_url_policy.ts",
"deprecated": false,
"children": [
{
"parentPluginId": "@kbn/core-http-common",
"id": "def-common.IExternalUrlPolicy.allow",
"type": "boolean",
"tags": [],
"label": "allow",
"description": [
"\nIndicates if this policy allows or denies access to the described destination."
],
"path": "packages/core/http/core-http-common/src/external_url_policy.ts",
"deprecated": false
},
{
"parentPluginId": "@kbn/core-http-common",
"id": "def-common.IExternalUrlPolicy.host",
"type": "string",
"tags": [],
"label": "host",
"description": [
"\nOptional host describing the external destination.\nMay be combined with `protocol`.\n"
],
"signature": [
"string | undefined"
],
"path": "packages/core/http/core-http-common/src/external_url_policy.ts",
"deprecated": false
},
{
"parentPluginId": "@kbn/core-http-common",
"id": "def-common.IExternalUrlPolicy.protocol",
"type": "string",
"tags": [],
"label": "protocol",
"description": [
"\nOptional protocol describing the external destination.\nMay be combined with `host`.\n"
],
"signature": [
"string | undefined"
],
"path": "packages/core/http/core-http-common/src/external_url_policy.ts",
"deprecated": false
}
],
"initialIsOpen": false
}
],
"enums": [],
"misc": [],
"objects": []
}
}

View file

@ -0,0 +1,27 @@
---
id: kibKbnCoreHttpCommonPluginApi
slug: /kibana-dev-docs/api/kbn-core-http-common
title: "@kbn/core-http-common"
image: https://source.unsplash.com/400x175/?github
summary: API docs for the @kbn/core-http-common plugin
date: 2022-07-08
tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-common']
warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info.
---
import kbnCoreHttpCommonObj from './kbn_core_http_common.devdocs.json';
Contact [Owner missing] for questions regarding this plugin.
**Code health stats**
| Public API count | Any count | Items lacking comments | Missing exports |
|-------------------|-----------|------------------------|-----------------|
| 4 | 0 | 0 | 0 |
## Common
### Interfaces
<DocDefinitionList data={kbnCoreHttpCommonObj.common.interfaces}/>

View file

@ -0,0 +1,182 @@
{
"id": "@kbn/crypto-browser",
"client": {
"classes": [],
"functions": [],
"interfaces": [],
"enums": [],
"misc": [],
"objects": []
},
"server": {
"classes": [],
"functions": [],
"interfaces": [],
"enums": [],
"misc": [],
"objects": []
},
"common": {
"classes": [
{
"parentPluginId": "@kbn/crypto-browser",
"id": "def-common.Sha256",
"type": "Class",
"tags": [],
"label": "Sha256",
"description": [],
"path": "packages/kbn-crypto-browser/src/sha256.ts",
"deprecated": false,
"children": [
{
"parentPluginId": "@kbn/crypto-browser",
"id": "def-common.Sha256.Unnamed",
"type": "Function",
"tags": [],
"label": "Constructor",
"description": [],
"signature": [
"any"
],
"path": "packages/kbn-crypto-browser/src/sha256.ts",
"deprecated": false,
"children": [],
"returnComment": []
},
{
"parentPluginId": "@kbn/crypto-browser",
"id": "def-common.Sha256.update",
"type": "Function",
"tags": [],
"label": "update",
"description": [],
"signature": [
"(data: string | Buffer, encoding?: BufferEncoding | undefined) => ",
{
"pluginId": "@kbn/crypto-browser",
"scope": "common",
"docId": "kibKbnCryptoBrowserPluginApi",
"section": "def-common.Sha256",
"text": "Sha256"
}
],
"path": "packages/kbn-crypto-browser/src/sha256.ts",
"deprecated": false,
"children": [
{
"parentPluginId": "@kbn/crypto-browser",
"id": "def-common.Sha256.update.$1",
"type": "CompoundType",
"tags": [],
"label": "data",
"description": [],
"signature": [
"string | Buffer"
],
"path": "packages/kbn-crypto-browser/src/sha256.ts",
"deprecated": false,
"isRequired": true
},
{
"parentPluginId": "@kbn/crypto-browser",
"id": "def-common.Sha256.update.$2",
"type": "CompoundType",
"tags": [],
"label": "encoding",
"description": [],
"signature": [
"BufferEncoding | undefined"
],
"path": "packages/kbn-crypto-browser/src/sha256.ts",
"deprecated": false,
"isRequired": false
}
],
"returnComment": []
},
{
"parentPluginId": "@kbn/crypto-browser",
"id": "def-common.Sha256.digest",
"type": "Function",
"tags": [],
"label": "digest",
"description": [],
"signature": [
"(encoding: BufferEncoding) => string"
],
"path": "packages/kbn-crypto-browser/src/sha256.ts",
"deprecated": false,
"children": [
{
"parentPluginId": "@kbn/crypto-browser",
"id": "def-common.Sha256.digest.$1",
"type": "CompoundType",
"tags": [],
"label": "encoding",
"description": [],
"signature": [
"BufferEncoding"
],
"path": "packages/kbn-crypto-browser/src/sha256.ts",
"deprecated": false,
"isRequired": true
}
],
"returnComment": []
},
{
"parentPluginId": "@kbn/crypto-browser",
"id": "def-common.Sha256._update",
"type": "Function",
"tags": [],
"label": "_update",
"description": [],
"signature": [
"(M: Buffer) => void"
],
"path": "packages/kbn-crypto-browser/src/sha256.ts",
"deprecated": false,
"children": [
{
"parentPluginId": "@kbn/crypto-browser",
"id": "def-common.Sha256._update.$1",
"type": "Object",
"tags": [],
"label": "M",
"description": [],
"signature": [
"Buffer"
],
"path": "packages/kbn-crypto-browser/src/sha256.ts",
"deprecated": false,
"isRequired": true
}
],
"returnComment": []
},
{
"parentPluginId": "@kbn/crypto-browser",
"id": "def-common.Sha256._hash",
"type": "Function",
"tags": [],
"label": "_hash",
"description": [],
"signature": [
"() => Buffer"
],
"path": "packages/kbn-crypto-browser/src/sha256.ts",
"deprecated": false,
"children": [],
"returnComment": []
}
],
"initialIsOpen": false
}
],
"functions": [],
"interfaces": [],
"enums": [],
"misc": [],
"objects": []
}
}

View file

@ -0,0 +1,27 @@
---
id: kibKbnCryptoBrowserPluginApi
slug: /kibana-dev-docs/api/kbn-crypto-browser
title: "@kbn/crypto-browser"
image: https://source.unsplash.com/400x175/?github
summary: API docs for the @kbn/crypto-browser plugin
date: 2022-07-08
tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto-browser']
warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info.
---
import kbnCryptoBrowserObj from './kbn_crypto_browser.devdocs.json';
Contact [Owner missing] for questions regarding this plugin.
**Code health stats**
| Public API count | Any count | Items lacking comments | Missing exports |
|-------------------|-----------|------------------------|-----------------|
| 10 | 0 | 10 | 0 |
## Common
### Classes
<DocDefinitionList data={kbnCryptoBrowserObj.common.classes}/>

View file

@ -108,6 +108,9 @@
"description": [
"\nThe interface for Storybook configuration in `main.ts` files."
],
"signature": [
"StorybookConfig"
],
"path": "node_modules/@storybook/core-common/dist/ts3.9/types.d.ts",
"deprecated": false,
"children": [

View file

@ -3775,8 +3775,8 @@
"label": "fetchError",
"description": [],
"signature": [
"HttpFetchError",
" | undefined"
"IHttpFetchError",
"<Error> | undefined"
],
"path": "src/plugins/kibana_react/public/table_list_view/table_list_view.tsx",
"deprecated": false
@ -4353,13 +4353,7 @@
" | undefined; executionContext?: ",
"ExecutionContextSetup",
" | undefined; http?: ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
},
"HttpSetup",
" | undefined; savedObjects?: ",
{
"pluginId": "core",

View file

@ -3360,13 +3360,7 @@
"text": "NavigateToAppOptions"
},
" | undefined) => Promise<void>; basePath: ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.IBasePath",
"text": "IBasePath"
},
"IBasePath",
"; mapping: string | Mapping; toastNotifications: ",
{
"pluginId": "core",
@ -3484,13 +3478,7 @@
"label": "basePath",
"description": [],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.IBasePath",
"text": "IBasePath"
}
"IBasePath"
],
"path": "src/plugins/kibana_utils/public/history/redirect_when_missing.tsx",
"deprecated": false

View file

@ -4401,6 +4401,9 @@
"tags": [],
"label": "METRIC_TYPE",
"description": [],
"signature": [
"METRIC_TYPE"
],
"path": "node_modules/@types/kbn__analytics/index.d.ts",
"deprecated": false,
"initialIsOpen": false
@ -4516,6 +4519,9 @@
"tags": [],
"label": "DropResult",
"description": [],
"signature": [
"DropResult"
],
"path": "x-pack/plugins/observability/public/typings/eui_draggable/index.ts",
"deprecated": false,
"initialIsOpen": false

View file

@ -12,13 +12,13 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| Count | Plugins or Packages with a <br /> public API | Number of teams |
|--------------|----------|------------------------|
| 324 | 266 | 36 |
| 328 | 270 | 36 |
### Public API health stats
| API Count | Any Count | Missing comments | Missing exports |
|--------------|----------|-----------------|--------|
| 26847 | 172 | 19400 | 1322 |
| 26915 | 172 | 19367 | 887 |
## Plugin Directory
@ -38,7 +38,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| <DocLink id="kibCloudSecurityPosturePluginApi" text="cloudSecurityPosture"/> | [Cloud Security Posture](https://github.com/orgs/elastic/teams/cloud-posture-security) | The cloud security posture plugin | 6 | 0 | 6 | 0 |
| <DocLink id="kibConsolePluginApi" text="console"/> | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 13 | 0 | 13 | 1 |
| <DocLink id="kibControlsPluginApi" text="controls"/> | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Controls Plugin contains embeddable components intended to create a simple query interface for end users, and a powerful editing suite that allows dashboard authors to build controls | 206 | 0 | 198 | 7 |
| <DocLink id="kibCorePluginApi" text="core"/> | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 2506 | 14 | 887 | 27 |
| <DocLink id="kibCorePluginApi" text="core"/> | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 2498 | 10 | 852 | 26 |
| crossClusterReplication | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 |
| <DocLink id="kibCustomIntegrationsPluginApi" text="customIntegrations"/> | [Fleet](https://github.com/orgs/elastic/teams/fleet) | Add custom data integrations so they can be displayed in the Fleet integrations app | 101 | 0 | 82 | 1 |
| <DocLink id="kibDashboardPluginApi" text="dashboard"/> | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds the Dashboard app to Kibana | 143 | 0 | 141 | 12 |
@ -221,6 +221,10 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| <DocLink id="kibKbnCoreExecutionContextServerMocksPluginApi" text="@kbn/core-execution-context-server-mocks"/> | [Owner missing] | - | 5 | 0 | 5 | 0 |
| <DocLink id="kibKbnCoreFatalErrorsBrowserPluginApi" text="@kbn/core-fatal-errors-browser"/> | [Owner missing] | - | 9 | 0 | 2 | 0 |
| <DocLink id="kibKbnCoreFatalErrorsBrowserMocksPluginApi" text="@kbn/core-fatal-errors-browser-mocks"/> | [Owner missing] | - | 4 | 0 | 4 | 0 |
| <DocLink id="kibKbnCoreHttpBrowserPluginApi" text="@kbn/core-http-browser"/> | [Owner missing] | - | 111 | 4 | 37 | 0 |
| <DocLink id="kibKbnCoreHttpBrowserInternalPluginApi" text="@kbn/core-http-browser-internal"/> | [Owner missing] | - | 10 | 0 | 10 | 0 |
| <DocLink id="kibKbnCoreHttpBrowserMocksPluginApi" text="@kbn/core-http-browser-mocks"/> | [Owner missing] | - | 16 | 0 | 16 | 0 |
| <DocLink id="kibKbnCoreHttpCommonPluginApi" text="@kbn/core-http-common"/> | [Owner missing] | - | 4 | 0 | 0 | 0 |
| <DocLink id="kibKbnCoreI18nBrowserPluginApi" text="@kbn/core-i18n-browser"/> | [Owner missing] | - | 4 | 0 | 2 | 0 |
| <DocLink id="kibKbnCoreI18nBrowserMocksPluginApi" text="@kbn/core-i18n-browser-mocks"/> | [Owner missing] | - | 3 | 0 | 3 | 0 |
| <DocLink id="kibKbnCoreInjectedMetadataBrowserPluginApi" text="@kbn/core-injected-metadata-browser"/> | [Owner missing] | - | 8 | 2 | 6 | 0 |
@ -235,6 +239,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| <DocLink id="kibKbnCoreThemeBrowserInternalPluginApi" text="@kbn/core-theme-browser-internal"/> | [Owner missing] | - | 2 | 0 | 1 | 0 |
| <DocLink id="kibKbnCoreThemeBrowserMocksPluginApi" text="@kbn/core-theme-browser-mocks"/> | [Owner missing] | - | 6 | 0 | 6 | 0 |
| <DocLink id="kibKbnCryptoPluginApi" text="@kbn/crypto"/> | [Owner missing] | - | 13 | 0 | 7 | 0 |
| <DocLink id="kibKbnCryptoBrowserPluginApi" text="@kbn/crypto-browser"/> | [Owner missing] | - | 10 | 0 | 10 | 0 |
| <DocLink id="kibKbnDatemathPluginApi" text="@kbn/datemath"/> | [Owner missing] | elasticsearch datemath parser, used in kibana | 44 | 0 | 43 | 0 |
| <DocLink id="kibKbnDevCliErrorsPluginApi" text="@kbn/dev-cli-errors"/> | [Owner missing] | - | 9 | 1 | 9 | 0 |
| <DocLink id="kibKbnDevCliRunnerPluginApi" text="@kbn/dev-cli-runner"/> | [Owner missing] | - | 65 | 0 | 64 | 0 |

View file

@ -33,13 +33,7 @@
"label": "http",
"description": [],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
}
"HttpSetup"
],
"path": "x-pack/plugins/spaces/public/spaces_manager/spaces_manager.ts",
"deprecated": false,

View file

@ -353,13 +353,7 @@
"description": [],
"signature": [
"({\n ids,\n http,\n}: { ids: string[]; http: ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
},
"HttpSetup",
"; }) => Promise<{ successes: string[]; errors: string[]; }>"
],
"path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/delete.ts",
@ -396,13 +390,7 @@
"label": "http",
"description": [],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
}
"HttpSetup"
],
"path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/delete.ts",
"deprecated": false
@ -422,13 +410,7 @@
"description": [],
"signature": [
"({ id, http }: { id: string; http: ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
},
"HttpSetup",
"; }) => Promise<void>"
],
"path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/disable.ts",
@ -462,13 +444,7 @@
"label": "http",
"description": [],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
}
"HttpSetup"
],
"path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/disable.ts",
"deprecated": false
@ -520,13 +496,7 @@
"description": [],
"signature": [
"({ id, http }: { id: string; http: ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
},
"HttpSetup",
"; }) => Promise<void>"
],
"path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/enable.ts",
@ -560,13 +530,7 @@
"label": "http",
"description": [],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
}
"HttpSetup"
],
"path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/enable.ts",
"deprecated": false
@ -618,13 +582,7 @@
"description": [],
"signature": [
"(http: ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
},
"HttpSetup",
", indexes: string[]) => Promise<{ name: string; type: string; normalizedType: string; searchable: boolean; aggregatable: boolean; }[]>"
],
"path": "x-pack/plugins/triggers_actions_ui/public/common/index_controls/index.ts",
@ -638,13 +596,7 @@
"label": "http",
"description": [],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
}
"HttpSetup"
],
"path": "x-pack/plugins/triggers_actions_ui/public/common/index_controls/index.ts",
"deprecated": false,
@ -677,13 +629,7 @@
"description": [],
"signature": [
"(http: ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
},
"HttpSetup",
", pattern: string) => Promise<",
"IOption",
"[]>"
@ -699,13 +645,7 @@
"label": "http",
"description": [],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
}
"HttpSetup"
],
"path": "x-pack/plugins/triggers_actions_ui/public/common/index_controls/index.ts",
"deprecated": false,
@ -878,13 +818,7 @@
"description": [],
"signature": [
"({ http }: { http: ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
},
"HttpSetup",
"; }) => Promise<",
{
"pluginId": "actions",
@ -916,13 +850,7 @@
"label": "http",
"description": [],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
}
"HttpSetup"
],
"path": "x-pack/plugins/triggers_actions_ui/public/application/lib/action_connector_api/connector_types.ts",
"deprecated": false
@ -942,13 +870,7 @@
"description": [],
"signature": [
"({ http }: { http: ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
},
"HttpSetup",
"; }) => Promise<",
{
"pluginId": "triggersActionsUi",
@ -980,13 +902,7 @@
"label": "http",
"description": [],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
}
"HttpSetup"
],
"path": "x-pack/plugins/triggers_actions_ui/public/application/lib/action_connector_api/connectors.ts",
"deprecated": false
@ -1008,13 +924,7 @@
"({ id, http, dateStart, dateEnd, filter, perPage, page, sort, }: ",
"LoadExecutionLogAggregationsProps",
" & { http: ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
},
"HttpSetup",
"; }) => Promise<",
{
"pluginId": "alerting",
@ -1038,13 +948,7 @@
"signature": [
"LoadExecutionLogAggregationsProps",
" & { http: ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
},
"HttpSetup",
"; }"
],
"path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_execution_log_aggregations.ts",
@ -1064,13 +968,7 @@
"description": [],
"signature": [
"({\n http,\n ruleId,\n}: { http: ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
},
"HttpSetup",
"; ruleId: string; }) => Promise<",
{
"pluginId": "triggersActionsUi",
@ -1110,13 +1008,7 @@
"label": "http",
"description": [],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
}
"HttpSetup"
],
"path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/get_rule.ts",
"deprecated": false
@ -1230,13 +1122,7 @@
"description": [],
"signature": [
"({\n http,\n ruleId,\n numberOfExecutions,\n}: { http: ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
},
"HttpSetup",
"; ruleId: string; numberOfExecutions?: number | undefined; }) => Promise<",
{
"pluginId": "alerting",
@ -1268,13 +1154,7 @@
"label": "http",
"description": [],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
}
"HttpSetup"
],
"path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rule_summary.ts",
"deprecated": false
@ -1317,13 +1197,7 @@
"description": [],
"signature": [
"({ http }: { http: ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
},
"HttpSetup",
"; }) => Promise<",
"RuleTagsAggregations",
">"
@ -1349,13 +1223,7 @@
"label": "http",
"description": [],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
}
"HttpSetup"
],
"path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/aggregate.ts",
"deprecated": false
@ -1375,13 +1243,7 @@
"description": [],
"signature": [
"({ http }: { http: ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
},
"HttpSetup",
"; }) => Promise<",
{
"pluginId": "triggersActionsUi",
@ -1413,13 +1275,7 @@
"label": "http",
"description": [],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
}
"HttpSetup"
],
"path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rule_types.ts",
"deprecated": false
@ -1439,13 +1295,7 @@
"description": [],
"signature": [
"({ id, http }: { id: string; http: ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
},
"HttpSetup",
"; }) => Promise<void>"
],
"path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/mute.ts",
@ -1479,13 +1329,7 @@
"label": "http",
"description": [],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
}
"HttpSetup"
],
"path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/mute.ts",
"deprecated": false
@ -1539,13 +1383,7 @@
"({\n id,\n snoozeSchedule,\n http,\n}: { id: string; snoozeSchedule: ",
"SnoozeSchedule",
"; http: ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
},
"HttpSetup",
"; }) => Promise<void>"
],
"path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/snooze.ts",
@ -1592,13 +1430,7 @@
"label": "http",
"description": [],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
}
"HttpSetup"
],
"path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/snooze.ts",
"deprecated": false
@ -1695,13 +1527,7 @@
"description": [],
"signature": [
"({ id, http }: { id: string; http: ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
},
"HttpSetup",
"; }) => Promise<void>"
],
"path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/unmute.ts",
@ -1735,13 +1561,7 @@
"label": "http",
"description": [],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
}
"HttpSetup"
],
"path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/unmute.ts",
"deprecated": false
@ -1761,13 +1581,7 @@
"description": [],
"signature": [
"({\n id,\n http,\n scheduleIds,\n}: { id: string; http: ",
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
},
"HttpSetup",
"; scheduleIds?: string[] | undefined; }) => Promise<void>"
],
"path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/unsnooze.ts",
@ -1801,13 +1615,7 @@
"label": "http",
"description": [],
"signature": [
{
"pluginId": "core",
"scope": "public",
"docId": "kibCoreHttpPluginApi",
"section": "def-public.HttpSetup",
"text": "HttpSetup"
}
"HttpSetup"
],
"path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/unsnooze.ts",
"deprecated": false

View file

@ -17,7 +17,7 @@ import {
EuiText,
} from '@elastic/eui';
import React, { useEffect, useState } from 'react';
import type { HttpSetup, IHttpFetchError, ResponseErrorBody } from '@kbn/core/public';
import type { HttpSetup, IHttpFetchError, ResponseErrorBody } from '@kbn/core-http-browser';
export const App = ({ http, token }: { http: HttpSetup; token?: string }) => {
const onCompleteSetup = async ({ shouldReloadConfig }: { shouldReloadConfig: boolean }) => {

View file

@ -16,8 +16,7 @@ import {
EuiCallOut,
EuiFormRow,
} from '@elastic/eui';
import { HttpFetchError } from '@kbn/core/public';
import { isError } from './is_error';
import { type IHttpFetchError, isHttpFetchError } from '@kbn/core-http-browser';
import { Services } from './services';
interface Props {
@ -25,7 +24,7 @@ interface Props {
}
export function GetMessageRouteExample({ getMessageById }: Props) {
const [error, setError] = useState<HttpFetchError | undefined>();
const [error, setError] = useState<IHttpFetchError | undefined>();
const [isFetching, setIsFetching] = useState<boolean>(false);
const [message, setMessage] = useState<string>('');
const [id, setId] = useState<string>('');
@ -35,7 +34,7 @@ export function GetMessageRouteExample({ getMessageById }: Props) {
setIsFetching(true);
const response = await getMessageById(id);
if (isError(response)) {
if (isHttpFetchError(response)) {
setError(response);
setMessage('');
} else {

View file

@ -17,8 +17,7 @@ import {
EuiFormRow,
EuiTextArea,
} from '@elastic/eui';
import { HttpFetchError } from '@kbn/core/public';
import { isError } from './is_error';
import { type IHttpFetchError, isHttpFetchError } from '@kbn/core-http-browser';
import { Services } from './services';
interface Props {
@ -27,7 +26,7 @@ interface Props {
}
export function PostMessageRouteExample({ postMessage, addSuccessToast }: Props) {
const [error, setError] = useState<HttpFetchError | undefined>();
const [error, setError] = useState<IHttpFetchError | undefined>();
const [isPosting, setIsPosting] = useState<boolean>(false);
const [message, setMessage] = useState<string>('');
const [id, setId] = useState<string>('');
@ -37,7 +36,7 @@ export function PostMessageRouteExample({ postMessage, addSuccessToast }: Props)
setIsPosting(true);
const response = await postMessage(message, id);
if (response && isError(response)) {
if (response && isHttpFetchError(response)) {
setError(response);
} else {
setError(undefined);

View file

@ -16,8 +16,7 @@ import {
EuiCallOut,
EuiFormRow,
} from '@elastic/eui';
import { HttpFetchError } from '@kbn/core/public';
import { isError } from './is_error';
import { type IHttpFetchError, isHttpFetchError } from '@kbn/core-http-browser';
import { Services } from './services';
interface Props {
@ -25,7 +24,7 @@ interface Props {
}
export function RandomNumberBetweenRouteExample({ fetchRandomNumberBetween }: Props) {
const [error, setError] = useState<HttpFetchError | undefined>();
const [error, setError] = useState<IHttpFetchError | undefined>();
const [randomNumber, setRandomNumber] = useState<number>(0);
const [isFetching, setIsFetching] = useState<boolean>(false);
const [maxInput, setMaxInput] = useState<string>('10');
@ -35,7 +34,7 @@ export function RandomNumberBetweenRouteExample({ fetchRandomNumberBetween }: Pr
setIsFetching(true);
const response = await fetchRandomNumberBetween(Number.parseInt(maxInput, 10));
if (isError(response)) {
if (isHttpFetchError(response)) {
setError(response);
} else {
setRandomNumber(response);

View file

@ -9,16 +9,15 @@
import React, { useCallback } from 'react';
import { useState } from 'react';
import { EuiText, EuiButton, EuiLoadingSpinner, EuiCallOut } from '@elastic/eui';
import { HttpFetchError } from '@kbn/core/public';
import { type IHttpFetchError, isHttpFetchError } from '@kbn/core-http-browser';
import { Services } from './services';
import { isError } from './is_error';
interface Props {
fetchRandomNumber: Services['fetchRandomNumber'];
}
export function RandomNumberRouteExample({ fetchRandomNumber }: Props) {
const [error, setError] = useState<HttpFetchError | undefined>(undefined);
const [error, setError] = useState<IHttpFetchError | undefined>(undefined);
const [randomNumber, setRandomNumber] = useState<number>(0);
const [isFetching, setIsFetching] = useState<boolean>(false);
@ -27,7 +26,7 @@ export function RandomNumberRouteExample({ fetchRandomNumber }: Props) {
setIsFetching(true);
const response = await fetchRandomNumber();
if (isError(response)) {
if (isHttpFetchError(response)) {
setError(response);
} else {
setRandomNumber(response);

View file

@ -6,7 +6,8 @@
* Side Public License, v 1.
*/
import { CoreStart, HttpFetchError } from '@kbn/core/public';
import type { CoreStart } from '@kbn/core/public';
import type { IHttpFetchError } from '@kbn/core-http-browser';
import {
RANDOM_NUMBER_ROUTE_PATH,
RANDOM_NUMBER_BETWEEN_ROUTE_PATH,
@ -15,10 +16,10 @@ import {
} from '../common';
export interface Services {
fetchRandomNumber: () => Promise<number | HttpFetchError>;
fetchRandomNumberBetween: (max: number) => Promise<number | HttpFetchError>;
postMessage: (message: string, id: string) => Promise<undefined | HttpFetchError>;
getMessageById: (id: string) => Promise<string | HttpFetchError>;
fetchRandomNumber: () => Promise<number | IHttpFetchError>;
fetchRandomNumberBetween: (max: number) => Promise<number | IHttpFetchError>;
postMessage: (message: string, id: string) => Promise<undefined | IHttpFetchError>;
getMessageById: (id: string) => Promise<string | IHttpFetchError>;
addSuccessToast: (message: string) => void;
}

View file

@ -176,6 +176,10 @@
"@kbn/core-fatal-errors-browser": "link:bazel-bin/packages/core/fatal-errors/core-fatal-errors-browser",
"@kbn/core-fatal-errors-browser-internal": "link:bazel-bin/packages/core/fatal-errors/core-fatal-errors-browser-internal",
"@kbn/core-fatal-errors-browser-mocks": "link:bazel-bin/packages/core/fatal-errors/core-fatal-errors-browser-mocks",
"@kbn/core-http-browser": "link:bazel-bin/packages/core/http/core-http-browser",
"@kbn/core-http-browser-internal": "link:bazel-bin/packages/core/http/core-http-browser-internal",
"@kbn/core-http-browser-mocks": "link:bazel-bin/packages/core/http/core-http-browser-mocks",
"@kbn/core-http-common": "link:bazel-bin/packages/core/http/core-http-common",
"@kbn/core-http-server": "link:bazel-bin/packages/core/http/core-http-server",
"@kbn/core-i18n-browser": "link:bazel-bin/packages/core/i18n/core-i18n-browser",
"@kbn/core-i18n-browser-internal": "link:bazel-bin/packages/core/i18n/core-i18n-browser-internal",
@ -197,6 +201,7 @@
"@kbn/core-theme-browser-internal": "link:bazel-bin/packages/core/theme/core-theme-browser-internal",
"@kbn/core-theme-browser-mocks": "link:bazel-bin/packages/core/theme/core-theme-browser-mocks",
"@kbn/crypto": "link:bazel-bin/packages/kbn-crypto",
"@kbn/crypto-browser": "link:bazel-bin/packages/kbn-crypto-browser",
"@kbn/datemath": "link:bazel-bin/packages/kbn-datemath",
"@kbn/doc-links": "link:bazel-bin/packages/kbn-doc-links",
"@kbn/es-errors": "link:bazel-bin/packages/kbn-es-errors",
@ -736,6 +741,10 @@
"@types/kbn__core-fatal-errors-browser": "link:bazel-bin/packages/core/fatal-errors/core-fatal-errors-browser/npm_module_types",
"@types/kbn__core-fatal-errors-browser-internal": "link:bazel-bin/packages/core/fatal-errors/core-fatal-errors-browser-internal/npm_module_types",
"@types/kbn__core-fatal-errors-browser-mocks": "link:bazel-bin/packages/core/fatal-errors/core-fatal-errors-browser-mocks/npm_module_types",
"@types/kbn__core-http-browser": "link:bazel-bin/packages/core/http/core-http-browser/npm_module_types",
"@types/kbn__core-http-browser-internal": "link:bazel-bin/packages/core/http/core-http-browser-internal/npm_module_types",
"@types/kbn__core-http-browser-mocks": "link:bazel-bin/packages/core/http/core-http-browser-mocks/npm_module_types",
"@types/kbn__core-http-common": "link:bazel-bin/packages/core/http/core-http-common/npm_module_types",
"@types/kbn__core-http-server": "link:bazel-bin/packages/core/http/core-http-server/npm_module_types",
"@types/kbn__core-i18n-browser": "link:bazel-bin/packages/core/i18n/core-i18n-browser/npm_module_types",
"@types/kbn__core-i18n-browser-internal": "link:bazel-bin/packages/core/i18n/core-i18n-browser-internal/npm_module_types",
@ -759,6 +768,7 @@
"@types/kbn__core-theme-browser-internal": "link:bazel-bin/packages/core/theme/core-theme-browser-internal/npm_module_types",
"@types/kbn__core-theme-browser-mocks": "link:bazel-bin/packages/core/theme/core-theme-browser-mocks/npm_module_types",
"@types/kbn__crypto": "link:bazel-bin/packages/kbn-crypto/npm_module_types",
"@types/kbn__crypto-browser": "link:bazel-bin/packages/kbn-crypto-browser/npm_module_types",
"@types/kbn__datemath": "link:bazel-bin/packages/kbn-datemath/npm_module_types",
"@types/kbn__dev-cli-errors": "link:bazel-bin/packages/kbn-dev-cli-errors/npm_module_types",
"@types/kbn__dev-cli-runner": "link:bazel-bin/packages/kbn-dev-cli-runner/npm_module_types",

View file

@ -45,6 +45,10 @@ filegroup(
"//packages/core/fatal-errors/core-fatal-errors-browser-internal:build",
"//packages/core/fatal-errors/core-fatal-errors-browser-mocks:build",
"//packages/core/fatal-errors/core-fatal-errors-browser:build",
"//packages/core/http/core-http-browser-internal:build",
"//packages/core/http/core-http-browser-mocks:build",
"//packages/core/http/core-http-browser:build",
"//packages/core/http/core-http-common:build",
"//packages/core/http/core-http-server:build",
"//packages/core/i18n/core-i18n-browser-internal:build",
"//packages/core/i18n/core-i18n-browser-mocks:build",
@ -88,6 +92,7 @@ filegroup(
"//packages/kbn-config-mocks:build",
"//packages/kbn-config-schema:build",
"//packages/kbn-config:build",
"//packages/kbn-crypto-browser:build",
"//packages/kbn-crypto:build",
"//packages/kbn-datemath:build",
"//packages/kbn-dev-cli-errors:build",
@ -230,6 +235,10 @@ filegroup(
"//packages/core/fatal-errors/core-fatal-errors-browser-internal:build_types",
"//packages/core/fatal-errors/core-fatal-errors-browser-mocks:build_types",
"//packages/core/fatal-errors/core-fatal-errors-browser:build_types",
"//packages/core/http/core-http-browser-internal:build_types",
"//packages/core/http/core-http-browser-mocks:build_types",
"//packages/core/http/core-http-browser:build_types",
"//packages/core/http/core-http-common:build_types",
"//packages/core/http/core-http-server:build_types",
"//packages/core/i18n/core-i18n-browser-internal:build_types",
"//packages/core/i18n/core-i18n-browser-mocks:build_types",
@ -269,6 +278,7 @@ filegroup(
"//packages/kbn-config-mocks:build_types",
"//packages/kbn-config-schema:build_types",
"//packages/kbn-config:build_types",
"//packages/kbn-crypto-browser:build_types",
"//packages/kbn-crypto:build_types",
"//packages/kbn-datemath:build_types",
"//packages/kbn-dev-cli-errors:build_types",

View file

@ -0,0 +1,119 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")
PKG_DIRNAME = "core-http-browser-internal"
PKG_REQUIRE_NAME = "@kbn/core-http-browser-internal"
SOURCE_FILES = glob(
[
"src/**/*.ts",
"src/**/*.tsx",
],
exclude = [
"**/*.test.*",
"**/*.story.*",
],
)
SRCS = SOURCE_FILES
filegroup(
name = "srcs",
srcs = SRCS,
)
NPM_MODULE_EXTRA_FILES = [
"package.json",
]
RUNTIME_DEPS = [
"@npm//lodash",
"@npm//rxjs",
"//packages/core/execution-context/core-execution-context-browser-internal",
"//packages/core/injected-metadata/core-injected-metadata-browser-mocks",
"//packages/kbn-crypto-browser",
"//packages/kbn-std",
]
TYPES_DEPS = [
"@npm//@types/node",
"@npm//@types/jest",
"//packages/core/base/core-base-browser-internal:npm_module_types",
"//packages/core/http/core-http-browser:npm_module_types",
"//packages/core/http/core-http-common:npm_module_types",
"//packages/core/execution-context/core-execution-context-browser-internal:npm_module_types",
"//packages/core/execution-context/core-execution-context-browser:npm_module_types",
"//packages/core/fatal-errors/core-fatal-errors-browser:npm_module_types",
"//packages/core/injected-metadata/core-injected-metadata-browser-internal:npm_module_types",
"//packages/kbn-crypto-browser:npm_module_types",
"//packages/kbn-std:npm_module_types",
]
jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
)
jsts_transpiler(
name = "target_web",
srcs = SRCS,
build_pkg_name = package_name(),
web = True,
)
ts_config(
name = "tsconfig",
src = "tsconfig.json",
deps = [
"//:tsconfig.base.json",
"//:tsconfig.bazel.json",
],
)
ts_project(
name = "tsc_types",
args = ['--pretty'],
srcs = SRCS,
deps = TYPES_DEPS,
declaration = True,
emit_declaration_only = True,
out_dir = "target_types",
root_dir = "src",
tsconfig = ":tsconfig",
)
js_library(
name = PKG_DIRNAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = RUNTIME_DEPS + [":target_node", ":target_web"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
pkg_npm(
name = "npm_module",
deps = [":" + PKG_DIRNAME],
)
filegroup(
name = "build",
srcs = [":npm_module"],
visibility = ["//visibility:public"],
)
pkg_npm_types(
name = "npm_module_types",
srcs = SRCS,
deps = [":tsc_types"],
package_name = PKG_REQUIRE_NAME,
tsconfig = ":tsconfig",
visibility = ["//visibility:public"],
)
filegroup(
name = "build_types",
srcs = [":npm_module_types"],
visibility = ["//visibility:public"],
)

View file

@ -0,0 +1,3 @@
# @kbn/core-http-browser-internal
This package contains the internal types and implementation for Core's browser-side HTTP service.

View file

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

View file

@ -0,0 +1,8 @@
{
"name": "@kbn/core-http-browser-internal",
"private": true,
"version": "1.0.0",
"main": "./target_node/index.js",
"browser": "./target_web/index.js",
"license": "SSPL-1.0 OR Elastic License 2.0"
}

View file

@ -7,7 +7,7 @@
*/
import type { CoreService } from '@kbn/core-base-browser-internal';
import { IAnonymousPaths, IBasePath } from '..';
import type { IAnonymousPaths, IBasePath } from '@kbn/core-http-browser';
interface Deps {
basePath: IBasePath;

View file

@ -6,9 +6,10 @@
* Side Public License, v 1.
*/
import { IBasePath } from '@kbn/core-http-browser';
import { modifyUrl } from '@kbn/std';
export class BasePath {
export class BasePath implements IBasePath {
constructor(
private readonly basePath: string = '',
public readonly serverBasePath: string = basePath,

View file

@ -6,10 +6,9 @@
* Side Public License, v 1.
*/
import { ExternalUrlConfig } from '../../server/types';
import { injectedMetadataServiceMock } from '../mocks';
import { Sha256 } from '../utils';
import { Sha256 } from '@kbn/crypto-browser';
import type { IExternalUrlPolicy } from '@kbn/core-http-common';
import { injectedMetadataServiceMock } from '@kbn/core-injected-metadata-browser-mocks';
import { ExternalUrlService } from './external_url_service';
@ -20,7 +19,7 @@ const setupService = ({
}: {
location: URL;
serverBasePath: string;
policy: ExternalUrlConfig['policy'];
policy: IExternalUrlPolicy[];
}) => {
const hashedPolicies = policy.map((entry) => {
// If the host contains a `[`, then it's likely an IPv6 address. Otherwise, append a `.` if it doesn't already contain one

View file

@ -6,11 +6,11 @@
* Side Public License, v 1.
*/
import { Sha256 } from '@kbn/crypto-browser';
import type { CoreService } from '@kbn/core-base-browser-internal';
import type { IExternalUrl } from '@kbn/core-http-browser';
import type { IExternalUrlPolicy } from '@kbn/core-http-common';
import type { InternalInjectedMetadataSetup } from '@kbn/core-injected-metadata-browser-internal';
import { IExternalUrlPolicy } from '../../server/types';
import { IExternalUrl } from './types';
import { Sha256 } from '../utils';
interface SetupDeps {
location: Pick<Location, 'href'>;

View file

@ -12,10 +12,10 @@ import { readFileSync } from 'fs';
import { join } from 'path';
import { first } from 'rxjs/operators';
import { executionContextServiceMock } from '@kbn/core-execution-context-browser-mocks';
import type { HttpResponse, HttpFetchOptionsWithPath } from '@kbn/core-http-browser';
import { Fetch } from './fetch';
import { BasePath } from './base_path';
import { HttpResponse, HttpFetchOptionsWithPath } from './types';
function delay<T>(duration: number) {
return new Promise<T>((r) => setTimeout(r, duration));

View file

@ -18,7 +18,7 @@ import type {
HttpFetchOptions,
HttpResponse,
HttpFetchOptionsWithPath,
} from './types';
} from '@kbn/core-http-browser';
import { HttpFetchError } from './http_fetch_error';
import { HttpInterceptController } from './http_intercept_controller';
import { interceptRequest, interceptResponse } from './intercept';

View file

@ -6,7 +6,7 @@
* Side Public License, v 1.
*/
import { IHttpFetchError } from './types';
import type { IHttpFetchError } from '@kbn/core-http-browser';
/** @internal */
export class HttpFetchError extends Error implements IHttpFetchError {

View file

@ -6,7 +6,7 @@
* Side Public License, v 1.
*/
import { IHttpInterceptController } from './types';
import type { IHttpInterceptController } from '@kbn/core-http-browser';
/** @internal */
export class HttpInterceptController implements IHttpInterceptController {

View file

@ -10,7 +10,7 @@ import type { CoreService } from '@kbn/core-base-browser-internal';
import type { ExecutionContextSetup } from '@kbn/core-execution-context-browser';
import type { InternalInjectedMetadataSetup } from '@kbn/core-injected-metadata-browser-internal';
import type { FatalErrorsSetup } from '@kbn/core-fatal-errors-browser';
import { HttpSetup, HttpStart } from './types';
import type { HttpSetup, HttpStart } from '@kbn/core-http-browser';
import { BasePath } from './base_path';
import { AnonymousPathsService } from './anonymous_paths_service';
import { LoadingCountService } from './loading_count_service';

View file

@ -6,6 +6,5 @@
* Side Public License, v 1.
*/
export { BasePath } from './base_path';
export { HttpService } from './http_service';
export { HttpFetchError } from './http_fetch_error';
export * from './types';

View file

@ -6,9 +6,13 @@
* Side Public License, v 1.
*/
import type {
HttpInterceptor,
HttpResponse,
HttpFetchOptionsWithPath,
} from '@kbn/core-http-browser';
import { HttpInterceptController } from './http_intercept_controller';
import { HttpInterceptHaltError } from './http_intercept_halt_error';
import { HttpInterceptor, HttpResponse, HttpFetchOptionsWithPath } from './types';
export async function interceptRequest(
options: HttpFetchOptionsWithPath,

View file

@ -6,9 +6,9 @@
* Side Public License, v 1.
*/
import { LoadingCountSetup, LoadingCountService } from './loading_count_service';
import { BehaviorSubject } from 'rxjs';
import type { PublicMethodsOf } from '@kbn/utility-types';
import type { LoadingCountSetup, LoadingCountService } from './loading_count_service';
const createSetupContractMock = () => {
const setupContract: jest.Mocked<LoadingCountSetup> = {

View file

@ -0,0 +1,17 @@
{
"extends": "../../../../tsconfig.bazel.json",
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "target_types",
"rootDir": "src",
"stripInternal": false,
"types": [
"jest",
"node"
]
},
"include": [
"src/**/*"
]
}

View file

@ -0,0 +1,109 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")
PKG_DIRNAME = "core-http-browser-mocks"
PKG_REQUIRE_NAME = "@kbn/core-http-browser-mocks"
SOURCE_FILES = glob(
[
"src/**/*.ts",
"src/**/*.tsx",
],
exclude = [
"**/*.test.*",
"**/*.story.*",
],
)
SRCS = SOURCE_FILES
filegroup(
name = "srcs",
srcs = SRCS,
)
NPM_MODULE_EXTRA_FILES = [
"package.json",
]
RUNTIME_DEPS = [
"@npm//rxjs",
"//packages/core/http/core-http-browser-internal",
]
TYPES_DEPS = [
"@npm//@types/node",
"@npm//@types/jest",
"//packages/kbn-utility-types:npm_module_types",
"//packages/core/http/core-http-browser-internal:npm_module_types",
"//packages/core/http/core-http-browser:npm_module_types",
]
jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
)
jsts_transpiler(
name = "target_web",
srcs = SRCS,
build_pkg_name = package_name(),
web = True,
)
ts_config(
name = "tsconfig",
src = "tsconfig.json",
deps = [
"//:tsconfig.base.json",
"//:tsconfig.bazel.json",
],
)
ts_project(
name = "tsc_types",
args = ['--pretty'],
srcs = SRCS,
deps = TYPES_DEPS,
declaration = True,
emit_declaration_only = True,
out_dir = "target_types",
root_dir = "src",
tsconfig = ":tsconfig",
)
js_library(
name = PKG_DIRNAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = RUNTIME_DEPS + [":target_node", ":target_web"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
pkg_npm(
name = "npm_module",
deps = [":" + PKG_DIRNAME],
)
filegroup(
name = "build",
srcs = [":npm_module"],
visibility = ["//visibility:public"],
)
pkg_npm_types(
name = "npm_module_types",
srcs = SRCS,
deps = [":tsc_types"],
package_name = PKG_REQUIRE_NAME,
tsconfig = ":tsconfig",
visibility = ["//visibility:public"],
)
filegroup(
name = "build_types",
srcs = [":npm_module_types"],
visibility = ["//visibility:public"],
)

View file

@ -0,0 +1,3 @@
# @kbn/core-http-browser-mocks
This package contains useful mocks for Core's HTTP browser-side packages.

View file

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

View file

@ -0,0 +1,8 @@
{
"name": "@kbn/core-http-browser-mocks",
"private": true,
"version": "1.0.0",
"main": "./target_node/index.js",
"browser": "./target_web/index.js",
"license": "SSPL-1.0 OR Elastic License 2.0"
}

View file

@ -6,7 +6,7 @@
* Side Public License, v 1.
*/
import { IBasePath } from './types';
import type { IBasePath } from '@kbn/core-http-browser';
const createBasePathMock = ({
publicBaseUrl = '/',

View file

@ -0,0 +1,26 @@
/*
* 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 { IHttpFetchError } from '@kbn/core-http-browser';
export function createHttpFetchError<TResponseBody>(
message: string,
name: string = 'error',
request = {} as Request,
response?: Response,
body?: TResponseBody
): IHttpFetchError {
return Object.assign(new Error(message), {
name,
request,
response,
req: request,
res: response,
body,
});
}

View file

@ -6,11 +6,10 @@
* Side Public License, v 1.
*/
import type { PublicMethodsOf } from '@kbn/utility-types';
import { HttpService } from './http_service';
import { HttpSetup } from './types';
import { BehaviorSubject } from 'rxjs';
import { BasePath } from './base_path';
import { type HttpService, BasePath } from '@kbn/core-http-browser-internal';
import type { HttpSetup } from '@kbn/core-http-browser';
import type { PublicMethodsOf } from '@kbn/utility-types';
import { basePathMock } from './base_path.mock';
export type HttpSetupMock = jest.Mocked<HttpSetup> & {

View file

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

View file

@ -0,0 +1,17 @@
{
"extends": "../../../../tsconfig.bazel.json",
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "target_types",
"rootDir": "src",
"stripInternal": false,
"types": [
"jest",
"node"
]
},
"include": [
"src/**/*"
]
}

View file

@ -0,0 +1,105 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")
PKG_DIRNAME = "core-http-browser"
PKG_REQUIRE_NAME = "@kbn/core-http-browser"
SOURCE_FILES = glob(
[
"src/**/*.ts",
"src/**/*.tsx",
],
exclude = [
"**/*.test.*",
],
)
SRCS = SOURCE_FILES
filegroup(
name = "srcs",
srcs = SRCS,
)
NPM_MODULE_EXTRA_FILES = [
"package.json",
]
RUNTIME_DEPS = [
]
TYPES_DEPS = [
"@npm//@types/node",
"@npm//rxjs",
"//packages/kbn-utility-types:npm_module_types",
"//packages/core/execution-context/core-execution-context-common:npm_module_types",
]
jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
)
jsts_transpiler(
name = "target_web",
srcs = SRCS,
build_pkg_name = package_name(),
web = True,
)
ts_config(
name = "tsconfig",
src = "tsconfig.json",
deps = [
"//:tsconfig.base.json",
"//:tsconfig.bazel.json",
],
)
ts_project(
name = "tsc_types",
args = ['--pretty'],
srcs = SRCS,
deps = TYPES_DEPS,
declaration = True,
emit_declaration_only = True,
out_dir = "target_types",
root_dir = "src",
tsconfig = ":tsconfig",
)
js_library(
name = PKG_DIRNAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = RUNTIME_DEPS + [":target_node", ":target_web"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
pkg_npm(
name = "npm_module",
deps = [":" + PKG_DIRNAME],
)
filegroup(
name = "build",
srcs = [":npm_module"],
visibility = ["//visibility:public"],
)
pkg_npm_types(
name = "npm_module_types",
srcs = SRCS,
deps = [":tsc_types"],
package_name = PKG_REQUIRE_NAME,
tsconfig = ":tsconfig",
visibility = ["//visibility:public"],
)
filegroup(
name = "build_types",
srcs = [":npm_module_types"],
visibility = ["//visibility:public"],
)

View file

@ -0,0 +1,3 @@
# @kbn/core-http-browser
This package contains the public types for Core's browser-side HTTP service.

View file

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

View file

@ -0,0 +1,8 @@
{
"name": "@kbn/core-http-browser",
"private": true,
"version": "1.0.0",
"main": "./target_node/index.js",
"browser": "./target_web/index.js",
"license": "SSPL-1.0 OR Elastic License 2.0"
}

View file

@ -0,0 +1,31 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
export type {
HttpSetup,
HttpStart,
IBasePath,
IExternalUrl,
IAnonymousPaths,
HttpHeadersInit,
HttpRequestInit,
HttpFetchQuery,
HttpFetchOptions,
HttpFetchOptionsWithPath,
HttpHandler,
HttpResponse,
IHttpResponseInterceptorOverrides,
ResponseErrorBody,
IHttpFetchError,
HttpInterceptorResponseError,
HttpInterceptorRequestError,
HttpInterceptor,
IHttpInterceptController,
} from './types';
export { isHttpFetchError } from './utils';

View file

@ -6,8 +6,8 @@
* Side Public License, v 1.
*/
import { Observable } from 'rxjs';
import { MaybePromise } from '@kbn/utility-types';
import type { Observable } from 'rxjs';
import type { MaybePromise } from '@kbn/utility-types';
import type { KibanaExecutionContext } from '@kbn/core-execution-context-common';
/** @public */

View file

@ -0,0 +1,14 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import type { IHttpFetchError } from './types';
/** @public */
export function isHttpFetchError<T>(error: T | IHttpFetchError): error is IHttpFetchError {
return error instanceof Error && ('request' in error || 'req' in error) && 'name' in error;
}

View file

@ -0,0 +1,17 @@
{
"extends": "../../../../tsconfig.bazel.json",
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "target_types",
"rootDir": "src",
"stripInternal": false,
"types": [
"jest",
"node"
]
},
"include": [
"src/**/*"
]
}

View file

@ -0,0 +1,104 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")
PKG_DIRNAME = "core-http-common"
PKG_REQUIRE_NAME = "@kbn/core-http-common"
SOURCE_FILES = glob(
[
"src/**/*.ts",
"src/**/*.tsx",
],
exclude = [
"**/*.test.*",
"**/*.story.*",
],
)
SRCS = SOURCE_FILES
filegroup(
name = "srcs",
srcs = SRCS,
)
NPM_MODULE_EXTRA_FILES = [
"package.json",
]
RUNTIME_DEPS = [
]
TYPES_DEPS = [
"@npm//@types/node",
"@npm//@types/jest",
]
jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
)
jsts_transpiler(
name = "target_web",
srcs = SRCS,
build_pkg_name = package_name(),
web = True,
)
ts_config(
name = "tsconfig",
src = "tsconfig.json",
deps = [
"//:tsconfig.base.json",
"//:tsconfig.bazel.json",
],
)
ts_project(
name = "tsc_types",
args = ['--pretty'],
srcs = SRCS,
deps = TYPES_DEPS,
declaration = True,
emit_declaration_only = True,
out_dir = "target_types",
root_dir = "src",
tsconfig = ":tsconfig",
)
js_library(
name = PKG_DIRNAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = RUNTIME_DEPS + [":target_node", ":target_web"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
pkg_npm(
name = "npm_module",
deps = [":" + PKG_DIRNAME],
)
filegroup(
name = "build",
srcs = [":npm_module"],
visibility = ["//visibility:public"],
)
pkg_npm_types(
name = "npm_module_types",
srcs = SRCS,
deps = [":tsc_types"],
package_name = PKG_REQUIRE_NAME,
tsconfig = ":tsconfig",
visibility = ["//visibility:public"],
)
filegroup(
name = "build_types",
srcs = [":npm_module_types"],
visibility = ["//visibility:public"],
)

View file

@ -0,0 +1,3 @@
# @kbn/core-http-common
This package contains the common types for Core's HTTP service and utils.

View file

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

View file

@ -0,0 +1,8 @@
{
"name": "@kbn/core-http-common",
"private": true,
"version": "1.0.0",
"main": "./target_node/index.js",
"browser": "./target_web/index.js",
"license": "SSPL-1.0 OR Elastic License 2.0"
}

View file

@ -0,0 +1,44 @@
/*
* 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.
*/
/**
* A policy describing whether access to an external destination is allowed.
* @public
*/
export interface IExternalUrlPolicy {
/**
* Indicates if this policy allows or denies access to the described destination.
*/
allow: boolean;
/**
* Optional host describing the external destination.
* May be combined with `protocol`.
*
* @example
* ```ts
* // allows access to all of google.com, using any protocol.
* allow: true,
* host: 'google.com'
* ```
*/
host?: string;
/**
* Optional protocol describing the external destination.
* May be combined with `host`.
*
* @example
* ```ts
* // allows access to all destinations over the `https` protocol.
* allow: true,
* protocol: 'https'
* ```
*/
protocol?: string;
}

View file

@ -6,8 +6,4 @@
* Side Public License, v 1.
*/
import { HttpFetchError } from '@kbn/core/public';
export function isError<T>(error: T | HttpFetchError): error is HttpFetchError {
return error instanceof HttpFetchError;
}
export type { IExternalUrlPolicy } from './external_url_policy';

View file

@ -0,0 +1,17 @@
{
"extends": "../../../../tsconfig.bazel.json",
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "target_types",
"rootDir": "src",
"stripInternal": false,
"types": [
"jest",
"node"
]
},
"include": [
"src/**/*"
]
}

View file

@ -39,7 +39,8 @@ TYPES_DEPS = [
"@npm//@hapi/boom",
"//packages/kbn-config-schema:npm_module_types",
"//packages/kbn-utility-types:npm_module_types",
"//packages/core/base/core-base-common:npm_module_types"
"//packages/core/base/core-base-common:npm_module_types",
"//packages/core/http/core-http-common:npm_module_types"
]
jsts_transpiler(

View file

@ -6,6 +6,8 @@
* Side Public License, v 1.
*/
import type { IExternalUrlPolicy } from '@kbn/core-http-common';
/**
* External Url configuration for use in Kibana.
* @public
@ -16,40 +18,3 @@ export interface IExternalUrlConfig {
*/
readonly policy: IExternalUrlPolicy[];
}
/**
* A policy describing whether access to an external destination is allowed.
* @public
*/
export interface IExternalUrlPolicy {
/**
* Indicates if this policy allows or denies access to the described destination.
*/
allow: boolean;
/**
* Optional host describing the external destination.
* May be combined with `protocol`.
*
* @example
* ```ts
* // allows access to all of google.com, using any protocol.
* allow: true,
* host: 'google.com'
* ```
*/
host?: string;
/**
* Optional protocol describing the external destination.
* May be combined with `host`.
*
* @example
* ```ts
* // allows access to all destinations over the `https` protocol.
* allow: true,
* protocol: 'https'
* ```
*/
protocol?: string;
}

View file

@ -102,7 +102,7 @@ export { validBodyOutput, RouteValidationError } from './router';
export type { ICspConfig } from './csp';
export type { IExternalUrlPolicy, IExternalUrlConfig } from './external_url';
export type { IExternalUrlConfig } from './external_url';
export type { IBasePath } from './base_path';

View file

@ -0,0 +1,104 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")
PKG_DIRNAME = "kbn-crypto-browser"
PKG_REQUIRE_NAME = "@kbn/crypto-browser"
SOURCE_FILES = glob(
[
"src/**/*.ts",
"src/**/*.tsx",
],
exclude = [
"**/*.test.*",
"**/*.story.*",
],
)
SRCS = SOURCE_FILES
filegroup(
name = "srcs",
srcs = SRCS,
)
NPM_MODULE_EXTRA_FILES = [
"package.json",
]
RUNTIME_DEPS = [
]
TYPES_DEPS = [
"@npm//@types/node",
"@npm//@types/jest",
]
jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
)
jsts_transpiler(
name = "target_web",
srcs = SRCS,
build_pkg_name = package_name(),
web = True,
)
ts_config(
name = "tsconfig",
src = "tsconfig.json",
deps = [
"//:tsconfig.base.json",
"//:tsconfig.bazel.json",
],
)
ts_project(
name = "tsc_types",
args = ['--pretty'],
srcs = SRCS,
deps = TYPES_DEPS,
declaration = True,
emit_declaration_only = True,
out_dir = "target_types",
root_dir = "src",
tsconfig = ":tsconfig",
)
js_library(
name = PKG_DIRNAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = RUNTIME_DEPS + [":target_node", ":target_web"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
pkg_npm(
name = "npm_module",
deps = [":" + PKG_DIRNAME],
)
filegroup(
name = "build",
srcs = [":npm_module"],
visibility = ["//visibility:public"],
)
pkg_npm_types(
name = "npm_module_types",
srcs = SRCS,
deps = [":tsc_types"],
package_name = PKG_REQUIRE_NAME,
tsconfig = ":tsconfig",
visibility = ["//visibility:public"],
)
filegroup(
name = "build_types",
srcs = [":npm_module_types"],
visibility = ["//visibility:public"],
)

View file

@ -0,0 +1,3 @@
# @kbn/crypto-browser
Crypto tools and utilities for Kibana, browser-side

View file

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

View file

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

Some files were not shown because too many files have changed in this diff Show more