diff --git a/docs/intro/jsonapi/index.md b/docs/intro/jsonapi/index.md index c388afe..e096c34 100644 --- a/docs/intro/jsonapi/index.md +++ b/docs/intro/jsonapi/index.md @@ -58,6 +58,7 @@ The AnimeThemes API Resource Object attributes are included as top-level members slug: "slug", year: year, season: "season", + media_format: "media_format", synopsis: "synopsis", ... } @@ -105,6 +106,7 @@ The AnimeThemes API Resource Object collections shall contain `links` and `meta` slug: "slug", year: year, season: "season", + media_format: "media_format", synopsis: "synopsis", created_at: "created_at", updated_at: "updated_at", @@ -212,6 +214,7 @@ If inclusion of related resources is not specified, the AnimeThemes API shall ** slug: "slug", year: year, season: "season", + media_format: "media_format", synopsis: "synopsis", created_at: "created_at", updated_at: "updated_at", @@ -245,6 +248,7 @@ If the client does not specify the set of fields for a given resource type, the slug: "slug", year: year, season: "season", + media_format: "media_format", synopsis: "synopsis", created_at: "created_at", updated_at: "updated_at", @@ -267,6 +271,7 @@ The AnimeThemes API supports sorting for every endpoint that returns a collectio slug: "slug", year: 1963, season: "season", + media_format: "media_format", synopsis: "synopsis", created_at: "created_at", updated_at: "updated_at", @@ -304,6 +309,7 @@ The AnimeThemes API supports an offset pagination strategy for every endpoint th slug: "slug", year: year, season: "season", + media_format: "media_format", synopsis: "synopsis", created_at: "created_at", updated_at: "updated_at", diff --git a/docs/search/index.md b/docs/search/index.md index 940961f..2b8b170 100644 --- a/docs/search/index.md +++ b/docs/search/index.md @@ -39,6 +39,7 @@ None slug: "slug", year: year, season: "season", + media_format: "media_format", synopsis: "synopsis", created_at: "created_at", updated_at: "updated_at", diff --git a/docs/wiki/animetheme/index/index.md b/docs/wiki/animetheme/index/index.md index 82b4915..e368868 100644 --- a/docs/wiki/animetheme/index/index.md +++ b/docs/wiki/animetheme/index/index.md @@ -44,11 +44,12 @@ None ## Allowed Relation Sort Fields -| Name | Description | -| :----------: | :--------------------------------------------------------------------- | -| anime.season | Sort resources on the season of the anime that the resource belongs to | -| anime.year | Sort resources on the year of the anime that the resource belongs to | -| song.title | Sort resources on the title of the song that the resource belongs to | +| Name | Description | +| :----------------: | :--------------------------------------------------------------------------- | +| anime.season | Sort resources on the season of the anime that the resource belongs to | +| anime.media_format | Sort resources on the media_format of the anime that the resource belongs to | +| anime.year | Sort resources on the year of the anime that the resource belongs to | +| song.title | Sort resources on the title of the song that the resource belongs to | ## Filters diff --git a/docs/wiki/animeyear/show/index.md b/docs/wiki/animeyear/show/index.md index 81011c2..de24667 100644 --- a/docs/wiki/animeyear/show/index.md +++ b/docs/wiki/animeyear/show/index.md @@ -36,6 +36,7 @@ None slug: "slug", year: year, season: "season", + media_format: "media_format", synopsis: "synopsis", created_at: "created_at", updated_at: "updated_at", @@ -50,6 +51,7 @@ None slug: "slug", year: year, season: "season", + media_format: "media_format", synopsis: "synopsis", created_at: "created_at", updated_at: "updated_at", @@ -64,6 +66,7 @@ None slug: "slug", year: year, season: "season", + media_format: "media_format", synopsis: "synopsis", created_at: "created_at", updated_at: "updated_at", @@ -78,6 +81,7 @@ None slug: "slug", year: year, season: "season", + media_format: "media_format", synopsis: "synopsis", created_at: "created_at", updated_at: "updated_at", diff --git a/docs/wiki/song/index.md b/docs/wiki/song/index.md index 33652ed..32c9d94 100644 --- a/docs/wiki/song/index.md +++ b/docs/wiki/song/index.md @@ -25,6 +25,7 @@ For example, Staple Stable is the song for the Bakemonogatari OP1 AnimeTheme. * animethemes * animethemes.anime * artists +* resources ## Allowed Pivots diff --git a/docs/wiki/songresource/destroy/index.md b/docs/wiki/songresource/destroy/index.md new file mode 100644 index 0000000..29eae99 --- /dev/null +++ b/docs/wiki/songresource/destroy/index.md @@ -0,0 +1,39 @@ +--- +title: Song Resource Destroy +--- + +# Song Resource Destroy Endpoint + +The song resource destroy endpoint deletes an song resource and returns the deleted song resource resource. + +For example, the `/songresource/10535/30212` endpoint will delete the association between the Mijuku DREAMER song and the external resource of id 30212. + +## URL + +```sh +DELETE /songresource/{song:id}/{resource:id} +``` + +## Authentication + +**Required Permission**: delete song, delete external resource + +**Roles with Permission**: Wiki Editor, Admin + +## Parameters + +None + +## Response + +```json +{ + message: "Resource 'https://open.spotify.com/track/6f9SU0JwNjVDjduReyFpAd?si=2719f3d5bd014f17' has been detached from Song 'Mijuku DREAMER'.", +} +``` + +## Example + +```bash +curl -X DELETE -H "Authorization: Bearer {token}" https://api.animethemes.moe/songresource/10535/30212 +``` diff --git a/docs/wiki/songresource/index.md b/docs/wiki/songresource/index.md new file mode 100644 index 0000000..5ef31ca --- /dev/null +++ b/docs/wiki/songresource/index.md @@ -0,0 +1,44 @@ +--- +title: Song Resource +--- + +# Song Resource + +--- + +An song resource API resource represents the association between an song and an external resource. + +## Fields + +| Name | Type | Nullable | Default | Description | +| :--------: | :-----: | :------: | :-----: | :------------------------------------------------------- | +| created_at | Date | No | No | The date that the resource was created | +| updated_at | Date | No | No | The date that the resource was last modified | +| as | String | No | Yes | Used to distinguish resources that map to the same song | + +## Allowed Include Paths + +* song +* resource + +## Endpoints + +**[Song Resource Destroy](/wiki/songresource/destroy/)** + +The song resource destroy endpoint deletes an song resource and returns the deleted song resource resource. + +**[Song Resource Index](/wiki/songresource/index/)** + +The song resource index endpoint displays a listing of song resource resources. + +**[Song Resource Show](/wiki/songresource/show/)** + +The song resource show endpoint returns an song resource resource. + +**[Song Resource Store](/wiki/songresource/store/)** + +The song resource store endpoint creates a new song resource and returns the new song resource resource. + +**[Song Resource Update](/wiki/songresource/update/)** + +The song resource update endpoint updates an song resource and returns the updated song resource resource. \ No newline at end of file diff --git a/docs/wiki/songresource/index/index.md b/docs/wiki/songresource/index/index.md new file mode 100644 index 0000000..2d2efd6 --- /dev/null +++ b/docs/wiki/songresource/index/index.md @@ -0,0 +1,79 @@ +--- +title: Song Resource Index +--- + +# Song Resource Index Endpoint + +The song resource index endpoint returns a listing of song resource resources. + +## URL + +```sh +GET /songresource/ +``` + +## Authentication + +None + +## Parameters + +| Name | Required | Description | +| :----------: | :------: | :---------------------------------------------------------------------------- | +| fields | No | Sparse fieldsets for resource types | +| filter | No | Filters for song resources & constraining the inclusion of related resources | +| include | No | Inclusion of related resources | +| page[number] | No | The page of song resource resources to display | +| page[size] | No | The number of song resource 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 | +| as | Sort resources on distinguishing label | + +## Filters + +| Name | Description | +| :--------: | :--------------------------------------------------------- | +| created_at | Filter resources on the resource creation date | +| updated_at | Filter resources on the resource last modified date | +| as | Filter resources on the resource distinguishing label | +| has | Filter resources on relations within allowed include paths | + +## Response + +```json +{ + songresources: [ + { + created_at: "created_at", + updated_at: "updated_at", + as: "as" + }, + ... + ], + 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/songresource/ +``` diff --git a/docs/wiki/songresource/show/index.md b/docs/wiki/songresource/show/index.md new file mode 100644 index 0000000..5986ca6 --- /dev/null +++ b/docs/wiki/songresource/show/index.md @@ -0,0 +1,41 @@ +--- +title: Song Resource Show +--- + +# Song Resource Show Endpoint + +The song resource show endpoint returns an song resource resource. + +For example, the `/songresource/10535/30212` endpoint will return the song resource resource for the association between the Mijuku DREAMER song and the external resource of id 30212. + +## URL + +```sh +GET /songresource/{song:id}/{resource:id} +``` + +## Authentication + +None + +## Parameters + +None + +## Response + +```json +{ + songresource: { + created_at: "created_at", + updated_at: "updated_at", + as: "as" + } +} +``` + +## Example + +```bash +curl https://api.animethemes.moe/songresource/10535/30212 +``` diff --git a/docs/wiki/songresource/store/index.md b/docs/wiki/songresource/store/index.md new file mode 100644 index 0000000..1be7e12 --- /dev/null +++ b/docs/wiki/songresource/store/index.md @@ -0,0 +1,45 @@ +--- +title: Song Resource Store +--- + +# Song Resource Store Endpoint + +The song resource store endpoint creates a new song resource and returns the new song resource resource. + +For example, the `/songresource/10535/30212` endpoint will create a new association between the Mijuku DREAMER song and the external resource of id 30212. + +## URL + +```sh +POST /songresource/{song:id}/{resource:id} +``` + +## Authentication + +**Required Permission**: create song, create external resource + +**Roles with Permission**: Wiki Editor, Admin + +## Parameters + +| Name | Required | Rules | +| :--: | :------: | :-------------- | +| as | No | string, max:192 | + +## Response + +```json +{ + songresource: { + created_at: "created_at", + updated_at: "updated_at", + as: "as" + } +} +``` + +## Example + +```bash +curl -X POST -H "Authorization: Bearer {token}" https://api.animethemes.moe/songresource/10535/30212 +``` diff --git a/docs/wiki/songresource/update/index.md b/docs/wiki/songresource/update/index.md new file mode 100644 index 0000000..de0c19d --- /dev/null +++ b/docs/wiki/songresource/update/index.md @@ -0,0 +1,45 @@ +--- +title: Song Resource Update +--- + +# Song Resource Update Endpoint + +The song resource store endpoint updates an song resource and returns the updated song resource resource. + +For example, the `/songresource/10535/30212?as=updated+label` endpoint will update the association between the Mijuku DREAMER song and the external resource of id 30212. + +## URL + +```sh +PUT|PATCH /songresource/{song:id}/{resource:id} +``` + +## Authentication + +**Required Permission**: update song, update external resource + +**Roles with Permission**: Wiki Editor, Admin + +## Parameters + +| Name | Required | Rules | +| :---------: | :------: | :-------------- | +| as | No | string, max:192 | + +## Response + +```json +{ + songresource: { + created_at: "created_at", + updated_at: "updated_at", + as: "as" + } +} +``` + +## Example + +```bash +curl -X PATCH -H "Authorization: Bearer {token}" https://api.animethemes.moe/songresource/ +```