page.graphql 4.8 KB

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