增强后端 TypeScript 严格类型检查

This commit is contained in:
yml2213
2026-05-26 10:07:19 +08:00
parent 6d9f267593
commit a2bce8b272
14 changed files with 66 additions and 31 deletions
@@ -109,6 +109,10 @@ export function resolveOrderItemSyncPlan(
if (matchedIndex >= 0) {
const matched = unmatchedExisting.splice(matchedIndex, 1)[0]
if (!matched) {
creates.push(item)
continue
}
updates.push({
orderItemId: matched.id,
item,
+13 -12
View File
@@ -195,18 +195,19 @@ export async function updateTask(taskId: number | string, patch: TaskUpdatePatch
)
if (containsRuntimeContextPatch(patch)) {
await upsertTaskRuntimeContextWithClient(client, Number(taskId), {
runtimeSessionId: patch.runtime_session_id,
loginType: patch.login_type,
nickname: patch.nickname,
roleId: patch.role_id,
roleName: patch.role_name,
area: patch.area,
partitionName: patch.partition_name,
screenshotPath: patch.screenshot_path,
artifactsJson: patch.artifacts_json,
stateJson: patch.state_json,
}, patch.updated_at || current.updated_at)
const runtimeContextPatch: TaskRuntimeContextPatch = {}
if (patch.runtime_session_id !== undefined) runtimeContextPatch.runtimeSessionId = patch.runtime_session_id
if (patch.login_type !== undefined) runtimeContextPatch.loginType = patch.login_type
if (patch.nickname !== undefined) runtimeContextPatch.nickname = patch.nickname
if (patch.role_id !== undefined) runtimeContextPatch.roleId = patch.role_id
if (patch.role_name !== undefined) runtimeContextPatch.roleName = patch.role_name
if (patch.area !== undefined) runtimeContextPatch.area = patch.area
if (patch.partition_name !== undefined) runtimeContextPatch.partitionName = patch.partition_name
if (patch.screenshot_path !== undefined) runtimeContextPatch.screenshotPath = patch.screenshot_path
if (patch.artifacts_json !== undefined) runtimeContextPatch.artifactsJson = patch.artifacts_json
if (patch.state_json !== undefined) runtimeContextPatch.stateJson = patch.state_json
await upsertTaskRuntimeContextWithClient(client, Number(taskId), runtimeContextPatch, patch.updated_at || current.updated_at)
}
return getTaskByIdWithExecutor(client.query.bind(client) as TaskQueryExecutor, taskId)