From c1f2235d24106610c5426321546ff7c648538d3b Mon Sep 17 00:00:00 2001 From: Kyrch Date: Fri, 18 Apr 2025 12:34:23 -0300 Subject: [PATCH] feat: added new artist related fields (#106) --- docs/.vitepress/config.js | 3 +- docs/wiki/artist/destroy/index.md | 1 + docs/wiki/artist/index.md | 17 +++++----- docs/wiki/artist/index/index.md | 41 ++++++++++++----------- docs/wiki/artist/restore/index.md | 1 + docs/wiki/artist/show/index.md | 1 + docs/wiki/artist/store/index.md | 10 +++--- docs/wiki/artist/update/index.md | 10 +++--- docs/wiki/artistimage/index.md | 7 +++- docs/wiki/artistimage/index/index.md | 5 ++- docs/wiki/artistimage/show/index.md | 3 +- docs/wiki/artistimage/store/index.md | 7 ++-- docs/wiki/artistimage/update/index.md | 45 ++++++++++++++++++++++++++ docs/wiki/artistmember/index.md | 1 + docs/wiki/artistmember/index/index.md | 5 ++- docs/wiki/artistmember/show/index.md | 3 +- docs/wiki/artistmember/store/index.md | 12 ++++--- docs/wiki/artistmember/update/index.md | 4 ++- docs/wiki/artistsong/index.md | 4 +-- 19 files changed, 129 insertions(+), 51 deletions(-) create mode 100644 docs/wiki/artistimage/update/index.md diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index 58a1905..a7d57eb 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -417,7 +417,8 @@ export default { { text: 'Destroy', link: '/wiki/artistimage/destroy/' }, { text: 'Index', link: '/wiki/artistimage/index/' }, { text: 'Show', link: '/wiki/artistimage/show/' }, - { text: 'Store', link: '/wiki/artistimage/store/' } + { text: 'Store', link: '/wiki/artistimage/store/' }, + { text: 'Update', link: '/wiki/artistimage/update/' } ] }, { diff --git a/docs/wiki/artist/destroy/index.md b/docs/wiki/artist/destroy/index.md index ade3d91..6dcc70c 100644 --- a/docs/wiki/artist/destroy/index.md +++ b/docs/wiki/artist/destroy/index.md @@ -34,6 +34,7 @@ None id: id, name: "name", slug: "slug", + information: "information", created_at: "created_at", updated_at: "updated_at", deleted_at: "deleted_at" diff --git a/docs/wiki/artist/index.md b/docs/wiki/artist/index.md index b3e856a..a46eaad 100644 --- a/docs/wiki/artist/index.md +++ b/docs/wiki/artist/index.md @@ -12,14 +12,15 @@ For example, Chiwa Saitou is the musical performer of the Bakemonogatari OP1 the ## Fields -| Name | Type | Nullable | Default | Description | -| :--------: | :-----: | :------: | :-----: | :------------------------------------------------------------- | -| id | Integer | No | Yes | The primary key of the resource | -| name | String | No | Yes | The primary title of the artist | -| slug | String | No | Yes | The URL slug & route key of the resource | -| 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 | -| deleted_at | Date | Yes | No | The date that the resource was deleted | +| Name | Type | Nullable | Default | Description | +| :---------: | :-----: | :------: | :-----: | :------------------------------------------------------------- | +| id | Integer | No | Yes | The primary key of the resource | +| name | String | No | Yes | The primary title of the artist | +| slug | String | No | Yes | The URL slug & route key of the resource | +| information | String | Yes | Yes | The brief information of the resource | +| 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 | +| deleted_at | Date | Yes | No | The date that the resource was deleted | ## Allowed Include Paths diff --git a/docs/wiki/artist/index/index.md b/docs/wiki/artist/index/index.md index a2b56a2..c67a5dd 100644 --- a/docs/wiki/artist/index/index.md +++ b/docs/wiki/artist/index/index.md @@ -30,28 +30,30 @@ None ## Allowed Sort Fields -| Name | Description | -| :--------: | :------------------------------------------------------------------ | -| id | Sort resources on the primary key | -| name | Sort resources on the title of the artist | -| slug | Sort resources on the URL slug of the artist | -| created_at | Sort resources on the resource creation date | -| updated_at | Sort resources on the resource last modified date | -| deleted_at | Sort resources on the resource deletion date | -| random | Sort resources randomly. Ignored if other sort fields are provided. | +| Name | Description | +| :---------: | :------------------------------------------------------------------ | +| id | Sort resources on the primary key | +| name | Sort resources on the title of the artist | +| slug | Sort resources on the URL slug of the artist | +| information | Sort resources on the information of the artist | +| created_at | Sort resources on the resource creation date | +| updated_at | Sort resources on the resource last modified date | +| deleted_at | Sort resources on the resource deletion date | +| random | Sort resources randomly. Ignored if other sort fields are provided. | ## Filters -| Name | Description | -| :--------: | :----------------------------------------------------------------- | -| id | Filter resources on the primary key | -| name | Filter resources on the title of the artist | -| slug | Filter resources on the URL slug of the artist | -| created_at | Filter resources on the resource creation date | -| updated_at | Filter resources on the resource last modified date | -| deleted_at | Filter resources on the resource deletion date | -| trashed | Filter resources on trashed (deleted) status [With, Without, Only] | -| has | Filter resources on relations within allowed include paths | +| Name | Description | +| :---------: | :----------------------------------------------------------------- | +| id | Filter resources on the primary key | +| name | Filter resources on the title of the artist | +| slug | Filter resources on the URL slug of the artist | +| information | Filter resources on the information of the artist | +| created_at | Filter resources on the resource creation date | +| updated_at | Filter resources on the resource last modified date | +| deleted_at | Filter resources on the resource deletion date | +| trashed | Filter resources on trashed (deleted) status [With, Without, Only] | +| has | Filter resources on relations within allowed include paths | ## Response @@ -62,6 +64,7 @@ None id: id, name: "name", slug: "slug", + information: "information", created_at: "created_at", updated_at: "updated_at", deleted_at: "deleted_at" diff --git a/docs/wiki/artist/restore/index.md b/docs/wiki/artist/restore/index.md index 52f17cd..b388d35 100644 --- a/docs/wiki/artist/restore/index.md +++ b/docs/wiki/artist/restore/index.md @@ -34,6 +34,7 @@ None id: id, name: "name", slug: "slug", + information: "information", created_at: "created_at", updated_at: "updated_at", deleted_at: "deleted_at" diff --git a/docs/wiki/artist/show/index.md b/docs/wiki/artist/show/index.md index 3ba781c..09533b7 100644 --- a/docs/wiki/artist/show/index.md +++ b/docs/wiki/artist/show/index.md @@ -35,6 +35,7 @@ None id: id, name: "name", slug: "slug", + information: "information", created_at: "created_at", updated_at: "updated_at", deleted_at: "deleted_at" diff --git a/docs/wiki/artist/store/index.md b/docs/wiki/artist/store/index.md index 9d9d93b..7c7cb7b 100644 --- a/docs/wiki/artist/store/index.md +++ b/docs/wiki/artist/store/index.md @@ -22,10 +22,11 @@ POST /artist ## Parameters -| Name | Required | Rules | -| :------: | :------: | :---------------------------------- | -| name | Yes | string, max:192 | -| slug | Yes | string, max:192, alpha_dash, unique | +| Name | Required | Rules | +| :---------: | :------: | :---------------------------------- | +| name | Yes | string, max:192 | +| slug | Yes | string, max:192, alpha_dash, unique | +| information | No | string, max:65535 | ## Response @@ -35,6 +36,7 @@ POST /artist id: id, name: "name", slug: "slug", + information: "information", created_at: "created_at", updated_at: "updated_at", deleted_at: "deleted_at" diff --git a/docs/wiki/artist/update/index.md b/docs/wiki/artist/update/index.md index 0fd7251..9ec0d6e 100644 --- a/docs/wiki/artist/update/index.md +++ b/docs/wiki/artist/update/index.md @@ -24,10 +24,11 @@ PUT|PATCH /artist/{slug} ## Parameters -| Name | Required | Rules | -| :------: | :------: | :---------------------------------- | -| name | No | string, max:192 | -| slug | No | string, max:192, alpha_dash, unique | +| Name | Required | Rules | +| :---------: | :------: | :---------------------------------- | +| name | No | string, max:192 | +| slug | No | string, max:192, alpha_dash, unique | +| information | No | string, max:65535 | ## Response @@ -37,6 +38,7 @@ PUT|PATCH /artist/{slug} id: id, name: "name", slug: "slug", + information: "information", created_at: "created_at", updated_at: "updated_at", deleted_at: "deleted_at" diff --git a/docs/wiki/artistimage/index.md b/docs/wiki/artistimage/index.md index e41859c..fc982db 100644 --- a/docs/wiki/artistimage/index.md +++ b/docs/wiki/artistimage/index.md @@ -14,6 +14,7 @@ An artist image API resource represents the association between an artist and an | :--------: | :-----: | :------: | :-----: | :------------------------------------------- | | 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 | +| depth | Int | Yes | No | Used to sort the artist images | ## Allowed Include Paths @@ -36,4 +37,8 @@ The artist image show endpoint returns an artist image resource. **[Artist Image Store](/wiki/artistimage/store/)** -The artist image store endpoint creates a new artist image and returns the new artist image resource. \ No newline at end of file +The artist image store endpoint creates a new artist image and returns the new artist image resource. + +**[Artist Image Update](/wiki/artistimage/update/)** + +The artist image update endpoint updates an artist image and returns the updated artist image resource. \ No newline at end of file diff --git a/docs/wiki/artistimage/index/index.md b/docs/wiki/artistimage/index/index.md index b933afa..c2c46f7 100644 --- a/docs/wiki/artistimage/index/index.md +++ b/docs/wiki/artistimage/index/index.md @@ -33,6 +33,7 @@ None | :--------: | :------------------------------------------------ | | created_at | Sort resources on the resource creation date | | updated_at | Sort resources on the resource last modified date | +| depth | Sort resources by orderable images | ## Filters @@ -41,6 +42,7 @@ None | 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 | +| depth | Filter resources on depth level | ## Response @@ -49,7 +51,8 @@ None artistimages: [ { created_at: "created_at", - updated_at: "updated_at" + updated_at: "updated_at", + depth: depth }, ... ], diff --git a/docs/wiki/artistimage/show/index.md b/docs/wiki/artistimage/show/index.md index 8b467d2..b192bf2 100644 --- a/docs/wiki/artistimage/show/index.md +++ b/docs/wiki/artistimage/show/index.md @@ -28,7 +28,8 @@ None { artistimage: { created_at: "created_at", - updated_at: "updated_at" + updated_at: "updated_at", + depth: depth } } ``` diff --git a/docs/wiki/artistimage/store/index.md b/docs/wiki/artistimage/store/index.md index 61bf7b7..7b214bd 100644 --- a/docs/wiki/artistimage/store/index.md +++ b/docs/wiki/artistimage/store/index.md @@ -22,7 +22,9 @@ POST /artistimage/{artist:slug}/{image:id} ## Parameters -None +| Name | Required | Rules | +| :---: | :------: | :-------------- | +| depth | No | integer, min:1 | ## Response @@ -30,7 +32,8 @@ None { artistimage: { created_at: "created_at", - updated_at: "updated_at" + updated_at: "updated_at", + depth: depth } } ``` diff --git a/docs/wiki/artistimage/update/index.md b/docs/wiki/artistimage/update/index.md new file mode 100644 index 0000000..9c87128 --- /dev/null +++ b/docs/wiki/artistimage/update/index.md @@ -0,0 +1,45 @@ +--- +title: Artist Image Update +--- + +# Artist Image Update Endpoint + +The artist image update endpoint updates an artist image and returns the updated artist image resource. + +For example, the `/artistimage/claris/5?depth=2` endpoint will update the association between the claris and the image of id 5. + +## URL + +```sh +PUT|PATCH /artistimage/{artist:slug}/{image:id} +``` + +## Authentication + +**Required Permission**: update artist, update image + +**Roles with Permission**: Wiki Editor, Encoder, Admin + +## Parameters + +| Name | Required | Rules | +| :---------: | :------: | :-------------- | +| depth | No | integer, min:1 | + +## Response + +```json +{ + artistimage: { + created_at: "created_at", + updated_at: "updated_at", + depth: depth + } +} +``` + +## Example + +```bash +curl -X PATCH -H "Authorization: Bearer {token}" https://api.animethemes.moe/artistimage/ +``` diff --git a/docs/wiki/artistmember/index.md b/docs/wiki/artistmember/index.md index 8c4c368..4eb1dc6 100644 --- a/docs/wiki/artistmember/index.md +++ b/docs/wiki/artistmember/index.md @@ -16,6 +16,7 @@ An artist member API resource represents the association of an artist and a grou | updated_at | Date | No | No | The date that the resource was last modified | | alias | String | Yes | Yes | Used to distinguish membership by alias | | as | String | Yes | Yes | Used to distinguish membership by character | +| notes | String | Yes | Yes | Used to extra annotation, like member role | ## Allowed Include Paths diff --git a/docs/wiki/artistmember/index/index.md b/docs/wiki/artistmember/index/index.md index 2215572..b21bce5 100644 --- a/docs/wiki/artistmember/index/index.md +++ b/docs/wiki/artistmember/index/index.md @@ -35,6 +35,7 @@ None | updated_at | Sort resources on the resource last modified date | | alias | Sort resources on distinguishing label for alias | | as | Sort resources on distinguishing label for character | +| notes | Sort resources on distinguishing label for notes | ## Filters @@ -45,6 +46,7 @@ None | has | Filter resources on relations within allowed include paths | | alias | Filter resources on distinguishing label for alias | | as | Filter resources on distinguishing label for character | +| notes | Filter resources on distinguishing label for notes | ## Response @@ -55,7 +57,8 @@ None created_at: "created_at", updated_at: "updated_at", alias: "alias", - as: "as" + as: "as", + notes: "notes" }, ... ], diff --git a/docs/wiki/artistmember/show/index.md b/docs/wiki/artistmember/show/index.md index 5664e54..69d55e9 100644 --- a/docs/wiki/artistmember/show/index.md +++ b/docs/wiki/artistmember/show/index.md @@ -30,7 +30,8 @@ None created_at: "created_at", updated_at: "updated_at", alias: "alias", - as: "as" + as: "as", + notes: "notes" } } ``` diff --git a/docs/wiki/artistmember/store/index.md b/docs/wiki/artistmember/store/index.md index dd9b1b7..67a20fe 100644 --- a/docs/wiki/artistmember/store/index.md +++ b/docs/wiki/artistmember/store/index.md @@ -22,10 +22,11 @@ POST /artistmember/{artist:slug}/{artist:slug} ## Parameters -| Name | Required | Rules | -| :---: | :------: | :-------------- | -| alias | No | string, max:192 | -| as | No | string, max:192 | +| Name | Required | Rules | +| :---: | :------: | :-------------- | +| alias | No | string, max:192 | +| as | No | string, max:192 | +| notes | No | string, max:192 | ## Response @@ -35,7 +36,8 @@ POST /artistmember/{artist:slug}/{artist:slug} created_at: "created_at", updated_at: "updated_at", alias: "alias", - as: "as" + as: "as", + notes: "notes" } } ``` diff --git a/docs/wiki/artistmember/update/index.md b/docs/wiki/artistmember/update/index.md index bb01abe..aefe077 100644 --- a/docs/wiki/artistmember/update/index.md +++ b/docs/wiki/artistmember/update/index.md @@ -26,6 +26,7 @@ PUT|PATCH /artistmember/{artist:slug}/{artist:slug} | :---------: | :------: | :-------------- | | alias | No | string, max:192 | | as | No | string, max:192 | +| notes | No | string, max:192 | ## Response @@ -35,7 +36,8 @@ PUT|PATCH /artistmember/{artist:slug}/{artist:slug} created_at: "created_at", updated_at: "updated_at", alias: "alias", - as: "as" + as: "as", + notes: "notes" } } ``` diff --git a/docs/wiki/artistsong/index.md b/docs/wiki/artistsong/index.md index 91b7434..c79b545 100644 --- a/docs/wiki/artistsong/index.md +++ b/docs/wiki/artistsong/index.md @@ -14,8 +14,8 @@ An artist song API resource represents the association between an artist and an | :--------: | :-----: | :------: | :-----: | :------------------------------------------------------------- | | 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 | -| alias | String | Yes | Yes | Used to distinguish a performance by alias | -| as | String | Yes | Yes | Used to distinguish a performance by character | +| alias | String | Yes | Yes | Used to distinguish a performance by alias | +| as | String | Yes | Yes | Used to distinguish a performance by character | ## Allowed Include Paths