style: auto-format codebase with Prettier

Applied formatting to 1487+ files using pnpm format:write
  - TypeScript/JavaScript files
  - Svelte components
  - Astro pages
  - JSON configs
  - Markdown docs

  13 files still need manual review (Astro JSX comments)
This commit is contained in:
Wuesteon 2025-11-27 18:33:16 +01:00
parent 0241f5554c
commit d36b321d9d
3952 changed files with 661498 additions and 739751 deletions

View file

@ -7,33 +7,33 @@
// Plan types
export {
type BillingCycle,
type PlanCategory,
type SubscriptionPlan,
type ManaPackage,
type ProductMapping,
type PackageMapping,
type FreeTierConfig,
DEFAULT_FREE_TIER,
type BillingCycle,
type PlanCategory,
type SubscriptionPlan,
type ManaPackage,
type ProductMapping,
type PackageMapping,
type FreeTierConfig,
DEFAULT_FREE_TIER,
} from './plans';
// Usage types
export {
type UsageData,
type UsageHistoryEntry,
type CostItem,
type ManaBalance,
type CreditTransaction,
type OperationPricing,
type UsageData,
type UsageHistoryEntry,
type CostItem,
type ManaBalance,
type CreditTransaction,
type OperationPricing,
} from './usage';
// RevenueCat types
export {
type RevenueCatSubscriptionPlan,
type RevenueCatManaPackage,
type SubscriptionServiceData,
type PurchaseResult,
type CustomerSubscriptionStatus,
type RestorePurchasesResult,
type RevenueCatOffering,
type RevenueCatSubscriptionPlan,
type RevenueCatManaPackage,
type SubscriptionServiceData,
type PurchaseResult,
type CustomerSubscriptionStatus,
type RestorePurchasesResult,
type RevenueCatOffering,
} from './revenueCat';

View file

@ -16,121 +16,121 @@ export type PlanCategory = 'individual' | 'team' | 'enterprise';
* Base subscription plan interface
*/
export interface SubscriptionPlan {
/** Unique identifier */
id: string;
/** Display name (localized) */
name: string;
/** English name */
nameEn?: string;
/** German name */
nameDe?: string;
/** Italian name */
nameIt?: string;
/** Price in local currency */
price: number;
/** Formatted price string (e.g., "5,99€") */
priceString?: string;
/** Currency code (e.g., "EUR") */
currencyCode?: string;
/** Price breakdown text */
priceBreakdown?: string;
/** Monthly equivalent for yearly plans */
monthlyEquivalent?: number;
/** Mana amount per month */
monthlyMana: number;
/** Initial mana grant on signup */
initialMana?: number;
/** Daily mana regeneration */
dailyMana?: number;
/** Maximum mana capacity */
maxMana?: number;
/** Whether user can gift mana */
canGiftMana: boolean;
/** Mark as popular/recommended */
popular?: boolean;
/** Billing frequency */
billingCycle: BillingCycle;
/** Team subscription flag */
isTeamSubscription?: boolean;
/** Enterprise subscription flag */
isEnterpriseSubscription?: boolean;
/** Plan features list */
features?: string[];
/** Unique identifier */
id: string;
/** Display name (localized) */
name: string;
/** English name */
nameEn?: string;
/** German name */
nameDe?: string;
/** Italian name */
nameIt?: string;
/** Price in local currency */
price: number;
/** Formatted price string (e.g., "5,99€") */
priceString?: string;
/** Currency code (e.g., "EUR") */
currencyCode?: string;
/** Price breakdown text */
priceBreakdown?: string;
/** Monthly equivalent for yearly plans */
monthlyEquivalent?: number;
/** Mana amount per month */
monthlyMana: number;
/** Initial mana grant on signup */
initialMana?: number;
/** Daily mana regeneration */
dailyMana?: number;
/** Maximum mana capacity */
maxMana?: number;
/** Whether user can gift mana */
canGiftMana: boolean;
/** Mark as popular/recommended */
popular?: boolean;
/** Billing frequency */
billingCycle: BillingCycle;
/** Team subscription flag */
isTeamSubscription?: boolean;
/** Enterprise subscription flag */
isEnterpriseSubscription?: boolean;
/** Plan features list */
features?: string[];
}
/**
* One-time mana package interface
*/
export interface ManaPackage {
/** Unique identifier */
id: string;
/** Display name (localized) */
name: string;
/** English name */
nameEn?: string;
/** German name */
nameDe?: string;
/** Italian name */
nameIt?: string;
/** Mana amount */
manaAmount: number;
/** Price in local currency */
price: number;
/** Formatted price string */
priceString?: string;
/** Currency code */
currencyCode?: string;
/** Team package flag */
isTeamPackage?: boolean;
/** Enterprise package flag */
isEnterprisePackage?: boolean;
/** Mark as popular */
popular?: boolean;
/** Unique identifier */
id: string;
/** Display name (localized) */
name: string;
/** English name */
nameEn?: string;
/** German name */
nameDe?: string;
/** Italian name */
nameIt?: string;
/** Mana amount */
manaAmount: number;
/** Price in local currency */
price: number;
/** Formatted price string */
priceString?: string;
/** Currency code */
currencyCode?: string;
/** Team package flag */
isTeamPackage?: boolean;
/** Enterprise package flag */
isEnterprisePackage?: boolean;
/** Mark as popular */
popular?: boolean;
}
/**
* Product mapping for RevenueCat
*/
export interface ProductMapping {
/** Internal subscription ID */
subscriptionId: string;
/** App Store/Play Store product ID */
productId: string;
/** Billing cycle */
billingCycle: BillingCycle;
/** Category */
category: PlanCategory;
/** Internal subscription ID */
subscriptionId: string;
/** App Store/Play Store product ID */
productId: string;
/** Billing cycle */
billingCycle: BillingCycle;
/** Category */
category: PlanCategory;
}
/**
* Package mapping for RevenueCat
*/
export interface PackageMapping {
/** Internal package ID */
packageId: string;
/** App Store/Play Store product ID */
productId: string;
/** Category */
category: PlanCategory;
/** Internal package ID */
packageId: string;
/** App Store/Play Store product ID */
productId: string;
/** Category */
category: PlanCategory;
}
/**
* Free tier configuration
*/
export interface FreeTierConfig {
/** Initial mana for free users */
initialMana: number;
/** Daily mana regeneration */
dailyMana: number;
/** Maximum mana capacity */
maxMana: number;
/** Initial mana for free users */
initialMana: number;
/** Daily mana regeneration */
dailyMana: number;
/** Maximum mana capacity */
maxMana: number;
}
/**
* Default free tier configuration
*/
export const DEFAULT_FREE_TIER: FreeTierConfig = {
initialMana: 150,
dailyMana: 5,
maxMana: 150,
initialMana: 150,
dailyMana: 5,
maxMana: 150,
};

