page.graphql 5.5 KB

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