450 lines
8.4 KiB
TypeScript
450 lines
8.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 VersionInfo {
|
|
version: string;
|
|
/** @nullable */
|
|
commitSha?: string | null;
|
|
/** @nullable */
|
|
buildDate?: string | null;
|
|
trashRetentionDays?: number;
|
|
}
|
|
|
|
export type AuthModeMode = typeof AuthModeMode[keyof typeof AuthModeMode];
|
|
|
|
|
|
export const AuthModeMode = {
|
|
oidc: 'oidc',
|
|
local: 'local',
|
|
} as const;
|
|
|
|
export interface AuthMode {
|
|
mode: AuthModeMode;
|
|
}
|
|
|
|
export interface LocalLoginInput {
|
|
username: string;
|
|
password: string;
|
|
}
|
|
|
|
export type UserRole = typeof UserRole[keyof typeof UserRole];
|
|
|
|
|
|
export const UserRole = {
|
|
admin: 'admin',
|
|
user: 'user',
|
|
} as const;
|
|
|
|
export type UserTier = typeof UserTier[keyof typeof UserTier];
|
|
|
|
|
|
export const UserTier = {
|
|
free: 'free',
|
|
premium: 'premium',
|
|
enterprise: 'enterprise',
|
|
} as const;
|
|
|
|
export type UserAuthProvider = typeof UserAuthProvider[keyof typeof UserAuthProvider];
|
|
|
|
|
|
export const UserAuthProvider = {
|
|
local: 'local',
|
|
oidc: 'oidc',
|
|
} as const;
|
|
|
|
export interface User {
|
|
id: number;
|
|
username: string;
|
|
/** @nullable */
|
|
email?: string | null;
|
|
role: UserRole;
|
|
tier?: UserTier;
|
|
authProvider?: UserAuthProvider;
|
|
createdAt: string;
|
|
}
|
|
|
|
export type UserCreateInputRole = typeof UserCreateInputRole[keyof typeof UserCreateInputRole];
|
|
|
|
|
|
export const UserCreateInputRole = {
|
|
admin: 'admin',
|
|
user: 'user',
|
|
} as const;
|
|
|
|
export type UserCreateInputTier = typeof UserCreateInputTier[keyof typeof UserCreateInputTier];
|
|
|
|
|
|
export const UserCreateInputTier = {
|
|
free: 'free',
|
|
premium: 'premium',
|
|
enterprise: 'enterprise',
|
|
} as const;
|
|
|
|
export interface UserCreateInput {
|
|
/** @minLength 2 */
|
|
username: string;
|
|
/** @minLength 6 */
|
|
password: string;
|
|
email?: string;
|
|
role?: UserCreateInputRole;
|
|
tier?: UserCreateInputTier;
|
|
}
|
|
|
|
export type UserRoleUpdateRole = typeof UserRoleUpdateRole[keyof typeof UserRoleUpdateRole];
|
|
|
|
|
|
export const UserRoleUpdateRole = {
|
|
admin: 'admin',
|
|
user: 'user',
|
|
} as const;
|
|
|
|
export type UserRoleUpdateTier = typeof UserRoleUpdateTier[keyof typeof UserRoleUpdateTier];
|
|
|
|
|
|
export const UserRoleUpdateTier = {
|
|
free: 'free',
|
|
premium: 'premium',
|
|
enterprise: 'enterprise',
|
|
} as const;
|
|
|
|
export interface UserRoleUpdate {
|
|
role?: UserRoleUpdateRole;
|
|
tier?: UserRoleUpdateTier;
|
|
}
|
|
|
|
export interface ChangePasswordInput {
|
|
/** @minLength 1 */
|
|
currentPassword: string;
|
|
/** @minLength 8 */
|
|
newPassword: string;
|
|
}
|
|
|
|
export interface SetPasswordInput {
|
|
/** @minLength 8 */
|
|
password: string;
|
|
}
|
|
|
|
export interface PasswordRedirect {
|
|
/** @nullable */
|
|
url: string | null;
|
|
}
|
|
|
|
export interface AuditLog {
|
|
id: number;
|
|
entityType: string;
|
|
/** @nullable */
|
|
entityId?: number | null;
|
|
action: string;
|
|
userId: string;
|
|
username: string;
|
|
/** @nullable */
|
|
changes?: string | null;
|
|
createdAt: string;
|
|
}
|
|
|
|
export interface Tool {
|
|
id: number;
|
|
name: string;
|
|
description: string;
|
|
category: string;
|
|
/** @nullable */
|
|
websiteUrl?: string | null;
|
|
/** @nullable */
|
|
iconUrl?: string | null;
|
|
/** @nullable */
|
|
createdBy?: string | null;
|
|
features?: string[];
|
|
tags?: string[];
|
|
createdAt: string;
|
|
updatedAt: string;
|
|
/** @nullable */
|
|
deletedAt?: string | null;
|
|
/** @nullable */
|
|
deletedBy?: string | null;
|
|
}
|
|
|
|
export interface RatingHistoryItem {
|
|
date: string;
|
|
usefulness: number;
|
|
usability: number;
|
|
combined: number;
|
|
}
|
|
|
|
export interface ToolWithStats {
|
|
id: number;
|
|
name: string;
|
|
description: string;
|
|
category: string;
|
|
/** @nullable */
|
|
websiteUrl?: string | null;
|
|
/** @nullable */
|
|
iconUrl?: string | null;
|
|
/** @nullable */
|
|
createdBy?: 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;
|
|
iconUrl?: string;
|
|
features?: string[];
|
|
tags?: string[];
|
|
}
|
|
|
|
export interface ToolUpdate {
|
|
/** @minLength 1 */
|
|
name?: string;
|
|
description?: string;
|
|
category?: string;
|
|
/** @nullable */
|
|
websiteUrl?: string | null;
|
|
/** @nullable */
|
|
iconUrl?: string | null;
|
|
features?: string[];
|
|
tags?: string[];
|
|
}
|
|
|
|
export interface TrashToolsInput {
|
|
/**
|
|
* @minItems 1
|
|
* @maxItems 500
|
|
*/
|
|
ids: number[];
|
|
}
|
|
|
|
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 type AuthUserRole = typeof AuthUserRole[keyof typeof AuthUserRole];
|
|
|
|
|
|
export const AuthUserRole = {
|
|
admin: 'admin',
|
|
user: 'user',
|
|
} as const;
|
|
|
|
export type AuthUserTier = typeof AuthUserTier[keyof typeof AuthUserTier];
|
|
|
|
|
|
export const AuthUserTier = {
|
|
free: 'free',
|
|
premium: 'premium',
|
|
enterprise: 'enterprise',
|
|
} as const;
|
|
|
|
export interface AuthUser {
|
|
sub: string;
|
|
/** @nullable */
|
|
email?: string | null;
|
|
/** @nullable */
|
|
name?: string | null;
|
|
/** @nullable */
|
|
preferredUsername?: string | null;
|
|
role?: AuthUserRole;
|
|
tier?: AuthUserTier;
|
|
entitlements?: string[];
|
|
isLocal?: boolean;
|
|
}
|
|
|
|
export type UserPreferencesView = typeof UserPreferencesView[keyof typeof UserPreferencesView];
|
|
|
|
|
|
export const UserPreferencesView = {
|
|
grid: 'grid',
|
|
table: 'table',
|
|
rows: 'rows',
|
|
} as const;
|
|
|
|
export type UserPreferencesDensity = typeof UserPreferencesDensity[keyof typeof UserPreferencesDensity];
|
|
|
|
|
|
export const UserPreferencesDensity = {
|
|
cozy: 'cozy',
|
|
compact: 'compact',
|
|
} as const;
|
|
|
|
export interface UserPreferences {
|
|
view?: UserPreferencesView;
|
|
density?: UserPreferencesDensity;
|
|
watchlist?: number[];
|
|
}
|
|
|
|
export interface ErrorResponse {
|
|
error: string;
|
|
}
|
|
|
|
export type ListToolsParams = {
|
|
category?: string;
|
|
search?: string;
|
|
sort?: ListToolsSort;
|
|
/**
|
|
* Comma-separated tags; tool must include all of them
|
|
*/
|
|
tags?: string;
|
|
/**
|
|
* Comma-separated features; tool must include all of them
|
|
*/
|
|
features?: string;
|
|
/**
|
|
* Minimum average combined rating (0-5)
|
|
* @minimum 0
|
|
* @maximum 5
|
|
*/
|
|
minRating?: number;
|
|
};
|
|
|
|
export type ListToolsSort = typeof ListToolsSort[keyof typeof ListToolsSort];
|
|
|
|
|
|
export const ListToolsSort = {
|
|
newest: 'newest',
|
|
top_rated: 'top_rated',
|
|
most_reviewed: 'most_reviewed',
|
|
name_asc: 'name_asc',
|
|
name_desc: 'name_desc',
|
|
recently_updated: 'recently_updated',
|
|
} as const;
|
|
|
|
export type ListCompareToolsParams = {
|
|
/**
|
|
* Comma-separated tool ids
|
|
*/
|
|
ids: string;
|
|
};
|
|
|
|
export type ListTrashedToolsParams = {
|
|
search?: string;
|
|
};
|
|
|
|
export type TrashTools200 = {
|
|
trashed?: number;
|
|
};
|
|
|
|
export type RestoreTools200 = {
|
|
restored?: number;
|
|
};
|
|
|
|
export type EmptyTrash200 = {
|
|
deleted?: number;
|
|
};
|
|
|
|
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;
|
|
};
|
|
|
|
export type ListAuditLogsParams = {
|
|
entityType?: string;
|
|
entityId?: number;
|
|
limit?: number;
|
|
};
|
|
|