rdme
Version:
ReadMe's official CLI and GitHub Action.
788 lines (787 loc) • 882 kB
TypeScript
/**
* This is a snapshot of the OpenAPI description for ReadMe APIv2.
*
* This is used both for typechecking as well as for runtime validation.
* We use ajv to validate the user data against schemas in this document.
*
* @see {@link https://docs.readme.com/main/openapi/readme-api-v2-beta.json}
*/
declare const document: {
readonly openapi: "3.1.0";
readonly info: {
readonly description: "Create beautiful product and API documentation with our developer friendly platform.";
readonly version: "2.0.0";
readonly title: "ReadMe API";
readonly 'x-readme-deploy': "5.428.0";
readonly termsOfService: "https://readme.com/tos";
readonly contact: {
readonly name: "API Support";
readonly url: "https://docs.readme.com/main/docs/need-more-support";
readonly email: "support@readme.io";
};
};
readonly components: {
readonly securitySchemes: {
readonly bearer: {
readonly type: "http";
readonly scheme: "bearer";
readonly description: "A bearer token that will be supplied within an `Authentication` header as `bearer <token>`.";
};
};
readonly schemas: {};
};
readonly paths: {
readonly '/projects/{subdomain}/apikeys': {
readonly post: {
readonly operationId: "createAPIKey";
readonly summary: "Create an API key";
readonly tags: ["API Keys"];
readonly description: "Create an API key for your ReadMe project.";
readonly requestBody: {
readonly content: {
readonly 'application/json': {
readonly schema: {
readonly type: "object";
readonly properties: {
readonly label: {
readonly allOf: [{
readonly type: "string";
}, {
readonly type: "string";
readonly minLength: 1;
}];
};
};
readonly required: ["label"];
readonly additionalProperties: false;
};
};
};
readonly required: true;
};
readonly parameters: [{
readonly schema: {
readonly type: "string";
readonly pattern: "(me|[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)";
readonly maxLength: 30;
};
readonly in: "path";
readonly name: "subdomain";
readonly required: true;
readonly description: "The subdomain of your project.";
}];
readonly responses: {
readonly '201': {
readonly description: "Created";
readonly content: {
readonly 'application/json': {
readonly schema: {
readonly type: "object";
readonly properties: {
readonly data: {
readonly type: "object";
readonly properties: {
readonly token: {
readonly type: "string";
readonly pattern: "rdme_\\w+";
};
readonly label: {
readonly type: "string";
readonly nullable: true;
};
readonly last_accessed_on: {
readonly type: "string";
readonly format: "date-time";
readonly nullable: true;
readonly description: "An ISO 8601 formatted date for when the API key was last accessed.";
};
readonly created_at: {
readonly type: "string";
readonly format: "date-time";
readonly description: "An ISO 8601 formatted date for when the API key was created.";
};
readonly uri: {
readonly type: "string";
readonly pattern: "\\/projects\\/(me|[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)\\/apikeys\\/[a-f\\d]{24}";
};
};
readonly required: ["token", "label", "last_accessed_on", "created_at", "uri"];
readonly additionalProperties: false;
};
};
readonly required: ["data"];
readonly additionalProperties: false;
};
};
};
};
};
};
readonly get: {
readonly operationId: "getAPIKeys";
readonly summary: "Get your API keys";
readonly tags: ["API Keys"];
readonly description: "Get the API keys for your ReadMe project.";
readonly parameters: [{
readonly schema: {
readonly type: "number";
readonly minimum: 1;
readonly default: 1;
};
readonly in: "query";
readonly name: "page";
readonly required: false;
readonly description: "Used to specify further pages (starts at 1).";
}, {
readonly schema: {
readonly type: "number";
readonly minimum: 1;
readonly maximum: 100;
readonly default: 10;
};
readonly in: "query";
readonly name: "per_page";
readonly required: false;
readonly description: "Number of items to include in pagination (up to 100, defaults to 10).";
}, {
readonly schema: {
readonly type: "string";
readonly pattern: "(me|[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)";
readonly maxLength: 30;
};
readonly in: "path";
readonly name: "subdomain";
readonly required: true;
readonly description: "The subdomain of your project.";
}];
readonly responses: {
readonly '200': {
readonly description: "OK";
readonly content: {
readonly 'application/json': {
readonly schema: {
readonly type: "object";
readonly properties: {
readonly total: {
readonly type: "number";
};
readonly page: {
readonly type: "number";
};
readonly per_page: {
readonly type: "number";
};
readonly paging: {
readonly type: "object";
readonly properties: {
readonly next: {
readonly type: "string";
readonly nullable: true;
};
readonly previous: {
readonly type: "string";
readonly nullable: true;
};
readonly first: {
readonly type: "string";
readonly nullable: true;
};
readonly last: {
readonly type: "string";
readonly nullable: true;
};
};
readonly required: ["next", "previous", "first", "last"];
readonly additionalProperties: false;
};
readonly data: {
readonly type: "array";
readonly items: {
readonly type: "object";
readonly properties: {
readonly token: {
readonly type: "string";
readonly pattern: "rdme_\\w+";
};
readonly label: {
readonly type: "string";
readonly nullable: true;
};
readonly last_accessed_on: {
readonly type: "string";
readonly format: "date-time";
readonly nullable: true;
readonly description: "An ISO 8601 formatted date for when the API key was last accessed.";
};
readonly created_at: {
readonly type: "string";
readonly format: "date-time";
readonly description: "An ISO 8601 formatted date for when the API key was created.";
};
readonly uri: {
readonly type: "string";
readonly pattern: "\\/projects\\/(me|[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)\\/apikeys\\/[a-f\\d]{24}";
};
};
readonly required: ["token", "label", "last_accessed_on", "created_at", "uri"];
readonly additionalProperties: false;
};
};
};
readonly required: ["total", "page", "per_page", "paging", "data"];
readonly additionalProperties: false;
};
};
};
};
};
};
};
readonly '/projects/{subdomain}/apikeys/{api_key_id}': {
readonly delete: {
readonly operationId: "deleteAPIKey";
readonly summary: "Delete an API key";
readonly tags: ["API Keys"];
readonly description: "Delete an API key from your ReadMe project.";
readonly parameters: [{
readonly schema: {
readonly type: "string";
readonly pattern: "[a-f\\d]{24}";
};
readonly in: "path";
readonly name: "api_key_id";
readonly required: true;
readonly description: "The unique identifier for your API key.";
}, {
readonly schema: {
readonly type: "string";
readonly pattern: "(me|[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)";
readonly maxLength: 30;
};
readonly in: "path";
readonly name: "subdomain";
readonly required: true;
readonly description: "The subdomain of your project.";
}];
readonly responses: {
readonly '204': {
readonly description: "No Content";
};
};
};
readonly get: {
readonly operationId: "getAPIKey";
readonly summary: "Get an API key";
readonly tags: ["API Keys"];
readonly description: "Get an API key for your ReadMe project.";
readonly parameters: [{
readonly schema: {
readonly type: "string";
readonly pattern: "[a-f\\d]{24}";
};
readonly in: "path";
readonly name: "api_key_id";
readonly required: true;
readonly description: "The unique identifier for your API key.";
}, {
readonly schema: {
readonly type: "string";
readonly pattern: "(me|[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)";
readonly maxLength: 30;
};
readonly in: "path";
readonly name: "subdomain";
readonly required: true;
readonly description: "The subdomain of your project.";
}];
readonly responses: {
readonly '200': {
readonly description: "OK";
readonly content: {
readonly 'application/json': {
readonly schema: {
readonly type: "object";
readonly properties: {
readonly data: {
readonly type: "object";
readonly properties: {
readonly token: {
readonly type: "string";
readonly pattern: "rdme_\\w+";
};
readonly label: {
readonly type: "string";
readonly nullable: true;
};
readonly last_accessed_on: {
readonly type: "string";
readonly format: "date-time";
readonly nullable: true;
readonly description: "An ISO 8601 formatted date for when the API key was last accessed.";
};
readonly created_at: {
readonly type: "string";
readonly format: "date-time";
readonly description: "An ISO 8601 formatted date for when the API key was created.";
};
readonly uri: {
readonly type: "string";
readonly pattern: "\\/projects\\/(me|[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)\\/apikeys\\/[a-f\\d]{24}";
};
};
readonly required: ["token", "label", "last_accessed_on", "created_at", "uri"];
readonly additionalProperties: false;
};
};
readonly required: ["data"];
readonly additionalProperties: false;
};
};
};
};
};
};
readonly patch: {
readonly operationId: "updateAPIKey";
readonly summary: "Update an API key";
readonly tags: ["API Keys"];
readonly description: "Update an API key on your ReadMe project.";
readonly requestBody: {
readonly content: {
readonly 'application/json': {
readonly schema: {
readonly type: "object";
readonly properties: {
readonly label: {
readonly allOf: [{
readonly type: "string";
}, {
readonly type: "string";
readonly minLength: 1;
}];
};
};
readonly required: ["label"];
readonly additionalProperties: false;
};
};
};
readonly required: true;
};
readonly parameters: [{
readonly schema: {
readonly type: "string";
readonly pattern: "[a-f\\d]{24}";
};
readonly in: "path";
readonly name: "api_key_id";
readonly required: true;
readonly description: "The unique identifier for your API key.";
}, {
readonly schema: {
readonly type: "string";
readonly pattern: "(me|[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)";
readonly maxLength: 30;
};
readonly in: "path";
readonly name: "subdomain";
readonly required: true;
readonly description: "The subdomain of your project.";
}];
readonly responses: {
readonly '200': {
readonly description: "OK";
readonly content: {
readonly 'application/json': {
readonly schema: {
readonly type: "object";
readonly properties: {
readonly data: {
readonly type: "object";
readonly properties: {
readonly token: {
readonly type: "string";
readonly pattern: "rdme_\\w+";
};
readonly label: {
readonly type: "string";
readonly nullable: true;
};
readonly last_accessed_on: {
readonly type: "string";
readonly format: "date-time";
readonly nullable: true;
readonly description: "An ISO 8601 formatted date for when the API key was last accessed.";
};
readonly created_at: {
readonly type: "string";
readonly format: "date-time";
readonly description: "An ISO 8601 formatted date for when the API key was created.";
};
readonly uri: {
readonly type: "string";
readonly pattern: "\\/projects\\/(me|[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)\\/apikeys\\/[a-f\\d]{24}";
};
};
readonly required: ["token", "label", "last_accessed_on", "created_at", "uri"];
readonly additionalProperties: false;
};
};
readonly required: ["data"];
readonly additionalProperties: false;
};
};
};
};
};
};
};
readonly '/branches/{branch}/apis': {
readonly get: {
readonly operationId: "getAPIs";
readonly summary: "Get all API definitions";
readonly tags: ["APIs"];
readonly description: "Get all API definitions from your ReadMe project.\n\n>📘\n> This route is only available to projects that are using [ReadMe Refactored](https://docs.readme.com/main/docs/welcome-to-readme-refactored).";
readonly parameters: [{
readonly schema: {
readonly type: "string";
readonly pattern: "(v{0,1})(stable|([0-9]+)(?:\\.([0-9]+))?(?:\\.([0-9]+))?(-.*)?)(_(.*))?";
};
readonly in: "path";
readonly name: "branch";
readonly required: true;
readonly description: "Project version number, `stable` for your project's stable version, or a valid branch name.";
}];
readonly responses: {
readonly '200': {
readonly description: "OK";
readonly content: {
readonly 'application/json': {
readonly schema: {
readonly type: "object";
readonly properties: {
readonly total: {
readonly type: "number";
};
readonly data: {
readonly type: "array";
readonly items: {
readonly type: "object";
readonly properties: {
readonly created_at: {
readonly type: "string";
readonly format: "date-time";
readonly description: "An ISO 8601 formatted date for when the API definition was created.";
};
readonly filename: {
readonly type: "string";
readonly description: "This is the unique identifier, its filename, for the API definition.";
};
readonly legacy_id: {
readonly type: "string";
readonly pattern: "[a-f\\d]{24}";
readonly nullable: true;
readonly description: "The legacy ID of your API definition. This is only used for legacy rdme CLI workflows and only applies if your project, and this API definition, predates ReadMe Refactored. We consider this value to be deprecated and recommend against relying on it going forward.";
};
readonly source: {
readonly type: "object";
readonly properties: {
readonly current: {
readonly type: "string";
readonly enum: ["api", "apidesigner", "apieditor", "bidi", "form", "postman", "rdme", "rdme_github", "url"];
};
readonly original: {
readonly type: "string";
readonly enum: ["api", "apidesigner", "apieditor", "bidi", "form", "postman", "rdme", "rdme_github", "url"];
};
};
readonly required: ["current", "original"];
readonly additionalProperties: false;
readonly description: "The sources by which this API definition was ingested.";
};
readonly type: {
readonly type: "string";
readonly enum: ["openapi", "postman", "swagger", "unknown"];
readonly description: "The type of API definition. This will be `unknown` if the API definition has either not yet been processed or failed with validation errors.";
};
readonly updated_at: {
readonly type: "string";
readonly format: "date-time";
readonly description: "An ISO 8601 formatted date for when the API definition was last updated.";
};
readonly upload: {
readonly type: "object";
readonly properties: {
readonly status: {
readonly type: "string";
readonly enum: ["pending", "failed", "done", "pending_update", "failed_update"];
readonly description: "The status of the API definition upload.";
};
readonly reason: {
readonly type: "string";
readonly nullable: true;
readonly description: "The reason for the upload failure if it failed.";
};
readonly warnings: {
readonly type: "string";
readonly nullable: true;
readonly description: "Any fixable warnings that may exist within the API definition if the upload was ingested without errors.";
};
};
readonly required: ["status", "reason", "warnings"];
readonly additionalProperties: false;
};
readonly uri: {
readonly type: "string";
readonly pattern: "\\/(versions|branches)\\/((v{0,1})(stable|([0-9]+)(?:\\.([0-9]+))?(?:\\.([0-9]+))?(-.*)?)(_(.*))?)\\/apis\\/((([a-z0-9-_ ]|[^\\\\x00-\\\\x7F])+.(json|yaml|yml)))";
readonly description: "A URI to the API definition resource.";
};
};
readonly required: ["created_at", "filename", "legacy_id", "source", "type", "updated_at", "upload", "uri"];
readonly additionalProperties: false;
};
};
};
readonly required: ["total", "data"];
readonly additionalProperties: false;
};
};
};
};
};
};
readonly post: {
readonly operationId: "createAPI";
readonly summary: "Create an API definition";
readonly tags: ["APIs"];
readonly description: "Create an API definition in the API Reference section of your ReadMe project.\n\n>📘\n> This route is only available to projects that are using [ReadMe Refactored](https://docs.readme.com/main/docs/welcome-to-readme-refactored).";
readonly requestBody: {
readonly content: {
readonly 'multipart/form-data': {
readonly schema: {
readonly type: "object";
readonly properties: {
readonly schema: {
readonly description: "The API definition.";
};
readonly upload_source: {
readonly default: "form";
readonly description: "The source that the API definition is being uploaded through.";
};
readonly url: {
readonly description: "The URL where the API definition is hosted.";
};
};
readonly additionalProperties: false;
readonly description: "The API definition to upload. We provide full support for OpenAPI 3.x and Swagger 2.0 and experimental support for Postman collections.";
};
};
};
readonly description: "The API definition to upload. We provide full support for OpenAPI 3.x and Swagger 2.0 and experimental support for Postman collections.";
};
readonly parameters: [{
readonly schema: {
readonly type: "string";
readonly pattern: "(v{0,1})(stable|([0-9]+)(?:\\.([0-9]+))?(?:\\.([0-9]+))?(-.*)?)(_(.*))?";
};
readonly in: "path";
readonly name: "branch";
readonly required: true;
readonly description: "Project version number, `stable` for your project's stable version, or a valid branch name.";
}];
readonly responses: {
readonly '202': {
readonly description: "Accepted";
readonly content: {
readonly 'application/json': {
readonly schema: {
readonly type: "object";
readonly properties: {
readonly data: {
readonly type: "object";
readonly properties: {
readonly upload: {
readonly type: "object";
readonly properties: {
readonly status: {
readonly type: "string";
readonly enum: ["pending", "failed", "done", "pending_update", "failed_update"];
readonly description: "The status of the API definition upload.";
};
};
readonly required: ["status"];
readonly additionalProperties: false;
};
readonly uri: {
readonly type: "string";
readonly pattern: "\\/(versions|branches)\\/((v{0,1})(stable|([0-9]+)(?:\\.([0-9]+))?(?:\\.([0-9]+))?(-.*)?)(_(.*))?)\\/apis\\/((([a-z0-9-_ ]|[^\\\\x00-\\\\x7F])+.(json|yaml|yml)))";
readonly description: "A URI to the API definition resource.";
};
};
readonly required: ["upload", "uri"];
readonly additionalProperties: false;
};
};
readonly required: ["data"];
readonly additionalProperties: false;
};
};
};
};
};
};
};
readonly '/branches/{branch}/apis/{filename}': {
readonly get: {
readonly operationId: "getAPI";
readonly summary: "Get an API definition";
readonly tags: ["APIs"];
readonly description: "Get an API definition from your ReadMe project.\n\n>📘\n> This route is only available to projects that are using [ReadMe Refactored](https://docs.readme.com/main/docs/welcome-to-readme-refactored).";
readonly parameters: [{
readonly schema: {
readonly type: "string";
readonly pattern: "(([a-z0-9-_ ]|[^\\\\x00-\\\\x7F])+.(json|yaml|yml))";
};
readonly in: "path";
readonly name: "filename";
readonly required: true;
readonly description: "The filename of the API definition to retrieve.";
}, {
readonly schema: {
readonly type: "string";
readonly pattern: "(v{0,1})(stable|([0-9]+)(?:\\.([0-9]+))?(?:\\.([0-9]+))?(-.*)?)(_(.*))?";
};
readonly in: "path";
readonly name: "branch";
readonly required: true;
readonly description: "Project version number, `stable` for your project's stable version, or a valid branch name.";
}];
readonly responses: {
readonly '200': {
readonly description: "OK";
readonly content: {
readonly 'application/json': {
readonly schema: {
readonly type: "object";
readonly properties: {
readonly data: {
readonly type: "object";
readonly properties: {
readonly created_at: {
readonly type: "string";
readonly format: "date-time";
readonly description: "An ISO 8601 formatted date for when the API definition was created.";
};
readonly filename: {
readonly type: "string";
readonly description: "This is the unique identifier, its filename, for the API definition.";
};
readonly legacy_id: {
readonly type: "string";
readonly pattern: "[a-f\\d]{24}";
readonly nullable: true;
readonly description: "The legacy ID of your API definition. This is only used for legacy rdme CLI workflows and only applies if your project, and this API definition, predates ReadMe Refactored. We consider this value to be deprecated and recommend against relying on it going forward.";
};
readonly source: {
readonly type: "object";
readonly properties: {
readonly current: {
readonly type: "string";
readonly enum: ["api", "apidesigner", "apieditor", "bidi", "form", "postman", "rdme", "rdme_github", "url"];
};
readonly original: {
readonly type: "string";
readonly enum: ["api", "apidesigner", "apieditor", "bidi", "form", "postman", "rdme", "rdme_github", "url"];
};
};
readonly required: ["current", "original"];
readonly additionalProperties: false;
readonly description: "The sources by which this API definition was ingested.";
};
readonly type: {
readonly type: "string";
readonly enum: ["openapi", "postman", "swagger", "unknown"];
readonly description: "The type of API definition. This will be `unknown` if the API definition has either not yet been processed or failed with validation errors.";
};
readonly updated_at: {
readonly type: "string";
readonly format: "date-time";
readonly description: "An ISO 8601 formatted date for when the API definition was last updated.";
};
readonly upload: {
readonly type: "object";
readonly properties: {
readonly status: {
readonly type: "string";
readonly enum: ["pending", "failed", "done", "pending_update", "failed_update"];
readonly description: "The status of the API definition upload.";
};
readonly reason: {
readonly type: "string";
readonly nullable: true;
readonly description: "The reason for the upload failure if it failed.";
};
readonly warnings: {
readonly type: "string";
readonly nullable: true;
readonly description: "Any fixable warnings that may exist within the API definition if the upload was ingested without errors.";
};
};
readonly required: ["status", "reason", "warnings"];
readonly additionalProperties: false;
};
readonly uri: {
readonly type: "string";
readonly pattern: "\\/(versions|branches)\\/((v{0,1})(stable|([0-9]+)(?:\\.([0-9]+))?(?:\\.([0-9]+))?(-.*)?)(_(.*))?)\\/apis\\/((([a-z0-9-_ ]|[^\\\\x00-\\\\x7F])+.(json|yaml|yml)))";
readonly description: "A URI to the API definition resource.";
};
readonly schema: {
readonly nullable: true;
readonly description: "The API schema.";
};
};
readonly required: ["created_at", "filename", "legacy_id", "source", "type", "updated_at", "upload", "uri"];
readonly additionalProperties: false;
};
};
readonly required: ["data"];
readonly additionalProperties: false;
};
};
};
};
};
};
readonly delete: {
readonly operationId: "deleteAPI";
readonly summary: "Delete an API definition";
readonly tags: ["APIs"];
readonly description: "Delete an API definition from the API Reference section of your ReadMe project.\n\n>📘\n> This route is only available to projects that are using [ReadMe Refactored](https://docs.readme.com/main/docs/welcome-to-readme-refactored).";
readonly parameters: [{
readonly schema: {
readonly type: "string";
readonly pattern: "(([a-z0-9-_ ]|[^\\\\x00-\\\\x7F])+.(json|yaml|yml))";
};
readonly in: "path";
readonly name: "filename";
readonly required: true;
readonly description: "The filename of the API definition to retrieve.";
}, {
readonly schema: {
readonly type: "string";
readonly pattern: "(v{0,1})(stable|([0-9]+)(?:\\.([0-9]+))?(?:\\.([0-9]+))?(-.*)?)(_(.*))?";
};
readonly in: "path";
readonly name: "branch";
readonly required: true;
readonly description: "Project version number, `stable` for your project's stable version, or a valid branch name.";
}];
readonly responses: {
readonly '204': {
readonly description: "No Content";
};
};
};
readonly put: {
readonly operationId: "updateAPI";
readonly summary: "Update an API definition";