162 lines
2.7 KiB
GraphQL
162 lines
2.7 KiB
GraphQL
scalar Time
|
|
|
|
enum Role {
|
|
admin
|
|
user
|
|
}
|
|
|
|
type User {
|
|
id: ID!
|
|
username: String!
|
|
albums: [Album]
|
|
# Local filepath for the user's photos
|
|
rootPath: String!
|
|
admin: Boolean
|
|
shareTokens: [ShareToken]
|
|
}
|
|
|
|
type Album {
|
|
id: ID!
|
|
title: String
|
|
photos: [Photo]
|
|
subAlbums: [Album]
|
|
parentAlbum: Album
|
|
owner: User!
|
|
path: String
|
|
|
|
shares: [ShareToken]
|
|
}
|
|
|
|
type PhotoURL {
|
|
# URL for previewing the image
|
|
url: String
|
|
# Width of the image in pixels
|
|
width: Int
|
|
# Height of the image in pixels
|
|
height: Int
|
|
}
|
|
|
|
type PhotoDownload {
|
|
title: String
|
|
url: String
|
|
}
|
|
|
|
type PhotoEXIF {
|
|
photo: Photo
|
|
camera: String
|
|
maker: String
|
|
lens: String
|
|
dateShot: Time
|
|
fileSize: String
|
|
exposure: String
|
|
aperture: Float
|
|
iso: Int
|
|
focalLength: String
|
|
flash: String
|
|
}
|
|
|
|
type Photo {
|
|
id: ID!
|
|
title: String
|
|
# Local filepath for the photo
|
|
path: String
|
|
# URL to display the photo in full resolution
|
|
original: PhotoURL
|
|
# URL to display the photo in a smaller resolution
|
|
thumbnail: PhotoURL
|
|
# The album that holds the photo
|
|
album: Album!
|
|
exif: PhotoEXIF
|
|
|
|
shares: [ShareToken]
|
|
downloads: [PhotoDownload]
|
|
}
|
|
|
|
type ShareToken {
|
|
token: ID!
|
|
owner: User
|
|
# Optional expire date
|
|
expire: Time
|
|
# Optional password
|
|
# password: String
|
|
|
|
album: Album
|
|
photo: Photo
|
|
}
|
|
|
|
type SiteInfo {
|
|
initialSetup: Boolean!
|
|
}
|
|
|
|
type AuthorizeResult {
|
|
success: Boolean!
|
|
status: String
|
|
token: String
|
|
}
|
|
|
|
type ScannerResult {
|
|
finished: Boolean!
|
|
success: Boolean!
|
|
progress: Float
|
|
message: String
|
|
}
|
|
|
|
type Result {
|
|
success: Boolean!
|
|
errorMessage: String
|
|
}
|
|
|
|
type Subscription {
|
|
scannerStatusUpdate: ScannerResult
|
|
}
|
|
|
|
type Mutation {
|
|
authorizeUser(username: String!, password: String!): AuthorizeResult!
|
|
|
|
registerUser(
|
|
username: String!
|
|
password: String!
|
|
rootPath: String!
|
|
): AuthorizeResult!
|
|
|
|
shareAlbum(albumId: ID!, expire: Time, password: String): ShareToken
|
|
sharePhoto(photoId: ID!, expire: Time, password: String): ShareToken
|
|
|
|
deleteShareToken(token: ID!): ShareToken
|
|
|
|
setAdmin(userId: ID!, admin: Boolean!): Result!
|
|
|
|
scanAll: ScannerResult!
|
|
scanUser(userId: ID!): ScannerResult!
|
|
|
|
initialSetupWizard(
|
|
username: String!
|
|
password: String!
|
|
rootPath: String!
|
|
): AuthorizeResult
|
|
|
|
updateUser(id: ID!, username: String, rootPath: String, admin: Boolean): User
|
|
createUser(id: ID, username: String, rootPath: String, admin: Boolean): User
|
|
deleteUser(id: ID!): User
|
|
|
|
changeUserPassword(id: ID!, newPassword: String!): Result
|
|
}
|
|
|
|
type Query {
|
|
siteInfo: SiteInfo
|
|
|
|
myUser: User
|
|
user: [User]
|
|
|
|
myAlbums: [Album]
|
|
album(id: ID): Album
|
|
|
|
myPhotos: [Photo]
|
|
photo(id: ID!): Photo
|
|
|
|
shareToken(token: ID!): ShareToken
|
|
|
|
albumShares(id: ID!, password: String): [ShareToken]
|
|
photoShares(id: ID!, password: String): [ShareToken]
|
|
}
|