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.

169 lines
3.4 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. resetPassword(
  66. id: Int!
  67. ): DefaultResponse
  68. updateProfile(
  69. name: String!
  70. location: String!
  71. jobTitle: String!
  72. timezone: String!
  73. dateFormat: String!
  74. appearance: String!
  75. ): UserTokenResponse
  76. changePassword(
  77. current: String!
  78. new: String!
  79. ): UserTokenResponse
  80. }
  81. # -----------------------------------------------
  82. # TYPES
  83. # -----------------------------------------------
  84. type UserResponse {
  85. responseResult: ResponseStatus!
  86. user: User
  87. }
  88. type UserLastLogin {
  89. id: Int!
  90. name: String!
  91. lastLoginAt: Date!
  92. }
  93. type UserMinimal {
  94. id: Int!
  95. name: String!
  96. email: String!
  97. providerKey: String!
  98. isSystem: Boolean!
  99. isActive: Boolean!
  100. createdAt: Date!
  101. lastLoginAt: Date
  102. }
  103. type User {
  104. id: Int!
  105. name: String!
  106. email: String!
  107. providerKey: String!
  108. providerId: String
  109. isSystem: Boolean!
  110. isActive: Boolean!
  111. isVerified: Boolean!
  112. location: String!
  113. jobTitle: String!
  114. timezone: String!
  115. dateFormat: String!
  116. appearance: String!
  117. createdAt: Date!
  118. updatedAt: Date!
  119. lastLoginAt: Date
  120. groups: [Group]!
  121. }
  122. type UserProfile {
  123. id: Int!
  124. name: String!
  125. email: String!
  126. providerKey: String
  127. providerName: String
  128. isSystem: Boolean!
  129. isVerified: Boolean!
  130. location: String!
  131. jobTitle: String!
  132. timezone: String!
  133. dateFormat: String!
  134. appearance: String!
  135. createdAt: Date!
  136. updatedAt: Date!
  137. lastLoginAt: Date
  138. groups: [String]!
  139. pagesTotal: Int!
  140. }
  141. type UserTokenResponse {
  142. responseResult: ResponseStatus!
  143. jwt: String
  144. }