page.graphql 7.3 KB

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