openapi.json 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016
  1. {
  2. "openapi": "3.0.3",
  3. "info": {
  4. "title": "theming",
  5. "version": "0.0.1",
  6. "description": "Adjust the Nextcloud theme",
  7. "license": {
  8. "name": "agpl"
  9. }
  10. },
  11. "components": {
  12. "securitySchemes": {
  13. "basic_auth": {
  14. "type": "http",
  15. "scheme": "basic"
  16. },
  17. "bearer_auth": {
  18. "type": "http",
  19. "scheme": "bearer"
  20. }
  21. },
  22. "schemas": {
  23. "Background": {
  24. "type": "object",
  25. "required": [
  26. "backgroundImage",
  27. "backgroundColor",
  28. "version"
  29. ],
  30. "properties": {
  31. "backgroundImage": {
  32. "type": "string",
  33. "nullable": true
  34. },
  35. "backgroundColor": {
  36. "type": "string"
  37. },
  38. "version": {
  39. "type": "integer",
  40. "format": "int64"
  41. }
  42. }
  43. },
  44. "OCSMeta": {
  45. "type": "object",
  46. "required": [
  47. "status",
  48. "statuscode"
  49. ],
  50. "properties": {
  51. "status": {
  52. "type": "string"
  53. },
  54. "statuscode": {
  55. "type": "integer"
  56. },
  57. "message": {
  58. "type": "string"
  59. },
  60. "totalitems": {
  61. "type": "string"
  62. },
  63. "itemsperpage": {
  64. "type": "string"
  65. }
  66. }
  67. },
  68. "PublicCapabilities": {
  69. "type": "object",
  70. "required": [
  71. "theming"
  72. ],
  73. "properties": {
  74. "theming": {
  75. "type": "object",
  76. "required": [
  77. "name",
  78. "url",
  79. "slogan",
  80. "color",
  81. "color-text",
  82. "color-element",
  83. "color-element-bright",
  84. "color-element-dark",
  85. "logo",
  86. "background",
  87. "background-plain",
  88. "background-default",
  89. "logoheader",
  90. "favicon"
  91. ],
  92. "properties": {
  93. "name": {
  94. "type": "string"
  95. },
  96. "url": {
  97. "type": "string"
  98. },
  99. "slogan": {
  100. "type": "string"
  101. },
  102. "color": {
  103. "type": "string"
  104. },
  105. "color-text": {
  106. "type": "string"
  107. },
  108. "color-element": {
  109. "type": "string"
  110. },
  111. "color-element-bright": {
  112. "type": "string"
  113. },
  114. "color-element-dark": {
  115. "type": "string"
  116. },
  117. "logo": {
  118. "type": "string"
  119. },
  120. "background": {
  121. "type": "string"
  122. },
  123. "background-plain": {
  124. "type": "boolean"
  125. },
  126. "background-default": {
  127. "type": "boolean"
  128. },
  129. "logoheader": {
  130. "type": "string"
  131. },
  132. "favicon": {
  133. "type": "string"
  134. }
  135. }
  136. }
  137. }
  138. }
  139. }
  140. },
  141. "paths": {
  142. "/index.php/apps/theming/theme/{themeId}.css": {
  143. "get": {
  144. "operationId": "theming-get-theme-stylesheet",
  145. "summary": "Get the CSS stylesheet for a theme",
  146. "tags": [
  147. "theming"
  148. ],
  149. "security": [
  150. {},
  151. {
  152. "bearer_auth": []
  153. },
  154. {
  155. "basic_auth": []
  156. }
  157. ],
  158. "parameters": [
  159. {
  160. "name": "plain",
  161. "in": "query",
  162. "description": "Let the browser decide the CSS priority",
  163. "schema": {
  164. "type": "integer",
  165. "default": 0
  166. }
  167. },
  168. {
  169. "name": "withCustomCss",
  170. "in": "query",
  171. "description": "Include custom CSS",
  172. "schema": {
  173. "type": "integer",
  174. "default": 0
  175. }
  176. },
  177. {
  178. "name": "themeId",
  179. "in": "path",
  180. "description": "ID of the theme",
  181. "required": true,
  182. "schema": {
  183. "type": "string"
  184. }
  185. }
  186. ],
  187. "responses": {
  188. "200": {
  189. "description": "Stylesheet returned",
  190. "headers": {
  191. "Content-Disposition": {
  192. "schema": {
  193. "type": "string"
  194. }
  195. }
  196. },
  197. "content": {
  198. "text/css": {
  199. "schema": {
  200. "type": "string",
  201. "format": "binary"
  202. }
  203. }
  204. }
  205. },
  206. "404": {
  207. "description": "Theme not found",
  208. "content": {
  209. "text/html": {
  210. "schema": {
  211. "type": "string"
  212. }
  213. }
  214. }
  215. }
  216. }
  217. }
  218. },
  219. "/index.php/apps/theming/image/{key}": {
  220. "get": {
  221. "operationId": "theming-get-image",
  222. "summary": "Get an image",
  223. "tags": [
  224. "theming"
  225. ],
  226. "security": [
  227. {},
  228. {
  229. "bearer_auth": []
  230. },
  231. {
  232. "basic_auth": []
  233. }
  234. ],
  235. "parameters": [
  236. {
  237. "name": "useSvg",
  238. "in": "query",
  239. "description": "Return image as SVG",
  240. "schema": {
  241. "type": "integer",
  242. "default": 1
  243. }
  244. },
  245. {
  246. "name": "key",
  247. "in": "path",
  248. "description": "Key of the image",
  249. "required": true,
  250. "schema": {
  251. "type": "string"
  252. }
  253. }
  254. ],
  255. "responses": {
  256. "200": {
  257. "description": "Image returned",
  258. "headers": {
  259. "Content-Disposition": {
  260. "schema": {
  261. "type": "string"
  262. }
  263. }
  264. },
  265. "content": {
  266. "*/*": {
  267. "schema": {
  268. "type": "string",
  269. "format": "binary"
  270. }
  271. }
  272. }
  273. },
  274. "404": {
  275. "description": "Image not found",
  276. "content": {
  277. "text/html": {
  278. "schema": {
  279. "type": "string"
  280. }
  281. }
  282. }
  283. },
  284. "500": {
  285. "description": "",
  286. "content": {
  287. "text/plain": {
  288. "schema": {
  289. "type": "string"
  290. }
  291. }
  292. }
  293. }
  294. }
  295. }
  296. },
  297. "/index.php/apps/theming/manifest/{app}": {
  298. "get": {
  299. "operationId": "theming-get-manifest",
  300. "summary": "Get the manifest for an app",
  301. "tags": [
  302. "theming"
  303. ],
  304. "security": [
  305. {},
  306. {
  307. "bearer_auth": []
  308. },
  309. {
  310. "basic_auth": []
  311. }
  312. ],
  313. "parameters": [
  314. {
  315. "name": "app",
  316. "in": "path",
  317. "description": "ID of the app",
  318. "required": true,
  319. "schema": {
  320. "type": "string"
  321. }
  322. }
  323. ],
  324. "responses": {
  325. "200": {
  326. "description": "",
  327. "content": {
  328. "application/json": {
  329. "schema": {
  330. "type": "object",
  331. "required": [
  332. "name",
  333. "short_name",
  334. "start_url",
  335. "theme_color",
  336. "background_color",
  337. "description",
  338. "icons",
  339. "display"
  340. ],
  341. "properties": {
  342. "name": {
  343. "type": "string"
  344. },
  345. "short_name": {
  346. "type": "string"
  347. },
  348. "start_url": {
  349. "type": "string"
  350. },
  351. "theme_color": {
  352. "type": "string"
  353. },
  354. "background_color": {
  355. "type": "string"
  356. },
  357. "description": {
  358. "type": "string"
  359. },
  360. "icons": {
  361. "type": "array",
  362. "items": {
  363. "type": "object",
  364. "required": [
  365. "src",
  366. "type",
  367. "sizes"
  368. ],
  369. "properties": {
  370. "src": {
  371. "type": "string"
  372. },
  373. "type": {
  374. "type": "string"
  375. },
  376. "sizes": {
  377. "type": "string"
  378. }
  379. }
  380. }
  381. },
  382. "display": {
  383. "type": "string"
  384. }
  385. }
  386. }
  387. }
  388. }
  389. },
  390. "404": {
  391. "description": "App not found",
  392. "content": {
  393. "application/json": {
  394. "schema": {
  395. "type": "object"
  396. }
  397. }
  398. }
  399. }
  400. }
  401. }
  402. },
  403. "/index.php/apps/theming/favicon/{app}": {
  404. "get": {
  405. "operationId": "icon-get-favicon",
  406. "summary": "Return a 32x32 favicon as png",
  407. "tags": [
  408. "icon"
  409. ],
  410. "security": [
  411. {},
  412. {
  413. "bearer_auth": []
  414. },
  415. {
  416. "basic_auth": []
  417. }
  418. ],
  419. "parameters": [
  420. {
  421. "name": "app",
  422. "in": "path",
  423. "description": "ID of the app",
  424. "required": true,
  425. "schema": {
  426. "type": "string",
  427. "default": "core"
  428. }
  429. }
  430. ],
  431. "responses": {
  432. "200": {
  433. "description": "Favicon returned",
  434. "headers": {
  435. "Content-Disposition": {
  436. "schema": {
  437. "type": "string"
  438. }
  439. }
  440. },
  441. "content": {
  442. "image/x-icon": {
  443. "schema": {
  444. "type": "string",
  445. "format": "binary"
  446. }
  447. }
  448. }
  449. },
  450. "404": {
  451. "description": "Favicon not found",
  452. "content": {
  453. "text/html": {
  454. "schema": {
  455. "type": "string"
  456. }
  457. }
  458. }
  459. },
  460. "500": {
  461. "description": "",
  462. "content": {
  463. "text/plain": {
  464. "schema": {
  465. "type": "string"
  466. }
  467. }
  468. }
  469. }
  470. }
  471. }
  472. },
  473. "/index.php/apps/theming/icon/{app}": {
  474. "get": {
  475. "operationId": "icon-get-touch-icon",
  476. "summary": "Return a 512x512 icon for touch devices",
  477. "tags": [
  478. "icon"
  479. ],
  480. "security": [
  481. {},
  482. {
  483. "bearer_auth": []
  484. },
  485. {
  486. "basic_auth": []
  487. }
  488. ],
  489. "parameters": [
  490. {
  491. "name": "app",
  492. "in": "path",
  493. "description": "ID of the app",
  494. "required": true,
  495. "schema": {
  496. "type": "string",
  497. "default": "core"
  498. }
  499. }
  500. ],
  501. "responses": {
  502. "200": {
  503. "description": "Touch icon returned",
  504. "headers": {
  505. "Content-Disposition": {
  506. "schema": {
  507. "type": "string"
  508. }
  509. }
  510. },
  511. "content": {
  512. "image/png": {
  513. "schema": {
  514. "type": "string",
  515. "format": "binary"
  516. }
  517. },
  518. "image/x-icon": {
  519. "schema": {
  520. "type": "string",
  521. "format": "binary"
  522. }
  523. }
  524. }
  525. },
  526. "404": {
  527. "description": "Touch icon not found",
  528. "content": {
  529. "text/html": {
  530. "schema": {
  531. "type": "string"
  532. }
  533. }
  534. }
  535. },
  536. "500": {
  537. "description": "",
  538. "content": {
  539. "text/plain": {
  540. "schema": {
  541. "type": "string"
  542. }
  543. }
  544. }
  545. }
  546. }
  547. }
  548. },
  549. "/index.php/apps/theming/img/{app}/{image}": {
  550. "get": {
  551. "operationId": "icon-get-themed-icon",
  552. "summary": "Get a themed icon",
  553. "tags": [
  554. "icon"
  555. ],
  556. "security": [
  557. {},
  558. {
  559. "bearer_auth": []
  560. },
  561. {
  562. "basic_auth": []
  563. }
  564. ],
  565. "parameters": [
  566. {
  567. "name": "app",
  568. "in": "path",
  569. "description": "ID of the app",
  570. "required": true,
  571. "schema": {
  572. "type": "string"
  573. }
  574. },
  575. {
  576. "name": "image",
  577. "in": "path",
  578. "description": "image file name (svg required)",
  579. "required": true,
  580. "schema": {
  581. "type": "string",
  582. "pattern": "^.+$"
  583. }
  584. }
  585. ],
  586. "responses": {
  587. "200": {
  588. "description": "Themed icon returned",
  589. "headers": {
  590. "Content-Disposition": {
  591. "schema": {
  592. "type": "string"
  593. }
  594. }
  595. },
  596. "content": {
  597. "image/svg+xml": {
  598. "schema": {
  599. "type": "string",
  600. "format": "binary"
  601. }
  602. }
  603. }
  604. },
  605. "404": {
  606. "description": "Themed icon not found",
  607. "content": {
  608. "text/html": {
  609. "schema": {
  610. "type": "string"
  611. }
  612. }
  613. }
  614. },
  615. "500": {
  616. "description": "",
  617. "content": {
  618. "text/plain": {
  619. "schema": {
  620. "type": "string"
  621. }
  622. }
  623. }
  624. }
  625. }
  626. }
  627. },
  628. "/index.php/apps/theming/background": {
  629. "get": {
  630. "operationId": "user_theme-get-background",
  631. "summary": "Get the background image",
  632. "tags": [
  633. "user_theme"
  634. ],
  635. "security": [
  636. {
  637. "bearer_auth": []
  638. },
  639. {
  640. "basic_auth": []
  641. }
  642. ],
  643. "parameters": [
  644. {
  645. "name": "OCS-APIRequest",
  646. "in": "header",
  647. "required": true,
  648. "schema": {
  649. "type": "string",
  650. "default": "true"
  651. }
  652. }
  653. ],
  654. "responses": {
  655. "200": {
  656. "description": "Background image returned",
  657. "headers": {
  658. "Content-Disposition": {
  659. "schema": {
  660. "type": "string"
  661. }
  662. }
  663. },
  664. "content": {
  665. "*/*": {
  666. "schema": {
  667. "type": "string",
  668. "format": "binary"
  669. }
  670. }
  671. }
  672. },
  673. "404": {
  674. "description": "Background image not found",
  675. "content": {
  676. "text/html": {
  677. "schema": {
  678. "type": "string"
  679. }
  680. }
  681. }
  682. }
  683. }
  684. }
  685. },
  686. "/index.php/apps/theming/background/{type}": {
  687. "post": {
  688. "operationId": "user_theme-set-background",
  689. "summary": "Set the background",
  690. "tags": [
  691. "user_theme"
  692. ],
  693. "security": [
  694. {
  695. "bearer_auth": []
  696. },
  697. {
  698. "basic_auth": []
  699. }
  700. ],
  701. "parameters": [
  702. {
  703. "name": "value",
  704. "in": "query",
  705. "description": "Path of the background image",
  706. "schema": {
  707. "type": "string",
  708. "default": ""
  709. }
  710. },
  711. {
  712. "name": "color",
  713. "in": "query",
  714. "description": "Color for the background",
  715. "schema": {
  716. "type": "string",
  717. "nullable": true
  718. }
  719. },
  720. {
  721. "name": "type",
  722. "in": "path",
  723. "description": "Type of background",
  724. "required": true,
  725. "schema": {
  726. "type": "string"
  727. }
  728. },
  729. {
  730. "name": "OCS-APIRequest",
  731. "in": "header",
  732. "required": true,
  733. "schema": {
  734. "type": "string",
  735. "default": "true"
  736. }
  737. }
  738. ],
  739. "responses": {
  740. "200": {
  741. "description": "Background set successfully",
  742. "content": {
  743. "application/json": {
  744. "schema": {
  745. "$ref": "#/components/schemas/Background"
  746. }
  747. }
  748. }
  749. },
  750. "400": {
  751. "description": "Setting background is not possible",
  752. "content": {
  753. "application/json": {
  754. "schema": {
  755. "type": "object",
  756. "required": [
  757. "error"
  758. ],
  759. "properties": {
  760. "error": {
  761. "type": "string"
  762. }
  763. }
  764. }
  765. }
  766. }
  767. },
  768. "500": {
  769. "description": "",
  770. "content": {
  771. "application/json": {
  772. "schema": {
  773. "type": "object",
  774. "required": [
  775. "error"
  776. ],
  777. "properties": {
  778. "error": {
  779. "type": "string"
  780. }
  781. }
  782. }
  783. }
  784. }
  785. }
  786. }
  787. }
  788. },
  789. "/index.php/apps/theming/background/custom": {
  790. "delete": {
  791. "operationId": "user_theme-delete-background",
  792. "summary": "Delete the background",
  793. "tags": [
  794. "user_theme"
  795. ],
  796. "security": [
  797. {
  798. "bearer_auth": []
  799. },
  800. {
  801. "basic_auth": []
  802. }
  803. ],
  804. "parameters": [
  805. {
  806. "name": "OCS-APIRequest",
  807. "in": "header",
  808. "required": true,
  809. "schema": {
  810. "type": "string",
  811. "default": "true"
  812. }
  813. }
  814. ],
  815. "responses": {
  816. "200": {
  817. "description": "",
  818. "content": {
  819. "application/json": {
  820. "schema": {
  821. "$ref": "#/components/schemas/Background"
  822. }
  823. }
  824. }
  825. }
  826. }
  827. }
  828. },
  829. "/ocs/v2.php/apps/theming/api/v1/theme/{themeId}/enable": {
  830. "put": {
  831. "operationId": "user_theme-enable-theme",
  832. "summary": "Enable theme",
  833. "tags": [
  834. "user_theme"
  835. ],
  836. "security": [
  837. {
  838. "bearer_auth": []
  839. },
  840. {
  841. "basic_auth": []
  842. }
  843. ],
  844. "parameters": [
  845. {
  846. "name": "themeId",
  847. "in": "path",
  848. "description": "the theme ID",
  849. "required": true,
  850. "schema": {
  851. "type": "string"
  852. }
  853. },
  854. {
  855. "name": "OCS-APIRequest",
  856. "in": "header",
  857. "required": true,
  858. "schema": {
  859. "type": "string",
  860. "default": "true"
  861. }
  862. }
  863. ],
  864. "responses": {
  865. "200": {
  866. "description": "Theme enabled successfully",
  867. "content": {
  868. "application/json": {
  869. "schema": {
  870. "type": "object",
  871. "required": [
  872. "ocs"
  873. ],
  874. "properties": {
  875. "ocs": {
  876. "type": "object",
  877. "required": [
  878. "meta",
  879. "data"
  880. ],
  881. "properties": {
  882. "meta": {
  883. "$ref": "#/components/schemas/OCSMeta"
  884. },
  885. "data": {
  886. "type": "object",
  887. "additionalProperties": true
  888. }
  889. }
  890. }
  891. }
  892. }
  893. }
  894. }
  895. },
  896. "400": {
  897. "description": "Enabling theme is not possible",
  898. "content": {
  899. "text/plain": {
  900. "schema": {
  901. "type": "string"
  902. }
  903. }
  904. }
  905. },
  906. "500": {
  907. "description": "",
  908. "content": {
  909. "text/plain": {
  910. "schema": {
  911. "type": "string"
  912. }
  913. }
  914. }
  915. }
  916. }
  917. }
  918. },
  919. "/ocs/v2.php/apps/theming/api/v1/theme/{themeId}": {
  920. "delete": {
  921. "operationId": "user_theme-disable-theme",
  922. "summary": "Disable theme",
  923. "tags": [
  924. "user_theme"
  925. ],
  926. "security": [
  927. {
  928. "bearer_auth": []
  929. },
  930. {
  931. "basic_auth": []
  932. }
  933. ],
  934. "parameters": [
  935. {
  936. "name": "themeId",
  937. "in": "path",
  938. "description": "the theme ID",
  939. "required": true,
  940. "schema": {
  941. "type": "string"
  942. }
  943. },
  944. {
  945. "name": "OCS-APIRequest",
  946. "in": "header",
  947. "required": true,
  948. "schema": {
  949. "type": "string",
  950. "default": "true"
  951. }
  952. }
  953. ],
  954. "responses": {
  955. "200": {
  956. "description": "Theme disabled successfully",
  957. "content": {
  958. "application/json": {
  959. "schema": {
  960. "type": "object",
  961. "required": [
  962. "ocs"
  963. ],
  964. "properties": {
  965. "ocs": {
  966. "type": "object",
  967. "required": [
  968. "meta",
  969. "data"
  970. ],
  971. "properties": {
  972. "meta": {
  973. "$ref": "#/components/schemas/OCSMeta"
  974. },
  975. "data": {
  976. "type": "object",
  977. "additionalProperties": true
  978. }
  979. }
  980. }
  981. }
  982. }
  983. }
  984. }
  985. },
  986. "400": {
  987. "description": "Disabling theme is not possible",
  988. "content": {
  989. "text/plain": {
  990. "schema": {
  991. "type": "string"
  992. }
  993. }
  994. }
  995. },
  996. "500": {
  997. "description": "",
  998. "content": {
  999. "text/plain": {
  1000. "schema": {
  1001. "type": "string"
  1002. }
  1003. }
  1004. }
  1005. }
  1006. }
  1007. }
  1008. }
  1009. },
  1010. "tags": [
  1011. {
  1012. "name": "theming",
  1013. "description": "Class ThemingController\nhandle ajax requests to update the theme"
  1014. }
  1015. ]
  1016. }