sa2kit 2.0.4 → 3.1.0
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/dist/{UniversalFileService-GsP6D3Rc.d.ts → UniversalFileService-CC4d3wkc.d.ts} +2 -2
- package/dist/{UniversalFileService-BpvbZitV.d.mts → UniversalFileService-CzAE_G4V.d.mts} +2 -2
- package/dist/ai/llm/ui/miniapp/index.d.mts +2 -2
- package/dist/ai/llm/ui/miniapp/index.d.ts +2 -2
- package/dist/ai/llm/ui/rn/index.d.mts +2 -2
- package/dist/ai/llm/ui/rn/index.d.ts +2 -2
- package/dist/ai/llm/ui/web/index.d.mts +3 -3
- package/dist/ai/llm/ui/web/index.d.ts +3 -3
- package/dist/analytics/index.d.mts +1 -1
- package/dist/analytics/index.d.ts +1 -1
- package/dist/business/index.d.mts +1 -5
- package/dist/business/index.d.ts +1 -5
- package/dist/business/index.js +34 -1135
- package/dist/business/index.js.map +1 -1
- package/dist/business/index.mjs +5 -1105
- package/dist/business/index.mjs.map +1 -1
- package/dist/calendar/routes/index.d.mts +74 -1
- package/dist/calendar/routes/index.d.ts +74 -1
- package/dist/calendar/routes/index.js +186 -97
- package/dist/calendar/routes/index.js.map +1 -1
- package/dist/calendar/routes/index.mjs +178 -99
- package/dist/calendar/routes/index.mjs.map +1 -1
- package/dist/{chunk-RJP2BRJD.mjs → chunk-4OOANEJV.mjs} +2 -2
- package/dist/{chunk-RJP2BRJD.mjs.map → chunk-4OOANEJV.mjs.map} +1 -1
- package/dist/chunk-5FUAQLGC.mjs +14 -0
- package/dist/chunk-5FUAQLGC.mjs.map +1 -0
- package/dist/{chunk-IIVNHQEI.mjs → chunk-5GBDDXYL.mjs} +4 -3
- package/dist/chunk-5GBDDXYL.mjs.map +1 -0
- package/dist/{chunk-S732H246.js → chunk-6PMXAK7F.js} +2 -2
- package/dist/{chunk-S732H246.js.map → chunk-6PMXAK7F.js.map} +1 -1
- package/dist/chunk-6YLCRWKM.mjs +8 -0
- package/dist/chunk-6YLCRWKM.mjs.map +1 -0
- package/dist/chunk-CAYOQDBR.js +78 -0
- package/dist/chunk-CAYOQDBR.js.map +1 -0
- package/dist/{chunk-PTMSDNGO.mjs → chunk-CX2GHCAI.mjs} +4 -75
- package/dist/chunk-CX2GHCAI.mjs.map +1 -0
- package/dist/chunk-EBHPTFG6.mjs +82 -0
- package/dist/chunk-EBHPTFG6.mjs.map +1 -0
- package/dist/chunk-HQLKOXG7.js +16 -0
- package/dist/chunk-HQLKOXG7.js.map +1 -0
- package/dist/chunk-IS7O4LPI.js +146 -0
- package/dist/chunk-IS7O4LPI.js.map +1 -0
- package/dist/chunk-LGHUCQIU.js +93 -0
- package/dist/chunk-LGHUCQIU.js.map +1 -0
- package/dist/chunk-LKBIVQBT.mjs +34 -0
- package/dist/chunk-LKBIVQBT.mjs.map +1 -0
- package/dist/chunk-MIDXG6LS.js +32 -0
- package/dist/chunk-MIDXG6LS.js.map +1 -0
- package/dist/chunk-NDGHXVGS.js +25 -0
- package/dist/chunk-NDGHXVGS.js.map +1 -0
- package/dist/chunk-PA4ELVGI.js +20 -0
- package/dist/chunk-PA4ELVGI.js.map +1 -0
- package/dist/chunk-Q5VFBPMG.mjs +76 -0
- package/dist/chunk-Q5VFBPMG.mjs.map +1 -0
- package/dist/{chunk-WZDTNDYR.js → chunk-QSKLQX6H.js} +11 -11
- package/dist/{chunk-WZDTNDYR.js.map → chunk-QSKLQX6H.js.map} +1 -1
- package/dist/{chunk-QQ2WFYOD.js → chunk-S6YSGVWD.js} +4 -76
- package/dist/chunk-S6YSGVWD.js.map +1 -0
- package/dist/chunk-TNJ6LYX7.mjs +18 -0
- package/dist/chunk-TNJ6LYX7.mjs.map +1 -0
- package/dist/chunk-TTYCVBIQ.mjs +144 -0
- package/dist/chunk-TTYCVBIQ.mjs.map +1 -0
- package/dist/chunk-VJNDOYEC.js +41 -0
- package/dist/chunk-VJNDOYEC.js.map +1 -0
- package/dist/{chunk-J77KR2EV.mjs → chunk-WJ7IMUEJ.mjs} +3 -3
- package/dist/{chunk-J77KR2EV.mjs.map → chunk-WJ7IMUEJ.mjs.map} +1 -1
- package/dist/chunk-YTGUIRRH.js +10 -0
- package/dist/chunk-YTGUIRRH.js.map +1 -0
- package/dist/chunk-ZF7DKR5A.mjs +26 -0
- package/dist/chunk-ZF7DKR5A.mjs.map +1 -0
- package/dist/common/auth/client/index.d.mts +3209 -0
- package/dist/common/auth/client/index.d.ts +3209 -0
- package/dist/common/auth/client/index.js +13 -0
- package/dist/common/auth/client/index.mjs +4 -0
- package/dist/common/auth/components/index.d.mts +140 -0
- package/dist/common/auth/components/index.d.ts +140 -0
- package/dist/common/auth/components/index.js +899 -0
- package/dist/common/auth/components/index.js.map +1 -0
- package/dist/common/auth/components/index.mjs +875 -0
- package/dist/common/auth/components/index.mjs.map +1 -0
- package/dist/common/auth/hooks/index.d.mts +48 -0
- package/dist/common/auth/hooks/index.d.ts +48 -0
- package/dist/common/auth/hooks/index.js +19 -0
- package/dist/common/auth/hooks/index.mjs +6 -0
- package/dist/common/auth/index.d.mts +11 -7
- package/dist/common/auth/index.d.ts +11 -7
- package/dist/common/auth/index.js +7 -19
- package/dist/common/auth/index.mjs +3 -3
- package/dist/common/auth/react/index.d.mts +3056 -0
- package/dist/common/auth/react/index.d.ts +3056 -0
- package/dist/common/auth/react/index.js +31 -0
- package/dist/common/auth/react/index.js.map +1 -0
- package/dist/common/auth/react/index.mjs +21 -0
- package/dist/common/auth/react/index.mjs.map +1 -0
- package/dist/common/auth/rn/index.d.mts +3122 -0
- package/dist/common/auth/rn/index.d.ts +3122 -0
- package/dist/common/auth/rn/index.js +316 -0
- package/dist/common/auth/rn/index.js.map +1 -0
- package/dist/common/auth/rn/index.mjs +298 -0
- package/dist/common/auth/rn/index.mjs.map +1 -0
- package/dist/common/auth/schema/index.d.mts +1479 -0
- package/dist/common/auth/schema/index.d.ts +1479 -0
- package/dist/common/auth/schema/index.js +49 -0
- package/dist/common/auth/schema/index.mjs +4 -0
- package/dist/common/auth/server/index.d.mts +81 -25
- package/dist/common/auth/server/index.d.ts +81 -25
- package/dist/common/auth/server/index.js +146 -98
- package/dist/common/auth/server/index.js.map +1 -1
- package/dist/common/auth/server/index.mjs +125 -5
- package/dist/common/auth/server/index.mjs.map +1 -1
- package/dist/common/auth/services/index.d.mts +14 -0
- package/dist/common/auth/services/index.d.ts +14 -0
- package/dist/common/auth/services/index.js +20 -0
- package/dist/common/auth/services/index.js.map +1 -0
- package/dist/common/auth/services/index.mjs +13 -0
- package/dist/common/auth/services/index.mjs.map +1 -0
- package/dist/common/file/server/index.js +32 -32
- package/dist/common/file/server/index.mjs +3 -3
- package/dist/common/index.d.mts +13 -8
- package/dist/common/index.d.ts +13 -8
- package/dist/common/index.js +19 -18
- package/dist/common/index.mjs +8 -7
- package/dist/common/storage/index.js +13 -12
- package/dist/common/storage/index.mjs +3 -2
- package/dist/festivalCard/index.d.mts +3 -3
- package/dist/festivalCard/index.d.ts +3 -3
- package/dist/festivalCard/routes/index.d.mts +1 -1
- package/dist/festivalCard/routes/index.d.ts +1 -1
- package/dist/festivalCard/server/index.d.mts +2 -2
- package/dist/festivalCard/server/index.d.ts +2 -2
- package/dist/{festivalCardService-BFCRhJrq.d.ts → festivalCardService-B3GsnNpV.d.ts} +1 -1
- package/dist/{festivalCardService-GriR2VMc.d.mts → festivalCardService-CWhrLNE9.d.mts} +1 -1
- package/dist/i18n/index.d.mts +1 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/imageCrop/index.d.mts +3 -3
- package/dist/imageCrop/index.d.ts +3 -3
- package/dist/index-Bd7cKF1j.d.mts +50 -0
- package/dist/{index-CLB80GCP.d.mts → index-D0cqaQEH.d.mts} +5 -5
- package/dist/{index-CLB80GCP.d.ts → index-D0cqaQEH.d.ts} +5 -5
- package/dist/index-DRQxtCDw.d.ts +50 -0
- package/dist/{index-1Ag7IBXN.d.ts → index-DZ5iJtNO.d.mts} +2 -44
- package/dist/{index-DdeZSeTJ.d.mts → index-DZ5iJtNO.d.ts} +2 -44
- package/dist/{index-BxZauNN_.d.ts → index-DoUo8IrU.d.mts} +8 -8
- package/dist/{index-BxZauNN_.d.mts → index-DoUo8IrU.d.ts} +8 -8
- package/dist/index.d.mts +6382 -105
- package/dist/index.d.ts +6382 -105
- package/dist/index.js +1037 -2616
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +976 -2555
- package/dist/index.mjs.map +1 -1
- package/dist/mmd/admin/index.d.mts +1 -1
- package/dist/mmd/admin/index.d.ts +1 -1
- package/dist/mmd/index.d.mts +1 -1
- package/dist/mmd/index.d.ts +1 -1
- package/dist/mmd/server/index.d.mts +3 -3
- package/dist/mmd/server/index.d.ts +3 -3
- package/dist/ossFile/server/index.js +32 -32
- package/dist/ossFile/server/index.mjs +3 -3
- package/dist/storage/index.js +12 -11
- package/dist/storage/index.mjs +2 -1
- package/dist/{types-DyG3ZV9V.d.mts → types-B6B210gX.d.mts} +1 -1
- package/dist/{types-DyG3ZV9V.d.ts → types-B6B210gX.d.ts} +1 -1
- package/dist/{types-BTiaMsBz.d.mts → types-Bdnte5EN.d.mts} +1 -1
- package/dist/{types-tQfupO6d.d.ts → types-Cs0CLvrH.d.mts} +1 -1
- package/dist/{types-tQfupO6d.d.mts → types-Cs0CLvrH.d.ts} +1 -1
- package/dist/{types-ERmJyjx8.d.ts → types-_rFX1atk.d.ts} +1 -1
- package/dist/universalExport/index.d.mts +3 -3
- package/dist/universalExport/index.d.ts +3 -3
- package/dist/universalFile/index.d.mts +5 -5
- package/dist/universalFile/index.d.ts +5 -5
- package/dist/universalFile/server/index.js +62 -62
- package/dist/universalFile/server/index.mjs +2 -2
- package/dist/useAuthActions-7S5dL7Oh.d.mts +77 -0
- package/dist/useAuthActions-7S5dL7Oh.d.ts +77 -0
- package/dist/vocaloidBooth/server/index.d.mts +3 -3
- package/dist/vocaloidBooth/server/index.d.ts +3 -3
- package/package.json +44 -111
- package/dist/auth/client/index.d.mts +0 -32
- package/dist/auth/client/index.d.ts +0 -32
- package/dist/auth/client/index.js +0 -21
- package/dist/auth/client/index.mjs +0 -4
- package/dist/auth/components/index.d.mts +0 -227
- package/dist/auth/components/index.d.ts +0 -227
- package/dist/auth/components/index.js +0 -327
- package/dist/auth/components/index.js.map +0 -1
- package/dist/auth/components/index.mjs +0 -319
- package/dist/auth/components/index.mjs.map +0 -1
- package/dist/auth/hooks/index.d.mts +0 -31
- package/dist/auth/hooks/index.d.ts +0 -31
- package/dist/auth/hooks/index.js +0 -17
- package/dist/auth/hooks/index.mjs +0 -4
- package/dist/auth/index.d.mts +0 -18
- package/dist/auth/index.d.ts +0 -18
- package/dist/auth/index.js +0 -151
- package/dist/auth/index.mjs +0 -10
- package/dist/auth/legacy/core/index.d.mts +0 -42
- package/dist/auth/legacy/core/index.d.ts +0 -42
- package/dist/auth/legacy/core/index.js +0 -242
- package/dist/auth/legacy/core/index.js.map +0 -1
- package/dist/auth/legacy/core/index.mjs +0 -226
- package/dist/auth/legacy/core/index.mjs.map +0 -1
- package/dist/auth/legacy/db/index.d.mts +0 -5
- package/dist/auth/legacy/db/index.d.ts +0 -5
- package/dist/auth/legacy/db/index.js +0 -261
- package/dist/auth/legacy/db/index.js.map +0 -1
- package/dist/auth/legacy/db/index.mjs +0 -250
- package/dist/auth/legacy/db/index.mjs.map +0 -1
- package/dist/auth/legacy/index.d.mts +0 -5
- package/dist/auth/legacy/index.d.ts +0 -5
- package/dist/auth/legacy/index.js +0 -1107
- package/dist/auth/legacy/index.js.map +0 -1
- package/dist/auth/legacy/index.mjs +0 -1086
- package/dist/auth/legacy/index.mjs.map +0 -1
- package/dist/auth/legacy/logic/index.d.mts +0 -9
- package/dist/auth/legacy/logic/index.d.ts +0 -9
- package/dist/auth/legacy/logic/index.js +0 -194
- package/dist/auth/legacy/logic/index.js.map +0 -1
- package/dist/auth/legacy/logic/index.mjs +0 -187
- package/dist/auth/legacy/logic/index.mjs.map +0 -1
- package/dist/auth/legacy/miniapp/index.d.mts +0 -5
- package/dist/auth/legacy/miniapp/index.d.ts +0 -5
- package/dist/auth/legacy/miniapp/index.js +0 -506
- package/dist/auth/legacy/miniapp/index.js.map +0 -1
- package/dist/auth/legacy/miniapp/index.mjs +0 -487
- package/dist/auth/legacy/miniapp/index.mjs.map +0 -1
- package/dist/auth/legacy/routes/index.d.mts +0 -53
- package/dist/auth/legacy/routes/index.d.ts +0 -53
- package/dist/auth/legacy/routes/index.js +0 -278
- package/dist/auth/legacy/routes/index.js.map +0 -1
- package/dist/auth/legacy/routes/index.mjs +0 -271
- package/dist/auth/legacy/routes/index.mjs.map +0 -1
- package/dist/auth/legacy/schema/index.d.mts +0 -401
- package/dist/auth/legacy/schema/index.d.ts +0 -401
- package/dist/auth/legacy/schema/index.js +0 -50
- package/dist/auth/legacy/schema/index.js.map +0 -1
- package/dist/auth/legacy/schema/index.mjs +0 -44
- package/dist/auth/legacy/schema/index.mjs.map +0 -1
- package/dist/auth/legacy/server/index.d.mts +0 -13
- package/dist/auth/legacy/server/index.d.ts +0 -13
- package/dist/auth/legacy/server/index.js +0 -21
- package/dist/auth/legacy/server/index.js.map +0 -1
- package/dist/auth/legacy/server/index.mjs +0 -19
- package/dist/auth/legacy/server/index.mjs.map +0 -1
- package/dist/auth/legacy/services/index.d.mts +0 -40
- package/dist/auth/legacy/services/index.d.ts +0 -40
- package/dist/auth/legacy/services/index.js +0 -258
- package/dist/auth/legacy/services/index.js.map +0 -1
- package/dist/auth/legacy/services/index.mjs +0 -252
- package/dist/auth/legacy/services/index.mjs.map +0 -1
- package/dist/auth/legacy/ui/miniapp/index.d.mts +0 -10
- package/dist/auth/legacy/ui/miniapp/index.d.ts +0 -10
- package/dist/auth/legacy/ui/miniapp/index.js +0 -298
- package/dist/auth/legacy/ui/miniapp/index.js.map +0 -1
- package/dist/auth/legacy/ui/miniapp/index.mjs +0 -290
- package/dist/auth/legacy/ui/miniapp/index.mjs.map +0 -1
- package/dist/auth/legacy/ui/web/index.d.mts +0 -22
- package/dist/auth/legacy/ui/web/index.d.ts +0 -22
- package/dist/auth/legacy/ui/web/index.js +0 -899
- package/dist/auth/legacy/ui/web/index.js.map +0 -1
- package/dist/auth/legacy/ui/web/index.mjs +0 -889
- package/dist/auth/legacy/ui/web/index.mjs.map +0 -1
- package/dist/auth/legacy/web/index.d.mts +0 -5
- package/dist/auth/legacy/web/index.d.ts +0 -5
- package/dist/auth/legacy/web/index.js +0 -1107
- package/dist/auth/legacy/web/index.js.map +0 -1
- package/dist/auth/legacy/web/index.mjs +0 -1086
- package/dist/auth/legacy/web/index.mjs.map +0 -1
- package/dist/auth/middleware/index.d.mts +0 -75
- package/dist/auth/middleware/index.d.ts +0 -75
- package/dist/auth/middleware/index.js +0 -15
- package/dist/auth/middleware/index.js.map +0 -1
- package/dist/auth/middleware/index.mjs +0 -6
- package/dist/auth/middleware/index.mjs.map +0 -1
- package/dist/auth/rn/index.d.mts +0 -64
- package/dist/auth/rn/index.d.ts +0 -64
- package/dist/auth/rn/index.js +0 -765
- package/dist/auth/rn/index.js.map +0 -1
- package/dist/auth/rn/index.mjs +0 -754
- package/dist/auth/rn/index.mjs.map +0 -1
- package/dist/auth/routes/index.d.mts +0 -261
- package/dist/auth/routes/index.d.ts +0 -261
- package/dist/auth/routes/index.js +0 -59
- package/dist/auth/routes/index.js.map +0 -1
- package/dist/auth/routes/index.mjs +0 -6
- package/dist/auth/routes/index.mjs.map +0 -1
- package/dist/auth/schema/index.d.mts +0 -789
- package/dist/auth/schema/index.d.ts +0 -789
- package/dist/auth/schema/index.js +0 -41
- package/dist/auth/schema/index.js.map +0 -1
- package/dist/auth/schema/index.mjs +0 -4
- package/dist/auth/schema/index.mjs.map +0 -1
- package/dist/auth/services/index.d.mts +0 -48
- package/dist/auth/services/index.d.ts +0 -48
- package/dist/auth/services/index.js +0 -34
- package/dist/auth/services/index.js.map +0 -1
- package/dist/auth/services/index.mjs +0 -5
- package/dist/auth/services/index.mjs.map +0 -1
- package/dist/base-api-client-ACKKt13v.d.mts +0 -277
- package/dist/base-api-client-ACKKt13v.d.ts +0 -277
- package/dist/base-api-client-B3wZZoaH.d.ts +0 -103
- package/dist/base-api-client-DrL35Ea2.d.mts +0 -103
- package/dist/chunk-37HYTHEC.mjs +0 -90
- package/dist/chunk-37HYTHEC.mjs.map +0 -1
- package/dist/chunk-5WV35FPV.js +0 -131
- package/dist/chunk-5WV35FPV.js.map +0 -1
- package/dist/chunk-DCRD5CZB.js +0 -573
- package/dist/chunk-DCRD5CZB.js.map +0 -1
- package/dist/chunk-DDX4JKFS.js +0 -19
- package/dist/chunk-DDX4JKFS.js.map +0 -1
- package/dist/chunk-DV6M7MFP.js +0 -283
- package/dist/chunk-DV6M7MFP.js.map +0 -1
- package/dist/chunk-HBF4HPRK.js +0 -186
- package/dist/chunk-HBF4HPRK.js.map +0 -1
- package/dist/chunk-HCI6JQOU.mjs +0 -183
- package/dist/chunk-HCI6JQOU.mjs.map +0 -1
- package/dist/chunk-I44HXJ3X.mjs +0 -17
- package/dist/chunk-I44HXJ3X.mjs.map +0 -1
- package/dist/chunk-IIVNHQEI.mjs.map +0 -1
- package/dist/chunk-IJ4YYWE3.mjs +0 -122
- package/dist/chunk-IJ4YYWE3.mjs.map +0 -1
- package/dist/chunk-J4BEIZUC.js +0 -92
- package/dist/chunk-J4BEIZUC.js.map +0 -1
- package/dist/chunk-OKPWFVXC.js +0 -24
- package/dist/chunk-OKPWFVXC.js.map +0 -1
- package/dist/chunk-PNOTQAYK.mjs +0 -560
- package/dist/chunk-PNOTQAYK.mjs.map +0 -1
- package/dist/chunk-PTMSDNGO.mjs.map +0 -1
- package/dist/chunk-Q2IAL7YV.js +0 -36
- package/dist/chunk-Q2IAL7YV.js.map +0 -1
- package/dist/chunk-QQ2WFYOD.js.map +0 -1
- package/dist/chunk-VQ54PUQV.js +0 -216
- package/dist/chunk-VQ54PUQV.js.map +0 -1
- package/dist/chunk-W5JEGA76.mjs +0 -33
- package/dist/chunk-W5JEGA76.mjs.map +0 -1
- package/dist/chunk-YGI7UU2D.mjs +0 -212
- package/dist/chunk-YGI7UU2D.mjs.map +0 -1
- package/dist/chunk-ZCLQSI5F.mjs +0 -271
- package/dist/chunk-ZCLQSI5F.mjs.map +0 -1
- package/dist/drizzle-auth-service-D-pljzCD.d.mts +0 -145
- package/dist/drizzle-auth-service-D3qryE_I.d.ts +0 -145
- package/dist/index-Bnh6VqFv.d.ts +0 -35
- package/dist/index-DNKZ7-R_.d.mts +0 -184
- package/dist/index-DNKZ7-R_.d.ts +0 -184
- package/dist/index-DPYkrKZf.d.mts +0 -35
- package/dist/types-C5vUWf9u.d.ts +0 -70
- package/dist/types-C_W_CoUD.d.ts +0 -99
- package/dist/types-DCRvasyH.d.mts +0 -99
- package/dist/types-IYCqCk2g.d.mts +0 -70
- /package/dist/{auth → common/auth}/client/index.js.map +0 -0
- /package/dist/{auth → common/auth}/client/index.mjs.map +0 -0
- /package/dist/{auth → common/auth}/hooks/index.js.map +0 -0
- /package/dist/{auth → common/auth}/hooks/index.mjs.map +0 -0
- /package/dist/{auth → common/auth/schema}/index.js.map +0 -0
- /package/dist/{auth → common/auth/schema}/index.mjs.map +0 -0
|
@@ -1,184 +0,0 @@
|
|
|
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 };
|
package/dist/index-DNKZ7-R_.d.ts
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
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 };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { useAuth, useAuthForm } from './auth/hooks/index.mjs';
|
|
2
|
-
import { B as BaseApiClient } from './base-api-client-DrL35Ea2.mjs';
|
|
3
|
-
import { API_ROUTES, STORAGE_KEYS } from './auth/client/index.mjs';
|
|
4
|
-
import { L as LoginFormState, R as RegisterFormState } from './types-IYCqCk2g.mjs';
|
|
5
|
-
import { b as ApiResponse, c as AuthResponse, A as AuthResult, B as BaseUser, I as IAuthClient, L as LoginForm, R as RegisterForm, a as UseAuthReturn, U as User } from './types-DCRvasyH.mjs';
|
|
6
|
-
import { U as UserRole } from './enums-Dume-V5Y.mjs';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @package sa2kit/common/auth
|
|
10
|
-
*
|
|
11
|
-
* Browser / client 安全入口(R2-211)。
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
declare const index_API_ROUTES: typeof API_ROUTES;
|
|
15
|
-
declare const index_ApiResponse: typeof ApiResponse;
|
|
16
|
-
declare const index_AuthResponse: typeof AuthResponse;
|
|
17
|
-
declare const index_AuthResult: typeof AuthResult;
|
|
18
|
-
declare const index_BaseApiClient: typeof BaseApiClient;
|
|
19
|
-
declare const index_BaseUser: typeof BaseUser;
|
|
20
|
-
declare const index_IAuthClient: typeof IAuthClient;
|
|
21
|
-
declare const index_LoginForm: typeof LoginForm;
|
|
22
|
-
declare const index_LoginFormState: typeof LoginFormState;
|
|
23
|
-
declare const index_RegisterForm: typeof RegisterForm;
|
|
24
|
-
declare const index_RegisterFormState: typeof RegisterFormState;
|
|
25
|
-
declare const index_STORAGE_KEYS: typeof STORAGE_KEYS;
|
|
26
|
-
declare const index_UseAuthReturn: typeof UseAuthReturn;
|
|
27
|
-
declare const index_User: typeof User;
|
|
28
|
-
declare const index_UserRole: typeof UserRole;
|
|
29
|
-
declare const index_useAuth: typeof useAuth;
|
|
30
|
-
declare const index_useAuthForm: typeof useAuthForm;
|
|
31
|
-
declare namespace index {
|
|
32
|
-
export { index_API_ROUTES as API_ROUTES, index_ApiResponse as ApiResponse, index_AuthResponse as AuthResponse, index_AuthResult as AuthResult, index_BaseApiClient as BaseApiClient, index_BaseUser as BaseUser, index_IAuthClient as IAuthClient, index_LoginForm as LoginForm, index_LoginFormState as LoginFormState, index_RegisterForm as RegisterForm, index_RegisterFormState as RegisterFormState, index_STORAGE_KEYS as STORAGE_KEYS, index_UseAuthReturn as UseAuthReturn, index_User as User, index_UserRole as UserRole, index_useAuth as useAuth, index_useAuthForm as useAuthForm };
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export { index as i };
|
package/dist/types-C5vUWf9u.d.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { U as User } from './types-C_W_CoUD.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Auth Components - Types
|
|
5
|
-
* 组件类型定义
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* 登录表单状态
|
|
10
|
-
*/
|
|
11
|
-
interface LoginFormState {
|
|
12
|
-
email: string;
|
|
13
|
-
password: string;
|
|
14
|
-
loading: boolean;
|
|
15
|
-
error: string | null;
|
|
16
|
-
handleEmailChange: (value: string) => void;
|
|
17
|
-
handlePasswordChange: (value: string) => void;
|
|
18
|
-
handleSubmit: (e?: React.FormEvent) => Promise<void>;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* 注册表单状态
|
|
22
|
-
*/
|
|
23
|
-
interface RegisterFormState {
|
|
24
|
-
email: string;
|
|
25
|
-
password: string;
|
|
26
|
-
username: string;
|
|
27
|
-
loading: boolean;
|
|
28
|
-
error: string | null;
|
|
29
|
-
handleEmailChange: (value: string) => void;
|
|
30
|
-
handlePasswordChange: (value: string) => void;
|
|
31
|
-
handleUsernameChange: (value: string) => void;
|
|
32
|
-
handleSubmit: (e?: React.FormEvent) => Promise<void>;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* 表单基础属性
|
|
36
|
-
*/
|
|
37
|
-
interface BaseFormProps {
|
|
38
|
-
/**
|
|
39
|
-
* API 客户端实例
|
|
40
|
-
*/
|
|
41
|
-
apiClient: any;
|
|
42
|
-
/**
|
|
43
|
-
* 成功回调
|
|
44
|
-
*/
|
|
45
|
-
onSuccess?: (user: User) => void;
|
|
46
|
-
/**
|
|
47
|
-
* 错误回调
|
|
48
|
-
*/
|
|
49
|
-
onError?: (error: string) => void;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Headless 登录表单属性
|
|
53
|
-
*/
|
|
54
|
-
interface HeadlessLoginFormProps extends BaseFormProps {
|
|
55
|
-
/**
|
|
56
|
-
* Render prop 函数
|
|
57
|
-
*/
|
|
58
|
-
children: (state: LoginFormState) => React.ReactNode;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Headless 注册表单属性
|
|
62
|
-
*/
|
|
63
|
-
interface HeadlessRegisterFormProps extends BaseFormProps {
|
|
64
|
-
/**
|
|
65
|
-
* Render prop 函数
|
|
66
|
-
*/
|
|
67
|
-
children: (state: RegisterFormState) => React.ReactNode;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export type { BaseFormProps as B, HeadlessLoginFormProps as H, LoginFormState as L, RegisterFormState as R, HeadlessRegisterFormProps as a };
|
package/dist/types-C_W_CoUD.d.ts
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { U as UserRole } from './enums-Dume-V5Y.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Auth 模块类型定义
|
|
5
|
-
* Auth Module Types
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* 用户基础信息(核心字段)
|
|
10
|
-
* Base User Information
|
|
11
|
-
*/
|
|
12
|
-
interface BaseUser {
|
|
13
|
-
id: string;
|
|
14
|
-
email: string;
|
|
15
|
-
username: string;
|
|
16
|
-
role: UserRole;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* 扩展用户信息(可选字段)
|
|
20
|
-
* Extended User Information
|
|
21
|
-
*/
|
|
22
|
-
interface User extends BaseUser {
|
|
23
|
-
nickname?: string;
|
|
24
|
-
avatar?: string;
|
|
25
|
-
createdAt?: string;
|
|
26
|
-
updatedAt?: string;
|
|
27
|
-
[key: string]: any;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* 登录表单数据
|
|
31
|
-
* Login Form Data
|
|
32
|
-
*/
|
|
33
|
-
interface LoginForm {
|
|
34
|
-
email: string;
|
|
35
|
-
password: string;
|
|
36
|
-
rememberMe?: boolean;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* 注册表单数据
|
|
40
|
-
* Register Form Data
|
|
41
|
-
*/
|
|
42
|
-
interface RegisterForm {
|
|
43
|
-
email: string;
|
|
44
|
-
username: string;
|
|
45
|
-
password: string;
|
|
46
|
-
confirmPassword?: string;
|
|
47
|
-
nickname?: string;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* API 响应类型
|
|
51
|
-
*/
|
|
52
|
-
interface ApiResponse<T = any> {
|
|
53
|
-
success: boolean;
|
|
54
|
-
data?: T;
|
|
55
|
-
error?: string;
|
|
56
|
-
message?: string;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* 认证响应类型
|
|
60
|
-
*/
|
|
61
|
-
interface AuthResponse {
|
|
62
|
-
user: User;
|
|
63
|
-
token: string;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* API 客户端基础接口
|
|
67
|
-
*/
|
|
68
|
-
interface IAuthClient {
|
|
69
|
-
isAuthenticated(): Promise<boolean>;
|
|
70
|
-
getCurrentUser(): Promise<ApiResponse<User>>;
|
|
71
|
-
login(email: string, password: string): Promise<ApiResponse<AuthResponse>>;
|
|
72
|
-
register(email: string, password: string, username: string): Promise<ApiResponse<AuthResponse>>;
|
|
73
|
-
logout(): Promise<void>;
|
|
74
|
-
clearUserData(): Promise<void>;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* 认证操作结果接口
|
|
78
|
-
*/
|
|
79
|
-
interface AuthResult {
|
|
80
|
-
success: boolean;
|
|
81
|
-
error?: string;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* useAuth Hook 返回值接口
|
|
85
|
-
*/
|
|
86
|
-
interface UseAuthReturn {
|
|
87
|
-
user: User | null;
|
|
88
|
-
isLoggedIn: boolean;
|
|
89
|
-
loading: boolean;
|
|
90
|
-
checkingAuth: boolean;
|
|
91
|
-
error: string | null;
|
|
92
|
-
login: (email: string, password: string) => Promise<AuthResult>;
|
|
93
|
-
register: (email: string, password: string, username: string) => Promise<AuthResult>;
|
|
94
|
-
logout: () => Promise<void>;
|
|
95
|
-
refresh: () => Promise<void>;
|
|
96
|
-
clearError: () => void;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export type { AuthResult as A, BaseUser as B, IAuthClient as I, LoginForm as L, RegisterForm as R, User as U, UseAuthReturn as a, ApiResponse as b, AuthResponse as c };
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { U as UserRole } from './enums-Dume-V5Y.mjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Auth 模块类型定义
|
|
5
|
-
* Auth Module Types
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* 用户基础信息(核心字段)
|
|
10
|
-
* Base User Information
|
|
11
|
-
*/
|
|
12
|
-
interface BaseUser {
|
|
13
|
-
id: string;
|
|
14
|
-
email: string;
|
|
15
|
-
username: string;
|
|
16
|
-
role: UserRole;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* 扩展用户信息(可选字段)
|
|
20
|
-
* Extended User Information
|
|
21
|
-
*/
|
|
22
|
-
interface User extends BaseUser {
|
|
23
|
-
nickname?: string;
|
|
24
|
-
avatar?: string;
|
|
25
|
-
createdAt?: string;
|
|
26
|
-
updatedAt?: string;
|
|
27
|
-
[key: string]: any;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* 登录表单数据
|
|
31
|
-
* Login Form Data
|
|
32
|
-
*/
|
|
33
|
-
interface LoginForm {
|
|
34
|
-
email: string;
|
|
35
|
-
password: string;
|
|
36
|
-
rememberMe?: boolean;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* 注册表单数据
|
|
40
|
-
* Register Form Data
|
|
41
|
-
*/
|
|
42
|
-
interface RegisterForm {
|
|
43
|
-
email: string;
|
|
44
|
-
username: string;
|
|
45
|
-
password: string;
|
|
46
|
-
confirmPassword?: string;
|
|
47
|
-
nickname?: string;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* API 响应类型
|
|
51
|
-
*/
|
|
52
|
-
interface ApiResponse<T = any> {
|
|
53
|
-
success: boolean;
|
|
54
|
-
data?: T;
|
|
55
|
-
error?: string;
|
|
56
|
-
message?: string;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* 认证响应类型
|
|
60
|
-
*/
|
|
61
|
-
interface AuthResponse {
|
|
62
|
-
user: User;
|
|
63
|
-
token: string;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* API 客户端基础接口
|
|
67
|
-
*/
|
|
68
|
-
interface IAuthClient {
|
|
69
|
-
isAuthenticated(): Promise<boolean>;
|
|
70
|
-
getCurrentUser(): Promise<ApiResponse<User>>;
|
|
71
|
-
login(email: string, password: string): Promise<ApiResponse<AuthResponse>>;
|
|
72
|
-
register(email: string, password: string, username: string): Promise<ApiResponse<AuthResponse>>;
|
|
73
|
-
logout(): Promise<void>;
|
|
74
|
-
clearUserData(): Promise<void>;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* 认证操作结果接口
|
|
78
|
-
*/
|
|
79
|
-
interface AuthResult {
|
|
80
|
-
success: boolean;
|
|
81
|
-
error?: string;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* useAuth Hook 返回值接口
|
|
85
|
-
*/
|
|
86
|
-
interface UseAuthReturn {
|
|
87
|
-
user: User | null;
|
|
88
|
-
isLoggedIn: boolean;
|
|
89
|
-
loading: boolean;
|
|
90
|
-
checkingAuth: boolean;
|
|
91
|
-
error: string | null;
|
|
92
|
-
login: (email: string, password: string) => Promise<AuthResult>;
|
|
93
|
-
register: (email: string, password: string, username: string) => Promise<AuthResult>;
|
|
94
|
-
logout: () => Promise<void>;
|
|
95
|
-
refresh: () => Promise<void>;
|
|
96
|
-
clearError: () => void;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export type { AuthResult as A, BaseUser as B, IAuthClient as I, LoginForm as L, RegisterForm as R, User as U, UseAuthReturn as a, ApiResponse as b, AuthResponse as c };
|