openapi.json 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006
  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. }
  391. }
  392. },
  393. "/index.php/apps/theming/favicon/{app}": {
  394. "get": {
  395. "operationId": "icon-get-favicon",
  396. "summary": "Return a 32x32 favicon as png",
  397. "tags": [
  398. "icon"
  399. ],
  400. "security": [
  401. {},
  402. {
  403. "bearer_auth": []
  404. },
  405. {
  406. "basic_auth": []
  407. }
  408. ],
  409. "parameters": [
  410. {
  411. "name": "app",
  412. "in": "path",
  413. "description": "ID of the app",
  414. "required": true,
  415. "schema": {
  416. "type": "string",
  417. "default": "core"
  418. }
  419. }
  420. ],
  421. "responses": {
  422. "200": {
  423. "description": "Favicon returned",
  424. "headers": {
  425. "Content-Disposition": {
  426. "schema": {
  427. "type": "string"
  428. }
  429. }
  430. },
  431. "content": {
  432. "image/x-icon": {
  433. "schema": {
  434. "type": "string",
  435. "format": "binary"
  436. }
  437. }
  438. }
  439. },
  440. "404": {
  441. "description": "Favicon not found",
  442. "content": {
  443. "text/html": {
  444. "schema": {
  445. "type": "string"
  446. }
  447. }
  448. }
  449. },
  450. "500": {
  451. "description": "",
  452. "content": {
  453. "text/plain": {
  454. "schema": {
  455. "type": "string"
  456. }
  457. }
  458. }
  459. }
  460. }
  461. }
  462. },
  463. "/index.php/apps/theming/icon/{app}": {
  464. "get": {
  465. "operationId": "icon-get-touch-icon",
  466. "summary": "Return a 512x512 icon for touch devices",
  467. "tags": [
  468. "icon"
  469. ],
  470. "security": [
  471. {},
  472. {
  473. "bearer_auth": []
  474. },
  475. {
  476. "basic_auth": []
  477. }
  478. ],
  479. "parameters": [
  480. {
  481. "name": "app",
  482. "in": "path",
  483. "description": "ID of the app",
  484. "required": true,
  485. "schema": {
  486. "type": "string",
  487. "default": "core"
  488. }
  489. }
  490. ],
  491. "responses": {
  492. "200": {
  493. "description": "Touch icon returned",
  494. "headers": {
  495. "Content-Disposition": {
  496. "schema": {
  497. "type": "string"
  498. }
  499. }
  500. },
  501. "content": {
  502. "image/png": {
  503. "schema": {
  504. "type": "string",
  505. "format": "binary"
  506. }
  507. },
  508. "image/x-icon": {
  509. "schema": {
  510. "type": "string",
  511. "format": "binary"
  512. }
  513. }
  514. }
  515. },
  516. "404": {
  517. "description": "Touch icon not found",
  518. "content": {
  519. "text/html": {
  520. "schema": {
  521. "type": "string"
  522. }
  523. }
  524. }
  525. },
  526. "500": {
  527. "description": "",
  528. "content": {
  529. "text/plain": {
  530. "schema": {
  531. "type": "string"
  532. }
  533. }
  534. }
  535. }
  536. }
  537. }
  538. },
  539. "/index.php/apps/theming/img/{app}/{image}": {
  540. "get": {
  541. "operationId": "icon-get-themed-icon",
  542. "summary": "Get a themed icon",
  543. "tags": [
  544. "icon"
  545. ],
  546. "security": [
  547. {},
  548. {
  549. "bearer_auth": []
  550. },
  551. {
  552. "basic_auth": []
  553. }
  554. ],
  555. "parameters": [
  556. {
  557. "name": "app",
  558. "in": "path",
  559. "description": "ID of the app",
  560. "required": true,
  561. "schema": {
  562. "type": "string"
  563. }
  564. },
  565. {
  566. "name": "image",
  567. "in": "path",
  568. "description": "image file name (svg required)",
  569. "required": true,
  570. "schema": {
  571. "type": "string",
  572. "pattern": "^.+$"
  573. }
  574. }
  575. ],
  576. "responses": {
  577. "200": {
  578. "description": "Themed icon returned",
  579. "headers": {
  580. "Content-Disposition": {
  581. "schema": {
  582. "type": "string"
  583. }
  584. }
  585. },
  586. "content": {
  587. "image/svg+xml": {
  588. "schema": {
  589. "type": "string",
  590. "format": "binary"
  591. }
  592. }
  593. }
  594. },
  595. "404": {
  596. "description": "Themed icon not found",
  597. "content": {
  598. "text/html": {
  599. "schema": {
  600. "type": "string"
  601. }
  602. }
  603. }
  604. },
  605. "500": {
  606. "description": "",
  607. "content": {
  608. "text/plain": {
  609. "schema": {
  610. "type": "string"
  611. }
  612. }
  613. }
  614. }
  615. }
  616. }
  617. },
  618. "/index.php/apps/theming/background": {
  619. "get": {
  620. "operationId": "user_theme-get-background",
  621. "summary": "Get the background image",
  622. "tags": [
  623. "user_theme"
  624. ],
  625. "security": [
  626. {
  627. "bearer_auth": []
  628. },
  629. {
  630. "basic_auth": []
  631. }
  632. ],
  633. "parameters": [
  634. {
  635. "name": "OCS-APIRequest",
  636. "in": "header",
  637. "required": true,
  638. "schema": {
  639. "type": "string",
  640. "default": "true"
  641. }
  642. }
  643. ],
  644. "responses": {
  645. "200": {
  646. "description": "Background image returned",
  647. "headers": {
  648. "Content-Disposition": {
  649. "schema": {
  650. "type": "string"
  651. }
  652. }
  653. },
  654. "content": {
  655. "*/*": {
  656. "schema": {
  657. "type": "string",
  658. "format": "binary"
  659. }
  660. }
  661. }
  662. },
  663. "404": {
  664. "description": "Background image not found",
  665. "content": {
  666. "text/html": {
  667. "schema": {
  668. "type": "string"
  669. }
  670. }
  671. }
  672. }
  673. }
  674. }
  675. },
  676. "/index.php/apps/theming/background/{type}": {
  677. "post": {
  678. "operationId": "user_theme-set-background",
  679. "summary": "Set the background",
  680. "tags": [
  681. "user_theme"
  682. ],
  683. "security": [
  684. {
  685. "bearer_auth": []
  686. },
  687. {
  688. "basic_auth": []
  689. }
  690. ],
  691. "parameters": [
  692. {
  693. "name": "value",
  694. "in": "query",
  695. "description": "Path of the background image",
  696. "schema": {
  697. "type": "string",
  698. "default": ""
  699. }
  700. },
  701. {
  702. "name": "color",
  703. "in": "query",
  704. "description": "Color for the background",
  705. "schema": {
  706. "type": "string",
  707. "nullable": true
  708. }
  709. },
  710. {
  711. "name": "type",
  712. "in": "path",
  713. "description": "Type of background",
  714. "required": true,
  715. "schema": {
  716. "type": "string"
  717. }
  718. },
  719. {
  720. "name": "OCS-APIRequest",
  721. "in": "header",
  722. "required": true,
  723. "schema": {
  724. "type": "string",
  725. "default": "true"
  726. }
  727. }
  728. ],
  729. "responses": {
  730. "200": {
  731. "description": "Background set successfully",
  732. "content": {
  733. "application/json": {
  734. "schema": {
  735. "$ref": "#/components/schemas/Background"
  736. }
  737. }
  738. }
  739. },
  740. "400": {
  741. "description": "Setting background is not possible",
  742. "content": {
  743. "application/json": {
  744. "schema": {
  745. "type": "object",
  746. "required": [
  747. "error"
  748. ],
  749. "properties": {
  750. "error": {
  751. "type": "string"
  752. }
  753. }
  754. }
  755. }
  756. }
  757. },
  758. "500": {
  759. "description": "",
  760. "content": {
  761. "application/json": {
  762. "schema": {
  763. "type": "object",
  764. "required": [
  765. "error"
  766. ],
  767. "properties": {
  768. "error": {
  769. "type": "string"
  770. }
  771. }
  772. }
  773. }
  774. }
  775. }
  776. }
  777. }
  778. },
  779. "/index.php/apps/theming/background/custom": {
  780. "delete": {
  781. "operationId": "user_theme-delete-background",
  782. "summary": "Delete the background",
  783. "tags": [
  784. "user_theme"
  785. ],
  786. "security": [
  787. {
  788. "bearer_auth": []
  789. },
  790. {
  791. "basic_auth": []
  792. }
  793. ],
  794. "parameters": [
  795. {
  796. "name": "OCS-APIRequest",
  797. "in": "header",
  798. "required": true,
  799. "schema": {
  800. "type": "string",
  801. "default": "true"
  802. }
  803. }
  804. ],
  805. "responses": {
  806. "200": {
  807. "description": "",
  808. "content": {
  809. "application/json": {
  810. "schema": {
  811. "$ref": "#/components/schemas/Background"
  812. }
  813. }
  814. }
  815. }
  816. }
  817. }
  818. },
  819. "/ocs/v2.php/apps/theming/api/v1/theme/{themeId}/enable": {
  820. "put": {
  821. "operationId": "user_theme-enable-theme",
  822. "summary": "Enable theme",
  823. "tags": [
  824. "user_theme"
  825. ],
  826. "security": [
  827. {
  828. "bearer_auth": []
  829. },
  830. {
  831. "basic_auth": []
  832. }
  833. ],
  834. "parameters": [
  835. {
  836. "name": "themeId",
  837. "in": "path",
  838. "description": "the theme ID",
  839. "required": true,
  840. "schema": {
  841. "type": "string"
  842. }
  843. },
  844. {
  845. "name": "OCS-APIRequest",
  846. "in": "header",
  847. "required": true,
  848. "schema": {
  849. "type": "string",
  850. "default": "true"
  851. }
  852. }
  853. ],
  854. "responses": {
  855. "200": {
  856. "description": "Theme enabled successfully",
  857. "content": {
  858. "application/json": {
  859. "schema": {
  860. "type": "object",
  861. "required": [
  862. "ocs"
  863. ],
  864. "properties": {
  865. "ocs": {
  866. "type": "object",
  867. "required": [
  868. "meta",
  869. "data"
  870. ],
  871. "properties": {
  872. "meta": {
  873. "$ref": "#/components/schemas/OCSMeta"
  874. },
  875. "data": {
  876. "type": "object",
  877. "additionalProperties": true
  878. }
  879. }
  880. }
  881. }
  882. }
  883. }
  884. }
  885. },
  886. "400": {
  887. "description": "Enabling theme is not possible",
  888. "content": {
  889. "text/plain": {
  890. "schema": {
  891. "type": "string"
  892. }
  893. }
  894. }
  895. },
  896. "500": {
  897. "description": "",
  898. "content": {
  899. "text/plain": {
  900. "schema": {
  901. "type": "string"
  902. }
  903. }
  904. }
  905. }
  906. }
  907. }
  908. },
  909. "/ocs/v2.php/apps/theming/api/v1/theme/{themeId}": {
  910. "delete": {
  911. "operationId": "user_theme-disable-theme",
  912. "summary": "Disable theme",
  913. "tags": [
  914. "user_theme"
  915. ],
  916. "security": [
  917. {
  918. "bearer_auth": []
  919. },
  920. {
  921. "basic_auth": []
  922. }
  923. ],
  924. "parameters": [
  925. {
  926. "name": "themeId",
  927. "in": "path",
  928. "description": "the theme ID",
  929. "required": true,
  930. "schema": {
  931. "type": "string"
  932. }
  933. },
  934. {
  935. "name": "OCS-APIRequest",
  936. "in": "header",
  937. "required": true,
  938. "schema": {
  939. "type": "string",
  940. "default": "true"
  941. }
  942. }
  943. ],
  944. "responses": {
  945. "200": {
  946. "description": "Theme disabled successfully",
  947. "content": {
  948. "application/json": {
  949. "schema": {
  950. "type": "object",
  951. "required": [
  952. "ocs"
  953. ],
  954. "properties": {
  955. "ocs": {
  956. "type": "object",
  957. "required": [
  958. "meta",
  959. "data"
  960. ],
  961. "properties": {
  962. "meta": {
  963. "$ref": "#/components/schemas/OCSMeta"
  964. },
  965. "data": {
  966. "type": "object",
  967. "additionalProperties": true
  968. }
  969. }
  970. }
  971. }
  972. }
  973. }
  974. }
  975. },
  976. "400": {
  977. "description": "Disabling theme is not possible",
  978. "content": {
  979. "text/plain": {
  980. "schema": {
  981. "type": "string"
  982. }
  983. }
  984. }
  985. },
  986. "500": {
  987. "description": "",
  988. "content": {
  989. "text/plain": {
  990. "schema": {
  991. "type": "string"
  992. }
  993. }
  994. }
  995. }
  996. }
  997. }
  998. }
  999. },
  1000. "tags": [
  1001. {
  1002. "name": "theming",
  1003. "description": "Class ThemingController\nhandle ajax requests to update the theme"
  1004. }
  1005. ]
  1006. }