user.graphql 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. lastLogins: [UserLastLogin]
  17. }
  18. extend type Mutation {
  19. createUser(
  20. email: String!
  21. name: String!
  22. password: String!
  23. groups: [UUID]!
  24. mustChangePassword: Boolean!
  25. sendWelcomeEmail: Boolean!
  26. ): UserResponse
  27. updateUser(
  28. id: UUID!
  29. patch: UserUpdateInput!
  30. ): DefaultResponse
  31. deleteUser(
  32. id: UUID!
  33. replaceId: UUID!
  34. ): DefaultResponse
  35. verifyUser(
  36. id: UUID!
  37. ): DefaultResponse
  38. activateUser(
  39. id: UUID!
  40. ): DefaultResponse
  41. deactivateUser(
  42. id: UUID!
  43. ): DefaultResponse
  44. enableUserTFA(
  45. id: UUID!
  46. ): DefaultResponse
  47. disableUserTFA(
  48. id: UUID!
  49. ): DefaultResponse
  50. resetUserPassword(
  51. id: Int!
  52. ): DefaultResponse
  53. updateProfile(
  54. name: String
  55. location: String
  56. jobTitle: String
  57. pronouns: String
  58. timezone: String
  59. dateFormat: String
  60. timeFormat: String
  61. appearance: UserSiteAppearance
  62. ): DefaultResponse
  63. }
  64. # -----------------------------------------------
  65. # TYPES
  66. # -----------------------------------------------
  67. type UserResponse {
  68. operation: Operation
  69. user: User
  70. }
  71. type UserLastLogin {
  72. id: UUID
  73. name: String
  74. lastLoginAt: Date
  75. }
  76. type UserMinimal {
  77. id: UUID
  78. name: String
  79. email: String
  80. isSystem: Boolean
  81. isActive: Boolean
  82. createdAt: Date
  83. lastLoginAt: Date
  84. }
  85. type User {
  86. id: UUID
  87. name: String
  88. email: String
  89. auth: JSON
  90. isSystem: Boolean
  91. isActive: Boolean
  92. isVerified: Boolean
  93. meta: JSON
  94. prefs: JSON
  95. pictureUrl: String
  96. createdAt: Date
  97. updatedAt: Date
  98. lastLoginAt: Date
  99. groups: [Group]
  100. }
  101. type UserTokenResponse {
  102. operation: Operation
  103. jwt: String
  104. }
  105. enum UserOrderBy {
  106. id
  107. email
  108. name
  109. createdAt
  110. updatedAt
  111. lastLoginAt
  112. }
  113. enum UserSiteAppearance {
  114. site
  115. light
  116. dark
  117. }
  118. input UserUpdateInput {
  119. email: String
  120. name: String
  121. newPassword: String
  122. groups: [UUID!]
  123. isActive: Boolean
  124. isVerified: Boolean
  125. meta: JSON
  126. prefs: JSON
  127. }