user.graphql 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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. resetUserPassword(
  57. id: Int!
  58. ): DefaultResponse
  59. updateProfile(
  60. name: String
  61. location: String
  62. jobTitle: String
  63. pronouns: String
  64. timezone: String
  65. dateFormat: String
  66. timeFormat: String
  67. appearance: UserSiteAppearance
  68. cvd: UserCvdChoices
  69. ): DefaultResponse
  70. uploadUserAvatar(
  71. id: UUID!
  72. image: Upload!
  73. ): DefaultResponse
  74. clearUserAvatar(
  75. id: UUID!
  76. ): DefaultResponse
  77. updateUserDefaults(
  78. timezone: String!
  79. dateFormat: String!
  80. timeFormat: String!
  81. ): DefaultResponse
  82. }
  83. # -----------------------------------------------
  84. # TYPES
  85. # -----------------------------------------------
  86. type UserResponse {
  87. operation: Operation
  88. user: User
  89. }
  90. type UserLastLogin {
  91. id: UUID
  92. name: String
  93. lastLoginAt: Date
  94. }
  95. type UserMinimal {
  96. id: UUID
  97. name: String
  98. email: String
  99. isSystem: Boolean
  100. isActive: Boolean
  101. createdAt: Date
  102. lastLoginAt: Date
  103. }
  104. type User {
  105. id: UUID
  106. name: String
  107. email: String
  108. auth: [UserAuth]
  109. hasAvatar: Boolean
  110. isSystem: Boolean
  111. isActive: Boolean
  112. isVerified: Boolean
  113. meta: JSON
  114. prefs: JSON
  115. createdAt: Date
  116. updatedAt: Date
  117. lastLoginAt: Date
  118. groups: [Group]
  119. }
  120. type UserAuth {
  121. authId: UUID
  122. authName: String
  123. strategyKey: String
  124. strategyIcon: String
  125. config: JSON
  126. }
  127. type UserDefaults {
  128. timezone: String
  129. dateFormat: String
  130. timeFormat: String
  131. }
  132. type UserTokenResponse {
  133. operation: Operation
  134. jwt: String
  135. }
  136. enum UserOrderBy {
  137. id
  138. email
  139. name
  140. createdAt
  141. updatedAt
  142. lastLoginAt
  143. }
  144. enum UserSiteAppearance {
  145. site
  146. light
  147. dark
  148. }
  149. enum UserCvdChoices {
  150. none
  151. protanopia
  152. deuteranopia
  153. tritanopia
  154. }
  155. input UserUpdateInput {
  156. email: String
  157. name: String
  158. newPassword: String
  159. groups: [UUID!]
  160. isActive: Boolean
  161. isVerified: Boolean
  162. meta: JSON
  163. prefs: JSON
  164. }