mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-27 12:51:26 +08:00
- Deleted batch and transaction related schemas, handlers, and IPC channels to streamline the Data API. - Updated related type definitions and import paths to reflect the removal of batch and transaction functionalities. - Simplified the API server and adapter logic by eliminating unused methods and handlers.
43 lines
1.4 KiB
TypeScript
43 lines
1.4 KiB
TypeScript
/**
|
|
* Schema Index - Composes all domain schemas into unified ApiSchemas
|
|
*
|
|
* This file has ONE responsibility: compose domain schemas into ApiSchemas.
|
|
*
|
|
* Import conventions (see api/README.md for details):
|
|
* - Infrastructure types: import from '@shared/data/api'
|
|
* - Domain DTOs: import directly from schema files (e.g., '@shared/data/api/schemas/topic')
|
|
*
|
|
* @example
|
|
* ```typescript
|
|
* // Infrastructure types via barrel export
|
|
* import type { ApiSchemas, DataRequest } from '@shared/data/api'
|
|
*
|
|
* // Domain DTOs directly from schema files
|
|
* import type { TestItem, CreateTestItemDto } from '@shared/data/api/schemas/test'
|
|
* import type { Topic, CreateTopicDto } from '@shared/data/api/schemas/topic'
|
|
* ```
|
|
*/
|
|
|
|
import type { AssertValidSchemas } from '../apiTypes'
|
|
import type { TestSchemas } from './test'
|
|
|
|
/**
|
|
* Merged API Schemas - single source of truth for all API endpoints
|
|
*
|
|
* All domain schemas are composed here using intersection types.
|
|
* AssertValidSchemas provides compile-time validation:
|
|
* - Invalid HTTP methods become `never` type
|
|
* - Missing `response` field causes type errors
|
|
*
|
|
* When adding a new domain:
|
|
* 1. Create the schema file (e.g., topic.ts)
|
|
* 2. Import and add to intersection below
|
|
*
|
|
* @example
|
|
* ```typescript
|
|
* import type { TopicSchemas } from './topic'
|
|
* export type ApiSchemas = AssertValidSchemas<TestSchemas & TopicSchemas>
|
|
* ```
|
|
*/
|
|
export type ApiSchemas = AssertValidSchemas<TestSchemas>
|