diff --git a/app/docs/slate/source/includes/_repositories.md b/app/docs/slate/source/includes/_repositories.md index c27243da6..eaae10746 100644 --- a/app/docs/slate/source/includes/_repositories.md +++ b/app/docs/slate/source/includes/_repositories.md @@ -924,6 +924,71 @@ await octokit.request('GET /api/yystopf/csfjkkj/readme.json') Success Data. +## 获取仓库贡献者 +获取仓库贡献者 + +> 示例: + +```shell +curl -X GET \ +-d "ref=master" \ +-d "filepath=lib" \ +http://localhost:3000/api/yystopf/csfjkkj/contributors.json +``` + +```javascript +await octokit.request('GET /api/yystopf/csfjkkj/contributors.json') +``` + +### HTTP 请求 +`GET /api/:owner/:repo/contributors.json` + +### 请求参数: +参数 | 必选 | 默认 | 类型 | 字段说明 +--------- | ------- | ------- | -------- | ---------- +|owner |是| |string |用户登录名 | +|repo |是| |string |项目标识identifier | +|ref |否| | string |分支名称、tag名称或是提交记录id,默认为整个仓库 | +|filepath |否| | string |子目录名称,默认为空 | + +### 返回字段说明: +参数 | 类型 | 字段说明 +--------- | ----------- | ----------- +|total_count |integer|贡献者数量| +|contributions |integer|贡献数量| +|login |string |用户登录名 | +|type |string|用户类型 | +|name |string|用户昵称| +|image_url |string|用户头像| + + +> 返回的JSON示例: + +```json +{ + "contributors": [ + { + "contributions": 5, + "login": "testforge2", + "type": "User", + "name": "testforge2", + "image_url": "system/lets/letter_avatars/2/T/236_177_85/120.png" + }, + { + "contributions": 79, + "login": "yystopf", + "type": "User", + "name": "yystopf", + "image_url": "system/lets/letter_avatars/2/Y/241_125_89/120.png" + } + ], + "total_count": 2 +} +``` + + ## 获取仓库webhooks列表 获取仓库webhooks列表 diff --git a/public/docs/api.html b/public/docs/api.html index 5e3baed1c..4ec491b4f 100644 --- a/public/docs/api.html +++ b/public/docs/api.html @@ -502,6 +502,9 @@
获取仓库webhooks列表
+获取仓库贡献者
示例:
curl -X GET \
-http://localhost:3000/api/yystopf/ceshi/webhooks.json
-
await octokit.request('GET /api/yystopf/ceshi/webhooks.json')
+-d "ref=master" \
+-d "filepath=lib" \
+http://localhost:3000/api/yystopf/csfjkkj/contributors.json
+
await octokit.request('GET /api/yystopf/csfjkkj/contributors.json')
GET /api/:owner/:repo/webhooks.json
GET /api/:owner/:repo/contributors.json
string | 项目标识identifier | |||
ref | +否 | ++ | string | +分支名称、tag名称或是提交记录id,默认为整个仓库 | +
filepath | +否 | ++ | string | +子目录名称,默认为空 | +
total_count | +integer | +贡献者数量 | +
contributions | +integer | +贡献数量 | +
login | +string | +用户登录名 | +
type | +string | +用户类型 | +
name | +string | +用户昵称 | +
image_url | +string | +用户头像 | +
++返回的JSON示例:
+
{
+ "contributors": [
+ {
+ "contributions": 5,
+ "login": "testforge2",
+ "type": "User",
+ "name": "testforge2",
+ "image_url": "system/lets/letter_avatars/2/T/236_177_85/120.png"
+ },
+ {
+ "contributions": 79,
+ "login": "yystopf",
+ "type": "User",
+ "name": "yystopf",
+ "image_url": "system/lets/letter_avatars/2/Y/241_125_89/120.png"
+ }
+ ],
+ "total_count": 2
+}
+
获取仓库webhooks列表
+ +++示例:
+
curl -X GET \
+http://localhost:3000/api/yystopf/ceshi/webhooks.json
+
await octokit.request('GET /api/yystopf/ceshi/webhooks.json')
+
GET /api/:owner/:repo/webhooks.json
参数 | +必选 | +默认 | +类型 | +字段说明 | +
---|---|---|---|---|
owner | +是 | ++ | string | +用户登录名 | +
repo | +是 | ++ | string | +项目标识identifier | +
参数 | +类型 | +字段说明 | +||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | int | id | @@ -7501,9 +7622,9 @@ http://localhost:3000/api/yystopf/ceshi/webhooks.json
参数 | @@ -7535,7 +7656,7 @@ http://localhost:3000/api/yystopf/ceshi/webhooks/3/edit.jsonwebhook ID |
---|
参数 | @@ -7736,266 +7857,8 @@ http://localhost:3000/api/yystopf/ceshi/webhooks/3/edit.json
---|
参数 | -必选 | -默认 | -类型 | -字段说明 | -
---|---|---|---|---|
owner | -是 | -- | string | -用户登录名 | -
repo | -是 | -- | string | -项目标识identifier | -
webhook.url | -是 | -- | string | -目标url | -
webhook.type | -否 | -- | string | -类型 | -
webhook.http_method | -是 | -- | string | -http方法, POST和GET | -
webhook.content_type | -是 | -- | string | -POST Content Type | -
webhook.secret | -否 | -- | string | -密钥文本 | -
webhook.active | -是 | -- | bool | -是否激活 | -
webhook.branch_filter | -否 | -- | string | -分支过滤 | -
webhook.events | -否 | -- | array | -触发事件 | -
触发事件字段说明
- -参数 | -含义 | -
---|---|
create | -创建分支或标签 | -
delete | -分支或标签删除 | -
fork | -仓库被fork | -
push | -git仓库推送 | -
issue | -易修已打开、已关闭、已重新打开或编辑 | -
issue_assign | -易修被指派 | -
issue_label | -易修标签被更新或删除 | -
issue_milestone | -易修被收入里程碑 | -
issue_comment | -易修评论 | -
pull_request | -合并请求 | -
pull_request_assign | -合并请求被指派 | -
pull_request_label | -合并请求被贴上标签 | -
pull_request_milestone | -合并请求被记录于里程碑中 | -
pull_request_comment | -合并请求被评论 | -
pull_request_review_approved | -合并请求被批准 | -
pull_request_review_rejected | -合并请求被拒绝 | -
pull_request_review_comment | -合并请求被提出审查意见 | -
pull_request_sync | -合并请求被同步 | -
repository | -创建或删除仓库 | -
release | -版本发布 | -
--请求的JSON示例:
-
{
- "active": true,
- "content_type": "json",
- "http_method": "GET",
- "secret": "123456",
- "url": "http://localhost:10000",
- "branch_filter": "*",
- "events": ["push"]
-}
-
参数 | -类型 | -字段说明 | -
---|---|---|
id | -int | -id | -
url | -string | -地址 | -
content_type | -string | -POST Content Type | -
is_active | -bool | -是否激活 | -
type | -string | -类型 | -
events | -array | -触发事件 | -
create_time | -string | -创建时间 | -
--返回的JSON示例:
-
{
- "id": 18,
- "type": "gitea",
- "content_type": "json",
- "url": "http://localhost:10000",
- "events": [
- "push"
- ],
- "active": true,
- "create_time": "2021-07-26 18:53:43"
-}
-
更新仓库webhook
- ---示例:
-
curl -X PATCH \
-http://localhost:3000/api/yystopf/ceshi/webhooks/7.json
-
await octokit.request('PATCH /api/yystopf/ceshi/webhooks/7.json')
PATCH /api/:owner/:repo/webhooks/:id.json
POST /api/:owner/:repo/webhooks.json
项目标识identifier | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id | -是 | -- | string | -webhook id | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
webhook.url | 是 | @@ -8188,28 +8044,79 @@ http://localhost:3000/api/yystopf/ceshi/webhooks/7.json "events": ["push"] } |
参数 | +类型 | +字段说明 | +
---|---|---|
id | +int | +id | +
url | +string | +地址 | +
content_type | +string | +POST Content Type | +
is_active | +bool | +是否激活 | +
type | +string | +类型 | +
events | +array | +触发事件 | +
create_time | +string | +创建时间 | +
返回的JSON示例:
{
- "status": 0,
- "message": "success"
+ "id": 18,
+ "type": "gitea",
+ "content_type": "json",
+ "url": "http://localhost:10000",
+ "events": [
+ "push"
+ ],
+ "active": true,
+ "create_time": "2021-07-26 18:53:43"
}
删除仓库webhook
+更新仓库webhook
-示例:
curl -X DELETE \
+curl -X PATCH \
http://localhost:3000/api/yystopf/ceshi/webhooks/7.json
-
await octokit.request('DELETE /api/yystopf/ceshi/webhooks/7.json')
+
await octokit.request('PATCH /api/yystopf/ceshi/webhooks/7.json')
HTTP 请求
-DELETE /api/:owner/:repo/webhooks/:id.json
+PATCH /api/:owner/:repo/webhooks/:id.json
请求参数:
@@ -8241,8 +8148,222 @@ http://localhost:3000/api/yystopf/ceshi/webhooks/7.json
string
webhook id
+
+webhook.url
+是
+
+string
+目标url
+
+
+webhook.type
+否
+
+string
+类型
+
+
+webhook.http_method
+是
+
+string
+http方法, POST和GET
+
+
+webhook.content_type
+是
+
+string
+POST Content Type
+
+
+webhook.secret
+否
+
+string
+密钥文本
+
+
+webhook.active
+是
+
+bool
+是否激活
+
+
+webhook.branch_filter
+否
+
+string
+分支过滤
+
+
+webhook.events
+否
+
+array
+触发事件
+
-返回字段说明:
+
+触发事件字段说明
+
+
+
+参数
+含义
+
+
+
+create
+创建分支或标签
+
+
+delete
+分支或标签删除
+
+
+fork
+仓库被fork
+
+
+push
+git仓库推送
+
+
+issue
+易修已打开、已关闭、已重新打开或编辑
+
+
+issue_assign
+易修被指派
+
+
+issue_label
+易修标签被更新或删除
+
+
+issue_milestone
+易修被收入里程碑
+
+
+issue_comment
+易修评论
+
+
+pull_request
+合并请求
+
+
+pull_request_assign
+合并请求被指派
+
+
+pull_request_label
+合并请求被贴上标签
+
+
+pull_request_milestone
+合并请求被记录于里程碑中
+
+
+pull_request_comment
+合并请求被评论
+
+
+pull_request_review_approved
+合并请求被批准
+
+
+pull_request_review_rejected
+合并请求被拒绝
+
+
+pull_request_review_comment
+合并请求被提出审查意见
+
+
+pull_request_sync
+合并请求被同步
+
+
+repository
+创建或删除仓库
+
+
+release
+版本发布
+
+
+
+
+请求的JSON示例:
+
+{
+ "active": true,
+ "content_type": "json",
+ "http_method": "GET",
+ "secret": "123456",
+ "url": "http://localhost:10000",
+ "branch_filter": "*",
+ "events": ["push"]
+}
+
返回字段说明:
+
+返回的JSON示例:
+
+{
+ "status": 0,
+ "message": "success"
+}
+
+
+删除仓库webhook
+删除仓库webhook
+
+
+示例:
+
+curl -X DELETE \
+http://localhost:3000/api/yystopf/ceshi/webhooks/7.json
+
await octokit.request('DELETE /api/yystopf/ceshi/webhooks/7.json')
+
HTTP 请求
+DELETE /api/:owner/:repo/webhooks/:id.json
+请求参数:
+
+
+参数
+必选
+默认
+类型
+字段说明
+
+
+
+owner
+是
+
+string
+用户登录名
+
+
+repo
+是
+
+string
+项目标识identifier
+
+
+id
+是
+
+string
+webhook id
+
+
+返回字段说明:
返回的JSON示例:
@@ -8263,9 +8384,9 @@ http://localhost:3000/api/yystopf/ceshi/webhooks/7.json
curl -X GET \
http://localhost:3000/api/yystopf/ceshi/webhooks/3/tasks.json
await octokit.request('GET /api/yystopf/ceshi/webhooks/3/tasks.json')
-
HTTP 请求
+
GET /api/:owner/:repo/webhooks/:id/tasks.json
参数 | @@ -8297,7 +8418,7 @@ http://localhost:3000/api/yystopf/ceshi/webhooks/3/tasks.jsonwebhook ID |
---|
参数 | @@ -8534,9 +8655,9 @@ http://localhost:3000/api/yystopf/ceshi/webhooks/3/tasks.json
---|
参数 | @@ -8568,7 +8689,7 @@ http://localhost:3000/api/yystopf/ceshi/webhooks/3/test.jsonwebhook ID |
---|
返回的JSON示例: