mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Use explicit interface for SavedObjectsClientContract
(#132795)
* No explicit interface for `SavedObjectsClientContract` * fix doc, do not export the client class * fix doc more * fix import from plugins * fix import from plugins bis * update generated doc
This commit is contained in:
parent
c51fb17e4c
commit
4043c33be1
36 changed files with 448 additions and 337 deletions
|
@ -14,9 +14,8 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
|
|||
|
||||
| Class | Description |
|
||||
| --- | --- |
|
||||
| [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md) | Saved Objects is Kibana's data persisentence mechanism allowing plugins to use Elasticsearch for storing plugin state. The client-side SavedObjectsClient is a thin convenience library around the SavedObjects HTTP API for interacting with Saved Objects. |
|
||||
| [ScopedHistory](./kibana-plugin-core-public.scopedhistory.md) | A wrapper around a <code>History</code> instance that is scoped to a particular base path of the history stack. Behaves similarly to the <code>basename</code> option except that this wrapper hides any history stack entries from outside the scope of this base path.<!-- -->This wrapper also allows Core and Plugins to share a single underlying global <code>History</code> instance without exposing the history of other applications.<!-- -->The [createSubHistory](./kibana-plugin-core-public.scopedhistory.createsubhistory.md) method is particularly useful for applications that contain any number of "sub-apps" which should not have access to the main application's history or basePath. |
|
||||
| [SimpleSavedObject](./kibana-plugin-core-public.simplesavedobject.md) | This class is a very simple wrapper for SavedObjects loaded from the server with the [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md)<!-- -->.<!-- -->It provides basic functionality for creating/saving/deleting saved objects, but doesn't include any type-specific implementations. |
|
||||
| [SimpleSavedObject](./kibana-plugin-core-public.simplesavedobject.md) | This class is a very simple wrapper for SavedObjects loaded from the server with the [SavedObjectsClientContract](./kibana-plugin-core-public.savedobjectsclientcontract.md)<!-- -->.<!-- -->It provides basic functionality for creating/saving/deleting saved objects, but doesn't include any type-specific implementations. |
|
||||
| [ToastsApi](./kibana-plugin-core-public.toastsapi.md) | Methods for adding and removing global toast messages. |
|
||||
|
||||
## Enumerations
|
||||
|
@ -98,7 +97,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
|
|||
| [OverlayStart](./kibana-plugin-core-public.overlaystart.md) | |
|
||||
| [Plugin\_2](./kibana-plugin-core-public.plugin_2.md) | The interface that should be returned by a <code>PluginInitializer</code>. |
|
||||
| [PluginInitializerContext](./kibana-plugin-core-public.plugininitializercontext.md) | The available core services passed to a <code>PluginInitializer</code> |
|
||||
| [ResolvedSimpleSavedObject](./kibana-plugin-core-public.resolvedsimplesavedobject.md) | This interface is a very simple wrapper for SavedObjects resolved from the server with the [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md)<!-- -->. |
|
||||
| [ResolvedSimpleSavedObject](./kibana-plugin-core-public.resolvedsimplesavedobject.md) | This interface is a very simple wrapper for SavedObjects resolved from the server with the [SavedObjectsClientContract](./kibana-plugin-core-public.savedobjectsclientcontract.md)<!-- -->. |
|
||||
| [ResponseErrorBody](./kibana-plugin-core-public.responseerrorbody.md) | |
|
||||
| [SavedObject](./kibana-plugin-core-public.savedobject.md) | |
|
||||
| [SavedObjectAttributes](./kibana-plugin-core-public.savedobjectattributes.md) | The data for a Saved Object is stored as an object in the <code>attributes</code> property. |
|
||||
|
@ -113,6 +112,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
|
|||
| [SavedObjectsBulkResolveResponse](./kibana-plugin-core-public.savedobjectsbulkresolveresponse.md) | |
|
||||
| [SavedObjectsBulkUpdateObject](./kibana-plugin-core-public.savedobjectsbulkupdateobject.md) | |
|
||||
| [SavedObjectsBulkUpdateOptions](./kibana-plugin-core-public.savedobjectsbulkupdateoptions.md) | |
|
||||
| [SavedObjectsClientContract](./kibana-plugin-core-public.savedobjectsclientcontract.md) | The client-side SavedObjectsClient is a thin convenience library around the SavedObjects HTTP API for interacting with Saved Objects. |
|
||||
| [SavedObjectsCollectMultiNamespaceReferencesResponse](./kibana-plugin-core-public.savedobjectscollectmultinamespacereferencesresponse.md) | The response when object references are collected. |
|
||||
| [SavedObjectsCreateOptions](./kibana-plugin-core-public.savedobjectscreateoptions.md) | |
|
||||
| [SavedObjectsFindOptions](./kibana-plugin-core-public.savedobjectsfindoptions.md) | |
|
||||
|
@ -178,7 +178,6 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
|
|||
| [ResolveDeprecationResponse](./kibana-plugin-core-public.resolvedeprecationresponse.md) | |
|
||||
| [SavedObjectAttribute](./kibana-plugin-core-public.savedobjectattribute.md) | Type definition for a Saved Object attribute value |
|
||||
| [SavedObjectAttributeSingle](./kibana-plugin-core-public.savedobjectattributesingle.md) | Don't use this type, it's simply a helper type for [SavedObjectAttribute](./kibana-plugin-core-public.savedobjectattribute.md) |
|
||||
| [SavedObjectsClientContract](./kibana-plugin-core-public.savedobjectsclientcontract.md) | SavedObjectsClientContract as implemented by the [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md) |
|
||||
| [SavedObjectsImportWarning](./kibana-plugin-core-public.savedobjectsimportwarning.md) | Composite type of all the possible types of import warnings.<!-- -->See [SavedObjectsImportSimpleWarning](./kibana-plugin-core-public.savedobjectsimportsimplewarning.md) and [SavedObjectsImportActionRequiredWarning](./kibana-plugin-core-public.savedobjectsimportactionrequiredwarning.md) for more details. |
|
||||
| [SavedObjectsNamespaceType](./kibana-plugin-core-public.savedobjectsnamespacetype.md) | The namespace type dictates how a saved object can be interacted in relation to namespaces. Each type is mutually exclusive: \* single (default): This type of saved object is namespace-isolated, e.g., it exists in only one namespace. \* multiple: This type of saved object is shareable, e.g., it can exist in one or more namespaces. \* multiple-isolated: This type of saved object is namespace-isolated, e.g., it exists in only one namespace, but object IDs must be unique across all namespaces. This is intended to be an intermediate step when objects with a "single" namespace type are being converted to a "multiple" namespace type. In other words, objects with a "multiple-isolated" namespace type will be \*share-capable\*, but will not actually be shareable until the namespace type is changed to "multiple". \* agnostic: This type of saved object is global. |
|
||||
| [StartServicesAccessor](./kibana-plugin-core-public.startservicesaccessor.md) | Allows plugins to get access to APIs available in start inside async handlers, such as [App.mount](./kibana-plugin-core-public.app.mount.md)<!-- -->. Promise will not resolve until Core and plugin dependencies have completed <code>start</code>. |
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
## ResolvedSimpleSavedObject interface
|
||||
|
||||
This interface is a very simple wrapper for SavedObjects resolved from the server with the [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md)<!-- -->.
|
||||
This interface is a very simple wrapper for SavedObjects resolved from the server with the [SavedObjectsClientContract](./kibana-plugin-core-public.savedobjectsclientcontract.md)<!-- -->.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
|
|
|
@ -15,5 +15,5 @@ export interface SavedObjectsBulkResolveResponse<T = unknown>
|
|||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [resolved\_objects](./kibana-plugin-core-public.savedobjectsbulkresolveresponse.resolved_objects.md) | Array<SavedObjectsResolveResponse<T>> | |
|
||||
| [resolved\_objects](./kibana-plugin-core-public.savedobjectsbulkresolveresponse.resolved_objects.md) | Array<ResolvedSimpleSavedObject<T>> | |
|
||||
|
||||
|
|
|
@ -7,5 +7,5 @@
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
resolved_objects: Array<SavedObjectsResolveResponse<T>>;
|
||||
resolved_objects: Array<ResolvedSimpleSavedObject<T>>;
|
||||
```
|
||||
|
|
|
@ -1,13 +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) > [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md) > [bulkCreate](./kibana-plugin-core-public.savedobjectsclient.bulkcreate.md)
|
||||
|
||||
## SavedObjectsClient.bulkCreate property
|
||||
|
||||
Creates multiple documents at once
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
bulkCreate: (objects?: SavedObjectsBulkCreateObject[], options?: SavedObjectsBulkCreateOptions) => Promise<SavedObjectsBatchResponse<unknown>>;
|
||||
```
|
|
@ -1,21 +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) > [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md) > [bulkGet](./kibana-plugin-core-public.savedobjectsclient.bulkget.md)
|
||||
|
||||
## SavedObjectsClient.bulkGet property
|
||||
|
||||
Returns an array of objects by id
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
bulkGet: (objects?: Array<{
|
||||
id: string;
|
||||
type: string;
|
||||
}>) => Promise<SavedObjectsBatchResponse<unknown>>;
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
bulkGet(\[ { id: 'one', type: 'config' }<!-- -->, { id: 'foo', type: 'index-pattern' } \])
|
||||
|
|
@ -1,13 +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) > [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md) > [create](./kibana-plugin-core-public.savedobjectsclient.create.md)
|
||||
|
||||
## SavedObjectsClient.create property
|
||||
|
||||
Persists an object
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
create: <T = unknown>(type: string, attributes: T, options?: SavedObjectsCreateOptions) => Promise<SimpleSavedObject<T>>;
|
||||
```
|
|
@ -1,13 +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) > [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md) > [delete](./kibana-plugin-core-public.savedobjectsclient.delete.md)
|
||||
|
||||
## SavedObjectsClient.delete property
|
||||
|
||||
Deletes an object
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
delete: (type: string, id: string, options?: SavedObjectsDeleteOptions | undefined) => ReturnType<SavedObjectsApi['delete']>;
|
||||
```
|
|
@ -1,13 +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) > [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md) > [find](./kibana-plugin-core-public.savedobjectsclient.find.md)
|
||||
|
||||
## SavedObjectsClient.find property
|
||||
|
||||
Search for objects
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
find: <T = unknown, A = unknown>(options: SavedObjectsFindOptions) => Promise<SavedObjectsFindResponsePublic<T, unknown>>;
|
||||
```
|
|
@ -1,13 +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) > [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md) > [get](./kibana-plugin-core-public.savedobjectsclient.get.md)
|
||||
|
||||
## SavedObjectsClient.get property
|
||||
|
||||
Fetches a single object
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
get: <T = unknown>(type: string, id: string) => Promise<SimpleSavedObject<T>>;
|
||||
```
|
|
@ -1,38 +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) > [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md)
|
||||
|
||||
## SavedObjectsClient class
|
||||
|
||||
Saved Objects is Kibana's data persisentence mechanism allowing plugins to use Elasticsearch for storing plugin state. The client-side SavedObjectsClient is a thin convenience library around the SavedObjects HTTP API for interacting with Saved Objects.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare class SavedObjectsClient
|
||||
```
|
||||
|
||||
## Remarks
|
||||
|
||||
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `SavedObjectsClient` class.
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| [bulkCreate](./kibana-plugin-core-public.savedobjectsclient.bulkcreate.md) | | (objects?: SavedObjectsBulkCreateObject\[\], options?: SavedObjectsBulkCreateOptions) => Promise<SavedObjectsBatchResponse<unknown>> | Creates multiple documents at once |
|
||||
| [bulkGet](./kibana-plugin-core-public.savedobjectsclient.bulkget.md) | | (objects?: Array<{ id: string; type: string; }>) => Promise<SavedObjectsBatchResponse<unknown>> | Returns an array of objects by id |
|
||||
| [bulkResolve](./kibana-plugin-core-public.savedobjectsclient.bulkresolve.md) | | <T = unknown>(objects?: Array<{ id: string; type: string; }>) => Promise<{ resolved\_objects: ResolvedSimpleSavedObject<T>\[\]; }> | Resolves an array of objects by id, using any legacy URL aliases if they exist |
|
||||
| [create](./kibana-plugin-core-public.savedobjectsclient.create.md) | | <T = unknown>(type: string, attributes: T, options?: SavedObjectsCreateOptions) => Promise<SimpleSavedObject<T>> | Persists an object |
|
||||
| [delete](./kibana-plugin-core-public.savedobjectsclient.delete.md) | | (type: string, id: string, options?: SavedObjectsDeleteOptions \| undefined) => ReturnType<SavedObjectsApi\['delete'\]> | Deletes an object |
|
||||
| [find](./kibana-plugin-core-public.savedobjectsclient.find.md) | | <T = unknown, A = unknown>(options: SavedObjectsFindOptions) => Promise<SavedObjectsFindResponsePublic<T, unknown>> | Search for objects |
|
||||
| [get](./kibana-plugin-core-public.savedobjectsclient.get.md) | | <T = unknown>(type: string, id: string) => Promise<SimpleSavedObject<T>> | Fetches a single object |
|
||||
| [resolve](./kibana-plugin-core-public.savedobjectsclient.resolve.md) | | <T = unknown>(type: string, id: string) => Promise<ResolvedSimpleSavedObject<T>> | Resolves a single object |
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Modifiers | Description |
|
||||
| --- | --- | --- |
|
||||
| [bulkUpdate(objects)](./kibana-plugin-core-public.savedobjectsclient.bulkupdate.md) | | Update multiple documents at once |
|
||||
| [update(type, id, attributes, { version, references, upsert })](./kibana-plugin-core-public.savedobjectsclient.update.md) | | Updates an object |
|
||||
|
|
@ -1,13 +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) > [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md) > [resolve](./kibana-plugin-core-public.savedobjectsclient.resolve.md)
|
||||
|
||||
## SavedObjectsClient.resolve property
|
||||
|
||||
Resolves a single object
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
resolve: <T = unknown>(type: string, id: string) => Promise<ResolvedSimpleSavedObject<T>>;
|
||||
```
|
|
@ -1,28 +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) > [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md) > [update](./kibana-plugin-core-public.savedobjectsclient.update.md)
|
||||
|
||||
## SavedObjectsClient.update() method
|
||||
|
||||
Updates an object
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
update<T = unknown>(type: string, id: string, attributes: T, { version, references, upsert }?: SavedObjectsUpdateOptions): Promise<SimpleSavedObject<T>>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| type | string | |
|
||||
| id | string | |
|
||||
| attributes | T | |
|
||||
| { version, references, upsert } | SavedObjectsUpdateOptions | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
Promise<SimpleSavedObject<T>>
|
||||
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsClientContract](./kibana-plugin-core-public.savedobjectsclientcontract.md) > [bulkCreate](./kibana-plugin-core-public.savedobjectsclientcontract.bulkcreate.md)
|
||||
|
||||
## SavedObjectsClientContract.bulkCreate() method
|
||||
|
||||
Creates multiple documents at once
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
bulkCreate(objects: SavedObjectsBulkCreateObject[], options?: SavedObjectsBulkCreateOptions): Promise<SavedObjectsBatchResponse<unknown>>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| objects | SavedObjectsBulkCreateObject\[\] | |
|
||||
| options | SavedObjectsBulkCreateOptions | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
Promise<SavedObjectsBatchResponse<unknown>>
|
||||
|
||||
The result of the create operation containing created saved objects.
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsClientContract](./kibana-plugin-core-public.savedobjectsclientcontract.md) > [bulkGet](./kibana-plugin-core-public.savedobjectsclientcontract.bulkget.md)
|
||||
|
||||
## SavedObjectsClientContract.bulkGet() method
|
||||
|
||||
Returns an array of objects by id
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
bulkGet(objects: Array<{
|
||||
id: string;
|
||||
type: string;
|
||||
}>): Promise<SavedObjectsBatchResponse<unknown>>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| objects | Array<{ id: string; type: string; }> | an array ids, or an array of objects containing id and optionally type |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
Promise<SavedObjectsBatchResponse<unknown>>
|
||||
|
||||
The saved objects with the given type and ids requested
|
||||
|
||||
## Example
|
||||
|
||||
bulkGet(\[ { id: 'one', type: 'config' }<!-- -->, { id: 'foo', type: 'index-pattern' } \])
|
||||
|
|
@ -1,22 +1,32 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md) > [bulkResolve](./kibana-plugin-core-public.savedobjectsclient.bulkresolve.md)
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsClientContract](./kibana-plugin-core-public.savedobjectsclientcontract.md) > [bulkResolve](./kibana-plugin-core-public.savedobjectsclientcontract.bulkresolve.md)
|
||||
|
||||
## SavedObjectsClient.bulkResolve property
|
||||
## SavedObjectsClientContract.bulkResolve() method
|
||||
|
||||
Resolves an array of objects by id, using any legacy URL aliases if they exist
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
bulkResolve: <T = unknown>(objects?: Array<{
|
||||
bulkResolve<T = unknown>(objects: Array<{
|
||||
id: string;
|
||||
type: string;
|
||||
}>) => Promise<{
|
||||
resolved_objects: ResolvedSimpleSavedObject<T>[];
|
||||
}>;
|
||||
}>): Promise<SavedObjectsBulkResolveResponse<T>>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| objects | Array<{ id: string; type: string; }> | an array of objects containing id, type |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
Promise<SavedObjectsBulkResolveResponse<T>>
|
||||
|
||||
The bulk resolve result for the saved objects for the given types and ids.
|
||||
|
||||
## Example
|
||||
|
||||
bulkResolve(\[ { id: 'one', type: 'config' }<!-- -->, { id: 'foo', type: 'index-pattern' } \])
|
|
@ -1,15 +1,15 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md) > [bulkUpdate](./kibana-plugin-core-public.savedobjectsclient.bulkupdate.md)
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsClientContract](./kibana-plugin-core-public.savedobjectsclientcontract.md) > [bulkUpdate](./kibana-plugin-core-public.savedobjectsclientcontract.bulkupdate.md)
|
||||
|
||||
## SavedObjectsClient.bulkUpdate() method
|
||||
## SavedObjectsClientContract.bulkUpdate() method
|
||||
|
||||
Update multiple documents at once
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
bulkUpdate<T = unknown>(objects?: SavedObjectsBulkUpdateObject[]): Promise<SavedObjectsBatchResponse<T>>;
|
||||
bulkUpdate<T = unknown>(objects: SavedObjectsBulkUpdateObject[]): Promise<SavedObjectsBatchResponse<T>>;
|
||||
```
|
||||
|
||||
## Parameters
|
|
@ -0,0 +1,26 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsClientContract](./kibana-plugin-core-public.savedobjectsclientcontract.md) > [create](./kibana-plugin-core-public.savedobjectsclientcontract.create.md)
|
||||
|
||||
## SavedObjectsClientContract.create() method
|
||||
|
||||
Persists an object
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
create<T = unknown>(type: string, attributes: T, options?: SavedObjectsCreateOptions): Promise<SimpleSavedObject<T>>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| type | string | |
|
||||
| attributes | T | |
|
||||
| options | SavedObjectsCreateOptions | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
Promise<SimpleSavedObject<T>>
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsClientContract](./kibana-plugin-core-public.savedobjectsclientcontract.md) > [delete](./kibana-plugin-core-public.savedobjectsclientcontract.delete.md)
|
||||
|
||||
## SavedObjectsClientContract.delete() method
|
||||
|
||||
Deletes an object
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
delete(type: string, id: string, options?: SavedObjectsDeleteOptions): Promise<{}>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| type | string | |
|
||||
| id | string | |
|
||||
| options | SavedObjectsDeleteOptions | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
Promise<{}>
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsClientContract](./kibana-plugin-core-public.savedobjectsclientcontract.md) > [find](./kibana-plugin-core-public.savedobjectsclientcontract.find.md)
|
||||
|
||||
## SavedObjectsClientContract.find() method
|
||||
|
||||
Search for objects
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
find<T = unknown, A = unknown>(options: SavedObjectsFindOptions): Promise<SavedObjectsFindResponsePublic<T>>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| options | SavedObjectsFindOptions | {<!-- -->string<!-- -->} options.type {<!-- -->string<!-- -->} options.search {<!-- -->string<!-- -->} options.searchFields - see Elasticsearch Simple Query String Query field argument for more information {<!-- -->integer<!-- -->} \[options.page=1\] {<!-- -->integer<!-- -->} \[options.perPage=20\] {<!-- -->array<!-- -->} options.fields {<!-- -->object<!-- -->} \[options.hasReference\] - { type, id } |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
Promise<SavedObjectsFindResponsePublic<T>>
|
||||
|
||||
A find result with objects matching the specified search.
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsClientContract](./kibana-plugin-core-public.savedobjectsclientcontract.md) > [get](./kibana-plugin-core-public.savedobjectsclientcontract.get.md)
|
||||
|
||||
## SavedObjectsClientContract.get() method
|
||||
|
||||
Fetches a single object
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
get<T = unknown>(type: string, id: string): Promise<SimpleSavedObject<T>>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| type | string | |
|
||||
| id | string | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
Promise<SimpleSavedObject<T>>
|
||||
|
||||
The saved object for the given type and id.
|
||||
|
|
@ -2,12 +2,28 @@
|
|||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsClientContract](./kibana-plugin-core-public.savedobjectsclientcontract.md)
|
||||
|
||||
## SavedObjectsClientContract type
|
||||
## SavedObjectsClientContract interface
|
||||
|
||||
SavedObjectsClientContract as implemented by the [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md)
|
||||
The client-side SavedObjectsClient is a thin convenience library around the SavedObjects HTTP API for interacting with Saved Objects.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare type SavedObjectsClientContract = PublicMethodsOf<SavedObjectsClient>;
|
||||
export interface SavedObjectsClientContract
|
||||
```
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Description |
|
||||
| --- | --- |
|
||||
| [bulkCreate(objects, options)](./kibana-plugin-core-public.savedobjectsclientcontract.bulkcreate.md) | Creates multiple documents at once |
|
||||
| [bulkGet(objects)](./kibana-plugin-core-public.savedobjectsclientcontract.bulkget.md) | Returns an array of objects by id |
|
||||
| [bulkResolve(objects)](./kibana-plugin-core-public.savedobjectsclientcontract.bulkresolve.md) | Resolves an array of objects by id, using any legacy URL aliases if they exist |
|
||||
| [bulkUpdate(objects)](./kibana-plugin-core-public.savedobjectsclientcontract.bulkupdate.md) | Update multiple documents at once |
|
||||
| [create(type, attributes, options)](./kibana-plugin-core-public.savedobjectsclientcontract.create.md) | Persists an object |
|
||||
| [delete(type, id, options)](./kibana-plugin-core-public.savedobjectsclientcontract.delete.md) | Deletes an object |
|
||||
| [find(options)](./kibana-plugin-core-public.savedobjectsclientcontract.find.md) | Search for objects |
|
||||
| [get(type, id)](./kibana-plugin-core-public.savedobjectsclientcontract.get.md) | Fetches a single object |
|
||||
| [resolve(type, id)](./kibana-plugin-core-public.savedobjectsclientcontract.resolve.md) | Resolves a single object |
|
||||
| [update(type, id, attributes, options)](./kibana-plugin-core-public.savedobjectsclientcontract.update.md) | Updates an object |
|
||||
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsClientContract](./kibana-plugin-core-public.savedobjectsclientcontract.md) > [resolve](./kibana-plugin-core-public.savedobjectsclientcontract.resolve.md)
|
||||
|
||||
## SavedObjectsClientContract.resolve() method
|
||||
|
||||
Resolves a single object
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
resolve<T = unknown>(type: string, id: string): Promise<ResolvedSimpleSavedObject<T>>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| type | string | |
|
||||
| id | string | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
Promise<ResolvedSimpleSavedObject<T>>
|
||||
|
||||
The resolve result for the saved object for the given type and id.
|
||||
|
||||
Saved objects that Kibana fails to find are replaced with an error object and an "exactMatch" outcome. The rationale behind the outcome is that "exactMatch" is the default outcome, and the outcome only changes if an alias is found. This behavior for the `resolve` API is unique to the public client, which batches individual calls with `bulkResolve` under the hood. We don't throw an error in that case for legacy compatibility reasons.
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsClientContract](./kibana-plugin-core-public.savedobjectsclientcontract.md) > [update](./kibana-plugin-core-public.savedobjectsclientcontract.update.md)
|
||||
|
||||
## SavedObjectsClientContract.update() method
|
||||
|
||||
Updates an object
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
update<T = unknown>(type: string, id: string, attributes: T, options?: SavedObjectsUpdateOptions): Promise<SimpleSavedObject<T>>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| type | string | |
|
||||
| id | string | |
|
||||
| attributes | T | |
|
||||
| options | SavedObjectsUpdateOptions | {<!-- -->integer<!-- -->} options.version - ensures version matches that of persisted object {<!-- -->object<!-- -->} options.migrationVersion - The optional migrationVersion of this document |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
Promise<SimpleSavedObject<T>>
|
||||
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
## SavedObjectsStart.client property
|
||||
|
||||
[SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md)
|
||||
[SavedObjectsClientContract](./kibana-plugin-core-public.savedobjectsclientcontract.md)
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
|
|
|
@ -15,5 +15,5 @@ export interface SavedObjectsStart
|
|||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [client](./kibana-plugin-core-public.savedobjectsstart.client.md) | SavedObjectsClientContract | [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md) |
|
||||
| [client](./kibana-plugin-core-public.savedobjectsstart.client.md) | SavedObjectsClientContract | [SavedObjectsClientContract](./kibana-plugin-core-public.savedobjectsclientcontract.md) |
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
## SimpleSavedObject class
|
||||
|
||||
This class is a very simple wrapper for SavedObjects loaded from the server with the [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md)<!-- -->.
|
||||
This class is a very simple wrapper for SavedObjects loaded from the server with the [SavedObjectsClientContract](./kibana-plugin-core-public.savedobjectsclientcontract.md)<!-- -->.
|
||||
|
||||
It provides basic functionality for creating/saving/deleting saved objects, but doesn't include any type-specific implementations.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue