@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,80 @@
1
+ /**
2
+ * API 응답 타입 정의
3
+ *
4
+ * 통합 에러 시스템에서 사용하는 API 응답 형식
5
+ */
6
+ /**
7
+ * 표준 API 응답 인터페이스
8
+ *
9
+ * @template T - 응답 데이터 타입
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * // 성공 응답
14
+ * const response: IApiResponse<User> = {
15
+ * success: true,
16
+ * data: { id: '1', email: 'user@example.com' }
17
+ * };
18
+ *
19
+ * // 에러 응답
20
+ * const errorResponse: IApiResponse = {
21
+ * success: false,
22
+ * error: {
23
+ * code: 40401,
24
+ * message: '리소스를 찾을 수 없습니다.'
25
+ * }
26
+ * };
27
+ * ```
28
+ */
29
+ export interface IApiResponse<T = any> {
30
+ /**
31
+ * 요청 성공 여부
32
+ * - true: 성공 (data 필드 포함)
33
+ * - false: 실패 (error 필드 포함)
34
+ */
35
+ success: boolean;
36
+ /**
37
+ * 응답 데이터 (성공 시)
38
+ */
39
+ data?: T;
40
+ /**
41
+ * 에러 정보 (실패 시)
42
+ */
43
+ error?: {
44
+ /**
45
+ * 5자리 HTTP 확장 에러 코드
46
+ * - XXX: HTTP 상태 코드
47
+ * - YY: 세부 순번
48
+ */
49
+ code: number;
50
+ /**
51
+ * 내부 개발용 상세 메시지
52
+ */
53
+ message: string;
54
+ /**
55
+ * 사용자용 다국어 메시지 (서버에서 번역되어 전달됨)
56
+ */
57
+ userMessage?: {
58
+ title?: string;
59
+ description: string;
60
+ action?: string;
61
+ };
62
+ /**
63
+ * 요청 식별을 위한 ID
64
+ */
65
+ requestId?: string;
66
+ /**
67
+ * 상세 에러 정보 (옵셔널)
68
+ * - 검증 에러의 경우 issues 배열 포함
69
+ * - 개발 환경에서만 표시되는 추가 정보
70
+ */
71
+ details?: any;
72
+ };
73
+ /**
74
+ * 메타데이터 (옵셔널)
75
+ * - 페이지네이션 정보
76
+ * - 캐시 정보
77
+ * - 기타 메타데이터
78
+ */
79
+ meta?: any;
80
+ }
File without changes
@@ -0,0 +1,38 @@
1
+ export interface IGeoLocationData {
2
+ ipAddress: string;
3
+ country?: string;
4
+ countryName?: string;
5
+ region?: string;
6
+ regionCode?: string;
7
+ city?: string;
8
+ latitude?: number;
9
+ longitude?: number;
10
+ timezone?: string;
11
+ isp?: string;
12
+ organization?: string;
13
+ asn?: string;
14
+ isPrivate: boolean;
15
+ isProxy: boolean;
16
+ accuracy?: number;
17
+ lastUpdated?: Date;
18
+ version?: number;
19
+ validFrom?: Date;
20
+ validTo?: Date;
21
+ isActive?: boolean;
22
+ }
23
+ export interface IGeoIPResponse {
24
+ success: boolean;
25
+ data?: IGeoLocationData;
26
+ error?: string;
27
+ }
28
+ export interface IDatabaseService {
29
+ findGeoLocation(ipAddress: string): Promise<IGeoLocationData | null>;
30
+ upsertGeoLocation(data: IGeoLocationData): Promise<IGeoLocationData>;
31
+ findManyGeoLocations(ipAddresses: string[]): Promise<IGeoLocationData[]>;
32
+ }
33
+ export interface ICacheService {
34
+ get<T>(key: string): Promise<T | null>;
35
+ set<T>(key: string, value: T, ttl?: number): Promise<void>;
36
+ delete(key: string): Promise<void>;
37
+ deletePattern(pattern: string): Promise<void>;
38
+ }
File without changes
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Shared Environment Configuration Types
3
+ *
4
+ * src/shared/ 모듈에서 사용하는 환경 설정 인터페이스
5
+ * 외부에서 의존성 주입을 통해 제공되어야 합니다.
6
+ */
7
+ /**
8
+ * Redis 환경 설정
9
+ */
10
+ export interface IRedisEnv {
11
+ URL?: string;
12
+ TOKEN?: string;
13
+ IS_AVAILABLE: boolean;
14
+ /** Redis 캐시 사용 여부 (CACHE_REDIS_ENABLED) */
15
+ ENABLED: boolean;
16
+ }
17
+ /**
18
+ * 카테고리별 캐시 설정
19
+ */
20
+ export interface ICacheCategoryConfig {
21
+ ENABLED: boolean;
22
+ DURATION: number;
23
+ }
24
+ /**
25
+ * 캐시 TTL 설정
26
+ */
27
+ export interface ICacheTTLConfig {
28
+ DEFAULT: number;
29
+ SHORT: number;
30
+ LONG: number;
31
+ GEOIP: number;
32
+ SETTINGS: number;
33
+ ANALYTICS: number;
34
+ USER: number;
35
+ LINK: number;
36
+ ALIAS: number;
37
+ COMMUNITY: number;
38
+ RESERVED_WORDS: number;
39
+ }
40
+ /**
41
+ * 캐시 백엔드 타입
42
+ */
43
+ export type CacheBackendType = 'redis' | 'memory' | 'hybrid';
44
+ /**
45
+ * 인메모리 캐시 환경 설정
46
+ */
47
+ export interface IInMemoryCacheEnv {
48
+ /** 인메모리 캐시 활성화 여부 */
49
+ ENABLED: boolean;
50
+ /** 최대 항목 수 */
51
+ MAX_SIZE: number;
52
+ /** 최대 메모리 (MB) */
53
+ MAX_MB: number;
54
+ /** 교체 정책: lru | fifo | ttl */
55
+ EVICTION: 'lru' | 'fifo' | 'ttl';
56
+ /** 만료 항목 정리 주기 (ms) */
57
+ CLEANUP_INTERVAL: number;
58
+ }
59
+ /**
60
+ * 캐시 환경 설정
61
+ */
62
+ export interface ICacheEnv {
63
+ ENABLED: boolean;
64
+ /** Redis 캐시 설정 */
65
+ REDIS: {
66
+ /** Redis 캐시 사용 여부 (CACHE_REDIS_ENABLED) */
67
+ ENABLED: boolean;
68
+ };
69
+ /** 인메모리 캐시 설정 */
70
+ INMEMORY: IInMemoryCacheEnv;
71
+ TTL: ICacheTTLConfig;
72
+ ANALYTICS: ICacheCategoryConfig;
73
+ USER: ICacheCategoryConfig;
74
+ GEOIP: ICacheCategoryConfig;
75
+ SETTINGS: ICacheCategoryConfig;
76
+ RESERVED_WORDS: ICacheCategoryConfig;
77
+ ALIAS: ICacheCategoryConfig;
78
+ COMMUNITY: ICacheCategoryConfig;
79
+ LINK: ICacheCategoryConfig;
80
+ RATE_LIMIT: ICacheCategoryConfig;
81
+ URL_TOKEN: ICacheCategoryConfig;
82
+ API_KEY: ICacheCategoryConfig;
83
+ API_CONFIG: ICacheCategoryConfig;
84
+ }
85
+ /**
86
+ * Raw 환경 변수 인터페이스 (직접 접근용)
87
+ */
88
+ export interface IRawEnv {
89
+ NODE_ENV: 'development' | 'production' | 'test';
90
+ UPSTASH_REDIS_REST_URL?: string;
91
+ UPSTASH_REDIS_REST_TOKEN?: string;
92
+ CACHE_ENABLED: boolean;
93
+ }
94
+ /**
95
+ * Shared 모듈용 환경 설정 인터페이스
96
+ */
97
+ export interface ISharedEnvConfig {
98
+ env: IRawEnv;
99
+ ENV: {
100
+ REDIS: IRedisEnv;
101
+ CACHE: ICacheEnv;
102
+ };
103
+ isCacheEnabled: () => boolean;
104
+ isRedisAvailable: () => boolean;
105
+ }
File without changes
@@ -0,0 +1,152 @@
1
+ import type { IGeoLocationData, IDatabaseService, ICacheService } from './database';
2
+ export interface IGeoIPConfig {
3
+ cacheEnabled: boolean;
4
+ cacheTTL: number;
5
+ batchSize: number;
6
+ rateLimitDelay: number;
7
+ maxRetries: number;
8
+ timeout: number;
9
+ enablePrivateIPDetection: boolean;
10
+ enableProxyDetection: boolean;
11
+ fallbackProviders: string[];
12
+ }
13
+ export interface IGeoIPService {
14
+ getGeoLocation(ip: string): Promise<IGeoLocationData | null>;
15
+ getGeoLocationBatch(ips: string[]): Promise<Map<string, IGeoLocationData>>;
16
+ updateClickHistoryGeoLocation(linkId: string, ip: string): Promise<void>;
17
+ getGeographyAnalytics(linkId: string, days?: number): Promise<IGeographyAnalytics>;
18
+ getUserGeographyAnalytics(userId: string, days?: number): Promise<IGeographyAnalytics>;
19
+ findOrCreateGeoLocation(ip: string): Promise<string | null>;
20
+ isGeoLocationOutdated(validFrom: Date): boolean;
21
+ }
22
+ export interface IBatchProcessorConfig {
23
+ batchSize: number;
24
+ delayBetweenBatches: number;
25
+ maxConcurrentBatches: number;
26
+ retryAttempts: number;
27
+ timeout: number;
28
+ }
29
+ export interface IBatchProcessResult {
30
+ totalProcessed: number;
31
+ successful: number;
32
+ failed: number;
33
+ skipped: number;
34
+ errors: string[];
35
+ processingTime: number;
36
+ averageTimePerItem: number;
37
+ }
38
+ export interface IGeoIPServiceFactory {
39
+ getInstance(databaseService?: IDatabaseService, cacheService?: ICacheService, config?: Partial<IGeoIPConfig>): IGeoIPService;
40
+ }
41
+ export interface IGeoIPBatchProcessor {
42
+ processMissingGeoIPData(): Promise<IBatchProcessResult>;
43
+ processLinkGeoIPData(linkId: string): Promise<IBatchProcessResult>;
44
+ cleanupOldGeoIPData(daysOld?: number): Promise<number>;
45
+ getGeoIPStats(): Promise<IGeoIPStats>;
46
+ processUserGeoIPData(userId: string): Promise<IBatchProcessResult>;
47
+ }
48
+ export interface IGeoIPApiResponse {
49
+ status?: string;
50
+ message?: string;
51
+ country?: string;
52
+ countryCode?: string;
53
+ region?: string;
54
+ regionName?: string;
55
+ city?: string;
56
+ lat?: number;
57
+ lon?: number;
58
+ timezone?: string;
59
+ isp?: string;
60
+ org?: string;
61
+ as?: string;
62
+ proxy?: boolean;
63
+ hosting?: boolean;
64
+ country_code?: string;
65
+ country_name?: string;
66
+ region_code?: string;
67
+ latitude?: number;
68
+ longitude?: number;
69
+ organization?: string;
70
+ asn?: string;
71
+ }
72
+ export interface IGeoIPProvider {
73
+ name: string;
74
+ url(ip: string): string;
75
+ parseResponse(data: IGeoIPApiResponse): IGeoLocationData | null;
76
+ isAvailable(): boolean;
77
+ getRateLimit(): number;
78
+ getTimeout(): number;
79
+ }
80
+ export interface IGeographyAnalytics {
81
+ totalClicks: number;
82
+ countries: Array<{
83
+ country: string;
84
+ countryName: string;
85
+ count: number;
86
+ percentage: number;
87
+ }>;
88
+ cities: Array<{
89
+ country: string | null;
90
+ city: string;
91
+ count: number;
92
+ percentage: number;
93
+ }>;
94
+ regions: Array<{
95
+ country: string | null;
96
+ region: string;
97
+ count: number;
98
+ percentage: number;
99
+ }>;
100
+ timezones: Array<{
101
+ timezone: string;
102
+ count: number;
103
+ percentage: number;
104
+ }>;
105
+ isps: Array<{
106
+ isp: string;
107
+ count: number;
108
+ percentage: number;
109
+ }>;
110
+ privateIPs: number;
111
+ proxyConnections: number;
112
+ lastUpdated: Date;
113
+ }
114
+ export interface IGeoIPStats {
115
+ totalRecords: number;
116
+ privateIPs: number;
117
+ publicIPs: number;
118
+ recentUpdates: number;
119
+ oldestRecord?: Date;
120
+ newestRecord?: Date;
121
+ providerStats: Array<{
122
+ provider: string;
123
+ requests: number;
124
+ successRate: number;
125
+ averageResponseTime: number;
126
+ }>;
127
+ cacheStats: {
128
+ hitRate: number;
129
+ missRate: number;
130
+ totalRequests: number;
131
+ };
132
+ }
133
+ export interface IGeoIPError {
134
+ code: 'PROVIDER_UNAVAILABLE' | 'RATE_LIMIT_EXCEEDED' | 'INVALID_IP' | 'NETWORK_ERROR' | 'PARSING_ERROR' | 'DATABASE_ERROR';
135
+ message: string;
136
+ provider?: string;
137
+ ip?: string;
138
+ timestamp: Date;
139
+ retryable: boolean;
140
+ }
141
+ export interface IGeoIPCacheEntry {
142
+ data: IGeoLocationData;
143
+ timestamp: Date;
144
+ ttl: number;
145
+ hits: number;
146
+ }
147
+ export interface IGeoIPPreset {
148
+ name: string;
149
+ description: string;
150
+ config: IGeoIPConfig;
151
+ useCase: 'development' | 'production' | 'testing' | 'high-volume' | 'low-latency';
152
+ }
File without changes
@@ -0,0 +1,11 @@
1
+ export type Locale = 'en' | 'ko' | 'ja';
2
+ export interface II18nConfig {
3
+ defaultLocale: Locale;
4
+ locales: Locale[];
5
+ localeNames: Record<Locale, string>;
6
+ }
7
+ declare global {
8
+ interface Window {
9
+ __NEXT_LOCALE__: Locale;
10
+ }
11
+ }
File without changes
@@ -0,0 +1,139 @@
1
+ export interface IQRCodeSettings {
2
+ size: number;
3
+ color: string;
4
+ bgColor: string;
5
+ errorCorrectionLevel: 'L' | 'M' | 'Q' | 'H';
6
+ includeMargin: boolean;
7
+ marginSize: number;
8
+ logoUrl?: string;
9
+ brandColor?: string;
10
+ }
11
+ export interface IQRCodeConfig {
12
+ id: string;
13
+ linkId: string;
14
+ settings: IQRCodeSettings;
15
+ isActive: boolean;
16
+ createdAt: Date;
17
+ updatedAt: Date;
18
+ }
19
+ export interface IQRTemplate {
20
+ id: string;
21
+ userId: string;
22
+ name: string;
23
+ description?: string;
24
+ settings: IQRCodeSettings;
25
+ isDefault: boolean;
26
+ isPublic: boolean;
27
+ createdAt: Date;
28
+ updatedAt: Date;
29
+ }
30
+ export interface IQRCodeStats {
31
+ totalClicks: number;
32
+ qrClicks: number;
33
+ normalClicks: number;
34
+ aliasClicks: number;
35
+ apiClicks: number;
36
+ qrUsageRate: number;
37
+ }
38
+ export interface IQRCodeAnalytics {
39
+ dailyStats: Array<{
40
+ date: string;
41
+ totalClicks: number;
42
+ qrClicks: number;
43
+ qrUsageRate: number;
44
+ }>;
45
+ deviceStats: Array<{
46
+ deviceType: string;
47
+ totalClicks: number;
48
+ qrClicks: number;
49
+ qrUsageRate: number;
50
+ }>;
51
+ browserStats: Array<{
52
+ browser: string;
53
+ totalClicks: number;
54
+ qrClicks: number;
55
+ qrUsageRate: number;
56
+ }>;
57
+ }
58
+ export interface IQRCodeDownloadOptions {
59
+ format: 'png' | 'svg';
60
+ filename: string;
61
+ quality?: number;
62
+ }
63
+ export declare const DEFAULT_QR_SETTINGS: IQRCodeSettings;
64
+ export declare const QR_CODE_TEMPLATES: readonly [{
65
+ readonly id: "default";
66
+ readonly name: "기본";
67
+ readonly description: "표준 QR 코드 스타일";
68
+ readonly settings: IQRCodeSettings;
69
+ }, {
70
+ readonly id: "minimal";
71
+ readonly name: "미니멀";
72
+ readonly description: "깔끔한 미니멀 스타일";
73
+ readonly settings: {
74
+ readonly color: "#333333";
75
+ readonly bgColor: "#FFFFFF";
76
+ readonly marginSize: 2;
77
+ readonly size: number;
78
+ readonly errorCorrectionLevel: "L" | "M" | "Q" | "H";
79
+ readonly includeMargin: boolean;
80
+ readonly logoUrl?: string;
81
+ readonly brandColor?: string;
82
+ };
83
+ }, {
84
+ readonly id: "branded";
85
+ readonly name: "브랜드";
86
+ readonly description: "브랜드 컬러 적용";
87
+ readonly settings: {
88
+ readonly color: "#3B82F6";
89
+ readonly bgColor: "#F8FAFC";
90
+ readonly errorCorrectionLevel: "H";
91
+ readonly size: number;
92
+ readonly includeMargin: boolean;
93
+ readonly marginSize: number;
94
+ readonly logoUrl?: string;
95
+ readonly brandColor?: string;
96
+ };
97
+ }, {
98
+ readonly id: "dark";
99
+ readonly name: "다크";
100
+ readonly description: "다크 테마 스타일";
101
+ readonly settings: {
102
+ readonly color: "#FFFFFF";
103
+ readonly bgColor: "#1F2937";
104
+ readonly errorCorrectionLevel: "Q";
105
+ readonly size: number;
106
+ readonly includeMargin: boolean;
107
+ readonly marginSize: number;
108
+ readonly logoUrl?: string;
109
+ readonly brandColor?: string;
110
+ };
111
+ }, {
112
+ readonly id: "colorful";
113
+ readonly name: "컬러풀";
114
+ readonly description: "화려한 컬러 스타일";
115
+ readonly settings: {
116
+ readonly color: "#EF4444";
117
+ readonly bgColor: "#FEF3C7";
118
+ readonly errorCorrectionLevel: "H";
119
+ readonly size: number;
120
+ readonly includeMargin: boolean;
121
+ readonly marginSize: number;
122
+ readonly logoUrl?: string;
123
+ readonly brandColor?: string;
124
+ };
125
+ }, {
126
+ readonly id: "large";
127
+ readonly name: "라지";
128
+ readonly description: "큰 크기 QR 코드";
129
+ readonly settings: {
130
+ readonly size: 500;
131
+ readonly errorCorrectionLevel: "H";
132
+ readonly color: string;
133
+ readonly bgColor: string;
134
+ readonly includeMargin: boolean;
135
+ readonly marginSize: number;
136
+ readonly logoUrl?: string;
137
+ readonly brandColor?: string;
138
+ };
139
+ }];
@@ -0,0 +1,75 @@
1
+ import {
2
+ __spreadProps,
3
+ __spreadValues
4
+ } from "../chunk-ORMEWXMH.js";
5
+
6
+ // src/types/qr-code.ts
7
+ var DEFAULT_QR_SETTINGS = {
8
+ size: 300,
9
+ color: "#000000",
10
+ bgColor: "#FFFFFF",
11
+ errorCorrectionLevel: "M",
12
+ includeMargin: true,
13
+ marginSize: 4
14
+ };
15
+ var QR_CODE_TEMPLATES = [
16
+ {
17
+ id: "default",
18
+ name: "\uAE30\uBCF8",
19
+ description: "\uD45C\uC900 QR \uCF54\uB4DC \uC2A4\uD0C0\uC77C",
20
+ settings: DEFAULT_QR_SETTINGS
21
+ },
22
+ {
23
+ id: "minimal",
24
+ name: "\uBBF8\uB2C8\uBA40",
25
+ description: "\uAE54\uB054\uD55C \uBBF8\uB2C8\uBA40 \uC2A4\uD0C0\uC77C",
26
+ settings: __spreadProps(__spreadValues({}, DEFAULT_QR_SETTINGS), {
27
+ color: "#333333",
28
+ bgColor: "#FFFFFF",
29
+ marginSize: 2
30
+ })
31
+ },
32
+ {
33
+ id: "branded",
34
+ name: "\uBE0C\uB79C\uB4DC",
35
+ description: "\uBE0C\uB79C\uB4DC \uCEEC\uB7EC \uC801\uC6A9",
36
+ settings: __spreadProps(__spreadValues({}, DEFAULT_QR_SETTINGS), {
37
+ color: "#3B82F6",
38
+ bgColor: "#F8FAFC",
39
+ errorCorrectionLevel: "H"
40
+ })
41
+ },
42
+ {
43
+ id: "dark",
44
+ name: "\uB2E4\uD06C",
45
+ description: "\uB2E4\uD06C \uD14C\uB9C8 \uC2A4\uD0C0\uC77C",
46
+ settings: __spreadProps(__spreadValues({}, DEFAULT_QR_SETTINGS), {
47
+ color: "#FFFFFF",
48
+ bgColor: "#1F2937",
49
+ errorCorrectionLevel: "Q"
50
+ })
51
+ },
52
+ {
53
+ id: "colorful",
54
+ name: "\uCEEC\uB7EC\uD480",
55
+ description: "\uD654\uB824\uD55C \uCEEC\uB7EC \uC2A4\uD0C0\uC77C",
56
+ settings: __spreadProps(__spreadValues({}, DEFAULT_QR_SETTINGS), {
57
+ color: "#EF4444",
58
+ bgColor: "#FEF3C7",
59
+ errorCorrectionLevel: "H"
60
+ })
61
+ },
62
+ {
63
+ id: "large",
64
+ name: "\uB77C\uC9C0",
65
+ description: "\uD070 \uD06C\uAE30 QR \uCF54\uB4DC",
66
+ settings: __spreadProps(__spreadValues({}, DEFAULT_QR_SETTINGS), {
67
+ size: 500,
68
+ errorCorrectionLevel: "H"
69
+ })
70
+ }
71
+ ];
72
+ export {
73
+ DEFAULT_QR_SETTINGS,
74
+ QR_CODE_TEMPLATES
75
+ };
@@ -0,0 +1,54 @@
1
+ /**
2
+ * 범용 사용자 인터페이스
3
+ * 프로젝트별 특화 필드는 상속받아 확장
4
+ */
5
+ export interface IUser {
6
+ id: string;
7
+ email: string;
8
+ name?: string | null;
9
+ createdAt: string;
10
+ updatedAt?: string;
11
+ isActive?: boolean;
12
+ emailVerified?: Date | null;
13
+ lastLoginAt?: string | null;
14
+ }
15
+ /**
16
+ * 범용 사용자 생성 데이터
17
+ */
18
+ export interface IUserCreateData {
19
+ email: string;
20
+ name?: string;
21
+ password?: string;
22
+ }
23
+ /**
24
+ * 범용 사용자 업데이트 데이터
25
+ */
26
+ export interface IUserUpdateData {
27
+ name?: string;
28
+ email?: string;
29
+ isActive?: boolean;
30
+ }
31
+ /**
32
+ * 범용 사용자 필터
33
+ */
34
+ export interface IUserFilters {
35
+ search?: string;
36
+ isActive?: string;
37
+ }
38
+ /**
39
+ * 범용 사용자 정렬 옵션
40
+ */
41
+ export interface IUserSortOptions {
42
+ sort: string;
43
+ order: 'asc' | 'desc';
44
+ }
45
+ /**
46
+ * 범용 사용자 목록 결과
47
+ */
48
+ export interface IUserListResult<T = IUser> {
49
+ users: T[];
50
+ total: number;
51
+ page: number;
52
+ pageSize: number;
53
+ totalPages: number;
54
+ }
File without changes