diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index b6d85ce..cc207d4 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -102,6 +102,7 @@ export default { { text: 'Artist', link: '/wiki/artist/' }, { text: 'Artist Image', link: '/wiki/artistimage/' }, { text: 'Artist Resource', link: '/wiki/artistresource/' }, + { text: 'Artist Song', link: '/wiki/artistsong/' }, { text: 'Audio', link: '/wiki/audio/' }, { text: 'Image', link: '/wiki/image/' }, { text: 'Resource', link: '/wiki/resource/' }, @@ -412,6 +413,18 @@ export default { { text: 'Update', link: '/wiki/artistresource/update/' } ] }, + { + text: 'Artist Song', + collapsible: true, + items: [ + { text: 'Resource', link: '/wiki/artistsong/' }, + { text: 'Destroy', link: '/wiki/artistsong/destroy/' }, + { text: 'Index', link: '/wiki/artistsong/index/' }, + { text: 'Show', link: '/wiki/artistsong/show/' }, + { text: 'Store', link: '/wiki/artistsong/store/' }, + { text: 'Update', link: '/wiki/artistsong/update/' } + ] + }, { text: 'Audio', collapsible: true, diff --git a/docs/wiki/animeresource/index.md b/docs/wiki/animeresource/index.md index 59bb400..4fe5a17 100644 --- a/docs/wiki/animeresource/index.md +++ b/docs/wiki/animeresource/index.md @@ -41,4 +41,4 @@ The anime resource store endpoint creates a new anime resource and returns the n **[Anime Resource Update](/wiki/animeresource/update/)** -The anime update endpoint updates an anime resource and returns the updated anime resource resource. \ No newline at end of file +The anime resource update endpoint updates an anime resource and returns the updated anime resource resource. \ No newline at end of file diff --git a/docs/wiki/artistresource/index.md b/docs/wiki/artistresource/index.md index 656453d..6552ad3 100644 --- a/docs/wiki/artistresource/index.md +++ b/docs/wiki/artistresource/index.md @@ -41,4 +41,4 @@ The artist resource store endpoint creates a new artist resource and returns the **[Artist Resource Update](/wiki/artistresource/update/)** -The artist update endpoint updates an artist resource and returns the updated artist resource resource. \ No newline at end of file +The artist resource update endpoint updates an artist resource and returns the updated artist resource resource. \ No newline at end of file diff --git a/docs/wiki/artistsong/destroy/index.md b/docs/wiki/artistsong/destroy/index.md new file mode 100644 index 0000000..d825d62 --- /dev/null +++ b/docs/wiki/artistsong/destroy/index.md @@ -0,0 +1,39 @@ +--- +title: Artist Song Destroy +--- + +# Artist Song Destroy Endpoint + +The artist song destroy endpoint deletes an artist song and returns the deleted artist song resource. + +For example, the `/artistsong/chiwa_saitou/3373` endpoint will delete the association between the Chiwa Saitou artist and the "staple stable" song. + +## URL + +```sh +DELETE /artistsong/{artist:slug}/{song:id} +``` + +## Authentication + +**Required Permission**: delete artist, delete song + +**Roles with Permission**: Wiki Editor, Admin + +## Parameters + +None + +## Response + +```json +{ + message: "Song 'staple stable' has been detached from Artist 'Chiwa Saitou'.", +} +``` + +## Example + +```bash +curl -X DELETE -H "Authorization: Bearer {token}" https://api.animethemes.moe/artistsong/chiwa_saitou/3373 +``` diff --git a/docs/wiki/artistsong/index.md b/docs/wiki/artistsong/index.md new file mode 100644 index 0000000..37b6a15 --- /dev/null +++ b/docs/wiki/artistsong/index.md @@ -0,0 +1,44 @@ +--- +title: Artist Song +--- + +# Artist Song + +--- + +An artist song API resource represents the association between an artist and an song. + +## 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 | +| as | String | No | Used to distinguish a performance by alias, character or group | + +## Allowed Include Paths + +* artist +* song + +## Endpoints + +**[Artist Song Destroy](/wiki/artistsong/destroy/)** + +The artist song destroy endpoint deletes an artist song and returns the deleted artist song resource. + +**[Artist Song Index](/wiki/artistsong/index/)** + +The artist song index endpoint displays a listing of artist song resources. + +**[Artist Song Show](/wiki/artistsong/show/)** + +The artist song show endpoint returns an artist song resource. + +**[Artist Song Store](/wiki/artistsong/store/)** + +The artist song store endpoint creates a new artist song and returns the new artist song resource. + +**[Artist Song Update](/wiki/artistsong/update/)** + +The artist song update endpoint updates an artist song and returns the updated artist song resource. \ No newline at end of file diff --git a/docs/wiki/artistsong/index/index.md b/docs/wiki/artistsong/index/index.md new file mode 100644 index 0000000..d0bb0a3 --- /dev/null +++ b/docs/wiki/artistsong/index/index.md @@ -0,0 +1,79 @@ +--- +title: Artist Song Index +--- + +# Artist Song Index Endpoint + +The artist song index endpoint returns a listing of artist song resources. + +## URL + +```sh +GET /artistsong/ +``` + +## Authentication + +None + +## Parameters + +| Name | Required | Description | +| :----------: | :------: | :---------------------------------------------------------------------------------- | +| fields | No | Sparse fieldsets for resource types | +| filter | No | Filters for artist song resources & constraining the inclusion of related resources | +| include | No | Inclusion of related resources | +| page[number] | No | The page of artist song resources to display | +| page[size] | No | The number of artist song 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 for performance by alias, character or group | + +## 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 | +| as | Filter resources on distinguishing label for performance by alias, character or group | + +## Response + +```json +{ + artistsongs: [ + { + 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/artistsong/ +``` diff --git a/docs/wiki/artistsong/show/index.md b/docs/wiki/artistsong/show/index.md new file mode 100644 index 0000000..2ab0cd2 --- /dev/null +++ b/docs/wiki/artistsong/show/index.md @@ -0,0 +1,41 @@ +--- +title: Artist Song Show +--- + +# Artist Song Show Endpoint + +The artist song show endpoint returns an artist song resource. + +For example, the `/artistsong/chiwa_saitou/3373` endpoint will return the artist song resource for the association between the Chiwa Saitou artist and the "staple stable" song. + +## URL + +```sh +GET /artistsong/{artist:slug}/{song:id} +``` + +## Authentication + +None + +## Parameters + +None + +## Response + +```json +{ + artistsong: { + created_at: "created_at", + updated_at: "updated_at", + as: "as" + } +} +``` + +## Example + +```bash +curl https://api.animethemes.moe/artistsong/chiwa_saitou/3373 +``` diff --git a/docs/wiki/artistsong/store/index.md b/docs/wiki/artistsong/store/index.md new file mode 100644 index 0000000..3589bc1 --- /dev/null +++ b/docs/wiki/artistsong/store/index.md @@ -0,0 +1,47 @@ +--- +title: Artist Song Store +--- + +# Artist Song Store Endpoint + +The artist song store endpoint creates a new artist song and returns the new artist song resource. + +For example, the `/artistsong?artist_id=53&song_id=3373` endpoint will create a new association between the Chiwa Saitou artist and the "staple stable" song. + +## URL + +```sh +POST /artistsong +``` + +## Authentication + +**Required Permission**: create artist, create song + +**Roles with Permission**: Wiki Editor, Admin + +## Parameters + +| Name | Required | Rules | +| :-------: | :------: | :------------------------ | +| artist_id | Yes | integer, Artist ID exists | +| song_id | Yes | integer, Song ID exists | +| as | No | string, max:192 | + +## Response + +```json +{ + artistsong: { + created_at: "created_at", + updated_at: "updated_at", + as: "as" + } +} +``` + +## Example + +```bash +curl -X POST -H "Authorization: Bearer {token}" https://api.animethemes.moe/artistsong/ +``` diff --git a/docs/wiki/artistsong/update/index.md b/docs/wiki/artistsong/update/index.md new file mode 100644 index 0000000..6171c0c --- /dev/null +++ b/docs/wiki/artistsong/update/index.md @@ -0,0 +1,45 @@ +--- +title: Artist Song Update +--- + +# Artist Song Update Endpoint + +The artist song update endpoint updates an artist song and returns the updated artist song resource. + +For example, the `/artistsong/chiwa_saitou/3373?as=updated+label` endpoint will update the association between the Chiwa Saitou artist and the "staple stable" song. + +## URL + +```sh +PUT|PATCH /artistsong/{artist:slug}/{song:id} +``` + +## Authentication + +**Required Permission**: update artist, update song + +**Roles with Permission**: Wiki Editor, Admin + +## Parameters + +| Name | Required | Rules | +| :---------: | :------: | :-------------- | +| as | No | string, max:192 | + +## Response + +```json +{ + artistsong: { + created_at: "created_at", + updated_at: "updated_at", + as: "as" + } +} +``` + +## Example + +```bash +curl -X PATCH -H "Authorization: Bearer {token}" https://api.animethemes.moe/artistsong/ +``` diff --git a/docs/wiki/index.md b/docs/wiki/index.md index a155904..8a7dc71 100644 --- a/docs/wiki/index.md +++ b/docs/wiki/index.md @@ -54,6 +54,10 @@ An artist image API resource represents the association between an artist and an An artist resource API resource represents the association between an artist and an external resource. +**[Artist Song](/wiki/artistsong/)** + +An artist song API resource represents the association between an artist and a song. + **[Audio](/wiki/audio/)** An audio API resource represents the audio track of a video. diff --git a/docs/wiki/studioresource/index.md b/docs/wiki/studioresource/index.md index cc6ab4e..a64c6e6 100644 --- a/docs/wiki/studioresource/index.md +++ b/docs/wiki/studioresource/index.md @@ -41,4 +41,4 @@ The studio resource store endpoint creates a new studio resource and returns the **[Studio Resource Update](/wiki/studioresource/update/)** -The studio update endpoint updates a studio resource and returns the updated studio resource resource. \ No newline at end of file +The studio resource update endpoint updates a studio resource and returns the updated studio resource resource. \ No newline at end of file