继续收紧 TypeScript:ClaimIdentity 契约与 flow 出口类型
- 新增 types/claim-identity,统一 ClaimIdentity / Payload / AdminSummary - 导出 KuaishouCloudFlow、KuaishouFeifeiFlow 作为 normalize 出口 - 生产路径 JsonObject 统一从 types/json 导入,去掉 rebind as any - 前后端 claimIdentity 类型字段对齐
This commit is contained in:
@@ -207,7 +207,28 @@ export async function syncKuaishouFeifeiTaskStatus(task: TaskRow) {
|
||||
return updatedTask || task
|
||||
}
|
||||
|
||||
export function normalizeKuaishouFeifeiFlow(value: unknown) {
|
||||
/** normalizeKuaishouFeifeiFlow 出口类型 */
|
||||
export type KuaishouFeifeiFlow = {
|
||||
flowType: 'kuaishou_feifei'
|
||||
productCode: string
|
||||
productName: string
|
||||
platformOrderNo: string
|
||||
orderNo: string
|
||||
rechargeStatus: number
|
||||
rechargeStatusLabel: string
|
||||
rechargeResultMessage: string
|
||||
claimUrl: string
|
||||
consumeStatus: string
|
||||
shortLink: ReturnType<typeof normalizeShortLinkPayload>
|
||||
h5: {
|
||||
entryUrl: string
|
||||
rechargeUrl: string
|
||||
}
|
||||
lastSyncedAt: unknown
|
||||
raw: unknown
|
||||
}
|
||||
|
||||
export function normalizeKuaishouFeifeiFlow(value: unknown): KuaishouFeifeiFlow {
|
||||
const source = value && typeof value === 'object' && !Array.isArray(value)
|
||||
? value as JsonObject
|
||||
: {}
|
||||
@@ -270,7 +291,7 @@ export function resolveKuaishouFeifeiH5UrlWithTaskUid(
|
||||
}
|
||||
|
||||
function mergeKuaishouFeifeiOrder(
|
||||
flow: ReturnType<typeof normalizeKuaishouFeifeiFlow>,
|
||||
flow: KuaishouFeifeiFlow,
|
||||
order: Awaited<ReturnType<typeof createKuaishouFeifeiOrder>>,
|
||||
patch: {
|
||||
platformOrderNo?: string
|
||||
@@ -299,7 +320,7 @@ function mergeKuaishouFeifeiOrder(
|
||||
}
|
||||
|
||||
function resolveKuaishouFeifeiDirectClaimUrl(
|
||||
flow: ReturnType<typeof normalizeKuaishouFeifeiFlow>,
|
||||
flow: KuaishouFeifeiFlow,
|
||||
) {
|
||||
const h5ClaimUrl = flow.h5.rechargeUrl || flow.h5.entryUrl
|
||||
if (h5ClaimUrl) {
|
||||
|
||||
Reference in New Issue
Block a user