openapi.json 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987
  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. "enum": [
  167. 0,
  168. 1
  169. ]
  170. }
  171. },
  172. {
  173. "name": "withCustomCss",
  174. "in": "query",
  175. "description": "Include custom CSS",
  176. "schema": {
  177. "type": "integer",
  178. "default": 0,
  179. "enum": [
  180. 0,
  181. 1
  182. ]
  183. }
  184. },
  185. {
  186. "name": "themeId",
  187. "in": "path",
  188. "description": "ID of the theme",
  189. "required": true,
  190. "schema": {
  191. "type": "string"
  192. }
  193. }
  194. ],
  195. "responses": {
  196. "200": {
  197. "description": "Stylesheet returned",
  198. "content": {
  199. "text/css": {
  200. "schema": {
  201. "type": "string",
  202. "format": "binary"
  203. }
  204. }
  205. }
  206. },
  207. "404": {
  208. "description": "Theme not found",
  209. "content": {
  210. "text/html": {
  211. "schema": {
  212. "type": "string"
  213. }
  214. }
  215. }
  216. }
  217. }
  218. }
  219. },
  220. "/index.php/apps/theming/image/{key}": {
  221. "get": {
  222. "operationId": "theming-get-image",
  223. "summary": "Get an image",
  224. "tags": [
  225. "theming"
  226. ],
  227. "security": [
  228. {},
  229. {
  230. "bearer_auth": []
  231. },
  232. {
  233. "basic_auth": []
  234. }
  235. ],
  236. "parameters": [
  237. {
  238. "name": "useSvg",
  239. "in": "query",
  240. "description": "Return image as SVG",
  241. "schema": {
  242. "type": "integer",
  243. "default": 1,
  244. "enum": [
  245. 0,
  246. 1
  247. ]
  248. }
  249. },
  250. {
  251. "name": "key",
  252. "in": "path",
  253. "description": "Key of the image",
  254. "required": true,
  255. "schema": {
  256. "type": "string"
  257. }
  258. }
  259. ],
  260. "responses": {
  261. "200": {
  262. "description": "Image returned",
  263. "content": {
  264. "*/*": {
  265. "schema": {
  266. "type": "string",
  267. "format": "binary"
  268. }
  269. }
  270. }
  271. },
  272. "404": {
  273. "description": "Image not found",
  274. "content": {
  275. "text/html": {
  276. "schema": {
  277. "type": "string"
  278. }
  279. }
  280. }
  281. },
  282. "500": {
  283. "description": "",
  284. "content": {
  285. "text/plain": {
  286. "schema": {
  287. "type": "string"
  288. }
  289. }
  290. }
  291. }
  292. }
  293. }
  294. },
  295. "/index.php/apps/theming/manifest/{app}": {
  296. "get": {
  297. "operationId": "theming-get-manifest",
  298. "summary": "Get the manifest for an app",
  299. "tags": [
  300. "theming"
  301. ],
  302. "security": [
  303. {},
  304. {
  305. "bearer_auth": []
  306. },
  307. {
  308. "basic_auth": []
  309. }
  310. ],
  311. "parameters": [
  312. {
  313. "name": "app",
  314. "in": "path",
  315. "description": "ID of the app",
  316. "required": true,
  317. "schema": {
  318. "type": "string",
  319. "default": "core"
  320. }
  321. }
  322. ],
  323. "responses": {
  324. "200": {
  325. "description": "Manifest returned",
  326. "content": {
  327. "application/json": {
  328. "schema": {
  329. "type": "object",
  330. "required": [
  331. "name",
  332. "short_name",
  333. "start_url",
  334. "theme_color",
  335. "background_color",
  336. "description",
  337. "icons",
  338. "display"
  339. ],
  340. "properties": {
  341. "name": {
  342. "type": "string"
  343. },
  344. "short_name": {
  345. "type": "string"
  346. },
  347. "start_url": {
  348. "type": "string"
  349. },
  350. "theme_color": {
  351. "type": "string"
  352. },
  353. "background_color": {
  354. "type": "string"
  355. },
  356. "description": {
  357. "type": "string"
  358. },
  359. "icons": {
  360. "type": "array",
  361. "items": {
  362. "type": "object",
  363. "required": [
  364. "src",
  365. "type",
  366. "sizes"
  367. ],
  368. "properties": {
  369. "src": {
  370. "type": "string",
  371. "minLength": 1
  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. "content": {
  435. "image/x-icon": {
  436. "schema": {
  437. "type": "string",
  438. "format": "binary"
  439. }
  440. }
  441. }
  442. },
  443. "404": {
  444. "description": "Favicon not found",
  445. "content": {
  446. "text/html": {
  447. "schema": {
  448. "type": "string"
  449. }
  450. }
  451. }
  452. },
  453. "500": {
  454. "description": "",
  455. "content": {
  456. "text/plain": {
  457. "schema": {
  458. "type": "string"
  459. }
  460. }
  461. }
  462. }
  463. }
  464. }
  465. },
  466. "/index.php/apps/theming/icon/{app}": {
  467. "get": {
  468. "operationId": "icon-get-touch-icon",
  469. "summary": "Return a 512x512 icon for touch devices",
  470. "tags": [
  471. "icon"
  472. ],
  473. "security": [
  474. {},
  475. {
  476. "bearer_auth": []
  477. },
  478. {
  479. "basic_auth": []
  480. }
  481. ],
  482. "parameters": [
  483. {
  484. "name": "app",
  485. "in": "path",
  486. "description": "ID of the app",
  487. "required": true,
  488. "schema": {
  489. "type": "string",
  490. "default": "core"
  491. }
  492. }
  493. ],
  494. "responses": {
  495. "200": {
  496. "description": "Touch icon returned",
  497. "content": {
  498. "image/png": {
  499. "schema": {
  500. "type": "string",
  501. "format": "binary"
  502. }
  503. },
  504. "image/x-icon": {
  505. "schema": {
  506. "type": "string",
  507. "format": "binary"
  508. }
  509. }
  510. }
  511. },
  512. "404": {
  513. "description": "Touch icon not found",
  514. "content": {
  515. "text/html": {
  516. "schema": {
  517. "type": "string"
  518. }
  519. }
  520. }
  521. },
  522. "500": {
  523. "description": "",
  524. "content": {
  525. "text/plain": {
  526. "schema": {
  527. "type": "string"
  528. }
  529. }
  530. }
  531. }
  532. }
  533. }
  534. },
  535. "/index.php/apps/theming/img/{app}/{image}": {
  536. "get": {
  537. "operationId": "icon-get-themed-icon",
  538. "summary": "Get a themed icon",
  539. "tags": [
  540. "icon"
  541. ],
  542. "security": [
  543. {},
  544. {
  545. "bearer_auth": []
  546. },
  547. {
  548. "basic_auth": []
  549. }
  550. ],
  551. "parameters": [
  552. {
  553. "name": "app",
  554. "in": "path",
  555. "description": "ID of the app",
  556. "required": true,
  557. "schema": {
  558. "type": "string"
  559. }
  560. },
  561. {
  562. "name": "image",
  563. "in": "path",
  564. "description": "image file name (svg required)",
  565. "required": true,
  566. "schema": {
  567. "type": "string",
  568. "pattern": "^.+$"
  569. }
  570. }
  571. ],
  572. "responses": {
  573. "200": {
  574. "description": "Themed icon returned",
  575. "content": {
  576. "image/svg+xml": {
  577. "schema": {
  578. "type": "string",
  579. "format": "binary"
  580. }
  581. }
  582. }
  583. },
  584. "404": {
  585. "description": "Themed icon not found",
  586. "content": {
  587. "text/html": {
  588. "schema": {
  589. "type": "string"
  590. }
  591. }
  592. }
  593. },
  594. "500": {
  595. "description": "",
  596. "content": {
  597. "text/plain": {
  598. "schema": {
  599. "type": "string"
  600. }
  601. }
  602. }
  603. }
  604. }
  605. }
  606. },
  607. "/index.php/apps/theming/background": {
  608. "get": {
  609. "operationId": "user_theme-get-background",
  610. "summary": "Get the background image",
  611. "tags": [
  612. "user_theme"
  613. ],
  614. "security": [
  615. {
  616. "bearer_auth": []
  617. },
  618. {
  619. "basic_auth": []
  620. }
  621. ],
  622. "parameters": [
  623. {
  624. "name": "OCS-APIRequest",
  625. "in": "header",
  626. "description": "Required to be true for the API request to pass",
  627. "required": true,
  628. "schema": {
  629. "type": "boolean",
  630. "default": true
  631. }
  632. }
  633. ],
  634. "responses": {
  635. "200": {
  636. "description": "Background image returned",
  637. "content": {
  638. "*/*": {
  639. "schema": {
  640. "type": "string",
  641. "format": "binary"
  642. }
  643. }
  644. }
  645. },
  646. "404": {
  647. "description": "Background image not found",
  648. "content": {
  649. "text/html": {
  650. "schema": {
  651. "type": "string"
  652. }
  653. }
  654. }
  655. }
  656. }
  657. }
  658. },
  659. "/index.php/apps/theming/background/{type}": {
  660. "post": {
  661. "operationId": "user_theme-set-background",
  662. "summary": "Set the background",
  663. "tags": [
  664. "user_theme"
  665. ],
  666. "security": [
  667. {
  668. "bearer_auth": []
  669. },
  670. {
  671. "basic_auth": []
  672. }
  673. ],
  674. "parameters": [
  675. {
  676. "name": "value",
  677. "in": "query",
  678. "description": "Path of the background image",
  679. "schema": {
  680. "type": "string",
  681. "default": ""
  682. }
  683. },
  684. {
  685. "name": "color",
  686. "in": "query",
  687. "description": "Color for the background",
  688. "schema": {
  689. "type": "string",
  690. "nullable": true
  691. }
  692. },
  693. {
  694. "name": "type",
  695. "in": "path",
  696. "description": "Type of background",
  697. "required": true,
  698. "schema": {
  699. "type": "string"
  700. }
  701. },
  702. {
  703. "name": "OCS-APIRequest",
  704. "in": "header",
  705. "description": "Required to be true for the API request to pass",
  706. "required": true,
  707. "schema": {
  708. "type": "boolean",
  709. "default": true
  710. }
  711. }
  712. ],
  713. "responses": {
  714. "200": {
  715. "description": "Background set successfully",
  716. "content": {
  717. "application/json": {
  718. "schema": {
  719. "$ref": "#/components/schemas/Background"
  720. }
  721. }
  722. }
  723. },
  724. "400": {
  725. "description": "Setting background is not possible",
  726. "content": {
  727. "application/json": {
  728. "schema": {
  729. "type": "object",
  730. "required": [
  731. "error"
  732. ],
  733. "properties": {
  734. "error": {
  735. "type": "string"
  736. }
  737. }
  738. }
  739. }
  740. }
  741. },
  742. "500": {
  743. "description": "",
  744. "content": {
  745. "application/json": {
  746. "schema": {
  747. "type": "object",
  748. "required": [
  749. "error"
  750. ],
  751. "properties": {
  752. "error": {
  753. "type": "string"
  754. }
  755. }
  756. }
  757. }
  758. }
  759. }
  760. }
  761. }
  762. },
  763. "/index.php/apps/theming/background/custom": {
  764. "delete": {
  765. "operationId": "user_theme-delete-background",
  766. "summary": "Delete the background",
  767. "tags": [
  768. "user_theme"
  769. ],
  770. "security": [
  771. {
  772. "bearer_auth": []
  773. },
  774. {
  775. "basic_auth": []
  776. }
  777. ],
  778. "parameters": [
  779. {
  780. "name": "OCS-APIRequest",
  781. "in": "header",
  782. "description": "Required to be true for the API request to pass",
  783. "required": true,
  784. "schema": {
  785. "type": "boolean",
  786. "default": true
  787. }
  788. }
  789. ],
  790. "responses": {
  791. "200": {
  792. "description": "Background deleted successfully",
  793. "content": {
  794. "application/json": {
  795. "schema": {
  796. "$ref": "#/components/schemas/Background"
  797. }
  798. }
  799. }
  800. }
  801. }
  802. }
  803. },
  804. "/ocs/v2.php/apps/theming/api/v1/theme/{themeId}/enable": {
  805. "put": {
  806. "operationId": "user_theme-enable-theme",
  807. "summary": "Enable theme",
  808. "tags": [
  809. "user_theme"
  810. ],
  811. "security": [
  812. {
  813. "bearer_auth": []
  814. },
  815. {
  816. "basic_auth": []
  817. }
  818. ],
  819. "parameters": [
  820. {
  821. "name": "themeId",
  822. "in": "path",
  823. "description": "the theme ID",
  824. "required": true,
  825. "schema": {
  826. "type": "string"
  827. }
  828. },
  829. {
  830. "name": "OCS-APIRequest",
  831. "in": "header",
  832. "description": "Required to be true for the API request to pass",
  833. "required": true,
  834. "schema": {
  835. "type": "boolean",
  836. "default": true
  837. }
  838. }
  839. ],
  840. "responses": {
  841. "200": {
  842. "description": "Theme enabled successfully",
  843. "content": {
  844. "application/json": {
  845. "schema": {
  846. "type": "object",
  847. "required": [
  848. "ocs"
  849. ],
  850. "properties": {
  851. "ocs": {
  852. "type": "object",
  853. "required": [
  854. "meta",
  855. "data"
  856. ],
  857. "properties": {
  858. "meta": {
  859. "$ref": "#/components/schemas/OCSMeta"
  860. },
  861. "data": {}
  862. }
  863. }
  864. }
  865. }
  866. }
  867. }
  868. },
  869. "400": {
  870. "description": "Enabling theme is not possible",
  871. "content": {
  872. "text/plain": {
  873. "schema": {
  874. "type": "string"
  875. }
  876. }
  877. }
  878. },
  879. "500": {
  880. "description": "",
  881. "content": {
  882. "text/plain": {
  883. "schema": {
  884. "type": "string"
  885. }
  886. }
  887. }
  888. }
  889. }
  890. }
  891. },
  892. "/ocs/v2.php/apps/theming/api/v1/theme/{themeId}": {
  893. "delete": {
  894. "operationId": "user_theme-disable-theme",
  895. "summary": "Disable theme",
  896. "tags": [
  897. "user_theme"
  898. ],
  899. "security": [
  900. {
  901. "bearer_auth": []
  902. },
  903. {
  904. "basic_auth": []
  905. }
  906. ],
  907. "parameters": [
  908. {
  909. "name": "themeId",
  910. "in": "path",
  911. "description": "the theme ID",
  912. "required": true,
  913. "schema": {
  914. "type": "string"
  915. }
  916. },
  917. {
  918. "name": "OCS-APIRequest",
  919. "in": "header",
  920. "description": "Required to be true for the API request to pass",
  921. "required": true,
  922. "schema": {
  923. "type": "boolean",
  924. "default": true
  925. }
  926. }
  927. ],
  928. "responses": {
  929. "200": {
  930. "description": "Theme disabled successfully",
  931. "content": {
  932. "application/json": {
  933. "schema": {
  934. "type": "object",
  935. "required": [
  936. "ocs"
  937. ],
  938. "properties": {
  939. "ocs": {
  940. "type": "object",
  941. "required": [
  942. "meta",
  943. "data"
  944. ],
  945. "properties": {
  946. "meta": {
  947. "$ref": "#/components/schemas/OCSMeta"
  948. },
  949. "data": {}
  950. }
  951. }
  952. }
  953. }
  954. }
  955. }
  956. },
  957. "400": {
  958. "description": "Disabling theme is not possible",
  959. "content": {
  960. "text/plain": {
  961. "schema": {
  962. "type": "string"
  963. }
  964. }
  965. }
  966. },
  967. "500": {
  968. "description": "",
  969. "content": {
  970. "text/plain": {
  971. "schema": {
  972. "type": "string"
  973. }
  974. }
  975. }
  976. }
  977. }
  978. }
  979. }
  980. },
  981. "tags": [
  982. {
  983. "name": "theming",
  984. "description": "Class ThemingController\nhandle ajax requests to update the theme"
  985. }
  986. ]
  987. }