directive @isAdmin on FIELD_DEFINITION scalar Time enum OrderDirection { ASC DESC } input Filter { order_by: String order_direction: OrderDirection limit: Int offset: Int } type Query { siteInfo: SiteInfo! "List of registered users, must be admin to call" users(filter: Filter): [User!]! @isAdmin "Information about the currently logged in user" myUser: User! "List of albums owned by the logged in user" myAlbums(filter: Filter): [Album!]! "Get album by id, user must own the album or be admin" album(id: Int!): Album! "List of photos owned by the logged in user" myPhotos(filter: Filter): [Photo!]! "Get photo by id, user must own the photo or be admin" photo(id: Int!): Photo! albumShares(id: Int!, password: String): [ShareToken!]! photoShares(id: Int!, password: String): [ShareToken!]! } type Mutation { authorizeUser(username: String!, password: String!): AuthorizeResult! "Registers a new user, must be admin to call" registerUser( username: String! password: String! rootPath: String! ): AuthorizeResult! "Registers the initial user, can only be called if initialSetup from SiteInfo is true" initialSetupWizard( username: String! password: String! rootPath: String! ): AuthorizeResult "Scan all users for new photos" scanAll: ScannerResult! "Scan a single user for new photos" 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 } type AuthorizeResult { success: Boolean! status: String! token: String } type ScannerResult { finished: Boolean! success: Boolean! progress: Float message: String } "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 "The album this token shares" album: Album "The photo this token shares" photo: Photo } "General public information about the site" type SiteInfo { initialSetup: Boolean! } type User { id: Int! username: String! #albums: [Album] "Local filepath for the user's photos" rootPath: String! @isAdmin admin: Boolean! #shareTokens: [ShareToken] } type Album { id: Int! title: String! "The photos inside this album" photos(filter: Filter): [Photo!]! "The albums contained in this album" subAlbums(filter: Filter): [Album!]! "The album witch contains this album" parentAlbum: Album "The user who owns this album" owner: User! "The path on the filesystem of the server, where this album is located" path: String! "An image in this album used for previewing this album" thumbnail: Photo # 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 Photo { id: Int! 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! highRes: PhotoURL! "The album that holds the photo" album: Album! exif: PhotoEXIF # shares: [ShareToken] # downloads: [PhotoDownload] } "EXIF metadata from the camera" type PhotoEXIF { 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 formatted filesize of the image" fileSize: String "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" focalLength: String "A formatted description of the flash settings, when the image was taken" flash: String }