page.graphql 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  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. tocDepth: RangeInput
  81. useDefaultTocDepth: Boolean
  82. ): PageResponse @auth(requires: ["write:pages", "manage:pages", "manage:system"])
  83. update(
  84. id: Int!
  85. content: String
  86. description: String
  87. editor: String
  88. isPrivate: Boolean
  89. isPublished: Boolean
  90. locale: String
  91. path: String
  92. publishEndDate: Date
  93. publishStartDate: Date
  94. scriptCss: String
  95. scriptJs: String
  96. tags: [String]
  97. title: String
  98. tocDepth: RangeInput
  99. useDefaultTocDepth: Boolean
  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. tocDepth: Range
  165. useDefaultTocDepth: Boolean
  166. contentType: String
  167. createdAt: Date
  168. updatedAt: Date
  169. editor: String @auth(requires: ["write:pages", "manage:system"])
  170. locale: String
  171. scriptCss: String
  172. scriptJs: String
  173. authorId: Int @auth(requires: ["write:pages", "manage:system"])
  174. authorName: String @auth(requires: ["write:pages", "manage:system"])
  175. authorEmail: String @auth(requires: ["write:pages", "manage:system"])
  176. creatorId: Int @auth(requires: ["write:pages", "manage:system"])
  177. creatorName: String @auth(requires: ["write:pages", "manage:system"])
  178. creatorEmail: String @auth(requires: ["write:pages", "manage:system"])
  179. }
  180. type PageTag {
  181. id: Int!
  182. tag: String!
  183. title: String
  184. createdAt: Date!
  185. updatedAt: Date!
  186. }
  187. type PageHistory {
  188. versionId: Int!
  189. versionDate: Date!
  190. authorId: Int!
  191. authorName: String!
  192. actionType: String!
  193. valueBefore: String
  194. valueAfter: String
  195. }
  196. type PageVersion {
  197. action: String!
  198. authorId: String!
  199. authorName: String!
  200. content: String!
  201. contentType: String!
  202. createdAt: Date!
  203. versionDate: Date!
  204. description: String!
  205. editor: String!
  206. isPrivate: Boolean!
  207. isPublished: Boolean!
  208. locale: String!
  209. pageId: Int!
  210. path: String!
  211. publishEndDate: Date!
  212. publishStartDate: Date!
  213. tags: [String]!
  214. title: String!
  215. versionId: Int!
  216. }
  217. type PageHistoryResult {
  218. trail: [PageHistory]
  219. total: Int!
  220. }
  221. type PageSearchResponse {
  222. results: [PageSearchResult]!
  223. suggestions: [String]!
  224. totalHits: Int!
  225. }
  226. type PageSearchResult {
  227. id: String!
  228. title: String!
  229. description: String!
  230. path: String!
  231. locale: String!
  232. }
  233. type PageListItem {
  234. id: Int!
  235. path: String!
  236. locale: String!
  237. title: String
  238. description: String
  239. contentType: String!
  240. isPublished: Boolean!
  241. isPrivate: Boolean!
  242. privateNS: String
  243. createdAt: Date!
  244. updatedAt: Date!
  245. tags: [String]
  246. }
  247. type PageTreeItem {
  248. id: Int!
  249. path: String!
  250. depth: Int!
  251. title: String!
  252. isPrivate: Boolean!
  253. isFolder: Boolean!
  254. privateNS: String
  255. parent: Int
  256. pageId: Int
  257. locale: String!
  258. }
  259. type PageLinkItem {
  260. id: Int!
  261. path: String!
  262. title: String!
  263. links: [String]!
  264. }
  265. type PageConflictLatest {
  266. id: Int!
  267. authorId: String!
  268. authorName: String!
  269. content: String!
  270. createdAt: Date!
  271. description: String!
  272. isPublished: Boolean!
  273. locale: String!
  274. path: String!
  275. tags: [String]
  276. title: String!
  277. updatedAt: Date!
  278. }
  279. enum PageOrderBy {
  280. CREATED
  281. ID
  282. PATH
  283. TITLE
  284. UPDATED
  285. }
  286. enum PageOrderByDirection {
  287. ASC
  288. DESC
  289. }
  290. enum PageTreeMode {
  291. FOLDERS
  292. PAGES
  293. ALL
  294. }