kibana/packages/core/saved-objects/core-saved-objects-api-server
Christiane (Tina) Heiligers 727929683e
[SOR] implement downward compatible update (#161822)
Part of https://github.com/elastic/kibana/issues/152807

## Summary

Change the way the `update` API of the savedObjects repository works, to
stop using ES `update` and perform the update manually instead by
fetching the document, applying the update and then re-indexing the
whole document.

This is required for BWC and version cohabitation reasons, to allow us
converting the document to the last known version before applying the
update.

The retry on conflict behavior is manually performed too, by detecting
conflict errors during the `index` calls and performing the whole loop
(fetch->migrate->update->index) again.

Upserts are done in a similar way, by checking the document's existence
first, and then using the `create` API.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: pgayvallet <pierre.gayvallet@elastic.co>
2023-09-01 10:27:17 +02:00
..
src [SOR] implement downward compatible update (#161822) 2023-09-01 10:27:17 +02:00
index.ts Revert "[SOR] Allow optionally downgrading documents with a higher version model in API READ methods" (#164991) 2023-08-28 20:36:27 +02:00
jest.config.js Create common and api types packages for the savedObjects domain (#136722) 2022-07-26 04:01:33 -07:00
kibana.jsonc Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
package.json Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
README.md Create common and api types packages for the savedObjects domain (#136722) 2022-07-26 04:01:33 -07:00
tsconfig.json [Saved Objects] Import SO types from server rather than common to avoid deprecation (#149289) 2023-01-25 05:38:05 -07:00

@kbn/core-saved-objects-api-server

This package contains the public types for core's server-side savedObjects client (and repository) APIs.