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
@@ -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";
|
||||
|
||||
Reference in new issue
Block a user