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.

136 lines
2.0 KiB

  1. # SCALARS
  2. scalar Date
  3. # ENUMS
  4. enum UserRole {
  5. guest
  6. user
  7. admin
  8. }
  9. enum FileType {
  10. binary
  11. image
  12. }
  13. enum RightRole {
  14. read
  15. write
  16. manage
  17. }
  18. # INTERFACES
  19. interface Base {
  20. id: Int!
  21. createdOn: Date
  22. updatedOn: Date
  23. }
  24. # TYPES
  25. type Comment implements Base {
  26. id: Int!
  27. createdOn: Date
  28. updatedOn: Date
  29. content: String
  30. document: Document!
  31. author: User!
  32. }
  33. type Document implements Base {
  34. id: Int!
  35. createdOn: Date
  36. updatedOn: Date
  37. path: String!
  38. title: String!
  39. subtitle: String
  40. parentPath: String
  41. parentTitle: String
  42. isDirectory: Boolean!
  43. isEntry: Boolean!
  44. searchContent: String
  45. tags: [Tag]
  46. }
  47. type File implements Base {
  48. id: Int!
  49. createdOn: Date
  50. updatedOn: Date
  51. category: FileType!
  52. mime: String!
  53. extra: String
  54. filename: String!
  55. basename: String!
  56. filesize: Int!
  57. folder: Folder
  58. }
  59. type Folder implements Base {
  60. id: Int!
  61. createdOn: Date
  62. updatedOn: Date
  63. name: String!
  64. }
  65. type Group implements Base {
  66. id: Int!
  67. createdOn: Date
  68. updatedOn: Date
  69. name: String!
  70. users: [User]
  71. rights: [Right]
  72. }
  73. type Right implements Base {
  74. id: Int!
  75. createdOn: Date
  76. updatedOn: Date
  77. path: String!
  78. role: RightRole!
  79. exact: Boolean!
  80. allow: Boolean!
  81. }
  82. type Setting implements Base {
  83. id: Int!
  84. createdOn: Date
  85. updatedOn: Date
  86. key: String!
  87. config: String!
  88. }
  89. type Tag implements Base {
  90. id: Int!
  91. createdOn: Date
  92. updatedOn: Date
  93. key: String!
  94. }
  95. type User implements Base {
  96. id: Int!
  97. createdOn: Date
  98. updatedOn: Date
  99. email: String!
  100. provider: String
  101. providerId: String
  102. name: String
  103. role: UserRole!
  104. groups: [Group]
  105. }
  106. # QUERY
  107. type Query {
  108. comments(id: Int): [Comment]
  109. documents(id: Int, path: String): [Document]
  110. files(id: Int): [File]
  111. folders(id: Int, name: String): [Folder]
  112. groups(id: Int, name: String): [Group]
  113. rights(id: Int): [Right]
  114. settings(key: String): [Setting]
  115. tags(key: String): [Tag]
  116. users(id: Int, email: String, provider: String, providerId: String, role: UserRole): [User]
  117. }