Update deps

This commit is contained in:
HugeFrog24
2026-03-26 03:35:53 +01:00
parent 1edd996336
commit c746b2c17f
68 changed files with 8504 additions and 6901 deletions
+33
View File
@@ -0,0 +1,33 @@
import { NextResponse } from 'next/server';
import { getVariant } from '@lemonsqueezy/lemonsqueezy.js';
import { initializeLemonSqueezy } from '../../config/lemonsqueezy';
import { getFeatureFlags } from '../../config/features';
import { appConfig } from '../../config/app';
export async function GET() {
const { paymentsEnabled } = getFeatureFlags();
if (!paymentsEnabled) {
return NextResponse.json({ prices: {}, enabled: false });
}
// Initialize Lemon Squeezy SDK
initializeLemonSqueezy();
const prices: Record<string, string> = {};
// Fetch prices for all premium skins
for (const [skinId, skin] of Object.entries(appConfig.skins)) {
if (skin.isPremium && skin.variantId) {
const variant = await getVariant(skin.variantId);
if (!variant.data) {
throw new Error(`No variant data found for ${skinId}`);
}
const priceInCents = variant.data.data.attributes.price;
prices[skinId] = `$${(priceInCents / 100).toFixed(2)}`;
}
}
return NextResponse.json({ prices });
}