src/core/packages/saved-objects/api-server-internal/README.md
This package contains the internal implementation of core's server-side savedObjects client and repository.
@kbn/core-saved-objects-api-server-internal
- /src/lib
- repository.ts
- /apis
- create.ts
- delete.ts
- ....
- /helpers
- /utils
- /internals
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).
'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.
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.
Unit tests should be kept close to the implementation. While not always possible to customize test fixtures and mocks completely, it is perfectly acceptible to duplicate code, with a focus on code coverage.