kibana/packages/core/saved-objects/core-saved-objects-api-server-internal
Pierre Gayvallet 50950e9c3b
[ZDT] SOR: handle higher-version documents retrieved from persistence. (#158251)
## Summary

Follow-up of https://github.com/elastic/kibana/pull/157895
Part of https://github.com/elastic/kibana/issues/150312

Adapt the SOR to accept retrieving documents on higher versions from the
persistence, and convert them back to the latest knows version (using
the version schema feature added in
https://github.com/elastic/kibana/pull/157895).
2023-05-30 00:11:56 -07:00
..
src [ZDT] SOR: handle higher-version documents retrieved from persistence. (#158251) 2023-05-30 00:11:56 -07:00
index.ts Migrate remaining parts of server-side SO domain to packages (#139305) 2022-08-26 01:53:37 -07:00
jest.config.js Migrate remaining parts of server-side SO domain to packages (#139305) 2022-08-26 01:53:37 -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 SavedObjectsRepository code cleanup (#157154) 2023-05-11 00:25:27 -07:00
tsconfig.json SavedObjectsRepository code cleanup (#157154) 2023-05-11 00:25:27 -07:00

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

This package contains the internal implementation of core's server-side savedObjects client and repository.

Structure of the package

@kbn/core-saved-objects-api-server-internal
- /src/lib
  - repository.ts
  - /apis
    - create.ts
    - delete.ts
    - ....
    - /helpers
    - /utils
    - /internals

lib/apis/utils

Base utility functions, receiving (mostly) parameters from a given API call's option (e.g the type or id of a document, but not the type registry).

lib/apis/helpers

'Stateful' helpers. These helpers were mostly here to receive the utility functions that were extracted from the SOR. They are instantiated with the SOR's context (e.g type registry, mappings and so on), to avoid the caller to such helpers to have to pass all the parameters again.

lib/apis/internals

I would call them 'utilities with business logic'. These are the 'big' chunks of logic called by the APIs. E.g preflightCheckForCreate, internalBulkResolve and so on.