openapi.json 31 KB

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