Compare commits

...

33 Commits

Author SHA1 Message Date
viletyy abc40199dc 修复 2022-07-26 10:59:31 +08:00
viletyy c4323b1b39 fix 2022-07-22 18:11:34 +08:00
viletyy a94d56a377 add: pr version and diff 2022-07-22 15:26:18 +08:00
viletyy 9d6780719d fix 2022-07-19 10:57:06 +08:00
viletyy 0c5724684c Merge branch 'gitlink' of github.com:viletyy/gitea-client into gitlink 2022-07-19 10:03:59 +08:00
viletyy dd693d62b2 fix 2022-07-19 10:01:06 +08:00
viletyy cdfc53f2b2 fix 2022-07-19 10:00:44 +08:00
viletyy d3440e67ce add: commits diff api 2022-07-19 09:59:29 +08:00
viletyy bdc52229c5 fix: add some api 2022-07-19 09:59:11 +08:00
viletyy 64275e530f add: some lose api 2022-07-19 09:58:28 +08:00
viletyy ea2d48fa20 change ruby version 2022-07-19 09:57:21 +08:00
viletyy b7e01f1076 fix: owner error 2022-07-19 09:56:47 +08:00
viletyy 41c2538e9c add: some lose api 2022-07-19 09:56:47 +08:00
viletyy 6978f97dbd fix: version 2022-07-19 09:56:45 +08:00
viletyy 5de47dcde9 fix: version 2022-07-19 09:55:53 +08:00
viletyy 515219d3b1 add: gitlink api plus 2022-07-19 09:55:28 +08:00
viletyy 0fc23e2e1f fix 2022-07-18 15:41:41 +08:00
viletyy 55a5935de2 fix 2022-07-18 09:39:15 +08:00
viletyy dca8344faa add: commits diff api 2022-07-18 09:34:35 +08:00
viletyy 8dedf60442 fix: add some api 2022-07-15 11:53:52 +08:00
viletyy 1ec1dd8a5f Merge branch 'gitlink' of github.com:viletyy/gitea-client into gitlink 2022-07-15 11:46:29 +08:00
viletyy 625474f044 change ruby version 2022-07-15 11:44:38 +08:00
viletyy db67771b84 fix: owner error 2022-07-15 11:44:38 +08:00
viletyy 107432be54 add: some lose api 2022-07-15 11:44:38 +08:00
viletyy d5fbd50438 fix: version 2022-07-15 11:44:38 +08:00
viletyy dd226bb64b fix: version 2022-07-15 11:44:38 +08:00
viletyy 409036d97c add: gitlink api plus 2022-07-15 11:44:38 +08:00
viletyy 67ac9e44e4 change ruby version 2022-06-26 08:47:57 +08:00
viletyy 7513b641e4 fix: owner error 2022-06-23 15:34:28 +08:00
viletyy b933f38a39 add: some lose api 2022-06-23 15:34:28 +08:00
viletyy 93ddc013f2 fix: version 2022-06-23 15:34:27 +08:00
viletyy b2b9c46b1e fix: version 2022-06-23 15:34:03 +08:00
viletyy 26cb66b2ba add: gitlink api plus 2022-06-23 15:33:48 +08:00
8 changed files with 103 additions and 3 deletions

View File

@ -1,7 +1,7 @@
PATH
remote: .
specs:
gitea-client (0.10.0)
gitea-client (0.10.5)
rest-client (~> 2.1.0)
GEM

View File

@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
spec.description = ""
spec.homepage = "https://github.com/viletyy/gitea-client"
spec.license = "MIT"
spec.required_ruby_version = ">= 2.6.0"
spec.required_ruby_version = ">= 2.4.0"
spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = "https://github.com/viletyy/gitea-client"

View File

@ -7,6 +7,7 @@ require_relative 'api/organization'
require_relative 'api/notification'
require_relative 'api/miscellaneous'
require_relative 'api/admin'
require_relative 'api/activity'
require_relative 'api/client'
require_relative 'api/config'
require_relative 'api/exception'

17
lib/gitea/api/activity.rb Normal file
View File

