You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

options.go 4.0KB

Add Attachment API (#3478) * Add Attachment API * repos/:owner/:repo/releases (add attachments) * repos/:owner/:repo/releases/:id (add attachments) * repos/:owner/:repo/releases/:id/attachments * repos/:owner/:repo/releases/:id/attachments/:attachment_id Signed-off-by: Jonas Franz <info@jonasfranz.de> * Add unit tests for new attachment functions Fix comments Signed-off-by: Jonas Franz <info@jonasfranz.software> * fix lint * Update vendor.json Signed-off-by: Jonas Franz <info@jonasfranz.software> * remove version of sdk Signed-off-by: Jonas Franz <info@jonasfranz.software> * Fix unit tests Add missing license header Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add CreateReleaseAttachment Add EditReleaseAttachment Add DeleteReleaseAttachment Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add filename query parameter for choosing another name for an attachment Signed-off-by: Jonas Franz <info@jonasfranz.software> * Fix order of imports Signed-off-by: Jonas Franz <info@jonasfranz.software> * Restricting updatable attachment columns Signed-off-by: Jonas Franz <info@jonasfranz.software> * gofmt Signed-off-by: Jonas Franz <info@jonasfranz.software> * Update go-sdk Replace Attachments with Assets Signed-off-by: Jonas Franz <info@jonasfranz.de> * Update go-sdk Signed-off-by: Jonas Franz <info@jonasfranz.de> * Updating go-sdk and regenerating swagger Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add missing file of go-sdk Signed-off-by: Jonas Franz <info@jonasfranz.software> * Change origin of code.gitea.io/sdk to code.gitea.io/sdk Update code.gitea.io/sdk Signed-off-by: Jonas Franz <info@jonasfranz.software> * Update swagger Signed-off-by: Jonas Franz <info@jonasfranz.software> * Update updateAttachment
6 years ago
Add API endpoint for accessing repo topics (#7963) * Create API endpoints for repo topics. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Generate swagger Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add documentation to functions Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Grammar fix Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix function comment Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Can't use FindTopics when looking for a single repo topic, as it doesnt use exact match Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add PUT ​/repos​/{owner}​/{repo}​/topics and remove GET ​/repos​/{owner}​/{repo}​/topics * Ignore if topic is sent twice in same request, refactoring. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix topic dropdown with api changes. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Style fix Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Update API documentation Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Better way to handle duplicate topics in slice Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Make response element TopicName an array of strings, instead of using an array of TopicName Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add test cases for API Repo Topics. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix format of tests Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix comments Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix unit tests after adding some more topics to the test fixture. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Update models/topic.go Limit multiple if else if ... Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com> * Engine as first parameter in function Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com> * Replace magic numbers with http status code constants. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix variable scope Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Test one read with login and one with token Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add some more tests Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Apply suggestions from code review Use empty struct for efficiency Co-Authored-By: Lauris BH <lauris@nix.lv> * Add test case to check access for user with write access Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix access, repo admin required to change topics Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Correct first test to be without token Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Any repo reader should be able to access topics. * No need for string pointer Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
4 years ago
Add API endpoint for accessing repo topics (#7963) * Create API endpoints for repo topics. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Generate swagger Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add documentation to functions Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Grammar fix Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix function comment Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Can't use FindTopics when looking for a single repo topic, as it doesnt use exact match Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add PUT ​/repos​/{owner}​/{repo}​/topics and remove GET ​/repos​/{owner}​/{repo}​/topics * Ignore if topic is sent twice in same request, refactoring. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix topic dropdown with api changes. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Style fix Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Update API documentation Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Better way to handle duplicate topics in slice Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Make response element TopicName an array of strings, instead of using an array of TopicName Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add test cases for API Repo Topics. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix format of tests Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix comments Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix unit tests after adding some more topics to the test fixture. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Update models/topic.go Limit multiple if else if ... Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com> * Engine as first parameter in function Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com> * Replace magic numbers with http status code constants. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix variable scope Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Test one read with login and one with token Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add some more tests Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Apply suggestions from code review Use empty struct for efficiency Co-Authored-By: Lauris BH <lauris@nix.lv> * Add test case to check access for user with write access Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix access, repo admin required to change topics Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Correct first test to be without token Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Any repo reader should be able to access topics. * No need for string pointer Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
4 years ago
Add API to get/edit wiki (#17278) * Add API to get/edit wiki * Add swagger docs, various improvements * fmt * Fix lint and rm comment * Add page parameter * Add pagination to pages * Add tests * fmt * Update func names * Update error handling * Update type name * Fix lint * Don't delete Home * Update func name * Update routers/api/v1/repo/wiki.go Co-authored-by: delvh <dev.lh@web.de> * Remove unnecessary check * Fix lint * Use English strings * Update integrations/api_wiki_test.go Co-authored-by: delvh <dev.lh@web.de> * Update func and test names * Remove unsed check and avoid duplicated error reports * Improve error handling * Return after error * Document 404 error * Update swagger * Fix lint * Apply suggestions from code review Co-authored-by: delvh <dev.lh@web.de> * Document file encoding * fmt * Apply suggestions * Use convert * Fix integration test * simplify permissions * unify duplicate key Title/Name * improve types & return UTC timestamps * improve types pt.2 - add WikiPageMetaData.LastCommit - add WikiPageMetaData.HTMLURL - replace WikiPageMetaData.Updated with .LastCommit.Committer.Created also delete convert.ToWikiPage(), as it received too many arguments and only had one callsite anyway. sorry for bad advice earlier 🙃 * WikiPage.Content is base64 encoded * simplify error handling in wikiContentsByName() * update swagger * fix & DRY findWikiRepoCommit() error handling ListWikiPages() previously wrote error twice when repo wiki didn't exist * rename Content -> ContentBase64 * Fix test * Fix tests * Update var name * suburl -> sub_url Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Norwin <git@nroo.de> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. // Copyright 2017 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package swagger
  4. import (
  5. api "code.gitea.io/gitea/modules/structs"
  6. "code.gitea.io/gitea/services/forms"
  7. )
  8. // not actually a response, just a hack to get go-swagger to include definitions
  9. // of the various XYZOption structs
  10. // parameterBodies
  11. // swagger:response parameterBodies
  12. type swaggerParameterBodies struct {
  13. // in:body
  14. AddCollaboratorOption api.AddCollaboratorOption
  15. // in:body
  16. CreateEmailOption api.CreateEmailOption
  17. // in:body
  18. DeleteEmailOption api.DeleteEmailOption
  19. // in:body
  20. CreateHookOption api.CreateHookOption
  21. // in:body
  22. EditHookOption api.EditHookOption
  23. // in:body
  24. EditGitHookOption api.EditGitHookOption
  25. // in:body
  26. CreateIssueOption api.CreateIssueOption
  27. // in:body
  28. EditIssueOption api.EditIssueOption
  29. // in:body
  30. EditDeadlineOption api.EditDeadlineOption
  31. // in:body
  32. CreateIssueCommentOption api.CreateIssueCommentOption
  33. // in:body
  34. EditIssueCommentOption api.EditIssueCommentOption
  35. // in:body
  36. IssueMeta api.IssueMeta
  37. // in:body
  38. IssueLabelsOption api.IssueLabelsOption
  39. // in:body
  40. CreateKeyOption api.CreateKeyOption
  41. // in:body
  42. RenameUserOption api.RenameUserOption
  43. // in:body
  44. CreateLabelOption api.CreateLabelOption
  45. // in:body
  46. EditLabelOption api.EditLabelOption
  47. // in:body
  48. MarkupOption api.MarkupOption
  49. // in:body
  50. MarkdownOption api.MarkdownOption
  51. // in:body
  52. CreateMilestoneOption api.CreateMilestoneOption
  53. // in:body
  54. EditMilestoneOption api.EditMilestoneOption
  55. // in:body
  56. CreateOrgOption api.CreateOrgOption
  57. // in:body
  58. EditOrgOption api.EditOrgOption
  59. // in:body
  60. CreatePullRequestOption api.CreatePullRequestOption
  61. // in:body
  62. EditPullRequestOption api.EditPullRequestOption
  63. // in:body
  64. MergePullRequestOption forms.MergePullRequestForm
  65. // in:body
  66. CreateReleaseOption api.CreateReleaseOption
  67. // in:body
  68. EditReleaseOption api.EditReleaseOption
  69. // in:body
  70. CreateRepoOption api.CreateRepoOption
  71. // in:body
  72. EditRepoOption api.EditRepoOption
  73. // in:body
  74. TransferRepoOption api.TransferRepoOption
  75. // in:body
  76. CreateForkOption api.CreateForkOption
  77. // in:body
  78. GenerateRepoOption api.GenerateRepoOption
  79. // in:body
  80. CreateStatusOption api.CreateStatusOption
  81. // in:body
  82. CreateTeamOption api.CreateTeamOption
  83. // in:body
  84. EditTeamOption api.EditTeamOption
  85. // in:body
  86. AddTimeOption api.AddTimeOption
  87. // in:body
  88. CreateUserOption api.CreateUserOption
  89. // in:body
  90. EditUserOption api.EditUserOption
  91. // in:body
  92. EditAttachmentOptions api.EditAttachmentOptions
  93. // in:body
  94. ChangeFilesOptions api.ChangeFilesOptions
  95. // in:body
  96. CreateFileOptions api.CreateFileOptions
  97. // in:body
  98. UpdateFileOptions api.UpdateFileOptions
  99. // in:body
  100. DeleteFileOptions api.DeleteFileOptions
  101. // in:body
  102. CommitDateOptions api.CommitDateOptions
  103. // in:body
  104. RepoTopicOptions api.RepoTopicOptions
  105. // in:body
  106. EditReactionOption api.EditReactionOption
  107. // in:body
  108. CreateBranchRepoOption api.CreateBranchRepoOption
  109. // in:body
  110. CreateBranchProtectionOption api.CreateBranchProtectionOption
  111. // in:body
  112. EditBranchProtectionOption api.EditBranchProtectionOption
  113. // in:body
  114. CreateOAuth2ApplicationOptions api.CreateOAuth2ApplicationOptions
  115. // in:body
  116. CreatePullReviewOptions api.CreatePullReviewOptions
  117. // in:body
  118. CreatePullReviewComment api.CreatePullReviewComment
  119. // in:body
  120. SubmitPullReviewOptions api.SubmitPullReviewOptions
  121. // in:body
  122. DismissPullReviewOptions api.DismissPullReviewOptions
  123. // in:body
  124. MigrateRepoOptions api.MigrateRepoOptions
  125. // in:body
  126. PullReviewRequestOptions api.PullReviewRequestOptions
  127. // in:body
  128. CreateTagOption api.CreateTagOption
  129. // in:body
  130. CreateAccessTokenOption api.CreateAccessTokenOption
  131. // in:body
  132. UserSettingsOptions api.UserSettingsOptions
  133. // in:body
  134. CreateWikiPageOptions api.CreateWikiPageOptions
  135. // in:body
  136. CreatePushMirrorOption api.CreatePushMirrorOption
  137. // in:body
  138. UpdateUserAvatarOptions api.UpdateUserAvatarOption
  139. // in:body
  140. UpdateRepoAvatarOptions api.UpdateRepoAvatarOption
  141. // in:body
  142. CreateOrUpdateSecretOption api.CreateOrUpdateSecretOption
  143. }