@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.
Files changed (380) hide show
  1. package/README.md +162 -0
  2. package/dist/auth/adapters/prisma/index.d.ts +43 -0
  3. package/dist/auth/adapters/prisma/index.js +284 -0
  4. package/dist/auth/core/email/token-generator.d.ts +43 -0
  5. package/dist/auth/core/email/token-generator.js +7 -0
  6. package/dist/auth/core/jwt/client.d.ts +87 -0
  7. package/dist/auth/core/jwt/client.js +36 -0
  8. package/dist/auth/core/jwt/index.d.ts +110 -0
  9. package/dist/auth/core/jwt/index.js +10 -0
  10. package/dist/auth/core/jwt/types.d.ts +6 -0
  11. package/dist/auth/core/jwt/types.js +13 -0
  12. package/dist/auth/core/oauth/index.d.ts +51 -0
  13. package/dist/auth/core/oauth/index.js +12 -0
  14. package/dist/auth/core/password/client-helper.d.ts +44 -0
  15. package/dist/auth/core/password/client-helper.js +28 -0
  16. package/dist/auth/core/password/index.d.ts +71 -0
  17. package/dist/auth/core/password/index.js +14 -0
  18. package/dist/auth/errors/index.d.ts +49 -0
  19. package/dist/auth/errors/index.js +17 -0
  20. package/dist/auth/index.d.ts +21 -0
  21. package/dist/auth/index.js +97 -0
  22. package/dist/auth/types/index.d.ts +213 -0
  23. package/dist/auth/types/index.js +13 -0
  24. package/dist/cache/cache-config.d.ts +73 -0
  25. package/dist/cache/cache-config.js +12 -0
  26. package/dist/cache/cache-defaults.d.ts +141 -0
  27. package/dist/cache/cache-defaults.js +33 -0
  28. package/dist/cache/cache-env.d.ts +75 -0
  29. package/dist/cache/cache-env.js +25 -0
  30. package/dist/cache/cache-factory.d.ts +34 -0
  31. package/dist/cache/cache-factory.js +28 -0
  32. package/dist/cache/cache-invalidation.d.ts +90 -0
  33. package/dist/cache/cache-invalidation.js +24 -0
  34. package/dist/cache/cache-keys-legacy.d.ts +35 -0
  35. package/dist/cache/cache-keys-legacy.js +7 -0
  36. package/dist/cache/cache-redis.d.ts +74 -0
  37. package/dist/cache/cache-redis.js +24 -0
  38. package/dist/cache/cache-types.d.ts +151 -0
  39. package/dist/cache/cache-types.js +9 -0
  40. package/dist/cache/cache-wrapper.d.ts +27 -0
  41. package/dist/cache/cache-wrapper.js +22 -0
  42. package/dist/cache/cache.d.ts +14 -0
  43. package/dist/cache/cache.js +112 -0
  44. package/dist/cache/hybrid-cache-manager.d.ts +148 -0
  45. package/dist/cache/hybrid-cache-manager.js +13 -0
  46. package/dist/cache/index.d.ts +21 -0
  47. package/dist/cache/index.js +112 -0
  48. package/dist/cache/inmemory-cache-manager.d.ts +163 -0
  49. package/dist/cache/inmemory-cache-manager.js +9 -0
  50. package/dist/cache/noop-cache-manager.d.ts +36 -0
  51. package/dist/cache/noop-cache-manager.js +11 -0
  52. package/dist/cache/redis-cache-manager.d.ts +34 -0
  53. package/dist/cache/redis-cache-manager.js +11 -0
  54. package/dist/chunk-26Y7VEYG.js +93 -0
  55. package/dist/chunk-2DVWSDST.js +119 -0
  56. package/dist/chunk-2KAPUVIS.js +155 -0
  57. package/dist/chunk-2TO7WUKK.js +93 -0
  58. package/dist/chunk-34WAGUT5.js +117 -0
  59. package/dist/chunk-3DZA6AGS.js +120 -0
  60. package/dist/chunk-4DPSCTX4.js +212 -0
  61. package/dist/chunk-4KJXENRM.js +64 -0
  62. package/dist/chunk-4NWJ3WCZ.js +28 -0
  63. package/dist/chunk-4ODT3Q4A.js +86 -0
  64. package/dist/chunk-5ATB5D6S.js +40 -0
  65. package/dist/chunk-62FLBG6B.js +34 -0
  66. package/dist/chunk-62Q7DN5G.js +25 -0
  67. package/dist/chunk-65LHDFU3.js +242 -0
  68. package/dist/chunk-6C7HQIX4.js +13 -0
  69. package/dist/chunk-6D3HHYER.js +32 -0
  70. package/dist/chunk-6LTZCXNC.js +326 -0
  71. package/dist/chunk-7VJNLGAS.js +110 -0
  72. package/dist/chunk-7XFHGAJP.js +0 -0
  73. package/dist/chunk-A6EAAWMK.js +50 -0
  74. package/dist/chunk-AHDPGRXS.js +51 -0
  75. package/dist/chunk-AIH3F7JV.js +76 -0
  76. package/dist/chunk-AIHQBQ3E.js +109 -0
  77. package/dist/chunk-BKGVSC6S.js +152 -0
  78. package/dist/chunk-COK4ZXNG.js +0 -0
  79. package/dist/chunk-DEEJBDJE.js +47 -0
  80. package/dist/chunk-DH2ZHGW2.js +53 -0
  81. package/dist/chunk-EBUEBEJX.js +0 -0
  82. package/dist/chunk-EEUBKZV4.js +54 -0
  83. package/dist/chunk-EQYTE7WD.js +139 -0
  84. package/dist/chunk-EUQATJLI.js +180 -0
  85. package/dist/chunk-EZC6ETFW.js +80 -0
  86. package/dist/chunk-EZR55KV2.js +249 -0
  87. package/dist/chunk-F6LCSFSU.js +31 -0
  88. package/dist/chunk-FOKAATUQ.js +62 -0
  89. package/dist/chunk-FW3IEJ7H.js +71 -0
  90. package/dist/chunk-G26T2PRQ.js +53 -0
  91. package/dist/chunk-G4NI37NN.js +257 -0
  92. package/dist/chunk-GCZOXUDV.js +132 -0
  93. package/dist/chunk-GDWEDUHO.js +55 -0
  94. package/dist/chunk-GL2NANFH.js +434 -0
  95. package/dist/chunk-GPBOMJSZ.js +136 -0
  96. package/dist/chunk-H5I5GWAA.js +94 -0
  97. package/dist/chunk-HGC4CCKB.js +29 -0
  98. package/dist/chunk-HV3DGSSH.js +447 -0
  99. package/dist/chunk-I47QEDTX.js +193 -0
  100. package/dist/chunk-IAJNC34M.js +102 -0
  101. package/dist/chunk-IHXRF3BH.js +215 -0
  102. package/dist/chunk-IJEZ7G7S.js +26 -0
  103. package/dist/chunk-IQQKKUAV.js +151 -0
  104. package/dist/chunk-JBCDEAMW.js +35 -0
  105. package/dist/chunk-JLLMTTQ4.js +75 -0
  106. package/dist/chunk-JS5VI3OW.js +143 -0
  107. package/dist/chunk-KAWVMIRJ.js +44 -0
  108. package/dist/chunk-KMCJIL57.js +214 -0
  109. package/dist/chunk-KWTBD4CM.js +145 -0
  110. package/dist/chunk-KXAWBFJN.js +310 -0
  111. package/dist/chunk-L25BNU3E.js +56 -0
  112. package/dist/chunk-L76O3X3D.js +197 -0
  113. package/dist/chunk-LNV2E4I6.js +63 -0
  114. package/dist/chunk-MLGO3HLS.js +329 -0
  115. package/dist/chunk-MRJE6OX5.js +22 -0
  116. package/dist/chunk-MYLGYX4K.js +57 -0
  117. package/dist/chunk-N4YGR5WH.js +310 -0
  118. package/dist/chunk-OIVXOT2X.js +80 -0
  119. package/dist/chunk-ORMEWXMH.js +37 -0
  120. package/dist/chunk-POKGHK3L.js +57 -0
  121. package/dist/chunk-Q7IP4JMW.js +69 -0
  122. package/dist/chunk-RJUVBBZG.js +27 -0
  123. package/dist/chunk-S73334QY.js +89 -0
  124. package/dist/chunk-SLG26KHZ.js +101 -0
  125. package/dist/chunk-SR65BF6X.js +82 -0
  126. package/dist/chunk-SS56XFLI.js +19 -0
  127. package/dist/chunk-T3LJYAMO.js +277 -0
  128. package/dist/chunk-TDZJ6SAI.js +34 -0
  129. package/dist/chunk-TEIYA7U4.js +72 -0
  130. package/dist/chunk-TMVS4F7E.js +88 -0
  131. package/dist/chunk-TRBKJ7JT.js +137 -0
  132. package/dist/chunk-TXGNSECL.js +84 -0
  133. package/dist/chunk-TZAP5T4N.js +188 -0
  134. package/dist/chunk-UCYQNHST.js +24 -0
  135. package/dist/chunk-ULF5RDDX.js +0 -0
  136. package/dist/chunk-UXQRU3EM.js +167 -0
  137. package/dist/chunk-V5K5FYU7.js +200 -0
  138. package/dist/chunk-VDXB5DCY.js +68 -0
  139. package/dist/chunk-VSGKVZB4.js +47 -0
  140. package/dist/chunk-VWODEQ5C.js +204 -0
  141. package/dist/chunk-WDUFQFDP.js +193 -0
  142. package/dist/chunk-WHR7HPWF.js +126 -0
  143. package/dist/chunk-WSQMXMTL.js +122 -0
  144. package/dist/chunk-XHZ5L4FO.js +103 -0
  145. package/dist/chunk-XPASCCUA.js +404 -0
  146. package/dist/chunk-XRRPEBKB.js +231 -0
  147. package/dist/chunk-Y2TUZFCP.js +0 -0
  148. package/dist/chunk-Y3OTJH2S.js +473 -0
  149. package/dist/chunk-YBSHN67U.js +161 -0
  150. package/dist/chunk-YJ3TLEW3.js +100 -0
  151. package/dist/chunk-YJWLWUFK.js +105 -0
  152. package/dist/chunk-Z4D4CMDA.js +488 -0
  153. package/dist/chunk-ZHVUK5OY.js +314 -0
  154. package/dist/chunk-ZTN4X5FN.js +29 -0
  155. package/dist/chunk-ZZIKRBJU.js +96 -0
  156. package/dist/components/ui/Alert.d.ts +12 -0
  157. package/dist/components/ui/Alert.js +10 -0
  158. package/dist/components/ui/Badge.d.ts +7 -0
  159. package/dist/components/ui/Badge.js +8 -0
  160. package/dist/components/ui/Button.d.ts +7 -0
  161. package/dist/components/ui/Button.js +8 -0
  162. package/dist/components/ui/DataTable.d.ts +103 -0
  163. package/dist/components/ui/DataTable.js +606 -0
  164. package/dist/components/ui/DomainDisplay.d.ts +12 -0
  165. package/dist/components/ui/DomainDisplay.js +31 -0
  166. package/dist/components/ui/Input.d.ts +5 -0
  167. package/dist/components/ui/Input.js +8 -0
  168. package/dist/components/ui/Label.d.ts +5 -0
  169. package/dist/components/ui/Label.js +8 -0
  170. package/dist/components/ui/Pagination.d.ts +42 -0
  171. package/dist/components/ui/Pagination.js +20 -0
  172. package/dist/components/ui/Select.d.ts +15 -0
  173. package/dist/components/ui/Select.js +27 -0
  174. package/dist/components/ui/Skeleton.d.ts +6 -0
  175. package/dist/components/ui/Skeleton.js +8 -0
  176. package/dist/components/ui/TimezoneDisplay.d.ts +22 -0
  177. package/dist/components/ui/TimezoneDisplay.js +83 -0
  178. package/dist/components/ui/Tooltip.d.ts +21 -0
  179. package/dist/components/ui/Tooltip.js +94 -0
  180. package/dist/components/ui/WorldMapChart.d.ts +17 -0
  181. package/dist/components/ui/WorldMapChart.js +250 -0
  182. package/dist/components/ui/loading-bar.d.ts +20 -0
  183. package/dist/components/ui/loading-bar.js +15 -0
  184. package/dist/constants/error-codes.d.ts +389 -0
  185. package/dist/constants/error-codes.js +27 -0
  186. package/dist/constants/index.d.ts +11 -0
  187. package/dist/constants/index.js +85 -0
  188. package/dist/constants/messages.d.ts +83 -0
  189. package/dist/constants/messages.js +13 -0
  190. package/dist/constants/pagination.d.ts +43 -0
  191. package/dist/constants/pagination.js +15 -0
  192. package/dist/constants/security.d.ts +66 -0
  193. package/dist/constants/security.js +23 -0
  194. package/dist/constants/validation.d.ts +60 -0
  195. package/dist/constants/validation.js +19 -0
  196. package/dist/error/ErrorBoundary.d.ts +47 -0
  197. package/dist/error/app-error.d.ts +144 -0
  198. package/dist/error/app-error.js +10 -0
  199. package/dist/error/components/EmptyState.d.ts +50 -0
  200. package/dist/error/components/ErrorAlert.d.ts +50 -0
  201. package/dist/error/components/ErrorPage.d.ts +39 -0
  202. package/dist/error/components/LoadingState.d.ts +37 -0
  203. package/dist/error/components/index.d.ts +13 -0
  204. package/dist/error/components/index.js +18 -0
  205. package/dist/error/core/locale-detector.d.ts +44 -0
  206. package/dist/error/core/locale-detector.js +9 -0
  207. package/dist/error/error-display.d.ts +55 -0
  208. package/dist/error/error-display.js +24 -0
  209. package/dist/error/error-handler.d.ts +118 -0
  210. package/dist/error/error-handler.js +18 -0
  211. package/dist/error/friendly-messages-v2.d.ts +46 -0
  212. package/dist/error/friendly-messages-v2.js +15 -0
  213. package/dist/error/friendly-messages.d.ts +22 -0
  214. package/dist/error/friendly-messages.js +12 -0
  215. package/dist/error/hooks/index.d.ts +7 -0
  216. package/dist/error/hooks/index.js +14 -0
  217. package/dist/error/hooks/useErrorHandler.d.ts +67 -0
  218. package/dist/error/hooks/useErrorHandler.js +14 -0
  219. package/dist/error/index.d.ts +26 -0
  220. package/dist/error/index.js +289 -0
  221. package/dist/error/logging/error-logger.d.ts +77 -0
  222. package/dist/error/logging/error-logger.js +10 -0
  223. package/dist/error/logging/index.d.ts +9 -0
  224. package/dist/error/logging/index.js +35 -0
  225. package/dist/error/logging/transports/base.d.ts +30 -0
  226. package/dist/error/logging/transports/base.js +7 -0
  227. package/dist/error/logging/transports/console.d.ts +40 -0
  228. package/dist/error/logging/transports/console.js +9 -0
  229. package/dist/error/logging/transports/file.d.ts +49 -0
  230. package/dist/error/logging/transports/file.js +8 -0
  231. package/dist/error/logging/transports/index.d.ts +12 -0
  232. package/dist/error/logging/transports/index.js +25 -0
  233. package/dist/error/logging/transports/sentry.d.ts +44 -0
  234. package/dist/error/logging/transports/sentry.js +9 -0
  235. package/dist/error/logging/transports/slack.d.ts +51 -0
  236. package/dist/error/logging/transports/slack.js +9 -0
  237. package/dist/error/logging/types.d.ts +83 -0
  238. package/dist/error/logging/types.js +7 -0
  239. package/dist/error/messages/en.d.ts +5 -0
  240. package/dist/error/messages/en.js +7 -0
  241. package/dist/error/messages/index.d.ts +40 -0
  242. package/dist/error/messages/index.js +17 -0
  243. package/dist/error/messages/ko.d.ts +5 -0
  244. package/dist/error/messages/ko.js +7 -0
  245. package/dist/error/messages/types.d.ts +30 -0
  246. package/dist/error/messages/types.js +0 -0
  247. package/dist/error/recovery/circuit-breaker.d.ts +85 -0
  248. package/dist/error/recovery/circuit-breaker.js +9 -0
  249. package/dist/error/recovery/degradation.d.ts +56 -0
  250. package/dist/error/recovery/degradation.js +7 -0
  251. package/dist/error/recovery/fallback.d.ts +55 -0
  252. package/dist/error/recovery/fallback.js +11 -0
  253. package/dist/error/recovery/index.d.ts +12 -0
  254. package/dist/error/recovery/index.js +26 -0
  255. package/dist/error/recovery/retry.d.ts +44 -0
  256. package/dist/error/recovery/retry.js +7 -0
  257. package/dist/geolocation/batch-processor.d.ts +33 -0
  258. package/dist/geolocation/batch-processor.js +10 -0
  259. package/dist/geolocation/index.d.ts +14 -0
  260. package/dist/geolocation/index.js +36 -0
  261. package/dist/geolocation/providers/base-provider.d.ts +33 -0
  262. package/dist/geolocation/providers/base-provider.js +9 -0
  263. package/dist/geolocation/providers/index.d.ts +54 -0
  264. package/dist/geolocation/providers/index.js +29 -0
  265. package/dist/geolocation/providers/ip-api-provider.d.ts +17 -0
  266. package/dist/geolocation/providers/ip-api-provider.js +8 -0
  267. package/dist/geolocation/providers/ipapi-co-provider.d.ts +17 -0
  268. package/dist/geolocation/providers/ipapi-co-provider.js +8 -0
  269. package/dist/geolocation/providers/ipgeolocation-provider.d.ts +18 -0
  270. package/dist/geolocation/providers/ipgeolocation-provider.js +8 -0
  271. package/dist/geolocation/providers/maxmind-provider.d.ts +18 -0
  272. package/dist/geolocation/providers/maxmind-provider.js +8 -0
  273. package/dist/hooks/useDataTable.d.ts +51 -0
  274. package/dist/hooks/useDataTable.js +149 -0
  275. package/dist/hooks/useDebounce.d.ts +7 -0
  276. package/dist/hooks/useDebounce.js +7 -0
  277. package/dist/hooks/useExitIntent.d.ts +35 -0
  278. package/dist/hooks/useExitIntent.js +72 -0
  279. package/dist/hooks/useTimezone.d.ts +19 -0
  280. package/dist/hooks/useTimezone.js +11 -0
  281. package/dist/logger/logger.d.ts +11 -0
  282. package/dist/logger/logger.js +17 -0
  283. package/dist/middleware/auth.d.ts +87 -0
  284. package/dist/middleware/auth.js +20 -0
  285. package/dist/middleware/cors.d.ts +30 -0
  286. package/dist/middleware/cors.js +10 -0
  287. package/dist/middleware/error-handler.d.ts +23 -0
  288. package/dist/middleware/error-handler.js +13 -0
  289. package/dist/middleware/index.d.ts +16 -0
  290. package/dist/middleware/index.js +72 -0
  291. package/dist/middleware/init-request.d.ts +18 -0
  292. package/dist/middleware/init-request.js +8 -0
  293. package/dist/middleware/middleware-chain.d.ts +53 -0
  294. package/dist/middleware/middleware-chain.js +8 -0
  295. package/dist/middleware/rate-limit.d.ts +82 -0
  296. package/dist/middleware/rate-limit.js +14 -0
  297. package/dist/middleware/response-logger.d.ts +22 -0
  298. package/dist/middleware/response-logger.js +8 -0
  299. package/dist/middleware/security.d.ts +31 -0
  300. package/dist/middleware/security.js +9 -0
  301. package/dist/middleware/types.d.ts +45 -0
  302. package/dist/middleware/types.js +0 -0
  303. package/dist/middleware/wrappers.d.ts +91 -0
  304. package/dist/middleware/wrappers.js +32 -0
  305. package/dist/storage/r2-storage.d.ts +38 -0
  306. package/dist/storage/r2-storage.js +105 -0
  307. package/dist/system/cpu.d.ts +2 -0
  308. package/dist/system/cpu.js +9 -0
  309. package/dist/system/disk.d.ts +2 -0
  310. package/dist/system/disk.js +9 -0
  311. package/dist/system/environment.d.ts +8 -0
  312. package/dist/system/environment.js +9 -0
  313. package/dist/system/health-check.d.ts +26 -0
  314. package/dist/system/health-check.js +10 -0
  315. package/dist/system/index.d.ts +51 -0
  316. package/dist/system/index.js +194 -0
  317. package/dist/system/memory.d.ts +2 -0
  318. package/dist/system/memory.js +9 -0
  319. package/dist/system/network.d.ts +2 -0
  320. package/dist/system/network.js +9 -0
  321. package/dist/system/types.d.ts +93 -0
  322. package/dist/system/types.js +0 -0
  323. package/dist/system/utils.d.ts +12 -0
  324. package/dist/system/utils.js +26 -0
  325. package/dist/types/api.d.ts +80 -0
  326. package/dist/types/api.js +0 -0
  327. package/dist/types/database.d.ts +38 -0
  328. package/dist/types/database.js +0 -0
  329. package/dist/types/env.d.ts +105 -0
  330. package/dist/types/env.js +0 -0
  331. package/dist/types/geoip.d.ts +152 -0
  332. package/dist/types/geoip.js +0 -0
  333. package/dist/types/i18n.d.ts +11 -0
  334. package/dist/types/i18n.js +0 -0
  335. package/dist/types/qr-code.d.ts +139 -0
  336. package/dist/types/qr-code.js +75 -0
  337. package/dist/types/user.d.ts +54 -0
  338. package/dist/types/user.js +0 -0
  339. package/dist/utils/api-helpers.d.ts +147 -0
  340. package/dist/utils/api-helpers.js +30 -0
  341. package/dist/utils/client/client-utils.d.ts +3 -0
  342. package/dist/utils/client/client-utils.js +9 -0
  343. package/dist/utils/client/qr-code.d.ts +16 -0
  344. package/dist/utils/client/qr-code.js +215 -0
  345. package/dist/utils/cors.d.ts +40 -0
  346. package/dist/utils/cors.js +21 -0
  347. package/dist/utils/csv-export.d.ts +97 -0
  348. package/dist/utils/csv-export.js +20 -0
  349. package/dist/utils/error-message-formatter.d.ts +17 -0
  350. package/dist/utils/error-message-formatter.js +11 -0
  351. package/dist/utils/error-processor.d.ts +70 -0
  352. package/dist/utils/error-processor.js +34 -0
  353. package/dist/utils/format-number.d.ts +17 -0
  354. package/dist/utils/format-number.js +9 -0
  355. package/dist/utils/index.d.ts +13 -0
  356. package/dist/utils/index.js +160 -0
  357. package/dist/utils/input-validation.d.ts +88 -0
  358. package/dist/utils/input-validation.js +223 -0
  359. package/dist/utils/ip-utils.d.ts +15 -0
  360. package/dist/utils/ip-utils.js +91 -0
  361. package/dist/utils/optimistic-lock.d.ts +27 -0
  362. package/dist/utils/optimistic-lock.js +16 -0
  363. package/dist/utils/sanitizer.d.ts +72 -0
  364. package/dist/utils/sanitizer.js +19 -0
  365. package/dist/utils/shared-utils.d.ts +25 -0
  366. package/dist/utils/shared-utils.js +43 -0
  367. package/dist/utils/short-code-generator.d.ts +24 -0
  368. package/dist/utils/short-code-generator.js +9 -0
  369. package/dist/utils/timezone.d.ts +56 -0
  370. package/dist/utils/timezone.js +29 -0
  371. package/dist/utils/type-guards.d.ts +164 -0
  372. package/dist/utils/type-guards.js +59 -0
  373. package/dist/utils/url-normalizer.d.ts +53 -0
  374. package/dist/utils/url-normalizer.js +21 -0
  375. package/dist/validators/index.d.ts +7 -0
  376. package/dist/validators/index.js +13 -0
  377. package/dist/validators/password-validator.d.ts +86 -0
  378. package/dist/validators/password-validator.js +13 -0
  379. package/dist/world_countries-C2WUL2CQ.js +279 -0
  380. package/package.json +129 -0
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Slack Transport
3
+ *
4
+ * Slack Webhook으로 알림 전송
5
+ */
6
+ import { BaseTransport } from './base';
7
+ import type { ILogEntry, ELogLevel } from '@withwiz/error/logging/types';
8
+ /**
9
+ * SlackTransport 옵션
10
+ */
11
+ export interface ISlackTransportOptions {
12
+ enabled?: boolean;
13
+ webhookUrl?: string;
14
+ minLevel?: ELogLevel;
15
+ channel?: string;
16
+ username?: string;
17
+ iconEmoji?: string;
18
+ }
19
+ /**
20
+ * SlackTransport 클래스
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * const transport = new SlackTransport({
25
+ * webhookUrl: process.env.SLACK_WEBHOOK_URL,
26
+ * minLevel: ELogLevel.CRITICAL,
27
+ * channel: '#errors',
28
+ * });
29
+ * ```
30
+ */
31
+ export declare class SlackTransport extends BaseTransport {
32
+ private webhookUrl;
33
+ private minLevel;
34
+ private channel?;
35
+ private username;
36
+ private iconEmoji;
37
+ constructor(options?: ISlackTransportOptions);
38
+ log(entry: ILogEntry): Promise<void>;
39
+ /**
40
+ * Slack 메시지 페이로드 생성
41
+ */
42
+ private buildPayload;
43
+ /**
44
+ * 문자열 자르기
45
+ */
46
+ private truncate;
47
+ /**
48
+ * 로그 레벨 체크
49
+ */
50
+ private shouldLog;
51
+ }
@@ -0,0 +1,9 @@
1
+ import {
2
+ SlackTransport
3
+ } from "../../../chunk-EQYTE7WD.js";
4
+ import "../../../chunk-HGC4CCKB.js";
5
+ import "../../../chunk-6C7HQIX4.js";
6
+ import "../../../chunk-ORMEWXMH.js";
7
+ export {
8
+ SlackTransport
9
+ };
@@ -0,0 +1,83 @@
1
+ /**
2
+ * 로깅 시스템 타입 정의
3
+ */
4
+ import type { AppError } from '@withwiz/error/app-error';
5
+ /**
6
+ * 로그 레벨
7
+ */
8
+ export declare enum ELogLevel {
9
+ DEBUG = "debug",
10
+ INFO = "info",
11
+ WARN = "warn",
12
+ ERROR = "error",
13
+ CRITICAL = "critical"
14
+ }
15
+ /**
16
+ * 에러 로그 컨텍스트
17
+ */
18
+ export interface IErrorLogContext {
19
+ requestId?: string;
20
+ method?: string;
21
+ path?: string;
22
+ userAgent?: string;
23
+ ip?: string;
24
+ userId?: string;
25
+ userEmail?: string;
26
+ userRole?: string;
27
+ errorCode?: number;
28
+ errorMessage?: string;
29
+ errorStack?: string;
30
+ environment?: string;
31
+ version?: string;
32
+ timestamp?: string;
33
+ metadata?: Record<string, unknown>;
34
+ }
35
+ /**
36
+ * 로그 엔트리
37
+ */
38
+ export interface ILogEntry {
39
+ level: ELogLevel;
40
+ message: string;
41
+ context: IErrorLogContext;
42
+ error?: AppError | Error;
43
+ timestamp: Date;
44
+ }
45
+ /**
46
+ * Transport 인터페이스
47
+ */
48
+ export interface ITransport {
49
+ /**
50
+ * Transport 이름
51
+ */
52
+ name: string;
53
+ /**
54
+ * 로그 전송
55
+ */
56
+ log(entry: ILogEntry): Promise<void>;
57
+ /**
58
+ * Transport 활성화 여부
59
+ */
60
+ isEnabled(): boolean;
61
+ }
62
+ /**
63
+ * ErrorLogger 옵션
64
+ */
65
+ export interface IErrorLoggerOptions {
66
+ /**
67
+ * 최소 로그 레벨
68
+ * 이 레벨 이상의 로그만 기록
69
+ */
70
+ minLevel?: ELogLevel;
71
+ /**
72
+ * 환경 정보
73
+ */
74
+ environment?: string;
75
+ /**
76
+ * 앱 버전
77
+ */
78
+ version?: string;
79
+ /**
80
+ * Transport 목록
81
+ */
82
+ transports?: ITransport[];
83
+ }
@@ -0,0 +1,7 @@
1
+ import {
2
+ ELogLevel
3
+ } from "../../chunk-6C7HQIX4.js";
4
+ import "../../chunk-ORMEWXMH.js";
5
+ export {
6
+ ELogLevel
7
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * English Error Messages
3
+ */
4
+ import type { TErrorMessages } from './types';
5
+ export declare const enMessages: TErrorMessages;
@@ -0,0 +1,7 @@
1
+ import {
2
+ enMessages
3
+ } from "../../chunk-N4YGR5WH.js";
4
+ import "../../chunk-ORMEWXMH.js";
5
+ export {
6
+ enMessages
7
+ };
@@ -0,0 +1,40 @@
1
+ /**
2
+ * 메시지 레지스트리
3
+ * 에러 코드에 대한 다중 언어 메시지 제공
4
+ */
5
+ import type { IErrorMessage, TLocale, TErrorMessages } from './types';
6
+ /**
7
+ * 에러 코드에 해당하는 메시지 가져오기
8
+ *
9
+ * @param code - 에러 코드 (5자리)
10
+ * @param locale - 언어 (기본값: 'ko')
11
+ * @returns 에러 메시지
12
+ */
13
+ export declare function getErrorMessage(code: number, locale?: TLocale): IErrorMessage;
14
+ /**
15
+ * 특정 언어의 모든 메시지 가져오기
16
+ *
17
+ * @param locale - 언어
18
+ * @returns 모든 에러 메시지
19
+ */
20
+ export declare function getAllMessages(locale?: TLocale): TErrorMessages;
21
+ /**
22
+ * 에러 코드가 메시지를 가지고 있는지 확인
23
+ *
24
+ * @param code - 에러 코드
25
+ * @param locale - 언어
26
+ * @returns 메시지 존재 여부
27
+ */
28
+ export declare function hasMessage(code: number, locale?: TLocale): boolean;
29
+ /**
30
+ * 지원하는 언어 목록
31
+ */
32
+ export declare const supportedLocales: TLocale[];
33
+ /**
34
+ * 언어가 지원되는지 확인
35
+ *
36
+ * @param locale - 언어
37
+ * @returns 지원 여부
38
+ */
39
+ export declare function isLocaleSupported(locale: string): locale is TLocale;
40
+ export type { IErrorMessage, TLocale, TErrorMessages, IDefaultMessages } from './types';
@@ -0,0 +1,17 @@
1
+ import {
2
+ getAllMessages,
3
+ getErrorMessage,
4
+ hasMessage,
5
+ isLocaleSupported,
6
+ supportedLocales
7
+ } from "../../chunk-EEUBKZV4.js";
8
+ import "../../chunk-N4YGR5WH.js";
9
+ import "../../chunk-KXAWBFJN.js";
10
+ import "../../chunk-ORMEWXMH.js";
11
+ export {
12
+ getAllMessages,
13
+ getErrorMessage,
14
+ hasMessage,
15
+ isLocaleSupported,
16
+ supportedLocales
17
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 한국어 에러 메시지
3
+ */
4
+ import type { TErrorMessages } from './types';
5
+ export declare const koMessages: TErrorMessages;
@@ -0,0 +1,7 @@
1
+ import {
2
+ koMessages
3
+ } from "../../chunk-KXAWBFJN.js";
4
+ import "../../chunk-ORMEWXMH.js";
5
+ export {
6
+ koMessages
7
+ };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * 에러 메시지 타입 정의
3
+ */
4
+ /**
5
+ * 에러 메시지 인터페이스
6
+ */
7
+ export interface IErrorMessage {
8
+ /** 에러 제목 (짧고 명확하게) */
9
+ title: string;
10
+ /** 에러 설명 (상세 내용) */
11
+ description: string;
12
+ /** 사용자 행동 유도 (선택적) */
13
+ action?: string;
14
+ }
15
+ /**
16
+ * 지원 언어 타입
17
+ */
18
+ export type TLocale = 'ko' | 'en' | 'ja';
19
+ /**
20
+ * 에러 코드별 메시지 맵
21
+ */
22
+ export type TErrorMessages = Record<number, IErrorMessage>;
23
+ /**
24
+ * 기본 메시지 (Fallback용)
25
+ */
26
+ export interface IDefaultMessages {
27
+ ko: IErrorMessage;
28
+ en: IErrorMessage;
29
+ ja: IErrorMessage;
30
+ }
File without changes
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Circuit Breaker 패턴
3
+ *
4
+ * 연속된 실패 시 일시적으로 요청 차단
5
+ */
6
+ /**
7
+ * Circuit Breaker 상태
8
+ */
9
+ export declare enum ECircuitState {
10
+ CLOSED = "closed",// 정상 동작
11
+ OPEN = "open",// 요청 차단
12
+ HALF_OPEN = "half-open"
13
+ }
14
+ /**
15
+ * CircuitBreaker 옵션
16
+ */
17
+ export interface ICircuitBreakerOptions {
18
+ /** 실패 임계값 (기본값: 5) */
19
+ failureThreshold?: number;
20
+ /** 성공 임계값 (Half-Open 상태에서, 기본값: 2) */
21
+ successThreshold?: number;
22
+ /** 타임아웃 (밀리초, 기본값: 60000) */
23
+ timeout?: number;
24
+ /** 상태 변경 콜백 */
25
+ onStateChange?: (oldState: ECircuitState, newState: ECircuitState) => void;
26
+ /** 에러 콜백 */
27
+ onError?: (error: unknown) => void;
28
+ }
29
+ /**
30
+ * CircuitBreaker 클래스
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * const breaker = new CircuitBreaker({
35
+ * failureThreshold: 5,
36
+ * timeout: 60000,
37
+ * });
38
+ *
39
+ * const data = await breaker.execute(async () => {
40
+ * const res = await fetch('/api/data');
41
+ * return res.json();
42
+ * });
43
+ * ```
44
+ */
45
+ export declare class CircuitBreaker {
46
+ private state;
47
+ private failureCount;
48
+ private successCount;
49
+ private nextAttemptTime;
50
+ private options;
51
+ constructor(options?: ICircuitBreakerOptions);
52
+ /**
53
+ * 함수 실행
54
+ */
55
+ execute<T>(fn: () => Promise<T>): Promise<T>;
56
+ /**
57
+ * 성공 처리
58
+ */
59
+ private onSuccess;
60
+ /**
61
+ * 실패 처리
62
+ */
63
+ private onFailure;
64
+ /**
65
+ * 상태 변경
66
+ */
67
+ private setState;
68
+ /**
69
+ * 현재 상태 조회
70
+ */
71
+ getState(): ECircuitState;
72
+ /**
73
+ * 상태 초기화
74
+ */
75
+ reset(): void;
76
+ /**
77
+ * 메트릭 조회
78
+ */
79
+ getMetrics(): {
80
+ state: ECircuitState;
81
+ failureCount: number;
82
+ successCount: number;
83
+ nextAttemptTime: number;
84
+ };
85
+ }
@@ -0,0 +1,9 @@
1
+ import {
2
+ CircuitBreaker,
3
+ ECircuitState
4
+ } from "../../chunk-7VJNLGAS.js";
5
+ import "../../chunk-ORMEWXMH.js";
6
+ export {
7
+ CircuitBreaker,
8
+ ECircuitState
9
+ };
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Feature Degradation 패턴
3
+ *
4
+ * 선택적 기능 실패 시 우아한 저하 (graceful degradation)
5
+ */
6
+ /**
7
+ * FeatureDegradation - 기능 저하 패턴
8
+ *
9
+ * 선택적 기능 실패 시 기본 작업은 계속 진행
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * const result = await FeatureDegradation.execute(
14
+ * 'analytics',
15
+ * async () => {
16
+ * await trackAnalytics(event);
17
+ * }
18
+ * );
19
+ *
20
+ * if (!result.success) {
21
+ * console.log('Analytics failed but app continues');
22
+ * }
23
+ * ```
24
+ */
25
+ export declare class FeatureDegradation {
26
+ /**
27
+ * 기능 실행 (실패해도 앱은 계속)
28
+ */
29
+ static execute<T>(featureName: string, fn: () => Promise<T>, fallbackValue?: T): Promise<{
30
+ success: boolean;
31
+ data?: T;
32
+ error?: unknown;
33
+ }>;
34
+ /**
35
+ * 여러 기능을 병렬로 실행 (일부 실패해도 계속)
36
+ */
37
+ static executeAll<T>(features: Array<{
38
+ name: string;
39
+ fn: () => Promise<T>;
40
+ fallbackValue?: T;
41
+ }>): Promise<Array<{
42
+ name: string;
43
+ success: boolean;
44
+ data?: T;
45
+ error?: unknown;
46
+ }>>;
47
+ /**
48
+ * 타임아웃 포함 실행
49
+ */
50
+ static executeWithTimeout<T>(featureName: string, fn: () => Promise<T>, timeoutMs: number, fallbackValue?: T): Promise<{
51
+ success: boolean;
52
+ data?: T;
53
+ error?: unknown;
54
+ timedOut?: boolean;
55
+ }>;
56
+ }
@@ -0,0 +1,7 @@
1
+ import {
2
+ FeatureDegradation
3
+ } from "../../chunk-TEIYA7U4.js";
4
+ import "../../chunk-ORMEWXMH.js";
5
+ export {
6
+ FeatureDegradation
7
+ };
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Fallback 패턴
3
+ *
4
+ * 실패 시 대체 값 또는 대체 함수 사용
5
+ */
6
+ /**
7
+ * Fallback 옵션
8
+ */
9
+ export interface IFallbackOptions<T> {
10
+ /** 에러 발생 시 콜백 */
11
+ onError?: (error: unknown) => void;
12
+ /** 에러 로깅 여부 (기본값: true) */
13
+ logError?: boolean;
14
+ }
15
+ /**
16
+ * withFallback - Fallback 패턴 (값)
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * const data = await withFallback(
21
+ * async () => {
22
+ * const res = await fetch('/api/data');
23
+ * return res.json();
24
+ * },
25
+ * { default: 'fallback data' }
26
+ * );
27
+ * ```
28
+ */
29
+ export declare function withFallback<T>(fn: () => Promise<T>, fallbackValue: T, options?: IFallbackOptions<T>): Promise<T>;
30
+ /**
31
+ * withFallbackFn - Fallback 패턴 (함수)
32
+ *
33
+ * @example
34
+ * ```typescript
35
+ * const data = await withFallbackFn(
36
+ * async () => await fetchFromPrimary(),
37
+ * async () => await fetchFromSecondary()
38
+ * );
39
+ * ```
40
+ */
41
+ export declare function withFallbackFn<T>(primaryFn: () => Promise<T>, fallbackFn: () => Promise<T>, options?: IFallbackOptions<T>): Promise<T>;
42
+ /**
43
+ * withFallbackChain - 여러 fallback을 순서대로 시도
44
+ *
45
+ * @example
46
+ * ```typescript
47
+ * const data = await withFallbackChain([
48
+ * async () => await fetchFromPrimary(),
49
+ * async () => await fetchFromSecondary(),
50
+ * async () => await fetchFromCache(),
51
+ * async () => ({ default: true })
52
+ * ]);
53
+ * ```
54
+ */
55
+ export declare function withFallbackChain<T>(fns: Array<() => Promise<T>>, options?: IFallbackOptions<T>): Promise<T>;
@@ -0,0 +1,11 @@
1
+ import {
2
+ withFallback,
3
+ withFallbackChain,
4
+ withFallbackFn
5
+ } from "../../chunk-MYLGYX4K.js";
6
+ import "../../chunk-ORMEWXMH.js";
7
+ export {
8
+ withFallback,
9
+ withFallbackChain,
10
+ withFallbackFn
11
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * 에러 복구 전략
3
+ *
4
+ * 통합 에러 처리 시스템의 복구 패턴
5
+ */
6
+ export { withRetry } from './retry';
7
+ export type { IRetryOptions } from './retry';
8
+ export { withFallback, withFallbackFn, withFallbackChain } from './fallback';
9
+ export type { IFallbackOptions } from './fallback';
10
+ export { CircuitBreaker, ECircuitState } from './circuit-breaker';
11
+ export type { ICircuitBreakerOptions } from './circuit-breaker';
12
+ export { FeatureDegradation } from './degradation';
@@ -0,0 +1,26 @@
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 {
11
+ CircuitBreaker,
12
+ ECircuitState
13
+ } from "../../chunk-7VJNLGAS.js";
14
+ import {
15
+ FeatureDegradation
16
+ } from "../../chunk-TEIYA7U4.js";
17
+ import "../../chunk-ORMEWXMH.js";
18
+ export {
19
+ CircuitBreaker,
20
+ ECircuitState,
21
+ FeatureDegradation,
22
+ withFallback,
23
+ withFallbackChain,
24
+ withFallbackFn,
25
+ withRetry
26
+ };
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Retry 패턴
3
+ *
4
+ * 실패한 작업을 자동으로 재시도
5
+ */
6
+ /**
7
+ * Retry 옵션
8
+ */
9
+ export interface IRetryOptions {
10
+ /** 최대 재시도 횟수 (기본값: 3) */
11
+ maxAttempts?: number;
12
+ /** 재시도 간격 (밀리초, 기본값: 1000) */
13
+ delay?: number;
14
+ /** 지수 백오프 사용 여부 (기본값: true) */
15
+ exponentialBackoff?: boolean;
16
+ /** 백오프 배수 (기본값: 2) */
17
+ backoffMultiplier?: number;
18
+ /** 최대 지연 시간 (밀리초, 기본값: 30000) */
19
+ maxDelay?: number;
20
+ /** 재시도 가능 여부를 판단하는 함수 */
21
+ shouldRetry?: (error: unknown, attempt: number) => boolean;
22
+ /** 재시도 전 콜백 */
23
+ onRetry?: (error: unknown, attempt: number) => void;
24
+ }
25
+ /**
26
+ * withRetry - 재시도 패턴
27
+ *
28
+ * @example
29
+ * ```typescript
30
+ * const data = await withRetry(
31
+ * async () => {
32
+ * const res = await fetch('/api/data');
33
+ * if (!res.ok) throw new Error('Fetch failed');
34
+ * return res.json();
35
+ * },
36
+ * {
37
+ * maxAttempts: 3,
38
+ * delay: 1000,
39
+ * exponentialBackoff: true,
40
+ * }
41
+ * );
42
+ * ```
43
+ */
44
+ export declare function withRetry<T>(fn: () => Promise<T>, options?: IRetryOptions): Promise<T>;
@@ -0,0 +1,7 @@
1
+ import {
2
+ withRetry
3
+ } from "../../chunk-A6EAAWMK.js";
4
+ import "../../chunk-ORMEWXMH.js";
5
+ export {
6
+ withRetry
7
+ };
@@ -0,0 +1,33 @@
1
+ import type { IBatchProcessorConfig, IBatchProcessResult } from '@withwiz/types/geoip';
2
+ /**
3
+ * 범용 배치 처리기
4
+ * 다양한 배치 작업에 재사용 가능한 공통 로직
5
+ */
6
+ export declare class BatchProcessor<T, R> {
7
+ private config;
8
+ constructor(config?: Partial<IBatchProcessorConfig>);
9
+ /**
10
+ * 배치 처리 실행
11
+ */
12
+ processBatch(items: T[], processor: (batch: T[]) => Promise<R[]>, onProgress?: (processed: number, total: number) => void): Promise<IBatchProcessResult>;
13
+ /**
14
+ * 재시도 로직이 포함된 배치 처리
15
+ */
16
+ processBatchWithRetry(items: T[], processor: (batch: T[]) => Promise<R[]>, onProgress?: (processed: number, total: number) => void): Promise<IBatchProcessResult>;
17
+ /**
18
+ * 동시 배치 처리 (병렬 처리)
19
+ */
20
+ processBatchConcurrent(items: T[], processor: (batch: T[]) => Promise<R[]>, onProgress?: (processed: number, total: number) => void): Promise<IBatchProcessResult>;
21
+ /**
22
+ * 설정 업데이트
23
+ */
24
+ updateConfig(newConfig: Partial<IBatchProcessorConfig>): void;
25
+ /**
26
+ * 현재 설정 조회
27
+ */
28
+ getConfig(): IBatchProcessorConfig;
29
+ }
30
+ /**
31
+ * 배치 처리기 팩토리 함수
32
+ */
33
+ export declare function createBatchProcessor<T, R>(config?: Partial<IBatchProcessorConfig>): BatchProcessor<T, R>;
@@ -0,0 +1,10 @@
1
+ import {
2
+ BatchProcessor,
3
+ createBatchProcessor
4
+ } from "../chunk-TZAP5T4N.js";
5
+ import "../chunk-EZR55KV2.js";
6
+ import "../chunk-ORMEWXMH.js";
7
+ export {
8
+ BatchProcessor,
9
+ createBatchProcessor
10
+ };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * GeoIP Shared Module
3
+ *
4
+ * 프로젝트 독립적인 GeoIP 유틸리티
5
+ * - 순수 Provider 구현
6
+ * - 범용 배치 처리기
7
+ * - IP 유틸리티는 @withwiz/utils/ip-utils 에서 import
8
+ *
9
+ * 프로젝트 종속적인 서비스는 <your-project>/services/geoip 를 사용하세요.
10
+ */
11
+ export { BaseGeoIPProvider, truncateString, IPApiProvider, IPApiCoProvider, IPGeolocationProvider, MaxMindProvider, GeoIPProviderFactory, } from './providers';
12
+ export { BatchProcessor, createBatchProcessor } from './batch-processor';
13
+ export type { IGeoIPConfig, IGeoIPService, IGeoIPProvider, IGeoIPApiResponse, IBatchProcessorConfig, IBatchProcessResult, IGeographyAnalytics, IGeoIPStats, IGeoIPError, IGeoIPCacheEntry, IGeoIPPreset, } from '@withwiz/types/geoip';
14
+ export type { IGeoLocationData, IGeoIPResponse, IDatabaseService, ICacheService, } from '@withwiz/types/database';