80 lines
1.5 KiB
GraphQL
80 lines
1.5 KiB
GraphQL
scalar Base64
|
|
|
|
scalar Date
|
|
|
|
scalar Email
|
|
|
|
scalar KeyID
|
|
|
|
scalar PhoneNumber
|
|
|
|
scalar Time
|
|
|
|
scalar TokenID
|
|
|
|
scalar UserID
|
|
|
|
enum Unit {
|
|
Unit
|
|
Unit2
|
|
}
|
|
|
|
type PGPKey {
|
|
id: KeyID!
|
|
user: User!
|
|
pgpKeyData: Base64!
|
|
expires: Time
|
|
uploaded: Time!
|
|
comment: String!
|
|
}
|
|
|
|
type Token {
|
|
id: TokenID!
|
|
user: User!
|
|
name: String
|
|
tokenData: String!
|
|
comment: String!
|
|
issued: Time!
|
|
expires: Time
|
|
permissions: String!
|
|
}
|
|
|
|
type User {
|
|
id: UserID!
|
|
email: Email
|
|
pendingEmail: Email
|
|
name: String!
|
|
nickname: String!
|
|
phoneNumber: PhoneNumber!
|
|
birthdate: Date!
|
|
homeplace: String!
|
|
registered: Time!
|
|
accepted: Time
|
|
seceded: Time
|
|
permissions: String!
|
|
isMember: Boolean!
|
|
application: String!
|
|
}
|
|
|
|
type Query {
|
|
users: [User!]!
|
|
user(id: UserID): User
|
|
applications: [User!]!
|
|
tokens(user: UserID): [Token!]!
|
|
keys(user: UserID): [PGPKey!]!
|
|
permissions: String!
|
|
primaryKey(user: UserID): PGPKey
|
|
}
|
|
|
|
type Mutation {
|
|
apply(email: Email!, phoneNumber: PhoneNumber!, password: String!, name: String!, nickname: String, birthdate: Date!, homeplace: String!, application: String!): User!
|
|
verifyEmail(secret: String!): Unit!
|
|
resendVerificationEmail(user: UserID): Unit!
|
|
update(email: Email, phoneNumber: PhoneNumber, password: String, name: String, nickname: String, homeplace: String, user: UserID): User!
|
|
newToken(comment: String, name: String, permissions: String): Token!
|
|
newKey(comment: String, keyData: Base64!, expires: Time): PGPKey!
|
|
accept(user: UserID!): Unit!
|
|
reject(user: UserID!): Unit!
|
|
}
|
|
|