删除咸鱼旧链路
This commit is contained in:
@@ -8,24 +8,6 @@ export function createDefaultRuntimeConfig(projectRoot: string): RuntimeConfig {
|
||||
port: 3000,
|
||||
},
|
||||
|
||||
browser: {
|
||||
chromePath: "",
|
||||
headless: null,
|
||||
devtools: null,
|
||||
keepAlive: null,
|
||||
prewarm: null,
|
||||
slowMoMs: null,
|
||||
vncResolution: "1600x900x24",
|
||||
},
|
||||
|
||||
session: {
|
||||
debug: false,
|
||||
},
|
||||
|
||||
ocr: {
|
||||
baseUrl: "",
|
||||
},
|
||||
|
||||
data: {
|
||||
root: path.resolve(projectRoot, "data"),
|
||||
},
|
||||
@@ -52,30 +34,6 @@ export function createDefaultRuntimeConfig(projectRoot: string): RuntimeConfig {
|
||||
},
|
||||
|
||||
platforms: {
|
||||
agiso: {
|
||||
appSecret: "",
|
||||
tradeDetail: {
|
||||
endpoint: "https://gw-api.agiso.com/aldsIdle/Order/Detail",
|
||||
apiVersion: "1",
|
||||
timeoutMs: 5000,
|
||||
},
|
||||
autoDelivery: {
|
||||
enabled: true,
|
||||
endpoint: "https://gw-api.agiso.com/aldsIdle/Order/DummySend",
|
||||
apiVersion: "1",
|
||||
},
|
||||
messaging: {
|
||||
enabled: false,
|
||||
sendMessageEndpoint:
|
||||
"https://gw-api.agiso.com/aldsIdle/ImMsg/SendMsg",
|
||||
apiVersion: "1",
|
||||
messageTemplate:
|
||||
"您的订单 {platformOrderId} 已创建领取链接,请在 {expiredAt} 前完成领取:{claimUrl}",
|
||||
autoDeliveryMessageTemplate:
|
||||
"您的订单 {platformOrderId} 已完成自动发货,请注意查收。",
|
||||
shops: {},
|
||||
},
|
||||
},
|
||||
ninetyone: {
|
||||
userId: "",
|
||||
secret: "",
|
||||
@@ -137,9 +95,5 @@ PfQTPNA++KsXtwRX9M6Re3vkTDRsutIIWKtj8jqhUbbYS3vzS8GJnAWavUFVkR15
|
||||
cors: {
|
||||
allowedOrigins: ["*"],
|
||||
},
|
||||
|
||||
redeem: {
|
||||
proofMode: "full",
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -21,17 +21,13 @@ const DEPLOYMENT_ONLY_ENV_NAMES = [
|
||||
'CADDY_SITE_ADDR',
|
||||
'CHOKIDAR_USEPOLLING',
|
||||
'NPM_CONFIG_REGISTRY',
|
||||
'OCR_IMAGE',
|
||||
'OCR_PORT',
|
||||
'POSTGRES_DB',
|
||||
'POSTGRES_PASSWORD',
|
||||
'POSTGRES_PORT',
|
||||
'POSTGRES_USER',
|
||||
'TENCENT_BROWSER_NOVNC_ENABLED',
|
||||
'TENCENT_BROWSER_NOVNC_PORT',
|
||||
'TENCENT_BROWSER_VNC_PORT',
|
||||
'TZ',
|
||||
'VITE_API_TARGET',
|
||||
'VITE_ALLOWED_HOSTS',
|
||||
]
|
||||
|
||||
const KNOWN_ENV_NAMES = new Set([
|
||||
|
||||
@@ -10,32 +10,21 @@ test('applyEnvOverrides maps typed environment values without mutating base conf
|
||||
|
||||
const config = applyEnvOverrides(baseConfig, {
|
||||
PORT: '4000',
|
||||
TENCENT_BROWSER_HEADLESS: 'true',
|
||||
TENCENT_BROWSER_SLOW_MO: '250',
|
||||
TENCENT_BROWSER_VNC_RESOLUTION: '1920x1080x24',
|
||||
DATA_ROOT: './tmp/backend-data',
|
||||
DATABASE_SSL: 'yes',
|
||||
ADMIN_DEFAULT_USERS_JSON: '[{"username":"admin","password":"secret","role":"admin"}]',
|
||||
AGISO_TRADE_DETAIL_TIMEOUT_MS: '7000',
|
||||
CLOUDTENTACLES_DEVICE_TYPE: '3',
|
||||
TENCENT_REDEEM_PROOF_MODE: 'basic',
|
||||
})
|
||||
|
||||
assert.equal(config.server.port, 4000)
|
||||
assert.equal(config.browser.headless, true)
|
||||
assert.equal(config.browser.slowMoMs, 250)
|
||||
assert.equal(config.browser.vncResolution, '1920x1080x24')
|
||||
assert.equal(config.data.root, path.resolve('./tmp/backend-data'))
|
||||
assert.equal(config.database.ssl, true)
|
||||
assert.deepEqual(config.admin.defaultUsers, [
|
||||
{ username: 'admin', password: 'secret', role: 'admin' },
|
||||
])
|
||||
assert.equal(config.platforms.agiso.tradeDetail.timeoutMs, 7000)
|
||||
assert.equal(config.platforms.cloudtentacles.deviceType, 3)
|
||||
assert.equal(config.redeem.proofMode, 'basic')
|
||||
|
||||
assert.equal(baseConfig.server.port, 3000)
|
||||
assert.equal(baseConfig.browser.headless, null)
|
||||
assert.deepEqual(baseConfig.admin.defaultUsers, [])
|
||||
})
|
||||
|
||||
@@ -80,21 +69,6 @@ function createRuntimeConfig(): RuntimeConfig {
|
||||
server: {
|
||||
port: 3000,
|
||||
},
|
||||
browser: {
|
||||
chromePath: '',
|
||||
headless: null,
|
||||
devtools: null,
|
||||
keepAlive: null,
|
||||
prewarm: null,
|
||||
slowMoMs: null,
|
||||
vncResolution: '1600x900x24',
|
||||
},
|
||||
session: {
|
||||
debug: false,
|
||||
},
|
||||
ocr: {
|
||||
baseUrl: '',
|
||||
},
|
||||
data: {
|
||||
root: '/tmp/order-site',
|
||||
},
|
||||
@@ -116,27 +90,6 @@ function createRuntimeConfig(): RuntimeConfig {
|
||||
defaultUsers: [],
|
||||
},
|
||||
platforms: {
|
||||
agiso: {
|
||||
appSecret: '',
|
||||
tradeDetail: {
|
||||
endpoint: 'https://gw-api.agiso.com/aldsIdle/Order/Detail',
|
||||
apiVersion: '1',
|
||||
timeoutMs: 5000,
|
||||
},
|
||||
autoDelivery: {
|
||||
enabled: true,
|
||||
endpoint: 'https://gw-api.agiso.com/aldsIdle/Order/DummySend',
|
||||
apiVersion: '1',
|
||||
},
|
||||
messaging: {
|
||||
enabled: false,
|
||||
sendMessageEndpoint: 'https://gw-api.agiso.com/aldsIdle/ImMsg/SendMsg',
|
||||
apiVersion: '1',
|
||||
messageTemplate: '',
|
||||
autoDeliveryMessageTemplate: '',
|
||||
shops: {},
|
||||
},
|
||||
},
|
||||
ninetyone: {
|
||||
userId: '',
|
||||
secret: '',
|
||||
@@ -184,8 +137,5 @@ function createRuntimeConfig(): RuntimeConfig {
|
||||
deviceType: 0,
|
||||
},
|
||||
},
|
||||
redeem: {
|
||||
proofMode: 'full',
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,15 +30,6 @@ type EnvOverride = {
|
||||
|
||||
export const ENV_OVERRIDES: readonly EnvOverride[] = [
|
||||
integerEnv("PORT", ["server", "port"]),
|
||||
stringEnv("CHROME_PATH", ["browser", "chromePath"]),
|
||||
booleanEnv("TENCENT_BROWSER_HEADLESS", ["browser", "headless"]),
|
||||
booleanEnv("TENCENT_BROWSER_DEVTOOLS", ["browser", "devtools"]),
|
||||
booleanEnv("TENCENT_BROWSER_KEEP_ALIVE", ["browser", "keepAlive"]),
|
||||
booleanEnv("TENCENT_BROWSER_PREWARM", ["browser", "prewarm"]),
|
||||
integerEnv("TENCENT_BROWSER_SLOW_MO", ["browser", "slowMoMs"]),
|
||||
stringEnv("TENCENT_BROWSER_VNC_RESOLUTION", ["browser", "vncResolution"]),
|
||||
booleanEnv("TENCENT_SESSION_DEBUG", ["session", "debug"]),
|
||||
stringEnv("OCR_BASE_URL", ["ocr", "baseUrl"]),
|
||||
stringEnv("DATA_ROOT", ["data", "root"], path.resolve),
|
||||
stringEnv("LOG_LEVEL", ["logging", "level"]),
|
||||
stringEnv("DATABASE_URL", ["database", "url"]),
|
||||
@@ -48,61 +39,6 @@ export const ENV_OVERRIDES: readonly EnvOverride[] = [
|
||||
stringEnv("ADMIN_SESSION_SECRET", ["admin", "sessionSecret"]),
|
||||
integerEnv("ADMIN_SESSION_TTL_HOURS", ["admin", "sessionTtlHours"]),
|
||||
adminUsersJsonEnv("ADMIN_DEFAULT_USERS_JSON", ["admin", "defaultUsers"]),
|
||||
stringEnv("AGISO_APP_SECRET", ["platforms", "agiso", "appSecret"]),
|
||||
stringEnv("AGISO_TRADE_DETAIL_ENDPOINT", [
|
||||
"platforms",
|
||||
"agiso",
|
||||
"tradeDetail",
|
||||
"endpoint",
|
||||
]),
|
||||
stringEnv("AGISO_TRADE_DETAIL_API_VERSION", [
|
||||
"platforms",
|
||||
"agiso",
|
||||
"tradeDetail",
|
||||
"apiVersion",
|
||||
]),
|
||||
integerEnv("AGISO_TRADE_DETAIL_TIMEOUT_MS", [
|
||||
"platforms",
|
||||
"agiso",
|
||||
"tradeDetail",
|
||||
"timeoutMs",
|
||||
]),
|
||||
booleanEnv("AGISO_AUTO_DELIVERY_ENABLED", [
|
||||
"platforms",
|
||||
"agiso",
|
||||
"autoDelivery",
|
||||
"enabled",
|
||||
]),
|
||||
stringEnv("AGISO_AUTO_DELIVERY_ENDPOINT", [
|
||||
"platforms",
|
||||
"agiso",
|
||||
"autoDelivery",
|
||||
"endpoint",
|
||||
]),
|
||||
stringEnv("AGISO_AUTO_DELIVERY_API_VERSION", [
|
||||
"platforms",
|
||||
"agiso",
|
||||
"autoDelivery",
|
||||
"apiVersion",
|
||||
]),
|
||||
stringEnv("AGISO_MESSAGE_API_VERSION", [
|
||||
"platforms",
|
||||
"agiso",
|
||||
"messaging",
|
||||
"apiVersion",
|
||||
]),
|
||||
stringEnv("AGISO_SEND_MESSAGE_ENDPOINT", [
|
||||
"platforms",
|
||||
"agiso",
|
||||
"messaging",
|
||||
"sendMessageEndpoint",
|
||||
]),
|
||||
booleanEnv("AGISO_MESSAGING_ENABLED", [
|
||||
"platforms",
|
||||
"agiso",
|
||||
"messaging",
|
||||
"enabled",
|
||||
]),
|
||||
stringEnv("NINETYONE_USER_ID", ["platforms", "ninetyone", "userId"]),
|
||||
stringEnv("NINETYONE_SECRET", ["platforms", "ninetyone", "secret"]),
|
||||
stringEnv("NINETYONE_VERSION", ["platforms", "ninetyone", "version"]),
|
||||
@@ -288,7 +224,6 @@ export const ENV_OVERRIDES: readonly EnvOverride[] = [
|
||||
"cloudtentacles",
|
||||
"deviceType",
|
||||
]),
|
||||
stringEnv("TENCENT_REDEEM_PROOF_MODE", ["redeem", "proofMode"]),
|
||||
corsOriginsEnv("CORS_ALLOWED_ORIGINS", ["cors", "allowedOrigins"]),
|
||||
];
|
||||
|
||||
|
||||
@@ -112,21 +112,6 @@ function createRuntimeConfig(overrides: Record<string, unknown> = {}): RuntimeCo
|
||||
server: {
|
||||
port: 3000,
|
||||
},
|
||||
browser: {
|
||||
chromePath: '',
|
||||
headless: null,
|
||||
devtools: null,
|
||||
keepAlive: null,
|
||||
prewarm: null,
|
||||
slowMoMs: null,
|
||||
vncResolution: '1600x900x24',
|
||||
},
|
||||
session: {
|
||||
debug: false,
|
||||
},
|
||||
ocr: {
|
||||
baseUrl: '',
|
||||
},
|
||||
data: {
|
||||
root: '/tmp/order-site',
|
||||
},
|
||||
@@ -154,27 +139,6 @@ function createRuntimeConfig(overrides: Record<string, unknown> = {}): RuntimeCo
|
||||
],
|
||||
},
|
||||
platforms: {
|
||||
agiso: {
|
||||
appSecret: '',
|
||||
tradeDetail: {
|
||||
endpoint: 'https://gw-api.agiso.com/aldsIdle/Order/Detail',
|
||||
apiVersion: '1',
|
||||
timeoutMs: 5000,
|
||||
},
|
||||
autoDelivery: {
|
||||
enabled: true,
|
||||
endpoint: 'https://gw-api.agiso.com/aldsIdle/Order/DummySend',
|
||||
apiVersion: '1',
|
||||
},
|
||||
messaging: {
|
||||
enabled: false,
|
||||
sendMessageEndpoint: 'https://gw-api.agiso.com/aldsIdle/ImMsg/SendMsg',
|
||||
apiVersion: '1',
|
||||
messageTemplate: '',
|
||||
autoDeliveryMessageTemplate: '',
|
||||
shops: {},
|
||||
},
|
||||
},
|
||||
ninetyone: {
|
||||
userId: '',
|
||||
secret: '',
|
||||
@@ -222,8 +186,5 @@ function createRuntimeConfig(overrides: Record<string, unknown> = {}): RuntimeCo
|
||||
deviceType: 0,
|
||||
},
|
||||
},
|
||||
redeem: {
|
||||
proofMode: 'full',
|
||||
},
|
||||
}, overrides) as RuntimeConfig
|
||||
}
|
||||
|
||||
@@ -47,7 +47,6 @@ export function validateRuntimeConfig(
|
||||
requireInteger(issues, 'database.maxConnections', config.database?.maxConnections, { min: 1 })
|
||||
requireInteger(issues, 'orders.tokenTtlHours', config.orders?.tokenTtlHours, { min: 1 })
|
||||
requireInteger(issues, 'admin.sessionTtlHours', config.admin?.sessionTtlHours, { min: 1 })
|
||||
requireInteger(issues, 'platforms.agiso.tradeDetail.timeoutMs', config.platforms?.agiso?.tradeDetail?.timeoutMs, { min: 1 })
|
||||
requireInteger(issues, 'platforms.cloudtentacles.timeoutMs', config.platforms?.cloudtentacles?.timeoutMs, { min: 1 })
|
||||
requireInteger(issues, 'platforms.cloudtentacles.bindUrlTtlSeconds', config.platforms?.cloudtentacles?.bindUrlTtlSeconds, { min: 1 })
|
||||
requireInteger(
|
||||
|
||||
Reference in New Issue
Block a user