-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.gql
164 lines (134 loc) · 3.55 KB
/
schema.gql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# -----------------------------------------------
# !!! THIS FILE WAS GENERATED BY TYPE-GRAPHQL !!!
# !!! DO NOT MODIFY THIS FILE BY YOURSELF !!!
# -----------------------------------------------
type AlbumGQL {
name: String!
resourceID: ID!
songs: [SongGQL!]!
}
input CreateSourceInput {
name: String!
path: String!
}
type MediaGQL {
mimeType: String
path: String!
resourceID: ID!
size: Int!
sourceResourceID: ID!
}
type Mutation {
"""
Add a new source, must be an admin.The source is not scanned automatically.
"""
createSource(data: CreateSourceInput!): SourceGQL
"""
Remove a source, must be admin, returns success.Also removes all resources associated with the source.Must be admin.
"""
deleteSource(resourceID: String!): Boolean!
"""Delete a user, returns success."""
deleteUser(userID: String!): Boolean
"""
Check whether the client is signed in, ensures theauthToken cookie (httpOnly) is present in the database andassociated with a user.
"""
isSignedIn: UserGQL
"""Scans the given source, returns success.Must be admin."""
scanSource(resourceID: String!): Boolean!
"""
Sign into the application, if the supplied credentialsare correct, the authToken httpOnly cookie is set.
"""
signIn(data: SignInInput!): UserGQL
"""Sign out of the application, revoking authToken."""
signOut: Boolean!
"""
Sign out of the application on all currentlyauthorized clients, including the client sending the request.Required to sign in again.
"""
signOutAll(data: SignInInput!): Boolean!
"""
Sign up, creating a new user/account, and signing inthe user automatically. The first account created is automaticallyset as an admin.
"""
signUp(data: SignUpInput!): UserGQL
"""
Update the users password. Requires the client tosign-in again (i.e provide username & password).
"""
updatePassword(data: SignInInput!): Boolean!
}
type Query {
"""Query a specific album."""
album(resourceID: String!): AlbumGQL
"""Query all albums the user has access to."""
albums: [AlbumGQL!]
"""Query a specific song."""
song(resourceID: String!): SongGQL
"""Query all songs the user has access to."""
songs(sourceResourceID: String): [SongGQL!]
"""Query a source, must have permissions to access to it."""
source(resourceID: String!): SourceGQL
"""
Query all sources, returns those which the user haspermission to access.
"""
sources: [SourceGQL!]
"""Query a user, must be logged in."""
user(userID: String!): UserGQL
"""Query all users, must be an admin."""
users: [UserGQL!]
}
type ScanGQL {
changesAdd: Int
changesRemove: Int
endTime: Timestamp
scanID: ID!
startTime: Timestamp!
}
input SignInInput {
password: String!
username: String!
}
input SignUpInput {
details: UserDetailsInput!
password: String!
username: String!
}
type SongGQL {
album: AlbumGQL
codec: String
diskNo: Int
diskOf: Int
duration: Float
lossless: Boolean
media: MediaGQL!
mediaResourceID: ID!
releaseCountry: String
releaseFormat: String
title: String!
trackNo: Int
trackOf: Int
year: Int
}
type SourceGQL {
mediaCount: Int!
name: String!
path: String!
resourceID: ID!
scanUnderway: Boolean!
scans: [ScanGQL!]!
}
"""
The javascript `Date` as integer. Type represents date and time as number of milliseconds from start of UNIX epoch.
"""
scalar Timestamp
type UserDetailsGQL {
email: String!
realName: String!
}
input UserDetailsInput {
email: String!
realName: String!
}
type UserGQL {
adminPriority: Int
details: UserDetailsGQL!
userID: ID!
username: String!
}