@withwiz/toolkit 0.4.0 → 0.4.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/core/jwt/cookie.js +4 -1
- package/dist/auth/core/jwt/index.js +4 -1
- package/dist/auth/index.js +7 -4
- package/dist/cache/cache-config.d.ts +0 -32
- package/dist/cache/cache-config.js +4 -4
- package/dist/cache/cache-defaults.d.ts +2 -28
- package/dist/cache/cache-defaults.js +1 -1
- package/dist/cache/cache-env.js +3 -3
- package/dist/cache/cache-factory.js +10 -10
- package/dist/cache/cache-invalidation.js +10 -10
- package/dist/cache/cache-redis.js +4 -4
- package/dist/cache/cache-wrapper.js +10 -10
- package/dist/cache/cache.js +16 -20
- package/dist/cache/config.d.ts +0 -8
- package/dist/cache/config.js +2 -2
- package/dist/cache/hybrid-cache-manager.js +5 -5
- package/dist/cache/index.d.ts +0 -1
- package/dist/cache/index.js +16 -20
- package/dist/cache/noop-cache-manager.d.ts +2 -2
- package/dist/cache/noop-cache-manager.js +5 -5
- package/dist/cache/redis-cache-manager.d.ts +2 -2
- package/dist/cache/redis-cache-manager.js +5 -5
- package/dist/{chunk-TO5CMMQC.js → chunk-2VMTIYLX.js} +2 -15
- package/dist/{chunk-WNF2RKFA.js → chunk-3J7FDOCU.js} +9 -9
- package/dist/{chunk-IQQKKUAV.js → chunk-57W32BFZ.js} +4 -30
- package/dist/chunk-7LJWRKDT.js +45 -0
- package/dist/{chunk-XI4MRH5P.js → chunk-BJLLMVWW.js} +11 -39
- package/dist/{chunk-JLLMTTQ4.js → chunk-C4TSQUFA.js} +0 -7
- package/dist/{chunk-FDRIFPG6.js → chunk-CRWMULHR.js} +4 -4
- package/dist/{chunk-SV7X6HEN.js → chunk-FUDEEQR3.js} +5 -5
- package/dist/{chunk-VF4EVAMV.js → chunk-GFAD4UAT.js} +1 -1
- package/dist/{chunk-7IN4WRSO.js → chunk-GGSFZP6T.js} +9 -9
- package/dist/{chunk-BYCFXGQL.js → chunk-N3TAGJHR.js} +2 -2
- package/dist/{chunk-AJLUPYCQ.js → chunk-N4D6OPPP.js} +16 -6
- package/dist/{chunk-KZUBO2IL.js → chunk-NQQU6UFE.js} +4 -4
- package/dist/{chunk-TFD3DSM2.js → chunk-UCIUAZQT.js} +14 -18
- package/dist/{chunk-AXCB7SKY.js → chunk-X5RMDLLM.js} +15 -15
- package/dist/{chunk-RWVGJUON.js → chunk-YSUL3SLC.js} +3 -3
- package/dist/{chunk-OIVXOT2X.js → chunk-YUBXS7YI.js} +2 -3
- package/dist/{chunk-VDXB5DCY.js → chunk-ZRDPJORV.js} +0 -10
- package/dist/constants/index.js +8 -10
- package/dist/constants/pagination.d.ts +0 -5
- package/dist/constants/pagination.js +1 -1
- package/dist/constants/security.d.ts +0 -6
- package/dist/constants/security.js +1 -3
- package/dist/constants/validation.d.ts +1 -3
- package/dist/initialize.js +4 -4
- package/dist/middleware/auth.js +1 -1
- package/dist/middleware/index.js +5 -5
- package/dist/middleware/rate-limit.d.ts +1 -1
- package/dist/middleware/wrappers.js +3 -3
- package/dist/system/environment.js +3 -3
- package/dist/system/health-check.js +4 -4
- package/dist/system/index.js +5 -5
- package/dist/types/env.d.ts +2 -13
- package/dist/types/qr-code.d.ts +1 -1
- package/dist/utils/cors.d.ts +6 -4
- package/dist/utils/cors.js +1 -1
- package/dist/utils/error-message-formatter.js +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/optimistic-lock.d.ts +4 -4
- package/package.json +1 -1
- package/dist/cache/cache-keys-legacy.d.ts +0 -35
- package/dist/cache/cache-keys-legacy.js +0 -7
- package/dist/chunk-JBCDEAMW.js +0 -35
- package/dist/chunk-O7CK3CKJ.js +0 -84
- package/dist/{chunk-YP5SAHAP.js → chunk-5WP57PJK.js} +3 -3
- /package/dist/{chunk-QMCOX3DP.js → chunk-EBUEBEJX.js} +0 -0
|
@@ -10,17 +10,16 @@ function formatRedisError(errorMessage) {
|
|
|
10
10
|
if (cleanMessage.startsWith("ERR ")) {
|
|
11
11
|
cleanMessage = cleanMessage.replace(/^ERR\s+/, "").trim();
|
|
12
12
|
}
|
|
13
|
-
cleanMessage = cleanMessage.replace(/\s*See https
|
|
13
|
+
cleanMessage = cleanMessage.replace(/\s*See https?:\/\/\S+\s*for details.*$/i, "").trim();
|
|
14
14
|
if (cleanMessage.includes("max requests limit exceeded")) {
|
|
15
15
|
const limitMatch = cleanMessage.match(/Limit:\s*(\d+)/);
|
|
16
16
|
const usageMatch = cleanMessage.match(/Usage:\s*(\d+)/);
|
|
17
17
|
if (limitMatch && usageMatch) {
|
|
18
18
|
const limit = parseInt(limitMatch[1]);
|
|
19
|
-
const usage = parseInt(usageMatch[1]);
|
|
20
19
|
const limitInK = Math.floor(limit / 1e3);
|
|
21
20
|
return `Redis request limit exceeded (${limitInK}K requests used). Please upgrade your plan or wait for the quota to reset.`;
|
|
22
21
|
}
|
|
23
|
-
return "Redis request limit exceeded. Please check your
|
|
22
|
+
return "Redis request limit exceeded. Please check your Redis provider plan.";
|
|
24
23
|
}
|
|
25
24
|
if (cleanMessage.includes("timeout") || cleanMessage.includes("ETIMEDOUT")) {
|
|
26
25
|
return "Redis connection timeout. Please check network connectivity.";
|
|
@@ -10,18 +10,8 @@ var PAGINATION = {
|
|
|
10
10
|
DEFAULT_PAGE: 1
|
|
11
11
|
};
|
|
12
12
|
var PAGE_SIZES = {
|
|
13
|
-
// 링크 목록
|
|
14
|
-
LINKS: 10,
|
|
15
13
|
// 사용자 목록
|
|
16
14
|
USERS: 20,
|
|
17
|
-
// 예약어 목록
|
|
18
|
-
RESERVED_WORDS: 20,
|
|
19
|
-
// 공지사항 목록
|
|
20
|
-
NOTICES: 10,
|
|
21
|
-
// 태그 목록
|
|
22
|
-
TAGS: 50,
|
|
23
|
-
// 클릭 히스토리
|
|
24
|
-
CLICK_HISTORY: 50,
|
|
25
15
|
// 활동 내역
|
|
26
16
|
ACTIVITY: 20,
|
|
27
17
|
// 검색 결과
|
package/dist/constants/index.js
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GENERIC_CONFIRM_MESSAGES,
|
|
3
|
-
GENERIC_ERROR_MESSAGES,
|
|
4
|
-
GENERIC_INFO_MESSAGES,
|
|
5
|
-
GENERIC_SUCCESS_MESSAGES
|
|
6
|
-
} from "../chunk-2TO7WUKK.js";
|
|
7
1
|
import {
|
|
8
2
|
DATE_RANGE,
|
|
9
3
|
FILTER_OPTIONS,
|
|
10
4
|
PAGE_SIZES,
|
|
11
5
|
PAGINATION,
|
|
12
6
|
SORT_OPTIONS
|
|
13
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-ZRDPJORV.js";
|
|
14
8
|
import {
|
|
15
|
-
API_KEY,
|
|
16
9
|
CSRF,
|
|
17
10
|
EMAIL_VERIFICATION,
|
|
18
11
|
JWT_DEFAULTS,
|
|
@@ -21,7 +14,7 @@ import {
|
|
|
21
14
|
PASSWORD_RESET,
|
|
22
15
|
SECURITY_HEADERS,
|
|
23
16
|
SESSION
|
|
24
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-C4TSQUFA.js";
|
|
25
18
|
import {
|
|
26
19
|
DATE,
|
|
27
20
|
FILE_UPLOAD,
|
|
@@ -45,9 +38,14 @@ import {
|
|
|
45
38
|
getHttpStatus,
|
|
46
39
|
getLogLevel
|
|
47
40
|
} from "../chunk-SNTLJ646.js";
|
|
41
|
+
import {
|
|
42
|
+
GENERIC_CONFIRM_MESSAGES,
|
|
43
|
+
GENERIC_ERROR_MESSAGES,
|
|
44
|
+
GENERIC_INFO_MESSAGES,
|
|
45
|
+
GENERIC_SUCCESS_MESSAGES
|
|
46
|
+
} from "../chunk-2TO7WUKK.js";
|
|
48
47
|
import "../chunk-ORMEWXMH.js";
|
|
49
48
|
export {
|
|
50
|
-
API_KEY,
|
|
51
49
|
CSRF,
|
|
52
50
|
DATE,
|
|
53
51
|
DATE_RANGE,
|
|
@@ -8,12 +8,7 @@ export declare const PAGINATION: {
|
|
|
8
8
|
readonly DEFAULT_PAGE: 1;
|
|
9
9
|
};
|
|
10
10
|
export declare const PAGE_SIZES: {
|
|
11
|
-
readonly LINKS: 10;
|
|
12
11
|
readonly USERS: 20;
|
|
13
|
-
readonly RESERVED_WORDS: 20;
|
|
14
|
-
readonly NOTICES: 10;
|
|
15
|
-
readonly TAGS: 50;
|
|
16
|
-
readonly CLICK_HISTORY: 50;
|
|
17
12
|
readonly ACTIVITY: 20;
|
|
18
13
|
readonly SEARCH_RESULTS: 10;
|
|
19
14
|
};
|
|
@@ -30,12 +30,6 @@ export declare const MAGIC_LINK: {
|
|
|
30
30
|
/** 토큰 길이 (바이트) */
|
|
31
31
|
readonly TOKEN_LENGTH: 32;
|
|
32
32
|
};
|
|
33
|
-
export declare const API_KEY: {
|
|
34
|
-
/** 키 길이 (문자) */
|
|
35
|
-
readonly LENGTH: 32;
|
|
36
|
-
/** 키 접두사 */
|
|
37
|
-
readonly PREFIX: "tlog_";
|
|
38
|
-
};
|
|
39
33
|
export declare const SESSION: {
|
|
40
34
|
/** 세션 쿠키 이름 */
|
|
41
35
|
readonly COOKIE_NAME: "session";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
API_KEY,
|
|
3
2
|
CSRF,
|
|
4
3
|
EMAIL_VERIFICATION,
|
|
5
4
|
JWT_DEFAULTS,
|
|
@@ -8,10 +7,9 @@ import {
|
|
|
8
7
|
PASSWORD_RESET,
|
|
9
8
|
SECURITY_HEADERS,
|
|
10
9
|
SESSION
|
|
11
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-C4TSQUFA.js";
|
|
12
11
|
import "../chunk-ORMEWXMH.js";
|
|
13
12
|
export {
|
|
14
|
-
API_KEY,
|
|
15
13
|
CSRF,
|
|
16
14
|
EMAIL_VERIFICATION,
|
|
17
15
|
JWT_DEFAULTS,
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
* 데이터 검증 관련 상수 (범용 유틸리티)
|
|
3
3
|
*
|
|
4
4
|
* 이 파일은 프로젝트 독립적인 범용 검증 상수들만 포함합니다.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @see <your-project>/constants/alias.ts - Alias, Link, ShortCode 관련 상수
|
|
5
|
+
* 도메인 비즈니스 로직 상수는 소비 프로젝트의 constants/ 영역에서 정의하세요.
|
|
8
6
|
*/
|
|
9
7
|
export declare const PASSWORD: {
|
|
10
8
|
/** 최소 길이 */
|
package/dist/initialize.js
CHANGED
|
@@ -13,15 +13,15 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
initializeLogger
|
|
15
15
|
} from "./chunk-OHBAELPZ.js";
|
|
16
|
+
import {
|
|
17
|
+
initializeCache
|
|
18
|
+
} from "./chunk-UCIUAZQT.js";
|
|
16
19
|
import {
|
|
17
20
|
initializeCommon
|
|
18
21
|
} from "./chunk-SFPMFVSD.js";
|
|
19
|
-
import {
|
|
20
|
-
initializeCache
|
|
21
|
-
} from "./chunk-TFD3DSM2.js";
|
|
22
22
|
import "./chunk-K25ICPU4.js";
|
|
23
23
|
import "./chunk-2QH66EVQ.js";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-57W32BFZ.js";
|
|
25
25
|
import "./chunk-ORMEWXMH.js";
|
|
26
26
|
|
|
27
27
|
// src/initialize.ts
|
package/dist/middleware/auth.js
CHANGED
|
@@ -9,7 +9,7 @@ import "../chunk-EOEMOXNT.js";
|
|
|
9
9
|
import "../chunk-SNTLJ646.js";
|
|
10
10
|
import "../chunk-OZE5KUS3.js";
|
|
11
11
|
import "../chunk-3GAY2T2A.js";
|
|
12
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-N4D6OPPP.js";
|
|
13
13
|
import "../chunk-AIH3F7JV.js";
|
|
14
14
|
import "../chunk-GQVBWZLH.js";
|
|
15
15
|
import "../chunk-OHBAELPZ.js";
|
package/dist/middleware/index.js
CHANGED
|
@@ -4,10 +4,7 @@ import {
|
|
|
4
4
|
withCustomApi,
|
|
5
5
|
withOptionalAuthApi,
|
|
6
6
|
withPublicApi
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import {
|
|
9
|
-
initRequestMiddleware
|
|
10
|
-
} from "../chunk-62Q7DN5G.js";
|
|
7
|
+
} from "../chunk-5WP57PJK.js";
|
|
11
8
|
import {
|
|
12
9
|
MiddlewareChain
|
|
13
10
|
} from "../chunk-FPESPW6P.js";
|
|
@@ -38,6 +35,9 @@ import {
|
|
|
38
35
|
import {
|
|
39
36
|
errorHandlerMiddleware
|
|
40
37
|
} from "../chunk-3YUKCYHI.js";
|
|
38
|
+
import {
|
|
39
|
+
initRequestMiddleware
|
|
40
|
+
} from "../chunk-62Q7DN5G.js";
|
|
41
41
|
import "../chunk-XHZ5L4FO.js";
|
|
42
42
|
import "../chunk-L6AU74EI.js";
|
|
43
43
|
import "../chunk-EOEMOXNT.js";
|
|
@@ -48,7 +48,7 @@ import "../chunk-SNTLJ646.js";
|
|
|
48
48
|
import "../chunk-GFWGLWTS.js";
|
|
49
49
|
import "../chunk-OZE5KUS3.js";
|
|
50
50
|
import "../chunk-3GAY2T2A.js";
|
|
51
|
-
import "../chunk-
|
|
51
|
+
import "../chunk-N4D6OPPP.js";
|
|
52
52
|
import "../chunk-AIH3F7JV.js";
|
|
53
53
|
import "../chunk-GQVBWZLH.js";
|
|
54
54
|
import "../chunk-OHBAELPZ.js";
|
|
@@ -51,7 +51,7 @@ export declare function setRateLimitAdapter(adapter: IRateLimitAdapter): void;
|
|
|
51
51
|
export type TRateLimitType = "api" | "auth" | "admin";
|
|
52
52
|
/**
|
|
53
53
|
* 확장 가능한 Rate Limit 타입
|
|
54
|
-
*
|
|
54
|
+
* 도메인 특화 타입은 소비 프로젝트의 extension 영역에서 정의하세요.
|
|
55
55
|
*/
|
|
56
56
|
export type TExtendedRateLimitType = TRateLimitType | string;
|
|
57
57
|
/**
|
|
@@ -4,8 +4,7 @@ import {
|
|
|
4
4
|
withCustomApi,
|
|
5
5
|
withOptionalAuthApi,
|
|
6
6
|
withPublicApi
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-62Q7DN5G.js";
|
|
7
|
+
} from "../chunk-5WP57PJK.js";
|
|
9
8
|
import "../chunk-FPESPW6P.js";
|
|
10
9
|
import "../chunk-AQJAY5FA.js";
|
|
11
10
|
import "../chunk-OIRAH57Y.js";
|
|
@@ -13,6 +12,7 @@ import "../chunk-WMQE2YK7.js";
|
|
|
13
12
|
import "../chunk-J5AISIJS.js";
|
|
14
13
|
import "../chunk-KGHWGLED.js";
|
|
15
14
|
import "../chunk-3YUKCYHI.js";
|
|
15
|
+
import "../chunk-62Q7DN5G.js";
|
|
16
16
|
import "../chunk-XHZ5L4FO.js";
|
|
17
17
|
import "../chunk-L6AU74EI.js";
|
|
18
18
|
import "../chunk-EOEMOXNT.js";
|
|
@@ -23,7 +23,7 @@ import "../chunk-SNTLJ646.js";
|
|
|
23
23
|
import "../chunk-GFWGLWTS.js";
|
|
24
24
|
import "../chunk-OZE5KUS3.js";
|
|
25
25
|
import "../chunk-3GAY2T2A.js";
|
|
26
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-N4D6OPPP.js";
|
|
27
27
|
import "../chunk-AIH3F7JV.js";
|
|
28
28
|
import "../chunk-GQVBWZLH.js";
|
|
29
29
|
import "../chunk-OHBAELPZ.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
checkEnvironmentVariables
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-3J7FDOCU.js";
|
|
4
4
|
import "../chunk-S5UCZ2T3.js";
|
|
5
5
|
import "../chunk-3CBGGMIY.js";
|
|
6
6
|
import "../chunk-OZE5KUS3.js";
|
|
7
7
|
import "../chunk-GQVBWZLH.js";
|
|
8
8
|
import "../chunk-OHBAELPZ.js";
|
|
9
|
+
import "../chunk-UCIUAZQT.js";
|
|
9
10
|
import "../chunk-SFPMFVSD.js";
|
|
10
|
-
import "../chunk-TFD3DSM2.js";
|
|
11
11
|
import "../chunk-K25ICPU4.js";
|
|
12
12
|
import "../chunk-2QH66EVQ.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-57W32BFZ.js";
|
|
14
14
|
import "../chunk-ORMEWXMH.js";
|
|
15
15
|
export {
|
|
16
16
|
checkEnvironmentVariables
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
checkServiceHealth
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-N3TAGJHR.js";
|
|
4
|
+
import "../chunk-YUBXS7YI.js";
|
|
5
5
|
import "../chunk-S5UCZ2T3.js";
|
|
6
6
|
import "../chunk-GQVBWZLH.js";
|
|
7
7
|
import "../chunk-OHBAELPZ.js";
|
|
8
|
+
import "../chunk-UCIUAZQT.js";
|
|
8
9
|
import "../chunk-SFPMFVSD.js";
|
|
9
|
-
import "../chunk-TFD3DSM2.js";
|
|
10
10
|
import "../chunk-K25ICPU4.js";
|
|
11
11
|
import "../chunk-2QH66EVQ.js";
|
|
12
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-57W32BFZ.js";
|
|
13
13
|
import "../chunk-ORMEWXMH.js";
|
|
14
14
|
export {
|
|
15
15
|
checkServiceHealth
|
package/dist/system/index.js
CHANGED
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
} from "../chunk-6SOQUYOU.js";
|
|
7
7
|
import {
|
|
8
8
|
checkEnvironmentVariables
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-3J7FDOCU.js";
|
|
10
10
|
import {
|
|
11
11
|
checkServiceHealth
|
|
12
|
-
} from "../chunk-
|
|
13
|
-
import "../chunk-
|
|
12
|
+
} from "../chunk-N3TAGJHR.js";
|
|
13
|
+
import "../chunk-YUBXS7YI.js";
|
|
14
14
|
import {
|
|
15
15
|
getMemoryInfo
|
|
16
16
|
} from "../chunk-LFQ3IQQB.js";
|
|
@@ -27,11 +27,11 @@ import {
|
|
|
27
27
|
logger
|
|
28
28
|
} from "../chunk-GQVBWZLH.js";
|
|
29
29
|
import "../chunk-OHBAELPZ.js";
|
|
30
|
+
import "../chunk-UCIUAZQT.js";
|
|
30
31
|
import "../chunk-SFPMFVSD.js";
|
|
31
|
-
import "../chunk-TFD3DSM2.js";
|
|
32
32
|
import "../chunk-K25ICPU4.js";
|
|
33
33
|
import "../chunk-2QH66EVQ.js";
|
|
34
|
-
import "../chunk-
|
|
34
|
+
import "../chunk-57W32BFZ.js";
|
|
35
35
|
import "../chunk-ORMEWXMH.js";
|
|
36
36
|
|
|
37
37
|
// src/system/index.ts
|
package/dist/types/env.d.ts
CHANGED
|
@@ -42,10 +42,6 @@ export interface ICacheTTLConfig {
|
|
|
42
42
|
SETTINGS: number;
|
|
43
43
|
ANALYTICS: number;
|
|
44
44
|
USER: number;
|
|
45
|
-
LINK: number;
|
|
46
|
-
ALIAS: number;
|
|
47
|
-
COMMUNITY: number;
|
|
48
|
-
RESERVED_WORDS: number;
|
|
49
45
|
}
|
|
50
46
|
/**
|
|
51
47
|
* 캐시 백엔드 타입
|
|
@@ -83,22 +79,15 @@ export interface ICacheEnv {
|
|
|
83
79
|
USER: ICacheCategoryConfig;
|
|
84
80
|
GEOIP: ICacheCategoryConfig;
|
|
85
81
|
SETTINGS: ICacheCategoryConfig;
|
|
86
|
-
RESERVED_WORDS: ICacheCategoryConfig;
|
|
87
|
-
ALIAS: ICacheCategoryConfig;
|
|
88
|
-
COMMUNITY: ICacheCategoryConfig;
|
|
89
|
-
LINK: ICacheCategoryConfig;
|
|
90
82
|
RATE_LIMIT: ICacheCategoryConfig;
|
|
91
|
-
URL_TOKEN: ICacheCategoryConfig;
|
|
92
|
-
API_KEY: ICacheCategoryConfig;
|
|
93
|
-
API_CONFIG: ICacheCategoryConfig;
|
|
94
83
|
}
|
|
95
84
|
/**
|
|
96
85
|
* Raw 환경 변수 인터페이스 (직접 접근용)
|
|
97
86
|
*/
|
|
98
87
|
export interface IRawEnv {
|
|
99
88
|
NODE_ENV: 'development' | 'production' | 'test';
|
|
100
|
-
|
|
101
|
-
|
|
89
|
+
REDIS_REST_URL?: string;
|
|
90
|
+
REDIS_REST_TOKEN?: string;
|
|
102
91
|
CACHE_ENABLED: boolean;
|
|
103
92
|
}
|
|
104
93
|
/**
|
package/dist/types/qr-code.d.ts
CHANGED
package/dist/utils/cors.d.ts
CHANGED
|
@@ -25,12 +25,14 @@ export declare function initCorsConfig(config: CorsConfig): void;
|
|
|
25
25
|
*/
|
|
26
26
|
export declare function getCorsConfig(): CorsConfig;
|
|
27
27
|
/**
|
|
28
|
-
* 허용된 도메인 목록
|
|
28
|
+
* 허용된 도메인 목록
|
|
29
29
|
*
|
|
30
30
|
* 우선순위:
|
|
31
|
-
* 1.
|
|
32
|
-
* 2.
|
|
33
|
-
* 3.
|
|
31
|
+
* 1. 미들웨어 CORS 설정의 allowedOrigins
|
|
32
|
+
* 2. baseUrl(설정/미들웨어)에서 자동 추출한 도메인
|
|
33
|
+
* 3. additionalOrigins(호출자 직접 추가)
|
|
34
|
+
*
|
|
35
|
+
* 개발 환경의 localhost 등은 호출자가 additionalOrigins로 명시 주입해야 합니다.
|
|
34
36
|
*/
|
|
35
37
|
export declare function getAllowedOrigins(): string[];
|
|
36
38
|
export declare function isOriginAllowed(origin: string | null | undefined): boolean;
|
package/dist/utils/cors.js
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
* @example
|
|
15
15
|
* ```typescript
|
|
16
16
|
* await withOptimisticLock(
|
|
17
|
-
* () => prisma.
|
|
18
|
-
* where: { id
|
|
19
|
-
* data: {
|
|
17
|
+
* () => prisma.entity.updateMany({
|
|
18
|
+
* where: { id, version: currentVersion },
|
|
19
|
+
* data: { name: newName, version: { increment: 1 } },
|
|
20
20
|
* }),
|
|
21
|
-
* '
|
|
21
|
+
* 'Entity'
|
|
22
22
|
* );
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
package/package.json
CHANGED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Legacy Cache Keys
|
|
3
|
-
*
|
|
4
|
-
* @deprecated CacheKeys (<your-project>/config/cache-keys.ts)를 사용하세요.
|
|
5
|
-
*
|
|
6
|
-
* 캐시 키 생성 헬퍼 함수들 (레거시 호환성 유지)
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated CacheKeys (<your-project>/config/cache-keys.ts)를 사용하세요.
|
|
10
|
-
* 이 객체는 레거시 호환성을 위해 유지됩니다.
|
|
11
|
-
*/
|
|
12
|
-
export declare const cacheKeys: {
|
|
13
|
-
geographyStats: (linkId: string) => string;
|
|
14
|
-
timelineStats: (linkId: string) => string;
|
|
15
|
-
deviceStats: (linkId: string) => string;
|
|
16
|
-
browserStats: (linkId: string) => string;
|
|
17
|
-
osStats: (linkId: string) => string;
|
|
18
|
-
adminCountryStats: () => string;
|
|
19
|
-
adminCityStats: () => string;
|
|
20
|
-
adminDailyStats: () => string;
|
|
21
|
-
adminDeviceStats: () => string;
|
|
22
|
-
adminBrowserStats: () => string;
|
|
23
|
-
userLinks: (userId: string) => string;
|
|
24
|
-
userStats: (userId: string) => string;
|
|
25
|
-
linkInfo: (linkId: string) => string;
|
|
26
|
-
linkClicks: (linkId: string) => string;
|
|
27
|
-
geoLocation: (ipAddress: string) => string;
|
|
28
|
-
community: {
|
|
29
|
-
popularTags: (period: string, limit: number) => string;
|
|
30
|
-
tagLinks: (tagId: string, page: number, pageSize: number, sortBy: string, period: string) => string;
|
|
31
|
-
recentLinks: (page: number, pageSize: number) => string;
|
|
32
|
-
trendingLinks: (period: string, algorithm: string, limit: number) => string;
|
|
33
|
-
searchLinks: (query: string, tagIds: string, sortBy: string, page: number, pageSize: number) => string;
|
|
34
|
-
};
|
|
35
|
-
};
|
package/dist/chunk-JBCDEAMW.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// src/cache/cache-keys-legacy.ts
|
|
2
|
-
var cacheKeys = {
|
|
3
|
-
// 분석 데이터 캐시 키
|
|
4
|
-
geographyStats: (linkId) => `geography:${linkId}`,
|
|
5
|
-
timelineStats: (linkId) => `timeline:${linkId}`,
|
|
6
|
-
deviceStats: (linkId) => `devices:${linkId}`,
|
|
7
|
-
browserStats: (linkId) => `browsers:${linkId}`,
|
|
8
|
-
osStats: (linkId) => `os:${linkId}`,
|
|
9
|
-
// 관리자 통계 캐시 키
|
|
10
|
-
adminCountryStats: () => "admin:stats:country",
|
|
11
|
-
adminCityStats: () => "admin:stats:city",
|
|
12
|
-
adminDailyStats: () => "admin:stats:daily",
|
|
13
|
-
adminDeviceStats: () => "admin:stats:device",
|
|
14
|
-
adminBrowserStats: () => "admin:stats:browser",
|
|
15
|
-
// 사용자 데이터 캐시 키
|
|
16
|
-
userLinks: (userId) => `user:links:${userId}`,
|
|
17
|
-
userStats: (userId) => `user:stats:${userId}`,
|
|
18
|
-
// 링크 데이터 캐시 키
|
|
19
|
-
linkInfo: (linkId) => `link:info:${linkId}`,
|
|
20
|
-
linkClicks: (linkId) => `link:clicks:${linkId}`,
|
|
21
|
-
// GeoLocation 캐시 키
|
|
22
|
-
geoLocation: (ipAddress) => `geo:${ipAddress}`,
|
|
23
|
-
// 커뮤니티 캐시 키
|
|
24
|
-
community: {
|
|
25
|
-
popularTags: (period, limit) => `popular-tags:${period}:${limit}`,
|
|
26
|
-
tagLinks: (tagId, page, pageSize, sortBy, period) => `tag-links:${tagId}:${page}:${pageSize}:${sortBy}:${period}`,
|
|
27
|
-
recentLinks: (page, pageSize) => `recent-links:${page}:${pageSize}`,
|
|
28
|
-
trendingLinks: (period, algorithm, limit) => `trending-links:${period}:${algorithm}:${limit}`,
|
|
29
|
-
searchLinks: (query, tagIds, sortBy, page, pageSize) => `search:${query}:${tagIds}:${sortBy}:${page}:${pageSize}`
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export {
|
|
34
|
-
cacheKeys
|
|
35
|
-
};
|
package/dist/chunk-O7CK3CKJ.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getENV,
|
|
3
|
-
isCacheEnabled
|
|
4
|
-
} from "./chunk-XI4MRH5P.js";
|
|
5
|
-
|
|
6
|
-
// src/cache/cache-config.ts
|
|
7
|
-
var getCacheConfig = {
|
|
8
|
-
// Analytics 캐시 설정
|
|
9
|
-
analytics: {
|
|
10
|
-
enabled: () => getENV().CACHE.ANALYTICS.ENABLED && isCacheEnabled(),
|
|
11
|
-
duration: () => getENV().CACHE.ANALYTICS.DURATION
|
|
12
|
-
},
|
|
13
|
-
// User 캐시 설정
|
|
14
|
-
user: {
|
|
15
|
-
enabled: () => getENV().CACHE.USER.ENABLED && isCacheEnabled(),
|
|
16
|
-
duration: () => getENV().CACHE.USER.DURATION
|
|
17
|
-
},
|
|
18
|
-
// GeoIP 캐시 설정
|
|
19
|
-
geoip: {
|
|
20
|
-
enabled: () => getENV().CACHE.GEOIP.ENABLED && isCacheEnabled(),
|
|
21
|
-
duration: () => getENV().CACHE.GEOIP.DURATION
|
|
22
|
-
},
|
|
23
|
-
// Settings 캐시 설정
|
|
24
|
-
settings: {
|
|
25
|
-
enabled: () => getENV().CACHE.SETTINGS.ENABLED && isCacheEnabled(),
|
|
26
|
-
duration: () => getENV().CACHE.SETTINGS.DURATION
|
|
27
|
-
},
|
|
28
|
-
// Reserved Words 캐시 설정
|
|
29
|
-
reservedWords: {
|
|
30
|
-
enabled: () => getENV().CACHE.RESERVED_WORDS.ENABLED && isCacheEnabled(),
|
|
31
|
-
duration: () => getENV().CACHE.RESERVED_WORDS.DURATION
|
|
32
|
-
},
|
|
33
|
-
// Alias 캐시 설정
|
|
34
|
-
alias: {
|
|
35
|
-
enabled: () => getENV().CACHE.ALIAS.ENABLED && isCacheEnabled(),
|
|
36
|
-
duration: () => getENV().CACHE.ALIAS.DURATION
|
|
37
|
-
},
|
|
38
|
-
// Community 캐시 설정
|
|
39
|
-
community: {
|
|
40
|
-
enabled: () => getENV().CACHE.COMMUNITY.ENABLED && isCacheEnabled(),
|
|
41
|
-
duration: () => getENV().CACHE.COMMUNITY.DURATION
|
|
42
|
-
},
|
|
43
|
-
// Link 캐시 설정
|
|
44
|
-
link: {
|
|
45
|
-
enabled: () => getENV().CACHE.LINK.ENABLED && isCacheEnabled(),
|
|
46
|
-
duration: () => getENV().CACHE.LINK.DURATION
|
|
47
|
-
},
|
|
48
|
-
// Rate Limiter 캐시 설정
|
|
49
|
-
rateLimit: {
|
|
50
|
-
enabled: () => getENV().CACHE.RATE_LIMIT.ENABLED && isCacheEnabled(),
|
|
51
|
-
duration: () => getENV().CACHE.RATE_LIMIT.DURATION
|
|
52
|
-
},
|
|
53
|
-
// URL Shortener Token 캐시 설정
|
|
54
|
-
urlToken: {
|
|
55
|
-
enabled: () => getENV().CACHE.URL_TOKEN.ENABLED && isCacheEnabled(),
|
|
56
|
-
duration: () => getENV().CACHE.URL_TOKEN.DURATION
|
|
57
|
-
},
|
|
58
|
-
// API Key 캐시 설정
|
|
59
|
-
apiKey: {
|
|
60
|
-
enabled: () => getENV().CACHE.API_KEY.ENABLED && isCacheEnabled(),
|
|
61
|
-
duration: () => getENV().CACHE.API_KEY.DURATION
|
|
62
|
-
},
|
|
63
|
-
// API Config 캐시 설정
|
|
64
|
-
apiConfig: {
|
|
65
|
-
enabled: () => getENV().CACHE.API_CONFIG.ENABLED && isCacheEnabled(),
|
|
66
|
-
duration: () => getENV().CACHE.API_CONFIG.DURATION
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
var getCacheTTL = {
|
|
70
|
-
settings: () => getCacheConfig.settings.duration(),
|
|
71
|
-
reservedWords: () => getCacheConfig.reservedWords.duration(),
|
|
72
|
-
alias: () => getCacheConfig.alias.duration(),
|
|
73
|
-
user: () => getCacheConfig.user.duration(),
|
|
74
|
-
analytics: () => getCacheConfig.analytics.duration(),
|
|
75
|
-
geoip: () => getCacheConfig.geoip.duration(),
|
|
76
|
-
community: () => getCacheConfig.community.duration(),
|
|
77
|
-
link: () => getCacheConfig.link.duration(),
|
|
78
|
-
default: () => getCacheConfig.analytics.duration()
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export {
|
|
82
|
-
getCacheConfig,
|
|
83
|
-
getCacheTTL
|
|
84
|
-
};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
initRequestMiddleware
|
|
3
|
-
} from "./chunk-62Q7DN5G.js";
|
|
4
1
|
import {
|
|
5
2
|
MiddlewareChain
|
|
6
3
|
} from "./chunk-FPESPW6P.js";
|
|
@@ -24,6 +21,9 @@ import {
|
|
|
24
21
|
import {
|
|
25
22
|
errorHandlerMiddleware
|
|
26
23
|
} from "./chunk-3YUKCYHI.js";
|
|
24
|
+
import {
|
|
25
|
+
initRequestMiddleware
|
|
26
|
+
} from "./chunk-62Q7DN5G.js";
|
|
27
27
|
|
|
28
28
|
// src/middleware/wrappers.ts
|
|
29
29
|
function withPublicApi(handler) {
|
|
File without changes
|