page.graphql 6.0 KB

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