View file

@ -8,92 +8,92 @@ import type { SubscriptionPlan, ManaPackage } from './plans';
* RevenueCat-enhanced subscription plan
*/
export interface RevenueCatSubscriptionPlan extends SubscriptionPlan {
/** RevenueCat package object */
revenueCatPackage?: unknown;
/** RevenueCat product object */
revenueCatProduct?: unknown;
/** App Store/Play Store product ID */
productId: string;
/** RevenueCat package object */
revenueCatPackage?: unknown;
/** RevenueCat product object */
revenueCatProduct?: unknown;
/** App Store/Play Store product ID */
productId: string;
}
/**
* RevenueCat-enhanced mana package
*/
export interface RevenueCatManaPackage extends ManaPackage {
/** RevenueCat package object */
revenueCatPackage?: unknown;
/** RevenueCat product object */
revenueCatProduct?: unknown;
/** App Store/Play Store product ID */
productId: string;
/** RevenueCat package object */
revenueCatPackage?: unknown;
/** RevenueCat product object */
revenueCatProduct?: unknown;
/** App Store/Play Store product ID */
productId: string;
}
/**
* Subscription service data response
*/
export interface SubscriptionServiceData {
/** All available subscription plans */
subscriptions: RevenueCatSubscriptionPlan[];
/** All available one-time packages */
packages: RevenueCatManaPackage[];
/** Whether data is from RevenueCat or fallback */
isFromRevenueCat: boolean;
/** Last update timestamp */
lastUpdated: Date;
/** All available subscription plans */
subscriptions: RevenueCatSubscriptionPlan[];
/** All available one-time packages */
packages: RevenueCatManaPackage[];
/** Whether data is from RevenueCat or fallback */
isFromRevenueCat: boolean;
/** Last update timestamp */
lastUpdated: Date;
}
/**
* Purchase result
*/
export interface PurchaseResult {
/** Whether purchase was successful */
success: boolean;
/** Customer info from RevenueCat */
customerInfo?: unknown;
/** Error message if failed */
error?: string;
/** Whether purchase was successful */
success: boolean;
/** Customer info from RevenueCat */
customerInfo?: unknown;
/** Error message if failed */
error?: string;
}
/**
* Customer subscription status
*/
export interface CustomerSubscriptionStatus {
/** Whether user has active subscription */
hasActiveSubscription: boolean;
/** Current plan ID */
currentPlanId?: string;
/** Subscription expiration date */
expirationDate?: Date;
/** Whether in grace period */
isInGracePeriod?: boolean;
/** Whether subscription will renew */
willRenew?: boolean;
/** Whether user has active subscription */
hasActiveSubscription: boolean;
/** Current plan ID */
currentPlanId?: string;
/** Subscription expiration date */
expirationDate?: Date;
/** Whether in grace period */
isInGracePeriod?: boolean;
/** Whether subscription will renew */
willRenew?: boolean;
}
/**
* Restore purchases result
*/
export interface RestorePurchasesResult {
/** Whether restore was successful */
success: boolean;
/** Restored subscription plan ID */
restoredPlanId?: string;
/** Error message if failed */
error?: string;
/** Whether restore was successful */
success: boolean;
/** Restored subscription plan ID */
restoredPlanId?: string;
/** Error message if failed */
error?: string;
}
/**
* Offering from RevenueCat
*/
export interface RevenueCatOffering {
/** Offering identifier */
identifier: string;
/** Available packages in this offering */
availablePackages: RevenueCatSubscriptionPlan[];
/** Lifetime package (if available) */
lifetime?: RevenueCatManaPackage;
/** Annual package */
annual?: RevenueCatSubscriptionPlan;
/** Monthly package */
monthly?: RevenueCatSubscriptionPlan;
/** Offering identifier */
identifier: string;
/** Available packages in this offering */
availablePackages: RevenueCatSubscriptionPlan[];
/** Lifetime package (if available) */
lifetime?: RevenueCatManaPackage;
/** Annual package */
annual?: RevenueCatSubscriptionPlan;
/** Monthly package */
monthly?: RevenueCatSubscriptionPlan;
}

