diff --git a/docs/development/core/server/kibana-plugin-server.md b/docs/development/core/server/kibana-plugin-server.md
index e695ce53df2ab..1cab160a96383 100644
--- a/docs/development/core/server/kibana-plugin-server.md
+++ b/docs/development/core/server/kibana-plugin-server.md
@@ -107,6 +107,7 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [RouteValidatorOptions](./kibana-plugin-server.routevalidatoroptions.md) | Additional options for the RouteValidator class to modify its default behaviour. |
| [SavedObject](./kibana-plugin-server.savedobject.md) | |
| [SavedObjectAttributes](./kibana-plugin-server.savedobjectattributes.md) | The data for a Saved Object is stored as an object in the attributes
property. |
+| [SavedObjectMigrationMap](./kibana-plugin-server.savedobjectmigrationmap.md) | A map of [migration functions](./kibana-plugin-server.savedobjectmigrationfn.md) to be used for a given type. The map's keys must be valid semver versions.Migrations will be executed in order, starting from the lowest matching an higher version that the document current version, and ending with the highest one. |
| [SavedObjectReference](./kibana-plugin-server.savedobjectreference.md) | A reference to another saved object. |
| [SavedObjectsBaseOptions](./kibana-plugin-server.savedobjectsbaseoptions.md) | |
| [SavedObjectsBulkCreateObject](./kibana-plugin-server.savedobjectsbulkcreateobject.md) | |
@@ -117,8 +118,8 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [SavedObjectsBulkUpdateResponse](./kibana-plugin-server.savedobjectsbulkupdateresponse.md) | |
| [SavedObjectsClientProviderOptions](./kibana-plugin-server.savedobjectsclientprovideroptions.md) | Options to control the creation of the Saved Objects Client. |
| [SavedObjectsClientWrapperOptions](./kibana-plugin-server.savedobjectsclientwrapperoptions.md) | Options passed to each SavedObjectsClientWrapperFactory to aid in creating the wrapper instance. |
-| [SavedObjectsComplexFieldMapping](./kibana-plugin-server.savedobjectscomplexfieldmapping.md) | |
-| [SavedObjectsCoreFieldMapping](./kibana-plugin-server.savedobjectscorefieldmapping.md) | |
+| [SavedObjectsComplexFieldMapping](./kibana-plugin-server.savedobjectscomplexfieldmapping.md) | See [SavedObjectsFieldMapping](./kibana-plugin-server.savedobjectsfieldmapping.md) for documentation. |
+| [SavedObjectsCoreFieldMapping](./kibana-plugin-server.savedobjectscorefieldmapping.md) | See [SavedObjectsFieldMapping](./kibana-plugin-server.savedobjectsfieldmapping.md) for documentation. |
| [SavedObjectsCreateOptions](./kibana-plugin-server.savedobjectscreateoptions.md) | |
| [SavedObjectsDeleteByNamespaceOptions](./kibana-plugin-server.savedobjectsdeletebynamespaceoptions.md) | |
| [SavedObjectsDeleteOptions](./kibana-plugin-server.savedobjectsdeleteoptions.md) | |
@@ -143,6 +144,7 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [SavedObjectsResolveImportErrorsOptions](./kibana-plugin-server.savedobjectsresolveimporterrorsoptions.md) | Options to control the "resolve import" operation. |
| [SavedObjectsServiceSetup](./kibana-plugin-server.savedobjectsservicesetup.md) | Saved Objects is Kibana's data persistence mechanism allowing plugins to use Elasticsearch for storing and querying state. The SavedObjectsServiceSetup API exposes methods for creating and registering Saved Object client wrappers. |
| [SavedObjectsServiceStart](./kibana-plugin-server.savedobjectsservicestart.md) | Saved Objects is Kibana's data persisentence mechanism allowing plugins to use Elasticsearch for storing and querying state. The SavedObjectsServiceStart API provides a scoped Saved Objects client for interacting with Saved Objects. |
+| [SavedObjectsType](./kibana-plugin-server.savedobjectstype.md) | |
| [SavedObjectsTypeMappingDefinition](./kibana-plugin-server.savedobjectstypemappingdefinition.md) | Describe a saved object type mapping. |
| [SavedObjectsUpdateOptions](./kibana-plugin-server.savedobjectsupdateoptions.md) | |
| [SavedObjectsUpdateResponse](./kibana-plugin-server.savedobjectsupdateresponse.md) | |
@@ -223,12 +225,13 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [RouteValidatorFullConfig](./kibana-plugin-server.routevalidatorfullconfig.md) | Route validations config and options merged into one object |
| [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) |
+| [SavedObjectMigrationFn](./kibana-plugin-server.savedobjectmigrationfn.md) | A migration function defined for a [saved objects type](./kibana-plugin-server.savedobjectstype.md) used to migrate it's |
| [SavedObjectSanitizedDoc](./kibana-plugin-server.savedobjectsanitizeddoc.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 [SavedObjectsClient](./kibana-plugin-server.savedobjectsclient.md) See [SavedObjectsErrorHelpers](./kibana-plugin-server.savedobjectserrorhelpers.md) |
| [SavedObjectsClientFactory](./kibana-plugin-server.savedobjectsclientfactory.md) | Describes the factory used to create instances of the Saved Objects Client. |
| [SavedObjectsClientFactoryProvider](./kibana-plugin-server.savedobjectsclientfactoryprovider.md) | Provider to invoke to retrieve a [SavedObjectsClientFactory](./kibana-plugin-server.savedobjectsclientfactory.md). |
| [SavedObjectsClientWrapperFactory](./kibana-plugin-server.savedobjectsclientwrapperfactory.md) | Describes the factory used to create instances of Saved Objects Client Wrappers. |
-| [SavedObjectsFieldMapping](./kibana-plugin-server.savedobjectsfieldmapping.md) | Describe a [saved object type mapping](./kibana-plugin-server.savedobjectstypemappingdefinition.md) field. |
+| [SavedObjectsFieldMapping](./kibana-plugin-server.savedobjectsfieldmapping.md) | Describe a [saved object type mapping](./kibana-plugin-server.savedobjectstypemappingdefinition.md) field.Please refer to [elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html) For the mapping documentation |
| [ScopeableRequest](./kibana-plugin-server.scopeablerequest.md) | A user credentials container. It accommodates the necessary auth credentials to impersonate the current user.See [KibanaRequest](./kibana-plugin-server.kibanarequest.md). |
| [SharedGlobalConfig](./kibana-plugin-server.sharedglobalconfig.md) | |
| [StringValidation](./kibana-plugin-server.stringvalidation.md) | Allows regex objects or a regex string |
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectscomplexfieldmapping.md b/docs/development/core/server/kibana-plugin-server.savedobjectscomplexfieldmapping.md
index fb1ad5e9270a6..ecb5ec0e88911 100644
--- a/docs/development/core/server/kibana-plugin-server.savedobjectscomplexfieldmapping.md
+++ b/docs/development/core/server/kibana-plugin-server.savedobjectscomplexfieldmapping.md
@@ -4,6 +4,7 @@
## SavedObjectsComplexFieldMapping interface
+See [SavedObjectsFieldMapping](./kibana-plugin-server.savedobjectsfieldmapping.md) for documentation.
Signature:
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectscorefieldmapping.md b/docs/development/core/server/kibana-plugin-server.savedobjectscorefieldmapping.md
index b3a010467a689..4287921997098 100644
--- a/docs/development/core/server/kibana-plugin-server.savedobjectscorefieldmapping.md
+++ b/docs/development/core/server/kibana-plugin-server.savedobjectscorefieldmapping.md
@@ -4,6 +4,7 @@
## SavedObjectsCoreFieldMapping interface
+See [SavedObjectsFieldMapping](./kibana-plugin-server.savedobjectsfieldmapping.md) for documentation.
Signature:
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsfieldmapping.md b/docs/development/core/server/kibana-plugin-server.savedobjectsfieldmapping.md
index 1c18e237901bd..f31e18e8df670 100644
--- a/docs/development/core/server/kibana-plugin-server.savedobjectsfieldmapping.md
+++ b/docs/development/core/server/kibana-plugin-server.savedobjectsfieldmapping.md
@@ -6,6 +6,8 @@
Describe a [saved object type mapping](./kibana-plugin-server.savedobjectstypemappingdefinition.md) field.
+Please refer to [elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html) For the mapping documentation
+
Signature:
```typescript
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsmigrationlogger.md b/docs/development/core/server/kibana-plugin-server.savedobjectsmigrationlogger.md
index a98d88700cd55..1b8db4a6c9f8d 100644
--- a/docs/development/core/server/kibana-plugin-server.savedobjectsmigrationlogger.md
+++ b/docs/development/core/server/kibana-plugin-server.savedobjectsmigrationlogger.md
@@ -17,5 +17,6 @@ export interface SavedObjectsMigrationLogger
| --- | --- | --- |
| [debug](./kibana-plugin-server.savedobjectsmigrationlogger.debug.md) | (msg: string) => void
| |
| [info](./kibana-plugin-server.savedobjectsmigrationlogger.info.md) | (msg: string) => void
| |
+| [warn](./kibana-plugin-server.savedobjectsmigrationlogger.warn.md) | (msg: string) => void
| |
| [warning](./kibana-plugin-server.savedobjectsmigrationlogger.warning.md) | (msg: string) => void
| |
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsmigrationlogger.warning.md b/docs/development/core/server/kibana-plugin-server.savedobjectsmigrationlogger.warning.md
index a87955d603b70..689a799515094 100644
--- a/docs/development/core/server/kibana-plugin-server.savedobjectsmigrationlogger.warning.md
+++ b/docs/development/core/server/kibana-plugin-server.savedobjectsmigrationlogger.warning.md
@@ -4,6 +4,11 @@
## SavedObjectsMigrationLogger.warning property
+> Warning: This API is now obsolete.
+>
+> Use `warn` instead.
+>
+
Signature:
```typescript
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsrawdoc._source.md b/docs/development/core/server/kibana-plugin-server.savedobjectsrawdoc._source.md
index dcf207f8120ea..332df982b23eb 100644
--- a/docs/development/core/server/kibana-plugin-server.savedobjectsrawdoc._source.md
+++ b/docs/development/core/server/kibana-plugin-server.savedobjectsrawdoc._source.md
@@ -7,5 +7,5 @@
Signature:
```typescript
-_source: any;
+_source: SavedObjectsRawDocSource;
```
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsrawdoc.md b/docs/development/core/server/kibana-plugin-server.savedobjectsrawdoc.md
index f1d5bbe733761..3e3ad7da5aecd 100644
--- a/docs/development/core/server/kibana-plugin-server.savedobjectsrawdoc.md
+++ b/docs/development/core/server/kibana-plugin-server.savedobjectsrawdoc.md
@@ -19,6 +19,6 @@ export interface SavedObjectsRawDoc
| [\_id](./kibana-plugin-server.savedobjectsrawdoc._id.md) | string
| |
| [\_primary\_term](./kibana-plugin-server.savedobjectsrawdoc._primary_term.md) | number
| |
| [\_seq\_no](./kibana-plugin-server.savedobjectsrawdoc._seq_no.md) | number
| |
-| [\_source](./kibana-plugin-server.savedobjectsrawdoc._source.md) | any
| |
+| [\_source](./kibana-plugin-server.savedobjectsrawdoc._source.md) | SavedObjectsRawDocSource
| |
| [\_type](./kibana-plugin-server.savedobjectsrawdoc._type.md) | string
| |
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsserializer.israwsavedobject.md b/docs/development/core/server/kibana-plugin-server.savedobjectsserializer.israwsavedobject.md
index fa6f6ab43e859..32d00ee1a9f7f 100644
--- a/docs/development/core/server/kibana-plugin-server.savedobjectsserializer.israwsavedobject.md
+++ b/docs/development/core/server/kibana-plugin-server.savedobjectsserializer.israwsavedobject.md
@@ -9,7 +9,7 @@ Determines whether or not the raw document can be converted to a saved object.
Signature:
```typescript
-isRawSavedObject(rawDoc: SavedObjectsRawDoc): any;
+isRawSavedObject(rawDoc: SavedObjectsRawDoc): boolean;
```
## Parameters
@@ -20,5 +20,5 @@ isRawSavedObject(rawDoc: SavedObjectsRawDoc): any;
Returns:
-`any`
+`boolean`
diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md
index 4b0015fb8c163..1c25f9bf7b079 100644
--- a/src/core/server/server.api.md
+++ b/src/core/server/server.api.md
@@ -1421,6 +1421,19 @@ export interface SavedObjectAttributes {
// @public
export type SavedObjectAttributeSingle = string | number | boolean | null | undefined | SavedObjectAttributes;
+// Warning: (ae-forgotten-export) The symbol "SavedObjectUnsanitizedDoc" needs to be exported by the entry point index.d.ts
+// Warning: (ae-missing-release-tag) "SavedObjectMigrationFn" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
+// Warning: (ae-unresolved-link) The @link reference could not be resolved: The package "kibana" does not have an export "SavedObjectUnsanitizedDoc"
+//
+// @public
+export type SavedObjectMigrationFn = (doc: SavedObjectUnsanitizedDoc, log: SavedObjectsMigrationLogger) => SavedObjectUnsanitizedDoc;
+
+// @public
+export interface SavedObjectMigrationMap {
+ // (undocumented)
+ [version: string]: SavedObjectMigrationFn;
+}
+
// @public
export interface SavedObjectReference {
// (undocumented)
@@ -1540,7 +1553,7 @@ export interface SavedObjectsClientWrapperOptions {
request: KibanaRequest;
}
-// @public (undocumented)
+// @public
export interface SavedObjectsComplexFieldMapping {
// (undocumented)
dynamic?: string;
@@ -1550,7 +1563,7 @@ export interface SavedObjectsComplexFieldMapping {
type?: string;
}
-// @public (undocumented)
+// @public
export interface SavedObjectsCoreFieldMapping {
// (undocumented)
enabled?: boolean;
@@ -1841,6 +1854,8 @@ export interface SavedObjectsMigrationLogger {
// (undocumented)
info: (msg: string) => void;
// (undocumented)
+ warn: (msg: string) => void;
+ // @deprecated (undocumented)
warning: (msg: string) => void;
}
@@ -1858,8 +1873,10 @@ export interface SavedObjectsRawDoc {
_primary_term?: number;
// (undocumented)
_seq_no?: number;
+ // Warning: (ae-forgotten-export) The symbol "SavedObjectsRawDocSource" needs to be exported by the entry point index.d.ts
+ //
// (undocumented)
- _source: any;
+ _source: SavedObjectsRawDocSource;
// (undocumented)
_type?: string;
}
@@ -1928,10 +1945,12 @@ export class SavedObjectsSchema {
// @public
export class SavedObjectsSerializer {
+ // Warning: (ae-forgotten-export) The symbol "ISavedObjectTypeRegistry" needs to be exported by the entry point index.d.ts
+ //
// @internal
- constructor(registry: SavedObjectTypeRegistry);
+ constructor(registry: ISavedObjectTypeRegistry);
generateRawId(namespace: string | undefined, type: string, id?: string): string;
- isRawSavedObject(rawDoc: SavedObjectsRawDoc): any;
+ isRawSavedObject(rawDoc: SavedObjectsRawDoc): boolean;
rawToSavedObject(doc: SavedObjectsRawDoc): SavedObjectSanitizedDoc;
savedObjectToRaw(savedObj: SavedObjectSanitizedDoc): SavedObjectsRawDoc;
}
@@ -1950,23 +1969,14 @@ export interface SavedObjectsServiceStart {
getScopedClient: (req: KibanaRequest, options?: SavedObjectsClientProviderOptions) => SavedObjectsClientContract;
}
-// @internal (undocumented)
+// @public (undocumented)
export interface SavedObjectsType {
- // (undocumented)
convertToAliasScript?: string;
- // (undocumented)
hidden: boolean;
- // (undocumented)
indexPattern?: string;
- // (undocumented)
mappings: SavedObjectsTypeMappingDefinition;
- // Warning: (ae-forgotten-export) The symbol "SavedObjectMigrationMap" needs to be exported by the entry point index.d.ts
- //
- // (undocumented)
migrations?: SavedObjectMigrationMap;
- // (undocumented)
name: string;
- // (undocumented)
namespaceAgnostic: boolean;
}