refactor(core): 抽象语义化 HTTP 客户端与统一防爬指纹管理

This commit is contained in:
gitea committed 2026-09-17 15:32:56 +08:00
1 parent 1322e2eab9
commit aa69b50e6e
11 files changed
+834 -401

No files matched your search

+55
View File
@@ -0,0 +1,55 @@
/**
* HTTP 客户端基础设施总入口
* 包含基础 Ky 客户端工厂、浏览器指纹伪装、闭合用户会话客户端、开放平台客户端、集群客户端及脚本流引擎客户端。
*/
// 1. 底层 Ky 基础工厂
export {
createClient,
createAuthClient,
type CreateClientOptions,
type CreateAuthClientOptions,
} from "./factory.js";
// 2. 统一浏览器指纹与防爬请求头
export {
getBrowserFingerprintHeaders,
DEFAULT_USER_AGENT,
DEFAULT_REFERER,
DEFAULT_ORIGIN,
type BrowserFingerprintOptions,
} from "./fingerprint.js";
// 3. 闭合用户会话客户端 (Session Client)
export {
createSessionClient,
getSessionHeaders,
createEkbClient,
getEkbHeaders,
type CreateSessionClientOptions,
} from "./session-client.js";
// 4. 开放平台 OpenAPI 客户端 (OpenAPI Client)
export {
createOpenApiClient,
fetchOpenApiToken,
getOpenApiHeaders,
type OpenApiAuthConfig,
type CreateOpenApiClientOptions,
} from "./openapi-client.js";
// 5. 应用中心与集群寻址客户端 (Unity Client)
export {
getUnityClient,
getEasoClient,
resolveCorpCluster,
fetchUnityJwt,
fetchHoseToken,
} from "./unity-client.js";
// 6. 工作流脚本调试引擎客户端 (Script Engine Client)
export {
getScriptEngineClient,
getPiperClient,
fetchEasoJwt,
} from "./script-engine-client.js";