feat: add SMS Bower phone SMS provider

This commit is contained in:
chick
2026-05-30 21:30:14 +08:00
parent 8cee2611ca
commit 5f871c3c40
10 changed files with 692 additions and 5 deletions
+9
View File
@@ -23,6 +23,7 @@ importScripts(
'phone-sms/providers/five-sim.js',
'phone-sms/providers/nexsms.js',
'phone-sms/providers/madao.js',
'phone-sms/providers/sms-bower.js',
'phone-sms/providers/registry.js',
'background/phone-verification-flow.js',
'background/account-run-history.js',
@@ -702,12 +703,14 @@ const PHONE_SMS_PROVIDER_HERO_SMS = PHONE_SMS_PROVIDER_HERO;
const PHONE_SMS_PROVIDER_FIVE_SIM = PHONE_SMS_PROVIDER_5SIM;
const PHONE_SMS_PROVIDER_NEXSMS = 'nexsms';
const PHONE_SMS_PROVIDER_MADAO = 'madao';
const PHONE_SMS_PROVIDER_SMS_BOWER = 'sms-bower';
const DEFAULT_PHONE_SMS_PROVIDER = PHONE_SMS_PROVIDER_HERO;
const DEFAULT_PHONE_SMS_PROVIDER_ORDER = Object.freeze([
PHONE_SMS_PROVIDER_HERO,
PHONE_SMS_PROVIDER_5SIM,
PHONE_SMS_PROVIDER_NEXSMS,
PHONE_SMS_PROVIDER_MADAO,
PHONE_SMS_PROVIDER_SMS_BOWER,
]);
const DEFAULT_FIVE_SIM_BASE_URL = 'https://5sim.net/v1';
const DEFAULT_FIVE_SIM_PRODUCT = 'openai';
@@ -716,6 +719,8 @@ const DEFAULT_FIVE_SIM_COUNTRY_ORDER = Object.freeze(['thailand']);
const DEFAULT_NEX_SMS_BASE_URL = 'https://api.nexsms.net';
const DEFAULT_NEX_SMS_SERVICE_CODE = 'ot';
const DEFAULT_NEX_SMS_COUNTRY_ORDER = Object.freeze([1]);
const DEFAULT_SMS_BOWER_SERVICE_CODE = 'ot';
const DEFAULT_SMS_BOWER_COUNTRY_ORDER = Object.freeze([52]);
const DEFAULT_MADAO_BASE_URL = 'http://127.0.0.1:7822';
const DEFAULT_MADAO_MODE = 'routing_plan';
const DEFAULT_HERO_SMS_REUSE_ENABLED = true;
@@ -1447,6 +1452,7 @@ const PERSISTED_SETTING_DEFAULTS = {
nexSmsApiKey: '',
nexSmsCountryOrder: [...DEFAULT_NEX_SMS_COUNTRY_ORDER],
nexSmsServiceCode: DEFAULT_NEX_SMS_SERVICE_CODE,
smsBowerApiKey: '',
madaoBaseUrl: DEFAULT_MADAO_BASE_URL,
madaoHttpSecret: '',
madaoMode: DEFAULT_MADAO_MODE,
@@ -1848,6 +1854,9 @@ function normalizePhoneSmsProvider(value = '') {
if (normalized === PHONE_SMS_PROVIDER_MADAO) {
return PHONE_SMS_PROVIDER_MADAO;
}
if (normalized === PHONE_SMS_PROVIDER_SMS_BOWER) {
return PHONE_SMS_PROVIDER_SMS_BOWER;
}
return PHONE_SMS_PROVIDER_HERO_SMS;
}
function normalizePhoneSmsProviderOrder(value = [], fallbackOrder = []) {