feat: expose member playlists over HTTP
This commit is contained in:
1 parent
dd639169f9
commit
d9a97b6331
11 files changed
+1158
-31
No files matched your search
@@ -1,6 +1,14 @@
|
||||
// Code generated by protocolgen from protocol/idl.json; DO NOT EDIT.
|
||||
|
||||
import type { APIKey, Account, AdminAccount, ErrorInfo, Member, QQLoginType, QRLogin, QRLoginResult, RoomListing, SourceAccount, StoredMedia } from '../realtime/protocol.gen'
|
||||
import type { APIKey, Account, AdminAccount, ErrorInfo, Member, MyPlaylist, MyPlaylistItem, QQLoginType, QRLogin, QRLoginResult, RoomListing, SourceAccount, StoredMedia, Track } from '../realtime/protocol.gen'
|
||||
|
||||
export interface AddMyPlaylistItemRequest {
|
||||
track: Track
|
||||
}
|
||||
|
||||
export interface AddMyPlaylistItemResponse {
|
||||
item: MyPlaylistItem
|
||||
}
|
||||
|
||||
export interface AdminCheckBilibiliLoginRequest {
|
||||
key: string
|
||||
@@ -108,6 +116,10 @@ export interface CreateMemberResponse {
|
||||
memberToken: string
|
||||
}
|
||||
|
||||
export interface CreateMyPlaylistRequest {
|
||||
name: string
|
||||
}
|
||||
|
||||
export interface CreateRoomRequest {
|
||||
description: string
|
||||
name: string
|
||||
@@ -136,6 +148,14 @@ export interface GetSiteResponse {
|
||||
registrationOpen: boolean
|
||||
}
|
||||
|
||||
export interface ListMyPlaylistItemsResponse {
|
||||
items: MyPlaylistItem[]
|
||||
}
|
||||
|
||||
export interface ListMyPlaylistsResponse {
|
||||
items: MyPlaylist[]
|
||||
}
|
||||
|
||||
export interface ListRoomsResponse {
|
||||
items: RoomListing[]
|
||||
}
|
||||
@@ -160,6 +180,14 @@ export interface RegisterResponse {
|
||||
account: Account
|
||||
}
|
||||
|
||||
export interface RemoveMyPlaylistItemRequest {
|
||||
track: Track
|
||||
}
|
||||
|
||||
export interface RenameMyPlaylistRequest {
|
||||
name: string
|
||||
}
|
||||
|
||||
export interface UpdateMeRequest {
|
||||
email?: string
|
||||
name?: string
|
||||
@@ -193,6 +221,13 @@ export function httpClient(send: HttpSend) {
|
||||
changePassword: (body: ChangePasswordRequest) => send<void>({ method: 'PUT', path: '/api/account/password', auth: 'member', body }),
|
||||
login: (body: LoginRequest) => send<LoginResponse>({ method: 'POST', path: '/api/sessions', auth: 'member', body }),
|
||||
logout: () => send<void>({ method: 'DELETE', path: '/api/sessions/current', auth: 'member' }),
|
||||
listMyPlaylists: () => send<ListMyPlaylistsResponse>({ method: 'GET', path: '/api/me/playlists', auth: 'member' }),
|
||||
createMyPlaylist: (body: CreateMyPlaylistRequest) => send<MyPlaylist>({ method: 'POST', path: '/api/me/playlists', auth: 'member', body }),
|
||||
renameMyPlaylist: (id: string, body: RenameMyPlaylistRequest) => send<void>({ method: 'PATCH', path: `/api/me/playlists/${encodeURIComponent(id)}`, auth: 'member', body }),
|
||||
deleteMyPlaylist: (id: string) => send<void>({ method: 'DELETE', path: `/api/me/playlists/${encodeURIComponent(id)}`, auth: 'member' }),
|
||||
listMyPlaylistItems: (id: string) => send<ListMyPlaylistItemsResponse>({ method: 'GET', path: `/api/me/playlists/${encodeURIComponent(id)}/items`, auth: 'member' }),
|
||||
addMyPlaylistItem: (id: string, body: AddMyPlaylistItemRequest) => send<AddMyPlaylistItemResponse>({ method: 'POST', path: `/api/me/playlists/${encodeURIComponent(id)}/items`, auth: 'member', body }),
|
||||
removeMyPlaylistItem: (id: string, body: RemoveMyPlaylistItemRequest) => send<void>({ method: 'POST', path: `/api/me/playlists/${encodeURIComponent(id)}/removals`, auth: 'member', body }),
|
||||
listRooms: () => send<ListRoomsResponse>({ method: 'GET', path: '/api/rooms', auth: 'none' }),
|
||||
getRoom: (ref: string) => send<RoomListing>({ method: 'GET', path: `/api/rooms/${encodeURIComponent(ref)}`, auth: 'none' }),
|
||||
createRoom: (body: CreateRoomRequest) => send<CreateRoomResponse>({ method: 'POST', path: '/api/rooms', auth: 'none', body }),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protocolgen from protocol/idl.json; DO NOT EDIT.
|
||||
|
||||
export const PROTOCOL_VERSION = 'eae091a3e1daf18c'
|
||||
export const PROTOCOL_VERSION = '1132502d511e1bab'
|
||||
|
||||
export interface APIKey {
|
||||
key: string
|
||||
@@ -72,6 +72,21 @@ export interface Members {
|
||||
sessions: Member[]
|
||||
}
|
||||
|
||||
export interface MyPlaylist {
|
||||
coverUrl: string | null
|
||||
createdAtMs: number
|
||||
favorites: boolean
|
||||
id: string
|
||||
name: string
|
||||
trackCount: number
|
||||
updatedAtMs: number
|
||||
}
|
||||
|
||||
export interface MyPlaylistItem {
|
||||
meta: TrackMeta
|
||||
track: Track
|
||||
}
|
||||
|
||||
export interface NowPlaying {
|
||||
durationMs: number
|
||||
entry: Entry
|
||||
|
||||
Reference in new issue
Block a user