Compare commits

...

3 Commits

Author SHA1 Message Date
068e568ec6 added AniList GET REST items 2025-02-17 20:50:10 -05:00
4e6f910e74 format change 2025-02-17 20:03:53 -05:00
b39f19f03a added REST private env to gitignore 2025-02-17 20:03:16 -05:00
10 changed files with 398 additions and 8 deletions

5
.gitignore vendored
View File

@ -29,4 +29,7 @@ package.json.md5
package-lock.json package-lock.json
.idea .idea
.env .env
environment.go environment.go
# REST (http files)
http-client.private.env.json

View File

@ -202,7 +202,7 @@ func (a *App) AniListSearch(query string) any {
perPage perPage
} }
media (search: $search, type: $listType) { media (search: $search, type: $listType) {
id id
idMal idMal
title { title {
romaji romaji
@ -415,8 +415,8 @@ func (a *App) AniListUpdateEntry(updateBody AniListUpdateVariables) AniListGetSi
}{ }{
Query: ` Query: `
mutation( mutation(
$mediaId:Int, $mediaId:Int,
$progress:Int, $progress:Int,
$status:MediaListStatus, $status:MediaListStatus,
$score:Float, $score:Float,
$repeat:Int, $repeat:Int,
@ -425,15 +425,15 @@ func (a *App) AniListUpdateEntry(updateBody AniListUpdateVariables) AniListGetSi
$completedAt:FuzzyDateInput, $completedAt:FuzzyDateInput,
){ ){
SaveMediaListEntry( SaveMediaListEntry(
mediaId:$mediaId, mediaId:$mediaId,
progress:$progress, progress:$progress,
status:$status, status:$status,
score:$score, score:$score,
repeat:$repeat, repeat:$repeat,
notes:$notes, notes:$notes,
startedAt:$startedAt startedAt:$startedAt
completedAt:$completedAt completedAt:$completedAt
){ ){
id id
mediaId mediaId
userId userId
@ -528,7 +528,7 @@ func (a *App) AniListDeleteEntry(mediaListId int) DeleteAniListReturn {
){ ){
DeleteMediaListEntry( DeleteMediaListEntry(
id:$id, id:$id,
){ ){
deleted deleted
} }
} }

View File

@ -0,0 +1,79 @@
# @name AniChart
POST https://graphql.anilist.co
Accept: applicaton/json
X-REQUEST-TYPE: Graphql
query ($page: Int, $perPage: Int, $airingAt_greater:Int) {
Page(page: $page, perPage: $perPage) {
pageInfo {
total
perPage
currentPage
lastPage
hasNextPage
}
airingSchedules(airingAt_greater:$airingAt_greater){
id
airingAt
timeUntilAiring
episode
mediaId
media{
id
title{
english
romaji
native
}
type
format
status
startDate{
year
month
day
}
endDate{
year
month
day
}
season
seasonYear
episodes
duration
coverImage{
medium
large
color
extraLarge
}
bannerImage
genres
averageScore
meanScore
popularity
trending
favourites
tags{
id
name
description
category
rank
isGeneralSpoiler
isMediaSpoiler
isAdult
}
isAdult
}
}
}
}
{
"page": 50,
"perPage": 20,
"airingAt_greater": 1730260800
}

View File

@ -0,0 +1,83 @@
# @name AniList Item
POST https://graphql.anilist.co
Accept: applicaton/json
X-REQUEST-TYPE: Graphql
Authorization: Bearer {{ANILIST_ACCESS_TOKEN}}
query ($userId: Int, $mediaId: Int, $listType: MediaType) {
MediaList(mediaId: $mediaId, userId: $userId, type: $listType) {
id
mediaId
userId
media {
id
idMal
tags {
id
name
description
rank
isMediaSpoiler
isAdult
}
title {
romaji
english
native
}
description
coverImage {
large
}
season
seasonYear
status
episodes
nextAiringEpisode {
airingAt
timeUntilAiring
episode
}
isAdult
}
status
startedAt {
year
month
day
}
completedAt {
year
month
day
}
notes
progress
score
repeat
user {
id
name
avatar {
large
medium
}
statistics {
anime {
count
statuses {
status
count
}
}
}
}
}
}
{
"userId": 413504,
"mediaId": 170998,
"listType": "ANIME"
}

View File

@ -0,0 +1,70 @@
# @name AniList MediaList User Query
POST https://graphql.anilist.co
Accept: applicaton/json
X-REQUEST-TYPE: Graphql
query(
$page: Int
$perPage: Int
$userId: Int
$listType: MediaType
$status: MediaListStatus
) {
Page(page: $page, perPage: $perPage) {
pageInfo {
total
perPage
currentPage
lastPage
hasNextPage
}
mediaList(userId: $userId, type: $listType, status: $status) {
id
mediaId
userId
media {
id
idMal
title {
romaji
english
native
}
description
coverImage {
large
}
season
seasonYear
episodes
}
status
notes
progress
score
repeat
user {
id
statistics {
anime {
count
statuses {
status
count
}
}
}
}
}
}
}
{
"page": 1,
"perPage": 20,
"userId": 413504,
"listType": "ANIME",
"status": "CURRENT"
}

View File

@ -0,0 +1,44 @@
# @name AniList Search
POST https://graphql.anilist.co
Accept: applicaton/json
X-REQUEST-TYPE: Graphql
query ($search: String!, $listType: MediaType) {
Page (page: 1, perPage: 100) {
pageInfo {
total
currentPage
lastPage
hasNextPage
perPage
}
media (search: $search, type: $listType) {
id
idMal
title {
romaji
english
native
}
description
coverImage {
large
}
season
seasonYear
status
episodes
nextAiringEpisode{
airingAt
timeUntilAiring
episode
}
}
}
}
{
"search": "dan-da-dan",
"listType": "ANIME"
}

View File

@ -0,0 +1,93 @@
# @name GetAniListUserWatchList
POST https://graphql.anilist.co
Accept: applicaton/json
X-REQUEST-TYPE: Graphql
query (
$page: Int
$perPage: Int
$userId: Int
$listType: MediaType
$status: MediaListStatus
$sort: [MediaListSort]
) {
Page(page: $page, perPage: $perPage) {
pageInfo {
total
perPage
currentPage
lastPage
hasNextPage
}
mediaList(userId: $userId, type: $listType, status: $status, sort: $sort) {
id
mediaId
userId
media {
id
idMal
title {
romaji
english
native
}
description
coverImage {
large
}
season
seasonYear
status
episodes
nextAiringEpisode {
airingAt
timeUntilAiring
episode
}
}
status
startedAt {
year
month
day
}
completedAt {
year
month
day
}
notes
progress
score
repeat
user {
id
name
avatar {
large
medium
}
statistics {
anime {
count
statuses {
status
count
}
}
}
}
}
}
}
{
"page": 1,
"perPage": 20,
"userId": 413504,
"listType": "ANIME",
"status": "CURRENT",
"sort": "UPDATED_TIME_DESC"
}

View File

18
rest/http-client.env.json Normal file
View File

@ -0,0 +1,18 @@
{
"$schema": "https://raw.githubusercontent.com/mistweaverco/kulala.nvim/main/schemas/http-client.env.schema.json",
"dev": {
"ANILIST_APP_ID": "",
"ANILIST_SECRET": "",
"SIMKL_CLIENT_ID": "",
"SIMKL_CLIENT_SECRET": "",
"MAL_CLIENT_ID": "",
"MAL_CLIENT_SECRET": "",
"ANILIST_ACCESS_TOKEN": "",
"ANILSIT_CODE": "",
"SIMKL_AUTH_TOKEN": "",
"MAL_CODE": "",
"MAL_VERIFIER": "",
"MAL_USER": "",
"MAL_ACCESS_TOKEN": ""
}
}