(state, options = {})
| 44 | } |
| 45 | |
| 46 | async function fetchCloudflareEmail(state, options = {}) { |
| 47 | throwIfStopped(); |
| 48 | const latestState = state || await getState(); |
| 49 | const domain = normalizeCloudflareDomain(latestState.cloudflareDomain); |
| 50 | if (!domain) { |
| 51 | throw new Error('Cloudflare 域名为空或格式无效。'); |
| 52 | } |
| 53 | |
| 54 | const localPart = String(options.localPart || '').trim().toLowerCase() || generateCloudflareAliasLocalPart(); |
| 55 | const aliasEmail = `${localPart}@${domain}`; |
| 56 | |
| 57 | await setEmailState(aliasEmail); |
| 58 | await addLog(`Cloudflare 邮箱:已生成 ${aliasEmail}`, 'ok'); |
| 59 | return aliasEmail; |
| 60 | } |
| 61 | |
| 62 | function ensureCloudflareTempEmailConfig(state, options = {}) { |
| 63 | const { |
no test coverage detected