2020-01-31 23:30:34 +01:00
|
|
|
directive @isAdmin on FIELD_DEFINITION
|
|
|
|
|
2020-01-31 18:51:24 +01:00
|
|
|
scalar Time
|
|
|
|
|
2020-02-09 15:26:59 +01:00
|
|
|
enum OrderDirection {
|
|
|
|
ASC
|
|
|
|
DESC
|
|
|
|
}
|
|
|
|
|
|
|
|
input Filter {
|
|
|
|
order_by: String
|
|
|
|
order_direction: OrderDirection
|
|
|
|
limit: Int
|
|
|
|
offset: Int
|
|
|
|
}
|
|
|
|
|
2020-01-30 14:28:14 +01:00
|
|
|
type Query {
|
2020-02-09 12:53:21 +01:00
|
|
|
siteInfo: SiteInfo!
|
2020-02-05 16:49:51 +01:00
|
|
|
|
2020-02-01 14:52:27 +01:00
|
|
|
"List of registered users, must be admin to call"
|
2020-02-15 22:13:02 +01:00
|
|
|
user(filter: Filter): [User!]! @isAdmin
|
2020-02-01 14:52:27 +01:00
|
|
|
"Information about the currently logged in user"
|
2020-02-09 12:53:21 +01:00
|
|
|
myUser: User!
|
2020-02-01 14:52:27 +01:00
|
|
|
|
2020-02-20 17:14:11 +01:00
|
|
|
"List of albums owned by the logged in user."
|
|
|
|
myAlbums(
|
|
|
|
filter: Filter
|
|
|
|
"Return only albums from the root directory of the user"
|
|
|
|
onlyRoot: Boolean
|
|
|
|
"Return also albums with no photos directly in them"
|
|
|
|
showEmpty: Boolean
|
|
|
|
): [Album!]!
|
2020-02-01 14:52:27 +01:00
|
|
|
"Get album by id, user must own the album or be admin"
|
2020-02-09 21:25:33 +01:00
|
|
|
album(id: Int!): Album!
|
2020-02-01 14:52:27 +01:00
|
|
|
|
|
|
|
"List of photos owned by the logged in user"
|
2020-02-09 15:26:59 +01:00
|
|
|
myPhotos(filter: Filter): [Photo!]!
|
2020-02-01 14:52:27 +01:00
|
|
|
"Get photo by id, user must own the photo or be admin"
|
2020-02-09 21:25:33 +01:00
|
|
|
photo(id: Int!): Photo!
|
|
|
|
|
2020-02-11 14:32:35 +01:00
|
|
|
shareToken(token: String!, password: String): ShareToken!
|
2020-06-14 18:28:12 +02:00
|
|
|
shareTokenRequiresPassword(token: String!): Boolean!
|
2020-03-05 11:53:42 +01:00
|
|
|
|
|
|
|
search(query: String!, limitPhotos: Int, limitAlbums: Int): SearchResult!
|
2020-01-30 14:28:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type Mutation {
|
|
|
|
authorizeUser(username: String!, password: String!): AuthorizeResult!
|
|
|
|
|
2020-02-05 16:49:51 +01:00
|
|
|
"Registers a new user, must be admin to call"
|
2020-01-31 18:51:24 +01:00
|
|
|
registerUser(
|
|
|
|
username: String!
|
|
|
|
password: String!
|
|
|
|
rootPath: String!
|
2020-02-09 12:53:21 +01:00
|
|
|
): AuthorizeResult!
|
2020-02-05 16:49:51 +01:00
|
|
|
|
|
|
|
"Registers the initial user, can only be called if initialSetup from SiteInfo is true"
|
|
|
|
initialSetupWizard(
|
|
|
|
username: String!
|
|
|
|
password: String!
|
|
|
|
rootPath: String!
|
|
|
|
): AuthorizeResult
|
2020-02-01 17:58:45 +01:00
|
|
|
|
|
|
|
"Scan all users for new photos"
|
2020-02-16 12:22:00 +01:00
|
|
|
scanAll: ScannerResult! @isAdmin
|
2020-02-01 17:58:45 +01:00
|
|
|
"Scan a single user for new photos"
|
2020-02-09 21:25:33 +01:00
|
|
|
scanUser(userId: Int!): ScannerResult!
|
|
|
|
|
|
|
|
"Generate share token for album"
|
|
|
|
shareAlbum(albumId: Int!, expire: Time, password: String): ShareToken
|
|
|
|
"Generate share token for photo"
|
|
|
|
sharePhoto(photoId: Int!, expire: Time, password: String): ShareToken
|
2020-02-11 15:36:12 +01:00
|
|
|
"Delete a share token by it's token value"
|
|
|
|
deleteShareToken(token: String!): ShareToken
|
2020-06-14 15:07:07 +02:00
|
|
|
"Set a password for a token, if null is passed for the password argument, the password will be cleared"
|
|
|
|
protectShareToken(token: String!, password: String): ShareToken
|
2020-02-16 12:22:00 +01:00
|
|
|
|
|
|
|
updateUser(
|
|
|
|
id: Int!
|
|
|
|
username: String
|
|
|
|
rootPath: String
|
2020-02-22 14:05:33 +01:00
|
|
|
password: String
|
2020-02-16 12:22:00 +01:00
|
|
|
admin: Boolean
|
|
|
|
): User @isAdmin
|
|
|
|
createUser(
|
|
|
|
username: String!
|
|
|
|
rootPath: String!
|
|
|
|
password: String
|
|
|
|
admin: Boolean!
|
|
|
|
): User @isAdmin
|
|
|
|
deleteUser(id: Int!): User @isAdmin
|
2020-01-30 14:28:14 +01:00
|
|
|
}
|
|
|
|
|
2020-02-21 16:50:50 +01:00
|
|
|
type Subscription {
|
|
|
|
notification: Notification!
|
|
|
|
}
|
|
|
|
|
|
|
|
enum NotificationType {
|
|
|
|
Message
|
|
|
|
Progress
|
2020-02-26 19:44:47 +01:00
|
|
|
"Close a notification with a given key"
|
|
|
|
Close
|
2020-02-21 16:50:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type Notification {
|
|
|
|
key: String!
|
|
|
|
type: NotificationType!
|
|
|
|
header: String!
|
|
|
|
content: String!
|
|
|
|
progress: Float
|
|
|
|
positive: Boolean!
|
|
|
|
negative: Boolean!
|
2020-02-26 19:44:47 +01:00
|
|
|
"Time in milliseconds before the notification will close"
|
|
|
|
timeout: Int
|
2020-02-21 16:50:50 +01:00
|
|
|
}
|
|
|
|
|
2020-01-30 14:28:14 +01:00
|
|
|
type AuthorizeResult {
|
|
|
|
success: Boolean!
|
|
|
|
status: String!
|
|
|
|
token: String
|
|
|
|
}
|
|
|
|
|
2020-02-01 17:58:45 +01:00
|
|
|
type ScannerResult {
|
|
|
|
finished: Boolean!
|
|
|
|
success: Boolean!
|
|
|
|
progress: Float
|
|
|
|
message: String
|
|
|
|
}
|
|
|
|
|
2020-02-09 21:25:33 +01:00
|
|
|
"A token used to publicly access an album or photo"
|
|
|
|
type ShareToken {
|
|
|
|
id: Int!
|
|
|
|
token: String!
|
|
|
|
"The user who created the token"
|
|
|
|
owner: User!
|
|
|
|
"Optional expire date"
|
|
|
|
expire: Time
|
2020-06-14 15:07:07 +02:00
|
|
|
"Whether or not a password is needed to access the share"
|
|
|
|
hasPassword: Boolean!
|
2020-02-09 21:25:33 +01:00
|
|
|
|
|
|
|
"The album this token shares"
|
|
|
|
album: Album
|
|
|
|
"The photo this token shares"
|
|
|
|
photo: Photo
|
|
|
|
}
|
|
|
|
|
2020-02-05 16:49:51 +01:00
|
|
|
"General public information about the site"
|
|
|
|
type SiteInfo {
|
|
|
|
initialSetup: Boolean!
|
|
|
|
}
|
|
|
|
|
2020-01-30 14:28:14 +01:00
|
|
|
type User {
|
2020-02-09 21:25:33 +01:00
|
|
|
id: Int!
|
2020-01-30 14:28:14 +01:00
|
|
|
username: String!
|
|
|
|
#albums: [Album]
|
2020-02-01 14:52:27 +01:00
|
|
|
"Local filepath for the user's photos"
|
2020-01-31 23:30:34 +01:00
|
|
|
rootPath: String! @isAdmin
|
2020-01-30 14:28:14 +01:00
|
|
|
admin: Boolean!
|
|
|
|
#shareTokens: [ShareToken]
|
|
|
|
}
|
2020-02-01 14:52:27 +01:00
|
|
|
|
|
|
|
type Album {
|
2020-02-09 21:25:33 +01:00
|
|
|
id: Int!
|
2020-02-09 12:53:21 +01:00
|
|
|
title: String!
|
2020-02-09 21:25:33 +01:00
|
|
|
"The photos inside this album"
|
2020-02-09 15:26:59 +01:00
|
|
|
photos(filter: Filter): [Photo!]!
|
2020-02-09 21:25:33 +01:00
|
|
|
"The albums contained in this album"
|
2020-02-09 16:16:41 +01:00
|
|
|
subAlbums(filter: Filter): [Album!]!
|
2020-02-09 21:25:33 +01:00
|
|
|
"The album witch contains this album"
|
2020-02-01 14:52:27 +01:00
|
|
|
parentAlbum: Album
|
2020-02-09 21:25:33 +01:00
|
|
|
"The user who owns this album"
|
2020-02-01 14:52:27 +01:00
|
|
|
owner: User!
|
2020-02-09 21:25:33 +01:00
|
|
|
"The path on the filesystem of the server, where this album is located"
|
2020-03-07 16:19:27 +01:00
|
|
|
filePath: String!
|
2020-02-09 21:25:33 +01:00
|
|
|
"An image in this album used for previewing this album"
|
2020-02-09 16:16:41 +01:00
|
|
|
thumbnail: Photo
|
2020-03-07 16:19:27 +01:00
|
|
|
path: [Album!]!
|
2020-02-01 14:52:27 +01:00
|
|
|
|
2020-02-11 14:32:35 +01:00
|
|
|
shares: [ShareToken]
|
2020-02-01 14:52:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type PhotoURL {
|
|
|
|
"URL for previewing the image"
|
2020-02-09 12:53:21 +01:00
|
|
|
url: String!
|
2020-02-01 14:52:27 +01:00
|
|
|
"Width of the image in pixels"
|
2020-02-09 12:53:21 +01:00
|
|
|
width: Int!
|
2020-02-01 14:52:27 +01:00
|
|
|
"Height of the image in pixels"
|
2020-02-09 12:53:21 +01:00
|
|
|
height: Int!
|
2020-02-01 14:52:27 +01:00
|
|
|
}
|
|
|
|
|
2020-02-10 12:05:58 +01:00
|
|
|
type PhotoDownload {
|
|
|
|
title: String!
|
2020-02-21 22:42:39 +01:00
|
|
|
width: Int!
|
|
|
|
height: Int!
|
2020-02-10 12:05:58 +01:00
|
|
|
url: String!
|
|
|
|
}
|
|
|
|
|
2020-02-01 14:52:27 +01:00
|
|
|
type Photo {
|
2020-02-09 21:25:33 +01:00
|
|
|
id: Int!
|
2020-02-09 12:53:21 +01:00
|
|
|
title: String!
|
2020-02-01 14:52:27 +01:00
|
|
|
"Local filepath for the photo"
|
2020-02-09 12:53:21 +01:00
|
|
|
path: String!
|
2020-02-01 14:52:27 +01:00
|
|
|
"URL to display the photo in a smaller resolution"
|
2020-02-09 12:53:21 +01:00
|
|
|
thumbnail: PhotoURL!
|
2020-02-10 12:05:58 +01:00
|
|
|
"URL to display the photo in full resolution"
|
2020-02-09 12:53:21 +01:00
|
|
|
highRes: PhotoURL!
|
2020-02-01 14:52:27 +01:00
|
|
|
"The album that holds the photo"
|
|
|
|
album: Album!
|
2020-02-02 00:29:42 +01:00
|
|
|
exif: PhotoEXIF
|
2020-02-01 14:52:27 +01:00
|
|
|
|
2020-02-10 12:05:58 +01:00
|
|
|
shares: [ShareToken!]!
|
|
|
|
downloads: [PhotoDownload!]!
|
2020-02-01 14:52:27 +01:00
|
|
|
}
|
2020-02-02 00:29:42 +01:00
|
|
|
|
|
|
|
"EXIF metadata from the camera"
|
|
|
|
type PhotoEXIF {
|
2020-02-24 23:30:08 +01:00
|
|
|
id: Int!
|
2020-02-02 00:29:42 +01:00
|
|
|
photo: Photo
|
|
|
|
"The model name of the camera"
|
|
|
|
camera: String
|
|
|
|
"The maker of the camera"
|
|
|
|
maker: String
|
|
|
|
"The name of the lens"
|
|
|
|
lens: String
|
|
|
|
dateShot: Time
|
|
|
|
"The exposure time of the image"
|
|
|
|
exposure: String
|
|
|
|
"The aperature stops of the image"
|
|
|
|
aperture: Float
|
|
|
|
"The ISO setting of the image"
|
|
|
|
iso: Int
|
|
|
|
"The focal length of the lens, when the image was taken"
|
2020-02-24 23:30:08 +01:00
|
|
|
focalLength: Float
|
2020-02-02 00:29:42 +01:00
|
|
|
"A formatted description of the flash settings, when the image was taken"
|
|
|
|
flash: String
|
2020-02-24 23:30:08 +01:00
|
|
|
"An index describing the mode for adjusting the exposure of the image"
|
|
|
|
exposureProgram: Int
|
2020-02-02 00:29:42 +01:00
|
|
|
}
|
2020-03-05 11:53:42 +01:00
|
|
|
|
|
|
|
type SearchResult {
|
|
|
|
query: String!
|
|
|
|
albums: [Album!]!
|
|
|
|
photos: [Photo!]!
|
|
|
|
}
|