@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,310 @@
1
+ // src/error/messages/en.ts
2
+ var enMessages = {
3
+ // ============================================
4
+ // Validation Errors (400xx)
5
+ // ============================================
6
+ 40001: {
7
+ title: "Please check your input",
8
+ description: "Some information you entered is incorrect.",
9
+ action: "Please review your input."
10
+ },
11
+ 40002: {
12
+ title: "Cannot process request",
13
+ description: "The request format is invalid.",
14
+ action: "Please refresh the page."
15
+ },
16
+ 40003: {
17
+ title: "Invalid input",
18
+ description: "The format is not allowed.",
19
+ action: "Please enter in the correct format."
20
+ },
21
+ 40004: {
22
+ title: "Required information is missing",
23
+ description: "Required fields are empty.",
24
+ action: "Please fill in all required fields."
25
+ },
26
+ 40005: {
27
+ title: "Please check URL format",
28
+ description: "Please enter a URL starting with https://.",
29
+ action: "Example: https://example.com"
30
+ },
31
+ 40006: {
32
+ title: "Please check email format",
33
+ description: "This is not a valid email address.",
34
+ action: "Example: user@example.com"
35
+ },
36
+ 40007: {
37
+ title: "Stronger password required",
38
+ description: "8+ characters with letters, numbers, and symbols",
39
+ action: "Please set a more complex password."
40
+ },
41
+ 40008: {
42
+ title: "Please check alias format",
43
+ description: "Only letters, numbers, and hyphens (-) allowed",
44
+ action: "Example: my-link-123"
45
+ },
46
+ // ============================================
47
+ // Authentication Errors (401xx)
48
+ // ============================================
49
+ 40101: {
50
+ title: "Login required",
51
+ description: "This feature requires authentication.",
52
+ action: "Please login and try again."
53
+ },
54
+ 40102: {
55
+ title: "Invalid authentication",
56
+ description: "Your login session is not valid.",
57
+ action: "Please login again."
58
+ },
59
+ 40103: {
60
+ title: "Session expired",
61
+ description: "Your session has expired for security.",
62
+ action: "Please login again."
63
+ },
64
+ 40106: {
65
+ title: "Login failed",
66
+ description: "Email or password is incorrect.",
67
+ action: "Please try again."
68
+ },
69
+ 40107: {
70
+ title: "Session ended",
71
+ description: "You have been automatically logged out.",
72
+ action: "Please login again."
73
+ },
74
+ // ============================================
75
+ // Permission Errors (403xx)
76
+ // ============================================
77
+ 40304: {
78
+ title: "Access denied",
79
+ description: "You do not have permission for this feature.",
80
+ action: "Please contact the administrator."
81
+ },
82
+ 40305: {
83
+ title: "Email verification required",
84
+ description: "Please verify your email first.",
85
+ action: "Please check your mailbox."
86
+ },
87
+ 40308: {
88
+ title: "Account disabled",
89
+ description: "This account cannot use the service.",
90
+ action: "Please contact customer support."
91
+ },
92
+ 40309: {
93
+ title: "Account locked",
94
+ description: "Account locked due to failed login attempts.",
95
+ action: "Please try again later."
96
+ },
97
+ // ============================================
98
+ // Resource Not Found (404xx)
99
+ // ============================================
100
+ 40401: {
101
+ title: "Not found",
102
+ description: "The requested item does not exist.",
103
+ action: "Please check the address."
104
+ },
105
+ 40402: {
106
+ title: "User not found",
107
+ description: "The user does not exist."
108
+ },
109
+ 40403: {
110
+ title: "Link not found",
111
+ description: "The shortened link does not exist.",
112
+ action: "Please check the link address."
113
+ },
114
+ 40408: {
115
+ title: "Tag not found",
116
+ description: "The tag does not exist."
117
+ },
118
+ 40409: {
119
+ title: "Favorite not found",
120
+ description: "The item does not exist."
121
+ },
122
+ 40410: {
123
+ title: "Group not found",
124
+ description: "The group does not exist."
125
+ },
126
+ // ============================================
127
+ // Conflict Errors (409xx)
128
+ // ============================================
129
+ 40904: {
130
+ title: "Conflict occurred",
131
+ description: "Conflicts with existing data.",
132
+ action: "Please try again later."
133
+ },
134
+ 40905: {
135
+ title: "Already exists",
136
+ description: "An identical item already exists.",
137
+ action: "Please use a different value."
138
+ },
139
+ 40906: {
140
+ title: "Email already registered",
141
+ description: "This email is already in use by another account.",
142
+ action: "Please use a different email."
143
+ },
144
+ 40907: {
145
+ title: "Alias already in use",
146
+ description: "This alias is being used by another link.",
147
+ action: "Please enter a different alias."
148
+ },
149
+ // ============================================
150
+ // Business Logic Errors (422xx)
151
+ // ============================================
152
+ 42201: {
153
+ title: "Cannot process",
154
+ description: "Cannot be processed in the current state.",
155
+ action: "Please check the conditions."
156
+ },
157
+ 42202: {
158
+ title: "Operation not allowed",
159
+ description: "This operation is not possible in the current state."
160
+ },
161
+ 42203: {
162
+ title: "Usage limit exceeded",
163
+ description: "You have exceeded the limit.",
164
+ action: "Please consider upgrading your plan."
165
+ },
166
+ 42204: {
167
+ title: "Link expired",
168
+ description: "The validity period has passed.",
169
+ action: "Please create a new link."
170
+ },
171
+ 42205: {
172
+ title: "Link disabled",
173
+ description: "Usage has been stopped.",
174
+ action: "Please contact the owner."
175
+ },
176
+ 42206: {
177
+ title: "Password required",
178
+ description: "You must enter a password.",
179
+ action: "Please enter the password."
180
+ },
181
+ 42207: {
182
+ title: "Incorrect password",
183
+ description: "The password is incorrect.",
184
+ action: "Please check again."
185
+ },
186
+ 42208: {
187
+ title: "Alias not allowed",
188
+ description: "This is a system reserved word.",
189
+ action: "Please choose a different alias."
190
+ },
191
+ 42209: {
192
+ title: "Already in favorites",
193
+ description: "Already added."
194
+ },
195
+ 42210: {
196
+ title: "Cannot delete",
197
+ description: "Cannot delete your own admin account."
198
+ },
199
+ 42211: {
200
+ title: "File too large",
201
+ description: "The maximum size has been exceeded.",
202
+ action: "Please select a smaller file."
203
+ },
204
+ 42212: {
205
+ title: "Unsupported file format",
206
+ description: "Cannot upload.",
207
+ action: "Please check supported formats."
208
+ },
209
+ // ============================================
210
+ // Rate Limiting (429xx)
211
+ // ============================================
212
+ 42901: {
213
+ title: "Please slow down",
214
+ description: "Too many requests.",
215
+ action: "Please try again in a moment."
216
+ },
217
+ 42902: {
218
+ title: "Daily limit reached",
219
+ description: "You have reached the daily limit.",
220
+ action: "Please try again tomorrow."
221
+ },
222
+ 42903: {
223
+ title: "API quota exceeded",
224
+ description: "API limit exceeded.",
225
+ action: "Please consider upgrading your plan."
226
+ },
227
+ // ============================================
228
+ // Server Errors (500xx)
229
+ // ============================================
230
+ 50001: {
231
+ title: "Internal server error",
232
+ description: "An internal server problem has occurred.",
233
+ action: "Please try again later."
234
+ },
235
+ 50002: {
236
+ title: "Temporary error",
237
+ description: "Will be restored soon.",
238
+ action: "Please try again later."
239
+ },
240
+ 50003: {
241
+ title: "Data processing error",
242
+ description: "A problem occurred while processing data.",
243
+ action: "Please try again later."
244
+ },
245
+ 50006: {
246
+ title: "Failed to send email",
247
+ description: "Email sending failed.",
248
+ action: "Please try again later."
249
+ },
250
+ 50007: {
251
+ title: "Temporary error",
252
+ description: "There is a problem with cache processing.",
253
+ action: "Please refresh the page."
254
+ },
255
+ 50008: {
256
+ title: "File upload failed",
257
+ description: "There was a problem saving the file.",
258
+ action: "Please try again."
259
+ },
260
+ // ============================================
261
+ // Service Unavailable (503xx)
262
+ // ============================================
263
+ 50304: {
264
+ title: "External service connection failed",
265
+ description: "The external service is not responding.",
266
+ action: "Please try again later."
267
+ },
268
+ 50305: {
269
+ title: "Service under maintenance",
270
+ description: "Maintenance in progress.",
271
+ action: "Please visit again later."
272
+ },
273
+ // ============================================
274
+ // Security Errors (403xx - 71~79)
275
+ // ============================================
276
+ 40371: {
277
+ title: "Access blocked",
278
+ description: "Blocked by security policy.",
279
+ action: "Please try again using the normal method."
280
+ },
281
+ 40372: {
282
+ title: "Security validation failed",
283
+ description: "Security token has expired.",
284
+ action: "Please refresh the page."
285
+ },
286
+ 40373: {
287
+ title: "URL not allowed",
288
+ description: "This URL is blocked for security reasons.",
289
+ action: "Please use a different URL."
290
+ },
291
+ 40374: {
292
+ title: "Suspicious activity detected",
293
+ description: "Temporarily restricted.",
294
+ action: "Please contact customer support."
295
+ },
296
+ 40375: {
297
+ title: "IP blocked",
298
+ description: "Blocked by security policy.",
299
+ action: "Please contact customer support."
300
+ },
301
+ 40376: {
302
+ title: "CORS policy violation",
303
+ description: "Request from an unauthorized origin.",
304
+ action: "Please access from the correct address."
305
+ }
306
+ };
307
+
308
+ export {
309
+ enMessages
310
+ };
@@ -0,0 +1,80 @@
1
+ // src/utils/error-message-formatter.ts
2
+ function formatRedisError(errorMessage) {
3
+ if (!errorMessage) {
4
+ return "Unknown Redis error";
5
+ }
6
+ let cleanMessage = errorMessage;
7
+ if (cleanMessage.startsWith("Command failed:")) {
8
+ cleanMessage = cleanMessage.replace(/^Command failed:\s*/, "").trim();
9
+ }
10
+ if (cleanMessage.startsWith("ERR ")) {
11
+ cleanMessage = cleanMessage.replace(/^ERR\s+/, "").trim();
12
+ }
13
+ cleanMessage = cleanMessage.replace(/\s*See https:\/\/upstash\.com\/[^\s]+\s*for details.*$/i, "").trim();
14
+ if (cleanMessage.includes("max requests limit exceeded")) {
15
+ const limitMatch = cleanMessage.match(/Limit:\s*(\d+)/);
16
+ const usageMatch = cleanMessage.match(/Usage:\s*(\d+)/);
17
+ if (limitMatch && usageMatch) {
18
+ const limit = parseInt(limitMatch[1]);
19
+ const usage = parseInt(usageMatch[1]);
20
+ const limitInK = Math.floor(limit / 1e3);
21
+ return `Redis request limit exceeded (${limitInK}K requests used). Please upgrade your plan or wait for the quota to reset.`;
22
+ }
23
+ return "Redis request limit exceeded. Please check your Upstash plan.";
24
+ }
25
+ if (cleanMessage.includes("timeout") || cleanMessage.includes("ETIMEDOUT")) {
26
+ return "Redis connection timeout. Please check network connectivity.";
27
+ }
28
+ if (cleanMessage.includes("NOAUTH") || cleanMessage.includes("authentication") || cleanMessage.includes("invalid password")) {
29
+ return "Redis authentication failed. Please check your credentials.";
30
+ }
31
+ if (cleanMessage.includes("ECONNREFUSED") || cleanMessage.includes("connection refused")) {
32
+ return "Redis connection refused. Please check Redis server status.";
33
+ }
34
+ if (cleanMessage.includes("ENOTFOUND") || cleanMessage.includes("getaddrinfo")) {
35
+ return "Redis server not found. Please check the Redis URL.";
36
+ }
37
+ if (cleanMessage.includes("network") || cleanMessage.includes("ENETUNREACH")) {
38
+ return "Network error connecting to Redis.";
39
+ }
40
+ if (cleanMessage.length > 100) {
41
+ return cleanMessage.substring(0, 100) + "...";
42
+ }
43
+ return cleanMessage;
44
+ }
45
+ function formatDatabaseError(errorMessage) {
46
+ if (!errorMessage) {
47
+ return "Unknown database error";
48
+ }
49
+ if (errorMessage.includes("timeout") || errorMessage.includes("ETIMEDOUT")) {
50
+ return "Database connection timeout. Please check network connectivity.";
51
+ }
52
+ if (errorMessage.includes("ECONNREFUSED") || errorMessage.includes("connection refused")) {
53
+ return "Database connection refused. Please check database server status.";
54
+ }
55
+ if (errorMessage.includes("authentication") || errorMessage.includes("password")) {
56
+ return "Database authentication failed. Please check your credentials.";
57
+ }
58
+ if (errorMessage.includes("too many connections") || errorMessage.includes("connection limit")) {
59
+ return "Database connection limit reached. Please try again later.";
60
+ }
61
+ if (errorMessage.includes("database") && errorMessage.includes("does not exist")) {
62
+ return "Database not found. Please check your configuration.";
63
+ }
64
+ return errorMessage.length > 100 ? errorMessage.substring(0, 100) + "..." : errorMessage;
65
+ }
66
+ function formatGenericError(errorMessage) {
67
+ if (!errorMessage) {
68
+ return "Unknown error occurred";
69
+ }
70
+ if (errorMessage.length > 150) {
71
+ return errorMessage.substring(0, 150) + "...";
72
+ }
73
+ return errorMessage;
74
+ }
75
+
76
+ export {
77
+ formatRedisError,
78
+ formatDatabaseError,
79
+ formatGenericError
80
+ };
@@ -0,0 +1,37 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+
33
+ export {
34
+ __spreadValues,
35
+ __spreadProps,
36
+ __objRest
37
+ };
@@ -0,0 +1,57 @@
1
+ import {
2
+ getErrorMessage
3
+ } from "./chunk-EEUBKZV4.js";
4
+ import {
5
+ getErrorCategory
6
+ } from "./chunk-Y3OTJH2S.js";
7
+
8
+ // src/error/friendly-messages-v2.ts
9
+ var categoryIcons = {
10
+ validation: "\u26A0\uFE0F",
11
+ auth: "\u{1F510}",
12
+ permission: "\u{1F6AB}",
13
+ resource: "\u{1F50D}",
14
+ conflict: "\u26A1",
15
+ business: "\u{1F4CB}",
16
+ rateLimit: "\u23F1\uFE0F",
17
+ server: "\u{1F527}",
18
+ security: "\u{1F6E1}\uFE0F",
19
+ unknown: "\u274C"
20
+ };
21
+ var categorySeverity = {
22
+ validation: "warning",
23
+ auth: "warning",
24
+ permission: "warning",
25
+ resource: "info",
26
+ conflict: "warning",
27
+ business: "warning",
28
+ rateLimit: "warning",
29
+ server: "error",
30
+ security: "critical",
31
+ unknown: "error"
32
+ };
33
+ function getFriendlyMessage(code, locale = "ko") {
34
+ return getErrorMessage(code, locale);
35
+ }
36
+ function getErrorDisplayInfo(code, locale = "ko") {
37
+ const message = getErrorMessage(code, locale);
38
+ const category = getErrorCategory(code);
39
+ return {
40
+ code,
41
+ title: message.title,
42
+ description: message.description,
43
+ action: message.action,
44
+ icon: categoryIcons[category],
45
+ severity: categorySeverity[category]
46
+ };
47
+ }
48
+ function formatFriendlyError(code, locale = "ko") {
49
+ const { title, description } = getFriendlyMessage(code, locale);
50
+ return `${title} - ${description} [${code}]`;
51
+ }
52
+
53
+ export {
54
+ getFriendlyMessage,
55
+ getErrorDisplayInfo,
56
+ formatFriendlyError
57
+ };
@@ -0,0 +1,69 @@
1
+ import {
2
+ getCacheConfig
3
+ } from "./chunk-TXGNSECL.js";
4
+ import {
5
+ getENV
6
+ } from "./chunk-I47QEDTX.js";
7
+
8
+ // src/cache/noop-cache-manager.ts
9
+ var NoopCacheManager = class {
10
+ constructor(prefix) {
11
+ this.prefix = prefix;
12
+ }
13
+ async get(_key) {
14
+ return null;
15
+ }
16
+ async set(_key, _value, _ttl) {
17
+ }
18
+ async delete(_key) {
19
+ }
20
+ async deletePattern(_pattern) {
21
+ }
22
+ async exists(_key) {
23
+ return false;
24
+ }
25
+ async increment() {
26
+ return 0;
27
+ }
28
+ async expire() {
29
+ }
30
+ getMetrics() {
31
+ return {
32
+ hits: 0,
33
+ misses: 0,
34
+ errors: 0,
35
+ totalRequests: 0,
36
+ hitRate: 0,
37
+ averageResponseTime: 0
38
+ };
39
+ }
40
+ getConnectionStatus() {
41
+ return {
42
+ isConnected: false,
43
+ connectionErrors: 0
44
+ };
45
+ }
46
+ async checkConnection() {
47
+ return false;
48
+ }
49
+ getConfig() {
50
+ const cacheConfig = getCacheConfig[this.prefix];
51
+ const envVarName = `CACHE_${this.prefix.toUpperCase()}_ENABLED`;
52
+ const ENV = getENV();
53
+ return {
54
+ prefix: this.prefix,
55
+ enabled: false,
56
+ reason: cacheConfig && !cacheConfig.enabled() ? "\uD658\uACBD \uBCC0\uC218\uB85C \uBE44\uD65C\uC131\uD654\uB428" : "\uC804\uC5ED \uCE90\uC2DC \uBE44\uD65C\uC131\uD654\uB428",
57
+ envVars: {
58
+ CACHE_ENABLED: ENV.CACHE.ENABLED ? "true" : "false",
59
+ [envVarName]: "disabled",
60
+ UPSTASH_REDIS_REST_URL: ENV.REDIS.URL ? "\uC124\uC815\uB428" : "\uBBF8\uC124\uC815",
61
+ UPSTASH_REDIS_REST_TOKEN: ENV.REDIS.TOKEN ? "\uC124\uC815\uB428" : "\uBBF8\uC124\uC815"
62
+ }
63
+ };
64
+ }
65
+ };
66
+
67
+ export {
68
+ NoopCacheManager
69
+ };
@@ -0,0 +1,27 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-62FLBG6B.js";
4
+ import {
5
+ __objRest,
6
+ __spreadValues
7
+ } from "./chunk-ORMEWXMH.js";
8
+
9
+ // src/components/ui/Input.tsx
10
+ import { jsx } from "react/jsx-runtime";
11
+ function Input(_a) {
12
+ var _b = _a, { className, type } = _b, props = __objRest(_b, ["className", "type"]);
13
+ return /* @__PURE__ */ jsx(
14
+ "input",
15
+ __spreadValues({
16
+ type,
17
+ className: cn(
18
+ "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
19
+ className
20
+ )
21
+ }, props)
22
+ );
23
+ }
24
+
25
+ export {
26
+ Input
27
+ };
@@ -0,0 +1,89 @@
1
+ import {
2
+ IPApiProvider
3
+ } from "./chunk-DEEJBDJE.js";
4
+ import {
5
+ IPApiCoProvider
6
+ } from "./chunk-VSGKVZB4.js";
7
+ import {
8
+ IPGeolocationProvider
9
+ } from "./chunk-DH2ZHGW2.js";
10
+ import {
11
+ MaxMindProvider
12
+ } from "./chunk-4NWJ3WCZ.js";
13
+
14
+ // src/geolocation/providers/index.ts
15
+ var GeoIPProviderFactory = class {
16
+ /**
17
+ * 사용 가능한 제공자 목록 반환
18
+ */
19
+ static getAvailableProviders() {
20
+ return this.providers.filter((provider) => provider.isAvailable());
21
+ }
22
+ /**
23
+ * 이름으로 제공자 찾기
24
+ */
25
+ static getProvider(name) {
26
+ return this.providers.find((provider) => provider.name === name) || null;
27
+ }
28
+ /**
29
+ * 모든 제공자 목록 반환
30
+ */
31
+ static getAllProviders() {
32
+ return [...this.providers];
33
+ }
34
+ /**
35
+ * 제공자별 성능 통계
36
+ */
37
+ static getProviderStats() {
38
+ return this.providers.map((provider) => ({
39
+ name: provider.name,
40
+ available: provider.isAvailable(),
41
+ rateLimit: provider.getRateLimit(),
42
+ timeout: provider.getTimeout()
43
+ }));
44
+ }
45
+ /**
46
+ * 최적의 제공자 선택 (성능 기준)
47
+ */
48
+ static getOptimalProvider() {
49
+ const availableProviders = this.getAvailableProviders();
50
+ if (availableProviders.length === 0) return null;
51
+ return availableProviders.sort((a, b) => {
52
+ const scoreA = a.getRateLimit() / a.getTimeout();
53
+ const scoreB = b.getRateLimit() / b.getTimeout();
54
+ return scoreB - scoreA;
55
+ })[0];
56
+ }
57
+ /**
58
+ * 제공자 등록
59
+ */
60
+ static registerProvider(provider) {
61
+ const existingIndex = this.providers.findIndex((p) => p.name === provider.name);
62
+ if (existingIndex >= 0) {
63
+ this.providers[existingIndex] = provider;
64
+ } else {
65
+ this.providers.push(provider);
66
+ }
67
+ }
68
+ /**
69
+ * 제공자 제거
70
+ */
71
+ static unregisterProvider(name) {
72
+ const index = this.providers.findIndex((p) => p.name === name);
73
+ if (index >= 0) {
74
+ this.providers.splice(index, 1);
75
+ return true;
76
+ }
77
+ return false;
78
+ }
79
+ };
80
+ GeoIPProviderFactory.providers = [
81
+ new IPApiProvider(),
82
+ new IPApiCoProvider(),
83
+ new IPGeolocationProvider(),
84
+ new MaxMindProvider()
85
+ ];
86
+
87
+ export {
88
+ GeoIPProviderFactory
89
+ };