You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

328 lines
6.9 KiB

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