page.graphql 5.6 KB

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