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.

158 lines
3.1 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. ): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
  50. delete(
  51. id: Int!
  52. ): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
  53. verify(
  54. id: Int!
  55. ): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
  56. activate(
  57. id: Int!
  58. ): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
  59. deactivate(
  60. id: Int!
  61. ): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
  62. resetPassword(
  63. id: Int!
  64. ): DefaultResponse
  65. updateProfile(
  66. name: String!
  67. location: String!
  68. jobTitle: String!
  69. timezone: String!
  70. ): UserTokenResponse
  71. changePassword(
  72. current: String!
  73. new: String!
  74. ): UserTokenResponse
  75. }
  76. # -----------------------------------------------
  77. # TYPES
  78. # -----------------------------------------------
  79. type UserResponse {
  80. responseResult: ResponseStatus!
  81. user: User
  82. }
  83. type UserLastLogin {
  84. id: Int!
  85. name: String!
  86. lastLoginAt: Date!
  87. }
  88. type UserMinimal {
  89. id: Int!
  90. name: String!
  91. email: String!
  92. providerKey: String!
  93. isSystem: Boolean!
  94. createdAt: Date!
  95. }
  96. type User {
  97. id: Int!
  98. name: String!
  99. email: String!
  100. providerKey: String!
  101. providerId: String
  102. isSystem: Boolean!
  103. isActive: Boolean!
  104. isVerified: Boolean!
  105. location: String!
  106. jobTitle: String!
  107. timezone: String!
  108. createdAt: Date!
  109. updatedAt: Date!
  110. lastLoginAt: Date
  111. groups: [Group]!
  112. }
  113. type UserProfile {
  114. id: Int!
  115. name: String!
  116. email: String!
  117. providerKey: String
  118. providerName: String
  119. isSystem: Boolean!
  120. isVerified: Boolean!
  121. location: String!
  122. jobTitle: String!
  123. timezone: String!
  124. createdAt: Date!
  125. updatedAt: Date!
  126. lastLoginAt: Date
  127. groups: [String]!
  128. pagesTotal: Int!
  129. }
  130. type UserTokenResponse {
  131. responseResult: ResponseStatus!
  132. jwt: String
  133. }