@withwiz/toolkit 0.2.8 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/config.d.ts +16 -0
- package/dist/auth/config.js +13 -0
- package/dist/auth/index.js +18 -18
- package/dist/cache/cache-config.js +6 -3
- package/dist/cache/cache-env.d.ts +11 -20
- package/dist/cache/cache-env.js +5 -6
- package/dist/cache/cache-factory.js +15 -10
- package/dist/cache/cache-invalidation.js +15 -10
- package/dist/cache/cache-redis.js +8 -3
- package/dist/cache/cache-wrapper.js +15 -10
- package/dist/cache/cache.js +32 -24
- package/dist/cache/config.d.ts +116 -0
- package/dist/cache/config.js +13 -0
- package/dist/cache/hybrid-cache-manager.js +10 -5
- package/dist/cache/index.d.ts +2 -1
- package/dist/cache/index.js +32 -24
- package/dist/cache/inmemory-cache-manager.js +6 -2
- package/dist/cache/noop-cache-manager.js +7 -4
- package/dist/cache/redis-cache-manager.js +9 -4
- package/dist/{chunk-JWZSWMOM.js → chunk-2KDLKHTO.js} +1 -1
- package/dist/chunk-2QH66EVQ.js +11 -0
- package/dist/chunk-3CBGGMIY.js +39 -0
- package/dist/{chunk-67KRDPIH.js → chunk-4HBAPPB2.js} +2 -2
- package/dist/{chunk-QMZ75GBU.js → chunk-6MI4XLWC.js} +1 -1
- package/dist/{chunk-BX5CNRVS.js → chunk-6SOQUYOU.js} +2 -2
- package/dist/{chunk-YVF4RXOK.js → chunk-7IN4WRSO.js} +15 -15
- package/dist/{chunk-I5PCM2JQ.js → chunk-AXCB7SKY.js} +4 -4
- package/dist/chunk-AYZJN32D.js +45 -0
- package/dist/{chunk-74MSBKYW.js → chunk-BDY3AOX5.js} +14 -10
- package/dist/{chunk-IT43YQND.js → chunk-BYCFXGQL.js} +20 -5
- package/dist/{chunk-QF6FH4GZ.js → chunk-CUZPD3BF.js} +5 -5
- package/dist/{chunk-JOGXLVUZ.js → chunk-E54MAI4I.js} +1 -1
- package/dist/{chunk-WEDR5GJO.js → chunk-FD2TXDTO.js} +2 -2
- package/dist/{chunk-HOMWLK62.js → chunk-FDRIFPG6.js} +2 -2
- package/dist/{chunk-AOZVTVJG.js → chunk-FPESPW6P.js} +1 -1
- package/dist/{chunk-4NWJ3WCZ.js → chunk-G5OMETUS.js} +8 -1
- package/dist/chunk-GFWGLWTS.js +48 -0
- package/dist/{chunk-5A2L6TXD.js → chunk-GQVBWZLH.js} +34 -15
- package/dist/{chunk-DH2ZHGW2.js → chunk-HHCDMWEF.js} +14 -2
- package/dist/{chunk-Y6IHEA3Q.js → chunk-J4TTSXDN.js} +3 -3
- package/dist/{chunk-WZDS4QEC.js → chunk-JOM3N4EJ.js} +1 -1
- package/dist/{chunk-WSUFD4SO.js → chunk-JR7GVCQX.js} +11 -3
- package/dist/chunk-K25ICPU4.js +8 -0
- package/dist/{chunk-T3YUJYBX.js → chunk-K3HAYBWX.js} +1 -1
- package/dist/{chunk-WDJLAZCW.js → chunk-KGHWGLED.js} +18 -3
- package/dist/{chunk-XN4YP4XO.js → chunk-KZUBO2IL.js} +5 -5
- package/dist/{chunk-3GEQQ4VL.js → chunk-LD7POV6B.js} +10 -10
- package/dist/{chunk-7KCWVRPR.js → chunk-LFQ3IQQB.js} +2 -2
- package/dist/{chunk-RPWEGUUS.js → chunk-LX2EYD74.js} +8 -8
- package/dist/{chunk-HCTNZM7D.js → chunk-O7CK3CKJ.js} +1 -1
- package/dist/chunk-OHBAELPZ.js +46 -0
- package/dist/{chunk-M5LIX3TD.js → chunk-OIRAH57Y.js} +1 -1
- package/dist/chunk-OZE5KUS3.js +50 -0
- package/dist/{chunk-NJXCFTOE.js → chunk-QVWDWROP.js} +1 -1
- package/dist/{chunk-YMIDD4YE.js → chunk-RWVGJUON.js} +6 -6
- package/dist/{chunk-6WVKLXVT.js → chunk-S5UCZ2T3.js} +1 -1
- package/dist/chunk-SFPMFVSD.js +40 -0
- package/dist/{chunk-R5OFGX3C.js → chunk-SV7X6HEN.js} +6 -6
- package/dist/chunk-TFD3DSM2.js +110 -0
- package/dist/{chunk-GCZOXUDV.js → chunk-TO5CMMQC.js} +50 -10
- package/dist/{chunk-LEWQBXN6.js → chunk-VF4EVAMV.js} +1 -1
- package/dist/chunk-WNF2RKFA.js +122 -0
- package/dist/chunk-XI4MRH5P.js +156 -0
- package/dist/components/ui/DataTable.js +5 -5
- package/dist/components/ui/data-table/DataTable.js +5 -5
- package/dist/components/ui/data-table/DataTableFilters.js +2 -2
- package/dist/components/ui/data-table/DataTableSearch.js +2 -2
- package/dist/config/common.d.ts +12 -0
- package/dist/config/common.js +13 -0
- package/dist/config/errors.d.ts +3 -0
- package/dist/config/errors.js +7 -0
- package/dist/config/warn.d.ts +4 -0
- package/dist/config/warn.js +7 -0
- package/dist/constants/index.js +13 -13
- package/dist/error/error-handler.js +6 -2
- package/dist/error/index.js +6 -2
- package/dist/geolocation/batch-processor.js +6 -2
- package/dist/geolocation/config.d.ts +14 -0
- package/dist/geolocation/config.js +13 -0
- package/dist/geolocation/index.js +13 -8
- package/dist/geolocation/providers/index.js +9 -6
- package/dist/geolocation/providers/ipgeolocation-provider.js +4 -1
- package/dist/geolocation/providers/maxmind-provider.js +4 -1
- package/dist/initialize.d.ts +18 -0
- package/dist/initialize.js +41 -0
- package/dist/logger/config.d.ts +20 -0
- package/dist/logger/config.js +13 -0
- package/dist/logger/logger.js +5 -1
- package/dist/middleware/auth.js +7 -2
- package/dist/middleware/cors-config.d.ts +14 -0
- package/dist/middleware/cors-config.js +13 -0
- package/dist/middleware/cors.js +7 -2
- package/dist/middleware/error-handler.js +7 -3
- package/dist/middleware/index.js +19 -13
- package/dist/middleware/middleware-chain.js +6 -2
- package/dist/middleware/rate-limit.js +6 -2
- package/dist/middleware/response-logger.js +6 -2
- package/dist/middleware/security.js +6 -2
- package/dist/middleware/wrappers.js +16 -10
- package/dist/storage/config.d.ts +20 -0
- package/dist/storage/config.js +13 -0
- package/dist/storage/r2-storage.d.ts +4 -0
- package/dist/storage/r2-storage.js +19 -10
- package/dist/system/cpu.js +7 -3
- package/dist/system/disk.js +7 -3
- package/dist/system/environment.js +11 -3
- package/dist/system/health-check.js +9 -3
- package/dist/system/index.js +18 -10
- package/dist/system/memory.js +7 -3
- package/dist/system/network.js +7 -3
- package/dist/system/utils.js +6 -2
- package/dist/types/env.d.ts +12 -2
- package/dist/utils/cors.js +5 -1
- package/dist/utils/csv-export.js +6 -2
- package/dist/utils/error-processor.js +6 -2
- package/dist/utils/index.js +23 -18
- package/package.json +10 -1
- package/dist/chunk-N4XYQB2G.js +0 -193
- package/dist/chunk-OFPRBEO6.js +0 -93
- package/dist/{chunk-TH45RVP7.js → chunk-KHYY4KCV.js} +3 -3
- package/dist/{chunk-EBUEBEJX.js → chunk-QMCOX3DP.js} +0 -0
- package/dist/{chunk-X2UP5PNN.js → chunk-SEZJN4TC.js} +3 -3
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface AuthConfig {
|
|
2
|
+
jwtSecret: string;
|
|
3
|
+
accessTokenExpiry?: string;
|
|
4
|
+
refreshTokenExpiry?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ResolvedAuthConfig {
|
|
7
|
+
jwtSecret: string;
|
|
8
|
+
accessTokenExpiry: string;
|
|
9
|
+
refreshTokenExpiry: string;
|
|
10
|
+
}
|
|
11
|
+
declare global {
|
|
12
|
+
var __withwiz_auth_config: ResolvedAuthConfig | undefined;
|
|
13
|
+
}
|
|
14
|
+
export declare function initializeAuth(config: AuthConfig): void;
|
|
15
|
+
export declare function getAuthConfig(): ResolvedAuthConfig;
|
|
16
|
+
export declare function resetAuth(): void;
|
package/dist/auth/index.js
CHANGED
|
@@ -1,24 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
OAuthManager
|
|
3
|
-
} from "../chunk-V5K5FYU7.js";
|
|
4
|
-
import {
|
|
5
|
-
DEFAULT_PASSWORD_CONFIG,
|
|
6
|
-
createPasswordHasher,
|
|
7
|
-
createPasswordSchema,
|
|
8
|
-
createPasswordValidator,
|
|
9
|
-
getPasswordStrength,
|
|
10
|
-
passwordValidator,
|
|
11
|
-
validatePassword
|
|
12
|
-
} from "../chunk-G26T2PRQ.js";
|
|
13
|
-
import {
|
|
14
|
-
PasswordHasher,
|
|
15
|
-
PasswordValidator,
|
|
16
|
-
defaultPasswordSchema,
|
|
17
|
-
strongPasswordSchema
|
|
18
|
-
} from "../chunk-IHXRF3BH.js";
|
|
19
1
|
import {
|
|
20
2
|
TokenGenerator
|
|
21
3
|
} from "../chunk-GDWEDUHO.js";
|
|
4
|
+
import {
|
|
5
|
+
OAuthManager
|
|
6
|
+
} from "../chunk-V5K5FYU7.js";
|
|
22
7
|
import {
|
|
23
8
|
JWTClientManager,
|
|
24
9
|
clearStoredTokens,
|
|
@@ -35,6 +20,21 @@ import {
|
|
|
35
20
|
isTokenExpiringSoon,
|
|
36
21
|
storeTokens
|
|
37
22
|
} from "../chunk-XRRPEBKB.js";
|
|
23
|
+
import {
|
|
24
|
+
DEFAULT_PASSWORD_CONFIG,
|
|
25
|
+
createPasswordHasher,
|
|
26
|
+
createPasswordSchema,
|
|
27
|
+
createPasswordValidator,
|
|
28
|
+
getPasswordStrength,
|
|
29
|
+
passwordValidator,
|
|
30
|
+
validatePassword
|
|
31
|
+
} from "../chunk-G26T2PRQ.js";
|
|
32
|
+
import {
|
|
33
|
+
PasswordHasher,
|
|
34
|
+
PasswordValidator,
|
|
35
|
+
defaultPasswordSchema,
|
|
36
|
+
strongPasswordSchema
|
|
37
|
+
} from "../chunk-IHXRF3BH.js";
|
|
38
38
|
import {
|
|
39
39
|
OAuthProvider,
|
|
40
40
|
PasswordStrength,
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getCacheConfig,
|
|
3
3
|
getCacheTTL
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-O7CK3CKJ.js";
|
|
5
|
+
import "../chunk-XI4MRH5P.js";
|
|
6
|
+
import "../chunk-SFPMFVSD.js";
|
|
7
|
+
import "../chunk-TFD3DSM2.js";
|
|
8
|
+
import "../chunk-K25ICPU4.js";
|
|
9
|
+
import "../chunk-2QH66EVQ.js";
|
|
7
10
|
import "../chunk-IQQKKUAV.js";
|
|
8
11
|
import "../chunk-ORMEWXMH.js";
|
|
9
12
|
export {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import type { ISharedEnvConfig, IRawEnv } from '@withwiz/types/env';
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Cache Environment Configuration
|
|
3
|
+
*
|
|
4
|
+
* 캐시 모듈의 환경 설정 관리
|
|
5
|
+
* - getResolvedCacheConfig()에서 설정을 읽어 ISharedEnvConfig 호환 레이어 제공
|
|
6
|
+
* - process.env 의존성 없음
|
|
5
7
|
*/
|
|
6
|
-
|
|
8
|
+
import type { ISharedEnvConfig, IRawEnv } from '@withwiz/types/env';
|
|
7
9
|
/**
|
|
8
|
-
* 현재
|
|
10
|
+
* 현재 캐시 설정을 ISharedEnvConfig 형태로 반환 (하위 호환 레이어)
|
|
9
11
|
*/
|
|
10
12
|
export declare function getConfig(): ISharedEnvConfig;
|
|
11
13
|
export declare const getEnv: () => IRawEnv;
|
|
@@ -13,21 +15,6 @@ export declare const getENV: () => {
|
|
|
13
15
|
REDIS: import("@withwiz/types/env").IRedisEnv;
|
|
14
16
|
CACHE: import("@withwiz/types/env").ICacheEnv;
|
|
15
17
|
};
|
|
16
|
-
declare global {
|
|
17
|
-
var __cacheInitialized: boolean | undefined;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* 캐시 모듈 초기화 (외부에서 환경 설정 주입)
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```typescript
|
|
24
|
-
* import { initializeCache } from '@withwiz/cache/cache';
|
|
25
|
-
* import { env, ENV, isCacheEnabled, isRedisAvailable } from '<your-project>/env';
|
|
26
|
-
*
|
|
27
|
-
* initializeCache({ env, ENV, isCacheEnabled, isRedisAvailable });
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
export declare function initializeCache(config: ISharedEnvConfig): void;
|
|
31
18
|
export declare const isCacheEnabled: () => boolean;
|
|
32
19
|
export declare function validateRedisEnvironment(): {
|
|
33
20
|
isValid: boolean;
|
|
@@ -73,3 +60,7 @@ export interface CacheHealthConfig {
|
|
|
73
60
|
* 캐시 건강상태 설정 가져오기
|
|
74
61
|
*/
|
|
75
62
|
export declare function getCacheHealthConfig(): CacheHealthConfig;
|
|
63
|
+
/**
|
|
64
|
+
* 캐시 리포트 설정 인터페이스 (CacheHealthConfig의 리포트 관련 항목)
|
|
65
|
+
*/
|
|
66
|
+
export type CacheReportConfig = Pick<CacheHealthConfig, 'reportHitRateThreshold' | 'reportResponseTimeThreshold' | 'reportInvalidationThreshold' | 'reportMinRequests'>;
|
package/dist/cache/cache-env.js
CHANGED
|
@@ -2,24 +2,23 @@ import {
|
|
|
2
2
|
getCacheFallbackConfig,
|
|
3
3
|
getCacheHealthConfig,
|
|
4
4
|
getConfig,
|
|
5
|
-
getDefaultConfig,
|
|
6
5
|
getENV,
|
|
7
6
|
getEnv,
|
|
8
|
-
initializeCache,
|
|
9
7
|
isCacheEnabled,
|
|
10
8
|
validateRedisEnvironment
|
|
11
|
-
} from "../chunk-
|
|
12
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-XI4MRH5P.js";
|
|
10
|
+
import "../chunk-SFPMFVSD.js";
|
|
11
|
+
import "../chunk-TFD3DSM2.js";
|
|
12
|
+
import "../chunk-K25ICPU4.js";
|
|
13
|
+
import "../chunk-2QH66EVQ.js";
|
|
13
14
|
import "../chunk-IQQKKUAV.js";
|
|
14
15
|
import "../chunk-ORMEWXMH.js";
|
|
15
16
|
export {
|
|
16
17
|
getCacheFallbackConfig,
|
|
17
18
|
getCacheHealthConfig,
|
|
18
19
|
getConfig,
|
|
19
|
-
getDefaultConfig,
|
|
20
20
|
getENV,
|
|
21
21
|
getEnv,
|
|
22
|
-
initializeCache,
|
|
23
22
|
isCacheEnabled,
|
|
24
23
|
validateRedisEnvironment
|
|
25
24
|
};
|
|
@@ -3,19 +3,24 @@ import {
|
|
|
3
3
|
geoCache,
|
|
4
4
|
getCacheManager,
|
|
5
5
|
getEffectiveCacheBackend
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-XN4YP4XO.js";
|
|
12
|
-
import "../chunk-HCTNZM7D.js";
|
|
6
|
+
} from "../chunk-7IN4WRSO.js";
|
|
7
|
+
import "../chunk-FDRIFPG6.js";
|
|
8
|
+
import "../chunk-KZUBO2IL.js";
|
|
9
|
+
import "../chunk-SV7X6HEN.js";
|
|
10
|
+
import "../chunk-J4TTSXDN.js";
|
|
13
11
|
import {
|
|
14
12
|
getRedisGlobalStatus,
|
|
15
13
|
isRedisGloballyDisabled
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
14
|
+
} from "../chunk-AXCB7SKY.js";
|
|
15
|
+
import "../chunk-GQVBWZLH.js";
|
|
16
|
+
import "../chunk-SS56XFLI.js";
|
|
17
|
+
import "../chunk-OHBAELPZ.js";
|
|
18
|
+
import "../chunk-O7CK3CKJ.js";
|
|
19
|
+
import "../chunk-XI4MRH5P.js";
|
|
20
|
+
import "../chunk-SFPMFVSD.js";
|
|
21
|
+
import "../chunk-TFD3DSM2.js";
|
|
22
|
+
import "../chunk-K25ICPU4.js";
|
|
23
|
+
import "../chunk-2QH66EVQ.js";
|
|
19
24
|
import "../chunk-IQQKKUAV.js";
|
|
20
25
|
import "../chunk-ORMEWXMH.js";
|
|
21
26
|
export {
|
|
@@ -3,17 +3,22 @@ import {
|
|
|
3
3
|
deletePatternFromCache,
|
|
4
4
|
deletePatternFromMultipleCaches,
|
|
5
5
|
invalidateCache
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-VF4EVAMV.js";
|
|
7
|
+
import "../chunk-7IN4WRSO.js";
|
|
8
|
+
import "../chunk-FDRIFPG6.js";
|
|
9
|
+
import "../chunk-KZUBO2IL.js";
|
|
10
|
+
import "../chunk-SV7X6HEN.js";
|
|
11
|
+
import "../chunk-J4TTSXDN.js";
|
|
12
|
+
import "../chunk-AXCB7SKY.js";
|
|
13
|
+
import "../chunk-GQVBWZLH.js";
|
|
10
14
|
import "../chunk-SS56XFLI.js";
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-OHBAELPZ.js";
|
|
16
|
+
import "../chunk-O7CK3CKJ.js";
|
|
17
|
+
import "../chunk-XI4MRH5P.js";
|
|
18
|
+
import "../chunk-SFPMFVSD.js";
|
|
19
|
+
import "../chunk-TFD3DSM2.js";
|
|
20
|
+
import "../chunk-K25ICPU4.js";
|
|
21
|
+
import "../chunk-2QH66EVQ.js";
|
|
17
22
|
import "../chunk-IQQKKUAV.js";
|
|
18
23
|
import "../chunk-ORMEWXMH.js";
|
|
19
24
|
export {
|
|
@@ -7,9 +7,14 @@ import {
|
|
|
7
7
|
logRedisInitialization,
|
|
8
8
|
notifyRedisError,
|
|
9
9
|
resetRedisGlobalState
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-AXCB7SKY.js";
|
|
11
|
+
import "../chunk-GQVBWZLH.js";
|
|
12
|
+
import "../chunk-OHBAELPZ.js";
|
|
13
|
+
import "../chunk-XI4MRH5P.js";
|
|
14
|
+
import "../chunk-SFPMFVSD.js";
|
|
15
|
+
import "../chunk-TFD3DSM2.js";
|
|
16
|
+
import "../chunk-K25ICPU4.js";
|
|
17
|
+
import "../chunk-2QH66EVQ.js";
|
|
13
18
|
import "../chunk-IQQKKUAV.js";
|
|
14
19
|
import "../chunk-ORMEWXMH.js";
|
|
15
20
|
export {
|
|
@@ -2,17 +2,22 @@ import {
|
|
|
2
2
|
cacheMetrics,
|
|
3
3
|
getCacheBackendLabel,
|
|
4
4
|
withCache
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-RWVGJUON.js";
|
|
6
|
+
import "../chunk-7IN4WRSO.js";
|
|
7
|
+
import "../chunk-FDRIFPG6.js";
|
|
8
|
+
import "../chunk-KZUBO2IL.js";
|
|
9
|
+
import "../chunk-SV7X6HEN.js";
|
|
10
|
+
import "../chunk-J4TTSXDN.js";
|
|
11
|
+
import "../chunk-AXCB7SKY.js";
|
|
12
|
+
import "../chunk-GQVBWZLH.js";
|
|
9
13
|
import "../chunk-SS56XFLI.js";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-OHBAELPZ.js";
|
|
15
|
+
import "../chunk-O7CK3CKJ.js";
|
|
16
|
+
import "../chunk-XI4MRH5P.js";
|
|
17
|
+
import "../chunk-SFPMFVSD.js";
|
|
18
|
+
import "../chunk-TFD3DSM2.js";
|
|
19
|
+
import "../chunk-K25ICPU4.js";
|
|
20
|
+
import "../chunk-2QH66EVQ.js";
|
|
16
21
|
import "../chunk-IQQKKUAV.js";
|
|
17
22
|
import "../chunk-ORMEWXMH.js";
|
|
18
23
|
export {
|
package/dist/cache/cache.js
CHANGED
|
@@ -1,37 +1,32 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-QMCOX3DP.js";
|
|
2
|
+
import {
|
|
3
|
+
cacheKeys
|
|
4
|
+
} from "../chunk-JBCDEAMW.js";
|
|
2
5
|
import {
|
|
3
6
|
cacheMetrics,
|
|
4
7
|
withCache
|
|
5
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-RWVGJUON.js";
|
|
6
9
|
import {
|
|
7
10
|
invalidateCache
|
|
8
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-VF4EVAMV.js";
|
|
9
12
|
import {
|
|
10
13
|
cache,
|
|
11
14
|
geoCache,
|
|
12
15
|
getCacheManager,
|
|
13
16
|
getEffectiveCacheBackend
|
|
14
|
-
} from "../chunk-
|
|
15
|
-
import {
|
|
16
|
-
HybridCacheManager
|
|
17
|
-
} from "../chunk-R5OFGX3C.js";
|
|
18
|
-
import {
|
|
19
|
-
InMemoryCacheManager
|
|
20
|
-
} from "../chunk-Y6IHEA3Q.js";
|
|
21
|
-
import "../chunk-SS56XFLI.js";
|
|
17
|
+
} from "../chunk-7IN4WRSO.js";
|
|
22
18
|
import {
|
|
23
19
|
NoopCacheManager
|
|
24
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-FDRIFPG6.js";
|
|
25
21
|
import {
|
|
26
22
|
RedisCacheManager
|
|
27
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-KZUBO2IL.js";
|
|
28
24
|
import {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} from "../chunk-HCTNZM7D.js";
|
|
25
|
+
HybridCacheManager
|
|
26
|
+
} from "../chunk-SV7X6HEN.js";
|
|
32
27
|
import {
|
|
33
|
-
|
|
34
|
-
} from "../chunk-
|
|
28
|
+
InMemoryCacheManager
|
|
29
|
+
} from "../chunk-J4TTSXDN.js";
|
|
35
30
|
import {
|
|
36
31
|
checkRedisConnection,
|
|
37
32
|
getRedisClient,
|
|
@@ -41,17 +36,29 @@ import {
|
|
|
41
36
|
logRedisInitialization,
|
|
42
37
|
notifyRedisError,
|
|
43
38
|
resetRedisGlobalState
|
|
44
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-AXCB7SKY.js";
|
|
40
|
+
import "../chunk-GQVBWZLH.js";
|
|
41
|
+
import "../chunk-SS56XFLI.js";
|
|
42
|
+
import "../chunk-OHBAELPZ.js";
|
|
43
|
+
import {
|
|
44
|
+
getCacheConfig,
|
|
45
|
+
getCacheTTL
|
|
46
|
+
} from "../chunk-O7CK3CKJ.js";
|
|
45
47
|
import {
|
|
46
48
|
getConfig,
|
|
47
|
-
getDefaultConfig,
|
|
48
49
|
getENV,
|
|
49
50
|
getEnv,
|
|
50
|
-
initializeCache,
|
|
51
51
|
isCacheEnabled,
|
|
52
52
|
validateRedisEnvironment
|
|
53
|
-
} from "../chunk-
|
|
54
|
-
import "../chunk-
|
|
53
|
+
} from "../chunk-XI4MRH5P.js";
|
|
54
|
+
import "../chunk-SFPMFVSD.js";
|
|
55
|
+
import {
|
|
56
|
+
getResolvedCacheConfig,
|
|
57
|
+
initializeCache,
|
|
58
|
+
resetCache
|
|
59
|
+
} from "../chunk-TFD3DSM2.js";
|
|
60
|
+
import "../chunk-K25ICPU4.js";
|
|
61
|
+
import "../chunk-2QH66EVQ.js";
|
|
55
62
|
import {
|
|
56
63
|
CACHE_DURATION_DEFAULTS,
|
|
57
64
|
CACHE_ENV_VARS,
|
|
@@ -93,12 +100,12 @@ export {
|
|
|
93
100
|
getCacheManager,
|
|
94
101
|
getCacheTTL,
|
|
95
102
|
getConfig,
|
|
96
|
-
getDefaultConfig,
|
|
97
103
|
getENV,
|
|
98
104
|
getEffectiveCacheBackend,
|
|
99
105
|
getEnv,
|
|
100
106
|
getRedisClient,
|
|
101
107
|
getRedisGlobalStatus,
|
|
108
|
+
getResolvedCacheConfig,
|
|
102
109
|
initializeCache,
|
|
103
110
|
invalidateCache,
|
|
104
111
|
isCacheEnabled,
|
|
@@ -106,6 +113,7 @@ export {
|
|
|
106
113
|
isRedisGloballyDisabled,
|
|
107
114
|
logRedisInitialization,
|
|
108
115
|
notifyRedisError,
|
|
116
|
+
resetCache,
|
|
109
117
|
resetRedisGlobalState,
|
|
110
118
|
validateRedisEnvironment,
|
|
111
119
|
withCache
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cache Config
|
|
3
|
+
*
|
|
4
|
+
* 코드 기반 캐시 설정 초기화 모듈 (process.env 의존성 제거)
|
|
5
|
+
*/
|
|
6
|
+
export interface CacheConfigInput {
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
redis?: {
|
|
9
|
+
url: string;
|
|
10
|
+
token: string;
|
|
11
|
+
enabled?: boolean;
|
|
12
|
+
};
|
|
13
|
+
inmemory?: {
|
|
14
|
+
enabled?: boolean;
|
|
15
|
+
maxSize?: number;
|
|
16
|
+
maxMb?: number;
|
|
17
|
+
eviction?: 'lru' | 'fifo' | 'ttl';
|
|
18
|
+
cleanupInterval?: number;
|
|
19
|
+
};
|
|
20
|
+
ttl?: Partial<{
|
|
21
|
+
DEFAULT: number;
|
|
22
|
+
SHORT: number;
|
|
23
|
+
LONG: number;
|
|
24
|
+
GEOIP: number;
|
|
25
|
+
SETTINGS: number;
|
|
26
|
+
ANALYTICS: number;
|
|
27
|
+
USER: number;
|
|
28
|
+
LINK: number;
|
|
29
|
+
ALIAS: number;
|
|
30
|
+
COMMUNITY: number;
|
|
31
|
+
RESERVED_WORDS: number;
|
|
32
|
+
}>;
|
|
33
|
+
categories?: Partial<Record<string, {
|
|
34
|
+
enabled?: boolean;
|
|
35
|
+
duration?: number;
|
|
36
|
+
}>>;
|
|
37
|
+
fallback?: {
|
|
38
|
+
redisErrorThresholdGlobal?: number;
|
|
39
|
+
redisErrorThresholdLocal?: number;
|
|
40
|
+
redisReconnectInterval?: number;
|
|
41
|
+
fallbackOnRedisError?: boolean;
|
|
42
|
+
writeToMemory?: boolean;
|
|
43
|
+
};
|
|
44
|
+
health?: {
|
|
45
|
+
errorRateThreshold?: number;
|
|
46
|
+
hitRateThreshold?: number;
|
|
47
|
+
reportHitRateThreshold?: number;
|
|
48
|
+
reportResponseTimeThreshold?: number;
|
|
49
|
+
reportInvalidationThreshold?: number;
|
|
50
|
+
reportMinRequests?: number;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface ResolvedCacheConfig {
|
|
54
|
+
enabled: boolean;
|
|
55
|
+
redis?: {
|
|
56
|
+
url: string;
|
|
57
|
+
token: string;
|
|
58
|
+
enabled: boolean;
|
|
59
|
+
};
|
|
60
|
+
inmemory: {
|
|
61
|
+
enabled: boolean;
|
|
62
|
+
maxSize: number;
|
|
63
|
+
maxMb: number;
|
|
64
|
+
eviction: 'lru' | 'fifo' | 'ttl';
|
|
65
|
+
cleanupInterval: number;
|
|
66
|
+
};
|
|
67
|
+
ttl: {
|
|
68
|
+
DEFAULT: number;
|
|
69
|
+
SHORT: number;
|
|
70
|
+
LONG: number;
|
|
71
|
+
GEOIP: number;
|
|
72
|
+
SETTINGS: number;
|
|
73
|
+
ANALYTICS: number;
|
|
74
|
+
USER: number;
|
|
75
|
+
LINK: number;
|
|
76
|
+
ALIAS: number;
|
|
77
|
+
COMMUNITY: number;
|
|
78
|
+
RESERVED_WORDS: number;
|
|
79
|
+
};
|
|
80
|
+
categories: Record<string, {
|
|
81
|
+
enabled: boolean;
|
|
82
|
+
duration: number;
|
|
83
|
+
}>;
|
|
84
|
+
fallback: {
|
|
85
|
+
redisErrorThresholdGlobal: number;
|
|
86
|
+
redisErrorThresholdLocal: number;
|
|
87
|
+
redisReconnectInterval: number;
|
|
88
|
+
fallbackOnRedisError: boolean;
|
|
89
|
+
writeToMemory: boolean;
|
|
90
|
+
};
|
|
91
|
+
health: {
|
|
92
|
+
errorRateThreshold: number;
|
|
93
|
+
hitRateThreshold: number;
|
|
94
|
+
reportHitRateThreshold: number;
|
|
95
|
+
reportResponseTimeThreshold: number;
|
|
96
|
+
reportInvalidationThreshold: number;
|
|
97
|
+
reportMinRequests: number;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
declare global {
|
|
101
|
+
var __withwiz_cache_config: ResolvedCacheConfig | undefined;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* 캐시 설정을 초기화합니다.
|
|
105
|
+
* redis가 제공된 경우 url과 token 유효성을 검사합니다.
|
|
106
|
+
*/
|
|
107
|
+
export declare function initializeCache(input: CacheConfigInput): void;
|
|
108
|
+
/**
|
|
109
|
+
* 초기화된 캐시 설정을 반환합니다.
|
|
110
|
+
* initializeCache를 먼저 호출하지 않으면 ConfigurationError를 던집니다.
|
|
111
|
+
*/
|
|
112
|
+
export declare function getResolvedCacheConfig(): ResolvedCacheConfig;
|
|
113
|
+
/**
|
|
114
|
+
* 캐시 설정을 초기화 전 상태로 리셋합니다. (테스트용)
|
|
115
|
+
*/
|
|
116
|
+
export declare function resetCache(): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getResolvedCacheConfig,
|
|
3
|
+
initializeCache,
|
|
4
|
+
resetCache
|
|
5
|
+
} from "../chunk-TFD3DSM2.js";
|
|
6
|
+
import "../chunk-2QH66EVQ.js";
|
|
7
|
+
import "../chunk-IQQKKUAV.js";
|
|
8
|
+
import "../chunk-ORMEWXMH.js";
|
|
9
|
+
export {
|
|
10
|
+
getResolvedCacheConfig,
|
|
11
|
+
initializeCache,
|
|
12
|
+
resetCache
|
|
13
|
+
};
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
HybridCacheManager
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-SV7X6HEN.js";
|
|
4
|
+
import "../chunk-J4TTSXDN.js";
|
|
5
|
+
import "../chunk-AXCB7SKY.js";
|
|
6
|
+
import "../chunk-GQVBWZLH.js";
|
|
5
7
|
import "../chunk-SS56XFLI.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-OHBAELPZ.js";
|
|
9
|
+
import "../chunk-XI4MRH5P.js";
|
|
10
|
+
import "../chunk-SFPMFVSD.js";
|
|
11
|
+
import "../chunk-TFD3DSM2.js";
|
|
12
|
+
import "../chunk-K25ICPU4.js";
|
|
13
|
+
import "../chunk-2QH66EVQ.js";
|
|
9
14
|
import "../chunk-IQQKKUAV.js";
|
|
10
15
|
import "../chunk-ORMEWXMH.js";
|
|
11
16
|
export {
|
package/dist/cache/index.d.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* 캐시 모듈의 통합 진입점
|
|
5
5
|
* - 모든 캐시 관련 기능을 re-export
|
|
6
6
|
*/
|
|
7
|
-
export {
|
|
7
|
+
export { isCacheEnabled, getEnv, getENV, getConfig, validateRedisEnvironment, } from './cache-env';
|
|
8
|
+
export { initializeCache, getResolvedCacheConfig, resetCache } from './config';
|
|
8
9
|
export { checkRedisConnection, isRedisAvailableNow, getRedisClient, logRedisInitialization, isRedisGloballyDisabled, notifyRedisError, resetRedisGlobalState, getRedisGlobalStatus, } from './cache-redis';
|
|
9
10
|
export type { CacheMetrics, RedisConnectionStatus } from './cache-redis';
|
|
10
11
|
export { getCacheConfig, getCacheTTL } from './cache-config';
|
package/dist/cache/index.js
CHANGED
|
@@ -1,37 +1,32 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-QMCOX3DP.js";
|
|
2
|
+
import {
|
|
3
|
+
cacheKeys
|
|
4
|
+
} from "../chunk-JBCDEAMW.js";
|
|
2
5
|
import {
|
|
3
6
|
cacheMetrics,
|
|
4
7
|
withCache
|
|
5
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-RWVGJUON.js";
|
|
6
9
|
import {
|
|
7
10
|
invalidateCache
|
|
8
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-VF4EVAMV.js";
|
|
9
12
|
import {
|
|
10
13
|
cache,
|
|
11
14
|
geoCache,
|
|
12
15
|
getCacheManager,
|
|
13
16
|
getEffectiveCacheBackend
|
|
14
|
-
} from "../chunk-
|
|
15
|
-
import {
|
|
16
|
-
HybridCacheManager
|
|
17
|
-
} from "../chunk-R5OFGX3C.js";
|
|
18
|
-
import {
|
|
19
|
-
InMemoryCacheManager
|
|
20
|
-
} from "../chunk-Y6IHEA3Q.js";
|
|
21
|
-
import "../chunk-SS56XFLI.js";
|
|
17
|
+
} from "../chunk-7IN4WRSO.js";
|
|
22
18
|
import {
|
|
23
19
|
NoopCacheManager
|
|
24
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-FDRIFPG6.js";
|
|
25
21
|
import {
|
|
26
22
|
RedisCacheManager
|
|
27
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-KZUBO2IL.js";
|
|
28
24
|
import {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} from "../chunk-HCTNZM7D.js";
|
|
25
|
+
HybridCacheManager
|
|
26
|
+
} from "../chunk-SV7X6HEN.js";
|
|
32
27
|
import {
|
|
33
|
-
|
|
34
|
-
} from "../chunk-
|
|
28
|
+
InMemoryCacheManager
|
|
29
|
+
} from "../chunk-J4TTSXDN.js";
|
|
35
30
|
import {
|
|
36
31
|
checkRedisConnection,
|
|
37
32
|
getRedisClient,
|
|
@@ -41,17 +36,29 @@ import {
|
|
|
41
36
|
logRedisInitialization,
|
|
42
37
|
notifyRedisError,
|
|
43
38
|
resetRedisGlobalState
|
|
44
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-AXCB7SKY.js";
|
|
40
|
+
import "../chunk-GQVBWZLH.js";
|
|
41
|
+
import "../chunk-SS56XFLI.js";
|
|
42
|
+
import "../chunk-OHBAELPZ.js";
|
|
43
|
+
import {
|
|
44
|
+
getCacheConfig,
|
|
45
|
+
getCacheTTL
|
|
46
|
+
} from "../chunk-O7CK3CKJ.js";
|
|
45
47
|
import {
|
|
46
48
|
getConfig,
|
|
47
|
-
getDefaultConfig,
|
|
48
49
|
getENV,
|
|
49
50
|
getEnv,
|
|
50
|
-
initializeCache,
|
|
51
51
|
isCacheEnabled,
|
|
52
52
|
validateRedisEnvironment
|
|
53
|
-
} from "../chunk-
|
|
54
|
-
import "../chunk-
|
|
53
|
+
} from "../chunk-XI4MRH5P.js";
|
|
54
|
+
import "../chunk-SFPMFVSD.js";
|
|
55
|
+
import {
|
|
56
|
+
getResolvedCacheConfig,
|
|
57
|
+
initializeCache,
|
|
58
|
+
resetCache
|
|
59
|
+
} from "../chunk-TFD3DSM2.js";
|
|
60
|
+
import "../chunk-K25ICPU4.js";
|
|
61
|
+
import "../chunk-2QH66EVQ.js";
|
|
55
62
|
import {
|
|
56
63
|
CACHE_DURATION_DEFAULTS,
|
|
57
64
|
CACHE_ENV_VARS,
|
|
@@ -93,12 +100,12 @@ export {
|
|
|
93
100
|
getCacheManager,
|
|
94
101
|
getCacheTTL,
|
|
95
102
|
getConfig,
|
|
96
|
-
getDefaultConfig,
|
|
97
103
|
getENV,
|
|
98
104
|
getEffectiveCacheBackend,
|
|
99
105
|
getEnv,
|
|
100
106
|
getRedisClient,
|
|
101
107
|
getRedisGlobalStatus,
|
|
108
|
+
getResolvedCacheConfig,
|
|
102
109
|
initializeCache,
|
|
103
110
|
invalidateCache,
|
|
104
111
|
isCacheEnabled,
|
|
@@ -106,6 +113,7 @@ export {
|
|
|
106
113
|
isRedisGloballyDisabled,
|
|
107
114
|
logRedisInitialization,
|
|
108
115
|
notifyRedisError,
|
|
116
|
+
resetCache,
|
|
109
117
|
resetRedisGlobalState,
|
|
110
118
|
validateRedisEnvironment,
|
|
111
119
|
withCache
|