user.graphql 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. sendWelcomeEmailFromSiteId: UUID
  33. ): UserResponse
  34. updateUser(
  35. id: UUID!
  36. patch: UserUpdateInput!
  37. ): DefaultResponse
  38. deleteUser(
  39. id: UUID!
  40. replaceId: UUID!
  41. ): DefaultResponse
  42. verifyUser(
  43. id: UUID!
  44. ): DefaultResponse
  45. activateUser(
  46. id: UUID!
  47. ): DefaultResponse
  48. deactivateUser(
  49. id: UUID!
  50. ): DefaultResponse
  51. enableUserTFA(
  52. id: UUID!
  53. ): DefaultResponse
  54. disableUserTFA(
  55. id: UUID!
  56. ): DefaultResponse
  57. changeUserPassword(
  58. id: UUID!
  59. newPassword: String!
  60. mustChangePassword: Boolean
  61. ): DefaultResponse
  62. updateProfile(
  63. name: String
  64. location: String
  65. jobTitle: String
  66. pronouns: String
  67. timezone: String
  68. dateFormat: String
  69. timeFormat: String
  70. appearance: UserSiteAppearance
  71. cvd: UserCvdChoices
  72. ): DefaultResponse
  73. uploadUserAvatar(
  74. id: UUID!
  75. image: Upload!
  76. ): DefaultResponse
  77. clearUserAvatar(
  78. id: UUID!
  79. ): DefaultResponse
  80. updateUserDefaults(
  81. timezone: String!
  82. dateFormat: String!
  83. timeFormat: String!
  84. ): DefaultResponse
  85. }
  86. # -----------------------------------------------
  87. # TYPES
  88. # -----------------------------------------------
  89. type UserResponse {
  90. operation: Operation
  91. user: User
  92. }
  93. type UserLastLogin {
  94. id: UUID
  95. name: String
  96. lastLoginAt: Date
  97. }
  98. type UserMinimal {
  99. id: UUID
  100. name: String
  101. email: String
  102. isSystem: Boolean
  103. isActive: Boolean
  104. createdAt: Date
  105. lastLoginAt: Date
  106. }
  107. type User {
  108. id: UUID
  109. name: String
  110. email: String
  111. auth: [UserAuth]
  112. passkeys: [UserPasskey]
  113. hasAvatar: Boolean
  114. isSystem: Boolean
  115. isActive: Boolean
  116. isVerified: Boolean
  117. meta: JSON
  118. prefs: JSON
  119. createdAt: Date
  120. updatedAt: Date
  121. lastLoginAt: Date
  122. groups: [Group]
  123. }
  124. type UserAuth {
  125. authId: UUID
  126. authName: String
  127. strategyKey: String
  128. strategyIcon: String
  129. config: JSON
  130. }
  131. type UserPasskey {
  132. id: String
  133. name: String
  134. createdAt: Date
  135. siteHostname: String
  136. }
  137. type UserDefaults {
  138. timezone: String
  139. dateFormat: String
  140. timeFormat: String
  141. }
  142. type UserTokenResponse {
  143. operation: Operation
  144. jwt: String
  145. }
  146. enum UserOrderBy {
  147. id
  148. email
  149. name
  150. createdAt
  151. updatedAt
  152. lastLoginAt
  153. }
  154. enum UserSiteAppearance {
  155. site
  156. light
  157. dark
  158. }
  159. enum UserCvdChoices {
  160. none
  161. protanopia
  162. deuteranopia
  163. tritanopia
  164. }
  165. input UserUpdateInput {
  166. email: String
  167. name: String
  168. groups: [UUID!]
  169. auth: UserAuthUpdateInput
  170. isActive: Boolean
  171. isVerified: Boolean
  172. meta: JSON
  173. prefs: JSON
  174. }
  175. input UserAuthUpdateInput {
  176. tfaRequired: Boolean
  177. mustChangePwd: Boolean
  178. restrictLogin: Boolean
  179. }