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.

259 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. # 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 SearchResult {
  82. path: String
  83. title: String
  84. tags: [String]
  85. }
  86. type Setting {
  87. id: Int!
  88. createdAt: Date
  89. updatedAt: Date
  90. key: String!
  91. config: String!
  92. }
  93. # Tags are attached to one or more documents
  94. type Tag {
  95. id: Int!
  96. createdAt: Date
  97. updatedAt: Date
  98. key: String!
  99. documents: [Document]
  100. }
  101. type Translation {
  102. key: String!
  103. value: String!
  104. }
  105. type OperationResult {
  106. succeeded: Boolean!
  107. message: String
  108. data: String
  109. }
  110. # Query (Read)
  111. type Query {
  112. comments(id: Int): [Comment]
  113. documents(id: Int, path: String): [Document]
  114. files(id: Int): [File]
  115. folders(id: Int, name: String): [Folder]
  116. rights(id: Int): [Right]
  117. search(q: String, tags: [String]): [SearchResult]
  118. settings(key: String): [Setting]
  119. tags(key: String): [Tag]
  120. translations(locale: String!, namespace: String!): [Translation]
  121. }
  122. # Mutations (Create, Update, Delete)
  123. type Mutation {
  124. addRightToGroup(
  125. groupId: Int!
  126. path: String!
  127. role: RightRole!
  128. exact: Boolean!
  129. allow: Boolean!
  130. ): Right
  131. assignTagToDocument(
  132. tagId: Int!
  133. documentId: Int!
  134. ): OperationResult
  135. createComment(
  136. userId: Int!
  137. documentId: Int!
  138. content: String!
  139. ): Comment
  140. createDocument(
  141. path: String!
  142. title: String!
  143. subtitle: String
  144. ): Document
  145. createFolder(
  146. name: String!
  147. ): Folder
  148. createTag(
  149. name: String!
  150. ): Tag
  151. deleteComment(
  152. id: Int!
  153. ): OperationResult
  154. deleteDocument(
  155. id: Int!
  156. ): OperationResult
  157. deleteFile(
  158. id: Int!
  159. ): OperationResult
  160. deleteFolder(
  161. id: Int!
  162. ): OperationResult
  163. deleteTag(
  164. id: Int!
  165. ): OperationResult
  166. modifyComment(
  167. id: Int!
  168. content: String!
  169. ): Document
  170. modifyDocument(
  171. id: Int!
  172. title: String
  173. subtitle: String
  174. ): Document
  175. modifyRight(
  176. id: Int!
  177. path: String
  178. role: RightRole
  179. exact: Boolean
  180. allow: Boolean
  181. ): Right
  182. moveDocument(
  183. id: Int!
  184. path: String!
  185. ): OperationResult
  186. moveFile(
  187. id: Int!
  188. folderId: Int!
  189. ): OperationResult
  190. renameFile(
  191. id: Int!
  192. name: String!
  193. ): OperationResult
  194. renameFolder(
  195. id: Int!
  196. name: String!
  197. ): OperationResult
  198. renameTag(
  199. id: Int!
  200. key: String!
  201. ): OperationResult
  202. removeTagFromDocument(
  203. tagId: Int!
  204. documentId: Int!
  205. ): OperationResult
  206. removeRightFromGroup(
  207. rightId: Int!
  208. ): OperationResult
  209. setConfigEntry(
  210. key: String!
  211. value: String!
  212. ): OperationResult
  213. uploadFile(
  214. category: FileType!
  215. filename: String!
  216. ): File
  217. }