Use string type for host names

[MAILPOET-2693]
This commit is contained in:
Amine Ben hammou
2020-04-17 14:33:43 +02:00
committed by Veljko V
parent cd73faaff7
commit 35d3e6dc87
2 changed files with 6 additions and 98 deletions

View File

@@ -63,14 +63,7 @@ export default function normalizeSettings(data: any): Settings {
mailpoet_api_key: text,
host: text,
port: text,
region: asEnum([
'us-east-1',
'us-west-2',
'eu-west-1',
'eu-central-1',
'ap-south-1',
'ap-southeast-2',
], 'us-east-1'),
region: asString('us-east-1'),
access_key: text,
secret_key: text,
api_key: text,
@@ -91,45 +84,7 @@ export default function normalizeSettings(data: any): Settings {
}),
mailpoet_smtp_provider: smtpServer,
smtp_provider: smtpServer,
web_host: asEnum([
'manual',
'1and1',
'bluehost',
'df',
'dreamhost',
'free',
'froghost',
'godaddy',
'goneo',
'googleapps',
'greengeeks',
'hawkhost',
'hivetec',
'hostgator',
'hosting2go',
'hostmonster',
'infomaniak',
'justhost',
'laughingsquid',
'lunarpages',
'mediatemple',
'netfirms',
'netissime',
'one',
'ovh',
'phpnet',
'planethoster',
'rochen',
'site5',
'siteground',
'synthesis',
'techark',
'vexxhost',
'vps',
'webcity',
'westhost',
'wpwebhost',
], 'manual'),
web_host: asString('manual'),
mailpoet_sending_frequency: asEnum(['auto', 'manual'], 'manual'),
signup_confirmation: asObject({
enabled: enabledRadio,

View File

@@ -1,50 +1,3 @@
type WebHostName =
| 'manual'
| '1and1'
| 'bluehost'
| 'df'
| 'dreamhost'
| 'free'
| 'froghost'
| 'godaddy'
| 'goneo'
| 'googleapps'
| 'greengeeks'
| 'hawkhost'
| 'hivetec'
| 'hostgator'
| 'hosting2go'
| 'hostmonster'
| 'infomaniak'
| 'justhost'
| 'laughingsquid'
| 'lunarpages'
| 'mediatemple'
| 'netfirms'
| 'netissime'
| 'one'
| 'ovh'
| 'phpnet'
| 'planethoster'
| 'rochen'
| 'site5'
| 'siteground'
| 'synthesis'
| 'techark'
| 'vexxhost'
| 'vps'
| 'webcity'
| 'westhost'
| 'wpwebhost'
type AmazonSesRegion =
| 'us-east-1'
| 'us-west-2'
| 'eu-west-1'
| 'eu-central-1'
| 'ap-south-1'
| 'ap-southeast-2'
export type Settings = {
sender: {
name: string
@@ -114,7 +67,7 @@ export type Settings = {
mailpoet_api_key: string
host: string
port: string
region: AmazonSesRegion
region: string
access_key: string
secret_key: string
api_key: string
@@ -134,7 +87,7 @@ export type Settings = {
}
mailpoet_smtp_provider: 'server' | 'manual' | 'AmazonSES' | 'SendGrid'
smtp_provider: 'server' | 'manual' | 'AmazonSES' | 'SendGrid',
web_host: WebHostName
web_host: string
mailpoet_sending_frequency: 'auto' | 'manual'
signup_confirmation: {
enabled: '1' | ''
@@ -193,7 +146,7 @@ type Page = {
}
type Hosts = {
web: {
[key in WebHostName]: {
[key: string]: {
name: string
emails: number
interval: number
@@ -204,7 +157,7 @@ type Hosts = {
emails: number
interval: number
regions: {
[key: string]: AmazonSesRegion
[key: string]: string
}
}
SendGrid: {