diff --git a/.gitea/workflows/update_swagger.yaml b/.gitea/workflows/update_swagger.yaml index ab702506..5b82f843 100644 --- a/.gitea/workflows/update_swagger.yaml +++ b/.gitea/workflows/update_swagger.yaml @@ -11,20 +11,8 @@ jobs: steps: - uses: actions/checkout@v6 - run: | - wget https://raw.githubusercontent.com/go-gitea/gitea/refs/heads/main/templates/swagger/v1_json.tmpl - sed -i "$@" 's\"version": "{{AppVer | JSEscape}}"\"version": "dev"\' v1_json.tmpl - sed -i "$@" 's\"basePath": "{{AppSubUrl | JSEscape}}/api/v1"\"basePath": "https://gitea.com/api/v1"\' v1_json.tmpl - mv v1_json.tmpl static/swagger-latest.json + make update-api-docs - for ver in '1.25.1' '1.24.7' '1.23.8' '1.22.6'; do - wget https://raw.githubusercontent.com/go-gitea/gitea/refs/tags/v${ver}/templates/swagger/v1_json.tmpl - sed -i "$@" "s|\"version\": \"{{AppVer \| JSEscape}}\"|\"version\": \"${ver}\"|" v1_json.tmpl - sed -i "$@" 's\"basePath": "{{AppSubUrl | JSEscape}}/api/v1"\"basePath": "https://gitea.com/api/v1"\' v1_json.tmpl - minor=$(echo "$ver" | cut -d '.' -f 2) - mv v1_json.tmpl static/swagger-$minor.json - done - - if ! [[ $(git diff --shortstat) ]]; then exit 0; fi git config --global user.name "Gitea Bot" git config --global user.email "teabot@gitea.io" git remote set-url origin https://x-access-token:${{ secrets.DEPLOY_TOKEN }}@gitea.com/gitea/docs.git diff --git a/Makefile b/Makefile index 97b9ecdf..c9df7053 100644 --- a/Makefile +++ b/Makefile @@ -52,3 +52,7 @@ clean: rm -rf static/swagger-22.json rm -rf static/swagger-23.json rm -rf static/swagger-24.json + +.PHONY: update-api-docs +update-api-docs: + ./update_api_docs.sh diff --git a/static/swagger-22.json b/static/swagger-22.json index 362a8473..2f34bcd8 100644 --- a/static/swagger-22.json +++ b/static/swagger-22.json @@ -19,9 +19,9 @@ "name": "MIT", "url": "http://opensource.org/licenses/MIT" }, - "version": "{{AppVer | JSEscape}}" + "version": "1.22.6" }, - "basePath": "{{AppSubUrl | JSEscape}}/api/v1", + "basePath": "https://gitea.com/api/v1", "paths": { "/activitypub/user-id/{user-id}": { "get": { @@ -3444,107 +3444,125 @@ "operationId": "issueSearchIssues", "parameters": [ { + "enum": [ + "open", + "closed", + "all" + ], "type": "string", - "description": "whether issue is open or closed", + "default": "open", + "description": "State of the issue", "name": "state", "in": "query" }, { "type": "string", - "description": "comma separated list of labels. Fetch only issues that have any of this labels. Non existent labels are discarded", + "description": "Comma-separated list of label names. Fetch only issues that have any of these labels. Non existent labels are discarded.", "name": "labels", "in": "query" }, { "type": "string", - "description": "comma separated list of milestone names. Fetch only issues that have any of this milestones. Non existent are discarded", + "description": "Comma-separated list of milestone names. Fetch only issues that have any of these milestones. Non existent milestones are discarded.", "name": "milestones", "in": "query" }, { "type": "string", - "description": "search string", + "description": "Search string", "name": "q", "in": "query" }, { "type": "integer", "format": "int64", - "description": "repository to prioritize in the results", + "description": "Repository ID to prioritize in the results", "name": "priority_repo_id", "in": "query" }, { + "enum": [ + "issues", + "pulls" + ], "type": "string", - "description": "filter by type (issues / pulls) if set", + "description": "Filter by issue type", "name": "type", "in": "query" }, { "type": "string", "format": "date-time", - "description": "Only show notifications updated after the given time. This is a timestamp in RFC 3339 format", + "description": "Only show issues updated after the given time (RFC 3339 format)", "name": "since", "in": "query" }, { "type": "string", "format": "date-time", - "description": "Only show notifications updated before the given time. This is a timestamp in RFC 3339 format", + "description": "Only show issues updated before the given time (RFC 3339 format)", "name": "before", "in": "query" }, { "type": "boolean", - "description": "filter (issues / pulls) assigned to you, default is false", + "default": false, + "description": "Filter issues or pulls assigned to the authenticated user", "name": "assigned", "in": "query" }, { "type": "boolean", - "description": "filter (issues / pulls) created by you, default is false", + "default": false, + "description": "Filter issues or pulls created by the authenticated user", "name": "created", "in": "query" }, { "type": "boolean", - "description": "filter (issues / pulls) mentioning you, default is false", + "default": false, + "description": "Filter issues or pulls mentioning the authenticated user", "name": "mentioned", "in": "query" }, { "type": "boolean", - "description": "filter pulls requesting your review, default is false", + "default": false, + "description": "Filter pull requests where the authenticated user's review was requested", "name": "review_requested", "in": "query" }, { "type": "boolean", - "description": "filter pulls reviewed by you, default is false", + "default": false, + "description": "Filter pull requests reviewed by the authenticated user", "name": "reviewed", "in": "query" }, { "type": "string", - "description": "filter by owner", + "description": "Filter by repository owner", "name": "owner", "in": "query" }, { "type": "string", - "description": "filter by team (requires organization owner parameter to be provided)", + "description": "Filter by team (requires organization owner parameter)", "name": "team", "in": "query" }, { + "minimum": 1, "type": "integer", - "description": "page number of results to return (1-based)", + "default": 1, + "description": "Page number of results to return (1-based)", "name": "page", "in": "query" }, { + "minimum": 0, "type": "integer", - "description": "page size of results", + "description": "Number of items per page", "name": "limit", "in": "query" } @@ -3552,6 +3570,12 @@ "responses": { "200": { "$ref": "#/responses/IssueList" + }, + "400": { + "$ref": "#/responses/error" + }, + "422": { + "$ref": "#/responses/validationError" } } } @@ -3843,6 +3867,39 @@ } } }, + "/repos/{owner}/{repo}/actions/runners/registration-token": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a repository's actions runner registration token", + "operationId": "repoGetRunnerRegistrationToken", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/RegistrationToken" + } + } + } + }, "/repos/{owner}/{repo}/actions/secrets": { "get": { "produces": [ @@ -5353,7 +5410,7 @@ "tags": [ "repository" ], - "summary": "Get the pull request of the commit", + "summary": "Get the merged pull request of the commit", "operationId": "repoGetCommitPullRequest", "parameters": [ { @@ -7418,6 +7475,9 @@ "404": { "$ref": "#/responses/error" }, + "422": { + "$ref": "#/responses/validationError" + }, "423": { "$ref": "#/responses/repoArchivedError" } @@ -8037,6 +8097,9 @@ "404": { "$ref": "#/responses/error" }, + "422": { + "$ref": "#/responses/validationError" + }, "423": { "$ref": "#/responses/repoArchivedError" } @@ -12765,6 +12828,9 @@ }, "409": { "$ref": "#/responses/error" + }, + "422": { + "$ref": "#/responses/validationError" } } } @@ -12883,8 +12949,8 @@ "404": { "$ref": "#/responses/notFound" }, - "405": { - "$ref": "#/responses/empty" + "422": { + "$ref": "#/responses/validationError" } } } @@ -12969,8 +13035,8 @@ "404": { "$ref": "#/responses/notFound" }, - "405": { - "$ref": "#/responses/empty" + "422": { + "$ref": "#/responses/validationError" } } }, @@ -13330,39 +13396,6 @@ } } }, - "/repos/{owner}/{repo}/runners/registration-token": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "repository" - ], - "summary": "Get a repository's actions runner registration token", - "operationId": "repoGetRunnerRegistrationToken", - "parameters": [ - { - "type": "string", - "description": "owner of the repo", - "name": "owner", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "name of the repo", - "name": "repo", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "$ref": "#/responses/RegistrationToken" - } - } - } - }, "/repos/{owner}/{repo}/signing-key.gpg": { "get": { "produces": [ @@ -13820,6 +13853,9 @@ "409": { "$ref": "#/responses/conflict" }, + "422": { + "$ref": "#/responses/validationError" + }, "423": { "$ref": "#/responses/repoArchivedError" } @@ -13913,6 +13949,9 @@ "409": { "$ref": "#/responses/conflict" }, + "422": { + "$ref": "#/responses/validationError" + }, "423": { "$ref": "#/responses/repoArchivedError" } @@ -20595,7 +20634,7 @@ "x-go-name": "Description" }, "enable_prune": { - "description": "enable prune - remove obsolete remote-tracking references", + "description": "enable prune - remove obsolete remote-tracking references when mirroring", "type": "boolean", "x-go-name": "EnablePrune" }, @@ -21748,12 +21787,9 @@ "type": "object", "properties": { "labels": { - "description": "list of label IDs", + "description": "Labels can be a list of integers representing label IDs\nor a list of strings representing label names", "type": "array", - "items": { - "type": "integer", - "format": "int64" - }, + "items": {}, "x-go-name": "Labels" } }, @@ -21942,7 +21978,7 @@ "type": "object", "properties": { "Context": { - "description": "Context to render\n\nin: body", + "description": "URL path for rendering issue, media and file links\nExpected format: /subpath/{user}/{repo}/src/{branch, commit, tag}/{identifier/path}/{file/dir}\n\nin: body", "type": "string" }, "Mode": { @@ -21965,7 +22001,7 @@ "type": "object", "properties": { "Context": { - "description": "Context to render\n\nin: body", + "description": "URL path for rendering issue, media and file links\nExpected format: /subpath/{user}/{repo}/src/{branch, commit, tag}/{identifier/path}/{file/dir}\n\nin: body", "type": "string" }, "FilePath": { @@ -22820,6 +22856,11 @@ "description": "PullRequest represents a pull request", "type": "object", "properties": { + "additions": { + "type": "integer", + "format": "int64", + "x-go-name": "Additions" + }, "allow_maintainer_edit": { "type": "boolean", "x-go-name": "AllowMaintainerEdit" @@ -22841,6 +22882,11 @@ "type": "string", "x-go-name": "Body" }, + "changed_files": { + "type": "integer", + "format": "int64", + "x-go-name": "ChangedFiles" + }, "closed_at": { "type": "string", "format": "date-time", @@ -22856,10 +22902,19 @@ "format": "date-time", "x-go-name": "Created" }, + "deletions": { + "type": "integer", + "format": "int64", + "x-go-name": "Deletions" + }, "diff_url": { "type": "string", "x-go-name": "DiffURL" }, + "draft": { + "type": "boolean", + "x-go-name": "Draft" + }, "due_date": { "type": "string", "format": "date-time", @@ -22936,6 +22991,12 @@ }, "x-go-name": "RequestedReviewers" }, + "review_comments": { + "description": "number of review comments made on the diff of a PR review (not including comments on commits or issues in a PR)", + "type": "integer", + "format": "int64", + "x-go-name": "ReviewComments" + }, "state": { "$ref": "#/definitions/StateType" }, @@ -22966,6 +23027,10 @@ "type": "boolean", "x-go-name": "IsWorkInProgress" }, + "html_url": { + "type": "string", + "x-go-name": "HTMLURL" + }, "merged": { "type": "boolean", "x-go-name": "HasMerged" @@ -24259,6 +24324,11 @@ "type": "string", "x-go-name": "FullName" }, + "html_url": { + "description": "URL to the user's gitea page", + "type": "string", + "x-go-name": "HTMLURL" + }, "id": { "description": "the user's id", "type": "integer", diff --git a/static/swagger-23.json b/static/swagger-23.json index fb37d45c..e716f75f 100644 --- a/static/swagger-23.json +++ b/static/swagger-23.json @@ -19,9 +19,9 @@ "name": "MIT", "url": "http://opensource.org/licenses/MIT" }, - "version": "{{AppVer | JSEscape}}" + "version": "1.23.8" }, - "basePath": "{{AppSubUrl | JSEscape}}/api/v1", + "basePath": "https://gitea.com/api/v1", "paths": { "/activitypub/user-id/{user-id}": { "get": { @@ -19616,7 +19616,18 @@ "items": { "type": "string" }, - "x-go-name": "Scopes" + "x-go-name": "Scopes", + "example": [ + "all", + "read:activitypub", + "read:issue", + "write:misc", + "read:notification", + "read:organization", + "read:package", + "read:repository", + "read:user" + ] } }, "x-go-package": "code.gitea.io/gitea/modules/structs" diff --git a/static/swagger-24.json b/static/swagger-24.json index 8082fc59..d5cfcabf 100644 --- a/static/swagger-24.json +++ b/static/swagger-24.json @@ -19,9 +19,9 @@ "name": "MIT", "url": "http://opensource.org/licenses/MIT" }, - "version": "{{AppVer | JSEscape}}" + "version": "1.24.7" }, - "basePath": "{{AppSubUrl | JSEscape}}/api/v1", + "basePath": "https://gitea.com/api/v1", "paths": { "/activitypub/user-id/{user-id}": { "get": { @@ -75,6 +75,108 @@ } } }, + "/admin/actions/runners": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Get all runners", + "operationId": "getAdminRunners", + "responses": { + "200": { + "$ref": "#/definitions/ActionRunnersResponse" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/admin/actions/runners/registration-token": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Get an global actions runner registration token", + "operationId": "adminCreateRunnerRegistrationToken", + "responses": { + "200": { + "$ref": "#/responses/RegistrationToken" + } + } + } + }, + "/admin/actions/runners/{runner_id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Get an global runner", + "operationId": "getAdminRunner", + "parameters": [ + { + "type": "string", + "description": "id of the runner", + "name": "runner_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/definitions/ActionRunner" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Delete an global runner", + "operationId": "deleteAdminRunner", + "parameters": [ + { + "type": "string", + "description": "id of the runner", + "name": "runner_id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "runner has been deleted" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, "/admin/cron": { "get": { "produces": [ @@ -1697,6 +1799,38 @@ } } }, + "/orgs/{org}/actions/runners": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Get org-level runners", + "operationId": "getOrgRunners", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/definitions/ActionRunnersResponse" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, "/orgs/{org}/actions/runners/registration-token": { "get": { "produces": [ @@ -1721,6 +1855,106 @@ "$ref": "#/responses/RegistrationToken" } } + }, + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Get an organization's actions runner registration token", + "operationId": "orgCreateRunnerRegistrationToken", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/RegistrationToken" + } + } + } + }, + "/orgs/{org}/actions/runners/{runner_id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Get an org-level runner", + "operationId": "getOrgRunner", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "id of the runner", + "name": "runner_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/definitions/ActionRunner" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Delete an org-level runner", + "operationId": "deleteOrgRunner", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "id of the runner", + "name": "runner_id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "runner has been deleted" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } } }, "/orgs/{org}/actions/secrets": { @@ -2991,6 +3225,46 @@ } } }, + "/orgs/{org}/rename": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Rename an organization", + "operationId": "renameOrg", + "parameters": [ + { + "type": "string", + "description": "existing org name", + "name": "org", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RenameOrgOption" + } + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, "/orgs/{org}/repos": { "get": { "produces": [ @@ -3299,6 +3573,191 @@ } } }, + "/packages/{owner}/{type}/{name}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "package" + ], + "summary": "Gets all versions of a package", + "operationId": "listPackageVersions", + "parameters": [ + { + "type": "string", + "description": "owner of the package", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "type of the package", + "name": "type", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the package", + "name": "name", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/PackageList" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/packages/{owner}/{type}/{name}/-/latest": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "package" + ], + "summary": "Gets the latest version of a package", + "operationId": "getLatestPackageVersion", + "parameters": [ + { + "type": "string", + "description": "owner of the package", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "type of the package", + "name": "type", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the package", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Package" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/packages/{owner}/{type}/{name}/-/link/{repo_name}": { + "post": { + "tags": [ + "package" + ], + "summary": "Link a package to a repository", + "operationId": "linkPackage", + "parameters": [ + { + "type": "string", + "description": "owner of the package", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "type of the package", + "name": "type", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the package", + "name": "name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repository to link.", + "name": "repo_name", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "$ref": "#/responses/empty" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/packages/{owner}/{type}/{name}/-/unlink": { + "post": { + "tags": [ + "package" + ], + "summary": "Unlink a package from a repository", + "operationId": "unlinkPackage", + "parameters": [ + { + "type": "string", + "description": "owner of the package", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "type of the package", + "name": "type", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the package", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "$ref": "#/responses/empty" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, "/packages/{owner}/{type}/{name}/{version}": { "get": { "produces": [ @@ -3879,6 +4338,272 @@ } } }, + "/repos/{owner}/{repo}/actions/artifacts": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Lists all artifacts for a repository", + "operationId": "getArtifacts", + "parameters": [ + { + "type": "string", + "description": "name of the owner", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repository", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the artifact", + "name": "name", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/ArtifactsList" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/actions/artifacts/{artifact_id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Gets a specific artifact for a workflow run", + "operationId": "getArtifact", + "parameters": [ + { + "type": "string", + "description": "name of the owner", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repository", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "id of the artifact", + "name": "artifact_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Artifact" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Deletes a specific artifact for a workflow run", + "operationId": "deleteArtifact", + "parameters": [ + { + "type": "string", + "description": "name of the owner", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repository", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "id of the artifact", + "name": "artifact_id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/zip": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Downloads a specific artifact for a workflow run redirects to blob url", + "operationId": "downloadArtifact", + "parameters": [ + { + "type": "string", + "description": "name of the owner", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repository", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "id of the artifact", + "name": "artifact_id", + "in": "path", + "required": true + } + ], + "responses": { + "302": { + "description": "redirect to the blob download" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/actions/jobs/{job_id}/logs": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Downloads the job logs for a workflow run", + "operationId": "downloadActionsRunJobLogs", + "parameters": [ + { + "type": "string", + "description": "name of the owner", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repository", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "id of the job", + "name": "job_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "output blob content" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/actions/runners": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get repo-level runners", + "operationId": "getRepoRunners", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/definitions/ActionRunnersResponse" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, "/repos/{owner}/{repo}/actions/runners/registration-token": { "get": { "produces": [ @@ -3910,6 +4635,179 @@ "$ref": "#/responses/RegistrationToken" } } + }, + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a repository's actions runner registration token", + "operationId": "repoCreateRunnerRegistrationToken", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/RegistrationToken" + } + } + } + }, + "/repos/{owner}/{repo}/actions/runners/{runner_id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get an repo-level runner", + "operationId": "getRepoRunner", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "id of the runner", + "name": "runner_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/definitions/ActionRunner" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Delete an repo-level runner", + "operationId": "deleteRepoRunner", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "id of the runner", + "name": "runner_id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "runner has been deleted" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/actions/runs/{run}/artifacts": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Lists all artifacts for a repository run", + "operationId": "getArtifactsOfRun", + "parameters": [ + { + "type": "string", + "description": "name of the owner", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repository", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "runid of the workflow run", + "name": "run", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the artifact", + "name": "name", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/ArtifactsList" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } } }, "/repos/{owner}/{repo}/actions/secrets": { @@ -4055,7 +4953,7 @@ ], "responses": { "204": { - "description": "delete one secret of the organization" + "description": "delete one secret of the repository" }, "400": { "$ref": "#/responses/error" @@ -4381,6 +5279,275 @@ } } }, + "/repos/{owner}/{repo}/actions/workflows": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "List repository workflows", + "operationId": "ActionsListRepositoryWorkflows", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/ActionWorkflowList" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/validationError" + }, + "500": { + "$ref": "#/responses/error" + } + } + } + }, + "/repos/{owner}/{repo}/actions/workflows/{workflow_id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a workflow", + "operationId": "ActionsGetWorkflow", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "id of the workflow", + "name": "workflow_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/ActionWorkflow" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/validationError" + }, + "500": { + "$ref": "#/responses/error" + } + } + } + }, + "/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable": { + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Disable a workflow", + "operationId": "ActionsDisableWorkflow", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "id of the workflow", + "name": "workflow_id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Create a workflow dispatch event", + "operationId": "ActionsDispatchWorkflow", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "id of the workflow", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateActionWorkflowDispatch" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable": { + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Enable a workflow", + "operationId": "ActionsEnableWorkflow", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "id of the workflow", + "name": "workflow_id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "409": { + "$ref": "#/responses/conflict" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, "/repos/{owner}/{repo}/activities/feeds": { "get": { "produces": [ @@ -5696,7 +6863,7 @@ }, { "type": "string", - "description": "The name of the commit/branch/tag. Default the repository’s default branch (usually master)", + "description": "The name of the commit/branch/tag. Default to the repository’s default branch.", "name": "ref", "in": "query" } @@ -5799,7 +6966,7 @@ }, { "type": "string", - "description": "The name of the commit/branch/tag. Default the repository’s default branch (usually master)", + "description": "The name of the commit/branch/tag. Default to the repository’s default branch.", "name": "ref", "in": "query" } @@ -6081,7 +7248,7 @@ }, { "type": "string", - "description": "The name of the commit/branch/tag. Default the repository’s default branch (usually master)", + "description": "The name of the commit/branch/tag. Default to the repository’s default branch.", "name": "ref", "in": "query" } @@ -6096,6 +7263,105 @@ } } }, + "/repos/{owner}/{repo}/file-contents": { + "get": { + "description": "See the POST method. This GET method supports to use JSON encoded request body in query parameter.", + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get the metadata and contents of requested files", + "operationId": "repoGetFileContents", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The name of the commit/branch/tag. Default to the repository’s default branch.", + "name": "ref", + "in": "query" + }, + { + "type": "string", + "description": "The JSON encoded body (see the POST request): {\"files\": [\"filename1\", \"filename2\"]}", + "name": "body", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/ContentsListResponse" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "post": { + "description": "Uses automatic pagination based on default page size and max response size and returns the maximum allowed number of files. Files which could not be retrieved are null. Files which are too large are being returned with `encoding == null`, `content == null` and `size \u003e 0`, they can be requested separately by using the `download_url`.", + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get the metadata and contents of requested files", + "operationId": "repoGetFileContentsPost", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The name of the commit/branch/tag. Default to the repository’s default branch.", + "name": "ref", + "in": "query" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/GetFilesOptions" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/ContentsListResponse" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, "/repos/{owner}/{repo}/forks": { "get": { "produces": [ @@ -9317,6 +10583,111 @@ } } }, + "/repos/{owner}/{repo}/issues/{index}/lock": { + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Lock an issue", + "operationId": "issueLockIssue", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/LockIssueOption" + } + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Unlock an issue", + "operationId": "issueUnlockIssue", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, "/repos/{owner}/{repo}/issues/{index}/pin": { "post": { "tags": [ @@ -11418,6 +12789,12 @@ "in": "path", "required": true }, + { + "type": "string", + "description": "Filter by target base branch of the pull request", + "name": "base_branch", + "in": "query" + }, { "enum": [ "open", @@ -11434,6 +12811,7 @@ "enum": [ "oldest", "recentupdate", + "recentclose", "leastupdate", "mostcomment", "leastcomment", @@ -13768,6 +15146,9 @@ "200": { "$ref": "#/responses/UserList" }, + "403": { + "$ref": "#/responses/forbidden" + }, "404": { "$ref": "#/responses/notFound" } @@ -16087,6 +17468,29 @@ } } }, + "/user/actions/runners": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get user-level runners", + "operationId": "getUserRunners", + "responses": { + "200": { + "$ref": "#/definitions/ActionRunnersResponse" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, "/user/actions/runners/registration-token": { "get": { "produces": [ @@ -16102,6 +17506,83 @@ "$ref": "#/responses/RegistrationToken" } } + }, + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get an user's actions runner registration token", + "operationId": "userCreateRunnerRegistrationToken", + "responses": { + "200": { + "$ref": "#/responses/RegistrationToken" + } + } + } + }, + "/user/actions/runners/{runner_id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get an user-level runner", + "operationId": "getUserRunner", + "parameters": [ + { + "type": "string", + "description": "id of the runner", + "name": "runner_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/definitions/ActionRunner" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Delete an user-level runner", + "operationId": "deleteUserRunner", + "parameters": [ + { + "type": "string", + "description": "id of the runner", + "name": "runner_id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "runner has been deleted" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } } }, "/user/actions/secrets/{secretname}": { @@ -17506,6 +18987,9 @@ "responses": { "200": { "$ref": "#/responses/RepositoryList" + }, + "403": { + "$ref": "#/responses/forbidden" } } } @@ -17537,6 +19021,9 @@ "204": { "$ref": "#/responses/empty" }, + "403": { + "$ref": "#/responses/forbidden" + }, "404": { "$ref": "#/responses/notFound" } @@ -17602,6 +19089,9 @@ "204": { "$ref": "#/responses/empty" }, + "403": { + "$ref": "#/responses/forbidden" + }, "404": { "$ref": "#/responses/notFound" } @@ -18278,6 +19768,9 @@ "200": { "$ref": "#/responses/RepositoryList" }, + "403": { + "$ref": "#/responses/forbidden" + }, "404": { "$ref": "#/responses/notFound" } @@ -18486,11 +19979,21 @@ "type": "object", "title": "AccessToken represents an API access token.", "properties": { + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, "id": { "type": "integer", "format": "int64", "x-go-name": "ID" }, + "last_used_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, "name": { "type": "string", "x-go-name": "Name" @@ -18513,6 +20016,150 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, + "ActionArtifact": { + "description": "ActionArtifact represents a ActionArtifact", + "type": "object", + "properties": { + "archive_download_url": { + "type": "string", + "x-go-name": "ArchiveDownloadURL" + }, + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "CreatedAt" + }, + "expired": { + "type": "boolean", + "x-go-name": "Expired" + }, + "expires_at": { + "type": "string", + "format": "date-time", + "x-go-name": "ExpiresAt" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "size_in_bytes": { + "type": "integer", + "format": "int64", + "x-go-name": "SizeInBytes" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "x-go-name": "UpdatedAt" + }, + "url": { + "type": "string", + "x-go-name": "URL" + }, + "workflow_run": { + "$ref": "#/definitions/ActionWorkflowRun" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "ActionArtifactsResponse": { + "description": "ActionArtifactsResponse returns ActionArtifacts", + "type": "object", + "properties": { + "artifacts": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionArtifact" + }, + "x-go-name": "Entries" + }, + "total_count": { + "type": "integer", + "format": "int64", + "x-go-name": "TotalCount" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "ActionRunner": { + "description": "ActionRunner represents a Runner", + "type": "object", + "properties": { + "busy": { + "type": "boolean", + "x-go-name": "Busy" + }, + "ephemeral": { + "type": "boolean", + "x-go-name": "Ephemeral" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "labels": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionRunnerLabel" + }, + "x-go-name": "Labels" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "status": { + "type": "string", + "x-go-name": "Status" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "ActionRunnerLabel": { + "description": "ActionRunnerLabel represents a Runner Label", + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "type": { + "type": "string", + "x-go-name": "Type" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "ActionRunnersResponse": { + "description": "ActionRunnersResponse returns Runners", + "type": "object", + "properties": { + "runners": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionRunner" + }, + "x-go-name": "Entries" + }, + "total_count": { + "type": "integer", + "format": "int64", + "x-go-name": "TotalCount" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "ActionTask": { "description": "ActionTask represents a ActionTask", "type": "object", @@ -18605,6 +20252,11 @@ "type": "string", "x-go-name": "Data" }, + "description": { + "description": "the description of the variable", + "type": "string", + "x-go-name": "Description" + }, "name": { "description": "the name of the variable", "type": "string", @@ -18625,6 +20277,96 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, + "ActionWorkflow": { + "description": "ActionWorkflow represents a ActionWorkflow", + "type": "object", + "properties": { + "badge_url": { + "type": "string", + "x-go-name": "BadgeURL" + }, + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "CreatedAt" + }, + "deleted_at": { + "type": "string", + "format": "date-time", + "x-go-name": "DeletedAt" + }, + "html_url": { + "type": "string", + "x-go-name": "HTMLURL" + }, + "id": { + "type": "string", + "x-go-name": "ID" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "path": { + "type": "string", + "x-go-name": "Path" + }, + "state": { + "type": "string", + "x-go-name": "State" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "x-go-name": "UpdatedAt" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "ActionWorkflowResponse": { + "description": "ActionWorkflowResponse returns a ActionWorkflow", + "type": "object", + "properties": { + "total_count": { + "type": "integer", + "format": "int64", + "x-go-name": "TotalCount" + }, + "workflows": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionWorkflow" + }, + "x-go-name": "Workflows" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "ActionWorkflowRun": { + "description": "ActionWorkflowRun represents a WorkflowRun", + "type": "object", + "properties": { + "head_sha": { + "type": "string", + "x-go-name": "HeadSha" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "repository_id": { + "type": "integer", + "format": "int64", + "x-go-name": "RepositoryID" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "Activity": { "type": "object", "properties": { @@ -19569,10 +21311,20 @@ "type": "string", "x-go-name": "HTMLURL" }, + "last_author_date": { + "type": "string", + "format": "date-time", + "x-go-name": "LastAuthorDate" + }, "last_commit_sha": { "type": "string", "x-go-name": "LastCommitSHA" }, + "last_committer_date": { + "type": "string", + "format": "date-time", + "x-go-name": "LastCommitterDate" + }, "name": { "type": "string", "x-go-name": "Name" @@ -19628,7 +21380,40 @@ "items": { "type": "string" }, - "x-go-name": "Scopes" + "x-go-name": "Scopes", + "example": [ + "all", + "read:activitypub", + "read:issue", + "write:misc", + "read:notification", + "read:organization", + "read:package", + "read:repository", + "read:user" + ] + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateActionWorkflowDispatch": { + "description": "CreateActionWorkflowDispatch represents the payload for triggering a workflow dispatch event", + "type": "object", + "required": [ + "ref" + ], + "properties": { + "inputs": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "Inputs" + }, + "ref": { + "type": "string", + "x-go-name": "Ref", + "example": "refs/heads/main" } }, "x-go-package": "code.gitea.io/gitea/modules/structs" @@ -20175,6 +21960,11 @@ "description": "Data of the secret to update", "type": "string", "x-go-name": "Data" + }, + "description": { + "description": "Description of the secret to update", + "type": "string", + "x-go-name": "Description" } }, "x-go-package": "code.gitea.io/gitea/modules/structs" @@ -20685,6 +22475,11 @@ "value" ], "properties": { + "description": { + "description": "Description of the variable to create", + "type": "string", + "x-go-name": "Description" + }, "value": { "description": "Value of the variable to create", "type": "string", @@ -21968,6 +23763,11 @@ "format": "int64", "x-go-name": "DefaultMaxBlobSize" }, + "default_max_response_size": { + "type": "integer", + "format": "int64", + "x-go-name": "DefaultMaxResponseSize" + }, "default_paging_num": { "type": "integer", "format": "int64", @@ -22134,6 +23934,20 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, + "GetFilesOptions": { + "description": "GetFilesOptions options for retrieving metadate and content of multiple files", + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Files" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "GitBlobResponse": { "description": "GitBlobResponse represents a git blob", "type": "object", @@ -22788,6 +24602,17 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, + "LockIssueOption": { + "description": "LockIssueOption options to lock an issue", + "type": "object", + "properties": { + "lock_reason": { + "type": "string", + "x-go-name": "Reason" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "MarkdownOption": { "description": "MarkdownOption markdown options", "type": "object", @@ -23000,7 +24825,8 @@ "gogs", "onedev", "gitbucket", - "codebase" + "codebase", + "codecommit" ], "x-go-name": "Service" }, @@ -23502,10 +25328,6 @@ "description": "PackageFile represents a package file", "type": "object", "properties": { - "Size": { - "type": "integer", - "format": "int64" - }, "id": { "type": "integer", "format": "int64", @@ -23530,6 +25352,11 @@ "sha512": { "type": "string", "x-go-name": "HashSHA512" + }, + "size": { + "type": "integer", + "format": "int64", + "x-go-name": "Size" } }, "x-go-package": "code.gitea.io/gitea/modules/structs" @@ -23681,6 +25508,11 @@ "type": "string", "x-go-name": "KeyType" }, + "last_used_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, "read_only": { "type": "boolean", "x-go-name": "ReadOnly" @@ -24207,6 +26039,22 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, + "RenameOrgOption": { + "description": "RenameOrgOption options when renaming an organization", + "type": "object", + "required": [ + "new_name" + ], + "properties": { + "new_name": { + "description": "New username for this org. This name cannot be in use yet by any other user.", + "type": "string", + "uniqueItems": true, + "x-go-name": "NewName" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "RenameUserOption": { "description": "RenameUserOption options when renaming a user", "type": "object", @@ -24630,6 +26478,11 @@ "format": "date-time", "x-go-name": "Created" }, + "description": { + "description": "the secret's description", + "type": "string", + "x-go-name": "Description" + }, "name": { "description": "the secret's name", "type": "string", @@ -25205,6 +27058,11 @@ "value" ], "properties": { + "description": { + "description": "Description of the variable to update", + "type": "string", + "x-go-name": "Description" + }, "name": { "description": "New name for the variable. If the field is empty, the variable name won't be updated.", "type": "string", @@ -25616,6 +27474,18 @@ "$ref": "#/definitions/ActionVariable" } }, + "ActionWorkflow": { + "description": "ActionWorkflow", + "schema": { + "$ref": "#/definitions/ActionWorkflow" + } + }, + "ActionWorkflowList": { + "description": "ActionWorkflowList", + "schema": { + "$ref": "#/definitions/ActionWorkflowResponse" + } + }, "ActivityFeedsList": { "description": "ActivityFeedsList", "schema": { @@ -25637,6 +27507,18 @@ "$ref": "#/definitions/AnnotatedTag" } }, + "Artifact": { + "description": "Artifact", + "schema": { + "$ref": "#/definitions/ActionArtifact" + } + }, + "ArtifactsList": { + "description": "ArtifactsList", + "schema": { + "$ref": "#/definitions/ActionArtifactsResponse" + } + }, "Attachment": { "description": "Attachment", "schema": { @@ -26373,6 +28255,18 @@ } } }, + "Runner": { + "description": "Runner", + "schema": { + "$ref": "#/definitions/ActionRunner" + } + }, + "RunnerList": { + "description": "RunnerList", + "schema": { + "$ref": "#/definitions/ActionRunnersResponse" + } + }, "SearchResults": { "description": "SearchResults", "schema": { @@ -26631,7 +28525,7 @@ "parameterBodies": { "description": "parameterBodies", "schema": { - "$ref": "#/definitions/UpdateVariableOption" + "$ref": "#/definitions/LockIssueOption" } }, "redirect": { @@ -26730,4 +28624,4 @@ "TOTPHeader": [] } ] -} +} \ No newline at end of file diff --git a/static/swagger-25.json b/static/swagger-25.json index ef0d607e..6e1e8b46 100644 --- a/static/swagger-25.json +++ b/static/swagger-25.json @@ -19,9 +19,9 @@ "name": "MIT", "url": "http://opensource.org/licenses/MIT" }, - "version": "{{.SwaggerAppVer}}" + "version": "1.25.1" }, - "basePath": "{{.SwaggerAppSubUrl}}/api/v1", + "basePath": "https://gitea.com/api/v1", "paths": { "/activitypub/user-id/{user-id}": { "get": { diff --git a/static/swagger-latest.json b/static/swagger-latest.json index 0cefa679..7a93188e 100644 --- a/static/swagger-latest.json +++ b/static/swagger-latest.json @@ -19,9 +19,9 @@ "name": "MIT", "url": "http://opensource.org/licenses/MIT" }, - "version": "{{.SwaggerAppVer}}" + "version": "dev" }, - "basePath": "{{.SwaggerAppSubUrl}}/api/v1", + "basePath": "https://gitea.com/api/v1", "paths": { "/activitypub/user-id/{user-id}": { "get": { diff --git a/update_api_docs.sh b/update_api_docs.sh new file mode 100755 index 00000000..9a19b80f --- /dev/null +++ b/update_api_docs.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +curl --silent --output v1_json.tmpl https://raw.githubusercontent.com/go-gitea/gitea/refs/heads/main/templates/swagger/v1_json.tmpl +sed -i "$@" 's|"version": "{{.SwaggerAppVer}}"|"version": "dev"|' v1_json.tmpl +sed -i "$@" 's|"basePath": "{{.SwaggerAppSubUrl}}/api/v1"|"basePath": "https://gitea.com/api/v1"|' v1_json.tmpl +mv v1_json.tmpl static/swagger-latest.json + +for ver in '1.25.1' '1.24.7' '1.23.8' '1.22.6'; do + curl --silent --output v1_json.tmpl https://raw.githubusercontent.com/go-gitea/gitea/refs/tags/v${ver}/templates/swagger/v1_json.tmpl + sed -i "$@" "s|\"version\": \"{{.SwaggerAppVer}}\"|\"version\": \"${ver}\"|" v1_json.tmpl + sed -i "$@" 's|"basePath": "{{.SwaggerAppSubUrl}}/api/v1"|"basePath": "https://gitea.com/api/v1"|' v1_json.tmpl + # for versions < 1.24 + sed -i "$@" "s|\"version\": \"{{AppVer \| JSEscape}}\"|\"version\": \"${ver}\"|" v1_json.tmpl + sed -i "$@" 's\"basePath": "{{AppSubUrl | JSEscape}}/api/v1"\"basePath": "https://gitea.com/api/v1"\' v1_json.tmpl + minor=$(echo "$ver" | cut -d '.' -f 2) + mv v1_json.tmpl static/swagger-$minor.json +done