@withwiz/toolkit 0.2.1 → 0.2.3

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 (84) hide show
  1. package/dist/auth/index.js +18 -18
  2. package/dist/{chunk-6JZQE7ZQ.js → chunk-GSUQE3SZ.js} +8 -8
  3. package/dist/{chunk-FH6E36YZ.js → chunk-SLG26KHZ.js} +1 -1
  4. package/dist/components/ui/DataTable.js +6 -6
  5. package/dist/components/ui/data-table/DataTable.js +6 -6
  6. package/dist/components/ui/data-table/DataTableFilters.js +2 -2
  7. package/dist/components/ui/data-table/DataTableSearch.js +2 -2
  8. package/dist/constants/index.js +13 -13
  9. package/dist/error/index.d.ts +0 -4
  10. package/dist/error/index.js +12 -80
  11. package/dist/geolocation/index.js +4 -4
  12. package/dist/geolocation/providers/index.js +4 -4
  13. package/dist/middleware/error-handler.js +2 -2
  14. package/dist/middleware/index.js +3 -3
  15. package/dist/middleware/wrappers.js +3 -3
  16. package/dist/utils/format-number.js +30 -4
  17. package/dist/utils/input-validation.js +4 -4
  18. package/dist/utils/short-code-generator.js +36 -4
  19. package/dist/utils/url-normalizer.js +194 -10
  20. package/package.json +1 -2
  21. package/dist/chunk-5ATB5D6S.js +0 -40
  22. package/dist/chunk-6C7HQIX4.js +0 -13
  23. package/dist/chunk-6UAYU5NU.js +0 -102
  24. package/dist/chunk-7VJNLGAS.js +0 -110
  25. package/dist/chunk-7XFHGAJP.js +0 -0
  26. package/dist/chunk-A6EAAWMK.js +0 -50
  27. package/dist/chunk-COK4ZXNG.js +0 -0
  28. package/dist/chunk-EQYTE7WD.js +0 -139
  29. package/dist/chunk-FW3IEJ7H.js +0 -71
  30. package/dist/chunk-HGC4CCKB.js +0 -29
  31. package/dist/chunk-JS5VI3OW.js +0 -143
  32. package/dist/chunk-MYLGYX4K.js +0 -57
  33. package/dist/chunk-TDZJ6SAI.js +0 -34
  34. package/dist/chunk-TEIYA7U4.js +0 -72
  35. package/dist/chunk-ULF5RDDX.js +0 -0
  36. package/dist/chunk-VWODEQ5C.js +0 -204
  37. package/dist/chunk-Y2TUZFCP.js +0 -0
  38. package/dist/chunk-YJ3TLEW3.js +0 -100
  39. package/dist/chunk-ZHVUK5OY.js +0 -314
  40. package/dist/chunk-ZZIKRBJU.js +0 -96
  41. package/dist/error/components/EmptyState.d.ts +0 -50
  42. package/dist/error/components/ErrorAlert.d.ts +0 -50
  43. package/dist/error/components/ErrorPage.d.ts +0 -39
  44. package/dist/error/components/LoadingState.d.ts +0 -37
  45. package/dist/error/components/index.d.ts +0 -13
  46. package/dist/error/components/index.js +0 -18
  47. package/dist/error/hooks/index.d.ts +0 -7
  48. package/dist/error/hooks/index.js +0 -14
  49. package/dist/error/hooks/useErrorHandler.d.ts +0 -67
  50. package/dist/error/hooks/useErrorHandler.js +0 -14
  51. package/dist/error/logging/error-logger.d.ts +0 -77
  52. package/dist/error/logging/error-logger.js +0 -10
  53. package/dist/error/logging/index.d.ts +0 -9
  54. package/dist/error/logging/index.js +0 -35
  55. package/dist/error/logging/transports/base.d.ts +0 -30
  56. package/dist/error/logging/transports/base.js +0 -7
  57. package/dist/error/logging/transports/console.d.ts +0 -40
  58. package/dist/error/logging/transports/console.js +0 -9
  59. package/dist/error/logging/transports/file.d.ts +0 -49
  60. package/dist/error/logging/transports/file.js +0 -8
  61. package/dist/error/logging/transports/index.d.ts +0 -12
  62. package/dist/error/logging/transports/index.js +0 -25
  63. package/dist/error/logging/transports/sentry.d.ts +0 -44
  64. package/dist/error/logging/transports/sentry.js +0 -9
  65. package/dist/error/logging/transports/slack.d.ts +0 -51
  66. package/dist/error/logging/transports/slack.js +0 -9
  67. package/dist/error/logging/types.d.ts +0 -83
  68. package/dist/error/logging/types.js +0 -7
  69. package/dist/error/recovery/circuit-breaker.d.ts +0 -85
  70. package/dist/error/recovery/circuit-breaker.js +0 -9
  71. package/dist/error/recovery/degradation.d.ts +0 -56
  72. package/dist/error/recovery/degradation.js +0 -7
  73. package/dist/error/recovery/fallback.d.ts +0 -55
  74. package/dist/error/recovery/fallback.js +0 -11
  75. package/dist/error/recovery/index.d.ts +0 -12
  76. package/dist/error/recovery/index.js +0 -26
  77. package/dist/error/recovery/retry.d.ts +0 -44
  78. package/dist/error/recovery/retry.js +0 -7
  79. package/dist/utils/shared-utils.d.ts +0 -25
  80. package/dist/utils/shared-utils.js +0 -43
  81. package/dist/{chunk-SEZJN4TC.js → chunk-LJEGM4OO.js} +3 -3
  82. package/dist/{chunk-S73334QY.js → chunk-QF6FH4GZ.js} +3 -3
  83. package/dist/{chunk-KHYY4KCV.js → chunk-TH45RVP7.js} +3 -3
  84. package/dist/{chunk-5OWZKYWQ.js → chunk-TMVS4F7E.js} +3 -3
