user.graphql 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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. ): UserResults
  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 UserResults {
  102. users: [UserMinimal]
  103. total: Int
  104. }
  105. type UserMinimal {
  106. id: UUID
  107. name: String
  108. email: String
  109. isSystem: Boolean
  110. isActive: Boolean
  111. createdAt: Date
  112. lastLoginAt: Date
  113. }
  114. type User {
  115. id: UUID
  116. name: String
  117. email: String
  118. auth: [UserAuth]
  119. passkeys: [UserPasskey]
  120. hasAvatar: Boolean
  121. isSystem: Boolean
  122. isActive: Boolean
  123. isVerified: Boolean
  124. meta: JSON
  125. prefs: JSON
  126. createdAt: Date
  127. updatedAt: Date
  128. lastLoginAt: Date
  129. groups: [Group]
  130. }
  131. type UserAuth {
  132. authId: UUID
  133. authName: String
  134. strategyKey: String
  135. strategyIcon: String
  136. config: JSON
  137. }
  138. type UserPasskey {
  139. id: String
  140. name: String
  141. createdAt: Date
  142. siteHostname: String
  143. }
  144. type UserDefaults {
  145. timezone: String
  146. dateFormat: String
  147. timeFormat: String
  148. }
  149. type UserTokenResponse {
  150. operation: Operation
  151. jwt: String
  152. }
  153. enum UserOrderBy {
  154. id
  155. email
  156. name
  157. createdAt
  158. updatedAt
  159. lastLoginAt
  160. }
  161. enum UserSiteAppearance {
  162. site
  163. light
  164. dark
  165. }
  166. enum UserCvdChoices {
  167. none
  168. protanopia
  169. deuteranopia
  170. tritanopia
  171. }
  172. input UserUpdateInput {
  173. email: String
  174. name: String
  175. groups: [UUID!]
  176. auth: UserAuthUpdateInput
  177. isActive: Boolean
  178. isVerified: Boolean
  179. meta: JSON
  180. prefs: JSON
  181. }
  182. input UserAuthUpdateInput {
  183. tfaRequired: Boolean
  184. mustChangePwd: Boolean
  185. restrictLogin: Boolean
  186. }