refactor: 将应用数据与工作流统一归入应用平台子模块
建立 applications 的应用模型和查询出口,保留基础及详情投影差异。 下沉 DataLink,将工作流模型、API、编排及执行上下文归回 workflow。 同步 CLI、SDK、生成脚本、测试和活跃文档引用,公开命令与 SDK 名称保持兼容。 验证:943 项测试、类型和版本检查通过;三份生成规范字节一致,README 审计通过。
This commit is contained in:
1 parent
edf300b808
commit
4e03c9bcd7
107 files changed
+423
-496
No files matched your search
@@ -10,9 +10,9 @@
|
||||
| [workflow/](./workflow/README.workflow.md) | 工作流配置、节点、分析、调试与监听 |
|
||||
| [corps/](./corps/README.corps.md) | 企业名录、身份、凭证导入和切换 |
|
||||
| [assist-platform/](./assist-platform/README.assist-platform.md) | 协助平台登录、工单与代客身份 |
|
||||
| [platform/](./platform/) | 自建应用及业务对象命令 |
|
||||
| [aipro/](./aipro/) | AI PRO 会话、规则与状态处理 |
|
||||
| [update/](./update/) | 更新检查与执行 |
|
||||
| [platform/](./platform) | 自建应用及业务对象命令 |
|
||||
| [aipro/](./aipro) | AI PRO 会话、规则与状态处理 |
|
||||
| [update/](./update) | 更新检查与执行 |
|
||||
| `auth.ts`、`context.ts`、`config.ts`、`probe.ts` | 认证、当前上下文、配置与诊断 |
|
||||
| `contact.ts`、`dimension.ts`、`feetype.ts`、`role.ts`、`permission.ts` | 员工、档案、费用类型及权限相关业务 |
|
||||
| `task.ts`、`message.ts`、`store.ts`、`keys.ts` | 待办、消息、应用中心与密钥 |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { fetchWorkbenchAppsList } from "../../domains/menu/tools.js";
|
||||
import { getPlatform } from "../../domains/datalink/services.js";
|
||||
import { getPlatform } from "../../domains/platform/applications/services.js";
|
||||
import { createClientsForCorp } from "../helpers.js";
|
||||
import { stringOption, booleanOption } from "../parser.js";
|
||||
import { printJson, printTable } from "../printer.js";
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import * as servicesApplications from "../../domains/platform/applications/services.js";
|
||||
import * as apiApplications from "../../domains/platform/applications/api.js";
|
||||
import { describe, expect, it, spyOn, afterEach } from "bun:test";
|
||||
import { handlePlatformCommand } from "./platform/index.js";
|
||||
import * as api from "../../domains/datalink/api.js";
|
||||
import * as services from "../../domains/datalink/services.js";
|
||||
import * as api from "../../domains/platform/datalink/api.js";
|
||||
import * as services from "../../domains/platform/datalink/services.js";
|
||||
import * as helpers from "../helpers.js";
|
||||
import type { CliRuntime } from "../types.js";
|
||||
import type { CorpConfig } from "../../core/config/types.js";
|
||||
@@ -75,7 +77,7 @@ describe("CLI - platform 命令与 record 动作", () => {
|
||||
|
||||
it("records 正确解析嵌套 dataLink 的停启用状态和更新时间", async () => {
|
||||
spies.push(spyOn(helpers, "createClientsForCorp").mockResolvedValue({ ekbClient: {} } as any));
|
||||
spies.push(spyOn(services, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(servicesApplications, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(services, "resolveEntity").mockResolvedValue(mockEntity as any));
|
||||
spies.push(spyOn(api, "searchEntityRecords").mockResolvedValue({
|
||||
total: 2,
|
||||
@@ -107,7 +109,7 @@ describe("CLI - platform 命令与 record 动作", () => {
|
||||
|
||||
it("record get 获取记录详情", async () => {
|
||||
spies.push(spyOn(helpers, "createClientsForCorp").mockResolvedValue({ ekbClient: {} } as any));
|
||||
spies.push(spyOn(services, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(servicesApplications, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(services, "resolveEntity").mockResolvedValue(mockEntity as any));
|
||||
spies.push(spyOn(api, "getRecordDetail").mockResolvedValue({
|
||||
dataLink: {
|
||||
@@ -134,7 +136,7 @@ describe("CLI - platform 命令与 record 动作", () => {
|
||||
|
||||
it("record toggle 切换停启用状态", async () => {
|
||||
spies.push(spyOn(helpers, "createClientsForCorp").mockResolvedValue({ ekbClient: {} } as any));
|
||||
spies.push(spyOn(services, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(servicesApplications, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(services, "resolveEntity").mockResolvedValue(mockEntity as any));
|
||||
const toggleSpy = spyOn(api, "toggleRecordState").mockResolvedValue({ recordId: "r-1", active: true });
|
||||
spies.push(toggleSpy);
|
||||
@@ -151,7 +153,7 @@ describe("CLI - platform 命令与 record 动作", () => {
|
||||
|
||||
it("record edit 编辑字段", async () => {
|
||||
spies.push(spyOn(helpers, "createClientsForCorp").mockResolvedValue({ ekbClient: {} } as any));
|
||||
spies.push(spyOn(services, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(servicesApplications, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(services, "resolveEntity").mockResolvedValue(mockEntity as any));
|
||||
const editSpy = spyOn(api, "editRecord").mockResolvedValue({ id: "r-1" } as any);
|
||||
spies.push(editSpy);
|
||||
@@ -182,7 +184,7 @@ describe("CLI - platform 命令与 record 动作", () => {
|
||||
|
||||
it("record recompute 触发台账重算", async () => {
|
||||
spies.push(spyOn(helpers, "createClientsForCorp").mockResolvedValue({ ekbClient: {} } as any));
|
||||
spies.push(spyOn(services, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(servicesApplications, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(services, "resolveEntity").mockResolvedValue(mockEntity as any));
|
||||
const recomputeSpy = spyOn(api, "recomputeRecordLedger").mockResolvedValue({ id: "ok" });
|
||||
spies.push(recomputeSpy);
|
||||
@@ -210,7 +212,7 @@ describe("CLI - platform 命令与 record 动作", () => {
|
||||
},
|
||||
})
|
||||
);
|
||||
spies.push(spyOn(api, "listPlatforms").mockResolvedValue([mockPlatform] as any));
|
||||
spies.push(spyOn(apiApplications, "listPlatforms").mockResolvedValue([mockPlatform] as any));
|
||||
spies.push(spyOn(api, "listPlatformEntities").mockResolvedValue([mockEntity] as any));
|
||||
|
||||
const res = await handlePlatformCommand(
|
||||
@@ -225,7 +227,7 @@ describe("CLI - platform 命令与 record 动作", () => {
|
||||
|
||||
it("record batch-edit --dry-run 生成安全合并预览且不发送真实写请求", async () => {
|
||||
spies.push(spyOn(helpers, "createClientsForCorp").mockResolvedValue({ ekbClient: {} } as any));
|
||||
spies.push(spyOn(services, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(servicesApplications, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(services, "resolveEntity").mockResolvedValue(mockEntity as any));
|
||||
spies.push(
|
||||
spyOn(api, "getRecordDetail").mockResolvedValue({
|
||||
@@ -258,7 +260,7 @@ describe("CLI - platform 命令与 record 动作", () => {
|
||||
|
||||
it("platform records 支持 --sum 数学核算与 --group-by 分组统计", async () => {
|
||||
spies.push(spyOn(helpers, "createClientsForCorp").mockResolvedValue({ ekbClient: {} } as any));
|
||||
spies.push(spyOn(services, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(servicesApplications, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(services, "resolveEntity").mockResolvedValue({
|
||||
...mockEntity,
|
||||
fields: [
|
||||
@@ -301,7 +303,7 @@ describe("CLI - platform 命令与 record 动作", () => {
|
||||
|
||||
it("platform audit 支持 --check-continuous 与 --expect 基线离群诊断", async () => {
|
||||
spies.push(spyOn(helpers, "createClientsForCorp").mockResolvedValue({ ekbClient: {} } as any));
|
||||
spies.push(spyOn(services, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(servicesApplications, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(services, "resolveEntity").mockResolvedValue({
|
||||
...mockEntity,
|
||||
fields: [
|
||||
@@ -344,7 +346,7 @@ describe("CLI - platform 命令与 record 动作", () => {
|
||||
|
||||
it("platform update 支持 --where 声明式筛选与 --set 原地修改(含 --dry-run 与 --yes)", async () => {
|
||||
spies.push(spyOn(helpers, "createClientsForCorp").mockResolvedValue({ ekbClient: {} } as any));
|
||||
spies.push(spyOn(services, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(servicesApplications, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(services, "resolveEntity").mockResolvedValue({
|
||||
...mockEntity,
|
||||
fields: [
|
||||
@@ -408,7 +410,7 @@ describe("CLI - platform 命令与 record 动作", () => {
|
||||
|
||||
it("platform records 支持 --stats 画像统计(计算状态、重名与编码聚类)", async () => {
|
||||
spies.push(spyOn(helpers, "createClientsForCorp").mockResolvedValue({ ekbClient: {} } as any));
|
||||
spies.push(spyOn(services, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(servicesApplications, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(services, "resolveEntity").mockResolvedValue(mockEntity as any));
|
||||
spies.push(
|
||||
spyOn(api, "searchEntityRecords").mockResolvedValue({
|
||||
@@ -463,7 +465,7 @@ describe("CLI - platform 命令与 record 动作", () => {
|
||||
|
||||
it("platform records 支持 --ndjson 流式逐行下发与 --flat 归一化", async () => {
|
||||
spies.push(spyOn(helpers, "createClientsForCorp").mockResolvedValue({ ekbClient: {} } as any));
|
||||
spies.push(spyOn(services, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(servicesApplications, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(services, "resolveEntity").mockResolvedValue(mockEntity as any));
|
||||
spies.push(
|
||||
spyOn(api, "searchEntityRecords").mockResolvedValue({
|
||||
@@ -516,7 +518,7 @@ describe("CLI - platform 命令与 record 动作", () => {
|
||||
|
||||
it("platform records --all 拒绝直接全量输出,要求分页或流式文件", async () => {
|
||||
spies.push(spyOn(helpers, "createClientsForCorp").mockResolvedValue({ ekbClient: {} } as any));
|
||||
spies.push(spyOn(services, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(servicesApplications, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(services, "resolveEntity").mockResolvedValue(mockEntity as any));
|
||||
await expect(
|
||||
handlePlatformCommand(
|
||||
@@ -528,7 +530,7 @@ describe("CLI - platform 命令与 record 动作", () => {
|
||||
|
||||
it("rejects malformed batch predicates before fetching all records or calling the writer", async () => {
|
||||
spies.push(spyOn(helpers, "createClientsForCorp").mockResolvedValue({ ekbClient: {} } as any));
|
||||
spies.push(spyOn(services, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(servicesApplications, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(services, "resolveEntity").mockResolvedValue(mockEntity as any));
|
||||
const fetch = spyOn(services, "fetchAllEntityRecords").mockResolvedValue({ data: [], total: 0 } as any);
|
||||
const write = spyOn(services, "batchSafeEditRecords").mockResolvedValue([]);
|
||||
@@ -540,7 +542,7 @@ describe("CLI - platform 命令与 record 动作", () => {
|
||||
|
||||
it("platform gen-props 生成 MVEL 和 JS 格式的字段模板", async () => {
|
||||
spies.push(spyOn(helpers, "createClientsForCorp").mockResolvedValue({ ekbClient: {} } as any));
|
||||
spies.push(spyOn(services, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(servicesApplications, "resolvePlatform").mockResolvedValue(mockPlatform as any));
|
||||
spies.push(spyOn(services, "resolveEntity").mockResolvedValue({
|
||||
id: "E_contract",
|
||||
name: "合同",
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import {
|
||||
getImportResult,
|
||||
listImportJobs,
|
||||
listAllPlatforms,
|
||||
listPlatformEntities,
|
||||
listPlatforms,
|
||||
} from "../../../domains/datalink/services.js";
|
||||
import { getImportResult, listImportJobs, listPlatformEntities } from "../../../domains/platform/datalink/services.js";
|
||||
import { listAllPlatforms, listPlatforms } from "../../../domains/platform/applications/services.js";
|
||||
import { createClientsForCorp } from "../../helpers.js";
|
||||
import { booleanOption, stringOption } from "../../parser.js";
|
||||
import { printJson, printTable } from "../../printer.js";
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
toggleRecordState,
|
||||
type BatchEditTargetItem,
|
||||
type SafeRecordEditOptions,
|
||||
} from "../../../domains/datalink/services.js";
|
||||
} from "../../../domains/platform/datalink/services.js";
|
||||
import { createClientsForCorp } from "../../helpers.js";
|
||||
import { booleanOption, numberOption, stringOption } from "../../parser.js";
|
||||
import { printJson, printTable } from "../../printer.js";
|
||||
|
||||
@@ -12,9 +12,9 @@ import {
|
||||
parseExpectClause,
|
||||
searchEntityRecords,
|
||||
selectRecordFields,
|
||||
} from "../../../domains/datalink/services.js";
|
||||
import type { DatalinkRecord } from "../../../domains/datalink/types.js";
|
||||
import type { LedgerContinuityReport } from "../../../domains/datalink/types.js";
|
||||
} from "../../../domains/platform/datalink/services.js";
|
||||
import type { DatalinkRecord } from "../../../domains/platform/datalink/types.js";
|
||||
import type { LedgerContinuityReport } from "../../../domains/platform/datalink/types.js";
|
||||
import { booleanOption, numberOption, stringOption } from "../../parser.js";
|
||||
import { printJson, printTable, printKeyValue, redactSensitiveText } from "../../printer.js";
|
||||
import { usageError } from "../../errors.js";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { resolveEntity, resolvePlatform } from "../../../domains/datalink/services.js";
|
||||
import { resolveEntity } from "../../../domains/platform/datalink/services.js";
|
||||
import { resolvePlatform } from "../../../domains/platform/applications/services.js";
|
||||
import { createClientsForCorp } from "../../helpers.js";
|
||||
import type { CliParsedArgs, CliRuntime } from "../../types.js";
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import * as apiApplications from "../../domains/platform/applications/services.js";
|
||||
import { canRefreshCorpAccessToken, hasOpenApiPersistentCredentials } from "../../core/auth/login.js";
|
||||
import { createSessionClient, getEasoClient } from "../../core/http/index.js";
|
||||
import * as api from "../../domains/platform/services.js";
|
||||
import * as api from "../../domains/platform/workflow/services.js";
|
||||
import { printJson, printKeyValue, formatSourceLabel, formatExpiresAt, formatCorpEnvLabel } from "../printer.js";
|
||||
import type { CliParsedArgs, CliResult, CliRuntime } from "../types.js";
|
||||
|
||||
@@ -93,7 +94,7 @@ export async function handleProbeCommand(
|
||||
let platforms: any[] = [];
|
||||
if (sessionClient) {
|
||||
try {
|
||||
platforms = await api.listPlatforms(sessionClient, currentCorp.credentials.corpId);
|
||||
platforms = await apiApplications.listBasicPlatforms(sessionClient, currentCorp.credentials.corpId);
|
||||
results.platformAccess = {
|
||||
status: "ok",
|
||||
totalPlatforms: platforms.length,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { afterEach, describe, expect, it, spyOn } from "bun:test";
|
||||
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import * as services from "../../domains/platform/services.js";
|
||||
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";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { afterEach, describe, expect, it, spyOn } from "bun:test";
|
||||
import { handleWorkflowTest } from "./workflow/test.js";
|
||||
import * as shared from "./workflow/shared.js";
|
||||
import * as services from "../../domains/platform/services.js";
|
||||
import * as services from "../../domains/platform/workflow/services.js";
|
||||
import type { CliParsedArgs, CliRuntime } from "../types.js";
|
||||
import type { WorkflowTestReport } from "../../domains/platform/types.js";
|
||||
import type { WorkflowTestReport } from "../../domains/platform/workflow/types.js";
|
||||
|
||||
const runtime = {
|
||||
selectedCorp: { id: "mock-corp", name: "Mock测试企业", env: "test", isTest: true } as any,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { expect, spyOn, test } from "bun:test";
|
||||
import { parseArgs } from "../parser.js";
|
||||
import { handleWorkflowCommand } from "./workflow/index.js";
|
||||
import * as services from "../../domains/platform/services.js";
|
||||
import * as services from "../../domains/platform/workflow/services.js";
|
||||
|
||||
test("node grant previews without a gateway call and requires explicit confirmation", async () => {
|
||||
const runtime = { selectedCorp: { id: "corp", credentials: { corpId: "corp" } }, jsonMode: true } as any;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { expect, spyOn, test } from "bun:test";
|
||||
import { handleWorkflowCommand } from "./workflow/index.js";
|
||||
import { parseArgs } from "../parser.js";
|
||||
import * as services from "../../domains/platform/services.js";
|
||||
import * as services from "../../domains/platform/workflow/services.js";
|
||||
test("failed grants retain gateway details and never report success", async () => {
|
||||
const grant = spyOn(services, "grantWorkflowNodes").mockResolvedValue({ success: false, saved: [], skipped: [], rawMessage: "permission denied" });
|
||||
try {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, it, spyOn, afterEach } from "bun:test";
|
||||
import { handleWorkflowCommand } from "./workflow/index.js";
|
||||
import * as services from "../../domains/platform/services.js";
|
||||
import * as api from "../../domains/platform/api.js";
|
||||
import * as services from "../../domains/platform/workflow/services.js";
|
||||
import * as api from "../../domains/platform/workflow/api.js";
|
||||
import * as helpers from "../helpers.js";
|
||||
import type { CliRuntime } from "../types.js";
|
||||
import type { CorpConfig } from "../../core/config/types.js";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, it, spyOn, afterEach } from "bun:test";
|
||||
import { handleWorkflowCommand } from "./workflow/index.js";
|
||||
import * as helpers from "../helpers.js";
|
||||
import * as platformServices from "../../domains/platform/services.js";
|
||||
import * as platformServices from "../../domains/platform/workflow/services.js";
|
||||
import type { CliRuntime } from "../types.js";
|
||||
import type { CorpConfig } from "../../core/config/types.js";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getWorkflowDetail, getWorkflowAvailableNodes } from "../../../domains/platform/services.js";
|
||||
import { getWorkflowDetail, getWorkflowAvailableNodes } from "../../../domains/platform/workflow/services.js";
|
||||
import {
|
||||
analyzeWorkflow,
|
||||
extractWorkflowSpecificationIds,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { listAllWorkflows, listWorkflowLogs } from "../../../domains/platform/services.js";
|
||||
import { listAllWorkflows, listWorkflowLogs } from "../../../domains/platform/workflow/services.js";
|
||||
import { WorkflowAlertStore } from "../../../domains/platform/workflow/alert/index.js";
|
||||
import { stringOption, numberOption, booleanOption } from "../../parser.js";
|
||||
import { createClientsForCorp, createPiperClientForCorp } from "../../helpers.js";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { copyWorkflow, getWorkflowDetail } from "../../../domains/platform/services.js";
|
||||
import { copyWorkflow, getWorkflowDetail } from "../../../domains/platform/workflow/services.js";
|
||||
import { stringOption } from "../../parser.js";
|
||||
import { printJson, printKeyValue } from "../../printer.js";
|
||||
import { isDryRun, mutationPreview, requireMutationConfirmation } from "../../mutation.js";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createWorkflow } from "../../../domains/platform/services.js";
|
||||
import { createWorkflow } from "../../../domains/platform/workflow/services.js";
|
||||
import { stringOption } from "../../parser.js";
|
||||
import { printJson, printKeyValue } from "../../printer.js";
|
||||
import { isDryRun, mutationPreview, requireMutationConfirmation } from "../../mutation.js";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { deleteWorkflow, getWorkflowDetail } from "../../../domains/platform/services.js";
|
||||
import { deleteWorkflow, getWorkflowDetail } from "../../../domains/platform/workflow/services.js";
|
||||
import { stringOption } from "../../parser.js";
|
||||
import { printJson } from "../../printer.js";
|
||||
import { isDryRun, mutationPreview, requireMutationConfirmation } from "../../mutation.js";
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
getJob,
|
||||
getJobExecutionTree,
|
||||
getWorkflowSnapshot,
|
||||
} from "../../../domains/platform/services.js";
|
||||
} from "../../../domains/platform/workflow/services.js";
|
||||
import { stringOption } from "../../parser.js";
|
||||
import { printJson, printTable } from "../../printer.js";
|
||||
import type { CliParsedArgs, CliResult, CliRuntime } from "../../types.js";
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { readFileSync, writeFileSync } from "node:fs";
|
||||
import { EkbError } from "../../../core/errors.js";
|
||||
import { getWorkflowDetail, listAllWorkflows, refreshWorkflowChooses, updateWorkflow } from "../../../domains/platform/services.js";
|
||||
import { getWorkflowDetail, listAllWorkflows, refreshWorkflowChooses, updateWorkflow } from "../../../domains/platform/workflow/services.js";
|
||||
import { WorkflowSavePartialError } from "../../../domains/platform/workflow/save-error.js";
|
||||
import { WorkflowDetailSchema } from "../../../domains/platform/types.js";
|
||||
import { WorkflowDetailSchema } from "../../../domains/platform/workflow/types.js";
|
||||
import {
|
||||
applyWorkflowPathPatch,
|
||||
beginWorkflowSave,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
resolveWorkflowEnumOptions,
|
||||
SYSTEM_WORKFLOW_ACTION_ENUMS,
|
||||
} from "../../../domains/platform/services.js";
|
||||
} from "../../../domains/platform/workflow/services.js";
|
||||
import { stringOption } from "../../parser.js";
|
||||
import { printJson, printTable, printKeyValue } from "../../printer.js";
|
||||
import type { CliParsedArgs, CliResult, CliRuntime } from "../../types.js";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getWorkflowDetail, listWorkflowLogs, listWorkflowSnapshots } from "../../../domains/platform/services.js";
|
||||
import { getWorkflowDetail, listWorkflowLogs, listWorkflowSnapshots } from "../../../domains/platform/workflow/services.js";
|
||||
import { stringOption, numberOption, booleanOption } from "../../parser.js";
|
||||
import { printJson, printTable, printKeyValue } from "../../printer.js";
|
||||
import type { CliParsedArgs, CliResult, CliRuntime } from "../../types.js";
|
||||
|
||||
@@ -1,18 +1,6 @@
|
||||
import {
|
||||
extractFailureExecutions,
|
||||
findExecutionNode,
|
||||
flattenExecutionTree,
|
||||
getExecutionLogs,
|
||||
getJob,
|
||||
getJobExecutionLevel,
|
||||
getJobExecutionTree,
|
||||
getJobFailedExecutions,
|
||||
getWorkflowDetail,
|
||||
isTaskExecutionFailed,
|
||||
listPlatforms,
|
||||
explainConditionBranches,
|
||||
} from "../../../domains/platform/services.js";
|
||||
import type { WorkflowTaskExecution } from "../../../domains/platform/types.js";
|
||||
import { extractFailureExecutions, findExecutionNode, flattenExecutionTree, getExecutionLogs, getJob, getJobExecutionLevel, getJobExecutionTree, getJobFailedExecutions, getWorkflowDetail, isTaskExecutionFailed, explainConditionBranches } from "../../../domains/platform/workflow/services.js";
|
||||
import { listBasicPlatforms as listPlatforms } from "../../../domains/platform/applications/services.js";
|
||||
import type { WorkflowTaskExecution } from "../../../domains/platform/workflow/types.js";
|
||||
import { stringOption, numberOption, booleanOption } from "../../parser.js";
|
||||
import { createClientsForCorp, createPiperClientForCorp } from "../../helpers.js";
|
||||
import { printJson, printTable, printKeyValue } from "../../printer.js";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { toggleWorkflow } from "../../../domains/platform/services.js";
|
||||
import { toggleWorkflow } from "../../../domains/platform/workflow/services.js";
|
||||
import { stringOption } from "../../parser.js";
|
||||
import { printJson } from "../../printer.js";
|
||||
import { isDryRun, mutationPreview, requireMutationConfirmation } from "../../mutation.js";
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
findWorkflowsByTaskType,
|
||||
getWorkflowDetail,
|
||||
listAllWorkflows,
|
||||
} from "../../../domains/platform/services.js";
|
||||
} from "../../../domains/platform/workflow/services.js";
|
||||
import { stringOption, numberOption, booleanOption } from "../../parser.js";
|
||||
import { createClientsForCorp } from "../../helpers.js";
|
||||
import { printJson, printTable, printKeyValue } from "../../printer.js";
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
applyNodeMapping,
|
||||
getWorkflowAvailableNodes,
|
||||
grantWorkflowNodes,
|
||||
} from "../../../domains/platform/services.js";
|
||||
} from "../../../domains/platform/workflow/services.js";
|
||||
import {
|
||||
GRAY_NODES_CATALOG,
|
||||
findGrayNode,
|
||||
|
||||
@@ -8,7 +8,7 @@ import { parseArgs } from "../../parser.js";
|
||||
import { cliErrorResult } from "../../runner.js";
|
||||
import { normalizeCliArgs, tokenizeCommand } from "../../../server.js";
|
||||
import { handleWorkflowCommand } from "./index.js";
|
||||
import { WorkflowDetailSchema } from "../../../domains/platform/types.js";
|
||||
import { WorkflowDetailSchema } from "../../../domains/platform/workflow/types.js";
|
||||
import { WorkflowSavePartialError } from "../../../domains/platform/workflow/save-error.js";
|
||||
import type { CliRuntime } from "../../types.js";
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { tmpdir } from "node:os";
|
||||
import { parseArgs } from "../../parser.js";
|
||||
import { handleWorkflowLintScript, handleWorkflowEvalScript } from "./script.js";
|
||||
import * as shared from "./shared.js";
|
||||
import * as services from "../../../domains/platform/services.js";
|
||||
import * as services from "../../../domains/platform/workflow/services.js";
|
||||
|
||||
test("all local and remote script JSON branches return reports and honor output files", async () => {
|
||||
const client = spyOn(shared, "createWorkflowDetailClient").mockResolvedValue({ client: {} } as any);
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
lintMvelCode,
|
||||
executeJavaScriptSandbox,
|
||||
executeMvelSandbox,
|
||||
} from "../../../domains/platform/services.js";
|
||||
} from "../../../domains/platform/workflow/services.js";
|
||||
import { stringOption, booleanOption } from "../../parser.js";
|
||||
import { printJson, printKeyValue } from "../../printer.js";
|
||||
import type { CliParsedArgs, CliResult, CliRuntime } from "../../types.js";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { flattenExecutionTree, listAllWorkflows } from "../../../domains/platform/services.js";
|
||||
import { flattenExecutionTree, listAllWorkflows } from "../../../domains/platform/workflow/services.js";
|
||||
import { stringOption } from "../../parser.js";
|
||||
import { createClientsForCorp, createPiperClientForCorp } from "../../helpers.js";
|
||||
import type { CliParsedArgs, CliRuntime } from "../../types.js";
|
||||
@@ -31,7 +31,7 @@ export async function createWorkflowDetailClient(
|
||||
if (!platformId) {
|
||||
try {
|
||||
const corpId = runtime.selectedCorp!.corpId || runtime.selectedCorp!.id;
|
||||
const { listPlatforms } = await import("../../../domains/platform/services.js");
|
||||
const { listBasicPlatforms: listPlatforms } = await import("../../../domains/platform/applications/services.js");
|
||||
const platforms = await listPlatforms(clients.ekbClient, corpId);
|
||||
const firstActive = platforms.find((p) => p.active) ?? platforms[0];
|
||||
platformId = firstActive?.id;
|
||||
@@ -58,7 +58,7 @@ export async function createJobPiperClient(
|
||||
const clients = await createClientsForCorp(corp);
|
||||
try {
|
||||
const corpId = corp.corpId || corp.id;
|
||||
const { listPlatforms } = await import("../../../domains/platform/services.js");
|
||||
const { listBasicPlatforms: listPlatforms } = await import("../../../domains/platform/applications/services.js");
|
||||
const platforms = await listPlatforms(clients.ekbClient, corpId);
|
||||
const firstActive = platforms.find((p) => p.active) ?? platforms[0];
|
||||
if (firstActive?.id) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { expect, test } from "bun:test";
|
||||
import { extractCodeNodeSummaries } from "./shared.js";
|
||||
import { flattenExecutionTree } from "../../../domains/platform/services.js";
|
||||
import { flattenExecutionTree } from "../../../domains/platform/workflow/services.js";
|
||||
|
||||
test("test and job summaries retain nested execution containers and repeated loop executions", () => {
|
||||
const tree = [{ id: "loop", type: "every", children: [
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
watchWorkflowPipeline,
|
||||
formatWatchEvent,
|
||||
type WorkflowWatchEvent,
|
||||
} from "../../../domains/platform/services.js";
|
||||
} from "../../../domains/platform/workflow/services.js";
|
||||
import { stringOption, numberOption, booleanOption } from "../../parser.js";
|
||||
import { printJson } from "../../printer.js";
|
||||
import type { CliParsedArgs, CliResult, CliRuntime } from "../../types.js";
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
getWorkflowSampleData,
|
||||
runWorkflowDebugTest,
|
||||
type WorkflowTriggerCategory,
|
||||
} from "../../../domains/platform/services.js";
|
||||
} from "../../../domains/platform/workflow/services.js";
|
||||
import { stringOption, booleanOption, numberOption } from "../../parser.js";
|
||||
import { printJson, printTable, printKeyValue } from "../../printer.js";
|
||||
import type { CliParsedArgs, CliResult, CliRuntime } from "../../types.js";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, it, spyOn, afterEach } from "bun:test";
|
||||
import { handleWebhookCommand } from "./webhook.js";
|
||||
import * as shared from "./shared.js";
|
||||
import * as services from "../../../domains/platform/services.js";
|
||||
import * as services from "../../../domains/platform/workflow/services.js";
|
||||
import type { CliParsedArgs, CliRuntime } from "../../types.js";
|
||||
|
||||
function createMockRuntime(overrides: Partial<CliRuntime> = {}): CliRuntime {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { existsSync, readFileSync } from "node:fs";
|
||||
import ky from "ky";
|
||||
import { getWorkflowDetail } from "../../../domains/platform/services.js";
|
||||
import { getWorkflowDetail } from "../../../domains/platform/workflow/services.js";
|
||||
import { getBillByCodeOrId } from "../../../domains/bill/tools.js";
|
||||
import { stringOption } from "../../parser.js";
|
||||
import { printJson, printKeyValue } from "../../printer.js";
|
||||
|
||||
@@ -9,7 +9,7 @@ import { createServer, HOSE_CLI_TOOL_NAME } from "../server.js";
|
||||
import { startHttpServer } from "../http/server.js";
|
||||
import * as helpers from "./helpers.js";
|
||||
import * as shared from "./commands/platform/shared.js";
|
||||
import * as records from "../domains/datalink/services.js";
|
||||
import * as records from "../domains/platform/datalink/services.js";
|
||||
|
||||
describe("NDJSON output destinations across CLI, MCP and HTTP", () => {
|
||||
const spies: Array<{ mockRestore(): void }> = [];
|
||||
|
||||
Reference in new issue
Block a user