|
|
|
# ===============================================
|
|
|
|
# USERS
|
|
|
|
# ===============================================
|
|
|
|
|
|
|
|
extend type Query {
|
|
|
|
users (
|
|
|
|
page: Int
|
|
|
|
pageSize: Int
|
|
|
|
orderBy: UserOrderBy
|
|
|
|
orderByDirection: OrderByDirection
|
|
|
|
# Filter by name / email
|
|
|
|
filter: String
|
|
|
|
): [UserMinimal]
|
|
|
|
|
|
|
|
userById(
|
|
|
|
id: UUID!
|
|
|
|
): User
|
|
|
|
|
|
|
|
lastLogins: [UserLastLogin]
|
|
|
|
}
|
|
|
|
|
|
|
|
extend type Mutation {
|
|
|
|
createUser(
|
|
|
|
email: String!
|
|
|
|
name: String!
|
|
|
|
password: String!
|
|
|
|
groups: [UUID]!
|
|
|
|
mustChangePassword: Boolean!
|
|
|
|
sendWelcomeEmail: Boolean!
|
|
|
|
): UserResponse
|
|
|
|
|
|
|
|
updateUser(
|
|
|
|
id: UUID!
|
|
|
|
patch: UserUpdateInput!
|
|
|
|
): DefaultResponse
|
|
|
|
|
|
|
|
deleteUser(
|
|
|
|
id: UUID!
|
|
|
|
replaceId: UUID!
|
|
|
|
): DefaultResponse
|
|
|
|
|
|
|
|
verifyUser(
|
|
|
|
id: UUID!
|
|
|
|
): DefaultResponse
|
|
|
|
|
|
|
|
activateUser(
|
|
|
|
id: UUID!
|
|
|
|
): DefaultResponse
|
|
|
|
|
|
|
|
deactivateUser(
|
|
|
|
id: UUID!
|
|
|
|
): DefaultResponse
|
|
|
|
|
|
|
|
enableUserTFA(
|
|
|
|
id: UUID!
|
|
|
|
): DefaultResponse
|
|
|
|
|
|
|
|
disableUserTFA(
|
|
|
|
id: UUID!
|
|
|
|
): DefaultResponse
|
|
|
|
|
|
|
|
resetUserPassword(
|
|
|
|
id: Int!
|
|
|
|
): DefaultResponse
|
|
|
|
|
|
|
|
updateProfile(
|
|
|
|
name: String
|
|
|
|
location: String
|
|
|
|
jobTitle: String
|
|
|
|
pronouns: String
|
|
|
|
timezone: String
|
|
|
|
dateFormat: String
|
|
|
|
timeFormat: String
|
|
|
|
appearance: UserSiteAppearance
|
|
|
|
): DefaultResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# TYPES
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
type UserResponse {
|
|
|
|
operation: Operation
|
|
|
|
user: User
|
|
|
|
}
|
|
|
|
|
|
|
|
type UserLastLogin {
|
|
|
|
id: UUID
|
|
|
|
name: String
|
|
|
|
lastLoginAt: Date
|
|
|
|
}
|
|
|
|
|
|
|
|
type UserMinimal {
|
|
|
|
id: UUID
|
|
|
|
name: String
|
|
|
|
email: String
|
|
|
|
isSystem: Boolean
|
|
|
|
isActive: Boolean
|
|
|
|
createdAt: Date
|
|
|
|
lastLoginAt: Date
|
|
|
|
}
|
|
|
|
|
|
|
|
type User {
|
|
|
|
id: UUID
|
|
|
|
name: String
|
|
|
|
email: String
|
|
|
|
auth: JSON
|
|
|
|
isSystem: Boolean
|
|
|
|
isActive: Boolean
|
|
|
|
isVerified: Boolean
|
|
|
|
meta: JSON
|
|
|
|
prefs: JSON
|
|
|
|
pictureUrl: String
|
|
|
|
createdAt: Date
|
|
|
|
updatedAt: Date
|
|
|
|
lastLoginAt: Date
|
|
|
|
groups: [Group]
|
|
|
|
}
|
|
|
|
|
|
|
|
type UserTokenResponse {
|
|
|
|
operation: Operation
|
|
|
|
jwt: String
|
|
|
|
}
|
|
|
|
|
|
|
|
enum UserOrderBy {
|
|
|
|
id
|
|
|
|
email
|
|
|
|
name
|
|
|
|
createdAt
|
|
|
|
updatedAt
|
|
|
|
lastLoginAt
|
|
|
|
}
|
|
|
|
|
|
|
|
enum UserSiteAppearance {
|
|
|
|
site
|
|
|
|
light
|
|
|
|
dark
|
|
|
|
}
|
|
|
|
|
|
|
|
input UserUpdateInput {
|
|
|
|
email: String
|
|
|
|
name: String
|
|
|
|
newPassword: String
|
|
|
|
groups: [UUID!]
|
|
|
|
isActive: Boolean
|
|
|
|
isVerified: Boolean
|
|
|
|
meta: JSON
|
|
|
|
prefs: JSON
|
|
|
|
}
|