@withwiz/toolkit 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ko.md +235 -0
- package/README.md +57 -26
- package/dist/{chunk-V6YD53NH.js → chunk-23LQJYZN.js} +5 -2
- package/dist/{chunk-ZTRASVGZ.js → chunk-34L7HTM7.js} +1 -1
- package/dist/{chunk-GSUCBWML.js → chunk-3RK3MKAR.js} +5 -2
- package/dist/{chunk-6JXHXIEH.js → chunk-3UIKCS56.js} +2 -2
- package/dist/{chunk-MNYVAEXK.js → chunk-4ROIPF33.js} +16 -3
- package/dist/{chunk-DUIQUAHR.js → chunk-4TGPAUJV.js} +4 -4
- package/dist/{chunk-P4CZVRSG.js → chunk-4XPXZNBX.js} +18 -11
- package/dist/{chunk-LG3KM5V3.js → chunk-5I3EQHR4.js} +6 -2
- package/dist/chunk-63EKUOJH.js +72 -0
- package/dist/{chunk-N5VOFGF3.js → chunk-75UDFONR.js} +5 -4
- package/dist/{chunk-T4643SEW.js → chunk-7KIM5MHV.js} +4 -4
- package/dist/{chunk-TF5RJ5Q2.js → chunk-7S2PCYNT.js} +5 -5
- package/dist/{chunk-2SIBG5BG.js → chunk-7YWUKMZD.js} +7 -0
- package/dist/{chunk-7X2N4VZM.js → chunk-ATBYGPLP.js} +1 -1
- package/dist/{chunk-A74POWYY.js → chunk-B7AJJKOY.js} +1 -1
- package/dist/{chunk-HKW4JA45.js → chunk-BRBOGLFT.js} +10 -10
- package/dist/{chunk-ZFNIHVVA.js → chunk-BRFW2LL2.js} +5 -5
- package/dist/{chunk-I4NT6G2T.js → chunk-DRTJSTEV.js} +2 -2
- package/dist/{chunk-H5KYXSYZ.js → chunk-DVCGAI5N.js} +2 -12
- package/dist/{chunk-AV7ELXHG.js → chunk-E5TDIRBJ.js} +2 -2
- package/dist/{chunk-Q5ERE4M3.js → chunk-HGVPZSWW.js} +18 -13
- package/dist/{chunk-2QVDB6UO.js → chunk-HV6A6Z5R.js} +1 -1
- package/dist/chunk-ILMPKSWS.js +125 -0
- package/dist/{chunk-J5NLAZV2.js → chunk-JHUWZ6YW.js} +2 -2
- package/dist/{chunk-LON5THYQ.js → chunk-KLMKCYIN.js} +1 -1
- package/dist/{chunk-4KJZRI74.js → chunk-KWUOLKDO.js} +1 -1
- package/dist/{chunk-GJO2MPC3.js → chunk-LCYDMYZS.js} +1 -1
- package/dist/{chunk-UP3VFIVQ.js → chunk-LL3VWKY4.js} +1 -1
- package/dist/{chunk-IMAFMUZ7.js → chunk-LSS3GJUE.js} +3 -2
- package/dist/{chunk-2PFSRVVD.js → chunk-LWHLB2Y6.js} +84 -18
- package/dist/{chunk-BBE4RXR7.js → chunk-MTZXWVW3.js} +17 -6
- package/dist/{chunk-ORMEWXMH.js → chunk-N3ETBM74.js} +1 -14
- package/dist/{chunk-UKPMQBU2.js → chunk-N3TCQ5BF.js} +6 -5
- package/dist/{chunk-TMTN7H46.js → chunk-NLV7IEYM.js} +7 -6
- package/dist/{chunk-P2VPYAJZ.js → chunk-NTZBMWB6.js} +6 -6
- package/dist/{chunk-ZVGEGDYF.js → chunk-OII5BXCZ.js} +1 -1
- package/dist/{chunk-2JGSS4RM.js → chunk-PRPMEHRE.js} +2 -2
- package/dist/{chunk-KG65BFPK.js → chunk-QAIN3WNN.js} +1 -1
- package/dist/{chunk-2MYD2BFJ.js → chunk-R7EFDSPZ.js} +7 -7
- package/dist/{chunk-VJE4HA2C.js → chunk-RWCPRPEP.js} +3 -2
- package/dist/{chunk-4YDBQZ5M.js → chunk-SCAFDDJP.js} +14 -14
- package/dist/{chunk-KXYDTC4A.js → chunk-SNFPZD6L.js} +11 -2
- package/dist/{chunk-BL6QHL5L.js → chunk-SXBDP3CK.js} +3 -3
- package/dist/{chunk-B5VRZ2VJ.js → chunk-TNDEYJEL.js} +25 -6
- package/dist/{chunk-Q4XDPK5B.js → chunk-TRGFXIEF.js} +3 -3
- package/dist/{chunk-VNDL2E44.js → chunk-U52U5SK7.js} +2 -2
- package/dist/{chunk-3KYSGBVF.js → chunk-UWOWKOOQ.js} +5 -3
- package/dist/{chunk-TQ3XHHZK.js → chunk-V3WZFUY3.js} +9 -9
- package/dist/{chunk-5BBVV2EX.js → chunk-VH57Y5Z4.js} +1 -1
- package/dist/{chunk-5S7M2AJL.js → chunk-VWAB4PM7.js} +1 -1
- package/dist/{chunk-AQZPGOEZ.js → chunk-VWKZMGPJ.js} +5 -4
- package/dist/{chunk-4K27YLAE.js → chunk-VZ2PQA4U.js} +2 -2
- package/dist/{chunk-ZOWEW4GY.js → chunk-WBHX4MJV.js} +2 -2
- package/dist/{chunk-UMRKMF3E.js → chunk-WXOWI7BJ.js} +2 -2
- package/dist/chunk-XAGPZLRK.js +106 -0
- package/dist/{chunk-AWIORJAI.js → chunk-XF3WUF3F.js} +2 -2
- package/dist/{chunk-M5ZYAQBB.js → chunk-XKIBJJA3.js} +28 -24
- package/dist/{chunk-ZLYBY3R4.js → chunk-XTGS6JJB.js} +10 -5
- package/dist/{chunk-KCDJIW2F.js → chunk-XXPB4C37.js} +5 -5
- package/dist/{chunk-LUIYCIF7.js → chunk-Y4ME3Q5K.js} +2 -2
- package/dist/{chunk-Q66VOVGN.js → chunk-Y4WPEIKW.js} +1 -1
- package/dist/{chunk-TUA5XW5Z.js → chunk-Y6CPPBJI.js} +1 -1
- package/dist/{chunk-PRWWB4QY.js → chunk-ZEHNCHIV.js} +2 -2
- package/dist/{chunk-D73ZJQMX.js → chunk-ZZABL54F.js} +13 -0
- package/dist/core/auth/config.d.ts +3 -0
- package/dist/core/auth/config.js +3 -3
- package/dist/core/auth/email/index.d.ts +3 -3
- package/dist/core/auth/email/index.js +3 -3
- package/dist/core/auth/email/sender.d.ts +1 -1
- package/dist/core/auth/email/sender.js +2 -2
- package/dist/core/auth/email/token-generator.d.ts +11 -0
- package/dist/core/auth/email/token-generator.js +2 -2
- package/dist/core/auth/errors/index.js +1 -1
- package/dist/core/auth/index.d.ts +11 -11
- package/dist/core/auth/index.js +24 -16
- package/dist/core/auth/jwt/client.js +3 -2
- package/dist/core/auth/jwt/cookie.d.ts +1 -1
- package/dist/core/auth/jwt/cookie.js +4 -4
- package/dist/core/auth/jwt/index.d.ts +41 -9
- package/dist/core/auth/jwt/index.js +6 -6
- package/dist/core/auth/jwt/types.d.ts +1 -1
- package/dist/core/auth/jwt/types.js +1 -1
- package/dist/core/auth/oauth/index.d.ts +6 -6
- package/dist/core/auth/oauth/index.js +5 -5
- package/dist/core/auth/oauth/providers/github.d.ts +1 -1
- package/dist/core/auth/oauth/providers/github.js +1 -1
- package/dist/core/auth/oauth/providers/google.d.ts +1 -1
- package/dist/core/auth/oauth/providers/google.js +1 -1
- package/dist/core/auth/oauth/providers/index.d.ts +5 -5
- package/dist/core/auth/oauth/providers/index.js +4 -4
- package/dist/core/auth/oauth/providers/kakao.d.ts +1 -1
- package/dist/core/auth/oauth/providers/kakao.js +1 -1
- package/dist/core/auth/oauth/providers/meta.d.ts +1 -1
- package/dist/core/auth/oauth/providers/meta.js +1 -1
- package/dist/core/auth/oauth/providers/microsoft.d.ts +1 -1
- package/dist/core/auth/oauth/providers/microsoft.js +1 -1
- package/dist/core/auth/oauth/state-cookie.js +1 -1
- package/dist/core/auth/password/client-helper.d.ts +9 -9
- package/dist/core/auth/password/client-helper.js +5 -3
- package/dist/core/auth/password/hasher.d.ts +83 -0
- package/dist/core/auth/password/hasher.js +14 -0
- package/dist/core/auth/password/index.d.ts +8 -6
- package/dist/core/auth/password/index.js +11 -2
- package/dist/core/auth/services/email-verification.service.d.ts +1 -1
- package/dist/core/auth/services/email-verification.service.js +3 -3
- package/dist/core/auth/services/index.d.ts +13 -12
- package/dist/core/auth/services/index.js +16 -16
- package/dist/core/auth/services/login.service.d.ts +15 -1
- package/dist/core/auth/services/login.service.js +6 -6
- package/dist/core/auth/services/oauth-callback.service.d.ts +7 -1
- package/dist/core/auth/services/oauth-callback.service.js +6 -6
- package/dist/core/auth/services/password-reset.service.d.ts +1 -1
- package/dist/core/auth/services/password-reset.service.js +3 -3
- package/dist/core/auth/services/refresh-token-store.d.ts +39 -0
- package/dist/core/auth/services/register.service.d.ts +1 -1
- package/dist/core/auth/services/register.service.js +3 -3
- package/dist/core/auth/services/token-refresh.service.d.ts +27 -1
- package/dist/core/auth/services/token-refresh.service.js +6 -6
- package/dist/core/auth/token-delivery.d.ts +47 -0
- package/dist/core/auth/token-delivery.js +14 -0
- package/dist/core/auth/types/index.d.ts +38 -4
- package/dist/core/auth/types/index.js +1 -1
- package/dist/core/cache/cache-config.js +5 -5
- package/dist/core/cache/cache-defaults.js +1 -1
- package/dist/core/cache/cache-env.d.ts +3 -3
- package/dist/core/cache/cache-env.js +4 -4
- package/dist/core/cache/cache-factory.d.ts +6 -6
- package/dist/core/cache/cache-factory.js +12 -12
- package/dist/core/cache/cache-invalidation.d.ts +4 -4
- package/dist/core/cache/cache-invalidation.js +13 -13
- package/dist/core/cache/cache-redis.js +6 -6
- package/dist/core/cache/cache-types.js +1 -1
- package/dist/core/cache/cache-wrapper.d.ts +1 -1
- package/dist/core/cache/cache-wrapper.js +13 -13
- package/dist/core/cache/cache.d.ts +2 -2
- package/dist/core/cache/cache.js +25 -25
- package/dist/core/cache/config.js +3 -3
- package/dist/core/cache/hybrid-cache-manager.d.ts +1 -1
- package/dist/core/cache/hybrid-cache-manager.js +8 -8
- package/dist/core/cache/index.d.ts +15 -15
- package/dist/core/cache/index.js +25 -25
- package/dist/core/cache/inmemory-cache-manager.d.ts +1 -1
- package/dist/core/cache/inmemory-cache-manager.js +3 -3
- package/dist/core/cache/noop-cache-manager.d.ts +1 -1
- package/dist/core/cache/noop-cache-manager.js +6 -6
- package/dist/core/cache/redis-cache-manager.d.ts +2 -2
- package/dist/core/cache/redis-cache-manager.js +7 -7
- package/dist/core/config/common.js +1 -1
- package/dist/core/config/errors.js +1 -1
- package/dist/core/config/registry.d.ts +7 -7
- package/dist/core/config/registry.js +1 -1
- package/dist/core/config/warn.js +1 -1
- package/dist/core/constants/error-codes.js +1 -1
- package/dist/core/constants/index.d.ts +5 -5
- package/dist/core/constants/index.js +17 -15
- package/dist/core/constants/messages.js +1 -1
- package/dist/core/constants/pagination.js +1 -1
- package/dist/core/constants/security.d.ts +15 -0
- package/dist/core/constants/security.js +4 -2
- package/dist/core/constants/validation.js +1 -1
- package/dist/core/cors/index.js +1 -1
- package/dist/core/error/app-error.d.ts +2 -2
- package/dist/core/error/app-error.js +1 -1
- package/dist/core/error/extract-error-info.js +1 -1
- package/dist/core/error/friendly-messages-v2.d.ts +3 -3
- package/dist/core/error/friendly-messages-v2.js +4 -4
- package/dist/core/error/friendly-messages.js +1 -1
- package/dist/core/error/index.d.ts +6 -6
- package/dist/core/error/index.js +7 -7
- package/dist/core/error/messages/en.d.ts +1 -1
- package/dist/core/error/messages/en.js +1 -1
- package/dist/core/error/messages/index.d.ts +2 -2
- package/dist/core/error/messages/index.js +3 -3
- package/dist/core/error/messages/ko.d.ts +1 -1
- package/dist/core/error/messages/ko.js +1 -1
- package/dist/core/geolocation/batch-processor.d.ts +1 -1
- package/dist/core/geolocation/batch-processor.js +3 -3
- package/dist/core/geolocation/config.js +1 -1
- package/dist/core/geolocation/index.d.ts +5 -5
- package/dist/core/geolocation/index.js +3 -3
- package/dist/core/geolocation/providers/base-provider.d.ts +2 -2
- package/dist/core/geolocation/providers/base-provider.js +1 -1
- package/dist/core/geolocation/providers/index.d.ts +6 -6
- package/dist/core/geolocation/providers/index.js +1 -1
- package/dist/core/geolocation/providers/ip-api-provider.d.ts +3 -3
- package/dist/core/geolocation/providers/ip-api-provider.js +1 -1
- package/dist/core/geolocation/providers/ipapi-co-provider.d.ts +3 -3
- package/dist/core/geolocation/providers/ipapi-co-provider.js +1 -1
- package/dist/core/geolocation/providers/ipgeolocation-provider.d.ts +3 -3
- package/dist/core/geolocation/providers/ipgeolocation-provider.js +1 -1
- package/dist/core/geolocation/providers/maxmind-provider.d.ts +3 -3
- package/dist/core/geolocation/providers/maxmind-provider.js +1 -1
- package/dist/core/logger/config.js +1 -1
- package/dist/core/logger/logger.js +2 -2
- package/dist/core/storage/config.js +1 -1
- package/dist/core/storage/r2-storage.js +2 -2
- package/dist/core/system/cpu.d.ts +1 -1
- package/dist/core/system/cpu.js +4 -4
- package/dist/core/system/disk.d.ts +1 -1
- package/dist/core/system/disk.js +4 -4
- package/dist/core/system/environment.d.ts +1 -1
- package/dist/core/system/environment.js +8 -8
- package/dist/core/system/health-check.d.ts +2 -2
- package/dist/core/system/health-check.js +6 -6
- package/dist/core/system/index.d.ts +7 -7
- package/dist/core/system/index.js +16 -16
- package/dist/core/system/memory.d.ts +1 -1
- package/dist/core/system/memory.js +4 -4
- package/dist/core/system/network.d.ts +1 -1
- package/dist/core/system/network.js +4 -4
- package/dist/core/system/utils.js +3 -3
- package/dist/core/types/geoip.d.ts +1 -1
- package/dist/core/types/qr-code.js +1 -1
- package/dist/core/utils/error-message-formatter.js +1 -1
- package/dist/core/utils/format-number.js +1 -1
- package/dist/core/utils/index.d.ts +3 -3
- package/dist/core/utils/index.js +2 -2
- package/dist/core/utils/input-validation.js +52 -16
- package/dist/core/utils/ip-utils.js +1 -1
- package/dist/core/utils/optimistic-lock.js +1 -1
- package/dist/core/utils/sanitizer.js +2 -2
- package/dist/core/utils/short-code-generator.js +1 -1
- package/dist/core/utils/timezone.js +121 -14
- package/dist/core/utils/type-guards.js +1 -1
- package/dist/core/utils/url-normalizer.js +1 -1
- package/dist/core/validators/index.d.ts +1 -1
- package/dist/core/validators/index.js +2 -2
- package/dist/core/validators/password-validator.d.ts +3 -3
- package/dist/core/validators/password-validator.js +2 -2
- package/dist/initialize.d.ts +10 -10
- package/dist/initialize.js +9 -9
- package/dist/next/auth-handlers/forgot-password.handler.d.ts +1 -1
- package/dist/next/auth-handlers/forgot-password.handler.js +4 -4
- package/dist/next/auth-handlers/index.d.ts +11 -11
- package/dist/next/auth-handlers/index.js +28 -27
- package/dist/next/auth-handlers/login.handler.d.ts +1 -1
- package/dist/next/auth-handlers/login.handler.js +7 -6
- package/dist/next/auth-handlers/logout.handler.d.ts +1 -1
- package/dist/next/auth-handlers/logout.handler.js +5 -5
- package/dist/next/auth-handlers/me.handler.d.ts +1 -1
- package/dist/next/auth-handlers/me.handler.js +7 -6
- package/dist/next/auth-handlers/oauth-authorize.handler.d.ts +1 -1
- package/dist/next/auth-handlers/oauth-authorize.handler.js +4 -4
- package/dist/next/auth-handlers/oauth-callback.handler.d.ts +1 -1
- package/dist/next/auth-handlers/oauth-callback.handler.js +9 -9
- package/dist/next/auth-handlers/refresh.handler.d.ts +1 -1
- package/dist/next/auth-handlers/refresh.handler.js +8 -7
- package/dist/next/auth-handlers/register.handler.d.ts +1 -1
- package/dist/next/auth-handlers/register.handler.js +4 -4
- package/dist/next/auth-handlers/reset-password.handler.d.ts +1 -1
- package/dist/next/auth-handlers/reset-password.handler.js +4 -4
- package/dist/next/auth-handlers/verify-email.handler.d.ts +1 -1
- package/dist/next/auth-handlers/verify-email.handler.js +4 -4
- package/dist/next/auth-types/handler-types.d.ts +5 -1
- package/dist/next/auth-types/handler-types.js +13 -1
- package/dist/next/auth-types/index.d.ts +1 -1
- package/dist/next/auth-types/index.js +13 -1
- package/dist/next/error/error-handler.js +5 -5
- package/dist/next/error/index.d.ts +3 -3
- package/dist/next/error/index.js +9 -9
- package/dist/next/error/locale-detector.d.ts +1 -1
- package/dist/next/error/locale-detector.js +1 -1
- package/dist/next/middleware/auth.d.ts +3 -3
- package/dist/next/middleware/auth.js +10 -9
- package/dist/next/middleware/cors.d.ts +2 -2
- package/dist/next/middleware/cors.js +3 -3
- package/dist/next/middleware/error-handler.d.ts +1 -1
- package/dist/next/middleware/error-handler.js +9 -9
- package/dist/next/middleware/index.d.ts +11 -11
- package/dist/next/middleware/index.js +23 -22
- package/dist/next/middleware/init-request.d.ts +1 -1
- package/dist/next/middleware/init-request.js +1 -1
- package/dist/next/middleware/middleware-chain.d.ts +1 -1
- package/dist/next/middleware/middleware-chain.js +3 -3
- package/dist/next/middleware/rate-limit.d.ts +2 -2
- package/dist/next/middleware/rate-limit.js +4 -4
- package/dist/next/middleware/response-logger.d.ts +1 -1
- package/dist/next/middleware/response-logger.js +3 -3
- package/dist/next/middleware/security.d.ts +1 -1
- package/dist/next/middleware/security.js +3 -3
- package/dist/next/middleware/types.d.ts +6 -3
- package/dist/next/middleware/wrappers.d.ts +2 -2
- package/dist/next/middleware/wrappers.js +21 -20
- package/dist/next/utils/api-helpers.d.ts +6 -2
- package/dist/next/utils/api-helpers.js +3 -2
- package/dist/next/utils/cors.js +2 -2
- package/dist/next/utils/csv-export-format.d.ts +11 -0
- package/dist/next/utils/csv-export-format.js +15 -0
- package/dist/next/utils/csv-export.d.ts +0 -2
- package/dist/next/utils/csv-export.js +3 -3
- package/dist/next/utils/error-processor.d.ts +1 -1
- package/dist/next/utils/error-processor.js +4 -4
- package/dist/next/utils/index.d.ts +5 -5
- package/dist/next/utils/index.js +21 -20
- package/dist/prisma/auth-adapter/index.d.ts +1 -1
- package/dist/prisma/auth-adapter/index.js +1 -1
- package/package.json +95 -51
- package/dist/chunk-2P4N4OK2.js +0 -150
- package/dist/chunk-4IQWQSEV.js +0 -27
- package/dist/chunk-4K76HG4V.js +0 -34
- package/dist/chunk-7EXSMZ2O.js +0 -29
- package/dist/chunk-7VXRBTRF.js +0 -110
- package/dist/chunk-ARXUKGZI.js +0 -58
- package/dist/chunk-B5OH43PR.js +0 -31
- package/dist/chunk-BW4QO7T6.js +0 -56
- package/dist/chunk-C6WH7RF5.js +0 -117
- package/dist/chunk-EK4TL7VW.js +0 -22
- package/dist/chunk-GPOSTBDQ.js +0 -193
- package/dist/chunk-IRUFNC4L.js +0 -26
- package/dist/chunk-J2MAXMIP.js +0 -105
- package/dist/chunk-MFMQO6IS.js +0 -127
- package/dist/chunk-NIWVKN6A.js +0 -81
- package/dist/chunk-OO2XOASJ.js +0 -240
- package/dist/chunk-PBQGXOVX.js +0 -31
- package/dist/chunk-STMAKLLG.js +0 -24
- package/dist/chunk-WP233RH2.js +0 -80
- package/dist/chunk-WWOYFWFB.js +0 -137
- package/dist/chunk-X7FGBUA4.js +0 -117
- package/dist/chunk-YSPIFSDI.js +0 -136
- package/dist/react/components/ui/Alert.d.ts +0 -12
- package/dist/react/components/ui/Alert.js +0 -10
- package/dist/react/components/ui/Badge.d.ts +0 -7
- package/dist/react/components/ui/Badge.js +0 -8
- package/dist/react/components/ui/Button.d.ts +0 -7
- package/dist/react/components/ui/Button.js +0 -8
- package/dist/react/components/ui/DataTable.d.ts +0 -8
- package/dist/react/components/ui/DataTable.js +0 -22
- package/dist/react/components/ui/DomainDisplay.d.ts +0 -12
- package/dist/react/components/ui/DomainDisplay.js +0 -31
- package/dist/react/components/ui/Input.d.ts +0 -5
- package/dist/react/components/ui/Input.js +0 -8
- package/dist/react/components/ui/Label.d.ts +0 -5
- package/dist/react/components/ui/Label.js +0 -8
- package/dist/react/components/ui/Pagination.d.ts +0 -42
- package/dist/react/components/ui/Pagination.js +0 -20
- package/dist/react/components/ui/Select.d.ts +0 -15
- package/dist/react/components/ui/Select.js +0 -27
- package/dist/react/components/ui/Skeleton.d.ts +0 -6
- package/dist/react/components/ui/Skeleton.js +0 -8
- package/dist/react/components/ui/TimezoneDisplay.d.ts +0 -22
- package/dist/react/components/ui/TimezoneDisplay.js +0 -83
- package/dist/react/components/ui/Tooltip.d.ts +0 -21
- package/dist/react/components/ui/Tooltip.js +0 -94
- package/dist/react/components/ui/data-table/DataTable.d.ts +0 -2
- package/dist/react/components/ui/data-table/DataTable.js +0 -22
- package/dist/react/components/ui/data-table/DataTableBody.d.ts +0 -19
- package/dist/react/components/ui/data-table/DataTableBody.js +0 -10
- package/dist/react/components/ui/data-table/DataTableBulkActions.d.ts +0 -17
- package/dist/react/components/ui/data-table/DataTableBulkActions.js +0 -12
- package/dist/react/components/ui/data-table/DataTableFilters.d.ts +0 -15
- package/dist/react/components/ui/data-table/DataTableFilters.js +0 -13
- package/dist/react/components/ui/data-table/DataTablePagination.d.ts +0 -10
- package/dist/react/components/ui/data-table/DataTablePagination.js +0 -11
- package/dist/react/components/ui/data-table/DataTableSearch.d.ts +0 -24
- package/dist/react/components/ui/data-table/DataTableSearch.js +0 -12
- package/dist/react/components/ui/data-table/index.d.ts +0 -13
- package/dist/react/components/ui/data-table/index.js +0 -42
- package/dist/react/components/ui/data-table/types.d.ts +0 -120
- package/dist/react/components/ui/data-table/types.js +0 -9
- package/dist/react/components/ui/loading-bar.d.ts +0 -20
- package/dist/react/components/ui/loading-bar.js +0 -15
- package/dist/react/error/error-display.d.ts +0 -48
- package/dist/react/error/error-display.js +0 -30
- package/dist/react/error/index.d.ts +0 -6
- package/dist/react/error/index.js +0 -30
- package/dist/react/hooks/useDataTable.d.ts +0 -96
- package/dist/react/hooks/useDataTable.js +0 -151
- package/dist/react/hooks/useDebounce.d.ts +0 -7
- package/dist/react/hooks/useDebounce.js +0 -7
- package/dist/react/hooks/useExitIntent.d.ts +0 -35
- package/dist/react/hooks/useExitIntent.js +0 -72
- package/dist/react/hooks/useTimezone.d.ts +0 -19
- package/dist/react/hooks/useTimezone.js +0 -11
- package/dist/react/utils/client-utils.d.ts +0 -3
- package/dist/react/utils/client-utils.js +0 -9
- package/dist/react/utils/qr-code.d.ts +0 -16
- package/dist/react/utils/qr-code.js +0 -215
- package/dist/{chunk-7PEVOMBO.js → chunk-AOWUPAPS.js} +0 -0
- package/dist/{chunk-V3GEYUBG.js → chunk-ER6LSA4M.js} +3 -3
- package/dist/{chunk-7WG7XPXC.js → chunk-KKZCNF6U.js} +3 -3
- /package/dist/{chunk-M22Z2NO6.js → core/auth/services/refresh-token-store.js} +0 -0
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
errorHandlerMiddleware
|
|
3
|
-
} from "./chunk-HKW4JA45.js";
|
|
4
1
|
import {
|
|
5
2
|
initRequestMiddleware
|
|
6
3
|
} from "./chunk-VC2E6KYQ.js";
|
|
7
4
|
import {
|
|
8
5
|
MiddlewareChain
|
|
9
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WXOWI7BJ.js";
|
|
10
7
|
import {
|
|
11
8
|
rateLimitMiddleware
|
|
12
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TRGFXIEF.js";
|
|
13
10
|
import {
|
|
14
11
|
responseLoggerMiddleware
|
|
15
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-LCYDMYZS.js";
|
|
16
13
|
import {
|
|
17
14
|
securityMiddleware
|
|
18
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-Y4WPEIKW.js";
|
|
19
16
|
import {
|
|
20
17
|
adminMiddleware,
|
|
21
18
|
authMiddleware,
|
|
22
19
|
optionalAuthMiddleware
|
|
23
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-XKIBJJA3.js";
|
|
24
21
|
import {
|
|
25
22
|
corsMiddleware
|
|
26
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-UWOWKOOQ.js";
|
|
24
|
+
import {
|
|
25
|
+
errorHandlerMiddleware
|
|
26
|
+
} from "./chunk-BRBOGLFT.js";
|
|
27
27
|
|
|
28
28
|
// src/next/middleware/wrappers.ts
|
|
29
29
|
function withPublicApi(handler) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TokenGenerator
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZZABL54F.js";
|
|
4
4
|
import {
|
|
5
5
|
AuthError
|
|
6
6
|
} from "./chunk-5GWGARXI.js";
|
|
@@ -20,12 +20,13 @@ var EmailVerificationService = class {
|
|
|
20
20
|
} };
|
|
21
21
|
}
|
|
22
22
|
async verify(email, token) {
|
|
23
|
-
const
|
|
23
|
+
const hashedToken = TokenGenerator.hash(token);
|
|
24
|
+
const tokenRecord = await this.tokenRepo.findByEmailAndToken(email, hashedToken, "EMAIL_VERIFICATION" /* EMAIL_VERIFICATION */);
|
|
24
25
|
if (!tokenRecord || tokenRecord.expires < /* @__PURE__ */ new Date()) {
|
|
25
26
|
throw new AuthError("Invalid or expired verification token", "TOKEN_INVALID", 400);
|
|
26
27
|
}
|
|
27
28
|
await this.userRepo.verifyEmail(email);
|
|
28
|
-
await this.tokenRepo.delete(email,
|
|
29
|
+
await this.tokenRepo.delete(email, hashedToken, "EMAIL_VERIFICATION" /* EMAIL_VERIFICATION */);
|
|
29
30
|
this.logger.info("Email verified", { email });
|
|
30
31
|
}
|
|
31
32
|
async resend(email) {
|
|
@@ -38,7 +39,7 @@ var EmailVerificationService = class {
|
|
|
38
39
|
}
|
|
39
40
|
const token = TokenGenerator.generate();
|
|
40
41
|
const expires = new Date(Date.now() + this.tokenExpiryHours * 60 * 60 * 1e3);
|
|
41
|
-
await this.tokenRepo.create(email, token, "EMAIL_VERIFICATION" /* EMAIL_VERIFICATION */, expires);
|
|
42
|
+
await this.tokenRepo.create(email, TokenGenerator.hash(token), "EMAIL_VERIFICATION" /* EMAIL_VERIFICATION */, expires);
|
|
42
43
|
await this.emailSender.sendVerificationEmail(email, token);
|
|
43
44
|
this.logger.info("Verification email resent", { email });
|
|
44
45
|
}
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
formatBytesPerSec,
|
|
4
4
|
runCommand,
|
|
5
5
|
runMacCommand
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KWUOLKDO.js";
|
|
7
7
|
import {
|
|
8
8
|
logger
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QAIN3WNN.js";
|
|
10
10
|
|
|
11
11
|
// src/core/system/network.ts
|
|
12
12
|
async function getNetworkInfo() {
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import {
|
|
2
|
+
JWTService
|
|
3
|
+
} from "./chunk-LWHLB2Y6.js";
|
|
4
|
+
import {
|
|
5
|
+
AuthError
|
|
6
|
+
} from "./chunk-5GWGARXI.js";
|
|
7
|
+
import {
|
|
8
|
+
JWT_DEFAULTS,
|
|
9
|
+
ROLE_DEFAULTS
|
|
10
|
+
} from "./chunk-7YWUKMZD.js";
|
|
11
|
+
|
|
12
|
+
// src/core/auth/services/token-refresh.service.ts
|
|
13
|
+
import { randomUUID } from "crypto";
|
|
14
|
+
var TokenRefreshService = class {
|
|
15
|
+
constructor(config) {
|
|
16
|
+
var _a, _b, _c;
|
|
17
|
+
this.userRepo = config.userRepository;
|
|
18
|
+
this.jwtService = new JWTService({
|
|
19
|
+
secret: config.jwtSecret,
|
|
20
|
+
accessTokenExpiry: (_a = config.accessTokenExpiry) != null ? _a : JWT_DEFAULTS.DEFAULT_ACCESS_TOKEN_EXPIRES,
|
|
21
|
+
refreshTokenExpiry: (_b = config.refreshTokenExpiry) != null ? _b : JWT_DEFAULTS.DEFAULT_REFRESH_TOKEN_EXPIRES,
|
|
22
|
+
algorithm: JWT_DEFAULTS.ALGORITHM
|
|
23
|
+
}, config.logger);
|
|
24
|
+
this.isTokenBlacklisted = config.isTokenBlacklisted;
|
|
25
|
+
this.store = config.refreshTokenStore;
|
|
26
|
+
this.logger = (_c = config.logger) != null ? _c : { debug() {
|
|
27
|
+
}, info() {
|
|
28
|
+
}, warn() {
|
|
29
|
+
}, error() {
|
|
30
|
+
} };
|
|
31
|
+
}
|
|
32
|
+
async refresh(refreshToken) {
|
|
33
|
+
var _a, _b, _c;
|
|
34
|
+
if (this.isTokenBlacklisted) {
|
|
35
|
+
const blacklisted = await this.isTokenBlacklisted(refreshToken);
|
|
36
|
+
if (blacklisted) {
|
|
37
|
+
throw new AuthError("Token has been revoked", "TOKEN_REVOKED", 401);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const { userId, jti, familyId } = await this.jwtService.verifyRefreshToken(refreshToken);
|
|
41
|
+
if (this.store) {
|
|
42
|
+
if (familyId && await this.store.isFamilyRevoked(familyId)) {
|
|
43
|
+
throw new AuthError("Token has been revoked", "TOKEN_REVOKED", 401);
|
|
44
|
+
}
|
|
45
|
+
if (jti && await this.store.isUsed(jti)) {
|
|
46
|
+
if (familyId) await this.store.revokeFamily(familyId);
|
|
47
|
+
this.logger.warn("Refresh token reuse detected", { userId, jti, familyId });
|
|
48
|
+
throw new AuthError("Refresh token reuse detected", "TOKEN_REUSE_DETECTED", 401);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const user = await this.userRepo.findById(userId);
|
|
52
|
+
if (!user) {
|
|
53
|
+
throw new AuthError("User not found", "USER_NOT_FOUND", 401);
|
|
54
|
+
}
|
|
55
|
+
if (user.isActive === false) {
|
|
56
|
+
throw new AuthError("Account is disabled", "ACCOUNT_DISABLED", 403);
|
|
57
|
+
}
|
|
58
|
+
const role = (_a = user.role) != null ? _a : ROLE_DEFAULTS.DEFAULT_ROLE;
|
|
59
|
+
const accessToken = await this.jwtService.createAccessToken({
|
|
60
|
+
id: user.id,
|
|
61
|
+
userId: user.id,
|
|
62
|
+
email: user.email,
|
|
63
|
+
role,
|
|
64
|
+
emailVerified: user.emailVerified
|
|
65
|
+
});
|
|
66
|
+
if (!this.store) {
|
|
67
|
+
return { accessToken, user: { id: user.id, email: user.email, role } };
|
|
68
|
+
}
|
|
69
|
+
const family = familyId != null ? familyId : randomUUID();
|
|
70
|
+
if (jti) {
|
|
71
|
+
await this.store.markUsed(jti, { familyId: family, userId });
|
|
72
|
+
}
|
|
73
|
+
const newJti = randomUUID();
|
|
74
|
+
const newRefreshToken = await this.jwtService.createRefreshToken(userId, {
|
|
75
|
+
jti: newJti,
|
|
76
|
+
familyId: family
|
|
77
|
+
});
|
|
78
|
+
await ((_c = (_b = this.store).register) == null ? void 0 : _c.call(_b, { jti: newJti, familyId: family, userId }));
|
|
79
|
+
return { accessToken, refreshToken: newRefreshToken, user: { id: user.id, email: user.email, role } };
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* family 전체를 즉시 무효화한다 (stateful 로그아웃 / 탈취 대응).
|
|
83
|
+
* store 미주입 시 동작하지 않는다.
|
|
84
|
+
*/
|
|
85
|
+
async revokeFamily(familyId) {
|
|
86
|
+
if (!this.store) {
|
|
87
|
+
throw new AuthError("Refresh token store is not configured", "STORE_NOT_CONFIGURED", 500);
|
|
88
|
+
}
|
|
89
|
+
await this.store.revokeFamily(familyId);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* refresh 토큰을 검증해 그 family 를 무효화한다 (로그아웃 핸들러용).
|
|
93
|
+
* 토큰에 familyId 가 없으면(레거시) 무효화할 family 가 없으므로 무시한다.
|
|
94
|
+
*/
|
|
95
|
+
async revokeByToken(refreshToken) {
|
|
96
|
+
if (!this.store) {
|
|
97
|
+
throw new AuthError("Refresh token store is not configured", "STORE_NOT_CONFIGURED", 500);
|
|
98
|
+
}
|
|
99
|
+
const { familyId } = await this.jwtService.verifyRefreshToken(refreshToken);
|
|
100
|
+
if (familyId) await this.store.revokeFamily(familyId);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export {
|
|
105
|
+
TokenRefreshService
|
|
106
|
+
};
|
|
@@ -2,17 +2,23 @@ import {
|
|
|
2
2
|
AppError
|
|
3
3
|
} from "./chunk-ATAQRXTH.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
ERROR_CODES
|
|
6
|
+
} from "./chunk-XQIAXMRY.js";
|
|
7
7
|
import {
|
|
8
8
|
JWTManager
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-LWHLB2Y6.js";
|
|
10
|
+
import {
|
|
11
|
+
getTokenDeliveryStrategy
|
|
12
|
+
} from "./chunk-63EKUOJH.js";
|
|
10
13
|
import {
|
|
11
14
|
getAuthConfig
|
|
12
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-N3TCQ5BF.js";
|
|
13
16
|
import {
|
|
14
|
-
|
|
15
|
-
} from "./chunk-
|
|
17
|
+
ROLE_DEFAULTS
|
|
18
|
+
} from "./chunk-7YWUKMZD.js";
|
|
19
|
+
import {
|
|
20
|
+
logger
|
|
21
|
+
} from "./chunk-QAIN3WNN.js";
|
|
16
22
|
|
|
17
23
|
// src/next/middleware/auth.ts
|
|
18
24
|
function setAccessTokenBlacklistChecker(checker) {
|
|
@@ -71,8 +77,14 @@ function initializeAuthMiddleware() {
|
|
|
71
77
|
const jwtManager = getJWTManager();
|
|
72
78
|
return jwtManager !== null;
|
|
73
79
|
}
|
|
80
|
+
function extractRequestToken(context, jwtManager) {
|
|
81
|
+
return getTokenDeliveryStrategy().extractAccessToken(
|
|
82
|
+
context.request,
|
|
83
|
+
(header) => jwtManager.extractTokenFromHeader(header)
|
|
84
|
+
);
|
|
85
|
+
}
|
|
74
86
|
var authMiddleware = async (context, next) => {
|
|
75
|
-
var _a, _b, _c
|
|
87
|
+
var _a, _b, _c;
|
|
76
88
|
try {
|
|
77
89
|
const jwtManager = getJWTManager();
|
|
78
90
|
if (!jwtManager) {
|
|
@@ -84,11 +96,7 @@ var authMiddleware = async (context, next) => {
|
|
|
84
96
|
"Authentication not configured. Contact administrator."
|
|
85
97
|
);
|
|
86
98
|
}
|
|
87
|
-
|
|
88
|
-
if (!token) {
|
|
89
|
-
const authHeader = context.request.headers.get("authorization");
|
|
90
|
-
token = jwtManager.extractTokenFromHeader(authHeader);
|
|
91
|
-
}
|
|
99
|
+
const token = extractRequestToken(context, jwtManager);
|
|
92
100
|
if (!token) {
|
|
93
101
|
throw new AppError(ERROR_CODES.UNAUTHORIZED.code);
|
|
94
102
|
}
|
|
@@ -108,16 +116,16 @@ var authMiddleware = async (context, next) => {
|
|
|
108
116
|
const payload = await jwtManager.verifyAccessToken(token);
|
|
109
117
|
context.user = {
|
|
110
118
|
id: payload.userId,
|
|
111
|
-
email: (
|
|
119
|
+
email: (_a = payload.email) != null ? _a : "",
|
|
112
120
|
name: void 0,
|
|
113
121
|
// 필요시 DB에서 조회
|
|
114
|
-
role: (
|
|
122
|
+
role: (_b = payload.role) != null ? _b : ROLE_DEFAULTS.DEFAULT_ROLE
|
|
115
123
|
};
|
|
116
124
|
} catch (error) {
|
|
117
125
|
if (error instanceof AppError) {
|
|
118
126
|
throw error;
|
|
119
127
|
}
|
|
120
|
-
if (error.code === "TOKEN_EXPIRED" || ((
|
|
128
|
+
if (error.code === "TOKEN_EXPIRED" || ((_c = error.message) == null ? void 0 : _c.includes("expired"))) {
|
|
121
129
|
throw new AppError(ERROR_CODES.TOKEN_EXPIRED.code, error.message);
|
|
122
130
|
}
|
|
123
131
|
throw new AppError(
|
|
@@ -128,15 +136,11 @@ var authMiddleware = async (context, next) => {
|
|
|
128
136
|
return await next();
|
|
129
137
|
};
|
|
130
138
|
var optionalAuthMiddleware = async (context, next) => {
|
|
131
|
-
var _a, _b
|
|
139
|
+
var _a, _b;
|
|
132
140
|
try {
|
|
133
141
|
const jwtManager = getJWTManager();
|
|
134
142
|
if (jwtManager) {
|
|
135
|
-
|
|
136
|
-
if (!token) {
|
|
137
|
-
const authHeader = context.request.headers.get("authorization");
|
|
138
|
-
token = jwtManager.extractTokenFromHeader(authHeader);
|
|
139
|
-
}
|
|
143
|
+
const token = extractRequestToken(context, jwtManager);
|
|
140
144
|
if (token) {
|
|
141
145
|
const tokenChecker = getAccessTokenChecker();
|
|
142
146
|
let isRevoked = false;
|
|
@@ -147,9 +151,9 @@ var optionalAuthMiddleware = async (context, next) => {
|
|
|
147
151
|
const payload = await jwtManager.verifyAccessToken(token);
|
|
148
152
|
context.user = {
|
|
149
153
|
id: payload.userId,
|
|
150
|
-
email: (
|
|
154
|
+
email: (_a = payload.email) != null ? _a : "",
|
|
151
155
|
name: void 0,
|
|
152
|
-
role: (
|
|
156
|
+
role: (_b = payload.role) != null ? _b : ROLE_DEFAULTS.DEFAULT_ROLE
|
|
153
157
|
};
|
|
154
158
|
}
|
|
155
159
|
}
|
|
@@ -169,7 +173,7 @@ function createRoleMiddleware(...allowedRoles) {
|
|
|
169
173
|
return await next();
|
|
170
174
|
};
|
|
171
175
|
}
|
|
172
|
-
var adminMiddleware = createRoleMiddleware(
|
|
176
|
+
var adminMiddleware = createRoleMiddleware(ROLE_DEFAULTS.ADMIN_ROLE);
|
|
173
177
|
|
|
174
178
|
export {
|
|
175
179
|
setAccessTokenBlacklistChecker,
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
JWTService
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LWHLB2Y6.js";
|
|
4
|
+
import {
|
|
5
|
+
getTokenDeliveryStrategy
|
|
6
|
+
} from "./chunk-63EKUOJH.js";
|
|
4
7
|
import {
|
|
5
8
|
JWT_DEFAULTS
|
|
6
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7YWUKMZD.js";
|
|
7
10
|
import {
|
|
8
11
|
__spreadValues
|
|
9
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-N3ETBM74.js";
|
|
10
13
|
|
|
11
14
|
// src/next/auth-handlers/me.handler.ts
|
|
12
15
|
import { NextResponse } from "next/server";
|
|
@@ -20,9 +23,11 @@ function createMeHandler(options) {
|
|
|
20
23
|
algorithm: JWT_DEFAULTS.ALGORITHM
|
|
21
24
|
});
|
|
22
25
|
return async (request) => {
|
|
23
|
-
var _a2, _b2, _c;
|
|
24
26
|
try {
|
|
25
|
-
const token = (
|
|
27
|
+
const token = getTokenDeliveryStrategy(options.tokenDelivery).extractAccessToken(
|
|
28
|
+
request,
|
|
29
|
+
(header) => jwtService.extractTokenFromHeader(header != null ? header : void 0)
|
|
30
|
+
);
|
|
26
31
|
if (!token) {
|
|
27
32
|
return NextResponse.json({ success: false, error: "Not authenticated" }, { status: 401 });
|
|
28
33
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
InMemoryCacheManager
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JHUWZ6YW.js";
|
|
4
4
|
import {
|
|
5
5
|
isRedisGloballyDisabled,
|
|
6
6
|
notifyRedisError
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZEHNCHIV.js";
|
|
8
8
|
import {
|
|
9
9
|
logger
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QAIN3WNN.js";
|
|
11
11
|
import {
|
|
12
12
|
getCacheFallbackConfig
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-HV6A6Z5R.js";
|
|
14
14
|
import {
|
|
15
15
|
__spreadValues
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-N3ETBM74.js";
|
|
17
17
|
|
|
18
18
|
// src/core/cache/hybrid-cache-manager.ts
|
|
19
19
|
function getDefaultHybridConfig() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TokenGenerator
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZZABL54F.js";
|
|
4
4
|
import {
|
|
5
5
|
AuthError
|
|
6
6
|
} from "./chunk-5GWGARXI.js";
|
|
@@ -38,7 +38,7 @@ var RegisterService = class {
|
|
|
38
38
|
if (this.emailVerificationRequired && this.emailSender) {
|
|
39
39
|
const token = TokenGenerator.generate();
|
|
40
40
|
const expires = new Date(Date.now() + 24 * 60 * 60 * 1e3);
|
|
41
|
-
await this.tokenRepo.create(input.email, token, "EMAIL_VERIFICATION" /* EMAIL_VERIFICATION */, expires);
|
|
41
|
+
await this.tokenRepo.create(input.email, TokenGenerator.hash(token), "EMAIL_VERIFICATION" /* EMAIL_VERIFICATION */, expires);
|
|
42
42
|
await this.emailSender.sendVerificationEmail(input.email, token);
|
|
43
43
|
verificationSent = true;
|
|
44
44
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
logger
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QAIN3WNN.js";
|
|
4
4
|
import {
|
|
5
5
|
getCacheFallbackConfig,
|
|
6
6
|
getConfig,
|
|
7
7
|
getEnv,
|
|
8
8
|
isCacheEnabled,
|
|
9
9
|
validateRedisEnvironment
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-HV6A6Z5R.js";
|
|
11
11
|
|
|
12
12
|
// src/core/cache/cache-redis.ts
|
|
13
13
|
import { Redis } from "@upstash/redis";
|
|
@@ -10,6 +10,19 @@ var TokenGenerator = class {
|
|
|
10
10
|
static generate(bytes = 32) {
|
|
11
11
|
return crypto.randomBytes(bytes).toString("hex");
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* 토큰의 SHA-256 해시 (저장용)
|
|
15
|
+
*
|
|
16
|
+
* 이메일/URL 로 전달되는 평문 토큰을 DB 에 그대로 저장하지 않기 위해 사용한다.
|
|
17
|
+
* 저장·조회 시 이 해시값으로 비교하면 DB 유출 시에도 토큰을 복원할 수 없다.
|
|
18
|
+
* (토큰 자체가 고엔트로피 랜덤이므로 salt 없이 단방향 해시로 충분하다.)
|
|
19
|
+
*
|
|
20
|
+
* @param token - 평문 토큰
|
|
21
|
+
* @returns 64글자 hex SHA-256 다이제스트
|
|
22
|
+
*/
|
|
23
|
+
static hash(token) {
|
|
24
|
+
return crypto.createHash("sha256").update(token).digest("hex");
|
|
25
|
+
}
|
|
13
26
|
/**
|
|
14
27
|
* URL-safe 토큰 생성 (Base64URL)
|
|
15
28
|
*
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
+
export type TokenDelivery = 'cookie' | 'header' | 'hybrid';
|
|
1
2
|
export interface AuthConfig {
|
|
2
3
|
jwtSecret: string;
|
|
3
4
|
accessTokenExpiry?: string;
|
|
4
5
|
refreshTokenExpiry?: string;
|
|
5
6
|
cookieSecure?: boolean;
|
|
7
|
+
tokenDelivery?: TokenDelivery;
|
|
6
8
|
}
|
|
7
9
|
export interface ResolvedAuthConfig {
|
|
8
10
|
jwtSecret: string;
|
|
9
11
|
accessTokenExpiry: string;
|
|
10
12
|
refreshTokenExpiry: string;
|
|
11
13
|
cookieSecure: boolean;
|
|
14
|
+
tokenDelivery: TokenDelivery;
|
|
12
15
|
}
|
|
13
16
|
export declare function initializeAuth(config: AuthConfig): void;
|
|
14
17
|
export declare function getAuthConfig(): ResolvedAuthConfig;
|
package/dist/core/auth/config.js
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
getAuthConfig,
|
|
3
3
|
initializeAuth,
|
|
4
4
|
resetAuth
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-N3TCQ5BF.js";
|
|
6
|
+
import "../../chunk-7YWUKMZD.js";
|
|
6
7
|
import "../../chunk-6J2EJVND.js";
|
|
7
8
|
import "../../chunk-F3R3UYBF.js";
|
|
8
|
-
import "../../chunk-
|
|
9
|
-
import "../../chunk-ORMEWXMH.js";
|
|
9
|
+
import "../../chunk-N3ETBM74.js";
|
|
10
10
|
export {
|
|
11
11
|
getAuthConfig,
|
|
12
12
|
initializeAuth,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { SmtpEmailSender } from '
|
|
2
|
-
export type { SmtpConfig, EmailTemplates } from '
|
|
3
|
-
export { TokenGenerator } from '
|
|
1
|
+
export { SmtpEmailSender } from '@withwiz/toolkit/core/auth/email/sender';
|
|
2
|
+
export type { SmtpConfig, EmailTemplates } from '@withwiz/toolkit/core/auth/email/sender';
|
|
3
|
+
export { TokenGenerator } from '@withwiz/toolkit/core/auth/email/token-generator';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SmtpEmailSender
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-ATBYGPLP.js";
|
|
4
4
|
import {
|
|
5
5
|
TokenGenerator
|
|
6
|
-
} from "../../../chunk-
|
|
7
|
-
import "../../../chunk-
|
|
6
|
+
} from "../../../chunk-ZZABL54F.js";
|
|
7
|
+
import "../../../chunk-N3ETBM74.js";
|
|
8
8
|
export {
|
|
9
9
|
SmtpEmailSender,
|
|
10
10
|
TokenGenerator
|
|
@@ -12,6 +12,17 @@ export declare class TokenGenerator {
|
|
|
12
12
|
* @returns 16진수 문자열 토큰
|
|
13
13
|
*/
|
|
14
14
|
static generate(bytes?: number): string;
|
|
15
|
+
/**
|
|
16
|
+
* 토큰의 SHA-256 해시 (저장용)
|
|
17
|
+
*
|
|
18
|
+
* 이메일/URL 로 전달되는 평문 토큰을 DB 에 그대로 저장하지 않기 위해 사용한다.
|
|
19
|
+
* 저장·조회 시 이 해시값으로 비교하면 DB 유출 시에도 토큰을 복원할 수 없다.
|
|
20
|
+
* (토큰 자체가 고엔트로피 랜덤이므로 salt 없이 단방향 해시로 충분하다.)
|
|
21
|
+
*
|
|
22
|
+
* @param token - 평문 토큰
|
|
23
|
+
* @returns 64글자 hex SHA-256 다이제스트
|
|
24
|
+
*/
|
|
25
|
+
static hash(token: string): string;
|
|
15
26
|
/**
|
|
16
27
|
* URL-safe 토큰 생성 (Base64URL)
|
|
17
28
|
*
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
* @version 1.0.0
|
|
8
8
|
* @description 범용 공유 라이브러리 - Tier 3
|
|
9
9
|
*/
|
|
10
|
-
export * from '
|
|
11
|
-
export * from '
|
|
12
|
-
export { JWTManager, JWTService } from '
|
|
13
|
-
export type { JWTConfig, JWTPayload, TokenPair } from '
|
|
14
|
-
export { JWTClientManager, getStoredTokens, storeTokens, clearStoredTokens, clearTokens, decodeJWTPayload, isTokenExpired, getTokenRemainingTime, extractUserFromToken, createAuthHeader, createApiHeaders, isTokenExpiringSoon, getTokenExpirationString, getTokenIssuedAtString, } from '
|
|
15
|
-
export { PasswordValidator, PasswordHasher, defaultPasswordSchema, strongPasswordSchema, } from '
|
|
16
|
-
export type { PasswordValidationResult, PasswordConfig } from '
|
|
17
|
-
export { DEFAULT_PASSWORD_CONFIG, createPasswordValidator, validatePassword, getPasswordStrength, createPasswordSchema, passwordValidator, createPasswordHasher, } from '
|
|
18
|
-
export { OAuthManager, GoogleOAuthProvider, GitHubOAuthProvider, KakaoOAuthProvider } from '
|
|
19
|
-
export { TokenGenerator } from '
|
|
20
|
-
export { PasswordStrength, OAUTH_PROVIDERS, TokenType } from '
|
|
10
|
+
export * from '@withwiz/toolkit/core/auth/types';
|
|
11
|
+
export * from '@withwiz/toolkit/core/auth/errors';
|
|
12
|
+
export { JWTManager, JWTService } from '@withwiz/toolkit/core/auth/jwt';
|
|
13
|
+
export type { JWTConfig, JWTPayload, TokenPair } from '@withwiz/toolkit/core/auth/types';
|
|
14
|
+
export { JWTClientManager, getStoredTokens, storeTokens, clearStoredTokens, clearTokens, decodeJWTPayload, isTokenExpired, getTokenRemainingTime, extractUserFromToken, createAuthHeader, createApiHeaders, isTokenExpiringSoon, getTokenExpirationString, getTokenIssuedAtString, } from '@withwiz/toolkit/core/auth/jwt/client';
|
|
15
|
+
export { PasswordValidator, PasswordHasher, defaultPasswordSchema, strongPasswordSchema, BcryptPasswordHasher, Argon2idPasswordHasher, MigratingPasswordHasher, } from '@withwiz/toolkit/core/auth/password';
|
|
16
|
+
export type { PasswordValidationResult, PasswordConfig, IPasswordHasher, BcryptHasherOptions, Argon2idHasherOptions, MigratingHasherOptions, } from '@withwiz/toolkit/core/auth/password';
|
|
17
|
+
export { DEFAULT_PASSWORD_CONFIG, createPasswordValidator, validatePassword, getPasswordStrength, createPasswordSchema, passwordValidator, createPasswordHasher, } from '@withwiz/toolkit/core/auth/password/client-helper';
|
|
18
|
+
export { OAuthManager, GoogleOAuthProvider, GitHubOAuthProvider, KakaoOAuthProvider } from '@withwiz/toolkit/core/auth/oauth';
|
|
19
|
+
export { TokenGenerator } from '@withwiz/toolkit/core/auth/email/token-generator';
|
|
20
|
+
export { PasswordStrength, OAUTH_PROVIDERS, TokenType } from '@withwiz/toolkit/core/auth/types';
|