diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index b2ae039..abef7a5 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -101,6 +101,7 @@ export default { { text: 'Anime Theme Entry', link: '/wiki/animethemeentry/' }, { text: 'Artist', link: '/wiki/artist/' }, { text: 'Artist Image', link: '/wiki/artistimage/' }, + { text: 'Artist Resource', link: '/wiki/artistresource/' }, { text: 'Audio', link: '/wiki/audio/' }, { text: 'Image', link: '/wiki/image/' }, { text: 'Resource', link: '/wiki/resource/' }, @@ -397,6 +398,18 @@ export default { { text: 'Store', link: '/wiki/artistimage/store/' } ] }, + { + text: 'Artist Resource', + collapsible: true, + items: [ + { text: 'Resource', link: '/wiki/artistresource/' }, + { text: 'Destroy', link: '/wiki/artistresource/destroy/' }, + { text: 'Index', link: '/wiki/artistresource/index/' }, + { text: 'Show', link: '/wiki/artistresource/show/' }, + { text: 'Store', link: '/wiki/artistresource/store/' }, + { text: 'Update', link: '/wiki/artistresource/update/' } + ] + }, { text: 'Audio', collapsible: true, diff --git a/docs/wiki/artistimage/destroy/index.md b/docs/wiki/artistimage/destroy/index.md index fcd2def..e8be570 100644 --- a/docs/wiki/artistimage/destroy/index.md +++ b/docs/wiki/artistimage/destroy/index.md @@ -35,5 +35,5 @@ None ## Example ```bash -curl -X DELETE -H "Authorization: Bearer {token}" https://api.artistthemes.moe/artistimage/chiwa_saitou/6703 +curl -X DELETE -H "Authorization: Bearer {token}" https://api.animethemes.moe/artistimage/chiwa_saitou/6703 ``` diff --git a/docs/wiki/artistimage/index/index.md b/docs/wiki/artistimage/index/index.md index 9df8521..b933afa 100644 --- a/docs/wiki/artistimage/index/index.md +++ b/docs/wiki/artistimage/index/index.md @@ -72,5 +72,5 @@ None ## Example ```bash -curl https://api.artistthemes.moe/artistimage/ +curl https://api.animethemes.moe/artistimage/ ``` diff --git a/docs/wiki/artistimage/show/index.md b/docs/wiki/artistimage/show/index.md index c66c3d6..8b467d2 100644 --- a/docs/wiki/artistimage/show/index.md +++ b/docs/wiki/artistimage/show/index.md @@ -36,5 +36,5 @@ None ## Example ```bash -curl https://api.artistthemes.moe/artistimage/chiwa_saitou/6703 +curl https://api.animethemes.moe/artistimage/chiwa_saitou/6703 ``` diff --git a/docs/wiki/artistimage/store/index.md b/docs/wiki/artistimage/store/index.md index 18f93e8..2bd5a36 100644 --- a/docs/wiki/artistimage/store/index.md +++ b/docs/wiki/artistimage/store/index.md @@ -41,5 +41,5 @@ POST /artistimage ## Example ```bash -curl -X POST -H "Authorization: Bearer {token}" https://api.artistthemes.moe/artistimage/ +curl -X POST -H "Authorization: Bearer {token}" https://api.animethemes.moe/artistimage/ ``` diff --git a/docs/wiki/artistresource/destroy/index.md b/docs/wiki/artistresource/destroy/index.md new file mode 100644 index 0000000..200d7bf --- /dev/null +++ b/docs/wiki/artistresource/destroy/index.md @@ -0,0 +1,39 @@ +--- +title: Artist Resource Destroy +--- + +# Artist Resource Destroy Endpoint + +The artist resource destroy endpoint deletes an artist resource and returns the deleted artist resource resource. + +For example, the `/artistresource/chiwa_saitou/3361` endpoint will delete the association between the Chiwa Saitou artist and the external resource of id 3361. + +## URL + +```sh +DELETE /artistresource/{artist:slug}/{resource:id} +``` + +## Authentication + +**Required Permission**: delete artist, delete external resource + +**Roles with Permission**: Wiki Editor, Admin + +## Parameters + +None + +## Response + +```json +{ + message: "Resource 'https://myanimelist.net/people/61' has been detached from Artist 'Chiwa Saitou'.", +} +``` + +## Example + +```bash +curl -X DELETE -H "Authorization: Bearer {token}" https://api.animethemes.moe/artistresource/chiwa_saitou/3361 +``` diff --git a/docs/wiki/artistresource/index.md b/docs/wiki/artistresource/index.md new file mode 100644 index 0000000..656453d --- /dev/null +++ b/docs/wiki/artistresource/index.md @@ -0,0 +1,44 @@ +--- +title: Artist Resource +--- + +# Artist Resource + +--- + +An artist resource API resource represents the association between an artist and an external resource. + +## 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 resources that map to the same artist | + +## Allowed Include Paths + +* artist +* resource + +## Endpoints + +**[Artist Resource Destroy](/wiki/artistresource/destroy/)** + +The artist resource destroy endpoint deletes an artist resource and returns the deleted artist resource resource. + +**[Artist Resource Index](/wiki/artistresource/index/)** + +The artist resource index endpoint displays a listing of artist resource resources. + +**[Artist Resource Show](/wiki/artistresource/show/)** + +The artist resource show endpoint returns an artist resource resource. + +**[Artist Resource Store](/wiki/artistresource/store/)** + +The artist resource store endpoint creates a new artist resource and returns the new artist resource resource. + +**[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 diff --git a/docs/wiki/artistresource/index/index.md b/docs/wiki/artistresource/index/index.md new file mode 100644 index 0000000..1acb502 --- /dev/null +++ b/docs/wiki/artistresource/index/index.md @@ -0,0 +1,79 @@ +--- +title: Artist Resource Index +--- + +# Artist Resource Index Endpoint + +The artist resource index endpoint returns a listing of artist resource resources. + +## URL + +```sh +GET /artistresource/ +``` + +## Authentication + +None + +## Parameters + +| Name | Required | Description | +| :----------: | :------: | :----------------------------------------------------------------------------- | +| fields | No | Sparse fieldsets for resource types | +| filter | No | Filters for artist resources & constraining the inclusion of related resources | +| include | No | Inclusion of related resources | +| page[number] | No | The page of artist resource resources to display | +| page[size] | No | The number of artist 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 +{ + artistresources: [ + { + 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/artistresource/ +``` diff --git a/docs/wiki/artistresource/show/index.md b/docs/wiki/artistresource/show/index.md new file mode 100644 index 0000000..d88dbb4 --- /dev/null +++ b/docs/wiki/artistresource/show/index.md @@ -0,0 +1,41 @@ +--- +title: Artist Resource Show +--- + +# Artist Resource Show Endpoint + +The artist resource show endpoint returns an artist resource resource. + +For example, the `/artistresource/chiwa_saitou/3361` endpoint will return the artist resource resource for the association between the Chiwa Saitou artist and the external resource of id 3361. + +## URL + +```sh +GET /artistresource/{artist:slug}/{resource:id} +``` + +## Authentication + +None + +## Parameters + +None + +## Response + +```json +{ + artistresource: { + created_at: "created_at", + updated_at: "updated_at", + as: "as" + } +} +``` + +## Example + +```bash +curl https://api.animethemes.moe/artistresource/chiwa_saitou/3361 +``` diff --git a/docs/wiki/artistresource/store/index.md b/docs/wiki/artistresource/store/index.md new file mode 100644 index 0000000..741245e --- /dev/null +++ b/docs/wiki/artistresource/store/index.md @@ -0,0 +1,47 @@ +--- +title: Artist Resource Store +--- + +# Artist Resource Store Endpoint + +The artist resource store endpoint creates a new artist resource and returns the new artist resource resource. + +For example, the `/artistresource?artist_id=53&resource_id=3361` endpoint will create a new association between the Chiwa Saitou artist and the external resource of id 3361. + +## URL + +```sh +POST /artistresource +``` + +## Authentication + +**Required Permission**: create artist, create external resource + +**Roles with Permission**: Wiki Editor, Admin + +## Parameters + +| Name | Required | Rules | +| :---------: | :------: | :-------------------------- | +| artist_id | Yes | integer, Artist ID exists | +| resource_id | Yes | integer, Resource ID exists | +| as | No | string, max:192 | + +## Response + +```json +{ + artistresource: { + created_at: "created_at", + updated_at: "updated_at", + as: "as" + } +} +``` + +## Example + +```bash +curl -X POST -H "Authorization: Bearer {token}" https://api.animethemes.moe/artistresource/ +``` diff --git a/docs/wiki/artistresource/update/index.md b/docs/wiki/artistresource/update/index.md new file mode 100644 index 0000000..ec836f0 --- /dev/null +++ b/docs/wiki/artistresource/update/index.md @@ -0,0 +1,45 @@ +--- +title: Artist Resource Update +--- + +# Artist Resource Update Endpoint + +The artist resource store endpoint updates an artist resource and returns the updated artist resource resource. + +For example, the `/artistresource/chiwa_saitou/3361?as=updated+label` endpoint will update the association between the Chiwa Saitou artist and the external resource of id 3361. + +## URL + +```sh +PUT|PATCH /artistresource/{artist:slug}/{resource:id} +``` + +## Authentication + +**Required Permission**: update artist, update external resource + +**Roles with Permission**: Wiki Editor, Admin + +## Parameters + +| Name | Required | Rules | +| :---------: | :------: | :-------------- | +| as | No | string, max:192 | + +## Response + +```json +{ + artistresource: { + created_at: "created_at", + updated_at: "updated_at", + as: "as" + } +} +``` + +## Example + +```bash +curl -X PATCH -H "Authorization: Bearer {token}" https://api.animethemes.moe/artistresource/ +``` diff --git a/docs/wiki/index.md b/docs/wiki/index.md index c063446..d2cee69 100644 --- a/docs/wiki/index.md +++ b/docs/wiki/index.md @@ -50,6 +50,10 @@ An artist API resource represents a musical performer of anime sequences. An artist image API resource represents the association between an artist and an image. +**[Artist Resource](/wiki/artistresource/)** + +An artist resource API resource represents the association between an artist and an external resource. + **[Audio](/wiki/audio/)** An audio API resource represents the audio track of a video.