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.

318 lines
6.0 KiB

6 years ago
6 years ago
6 years ago
6 years ago
5 years ago
5 years ago
  1. # ===============================================
  2. # PAGES
  3. # ===============================================
  4. extend type Query {
  5. pages: PageQuery
  6. }
  7. extend type Mutation {
  8. pages: PageMutation
  9. }
  10. # -----------------------------------------------
  11. # QUERIES
  12. # -----------------------------------------------
  13. type PageQuery {
  14. history(
  15. id: Int!
  16. offsetPage: Int
  17. offsetSize: Int
  18. ): PageHistoryResult @auth(requires: ["manage:system", "read:history"])
  19. version(
  20. pageId: Int!
  21. versionId: Int!
  22. ): PageVersion @auth(requires: ["manage:system", "read:history"])
  23. search(
  24. query: String!
  25. path: String
  26. locale: String
  27. ): PageSearchResponse! @auth(requires: ["manage:system", "read:pages"])
  28. list(
  29. limit: Int
  30. orderBy: PageOrderBy
  31. orderByDirection: PageOrderByDirection
  32. tags: [String!]
  33. locale: String
  34. creatorId: Int
  35. authorId: Int
  36. ): [PageListItem!]! @auth(requires: ["manage:system", "read:pages"])
  37. single(
  38. id: Int!
  39. ): Page @auth(requires: ["manage:pages", "delete:pages", "manage:system"])
  40. tags: [PageTag]! @auth(requires: ["manage:system", "read:pages"])
  41. searchTags(
  42. query: String!
  43. ): [String]! @auth(requires: ["manage:system", "read:pages"])
  44. tree(
  45. path: String
  46. parent: Int
  47. mode: PageTreeMode!
  48. locale: String!
  49. includeAncestors: Boolean
  50. ): [PageTreeItem] @auth(requires: ["manage:system", "read:pages"])
  51. links(
  52. locale: String!
  53. ): [PageLinkItem] @auth(requires: ["manage:system", "read:pages"])
  54. checkConflicts(
  55. id: Int!
  56. checkoutDate: Date!
  57. ): Boolean! @auth(requires: ["write:pages", "manage:pages", "manage:system"])
  58. conflictLatest(
  59. id: Int!
  60. ): PageConflictLatest! @auth(requires: ["write:pages", "manage:pages", "manage:system"])
  61. }
  62. # -----------------------------------------------
  63. # MUTATIONS
  64. # -----------------------------------------------
  65. type PageMutation {
  66. create(
  67. content: String!
  68. description: String!
  69. editor: String!
  70. isPublished: Boolean!
  71. isPrivate: Boolean!
  72. locale: String!
  73. path: String!
  74. publishEndDate: Date
  75. publishStartDate: Date
  76. tags: [String]!
  77. title: String!
  78. ): PageResponse @auth(requires: ["write:pages", "manage:pages", "manage:system"])
  79. update(
  80. id: Int!
  81. content: String
  82. description: String
  83. editor: String
  84. isPrivate: Boolean
  85. isPublished: Boolean
  86. locale: String
  87. path: String
  88. publishEndDate: Date
  89. publishStartDate: Date
  90. tags: [String]
  91. title: String
  92. ): PageResponse @auth(requires: ["write:pages", "manage:pages", "manage:system"])
  93. move(
  94. id: Int!
  95. destinationPath: String!
  96. destinationLocale: String!
  97. ): DefaultResponse @auth(requires: ["manage:pages", "manage:system"])
  98. delete(
  99. id: Int!
  100. ): DefaultResponse @auth(requires: ["delete:pages", "manage:system"])
  101. deleteTag(
  102. id: Int!
  103. ): DefaultResponse @auth(requires: ["manage:system"])
  104. updateTag(
  105. id: Int!
  106. tag: String!
  107. title: String!
  108. ): DefaultResponse @auth(requires: ["manage:system"])
  109. flushCache: DefaultResponse @auth(requires: ["manage:system"])
  110. migrateToLocale(
  111. sourceLocale: String!
  112. targetLocale: String!
  113. ): PageMigrationResponse @auth(requires: ["manage:system"])
  114. rebuildTree: DefaultResponse @auth(requires: ["manage:system"])
  115. render(
  116. id: Int!
  117. ): DefaultResponse @auth(requires: ["manage:system"])
  118. restore(
  119. pageId: Int!
  120. versionId: Int!
  121. ): DefaultResponse @auth(requires: ["write:pages", "manage:pages", "manage:system"])
  122. }
  123. # -----------------------------------------------
  124. # TYPES
  125. # -----------------------------------------------
  126. type PageResponse {
  127. responseResult: ResponseStatus!
  128. page: Page
  129. }
  130. type PageMigrationResponse {
  131. responseResult: ResponseStatus!
  132. count: Int
  133. }
  134. type Page {
  135. id: Int!
  136. path: String!
  137. hash: String!
  138. title: String!
  139. description: String!
  140. isPrivate: Boolean!
  141. isPublished: Boolean!
  142. privateNS: String
  143. publishStartDate: Date!
  144. publishEndDate: Date!
  145. tags: [PageTag]!
  146. content: String!
  147. render: String
  148. toc: String
  149. contentType: String!
  150. createdAt: Date!
  151. updatedAt: Date!
  152. editor: String!
  153. locale: String!
  154. authorId: Int!
  155. authorName: String!
  156. authorEmail: String!
  157. creatorId: Int!
  158. creatorName: String!
  159. creatorEmail: String!
  160. }
  161. type PageTag {
  162. id: Int!
  163. tag: String!
  164. title: String
  165. createdAt: Date!
  166. updatedAt: Date!
  167. }
  168. type PageHistory {
  169. versionId: Int!
  170. versionDate: Date!
  171. authorId: Int!
  172. authorName: String!
  173. actionType: String!
  174. valueBefore: String
  175. valueAfter: String
  176. }
  177. type PageVersion {
  178. action: String!
  179. authorId: String!
  180. authorName: String!
  181. content: String!
  182. contentType: String!
  183. createdAt: Date!
  184. versionDate: Date!
  185. description: String!
  186. editor: String!
  187. isPrivate: Boolean!
  188. isPublished: Boolean!
  189. locale: String!
  190. pageId: Int!
  191. path: String!
  192. publishEndDate: Date!
  193. publishStartDate: Date!
  194. tags: [String]!
  195. title: String!
  196. versionId: Int!
  197. }
  198. type PageHistoryResult {
  199. trail: [PageHistory]
  200. total: Int!
  201. }
  202. type PageSearchResponse {
  203. results: [PageSearchResult]!
  204. suggestions: [String]!
  205. totalHits: Int!
  206. }
  207. type PageSearchResult {
  208. id: String!
  209. title: String!
  210. description: String!
  211. path: String!
  212. locale: String!
  213. }
  214. type PageListItem {
  215. id: Int!
  216. path: String!
  217. locale: String!
  218. title: String
  219. description: String
  220. contentType: String!
  221. isPublished: Boolean!
  222. isPrivate: Boolean!
  223. privateNS: String
  224. createdAt: Date!
  225. updatedAt: Date!
  226. tags: [String]
  227. }
  228. type PageTreeItem {
  229. id: Int!
  230. path: String!
  231. depth: Int!
  232. title: String!
  233. isPrivate: Boolean!
  234. isFolder: Boolean!
  235. privateNS: String
  236. parent: Int
  237. pageId: Int
  238. locale: String!
  239. }
  240. type PageLinkItem {
  241. id: Int!
  242. path: String!
  243. title: String!
  244. links: [String]!
  245. }
  246. type PageConflictLatest {
  247. id: Int!
  248. authorId: String!
  249. authorName: String!
  250. content: String!
  251. createdAt: Date!
  252. description: String!
  253. isPublished: Boolean!
  254. locale: String!
  255. path: String!
  256. tags: [String]
  257. title: String!
  258. updatedAt: Date!
  259. }
  260. enum PageOrderBy {
  261. CREATED
  262. ID
  263. PATH
  264. TITLE
  265. UPDATED
  266. }
  267. enum PageOrderByDirection {
  268. ASC
  269. DESC
  270. }
  271. enum PageTreeMode {
  272. FOLDERS
  273. PAGES
  274. ALL
  275. }