(state, purchaseId, options = {})
| 2263 | } |
| 2264 | |
| 2265 | async function getLuckmailPurchaseById(state, purchaseId, options = {}) { |
| 2266 | const normalizedPurchaseId = Number(normalizeLuckmailPurchaseId(purchaseId)) || 0; |
| 2267 | if (!normalizedPurchaseId) { |
| 2268 | throw new Error('LuckMail 邮箱 ID 无效。'); |
| 2269 | } |
| 2270 | |
| 2271 | const purchases = await listLuckmailPurchasesByProject(state, options); |
| 2272 | const purchase = purchases.find((item) => item.id === normalizedPurchaseId) || null; |
| 2273 | if (!purchase) { |
| 2274 | throw new Error(`未找到 ID=${normalizedPurchaseId} 的 openai LuckMail 邮箱。`); |
| 2275 | } |
| 2276 | return purchase; |
| 2277 | } |
| 2278 | |
| 2279 | async function listLuckmailPurchasesForManagement() { |
| 2280 | const state = await getState(); |
no test coverage detected