2018-05-12 20:13:04 +00:00
|
|
|
# ===============================================
|
|
|
|
# USERS
|
|
|
|
# ===============================================
|
|
|
|
|
|
|
|
extend type Query {
|
|
|
|
users: UserQuery
|
|
|
|
}
|
|
|
|
|
|
|
|
extend type Mutation {
|
|
|
|
users: UserMutation
|
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# QUERIES
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
type UserQuery {
|
|
|
|
list(
|
|
|
|
filter: String
|
|
|
|
orderBy: String
|
2018-10-14 21:38:39 +00:00
|
|
|
): [UserMinimal] @auth(requires: ["write:users", "manage:users", "manage:system"])
|
2018-05-12 20:13:04 +00:00
|
|
|
|
|
|
|
search(
|
|
|
|
query: String!
|
2018-10-14 21:38:39 +00:00
|
|
|
): [UserMinimal] @auth(requires: ["write:groups", "manage:groups", "write:users", "manage:users", "manage:system"])
|
2018-05-12 20:13:04 +00:00
|
|
|
|
|
|
|
single(
|
|
|
|
id: Int!
|
2018-10-14 21:38:39 +00:00
|
|
|
): User @auth(requires: ["manage:users", "manage:system"])
|
2020-03-30 05:30:10 +00:00
|
|
|
|
|
|
|
profile: UserProfile
|
2020-04-13 19:54:10 +00:00
|
|
|
|
|
|
|
lastLogins: [UserLastLogin] @auth(requires: ["write:groups", "manage:groups", "write:users", "manage:users", "manage:system"])
|
2018-05-12 20:13:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# MUTATIONS
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
type UserMutation {
|
|
|
|
create(
|
|
|
|
email: String!
|
2019-07-29 04:50:03 +00:00
|
|
|
name: String!
|
2018-05-12 20:13:04 +00:00
|
|
|
passwordRaw: String
|
2018-12-15 22:15:13 +00:00
|
|
|
providerKey: String!
|
2019-07-29 04:50:03 +00:00
|
|
|
groups: [Int]!
|
|
|
|
mustChangePassword: Boolean
|
|
|
|
sendWelcomeEmail: Boolean
|
2018-10-14 21:38:39 +00:00
|
|
|
): UserResponse @auth(requires: ["write:users", "manage:users", "manage:system"])
|
2018-05-12 20:13:04 +00:00
|
|
|
|
|
|
|
update(
|
|
|
|
id: Int!
|
|
|
|
email: String
|
|
|
|
name: String
|
2019-08-17 22:29:58 +00:00
|
|
|
newPassword: String
|
|
|
|
groups: [Int]
|
|
|
|
location: String
|
|
|
|
jobTitle: String
|
|
|
|
timezone: String
|
2020-05-03 04:38:02 +00:00
|
|
|
dateFormat: String
|
|
|
|
appearance: String
|
2019-08-17 22:29:58 +00:00
|
|
|
): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
|
2018-05-12 20:13:04 +00:00
|
|
|
|
|
|
|
delete(
|
|
|
|
id: Int!
|
2020-05-30 20:34:09 +00:00
|
|
|
replaceId: Int!
|
2018-10-14 21:38:39 +00:00
|
|
|
): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
|
2018-05-12 20:13:04 +00:00
|
|
|
|
2020-01-02 19:19:02 +00:00
|
|
|
verify(
|
|
|
|
id: Int!
|
|
|
|
): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
|
|
|
|
|
|
|
|
activate(
|
|
|
|
id: Int!
|
|
|
|
): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
|
|
|
|
|
|
|
|
deactivate(
|
|
|
|
id: Int!
|
|
|
|
): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
|
|
|
|
|
2018-05-12 20:13:04 +00:00
|
|
|
resetPassword(
|
|
|
|
id: Int!
|
|
|
|
): DefaultResponse
|
2020-04-05 22:51:48 +00:00
|
|
|
|
|
|
|
updateProfile(
|
|
|
|
name: String!
|
|
|
|
location: String!
|
|
|
|
jobTitle: String!
|
|
|
|
timezone: String!
|
2020-05-03 04:38:02 +00:00
|
|
|
dateFormat: String!
|
|
|
|
appearance: String!
|
2020-04-05 22:51:48 +00:00
|
|
|
): UserTokenResponse
|
|
|
|
|
|
|
|
changePassword(
|
|
|
|
current: String!
|
|
|
|
new: String!
|
|
|
|
): UserTokenResponse
|
2018-05-12 20:13:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# TYPES
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
type UserResponse {
|
|
|
|
responseResult: ResponseStatus!
|
|
|
|
user: User
|
|
|
|
}
|
|
|
|
|
2020-04-13 19:54:10 +00:00
|
|
|
type UserLastLogin {
|
|
|
|
id: Int!
|
|
|
|
name: String!
|
|
|
|
lastLoginAt: Date!
|
|
|
|
}
|
|
|
|
|
2018-05-12 20:13:04 +00:00
|
|
|
type UserMinimal {
|
|
|
|
id: Int!
|
|
|
|
name: String!
|
|
|
|
email: String!
|
2018-08-05 15:27:46 +00:00
|
|
|
providerKey: String!
|
2018-12-15 22:15:13 +00:00
|
|
|
isSystem: Boolean!
|
2020-05-15 21:05:11 +00:00
|
|
|
isActive: Boolean!
|
2018-10-14 03:22:42 +00:00
|
|
|
createdAt: Date!
|
2020-05-15 21:05:11 +00:00
|
|
|
lastLoginAt: Date
|
2018-05-12 20:13:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type User {
|
|
|
|
id: Int!
|
|
|
|
name: String!
|
|
|
|
email: String!
|
2018-08-05 15:27:46 +00:00
|
|
|
providerKey: String!
|
2018-05-12 20:13:04 +00:00
|
|
|
providerId: String
|
2018-12-15 22:15:13 +00:00
|
|
|
isSystem: Boolean!
|
2019-08-25 02:19:35 +00:00
|
|
|
isActive: Boolean!
|
|
|
|
isVerified: Boolean!
|
2018-12-15 22:15:13 +00:00
|
|
|
location: String!
|
|
|
|
jobTitle: String!
|
|
|
|
timezone: String!
|
2020-05-03 04:38:02 +00:00
|
|
|
dateFormat: String!
|
|
|
|
appearance: String!
|
2018-05-12 20:13:04 +00:00
|
|
|
createdAt: Date!
|
|
|
|
updatedAt: Date!
|
2020-04-05 23:30:02 +00:00
|
|
|
lastLoginAt: Date
|
2020-08-22 23:37:49 +00:00
|
|
|
tfaIsActive: Boolean!
|
2018-12-15 22:15:13 +00:00
|
|
|
groups: [Group]!
|
2018-05-12 20:13:04 +00:00
|
|
|
}
|
2020-03-30 05:30:10 +00:00
|
|
|
|
|
|
|
type UserProfile {
|
|
|
|
id: Int!
|
|
|
|
name: String!
|
|
|
|
email: String!
|
2020-04-05 22:51:48 +00:00
|
|
|
providerKey: String
|
2020-03-30 05:30:10 +00:00
|
|
|
providerName: String
|
|
|
|
isSystem: Boolean!
|
|
|
|
isVerified: Boolean!
|
|
|
|
location: String!
|
|
|
|
jobTitle: String!
|
|
|
|
timezone: String!
|
2020-05-03 04:38:02 +00:00
|
|
|
dateFormat: String!
|
|
|
|
appearance: String!
|
2020-03-30 05:30:10 +00:00
|
|
|
createdAt: Date!
|
|
|
|
updatedAt: Date!
|
2020-04-05 22:51:48 +00:00
|
|
|
lastLoginAt: Date
|
2020-03-30 05:30:10 +00:00
|
|
|
groups: [String]!
|
2020-04-05 22:51:48 +00:00
|
|
|
pagesTotal: Int!
|
|
|
|
}
|
|
|
|
|
|
|
|
type UserTokenResponse {
|
|
|
|
responseResult: ResponseStatus!
|
|
|
|
jwt: String
|
2020-03-30 05:30:10 +00:00
|
|
|
}
|