Expose SO import/export APIs from the service's contract instead of exporting static functions (#86264) (#87611)
* Add user doc for SO tagging * add link to new page * handle review feedbacks * second pass * create SO exporter class * adapt spaces code * typo fix * adapt tests * some doc * update generated doc * fix spaces tests * move ALL the import things * adapt / move types * create context, adapt core code * adapt integration tests * rename for consistency * adapt spaces usages * adapt spaces routes usages * remove unused getImportExportObjectLimit * fix tsdoc * update generated doc * doc nits * review comments * add test for fetchByObjects failure * add custom errors for exporter * remove `getImportExportObjectLimit` API * fix IT * update generated doc * adapt UT * forgot one Boom usage * rename import error to failure * remove Boom usages from importer * update generated doc * fix spaces types
This commit is contained in:
parent
ccb83f87d8
commit
6e66ee0f65
|
@ -114,7 +114,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
|
|||
| [SavedObjectsFindResponsePublic](./kibana-plugin-core-public.savedobjectsfindresponsepublic.md) | Return type of the Saved Objects <code>find()</code> method.<!-- -->\*Note\*: this type is different between the Public and Server Saved Objects clients. |
|
||||
| [SavedObjectsImportAmbiguousConflictError](./kibana-plugin-core-public.savedobjectsimportambiguousconflicterror.md) | Represents a failure to import due to a conflict, which can be resolved in different ways with an overwrite. |
|
||||
| [SavedObjectsImportConflictError](./kibana-plugin-core-public.savedobjectsimportconflicterror.md) | Represents a failure to import due to a conflict. |
|
||||
| [SavedObjectsImportError](./kibana-plugin-core-public.savedobjectsimporterror.md) | Represents a failure to import. |
|
||||
| [SavedObjectsImportFailure](./kibana-plugin-core-public.savedobjectsimportfailure.md) | Represents a failure to import. |
|
||||
| [SavedObjectsImportMissingReferencesError](./kibana-plugin-core-public.savedobjectsimportmissingreferenceserror.md) | Represents a failure to import due to missing references. |
|
||||
| [SavedObjectsImportResponse](./kibana-plugin-core-public.savedobjectsimportresponse.md) | The response describing the result of an import. |
|
||||
| [SavedObjectsImportRetry](./kibana-plugin-core-public.savedobjectsimportretry.md) | Describes a retry operation for importing a saved object. |
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsImportError](./kibana-plugin-core-public.savedobjectsimporterror.md) > [id](./kibana-plugin-core-public.savedobjectsimporterror.id.md)
|
||||
|
||||
## SavedObjectsImportError.id property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
id: string;
|
||||
```
|
|
@ -1,25 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsImportError](./kibana-plugin-core-public.savedobjectsimporterror.md)
|
||||
|
||||
## SavedObjectsImportError interface
|
||||
|
||||
Represents a failure to import.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface SavedObjectsImportError
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [error](./kibana-plugin-core-public.savedobjectsimporterror.error.md) | <code>SavedObjectsImportConflictError | SavedObjectsImportAmbiguousConflictError | SavedObjectsImportUnsupportedTypeError | SavedObjectsImportMissingReferencesError | SavedObjectsImportUnknownError</code> | |
|
||||
| [id](./kibana-plugin-core-public.savedobjectsimporterror.id.md) | <code>string</code> | |
|
||||
| [meta](./kibana-plugin-core-public.savedobjectsimporterror.meta.md) | <code>{</code><br/><code> title?: string;</code><br/><code> icon?: string;</code><br/><code> }</code> | |
|
||||
| [overwrite](./kibana-plugin-core-public.savedobjectsimporterror.overwrite.md) | <code>boolean</code> | If <code>overwrite</code> is specified, an attempt was made to overwrite an existing object. |
|
||||
| [title](./kibana-plugin-core-public.savedobjectsimporterror.title.md) | <code>string</code> | |
|
||||
| [type](./kibana-plugin-core-public.savedobjectsimporterror.type.md) | <code>string</code> | |
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsImportError](./kibana-plugin-core-public.savedobjectsimporterror.md) > [type](./kibana-plugin-core-public.savedobjectsimporterror.type.md)
|
||||
|
||||
## SavedObjectsImportError.type property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
type: string;
|
||||
```
|
|
@ -1,8 +1,8 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsImportError](./kibana-plugin-core-public.savedobjectsimporterror.md) > [error](./kibana-plugin-core-public.savedobjectsimporterror.error.md)
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsImportFailure](./kibana-plugin-core-public.savedobjectsimportfailure.md) > [error](./kibana-plugin-core-public.savedobjectsimportfailure.error.md)
|
||||
|
||||
## SavedObjectsImportError.error property
|
||||
## SavedObjectsImportFailure.error property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsImportFailure](./kibana-plugin-core-public.savedobjectsimportfailure.md) > [id](./kibana-plugin-core-public.savedobjectsimportfailure.id.md)
|
||||
|
||||
## SavedObjectsImportFailure.id property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
id: string;
|
||||
```
|
|
@ -0,0 +1,25 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsImportFailure](./kibana-plugin-core-public.savedobjectsimportfailure.md)
|
||||
|
||||
## SavedObjectsImportFailure interface
|
||||
|
||||
Represents a failure to import.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface SavedObjectsImportFailure
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [error](./kibana-plugin-core-public.savedobjectsimportfailure.error.md) | <code>SavedObjectsImportConflictError | SavedObjectsImportAmbiguousConflictError | SavedObjectsImportUnsupportedTypeError | SavedObjectsImportMissingReferencesError | SavedObjectsImportUnknownError</code> | |
|
||||
| [id](./kibana-plugin-core-public.savedobjectsimportfailure.id.md) | <code>string</code> | |
|
||||
| [meta](./kibana-plugin-core-public.savedobjectsimportfailure.meta.md) | <code>{</code><br/><code> title?: string;</code><br/><code> icon?: string;</code><br/><code> }</code> | |
|
||||
| [overwrite](./kibana-plugin-core-public.savedobjectsimportfailure.overwrite.md) | <code>boolean</code> | If <code>overwrite</code> is specified, an attempt was made to overwrite an existing object. |
|
||||
| [title](./kibana-plugin-core-public.savedobjectsimportfailure.title.md) | <code>string</code> | |
|
||||
| [type](./kibana-plugin-core-public.savedobjectsimportfailure.type.md) | <code>string</code> | |
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsImportError](./kibana-plugin-core-public.savedobjectsimporterror.md) > [meta](./kibana-plugin-core-public.savedobjectsimporterror.meta.md)
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsImportFailure](./kibana-plugin-core-public.savedobjectsimportfailure.md) > [meta](./kibana-plugin-core-public.savedobjectsimportfailure.meta.md)
|
||||
|
||||
## SavedObjectsImportError.meta property
|
||||
## SavedObjectsImportFailure.meta property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsImportError](./kibana-plugin-core-public.savedobjectsimporterror.md) > [overwrite](./kibana-plugin-core-public.savedobjectsimporterror.overwrite.md)
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsImportFailure](./kibana-plugin-core-public.savedobjectsimportfailure.md) > [overwrite](./kibana-plugin-core-public.savedobjectsimportfailure.overwrite.md)
|
||||
|
||||
## SavedObjectsImportError.overwrite property
|
||||
## SavedObjectsImportFailure.overwrite property
|
||||
|
||||
If `overwrite` is specified, an attempt was made to overwrite an existing object.
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsImportError](./kibana-plugin-core-public.savedobjectsimporterror.md) > [title](./kibana-plugin-core-public.savedobjectsimporterror.title.md)
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsImportFailure](./kibana-plugin-core-public.savedobjectsimportfailure.md) > [title](./kibana-plugin-core-public.savedobjectsimportfailure.title.md)
|
||||
|
||||
## SavedObjectsImportError.title property
|
||||
## SavedObjectsImportFailure.title property
|
||||
|
||||
> Warning: This API is now obsolete.
|
||||
>
|
|
@ -0,0 +1,11 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsImportFailure](./kibana-plugin-core-public.savedobjectsimportfailure.md) > [type](./kibana-plugin-core-public.savedobjectsimportfailure.type.md)
|
||||
|
||||
## SavedObjectsImportFailure.type property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
type: string;
|
||||
```
|
|
@ -7,5 +7,5 @@
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
errors?: SavedObjectsImportError[];
|
||||
errors?: SavedObjectsImportFailure[];
|
||||
```
|
||||
|
|
|
@ -16,7 +16,7 @@ export interface SavedObjectsImportResponse
|
|||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [errors](./kibana-plugin-core-public.savedobjectsimportresponse.errors.md) | <code>SavedObjectsImportError[]</code> | |
|
||||
| [errors](./kibana-plugin-core-public.savedobjectsimportresponse.errors.md) | <code>SavedObjectsImportFailure[]</code> | |
|
||||
| [success](./kibana-plugin-core-public.savedobjectsimportresponse.success.md) | <code>boolean</code> | |
|
||||
| [successCount](./kibana-plugin-core-public.savedobjectsimportresponse.successcount.md) | <code>number</code> | |
|
||||
| [successResults](./kibana-plugin-core-public.savedobjectsimportresponse.successresults.md) | <code>SavedObjectsImportSuccess[]</code> | |
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [exportSavedObjectsToStream](./kibana-plugin-core-server.exportsavedobjectstostream.md)
|
||||
|
||||
## exportSavedObjectsToStream() function
|
||||
|
||||
Generates sorted saved object stream to be used for export. See the [options](./kibana-plugin-core-server.savedobjectsexportoptions.md) for more detailed information.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare function exportSavedObjectsToStream({ types, hasReference, objects, search, savedObjectsClient, exportSizeLimit, includeReferencesDeep, excludeExportDetails, namespace, }: SavedObjectsExportOptions): Promise<import("stream").Readable>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| { types, hasReference, objects, search, savedObjectsClient, exportSizeLimit, includeReferencesDeep, excludeExportDetails, namespace, } | <code>SavedObjectsExportOptions</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`Promise<import("stream").Readable>`
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [importSavedObjectsFromStream](./kibana-plugin-core-server.importsavedobjectsfromstream.md)
|
||||
|
||||
## importSavedObjectsFromStream() function
|
||||
|
||||
Import saved objects from given stream. See the [options](./kibana-plugin-core-server.savedobjectsimportoptions.md) for more detailed information.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare function importSavedObjectsFromStream({ readStream, objectLimit, overwrite, createNewCopies, savedObjectsClient, typeRegistry, namespace, }: SavedObjectsImportOptions): Promise<SavedObjectsImportResponse>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| { readStream, objectLimit, overwrite, createNewCopies, savedObjectsClient, typeRegistry, namespace, } | <code>SavedObjectsImportOptions</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`Promise<SavedObjectsImportResponse>`
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [ISavedObjectsExporter](./kibana-plugin-core-server.isavedobjectsexporter.md)
|
||||
|
||||
## ISavedObjectsExporter type
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare type ISavedObjectsExporter = PublicMethodsOf<SavedObjectsExporter>;
|
||||
```
|
|
@ -0,0 +1,12 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [ISavedObjectsImporter](./kibana-plugin-core-server.isavedobjectsimporter.md)
|
||||
|
||||
## ISavedObjectsImporter type
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare type ISavedObjectsImporter = PublicMethodsOf<SavedObjectsImporter>;
|
||||
```
|
|
@ -26,6 +26,10 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
|
|||
| [RouteValidationError](./kibana-plugin-core-server.routevalidationerror.md) | Error to return when the validation is not successful. |
|
||||
| [SavedObjectsClient](./kibana-plugin-core-server.savedobjectsclient.md) | |
|
||||
| [SavedObjectsErrorHelpers](./kibana-plugin-core-server.savedobjectserrorhelpers.md) | |
|
||||
| [SavedObjectsExporter](./kibana-plugin-core-server.savedobjectsexporter.md) | |
|
||||
| [SavedObjectsExportError](./kibana-plugin-core-server.savedobjectsexporterror.md) | |
|
||||
| [SavedObjectsImporter](./kibana-plugin-core-server.savedobjectsimporter.md) | |
|
||||
| [SavedObjectsImportError](./kibana-plugin-core-server.savedobjectsimporterror.md) | |
|
||||
| [SavedObjectsRepository](./kibana-plugin-core-server.savedobjectsrepository.md) | |
|
||||
| [SavedObjectsSerializer](./kibana-plugin-core-server.savedobjectsserializer.md) | A serializer that can be used to manually convert [raw](./kibana-plugin-core-server.savedobjectsrawdoc.md) or [sanitized](./kibana-plugin-core-server.savedobjectsanitizeddoc.md) documents to the other kind. |
|
||||
| [SavedObjectsUtils](./kibana-plugin-core-server.savedobjectsutils.md) | |
|
||||
|
@ -38,14 +42,6 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
|
|||
| [AuthResultType](./kibana-plugin-core-server.authresulttype.md) | |
|
||||
| [AuthStatus](./kibana-plugin-core-server.authstatus.md) | Status indicating an outcome of the authentication. |
|
||||
|
||||
## Functions
|
||||
|
||||
| Function | Description |
|
||||
| --- | --- |
|
||||
| [exportSavedObjectsToStream({ types, hasReference, objects, search, savedObjectsClient, exportSizeLimit, includeReferencesDeep, excludeExportDetails, namespace, })](./kibana-plugin-core-server.exportsavedobjectstostream.md) | Generates sorted saved object stream to be used for export. See the [options](./kibana-plugin-core-server.savedobjectsexportoptions.md) for more detailed information. |
|
||||
| [importSavedObjectsFromStream({ readStream, objectLimit, overwrite, createNewCopies, savedObjectsClient, typeRegistry, namespace, })](./kibana-plugin-core-server.importsavedobjectsfromstream.md) | Import saved objects from given stream. See the [options](./kibana-plugin-core-server.savedobjectsimportoptions.md) for more detailed information. |
|
||||
| [resolveSavedObjectsImportErrors({ readStream, objectLimit, retries, savedObjectsClient, typeRegistry, namespace, createNewCopies, })](./kibana-plugin-core-server.resolvesavedobjectsimporterrors.md) | Resolve and return saved object import errors. See the [options](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.md) for more detailed informations. |
|
||||
|
||||
## Interfaces
|
||||
|
||||
| Interface | Description |
|
||||
|
@ -140,6 +136,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
|
|||
| [RouteValidatorOptions](./kibana-plugin-core-server.routevalidatoroptions.md) | Additional options for the RouteValidator class to modify its default behaviour. |
|
||||
| [SavedObject](./kibana-plugin-core-server.savedobject.md) | |
|
||||
| [SavedObjectAttributes](./kibana-plugin-core-server.savedobjectattributes.md) | The data for a Saved Object is stored as an object in the <code>attributes</code> property. |
|
||||
| [SavedObjectExportBaseOptions](./kibana-plugin-core-server.savedobjectexportbaseoptions.md) | |
|
||||
| [SavedObjectMigrationContext](./kibana-plugin-core-server.savedobjectmigrationcontext.md) | Migration context provided when invoking a [migration handler](./kibana-plugin-core-server.savedobjectmigrationfn.md) |
|
||||
| [SavedObjectMigrationMap](./kibana-plugin-core-server.savedobjectmigrationmap.md) | A map of [migration functions](./kibana-plugin-core-server.savedobjectmigrationfn.md) to be used for a given type. The map's keys must be valid semver versions.<!-- -->For a given document, only migrations with a higher version number than that of the document will be applied. Migrations are executed in order, starting from the lowest version and ending with the highest one. |
|
||||
| [SavedObjectReference](./kibana-plugin-core-server.savedobjectreference.md) | A reference to another saved object. |
|
||||
|
@ -163,7 +160,8 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
|
|||
| [SavedObjectsDeleteFromNamespacesOptions](./kibana-plugin-core-server.savedobjectsdeletefromnamespacesoptions.md) | |
|
||||
| [SavedObjectsDeleteFromNamespacesResponse](./kibana-plugin-core-server.savedobjectsdeletefromnamespacesresponse.md) | |
|
||||
| [SavedObjectsDeleteOptions](./kibana-plugin-core-server.savedobjectsdeleteoptions.md) | |
|
||||
| [SavedObjectsExportOptions](./kibana-plugin-core-server.savedobjectsexportoptions.md) | Options controlling the export operation. |
|
||||
| [SavedObjectsExportByObjectOptions](./kibana-plugin-core-server.savedobjectsexportbyobjectoptions.md) | Options for the [export by objects API](./kibana-plugin-core-server.savedobjectsexporter.exportbyobjects.md) |
|
||||
| [SavedObjectsExportByTypeOptions](./kibana-plugin-core-server.savedobjectsexportbytypeoptions.md) | Options for the [export by type API](./kibana-plugin-core-server.savedobjectsexporter.exportbytypes.md) |
|
||||
| [SavedObjectsExportResultDetails](./kibana-plugin-core-server.savedobjectsexportresultdetails.md) | Structure of the export result details entry |
|
||||
| [SavedObjectsFindOptions](./kibana-plugin-core-server.savedobjectsfindoptions.md) | |
|
||||
| [SavedObjectsFindOptionsReference](./kibana-plugin-core-server.savedobjectsfindoptionsreference.md) | |
|
||||
|
@ -171,7 +169,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
|
|||
| [SavedObjectsFindResult](./kibana-plugin-core-server.savedobjectsfindresult.md) | |
|
||||
| [SavedObjectsImportAmbiguousConflictError](./kibana-plugin-core-server.savedobjectsimportambiguousconflicterror.md) | Represents a failure to import due to a conflict, which can be resolved in different ways with an overwrite. |
|
||||
| [SavedObjectsImportConflictError](./kibana-plugin-core-server.savedobjectsimportconflicterror.md) | Represents a failure to import due to a conflict. |
|
||||
| [SavedObjectsImportError](./kibana-plugin-core-server.savedobjectsimporterror.md) | Represents a failure to import. |
|
||||
| [SavedObjectsImportFailure](./kibana-plugin-core-server.savedobjectsimportfailure.md) | Represents a failure to import. |
|
||||
| [SavedObjectsImportMissingReferencesError](./kibana-plugin-core-server.savedobjectsimportmissingreferenceserror.md) | Represents a failure to import due to missing references. |
|
||||
| [SavedObjectsImportOptions](./kibana-plugin-core-server.savedobjectsimportoptions.md) | Options to control the import operation. |
|
||||
| [SavedObjectsImportResponse](./kibana-plugin-core-server.savedobjectsimportresponse.md) | The response describing the result of an import. |
|
||||
|
@ -249,6 +247,8 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
|
|||
| [ILegacyCustomClusterClient](./kibana-plugin-core-server.ilegacycustomclusterclient.md) | Represents an Elasticsearch cluster API client created by a plugin. It allows to call API on behalf of the internal Kibana user and the actual user that is derived from the request headers (via <code>asScoped(...)</code>).<!-- -->See [LegacyClusterClient](./kibana-plugin-core-server.legacyclusterclient.md)<!-- -->. |
|
||||
| [ILegacyScopedClusterClient](./kibana-plugin-core-server.ilegacyscopedclusterclient.md) | Serves the same purpose as "normal" <code>ClusterClient</code> but exposes additional <code>callAsCurrentUser</code> method that doesn't use credentials of the Kibana internal user (as <code>callAsInternalUser</code> does) to request Elasticsearch API, but rather passes HTTP headers extracted from the current user request to the API.<!-- -->See [LegacyScopedClusterClient](./kibana-plugin-core-server.legacyscopedclusterclient.md)<!-- -->. |
|
||||
| [IsAuthenticated](./kibana-plugin-core-server.isauthenticated.md) | Returns authentication status for a request. |
|
||||
| [ISavedObjectsExporter](./kibana-plugin-core-server.isavedobjectsexporter.md) | |
|
||||
| [ISavedObjectsImporter](./kibana-plugin-core-server.isavedobjectsimporter.md) | |
|
||||
| [ISavedObjectsRepository](./kibana-plugin-core-server.isavedobjectsrepository.md) | See [SavedObjectsRepository](./kibana-plugin-core-server.savedobjectsrepository.md) |
|
||||
| [ISavedObjectTypeRegistry](./kibana-plugin-core-server.isavedobjecttyperegistry.md) | See [SavedObjectTypeRegistry](./kibana-plugin-core-server.savedobjecttyperegistry.md) for documentation. |
|
||||
| [KibanaRequestRouteOptions](./kibana-plugin-core-server.kibanarequestrouteoptions.md) | Route options: If 'GET' or 'OPTIONS' method, body options won't be returned. |
|
||||
|
|
|
@ -11,6 +11,8 @@ core: {
|
|||
savedObjects: {
|
||||
client: SavedObjectsClientContract;
|
||||
typeRegistry: ISavedObjectTypeRegistry;
|
||||
exporter: ISavedObjectsExporter;
|
||||
importer: ISavedObjectsImporter;
|
||||
};
|
||||
elasticsearch: {
|
||||
client: IScopedClusterClient;
|
||||
|
|
|
@ -18,5 +18,5 @@ export interface RequestHandlerContext
|
|||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [core](./kibana-plugin-core-server.requesthandlercontext.core.md) | <code>{</code><br/><code> savedObjects: {</code><br/><code> client: SavedObjectsClientContract;</code><br/><code> typeRegistry: ISavedObjectTypeRegistry;</code><br/><code> };</code><br/><code> elasticsearch: {</code><br/><code> client: IScopedClusterClient;</code><br/><code> legacy: {</code><br/><code> client: ILegacyScopedClusterClient;</code><br/><code> };</code><br/><code> };</code><br/><code> uiSettings: {</code><br/><code> client: IUiSettingsClient;</code><br/><code> };</code><br/><code> }</code> | |
|
||||
| [core](./kibana-plugin-core-server.requesthandlercontext.core.md) | <code>{</code><br/><code> savedObjects: {</code><br/><code> client: SavedObjectsClientContract;</code><br/><code> typeRegistry: ISavedObjectTypeRegistry;</code><br/><code> exporter: ISavedObjectsExporter;</code><br/><code> importer: ISavedObjectsImporter;</code><br/><code> };</code><br/><code> elasticsearch: {</code><br/><code> client: IScopedClusterClient;</code><br/><code> legacy: {</code><br/><code> client: ILegacyScopedClusterClient;</code><br/><code> };</code><br/><code> };</code><br/><code> uiSettings: {</code><br/><code> client: IUiSettingsClient;</code><br/><code> };</code><br/><code> }</code> | |
|
||||
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [resolveSavedObjectsImportErrors](./kibana-plugin-core-server.resolvesavedobjectsimporterrors.md)
|
||||
|
||||
## resolveSavedObjectsImportErrors() function
|
||||
|
||||
Resolve and return saved object import errors. See the [options](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.md) for more detailed informations.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare function resolveSavedObjectsImportErrors({ readStream, objectLimit, retries, savedObjectsClient, typeRegistry, namespace, createNewCopies, }: SavedObjectsResolveImportErrorsOptions): Promise<SavedObjectsImportResponse>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| { readStream, objectLimit, retries, savedObjectsClient, typeRegistry, namespace, createNewCopies, } | <code>SavedObjectsResolveImportErrorsOptions</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`Promise<SavedObjectsImportResponse>`
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExportOptions](./kibana-plugin-core-server.savedobjectsexportoptions.md) > [excludeExportDetails](./kibana-plugin-core-server.savedobjectsexportoptions.excludeexportdetails.md)
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectExportBaseOptions](./kibana-plugin-core-server.savedobjectexportbaseoptions.md) > [excludeExportDetails](./kibana-plugin-core-server.savedobjectexportbaseoptions.excludeexportdetails.md)
|
||||
|
||||
## SavedObjectsExportOptions.excludeExportDetails property
|
||||
## SavedObjectExportBaseOptions.excludeExportDetails property
|
||||
|
||||
flag to not append [export details](./kibana-plugin-core-server.savedobjectsexportresultdetails.md) to the end of the export stream.
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectExportBaseOptions](./kibana-plugin-core-server.savedobjectexportbaseoptions.md) > [includeReferencesDeep](./kibana-plugin-core-server.savedobjectexportbaseoptions.includereferencesdeep.md)
|
||||
|
||||
## SavedObjectExportBaseOptions.includeReferencesDeep property
|
||||
|
||||
flag to also include all related saved objects in the export stream.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
includeReferencesDeep?: boolean;
|
||||
```
|
|
@ -0,0 +1,21 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectExportBaseOptions](./kibana-plugin-core-server.savedobjectexportbaseoptions.md)
|
||||
|
||||
## SavedObjectExportBaseOptions interface
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface SavedObjectExportBaseOptions
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [excludeExportDetails](./kibana-plugin-core-server.savedobjectexportbaseoptions.excludeexportdetails.md) | <code>boolean</code> | flag to not append [export details](./kibana-plugin-core-server.savedobjectsexportresultdetails.md) to the end of the export stream. |
|
||||
| [includeReferencesDeep](./kibana-plugin-core-server.savedobjectexportbaseoptions.includereferencesdeep.md) | <code>boolean</code> | flag to also include all related saved objects in the export stream. |
|
||||
| [namespace](./kibana-plugin-core-server.savedobjectexportbaseoptions.namespace.md) | <code>string</code> | optional namespace to override the namespace used by the savedObjectsClient. |
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExportOptions](./kibana-plugin-core-server.savedobjectsexportoptions.md) > [namespace](./kibana-plugin-core-server.savedobjectsexportoptions.namespace.md)
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectExportBaseOptions](./kibana-plugin-core-server.savedobjectexportbaseoptions.md) > [namespace](./kibana-plugin-core-server.savedobjectexportbaseoptions.namespace.md)
|
||||
|
||||
## SavedObjectsExportOptions.namespace property
|
||||
## SavedObjectExportBaseOptions.namespace property
|
||||
|
||||
optional namespace to override the namespace used by the savedObjectsClient.
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExportByObjectOptions](./kibana-plugin-core-server.savedobjectsexportbyobjectoptions.md)
|
||||
|
||||
## SavedObjectsExportByObjectOptions interface
|
||||
|
||||
Options for the [export by objects API](./kibana-plugin-core-server.savedobjectsexporter.exportbyobjects.md)
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface SavedObjectsExportByObjectOptions extends SavedObjectExportBaseOptions
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [objects](./kibana-plugin-core-server.savedobjectsexportbyobjectoptions.objects.md) | <code>Array<{</code><br/><code> id: string;</code><br/><code> type: string;</code><br/><code> }></code> | optional array of objects to export. |
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExportByObjectOptions](./kibana-plugin-core-server.savedobjectsexportbyobjectoptions.md) > [objects](./kibana-plugin-core-server.savedobjectsexportbyobjectoptions.objects.md)
|
||||
|
||||
## SavedObjectsExportByObjectOptions.objects property
|
||||
|
||||
optional array of objects to export.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
objects: Array<{
|
||||
id: string;
|
||||
type: string;
|
||||
}>;
|
||||
```
|
|
@ -0,0 +1,13 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExportByTypeOptions](./kibana-plugin-core-server.savedobjectsexportbytypeoptions.md) > [hasReference](./kibana-plugin-core-server.savedobjectsexportbytypeoptions.hasreference.md)
|
||||
|
||||
## SavedObjectsExportByTypeOptions.hasReference property
|
||||
|
||||
optional array of references to search object for.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
hasReference?: SavedObjectsFindOptionsReference[];
|
||||
```
|
|
@ -0,0 +1,22 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExportByTypeOptions](./kibana-plugin-core-server.savedobjectsexportbytypeoptions.md)
|
||||
|
||||
## SavedObjectsExportByTypeOptions interface
|
||||
|
||||
Options for the [export by type API](./kibana-plugin-core-server.savedobjectsexporter.exportbytypes.md)
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface SavedObjectsExportByTypeOptions extends SavedObjectExportBaseOptions
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [hasReference](./kibana-plugin-core-server.savedobjectsexportbytypeoptions.hasreference.md) | <code>SavedObjectsFindOptionsReference[]</code> | optional array of references to search object for. |
|
||||
| [search](./kibana-plugin-core-server.savedobjectsexportbytypeoptions.search.md) | <code>string</code> | optional query string to filter exported objects. |
|
||||
| [types](./kibana-plugin-core-server.savedobjectsexportbytypeoptions.types.md) | <code>string[]</code> | array of saved object types. |
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExportByTypeOptions](./kibana-plugin-core-server.savedobjectsexportbytypeoptions.md) > [search](./kibana-plugin-core-server.savedobjectsexportbytypeoptions.search.md)
|
||||
|
||||
## SavedObjectsExportByTypeOptions.search property
|
||||
|
||||
optional query string to filter exported objects.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
search?: string;
|
||||
```
|
|
@ -0,0 +1,13 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExportByTypeOptions](./kibana-plugin-core-server.savedobjectsexportbytypeoptions.md) > [types](./kibana-plugin-core-server.savedobjectsexportbytypeoptions.types.md)
|
||||
|
||||
## SavedObjectsExportByTypeOptions.types property
|
||||
|
||||
array of saved object types.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
types: string[];
|
||||
```
|
|
@ -0,0 +1,11 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExporter](./kibana-plugin-core-server.savedobjectsexporter.md) > ["\#private"](./kibana-plugin-core-server.savedobjectsexporter.__private_.md)
|
||||
|
||||
## SavedObjectsExporter."\#private" property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
#private;
|
||||
```
|
|
@ -0,0 +1,23 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExporter](./kibana-plugin-core-server.savedobjectsexporter.md) > [(constructor)](./kibana-plugin-core-server.savedobjectsexporter._constructor_.md)
|
||||
|
||||
## SavedObjectsExporter.(constructor)
|
||||
|
||||
Constructs a new instance of the `SavedObjectsExporter` class
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
constructor({ savedObjectsClient, exportSizeLimit, }: {
|
||||
savedObjectsClient: SavedObjectsClientContract;
|
||||
exportSizeLimit: number;
|
||||
});
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| { savedObjectsClient, exportSizeLimit, } | <code>{</code><br/><code> savedObjectsClient: SavedObjectsClientContract;</code><br/><code> exportSizeLimit: number;</code><br/><code> }</code> | |
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExporter](./kibana-plugin-core-server.savedobjectsexporter.md) > [exportByObjects](./kibana-plugin-core-server.savedobjectsexporter.exportbyobjects.md)
|
||||
|
||||
## SavedObjectsExporter.exportByObjects() method
|
||||
|
||||
Generates an export stream for given object references.
|
||||
|
||||
See the [options](./kibana-plugin-core-server.savedobjectsexportbyobjectoptions.md) for more detailed information.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
exportByObjects(options: SavedObjectsExportByObjectOptions): Promise<import("stream").Readable>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| options | <code>SavedObjectsExportByObjectOptions</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`Promise<import("stream").Readable>`
|
||||
|
||||
## Exceptions
|
||||
|
||||
SavedObjectsExportError
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExporter](./kibana-plugin-core-server.savedobjectsexporter.md) > [exportByTypes](./kibana-plugin-core-server.savedobjectsexporter.exportbytypes.md)
|
||||
|
||||
## SavedObjectsExporter.exportByTypes() method
|
||||
|
||||
Generates an export stream for given types.
|
||||
|
||||
See the [options](./kibana-plugin-core-server.savedobjectsexportbytypeoptions.md) for more detailed information.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
exportByTypes(options: SavedObjectsExportByTypeOptions): Promise<import("stream").Readable>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| options | <code>SavedObjectsExportByTypeOptions</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`Promise<import("stream").Readable>`
|
||||
|
||||
## Exceptions
|
||||
|
||||
SavedObjectsExportError
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExporter](./kibana-plugin-core-server.savedobjectsexporter.md)
|
||||
|
||||
## SavedObjectsExporter class
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare class SavedObjectsExporter
|
||||
```
|
||||
|
||||
## Constructors
|
||||
|
||||
| Constructor | Modifiers | Description |
|
||||
| --- | --- | --- |
|
||||
| [(constructor)({ savedObjectsClient, exportSizeLimit, })](./kibana-plugin-core-server.savedobjectsexporter._constructor_.md) | | Constructs a new instance of the <code>SavedObjectsExporter</code> class |
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| ["\#private"](./kibana-plugin-core-server.savedobjectsexporter.__private_.md) | | <code></code> | |
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Modifiers | Description |
|
||||
| --- | --- | --- |
|
||||
| [exportByObjects(options)](./kibana-plugin-core-server.savedobjectsexporter.exportbyobjects.md) | | Generates an export stream for given object references.<!-- -->See the [options](./kibana-plugin-core-server.savedobjectsexportbyobjectoptions.md) for more detailed information. |
|
||||
| [exportByTypes(options)](./kibana-plugin-core-server.savedobjectsexporter.exportbytypes.md) | | Generates an export stream for given types.<!-- -->See the [options](./kibana-plugin-core-server.savedobjectsexportbytypeoptions.md) for more detailed information. |
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExportError](./kibana-plugin-core-server.savedobjectsexporterror.md) > [(constructor)](./kibana-plugin-core-server.savedobjectsexporterror._constructor_.md)
|
||||
|
||||
## SavedObjectsExportError.(constructor)
|
||||
|
||||
Constructs a new instance of the `SavedObjectsExportError` class
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
constructor(type: string, message: string, attributes?: Record<string, any> | undefined);
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| type | <code>string</code> | |
|
||||
| message | <code>string</code> | |
|
||||
| attributes | <code>Record<string, any> | undefined</code> | |
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExportError](./kibana-plugin-core-server.savedobjectsexporterror.md) > [attributes](./kibana-plugin-core-server.savedobjectsexporterror.attributes.md)
|
||||
|
||||
## SavedObjectsExportError.attributes property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
readonly attributes?: Record<string, any> | undefined;
|
||||
```
|
|
@ -0,0 +1,22 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExportError](./kibana-plugin-core-server.savedobjectsexporterror.md) > [exportSizeExceeded](./kibana-plugin-core-server.savedobjectsexporterror.exportsizeexceeded.md)
|
||||
|
||||
## SavedObjectsExportError.exportSizeExceeded() method
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
static exportSizeExceeded(limit: number): SavedObjectsExportError;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| limit | <code>number</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`SavedObjectsExportError`
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExportError](./kibana-plugin-core-server.savedobjectsexporterror.md)
|
||||
|
||||
## SavedObjectsExportError class
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare class SavedObjectsExportError extends Error
|
||||
```
|
||||
|
||||
## Constructors
|
||||
|
||||
| Constructor | Modifiers | Description |
|
||||
| --- | --- | --- |
|
||||
| [(constructor)(type, message, attributes)](./kibana-plugin-core-server.savedobjectsexporterror._constructor_.md) | | Constructs a new instance of the <code>SavedObjectsExportError</code> class |
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| [attributes](./kibana-plugin-core-server.savedobjectsexporterror.attributes.md) | | <code>Record<string, any> | undefined</code> | |
|
||||
| [type](./kibana-plugin-core-server.savedobjectsexporterror.type.md) | | <code>string</code> | |
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Modifiers | Description |
|
||||
| --- | --- | --- |
|
||||
| [exportSizeExceeded(limit)](./kibana-plugin-core-server.savedobjectsexporterror.exportsizeexceeded.md) | <code>static</code> | |
|
||||
| [objectFetchError(objects)](./kibana-plugin-core-server.savedobjectsexporterror.objectfetcherror.md) | <code>static</code> | |
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExportError](./kibana-plugin-core-server.savedobjectsexporterror.md) > [objectFetchError](./kibana-plugin-core-server.savedobjectsexporterror.objectfetcherror.md)
|
||||
|
||||
## SavedObjectsExportError.objectFetchError() method
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
static objectFetchError(objects: SavedObject[]): SavedObjectsExportError;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| objects | <code>SavedObject[]</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`SavedObjectsExportError`
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExportError](./kibana-plugin-core-server.savedobjectsexporterror.md) > [type](./kibana-plugin-core-server.savedobjectsexporterror.type.md)
|
||||
|
||||
## SavedObjectsExportError.type property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
readonly type: string;
|
||||
```
|
|
@ -1,13 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExportOptions](./kibana-plugin-core-server.savedobjectsexportoptions.md) > [exportSizeLimit](./kibana-plugin-core-server.savedobjectsexportoptions.exportsizelimit.md)
|
||||
|
||||
## SavedObjectsExportOptions.exportSizeLimit property
|
||||
|
||||
the maximum number of objects to export.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
exportSizeLimit: number;
|
||||
```
|
|
@ -1,13 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExportOptions](./kibana-plugin-core-server.savedobjectsexportoptions.md) > [hasReference](./kibana-plugin-core-server.savedobjectsexportoptions.hasreference.md)
|
||||
|
||||
## SavedObjectsExportOptions.hasReference property
|
||||
|
||||
optional array of references to search object for when exporting by types
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
hasReference?: SavedObjectsFindOptionsReference[];
|
||||
```
|
|
@ -1,13 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExportOptions](./kibana-plugin-core-server.savedobjectsexportoptions.md) > [includeReferencesDeep](./kibana-plugin-core-server.savedobjectsexportoptions.includereferencesdeep.md)
|
||||
|
||||
## SavedObjectsExportOptions.includeReferencesDeep property
|
||||
|
||||
flag to also include all related saved objects in the export stream.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
includeReferencesDeep?: boolean;
|
||||
```
|
|
@ -1,28 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExportOptions](./kibana-plugin-core-server.savedobjectsexportoptions.md)
|
||||
|
||||
## SavedObjectsExportOptions interface
|
||||
|
||||
Options controlling the export operation.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface SavedObjectsExportOptions
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [excludeExportDetails](./kibana-plugin-core-server.savedobjectsexportoptions.excludeexportdetails.md) | <code>boolean</code> | flag to not append [export details](./kibana-plugin-core-server.savedobjectsexportresultdetails.md) to the end of the export stream. |
|
||||
| [exportSizeLimit](./kibana-plugin-core-server.savedobjectsexportoptions.exportsizelimit.md) | <code>number</code> | the maximum number of objects to export. |
|
||||
| [hasReference](./kibana-plugin-core-server.savedobjectsexportoptions.hasreference.md) | <code>SavedObjectsFindOptionsReference[]</code> | optional array of references to search object for when exporting by types |
|
||||
| [includeReferencesDeep](./kibana-plugin-core-server.savedobjectsexportoptions.includereferencesdeep.md) | <code>boolean</code> | flag to also include all related saved objects in the export stream. |
|
||||
| [namespace](./kibana-plugin-core-server.savedobjectsexportoptions.namespace.md) | <code>string</code> | optional namespace to override the namespace used by the savedObjectsClient. |
|
||||
| [objects](./kibana-plugin-core-server.savedobjectsexportoptions.objects.md) | <code>Array<{</code><br/><code> id: string;</code><br/><code> type: string;</code><br/><code> }></code> | optional array of objects to export. |
|
||||
| [savedObjectsClient](./kibana-plugin-core-server.savedobjectsexportoptions.savedobjectsclient.md) | <code>SavedObjectsClientContract</code> | an instance of the SavedObjectsClient. |
|
||||
| [search](./kibana-plugin-core-server.savedobjectsexportoptions.search.md) | <code>string</code> | optional query string to filter exported objects. |
|
||||
| [types](./kibana-plugin-core-server.savedobjectsexportoptions.types.md) | <code>string[]</code> | optional array of saved object types. |
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExportOptions](./kibana-plugin-core-server.savedobjectsexportoptions.md) > [objects](./kibana-plugin-core-server.savedobjectsexportoptions.objects.md)
|
||||
|
||||
## SavedObjectsExportOptions.objects property
|
||||
|
||||
optional array of objects to export.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
objects?: Array<{
|
||||
id: string;
|
||||
type: string;
|
||||
}>;
|
||||
```
|
|
@ -1,13 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExportOptions](./kibana-plugin-core-server.savedobjectsexportoptions.md) > [savedObjectsClient](./kibana-plugin-core-server.savedobjectsexportoptions.savedobjectsclient.md)
|
||||
|
||||
## SavedObjectsExportOptions.savedObjectsClient property
|
||||
|
||||
an instance of the SavedObjectsClient.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
savedObjectsClient: SavedObjectsClientContract;
|
||||
```
|
|
@ -1,13 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExportOptions](./kibana-plugin-core-server.savedobjectsexportoptions.md) > [search](./kibana-plugin-core-server.savedobjectsexportoptions.search.md)
|
||||
|
||||
## SavedObjectsExportOptions.search property
|
||||
|
||||
optional query string to filter exported objects.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
search?: string;
|
||||
```
|
|
@ -1,13 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsExportOptions](./kibana-plugin-core-server.savedobjectsexportoptions.md) > [types](./kibana-plugin-core-server.savedobjectsexportoptions.types.md)
|
||||
|
||||
## SavedObjectsExportOptions.types property
|
||||
|
||||
optional array of saved object types.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
types?: string[];
|
||||
```
|
|
@ -0,0 +1,11 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImporter](./kibana-plugin-core-server.savedobjectsimporter.md) > ["\#private"](./kibana-plugin-core-server.savedobjectsimporter.__private_.md)
|
||||
|
||||
## SavedObjectsImporter."\#private" property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
#private;
|
||||
```
|
|
@ -0,0 +1,24 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImporter](./kibana-plugin-core-server.savedobjectsimporter.md) > [(constructor)](./kibana-plugin-core-server.savedobjectsimporter._constructor_.md)
|
||||
|
||||
## SavedObjectsImporter.(constructor)
|
||||
|
||||
Constructs a new instance of the `SavedObjectsImporter` class
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
constructor({ savedObjectsClient, typeRegistry, importSizeLimit, }: {
|
||||
savedObjectsClient: SavedObjectsClientContract;
|
||||
typeRegistry: ISavedObjectTypeRegistry;
|
||||
importSizeLimit: number;
|
||||
});
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| { savedObjectsClient, typeRegistry, importSizeLimit, } | <code>{</code><br/><code> savedObjectsClient: SavedObjectsClientContract;</code><br/><code> typeRegistry: ISavedObjectTypeRegistry;</code><br/><code> importSizeLimit: number;</code><br/><code> }</code> | |
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImporter](./kibana-plugin-core-server.savedobjectsimporter.md) > [import](./kibana-plugin-core-server.savedobjectsimporter.import.md)
|
||||
|
||||
## SavedObjectsImporter.import() method
|
||||
|
||||
Import saved objects from given stream. See the [options](./kibana-plugin-core-server.savedobjectsimportoptions.md) for more detailed information.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
import({ readStream, createNewCopies, namespace, overwrite, }: SavedObjectsImportOptions): Promise<SavedObjectsImportResponse>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| { readStream, createNewCopies, namespace, overwrite, } | <code>SavedObjectsImportOptions</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`Promise<SavedObjectsImportResponse>`
|
||||
|
||||
## Exceptions
|
||||
|
||||
SavedObjectsImportError
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImporter](./kibana-plugin-core-server.savedobjectsimporter.md)
|
||||
|
||||
## SavedObjectsImporter class
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare class SavedObjectsImporter
|
||||
```
|
||||
|
||||
## Constructors
|
||||
|
||||
| Constructor | Modifiers | Description |
|
||||
| --- | --- | --- |
|
||||
| [(constructor)({ savedObjectsClient, typeRegistry, importSizeLimit, })](./kibana-plugin-core-server.savedobjectsimporter._constructor_.md) | | Constructs a new instance of the <code>SavedObjectsImporter</code> class |
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| ["\#private"](./kibana-plugin-core-server.savedobjectsimporter.__private_.md) | | <code></code> | |
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Modifiers | Description |
|
||||
| --- | --- | --- |
|
||||
| [import({ readStream, createNewCopies, namespace, overwrite, })](./kibana-plugin-core-server.savedobjectsimporter.import.md) | | Import saved objects from given stream. See the [options](./kibana-plugin-core-server.savedobjectsimportoptions.md) for more detailed information. |
|
||||
| [resolveImportErrors({ readStream, createNewCopies, namespace, retries, })](./kibana-plugin-core-server.savedobjectsimporter.resolveimporterrors.md) | | Resolve and return saved object import errors. See the [options](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.md) for more detailed informations. |
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImporter](./kibana-plugin-core-server.savedobjectsimporter.md) > [resolveImportErrors](./kibana-plugin-core-server.savedobjectsimporter.resolveimporterrors.md)
|
||||
|
||||
## SavedObjectsImporter.resolveImportErrors() method
|
||||
|
||||
Resolve and return saved object import errors. See the [options](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.md) for more detailed informations.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
resolveImportErrors({ readStream, createNewCopies, namespace, retries, }: SavedObjectsResolveImportErrorsOptions): Promise<SavedObjectsImportResponse>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| { readStream, createNewCopies, namespace, retries, } | <code>SavedObjectsResolveImportErrorsOptions</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`Promise<SavedObjectsImportResponse>`
|
||||
|
||||
## Exceptions
|
||||
|
||||
SavedObjectsImportError
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportError](./kibana-plugin-core-server.savedobjectsimporterror.md) > [id](./kibana-plugin-core-server.savedobjectsimporterror.id.md)
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportError](./kibana-plugin-core-server.savedobjectsimporterror.md) > [attributes](./kibana-plugin-core-server.savedobjectsimporterror.attributes.md)
|
||||
|
||||
## SavedObjectsImportError.id property
|
||||
## SavedObjectsImportError.attributes property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
id: string;
|
||||
readonly attributes?: Record<string, any> | undefined;
|
||||
```
|
|
@ -0,0 +1,22 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportError](./kibana-plugin-core-server.savedobjectsimporterror.md) > [importSizeExceeded](./kibana-plugin-core-server.savedobjectsimporterror.importsizeexceeded.md)
|
||||
|
||||
## SavedObjectsImportError.importSizeExceeded() method
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
static importSizeExceeded(limit: number): SavedObjectsImportError;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| limit | <code>number</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`SavedObjectsImportError`
|
||||
|
|
@ -2,24 +2,29 @@
|
|||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportError](./kibana-plugin-core-server.savedobjectsimporterror.md)
|
||||
|
||||
## SavedObjectsImportError interface
|
||||
## SavedObjectsImportError class
|
||||
|
||||
Represents a failure to import.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface SavedObjectsImportError
|
||||
export declare class SavedObjectsImportError extends Error
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [error](./kibana-plugin-core-server.savedobjectsimporterror.error.md) | <code>SavedObjectsImportConflictError | SavedObjectsImportAmbiguousConflictError | SavedObjectsImportUnsupportedTypeError | SavedObjectsImportMissingReferencesError | SavedObjectsImportUnknownError</code> | |
|
||||
| [id](./kibana-plugin-core-server.savedobjectsimporterror.id.md) | <code>string</code> | |
|
||||
| [meta](./kibana-plugin-core-server.savedobjectsimporterror.meta.md) | <code>{</code><br/><code> title?: string;</code><br/><code> icon?: string;</code><br/><code> }</code> | |
|
||||
| [overwrite](./kibana-plugin-core-server.savedobjectsimporterror.overwrite.md) | <code>boolean</code> | If <code>overwrite</code> is specified, an attempt was made to overwrite an existing object. |
|
||||
| [title](./kibana-plugin-core-server.savedobjectsimporterror.title.md) | <code>string</code> | |
|
||||
| [type](./kibana-plugin-core-server.savedobjectsimporterror.type.md) | <code>string</code> | |
|
||||
| Property | Modifiers | Type | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| [attributes](./kibana-plugin-core-server.savedobjectsimporterror.attributes.md) | | <code>Record<string, any> | undefined</code> | |
|
||||
| [type](./kibana-plugin-core-server.savedobjectsimporterror.type.md) | | <code>string</code> | |
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Modifiers | Description |
|
||||
| --- | --- | --- |
|
||||
| [importSizeExceeded(limit)](./kibana-plugin-core-server.savedobjectsimporterror.importsizeexceeded.md) | <code>static</code> | |
|
||||
| [nonUniqueImportObjects(nonUniqueEntries)](./kibana-plugin-core-server.savedobjectsimporterror.nonuniqueimportobjects.md) | <code>static</code> | |
|
||||
| [nonUniqueRetryDestinations(nonUniqueRetryDestinations)](./kibana-plugin-core-server.savedobjectsimporterror.nonuniqueretrydestinations.md) | <code>static</code> | |
|
||||
| [nonUniqueRetryObjects(nonUniqueRetryObjects)](./kibana-plugin-core-server.savedobjectsimporterror.nonuniqueretryobjects.md) | <code>static</code> | |
|
||||
| [referencesFetchError(objects)](./kibana-plugin-core-server.savedobjectsimporterror.referencesfetcherror.md) | <code>static</code> | |
|
||||
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportError](./kibana-plugin-core-server.savedobjectsimporterror.md) > [nonUniqueImportObjects](./kibana-plugin-core-server.savedobjectsimporterror.nonuniqueimportobjects.md)
|
||||
|
||||
## SavedObjectsImportError.nonUniqueImportObjects() method
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
static nonUniqueImportObjects(nonUniqueEntries: string[]): SavedObjectsImportError;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| nonUniqueEntries | <code>string[]</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`SavedObjectsImportError`
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportError](./kibana-plugin-core-server.savedobjectsimporterror.md) > [nonUniqueRetryDestinations](./kibana-plugin-core-server.savedobjectsimporterror.nonuniqueretrydestinations.md)
|
||||
|
||||
## SavedObjectsImportError.nonUniqueRetryDestinations() method
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
static nonUniqueRetryDestinations(nonUniqueRetryDestinations: string[]): SavedObjectsImportError;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| nonUniqueRetryDestinations | <code>string[]</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`SavedObjectsImportError`
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportError](./kibana-plugin-core-server.savedobjectsimporterror.md) > [nonUniqueRetryObjects](./kibana-plugin-core-server.savedobjectsimporterror.nonuniqueretryobjects.md)
|
||||
|
||||
## SavedObjectsImportError.nonUniqueRetryObjects() method
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
static nonUniqueRetryObjects(nonUniqueRetryObjects: string[]): SavedObjectsImportError;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| nonUniqueRetryObjects | <code>string[]</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`SavedObjectsImportError`
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportError](./kibana-plugin-core-server.savedobjectsimporterror.md) > [referencesFetchError](./kibana-plugin-core-server.savedobjectsimporterror.referencesfetcherror.md)
|
||||
|
||||
## SavedObjectsImportError.referencesFetchError() method
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
static referencesFetchError(objects: SavedObject[]): SavedObjectsImportError;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| objects | <code>SavedObject[]</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`SavedObjectsImportError`
|
||||
|
|
@ -7,5 +7,5 @@
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
type: string;
|
||||
readonly type: string;
|
||||
```
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportError](./kibana-plugin-core-server.savedobjectsimporterror.md) > [error](./kibana-plugin-core-server.savedobjectsimporterror.error.md)
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportFailure](./kibana-plugin-core-server.savedobjectsimportfailure.md) > [error](./kibana-plugin-core-server.savedobjectsimportfailure.error.md)
|
||||
|
||||
## SavedObjectsImportError.error property
|
||||
## SavedObjectsImportFailure.error property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportFailure](./kibana-plugin-core-server.savedobjectsimportfailure.md) > [id](./kibana-plugin-core-server.savedobjectsimportfailure.id.md)
|
||||
|
||||
## SavedObjectsImportFailure.id property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
id: string;
|
||||
```
|
|
@ -0,0 +1,25 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportFailure](./kibana-plugin-core-server.savedobjectsimportfailure.md)
|
||||
|
||||
## SavedObjectsImportFailure interface
|
||||
|
||||
Represents a failure to import.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface SavedObjectsImportFailure
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [error](./kibana-plugin-core-server.savedobjectsimportfailure.error.md) | <code>SavedObjectsImportConflictError | SavedObjectsImportAmbiguousConflictError | SavedObjectsImportUnsupportedTypeError | SavedObjectsImportMissingReferencesError | SavedObjectsImportUnknownError</code> | |
|
||||
| [id](./kibana-plugin-core-server.savedobjectsimportfailure.id.md) | <code>string</code> | |
|
||||
| [meta](./kibana-plugin-core-server.savedobjectsimportfailure.meta.md) | <code>{</code><br/><code> title?: string;</code><br/><code> icon?: string;</code><br/><code> }</code> | |
|
||||
| [overwrite](./kibana-plugin-core-server.savedobjectsimportfailure.overwrite.md) | <code>boolean</code> | If <code>overwrite</code> is specified, an attempt was made to overwrite an existing object. |
|
||||
| [title](./kibana-plugin-core-server.savedobjectsimportfailure.title.md) | <code>string</code> | |
|
||||
| [type](./kibana-plugin-core-server.savedobjectsimportfailure.type.md) | <code>string</code> | |
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportError](./kibana-plugin-core-server.savedobjectsimporterror.md) > [meta](./kibana-plugin-core-server.savedobjectsimporterror.meta.md)
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportFailure](./kibana-plugin-core-server.savedobjectsimportfailure.md) > [meta](./kibana-plugin-core-server.savedobjectsimportfailure.meta.md)
|
||||
|
||||
## SavedObjectsImportError.meta property
|
||||
## SavedObjectsImportFailure.meta property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportError](./kibana-plugin-core-server.savedobjectsimporterror.md) > [overwrite](./kibana-plugin-core-server.savedobjectsimporterror.overwrite.md)
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportFailure](./kibana-plugin-core-server.savedobjectsimportfailure.md) > [overwrite](./kibana-plugin-core-server.savedobjectsimportfailure.overwrite.md)
|
||||
|
||||
## SavedObjectsImportError.overwrite property
|
||||
## SavedObjectsImportFailure.overwrite property
|
||||
|
||||
If `overwrite` is specified, an attempt was made to overwrite an existing object.
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportError](./kibana-plugin-core-server.savedobjectsimporterror.md) > [title](./kibana-plugin-core-server.savedobjectsimporterror.title.md)
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportFailure](./kibana-plugin-core-server.savedobjectsimportfailure.md) > [title](./kibana-plugin-core-server.savedobjectsimportfailure.title.md)
|
||||
|
||||
## SavedObjectsImportError.title property
|
||||
## SavedObjectsImportFailure.title property
|
||||
|
||||
> Warning: This API is now obsolete.
|
||||
>
|
|
@ -0,0 +1,11 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportFailure](./kibana-plugin-core-server.savedobjectsimportfailure.md) > [type](./kibana-plugin-core-server.savedobjectsimportfailure.type.md)
|
||||
|
||||
## SavedObjectsImportFailure.type property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
type: string;
|
||||
```
|
|
@ -18,9 +18,6 @@ export interface SavedObjectsImportOptions
|
|||
| --- | --- | --- |
|
||||
| [createNewCopies](./kibana-plugin-core-server.savedobjectsimportoptions.createnewcopies.md) | <code>boolean</code> | If true, will create new copies of import objects, each with a random <code>id</code> and undefined <code>originId</code>. |
|
||||
| [namespace](./kibana-plugin-core-server.savedobjectsimportoptions.namespace.md) | <code>string</code> | if specified, will import in given namespace, else will import as global object |
|
||||
| [objectLimit](./kibana-plugin-core-server.savedobjectsimportoptions.objectlimit.md) | <code>number</code> | The maximum number of object to import |
|
||||
| [overwrite](./kibana-plugin-core-server.savedobjectsimportoptions.overwrite.md) | <code>boolean</code> | If true, will override existing object if present. Note: this has no effect when used with the <code>createNewCopies</code> option. |
|
||||
| [readStream](./kibana-plugin-core-server.savedobjectsimportoptions.readstream.md) | <code>Readable</code> | The stream of [saved objects](./kibana-plugin-core-server.savedobject.md) to import |
|
||||
| [savedObjectsClient](./kibana-plugin-core-server.savedobjectsimportoptions.savedobjectsclient.md) | <code>SavedObjectsClientContract</code> | [client](./kibana-plugin-core-server.savedobjectsclientcontract.md) to use to perform the import operation |
|
||||
| [typeRegistry](./kibana-plugin-core-server.savedobjectsimportoptions.typeregistry.md) | <code>ISavedObjectTypeRegistry</code> | The registry of all known saved object types |
|
||||
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportOptions](./kibana-plugin-core-server.savedobjectsimportoptions.md) > [objectLimit](./kibana-plugin-core-server.savedobjectsimportoptions.objectlimit.md)
|
||||
|
||||
## SavedObjectsImportOptions.objectLimit property
|
||||
|
||||
The maximum number of object to import
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
objectLimit: number;
|
||||
```
|
|
@ -1,13 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportOptions](./kibana-plugin-core-server.savedobjectsimportoptions.md) > [savedObjectsClient](./kibana-plugin-core-server.savedobjectsimportoptions.savedobjectsclient.md)
|
||||
|
||||
## SavedObjectsImportOptions.savedObjectsClient property
|
||||
|
||||
[client](./kibana-plugin-core-server.savedobjectsclientcontract.md) to use to perform the import operation
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
savedObjectsClient: SavedObjectsClientContract;
|
||||
```
|
|
@ -1,13 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportOptions](./kibana-plugin-core-server.savedobjectsimportoptions.md) > [typeRegistry](./kibana-plugin-core-server.savedobjectsimportoptions.typeregistry.md)
|
||||
|
||||
## SavedObjectsImportOptions.typeRegistry property
|
||||
|
||||
The registry of all known saved object types
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
typeRegistry: ISavedObjectTypeRegistry;
|
||||
```
|
|
@ -7,5 +7,5 @@
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
errors?: SavedObjectsImportError[];
|
||||
errors?: SavedObjectsImportFailure[];
|
||||
```
|
||||
|
|
|
@ -16,7 +16,7 @@ export interface SavedObjectsImportResponse
|
|||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [errors](./kibana-plugin-core-server.savedobjectsimportresponse.errors.md) | <code>SavedObjectsImportError[]</code> | |
|
||||
| [errors](./kibana-plugin-core-server.savedobjectsimportresponse.errors.md) | <code>SavedObjectsImportFailure[]</code> | |
|
||||
| [success](./kibana-plugin-core-server.savedobjectsimportresponse.success.md) | <code>boolean</code> | |
|
||||
| [successCount](./kibana-plugin-core-server.savedobjectsimportresponse.successcount.md) | <code>number</code> | |
|
||||
| [successResults](./kibana-plugin-core-server.savedobjectsimportresponse.successresults.md) | <code>SavedObjectsImportSuccess[]</code> | |
|
||||
|
|
|
@ -18,9 +18,6 @@ export interface SavedObjectsResolveImportErrorsOptions
|
|||
| --- | --- | --- |
|
||||
| [createNewCopies](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.createnewcopies.md) | <code>boolean</code> | If true, will create new copies of import objects, each with a random <code>id</code> and undefined <code>originId</code>. |
|
||||
| [namespace](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.namespace.md) | <code>string</code> | if specified, will import in given namespace |
|
||||
| [objectLimit](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.objectlimit.md) | <code>number</code> | The maximum number of object to import |
|
||||
| [readStream](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.readstream.md) | <code>Readable</code> | The stream of [saved objects](./kibana-plugin-core-server.savedobject.md) to resolve errors from |
|
||||
| [retries](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.retries.md) | <code>SavedObjectsImportRetry[]</code> | saved object import references to retry |
|
||||
| [savedObjectsClient](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.savedobjectsclient.md) | <code>SavedObjectsClientContract</code> | client to use to perform the import operation |
|
||||
| [typeRegistry](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.typeregistry.md) | <code>ISavedObjectTypeRegistry</code> | The registry of all known saved object types |
|
||||
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsResolveImportErrorsOptions](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.md) > [objectLimit](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.objectlimit.md)
|
||||
|
||||
## SavedObjectsResolveImportErrorsOptions.objectLimit property
|
||||
|
||||
The maximum number of object to import
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
objectLimit: number;
|
||||
```
|
|
@ -1,13 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsResolveImportErrorsOptions](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.md) > [savedObjectsClient](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.savedobjectsclient.md)
|
||||
|
||||
## SavedObjectsResolveImportErrorsOptions.savedObjectsClient property
|
||||
|
||||
client to use to perform the import operation
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
savedObjectsClient: SavedObjectsClientContract;
|
||||
```
|
|
@ -1,13 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsResolveImportErrorsOptions](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.md) > [typeRegistry](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.typeregistry.md)
|
||||
|
||||
## SavedObjectsResolveImportErrorsOptions.typeRegistry property
|
||||
|
||||
The registry of all known saved object types
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
typeRegistry: ISavedObjectTypeRegistry;
|
||||
```
|
|
@ -1,13 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsServiceSetup](./kibana-plugin-core-server.savedobjectsservicesetup.md) > [getImportExportObjectLimit](./kibana-plugin-core-server.savedobjectsservicesetup.getimportexportobjectlimit.md)
|
||||
|
||||
## SavedObjectsServiceSetup.getImportExportObjectLimit property
|
||||
|
||||
Returns the maximum number of objects allowed for import or export operations.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
getImportExportObjectLimit: () => number;
|
||||
```
|
|
@ -52,7 +52,6 @@ export class Plugin() {
|
|||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [addClientWrapper](./kibana-plugin-core-server.savedobjectsservicesetup.addclientwrapper.md) | <code>(priority: number, id: string, factory: SavedObjectsClientWrapperFactory) => void</code> | Add a [client wrapper factory](./kibana-plugin-core-server.savedobjectsclientwrapperfactory.md) with the given priority. |
|
||||
| [getImportExportObjectLimit](./kibana-plugin-core-server.savedobjectsservicesetup.getimportexportobjectlimit.md) | <code>() => number</code> | Returns the maximum number of objects allowed for import or export operations. |
|
||||
| [registerType](./kibana-plugin-core-server.savedobjectsservicesetup.registertype.md) | <code>(type: SavedObjectsType) => void</code> | Register a [savedObjects type](./kibana-plugin-core-server.savedobjectstype.md) definition.<!-- -->See the [mappings format](./kibana-plugin-core-server.savedobjectstypemappingdefinition.md) and [migration format](./kibana-plugin-core-server.savedobjectmigrationmap.md) for more details about these. |
|
||||
| [setClientFactoryProvider](./kibana-plugin-core-server.savedobjectsservicesetup.setclientfactoryprovider.md) | <code>(clientFactoryProvider: SavedObjectsClientFactoryProvider) => void</code> | Set the default [factory provider](./kibana-plugin-core-server.savedobjectsclientfactoryprovider.md) for creating Saved Objects clients. Only one provider can be set, subsequent calls to this method will fail. |
|
||||
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsServiceStart](./kibana-plugin-core-server.savedobjectsservicestart.md) > [createExporter](./kibana-plugin-core-server.savedobjectsservicestart.createexporter.md)
|
||||
|
||||
## SavedObjectsServiceStart.createExporter property
|
||||
|
||||
Creates an [exporter](./kibana-plugin-core-server.isavedobjectsexporter.md) bound to given client.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
createExporter: (client: SavedObjectsClientContract) => ISavedObjectsExporter;
|
||||
```
|
|
@ -0,0 +1,13 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsServiceStart](./kibana-plugin-core-server.savedobjectsservicestart.md) > [createImporter](./kibana-plugin-core-server.savedobjectsservicestart.createimporter.md)
|
||||
|
||||
## SavedObjectsServiceStart.createImporter property
|
||||
|
||||
Creates an [importer](./kibana-plugin-core-server.isavedobjectsimporter.md) bound to given client.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
createImporter: (client: SavedObjectsClientContract) => ISavedObjectsImporter;
|
||||
```
|
|
@ -16,6 +16,8 @@ export interface SavedObjectsServiceStart
|
|||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [createExporter](./kibana-plugin-core-server.savedobjectsservicestart.createexporter.md) | <code>(client: SavedObjectsClientContract) => ISavedObjectsExporter</code> | Creates an [exporter](./kibana-plugin-core-server.isavedobjectsexporter.md) bound to given client. |
|
||||
| [createImporter](./kibana-plugin-core-server.savedobjectsservicestart.createimporter.md) | <code>(client: SavedObjectsClientContract) => ISavedObjectsImporter</code> | Creates an [importer](./kibana-plugin-core-server.isavedobjectsimporter.md) bound to given client. |
|
||||
| [createInternalRepository](./kibana-plugin-core-server.savedobjectsservicestart.createinternalrepository.md) | <code>(includedHiddenTypes?: string[]) => ISavedObjectsRepository</code> | Creates a [Saved Objects repository](./kibana-plugin-core-server.isavedobjectsrepository.md) that uses the internal Kibana user for authenticating with Elasticsearch. |
|
||||
| [createScopedRepository](./kibana-plugin-core-server.savedobjectsservicestart.createscopedrepository.md) | <code>(req: KibanaRequest, includedHiddenTypes?: string[]) => ISavedObjectsRepository</code> | Creates a [Saved Objects repository](./kibana-plugin-core-server.isavedobjectsrepository.md) that uses the credentials from the passed in request to authenticate with Elasticsearch. |
|
||||
| [createSerializer](./kibana-plugin-core-server.savedobjectsservicestart.createserializer.md) | <code>() => SavedObjectsSerializer</code> | Creates a [serializer](./kibana-plugin-core-server.savedobjectsserializer.md) that is aware of all registered types. |
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
|
||||
`addTriggerAction` is similar to `attachAction` as it attaches action to a trigger, but it also registers the action, if it has not been registered, yet.
|
||||
|
||||
`addTriggerAction` also infers better typing of the `action` argument.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
|
|
|
@ -21,7 +21,7 @@ export declare class UiActionsService
|
|||
| Property | Modifiers | Type | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| [actions](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.actions.md) | | <code>ActionRegistry</code> | |
|
||||
| [addTriggerAction](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.addtriggeraction.md) | | <code>(triggerId: string, action: ActionDefinition) => void</code> | <code>addTriggerAction</code> is similar to <code>attachAction</code> as it attaches action to a trigger, but it also registers the action, if it has not been registered, yet.<code>addTriggerAction</code> also infers better typing of the <code>action</code> argument. |
|
||||
| [addTriggerAction](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.addtriggeraction.md) | | <code>(triggerId: string, action: ActionDefinition) => void</code> | <code>addTriggerAction</code> is similar to <code>attachAction</code> as it attaches action to a trigger, but it also registers the action, if it has not been registered, yet. |
|
||||
| [attachAction](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.attachaction.md) | | <code>(triggerId: string, actionId: string) => void</code> | |
|
||||
| [clear](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.clear.md) | | <code>() => void</code> | Removes all registered triggers and actions. |
|
||||
| [detachAction](./kibana-plugin-plugins-ui_actions-public.uiactionsservice.detachaction.md) | | <code>(triggerId: string, actionId: string) => void</code> | |
|
||||
|
|
|
@ -149,7 +149,7 @@ export {
|
|||
SavedObjectsImportUnsupportedTypeError,
|
||||
SavedObjectsImportMissingReferencesError,
|
||||
SavedObjectsImportUnknownError,
|
||||
SavedObjectsImportError,
|
||||
SavedObjectsImportFailure,
|
||||
SavedObjectsImportRetry,
|
||||
SavedObjectsNamespaceType,
|
||||
} from './saved_objects';
|
||||
|
|
|
@ -1246,7 +1246,7 @@ export interface SavedObjectsImportConflictError {
|
|||
}
|
||||
|
||||
// @public
|
||||
export interface SavedObjectsImportError {
|
||||
export interface SavedObjectsImportFailure {
|
||||
// (undocumented)
|
||||
error: SavedObjectsImportConflictError | SavedObjectsImportAmbiguousConflictError | SavedObjectsImportUnsupportedTypeError | SavedObjectsImportMissingReferencesError | SavedObjectsImportUnknownError;
|
||||
// (undocumented)
|
||||
|
@ -1277,7 +1277,7 @@ export interface SavedObjectsImportMissingReferencesError {
|
|||
// @public
|
||||
export interface SavedObjectsImportResponse {
|
||||
// (undocumented)
|
||||
errors?: SavedObjectsImportError[];
|
||||
errors?: SavedObjectsImportFailure[];
|
||||
// (undocumented)
|
||||
success: boolean;
|
||||
// (undocumented)
|
||||
|
|
|
@ -43,7 +43,7 @@ export {
|
|||
SavedObjectsImportUnsupportedTypeError,
|
||||
SavedObjectsImportMissingReferencesError,
|
||||
SavedObjectsImportUnknownError,
|
||||
SavedObjectsImportError,
|
||||
SavedObjectsImportFailure,
|
||||
SavedObjectsImportRetry,
|
||||
SavedObjectsNamespaceType,
|
||||
} from '../../server/types';
|
||||
|
|
|
@ -21,7 +21,12 @@
|
|||
import { InternalCoreStart } from './internal_types';
|
||||
import { KibanaRequest } from './http/router';
|
||||
import { SavedObjectsClientContract } from './saved_objects/types';
|
||||
import { InternalSavedObjectsServiceStart, ISavedObjectTypeRegistry } from './saved_objects';
|
||||
import {
|
||||
InternalSavedObjectsServiceStart,
|
||||
ISavedObjectTypeRegistry,
|
||||
ISavedObjectsExporter,
|
||||
ISavedObjectsImporter,
|
||||
} from './saved_objects';
|
||||
import {
|
||||
InternalElasticsearchServiceStart,
|
||||
IScopedClusterClient,
|
||||
|
@ -64,6 +69,8 @@ class CoreSavedObjectsRouteHandlerContext {
|
|||
) {}
|
||||
#scopedSavedObjectsClient?: SavedObjectsClientContract;
|
||||
#typeRegistry?: ISavedObjectTypeRegistry;
|
||||
#exporter?: ISavedObjectsExporter;
|
||||
#importer?: ISavedObjectsImporter;
|
||||
|
||||
public get client() {
|
||||
if (this.#scopedSavedObjectsClient == null) {
|
||||
|
@ -78,6 +85,20 @@ class CoreSavedObjectsRouteHandlerContext {
|
|||
}
|
||||
return this.#typeRegistry;
|
||||
}
|
||||
|
||||
public get exporter() {
|
||||
if (this.#exporter == null) {
|
||||
this.#exporter = this.savedObjectsStart.createExporter(this.client);
|
||||
}
|
||||
return this.#exporter;
|
||||
}
|
||||
|
||||
public get importer() {
|
||||
if (this.#importer == null) {
|
||||
this.#importer = this.savedObjectsStart.createImporter(this.client);
|
||||
}
|
||||
return this.#importer;
|
||||
}
|
||||
}
|
||||
|
||||
class CoreUiSettingsRouteHandlerContext {
|
||||
|
|
|
@ -24,7 +24,6 @@ import {
|
|||
ISavedObjectsRepository,
|
||||
SavedObjectsImportOptions,
|
||||
SavedObjectsResolveImportErrorsOptions,
|
||||
SavedObjectsExportOptions,
|
||||
KibanaRequest,
|
||||
IBasePath,
|
||||
} from '..';
|
||||
|
@ -40,8 +39,10 @@ export type IncrementSavedObjectsImportOptions = BaseIncrementOptions &
|
|||
export type IncrementSavedObjectsResolveImportErrorsOptions = BaseIncrementOptions &
|
||||
Pick<SavedObjectsResolveImportErrorsOptions, 'createNewCopies'>;
|
||||
/** @internal */
|
||||
export type IncrementSavedObjectsExportOptions = BaseIncrementOptions &
|
||||
Pick<SavedObjectsExportOptions, 'types'> & { supportedTypes: string[] };
|
||||
export type IncrementSavedObjectsExportOptions = BaseIncrementOptions & {
|
||||
types?: string[];
|
||||
supportedTypes: string[];
|
||||
};
|
||||
|
||||
export const BULK_CREATE_STATS_PREFIX = 'apiCalls.savedObjectsBulkCreate';
|
||||
export const BULK_GET_STATS_PREFIX = 'apiCalls.savedObjectsBulkGet';
|
||||
|
|
|
@ -58,6 +58,8 @@ import {
|
|||
ISavedObjectTypeRegistry,
|
||||
SavedObjectsServiceSetup,
|
||||
SavedObjectsServiceStart,
|
||||
ISavedObjectsExporter,
|
||||
ISavedObjectsImporter,
|
||||
} from './saved_objects';
|
||||
import { CapabilitiesSetup, CapabilitiesStart } from './capabilities';
|
||||
import { MetricsServiceSetup, MetricsServiceStart } from './metrics';
|
||||
|
@ -265,13 +267,12 @@ export {
|
|||
SavedObjectsClientFactoryProvider,
|
||||
SavedObjectsCreateOptions,
|
||||
SavedObjectsErrorHelpers,
|
||||
SavedObjectsExportOptions,
|
||||
SavedObjectsExportResultDetails,
|
||||
SavedObjectsFindResult,
|
||||
SavedObjectsFindResponse,
|
||||
SavedObjectsImportConflictError,
|
||||
SavedObjectsImportAmbiguousConflictError,
|
||||
SavedObjectsImportError,
|
||||
SavedObjectsImportFailure,
|
||||
SavedObjectsImportMissingReferencesError,
|
||||
SavedObjectsImportOptions,
|
||||
SavedObjectsImportResponse,
|
||||
|
@ -317,9 +318,15 @@ export {
|
|||
SavedObjectMigrationMap,
|
||||
SavedObjectMigrationFn,
|
||||
SavedObjectsUtils,
|
||||
exportSavedObjectsToStream,
|
||||
importSavedObjectsFromStream,
|
||||
resolveSavedObjectsImportErrors,
|
||||
SavedObjectsExporter,
|
||||
ISavedObjectsExporter,
|
||||
SavedObjectExportBaseOptions,
|
||||
SavedObjectsExportByObjectOptions,
|
||||
SavedObjectsExportByTypeOptions,
|
||||
SavedObjectsExportError,
|
||||
SavedObjectsImporter,
|
||||
ISavedObjectsImporter,
|
||||
SavedObjectsImportError,
|
||||
} from './saved_objects';
|
||||
|
||||
export {
|
||||
|
@ -399,6 +406,8 @@ export interface RequestHandlerContext {
|
|||
savedObjects: {
|
||||
client: SavedObjectsClientContract;
|
||||
typeRegistry: ISavedObjectTypeRegistry;
|
||||
exporter: ISavedObjectsExporter;
|
||||
importer: ISavedObjectsImporter;
|
||||
};
|
||||
elasticsearch: {
|
||||
client: IScopedClusterClient;
|
||||
|
|
|
@ -211,6 +211,8 @@ export class LegacyService implements CoreService {
|
|||
createScopedRepository: startDeps.core.savedObjects.createScopedRepository,
|
||||
createInternalRepository: startDeps.core.savedObjects.createInternalRepository,
|
||||
createSerializer: startDeps.core.savedObjects.createSerializer,
|
||||
createExporter: startDeps.core.savedObjects.createExporter,
|
||||
createImporter: startDeps.core.savedObjects.createImporter,
|
||||
getTypeRegistry: startDeps.core.savedObjects.getTypeRegistry,
|
||||
},
|
||||
metrics: {
|
||||
|
@ -265,7 +267,6 @@ export class LegacyService implements CoreService {
|
|||
setClientFactoryProvider: setupDeps.core.savedObjects.setClientFactoryProvider,
|
||||
addClientWrapper: setupDeps.core.savedObjects.addClientWrapper,
|
||||
registerType: setupDeps.core.savedObjects.registerType,
|
||||
getImportExportObjectLimit: setupDeps.core.savedObjects.getImportExportObjectLimit,
|
||||
},
|
||||
status: {
|
||||
isStatusPageAnonymous: setupDeps.core.status.isStatusPageAnonymous,
|
||||
|
|
|
@ -203,6 +203,8 @@ function createCoreRequestHandlerContextMock() {
|
|||
savedObjects: {
|
||||
client: savedObjectsClientMock.create(),
|
||||
typeRegistry: savedObjectsTypeRegistryMock.create(),
|
||||
exporter: savedObjectsServiceMock.createExporter(),
|
||||
importer: savedObjectsServiceMock.createImporter(),
|
||||
},
|
||||
elasticsearch: {
|
||||
client: elasticsearchServiceMock.createScopedClusterClient(),
|
||||
|
|
|
@ -188,7 +188,6 @@ export function createPluginSetupContext<TPlugin, TPluginDependencies>(
|
|||
setClientFactoryProvider: deps.savedObjects.setClientFactoryProvider,
|
||||
addClientWrapper: deps.savedObjects.addClientWrapper,
|
||||
registerType: deps.savedObjects.registerType,
|
||||
getImportExportObjectLimit: deps.savedObjects.getImportExportObjectLimit,
|
||||
},
|
||||
status: {
|
||||
core$: deps.status.core$,
|
||||
|
@ -241,6 +240,8 @@ export function createPluginStartContext<TPlugin, TPluginDependencies>(
|
|||
createInternalRepository: deps.savedObjects.createInternalRepository,
|
||||
createScopedRepository: deps.savedObjects.createScopedRepository,
|
||||
createSerializer: deps.savedObjects.createSerializer,
|
||||
createExporter: deps.savedObjects.createExporter,
|
||||
createImporter: deps.savedObjects.createImporter,
|
||||
getTypeRegistry: deps.savedObjects.getTypeRegistry,
|
||||
},
|
||||
metrics: {
|
||||
|
|
50
src/core/server/saved_objects/export/errors.ts
Normal file
50
src/core/server/saved_objects/export/errors.ts
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import { SavedObject } from '../../../types';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export class SavedObjectsExportError extends Error {
|
||||
constructor(
|
||||
public readonly type: string,
|
||||
message: string,
|
||||
public readonly attributes?: Record<string, any>
|
||||
) {
|
||||
super(message);
|
||||
|
||||
// Set the prototype explicitly, see:
|
||||
// https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
||||
Object.setPrototypeOf(this, SavedObjectsExportError.prototype);
|
||||
}
|
||||
|
||||
static exportSizeExceeded(limit: number) {
|
||||
return new SavedObjectsExportError(
|
||||
'export-size-exceeded',
|
||||
`Can't export more than ${limit} objects`
|
||||
);
|
||||
}
|
||||
|
||||
static objectFetchError(objects: SavedObject[]) {
|
||||
return new SavedObjectsExportError('object-fetch-error', 'Error fetching objects to export', {
|
||||
objects,
|
||||
});
|
||||
}
|
||||
}
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
import { SavedObject } from '../types';
|
||||
import { savedObjectsClientMock } from '../../mocks';
|
||||
import { getObjectReferencesToFetch, fetchNestedDependencies } from './inject_nested_depdendencies';
|
||||
import { getObjectReferencesToFetch, fetchNestedDependencies } from './fetch_nested_dependencies';
|
||||
import { SavedObjectsErrorHelpers } from '..';
|
||||
|
||||
describe('getObjectReferencesToFetch()', () => {
|
|
@ -1,955 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import { exportSavedObjectsToStream } from './get_sorted_objects_for_export';
|
||||
import { savedObjectsClientMock } from '../service/saved_objects_client.mock';
|
||||
import { Readable } from 'stream';
|
||||
import { createPromiseFromStreams, createConcatStream } from '@kbn/utils';
|
||||
|
||||
async function readStreamToCompletion(stream: Readable) {
|
||||
return createPromiseFromStreams([stream, createConcatStream([])]);
|
||||
}
|
||||
|
||||
describe('getSortedObjectsForExport()', () => {
|
||||
const savedObjectsClient = savedObjectsClientMock.create();
|
||||
|
||||
afterEach(() => {
|
||||
savedObjectsClient.find.mockReset();
|
||||
savedObjectsClient.bulkGet.mockReset();
|
||||
savedObjectsClient.create.mockReset();
|
||||
savedObjectsClient.bulkCreate.mockReset();
|
||||
savedObjectsClient.delete.mockReset();
|
||||
savedObjectsClient.get.mockReset();
|
||||
savedObjectsClient.update.mockReset();
|
||||
});
|
||||
|
||||
test('exports selected types and sorts them', async () => {
|
||||
savedObjectsClient.find.mockResolvedValueOnce({
|
||||
total: 2,
|
||||
saved_objects: [
|
||||
{
|
||||
id: '2',
|
||||
type: 'search',
|
||||
attributes: {},
|
||||
score: 1,
|
||||
references: [
|
||||
{
|
||||
name: 'name',
|
||||
type: 'index-pattern',
|
||||
id: '1',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: '1',
|
||||
type: 'index-pattern',
|
||||
attributes: {},
|
||||
score: 1,
|
||||
references: [],
|
||||
},
|
||||
],
|
||||
per_page: 1,
|
||||
page: 0,
|
||||
});
|
||||
const exportStream = await exportSavedObjectsToStream({
|
||||
savedObjectsClient,
|
||||
exportSizeLimit: 500,
|
||||
types: ['index-pattern', 'search'],
|
||||
});
|
||||
|
||||
const response = await readStreamToCompletion(exportStream);
|
||||
|
||||
expect(response).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
Object {
|
||||
"attributes": Object {},
|
||||
"id": "1",
|
||||
"references": Array [],
|
||||
"type": "index-pattern",
|
||||
},
|
||||
Object {
|
||||
"attributes": Object {},
|
||||
"id": "2",
|
||||
"references": Array [
|
||||
Object {
|
||||
"id": "1",
|
||||
"name": "name",
|
||||
"type": "index-pattern",
|
||||
},
|
||||
],
|
||||
"type": "search",
|
||||
},
|
||||
Object {
|
||||
"exportedCount": 2,
|
||||
"missingRefCount": 0,
|
||||
"missingReferences": Array [],
|
||||
},
|
||||
]
|
||||
`);
|
||||
expect(savedObjectsClient.find).toMatchInlineSnapshot(`
|
||||
[MockFunction] {
|
||||
"calls": Array [
|
||||
Array [
|
||||
Object {
|
||||
"hasReference": undefined,
|
||||
"hasReferenceOperator": undefined,
|
||||
"namespaces": undefined,
|
||||
"perPage": 500,
|
||||
"search": undefined,
|
||||
"type": Array [
|
||||
"index-pattern",
|
||||
"search",
|
||||
],
|
||||
},
|
||||
],
|
||||
],
|
||||
"results": Array [
|
||||
Object {
|
||||
"type": "return",
|
||||
"value": Promise {},
|
||||
},
|
||||
],
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
||||
test('omits the `namespaces` property from the export', async () => {
|
||||
savedObjectsClient.find.mockResolvedValueOnce({
|
||||
total: 2,
|
||||
saved_objects: [
|
||||
{
|
||||
id: '2',
|
||||
type: 'search',
|
||||
attributes: {},
|
||||
namespaces: ['foo', 'bar'],
|
||||
score: 0,
|
||||
references: [
|
||||
{
|
||||
name: 'name',
|
||||
type: 'index-pattern',
|
||||
id: '1',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: '1',
|
||||
type: 'index-pattern',
|
||||
attributes: {},
|
||||
namespaces: ['foo', 'bar'],
|
||||
score: 0,
|
||||
references: [],
|
||||
},
|
||||
],
|
||||
per_page: 1,
|
||||
page: 0,
|
||||
});
|
||||
const exportStream = await exportSavedObjectsToStream({
|
||||
savedObjectsClient,
|
||||
exportSizeLimit: 500,
|
||||
types: ['index-pattern', 'search'],
|
||||
});
|
||||
|
||||
const response = await readStreamToCompletion(exportStream);
|
||||
|
||||
expect(response).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
Object {
|
||||
"attributes": Object {},
|
||||
"id": "1",
|
||||
"references": Array [],
|
||||
"type": "index-pattern",
|
||||
},
|
||||
Object {
|
||||
"attributes": Object {},
|
||||
"id": "2",
|
||||
"references": Array [
|
||||
Object {
|
||||
"id": "1",
|
||||
"name": "name",
|
||||
"type": "index-pattern",
|
||||
},
|
||||
],
|
||||
"type": "search",
|
||||
},
|
||||
Object {
|
||||
"exportedCount": 2,
|
||||
"missingRefCount": 0,
|
||||
"missingReferences": Array [],
|
||||
},
|
||||
]
|
||||
`);
|
||||
expect(savedObjectsClient.find).toMatchInlineSnapshot(`
|
||||
[MockFunction] {
|
||||
"calls": Array [
|
||||
Array [
|
||||
Object {
|
||||
"hasReference": undefined,
|
||||
"hasReferenceOperator": undefined,
|
||||
"namespaces": undefined,
|
||||
"perPage": 500,
|
||||
"search": undefined,
|
||||
"type": Array [
|
||||
"index-pattern",
|
||||
"search",
|
||||
],
|
||||
},
|
||||
],
|
||||
],
|
||||
"results": Array [
|
||||
Object {
|
||||
"type": "return",
|
||||
"value": Promise {},
|
||||
},
|
||||
],
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
||||
test('exclude export details if option is specified', async () => {
|
||||
savedObjectsClient.find.mockResolvedValueOnce({
|
||||
total: 2,
|
||||
saved_objects: [
|
||||
{
|
||||
id: '2',
|
||||
type: 'search',
|
||||
attributes: {},
|
||||
score: 1,
|
||||
references: [
|
||||
{
|
||||
name: 'name',
|
||||
type: 'index-pattern',
|
||||
id: '1',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: '1',
|
||||
type: 'index-pattern',
|
||||
attributes: {},
|
||||
score: 1,
|
||||
references: [],
|
||||
},
|
||||
],
|
||||
per_page: 1,
|
||||
page: 0,
|
||||
});
|
||||
const exportStream = await exportSavedObjectsToStream({
|
||||
savedObjectsClient,
|
||||
exportSizeLimit: 500,
|
||||
types: ['index-pattern', 'search'],
|
||||
excludeExportDetails: true,
|
||||
});
|
||||
|
||||
const response = await readStreamToCompletion(exportStream);
|
||||
|
||||
expect(response).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
Object {
|
||||
"attributes": Object {},
|
||||
"id": "1",
|
||||
"references": Array [],
|
||||
"type": "index-pattern",
|
||||
},
|
||||
Object {
|
||||
"attributes": Object {},
|
||||
"id": "2",
|
||||
"references": Array [
|
||||
Object {
|
||||
"id": "1",
|
||||
"name": "name",
|
||||
"type": "index-pattern",
|
||||
},
|
||||
],
|
||||
"type": "search",
|
||||
},
|
||||
]
|
||||
`);
|
||||
});
|
||||
|
||||
test('exports selected types with search string when present', async () => {
|
||||
savedObjectsClient.find.mockResolvedValueOnce({
|
||||
total: 2,
|
||||
saved_objects: [
|
||||
{
|
||||
id: '2',
|
||||
type: 'search',
|
||||
attributes: {},
|
||||
score: 1,
|
||||
references: [
|
||||
{
|
||||
name: 'name',
|
||||
type: 'index-pattern',
|
||||
id: '1',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: '1',
|
||||
type: 'index-pattern',
|
||||
attributes: {},
|
||||
score: 1,
|
||||
references: [],
|
||||
},
|
||||
],
|
||||
per_page: 1,
|
||||
page: 0,
|
||||
});
|
||||
const exportStream = await exportSavedObjectsToStream({
|
||||
savedObjectsClient,
|
||||
exportSizeLimit: 500,
|
||||
types: ['index-pattern', 'search'],
|
||||
search: 'foo',
|
||||
});
|
||||
|
||||
const response = await readStreamToCompletion(exportStream);
|
||||
|
||||
expect(response).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
Object {
|
||||
"attributes": Object {},
|
||||
"id": "1",
|
||||
"references": Array [],
|
||||
"type": "index-pattern",
|
||||
},
|
||||
Object {
|
||||
"attributes": Object {},
|
||||
"id": "2",
|
||||
"references": Array [
|
||||
Object {
|
||||
"id": "1",
|
||||
"name": "name",
|
||||
"type": "index-pattern",
|
||||
},
|
||||
],
|
||||
"type": "search",
|
||||
},
|
||||
Object {
|
||||
"exportedCount": 2,
|
||||
"missingRefCount": 0,
|
||||
"missingReferences": Array [],
|
||||
},
|
||||
]
|
||||
`);
|
||||
expect(savedObjectsClient.find).toMatchInlineSnapshot(`
|
||||
[MockFunction] {
|
||||
"calls": Array [
|
||||
Array [
|
||||
Object {
|
||||
"hasReference": undefined,
|
||||
"hasReferenceOperator": undefined,
|
||||
"namespaces": undefined,
|
||||
"perPage": 500,
|
||||
"search": "foo",
|
||||
"type": Array [
|
||||
"index-pattern",
|
||||
"search",
|
||||
],
|
||||
},
|
||||
],
|
||||
],
|
||||
"results": Array [
|
||||
Object {
|
||||
"type": "return",
|
||||
"value": Promise {},
|
||||
},
|
||||
],
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
||||
test('exports selected types with references when present', async () => {
|
||||
savedObjectsClient.find.mockResolvedValueOnce({
|
||||
total: 1,
|
||||
saved_objects: [
|
||||
{
|
||||
id: '2',
|
||||
type: 'search',
|
||||
attributes: {},
|
||||
score: 1,
|
||||
references: [
|
||||
{
|
||||
name: 'name',
|
||||
type: 'index-pattern',
|
||||
id: '1',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
per_page: 1,
|
||||
page: 0,
|
||||
});
|
||||
const exportStream = await exportSavedObjectsToStream({
|
||||
savedObjectsClient,
|
||||
exportSizeLimit: 500,
|
||||
types: ['index-pattern', 'search'],
|
||||
hasReference: [
|
||||
{
|
||||
id: '1',
|
||||
type: 'index-pattern',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const response = await readStreamToCompletion(exportStream);
|
||||
|
||||
expect(response).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
Object {
|
||||
"attributes": Object {},
|
||||
"id": "2",
|
||||
"references": Array [
|
||||
Object {
|
||||
"id": "1",
|
||||
"name": "name",
|
||||
"type": "index-pattern",
|
||||
},
|
||||
],
|
||||
"type": "search",
|
||||
},
|
||||
Object {
|
||||
"exportedCount": 1,
|
||||
"missingRefCount": 0,
|
||||
"missingReferences": Array [],
|
||||
},
|
||||
]
|
||||
`);
|
||||
expect(savedObjectsClient.find).toMatchInlineSnapshot(`
|
||||
[MockFunction] {
|
||||
"calls": Array [
|
||||
Array [
|
||||
Object {
|
||||
"hasReference": Array [
|
||||
Object {
|
||||
"id": "1",
|
||||
"type": "index-pattern",
|
||||
},
|
||||
],
|
||||
"hasReferenceOperator": "OR",
|
||||
"namespaces": undefined,
|
||||
"perPage": 500,
|
||||
"search": undefined,
|
||||
"type": Array [
|
||||
"index-pattern",
|
||||
"search",
|
||||
],
|
||||
},
|
||||
],
|
||||
],
|
||||
"results": Array [
|
||||
Object {
|
||||
"type": "return",
|
||||
"value": Promise {},
|
||||
},
|
||||
],
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
||||
test('exports from the provided namespace when present', async () => {
|
||||
savedObjectsClient.find.mockResolvedValueOnce({
|
||||
total: 2,
|
||||
saved_objects: [
|
||||
{
|
||||
id: '2',
|
||||
type: 'search',
|
||||
attributes: {},
|
||||
score: 1,
|
||||
references: [
|
||||
{
|
||||
name: 'name',
|
||||
type: 'index-pattern',
|
||||
id: '1',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: '1',
|
||||
type: 'index-pattern',
|
||||
attributes: {},
|
||||
score: 1,
|
||||
references: [],
|
||||
},
|
||||
],
|
||||
per_page: 1,
|
||||
page: 0,
|
||||
});
|
||||
const exportStream = await exportSavedObjectsToStream({
|
||||
savedObjectsClient,
|
||||
exportSizeLimit: 500,
|
||||
types: ['index-pattern', 'search'],
|
||||
namespace: 'foo',
|
||||
});
|
||||
|
||||
const response = await readStreamToCompletion(exportStream);
|
||||
|
||||
expect(response).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
Object {
|
||||
"attributes": Object {},
|
||||
"id": "1",
|
||||
"references": Array [],
|
||||
"type": "index-pattern",
|
||||
},
|
||||
Object {
|
||||
"attributes": Object {},
|
||||
"id": "2",
|
||||
"references": Array [
|
||||
Object {
|
||||
"id": "1",
|
||||
"name": "name",
|
||||
"type": "index-pattern",
|
||||
},
|
||||
],
|
||||
"type": "search",
|
||||
},
|
||||
Object {
|
||||
"exportedCount": 2,
|
||||
"missingRefCount": 0,
|
||||
"missingReferences": Array [],
|
||||
},
|
||||
]
|
||||
`);
|
||||
expect(savedObjectsClient.find).toMatchInlineSnapshot(`
|
||||
[MockFunction] {
|
||||
"calls": Array [
|
||||
Array [
|
||||
Object {
|
||||
"hasReference": undefined,
|
||||
"hasReferenceOperator": undefined,
|
||||
"namespaces": Array [
|
||||
"foo",
|
||||
],
|
||||
"perPage": 500,
|
||||
"search": undefined,
|
||||
"type": Array [
|
||||
"index-pattern",
|
||||
"search",
|
||||
],
|
||||
},
|
||||
],
|
||||
],
|
||||
"results": Array [
|
||||
Object {
|
||||
"type": "return",
|
||||
"value": Promise {},
|
||||
},
|
||||
],
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
||||
test('export selected types throws error when exceeding exportSizeLimit', async () => {
|
||||
savedObjectsClient.find.mockResolvedValueOnce({
|
||||
total: 2,
|
||||
saved_objects: [
|
||||
{
|
||||
id: '2',
|
||||
type: 'search',
|
||||
attributes: {},
|
||||
score: 1,
|
||||
references: [
|
||||
{
|
||||
type: 'index-pattern',
|
||||
name: 'name',
|
||||
id: '1',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: '1',
|
||||
type: 'index-pattern',
|
||||
attributes: {},
|
||||
score: 1,
|
||||
references: [],
|
||||
},
|
||||
],
|
||||
per_page: 1,
|
||||
page: 0,
|
||||
});
|
||||
await expect(
|
||||
exportSavedObjectsToStream({
|
||||
savedObjectsClient,
|
||||
exportSizeLimit: 1,
|
||||
types: ['index-pattern', 'search'],
|
||||
})
|
||||
).rejects.toThrowErrorMatchingInlineSnapshot(`"Can't export more than 1 objects"`);
|
||||
});
|
||||
|
||||
test('sorts objects within type', async () => {
|
||||
savedObjectsClient.find.mockResolvedValueOnce({
|
||||
total: 3,
|
||||
per_page: 10000,
|
||||
page: 1,
|
||||
saved_objects: [
|
||||
{
|
||||
id: '3',
|
||||
type: 'index-pattern',
|
||||
attributes: {
|
||||
name: 'baz',
|
||||
},
|
||||
score: 1,
|
||||
references: [],
|
||||
},
|
||||
{
|
||||
id: '1',
|
||||
type: 'index-pattern',
|
||||
attributes: {
|
||||
name: 'foo',
|
||||
},
|
||||
score: 1,
|
||||
references: [],
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
type: 'index-pattern',
|
||||
attributes: {
|
||||
name: 'bar',
|
||||
},
|
||||
score: 1,
|
||||
references: [],
|
||||
},
|
||||
],
|
||||
});
|
||||
const exportStream = await exportSavedObjectsToStream({
|
||||
exportSizeLimit: 10000,
|
||||
savedObjectsClient,
|
||||
types: ['index-pattern'],
|
||||
});
|
||||
const response = await readStreamToCompletion(exportStream);
|
||||
expect(response).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"name": "foo",
|
||||
},
|
||||
"id": "1",
|
||||
"references": Array [],
|
||||
"type": "index-pattern",
|
||||
},
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"name": "bar",
|
||||
},
|
||||
"id": "2",
|
||||
"references": Array [],
|
||||
"type": "index-pattern",
|
||||
},
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"name": "baz",
|
||||
},
|
||||
"id": "3",
|
||||
"references": Array [],
|
||||
"type": "index-pattern",
|
||||
},
|
||||
Object {
|
||||
"exportedCount": 3,
|
||||
"missingRefCount": 0,
|
||||
"missingReferences": Array [],
|
||||
},
|
||||
]
|
||||
`);
|
||||
});
|
||||
|
||||
test('exports selected objects and sorts them', async () => {
|
||||
savedObjectsClient.bulkGet.mockResolvedValueOnce({
|
||||
saved_objects: [
|
||||
{
|
||||
id: '2',
|
||||
type: 'search',
|
||||
attributes: {},
|
||||
references: [
|
||||
{
|
||||
id: '1',
|
||||
name: 'name',
|
||||
type: 'index-pattern',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: '1',
|
||||
type: 'index-pattern',
|
||||
attributes: {},
|
||||
references: [],
|
||||
},
|
||||
],
|
||||
});
|
||||
const exportStream = await exportSavedObjectsToStream({
|
||||
exportSizeLimit: 10000,
|
||||
savedObjectsClient,
|
||||
objects: [
|
||||
{
|
||||
type: 'index-pattern',
|
||||
id: '1',
|
||||
},
|
||||
{
|
||||
type: 'search',
|
||||
id: '2',
|
||||
},
|
||||
],
|
||||
});
|
||||
const response = await readStreamToCompletion(exportStream);
|
||||
expect(response).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
Object {
|
||||
"attributes": Object {},
|
||||
"id": "1",
|
||||
"references": Array [],
|
||||
"type": "index-pattern",
|
||||
},
|
||||
Object {
|
||||
"attributes": Object {},
|
||||
"id": "2",
|
||||
"references": Array [
|
||||
Object {
|
||||
"id": "1",
|
||||
"name": "name",
|
||||
"type": "index-pattern",
|
||||
},
|
||||
],
|
||||
"type": "search",
|
||||
},
|
||||
Object {
|
||||
"exportedCount": 2,
|
||||
"missingRefCount": 0,
|
||||
"missingReferences": Array [],
|
||||
},
|
||||
]
|
||||
`);
|
||||
expect(savedObjectsClient.bulkGet).toMatchInlineSnapshot(`
|
||||
[MockFunction] {
|
||||
"calls": Array [
|
||||
Array [
|
||||
Array [
|
||||
Object {
|
||||
"id": "1",
|
||||
"type": "index-pattern",
|
||||
},
|
||||
Object {
|
||||
"id": "2",
|
||||
"type": "search",
|
||||
},
|
||||
],
|
||||
Object {
|
||||
"namespace": undefined,
|
||||
},
|
||||
],
|
||||
],
|
||||
"results": Array [
|
||||
Object {
|
||||
"type": "return",
|
||||
"value": Promise {},
|
||||
},
|
||||
],
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
||||
test('modifies return results to redact `namespaces` attribute', async () => {
|
||||
const createSavedObject = (obj: any) => ({ ...obj, attributes: {}, references: [] });
|
||||
savedObjectsClient.bulkGet.mockResolvedValueOnce({
|
||||
saved_objects: [
|
||||
createSavedObject({ type: 'multi', id: '1', namespaces: ['foo'] }),
|
||||
createSavedObject({ type: 'multi', id: '2', namespaces: ['bar'] }),
|
||||
createSavedObject({ type: 'other', id: '3' }),
|
||||
],
|
||||
});
|
||||
const exportStream = await exportSavedObjectsToStream({
|
||||
exportSizeLimit: 10000,
|
||||
savedObjectsClient,
|
||||
objects: [
|
||||
{ type: 'multi', id: '1' },
|
||||
{ type: 'multi', id: '2' },
|
||||
{ type: 'other', id: '3' },
|
||||
],
|
||||
});
|
||||
const response = await readStreamToCompletion(exportStream);
|
||||
expect(response).toEqual([
|
||||
createSavedObject({ type: 'multi', id: '1' }),
|
||||
createSavedObject({ type: 'multi', id: '2' }),
|
||||
createSavedObject({ type: 'other', id: '3' }),
|
||||
expect.objectContaining({ exportedCount: 3 }),
|
||||
]);
|
||||
});
|
||||
|
||||
test('includes nested dependencies when passed in', async () => {
|
||||
savedObjectsClient.bulkGet.mockResolvedValueOnce({
|
||||
saved_objects: [
|
||||
{
|
||||
id: '2',
|
||||
type: 'search',
|
||||
attributes: {},
|
||||
references: [
|
||||
{
|
||||
type: 'index-pattern',
|
||||
name: 'name',
|
||||
id: '1',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
savedObjectsClient.bulkGet.mockResolvedValueOnce({
|
||||
saved_objects: [
|
||||
{
|
||||
id: '1',
|
||||
type: 'index-pattern',
|
||||
attributes: {},
|
||||
references: [],
|
||||
},
|
||||
],
|
||||
});
|
||||
const exportStream = await exportSavedObjectsToStream({
|
||||
exportSizeLimit: 10000,
|
||||
savedObjectsClient,
|
||||
objects: [
|
||||
{
|
||||
type: 'search',
|
||||
id: '2',
|
||||
},
|
||||
],
|
||||
includeReferencesDeep: true,
|
||||
});
|
||||
const response = await readStreamToCompletion(exportStream);
|
||||
expect(response).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
Object {
|
||||
"attributes": Object {},
|
||||
"id": "1",
|
||||
"references": Array [],
|
||||
"type": "index-pattern",
|
||||
},
|
||||
Object {
|
||||
"attributes": Object {},
|
||||
"id": "2",
|
||||
"references": Array [
|
||||
Object {
|
||||
"id": "1",
|
||||
"name": "name",
|
||||
"type": "index-pattern",
|
||||
},
|
||||
],
|
||||
"type": "search",
|
||||
},
|
||||
Object {
|
||||
"exportedCount": 2,
|
||||
"missingRefCount": 0,
|
||||
"missingReferences": Array [],
|
||||
},
|
||||
]
|
||||
`);
|
||||
expect(savedObjectsClient.bulkGet).toMatchInlineSnapshot(`
|
||||
[MockFunction] {
|
||||
"calls": Array [
|
||||
Array [
|
||||
Array [
|
||||
Object {
|
||||
"id": "2",
|
||||
"type": "search",
|
||||
},
|
||||
],
|
||||
Object {
|
||||
"namespace": undefined,
|
||||
},
|
||||
],
|
||||
Array [
|
||||
Array [
|
||||
Object {
|
||||
"id": "1",
|
||||
"type": "index-pattern",
|
||||
},
|
||||
],
|
||||
Object {
|
||||
"namespace": undefined,
|
||||
},
|
||||
],
|
||||
],
|
||||
"results": Array [
|
||||
Object {
|
||||
"type": "return",
|
||||
"value": Promise {},
|
||||
},
|
||||
Object {
|
||||
"type": "return",
|
||||
"value": Promise {},
|
||||
},
|
||||
],
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
||||
test('export selected objects throws error when exceeding exportSizeLimit', async () => {
|
||||
const exportOpts = {
|
||||
exportSizeLimit: 1,
|
||||
savedObjectsClient,
|
||||
objects: [
|
||||
{
|
||||
type: 'index-pattern',
|
||||
id: '1',
|
||||
},
|
||||
{
|
||||
type: 'search',
|
||||
id: '2',
|
||||
},
|
||||
],
|
||||
};
|
||||
await expect(exportSavedObjectsToStream(exportOpts)).rejects.toThrowErrorMatchingInlineSnapshot(
|
||||
`"Can't export more than 1 objects"`
|
||||
);
|
||||
});
|
||||
|
||||
test('rejects when neither type nor objects paramaters are passed in', () => {
|
||||
const exportOpts = {
|
||||
exportSizeLimit: 1,
|
||||
savedObjectsClient,
|
||||
types: undefined,
|
||||
objects: undefined,
|
||||
};
|
||||
|
||||
expect(exportSavedObjectsToStream(exportOpts)).rejects.toThrowErrorMatchingInlineSnapshot(
|
||||
`"Either \`type\` or \`objects\` are required."`
|
||||
);
|
||||
});
|
||||
|
||||
test('rejects when both objects and search are passed in', () => {
|
||||
const exportOpts = {
|
||||
exportSizeLimit: 1,
|
||||
savedObjectsClient,
|
||||
objects: [{ type: 'index-pattern', id: '1' }],
|
||||
search: 'foo',
|
||||
};
|
||||
|
||||
expect(exportSavedObjectsToStream(exportOpts)).rejects.toThrowErrorMatchingInlineSnapshot(
|
||||
`"Can't specify both \\"search\\" and \\"objects\\" properties when exporting"`
|
||||
);
|
||||
});
|
||||
|
||||
test('rejects when both objects and references are passed in', () => {
|
||||
const exportOpts = {
|
||||
exportSizeLimit: 1,
|
||||
savedObjectsClient,
|
||||
objects: [{ type: 'index-pattern', id: '1' }],
|
||||
hasReference: [{ type: 'index-pattern', id: '1' }],
|
||||
};
|
||||
|
||||
expect(exportSavedObjectsToStream(exportOpts)).rejects.toThrowErrorMatchingInlineSnapshot(
|
||||
`"Can't specify both \\"references\\" and \\"objects\\" properties when exporting"`
|
||||
);
|
||||
});
|
||||
});
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue