Skip to content

Commit bb00beb

Browse files
chatman-mediaclaude
andcommitted
refactor(adapters): cleanup HTTP адаптера и экспортов
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 39ba81a commit bb00beb

File tree

4 files changed

+12
-23
lines changed

4 files changed

+12
-23
lines changed

src/adapters/http/client.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,7 @@ export class HttpClient {
5454
return this.request<T>("DELETE", path)
5555
}
5656

57-
private async request<T>(
58-
method: string,
59-
path: string,
60-
body?: unknown,
61-
): Promise<ApiResponse<T>> {
57+
private async request<T>(method: string, path: string, body?: unknown): Promise<ApiResponse<T>> {
6258
const url = `${this.baseUrl}${path}`
6359
const controller = new AbortController()
6460
const timeoutId = setTimeout(() => controller.abort(), this.timeout)

src/adapters/http/index.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
import { container } from "@/core/container"
2121

2222
import { type HttpBackendOptions, HttpBackendService } from "./backend"
23-
import { type HttpClientOptions, HttpClient } from "./client"
23+
import { HttpClient } from "./client"
2424

2525
// Re-exports
2626
export { type HttpBackendOptions, HttpBackendService } from "./backend"
27-
export { type HttpClientOptions, HttpClient } from "./client"
27+
export { HttpClient, type HttpClientOptions } from "./client"
2828

2929
export interface HttpAppOptions {
3030
/** URL сервера */
@@ -48,10 +48,7 @@ export interface HttpAppServices {
4848
* @returns Объект со всеми сервисами
4949
*/
5050
export async function initHttpApp(options: HttpAppOptions = {}): Promise<HttpAppServices> {
51-
const {
52-
serverUrl = "http://localhost:3001",
53-
autoConnect = true,
54-
} = options
51+
const { serverUrl = "http://localhost:3001", autoConnect = true } = options
5552

5653
// Create HTTP client
5754
const client = new HttpClient({

src/adapters/index.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@
2929
* ```
3030
*/
3131

32+
// HTTP adapters (for web version / remote control via src-node)
33+
export {
34+
createHttpServices,
35+
HttpBackendService,
36+
HttpClient,
37+
initHttpApp,
38+
} from "./http"
3239
// Mock adapters
3340
export {
3441
createMockServices,
@@ -38,13 +45,10 @@ export {
3845
MockPlatformService,
3946
MockStorageService,
4047
} from "./mock"
41-
4248
// Node.js adapters
4349
export { initNodeApp, NodeMediaService } from "./node"
44-
4550
// React provider (main entry point for apps)
4651
export { AppInitProvider, useAppInit, useAppReady } from "./react"
47-
4852
// Tauri adapters
4953
export {
5054
initTauriApp,
@@ -53,11 +57,3 @@ export {
5357
TauriPlatformService,
5458
TauriStorageService,
5559
} from "./tauri"
56-
57-
// HTTP adapters (for web version / remote control via src-node)
58-
export {
59-
createHttpServices,
60-
HttpBackendService,
61-
HttpClient,
62-
initHttpApp,
63-
} from "./http"

src/features/montage-planner/components/analysis-tasks-dropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
useAnalysisTasks,
2525
} from "../hooks"
2626
import { AnalysisPhase } from "../types"
27-
import { AnalysisTaskStatus, type AnalysisTask } from "../types/analysis-task"
27+
import { type AnalysisTask, AnalysisTaskStatus } from "../types/analysis-task"
2828

2929
/**
3030
* Маппинг статуса FileAnalysisProgress на AnalysisTaskStatus

0 commit comments

Comments
 (0)