From 9dca46ea6658d84e52ff77f4866720f9d92b6731 Mon Sep 17 00:00:00 2001 From: CaptOrb Date: Wed, 27 Aug 2025 22:31:07 +0100 Subject: [PATCH] update openapi.yaml --- server/openapi.yaml | 44 ++++++++++++++++++++++++++++++++++- server/src/types/openapi.d.ts | 40 ++++++++++++++++++++++++++++++- 2 files changed, 82 insertions(+), 2 deletions(-) diff --git a/server/openapi.yaml b/server/openapi.yaml index 8d33e9c..69df2a0 100644 --- a/server/openapi.yaml +++ b/server/openapi.yaml @@ -73,7 +73,49 @@ paths: schema: $ref: '#/components/schemas/Error' - /repos/{id}: + /repo/{id}: + get: + summary: Get the configuration of a specific repository + operationId: getRepo + parameters: + - in: path + name: id + schema: + type: string + required: true + description: Repository ID + responses: + '200': + description: Repository configuration retrieved successfully + content: + application/json: + schema: + $ref: '#/components/schemas/RepositoryConfig' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorised + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Repository not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + put: summary: Configure a repository for MOLCI operationId: configureRepo diff --git a/server/src/types/openapi.d.ts b/server/src/types/openapi.d.ts index 240a237..c01b3a4 100644 --- a/server/src/types/openapi.d.ts +++ b/server/src/types/openapi.d.ts @@ -68,6 +68,21 @@ declare namespace Paths { export type $500 = Components.Schemas.Error; } } + namespace GetRepo { + namespace Parameters { + export type Id = string; + } + export interface PathParameters { + id: Parameters.Id; + } + namespace Responses { + export type $200 = Components.Schemas.RepositoryConfig; + export type $400 = Components.Schemas.Error; + export type $401 = Components.Schemas.Error; + export type $404 = Components.Schemas.Error; + export type $500 = Components.Schemas.Error; + } + } namespace ListAvailableRepos { namespace Responses { export type $200 = Components.Schemas.Repository[]; @@ -130,7 +145,30 @@ export interface Operations { | Paths.ListConfiguredRepos.Responses.$500; }; /** - * PUT /repos/{id} + * GET /repo/{id} + */ + ["getRepo"]: { + requestBody: any; + params: Paths.GetRepo.PathParameters; + query: UnknownParams; + headers: UnknownParams; + cookies: UnknownParams; + context: Context< + any, + Paths.GetRepo.PathParameters, + UnknownParams, + UnknownParams, + UnknownParams + >; + response: + | Paths.GetRepo.Responses.$200 + | Paths.GetRepo.Responses.$400 + | Paths.GetRepo.Responses.$401 + | Paths.GetRepo.Responses.$404 + | Paths.GetRepo.Responses.$500; + }; + /** + * PUT /repo/{id} */ ["configureRepo"]: { requestBody: Paths.ConfigureRepo.RequestBody;