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

Function activateLuckmailPurchaseForFlow

background.js:2314–2335  ·  view source on GitHub ↗
(state, client, purchase, options = {})

Source from the content-addressed store, hash-verified

2312}
2313
2314async function activateLuckmailPurchaseForFlow(state, client, purchase, options = {}) {
2315 const normalizedPurchase = normalizeLuckmailPurchase(purchase);
2316 if (!normalizedPurchase?.email_address || !normalizedPurchase?.token) {
2317 throw new Error('LuckMail 邮箱缺少 email/token,无法用于当前流程。');
2318 }
2319
2320 let baselineCursor = null;
2321 if (options.initializeCursor !== false) {
2322 const mailList = await client.user.getTokenMails(normalizedPurchase.token);
2323 baselineCursor = buildLuckmailBaselineCursor(mailList?.mails || []);
2324 }
2325
2326 await setLuckmailPurchaseState(normalizedPurchase);
2327 await setLuckmailMailCursorState(baselineCursor);
2328 await setEmailState(normalizedPurchase.email_address);
2329
2330 if (options.logMessage) {
2331 await addLog(options.logMessage, options.logLevel || 'ok');
2332 }
2333
2334 return normalizedPurchase;
2335}
2336
2337async function findReusableLuckmailPurchaseForFlow(state, client) {
2338 const preserveTagInfo = getLuckmailPreserveTagInfo(state);

Callers 2

selectLuckmailPurchaseFunction · 0.85

Calls 6

setLuckmailPurchaseStateFunction · 0.85
setEmailStateFunction · 0.85
addLogFunction · 0.70

Tested by

no test coverage detected