mirror of
https://github.com/yusufipk/RepoHub.git
synced 2026-09-11 10:36:07 +00:00
- Remove experienceLevel from UserProfile, RecommendationRequest, and PackagePreset types - Remove experience level validation and handling from GET/POST endpoints - Disable localStorage persistence in useRecommendationProfile hook (session-only storage) - Disable automatic onboarding modal on first visit - Set recommendations section to expanded by default - Add empty state card for recommendations with wizard button - Add translations
95 lines
2.0 KiB
TypeScript
95 lines
2.0 KiB
TypeScript
import { Package, Platform } from "./index";
|
|
|
|
/**
|
|
* User category types for package recommendations
|
|
*/
|
|
export type UserCategory =
|
|
| "development"
|
|
| "design"
|
|
| "multimedia"
|
|
| "system-tools"
|
|
| "gaming"
|
|
| "productivity"
|
|
| "education";
|
|
|
|
/**
|
|
* User profile stored in localStorage
|
|
*/
|
|
export interface UserProfile {
|
|
version: number; // Schema version for future migrations
|
|
categories: UserCategory[];
|
|
detectedOS?: string;
|
|
selectedOS?: string; // Manual override
|
|
hasCompletedOnboarding: boolean;
|
|
createdAt: string;
|
|
lastUpdated: string;
|
|
}
|
|
|
|
/**
|
|
* Request payload for recommendation API
|
|
*/
|
|
export interface RecommendationRequest {
|
|
platform_id: string;
|
|
categories: UserCategory[];
|
|
limit?: number;
|
|
}
|
|
|
|
/**
|
|
* Recommended package with score
|
|
*/
|
|
export interface RecommendedPackage {
|
|
id: string;
|
|
name: string;
|
|
description: string;
|
|
version: string;
|
|
category?: string;
|
|
license?: string;
|
|
type: "gui" | "cli";
|
|
platform?: Platform;
|
|
platform_id?: string;
|
|
repository: "official" | "third-party" | "aur";
|
|
download_url?: string;
|
|
lastUpdated?: string;
|
|
downloads?: number;
|
|
popularity?: number;
|
|
popularity_score?: number;
|
|
tags?: string[];
|
|
recommendationScore: number;
|
|
recommendationReason: string;
|
|
presetMatch?: boolean;
|
|
matchedCategory?: UserCategory; // Which user category this package matched
|
|
icon?: string;
|
|
}
|
|
|
|
/**
|
|
* Preset package configuration
|
|
*/
|
|
export interface PackagePreset {
|
|
packageName: string;
|
|
platforms: string[]; // ['windows', 'macos', 'ubuntu', 'arch', 'fedora']
|
|
priority: number; // 1-10, higher = more important
|
|
reason: string; // Why this package is recommended
|
|
}
|
|
|
|
/**
|
|
* Category preset configuration
|
|
*/
|
|
export interface CategoryPreset {
|
|
category: UserCategory;
|
|
packages: PackagePreset[];
|
|
description: string;
|
|
// Icon removed in favor of UI-side mapping
|
|
}
|
|
|
|
/**
|
|
* Recommendation response
|
|
*/
|
|
export interface RecommendationResponse {
|
|
recommendations: RecommendedPackage[];
|
|
total: number;
|
|
userProfile: {
|
|
categories: UserCategory[];
|
|
platform: string;
|
|
};
|
|
}
|