1
0

openapi.json 31 KB

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