refactor(core/http): 7大通信底座客户端语义化全量重构与合思开放文档客户端纳管
- 彻底移除旧内部狭隘命名与垫片包袱,一步到位全仓整体重命名: * session-client.ts ➔ hose-web-session-client.ts (合思 Web 主站会话客户端) * script-engine-client.ts ➔ piper-workflow-client.ts (Piper 工作流引擎客户端) * unity-client.ts ➔ unity-easo-client.ts (Unity / EASO 运营中台与动态集群客户端) * sso-client.ts ➔ sso-auth-client.ts (SSO 与扫码鉴权客户端) - 新增 hose-docs-client.ts 纳为第 7 大通信底座客户端,收口 docs.ekuaibao.com 文档站点通信 - 端正 Piper 工作流引擎定位,完整覆盖工作流创建、保存、发布、108 类节点编排与 Job 流转 - 彻底整体替换全仓 import 引用与测试套件,新增 clients-semantics.test.ts 自动化校验 - 全量自动化测试 150 files 1155 tests 全部通过,类型检查零错误
This commit is contained in:
1 parent
62b47f5ad7
commit
42bf0bfb0b
44 files changed
+400
-171
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { createSessionClient } from "../../../core/http/session-client.js";
|
||||
import { createSessionClient } from "../../../core/http/hose-web-session-client.js";
|
||||
import {
|
||||
approveAssistTicket,
|
||||
listAssistTickets,
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
getActiveAccount,
|
||||
setActiveAccount,
|
||||
} from "../../core/auth/account-store.js";
|
||||
import { createSessionClient } from "../../core/http/session-client.js";
|
||||
import { createSessionClient } from "../../core/http/hose-web-session-client.js";
|
||||
import { stringOption, booleanOption } from "../parser.js";
|
||||
import { printJson, printKeyValue, printTable, formatSourceLabel, formatExpiresAt } from "../printer.js";
|
||||
import { prompt } from "../helpers.js";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createSessionClient } from "../../../core/http/session-client.js";
|
||||
import { createSessionClient } from "../../../core/http/hose-web-session-client.js";
|
||||
import { resolveBillStaffIds } from "../../../domains/bill/tools.js";
|
||||
import { booleanOption, stringOption } from "../../parser.js";
|
||||
import { isDryRun, requireMutationConfirmation } from "../../mutation.js";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, it, expect } from "bun:test";
|
||||
import { parseHeadersOrCurl } from "../../core/auth/login.js";
|
||||
import { resolveCorpCluster } from "../../core/http/unity-client.js";
|
||||
import { resolveCorpCluster } from "../../core/http/unity-easo-client.js";
|
||||
import { handleCorpsCommand } from "./corps/index.js";
|
||||
import type { CliRuntime } from "../types.js";
|
||||
import type { CorpConfig } from "../../core/config/types.js";
|
||||
@@ -35,7 +35,7 @@ describe("core/auth/login > parseHeadersOrCurl & URL link parsing", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("core/http/unity-client > resolveCorpCluster", () => {
|
||||
describe("core/http/unity-easo-client > resolveCorpCluster", () => {
|
||||
it("prioritizes explicit cluster config", () => {
|
||||
expect(resolveCorpCluster({ cluster: "wx2", baseUrl: "https://app.ekuaibao.com" })).toBe("wx2");
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { loadCorpConfigs } from "../../../core/config/loader.js";
|
||||
import { createSessionClient } from "../../../core/http/session-client.js";
|
||||
import { createSessionClient } from "../../../core/http/hose-web-session-client.js";
|
||||
import { booleanOption, stringOption } from "../../parser.js";
|
||||
import { NotFoundError } from "../../../core/errors.js";
|
||||
import { formatSourceLabel, printJson, printTable } from "../../printer.js";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { CliParsedArgs, CliResult, CliRuntime } from "../types.js";
|
||||
import { printJson, printTable } from "../printer.js";
|
||||
import { numberOption, stringOption } from "../parser.js";
|
||||
import { createSessionClient } from "../../core/http/session-client.js";
|
||||
import { createSessionClient } from "../../core/http/hose-web-session-client.js";
|
||||
import { searchDimensions, resolveDimension } from "../../domains/dimension/tools.js";
|
||||
|
||||
export async function handleDimensionCommand(parsed: CliParsedArgs, runtime: CliRuntime): Promise<CliResult> {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { CliParsedArgs, CliResult, CliRuntime } from "../types.js";
|
||||
import { printJson, printTable } from "../printer.js";
|
||||
import { booleanOption, stringOption } from "../parser.js";
|
||||
import { createSessionClient } from "../../core/http/session-client.js";
|
||||
import { createSessionClient } from "../../core/http/hose-web-session-client.js";
|
||||
import {
|
||||
createFeeType,
|
||||
disableFeeTypeItem,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { describe, expect, it, spyOn, afterEach } from "bun:test";
|
||||
import { handleFlowCommand } from "./flow.js";
|
||||
import { handleBillCommand } from "./bill/index.js";
|
||||
import { findCommandByArea } from "../registry.js";
|
||||
import * as sessionModule from "../../core/http/session-client.js";
|
||||
import * as sessionModule from "../../core/http/hose-web-session-client.js";
|
||||
import type { CliRuntime } from "../types.js";
|
||||
import type { CorpConfig } from "../../core/config/types.js";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { booleanOption, numberOption, stringOption } from "../parser.js";
|
||||
import { printJson, printTable } from "../printer.js";
|
||||
import type { CliParsedArgs, CliResult, CliRuntime } from "../types.js";
|
||||
import { createSessionClient } from "../../core/http/session-client.js";
|
||||
import { createSessionClient } from "../../core/http/hose-web-session-client.js";
|
||||
import { filterMessages, listMessages, mergeMessages, readMessage } from "../../domains/message/tools.js";
|
||||
import type { MessageItem } from "../../domains/message/types.js";
|
||||
import { isDryRun, mutationPreview, requireMutationConfirmation } from "../mutation.js";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { printJson, printTable } from "../printer.js";
|
||||
import type { CliParsedArgs, CliResult, CliRuntime } from "../types.js";
|
||||
import { createSessionClient } from "../../core/http/session-client.js";
|
||||
import { createSessionClient } from "../../core/http/hose-web-session-client.js";
|
||||
import { getPermissions } from "../../domains/permission/tools.js";
|
||||
|
||||
export async function handlePermissionCommand(parsed: CliParsedArgs, runtime: CliRuntime): Promise<CliResult> {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { join } from "node:path";
|
||||
import * as services from "../../domains/platform/workflow/services.js";
|
||||
import * as billApi from "../../domains/bill/api.js";
|
||||
import * as cache from "../../core/cache/index.js";
|
||||
import * as session from "../../core/http/session-client.js";
|
||||
import * as session from "../../core/http/hose-web-session-client.js";
|
||||
import * as helpers from "../helpers.js";
|
||||
import * as workflowShared from "./workflow/shared.js";
|
||||
import * as platformShared from "./platform/shared.js";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { numberOption, stringOption } from "../parser.js";
|
||||
import { printJson, printTable } from "../printer.js";
|
||||
import type { CliParsedArgs, CliResult, CliRuntime } from "../types.js";
|
||||
import { createSessionClient } from "../../core/http/session-client.js";
|
||||
import { createSessionClient } from "../../core/http/hose-web-session-client.js";
|
||||
import { getRoleGroups, getRoleMembers, searchRoles } from "../../domains/role/tools.js";
|
||||
|
||||
export async function handleRoleCommand(parsed: CliParsedArgs, runtime: CliRuntime): Promise<CliResult> {
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
import { printJson, printKeyValue } from "../printer.js";
|
||||
import { numberOption, stringOption } from "../parser.js";
|
||||
import type { CliParsedArgs, CliResult, CliRuntime } from "../types.js";
|
||||
import { createSessionClient } from "../../core/http/session-client.js";
|
||||
import { createSessionClient } from "../../core/http/hose-web-session-client.js";
|
||||
import { EventStore } from "../../domains/events/store.js";
|
||||
import { pollEvents } from "../../domains/events/poller.js";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { CliParsedArgs, CliResult, CliRuntime } from "../types.js";
|
||||
import { booleanOption, numberOption, stringOption } from "../parser.js";
|
||||
import { printJson, printTable } from "../printer.js";
|
||||
import { createSessionClient } from "../../core/http/session-client.js";
|
||||
import { createSessionClient } from "../../core/http/hose-web-session-client.js";
|
||||
import { listTasks } from "../../domains/task/tools.js";
|
||||
import type { TaskView } from "../../domains/task/types.js";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { stringOption, numberOption } from "../../parser.js";
|
||||
import { printJson, printTable } from "../../printer.js";
|
||||
import type { CliParsedArgs, CliResult, CliRuntime } from "../../types.js";
|
||||
import { createSessionClient } from "../../../core/http/session-client.js";
|
||||
import { createSessionClient } from "../../../core/http/hose-web-session-client.js";
|
||||
import { getOutboundMessages, queryOutboundMessageLogs } from "../../../domains/platform/workflow/services.js";
|
||||
|
||||
function formatTime(timestamp: number | undefined): string {
|
||||
|
||||
@@ -89,6 +89,7 @@ export async function createScriptEngineClientForCorp(corp: CorpConfig, platform
|
||||
}
|
||||
|
||||
export const createPiperClientForCorp = createScriptEngineClientForCorp;
|
||||
export const createPiperWorkflowClientForCorp = createPiperClientForCorp;
|
||||
|
||||
export function requireSelectedCorp(
|
||||
runtime: CliRuntime,
|
||||
@@ -107,6 +108,9 @@ export async function getSessionClientForRuntime(runtime: CliRuntime) {
|
||||
return { corp, corpId, client };
|
||||
}
|
||||
|
||||
export const getHoseWebSessionClientForRuntime = getSessionClientForRuntime;
|
||||
|
||||
|
||||
export function prompt(question: string): Promise<string> {
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
|
||||
Reference in new issue
Block a user