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: '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/' }
]
},
{
+1
View File
@@ -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"
+9 -8
View File
@@ -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
+22 -19
View File
@@ -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"
+1
View File
@@ -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"
+1
View File
@@ -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"
+6 -4
View File
@@ -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"
+6 -4
View File
@@ -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"
+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 |
| 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.
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 |
| 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
},
...
],
+2 -1
View File
@@ -28,7 +28,8 @@ None
{
artistimage: {
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
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
}
}
```
+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 |
| 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
+4 -1
View File
@@ -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"
},
...
],
+2 -1
View File
@@ -30,7 +30,8 @@ None
created_at: "created_at",
updated_at: "updated_at",
alias: "alias",
as: "as"
as: "as",
notes: "notes"
}
}
```
+7 -5
View File
@@ -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"
}
}
```
+3 -1
View File
@@ -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"
}
}
```
+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 |
| 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