@withwiz/toolkit 0.7.1 → 0.9.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 +226 -0
- package/README.md +66 -44
- package/dist/{chunk-V6YD53NH.js → chunk-23LQJYZN.js} +5 -2
- package/dist/chunk-2JUFL4KX.js +41 -0
- 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-MWBEE6VI.js → chunk-4EXZ2SDV.js} +5 -5
- package/dist/{chunk-MNYVAEXK.js → chunk-4ROIPF33.js} +16 -3
- package/dist/{chunk-JKSABDFT.js → chunk-4TGPAUJV.js} +4 -4
- package/dist/{chunk-D2KXIKI4.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-6A5JHOBB.js +134 -0
- package/dist/{chunk-N5VOFGF3.js → chunk-75UDFONR.js} +5 -4
- package/dist/{chunk-GORISA3L.js → chunk-7KIM5MHV.js} +1 -1
- package/dist/{chunk-4L6OSSSG.js → chunk-7S2PCYNT.js} +3 -3
- 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-W7PEL3DX.js → chunk-BRBOGLFT.js} +4 -4
- package/dist/{chunk-IOUNOHP7.js → chunk-BRFW2LL2.js} +1 -1
- package/dist/chunk-BTYH4MHU.js +118 -0
- package/dist/{chunk-I4NT6G2T.js → chunk-DRTJSTEV.js} +2 -2
- package/dist/{chunk-JIYLTMVL.js → chunk-DVCGAI5N.js} +2 -2
- package/dist/chunk-E4TKORMQ.js +59 -0
- package/dist/{chunk-AV7ELXHG.js → chunk-E5TDIRBJ.js} +2 -2
- package/dist/{chunk-UBASOMP5.js → chunk-HGVPZSWW.js} +18 -13
- package/dist/{chunk-7F5X6F7X.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-WIQAPWTY.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-KYAHURXN.js → chunk-N3TCQ5BF.js} +4 -3
- package/dist/{chunk-HX4MPCVV.js → chunk-NTZBMWB6.js} +4 -4
- package/dist/{chunk-RJGYONRO.js → chunk-PRPMEHRE.js} +2 -2
- package/dist/{chunk-KG65BFPK.js → chunk-QAIN3WNN.js} +1 -1
- package/dist/{chunk-JJAIVUVD.js → chunk-R7EFDSPZ.js} +2 -2
- package/dist/{chunk-VJE4HA2C.js → chunk-RWCPRPEP.js} +3 -2
- package/dist/{chunk-B6L5XV7O.js → chunk-SCAFDDJP.js} +11 -11
- package/dist/{chunk-KXYDTC4A.js → chunk-SNFPZD6L.js} +11 -2
- package/dist/{chunk-B5VRZ2VJ.js → chunk-TNDEYJEL.js} +25 -6
- package/dist/{chunk-GDTZMX3L.js → chunk-TRGFXIEF.js} +1 -1
- package/dist/{chunk-JRORMRVN.js → chunk-U2TGXJ3A.js} +1 -1
- package/dist/{chunk-VNDL2E44.js → chunk-U52U5SK7.js} +2 -2
- package/dist/{chunk-54REXMTE.js → chunk-UWOWKOOQ.js} +3 -1
- package/dist/{chunk-4PROUAZ5.js → chunk-V3WZFUY3.js} +7 -7
- package/dist/{chunk-G4LJN4OZ.js → chunk-VH57Y5Z4.js} +1 -1
- package/dist/chunk-VQJY52YF.js +139 -0
- 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-G4SNTXJ3.js → chunk-WSHRBK6Y.js} +7 -6
- package/dist/{chunk-UMRKMF3E.js → chunk-WXOWI7BJ.js} +2 -2
- package/dist/chunk-XAGPZLRK.js +106 -0
- package/dist/{chunk-VPRTPW7C.js → chunk-XF3WUF3F.js} +2 -2
- package/dist/{chunk-6TRD7ZW4.js → chunk-XKIBJJA3.js} +25 -21
- package/dist/{chunk-ZLYBY3R4.js → chunk-XTGS6JJB.js} +10 -5
- package/dist/{chunk-BFZR62LZ.js → chunk-XXPB4C37.js} +7 -7
- package/dist/{chunk-LUIYCIF7.js → chunk-Y4ME3Q5K.js} +2 -2
- package/dist/{chunk-Q66VOVGN.js → chunk-Y4WPEIKW.js} +1 -1
- package/dist/{chunk-MREY2W7N.js → chunk-Y6CPPBJI.js} +1 -1
- package/dist/{chunk-6TUDUOGC.js → chunk-ZEHNCHIV.js} +2 -2
- package/dist/{chunk-D73ZJQMX.js → chunk-ZZABL54F.js} +13 -0
- package/dist/core/auth/adapters/sql/dialect.d.ts +21 -0
- package/dist/core/auth/adapters/sql/dialect.js +11 -0
- package/dist/core/auth/adapters/sql/email-token-repository.d.ts +17 -0
- package/dist/core/auth/adapters/sql/email-token-repository.js +9 -0
- package/dist/core/auth/adapters/sql/index.d.ts +7 -0
- package/dist/core/auth/adapters/sql/index.js +27 -0
- package/dist/core/auth/adapters/sql/oauth-account-repository.d.ts +18 -0
- package/dist/core/auth/adapters/sql/oauth-account-repository.js +9 -0
- package/dist/core/auth/adapters/sql/types.d.ts +73 -0
- package/dist/core/auth/adapters/sql/types.js +7 -0
- package/dist/core/auth/adapters/sql/user-repository.d.ts +20 -0
- package/dist/core/auth/adapters/sql/user-repository.js +9 -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 +23 -15
- 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 +4 -4
- 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 +3 -3
- package/dist/core/cache/cache-factory.d.ts +6 -6
- package/dist/core/cache/cache-factory.js +11 -11
- package/dist/core/cache/cache-invalidation.d.ts +4 -4
- package/dist/core/cache/cache-invalidation.js +12 -12
- package/dist/core/cache/cache-redis.js +5 -5
- 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 +12 -12
- package/dist/core/cache/cache.d.ts +2 -2
- package/dist/core/cache/cache.js +17 -17
- package/dist/core/cache/config.js +2 -2
- package/dist/core/cache/hybrid-cache-manager.d.ts +1 -1
- package/dist/core/cache/hybrid-cache-manager.js +7 -7
- package/dist/core/cache/index.d.ts +15 -15
- package/dist/core/cache/index.js +17 -17
- 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 +5 -5
- package/dist/core/cache/redis-cache-manager.d.ts +2 -2
- package/dist/core/cache/redis-cache-manager.js +6 -6
- 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 +10 -8
- 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 +4 -4
- 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 +7 -7
- 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 +5 -5
- 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 +1 -1
- 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 +7 -7
- package/dist/core/system/health-check.d.ts +2 -2
- package/dist/core/system/health-check.js +5 -5
- package/dist/core/system/index.d.ts +7 -7
- package/dist/core/system/index.js +17 -17
- 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 +9 -9
- 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 +7 -7
- 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 +32 -31
- 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 +3 -3
- 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 +8 -7
- 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 +6 -6
- package/dist/next/middleware/index.d.ts +11 -11
- package/dist/next/middleware/index.js +19 -18
- 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 +3 -3
- 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 +18 -17
- 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.js +1 -1
- 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 +3 -3
- package/dist/next/utils/index.d.ts +5 -5
- package/dist/next/utils/index.js +28 -27
- package/dist/prisma/auth-adapter/index.d.ts +1 -1
- package/dist/prisma/auth-adapter/index.js +1 -1
- package/package.json +96 -52
- 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-EK4TL7VW.js +0 -22
- package/dist/chunk-ERKJJDY6.js +0 -117
- package/dist/chunk-G4GT4X3J.js +0 -240
- 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-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/chunk-ZCLKRGZ4.js +0 -81
- 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-VDRLJU6C.js → chunk-E2HYIONP.js} +3 -3
- package/dist/{chunk-7WG7XPXC.js → chunk-KKZCNF6U.js} +3 -3
- package/dist/{chunk-UQ3Z3ZAF.js → chunk-P7WHMKN5.js} +3 -3
- /package/dist/{chunk-M22Z2NO6.js → core/auth/services/refresh-token-store.js} +0 -0
package/README.ko.md
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
# @withwiz/toolkit
|
|
2
|
+
|
|
3
|
+
[English](README.md) | **한국어**
|
|
4
|
+
|
|
5
|
+
Shared utility library for [withwiz](https://github.com/greeun) projects — 인증, 캐싱, 에러 처리, 미들웨어, 지오로케이션, 로깅 등 프로덕션 수준의 모듈 모음.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Composition root** — 단일 `initialize()`로 모든 티어 설정을 한 번에 조립
|
|
10
|
+
- **Framework tiers** — `core` / `next` / `prisma` 3개 티어로 의존성 분리 (0.8+)
|
|
11
|
+
- **Auth** — JWT, password hashing, OAuth helpers (Google / GitHub / Kakao / Microsoft / Meta), state-cookie CSRF 바인딩, Prisma adapter
|
|
12
|
+
- **Cache** — Redis / in-memory / hybrid / noop 백엔드, factory, invalidation, defaults
|
|
13
|
+
- **Constants** — Error codes, messages, pagination, security constants
|
|
14
|
+
- **Error** — Typed `AppError`, framework-aware error handler (core · next)
|
|
15
|
+
- **Geolocation** — GeoIP lookup, batch processing, provider factory
|
|
16
|
+
- **Logger** — Winston-based structured logger with daily rotation
|
|
17
|
+
- **Middleware** — Auth, rate-limiting, CORS, security middleware wrappers (Next.js)
|
|
18
|
+
- **Storage** — Cloudflare R2 (AWS S3-compatible) storage
|
|
19
|
+
- **System** — Health check, system monitoring
|
|
20
|
+
- **Types** — Shared TypeScript types (API, DB, env, GeoIP, user, i18n, QR)
|
|
21
|
+
- **Utils** — Sanitizer, type-guards, CSV export, URL normalizer, timezone, IP utils, ...
|
|
22
|
+
- **Validators** — Password strength validator
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install @withwiz/toolkit
|
|
28
|
+
# or
|
|
29
|
+
pnpm add @withwiz/toolkit
|
|
30
|
+
# or
|
|
31
|
+
yarn add @withwiz/toolkit
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Peer dependencies (optional)
|
|
35
|
+
|
|
36
|
+
`next` / `react` / `react-dom` 은 **optional** peer입니다 — 사용하는 티어가 요구하는 peer만 설치하세요.
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# next 티어를 쓸 때
|
|
40
|
+
# (React 도 필요 — next/error/ErrorBoundary 가 React 컴포넌트)
|
|
41
|
+
npm install next react react-dom
|
|
42
|
+
|
|
43
|
+
# core 티어만 쓰는 백엔드 / CLI
|
|
44
|
+
# (별도 peer 설치 불필요)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
> **React 컴포넌트 분리 (0.8).** `react` 티어(UI 컴포넌트, hooks, `error-display`)는
|
|
48
|
+
> 독립 패키지 [`@withwiz/ui`](https://github.com/greeun) 로 추출되었습니다.
|
|
49
|
+
> `@withwiz/toolkit/react/*` → `@withwiz/ui/react/*` 로 import 경로를 치환하세요.
|
|
50
|
+
|
|
51
|
+
## Quick start
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
// Auth — JWT
|
|
55
|
+
import { signToken, verifyToken } from '@withwiz/toolkit/core/auth/jwt'
|
|
56
|
+
|
|
57
|
+
const token = await signToken({ userId: 'u_123' })
|
|
58
|
+
const payload = await verifyToken(token)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
// Cache — Redis wrapper
|
|
63
|
+
import { withCache } from '@withwiz/toolkit/core/cache'
|
|
64
|
+
|
|
65
|
+
const data = await withCache('my-key', async () => fetchData(), 3600)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
// Error — typed error class
|
|
70
|
+
import { AppError } from '@withwiz/toolkit/core/error'
|
|
71
|
+
|
|
72
|
+
throw new AppError('NOT_FOUND', 'Resource not found', 404)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
// Logger
|
|
77
|
+
import { logInfo, logError } from '@withwiz/toolkit/core/logger/logger'
|
|
78
|
+
|
|
79
|
+
logInfo('Server started', { port: 3000 })
|
|
80
|
+
logError('Something went wrong', { error })
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
// Geolocation
|
|
85
|
+
import { getGeoLocation } from '@withwiz/toolkit/core/geolocation'
|
|
86
|
+
|
|
87
|
+
const geo = await getGeoLocation('8.8.8.8')
|
|
88
|
+
// { country: 'US', city: 'Mountain View', ... }
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
```ts
|
|
92
|
+
// Utils
|
|
93
|
+
import { sanitizeInput } from '@withwiz/toolkit/core/utils/sanitizer'
|
|
94
|
+
import { formatNumber } from '@withwiz/toolkit/core/utils/format-number'
|
|
95
|
+
import { normalizeUrl } from '@withwiz/toolkit/core/utils/url-normalizer'
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### 토큰 전달 모드 (tokenDelivery)
|
|
99
|
+
|
|
100
|
+
인증 토큰 전달 방식을 초기화 시 선택할 수 있습니다. 기본값은 `'hybrid'`(쿠키 + 헤더 동시 지원, 기존 동작)입니다.
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
import { initialize } from '@withwiz/toolkit/initialize';
|
|
104
|
+
|
|
105
|
+
initialize({
|
|
106
|
+
auth: {
|
|
107
|
+
jwtSecret: process.env.JWT_SECRET!,
|
|
108
|
+
tokenDelivery: 'cookie', // 'cookie' | 'header' | 'hybrid' (기본)
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
핸들러별로 덮어쓸 수도 있습니다 (옵션 > 전역 > `'hybrid'` 순):
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
createAuthHandlers({ ...options, tokenDelivery: 'header' });
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
| 모드 | 토큰 위치 | 특징 |
|
|
120
|
+
|---|---|---|
|
|
121
|
+
| `cookie` | HttpOnly 쿠키 전용 | 응답 body 에서 토큰 제거 — XSS 노출 면 최소. 브라우저 앱 권장 |
|
|
122
|
+
| `header` | `Authorization: Bearer` + body | refresh 는 body `{ refreshToken }` 으로 전달. 클라이언트 저장소는 XSS 에 상대적으로 취약 — 비브라우저 클라이언트용 |
|
|
123
|
+
| `hybrid` | 둘 다 | 기존 동작. 쿠키 우선, 헤더/body 폴백 |
|
|
124
|
+
|
|
125
|
+
**제약**: OAuth callback 은 redirect 응답이라 모드와 무관하게 쿠키로만 토큰을 전달합니다. OAuth 를 쓰는 앱은 `'cookie'` 또는 `'hybrid'` 를 사용하세요.
|
|
126
|
+
|
|
127
|
+
## Module reference
|
|
128
|
+
|
|
129
|
+
0.7부터 모든 subpath는 프레임워크 의존성에 따라 티어로 분리됩니다
|
|
130
|
+
(0.8부터 `core` / `next` / `prisma` 3개 — `react` 티어는 `@withwiz/ui` 로 이동).
|
|
131
|
+
자세한 티어 모델·규칙·마이그레이션 매핑은 [`docs/FRAMEWORK_TIERS.md`](docs/FRAMEWORK_TIERS.md)
|
|
132
|
+
및 [`CHANGELOG.md`](CHANGELOG.md) 의 0.7.0 / 0.8.0 항목을 참조하세요.
|
|
133
|
+
|
|
134
|
+
### Composition root
|
|
135
|
+
|
|
136
|
+
| Subpath | Description |
|
|
137
|
+
|---|---|
|
|
138
|
+
| `/initialize` | 모든 티어 설정을 단일 객체로 조립하는 통합 진입점 |
|
|
139
|
+
|
|
140
|
+
### `core` — 프레임워크 독립 (pure TS)
|
|
141
|
+
|
|
142
|
+
| Subpath | Description |
|
|
143
|
+
|---|---|
|
|
144
|
+
| `/core/auth` | Full auth (JWT + password + OAuth + services + email + types) |
|
|
145
|
+
| `/core/auth/jwt` | JWT sign / verify |
|
|
146
|
+
| `/core/auth/password` | bcrypt helpers |
|
|
147
|
+
| `/core/auth/oauth` | OAuth utilities (Google / GitHub / Kakao / Microsoft / Meta) |
|
|
148
|
+
| `/core/auth/oauth/providers/{google,github,kakao,microsoft,meta}` | Individual OAuth providers |
|
|
149
|
+
| `/core/auth/services` | Login / token-refresh / oauth-callback services |
|
|
150
|
+
| `/core/auth/email` | Email token generation |
|
|
151
|
+
| `/core/auth/types` | Framework-independent auth types |
|
|
152
|
+
| `/core/cache` | Cache facade (get / set / delete / withCache) |
|
|
153
|
+
| `/core/cache/cache-factory` | Cache backend factory (Redis / in-memory / hybrid / noop) |
|
|
154
|
+
| `/core/cache/cache-invalidation` | Pattern-based cache invalidation |
|
|
155
|
+
| `/core/config` | Config registry |
|
|
156
|
+
| `/core/constants/{error-codes,messages,pagination,security}` | Shared constants |
|
|
157
|
+
| `/core/cors` | Framework-independent CORS config |
|
|
158
|
+
| `/core/error` | `AppError`, error codes, i18n messages, `extractErrorInfo` |
|
|
159
|
+
| `/core/geolocation` | GeoIP lookup, batch processor, provider factory |
|
|
160
|
+
| `/core/logger/logger` | Winston-based structured logger |
|
|
161
|
+
| `/core/storage` | Cloudflare R2 / S3-compatible storage |
|
|
162
|
+
| `/core/system` | Health check, system monitoring |
|
|
163
|
+
| `/core/types/{api,database,env,geoip,i18n,qr-code,user}` | Shared TypeScript types |
|
|
164
|
+
| `/core/utils` | `sanitizer`, `type-guards`, `format-number`, `ip-utils`, `timezone`, ... |
|
|
165
|
+
| `/core/validators` | Password strength validator |
|
|
166
|
+
|
|
167
|
+
### `next` — Next.js 의존
|
|
168
|
+
|
|
169
|
+
| Subpath | Description |
|
|
170
|
+
|---|---|
|
|
171
|
+
| `/next/middleware` | Auth · rate-limit · CORS · security · wrappers |
|
|
172
|
+
| `/next/auth-handlers` | Route handlers (login / refresh / oauth callback / me) |
|
|
173
|
+
| `/next/auth-types` | Handler types (`NextRequest` signatures) |
|
|
174
|
+
| `/next/error` | `error-handler` (NextResponse), `LocaleDetector`, `ErrorBoundary` |
|
|
175
|
+
| `/next/utils` | `api-helpers`, `cors`, `csv-export`, `error-processor` |
|
|
176
|
+
|
|
177
|
+
### `react` — `@withwiz/ui` 로 이동 (0.8)
|
|
178
|
+
|
|
179
|
+
React 티어(UI 컴포넌트, hooks, `error-display`, 브라우저 컨텍스트 utils)는 독립 패키지
|
|
180
|
+
[`@withwiz/ui`](https://github.com/greeun) 로 추출되었습니다.
|
|
181
|
+
import 경로 치환: `@withwiz/toolkit/react/*` → `@withwiz/ui/react/*`.
|
|
182
|
+
|
|
183
|
+
### `prisma` — Prisma 의존
|
|
184
|
+
|
|
185
|
+
| Subpath | Description |
|
|
186
|
+
|---|---|
|
|
187
|
+
| `/prisma/auth-adapter` | `UserRepository` / `OAuthAccountRepository` / `EmailTokenRepository` Prisma 구현체 |
|
|
188
|
+
|
|
189
|
+
## Requirements
|
|
190
|
+
|
|
191
|
+
- Node.js >= 18
|
|
192
|
+
- TypeScript >= 5
|
|
193
|
+
|
|
194
|
+
### Optional peers
|
|
195
|
+
|
|
196
|
+
`next` / `react` / `react-dom` 은 `optional` peer dependency입니다.
|
|
197
|
+
사용하는 티어가 요구하는 peer만 설치하세요:
|
|
198
|
+
|
|
199
|
+
- `core` 티어만 쓰는 백엔드 / CLI: peer 불필요
|
|
200
|
+
- `next` 티어: Next.js >= 15, 그리고 React >= 18 / React-DOM >= 18 (`next/error/ErrorBoundary` 가 React 컴포넌트)
|
|
201
|
+
- `prisma` 티어: Prisma 호환 클라이언트 (덕 타이핑)
|
|
202
|
+
- Prisma 어댑터의 `EmailTokenRepository` 등 일부 모듈: `date-fns >= 3` (optional)
|
|
203
|
+
- 이메일 전송: `nodemailer >= 6` (optional)
|
|
204
|
+
|
|
205
|
+
## Development
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
# Install dependencies
|
|
209
|
+
npm install
|
|
210
|
+
|
|
211
|
+
# Build
|
|
212
|
+
npm run build
|
|
213
|
+
|
|
214
|
+
# Run tests
|
|
215
|
+
npm test
|
|
216
|
+
|
|
217
|
+
# Watch mode
|
|
218
|
+
npm run test:watch
|
|
219
|
+
|
|
220
|
+
# Coverage
|
|
221
|
+
npm run test:coverage
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## License
|
|
225
|
+
|
|
226
|
+
MIT © [withwiz](https://github.com/greeun)
|
package/README.md
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
# @withwiz/toolkit
|
|
2
2
|
|
|
3
|
+
**English** | [한국어](README.ko.md)
|
|
4
|
+
|
|
3
5
|
Shared utility library for [withwiz](https://github.com/greeun) projects — a collection of production-ready modules for authentication, caching, error handling, middleware, geolocation, logging, and more.
|
|
4
6
|
|
|
5
7
|
## Features
|
|
6
8
|
|
|
7
|
-
- **Composition root** —
|
|
8
|
-
- **Framework tiers** — `core` / `next` / `
|
|
9
|
-
- **Auth** — JWT, password hashing, OAuth helpers (Google / GitHub / Kakao / Microsoft / Meta), state-cookie CSRF
|
|
10
|
-
- **Cache** — Redis / in-memory / hybrid / noop
|
|
9
|
+
- **Composition root** — assemble every tier's configuration at once with a single `initialize()`
|
|
10
|
+
- **Framework tiers** — dependencies split across three tiers: `core` / `next` / `prisma` (0.8+)
|
|
11
|
+
- **Auth** — JWT, password hashing, OAuth helpers (Google / GitHub / Kakao / Microsoft / Meta), state-cookie CSRF binding, Prisma adapter
|
|
12
|
+
- **Cache** — Redis / in-memory / hybrid / noop backends, factory, invalidation, defaults
|
|
11
13
|
- **Constants** — Error codes, messages, pagination, security constants
|
|
12
|
-
- **Error** — Typed `AppError`, framework-aware error handler
|
|
14
|
+
- **Error** — Typed `AppError`, framework-aware error handler (core · next)
|
|
13
15
|
- **Geolocation** — GeoIP lookup, batch processing, provider factory
|
|
14
|
-
- **Hooks** — `useDataTable`, `useDebounce`, `useExitIntent`, `useTimezone`
|
|
15
16
|
- **Logger** — Winston-based structured logger with daily rotation
|
|
16
17
|
- **Middleware** — Auth, rate-limiting, CORS, security middleware wrappers (Next.js)
|
|
17
18
|
- **Storage** — Cloudflare R2 (AWS S3-compatible) storage
|
|
@@ -32,19 +33,21 @@ yarn add @withwiz/toolkit
|
|
|
32
33
|
|
|
33
34
|
### Peer dependencies (optional)
|
|
34
35
|
|
|
35
|
-
`next` / `react` / `react-dom`
|
|
36
|
+
`next` / `react` / `react-dom` are **optional** peers — install only the peers required by the tiers you use.
|
|
36
37
|
|
|
37
38
|
```bash
|
|
38
|
-
#
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
# react 티어를 쓸 때
|
|
42
|
-
npm install react react-dom
|
|
39
|
+
# When using the next tier
|
|
40
|
+
# (React is also needed — next/error/ErrorBoundary is a React component)
|
|
41
|
+
npm install next react react-dom
|
|
43
42
|
|
|
44
|
-
#
|
|
45
|
-
# (
|
|
43
|
+
# Backend / CLI using only the core tier
|
|
44
|
+
# (no extra peers required)
|
|
46
45
|
```
|
|
47
46
|
|
|
47
|
+
> **React components moved out (0.8).** The `react` tier (UI components, hooks,
|
|
48
|
+
> `error-display`) was extracted to [`@withwiz/ui`](https://github.com/greeun).
|
|
49
|
+
> Migrate by replacing `@withwiz/toolkit/react/*` → `@withwiz/ui/react/*`.
|
|
50
|
+
|
|
48
51
|
## Quick start
|
|
49
52
|
|
|
50
53
|
```ts
|
|
@@ -85,13 +88,6 @@ const geo = await getGeoLocation('8.8.8.8')
|
|
|
85
88
|
// { country: 'US', city: 'Mountain View', ... }
|
|
86
89
|
```
|
|
87
90
|
|
|
88
|
-
```tsx
|
|
89
|
-
// Hooks (React)
|
|
90
|
-
import { useDebounce } from '@withwiz/toolkit/react/hooks/useDebounce'
|
|
91
|
-
|
|
92
|
-
const debouncedQuery = useDebounce(query, 300)
|
|
93
|
-
```
|
|
94
|
-
|
|
95
91
|
```ts
|
|
96
92
|
// Utils
|
|
97
93
|
import { sanitizeInput } from '@withwiz/toolkit/core/utils/sanitizer'
|
|
@@ -99,19 +95,49 @@ import { formatNumber } from '@withwiz/toolkit/core/utils/format-number'
|
|
|
99
95
|
import { normalizeUrl } from '@withwiz/toolkit/core/utils/url-normalizer'
|
|
100
96
|
```
|
|
101
97
|
|
|
98
|
+
### Token delivery mode (tokenDelivery)
|
|
99
|
+
|
|
100
|
+
You can choose how authentication tokens are delivered at initialization time. The default is `'hybrid'` (cookie + header support, the legacy behavior).
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
import { initialize } from '@withwiz/toolkit/initialize';
|
|
104
|
+
|
|
105
|
+
initialize({
|
|
106
|
+
auth: {
|
|
107
|
+
jwtSecret: process.env.JWT_SECRET!,
|
|
108
|
+
tokenDelivery: 'cookie', // 'cookie' | 'header' | 'hybrid' (default)
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
It can also be overridden per handler (precedence: option > global > `'hybrid'`):
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
createAuthHandlers({ ...options, tokenDelivery: 'header' });
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
| Mode | Token location | Notes |
|
|
120
|
+
|---|---|---|
|
|
121
|
+
| `cookie` | HttpOnly cookie only | Token removed from the response body — minimal XSS exposure. Recommended for browser apps |
|
|
122
|
+
| `header` | `Authorization: Bearer` + body | Refresh is passed via the body `{ refreshToken }`. Client-side storage is relatively vulnerable to XSS — for non-browser clients |
|
|
123
|
+
| `hybrid` | Both | Legacy behavior. Cookie first, with header/body fallback |
|
|
124
|
+
|
|
125
|
+
**Constraint**: The OAuth callback is a redirect response, so it always delivers the token via cookie regardless of the mode. Apps that use OAuth should use `'cookie'` or `'hybrid'`.
|
|
126
|
+
|
|
102
127
|
## Module reference
|
|
103
128
|
|
|
104
|
-
0.7
|
|
105
|
-
|
|
106
|
-
|
|
129
|
+
Since 0.7, every subpath is split into tiers based on its framework dependencies
|
|
130
|
+
(`core` / `next` / `prisma` since 0.8 — the `react` tier moved to `@withwiz/ui`).
|
|
131
|
+
For the detailed tier model, rules, and migration mapping, see [`docs/FRAMEWORK_TIERS.md`](docs/FRAMEWORK_TIERS.md)
|
|
132
|
+
and the 0.7.0 / 0.8.0 entries in [`CHANGELOG.md`](CHANGELOG.md).
|
|
107
133
|
|
|
108
134
|
### Composition root
|
|
109
135
|
|
|
110
136
|
| Subpath | Description |
|
|
111
137
|
|---|---|
|
|
112
|
-
| `/initialize` |
|
|
138
|
+
| `/initialize` | Unified entry point that assembles every tier's configuration into a single object |
|
|
113
139
|
|
|
114
|
-
### `core` —
|
|
140
|
+
### `core` — framework-independent (pure TS)
|
|
115
141
|
|
|
116
142
|
| Subpath | Description |
|
|
117
143
|
|---|---|
|
|
@@ -138,7 +164,7 @@ import { normalizeUrl } from '@withwiz/toolkit/core/utils/url-normalizer'
|
|
|
138
164
|
| `/core/utils` | `sanitizer`, `type-guards`, `format-number`, `ip-utils`, `timezone`, ... |
|
|
139
165
|
| `/core/validators` | Password strength validator |
|
|
140
166
|
|
|
141
|
-
### `next` — Next.js
|
|
167
|
+
### `next` — depends on Next.js
|
|
142
168
|
|
|
143
169
|
| Subpath | Description |
|
|
144
170
|
|---|---|
|
|
@@ -148,20 +174,17 @@ import { normalizeUrl } from '@withwiz/toolkit/core/utils/url-normalizer'
|
|
|
148
174
|
| `/next/error` | `error-handler` (NextResponse), `LocaleDetector`, `ErrorBoundary` |
|
|
149
175
|
| `/next/utils` | `api-helpers`, `cors`, `csv-export`, `error-processor` |
|
|
150
176
|
|
|
151
|
-
### `react` —
|
|
177
|
+
### `react` — moved to `@withwiz/ui` (0.8)
|
|
152
178
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
| `/react/hooks/{useDataTable,useDebounce,useExitIntent,useTimezone}` | React hooks |
|
|
157
|
-
| `/react/error` | `error-display` (sonner toast) |
|
|
158
|
-
| `/react/utils/{client-utils,qr-code}` | Browser-context utilities |
|
|
179
|
+
The React tier (UI components, hooks, `error-display`, browser-context utils) was
|
|
180
|
+
extracted to the standalone [`@withwiz/ui`](https://github.com/greeun) package.
|
|
181
|
+
Migrate imports: `@withwiz/toolkit/react/*` → `@withwiz/ui/react/*`.
|
|
159
182
|
|
|
160
|
-
### `prisma` — Prisma
|
|
183
|
+
### `prisma` — depends on Prisma
|
|
161
184
|
|
|
162
185
|
| Subpath | Description |
|
|
163
186
|
|---|---|
|
|
164
|
-
| `/prisma/auth-adapter` | `UserRepository` / `OAuthAccountRepository` / `EmailTokenRepository`
|
|
187
|
+
| `/prisma/auth-adapter` | Prisma implementations of `UserRepository` / `OAuthAccountRepository` / `EmailTokenRepository` |
|
|
165
188
|
|
|
166
189
|
## Requirements
|
|
167
190
|
|
|
@@ -170,15 +193,14 @@ import { normalizeUrl } from '@withwiz/toolkit/core/utils/url-normalizer'
|
|
|
170
193
|
|
|
171
194
|
### Optional peers
|
|
172
195
|
|
|
173
|
-
`next` / `react` / `react-dom`
|
|
174
|
-
|
|
196
|
+
`next` / `react` / `react-dom` are `optional` peer dependencies.
|
|
197
|
+
Install only the peers required by the tiers you use:
|
|
175
198
|
|
|
176
|
-
-
|
|
177
|
-
- `next`
|
|
178
|
-
- `
|
|
179
|
-
-
|
|
180
|
-
-
|
|
181
|
-
- 이메일 전송: `nodemailer >= 6` (optional)
|
|
199
|
+
- Backend / CLI using only the `core` tier: no peers required
|
|
200
|
+
- `next` tier: Next.js >= 15, plus React >= 18 / React-DOM >= 18 (`next/error/ErrorBoundary` is a React component)
|
|
201
|
+
- `prisma` tier: a Prisma-compatible client (duck-typed)
|
|
202
|
+
- Some modules such as the Prisma adapter's `EmailTokenRepository`: `date-fns >= 3` (optional)
|
|
203
|
+
- Email delivery: `nodemailer >= 6` (optional)
|
|
182
204
|
|
|
183
205
|
## Development
|
|
184
206
|
|
|
@@ -2,6 +2,9 @@ import {
|
|
|
2
2
|
ERROR_CODES,
|
|
3
3
|
formatErrorMessage
|
|
4
4
|
} from "./chunk-XQIAXMRY.js";
|
|
5
|
+
import {
|
|
6
|
+
ROLE_DEFAULTS
|
|
7
|
+
} from "./chunk-7YWUKMZD.js";
|
|
5
8
|
|
|
6
9
|
// src/next/utils/api-helpers.ts
|
|
7
10
|
import { NextResponse } from "next/server";
|
|
@@ -73,8 +76,8 @@ function createPaginatedResponse(data, total, page, limit) {
|
|
|
73
76
|
}
|
|
74
77
|
});
|
|
75
78
|
}
|
|
76
|
-
function requireAdmin(userRole) {
|
|
77
|
-
if (userRole !==
|
|
79
|
+
function requireAdmin(userRole, adminRole = ROLE_DEFAULTS.ADMIN_ROLE) {
|
|
80
|
+
if (userRole !== adminRole) {
|
|
78
81
|
return {
|
|
79
82
|
isAdmin: false,
|
|
80
83
|
response: NextResponse.json(
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// src/core/auth/adapters/sql/dialect.ts
|
|
2
|
+
var POSTGRES = {
|
|
3
|
+
placeholder: (index) => `$${index}`,
|
|
4
|
+
quoteId: (id) => `"${id}"`
|
|
5
|
+
};
|
|
6
|
+
var MYSQL = {
|
|
7
|
+
placeholder: () => "?",
|
|
8
|
+
quoteId: (id) => `\`${id}\``
|
|
9
|
+
};
|
|
10
|
+
function getDialect(dialect) {
|
|
11
|
+
switch (dialect) {
|
|
12
|
+
case "postgres":
|
|
13
|
+
return POSTGRES;
|
|
14
|
+
case "mysql":
|
|
15
|
+
return MYSQL;
|
|
16
|
+
default:
|
|
17
|
+
throw new Error(`Unsupported SQL dialect: ${dialect}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
var ParamBuilder = class {
|
|
21
|
+
constructor(dialect) {
|
|
22
|
+
this.dialect = dialect;
|
|
23
|
+
this._params = [];
|
|
24
|
+
}
|
|
25
|
+
add(value) {
|
|
26
|
+
this._params.push(value);
|
|
27
|
+
return this.dialect.placeholder(this._params.length);
|
|
28
|
+
}
|
|
29
|
+
get params() {
|
|
30
|
+
return this._params;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
function columnList(columns, dialect) {
|
|
34
|
+
return columns.map((c) => dialect.quoteId(c)).join(", ");
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
getDialect,
|
|
39
|
+
ParamBuilder,
|
|
40
|
+
columnList
|
|
41
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__spreadValues
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-N3ETBM74.js";
|
|
4
4
|
|
|
5
5
|
// src/core/utils/sanitizer.ts
|
|
6
6
|
function sanitizeHtml(input) {
|
|
@@ -21,7 +21,10 @@ function removeEventHandlers(input) {
|
|
|
21
21
|
if (!input || typeof input !== "string") {
|
|
22
22
|
return "";
|
|
23
23
|
}
|
|
24
|
-
return input.replace(
|
|
24
|
+
return input.replace(
|
|
25
|
+
/\bon\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,
|
|
26
|
+
""
|
|
27
|
+
);
|
|
25
28
|
}
|
|
26
29
|
function sanitizeUrl(url) {
|
|
27
30
|
if (!url || typeof url !== "string") {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PasswordHasher,
|
|
3
3
|
PasswordValidator
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4ROIPF33.js";
|
|
5
5
|
import {
|
|
6
6
|
__spreadValues
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-N3ETBM74.js";
|
|
8
8
|
|
|
9
9
|
// src/core/auth/password/client-helper.ts
|
|
10
10
|
var DEFAULT_PASSWORD_CONFIG = {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getPlatform
|
|
3
|
+
} from "./chunk-KWUOLKDO.js";
|
|
1
4
|
import {
|
|
2
5
|
formatDatabaseError,
|
|
3
6
|
formatRedisError
|
|
4
7
|
} from "./chunk-PBVP7CFZ.js";
|
|
5
|
-
import {
|
|
6
|
-
getPlatform
|
|
7
|
-
} from "./chunk-4KJZRI74.js";
|
|
8
8
|
import {
|
|
9
9
|
logger
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QAIN3WNN.js";
|
|
11
11
|
import {
|
|
12
12
|
getResolvedCacheConfig
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-7KIM5MHV.js";
|
|
14
14
|
|
|
15
15
|
// src/core/system/health-check.ts
|
|
16
16
|
async function checkServiceHealth(prismaClient) {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
// src/core/auth/password/index.ts
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import bcrypt from "bcryptjs";
|
|
4
|
+
var BCRYPT_MAX_PASSWORD_BYTES = 72;
|
|
5
|
+
var utf8ByteLength = (value) => new TextEncoder().encode(value).length;
|
|
6
|
+
var BCRYPT_BYTE_LIMIT_MESSAGE = `Password cannot exceed ${BCRYPT_MAX_PASSWORD_BYTES} bytes`;
|
|
4
7
|
var _PasswordValidator = class _PasswordValidator {
|
|
5
8
|
constructor(config) {
|
|
6
9
|
this.config = config;
|
|
@@ -20,6 +23,9 @@ var _PasswordValidator = class _PasswordValidator {
|
|
|
20
23
|
`Password cannot exceed ${this.config.maxLength} characters`
|
|
21
24
|
);
|
|
22
25
|
}
|
|
26
|
+
if (utf8ByteLength(password) > BCRYPT_MAX_PASSWORD_BYTES) {
|
|
27
|
+
errors.push(BCRYPT_BYTE_LIMIT_MESSAGE);
|
|
28
|
+
}
|
|
23
29
|
if (this.config.requireNumber && !/\d/.test(password)) {
|
|
24
30
|
errors.push("Password must contain at least one number");
|
|
25
31
|
}
|
|
@@ -119,7 +125,10 @@ var _PasswordValidator = class _PasswordValidator {
|
|
|
119
125
|
"Password must contain at least one special character"
|
|
120
126
|
);
|
|
121
127
|
}
|
|
122
|
-
return schema
|
|
128
|
+
return schema.refine(
|
|
129
|
+
(value) => utf8ByteLength(value) <= BCRYPT_MAX_PASSWORD_BYTES,
|
|
130
|
+
{ message: BCRYPT_BYTE_LIMIT_MESSAGE }
|
|
131
|
+
);
|
|
123
132
|
}
|
|
124
133
|
/**
|
|
125
134
|
* 비밀번호 힌트 생성
|
|
@@ -201,11 +210,15 @@ var PasswordHasher = class {
|
|
|
201
210
|
return bcrypt.compare(password, hash);
|
|
202
211
|
}
|
|
203
212
|
};
|
|
204
|
-
var defaultPasswordSchema = z.string().min(8, "Password must be at least 8 characters long").max(128, "Password cannot exceed 128 characters").regex(/\d/, "Password must contain at least one number")
|
|
213
|
+
var defaultPasswordSchema = z.string().min(8, "Password must be at least 8 characters long").max(128, "Password cannot exceed 128 characters").regex(/\d/, "Password must contain at least one number").refine((value) => utf8ByteLength(value) <= BCRYPT_MAX_PASSWORD_BYTES, {
|
|
214
|
+
message: BCRYPT_BYTE_LIMIT_MESSAGE
|
|
215
|
+
});
|
|
205
216
|
var strongPasswordSchema = z.string().min(12, "Password must be at least 12 characters long").max(128, "Password cannot exceed 128 characters").regex(/[a-z]/, "Password must contain at least one lowercase letter").regex(/[A-Z]/, "Password must contain at least one uppercase letter").regex(/\d/, "Password must contain at least one number").regex(
|
|
206
217
|
/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~`]/,
|
|
207
218
|
"Password must contain at least one special character"
|
|
208
|
-
)
|
|
219
|
+
).refine((value) => utf8ByteLength(value) <= BCRYPT_MAX_PASSWORD_BYTES, {
|
|
220
|
+
message: BCRYPT_BYTE_LIMIT_MESSAGE
|
|
221
|
+
});
|
|
209
222
|
|
|
210
223
|
export {
|
|
211
224
|
PasswordValidator,
|
|
@@ -3,17 +3,17 @@ import {
|
|
|
3
3
|
isRedisGloballyDisabled,
|
|
4
4
|
notifyRedisError,
|
|
5
5
|
resetRedisGlobalState
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZEHNCHIV.js";
|
|
7
7
|
import {
|
|
8
8
|
logger
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QAIN3WNN.js";
|
|
10
10
|
import {
|
|
11
11
|
getENV,
|
|
12
12
|
isCacheEnabled
|
|
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/redis-cache-manager.ts
|
|
19
19
|
var RedisCacheManager = class _RedisCacheManager {
|