tabby/ee/tabby-webserver/graphql/schema.graphql

70 lines
1.1 KiB
GraphQL

type RegisterResponse {
accessToken: String!
refreshToken: String!
}
enum WorkerKind {
COMPLETION
CHAT
}
type Mutation {
resetRegistrationToken: String!
register(email: String!, password1: String!, password2: String!, invitationCode: String): RegisterResponse!
tokenAuth(email: String!, password: String!): TokenAuthResponse!
verifyToken(token: String!): VerifyTokenResponse!
createInvitation(email: String!): Int!
deleteInvitation(id: Int!): Int!
}
type VerifyTokenResponse {
claims: Claims!
}
type UserInfo {
email: String!
isAdmin: Boolean!
}
type Claims {
exp: Float!
iat: Float!
user: UserInfo!
}
type Query {
workers: [Worker!]!
registrationToken: String!
isAdminInitialized: Boolean!
invitations: [Invitation!]!
me: UserInfo!
}
type Invitation {
id: Int!
email: String!
code: String!
createdAt: String!
}
type Worker {
kind: WorkerKind!
name: String!
addr: String!
device: String!
arch: String!
cpuInfo: String!
cpuCount: Int!
cudaDevices: [String!]!
}
type TokenAuthResponse {
accessToken: String!
refreshToken: String!
}
schema {
query: Query
mutation: Mutation
}