收紧后端 TypeScript:统一 Json 类型与 TaskContext 契约
关闭 allowJs;集中 JsonObject 定义并替换分散 any 别名;parseTaskContext 返回 TaskContext;任务详情 API 标注 AdminTaskDetailView;测试减少 as any。
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
isClaimUidMatched,
|
||||
normalizeClaimUid,
|
||||
} from "../../claim/claim-identity.js";
|
||||
import { asJsonObject } from "../../../types/json.js";
|
||||
import {
|
||||
normalizeKuaishouCloudFlow,
|
||||
normalizeKuaishouCloudRoleInfo,
|
||||
@@ -26,13 +27,9 @@ export async function syncKuaishouCloudRoleInfoBeforeDispatch(
|
||||
String(input.errorCodePrefix || "kuaishou_cloud").trim() ||
|
||||
"kuaishou_cloud";
|
||||
const cloudContext =
|
||||
input.cloudContext && typeof input.cloudContext === "object"
|
||||
? input.cloudContext
|
||||
: {};
|
||||
asJsonObject(input.cloudContext);
|
||||
const taskContext =
|
||||
input.taskContext && typeof input.taskContext === "object"
|
||||
? input.taskContext
|
||||
: {};
|
||||
asJsonObject(input.taskContext);
|
||||
const flow = normalizeKuaishouCloudFlow(
|
||||
input.flow || taskContext.kuaishouCloudFulfillment
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user