page.graphql 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  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. tags(
  101. siteId: UUID!
  102. ): [PageTag]
  103. checkConflicts(
  104. id: Int!
  105. checkoutDate: Date!
  106. ): Boolean
  107. checkConflictsLatest(
  108. id: Int!
  109. ): PageConflictLatest
  110. }
  111. extend type Mutation {
  112. createPage(
  113. alias: String
  114. allowComments: Boolean
  115. allowContributions: Boolean
  116. allowRatings: Boolean
  117. content: String!
  118. description: String!
  119. editor: String!
  120. icon: String
  121. isBrowsable: Boolean
  122. isSearchable: Boolean
  123. locale: String!
  124. path: String!
  125. publishState: PagePublishState!
  126. publishEndDate: Date
  127. publishStartDate: Date
  128. relations: [PageRelationInput!]
  129. scriptCss: String
  130. scriptJsLoad: String
  131. scriptJsUnload: String
  132. showSidebar: Boolean
  133. showTags: Boolean
  134. showToc: Boolean
  135. siteId: UUID!
  136. tags: [String!]
  137. title: String!
  138. tocDepth: PageTocDepthInput
  139. ): PageResponse
  140. updatePage(
  141. id: UUID!
  142. patch: PageUpdateInput!
  143. ): PageResponse
  144. convertPage(
  145. id: UUID!
  146. editor: String!
  147. ): DefaultResponse
  148. renamePage(
  149. id: Int!
  150. destinationPath: String!
  151. destinationLocale: String!
  152. ): DefaultResponse
  153. deletePage(
  154. id: UUID!
  155. ): DefaultResponse
  156. deleteTag(
  157. id: Int!
  158. ): DefaultResponse
  159. updateTag(
  160. id: Int!
  161. tag: String!
  162. title: String!
  163. ): DefaultResponse
  164. flushCache: DefaultResponse
  165. migrateToLocale(
  166. sourceLocale: String!
  167. targetLocale: String!
  168. ): PageMigrationResponse
  169. rebuildPageTree: DefaultResponse
  170. renderPage(
  171. id: Int!
  172. ): DefaultResponse
  173. restorePage(
  174. pageId: Int!
  175. versionId: Int!
  176. ): DefaultResponse
  177. purgePagesHistory (
  178. olderThan: String!
  179. ): DefaultResponse
  180. }
  181. # -----------------------------------------------
  182. # TYPES
  183. # -----------------------------------------------
  184. type PageResponse {
  185. operation: Operation
  186. page: Page
  187. }
  188. type PageMigrationResponse {
  189. operation: Operation
  190. count: Int
  191. }
  192. type Page {
  193. alias: String
  194. allowComments: Boolean
  195. allowContributions: Boolean
  196. allowRatings: Boolean
  197. author: User
  198. content: String
  199. contentType: String
  200. createdAt: Date
  201. creator: User
  202. description: String
  203. editor: String
  204. hash: String
  205. icon: String
  206. id: UUID
  207. isBrowsable: Boolean
  208. isSearchable: Boolean
  209. locale: String
  210. navigationId: UUID
  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: [String]
  226. title: String
  227. toc: [JSON]
  228. tocDepth: PageTocDepth
  229. updatedAt: Date
  230. }
  231. type PageTag {
  232. id: UUID
  233. tag: String
  234. usageCount: Int
  235. siteId: UUID
  236. createdAt: Date
  237. updatedAt: Date
  238. }
  239. type PageHistory {
  240. versionId: Int
  241. versionDate: Date
  242. authorId: Int
  243. authorName: String
  244. actionType: String
  245. valueBefore: String
  246. valueAfter: String
  247. }
  248. type PageVersion {
  249. action: String
  250. authorId: String
  251. authorName: String
  252. content: String
  253. contentType: String
  254. createdAt: Date
  255. versionDate: Date
  256. description: String
  257. editor: String
  258. isPrivate: Boolean
  259. isPublished: Boolean
  260. locale: String
  261. pageId: Int
  262. path: String
  263. publishEndDate: Date
  264. publishStartDate: Date
  265. render: String
  266. tags: [String]
  267. title: String
  268. versionId: Int
  269. }
  270. type PageHistoryResult {
  271. trail: [PageHistory]
  272. total: Int
  273. }
  274. type PageSearchResponse {
  275. results: [PageSearchResult]
  276. totalHits: Int
  277. }
  278. type PageSearchResult {
  279. description: String
  280. highlight: String
  281. icon: String
  282. id: UUID
  283. locale: String
  284. path: String
  285. relevancy: Float
  286. tags: [String]
  287. title: String
  288. updatedAt: Date
  289. }
  290. type PageListItem {
  291. id: Int
  292. path: String
  293. locale: String
  294. title: String
  295. description: String
  296. contentType: String
  297. isPublished: Boolean
  298. isPrivate: Boolean
  299. privateNS: String
  300. createdAt: Date
  301. updatedAt: Date
  302. tags: [String]
  303. }
  304. type PageTreeItem {
  305. id: Int
  306. path: String
  307. depth: Int
  308. title: String
  309. isPrivate: Boolean
  310. isFolder: Boolean
  311. privateNS: String
  312. parent: Int
  313. pageId: Int
  314. locale: String
  315. }
  316. type PageLinkItem {
  317. id: Int
  318. path: String
  319. title: String
  320. links: [String]
  321. }
  322. type PageConflictLatest {
  323. id: Int
  324. authorId: String
  325. authorName: String
  326. content: String
  327. createdAt: Date
  328. description: String
  329. isPublished: Boolean
  330. locale: String
  331. path: String
  332. tags: [String]
  333. title: String
  334. updatedAt: Date
  335. }
  336. type PageRelation {
  337. id: UUID
  338. position: PageRelationPosition
  339. label: String
  340. caption: String
  341. icon: String
  342. target: String
  343. }
  344. input PageRelationInput {
  345. id: UUID!
  346. position: PageRelationPosition!
  347. label: String!
  348. caption: String
  349. icon: String
  350. target: String!
  351. }
  352. input PageUpdateInput {
  353. alias: String
  354. allowComments: Boolean
  355. allowContributions: Boolean
  356. allowRatings: Boolean
  357. content: String
  358. description: String
  359. icon: String
  360. isBrowsable: Boolean
  361. isSearchable: Boolean
  362. password: String
  363. publishEndDate: Date
  364. publishStartDate: Date
  365. publishState: PagePublishState
  366. reasonForChange: String
  367. relations: [PageRelationInput!]
  368. scriptJsLoad: String
  369. scriptJsUnload: String
  370. scriptCss: String
  371. showSidebar: Boolean
  372. showTags: Boolean
  373. showToc: Boolean
  374. tags: [String!]
  375. title: String
  376. tocDepth: PageTocDepthInput
  377. }
  378. type PageAliasPath {
  379. id: UUID
  380. path: String
  381. }
  382. type PageTocDepth {
  383. min: Int
  384. max: Int
  385. }
  386. input PageTocDepthInput {
  387. min: Int!
  388. max: Int!
  389. }
  390. enum PageSearchSort {
  391. relevancy
  392. title
  393. updatedAt
  394. }
  395. enum PageOrderBy {
  396. CREATED
  397. ID
  398. PATH
  399. TITLE
  400. UPDATED
  401. }
  402. enum PageOrderByDirection {
  403. ASC
  404. DESC
  405. }
  406. enum PageTreeMode {
  407. FOLDERS
  408. PAGES
  409. ALL
  410. }
  411. enum PagePublishState {
  412. draft
  413. published
  414. scheduled
  415. }
  416. enum PageRelationPosition {
  417. left
  418. center
  419. right
  420. }