stash/schema/schema.graphql

472 lines
9.5 KiB
GraphQL

#######################################
# Gallery
#######################################
"""Gallery type"""
type Gallery {
id: ID!
checksum: String!
path: String!
title: String
"""The files in the gallery"""
files: [GalleryFilesType!]! # Resolver
}
type GalleryFilesType {
index: Int!
name: String
path: String
}
type FindGalleriesResultType {
count: Int!
galleries: [Gallery!]!
}
#######################################
# Performer
#######################################
type Performer {
id: ID!
checksum: String!
name: String
url: String
twitter: String
instagram: String
birthdate: String
ethnicity: String
country: String
eye_color: String
height: String
measurements: String
fake_tits: String
career_length: String
tattoos: String
piercings: String
aliases: String
favorite: Boolean!
image_path: String # Resolver
scene_count: Int # Resolver
scenes: [Scene!]!
}
input PerformerCreateInput {
name: String
url: String
birthdate: String
ethnicity: String
country: String
eye_color: String
height: String
measurements: String
fake_tits: String
career_length: String
tattoos: String
piercings: String
aliases: String
twitter: String
instagram: String
favorite: Boolean
"""This should be base64 encoded"""
image: String!
}
input PerformerUpdateInput {
id: ID!
name: String
url: String
birthdate: String
ethnicity: String
country: String
eye_color: String
height: String
measurements: String
fake_tits: String
career_length: String
tattoos: String
piercings: String
aliases: String
twitter: String
instagram: String
favorite: Boolean
"""This should be base64 encoded"""
image: String
}
type FindPerformersResultType {
count: Int!
performers: [Performer!]!
}
#######################################
# Scene Marker Tag
#######################################
type SceneMarkerTag {
tag: Tag!
scene_markers: [SceneMarker!]!
}
#######################################
# Scene Marker
#######################################
type SceneMarker {
id: ID!
scene: Scene!
title: String!
seconds: Float!
primary_tag: Tag!
tags: [Tag!]!
"""The path to stream this marker"""
stream: String! # Resolver
"""The path to the preview image for this marker"""
preview: String! # Resolver
}
input SceneMarkerCreateInput {
title: String!
seconds: Float!
scene_id: ID!
primary_tag_id: ID!
tag_ids: [ID!]
}
input SceneMarkerUpdateInput {
id: ID!
title: String!
seconds: Float!
scene_id: ID!
primary_tag_id: ID!
tag_ids: [ID!]
}
type FindSceneMarkersResultType {
count: Int!
scene_markers: [SceneMarker!]!
}
type MarkerStringsResultType {
count: Int!
id: ID!
title: String!
}
#######################################
# Scene
#######################################
type SceneFileType {
size: String
duration: Float
video_codec: String
audio_codec: String
width: Int
height: Int
framerate: Float
bitrate: Int
}
type ScenePathsType {
screenshot: String # Resolver
preview: String # Resolver
stream: String # Resolver
webp: String # Resolver
vtt: String # Resolver
chapters_vtt: String # Resolver
}
type Scene {
id: ID!
checksum: String!
title: String
details: String
url: String
date: String
rating: Int
path: String!
file: SceneFileType! # Resolver
paths: ScenePathsType! # Resolver
is_streamable: Boolean! # Resolver
scene_markers: [SceneMarker!]!
gallery: Gallery
studio: Studio
tags: [Tag!]!
performers: [Performer!]!
}
input SceneUpdateInput {
clientMutationId: String
id: ID!
title: String
details: String
url: String
date: String
rating: Int
studio_id: ID
gallery_id: ID
performer_ids: [ID!]
tag_ids: [ID!]
}
type FindScenesResultType {
count: Int!
scenes: [Scene!]!
}
#######################################
# Scraped Performer
#######################################
"""A performer from a scraping operation..."""
type ScrapedPerformer {
name: String
url: String
twitter: String
instagram: String
birthdate: String
ethnicity: String
country: String
eye_color: String
height: String
measurements: String
fake_tits: String
career_length: String
tattoos: String
piercings: String
aliases: String
}
#######################################
# Stats
#######################################
type StatsResultType {
scene_count: Int!
gallery_count: Int!
performer_count: Int!
studio_count: Int!
tag_count: Int!
}
#######################################
# Studio
#######################################
type Studio {
id: ID!
checksum: String!
name: String!
url: String
image_path: String # Resolver
scene_count: Int # Resolver
}
input StudioCreateInput {
name: String!
url: String
"""This should be base64 encoded"""
image: String!
}
input StudioUpdateInput {
id: ID!
name: String
url: String
"""This should be base64 encoded"""
image: String
}
type FindStudiosResultType {
count: Int!
studios: [Studio!]!
}
#######################################
# Tag
#######################################
type Tag {
id: ID!
name: String!
scene_count: Int # Resolver
scene_marker_count: Int # Resolver
}
input TagCreateInput {
name: String!
}
input TagUpdateInput {
id: ID!
name: String!
}
input TagDestroyInput {
id: ID!
}
#######################################
# Filters
#######################################
enum SortDirectionEnum {
ASC
DESC
}
input FindFilterType {
q: String
page: Int
per_page: Int
sort: String
direction: SortDirectionEnum
}
enum ResolutionEnum {
"240p", LOW
"480p", STANDARD
"720p", STANDARD_HD
"1080p", FULL_HD
"4k", FOUR_K
}
input PerformerFilterType {
"""Filter by favorite"""
filter_favorites: Boolean
}
input SceneMarkerFilterType {
"""Filter to only include scene markers with this tag"""
tag_id: ID
"""Filter to only include scene markers with these tags"""
tags: [ID!]
"""Filter to only include scene markers attached to a scene with these tags"""
scene_tags: [ID!]
"""Filter to only include scene markers with these performers"""
performers: [ID!]
}
input SceneFilterType {
"""Filter by rating"""
rating: Int
"""Filter by resolution"""
resolution: ResolutionEnum
"""Filter to only include scenes which have markers. `true` or `false`"""
has_markers: String
"""Filter to only include scenes missing this property"""
is_missing: String
"""Filter to only include scenes with this studio"""
studio_id: ID
"""Filter to only include scenes with these tags"""
tags: [ID!]
"""Filter to only include scenes with this performer"""
performer_id: ID
}
#############
# Root Schema
#############
"""The query root for this schema"""
type Query {
"""Find a scene by ID or Checksum"""
findScene(id: ID, checksum: String): Scene
"""A function which queries Scene objects"""
findScenes(scene_filter: SceneFilterType, scene_ids: [Int!], filter: FindFilterType): FindScenesResultType!
"""A function which queries SceneMarker objects"""
findSceneMarkers(scene_marker_filter: SceneMarkerFilterType filter: FindFilterType): FindSceneMarkersResultType!
"""Find a performer by ID"""
findPerformer(id: ID!): Performer
"""A function which queries Performer objects"""
findPerformers(performer_filter: PerformerFilterType, filter: FindFilterType): FindPerformersResultType!
"""Find a studio by ID"""
findStudio(id: ID!): Studio
"""A function which queries Studio objects"""
findStudios(filter: FindFilterType): FindStudiosResultType!
findGallery(id: ID!): Gallery
findGalleries(filter: FindFilterType): FindGalleriesResultType!
findTag(id: ID!): Tag
"""Retrieve random scene markers for the wall"""
markerWall(q: String): [SceneMarker!]!
"""Retrieve random scenes for the wall"""
sceneWall(q: String): [Scene!]!
"""Get marker strings"""
markerStrings(q: String, sort: String): [MarkerStringsResultType]!
"""Get the list of valid galleries for a given scene ID"""
validGalleriesForScene(scene_id: ID): [Gallery!]!
"""Get stats"""
stats: StatsResultType!
"""Organize scene markers by tag for a given scene ID"""
sceneMarkerTags(scene_id: ID!): [SceneMarkerTag!]!
# Scrapers
"""Scrape a performer using Freeones"""
scrapeFreeones(performer_name: String!): ScrapedPerformer
"""Scrape a list of performers from a query"""
scrapeFreeonesPerformerList(query: String!): [String!]!
# Metadata
"""Start an import. Returns the job ID"""
metadataImport: String!
"""Start an export. Returns the job ID"""
metadataExport: String!
"""Start a scan. Returns the job ID"""
metadataScan: String!
"""Start generating content. Returns the job ID"""
metadataGenerate: String!
"""Clean metadata. Returns the job ID"""
metadataClean: String!
# Get everything
allPerformers: [Performer!]!
allStudios: [Studio!]!
allTags: [Tag!]!
}
type Mutation {
sceneUpdate(input: SceneUpdateInput!): Scene
sceneMarkerCreate(input: SceneMarkerCreateInput!): SceneMarker
sceneMarkerUpdate(input: SceneMarkerUpdateInput!): SceneMarker
sceneMarkerDestroy(id: ID!): Boolean!
performerCreate(input: PerformerCreateInput!): Performer
performerUpdate(input: PerformerUpdateInput!): Performer
studioCreate(input: StudioCreateInput!): Studio
studioUpdate(input: StudioUpdateInput!): Studio
tagCreate(input: TagCreateInput!): Tag
tagUpdate(input: TagUpdateInput!): Tag
tagDestroy(input: TagDestroyInput!): Boolean!
}
type Subscription {
"""Update from the meatadata manager"""
metadataUpdate: String!
}
schema {
query: Query
mutation: Mutation
subscription: Subscription
}