View file

@ -6,88 +6,88 @@
* Usage data for displaying user's mana consumption
*/
export interface UsageData {
/** Total mana consumed all time */
total: number;
/** Mana consumed last week */
lastWeek: number;
/** Mana consumed last month */
lastMonth: number;
/** Current mana balance */
currentMana: number;
/** Maximum mana capacity */
maxMana: number;
/** Usage history */
history?: UsageHistoryEntry[];
/** Total mana consumed all time */
total: number;
/** Mana consumed last week */
lastWeek: number;
/** Mana consumed last month */
lastMonth: number;
/** Current mana balance */
currentMana: number;
/** Maximum mana capacity */
maxMana: number;
/** Usage history */
history?: UsageHistoryEntry[];
}
/**
* Single usage history entry
*/
export interface UsageHistoryEntry {
/** Date of usage (ISO string) */
date: string;
/** Amount consumed */
amount: number;
/** Action type (optional) */
action?: string;
/** Date of usage (ISO string) */
date: string;
/** Amount consumed */
amount: number;
/** Action type (optional) */
action?: string;
}
/**
* Cost item for displaying operation costs
*/
export interface CostItem {
/** Action description */
action: string;
/** Translation key for action */
actionKey?: string;
/** Mana cost */
cost: number;
/** Icon name */
icon: string;
/** Action description */
action: string;
/** Translation key for action */
actionKey?: string;
/** Mana cost */
cost: number;
/** Icon name */
icon: string;
}
/**
* User's credit/mana balance
*/
export interface ManaBalance {
/** Current mana amount */
current: number;
/** Maximum capacity */
max: number;
/** Last updated timestamp */
lastUpdated: string;
/** Current mana amount */
current: number;
/** Maximum capacity */
max: number;
/** Last updated timestamp */
lastUpdated: string;
}
/**
* Credit transaction record
*/
export interface CreditTransaction {
/** Transaction ID */
id: string;
/** User ID */
userId: string;
/** Amount (positive = credit, negative = debit) */
amount: number;
/** Transaction type */
type: 'purchase' | 'subscription' | 'usage' | 'gift' | 'refund' | 'bonus';
/** Description */
description: string;
/** Timestamp */
createdAt: string;
/** Related operation ID (if applicable) */
operationId?: string;
/** Transaction ID */
id: string;
/** User ID */
userId: string;
/** Amount (positive = credit, negative = debit) */
amount: number;
/** Transaction type */
type: 'purchase' | 'subscription' | 'usage' | 'gift' | 'refund' | 'bonus';
/** Description */
description: string;
/** Timestamp */
createdAt: string;
/** Related operation ID (if applicable) */
operationId?: string;
}
/**
* Pricing information for operations
*/
export interface OperationPricing {
/** Operation key */
operation: string;
/** Base cost in mana */
baseCost: number;
/** Per-unit cost (e.g., per minute, per token) */
perUnitCost?: number;
/** Unit type */
unitType?: 'minute' | 'token' | 'request';
/** Operation key */
operation: string;
/** Base cost in mana */
baseCost: number;
/** Per-unit cost (e.g., per minute, per token) */
perUnitCost?: number;
/** Unit type */
unitType?: 'minute' | 'token' | 'request';
}