feat: added new artist related fields (#106)

This commit is contained in:
Kyrch
2025-04-18 12:34:23 -03:00
committed by GitHub
parent b2c9f0ce46
commit c1f2235d24
19 changed files with 129 additions and 51 deletions
+2 -1
View File
@@ -417,7 +417,8 @@ export default {
{ text: 'Destroy', link: '/wiki/artistimage/destroy/' }, { text: 'Destroy', link: '/wiki/artistimage/destroy/' },
{ text: 'Index', link: '/wiki/artistimage/index/' }, { text: 'Index', link: '/wiki/artistimage/index/' },
{ text: 'Show', link: '/wiki/artistimage/show/' }, { text: 'Show', link: '/wiki/artistimage/show/' },
{ text: 'Store', link: '/wiki/artistimage/store/' } { text: 'Store', link: '/wiki/artistimage/store/' },
{ text: 'Update', link: '/wiki/artistimage/update/' }
] ]
}, },
{ {
+1
View File
@@ -34,6 +34,7 @@ None
id: id, id: id,
name: "name", name: "name",
slug: "slug", slug: "slug",
information: "information",
created_at: "created_at", created_at: "created_at",
updated_at: "updated_at", updated_at: "updated_at",
deleted_at: "deleted_at" deleted_at: "deleted_at"
+9 -8
View File
@@ -12,14 +12,15 @@ For example, Chiwa Saitou is the musical performer of the Bakemonogatari OP1 the
## Fields ## Fields
| Name | Type | Nullable | Default | Description | | Name | Type | Nullable | Default | Description |
| :--------: | :-----: | :------: | :-----: | :------------------------------------------------------------- | | :---------: | :-----: | :------: | :-----: | :------------------------------------------------------------- |
| id | Integer | No | Yes | The primary key of the resource | | id | Integer | No | Yes | The primary key of the resource |
| name | String | No | Yes | The primary title of the artist | | name | String | No | Yes | The primary title of the artist |
| slug | String | No | Yes | The URL slug & route key of the resource | | slug | String | No | Yes | The URL slug & route key of the resource |
| created_at | Date | No | No | The date that the resource was created | | information | String | Yes | Yes | The brief information of the resource |
| updated_at | Date | No | No | The date that the resource was last modified | | created_at | Date | No | No | The date that the resource was created |
| deleted_at | Date | Yes | No | The date that the resource was deleted | | 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 ## Allowed Include Paths
+22 -19
View File
@@ -30,28 +30,30 @@ None
## Allowed Sort Fields ## Allowed Sort Fields
| Name | Description | | Name | Description |
| :--------: | :------------------------------------------------------------------ | | :---------: | :------------------------------------------------------------------ |
| id | Sort resources on the primary key | | id | Sort resources on the primary key |
| name | Sort resources on the title of the artist | | name | Sort resources on the title of the artist |
| slug | Sort resources on the URL slug of the artist | | slug | Sort resources on the URL slug of the artist |
| created_at | Sort resources on the resource creation date | | information | Sort resources on the information of the artist |
| updated_at | Sort resources on the resource last modified date | | created_at | Sort resources on the resource creation date |
| deleted_at | Sort resources on the resource deletion date | | updated_at | Sort resources on the resource last modified date |
| random | Sort resources randomly. Ignored if other sort fields are provided. | | deleted_at | Sort resources on the resource deletion date |
| random | Sort resources randomly. Ignored if other sort fields are provided. |
## Filters ## Filters
| Name | Description | | Name | Description |
| :--------: | :----------------------------------------------------------------- | | :---------: | :----------------------------------------------------------------- |
| id | Filter resources on the primary key | | id | Filter resources on the primary key |
| name | Filter resources on the title of the artist | | name | Filter resources on the title of the artist |
| slug | Filter resources on the URL slug of the artist | | slug | Filter resources on the URL slug of the artist |
| created_at | Filter resources on the resource creation date | | information | Filter resources on the information of the artist |
| updated_at | Filter resources on the resource last modified date | | created_at | Filter resources on the resource creation date |
| deleted_at | Filter resources on the resource deletion date | | updated_at | Filter resources on the resource last modified date |
| trashed | Filter resources on trashed (deleted) status [With, Without, Only] | | deleted_at | Filter resources on the resource deletion date |
| has | Filter resources on relations within allowed include paths | | trashed | Filter resources on trashed (deleted) status [With, Without, Only] |
| has | Filter resources on relations within allowed include paths |
## Response ## Response
@@ -62,6 +64,7 @@ None
id: id, id: id,
name: "name", name: "name",
slug: "slug", slug: "slug",
information: "information",
created_at: "created_at", created_at: "created_at",
updated_at: "updated_at", updated_at: "updated_at",
deleted_at: "deleted_at" deleted_at: "deleted_at"
+1
View File
@@ -34,6 +34,7 @@ None
id: id, id: id,
name: "name", name: "name",
slug: "slug", slug: "slug",
information: "information",
created_at: "created_at", created_at: "created_at",
updated_at: "updated_at", updated_at: "updated_at",
deleted_at: "deleted_at" deleted_at: "deleted_at"
+1
View File
@@ -35,6 +35,7 @@ None
id: id, id: id,
name: "name", name: "name",
slug: "slug", slug: "slug",
information: "information",
created_at: "created_at", created_at: "created_at",
updated_at: "updated_at", updated_at: "updated_at",
deleted_at: "deleted_at" deleted_at: "deleted_at"
+6 -4
View File
@@ -22,10 +22,11 @@ POST /artist
## Parameters ## Parameters
| Name | Required | Rules | | Name | Required | Rules |
| :------: | :------: | :---------------------------------- | | :---------: | :------: | :---------------------------------- |
| name | Yes | string, max:192 | | name | Yes | string, max:192 |
| slug | Yes | string, max:192, alpha_dash, unique | | slug | Yes | string, max:192, alpha_dash, unique |
| information | No | string, max:65535 |
## Response ## Response
@@ -35,6 +36,7 @@ POST /artist
id: id, id: id,
name: "name", name: "name",
slug: "slug", slug: "slug",
information: "information",
created_at: "created_at", created_at: "created_at",
updated_at: "updated_at", updated_at: "updated_at",
deleted_at: "deleted_at" deleted_at: "deleted_at"
+6 -4
View File
@@ -24,10 +24,11 @@ PUT|PATCH /artist/{slug}
## Parameters ## Parameters
| Name | Required | Rules | | Name | Required | Rules |
| :------: | :------: | :---------------------------------- | | :---------: | :------: | :---------------------------------- |
| name | No | string, max:192 | | name | No | string, max:192 |
| slug | No | string, max:192, alpha_dash, unique | | slug | No | string, max:192, alpha_dash, unique |
| information | No | string, max:65535 |
## Response ## Response
@@ -37,6 +38,7 @@ PUT|PATCH /artist/{slug}
id: id, id: id,
name: "name", name: "name",
slug: "slug", slug: "slug",
information: "information",
created_at: "created_at", created_at: "created_at",
updated_at: "updated_at", updated_at: "updated_at",
deleted_at: "deleted_at" deleted_at: "deleted_at"
+6 -1
View File
@@ -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 | | 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 | | 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 ## Allowed Include Paths
@@ -36,4 +37,8 @@ The artist image show endpoint returns an artist image resource.
**[Artist Image Store](/wiki/artistimage/store/)** **[Artist Image Store](/wiki/artistimage/store/)**
The artist image store endpoint creates a new artist image and returns the new artist image resource. 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.
+4 -1
View File
@@ -33,6 +33,7 @@ None
| :--------: | :------------------------------------------------ | | :--------: | :------------------------------------------------ |
| created_at | Sort resources on the resource creation date | | created_at | Sort resources on the resource creation date |
| updated_at | Sort resources on the resource last modified date | | updated_at | Sort resources on the resource last modified date |
| depth | Sort resources by orderable images |
## Filters ## Filters
@@ -41,6 +42,7 @@ None
| created_at | Filter resources on the resource creation date | | created_at | Filter resources on the resource creation date |
| updated_at | Filter resources on the resource last modified date | | updated_at | Filter resources on the resource last modified date |
| has | Filter resources on relations within allowed include paths | | has | Filter resources on relations within allowed include paths |
| depth | Filter resources on depth level |
## Response ## Response
@@ -49,7 +51,8 @@ None
artistimages: [ artistimages: [
{ {
created_at: "created_at", created_at: "created_at",
updated_at: "updated_at" updated_at: "updated_at",
depth: depth
}, },
... ...
], ],
+2 -1
View File
@@ -28,7 +28,8 @@ None
{ {
artistimage: { artistimage: {
created_at: "created_at", created_at: "created_at",
updated_at: "updated_at" updated_at: "updated_at",
depth: depth
} }
} }
``` ```
+5 -2
View File
@@ -22,7 +22,9 @@ POST /artistimage/{artist:slug}/{image:id}
## Parameters ## Parameters
None | Name | Required | Rules |
| :---: | :------: | :-------------- |
| depth | No | integer, min:1 |
## Response ## Response
@@ -30,7 +32,8 @@ None
{ {
artistimage: { artistimage: {
created_at: "created_at", created_at: "created_at",
updated_at: "updated_at" updated_at: "updated_at",
depth: depth
} }
} }
``` ```
+45
View File
@@ -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/
```
+1
View File
@@ -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 | | updated_at | Date | No | No | The date that the resource was last modified |
| alias | String | Yes | Yes | Used to distinguish membership by alias | | alias | String | Yes | Yes | Used to distinguish membership by alias |
| as | String | Yes | Yes | Used to distinguish membership by character | | as | String | Yes | Yes | Used to distinguish membership by character |
| notes | String | Yes | Yes | Used to extra annotation, like member role |
## Allowed Include Paths ## Allowed Include Paths
+4 -1
View File
@@ -35,6 +35,7 @@ None
| updated_at | Sort resources on the resource last modified date | | updated_at | Sort resources on the resource last modified date |
| alias | Sort resources on distinguishing label for alias | | alias | Sort resources on distinguishing label for alias |
| as | Sort resources on distinguishing label for character | | as | Sort resources on distinguishing label for character |
| notes | Sort resources on distinguishing label for notes |
## Filters ## Filters
@@ -45,6 +46,7 @@ None
| has | Filter resources on relations within allowed include paths | | has | Filter resources on relations within allowed include paths |
| alias | Filter resources on distinguishing label for alias | | alias | Filter resources on distinguishing label for alias |
| as | Filter resources on distinguishing label for character | | as | Filter resources on distinguishing label for character |
| notes | Filter resources on distinguishing label for notes |
## Response ## Response
@@ -55,7 +57,8 @@ None
created_at: "created_at", created_at: "created_at",
updated_at: "updated_at", updated_at: "updated_at",
alias: "alias", alias: "alias",
as: "as" as: "as",
notes: "notes"
}, },
... ...
], ],
+2 -1
View File
@@ -30,7 +30,8 @@ None
created_at: "created_at", created_at: "created_at",
updated_at: "updated_at", updated_at: "updated_at",
alias: "alias", alias: "alias",
as: "as" as: "as",
notes: "notes"
} }
} }
``` ```
+7 -5
View File
@@ -22,10 +22,11 @@ POST /artistmember/{artist:slug}/{artist:slug}
## Parameters ## Parameters
| Name | Required | Rules | | Name | Required | Rules |
| :---: | :------: | :-------------- | | :---: | :------: | :-------------- |
| alias | No | string, max:192 | | alias | No | string, max:192 |
| as | No | string, max:192 | | as | No | string, max:192 |
| notes | No | string, max:192 |
## Response ## Response
@@ -35,7 +36,8 @@ POST /artistmember/{artist:slug}/{artist:slug}
created_at: "created_at", created_at: "created_at",
updated_at: "updated_at", updated_at: "updated_at",
alias: "alias", alias: "alias",
as: "as" as: "as",
notes: "notes"
} }
} }
``` ```
+3 -1
View File
@@ -26,6 +26,7 @@ PUT|PATCH /artistmember/{artist:slug}/{artist:slug}
| :---------: | :------: | :-------------- | | :---------: | :------: | :-------------- |
| alias | No | string, max:192 | | alias | No | string, max:192 |
| as | No | string, max:192 | | as | No | string, max:192 |
| notes | No | string, max:192 |
## Response ## Response
@@ -35,7 +36,8 @@ PUT|PATCH /artistmember/{artist:slug}/{artist:slug}
created_at: "created_at", created_at: "created_at",
updated_at: "updated_at", updated_at: "updated_at",
alias: "alias", alias: "alias",
as: "as" as: "as",
notes: "notes"
} }
} }
``` ```
+2 -2
View File
@@ -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 | | 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 | | updated_at | Date | No | No | The date that the resource was last modified |
| alias | String | Yes | Yes | Used to distinguish a performance by alias | | alias | String | Yes | Yes | Used to distinguish a performance by alias |
| as | String | Yes | Yes | Used to distinguish a performance by character | | as | String | Yes | Yes | Used to distinguish a performance by character |
## Allowed Include Paths ## Allowed Include Paths