@withwiz/toolkit 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +162 -0
- package/dist/auth/adapters/prisma/index.d.ts +43 -0
- package/dist/auth/adapters/prisma/index.js +284 -0
- package/dist/auth/core/email/token-generator.d.ts +43 -0
- package/dist/auth/core/email/token-generator.js +7 -0
- package/dist/auth/core/jwt/client.d.ts +87 -0
- package/dist/auth/core/jwt/client.js +36 -0
- package/dist/auth/core/jwt/index.d.ts +110 -0
- package/dist/auth/core/jwt/index.js +10 -0
- package/dist/auth/core/jwt/types.d.ts +6 -0
- package/dist/auth/core/jwt/types.js +13 -0
- package/dist/auth/core/oauth/index.d.ts +51 -0
- package/dist/auth/core/oauth/index.js +12 -0
- package/dist/auth/core/password/client-helper.d.ts +44 -0
- package/dist/auth/core/password/client-helper.js +28 -0
- package/dist/auth/core/password/index.d.ts +71 -0
- package/dist/auth/core/password/index.js +14 -0
- package/dist/auth/errors/index.d.ts +49 -0
- package/dist/auth/errors/index.js +17 -0
- package/dist/auth/index.d.ts +21 -0
- package/dist/auth/index.js +97 -0
- package/dist/auth/types/index.d.ts +213 -0
- package/dist/auth/types/index.js +13 -0
- package/dist/cache/cache-config.d.ts +73 -0
- package/dist/cache/cache-config.js +12 -0
- package/dist/cache/cache-defaults.d.ts +141 -0
- package/dist/cache/cache-defaults.js +33 -0
- package/dist/cache/cache-env.d.ts +75 -0
- package/dist/cache/cache-env.js +25 -0
- package/dist/cache/cache-factory.d.ts +34 -0
- package/dist/cache/cache-factory.js +28 -0
- package/dist/cache/cache-invalidation.d.ts +90 -0
- package/dist/cache/cache-invalidation.js +24 -0
- package/dist/cache/cache-keys-legacy.d.ts +35 -0
- package/dist/cache/cache-keys-legacy.js +7 -0
- package/dist/cache/cache-redis.d.ts +74 -0
- package/dist/cache/cache-redis.js +24 -0
- package/dist/cache/cache-types.d.ts +151 -0
- package/dist/cache/cache-types.js +9 -0
- package/dist/cache/cache-wrapper.d.ts +27 -0
- package/dist/cache/cache-wrapper.js +22 -0
- package/dist/cache/cache.d.ts +14 -0
- package/dist/cache/cache.js +112 -0
- package/dist/cache/hybrid-cache-manager.d.ts +148 -0
- package/dist/cache/hybrid-cache-manager.js +13 -0
- package/dist/cache/index.d.ts +21 -0
- package/dist/cache/index.js +112 -0
- package/dist/cache/inmemory-cache-manager.d.ts +163 -0
- package/dist/cache/inmemory-cache-manager.js +9 -0
- package/dist/cache/noop-cache-manager.d.ts +36 -0
- package/dist/cache/noop-cache-manager.js +11 -0
- package/dist/cache/redis-cache-manager.d.ts +34 -0
- package/dist/cache/redis-cache-manager.js +11 -0
- package/dist/chunk-26Y7VEYG.js +93 -0
- package/dist/chunk-2DVWSDST.js +119 -0
- package/dist/chunk-2KAPUVIS.js +155 -0
- package/dist/chunk-2TO7WUKK.js +93 -0
- package/dist/chunk-34WAGUT5.js +117 -0
- package/dist/chunk-3DZA6AGS.js +120 -0
- package/dist/chunk-4DPSCTX4.js +212 -0
- package/dist/chunk-4KJXENRM.js +64 -0
- package/dist/chunk-4NWJ3WCZ.js +28 -0
- package/dist/chunk-4ODT3Q4A.js +86 -0
- package/dist/chunk-5ATB5D6S.js +40 -0
- package/dist/chunk-62FLBG6B.js +34 -0
- package/dist/chunk-62Q7DN5G.js +25 -0
- package/dist/chunk-65LHDFU3.js +242 -0
- package/dist/chunk-6C7HQIX4.js +13 -0
- package/dist/chunk-6D3HHYER.js +32 -0
- package/dist/chunk-6LTZCXNC.js +326 -0
- package/dist/chunk-7VJNLGAS.js +110 -0
- package/dist/chunk-7XFHGAJP.js +0 -0
- package/dist/chunk-A6EAAWMK.js +50 -0
- package/dist/chunk-AHDPGRXS.js +51 -0
- package/dist/chunk-AIH3F7JV.js +76 -0
- package/dist/chunk-AIHQBQ3E.js +109 -0
- package/dist/chunk-BKGVSC6S.js +152 -0
- package/dist/chunk-COK4ZXNG.js +0 -0
- package/dist/chunk-DEEJBDJE.js +47 -0
- package/dist/chunk-DH2ZHGW2.js +53 -0
- package/dist/chunk-EBUEBEJX.js +0 -0
- package/dist/chunk-EEUBKZV4.js +54 -0
- package/dist/chunk-EQYTE7WD.js +139 -0
- package/dist/chunk-EUQATJLI.js +180 -0
- package/dist/chunk-EZC6ETFW.js +80 -0
- package/dist/chunk-EZR55KV2.js +249 -0
- package/dist/chunk-F6LCSFSU.js +31 -0
- package/dist/chunk-FOKAATUQ.js +62 -0
- package/dist/chunk-FW3IEJ7H.js +71 -0
- package/dist/chunk-G26T2PRQ.js +53 -0
- package/dist/chunk-G4NI37NN.js +257 -0
- package/dist/chunk-GCZOXUDV.js +132 -0
- package/dist/chunk-GDWEDUHO.js +55 -0
- package/dist/chunk-GL2NANFH.js +434 -0
- package/dist/chunk-GPBOMJSZ.js +136 -0
- package/dist/chunk-H5I5GWAA.js +94 -0
- package/dist/chunk-HGC4CCKB.js +29 -0
- package/dist/chunk-HV3DGSSH.js +447 -0
- package/dist/chunk-I47QEDTX.js +193 -0
- package/dist/chunk-IAJNC34M.js +102 -0
- package/dist/chunk-IHXRF3BH.js +215 -0
- package/dist/chunk-IJEZ7G7S.js +26 -0
- package/dist/chunk-IQQKKUAV.js +151 -0
- package/dist/chunk-JBCDEAMW.js +35 -0
- package/dist/chunk-JLLMTTQ4.js +75 -0
- package/dist/chunk-JS5VI3OW.js +143 -0
- package/dist/chunk-KAWVMIRJ.js +44 -0
- package/dist/chunk-KMCJIL57.js +214 -0
- package/dist/chunk-KWTBD4CM.js +145 -0
- package/dist/chunk-KXAWBFJN.js +310 -0
- package/dist/chunk-L25BNU3E.js +56 -0
- package/dist/chunk-L76O3X3D.js +197 -0
- package/dist/chunk-LNV2E4I6.js +63 -0
- package/dist/chunk-MLGO3HLS.js +329 -0
- package/dist/chunk-MRJE6OX5.js +22 -0
- package/dist/chunk-MYLGYX4K.js +57 -0
- package/dist/chunk-N4YGR5WH.js +310 -0
- package/dist/chunk-OIVXOT2X.js +80 -0
- package/dist/chunk-ORMEWXMH.js +37 -0
- package/dist/chunk-POKGHK3L.js +57 -0
- package/dist/chunk-Q7IP4JMW.js +69 -0
- package/dist/chunk-RJUVBBZG.js +27 -0
- package/dist/chunk-S73334QY.js +89 -0
- package/dist/chunk-SLG26KHZ.js +101 -0
- package/dist/chunk-SR65BF6X.js +82 -0
- package/dist/chunk-SS56XFLI.js +19 -0
- package/dist/chunk-T3LJYAMO.js +277 -0
- package/dist/chunk-TDZJ6SAI.js +34 -0
- package/dist/chunk-TEIYA7U4.js +72 -0
- package/dist/chunk-TMVS4F7E.js +88 -0
- package/dist/chunk-TRBKJ7JT.js +137 -0
- package/dist/chunk-TXGNSECL.js +84 -0
- package/dist/chunk-TZAP5T4N.js +188 -0
- package/dist/chunk-UCYQNHST.js +24 -0
- package/dist/chunk-ULF5RDDX.js +0 -0
- package/dist/chunk-UXQRU3EM.js +167 -0
- package/dist/chunk-V5K5FYU7.js +200 -0
- package/dist/chunk-VDXB5DCY.js +68 -0
- package/dist/chunk-VSGKVZB4.js +47 -0
- package/dist/chunk-VWODEQ5C.js +204 -0
- package/dist/chunk-WDUFQFDP.js +193 -0
- package/dist/chunk-WHR7HPWF.js +126 -0
- package/dist/chunk-WSQMXMTL.js +122 -0
- package/dist/chunk-XHZ5L4FO.js +103 -0
- package/dist/chunk-XPASCCUA.js +404 -0
- package/dist/chunk-XRRPEBKB.js +231 -0
- package/dist/chunk-Y2TUZFCP.js +0 -0
- package/dist/chunk-Y3OTJH2S.js +473 -0
- package/dist/chunk-YBSHN67U.js +161 -0
- package/dist/chunk-YJ3TLEW3.js +100 -0
- package/dist/chunk-YJWLWUFK.js +105 -0
- package/dist/chunk-Z4D4CMDA.js +488 -0
- package/dist/chunk-ZHVUK5OY.js +314 -0
- package/dist/chunk-ZTN4X5FN.js +29 -0
- package/dist/chunk-ZZIKRBJU.js +96 -0
- package/dist/components/ui/Alert.d.ts +12 -0
- package/dist/components/ui/Alert.js +10 -0
- package/dist/components/ui/Badge.d.ts +7 -0
- package/dist/components/ui/Badge.js +8 -0
- package/dist/components/ui/Button.d.ts +7 -0
- package/dist/components/ui/Button.js +8 -0
- package/dist/components/ui/DataTable.d.ts +103 -0
- package/dist/components/ui/DataTable.js +606 -0
- package/dist/components/ui/DomainDisplay.d.ts +12 -0
- package/dist/components/ui/DomainDisplay.js +31 -0
- package/dist/components/ui/Input.d.ts +5 -0
- package/dist/components/ui/Input.js +8 -0
- package/dist/components/ui/Label.d.ts +5 -0
- package/dist/components/ui/Label.js +8 -0
- package/dist/components/ui/Pagination.d.ts +42 -0
- package/dist/components/ui/Pagination.js +20 -0
- package/dist/components/ui/Select.d.ts +15 -0
- package/dist/components/ui/Select.js +27 -0
- package/dist/components/ui/Skeleton.d.ts +6 -0
- package/dist/components/ui/Skeleton.js +8 -0
- package/dist/components/ui/TimezoneDisplay.d.ts +22 -0
- package/dist/components/ui/TimezoneDisplay.js +83 -0
- package/dist/components/ui/Tooltip.d.ts +21 -0
- package/dist/components/ui/Tooltip.js +94 -0
- package/dist/components/ui/WorldMapChart.d.ts +17 -0
- package/dist/components/ui/WorldMapChart.js +250 -0
- package/dist/components/ui/loading-bar.d.ts +20 -0
- package/dist/components/ui/loading-bar.js +15 -0
- package/dist/constants/error-codes.d.ts +389 -0
- package/dist/constants/error-codes.js +27 -0
- package/dist/constants/index.d.ts +11 -0
- package/dist/constants/index.js +85 -0
- package/dist/constants/messages.d.ts +83 -0
- package/dist/constants/messages.js +13 -0
- package/dist/constants/pagination.d.ts +43 -0
- package/dist/constants/pagination.js +15 -0
- package/dist/constants/security.d.ts +66 -0
- package/dist/constants/security.js +23 -0
- package/dist/constants/validation.d.ts +60 -0
- package/dist/constants/validation.js +19 -0
- package/dist/error/ErrorBoundary.d.ts +47 -0
- package/dist/error/app-error.d.ts +144 -0
- package/dist/error/app-error.js +10 -0
- package/dist/error/components/EmptyState.d.ts +50 -0
- package/dist/error/components/ErrorAlert.d.ts +50 -0
- package/dist/error/components/ErrorPage.d.ts +39 -0
- package/dist/error/components/LoadingState.d.ts +37 -0
- package/dist/error/components/index.d.ts +13 -0
- package/dist/error/components/index.js +18 -0
- package/dist/error/core/locale-detector.d.ts +44 -0
- package/dist/error/core/locale-detector.js +9 -0
- package/dist/error/error-display.d.ts +55 -0
- package/dist/error/error-display.js +24 -0
- package/dist/error/error-handler.d.ts +118 -0
- package/dist/error/error-handler.js +18 -0
- package/dist/error/friendly-messages-v2.d.ts +46 -0
- package/dist/error/friendly-messages-v2.js +15 -0
- package/dist/error/friendly-messages.d.ts +22 -0
- package/dist/error/friendly-messages.js +12 -0
- package/dist/error/hooks/index.d.ts +7 -0
- package/dist/error/hooks/index.js +14 -0
- package/dist/error/hooks/useErrorHandler.d.ts +67 -0
- package/dist/error/hooks/useErrorHandler.js +14 -0
- package/dist/error/index.d.ts +26 -0
- package/dist/error/index.js +289 -0
- package/dist/error/logging/error-logger.d.ts +77 -0
- package/dist/error/logging/error-logger.js +10 -0
- package/dist/error/logging/index.d.ts +9 -0
- package/dist/error/logging/index.js +35 -0
- package/dist/error/logging/transports/base.d.ts +30 -0
- package/dist/error/logging/transports/base.js +7 -0
- package/dist/error/logging/transports/console.d.ts +40 -0
- package/dist/error/logging/transports/console.js +9 -0
- package/dist/error/logging/transports/file.d.ts +49 -0
- package/dist/error/logging/transports/file.js +8 -0
- package/dist/error/logging/transports/index.d.ts +12 -0
- package/dist/error/logging/transports/index.js +25 -0
- package/dist/error/logging/transports/sentry.d.ts +44 -0
- package/dist/error/logging/transports/sentry.js +9 -0
- package/dist/error/logging/transports/slack.d.ts +51 -0
- package/dist/error/logging/transports/slack.js +9 -0
- package/dist/error/logging/types.d.ts +83 -0
- package/dist/error/logging/types.js +7 -0
- package/dist/error/messages/en.d.ts +5 -0
- package/dist/error/messages/en.js +7 -0
- package/dist/error/messages/index.d.ts +40 -0
- package/dist/error/messages/index.js +17 -0
- package/dist/error/messages/ko.d.ts +5 -0
- package/dist/error/messages/ko.js +7 -0
- package/dist/error/messages/types.d.ts +30 -0
- package/dist/error/messages/types.js +0 -0
- package/dist/error/recovery/circuit-breaker.d.ts +85 -0
- package/dist/error/recovery/circuit-breaker.js +9 -0
- package/dist/error/recovery/degradation.d.ts +56 -0
- package/dist/error/recovery/degradation.js +7 -0
- package/dist/error/recovery/fallback.d.ts +55 -0
- package/dist/error/recovery/fallback.js +11 -0
- package/dist/error/recovery/index.d.ts +12 -0
- package/dist/error/recovery/index.js +26 -0
- package/dist/error/recovery/retry.d.ts +44 -0
- package/dist/error/recovery/retry.js +7 -0
- package/dist/geolocation/batch-processor.d.ts +33 -0
- package/dist/geolocation/batch-processor.js +10 -0
- package/dist/geolocation/index.d.ts +14 -0
- package/dist/geolocation/index.js +36 -0
- package/dist/geolocation/providers/base-provider.d.ts +33 -0
- package/dist/geolocation/providers/base-provider.js +9 -0
- package/dist/geolocation/providers/index.d.ts +54 -0
- package/dist/geolocation/providers/index.js +29 -0
- package/dist/geolocation/providers/ip-api-provider.d.ts +17 -0
- package/dist/geolocation/providers/ip-api-provider.js +8 -0
- package/dist/geolocation/providers/ipapi-co-provider.d.ts +17 -0
- package/dist/geolocation/providers/ipapi-co-provider.js +8 -0
- package/dist/geolocation/providers/ipgeolocation-provider.d.ts +18 -0
- package/dist/geolocation/providers/ipgeolocation-provider.js +8 -0
- package/dist/geolocation/providers/maxmind-provider.d.ts +18 -0
- package/dist/geolocation/providers/maxmind-provider.js +8 -0
- package/dist/hooks/useDataTable.d.ts +51 -0
- package/dist/hooks/useDataTable.js +149 -0
- package/dist/hooks/useDebounce.d.ts +7 -0
- package/dist/hooks/useDebounce.js +7 -0
- package/dist/hooks/useExitIntent.d.ts +35 -0
- package/dist/hooks/useExitIntent.js +72 -0
- package/dist/hooks/useTimezone.d.ts +19 -0
- package/dist/hooks/useTimezone.js +11 -0
- package/dist/logger/logger.d.ts +11 -0
- package/dist/logger/logger.js +17 -0
- package/dist/middleware/auth.d.ts +87 -0
- package/dist/middleware/auth.js +20 -0
- package/dist/middleware/cors.d.ts +30 -0
- package/dist/middleware/cors.js +10 -0
- package/dist/middleware/error-handler.d.ts +23 -0
- package/dist/middleware/error-handler.js +13 -0
- package/dist/middleware/index.d.ts +16 -0
- package/dist/middleware/index.js +72 -0
- package/dist/middleware/init-request.d.ts +18 -0
- package/dist/middleware/init-request.js +8 -0
- package/dist/middleware/middleware-chain.d.ts +53 -0
- package/dist/middleware/middleware-chain.js +8 -0
- package/dist/middleware/rate-limit.d.ts +82 -0
- package/dist/middleware/rate-limit.js +14 -0
- package/dist/middleware/response-logger.d.ts +22 -0
- package/dist/middleware/response-logger.js +8 -0
- package/dist/middleware/security.d.ts +31 -0
- package/dist/middleware/security.js +9 -0
- package/dist/middleware/types.d.ts +45 -0
- package/dist/middleware/types.js +0 -0
- package/dist/middleware/wrappers.d.ts +91 -0
- package/dist/middleware/wrappers.js +32 -0
- package/dist/storage/r2-storage.d.ts +38 -0
- package/dist/storage/r2-storage.js +105 -0
- package/dist/system/cpu.d.ts +2 -0
- package/dist/system/cpu.js +9 -0
- package/dist/system/disk.d.ts +2 -0
- package/dist/system/disk.js +9 -0
- package/dist/system/environment.d.ts +8 -0
- package/dist/system/environment.js +9 -0
- package/dist/system/health-check.d.ts +26 -0
- package/dist/system/health-check.js +10 -0
- package/dist/system/index.d.ts +51 -0
- package/dist/system/index.js +194 -0
- package/dist/system/memory.d.ts +2 -0
- package/dist/system/memory.js +9 -0
- package/dist/system/network.d.ts +2 -0
- package/dist/system/network.js +9 -0
- package/dist/system/types.d.ts +93 -0
- package/dist/system/types.js +0 -0
- package/dist/system/utils.d.ts +12 -0
- package/dist/system/utils.js +26 -0
- package/dist/types/api.d.ts +80 -0
- package/dist/types/api.js +0 -0
- package/dist/types/database.d.ts +38 -0
- package/dist/types/database.js +0 -0
- package/dist/types/env.d.ts +105 -0
- package/dist/types/env.js +0 -0
- package/dist/types/geoip.d.ts +152 -0
- package/dist/types/geoip.js +0 -0
- package/dist/types/i18n.d.ts +11 -0
- package/dist/types/i18n.js +0 -0
- package/dist/types/qr-code.d.ts +139 -0
- package/dist/types/qr-code.js +75 -0
- package/dist/types/user.d.ts +54 -0
- package/dist/types/user.js +0 -0
- package/dist/utils/api-helpers.d.ts +147 -0
- package/dist/utils/api-helpers.js +30 -0
- package/dist/utils/client/client-utils.d.ts +3 -0
- package/dist/utils/client/client-utils.js +9 -0
- package/dist/utils/client/qr-code.d.ts +16 -0
- package/dist/utils/client/qr-code.js +215 -0
- package/dist/utils/cors.d.ts +40 -0
- package/dist/utils/cors.js +21 -0
- package/dist/utils/csv-export.d.ts +97 -0
- package/dist/utils/csv-export.js +20 -0
- package/dist/utils/error-message-formatter.d.ts +17 -0
- package/dist/utils/error-message-formatter.js +11 -0
- package/dist/utils/error-processor.d.ts +70 -0
- package/dist/utils/error-processor.js +34 -0
- package/dist/utils/format-number.d.ts +17 -0
- package/dist/utils/format-number.js +9 -0
- package/dist/utils/index.d.ts +13 -0
- package/dist/utils/index.js +160 -0
- package/dist/utils/input-validation.d.ts +88 -0
- package/dist/utils/input-validation.js +223 -0
- package/dist/utils/ip-utils.d.ts +15 -0
- package/dist/utils/ip-utils.js +91 -0
- package/dist/utils/optimistic-lock.d.ts +27 -0
- package/dist/utils/optimistic-lock.js +16 -0
- package/dist/utils/sanitizer.d.ts +72 -0
- package/dist/utils/sanitizer.js +19 -0
- package/dist/utils/shared-utils.d.ts +25 -0
- package/dist/utils/shared-utils.js +43 -0
- package/dist/utils/short-code-generator.d.ts +24 -0
- package/dist/utils/short-code-generator.js +9 -0
- package/dist/utils/timezone.d.ts +56 -0
- package/dist/utils/timezone.js +29 -0
- package/dist/utils/type-guards.d.ts +164 -0
- package/dist/utils/type-guards.js +59 -0
- package/dist/utils/url-normalizer.d.ts +53 -0
- package/dist/utils/url-normalizer.js +21 -0
- package/dist/validators/index.d.ts +7 -0
- package/dist/validators/index.js +13 -0
- package/dist/validators/password-validator.d.ts +86 -0
- package/dist/validators/password-validator.js +13 -0
- package/dist/world_countries-C2WUL2CQ.js +279 -0
- package/package.json +129 -0
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import "../chunk-ULF5RDDX.js";
|
|
2
|
+
import {
|
|
3
|
+
withFallback,
|
|
4
|
+
withFallbackChain,
|
|
5
|
+
withFallbackFn
|
|
6
|
+
} from "../chunk-MYLGYX4K.js";
|
|
7
|
+
import {
|
|
8
|
+
withRetry
|
|
9
|
+
} from "../chunk-A6EAAWMK.js";
|
|
10
|
+
import "../chunk-Y2TUZFCP.js";
|
|
11
|
+
import {
|
|
12
|
+
useErrorHandler
|
|
13
|
+
} from "../chunk-IAJNC34M.js";
|
|
14
|
+
import {
|
|
15
|
+
EmptyState,
|
|
16
|
+
ErrorAlert,
|
|
17
|
+
ErrorPage,
|
|
18
|
+
LoadingState
|
|
19
|
+
} from "../chunk-ZHVUK5OY.js";
|
|
20
|
+
import "../chunk-7XFHGAJP.js";
|
|
21
|
+
import "../chunk-COK4ZXNG.js";
|
|
22
|
+
import {
|
|
23
|
+
ConsoleTransport
|
|
24
|
+
} from "../chunk-FW3IEJ7H.js";
|
|
25
|
+
import {
|
|
26
|
+
FileTransport
|
|
27
|
+
} from "../chunk-YJ3TLEW3.js";
|
|
28
|
+
import {
|
|
29
|
+
SentryTransport
|
|
30
|
+
} from "../chunk-ZZIKRBJU.js";
|
|
31
|
+
import {
|
|
32
|
+
SlackTransport
|
|
33
|
+
} from "../chunk-EQYTE7WD.js";
|
|
34
|
+
import {
|
|
35
|
+
BaseTransport
|
|
36
|
+
} from "../chunk-HGC4CCKB.js";
|
|
37
|
+
import {
|
|
38
|
+
ErrorLogger
|
|
39
|
+
} from "../chunk-JS5VI3OW.js";
|
|
40
|
+
import {
|
|
41
|
+
ELogLevel
|
|
42
|
+
} from "../chunk-6C7HQIX4.js";
|
|
43
|
+
import {
|
|
44
|
+
CircuitBreaker,
|
|
45
|
+
ECircuitState
|
|
46
|
+
} from "../chunk-7VJNLGAS.js";
|
|
47
|
+
import {
|
|
48
|
+
FeatureDegradation
|
|
49
|
+
} from "../chunk-TEIYA7U4.js";
|
|
50
|
+
import {
|
|
51
|
+
LocaleDetector
|
|
52
|
+
} from "../chunk-XHZ5L4FO.js";
|
|
53
|
+
import {
|
|
54
|
+
ErrorResponse,
|
|
55
|
+
errorToResponse,
|
|
56
|
+
processError,
|
|
57
|
+
withErrorHandler
|
|
58
|
+
} from "../chunk-GPBOMJSZ.js";
|
|
59
|
+
import {
|
|
60
|
+
formatFriendlyError,
|
|
61
|
+
getErrorDisplayInfo as getErrorDisplayInfo2,
|
|
62
|
+
getFriendlyMessage
|
|
63
|
+
} from "../chunk-POKGHK3L.js";
|
|
64
|
+
import {
|
|
65
|
+
getAllMessages,
|
|
66
|
+
getErrorMessage,
|
|
67
|
+
hasMessage,
|
|
68
|
+
isLocaleSupported,
|
|
69
|
+
supportedLocales
|
|
70
|
+
} from "../chunk-EEUBKZV4.js";
|
|
71
|
+
import "../chunk-N4YGR5WH.js";
|
|
72
|
+
import "../chunk-KXAWBFJN.js";
|
|
73
|
+
import {
|
|
74
|
+
AppError
|
|
75
|
+
} from "../chunk-MLGO3HLS.js";
|
|
76
|
+
import {
|
|
77
|
+
extractErrorInfo,
|
|
78
|
+
formatInlineError,
|
|
79
|
+
getDefaultErrorCode,
|
|
80
|
+
getErrorIcon,
|
|
81
|
+
handleApiResponse,
|
|
82
|
+
showFriendlyError
|
|
83
|
+
} from "../chunk-3DZA6AGS.js";
|
|
84
|
+
import {
|
|
85
|
+
getErrorDisplayInfo
|
|
86
|
+
} from "../chunk-2DVWSDST.js";
|
|
87
|
+
import {
|
|
88
|
+
ERROR_CODES,
|
|
89
|
+
HTTP_STATUS,
|
|
90
|
+
formatErrorMessage,
|
|
91
|
+
getAllErrorCodes,
|
|
92
|
+
getDefaultErrorMessage,
|
|
93
|
+
getErrorByCode,
|
|
94
|
+
getErrorCategory,
|
|
95
|
+
getErrorCodesByCategory,
|
|
96
|
+
getErrorInfo,
|
|
97
|
+
getHttpStatus,
|
|
98
|
+
getLogLevel
|
|
99
|
+
} from "../chunk-Y3OTJH2S.js";
|
|
100
|
+
import "../chunk-EZR55KV2.js";
|
|
101
|
+
import "../chunk-ORMEWXMH.js";
|
|
102
|
+
|
|
103
|
+
// src/error/ErrorBoundary.tsx
|
|
104
|
+
import { Component } from "react";
|
|
105
|
+
import { AlertCircle, RefreshCw, Home, HelpCircle } from "lucide-react";
|
|
106
|
+
import Link from "next/link";
|
|
107
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
108
|
+
var ErrorBoundary = class extends Component {
|
|
109
|
+
constructor(props) {
|
|
110
|
+
super(props);
|
|
111
|
+
this.handleReset = () => {
|
|
112
|
+
this.setState({ hasError: false, error: null, errorCode: 50001 });
|
|
113
|
+
};
|
|
114
|
+
this.handleRefresh = () => {
|
|
115
|
+
window.location.reload();
|
|
116
|
+
};
|
|
117
|
+
this.state = { hasError: false, error: null, errorCode: 50001 };
|
|
118
|
+
}
|
|
119
|
+
static getDerivedStateFromError(error) {
|
|
120
|
+
const { code } = extractErrorInfo(error);
|
|
121
|
+
return { hasError: true, error, errorCode: code };
|
|
122
|
+
}
|
|
123
|
+
componentDidCatch(error, errorInfo) {
|
|
124
|
+
var _a, _b;
|
|
125
|
+
console.error("ErrorBoundary caught an error:", error, errorInfo);
|
|
126
|
+
(_b = (_a = this.props).onError) == null ? void 0 : _b.call(_a, error, errorInfo);
|
|
127
|
+
}
|
|
128
|
+
render() {
|
|
129
|
+
if (this.state.hasError) {
|
|
130
|
+
if (this.props.fallback) {
|
|
131
|
+
return this.props.fallback;
|
|
132
|
+
}
|
|
133
|
+
const locale = this.props.locale || "ko";
|
|
134
|
+
const displayInfo = getErrorDisplayInfo(this.state.errorCode, locale);
|
|
135
|
+
const isKo = locale === "ko";
|
|
136
|
+
return /* @__PURE__ */ jsx("div", { className: "min-h-[400px] flex items-center justify-center p-6", children: /* @__PURE__ */ jsxs("div", { className: "max-w-md w-full bg-white dark:bg-gray-900 rounded-2xl shadow-xl p-8 text-center", children: [
|
|
137
|
+
/* @__PURE__ */ jsx("div", { className: "w-16 h-16 mx-auto mb-6 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center", children: /* @__PURE__ */ jsx(AlertCircle, { className: "w-8 h-8 text-red-500" }) }),
|
|
138
|
+
/* @__PURE__ */ jsx("h2", { className: "text-xl font-bold text-gray-900 dark:text-white mb-2", children: displayInfo.title }),
|
|
139
|
+
/* @__PURE__ */ jsx("p", { className: "text-gray-600 dark:text-gray-400 mb-4", children: displayInfo.description }),
|
|
140
|
+
/* @__PURE__ */ jsxs("p", { className: "text-sm text-gray-500 dark:text-gray-500 mb-6", children: [
|
|
141
|
+
isKo ? "\uC5D0\uB7EC \uCF54\uB4DC" : "Error Code",
|
|
142
|
+
": ",
|
|
143
|
+
/* @__PURE__ */ jsx("code", { className: "bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded", children: this.state.errorCode })
|
|
144
|
+
] }),
|
|
145
|
+
this.props.showDetails && this.state.error && /* @__PURE__ */ jsxs("details", { className: "text-left mb-6 p-4 bg-gray-50 dark:bg-gray-800 rounded-lg", children: [
|
|
146
|
+
/* @__PURE__ */ jsx("summary", { className: "cursor-pointer text-sm font-medium text-gray-700 dark:text-gray-300", children: isKo ? "\uC0C1\uC138 \uC815\uBCF4" : "Details" }),
|
|
147
|
+
/* @__PURE__ */ jsx("pre", { className: "mt-2 text-xs text-gray-600 dark:text-gray-400 overflow-auto max-h-40", children: this.state.error.stack })
|
|
148
|
+
] }),
|
|
149
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row gap-3 justify-center", children: [
|
|
150
|
+
/* @__PURE__ */ jsxs(
|
|
151
|
+
"button",
|
|
152
|
+
{
|
|
153
|
+
onClick: this.handleRefresh,
|
|
154
|
+
className: "inline-flex items-center justify-center px-4 py-2.5 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors",
|
|
155
|
+
children: [
|
|
156
|
+
/* @__PURE__ */ jsx(RefreshCw, { className: "w-4 h-4 mr-2" }),
|
|
157
|
+
isKo ? "\uC0C8\uB85C\uACE0\uCE68" : "Refresh"
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
),
|
|
161
|
+
/* @__PURE__ */ jsxs(
|
|
162
|
+
Link,
|
|
163
|
+
{
|
|
164
|
+
href: "/",
|
|
165
|
+
className: "inline-flex items-center justify-center px-4 py-2.5 bg-gray-100 hover:bg-gray-200 dark:bg-gray-800 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300 font-medium rounded-lg transition-colors",
|
|
166
|
+
children: [
|
|
167
|
+
/* @__PURE__ */ jsx(Home, { className: "w-4 h-4 mr-2" }),
|
|
168
|
+
isKo ? "\uD648\uC73C\uB85C" : "Go Home"
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
)
|
|
172
|
+
] }),
|
|
173
|
+
displayInfo.action && /* @__PURE__ */ jsxs("p", { className: "mt-6 text-sm text-gray-500 dark:text-gray-500 flex items-center justify-center gap-1", children: [
|
|
174
|
+
/* @__PURE__ */ jsx(HelpCircle, { className: "w-4 h-4" }),
|
|
175
|
+
displayInfo.action
|
|
176
|
+
] })
|
|
177
|
+
] }) });
|
|
178
|
+
}
|
|
179
|
+
return this.props.children;
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
function ErrorCard({
|
|
183
|
+
code,
|
|
184
|
+
message,
|
|
185
|
+
locale = "ko",
|
|
186
|
+
onRetry,
|
|
187
|
+
className
|
|
188
|
+
}) {
|
|
189
|
+
const errorCode = code || 50002;
|
|
190
|
+
const displayInfo = getErrorDisplayInfo(errorCode, locale);
|
|
191
|
+
const isKo = locale === "ko";
|
|
192
|
+
return /* @__PURE__ */ jsx("div", { className: `bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 ${className || ""}`, children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
193
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "w-5 h-5 text-red-500 flex-shrink-0 mt-0.5" }),
|
|
194
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
195
|
+
/* @__PURE__ */ jsx("h4", { className: "font-medium text-red-800 dark:text-red-200", children: message || displayInfo.title }),
|
|
196
|
+
/* @__PURE__ */ jsxs("p", { className: "text-sm text-red-600 dark:text-red-300 mt-1", children: [
|
|
197
|
+
displayInfo.description,
|
|
198
|
+
" [",
|
|
199
|
+
errorCode,
|
|
200
|
+
"]"
|
|
201
|
+
] }),
|
|
202
|
+
onRetry && /* @__PURE__ */ jsxs(
|
|
203
|
+
"button",
|
|
204
|
+
{
|
|
205
|
+
onClick: onRetry,
|
|
206
|
+
className: "mt-3 text-sm text-red-600 dark:text-red-400 hover:underline flex items-center gap-1",
|
|
207
|
+
children: [
|
|
208
|
+
/* @__PURE__ */ jsx(RefreshCw, { className: "w-3 h-3" }),
|
|
209
|
+
isKo ? "\uB2E4\uC2DC \uC2DC\uB3C4" : "Try again"
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
)
|
|
213
|
+
] })
|
|
214
|
+
] }) });
|
|
215
|
+
}
|
|
216
|
+
function InlineError({
|
|
217
|
+
code,
|
|
218
|
+
message,
|
|
219
|
+
locale = "ko"
|
|
220
|
+
}) {
|
|
221
|
+
if (!code && !message) return null;
|
|
222
|
+
const displayInfo = code ? getErrorDisplayInfo(code, locale) : null;
|
|
223
|
+
const displayMessage = message || (displayInfo == null ? void 0 : displayInfo.description) || "";
|
|
224
|
+
return /* @__PURE__ */ jsxs("p", { className: "text-sm text-red-600 dark:text-red-400 mt-1 flex items-center gap-1", children: [
|
|
225
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "w-3 h-3" }),
|
|
226
|
+
displayMessage,
|
|
227
|
+
" ",
|
|
228
|
+
code && /* @__PURE__ */ jsxs("span", { className: "text-red-400", children: [
|
|
229
|
+
"[",
|
|
230
|
+
code,
|
|
231
|
+
"]"
|
|
232
|
+
] })
|
|
233
|
+
] });
|
|
234
|
+
}
|
|
235
|
+
export {
|
|
236
|
+
AppError,
|
|
237
|
+
BaseTransport,
|
|
238
|
+
CircuitBreaker,
|
|
239
|
+
ConsoleTransport,
|
|
240
|
+
ECircuitState,
|
|
241
|
+
ELogLevel,
|
|
242
|
+
ERROR_CODES,
|
|
243
|
+
EmptyState,
|
|
244
|
+
ErrorAlert,
|
|
245
|
+
ErrorBoundary,
|
|
246
|
+
ErrorCard,
|
|
247
|
+
ErrorLogger,
|
|
248
|
+
ErrorPage,
|
|
249
|
+
ErrorResponse,
|
|
250
|
+
FeatureDegradation,
|
|
251
|
+
FileTransport,
|
|
252
|
+
HTTP_STATUS,
|
|
253
|
+
InlineError,
|
|
254
|
+
LoadingState,
|
|
255
|
+
LocaleDetector,
|
|
256
|
+
SentryTransport,
|
|
257
|
+
SlackTransport,
|
|
258
|
+
errorToResponse,
|
|
259
|
+
extractErrorInfo,
|
|
260
|
+
formatErrorMessage,
|
|
261
|
+
formatFriendlyError,
|
|
262
|
+
formatInlineError,
|
|
263
|
+
getAllErrorCodes,
|
|
264
|
+
getAllMessages,
|
|
265
|
+
getDefaultErrorCode,
|
|
266
|
+
getDefaultErrorMessage,
|
|
267
|
+
getErrorByCode,
|
|
268
|
+
getErrorCategory,
|
|
269
|
+
getErrorCodesByCategory,
|
|
270
|
+
getErrorDisplayInfo2 as getErrorDisplayInfo,
|
|
271
|
+
getErrorIcon,
|
|
272
|
+
getErrorInfo,
|
|
273
|
+
getErrorMessage,
|
|
274
|
+
getFriendlyMessage,
|
|
275
|
+
getHttpStatus,
|
|
276
|
+
getLogLevel,
|
|
277
|
+
handleApiResponse,
|
|
278
|
+
hasMessage,
|
|
279
|
+
isLocaleSupported,
|
|
280
|
+
processError,
|
|
281
|
+
showFriendlyError,
|
|
282
|
+
supportedLocales,
|
|
283
|
+
useErrorHandler,
|
|
284
|
+
withErrorHandler,
|
|
285
|
+
withFallback,
|
|
286
|
+
withFallbackChain,
|
|
287
|
+
withFallbackFn,
|
|
288
|
+
withRetry
|
|
289
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ErrorLogger 클래스
|
|
3
|
+
*
|
|
4
|
+
* 구조화된 에러 로깅
|
|
5
|
+
*/
|
|
6
|
+
import { AppError } from '@withwiz/error/app-error';
|
|
7
|
+
import type { IErrorLogContext, ITransport, IErrorLoggerOptions } from './types';
|
|
8
|
+
/**
|
|
9
|
+
* ErrorLogger 클래스
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const logger = new ErrorLogger({
|
|
14
|
+
* minLevel: ELogLevel.INFO,
|
|
15
|
+
* environment: 'production',
|
|
16
|
+
* transports: [consoleTransport, sentryTransport],
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* logger.error('API Error', {
|
|
20
|
+
* requestId: 'abc-123',
|
|
21
|
+
* errorCode: 50001,
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare class ErrorLogger {
|
|
26
|
+
private options;
|
|
27
|
+
private transports;
|
|
28
|
+
constructor(options?: IErrorLoggerOptions);
|
|
29
|
+
/**
|
|
30
|
+
* Transport 추가
|
|
31
|
+
*/
|
|
32
|
+
addTransport(transport: ITransport): void;
|
|
33
|
+
/**
|
|
34
|
+
* Transport 제거
|
|
35
|
+
*/
|
|
36
|
+
removeTransport(transportName: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* Debug 로그
|
|
39
|
+
*/
|
|
40
|
+
debug(message: string, context?: IErrorLogContext): void;
|
|
41
|
+
/**
|
|
42
|
+
* Info 로그
|
|
43
|
+
*/
|
|
44
|
+
info(message: string, context?: IErrorLogContext): void;
|
|
45
|
+
/**
|
|
46
|
+
* Warning 로그
|
|
47
|
+
*/
|
|
48
|
+
warn(message: string, context?: IErrorLogContext): void;
|
|
49
|
+
/**
|
|
50
|
+
* Error 로그
|
|
51
|
+
*/
|
|
52
|
+
error(message: string, context?: IErrorLogContext, error?: AppError | Error): void;
|
|
53
|
+
/**
|
|
54
|
+
* Critical 로그
|
|
55
|
+
*/
|
|
56
|
+
critical(message: string, context?: IErrorLogContext, error?: AppError | Error): void;
|
|
57
|
+
/**
|
|
58
|
+
* 로그 기록
|
|
59
|
+
*/
|
|
60
|
+
private log;
|
|
61
|
+
/**
|
|
62
|
+
* 로그 레벨 체크
|
|
63
|
+
*/
|
|
64
|
+
private shouldLog;
|
|
65
|
+
/**
|
|
66
|
+
* 컨텍스트 보강
|
|
67
|
+
*/
|
|
68
|
+
private enrichContext;
|
|
69
|
+
/**
|
|
70
|
+
* Transport로 전송
|
|
71
|
+
*/
|
|
72
|
+
private sendToTransports;
|
|
73
|
+
/**
|
|
74
|
+
* AppError 로깅 헬퍼
|
|
75
|
+
*/
|
|
76
|
+
logAppError(error: AppError, context?: IErrorLogContext): void;
|
|
77
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import "../../chunk-7XFHGAJP.js";
|
|
2
|
+
import "../../chunk-COK4ZXNG.js";
|
|
3
|
+
import {
|
|
4
|
+
ConsoleTransport
|
|
5
|
+
} from "../../chunk-FW3IEJ7H.js";
|
|
6
|
+
import {
|
|
7
|
+
FileTransport
|
|
8
|
+
} from "../../chunk-YJ3TLEW3.js";
|
|
9
|
+
import {
|
|
10
|
+
SentryTransport
|
|
11
|
+
} from "../../chunk-ZZIKRBJU.js";
|
|
12
|
+
import {
|
|
13
|
+
SlackTransport
|
|
14
|
+
} from "../../chunk-EQYTE7WD.js";
|
|
15
|
+
import {
|
|
16
|
+
BaseTransport
|
|
17
|
+
} from "../../chunk-HGC4CCKB.js";
|
|
18
|
+
import {
|
|
19
|
+
ErrorLogger
|
|
20
|
+
} from "../../chunk-JS5VI3OW.js";
|
|
21
|
+
import {
|
|
22
|
+
ELogLevel
|
|
23
|
+
} from "../../chunk-6C7HQIX4.js";
|
|
24
|
+
import "../../chunk-MLGO3HLS.js";
|
|
25
|
+
import "../../chunk-Y3OTJH2S.js";
|
|
26
|
+
import "../../chunk-ORMEWXMH.js";
|
|
27
|
+
export {
|
|
28
|
+
BaseTransport,
|
|
29
|
+
ConsoleTransport,
|
|
30
|
+
ELogLevel,
|
|
31
|
+
ErrorLogger,
|
|
32
|
+
FileTransport,
|
|
33
|
+
SentryTransport,
|
|
34
|
+
SlackTransport
|
|
35
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base Transport
|
|
3
|
+
*
|
|
4
|
+
* 모든 Transport의 기본 클래스
|
|
5
|
+
*/
|
|
6
|
+
import type { ITransport, ILogEntry } from '@withwiz/error/logging/types';
|
|
7
|
+
/**
|
|
8
|
+
* BaseTransport 추상 클래스
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class BaseTransport implements ITransport {
|
|
11
|
+
readonly name: string;
|
|
12
|
+
protected enabled: boolean;
|
|
13
|
+
constructor(name: string, enabled?: boolean);
|
|
14
|
+
/**
|
|
15
|
+
* 로그 전송 (구현 필요)
|
|
16
|
+
*/
|
|
17
|
+
abstract log(entry: ILogEntry): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Transport 활성화 여부
|
|
20
|
+
*/
|
|
21
|
+
isEnabled(): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Transport 활성화
|
|
24
|
+
*/
|
|
25
|
+
enable(): void;
|
|
26
|
+
/**
|
|
27
|
+
* Transport 비활성화
|
|
28
|
+
*/
|
|
29
|
+
disable(): void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Console Transport
|
|
3
|
+
*
|
|
4
|
+
* 콘솔에 로그 출력
|
|
5
|
+
*/
|
|
6
|
+
import { BaseTransport } from './base';
|
|
7
|
+
import type { ILogEntry } from '@withwiz/error/logging/types';
|
|
8
|
+
/**
|
|
9
|
+
* ConsoleTransport 옵션
|
|
10
|
+
*/
|
|
11
|
+
export interface IConsoleTransportOptions {
|
|
12
|
+
enabled?: boolean;
|
|
13
|
+
colorize?: boolean;
|
|
14
|
+
includeTimestamp?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* ConsoleTransport 클래스
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const transport = new ConsoleTransport({
|
|
22
|
+
* colorize: true,
|
|
23
|
+
* includeTimestamp: true,
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare class ConsoleTransport extends BaseTransport {
|
|
28
|
+
private colorize;
|
|
29
|
+
private includeTimestamp;
|
|
30
|
+
constructor(options?: IConsoleTransportOptions);
|
|
31
|
+
log(entry: ILogEntry): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* 로그 포맷팅
|
|
34
|
+
*/
|
|
35
|
+
private format;
|
|
36
|
+
/**
|
|
37
|
+
* 콘솔 출력
|
|
38
|
+
*/
|
|
39
|
+
private output;
|
|
40
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File Transport
|
|
3
|
+
*
|
|
4
|
+
* 파일에 로그 기록 (서버 전용)
|
|
5
|
+
*/
|
|
6
|
+
import { BaseTransport } from './base';
|
|
7
|
+
import type { ILogEntry } from '@withwiz/error/logging/types';
|
|
8
|
+
/**
|
|
9
|
+
* FileTransport 옵션
|
|
10
|
+
*/
|
|
11
|
+
export interface IFileTransportOptions {
|
|
12
|
+
enabled?: boolean;
|
|
13
|
+
filePath?: string;
|
|
14
|
+
maxSize?: number;
|
|
15
|
+
maxFiles?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* FileTransport 클래스
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const transport = new FileTransport({
|
|
23
|
+
* filePath: './logs/error.log',
|
|
24
|
+
* maxSize: 10 * 1024 * 1024, // 10MB
|
|
25
|
+
* maxFiles: 5,
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare class FileTransport extends BaseTransport {
|
|
30
|
+
private filePath;
|
|
31
|
+
private maxSize;
|
|
32
|
+
private maxFiles;
|
|
33
|
+
private fs;
|
|
34
|
+
private path;
|
|
35
|
+
constructor(options?: IFileTransportOptions);
|
|
36
|
+
/**
|
|
37
|
+
* 모듈 로드 (동적 import)
|
|
38
|
+
*/
|
|
39
|
+
private loadModules;
|
|
40
|
+
log(entry: ILogEntry): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* 로그 포맷팅 (JSON Lines)
|
|
43
|
+
*/
|
|
44
|
+
private format;
|
|
45
|
+
/**
|
|
46
|
+
* 파일 rotation
|
|
47
|
+
*/
|
|
48
|
+
private rotateIfNeeded;
|
|
49
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transport 모듈
|
|
3
|
+
*/
|
|
4
|
+
export { BaseTransport } from './base';
|
|
5
|
+
export { ConsoleTransport } from './console';
|
|
6
|
+
export type { IConsoleTransportOptions } from './console';
|
|
7
|
+
export { FileTransport } from './file';
|
|
8
|
+
export type { IFileTransportOptions } from './file';
|
|
9
|
+
export { SentryTransport } from './sentry';
|
|
10
|
+
export type { ISentryTransportOptions } from './sentry';
|
|
11
|
+
export { SlackTransport } from './slack';
|
|
12
|
+
export type { ISlackTransportOptions } from './slack';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import "../../../chunk-COK4ZXNG.js";
|
|
2
|
+
import {
|
|
3
|
+
ConsoleTransport
|
|
4
|
+
} from "../../../chunk-FW3IEJ7H.js";
|
|
5
|
+
import {
|
|
6
|
+
FileTransport
|
|
7
|
+
} from "../../../chunk-YJ3TLEW3.js";
|
|
8
|
+
import {
|
|
9
|
+
SentryTransport
|
|
10
|
+
} from "../../../chunk-ZZIKRBJU.js";
|
|
11
|
+
import {
|
|
12
|
+
SlackTransport
|
|
13
|
+
} from "../../../chunk-EQYTE7WD.js";
|
|
14
|
+
import {
|
|
15
|
+
BaseTransport
|
|
16
|
+
} from "../../../chunk-HGC4CCKB.js";
|
|
17
|
+
import "../../../chunk-6C7HQIX4.js";
|
|
18
|
+
import "../../../chunk-ORMEWXMH.js";
|
|
19
|
+
export {
|
|
20
|
+
BaseTransport,
|
|
21
|
+
ConsoleTransport,
|
|
22
|
+
FileTransport,
|
|
23
|
+
SentryTransport,
|
|
24
|
+
SlackTransport
|
|
25
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sentry Transport
|
|
3
|
+
*
|
|
4
|
+
* Sentry로 에러 전송
|
|
5
|
+
*/
|
|
6
|
+
import { BaseTransport } from './base';
|
|
7
|
+
import type { ILogEntry, ELogLevel } from '@withwiz/error/logging/types';
|
|
8
|
+
/**
|
|
9
|
+
* SentryTransport 옵션
|
|
10
|
+
*/
|
|
11
|
+
export interface ISentryTransportOptions {
|
|
12
|
+
enabled?: boolean;
|
|
13
|
+
dsn?: string;
|
|
14
|
+
environment?: string;
|
|
15
|
+
minLevel?: ELogLevel;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* SentryTransport 클래스
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const transport = new SentryTransport({
|
|
23
|
+
* dsn: process.env.SENTRY_DSN,
|
|
24
|
+
* environment: 'production',
|
|
25
|
+
* minLevel: ELogLevel.ERROR,
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare class SentryTransport extends BaseTransport {
|
|
30
|
+
private dsn;
|
|
31
|
+
private environment;
|
|
32
|
+
private minLevel;
|
|
33
|
+
private Sentry;
|
|
34
|
+
constructor(options?: ISentryTransportOptions);
|
|
35
|
+
/**
|
|
36
|
+
* Sentry 초기화
|
|
37
|
+
*/
|
|
38
|
+
private initSentry;
|
|
39
|
+
log(entry: ILogEntry): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* 로그 레벨 체크
|
|
42
|
+
*/
|
|
43
|
+
private shouldLog;
|
|
44
|
+
}
|