@@ -1,85 +0,0 @@
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
- }
@@ -1,9 +0,0 @@
1
- import {
2
- CircuitBreaker,
3
- ECircuitState
4
- } from "../../chunk-7VJNLGAS.js";
5
- import "../../chunk-ORMEWXMH.js";
6
- export {
7
- CircuitBreaker,
8
- ECircuitState
9
- };
@@ -1,56 +0,0 @@
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
- }
@@ -1,7 +0,0 @@
1
- import {
2
- FeatureDegradation
3
- } from "../../chunk-TEIYA7U4.js";
4
- import "../../chunk-ORMEWXMH.js";
5
- export {
6
- FeatureDegradation
7
- };
@@ -1,55 +0,0 @@
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>;
@@ -1,11 +0,0 @@
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
- };
@@ -1,12 +0,0 @@
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';
@@ -1,26 +0,0 @@
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
- };
@@ -1,44 +0,0 @@
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>;
@@ -1,7 +0,0 @@
1
- import {
2
- withRetry
3
- } from "../../chunk-A6EAAWMK.js";
4
- import "../../chunk-ORMEWXMH.js";
5
- export {
6
- withRetry
7
- };
@@ -1,25 +0,0 @@
1
- /**
2
- * shared-utils (범용 유틸리티)
3
- *
4
- * 이 파일은 프로젝트 독립적인 범용 유틸리티만 포함합니다.
5
- * URL shortener 비즈니스 로직은 <your-project>/utils/ 에 위치합니다.
6
- *
7
- * @see <your-project>/utils/alias-validation.ts - Alias 검증 관련 함수
8
- */
9
- import type { IGeoLocationData, IGeoIPResponse } from '@withwiz/types/database';
10
- export type { IGeoLocationData, IGeoIPResponse };
11
- export * from './url-normalizer';
12
- export * from './format-number';
13
- export * from './short-code-generator';
14
- /**
15
- * 에러 메시지 생성 (템플릿 변수 치환)
16
- *
17
- * @param code - 에러 코드
18
- * @param message - 에러 메시지 템플릿
19
- * @param replacements - 치환할 변수들
20
- * @returns 에러 객체
21
- */
22
- export declare function createValidationError(code: string, message: string, replacements?: Record<string, string>): {
23
- code: string;
24
- message: string;
25
- };
@@ -1,43 +0,0 @@
1
- import {
2
- generateShortCode,
3
- generateUniqueShortCode
4
- } from "../chunk-5ATB5D6S.js";
5
- import {
6
- SUPPORTED_SCHEMES,
7
- extractScheme,
8
- getUrlType,
9
- hasValidScheme,
10
- isAppScheme,
11
- isWebUrl,
12
- normalizeUrl,
13
- validateUrl
14
- } from "../chunk-VWODEQ5C.js";
15
- import {
16
- formatChartNumber,
17
- formatNumber
18
- } from "../chunk-TDZJ6SAI.js";
19
- import "../chunk-ORMEWXMH.js";
20
-
21
- // src/utils/shared-utils.ts
22
- function createValidationError(code, message, replacements = {}) {
23
- let finalMessage = message;
24
- Object.entries(replacements).forEach(([key, value]) => {
25
- finalMessage = finalMessage.replace(`{${key}}`, value);
26
- });
27
- return { code, message: finalMessage };
28
- }
29
- export {
30
- SUPPORTED_SCHEMES,
31
- createValidationError,
32
- extractScheme,
33
- formatChartNumber,
34
- formatNumber,
35
- generateShortCode,
36
- generateUniqueShortCode,
37
- getUrlType,
38
- hasValidScheme,
39
- isAppScheme,
40
- isWebUrl,
41
- normalizeUrl,
42
- validateUrl
43
- };
@@ -1,6 +1,3 @@
1
- import {
2
- Input
3
- } from "./chunk-RJUVBBZG.js";
4
1
  import {
5
2
  Label
6
3
  } from "./chunk-IJEZ7G7S.js";
