You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

180 lines
3.6 KiB

  1. # ===============================================
  2. # USERS
  3. # ===============================================
  4. extend type Query {
  5. users: UserQuery
  6. }
  7. extend type Mutation {
  8. users: UserMutation
  9. }
  10. # -----------------------------------------------
  11. # QUERIES
  12. # -----------------------------------------------
  13. type UserQuery {
  14. list(
  15. filter: String
  16. orderBy: String
  17. ): [UserMinimal] @auth(requires: ["write:users", "manage:users", "manage:system"])
  18. search(
  19. query: String!
  20. ): [UserMinimal] @auth(requires: ["write:groups", "manage:groups", "write:users", "manage:users", "manage:system"])
  21. single(
  22. id: Int!
  23. ): User @auth(requires: ["manage:users", "manage:system"])
  24. profile: UserProfile
  25. lastLogins: [UserLastLogin] @auth(requires: ["write:groups", "manage:groups", "write:users", "manage:users", "manage:system"])
  26. }
  27. # -----------------------------------------------
  28. # MUTATIONS
  29. # -----------------------------------------------
  30. type UserMutation {
  31. create(
  32. email: String!
  33. name: String!
  34. passwordRaw: String
  35. providerKey: String!
  36. groups: [Int]!
  37. mustChangePassword: Boolean
  38. sendWelcomeEmail: Boolean
  39. ): UserResponse @auth(requires: ["write:users", "manage:users", "manage:system"])
  40. update(
  41. id: Int!
  42. email: String
  43. name: String
  44. newPassword: String
  45. groups: [Int]
  46. location: String
  47. jobTitle: String
  48. timezone: String
  49. dateFormat: String
  50. appearance: String
  51. ): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
  52. delete(
  53. id: Int!
  54. replaceId: Int!
  55. ): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
  56. verify(
  57. id: Int!
  58. ): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
  59. activate(
  60. id: Int!
  61. ): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
  62. deactivate(
  63. id: Int!
  64. ): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
  65. enableTFA(
  66. id: Int!
  67. ): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
  68. disableTFA(
  69. id: Int!
  70. ): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
  71. resetPassword(
  72. id: Int!
  73. ): DefaultResponse
  74. updateProfile(
  75. name: String!
  76. location: String!
  77. jobTitle: String!
  78. timezone: String!
  79. dateFormat: String!
  80. appearance: String!
  81. ): UserTokenResponse
  82. changePassword(
  83. current: String!
  84. new: String!
  85. ): UserTokenResponse
  86. }
  87. # -----------------------------------------------
  88. # TYPES
  89. # -----------------------------------------------
  90. type UserResponse {
  91. responseResult: ResponseStatus!
  92. user: User
  93. }
  94. type UserLastLogin {
  95. id: Int!
  96. name: String!
  97. lastLoginAt: Date!
  98. }
  99. type UserMinimal {
  100. id: Int!
  101. name: String!
  102. email: String!
  103. providerKey: String!
  104. isSystem: Boolean!
  105. isActive: Boolean!
  106. createdAt: Date!
  107. lastLoginAt: Date
  108. }
  109. type User {
  110. id: Int!
  111. name: String!
  112. email: String!
  113. providerKey: String!
  114. providerName: String
  115. providerId: String
  116. providerIs2FACapable: Boolean
  117. isSystem: Boolean!
  118. isActive: Boolean!
  119. isVerified: Boolean!
  120. location: String!
  121. jobTitle: String!
  122. timezone: String!
  123. dateFormat: String!
  124. appearance: String!
  125. createdAt: Date!
  126. updatedAt: Date!
  127. lastLoginAt: Date
  128. tfaIsActive: Boolean!
  129. groups: [Group]!
  130. }
  131. type UserProfile {
  132. id: Int!
  133. name: String!
  134. email: String!
  135. providerKey: String
  136. providerName: String
  137. isSystem: Boolean!
  138. isVerified: Boolean!
  139. location: String!
  140. jobTitle: String!
  141. timezone: String!
  142. dateFormat: String!
  143. appearance: String!
  144. createdAt: Date!
  145. updatedAt: Date!
  146. lastLoginAt: Date
  147. groups: [String]!
  148. pagesTotal: Int!
  149. }
  150. type UserTokenResponse {
  151. responseResult: ResponseStatus!
  152. jwt: String
  153. }