page.graphql 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. # ===============================================
  2. # PAGES
  3. # ===============================================
  4. extend type Query {
  5. pageHistoryById(
  6. id: Int!
  7. offsetPage: Int
  8. offsetSize: Int
  9. ): PageHistoryResult
  10. pageVersionById(
  11. pageId: Int!
  12. versionId: Int!
  13. ): PageVersion
  14. searchPages(
  15. """
  16. Site ID to search in (required)
  17. """
  18. siteId: UUID!
  19. """
  20. Search Query (required)
  21. """
  22. query: String!
  23. """
  24. The locale to perform the query as. Affects how the query is parsed by the search engine.
  25. """
  26. queryLocale: String
  27. """
  28. Only match pages that starts with the provided path.
  29. """
  30. path: String
  31. """
  32. Only match pages having one of the provided locales.
  33. """
  34. locale: [String]
  35. """
  36. Only match pages having one of the provided tags.
  37. """
  38. tags: [String]
  39. """
  40. Only match pages using the provided editor.
  41. """
  42. editor: String
  43. """
  44. Only match pages is the provided state.
  45. """
  46. publishState: PagePublishState
  47. """
  48. Result ordering. Defaults to relevancy.
  49. """
  50. orderBy: PageSearchSort
  51. """
  52. Result ordering direction. Defaults to descending.
  53. """
  54. orderByDirection: OrderByDirection
  55. """
  56. Result offset. Defaults to 0.
  57. """
  58. offset: Int
  59. """
  60. Results amount to return. Defaults to 25. Maximum 100.
  61. """
  62. limit: Int
  63. ): PageSearchResponse
  64. searchPagesAutocomplete(
  65. siteId: UUID!
  66. query: String!
  67. ): [String]
  68. pages(
  69. limit: Int
  70. orderBy: PageOrderBy
  71. orderByDirection: PageOrderByDirection
  72. tags: [String!]
  73. locale: String
  74. creatorId: Int
  75. authorId: Int
  76. ): [PageListItem]
  77. pageById(
  78. id: UUID!
  79. password: String
  80. ): Page
  81. pageByPath(
  82. siteId: UUID!
  83. path: String!
  84. password: String
  85. ): Page
  86. pageTree(
  87. path: String
  88. parent: Int
  89. mode: PageTreeMode!
  90. locale: String!
  91. includeAncestors: Boolean
  92. ): [PageTreeItem]
  93. pageLinks(
  94. locale: String!
  95. ): [PageLinkItem]
  96. pathFromAlias(
  97. siteId: UUID!
  98. alias: String!
  99. ): PageAliasPath
  100. searchTags(
  101. query: String!
  102. ): [String]!
  103. tags: [PageTag]!
  104. checkConflicts(
  105. id: Int!
  106. checkoutDate: Date!
  107. ): Boolean!
  108. checkConflictsLatest(
  109. id: Int!
  110. ): PageConflictLatest!
  111. }
  112. extend type Mutation {
  113. createPage(
  114. alias: String
  115. allowComments: Boolean
  116. allowContributions: Boolean
  117. allowRatings: Boolean
  118. content: String!
  119. description: String!
  120. editor: String!
  121. icon: String
  122. isBrowsable: Boolean
  123. isSearchable: Boolean
  124. locale: String!
  125. path: String!
  126. publishState: PagePublishState!
  127. publishEndDate: Date
  128. publishStartDate: Date
  129. relations: [PageRelationInput!]
  130. scriptCss: String
  131. scriptJsLoad: String
  132. scriptJsUnload: String
  133. showSidebar: Boolean
  134. showTags: Boolean
  135. showToc: Boolean
  136. siteId: UUID!
  137. tags: [String!]
  138. title: String!
  139. tocDepth: PageTocDepthInput
  140. ): PageResponse
  141. updatePage(
  142. id: UUID!
  143. patch: PageUpdateInput!
  144. ): PageResponse
  145. convertPage(
  146. id: UUID!
  147. editor: String!
  148. ): DefaultResponse
  149. renamePage(
  150. id: Int!
  151. destinationPath: String!
  152. destinationLocale: String!
  153. ): DefaultResponse
  154. deletePage(
  155. id: UUID!
  156. ): DefaultResponse
  157. deleteTag(
  158. id: Int!
  159. ): DefaultResponse
  160. updateTag(
  161. id: Int!
  162. tag: String!
  163. title: String!
  164. ): DefaultResponse
  165. flushCache: DefaultResponse
  166. migrateToLocale(
  167. sourceLocale: String!
  168. targetLocale: String!
  169. ): PageMigrationResponse
  170. rebuildPageTree: DefaultResponse
  171. renderPage(
  172. id: Int!
  173. ): DefaultResponse
  174. restorePage(
  175. pageId: Int!
  176. versionId: Int!
  177. ): DefaultResponse
  178. purgePagesHistory (
  179. olderThan: String!
  180. ): DefaultResponse
  181. }
  182. # -----------------------------------------------
  183. # TYPES
  184. # -----------------------------------------------
  185. type PageResponse {
  186. operation: Operation
  187. page: Page
  188. }
  189. type PageMigrationResponse {
  190. operation: Operation
  191. count: Int
  192. }
  193. type Page {
  194. alias: String
  195. allowComments: Boolean
  196. allowContributions: Boolean
  197. allowRatings: Boolean
  198. author: User
  199. content: String
  200. contentType: String
  201. createdAt: Date
  202. creator: User
  203. description: String
  204. editor: String
  205. hash: String
  206. icon: String
  207. id: UUID
  208. isBrowsable: Boolean
  209. isSearchable: Boolean
  210. locale: String
  211. password: String
  212. path: String
  213. publishEndDate: Date
  214. publishStartDate: Date
  215. publishState: PagePublishState
  216. relations: [PageRelation]
  217. render: String
  218. scriptJsLoad: String
  219. scriptJsUnload: String
  220. scriptCss: String
  221. showSidebar: Boolean
  222. showTags: Boolean
  223. showToc: Boolean
  224. siteId: UUID
  225. tags: [PageTag]
  226. title: String
  227. toc: [JSON]
  228. tocDepth: PageTocDepth
  229. updatedAt: Date
  230. }
  231. type PageTag {
  232. id: Int
  233. tag: String
  234. title: String
  235. createdAt: Date
  236. updatedAt: Date
  237. }
  238. type PageHistory {
  239. versionId: Int
  240. versionDate: Date
  241. authorId: Int
  242. authorName: String
  243. actionType: String
  244. valueBefore: String
  245. valueAfter: String
  246. }
  247. type PageVersion {
  248. action: String
  249. authorId: String
  250. authorName: String
  251. content: String
  252. contentType: String
  253. createdAt: Date
  254. versionDate: Date
  255. description: String
  256. editor: String
  257. isPrivate: Boolean
  258. isPublished: Boolean
  259. locale: String
  260. pageId: Int
  261. path: String
  262. publishEndDate: Date
  263. publishStartDate: Date
  264. render: String
  265. tags: [String]
  266. title: String
  267. versionId: Int
  268. }
  269. type PageHistoryResult {
  270. trail: [PageHistory]
  271. total: Int
  272. }
  273. type PageSearchResponse {
  274. results: [PageSearchResult]
  275. totalHits: Int
  276. }
  277. type PageSearchResult {
  278. description: String
  279. highlight: String
  280. icon: String
  281. id: UUID
  282. locale: String
  283. path: String
  284. relevancy: Float
  285. tags: [String]
  286. title: String
  287. updatedAt: Date
  288. }
  289. type PageListItem {
  290. id: Int
  291. path: String
  292. locale: String
  293. title: String
  294. description: String
  295. contentType: String
  296. isPublished: Boolean
  297. isPrivate: Boolean
  298. privateNS: String
  299. createdAt: Date
  300. updatedAt: Date
  301. tags: [String]
  302. }
  303. type PageTreeItem {
  304. id: Int
  305. path: String
  306. depth: Int
  307. title: String
  308. isPrivate: Boolean
  309. isFolder: Boolean
  310. privateNS: String
  311. parent: Int
  312. pageId: Int
  313. locale: String
  314. }
  315. type PageLinkItem {
  316. id: Int
  317. path: String
  318. title: String
  319. links: [String]
  320. }
  321. type PageConflictLatest {
  322. id: Int
  323. authorId: String
  324. authorName: String
  325. content: String
  326. createdAt: Date
  327. description: String
  328. isPublished: Boolean
  329. locale: String
  330. path: String
  331. tags: [String]
  332. title: String
  333. updatedAt: Date
  334. }
  335. type PageRelation {
  336. id: UUID
  337. position: PageRelationPosition
  338. label: String
  339. caption: String
  340. icon: String
  341. target: String
  342. }
  343. input PageRelationInput {
  344. id: UUID!
  345. position: PageRelationPosition!
  346. label: String!
  347. caption: String
  348. icon: String
  349. target: String!
  350. }
  351. input PageUpdateInput {
  352. alias: String
  353. allowComments: Boolean
  354. allowContributions: Boolean
  355. allowRatings: Boolean
  356. content: String
  357. description: String
  358. icon: String
  359. isBrowsable: Boolean
  360. isSearchable: Boolean
  361. locale: String
  362. password: String
  363. path: String
  364. publishEndDate: Date
  365. publishStartDate: Date
  366. publishState: PagePublishState
  367. reasonForChange: String
  368. relations: [PageRelationInput!]
  369. scriptJsLoad: String
  370. scriptJsUnload: String
  371. scriptCss: String
  372. showSidebar: Boolean
  373. showTags: Boolean
  374. showToc: Boolean
  375. tags: [String!]
  376. title: String
  377. tocDepth: PageTocDepthInput
  378. }
  379. type PageAliasPath {
  380. id: UUID
  381. path: String
  382. }
  383. type PageTocDepth {
  384. min: Int
  385. max: Int
  386. }
  387. input PageTocDepthInput {
  388. min: Int!
  389. max: Int!
  390. }
  391. enum PageSearchSort {
  392. relevancy
  393. title
  394. updatedAt
  395. }
  396. enum PageOrderBy {
  397. CREATED
  398. ID
  399. PATH
  400. TITLE
  401. UPDATED
  402. }
  403. enum PageOrderByDirection {
  404. ASC
  405. DESC
  406. }
  407. enum PageTreeMode {
  408. FOLDERS
  409. PAGES
  410. ALL
  411. }
  412. enum PagePublishState {
  413. draft
  414. published
  415. scheduled
  416. }
  417. enum PageRelationPosition {
  418. left
  419. center
  420. right
  421. }