page.graphql 6.8 KB

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