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.

258 lines
3.6 KiB

  1. # ENUMS
  2. enum FileType {
  3. binary
  4. image
  5. }
  6. enum RightRole {
  7. read
  8. write
  9. manage
  10. }
  11. # DIRECTIVES
  12. directive @auth(requires: [String]) on QUERY | FIELD_DEFINITION | ARGUMENT_DEFINITION
  13. # TYPES
  14. type KeyValuePair {
  15. key: String!
  16. value: String!
  17. }
  18. input KeyValuePairInput {
  19. key: String!
  20. value: String!
  21. }
  22. type DefaultResponse {
  23. responseResult: ResponseStatus
  24. }
  25. type ResponseStatus {
  26. succeeded: Boolean!
  27. errorCode: Int!
  28. slug: String!
  29. message: String
  30. }
  31. type Comment {
  32. id: Int!
  33. createdAt: Date
  34. updatedAt: Date
  35. content: String
  36. document: Document!
  37. author: User!
  38. }
  39. type Document {
  40. id: Int!
  41. createdAt: Date
  42. updatedAt: Date
  43. path: String!
  44. title: String!
  45. subtitle: String
  46. parentPath: String
  47. parentTitle: String
  48. isDirectory: Boolean!
  49. isEntry: Boolean!
  50. searchContent: String
  51. comments: [Comment]
  52. tags: [Tag]
  53. }
  54. type File {
  55. id: Int!
  56. createdAt: Date
  57. updatedAt: Date
  58. category: FileType!
  59. mime: String!
  60. extra: String
  61. filename: String!
  62. basename: String!
  63. filesize: Int!
  64. folder: Folder
  65. }
  66. type Folder {
  67. id: Int!
  68. createdAt: Date
  69. updatedAt: Date
  70. name: String!
  71. files: [File]
  72. }
  73. type Right {
  74. id: Int!
  75. createdAt: Date
  76. updatedAt: Date
  77. path: String!
  78. role: RightRole!
  79. exact: Boolean!
  80. allow: Boolean!
  81. group: Group!
  82. }
  83. type Setting {
  84. id: Int!
  85. createdAt: Date
  86. updatedAt: Date
  87. key: String!
  88. config: String!
  89. }
  90. # Tags are attached to one or more documents
  91. type Tag {
  92. id: Int!
  93. createdAt: Date
  94. updatedAt: Date
  95. key: String!
  96. documents: [Document]
  97. }
  98. type Translation {
  99. key: String!
  100. value: String!
  101. }
  102. type OperationResult {
  103. succeeded: Boolean!
  104. message: String
  105. data: String
  106. }
  107. # Query (Read)
  108. type Query {
  109. comments(id: Int): [Comment]
  110. documents(id: Int, path: String): [Document]
  111. files(id: Int): [File]
  112. folders(id: Int, name: String): [Folder]
  113. rights(id: Int): [Right]
  114. settings(key: String): [Setting]
  115. tags(key: String): [Tag]
  116. translations(locale: String!, namespace: String!): [Translation]
  117. }
  118. # Mutations (Create, Update, Delete)
  119. type Mutation {
  120. addRightToGroup(
  121. groupId: Int!
  122. path: String!
  123. role: RightRole!
  124. exact: Boolean!
  125. allow: Boolean!
  126. ): Right
  127. assignTagToDocument(
  128. tagId: Int!
  129. documentId: Int!
  130. ): OperationResult
  131. createComment(
  132. userId: Int!
  133. documentId: Int!
  134. content: String!
  135. ): Comment
  136. createDocument(
  137. path: String!
  138. title: String!
  139. subtitle: String
  140. ): Document
  141. createFolder(
  142. name: String!
  143. ): Folder
  144. createTag(
  145. name: String!
  146. ): Tag
  147. deleteComment(
  148. id: Int!
  149. ): OperationResult
  150. deleteDocument(
  151. id: Int!
  152. ): OperationResult
  153. deleteFile(
  154. id: Int!
  155. ): OperationResult
  156. deleteFolder(
  157. id: Int!
  158. ): OperationResult
  159. deleteTag(
  160. id: Int!
  161. ): OperationResult
  162. modifyComment(
  163. id: Int!
  164. content: String!
  165. ): Document
  166. modifyDocument(
  167. id: Int!
  168. title: String
  169. subtitle: String
  170. ): Document
  171. modifyRight(
  172. id: Int!
  173. path: String
  174. role: RightRole
  175. exact: Boolean
  176. allow: Boolean
  177. ): Right
  178. moveDocument(
  179. id: Int!
  180. path: String!
  181. ): OperationResult
  182. moveFile(
  183. id: Int!
  184. folderId: Int!
  185. ): OperationResult
  186. renameFile(
  187. id: Int!
  188. name: String!
  189. ): OperationResult
  190. renameFolder(
  191. id: Int!
  192. name: String!
  193. ): OperationResult
  194. renameTag(
  195. id: Int!
  196. key: String!
  197. ): OperationResult
  198. removeTagFromDocument(
  199. tagId: Int!
  200. documentId: Int!
  201. ): OperationResult
  202. removeRightFromGroup(
  203. rightId: Int!
  204. ): OperationResult
  205. setConfigEntry(
  206. key: String!
  207. value: String!
  208. ): OperationResult
  209. uploadFile(
  210. category: FileType!
  211. filename: String!
  212. ): File
  213. }
  214. type Subscription