mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 12:30:12 +02:00
check authentication for all servers on initialization and update permission roles
This commit is contained in:
@@ -7,9 +7,13 @@ const baseResponse = z.object({
|
||||
}),
|
||||
});
|
||||
|
||||
const authenticate = z.object({
|
||||
const userParameters = z.object({
|
||||
id: z.string(),
|
||||
});
|
||||
|
||||
const user = z.object({
|
||||
user: z.object({
|
||||
adminRoles: z.boolean(),
|
||||
adminRole: z.boolean(),
|
||||
commentRole: z.boolean(),
|
||||
coverArtRole: z.boolean(),
|
||||
downloadRole: z.boolean(),
|
||||
@@ -26,6 +30,8 @@ const authenticate = z.object({
|
||||
}),
|
||||
});
|
||||
|
||||
const authenticate = user;
|
||||
|
||||
const authenticateParameters = z.object({
|
||||
c: z.string(),
|
||||
f: z.string(),
|
||||
@@ -641,6 +647,7 @@ export const ssType = {
|
||||
structuredLyrics: structuredLyricsParameters,
|
||||
topSongsList: topSongsListParameters,
|
||||
updatePlaylist: updatePlaylistParameters,
|
||||
user: userParameters,
|
||||
},
|
||||
_response: {
|
||||
album,
|
||||
@@ -683,5 +690,6 @@ export const ssType = {
|
||||
song,
|
||||
structuredLyrics,
|
||||
topSongsList,
|
||||
user,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1276,7 +1276,6 @@ export type ControllerEndpoint = {
|
||||
getAlbumInfo?: (args: AlbumDetailArgs) => Promise<AlbumInfo>;
|
||||
getAlbumList: (args: AlbumListArgs) => Promise<AlbumListResponse>;
|
||||
getAlbumListCount: (args: AlbumListCountArgs) => Promise<number>;
|
||||
// getArtistInfo?: (args: any) => void;
|
||||
getArtistList: (args: ArtistListArgs) => Promise<ArtistListResponse>;
|
||||
getArtistListCount: (args: ArtistListCountArgs) => Promise<number>;
|
||||
getDownloadUrl: (args: DownloadArgs) => string;
|
||||
@@ -1299,6 +1298,8 @@ export type ControllerEndpoint = {
|
||||
getStructuredLyrics?: (args: StructuredLyricsArgs) => Promise<StructuredLyric[]>;
|
||||
getTagList?: (args: TagListArgs) => Promise<TagListResponse>;
|
||||
getTopSongs: (args: TopSongListArgs) => Promise<TopSongListResponse>;
|
||||
// getArtistInfo?: (args: any) => void;
|
||||
getUserInfo: (args: UserInfoArgs) => Promise<UserInfoResponse>;
|
||||
getUserList?: (args: UserListArgs) => Promise<UserListResponse>;
|
||||
movePlaylistItem?: (args: MoveItemArgs) => Promise<void>;
|
||||
removeFromPlaylist: (args: RemoveFromPlaylistArgs) => Promise<RemoveFromPlaylistResponse>;
|
||||
@@ -1393,6 +1394,7 @@ export type InternalControllerEndpoint = {
|
||||
) => Promise<StructuredLyric[]>;
|
||||
getTagList?: (args: ReplaceApiClientProps<TagListArgs>) => Promise<TagListResponse>;
|
||||
getTopSongs: (args: ReplaceApiClientProps<TopSongListArgs>) => Promise<TopSongListResponse>;
|
||||
getUserInfo: (args: ReplaceApiClientProps<UserInfoArgs>) => Promise<UserInfoResponse>;
|
||||
getUserList?: (args: ReplaceApiClientProps<UserListArgs>) => Promise<UserListResponse>;
|
||||
movePlaylistItem?: (args: ReplaceApiClientProps<MoveItemArgs>) => Promise<void>;
|
||||
removeFromPlaylist: (
|
||||
@@ -1509,6 +1511,18 @@ export type TagListResponse = {
|
||||
};
|
||||
};
|
||||
|
||||
export type UserInfoArgs = BaseEndpointArgs & { query: UserInfoQuery };
|
||||
|
||||
export type UserInfoQuery = {
|
||||
id: string;
|
||||
};
|
||||
|
||||
export type UserInfoResponse = {
|
||||
id: string;
|
||||
isAdmin: boolean;
|
||||
name: string;
|
||||
};
|
||||
|
||||
type BaseEndpointArgsWithServer = {
|
||||
apiClientProps: {
|
||||
server: null | ServerListItemWithCredential;
|
||||
|
||||
Reference in New Issue
Block a user