refs https://github.com/TryGhost/Team/issues/3170
- This implementation allows to create an automatic collection with a filter defining automatically populated posts that belong to a collection
- To populate collection using a filter the API client can send a `filter` property along with a collection request
- Filter values are compatible with the filters used in Content API (https://ghost.org/docs/content-api/#filter)
refs https://github.com/TryGhost/Team/issues/3260
- We need a way to remove posts form collections without fetching the whole collection's content. This API method allows to remove posts from manual collections by collection id and post id.
- As a response it returns up to date collection state without the removed post.
refs https://github.com/TryGhost/Team/issues/3260
- Whenever properties of the DTO are undefined they should be removed to avoid unintentional empty assignments to the stored collection
Rather than using `require` we can add a type definition file, this allows us
to add custom types in the future if we want. We need to add some config for
ts-node to pick up the types correctly.
closes https://github.com/TryGhost/Team/issues/3259
- API output mappers (soon to be serializers) are meant to work based on allowlist set of output properties. Having the allowlist early on will allow to track the API evolution consistently.
refs https://github.com/TryGhost/Team/issues/3294
- The factory method for the Collection and validations should live close together based on our latest architectural direction
refs https://github.com/TryGhost/Team/issues/3167
- Having paging metadata is part of every API response and was missing from initial implementation
- The getAll method has all of the values as "static" as there's nothing to page on.
refs https://github.com/TryGhost/Team/issues/3167
- The core client (API) needs a way to pass in information without an ID when creating a new entity, handling it on service/repository layer makes the most sense.
- Used "require" syntax to import tpl/errors modules, otherwise TS compiler was complaining about type compatibility issues, this works as a temporary workaround and is tracked and an issue to improve in the future.
closes https://github.com/TryGhost/Team/issues/3166
- The collections service contains CRUD logic to manage collection entities through: save, getById, getAll, and destroy methods.