autosnippet
Version:
Extract code patterns into a knowledge base for AI coding assistants
230 lines (229 loc) • 7.49 kB
TypeScript
/** API 文档 - OpenAPI 3.0 规范 */
export declare const apiSpec: {
openapi: string;
info: {
title: string;
description: string;
version: string;
contact: {
name: string;
url: string;
};
};
servers: {
url: string;
description: string;
}[];
paths: {
'/health': {
get: {
summary: string;
description: string;
tags: string[];
responses: {
200: {
description: string;
content: {
'application/json': {
schema: {
type: string;
properties: {
success: {
type: string;
example: boolean;
};
status: {
type: string;
example: string;
};
timestamp: {
type: string;
example: number;
};
uptime: {
type: string;
example: number;
};
};
};
};
};
};
};
};
};
'/health/ready': {
get: {
summary: string;
description: string;
tags: string[];
responses: {
200: {
description: string;
content: {
'application/json': {
schema: {
type: string;
properties: {
success: {
type: string;
example: boolean;
};
ready: {
type: string;
example: boolean;
};
timestamp: {
type: string;
};
};
};
};
};
};
};
};
};
'/rules': {
get: {
summary: string;
tags: string[];
responses: {
200: {
description: string;
};
};
};
post: {
summary: string;
tags: string[];
requestBody: {
required: boolean;
content: {
'application/json': {
schema: {
type: string;
required: string[];
properties: {
name: {
type: string;
};
category: {
type: string;
};
pattern: {
type: string;
};
condition: {
type: string;
};
action: {
type: string;
};
priority: {
type: string;
};
};
};
};
};
};
responses: {
201: {
description: string;
};
};
};
};
'/rules/{id}': {
get: {
summary: string;
tags: string[];
parameters: {
name: string;
in: string;
required: boolean;
schema: {
type: string;
};
}[];
responses: {
200: {
description: string;
};
};
};
};
'/rules/{id}/enable': {
patch: {
summary: string;
tags: string[];
parameters: {
name: string;
in: string;
required: boolean;
schema: {
type: string;
};
}[];
responses: {
200: {
description: string;
};
};
};
};
'/rules/{id}/disable': {
patch: {
summary: string;
tags: string[];
parameters: {
name: string;
in: string;
required: boolean;
schema: {
type: string;
};
}[];
responses: {
200: {
description: string;
};
};
};
};
};
components: {
schemas: {
GuardRule: {
type: string;
description: string;
properties: {
id: {
type: string;
};
title: {
type: string;
};
description: {
type: string;
};
knowledgeType: {
type: string;
enum: string[];
};
constraints: {
type: string;
};
status: {
type: string;
};
createdAt: {
type: string;
};
};
};
};
};
};
export default apiSpec;