From 9e86447c45b52bca5502a230c47211152563ea54 Mon Sep 17 00:00:00 2001 From: siujamo Date: Fri, 28 Aug 2026 09:52:50 +0800 Subject: [PATCH] chore: sync main branch with develop (monorepo rename) --- .gitea/workflows/server-build-and-deploy.yml | 89 + .gitea/workflows/web-build-and-deploy.yml | 115 + .gitignore | 114 +- CLAUDE.md | 100 +- README.md | 152 +- server/Dockerfile | 2 +- server/Dockerfile.ci | 6 +- server/build.gradle.kts | 54 +- server/config/application-prod.yaml.example | 100 +- server/gradle/libs.versions.toml | 88 + server/settings.gradle.kts | 2 +- .../ahsarahguide/AhsarahGuideApplication.java | 20 + .../ahsarahguide/client/EmailClient.java | 109 + .../ahsarahguide/client/TokenClient.java | 75 + .../ahsarahguide/config/AppConfig.java | 48 + .../ahsarahguide/config/CacheConfig.java | 102 + .../ahsarahguide/config/CorsConfig.java | 49 + .../config/EmailTemplateConfig.java | 37 + .../ahsarahguide/config/FilterConfig.java | 21 + .../ahsarahguide/config/JacksonConfig.java | 25 + .../ahsarahguide/config/MyBatisConfig.java | 15 + .../config/OpenApiConfiguration.java | 26 + .../ahsarahguide/config/SecurityConfig.java | 113 + .../ahsarahguide/config/SpringDataConfig.java | 15 + .../ahsarahguide/config/WebhookConfig.java | 10 + .../controller/AdminController.java | 59 + .../controller/AuthController.java | 62 + .../controller/DailyPasswordController.java | 32 + .../controller/FirearmController.java | 72 + .../controller/GlobalExceptionHandler.java | 44 + .../controller/ModificationController.java | 109 + .../controller/TagController.java | 34 + .../controller/UserController.java | 79 + .../controller/VersionController.java | 26 + .../controller/WebhookController.java | 47 + .../converter/FirearmTypeConverter.java | 26 + .../ModificationStatusConverter.java | 28 + .../domain/dto/AccessoryRequest.java | 25 + .../domain/dto/AccessoryResponse.java | 27 + .../domain/dto/BuildSummaryResponse.java | 20 + .../domain/dto/ChangePasswordRequest.java | 23 + .../domain/dto/DailyPassword.java | 12 + .../domain/dto/DailyPasswordData.java | 19 + .../domain/dto/DailyPasswordMetadata.java | 12 + .../domain/dto/DailyPasswordResponse.java | 14 + .../domain/dto/EmailVerificationCode.java | 8 + .../domain/dto/ErrorResponse.java | 12 + .../domain/dto/FirearmRequest.java | 20 + .../domain/dto/FirearmResponse.java | 36 + .../domain/dto/GitHubIssueRequest.java | 15 + .../domain/dto/GitHubWebhookIssue.java | 20 + .../domain/dto/GitHubWebhookLabel.java | 12 + .../domain/dto/GitHubWebhookRepository.java | 12 + .../domain/dto/GitHubWebhookSender.java | 12 + .../ahsarahguide/domain/dto/LoginRequest.java | 20 + .../domain/dto/ManageRoleRequest.java | 13 + .../dto/ModificationBatchCreateRequest.java | 18 + .../dto/ModificationBatchDeleteRequest.java | 18 + .../domain/dto/ModificationRequest.java | 38 + .../domain/dto/ModificationResponse.java | 39 + .../ahsarahguide/domain/dto/PageResponse.java | 29 + .../domain/dto/RegisterRequest.java | 31 + .../dto/SendVerificationCodeRequest.java | 9 + .../dto/SendVerificationCodeResponse.java | 6 + .../domain/dto/TuningRequest.java | 18 + .../domain/dto/TuningResponse.java | 21 + .../domain/dto/UpdateProfileRequest.java | 14 + .../domain/dto/UserProfileResponse.java | 44 + .../ahsarahguide/domain/dto/UserResponse.java | 26 + .../ahsarahguide/domain/entity/Accessory.java | 72 + .../ahsarahguide/domain/entity/Firearm.java | 232 ++ .../domain/entity/Modification.java | 289 ++ .../ahsarahguide/domain/entity/Tuning.java | 50 + .../ahsarahguide/domain/entity/User.java | 217 ++ .../domain/entity/UserCredential.java | 143 + .../domain/entity/UserCredentialId.java | 81 + .../ahsarahguide/domain/entity/UserRole.java | 101 + .../ahsarahguide/enumeration/FirearmType.java | 50 + .../enumeration/ModificationStatus.java | 44 + .../exeption/BadRequestException.java | 11 + .../exeption/ConflictException.java | 11 + .../exeption/ForbiddenException.java | 11 + .../InternalServerErrorException.java | 11 + .../exeption/NotFoundException.java | 11 + .../exeption/UnauthorisedException.java | 11 + .../filter/TokenAuthenticationFilter.java | 123 + .../ahsarahguide/filter/WebhookFilter.java | 22 + .../interceptor/GitHubWebhookInterceptor.java | 83 + .../interceptor/TrafficInterceptor.java | 46 + .../ahsarahguide/manager/AppManager.java | 27 + .../ahsarahguide/manager/CookieManager.java | 88 + .../manager/DailyPasswordManager.java | 84 + .../manager/ModificationManager.java | 140 + .../manager/UserCredentialManager.java | 76 + .../ahsarahguide/manager/UserManager.java | 128 + .../ahsarahguide/manager/UserRoleManager.java | 72 + .../ahsarahguide/manager/WebhookManager.java | 24 + .../properties/AppProperties.java | 11 + .../properties/CookieProperties.java | 27 + .../properties/CorsProperties.java | 36 + .../properties/GitHubWebhookProperties.java | 12 + .../properties/TokenProperties.java | 23 + .../repository/FirearmRepository.java | 25 + .../repository/ModificationRepository.java | 45 + .../repository/UserCredentialRepository.java | 80 + .../repository/UserRepository.java | 52 + .../repository/UserRoleRepository.java | 72 + .../security/annotation/RequiresAdmin.java | 14 + .../security/annotation/RequiresAuth.java | 19 + .../annotation/RequiresSuperUser.java | 14 + .../UsernamePasswordAuthentication.java | 101 + ...sernamePasswordAuthenticationProvider.java | 117 + .../security/resolver/CurrentUser.java | 22 + .../resolver/CurrentUserArgumentResolver.java | 45 + .../ahsarahguide/service/AppService.java | 18 + .../ahsarahguide/service/AuthService.java | 215 ++ .../service/DailyPasswordService.java | 28 + .../ahsarahguide/service/FirearmService.java | 111 + .../service/ModificationService.java | 223 ++ .../ahsarahguide/service/UserService.java | 269 ++ .../ahsarahguide/service/WebhookService.java | 218 ++ .../ahsarahguide/shared/CookieName.java | 11 + .../shared/CredentialProvider.java | 11 + .../shared/DateTimeFormatters.java | 46 + .../shared/GitHubWebhookHeader.java | 56 + .../ahsarahguide/shared/JacksonModules.java | 40 + .../shared/JacksonRedisSerialiser.java | 28 + .../onixbyte/ahsarahguide/shared/Role.java | 19 + .../ModificationSpecification.java | 41 + .../ahsarahguide/utils/DateTimeUtil.java | 24 + .../wrapper/RepeatedlyReadRequestWrapper.java | 56 + server/src/main/resources/application.yaml | 15 +- .../db/migration/V6__user_profile.sql | 6 + .../resources/db/migration/V7__user_role.sql | 6 + .../db/migration/V8__modification.sql | 71 + .../mail-templates/verification-code.html | 71 + web/.env.example | 21 + web/.vscode/launch.json | 39 +- web/index.html | 2 +- web/package-lock.json | 3077 +++++++++++++++++ web/package.json | 36 +- web/pnpm-lock.yaml | 1556 ++++----- web/pnpm-workspace.yaml | 2 + web/src/api/auth-api.ts | 13 + web/src/api/firearm-api.ts | 28 +- web/src/api/index.ts | 1 + web/src/api/modification-api.ts | 36 +- .../components/firearm-create-modal/index.tsx | 58 + .../components/firearm-edit-modal/index.tsx | 67 + web/src/components/firearm-form/index.tsx | 101 + .../components/markdown-renderer/index.tsx | 17 + web/src/components/mod-codes/index.tsx | 357 ++ .../modification-create-modal/index.tsx | 97 + .../modification-edit-modal/index.tsx | 100 + .../components/modification-form/index.tsx | 217 ++ web/src/constant/calibres.json | 23 + web/src/constant/slots.json | 19 + web/src/constant/tunings.json | 1 + web/src/docs/EULA.md | 29 + web/src/docs/PrivacyPolicy.md | 33 + web/src/hooks/store.ts | 5 + web/src/index.css | 170 +- web/src/layout/hero-layout/index.tsx | 168 +- web/src/main.tsx | 1 - web/src/markdown.d.ts | 6 + web/src/page/firearms/index.tsx | 481 ++- web/src/page/legal/index.tsx | 34 + web/src/page/login/index.tsx | 67 + web/src/page/mod-codes/index.tsx | 227 +- web/src/router/index.tsx | 20 + web/src/shared/dayjs/index.ts | 6 + web/src/shared/web-client/index.ts | 3 +- web/src/store/auth-slice.ts | 26 + web/src/store/index.ts | 7 +- web/src/types/auth.ts | 11 + web/src/types/common.ts | 17 + web/src/types/firearm.ts | 24 + web/src/types/index.ts | 53 +- web/src/types/modification.ts | 24 + web/src/vite-env.d.ts | 8 + web/tailwind.config.ts | 10 + web/vite.config.ts | 39 +- 182 files changed, 13333 insertions(+), 1308 deletions(-) create mode 100644 .gitea/workflows/server-build-and-deploy.yml create mode 100644 .gitea/workflows/web-build-and-deploy.yml create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/AhsarahGuideApplication.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/client/EmailClient.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/client/TokenClient.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/config/AppConfig.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/config/CacheConfig.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/config/CorsConfig.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/config/EmailTemplateConfig.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/config/FilterConfig.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/config/JacksonConfig.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/config/MyBatisConfig.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/config/OpenApiConfiguration.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/config/SecurityConfig.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/config/SpringDataConfig.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/config/WebhookConfig.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/controller/AdminController.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/controller/AuthController.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/controller/DailyPasswordController.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/controller/FirearmController.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/controller/GlobalExceptionHandler.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/controller/ModificationController.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/controller/TagController.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/controller/UserController.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/controller/VersionController.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/controller/WebhookController.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/converter/FirearmTypeConverter.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/converter/ModificationStatusConverter.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/AccessoryRequest.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/AccessoryResponse.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/BuildSummaryResponse.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ChangePasswordRequest.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/DailyPassword.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/DailyPasswordData.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/DailyPasswordMetadata.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/DailyPasswordResponse.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/EmailVerificationCode.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ErrorResponse.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/FirearmRequest.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/FirearmResponse.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/GitHubIssueRequest.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/GitHubWebhookIssue.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/GitHubWebhookLabel.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/GitHubWebhookRepository.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/GitHubWebhookSender.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/LoginRequest.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ManageRoleRequest.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ModificationBatchCreateRequest.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ModificationBatchDeleteRequest.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ModificationRequest.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ModificationResponse.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/PageResponse.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/RegisterRequest.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/SendVerificationCodeRequest.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/SendVerificationCodeResponse.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/TuningRequest.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/TuningResponse.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/UpdateProfileRequest.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/UserProfileResponse.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/UserResponse.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/Accessory.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/Firearm.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/Modification.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/Tuning.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/User.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/UserCredential.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/UserCredentialId.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/UserRole.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/enumeration/FirearmType.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/enumeration/ModificationStatus.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/exeption/BadRequestException.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/exeption/ConflictException.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/exeption/ForbiddenException.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/exeption/InternalServerErrorException.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/exeption/NotFoundException.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/exeption/UnauthorisedException.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/filter/TokenAuthenticationFilter.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/filter/WebhookFilter.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/interceptor/GitHubWebhookInterceptor.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/interceptor/TrafficInterceptor.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/manager/AppManager.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/manager/CookieManager.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/manager/DailyPasswordManager.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/manager/ModificationManager.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/manager/UserCredentialManager.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/manager/UserManager.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/manager/UserRoleManager.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/manager/WebhookManager.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/properties/AppProperties.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/properties/CookieProperties.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/properties/CorsProperties.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/properties/GitHubWebhookProperties.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/properties/TokenProperties.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/repository/FirearmRepository.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/repository/ModificationRepository.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/repository/UserCredentialRepository.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/repository/UserRepository.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/repository/UserRoleRepository.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/security/annotation/RequiresAdmin.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/security/annotation/RequiresAuth.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/security/annotation/RequiresSuperUser.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/security/authentication/UsernamePasswordAuthentication.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/security/provider/UsernamePasswordAuthenticationProvider.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/security/resolver/CurrentUser.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/security/resolver/CurrentUserArgumentResolver.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/service/AppService.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/service/AuthService.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/service/DailyPasswordService.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/service/FirearmService.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/service/ModificationService.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/service/UserService.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/service/WebhookService.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/shared/CookieName.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/shared/CredentialProvider.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/shared/DateTimeFormatters.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/shared/GitHubWebhookHeader.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/shared/JacksonModules.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/shared/JacksonRedisSerialiser.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/shared/Role.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/specification/ModificationSpecification.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/utils/DateTimeUtil.java create mode 100644 server/src/main/java/com/onixbyte/ahsarahguide/wrapper/RepeatedlyReadRequestWrapper.java create mode 100644 server/src/main/resources/db/migration/V6__user_profile.sql create mode 100644 server/src/main/resources/db/migration/V7__user_role.sql create mode 100644 server/src/main/resources/db/migration/V8__modification.sql create mode 100644 server/src/main/resources/mail-templates/verification-code.html create mode 100644 web/package-lock.json create mode 100644 web/pnpm-workspace.yaml create mode 100644 web/src/api/auth-api.ts create mode 100644 web/src/components/firearm-create-modal/index.tsx create mode 100644 web/src/components/firearm-edit-modal/index.tsx create mode 100644 web/src/components/firearm-form/index.tsx create mode 100644 web/src/components/markdown-renderer/index.tsx create mode 100644 web/src/components/mod-codes/index.tsx create mode 100644 web/src/components/modification-create-modal/index.tsx create mode 100644 web/src/components/modification-edit-modal/index.tsx create mode 100644 web/src/components/modification-form/index.tsx create mode 100644 web/src/constant/calibres.json create mode 100644 web/src/constant/slots.json create mode 100644 web/src/constant/tunings.json create mode 100644 web/src/docs/EULA.md create mode 100644 web/src/docs/PrivacyPolicy.md create mode 100644 web/src/hooks/store.ts create mode 100644 web/src/markdown.d.ts create mode 100644 web/src/page/legal/index.tsx create mode 100644 web/src/page/login/index.tsx create mode 100644 web/src/shared/dayjs/index.ts create mode 100644 web/src/store/auth-slice.ts create mode 100644 web/src/types/auth.ts create mode 100644 web/src/types/common.ts create mode 100644 web/src/types/firearm.ts create mode 100644 web/src/types/modification.ts create mode 100644 web/tailwind.config.ts diff --git a/.gitea/workflows/server-build-and-deploy.yml b/.gitea/workflows/server-build-and-deploy.yml new file mode 100644 index 0000000..ef40435 --- /dev/null +++ b/.gitea/workflows/server-build-and-deploy.yml @@ -0,0 +1,89 @@ +name: Build and Deploy + +on: + release: + types: [published] + +env: + APP_NAME: ahsarah-guide-server + +jobs: + build-and-release: + runs-on: ubuntu-latest + defaults: + run: + working-directory: server + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 21 (Corretto) + uses: actions/setup-java@v4 + with: + java-version: 21 + distribution: corretto + cache: gradle + + - name: Build with Gradle + run: > + ./gradlew bootJar -x test + -PartefactVersion="${{ gitea.event.release.tag_name }}" + -PbuildChannel=stable + -Pvendor=${{ vars.VENDOR }} + + - name: Resolve JAR file path + id: jar + run: | + JAR_PATH=$(find build/libs -name '*.jar' | head -1) + echo "file=$JAR_PATH" >> "$GITHUB_OUTPUT" + + - name: Upload JAR to Gitea Release + run: | + TAG="${{ gitea.event.release.tag_name }}" + FILE="${{ steps.jar.outputs.file }}" + ASSET_NAME="${APP_NAME}-${TAG}.jar" + curl -X POST \ + -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \ + -H "Content-Type: multipart/form-data" \ + -F "attachment=@${FILE};filename=${ASSET_NAME}" \ + "${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/releases/${{ gitea.event.release.id }}/assets?name=${ASSET_NAME}" + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + + - name: Generate image tags + id: meta + run: | + DOCKERHUB_USER="${{ vars.DOCKER_HUB_USERNAME }}" + echo "tag_version=${DOCKERHUB_USER}/${APP_NAME}:${{ gitea.event.release.tag_name }}" >> "$GITHUB_OUTPUT" + echo "tag_latest=${DOCKERHUB_USER}/${APP_NAME}:latest" >> "$GITHUB_OUTPUT" + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: server + file: server/Dockerfile.ci + build-args: | + JAR_FILE=${{ steps.jar.outputs.file }} + IMAGE_VERSION=${{ gitea.event.release.tag_name }} + IMAGE_VENDOR=${{ vars.VENDOR }} + BUILD_DATE=${{ gitea.event.release.published_at }} + push: true + tags: | + ${{ steps.meta.outputs.tag_version }} + ${{ steps.meta.outputs.tag_latest }} + + - name: Push README to Docker Hub + uses: christian-korneck/update-container-description-action@v1 + env: + DOCKER_USER: ${{ vars.DOCKER_HUB_USERNAME }} + DOCKER_PASS: ${{ secrets.DOCKER_HUB_TOKEN }} + with: + destination_container_repo: ${{ vars.DOCKER_HUB_USERNAME }}/${{ env.APP_NAME }} + provider: dockerhub + readme_file: server/README.md diff --git a/.gitea/workflows/web-build-and-deploy.yml b/.gitea/workflows/web-build-and-deploy.yml new file mode 100644 index 0000000..a0e8354 --- /dev/null +++ b/.gitea/workflows/web-build-and-deploy.yml @@ -0,0 +1,115 @@ +name: Build and Deploy + +on: + release: + types: [published] + +jobs: + build: + name: Build release archive + runs-on: ubuntu-latest + defaults: + run: + working-directory: web + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 24 + cache: pnpm + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 11 + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build release archive + run: pnpm build:tar + + - name: Clean up previous build artifacts on server + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ vars.DEPLOY_HOST }} + username: ${{ vars.DEPLOY_USER }} + port: ${{ vars.DEPLOY_PORT }} + key: ${{ secrets.DEPLOY_SSH_KEY }} + command: rm -rf /tmp/dist.tar.gz /tmp/dist.tar.gz/ + + - name: Upload artifact to server + uses: appleboy/scp-action@v0.1.7 + with: + host: ${{ vars.DEPLOY_HOST }} + username: ${{ vars.DEPLOY_USER }} + port: ${{ vars.DEPLOY_PORT }} + key: ${{ secrets.DEPLOY_SSH_KEY }} + source: "dist.tar.gz" + target: "/tmp/" + + upload-release-asset: + name: Upload to Gitea Release + needs: build + runs-on: ubuntu-latest + + steps: + - name: Download artifact from server + env: + DEPLOY_HOST: ${{ vars.DEPLOY_HOST }} + DEPLOY_USER: ${{ vars.DEPLOY_USER }} + DEPLOY_PORT: ${{ vars.DEPLOY_PORT }} + DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }} + run: | + set -e + SSH_DIR="${RUNNER_TEMP}/ssh" + mkdir -p "$SSH_DIR" + chmod 700 "$SSH_DIR" + printf '%s\n' "$DEPLOY_SSH_KEY" > "$SSH_DIR/key" + chmod 600 "$SSH_DIR/key" + scp -i "$SSH_DIR/key" \ + -P "$DEPLOY_PORT" \ + -o StrictHostKeyChecking=accept-new \ + -o UserKnownHostsFile="$SSH_DIR/known_hosts" \ + "${DEPLOY_USER}@${DEPLOY_HOST}:/tmp/dist.tar.gz" \ + ./dist.tar.gz + rm -rf "$SSH_DIR" + + - name: Upload release asset via Gitea API + run: | + set -e + RELEASE_ID=$(jq -r '.release.id' "$GITEA_EVENT_PATH") + URL="${GITEA_SERVER_URL}/api/v1/repos/${GITEA_REPOSITORY}/releases/${RELEASE_ID}/assets?name=dist.tar.gz" + curl -fsSL \ + -X POST \ + -H "Authorization: token ${GITEA_TOKEN}" \ + -H "Content-Type: application/gzip" \ + --data-binary "@dist.tar.gz" \ + "${URL}" + + deploy-to-server: + name: Deploy to onixbyte.cn + needs: [build, upload-release-asset] + runs-on: ubuntu-latest + + steps: + - name: Extract archive and deploy + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ vars.DEPLOY_HOST }} + username: ${{ vars.DEPLOY_USER }} + port: ${{ vars.DEPLOY_PORT }} + key: ${{ secrets.DEPLOY_SSH_KEY }} + script_stop: true + script: | + set -e + DEPLOY_PATH="${{ vars.DEPLOY_PATH }}" + mkdir -p "$DEPLOY_PATH" + rm -rf "$DEPLOY_PATH"/* + tar -xzf /tmp/dist.tar.gz -C "$DEPLOY_PATH" --strip-components=1 + chown -R caddy:caddy "$DEPLOY_PATH" + rm -f /tmp/dist.tar.gz diff --git a/.gitignore b/.gitignore index e026c93..6ce4700 100644 --- a/.gitignore +++ b/.gitignore @@ -97,7 +97,7 @@ fabric.properties # Editor-based HTTP Client http-client.private.env.json -### Server +### Java # Compiled class file *.class @@ -111,26 +111,18 @@ http-client.private.env.json .mtj.tmp/ # Package Files # +*.jar *.war *.nar *.ear *.zip *.tar.gz *.rar -*.jar # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* replay_pid* -# Config -config/*.yml -config/*.yaml -config/*.properties - -# Tests -test/ - ### Gradle .gradle **/build/ @@ -143,13 +135,6 @@ test/ gradle-app.setting .gradletasknamecache -### Claude Code -.claude/settings.local.json -.claude/memory/ -.claude/plans/ -.claude/worktrees/ -.claude/scheduled_tasks.json - # Eclipse Gradle plugin generated files # Eclipse Core .project @@ -158,5 +143,100 @@ gradle-app.setting gradle.properties +### Node.js +# Logs +logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.* +!.env.example + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Vite logs files +vite.config.js.timestamp-* +vite.config.ts.timestamp-* + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v3 +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions + +### Server-specific +# Config +server/config/*.yml +server/config/*.yaml +server/config/*.properties + +# Tests +server/test/ + # frp config frpc.toml + +### Claude Code +.claude/settings.local.json +.claude/memory/ +.claude/plans/ +.claude/worktrees/ +.claude/scheduled_tasks.json diff --git a/CLAUDE.md b/CLAUDE.md index 3e567dd..f9c9f80 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2,16 +2,25 @@ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. -## Coding Standards +## Monorepo Structure + +- `server/` — Java 21 + Spring Boot 3.5 + Gradle (Kotlin DSL) REST API backend +- `web/` — React 19 + Vite 8 + TypeScript + Ant Design 6 + Tailwind CSS 4 frontend + +## Server + +### Coding Standards - **Style**: Follow the Google Java Coding Style as the foundation. - **Indentation**: Use 4 spaces — no tabs. - **Line length**: Maximum 100 characters per line. - **Comments**: All code comments must use British English spelling (e.g. "colour" not "color", "behaviour" not "behavior", "serialise" not "serialize", "analyse" not "analyze", "traveller" not "traveler"). -## Build & Test Commands +### Build & Test Commands ```bash +cd server + # Build the project (skip tests) ./gradlew build -x test @@ -19,10 +28,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ./gradlew test # Run a single test class -./gradlew test --tests "com.onixbyte.deltaforceguide.service.PasswordEncoderTest" - -# Run a specific test method -./gradlew test --tests "com.onixbyte.deltaforceguide.service.PasswordEncoderTest.generatePassword" +./gradlew test --tests "com.onixbyte.ahsarahguide.service.PasswordEncoderTest" # Build the full JAR ./gradlew bootJar @@ -30,14 +36,14 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co The project uses Gradle with Java 21 (Amazon Corretto). Tests use JUnit 5 with the Spring Boot test framework, H2 in-memory database for test runtime, and Spring Security test support. Tests require an active `dev` profile. -## Code Architecture +### Code Architecture -**Delta Force Guide Server** — A REST API backend for managing Delta Force game firearm builds/modifications. +**Ahsarah Guide Server** — A REST API backend for managing firearm builds/modifications. ### Package structure ``` -com.onixbyte.deltaforceguide +com.onixbyte.ahsarahguide ├── client/ # External service clients (TokenClient for JWT) ├── config/ # Spring beans: Security, CORS, Cache/Redis, Jackson, MyBatis, Spring Data ├── controller/ # REST controllers (Firearm, Modification, Tag, Auth) @@ -65,16 +71,9 @@ com.onixbyte.deltaforceguide - **JPA + native queries**: Most CRUD uses Spring Data JPA. Native queries (in `ModificationRepository`) handle JSONB tag filtering with Postgres `@>` operator. - **Custom auth flow**: JWT tokens in httpOnly cookies (`AccessToken`). Spring Security with a custom `UsernamePasswordAuthenticationProvider` and `TokenAuthenticationFilter`. Tokens are auto-renewed within 5 min of expiry. - **JSONB storage**: `Modification.tags` and `Modification.accessories` (including nested `Tuning` objects) are stored as JSONB columns using Hypersistence Utils `JsonType`. -- **Strict layering**: The call chain must follow `Controller → Service → Manager → Repository/Mapper`. Skipping layers (e.g. Controller calling Manager directly, Service calling Repository directly) is not permitted. Each layer has a distinct responsibility: Controller handles HTTP concerns, Service contains business logic, Manager manages `@Transactional` boundaries and data access coordination, Repository/Mapper handles raw data access. +- **Strict layering**: The call chain must follow `Controller → Service → Manager → Repository/Mapper`. Skipping layers (e.g. Controller calling Manager directly, Service calling Repository directly) is not permitted. - **DTOs as Java records**: All request/response objects are immutable records with static `from()` factory methods for entity→DTO conversion. -- **Flyway migrations**: SQL migrations in `src/main/resources/db/migration/` — V2 (init), V3 (bullet/damage fields), V4 (user), V5 (accessories JSONB column). - -### Data model - -- `firearm` table: id, name, type (int→FirearmType enum), level, calibre, fire_rate, armour_damage, body_damage, review -- `modification` table: id, firearm_id (FK→firearm), name, code, tags (jsonb), accessories (jsonb), note, author, video_url -- `app_user` table: id, username, email -- `user_credential` table: user_id, provider, credential (hashed) +- **Flyway migrations**: SQL migrations in `src/main/resources/db/migration/`. ### API endpoints @@ -94,16 +93,61 @@ com.onixbyte.deltaforceguide Conventional commits: `feat:`, `chore:`, `fix:`. Messages are in English, present tense imperative style. -### External dependencies +--- -- **DB**: PostgreSQL (via Flyway migrations), H2 in test -- **Cache**: Redis (via Spring Cache + RedisTemplate with GenericJackson2JsonRedisSerializer) -- **Auth**: java-jwt (auth0), BCrypt -- **Docs**: springdoc-openapi (Swagger UI) on dev profile -- **Onixbyte internal libs**: version-catalogue, tuple, common-toolbox, math-toolbox, identity-generator, captcha, regions -- **AWS**: S3 SDK +## Web -### Profiles +### Commands -- `dev`: Enables Swagger UI, connects to dev DB/Redis at `dfguide.onixbyte.cn`. Config in `config/application-dev.yaml`. -- Default profile: Used for production, no Swagger, connects to production datasource. +```bash +cd web + +pnpm install # Install dependencies (pnpm required) +pnpm dev # Start Vite dev server +pnpm build # TypeScript check + Vite production build +pnpm build:tar # Build + tar.gz archive (used by CI) +pnpm preview # Preview production build locally +pnpm lint # ESLint +``` + +No test suite exists in this project. + +### Architecture + +Chinese-language SPA for browsing and managing Ahsarah Guide (阿萨拉向导). The frontend talks to the Spring Boot backend via REST APIs. + +**App shell** (`src/main.tsx`): React 19 + React Router 7 + Redux Toolkit + Ant Design 6 + Tailwind CSS 4. Wraps the router in Redux `Provider` → `PersistGate` (Redux Persist) → Ant Design `StyleProvider`/`ConfigProvider` (locale `zh_CN`). + +**Routing** (`src/router/index.tsx`): Two layout groups: +- `HeroLayout` (nav header + footer) for `/`, `/firearms`, `/mod-codes` +- `EmptyLayout` (minimal) for `/login` +All page components are lazy-loaded via `createBrowserRouter` + `lazy()`. + +**State** (`src/store/`): Redux Toolkit with two slices — `auth` (current user) and `firearms` (paginated firearm list). State is persisted to `localStorage` or `sessionStorage` based on the `VITE_REDUX_STORAGE` env var. Use typed hooks from `src/hooks/store.ts` (`useAppDispatch`, `useAppSelector`). + +**API layer** (`src/api/`): Axios instance (`src/shared/web-client/`) with base URL from `VITE_API_BASE_URL`, 10s timeout, and credentials. API modules: `FirearmApi`, `ModificationApi`, `TagApi`, `AuthApi`. + +**Pages**: +- `FirearmsPage` — paginated card grid with type filter, create/edit modals (admin-only), delete with popconfirm +- `ModCodesPage` — paginated list with tag multi-select and firearmId query param filter, create/edit modals with nested accessory/tuning form lists +- `LoginPage` — simple username/password form, dispatches `setCurrentUser` on success + +**Shared form components**: `FirearmForm` and `ModificationForm` are reused by both create and edit modals. `ModificationForm` fetches all firearms for its weapon selector and supports a `lockFirearmId` prop that disables the selector (used when navigating from a specific firearm). + +**Type system** (`src/types/`): `Firearm` with weapon stats, `Modification` with nested `Accessory[]` → `Tuning[]`, `Page` for paginated API responses, `User` for auth. + +**Vite config**: Alias `@` → `./src`. Plugins: React, Tailwind CSS 4, port checker. Build uses rolldown with manual chunk splitting for React, Redux, Ant Design, React Router, and rc-* packages. + +**Styling**: Tailwind CSS 4 with CSS layers (`theme, base, antd, components, utilities`). Responsive grid for mod code cards (1→2→3→4 columns). Prettier: 100 print width, no semicolons, double quotes, trailing commas ES5. + +### Environment variables + +``` +VITE_API_BASE_URL=/api # Backend API base URL +VITE_REDUX_STORAGE=local # "local" or "session" for Redux persistence +``` + +### Contributing conventions + +- User-facing copy, documentation, and code comments in British English +- Commit messages use `chore:` prefix for dependency updates (per Dependabot config) diff --git a/README.md b/README.md index 13455ae..c77ae57 100644 --- a/README.md +++ b/README.md @@ -1,150 +1,38 @@ -# Delta Force Guide Server +# Ahsarah Guide (阿萨拉向导) -REST API backend for managing **Delta Force** game firearm builds and modifications. Provides endpoints to browse, create, and share weapon configurations including attachments, tuning setups, tags, and build reviews. +Ahsarah Guide is a full-stack web application for browsing and managing firearm modification guides. +## Monorepo Structure -## Tech Stack - -| Layer | Technology | -|-----------|------------------------------------------------------------| -| Language | Java 21 (Amazon Corretto) | -| Framework | Spring Boot 3.x (Web, Security, Data JPA, Cache, Actuator) | -| Build | Gradle (Kotlin DSL) | -| Database | PostgreSQL (Flyway migrations, JSONB columns) | -| Cache | Redis (2-hour TTL) | -| Auth | Custom JWT via httpOnly cookies + BCrypt | -| API Docs | springdoc-openapi (Swagger UI, dev profile only) | -| Container | Multi-stage Docker image (Amazon Corretto 21 → Alpine) | -| CI/CD | GitHub Actions — builds on release publish | - +| Directory | Stack | Description | +|-----------|-------|-------------| +| `server/` | Java 21 + Spring Boot 3.5 + Gradle | REST API backend | +| `web/` | React 19 + Vite 8 + TypeScript + Ant Design 6 | Web frontend | ## Quick Start -### Prerequisites +### Server -- JDK 21 (Amazon Corretto recommended) -- PostgreSQL -- Redis - -### Configure - -Copy and customise the development config: +Prerequisites: JDK 21 (Amazon Corretto), PostgreSQL, Redis ```bash -cp config/application-prod.yaml.example \ - config/application-dev.yaml -``` - -Fill in your datasource and Redis connection details, then place the production config at `config/`, then enable it by environment variable `SPRING_PROFILES_ACTIVE`. - -### Build - -```bash -# Compile (skip tests) -./gradlew build -x test - -# Run all tests -./gradlew test - -# Build executable JAR +cd server +cp config/application-prod.yaml.example config/application-dev.yaml +# Edit config/application-dev.yaml with your database and Redis credentials ./gradlew bootJar +java -jar build/libs/ahsarah-guide-server-*.jar ``` -### Run +### Web + +Prerequisites: Node.js 20+, pnpm ```bash -SPRING_PROFILES_ACTIVE=prod java -jar build/libs/delta-force-guide-server-$version.jar +cd web +pnpm install +pnpm dev ``` -Swagger UI is available at `http://localhost:8080/swagger-ui.html` when the `dev` profile is active. - -## Data Model - -- **Firearm** — weapon base stats (name, type, level, calibre, fire rate, armour/body damage, review) -- **Modification** — a build attached to a firearm, with name, code, tags (JSONB), accessories including nested tuning objects (JSONB), author notes, and video links -- **App User** — registered user (username, email) with hashed credentials via BCrypt - -Tags and accessories are stored as PostgreSQL JSONB columns using [Hypersistence Utils](https://github.com/vladmihalcea/hypersistence-utils), enabling flexible per-build metadata and filtering with the `@>` operator. - - -## Architecture - -``` -Controller → Service → Manager → Repository / Mapper - (HTTP) (logic) (@Transactional) (data access) -``` - -The call chain is strictly enforced — skipping layers is not permitted. All request/response objects are Java records with static `from()` factory methods for entity-to-DTO conversion. - - -## Docker - -```bash -# Build image -docker pull registry.onixbyte.cn/onixbyte/delta-force-guide-server:latest - -# Run container -docker run -p 8080:8080 \ - -v /path/to/config:/app/config \ - -e SPRING_PROFILES_ACTIVE=$your_active_profiles - delta-force-guide-server -``` - -Pre-built images are published to **Self-hosted GitLab Container Registry** (`registry.onixbyte.cn/onixbyte/delta-force-guide-server`) on every release. - - -## CI/CD - -GitLab CI triggers on **tags**. The pipeline: - -1. Builds the boot JAR with the release tag as the version -2. Uploads the JAR as a release asset -3. Builds and pushes a multi-arch Docker image to GHCR tagged with both `:latest` and `:` - -No tests are run in CI by design — tests are expected to pass locally before a release is cut. - - -## Profiles - -| Profile | Purpose | -|---------|-----------------------------------------------------------------------| -| `dev` | Enables Swagger UI, connects to dev DB/Redis at `dfguide.onixbyte.cn` | -| default | Production mode, no Swagger, uses production datasource | - - -## Project Structure - -``` -src/main/java/com/onixbyte/deltaforceguide/ -├── client/ External service HTTP clients -├── config/ Spring bean definitions (Security, CORS, Cache, Jackson, MyBatis) -├── controller/ REST controllers -├── domain/ -│ ├── converter/ JPA attribute converters -│ ├── dto/ Request/response records -│ └── entity/ JPA entities -├── enumeration/ Enums (FirearmType) -├── exception/ Custom BizException with HTTP status mapping -├── filter/ TokenAuthenticationFilter (JWT through OncePerRequestFilter) -├── manager/ @Transactional wrappers around repositories -├── mapper/ MyBatis mapper interfaces (reserved for future use) -├── properties/ @ConfigurationProperties records -├── repository/ Spring Data JPA repositories -├── security/ -│ ├── authentication/ Custom UsernamePasswordAuthentication -│ └── provider/ UsernamePasswordAuthenticationProvider -├── service/ Business logic -├── shared/ Constants and utility classes -└── utils/ General-purpose helpers -``` - - -## Versioning - -The application exposes its version at `/versions` (GET). - - ## Licence -This project is licensed under the [MIT Licence](LICENCE). Copyright © 2026 OnixByte. - +MIT. See [LICENCE](LICENCE) for details. diff --git a/server/Dockerfile b/server/Dockerfile index 8f5999c..86334a6 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -6,5 +6,5 @@ RUN chmod +x ./gradlew && \ FROM amazoncorretto:21-alpine AS runner WORKDIR /app -COPY --from=builder /app/build/libs/delta-force-guide-server-1.0.0.jar app.jar +COPY --from=builder /app/build/libs/ahsarah-guide-server-*.jar app.jar ENTRYPOINT ["java", "-jar", "app.jar"] diff --git a/server/Dockerfile.ci b/server/Dockerfile.ci index 7925330..521c3e6 100644 --- a/server/Dockerfile.ci +++ b/server/Dockerfile.ci @@ -8,11 +8,11 @@ ARG BUILD_DATE COPY ${JAR_FILE} app.jar -LABEL org.opencontainers.image.title="delta-force-guide-server" \ - org.opencontainers.image.description="REST API backend for managing Delta Force game firearm builds and modifications" \ +LABEL org.opencontainers.image.title="ahsarah-guide-server" \ + org.opencontainers.image.description="REST API backend for Ahsarah Guide" \ org.opencontainers.image.version="${IMAGE_VERSION}" \ org.opencontainers.image.vendor="${IMAGE_VENDOR}" \ - org.opencontainers.image.source="https://git.onixbyte.com/onixbyte/delta-force-guide-server" \ + org.opencontainers.image.source="https://onixbyte.dev/onixbyte/ahsarah-guide" \ org.opencontainers.image.licenses="MIT" \ org.opencontainers.image.created="${BUILD_DATE}" diff --git a/server/build.gradle.kts b/server/build.gradle.kts index a98947a..8e0e7b0 100644 --- a/server/build.gradle.kts +++ b/server/build.gradle.kts @@ -8,7 +8,7 @@ val artefactVersion: String by project val buildChannel: String by project val vendor: String by project -group = "com.onixbyte.helix" +group = "com.onixbyte.ahsarahguide" version = artefactVersion tasks.withType { @@ -24,47 +24,33 @@ java { } dependencies { - implementation(libs.jspecify.core) + // BOMs are imported as platforms, so they cannot be bundled. implementation(platform(libs.aws.sdk.bom)) - implementation(libs.aws.sdk.s3) - implementation(libs.commons.io) - implementation(libs.commons.lang) - implementation(libs.commons.collections) - implementation(libs.hypersistence.core) implementation(platform(libs.onixbyte.versionCatalogue)) - implementation(libs.onixbyte.tuple) - implementation(libs.onixbyte.commonToolbox) - implementation(libs.onixbyte.mathToolbox) - implementation(libs.onixbyte.identityGenerator) - implementation(libs.onixbyte.captcha) - implementation(libs.onixbyte.regions) - implementation(libs.onixbyte.cryptoToolbox) - implementation(libs.jwt.core) + + implementation(libs.bundles.utilities) + implementation(libs.bundles.onixbyte) + implementation(libs.bundles.web) + implementation(libs.bundles.persistence) + implementation(libs.bundles.security) + implementation(libs.bundles.cache) + implementation(libs.bundles.observability) + implementation(libs.bundles.mail) + implementation(libs.bundles.aws) + implementation(libs.bundles.docs) + + // Annotation processor for @ConfigurationProperties; kept out of bundles. implementation(libs.spring.boot.configurationProcessor) - implementation(libs.spring.boot.actuator) - implementation(libs.spring.boot.starter.web) - implementation(libs.spring.boot.starter.webFlux) - implementation(libs.spring.boot.starter.validation) - implementation(libs.spring.boot.starter.redis) - implementation(libs.spring.boot.starter.cache) - implementation(libs.spring.boot.starter.jpa) - implementation(libs.mybatis.starter.core) - implementation(libs.flyway.core) - implementation(libs.flyway.postgresql) - implementation(libs.jackson.jsr310) - implementation(libs.spring.boot.starter.doc) - implementation(libs.spring.boot.starter.security) - testImplementation(libs.spring.boot.starter.test) - testImplementation(libs.reactor.test) - testImplementation(libs.mybatis.starter.test) - testImplementation(libs.spring.security.test) + runtimeOnly(libs.postgres.driver) - testRuntimeOnly(libs.h2.database) - testRuntimeOnly(libs.junit.launcher) + + testImplementation(libs.bundles.testing) + testRuntimeOnly(libs.bundles.testRuntime) } tasks.processResources { filesMatching("application.yaml") { + println("appVersion = ${artefactVersion}, channel = ${buildChannel}, vendor = ${vendor}") expand( "appVersion" to artefactVersion, "channel" to buildChannel, diff --git a/server/config/application-prod.yaml.example b/server/config/application-prod.yaml.example index e68c145..b7455da 100644 --- a/server/config/application-prod.yaml.example +++ b/server/config/application-prod.yaml.example @@ -1,57 +1,131 @@ spring: datasource: + # PostgreSQL connection URL. url: jdbc:postgresql://localhost:5432/dfguide_dev + + # PostgreSQL username. username: postgres + + # PostgreSQL password. password: 123456 + + # PostgreSQL JDBC driver class name. driver-class-name: org.postgresql.Driver data: redis: + # Redis server host. host: localhost + + # Redis server port. port: 6379 + + # Redis database index. + # + # Default to 0. database: 0 - # password: qwerty # Uncomment if password is necessary + + # Redis server password. + # + # Uncomment if the server requires a password. + # + # password: qwerty logging: pattern: - # dateformat: dd MMM yyyy HH:mm:ss.SSS # Modify this for custom date format. + # Date format used in log output. Uncomment to use a custom format. + # + # Default to the date format provided by Spring Boot. + # dateformat: dd MMM yyyy HH:mm:ss.SSS app: cookie: + # Whether the cookie is accessible from JavaScript. Keep `true` to mitigate XSS attacks. http-only: true - secure: false + + # Whether the cookie is only sent over HTTPS. Set to `true` in production is recommended. + secure: true + + # SameSite policy of the cookie. + # + # NOTE that `none` requires `secure` to be `true`. same-site: none + + # Cookie path. path: '/' + + # Cookie max age. max-age: P1D cors: - allowed-origins: # Cross-origin allowed origins - - "http://localhost:5173" # Dev server for vite. - - "http://localhost:4173" # Preview server for vite. - allow-credentials: true # Must be set to `true` since we are using cookie. You can change it only when you have modified how this application executing authentication. + # Cross-origin allowed origins. Add your custom origins here. + allowed-origins: [] + + # Whether to allow credentials (cookies, authorisation headers) in cross-origin requests. + # + # Must be `true` since the application uses cookies for authentication. Change it only when + # the authentication mechanism no longer relies on cookies. + allow-credentials: true + + # Whether to allow requests originating from private network addresses. allow-private-network: false + + # Headers allowed in cross-origin requests. allowed-headers: - "Content-Type" - "Authorization" + + # HTTP methods allowed in cross-origin requests. + # + # Methods are matched against Spring's HttpMethod, so they must be written in UPPER CASE. + # e.g., GET, POST, PUT, PATCH, DELETE, OPTIONS allowed-methods: - GET - POST - PUT - PATCH - DELETE + + # Response headers exposed to the browser in cross-origin responses. exposed-headers: - "Content-Type" - "Authorization" + + # How long the CORS pre-flight response may be cached by the browser. + # + # Default to PT2H (2 hours). max-age: PT2H jwt: - issuer: dfguide.local # Issuer host - secret: qwertyuiopasdfghjklzxcvbnm123456 # JWT singing secret, a 32-byte long or longer string is recommended - valid-time: PT2H # JWT valid duration + # Issuer identifier, domain name is recommended. + issuer: ahsarah-guide.local + + # Token signing secret, a 32-byte long or longer string is recommended. + secret: qwertyuiopasdfghjklzxcvbnm123456 + + # Token valid duration. + # + # Default to PT2H (2 hours). + valid-time: PT2H + + # Token renew threshold. + # + # If valid time of this token is less than this value, then a new token will be delivered to + # the user. + # + # Default to PT5M (5 min). + renew-threshold: PT5M webhook: github: + # GitHub webhook secret. Used to verify the signature of incoming webhook requests. secret: 123456 - allowed-users: [ octotcat, onixbyte ] + + # GitHub usernames allowed to trigger webhook events. + allowed-users: [ octocat, onixbyte ] springdoc: api-docs: - enabled: true # Set to `false` if you do not need api docs (recommended in production mode). + # Whether to expose the OpenAPI documentation. Set to `false` if you do not need it + # (recommended in production mode). + enabled: true swagger-ui: - enabled: true # Set to `false` if you do not need swagger ui (recommended in production mode). \ No newline at end of file + # Whether to expose the Swagger UI. Set to `false` if you do not need it + # (recommended in production mode). + enabled: true diff --git a/server/gradle/libs.versions.toml b/server/gradle/libs.versions.toml index d9650f6..a9ff6c6 100644 --- a/server/gradle/libs.versions.toml +++ b/server/gradle/libs.versions.toml @@ -59,6 +59,11 @@ spring-boot-actuator = { group = "org.springframework.boot", name = "spring-boot spring-boot-starter-security = { group = "org.springframework.boot", name = "spring-boot-starter-security" } jwt-core = { group = "com.auth0", name = "java-jwt", version.ref = "javaJwtVersion" } +# Java Mail & Templating +spring-boot-starter-mail = { module = "org.springframework.boot:spring-boot-starter-mail" } +spring-boot-starter-thymeleaf = { group = "org.springframework.boot", name = "spring-boot-starter-thymeleaf" } +thymeleaf-extras-springsecurity6 = { group = "org.thymeleaf.extras", name = "thymeleaf-extras-springsecurity6" } + # Spring Doc spring-boot-starter-doc = { group = "org.springdoc", name = "springdoc-openapi-starter-webmvc-ui", version.ref = "springDocVersion" } @@ -73,6 +78,89 @@ reactor-test = { group = "io.projectreactor", name = "reactor-test", version.ref junit-launcher = { group = "org.junit.platform", name = "junit-platform-launcher", version.ref = "junitPlatformVersion" } mybatis-starter-test = { group = "org.mybatis.spring.boot", name = "mybatis-spring-boot-starter-test", version.ref = "mybatisVersion" } +[bundles] +# General utilities +utilities = [ + "jspecify-core", + "commons-io", + "commons-lang", + "commons-collections", + "jackson-jsr310", +] + +# Onixbyte ecosystem (the version-catalogue BOM stays out of bundles, it is imported as a platform) +onixbyte = [ + "onixbyte-tuple", + "onixbyte-commonToolbox", + "onixbyte-cryptoToolbox", + "onixbyte-mathToolbox", + "onixbyte-identityGenerator", + "onixbyte-captcha", + "onixbyte-regions", +] + +# Web layer +web = [ + "spring-boot-starter-web", + "spring-boot-starter-webFlux", + "spring-boot-starter-validation", +] + +# Persistence and database +persistence = [ + "spring-boot-starter-jpa", + "mybatis-starter-core", + "hypersistence-core", + "flyway-core", + "flyway-postgresql", +] + +# Security and authentication +security = [ + "spring-boot-starter-security", + "jwt-core", +] + +# Caching (Redis) +cache = [ + "spring-boot-starter-redis", + "spring-boot-starter-cache", +] + +# Observability +observability = [ + "spring-boot-actuator", +] + +# Mail and templating +mail = [ + "spring-boot-starter-mail", + "spring-boot-starter-thymeleaf", + "thymeleaf-extras-springsecurity6", +] + +# AWS cloud services +aws = [ + "aws-sdk-s3", +] + +# API documentation +docs = [ + "spring-boot-starter-doc", +] + +# Testing +testing = [ + "spring-boot-starter-test", + "spring-security-test", + "reactor-test", + "mybatis-starter-test", +] +testRuntime = [ + "h2-database", + "junit-launcher", +] + [plugins] spring-boot = { id = "org.springframework.boot", version.ref = "springBootVersion" } spring-dependency-management = { id = "io.spring.dependency-management", version.ref = "springDependencyManagementVersion" } diff --git a/server/settings.gradle.kts b/server/settings.gradle.kts index 2b10ea5..1ca35a5 100644 --- a/server/settings.gradle.kts +++ b/server/settings.gradle.kts @@ -11,4 +11,4 @@ dependencyResolutionManagement { } } -rootProject.name = "delta-force-guide-server" +rootProject.name = "ahsarah-guide-server" diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/AhsarahGuideApplication.java b/server/src/main/java/com/onixbyte/ahsarahguide/AhsarahGuideApplication.java new file mode 100644 index 0000000..dbfedf4 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/AhsarahGuideApplication.java @@ -0,0 +1,20 @@ +package com.onixbyte.ahsarahguide; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableAsync; + +/** + * Entry point for the Ahsarah Guide Server application. + * + * @author zihluwang + */ +@EnableAsync +@SpringBootApplication +public class AhsarahGuideApplication { + + public static void main(String[] args) { + SpringApplication.run(AhsarahGuideApplication.class, args); + } + +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/client/EmailClient.java b/server/src/main/java/com/onixbyte/ahsarahguide/client/EmailClient.java new file mode 100644 index 0000000..c5f3a2c --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/client/EmailClient.java @@ -0,0 +1,109 @@ +package com.onixbyte.ahsarahguide.client; + +import jakarta.mail.MessagingException; +import jakarta.mail.internet.InternetAddress; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.mail.javamail.JavaMailSender; +import org.springframework.mail.javamail.MimeMessageHelper; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; +import org.thymeleaf.TemplateEngine; +import org.thymeleaf.context.Context; + +import java.io.UnsupportedEncodingException; +import java.nio.charset.StandardCharsets; +import java.util.Map; + +@Component +public class EmailClient { + + private static final Logger log = LoggerFactory.getLogger(EmailClient.class); + + private final JavaMailSender mailSender; + + private final TemplateEngine emailTemplateEngine; + + @Autowired + public EmailClient( + JavaMailSender mailSender, + TemplateEngine emailTemplateEngine + ) { + this.mailSender = mailSender; + this.emailTemplateEngine = emailTemplateEngine; + } + + private String fromAddress; + + @Autowired + public void setFromAddress(@Value("${spring.mail.username}") String fromAddress) { + this.fromAddress = fromAddress; + } + + /** + * Send a template-based HTML email asynchronously. + * + * @param toRecipient recipient email address + * @param subject subject line + * @param templateName template name (without .html extension, under mail-templates/) + * @param variables context variables required by the template + */ + @Async + public void sendTemplateMail(String toRecipient, String subject, String templateName, Map variables) { + try { + // Render HTML content using the dedicated email template engine + var context = new Context(); + if (variables != null && !variables.isEmpty()) { + context.setVariables(variables); + } + var htmlBody = emailTemplateEngine.process(templateName, context); + + log.debug("htmlBody={}", htmlBody); + + // Build the MIME message + var message = mailSender.createMimeMessage(); + var helper = new MimeMessageHelper( + message, + MimeMessageHelper.MULTIPART_MODE_MIXED_RELATED, + StandardCharsets.UTF_8.name() + ); + + helper.setFrom(new InternetAddress(fromAddress, "阿萨拉向导", StandardCharsets.UTF_8.name())); + helper.setTo(toRecipient); + helper.setSubject(subject); + helper.setText(htmlBody, true); + + // Dispatch the message + mailSender.send(message); + log.info("Successfully dispatched email to: [{}] with subject: [{}]", toRecipient, subject); + + } catch (MessagingException | UnsupportedEncodingException ex) { + log.error("Failed to construct or send email to: [{}], subject: [{}]", toRecipient, subject, ex); + // Handle or rethrow custom business exception if required + } catch (Exception ex) { + log.error("Unexpected error occurred while processing email for: [{}]", toRecipient, ex); + } + } + + /** + * Convenience method specifically for sending registration/login verification codes. + * + * @param toRecipient target recipient email + * @param username display username + * @param code verification code string + * @param expireMinutes expiration time in minutes + */ + @Async + public void sendVerificationCode(String toRecipient, String username, String code, int expireMinutes) { + var subject = "【阿萨拉向导】账号注册验证码"; + var variables = Map.of( + "username", username, + "code", code, + "expireMinutes", expireMinutes + ); + + sendTemplateMail(toRecipient, subject, "verification-code", variables); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/client/TokenClient.java b/server/src/main/java/com/onixbyte/ahsarahguide/client/TokenClient.java new file mode 100644 index 0000000..5a0c1ad --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/client/TokenClient.java @@ -0,0 +1,75 @@ +package com.onixbyte.ahsarahguide.client; + +import com.auth0.jwt.JWT; +import com.auth0.jwt.JWTVerifier; +import com.auth0.jwt.algorithms.Algorithm; +import com.auth0.jwt.interfaces.DecodedJWT; +import com.onixbyte.ahsarahguide.domain.entity.User; +import com.onixbyte.ahsarahguide.properties.TokenProperties; +import com.onixbyte.ahsarahguide.utils.DateTimeUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; + +/** + * Client for generating and verifying JSON Web Tokens using the Auth0 java-jwt library. + * + * @author zihluwang + */ +@Component +public class TokenClient { + + private final Algorithm algorithm; + private final TokenProperties tokenProperties; + private final JWTVerifier verifier; + + /** + * Constructs a new TokenClient with the necessary algorithm and token properties. + * + * @param algorithm the signing algorithm used to secure the JWT + * @param tokenProperties the configuration properties for the token, such as issuer and + * validity period + */ + @Autowired + public TokenClient( + Algorithm algorithm, + TokenProperties tokenProperties, + JWTVerifier verifier + ) { + this.algorithm = algorithm; + this.tokenProperties = tokenProperties; + this.verifier = verifier; + } + + /** + * Generate a JSON Web Token to the current user. + * + * @param user the current user for whom the token is being generated + * @return a JWT string + */ + public String generateToken(User user) { + var issuedAt = LocalDateTime.now(); + var expiresAt = issuedAt.plus(tokenProperties.validTime()); + + return JWT.create() + .withSubject(user.getUsername()) + .withIssuer(tokenProperties.issuer()) + .withIssuedAt(DateTimeUtil.asInstant(issuedAt)) + .withExpiresAt(DateTimeUtil.asInstant(expiresAt)) + .sign(algorithm); + } + + /** + * Verify and decode token. + * + * @param token a JWT token + * @return information included in the given token + * @throws com.auth0.jwt.exceptions.JWTVerificationException if the token is invalid, such as + * expired, or not signed by + * specific server + */ + public DecodedJWT verifyToken(String token) { + return verifier.verify(token); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/config/AppConfig.java b/server/src/main/java/com/onixbyte/ahsarahguide/config/AppConfig.java new file mode 100644 index 0000000..7246ebe --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/config/AppConfig.java @@ -0,0 +1,48 @@ +package com.onixbyte.ahsarahguide.config; + +import com.onixbyte.ahsarahguide.interceptor.GitHubWebhookInterceptor; +import com.onixbyte.ahsarahguide.interceptor.TrafficInterceptor; +import com.onixbyte.ahsarahguide.properties.AppProperties; +import com.onixbyte.ahsarahguide.security.resolver.CurrentUserArgumentResolver; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.method.support.HandlerMethodArgumentResolver; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import java.util.List; + +@Configuration +@EnableConfigurationProperties(AppProperties.class) +public class AppConfig implements WebMvcConfigurer { + + private final TrafficInterceptor trafficInterceptor; + + private final GitHubWebhookInterceptor gitHubWebhookInterceptor; + + private final CurrentUserArgumentResolver currentUserArgumentResolver; + + @Autowired + public AppConfig( + TrafficInterceptor trafficInterceptor, + GitHubWebhookInterceptor gitHubWebhookInterceptor, + CurrentUserArgumentResolver currentUserArgumentResolver + ) { + this.trafficInterceptor = trafficInterceptor; + this.gitHubWebhookInterceptor = gitHubWebhookInterceptor; + this.currentUserArgumentResolver = currentUserArgumentResolver; + } + + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(trafficInterceptor); + registry.addInterceptor(gitHubWebhookInterceptor) + .addPathPatterns("/webhooks/github"); + } + + @Override + public void addArgumentResolvers(List resolvers) { + resolvers.add(currentUserArgumentResolver); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/config/CacheConfig.java b/server/src/main/java/com/onixbyte/ahsarahguide/config/CacheConfig.java new file mode 100644 index 0000000..1b43650 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/config/CacheConfig.java @@ -0,0 +1,102 @@ +package com.onixbyte.ahsarahguide.config; + +import com.onixbyte.ahsarahguide.shared.JacksonRedisSerialiser; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.cache.RedisCacheConfiguration; +import org.springframework.data.redis.cache.RedisCacheManager; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; +import org.springframework.data.redis.serializer.RedisSerializationContext; +import org.springframework.data.redis.serializer.RedisSerializer; + +import java.time.Duration; + +/** + * Configuration class for Redis-based caching components. + *

+ * This configuration class provides beans for Redis cache management and template operations + * within the Helix application. It configures custom serialisation strategies using + * {@link GenericJackson2JsonRedisSerializer} for values and string serialisation for keys, + * ensuring optimal performance and compatibility with JSON-based data structures. + *

+ * The configuration includes: + *

    + *
  • Custom {@link RedisCacheManager} with JSON serialisation support
  • + *
  • Configured {@link RedisTemplate} for direct Redis operations
  • + *
+ * + * @author zihluwang + * @see RedisCacheManager + * @see RedisTemplate + * @see GenericJackson2JsonRedisSerializer + * @since 1.0.0 + */ +@Configuration +@EnableCaching +public class CacheConfig { + + /** + * Creates a custom Redis cache manager with JSON serialisation support. + *

+ * This method configures a {@link RedisCacheManager} that uses string serialisation for cache + * keys and {@link GenericJackson2JsonRedisSerializer} for cache values. This setup ensures that + * complex objects can be stored and retrieved from Redis cache whilst maintaining readability + * and compatibility with JSON-based systems. + * + * @param connectionFactory the Redis connection factory used to establish connections + * @return a configured {@link RedisCacheManager} with custom serialisation settings + * @see RedisCacheManager + * @see GenericJackson2JsonRedisSerializer + * @see RedisSerializationContext + */ + @Bean + public RedisCacheManager cacheManager( + RedisConnectionFactory connectionFactory + ) { + var _keySerializer = RedisSerializer.string(); + + var cacheConfiguration = RedisCacheConfiguration.defaultCacheConfig() + .serializeKeysWith(RedisSerializationContext.SerializationPair + .fromSerializer(_keySerializer)) + .serializeValuesWith(RedisSerializationContext.SerializationPair + .fromSerializer(JacksonRedisSerialiser.INSTANCE)) + .entryTtl(Duration.ofMinutes(90L)); + + return RedisCacheManager.RedisCacheManagerBuilder + .fromConnectionFactory(connectionFactory) + .cacheDefaults(cacheConfiguration) + .build(); + } + + /** + * Creates a Redis template for direct Redis operations with custom serialisation. + *

+ * This method configures a {@link RedisTemplate} that uses string serialisation for keys + * and {@link GenericJackson2JsonRedisSerializer} for values. This template provides low-level + * access to Redis operations whilst ensuring consistent serialisation strategies across + * the application. + *

+ * The template is fully configured and ready for use after bean creation. + * + * @param connectionFactory the Redis connection factory used to establish connections + * @return a fully configured {@link RedisTemplate} for Redis operations + * @see RedisTemplate + * @see GenericJackson2JsonRedisSerializer + * @see RedisSerializer + */ + @Bean + public RedisTemplate redisTemplate( + RedisConnectionFactory connectionFactory + ) { + var redisTemplate = new RedisTemplate(); + redisTemplate.setConnectionFactory(connectionFactory); + redisTemplate.setKeySerializer(RedisSerializer.string()); + redisTemplate.setValueSerializer(JacksonRedisSerialiser.INSTANCE); + redisTemplate.afterPropertiesSet(); + return redisTemplate; + } +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/config/CorsConfig.java b/server/src/main/java/com/onixbyte/ahsarahguide/config/CorsConfig.java new file mode 100644 index 0000000..0a8e2c9 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/config/CorsConfig.java @@ -0,0 +1,49 @@ +package com.onixbyte.ahsarahguide.config; + +import com.onixbyte.ahsarahguide.properties.CorsProperties; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpMethod; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.CorsConfigurationSource; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; + +import java.util.List; +import java.util.stream.Stream; + +/** + * Configuration for CORS (Cross-Origin Resource Sharing) policies. + * + * @author zihluwang + */ +@Configuration +@EnableConfigurationProperties({CorsProperties.class}) +public class CorsConfig { + + /** + * Creates the CORS configuration source with properties from configuration. + * + * @param properties the CORS configuration properties + * @return the CORS configuration source + */ + @Bean + public CorsConfigurationSource corsConfigurationSource( + CorsProperties properties + ) { + var corsConfiguration = new CorsConfiguration(); + corsConfiguration.setAllowCredentials(properties.allowCredentials()); + corsConfiguration.setAllowedOrigins(List.of(properties.allowedOrigins())); + corsConfiguration.setAllowedHeaders(List.of(properties.allowedHeaders())); + corsConfiguration.setAllowedMethods(Stream.of(properties.allowedMethods()) + .map(HttpMethod::name) + .toList()); + corsConfiguration.setMaxAge(properties.maxAge()); + corsConfiguration.setAllowPrivateNetwork(properties.allowPrivateNetwork()); + corsConfiguration.setExposedHeaders(List.of(properties.exposedHeaders())); + + var corsConfigurationSource = new UrlBasedCorsConfigurationSource(); + corsConfigurationSource.registerCorsConfiguration("/**", corsConfiguration); + return corsConfigurationSource; + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/config/EmailTemplateConfig.java b/server/src/main/java/com/onixbyte/ahsarahguide/config/EmailTemplateConfig.java new file mode 100644 index 0000000..825bd95 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/config/EmailTemplateConfig.java @@ -0,0 +1,37 @@ +package com.onixbyte.ahsarahguide.config; + +import com.onixbyte.captcha.text.TextProducer; +import com.onixbyte.captcha.text.impl.DefaultTextProducer; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.thymeleaf.TemplateEngine; +import org.thymeleaf.spring6.SpringTemplateEngine; +import org.thymeleaf.templatemode.TemplateMode; +import org.thymeleaf.templateresolver.ClassLoaderTemplateResolver; +import org.thymeleaf.templateresolver.ITemplateResolver; + +import java.nio.charset.StandardCharsets; + +@Configuration +public class EmailTemplateConfig { + + @Bean + public TemplateEngine emailTemplateEngine() { + var resolver = new ClassLoaderTemplateResolver(); + // Template files are located under src/main/resources/mail-templates/ + resolver.setPrefix("mail-templates/"); + resolver.setSuffix(".html"); + resolver.setTemplateMode(TemplateMode.HTML); + resolver.setCharacterEncoding(StandardCharsets.UTF_8.name()); + resolver.setCacheable(true); // Enable caching for the production environment + + var templateEngine = new SpringTemplateEngine(); + templateEngine.addTemplateResolver(resolver); + return templateEngine; + } + + @Bean + public TextProducer textProducer() { + return DefaultTextProducer.builder().build(); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/config/FilterConfig.java b/server/src/main/java/com/onixbyte/ahsarahguide/config/FilterConfig.java new file mode 100644 index 0000000..1df3265 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/config/FilterConfig.java @@ -0,0 +1,21 @@ +package com.onixbyte.ahsarahguide.config; + +import com.onixbyte.ahsarahguide.filter.WebhookFilter; +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class FilterConfig { + + @Bean + public FilterRegistrationBean webhookFilterBean(WebhookFilter webhookFilter) { + var registrationBean = new FilterRegistrationBean(); + + registrationBean.setFilter(webhookFilter); + registrationBean.addUrlPatterns("/webhooks/*"); + registrationBean.setOrder(1); + + return registrationBean; + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/config/JacksonConfig.java b/server/src/main/java/com/onixbyte/ahsarahguide/config/JacksonConfig.java new file mode 100644 index 0000000..9aff99b --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/config/JacksonConfig.java @@ -0,0 +1,25 @@ +package com.onixbyte.ahsarahguide.config; + +import com.fasterxml.jackson.databind.SerializationFeature; +import com.onixbyte.ahsarahguide.shared.JacksonModules; +import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Configuration for Jackson JSON serialisation and deserialisation settings. + * + * @author zihluwang + */ +@Configuration +public class JacksonConfig { + + @Bean + public Jackson2ObjectMapperBuilderCustomizer jacksonCustomiser() { + return (builder) -> { + builder.modules(JacksonModules.DATE_TIME_MODULE); + builder.featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + }; + } +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/config/MyBatisConfig.java b/server/src/main/java/com/onixbyte/ahsarahguide/config/MyBatisConfig.java new file mode 100644 index 0000000..66ff677 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/config/MyBatisConfig.java @@ -0,0 +1,15 @@ +package com.onixbyte.ahsarahguide.config; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.context.annotation.Configuration; + +/** + * Configuration for MyBatis SQL mapping framework integration. + * + * @author zihluwang + */ +@Configuration +@MapperScan(basePackages = {"com.onixbyte.ahsarahguide.mapper"}) +public class MyBatisConfig { +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/config/OpenApiConfiguration.java b/server/src/main/java/com/onixbyte/ahsarahguide/config/OpenApiConfiguration.java new file mode 100644 index 0000000..e937cad --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/config/OpenApiConfiguration.java @@ -0,0 +1,26 @@ +package com.onixbyte.ahsarahguide.config; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.info.Contact; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.info.License; +import org.springframework.context.annotation.Configuration; + +@OpenAPIDefinition( + info = @Info( + title = "Ahsarah Guide Server", + description = "API for Ahsarah Guide", + version = "1.4.0", + contact = @Contact( + name = "Zihlu Wang", + email = "zihlu.wang@onixbyte.com" + ), + license = @License( + name = "MIT", + url = "https://onixbyte.dev/onixbyte/ahsarah-guide/raw/branch/main/LICENCE" + ) + ) +) +@Configuration +public class OpenApiConfiguration { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/config/SecurityConfig.java b/server/src/main/java/com/onixbyte/ahsarahguide/config/SecurityConfig.java new file mode 100644 index 0000000..6ad1b72 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/config/SecurityConfig.java @@ -0,0 +1,113 @@ +package com.onixbyte.ahsarahguide.config; + +import com.auth0.jwt.JWT; +import com.auth0.jwt.JWTVerifier; +import com.auth0.jwt.algorithms.Algorithm; +import com.onixbyte.ahsarahguide.exeption.ForbiddenException; +import com.onixbyte.ahsarahguide.exeption.UnauthorisedException; +import com.onixbyte.ahsarahguide.filter.TokenAuthenticationFilter; +import com.onixbyte.ahsarahguide.properties.CookieProperties; +import com.onixbyte.ahsarahguide.properties.TokenProperties; +import com.onixbyte.ahsarahguide.security.provider.UsernamePasswordAuthenticationProvider; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.ProviderManager; +import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.security.web.SecurityFilterChain; +import org.springframework.security.web.access.ExceptionTranslationFilter; +import org.springframework.web.cors.CorsConfigurationSource; + +/** + * Spring Security configuration defining authentication, authorisation, and filter chains. + * + * @author zihluwang + */ +@Configuration +@EnableWebSecurity +@EnableMethodSecurity +@EnableConfigurationProperties({TokenProperties.class, CookieProperties.class}) +public class SecurityConfig { + + private static final Logger log = LoggerFactory.getLogger(SecurityConfig.class); + + /** + * Configures the HTTP security filter chain including endpoint authorisation and JWT filter. + * + * @param httpSecurity the HTTP security builder + * @return the configured security filter chain + */ + @Bean + public SecurityFilterChain securityFilterChain( + HttpSecurity httpSecurity, + CorsConfigurationSource corsConfigurationSource, + TokenAuthenticationFilter tokenAuthenticationFilter + ) throws Exception { + return httpSecurity + .cors((cors) -> cors + .configurationSource(corsConfigurationSource)) + .csrf(AbstractHttpConfigurer::disable) + .sessionManagement((customiser) -> customiser + .sessionCreationPolicy(SessionCreationPolicy.STATELESS)) + .authorizeHttpRequests((customiser) -> customiser + .anyRequest().permitAll() + ) + .exceptionHandling(customiser -> customiser + .authenticationEntryPoint((request, response, authException) -> { + log.error("Unauthenticated request: {}", request, authException); + throw new UnauthorisedException("请先登录"); + }) + .accessDeniedHandler((request, response, accessDeniedException) -> { + log.error("Denied request: {}", request, accessDeniedException); + throw new ForbiddenException("权限不足"); + }) + ) + .addFilterAfter(tokenAuthenticationFilter, ExceptionTranslationFilter.class) + .build(); + } + + /** + * Provides the BCrypt password encoder for credential hashing. + * + * @return the BCrypt password encoder + */ + @Bean + public PasswordEncoder passwordEncoder() { + return new BCryptPasswordEncoder(); + } + + /** + * Provides the authentication manager for the security configuration. + * + * @return the authentication manager + */ + @Bean + public AuthenticationManager authenticationManager( + UsernamePasswordAuthenticationProvider usernamePasswordAuthenticationProvider + ) { + return new ProviderManager( + usernamePasswordAuthenticationProvider + ); + } + + @Bean + public Algorithm algorithm(TokenProperties properties) { + return Algorithm.HMAC256(properties.secret()); + } + + @Bean + public JWTVerifier verifier(Algorithm algorithm, TokenProperties tokenProperties) { + return JWT.require(algorithm) + .withIssuer(tokenProperties.issuer()) + .build(); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/config/SpringDataConfig.java b/server/src/main/java/com/onixbyte/ahsarahguide/config/SpringDataConfig.java new file mode 100644 index 0000000..2970777 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/config/SpringDataConfig.java @@ -0,0 +1,15 @@ +package com.onixbyte.ahsarahguide.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; + +/** + * Configuration for Spring Data JPA auditing and repository settings. + * + * @author zihluwang + */ +@Configuration +@EnableJpaRepositories(basePackages = {"com.onixbyte.ahsarahguide.repository"}) +public class SpringDataConfig { +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/config/WebhookConfig.java b/server/src/main/java/com/onixbyte/ahsarahguide/config/WebhookConfig.java new file mode 100644 index 0000000..6d32478 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/config/WebhookConfig.java @@ -0,0 +1,10 @@ +package com.onixbyte.ahsarahguide.config; + +import com.onixbyte.ahsarahguide.properties.GitHubWebhookProperties; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +@Configuration +@EnableConfigurationProperties({GitHubWebhookProperties.class}) +public class WebhookConfig { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/controller/AdminController.java b/server/src/main/java/com/onixbyte/ahsarahguide/controller/AdminController.java new file mode 100644 index 0000000..693b315 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/controller/AdminController.java @@ -0,0 +1,59 @@ +package com.onixbyte.ahsarahguide.controller; + +import com.onixbyte.ahsarahguide.domain.dto.ManageRoleRequest; +import com.onixbyte.ahsarahguide.security.annotation.RequiresAuth; +import com.onixbyte.ahsarahguide.service.UserService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Positive; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * REST controller for administrative user and role management. + * + * @author zihluwang + */ +@Tag(name = "管理员", description = "管理员用户与角色管理") +@RestController +@RequestMapping("/admin") +@Validated +@RequiresAuth +public class AdminController { + + private final UserService userService; + + public AdminController(UserService userService) { + this.userService = userService; + } + + @Operation(description = "为用户分配角色(仅超级管理员可操作)") + @PreAuthorize("hasRole('SUPER_USER')") + @PutMapping("/users/{id}/roles") + public ResponseEntity assignRole( + @PathVariable @Positive(message = "用户ID必须为正数") Long id, + @Valid @RequestBody ManageRoleRequest request + ) { + userService.assignRole(id, request.role()); + return ResponseEntity.noContent().build(); + } + + @Operation(description = "移除用户角色(仅超级管理员可操作)") + @PreAuthorize("hasRole('SUPER_USER')") + @DeleteMapping("/users/{id}/roles/{role}") + public ResponseEntity removeRole( + @PathVariable @Positive(message = "用户ID必须为正数") Long id, + @PathVariable String role + ) { + userService.removeRole(id, role); + return ResponseEntity.noContent().build(); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/controller/AuthController.java b/server/src/main/java/com/onixbyte/ahsarahguide/controller/AuthController.java new file mode 100644 index 0000000..4d083da --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/controller/AuthController.java @@ -0,0 +1,62 @@ +package com.onixbyte.ahsarahguide.controller; + +import com.onixbyte.ahsarahguide.domain.dto.*; +import com.onixbyte.ahsarahguide.security.annotation.RequiresAuth; +import com.onixbyte.ahsarahguide.service.AuthService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpHeaders; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * REST controller for user authentication endpoints (login, logout). + * + * @author zihluwang + */ +@Tag(name = "用户鉴权", description = "处理用户登录与退出功能") +@RestController +@RequestMapping("/auth") +public class AuthController { + + private final AuthService authService; + + public AuthController(AuthService authService) { + this.authService = authService; + } + + @Operation(description = "用户登录") + @PostMapping("/login") + public ResponseEntity login(@Validated @RequestBody LoginRequest request) { + var user = authService.login(request); + return authService.getUserResponseResponseEntity(user); + } + + @RequiresAuth + @Operation(description = "退出登录") + @PostMapping("/logout") + public ResponseEntity logout() { + var expiredCookie = authService.logout(); + return ResponseEntity.noContent() + .header(HttpHeaders.SET_COOKIE, expiredCookie.toString()) + .build(); + } + + @Operation(description = "发送邮件验证码") + @PostMapping("/verification-code") + public SendVerificationCodeResponse sendVerificationCode(@Validated @RequestBody SendVerificationCodeRequest request) { + var verificationCodeId = authService.sendVerificationCode(request); + return new SendVerificationCodeResponse(verificationCodeId); + } + + @Operation(description = "用户注册") + @PostMapping("/register") + public ResponseEntity register(@Validated @RequestBody RegisterRequest request) { + var user = authService.register(request); + return authService.getUserResponseResponseEntity(user); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/controller/DailyPasswordController.java b/server/src/main/java/com/onixbyte/ahsarahguide/controller/DailyPasswordController.java new file mode 100644 index 0000000..8e4a6df --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/controller/DailyPasswordController.java @@ -0,0 +1,32 @@ +package com.onixbyte.ahsarahguide.controller; + +import com.onixbyte.ahsarahguide.domain.dto.DailyPasswordResponse; +import com.onixbyte.ahsarahguide.service.DailyPasswordService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * REST controller for retrieving daily-generated passwords. + * + * @author zihluwang + */ +@Tag(name = "每日密码", description = "获取每日密码信息") +@RestController +@RequestMapping("/daily-passwords") +public class DailyPasswordController { + + private final DailyPasswordService dailyPasswordService; + + public DailyPasswordController(DailyPasswordService dailyPasswordService) { + this.dailyPasswordService = dailyPasswordService; + } + + @Operation(description = "获取当日的每日密码数据,该数据将被缓存一天") + @GetMapping + public DailyPasswordResponse getDailyPassword() { + return dailyPasswordService.getDailyPassword(); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/controller/FirearmController.java b/server/src/main/java/com/onixbyte/ahsarahguide/controller/FirearmController.java new file mode 100644 index 0000000..2d0cadb --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/controller/FirearmController.java @@ -0,0 +1,72 @@ +package com.onixbyte.ahsarahguide.controller; + +import com.onixbyte.ahsarahguide.domain.dto.FirearmRequest; +import com.onixbyte.ahsarahguide.domain.dto.FirearmResponse; +import com.onixbyte.ahsarahguide.domain.dto.PageResponse; +import com.onixbyte.ahsarahguide.enumeration.FirearmType; +import com.onixbyte.ahsarahguide.security.annotation.RequiresAuth; +import com.onixbyte.ahsarahguide.service.FirearmService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * REST controller for firearm CRUD operations. + * + * @author zihluwang + */ +@Tag(name = "武器管理", description = "与武器有关的操作") +@RestController +@RequestMapping("/firearms") +public class FirearmController { + + private final FirearmService firearmService; + + public FirearmController(FirearmService firearmService) { + this.firearmService = firearmService; + } + + @Operation(description = "获取分页武器数据") + @Validated + @GetMapping + public PageResponse pageQuery( + @RequestParam(defaultValue = "0") @Min(0) int page, + @RequestParam(defaultValue = "20") @Min(1) @Max(100) int size, + @RequestParam(defaultValue = "id") String sortBy, + @RequestParam(defaultValue = "DESC") Sort.Direction direction, + @RequestParam(required = false) FirearmType type + ) { + return firearmService.pageQuery(type, PageRequest.of(page, size, Sort.by(direction, sortBy))); + } + + @Operation(description = "获取指定武器的数据") + @GetMapping("/{id}") + public FirearmResponse queryById(@PathVariable Long id) { + return firearmService.queryById(id); + } + + @RequiresAuth + @PostMapping + public FirearmResponse addFirearm(@Validated @RequestBody FirearmRequest request) { + return firearmService.addFirearm(request); + } + + @RequiresAuth + @Operation(description = "更新指定武器的数据") + @PutMapping("/{id}") + public FirearmResponse updateFirearm(@PathVariable Long id, @Validated @RequestBody FirearmRequest request) { + return firearmService.updateFirearm(id, request); + } + + @RequiresAuth + @Operation(description = "删除指定武器的数据") + @DeleteMapping("/{id}") + public void deleteFirearm(@PathVariable Long id) { + firearmService.deleteFirearm(id); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/controller/GlobalExceptionHandler.java b/server/src/main/java/com/onixbyte/ahsarahguide/controller/GlobalExceptionHandler.java new file mode 100644 index 0000000..882437d --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/controller/GlobalExceptionHandler.java @@ -0,0 +1,44 @@ +package com.onixbyte.ahsarahguide.controller; + +import com.onixbyte.ahsarahguide.domain.dto.ErrorResponse; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.server.ResponseStatusException; + +/** + * Global exception handler that translates exceptions into standard error responses. + * + * @author zihluwang + */ +@RestControllerAdvice +public class GlobalExceptionHandler { + @ExceptionHandler(ResponseStatusException.class) + public ResponseEntity handleResponseStatusException(ResponseStatusException exception) { + var status = exception.getStatusCode(); + return ResponseEntity.status(status) + .body(new ErrorResponse(exception.getReason())); + } + + @ExceptionHandler(AuthenticationException.class) + public ResponseEntity handleAuthenticationException(AuthenticationException exception) { + return ResponseEntity.status(HttpStatus.UNAUTHORIZED) + .body(new ErrorResponse("请先登录")); + } + + @ExceptionHandler(AccessDeniedException.class) + public ResponseEntity handleAccessDeniedException(AccessDeniedException exception) { + var authentication = SecurityContextHolder.getContext().getAuthentication(); + var httpStatus = authentication == null || !authentication.isAuthenticated() + ? HttpStatus.UNAUTHORIZED + : HttpStatus.FORBIDDEN; + var message = httpStatus == HttpStatus.UNAUTHORIZED ? "请先登录" : "权限不足"; + return ResponseEntity.status(httpStatus) + .body(new ErrorResponse(message)); + } +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/controller/ModificationController.java b/server/src/main/java/com/onixbyte/ahsarahguide/controller/ModificationController.java new file mode 100644 index 0000000..de45d57 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/controller/ModificationController.java @@ -0,0 +1,109 @@ +package com.onixbyte.ahsarahguide.controller; + +import com.onixbyte.ahsarahguide.domain.dto.ModificationBatchCreateRequest; +import com.onixbyte.ahsarahguide.domain.dto.ModificationRequest; +import com.onixbyte.ahsarahguide.domain.dto.ModificationResponse; +import com.onixbyte.ahsarahguide.domain.dto.PageResponse; +import com.onixbyte.ahsarahguide.domain.entity.User; +import com.onixbyte.ahsarahguide.security.annotation.RequiresAuth; +import com.onixbyte.ahsarahguide.security.resolver.CurrentUser; +import com.onixbyte.ahsarahguide.service.ModificationService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.Positive; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * REST controller for modification CRUD operations, including batch creation and deletion. + * + * @author zihluwang + */ +@Tag(name = "改装管理", description = "对枪械改装的管理") +@RestController +@RequestMapping("/modifications") +public class ModificationController { + + private final ModificationService modificationService; + + public ModificationController(ModificationService modificationService) { + this.modificationService = modificationService; + } + + @Operation(description = "分页查询改装信息") + @Validated + @GetMapping + public PageResponse pageQuery( + @RequestParam(defaultValue = "0") @Min(0) int page, + @RequestParam(defaultValue = "20") @Min(1) @Max(100) int size, + @RequestParam(required = false) @Positive Long firearmId, + @RequestParam(defaultValue = "id") String sortBy, + @RequestParam(defaultValue = "DESC") Sort.Direction direction, + @RequestParam(required = false) List tags + ) { + return modificationService.pageQuery(firearmId, tags, PageRequest.of(page, size, Sort.by(direction, sortBy))); + } + + @Operation(description = "查询指定改装的信息") + @GetMapping("/{id}") + public ModificationResponse queryById(@PathVariable Long id) { + return modificationService.queryById(id); + } + + @RequiresAuth + @Operation(description = "创建改装") + @PostMapping + public ModificationResponse create( + @CurrentUser User user, + @Valid @RequestBody ModificationRequest request + ) { + return modificationService.create(request, user); + } + + @RequiresAuth + @Operation(description = "批量创建改装") + @PostMapping("/batch") + public List batchCreate( + @CurrentUser User user, + @Valid @RequestBody ModificationBatchCreateRequest request + ) { + return modificationService.batchCreate(request.modifications(), user); + } + + @RequiresAuth + @Operation(description = "修改指定改装") + @PutMapping("/{id}") + public ModificationResponse update(@PathVariable Long id, @Valid @RequestBody ModificationRequest request) { + return modificationService.update(id, request); + } + + @RequiresAuth + @Operation(description = "删除指定改装") + @DeleteMapping("/{id}") + public void delete(@PathVariable Long id) { + modificationService.delete(id); + } + + @RequiresAuth + @Operation(description = "批量删除改装") + @DeleteMapping("/batch-delete") + @Validated + public void batchDelete(@RequestParam List<@Positive Long> ids) { + modificationService.batchDelete(ids); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/controller/TagController.java b/server/src/main/java/com/onixbyte/ahsarahguide/controller/TagController.java new file mode 100644 index 0000000..7a8dd0b --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/controller/TagController.java @@ -0,0 +1,34 @@ +package com.onixbyte.ahsarahguide.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import com.onixbyte.ahsarahguide.service.ModificationService; + +import java.util.List; + +/** + * REST controller for retrieving available modification tags. + * + * @author zihluwang + */ +@Tag(name = "标签管理", description = "管理标签信息") +@RestController +@RequestMapping("/tags") +public class TagController { + + private final ModificationService modificationService; + + public TagController(ModificationService modificationService) { + this.modificationService = modificationService; + } + + @Operation(description = "查询指定武器或所有武器的标签") + @GetMapping + public List getTags(@RequestParam(required = false) Long firearmId) { + return modificationService.findAllTags(firearmId); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/controller/UserController.java b/server/src/main/java/com/onixbyte/ahsarahguide/controller/UserController.java new file mode 100644 index 0000000..4213603 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/controller/UserController.java @@ -0,0 +1,79 @@ +package com.onixbyte.ahsarahguide.controller; + +import com.onixbyte.ahsarahguide.domain.dto.BuildSummaryResponse; +import com.onixbyte.ahsarahguide.domain.dto.ChangePasswordRequest; +import com.onixbyte.ahsarahguide.domain.dto.PageResponse; +import com.onixbyte.ahsarahguide.domain.dto.UpdateProfileRequest; +import com.onixbyte.ahsarahguide.domain.dto.UserProfileResponse; +import com.onixbyte.ahsarahguide.domain.entity.User; +import com.onixbyte.ahsarahguide.security.annotation.RequiresAuth; +import com.onixbyte.ahsarahguide.security.resolver.CurrentUser; +import com.onixbyte.ahsarahguide.service.UserService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import org.springframework.data.domain.PageRequest; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * REST controller for the current user's profile management endpoints. + * + * @author zihluwang + */ +@Tag(name = "用户个人中心", description = "当前用户的资料管理与密码修改") +@RestController +@RequestMapping("/user") +@Validated +@RequiresAuth +public class UserController { + + private final UserService userService; + + public UserController(UserService userService) { + this.userService = userService; + } + + @Operation(description = "获取当前登录用户的个人资料") + @GetMapping("/me") + public UserProfileResponse profile(@CurrentUser User user) { + return userService.getProfile(user); + } + + @Operation(description = "修改当前用户的个人资料(昵称与邮箱)") + @PutMapping("/me") + public UserProfileResponse updateProfile( + @CurrentUser User user, + @Valid @RequestBody UpdateProfileRequest request + ) { + return userService.updateProfile(user, request); + } + + @Operation(description = "修改当前用户的登录密码") + @PutMapping("/me/password") + public ResponseEntity changePassword( + @CurrentUser User user, + @Valid @RequestBody ChangePasswordRequest request + ) { + userService.changePassword(user, request); + return ResponseEntity.noContent().build(); + } + + @Operation(description = "分页查询当前用户的改枪码列表") + @GetMapping("/me/builds") + public PageResponse builds( + @CurrentUser User user, + @RequestParam(defaultValue = "0") @Min(0) int page, + @RequestParam(defaultValue = "20") @Min(1) @Max(100) int size + ) { + return userService.getBuilds(user, PageRequest.of(page, size)); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/controller/VersionController.java b/server/src/main/java/com/onixbyte/ahsarahguide/controller/VersionController.java new file mode 100644 index 0000000..8641192 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/controller/VersionController.java @@ -0,0 +1,26 @@ +package com.onixbyte.ahsarahguide.controller; + +import com.onixbyte.ahsarahguide.service.AppService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@Tag(name = "版本信息") +@RestController +@RequestMapping("/versions") +public class VersionController { + + private final AppService appService; + + public VersionController(AppService appService) { + this.appService = appService; + } + + @Operation(description = "获取当前应用版本号") + @GetMapping + public String getVersion() { + return appService.getVersion(); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/controller/WebhookController.java b/server/src/main/java/com/onixbyte/ahsarahguide/controller/WebhookController.java new file mode 100644 index 0000000..55ad57f --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/controller/WebhookController.java @@ -0,0 +1,47 @@ +package com.onixbyte.ahsarahguide.controller; + +import com.onixbyte.ahsarahguide.domain.dto.GitHubIssueRequest; +import com.onixbyte.ahsarahguide.service.WebhookService; +import com.onixbyte.ahsarahguide.shared.GitHubWebhookHeader; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@Tag(name = "WebHook") +@RestController +@RequestMapping("/webhooks") +public class WebhookController { + + private static final Logger log = LoggerFactory.getLogger(WebhookController.class); + + private final WebhookService webhookService; + + public WebhookController(WebhookService webhookService) { + this.webhookService = webhookService; + } + + @Operation(description = "GitHub WebHook 接口") + @PostMapping("/github") + public ResponseEntity handleWebhook( + @RequestHeader(GitHubWebhookHeader.EVENT) String event, + @RequestBody GitHubIssueRequest request + ) { + if (!"issues".equals(event)) { + log.debug("Ignoring non-issue event: {}", event); + return ResponseEntity.ok().build(); + } + if (!"opened".equals(request.action())) { + log.debug("Ignoring issue action: {}", request.action()); + return ResponseEntity.ok().build(); + } + webhookService.processIssueEvent(request); + return ResponseEntity.ok().build(); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/converter/FirearmTypeConverter.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/converter/FirearmTypeConverter.java new file mode 100644 index 0000000..d1215b0 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/converter/FirearmTypeConverter.java @@ -0,0 +1,26 @@ +package com.onixbyte.ahsarahguide.domain.converter; + +import com.onixbyte.ahsarahguide.enumeration.FirearmType; +import jakarta.persistence.AttributeConverter; +import jakarta.persistence.Converter; + +/** + * JPA attribute converter that maps {@link FirearmType} enum to/from its integer database representation. + * + * @author zihluwang + */ +@Converter +public class FirearmTypeConverter implements AttributeConverter { + + @Override + public Integer convertToDatabaseColumn(FirearmType attribute) { + return attribute == null ? null : attribute.getCode(); + } + + @Override + public FirearmType convertToEntityAttribute(Integer dbData) { + return FirearmType.fromCode(dbData); + } +} + + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/converter/ModificationStatusConverter.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/converter/ModificationStatusConverter.java new file mode 100644 index 0000000..f2e4687 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/converter/ModificationStatusConverter.java @@ -0,0 +1,28 @@ +package com.onixbyte.ahsarahguide.domain.converter; + +import com.onixbyte.ahsarahguide.enumeration.ModificationStatus; +import jakarta.persistence.AttributeConverter; +import jakarta.persistence.Converter; + +import java.util.Optional; + +/** + * JPA attribute converter that maps {@link ModificationStatus} enum to/from its integer database representation. + * + * @author zihluwang + */ +@Converter +public class ModificationStatusConverter implements AttributeConverter { + + @Override + public Integer convertToDatabaseColumn(ModificationStatus attribute) { + return Optional.ofNullable(attribute) + .map(ModificationStatus::getCode) + .orElse(null); + } + + @Override + public ModificationStatus convertToEntityAttribute(Integer dbData) { + return ModificationStatus.fromCode(dbData); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/AccessoryRequest.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/AccessoryRequest.java new file mode 100644 index 0000000..97589da --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/AccessoryRequest.java @@ -0,0 +1,25 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; + +import java.util.ArrayList; +import java.util.List; + +/** + * Request DTO for creating or updating an accessory attached to a modification. + * + * @author zihluwang + */ +public record AccessoryRequest( + @NotBlank(message = "插槽名称不能为空") + String slotName, + @NotBlank(message = "配件名称不能为空") + String accessoryName, + List<@Valid TuningRequest> tunings +) { + public List tunings() { + return tunings == null ? new ArrayList<>() : tunings; + } +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/AccessoryResponse.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/AccessoryResponse.java new file mode 100644 index 0000000..f37e2d6 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/AccessoryResponse.java @@ -0,0 +1,27 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import com.onixbyte.ahsarahguide.domain.entity.Accessory; + +import java.util.List; + +/** + * Response DTO for an accessory attached to a modification. + * + * @author zihluwang + */ +public record AccessoryResponse( + String slotName, + String accessoryName, + List tunings +) { + public static AccessoryResponse from(Accessory accessory) { + return new AccessoryResponse( + accessory.getSlotName(), + accessory.getAccessoryName(), + accessory.getTunings() == null + ? List.of() + : accessory.getTunings().stream().map(TuningResponse::from).toList() + ); + } +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/BuildSummaryResponse.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/BuildSummaryResponse.java new file mode 100644 index 0000000..9cf4f04 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/BuildSummaryResponse.java @@ -0,0 +1,20 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import java.util.List; + +/** + * Response record summarising a user's custom modification build. + * This is a skeleton record whose {@code from()} factory will be fully implemented + * when the CustomModification entity is introduced in a future issue. + * + * @author zihluwang + */ +public record BuildSummaryResponse( + Long id, + String name, + String code, + String firearmName, + List tags +) { + // from() factory to be implemented when CustomModification entity lands +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ChangePasswordRequest.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ChangePasswordRequest.java new file mode 100644 index 0000000..14478e9 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ChangePasswordRequest.java @@ -0,0 +1,23 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Pattern; +import jakarta.validation.constraints.Size; + +/** + * Request record for changing the current user's password. + * + * @author zihluwang + */ +public record ChangePasswordRequest( + @NotBlank(message = "旧密码不能为空") + String oldPassword, + + @NotBlank(message = "新密码不能为空") + @Size(min = 8, max = 128, message = "密码长度必须在8-128个字符之间") + @Pattern( + regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).+$", + message = "密码必须包含至少一个大写字母、一个小写字母和一个数字" + ) + String newPassword +) {} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/DailyPassword.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/DailyPassword.java new file mode 100644 index 0000000..50f8cc1 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/DailyPassword.java @@ -0,0 +1,12 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +/** + * DTO representing a single daily-generated password for a map. + * + * @author zihluwang + */ +public record DailyPassword( + String mapName, + String password +) { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/DailyPasswordData.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/DailyPasswordData.java new file mode 100644 index 0000000..915acac --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/DailyPasswordData.java @@ -0,0 +1,19 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * DTO containing daily password data including update information and password list. + * + * @author zihluwang + */ +public record DailyPasswordData( + String updateDate, + Integer totalCount, + List passwords, + String source, + LocalDateTime lastUpdated, + Long timestamp +) { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/DailyPasswordMetadata.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/DailyPasswordMetadata.java new file mode 100644 index 0000000..42e7c4d --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/DailyPasswordMetadata.java @@ -0,0 +1,12 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +/** + * DTO holding metadata about the daily password source and update tracking. + * + * @author zihluwang + */ +public record DailyPasswordMetadata( + String version, + String author +) { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/DailyPasswordResponse.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/DailyPasswordResponse.java new file mode 100644 index 0000000..c5c1e07 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/DailyPasswordResponse.java @@ -0,0 +1,14 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +/** + * Response DTO wrapping daily password data with metadata. + * + * @author zihluwang + */ +public record DailyPasswordResponse( + String status, + String message, + DailyPasswordData data, + DailyPasswordMetadata metadata +) { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/EmailVerificationCode.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/EmailVerificationCode.java new file mode 100644 index 0000000..76f195e --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/EmailVerificationCode.java @@ -0,0 +1,8 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +public record EmailVerificationCode( + String username, + String email, + String code +) { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ErrorResponse.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ErrorResponse.java new file mode 100644 index 0000000..79febea --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ErrorResponse.java @@ -0,0 +1,12 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +/** + * Standard error response body returned on API failures. + * + * @author zihluwang + */ +public record ErrorResponse( + String message +) { +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/FirearmRequest.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/FirearmRequest.java new file mode 100644 index 0000000..86e4d84 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/FirearmRequest.java @@ -0,0 +1,20 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import com.onixbyte.ahsarahguide.enumeration.FirearmType; + +/** + * Request DTO for creating or updating a firearm. + * + * @author zihluwang + */ +public record FirearmRequest( + String name, + FirearmType type, + String level, + String calibre, + Integer fireRate, + Integer armourDamage, + Integer bodyDamage, + String review +) { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/FirearmResponse.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/FirearmResponse.java new file mode 100644 index 0000000..195838d --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/FirearmResponse.java @@ -0,0 +1,36 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import com.onixbyte.ahsarahguide.domain.entity.Firearm; +import com.onixbyte.ahsarahguide.enumeration.FirearmType; + +/** + * Response DTO for a firearm record, including associated modifications. + * + * @author zihluwang + */ +public record FirearmResponse( + Long id, + String name, + FirearmType type, + String level, + String calibre, + Integer fireRate, + Integer armourDamage, + Integer bodyDamage, + String review +) { + public static FirearmResponse from(Firearm firearm) { + return new FirearmResponse( + firearm.getId(), + firearm.getName(), + firearm.getType(), + firearm.getLevel(), + firearm.getCalibre(), + firearm.getFireRate(), + firearm.getArmourDamage(), + firearm.getBodyDamage(), + firearm.getReview() + ); + } +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/GitHubIssueRequest.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/GitHubIssueRequest.java new file mode 100644 index 0000000..b99899d --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/GitHubIssueRequest.java @@ -0,0 +1,15 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; + +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) +@JsonIgnoreProperties(ignoreUnknown = true) +public record GitHubIssueRequest( + String action, + GitHubWebhookIssue issue, + GitHubWebhookRepository repository, + GitHubWebhookSender sender +) { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/GitHubWebhookIssue.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/GitHubWebhookIssue.java new file mode 100644 index 0000000..3b91ba7 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/GitHubWebhookIssue.java @@ -0,0 +1,20 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; + +import java.util.List; + +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) +@JsonIgnoreProperties(ignoreUnknown = true) +public record GitHubWebhookIssue( + String url, + Long id, + Long number, + String title, + String body, + List labels +) { + +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/GitHubWebhookLabel.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/GitHubWebhookLabel.java new file mode 100644 index 0000000..d9eead5 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/GitHubWebhookLabel.java @@ -0,0 +1,12 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; + +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) +@JsonIgnoreProperties(ignoreUnknown = true) +public record GitHubWebhookLabel( + String name +) { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/GitHubWebhookRepository.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/GitHubWebhookRepository.java new file mode 100644 index 0000000..639b56c --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/GitHubWebhookRepository.java @@ -0,0 +1,12 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; + +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) +@JsonIgnoreProperties(ignoreUnknown = true) +public record GitHubWebhookRepository( + String fullName +) { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/GitHubWebhookSender.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/GitHubWebhookSender.java new file mode 100644 index 0000000..380458f --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/GitHubWebhookSender.java @@ -0,0 +1,12 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; + +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) +@JsonIgnoreProperties(ignoreUnknown = true) +public record GitHubWebhookSender( + String login +) { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/LoginRequest.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/LoginRequest.java new file mode 100644 index 0000000..2da755a --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/LoginRequest.java @@ -0,0 +1,20 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; + +/** + * Login request containing principle (username/email) and credential (password). + * + * @author zihluwang + */ +@Schema(description = "登录请求") +public record LoginRequest( + @NotBlank(message = "登录名称不能为空") + @Schema(description = "用户名或电子邮箱", requiredMode = Schema.RequiredMode.REQUIRED) + String principle, + @NotBlank(message = "登录口令不能为空") + @Schema(description = "密码", requiredMode = Schema.RequiredMode.REQUIRED) + String credential +) { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ManageRoleRequest.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ManageRoleRequest.java new file mode 100644 index 0000000..3a2ba5f --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ManageRoleRequest.java @@ -0,0 +1,13 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import jakarta.validation.constraints.NotBlank; + +/** + * Request record for managing a user's role assignment. + * + * @author zihluwang + */ +public record ManageRoleRequest( + @NotBlank(message = "角色不能为空") + String role +) {} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ModificationBatchCreateRequest.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ModificationBatchCreateRequest.java new file mode 100644 index 0000000..4bccd5d --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ModificationBatchCreateRequest.java @@ -0,0 +1,18 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotEmpty; + +import java.util.List; + +/** + * Request DTO for batch creation of modifications. + * + * @author zihluwang + */ +public record ModificationBatchCreateRequest( + @NotEmpty(message = "批量创建列表不能为空") + List<@Valid ModificationRequest> modifications +) { +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ModificationBatchDeleteRequest.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ModificationBatchDeleteRequest.java new file mode 100644 index 0000000..0d9563e --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ModificationBatchDeleteRequest.java @@ -0,0 +1,18 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.Positive; + +import java.util.List; + +/** + * Request DTO for batch deletion of modifications by ID. + * + * @author zihluwang + */ +public record ModificationBatchDeleteRequest( + @NotEmpty(message = "批量删除ID列表不能为空") + List<@Positive(message = "ID必须为正数") Long> ids +) { +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ModificationRequest.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ModificationRequest.java new file mode 100644 index 0000000..d994d2f --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ModificationRequest.java @@ -0,0 +1,38 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Positive; + +import java.util.ArrayList; +import java.util.List; + +/** + * Request DTO for creating or updating a modification. + * + * @author zihluwang + */ +public record ModificationRequest( + @NotNull(message = "武器ID不能为空") + @Positive(message = "武器ID必须为正数") + Long firearmId, + @NotBlank(message = "改装名称不能为空") + String name, + @NotBlank(message = "改装代码不能为空") + String code, + List<@NotBlank(message = "标签不能为空") String> tags, + List<@Valid AccessoryRequest> accessories, + String note, + String author, + String videoUrl +) { + public List tags() { + return tags == null ? new ArrayList<>() : tags; + } + + public List accessories() { + return accessories == null ? new ArrayList<>() : accessories; + } +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ModificationResponse.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ModificationResponse.java new file mode 100644 index 0000000..5357887 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/ModificationResponse.java @@ -0,0 +1,39 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import com.onixbyte.ahsarahguide.domain.entity.Modification; + +import java.util.List; + +/** + * Response DTO for a modification record including accessories and tags. + * + * @author zihluwang + */ +public record ModificationResponse( + Long id, + Long firearmId, + String name, + String code, + List tags, + List accessories, + String note, + String author, + String videoUrl +) { + public static ModificationResponse from(Modification modification) { + return new ModificationResponse( + modification.getId(), + modification.getFirearm().getId(), + modification.getName(), + modification.getCode(), + modification.getTags(), + modification.getAccessories() == null + ? List.of() + : modification.getAccessories().stream().map(AccessoryResponse::from).toList(), + modification.getNote(), + modification.getAuthor(), + modification.getVideoUrl() + ); + } +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/PageResponse.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/PageResponse.java new file mode 100644 index 0000000..2e3a94f --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/PageResponse.java @@ -0,0 +1,29 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import org.springframework.data.domain.Page; + +import java.util.List; + +/** + * Generic paginated response wrapper for list endpoints. + * + * @author zihluwang + */ +public record PageResponse( + List items, + int page, + int size, + long totalElements, + int totalPages +) { + public static PageResponse from(Page source) { + return new PageResponse<>( + source.getContent(), + source.getNumber(), + source.getSize(), + source.getTotalElements(), + source.getTotalPages() + ); + } +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/RegisterRequest.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/RegisterRequest.java new file mode 100644 index 0000000..957d66f --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/RegisterRequest.java @@ -0,0 +1,31 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.NotBlank; + +/** + * Registration request containing the new user account information. + * + * @author zihluwang + */ +@Schema(description = "注册请求") +public record RegisterRequest( + @NotBlank(message = "用户名不能为空") + @Schema(description = "用户名", requiredMode = Schema.RequiredMode.REQUIRED) + String username, + @NotBlank(message = "邮箱不能为空") + @Email(message = "邮箱格式不正确") + @Schema(description = "邮箱", requiredMode = Schema.RequiredMode.REQUIRED) + String email, + @Schema(description = "昵称") + String nickname, + @Schema(description = "头像链接") + String avatarUrl, + @NotBlank(message = "密码不能为空") + @Schema(description = "密码", requiredMode = Schema.RequiredMode.REQUIRED) + String password, + @NotBlank(message = "验证码 ID 不能为空") String verificationCodeId, + @NotBlank(message = "验证码不能为空") String verificationCode +) { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/SendVerificationCodeRequest.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/SendVerificationCodeRequest.java new file mode 100644 index 0000000..4c67659 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/SendVerificationCodeRequest.java @@ -0,0 +1,9 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import jakarta.validation.constraints.NotBlank; + +public record SendVerificationCodeRequest( + @NotBlank(message = "用户名不能为空") String username, + @NotBlank(message = "电子邮箱地址不能为空") String email +) { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/SendVerificationCodeResponse.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/SendVerificationCodeResponse.java new file mode 100644 index 0000000..0bbfe45 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/SendVerificationCodeResponse.java @@ -0,0 +1,6 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +public record SendVerificationCodeResponse( + String verificationCodeId +) { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/TuningRequest.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/TuningRequest.java new file mode 100644 index 0000000..a7d2381 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/TuningRequest.java @@ -0,0 +1,18 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; + +/** + * Request DTO for a tuning adjustment on an accessory. + * + * @author zihluwang + */ +public record TuningRequest( + @NotBlank(message = "调校项名称不能为空") + String tuningName, + @NotNull(message = "调校值不能为空") + Double tuningValue +) { +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/TuningResponse.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/TuningResponse.java new file mode 100644 index 0000000..dda6258 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/TuningResponse.java @@ -0,0 +1,21 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import com.onixbyte.ahsarahguide.domain.entity.Tuning; + +/** + * Response DTO for a tuning adjustment on an accessory. + * + * @author zihluwang + */ +public record TuningResponse( + String tuningName, + Double tuningValue +) { + public static TuningResponse from(Tuning tuning) { + return new TuningResponse( + tuning.getTuningName(), + tuning.getTuningValue() + ); + } +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/UpdateProfileRequest.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/UpdateProfileRequest.java new file mode 100644 index 0000000..08f55c2 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/UpdateProfileRequest.java @@ -0,0 +1,14 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.Size; + +/** + * Request record for updating the current user's profile information. + * + * @author zihluwang + */ +public record UpdateProfileRequest( + @Size(min = 1, max = 64, message = "昵称长度必须在1-64个字符之间") + String nickname +) {} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/UserProfileResponse.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/UserProfileResponse.java new file mode 100644 index 0000000..ff8f4c8 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/UserProfileResponse.java @@ -0,0 +1,44 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import com.onixbyte.ahsarahguide.domain.entity.User; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * Response record for the current user's full profile information. + * + * @author zihluwang + */ +public record UserProfileResponse( + Long id, + String username, + String nickname, + String email, + String avatarUrl, + Boolean enabled, + LocalDateTime createdAt, + List roles +) { + + /** + * Creates a {@code UserProfileResponse} from a {@link User} entity and its assigned roles. + * + * @param user the user entity + * @param roles the list of role names assigned to the user + * @return the constructed response + */ + public static UserProfileResponse from(User user, List roles) { + return new UserProfileResponse( + user.getId(), + user.getUsername(), + user.getNickname() == null || user.getNickname().isBlank() + ? user.getUsername() : user.getNickname(), + user.getEmail(), + user.getAvatarUrl(), + user.getEnabled(), + user.getCreatedAt(), + roles + ); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/UserResponse.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/UserResponse.java new file mode 100644 index 0000000..a306864 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/dto/UserResponse.java @@ -0,0 +1,26 @@ +package com.onixbyte.ahsarahguide.domain.dto; + +import com.onixbyte.ahsarahguide.domain.entity.User; + +import java.time.LocalDateTime; + +/** + * Response DTO for a user account, including associated credentials. + * + * @author zihluwang + */ +public record UserResponse( + Long id, + String username, + String email, + LocalDateTime expiration +) { + public static UserResponse from(User user, LocalDateTime expiration) { + return new UserResponse( + user.getId(), + user.getUsername(), + user.getEmail(), + expiration + ); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/Accessory.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/Accessory.java new file mode 100644 index 0000000..be87f23 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/Accessory.java @@ -0,0 +1,72 @@ +package com.onixbyte.ahsarahguide.domain.entity; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * Entity representing an accessory attached to a modification, stored as JSONB. + * + * @author zihluwang + */ +public class Accessory { + + private String slotName; + + private String accessoryName; + + private List tunings = new ArrayList<>(); + + public Accessory() { + } + + public String getSlotName() { + return slotName; + } + + public void setSlotName(String slotName) { + this.slotName = slotName; + } + + public String getAccessoryName() { + return accessoryName; + } + + public void setAccessoryName(String accessoryName) { + this.accessoryName = accessoryName; + } + + public List getTunings() { + return tunings; + } + + public void setTunings(List tunings) { + this.tunings = tunings; + } + + public void addTuning(Tuning tuning) { + this.tunings.add(tuning); + } + + public void removeTuning(Tuning tuning) { + this.tunings.remove(tuning); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof Accessory accessory)) { + return false; + } + return Objects.equals(slotName, accessory.slotName) + && Objects.equals(accessoryName, accessory.accessoryName) + && Objects.equals(tunings, accessory.tunings); + } + + @Override + public int hashCode() { + return Objects.hash(slotName, accessoryName, tunings); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/Firearm.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/Firearm.java new file mode 100644 index 0000000..ea032cb --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/Firearm.java @@ -0,0 +1,232 @@ +package com.onixbyte.ahsarahguide.domain.entity; + +import com.onixbyte.ahsarahguide.domain.converter.FirearmTypeConverter; +import com.onixbyte.ahsarahguide.enumeration.FirearmType; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Convert; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; + +import java.util.ArrayList; +import java.util.List; + +/** + * Entity representing a firearm in the Delta Force game. + * + * @author zihluwang + */ +@Entity +@Table(name = "firearm") +public class Firearm { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(name = "name", nullable = false, length = 64) + private String name; + + @Column(name = "type", nullable = false) + @Convert(converter = FirearmTypeConverter.class) + private FirearmType type; + + @Column(name = "level", nullable = false) + private String level; + + @Column(name = "review", columnDefinition = "TEXT") + private String review; + + @Column(name = "calibre") + private String calibre; + + @Column(name = "fire_rate") + private Integer fireRate; + + @Column(name = "armour_damage") + private Integer armourDamage; + + @Column(name = "body_damage") + private Integer bodyDamage; + + @OneToMany(mappedBy = "firearm", cascade = CascadeType.ALL, orphanRemoval = true) + private List modifications = new ArrayList<>(); + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public FirearmType getType() { + return type; + } + + public void setType(FirearmType type) { + this.type = type; + } + + public String getLevel() { + return level; + } + + public void setLevel(String level) { + this.level = level; + } + + public String getReview() { + return review; + } + + public void setReview(String review) { + this.review = review; + } + + public String getCalibre() { + return calibre; + } + + public void setCalibre(String calibre) { + this.calibre = calibre; + } + + public Integer getFireRate() { + return fireRate; + } + + public void setFireRate(Integer fireRate) { + this.fireRate = fireRate; + } + + public Integer getArmourDamage() { + return armourDamage; + } + + public void setArmourDamage(Integer armourDamage) { + this.armourDamage = armourDamage; + } + + public Integer getBodyDamage() { + return bodyDamage; + } + + public void setBodyDamage(Integer bodyDamage) { + this.bodyDamage = bodyDamage; + } + + public List getModifications() { + return modifications; + } + + public void setModifications(List modifications) { + this.modifications = modifications; + } + + public void addModification(Modification modification) { + this.modifications.add(modification); + modification.setFirearm(this); + } + + public void removeModification(Modification modification) { + this.modifications.remove(modification); + modification.setFirearm(null); + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + + private Long id; + private String name; + private FirearmType type; + private String level; + private String review; + private String calibre; + private Integer fireRate; + private Integer armourDamage; + private Integer bodyDamage; + private List modifications; + + public Builder id(Long id) { + this.id = id; + return this; + } + + public Builder name(String name) { + this.name = name; + return this; + } + + public Builder type(FirearmType type) { + this.type = type; + return this; + } + + public Builder level(String level) { + this.level = level; + return this; + } + + public Builder review(String review) { + this.review = review; + return this; + } + + public Builder calibre(String calibre) { + this.calibre = calibre; + return this; + } + + public Builder fireRate(Integer fireRate) { + this.fireRate = fireRate; + return this; + } + + public Builder armourDamage(Integer armourDamage) { + this.armourDamage = armourDamage; + return this; + } + + public Builder bodyDamage(Integer bodyDamage) { + this.bodyDamage = bodyDamage; + return this; + } + + public Builder modifications(List modifications) { + this.modifications = modifications; + return this; + } + + public Firearm build() { + Firearm firearm = new Firearm(); + firearm.id = this.id; + firearm.name = this.name; + firearm.type = this.type; + firearm.level = this.level; + firearm.review = this.review; + firearm.calibre = this.calibre; + firearm.fireRate = this.fireRate; + firearm.armourDamage = this.armourDamage; + firearm.bodyDamage = this.bodyDamage; + firearm.modifications = this.modifications == null ? new ArrayList<>() : this.modifications; + return firearm; + } + } +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/Modification.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/Modification.java new file mode 100644 index 0000000..8e9d651 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/Modification.java @@ -0,0 +1,289 @@ +package com.onixbyte.ahsarahguide.domain.entity; + +import com.onixbyte.ahsarahguide.domain.converter.ModificationStatusConverter; +import com.onixbyte.ahsarahguide.enumeration.ModificationStatus; +import io.hypersistence.utils.hibernate.type.json.JsonType; +import jakarta.persistence.*; +import org.hibernate.annotations.Type; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +/** + * Entity representing a firearm modification or build configuration. + * + * @author zihluwang + */ +@Entity +@Table( + name = "modification", + indexes = { + @Index(name = "idx_modification_firearm_id", columnList = "firearm_id") + } +) +public class Modification { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne + @JoinColumn(name = "user_id") + private User user; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "firearm_id", nullable = false, foreignKey = @ForeignKey(name = "fk_modification_firearm")) + private Firearm firearm; + + @Column(name = "name", nullable = false, length = 64) + private String name; + + @Column(name = "code", nullable = false, length = 64) + private String code; + + @Type(JsonType.class) + @Column(name = "tags", columnDefinition = "jsonb", nullable = false) + private List tags = new ArrayList<>(); + + @Type(JsonType.class) + @Column(name = "accessories", columnDefinition = "jsonb", nullable = false) + private List accessories = new ArrayList<>(); + + @Column(name = "note", columnDefinition = "TEXT") + private String note; + + @Column(name = "author", length = 64) + private String author; + + @Column(name = "video_url", length = 512) + private String videoUrl; + + @Column(name = "status", nullable = false) + @Convert(converter = ModificationStatusConverter.class) + private ModificationStatus status = ModificationStatus.DRAFT; + + @Column(name = "create_by") + private Long createBy; + + @Column(name = "create_time", nullable = false) + private OffsetDateTime createTime; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Firearm getFirearm() { + return firearm; + } + + public void setFirearm(Firearm firearm) { + this.firearm = firearm; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public List getAccessories() { + return accessories; + } + + public void setAccessories(List accessories) { + this.accessories = accessories; + } + + public void addAccessory(Accessory modificationAccessory) { + this.accessories.add(modificationAccessory); + } + + public void removeAccessory(Accessory modificationAccessory) { + this.accessories.remove(modificationAccessory); + } + + public String getNote() { + return note; + } + + public void setNote(String note) { + this.note = note; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } + + public String getVideoUrl() { + return videoUrl; + } + + public void setVideoUrl(String videoUrl) { + this.videoUrl = videoUrl; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public Long getCreateBy() { + return createBy; + } + + public void setCreateBy(Long createBy) { + this.createBy = createBy; + } + + public OffsetDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(OffsetDateTime createTime) { + this.createTime = createTime; + } + + public ModificationStatus getStatus() { + return status; + } + + public void setStatus(ModificationStatus status) { + this.status = status; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + + private Long id; + private User user; + private Firearm firearm; + private String name; + private String code; + private List tags; + private List accessories; + private String note; + private String author; + private String videoUrl; + private Long createBy; + private OffsetDateTime createTime; + private ModificationStatus status; + + public Builder id(Long id) { + this.id = id; + return this; + } + + public Builder user(User user) { + this.user = user; + return this; + } + + public Builder firearm(Firearm firearm) { + this.firearm = firearm; + return this; + } + + public Builder name(String name) { + this.name = name; + return this; + } + + public Builder code(String code) { + this.code = code; + return this; + } + + public Builder tags(List tags) { + this.tags = tags; + return this; + } + + public Builder accessories(List accessories) { + this.accessories = accessories; + return this; + } + + public Builder note(String note) { + this.note = note; + return this; + } + + public Builder author(String author) { + this.author = author; + return this; + } + + public Builder videoUrl(String videoUrl) { + this.videoUrl = videoUrl; + return this; + } + + public Builder createBy(Long createBy) { + this.createBy = createBy; + return this; + } + + public Builder createTime(OffsetDateTime createTime) { + this.createTime = createTime; + return this; + } + + public Builder status(ModificationStatus status) { + this.status = status; + return this; + } + + public Modification build() { + Modification modification = new Modification(); + modification.id = this.id; + modification.user = this.user; + modification.firearm = this.firearm; + modification.name = this.name; + modification.code = this.code; + modification.tags = Optional.ofNullable(this.tags).orElseGet(ArrayList::new); + modification.accessories = Optional.ofNullable(this.accessories).orElseGet(ArrayList::new); + modification.note = this.note; + modification.author = this.author; + modification.videoUrl = this.videoUrl; + modification.createBy = this.createBy; + modification.createTime = Optional.ofNullable(this.createTime).orElseGet(OffsetDateTime::now); + modification.status = Optional.ofNullable(this.status).orElse(ModificationStatus.DRAFT); + return modification; + } + } +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/Tuning.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/Tuning.java new file mode 100644 index 0000000..42283eb --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/Tuning.java @@ -0,0 +1,50 @@ +package com.onixbyte.ahsarahguide.domain.entity; + +import java.util.Objects; + +/** + * Entity representing a tuning adjustment for an accessory, stored as JSONB within Accessory. + * + * @author zihluwang + */ +public class Tuning { + + private String tuningName; + private Double tuningValue; + + public Tuning() { + } + + public String getTuningName() { + return tuningName; + } + + public void setTuningName(String tuningName) { + this.tuningName = tuningName; + } + + public Double getTuningValue() { + return tuningValue; + } + + public void setTuningValue(Double tuningValue) { + this.tuningValue = tuningValue; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof Tuning tuning)) { + return false; + } + return Objects.equals(tuningName, tuning.tuningName) + && Objects.equals(tuningValue, tuning.tuningValue); + } + + @Override + public int hashCode() { + return Objects.hash(tuningName, tuningValue); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/User.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/User.java new file mode 100644 index 0000000..6a04788 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/User.java @@ -0,0 +1,217 @@ +package com.onixbyte.ahsarahguide.domain.entity; + +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.OneToMany; +import jakarta.persistence.PreUpdate; +import jakarta.persistence.Table; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +/** + * Entity representing an application user with authentication credentials. + * + * @author zihluwang + */ +@Entity +@Table(name = "app_user") +public class User { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(name = "username", nullable = false) + private String username; + + @Column(name = "email", nullable = false) + private String email; + + @Column(name = "nickname") + private String nickname; + + @Column(name = "avatar_url") + private String avatarUrl; + + @Column(name = "enabled", nullable = false) + private Boolean enabled = true; + + @Column(name = "created_at", nullable = false) + private LocalDateTime createdAt; + + @Column(name = "updated_at", nullable = false) + private LocalDateTime updatedAt; + + @OneToMany(mappedBy = "user", cascade = CascadeType.ALL, orphanRemoval = true) + private List credentials = new ArrayList<>(); + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getNickname() { + return nickname; + } + + public void setNickname(String nickname) { + this.nickname = nickname; + } + + public String getAvatarUrl() { + return avatarUrl; + } + + public void setAvatarUrl(String avatarUrl) { + this.avatarUrl = avatarUrl; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public LocalDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(LocalDateTime createdAt) { + this.createdAt = createdAt; + } + + public LocalDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(LocalDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + @PreUpdate + private void onUpdate() { + this.updatedAt = LocalDateTime.now(); + } + + public List getCredentials() { + return credentials; + } + + public void setCredentials(List credentials) { + this.credentials = credentials; + } + + public void addCredential(UserCredential credential) { + this.credentials.add(credential); + credential.setUser(this); + } + + public void removeCredential(UserCredential credential) { + this.credentials.remove(credential); + credential.setUser(null); + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + + private Long id; + private String username; + private String email; + private String nickname; + private String avatarUrl; + private Boolean enabled; + private LocalDateTime createdAt; + private LocalDateTime updatedAt; + private List credentials; + + public Builder id(Long id) { + this.id = id; + return this; + } + + public Builder username(String username) { + this.username = username; + return this; + } + + public Builder email(String email) { + this.email = email; + return this; + } + + public Builder nickname(String nickname) { + this.nickname = nickname; + return this; + } + + public Builder avatarUrl(String avatarUrl) { + this.avatarUrl = avatarUrl; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + public Builder createdAt(LocalDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder updatedAt(LocalDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder credentials(List credentials) { + this.credentials = credentials; + return this; + } + + public User build() { + User user = new User(); + user.id = this.id; + user.username = this.username; + user.email = this.email; + user.nickname = this.nickname == null || this.nickname.isBlank() + ? this.username : this.nickname; + user.avatarUrl = this.avatarUrl; + user.enabled = this.enabled == null || this.enabled; + user.createdAt = this.createdAt; + user.updatedAt = this.updatedAt; + user.credentials = this.credentials == null ? new ArrayList<>() : this.credentials; + return user; + } + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/UserCredential.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/UserCredential.java new file mode 100644 index 0000000..b5f05f0 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/UserCredential.java @@ -0,0 +1,143 @@ +package com.onixbyte.ahsarahguide.domain.entity; + +import jakarta.persistence.Column; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.AttributeOverrides; +import jakarta.persistence.EmbeddedId; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.MapsId; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; + +/** + * Entity representing a user credential linked to an authentication provider. + * + * @author zihluwang + */ +@Entity +@Table(name = "app_user_credential") +public class UserCredential { + + @EmbeddedId + @AttributeOverrides({ + @AttributeOverride(name = "userId", column = @Column(name = "user_id")), + @AttributeOverride(name = "provider", column = @Column(name = "provider")) + }) + private UserCredentialId id = new UserCredentialId(); + + @MapsId("userId") + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "user_id", nullable = false, foreignKey = @ForeignKey(name = "fk_user_credential_user")) + private User user; + + @Column(name = "credential", nullable = false) + private String credential; + + public UserCredentialId getId() { + return id; + } + + public void setId(UserCredentialId id) { + this.id = id; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + if (this.id == null) { + this.id = new UserCredentialId(); + } + this.id.setUserId(user == null ? null : user.getId()); + } + + public Long getUserId() { + return id == null ? null : id.getUserId(); + } + + public void setUserId(Long userId) { + if (this.id == null) { + this.id = new UserCredentialId(); + } + this.id.setUserId(userId); + } + + public String getProvider() { + return id == null ? null : id.getProvider(); + } + + public void setProvider(String provider) { + if (this.id == null) { + this.id = new UserCredentialId(); + } + this.id.setProvider(provider); + } + + public String getCredential() { + return credential; + } + + public void setCredential(String credential) { + this.credential = credential; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + + private UserCredentialId id; + private User user; + private Long userId; + private String provider; + private String credential; + + public Builder id(UserCredentialId id) { + this.id = id; + return this; + } + + public Builder user(User user) { + this.user = user; + return this; + } + + public Builder userId(Long userId) { + this.userId = userId; + return this; + } + + public Builder provider(String provider) { + this.provider = provider; + return this; + } + + public Builder credential(String credential) { + this.credential = credential; + return this; + } + + public UserCredential build() { + UserCredential userCredential = new UserCredential(); + userCredential.id = this.id == null ? new UserCredentialId() : this.id; + userCredential.user = this.user; + if (this.user != null) { + userCredential.id.setUserId(this.user.getId()); + } + if (this.userId != null) { + userCredential.id.setUserId(this.userId); + } + if (this.provider != null) { + userCredential.id.setProvider(this.provider); + } + userCredential.credential = this.credential; + return userCredential; + } + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/UserCredentialId.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/UserCredentialId.java new file mode 100644 index 0000000..b1c7fea --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/UserCredentialId.java @@ -0,0 +1,81 @@ +package com.onixbyte.ahsarahguide.domain.entity; + +import jakarta.persistence.Embeddable; + +import java.io.Serializable; +import java.util.Objects; + +/** + * Composite key for the UserCredential entity, combining user ID and provider. + * + * @author zihluwang + */ +@Embeddable +public class UserCredentialId implements Serializable { + + private Long userId; + + private String provider; + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getProvider() { + return provider; + } + + public void setProvider(String provider) { + this.provider = provider; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserCredentialId that = (UserCredentialId) o; + return Objects.equals(userId, that.userId) && Objects.equals(provider, that.provider); + } + + @Override + public int hashCode() { + return Objects.hash(userId, provider); + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + + private Long userId; + private String provider; + + public Builder userId(Long userId) { + this.userId = userId; + return this; + } + + public Builder provider(String provider) { + this.provider = provider; + return this; + } + + public UserCredentialId build() { + UserCredentialId id = new UserCredentialId(); + id.userId = this.userId; + id.provider = this.provider; + return id; + } + } +} + + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/UserRole.java b/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/UserRole.java new file mode 100644 index 0000000..b354e6b --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/domain/entity/UserRole.java @@ -0,0 +1,101 @@ +package com.onixbyte.ahsarahguide.domain.entity; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.MapsId; +import jakarta.persistence.Table; + +/** + * Entity representing a role assignment linking a user to a security role. + *

+ * A user owns at most one role assignment, so the user ID is the primary key. + * + * @author zihluwang + */ +@Entity +@Table(name = "user_role") +public class UserRole { + + @Id + @Column(name = "user_id") + private Long userId; + + @MapsId("userId") + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "user_id", nullable = false, foreignKey = @ForeignKey(name = "fk_user_role_user")) + private User user; + + @Column(name = "role", nullable = false, length = 32) + private String role; + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + if (user != null) { + this.userId = user.getId(); + } + } + + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + + private User user; + private Long userId; + private String role; + + public Builder user(User user) { + this.user = user; + return this; + } + + public Builder userId(Long userId) { + this.userId = userId; + return this; + } + + public Builder role(String role) { + this.role = role; + return this; + } + + public UserRole build() { + UserRole userRole = new UserRole(); + userRole.user = this.user; + userRole.role = this.role; + if (this.user != null) { + userRole.userId = this.user.getId(); + } + if (this.userId != null) { + userRole.userId = this.userId; + } + return userRole; + } + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/enumeration/FirearmType.java b/server/src/main/java/com/onixbyte/ahsarahguide/enumeration/FirearmType.java new file mode 100644 index 0000000..a6343b1 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/enumeration/FirearmType.java @@ -0,0 +1,50 @@ +package com.onixbyte.ahsarahguide.enumeration; + +/** + * Enumeration of firearm types in the Delta Force game. + * Each type is associated with an integer code used for database persistence. + * + * @author zihluwang + */ +public enum FirearmType { + + RIFLE(0), + SUB_MACHINE_GUN(1), + SHOTGUN(2), + LIGHT_MACHINE_GUN(3), + DESIGNATED_MARKSMAN_RIFLE(4), + SNIPER_RIFLE(5), + PISTOL(6), + SPECIAL(7); + + private final int code; + + FirearmType(int code) { + this.code = code; + } + + public int getCode() { + return code; + } + + /** + * Resolve a FirearmType from its integer code. + * + * @param code the integer code, may be null + * @return the corresponding FirearmType, or null if the code is null + * @throws IllegalArgumentException if the code does not match any known type + */ + public static FirearmType fromCode(Integer code) { + if (code == null) { + return null; + } + + for (FirearmType type : values()) { + if (type.code == code) { + return type; + } + } + + throw new IllegalArgumentException("Unknown FirearmType code: " + code); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/enumeration/ModificationStatus.java b/server/src/main/java/com/onixbyte/ahsarahguide/enumeration/ModificationStatus.java new file mode 100644 index 0000000..edfdbd7 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/enumeration/ModificationStatus.java @@ -0,0 +1,44 @@ +package com.onixbyte.ahsarahguide.enumeration; + +import java.util.Arrays; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * Enumeration of modification statuses. + *

+ * Each status is associated with an integer code used for database persistence. + * + * @author zihluwang + */ +public enum ModificationStatus { + + DRAFT(0), + PENDING_APPROVAL(1), + PUBLISHED(2); + + private final int code; + + ModificationStatus(int code) { + this.code = code; + } + + public int getCode() { + return code; + } + + public static final Map CODE_MAP = Arrays.stream(values()) + .collect(Collectors.toMap(ModificationStatus::getCode, Function.identity())); + + /** + * Resolve a ModificationStatus from its integer code. + * + * @param code the integer code, may be null + * @return the corresponding ModificationStatus, or null if the code is null + * @throws IllegalArgumentException if the code does not match any known status + */ + public static ModificationStatus fromCode(Integer code) { + return CODE_MAP.get(code); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/exeption/BadRequestException.java b/server/src/main/java/com/onixbyte/ahsarahguide/exeption/BadRequestException.java new file mode 100644 index 0000000..738d562 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/exeption/BadRequestException.java @@ -0,0 +1,11 @@ +package com.onixbyte.ahsarahguide.exeption; + +import org.springframework.http.HttpStatus; +import org.springframework.web.server.ResponseStatusException; + +public class BadRequestException extends ResponseStatusException { + + public BadRequestException(String reason) { + super(HttpStatus.BAD_REQUEST, reason); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/exeption/ConflictException.java b/server/src/main/java/com/onixbyte/ahsarahguide/exeption/ConflictException.java new file mode 100644 index 0000000..5f145c1 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/exeption/ConflictException.java @@ -0,0 +1,11 @@ +package com.onixbyte.ahsarahguide.exeption; + +import org.springframework.http.HttpStatus; +import org.springframework.web.server.ResponseStatusException; + +public class ConflictException extends ResponseStatusException { + + public ConflictException(String reason) { + super(HttpStatus.CONFLICT, reason); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/exeption/ForbiddenException.java b/server/src/main/java/com/onixbyte/ahsarahguide/exeption/ForbiddenException.java new file mode 100644 index 0000000..1170702 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/exeption/ForbiddenException.java @@ -0,0 +1,11 @@ +package com.onixbyte.ahsarahguide.exeption; + +import org.springframework.http.HttpStatus; +import org.springframework.web.server.ResponseStatusException; + +public class ForbiddenException extends ResponseStatusException { + + public ForbiddenException(String reason) { + super(HttpStatus.FORBIDDEN, reason); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/exeption/InternalServerErrorException.java b/server/src/main/java/com/onixbyte/ahsarahguide/exeption/InternalServerErrorException.java new file mode 100644 index 0000000..9d88589 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/exeption/InternalServerErrorException.java @@ -0,0 +1,11 @@ +package com.onixbyte.ahsarahguide.exeption; + +import org.springframework.http.HttpStatus; +import org.springframework.web.server.ResponseStatusException; + +public class InternalServerErrorException extends ResponseStatusException { + + public InternalServerErrorException(String reason) { + super(HttpStatus.INTERNAL_SERVER_ERROR, reason); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/exeption/NotFoundException.java b/server/src/main/java/com/onixbyte/ahsarahguide/exeption/NotFoundException.java new file mode 100644 index 0000000..d37229d --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/exeption/NotFoundException.java @@ -0,0 +1,11 @@ +package com.onixbyte.ahsarahguide.exeption; + +import org.springframework.http.HttpStatus; +import org.springframework.web.server.ResponseStatusException; + +public class NotFoundException extends ResponseStatusException { + + public NotFoundException(String reason) { + super(HttpStatus.NOT_FOUND, reason); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/exeption/UnauthorisedException.java b/server/src/main/java/com/onixbyte/ahsarahguide/exeption/UnauthorisedException.java new file mode 100644 index 0000000..d232276 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/exeption/UnauthorisedException.java @@ -0,0 +1,11 @@ +package com.onixbyte.ahsarahguide.exeption; + +import org.springframework.http.HttpStatus; +import org.springframework.web.server.ResponseStatusException; + +public class UnauthorisedException extends ResponseStatusException { + + public UnauthorisedException(String reason) { + super(HttpStatus.UNAUTHORIZED, reason); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/filter/TokenAuthenticationFilter.java b/server/src/main/java/com/onixbyte/ahsarahguide/filter/TokenAuthenticationFilter.java new file mode 100644 index 0000000..6c66a29 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/filter/TokenAuthenticationFilter.java @@ -0,0 +1,123 @@ +package com.onixbyte.ahsarahguide.filter; + +import com.auth0.jwt.exceptions.JWTVerificationException; +import com.onixbyte.ahsarahguide.client.TokenClient; +import com.onixbyte.ahsarahguide.exeption.UnauthorisedException; +import com.onixbyte.ahsarahguide.manager.CookieManager; +import com.onixbyte.ahsarahguide.manager.UserManager; +import com.onixbyte.ahsarahguide.manager.UserRoleManager; +import com.onixbyte.ahsarahguide.security.authentication.UsernamePasswordAuthentication; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import org.jspecify.annotations.NonNull; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpHeaders; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.stereotype.Component; +import org.springframework.web.filter.OncePerRequestFilter; +import org.springframework.web.server.ResponseStatusException; +import org.springframework.web.servlet.HandlerExceptionResolver; +import org.springframework.web.util.WebUtils; + +import java.io.IOException; +import java.time.Duration; +import java.time.Instant; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * Servlet filter that extracts and validates JWT tokens from httpOnly cookies for each request. + * + * @author zihluwang + */ +@Component +public class TokenAuthenticationFilter extends OncePerRequestFilter { + + private final static Logger log = LoggerFactory.getLogger(TokenAuthenticationFilter.class); + private static final Duration ACCESS_TOKEN_RENEW_THRESHOLD = Duration.ofMinutes(5); + + private final UserManager userManager; + private final UserRoleManager userRoleManager; + private final TokenClient tokenClient; + private final CookieManager cookieManager; + private final HandlerExceptionResolver handlerExceptionResolver; + + public TokenAuthenticationFilter( + UserManager userManager, + UserRoleManager userRoleManager, + TokenClient tokenClient, + CookieManager cookieManager, + HandlerExceptionResolver handlerExceptionResolver + ) { + this.userManager = userManager; + this.userRoleManager = userRoleManager; + this.tokenClient = tokenClient; + this.cookieManager = cookieManager; + this.handlerExceptionResolver = handlerExceptionResolver; + } + + /** + * Extracts JWT from httpOnly cookie, validates it, and sets the security context. + * + * @param request the HTTP request + * @param response the HTTP response + * @param filterChain the filter chain + */ + @Override + protected void doFilterInternal( + @NonNull HttpServletRequest request, + @NonNull HttpServletResponse response, + @NonNull FilterChain filterChain + ) throws ServletException, IOException { + var token = Optional.ofNullable(WebUtils.getCookie(request, "AccessToken")) + .map(Cookie::getValue) + .orElse(null); + if (Objects.isNull(token) || token.isBlank()) { + filterChain.doFilter(request, response); + return; + } + + try { + var decodedToken = tokenClient.verifyToken(token); + var username = decodedToken.getSubject(); + + var userWrapper = userManager.findByUsername(username); + if (userWrapper.isEmpty()) { + throw new UnauthorisedException("登录已过期,请重新登录"); + } + + var user = userWrapper.get(); + var roles = userRoleManager.findAllByUserId(user.getId()); + var authorities = roles.stream() + .map(r -> new SimpleGrantedAuthority(r.getRole())) + .collect(Collectors.toList()); + var authentication = UsernamePasswordAuthentication.authenticated(user, authorities); + SecurityContextHolder.getContext().setAuthentication(authentication); + + if (shouldRenew(decodedToken.getExpiresAt().toInstant())) { + var renewedToken = tokenClient.generateToken(user); + var renewedTokenCookie = cookieManager.buildCookie("AccessToken", renewedToken); + response.addHeader(HttpHeaders.SET_COOKIE, renewedTokenCookie.toString()); + } + + filterChain.doFilter(request, response); + } catch (JWTVerificationException e) { + log.error("JWT verification failed.", e); + handlerExceptionResolver.resolveException(request, response, null, + new UnauthorisedException("登录已过期,请重新登录")); + } catch (ResponseStatusException e) { + handlerExceptionResolver.resolveException(request, response, null, e); + } + } + + private boolean shouldRenew(Instant expiresAt) { + return Duration.between(Instant.now(), expiresAt).compareTo(ACCESS_TOKEN_RENEW_THRESHOLD) < 0; + } +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/filter/WebhookFilter.java b/server/src/main/java/com/onixbyte/ahsarahguide/filter/WebhookFilter.java new file mode 100644 index 0000000..ad929d9 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/filter/WebhookFilter.java @@ -0,0 +1,22 @@ +package com.onixbyte.ahsarahguide.filter; + +import com.onixbyte.ahsarahguide.wrapper.RepeatedlyReadRequestWrapper; +import jakarta.servlet.*; +import jakarta.servlet.http.HttpServletRequest; +import org.springframework.stereotype.Component; + +import java.io.IOException; + +@Component +public class WebhookFilter implements Filter { + @Override + public void doFilter( + ServletRequest request, + ServletResponse response, + FilterChain chain + ) throws IOException, ServletException { + var httpRequest = (HttpServletRequest) request; + var wrappedRequest = new RepeatedlyReadRequestWrapper(httpRequest); + chain.doFilter(wrappedRequest, response); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/interceptor/GitHubWebhookInterceptor.java b/server/src/main/java/com/onixbyte/ahsarahguide/interceptor/GitHubWebhookInterceptor.java new file mode 100644 index 0000000..cf026ea --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/interceptor/GitHubWebhookInterceptor.java @@ -0,0 +1,83 @@ +package com.onixbyte.ahsarahguide.interceptor; + +import com.onixbyte.crypto.util.CryptoUtil; +import com.onixbyte.ahsarahguide.exeption.InternalServerErrorException; +import com.onixbyte.ahsarahguide.exeption.UnauthorisedException; +import com.onixbyte.ahsarahguide.manager.WebhookManager; +import com.onixbyte.ahsarahguide.shared.GitHubWebhookHeader; +import com.onixbyte.ahsarahguide.wrapper.RepeatedlyReadRequestWrapper; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import org.jspecify.annotations.NonNull; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.springframework.web.servlet.HandlerInterceptor; + +import java.nio.charset.StandardCharsets; +import java.security.InvalidKeyException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; + +/** + * Verifies GitHub webhook requests by validating the {@code X-Hub-Signature-256} + * header against the configured secret using HMAC-SHA256. + * + *

Verification is skipped when no secret is configured. The signature format is + * {@code sha256=} as documented by GitHub. + */ +@Component +public class GitHubWebhookInterceptor implements HandlerInterceptor { + + private static final Logger log = LoggerFactory.getLogger(GitHubWebhookInterceptor.class); + + private final WebhookManager webhookManager; + + public GitHubWebhookInterceptor(WebhookManager webhookManager) { + this.webhookManager = webhookManager; + } + + @Override + public boolean preHandle( + @NonNull HttpServletRequest request, + @NonNull HttpServletResponse response, + @NonNull Object handler + ) { + if (!(request instanceof RepeatedlyReadRequestWrapper req)) { + throw new InternalServerErrorException( + "Request body is not readable"); + } + + var secret = webhookManager.secret(); + if (secret == null || secret.isBlank()) { + log.debug("No GitHub webhook secret configured, skipping signature verification"); + return true; + } + + var signatureHeader = req.getHeader(GitHubWebhookHeader.SIGNATURE_256); + if (signatureHeader == null || signatureHeader.isBlank()) { + log.warn("Missing {} header from ip={}", + GitHubWebhookHeader.SIGNATURE_256, request.getRemoteAddr()); + throw new UnauthorisedException( + "Missing webhook signature header"); + } + + var body = req.getBodyString(); + try { + var computed = "sha256=" + CryptoUtil.hmacSha256(body, secret); + + if (!MessageDigest.isEqual( + computed.getBytes(StandardCharsets.UTF_8), + signatureHeader.getBytes(StandardCharsets.UTF_8))) { + log.warn("Invalid webhook signature from ip={}", request.getRemoteAddr()); + throw new UnauthorisedException("Invalid webhook signature"); + } + + return true; + } catch (NoSuchAlgorithmException | InvalidKeyException e) { + log.error("Failed to compute HMAC-SHA256", e); + throw new InternalServerErrorException( + "Failed to verify webhook signature"); + } + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/interceptor/TrafficInterceptor.java b/server/src/main/java/com/onixbyte/ahsarahguide/interceptor/TrafficInterceptor.java new file mode 100644 index 0000000..1f7a655 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/interceptor/TrafficInterceptor.java @@ -0,0 +1,46 @@ +package com.onixbyte.ahsarahguide.interceptor; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import org.jspecify.annotations.NonNull; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.springframework.web.servlet.HandlerInterceptor; + +@Component +public class TrafficInterceptor implements HandlerInterceptor { + + private static final Logger log = LoggerFactory.getLogger(TrafficInterceptor.class); + + @Override + public boolean preHandle( + @NonNull HttpServletRequest request, + @NonNull HttpServletResponse response, + @NonNull Object handler + ) { + var ip = resolveClientIp(request); + var method = request.getMethod(); + var uri = request.getRequestURI(); + var query = request.getQueryString(); + var contentType = request.getContentType(); + var contentLength = request.getContentLength(); + var userAgent = request.getHeader("User-Agent"); + + log.debug("Request method={}, uri={}, query={}, ip={}, content-type={}, content-length={}, user-agent={}", + method, uri, query, ip, contentType, contentLength, userAgent); + return true; + } + + private String resolveClientIp(HttpServletRequest request) { + var xForwardedFor = request.getHeader("X-Forwarded-For"); + if (xForwardedFor != null && !xForwardedFor.isBlank()) { + return xForwardedFor.split(",")[0].trim(); + } + var xRealIp = request.getHeader("X-Real-IP"); + if (xRealIp != null && !xRealIp.isBlank()) { + return xRealIp.trim(); + } + return request.getRemoteAddr(); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/manager/AppManager.java b/server/src/main/java/com/onixbyte/ahsarahguide/manager/AppManager.java new file mode 100644 index 0000000..042932e --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/manager/AppManager.java @@ -0,0 +1,27 @@ +package com.onixbyte.ahsarahguide.manager; + +import com.onixbyte.ahsarahguide.properties.AppProperties; +import org.springframework.stereotype.Component; + +@Component +public class AppManager { + + private final AppProperties appProperties; + + public AppManager(AppProperties appProperties) { + this.appProperties = appProperties; + } + + /** + * Retrieves the application version. + * + * @return the version string of this application + */ + public String getVersion() { + return "v%s-%s by @%s".formatted( + appProperties.version(), + appProperties.channel(), + appProperties.vendor() + ); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/manager/CookieManager.java b/server/src/main/java/com/onixbyte/ahsarahguide/manager/CookieManager.java new file mode 100644 index 0000000..418684e --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/manager/CookieManager.java @@ -0,0 +1,88 @@ +package com.onixbyte.ahsarahguide.manager; + +import com.onixbyte.ahsarahguide.properties.CookieProperties; +import org.springframework.boot.web.server.Cookie; +import org.springframework.http.ResponseCookie; +import org.springframework.stereotype.Component; + +import java.time.Duration; + +/** + * Manager providing cookie construction operations with configurable properties. + * + * @author zihluwang + */ +@Component +public class CookieManager { + + private final CookieProperties cookieProperties; + + public CookieManager(CookieProperties cookieProperties) { + this.cookieProperties = cookieProperties; + } + + public Boolean getHttpOnly() { + return cookieProperties.httpOnly(); + } + + public Boolean getSecure() { + return cookieProperties.secure(); + } + + public Cookie.SameSite getSameSite() { + return cookieProperties.sameSite(); + } + + public String getPath() { + return cookieProperties.path(); + } + + public Duration getMaxAge() { + return cookieProperties.maxAge(); + } + + /** + * Builds a response cookie with the default max age from configuration. + * + * @param cookieName the cookie name + * @param value the cookie value + * @return a configured ResponseCookie + */ + public ResponseCookie buildCookie(String cookieName, String value) { + return buildCookieInternal(cookieName, value, getMaxAge()); + } + + /** + * Builds a response cookie with a custom valid duration. + * + * @param cookieName the cookie name + * @param value the cookie value + * @param validDuration the cookie's max age + * @return a configured ResponseCookie + */ + public ResponseCookie buildCookie(String cookieName, String value, Duration validDuration) { + return buildCookieInternal(cookieName, value, validDuration); + } + + /** + * Creates a response cookie builder with specified name, value and valid duration. + * + * @param name name of the cookie + * @param value value of the cookie + * @param maxAge valid duration of the cookie + * @return cookie builder + */ + protected ResponseCookie buildCookieInternal( + String name, + String value, + Duration maxAge + ) { + return ResponseCookie.from(name, value) + .secure(getSecure()) + .maxAge(maxAge) + .httpOnly(getHttpOnly()) + .path(getPath()) + .sameSite(getSameSite().attributeValue()) + .build(); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/manager/DailyPasswordManager.java b/server/src/main/java/com/onixbyte/ahsarahguide/manager/DailyPasswordManager.java new file mode 100644 index 0000000..064531b --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/manager/DailyPasswordManager.java @@ -0,0 +1,84 @@ +package com.onixbyte.ahsarahguide.manager; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.onixbyte.ahsarahguide.domain.dto.DailyPasswordResponse; +import com.onixbyte.ahsarahguide.exeption.InternalServerErrorException; +import com.onixbyte.ahsarahguide.shared.JacksonModules; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.stereotype.Component; +import org.springframework.web.client.RestClient; + +import java.time.Duration; +import java.time.LocalDate; +import java.util.Objects; + +/** + * Manager for daily password data access and caching coordination. + * + * @author zihluwang + */ +@Component +public class DailyPasswordManager { + + private static final String CACHE_KEY_PREFIX = "daily-password:"; + + private final RestClient restClient; + private final RedisTemplate redisTemplate; + + @Autowired + public DailyPasswordManager( + RestClient.Builder restClientBuilder, + RedisTemplate redisTemplate + ) { + var snakeCaseMapper = new ObjectMapper(); + snakeCaseMapper.setPropertyNamingStrategy( + PropertyNamingStrategies.SnakeCaseStrategy.INSTANCE); + snakeCaseMapper.configure( + DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + snakeCaseMapper.registerModule(JacksonModules.DATE_TIME_MODULE); + + this.restClient = restClientBuilder + .baseUrl("https://tmini.net/api") + .messageConverters(converters -> { + converters.removeIf( + MappingJackson2HttpMessageConverter.class::isInstance); + converters.add( + new MappingJackson2HttpMessageConverter(snakeCaseMapper)); + }) + .build(); + this.redisTemplate = redisTemplate; + } + + /** + * Retrieves the daily password from cache or generates a new one. + * @return the daily password response + */ + public DailyPasswordResponse getDailyPassword() { + var key = CACHE_KEY_PREFIX + LocalDate.now(); + + var cached = redisTemplate.opsForValue().get(key); + if (cached != null) { + return (DailyPasswordResponse) cached; + } + + var response = restClient.get() + .uri((uriBuilder) -> uriBuilder + .path("/sjzmm") + .queryParam("ckey", "") + .queryParam("type", "json") + .build()) + .retrieve() + .body(DailyPasswordResponse.class); + + if (Objects.isNull(response)) { + throw new InternalServerErrorException("暂无每日密码数据。"); + } + + redisTemplate.opsForValue().set(key, response, Duration.ofDays(1L)); + return response; + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/manager/ModificationManager.java b/server/src/main/java/com/onixbyte/ahsarahguide/manager/ModificationManager.java new file mode 100644 index 0000000..f1b058d --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/manager/ModificationManager.java @@ -0,0 +1,140 @@ +package com.onixbyte.ahsarahguide.manager; + +import com.onixbyte.ahsarahguide.domain.entity.Accessory; +import com.onixbyte.ahsarahguide.domain.entity.Firearm; +import com.onixbyte.ahsarahguide.domain.entity.Modification; +import com.onixbyte.ahsarahguide.domain.entity.Tuning; +import com.onixbyte.ahsarahguide.domain.entity.User; +import com.onixbyte.ahsarahguide.domain.dto.AccessoryRequest; +import com.onixbyte.ahsarahguide.domain.dto.ModificationRequest; +import com.onixbyte.ahsarahguide.domain.dto.ModificationResponse; +import com.onixbyte.ahsarahguide.domain.dto.TuningRequest; +import com.onixbyte.ahsarahguide.repository.FirearmRepository; +import com.onixbyte.ahsarahguide.repository.ModificationRepository; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.server.ResponseStatusException; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; + +@Component +public class ModificationManager { + + private final ModificationRepository modificationRepository; + private final FirearmRepository firearmRepository; + + public ModificationManager( + ModificationRepository modificationRepository, + FirearmRepository firearmRepository + ) { + this.modificationRepository = modificationRepository; + this.firearmRepository = firearmRepository; + } + + @Transactional + public ModificationResponse create(ModificationRequest request, User user) { + var firearm = firearmRepository.findById(request.firearmId()) + .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, + "Firearm not found: " + request.firearmId())); + var modification = toEntity(request, firearm, user); + return ModificationResponse.from(modificationRepository.save(modification)); + } + + @Transactional + public List batchCreate(List requests, User user) { + var firearmIds = requests.stream() + .map(ModificationRequest::firearmId) + .collect(java.util.stream.Collectors.toCollection(LinkedHashSet::new)); + + Map firearmMap = new HashMap<>(); + firearmRepository.findAllById(firearmIds) + .forEach(firearm -> firearmMap.put(firearm.getId(), firearm)); + + if (firearmMap.size() != firearmIds.size()) { + var missing = firearmIds.stream() + .filter((id) -> !firearmMap.containsKey(id)) + .toList(); + throw new ResponseStatusException(HttpStatus.NOT_FOUND, + "Firearm not found: " + missing); + } + + var modifications = requests.stream() + .map(req -> toEntity(req, firearmMap.get(req.firearmId()), user)) + .toList(); + return modificationRepository.saveAll(modifications) + .stream() + .map(ModificationResponse::from) + .toList(); + } + + public Long resolveFirearmId(Long firearmId, String firearmName) { + if (firearmId != null) { + return firearmId; + } + if (firearmName == null || firearmName.isBlank()) { + return null; + } + var matches = firearmRepository.findByName(firearmName); + if (matches.isEmpty()) { + throw new ResponseStatusException(HttpStatus.NOT_FOUND, + "Firearm not found by name: " + firearmName); + } + return matches.getFirst().getId(); + } + + private Modification toEntity(ModificationRequest request, Firearm firearm, User user) { + return Modification.builder() + .firearm(firearm) + .name(request.name()) + .code(request.code()) + .tags(request.tags()) + .accessories(toAccessories(request.accessories())) + .note(request.note()) + .author(request.author()) + .videoUrl(request.videoUrl()) + .createBy(user == null ? null : user.getId()) + .build(); + } + + private List toAccessories(List requests) { + if (requests == null) { + return new ArrayList<>(); + } + return requests.stream().map(this::toAccessory).toList(); + } + + private Accessory toAccessory(AccessoryRequest request) { + var accessory = new Accessory(); + accessory.setSlotName(request.slotName()); + accessory.setAccessoryName(request.accessoryName()); + accessory.setTunings(toTunings(request.tunings())); + return accessory; + } + + private List toTunings(List requests) { + if (requests == null) { + return new ArrayList<>(); + } + return requests.stream().map(this::toTuning).toList(); + } + + private Tuning toTuning(TuningRequest request) { + var tuning = new Tuning(); + tuning.setTuningName(request.tuningName()); + tuning.setTuningValue(request.tuningValue()); + return tuning; + } + + @Transactional(readOnly = true) + public Page findBySpec(Specification spec, Pageable pageable) { + return modificationRepository.findAll(spec, pageable); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/manager/UserCredentialManager.java b/server/src/main/java/com/onixbyte/ahsarahguide/manager/UserCredentialManager.java new file mode 100644 index 0000000..4a64370 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/manager/UserCredentialManager.java @@ -0,0 +1,76 @@ +package com.onixbyte.ahsarahguide.manager; + +import com.onixbyte.ahsarahguide.domain.entity.UserCredential; +import com.onixbyte.ahsarahguide.repository.UserCredentialRepository; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Optional; + +/** + * Manager for user credential persistence and authentication data access. + * + * @author zihluwang + */ +@Component +public class UserCredentialManager { + + private final UserCredentialRepository userCredentialRepository; + + public UserCredentialManager(UserCredentialRepository userCredentialRepository) { + this.userCredentialRepository = userCredentialRepository; + } + + /** + * Finds all credentials belonging to a specific user. + * + * @param userId the user ID + * @return list of matching credentials + */ + public List findAllByUserId(Long userId) { + return userCredentialRepository.findAllByUserId(userId); + } + + /** + * Finds a credential for a specific user and provider combination. + * + * @param userId the user ID + * @param provider the authentication provider + * @return the matching credential, if found + */ + public Optional findByUserIdAndProvider(Long userId, String provider) { + return userCredentialRepository.findByUserIdAndProvider(userId, provider); + } + + /** + * Persists a new or updated credential. + * + * @param userCredential the credential to save + * @return the saved credential + */ + public UserCredential save(UserCredential userCredential) { + return userCredentialRepository.save(userCredential); + } + + /** + * Deletes a credential for a specific user and provider. + * + * @param userId the user ID + * @param provider the authentication provider + */ + public void deleteByUserIdAndProvider(Long userId, String provider) { + userCredentialRepository.deleteByUserIdAndProvider(userId, provider); + } + + /** + * Deletes all credentials belonging to a user. + * + * @param userId the user ID + */ + public void deleteAllByUserId(Long userId) { + userCredentialRepository.deleteAllByUserId(userId); + } +} + + + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/manager/UserManager.java b/server/src/main/java/com/onixbyte/ahsarahguide/manager/UserManager.java new file mode 100644 index 0000000..355fe29 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/manager/UserManager.java @@ -0,0 +1,128 @@ +package com.onixbyte.ahsarahguide.manager; + +import com.onixbyte.ahsarahguide.domain.entity.User; +import com.onixbyte.ahsarahguide.domain.entity.UserRole; +import com.onixbyte.ahsarahguide.repository.UserRepository; +import com.onixbyte.ahsarahguide.repository.UserRoleRepository; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Optional; + +/** + * Manager for user entity persistence and query operations. + * + * @author zihluwang + */ +@Component +public class UserManager { + + private final UserRepository userRepository; + private final UserRoleRepository userRoleRepository; + + public UserManager(UserRepository userRepository, UserRoleRepository userRoleRepository) { + this.userRepository = userRepository; + this.userRoleRepository = userRoleRepository; + } + + /** + * Finds a user by their ID. + * + * @param id the user ID + * @return the matching user, if found + */ + public Optional findById(Long id) { + return userRepository.findById(id); + } + + /** + * Retrieves all registered users. + * @return list of all users + */ + public List findAll() { + return userRepository.findAll(); + } + + /** + * Finds a user by their username. + * + * @param username the username to search for + * @return the matching user, if found + */ + public Optional findByUsername(String username) { + return userRepository.findByUsername(username); + } + + @Transactional(readOnly = true) + public Optional findByEmail(String email) { + return userRepository.findByEmail(email); + } + + /** + * Persists a new or updated user. + * + * @param user the user to save + * @return the saved user + */ + public User save(User user) { + return userRepository.save(user); + } + + /** + * Deletes a user by their ID. + * + * @param id the user ID to delete + */ + public void deleteById(Long id) { + userRepository.deleteById(id); + } + + /** + * Finds a user by their username or email address. + * + * @param principal the username or email to search for + * @return the matching user, if found + */ + public Optional findByUsernameOrEmail(String principal) { + return userRepository.findByUsernameOrEmail(principal); + } + + /** + * Checks whether a username is already registered. + * + * @param username the username to check + * @return true if the username is already taken + */ + public boolean existsByUsername(String username) { + return userRepository.existsByUsername(username); + } + + /** + * Checks whether an email address is already registered. + * + * @param email the email address to check + * @return true if the email address is already taken + */ + public boolean existsByEmail(String email) { + return userRepository.existsByEmail(email); + } + + /** + * Persists a new user together with an initial role assignment in a single transaction. + * + * @param user the user to persist, whose credentials are cascaded + * @param role the initial role name to assign + * @return the saved user + */ + @Transactional + public User createWithRole(User user, String role) { + var saved = userRepository.save(user); + userRoleRepository.save(UserRole.builder() + .user(saved) + .role(role) + .build()); + return saved; + } +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/manager/UserRoleManager.java b/server/src/main/java/com/onixbyte/ahsarahguide/manager/UserRoleManager.java new file mode 100644 index 0000000..9639e2f --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/manager/UserRoleManager.java @@ -0,0 +1,72 @@ +package com.onixbyte.ahsarahguide.manager; + +import com.onixbyte.ahsarahguide.domain.entity.UserRole; +import com.onixbyte.ahsarahguide.repository.UserRoleRepository; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * Manager for user role persistence and authorisation data access. + * + * @author zihluwang + */ +@Component +public class UserRoleManager { + + private final UserRoleRepository userRoleRepository; + + public UserRoleManager(UserRoleRepository userRoleRepository) { + this.userRoleRepository = userRoleRepository; + } + + /** + * Finds all role assignments for a specific user. + * + * @param userId the user ID + * @return list of matching role assignments + */ + public List findAllByUserId(Long userId) { + return userRoleRepository.findAllByUserId(userId); + } + + /** + * Checks whether a user has a specific role. + * + * @param userId the user ID + * @param role the role name + * @return true if the role is assigned, false otherwise + */ + public boolean existsByUserIdAndRole(Long userId, String role) { + return userRoleRepository.existsByUserIdAndRole(userId, role); + } + + /** + * Persists a new role assignment. + * + * @param userRole the role assignment to save + * @return the saved role assignment + */ + public UserRole save(UserRole userRole) { + return userRoleRepository.save(userRole); + } + + /** + * Deletes a role assignment for a specific user and role. + * + * @param userId the user ID + * @param role the role name + */ + public void deleteByUserIdAndRole(Long userId, String role) { + userRoleRepository.deleteByUserIdAndRole(userId, role); + } + + /** + * Deletes all role assignments belonging to a user. + * + * @param userId the user ID + */ + public void deleteAllByUserId(Long userId) { + userRoleRepository.deleteAllByUserId(userId); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/manager/WebhookManager.java b/server/src/main/java/com/onixbyte/ahsarahguide/manager/WebhookManager.java new file mode 100644 index 0000000..6034ecb --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/manager/WebhookManager.java @@ -0,0 +1,24 @@ +package com.onixbyte.ahsarahguide.manager; + +import com.onixbyte.ahsarahguide.properties.GitHubWebhookProperties; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +public class WebhookManager { + + private final GitHubWebhookProperties gitHubWebhookProperties; + + public WebhookManager(GitHubWebhookProperties gitHubWebhookProperties) { + this.gitHubWebhookProperties = gitHubWebhookProperties; + } + + public String secret() { + return gitHubWebhookProperties.secret(); + } + + public List allowedUsers() { + return gitHubWebhookProperties.allowedUsers(); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/properties/AppProperties.java b/server/src/main/java/com/onixbyte/ahsarahguide/properties/AppProperties.java new file mode 100644 index 0000000..31b81fd --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/properties/AppProperties.java @@ -0,0 +1,11 @@ +package com.onixbyte.ahsarahguide.properties; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +@ConfigurationProperties(prefix = "app.common") +public record AppProperties( + String version, + String channel, + String vendor +) { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/properties/CookieProperties.java b/server/src/main/java/com/onixbyte/ahsarahguide/properties/CookieProperties.java new file mode 100644 index 0000000..2dfe7c2 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/properties/CookieProperties.java @@ -0,0 +1,27 @@ +package com.onixbyte.ahsarahguide.properties; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.bind.DefaultValue; +import org.springframework.boot.web.server.Cookie; + +import java.time.Duration; + +/** + * Configuration properties for HTTP cookies used in authentication, prefixed with "app.cookie". + * + * @param httpOnly whether the cookie is httpOnly + * @param secure whether the cookie is secure + * @param path the cookie path + * @param maxAge the maximum age of the cookie + * @param sameSite the SameSite policy for the cookie + * @author zihluwang + */ +@ConfigurationProperties(prefix = "app.cookie") +public record CookieProperties( + @DefaultValue("true") Boolean httpOnly, + @DefaultValue("true") Boolean secure, + @DefaultValue("/") String path, + @DefaultValue("PT2H") Duration maxAge, + @DefaultValue("LAX") Cookie.SameSite sameSite +) { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/properties/CorsProperties.java b/server/src/main/java/com/onixbyte/ahsarahguide/properties/CorsProperties.java new file mode 100644 index 0000000..d79c06a --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/properties/CorsProperties.java @@ -0,0 +1,36 @@ +package com.onixbyte.ahsarahguide.properties; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.bind.DefaultValue; +import org.springframework.http.HttpMethod; + +import java.time.Duration; + +/** + * Configuration properties for CORS settings, prefixed with "app.cors". + * + * @param allowedHeaders headers allowed in CORS requests + * @param allowedMethods HTTP methods allowed in CORS requests + * @param allowedOrigins origins permitted to make cross-origin requests + * @param allowCredentials whether credentials are allowed in CORS requests + * @param allowPrivateNetwork whether private network access is permitted + * @param maxAge how long the CORS preflight response may be cached + * @param exposedHeaders headers exposed to the client in CORS responses + * @author zihluwang + */ +@ConfigurationProperties(prefix = "app.cors") +public record CorsProperties( + @DefaultValue({"Content-Type", "Authorization"}) + String[] allowedHeaders, + @DefaultValue({"GET", "POST", "PUT", "PATCH", "DELETE"}) + HttpMethod[] allowedMethods, + String[] allowedOrigins, + boolean allowCredentials, + boolean allowPrivateNetwork, + @DefaultValue("PT2H") + Duration maxAge, + @DefaultValue({"Content-Type", "Authorization"}) + String[] exposedHeaders +) { +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/properties/GitHubWebhookProperties.java b/server/src/main/java/com/onixbyte/ahsarahguide/properties/GitHubWebhookProperties.java new file mode 100644 index 0000000..631653c --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/properties/GitHubWebhookProperties.java @@ -0,0 +1,12 @@ +package com.onixbyte.ahsarahguide.properties; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +import java.util.List; + +@ConfigurationProperties(prefix = "app.webhook.github") +public record GitHubWebhookProperties( + String secret, + List allowedUsers +) { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/properties/TokenProperties.java b/server/src/main/java/com/onixbyte/ahsarahguide/properties/TokenProperties.java new file mode 100644 index 0000000..70588fb --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/properties/TokenProperties.java @@ -0,0 +1,23 @@ +package com.onixbyte.ahsarahguide.properties; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.bind.DefaultValue; + +import java.time.Duration; + +/** + * Configuration properties for JWT token generation and validation, prefixed with "app.jwt". + * + * @param issuer the JWT issuer claim + * @param secret the signing secret for JWT tokens + * @param validTime the duration for which a token remains valid + * @author zihluwang + */ +@ConfigurationProperties(prefix = "app.jwt") +public record TokenProperties( + String issuer, + String secret, + @DefaultValue("PT2H") Duration validTime, + @DefaultValue("PT5M") Duration renewThreshold +) { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/repository/FirearmRepository.java b/server/src/main/java/com/onixbyte/ahsarahguide/repository/FirearmRepository.java new file mode 100644 index 0000000..d4652c4 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/repository/FirearmRepository.java @@ -0,0 +1,25 @@ +package com.onixbyte.ahsarahguide.repository; + +import com.onixbyte.ahsarahguide.domain.entity.Firearm; +import com.onixbyte.ahsarahguide.enumeration.FirearmType; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * Spring Data JPA repository for {@link Firearm} entity operations. + * + * @author zihluwang + */ +@Repository +public interface FirearmRepository extends JpaRepository, JpaSpecificationExecutor { + + Page findAllByType(FirearmType type, Pageable pageable); + + List findByName(String name); +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/repository/ModificationRepository.java b/server/src/main/java/com/onixbyte/ahsarahguide/repository/ModificationRepository.java new file mode 100644 index 0000000..b13d3f6 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/repository/ModificationRepository.java @@ -0,0 +1,45 @@ +package com.onixbyte.ahsarahguide.repository; + +import com.onixbyte.ahsarahguide.domain.entity.Modification; +import org.jspecify.annotations.NonNull; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.data.jpa.repository.EntityGraph; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Optional; + +/** + * Spring Data JPA repository for {@link Modification} entity operations, + * including JSONB tag filtering for Postgres via the specification API. + * + * @author zihluwang + */ +@Repository +public interface ModificationRepository extends JpaRepository, JpaSpecificationExecutor { + + @Override + @EntityGraph(attributePaths = {"firearm"}) + @NonNull + Page findAll(Specification spec, @NonNull Pageable pageable); + + @Override + @EntityGraph(attributePaths = {"firearm"}) + @NonNull + Optional findById(@NonNull Long id); + + /** + * Retrieve all distinct tag values from modifications, optionally filtered by firearm. + * + * @param firearmId optional firearm ID filter (nullable) + * @return list of distinct tag strings + */ + @Query(value = "SELECT DISTINCT jsonb_array_elements_text(cast(tags as jsonb)) FROM modification WHERE (:firearmId IS NULL OR firearm_id = :firearmId)", nativeQuery = true) + List findAllTags(@Param("firearmId") Long firearmId); +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/repository/UserCredentialRepository.java b/server/src/main/java/com/onixbyte/ahsarahguide/repository/UserCredentialRepository.java new file mode 100644 index 0000000..594fa8b --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/repository/UserCredentialRepository.java @@ -0,0 +1,80 @@ +package com.onixbyte.ahsarahguide.repository; + +import com.onixbyte.ahsarahguide.domain.entity.UserCredential; +import com.onixbyte.ahsarahguide.domain.entity.UserCredentialId; +import org.springframework.data.jpa.repository.*; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Optional; + +/** + * Spring Data JPA repository for {@link UserCredential} entity operations. + * + * @author zihluwang + */ +@Repository +public interface UserCredentialRepository extends + JpaRepository, + JpaSpecificationExecutor { + + /** + * Find all credentials belonging to a given user. + * + * @param userId the user ID + * @return list of matching credentials + */ + @EntityGraph(attributePaths = {"user"}) + @Query(""" + select uc + from UserCredential uc + where uc.user.id = :userId + """) + List findAllByUserId(@Param("userId") Long userId); + + /** + * Find a specific credential for a user by provider. + * + * @param userId the user ID + * @param provider the authentication provider identifier + * @return an optional containing the matching credential, or empty if not found + */ + @EntityGraph(attributePaths = {"user"}) + @Query(""" + select uc + from UserCredential uc + where uc.user.id = :userId + and uc.id.provider = :provider + """) + Optional findByUserIdAndProvider(@Param("userId") Long userId, @Param("provider") String provider); + + /** + * Delete a specific credential for a user by provider. + * + * @param userId the user ID + * @param provider the authentication provider identifier + */ + @Modifying + @Query(""" + delete from UserCredential uc + where uc.user.id = :userId + and uc.id.provider = :provider + """) + void deleteByUserIdAndProvider(@Param("userId") Long userId, @Param("provider") String provider); + + /** + * Delete all credentials for a given user. + * + * @param userId the user ID + */ + @Modifying + @Query(""" + delete from UserCredential uc + where uc.user.id = :userId + """) + void deleteAllByUserId(@Param("userId") Long userId); +} + + + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/repository/UserRepository.java b/server/src/main/java/com/onixbyte/ahsarahguide/repository/UserRepository.java new file mode 100644 index 0000000..f35e037 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/repository/UserRepository.java @@ -0,0 +1,52 @@ +package com.onixbyte.ahsarahguide.repository; + +import com.onixbyte.ahsarahguide.domain.entity.User; +import org.jspecify.annotations.NonNull; +import org.springframework.data.jpa.repository.EntityGraph; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; + +import java.util.Optional; + +/** + * Spring Data JPA repository for {@link User} entity operations. + * + * @author zihluwang + */ +@Repository +public interface UserRepository extends JpaRepository, JpaSpecificationExecutor { + + @Override + @EntityGraph(attributePaths = {"credentials"}) + @NonNull + Optional findById(@NonNull Long id); + + @EntityGraph(attributePaths = {"credentials"}) + Optional findByUsername(String username); + + @EntityGraph(attributePaths = {"credentials"}) + Optional findByEmail(String email); + + boolean existsByUsername(String username); + + boolean existsByEmail(String email); + + /** + * Find a user by either username or email. + * + * @param principal the username or email to search for + * @return an optional containing the matching user, or empty if not found + */ + @EntityGraph(attributePaths = {"credentials"}) + @Query(""" + select u + from User u + where u.username = :principal + or u.email = :principal + """) + Optional findByUsernameOrEmail(@Param("principal") String principal); +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/repository/UserRoleRepository.java b/server/src/main/java/com/onixbyte/ahsarahguide/repository/UserRoleRepository.java new file mode 100644 index 0000000..58125d2 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/repository/UserRoleRepository.java @@ -0,0 +1,72 @@ +package com.onixbyte.ahsarahguide.repository; + +import com.onixbyte.ahsarahguide.domain.entity.UserRole; +import org.springframework.data.jpa.repository.*; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * Spring Data JPA repository for {@link UserRole} entity operations. + * + * @author zihluwang + */ +@Repository +public interface UserRoleRepository extends JpaRepository, JpaSpecificationExecutor { + + /** + * Find all roles assigned to a given user. + * + * @param userId the user ID + * @return list of matching role assignments + */ + @EntityGraph(attributePaths = {"user"}) + @Query(""" + select ur + from UserRole ur + where ur.user.id = :userId + """) + List findAllByUserId(@Param("userId") Long userId); + + /** + * Check whether a user has a specific role. + * + * @param userId the user ID + * @param role the role name + * @return true if the role is assigned, false otherwise + */ + @Query(""" + select count(ur) > 0 + from UserRole ur + where ur.user.id = :userId + and ur.role = :role + """) + boolean existsByUserIdAndRole(@Param("userId") Long userId, @Param("role") String role); + + /** + * Delete a specific role assignment for a user. + * + * @param userId the user ID + * @param role the role name + */ + @Modifying + @Query(""" + delete from UserRole ur + where ur.user.id = :userId + and ur.role = :role + """) + void deleteByUserIdAndRole(@Param("userId") Long userId, @Param("role") String role); + + /** + * Delete all role assignments for a given user. + * + * @param userId the user ID + */ + @Modifying + @Query(""" + delete from UserRole ur + where ur.user.id = :userId + """) + void deleteAllByUserId(@Param("userId") Long userId); +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/security/annotation/RequiresAdmin.java b/server/src/main/java/com/onixbyte/ahsarahguide/security/annotation/RequiresAdmin.java new file mode 100644 index 0000000..a693d95 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/security/annotation/RequiresAdmin.java @@ -0,0 +1,14 @@ +package com.onixbyte.ahsarahguide.security.annotation; + +import org.springframework.security.access.prepost.PreAuthorize; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.METHOD, ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@PreAuthorize("isAuthenticated() && hasAnyRole('ADMIN', 'SUPER_USER')") +public @interface RequiresAdmin { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/security/annotation/RequiresAuth.java b/server/src/main/java/com/onixbyte/ahsarahguide/security/annotation/RequiresAuth.java new file mode 100644 index 0000000..fe1321a --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/security/annotation/RequiresAuth.java @@ -0,0 +1,19 @@ +package com.onixbyte.ahsarahguide.security.annotation; + +import org.springframework.security.access.prepost.PreAuthorize; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Annotation to mark controller endpoints that require authentication. + * + * @author zihluwang + */ +@Target({ElementType.METHOD, ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@PreAuthorize("isAuthenticated()") +public @interface RequiresAuth { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/security/annotation/RequiresSuperUser.java b/server/src/main/java/com/onixbyte/ahsarahguide/security/annotation/RequiresSuperUser.java new file mode 100644 index 0000000..79417d3 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/security/annotation/RequiresSuperUser.java @@ -0,0 +1,14 @@ +package com.onixbyte.ahsarahguide.security.annotation; + +import org.springframework.security.access.prepost.PreAuthorize; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.METHOD, ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@PreAuthorize("isAuthenticated() && hasRole('SUPER_USER')") +public @interface RequiresSuperUser { +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/security/authentication/UsernamePasswordAuthentication.java b/server/src/main/java/com/onixbyte/ahsarahguide/security/authentication/UsernamePasswordAuthentication.java new file mode 100644 index 0000000..408a1d3 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/security/authentication/UsernamePasswordAuthentication.java @@ -0,0 +1,101 @@ +package com.onixbyte.ahsarahguide.security.authentication; + +import com.onixbyte.ahsarahguide.domain.entity.User; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.CredentialsContainer; +import org.springframework.security.core.GrantedAuthority; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +/** + * Custom authentication token for username/password-based login flows. + * + * @author zihluwang + */ +public class UsernamePasswordAuthentication implements Authentication, CredentialsContainer { + private final String username; + private String password; + private boolean authenticated; + private User user; + private Collection authorities; + + private UsernamePasswordAuthentication( + String username, + String password, + boolean authenticated, + User user, + Collection authorities + ) { + this.username = username; + this.password = password; + this.authenticated = authenticated; + this.user = user; + this.authorities = authorities == null ? List.of() : new ArrayList<>(authorities); + } + + public static UsernamePasswordAuthentication unauthenticated(String username, String password) { + return new UsernamePasswordAuthentication(username, password, false, null, List.of()); + } + + public static UsernamePasswordAuthentication authenticated(User user) { + return new UsernamePasswordAuthentication(user.getUsername(), null, true, user, List.of()); + } + + public static UsernamePasswordAuthentication authenticated( + User user, + Collection authorities + ) { + return new UsernamePasswordAuthentication(user.getUsername(), null, true, user, authorities); + } + + @Override + public Collection getAuthorities() { + return authorities; + } + + @Override + public String getCredentials() { + return password; + } + + @Override + public User getDetails() { + return user; + } + + @Override + public String getPrincipal() { + return username; + } + + @Override + public boolean isAuthenticated() { + return authenticated; + } + + @Override + public void setAuthenticated(boolean authenticated) throws IllegalArgumentException { + this.authenticated = authenticated; + } + + @Override + public String getName() { + return username; + } + + @Override + public void eraseCredentials() { + this.password = null; + } + + public void setDetails(User user) { + this.user = user; + } + + public void setAuthorities(Collection authorities) { + this.authorities = new ArrayList<>(authorities); + } +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/security/provider/UsernamePasswordAuthenticationProvider.java b/server/src/main/java/com/onixbyte/ahsarahguide/security/provider/UsernamePasswordAuthenticationProvider.java new file mode 100644 index 0000000..6dae404 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/security/provider/UsernamePasswordAuthenticationProvider.java @@ -0,0 +1,117 @@ +package com.onixbyte.ahsarahguide.security.provider; + +import com.onixbyte.ahsarahguide.domain.entity.UserCredentialId; +import com.onixbyte.ahsarahguide.domain.entity.UserRole; +import com.onixbyte.ahsarahguide.exeption.InternalServerErrorException; +import com.onixbyte.ahsarahguide.exeption.UnauthorisedException; +import com.onixbyte.ahsarahguide.manager.UserManager; +import com.onixbyte.ahsarahguide.repository.UserCredentialRepository; +import com.onixbyte.ahsarahguide.repository.UserRoleRepository; +import com.onixbyte.ahsarahguide.security.authentication.UsernamePasswordAuthentication; +import com.onixbyte.ahsarahguide.shared.CredentialProvider; +import com.onixbyte.ahsarahguide.shared.Role; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.authentication.AuthenticationProvider; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * Authentication provider that validates username/password credentials against stored BCrypt hashes. + * + * @author zihluwang + */ +@Component +public class UsernamePasswordAuthenticationProvider implements AuthenticationProvider { + + private static final Logger log = LoggerFactory.getLogger(UsernamePasswordAuthenticationProvider.class); + private final UserManager userManager; + private final PasswordEncoder passwordEncoder; + private final UserCredentialRepository userCredentialRepository; + private final UserRoleRepository userRoleRepository; + + @Autowired + public UsernamePasswordAuthenticationProvider( + UserManager userManager, + PasswordEncoder passwordEncoder, + UserCredentialRepository userCredentialRepository, + UserRoleRepository userRoleRepository) { + this.userManager = userManager; + this.passwordEncoder = passwordEncoder; + this.userCredentialRepository = userCredentialRepository; + this.userRoleRepository = userRoleRepository; + } + + /** + * Validates the username/password credentials against stored BCrypt hashes. + * + * @param authentication the authentication request object + * @return a fully authenticated object including user details + */ + @Override + public Authentication authenticate(Authentication authentication) throws AuthenticationException { + if (!(authentication instanceof UsernamePasswordAuthentication usernamePasswordAuthentication)) { + throw new InternalServerErrorException("用户认证失败,请稍后再试。"); + } + + // get userContainer from database + var userContainer = userManager.findByUsernameOrEmail(usernamePasswordAuthentication.getPrincipal()); + if (userContainer.isEmpty()) { + log.error("User {} is trying to authenticate but no userContainer found.", usernamePasswordAuthentication.getPrincipal()); + throw new UnauthorisedException("用户名或密码错误。"); + } + + var user = userContainer.get(); + + var userCredentialId = UserCredentialId.builder() + .provider(CredentialProvider.LOCAL) + .userId(user.getId()) + .build(); + + // get userContainer credentials from database + var userCredentials = userCredentialRepository.findOne((root, query, cb) -> cb.equal(root.get("id"), userCredentialId)) + .orElseThrow(() -> new UnauthorisedException("您还没有配置密码,请联系管理员处理。")); + + // validate password + if (!passwordEncoder.matches(usernamePasswordAuthentication.getCredentials(), userCredentials.getCredential())) { + log.error("User {} is trying to authenticate but password is incorrect.", usernamePasswordAuthentication.getPrincipal()); + throw new UnauthorisedException("用户名或密码错误。"); + } + + var role = userRoleRepository.findOne((root, query, cb) -> cb.equal(root.get("userId"), user.getId())) + .orElseGet(() -> { + var ur = new UserRole(); + ur.setUserId(user.getId()); + ur.setRole(Role.ROLE_USER); + return ur; + }); + + // erase credentials + usernamePasswordAuthentication.eraseCredentials(); + + // set values + usernamePasswordAuthentication.setAuthenticated(true); + usernamePasswordAuthentication.setDetails(user); + usernamePasswordAuthentication.setAuthorities(List.of(new SimpleGrantedAuthority(role.getRole()))); + + return usernamePasswordAuthentication; + } + + /** + * Checks if this provider supports the given authentication type. + * + * @param authentication the authentication class to check + * @return true if this provider supports the given type + */ + @Override + public boolean supports(Class authentication) { + return UsernamePasswordAuthentication.class.isAssignableFrom(authentication); + } +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/security/resolver/CurrentUser.java b/server/src/main/java/com/onixbyte/ahsarahguide/security/resolver/CurrentUser.java new file mode 100644 index 0000000..fe16aac --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/security/resolver/CurrentUser.java @@ -0,0 +1,22 @@ +package com.onixbyte.ahsarahguide.security.resolver; + +import io.swagger.v3.oas.annotations.Parameter; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Annotation for injecting the currently authenticated {@code User} into controller method + * parameters. The resolver extracts the user from the {@code SecurityContext}. + *

+ * Marked hidden so it is not rendered as a request parameter in the OpenAPI documentation, + * as the value is injected server-side rather than supplied by the client. + * + * @author zihluwang + */ +@Parameter(hidden = true) +@Target(ElementType.PARAMETER) +@Retention(RetentionPolicy.RUNTIME) +public @interface CurrentUser {} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/security/resolver/CurrentUserArgumentResolver.java b/server/src/main/java/com/onixbyte/ahsarahguide/security/resolver/CurrentUserArgumentResolver.java new file mode 100644 index 0000000..ec1928e --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/security/resolver/CurrentUserArgumentResolver.java @@ -0,0 +1,45 @@ +package com.onixbyte.ahsarahguide.security.resolver; + +import com.onixbyte.ahsarahguide.domain.entity.User; +import com.onixbyte.ahsarahguide.security.authentication.UsernamePasswordAuthentication; +import org.jspecify.annotations.NonNull; +import org.springframework.core.MethodParameter; +import org.springframework.http.HttpStatus; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.support.WebDataBinderFactory; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.method.support.HandlerMethodArgumentResolver; +import org.springframework.web.method.support.ModelAndViewContainer; +import org.springframework.web.server.ResponseStatusException; + +/** + * Resolves {@link CurrentUser}-annotated controller method parameters by extracting the + * {@link User} entity from the current {@link UsernamePasswordAuthentication} in the + * security context. + * + * @author zihluwang + */ +@Component +public class CurrentUserArgumentResolver implements HandlerMethodArgumentResolver { + + @Override + public boolean supportsParameter(MethodParameter parameter) { + return parameter.hasParameterAnnotation(CurrentUser.class) + && parameter.getParameterType().equals(User.class); + } + + @Override + public User resolveArgument( + @NonNull MethodParameter parameter, + ModelAndViewContainer mavContainer, + @NonNull NativeWebRequest webRequest, + WebDataBinderFactory binderFactory + ) { + var auth = SecurityContextHolder.getContext().getAuthentication(); + if (auth instanceof UsernamePasswordAuthentication upa && upa.isAuthenticated()) { + return upa.getDetails(); + } + throw new ResponseStatusException(HttpStatus.UNAUTHORIZED, "请先登录"); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/service/AppService.java b/server/src/main/java/com/onixbyte/ahsarahguide/service/AppService.java new file mode 100644 index 0000000..aed162c --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/service/AppService.java @@ -0,0 +1,18 @@ +package com.onixbyte.ahsarahguide.service; + +import com.onixbyte.ahsarahguide.manager.AppManager; +import org.springframework.stereotype.Service; + +@Service +public class AppService { + + private final AppManager appManager; + + public AppService(AppManager appManager) { + this.appManager = appManager; + } + + public String getVersion() { + return appManager.getVersion(); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/service/AuthService.java b/server/src/main/java/com/onixbyte/ahsarahguide/service/AuthService.java new file mode 100644 index 0000000..9a3dde1 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/service/AuthService.java @@ -0,0 +1,215 @@ +package com.onixbyte.ahsarahguide.service; + +import com.onixbyte.captcha.text.TextProducer; +import com.onixbyte.ahsarahguide.client.EmailClient; +import com.onixbyte.ahsarahguide.client.TokenClient; +import com.onixbyte.ahsarahguide.domain.dto.EmailVerificationCode; +import com.onixbyte.ahsarahguide.domain.dto.LoginRequest; +import com.onixbyte.ahsarahguide.domain.dto.RegisterRequest; +import com.onixbyte.ahsarahguide.domain.dto.SendVerificationCodeRequest; +import com.onixbyte.ahsarahguide.domain.dto.UserResponse; +import com.onixbyte.ahsarahguide.domain.entity.User; +import com.onixbyte.ahsarahguide.domain.entity.UserCredential; +import com.onixbyte.ahsarahguide.exeption.BadRequestException; +import com.onixbyte.ahsarahguide.exeption.ConflictException; +import com.onixbyte.ahsarahguide.exeption.InternalServerErrorException; +import com.onixbyte.ahsarahguide.manager.CookieManager; +import com.onixbyte.ahsarahguide.manager.UserManager; +import com.onixbyte.ahsarahguide.security.authentication.UsernamePasswordAuthentication; +import com.onixbyte.ahsarahguide.shared.CookieName; +import com.onixbyte.ahsarahguide.shared.CredentialProvider; +import com.onixbyte.ahsarahguide.shared.Role; +import org.jspecify.annotations.NonNull; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.cache.CacheManager; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.http.HttpCookie; +import org.springframework.http.HttpHeaders; +import org.springframework.http.ResponseEntity; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.stereotype.Service; + +import java.time.Duration; +import java.time.LocalDateTime; +import java.util.UUID; + +/** + * Service handling user authentication, login, and session management. + * + * @author zihluwang + */ +@Service +public class AuthService { + + private static final Logger log = LoggerFactory.getLogger(AuthService.class); + private final AuthenticationManager authenticationManager; + private final TokenClient tokenClient; + private final CookieManager cookieManager; + private final UserManager userManager; + private final PasswordEncoder passwordEncoder; + private final TextProducer textProducer; + private final CacheManager cacheManager; + private final RedisTemplate redisTemplate; + private final EmailClient emailClient; + + public AuthService( + AuthenticationManager authenticationManager, + TokenClient tokenClient, + CookieManager cookieManager, + UserManager userManager, + PasswordEncoder passwordEncoder, + TextProducer textProducer, + CacheManager cacheManager, + RedisTemplate redisTemplate, + EmailClient emailClient + ) { + this.authenticationManager = authenticationManager; + this.tokenClient = tokenClient; + this.cookieManager = cookieManager; + this.userManager = userManager; + this.passwordEncoder = passwordEncoder; + this.textProducer = textProducer; + this.cacheManager = cacheManager; + this.redisTemplate = redisTemplate; + this.emailClient = emailClient; + } + + /** + * Authenticates a user with the given login credentials. + *

+ * Delegates authentication to Spring Security's {@link AuthenticationManager} and verifies + * that the result is of the expected {@link UsernamePasswordAuthentication} type. + * + * @param request the login credentials containing principle and password + * @return the authenticated {@link User} + */ + public User login(LoginRequest request) { + var _authentication = authenticationManager.authenticate(UsernamePasswordAuthentication + .unauthenticated(request.principle(), request.credential())); + if (!(_authentication instanceof UsernamePasswordAuthentication authentication)) { + log.error( + "Type mismatched, required type is UsernamePasswordAuthentication but got {}.", + _authentication.getClass() + ); + throw new InternalServerErrorException("登录服务异常,请稍后再试。"); + } + + return authentication.getDetails(); + } + + /** + * Registers a new user account with the LOCAL password provider and the default USER role. + * + * @param request the registration information + * @return the newly created {@link User} + */ + public User register(RegisterRequest request) { + var username = request.username().trim(); + var email = request.email().trim(); + + if (userManager.existsByUsername(username)) { + throw new BadRequestException("用户名已被注册。"); + } + if (userManager.existsByEmail(email)) { + throw new BadRequestException("该邮箱已被注册。"); + } + + var code = request.verificationCode(); + var verificationCodeId = request.verificationCodeId(); + + var _req = redisTemplate.opsForValue().get("verification-code:" + verificationCodeId); + if (!(_req instanceof EmailVerificationCode verificationCode)) { + log.error("_req not a EmailVerificationCode, storedCode={}", _req); + throw new InternalServerErrorException("系统内部错误,请重试"); + } + + if (!request.username().equals(verificationCode.username()) + || !request.email().equals(verificationCode.email())) { + log.error( + "Username and email address do not match the data submitted " + + "when requesting the verification code." + ); + log.error("EmailVerificationCode={}", verificationCode); + log.error("RegisterRequest={}", request); + throw new BadRequestException("用户名或邮箱与获取验证码时不一致,请重新获取验证码。"); + } + + if (!code.equalsIgnoreCase(verificationCode.code())) { + throw new BadRequestException("邮箱验证码不正确,请重试。"); + } + + var now = LocalDateTime.now(); + var user = User.builder() + .username(username) + .email(email) + .nickname(request.nickname()) + .avatarUrl(request.avatarUrl()) + .createdAt(now) + .updatedAt(now) + .build(); + var credential = UserCredential.builder() + .provider(CredentialProvider.LOCAL) + .credential(passwordEncoder.encode(request.password())) + .build(); + user.addCredential(credential); + + return userManager.createWithRole(user, Role.ROLE_USER); + } + + @NonNull + public ResponseEntity getUserResponseResponseEntity(User user) { + var currentTime = LocalDateTime.now(); + var accessToken = tokenClient.generateToken(user); + var accessTokenCookie = cookieManager.buildCookie(CookieName.ACCESS_TOKEN, accessToken); + var cookieMaxAge = accessTokenCookie.getMaxAge(); + + return ResponseEntity.ok() + .header(HttpHeaders.SET_COOKIE, accessTokenCookie.toString()) + .body(UserResponse.from(user, currentTime.plus(cookieMaxAge))); + } + + public HttpCookie logout() { + return cookieManager.buildCookie(CookieName.ACCESS_TOKEN, "", Duration.ZERO); + } + + /** + * Generates and dispatches a verification code to the given email address. + *

+ * The code is cached under the returned UUID for 10 minutes and emailed + * asynchronously to the recipient. The UUID must be supplied back to the + * server when verifying the code. + * + * @param request the verification code request containing the target username and email + * @return the UUID identifying the verification record, to be used when verifying the code + * @throws ConflictException if the username or email is already registered + */ + public String sendVerificationCode(SendVerificationCodeRequest request) { + // Check username. + if (userManager.existsByUsername(request.username())) { + throw new ConflictException("用户名【" + request.username() + "】已被使用。"); + } + + // Check email address. + if (userManager.existsByEmail(request.email())) { + throw new ConflictException("邮箱地址【" + request.email() + "】已被使用。"); + } + + // Generate UUID and verification code. + var uuid = UUID.randomUUID().toString().replace("-", ""); + var code = textProducer.getText(); + + // Save verification code to cache. + redisTemplate.opsForValue().set( + "verification-code:" + uuid, + new EmailVerificationCode(request.username(), request.email(), code), + Duration.ofMinutes(10L) + ); + + // Send email. + emailClient.sendVerificationCode(request.email(), request.username(), code, 10); + + return uuid; + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/service/DailyPasswordService.java b/server/src/main/java/com/onixbyte/ahsarahguide/service/DailyPasswordService.java new file mode 100644 index 0000000..16b9e9f --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/service/DailyPasswordService.java @@ -0,0 +1,28 @@ +package com.onixbyte.ahsarahguide.service; + +import com.onixbyte.ahsarahguide.domain.dto.DailyPasswordResponse; +import com.onixbyte.ahsarahguide.manager.DailyPasswordManager; +import org.springframework.stereotype.Service; + +/** + * Service for generating and caching daily rotation passwords. + * + * @author zihluwang + */ +@Service +public class DailyPasswordService { + + private final DailyPasswordManager dailyPasswordManager; + + public DailyPasswordService(DailyPasswordManager dailyPasswordManager) { + this.dailyPasswordManager = dailyPasswordManager; + } + + /** + * Retrieves the daily password for the current day. + * @return the daily password response + */ + public DailyPasswordResponse getDailyPassword() { + return dailyPasswordManager.getDailyPassword(); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/service/FirearmService.java b/server/src/main/java/com/onixbyte/ahsarahguide/service/FirearmService.java new file mode 100644 index 0000000..7a94ae9 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/service/FirearmService.java @@ -0,0 +1,111 @@ +package com.onixbyte.ahsarahguide.service; + +import com.onixbyte.ahsarahguide.domain.dto.FirearmRequest; +import com.onixbyte.ahsarahguide.domain.dto.FirearmResponse; +import com.onixbyte.ahsarahguide.domain.dto.PageResponse; +import com.onixbyte.ahsarahguide.domain.entity.Firearm; +import com.onixbyte.ahsarahguide.enumeration.FirearmType; +import com.onixbyte.ahsarahguide.exeption.NotFoundException; +import com.onixbyte.ahsarahguide.repository.FirearmRepository; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Service; +import org.springframework.web.server.ResponseStatusException; + +/** + * Service handling firearm business logic including CRUD operations and queries. + * + * @author zihluwang + */ +@Service +public class FirearmService { + + private final FirearmRepository firearmRepository; + + public FirearmService(FirearmRepository firearmRepository) { + this.firearmRepository = firearmRepository; + } + + /** + * Queries firearms with optional type filter and pagination. + * + * @param type optional firearm type filter + * @param pageable pagination parameters + * @return a paginated response of firearm records + */ + public PageResponse pageQuery(FirearmType type, Pageable pageable) { + Page page = type == null + ? firearmRepository.findAll(pageable) + : firearmRepository.findAllByType(type, pageable); + + return PageResponse.from(page.map(FirearmResponse::from)); + } + + /** + * Finds a firearm by its ID. + * + * @param id the firearm ID + * @return the firearm response + */ + public FirearmResponse queryById(Long id) { + return firearmRepository.findById(id) + .map(FirearmResponse::from) + .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, "Firearm not found: " + id)); + } + + /** + * Creates a new firearm from the provided request data. + * + * @param request the firearm creation request + * @return the created firearm response + */ + public FirearmResponse addFirearm(FirearmRequest request) { + var firearm = firearmRepository.save(Firearm.builder() + .name(request.name()) + .type(request.type()) + .level(request.level()) + .calibre(request.calibre()) + .fireRate(request.fireRate()) + .armourDamage(request.armourDamage()) + .bodyDamage(request.bodyDamage()) + .review(request.review()) + .build()); + + return FirearmResponse.from(firearm); + } + + /** + * Updates an existing firearm identified by ID. + * + * @param id the firearm ID + * @param request the updated firearm data + * @return the updated firearm response + */ + public FirearmResponse updateFirearm(Long id, FirearmRequest request) { + var firearm = firearmRepository.findById(id) + .orElseThrow(() -> new NotFoundException("Firearm not found: " + id)); + + firearm.setName(request.name()); + firearm.setType(request.type()); + firearm.setLevel(request.level()); + firearm.setCalibre(request.calibre()); + firearm.setFireRate(request.fireRate()); + firearm.setArmourDamage(request.armourDamage()); + firearm.setBodyDamage(request.bodyDamage()); + firearm.setReview(request.review()); + + return FirearmResponse.from(firearmRepository.save(firearm)); + } + + /** + * Deletes a firearm by its ID. + * + * @param id the firearm ID to delete + */ + public void deleteFirearm(Long id) { + Firearm firearm = firearmRepository.findById(id) + .orElseThrow(() -> new NotFoundException("Firearm not found: " + id)); + firearmRepository.delete(firearm); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/service/ModificationService.java b/server/src/main/java/com/onixbyte/ahsarahguide/service/ModificationService.java new file mode 100644 index 0000000..c1875e2 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/service/ModificationService.java @@ -0,0 +1,223 @@ +package com.onixbyte.ahsarahguide.service; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.onixbyte.ahsarahguide.domain.dto.AccessoryRequest; +import com.onixbyte.ahsarahguide.domain.dto.ModificationRequest; +import com.onixbyte.ahsarahguide.domain.dto.ModificationResponse; +import com.onixbyte.ahsarahguide.domain.dto.PageResponse; +import com.onixbyte.ahsarahguide.domain.dto.TuningRequest; +import com.onixbyte.ahsarahguide.domain.entity.Accessory; +import com.onixbyte.ahsarahguide.domain.entity.Firearm; +import com.onixbyte.ahsarahguide.domain.entity.Modification; +import com.onixbyte.ahsarahguide.domain.entity.Tuning; +import com.onixbyte.ahsarahguide.domain.entity.User; +import com.onixbyte.ahsarahguide.manager.ModificationManager; +import com.onixbyte.ahsarahguide.repository.FirearmRepository; +import com.onixbyte.ahsarahguide.repository.ModificationRepository; +import com.onixbyte.ahsarahguide.specification.ModificationSpecification; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Service; +import org.springframework.web.server.ResponseStatusException; + +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; + +/** + * Service handling modification business logic including CRUD, batch operations, and tag filtering. + * + * @author zihluwang + */ +@Service +public class ModificationService { + + private final ModificationRepository modificationRepository; + private final FirearmRepository firearmRepository; + private final ModificationManager modificationManager; + private final ObjectMapper objectMapper; + + public ModificationService( + ModificationRepository modificationRepository, + FirearmRepository firearmRepository, + ModificationManager modificationManager, + ObjectMapper objectMapper + ) { + this.modificationRepository = modificationRepository; + this.firearmRepository = firearmRepository; + this.modificationManager = modificationManager; + this.objectMapper = objectMapper; + } + + /** + * Queries modifications with optional firearm and tag filters. + * + * @param firearmId optional firearm ID filter + * @param tags optional tag list filter + * @param pageable pagination parameters + * @return a paginated response of modification records + */ + public PageResponse pageQuery(Long firearmId, List tags, Pageable pageable) { + String tagsJson = null; + if (tags != null && !tags.isEmpty()) { + try { + tagsJson = objectMapper.writeValueAsString(tags); + } catch (JsonProcessingException e) { + throw new RuntimeException("Failed to serialize tags", e); + } + } + + var spec = Specification.allOf( + ModificationSpecification.hasFirearmId(firearmId), + ModificationSpecification.containsTags(tagsJson) + ); + + var page = modificationManager.findBySpec(spec, pageable); + + return PageResponse.from(page.map(ModificationResponse::from)); + } + + /** + * Finds a modification by its ID. + * + * @param id the modification ID + * @return the modification response + */ + public ModificationResponse queryById(Long id) { + return modificationRepository.findById(id) + .map(ModificationResponse::from) + .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, "Modification not found: " + id)); + } + + /** + * Finds all unique tags across modifications, optionally scoped to a firearm. + * + * @param firearmId optional firearm ID to scope the tag search + * @return list of unique tag strings + */ + public List findAllTags(Long firearmId) { + return modificationRepository.findAllTags(firearmId); + } + + /** + * Creates a new modification for a given firearm. + * + * @param request the modification creation request + * @param user the authenticated user creating the modification + * @return the created modification response + */ + public ModificationResponse create(ModificationRequest request, User user) { + return modificationManager.create(request, user); + } + + /** + * Creates multiple modifications in a single batch operation. + * + * @param requests list of modification creation requests + * @param user the authenticated user creating the modifications + * @return list of created modification responses + */ + public List batchCreate(List requests, User user) { + return modificationManager.batchCreate(requests, user); + } + + /** + * Updates an existing modification identified by ID. + * + * @param id the modification ID + * @param request the updated modification data + * @return the updated modification response + */ + public ModificationResponse update(Long id, ModificationRequest request) { + Modification modification = modificationRepository.findById(id) + .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, "Modification not found: " + id)); + Firearm firearm = firearmRepository.findById(request.firearmId()) + .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, "Firearm not found: " + request.firearmId())); + + modification.setFirearm(firearm); + modification.setName(request.name()); + modification.setCode(request.code()); + modification.setTags(safeTags(request.tags())); + modification.setAccessories(toAccessories(request.accessories())); + modification.setNote(request.note()); + modification.setAuthor(request.author()); + modification.setVideoUrl(request.videoUrl()); + + return ModificationResponse.from(modificationRepository.save(modification)); + } + + /** + * Deletes a modification by its ID. + * + * @param id the modification ID to delete + */ + public void delete(Long id) { + Modification modification = modificationRepository.findById(id) + .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, "Modification not found: " + id)); + modificationRepository.delete(modification); + } + + /** + * Deletes multiple modifications in a single batch operation. + * + * @param ids list of modification IDs to delete + */ + public void batchDelete(List ids) { + Set uniqueIds = new LinkedHashSet<>(ids); + List modifications = modificationRepository.findAllById(uniqueIds); + + if (modifications.size() != uniqueIds.size()) { + Set foundIds = modifications.stream() + .map(Modification::getId) + .collect(java.util.stream.Collectors.toSet()); + List missingIds = uniqueIds.stream() + .filter(id -> !foundIds.contains(id)) + .toList(); + throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Modification not found: " + missingIds); + } + + modificationRepository.deleteAllInBatch(modifications); + } + + private List safeTags(List tags) { + return tags == null ? new ArrayList<>() : tags; + } + + private List toAccessories(List accessoryRequests) { + if (accessoryRequests == null) { + return new ArrayList<>(); + } + + return accessoryRequests.stream() + .map(this::toAccessory) + .toList(); + } + + private Accessory toAccessory(AccessoryRequest request) { + Accessory accessory = new Accessory(); + accessory.setSlotName(request.slotName()); + accessory.setAccessoryName(request.accessoryName()); + accessory.setTunings(toTunings(request.tunings())); + return accessory; + } + + private List toTunings(List tuningRequests) { + if (tuningRequests == null) { + return new ArrayList<>(); + } + + return tuningRequests.stream() + .map(this::toTuning) + .toList(); + } + + private Tuning toTuning(TuningRequest request) { + Tuning tuning = new Tuning(); + tuning.setTuningName(request.tuningName()); + tuning.setTuningValue(request.tuningValue()); + return tuning; + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/service/UserService.java b/server/src/main/java/com/onixbyte/ahsarahguide/service/UserService.java new file mode 100644 index 0000000..ad3f317 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/service/UserService.java @@ -0,0 +1,269 @@ +package com.onixbyte.ahsarahguide.service; + +import com.onixbyte.ahsarahguide.domain.dto.*; +import com.onixbyte.ahsarahguide.domain.entity.User; +import com.onixbyte.ahsarahguide.domain.entity.UserCredential; +import com.onixbyte.ahsarahguide.domain.entity.UserRole; +import com.onixbyte.ahsarahguide.exeption.BadRequestException; +import com.onixbyte.ahsarahguide.manager.UserCredentialManager; +import com.onixbyte.ahsarahguide.manager.UserManager; +import com.onixbyte.ahsarahguide.manager.UserRoleManager; +import com.onixbyte.ahsarahguide.shared.CredentialProvider; +import com.onixbyte.ahsarahguide.shared.Role; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.http.HttpStatus; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; +import org.springframework.web.server.ResponseStatusException; + +import java.util.List; +import java.util.Objects; + +/** + * Service for user account management and profile operations. + * + * @author zihluwang + */ +@Service +public class UserService { + + private final UserManager userManager; + private final UserCredentialManager userCredentialManager; + private final UserRoleManager userRoleManager; + private final PasswordEncoder passwordEncoder; + + public UserService( + UserManager userManager, + UserCredentialManager userCredentialManager, + UserRoleManager userRoleManager, + PasswordEncoder passwordEncoder + ) { + this.userManager = userManager; + this.userCredentialManager = userCredentialManager; + this.userRoleManager = userRoleManager; + this.passwordEncoder = passwordEncoder; + } + + /** + * Retrieves all registered users. + * + * @return list of all users + */ + public List findAll() { + return userManager.findAll(); + } + + /** + * Finds a user by their ID. + * + * @param id the user ID + * @return the user + */ + public User queryById(Long id) { + return userManager.findById(id) + .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, "User not found: " + id)); + } + + /** + * Finds a user by their username. + * + * @param username the username to search for + * @return the user + */ + public User queryByUsername(String username) { + return userManager.findByUsername(username) + .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, "User not found: " + username)); + } + + /** + * Creates a new user account. + * + * @param user the user entity to persist + * @return the saved user entity + */ + public User create(User user) { + return userManager.save(user); + } + + /** + * Updates an existing user account. + * + * @param user the user entity with updated fields + * @return the saved user entity + */ + public User update(User user) { + if (user.getId() == null || userManager.findById(user.getId()).isEmpty()) { + throw new ResponseStatusException(HttpStatus.NOT_FOUND, "User not found: " + user.getId()); + } + return userManager.save(user); + } + + /** + * Finds all credentials associated with a user. + * + * @param userId the user ID + * @return list of user credentials + */ + public List findCredentials(Long userId) { + ensureUserExists(userId); + return userCredentialManager.findAllByUserId(userId); + } + + /** + * Queries a specific credential for a user by provider. + * + * @param userId the user ID + * @param provider the authentication provider + * @return the matching credential + */ + public UserCredential queryCredential(Long userId, String provider) { + ensureUserExists(userId); + return userCredentialManager.findByUserIdAndProvider(userId, provider) + .orElseThrow(() -> new ResponseStatusException( + HttpStatus.NOT_FOUND, + "User credential not found: userId=" + userId + ", provider=" + provider)); + } + + /** + * Creates or updates a credential for a user and provider. + * + * @param userId the user ID + * @param provider the authentication provider + * @param credential the credential value + * @return the saved credential + */ + public UserCredential upsertCredential(Long userId, String provider, String credential) { + User user = ensureUserExists(userId); + UserCredential userCredential = userCredentialManager.findByUserIdAndProvider(userId, provider) + .orElseGet(UserCredential::new); + userCredential.setUser(user); + userCredential.setProvider(provider); + userCredential.setCredential(credential); + return userCredentialManager.save(userCredential); + } + + /** + * Deletes a specific credential for a user by provider. + * + * @param userId the user ID + * @param provider the authentication provider + */ + public void deleteCredential(Long userId, String provider) { + ensureUserExists(userId); + userCredentialManager.deleteByUserIdAndProvider(userId, provider); + } + + /** + * Deletes a user and all associated credentials. + * + * @param id the user ID to delete + */ + public void deleteById(Long id) { + ensureUserExists(id); + userCredentialManager.deleteAllByUserId(id); + userManager.deleteById(id); + } + + private User ensureUserExists(Long userId) { + return userManager.findById(userId) + .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, "User not found: " + userId)); + } + + /** + * Builds the full profile response for the given user, including their assigned roles. + * + * @param user the authenticated user + * @return the user's profile response + */ + public UserProfileResponse getProfile(User user) { + var roles = userRoleManager.findAllByUserId(user.getId()).stream() + .map(UserRole::getRole) + .toList(); + return UserProfileResponse.from(user, roles); + } + + /** + * Updates the current user's profile information (nickname and email). + * If the email address changes, the email verification status is reset. + * + * @param user the authenticated user + * @param request the update request containing new nickname and email + * @return the updated user profile response + */ + public UserProfileResponse updateProfile(User user, UpdateProfileRequest request) { + if (StringUtils.hasText(request.nickname())) { + user.setNickname(request.nickname()); + } + + userManager.save(user); + return getProfile(user); + } + + /** + * Changes the current user's password after validating the old password. + * + * @param user the authenticated user + * @param request the change password request containing old and new passwords + */ + public void changePassword(User user, ChangePasswordRequest request) { + var credential = userCredentialManager.findByUserIdAndProvider(user.getId(), CredentialProvider.LOCAL); + if (credential.isEmpty() || !passwordEncoder.matches(request.oldPassword(), credential.get().getCredential())) { + throw new BadRequestException("旧密码不正确。"); + } + var encoded = passwordEncoder.encode(request.newPassword()); + upsertCredential(user.getId(), CredentialProvider.LOCAL, encoded); + } + + /** + * Retrieves a paginated list of the current user's custom modification builds. + * This is a skeleton implementation that returns an empty page. + * It will be activated when the CustomModification entity is introduced. + * + * @param user the authenticated user + * @param pageable pagination parameters + * @return an empty paginated response + */ + public PageResponse getBuilds(User user, Pageable pageable) { + var emptyPage = Page.empty(pageable); + return PageResponse.from(emptyPage); + } + + /** + * Assigns a role to a user. Only {@code ROLE_ADMIN} may be assigned via this API. + * + * @param userId the target user ID + * @param role the role to assign + */ + public void assignRole(Long userId, String role) { + if (!Role.ROLE_ADMIN.equals(role)) { + throw new BadRequestException("只能通过API分配ROLE_ADMIN角色。"); + } + var user = ensureUserExists(userId); + if (userRoleManager.existsByUserIdAndRole(userId, role)) { + return; // already assigned — idempotent + } + var userRole = UserRole.builder() + .user(user) + .role(role) + .build(); + userRoleManager.save(userRole); + } + + /** + * Removes a role from a user. Only {@code ROLE_ADMIN} may be removed via this API. + * + * @param userId the target user ID + * @param role the role to remove + */ + public void removeRole(Long userId, String role) { + if (!Role.ROLE_ADMIN.equals(role)) { + throw new BadRequestException("只能通过API移除ROLE_ADMIN角色。"); + } + ensureUserExists(userId); + userRoleManager.deleteByUserIdAndRole(userId, role); + } +} + + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/service/WebhookService.java b/server/src/main/java/com/onixbyte/ahsarahguide/service/WebhookService.java new file mode 100644 index 0000000..248953e --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/service/WebhookService.java @@ -0,0 +1,218 @@ +package com.onixbyte.ahsarahguide.service; + +import com.onixbyte.ahsarahguide.domain.dto.*; +import com.onixbyte.ahsarahguide.exeption.BadRequestException; +import com.onixbyte.ahsarahguide.manager.ModificationManager; +import com.onixbyte.ahsarahguide.manager.WebhookManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Service; +import org.yaml.snakeyaml.Yaml; + +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; + +@Service +public class WebhookService { + + private static final Logger log = LoggerFactory.getLogger(WebhookService.class); + private static final String TRIGGER_LABEL = "weapon-mod"; + private static final Duration DEDUP_TTL = Duration.ofHours(12); + private static final Pattern YAML_FENCE = + Pattern.compile("```ya?ml\\s*\\R(.*?)```", Pattern.DOTALL); + + private final ModificationManager modificationManager; + private final RedisTemplate redisTemplate; + private final WebhookManager webhookManager; + private final Yaml yaml; + + public WebhookService( + ModificationManager modificationManager, + RedisTemplate redisTemplate, + WebhookManager webhookManager + ) { + this.modificationManager = modificationManager; + this.redisTemplate = redisTemplate; + this.webhookManager = webhookManager; + this.yaml = new Yaml(); + } + + public void processIssueEvent(GitHubIssueRequest request) { + var issue = request.issue(); + var repository = request.repository(); + var sender = request.sender(); + + if (!isAllowedSender(sender)) { + log.info("Issue #{} sender={} not in allowed-users, skipping", + issue.number(), sender != null ? sender.login() : "null"); + return; + } + + if (!hasTriggerLabel(issue.labels())) { + log.debug("Issue #{} lacks trigger label, skipping", issue.number()); + return; + } + + var dedupKey = "github:webhook:processed:%s:%d" + .formatted(repository.fullName(), issue.number()); + var acquired = redisTemplate.opsForValue() + .setIfAbsent(dedupKey, "1", DEDUP_TTL); + if (acquired == null || !acquired) { + log.info("Issue #{} already processed, skipping", issue.number()); + return; + } + + var parsedYaml = extractYaml(issue.body()); + if (parsedYaml == null) { + log.warn("No YAML block found in issue #{} body", issue.number()); + return; + } + + var data = yaml.>load(parsedYaml); + if (data == null) { + log.warn("Empty YAML block in issue #{}", issue.number()); + return; + } + + if (data.containsKey("modifications")) { + processBatch(issue.number(), data); + } else { + processSingle(issue.number(), data); + } + } + + private void processSingle(Long issueNumber, Map data) { + var request = mapToRequest(data); + log.info("Creating modification from issue #{}: name={}", issueNumber, request.name()); + modificationManager.create(request, null); + } + + @SuppressWarnings("unchecked") + private void processBatch(Long issueNumber, Map data) { + var list = (List>) data.get("modifications"); + if (list == null || list.isEmpty()) { + log.warn("Empty modifications list in issue #{}", issueNumber); + return; + } + var requests = list.stream() + .map(this::mapToRequest) + .toList(); + log.info("Batch creating {} modifications from issue #{}", requests.size(), issueNumber); + modificationManager.batchCreate(requests, null); + } + + private ModificationRequest mapToRequest(Map data) { + Long firearmId = modificationManager.resolveFirearmId( + toLong(data.get("firearmId")), + (String) data.get("firearmName")); + if (firearmId == null) { + throw new BadRequestException( + "YAML must contain firearmId or firearmName"); + } + String name = (String) data.get("name"); + String code = (String) data.get("code"); + List tags = toStringList(data.get("tags")); + List accessories = mapAccessories(data.get("accessories")); + String note = (String) data.get("note"); + String author = (String) data.get("author"); + String videoUrl = (String) data.get("videoUrl"); + + return new ModificationRequest(firearmId, name, code, tags, accessories, + note, author, videoUrl); + } + + private List mapAccessories(Object raw) { + if (!(raw instanceof List list)) { + return new ArrayList<>(); + } + var result = new ArrayList(); + for (var item : list) { + if (item instanceof Map map) { + result.add(new AccessoryRequest( + (String) map.get("slotName"), + (String) map.get("accessoryName"), + mapTunings(map.get("tunings")) + )); + } + } + return result; + } + + private List mapTunings(Object raw) { + if (!(raw instanceof List list)) { + return new ArrayList<>(); + } + var result = new ArrayList(); + for (var item : list) { + if (item instanceof Map map) { + result.add(new TuningRequest( + (String) map.get("tuningName"), + toDouble(map.get("tuningValue")) + )); + } + } + return result; + } + + private List toStringList(Object raw) { + if (raw instanceof List list) { + return list.stream() + .filter(String.class::isInstance) + .map(String.class::cast) + .toList(); + } + return new ArrayList<>(); + } + + private boolean isAllowedSender( + GitHubWebhookSender sender + ) { + var allowedUsers = webhookManager.allowedUsers(); + if (allowedUsers == null || allowedUsers.isEmpty()) { + return true; + } + if (sender == null || sender.login() == null) { + return false; + } + return allowedUsers.contains(sender.login()); + } + + private boolean hasTriggerLabel(List labels) { + if (labels == null) { + return false; + } + return labels.stream().anyMatch(label -> TRIGGER_LABEL.equals(label.name())); + } + + private String extractYaml(String body) { + if (body == null) { + return null; + } + var matcher = YAML_FENCE.matcher(body); + return matcher.find() ? matcher.group(1) : null; + } + + private Long toLong(Object value) { + if (value instanceof Number num) { + return num.longValue(); + } + if (value instanceof String s) { + return Long.parseLong(s); + } + return null; + } + + private Double toDouble(Object value) { + if (value instanceof Number num) { + return num.doubleValue(); + } + if (value instanceof String s) { + return Double.parseDouble(s); + } + return null; + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/shared/CookieName.java b/server/src/main/java/com/onixbyte/ahsarahguide/shared/CookieName.java new file mode 100644 index 0000000..d8ccaf2 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/shared/CookieName.java @@ -0,0 +1,11 @@ +package com.onixbyte.ahsarahguide.shared; + +/** + * Constants for HTTP cookie names used for authentication tokens. + * + * @author zihluwang + */ +public class CookieName { + + public static final String ACCESS_TOKEN = "AccessToken"; +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/shared/CredentialProvider.java b/server/src/main/java/com/onixbyte/ahsarahguide/shared/CredentialProvider.java new file mode 100644 index 0000000..2ceee58 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/shared/CredentialProvider.java @@ -0,0 +1,11 @@ +package com.onixbyte.ahsarahguide.shared; + +/** + * Constants for supported authentication provider identifiers. + * + * @author zihluwang + */ +public class CredentialProvider { + + public static final String LOCAL = "LOCAL"; +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/shared/DateTimeFormatters.java b/server/src/main/java/com/onixbyte/ahsarahguide/shared/DateTimeFormatters.java new file mode 100644 index 0000000..e356cd3 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/shared/DateTimeFormatters.java @@ -0,0 +1,46 @@ +package com.onixbyte.ahsarahguide.shared; + +import java.time.format.DateTimeFormatter; + +/** + * Utility class providing predefined {@link DateTimeFormatter} instances for common date and + * time patterns. These formatters can be used to parse and format {@code java.time} objects + * consistently throughout an application. + * + * @author zihluwang + */ +public class DateTimeFormatters { + + /** + * A {@link DateTimeFormatter} for formatting and parsing full date and time with seconds, using + * the pattern "yyyy-MM-dd HH:mm:ss". + *

+ * Example: "{@code 2023-10-27 15:30:45}" + */ + public static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + + /** + * A {@link DateTimeFormatter} for formatting and parsing dates only, using the + * pattern "yyyy-MM-dd". + *

+ * Example: "{@code 2023-10-27}" + */ + public static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + + /** + * A {@link DateTimeFormatter} for formatting and parsing times only, using the + * pattern "HH:mm:ss". + *

+ * Example: "{@code 15:30:45}" + */ + public static final DateTimeFormatter TIME_FORMATTER = DateTimeFormatter.ofPattern("HH:mm:ss"); + + /** + * A {@link DateTimeFormatter} for formatting and parsing year and month only, using the + * pattern "yyyy-MM". + *

+ * Example: "{@code 2023-10}" + */ + public static final DateTimeFormatter YEAR_MONTH_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM"); +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/shared/GitHubWebhookHeader.java b/server/src/main/java/com/onixbyte/ahsarahguide/shared/GitHubWebhookHeader.java new file mode 100644 index 0000000..041fb19 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/shared/GitHubWebhookHeader.java @@ -0,0 +1,56 @@ +package com.onixbyte.ahsarahguide.shared; + +/** + * This class lists the header names that GitHub sends in webhook requests. + * + * @author siujamo + */ +public class GitHubWebhookHeader { + + /** + * The unique identifier of the webhook. + */ + public static final String HOOK_ID = "X-GitHub-Hook-ID"; + + /** + * The name of the event that triggered the delivery. + */ + public static final String EVENT = "X-GitHub-Event"; + + /** + * A globally unique identifier (GUID) to identify the event. + */ + public static final String DELIVERY = "X-GitHub-Delivery"; + + /** + * This header is sent if the webhook is configured with a {@code secret}. This is the HMAC hex + * digest of the request body, and is generated using the SHA-1 hash function and the secret as + * the HMAC {@code key}. {@code X-Hub-Signature} is provided for compatibility with + * existing integrations. We recommend that you use the more secure + * {@code X-Hub-Signature-256} instead. + */ + public static final String SIGNATURE = "X-Hub-Signature"; + + /** + * This header is sent if the webhook is configured with a {@code secret}. This is the HMAC hex + * digest of the request body, and is generated using the SHA-256 hash function and the + * {@code secret} as the HMAC key. For more information, see Validating webhook deliveries. + */ + public static final String SIGNATURE_256 = "X-Hub-Signature-256"; + + /** + * This header will always have the prefix {@code GitHub-Hookshot/}. + */ + public static final String USER_AGENT = "User-Agent"; + + /** + * The type of resource where the webhook was created. + */ + public static final String INSTALLATION_TARGET_TYPE = "X-GitHub-Hook-Installation-Target-Type"; + + /** + * The unique identifier of the resource where the webhook was created. + */ + public static final String INSTALLATION_TARGET_ID = "X-GitHub-Hook-Installation-Target-ID"; +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/shared/JacksonModules.java b/server/src/main/java/com/onixbyte/ahsarahguide/shared/JacksonModules.java new file mode 100644 index 0000000..bbd1ad9 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/shared/JacksonModules.java @@ -0,0 +1,40 @@ +package com.onixbyte.ahsarahguide.shared; + +import com.fasterxml.jackson.databind.module.SimpleModule; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; + +/** + * Shared Jackson {@link com.fasterxml.jackson.databind.Module} instances for custom date/time + * serialisation and deserialisation across the application. + * + * @author zihluwang + */ +public class JacksonModules { + + public static final SimpleModule DATE_TIME_MODULE = initialiseDateTimeModule(); + + private static SimpleModule initialiseDateTimeModule() { + var javaTimeModule = new JavaTimeModule(); + javaTimeModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatters.DATE_TIME_FORMATTER)); + javaTimeModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatters.DATE_TIME_FORMATTER)); + + javaTimeModule.addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatters.DATE_FORMATTER)); + javaTimeModule.addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatters.DATE_FORMATTER)); + + javaTimeModule.addSerializer(LocalTime.class, new LocalTimeSerializer(DateTimeFormatters.TIME_FORMATTER)); + javaTimeModule.addDeserializer(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatters.TIME_FORMATTER)); + + return javaTimeModule; + } +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/shared/JacksonRedisSerialiser.java b/server/src/main/java/com/onixbyte/ahsarahguide/shared/JacksonRedisSerialiser.java new file mode 100644 index 0000000..99b72cf --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/shared/JacksonRedisSerialiser.java @@ -0,0 +1,28 @@ +package com.onixbyte.ahsarahguide.shared; + +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; + +/** + * Singleton serialiser for Redis cache operations using + * {@link GenericJackson2JsonRedisSerializer} with JavaTime module support. + * + * @author zihluwang + */ +public class JacksonRedisSerialiser { + + public static final GenericJackson2JsonRedisSerializer INSTANCE = initialiseSerializer(); + + private static GenericJackson2JsonRedisSerializer initialiseSerializer() { + var serializer = new GenericJackson2JsonRedisSerializer(); + + serializer.configure((configurer) -> { + configurer.registerModule(new JavaTimeModule()); + configurer.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + }); + + return serializer; + } +} + diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/shared/Role.java b/server/src/main/java/com/onixbyte/ahsarahguide/shared/Role.java new file mode 100644 index 0000000..66ad2bd --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/shared/Role.java @@ -0,0 +1,19 @@ +package com.onixbyte.ahsarahguide.shared; + +/** + * Constants for application role names used in authorisation decisions. + * + * @author zihluwang + */ +public class Role { + + public static final String ROLE_USER_VALUE = "USER"; + public static final String ROLE_ADMIN_VALUE = "ADMIN"; + public static final String ROLE_SUPER_USER_VALUE = "SUPER_USER"; + + public static final String ROLE_USER = "ROLE_USER"; + public static final String ROLE_ADMIN = "ROLE_ADMIN"; + public static final String ROLE_SUPER_USER = "ROLE_SUPER_USER"; + + private Role() {} +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/specification/ModificationSpecification.java b/server/src/main/java/com/onixbyte/ahsarahguide/specification/ModificationSpecification.java new file mode 100644 index 0000000..1d0ecac --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/specification/ModificationSpecification.java @@ -0,0 +1,41 @@ +package com.onixbyte.ahsarahguide.specification; + +import com.onixbyte.ahsarahguide.domain.entity.Modification; +import org.springframework.data.jpa.domain.Specification; + +import java.util.Objects; + +public class ModificationSpecification { + + /** + * Filters by firearm ID if specified. + */ + public static Specification hasFirearmId(Long firearmId) { + return (root, query, cb) -> { + if (Objects.isNull(firearmId)) { + return null; + } + return cb.equal(root.get("firearm").get("id"), firearmId); + }; + } + + /** + * Checks if the jsonb tags contain the given JSON string. + */ + public static Specification containsTags(String tagsJson) { + return (root, query, cb) -> { + if (Objects.isNull(tagsJson)) { + return null; + } + // Invoke the PostgreSQL native function 'jsonb_contains' (backing the + // '@>' operator). The argument is cast via the 'jsonb' function-style + // cast so PostgreSQL resolves the correct overload instead of treating + // the bound String as varchar. + return cb.isTrue( + cb.function("jsonb_contains", Boolean.class, + root.get("tags"), + cb.function("jsonb", String.class, cb.literal(tagsJson))) + ); + }; + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/utils/DateTimeUtil.java b/server/src/main/java/com/onixbyte/ahsarahguide/utils/DateTimeUtil.java new file mode 100644 index 0000000..fd0f8b4 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/utils/DateTimeUtil.java @@ -0,0 +1,24 @@ +package com.onixbyte.ahsarahguide.utils; + +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; + +/** + * Utility class for date and time operations using system-default time zone. + * + * @author zihluwang + */ +public class DateTimeUtil { + + /** + * Convert a {@link LocalDateTime} to an {@link Instant} using the system-default time zone. + * + * @param ldt the local date-time to convert + * @return the corresponding instant + */ + public static Instant asInstant(LocalDateTime ldt) { + return ldt.atZone(ZoneId.systemDefault()) + .toInstant(); + } +} diff --git a/server/src/main/java/com/onixbyte/ahsarahguide/wrapper/RepeatedlyReadRequestWrapper.java b/server/src/main/java/com/onixbyte/ahsarahguide/wrapper/RepeatedlyReadRequestWrapper.java new file mode 100644 index 0000000..322a3b4 --- /dev/null +++ b/server/src/main/java/com/onixbyte/ahsarahguide/wrapper/RepeatedlyReadRequestWrapper.java @@ -0,0 +1,56 @@ +package com.onixbyte.ahsarahguide.wrapper; + +import jakarta.servlet.ReadListener; +import jakarta.servlet.ServletInputStream; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequestWrapper; +import org.springframework.util.StreamUtils; +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; + +public class RepeatedlyReadRequestWrapper extends HttpServletRequestWrapper { + + private final byte[] body; + + public RepeatedlyReadRequestWrapper(HttpServletRequest request) throws IOException { + super(request); + this.body = StreamUtils.copyToByteArray(request.getInputStream()); + } + + @Override + public ServletInputStream getInputStream() { + final var byteArrayInputStream = new ByteArrayInputStream(body); + return new ServletInputStream() { + @Override + public boolean isFinished() { + return byteArrayInputStream.available() == 0; + } + + @Override + public boolean isReady() { + return true; + } + + @Override + public void setReadListener(ReadListener readListener) { + } + + @Override + public int read() throws IOException { + return byteArrayInputStream.read(); + } + }; + } + + @Override + public BufferedReader getReader() throws IOException { + return new BufferedReader(new InputStreamReader(this.getInputStream(), StandardCharsets.UTF_8)); + } + + public String getBodyString() { + return new String(body, StandardCharsets.UTF_8); + } +} diff --git a/server/src/main/resources/application.yaml b/server/src/main/resources/application.yaml index 8fcdf2f..5329469 100644 --- a/server/src/main/resources/application.yaml +++ b/server/src/main/resources/application.yaml @@ -1,6 +1,6 @@ spring: application: - name: delta-force-guide + name: ahsarah-guide cache: type: redis redis: @@ -30,16 +30,25 @@ spring: flyway: enabled: true baseline-on-migrate: true + thymeleaf: + enabled: false + check-template-location: false + mail: + # This configuration is used to suppressing warnings of no beans found of JavaMailSender. + host: example.smtp.com + username: app@dfguide.onixbyte.cn mybatis: configuration: log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl map-underscore-to-camel-case: true - type-aliases-package: com.onixbyte.deltaforceguide.domain.entity - type-handlers-package: com.onixbyte.deltaforceguide.mapper.handler + type-aliases-package: com.onixbyte.ahsarahguide.domain.entity + type-handlers-package: com.onixbyte.ahsarahguide.mapper.handler mapper-locations: classpath:/mapper/*.xml logging: + pattern: + dateformat: dd MMM yyyy HH:mm:ss level: org.hibernate: orm.connections.pooling: off diff --git a/server/src/main/resources/db/migration/V6__user_profile.sql b/server/src/main/resources/db/migration/V6__user_profile.sql new file mode 100644 index 0000000..4a4dbc5 --- /dev/null +++ b/server/src/main/resources/db/migration/V6__user_profile.sql @@ -0,0 +1,6 @@ +ALTER TABLE app_user + ADD COLUMN nickname VARCHAR(64), + ADD COLUMN avatar_url VARCHAR(512), + ADD COLUMN enabled BOOLEAN NOT NULL DEFAULT TRUE, + ADD COLUMN created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + ADD COLUMN updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(); diff --git a/server/src/main/resources/db/migration/V7__user_role.sql b/server/src/main/resources/db/migration/V7__user_role.sql new file mode 100644 index 0000000..69b69e5 --- /dev/null +++ b/server/src/main/resources/db/migration/V7__user_role.sql @@ -0,0 +1,6 @@ +CREATE TABLE user_role +( + user_id BIGINT NOT NULL REFERENCES app_user (id), + role VARCHAR(32) NOT NULL, + CONSTRAINT user_role_pkey PRIMARY KEY (user_id) +); diff --git a/server/src/main/resources/db/migration/V8__modification.sql b/server/src/main/resources/db/migration/V8__modification.sql new file mode 100644 index 0000000..eba22e7 --- /dev/null +++ b/server/src/main/resources/db/migration/V8__modification.sql @@ -0,0 +1,71 @@ +BEGIN; + +CREATE TABLE IF NOT EXISTS modification_new +( + id BIGSERIAL NOT NULL PRIMARY KEY, + user_id BIGINT NULL REFERENCES app_user (id), + firearm_id BIGINT NOT NULL REFERENCES firearm (id), + name VARCHAR(64) NOT NULL, + code VARCHAR(64) NOT NULL, + tags JSONB NOT NULL DEFAULT '[]'::JSONB, + note TEXT NULL, + author VARCHAR(64) NULL, + video_url VARCHAR(512) NULL, + accessories JSONB NOT NULL DEFAULT '[]'::JSONB, + status INTEGER NOT NULL DEFAULT 0, + create_by BIGINT NULL, + create_time TIMESTAMPTZ NOT NULL, + CONSTRAINT tags_must_be_string_array CHECK ( + jsonb_typeof(tags) = 'array' AND + NOT jsonb_path_exists(tags, '$[*] ? (@.type() != "string")') + ) +); + +DO +$$ + DECLARE + v_super_user_id BIGINT; + BEGIN + -- Added explicit table reference and LIMIT 1 to prevent multiple-row errors + SELECT app_user.id + INTO v_super_user_id + FROM app_user + LEFT JOIN user_role ur ON app_user.id = ur.user_id + WHERE ur.role = 'SUPER_USER' + LIMIT 1; + + -- Explicitly check for NULL rather than evaluating the integer + IF v_super_user_id IS NOT NULL THEN + INSERT INTO modification_new(id, user_id, firearm_id, name, code, tags, note, author, + video_url, accessories, status, create_by, create_time) + SELECT m.id, + NULL, + m.firearm_id, + m.name, + m.code, + COALESCE(m.tags, '[]'::JSONB), + m.note, + m.author, + m.video_url, + COALESCE(m.accessories, '[]'::JSONB), + 2, + v_super_user_id, + now() + FROM modification m; + ELSE + -- Fixed RAISE NOTICE parameter formatting + RAISE NOTICE 'Super user not found. Please execute the manual SQL commands after adding a super user.'; + END IF; + END +$$; + +ALTER INDEX idx_modification_firearm_id RENAME TO idx_modification_lagacy_firearm_id; + +CREATE INDEX idx_modification_firearm_id ON modification_new (firearm_id); + +ALTER TABLE modification + RENAME TO modification_legacy; +ALTER TABLE modification_new + RENAME TO modification; + +COMMIT; \ No newline at end of file diff --git a/server/src/main/resources/mail-templates/verification-code.html b/server/src/main/resources/mail-templates/verification-code.html new file mode 100644 index 0000000..d6e9c37 --- /dev/null +++ b/server/src/main/resources/mail-templates/verification-code.html @@ -0,0 +1,71 @@ + + + + + + 账号验证 + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+

账号注册验证

+
+
+
+

+ 您好 用户, +

+

+ 感谢注册我们的服务。请使用下方的验证码完成账号验证,该验证码在 10 分钟 内有效: +

+ + + + + + +
+ 123456 +
+ +

+ 若您未发起此操作或未尝试注册该账号,请直接忽略本邮件。 +

+
+

+ 此邮件为系统自动发送,请勿直接回复。 +

+

+ © 2026 阿萨拉向导. 保留所有权利。 +

+
+
+ + \ No newline at end of file diff --git a/web/.env.example b/web/.env.example index e69de29..d9fc73b 100644 --- a/web/.env.example +++ b/web/.env.example @@ -0,0 +1,21 @@ +# ENVIRONMENT CONFIGURATION TEMPLATE +# +# This file serves as a template for environment variables. +# DO NOT include any sensitive data (passwords, API keys, etc.) in this file. +# +# INSTRUCTIONS +# 1. Copy this file to `.env`, `.env.development`, or `.env.production` depending on your +# target environment. +# 2. Replace the placeholder values with your actual configuration. +# 3. Alternatively, ensure these variables are defined within your system's environment +# settings before running the application. + +# The base URL fot the backend API service. +# Ensure this matches your Spring Boot server address (e.g., http://localhost:8080). +VITE_API_BASE_URL=/api + +# Determines where Redux state is persisted on the client side. +# Available options: +# - `local`: Persists data in LocalStorage (remains after closing the browser). +# - `session`: Persists data in SessionStorage (cleared when the tab is closed). +VITE_REDUX_STORAGE=local diff --git a/web/.vscode/launch.json b/web/.vscode/launch.json index d439075..97c312b 100644 --- a/web/.vscode/launch.json +++ b/web/.vscode/launch.json @@ -1,22 +1,19 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "node-terminal", - "request": "launch", - "name": "pnpm dev", - "command": "pnpm dev", - "cwd": "${workspaceFolder}" - }, - { - "type": "node-terminal", - "request": "launch", - "name": "build", - "command": "pnpm build", - "cwd": "${workspaceFolder}" - } - ] -} \ No newline at end of file + "version": "0.2.0", + "configurations": [ + { + "type": "node-terminal", + "request": "launch", + "name": "pnpm dev", + "command": "pnpm dev", + "cwd": "${workspaceFolder}" + }, + { + "type": "node-terminal", + "request": "launch", + "name": "build", + "command": "pnpm build", + "cwd": "${workspaceFolder}" + } + ] +} diff --git a/web/index.html b/web/index.html index 4c8aa19..2af511c 100644 --- a/web/index.html +++ b/web/index.html @@ -4,7 +4,7 @@ - 三角洲行动改枪码库 + 阿萨拉向导

diff --git a/web/package-lock.json b/web/package-lock.json new file mode 100644 index 0000000..c219063 --- /dev/null +++ b/web/package-lock.json @@ -0,0 +1,3077 @@ +{ + "name": "delta-force-guide-web", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "delta-force-guide-web", + "version": "0.0.0", + "dependencies": { + "@ant-design/cssinjs": "^2.1.2", + "@ant-design/icons": "^6.2.2", + "@reduxjs/toolkit": "^2.11.2", + "@tailwindcss/vite": "^4.2.4", + "@tanstack/react-virtual": "^3.13.24", + "antd": "^6.3.7", + "axios": "^1.16.0", + "dayjs": "^1.11.20", + "react": "^19.2.6", + "react-dom": "^19.2.6", + "react-redux": "^9.2.0", + "react-router": "^7.15.0", + "react-router-dom": "^7.15.0", + "redux-persist": "^6.0.0", + "tailwindcss": "^4.2.4" + }, + "devDependencies": { + "@tailwindcss/typography": "^0.5.19", + "@types/node": "^22.19.17", + "@types/react": "^19.2.14", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^6.0.1", + "globals": "^17.6.0", + "prettier": "^3.8.3", + "typescript": "~6.0.3", + "vite": "^8.0.11", + "vite-plugin-markdown": "^2.2.0", + "vite-plugin-port-checker": "^1.0.1" + } + }, + "node_modules/@ant-design/colors": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@ant-design/colors/-/colors-8.0.1.tgz", + "integrity": "sha512-foPVl0+SWIslGUtD/xBr1p9U4AKzPhNYEseXYRRo5QSzGACYZrQbe11AYJbYfAWnWSpGBx6JjBmSeugUsD9vqQ==", + "license": "MIT", + "dependencies": { + "@ant-design/fast-color": "^3.0.0" + } + }, + "node_modules/@ant-design/cssinjs": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@ant-design/cssinjs/-/cssinjs-2.1.2.tgz", + "integrity": "sha512-2Hy8BnCEH31xPeSLbhhB2ctCPXE2ZnASdi+KbSeS79BNbUhL9hAEe20SkUk+BR8aKTmqb6+FKFruk7w8z0VoRQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.11.1", + "@emotion/hash": "^0.8.0", + "@emotion/unitless": "^0.7.5", + "@rc-component/util": "^1.4.0", + "clsx": "^2.1.1", + "csstype": "^3.1.3", + "stylis": "^4.3.4" + }, + "peerDependencies": { + "react": ">=16.0.0", + "react-dom": ">=16.0.0" + } + }, + "node_modules/@ant-design/cssinjs-utils": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@ant-design/cssinjs-utils/-/cssinjs-utils-2.1.2.tgz", + "integrity": "sha512-5fTHQ158jJJ5dC/ECeyIdZUzKxE/mpEMRZxthyG1sw/AKRHKgJBg00Yi6ACVXgycdje7KahRNvNET/uBccwCnA==", + "license": "MIT", + "dependencies": { + "@ant-design/cssinjs": "^2.1.2", + "@babel/runtime": "^7.23.2", + "@rc-component/util": "^1.4.0" + }, + "peerDependencies": { + "react": ">=18", + "react-dom": ">=18" + } + }, + "node_modules/@ant-design/fast-color": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@ant-design/fast-color/-/fast-color-3.0.1.tgz", + "integrity": "sha512-esKJegpW4nckh0o6kV3Tkb7NPIZYbPnnFxmQDUmL08ukXZAvV85TZBr70eGuke/CIArLaP6aw8lt9KILjnWuOw==", + "license": "MIT", + "engines": { + "node": ">=8.x" + } + }, + "node_modules/@ant-design/icons": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/@ant-design/icons/-/icons-6.2.2.tgz", + "integrity": "sha512-zlJtE7AMbG12TeYVPhtBXwNpFInNy8mjLzcIm+0BPw16/b8ODG87YJ1G37VIF5VFscdgfsf6EweAFPTobu/3iQ==", + "license": "MIT", + "dependencies": { + "@ant-design/colors": "^8.0.1", + "@ant-design/icons-svg": "^4.4.2", + "@rc-component/util": "^1.10.1", + "clsx": "^2.1.1" + }, + "engines": { + "node": ">=8" + }, + "peerDependencies": { + "react": ">=16.0.0", + "react-dom": ">=16.0.0" + } + }, + "node_modules/@ant-design/icons-svg": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@ant-design/icons-svg/-/icons-svg-4.4.2.tgz", + "integrity": "sha512-vHbT+zJEVzllwP+CM+ul7reTEfBR0vgxFe7+lREAsAA7YGsYpboiq2sQNeQeRvh09GfQgs/GyFEvZpJ9cLXpXA==", + "license": "MIT" + }, + "node_modules/@ant-design/react-slick": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@ant-design/react-slick/-/react-slick-2.0.0.tgz", + "integrity": "sha512-HMS9sRoEmZey8LsE/Yo6+klhlzU12PisjrVcydW3So7RdklyEd2qehyU6a7Yp+OYN72mgsYs3NFCyP2lCPFVqg==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.28.4", + "clsx": "^2.1.1", + "json2mq": "^0.2.0", + "throttle-debounce": "^5.0.0" + }, + "peerDependencies": { + "react": "^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.2.tgz", + "integrity": "sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@emnapi/core": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz", + "integrity": "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==", + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.1", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz", + "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz", + "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emotion/hash": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.8.0.tgz", + "integrity": "sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==", + "license": "MIT" + }, + "node_modules/@emotion/unitless": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", + "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==", + "license": "MIT" + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.4.tgz", + "integrity": "sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==", + "license": "MIT", + "optional": true, + "dependencies": { + "@tybys/wasm-util": "^0.10.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.132.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.132.0.tgz", + "integrity": "sha512-FESMOxil5Se014ui/Eq8fT5uHJo6nIRwH0PfJrZJXs6Gek3ZVFOrpUv3YIZT20m+extU98Hg1Ym72U58rlsxUQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + } + }, + "node_modules/@rc-component/async-validator": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@rc-component/async-validator/-/async-validator-5.1.0.tgz", + "integrity": "sha512-n4HcR5siNUXRX23nDizbZBQPO0ZM/5oTtmKZ6/eqL0L2bo747cklFdZGRN2f+c9qWGICwDzrhW0H7tE9PptdcA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.24.4" + }, + "engines": { + "node": ">=14.x" + } + }, + "node_modules/@rc-component/cascader": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@rc-component/cascader/-/cascader-1.14.0.tgz", + "integrity": "sha512-Ip9356xwZUR2nbW5PRVGif4B/bDve4pLa/N+PGbvBaTnjbvmN4PFMBGQSmlDlzKP1ovxaYMvwF/dI9lXNLT4iQ==", + "license": "MIT", + "dependencies": { + "@rc-component/select": "~1.6.0", + "@rc-component/tree": "~1.2.0", + "@rc-component/util": "^1.4.0", + "clsx": "^2.1.1" + }, + "peerDependencies": { + "react": ">=18.0.0", + "react-dom": ">=18.0.0" + } + }, + "node_modules/@rc-component/checkbox": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@rc-component/checkbox/-/checkbox-2.0.0.tgz", + "integrity": "sha512-3CXGPpAR9gsPKeO2N78HAPOzU30UdemD6HGJoWVJOpa6WleaGB5kzZj3v6bdTZab31YuWgY/RxV3VKPctn0DwQ==", + "license": "MIT", + "dependencies": { + "@rc-component/util": "^1.3.0", + "clsx": "^2.1.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/collapse": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@rc-component/collapse/-/collapse-1.2.0.tgz", + "integrity": "sha512-ZRYSKSS39qsFx93p26bde7JUZJshsUBEQRlRXPuJYlAiNX0vyYlF5TsAm8JZN3LcF8XvKikdzPbgAtXSbkLUkw==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.10.1", + "@rc-component/motion": "^1.1.4", + "@rc-component/util": "^1.3.0", + "clsx": "^2.1.1" + }, + "peerDependencies": { + "react": ">=18.0.0", + "react-dom": ">=18.0.0" + } + }, + "node_modules/@rc-component/color-picker": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@rc-component/color-picker/-/color-picker-3.1.1.tgz", + "integrity": "sha512-OHaCHLHszCegdXmIq2ZRIZBN/EtpT6Wm8SG/gpzLATHbVKc/avvuKi+zlOuk05FTWvgaMmpxAko44uRJ3M+2pg==", + "license": "MIT", + "dependencies": { + "@ant-design/fast-color": "^3.0.1", + "@rc-component/util": "^1.3.0", + "clsx": "^2.1.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/context": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@rc-component/context/-/context-2.0.1.tgz", + "integrity": "sha512-HyZbYm47s/YqtP6pKXNMjPEMaukyg7P0qVfgMLzr7YiFNMHbK2fKTAGzms9ykfGHSfyf75nBbgWw+hHkp+VImw==", + "license": "MIT", + "dependencies": { + "@rc-component/util": "^1.3.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/dialog": { + "version": "1.8.4", + "resolved": "https://registry.npmjs.org/@rc-component/dialog/-/dialog-1.8.4.tgz", + "integrity": "sha512-Ay6PM7phkTkquplG8fWfUGFZ2GTLx9diTl4f0d8Eqxd7W1u1KjE9AQooFQHOHnhZf0Ya3z51+5EKCWHmt/dNEw==", + "license": "MIT", + "dependencies": { + "@rc-component/motion": "^1.1.3", + "@rc-component/portal": "^2.1.0", + "@rc-component/util": "^1.9.0", + "clsx": "^2.1.1" + }, + "peerDependencies": { + "react": ">=18.0.0", + "react-dom": ">=18.0.0" + } + }, + "node_modules/@rc-component/drawer": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@rc-component/drawer/-/drawer-1.4.2.tgz", + "integrity": "sha512-1ib+fZEp6FBu+YvcIktm+nCQ+Q+qIpwpoaJH6opGr4ofh2QMq+qdr5DLC4oCf5qf3pcWX9lUWPYX652k4ini8Q==", + "license": "MIT", + "dependencies": { + "@rc-component/motion": "^1.1.4", + "@rc-component/portal": "^2.1.3", + "@rc-component/util": "^1.9.0", + "clsx": "^2.1.1" + }, + "peerDependencies": { + "react": ">=18.0.0", + "react-dom": ">=18.0.0" + } + }, + "node_modules/@rc-component/dropdown": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rc-component/dropdown/-/dropdown-1.0.2.tgz", + "integrity": "sha512-6PY2ecUSYhDPhkNHHb4wfeAya04WhpmUSKzdR60G+kMNVUCX2vjT/AgTS0Lz0I/K6xrPMJ3enQbwVpeN3sHCgg==", + "license": "MIT", + "dependencies": { + "@rc-component/trigger": "^3.0.0", + "@rc-component/util": "^1.2.1", + "clsx": "^2.1.1" + }, + "peerDependencies": { + "react": ">=16.11.0", + "react-dom": ">=16.11.0" + } + }, + "node_modules/@rc-component/form": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@rc-component/form/-/form-1.8.1.tgz", + "integrity": "sha512-8O7TB55Fi2mWIGvSnwZjk8jFqVNYyKDAswglwGShcbndxqzKz4cHwNtNaLjZlAeRge9wcB0LL8IWsC/Bl18raQ==", + "license": "MIT", + "dependencies": { + "@rc-component/async-validator": "^5.1.0", + "@rc-component/util": "^1.6.2", + "clsx": "^2.1.1" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/image": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@rc-component/image/-/image-1.9.0.tgz", + "integrity": "sha512-khF7w7xkBH5B1bsBcI1FSUZdkyd1aqpl2eYyILCqCzzQH3XdfehGUaZTnptyaJJfs09/R5hv9jXWyazOMFIClQ==", + "license": "MIT", + "dependencies": { + "@rc-component/motion": "^1.0.0", + "@rc-component/portal": "^2.1.2", + "@rc-component/util": "^1.10.1", + "clsx": "^2.1.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/input": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@rc-component/input/-/input-1.1.2.tgz", + "integrity": "sha512-Q61IMR47piUBudgixJ30CciKIy9b1H95qe7GgEKOmSJVJXvFRWJllJfQry9tif+MX2cWFXWJf/RXz4kaCeq/Fg==", + "license": "MIT", + "dependencies": { + "@rc-component/util": "^1.4.0", + "clsx": "^2.1.1" + }, + "peerDependencies": { + "react": ">=16.0.0", + "react-dom": ">=16.0.0" + } + }, + "node_modules/@rc-component/input-number": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/@rc-component/input-number/-/input-number-1.6.2.tgz", + "integrity": "sha512-Gjcq7meZlCOiWN1t1xCC+7/s85humHVokTBI7PJgTfoyw5OWF74y3e6P8PHX104g9+b54jsodFIzyaj6p8LI9w==", + "license": "MIT", + "dependencies": { + "@rc-component/mini-decimal": "^1.0.1", + "@rc-component/util": "^1.4.0", + "clsx": "^2.1.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/mentions": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@rc-component/mentions/-/mentions-1.6.0.tgz", + "integrity": "sha512-KIkQNP6habNuTsLhUv0UGEOwG67tlmE7KNIJoQZZNggEZl5lQJTytFDb69sl5CK3TDdISCTjKP3nGEBKgT61CQ==", + "license": "MIT", + "dependencies": { + "@rc-component/input": "~1.1.0", + "@rc-component/menu": "~1.2.0", + "@rc-component/textarea": "~1.1.0", + "@rc-component/trigger": "^3.0.0", + "@rc-component/util": "^1.3.0", + "clsx": "^2.1.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/menu": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@rc-component/menu/-/menu-1.2.0.tgz", + "integrity": "sha512-VWwDuhvYHSnTGj4n6bV3ISrLACcPAzdPOq3d0BzkeiM5cve8BEYfvkEhNoM0PLzv51jpcejeyrLXeMVIJ+QJlg==", + "license": "MIT", + "dependencies": { + "@rc-component/motion": "^1.1.4", + "@rc-component/overflow": "^1.0.0", + "@rc-component/trigger": "^3.0.0", + "@rc-component/util": "^1.3.0", + "clsx": "^2.1.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/mini-decimal": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@rc-component/mini-decimal/-/mini-decimal-1.1.3.tgz", + "integrity": "sha512-bk/FJ09fLf+NLODMAFll6CfYrHPBioTedhW6lxDBuuWucJEqFUd4l/D/5JgIi3dina6sYahB8iuPAZTNz2pMxw==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.18.0" + }, + "engines": { + "node": ">=8.x" + } + }, + "node_modules/@rc-component/motion": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@rc-component/motion/-/motion-1.3.2.tgz", + "integrity": "sha512-itfd+GztzJYAb04Z4RkEub1TbJAfZc2Iuy8p44U44xD1F5+fNYFKI3897ijlbIyfvXkTmMm+KGcjkQQGMHywEQ==", + "license": "MIT", + "dependencies": { + "@rc-component/util": "^1.2.0", + "clsx": "^2.1.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/mutate-observer": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@rc-component/mutate-observer/-/mutate-observer-2.0.1.tgz", + "integrity": "sha512-AyarjoLU5YlxuValRi+w8JRH2Z84TBbFO2RoGWz9d8bSu0FqT8DtugH3xC3BV7mUwlmROFauyWuXFuq4IFbH+w==", + "license": "MIT", + "dependencies": { + "@rc-component/util": "^1.2.0" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/notification": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@rc-component/notification/-/notification-1.2.0.tgz", + "integrity": "sha512-OX3J+zVU7rvoJCikjrfW7qOUp7zlDeFBK2eA3SFbGSkDqo63Sl4Ss8A04kFP+fxHSxMDIS9jYVEZtU1FNCFuBA==", + "license": "MIT", + "dependencies": { + "@rc-component/motion": "^1.1.4", + "@rc-component/util": "^1.2.1", + "clsx": "^2.1.1" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/overflow": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rc-component/overflow/-/overflow-1.0.1.tgz", + "integrity": "sha512-syfmgAABaHCnCDzPwHZ/2tuvIcpOO3jefYZMmfkN+pmo8HKTzsfhS57vxo4ksPdN0By+uWVJhJWNFozNBxi2eA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.11.1", + "@rc-component/resize-observer": "^1.0.1", + "@rc-component/util": "^1.4.0", + "clsx": "^2.1.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/pagination": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@rc-component/pagination/-/pagination-1.2.0.tgz", + "integrity": "sha512-YcpUFE8dMLfSo6OARJlK6DbHHvrxz7pMGPGmC/caZSJJz6HRKHC1RPP001PRHCvG9Z/veD039uOQmazVuLJzlw==", + "license": "MIT", + "dependencies": { + "@rc-component/util": "^1.3.0", + "clsx": "^2.1.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/picker": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@rc-component/picker/-/picker-1.9.1.tgz", + "integrity": "sha512-9FBYYsvH3HMLICaPDA/1Th5FLaDkFa7qAtangIdlhKb3ZALaR745e9PsOhheJb6asS4QXc12ffiAcjdkZ4C5/g==", + "license": "MIT", + "dependencies": { + "@rc-component/overflow": "^1.0.0", + "@rc-component/resize-observer": "^1.0.0", + "@rc-component/trigger": "^3.6.15", + "@rc-component/util": "^1.3.0", + "clsx": "^2.1.1" + }, + "engines": { + "node": ">=12.x" + }, + "peerDependencies": { + "date-fns": ">= 2.x", + "dayjs": ">= 1.x", + "luxon": ">= 3.x", + "moment": ">= 2.x", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + }, + "peerDependenciesMeta": { + "date-fns": { + "optional": true + }, + "dayjs": { + "optional": true + }, + "luxon": { + "optional": true + }, + "moment": { + "optional": true + } + } + }, + "node_modules/@rc-component/portal": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@rc-component/portal/-/portal-2.2.0.tgz", + "integrity": "sha512-oc6FlA+uXCMiwArHsJyHcIkX4q6uKyndrPol2eWX8YPkAnztHOPsFIRtmWG4BMlGE5h7YIRE3NiaJ5VS8Lb1QQ==", + "license": "MIT", + "dependencies": { + "@rc-component/util": "^1.2.1", + "clsx": "^2.1.1" + }, + "engines": { + "node": ">=12.x" + }, + "peerDependencies": { + "react": ">=18.0.0", + "react-dom": ">=18.0.0" + } + }, + "node_modules/@rc-component/progress": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rc-component/progress/-/progress-1.0.2.tgz", + "integrity": "sha512-WZUnH9eGxH1+xodZKqdrHke59uyGZSWgj5HBM5Kwk5BrTMuAORO7VJ2IP5Qbm9aH3n9x3IcesqHHR0NWPBC7fQ==", + "license": "MIT", + "dependencies": { + "@rc-component/util": "^1.2.1", + "clsx": "^2.1.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/qrcode": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@rc-component/qrcode/-/qrcode-1.1.1.tgz", + "integrity": "sha512-LfLGNymzKdUPjXUbRP+xOhIWY4jQ+YMj5MmWAcgcAq1Ij8XP7tRmAXqyuv96XvLUBE/5cA8hLFl9eO1JQMujrA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.24.7" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/rate": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rc-component/rate/-/rate-1.0.1.tgz", + "integrity": "sha512-bkXxeBqDpl5IOC7yL7GcSYjQx9G8H+6kLYQnNZWeBYq2OYIv1MONd6mqKTjnnJYpV0cQIU2z3atdW0j1kttpTw==", + "license": "MIT", + "dependencies": { + "@rc-component/util": "^1.3.0", + "clsx": "^2.1.1" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/resize-observer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@rc-component/resize-observer/-/resize-observer-1.1.2.tgz", + "integrity": "sha512-t/Bb0W8uvL4PYKAB3YcChC+DlHh0Wt5kM7q/J+0qpVEUMLe7Hk5zuvc9km0hMnTFPSx5Z7Wu/fzCLN6erVLE8Q==", + "license": "MIT", + "dependencies": { + "@rc-component/util": "^1.2.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/segmented": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@rc-component/segmented/-/segmented-1.3.0.tgz", + "integrity": "sha512-5J/bJ01mbDnoA6P/FW8SxUvKn+OgUSTZJPzCNnTBntG50tzoP7DydGhqxp7ggZXZls7me3mc2EQDXakU3iTVFg==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.11.1", + "@rc-component/motion": "^1.1.4", + "@rc-component/util": "^1.3.0", + "clsx": "^2.1.1" + }, + "peerDependencies": { + "react": ">=16.0.0", + "react-dom": ">=16.0.0" + } + }, + "node_modules/@rc-component/select": { + "version": "1.6.15", + "resolved": "https://registry.npmjs.org/@rc-component/select/-/select-1.6.15.tgz", + "integrity": "sha512-SyVCWnqxCQZZcQvQJ/CxSjx2bGma6ds/HtnpkIfZVnt6RoEgbqUmHgD6vrzNarNXwbLXerwVzWwq8F3d1sst7g==", + "license": "MIT", + "dependencies": { + "@rc-component/overflow": "^1.0.0", + "@rc-component/trigger": "^3.0.0", + "@rc-component/util": "^1.3.0", + "@rc-component/virtual-list": "^1.0.1", + "clsx": "^2.1.1" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": "*", + "react-dom": "*" + } + }, + "node_modules/@rc-component/slider": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rc-component/slider/-/slider-1.0.1.tgz", + "integrity": "sha512-uDhEPU1z3WDfCJhaL9jfd2ha/Eqpdfxsn0Zb0Xcq1NGQAman0TWaR37OWp2vVXEOdV2y0njSILTMpTfPV1454g==", + "license": "MIT", + "dependencies": { + "@rc-component/util": "^1.3.0", + "clsx": "^2.1.1" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/steps": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@rc-component/steps/-/steps-1.2.2.tgz", + "integrity": "sha512-/yVIZ00gDYYPHSY0JP+M+s3ZvuXLu2f9rEjQqiUDs7EcYsUYrpJ/1bLj9aI9R7MBR3fu/NGh6RM9u2qGfqp+Nw==", + "license": "MIT", + "dependencies": { + "@rc-component/util": "^1.2.1", + "clsx": "^2.1.1" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/switch": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rc-component/switch/-/switch-1.0.3.tgz", + "integrity": "sha512-Jgi+EbOBquje/XNdofr7xbJQZPYJP+BlPfR0h+WN4zFkdtB2EWqEfvkXJWeipflwjWip0/17rNbxEAqs8hVHfw==", + "license": "MIT", + "dependencies": { + "@rc-component/util": "^1.3.0", + "clsx": "^2.1.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/table": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@rc-component/table/-/table-1.9.1.tgz", + "integrity": "sha512-FVI5ZS/GdB3BcgexfCYKi3iHhZS3Fr59EtsxORszYGrfpH1eWr33eDNSYkVfLI6tfJ7vftJDd9D5apfFWqkdJg==", + "license": "MIT", + "dependencies": { + "@rc-component/context": "^2.0.1", + "@rc-component/resize-observer": "^1.0.0", + "@rc-component/util": "^1.1.0", + "@rc-component/virtual-list": "^1.0.1", + "clsx": "^2.1.1" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=18.0.0", + "react-dom": ">=18.0.0" + } + }, + "node_modules/@rc-component/tabs": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@rc-component/tabs/-/tabs-1.7.0.tgz", + "integrity": "sha512-J48cs2iBi7Ho3nptBxxIqizEliUC+ExE23faspUQKGQ550vaBlv3aGF8Epv/UB1vFWeoJDTW/dNzgIU0Qj5i/w==", + "license": "MIT", + "dependencies": { + "@rc-component/dropdown": "~1.0.0", + "@rc-component/menu": "~1.2.0", + "@rc-component/motion": "^1.1.3", + "@rc-component/resize-observer": "^1.0.0", + "@rc-component/util": "^1.3.0", + "clsx": "^2.1.1" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/textarea": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@rc-component/textarea/-/textarea-1.1.2.tgz", + "integrity": "sha512-9rMUEODWZDMovfScIEHXWlVZuPljZ2pd1LKNjslJVitn4SldEzq5vO1CL3yy3Dnib6zZal2r2DPtjy84VVpF6A==", + "license": "MIT", + "dependencies": { + "@rc-component/input": "~1.1.0", + "@rc-component/resize-observer": "^1.0.0", + "@rc-component/util": "^1.3.0", + "clsx": "^2.1.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/tooltip": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@rc-component/tooltip/-/tooltip-1.4.0.tgz", + "integrity": "sha512-8Rx5DCctIlLI4raR0I0xHjVTf1aF48+gKCNeAAo5bmF5VoR5YED+A/XEqzXv9KKqrJDRcd3Wndpxh2hyzrTtSg==", + "license": "MIT", + "dependencies": { + "@rc-component/trigger": "^3.7.1", + "@rc-component/util": "^1.3.0", + "clsx": "^2.1.1" + }, + "peerDependencies": { + "react": ">=18.0.0", + "react-dom": ">=18.0.0" + } + }, + "node_modules/@rc-component/tour": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@rc-component/tour/-/tour-2.3.0.tgz", + "integrity": "sha512-K04K9r32kUC+auBSQfr+Fss4SpSIS9JGe56oq/ALAX0p+i2ylYOI1MgR83yBY7v96eO6ZFXcM/igCQmubps0Ow==", + "license": "MIT", + "dependencies": { + "@rc-component/portal": "^2.2.0", + "@rc-component/trigger": "^3.0.0", + "@rc-component/util": "^1.7.0", + "clsx": "^2.1.1" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/tree": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@rc-component/tree/-/tree-1.2.4.tgz", + "integrity": "sha512-5Gli43+m4R7NhpYYz3Z61I6LOw9yI6CNChxgVtvrO6xB1qML7iE6QMLVMB3+FTjo2yF6uFdAHtqWPECz/zbX5w==", + "license": "MIT", + "dependencies": { + "@rc-component/motion": "^1.0.0", + "@rc-component/util": "^1.8.1", + "@rc-component/virtual-list": "^1.0.1", + "clsx": "^2.1.1" + }, + "engines": { + "node": ">=10.x" + }, + "peerDependencies": { + "react": "*", + "react-dom": "*" + } + }, + "node_modules/@rc-component/tree-select": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@rc-component/tree-select/-/tree-select-1.8.0.tgz", + "integrity": "sha512-iYsPq3nuLYvGqdvFAW+l+I9ASRIOVbMXyA8FGZg2lGym/GwkaWeJGzI4eJ7c9IOEhRj0oyfIN4S92Fl3J05mjQ==", + "license": "MIT", + "dependencies": { + "@rc-component/select": "~1.6.0", + "@rc-component/tree": "~1.2.0", + "@rc-component/util": "^1.4.0", + "clsx": "^2.1.1" + }, + "peerDependencies": { + "react": "*", + "react-dom": "*" + } + }, + "node_modules/@rc-component/trigger": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/@rc-component/trigger/-/trigger-3.9.0.tgz", + "integrity": "sha512-X8btpwfrT27AgrZVOz4swclhEHTZcqaHeQMXXBgveagOiakTa36uObXbdwerXffgV8G9dH1fAAE0DHtVQs8EHg==", + "license": "MIT", + "dependencies": { + "@rc-component/motion": "^1.1.4", + "@rc-component/portal": "^2.2.0", + "@rc-component/resize-observer": "^1.1.1", + "@rc-component/util": "^1.2.1", + "clsx": "^2.1.1" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=18.0.0", + "react-dom": ">=18.0.0" + } + }, + "node_modules/@rc-component/upload": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rc-component/upload/-/upload-1.1.0.tgz", + "integrity": "sha512-LIBV90mAnUE6VK5N4QvForoxZc4XqEYZimcp7fk+lkE4XwHHyJWxpIXQQwMU8hJM+YwBbsoZkGksL1sISWHQxw==", + "license": "MIT", + "dependencies": { + "@rc-component/util": "^1.3.0", + "clsx": "^2.1.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/util": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/@rc-component/util/-/util-1.10.1.tgz", + "integrity": "sha512-q++9S6rUa5Idb/xIBNz6jtvumw5+O5YV5V0g4iK9mn9jWs4oGJheE3ZN1kAnE723AXyaD8v95yeOASmdk8Jnng==", + "license": "MIT", + "dependencies": { + "is-mobile": "^5.0.0", + "react-is": "^18.2.0" + }, + "peerDependencies": { + "react": ">=18.0.0", + "react-dom": ">=18.0.0" + } + }, + "node_modules/@rc-component/virtual-list": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rc-component/virtual-list/-/virtual-list-1.0.2.tgz", + "integrity": "sha512-uvTol/mH74FYsn5loDGJxo+7kjkO4i+y4j87Re1pxJBs0FaeuMuLRzQRGaXwnMcV1CxpZLi2Z56Rerj2M00fjQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.20.0", + "@rc-component/resize-observer": "^1.0.1", + "@rc-component/util": "^1.4.0", + "clsx": "^2.1.1" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@reduxjs/toolkit": { + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-2.11.2.tgz", + "integrity": "sha512-Kd6kAHTA6/nUpp8mySPqj3en3dm0tdMIgbttnQ1xFMVpufoj+ADi8pXLBsd4xzTRHQa7t/Jv8W5UnCuW4kuWMQ==", + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.0.0", + "@standard-schema/utils": "^0.3.0", + "immer": "^11.0.0", + "redux": "^5.0.1", + "redux-thunk": "^3.1.0", + "reselect": "^5.1.0" + }, + "peerDependencies": { + "react": "^16.9.0 || ^17.0.0 || ^18 || ^19", + "react-redux": "^7.2.1 || ^8.1.3 || ^9.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-redux": { + "optional": true + } + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.2.tgz", + "integrity": "sha512-ZS4D1JPGn/MYQN/SYDWftIE/nVsM8j/AFOYEzAoOE2O3NktQOZru+/vYXGbR/qtdLdIfGCP0lcoJiYVzsEz+iQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.2.tgz", + "integrity": "sha512-vdFA9+C/rekyGce7WqHs/xoT0ioZEWaOFyZLIV1mEeNFaFDUQrPIo8Vs2GvJ6eetb3rzDUtUBgzto3ExpXJB3w==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.2.tgz", + "integrity": "sha512-BewSOwTHazv77DTYiAZXSqqKZ4KP/KonFisDMVU7PImxoWfB2aepnPhd2E4SWz3zDzYgDNbs6jBmTdgNnF02GA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.2.tgz", + "integrity": "sha512-m41o7M0YWtUdqk61Tb+jnKb2rN++iRdIASlExkUoKfIAH30DOHCB8fVLzSUpbWHHU8esmEioY62PxzexE8MBuA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.2.tgz", + "integrity": "sha512-jcojB9H7W/jS29pMKWAK1N+fU99vXodHDTatS3b3y/XSOCiHo0kkA74pL3jJmkoQtYpOCxDvaKs1fo2Ij/1X5w==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.2.tgz", + "integrity": "sha512-1jn6qDU5iiOgFgygDzKUuKP0maTi0/f1+sBLgvij/76C77Nm3ts6ufz9Bjg5q5dduxiUIxtq86JIoBvo1xQ4Ig==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.2.tgz", + "integrity": "sha512-QVLO/czFMdoMFSqlX3bcswcJNm/23r+qoa/jgtmFc/qEp6/jXmIkDjF/XIo8dPfGaiwy1xfQn8o77L79GeXFgw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.2.tgz", + "integrity": "sha512-hgO5Abm0w5UL6FEa2iFnZqo2KlK7TQ5QhV5x09hujBf7t5KzHQ1VmfPuTpqRy/rNlSxua3eWH374xxiVrP+lcA==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.2.tgz", + "integrity": "sha512-fy8rXxuYEu602abC8MUNaPjYLIFzReOaEIEMKMUa0rFEUxNpVXhs15KSSQ4qlqSaM7B6rcj9rDZgADh/IGDzLQ==", + "cpu": [ + "s390x" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.2.tgz", + "integrity": "sha512-0+bOkiQ779+r1WpoHOWHqncvyySci0vKph+myNDYb+im6meJAzHQXay6oEgnkHuUGouM1LKTZwqKpBow6Kj7CQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.2.tgz", + "integrity": "sha512-mjSkrzZK5Qsl0a9d1JgILOiuZOSDTVdKENcSXBoqbzSrspLR/4/IRVDo5wd2GgZjNss/viBFJdeq+j7qH2nypw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.2.tgz", + "integrity": "sha512-1v5vHasdfQAZoEHakBV72LIFAC9JjnymsiKxp+GEr/ma3+NJCPSaYK+qavInOovJkgwFrs7GccX2d6IgDA3Z5w==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.2.tgz", + "integrity": "sha512-mb1VobWn6NheziTk5/WEaR6AKVbrwT5sOi6C7zk3gy/pD1qtJfU1j4PgTo2NJnOtbL9Dl3Aeei8w9jJ7qC2jZQ==", + "cpu": [ + "wasm32" + ], + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "1.10.0", + "@emnapi/runtime": "1.10.0", + "@napi-rs/wasm-runtime": "^1.1.4" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.2.tgz", + "integrity": "sha512-SqKonF56vA/L2yHwHYcEp2P34URpOZ7d1fS635cTkpDnUtEGdUbhI6NzsPdqeSWvAAeGDrxjWjNmibDIdFf9/A==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.2.tgz", + "integrity": "sha512-v7qRI7gXLRINcOGXt+7YmAZ6iFuyZVMIoXAxhd8oP+DR9dLfL9GfNIx7PLMxmhZdvq8waUJBQiWN9EKNy+TRBQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-rc.7", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.7.tgz", + "integrity": "sha512-qujRfC8sFVInYSPPMLQByRh7zhwkGFS4+tyMQ83srV1qrxL4g8E2tyxVVyxd0+8QeBM1mIk9KbWxkegRr76XzA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "license": "MIT" + }, + "node_modules/@standard-schema/utils": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@standard-schema/utils/-/utils-0.3.0.tgz", + "integrity": "sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==", + "license": "MIT" + }, + "node_modules/@tailwindcss/node": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.2.4.tgz", + "integrity": "sha512-Ai7+yQPxz3ddrDQzFfBKdHEVBg0w3Zl83jnjuwxnZOsnH9pGn93QHQtpU0p/8rYWxvbFZHneni6p1BSLK4DkGA==", + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.5", + "enhanced-resolve": "^5.19.0", + "jiti": "^2.6.1", + "lightningcss": "1.32.0", + "magic-string": "^0.30.21", + "source-map-js": "^1.2.1", + "tailwindcss": "4.2.4" + } + }, + "node_modules/@tailwindcss/oxide": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.2.4.tgz", + "integrity": "sha512-9El/iI069DKDSXwTvB9J4BwdO5JhRrOweGaK25taBAvBXyXqJAX+Jqdvs8r8gKpsI/1m0LeJLyQYTf/WLrBT1Q==", + "license": "MIT", + "engines": { + "node": ">= 20" + }, + "optionalDependencies": { + "@tailwindcss/oxide-android-arm64": "4.2.4", + "@tailwindcss/oxide-darwin-arm64": "4.2.4", + "@tailwindcss/oxide-darwin-x64": "4.2.4", + "@tailwindcss/oxide-freebsd-x64": "4.2.4", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.2.4", + "@tailwindcss/oxide-linux-arm64-gnu": "4.2.4", + "@tailwindcss/oxide-linux-arm64-musl": "4.2.4", + "@tailwindcss/oxide-linux-x64-gnu": "4.2.4", + "@tailwindcss/oxide-linux-x64-musl": "4.2.4", + "@tailwindcss/oxide-wasm32-wasi": "4.2.4", + "@tailwindcss/oxide-win32-arm64-msvc": "4.2.4", + "@tailwindcss/oxide-win32-x64-msvc": "4.2.4" + } + }, + "node_modules/@tailwindcss/oxide-android-arm64": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.2.4.tgz", + "integrity": "sha512-e7MOr1SAn9U8KlZzPi1ZXGZHeC5anY36qjNwmZv9pOJ8E4Q6jmD1vyEHkQFmNOIN7twGPEMXRHmitN4zCMN03g==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-arm64": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.2.4.tgz", + "integrity": "sha512-tSC/Kbqpz/5/o/C2sG7QvOxAKqyd10bq+ypZNf+9Fi2TvbVbv1zNpcEptcsU7DPROaSbVgUXmrzKhurFvo5eDg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-x64": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.2.4.tgz", + "integrity": "sha512-yPyUXn3yO/ufR6+Kzv0t4fCg2qNr90jxXc5QqBpjlPNd0NqyDXcmQb/6weunH/MEDXW5dhyEi+agTDiqa3WsGg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-freebsd-x64": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.2.4.tgz", + "integrity": "sha512-BoMIB4vMQtZsXdGLVc2z+P9DbETkiopogfWZKbWwM8b/1Vinbs4YcUwo+kM/KeLkX3Ygrf4/PsRndKaYhS8Eiw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.2.4.tgz", + "integrity": "sha512-7pIHBLTHYRAlS7V22JNuTh33yLH4VElwKtB3bwchK/UaKUPpQ0lPQiOWcbm4V3WP2I6fNIJ23vABIvoy2izdwA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.2.4.tgz", + "integrity": "sha512-+E4wxJ0ZGOzSH325reXTWB48l42i93kQqMvDyz5gqfRzRZ7faNhnmvlV4EPGJU3QJM/3Ab5jhJ5pCRUsKn6OQw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-musl": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.2.4.tgz", + "integrity": "sha512-bBADEGAbo4ASnppIziaQJelekCxdMaxisrk+fB7Thit72IBnALp9K6ffA2G4ruj90G9XRS2VQ6q2bCKbfFV82g==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-gnu": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.2.4.tgz", + "integrity": "sha512-7Mx25E4WTfnht0TVRTyC00j3i0M+EeFe7wguMDTlX4mRxafznw0CA8WJkFjWYH5BlgELd1kSjuU2JiPnNZbJDA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-musl": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.2.4.tgz", + "integrity": "sha512-2wwJRF7nyhOR0hhHoChc04xngV3iS+akccHTGtz965FwF0up4b2lOdo6kI1EbDaEXKgvcrFBYcYQQ/rrnWFVfA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.2.4.tgz", + "integrity": "sha512-FQsqApeor8Fo6gUEklzmaa9994orJZZDBAlQpK2Mq+DslRKFJeD6AjHpBQ0kZFQohVr8o85PPh8eOy86VlSCmw==", + "bundleDependencies": [ + "@napi-rs/wasm-runtime", + "@emnapi/core", + "@emnapi/runtime", + "@tybys/wasm-util", + "@emnapi/wasi-threads", + "tslib" + ], + "cpu": [ + "wasm32" + ], + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.8.1", + "@emnapi/runtime": "^1.8.1", + "@emnapi/wasi-threads": "^1.1.0", + "@napi-rs/wasm-runtime": "^1.1.1", + "@tybys/wasm-util": "^0.10.1", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.2.4.tgz", + "integrity": "sha512-L9BXqxC4ToVgwMFqj3pmZRqyHEztulpUJzCxUtLjobMCzTPsGt1Fa9enKbOpY2iIyVtaHNeNvAK8ERP/64sqGQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-win32-x64-msvc": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.2.4.tgz", + "integrity": "sha512-ESlKG0EpVJQwRjXDDa9rLvhEAh0mhP1sF7sap9dNZT0yyl9SAG6T7gdP09EH0vIv0UNTlo6jPWyujD6559fZvw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/typography": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.19.tgz", + "integrity": "sha512-w31dd8HOx3k9vPtcQh5QHP9GwKcgbMp87j58qi6xgiBnFFtKEAgCWnDw4qUT8aHwkCp8bKvb/KGKWWHedP0AAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-selector-parser": "6.0.10" + }, + "peerDependencies": { + "tailwindcss": ">=3.0.0 || insiders || >=4.0.0-alpha.20 || >=4.0.0-beta.1" + } + }, + "node_modules/@tailwindcss/vite": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.2.4.tgz", + "integrity": "sha512-pCvohwOCspk3ZFn6eJzrrX3g4n2JY73H6MmYC87XfGPyTty4YsCjYTMArRZm/zOI8dIt3+EcrLHAFPe5A4bgtw==", + "license": "MIT", + "dependencies": { + "@tailwindcss/node": "4.2.4", + "@tailwindcss/oxide": "4.2.4", + "tailwindcss": "4.2.4" + }, + "peerDependencies": { + "vite": "^5.2.0 || ^6 || ^7 || ^8" + } + }, + "node_modules/@tanstack/react-virtual": { + "version": "3.13.24", + "resolved": "https://registry.npmjs.org/@tanstack/react-virtual/-/react-virtual-3.13.24.tgz", + "integrity": "sha512-aIJvz5OSkhNIhZIpYivrxrPTKYsjW9Uzy+sP/mx0S3sev2HyvPb7xmjbYvokzEpfgYHy/HjzJ2zFAETuUfgCpg==", + "license": "MIT", + "dependencies": { + "@tanstack/virtual-core": "3.14.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/@tanstack/virtual-core": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/@tanstack/virtual-core/-/virtual-core-3.14.0.tgz", + "integrity": "sha512-JLANqGy/D6k4Ujmh8Tr25lGimuOXNiaVyXaCAZS0W+1390sADdGnyUdSWNIfd49gebtIxGMij4IktRVzrdr12Q==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.2.tgz", + "integrity": "sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@types/node": { + "version": "22.19.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.17.tgz", + "integrity": "sha512-wGdMcf+vPYM6jikpS/qhg6WiqSV/OhG+jeeHT/KlVqxYfD40iYJf9/AE1uQxVWFvU7MipKRkRv8NSHiCGgPr8Q==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/react": { + "version": "19.2.14", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz", + "integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.2.3", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz", + "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.2.0" + } + }, + "node_modules/@types/use-sync-external-store": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.6.tgz", + "integrity": "sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==", + "license": "MIT" + }, + "node_modules/@vitejs/plugin-react": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-6.0.1.tgz", + "integrity": "sha512-l9X/E3cDb+xY3SWzlG1MOGt2usfEHGMNIaegaUGFsLkb3RCn/k8/TOXBcab+OndDI4TBtktT8/9BwwW8Vi9KUQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rolldown/pluginutils": "1.0.0-rc.7" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0", + "babel-plugin-react-compiler": "^1.0.0", + "vite": "^8.0.0" + }, + "peerDependenciesMeta": { + "@rolldown/plugin-babel": { + "optional": true + }, + "babel-plugin-react-compiler": { + "optional": true + } + } + }, + "node_modules/antd": { + "version": "6.3.7", + "resolved": "https://registry.npmjs.org/antd/-/antd-6.3.7.tgz", + "integrity": "sha512-WTHi4bHVNKpYXLHESzU0Tts7rRNQeL84Bph9dfI3Qw7mHbTulExDcYKNHny5CTXcrBBOpraXbU9miBAwUR5vaw==", + "license": "MIT", + "dependencies": { + "@ant-design/colors": "^8.0.1", + "@ant-design/cssinjs": "^2.1.2", + "@ant-design/cssinjs-utils": "^2.1.2", + "@ant-design/fast-color": "^3.0.1", + "@ant-design/icons": "^6.1.1", + "@ant-design/react-slick": "~2.0.0", + "@babel/runtime": "^7.28.4", + "@rc-component/cascader": "~1.14.0", + "@rc-component/checkbox": "~2.0.0", + "@rc-component/collapse": "~1.2.0", + "@rc-component/color-picker": "~3.1.1", + "@rc-component/dialog": "~1.8.4", + "@rc-component/drawer": "~1.4.2", + "@rc-component/dropdown": "~1.0.2", + "@rc-component/form": "~1.8.1", + "@rc-component/image": "~1.9.0", + "@rc-component/input": "~1.1.2", + "@rc-component/input-number": "~1.6.2", + "@rc-component/mentions": "~1.6.0", + "@rc-component/menu": "~1.2.0", + "@rc-component/motion": "^1.3.2", + "@rc-component/mutate-observer": "^2.0.1", + "@rc-component/notification": "~1.2.0", + "@rc-component/pagination": "~1.2.0", + "@rc-component/picker": "~1.9.1", + "@rc-component/progress": "~1.0.2", + "@rc-component/qrcode": "~1.1.1", + "@rc-component/rate": "~1.0.1", + "@rc-component/resize-observer": "^1.1.2", + "@rc-component/segmented": "~1.3.0", + "@rc-component/select": "~1.6.15", + "@rc-component/slider": "~1.0.1", + "@rc-component/steps": "~1.2.2", + "@rc-component/switch": "~1.0.3", + "@rc-component/table": "~1.9.1", + "@rc-component/tabs": "~1.7.0", + "@rc-component/textarea": "~1.1.2", + "@rc-component/tooltip": "~1.4.0", + "@rc-component/tour": "~2.3.0", + "@rc-component/tree": "~1.2.4", + "@rc-component/tree-select": "~1.8.0", + "@rc-component/trigger": "^3.9.0", + "@rc-component/upload": "~1.1.0", + "@rc-component/util": "^1.10.1", + "clsx": "^2.1.1", + "dayjs": "^1.11.11", + "scroll-into-view-if-needed": "^3.1.0", + "throttle-debounce": "^5.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/ant-design" + }, + "peerDependencies": { + "react": ">=18.0.0", + "react-dom": ">=18.0.0" + } + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/axios": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.16.0.tgz", + "integrity": "sha512-6hp5CwvTPlN2A31g5dxnwAX0orzM7pmCRDLnZSX772mv8WDqICwFjowHuPs04Mc8deIld1+ejhtaMn5vp6b+1w==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.16.0", + "form-data": "^4.0.5", + "proxy-from-env": "^2.1.0" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/compute-scroll-into-view": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/compute-scroll-into-view/-/compute-scroll-into-view-3.1.1.tgz", + "integrity": "sha512-VRhuHOLoKYOy4UbilLbUzbYg93XLjv2PncJC50EuTWPA3gaja1UjBsUP/D/9/juV3vQFr6XBEzn9KCAHdUvOHw==", + "license": "MIT" + }, + "node_modules/cookie": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz", + "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "license": "MIT", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "license": "MIT" + }, + "node_modules/dayjs": { + "version": "1.11.20", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.20.tgz", + "integrity": "sha512-YbwwqR/uYpeoP4pu043q+LTDLFBLApUP6VxRihdfNTqu4ubqMlGDLd6ErXhEgsyvY0K6nCs7nggYumAN+9uEuQ==", + "license": "MIT" + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/dom-serializer": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz", + "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==", + "dev": true, + "license": "MIT", + "dependencies": { + "domelementtype": "^2.0.1", + "domhandler": "^4.2.0", + "entities": "^2.0.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "BSD-2-Clause" + }, + "node_modules/domhandler": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", + "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "domelementtype": "^2.2.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", + "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "dom-serializer": "^1.0.1", + "domelementtype": "^2.2.0", + "domhandler": "^4.2.0" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/enhanced-resolve": { + "version": "5.21.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.21.0.tgz", + "integrity": "sha512-otxSQPw4lkOZWkHpB3zaEQs6gWYEsmX4xQF68ElXC/TWvGxGMSGOvoNbaLXm6/cS/fSfHtsEdw90y20PCd+sCA==", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.3.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/entities": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", + "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", + "dev": true, + "license": "BSD-2-Clause", + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/follow-redirects": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz", + "integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/front-matter": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/front-matter/-/front-matter-4.0.2.tgz", + "integrity": "sha512-I8ZuJ/qG92NWX8i5x1Y8qyj3vizhXS31OxjKDu3LKP+7/qBgfIKValiZIEwoVoJKUHlhWtYrktkxV1XsX+pPlg==", + "dev": true, + "license": "MIT", + "dependencies": { + "js-yaml": "^3.13.1" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/globals": { + "version": "17.6.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.6.0.tgz", + "integrity": "sha512-sepffkT8stwnIYbsMBpoCHJuJM5l98FUF2AnE07hfvE0m/qp3R586hw4jF4uadbhvg1ooIdzuu7CsfD2jzCaNA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.3.tgz", + "integrity": "sha512-ej4AhfhfL2Q2zpMmLo7U1Uv9+PyhIZpgQLGT1F9miIGmiCJIoCgSmczFdrc97mWT4kVY72KA+WnnhJ5pghSvSg==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/htmlparser2": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz", + "integrity": "sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==", + "dev": true, + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "MIT", + "dependencies": { + "domelementtype": "^2.0.1", + "domhandler": "^4.0.0", + "domutils": "^2.5.2", + "entities": "^2.0.0" + } + }, + "node_modules/immer": { + "version": "11.1.6", + "resolved": "https://registry.npmjs.org/immer/-/immer-11.1.6.tgz", + "integrity": "sha512-uwrF08UBQfxk49i9WcUeCx045wjB1zXEHNJmbYHPVVspxmjwSeWCoKbB8DEIvs3XkBJV6lcRAyLaWJ2+u3MMCw==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/immer" + } + }, + "node_modules/is-mobile": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-mobile/-/is-mobile-5.0.0.tgz", + "integrity": "sha512-Tz/yndySvLAEXh+Uk8liFCxOwVH6YutuR74utvOcu7I9Di+DwM0mtdPVZNaVvvBUM2OXxne/NhOs1zAO7riusQ==", + "license": "MIT" + }, + "node_modules/jiti": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz", + "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==", + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/js-yaml": { + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", + "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json2mq": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/json2mq/-/json2mq-0.2.0.tgz", + "integrity": "sha512-SzoRg7ux5DWTII9J2qkrZrqV1gt+rTaoufMxEzXbS26Uid0NwaJd123HcoB80TgubEppxxIGdNxCx50fEoEWQA==", + "license": "MIT", + "dependencies": { + "string-convert": "^0.2.0" + } + }, + "node_modules/lightningcss": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", + "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.32.0", + "lightningcss-darwin-arm64": "1.32.0", + "lightningcss-darwin-x64": "1.32.0", + "lightningcss-freebsd-x64": "1.32.0", + "lightningcss-linux-arm-gnueabihf": "1.32.0", + "lightningcss-linux-arm64-gnu": "1.32.0", + "lightningcss-linux-arm64-musl": "1.32.0", + "lightningcss-linux-x64-gnu": "1.32.0", + "lightningcss-linux-x64-musl": "1.32.0", + "lightningcss-win32-arm64-msvc": "1.32.0", + "lightningcss-win32-x64-msvc": "1.32.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", + "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", + "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", + "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", + "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", + "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", + "cpu": [ + "arm" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", + "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", + "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", + "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", + "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", + "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", + "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/linkify-it": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", + "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "uc.micro": "^1.0.1" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/markdown-it": { + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", + "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1", + "entities": "~2.1.0", + "linkify-it": "^3.0.1", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + }, + "bin": { + "markdown-it": "bin/markdown-it.js" + } + }, + "node_modules/markdown-it/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/markdown-it/node_modules/entities": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", + "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", + "dev": true, + "license": "BSD-2-Clause", + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", + "dev": true, + "license": "MIT" + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nanoid": { + "version": "3.3.12", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz", + "integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.15", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.15.tgz", + "integrity": "sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.12", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz", + "integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/prettier": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.3.tgz", + "integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/proxy-from-env": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz", + "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/react": { + "version": "19.2.6", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.6.tgz", + "integrity": "sha512-sfWGGfavi0xr8Pg0sVsyHMAOziVYKgPLNrS7ig+ivMNb3wbCBw3KxtflsGBAwD3gYQlE/AEZsTLgToRrSCjb0Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.2.6", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.6.tgz", + "integrity": "sha512-0prMI+hvBbPjsWnxDLxlCGyM8PN6UuWjEUCYmZhO67xIV9Xasa/r/vDnq+Xyq4Lo27g8QSbO5YzARu0D1Sps3g==", + "license": "MIT", + "dependencies": { + "scheduler": "^0.27.0" + }, + "peerDependencies": { + "react": "^19.2.6" + } + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "license": "MIT" + }, + "node_modules/react-redux": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.2.0.tgz", + "integrity": "sha512-ROY9fvHhwOD9ySfrF0wmvu//bKCQ6AeZZq1nJNtbDC+kk5DuSuNX/n6YWYF/SYy7bSba4D4FSz8DJeKY/S/r+g==", + "license": "MIT", + "dependencies": { + "@types/use-sync-external-store": "^0.0.6", + "use-sync-external-store": "^1.4.0" + }, + "peerDependencies": { + "@types/react": "^18.2.25 || ^19", + "react": "^18.0 || ^19", + "redux": "^5.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "redux": { + "optional": true + } + } + }, + "node_modules/react-router": { + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.15.0.tgz", + "integrity": "sha512-HW9vYwuM8f4yx66Izy8xfrzCM+SBJluoZcCbww9A1TySax11S5Vgw6fi3ZjMONw9J4gQwngL7PzkyIpJJpJ7RQ==", + "license": "MIT", + "dependencies": { + "cookie": "^1.0.1", + "set-cookie-parser": "^2.6.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "react": ">=18", + "react-dom": ">=18" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } + } + }, + "node_modules/react-router-dom": { + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.15.0.tgz", + "integrity": "sha512-VcrVg64Fo8nwBvDscajG8gRTLIuTC6N50nb22l2HOOV4PTOHgoGp8mUjy9wLiHYoYTSYI36tUnXZgasSRFZorQ==", + "license": "MIT", + "dependencies": { + "react-router": "7.15.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "react": ">=18", + "react-dom": ">=18" + } + }, + "node_modules/redux": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz", + "integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==", + "license": "MIT" + }, + "node_modules/redux-persist": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/redux-persist/-/redux-persist-6.0.0.tgz", + "integrity": "sha512-71LLMbUq2r02ng2We9S215LtPu3fY0KgaGE0k8WRgl6RkqxtGfl7HUozz1Dftwsb0D/5mZ8dwAaPbtnzfvbEwQ==", + "license": "MIT", + "peerDependencies": { + "redux": ">4.0.0" + } + }, + "node_modules/redux-thunk": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-3.1.0.tgz", + "integrity": "sha512-NW2r5T6ksUKXCabzhL9z+h206HQw/NJkcLm1GPImRQ8IzfXwRGqjVhKJGauHirT0DAuyy6hjdnMZaRoAcy0Klw==", + "license": "MIT", + "peerDependencies": { + "redux": "^5.0.0" + } + }, + "node_modules/reselect": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/reselect/-/reselect-5.1.1.tgz", + "integrity": "sha512-K/BG6eIky/SBpzfHZv/dd+9JBFiS4SWV7FIujVyJRux6e45+73RaUHXLmIR1f7WOMaQ0U1km6qwklRQxpJJY0w==", + "license": "MIT" + }, + "node_modules/rolldown": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.2.tgz", + "integrity": "sha512-oZx5zVDtVB44AW3eaifgDml1gWRDZGvjcfdxonE4swNPG98PrrXjaO/KrnUjzlMnztCCRVlUueA1kCXhARGk6g==", + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.132.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm64": "1.0.2", + "@rolldown/binding-darwin-arm64": "1.0.2", + "@rolldown/binding-darwin-x64": "1.0.2", + "@rolldown/binding-freebsd-x64": "1.0.2", + "@rolldown/binding-linux-arm-gnueabihf": "1.0.2", + "@rolldown/binding-linux-arm64-gnu": "1.0.2", + "@rolldown/binding-linux-arm64-musl": "1.0.2", + "@rolldown/binding-linux-ppc64-gnu": "1.0.2", + "@rolldown/binding-linux-s390x-gnu": "1.0.2", + "@rolldown/binding-linux-x64-gnu": "1.0.2", + "@rolldown/binding-linux-x64-musl": "1.0.2", + "@rolldown/binding-openharmony-arm64": "1.0.2", + "@rolldown/binding-wasm32-wasi": "1.0.2", + "@rolldown/binding-win32-arm64-msvc": "1.0.2", + "@rolldown/binding-win32-x64-msvc": "1.0.2" + } + }, + "node_modules/rolldown/node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "license": "MIT" + }, + "node_modules/scheduler": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", + "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", + "license": "MIT" + }, + "node_modules/scroll-into-view-if-needed": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/scroll-into-view-if-needed/-/scroll-into-view-if-needed-3.1.0.tgz", + "integrity": "sha512-49oNpRjWRvnU8NyGVmUaYG4jtTkNonFZI86MmGRDqBphEK2EXT9gdEUoQPZhuBM8yWHxCWbobltqYO5M4XrUvQ==", + "license": "MIT", + "dependencies": { + "compute-scroll-into-view": "^3.0.2" + } + }, + "node_modules/set-cookie-parser": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz", + "integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==", + "license": "MIT" + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/string-convert": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/string-convert/-/string-convert-0.2.1.tgz", + "integrity": "sha512-u/1tdPl4yQnPBjnVrmdLo9gtuLvELKsAoRapekWggdiQNvvvum+jYF329d84NAa660KQw7pB2n36KrIKVoXa3A==", + "license": "MIT" + }, + "node_modules/stylis": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.4.0.tgz", + "integrity": "sha512-5Z9ZpRzfuH6l/UAvCPAPUo3665Nk2wLaZU3x+TLHKVzIz33+sbJqbtrYoC3KD4/uVOr2Zp+L0LySezP9OHV9yA==", + "license": "MIT" + }, + "node_modules/tailwindcss": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.2.4.tgz", + "integrity": "sha512-HhKppgO81FQof5m6TEnuBWCZGgfRAWbaeOaGT00KOy/Pf/j6oUihdvBpA7ltCeAvZpFhW3j0PTclkxsd4IXYDA==", + "license": "MIT" + }, + "node_modules/tapable": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz", + "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==", + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/throttle-debounce": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/throttle-debounce/-/throttle-debounce-5.0.2.tgz", + "integrity": "sha512-B71/4oyj61iNH0KeCamLuE2rmKuTO5byTOSVwECM5FA7TiAiAW+UqTKZ9ERueC4qvgSttUhdmq1mXC3kJqGX7A==", + "license": "MIT", + "engines": { + "node": ">=12.22" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.16", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.16.tgz", + "integrity": "sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==", + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD", + "optional": true + }, + "node_modules/typescript": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", + "dev": true, + "license": "MIT" + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/use-sync-external-store": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz", + "integrity": "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==", + "license": "MIT", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/vite": { + "version": "8.0.14", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.14.tgz", + "integrity": "sha512-s4BJJ+5y1pYL6Otw51FHhVJQhPnuRinKig64g/1+EUNaJsd3gCKdD31IPFvswUgW9/60QT9oFHbZHbQK5imcxw==", + "license": "MIT", + "dependencies": { + "lightningcss": "^1.32.0", + "picomatch": "^4.0.4", + "postcss": "^8.5.15", + "rolldown": "1.0.2", + "tinyglobby": "^0.2.16" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.1.18", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vite-plugin-markdown": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/vite-plugin-markdown/-/vite-plugin-markdown-2.2.0.tgz", + "integrity": "sha512-eH2tXMZcx3EHb5okd+/0VIyoR8Gp9pGe24UXitOOcGkzObbJ1vl48aGOAbakoT88FBdzC8MXNkMfBIB9VK0Ndg==", + "dev": true, + "license": "MIT", + "dependencies": { + "domhandler": "^4.0.0", + "front-matter": "^4.0.0", + "htmlparser2": "^6.0.0", + "markdown-it": "^12.0.0" + }, + "peerDependencies": { + "vite": ">= 2.0.0" + } + }, + "node_modules/vite-plugin-port-checker": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/vite-plugin-port-checker/-/vite-plugin-port-checker-1.0.1.tgz", + "integrity": "sha512-Mx/Pj5zyu4oak+SKGwQyRLGAvnp9zx0nqjCLhaJoGJeZk2t4EarZojTcHGG0gPMJWj9X6c0MIfzaZDslg80/GA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "vite": ">=3.0.0" + } + } + } +} diff --git a/web/package.json b/web/package.json index ee3fbfd..126918d 100644 --- a/web/package.json +++ b/web/package.json @@ -1,5 +1,5 @@ { - "name": "delta-force-guide-web", + "name": "ahsarah-guide-web", "private": true, "version": "0.0.0", "type": "module", @@ -8,35 +8,37 @@ "build": "tsc -b && vite build", "build:tar": "pnpm build && tar -czf dist.tar.gz dist", "lint": "eslint .", - "preview": "vite preview", - "deploy": "pnpm build && gh-pages -d dist", - "predeploy": "pnpm build" + "preview": "vite preview" }, "dependencies": { "@ant-design/cssinjs": "^2.1.2", + "@ant-design/icons": "^6.2.2", "@reduxjs/toolkit": "^2.11.2", - "@tailwindcss/vite": "^4.2.2", - "@tanstack/react-virtual": "^3.13.23", - "antd": "^6.3.5", - "axios": "^1.14.0", + "@tailwindcss/vite": "^4.2.4", + "@tanstack/react-virtual": "^3.13.24", + "antd": "^6.3.7", + "axios": "^1.16.0", "dayjs": "^1.11.20", - "react": "^19.2.5", - "react-dom": "^19.2.5", + "react": "^19.2.6", + "react-dom": "^19.2.6", "react-redux": "^9.2.0", - "react-router": "^7.14.0", - "react-router-dom": "^7.14.0", + "react-router": "^7.15.0", + "react-router-dom": "^7.15.0", "redux-persist": "^6.0.0", - "tailwindcss": "^4.2.2" + "tailwindcss": "^4.2.4" }, "devDependencies": { + "@tailwindcss/typography": "^0.5.19", "@types/node": "^22.19.17", "@types/react": "^19.2.14", "@types/react-dom": "^19.2.3", "@vitejs/plugin-react": "^6.0.1", - "globals": "^17.4.0", - "prettier": "^3.8.1", - "typescript": "~6.0.2", - "vite": "^8.0.8" + "globals": "^17.6.0", + "prettier": "^3.8.3", + "typescript": "~6.0.3", + "vite": "^8.0.11", + "vite-plugin-markdown": "^2.2.0", + "vite-plugin-port-checker": "^1.0.1" }, "pnpm": { "ignoredBuiltDependencies": [ diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index 631d2f9..3751038 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -10,47 +10,53 @@ importers: dependencies: '@ant-design/cssinjs': specifier: ^2.1.2 - version: 2.1.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + version: 2.1.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@ant-design/icons': + specifier: ^6.2.2 + version: 6.2.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) '@reduxjs/toolkit': specifier: ^2.11.2 - version: 2.11.2(react-redux@9.2.0(@types/react@19.2.14)(react@19.2.5)(redux@5.0.1))(react@19.2.5) + version: 2.11.2(react-redux@9.2.0(@types/react@19.2.14)(react@19.2.6)(redux@5.0.1))(react@19.2.6) '@tailwindcss/vite': - specifier: ^4.2.2 - version: 4.2.2(vite@8.0.8(@types/node@22.19.17)(esbuild@0.27.4)(jiti@2.6.1)) + specifier: ^4.2.4 + version: 4.2.4(vite@8.0.11(@types/node@22.19.17)(jiti@2.6.1)) '@tanstack/react-virtual': - specifier: ^3.13.23 - version: 3.13.23(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + specifier: ^3.13.24 + version: 3.13.24(react-dom@19.2.6(react@19.2.6))(react@19.2.6) antd: - specifier: ^6.3.5 - version: 6.3.5(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + specifier: ^6.3.7 + version: 6.3.7(react-dom@19.2.6(react@19.2.6))(react@19.2.6) axios: - specifier: ^1.14.0 - version: 1.14.0 + specifier: ^1.16.0 + version: 1.16.0 dayjs: specifier: ^1.11.20 version: 1.11.20 react: - specifier: ^19.2.5 - version: 19.2.5 + specifier: ^19.2.6 + version: 19.2.6 react-dom: - specifier: ^19.2.5 - version: 19.2.5(react@19.2.5) + specifier: ^19.2.6 + version: 19.2.6(react@19.2.6) react-redux: specifier: ^9.2.0 - version: 9.2.0(@types/react@19.2.14)(react@19.2.5)(redux@5.0.1) + version: 9.2.0(@types/react@19.2.14)(react@19.2.6)(redux@5.0.1) react-router: - specifier: ^7.14.0 - version: 7.14.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + specifier: ^7.15.0 + version: 7.15.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) react-router-dom: - specifier: ^7.14.0 - version: 7.14.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + specifier: ^7.15.0 + version: 7.15.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) redux-persist: specifier: ^6.0.0 - version: 6.0.0(react@19.2.5)(redux@5.0.1) + version: 6.0.0(react@19.2.6)(redux@5.0.1) tailwindcss: - specifier: ^4.2.2 - version: 4.2.2 + specifier: ^4.2.4 + version: 4.2.4 devDependencies: + '@tailwindcss/typography': + specifier: ^0.5.19 + version: 0.5.19(tailwindcss@4.2.4) '@types/node': specifier: ^22.19.17 version: 22.19.17 @@ -62,19 +68,25 @@ importers: version: 19.2.3(@types/react@19.2.14) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(vite@8.0.8(@types/node@22.19.17)(esbuild@0.27.4)(jiti@2.6.1)) + version: 6.0.1(vite@8.0.11(@types/node@22.19.17)(jiti@2.6.1)) globals: - specifier: ^17.4.0 - version: 17.4.0 + specifier: ^17.6.0 + version: 17.6.0 prettier: - specifier: ^3.8.1 - version: 3.8.1 + specifier: ^3.8.3 + version: 3.8.3 typescript: - specifier: ~6.0.2 - version: 6.0.2 + specifier: ~6.0.3 + version: 6.0.3 vite: - specifier: ^8.0.8 - version: 8.0.8(@types/node@22.19.17)(esbuild@0.27.4)(jiti@2.6.1) + specifier: ^8.0.11 + version: 8.0.11(@types/node@22.19.17)(jiti@2.6.1) + vite-plugin-markdown: + specifier: ^2.2.0 + version: 2.2.0(vite@8.0.11(@types/node@22.19.17)(jiti@2.6.1)) + vite-plugin-port-checker: + specifier: ^1.0.1 + version: 1.0.1(vite@8.0.11(@types/node@22.19.17)(jiti@2.6.1)) packages: @@ -100,8 +112,8 @@ packages: '@ant-design/icons-svg@4.4.2': resolution: {integrity: sha512-vHbT+zJEVzllwP+CM+ul7reTEfBR0vgxFe7+lREAsAA7YGsYpboiq2sQNeQeRvh09GfQgs/GyFEvZpJ9cLXpXA==} - '@ant-design/icons@6.1.1': - resolution: {integrity: sha512-AMT4N2y++TZETNHiM77fs4a0uPVCJGuL5MTonk13Pvv7UN7sID1cNEZOc1qNqx6zLKAOilTEFAdAoAFKa0U//Q==} + '@ant-design/icons@6.2.2': + resolution: {integrity: sha512-zlJtE7AMbG12TeYVPhtBXwNpFInNy8mjLzcIm+0BPw16/b8ODG87YJ1G37VIF5VFscdgfsf6EweAFPTobu/3iQ==} engines: {node: '>=8'} peerDependencies: react: '>=16.0.0' @@ -117,11 +129,11 @@ packages: resolution: {integrity: sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==} engines: {node: '>=6.9.0'} - '@emnapi/core@1.9.2': - resolution: {integrity: sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA==} + '@emnapi/core@1.10.0': + resolution: {integrity: sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==} - '@emnapi/runtime@1.9.2': - resolution: {integrity: sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw==} + '@emnapi/runtime@1.10.0': + resolution: {integrity: sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==} '@emnapi/wasi-threads@1.2.1': resolution: {integrity: sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==} @@ -132,162 +144,6 @@ packages: '@emotion/unitless@0.7.5': resolution: {integrity: sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==} - '@esbuild/aix-ppc64@0.27.4': - resolution: {integrity: sha512-cQPwL2mp2nSmHHJlCyoXgHGhbEPMrEEU5xhkcy3Hs/O7nGZqEpZ2sUtLaL9MORLtDfRvVl2/3PAuEkYZH0Ty8Q==} - engines: {node: '>=18'} - cpu: [ppc64] - os: [aix] - - '@esbuild/android-arm64@0.27.4': - resolution: {integrity: sha512-gdLscB7v75wRfu7QSm/zg6Rx29VLdy9eTr2t44sfTW7CxwAtQghZ4ZnqHk3/ogz7xao0QAgrkradbBzcqFPasw==} - engines: {node: '>=18'} - cpu: [arm64] - os: [android] - - '@esbuild/android-arm@0.27.4': - resolution: {integrity: sha512-X9bUgvxiC8CHAGKYufLIHGXPJWnr0OCdR0anD2e21vdvgCI8lIfqFbnoeOz7lBjdrAGUhqLZLcQo6MLhTO2DKQ==} - engines: {node: '>=18'} - cpu: [arm] - os: [android] - - '@esbuild/android-x64@0.27.4': - resolution: {integrity: sha512-PzPFnBNVF292sfpfhiyiXCGSn9HZg5BcAz+ivBuSsl6Rk4ga1oEXAamhOXRFyMcjwr2DVtm40G65N3GLeH1Lvw==} - engines: {node: '>=18'} - cpu: [x64] - os: [android] - - '@esbuild/darwin-arm64@0.27.4': - resolution: {integrity: sha512-b7xaGIwdJlht8ZFCvMkpDN6uiSmnxxK56N2GDTMYPr2/gzvfdQN8rTfBsvVKmIVY/X7EM+/hJKEIbbHs9oA4tQ==} - engines: {node: '>=18'} - cpu: [arm64] - os: [darwin] - - '@esbuild/darwin-x64@0.27.4': - resolution: {integrity: sha512-sR+OiKLwd15nmCdqpXMnuJ9W2kpy0KigzqScqHI3Hqwr7IXxBp3Yva+yJwoqh7rE8V77tdoheRYataNKL4QrPw==} - engines: {node: '>=18'} - cpu: [x64] - os: [darwin] - - '@esbuild/freebsd-arm64@0.27.4': - resolution: {integrity: sha512-jnfpKe+p79tCnm4GVav68A7tUFeKQwQyLgESwEAUzyxk/TJr4QdGog9sqWNcUbr/bZt/O/HXouspuQDd9JxFSw==} - engines: {node: '>=18'} - cpu: [arm64] - os: [freebsd] - - '@esbuild/freebsd-x64@0.27.4': - resolution: {integrity: sha512-2kb4ceA/CpfUrIcTUl1wrP/9ad9Atrp5J94Lq69w7UwOMolPIGrfLSvAKJp0RTvkPPyn6CIWrNy13kyLikZRZQ==} - engines: {node: '>=18'} - cpu: [x64] - os: [freebsd] - - '@esbuild/linux-arm64@0.27.4': - resolution: {integrity: sha512-7nQOttdzVGth1iz57kxg9uCz57dxQLHWxopL6mYuYthohPKEK0vU0C3O21CcBK6KDlkYVcnDXY099HcCDXd9dA==} - engines: {node: '>=18'} - cpu: [arm64] - os: [linux] - - '@esbuild/linux-arm@0.27.4': - resolution: {integrity: sha512-aBYgcIxX/wd5n2ys0yESGeYMGF+pv6g0DhZr3G1ZG4jMfruU9Tl1i2Z+Wnj9/KjGz1lTLCcorqE2viePZqj4Eg==} - engines: {node: '>=18'} - cpu: [arm] - os: [linux] - - '@esbuild/linux-ia32@0.27.4': - resolution: {integrity: sha512-oPtixtAIzgvzYcKBQM/qZ3R+9TEUd1aNJQu0HhGyqtx6oS7qTpvjheIWBbes4+qu1bNlo2V4cbkISr8q6gRBFA==} - engines: {node: '>=18'} - cpu: [ia32] - os: [linux] - - '@esbuild/linux-loong64@0.27.4': - resolution: {integrity: sha512-8mL/vh8qeCoRcFH2nM8wm5uJP+ZcVYGGayMavi8GmRJjuI3g1v6Z7Ni0JJKAJW+m0EtUuARb6Lmp4hMjzCBWzA==} - engines: {node: '>=18'} - cpu: [loong64] - os: [linux] - - '@esbuild/linux-mips64el@0.27.4': - resolution: {integrity: sha512-1RdrWFFiiLIW7LQq9Q2NES+HiD4NyT8Itj9AUeCl0IVCA459WnPhREKgwrpaIfTOe+/2rdntisegiPWn/r/aAw==} - engines: {node: '>=18'} - cpu: [mips64el] - os: [linux] - - '@esbuild/linux-ppc64@0.27.4': - resolution: {integrity: sha512-tLCwNG47l3sd9lpfyx9LAGEGItCUeRCWeAx6x2Jmbav65nAwoPXfewtAdtbtit/pJFLUWOhpv0FpS6GQAmPrHA==} - engines: {node: '>=18'} - cpu: [ppc64] - os: [linux] - - '@esbuild/linux-riscv64@0.27.4': - resolution: {integrity: sha512-BnASypppbUWyqjd1KIpU4AUBiIhVr6YlHx/cnPgqEkNoVOhHg+YiSVxM1RLfiy4t9cAulbRGTNCKOcqHrEQLIw==} - engines: {node: '>=18'} - cpu: [riscv64] - os: [linux] - - '@esbuild/linux-s390x@0.27.4': - resolution: {integrity: sha512-+eUqgb/Z7vxVLezG8bVB9SfBie89gMueS+I0xYh2tJdw3vqA/0ImZJ2ROeWwVJN59ihBeZ7Tu92dF/5dy5FttA==} - engines: {node: '>=18'} - cpu: [s390x] - os: [linux] - - '@esbuild/linux-x64@0.27.4': - resolution: {integrity: sha512-S5qOXrKV8BQEzJPVxAwnryi2+Iq5pB40gTEIT69BQONqR7JH1EPIcQ/Uiv9mCnn05jff9umq/5nqzxlqTOg9NA==} - engines: {node: '>=18'} - cpu: [x64] - os: [linux] - - '@esbuild/netbsd-arm64@0.27.4': - resolution: {integrity: sha512-xHT8X4sb0GS8qTqiwzHqpY00C95DPAq7nAwX35Ie/s+LO9830hrMd3oX0ZMKLvy7vsonee73x0lmcdOVXFzd6Q==} - engines: {node: '>=18'} - cpu: [arm64] - os: [netbsd] - - '@esbuild/netbsd-x64@0.27.4': - resolution: {integrity: sha512-RugOvOdXfdyi5Tyv40kgQnI0byv66BFgAqjdgtAKqHoZTbTF2QqfQrFwa7cHEORJf6X2ht+l9ABLMP0dnKYsgg==} - engines: {node: '>=18'} - cpu: [x64] - os: [netbsd] - - '@esbuild/openbsd-arm64@0.27.4': - resolution: {integrity: sha512-2MyL3IAaTX+1/qP0O1SwskwcwCoOI4kV2IBX1xYnDDqthmq5ArrW94qSIKCAuRraMgPOmG0RDTA74mzYNQA9ow==} - engines: {node: '>=18'} - cpu: [arm64] - os: [openbsd] - - '@esbuild/openbsd-x64@0.27.4': - resolution: {integrity: sha512-u8fg/jQ5aQDfsnIV6+KwLOf1CmJnfu1ShpwqdwC0uA7ZPwFws55Ngc12vBdeUdnuWoQYx/SOQLGDcdlfXhYmXQ==} - engines: {node: '>=18'} - cpu: [x64] - os: [openbsd] - - '@esbuild/openharmony-arm64@0.27.4': - resolution: {integrity: sha512-JkTZrl6VbyO8lDQO3yv26nNr2RM2yZzNrNHEsj9bm6dOwwu9OYN28CjzZkH57bh4w0I2F7IodpQvUAEd1mbWXg==} - engines: {node: '>=18'} - cpu: [arm64] - os: [openharmony] - - '@esbuild/sunos-x64@0.27.4': - resolution: {integrity: sha512-/gOzgaewZJfeJTlsWhvUEmUG4tWEY2Spp5M20INYRg2ZKl9QPO3QEEgPeRtLjEWSW8FilRNacPOg8R1uaYkA6g==} - engines: {node: '>=18'} - cpu: [x64] - os: [sunos] - - '@esbuild/win32-arm64@0.27.4': - resolution: {integrity: sha512-Z9SExBg2y32smoDQdf1HRwHRt6vAHLXcxD2uGgO/v2jK7Y718Ix4ndsbNMU/+1Qiem9OiOdaqitioZwxivhXYg==} - engines: {node: '>=18'} - cpu: [arm64] - os: [win32] - - '@esbuild/win32-ia32@0.27.4': - resolution: {integrity: sha512-DAyGLS0Jz5G5iixEbMHi5KdiApqHBWMGzTtMiJ72ZOLhbu/bzxgAe8Ue8CTS3n3HbIUHQz/L51yMdGMeoxXNJw==} - engines: {node: '>=18'} - cpu: [ia32] - os: [win32] - - '@esbuild/win32-x64@0.27.4': - resolution: {integrity: sha512-+knoa0BDoeXgkNvvV1vvbZX4+hizelrkwmGJBdT17t8FNPwG2lKemmuMZlmaNQ3ws3DKKCxpb4zRZEIp3UxFCg==} - engines: {node: '>=18'} - cpu: [x64] - os: [win32] - '@jridgewell/gen-mapping@0.3.13': resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} @@ -304,14 +160,14 @@ packages: '@jridgewell/trace-mapping@0.3.31': resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} - '@napi-rs/wasm-runtime@1.1.3': - resolution: {integrity: sha512-xK9sGVbJWYb08+mTJt3/YV24WxvxpXcXtP6B172paPZ+Ts69Re9dAr7lKwJoeIx8OoeuimEiRZ7umkiUVClmmQ==} + '@napi-rs/wasm-runtime@1.1.4': + resolution: {integrity: sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==} peerDependencies: '@emnapi/core': ^1.7.1 '@emnapi/runtime': ^1.7.1 - '@oxc-project/types@0.124.0': - resolution: {integrity: sha512-VBFWMTBvHxS11Z5Lvlr3IWgrwhMTXV+Md+EQF0Xf60+wAdsGFTBx7X7K/hP4pi8N7dcm1RvcHwDxZ16Qx8keUg==} + '@oxc-project/types@0.128.0': + resolution: {integrity: sha512-huv1Y/LzBJkBVHt3OlC7u0zHBW9qXf1FdD7sGmc1rXc2P1mTwHssYv7jyGx5KAACSCH+9B3Bhn6Z9luHRvf7pQ==} '@rc-component/async-validator@5.1.0': resolution: {integrity: sha512-n4HcR5siNUXRX23nDizbZBQPO0ZM/5oTtmKZ6/eqL0L2bo747cklFdZGRN2f+c9qWGICwDzrhW0H7tE9PptdcA==} @@ -365,15 +221,15 @@ packages: react: '>=16.11.0' react-dom: '>=16.11.0' - '@rc-component/form@1.8.0': - resolution: {integrity: sha512-eUD5KKYnIZWmJwRA0vnyO/ovYUfHGU1svydY1OrqU5fw8Oz9Tdqvxvrlh0wl6xI/EW69dT7II49xpgOWzK3T5A==} + '@rc-component/form@1.8.1': + resolution: {integrity: sha512-8O7TB55Fi2mWIGvSnwZjk8jFqVNYyKDAswglwGShcbndxqzKz4cHwNtNaLjZlAeRge9wcB0LL8IWsC/Bl18raQ==} engines: {node: '>=8.x'} peerDependencies: react: '>=16.9.0' react-dom: '>=16.9.0' - '@rc-component/image@1.8.0': - resolution: {integrity: sha512-Dr41bFevLB5NgVaJhEUmNvbEf+ynAhim6W98ZW2xvCsdFISc2TYP4ZvCVdie3eaZdum2kieVcvpNHu+UrzAAHA==} + '@rc-component/image@1.9.0': + resolution: {integrity: sha512-khF7w7xkBH5B1bsBcI1FSUZdkyd1aqpl2eYyILCqCzzQH3XdfehGUaZTnptyaJJfs09/R5hv9jXWyazOMFIClQ==} peerDependencies: react: '>=16.9.0' react-dom: '>=16.9.0' @@ -426,8 +282,8 @@ packages: react: '>=16.9.0' react-dom: '>=16.9.0' - '@rc-component/overflow@1.0.0': - resolution: {integrity: sha512-GSlBeoE0XTBi5cf3zl8Qh7Uqhn7v8RrlJ8ajeVpEkNe94HWy5l5BQ0Mwn2TVUq9gdgbfEMUmTX7tJFAg7mz0Rw==} + '@rc-component/overflow@1.0.1': + resolution: {integrity: sha512-syfmgAABaHCnCDzPwHZ/2tuvIcpOO3jefYZMmfkN+pmo8HKTzsfhS57vxo4ksPdN0By+uWVJhJWNFozNBxi2eA==} peerDependencies: react: '>=16.9.0' react-dom: '>=16.9.0' @@ -589,6 +445,12 @@ packages: react: '>=18.0.0' react-dom: '>=18.0.0' + '@rc-component/util@1.10.1': + resolution: {integrity: sha512-q++9S6rUa5Idb/xIBNz6jtvumw5+O5YV5V0g4iK9mn9jWs4oGJheE3ZN1kAnE723AXyaD8v95yeOASmdk8Jnng==} + peerDependencies: + react: '>=18.0.0' + react-dom: '>=18.0.0' + '@rc-component/virtual-list@1.0.2': resolution: {integrity: sha512-uvTol/mH74FYsn5loDGJxo+7kjkO4i+y4j87Re1pxJBs0FaeuMuLRzQRGaXwnMcV1CxpZLi2Z56Rerj2M00fjQ==} engines: {node: '>=8.x'} @@ -607,103 +469,103 @@ packages: react-redux: optional: true - '@rolldown/binding-android-arm64@1.0.0-rc.15': - resolution: {integrity: sha512-YYe6aWruPZDtHNpwu7+qAHEMbQ/yRl6atqb/AhznLTnD3UY99Q1jE7ihLSahNWkF4EqRPVC4SiR4O0UkLK02tA==} + '@rolldown/binding-android-arm64@1.0.0-rc.18': + resolution: {integrity: sha512-lIDyUAfD7U3+BWKzdxMbJcsYHuqXqmGz40aeRqvuAm3y5TkJSYTBW2RDrn65DJFPQqVjUAUqq5uz8urzQ8aBdQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] - '@rolldown/binding-darwin-arm64@1.0.0-rc.15': - resolution: {integrity: sha512-oArR/ig8wNTPYsXL+Mzhs0oxhxfuHRfG7Ikw7jXsw8mYOtk71W0OkF2VEVh699pdmzjPQsTjlD1JIOoHkLP1Fg==} + '@rolldown/binding-darwin-arm64@1.0.0-rc.18': + resolution: {integrity: sha512-apJq2ktnGp27nSInMR5Vcj8kY6xJzDAvfdIFlpDcAK/w4cDO58qVoi1YQsES/SKiFNge/6e4CUzgjfHduYqWpQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] - '@rolldown/binding-darwin-x64@1.0.0-rc.15': - resolution: {integrity: sha512-YzeVqOqjPYvUbJSWJ4EDL8ahbmsIXQpgL3JVipmN+MX0XnXMeWomLN3Fb+nwCmP/jfyqte5I3XRSm7OfQrbyxw==} + '@rolldown/binding-darwin-x64@1.0.0-rc.18': + resolution: {integrity: sha512-5Ofot8xbs+pxRHJqm9/9N/4sTQOvdrwEsmPE9pdLEEoAbdZtG6F2LMDfO1sp6ZAtXJuJV/21ew2srq3W8NXB5g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] - '@rolldown/binding-freebsd-x64@1.0.0-rc.15': - resolution: {integrity: sha512-9Erhx956jeQ0nNTyif1+QWAXDRD38ZNjr//bSHrt6wDwB+QkAfl2q6Mn1k6OBPerznjRmbM10lgRb1Pli4xZPw==} + '@rolldown/binding-freebsd-x64@1.0.0-rc.18': + resolution: {integrity: sha512-7h8eeOTT1eyqJyx64BFCnWZpNm486hGWt2sqeLLgDxA0xI1oGZ9H7gK1S85uNGmBhkdPwa/6reTxfFFKvIsebw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.15': - resolution: {integrity: sha512-cVwk0w8QbZJGTnP/AHQBs5yNwmpgGYStL88t4UIaqcvYJWBfS0s3oqVLZPwsPU6M0zlW4GqjP0Zq5MnAGwFeGA==} + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.18': + resolution: {integrity: sha512-eRcm/HVt9U/JFu5RKAEKwGQYtDCKWLiaH6wOnsSEp6NMBb/3Os8LgHZlNyzMpFVNmiiMFlfb2zEnebfzJrHFmg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] - '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.15': - resolution: {integrity: sha512-eBZ/u8iAK9SoHGanqe/jrPnY0JvBN6iXbVOsbO38mbz+ZJsaobExAm1Iu+rxa4S1l2FjG0qEZn4Rc6X8n+9M+w==} + '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.18': + resolution: {integrity: sha512-SOrT/cT4ukTmgnrEz/Hg3m7LBnuCLW9psDeMKrimRWY4I8DmnO7Lco8W2vtqPmMkbVu8iJ+g4GFLVLLOVjJ9DQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [glibc] - '@rolldown/binding-linux-arm64-musl@1.0.0-rc.15': - resolution: {integrity: sha512-ZvRYMGrAklV9PEkgt4LQM6MjQX2P58HPAuecwYObY2DhS2t35R0I810bKi0wmaYORt6m/2Sm+Z+nFgb0WhXNcQ==} + '@rolldown/binding-linux-arm64-musl@1.0.0-rc.18': + resolution: {integrity: sha512-QWjdxN1HJCpBTAcZ5N5F7wju3gVPzRzSpmGzx7na0c/1qpN9CFil+xt+l9lV/1M6/gqHSNXCiqPfwhVJPeLnug==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [musl] - '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.15': - resolution: {integrity: sha512-VDpgGBzgfg5hLg+uBpCLoFG5kVvEyafmfxGUV0UHLcL5irxAK7PKNeC2MwClgk6ZAiNhmo9FLhRYgvMmedLtnQ==} + '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.18': + resolution: {integrity: sha512-ugCOyj7a4d9h3q9B+wXmf6g3a68UsjGh6dob5DHevHGMwDUbhsYNbSPxJsENcIttJZ9jv7qGM2UesLw5jqIhdg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] libc: [glibc] - '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.15': - resolution: {integrity: sha512-y1uXY3qQWCzcPgRJATPSOUP4tCemh4uBdY7e3EZbVwCJTY3gLJWnQABgeUetvED+bt1FQ01OeZwvhLS2bpNrAQ==} + '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.18': + resolution: {integrity: sha512-kKWRhbsotpXkGbcd5dllUWg5gEXcDAa8u5YnP9AV5DYNbvJHGzzuwv7dpmhc8NqKMJldl0a+x76IHbspEpEmdA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] libc: [glibc] - '@rolldown/binding-linux-x64-gnu@1.0.0-rc.15': - resolution: {integrity: sha512-023bTPBod7J3Y/4fzAN6QtpkSABR0rigtrwaP+qSEabUh5zf6ELr9Nc7GujaROuPY3uwdSIXWrvhn1KxOvurWA==} + '@rolldown/binding-linux-x64-gnu@1.0.0-rc.18': + resolution: {integrity: sha512-uCo8ElcCIAMyYAZyuIZ81oFkhTSIllNvUCHCAlbhlN4ji3uC28h7IIdlXyIvGO7HsuqnV9p3rD/bpH7XhIyhRw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [glibc] - '@rolldown/binding-linux-x64-musl@1.0.0-rc.15': - resolution: {integrity: sha512-witB2O0/hU4CgfOOKUoeFgQ4GktPi1eEbAhaLAIpgD6+ZnhcPkUtPsoKKHRzmOoWPZue46IThdSgdo4XneOLYw==} + '@rolldown/binding-linux-x64-musl@1.0.0-rc.18': + resolution: {integrity: sha512-XNOQZtuE6yUIvx4rwGemwh8kpL1xvU41FXy/s9K7T/3JVcqGzo3NfKM2HrbrGgfPYGFW42f07Wk++aOC6B9NWA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [musl] - '@rolldown/binding-openharmony-arm64@1.0.0-rc.15': - resolution: {integrity: sha512-UCL68NJ0Ud5zRipXZE9dF5PmirzJE4E4BCIOOssEnM7wLDsxjc6Qb0sGDxTNRTP53I6MZpygyCpY8Aa8sPfKPg==} + '@rolldown/binding-openharmony-arm64@1.0.0-rc.18': + resolution: {integrity: sha512-tSn/kzrfa7tNOXr7sEacDBN4YsIqTyLqh45IO0nHDwtpKIDNDJr+VFojt+4klSpChxB29JLyduSsE0MKEwa65A==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] - '@rolldown/binding-wasm32-wasi@1.0.0-rc.15': - resolution: {integrity: sha512-ApLruZq/ig+nhaE7OJm4lDjayUnOHVUa77zGeqnqZ9pn0ovdVbbNPerVibLXDmWeUZXjIYIT8V3xkT58Rm9u5Q==} - engines: {node: '>=14.0.0'} + '@rolldown/binding-wasm32-wasi@1.0.0-rc.18': + resolution: {integrity: sha512-+J9YGmc+czgqlhYmwun3S3O0FIZhsH8ep2456xwjAdIOmuJxM7xz4P4PtrxU+Bz17a/5bqPA8o3HAAoX0teUdg==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [wasm32] - '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.15': - resolution: {integrity: sha512-KmoUoU7HnN+Si5YWJigfTws1jz1bKBYDQKdbLspz0UaqjjFkddHsqorgiW1mxcAj88lYUE6NC/zJNwT+SloqtA==} + '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.18': + resolution: {integrity: sha512-zsu47DgU0FQzSwi6sU9dZoEdUv7pc1AptSEz/Z8HBg54sV0Pbs3N0+CrIbTsgiu6EyoaNN9CHboqbLaz9lhOyQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] - '@rolldown/binding-win32-x64-msvc@1.0.0-rc.15': - resolution: {integrity: sha512-3P2A8L+x75qavWLe/Dll3EYBJLQmtkJN8rfh+U/eR3MqMgL/h98PhYI+JFfXuDPgPeCB7iZAKiqii5vqOvnA0g==} + '@rolldown/binding-win32-x64-msvc@1.0.0-rc.18': + resolution: {integrity: sha512-7H+3yqGgmnlDTRRhw/xpYY9J1kf4GC681nVc4GqKhExZTDrVVrV2tsOR9kso0fvgBdcTCcQShx4SLLoHgaLwhg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] - '@rolldown/pluginutils@1.0.0-rc.15': - resolution: {integrity: sha512-UromN0peaE53IaBRe9W7CjrZgXl90fqGpK+mIZbA3qSTeYqg3pqpROBdIPvOG3F5ereDHNwoHBI2e50n1BDr1g==} + '@rolldown/pluginutils@1.0.0-rc.18': + resolution: {integrity: sha512-CUY5Mnhe64xQBGZEEXQ5WyZwsc1JU3vAZLIxtrsBt3LO6UOb+C8GunVKqe9sT8NeWb4lqSaoJtp2xo6GxT1MNw==} '@rolldown/pluginutils@1.0.0-rc.7': resolution: {integrity: sha512-qujRfC8sFVInYSPPMLQByRh7zhwkGFS4+tyMQ83srV1qrxL4g8E2tyxVVyxd0+8QeBM1mIk9KbWxkegRr76XzA==} @@ -714,69 +576,69 @@ packages: '@standard-schema/utils@0.3.0': resolution: {integrity: sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==} - '@tailwindcss/node@4.2.2': - resolution: {integrity: sha512-pXS+wJ2gZpVXqFaUEjojq7jzMpTGf8rU6ipJz5ovJV6PUGmlJ+jvIwGrzdHdQ80Sg+wmQxUFuoW1UAAwHNEdFA==} + '@tailwindcss/node@4.2.4': + resolution: {integrity: sha512-Ai7+yQPxz3ddrDQzFfBKdHEVBg0w3Zl83jnjuwxnZOsnH9pGn93QHQtpU0p/8rYWxvbFZHneni6p1BSLK4DkGA==} - '@tailwindcss/oxide-android-arm64@4.2.2': - resolution: {integrity: sha512-dXGR1n+P3B6748jZO/SvHZq7qBOqqzQ+yFrXpoOWWALWndF9MoSKAT3Q0fYgAzYzGhxNYOoysRvYlpixRBBoDg==} + '@tailwindcss/oxide-android-arm64@4.2.4': + resolution: {integrity: sha512-e7MOr1SAn9U8KlZzPi1ZXGZHeC5anY36qjNwmZv9pOJ8E4Q6jmD1vyEHkQFmNOIN7twGPEMXRHmitN4zCMN03g==} engines: {node: '>= 20'} cpu: [arm64] os: [android] - '@tailwindcss/oxide-darwin-arm64@4.2.2': - resolution: {integrity: sha512-iq9Qjr6knfMpZHj55/37ouZeykwbDqF21gPFtfnhCCKGDcPI/21FKC9XdMO/XyBM7qKORx6UIhGgg6jLl7BZlg==} + '@tailwindcss/oxide-darwin-arm64@4.2.4': + resolution: {integrity: sha512-tSC/Kbqpz/5/o/C2sG7QvOxAKqyd10bq+ypZNf+9Fi2TvbVbv1zNpcEptcsU7DPROaSbVgUXmrzKhurFvo5eDg==} engines: {node: '>= 20'} cpu: [arm64] os: [darwin] - '@tailwindcss/oxide-darwin-x64@4.2.2': - resolution: {integrity: sha512-BlR+2c3nzc8f2G639LpL89YY4bdcIdUmiOOkv2GQv4/4M0vJlpXEa0JXNHhCHU7VWOKWT/CjqHdTP8aUuDJkuw==} + '@tailwindcss/oxide-darwin-x64@4.2.4': + resolution: {integrity: sha512-yPyUXn3yO/ufR6+Kzv0t4fCg2qNr90jxXc5QqBpjlPNd0NqyDXcmQb/6weunH/MEDXW5dhyEi+agTDiqa3WsGg==} engines: {node: '>= 20'} cpu: [x64] os: [darwin] - '@tailwindcss/oxide-freebsd-x64@4.2.2': - resolution: {integrity: sha512-YUqUgrGMSu2CDO82hzlQ5qSb5xmx3RUrke/QgnoEx7KvmRJHQuZHZmZTLSuuHwFf0DJPybFMXMYf+WJdxHy/nQ==} + '@tailwindcss/oxide-freebsd-x64@4.2.4': + resolution: {integrity: sha512-BoMIB4vMQtZsXdGLVc2z+P9DbETkiopogfWZKbWwM8b/1Vinbs4YcUwo+kM/KeLkX3Ygrf4/PsRndKaYhS8Eiw==} engines: {node: '>= 20'} cpu: [x64] os: [freebsd] - '@tailwindcss/oxide-linux-arm-gnueabihf@4.2.2': - resolution: {integrity: sha512-FPdhvsW6g06T9BWT0qTwiVZYE2WIFo2dY5aCSpjG/S/u1tby+wXoslXS0kl3/KXnULlLr1E3NPRRw0g7t2kgaQ==} + '@tailwindcss/oxide-linux-arm-gnueabihf@4.2.4': + resolution: {integrity: sha512-7pIHBLTHYRAlS7V22JNuTh33yLH4VElwKtB3bwchK/UaKUPpQ0lPQiOWcbm4V3WP2I6fNIJ23vABIvoy2izdwA==} engines: {node: '>= 20'} cpu: [arm] os: [linux] - '@tailwindcss/oxide-linux-arm64-gnu@4.2.2': - resolution: {integrity: sha512-4og1V+ftEPXGttOO7eCmW7VICmzzJWgMx+QXAJRAhjrSjumCwWqMfkDrNu1LXEQzNAwz28NCUpucgQPrR4S2yw==} + '@tailwindcss/oxide-linux-arm64-gnu@4.2.4': + resolution: {integrity: sha512-+E4wxJ0ZGOzSH325reXTWB48l42i93kQqMvDyz5gqfRzRZ7faNhnmvlV4EPGJU3QJM/3Ab5jhJ5pCRUsKn6OQw==} engines: {node: '>= 20'} cpu: [arm64] os: [linux] libc: [glibc] - '@tailwindcss/oxide-linux-arm64-musl@4.2.2': - resolution: {integrity: sha512-oCfG/mS+/+XRlwNjnsNLVwnMWYH7tn/kYPsNPh+JSOMlnt93mYNCKHYzylRhI51X+TbR+ufNhhKKzm6QkqX8ag==} + '@tailwindcss/oxide-linux-arm64-musl@4.2.4': + resolution: {integrity: sha512-bBADEGAbo4ASnppIziaQJelekCxdMaxisrk+fB7Thit72IBnALp9K6ffA2G4ruj90G9XRS2VQ6q2bCKbfFV82g==} engines: {node: '>= 20'} cpu: [arm64] os: [linux] libc: [musl] - '@tailwindcss/oxide-linux-x64-gnu@4.2.2': - resolution: {integrity: sha512-rTAGAkDgqbXHNp/xW0iugLVmX62wOp2PoE39BTCGKjv3Iocf6AFbRP/wZT/kuCxC9QBh9Pu8XPkv/zCZB2mcMg==} + '@tailwindcss/oxide-linux-x64-gnu@4.2.4': + resolution: {integrity: sha512-7Mx25E4WTfnht0TVRTyC00j3i0M+EeFe7wguMDTlX4mRxafznw0CA8WJkFjWYH5BlgELd1kSjuU2JiPnNZbJDA==} engines: {node: '>= 20'} cpu: [x64] os: [linux] libc: [glibc] - '@tailwindcss/oxide-linux-x64-musl@4.2.2': - resolution: {integrity: sha512-XW3t3qwbIwiSyRCggeO2zxe3KWaEbM0/kW9e8+0XpBgyKU4ATYzcVSMKteZJ1iukJ3HgHBjbg9P5YPRCVUxlnQ==} + '@tailwindcss/oxide-linux-x64-musl@4.2.4': + resolution: {integrity: sha512-2wwJRF7nyhOR0hhHoChc04xngV3iS+akccHTGtz965FwF0up4b2lOdo6kI1EbDaEXKgvcrFBYcYQQ/rrnWFVfA==} engines: {node: '>= 20'} cpu: [x64] os: [linux] libc: [musl] - '@tailwindcss/oxide-wasm32-wasi@4.2.2': - resolution: {integrity: sha512-eKSztKsmEsn1O5lJ4ZAfyn41NfG7vzCg496YiGtMDV86jz1q/irhms5O0VrY6ZwTUkFy/EKG3RfWgxSI3VbZ8Q==} + '@tailwindcss/oxide-wasm32-wasi@4.2.4': + resolution: {integrity: sha512-FQsqApeor8Fo6gUEklzmaa9994orJZZDBAlQpK2Mq+DslRKFJeD6AjHpBQ0kZFQohVr8o85PPh8eOy86VlSCmw==} engines: {node: '>=14.0.0'} cpu: [wasm32] bundledDependencies: @@ -787,38 +649,43 @@ packages: - '@emnapi/wasi-threads' - tslib - '@tailwindcss/oxide-win32-arm64-msvc@4.2.2': - resolution: {integrity: sha512-qPmaQM4iKu5mxpsrWZMOZRgZv1tOZpUm+zdhhQP0VhJfyGGO3aUKdbh3gDZc/dPLQwW4eSqWGrrcWNBZWUWaXQ==} + '@tailwindcss/oxide-win32-arm64-msvc@4.2.4': + resolution: {integrity: sha512-L9BXqxC4ToVgwMFqj3pmZRqyHEztulpUJzCxUtLjobMCzTPsGt1Fa9enKbOpY2iIyVtaHNeNvAK8ERP/64sqGQ==} engines: {node: '>= 20'} cpu: [arm64] os: [win32] - '@tailwindcss/oxide-win32-x64-msvc@4.2.2': - resolution: {integrity: sha512-1T/37VvI7WyH66b+vqHj/cLwnCxt7Qt3WFu5Q8hk65aOvlwAhs7rAp1VkulBJw/N4tMirXjVnylTR72uI0HGcA==} + '@tailwindcss/oxide-win32-x64-msvc@4.2.4': + resolution: {integrity: sha512-ESlKG0EpVJQwRjXDDa9rLvhEAh0mhP1sF7sap9dNZT0yyl9SAG6T7gdP09EH0vIv0UNTlo6jPWyujD6559fZvw==} engines: {node: '>= 20'} cpu: [x64] os: [win32] - '@tailwindcss/oxide@4.2.2': - resolution: {integrity: sha512-qEUA07+E5kehxYp9BVMpq9E8vnJuBHfJEC0vPC5e7iL/hw7HR61aDKoVoKzrG+QKp56vhNZe4qwkRmMC0zDLvg==} + '@tailwindcss/oxide@4.2.4': + resolution: {integrity: sha512-9El/iI069DKDSXwTvB9J4BwdO5JhRrOweGaK25taBAvBXyXqJAX+Jqdvs8r8gKpsI/1m0LeJLyQYTf/WLrBT1Q==} engines: {node: '>= 20'} - '@tailwindcss/vite@4.2.2': - resolution: {integrity: sha512-mEiF5HO1QqCLXoNEfXVA1Tzo+cYsrqV7w9Juj2wdUFyW07JRenqMG225MvPwr3ZD9N1bFQj46X7r33iHxLUW0w==} + '@tailwindcss/typography@0.5.19': + resolution: {integrity: sha512-w31dd8HOx3k9vPtcQh5QHP9GwKcgbMp87j58qi6xgiBnFFtKEAgCWnDw4qUT8aHwkCp8bKvb/KGKWWHedP0AAg==} + peerDependencies: + tailwindcss: '>=3.0.0 || insiders || >=4.0.0-alpha.20 || >=4.0.0-beta.1' + + '@tailwindcss/vite@4.2.4': + resolution: {integrity: sha512-pCvohwOCspk3ZFn6eJzrrX3g4n2JY73H6MmYC87XfGPyTty4YsCjYTMArRZm/zOI8dIt3+EcrLHAFPe5A4bgtw==} peerDependencies: vite: ^5.2.0 || ^6 || ^7 || ^8 - '@tanstack/react-virtual@3.13.23': - resolution: {integrity: sha512-XnMRnHQ23piOVj2bzJqHrRrLg4r+F86fuBcwteKfbIjJrtGxb4z7tIvPVAe4B+4UVwo9G4Giuz5fmapcrnZ0OQ==} + '@tanstack/react-virtual@3.13.24': + resolution: {integrity: sha512-aIJvz5OSkhNIhZIpYivrxrPTKYsjW9Uzy+sP/mx0S3sev2HyvPb7xmjbYvokzEpfgYHy/HjzJ2zFAETuUfgCpg==} peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - '@tanstack/virtual-core@3.13.23': - resolution: {integrity: sha512-zSz2Z2HNyLjCplANTDyl3BcdQJc2k1+yyFoKhNRmCr7V7dY8o8q5m8uFTI1/Pg1kL+Hgrz6u3Xo6eFUB7l66cg==} + '@tanstack/virtual-core@3.14.0': + resolution: {integrity: sha512-JLANqGy/D6k4Ujmh8Tr25lGimuOXNiaVyXaCAZS0W+1390sADdGnyUdSWNIfd49gebtIxGMij4IktRVzrdr12Q==} - '@tybys/wasm-util@0.10.1': - resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} + '@tybys/wasm-util@0.10.2': + resolution: {integrity: sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==} '@types/node@22.19.17': resolution: {integrity: sha512-wGdMcf+vPYM6jikpS/qhg6WiqSV/OhG+jeeHT/KlVqxYfD40iYJf9/AE1uQxVWFvU7MipKRkRv8NSHiCGgPr8Q==} @@ -847,17 +714,23 @@ packages: babel-plugin-react-compiler: optional: true - antd@6.3.5: - resolution: {integrity: sha512-8BPz9lpZWQm42PTx7yL4KxWAotVuqINiKcoYRcLtdd5BFmAcAZicVyFTnBJyRDlzGZFZeRW3foGu6jXYFnej6Q==} + antd@6.3.7: + resolution: {integrity: sha512-WTHi4bHVNKpYXLHESzU0Tts7rRNQeL84Bph9dfI3Qw7mHbTulExDcYKNHny5CTXcrBBOpraXbU9miBAwUR5vaw==} peerDependencies: react: '>=18.0.0' react-dom: '>=18.0.0' + argparse@1.0.10: + resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + + argparse@2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - axios@1.14.0: - resolution: {integrity: sha512-3Y8yrqLSwjuzpXuZ0oIYZ/XGgLwUIBU3uLvbcpb0pidD9ctpShJd43KSlEEkVQg6DS0G9NKyzOvBfUtDKEyHvQ==} + axios@1.16.0: + resolution: {integrity: sha512-6hp5CwvTPlN2A31g5dxnwAX0orzM7pmCRDLnZSX772mv8WDqICwFjowHuPs04Mc8deIld1+ejhtaMn5vp6b+1w==} call-bind-apply-helpers@1.0.2: resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} @@ -878,6 +751,11 @@ packages: resolution: {integrity: sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==} engines: {node: '>=18'} + cssesc@3.0.0: + resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} + engines: {node: '>=4'} + hasBin: true + csstype@3.2.3: resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} @@ -892,6 +770,19 @@ packages: resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} engines: {node: '>=8'} + dom-serializer@1.4.1: + resolution: {integrity: sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==} + + domelementtype@2.3.0: + resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==} + + domhandler@4.3.1: + resolution: {integrity: sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==} + engines: {node: '>= 4'} + + domutils@2.8.0: + resolution: {integrity: sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==} + dunder-proto@1.0.1: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} @@ -900,6 +791,12 @@ packages: resolution: {integrity: sha512-Qohcme7V1inbAfvjItgw0EaxVX5q2rdVEZHRBrEQdRZTssLDGsL8Lwrznl8oQ/6kuTJONLaDcGjkNP247XEhcA==} engines: {node: '>=10.13.0'} + entities@2.1.0: + resolution: {integrity: sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==} + + entities@2.2.0: + resolution: {integrity: sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==} + es-define-property@1.0.1: resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} engines: {node: '>= 0.4'} @@ -916,9 +813,9 @@ packages: resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} engines: {node: '>= 0.4'} - esbuild@0.27.4: - resolution: {integrity: sha512-Rq4vbHnYkK5fws5NF7MYTU68FPRE1ajX7heQ/8QXXWqNgqqJ/GkmmyxIzUnf2Sr/bakf8l54716CcMGHYhMrrQ==} - engines: {node: '>=18'} + esprima@4.0.1: + resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + engines: {node: '>=4'} hasBin: true fdir@6.5.0: @@ -930,8 +827,8 @@ packages: picomatch: optional: true - follow-redirects@1.15.11: - resolution: {integrity: sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==} + follow-redirects@1.16.0: + resolution: {integrity: sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==} engines: {node: '>=4.0'} peerDependencies: debug: '*' @@ -943,6 +840,9 @@ packages: resolution: {integrity: sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==} engines: {node: '>= 6'} + front-matter@4.0.2: + resolution: {integrity: sha512-I8ZuJ/qG92NWX8i5x1Y8qyj3vizhXS31OxjKDu3LKP+7/qBgfIKValiZIEwoVoJKUHlhWtYrktkxV1XsX+pPlg==} + fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -959,8 +859,8 @@ packages: resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} engines: {node: '>= 0.4'} - globals@17.4.0: - resolution: {integrity: sha512-hjrNztw/VajQwOLsMNT1cbJiH2muO3OROCHnbehc8eY5JyD2gqz4AcMHPqgaOR59DjgUjYAYLeH699g/eWi2jw==} + globals@17.6.0: + resolution: {integrity: sha512-sepffkT8stwnIYbsMBpoCHJuJM5l98FUF2AnE07hfvE0m/qp3R586hw4jF4uadbhvg1ooIdzuu7CsfD2jzCaNA==} engines: {node: '>=18'} gopd@1.2.0: @@ -978,10 +878,13 @@ packages: resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} engines: {node: '>= 0.4'} - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + hasown@2.0.3: + resolution: {integrity: sha512-ej4AhfhfL2Q2zpMmLo7U1Uv9+PyhIZpgQLGT1F9miIGmiCJIoCgSmczFdrc97mWT4kVY72KA+WnnhJ5pghSvSg==} engines: {node: '>= 0.4'} + htmlparser2@6.1.0: + resolution: {integrity: sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==} + immer@11.1.4: resolution: {integrity: sha512-XREFCPo6ksxVzP4E0ekD5aMdf8WMwmdNaz6vuvxgI40UaEiu6q3p8X52aU6GdyvLY3XXX/8R7JOTXStz/nBbRw==} @@ -992,6 +895,10 @@ packages: resolution: {integrity: sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==} hasBin: true + js-yaml@3.14.2: + resolution: {integrity: sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==} + hasBin: true + json2mq@0.2.0: resolution: {integrity: sha512-SzoRg7ux5DWTII9J2qkrZrqV1gt+rTaoufMxEzXbS26Uid0NwaJd123HcoB80TgubEppxxIGdNxCx50fEoEWQA==} @@ -1069,13 +976,23 @@ packages: resolution: {integrity: sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==} engines: {node: '>= 12.0.0'} + linkify-it@3.0.3: + resolution: {integrity: sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==} + magic-string@0.30.21: resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + markdown-it@12.3.2: + resolution: {integrity: sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==} + hasBin: true + math-intrinsics@1.1.0: resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} engines: {node: '>= 0.4'} + mdurl@1.0.1: + resolution: {integrity: sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==} + mime-db@1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} @@ -1084,8 +1001,8 @@ packages: resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} engines: {node: '>= 0.6'} - nanoid@3.3.11: - resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} + nanoid@3.3.12: + resolution: {integrity: sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true @@ -1096,12 +1013,16 @@ packages: resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} engines: {node: '>=12'} - postcss@8.5.8: - resolution: {integrity: sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==} + postcss-selector-parser@6.0.10: + resolution: {integrity: sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==} + engines: {node: '>=4'} + + postcss@8.5.14: + resolution: {integrity: sha512-SoSL4+OSEtR99LHFZQiJLkT59C5B1amGO1NzTwj7TT1qCUgUO6hxOvzkOYxD+vMrXBM3XJIKzokoERdqQq/Zmg==} engines: {node: ^10 || ^12 || >=14} - prettier@3.8.1: - resolution: {integrity: sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==} + prettier@3.8.3: + resolution: {integrity: sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==} engines: {node: '>=14'} hasBin: true @@ -1109,10 +1030,10 @@ packages: resolution: {integrity: sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==} engines: {node: '>=10'} - react-dom@19.2.5: - resolution: {integrity: sha512-J5bAZz+DXMMwW/wV3xzKke59Af6CHY7G4uYLN1OvBcKEsWOs4pQExj86BBKamxl/Ik5bx9whOrvBlSDfWzgSag==} + react-dom@19.2.6: + resolution: {integrity: sha512-0prMI+hvBbPjsWnxDLxlCGyM8PN6UuWjEUCYmZhO67xIV9Xasa/r/vDnq+Xyq4Lo27g8QSbO5YzARu0D1Sps3g==} peerDependencies: - react: ^19.2.5 + react: ^19.2.6 react-is@18.3.1: resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} @@ -1129,15 +1050,15 @@ packages: redux: optional: true - react-router-dom@7.14.0: - resolution: {integrity: sha512-2G3ajSVSZMEtmTjIklRWlNvo8wICEpLihfD/0YMDxbWK2UyP5EGfnoIn9AIQGnF3G/FX0MRbHXdFcD+rL1ZreQ==} + react-router-dom@7.15.0: + resolution: {integrity: sha512-VcrVg64Fo8nwBvDscajG8gRTLIuTC6N50nb22l2HOOV4PTOHgoGp8mUjy9wLiHYoYTSYI36tUnXZgasSRFZorQ==} engines: {node: '>=20.0.0'} peerDependencies: react: '>=18' react-dom: '>=18' - react-router@7.14.0: - resolution: {integrity: sha512-m/xR9N4LQLmAS0ZhkY2nkPA1N7gQ5TUVa5n8TgANuDTARbn1gt+zLPXEm7W0XDTbrQ2AJSJKhoa6yx1D8BcpxQ==} + react-router@7.15.0: + resolution: {integrity: sha512-HW9vYwuM8f4yx66Izy8xfrzCM+SBJluoZcCbww9A1TySax11S5Vgw6fi3ZjMONw9J4gQwngL7PzkyIpJJpJ7RQ==} engines: {node: '>=20.0.0'} peerDependencies: react: '>=18' @@ -1146,8 +1067,8 @@ packages: react-dom: optional: true - react@19.2.5: - resolution: {integrity: sha512-llUJLzz1zTUBrskt2pwZgLq59AemifIftw4aB7JxOqf1HY2FDaGDxgwpAPVzHU1kdWabH7FauP4i1oEeer2WCA==} + react@19.2.6: + resolution: {integrity: sha512-sfWGGfavi0xr8Pg0sVsyHMAOziVYKgPLNrS7ig+ivMNb3wbCBw3KxtflsGBAwD3gYQlE/AEZsTLgToRrSCjb0Q==} engines: {node: '>=0.10.0'} redux-persist@6.0.0: @@ -1170,8 +1091,8 @@ packages: reselect@5.1.1: resolution: {integrity: sha512-K/BG6eIky/SBpzfHZv/dd+9JBFiS4SWV7FIujVyJRux6e45+73RaUHXLmIR1f7WOMaQ0U1km6qwklRQxpJJY0w==} - rolldown@1.0.0-rc.15: - resolution: {integrity: sha512-Ff31guA5zT6WjnGp0SXw76X6hzGRk/OQq2hE+1lcDe+lJdHSgnSX6nK3erbONHyCbpSj9a9E+uX/OvytZoWp2g==} + rolldown@1.0.0-rc.18: + resolution: {integrity: sha512-phmyKBpuBdRYDf4hgyynGAYn/rDDe+iZXKVJ7WX5b1zQzpLkP5oJRPGsfJuHdzPMlyyEO/4sPW6yfSx2gf7lVg==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true @@ -1188,35 +1109,41 @@ packages: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} + sprintf-js@1.0.3: + resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + string-convert@0.2.1: resolution: {integrity: sha512-u/1tdPl4yQnPBjnVrmdLo9gtuLvELKsAoRapekWggdiQNvvvum+jYF329d84NAa660KQw7pB2n36KrIKVoXa3A==} stylis@4.3.6: resolution: {integrity: sha512-yQ3rwFWRfwNUY7H5vpU0wfdkNSnvnJinhF9830Swlaxl03zsOjCfmX0ugac+3LtK0lYSgwL/KXc8oYL3mG4YFQ==} - tailwindcss@4.2.2: - resolution: {integrity: sha512-KWBIxs1Xb6NoLdMVqhbhgwZf2PGBpPEiwOqgI4pFIYbNTfBXiKYyWoTsXgBQ9WFg/OlhnvHaY+AEpW7wSmFo2Q==} + tailwindcss@4.2.4: + resolution: {integrity: sha512-HhKppgO81FQof5m6TEnuBWCZGgfRAWbaeOaGT00KOy/Pf/j6oUihdvBpA7ltCeAvZpFhW3j0PTclkxsd4IXYDA==} - tapable@2.3.0: - resolution: {integrity: sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==} + tapable@2.3.3: + resolution: {integrity: sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==} engines: {node: '>=6'} throttle-debounce@5.0.2: resolution: {integrity: sha512-B71/4oyj61iNH0KeCamLuE2rmKuTO5byTOSVwECM5FA7TiAiAW+UqTKZ9ERueC4qvgSttUhdmq1mXC3kJqGX7A==} engines: {node: '>=12.22'} - tinyglobby@0.2.15: - resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} + tinyglobby@0.2.16: + resolution: {integrity: sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==} engines: {node: '>=12.0.0'} tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} - typescript@6.0.2: - resolution: {integrity: sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ==} + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} engines: {node: '>=14.17'} hasBin: true + uc.micro@1.0.6: + resolution: {integrity: sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==} + undici-types@6.21.0: resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} @@ -1225,13 +1152,26 @@ packages: peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - vite@8.0.8: - resolution: {integrity: sha512-dbU7/iLVa8KZALJyLOBOQ88nOXtNG8vxKuOT4I2mD+Ya70KPceF4IAmDsmU0h1Qsn5bPrvsY9HJstCRh3hG6Uw==} + util-deprecate@1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + + vite-plugin-markdown@2.2.0: + resolution: {integrity: sha512-eH2tXMZcx3EHb5okd+/0VIyoR8Gp9pGe24UXitOOcGkzObbJ1vl48aGOAbakoT88FBdzC8MXNkMfBIB9VK0Ndg==} + peerDependencies: + vite: '>= 2.0.0' + + vite-plugin-port-checker@1.0.1: + resolution: {integrity: sha512-Mx/Pj5zyu4oak+SKGwQyRLGAvnp9zx0nqjCLhaJoGJeZk2t4EarZojTcHGG0gPMJWj9X6c0MIfzaZDslg80/GA==} + peerDependencies: + vite: '>=3.0.0' + + vite@8.0.11: + resolution: {integrity: sha512-Jz1mxtUBR5xTT65VOdJZUUeoyLtqljmFkiUXhPTLZka3RDc9vpi/xXkyrnsdRcm2lIi3l3GPMnAidTsEGIj3Ow==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: '@types/node': ^20.19.0 || >=22.12.0 - '@vitejs/devtools': ^0.1.0 + '@vitejs/devtools': ^0.1.18 esbuild: ^0.27.0 || ^0.28.0 jiti: '>=1.21.0' less: ^4.0.0 @@ -1274,57 +1214,57 @@ snapshots: dependencies: '@ant-design/fast-color': 3.0.1 - '@ant-design/cssinjs-utils@2.1.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@ant-design/cssinjs-utils@2.1.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@ant-design/cssinjs': 2.1.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@ant-design/cssinjs': 2.1.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) '@babel/runtime': 7.29.2 - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@ant-design/cssinjs@2.1.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@ant-design/cssinjs@2.1.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: '@babel/runtime': 7.29.2 '@emotion/hash': 0.8.0 '@emotion/unitless': 0.7.5 - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/util': 1.10.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 csstype: 3.2.3 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) stylis: 4.3.6 '@ant-design/fast-color@3.0.1': {} '@ant-design/icons-svg@4.4.2': {} - '@ant-design/icons@6.1.1(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@ant-design/icons@6.2.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: '@ant-design/colors': 8.0.1 '@ant-design/icons-svg': 4.4.2 - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@ant-design/react-slick@2.0.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@ant-design/react-slick@2.0.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: '@babel/runtime': 7.29.2 clsx: 2.1.1 json2mq: 0.2.0 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) throttle-debounce: 5.0.2 '@babel/runtime@7.29.2': {} - '@emnapi/core@1.9.2': + '@emnapi/core@1.10.0': dependencies: '@emnapi/wasi-threads': 1.2.1 tslib: 2.8.1 optional: true - '@emnapi/runtime@1.9.2': + '@emnapi/runtime@1.10.0': dependencies: tslib: 2.8.1 optional: true @@ -1338,84 +1278,6 @@ snapshots: '@emotion/unitless@0.7.5': {} - '@esbuild/aix-ppc64@0.27.4': - optional: true - - '@esbuild/android-arm64@0.27.4': - optional: true - - '@esbuild/android-arm@0.27.4': - optional: true - - '@esbuild/android-x64@0.27.4': - optional: true - - '@esbuild/darwin-arm64@0.27.4': - optional: true - - '@esbuild/darwin-x64@0.27.4': - optional: true - - '@esbuild/freebsd-arm64@0.27.4': - optional: true - - '@esbuild/freebsd-x64@0.27.4': - optional: true - - '@esbuild/linux-arm64@0.27.4': - optional: true - - '@esbuild/linux-arm@0.27.4': - optional: true - - '@esbuild/linux-ia32@0.27.4': - optional: true - - '@esbuild/linux-loong64@0.27.4': - optional: true - - '@esbuild/linux-mips64el@0.27.4': - optional: true - - '@esbuild/linux-ppc64@0.27.4': - optional: true - - '@esbuild/linux-riscv64@0.27.4': - optional: true - - '@esbuild/linux-s390x@0.27.4': - optional: true - - '@esbuild/linux-x64@0.27.4': - optional: true - - '@esbuild/netbsd-arm64@0.27.4': - optional: true - - '@esbuild/netbsd-x64@0.27.4': - optional: true - - '@esbuild/openbsd-arm64@0.27.4': - optional: true - - '@esbuild/openbsd-x64@0.27.4': - optional: true - - '@esbuild/openharmony-arm64@0.27.4': - optional: true - - '@esbuild/sunos-x64@0.27.4': - optional: true - - '@esbuild/win32-arm64@0.27.4': - optional: true - - '@esbuild/win32-ia32@0.27.4': - optional: true - - '@esbuild/win32-x64@0.27.4': - optional: true - '@jridgewell/gen-mapping@0.3.13': dependencies: '@jridgewell/sourcemap-codec': 1.5.5 @@ -1435,362 +1297,369 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.5 - '@napi-rs/wasm-runtime@1.1.3(@emnapi/core@1.9.2)(@emnapi/runtime@1.9.2)': + '@napi-rs/wasm-runtime@1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)': dependencies: - '@emnapi/core': 1.9.2 - '@emnapi/runtime': 1.9.2 - '@tybys/wasm-util': 0.10.1 + '@emnapi/core': 1.10.0 + '@emnapi/runtime': 1.10.0 + '@tybys/wasm-util': 0.10.2 optional: true - '@oxc-project/types@0.124.0': {} + '@oxc-project/types@0.128.0': {} '@rc-component/async-validator@5.1.0': dependencies: '@babel/runtime': 7.29.2 - '@rc-component/cascader@1.14.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/cascader@1.14.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/select': 1.6.15(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/tree': 1.2.4(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/select': 1.6.15(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/tree': 1.2.4(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/checkbox@2.0.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/checkbox@2.0.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/collapse@1.2.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/collapse@1.2.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: '@babel/runtime': 7.29.2 - '@rc-component/motion': 1.3.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/motion': 1.3.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/color-picker@3.1.1(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/color-picker@3.1.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: '@ant-design/fast-color': 3.0.1 - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/context@2.0.1(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/context@2.0.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/dialog@1.8.4(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/dialog@1.8.4(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/motion': 1.3.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/portal': 2.2.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/motion': 1.3.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/portal': 2.2.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/drawer@1.4.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/drawer@1.4.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/motion': 1.3.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/portal': 2.2.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/motion': 1.3.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/portal': 2.2.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/dropdown@1.0.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/dropdown@1.0.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/trigger': 3.9.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/trigger': 3.9.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/form@1.8.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/form@1.8.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: '@rc-component/async-validator': 5.1.0 - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/image@1.8.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/image@1.9.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/motion': 1.3.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/portal': 2.2.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/motion': 1.3.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/portal': 2.2.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/input-number@1.6.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/input-number@1.6.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: '@rc-component/mini-decimal': 1.1.3 - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/input@1.1.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/input@1.1.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/mentions@1.6.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/mentions@1.6.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/input': 1.1.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/menu': 1.2.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/textarea': 1.1.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/trigger': 3.9.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/input': 1.1.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/menu': 1.2.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/textarea': 1.1.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/trigger': 3.9.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/menu@1.2.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/menu@1.2.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/motion': 1.3.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/overflow': 1.0.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/trigger': 3.9.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/motion': 1.3.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/overflow': 1.0.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/trigger': 3.9.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) '@rc-component/mini-decimal@1.1.3': dependencies: '@babel/runtime': 7.29.2 - '@rc-component/motion@1.3.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/motion@1.3.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/mutate-observer@2.0.1(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/mutate-observer@2.0.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/notification@1.2.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/notification@1.2.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/motion': 1.3.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/motion': 1.3.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/overflow@1.0.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/overflow@1.0.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: '@babel/runtime': 7.29.2 - '@rc-component/resize-observer': 1.1.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/resize-observer': 1.1.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/pagination@1.2.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/pagination@1.2.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/picker@1.9.1(dayjs@1.11.20)(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/picker@1.9.1(dayjs@1.11.20)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/overflow': 1.0.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/resize-observer': 1.1.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/trigger': 3.9.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/overflow': 1.0.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/resize-observer': 1.1.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/trigger': 3.9.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) optionalDependencies: dayjs: 1.11.20 - '@rc-component/portal@2.2.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/portal@2.2.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/progress@1.0.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/progress@1.0.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/qrcode@1.1.1(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/qrcode@1.1.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: '@babel/runtime': 7.29.2 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/rate@1.0.1(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/rate@1.0.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/resize-observer@1.1.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/resize-observer@1.1.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/segmented@1.3.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/segmented@1.3.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: '@babel/runtime': 7.29.2 - '@rc-component/motion': 1.3.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/motion': 1.3.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/select@1.6.15(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/select@1.6.15(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/overflow': 1.0.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/trigger': 3.9.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/virtual-list': 1.0.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/overflow': 1.0.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/trigger': 3.9.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/virtual-list': 1.0.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/slider@1.0.1(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/slider@1.0.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/steps@1.2.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/steps@1.2.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/switch@1.0.3(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/switch@1.0.3(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/table@1.9.1(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/table@1.9.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/context': 2.0.1(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/resize-observer': 1.1.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/virtual-list': 1.0.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/context': 2.0.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/resize-observer': 1.1.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/virtual-list': 1.0.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/tabs@1.7.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/tabs@1.7.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/dropdown': 1.0.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/menu': 1.2.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/motion': 1.3.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/resize-observer': 1.1.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/dropdown': 1.0.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/menu': 1.2.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/motion': 1.3.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/resize-observer': 1.1.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/textarea@1.1.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/textarea@1.1.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/input': 1.1.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/resize-observer': 1.1.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/input': 1.1.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/resize-observer': 1.1.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/tooltip@1.4.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/tooltip@1.4.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/trigger': 3.9.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/trigger': 3.9.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/tour@2.3.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/tour@2.3.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/portal': 2.2.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/trigger': 3.9.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/portal': 2.2.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/trigger': 3.9.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/tree-select@1.8.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/tree-select@1.8.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/select': 1.6.15(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/tree': 1.2.4(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/select': 1.6.15(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/tree': 1.2.4(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/tree@1.2.4(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/tree@1.2.4(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/motion': 1.3.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/virtual-list': 1.0.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/motion': 1.3.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/virtual-list': 1.0.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/trigger@3.9.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/trigger@3.9.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/motion': 1.3.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/portal': 2.2.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/resize-observer': 1.1.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/motion': 1.3.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/portal': 2.2.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/resize-observer': 1.1.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/upload@1.1.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/upload@1.1.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@rc-component/util@1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/util@1.10.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: is-mobile: 5.0.0 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) react-is: 18.3.1 - '@rc-component/virtual-list@1.0.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@rc-component/util@1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': + dependencies: + is-mobile: 5.0.0 + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) + react-is: 18.3.1 + + '@rc-component/virtual-list@1.0.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': dependencies: '@babel/runtime': 7.29.2 - '@rc-component/resize-observer': 1.1.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/resize-observer': 1.1.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@reduxjs/toolkit@2.11.2(react-redux@9.2.0(@types/react@19.2.14)(react@19.2.5)(redux@5.0.1))(react@19.2.5)': + '@reduxjs/toolkit@2.11.2(react-redux@9.2.0(@types/react@19.2.14)(react@19.2.6)(redux@5.0.1))(react@19.2.6)': dependencies: '@standard-schema/spec': 1.1.0 '@standard-schema/utils': 0.3.0 @@ -1799,59 +1668,59 @@ snapshots: redux-thunk: 3.1.0(redux@5.0.1) reselect: 5.1.1 optionalDependencies: - react: 19.2.5 - react-redux: 9.2.0(@types/react@19.2.14)(react@19.2.5)(redux@5.0.1) + react: 19.2.6 + react-redux: 9.2.0(@types/react@19.2.14)(react@19.2.6)(redux@5.0.1) - '@rolldown/binding-android-arm64@1.0.0-rc.15': + '@rolldown/binding-android-arm64@1.0.0-rc.18': optional: true - '@rolldown/binding-darwin-arm64@1.0.0-rc.15': + '@rolldown/binding-darwin-arm64@1.0.0-rc.18': optional: true - '@rolldown/binding-darwin-x64@1.0.0-rc.15': + '@rolldown/binding-darwin-x64@1.0.0-rc.18': optional: true - '@rolldown/binding-freebsd-x64@1.0.0-rc.15': + '@rolldown/binding-freebsd-x64@1.0.0-rc.18': optional: true - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.15': + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.18': optional: true - '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.15': + '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.18': optional: true - '@rolldown/binding-linux-arm64-musl@1.0.0-rc.15': + '@rolldown/binding-linux-arm64-musl@1.0.0-rc.18': optional: true - '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.15': + '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.18': optional: true - '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.15': + '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.18': optional: true - '@rolldown/binding-linux-x64-gnu@1.0.0-rc.15': + '@rolldown/binding-linux-x64-gnu@1.0.0-rc.18': optional: true - '@rolldown/binding-linux-x64-musl@1.0.0-rc.15': + '@rolldown/binding-linux-x64-musl@1.0.0-rc.18': optional: true - '@rolldown/binding-openharmony-arm64@1.0.0-rc.15': + '@rolldown/binding-openharmony-arm64@1.0.0-rc.18': optional: true - '@rolldown/binding-wasm32-wasi@1.0.0-rc.15': + '@rolldown/binding-wasm32-wasi@1.0.0-rc.18': dependencies: - '@emnapi/core': 1.9.2 - '@emnapi/runtime': 1.9.2 - '@napi-rs/wasm-runtime': 1.1.3(@emnapi/core@1.9.2)(@emnapi/runtime@1.9.2) + '@emnapi/core': 1.10.0 + '@emnapi/runtime': 1.10.0 + '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) optional: true - '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.15': + '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.18': optional: true - '@rolldown/binding-win32-x64-msvc@1.0.0-rc.15': + '@rolldown/binding-win32-x64-msvc@1.0.0-rc.18': optional: true - '@rolldown/pluginutils@1.0.0-rc.15': {} + '@rolldown/pluginutils@1.0.0-rc.18': {} '@rolldown/pluginutils@1.0.0-rc.7': {} @@ -1859,7 +1728,7 @@ snapshots: '@standard-schema/utils@0.3.0': {} - '@tailwindcss/node@4.2.2': + '@tailwindcss/node@4.2.4': dependencies: '@jridgewell/remapping': 2.3.5 enhanced-resolve: 5.20.1 @@ -1867,75 +1736,80 @@ snapshots: lightningcss: 1.32.0 magic-string: 0.30.21 source-map-js: 1.2.1 - tailwindcss: 4.2.2 + tailwindcss: 4.2.4 - '@tailwindcss/oxide-android-arm64@4.2.2': + '@tailwindcss/oxide-android-arm64@4.2.4': optional: true - '@tailwindcss/oxide-darwin-arm64@4.2.2': + '@tailwindcss/oxide-darwin-arm64@4.2.4': optional: true - '@tailwindcss/oxide-darwin-x64@4.2.2': + '@tailwindcss/oxide-darwin-x64@4.2.4': optional: true - '@tailwindcss/oxide-freebsd-x64@4.2.2': + '@tailwindcss/oxide-freebsd-x64@4.2.4': optional: true - '@tailwindcss/oxide-linux-arm-gnueabihf@4.2.2': + '@tailwindcss/oxide-linux-arm-gnueabihf@4.2.4': optional: true - '@tailwindcss/oxide-linux-arm64-gnu@4.2.2': + '@tailwindcss/oxide-linux-arm64-gnu@4.2.4': optional: true - '@tailwindcss/oxide-linux-arm64-musl@4.2.2': + '@tailwindcss/oxide-linux-arm64-musl@4.2.4': optional: true - '@tailwindcss/oxide-linux-x64-gnu@4.2.2': + '@tailwindcss/oxide-linux-x64-gnu@4.2.4': optional: true - '@tailwindcss/oxide-linux-x64-musl@4.2.2': + '@tailwindcss/oxide-linux-x64-musl@4.2.4': optional: true - '@tailwindcss/oxide-wasm32-wasi@4.2.2': + '@tailwindcss/oxide-wasm32-wasi@4.2.4': optional: true - '@tailwindcss/oxide-win32-arm64-msvc@4.2.2': + '@tailwindcss/oxide-win32-arm64-msvc@4.2.4': optional: true - '@tailwindcss/oxide-win32-x64-msvc@4.2.2': + '@tailwindcss/oxide-win32-x64-msvc@4.2.4': optional: true - '@tailwindcss/oxide@4.2.2': + '@tailwindcss/oxide@4.2.4': optionalDependencies: - '@tailwindcss/oxide-android-arm64': 4.2.2 - '@tailwindcss/oxide-darwin-arm64': 4.2.2 - '@tailwindcss/oxide-darwin-x64': 4.2.2 - '@tailwindcss/oxide-freebsd-x64': 4.2.2 - '@tailwindcss/oxide-linux-arm-gnueabihf': 4.2.2 - '@tailwindcss/oxide-linux-arm64-gnu': 4.2.2 - '@tailwindcss/oxide-linux-arm64-musl': 4.2.2 - '@tailwindcss/oxide-linux-x64-gnu': 4.2.2 - '@tailwindcss/oxide-linux-x64-musl': 4.2.2 - '@tailwindcss/oxide-wasm32-wasi': 4.2.2 - '@tailwindcss/oxide-win32-arm64-msvc': 4.2.2 - '@tailwindcss/oxide-win32-x64-msvc': 4.2.2 + '@tailwindcss/oxide-android-arm64': 4.2.4 + '@tailwindcss/oxide-darwin-arm64': 4.2.4 + '@tailwindcss/oxide-darwin-x64': 4.2.4 + '@tailwindcss/oxide-freebsd-x64': 4.2.4 + '@tailwindcss/oxide-linux-arm-gnueabihf': 4.2.4 + '@tailwindcss/oxide-linux-arm64-gnu': 4.2.4 + '@tailwindcss/oxide-linux-arm64-musl': 4.2.4 + '@tailwindcss/oxide-linux-x64-gnu': 4.2.4 + '@tailwindcss/oxide-linux-x64-musl': 4.2.4 + '@tailwindcss/oxide-wasm32-wasi': 4.2.4 + '@tailwindcss/oxide-win32-arm64-msvc': 4.2.4 + '@tailwindcss/oxide-win32-x64-msvc': 4.2.4 - '@tailwindcss/vite@4.2.2(vite@8.0.8(@types/node@22.19.17)(esbuild@0.27.4)(jiti@2.6.1))': + '@tailwindcss/typography@0.5.19(tailwindcss@4.2.4)': dependencies: - '@tailwindcss/node': 4.2.2 - '@tailwindcss/oxide': 4.2.2 - tailwindcss: 4.2.2 - vite: 8.0.8(@types/node@22.19.17)(esbuild@0.27.4)(jiti@2.6.1) + postcss-selector-parser: 6.0.10 + tailwindcss: 4.2.4 - '@tanstack/react-virtual@3.13.23(react-dom@19.2.5(react@19.2.5))(react@19.2.5)': + '@tailwindcss/vite@4.2.4(vite@8.0.11(@types/node@22.19.17)(jiti@2.6.1))': dependencies: - '@tanstack/virtual-core': 3.13.23 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + '@tailwindcss/node': 4.2.4 + '@tailwindcss/oxide': 4.2.4 + tailwindcss: 4.2.4 + vite: 8.0.11(@types/node@22.19.17)(jiti@2.6.1) - '@tanstack/virtual-core@3.13.23': {} + '@tanstack/react-virtual@3.13.24(react-dom@19.2.6(react@19.2.6))(react@19.2.6)': + dependencies: + '@tanstack/virtual-core': 3.14.0 + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - '@tybys/wasm-util@0.10.1': + '@tanstack/virtual-core@3.14.0': {} + + '@tybys/wasm-util@0.10.2': dependencies: tslib: 2.8.1 optional: true @@ -1954,61 +1828,61 @@ snapshots: '@types/use-sync-external-store@0.0.6': {} - '@vitejs/plugin-react@6.0.1(vite@8.0.8(@types/node@22.19.17)(esbuild@0.27.4)(jiti@2.6.1))': + '@vitejs/plugin-react@6.0.1(vite@8.0.11(@types/node@22.19.17)(jiti@2.6.1))': dependencies: '@rolldown/pluginutils': 1.0.0-rc.7 - vite: 8.0.8(@types/node@22.19.17)(esbuild@0.27.4)(jiti@2.6.1) + vite: 8.0.11(@types/node@22.19.17)(jiti@2.6.1) - antd@6.3.5(react-dom@19.2.5(react@19.2.5))(react@19.2.5): + antd@6.3.7(react-dom@19.2.6(react@19.2.6))(react@19.2.6): dependencies: '@ant-design/colors': 8.0.1 - '@ant-design/cssinjs': 2.1.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@ant-design/cssinjs-utils': 2.1.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@ant-design/cssinjs': 2.1.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@ant-design/cssinjs-utils': 2.1.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) '@ant-design/fast-color': 3.0.1 - '@ant-design/icons': 6.1.1(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@ant-design/react-slick': 2.0.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@ant-design/icons': 6.2.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@ant-design/react-slick': 2.0.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) '@babel/runtime': 7.29.2 - '@rc-component/cascader': 1.14.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/checkbox': 2.0.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/collapse': 1.2.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/color-picker': 3.1.1(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/dialog': 1.8.4(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/drawer': 1.4.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/dropdown': 1.0.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/form': 1.8.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/image': 1.8.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/input': 1.1.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/input-number': 1.6.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/mentions': 1.6.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/menu': 1.2.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/motion': 1.3.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/mutate-observer': 2.0.1(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/notification': 1.2.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/pagination': 1.2.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/picker': 1.9.1(dayjs@1.11.20)(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/progress': 1.0.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/qrcode': 1.1.1(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/rate': 1.0.1(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/resize-observer': 1.1.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/segmented': 1.3.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/select': 1.6.15(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/slider': 1.0.1(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/steps': 1.2.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/switch': 1.0.3(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/table': 1.9.1(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/tabs': 1.7.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/textarea': 1.1.2(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/tooltip': 1.4.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/tour': 2.3.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/tree': 1.2.4(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/tree-select': 1.8.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/trigger': 3.9.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/upload': 1.1.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@rc-component/util': 1.10.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + '@rc-component/cascader': 1.14.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/checkbox': 2.0.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/collapse': 1.2.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/color-picker': 3.1.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/dialog': 1.8.4(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/drawer': 1.4.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/dropdown': 1.0.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/form': 1.8.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/image': 1.9.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/input': 1.1.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/input-number': 1.6.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/mentions': 1.6.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/menu': 1.2.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/motion': 1.3.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/mutate-observer': 2.0.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/notification': 1.2.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/pagination': 1.2.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/picker': 1.9.1(dayjs@1.11.20)(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/progress': 1.0.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/qrcode': 1.1.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/rate': 1.0.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/resize-observer': 1.1.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/segmented': 1.3.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/select': 1.6.15(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/slider': 1.0.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/steps': 1.2.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/switch': 1.0.3(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/table': 1.9.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/tabs': 1.7.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/textarea': 1.1.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/tooltip': 1.4.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/tour': 2.3.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/tree': 1.2.4(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/tree-select': 1.8.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/trigger': 3.9.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/upload': 1.1.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@rc-component/util': 1.10.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) clsx: 2.1.1 dayjs: 1.11.20 - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) scroll-into-view-if-needed: 3.1.0 throttle-debounce: 5.0.2 transitivePeerDependencies: @@ -2016,11 +1890,17 @@ snapshots: - luxon - moment + argparse@1.0.10: + dependencies: + sprintf-js: 1.0.3 + + argparse@2.0.1: {} + asynckit@0.4.0: {} - axios@1.14.0: + axios@1.16.0: dependencies: - follow-redirects: 1.15.11 + follow-redirects: 1.16.0 form-data: 4.0.5 proxy-from-env: 2.1.0 transitivePeerDependencies: @@ -2041,6 +1921,8 @@ snapshots: cookie@1.1.1: {} + cssesc@3.0.0: {} + csstype@3.2.3: {} dayjs@1.11.20: {} @@ -2049,6 +1931,24 @@ snapshots: detect-libc@2.1.2: {} + dom-serializer@1.4.1: + dependencies: + domelementtype: 2.3.0 + domhandler: 4.3.1 + entities: 2.2.0 + + domelementtype@2.3.0: {} + + domhandler@4.3.1: + dependencies: + domelementtype: 2.3.0 + + domutils@2.8.0: + dependencies: + dom-serializer: 1.4.1 + domelementtype: 2.3.0 + domhandler: 4.3.1 + dunder-proto@1.0.1: dependencies: call-bind-apply-helpers: 1.0.2 @@ -2058,7 +1958,11 @@ snapshots: enhanced-resolve@5.20.1: dependencies: graceful-fs: 4.2.11 - tapable: 2.3.0 + tapable: 2.3.3 + + entities@2.1.0: {} + + entities@2.2.0: {} es-define-property@1.0.1: {} @@ -2073,52 +1977,28 @@ snapshots: es-errors: 1.3.0 get-intrinsic: 1.3.0 has-tostringtag: 1.0.2 - hasown: 2.0.2 + hasown: 2.0.3 - esbuild@0.27.4: - optionalDependencies: - '@esbuild/aix-ppc64': 0.27.4 - '@esbuild/android-arm': 0.27.4 - '@esbuild/android-arm64': 0.27.4 - '@esbuild/android-x64': 0.27.4 - '@esbuild/darwin-arm64': 0.27.4 - '@esbuild/darwin-x64': 0.27.4 - '@esbuild/freebsd-arm64': 0.27.4 - '@esbuild/freebsd-x64': 0.27.4 - '@esbuild/linux-arm': 0.27.4 - '@esbuild/linux-arm64': 0.27.4 - '@esbuild/linux-ia32': 0.27.4 - '@esbuild/linux-loong64': 0.27.4 - '@esbuild/linux-mips64el': 0.27.4 - '@esbuild/linux-ppc64': 0.27.4 - '@esbuild/linux-riscv64': 0.27.4 - '@esbuild/linux-s390x': 0.27.4 - '@esbuild/linux-x64': 0.27.4 - '@esbuild/netbsd-arm64': 0.27.4 - '@esbuild/netbsd-x64': 0.27.4 - '@esbuild/openbsd-arm64': 0.27.4 - '@esbuild/openbsd-x64': 0.27.4 - '@esbuild/openharmony-arm64': 0.27.4 - '@esbuild/sunos-x64': 0.27.4 - '@esbuild/win32-arm64': 0.27.4 - '@esbuild/win32-ia32': 0.27.4 - '@esbuild/win32-x64': 0.27.4 - optional: true + esprima@4.0.1: {} fdir@6.5.0(picomatch@4.0.4): optionalDependencies: picomatch: 4.0.4 - follow-redirects@1.15.11: {} + follow-redirects@1.16.0: {} form-data@4.0.5: dependencies: asynckit: 0.4.0 combined-stream: 1.0.8 es-set-tostringtag: 2.1.0 - hasown: 2.0.2 + hasown: 2.0.3 mime-types: 2.1.35 + front-matter@4.0.2: + dependencies: + js-yaml: 3.14.2 + fsevents@2.3.3: optional: true @@ -2134,7 +2014,7 @@ snapshots: get-proto: 1.0.1 gopd: 1.2.0 has-symbols: 1.1.0 - hasown: 2.0.2 + hasown: 2.0.3 math-intrinsics: 1.1.0 get-proto@1.0.1: @@ -2142,7 +2022,7 @@ snapshots: dunder-proto: 1.0.1 es-object-atoms: 1.1.1 - globals@17.4.0: {} + globals@17.6.0: {} gopd@1.2.0: {} @@ -2154,16 +2034,28 @@ snapshots: dependencies: has-symbols: 1.1.0 - hasown@2.0.2: + hasown@2.0.3: dependencies: function-bind: 1.1.2 + htmlparser2@6.1.0: + dependencies: + domelementtype: 2.3.0 + domhandler: 4.3.1 + domutils: 2.8.0 + entities: 2.2.0 + immer@11.1.4: {} is-mobile@5.0.0: {} jiti@2.6.1: {} + js-yaml@3.14.2: + dependencies: + argparse: 1.0.10 + esprima: 4.0.1 + json2mq@0.2.0: dependencies: string-convert: 0.2.1 @@ -2217,71 +2109,90 @@ snapshots: lightningcss-win32-arm64-msvc: 1.32.0 lightningcss-win32-x64-msvc: 1.32.0 + linkify-it@3.0.3: + dependencies: + uc.micro: 1.0.6 + magic-string@0.30.21: dependencies: '@jridgewell/sourcemap-codec': 1.5.5 + markdown-it@12.3.2: + dependencies: + argparse: 2.0.1 + entities: 2.1.0 + linkify-it: 3.0.3 + mdurl: 1.0.1 + uc.micro: 1.0.6 + math-intrinsics@1.1.0: {} + mdurl@1.0.1: {} + mime-db@1.52.0: {} mime-types@2.1.35: dependencies: mime-db: 1.52.0 - nanoid@3.3.11: {} + nanoid@3.3.12: {} picocolors@1.1.1: {} picomatch@4.0.4: {} - postcss@8.5.8: + postcss-selector-parser@6.0.10: dependencies: - nanoid: 3.3.11 + cssesc: 3.0.0 + util-deprecate: 1.0.2 + + postcss@8.5.14: + dependencies: + nanoid: 3.3.12 picocolors: 1.1.1 source-map-js: 1.2.1 - prettier@3.8.1: {} + prettier@3.8.3: {} proxy-from-env@2.1.0: {} - react-dom@19.2.5(react@19.2.5): + react-dom@19.2.6(react@19.2.6): dependencies: - react: 19.2.5 + react: 19.2.6 scheduler: 0.27.0 react-is@18.3.1: {} - react-redux@9.2.0(@types/react@19.2.14)(react@19.2.5)(redux@5.0.1): + react-redux@9.2.0(@types/react@19.2.14)(react@19.2.6)(redux@5.0.1): dependencies: '@types/use-sync-external-store': 0.0.6 - react: 19.2.5 - use-sync-external-store: 1.6.0(react@19.2.5) + react: 19.2.6 + use-sync-external-store: 1.6.0(react@19.2.6) optionalDependencies: '@types/react': 19.2.14 redux: 5.0.1 - react-router-dom@7.14.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5): + react-router-dom@7.15.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6): dependencies: - react: 19.2.5 - react-dom: 19.2.5(react@19.2.5) - react-router: 7.14.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) + react-router: 7.15.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6) - react-router@7.14.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5): + react-router@7.15.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6): dependencies: cookie: 1.1.1 - react: 19.2.5 + react: 19.2.6 set-cookie-parser: 2.7.2 optionalDependencies: - react-dom: 19.2.5(react@19.2.5) + react-dom: 19.2.6(react@19.2.6) - react@19.2.5: {} + react@19.2.6: {} - redux-persist@6.0.0(react@19.2.5)(redux@5.0.1): + redux-persist@6.0.0(react@19.2.6)(redux@5.0.1): dependencies: redux: 5.0.1 optionalDependencies: - react: 19.2.5 + react: 19.2.6 redux-thunk@3.1.0(redux@5.0.1): dependencies: @@ -2291,26 +2202,26 @@ snapshots: reselect@5.1.1: {} - rolldown@1.0.0-rc.15: + rolldown@1.0.0-rc.18: dependencies: - '@oxc-project/types': 0.124.0 - '@rolldown/pluginutils': 1.0.0-rc.15 + '@oxc-project/types': 0.128.0 + '@rolldown/pluginutils': 1.0.0-rc.18 optionalDependencies: - '@rolldown/binding-android-arm64': 1.0.0-rc.15 - '@rolldown/binding-darwin-arm64': 1.0.0-rc.15 - '@rolldown/binding-darwin-x64': 1.0.0-rc.15 - '@rolldown/binding-freebsd-x64': 1.0.0-rc.15 - '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-rc.15 - '@rolldown/binding-linux-arm64-gnu': 1.0.0-rc.15 - '@rolldown/binding-linux-arm64-musl': 1.0.0-rc.15 - '@rolldown/binding-linux-ppc64-gnu': 1.0.0-rc.15 - '@rolldown/binding-linux-s390x-gnu': 1.0.0-rc.15 - '@rolldown/binding-linux-x64-gnu': 1.0.0-rc.15 - '@rolldown/binding-linux-x64-musl': 1.0.0-rc.15 - '@rolldown/binding-openharmony-arm64': 1.0.0-rc.15 - '@rolldown/binding-wasm32-wasi': 1.0.0-rc.15 - '@rolldown/binding-win32-arm64-msvc': 1.0.0-rc.15 - '@rolldown/binding-win32-x64-msvc': 1.0.0-rc.15 + '@rolldown/binding-android-arm64': 1.0.0-rc.18 + '@rolldown/binding-darwin-arm64': 1.0.0-rc.18 + '@rolldown/binding-darwin-x64': 1.0.0-rc.18 + '@rolldown/binding-freebsd-x64': 1.0.0-rc.18 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-rc.18 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-rc.18 + '@rolldown/binding-linux-arm64-musl': 1.0.0-rc.18 + '@rolldown/binding-linux-ppc64-gnu': 1.0.0-rc.18 + '@rolldown/binding-linux-s390x-gnu': 1.0.0-rc.18 + '@rolldown/binding-linux-x64-gnu': 1.0.0-rc.18 + '@rolldown/binding-linux-x64-musl': 1.0.0-rc.18 + '@rolldown/binding-openharmony-arm64': 1.0.0-rc.18 + '@rolldown/binding-wasm32-wasi': 1.0.0-rc.18 + '@rolldown/binding-win32-arm64-msvc': 1.0.0-rc.18 + '@rolldown/binding-win32-x64-msvc': 1.0.0-rc.18 scheduler@0.27.0: {} @@ -2322,17 +2233,19 @@ snapshots: source-map-js@1.2.1: {} + sprintf-js@1.0.3: {} + string-convert@0.2.1: {} stylis@4.3.6: {} - tailwindcss@4.2.2: {} + tailwindcss@4.2.4: {} - tapable@2.3.0: {} + tapable@2.3.3: {} throttle-debounce@5.0.2: {} - tinyglobby@0.2.15: + tinyglobby@0.2.16: dependencies: fdir: 6.5.0(picomatch@4.0.4) picomatch: 4.0.4 @@ -2340,23 +2253,38 @@ snapshots: tslib@2.8.1: optional: true - typescript@6.0.2: {} + typescript@6.0.3: {} + + uc.micro@1.0.6: {} undici-types@6.21.0: {} - use-sync-external-store@1.6.0(react@19.2.5): + use-sync-external-store@1.6.0(react@19.2.6): dependencies: - react: 19.2.5 + react: 19.2.6 - vite@8.0.8(@types/node@22.19.17)(esbuild@0.27.4)(jiti@2.6.1): + util-deprecate@1.0.2: {} + + vite-plugin-markdown@2.2.0(vite@8.0.11(@types/node@22.19.17)(jiti@2.6.1)): + dependencies: + domhandler: 4.3.1 + front-matter: 4.0.2 + htmlparser2: 6.1.0 + markdown-it: 12.3.2 + vite: 8.0.11(@types/node@22.19.17)(jiti@2.6.1) + + vite-plugin-port-checker@1.0.1(vite@8.0.11(@types/node@22.19.17)(jiti@2.6.1)): + dependencies: + vite: 8.0.11(@types/node@22.19.17)(jiti@2.6.1) + + vite@8.0.11(@types/node@22.19.17)(jiti@2.6.1): dependencies: lightningcss: 1.32.0 picomatch: 4.0.4 - postcss: 8.5.8 - rolldown: 1.0.0-rc.15 - tinyglobby: 0.2.15 + postcss: 8.5.14 + rolldown: 1.0.0-rc.18 + tinyglobby: 0.2.16 optionalDependencies: '@types/node': 22.19.17 - esbuild: 0.27.4 fsevents: 2.3.3 jiti: 2.6.1 diff --git a/web/pnpm-workspace.yaml b/web/pnpm-workspace.yaml new file mode 100644 index 0000000..49c0ad7 --- /dev/null +++ b/web/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +allowBuilds: + esbuild: false diff --git a/web/src/api/auth-api.ts b/web/src/api/auth-api.ts new file mode 100644 index 0000000..1727cde --- /dev/null +++ b/web/src/api/auth-api.ts @@ -0,0 +1,13 @@ +import { LoginRequest, User } from "@/types" +import { WebClient } from "@/shared/web-client" + +export async function login(loginRequest: LoginRequest): Promise { + const { data } = await WebClient.post("/auth/login", { + ...loginRequest, + }) + return data +} + +export async function logout() { + await WebClient.get("/auth/logout") +} diff --git a/web/src/api/firearm-api.ts b/web/src/api/firearm-api.ts index f2f8e0b..c62cb31 100644 --- a/web/src/api/firearm-api.ts +++ b/web/src/api/firearm-api.ts @@ -1,4 +1,4 @@ -import { Direction, Firearm, FirearmType, Page, PageQueryParams } from "@/types" +import { AddFirearmRequest, Direction, Firearm, FirearmType, Page, PageQueryParams } from "@/types" import { WebClient } from "@/shared/web-client" import { asUrlSearchParam } from "@/utils/query-param-utils.ts" @@ -7,9 +7,9 @@ interface FirearmParams extends PageQueryParams { } /** - * 查询武器列表 + * Fetch firearm list * - * @param params 分页查询参数¬ + * @param params Paged query parameters */ export async function getFirearms(params?: FirearmParams): Promise> { let uri = "/firearms" @@ -28,11 +28,29 @@ export async function getFirearms(params?: FirearmParams): Promise } /** - * 根据 ID 查询武器 + * Fetch firearm by ID * - * @param id 武器 ID + * @param id Firearm ID */ export async function getFirearm(id: number): Promise { const { data } = await WebClient.get(`/firearms/${id}`) return data } + +/** + * Create firearm + * @param request + */ +export async function addFirearm(request: AddFirearmRequest): Promise { + const { data } = await WebClient.post("/firearms", request) + return data +} + +export async function editFirearm(id: number, request: AddFirearmRequest): Promise { + const { data } = await WebClient.put(`/firearms/${id}`, request) + return data +} + +export async function removeFirearm(id: number) { + await WebClient.delete(`/firearms/${id}`) +} diff --git a/web/src/api/index.ts b/web/src/api/index.ts index eb0551b..edb4561 100644 --- a/web/src/api/index.ts +++ b/web/src/api/index.ts @@ -1,3 +1,4 @@ export * as FirearmApi from "./firearm-api" export * as ModificationApi from "./modification-api" export * as TagApi from "./tag-api" +export * as AuthApi from "./auth-api" diff --git a/web/src/api/modification-api.ts b/web/src/api/modification-api.ts index 1d95436..84254c2 100644 --- a/web/src/api/modification-api.ts +++ b/web/src/api/modification-api.ts @@ -1,4 +1,4 @@ -import { Modification, Page, PageQueryParams } from "@/types" +import { Modification, ModificationRequest, Page, PageQueryParams } from "@/types" import { WebClient } from "@/shared/web-client" import { asUrlSearchParam } from "@/utils/query-param-utils.ts" @@ -30,4 +30,38 @@ export async function getModifications(params?: ModificationParams): Promise { const { data } = await WebClient.get(`/modifications/${id}`) return data +} + +export async function addModification(modification: ModificationRequest): Promise { + const { data } = await WebClient.post("/modifications", modification) + return data +} + +export async function addModifications( + modifications: ModificationRequest[] +): Promise { + const { data } = await WebClient.post("/modifications/batch", { + modifications, + }) + return data +} + +export async function editModification( + id: number, + modification: ModificationRequest +): Promise { + const { data } = await WebClient.put(`/modifications/${id}`, modification) + return data +} + +export async function removeModification( + id: number +): Promise { + await WebClient.delete(`/modifications/${id}`) +} + +export async function removeModifications(ids: number[]) { + const urlSearchParams = new URLSearchParams() + ids.forEach((id) => urlSearchParams.append("ids", "" + id)) + await WebClient.delete(`/modifications/batch-delete?${urlSearchParams.toString()}`) } \ No newline at end of file diff --git a/web/src/components/firearm-create-modal/index.tsx b/web/src/components/firearm-create-modal/index.tsx new file mode 100644 index 0000000..100e571 --- /dev/null +++ b/web/src/components/firearm-create-modal/index.tsx @@ -0,0 +1,58 @@ +import { useState } from "react" +import { App, Form, Modal } from "antd" +import { FirearmApi } from "@/api" +import FirearmForm from "@/components/firearm-form" +import { AddFirearmRequest, Firearm } from "@/types" + +interface FirearmCreateModalProps { + open: boolean + onCancel: () => void + onSuccess: (firearm: Firearm) => void +} + +function normalizeRequest(values: AddFirearmRequest): AddFirearmRequest { + return { + ...values, + review: values.review?.trim() || null, + } +} + +export default function FirearmCreateModal({ open, onCancel, onSuccess }: FirearmCreateModalProps) { + const { message } = App.useApp() + const [form] = Form.useForm() + const [loading, setLoading] = useState(false) + + async function onFinish(values: AddFirearmRequest) { + setLoading(true) + try { + const firearm = await FirearmApi.addFirearm(normalizeRequest(values)) + message.success("武器创建成功") + form.resetFields() + onSuccess(firearm) + } catch { + message.error("武器创建失败,请稍后重试") + } finally { + setLoading(false) + } + } + + return ( + form.submit()} + okText="创建" + cancelText="取消" + confirmLoading={loading} + destroyOnHidden + afterOpenChange={(visible) => { + if (!visible) { + form.resetFields() + } + }}> + + + ) +} + diff --git a/web/src/components/firearm-edit-modal/index.tsx b/web/src/components/firearm-edit-modal/index.tsx new file mode 100644 index 0000000..c0c1b49 --- /dev/null +++ b/web/src/components/firearm-edit-modal/index.tsx @@ -0,0 +1,67 @@ +import { useEffect, useState } from "react" +import { App, Form, Modal } from "antd" +import { FirearmApi } from "@/api" +import FirearmForm from "@/components/firearm-form" +import { AddFirearmRequest, Firearm } from "@/types" + +interface FirearmEditModalProps { + open: boolean + firearm: Firearm | null + onCancel: () => void + onSuccess: (firearm: Firearm) => void +} + +function normalizeRequest(values: AddFirearmRequest): AddFirearmRequest { + return { + ...values, + review: values.review?.trim() || null, + } +} + +export default function FirearmEditModal({ open, firearm, onCancel, onSuccess }: FirearmEditModalProps) { + const { message } = App.useApp() + const [form] = Form.useForm() + const [loading, setLoading] = useState(false) + + useEffect(() => { + if (!open || !firearm) { + return + } + + const { id: _id, ...editableValues } = firearm + form.setFieldsValue(editableValues) + }, [open, firearm, form]) + + async function onFinish(values: AddFirearmRequest) { + if (!firearm) { + return + } + + setLoading(true) + try { + const updated = await FirearmApi.editFirearm(firearm.id, normalizeRequest(values)) + message.success("武器更新成功") + onSuccess(updated) + } catch { + message.error("武器更新失败,请稍后重试") + } finally { + setLoading(false) + } + } + + return ( + form.submit()} + okText="保存" + cancelText="取消" + confirmLoading={loading} + destroyOnHidden + > + + + ) +} + diff --git a/web/src/components/firearm-form/index.tsx b/web/src/components/firearm-form/index.tsx new file mode 100644 index 0000000..2095383 --- /dev/null +++ b/web/src/components/firearm-form/index.tsx @@ -0,0 +1,101 @@ +import { Form, Input, InputNumber, Select } from "antd" +import { AddFirearmRequest, FirearmType } from "@/types" +import calibres from "@/constant/calibres.json" + +const firearmTypeText: Record = { + RIFLE: "步枪", + SUB_MACHINE_GUN: "冲锋枪", + SHOTGUN: "霰弹枪", + LIGHT_MACHINE_GUN: "轻机枪", + DESIGNATED_MARKSMAN_RIFLE: "射手步枪", + SNIPER_RIFLE: "狙击步枪", + PISTOL: "手枪", + SPECIAL: "特殊", +} + +const calibreOptions = calibres.map((calibre) => ({ + value: calibre, + label: calibre, +})) + +interface FirearmFormProps { + form: ReturnType>[0] + onFinish: (values: AddFirearmRequest) => void +} + +export default function FirearmForm({ form, onFinish }: FirearmFormProps) { + return ( + form={form} layout="vertical" onFinish={onFinish} requiredMark={false}> + + name="name" + label="武器名称" + rules={[{ required: true, message: "请输入武器名称" }]} + > + + + + + name="type" + label="武器类型" + rules={[{ required: true, message: "请选择武器类型" }]} + > + + + + + name="calibre" + label="子弹口径" + rules={[{ required: true, message: "请选择子弹口径" }]} + > + + + + + name="code" + label="改枪码" + rules={[{ required: true, message: "请输入改枪码" }]}> + + + + name="tags" label="标签"> + + + + name="videoUrl" label="视频链接"> + + + + name="note" label="备注"> + + + + + {(accessoryFields, { add: addAccessory, remove: removeAccessory }) => ( +
+ {accessoryFields.map((accessoryField) => ( + removeAccessory(accessoryField.name)}> + 删除配件 + + }> + + + + + + + + + + {(tuningFields, { add: addTuning, remove: removeTuning }) => ( +
+ {tuningFields.map((tuningField) => ( + + + + + + + + + + ))} + +
+ )} +
+
+ ))} + +
+ )} +
+ + ) +} diff --git a/web/src/constant/calibres.json b/web/src/constant/calibres.json new file mode 100644 index 0000000..b1f47ad --- /dev/null +++ b/web/src/constant/calibres.json @@ -0,0 +1,23 @@ +[ + ".338 Lap Mag", + ".357 Magnum", + ".45 ACP", + ".50 AE", + ".50 BMG", + "12 Gauge", + "12.7x55mm", + "5.45x39mm", + "5.56x45mm", + "5.7x28mm", + "5.8x42mm", + "6.8x51mm", + "7.62x39mm", + "7.62x51mm", + "7.62x54mm", + "9x19mm", + "9x39mm", + "4.6x30mm", + ".300 BLK", + "箭矢", + "45-70 Govt" +] \ No newline at end of file diff --git a/web/src/constant/slots.json b/web/src/constant/slots.json new file mode 100644 index 0000000..d75873b --- /dev/null +++ b/web/src/constant/slots.json @@ -0,0 +1,19 @@ +[ + "枪口", + "枪管", + "贴片", + "瞄准镜", + "战术设备", + "增高座瞄具", + "侧瞄具", + "枪托", + "托腮板", + "枪托套件", + "导轨脚架", + "前握把", + "后握把", + "后握贴片", + "握把座", + "弹匣", + "弹匣座" +] diff --git a/web/src/constant/tunings.json b/web/src/constant/tunings.json new file mode 100644 index 0000000..5c70d07 --- /dev/null +++ b/web/src/constant/tunings.json @@ -0,0 +1 @@ +["安装位置", "厚度", "缩放倍率", "长度", "瞳距", "配重", "托腮板安装位置"] diff --git a/web/src/docs/EULA.md b/web/src/docs/EULA.md new file mode 100644 index 0000000..f2d2cb4 --- /dev/null +++ b/web/src/docs/EULA.md @@ -0,0 +1,29 @@ +# 阿萨拉向导最终用户许可协议 + +> 最近更新日期: 2026年5月6日 + +感谢您访问阿萨拉向导(以下简称”本站”)。在访问或使用本站前,请您务必仔细阅读本协议。 + +## 第一条:项目性质与声明 + +本站是由游戏玩家开发的兴趣爱好项目,与任何游戏官方不存在任何形式的关联、授权或代理关系。 + +本站仅旨在为玩家提供游戏资讯、攻略及技术性指南,不保证资讯的绝对实时性与准确性。 + +## 第二条:内容版权说明 + +本站部分指南、攻略及图片素材提取、整理自哔哩哔哩、抖音等视频平台的公开视频,本站均会标注原作者信息或来源。相关内容的知识产权归原作者所有。 + +由本站开发者原创或邀请的高手提供的特约稿件,其版权归本站或原提供者所有。 + +严禁任何个人或组织在未经本站或原作者授权的情况下,将本站内容用于商业牟利。 + +## 第三条:免责声明 + +游戏机制可能随版本更新而变动,因参考本站指南而产生的任何游戏结果(如战绩波动、游戏内损失等),本站概不负责。 + +来源标注中可能包含指向第三方平台的链接,本站不对第三方平台内容的合法性或安全性负责。 + +## 第四条:协议变更 + +本站保留随时修改本协议的权利。重大变更将通过站点公告形式发布。 \ No newline at end of file diff --git a/web/src/docs/PrivacyPolicy.md b/web/src/docs/PrivacyPolicy.md new file mode 100644 index 0000000..8a5d0ec --- /dev/null +++ b/web/src/docs/PrivacyPolicy.md @@ -0,0 +1,33 @@ +# 阿萨拉向导隐私政策 + +本隐私政策旨在向您说明在无需登录的情况下,本站如何处理与您相关的信息。 + +## 第一条:信息收集情况 + +1. **个人信息:** 由于本站采用无需登录的模式,我们不会收集您的姓名、手机号、身份证号或精确地理位置等个人敏感数据。 + +2. **服务器日志:** 本站未集成任何第三方流量统计工具(如 Google Analytics 或百度统计),不会主动记录您的 IP 地址或用户代理(User-agent)数据。 + +## 第二条:Cookie 的使用 + +1. **必要性 Cookie:** 本站仅使用必要的 Cookie 用于保存与后端交互所需的功能性数据(如临时会话标识或您的本地设置偏好)。 + +2. **非追踪性:** 这些 Cookie 不用于追踪您的个人跨站行为,也不会用于构建您的个人画像。 + +## 第三条:第三方广告与赞助 + +1. **现状说明:** 本站目前不包含任何商业广告,亦未开通打赏或赞助入口。 + +2. **未来规划:** 考虑到运营成本,本站保留未来接入广告服务或赞助链接的权利。届时,广告商可能会根据其自身的隐私政策使用 Cookie。一旦此类功能上线,我们将同步更新本政策。 + +## 第四条:数据安全 + +我们致力于保护站点的运行安全,防止现有数据被非法篡改或泄露。 + +## 第五条:联系我们 + +若您对本协议或内容版权有任何疑问,请通过以下方式联系: + +开发者: Zihlu Wang、Xingyao Fan + +联系渠道: [Gitea](https://onixbyte.dev/onixbyte/ahsarah-guide) \ No newline at end of file diff --git a/web/src/hooks/store.ts b/web/src/hooks/store.ts new file mode 100644 index 0000000..f9a3047 --- /dev/null +++ b/web/src/hooks/store.ts @@ -0,0 +1,5 @@ +import { useDispatch, useSelector } from "react-redux" +import type { AppDispatch, RootState } from "@/store" + +export const useAppDispatch = useDispatch.withTypes() +export const useAppSelector = useSelector.withTypes() diff --git a/web/src/index.css b/web/src/index.css index f48439e..9447624 100644 --- a/web/src/index.css +++ b/web/src/index.css @@ -1,8 +1,10 @@ @layer theme, base, antd, components, utilities; @import 'tailwindcss'; +@plugin "@tailwindcss/typography"; -html, body { +html, +body { margin: 0; padding: 0; width: 100%; @@ -33,4 +35,170 @@ html, body { .mod-codes-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } +} + +.nav-item { + position: relative; + overflow: hidden; + z-index: 1; +} + +.nav-item::after { + content: ''; + position: absolute; + bottom: 0; + left: 0; + right: 0; + height: 0; + background: linear-gradient(to top, #22ffa7, transparent); + transition: height 0.2s ease-in-out; + opacity: 0.35; + pointer-events: none; + z-index: -1; + +} + +.nav-item:hover::after { + height: 30%; +} + +/* 激活状态效果 */ +.nav-item.active::after { + height: 30%; +} + +/* 可选:激活+悬停效果 */ +.nav-item.active:hover::after { + opacity: 0.35; +} + +.custom-btn-outlined { + --ant-color-solid: #10E28C; + /* 边框和文字颜色 */ + --ant-color-solid-hover: #2ee59d; + --ant-color-solid-active: #0cb878; +} + + +.hex-bg { + background-color: #1E1E1E; + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' opacity='0.3' viewBox='0 0 100 100'%3E%3Cdefs%3E%3ClinearGradient id='fadeDown' x1='0%25' y1='0%25' x2='0%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%2339ff14' stop-opacity='1' /%3E%3Cstop offset='100%25' stop-color='%2339ff14' stop-opacity='0' /%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='none' stroke='url(%23fadeDown)' stroke-width='0.5'%3E%3Cpath d='M225 131.704L230.452 134.852 230.452 141.148 225 144.296 219.548 141.148 219.548 134.852Z' transform='matrix(0.52546041,-0.85081805,0.85081805,0.52546041,-203.01888079,130.22116071)'/%3E%3Cpath d='M225 131.704L230.452 134.852 230.452 141.148 225 144.296 219.548 141.148 219.548 134.852Z' transform='matrix(0.52546006,-0.85081827,0.85081827,0.52546006,-190.65208214,130.43446239)'/%3E%3Cpath d='M225 131.704L230.452 134.852 230.452 141.148 225 144.296 219.548 141.148 219.548 134.852Z' transform='matrix(0.52546006,-0.85081827,0.85081827,0.52546006,-197.04868859,141.09544261)'/%3E%3Cpath d='M225 131.704L230.452 134.852 230.452 141.148 225 144.296 219.548 141.148 219.548 134.852Z' transform='matrix(0.52546006,-0.85081827,0.85081827,0.52546006,-184.68192833,141.30866893)'/%3E%3Cpath d='M225 131.704L230.452 134.852 230.452 141.148 225 144.296 219.548 141.148 219.548 134.852Z' transform='matrix(0.52546006,-0.85081827,0.85081827,0.52546006,-178.2853524,130.6476887)'/%3E%3Cpath d='M225 131.704L230.452 134.852 230.452 141.148 225 144.296 219.548 141.148 219.548 134.852Z' transform='matrix(0.52546006,-0.85081827,0.85081827,0.52546006,-172.3151986,141.52187999)'/%3E%3Cpath d='M225 131.704L230.452 134.852 230.452 141.148 225 144.296 219.548 141.148 219.548 134.852Z' transform='matrix(0.52546006,-0.85081827,0.85081827,0.52546006,-190.86530846,152.18286021)'/%3E%3Cpath d='M225 131.704L230.452 134.852 230.452 141.148 225 144.296 219.548 141.148 219.548 134.852Z' transform='matrix(0.52546006,-0.85081827,0.85081827,0.52546006,-178.49857872,152.39608653)'/%3E%3Cpath d='M225 131.704L230.452 134.852 230.452 141.148 225 144.296 219.548 141.148 219.548 134.852Z' transform='matrix(0.52546006,-0.85081827,0.85081827,0.52546006,-203.44526451,151.88976939)'/%3E%3Cpath d='M225 131.704L230.452 134.852 230.452 141.148 225 144.296 219.548 141.148 219.548 134.852Z' transform='matrix(0.52546006,-0.85081827,0.85081827,0.52546006,-165.94457787,152.72932323)'/%3E%3Cpath d='M225 131.704L230.452 134.852 230.452 141.148 225 144.296 219.548 141.148 219.548 134.852Z' transform='matrix(0.52546006,-0.85081827,0.85081827,0.52546006,-197.30770653,163.1089619)'/%3E%3Cpath d='M225 131.704L230.452 134.852 230.452 141.148 225 144.296 219.548 141.148 219.548 134.852Z' transform='matrix(0.52546006,-0.85081827,0.85081827,0.52546006,-184.99694603,163.40205272)'/%3E%3Cpath d='M225 131.704L230.452 134.852 230.452 141.148 225 144.296 219.548 141.148 219.548 134.852Z' transform='matrix(0.52546006,-0.85081827,0.85081827,0.52546006,-172.3930642,163.69517406)'/%3E%3Cpath d='M225 131.704L230.452 134.852 230.452 141.148 225 144.296 219.548 141.148 219.548 134.852Z' transform='matrix(0.52546006,-0.85081827,0.85081827,0.52546006,-165.94457787,130.86648448)'/%3E%3Cpath d='M225 131.704L230.452 134.852 230.452 141.148 225 144.296 219.548 141.148 219.548 134.852Z' transform='matrix(0.52546006,-0.85081827,0.85081827,0.52546006,-178.84158104,174.24726756)'/%3E%3Cpath d='M225 131.704L230.452 134.852 230.452 141.148 225 144.296 219.548 141.148 219.548 134.852Z' transform='matrix(0.52546006,-0.85081827,0.85081827,0.52546006,-166.23769921,174.68691905)'/%3E%3Cpath d='M225 131.704L230.452 134.852 230.452 141.148 225 144.296 219.548 141.148 219.548 134.852Z' transform='matrix(0.52546006,-0.85081827,0.85081827,0.52546006,-160.08231896,163.69518931)'/%3E%3Cpath d='M225 131.704L230.452 134.852 230.452 141.148 225 144.296 219.548 141.148 219.548 134.852Z' transform='matrix(0.52546006,-0.85081827,0.85081827,0.52546006,-159.78921288,141.71168407)'/%3E%3Cpath d='M225 131.704L230.452 134.852 230.452 141.148 225 144.296 219.548 141.148 219.548 134.852Z' transform='matrix(0.52546006,-0.85081827,0.85081827,0.52546006,-160.37542504,185.6786793)'/%3E%3Cpath d='M225 131.704L230.452 134.852 230.452 141.148 225 144.296 219.548 141.148 219.548 134.852Z' transform='matrix(0.52546006,-0.85081827,0.85081827,0.52546006,-172.68620079,185.53211864)'/%3E%3Cpath d='M225 131.704L230.452 134.852 230.452 141.148 225 144.296 219.548 141.148 219.548 134.852Z' transform='matrix(0.52546006,-0.85081827,0.85081827,0.52546006,-209.32536095,140.83235057)'/%3E%3Cpath d='M225 131.704L230.452 134.852 230.452 141.148 225 144.296 219.548 141.148 219.548 134.852Z' transform='matrix(0.52546006,-0.85081827,0.85081827,0.52546006,-215.48072594,129.98715098)'/%3E%3C/g%3E%3C/svg%3E"); + background-size: 350px 350px; + background-position: right -90px top -40px; + background-repeat: no-repeat; + margin: 0; + +} + +.nav-item:hover, +.nav-item.active { + color: white; +} + + +/* LeftMiddleRightBox.css */ +.lmr-container { + display: flex; + width: 100%; + /* 可根据需要调整 */ + overflow: hidden; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); + background: '#555555'; + color: 'white'; + padding: '4px 12px'; + border-radius: '4px'; + font-size: '14px'; + font-weight: '500'; + letter-spacing: '0.5px'; +} + + +.lmr-left, +.lmr-middle, +.lmr-right { + padding: 20px; + transition: all 0.2s ease; + height: 100%; +} + + +.lmr-left { + flex: 1; + background-color: '#555555'; + color: 'white'; + padding: '4px 12px'; + border-radius: '4px'; + font-size: '14px'; + font-weight: '500'; + letter-spacing: '0.5px'; + margin: auto; +} + +.lmr-middle { + flex: 3; + background-color: '#555555'; + color: 'white'; + padding: '4px 12px'; + border-radius: '4px'; + font-size: '14px'; + font-weight: '500'; + letter-spacing: '0.5px'; +} + +.lmr-right { + flex: 2; + background-color: '#555555'; + color: 'white'; + padding: '4px 12px'; + border-radius: '4px'; + font-size: '14px'; + font-weight: '500'; + letter-spacing: '0.5px'; +} + +.content-placeholder { + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + justify-content: center; + height: 100%; + border-radius: 12px; + padding: 16px; +} + + + +@media (max-width: 768px) { + .lmr-container { + flex-direction: column; + min-height: auto; + } + + .lmr-left, + .lmr-middle, + .lmr-right { + border-right: none; + + } + + .lmr-right { + border-bottom: none; + } + + .content-placeholder { + min-height: 100px; + } +} + +.css-var-_r_1_.ant-collapse{ + --ant-collapse-header-bg:#1e1e1e; + width: 90%; + border: 0; + margin-left: auto; + margin-right: auto; +} + +.ant-collapse-body{ + background: #1e1e1e; } \ No newline at end of file diff --git a/web/src/layout/hero-layout/index.tsx b/web/src/layout/hero-layout/index.tsx index 113005e..08f1710 100644 --- a/web/src/layout/hero-layout/index.tsx +++ b/web/src/layout/hero-layout/index.tsx @@ -1,6 +1,17 @@ -import { Outlet, Link } from "react-router-dom" +import { Outlet, Link, NavLink } from "react-router-dom" import { useMemo } from "react" import dayjs from "dayjs" +import { Dropdown } from "antd" +import { + FileTextOutlined, + GithubOutlined, + LockOutlined, + LoginOutlined, +} from "@ant-design/icons" +import { AuthApi } from "@/api" +import { useAppDispatch, useAppSelector } from "@/hooks/store" +import { clearCurrentUser } from "@/store/auth-slice" +import { useState } from "react" /** * Main application component that serves as the root layout. @@ -8,59 +19,152 @@ import dayjs from "dayjs" */ export default function HeroLayout() { const today = useMemo(() => dayjs(), []) + const user = useAppSelector((state) => state.auth.user) + const dispatch = useAppDispatch() + const [isDropdownOpen, setIsDropdownOpen] = useState(false) + + async function handleLogout() { + try { + await AuthApi.logout() + } finally { + dispatch(clearCurrentUser()) + } + } return ( -
+
{/* Navigation Header */} -
-
-
+
+
+
-

- 三角洲行动改枪码库 -

+

阿萨拉向导

-
{/* Main Content Area */} -
+
{/* Footer */} -
-
-

- © 2024-{today.year()} Zihlu Wang 和 OnixByte。使用 React 与 TypeScript 构建。 -

+
+
+
+
setIsDropdownOpen(true)} + onMouseLeave={() => setIsDropdownOpen(false)}> + + {isDropdownOpen && ( + + )} +
+ + • + + + EULA + + • + + + 隐私政策 + + • + {user ? ( + + + {user.username} + + + ) : ( + + + 登录 + + )} +
+ +
+
+

© 2024-{today.year()} Zihlu Wang 和 OnixByte。使用 React 与 TypeScript 构建。

+
) -} \ No newline at end of file +} diff --git a/web/src/main.tsx b/web/src/main.tsx index 91dc8c0..26957b7 100644 --- a/web/src/main.tsx +++ b/web/src/main.tsx @@ -6,7 +6,6 @@ import { PersistGate } from "redux-persist/integration/react" import { App as AntApp, ConfigProvider as AntConfigProvider } from "antd" import { StyleProvider as AntStyleProvider } from "@ant-design/cssinjs" import AntSimplifiedChinese from "antd/locale/zh_CN" -import "@/init" import router from "@/router" import store, { persistor } from "@/store" import "./index.css" diff --git a/web/src/markdown.d.ts b/web/src/markdown.d.ts new file mode 100644 index 0000000..ad2af77 --- /dev/null +++ b/web/src/markdown.d.ts @@ -0,0 +1,6 @@ +declare module "*.md" { + const attributes: Record + const html: string + const toc: { level: string; content: string; slug: string }[] + export { attributes, html, toc } +} diff --git a/web/src/page/firearms/index.tsx b/web/src/page/firearms/index.tsx index ff63e20..28884b9 100644 --- a/web/src/page/firearms/index.tsx +++ b/web/src/page/firearms/index.tsx @@ -1,8 +1,16 @@ -import { useEffect, useState } from "react" +import { useCallback, useEffect, useState } from "react" import { Link } from "react-router-dom" import { FirearmApi } from "@/api" +import FirearmCreateModal from "@/components/firearm-create-modal" +import FirearmEditModal from "@/components/firearm-edit-modal" +import ModCodes from "@/components/mod-codes" +import { useAppSelector } from "@/hooks/store" import { Firearm, FirearmType } from "@/types" -import { Button, Card, Col, Pagination, Row, Select, Tag, Typography } from "antd" +import { Button, Card, Col, Pagination, Popconfirm, Row, Select, Tag, Typography, App } from "antd" +import { ConfigProvider, theme } from 'antd'; +import type { CollapseProps } from 'antd'; +import { Collapse } from 'antd'; + const firearmTypeText: Record = { RIFLE: "步枪", @@ -15,6 +23,14 @@ const firearmTypeText: Record = { SPECIAL: "特殊", } + + +const darkTheme = { + algorithm: theme.darkAlgorithm, + + // token: { colorPrimary: '#00b96b' }, +}; + const allTypeValue = "ALL" type FirearmTypeFilter = FirearmType | typeof allTypeValue @@ -23,110 +39,399 @@ function asDps(fireRate: number, damage: number) { } export default function FirearmsPage() { + const user = useAppSelector((state) => state.auth.user) + const { message } = App.useApp() const [page, setPage] = useState(1) const [typeFilter, setTypeFilter] = useState(allTypeValue) const [firearms, setFirearms] = useState([]) const [total, setTotal] = useState(0) - useEffect(() => { - FirearmApi.getFirearms({ + const [createModalOpen, setCreateModalOpen] = useState(false) + const [editingFirearm, setEditingFirearm] = useState(null) + const [deletingId, setDeletingId] = useState(null) + + const loadFirearms = useCallback(async () => { + const pagedData = await FirearmApi.getFirearms({ page: page - 1, size: 12, sortBy: "id", direction: "ASC", type: typeFilter === allTypeValue ? undefined : typeFilter, - }).then((pagedData) => { - setFirearms(pagedData.items) - setTotal(pagedData.totalElements) }) + setFirearms(pagedData.items) + setTotal(pagedData.totalElements) }, [page, typeFilter]) + const [expandedId, setExpandedId] = useState(null); + + + + + useEffect(() => { + void loadFirearms() + }, [loadFirearms]) + useEffect(() => { + window.scrollTo({ top: 0, behavior: 'smooth' }); + }, [page]); + + + async function handleDelete(firearm: Firearm) { + setDeletingId(firearm.id) + try { + await FirearmApi.removeFirearm(firearm.id) + message.success("武器删除成功") + if (firearms.length === 1 && page > 1) { + setPage(page - 1) + } else { + void loadFirearms() + } + } catch { + message.error("武器删除失败,请稍后重试") + } finally { + setDeletingId(null) + } + } return ( <> -
- - className="w-full sm:w-64" - value={typeFilter} - options={[ - { value: allTypeValue, label: "全部类型" }, - ...Object.entries(firearmTypeText).map(([value, label]) => ({ - value, - label, - })), - ]} - onChange={(nextType) => { - setPage(1) - setTypeFilter(nextType) - }} - /> -
-
- - {firearms.map((firearm) => ( - - - - , - ]}> -
-
- {firearmTypeText[firearm.type]} + +
+
+ {user && ( + + )} +
+ + className="w-full sm:w-64" + value={typeFilter} + options={[ + { value: allTypeValue, label: "全部类型" }, + ...Object.entries(firearmTypeText).map(([value, label]) => ({ + value, + label, + })), + ]} + onChange={(nextType) => { + setPage(1) + setTypeFilter(nextType) + }} + /> +
+
+ + {firearms.map((firearm) => ( + + + + + handleDelete(firearm)}> + + +
+ ) : null + } + variant="outlined" + style={{ + height: '100%', display: 'flex', flexDirection: 'column' + }} + styles={{ + root: { + border: '1px solid #313131' + }, + header: { + borderBottom: '1px solid #303030', + }, + body: { + flex: 1, + overflow: 'auto', + padding: '12px', + + }, + actions: { + flexShrink: 0, + background: '#1e1e1e', + display: 'flex' + } + }} + actions={[ +
+ null} + styles={ + { + root: { + background: '#1e1e1e', + } + } + } + items={[{ + key: '1', + label: ( + + ), + children: + }]} + /> +
, + ]}> +
+
+
+
+ + {firearm.name} + + + {firearmTypeText[firearm.type]} + +
+
+
+
+
+ {/* 武器输出等级 */} +
+
+ 武器输出等级 +
+
+ {firearm.level} +
+
+ + {/* 子弹口径 */} +
+
+ 子弹口径 +
+
+ {firearm.calibre} +
+
+ + {/* 每秒甲伤 */} +
+
+ 每秒甲伤 +
+
+ {asDps(firearm.fireRate, firearm.armourDamage)} +
+
+ + {/* 每秒肉伤 */} +
+
+ 每秒肉伤 +
+
+ {asDps(firearm.fireRate, firearm.bodyDamage)} +
+
+
+ +
+
+
+ {firearm.review}
, + placement: "topLeft", + } + : false, + }} + className="whitespace-pre-line"> + {firearm.review || "暂无描述"} + +
+
+
- - 武器输出等级: - {firearm.level} - - - 子弹口径: - {firearm.calibre} - - - 每秒甲伤: - {asDps(firearm.fireRate, firearm.armourDamage)} - - - 每秒肉伤: - {asDps(firearm.fireRate, firearm.bodyDamage)} - - - {firearm.review || "暂无描述"} - -
-
- - ))} - {firearms.length === 0 && ( - - - 暂无武器数据 - - - )} -
-
-
- { - setPage(nextPage) + + + ))} + {firearms.length === 0 && ( + + + 暂无武器数据 + + + )} + +
+
+ { + setPage(nextPage) + }} + showSizeChanger={false} + /> +
+ setCreateModalOpen(false)} + onSuccess={() => { + setCreateModalOpen(false) + void loadFirearms() }} - showSizeChanger={false} /> -
+ + setEditingFirearm(null)} + onSuccess={() => { + setEditingFirearm(null) + void loadFirearms() + }} + + /> + + ) } diff --git a/web/src/page/legal/index.tsx b/web/src/page/legal/index.tsx new file mode 100644 index 0000000..c108514 --- /dev/null +++ b/web/src/page/legal/index.tsx @@ -0,0 +1,34 @@ +import { Tabs } from "antd" +import { useSearchParams } from "react-router-dom" +import MarkdownRenderer from "@/components/markdown-renderer" +import { html as EulaHtml } from "@/docs/EULA.md" +import { html as PrivacyHtml } from "@/docs/PrivacyPolicy.md" + +const tabKeys = new Set(["eula", "privacy"]) + +export default function LegalPage() { + const [searchParams, setSearchParams] = useSearchParams() + const rawTab = searchParams.get("tab") + const activeTab = rawTab && tabKeys.has(rawTab) ? rawTab : "eula" + + return ( +
+ setSearchParams({ tab: key })} + items={[ + { + key: "eula", + label: "最终用户许可协议", + children: , + }, + { + key: "privacy", + label: "隐私政策", + children: , + }, + ]} + /> +
+ ) +} diff --git a/web/src/page/login/index.tsx b/web/src/page/login/index.tsx new file mode 100644 index 0000000..c077fe5 --- /dev/null +++ b/web/src/page/login/index.tsx @@ -0,0 +1,67 @@ +import { useState } from "react" +import { useNavigate } from "react-router-dom" +import { App, Button, Card, Form, Input, Typography } from "antd" +import { AuthApi } from "@/api" +import { useAppDispatch } from "@/hooks/store" +import { setCurrentUser } from "@/store/auth-slice" +import { LoginRequest } from "@/types" + +export default function LoginPage() { + const navigate = useNavigate() + const { message } = App.useApp() + const dispatch = useAppDispatch() + const [loading, setLoading] = useState(false) + + async function onFinish(values: LoginRequest) { + setLoading(true) + try { + const user = await AuthApi.login(values) + dispatch(setCurrentUser(user)) + message.success(`欢迎回来,${user.username}`) + navigate("/firearms") + } catch { + message.error("登录失败,请检查帐号或密码") + } finally { + setLoading(false) + } + } + + return ( +
+
+ + + 登录 + + + 使用你的帐号登录后即可继续操作 + + + layout="vertical" onFinish={onFinish} requiredMark={false}> + + name="principle" + label="帐号" + rules={[{ required: true, message: "请输入帐号" }]} + > + + + + + name="credential" + label="密码" + rules={[{ required: true, message: "请输入密码" }]} + > + + + + + + + + +
+
+ ) +} diff --git a/web/src/page/mod-codes/index.tsx b/web/src/page/mod-codes/index.tsx index c18f29b..1460ed9 100644 --- a/web/src/page/mod-codes/index.tsx +++ b/web/src/page/mod-codes/index.tsx @@ -1,34 +1,62 @@ -import { useEffect, useMemo, useState } from "react" +import { + App, + Button, + Card, + Col, + Pagination, + Popconfirm, + Row, + Select, + Space, + Tag, + Typography, +} from "antd" +import { useCallback, useEffect, useMemo, useState } from "react" import { Link, useSearchParams } from "react-router-dom" -import { Button, Card, Col, Pagination, Row, Select, Space, Tag, Typography } from "antd" import { ModificationApi, TagApi } from "@/api" +import ModificationCreateModal from "@/components/modification-create-modal" +import ModificationEditModal from "@/components/modification-edit-modal" +import { useAppSelector } from "@/hooks/store" import { Modification } from "@/types" -const pageSize = 12 +const pageSize = 10 export default function ModCodesPage() { + const user = useAppSelector((state) => state.auth.user) + const { message } = App.useApp() const [searchParams] = useSearchParams() const firearmId = useMemo(() => searchParams.get("firearmId") || undefined, [searchParams]) + const parsedFirearmId = useMemo(() => { + if (!firearmId) { + return undefined + } + + const value = Number(firearmId) + return Number.isFinite(value) ? value : undefined + }, [firearmId]) const [page, setPage] = useState(1) const [modifications, setModifications] = useState([]) const [tagOptions, setTagOptions] = useState([]) const [selectedTags, setSelectedTags] = useState([]) const [total, setTotal] = useState(0) + const [deletingId, setDeletingId] = useState(null) + const [createModalOpen, setCreateModalOpen] = useState(false) + const [editingModification, setEditingModification] = useState(null) useEffect(() => { - const _firearmId = firearmId ? +firearmId : (void 0) + const _firearmId = firearmId ? +firearmId : void 0 TagApi.getTags(_firearmId).then((tags) => { setTagOptions(tags) }) - }, []) + }, [firearmId]) - useEffect(() => { - ModificationApi.getModifications({ + const loadModifications = useCallback(async () => { + return ModificationApi.getModifications({ page: page - 1, size: pageSize, sortBy: "id", - direction: "ASC", + direction: "DESC", firearmId, tags: selectedTags, }).then((pagedData) => { @@ -37,6 +65,31 @@ export default function ModCodesPage() { }) }, [page, firearmId, selectedTags]) + useEffect(() => { + void loadModifications() + }, [loadModifications]) + + async function handleDelete(modification: Modification) { + if (!user) { + return + } + + setDeletingId(modification.id) + try { + await ModificationApi.removeModification(modification.id) + message.success("改枪码删除成功") + if (modifications.length === 1 && page > 1) { + setPage(page - 1) + } else { + void loadModifications() + } + } catch { + message.error("改枪码删除失败,请稍后重试") + } finally { + setDeletingId(null) + } + } + useEffect(() => { setPage(1) }, [firearmId]) @@ -47,46 +100,79 @@ export default function ModCodesPage() { return ( <> -
+
改枪码列表 - - 标签: - - mode="multiple" - allowClear - placeholder="请选择标签" - className="w-64" - value={selectedTags} - options={tagOptions.map((tag) => ({ value: tag, label: tag }))} - onChange={(values) => { - setSelectedTags(values) - }} - /> - {firearmId && 武器 ID: {firearmId}} - {(firearmId || selectedTags.length > 0) && ( - - - +
+ + 标签: + + mode="multiple" + allowClear + placeholder="请选择标签" + className="w-64" + value={selectedTags} + options={tagOptions.map((tag) => ({ value: tag, label: tag }))} + onChange={(values) => { + setSelectedTags(values) + }} + /> + {firearmId && 武器 ID: {firearmId}} + {(firearmId || selectedTags.length > 0) && ( + + + + )} + + {user && ( + )} - +
{modifications.map((modification) => ( - + + + handleDelete(modification)}> + + +
+ ) : null + } variant="outlined" styles={{ header: { minHeight: 56 }, @@ -106,20 +192,59 @@ export default function ModCodesPage() { 复制
- + 作者: {modification.author || "未知"} - {modification.tags.length > 0 && ( + {(modification.tags?.length || 0) > 0 && (
- {modification.tags.map((tag) => ( + {(modification.tags || []).map((tag) => ( {tag} ))}
)} +
+ 配件配置: + {(modification.accessories?.length || 0) > 0 ? ( +
+
+ {(modification.accessories || []).map((accessory, accessoryIndex) => ( +
+
+ + {accessory.slotName || "未填写槽位"} + + + {accessory.accessoryName || "未填写配件"} + +
+ {(accessory.tunings?.length || 0) > 0 ? ( +
+ {accessory.tunings.map((tuning, tuningIndex) => ( + + {tuning.tuningName || "未命名"}: {tuning.tuningValue ?? "-"} + + ))} +
+ ) : null} +
+ ))} +
+
+ ) : ( + + 暂无配件信息 + + )} +
+
+ + setCreateModalOpen(false)} + onSuccess={() => { + setCreateModalOpen(false) + void loadModifications() + }} + /> + + setEditingModification(null)} + onSuccess={() => { + setEditingModification(null) + void loadModifications() + }} + /> ) } diff --git a/web/src/router/index.tsx b/web/src/router/index.tsx index b506a3c..a9bd1aa 100644 --- a/web/src/router/index.tsx +++ b/web/src/router/index.tsx @@ -1,6 +1,7 @@ import { ComponentType } from "react" import { createBrowserRouter } from "react-router-dom" import ErrorPage from "@/components/error-page" +import EmptyLayout from "@/layout/empty-layout" import HeroLayout from "@/layout/hero-layout" function lazy }>(importer: () => Promise) { @@ -12,6 +13,8 @@ function lazy }>(importer: () => Pro } } +const hydrateFallbackElement =
页面加载中...
+ /** * Main application router configuration using React Router v6. * Defines all routes and their corresponding components. @@ -21,11 +24,13 @@ const router = createBrowserRouter( { path: "/", element: , + hydrateFallbackElement, errorElement: , children: [ { index: true, lazy: lazy(() => import("@/page/firearms")), + }, { path: "firearms", @@ -35,6 +40,21 @@ const router = createBrowserRouter( path: "mod-codes", lazy: lazy(() => import("@/page/mod-codes")), }, + { + path: "legal", + lazy: lazy(() => import("@/page/legal")) + } + ], + }, + { + element: , + hydrateFallbackElement, + errorElement: , + children: [ + { + path: "login", + lazy: lazy(() => import("@/page/login")), + }, ], }, ], diff --git a/web/src/shared/dayjs/index.ts b/web/src/shared/dayjs/index.ts new file mode 100644 index 0000000..42e67bc --- /dev/null +++ b/web/src/shared/dayjs/index.ts @@ -0,0 +1,6 @@ +import dayjs from "dayjs" +import duration from "dayjs/plugin/duration" + +dayjs.extend(duration) + +export default dayjs diff --git a/web/src/shared/web-client/index.ts b/web/src/shared/web-client/index.ts index b6b2081..b2fc077 100644 --- a/web/src/shared/web-client/index.ts +++ b/web/src/shared/web-client/index.ts @@ -1,9 +1,10 @@ import axios from "axios" -import dayjs from "dayjs" +import dayjs from "@/shared/dayjs" const WebClient = axios.create({ baseURL: import.meta.env.VITE_API_BASE_URL, timeout: dayjs.duration({ seconds: 10 }).asMilliseconds(), + withCredentials: true }) export { WebClient } diff --git a/web/src/store/auth-slice.ts b/web/src/store/auth-slice.ts new file mode 100644 index 0000000..71dc980 --- /dev/null +++ b/web/src/store/auth-slice.ts @@ -0,0 +1,26 @@ +import { createSlice, PayloadAction } from "@reduxjs/toolkit" +import { User } from "@/types" + +interface AuthState { + user: User | null +} + +const initialState: AuthState = { + user: null, +} + +const authSlice = createSlice({ + name: "auth", + initialState, + reducers: { + setCurrentUser(state, action: PayloadAction) { + state.user = action.payload + }, + clearCurrentUser(state) { + state.user = null + }, + }, +}) + +export const { setCurrentUser, clearCurrentUser } = authSlice.actions +export const authReducer = authSlice.reducer diff --git a/web/src/store/index.ts b/web/src/store/index.ts index 8e33ca8..eaf1212 100644 --- a/web/src/store/index.ts +++ b/web/src/store/index.ts @@ -1,5 +1,4 @@ import { configureStore, combineReducers } from "@reduxjs/toolkit" -import { useDispatch, useSelector } from "react-redux" import { persistStore, persistReducer, @@ -11,6 +10,7 @@ import { REGISTER, } from "redux-persist" import createWebStorage from "redux-persist/es/storage/createWebStorage" +import { authReducer } from "./auth-slice" import { firearmsReducer } from "./firearms-slice" const storage = createWebStorage(import.meta.env.VITE_REDUX_STORAGE ?? "local") @@ -18,10 +18,11 @@ const storage = createWebStorage(import.meta.env.VITE_REDUX_STORAGE ?? "local") const persistConfig = { key: "root", storage, - whitelist: ["firearms"], + whitelist: ["auth", "firearms"], } const rootReducer = combineReducers({ + auth: authReducer, firearms: firearmsReducer }) @@ -44,5 +45,3 @@ export type RootState = ReturnType export type AppDispatch = typeof store.dispatch export type AppStore = typeof store -export const useAppDispatch = useDispatch.withTypes() -export const useAppSelector = useSelector.withTypes() diff --git a/web/src/types/auth.ts b/web/src/types/auth.ts new file mode 100644 index 0000000..34c2b14 --- /dev/null +++ b/web/src/types/auth.ts @@ -0,0 +1,11 @@ +export interface LoginRequest { + principle: string + credential: string +} + +export interface User { + id: number + username: string + email: string +} + diff --git a/web/src/types/common.ts b/web/src/types/common.ts new file mode 100644 index 0000000..9f98731 --- /dev/null +++ b/web/src/types/common.ts @@ -0,0 +1,17 @@ +export type Direction = "ASC" | "DESC" + +export interface Page { + items: T[] + page: number + size: number + totalElements: number + totalPages: number +} + +export interface PageQueryParams { + page?: number + size?: number + sortBy?: string + direction?: Direction +} + diff --git a/web/src/types/firearm.ts b/web/src/types/firearm.ts new file mode 100644 index 0000000..596f02d --- /dev/null +++ b/web/src/types/firearm.ts @@ -0,0 +1,24 @@ +export type FirearmType = + | "RIFLE" + | "SUB_MACHINE_GUN" + | "SHOTGUN" + | "LIGHT_MACHINE_GUN" + | "DESIGNATED_MARKSMAN_RIFLE" + | "SNIPER_RIFLE" + | "PISTOL" + | "SPECIAL" + +export interface Firearm { + id: number + name: string + type: FirearmType + level: string + calibre: string + fireRate: number + armourDamage: number + bodyDamage: number + review: string | null +} + +export interface AddFirearmRequest extends Omit {} + diff --git a/web/src/types/index.ts b/web/src/types/index.ts index 94c898b..785c148 100644 --- a/web/src/types/index.ts +++ b/web/src/types/index.ts @@ -1,49 +1,4 @@ -export type Direction = "ASC" | "DESC" - -export type FirearmType = - | "RIFLE" - | "SUB_MACHINE_GUN" - | "SHOTGUN" - | "LIGHT_MACHINE_GUN" - | "DESIGNATED_MARKSMAN_RIFLE" - | "SNIPER_RIFLE" - | "PISTOL" - | "SPECIAL" - -export interface Page { - items: T[] - page: number - size: number - totalElements: number - totalPages: number -} - -export interface Firearm { - id: number - name: string - type: FirearmType - level: string - calibre: string - fireRate: number - armourDamage: number - bodyDamage: number - review: string -} - -export interface Modification { - id: number - firearmId: number - name: string - code: string - tags: string[] - note: string - author: string - videoUrl: string -} - -export interface PageQueryParams { - page?: number - size?: number - sortBy?: string - direction?: Direction -} +export * from "./common" +export * from "./firearm" +export * from "./modification" +export * from "./auth" diff --git a/web/src/types/modification.ts b/web/src/types/modification.ts new file mode 100644 index 0000000..20b6e58 --- /dev/null +++ b/web/src/types/modification.ts @@ -0,0 +1,24 @@ +export interface Tuning { + tuningName: string + tuningValue: number +} + +export interface Accessory { + slotName: string + accessoryName: string + tunings: Tuning[] +} + +export interface Modification { + id: number + firearmId: number + name: string + code: string + tags?: string[] + note?: string + author?: string + videoUrl?: string, + accessories: Accessory[] +} + +export interface ModificationRequest extends Omit {} diff --git a/web/src/vite-env.d.ts b/web/src/vite-env.d.ts index 3bd4069..d704870 100644 --- a/web/src/vite-env.d.ts +++ b/web/src/vite-env.d.ts @@ -1,6 +1,14 @@ /// interface ImportMetaEnv { + /** + * Redux persistent storage location, use `local` for local storage and `session` for + * session storage + */ readonly VITE_REDUX_STORAGE: "local" | "session" + + /** + * Backend API Base URL + */ readonly VITE_API_BASE_URL: string } diff --git a/web/tailwind.config.ts b/web/tailwind.config.ts new file mode 100644 index 0000000..5170b8b --- /dev/null +++ b/web/tailwind.config.ts @@ -0,0 +1,10 @@ +import type { Config } from "tailwindcss" +import typography from "@tailwindcss/typography" + +export default { + content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"], + theme: { + extend: {}, + }, + plugins: [typography], +} satisfies Config diff --git a/web/vite.config.ts b/web/vite.config.ts index 45b6aba..629a4ba 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -2,11 +2,48 @@ import { fileURLToPath, URL } from "node:url" import { defineConfig } from "vite" import react from "@vitejs/plugin-react" import tailwindcss from "@tailwindcss/vite" +import portChecker from "vite-plugin-port-checker" +import { Mode, plugin as markdown } from "vite-plugin-markdown" // https://vite.dev/config/ export default defineConfig({ - plugins: [react(), tailwindcss()], + plugins: [react(), tailwindcss(), portChecker(), markdown({ mode: [Mode.HTML, Mode.TOC] })], base: "/", + build: { + rolldownOptions: { + output: { + manualChunks(id) { + if (!id.includes("node_modules")) { + return + } + + if (id.includes("react-router")) { + return "router-vendor" + } + + if (id.includes("redux") || id.includes("immer")) { + return "redux-vendor" + } + + if (id.includes("/node_modules/@ant-design/")) { + return "ant-design-vendor" + } + + if (id.includes("/node_modules/rc-")) { + return "antd-rc-vendor" + } + + if ( + id.includes("/node_modules/react/") || + id.includes("/node_modules/react-dom/") || + id.includes("/node_modules/scheduler/") + ) { + return "react-vendor" + } + }, + }, + }, + }, resolve: { alias: { "@": fileURLToPath(new URL("./src", import.meta.url)),