- Introduce PermissionControlPanel in UserCenter for managing notification permissions. - Update Service Worker (sw.ts) to handle background push notifications via Firebase Cloud Messaging. - Implement EventSubscribeService logic to fetch active events, filter expired ones, and clean up subscriptions. - Refactor KaiqiuService and parsing utilities to include eventId in event details. - Remove deprecated ScheduleService and inline sendNotification logic. - Update utility functions to support new types and notification checks. - Add VAPI public key configuration and update Firebase exports.
99 lines
1.6 KiB
TypeScript
99 lines
1.6 KiB
TypeScript
import type { JWTPayload } from 'jose';
|
|
|
|
export * from './profile';
|
|
export * from './tag';
|
|
export interface Config {
|
|
KAIQIUCC_TOKEN: string;
|
|
}
|
|
export interface IEventInfo {
|
|
title: string;
|
|
info: string[];
|
|
url: string;
|
|
matchId: string;
|
|
startDate: string;
|
|
isFinished: boolean;
|
|
isProcessing: boolean;
|
|
location: string;
|
|
}
|
|
|
|
export interface MatchInfo {
|
|
itemId: string;
|
|
title: string;
|
|
players: Player[];
|
|
}
|
|
|
|
export interface BasePlayer {
|
|
uid: string;
|
|
name: string;
|
|
score: string;
|
|
}
|
|
|
|
export interface Player extends BasePlayer {
|
|
avatar: string;
|
|
info: string;
|
|
}
|
|
|
|
export interface XCXMember extends BasePlayer {
|
|
uid: string;
|
|
score: string;
|
|
realname: string;
|
|
name: string;
|
|
number: number;
|
|
age: string;
|
|
}
|
|
|
|
export interface XCXFindUser extends BasePlayer {
|
|
name: never;
|
|
username2: string;
|
|
realname: string;
|
|
residecity: string;
|
|
resideprovince: string;
|
|
minscore: string;
|
|
maxscore: string;
|
|
birthyear: string;
|
|
sex: string;
|
|
th?: string;
|
|
}
|
|
|
|
export interface XCXFindUserResp {
|
|
current_page: number;
|
|
last_page: number;
|
|
per_page: number;
|
|
total: number;
|
|
data: XCXFindUser[];
|
|
}
|
|
|
|
export interface ClubInfo {
|
|
id: string;
|
|
name: string;
|
|
members: number;
|
|
area: string;
|
|
url: string;
|
|
img: string;
|
|
}
|
|
|
|
export interface ClubDetail {
|
|
id: string;
|
|
name: string;
|
|
article: string;
|
|
img: string;
|
|
geo: { lng: number; lat: number; } | null;
|
|
}
|
|
|
|
export interface EventDetail {
|
|
itemId: string,
|
|
eventId: string,
|
|
title: string,
|
|
players: Player[],
|
|
}
|
|
|
|
export type WsPaylaod = {
|
|
user: Required<JWTPayload>;
|
|
}
|
|
|
|
export type NotificationData = {
|
|
title: string;
|
|
body?: string;
|
|
icon?: string;
|
|
url?: string;
|
|
} |