7abb048edc
Implement Keycloak authentication, protected routes, and add combobox and autocomplete components for tool categories and features. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 776963d0-f75d-42e2-a57b-cc36bdff8495 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 0b145113-c016-4f54-b000-13bd3b0ba8f0 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0683fb79-a27c-485c-9333-5f4b288c4567/776963d0-f75d-42e2-a57b-cc36bdff8495/z4uWN6A Replit-Helium-Checkpoint-Created: true
188 lines
3.4 KiB
TypeScript
188 lines
3.4 KiB
TypeScript
/**
|
|
* Generated by orval v8.9.1 🍺
|
|
* Do not edit manually.
|
|
* Api
|
|
* ToolRate API — Tool listing and rating platform
|
|
* OpenAPI spec version: 0.1.0
|
|
*/
|
|
export interface HealthStatus {
|
|
status: string;
|
|
}
|
|
|
|
export interface Tool {
|
|
id: number;
|
|
name: string;
|
|
description: string;
|
|
category: string;
|
|
/** @nullable */
|
|
websiteUrl?: string | null;
|
|
features?: string[];
|
|
tags?: string[];
|
|
createdAt: string;
|
|
updatedAt: string;
|
|
}
|
|
|
|
export interface ToolWithStats {
|
|
id: number;
|
|
name: string;
|
|
description: string;
|
|
category: string;
|
|
/** @nullable */
|
|
websiteUrl?: string | null;
|
|
features?: string[];
|
|
tags?: string[];
|
|
createdAt: string;
|
|
updatedAt: string;
|
|
ratingCount: number;
|
|
/** @nullable */
|
|
avgUsefulness: number | null;
|
|
/** @nullable */
|
|
avgUsability: number | null;
|
|
/** @nullable */
|
|
avgCombined: number | null;
|
|
}
|
|
|
|
export interface ToolInput {
|
|
/** @minLength 1 */
|
|
name: string;
|
|
/** @minLength 1 */
|
|
description: string;
|
|
/** @minLength 1 */
|
|
category: string;
|
|
websiteUrl?: string;
|
|
features?: string[];
|
|
tags?: string[];
|
|
}
|
|
|
|
export interface ToolUpdate {
|
|
/** @minLength 1 */
|
|
name?: string;
|
|
description?: string;
|
|
category?: string;
|
|
websiteUrl?: string;
|
|
features?: string[];
|
|
tags?: string[];
|
|
}
|
|
|
|
export interface Rating {
|
|
id: number;
|
|
toolId: number;
|
|
/**
|
|
* @minimum 1
|
|
* @maximum 5
|
|
*/
|
|
usefulness: number;
|
|
/**
|
|
* @minimum 1
|
|
* @maximum 5
|
|
*/
|
|
usability: number;
|
|
/** @nullable */
|
|
comment?: string | null;
|
|
/** @nullable */
|
|
reviewerName?: string | null;
|
|
createdAt: string;
|
|
}
|
|
|
|
export interface RatingInput {
|
|
/**
|
|
* @minimum 1
|
|
* @maximum 5
|
|
*/
|
|
usefulness: number;
|
|
/**
|
|
* @minimum 1
|
|
* @maximum 5
|
|
*/
|
|
usability: number;
|
|
comment?: string;
|
|
reviewerName?: string;
|
|
}
|
|
|
|
export interface AnalyticsSummary {
|
|
totalTools: number;
|
|
totalRatings: number;
|
|
/** @nullable */
|
|
avgUsefulness: number | null;
|
|
/** @nullable */
|
|
avgUsability: number | null;
|
|
/** @nullable */
|
|
avgCombined: number | null;
|
|
categoriesCount: number;
|
|
mostRatedTool?: ToolWithStats;
|
|
}
|
|
|
|
export interface TopToolEntry {
|
|
tool: ToolWithStats;
|
|
score: number;
|
|
ratingCount: number;
|
|
}
|
|
|
|
export interface CategoryStats {
|
|
category: string;
|
|
toolCount: number;
|
|
totalRatings: number;
|
|
/** @nullable */
|
|
avgUsefulness: number | null;
|
|
/** @nullable */
|
|
avgUsability: number | null;
|
|
}
|
|
|
|
export interface ScoreBucket {
|
|
score: number;
|
|
count: number;
|
|
}
|
|
|
|
export interface RatingDistribution {
|
|
usefulness: ScoreBucket[];
|
|
usability: ScoreBucket[];
|
|
}
|
|
|
|
export interface AuthUser {
|
|
sub: string;
|
|
/** @nullable */
|
|
email?: string | null;
|
|
/** @nullable */
|
|
name?: string | null;
|
|
/** @nullable */
|
|
preferredUsername?: string | null;
|
|
}
|
|
|
|
export interface ErrorResponse {
|
|
error: string;
|
|
}
|
|
|
|
export type ListToolsParams = {
|
|
category?: string;
|
|
search?: string;
|
|
sort?: ListToolsSort;
|
|
};
|
|
|
|
export type ListToolsSort = typeof ListToolsSort[keyof typeof ListToolsSort];
|
|
|
|
|
|
export const ListToolsSort = {
|
|
newest: 'newest',
|
|
top_rated: 'top_rated',
|
|
most_reviewed: 'most_reviewed',
|
|
} as const;
|
|
|
|
export type GetTopToolsParams = {
|
|
limit?: number;
|
|
metric?: GetTopToolsMetric;
|
|
};
|
|
|
|
export type GetTopToolsMetric = typeof GetTopToolsMetric[keyof typeof GetTopToolsMetric];
|
|
|
|
|
|
export const GetTopToolsMetric = {
|
|
usefulness: 'usefulness',
|
|
usability: 'usability',
|
|
combined: 'combined',
|
|
} as const;
|
|
|
|
export type GetRatingDistributionParams = {
|
|
toolId?: number;
|
|
};
|
|
|