mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-08-29 22:35:24 +02:00
Updates SDK dep (#6406)
This commit is contained in:
parent
03e4db40cc
commit
ecce28f9df
6 changed files with 111 additions and 11 deletions
4
Gopkg.lock
generated
4
Gopkg.lock
generated
|
@ -11,11 +11,11 @@
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
digest = "1:dbf849e6552740945ac1c6c6acba590fbc594e4efa80cf05568dec8579ae0dab"
|
digest = "1:6fb0a860db126f973204b4b05ed08d338d485a74c19c15f0e5cf0f49352a8ef1"
|
||||||
name = "code.gitea.io/sdk"
|
name = "code.gitea.io/sdk"
|
||||||
packages = ["gitea"]
|
packages = ["gitea"]
|
||||||
pruneopts = "NUT"
|
pruneopts = "NUT"
|
||||||
revision = "e4effe4df2b895ca51482d24edb8748704326f1a"
|
revision = "a669487e86e0cc5833a2867e6476da6327244a1a"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:5d72bbcc9c8667b11c3dc3cbe681c5a6f71e5096744c0bf7726ab5c6425d5dc4"
|
digest = "1:5d72bbcc9c8667b11c3dc3cbe681c5a6f71e5096744c0bf7726ab5c6425d5dc4"
|
||||||
|
|
|
@ -97,14 +97,18 @@ func GetSingleCommit(ctx *context.APIContext) {
|
||||||
RepoCommit: &api.RepoCommit{
|
RepoCommit: &api.RepoCommit{
|
||||||
URL: setting.AppURL + ctx.Link[1:],
|
URL: setting.AppURL + ctx.Link[1:],
|
||||||
Author: &api.CommitUser{
|
Author: &api.CommitUser{
|
||||||
Name: commit.Author.Name,
|
Identity: api.Identity{
|
||||||
Email: commit.Author.Email,
|
Name: commit.Author.Name,
|
||||||
Date: commit.Author.When.Format(time.RFC3339),
|
Email: commit.Author.Email,
|
||||||
|
},
|
||||||
|
Date: commit.Author.When.Format(time.RFC3339),
|
||||||
},
|
},
|
||||||
Committer: &api.CommitUser{
|
Committer: &api.CommitUser{
|
||||||
Name: commit.Committer.Name,
|
Identity: api.Identity{
|
||||||
Email: commit.Committer.Email,
|
Name: commit.Committer.Name,
|
||||||
Date: commit.Committer.When.Format(time.RFC3339),
|
Email: commit.Committer.Email,
|
||||||
|
},
|
||||||
|
Date: commit.Committer.When.Format(time.RFC3339),
|
||||||
},
|
},
|
||||||
Message: commit.Summary(),
|
Message: commit.Summary(),
|
||||||
Tree: &api.CommitMeta{
|
Tree: &api.CommitMeta{
|
||||||
|
|
|
@ -6447,6 +6447,7 @@
|
||||||
},
|
},
|
||||||
"email": {
|
"email": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
"format": "email",
|
||||||
"x-go-name": "Email"
|
"x-go-name": "Email"
|
||||||
},
|
},
|
||||||
"name": {
|
"name": {
|
||||||
|
|
14
vendor/code.gitea.io/sdk/gitea/git_blob.go
generated
vendored
Normal file
14
vendor/code.gitea.io/sdk/gitea/git_blob.go
generated
vendored
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
// Copyright 2019 The Gitea Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a MIT-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package gitea
|
||||||
|
|
||||||
|
// GitBlobResponse represents a git blob
|
||||||
|
type GitBlobResponse struct {
|
||||||
|
Content string `json:"content"`
|
||||||
|
Encoding string `json:"encoding"`
|
||||||
|
URL string `json:"url"`
|
||||||
|
SHA string `json:"sha"`
|
||||||
|
Size int64 `json:"size"`
|
||||||
|
}
|
12
vendor/code.gitea.io/sdk/gitea/repo_commit.go
generated
vendored
12
vendor/code.gitea.io/sdk/gitea/repo_commit.go
generated
vendored
|
@ -9,6 +9,13 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Identity for a person's identity like an author or committer
|
||||||
|
type Identity struct {
|
||||||
|
Name string `json:"name" binding:"MaxSize(100)"`
|
||||||
|
// swagger:strfmt email
|
||||||
|
Email string `json:"email" binding:"MaxSize(254)"`
|
||||||
|
}
|
||||||
|
|
||||||
// CommitMeta contains meta information of a commit in terms of API.
|
// CommitMeta contains meta information of a commit in terms of API.
|
||||||
type CommitMeta struct {
|
type CommitMeta struct {
|
||||||
URL string `json:"url"`
|
URL string `json:"url"`
|
||||||
|
@ -17,9 +24,8 @@ type CommitMeta struct {
|
||||||
|
|
||||||
// CommitUser contains information of a user in the context of a commit.
|
// CommitUser contains information of a user in the context of a commit.
|
||||||
type CommitUser struct {
|
type CommitUser struct {
|
||||||
Name string `json:"name"`
|
Identity
|
||||||
Email string `json:"email"`
|
Date string `json:"date"`
|
||||||
Date string `json:"date"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// RepoCommit contains information of a commit in the context of a repository.
|
// RepoCommit contains information of a commit in the context of a repository.
|
||||||
|
|
75
vendor/code.gitea.io/sdk/gitea/repo_file.go
generated
vendored
75
vendor/code.gitea.io/sdk/gitea/repo_file.go
generated
vendored
|
@ -1,4 +1,5 @@
|
||||||
// Copyright 2014 The Gogs Authors. All rights reserved.
|
// Copyright 2014 The Gogs Authors. All rights reserved.
|
||||||
|
// Copyright 2019 The Gitea Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a MIT-style
|
// Use of this source code is governed by a MIT-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
@ -13,3 +14,77 @@ import (
|
||||||
func (c *Client) GetFile(user, repo, ref, tree string) ([]byte, error) {
|
func (c *Client) GetFile(user, repo, ref, tree string) ([]byte, error) {
|
||||||
return c.getResponse("GET", fmt.Sprintf("/repos/%s/%s/raw/%s/%s", user, repo, ref, tree), nil, nil)
|
return c.getResponse("GET", fmt.Sprintf("/repos/%s/%s/raw/%s/%s", user, repo, ref, tree), nil, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FileOptions options for all file APIs
|
||||||
|
type FileOptions struct {
|
||||||
|
Message string `json:"message" binding:"Required"`
|
||||||
|
BranchName string `json:"branch"`
|
||||||
|
NewBranchName string `json:"new_branch"`
|
||||||
|
Author Identity `json:"author"`
|
||||||
|
Committer Identity `json:"committer"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateFileOptions options for creating files
|
||||||
|
type CreateFileOptions struct {
|
||||||
|
FileOptions
|
||||||
|
Content string `json:"content"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteFileOptions options for deleting files (used for other File structs below)
|
||||||
|
type DeleteFileOptions struct {
|
||||||
|
FileOptions
|
||||||
|
SHA string `json:"sha" binding:"Required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateFileOptions options for updating files
|
||||||
|
type UpdateFileOptions struct {
|
||||||
|
DeleteFileOptions
|
||||||
|
Content string `json:"content"`
|
||||||
|
FromPath string `json:"from_path" binding:"MaxSize(500)"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// FileLinksResponse contains the links for a repo's file
|
||||||
|
type FileLinksResponse struct {
|
||||||
|
Self string `json:"url"`
|
||||||
|
GitURL string `json:"git_url"`
|
||||||
|
HTMLURL string `json:"html_url"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// FileContentResponse contains information about a repo's file stats and content
|
||||||
|
type FileContentResponse struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Path string `json:"path"`
|
||||||
|
SHA string `json:"sha"`
|
||||||
|
Size int64 `json:"size"`
|
||||||
|
URL string `json:"url"`
|
||||||
|
HTMLURL string `json:"html_url"`
|
||||||
|
GitURL string `json:"git_url"`
|
||||||
|
DownloadURL string `json:"download_url"`
|
||||||
|
Type string `json:"type"`
|
||||||
|
Links *FileLinksResponse `json:"_links"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// FileCommitResponse contains information generated from a Git commit for a repo's file.
|
||||||
|
type FileCommitResponse struct {
|
||||||
|
CommitMeta
|
||||||
|
HTMLURL string `json:"html_url"`
|
||||||
|
Author *CommitUser `json:"author"`
|
||||||
|
Committer *CommitUser `json:"committer"`
|
||||||
|
Parents []*CommitMeta `json:"parents"`
|
||||||
|
Message string `json:"message"`
|
||||||
|
Tree *CommitMeta `json:"tree"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// FileResponse contains information about a repo's file
|
||||||
|
type FileResponse struct {
|
||||||
|
Content *FileContentResponse `json:"content"`
|
||||||
|
Commit *FileCommitResponse `json:"commit"`
|
||||||
|
Verification *PayloadCommitVerification `json:"verification"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// FileDeleteResponse contains information about a repo's file that was deleted
|
||||||
|
type FileDeleteResponse struct {
|
||||||
|
Content interface{} `json:"content"` // to be set to nil
|
||||||
|
Commit *FileCommitResponse `json:"commit"`
|
||||||
|
Verification *PayloadCommitVerification `json:"verification"`
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue