[Part of #176153] Saved objects (#179752)

This commit is contained in:
Alejandro Fernández Haro 2024-04-02 10:57:51 +02:00 committed by GitHub
parent e290d2c1ab
commit 73347f6cb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 5 deletions

View file

@ -262,9 +262,8 @@ export const performBulkUpdate = async <T>(
const typeDefinition = registry.getType(type)!;
const updatedAttributes = mergeForUpdate({
// @ts-expect-error upgrade typescript v4.9.5
targetAttributes: {
...migrated!.attributes,
...(migrated!.attributes as Record<string, unknown>),
},
updatedAttributes: await encryptionHelper.optionallyEncryptAttributes(
type,

View file

@ -247,9 +247,8 @@ export const executeUpdate = async <T>(
// therefor we can safely process with the "standard" update sequence.
const updatedAttributes = mergeForUpdate({
// @ts-expect-error upgrade typescript v4.9.5
targetAttributes: {
...migrated!.attributes,
...(migrated!.attributes as Record<string, unknown>),
},
updatedAttributes: await encryptionHelper.optionallyEncryptAttributes(
type,

View file

@ -66,7 +66,7 @@ export interface SavedObjectReference {
export interface SavedObject<T = unknown> {
/** The ID of this Saved Object, guaranteed to be unique for all objects of the same `type` */
id: string;
/** The type of Saved Object. Each plugin can define it's own custom Saved Object types. */
/** The type of Saved Object. Each plugin can define its own custom Saved Object types. */
type: string;
/** An opaque version number which changes on each successful write operation. Can be used for implementing optimistic concurrency control. */
version?: string;