mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-31 00:10:22 +08:00
- Add Topic and Message API endpoints for CRUD operations - Implement tree visualization queries (GET /topics/:id/tree) - Implement branch message queries with pagination (GET /topics/:id/messages) - Add multi-model response grouping via siblingsGroupId - Support topic forking from existing message nodes - Add INVALID_OPERATION error code for business rule violations - Update API design guidelines documentation
105 lines
2.8 KiB
TypeScript
105 lines
2.8 KiB
TypeScript
/**
|
|
* Cherry Studio Data API - Barrel Exports
|
|
*
|
|
* Exports common infrastructure types for the Data API system.
|
|
* Domain-specific DTOs should be imported directly from their schema files.
|
|
*
|
|
* @example
|
|
* ```typescript
|
|
* // Infrastructure types from barrel export
|
|
* import { DataRequest, DataResponse, ErrorCode, DataApiError } from '@shared/data/api'
|
|
*
|
|
* // Domain DTOs from schema files directly
|
|
* import type { Topic, CreateTopicDto } from '@shared/data/api/schemas/topic'
|
|
* ```
|
|
*/
|
|
|
|
// ============================================================================
|
|
// Core Request/Response Types
|
|
// ============================================================================
|
|
|
|
export type {
|
|
DataRequest,
|
|
DataResponse,
|
|
HttpMethod,
|
|
PaginatedResponse,
|
|
PaginationParams
|
|
} from './apiTypes'
|
|
|
|
// ============================================================================
|
|
// API Schema Type Utilities
|
|
// ============================================================================
|
|
|
|
export type {
|
|
ApiBody,
|
|
ApiClient,
|
|
ApiHandler,
|
|
ApiImplementation,
|
|
ApiMethods,
|
|
ApiParams,
|
|
ApiPaths,
|
|
ApiQuery,
|
|
ApiResponse,
|
|
ApiSchemas,
|
|
ConcreteApiPaths
|
|
} from './apiTypes'
|
|
|
|
// ============================================================================
|
|
// Path Resolution Utilities
|
|
// ============================================================================
|
|
|
|
export type {
|
|
BodyForPath,
|
|
MatchApiPath,
|
|
QueryParamsForPath,
|
|
ResolvedPath,
|
|
ResponseForPath
|
|
} from './apiPaths'
|
|
|
|
// ============================================================================
|
|
// Error Handling (from apiErrors.ts)
|
|
// ============================================================================
|
|
|
|
// Error code enum and mappings
|
|
export {
|
|
ERROR_MESSAGES,
|
|
ERROR_STATUS_MAP,
|
|
ErrorCode,
|
|
isRetryableErrorCode,
|
|
RETRYABLE_ERROR_CODES
|
|
} from './apiErrors'
|
|
|
|
// DataApiError class and factory
|
|
export {
|
|
DataApiError,
|
|
DataApiErrorFactory,
|
|
isDataApiError,
|
|
isSerializedDataApiError,
|
|
toDataApiError
|
|
} from './apiErrors'
|
|
|
|
// Error-related types
|
|
export type {
|
|
ConcurrentModificationErrorDetails,
|
|
DatabaseErrorDetails,
|
|
DataInconsistentErrorDetails,
|
|
DetailsForCode,
|
|
ErrorDetailsMap,
|
|
InternalErrorDetails,
|
|
InvalidOperationErrorDetails,
|
|
NotFoundErrorDetails,
|
|
PermissionDeniedErrorDetails,
|
|
RequestContext,
|
|
ResourceLockedErrorDetails,
|
|
SerializedDataApiError,
|
|
TimeoutErrorDetails,
|
|
ValidationErrorDetails
|
|
} from './apiErrors'
|
|
|
|
// ============================================================================
|
|
// Subscription & Middleware (for advanced usage)
|
|
// ============================================================================
|
|
|
|
export type { Middleware, ServiceOptions, SubscriptionCallback, SubscriptionOptions } from './apiTypes'
|
|
export { SubscriptionEvent } from './apiTypes'
|