文档项目构建
下 兜帽
我们异步处理繁重的工作。 您只需立即得到结果。
您(客户)
协调者
人工智能处理
霓虹灯数据库
敏捷实时
文档在后台自动生成
完整的 工具包
将代码库转换为清晰、最新的文档所需的一切。
不仅仅是文本。 可操作的指标。
跟踪技术债务,识别
复杂性与文档
实时分析过去 6 个月的存储库运行状况。
总线系数
1.2严重风险:模块“auth/core”
可维护性
A+本月提升 15%
文档项目构建
我们异步处理繁重的工作。 您只需立即得到结果。
将代码库转换为清晰、最新的文档所需的一切。
跟踪技术债务,识别
总线系数
1.2严重风险:模块“auth/core”
可维护性
A+export async function processSub(uId: string, plan: string) {
const user = await db.user.findById(uId);
if (!user.isActive) throw new Error("403");
if (user.sub === plan) return null;
const price = PRICING[plan];
// Charge the user
await stripe.charges.create({
amount: price * 100,
currency: 'usd',
customer: user.stripeId
});
await db.user.update(uId, { sub: plan, status: 'active' });
await email.sendWelcome(user.email, plan);
return true;
}/**
* Upgrades user subscription and handles payment processing.
*
* @description
* 1. Verifies user status (must be active).
* 2. Deduplicates requests (returns null if already on plan).
* 3. Charges card via Stripe and updates local DB.
*
* @param {string} uId - Internal user UUID.
* @param {string} plan - Target plan ID (e.g., 'PRO_YEARLY').
* @throws {Error} "403" if user is suspended/inactive.
* @returns {Promise<boolean|null>} True on success, null if no change needed.
*
* @example
* try {
* await processSub("user_123", "ENTERPRISE");
* } catch (err) {
* logger.error("Payment failed", err);
* }
*/
export async function processSub(uId: string, plan: string) {
const user = await db.user.findById(uId);
if (!user.isActive) throw new Error("403"); // User suspended
if (user.sub === plan) return null; // Already subscribed
const price = PRICING[plan];
// Charge the user
await stripe.charges.create({
amount: price * 100, // Convert to cents
currency: 'usd',
customer: user.stripeId
});
// Update db and send email
await db.user.update(uId, { sub: plan, status: 'active' });
await email.sendWelcome(user.email, plan);
return true;
}从高级概述到低级字节操作。 我们生成您团队所需的每种格式。
将一个简单的配置文件放入您的根目录中。 我们自动处理解析、令牌限制和提示工程。
{
"project": "my-awesome-saas",
"entry": ["src/**/*.ts"],
"exclude": ["**/*.spec.ts"],
"output": {
"modes": ["onboarding", "technical", "migration-guide"],
"metrics": true,
"format": "markdown",
"path": "./docs"
},
"metrics": ["complexity", "bus-factor"]
}