refactor(fulfillment): 移除飞飞/乐玩通道,仅保留 affiliate_dash

新单只路由 affiliate_dash(未命中走 manual_dispatch);历史飞飞/乐玩任务保留只读 stub,避免订单重同步失败。同步清理 cloudtentacles 调度、Admin 写路径与相关 env。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
yml2213
2026-09-14 17:29:47 +08:00
co-authored by Cursor
parent 0cbcb89dd8
commit b3aad0044c
155 changed files with 661 additions and 23351 deletions
-112
View File
@@ -3,7 +3,6 @@ import process from 'node:process'
import type {
AdminDefaultUser,
KuaishouFeifeiProductRule,
RuntimeConfig,
} from '../types/runtime-config.js'
import { parseBoolean, parseInteger, parseJsonArray } from './runtime-env.js'
@@ -15,7 +14,6 @@ type RuntimeConfigValue =
| number
| boolean
| AdminDefaultUser[]
| KuaishouFeifeiProductRule[]
| string[]
| Record<string, string>
type RuntimeEnv = Record<string, string | undefined>
@@ -73,96 +71,6 @@ export const ENV_OVERRIDES: readonly EnvOverride[] = [
'timestampToleranceSeconds',
]),
stringEnv('KAQUAN91_CARDS_ENCODING', ['platforms', 'ninetyone', 'cardsEncoding']),
stringEnv('CLOUDTENTACLES_BASE_URL', ['platforms', 'cloudtentacles', 'baseUrl']),
integerEnv('CLOUDTENTACLES_TIMEOUT_MS', ['platforms', 'cloudtentacles', 'timeoutMs']),
stringEnv('CLOUDTENTACLES_SEND_SMS_PATH', ['platforms', 'cloudtentacles', 'sendSmsPath']),
stringEnv('CLOUDTENTACLES_LOGIN_PATH', ['platforms', 'cloudtentacles', 'loginPath']),
stringEnv('CLOUDTENTACLES_USER_INFO_PATH', ['platforms', 'cloudtentacles', 'userInfoPath']),
stringEnv('CLOUDTENTACLES_ASSET_PATH', ['platforms', 'cloudtentacles', 'assetPath']),
stringEnv('CLOUDTENTACLES_PERMISSION_PATH', ['platforms', 'cloudtentacles', 'permissionPath']),
stringEnv('CLOUDTENTACLES_CATEGORIES_PATH', ['platforms', 'cloudtentacles', 'categoriesPath']),
stringEnv('CLOUDTENTACLES_SKU_LIST_PATH', ['platforms', 'cloudtentacles', 'skuListPath']),
stringEnv('CLOUDTENTACLES_SKU_BUY_PATH', ['platforms', 'cloudtentacles', 'skuBuyPath']),
stringEnv('CLOUDTENTACLES_KNAPSACK_PATH', ['platforms', 'cloudtentacles', 'knapsackPath']),
stringEnv('CLOUDTENTACLES_VN_LIST_PATH', ['platforms', 'cloudtentacles', 'vnListPath']),
stringEnv('CLOUDTENTACLES_VN_APPOINT_PATH', ['platforms', 'cloudtentacles', 'vnAppointPath']),
stringEnv('CLOUDTENTACLES_VN_GENERATE_LOGIN_CODE_PATH', [
'platforms',
'cloudtentacles',
'vnGenerateLoginCodePath',
]),
stringEnv('CLOUDTENTACLES_VN_VERIF_CODE_PATH', [
'platforms',
'cloudtentacles',
'vnVerifCodePath',
]),
stringEnv('CLOUDTENTACLES_VN_VERIFY_LOGIN_CODE_PATH', [
'platforms',
'cloudtentacles',
'vnVerifyLoginCodePath',
]),
stringEnv('CLOUDTENTACLES_VN_BIND_URL_PATH', ['platforms', 'cloudtentacles', 'vnBindUrlPath']),
stringEnv('CLOUDTENTACLES_VN_BIND_INFO_PATH', ['platforms', 'cloudtentacles', 'vnBindInfoPath']),
stringEnv('CLOUDTENTACLES_VN_BACK_PATH', ['platforms', 'cloudtentacles', 'vnBackPath']),
integerEnv('CLOUDTENTACLES_BIND_URL_TTL_SECONDS', [
'platforms',
'cloudtentacles',
'bindUrlTtlSeconds',
]),
integerEnv('CLOUDTENTACLES_BIND_URL_PROBE_INTERVAL_SECONDS', [
'platforms',
'cloudtentacles',
'bindUrlProbeIntervalSeconds',
]),
integerEnv('CLOUDTENTACLES_BIND_URL_PROBE_TIMEOUT_MS', [
'platforms',
'cloudtentacles',
'bindUrlProbeTimeoutMs',
]),
stringEnv('CLOUDTENTACLES_BIND_URL_PROBE_USER_AGENT', [
'platforms',
'cloudtentacles',
'bindUrlProbeUserAgent',
]),
stringEnv('CLOUDTENTACLES_BIND_URL_PROBE_ENDPOINT', [
'platforms',
'cloudtentacles',
'bindUrlProbeEndpoint',
]),
stringEnv('CLOUDTENTACLES_BIND_URL_PROBE_CHART_ID', [
'platforms',
'cloudtentacles',
'bindUrlProbeChartId',
]),
stringEnv('CLOUDTENTACLES_BIND_URL_PROBE_SUB_CHART_ID', [
'platforms',
'cloudtentacles',
'bindUrlProbeSubChartId',
]),
stringEnv('CLOUDTENTACLES_BIND_URL_PROBE_IDE_TOKEN', [
'platforms',
'cloudtentacles',
'bindUrlProbeIdeToken',
]),
stringEnv('CLOUDTENTACLES_BIND_URL_PROBE_ACTIVITY_URL', [
'platforms',
'cloudtentacles',
'bindUrlProbeActivityUrl',
]),
stringEnv('CLOUDTENTACLES_BIND_URL_PROBE_REFERER', [
'platforms',
'cloudtentacles',
'bindUrlProbeReferer',
]),
stringEnv('CLOUDTENTACLES_BIND_URL_PROBE_EXTRA_COOKIE', [
'platforms',
'cloudtentacles',
'bindUrlProbeExtraCookie',
]),
stringEnv('CLOUDTENTACLES_PUBLIC_KEY_PEM', ['platforms', 'cloudtentacles', 'publicKeyPem']),
stringEnv('CLOUDTENTACLES_CLIENT_SOURCE', ['platforms', 'cloudtentacles', 'clientSource']),
stringEnv('CLOUDTENTACLES_DEVICE_ID', ['platforms', 'cloudtentacles', 'deviceId']),
integerEnv('CLOUDTENTACLES_DEVICE_TYPE', ['platforms', 'cloudtentacles', 'deviceType']),
stringEnv('KUASHOU_INDUSTRY_APP_KEY', ['platforms', 'kuaishouIndustry', 'appKey']),
stringEnv('KUASHOU_INDUSTRY_APP_SECRET', ['platforms', 'kuaishouIndustry', 'appSecret']),
stringEnv('KUASHOU_INDUSTRY_SIGN_SECRET', ['platforms', 'kuaishouIndustry', 'signSecret']),
@@ -171,9 +79,6 @@ export const ENV_OVERRIDES: readonly EnvOverride[] = [
stringEnv('KUASHOU_INDUSTRY_SHOP_ID', ['platforms', 'kuaishouIndustry', 'shopId']),
stringEnv('KUASHOU_INDUSTRY_SHOP_NAME', ['platforms', 'kuaishouIndustry', 'shopName']),
stringEnv('KUASHOU_INDUSTRY_VERSION', ['platforms', 'kuaishouIndustry', 'version']),
stringEnv('KUAISHOU_FEIFEI_BASE_URL', ['platforms', 'kuaishouFeifei', 'baseUrl']),
stringEnv('KUAISHOU_FEIFEI_APP_KEY', ['platforms', 'kuaishouFeifei', 'appKey']),
stringEnv('KUAISHOU_FEIFEI_APP_SECRET', ['platforms', 'kuaishouFeifei', 'appSecret']),
stringEnv('WORKER_SMS_PROVIDER', ['worker', 'sms', 'provider']),
stringEnv('WORKER_SMS_ACCESS_KEY_ID', ['worker', 'sms', 'accessKeyId']),
stringEnv('WORKER_SMS_ACCESS_KEY_SECRET', ['worker', 'sms', 'accessKeySecret']),
@@ -183,13 +88,6 @@ export const ENV_OVERRIDES: readonly EnvOverride[] = [
integerEnv('WORKER_SMS_COOLDOWN_SECONDS', ['worker', 'sms', 'cooldownSeconds']),
integerEnv('WORKER_SMS_DAILY_LIMIT', ['worker', 'sms', 'dailyLimit']),
booleanEnv('WORKER_ORDER_TIMELINE_VISIBLE', ['worker', 'orderTimelineVisible']),
integerEnv('KUAISHOU_FEIFEI_TIMEOUT_MS', ['platforms', 'kuaishouFeifei', 'timeoutMs']),
stringEnv('KUAISHOU_FEIFEI_NOTIFY_URL', ['platforms', 'kuaishouFeifei', 'notifyUrl']),
kuaishouFeifeiProductRulesEnv('KUAISHOU_FEIFEI_PRODUCT_RULES_JSON', [
'platforms',
'kuaishouFeifei',
'productRules',
]),
stringEnv('AFFILIATE_DASH_BASE_URL', ['platforms', 'affiliateDash', 'baseUrl']),
stringEnv('AFFILIATE_DASH_APP_KEY', ['platforms', 'affiliateDash', 'appKey']),
stringEnv('AFFILIATE_DASH_APP_SECRET', ['platforms', 'affiliateDash', 'appSecret']),
@@ -306,16 +204,6 @@ function adminUsersJsonEnv(env: string, configPath: RuntimeConfigPath): EnvOverr
}
}
function kuaishouFeifeiProductRulesEnv(env: string, configPath: RuntimeConfigPath): EnvOverride {
return {
env,
path: configPath,
read(rawValue) {
const parsed = parseJsonArray<KuaishouFeifeiProductRule>(rawValue)
return parsed === null ? null : parsed
},
}
}
function affiliateDashSkuMappingEnv(env: string, configPath: RuntimeConfigPath): EnvOverride {
return {