(state, options = {})
| 186 | } |
| 187 | |
| 188 | async function fetchGeneratedEmail(state, options = {}) { |
| 189 | const currentState = state || await getState(); |
| 190 | const generator = normalizeEmailGenerator(options.generator ?? currentState.emailGenerator); |
| 191 | if (generator === 'custom') { |
| 192 | throw new Error('当前邮箱生成方式为自定义邮箱,请直接填写注册邮箱。'); |
| 193 | } |
| 194 | if (generator === 'icloud') { |
| 195 | return fetchIcloudHideMyEmail(); |
| 196 | } |
| 197 | if (generator === 'cloudflare') { |
| 198 | return fetchCloudflareEmail(currentState, options); |
| 199 | } |
| 200 | if (generator === CLOUDFLARE_TEMP_EMAIL_GENERATOR) { |
| 201 | return fetchCloudflareTempEmailAddress(currentState, options); |
| 202 | } |
| 203 | return fetchDuckEmail(options); |
| 204 | } |
| 205 | |
| 206 | return { |
| 207 | ensureCloudflareTempEmailConfig, |
no test coverage detected