Cleanup api docs and ts api-client options (#3663)

This commit is contained in:
Anbraten 2024-05-01 11:50:41 +02:00 committed by GitHub
parent 4d2610c22e
commit dbd91d3884
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 207 additions and 189 deletions

View file

@ -78,11 +78,11 @@ func FormatFlag(tmpl string, hidden ...bool) *cli.StringFlag {
var RepoFlag = &cli.StringFlag{ var RepoFlag = &cli.StringFlag{
Name: "repository", Name: "repository",
Aliases: []string{"repo"}, Aliases: []string{"repo"},
Usage: "repository id or full-name (e.g. 134 or octocat/hello-world)", Usage: "repository id or full name (e.g. 134 or octocat/hello-world)",
} }
var OrgFlag = &cli.StringFlag{ var OrgFlag = &cli.StringFlag{
Name: "organization", Name: "organization",
Aliases: []string{"org"}, Aliases: []string{"org"},
Usage: "organization id or full-name (e.g. 123 or octocat)", Usage: "organization id or full name (e.g. 123 or octocat)",
} }

View file

@ -26,7 +26,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Agents" "Agents"
], ],
"summary": "Get agent list", "summary": "List agents",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -64,13 +64,14 @@ const docTemplate = `{
} }
}, },
"post": { "post": {
"description": "Creates a new agent with a random token",
"produces": [ "produces": [
"application/json" "application/json"
], ],
"tags": [ "tags": [
"Agents" "Agents"
], ],
"summary": "Create a new agent with a random token so a new agent can connect to the server", "summary": "Create a new agent",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -108,7 +109,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Agents" "Agents"
], ],
"summary": "Get agent information", "summary": "Get an agent",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -173,7 +174,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Agents" "Agents"
], ],
"summary": "Update agent information", "summary": "Update an agent",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -218,7 +219,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Agents" "Agents"
], ],
"summary": "Get agent tasks", "summary": "List agent tasks",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -283,7 +284,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Badges" "Badges"
], ],
"summary": "Get status badge, SVG format", "summary": "Get status of pipeline as SVG badge",
"parameters": [ "parameters": [
{ {
"type": "integer", "type": "integer",
@ -744,7 +745,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Organizations" "Organizations"
], ],
"summary": "Lookup organization by full-name", "summary": "Lookup an organization by full name",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -756,7 +757,7 @@ const docTemplate = `{
}, },
{ {
"type": "string", "type": "string",
"description": "the organizations full-name / slug", "description": "the organizations full name / slug",
"name": "org_full_name", "name": "org_full_name",
"in": "path", "in": "path",
"required": true "required": true
@ -781,7 +782,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Orgs" "Orgs"
], ],
"summary": "Get all orgs", "summary": "List organizations",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -828,7 +829,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Orgs" "Orgs"
], ],
"summary": "Delete an org", "summary": "Delete an organization",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -861,7 +862,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Organization" "Organization"
], ],
"summary": "Get organization by id", "summary": "Get an organization",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -900,7 +901,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Organization permissions" "Organization permissions"
], ],
"summary": "Get the permissions of the current user in the given organization", "summary": "Get the permissions of the currently authenticated user for the given organization",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -939,7 +940,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Organization secrets" "Organization secrets"
], ],
"summary": "Get the organization secret list", "summary": "List organization secrets",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -990,7 +991,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Organization secrets" "Organization secrets"
], ],
"summary": "Persist/create an organization secret", "summary": "Create an organization secret",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -1035,7 +1036,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Organization secrets" "Organization secrets"
], ],
"summary": "Get the named organization secret", "summary": "Get a organization secret by name",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -1076,7 +1077,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Organization secrets" "Organization secrets"
], ],
"summary": "Delete the named secret from an organization", "summary": "Delete an organization secret by name",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -1114,7 +1115,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Organization secrets" "Organization secrets"
], ],
"summary": "Update an organization secret", "summary": "Update an organization secret by name",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -1166,7 +1167,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Pipeline queues" "Pipeline queues"
], ],
"summary": "List pipeline queues", "summary": "List pipelines in queue",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -1257,7 +1258,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Pipeline queues" "Pipeline queues"
], ],
"summary": "Pause a pipeline queue", "summary": "Pause the pipeline queue",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -1283,7 +1284,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Pipeline queues" "Pipeline queues"
], ],
"summary": "Resume a pipeline queue", "summary": "Resume the pipeline queue",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -1303,13 +1304,14 @@ const docTemplate = `{
}, },
"/repos": { "/repos": {
"get": { "get": {
"description": "Returns a list of all repositories. Requires admin rights.",
"produces": [ "produces": [
"application/json" "application/json"
], ],
"tags": [ "tags": [
"Repositories" "Repositories"
], ],
"summary": "List all repositories on the server. Requires admin rights.", "summary": "List all repositories on the server",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -1395,7 +1397,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Repositories" "Repositories"
], ],
"summary": "Get repository by full-name", "summary": "Lookup a repository by full name",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -1407,7 +1409,7 @@ const docTemplate = `{
}, },
{ {
"type": "string", "type": "string",
"description": "the repository full-name / slug", "description": "the repository full name / slug",
"name": "repo_full_name", "name": "repo_full_name",
"in": "path", "in": "path",
"required": true "required": true
@ -1425,13 +1427,14 @@ const docTemplate = `{
}, },
"/repos/repair": { "/repos/repair": {
"post": { "post": {
"description": "Executes a repair process on all repositories. Requires admin rights.",
"produces": [ "produces": [
"text/plain" "text/plain"
], ],
"tags": [ "tags": [
"Repositories" "Repositories"
], ],
"summary": "Repair all repositories on the server. Requires admin rights.", "summary": "Repair all repositories on the server",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -1457,7 +1460,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Repositories" "Repositories"
], ],
"summary": "Get repository information", "summary": "Get a repository",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -1525,7 +1528,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Repositories" "Repositories"
], ],
"summary": "Change a repository", "summary": "Update a repository",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -1570,7 +1573,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Repositories" "Repositories"
], ],
"summary": "Get repository branches", "summary": "Get branches of a repository",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -1623,7 +1626,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Repositories" "Repositories"
], ],
"summary": "Change a repository's owner, to the one holding the access token", "summary": "Change a repository's owner to the currently authenticated user",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -1659,7 +1662,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Repository cron jobs" "Repository cron jobs"
], ],
"summary": "Get the cron job list", "summary": "List cron jobs",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -1710,7 +1713,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Repository cron jobs" "Repository cron jobs"
], ],
"summary": "Persist/creat a cron job", "summary": "Create a cron job",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -1755,7 +1758,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Repository cron jobs" "Repository cron jobs"
], ],
"summary": "Get a cron job by id", "summary": "Get a cron job",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -1837,7 +1840,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Repository cron jobs" "Repository cron jobs"
], ],
"summary": "Delete a cron job by id", "summary": "Delete a cron job",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -1927,7 +1930,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Pipeline logs" "Pipeline logs"
], ],
"summary": "Deletes log", "summary": "Deletes all logs of a pipeline",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -1967,7 +1970,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Pipeline logs" "Pipeline logs"
], ],
"summary": "Log information", "summary": "Get logs for a pipeline step",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -2020,7 +2023,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Pipeline logs" "Pipeline logs"
], ],
"summary": "Deletes step log", "summary": "Delete step logs of a pipeline",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -2108,7 +2111,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Repositories" "Repositories"
], ],
"summary": "Repository permission information", "summary": "Check current authenticated users access to the repository",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -2138,13 +2141,14 @@ const docTemplate = `{
}, },
"/repos/{repo_id}/pipelines": { "/repos/{repo_id}/pipelines": {
"get": { "get": {
"description": "Get a list of pipelines for a repository.",
"produces": [ "produces": [
"application/json" "application/json"
], ],
"tags": [ "tags": [
"Pipelines" "Pipelines"
], ],
"summary": "Get pipelines, current running and past ones", "summary": "List repository pipelines",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -2207,7 +2211,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Pipelines" "Pipelines"
], ],
"summary": "Run/trigger a pipelines", "summary": "Trigger a manual pipeline",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -2252,7 +2256,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Pipelines" "Pipelines"
], ],
"summary": "Pipeline information by number", "summary": "Get a repositories pipeline",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -2347,7 +2351,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Pipelines" "Pipelines"
], ],
"summary": "Delete pipeline", "summary": "Delete a pipeline",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -2387,7 +2391,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Pipelines" "Pipelines"
], ],
"summary": "Start pipelines in gated repos", "summary": "Approve and start a pipeline",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -2430,7 +2434,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Pipelines" "Pipelines"
], ],
"summary": "Cancels a pipeline", "summary": "Cancel a pipeline",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -2470,7 +2474,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Pipelines" "Pipelines"
], ],
"summary": "Pipeline configuration", "summary": "Get configuration files for a pipeline",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -2516,7 +2520,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Pipelines" "Pipelines"
], ],
"summary": "Decline pipelines in gated repos", "summary": "Decline a pipeline",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -2559,7 +2563,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Repositories" "Repositories"
], ],
"summary": "List active pull requests", "summary": "List active pull requests of a repository",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -2612,7 +2616,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Repository registries" "Repository registries"
], ],
"summary": "Get the registry list", "summary": "List registries",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -2663,7 +2667,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Repository registries" "Repository registries"
], ],
"summary": "Persist/create a registry", "summary": "Create a registry",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -2708,7 +2712,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Repository registries" "Repository registries"
], ],
"summary": "Get a named registry", "summary": "Get a registry by name",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -2749,7 +2753,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Repository registries" "Repository registries"
], ],
"summary": "Delete a named registry", "summary": "Delete a registry by name",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -2787,7 +2791,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Repository registries" "Repository registries"
], ],
"summary": "Update a named registry", "summary": "Update a registry by name",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -2872,7 +2876,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Repository secrets" "Repository secrets"
], ],
"summary": "Get the secret list", "summary": "List repository secrets",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -2923,7 +2927,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Repository secrets" "Repository secrets"
], ],
"summary": "Persist/create a secret", "summary": "Create a repository secret",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -2968,7 +2972,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Repository secrets" "Repository secrets"
], ],
"summary": "Get a named secret", "summary": "Get a repository secret by name",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -3009,7 +3013,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Repository secrets" "Repository secrets"
], ],
"summary": "Delete a named secret", "summary": "Delete a repository secret by name",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -3047,7 +3051,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Repository secrets" "Repository secrets"
], ],
"summary": "Update a named secret", "summary": "Update a repository secret by name",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -3099,7 +3103,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Secrets" "Secrets"
], ],
"summary": "Get the global secret list", "summary": "List global secrets",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -3143,7 +3147,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Secrets" "Secrets"
], ],
"summary": "Persist/create a global secret", "summary": "Create a global secret",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -3311,14 +3315,14 @@ const docTemplate = `{
}, },
"/stream/events": { "/stream/events": {
"get": { "get": {
"description": "event source streaming for compatibility with quic and http2", "description": "With quic and http2 support",
"produces": [ "produces": [
"text/plain" "text/plain"
], ],
"tags": [ "tags": [
"Events" "Events"
], ],
"summary": "Event stream", "summary": "Stream events like pipeline updates",
"responses": { "responses": {
"200": { "200": {
"description": "OK" "description": "OK"
@ -3334,7 +3338,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Pipeline logs" "Pipeline logs"
], ],
"summary": "Log stream", "summary": "Stream logs of a pipeline step",
"parameters": [ "parameters": [
{ {
"type": "integer", "type": "integer",
@ -3373,7 +3377,7 @@ const docTemplate = `{
"tags": [ "tags": [
"User" "User"
], ],
"summary": "Returns the currently authenticated user.", "summary": "Get the currently authenticated user",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -3396,14 +3400,14 @@ const docTemplate = `{
}, },
"/user/feed": { "/user/feed": {
"get": { "get": {
"description": "Feed entries can be used to display information on the latest builds.", "description": "The feed lists the most recent pipeline for the currently authenticated user.",
"produces": [ "produces": [
"application/json" "application/json"
], ],
"tags": [ "tags": [
"User" "User"
], ],
"summary": "A feed entry for a build.", "summary": "Get the currently authenticaed users pipeline feed",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -3418,7 +3422,10 @@ const docTemplate = `{
"200": { "200": {
"description": "OK", "description": "OK",
"schema": { "schema": {
"$ref": "#/definitions/Feed" "type": "array",
"items": {
"$ref": "#/definitions/Feed"
}
} }
} }
} }
@ -3433,7 +3440,7 @@ const docTemplate = `{
"tags": [ "tags": [
"User" "User"
], ],
"summary": "Get user's repos", "summary": "Get user's repositories",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -3523,7 +3530,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Users" "Users"
], ],
"summary": "Get all users", "summary": "List users",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -3677,7 +3684,7 @@ const docTemplate = `{
"tags": [ "tags": [
"Users" "Users"
], ],
"summary": "Change a user", "summary": "Update a user",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",

8
go.sum
View file

@ -540,8 +540,6 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@ -575,8 +573,6 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc=
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
@ -623,8 +619,6 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
@ -633,8 +627,6 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q=
golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=

View file

@ -30,7 +30,7 @@ import (
// GetAgents // GetAgents
// //
// @Summary Get agent list // @Summary List agents
// @Router /agents [get] // @Router /agents [get]
// @Produce json // @Produce json
// @Success 200 {array} Agent // @Success 200 {array} Agent
@ -49,7 +49,7 @@ func GetAgents(c *gin.Context) {
// GetAgent // GetAgent
// //
// @Summary Get agent information // @Summary Get an agent
// @Router /agents/{agent} [get] // @Router /agents/{agent} [get]
// @Produce json // @Produce json
// @Success 200 {object} Agent // @Success 200 {object} Agent
@ -73,7 +73,7 @@ func GetAgent(c *gin.Context) {
// GetAgentTasks // GetAgentTasks
// //
// @Summary Get agent tasks // @Summary List agent tasks
// @Router /agents/{agent}/tasks [get] // @Router /agents/{agent}/tasks [get]
// @Produce json // @Produce json
// @Success 200 {array} Task // @Success 200 {array} Task
@ -106,7 +106,7 @@ func GetAgentTasks(c *gin.Context) {
// PatchAgent // PatchAgent
// //
// @Summary Update agent information // @Summary Update an agent
// @Router /agents/{agent} [patch] // @Router /agents/{agent} [patch]
// @Produce json // @Produce json
// @Success 200 {object} Agent // @Success 200 {object} Agent
@ -152,7 +152,8 @@ func PatchAgent(c *gin.Context) {
// PostAgent // PostAgent
// //
// @Summary Create a new agent with a random token so a new agent can connect to the server // @Summary Create a new agent
// @Description Creates a new agent with a random token
// @Router /agents [post] // @Router /agents [post]
// @Produce json // @Produce json
// @Success 200 {object} Agent // @Success 200 {object} Agent

View file

@ -37,7 +37,7 @@ import (
// GetBadge // GetBadge
// //
// @Summary Get status badge, SVG format // @Summary Get status of pipeline as SVG badge
// @Router /badges/{repo_id}/status.svg [get] // @Router /badges/{repo_id}/status.svg [get]
// @Produce image/svg+xml // @Produce image/svg+xml
// @Success 200 // @Success 200

View file

@ -32,7 +32,7 @@ import (
// GetCron // GetCron
// //
// @Summary Get a cron job by id // @Summary Get a cron job
// @Router /repos/{repo_id}/cron/{cron} [get] // @Router /repos/{repo_id}/cron/{cron} [get]
// @Produce json // @Produce json
// @Success 200 {object} Cron // @Success 200 {object} Cron
@ -98,7 +98,7 @@ func RunCron(c *gin.Context) {
// PostCron // PostCron
// //
// @Summary Persist/creat a cron job // @Summary Create a cron job
// @Router /repos/{repo_id}/cron [post] // @Router /repos/{repo_id}/cron [post]
// @Produce json // @Produce json
// @Success 200 {object} Cron // @Success 200 {object} Cron
@ -233,7 +233,7 @@ func PatchCron(c *gin.Context) {
// GetCronList // GetCronList
// //
// @Summary Get the cron job list // @Summary List cron jobs
// @Router /repos/{repo_id}/cron [get] // @Router /repos/{repo_id}/cron [get]
// @Produce json // @Produce json
// @Success 200 {array} Cron // @Success 200 {array} Cron
@ -254,7 +254,7 @@ func GetCronList(c *gin.Context) {
// DeleteCron // DeleteCron
// //
// @Summary Delete a cron job by id // @Summary Delete a cron job
// @Router /repos/{repo_id}/cron/{cron} [delete] // @Router /repos/{repo_id}/cron/{cron} [delete]
// @Produce plain // @Produce plain
// @Success 204 // @Success 204

View file

@ -26,7 +26,7 @@ import (
// GetGlobalSecretList // GetGlobalSecretList
// //
// @Summary Get the global secret list // @Summary List global secrets
// @Router /secrets [get] // @Router /secrets [get]
// @Produce json // @Produce json
// @Success 200 {array} Secret // @Success 200 {array} Secret
@ -71,7 +71,7 @@ func GetGlobalSecret(c *gin.Context) {
// PostGlobalSecret // PostGlobalSecret
// //
// @Summary Persist/create a global secret // @Summary Create a global secret
// @Router /secrets [post] // @Router /secrets [post]
// @Produce json // @Produce json
// @Success 200 {object} Secret // @Success 200 {object} Secret

View file

@ -52,7 +52,7 @@ func GetQueueInfo(c *gin.Context) {
// PauseQueue // PauseQueue
// //
// @Summary Pause a pipeline queue // @Summary Pause the pipeline queue
// @Router /queue/pause [post] // @Router /queue/pause [post]
// @Produce plain // @Produce plain
// @Success 204 // @Success 204
@ -65,7 +65,7 @@ func PauseQueue(c *gin.Context) {
// ResumeQueue // ResumeQueue
// //
// @Summary Resume a pipeline queue // @Summary Resume the pipeline queue
// @Router /queue/resume [post] // @Router /queue/resume [post]
// @Produce plain // @Produce plain
// @Success 204 // @Success 204

View file

@ -30,7 +30,7 @@ import (
// GetOrg // GetOrg
// //
// @Summary Get organization by id // @Summary Get an organization
// @Router /orgs/{org_id} [get] // @Router /orgs/{org_id} [get]
// @Produce json // @Produce json
// @Success 200 {array} Org // @Success 200 {array} Org
@ -57,7 +57,7 @@ func GetOrg(c *gin.Context) {
// GetOrgPermissions // GetOrgPermissions
// //
// @Summary Get the permissions of the current user in the given organization // @Summary Get the permissions of the currently authenticated user for the given organization
// @Router /orgs/{org_id}/permissions [get] // @Router /orgs/{org_id}/permissions [get]
// @Produce json // @Produce json
// @Success 200 {array} OrgPerm // @Success 200 {array} OrgPerm
@ -114,13 +114,13 @@ func GetOrgPermissions(c *gin.Context) {
// LookupOrg // LookupOrg
// //
// @Summary Lookup organization by full-name // @Summary Lookup an organization by full name
// @Router /org/lookup/{org_full_name} [get] // @Router /org/lookup/{org_full_name} [get]
// @Produce json // @Produce json
// @Success 200 {object} Org // @Success 200 {object} Org
// @Tags Organizations // @Tags Organizations
// @Param Authorization header string true "Insert your personal access token" default(Bearer <personal access token>) // @Param Authorization header string true "Insert your personal access token" default(Bearer <personal access token>)
// @Param org_full_name path string true "the organizations full-name / slug" // @Param org_full_name path string true "the organizations full name / slug"
func LookupOrg(c *gin.Context) { func LookupOrg(c *gin.Context) {
_store := store.FromContext(c) _store := store.FromContext(c)
user := session.User(c) user := session.User(c)

View file

@ -27,7 +27,7 @@ import (
// GetOrgSecret // GetOrgSecret
// //
// @Summary Get the named organization secret // @Summary Get a organization secret by name
// @Router /orgs/{org_id}/secrets/{secret} [get] // @Router /orgs/{org_id}/secrets/{secret} [get]
// @Produce json // @Produce json
// @Success 200 {object} Secret // @Success 200 {object} Secret
@ -55,7 +55,7 @@ func GetOrgSecret(c *gin.Context) {
// GetOrgSecretList // GetOrgSecretList
// //
// @Summary Get the organization secret list // @Summary List organization secrets
// @Router /orgs/{org_id}/secrets [get] // @Router /orgs/{org_id}/secrets [get]
// @Produce json // @Produce json
// @Success 200 {array} Secret // @Success 200 {array} Secret
@ -87,7 +87,7 @@ func GetOrgSecretList(c *gin.Context) {
// PostOrgSecret // PostOrgSecret
// //
// @Summary Persist/create an organization secret // @Summary Create an organization secret
// @Router /orgs/{org_id}/secrets [post] // @Router /orgs/{org_id}/secrets [post]
// @Produce json // @Produce json
// @Success 200 {object} Secret // @Success 200 {object} Secret
@ -129,7 +129,7 @@ func PostOrgSecret(c *gin.Context) {
// PatchOrgSecret // PatchOrgSecret
// //
// @Summary Update an organization secret // @Summary Update an organization secret by name
// @Router /orgs/{org_id}/secrets/{secret} [patch] // @Router /orgs/{org_id}/secrets/{secret} [patch]
// @Produce json // @Produce json
// @Success 200 {object} Secret // @Success 200 {object} Secret
@ -183,7 +183,7 @@ func PatchOrgSecret(c *gin.Context) {
// DeleteOrgSecret // DeleteOrgSecret
// //
// @Summary Delete the named secret from an organization // @Summary Delete an organization secret by name
// @Router /orgs/{org_id}/secrets/{secret} [delete] // @Router /orgs/{org_id}/secrets/{secret} [delete]
// @Produce plain // @Produce plain
// @Success 204 // @Success 204

View file

@ -26,7 +26,7 @@ import (
// GetOrgs // GetOrgs
// //
// @Summary Get all orgs // @Summary List organizations
// @Description Returns all registered orgs in the system. Requires admin rights. // @Description Returns all registered orgs in the system. Requires admin rights.
// @Router /orgs [get] // @Router /orgs [get]
// @Produce json // @Produce json
@ -46,7 +46,7 @@ func GetOrgs(c *gin.Context) {
// DeleteOrg // DeleteOrg
// //
// @Summary Delete an org // @Summary Delete an organization
// @Description Deletes the given org. Requires admin rights. // @Description Deletes the given org. Requires admin rights.
// @Router /orgs/{id} [delete] // @Router /orgs/{id} [delete]
// @Produce plain // @Produce plain

View file

@ -38,7 +38,7 @@ import (
// CreatePipeline // CreatePipeline
// //
// @Summary Run/trigger a pipelines // @Summary Trigger a manual pipeline
// @Router /repos/{repo_id}/pipelines [post] // @Router /repos/{repo_id}/pipelines [post]
// @Produce json // @Produce json
// @Success 200 {object} Pipeline // @Success 200 {object} Pipeline
@ -100,7 +100,8 @@ func createTmpPipeline(event model.WebhookEvent, commit *model.Commit, user *mod
// GetPipelines // GetPipelines
// //
// @Summary Get pipelines, current running and past ones // @Summary List repository pipelines
// @Description Get a list of pipelines for a repository.
// @Router /repos/{repo_id}/pipelines [get] // @Router /repos/{repo_id}/pipelines [get]
// @Produce json // @Produce json
// @Success 200 {array} Pipeline // @Success 200 {array} Pipeline
@ -146,7 +147,7 @@ func GetPipelines(c *gin.Context) {
// DeletePipeline // DeletePipeline
// //
// @Summary Delete pipeline // @Summary Delete a pipeline
// @Router /repos/{repo_id}/pipelines/{number} [delete] // @Router /repos/{repo_id}/pipelines/{number} [delete]
// @Produce plain // @Produce plain
// @Success 204 // @Success 204
@ -186,7 +187,7 @@ func DeletePipeline(c *gin.Context) {
// GetPipeline // GetPipeline
// //
// @Summary Pipeline information by number // @Summary Get a repositories pipeline
// @Router /repos/{repo_id}/pipelines/{number} [get] // @Router /repos/{repo_id}/pipelines/{number} [get]
// @Produce json // @Produce json
// @Success 200 {object} Pipeline // @Success 200 {object} Pipeline
@ -241,7 +242,7 @@ func GetPipelineLast(c *gin.Context) {
// GetStepLogs // GetStepLogs
// //
// @Summary Log information // @Summary Get logs for a pipeline step
// @Router /repos/{repo_id}/logs/{number}/{stepID} [get] // @Router /repos/{repo_id}/logs/{number}/{stepID} [get]
// @Produce json // @Produce json
// @Success 200 {array} LogEntry // @Success 200 {array} LogEntry
@ -297,7 +298,7 @@ func GetStepLogs(c *gin.Context) {
// DeleteStepLogs // DeleteStepLogs
// //
// @Summary Deletes step log // @Summary Delete step logs of a pipeline
// @Router /repos/{repo_id}/logs/{number}/{stepId} [delete] // @Router /repos/{repo_id}/logs/{number}/{stepId} [delete]
// @Produce plain // @Produce plain
// @Success 204 // @Success 204
@ -357,7 +358,7 @@ func DeleteStepLogs(c *gin.Context) {
// GetPipelineConfig // GetPipelineConfig
// //
// @Summary Pipeline configuration // @Summary Get configuration files for a pipeline
// @Router /repos/{repo_id}/pipelines/{number}/config [get] // @Router /repos/{repo_id}/pipelines/{number}/config [get]
// @Produce json // @Produce json
// @Success 200 {array} Config // @Success 200 {array} Config
@ -391,7 +392,7 @@ func GetPipelineConfig(c *gin.Context) {
// CancelPipeline // CancelPipeline
// //
// @Summary Cancels a pipeline // @Summary Cancel a pipeline
// @Router /repos/{repo_id}/pipelines/{number}/cancel [post] // @Router /repos/{repo_id}/pipelines/{number}/cancel [post]
// @Produce plain // @Produce plain
// @Success 200 // @Success 200
@ -427,7 +428,7 @@ func CancelPipeline(c *gin.Context) {
// PostApproval // PostApproval
// //
// @Summary Start pipelines in gated repos // @Summary Approve and start a pipeline
// @Router /repos/{repo_id}/pipelines/{number}/approve [post] // @Router /repos/{repo_id}/pipelines/{number}/approve [post]
// @Produce json // @Produce json
// @Success 200 {object} Pipeline // @Success 200 {object} Pipeline
@ -459,7 +460,7 @@ func PostApproval(c *gin.Context) {
// PostDecline // PostDecline
// //
// @Summary Decline pipelines in gated repos // @Summary Decline a pipeline
// @Router /repos/{repo_id}/pipelines/{number}/decline [post] // @Router /repos/{repo_id}/pipelines/{number}/decline [post]
// @Produce json // @Produce json
// @Success 200 {object} Pipeline // @Success 200 {object} Pipeline
@ -491,7 +492,7 @@ func PostDecline(c *gin.Context) {
// GetPipelineQueue // GetPipelineQueue
// //
// @Summary List pipeline queues // @Summary List pipelines in queue
// @Router /pipelines [get] // @Router /pipelines [get]
// @Produce json // @Produce json
// @Success 200 {array} Feed // @Success 200 {array} Feed
@ -588,7 +589,7 @@ func PostPipeline(c *gin.Context) {
// DeletePipelineLogs // DeletePipelineLogs
// //
// @Summary Deletes log // @Summary Deletes all logs of a pipeline
// @Router /repos/{repo_id}/logs/{number} [delete] // @Router /repos/{repo_id}/logs/{number} [delete]
// @Produce plain // @Produce plain
// @Success 204 // @Success 204

View file

@ -26,7 +26,7 @@ import (
// GetRegistry // GetRegistry
// //
// @Summary Get a named registry // @Summary Get a registry by name
// @Router /repos/{repo_id}/registry/{registry} [get] // @Router /repos/{repo_id}/registry/{registry} [get]
// @Produce json // @Produce json
// @Success 200 {object} Registry // @Success 200 {object} Registry
@ -49,7 +49,7 @@ func GetRegistry(c *gin.Context) {
// PostRegistry // PostRegistry
// //
// @Summary Persist/create a registry // @Summary Create a registry
// @Router /repos/{repo_id}/registry [post] // @Router /repos/{repo_id}/registry [post]
// @Produce json // @Produce json
// @Success 200 {object} Registry // @Success 200 {object} Registry
@ -86,7 +86,7 @@ func PostRegistry(c *gin.Context) {
// PatchRegistry // PatchRegistry
// //
// @Summary Update a named registry // @Summary Update a registry by name
// @Router /repos/{repo_id}/registry/{registry} [patch] // @Router /repos/{repo_id}/registry/{registry} [patch]
// @Produce json // @Produce json
// @Success 200 {object} Registry // @Success 200 {object} Registry
@ -134,7 +134,7 @@ func PatchRegistry(c *gin.Context) {
// GetRegistryList // GetRegistryList
// //
// @Summary Get the registry list // @Summary List registries
// @Router /repos/{repo_id}/registry [get] // @Router /repos/{repo_id}/registry [get]
// @Produce json // @Produce json
// @Success 200 {array} Registry // @Success 200 {array} Registry
@ -161,7 +161,7 @@ func GetRegistryList(c *gin.Context) {
// DeleteRegistry // DeleteRegistry
// //
// @Summary Delete a named registry // @Summary Delete a registry by name
// @Router /repos/{repo_id}/registry/{registry} [delete] // @Router /repos/{repo_id}/registry/{registry} [delete]
// @Produce plain // @Produce plain
// @Success 204 // @Success 204

View file

@ -199,7 +199,7 @@ func PostRepo(c *gin.Context) {
// PatchRepo // PatchRepo
// //
// @Summary Change a repository // @Summary Update a repository
// @Router /repos/{repo_id} [patch] // @Router /repos/{repo_id} [patch]
// @Produce json // @Produce json
// @Success 200 {object} Repo // @Success 200 {object} Repo
@ -273,7 +273,7 @@ func PatchRepo(c *gin.Context) {
// ChownRepo // ChownRepo
// //
// @Summary Change a repository's owner, to the one holding the access token // @Summary Change a repository's owner to the currently authenticated user
// @Router /repos/{repo_id}/chown [post] // @Router /repos/{repo_id}/chown [post]
// @Produce json // @Produce json
// @Success 200 {object} Repo // @Success 200 {object} Repo
@ -296,20 +296,20 @@ func ChownRepo(c *gin.Context) {
// LookupRepo // LookupRepo
// //
// @Summary Get repository by full-name // @Summary Lookup a repository by full name
// @Router /repos/lookup/{repo_full_name} [get] // @Router /repos/lookup/{repo_full_name} [get]
// @Produce json // @Produce json
// @Success 200 {object} Repo // @Success 200 {object} Repo
// @Tags Repositories // @Tags Repositories
// @Param Authorization header string true "Insert your personal access token" default(Bearer <personal access token>) // @Param Authorization header string true "Insert your personal access token" default(Bearer <personal access token>)
// @Param repo_full_name path string true "the repository full-name / slug" // @Param repo_full_name path string true "the repository full name / slug"
func LookupRepo(c *gin.Context) { func LookupRepo(c *gin.Context) {
c.JSON(http.StatusOK, session.Repo(c)) c.JSON(http.StatusOK, session.Repo(c))
} }
// GetRepo // GetRepo
// //
// @Summary Get repository information // @Summary Get a repository
// @Router /repos/{repo_id} [get] // @Router /repos/{repo_id} [get]
// @Produce json // @Produce json
// @Success 200 {object} Repo // @Success 200 {object} Repo
@ -322,7 +322,7 @@ func GetRepo(c *gin.Context) {
// GetRepoPermissions // GetRepoPermissions
// //
// @Summary Repository permission information // @Summary Check current authenticated users access to the repository
// @Description The repository permission, according to the used access token. // @Description The repository permission, according to the used access token.
// @Router /repos/{repo_id}/permissions [get] // @Router /repos/{repo_id}/permissions [get]
// @Produce json // @Produce json
@ -337,7 +337,7 @@ func GetRepoPermissions(c *gin.Context) {
// GetRepoBranches // GetRepoBranches
// //
// @Summary Get repository branches // @Summary Get branches of a repository
// @Router /repos/{repo_id}/branches [get] // @Router /repos/{repo_id}/branches [get]
// @Produce json // @Produce json
// @Success 200 {array} string // @Success 200 {array} string
@ -367,7 +367,7 @@ func GetRepoBranches(c *gin.Context) {
// GetRepoPullRequests // GetRepoPullRequests
// //
// @Summary List active pull requests // @Summary List active pull requests of a repository
// @Router /repos/{repo_id}/pull_requests [get] // @Router /repos/{repo_id}/pull_requests [get]
// @Produce json // @Produce json
// @Success 200 {array} PullRequest // @Success 200 {array} PullRequest
@ -547,7 +547,8 @@ func MoveRepo(c *gin.Context) {
// GetAllRepos // GetAllRepos
// //
// @Summary List all repositories on the server. Requires admin rights. // @Summary List all repositories on the server
// @Description Returns a list of all repositories. Requires admin rights.
// @Router /repos [get] // @Router /repos [get]
// @Produce json // @Produce json
// @Success 200 {array} Repo // @Success 200 {array} Repo
@ -572,7 +573,8 @@ func GetAllRepos(c *gin.Context) {
// RepairAllRepos // RepairAllRepos
// //
// @Summary Repair all repositories on the server. Requires admin rights. // @Summary Repair all repositories on the server
// @Description Executes a repair process on all repositories. Requires admin rights.
// @Router /repos/repair [post] // @Router /repos/repair [post]
// @Produce plain // @Produce plain
// @Success 204 // @Success 204

View file

@ -26,7 +26,7 @@ import (
// GetSecret // GetSecret
// //
// @Summary Get a named secret // @Summary Get a repository secret by name
// @Router /repos/{repo_id}/secrets/{secretName} [get] // @Router /repos/{repo_id}/secrets/{secretName} [get]
// @Produce json // @Produce json
// @Success 200 {object} Secret // @Success 200 {object} Secret
@ -49,7 +49,7 @@ func GetSecret(c *gin.Context) {
// PostSecret // PostSecret
// //
// @Summary Persist/create a secret // @Summary Create a repository secret
// @Router /repos/{repo_id}/secrets [post] // @Router /repos/{repo_id}/secrets [post]
// @Produce json // @Produce json
// @Success 200 {object} Secret // @Success 200 {object} Secret
@ -87,7 +87,7 @@ func PostSecret(c *gin.Context) {
// PatchSecret // PatchSecret
// //
// @Summary Update a named secret // @Summary Update a repository secret by name
// @Router /repos/{repo_id}/secrets/{secretName} [patch] // @Router /repos/{repo_id}/secrets/{secretName} [patch]
// @Produce json // @Produce json
// @Success 200 {object} Secret // @Success 200 {object} Secret
@ -138,7 +138,7 @@ func PatchSecret(c *gin.Context) {
// GetSecretList // GetSecretList
// //
// @Summary Get the secret list // @Summary List repository secrets
// @Router /repos/{repo_id}/secrets [get] // @Router /repos/{repo_id}/secrets [get]
// @Produce json // @Produce json
// @Success 200 {array} Secret // @Success 200 {array} Secret
@ -165,7 +165,7 @@ func GetSecretList(c *gin.Context) {
// DeleteSecret // DeleteSecret
// //
// @Summary Delete a named secret // @Summary Delete a repository secret by name
// @Router /repos/{repo_id}/secrets/{secretName} [delete] // @Router /repos/{repo_id}/secrets/{secretName} [delete]
// @Produce plain // @Produce plain
// @Success 204 // @Success 204

View file

@ -36,8 +36,8 @@ import (
// EventStreamSSE // EventStreamSSE
// //
// @Summary Event stream // @Summary Stream events like pipeline updates
// @Description event source streaming for compatibility with quic and http2 // @Description With quic and http2 support
// @Router /stream/events [get] // @Router /stream/events [get]
// @Produce plain // @Produce plain
// @Success 200 // @Success 200
@ -124,7 +124,7 @@ func EventStreamSSE(c *gin.Context) {
// LogStreamSSE // LogStreamSSE
// //
// @Summary Log stream // @Summary Stream logs of a pipeline step
// @Router /stream/logs/{repo_id}/{pipeline}/{stepID} [get] // @Router /stream/logs/{repo_id}/{pipeline}/{stepID} [get]
// @Produce plain // @Produce plain
// @Success 200 // @Success 200

View file

@ -32,7 +32,7 @@ import (
// GetSelf // GetSelf
// //
// @Summary Returns the currently authenticated user. // @Summary Get the currently authenticated user
// @Router /user [get] // @Router /user [get]
// @Produce json // @Produce json
// @Success 200 {object} User // @Success 200 {object} User
@ -44,11 +44,11 @@ func GetSelf(c *gin.Context) {
// GetFeed // GetFeed
// //
// @Summary A feed entry for a build. // @Summary Get the currently authenticaed users pipeline feed
// @Description Feed entries can be used to display information on the latest builds. // @Description The feed lists the most recent pipeline for the currently authenticated user.
// @Router /user/feed [get] // @Router /user/feed [get]
// @Produce json // @Produce json
// @Success 200 {object} Feed // @Success 200 {array} Feed
// @Tags User // @Tags User
// @Param Authorization header string true "Insert your personal access token" default(Bearer <personal access token>) // @Param Authorization header string true "Insert your personal access token" default(Bearer <personal access token>)
func GetFeed(c *gin.Context) { func GetFeed(c *gin.Context) {
@ -77,7 +77,7 @@ func GetFeed(c *gin.Context) {
// GetRepos // GetRepos
// //
// @Summary Get user's repos // @Summary Get user's repositories
// @Description Retrieve the currently authenticated User's Repository list // @Description Retrieve the currently authenticated User's Repository list
// @Router /user/repos [get] // @Router /user/repos [get]
// @Produce json // @Produce json

View file

@ -28,7 +28,7 @@ import (
// GetUsers // GetUsers
// //
// @Summary Get all users // @Summary List users
// @Description Returns all registered, active users in the system. Requires admin rights. // @Description Returns all registered, active users in the system. Requires admin rights.
// @Router /users [get] // @Router /users [get]
// @Produce json // @Produce json
@ -67,7 +67,7 @@ func GetUser(c *gin.Context) {
// PatchUser // PatchUser
// //
// @Summary Change a user // @Summary Update a user
// @Description Changes the data of an existing user. Requires admin rights. // @Description Changes the data of an existing user. Requires admin rights.
// @Router /users/{login} [patch] // @Router /users/{login} [patch]
// @Produce json // @Produce json

View file

@ -158,7 +158,7 @@ const selectedAgent = ref<Partial<Agent>>();
const isEditingAgent = computed(() => !!selectedAgent.value?.id); const isEditingAgent = computed(() => !!selectedAgent.value?.id);
async function loadAgents(page: number): Promise<Agent[] | null> { async function loadAgents(page: number): Promise<Agent[] | null> {
return apiClient.getAgents(page); return apiClient.getAgents({ page });
} }
const { resetPage, data: agents } = usePagination(loadAgents, () => !selectedAgent.value); const { resetPage, data: agents } = usePagination(loadAgents, () => !selectedAgent.value);

View file

@ -50,7 +50,7 @@ const notifications = useNotifications();
const { t } = useI18n(); const { t } = useI18n();
async function loadOrgs(page: number): Promise<Org[] | null> { async function loadOrgs(page: number): Promise<Org[] | null> {
return apiClient.getOrgs(page); return apiClient.getOrgs({ page });
} }
const { resetPage, data: orgs } = usePagination(loadOrgs); const { resetPage, data: orgs } = usePagination(loadOrgs);

View file

@ -56,7 +56,7 @@ const notifications = useNotifications();
const i18n = useI18n(); const i18n = useI18n();
async function loadRepos(page: number): Promise<Repo[] | null> { async function loadRepos(page: number): Promise<Repo[] | null> {
return apiClient.getAllRepos(page); return apiClient.getAllRepos({ page });
} }
const { data: repos } = usePagination(loadRepos); const { data: repos } = usePagination(loadRepos);

View file

@ -65,7 +65,7 @@ const selectedSecret = ref<Partial<Secret>>();
const isEditingSecret = computed(() => !!selectedSecret.value?.id); const isEditingSecret = computed(() => !!selectedSecret.value?.id);
async function loadSecrets(page: number): Promise<Secret[] | null> { async function loadSecrets(page: number): Promise<Secret[] | null> {
return apiClient.getGlobalSecretList(page); return apiClient.getGlobalSecretList({ page });
} }
const { resetPage, data: secrets } = usePagination(loadSecrets, () => !selectedSecret.value); const { resetPage, data: secrets } = usePagination(loadSecrets, () => !selectedSecret.value);

View file

@ -107,7 +107,7 @@ const selectedUser = ref<Partial<User>>();
const isEditingUser = computed(() => !!selectedUser.value?.id); const isEditingUser = computed(() => !!selectedUser.value?.id);
async function loadUsers(page: number): Promise<User[] | null> { async function loadUsers(page: number): Promise<User[] | null> {
return apiClient.getUsers(page); return apiClient.getUsers({ page });
} }
const { resetPage, data: users } = usePagination(loadUsers, () => !selectedUser.value); const { resetPage, data: users } = usePagination(loadUsers, () => !selectedUser.value);

View file

@ -90,7 +90,7 @@ const pipelineOptions = computed(() => {
const loading = ref(true); const loading = ref(true);
onMounted(async () => { onMounted(async () => {
const data = await usePaginate((page) => apiClient.getRepoBranches(repo.value.id, page)); const data = await usePaginate((page) => apiClient.getRepoBranches(repo.value.id, { page }));
branches.value = data.map((e) => ({ branches.value = data.map((e) => ({
text: e, text: e,
value: e, value: e,

View file

@ -69,7 +69,7 @@ async function loadSecrets(page: number): Promise<Secret[] | null> {
throw new Error("Unexpected: Can't load org"); throw new Error("Unexpected: Can't load org");
} }
return apiClient.getOrgSecretList(org.value.id, page); return apiClient.getOrgSecretList(org.value.id, { page });
} }
const { resetPage, data: secrets } = usePagination(loadSecrets, () => !selectedSecret.value); const { resetPage, data: secrets } = usePagination(loadSecrets, () => !selectedSecret.value);

View file

@ -70,7 +70,7 @@ async function loadBranches() {
throw new Error('Unexpected: "repo" should be provided at this place'); throw new Error('Unexpected: "repo" should be provided at this place');
} }
branches.value = (await usePaginate((page) => apiClient.getRepoBranches(repo.value.id, page))) branches.value = (await usePaginate((page) => apiClient.getRepoBranches(repo.value.id, { page })))
.map((b) => ({ .map((b) => ({
value: b, value: b,
text: b, text: b,

View file

@ -121,7 +121,7 @@ async function loadCrons(page: number): Promise<Cron[] | null> {
throw new Error("Unexpected: Can't load repo"); throw new Error("Unexpected: Can't load repo");
} }
return apiClient.getCronList(repo.value.id, page); return apiClient.getCronList(repo.value.id, { page });
} }
const { resetPage, data: crons } = usePagination(loadCrons, () => !selectedCron.value); const { resetPage, data: crons } = usePagination(loadCrons, () => !selectedCron.value);

View file

@ -104,7 +104,7 @@ async function loadRegistries(page: number): Promise<Registry[] | null> {
throw new Error("Unexpected: Can't load repo"); throw new Error("Unexpected: Can't load repo");
} }
return apiClient.getRegistryList(repo.value.id, page); return apiClient.getRegistryList(repo.value.id, { page });
} }
const { resetPage, data: registries } = usePagination(loadRegistries, () => !selectedRegistry.value); const { resetPage, data: registries } = usePagination(loadRegistries, () => !selectedRegistry.value);

View file

@ -71,11 +71,11 @@ async function loadSecrets(page: number, level: 'repo' | 'org' | 'global'): Prom
switch (level) { switch (level) {
case 'repo': case 'repo':
return apiClient.getSecretList(repo.value.id, page); return apiClient.getSecretList(repo.value.id, { page });
case 'org': case 'org':
return apiClient.getOrgSecretList(repo.value.org_id, page); return apiClient.getOrgSecretList(repo.value.org_id, { page });
case 'global': case 'global':
return apiClient.getGlobalSecretList(page); return apiClient.getGlobalSecretList({ page });
default: default:
throw new Error(`Unexpected level: ${level}`); throw new Error(`Unexpected level: ${level}`);
} }

View file

@ -78,7 +78,7 @@ async function loadSecrets(page: number): Promise<Secret[] | null> {
throw new Error('Unexpected: Unauthenticated'); throw new Error('Unexpected: Unauthenticated');
} }
return apiClient.getOrgSecretList(user.org_id, page); return apiClient.getOrgSecretList(user.org_id, { page });
} }
const { resetPage, data: secrets } = usePagination(loadSecrets, () => !selectedSecret.value); const { resetPage, data: secrets } = usePagination(loadSecrets, () => !selectedSecret.value);

View file

@ -34,6 +34,11 @@ type DeploymentOptions = {
variables: Record<string, string>; variables: Record<string, string>;
}; };
type PaginationOptions = {
page?: number;
perPage?: number;
};
export default class WoodpeckerClient extends ApiClient { export default class WoodpeckerClient extends ApiClient {
getRepoList(opts?: RepoListOptions): Promise<Repo[]> { getRepoList(opts?: RepoListOptions): Promise<Repo[]> {
const query = encodeQueryString(opts); const query = encodeQueryString(opts);
@ -52,12 +57,14 @@ export default class WoodpeckerClient extends ApiClient {
return this._get(`/api/repos/${repoId}/permissions`) as Promise<RepoPermissions>; return this._get(`/api/repos/${repoId}/permissions`) as Promise<RepoPermissions>;
} }
getRepoBranches(repoId: number, page: number): Promise<string[]> { getRepoBranches(repoId: number, opts?: PaginationOptions): Promise<string[]> {
return this._get(`/api/repos/${repoId}/branches?page=${page}`) as Promise<string[]>; const query = encodeQueryString(opts);
return this._get(`/api/repos/${repoId}/branches?${query}`) as Promise<string[]>;
} }
getRepoPullRequests(repoId: number, page: number): Promise<PullRequest[]> { getRepoPullRequests(repoId: number, opts?: PaginationOptions): Promise<PullRequest[]> {
return this._get(`/api/repos/${repoId}/pull_requests?page=${page}`) as Promise<PullRequest[]>; const query = encodeQueryString(opts);
return this._get(`/api/repos/${repoId}/pull_requests?${query}`) as Promise<PullRequest[]>;
} }
activateRepo(forgeRemoteId: string): Promise<Repo> { activateRepo(forgeRemoteId: string): Promise<Repo> {
@ -93,7 +100,7 @@ export default class WoodpeckerClient extends ApiClient {
return this._post(`/api/repos/${repoId}/pipelines/${pipelineNumber}?${query}`) as Promise<Pipeline>; return this._post(`/api/repos/${repoId}/pipelines/${pipelineNumber}?${query}`) as Promise<Pipeline>;
} }
getPipelineList(repoId: number, opts?: Record<string, string | number | boolean>): Promise<Pipeline[]> { getPipelineList(repoId: number, opts?: PaginationOptions & { before?: string; after?: string }): Promise<Pipeline[]> {
const query = encodeQueryString(opts); const query = encodeQueryString(opts);
return this._get(`/api/repos/${repoId}/pipelines?${query}`) as Promise<Pipeline[]>; return this._get(`/api/repos/${repoId}/pipelines?${query}`) as Promise<Pipeline[]>;
} }
@ -106,9 +113,8 @@ export default class WoodpeckerClient extends ApiClient {
return this._get(`/api/repos/${repoId}/pipelines/${pipelineNumber}/config`) as Promise<PipelineConfig[]>; return this._get(`/api/repos/${repoId}/pipelines/${pipelineNumber}/config`) as Promise<PipelineConfig[]>;
} }
getPipelineFeed(opts?: Record<string, string | number | boolean>): Promise<PipelineFeed[]> { getPipelineFeed(): Promise<PipelineFeed[]> {
const query = encodeQueryString(opts); return this._get(`/api/user/feed`) as Promise<PipelineFeed[]>;
return this._get(`/api/user/feed?${query}`) as Promise<PipelineFeed[]>;
} }
cancelPipeline(repoId: number, pipelineNumber: number): Promise<unknown> { cancelPipeline(repoId: number, pipelineNumber: number): Promise<unknown> {
@ -126,7 +132,7 @@ export default class WoodpeckerClient extends ApiClient {
restartPipeline( restartPipeline(
repoId: number, repoId: number,
pipeline: string, pipeline: string,
opts?: Record<string, string | number | boolean>, opts?: { event?: string; deploy_to?: string; fork?: boolean },
): Promise<Pipeline> { ): Promise<Pipeline> {
const query = encodeQueryString(opts); const query = encodeQueryString(opts);
return this._post(`/api/repos/${repoId}/pipelines/${pipeline}?${query}`) as Promise<Pipeline>; return this._post(`/api/repos/${repoId}/pipelines/${pipeline}?${query}`) as Promise<Pipeline>;
@ -140,8 +146,9 @@ export default class WoodpeckerClient extends ApiClient {
return this._delete(`/api/repos/${repoId}/logs/${pipeline}/${step}`); return this._delete(`/api/repos/${repoId}/logs/${pipeline}/${step}`);
} }
getSecretList(repoId: number, page: number): Promise<Secret[] | null> { getSecretList(repoId: number, opts?: PaginationOptions): Promise<Secret[] | null> {
return this._get(`/api/repos/${repoId}/secrets?page=${page}`) as Promise<Secret[] | null>; const query = encodeQueryString(opts);
return this._get(`/api/repos/${repoId}/secrets?${query}`) as Promise<Secret[] | null>;
} }
createSecret(repoId: number, secret: Partial<Secret>): Promise<unknown> { createSecret(repoId: number, secret: Partial<Secret>): Promise<unknown> {
@ -158,8 +165,9 @@ export default class WoodpeckerClient extends ApiClient {
return this._delete(`/api/repos/${repoId}/secrets/${name}`); return this._delete(`/api/repos/${repoId}/secrets/${name}`);
} }
getRegistryList(repoId: number, page: number): Promise<Registry[] | null> { getRegistryList(repoId: number, opts?: PaginationOptions): Promise<Registry[] | null> {
return this._get(`/api/repos/${repoId}/registry?page=${page}`) as Promise<Registry[] | null>; const query = encodeQueryString(opts);
return this._get(`/api/repos/${repoId}/registry?${query}`) as Promise<Registry[] | null>;
} }
createRegistry(repoId: number, registry: Partial<Registry>): Promise<unknown> { createRegistry(repoId: number, registry: Partial<Registry>): Promise<unknown> {
@ -174,8 +182,9 @@ export default class WoodpeckerClient extends ApiClient {
return this._delete(`/api/repos/${repoId}/registry/${registryAddress}`); return this._delete(`/api/repos/${repoId}/registry/${registryAddress}`);
} }
getCronList(repoId: number, page: number): Promise<Cron[] | null> { getCronList(repoId: number, opts?: PaginationOptions): Promise<Cron[] | null> {
return this._get(`/api/repos/${repoId}/cron?page=${page}`) as Promise<Cron[] | null>; const query = encodeQueryString(opts);
return this._get(`/api/repos/${repoId}/cron?${query}`) as Promise<Cron[] | null>;
} }
createCron(repoId: number, cron: Partial<Cron>): Promise<unknown> { createCron(repoId: number, cron: Partial<Cron>): Promise<unknown> {
@ -206,8 +215,9 @@ export default class WoodpeckerClient extends ApiClient {
return this._get(`/api/orgs/${orgId}/permissions`) as Promise<OrgPermissions>; return this._get(`/api/orgs/${orgId}/permissions`) as Promise<OrgPermissions>;
} }
getOrgSecretList(orgId: number, page: number): Promise<Secret[] | null> { getOrgSecretList(orgId: number, opts?: PaginationOptions): Promise<Secret[] | null> {
return this._get(`/api/orgs/${orgId}/secrets?page=${page}`) as Promise<Secret[] | null>; const query = encodeQueryString(opts);
return this._get(`/api/orgs/${orgId}/secrets?${query}`) as Promise<Secret[] | null>;
} }
createOrgSecret(orgId: number, secret: Partial<Secret>): Promise<unknown> { createOrgSecret(orgId: number, secret: Partial<Secret>): Promise<unknown> {
@ -224,8 +234,9 @@ export default class WoodpeckerClient extends ApiClient {
return this._delete(`/api/orgs/${orgId}/secrets/${name}`); return this._delete(`/api/orgs/${orgId}/secrets/${name}`);
} }
getGlobalSecretList(page: number): Promise<Secret[] | null> { getGlobalSecretList(opts?: PaginationOptions): Promise<Secret[] | null> {
return this._get(`/api/secrets?page=${page}`) as Promise<Secret[] | null>; const query = encodeQueryString(opts);
return this._get(`/api/secrets?${query}`) as Promise<Secret[] | null>;
} }
createGlobalSecret(secret: Partial<Secret>): Promise<unknown> { createGlobalSecret(secret: Partial<Secret>): Promise<unknown> {
@ -250,8 +261,9 @@ export default class WoodpeckerClient extends ApiClient {
return this._post('/api/user/token') as Promise<string>; return this._post('/api/user/token') as Promise<string>;
} }
getAgents(page: number): Promise<Agent[] | null> { getAgents(opts?: PaginationOptions): Promise<Agent[] | null> {
return this._get(`/api/agents?page=${page}`) as Promise<Agent[] | null>; const query = encodeQueryString(opts);
return this._get(`/api/agents?${query}`) as Promise<Agent[] | null>;
} }
getAgent(agentId: Agent['id']): Promise<Agent> { getAgent(agentId: Agent['id']): Promise<Agent> {
@ -282,8 +294,9 @@ export default class WoodpeckerClient extends ApiClient {
return this._post('/api/queue/resume'); return this._post('/api/queue/resume');
} }
getUsers(page: number): Promise<User[] | null> { getUsers(opts?: PaginationOptions): Promise<User[] | null> {
return this._get(`/api/users?page=${page}`) as Promise<User[] | null>; const query = encodeQueryString(opts);
return this._get(`/api/users?${query}`) as Promise<User[] | null>;
} }
getUser(username: string): Promise<User> { getUser(username: string): Promise<User> {
@ -306,16 +319,18 @@ export default class WoodpeckerClient extends ApiClient {
return this._delete('/api/user/token') as Promise<string>; return this._delete('/api/user/token') as Promise<string>;
} }
getOrgs(page: number): Promise<Org[] | null> { getOrgs(opts?: PaginationOptions): Promise<Org[] | null> {
return this._get(`/api/orgs?page=${page}`) as Promise<Org[] | null>; const query = encodeQueryString(opts);
return this._get(`/api/orgs?${query}`) as Promise<Org[] | null>;
} }
deleteOrg(org: Org): Promise<unknown> { deleteOrg(org: Org): Promise<unknown> {
return this._delete(`/api/orgs/${org.id}`); return this._delete(`/api/orgs/${org.id}`);
} }
getAllRepos(page: number): Promise<Repo[] | null> { getAllRepos(opts?: PaginationOptions): Promise<Repo[] | null> {
return this._get(`/api/repos?page=${page}`) as Promise<Repo[] | null>; const query = encodeQueryString(opts);
return this._get(`/api/repos?${query}`) as Promise<Repo[] | null>;
} }
repairAllRepos(): Promise<unknown> { repairAllRepos(): Promise<unknown> {

View file

@ -46,8 +46,8 @@ export const usePipelineStore = defineStore('pipelines', () => {
setPipeline(repoId, pipeline); setPipeline(repoId, pipeline);
} }
async function loadRepoPipelines(repoId: number) { async function loadRepoPipelines(repoId: number, page?: number) {
const _pipelines = await apiClient.getPipelineList(repoId); const _pipelines = await apiClient.getPipelineList(repoId, { page });
_pipelines.forEach((pipeline) => { _pipelines.forEach((pipeline) => {
setPipeline(repoId, pipeline); setPipeline(repoId, pipeline);
}); });

View file

@ -41,7 +41,7 @@ async function loadBranches(page: number): Promise<string[]> {
throw new Error('Unexpected: "repo" should be provided at this place'); throw new Error('Unexpected: "repo" should be provided at this place');
} }
return apiClient.getRepoBranches(repo.value.id, page); return apiClient.getRepoBranches(repo.value.id, { page });
} }
const { resetPage, data: branches, loading } = usePagination(loadBranches); const { resetPage, data: branches, loading } = usePagination(loadBranches);

View file

@ -48,7 +48,7 @@ async function loadPullRequests(page: number): Promise<PullRequest[]> {
throw new Error('Unexpected: "repo" should be provided at this place'); throw new Error('Unexpected: "repo" should be provided at this place');
} }
return apiClient.getRepoPullRequests(repo.value.id, page); return apiClient.getRepoPullRequests(repo.value.id, { page });
} }
const { resetPage, data: pullRequests, loading } = usePagination(loadPullRequests); const { resetPage, data: pullRequests, loading } = usePagination(loadPullRequests);