@@ -14,6 +11,9 @@ import {
14
11
  import {
15
12
  Button
16
13
  } from "./chunk-L25BNU3E.js";
14
+ import {
15
+ Input
16
+ } from "./chunk-RJUVBBZG.js";
17
17
  import {
18
18
  cn
19
19
  } from "./chunk-62FLBG6B.js";
@@ -1,6 +1,3 @@
1
- import {
2
- IPApiProvider
3
- } from "./chunk-DEEJBDJE.js";
4
1
  import {
5
2
  IPApiCoProvider
6
3
  } from "./chunk-VSGKVZB4.js";
@@ -10,6 +7,9 @@ import {
10
7
  import {
11
8
  MaxMindProvider
12
9
  } from "./chunk-4NWJ3WCZ.js";
10
+ import {
11
+ IPApiProvider
12
+ } from "./chunk-DEEJBDJE.js";
13
13
 
14
14
  // src/geolocation/providers/index.ts
15
15
  var GeoIPProviderFactory = class {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  formatLabel
3
3
  } from "./chunk-NY5QXT33.js";
4
- import {
5
- Input
6
- } from "./chunk-RJUVBBZG.js";
7
4
  import {
8
5
  Button
9
6
  } from "./chunk-L25BNU3E.js";
7
+ import {
8
+ Input
9
+ } from "./chunk-RJUVBBZG.js";
10
10
 
11
11
  // src/components/ui/data-table/DataTableSearch.tsx
12
12
  import { isValidElement } from "react";
@@ -1,9 +1,9 @@
1
- import {
2
- AppError
3
- } from "./chunk-MLGO3HLS.js";
4
1
  import {
5
2
  getErrorMessage
6
3
  } from "./chunk-EEUBKZV4.js";
4
+ import {
5
+ AppError
6
+ } from "./chunk-MLGO3HLS.js";
7
7
  import {
8
8
  ERROR_CODES
9
9
  } from "./chunk-Y3OTJH2S.js";