user.graphql 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. # ===============================================
  2. # USERS
  3. # ===============================================
  4. extend type Query {
  5. users (
  6. page: Int
  7. pageSize: Int
  8. orderBy: UserOrderBy
  9. orderByDirection: OrderByDirection
  10. # Filter by name / email
  11. filter: String
  12. ): [UserMinimal]
  13. userById(
  14. id: UUID!
  15. ): User
  16. userDefaults: UserDefaults
  17. lastLogins: [UserLastLogin]
  18. userPermissions: [String]
  19. userPermissionsAtPath(
  20. siteId: UUID!
  21. path: String!
  22. ): [String]
  23. }
  24. extend type Mutation {
  25. createUser(
  26. email: String!
  27. name: String!
  28. password: String!
  29. groups: [UUID]!
  30. mustChangePassword: Boolean!
  31. sendWelcomeEmail: Boolean!
  32. ): UserResponse
  33. updateUser(
  34. id: UUID!
  35. patch: UserUpdateInput!
  36. ): DefaultResponse
  37. deleteUser(
  38. id: UUID!
  39. replaceId: UUID!
  40. ): DefaultResponse
  41. verifyUser(
  42. id: UUID!
  43. ): DefaultResponse
  44. activateUser(
  45. id: UUID!
  46. ): DefaultResponse
  47. deactivateUser(
  48. id: UUID!
  49. ): DefaultResponse
  50. enableUserTFA(
  51. id: UUID!
  52. ): DefaultResponse
  53. disableUserTFA(
  54. id: UUID!
  55. ): DefaultResponse
  56. changeUserPassword(
  57. id: UUID!
  58. newPassword: String!
  59. mustChangePassword: Boolean
  60. ): DefaultResponse
  61. updateProfile(
  62. name: String
  63. location: String
  64. jobTitle: String
  65. pronouns: String
  66. timezone: String
  67. dateFormat: String
  68. timeFormat: String
  69. appearance: UserSiteAppearance
  70. cvd: UserCvdChoices
  71. ): DefaultResponse
  72. uploadUserAvatar(
  73. id: UUID!
  74. image: Upload!
  75. ): DefaultResponse
  76. clearUserAvatar(
  77. id: UUID!
  78. ): DefaultResponse
  79. updateUserDefaults(
  80. timezone: String!
  81. dateFormat: String!
  82. timeFormat: String!
  83. ): DefaultResponse
  84. }
  85. # -----------------------------------------------
  86. # TYPES
  87. # -----------------------------------------------
  88. type UserResponse {
  89. operation: Operation
  90. user: User
  91. }
  92. type UserLastLogin {
  93. id: UUID
  94. name: String
  95. lastLoginAt: Date
  96. }
  97. type UserMinimal {
  98. id: UUID
  99. name: String
  100. email: String
  101. isSystem: Boolean
  102. isActive: Boolean
  103. createdAt: Date
  104. lastLoginAt: Date
  105. }
  106. type User {
  107. id: UUID
  108. name: String
  109. email: String
  110. auth: [UserAuth]
  111. passkeys: [UserPasskey]
  112. hasAvatar: Boolean
  113. isSystem: Boolean
  114. isActive: Boolean
  115. isVerified: Boolean
  116. meta: JSON
  117. prefs: JSON
  118. createdAt: Date
  119. updatedAt: Date
  120. lastLoginAt: Date
  121. groups: [Group]
  122. }
  123. type UserAuth {
  124. authId: UUID
  125. authName: String
  126. strategyKey: String
  127. strategyIcon: String
  128. config: JSON
  129. }
  130. type UserPasskey {
  131. id: String
  132. name: String
  133. createdAt: Date
  134. siteHostname: String
  135. }
  136. type UserDefaults {
  137. timezone: String
  138. dateFormat: String
  139. timeFormat: String
  140. }
  141. type UserTokenResponse {
  142. operation: Operation
  143. jwt: String
  144. }
  145. enum UserOrderBy {
  146. id
  147. email
  148. name
  149. createdAt
  150. updatedAt
  151. lastLoginAt
  152. }
  153. enum UserSiteAppearance {
  154. site
  155. light
  156. dark
  157. }
  158. enum UserCvdChoices {
  159. none
  160. protanopia
  161. deuteranopia
  162. tritanopia
  163. }
  164. input UserUpdateInput {
  165. email: String
  166. name: String
  167. groups: [UUID!]
  168. auth: UserAuthUpdateInput
  169. isActive: Boolean
  170. isVerified: Boolean
  171. meta: JSON
  172. prefs: JSON
  173. }
  174. input UserAuthUpdateInput {
  175. tfaRequired: Boolean
  176. mustChangePwd: Boolean
  177. restrictLogin: Boolean
  178. }