refs https://github.com/TryGhost/Arch/issues/99
- Added naive version of the count method using bookshelf models metadata. We aim to use knex anyway, so this is just to get the tests passing
refs https://github.com/TryGhost/Arch/issues/99
- This is a naive implementation mostly based on existing bookshelf approach. It's up for discussion if doing aggregation inside of the browse method is a right call or this data should be separated into a different method
- To reiterate, the aim for initial spike is to make the cod work using nest and figure out better patterns iteratively while it's fresh.
refs https://github.com/TryGhost/Arch/issues/99
- The timezone formatting was dropped from the migrated implementation because we do not do the formatting in the legacy API (incorrectly imo). We only do the timezone formatting on Posts API endpoints.
- Adding formatting for migrated Snippets API would mean a breaking change, which we don't want to make just yet
refs https://github.com/TryGhost/Arch/issues/99
- Only posts resources ever have the dates formatted in the legacy API. There's no need to implement this formatting in Snippets API at the moment
refs https://github.com/TryGhost/Arch/issues/99
- This is a very crude implementation that showcases moving pieces that are needed to make Snippets API work with NestJS
- The snippets api e2e test suite enables the `nestSnippetsAPI` flag to allow testing nest implementation of the GET /snippets endpoint
refs https://github.com/TryGhost/Arch/issues/99
- The Snippets repository allows to fetch Snippet entity data through the legacy bookshelf models. The bookshelf should be substituted with knex wherever possible, once we have reached the feature parity and stability with the legacy Snippets API.
refs https://github.com/TryGhost/Arch/issues/100
- Because of the way how new NestJS code is integrated into existing Ghost I've introduced a way to "skip" rather than "block" access to certain API endpoints when the labs flag is enabled.
- This change skips the `GET /snippets` legacy Admin API route and falls through to the NestJS route
refs https://github.com/TryGhost/Arch/issues/99
- Adds connection between snippets in NestJS application to the models in the legacy Ghost codebase to link snippets to real data
- The NestJS controller code can be executed by commenting out `router.get('/snippets', mw.authAdminApi, http(api.snippets.browse));` in the ghost core Admin API routes file
refs https://github.com/TryGhost/Arch/issues/99
- This is scaffolding for the Snippets API controller
- The change includes a basic controller, service and a test to get the ball rolling
- In the Nest code we are writing an example of the ideal code. The ESlint rules will adjust to how code is written in this project eventually once we experiment with things enough.
- Examples of new naming convention are based on `.` separator e.g.:
- The middle words represent use cases, could later become pods e.g. posts.controller.js, posts.repository.js, posts.dto.js, posts.service.js, posts.scheduling.service.js, stripe.provider.js, stripe.webhook.listener.js.