sa2kit 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/CollisionBalls-BpHufX3H.d.mts +41 -0
- package/dist/CollisionBalls-BpHufX3H.d.ts +41 -0
- package/dist/ConfigService-BxK06xP6.d.mts +262 -0
- package/dist/ConfigService-BxK06xP6.d.ts +262 -0
- package/dist/UniversalFileService-BpvbZitV.d.mts +139 -0
- package/dist/UniversalFileService-GsP6D3Rc.d.ts +139 -0
- package/dist/audioDetection/index.d.mts +449 -0
- package/dist/audioDetection/index.d.ts +449 -0
- package/dist/audioDetection/index.js +1244 -0
- package/dist/audioDetection/index.js.map +1 -0
- package/dist/audioDetection/index.mjs +1227 -0
- package/dist/audioDetection/index.mjs.map +1 -0
- package/dist/auth/legacy/core/index.d.mts +42 -0
- package/dist/auth/legacy/core/index.d.ts +42 -0
- package/dist/auth/legacy/core/index.js +242 -0
- package/dist/auth/legacy/core/index.js.map +1 -0
- package/dist/auth/legacy/core/index.mjs +226 -0
- package/dist/auth/legacy/core/index.mjs.map +1 -0
- package/dist/auth/legacy/db/index.d.mts +5 -0
- package/dist/auth/legacy/db/index.d.ts +5 -0
- package/dist/auth/legacy/db/index.js +261 -0
- package/dist/auth/legacy/db/index.js.map +1 -0
- package/dist/auth/legacy/db/index.mjs +250 -0
- package/dist/auth/legacy/db/index.mjs.map +1 -0
- package/dist/auth/legacy/index.d.mts +5 -0
- package/dist/auth/legacy/index.d.ts +5 -0
- package/dist/auth/legacy/index.js +1107 -0
- package/dist/auth/legacy/index.js.map +1 -0
- package/dist/auth/legacy/index.mjs +1086 -0
- package/dist/auth/legacy/index.mjs.map +1 -0
- package/dist/auth/legacy/logic/index.d.mts +9 -0
- package/dist/auth/legacy/logic/index.d.ts +9 -0
- package/dist/auth/legacy/logic/index.js +194 -0
- package/dist/auth/legacy/logic/index.js.map +1 -0
- package/dist/auth/legacy/logic/index.mjs +187 -0
- package/dist/auth/legacy/logic/index.mjs.map +1 -0
- package/dist/auth/legacy/miniapp/index.d.mts +5 -0
- package/dist/auth/legacy/miniapp/index.d.ts +5 -0
- package/dist/auth/legacy/miniapp/index.js +506 -0
- package/dist/auth/legacy/miniapp/index.js.map +1 -0
- package/dist/auth/legacy/miniapp/index.mjs +487 -0
- package/dist/auth/legacy/miniapp/index.mjs.map +1 -0
- package/dist/auth/legacy/routes/index.d.mts +53 -0
- package/dist/auth/legacy/routes/index.d.ts +53 -0
- package/dist/auth/legacy/routes/index.js +278 -0
- package/dist/auth/legacy/routes/index.js.map +1 -0
- package/dist/auth/legacy/routes/index.mjs +271 -0
- package/dist/auth/legacy/routes/index.mjs.map +1 -0
- package/dist/auth/legacy/schema/index.d.mts +401 -0
- package/dist/auth/legacy/schema/index.d.ts +401 -0
- package/dist/auth/legacy/schema/index.js +50 -0
- package/dist/auth/legacy/schema/index.js.map +1 -0
- package/dist/auth/legacy/schema/index.mjs +44 -0
- package/dist/auth/legacy/schema/index.mjs.map +1 -0
- package/dist/auth/legacy/server/index.d.mts +13 -0
- package/dist/auth/legacy/server/index.d.ts +13 -0
- package/dist/auth/legacy/server/index.js +21 -0
- package/dist/auth/legacy/server/index.js.map +1 -0
- package/dist/auth/legacy/server/index.mjs +19 -0
- package/dist/auth/legacy/server/index.mjs.map +1 -0
- package/dist/auth/legacy/services/index.d.mts +40 -0
- package/dist/auth/legacy/services/index.d.ts +40 -0
- package/dist/auth/legacy/services/index.js +258 -0
- package/dist/auth/legacy/services/index.js.map +1 -0
- package/dist/auth/legacy/services/index.mjs +252 -0
- package/dist/auth/legacy/services/index.mjs.map +1 -0
- package/dist/auth/legacy/ui/miniapp/index.d.mts +10 -0
- package/dist/auth/legacy/ui/miniapp/index.d.ts +10 -0
- package/dist/auth/legacy/ui/miniapp/index.js +298 -0
- package/dist/auth/legacy/ui/miniapp/index.js.map +1 -0
- package/dist/auth/legacy/ui/miniapp/index.mjs +290 -0
- package/dist/auth/legacy/ui/miniapp/index.mjs.map +1 -0
- package/dist/auth/legacy/ui/web/index.d.mts +22 -0
- package/dist/auth/legacy/ui/web/index.d.ts +22 -0
- package/dist/auth/legacy/ui/web/index.js +899 -0
- package/dist/auth/legacy/ui/web/index.js.map +1 -0
- package/dist/auth/legacy/ui/web/index.mjs +889 -0
- package/dist/auth/legacy/ui/web/index.mjs.map +1 -0
- package/dist/auth/legacy/web/index.d.mts +5 -0
- package/dist/auth/legacy/web/index.d.ts +5 -0
- package/dist/auth/legacy/web/index.js +1107 -0
- package/dist/auth/legacy/web/index.js.map +1 -0
- package/dist/auth/legacy/web/index.mjs +1086 -0
- package/dist/auth/legacy/web/index.mjs.map +1 -0
- package/dist/auth/rn/index.d.mts +64 -0
- package/dist/auth/rn/index.d.ts +64 -0
- package/dist/auth/rn/index.js +765 -0
- package/dist/auth/rn/index.js.map +1 -0
- package/dist/auth/rn/index.mjs +754 -0
- package/dist/auth/rn/index.mjs.map +1 -0
- package/dist/base-api-client-ACKKt13v.d.mts +277 -0
- package/dist/base-api-client-ACKKt13v.d.ts +277 -0
- package/dist/boothVaultService-Cn4WPhjg.d.mts +83 -0
- package/dist/boothVaultService-Cn4WPhjg.d.ts +83 -0
- package/dist/business/index.d.mts +6 -0
- package/dist/business/index.d.ts +6 -0
- package/dist/business/index.js +1682 -0
- package/dist/business/index.js.map +1 -0
- package/dist/business/index.mjs +1675 -0
- package/dist/business/index.mjs.map +1 -0
- package/dist/calendar/index.d.mts +1325 -0
- package/dist/calendar/index.d.ts +1325 -0
- package/dist/calendar/index.js +5964 -0
- package/dist/calendar/index.js.map +1 -0
- package/dist/calendar/index.mjs +5878 -0
- package/dist/calendar/index.mjs.map +1 -0
- package/dist/components/index.d.mts +405 -0
- package/dist/components/index.d.ts +405 -0
- package/dist/components/index.js +2516 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +2396 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/drizzle-schema-BNhqj2AZ.d.mts +1114 -0
- package/dist/drizzle-schema-BNhqj2AZ.d.ts +1114 -0
- package/dist/festivalCard/index.d.mts +75 -0
- package/dist/festivalCard/index.d.ts +75 -0
- package/dist/festivalCard/index.js +1492 -0
- package/dist/festivalCard/index.js.map +1 -0
- package/dist/festivalCard/index.mjs +1475 -0
- package/dist/festivalCard/index.mjs.map +1 -0
- package/dist/festivalCard/server/index.d.mts +120 -0
- package/dist/festivalCard/server/index.d.ts +120 -0
- package/dist/festivalCard/server/index.js +272 -0
- package/dist/festivalCard/server/index.js.map +1 -0
- package/dist/festivalCard/server/index.mjs +265 -0
- package/dist/festivalCard/server/index.mjs.map +1 -0
- package/dist/festivalCardService-CZomuQ4E.d.mts +80 -0
- package/dist/festivalCardService-CZomuQ4E.d.ts +80 -0
- package/dist/index-1Ag7IBXN.d.ts +144 -0
- package/dist/index-DNKZ7-R_.d.mts +184 -0
- package/dist/index-DNKZ7-R_.d.ts +184 -0
- package/dist/index-DSel44Ke.d.mts +93 -0
- package/dist/index-DSel44Ke.d.ts +93 -0
- package/dist/index-DdeZSeTJ.d.mts +144 -0
- package/dist/index-DrPcMJPc.d.mts +250 -0
- package/dist/index-DrPcMJPc.d.ts +250 -0
- package/dist/index.d.mts +5333 -0
- package/dist/index.d.ts +5333 -0
- package/dist/index.js +18809 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +18533 -0
- package/dist/index.mjs.map +1 -0
- package/dist/mikuContest/ui/web/index.d.mts +2 -0
- package/dist/mikuContest/ui/web/index.d.ts +2 -0
- package/dist/mikuContest/ui/web/index.js +353 -0
- package/dist/mikuContest/ui/web/index.js.map +1 -0
- package/dist/mikuContest/ui/web/index.mjs +343 -0
- package/dist/mikuContest/ui/web/index.mjs.map +1 -0
- package/dist/mikuFireworks3D/index.d.mts +268 -0
- package/dist/mikuFireworks3D/index.d.ts +268 -0
- package/dist/mikuFireworks3D/index.js +1267 -0
- package/dist/mikuFireworks3D/index.js.map +1 -0
- package/dist/mikuFireworks3D/index.mjs +1228 -0
- package/dist/mikuFireworks3D/index.mjs.map +1 -0
- package/dist/mikuFusionGame/index.d.mts +117 -0
- package/dist/mikuFusionGame/index.d.ts +117 -0
- package/dist/mikuFusionGame/index.js +1208 -0
- package/dist/mikuFusionGame/index.js.map +1 -0
- package/dist/mikuFusionGame/index.mjs +1195 -0
- package/dist/mikuFusionGame/index.mjs.map +1 -0
- package/dist/mmd/admin/index.d.mts +487 -0
- package/dist/mmd/admin/index.d.ts +487 -0
- package/dist/mmd/admin/index.js +1058 -0
- package/dist/mmd/admin/index.js.map +1 -0
- package/dist/mmd/admin/index.mjs +1027 -0
- package/dist/mmd/admin/index.mjs.map +1 -0
- package/dist/mmd/index.d.mts +2467 -0
- package/dist/mmd/index.d.ts +2467 -0
- package/dist/mmd/index.js +10119 -0
- package/dist/mmd/index.js.map +1 -0
- package/dist/mmd/index.mjs +10028 -0
- package/dist/mmd/index.mjs.map +1 -0
- package/dist/mmd/server/index.d.mts +139 -0
- package/dist/mmd/server/index.d.ts +139 -0
- package/dist/mmd/server/index.js +424 -0
- package/dist/mmd/server/index.js.map +1 -0
- package/dist/mmd/server/index.mjs +404 -0
- package/dist/mmd/server/index.mjs.map +1 -0
- package/dist/music/index.d.mts +74 -0
- package/dist/music/index.d.ts +74 -0
- package/dist/music/index.js +830 -0
- package/dist/music/index.js.map +1 -0
- package/dist/music/index.mjs +809 -0
- package/dist/music/index.mjs.map +1 -0
- package/dist/music/server/index.d.mts +1 -0
- package/dist/music/server/index.d.ts +1 -0
- package/dist/music/server/index.js +194 -0
- package/dist/music/server/index.js.map +1 -0
- package/dist/music/server/index.mjs +182 -0
- package/dist/music/server/index.mjs.map +1 -0
- package/dist/navigation/index.d.mts +93 -0
- package/dist/navigation/index.d.ts +93 -0
- package/dist/navigation/index.js +453 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/navigation/index.mjs +443 -0
- package/dist/navigation/index.mjs.map +1 -0
- package/dist/portfolio/index.d.mts +66 -0
- package/dist/portfolio/index.d.ts +66 -0
- package/dist/portfolio/index.js +736 -0
- package/dist/portfolio/index.js.map +1 -0
- package/dist/portfolio/index.mjs +724 -0
- package/dist/portfolio/index.mjs.map +1 -0
- package/dist/qqbot/server/index.d.mts +216 -0
- package/dist/qqbot/server/index.d.ts +216 -0
- package/dist/qqbot/server/index.js +394 -0
- package/dist/qqbot/server/index.js.map +1 -0
- package/dist/qqbot/server/index.mjs +385 -0
- package/dist/qqbot/server/index.mjs.map +1 -0
- package/dist/qqbot/ui/web/index.d.mts +10 -0
- package/dist/qqbot/ui/web/index.d.ts +10 -0
- package/dist/qqbot/ui/web/index.js +105 -0
- package/dist/qqbot/ui/web/index.js.map +1 -0
- package/dist/qqbot/ui/web/index.mjs +99 -0
- package/dist/qqbot/ui/web/index.mjs.map +1 -0
- package/dist/screenReceiver/index.d.mts +86 -0
- package/dist/screenReceiver/index.d.ts +86 -0
- package/dist/screenReceiver/index.js +281 -0
- package/dist/screenReceiver/index.js.map +1 -0
- package/dist/screenReceiver/index.mjs +273 -0
- package/dist/screenReceiver/index.mjs.map +1 -0
- package/dist/testYourself/admin/index.d.mts +58 -0
- package/dist/testYourself/admin/index.d.ts +58 -0
- package/dist/testYourself/admin/index.js +1009 -0
- package/dist/testYourself/admin/index.js.map +1 -0
- package/dist/testYourself/admin/index.mjs +1002 -0
- package/dist/testYourself/admin/index.mjs.map +1 -0
- package/dist/testYourself/index.d.mts +53 -0
- package/dist/testYourself/index.d.ts +53 -0
- package/dist/testYourself/index.js +2551 -0
- package/dist/testYourself/index.js.map +1 -0
- package/dist/testYourself/index.mjs +2531 -0
- package/dist/testYourself/index.mjs.map +1 -0
- package/dist/testYourself/server/index.d.mts +1029 -0
- package/dist/testYourself/server/index.d.ts +1029 -0
- package/dist/testYourself/server/index.js +825 -0
- package/dist/testYourself/server/index.js.map +1 -0
- package/dist/testYourself/server/index.mjs +816 -0
- package/dist/testYourself/server/index.mjs.map +1 -0
- package/dist/types-BTiaMsBz.d.mts +292 -0
- package/dist/types-DyG3ZV9V.d.mts +270 -0
- package/dist/types-DyG3ZV9V.d.ts +270 -0
- package/dist/types-ERmJyjx8.d.ts +292 -0
- package/dist/types-HorDyIRv.d.mts +303 -0
- package/dist/types-HorDyIRv.d.ts +303 -0
- package/dist/vocaloidBooth/index.d.mts +64 -0
- package/dist/vocaloidBooth/index.d.ts +64 -0
- package/dist/vocaloidBooth/index.js +376 -0
- package/dist/vocaloidBooth/index.js.map +1 -0
- package/dist/vocaloidBooth/index.mjs +362 -0
- package/dist/vocaloidBooth/index.mjs.map +1 -0
- package/dist/vocaloidBooth/server/index.d.mts +111 -0
- package/dist/vocaloidBooth/server/index.d.ts +111 -0
- package/dist/vocaloidBooth/server/index.js +247 -0
- package/dist/vocaloidBooth/server/index.js.map +1 -0
- package/dist/vocaloidBooth/server/index.mjs +237 -0
- package/dist/vocaloidBooth/server/index.mjs.map +1 -0
- package/dist/vocaloidBooth/web/index.d.mts +3 -0
- package/dist/vocaloidBooth/web/index.d.ts +3 -0
- package/dist/vocaloidBooth/web/index.js +376 -0
- package/dist/vocaloidBooth/web/index.js.map +1 -0
- package/dist/vocaloidBooth/web/index.mjs +362 -0
- package/dist/vocaloidBooth/web/index.mjs.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
type FestivalCardElementType = 'text' | 'image';
|
|
2
|
+
interface FestivalCardElementBase {
|
|
3
|
+
id: string;
|
|
4
|
+
type: FestivalCardElementType;
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
}
|
|
10
|
+
interface FestivalCardTextElement extends FestivalCardElementBase {
|
|
11
|
+
type: 'text';
|
|
12
|
+
content: string;
|
|
13
|
+
color?: string;
|
|
14
|
+
fontSize?: number;
|
|
15
|
+
fontWeight?: number;
|
|
16
|
+
fontFamily?: string;
|
|
17
|
+
align?: 'left' | 'center' | 'right';
|
|
18
|
+
}
|
|
19
|
+
interface FestivalCardImageElement extends FestivalCardElementBase {
|
|
20
|
+
type: 'image';
|
|
21
|
+
src: string;
|
|
22
|
+
alt?: string;
|
|
23
|
+
borderRadius?: number;
|
|
24
|
+
fit?: 'cover' | 'contain';
|
|
25
|
+
isBackground?: boolean;
|
|
26
|
+
}
|
|
27
|
+
type FestivalCardElement = FestivalCardTextElement | FestivalCardImageElement;
|
|
28
|
+
interface FestivalCardPage {
|
|
29
|
+
id: string;
|
|
30
|
+
title?: string;
|
|
31
|
+
elements: FestivalCardElement[];
|
|
32
|
+
background?: {
|
|
33
|
+
color?: string;
|
|
34
|
+
image?: string;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
interface FestivalCardAudioConfig {
|
|
38
|
+
src: string;
|
|
39
|
+
loop?: boolean;
|
|
40
|
+
autoPlay?: boolean;
|
|
41
|
+
volume?: number;
|
|
42
|
+
}
|
|
43
|
+
interface FestivalCardConfig {
|
|
44
|
+
id?: string;
|
|
45
|
+
name?: string;
|
|
46
|
+
theme?: 'winter' | 'spring' | 'custom';
|
|
47
|
+
coverTitle?: string;
|
|
48
|
+
coverSubtitle?: string;
|
|
49
|
+
pages: FestivalCardPage[];
|
|
50
|
+
backgroundMusic?: FestivalCardAudioConfig;
|
|
51
|
+
background?: {
|
|
52
|
+
colorA?: string;
|
|
53
|
+
colorB?: string;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
interface FestivalCardConfigSummary {
|
|
57
|
+
id: string;
|
|
58
|
+
name?: string;
|
|
59
|
+
}
|
|
60
|
+
interface FestivalCardDbAdapter {
|
|
61
|
+
listConfigs?(): Promise<FestivalCardConfigSummary[]>;
|
|
62
|
+
getConfig(id: string): Promise<FestivalCardConfig | null>;
|
|
63
|
+
saveConfig(id: string, config: FestivalCardConfig): Promise<void>;
|
|
64
|
+
deleteConfig?(id: string): Promise<void>;
|
|
65
|
+
}
|
|
66
|
+
interface FestivalCardServiceOptions {
|
|
67
|
+
db?: FestivalCardDbAdapter;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
declare class FestivalCardService {
|
|
71
|
+
private db;
|
|
72
|
+
constructor(options?: FestivalCardServiceOptions);
|
|
73
|
+
listConfigs(): Promise<FestivalCardConfigSummary[]>;
|
|
74
|
+
getConfig(cardId?: string): Promise<FestivalCardConfig>;
|
|
75
|
+
saveConfig(cardId: string, config: FestivalCardConfig): Promise<FestivalCardConfig>;
|
|
76
|
+
deleteConfig(cardId: string): Promise<void>;
|
|
77
|
+
}
|
|
78
|
+
declare const createInMemoryFestivalCardDb: () => FestivalCardDbAdapter;
|
|
79
|
+
|
|
80
|
+
export { type FestivalCardDbAdapter as F, type FestivalCardConfig as a, type FestivalCardConfigSummary as b, createInMemoryFestivalCardDb as c, FestivalCardService as d, type FestivalCardElementType as e, type FestivalCardElementBase as f, type FestivalCardTextElement as g, type FestivalCardImageElement as h, type FestivalCardElement as i, type FestivalCardPage as j, type FestivalCardAudioConfig as k, type FestivalCardServiceOptions as l };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
type FestivalCardElementType = 'text' | 'image';
|
|
2
|
+
interface FestivalCardElementBase {
|
|
3
|
+
id: string;
|
|
4
|
+
type: FestivalCardElementType;
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
}
|
|
10
|
+
interface FestivalCardTextElement extends FestivalCardElementBase {
|
|
11
|
+
type: 'text';
|
|
12
|
+
content: string;
|
|
13
|
+
color?: string;
|
|
14
|
+
fontSize?: number;
|
|
15
|
+
fontWeight?: number;
|
|
16
|
+
fontFamily?: string;
|
|
17
|
+
align?: 'left' | 'center' | 'right';
|
|
18
|
+
}
|
|
19
|
+
interface FestivalCardImageElement extends FestivalCardElementBase {
|
|
20
|
+
type: 'image';
|
|
21
|
+
src: string;
|
|
22
|
+
alt?: string;
|
|
23
|
+
borderRadius?: number;
|
|
24
|
+
fit?: 'cover' | 'contain';
|
|
25
|
+
isBackground?: boolean;
|
|
26
|
+
}
|
|
27
|
+
type FestivalCardElement = FestivalCardTextElement | FestivalCardImageElement;
|
|
28
|
+
interface FestivalCardPage {
|
|
29
|
+
id: string;
|
|
30
|
+
title?: string;
|
|
31
|
+
elements: FestivalCardElement[];
|
|
32
|
+
background?: {
|
|
33
|
+
color?: string;
|
|
34
|
+
image?: string;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
interface FestivalCardAudioConfig {
|
|
38
|
+
src: string;
|
|
39
|
+
loop?: boolean;
|
|
40
|
+
autoPlay?: boolean;
|
|
41
|
+
volume?: number;
|
|
42
|
+
}
|
|
43
|
+
interface FestivalCardConfig {
|
|
44
|
+
id?: string;
|
|
45
|
+
name?: string;
|
|
46
|
+
theme?: 'winter' | 'spring' | 'custom';
|
|
47
|
+
coverTitle?: string;
|
|
48
|
+
coverSubtitle?: string;
|
|
49
|
+
pages: FestivalCardPage[];
|
|
50
|
+
backgroundMusic?: FestivalCardAudioConfig;
|
|
51
|
+
background?: {
|
|
52
|
+
colorA?: string;
|
|
53
|
+
colorB?: string;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
interface FestivalCardConfigSummary {
|
|
57
|
+
id: string;
|
|
58
|
+
name?: string;
|
|
59
|
+
}
|
|
60
|
+
interface FestivalCardDbAdapter {
|
|
61
|
+
listConfigs?(): Promise<FestivalCardConfigSummary[]>;
|
|
62
|
+
getConfig(id: string): Promise<FestivalCardConfig | null>;
|
|
63
|
+
saveConfig(id: string, config: FestivalCardConfig): Promise<void>;
|
|
64
|
+
deleteConfig?(id: string): Promise<void>;
|
|
65
|
+
}
|
|
66
|
+
interface FestivalCardServiceOptions {
|
|
67
|
+
db?: FestivalCardDbAdapter;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
declare class FestivalCardService {
|
|
71
|
+
private db;
|
|
72
|
+
constructor(options?: FestivalCardServiceOptions);
|
|
73
|
+
listConfigs(): Promise<FestivalCardConfigSummary[]>;
|
|
74
|
+
getConfig(cardId?: string): Promise<FestivalCardConfig>;
|
|
75
|
+
saveConfig(cardId: string, config: FestivalCardConfig): Promise<FestivalCardConfig>;
|
|
76
|
+
deleteConfig(cardId: string): Promise<void>;
|
|
77
|
+
}
|
|
78
|
+
declare const createInMemoryFestivalCardDb: () => FestivalCardDbAdapter;
|
|
79
|
+
|
|
80
|
+
export { type FestivalCardDbAdapter as F, type FestivalCardConfig as a, type FestivalCardConfigSummary as b, createInMemoryFestivalCardDb as c, FestivalCardService as d, type FestivalCardElementType as e, type FestivalCardElementBase as f, type FestivalCardTextElement as g, type FestivalCardImageElement as h, type FestivalCardElement as i, type FestivalCardPage as j, type FestivalCardAudioConfig as k, type FestivalCardServiceOptions as l };
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { AuthGuard, ForgotPasswordModal, LoginModal, RegisterModal, UserMenu } from './auth/legacy/ui/web/index.js';
|
|
2
|
+
import { AuthProvider, useAuth } from './auth/legacy/logic/index.js';
|
|
3
|
+
import { A as AuthGuardProps, i as AuthService, C as CustomMenuItem, F as ForgotPasswordModalProps, e as LoginModalProps, L as LoginRequest, b as LoginResponse, f as RegisterModalProps, R as RegisterRequest, c as RegisterResponse, k as SessionConfig, d as SessionValidation, S as SessionValidationResponse, h as UseAuthReturn, U as User, g as UserMenuProps, j as UserRole, a as UserSession, V as ValidateApiAuth } from './index-DNKZ7-R_.js';
|
|
4
|
+
import { calculateSessionExpiry, generateSessionToken, getUserDisplayName, isActiveUser, isAdmin, isSessionExpired, validatePassword, validatePhoneNumber } from './auth/legacy/core/index.js';
|
|
5
|
+
import React__default from 'react';
|
|
6
|
+
|
|
7
|
+
declare const index$3_AuthGuard: typeof AuthGuard;
|
|
8
|
+
declare const index$3_AuthGuardProps: typeof AuthGuardProps;
|
|
9
|
+
declare const index$3_AuthProvider: typeof AuthProvider;
|
|
10
|
+
declare const index$3_AuthService: typeof AuthService;
|
|
11
|
+
declare const index$3_CustomMenuItem: typeof CustomMenuItem;
|
|
12
|
+
declare const index$3_ForgotPasswordModal: typeof ForgotPasswordModal;
|
|
13
|
+
declare const index$3_ForgotPasswordModalProps: typeof ForgotPasswordModalProps;
|
|
14
|
+
declare const index$3_LoginModal: typeof LoginModal;
|
|
15
|
+
declare const index$3_LoginModalProps: typeof LoginModalProps;
|
|
16
|
+
declare const index$3_LoginRequest: typeof LoginRequest;
|
|
17
|
+
declare const index$3_LoginResponse: typeof LoginResponse;
|
|
18
|
+
declare const index$3_RegisterModal: typeof RegisterModal;
|
|
19
|
+
declare const index$3_RegisterModalProps: typeof RegisterModalProps;
|
|
20
|
+
declare const index$3_RegisterRequest: typeof RegisterRequest;
|
|
21
|
+
declare const index$3_RegisterResponse: typeof RegisterResponse;
|
|
22
|
+
declare const index$3_SessionConfig: typeof SessionConfig;
|
|
23
|
+
declare const index$3_SessionValidation: typeof SessionValidation;
|
|
24
|
+
declare const index$3_SessionValidationResponse: typeof SessionValidationResponse;
|
|
25
|
+
declare const index$3_UseAuthReturn: typeof UseAuthReturn;
|
|
26
|
+
declare const index$3_User: typeof User;
|
|
27
|
+
declare const index$3_UserMenu: typeof UserMenu;
|
|
28
|
+
declare const index$3_UserMenuProps: typeof UserMenuProps;
|
|
29
|
+
declare const index$3_UserRole: typeof UserRole;
|
|
30
|
+
declare const index$3_UserSession: typeof UserSession;
|
|
31
|
+
declare const index$3_ValidateApiAuth: typeof ValidateApiAuth;
|
|
32
|
+
declare const index$3_calculateSessionExpiry: typeof calculateSessionExpiry;
|
|
33
|
+
declare const index$3_generateSessionToken: typeof generateSessionToken;
|
|
34
|
+
declare const index$3_getUserDisplayName: typeof getUserDisplayName;
|
|
35
|
+
declare const index$3_isActiveUser: typeof isActiveUser;
|
|
36
|
+
declare const index$3_isAdmin: typeof isAdmin;
|
|
37
|
+
declare const index$3_isSessionExpired: typeof isSessionExpired;
|
|
38
|
+
declare const index$3_useAuth: typeof useAuth;
|
|
39
|
+
declare const index$3_validatePassword: typeof validatePassword;
|
|
40
|
+
declare const index$3_validatePhoneNumber: typeof validatePhoneNumber;
|
|
41
|
+
declare namespace index$3 {
|
|
42
|
+
export { index$3_AuthGuard as AuthGuard, index$3_AuthGuardProps as AuthGuardProps, index$3_AuthProvider as AuthProvider, index$3_AuthService as AuthService, index$3_CustomMenuItem as CustomMenuItem, index$3_ForgotPasswordModal as ForgotPasswordModal, index$3_ForgotPasswordModalProps as ForgotPasswordModalProps, index$3_LoginModal as LoginModal, index$3_LoginModalProps as LoginModalProps, index$3_LoginRequest as LoginRequest, index$3_LoginResponse as LoginResponse, index$3_RegisterModal as RegisterModal, index$3_RegisterModalProps as RegisterModalProps, index$3_RegisterRequest as RegisterRequest, index$3_RegisterResponse as RegisterResponse, index$3_SessionConfig as SessionConfig, index$3_SessionValidation as SessionValidation, index$3_SessionValidationResponse as SessionValidationResponse, index$3_UseAuthReturn as UseAuthReturn, index$3_User as User, index$3_UserMenu as UserMenu, index$3_UserMenuProps as UserMenuProps, index$3_UserRole as UserRole, index$3_UserSession as UserSession, index$3_ValidateApiAuth as ValidateApiAuth, index$3_calculateSessionExpiry as calculateSessionExpiry, index$3_generateSessionToken as generateSessionToken, index$3_getUserDisplayName as getUserDisplayName, index$3_isActiveUser as isActiveUser, index$3_isAdmin as isAdmin, index$3_isSessionExpired as isSessionExpired, index$3_useAuth as useAuth, index$3_validatePassword as validatePassword, index$3_validatePhoneNumber as validatePhoneNumber };
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
type BubbleShooterStatus = 'ready' | 'shooting' | 'won' | 'lost';
|
|
46
|
+
interface BubbleShooterConfig {
|
|
47
|
+
rows: number;
|
|
48
|
+
cols: number;
|
|
49
|
+
initialRows: number;
|
|
50
|
+
bubbleRadius: number;
|
|
51
|
+
topOffset: number;
|
|
52
|
+
palette: string[];
|
|
53
|
+
launchSpeed: number;
|
|
54
|
+
minMatchCount: number;
|
|
55
|
+
}
|
|
56
|
+
interface BubbleShooterSlot {
|
|
57
|
+
row: number;
|
|
58
|
+
col: number;
|
|
59
|
+
}
|
|
60
|
+
interface BubbleShooterProjectile {
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
vx: number;
|
|
64
|
+
vy: number;
|
|
65
|
+
color: string;
|
|
66
|
+
}
|
|
67
|
+
interface BubbleShooterResolution {
|
|
68
|
+
grid: (string | null)[][];
|
|
69
|
+
removed: number;
|
|
70
|
+
matched: number;
|
|
71
|
+
dropped: number;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
declare const DEFAULT_BUBBLE_SHOOTER_CONFIG: BubbleShooterConfig;
|
|
75
|
+
declare const getBubbleDiameter: (config: BubbleShooterConfig) => number;
|
|
76
|
+
declare const getRowStep: (config: BubbleShooterConfig) => number;
|
|
77
|
+
declare const getBoardWidth: (config: BubbleShooterConfig) => number;
|
|
78
|
+
declare const getBoardHeight: (config: BubbleShooterConfig) => number;
|
|
79
|
+
declare const createEmptyGrid: (config: BubbleShooterConfig) => (string | null)[][];
|
|
80
|
+
declare const createInitialGrid: (config: BubbleShooterConfig) => (string | null)[][];
|
|
81
|
+
declare const pickRandomColor: (palette: string[]) => string;
|
|
82
|
+
declare const getBubblePosition: (row: number, col: number, config: BubbleShooterConfig) => {
|
|
83
|
+
x: number;
|
|
84
|
+
y: number;
|
|
85
|
+
};
|
|
86
|
+
declare const isValidSlot: (slot: BubbleShooterSlot, config: BubbleShooterConfig) => boolean;
|
|
87
|
+
declare const getNeighbors: (slot: BubbleShooterSlot, config: BubbleShooterConfig) => BubbleShooterSlot[];
|
|
88
|
+
declare const getNearestSlot: (x: number, y: number, config: BubbleShooterConfig) => BubbleShooterSlot;
|
|
89
|
+
declare const findAttachSlot: (x: number, y: number, grid: (string | null)[][], config: BubbleShooterConfig, preferred?: BubbleShooterSlot) => BubbleShooterSlot | null;
|
|
90
|
+
declare const findCollisionSlot: (x: number, y: number, grid: (string | null)[][], config: BubbleShooterConfig) => BubbleShooterSlot | null;
|
|
91
|
+
declare const resolveMatches: (grid: (string | null)[][], placed: BubbleShooterSlot, config: BubbleShooterConfig) => BubbleShooterResolution;
|
|
92
|
+
declare const hasAnyBubble: (grid: (string | null)[][]) => boolean;
|
|
93
|
+
declare const hasReachedDangerLine: (grid: (string | null)[][], config: BubbleShooterConfig, dangerRowOffset?: number) => boolean;
|
|
94
|
+
|
|
95
|
+
interface BubbleShooterBoardProps {
|
|
96
|
+
config?: Partial<BubbleShooterConfig>;
|
|
97
|
+
className?: string;
|
|
98
|
+
}
|
|
99
|
+
declare const BubbleShooterBoard: React__default.FC<BubbleShooterBoardProps>;
|
|
100
|
+
|
|
101
|
+
interface BubbleShooterGamePageProps {
|
|
102
|
+
config?: Partial<BubbleShooterConfig>;
|
|
103
|
+
title?: string;
|
|
104
|
+
description?: string;
|
|
105
|
+
}
|
|
106
|
+
declare const BubbleShooterGamePage: React__default.FC<BubbleShooterGamePageProps>;
|
|
107
|
+
|
|
108
|
+
declare const index$2_BubbleShooterBoard: typeof BubbleShooterBoard;
|
|
109
|
+
declare const index$2_BubbleShooterGamePage: typeof BubbleShooterGamePage;
|
|
110
|
+
declare namespace index$2 {
|
|
111
|
+
export { index$2_BubbleShooterBoard as BubbleShooterBoard, index$2_BubbleShooterGamePage as BubbleShooterGamePage };
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
type index$1_BubbleShooterConfig = BubbleShooterConfig;
|
|
115
|
+
type index$1_BubbleShooterProjectile = BubbleShooterProjectile;
|
|
116
|
+
type index$1_BubbleShooterResolution = BubbleShooterResolution;
|
|
117
|
+
type index$1_BubbleShooterSlot = BubbleShooterSlot;
|
|
118
|
+
type index$1_BubbleShooterStatus = BubbleShooterStatus;
|
|
119
|
+
declare const index$1_DEFAULT_BUBBLE_SHOOTER_CONFIG: typeof DEFAULT_BUBBLE_SHOOTER_CONFIG;
|
|
120
|
+
declare const index$1_createEmptyGrid: typeof createEmptyGrid;
|
|
121
|
+
declare const index$1_createInitialGrid: typeof createInitialGrid;
|
|
122
|
+
declare const index$1_findAttachSlot: typeof findAttachSlot;
|
|
123
|
+
declare const index$1_findCollisionSlot: typeof findCollisionSlot;
|
|
124
|
+
declare const index$1_getBoardHeight: typeof getBoardHeight;
|
|
125
|
+
declare const index$1_getBoardWidth: typeof getBoardWidth;
|
|
126
|
+
declare const index$1_getBubbleDiameter: typeof getBubbleDiameter;
|
|
127
|
+
declare const index$1_getBubblePosition: typeof getBubblePosition;
|
|
128
|
+
declare const index$1_getNearestSlot: typeof getNearestSlot;
|
|
129
|
+
declare const index$1_getNeighbors: typeof getNeighbors;
|
|
130
|
+
declare const index$1_getRowStep: typeof getRowStep;
|
|
131
|
+
declare const index$1_hasAnyBubble: typeof hasAnyBubble;
|
|
132
|
+
declare const index$1_hasReachedDangerLine: typeof hasReachedDangerLine;
|
|
133
|
+
declare const index$1_isValidSlot: typeof isValidSlot;
|
|
134
|
+
declare const index$1_pickRandomColor: typeof pickRandomColor;
|
|
135
|
+
declare const index$1_resolveMatches: typeof resolveMatches;
|
|
136
|
+
declare namespace index$1 {
|
|
137
|
+
export { type index$1_BubbleShooterConfig as BubbleShooterConfig, type index$1_BubbleShooterProjectile as BubbleShooterProjectile, type index$1_BubbleShooterResolution as BubbleShooterResolution, type index$1_BubbleShooterSlot as BubbleShooterSlot, type index$1_BubbleShooterStatus as BubbleShooterStatus, index$1_DEFAULT_BUBBLE_SHOOTER_CONFIG as DEFAULT_BUBBLE_SHOOTER_CONFIG, index$1_createEmptyGrid as createEmptyGrid, index$1_createInitialGrid as createInitialGrid, index$1_findAttachSlot as findAttachSlot, index$1_findCollisionSlot as findCollisionSlot, index$1_getBoardHeight as getBoardHeight, index$1_getBoardWidth as getBoardWidth, index$1_getBubbleDiameter as getBubbleDiameter, index$1_getBubblePosition as getBubblePosition, index$1_getNearestSlot as getNearestSlot, index$1_getNeighbors as getNeighbors, index$1_getRowStep as getRowStep, index$1_hasAnyBubble as hasAnyBubble, index$1_hasReachedDangerLine as hasReachedDangerLine, index$1_isValidSlot as isValidSlot, index$1_pickRandomColor as pickRandomColor, index$1_resolveMatches as resolveMatches, index$2 as webUI };
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
declare namespace index {
|
|
141
|
+
export { index$3 as authLegacy, index$1 as bubbleShooter };
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export { index$1 as a, index$3 as b, index as i };
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 用户信息接口
|
|
3
|
+
*/
|
|
4
|
+
interface User {
|
|
5
|
+
id: number;
|
|
6
|
+
phone: string;
|
|
7
|
+
name?: string | null;
|
|
8
|
+
email?: string | null;
|
|
9
|
+
role: string;
|
|
10
|
+
isActive: boolean;
|
|
11
|
+
lastLoginAt?: Date | null;
|
|
12
|
+
createdAt: Date;
|
|
13
|
+
updatedAt: Date;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 用户会话接口
|
|
17
|
+
*/
|
|
18
|
+
interface UserSession {
|
|
19
|
+
id: number;
|
|
20
|
+
userId: number;
|
|
21
|
+
sessionToken: string;
|
|
22
|
+
expiresAt: Date;
|
|
23
|
+
createdAt: Date;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 登录请求接口
|
|
27
|
+
*/
|
|
28
|
+
interface LoginRequest {
|
|
29
|
+
phone: string;
|
|
30
|
+
password: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 注册请求接口
|
|
34
|
+
*/
|
|
35
|
+
interface RegisterRequest {
|
|
36
|
+
phone: string;
|
|
37
|
+
password: string;
|
|
38
|
+
name?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 登录响应接口
|
|
42
|
+
*/
|
|
43
|
+
interface LoginResponse {
|
|
44
|
+
success: boolean;
|
|
45
|
+
message: string;
|
|
46
|
+
user?: User;
|
|
47
|
+
sessionToken?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* 注册响应接口
|
|
51
|
+
*/
|
|
52
|
+
interface RegisterResponse {
|
|
53
|
+
success: boolean;
|
|
54
|
+
message: string;
|
|
55
|
+
user?: User;
|
|
56
|
+
sessionToken?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 会话验证响应接口
|
|
60
|
+
*/
|
|
61
|
+
interface SessionValidationResponse {
|
|
62
|
+
valid: boolean;
|
|
63
|
+
user?: User;
|
|
64
|
+
message?: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* 会话验证结果接口
|
|
68
|
+
*/
|
|
69
|
+
interface SessionValidation {
|
|
70
|
+
valid: boolean;
|
|
71
|
+
user?: User;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* 登录模态框Props
|
|
75
|
+
*/
|
|
76
|
+
interface LoginModalProps {
|
|
77
|
+
isOpen: boolean;
|
|
78
|
+
onClose: () => void;
|
|
79
|
+
onSuccess: () => void;
|
|
80
|
+
onSwitchToRegister?: () => void;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* 注册模态框Props
|
|
84
|
+
*/
|
|
85
|
+
interface RegisterModalProps {
|
|
86
|
+
isOpen: boolean;
|
|
87
|
+
onClose: () => void;
|
|
88
|
+
onSuccess: () => void;
|
|
89
|
+
onSwitchToLogin?: () => void;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* 认证守卫Props
|
|
93
|
+
*/
|
|
94
|
+
interface AuthGuardProps {
|
|
95
|
+
children: React.ReactNode;
|
|
96
|
+
fallback?: React.ReactNode;
|
|
97
|
+
requireAuth?: boolean;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* 自定义菜单项接口
|
|
101
|
+
*/
|
|
102
|
+
interface CustomMenuItem {
|
|
103
|
+
id: string;
|
|
104
|
+
label: string;
|
|
105
|
+
icon?: React.ComponentType<any>;
|
|
106
|
+
onClick: () => void;
|
|
107
|
+
requireAuth?: boolean;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* 用户菜单Props
|
|
111
|
+
*/
|
|
112
|
+
interface UserMenuProps {
|
|
113
|
+
customMenuItems?: CustomMenuItem[];
|
|
114
|
+
className?: string;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* 忘记密码模态框Props
|
|
118
|
+
*/
|
|
119
|
+
interface ForgotPasswordModalProps {
|
|
120
|
+
isOpen: boolean;
|
|
121
|
+
onClose: () => void;
|
|
122
|
+
onSuccess: () => void;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* useAuth Hook返回值类型
|
|
126
|
+
*/
|
|
127
|
+
interface UseAuthReturn {
|
|
128
|
+
user: User | null;
|
|
129
|
+
loading: boolean;
|
|
130
|
+
isAuthenticated: boolean;
|
|
131
|
+
login: (credentials: LoginRequest) => Promise<{
|
|
132
|
+
success: boolean;
|
|
133
|
+
user?: User;
|
|
134
|
+
message?: string;
|
|
135
|
+
}>;
|
|
136
|
+
register: (userData: RegisterRequest) => Promise<{
|
|
137
|
+
success: boolean;
|
|
138
|
+
user?: User;
|
|
139
|
+
message?: string;
|
|
140
|
+
}>;
|
|
141
|
+
logout: () => Promise<void>;
|
|
142
|
+
refreshUser: () => void;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* 认证服务接口
|
|
146
|
+
*/
|
|
147
|
+
interface AuthService {
|
|
148
|
+
verifyPassword(phone: string, password: string): Promise<User | null>;
|
|
149
|
+
createUser(phone: string, password: string, name?: string): Promise<User>;
|
|
150
|
+
createSession(userId: number): Promise<UserSession>;
|
|
151
|
+
validateSession(sessionToken: string): Promise<SessionValidation>;
|
|
152
|
+
deleteSession(sessionToken: string): Promise<void>;
|
|
153
|
+
deleteUserSessions(userId: number): Promise<void>;
|
|
154
|
+
updateLastLogin(userId: number): Promise<void>;
|
|
155
|
+
cleanupExpiredSessions(): Promise<void>;
|
|
156
|
+
getUserByPhone(phone: string): Promise<User | null>;
|
|
157
|
+
sendVerificationCode(phone: string): Promise<string>;
|
|
158
|
+
verifyCode(phone: string, code: string): Promise<boolean>;
|
|
159
|
+
resetPassword(phone: string, newPassword: string): Promise<void>;
|
|
160
|
+
cleanupExpiredVerificationCodes(): Promise<void>;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* API权限验证函数类型
|
|
164
|
+
*/
|
|
165
|
+
type ValidateApiAuth = (request: Request) => Promise<User | null>;
|
|
166
|
+
/**
|
|
167
|
+
* 用户角色枚举
|
|
168
|
+
*/
|
|
169
|
+
declare enum UserRole {
|
|
170
|
+
USER = "user",
|
|
171
|
+
ADMIN = "admin"
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* 会话配置
|
|
175
|
+
*/
|
|
176
|
+
interface SessionConfig {
|
|
177
|
+
maxAge: number;
|
|
178
|
+
cookieName: string;
|
|
179
|
+
secure: boolean;
|
|
180
|
+
httpOnly: boolean;
|
|
181
|
+
sameSite: 'strict' | 'lax' | 'none';
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export { type AuthGuardProps as A, type CustomMenuItem as C, type ForgotPasswordModalProps as F, type LoginRequest as L, type RegisterRequest as R, type SessionValidationResponse as S, type User as U, type ValidateApiAuth as V, type UserSession as a, type LoginResponse as b, type RegisterResponse as c, type SessionValidation as d, type LoginModalProps as e, type RegisterModalProps as f, type UserMenuProps as g, type UseAuthReturn as h, type AuthService as i, UserRole as j, type SessionConfig as k };
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 用户信息接口
|
|
3
|
+
*/
|
|
4
|
+
interface User {
|
|
5
|
+
id: number;
|
|
6
|
+
phone: string;
|
|
7
|
+
name?: string | null;
|
|
8
|
+
email?: string | null;
|
|
9
|
+
role: string;
|
|
10
|
+
isActive: boolean;
|
|
11
|
+
lastLoginAt?: Date | null;
|
|
12
|
+
createdAt: Date;
|
|
13
|
+
updatedAt: Date;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 用户会话接口
|
|
17
|
+
*/
|
|
18
|
+
interface UserSession {
|
|
19
|
+
id: number;
|
|
20
|
+
userId: number;
|
|
21
|
+
sessionToken: string;
|
|
22
|
+
expiresAt: Date;
|
|
23
|
+
createdAt: Date;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 登录请求接口
|
|
27
|
+
*/
|
|
28
|
+
interface LoginRequest {
|
|
29
|
+
phone: string;
|
|
30
|
+
password: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 注册请求接口
|
|
34
|
+
*/
|
|
35
|
+
interface RegisterRequest {
|
|
36
|
+
phone: string;
|
|
37
|
+
password: string;
|
|
38
|
+
name?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 登录响应接口
|
|
42
|
+
*/
|
|
43
|
+
interface LoginResponse {
|
|
44
|
+
success: boolean;
|
|
45
|
+
message: string;
|
|
46
|
+
user?: User;
|
|
47
|
+
sessionToken?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* 注册响应接口
|
|
51
|
+
*/
|
|
52
|
+
interface RegisterResponse {
|
|
53
|
+
success: boolean;
|
|
54
|
+
message: string;
|
|
55
|
+
user?: User;
|
|
56
|
+
sessionToken?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 会话验证响应接口
|
|
60
|
+
*/
|
|
61
|
+
interface SessionValidationResponse {
|
|
62
|
+
valid: boolean;
|
|
63
|
+
user?: User;
|
|
64
|
+
message?: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* 会话验证结果接口
|
|
68
|
+
*/
|
|
69
|
+
interface SessionValidation {
|
|
70
|
+
valid: boolean;
|
|
71
|
+
user?: User;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* 登录模态框Props
|
|
75
|
+
*/
|
|
76
|
+
interface LoginModalProps {
|
|
77
|
+
isOpen: boolean;
|
|
78
|
+
onClose: () => void;
|
|
79
|
+
onSuccess: () => void;
|
|
80
|
+
onSwitchToRegister?: () => void;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* 注册模态框Props
|
|
84
|
+
*/
|
|
85
|
+
interface RegisterModalProps {
|
|
86
|
+
isOpen: boolean;
|
|
87
|
+
onClose: () => void;
|
|
88
|
+
onSuccess: () => void;
|
|
89
|
+
onSwitchToLogin?: () => void;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* 认证守卫Props
|
|
93
|
+
*/
|
|
94
|
+
interface AuthGuardProps {
|
|
95
|
+
children: React.ReactNode;
|
|
96
|
+
fallback?: React.ReactNode;
|
|
97
|
+
requireAuth?: boolean;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* 自定义菜单项接口
|
|
101
|
+
*/
|
|
102
|
+
interface CustomMenuItem {
|
|
103
|
+
id: string;
|
|
104
|
+
label: string;
|
|
105
|
+
icon?: React.ComponentType<any>;
|
|
106
|
+
onClick: () => void;
|
|
107
|
+
requireAuth?: boolean;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* 用户菜单Props
|
|
111
|
+
*/
|
|
112
|
+
interface UserMenuProps {
|
|
113
|
+
customMenuItems?: CustomMenuItem[];
|
|
114
|
+
className?: string;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* 忘记密码模态框Props
|
|
118
|
+
*/
|
|
119
|
+
interface ForgotPasswordModalProps {
|
|
120
|
+
isOpen: boolean;
|
|
121
|
+
onClose: () => void;
|
|
122
|
+
onSuccess: () => void;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* useAuth Hook返回值类型
|
|
126
|
+
*/
|
|
127
|
+
interface UseAuthReturn {
|
|
128
|
+
user: User | null;
|
|
129
|
+
loading: boolean;
|
|
130
|
+
isAuthenticated: boolean;
|
|
131
|
+
login: (credentials: LoginRequest) => Promise<{
|
|
132
|
+
success: boolean;
|
|
133
|
+
user?: User;
|
|
134
|
+
message?: string;
|
|
135
|
+
}>;
|
|
136
|
+
register: (userData: RegisterRequest) => Promise<{
|
|
137
|
+
success: boolean;
|
|
138
|
+
user?: User;
|
|
139
|
+
message?: string;
|
|
140
|
+
}>;
|
|
141
|
+
logout: () => Promise<void>;
|
|
142
|
+
refreshUser: () => void;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* 认证服务接口
|
|
146
|
+
*/
|
|
147
|
+
interface AuthService {
|
|
148
|
+
verifyPassword(phone: string, password: string): Promise<User | null>;
|
|
149
|
+
createUser(phone: string, password: string, name?: string): Promise<User>;
|
|
150
|
+
createSession(userId: number): Promise<UserSession>;
|
|
151
|
+
validateSession(sessionToken: string): Promise<SessionValidation>;
|
|
152
|
+
deleteSession(sessionToken: string): Promise<void>;
|
|
153
|
+
deleteUserSessions(userId: number): Promise<void>;
|
|
154
|
+
updateLastLogin(userId: number): Promise<void>;
|
|
155
|
+
cleanupExpiredSessions(): Promise<void>;
|
|
156
|
+
getUserByPhone(phone: string): Promise<User | null>;
|
|
157
|
+
sendVerificationCode(phone: string): Promise<string>;
|
|
158
|
+
verifyCode(phone: string, code: string): Promise<boolean>;
|
|
159
|
+
resetPassword(phone: string, newPassword: string): Promise<void>;
|
|
160
|
+
cleanupExpiredVerificationCodes(): Promise<void>;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* API权限验证函数类型
|
|
164
|
+
*/
|
|
165
|
+
type ValidateApiAuth = (request: Request) => Promise<User | null>;
|
|
166
|
+
/**
|
|
167
|
+
* 用户角色枚举
|
|
168
|
+
*/
|
|
169
|
+
declare enum UserRole {
|
|
170
|
+
USER = "user",
|
|
171
|
+
ADMIN = "admin"
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* 会话配置
|
|
175
|
+
*/
|
|
176
|
+
interface SessionConfig {
|
|
177
|
+
maxAge: number;
|
|
178
|
+
cookieName: string;
|
|
179
|
+
secure: boolean;
|
|
180
|
+
httpOnly: boolean;
|
|
181
|
+
sameSite: 'strict' | 'lax' | 'none';
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export { type AuthGuardProps as A, type CustomMenuItem as C, type ForgotPasswordModalProps as F, type LoginRequest as L, type RegisterRequest as R, type SessionValidationResponse as S, type User as U, type ValidateApiAuth as V, type UserSession as a, type LoginResponse as b, type RegisterResponse as c, type SessionValidation as d, type LoginModalProps as e, type RegisterModalProps as f, type UserMenuProps as g, type UseAuthReturn as h, type AuthService as i, UserRole as j, type SessionConfig as k };
|