MCPcopy Index your code
hub / github.com/QLHazyCoder/FlowPilot / resolveIcloudPremiumMailService

Function resolveIcloudPremiumMailService

background.js:2961–2985  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2959}
2960
2961async function resolveIcloudPremiumMailService() {
2962 const errors = [];
2963 const state = await getState();
2964 const setupUrls = await getPreferredIcloudSetupUrls(state);
2965
2966 for (const setupUrl of setupUrls) {
2967 try {
2968 const data = await validateIcloudSession(setupUrl);
2969 const preferredIcloudHost = normalizeIcloudHost(new URL(setupUrl).host);
2970 if (preferredIcloudHost && preferredIcloudHost !== normalizeIcloudHost(state.preferredIcloudHost)) {
2971 await setState({ preferredIcloudHost });
2972 }
2973 return {
2974 setupUrl,
2975 serviceUrl: String(data.webservices.premiummailsettings.url || '').replace(/\/$/, ''),
2976 };
2977 } catch (err) {
2978 errors.push(`${new URL(setupUrl).host}: ${getErrorMessage(err)}`);
2979 }
2980 }
2981
2982 throw new Error(errors.length
2983 ? `Could not validate iCloud session. ${errors.join(' | ')}`
2984 : 'Could not validate iCloud session. 请先在当前浏览器登录 icloud.com.cn 或 icloud.com。');
2985}
2986
2987function getIcloudAliasLabel() {
2988 const now = new Date();

Callers 4

checkIcloudSessionFunction · 0.85
listIcloudAliasesFunction · 0.85
deleteIcloudAliasFunction · 0.85
fetchIcloudHideMyEmailFunction · 0.85

Calls 6

getStateFunction · 0.85
validateIcloudSessionFunction · 0.85
normalizeIcloudHostFunction · 0.85
setStateFunction · 0.85
getErrorMessageFunction · 0.70

Tested by

no test coverage detected