94 lines
2.0 KiB
TypeScript
94 lines
2.0 KiB
TypeScript
/**
|
|
* Representación simplificada de un schema de componente OpenAPI.
|
|
* Se utiliza para generar modelos (entidades) y mappers.
|
|
*/
|
|
export interface OpenApiSchema {
|
|
properties?: Record<
|
|
string,
|
|
{
|
|
type?: string;
|
|
description?: string;
|
|
$ref?: string;
|
|
items?: { $ref?: string };
|
|
}
|
|
>;
|
|
required?: string[];
|
|
description?: string;
|
|
}
|
|
|
|
/**
|
|
* Representación de una operación OpenAPI (GET, POST, etc.) dentro de un path.
|
|
* Contiene la información necesaria para generar repositorios y casos de uso.
|
|
*/
|
|
export interface OpenApiOperation {
|
|
tags?: string[];
|
|
operationId?: string;
|
|
summary?: string;
|
|
description?: string;
|
|
parameters?: Array<{
|
|
name: string;
|
|
in: string;
|
|
required: boolean;
|
|
description?: string;
|
|
schema?: { type?: string };
|
|
}>;
|
|
requestBody?: {
|
|
description?: string;
|
|
content?: Record<
|
|
string,
|
|
{
|
|
schema?: {
|
|
$ref?: string;
|
|
type?: string;
|
|
};
|
|
}
|
|
>;
|
|
};
|
|
responses?: Record<
|
|
string,
|
|
{
|
|
content?: Record<
|
|
string,
|
|
{
|
|
schema?: {
|
|
$ref?: string;
|
|
type?: string;
|
|
items?: { $ref?: string };
|
|
};
|
|
}
|
|
>;
|
|
}
|
|
>;
|
|
}
|
|
|
|
/**
|
|
* Operación normalizada y lista para ser consumida por los templates Mustache.
|
|
* Cada instancia representa un endpoint agrupado bajo un tag del API.
|
|
*/
|
|
export interface TagOperationParam {
|
|
paramName: string;
|
|
dataType: string;
|
|
description: string;
|
|
required: boolean;
|
|
'-last': boolean;
|
|
}
|
|
|
|
export interface TagOperation {
|
|
nickname: string;
|
|
summary: string;
|
|
notes: string;
|
|
httpMethod: string;
|
|
path: string;
|
|
allParams: TagOperationParam[];
|
|
hasQueryParams: boolean;
|
|
queryParams: unknown[];
|
|
hasBodyParam: boolean;
|
|
bodyParam: string;
|
|
returnType: string | boolean;
|
|
returnBaseType: string | boolean;
|
|
returnTypeVarName: string | boolean;
|
|
returnBaseTypeVarName: string | boolean;
|
|
isListContainer: boolean;
|
|
vendorExtensions: Record<string, unknown>;
|
|
}
|