2
0

page.graphql 7.1 KB

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