|
|
@@ -12,19 +12,21 @@ const axiosInstance = axios.create({
|
|
|
|
|
|
const countryMap = {
|
|
|
US: 'US',
|
|
|
- GB: 'UK',
|
|
|
- BR: 'BR'
|
|
|
+ US1: 'US',
|
|
|
+ US2: 'US',
|
|
|
+ US3: 'US',
|
|
|
+ GB: 'UK'
|
|
|
}
|
|
|
|
|
|
export class smspva extends GetNumberService {
|
|
|
source: RcsNumberSource = RcsNumberSource.smspva
|
|
|
|
|
|
async getNumber(country: string, num?: number): Promise<GetNumberResponse> {
|
|
|
- const countryCode = countryMap[country]
|
|
|
+ let countryCode = countryMap[country]
|
|
|
if (!countryCode) {
|
|
|
- throw new Error('No available country')
|
|
|
+ countryCode = country
|
|
|
}
|
|
|
- const res = await axiosInstance.get(`number/${country}/${SERVICE}`, {
|
|
|
+ const res = await axiosInstance.get(`number/${countryCode}/${SERVICE}`, {
|
|
|
headers: {
|
|
|
apikey: API_KEY
|
|
|
}
|