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.

252 lines
3.5 KiB

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