user.graphql 3.2 KB

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