mirror of https://github.com/requarks/wiki
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
222 lines
3.3 KiB
222 lines
3.3 KiB
# ===============================================
|
|
# USERS
|
|
# ===============================================
|
|
|
|
extend type Query {
|
|
users (
|
|
page: Int
|
|
pageSize: Int
|
|
orderBy: UserOrderBy
|
|
orderByDirection: OrderByDirection
|
|
# Filter by name / email
|
|
filter: String
|
|
): UserResults
|
|
|
|
userById(
|
|
id: UUID!
|
|
): User
|
|
|
|
userDefaults: UserDefaults
|
|
|
|
userEditorSettings(
|
|
editor: String!
|
|
): JSON
|
|
|
|
lastLogins: [UserLastLogin]
|
|
|
|
userPermissions: [String]
|
|
|
|
userPermissionsAtPath(
|
|
siteId: UUID!
|
|
path: String!
|
|
): [String]
|
|
}
|
|
|
|
extend type Mutation {
|
|
createUser(
|
|
email: String!
|
|
name: String!
|
|
password: String!
|
|
groups: [UUID]!
|
|
mustChangePassword: Boolean!
|
|
sendWelcomeEmail: Boolean!
|
|
sendWelcomeEmailFromSiteId: UUID
|
|
): 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
|
|
|
|
changeUserPassword(
|
|
id: UUID!
|
|
newPassword: String!
|
|
mustChangePassword: Boolean
|
|
): DefaultResponse
|
|
|
|
updateProfile(
|
|
name: String
|
|
location: String
|
|
jobTitle: String
|
|
pronouns: String
|
|
timezone: String
|
|
dateFormat: String
|
|
timeFormat: String
|
|
appearance: UserSiteAppearance
|
|
cvd: UserCvdChoices
|
|
): DefaultResponse
|
|
|
|
uploadUserAvatar(
|
|
id: UUID!
|
|
image: Upload!
|
|
): DefaultResponse
|
|
|
|
clearUserAvatar(
|
|
id: UUID!
|
|
): DefaultResponse
|
|
|
|
updateUserDefaults(
|
|
timezone: String!
|
|
dateFormat: String!
|
|
timeFormat: String!
|
|
): DefaultResponse
|
|
}
|
|
|
|
# -----------------------------------------------
|
|
# TYPES
|
|
# -----------------------------------------------
|
|
|
|
type UserResponse {
|
|
operation: Operation
|
|
user: User
|
|
}
|
|
|
|
type UserLastLogin {
|
|
id: UUID
|
|
name: String
|
|
lastLoginAt: Date
|
|
}
|
|
|
|
type UserResults {
|
|
users: [UserMinimal]
|
|
total: Int
|
|
}
|
|
|
|
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: [UserAuth]
|
|
passkeys: [UserPasskey]
|
|
hasAvatar: Boolean
|
|
isSystem: Boolean
|
|
isActive: Boolean
|
|
isVerified: Boolean
|
|
meta: JSON
|
|
prefs: JSON
|
|
createdAt: Date
|
|
updatedAt: Date
|
|
lastLoginAt: Date
|
|
groups: [Group]
|
|
}
|
|
|
|
type UserAuth {
|
|
authId: UUID
|
|
authName: String
|
|
strategyKey: String
|
|
strategyIcon: String
|
|
config: JSON
|
|
}
|
|
|
|
type UserPasskey {
|
|
id: String
|
|
name: String
|
|
createdAt: Date
|
|
siteHostname: String
|
|
}
|
|
|
|
type UserDefaults {
|
|
timezone: String
|
|
dateFormat: String
|
|
timeFormat: String
|
|
}
|
|
|
|
type UserTokenResponse {
|
|
operation: Operation
|
|
jwt: String
|
|
}
|
|
|
|
enum UserOrderBy {
|
|
id
|
|
email
|
|
name
|
|
createdAt
|
|
updatedAt
|
|
lastLoginAt
|
|
}
|
|
|
|
enum UserSiteAppearance {
|
|
site
|
|
light
|
|
dark
|
|
}
|
|
|
|
enum UserCvdChoices {
|
|
none
|
|
protanopia
|
|
deuteranopia
|
|
tritanopia
|
|
}
|
|
|
|
input UserUpdateInput {
|
|
email: String
|
|
name: String
|
|
groups: [UUID!]
|
|
auth: UserAuthUpdateInput
|
|
isActive: Boolean
|
|
isVerified: Boolean
|
|
meta: JSON
|
|
prefs: JSON
|
|
}
|
|
|
|
input UserAuthUpdateInput {
|
|
tfaRequired: Boolean
|
|
mustChangePwd: Boolean
|
|
restrictLogin: Boolean
|
|
}
|