Final commit
This commit is contained in:
parent
91fffb3294
commit
c35e0716af
372 changed files with 16591 additions and 1 deletions
19
backend/types/ai.ts
Normal file
19
backend/types/ai.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
export type AiSuggestionsOutput = {
|
||||
type: "success";
|
||||
songs: {
|
||||
title: string;
|
||||
artist: string;
|
||||
}[];
|
||||
} | {
|
||||
type: "error";
|
||||
error: string;
|
||||
};
|
||||
|
||||
export interface SongSearch {
|
||||
title: string;
|
||||
artist: string;
|
||||
}
|
||||
|
||||
export interface AiSnewuggestionOutput {
|
||||
songs: SongSearch[];
|
||||
}
|
47
backend/types/api.ts
Normal file
47
backend/types/api.ts
Normal file
|
@ -0,0 +1,47 @@
|
|||
import { SpotifyTrack } from "./spotify.ts";
|
||||
|
||||
export interface GetSongsTextParams {
|
||||
prompt: string;
|
||||
rules: string;
|
||||
}
|
||||
|
||||
export type GetSongsTextOutput = {
|
||||
type: "success";
|
||||
songs: SpotifyTrack[];
|
||||
} | {
|
||||
type: "error";
|
||||
error: string;
|
||||
};
|
||||
|
||||
export interface GetYoutubeInput {
|
||||
title: string;
|
||||
artist: string;
|
||||
}
|
||||
|
||||
export interface GetYoutubeOutput {
|
||||
videoId?: string;
|
||||
}
|
||||
|
||||
export interface GetTrackInput {
|
||||
trackId: string;
|
||||
}
|
||||
|
||||
export interface GetTrackOutput {
|
||||
track: SpotifyTrack;
|
||||
}
|
||||
|
||||
export type GetNewSuggestInput =
|
||||
& {
|
||||
rules: string;
|
||||
}
|
||||
& ({
|
||||
type: "scratch-suggestion";
|
||||
room_name: string;
|
||||
} | {
|
||||
type: "from-songs-suggestion";
|
||||
songs: { song: string }[];
|
||||
});
|
||||
|
||||
export type GetNewSuggestOutput = {
|
||||
songs: SpotifyTrack[];
|
||||
};
|
97
backend/types/spotify.ts
Normal file
97
backend/types/spotify.ts
Normal file
|
@ -0,0 +1,97 @@
|
|||
export interface SpotifyArtist {
|
||||
external_urls: {
|
||||
spotify: string;
|
||||
};
|
||||
href: string;
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
uri: string;
|
||||
}
|
||||
|
||||
export interface SpotifyAlbum {
|
||||
album_type: string;
|
||||
total_tracks: number;
|
||||
available_markets: string[];
|
||||
external_urls: {
|
||||
spotify: string;
|
||||
};
|
||||
href: string;
|
||||
id: string;
|
||||
images: Array<{
|
||||
url: string;
|
||||
height: number;
|
||||
width: number;
|
||||
}>;
|
||||
name: string;
|
||||
release_date: string;
|
||||
release_date_precision: string;
|
||||
type: string;
|
||||
uri: string;
|
||||
artists: SpotifyArtist[];
|
||||
is_playable?: boolean;
|
||||
}
|
||||
|
||||
export interface SpotifyTrack {
|
||||
album: SpotifyAlbum;
|
||||
artists: SpotifyArtist[];
|
||||
available_markets: string[];
|
||||
disc_number: number;
|
||||
duration_ms: number;
|
||||
explicit: boolean;
|
||||
external_ids: {
|
||||
isrc?: string;
|
||||
};
|
||||
external_urls: {
|
||||
spotify: string;
|
||||
};
|
||||
href: string;
|
||||
id: string;
|
||||
is_playable?: boolean;
|
||||
name: string;
|
||||
popularity: number;
|
||||
preview_url: string | null;
|
||||
track_number: number;
|
||||
type: string;
|
||||
uri: string;
|
||||
is_local: boolean;
|
||||
}
|
||||
|
||||
export interface SpotifySearchResponse {
|
||||
tracks: {
|
||||
href: string;
|
||||
limit: number;
|
||||
next: string | null;
|
||||
offset: number;
|
||||
previous: string | null;
|
||||
total: number;
|
||||
items: SpotifyTrack[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface SearchResultTrack {
|
||||
id: string;
|
||||
name: string;
|
||||
artists: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
spotify_url: string;
|
||||
}>;
|
||||
album: {
|
||||
id: string;
|
||||
name: string;
|
||||
release_date: string;
|
||||
images: Array<{
|
||||
url: string;
|
||||
height: number;
|
||||
width: number;
|
||||
}>;
|
||||
spotify_url: string;
|
||||
};
|
||||
duration_ms: number;
|
||||
popularity: number;
|
||||
preview_url: string | null;
|
||||
spotify_url: string;
|
||||
explicit: boolean;
|
||||
available_markets: string[];
|
||||
}
|
4
backend/types/youtube.ts
Normal file
4
backend/types/youtube.ts
Normal file
|
@ -0,0 +1,4 @@
|
|||
export interface Vids {
|
||||
title: string;
|
||||
artist: string;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue