openapi.json 35 KB

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