PluginInitializer
. |
| [PluginInitializerContext](./kibana-plugin-public.plugininitializercontext.md) | The available core services passed to a PluginInitializer
|
| [SavedObject](./kibana-plugin-public.savedobject.md) | |
-| [SavedObjectAttributes](./kibana-plugin-public.savedobjectattributes.md) | The data for a Saved Object is stored in the attributes
key as either an object or an array of objects. |
+| [SavedObjectAttributes](./kibana-plugin-public.savedobjectattributes.md) | The data for a Saved Object is stored as an object in the attributes
property. |
| [SavedObjectReference](./kibana-plugin-public.savedobjectreference.md) | A reference to another saved object. |
| [SavedObjectsBaseOptions](./kibana-plugin-public.savedobjectsbaseoptions.md) | |
| [SavedObjectsBatchResponse](./kibana-plugin-public.savedobjectsbatchresponse.md) | |
@@ -104,7 +104,8 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [PluginInitializer](./kibana-plugin-public.plugininitializer.md) | The plugin
export at the root of a plugin's public
directory should conform to this interface. |
| [PluginOpaqueId](./kibana-plugin-public.pluginopaqueid.md) | |
| [RecursiveReadonly](./kibana-plugin-public.recursivereadonly.md) | |
-| [SavedObjectAttribute](./kibana-plugin-public.savedobjectattribute.md) | |
+| [SavedObjectAttribute](./kibana-plugin-public.savedobjectattribute.md) | Type definition for a Saved Object attribute value |
+| [SavedObjectAttributeSingle](./kibana-plugin-public.savedobjectattributesingle.md) | Don't use this type, it's simply a helper type for [SavedObjectAttribute](./kibana-plugin-public.savedobjectattribute.md) |
| [SavedObjectsClientContract](./kibana-plugin-public.savedobjectsclientcontract.md) | SavedObjectsClientContract as implemented by the [SavedObjectsClient](./kibana-plugin-public.savedobjectsclient.md) |
| [ToastInput](./kibana-plugin-public.toastinput.md) | |
| [UiSettingsClientContract](./kibana-plugin-public.uisettingsclientcontract.md) | [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) |
diff --git a/docs/development/core/public/kibana-plugin-public.savedobject.attributes.md b/docs/development/core/public/kibana-plugin-public.savedobject.attributes.md
index f9d39c15fcff4..0ec57d679920c 100644
--- a/docs/development/core/public/kibana-plugin-public.savedobject.attributes.md
+++ b/docs/development/core/public/kibana-plugin-public.savedobject.attributes.md
@@ -4,7 +4,7 @@
## SavedObject.attributes property
-The data for a Saved Object is stored in the `attributes` key as either an object or an array of objects.
+The data for a Saved Object is stored as an object in the `attributes` property.
Signature:
diff --git a/docs/development/core/public/kibana-plugin-public.savedobject.md b/docs/development/core/public/kibana-plugin-public.savedobject.md
index 9bf0149f0854e..00260c62dd934 100644
--- a/docs/development/core/public/kibana-plugin-public.savedobject.md
+++ b/docs/development/core/public/kibana-plugin-public.savedobject.md
@@ -15,7 +15,7 @@ export interface SavedObjectT
| The data for a Saved Object is stored in the attributes
key as either an object or an array of objects. |
+| [attributes](./kibana-plugin-public.savedobject.attributes.md) | T
| The data for a Saved Object is stored as an object in the attributes
property. |
| [error](./kibana-plugin-public.savedobject.error.md) | {
message: string;
statusCode: number;
}
| |
| [id](./kibana-plugin-public.savedobject.id.md) | string
| The ID of this Saved Object, guaranteed to be unique for all objects of the same type
|
| [migrationVersion](./kibana-plugin-public.savedobject.migrationversion.md) | SavedObjectsMigrationVersion
| Information about the migrations that have been applied to this SavedObject. When Kibana starts up, KibanaMigrator detects outdated documents and migrates them based on this value. For each migration that has been applied, the plugin's name is used as a key and the latest migration version as the value. |
diff --git a/docs/development/core/public/kibana-plugin-public.savedobjectattribute.md b/docs/development/core/public/kibana-plugin-public.savedobjectattribute.md
index f8d51390863eb..5ce6a60f76c79 100644
--- a/docs/development/core/public/kibana-plugin-public.savedobjectattribute.md
+++ b/docs/development/core/public/kibana-plugin-public.savedobjectattribute.md
@@ -4,9 +4,10 @@
## SavedObjectAttribute type
+Type definition for a Saved Object attribute value
Signature:
```typescript
-export declare type SavedObjectAttribute = string | number | boolean | null | undefined | SavedObjectAttributes | SavedObjectAttributes[];
+export declare type SavedObjectAttribute = SavedObjectAttributeSingle | SavedObjectAttributeSingle[];
```
diff --git a/docs/development/core/public/kibana-plugin-public.savedobjectattributes.md b/docs/development/core/public/kibana-plugin-public.savedobjectattributes.md
index 4a9e096cc25b7..39c02216f4827 100644
--- a/docs/development/core/public/kibana-plugin-public.savedobjectattributes.md
+++ b/docs/development/core/public/kibana-plugin-public.savedobjectattributes.md
@@ -4,7 +4,7 @@
## SavedObjectAttributes interface
-The data for a Saved Object is stored in the `attributes` key as either an object or an array of objects.
+The data for a Saved Object is stored as an object in the `attributes` property.
Signature:
diff --git a/docs/development/core/public/kibana-plugin-public.savedobjectattributesingle.md b/docs/development/core/public/kibana-plugin-public.savedobjectattributesingle.md
new file mode 100644
index 0000000000000..3f2d70baa64e6
--- /dev/null
+++ b/docs/development/core/public/kibana-plugin-public.savedobjectattributesingle.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [SavedObjectAttributeSingle](./kibana-plugin-public.savedobjectattributesingle.md)
+
+## SavedObjectAttributeSingle type
+
+Don't use this type, it's simply a helper type for [SavedObjectAttribute](./kibana-plugin-public.savedobjectattribute.md)
+
+Signature:
+
+```typescript
+export declare type SavedObjectAttributeSingle = string | number | boolean | null | undefined | SavedObjectAttributes;
+```
diff --git a/docs/development/core/server/kibana-plugin-server.md b/docs/development/core/server/kibana-plugin-server.md
index 1247c52a5704b..02bbd028ac419 100644
--- a/docs/development/core/server/kibana-plugin-server.md
+++ b/docs/development/core/server/kibana-plugin-server.md
@@ -76,7 +76,7 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [RouteConfig](./kibana-plugin-server.routeconfig.md) | Route specific configuration. |
| [RouteConfigOptions](./kibana-plugin-server.routeconfigoptions.md) | Additional route options. |
| [SavedObject](./kibana-plugin-server.savedobject.md) | |
-| [SavedObjectAttributes](./kibana-plugin-server.savedobjectattributes.md) | The data for a Saved Object is stored in the attributes
key as either an object or an array of objects. |
+| [SavedObjectAttributes](./kibana-plugin-server.savedobjectattributes.md) | The data for a Saved Object is stored as an object in the attributes
property. |
| [SavedObjectReference](./kibana-plugin-server.savedobjectreference.md) | A reference to another saved object. |
| [SavedObjectsBaseOptions](./kibana-plugin-server.savedobjectsbaseoptions.md) | |
| [SavedObjectsBulkCreateObject](./kibana-plugin-server.savedobjectsbulkcreateobject.md) | |
@@ -152,7 +152,8 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [ResponseErrorAttributes](./kibana-plugin-server.responseerrorattributes.md) | Additional data to provide error details. |
| [ResponseHeaders](./kibana-plugin-server.responseheaders.md) | Http response headers to set. |
| [RouteMethod](./kibana-plugin-server.routemethod.md) | The set of common HTTP methods supported by Kibana routing. |
-| [SavedObjectAttribute](./kibana-plugin-server.savedobjectattribute.md) | |
+| [SavedObjectAttribute](./kibana-plugin-server.savedobjectattribute.md) | Type definition for a Saved Object attribute value |
+| [SavedObjectAttributeSingle](./kibana-plugin-server.savedobjectattributesingle.md) | Don't use this type, it's simply a helper type for [SavedObjectAttribute](./kibana-plugin-server.savedobjectattribute.md) |
| [SavedObjectsClientContract](./kibana-plugin-server.savedobjectsclientcontract.md) | Saved Objects is Kibana's data persisentence mechanism allowing plugins to use Elasticsearch for storing plugin state.\#\# SavedObjectsClient errorsSince the SavedObjectsClient has its hands in everything we are a little paranoid about the way we present errors back to to application code. Ideally, all errors will be either:1. Caused by bad implementation (ie. undefined is not a function) and as such unpredictable 2. An error that has been classified and decorated appropriately by the decorators in [SavedObjectsErrorHelpers](./kibana-plugin-server.savedobjectserrorhelpers.md)Type 1 errors are inevitable, but since all expected/handle-able errors should be Type 2 the isXYZError()
helpers exposed at SavedObjectsErrorHelpers
should be used to understand and manage error responses from the SavedObjectsClient
.Type 2 errors are decorated versions of the source error, so if the elasticsearch client threw an error it will be decorated based on its type. That means that rather than looking for error.body.error.type
or doing substring checks on error.body.error.reason
, just use the helpers to understand the meaning of the error:\`\`\`js if (SavedObjectsErrorHelpers.isNotFoundError(error)) { // handle 404 }if (SavedObjectsErrorHelpers.isNotAuthorizedError(error)) { // 401 handling should be automatic, but in case you wanted to know }// always rethrow the error unless you handle it throw error; \`\`\`\#\#\# 404s from missing indexFrom the perspective of application code and APIs the SavedObjectsClient is a black box that persists objects. One of the internal details that users have no control over is that we use an elasticsearch index for persistance and that index might be missing.At the time of writing we are in the process of transitioning away from the operating assumption that the SavedObjects index is always available. Part of this transition is handling errors resulting from an index missing. These used to trigger a 500 error in most cases, and in others cause 404s with different error messages.From my (Spencer) perspective, a 404 from the SavedObjectsApi is a 404; The object the request/call was targeting could not be found. This is why \#14141 takes special care to ensure that 404 errors are generic and don't distinguish between index missing or document missing.\#\#\# 503s from missing indexUnlike all other methods, create requests are supposed to succeed even when the Kibana index does not exist because it will be automatically created by elasticsearch. When that is not the case it is because Elasticsearch's action.auto_create_index
setting prevents it from being created automatically so we throw a special 503 with the intention of informing the user that their Elasticsearch settings need to be updated.See [SavedObjectsErrorHelpers](./kibana-plugin-server.savedobjectserrorhelpers.md) |
| [SavedObjectsClientWrapperFactory](./kibana-plugin-server.savedobjectsclientwrapperfactory.md) | Describes the factory used to create instances of Saved Objects Client Wrappers. |
diff --git a/docs/development/core/server/kibana-plugin-server.savedobject.attributes.md b/docs/development/core/server/kibana-plugin-server.savedobject.attributes.md
index c3d521aa7bc2c..7049ca65e96d3 100644
--- a/docs/development/core/server/kibana-plugin-server.savedobject.attributes.md
+++ b/docs/development/core/server/kibana-plugin-server.savedobject.attributes.md
@@ -4,7 +4,7 @@
## SavedObject.attributes property
-The data for a Saved Object is stored in the `attributes` key as either an object or an array of objects.
+The data for a Saved Object is stored as an object in the `attributes` property.
Signature:
diff --git a/docs/development/core/server/kibana-plugin-server.savedobject.md b/docs/development/core/server/kibana-plugin-server.savedobject.md
index 1514980588746..c7099cdce7ecd 100644
--- a/docs/development/core/server/kibana-plugin-server.savedobject.md
+++ b/docs/development/core/server/kibana-plugin-server.savedobject.md
@@ -15,7 +15,7 @@ export interface SavedObjectT
| The data for a Saved Object is stored in the attributes
key as either an object or an array of objects. |
+| [attributes](./kibana-plugin-server.savedobject.attributes.md) | T
| The data for a Saved Object is stored as an object in the attributes
property. |
| [error](./kibana-plugin-server.savedobject.error.md) | {
message: string;
statusCode: number;
}
| |
| [id](./kibana-plugin-server.savedobject.id.md) | string
| The ID of this Saved Object, guaranteed to be unique for all objects of the same type
|
| [migrationVersion](./kibana-plugin-server.savedobject.migrationversion.md) | SavedObjectsMigrationVersion
| Information about the migrations that have been applied to this SavedObject. When Kibana starts up, KibanaMigrator detects outdated documents and migrates them based on this value. For each migration that has been applied, the plugin's name is used as a key and the latest migration version as the value. |
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectattribute.md b/docs/development/core/server/kibana-plugin-server.savedobjectattribute.md
index 6a6c7c4d36bc6..6696d9c6ce96d 100644
--- a/docs/development/core/server/kibana-plugin-server.savedobjectattribute.md
+++ b/docs/development/core/server/kibana-plugin-server.savedobjectattribute.md
@@ -4,9 +4,10 @@
## SavedObjectAttribute type
+Type definition for a Saved Object attribute value
Signature:
```typescript
-export declare type SavedObjectAttribute = string | number | boolean | null | undefined | SavedObjectAttributes | SavedObjectAttributes[];
+export declare type SavedObjectAttribute = SavedObjectAttributeSingle | SavedObjectAttributeSingle[];
```
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectattributes.md b/docs/development/core/server/kibana-plugin-server.savedobjectattributes.md
index 7ff1247e89f2d..6d24eb02b4eaf 100644
--- a/docs/development/core/server/kibana-plugin-server.savedobjectattributes.md
+++ b/docs/development/core/server/kibana-plugin-server.savedobjectattributes.md
@@ -4,7 +4,7 @@
## SavedObjectAttributes interface
-The data for a Saved Object is stored in the `attributes` key as either an object or an array of objects.
+The data for a Saved Object is stored as an object in the `attributes` property.
Signature:
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectattributesingle.md b/docs/development/core/server/kibana-plugin-server.savedobjectattributesingle.md
new file mode 100644
index 0000000000000..b2ddb59ddb252
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.savedobjectattributesingle.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectAttributeSingle](./kibana-plugin-server.savedobjectattributesingle.md)
+
+## SavedObjectAttributeSingle type
+
+Don't use this type, it's simply a helper type for [SavedObjectAttribute](./kibana-plugin-server.savedobjectattribute.md)
+
+Signature:
+
+```typescript
+export declare type SavedObjectAttributeSingle = string | number | boolean | null | undefined | SavedObjectAttributes;
+```
diff --git a/package.json b/package.json
index 22a38eb8e7fec..ec89e923f5129 100644
--- a/package.json
+++ b/package.json
@@ -267,6 +267,7 @@
"@babel/parser": "^7.5.5",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/types": "^7.5.5",
+ "@elastic/elasticsearch": "^7.4.0",
"@elastic/eslint-config-kibana": "0.15.0",
"@elastic/eslint-plugin-eui": "0.0.2",
"@elastic/github-checks-reporter": "0.0.20b3",
@@ -281,7 +282,6 @@
"@kbn/utility-types": "1.0.0",
"@microsoft/api-documenter": "7.4.3",
"@microsoft/api-extractor": "7.4.2",
- "@octokit/rest": "^15.10.0",
"@percy/agent": "^0.11.0",
"@types/angular": "^1.6.56",
"@types/angular-mocks": "^1.7.0",
diff --git a/packages/kbn-dev-utils/src/kbn_client/errors.ts b/packages/kbn-dev-utils/src/axios/errors.ts
similarity index 73%
rename from packages/kbn-dev-utils/src/kbn_client/errors.ts
rename to packages/kbn-dev-utils/src/axios/errors.ts
index 068c68555b62a..e449c49a483b7 100644
--- a/packages/kbn-dev-utils/src/kbn_client/errors.ts
+++ b/packages/kbn-dev-utils/src/axios/errors.ts
@@ -28,15 +28,9 @@ export interface AxiosResponseError