docs.go 102 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055
  1. // Code generated by swaggo/swag. DO NOT EDIT.
  2. package v1
  3. import "github.com/swaggo/swag"
  4. const docTemplate = `{
  5. "schemes": {{ marshal .Schemes }},
  6. "swagger": "2.0",
  7. "info": {
  8. "description": "{{escape .Description}}",
  9. "title": "{{.Title}}",
  10. "contact": {
  11. "name": "API Support",
  12. "url": "https://github.com/orgs/usememos/discussions"
  13. },
  14. "license": {
  15. "name": "MIT License",
  16. "url": "https://github.com/usememos/memos/blob/main/LICENSE"
  17. },
  18. "version": "{{.Version}}"
  19. },
  20. "host": "{{.Host}}",
  21. "basePath": "{{.BasePath}}",
  22. "paths": {
  23. "/api/v1/auth/signin": {
  24. "post": {
  25. "consumes": [
  26. "application/json"
  27. ],
  28. "produces": [
  29. "application/json"
  30. ],
  31. "tags": [
  32. "auth"
  33. ],
  34. "summary": "Sign-in to memos.",
  35. "parameters": [
  36. {
  37. "description": "Sign-in object",
  38. "name": "body",
  39. "in": "body",
  40. "required": true,
  41. "schema": {
  42. "$ref": "#/definitions/v1.SignIn"
  43. }
  44. }
  45. ],
  46. "responses": {
  47. "200": {
  48. "description": "User information",
  49. "schema": {
  50. "$ref": "#/definitions/store.User"
  51. }
  52. },
  53. "400": {
  54. "description": "Malformatted signin request"
  55. },
  56. "401": {
  57. "description": "Password login is deactivated | Incorrect login credentials, please try again"
  58. },
  59. "403": {
  60. "description": "User has been archived with username %s"
  61. },
  62. "500": {
  63. "description": "Failed to find system setting | Failed to unmarshal system setting | Incorrect login credentials, please try again | Failed to generate tokens | Failed to create activity"
  64. }
  65. }
  66. }
  67. },
  68. "/api/v1/auth/signin/sso": {
  69. "post": {
  70. "consumes": [
  71. "application/json"
  72. ],
  73. "produces": [
  74. "application/json"
  75. ],
  76. "tags": [
  77. "auth"
  78. ],
  79. "summary": "Sign-in to memos using SSO.",
  80. "parameters": [
  81. {
  82. "description": "SSO sign-in object",
  83. "name": "body",
  84. "in": "body",
  85. "required": true,
  86. "schema": {
  87. "$ref": "#/definitions/v1.SSOSignIn"
  88. }
  89. }
  90. ],
  91. "responses": {
  92. "200": {
  93. "description": "User information",
  94. "schema": {
  95. "$ref": "#/definitions/store.User"
  96. }
  97. },
  98. "400": {
  99. "description": "Malformatted signin request"
  100. },
  101. "401": {
  102. "description": "Access denied, identifier does not match the filter."
  103. },
  104. "403": {
  105. "description": "User has been archived with username {username}"
  106. },
  107. "404": {
  108. "description": "Identity provider not found"
  109. },
  110. "500": {
  111. "description": "Failed to find identity provider | Failed to create identity provider instance | Failed to exchange token | Failed to get user info | Failed to compile identifier filter | Incorrect login credentials, please try again | Failed to generate random password | Failed to generate password hash | Failed to create user | Failed to generate tokens | Failed to create activity"
  112. }
  113. }
  114. }
  115. },
  116. "/api/v1/auth/signout": {
  117. "post": {
  118. "produces": [
  119. "application/json"
  120. ],
  121. "tags": [
  122. "auth"
  123. ],
  124. "summary": "Sign-out from memos.",
  125. "responses": {
  126. "200": {
  127. "description": "Sign-out success",
  128. "schema": {
  129. "type": "boolean"
  130. }
  131. }
  132. }
  133. }
  134. },
  135. "/api/v1/auth/signup": {
  136. "post": {
  137. "consumes": [
  138. "application/json"
  139. ],
  140. "produces": [
  141. "application/json"
  142. ],
  143. "tags": [
  144. "auth"
  145. ],
  146. "summary": "Sign-up to memos.",
  147. "parameters": [
  148. {
  149. "description": "Sign-up object",
  150. "name": "body",
  151. "in": "body",
  152. "required": true,
  153. "schema": {
  154. "$ref": "#/definitions/v1.SignUp"
  155. }
  156. }
  157. ],
  158. "responses": {
  159. "200": {
  160. "description": "User information",
  161. "schema": {
  162. "$ref": "#/definitions/store.User"
  163. }
  164. },
  165. "400": {
  166. "description": "Malformatted signup request | Failed to find users"
  167. },
  168. "401": {
  169. "description": "signup is disabled"
  170. },
  171. "403": {
  172. "description": "Forbidden"
  173. },
  174. "404": {
  175. "description": "Not found"
  176. },
  177. "500": {
  178. "description": "Failed to find system setting | Failed to unmarshal system setting allow signup | Failed to generate password hash | Failed to create user | Failed to generate tokens | Failed to create activity"
  179. }
  180. }
  181. }
  182. },
  183. "/api/v1/idp": {
  184. "get": {
  185. "description": "*clientSecret is only available for host user",
  186. "produces": [
  187. "application/json"
  188. ],
  189. "tags": [
  190. "idp"
  191. ],
  192. "summary": "Get a list of identity providers",
  193. "responses": {
  194. "200": {
  195. "description": "List of available identity providers",
  196. "schema": {
  197. "type": "array",
  198. "items": {
  199. "$ref": "#/definitions/v1.IdentityProvider"
  200. }
  201. }
  202. },
  203. "500": {
  204. "description": "Failed to find identity provider list | Failed to find user"
  205. }
  206. }
  207. },
  208. "post": {
  209. "consumes": [
  210. "application/json"
  211. ],
  212. "produces": [
  213. "application/json"
  214. ],
  215. "tags": [
  216. "idp"
  217. ],
  218. "summary": "Create Identity Provider",
  219. "parameters": [
  220. {
  221. "description": "Identity provider information",
  222. "name": "body",
  223. "in": "body",
  224. "required": true,
  225. "schema": {
  226. "$ref": "#/definitions/v1.CreateIdentityProviderRequest"
  227. }
  228. }
  229. ],
  230. "responses": {
  231. "200": {
  232. "description": "Identity provider information",
  233. "schema": {
  234. "$ref": "#/definitions/store.IdentityProvider"
  235. }
  236. },
  237. "400": {
  238. "description": "Malformatted post identity provider request"
  239. },
  240. "401": {
  241. "description": "Missing user in session | Unauthorized"
  242. },
  243. "500": {
  244. "description": "Failed to find user | Failed to create identity provider"
  245. }
  246. }
  247. }
  248. },
  249. "/api/v1/idp/{idpId}": {
  250. "get": {
  251. "consumes": [
  252. "application/json"
  253. ],
  254. "produces": [
  255. "application/json"
  256. ],
  257. "tags": [
  258. "idp"
  259. ],
  260. "summary": "Get an identity provider by ID",
  261. "parameters": [
  262. {
  263. "type": "integer",
  264. "description": "Identity provider ID",
  265. "name": "idpId",
  266. "in": "path",
  267. "required": true
  268. }
  269. ],
  270. "responses": {
  271. "200": {
  272. "description": "Requested identity provider",
  273. "schema": {
  274. "$ref": "#/definitions/store.IdentityProvider"
  275. }
  276. },
  277. "400": {
  278. "description": "ID is not a number: %s"
  279. },
  280. "401": {
  281. "description": "Missing user in session | Unauthorized"
  282. },
  283. "404": {
  284. "description": "Identity provider not found"
  285. },
  286. "500": {
  287. "description": "Failed to find identity provider list | Failed to find user"
  288. }
  289. }
  290. },
  291. "delete": {
  292. "consumes": [
  293. "application/json"
  294. ],
  295. "produces": [
  296. "application/json"
  297. ],
  298. "tags": [
  299. "idp"
  300. ],
  301. "summary": "Delete an identity provider by ID",
  302. "parameters": [
  303. {
  304. "type": "integer",
  305. "description": "Identity Provider ID",
  306. "name": "idpId",
  307. "in": "path",
  308. "required": true
  309. }
  310. ],
  311. "responses": {
  312. "200": {
  313. "description": "Identity Provider deleted",
  314. "schema": {
  315. "type": "boolean"
  316. }
  317. },
  318. "400": {
  319. "description": "ID is not a number: %s | Malformatted patch identity provider request"
  320. },
  321. "401": {
  322. "description": "Missing user in session | Unauthorized"
  323. },
  324. "500": {
  325. "description": "Failed to find user | Failed to patch identity provider"
  326. }
  327. }
  328. },
  329. "patch": {
  330. "consumes": [
  331. "application/json"
  332. ],
  333. "produces": [
  334. "application/json"
  335. ],
  336. "tags": [
  337. "idp"
  338. ],
  339. "summary": "Update an identity provider by ID",
  340. "parameters": [
  341. {
  342. "type": "integer",
  343. "description": "Identity Provider ID",
  344. "name": "idpId",
  345. "in": "path",
  346. "required": true
  347. },
  348. {
  349. "description": "Patched identity provider information",
  350. "name": "body",
  351. "in": "body",
  352. "required": true,
  353. "schema": {
  354. "$ref": "#/definitions/v1.UpdateIdentityProviderRequest"
  355. }
  356. }
  357. ],
  358. "responses": {
  359. "200": {
  360. "description": "Patched identity provider",
  361. "schema": {
  362. "$ref": "#/definitions/store.IdentityProvider"
  363. }
  364. },
  365. "400": {
  366. "description": "ID is not a number: %s | Malformatted patch identity provider request"
  367. },
  368. "401": {
  369. "description": "Missing user in session | Unauthorized"
  370. },
  371. "500": {
  372. "description": "Failed to find user | Failed to patch identity provider"
  373. }
  374. }
  375. }
  376. },
  377. "/api/v1/memo": {
  378. "get": {
  379. "produces": [
  380. "application/json"
  381. ],
  382. "tags": [
  383. "memo"
  384. ],
  385. "summary": "Get a list of memos matching optional filters",
  386. "parameters": [
  387. {
  388. "type": "integer",
  389. "description": "Creator ID",
  390. "name": "creatorId",
  391. "in": "query"
  392. },
  393. {
  394. "type": "string",
  395. "description": "Creator username",
  396. "name": "creatorUsername",
  397. "in": "query"
  398. },
  399. {
  400. "enum": [
  401. "NORMAL",
  402. "ARCHIVED"
  403. ],
  404. "type": "string",
  405. "description": "Row status",
  406. "name": "rowStatus",
  407. "in": "query"
  408. },
  409. {
  410. "type": "boolean",
  411. "description": "Pinned",
  412. "name": "pinned",
  413. "in": "query"
  414. },
  415. {
  416. "type": "string",
  417. "description": "Search for tag. Do not append #",
  418. "name": "tag",
  419. "in": "query"
  420. },
  421. {
  422. "type": "string",
  423. "description": "Search for content",
  424. "name": "content",
  425. "in": "query"
  426. },
  427. {
  428. "type": "integer",
  429. "description": "Limit",
  430. "name": "limit",
  431. "in": "query"
  432. },
  433. {
  434. "type": "integer",
  435. "description": "Offset",
  436. "name": "offset",
  437. "in": "query"
  438. }
  439. ],
  440. "responses": {
  441. "200": {
  442. "description": "Memo list",
  443. "schema": {
  444. "type": "array",
  445. "items": {
  446. "$ref": "#/definitions/store.Memo"
  447. }
  448. }
  449. },
  450. "400": {
  451. "description": "Missing user to find memo"
  452. },
  453. "500": {
  454. "description": "Failed to get memo display with updated ts setting value | Failed to fetch memo list | Failed to compose memo response"
  455. }
  456. }
  457. },
  458. "post": {
  459. "description": "Visibility can be PUBLIC, PROTECTED or PRIVATE\n*You should omit fields to use their default values",
  460. "consumes": [
  461. "application/json"
  462. ],
  463. "produces": [
  464. "application/json"
  465. ],
  466. "tags": [
  467. "memo"
  468. ],
  469. "summary": "Create a memo",
  470. "parameters": [
  471. {
  472. "description": "Request object.",
  473. "name": "body",
  474. "in": "body",
  475. "required": true,
  476. "schema": {
  477. "$ref": "#/definitions/v1.CreateMemoRequest"
  478. }
  479. }
  480. ],
  481. "responses": {
  482. "200": {
  483. "description": "Stored memo",
  484. "schema": {
  485. "$ref": "#/definitions/store.Memo"
  486. }
  487. },
  488. "400": {
  489. "description": "Malformatted post memo request | Content size overflow, up to 1MB"
  490. },
  491. "401": {
  492. "description": "Missing user in session"
  493. },
  494. "404": {
  495. "description": "User not found | Memo not found: %d"
  496. },
  497. "500": {
  498. "description": "Failed to find user setting | Failed to unmarshal user setting value | Failed to find system setting | Failed to unmarshal system setting | Failed to find user | Failed to create memo | Failed to create activity | Failed to upsert memo resource | Failed to upsert memo relation | Failed to compose memo | Failed to compose memo response"
  499. }
  500. }
  501. }
  502. },
  503. "/api/v1/memo/all": {
  504. "get": {
  505. "description": "This should also list protected memos if the user is logged in\nAuthentication is optional",
  506. "produces": [
  507. "application/json"
  508. ],
  509. "tags": [
  510. "memo"
  511. ],
  512. "summary": "Get a list of public memos matching optional filters",
  513. "parameters": [
  514. {
  515. "type": "integer",
  516. "description": "Limit",
  517. "name": "limit",
  518. "in": "query"
  519. },
  520. {
  521. "type": "integer",
  522. "description": "Offset",
  523. "name": "offset",
  524. "in": "query"
  525. }
  526. ],
  527. "responses": {
  528. "200": {
  529. "description": "Memo list",
  530. "schema": {
  531. "type": "array",
  532. "items": {
  533. "$ref": "#/definitions/store.Memo"
  534. }
  535. }
  536. },
  537. "500": {
  538. "description": "Failed to get memo display with updated ts setting value | Failed to fetch all memo list | Failed to compose memo response"
  539. }
  540. }
  541. }
  542. },
  543. "/api/v1/memo/stats": {
  544. "get": {
  545. "description": "Used to generate the heatmap",
  546. "produces": [
  547. "application/json"
  548. ],
  549. "tags": [
  550. "memo"
  551. ],
  552. "summary": "Get memo stats by creator ID or username",
  553. "parameters": [
  554. {
  555. "type": "integer",
  556. "description": "Creator ID",
  557. "name": "creatorId",
  558. "in": "query"
  559. },
  560. {
  561. "type": "string",
  562. "description": "Creator username",
  563. "name": "creatorUsername",
  564. "in": "query"
  565. }
  566. ],
  567. "responses": {
  568. "200": {
  569. "description": "Memo createdTs list",
  570. "schema": {
  571. "type": "array",
  572. "items": {
  573. "type": "integer"
  574. }
  575. }
  576. },
  577. "400": {
  578. "description": "Missing user id to find memo"
  579. },
  580. "500": {
  581. "description": "Failed to get memo display with updated ts setting value | Failed to find memo list | Failed to compose memo response"
  582. }
  583. }
  584. }
  585. },
  586. "/api/v1/memo/{memoId}": {
  587. "get": {
  588. "produces": [
  589. "application/json"
  590. ],
  591. "tags": [
  592. "memo"
  593. ],
  594. "summary": "Get memo by ID",
  595. "parameters": [
  596. {
  597. "type": "integer",
  598. "description": "Memo ID",
  599. "name": "memoId",
  600. "in": "path",
  601. "required": true
  602. }
  603. ],
  604. "responses": {
  605. "200": {
  606. "description": "Memo list",
  607. "schema": {
  608. "type": "array",
  609. "items": {
  610. "$ref": "#/definitions/store.Memo"
  611. }
  612. }
  613. },
  614. "400": {
  615. "description": "ID is not a number: %s"
  616. },
  617. "401": {
  618. "description": "Missing user in session"
  619. },
  620. "403": {
  621. "description": "this memo is private only | this memo is protected, missing user in session"
  622. },
  623. "404": {
  624. "description": "Memo not found: %d"
  625. },
  626. "500": {
  627. "description": "Failed to find memo by ID: %v | Failed to compose memo response"
  628. }
  629. }
  630. },
  631. "delete": {
  632. "produces": [
  633. "application/json"
  634. ],
  635. "tags": [
  636. "memo"
  637. ],
  638. "summary": "Delete memo by ID",
  639. "parameters": [
  640. {
  641. "type": "integer",
  642. "description": "Memo ID to delete",
  643. "name": "memoId",
  644. "in": "path",
  645. "required": true
  646. }
  647. ],
  648. "responses": {
  649. "200": {
  650. "description": "Memo deleted",
  651. "schema": {
  652. "type": "boolean"
  653. }
  654. },
  655. "400": {
  656. "description": "ID is not a number: %s"
  657. },
  658. "401": {
  659. "description": "Missing user in session | Unauthorized"
  660. },
  661. "404": {
  662. "description": "Memo not found: %d"
  663. },
  664. "500": {
  665. "description": "Failed to find memo | Failed to delete memo ID: %v"
  666. }
  667. }
  668. },
  669. "patch": {
  670. "description": "Visibility can be PUBLIC, PROTECTED or PRIVATE\n*You should omit fields to use their default values",
  671. "consumes": [
  672. "application/json"
  673. ],
  674. "produces": [
  675. "application/json"
  676. ],
  677. "tags": [
  678. "memo"
  679. ],
  680. "summary": "Update a memo",
  681. "parameters": [
  682. {
  683. "type": "integer",
  684. "description": "ID of memo to update",
  685. "name": "memoId",
  686. "in": "path",
  687. "required": true
  688. },
  689. {
  690. "description": "Patched object.",
  691. "name": "body",
  692. "in": "body",
  693. "required": true,
  694. "schema": {
  695. "$ref": "#/definitions/v1.PatchMemoRequest"
  696. }
  697. }
  698. ],
  699. "responses": {
  700. "200": {
  701. "description": "Stored memo",
  702. "schema": {
  703. "$ref": "#/definitions/store.Memo"
  704. }
  705. },
  706. "400": {
  707. "description": "ID is not a number: %s | Malformatted patch memo request | Content size overflow, up to 1MB"
  708. },
  709. "401": {
  710. "description": "Missing user in session | Unauthorized"
  711. },
  712. "404": {
  713. "description": "Memo not found: %d"
  714. },
  715. "500": {
  716. "description": "Failed to find memo | Failed to patch memo | Failed to upsert memo resource | Failed to delete memo resource | Failed to compose memo response"
  717. }
  718. }
  719. }
  720. },
  721. "/api/v1/memo/{memoId}/organizer": {
  722. "post": {
  723. "consumes": [
  724. "application/json"
  725. ],
  726. "produces": [
  727. "application/json"
  728. ],
  729. "tags": [
  730. "memo-organizer"
  731. ],
  732. "summary": "Organize memo (pin/unpin)",
  733. "parameters": [
  734. {
  735. "type": "integer",
  736. "description": "ID of memo to organize",
  737. "name": "memoId",
  738. "in": "path",
  739. "required": true
  740. },
  741. {
  742. "description": "Memo organizer object",
  743. "name": "body",
  744. "in": "body",
  745. "required": true,
  746. "schema": {
  747. "$ref": "#/definitions/v1.UpsertMemoOrganizerRequest"
  748. }
  749. }
  750. ],
  751. "responses": {
  752. "200": {
  753. "description": "Memo information",
  754. "schema": {
  755. "$ref": "#/definitions/store.Memo"
  756. }
  757. },
  758. "400": {
  759. "description": "ID is not a number: %s | Malformatted post memo organizer request"
  760. },
  761. "401": {
  762. "description": "Missing user in session | Unauthorized"
  763. },
  764. "404": {
  765. "description": "Memo not found: %v"
  766. },
  767. "500": {
  768. "description": "Failed to find memo | Failed to upsert memo organizer | Failed to find memo by ID: %v | Failed to compose memo response"
  769. }
  770. }
  771. }
  772. },
  773. "/api/v1/memo/{memoId}/relation": {
  774. "get": {
  775. "consumes": [
  776. "application/json"
  777. ],
  778. "produces": [
  779. "application/json"
  780. ],
  781. "tags": [
  782. "memo-relation"
  783. ],
  784. "summary": "Get a list of Memo Relations",
  785. "parameters": [
  786. {
  787. "type": "integer",
  788. "description": "ID of memo to find relations",
  789. "name": "memoId",
  790. "in": "path",
  791. "required": true
  792. }
  793. ],
  794. "responses": {
  795. "200": {
  796. "description": "Memo relation information list",
  797. "schema": {
  798. "type": "array",
  799. "items": {
  800. "$ref": "#/definitions/store.MemoRelation"
  801. }
  802. }
  803. },
  804. "400": {
  805. "description": "ID is not a number: %s"
  806. },
  807. "500": {
  808. "description": "Failed to list memo relations"
  809. }
  810. }
  811. },
  812. "post": {
  813. "description": "Create a relation between two memos",
  814. "consumes": [
  815. "application/json"
  816. ],
  817. "produces": [
  818. "application/json"
  819. ],
  820. "tags": [
  821. "memo-relation"
  822. ],
  823. "summary": "Create Memo Relation",
  824. "parameters": [
  825. {
  826. "type": "integer",
  827. "description": "ID of memo to relate",
  828. "name": "memoId",
  829. "in": "path",
  830. "required": true
  831. },
  832. {
  833. "description": "Memo relation object",
  834. "name": "body",
  835. "in": "body",
  836. "required": true,
  837. "schema": {
  838. "$ref": "#/definitions/v1.UpsertMemoRelationRequest"
  839. }
  840. }
  841. ],
  842. "responses": {
  843. "200": {
  844. "description": "Memo relation information",
  845. "schema": {
  846. "$ref": "#/definitions/store.MemoRelation"
  847. }
  848. },
  849. "400": {
  850. "description": "ID is not a number: %s | Malformatted post memo relation request"
  851. },
  852. "500": {
  853. "description": "Failed to upsert memo relation"
  854. }
  855. }
  856. }
  857. },
  858. "/api/v1/memo/{memoId}/relation/{relatedMemoId}/type/{relationType}": {
  859. "delete": {
  860. "description": "Removes a relation between two memos",
  861. "consumes": [
  862. "application/json"
  863. ],
  864. "produces": [
  865. "application/json"
  866. ],
  867. "tags": [
  868. "memo-relation"
  869. ],
  870. "summary": "Delete a Memo Relation",
  871. "parameters": [
  872. {
  873. "type": "integer",
  874. "description": "ID of memo to find relations",
  875. "name": "memoId",
  876. "in": "path",
  877. "required": true
  878. },
  879. {
  880. "type": "integer",
  881. "description": "ID of memo to remove relation to",
  882. "name": "relatedMemoId",
  883. "in": "path",
  884. "required": true
  885. },
  886. {
  887. "enum": [
  888. "REFERENCE",
  889. "ADDITIONAL"
  890. ],
  891. "type": "string",
  892. "description": "Type of relation to remove",
  893. "name": "relationType",
  894. "in": "path",
  895. "required": true
  896. }
  897. ],
  898. "responses": {
  899. "200": {
  900. "description": "Memo relation deleted",
  901. "schema": {
  902. "type": "boolean"
  903. }
  904. },
  905. "400": {
  906. "description": "Memo ID is not a number: %s | Related memo ID is not a number: %s"
  907. },
  908. "500": {
  909. "description": "Failed to delete memo relation"
  910. }
  911. }
  912. }
  913. },
  914. "/api/v1/ping": {
  915. "get": {
  916. "produces": [
  917. "application/json"
  918. ],
  919. "tags": [
  920. "system"
  921. ],
  922. "summary": "Ping the system",
  923. "responses": {
  924. "200": {
  925. "description": "If succeed to ping the system",
  926. "schema": {
  927. "type": "boolean"
  928. }
  929. }
  930. }
  931. }
  932. },
  933. "/api/v1/resource": {
  934. "get": {
  935. "produces": [
  936. "application/json"
  937. ],
  938. "tags": [
  939. "resource"
  940. ],
  941. "summary": "Get a list of resources",
  942. "parameters": [
  943. {
  944. "type": "integer",
  945. "description": "Limit",
  946. "name": "limit",
  947. "in": "query"
  948. },
  949. {
  950. "type": "integer",
  951. "description": "Offset",
  952. "name": "offset",
  953. "in": "query"
  954. }
  955. ],
  956. "responses": {
  957. "200": {
  958. "description": "Resource list",
  959. "schema": {
  960. "type": "array",
  961. "items": {
  962. "$ref": "#/definitions/store.Resource"
  963. }
  964. }
  965. },
  966. "401": {
  967. "description": "Missing user in session"
  968. },
  969. "500": {
  970. "description": "Failed to fetch resource list"
  971. }
  972. }
  973. },
  974. "post": {
  975. "consumes": [
  976. "application/json"
  977. ],
  978. "produces": [
  979. "application/json"
  980. ],
  981. "tags": [
  982. "resource"
  983. ],
  984. "summary": "Create resource",
  985. "parameters": [
  986. {
  987. "description": "Request object.",
  988. "name": "body",
  989. "in": "body",
  990. "required": true,
  991. "schema": {
  992. "$ref": "#/definitions/v1.CreateResourceRequest"
  993. }
  994. }
  995. ],
  996. "responses": {
  997. "200": {
  998. "description": "Created resource",
  999. "schema": {
  1000. "$ref": "#/definitions/store.Resource"
  1001. }
  1002. },
  1003. "400": {
  1004. "description": "Malformatted post resource request | Invalid external link | Invalid external link scheme | Failed to request %s | Failed to read %s | Failed to read mime from %s"
  1005. },
  1006. "401": {
  1007. "description": "Missing user in session"
  1008. },
  1009. "500": {
  1010. "description": "Failed to save resource | Failed to create resource | Failed to create activity"
  1011. }
  1012. }
  1013. }
  1014. },
  1015. "/api/v1/resource/blob": {
  1016. "post": {
  1017. "consumes": [
  1018. "multipart/form-data"
  1019. ],
  1020. "produces": [
  1021. "application/json"
  1022. ],
  1023. "tags": [
  1024. "resource"
  1025. ],
  1026. "summary": "Upload resource",
  1027. "parameters": [
  1028. {
  1029. "type": "file",
  1030. "description": "File to upload",
  1031. "name": "file",
  1032. "in": "formData",
  1033. "required": true
  1034. }
  1035. ],
  1036. "responses": {
  1037. "200": {
  1038. "description": "Created resource",
  1039. "schema": {
  1040. "$ref": "#/definitions/store.Resource"
  1041. }
  1042. },
  1043. "400": {
  1044. "description": "Upload file not found | File size exceeds allowed limit of %d MiB | Failed to parse upload data"
  1045. },
  1046. "401": {
  1047. "description": "Missing user in session"
  1048. },
  1049. "500": {
  1050. "description": "Failed to get uploading file | Failed to open file | Failed to save resource | Failed to create resource | Failed to create activity"
  1051. }
  1052. }
  1053. }
  1054. },
  1055. "/api/v1/resource/{resourceId}": {
  1056. "delete": {
  1057. "produces": [
  1058. "application/json"
  1059. ],
  1060. "tags": [
  1061. "resource"
  1062. ],
  1063. "summary": "Delete a resource",
  1064. "parameters": [
  1065. {
  1066. "type": "integer",
  1067. "description": "Resource ID",
  1068. "name": "resourceId",
  1069. "in": "path",
  1070. "required": true
  1071. }
  1072. ],
  1073. "responses": {
  1074. "200": {
  1075. "description": "Resource deleted",
  1076. "schema": {
  1077. "type": "boolean"
  1078. }
  1079. },
  1080. "400": {
  1081. "description": "ID is not a number: %s"
  1082. },
  1083. "401": {
  1084. "description": "Missing user in session"
  1085. },
  1086. "404": {
  1087. "description": "Resource not found: %d"
  1088. },
  1089. "500": {
  1090. "description": "Failed to find resource | Failed to delete resource"
  1091. }
  1092. }
  1093. },
  1094. "patch": {
  1095. "produces": [
  1096. "application/json"
  1097. ],
  1098. "tags": [
  1099. "resource"
  1100. ],
  1101. "summary": "Update a resource",
  1102. "parameters": [
  1103. {
  1104. "type": "integer",
  1105. "description": "Resource ID",
  1106. "name": "resourceId",
  1107. "in": "path",
  1108. "required": true
  1109. },
  1110. {
  1111. "description": "Patch resource request",
  1112. "name": "patch",
  1113. "in": "body",
  1114. "required": true,
  1115. "schema": {
  1116. "$ref": "#/definitions/v1.UpdateResourceRequest"
  1117. }
  1118. }
  1119. ],
  1120. "responses": {
  1121. "200": {
  1122. "description": "Updated resource",
  1123. "schema": {
  1124. "$ref": "#/definitions/store.Resource"
  1125. }
  1126. },
  1127. "400": {
  1128. "description": "ID is not a number: %s | Malformatted patch resource request"
  1129. },
  1130. "401": {
  1131. "description": "Missing user in session | Unauthorized"
  1132. },
  1133. "404": {
  1134. "description": "Resource not found: %d"
  1135. },
  1136. "500": {
  1137. "description": "Failed to find resource | Failed to patch resource"
  1138. }
  1139. }
  1140. }
  1141. },
  1142. "/api/v1/status": {
  1143. "get": {
  1144. "produces": [
  1145. "application/json"
  1146. ],
  1147. "tags": [
  1148. "system"
  1149. ],
  1150. "summary": "Get system GetSystemStatus",
  1151. "responses": {
  1152. "200": {
  1153. "description": "System GetSystemStatus",
  1154. "schema": {
  1155. "$ref": "#/definitions/v1.SystemStatus"
  1156. }
  1157. },
  1158. "401": {
  1159. "description": "Missing user in session | Unauthorized"
  1160. },
  1161. "500": {
  1162. "description": "Failed to find host user | Failed to find system setting list | Failed to unmarshal system setting customized profile value"
  1163. }
  1164. }
  1165. }
  1166. },
  1167. "/api/v1/storage": {
  1168. "get": {
  1169. "produces": [
  1170. "application/json"
  1171. ],
  1172. "tags": [
  1173. "storage"
  1174. ],
  1175. "summary": "Get a list of storages",
  1176. "responses": {
  1177. "200": {
  1178. "description": "List of storages",
  1179. "schema": {
  1180. "type": "array",
  1181. "items": {
  1182. "$ref": "#/definitions/store.Storage"
  1183. }
  1184. }
  1185. },
  1186. "401": {
  1187. "description": "Missing user in session | Unauthorized"
  1188. },
  1189. "500": {
  1190. "description": "Failed to find user | Failed to convert storage"
  1191. }
  1192. }
  1193. },
  1194. "post": {
  1195. "consumes": [
  1196. "application/json"
  1197. ],
  1198. "produces": [
  1199. "application/json"
  1200. ],
  1201. "tags": [
  1202. "storage"
  1203. ],
  1204. "summary": "Create storage",
  1205. "parameters": [
  1206. {
  1207. "description": "Request object.",
  1208. "name": "body",
  1209. "in": "body",
  1210. "required": true,
  1211. "schema": {
  1212. "$ref": "#/definitions/v1.CreateStorageRequest"
  1213. }
  1214. }
  1215. ],
  1216. "responses": {
  1217. "200": {
  1218. "description": "Created storage",
  1219. "schema": {
  1220. "$ref": "#/definitions/store.Storage"
  1221. }
  1222. },
  1223. "400": {
  1224. "description": "Malformatted post storage request"
  1225. },
  1226. "401": {
  1227. "description": "Missing user in session"
  1228. },
  1229. "500": {
  1230. "description": "Failed to find user | Failed to create storage | Failed to convert storage"
  1231. }
  1232. }
  1233. }
  1234. },
  1235. "/api/v1/storage/{storageId}": {
  1236. "delete": {
  1237. "produces": [
  1238. "application/json"
  1239. ],
  1240. "tags": [
  1241. "storage"
  1242. ],
  1243. "summary": "Delete a storage",
  1244. "parameters": [
  1245. {
  1246. "type": "integer",
  1247. "description": "Storage ID",
  1248. "name": "storageId",
  1249. "in": "path",
  1250. "required": true
  1251. }
  1252. ],
  1253. "responses": {
  1254. "200": {
  1255. "description": "Storage deleted",
  1256. "schema": {
  1257. "type": "boolean"
  1258. }
  1259. },
  1260. "400": {
  1261. "description": "ID is not a number: %s | Storage service %d is using"
  1262. },
  1263. "401": {
  1264. "description": "Missing user in session | Unauthorized"
  1265. },
  1266. "500": {
  1267. "description": "Failed to find user | Failed to find storage | Failed to unmarshal storage service id | Failed to delete storage"
  1268. }
  1269. }
  1270. },
  1271. "patch": {
  1272. "produces": [
  1273. "application/json"
  1274. ],
  1275. "tags": [
  1276. "storage"
  1277. ],
  1278. "summary": "Update a storage",
  1279. "parameters": [
  1280. {
  1281. "type": "integer",
  1282. "description": "Storage ID",
  1283. "name": "storageId",
  1284. "in": "path",
  1285. "required": true
  1286. },
  1287. {
  1288. "description": "Patch request",
  1289. "name": "patch",
  1290. "in": "body",
  1291. "required": true,
  1292. "schema": {
  1293. "$ref": "#/definitions/v1.UpdateStorageRequest"
  1294. }
  1295. }
  1296. ],
  1297. "responses": {
  1298. "200": {
  1299. "description": "Updated resource",
  1300. "schema": {
  1301. "$ref": "#/definitions/store.Storage"
  1302. }
  1303. },
  1304. "400": {
  1305. "description": "ID is not a number: %s | Malformatted patch storage request | Malformatted post storage request"
  1306. },
  1307. "401": {
  1308. "description": "Missing user in session | Unauthorized"
  1309. },
  1310. "500": {
  1311. "description": "Failed to find user | Failed to patch storage | Failed to convert storage"
  1312. }
  1313. }
  1314. }
  1315. },
  1316. "/api/v1/system/setting": {
  1317. "get": {
  1318. "produces": [
  1319. "application/json"
  1320. ],
  1321. "tags": [
  1322. "system-setting"
  1323. ],
  1324. "summary": "Get a list of system settings",
  1325. "responses": {
  1326. "200": {
  1327. "description": "System setting list",
  1328. "schema": {
  1329. "type": "array",
  1330. "items": {
  1331. "$ref": "#/definitions/v1.SystemSetting"
  1332. }
  1333. }
  1334. },
  1335. "401": {
  1336. "description": "Missing user in session | Unauthorized"
  1337. },
  1338. "500": {
  1339. "description": "Failed to find user | Failed to find system setting list"
  1340. }
  1341. }
  1342. },
  1343. "post": {
  1344. "consumes": [
  1345. "application/json"
  1346. ],
  1347. "produces": [
  1348. "application/json"
  1349. ],
  1350. "tags": [
  1351. "system-setting"
  1352. ],
  1353. "summary": "Create system setting",
  1354. "parameters": [
  1355. {
  1356. "description": "Request object.",
  1357. "name": "body",
  1358. "in": "body",
  1359. "required": true,
  1360. "schema": {
  1361. "$ref": "#/definitions/v1.UpsertSystemSettingRequest"
  1362. }
  1363. }
  1364. ],
  1365. "responses": {
  1366. "200": {
  1367. "description": "Created system setting",
  1368. "schema": {
  1369. "$ref": "#/definitions/store.SystemSetting"
  1370. }
  1371. },
  1372. "400": {
  1373. "description": "Malformatted post system setting request | invalid system setting"
  1374. },
  1375. "401": {
  1376. "description": "Missing user in session | Unauthorized"
  1377. },
  1378. "403": {
  1379. "description": "Cannot disable passwords if no SSO identity provider is configured."
  1380. },
  1381. "500": {
  1382. "description": "Failed to find user | Failed to upsert system setting"
  1383. }
  1384. }
  1385. }
  1386. },
  1387. "/api/v1/system/vacuum": {
  1388. "post": {
  1389. "produces": [
  1390. "application/json"
  1391. ],
  1392. "tags": [
  1393. "system"
  1394. ],
  1395. "summary": "Vacuum the database",
  1396. "responses": {
  1397. "200": {
  1398. "description": "Database vacuumed",
  1399. "schema": {
  1400. "type": "boolean"
  1401. }
  1402. },
  1403. "401": {
  1404. "description": "Missing user in session | Unauthorized"
  1405. },
  1406. "500": {
  1407. "description": "Failed to find user | Failed to ExecVacuum database"
  1408. }
  1409. }
  1410. }
  1411. },
  1412. "/api/v1/tag": {
  1413. "get": {
  1414. "produces": [
  1415. "application/json"
  1416. ],
  1417. "tags": [
  1418. "tag"
  1419. ],
  1420. "summary": "Get a list of tags",
  1421. "responses": {
  1422. "200": {
  1423. "description": "Tag list",
  1424. "schema": {
  1425. "type": "array",
  1426. "items": {
  1427. "type": "string"
  1428. }
  1429. }
  1430. },
  1431. "400": {
  1432. "description": "Missing user id to find tag"
  1433. },
  1434. "500": {
  1435. "description": "Failed to find tag list"
  1436. }
  1437. }
  1438. },
  1439. "post": {
  1440. "consumes": [
  1441. "application/json"
  1442. ],
  1443. "produces": [
  1444. "application/json"
  1445. ],
  1446. "tags": [
  1447. "tag"
  1448. ],
  1449. "summary": "Create a tag",
  1450. "parameters": [
  1451. {
  1452. "description": "Request object.",
  1453. "name": "body",
  1454. "in": "body",
  1455. "required": true,
  1456. "schema": {
  1457. "$ref": "#/definitions/v1.UpsertTagRequest"
  1458. }
  1459. }
  1460. ],
  1461. "responses": {
  1462. "200": {
  1463. "description": "Created tag name",
  1464. "schema": {
  1465. "type": "string"
  1466. }
  1467. },
  1468. "400": {
  1469. "description": "Malformatted post tag request | Tag name shouldn't be empty"
  1470. },
  1471. "401": {
  1472. "description": "Missing user in session"
  1473. },
  1474. "500": {
  1475. "description": "Failed to upsert tag | Failed to create activity"
  1476. }
  1477. }
  1478. }
  1479. },
  1480. "/api/v1/tag/delete": {
  1481. "post": {
  1482. "consumes": [
  1483. "application/json"
  1484. ],
  1485. "produces": [
  1486. "application/json"
  1487. ],
  1488. "tags": [
  1489. "tag"
  1490. ],
  1491. "summary": "Delete a tag",
  1492. "parameters": [
  1493. {
  1494. "description": "Request object.",
  1495. "name": "body",
  1496. "in": "body",
  1497. "required": true,
  1498. "schema": {
  1499. "$ref": "#/definitions/v1.DeleteTagRequest"
  1500. }
  1501. }
  1502. ],
  1503. "responses": {
  1504. "200": {
  1505. "description": "Tag deleted",
  1506. "schema": {
  1507. "type": "boolean"
  1508. }
  1509. },
  1510. "400": {
  1511. "description": "Malformatted post tag request | Tag name shouldn't be empty"
  1512. },
  1513. "401": {
  1514. "description": "Missing user in session"
  1515. },
  1516. "500": {
  1517. "description": "Failed to delete tag name: %v"
  1518. }
  1519. }
  1520. }
  1521. },
  1522. "/api/v1/tag/suggestion": {
  1523. "get": {
  1524. "produces": [
  1525. "application/json"
  1526. ],
  1527. "tags": [
  1528. "tag"
  1529. ],
  1530. "summary": "Get a list of tags suggested from other memos contents",
  1531. "responses": {
  1532. "200": {
  1533. "description": "Tag list",
  1534. "schema": {
  1535. "type": "array",
  1536. "items": {
  1537. "type": "string"
  1538. }
  1539. }
  1540. },
  1541. "400": {
  1542. "description": "Missing user session"
  1543. },
  1544. "500": {
  1545. "description": "Failed to find memo list | Failed to find tag list"
  1546. }
  1547. }
  1548. }
  1549. },
  1550. "/api/v1/user": {
  1551. "get": {
  1552. "produces": [
  1553. "application/json"
  1554. ],
  1555. "tags": [
  1556. "user"
  1557. ],
  1558. "summary": "Get a list of users",
  1559. "responses": {
  1560. "200": {
  1561. "description": "User list",
  1562. "schema": {
  1563. "type": "array",
  1564. "items": {
  1565. "$ref": "#/definitions/store.User"
  1566. }
  1567. }
  1568. },
  1569. "500": {
  1570. "description": "Failed to fetch user list"
  1571. }
  1572. }
  1573. },
  1574. "post": {
  1575. "consumes": [
  1576. "application/json"
  1577. ],
  1578. "produces": [
  1579. "application/json"
  1580. ],
  1581. "tags": [
  1582. "user"
  1583. ],
  1584. "summary": "Create a user",
  1585. "parameters": [
  1586. {
  1587. "description": "Request object",
  1588. "name": "body",
  1589. "in": "body",
  1590. "required": true,
  1591. "schema": {
  1592. "$ref": "#/definitions/v1.CreateUserRequest"
  1593. }
  1594. }
  1595. ],
  1596. "responses": {
  1597. "200": {
  1598. "description": "Created user",
  1599. "schema": {
  1600. "$ref": "#/definitions/store.User"
  1601. }
  1602. },
  1603. "400": {
  1604. "description": "Malformatted post user request | Invalid user create format"
  1605. },
  1606. "401": {
  1607. "description": "Missing auth session | Unauthorized to create user"
  1608. },
  1609. "403": {
  1610. "description": "Could not create host user"
  1611. },
  1612. "500": {
  1613. "description": "Failed to find user by id | Failed to generate password hash | Failed to create user | Failed to create activity"
  1614. }
  1615. }
  1616. }
  1617. },
  1618. "/api/v1/user/me": {
  1619. "get": {
  1620. "produces": [
  1621. "application/json"
  1622. ],
  1623. "tags": [
  1624. "user"
  1625. ],
  1626. "summary": "Get current user",
  1627. "responses": {
  1628. "200": {
  1629. "description": "Current user",
  1630. "schema": {
  1631. "$ref": "#/definitions/store.User"
  1632. }
  1633. },
  1634. "401": {
  1635. "description": "Missing auth session"
  1636. },
  1637. "500": {
  1638. "description": "Failed to find user | Failed to find userSettingList"
  1639. }
  1640. }
  1641. }
  1642. },
  1643. "/api/v1/user/name/{username}": {
  1644. "get": {
  1645. "produces": [
  1646. "application/json"
  1647. ],
  1648. "tags": [
  1649. "user"
  1650. ],
  1651. "summary": "Get user by username",
  1652. "parameters": [
  1653. {
  1654. "type": "string",
  1655. "description": "Username",
  1656. "name": "username",
  1657. "in": "path",
  1658. "required": true
  1659. }
  1660. ],
  1661. "responses": {
  1662. "200": {
  1663. "description": "Requested user",
  1664. "schema": {
  1665. "$ref": "#/definitions/store.User"
  1666. }
  1667. },
  1668. "404": {
  1669. "description": "User not found"
  1670. },
  1671. "500": {
  1672. "description": "Failed to find user"
  1673. }
  1674. }
  1675. }
  1676. },
  1677. "/api/v1/user/setting": {
  1678. "post": {
  1679. "consumes": [
  1680. "application/json"
  1681. ],
  1682. "produces": [
  1683. "application/json"
  1684. ],
  1685. "tags": [
  1686. "user-setting"
  1687. ],
  1688. "summary": "Upsert user setting",
  1689. "parameters": [
  1690. {
  1691. "description": "Request object.",
  1692. "name": "body",
  1693. "in": "body",
  1694. "required": true,
  1695. "schema": {
  1696. "$ref": "#/definitions/v1.UpsertUserSettingRequest"
  1697. }
  1698. }
  1699. ],
  1700. "responses": {
  1701. "200": {
  1702. "description": "Created user setting",
  1703. "schema": {
  1704. "$ref": "#/definitions/github_com_usememos_memos_store.UserSetting"
  1705. }
  1706. },
  1707. "400": {
  1708. "description": "Malformatted post user setting upsert request | Invalid user setting format"
  1709. },
  1710. "401": {
  1711. "description": "Missing auth session"
  1712. },
  1713. "500": {
  1714. "description": "Failed to upsert user setting"
  1715. }
  1716. }
  1717. }
  1718. },
  1719. "/api/v1/user/{id}": {
  1720. "get": {
  1721. "produces": [
  1722. "application/json"
  1723. ],
  1724. "tags": [
  1725. "user"
  1726. ],
  1727. "summary": "Get user by id",
  1728. "parameters": [
  1729. {
  1730. "type": "integer",
  1731. "description": "User ID",
  1732. "name": "id",
  1733. "in": "path",
  1734. "required": true
  1735. }
  1736. ],
  1737. "responses": {
  1738. "200": {
  1739. "description": "Requested user",
  1740. "schema": {
  1741. "$ref": "#/definitions/store.User"
  1742. }
  1743. },
  1744. "400": {
  1745. "description": "Malformatted user id"
  1746. },
  1747. "404": {
  1748. "description": "User not found"
  1749. },
  1750. "500": {
  1751. "description": "Failed to find user"
  1752. }
  1753. }
  1754. },
  1755. "delete": {
  1756. "produces": [
  1757. "application/json"
  1758. ],
  1759. "tags": [
  1760. "user"
  1761. ],
  1762. "summary": "Delete a user",
  1763. "parameters": [
  1764. {
  1765. "type": "string",
  1766. "description": "User ID",
  1767. "name": "id",
  1768. "in": "path",
  1769. "required": true
  1770. }
  1771. ],
  1772. "responses": {
  1773. "200": {
  1774. "description": "User deleted",
  1775. "schema": {
  1776. "type": "boolean"
  1777. }
  1778. },
  1779. "400": {
  1780. "description": "ID is not a number: %s | Current session user not found with ID: %d"
  1781. },
  1782. "401": {
  1783. "description": "Missing user in session"
  1784. },
  1785. "403": {
  1786. "description": "Unauthorized to delete user"
  1787. },
  1788. "500": {
  1789. "description": "Failed to find user | Failed to delete user"
  1790. }
  1791. }
  1792. },
  1793. "patch": {
  1794. "produces": [
  1795. "application/json"
  1796. ],
  1797. "tags": [
  1798. "user"
  1799. ],
  1800. "summary": "Update a user",
  1801. "parameters": [
  1802. {
  1803. "type": "string",
  1804. "description": "User ID",
  1805. "name": "id",
  1806. "in": "path",
  1807. "required": true
  1808. },
  1809. {
  1810. "description": "Patch request",
  1811. "name": "patch",
  1812. "in": "body",
  1813. "required": true,
  1814. "schema": {
  1815. "$ref": "#/definitions/v1.UpdateUserRequest"
  1816. }
  1817. }
  1818. ],
  1819. "responses": {
  1820. "200": {
  1821. "description": "Updated user",
  1822. "schema": {
  1823. "$ref": "#/definitions/store.User"
  1824. }
  1825. },
  1826. "400": {
  1827. "description": "ID is not a number: %s | Current session user not found with ID: %d | Malformatted patch user request | Invalid update user request"
  1828. },
  1829. "401": {
  1830. "description": "Missing user in session"
  1831. },
  1832. "403": {
  1833. "description": "Unauthorized to update user"
  1834. },
  1835. "500": {
  1836. "description": "Failed to find user | Failed to generate password hash | Failed to patch user | Failed to find userSettingList"
  1837. }
  1838. }
  1839. }
  1840. },
  1841. "/explore/rss.xml": {
  1842. "get": {
  1843. "produces": [
  1844. "text/xml"
  1845. ],
  1846. "tags": [
  1847. "rss"
  1848. ],
  1849. "summary": "Get RSS",
  1850. "responses": {
  1851. "200": {
  1852. "description": "RSS"
  1853. },
  1854. "500": {
  1855. "description": "Failed to get system customized profile | Failed to find memo list | Failed to generate rss"
  1856. }
  1857. }
  1858. }
  1859. },
  1860. "/o/get/GetImage": {
  1861. "get": {
  1862. "produces": [
  1863. "GetImage/*"
  1864. ],
  1865. "tags": [
  1866. "get"
  1867. ],
  1868. "summary": "Get GetImage from URL",
  1869. "parameters": [
  1870. {
  1871. "type": "string",
  1872. "description": "Image url",
  1873. "name": "url",
  1874. "in": "query",
  1875. "required": true
  1876. }
  1877. ],
  1878. "responses": {
  1879. "200": {
  1880. "description": "Image"
  1881. },
  1882. "400": {
  1883. "description": "Missing GetImage url | Wrong url | Failed to get GetImage url: %s"
  1884. },
  1885. "500": {
  1886. "description": "Failed to write GetImage blob"
  1887. }
  1888. }
  1889. }
  1890. },
  1891. "/o/get/GetWebsiteMetadata": {
  1892. "get": {
  1893. "produces": [
  1894. "application/json"
  1895. ],
  1896. "tags": [
  1897. "get"
  1898. ],
  1899. "summary": "Get website metadata",
  1900. "parameters": [
  1901. {
  1902. "type": "string",
  1903. "description": "Website URL",
  1904. "name": "url",
  1905. "in": "query",
  1906. "required": true
  1907. }
  1908. ],
  1909. "responses": {
  1910. "200": {
  1911. "description": "Extracted metadata",
  1912. "schema": {
  1913. "$ref": "#/definitions/getter.HTMLMeta"
  1914. }
  1915. },
  1916. "400": {
  1917. "description": "Missing website url | Wrong url"
  1918. },
  1919. "406": {
  1920. "description": "Failed to get website meta with url: %s"
  1921. }
  1922. }
  1923. }
  1924. },
  1925. "/o/r/{resourceId}": {
  1926. "get": {
  1927. "description": "*Swagger UI may have problems displaying other file types than images",
  1928. "produces": [
  1929. "application/octet-stream"
  1930. ],
  1931. "tags": [
  1932. "resource"
  1933. ],
  1934. "summary": "Stream a resource",
  1935. "parameters": [
  1936. {
  1937. "type": "integer",
  1938. "description": "Resource ID",
  1939. "name": "resourceId",
  1940. "in": "path",
  1941. "required": true
  1942. },
  1943. {
  1944. "type": "integer",
  1945. "description": "Thumbnail",
  1946. "name": "thumbnail",
  1947. "in": "query"
  1948. }
  1949. ],
  1950. "responses": {
  1951. "200": {
  1952. "description": "Requested resource"
  1953. },
  1954. "400": {
  1955. "description": "ID is not a number: %s | Failed to get resource visibility"
  1956. },
  1957. "401": {
  1958. "description": "Resource visibility not match"
  1959. },
  1960. "404": {
  1961. "description": "Resource not found: %d"
  1962. },
  1963. "500": {
  1964. "description": "Failed to find resource by ID: %v | Failed to open the local resource: %s | Failed to read the local resource: %s"
  1965. }
  1966. }
  1967. }
  1968. },
  1969. "/u/{id}/rss.xml": {
  1970. "get": {
  1971. "produces": [
  1972. "text/xml"
  1973. ],
  1974. "tags": [
  1975. "rss"
  1976. ],
  1977. "summary": "Get RSS for a user",
  1978. "parameters": [
  1979. {
  1980. "type": "integer",
  1981. "description": "User ID",
  1982. "name": "id",
  1983. "in": "path",
  1984. "required": true
  1985. }
  1986. ],
  1987. "responses": {
  1988. "200": {
  1989. "description": "RSS"
  1990. },
  1991. "400": {
  1992. "description": "User id is not a number"
  1993. },
  1994. "500": {
  1995. "description": "Failed to get system customized profile | Failed to find memo list | Failed to generate rss"
  1996. }
  1997. }
  1998. }
  1999. }
  2000. },
  2001. "definitions": {
  2002. "getter.HTMLMeta": {
  2003. "type": "object",
  2004. "properties": {
  2005. "description": {
  2006. "type": "string"
  2007. },
  2008. "image": {
  2009. "type": "string"
  2010. },
  2011. "title": {
  2012. "type": "string"
  2013. }
  2014. }
  2015. },
  2016. "github_com_usememos_memos_store.UserSetting": {
  2017. "type": "object",
  2018. "properties": {
  2019. "key": {
  2020. "type": "string"
  2021. },
  2022. "userID": {
  2023. "type": "integer"
  2024. },
  2025. "value": {
  2026. "type": "string"
  2027. }
  2028. }
  2029. },
  2030. "profile.Profile": {
  2031. "type": "object",
  2032. "properties": {
  2033. "mode": {
  2034. "description": "Mode can be \"prod\" or \"dev\" or \"demo\"",
  2035. "type": "string"
  2036. },
  2037. "version": {
  2038. "description": "Version is the current version of server",
  2039. "type": "string"
  2040. }
  2041. }
  2042. },
  2043. "store.FieldMapping": {
  2044. "type": "object",
  2045. "properties": {
  2046. "displayName": {
  2047. "type": "string"
  2048. },
  2049. "email": {
  2050. "type": "string"
  2051. },
  2052. "identifier": {
  2053. "type": "string"
  2054. }
  2055. }
  2056. },
  2057. "store.IdentityProvider": {
  2058. "type": "object",
  2059. "properties": {
  2060. "config": {
  2061. "$ref": "#/definitions/store.IdentityProviderConfig"
  2062. },
  2063. "id": {
  2064. "type": "integer"
  2065. },
  2066. "identifierFilter": {
  2067. "type": "string"
  2068. },
  2069. "name": {
  2070. "type": "string"
  2071. },
  2072. "type": {
  2073. "$ref": "#/definitions/store.IdentityProviderType"
  2074. }
  2075. }
  2076. },
  2077. "store.IdentityProviderConfig": {
  2078. "type": "object",
  2079. "properties": {
  2080. "oauth2Config": {
  2081. "$ref": "#/definitions/store.IdentityProviderOAuth2Config"
  2082. }
  2083. }
  2084. },
  2085. "store.IdentityProviderOAuth2Config": {
  2086. "type": "object",
  2087. "properties": {
  2088. "authUrl": {
  2089. "type": "string"
  2090. },
  2091. "clientId": {
  2092. "type": "string"
  2093. },
  2094. "clientSecret": {
  2095. "type": "string"
  2096. },
  2097. "fieldMapping": {
  2098. "$ref": "#/definitions/store.FieldMapping"
  2099. },
  2100. "scopes": {
  2101. "type": "array",
  2102. "items": {
  2103. "type": "string"
  2104. }
  2105. },
  2106. "tokenUrl": {
  2107. "type": "string"
  2108. },
  2109. "userInfoUrl": {
  2110. "type": "string"
  2111. }
  2112. }
  2113. },
  2114. "store.IdentityProviderType": {
  2115. "type": "string",
  2116. "enum": [
  2117. "OAUTH2"
  2118. ],
  2119. "x-enum-varnames": [
  2120. "IdentityProviderOAuth2Type"
  2121. ]
  2122. },
  2123. "store.Memo": {
  2124. "type": "object",
  2125. "properties": {
  2126. "content": {
  2127. "description": "Domain specific fields",
  2128. "type": "string"
  2129. },
  2130. "createdTs": {
  2131. "type": "integer"
  2132. },
  2133. "creatorID": {
  2134. "type": "integer"
  2135. },
  2136. "id": {
  2137. "type": "integer"
  2138. },
  2139. "pinned": {
  2140. "description": "Composed fields",
  2141. "type": "boolean"
  2142. },
  2143. "relationList": {
  2144. "type": "array",
  2145. "items": {
  2146. "$ref": "#/definitions/store.MemoRelation"
  2147. }
  2148. },
  2149. "resourceIDList": {
  2150. "type": "array",
  2151. "items": {
  2152. "type": "integer"
  2153. }
  2154. },
  2155. "rowStatus": {
  2156. "description": "Standard fields",
  2157. "allOf": [
  2158. {
  2159. "$ref": "#/definitions/store.RowStatus"
  2160. }
  2161. ]
  2162. },
  2163. "updatedTs": {
  2164. "type": "integer"
  2165. },
  2166. "visibility": {
  2167. "$ref": "#/definitions/store.Visibility"
  2168. }
  2169. }
  2170. },
  2171. "store.MemoRelation": {
  2172. "type": "object",
  2173. "properties": {
  2174. "memoID": {
  2175. "type": "integer"
  2176. },
  2177. "relatedMemoID": {
  2178. "type": "integer"
  2179. },
  2180. "type": {
  2181. "$ref": "#/definitions/store.MemoRelationType"
  2182. }
  2183. }
  2184. },
  2185. "store.MemoRelationType": {
  2186. "type": "string",
  2187. "enum": [
  2188. "REFERENCE",
  2189. "ADDITIONAL"
  2190. ],
  2191. "x-enum-varnames": [
  2192. "MemoRelationReference",
  2193. "MemoRelationAdditional"
  2194. ]
  2195. },
  2196. "store.Resource": {
  2197. "type": "object",
  2198. "properties": {
  2199. "blob": {
  2200. "type": "array",
  2201. "items": {
  2202. "type": "integer"
  2203. }
  2204. },
  2205. "createdTs": {
  2206. "type": "integer"
  2207. },
  2208. "creatorID": {
  2209. "description": "Standard fields",
  2210. "type": "integer"
  2211. },
  2212. "externalLink": {
  2213. "type": "string"
  2214. },
  2215. "filename": {
  2216. "description": "Domain specific fields",
  2217. "type": "string"
  2218. },
  2219. "id": {
  2220. "type": "integer"
  2221. },
  2222. "internalPath": {
  2223. "type": "string"
  2224. },
  2225. "memoID": {
  2226. "type": "integer"
  2227. },
  2228. "size": {
  2229. "type": "integer"
  2230. },
  2231. "type": {
  2232. "type": "string"
  2233. },
  2234. "updatedTs": {
  2235. "type": "integer"
  2236. }
  2237. }
  2238. },
  2239. "store.Role": {
  2240. "type": "string",
  2241. "enum": [
  2242. "HOST",
  2243. "ADMIN",
  2244. "USER"
  2245. ],
  2246. "x-enum-varnames": [
  2247. "RoleHost",
  2248. "RoleAdmin",
  2249. "RoleUser"
  2250. ]
  2251. },
  2252. "store.RowStatus": {
  2253. "type": "string",
  2254. "enum": [
  2255. "NORMAL",
  2256. "ARCHIVED"
  2257. ],
  2258. "x-enum-varnames": [
  2259. "Normal",
  2260. "Archived"
  2261. ]
  2262. },
  2263. "store.Storage": {
  2264. "type": "object",
  2265. "properties": {
  2266. "config": {
  2267. "type": "string"
  2268. },
  2269. "id": {
  2270. "type": "integer"
  2271. },
  2272. "name": {
  2273. "type": "string"
  2274. },
  2275. "type": {
  2276. "type": "string"
  2277. }
  2278. }
  2279. },
  2280. "store.SystemSetting": {
  2281. "type": "object",
  2282. "properties": {
  2283. "description": {
  2284. "type": "string"
  2285. },
  2286. "name": {
  2287. "type": "string"
  2288. },
  2289. "value": {
  2290. "type": "string"
  2291. }
  2292. }
  2293. },
  2294. "store.User": {
  2295. "type": "object",
  2296. "properties": {
  2297. "avatarURL": {
  2298. "type": "string"
  2299. },
  2300. "createdTs": {
  2301. "type": "integer"
  2302. },
  2303. "email": {
  2304. "type": "string"
  2305. },
  2306. "id": {
  2307. "type": "integer"
  2308. },
  2309. "nickname": {
  2310. "type": "string"
  2311. },
  2312. "passwordHash": {
  2313. "type": "string"
  2314. },
  2315. "role": {
  2316. "$ref": "#/definitions/store.Role"
  2317. },
  2318. "rowStatus": {
  2319. "description": "Standard fields",
  2320. "allOf": [
  2321. {
  2322. "$ref": "#/definitions/store.RowStatus"
  2323. }
  2324. ]
  2325. },
  2326. "updatedTs": {
  2327. "type": "integer"
  2328. },
  2329. "username": {
  2330. "description": "Domain specific fields",
  2331. "type": "string"
  2332. }
  2333. }
  2334. },
  2335. "store.Visibility": {
  2336. "type": "string",
  2337. "enum": [
  2338. "PUBLIC",
  2339. "PROTECTED",
  2340. "PRIVATE"
  2341. ],
  2342. "x-enum-varnames": [
  2343. "Public",
  2344. "Protected",
  2345. "Private"
  2346. ]
  2347. },
  2348. "v1.CreateIdentityProviderRequest": {
  2349. "type": "object",
  2350. "properties": {
  2351. "config": {
  2352. "$ref": "#/definitions/v1.IdentityProviderConfig"
  2353. },
  2354. "identifierFilter": {
  2355. "type": "string"
  2356. },
  2357. "name": {
  2358. "type": "string"
  2359. },
  2360. "type": {
  2361. "$ref": "#/definitions/v1.IdentityProviderType"
  2362. }
  2363. }
  2364. },
  2365. "v1.CreateMemoRequest": {
  2366. "type": "object",
  2367. "properties": {
  2368. "content": {
  2369. "type": "string"
  2370. },
  2371. "createdTs": {
  2372. "type": "integer"
  2373. },
  2374. "relationList": {
  2375. "type": "array",
  2376. "items": {
  2377. "$ref": "#/definitions/v1.UpsertMemoRelationRequest"
  2378. }
  2379. },
  2380. "resourceIdList": {
  2381. "description": "Related fields",
  2382. "type": "array",
  2383. "items": {
  2384. "type": "integer"
  2385. }
  2386. },
  2387. "visibility": {
  2388. "description": "Domain specific fields",
  2389. "allOf": [
  2390. {
  2391. "$ref": "#/definitions/v1.Visibility"
  2392. }
  2393. ]
  2394. }
  2395. }
  2396. },
  2397. "v1.CreateResourceRequest": {
  2398. "type": "object",
  2399. "properties": {
  2400. "externalLink": {
  2401. "type": "string"
  2402. },
  2403. "filename": {
  2404. "type": "string"
  2405. },
  2406. "internalPath": {
  2407. "type": "string"
  2408. },
  2409. "type": {
  2410. "type": "string"
  2411. }
  2412. }
  2413. },
  2414. "v1.CreateStorageRequest": {
  2415. "type": "object",
  2416. "properties": {
  2417. "config": {
  2418. "$ref": "#/definitions/v1.StorageConfig"
  2419. },
  2420. "name": {
  2421. "type": "string"
  2422. },
  2423. "type": {
  2424. "$ref": "#/definitions/v1.StorageType"
  2425. }
  2426. }
  2427. },
  2428. "v1.CreateUserRequest": {
  2429. "type": "object",
  2430. "properties": {
  2431. "email": {
  2432. "type": "string"
  2433. },
  2434. "nickname": {
  2435. "type": "string"
  2436. },
  2437. "password": {
  2438. "type": "string"
  2439. },
  2440. "role": {
  2441. "$ref": "#/definitions/v1.Role"
  2442. },
  2443. "username": {
  2444. "type": "string"
  2445. }
  2446. }
  2447. },
  2448. "v1.CustomizedProfile": {
  2449. "type": "object",
  2450. "properties": {
  2451. "appearance": {
  2452. "description": "Appearance is the server default appearance.",
  2453. "type": "string"
  2454. },
  2455. "description": {
  2456. "description": "Description is the server description.",
  2457. "type": "string"
  2458. },
  2459. "externalUrl": {
  2460. "description": "ExternalURL is the external url of server. e.g. https://usermemos.com",
  2461. "type": "string"
  2462. },
  2463. "locale": {
  2464. "description": "Locale is the server default locale.",
  2465. "type": "string"
  2466. },
  2467. "logoUrl": {
  2468. "description": "LogoURL is the url of logo image.",
  2469. "type": "string"
  2470. },
  2471. "name": {
  2472. "description": "Name is the server name, default is ` + "`" + `memos` + "`" + `",
  2473. "type": "string"
  2474. }
  2475. }
  2476. },
  2477. "v1.DeleteTagRequest": {
  2478. "type": "object",
  2479. "properties": {
  2480. "name": {
  2481. "type": "string"
  2482. }
  2483. }
  2484. },
  2485. "v1.FieldMapping": {
  2486. "type": "object",
  2487. "properties": {
  2488. "displayName": {
  2489. "type": "string"
  2490. },
  2491. "email": {
  2492. "type": "string"
  2493. },
  2494. "identifier": {
  2495. "type": "string"
  2496. }
  2497. }
  2498. },
  2499. "v1.IdentityProvider": {
  2500. "type": "object",
  2501. "properties": {
  2502. "config": {
  2503. "$ref": "#/definitions/v1.IdentityProviderConfig"
  2504. },
  2505. "id": {
  2506. "type": "integer"
  2507. },
  2508. "identifierFilter": {
  2509. "type": "string"
  2510. },
  2511. "name": {
  2512. "type": "string"
  2513. },
  2514. "type": {
  2515. "$ref": "#/definitions/v1.IdentityProviderType"
  2516. }
  2517. }
  2518. },
  2519. "v1.IdentityProviderConfig": {
  2520. "type": "object",
  2521. "properties": {
  2522. "oauth2Config": {
  2523. "$ref": "#/definitions/v1.IdentityProviderOAuth2Config"
  2524. }
  2525. }
  2526. },
  2527. "v1.IdentityProviderOAuth2Config": {
  2528. "type": "object",
  2529. "properties": {
  2530. "authUrl": {
  2531. "type": "string"
  2532. },
  2533. "clientId": {
  2534. "type": "string"
  2535. },
  2536. "clientSecret": {
  2537. "type": "string"
  2538. },
  2539. "fieldMapping": {
  2540. "$ref": "#/definitions/v1.FieldMapping"
  2541. },
  2542. "scopes": {
  2543. "type": "array",
  2544. "items": {
  2545. "type": "string"
  2546. }
  2547. },
  2548. "tokenUrl": {
  2549. "type": "string"
  2550. },
  2551. "userInfoUrl": {
  2552. "type": "string"
  2553. }
  2554. }
  2555. },
  2556. "v1.IdentityProviderType": {
  2557. "type": "string",
  2558. "enum": [
  2559. "OAUTH2"
  2560. ],
  2561. "x-enum-varnames": [
  2562. "IdentityProviderOAuth2Type"
  2563. ]
  2564. },
  2565. "v1.MemoRelationType": {
  2566. "type": "string",
  2567. "enum": [
  2568. "REFERENCE",
  2569. "ADDITIONAL"
  2570. ],
  2571. "x-enum-varnames": [
  2572. "MemoRelationReference",
  2573. "MemoRelationAdditional"
  2574. ]
  2575. },
  2576. "v1.PatchMemoRequest": {
  2577. "type": "object",
  2578. "properties": {
  2579. "content": {
  2580. "description": "Domain specific fields",
  2581. "type": "string"
  2582. },
  2583. "createdTs": {
  2584. "description": "Standard fields",
  2585. "type": "integer"
  2586. },
  2587. "relationList": {
  2588. "type": "array",
  2589. "items": {
  2590. "$ref": "#/definitions/v1.UpsertMemoRelationRequest"
  2591. }
  2592. },
  2593. "resourceIdList": {
  2594. "description": "Related fields",
  2595. "type": "array",
  2596. "items": {
  2597. "type": "integer"
  2598. }
  2599. },
  2600. "rowStatus": {
  2601. "$ref": "#/definitions/v1.RowStatus"
  2602. },
  2603. "updatedTs": {
  2604. "type": "integer"
  2605. },
  2606. "visibility": {
  2607. "$ref": "#/definitions/v1.Visibility"
  2608. }
  2609. }
  2610. },
  2611. "v1.Role": {
  2612. "type": "string",
  2613. "enum": [
  2614. "HOST",
  2615. "ADMIN",
  2616. "USER"
  2617. ],
  2618. "x-enum-varnames": [
  2619. "RoleHost",
  2620. "RoleAdmin",
  2621. "RoleUser"
  2622. ]
  2623. },
  2624. "v1.RowStatus": {
  2625. "type": "string",
  2626. "enum": [
  2627. "NORMAL",
  2628. "ARCHIVED"
  2629. ],
  2630. "x-enum-varnames": [
  2631. "Normal",
  2632. "Archived"
  2633. ]
  2634. },
  2635. "v1.SSOSignIn": {
  2636. "type": "object",
  2637. "properties": {
  2638. "code": {
  2639. "type": "string"
  2640. },
  2641. "identityProviderId": {
  2642. "type": "integer"
  2643. },
  2644. "redirectUri": {
  2645. "type": "string"
  2646. }
  2647. }
  2648. },
  2649. "v1.SignIn": {
  2650. "type": "object",
  2651. "properties": {
  2652. "password": {
  2653. "type": "string"
  2654. },
  2655. "username": {
  2656. "type": "string"
  2657. }
  2658. }
  2659. },
  2660. "v1.SignUp": {
  2661. "type": "object",
  2662. "properties": {
  2663. "password": {
  2664. "type": "string"
  2665. },
  2666. "username": {
  2667. "type": "string"
  2668. }
  2669. }
  2670. },
  2671. "v1.StorageConfig": {
  2672. "type": "object",
  2673. "properties": {
  2674. "s3Config": {
  2675. "$ref": "#/definitions/v1.StorageS3Config"
  2676. }
  2677. }
  2678. },
  2679. "v1.StorageS3Config": {
  2680. "type": "object",
  2681. "properties": {
  2682. "accessKey": {
  2683. "type": "string"
  2684. },
  2685. "bucket": {
  2686. "type": "string"
  2687. },
  2688. "endPoint": {
  2689. "type": "string"
  2690. },
  2691. "path": {
  2692. "type": "string"
  2693. },
  2694. "region": {
  2695. "type": "string"
  2696. },
  2697. "secretKey": {
  2698. "type": "string"
  2699. },
  2700. "urlPrefix": {
  2701. "type": "string"
  2702. },
  2703. "urlSuffix": {
  2704. "type": "string"
  2705. }
  2706. }
  2707. },
  2708. "v1.StorageType": {
  2709. "type": "string",
  2710. "enum": [
  2711. "S3"
  2712. ],
  2713. "x-enum-varnames": [
  2714. "StorageS3"
  2715. ]
  2716. },
  2717. "v1.SystemSetting": {
  2718. "type": "object",
  2719. "properties": {
  2720. "description": {
  2721. "type": "string"
  2722. },
  2723. "name": {
  2724. "$ref": "#/definitions/v1.SystemSettingName"
  2725. },
  2726. "value": {
  2727. "description": "Value is a JSON string with basic value.",
  2728. "type": "string"
  2729. }
  2730. }
  2731. },
  2732. "v1.SystemSettingName": {
  2733. "type": "string",
  2734. "enum": [
  2735. "server-id",
  2736. "secret-session",
  2737. "allow-signup",
  2738. "disable-password-login",
  2739. "disable-public-memos",
  2740. "max-upload-size-mib",
  2741. "additional-style",
  2742. "additional-script",
  2743. "customized-profile",
  2744. "storage-service-id",
  2745. "local-storage-path",
  2746. "telegram-bot-token",
  2747. "memo-display-with-updated-ts",
  2748. "auto-backup-interval"
  2749. ],
  2750. "x-enum-varnames": [
  2751. "SystemSettingServerIDName",
  2752. "SystemSettingSecretSessionName",
  2753. "SystemSettingAllowSignUpName",
  2754. "SystemSettingDisablePasswordLoginName",
  2755. "SystemSettingDisablePublicMemosName",
  2756. "SystemSettingMaxUploadSizeMiBName",
  2757. "SystemSettingAdditionalStyleName",
  2758. "SystemSettingAdditionalScriptName",
  2759. "SystemSettingCustomizedProfileName",
  2760. "SystemSettingStorageServiceIDName",
  2761. "SystemSettingLocalStoragePathName",
  2762. "SystemSettingTelegramBotTokenName",
  2763. "SystemSettingMemoDisplayWithUpdatedTsName",
  2764. "SystemSettingAutoBackupIntervalName"
  2765. ]
  2766. },
  2767. "v1.SystemStatus": {
  2768. "type": "object",
  2769. "properties": {
  2770. "additionalScript": {
  2771. "description": "Additional script.",
  2772. "type": "string"
  2773. },
  2774. "additionalStyle": {
  2775. "description": "Additional style.",
  2776. "type": "string"
  2777. },
  2778. "allowSignUp": {
  2779. "description": "System settings\nAllow sign up.",
  2780. "type": "boolean"
  2781. },
  2782. "autoBackupInterval": {
  2783. "description": "Auto Backup Interval.",
  2784. "type": "integer"
  2785. },
  2786. "customizedProfile": {
  2787. "description": "Customized server profile, including server name and external url.",
  2788. "allOf": [
  2789. {
  2790. "$ref": "#/definitions/v1.CustomizedProfile"
  2791. }
  2792. ]
  2793. },
  2794. "dbSize": {
  2795. "type": "integer"
  2796. },
  2797. "disablePasswordLogin": {
  2798. "description": "Disable password login.",
  2799. "type": "boolean"
  2800. },
  2801. "disablePublicMemos": {
  2802. "description": "Disable public memos.",
  2803. "type": "boolean"
  2804. },
  2805. "host": {
  2806. "$ref": "#/definitions/v1.User"
  2807. },
  2808. "localStoragePath": {
  2809. "description": "Local storage path.",
  2810. "type": "string"
  2811. },
  2812. "maxUploadSizeMiB": {
  2813. "description": "Max upload size.",
  2814. "type": "integer"
  2815. },
  2816. "memoDisplayWithUpdatedTs": {
  2817. "description": "Memo display with updated timestamp.",
  2818. "type": "boolean"
  2819. },
  2820. "profile": {
  2821. "$ref": "#/definitions/profile.Profile"
  2822. },
  2823. "storageServiceId": {
  2824. "description": "Storage service ID.",
  2825. "type": "integer"
  2826. }
  2827. }
  2828. },
  2829. "v1.UpdateIdentityProviderRequest": {
  2830. "type": "object",
  2831. "properties": {
  2832. "config": {
  2833. "$ref": "#/definitions/v1.IdentityProviderConfig"
  2834. },
  2835. "identifierFilter": {
  2836. "type": "string"
  2837. },
  2838. "name": {
  2839. "type": "string"
  2840. },
  2841. "type": {
  2842. "$ref": "#/definitions/v1.IdentityProviderType"
  2843. }
  2844. }
  2845. },
  2846. "v1.UpdateResourceRequest": {
  2847. "type": "object",
  2848. "properties": {
  2849. "filename": {
  2850. "type": "string"
  2851. }
  2852. }
  2853. },
  2854. "v1.UpdateStorageRequest": {
  2855. "type": "object",
  2856. "properties": {
  2857. "config": {
  2858. "$ref": "#/definitions/v1.StorageConfig"
  2859. },
  2860. "name": {
  2861. "type": "string"
  2862. },
  2863. "type": {
  2864. "$ref": "#/definitions/v1.StorageType"
  2865. }
  2866. }
  2867. },
  2868. "v1.UpdateUserRequest": {
  2869. "type": "object",
  2870. "properties": {
  2871. "avatarUrl": {
  2872. "type": "string"
  2873. },
  2874. "email": {
  2875. "type": "string"
  2876. },
  2877. "nickname": {
  2878. "type": "string"
  2879. },
  2880. "password": {
  2881. "type": "string"
  2882. },
  2883. "rowStatus": {
  2884. "$ref": "#/definitions/v1.RowStatus"
  2885. },
  2886. "username": {
  2887. "type": "string"
  2888. }
  2889. }
  2890. },
  2891. "v1.UpsertMemoOrganizerRequest": {
  2892. "type": "object",
  2893. "properties": {
  2894. "pinned": {
  2895. "type": "boolean"
  2896. }
  2897. }
  2898. },
  2899. "v1.UpsertMemoRelationRequest": {
  2900. "type": "object",
  2901. "properties": {
  2902. "relatedMemoId": {
  2903. "type": "integer"
  2904. },
  2905. "type": {
  2906. "$ref": "#/definitions/v1.MemoRelationType"
  2907. }
  2908. }
  2909. },
  2910. "v1.UpsertSystemSettingRequest": {
  2911. "type": "object",
  2912. "properties": {
  2913. "description": {
  2914. "type": "string"
  2915. },
  2916. "name": {
  2917. "$ref": "#/definitions/v1.SystemSettingName"
  2918. },
  2919. "value": {
  2920. "type": "string"
  2921. }
  2922. }
  2923. },
  2924. "v1.UpsertTagRequest": {
  2925. "type": "object",
  2926. "properties": {
  2927. "name": {
  2928. "type": "string"
  2929. }
  2930. }
  2931. },
  2932. "v1.UpsertUserSettingRequest": {
  2933. "type": "object",
  2934. "properties": {
  2935. "key": {
  2936. "$ref": "#/definitions/v1.UserSettingKey"
  2937. },
  2938. "value": {
  2939. "type": "string"
  2940. }
  2941. }
  2942. },
  2943. "v1.User": {
  2944. "type": "object",
  2945. "properties": {
  2946. "avatarUrl": {
  2947. "type": "string"
  2948. },
  2949. "createdTs": {
  2950. "type": "integer"
  2951. },
  2952. "email": {
  2953. "type": "string"
  2954. },
  2955. "id": {
  2956. "type": "integer"
  2957. },
  2958. "nickname": {
  2959. "type": "string"
  2960. },
  2961. "role": {
  2962. "$ref": "#/definitions/v1.Role"
  2963. },
  2964. "rowStatus": {
  2965. "description": "Standard fields",
  2966. "allOf": [
  2967. {
  2968. "$ref": "#/definitions/v1.RowStatus"
  2969. }
  2970. ]
  2971. },
  2972. "updatedTs": {
  2973. "type": "integer"
  2974. },
  2975. "userSettingList": {
  2976. "type": "array",
  2977. "items": {
  2978. "$ref": "#/definitions/v1.UserSetting"
  2979. }
  2980. },
  2981. "username": {
  2982. "description": "Domain specific fields",
  2983. "type": "string"
  2984. }
  2985. }
  2986. },
  2987. "v1.UserSetting": {
  2988. "type": "object",
  2989. "properties": {
  2990. "key": {
  2991. "$ref": "#/definitions/v1.UserSettingKey"
  2992. },
  2993. "userId": {
  2994. "type": "integer"
  2995. },
  2996. "value": {
  2997. "type": "string"
  2998. }
  2999. }
  3000. },
  3001. "v1.UserSettingKey": {
  3002. "type": "string",
  3003. "enum": [
  3004. "locale",
  3005. "appearance",
  3006. "memo-visibility",
  3007. "telegram-user-id"
  3008. ],
  3009. "x-enum-varnames": [
  3010. "UserSettingLocaleKey",
  3011. "UserSettingAppearanceKey",
  3012. "UserSettingMemoVisibilityKey",
  3013. "UserSettingTelegramUserIDKey"
  3014. ]
  3015. },
  3016. "v1.Visibility": {
  3017. "type": "string",
  3018. "enum": [
  3019. "PUBLIC",
  3020. "PROTECTED",
  3021. "PRIVATE"
  3022. ],
  3023. "x-enum-varnames": [
  3024. "Public",
  3025. "Protected",
  3026. "Private"
  3027. ]
  3028. }
  3029. },
  3030. "externalDocs": {
  3031. "description": "Find out more about Memos.",
  3032. "url": "https://usememos.com/"
  3033. }
  3034. }`
  3035. // SwaggerInfo holds exported Swagger Info so clients can modify it
  3036. var SwaggerInfo = &swag.Spec{
  3037. Version: "1.0",
  3038. Host: "",
  3039. BasePath: "/",
  3040. Schemes: []string{},
  3041. Title: "memos API",
  3042. Description: "A privacy-first, lightweight note-taking service.",
  3043. InfoInstanceName: "swagger",
  3044. SwaggerTemplate: docTemplate,
  3045. LeftDelim: "{{",
  3046. RightDelim: "}}",
  3047. }
  3048. func init() {
  3049. swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
  3050. }