@ -0,0 +1,17 @@
module Gitea
module Api
module Activity
def get_activity(opt={})
@http.get("/activity", opt)
end
def get_activity_develop(opt={})
@http.get("/activity/develop", opt)
end
def get_activity_project(opt={})
@http.get("/activity/project", opt)
end
end # Activity
end # Api
end # Gitea

View File

@ -44,6 +44,7 @@ module Gitea
include Gitea::Api::Notification
include Gitea::Api::Miscellaneous
include Gitea::Api::Admin
include Gitea::Api::Activity
end
end # User
end # Gitea

View File

@ -29,6 +29,15 @@ module Gitea
@http.get("/repos/#{owner}/#{repo}/assignees", opt)
end
# get repository blame
def get_repos_blame_by_owner_repo(owner, repo, opt = {})
@http.get("/repos/#{owner}/#{repo}/blame", opt)
end
def get_repos_branch_name_set_by_owner_repo(owner, repo, opt = {})
@http.get("/repos/#{owner}/#{repo}/branch_name_set", opt)
end
def get_repos_branch_protections_by_owner_repo(owner, repo, opt = {})
@http.get("/repos/#{owner}/#{repo}/branch_protections", opt)
end
@ -49,6 +58,10 @@ module Gitea
@http.patch("/repos/#{owner}/#{repo}/branch_protections/#{name}", opt)
end
def get_repos_branch_tag_count_by_owner_repo(owner, repo, opt={})
@http.get("/repos/#{owner}/#{repo}/branch_tag_count", opt)
end
def get_repos_branches_by_owner_repo(owner, repo, opt = {})
@http.get("/repos/#{owner}/#{repo}/branches", opt)
end
@ -57,6 +70,14 @@ module Gitea
@http.post("/repos/#{owner}/#{repo}/branches", opt)
end
def get_repos_branches_branches_slice_by_owner_repo(owner, repo, opt = {})
@http.get("/repos/#{owner}/#{repo}/branches/branches_slice", opt)
end
def get_repos_branches_branches_slice_by_owner_repo(owner, repo, opt = {})
@http.get("/repos/#{owner}/#{repo}/branches/branches_slice", opt)
end
def get_repos_branches_by_owner_repo_branch(owner, repo, branch, opt = {})
@http.get("/repos/#{owner}/#{repo}/branches/#{branch}", opt)
end
@ -65,6 +86,10 @@ module Gitea
@http.delete("/repos/#{owner}/#{repo}/branches/#{branch}", opt)
end
def get_repos_compare_by_owner_repo_from_to(owner, repo, from, to, opt = {})
@http.get("/repos/#{owner}/#{repo}/compare/#{to}...#{from}", opt)
end
def get_repos_collaborators_by_owner_repo_collaborator(owner, repo, collaborator, opt = {})
@http.get("/repos/#{owner}/#{repo}/collaborators/#{collaborator}", opt)
end
@ -81,6 +106,10 @@ module Gitea
@http.get("/repos/#{owner}/#{repo}/commits", opt)
end
def get_repos_commits_diff_by_owner_repo_sha(owner, repo, sha, opt = {})
@http.get("/repos/#{owner}/#{repo}/commits/#{sha}/diff", opt)
end
def get_repos_commits_status_by_owner_repo_ref(owner, repo, ref, opt = {})
@http.get("/repos/#{owner}/#{repo}/commits/#{ref}/status", opt)
end
@ -89,10 +118,18 @@ module Gitea
@http.get("/repos/#{owner}/#{repo}/commits/#{ref}/statuses", opt)
end
def get_repos_commits_slice_by_owner_repo(owner, repo, opt = {})
@http.get("/repos/#{owner}/#{repo}/commits_slice", opt)
end
def get_repos_contents_by_owner_repo(owner, repo, opt = {})
@http.get("/repos/#{owner}/#{repo}/contents", opt)
end
def post_repos_contents_batch_by_owner_repo(owner, repo, opt = {})
@http.post("/repos/#{owner}/#{repo}/contents/batch", opt)
end
def get_repos_contents_by_owner_repo_filepath(owner, repo, filepath, opt = {})
@http.get("/repos/#{owner}/#{repo}/contents/#{filepath}", opt)
end
@ -109,10 +146,26 @@ module Gitea
@http.delete("/repos/#{owner}/#{repo}/contents/#{filepath}", opt)
end
def get_repos_contributors_by_owner_repo(owner, repo, opt={})
@http.get("/repos/#{owner}/#{repo}/contributors", opt)
end
def get_repos_count_by_owner_repo(owner, repo, opt={})
@http.get("/repos/#{owner}/#{repo}/count", opt)
end
def get_repos_editorconfig_by_owner_repo_filepath(owner, repo, filepath, opt = {})
@http.get("/repos/#{owner}/#{repo}/editorconfig/#{filepath}", opt)
end
def get_repos_file_commits_by_owner_repo_filepath(owner, repo, filepath, opt={})
@http.get("/repos/#{owner}/#{repo}/file_commits/#{filepath}", opt)
end
def get_repos_find_by_owner_repo_filepath(owner, repo, filepath, opt={})
@http.get("/repos/#{owner}/#{repo}/find", opt)
end
def get_repos_forks_by_owner_repo(owner, repo, opt = {})
@http.get("/repos/#{owner}/#{repo}/forks", opt)
end
@ -181,6 +234,10 @@ module Gitea
@http.patch("/repos/#{owner}/#{repo}/hooks/#{id}", opt)
end
def get_repos_hooks_hooktasks_by_owner_repo_id(owner, repo, id, opt={})
@http.get("/repos/#{owner}/#{repo}/hooks/#{id}/hooktasks", opt)
end
def post_repos_hooks_tests_by_owner_repo_id(owner, repo, id, opt = {})
@http.post("/repos/#{owner}/#{repo}/hooks/#{id}/tests", opt)
end
@ -221,6 +278,10 @@ module Gitea
@http.post("/repos/#{owner}/#{repo}/pulls", opt)
end
def get_repos_pulls_by_owner_repo_index(owner, repo, index, opt = {})
@http.get("/repos/#{owner}/#{repo}/pulls/#{index}", opt)
end
def patch_repos_pulls_by_owner_repo_index(owner, repo, index, opt = {})
@http.patch("/repos/#{owner}/#{repo}/pulls/#{index}", opt)
end
@ -281,10 +342,26 @@ module Gitea
@http.post("/repos/#{owner}/#{repo}/pulls/#{index}/update", opt)
end
def get_repos_pulls_versions_by_owner_repo_index(owner, repo, index, opt = {})
@http.get("/repos/#{owner}/#{repo}/pulls/#{index}/versions", opt)
end
def get_repos_pulls_versions_diff_by_owner_repo_index_version_id(owner, repo, index, version_id, opt={})
@http.get("/repos/#{owner}/#{repo}/pulls/#{index}/versions/#{version_id}/diff", opt)
end
def get_repos_raw_by_owner_repo_filepath(owner, repo, filepath, opt = {})
@http.get("/repos/#{owner}/#{repo}/raw/#{filepath}", opt)
end
def get_repos_readme_by_owner_repo(owner, repo, opt={})
@http.get("/repos/#{owner}/#{repo}/readme", opt)
end
def get_repos_readme_by_owner_repo_dir(owner, repo, dir, opt={})
@http.get("/repos/#{owner}/#{repo}/readme/#{dir}", opt)
end
def get_repos_releases_by_owner_repo(owner, repo, opt = {})
@http.get("/repos/#{owner}/#{repo}/releases", opt)
end

View File

@ -166,6 +166,10 @@ module Gitea
@http.get("/user/#{username}/gpg_keys", opt)
end
def get_users_heatmap_by_username(username, opt={})
@http.get("/users/#{username}/heatmap", opt)
end
def get_users_keys_by_username(username, opt={})
@http.get("/user/#{username}/keys", opt)
end

View File

@ -1,5 +1,5 @@
# frozen_string_literal: true
module Gitea
VERSION = "0.10.0"
VERSION = "0.10.5"
end