style: 修复 pre-push Prettier 格式检查失败
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
import path from 'node:path'
|
||||
import process from 'node:process'
|
||||
|
||||
import type {
|
||||
AdminDefaultUser,
|
||||
RuntimeConfig,
|
||||
} from '../types/runtime-config.js'
|
||||
import type { AdminDefaultUser, RuntimeConfig } from '../types/runtime-config.js'
|
||||
import { parseBoolean, parseInteger, parseJsonArray } from './runtime-env.js'
|
||||
import { deepMerge } from './runtime-merge.js'
|
||||
|
||||
@@ -204,7 +201,6 @@ function adminUsersJsonEnv(env: string, configPath: RuntimeConfigPath): EnvOverr
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function affiliateDashSkuMappingEnv(env: string, configPath: RuntimeConfigPath): EnvOverride {
|
||||
return {
|
||||
env,
|
||||
|
||||
@@ -314,10 +314,7 @@ export async function completeAdminTaskManualDispatch(
|
||||
): Promise<AdminTaskManualDispatchResponse> {
|
||||
const task = await getRequiredTask(taskId)
|
||||
|
||||
if (
|
||||
!isManualDispatchTask(task) &&
|
||||
!isRetiredFulfillmentExecutor(task.executor_key)
|
||||
) {
|
||||
if (!isManualDispatchTask(task) && !isRetiredFulfillmentExecutor(task.executor_key)) {
|
||||
throw createHttpError('当前任务不是人工履约任务', {
|
||||
statusCode: 409,
|
||||
errorCode: 'admin_task_not_manual_dispatch',
|
||||
|
||||
@@ -167,7 +167,10 @@ function buildRetiredClaimDetailPayload({ claimToken, task, order, orderItem }:
|
||||
return {
|
||||
tokenStatus: claimToken.status,
|
||||
claimUrl: buildClaimUrl(claimToken.token),
|
||||
flowType: executorKey === 'kuaishou_feifei' ? ('kuaishou_feifei' as const) : ('kuaishou_cloud' as const),
|
||||
flowType:
|
||||
executorKey === 'kuaishou_feifei'
|
||||
? ('kuaishou_feifei' as const)
|
||||
: ('kuaishou_cloud' as const),
|
||||
channelOffline: true,
|
||||
channelOfflineMessage: offlineMessage,
|
||||
claimIdentity,
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import { getFulfillmentProfileByKey } from '../../repositories/fulfillment-profile-repo.js'
|
||||
import type { JsonObject } from '../../types/json.js'
|
||||
import type { OrderItemRow, OrderRow } from '../../types/repository/rows.js'
|
||||
import {
|
||||
FULFILLMENT_EXECUTOR_KEYS,
|
||||
isAffiliateDashExecutor,
|
||||
} from './executors/types.js'
|
||||
import { FULFILLMENT_EXECUTOR_KEYS, isAffiliateDashExecutor } from './executors/types.js'
|
||||
|
||||
export type FulfillmentBindingLike = {
|
||||
id: number
|
||||
|
||||
@@ -157,9 +157,7 @@ test('resolveFulfillmentRoute 指定匹配命中但商品不可用时回退人
|
||||
const result = resolveFulfillmentRoute({
|
||||
productName: '幸运币90个',
|
||||
preferredExecutorKey: 'affiliate_dash',
|
||||
candidates: [
|
||||
{ executorKey: 'affiliate_dash', available: false, reason: '未命中 sku 映射' },
|
||||
],
|
||||
candidates: [{ executorKey: 'affiliate_dash', available: false, reason: '未命中 sku 映射' }],
|
||||
config: normalizeFulfillmentRoutingConfig({}),
|
||||
})
|
||||
|
||||
|
||||
@@ -7,38 +7,38 @@
|
||||
export const AFFILIATE_DASH_SKU_MAPPING: Readonly<Record<string, string>> = Object.freeze({
|
||||
'套装-花面小丑': 'suit_jester_face',
|
||||
'套装-沙丘之歌': 'suit_dune_song',
|
||||
'龙宫之主大礼包': 'pack_dragon_palace',
|
||||
'幸运币90个': 'lucky_coin_x90',
|
||||
'幸运币30个': 'lucky_coin_x30',
|
||||
'幸运币2个': 'lucky_coin_x2',
|
||||
'荣耀勋章90个': 'honor_medal_x90',
|
||||
'荣耀勋章30个': 'honor_medal_x30',
|
||||
'荣耀勋章2个': 'honor_medal_x2',
|
||||
龙宫之主大礼包: 'pack_dragon_palace',
|
||||
幸运币90个: 'lucky_coin_x90',
|
||||
幸运币30个: 'lucky_coin_x30',
|
||||
幸运币2个: 'lucky_coin_x2',
|
||||
荣耀勋章90个: 'honor_medal_x90',
|
||||
荣耀勋章30个: 'honor_medal_x30',
|
||||
荣耀勋章2个: 'honor_medal_x2',
|
||||
'套装-绵云熊熊': 'suit_cloud_bear',
|
||||
'星际漫游枪械礼包': 'pack_star_roam_weapon',
|
||||
'星际漫游服装礼包': 'pack_star_roam_outfit',
|
||||
星际漫游枪械礼包: 'pack_star_roam_weapon',
|
||||
星际漫游服装礼包: 'pack_star_roam_outfit',
|
||||
'套装-狂沙舞者': 'suit_sand_dancer',
|
||||
'熔岩游骑兵礼包': 'pack_lava_ranger',
|
||||
熔岩游骑兵礼包: 'pack_lava_ranger',
|
||||
'套装-胖达团团': 'suit_panda_tuan',
|
||||
'套装-胖达圆圆': 'suit_panda_round',
|
||||
'国宝胖达头盔': 'helmet_panda_treasure',
|
||||
国宝胖达头盔: 'helmet_panda_treasure',
|
||||
'套装-西部谜踪': 'suit_western_mystery',
|
||||
'仓鼠灰灰头盔': 'helmet_hamster_gray',
|
||||
'仓鼠灰灰背包': 'bag_hamster_gray',
|
||||
'糯粉咩咩头盔': 'helmet_pink_sheep',
|
||||
'糯粉咩咩背包': 'bag_pink_sheep',
|
||||
仓鼠灰灰头盔: 'helmet_hamster_gray',
|
||||
仓鼠灰灰背包: 'bag_hamster_gray',
|
||||
糯粉咩咩头盔: 'helmet_pink_sheep',
|
||||
糯粉咩咩背包: 'bag_pink_sheep',
|
||||
'套装-萌熊伴侣': 'suit_cute_bear',
|
||||
'套装-仓鼠灰灰': 'suit_hamster_gray',
|
||||
'破片手榴弹-糯粉咩咩': 'frag_pink_sheep',
|
||||
'烟雾弹-糯粉咩咩': 'smoke_pink_sheep',
|
||||
'西部牛仔大礼包': 'pack_western_cowboy',
|
||||
西部牛仔大礼包: 'pack_western_cowboy',
|
||||
'套装-浪漫天命': 'suit_romantic_destiny',
|
||||
'套装-恋恋初桃': 'suit_first_peach',
|
||||
'套装-糯粉咩咩': 'suit_pink_sheep',
|
||||
'套装-双彩绵绵': 'suit_dual_fluffy',
|
||||
'萌熊伴侣背包': 'bag_cute_bear',
|
||||
萌熊伴侣背包: 'bag_cute_bear',
|
||||
'M416-仓鼠灰灰': 'm416_hamster_gray',
|
||||
'黑色高级特训官上衣': 'top_black_elite_trainer',
|
||||
黑色高级特训官上衣: 'top_black_elite_trainer',
|
||||
'套装-暗影哥特': 'suit_shadow_gothic',
|
||||
'套装-Alan Walker': 'suit_alan_walker',
|
||||
})
|
||||
|
||||
@@ -16,10 +16,7 @@ import type { JsonObject } from '../../types/json.js'
|
||||
import type { OrderItemRow, OrderRow } from '../../types/repository/rows.js'
|
||||
import { createHttpError } from '../../utils/http.js'
|
||||
import { nowIso } from '../../utils/time.js'
|
||||
import {
|
||||
extractPddOutSkuSn,
|
||||
type PddRawOrderItem,
|
||||
} from '../platforms/pdd/pdd-order-mapper.js'
|
||||
import { extractPddOutSkuSn, type PddRawOrderItem } from '../platforms/pdd/pdd-order-mapper.js'
|
||||
import {
|
||||
normalizeDateString,
|
||||
normalizePage,
|
||||
@@ -267,9 +264,7 @@ export async function listAdminKuaishouMatchSources(payload: JsonObject = {}) {
|
||||
const relSkuId = normalizeKuaishouMatchId(
|
||||
ksc.relSkuId || outSkuSn || snapshot.spec || row.sku_code,
|
||||
)
|
||||
const skuNick = String(
|
||||
ksc.skuNick || outSkuSn || snapshot.spec || row.sku_name || '',
|
||||
).trim()
|
||||
const skuNick = String(ksc.skuNick || outSkuSn || snapshot.spec || row.sku_name || '').trim()
|
||||
|
||||
if (!sellerId || (!relItemId && !itemTitle)) continue
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ export type AdminDefaultUser = {
|
||||
status?: string
|
||||
}
|
||||
|
||||
|
||||
export type AffiliateDashSkuMapping = Record<string, string>
|
||||
|
||||
export type RuntimeConfig = {
|
||||
|
||||
Reference in New Issue
Block a user