From 03d596c7eb61b029f2357b49f6f8acf019da9057 Mon Sep 17 00:00:00 2001 From: dzikoysk Date: Fri, 22 Nov 2024 18:33:11 +0100 Subject: [PATCH] GH-2233 Update schema in the endpoints guide (Resolve #2233) --- .../data/guides/developers/endpoints.md | 1656 ++++++++++------- 1 file changed, 958 insertions(+), 698 deletions(-) diff --git a/reposilite-site/data/guides/developers/endpoints.md b/reposilite-site/data/guides/developers/endpoints.md index 30e6769fb..ca798a10c 100644 --- a/reposilite-site/data/guides/developers/endpoints.md +++ b/reposilite-site/data/guides/developers/endpoints.md @@ -15,30 +15,17 @@ Raw JSON scheme: "openapi": "3.0.3", "info": { "title": "Reposilite Repository", - "description": "Public Maven repository hosted through the Reposilite", - "version": "3.0.2" + "version": "3.5.19-SNAPSHOT", + "description": "Official public Maven repository powered by Reposilite 💜" }, "paths": { - "/api/console/sock": { - "patch": { - "tags": [], - "parameters": [], - "requestBody": { - "content": {}, - "required": false - }, - "responses": {}, - "deprecated": false, - "security": [] - } - }, - "/api/console/execute": { - "post": { + "/api/auth/me": { + "get": { "tags": [ - "Cli" + "Auth" ], - "summary": "Remote command execution", - "description": "Execute command using POST request. The commands are the same as in the console and can be listed using the \u0027help\u0027 command.", + "summary": "Get token details", + "description": "Returns details about the requested token", "parameters": [ { "name": "Authorization", @@ -48,38 +35,23 @@ Raw JSON scheme: "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } } ], - "requestBody": { - "content": {}, - "required": false - }, "responses": { "200": { - "description": "Status of the executed command", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ExecutionResponse" - } - } - } - }, - "400": { - "description": "Error message related to the invalid command format (0 \u003c command length \u003c 1024)", + "description": "Details about the token for succeeded authentication", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "$ref": "#/components/schemas/SessionDetails" } } } }, "401": { - "description": "Error message related to the unauthorized access", + "description": "Error message related to the unauthorized access in case of any failure", "content": { "application/json": { "schema": { @@ -93,66 +65,74 @@ Raw JSON scheme: "security": [] } }, - "/api/statistics/resolved/phrase/{limit}/{repository}/*": { + "/api/badge/latest/{repository}/{gav}": { "get": { "tags": [ - "Statistics" + "Maven", + "Badge" ], "parameters": [ { - "name": "limit", + "name": "repository", "in": "path", - "description": "Amount of records to find (Maximum: 100", + "description": "Artifact's repository", "required": true, "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } }, { - "name": "repository", + "name": "gav", "in": "path", - "description": "Repository to search in", + "description": "Artifacts' GAV", "required": true, "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } - }, + } + ], + "responses": {}, + "deprecated": false, + "security": [] + } + }, + "/api/console/execute": { + "post": { + "tags": [ + "Cli" + ], + "summary": "Remote command execution", + "description": "Execute command using POST request. The commands are the same as in the console and can be listed using the 'help' command.", + "parameters": [ { - "name": "*", - "in": "path", - "description": "Phrase to search for", + "name": "Authorization", + "in": "header", + "description": "Name and secret provided as basic auth credentials", "required": true, "deprecated": false, - "allowEmptyValue": true, + "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } } ], - "requestBody": { - "content": {}, - "required": false - }, "responses": { "200": { - "description": "Aggregated sum of resolved requests with list a list of them all", + "description": "Status of the executed command", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResolvedCountResponse" + "$ref": "#/components/schemas/ExecutionResponse" } } } }, - "401": { - "description": "When invalid token is used", + "400": { + "description": "Error message related to the invalid command format (0 < command length < 1024)", "content": { "application/json": { "schema": { @@ -160,36 +140,9 @@ Raw JSON scheme: } } } - } - }, - "deprecated": false, - "security": [] - } - }, - "/api/statistics/resolved/unique": { - "get": { - "tags": [ - "Statistics" - ], - "parameters": [], - "requestBody": { - "content": {}, - "required": false - }, - "responses": { - "200": { - "description": "Number of all unique requests", - "content": { - "application/json": { - "schema": { - "type": "number", - "format": "int64" - } - } - } }, "401": { - "description": "When non-manager token is used", + "description": "Error message related to the unauthorized access", "content": { "application/json": { "schema": { @@ -203,360 +156,233 @@ Raw JSON scheme: "security": [] } }, - "/api/tokens": { - "get": { - "tags": [ - "tokens" - ], - "summary": "Returns all existing tokens and data such as their permissions. Note: Requires Manager", - "parameters": [], - "requestBody": { - "content": {}, - "required": false - }, - "responses": {}, - "deprecated": false, - "security": [] - } - }, - "/api/tokens/{name}": { + "/api/console/log": { "get": { "tags": [ - "tokens" + "Console" ], - "summary": "Returns data about the token given via it\u0027s name. Note: Requires manager or you must be the token owner", + "description": "Streams the output of logs through an SSE Connection.", "parameters": [ { - "name": "name", - "in": "path", - "description": "Name of the token to be deleted", + "name": "Authorization", + "in": "header", + "description": "Name and secret provided as basic auth credentials", "required": true, "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } } ], - "requestBody": { - "content": {}, - "required": false + "responses": { + "200": { + "description": "Continuously sends out the log as messages under the `log` event. Sends a keepalive ping through comments." + } }, - "responses": {}, "deprecated": false, "security": [] - }, - "put": { + } + }, + "/api/console/sock": { + "patch": { "tags": [ - "tokens" - ], - "summary": "Creates / Updates a token via the specified body. Note: Requires manager permission.", - "parameters": [ - { - "name": "name", - "in": "path", - "description": "Name of the token to be deleted", - "required": true, - "deprecated": false, - "allowEmptyValue": false, - "schema": { - "type": "string", - "format": "" - } - } + "Console" ], - "requestBody": { - "description": "Data about the account including the secret and it\u0027s permissions", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateAccessTokenWithNoNameRequest" - } - } - }, - "required": true - }, + "parameters": [], "responses": {}, "deprecated": false, "security": [] - }, - "delete": { + } + }, + "/api/maven/details/{repository}/{gav}": { + "get": { "tags": [ - "tokens" + "Maven" ], - "summary": "Deletes the token specified via it\u0027s name. Note: Requires Manager", + "summary": "Browse the contents of repositories using API", + "description": "Get details about the requested file as JSON response", "parameters": [ { - "name": "name", + "name": "repository", "in": "path", - "description": "Name of the token to be deleted", + "description": "Destination repository", "required": true, "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } - } - ], - "requestBody": { - "content": {}, - "required": false - }, - "responses": {}, - "deprecated": false, - "security": [] - } - }, - "/api/settings/content/{name}": { - "get": { - "tags": [ - "Settings" - ], - "summary": "Find configuration content", - "parameters": [ + }, { - "name": "name", + "name": "gav", "in": "path", - "description": "Name of configuration to fetch", + "description": "Artifact path qualifier", "required": true, "deprecated": false, - "allowEmptyValue": false, + "allowEmptyValue": true, "schema": { - "type": "string", - "format": "" + "type": "string" } } ], - "requestBody": { - "content": {}, - "required": false - }, "responses": { "200": { - "description": "Returns dto representing configuration", + "description": "Returns document (different for directory and file) that describes requested resource", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SettingsResponse" + "$ref": "#/components/schemas/FileDetails" } } } }, "401": { - "description": "Returns 401 if token without moderation permission has been used to access this resource", - "content": {} + "description": "Returns 401 in case of unauthorized attempt of access to private repository", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } }, "404": { - "description": "Returns 404 if non-existing configuration is requested", - "content": {} + "description": "Returns 404 (for Maven) and frontend (for user) as a response if requested artifact is not in the repository" } }, "deprecated": false, "security": [] - }, - "put": { + } + }, + "/api/maven/generate/pom/{repository}/{gav}": { + "post": { "tags": [ - "Settings" + "Maven" ], - "summary": "Update configuration", "parameters": [ { - "name": "name", + "name": "repository", "in": "path", - "description": "Name of configuration to update", + "description": "Destination repository", + "required": true, + "deprecated": false, + "allowEmptyValue": false, + "schema": { + "type": "string" + } + }, + { + "name": "gav", + "in": "path", + "description": "Artifact path qualifier", "required": true, "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } } ], "requestBody": { - "content": {}, - "required": false - }, - "responses": { - "200": { - "description": "Returns 200 if configuration has been updated successfully", - "content": {} - }, - "401": { - "description": "Returns 401 if token without moderation permission has been used to access this resource", - "content": {} + "description": "GroupId, ArtifactId and Version of the stub POM", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PomDetails" + } + } }, - "404": { - "description": "Returns 404 if non-existing configuration is requested", - "content": {} - } + "required": true }, + "responses": {}, "deprecated": false, "security": [] } }, - "/api/auth/me": { + "/api/maven/latest/details/{repository}/{gav}": { "get": { "tags": [ - "Auth" + "Maven" ], - "summary": "Get token details", - "description": "Returns details about the requested token", "parameters": [ { - "name": "Authorization", - "in": "header", - "description": "Name and secret provided as basic auth credentials", + "name": "repository", + "in": "path", + "description": "Destination repository", "required": true, "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" - } - } - ], - "requestBody": { - "content": {}, - "required": false - }, - "responses": { - "200": { - "description": "Details about the token for succeeded authentication", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SessionDetails" - } - } + "type": "string" } }, - "401": { - "description": "Error message related to the unauthorized access in case of any failure", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "deprecated": false, - "security": [] - } - }, - "/{repository}/*": { - "get": { - "tags": [ - "Maven" - ], - "summary": "Browse the contents of repositories", - "description": "The route may return various responses to properly handle Maven specification and frontend application using the same path.", - "parameters": [ { - "name": "repository", + "name": "gav", "in": "path", - "description": "Destination repository", + "description": "Artifact path qualifier", "required": true, "deprecated": false, - "allowEmptyValue": false, + "allowEmptyValue": true, "schema": { - "type": "string", - "format": "" + "type": "string" } }, { - "name": "*", - "in": "path", - "description": "Artifact path qualifier", - "required": true, + "name": "extension", + "in": "query", + "description": "Changes extension of matched file (by default matches 'jar')", + "required": false, "deprecated": false, - "allowEmptyValue": true, + "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } - } - ], - "requestBody": { - "content": {}, - "required": false - }, - "responses": { - "200": { - "description": "Input stream of requested file", - "content": {} }, - "404": { - "description": "Returns 404 (for Maven) with frontend (for user) as a response if requested resource is not located in the current repository", - "content": {} - } - }, - "deprecated": false, - "security": [] - }, - "post": { - "tags": [ - "Maven" - ], - "summary": "Deploy artifact to the repository", - "description": "Deploy supports both, POST and PUT, methods and allows to deploy artifact builds", - "parameters": [ { - "name": "repository", - "in": "path", - "description": "Destination repository", - "required": true, + "name": "classifier", + "in": "query", + "description": "Appends classifier suffix to matched file", + "required": false, "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } }, { - "name": "*", - "in": "path", - "description": "Artifact path qualifier", - "required": true, + "name": "filter", + "in": "query", + "description": "Version (prefix) filter to apply", + "required": false, "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } } ], - "requestBody": { - "content": {}, - "required": false - }, "responses": { "200": { - "description": "Input stream of requested file", - "content": {} - }, - "401": { - "description": "Returns 401 for invalid credentials", - "content": {} - }, - "507": { - "description": "Returns 507 if Reposilite does not have enough disk space to store the uploaded file", - "content": {} + "description": "Details about the given file", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FileDetails" + } + } + } } }, "deprecated": false, "security": [] - }, - "put": { + } + }, + "/api/maven/latest/file/{repository}/{gav}": { + "get": { "tags": [ "Maven" ], - "summary": "Deploy artifact to the repository", - "description": "Deploy supports both, POST and PUT, methods and allows to deploy artifact builds", "parameters": [ { "name": "repository", @@ -566,49 +392,64 @@ Raw JSON scheme: "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } }, { - "name": "*", + "name": "gav", "in": "path", "description": "Artifact path qualifier", "required": true, "deprecated": false, + "allowEmptyValue": true, + "schema": { + "type": "string" + } + }, + { + "name": "extension", + "in": "query", + "description": "Changes extension of matched file (by default matches 'jar')", + "required": false, + "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } - } - ], - "requestBody": { - "content": {}, - "required": false - }, - "responses": { - "200": { - "description": "Input stream of requested file", - "content": {} }, - "401": { - "description": "Returns 401 for invalid credentials", - "content": {} + { + "name": "classifier", + "in": "query", + "description": "Appends classifier suffix to matched file", + "required": false, + "deprecated": false, + "allowEmptyValue": false, + "schema": { + "type": "string" + } }, - "507": { - "description": "Returns 507 if Reposilite does not have enough disk space to store the uploaded file", - "content": {} + { + "name": "filter", + "in": "query", + "description": "Version (prefix) filter to apply", + "required": false, + "deprecated": false, + "allowEmptyValue": false, + "schema": { + "type": "string" + } } - }, + ], + "responses": {}, "deprecated": false, "security": [] - }, - "delete": { + } + }, + "/api/maven/latest/version/{repository}/{gav}": { + "get": { "tags": [ "Maven" ], - "summary": "Delete the given file from repository", "parameters": [ { "name": "repository", @@ -618,48 +459,29 @@ Raw JSON scheme: "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } }, { - "name": "*", + "name": "gav", "in": "path", "description": "Artifact path qualifier", "required": true, "deprecated": false, - "allowEmptyValue": false, + "allowEmptyValue": true, "schema": { - "type": "string", - "format": "" + "type": "string" } - } - ], - "requestBody": { - "content": {}, - "required": false - }, - "responses": {}, - "deprecated": false, - "security": [] - } - }, - "/api/maven/latest/version/{repository}/*": { - "get": { - "tags": [ - "Maven" - ], - "parameters": [ + }, { "name": "extension", "in": "query", - "description": "Changes extension of matched file (by default matches \u0027jar\u0027)", + "description": "Changes extension of matched file (by default matches 'jar')", "required": false, "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } }, { @@ -670,8 +492,7 @@ Raw JSON scheme: "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } }, { @@ -682,59 +503,28 @@ Raw JSON scheme: "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } }, { "name": "type", "in": "query", - "description": "Format of expected response type: empty (default) for json; \u0027raw\u0027 for plain text", + "description": "Format of expected response type: empty (default) for json; 'raw' for plain text", "required": false, "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" - } - }, - { - "name": "repository", - "in": "path", - "description": "Destination repository", - "required": true, - "deprecated": false, - "allowEmptyValue": false, - "schema": { - "type": "string", - "format": "" - } - }, - { - "name": "*", - "in": "path", - "description": "Artifact path qualifier", - "required": true, - "deprecated": false, - "allowEmptyValue": true, - "schema": { - "type": "string", - "format": "" + "type": "string" } } ], - "requestBody": { - "content": {}, - "required": false - }, "responses": { "200": { "description": "", "content": { "text/plain": { "schema": { - "type": "string", - "format": "" + "type": "string" } } } @@ -744,34 +534,32 @@ Raw JSON scheme: "security": [] } }, - "/api/maven/latest/details/{repository}/*": { + "/api/maven/versions/{repository}/{gav}": { "get": { "tags": [ "Maven" ], "parameters": [ { - "name": "extension", - "in": "query", - "description": "Changes extension of matched file (by default matches \u0027jar\u0027)", - "required": false, + "name": "repository", + "in": "path", + "description": "Destination repository", + "required": true, "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } }, { - "name": "classifier", - "in": "query", - "description": "Appends classifier suffix to matched file", - "required": false, + "name": "gav", + "in": "path", + "description": "Artifact path qualifier", + "required": true, "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } }, { @@ -782,178 +570,413 @@ Raw JSON scheme: "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } - }, + } + ], + "responses": {}, + "deprecated": false, + "security": [] + } + }, + "/api/settings/domain/{name}": { + "get": { + "tags": [ + "Settings" + ], + "summary": "Find configuration", + "parameters": [ { - "name": "repository", + "name": "name", "in": "path", - "description": "Destination repository", + "description": "Name of configuration to fetch", "required": true, "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } + } + ], + "responses": { + "200": { + "description": "Returns dto representing configuration" + }, + "401": { + "description": "Returns 401 if token without moderation permission has been used to access this resource" }, + "404": { + "description": "Returns 404 if non-existing configuration is requested" + } + }, + "deprecated": false, + "security": [] + }, + "put": { + "tags": [ + "Settings" + ], + "summary": "Update configuration", + "parameters": [ { - "name": "*", + "name": "name", "in": "path", - "description": "Artifact path qualifier", + "description": "Name of configuration to update", "required": true, "deprecated": false, - "allowEmptyValue": true, + "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } } ], - "requestBody": { - "content": {}, - "required": false - }, "responses": { "200": { - "description": "Details about the given file", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FileDetails" - } - } - } + "description": "Returns 200 if configuration has been updated successfully" + }, + "401": { + "description": "Returns 401 if token without moderation permission has been used to access this resource" + }, + "404": { + "description": "Returns 404 if non-existing configuration is requested" } }, "deprecated": false, "security": [] } }, - "/api/maven/latest/file/{repository}/*": { + "/api/settings/domains": { "get": { "tags": [ - "Maven" + "Settings" ], + "summary": "List configurations", + "parameters": [], + "responses": { + "200": { + "description": "Returns list of configuration names" + }, + "401": { + "description": "Returns 401 if token without moderation permission has been used to access this resource" + } + }, + "deprecated": false, + "security": [] + } + }, + "/api/settings/schema/{name}": { + "get": { + "tags": [ + "Settings" + ], + "summary": "Get schema", "parameters": [ { - "name": "extension", - "in": "query", - "description": "Changes extension of matched file (by default matches \u0027jar\u0027)", - "required": false, + "name": "name", + "in": "path", + "description": "Name of schema to get", + "required": true, "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Returns dto representing configuration schema", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } } }, - { - "name": "classifier", - "in": "query", - "description": "Appends classifier suffix to matched file", - "required": false, - "deprecated": false, - "allowEmptyValue": false, - "schema": { - "type": "string", - "format": "" + "401": { + "description": "Returns 401 if token without moderation permission has been used to access this resource" + }, + "404": { + "description": "Returns 404 if non-existing configuration schema is requested" + } + }, + "deprecated": false, + "security": [] + } + }, + "/api/statistics/resolved/all": { + "get": { + "tags": [ + "Statistics" + ], + "parameters": [], + "responses": { + "200": { + "description": "Aggregated list of statistics per each repository", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AllResolvedResponse" + } + } } }, + "401": { + "description": "When non-manager token is used", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "deprecated": false, + "security": [] + } + }, + "/api/statistics/resolved/phrase/{limit}/{repository}/{gav}": { + "get": { + "tags": [ + "Statistics" + ], + "parameters": [ { - "name": "filter", - "in": "query", - "description": "Version (prefix) filter to apply", - "required": false, + "name": "limit", + "in": "path", + "description": "Amount of records to find (Maximum: 100", + "required": true, "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } }, { "name": "repository", "in": "path", - "description": "Destination repository", + "description": "Repository to search in", "required": true, "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } }, { - "name": "*", + "name": "gav", "in": "path", - "description": "Artifact path qualifier", + "description": "Phrase to search for", "required": true, "deprecated": false, "allowEmptyValue": true, "schema": { - "type": "string", - "format": "" + "type": "string" } } ], - "requestBody": { - "content": {}, - "required": false + "responses": { + "200": { + "description": "Aggregated sum of resolved requests with list a list of them all", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolvedCountResponse" + } + } + } + }, + "401": { + "description": "When invalid token is used", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "deprecated": false, + "security": [] + } + }, + "/api/statistics/resolved/unique": { + "get": { + "tags": [ + "Statistics" + ], + "parameters": [], + "responses": { + "200": { + "description": "Number of all unique requests", + "content": { + "application/json": { + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "401": { + "description": "When non-manager token is used", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "deprecated": false, + "security": [] + } + }, + "/api/status/instance": { + "get": { + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InstanceStatusResponse" + } + } + } + } + }, + "deprecated": false, + "security": [] + } + }, + "/api/status/snapshots": { + "get": { + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StatusSnapshot" + } + } + } + } + } }, + "deprecated": false, + "security": [] + } + }, + "/api/tokens": { + "get": { + "tags": [ + "Tokens" + ], + "summary": "Returns all existing tokens and data such as their permissions. Note: Requires Manager", + "parameters": [], "responses": {}, "deprecated": false, "security": [] } }, - "/api/badge/latest/{repository}/{gav}": { + "/api/tokens/{name}": { "get": { "tags": [ - "badge" + "Tokens" ], + "summary": "Returns data about the token given via it's name. Note: Requires manager or you must be the token owner", "parameters": [ { - "name": "repository", + "name": "name", "in": "path", - "description": "Artifact\u0027s repository", + "description": "Name of the token to be deleted", "required": true, "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } - }, + } + ], + "responses": {}, + "deprecated": false, + "security": [] + }, + "put": { + "tags": [ + "Tokens" + ], + "summary": "Creates / Updates a token via the specified body. Note: Requires manager permission.", + "parameters": [ { - "name": "gav", + "name": "name", "in": "path", - "description": "Artifacts\u0027 GAV", + "description": "Name of the token to be deleted", "required": true, "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } } ], "requestBody": { - "content": {}, - "required": false + "description": "Data about the account including the secret and it's permissions", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateAccessTokenWithNoNameRequest" + } + } + }, + "required": true }, "responses": {}, "deprecated": false, "security": [] + }, + "delete": { + "tags": [ + "Tokens" + ], + "summary": "Deletes the token specified via it's name. Note: Requires Manager", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Name of the token to be deleted", + "required": true, + "deprecated": false, + "allowEmptyValue": false, + "schema": { + "type": "string" + } + } + ], + "responses": {}, + "deprecated": false, + "security": [] } }, - "/api/maven/details/{repository}/*": { + "/{repository}/{gav}": { "get": { "tags": [ "Maven" ], - "summary": "Browse the contents of repositories using API", - "description": "Get details about the requested file as JSON response", + "summary": "Browse the contents of repositories", + "description": "The route may return various responses to properly handle Maven specification and frontend application using the same path.", "parameters": [ { "name": "repository", @@ -963,75 +986,157 @@ Raw JSON scheme: "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } }, { - "name": "*", + "name": "gav", "in": "path", "description": "Artifact path qualifier", "required": true, "deprecated": false, "allowEmptyValue": true, "schema": { - "type": "string", - "format": "" + "type": "string" } } ], - "requestBody": { - "content": {}, - "required": false + "responses": { + "200": { + "description": "Input stream of requested file", + "content": { + "multipart/form-data": {} + } + }, + "404": { + "description": "Returns 404 (for Maven) with frontend (for user) as a response if requested resource is not located in the current repository" + } + }, + "deprecated": false, + "security": [] + }, + "post": { + "tags": [ + "Maven" + ], + "summary": "Deploy artifact to the repository", + "description": "Deploy supports both, POST and PUT, methods and allows to deploy artifact builds", + "parameters": [ + { + "name": "X-Generate-Checksums", + "in": "header", + "description": "Determines if Reposilite should generate checksums for this file", + "required": false, + "deprecated": false, + "allowEmptyValue": false, + "schema": { + "type": "string" + } + }, + { + "name": "repository", + "in": "path", + "description": "Destination repository", + "required": true, + "deprecated": false, + "allowEmptyValue": false, + "schema": { + "type": "string" + } + }, + { + "name": "gav", + "in": "path", + "description": "Artifact path qualifier", + "required": true, + "deprecated": false, + "allowEmptyValue": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Input stream of requested file", + "content": { + "multipart/form-data": {} + } + }, + "401": { + "description": "Returns 401 for invalid credentials" + }, + "507": { + "description": "Returns 507 if Reposilite does not have enough disk space to store the uploaded file" + } }, + "deprecated": false, + "security": [] + }, + "put": { + "tags": [ + "Maven" + ], + "summary": "Deploy artifact to the repository", + "description": "Deploy supports both, POST and PUT, methods and allows to deploy artifact builds", + "parameters": [ + { + "name": "X-Generate-Checksums", + "in": "header", + "description": "Determines if Reposilite should generate checksums for this file", + "required": false, + "deprecated": false, + "allowEmptyValue": false, + "schema": { + "type": "string" + } + }, + { + "name": "repository", + "in": "path", + "description": "Destination repository", + "required": true, + "deprecated": false, + "allowEmptyValue": false, + "schema": { + "type": "string" + } + }, + { + "name": "gav", + "in": "path", + "description": "Artifact path qualifier", + "required": true, + "deprecated": false, + "allowEmptyValue": false, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { - "description": "Returns document (different for directory and file) that describes requested resource", + "description": "Input stream of requested file", "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FileDetails" - } - } + "multipart/form-data": {} } }, "401": { - "description": "Returns 401 in case of unauthorized attempt of access to private repository", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } + "description": "Returns 401 for invalid credentials" }, - "404": { - "description": "Returns 404 (for Maven) and frontend (for user) as a response if requested artifact is not in the repository", - "content": {} + "507": { + "description": "Returns 507 if Reposilite does not have enough disk space to store the uploaded file" } }, "deprecated": false, "security": [] - } - }, - "/api/maven/versions/{repository}/*": { - "get": { + }, + "delete": { "tags": [ "Maven" ], + "summary": "Delete the given file from repository", "parameters": [ - { - "name": "filter", - "in": "query", - "description": "Version (prefix) filter to apply", - "required": false, - "deprecated": false, - "allowEmptyValue": false, - "schema": { - "type": "string", - "format": "" - } - }, { "name": "repository", "in": "path", @@ -1040,27 +1145,21 @@ Raw JSON scheme: "deprecated": false, "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } }, { - "name": "*", + "name": "gav", "in": "path", "description": "Artifact path qualifier", "required": true, "deprecated": false, - "allowEmptyValue": true, + "allowEmptyValue": false, "schema": { - "type": "string", - "format": "" + "type": "string" } } ], - "requestBody": { - "content": {}, - "required": false - }, "responses": {}, "deprecated": false, "security": [] @@ -1069,227 +1168,299 @@ Raw JSON scheme: }, "components": { "schemas": { - "ExecutionResponse": { + "SessionDetails": { "type": "object", + "additionalProperties": false, "properties": { - "status": { - "$ref": "#/components/schemas/CommandStatus" + "accessToken": { + "$ref": "#/components/schemas/AccessTokenDto" }, - "response": { + "permissions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccessTokenPermission" + } + }, + "routes": { "type": "array", "items": { - "type": "string", - "format": "" + "$ref": "#/components/schemas/Route" } } - } + }, + "required": [ + "accessToken", + "permissions", + "routes" + ] }, - "ErrorResponse": { + "CommandStatus": { + "type": "string", + "enum": [ + "SUCCEEDED", + "FAILED" + ] + }, + "ExecutionResponse": { "type": "object", + "additionalProperties": false, "properties": { "status": { - "type": "integer", - "format": "int32" + "$ref": "#/components/schemas/CommandStatus" }, - "message": { - "type": "string", - "format": "" + "response": { + "type": "array", + "items": { + "type": "string" + } } - } + }, + "required": [ + "status", + "response" + ] }, - "ResolvedCountResponse": { + "LatestVersionResponse": { "type": "object", + "additionalProperties": false, "properties": { - "sum": { - "type": "number", - "format": "int64" + "snapshot": { + "type": "boolean" }, - "requests": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ResolvedEntry" - } + "version": { + "type": "string" } - } + }, + "required": [ + "snapshot", + "version" + ] }, - "CreateAccessTokenWithNoNameRequest": { + "PomDetails": { "type": "object", + "additionalProperties": false, "properties": { - "type": { - "$ref": "#/components/schemas/AccessTokenType" + "groupId": { + "type": "string" }, - "secret": { - "type": "string", - "format": "" + "artifactId": { + "type": "string" }, - "permissions": { - "type": "array", - "items": { - "type": "string", - "format": "" - } + "version": { + "type": "string" } - } + }, + "required": [ + "groupId", + "artifactId", + "version" + ] }, - "SettingsResponse": { + "ErrorResponse": { "type": "object", + "additionalProperties": false, "properties": { - "type": { - "$ref": "#/components/schemas/ContentType" + "status": { + "type": "integer", + "format": "int32" }, - "content": { - "type": "string", - "format": "" + "message": { + "type": "string" } - } + }, + "required": [ + "status", + "message" + ] }, - "SessionDetails": { + "AllResolvedResponse": { "type": "object", + "additionalProperties": false, "properties": { - "accessToken": { - "$ref": "#/components/schemas/AccessTokenDto" - }, - "permissions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AccessTokenPermission" - } + "statisticsEnabled": { + "type": "boolean" }, - "routes": { + "repositories": { "type": "array", "items": { - "$ref": "#/components/schemas/Route" + "$ref": "#/components/schemas/RepositoryStatistics" } } - } + }, + "required": [ + "statisticsEnabled", + "repositories" + ] }, - "LatestVersionResponse": { + "IntervalRecord": { "type": "object", + "additionalProperties": false, "properties": { - "snapshot": { - "type": "boolean", - "format": "" + "date": { + "type": "integer", + "format": "int64" }, - "version": { - "type": "string", - "format": "" + "count": { + "type": "integer", + "format": "int64" } - } + }, + "required": [ + "date", + "count" + ] }, - "FileDetails": { + "RepositoryStatistics": { "type": "object", + "additionalProperties": false, "properties": { - "type": { - "$ref": "#/components/schemas/FileType" - }, "name": { - "type": "string", - "format": "" + "type": "string" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/IntervalRecord" + } } - } + }, + "required": [ + "name", + "data" + ] }, - "CommandStatus": { + "ResolvedCountResponse": { "type": "object", - "properties": {} + "additionalProperties": false, + "properties": { + "sum": { + "type": "integer", + "format": "int64" + }, + "requests": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ResolvedEntry" + } + } + }, + "required": [ + "sum", + "requests" + ] }, "ResolvedEntry": { "type": "object", + "additionalProperties": false, "properties": { "gav": { - "type": "string", - "format": "" + "type": "string" }, "count": { - "type": "number", + "type": "integer", "format": "int64" } - } - }, - "AccessTokenType": { - "type": "object", - "properties": {} + }, + "required": [ + "gav", + "count" + ] }, - "ContentType": { + "InstanceStatusResponse": { "type": "object", + "additionalProperties": false, "properties": { - "mimeType": { - "type": "string", - "format": "" - }, - "humanReadable": { - "type": "boolean", - "format": "" + "version": { + "type": "string" }, - "extensions": { - "type": "array", - "items": { - "type": "string", - "format": "" - } + "latestVersion": { + "type": "string" }, - "contentType": { - "$ref": "#/components/schemas/ContentType" + "uptime": { + "type": "integer", + "format": "int64" }, - "contentTypeByExtension": { - "$ref": "#/components/schemas/ContentType" + "usedMemory": { + "type": "number", + "format": "double" }, - "mimeTypeByExtension": { - "type": "string", - "format": "" - } - } - }, - "AccessTokenDto": { - "type": "object", - "properties": { - "identifier": { - "$ref": "#/components/schemas/AccessTokenIdentifier" + "maxMemory": { + "type": "integer", + "format": "int32" }, - "name": { - "type": "string", - "format": "" + "usedThreads": { + "type": "integer", + "format": "int32" }, - "createdAt": { - "type": "string", - "format": "date" + "maxThreads": { + "type": "integer", + "format": "int32" }, - "description": { - "type": "string", - "format": "" + "failuresCount": { + "type": "integer", + "format": "int32" } - } + }, + "required": [ + "version", + "latestVersion", + "uptime", + "usedMemory", + "maxMemory", + "usedThreads", + "maxThreads", + "failuresCount" + ] }, - "AccessTokenPermission": { + "StatusSnapshot": { "type": "object", + "additionalProperties": false, "properties": { - "identifier": { - "type": "string", - "format": "" + "at": { + "type": "integer", + "format": "int64" }, - "shortcut": { - "type": "string", - "format": "" + "memory": { + "type": "integer", + "format": "int32" + }, + "threads": { + "type": "integer", + "format": "int32" } - } + }, + "required": [ + "at", + "memory", + "threads" + ] }, - "Route": { + "FileDetails": { "type": "object", + "additionalProperties": false, "properties": { - "path": { - "type": "string", - "format": "" + "type": { + "$ref": "#/components/schemas/FileType" }, - "permission": { - "$ref": "#/components/schemas/RoutePermission" + "name": { + "type": "string" } - } + }, + "required": [ + "type", + "name" + ] }, "FileType": { - "type": "object", - "properties": {} + "type": "string", + "enum": [ + "FILE", + "DIRECTORY" + ] }, "AccessTokenIdentifier": { "type": "object", + "additionalProperties": false, "properties": { "type": { "$ref": "#/components/schemas/AccessTokenType" @@ -1298,22 +1469,111 @@ Raw JSON scheme: "type": "integer", "format": "int32" } - } + }, + "required": [ + "type", + "value" + ] + }, + "AccessTokenPermission": { + "type": "string", + "enum": [ + "MANAGER" + ] + }, + "AccessTokenType": { + "type": "string", + "enum": [ + "PERSISTENT", + "TEMPORARY" + ] + }, + "Route": { + "type": "object", + "additionalProperties": false, + "properties": { + "path": { + "type": "string" + }, + "permission": { + "$ref": "#/components/schemas/RoutePermission" + } + }, + "required": [ + "path", + "permission" + ] }, "RoutePermission": { + "type": "string", + "enum": [ + "READ", + "WRITE" + ] + }, + "AccessTokenDto": { "type": "object", + "additionalProperties": false, "properties": { "identifier": { + "$ref": "#/components/schemas/AccessTokenIdentifier" + }, + "name": { + "type": "string" + }, + "createdAt": { "type": "string", - "format": "" + "format": "date" + }, + "description": { + "type": "string" + } + }, + "required": [ + "identifier", + "name", + "createdAt", + "description" + ] + }, + "CreateAccessTokenWithNoNameRequest": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "$ref": "#/components/schemas/AccessTokenType" }, - "shortcut": { + "secretType": { + "$ref": "#/components/schemas/SecretType" + }, + "secret": { "type": "string", - "format": "" + "nullable": true + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + } } - } + }, + "required": [ + "type", + "secretType", + "permissions" + ] + }, + "SecretType": { + "type": "string", + "enum": [ + "RAW", + "ENCRYPTED" + ] } - } - } + }, + "securitySchemes": {} + }, + "servers": [], + "security": null } ``` \ No newline at end of file