From 5c8c68122fa0cecd8f412f5a28cbeb37654378c6 Mon Sep 17 00:00:00 2001 From: paranarimasu <33796518+paranarimasu@users.noreply.github.com> Date: Sat, 4 Mar 2023 13:48:31 -0600 Subject: [PATCH] feat: adding anime series endpoints (#66) --- docs/.vitepress/config.js | 12 ++++ docs/wiki/animeseries/destroy/index.md | 42 ++++++++++++++ docs/wiki/animeseries/index.md | 39 +++++++++++++ docs/wiki/animeseries/index/index.md | 76 ++++++++++++++++++++++++++ docs/wiki/animeseries/show/index.md | 40 ++++++++++++++ docs/wiki/animeseries/store/index.md | 45 +++++++++++++++ docs/wiki/index.md | 8 +++ 7 files changed, 262 insertions(+) create mode 100644 docs/wiki/animeseries/destroy/index.md create mode 100644 docs/wiki/animeseries/index.md create mode 100644 docs/wiki/animeseries/index/index.md create mode 100644 docs/wiki/animeseries/show/index.md create mode 100644 docs/wiki/animeseries/store/index.md diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index fac1292..d9780a8 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -94,6 +94,7 @@ export default { { text: 'Anime', link: '/wiki/anime/' }, { text: 'Anime Image', link: '/wiki/animeimage/' }, { text: 'Anime Resource', link: '/wiki/animeresource/' }, + { text: 'Anime Series', link: '/wiki/animeseries/' }, { text: 'Anime Synonym', link: '/wiki/animesynonym/' }, { text: 'Anime Theme', link: '/wiki/animetheme/' }, { text: 'Anime Theme Entry', link: '/wiki/animethemeentry/' }, @@ -305,6 +306,17 @@ export default { { text: 'Update', link: '/wiki/animeresource/update/' } ] }, + { + text: 'Anime Series', + collapsible: true, + items: [ + { text: 'Resource', link: '/wiki/animeseries/' }, + { text: 'Destroy', link: '/wiki/animeseries/destroy/' }, + { text: 'Index', link: '/wiki/animeseries/index/' }, + { text: 'Show', link: '/wiki/animeseries/show/' }, + { text: 'Store', link: '/wiki/animeseries/store/' } + ] + }, { text: 'Anime Synonym', collapsible: true, diff --git a/docs/wiki/animeseries/destroy/index.md b/docs/wiki/animeseries/destroy/index.md new file mode 100644 index 0000000..aab9afe --- /dev/null +++ b/docs/wiki/animeseries/destroy/index.md @@ -0,0 +1,42 @@ +--- +title: Anime Series Destroy +--- + +# Anime Series Destroy Endpoint + +The anime series destroy endpoint deletes an anime series and returns the deleted anime series resource. + +For example, the `/animeseries/bakemonogatari/monogatari` endpoint will delete the association between the Bakemonogatari anime and the Monogatari series. + +## URL + +```sh +DELETE /animeseries/{anime:slug}/{series:slug} +``` + +## Authentication + +**Required Permission**: delete anime, delete series + +**Roles with Permission**: Wiki Editor, Admin + +## Parameters + +None + +## Response + +```json +{ + animeseries: { + created_at: "created_at", + updated_at: "updated_at" + } +} +``` + +## Example + +```bash +curl -X DELETE -H "Authorization: Bearer {token}" https://api.animethemes.moe/animeseries/bakemonogatari/monogatari +``` diff --git a/docs/wiki/animeseries/index.md b/docs/wiki/animeseries/index.md new file mode 100644 index 0000000..2aa3e7c --- /dev/null +++ b/docs/wiki/animeseries/index.md @@ -0,0 +1,39 @@ +--- +title: Anime Series +--- + +# Anime Series + +--- + +An anime series API resource represents the association between an anime and a series. + +## Fields + +| Name | Type | Nullable | Description | +| :--------: | :-----: | :------: | :------------------------------------------- | +| created_at | Date | No | The date that the resource was created | +| updated_at | Date | No | The date that the resource was last modified | + +## Allowed Include Paths + +* anime +* series + +## Endpoints + +**[Anime Series Destroy](/wiki/animeseries/destroy/)** + +The anime series destroy endpoint deletes an anime series and returns the deleted anime series resource. + +**[Anime Series Index](/wiki/animeseries/index/)** + +The anime series index endpoint displays a listing of anime series resources. + +**[Anime Series Show](/wiki/animeseries/show/)** + +The anime series show endpoint returns an anime series resource. + +**[Anime Series Store](/wiki/animeseries/store/)** + +The anime series store endpoint creates a new anime series and returns the new anime series resource. \ No newline at end of file diff --git a/docs/wiki/animeseries/index/index.md b/docs/wiki/animeseries/index/index.md new file mode 100644 index 0000000..3461464 --- /dev/null +++ b/docs/wiki/animeseries/index/index.md @@ -0,0 +1,76 @@ +--- +title: Anime Series Index +--- + +# Anime Series Index Endpoint + +The anime series index endpoint returns a listing of anime series resources. + +## URL + +```sh +GET /animeseries/ +``` + +## Authentication + +None + +## Parameters + +| Name | Required | Description | +| :----------: | :------: | :----------------------------------------------------------------------------------- | +| fields | No | Sparse fieldsets for resource types | +| filter | No | Filters for anime series resources & constraining the inclusion of related resources | +| include | No | Inclusion of related resources | +| page[number] | No | The page of anime series resources to display | +| page[size] | No | The number of anime series resources to display for the current page | +| sort | No | The list of fields to sort the resources | + +## Allowed Sort Fields + +| Name | Description | +| :--------: | :------------------------------------------------ | +| created_at | Sort resources on the resource creation date | +| updated_at | Sort resources on the resource last modified date | + +## Filters + +| Name | Description | +| :--------: | :--------------------------------------------------------- | +| created_at | Filter resources on the resource creation date | +| updated_at | Filter resources on the resource last modified date | +| has | Filter resources on relations within allowed include paths | + +## Response + +```json +{ + animeseries: [ + { + created_at: "created_at", + updated_at: "updated_at" + }, + ... + ], + links: { + first: "first", + last: "last", + prev: "prev", + next: "next" + }, + meta: { + current_page: current_page, + from: from, + path: "path", + per_page: per_page, + to: to + } +} +``` + +## Example + +```bash +curl https://api.animethemes.moe/animeseries/ +``` diff --git a/docs/wiki/animeseries/show/index.md b/docs/wiki/animeseries/show/index.md new file mode 100644 index 0000000..27d7d7e --- /dev/null +++ b/docs/wiki/animeseries/show/index.md @@ -0,0 +1,40 @@ +--- +title: Anime Series Show +--- + +# Anime Series Show Endpoint + +The anime series show endpoint returns an anime series resource. + +For example, the `/animeseries/bakemonogatari/monogatari` endpoint will return the anime series resource for the association between the Bakemonogatari anime and the Monogatari series. + +## URL + +```sh +GET /animeseries/{anime:slug}/{series:slug} +``` + +## Authentication + +None + +## Parameters + +None + +## Response + +```json +{ + animeseries: { + created_at: "created_at", + updated_at: "updated_at" + } +} +``` + +## Example + +```bash +curl https://api.animethemes.moe/animeseries/bakemonogatari/monogatari +``` diff --git a/docs/wiki/animeseries/store/index.md b/docs/wiki/animeseries/store/index.md new file mode 100644 index 0000000..5d27b80 --- /dev/null +++ b/docs/wiki/animeseries/store/index.md @@ -0,0 +1,45 @@ +--- +title: Anime Series Store +--- + +# Anime Series Store Endpoint + +The anime series store endpoint creates a new anime series and returns the new anime series resource. + +For example, the `/animeseries?anime_id=218&series_id=116` endpoint will create a new association between the Bakemonogatari anime and the Monogatari series. + +## URL + +```sh +POST /animeseries +``` + +## Authentication + +**Required Permission**: create anime, create series + +**Roles with Permission**: Wiki Editor, Admin + +## Parameters + +| Name | Required | Rules | +| :-------: | :------: | :------------------------ | +| anime_id | Yes | integer, Anime ID exists | +| series_id | Yes | integer, Series ID exists | + +## Response + +```json +{ + animeseries: { + created_at: "created_at", + updated_at: "updated_at" + } +} +``` + +## Example + +```bash +curl -X POST -H "Authorization: Bearer {token}" https://api.animethemes.moe/animeseries/ +``` diff --git a/docs/wiki/index.md b/docs/wiki/index.md index 141a10e..7b908fe 100644 --- a/docs/wiki/index.md +++ b/docs/wiki/index.md @@ -18,6 +18,14 @@ An anime API resource represents a production with at least one opening or endin An anime image API resource represents the association between an anime and an image. +**[Anime Resource](/wiki/animeresource/)** + +An anime resource API resource represents the association between an anime and an external resource. + +**[Anime Series](/wiki/animeseries/)** + +An anime series API resource represents the association between an anime and a series. + **[Anime Synonym](/wiki/animesynonym/)** An anime synonym API resource represents an alternate title or common abbreviation for an anime.