@withwiz/toolkit 0.13.0 → 0.14.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.
- package/dist/{chunk-YOIZUVRD.js → chunk-2HFLXCXJ.js} +7 -7
- package/dist/{chunk-QVU4BHMC.js → chunk-5EUK6YWS.js} +1 -1
- package/dist/{chunk-LYO2HV5F.js → chunk-DTADWVLS.js} +3 -3
- package/dist/{chunk-K7OZWWIS.js → chunk-F2FTS6H4.js} +2 -2
- package/dist/{chunk-G4IGD3AZ.js → chunk-GPBNH2EZ.js} +11 -3
- package/dist/{chunk-YYTA6ERS.js → chunk-JL7CSV6G.js} +12 -1
- package/dist/{chunk-TDRB5BIM.js → chunk-LJI4HDD6.js} +7 -7
- package/dist/{chunk-NKZPMRVF.js → chunk-MTRPUJ4B.js} +1 -1
- package/dist/{chunk-QVPGBTCL.js → chunk-OEZPVNSA.js} +1 -1
- package/dist/{chunk-L4WQRYMR.js → chunk-UTZ2XXGE.js} +5 -9
- package/dist/{chunk-Z3OLZKTN.js → chunk-VVCT2A7O.js} +3 -3
- package/dist/chunk-WNOTRPZP.js +44 -0
- package/dist/{chunk-RWN47K7J.js → chunk-XIAZAHIL.js} +7 -3
- package/dist/{chunk-ROJJJXRL.js → chunk-ZFBY2FNS.js} +2 -2
- package/dist/core/api-key/api-key.service.d.ts +6 -1
- package/dist/core/api-key/api-key.service.js +1 -1
- package/dist/core/api-key/index.js +1 -1
- package/dist/core/auth/index.js +3 -3
- package/dist/core/auth/services/index.js +6 -6
- package/dist/core/cache/cache-config.js +3 -3
- package/dist/core/cache/cache-env.js +2 -2
- package/dist/core/cache/cache-factory.js +9 -9
- package/dist/core/cache/cache-invalidation.js +10 -10
- package/dist/core/cache/cache-redis.js +3 -3
- package/dist/core/cache/cache-wrapper.js +10 -10
- package/dist/core/cache/cache.js +11 -11
- package/dist/core/cache/hybrid-cache-manager.js +5 -5
- package/dist/core/cache/index.js +11 -11
- package/dist/core/cache/inmemory-cache-manager.js +1 -1
- package/dist/core/cache/noop-cache-manager.js +4 -4
- package/dist/core/cache/redis-cache-manager.js +4 -4
- package/dist/core/constants/index.js +6 -6
- package/dist/core/error/index.js +3 -3
- package/dist/core/system/environment.js +2 -2
- package/dist/core/system/health-check.js +1 -1
- package/dist/core/system/index.js +6 -6
- package/dist/core/utils/index.js +8 -8
- package/dist/core/utils/input-validation.js +23 -2
- package/dist/initialize.js +3 -3
- package/dist/next/auth-handlers/index.js +18 -18
- package/dist/next/auth-handlers/logout.handler.d.ts +1 -1
- package/dist/next/auth-handlers/logout.handler.js +5 -1
- package/dist/next/auth-handlers/refresh.handler.js +1 -1
- package/dist/next/auth-types/handler-types.d.ts +9 -0
- package/dist/next/error/index.js +1 -1
- package/dist/next/middleware/error-handler.js +2 -2
- package/dist/next/middleware/index.js +12 -12
- package/dist/next/middleware/wrappers.js +6 -6
- package/dist/next/oapi/api-key-auth.js +1 -1
- package/dist/next/oapi/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-6E2Q27EN.js +0 -17
- package/dist/{chunk-UGLEAXTY.js → chunk-BPDYEB37.js} +3 -3
- package/dist/{chunk-TGEKWTFZ.js → chunk-IE52LXR7.js} +0 -0
- package/dist/{chunk-A6NIKJX5.js → chunk-LFJ24NDO.js} +3 -3
package/dist/core/cache/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import "../../chunk-HH4ZKZHD.js";
|
|
2
2
|
import {
|
|
3
3
|
invalidateCache
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-5EUK6YWS.js";
|
|
5
5
|
import {
|
|
6
6
|
cacheMetrics,
|
|
7
7
|
withCache
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-DTADWVLS.js";
|
|
9
9
|
import {
|
|
10
10
|
cache,
|
|
11
11
|
geoCache,
|
|
12
12
|
getCacheManager,
|
|
13
13
|
getEffectiveCacheBackend
|
|
14
|
-
} from "../../chunk-
|
|
14
|
+
} from "../../chunk-LJI4HDD6.js";
|
|
15
15
|
import {
|
|
16
16
|
HybridCacheManager
|
|
17
|
-
} from "../../chunk-
|
|
17
|
+
} from "../../chunk-VVCT2A7O.js";
|
|
18
18
|
import {
|
|
19
19
|
InMemoryCacheManager
|
|
20
|
-
} from "../../chunk-
|
|
20
|
+
} from "../../chunk-JL7CSV6G.js";
|
|
21
21
|
import {
|
|
22
22
|
NoopCacheManager
|
|
23
|
-
} from "../../chunk-
|
|
23
|
+
} from "../../chunk-ZFBY2FNS.js";
|
|
24
24
|
import {
|
|
25
25
|
RedisCacheManager
|
|
26
|
-
} from "../../chunk-
|
|
26
|
+
} from "../../chunk-F2FTS6H4.js";
|
|
27
27
|
import {
|
|
28
28
|
checkRedisConnection,
|
|
29
29
|
getRedisClient,
|
|
@@ -33,27 +33,27 @@ import {
|
|
|
33
33
|
logRedisInitialization,
|
|
34
34
|
notifyRedisError,
|
|
35
35
|
resetRedisGlobalState
|
|
36
|
-
} from "../../chunk-
|
|
36
|
+
} from "../../chunk-MTRPUJ4B.js";
|
|
37
37
|
import "../../chunk-QAIN3WNN.js";
|
|
38
38
|
import "../../chunk-O4L6RI5S.js";
|
|
39
39
|
import {
|
|
40
40
|
getCacheConfig,
|
|
41
41
|
getCacheTTL
|
|
42
|
-
} from "../../chunk-
|
|
42
|
+
} from "../../chunk-OEZPVNSA.js";
|
|
43
43
|
import {
|
|
44
44
|
getConfig,
|
|
45
45
|
getENV,
|
|
46
46
|
getEnv,
|
|
47
47
|
isCacheEnabled,
|
|
48
48
|
validateRedisEnvironment
|
|
49
|
-
} from "../../chunk-
|
|
49
|
+
} from "../../chunk-BPDYEB37.js";
|
|
50
50
|
import "../../chunk-IKZB26SK.js";
|
|
51
|
+
import "../../chunk-PX535BHW.js";
|
|
51
52
|
import {
|
|
52
53
|
getResolvedCacheConfig,
|
|
53
54
|
initializeCache,
|
|
54
55
|
resetCache
|
|
55
56
|
} from "../../chunk-RHYETIUR.js";
|
|
56
|
-
import "../../chunk-PX535BHW.js";
|
|
57
57
|
import {
|
|
58
58
|
CACHE_DURATION_DEFAULTS,
|
|
59
59
|
CACHE_ENV_VARS,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NoopCacheManager
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-RHYETIUR.js";
|
|
3
|
+
} from "../../chunk-ZFBY2FNS.js";
|
|
4
|
+
import "../../chunk-OEZPVNSA.js";
|
|
5
|
+
import "../../chunk-BPDYEB37.js";
|
|
7
6
|
import "../../chunk-PX535BHW.js";
|
|
7
|
+
import "../../chunk-RHYETIUR.js";
|
|
8
8
|
import "../../chunk-ERFD6YAW.js";
|
|
9
9
|
import "../../chunk-6J2EJVND.js";
|
|
10
10
|
import "../../chunk-F3R3UYBF.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RedisCacheManager
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-F2FTS6H4.js";
|
|
4
|
+
import "../../chunk-MTRPUJ4B.js";
|
|
5
5
|
import "../../chunk-QAIN3WNN.js";
|
|
6
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-BPDYEB37.js";
|
|
7
7
|
import "../../chunk-IKZB26SK.js";
|
|
8
|
-
import "../../chunk-RHYETIUR.js";
|
|
9
8
|
import "../../chunk-PX535BHW.js";
|
|
9
|
+
import "../../chunk-RHYETIUR.js";
|
|
10
10
|
import "../../chunk-ERFD6YAW.js";
|
|
11
11
|
import "../../chunk-6J2EJVND.js";
|
|
12
12
|
import "../../chunk-F3R3UYBF.js";
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GENERIC_CONFIRM_MESSAGES,
|
|
3
|
-
GENERIC_ERROR_MESSAGES,
|
|
4
|
-
GENERIC_INFO_MESSAGES,
|
|
5
|
-
GENERIC_SUCCESS_MESSAGES
|
|
6
|
-
} from "../../chunk-THUQVCTI.js";
|
|
7
1
|
import {
|
|
8
2
|
DATE_RANGE,
|
|
9
3
|
FILTER_OPTIONS,
|
|
@@ -20,6 +14,12 @@ import {
|
|
|
20
14
|
URL,
|
|
21
15
|
USER_INPUT
|
|
22
16
|
} from "../../chunk-GTCCVI45.js";
|
|
17
|
+
import {
|
|
18
|
+
GENERIC_CONFIRM_MESSAGES,
|
|
19
|
+
GENERIC_ERROR_MESSAGES,
|
|
20
|
+
GENERIC_INFO_MESSAGES,
|
|
21
|
+
GENERIC_SUCCESS_MESSAGES
|
|
22
|
+
} from "../../chunk-THUQVCTI.js";
|
|
23
23
|
import {
|
|
24
24
|
ERROR_CODES,
|
|
25
25
|
HTTP_STATUS,
|
package/dist/core/error/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AppError
|
|
3
|
-
} from "../../chunk-MCPPJI3T.js";
|
|
4
1
|
import {
|
|
5
2
|
extractErrorInfo
|
|
6
3
|
} from "../../chunk-6HQ5JHL4.js";
|
|
@@ -18,6 +15,9 @@ import {
|
|
|
18
15
|
} from "../../chunk-7WG7XPXC.js";
|
|
19
16
|
import "../../chunk-AMZWDLJ4.js";
|
|
20
17
|
import "../../chunk-VUYS3SU7.js";
|
|
18
|
+
import {
|
|
19
|
+
AppError
|
|
20
|
+
} from "../../chunk-MCPPJI3T.js";
|
|
21
21
|
import {
|
|
22
22
|
ERROR_CODES,
|
|
23
23
|
HTTP_STATUS,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
checkEnvironmentVariables
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-UTZ2XXGE.js";
|
|
4
4
|
import "../../chunk-KWUOLKDO.js";
|
|
5
5
|
import "../../chunk-QAIN3WNN.js";
|
|
6
6
|
import "../../chunk-CRJUFA73.js";
|
|
@@ -8,8 +8,8 @@ import "../../chunk-IKZB26SK.js";
|
|
|
8
8
|
import "../../chunk-TQMQ5XXG.js";
|
|
9
9
|
import "../../chunk-7YWUKMZD.js";
|
|
10
10
|
import "../../chunk-OVOBSYR4.js";
|
|
11
|
-
import "../../chunk-RHYETIUR.js";
|
|
12
11
|
import "../../chunk-PX535BHW.js";
|
|
12
|
+
import "../../chunk-RHYETIUR.js";
|
|
13
13
|
import "../../chunk-ERFD6YAW.js";
|
|
14
14
|
import "../../chunk-6J2EJVND.js";
|
|
15
15
|
import "../../chunk-F3R3UYBF.js";
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
checkServiceHealth
|
|
3
|
-
} from "../../chunk-TGEKWTFZ.js";
|
|
4
|
-
import "../../chunk-PBVP7CFZ.js";
|
|
5
1
|
import {
|
|
6
2
|
getMemoryInfo
|
|
7
3
|
} from "../../chunk-U52U5SK7.js";
|
|
@@ -16,7 +12,11 @@ import {
|
|
|
16
12
|
} from "../../chunk-E5TDIRBJ.js";
|
|
17
13
|
import {
|
|
18
14
|
checkEnvironmentVariables
|
|
19
|
-
} from "../../chunk-
|
|
15
|
+
} from "../../chunk-UTZ2XXGE.js";
|
|
16
|
+
import {
|
|
17
|
+
checkServiceHealth
|
|
18
|
+
} from "../../chunk-IE52LXR7.js";
|
|
19
|
+
import "../../chunk-PBVP7CFZ.js";
|
|
20
20
|
import {
|
|
21
21
|
getPlatform,
|
|
22
22
|
getRecommendedCommands
|
|
@@ -29,8 +29,8 @@ import "../../chunk-IKZB26SK.js";
|
|
|
29
29
|
import "../../chunk-TQMQ5XXG.js";
|
|
30
30
|
import "../../chunk-7YWUKMZD.js";
|
|
31
31
|
import "../../chunk-OVOBSYR4.js";
|
|
32
|
-
import "../../chunk-RHYETIUR.js";
|
|
33
32
|
import "../../chunk-PX535BHW.js";
|
|
33
|
+
import "../../chunk-RHYETIUR.js";
|
|
34
34
|
import "../../chunk-ERFD6YAW.js";
|
|
35
35
|
import "../../chunk-6J2EJVND.js";
|
|
36
36
|
import "../../chunk-F3R3UYBF.js";
|
package/dist/core/utils/index.js
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
removeEventHandlers,
|
|
3
|
-
sanitizeArray,
|
|
4
|
-
sanitizeHtml,
|
|
5
|
-
sanitizeInput,
|
|
6
|
-
sanitizeObjectFields,
|
|
7
|
-
sanitizeUrl
|
|
8
|
-
} from "../../chunk-3RK3MKAR.js";
|
|
9
1
|
import {
|
|
10
2
|
isApiErrorResponse,
|
|
11
3
|
isApiSuccessResponse,
|
|
@@ -34,6 +26,14 @@ import {
|
|
|
34
26
|
isValidJSON,
|
|
35
27
|
isValidUrl
|
|
36
28
|
} from "../../chunk-4ETAGZIT.js";
|
|
29
|
+
import {
|
|
30
|
+
removeEventHandlers,
|
|
31
|
+
sanitizeArray,
|
|
32
|
+
sanitizeHtml,
|
|
33
|
+
sanitizeInput,
|
|
34
|
+
sanitizeObjectFields,
|
|
35
|
+
sanitizeUrl
|
|
36
|
+
} from "../../chunk-3RK3MKAR.js";
|
|
37
37
|
import "../../chunk-N3ETBM74.js";
|
|
38
38
|
export {
|
|
39
39
|
isApiErrorResponse,
|
|
@@ -25,29 +25,50 @@ var ALLOWED_URL_SCHEMES = [
|
|
|
25
25
|
"tel:",
|
|
26
26
|
"sms:"
|
|
27
27
|
];
|
|
28
|
-
function isPrivateV4(a, b) {
|
|
28
|
+
function isPrivateV4(a, b, c = 0) {
|
|
29
29
|
if (a === 0) return true;
|
|
30
30
|
if (a === 127) return true;
|
|
31
31
|
if (a === 10) return true;
|
|
32
|
+
if (a === 100 && b >= 64 && b <= 127) return true;
|
|
32
33
|
if (a === 169 && b === 254) return true;
|
|
34
|
+
if (a === 192 && b === 0 && c === 0) return true;
|
|
33
35
|
if (a === 192 && b === 168) return true;
|
|
34
36
|
if (a === 172 && b >= 16 && b <= 31) return true;
|
|
37
|
+
if (a >= 224) return true;
|
|
35
38
|
return false;
|
|
36
39
|
}
|
|
40
|
+
function mappedV4Octets(h) {
|
|
41
|
+
const prefix = "::ffff:";
|
|
42
|
+
if (!h.startsWith(prefix)) return null;
|
|
43
|
+
const rest = h.slice(prefix.length);
|
|
44
|
+
const dotted = rest.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);
|
|
45
|
+
if (dotted) {
|
|
46
|
+
const o = dotted.slice(1, 5).map(Number);
|
|
47
|
+
return o.some((n) => n > 255) ? null : o;
|
|
48
|
+
}
|
|
49
|
+
const hex = rest.match(/^([0-9a-f]{1,4}):([0-9a-f]{1,4})$/);
|
|
50
|
+
if (!hex) return null;
|
|
51
|
+
const hi = parseInt(hex[1], 16);
|
|
52
|
+
const lo = parseInt(hex[2], 16);
|
|
53
|
+
return [hi >> 8, hi & 255, lo >> 8, lo & 255];
|
|
54
|
+
}
|
|
37
55
|
function isInternalHost(hostname) {
|
|
38
56
|
let h = hostname.toLowerCase();
|
|
39
57
|
if (h.startsWith("[") && h.endsWith("]")) h = h.slice(1, -1);
|
|
58
|
+
if (h.endsWith(".")) h = h.slice(0, -1);
|
|
40
59
|
if (h === "localhost" || h.endsWith(".localhost")) return true;
|
|
41
60
|
if (h.includes(":")) {
|
|
42
61
|
if (h === "::1" || h === "::") return true;
|
|
43
62
|
if (/^f[cd]/.test(h) || /^fe[89ab]/.test(h)) return true;
|
|
63
|
+
const mapped = mappedV4Octets(h);
|
|
64
|
+
if (mapped) return isPrivateV4(mapped[0], mapped[1], mapped[2]);
|
|
44
65
|
return false;
|
|
45
66
|
}
|
|
46
67
|
const v4 = h.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);
|
|
47
68
|
if (v4) {
|
|
48
69
|
const o = v4.slice(1, 5).map(Number);
|
|
49
70
|
if (o.some((n) => n > 255)) return false;
|
|
50
|
-
return isPrivateV4(o[0], o[1]);
|
|
71
|
+
return isPrivateV4(o[0], o[1], o[2]);
|
|
51
72
|
}
|
|
52
73
|
return false;
|
|
53
74
|
}
|
package/dist/initialize.js
CHANGED
|
@@ -19,12 +19,12 @@ import {
|
|
|
19
19
|
} from "./chunk-TQMQ5XXG.js";
|
|
20
20
|
import "./chunk-7YWUKMZD.js";
|
|
21
21
|
import "./chunk-OVOBSYR4.js";
|
|
22
|
-
import {
|
|
23
|
-
initializeCache
|
|
24
|
-
} from "./chunk-RHYETIUR.js";
|
|
25
22
|
import {
|
|
26
23
|
initializeCommon
|
|
27
24
|
} from "./chunk-PX535BHW.js";
|
|
25
|
+
import {
|
|
26
|
+
initializeCache
|
|
27
|
+
} from "./chunk-RHYETIUR.js";
|
|
28
28
|
import "./chunk-ERFD6YAW.js";
|
|
29
29
|
import "./chunk-6J2EJVND.js";
|
|
30
30
|
import "./chunk-F3R3UYBF.js";
|
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createLogoutHandler
|
|
3
|
+
} from "../../chunk-WNOTRPZP.js";
|
|
4
|
+
import {
|
|
5
|
+
createMeHandler
|
|
6
|
+
} from "../../chunk-AWFP2KAU.js";
|
|
7
|
+
import {
|
|
8
|
+
createOAuthAuthorizeHandler
|
|
9
|
+
} from "../../chunk-ZVGEGDYF.js";
|
|
10
|
+
import {
|
|
11
|
+
createOAuthCallbackHandler
|
|
12
|
+
} from "../../chunk-AQQ7JSS5.js";
|
|
13
|
+
import "../../chunk-MTZXWVW3.js";
|
|
14
|
+
import {
|
|
15
|
+
createRefreshHandler
|
|
16
|
+
} from "../../chunk-XIAZAHIL.js";
|
|
17
|
+
import "../../chunk-XAGPZLRK.js";
|
|
1
18
|
import {
|
|
2
19
|
createRegisterHandler
|
|
3
20
|
} from "../../chunk-RWCPRPEP.js";
|
|
@@ -16,24 +33,6 @@ import "../../chunk-75UDFONR.js";
|
|
|
16
33
|
import {
|
|
17
34
|
createLoginHandler
|
|
18
35
|
} from "../../chunk-5MPMPXIR.js";
|
|
19
|
-
import {
|
|
20
|
-
createLogoutHandler
|
|
21
|
-
} from "../../chunk-6E2Q27EN.js";
|
|
22
|
-
import {
|
|
23
|
-
createMeHandler
|
|
24
|
-
} from "../../chunk-AWFP2KAU.js";
|
|
25
|
-
import {
|
|
26
|
-
createOAuthAuthorizeHandler
|
|
27
|
-
} from "../../chunk-ZVGEGDYF.js";
|
|
28
|
-
import {
|
|
29
|
-
createOAuthCallbackHandler
|
|
30
|
-
} from "../../chunk-AQQ7JSS5.js";
|
|
31
|
-
import "../../chunk-MTZXWVW3.js";
|
|
32
|
-
import {
|
|
33
|
-
createRefreshHandler
|
|
34
|
-
} from "../../chunk-RWN47K7J.js";
|
|
35
|
-
import "../../chunk-XAGPZLRK.js";
|
|
36
|
-
import "../../chunk-ZZABL54F.js";
|
|
37
36
|
import "../../chunk-V3GEYUBG.js";
|
|
38
37
|
import "../../chunk-CDALZTPN.js";
|
|
39
38
|
import "../../chunk-HIZ7USIF.js";
|
|
@@ -42,6 +41,7 @@ import "../../chunk-65HVR74O.js";
|
|
|
42
41
|
import "../../chunk-33RIHX7O.js";
|
|
43
42
|
import "../../chunk-GSSHHVHF.js";
|
|
44
43
|
import "../../chunk-JLRMET4V.js";
|
|
44
|
+
import "../../chunk-ZZABL54F.js";
|
|
45
45
|
import "../../chunk-GH3U4WRE.js";
|
|
46
46
|
import "../../chunk-LWHLB2Y6.js";
|
|
47
47
|
import "../../chunk-5GWGARXI.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { NextRequest } from 'next/server';
|
|
2
2
|
import type { AuthHandlerOptions } from '@withwiz/toolkit/next/auth-types/handler-types';
|
|
3
|
-
export declare function createLogoutHandler(
|
|
3
|
+
export declare function createLogoutHandler(options: AuthHandlerOptions): (request: NextRequest) => Promise<Response>;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createLogoutHandler
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-WNOTRPZP.js";
|
|
4
|
+
import "../../chunk-XAGPZLRK.js";
|
|
5
|
+
import "../../chunk-LWHLB2Y6.js";
|
|
6
|
+
import "../../chunk-5GWGARXI.js";
|
|
7
|
+
import "../../chunk-HNFYO5XV.js";
|
|
4
8
|
import "../../chunk-DTRXWS7G.js";
|
|
5
9
|
import "../../chunk-TQMQ5XXG.js";
|
|
6
10
|
import "../../chunk-7YWUKMZD.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { NextRequest } from 'next/server';
|
|
2
2
|
import type { BaseUser, OAuthProviderName, UserRepository, OAuthAccountRepository, EmailTokenRepository, EmailSender, Logger } from '@withwiz/toolkit/core/auth/types';
|
|
3
3
|
import type { TokenDelivery } from '@withwiz/toolkit/core/auth/config';
|
|
4
|
+
import type { IRefreshTokenStore } from '@withwiz/toolkit/core/auth/services/refresh-token-store';
|
|
4
5
|
export interface AuthHandlerDependencies {
|
|
5
6
|
userRepository: UserRepository;
|
|
6
7
|
oauthAccountRepository: OAuthAccountRepository;
|
|
@@ -64,6 +65,14 @@ export interface AuthHandlerOptions {
|
|
|
64
65
|
};
|
|
65
66
|
/** 토큰 전달 모드. 미지정 시 전역 AuthConfig → 'hybrid' 순으로 해석 */
|
|
66
67
|
tokenDelivery?: TokenDelivery;
|
|
68
|
+
/**
|
|
69
|
+
* refresh 토큰 store. 주입 시:
|
|
70
|
+
* - refresh 핸들러가 회전(rotation) + 재사용 탐지(reuse detection)를 수행하고
|
|
71
|
+
* 새 refresh 토큰을 쿠키/응답에 반영한다.
|
|
72
|
+
* - logout 핸들러가 제출된 refresh 토큰의 family 를 즉시 무효화한다.
|
|
73
|
+
* 미주입 시 0.13 이전과 동일하게 동작한다(access 재발급만, 로그아웃은 쿠키 삭제만).
|
|
74
|
+
*/
|
|
75
|
+
refreshTokenStore?: IRefreshTokenStore;
|
|
67
76
|
}
|
|
68
77
|
export interface AuthHandlerResult {
|
|
69
78
|
GET: (req: NextRequest) => Promise<Response>;
|
package/dist/next/error/index.js
CHANGED
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
LocaleDetector
|
|
10
10
|
} from "../../chunk-K2PNAQI4.js";
|
|
11
|
-
import "../../chunk-MCPPJI3T.js";
|
|
12
11
|
import {
|
|
13
12
|
extractErrorInfo
|
|
14
13
|
} from "../../chunk-6HQ5JHL4.js";
|
|
@@ -18,6 +17,7 @@ import {
|
|
|
18
17
|
import "../../chunk-7WG7XPXC.js";
|
|
19
18
|
import "../../chunk-AMZWDLJ4.js";
|
|
20
19
|
import "../../chunk-VUYS3SU7.js";
|
|
20
|
+
import "../../chunk-MCPPJI3T.js";
|
|
21
21
|
import "../../chunk-5VZIAXO2.js";
|
|
22
22
|
import "../../chunk-QAIN3WNN.js";
|
|
23
23
|
import "../../chunk-5GWGARXI.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
errorHandlerMiddleware
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-LFJ24NDO.js";
|
|
4
4
|
import "../../chunk-NHFIOK2D.js";
|
|
5
|
-
import "../../chunk-MCPPJI3T.js";
|
|
6
5
|
import "../../chunk-7WG7XPXC.js";
|
|
7
6
|
import "../../chunk-AMZWDLJ4.js";
|
|
8
7
|
import "../../chunk-VUYS3SU7.js";
|
|
8
|
+
import "../../chunk-MCPPJI3T.js";
|
|
9
9
|
import "../../chunk-5VZIAXO2.js";
|
|
10
10
|
import "../../chunk-QAIN3WNN.js";
|
|
11
11
|
import "../../chunk-5GWGARXI.js";
|
|
@@ -4,7 +4,15 @@ import {
|
|
|
4
4
|
withCustomApi,
|
|
5
5
|
withOptionalAuthApi,
|
|
6
6
|
withPublicApi
|
|
7
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-2HFLXCXJ.js";
|
|
8
|
+
import {
|
|
9
|
+
MiddlewareChain
|
|
10
|
+
} from "../../chunk-WXOWI7BJ.js";
|
|
11
|
+
import {
|
|
12
|
+
createRateLimitMiddleware,
|
|
13
|
+
rateLimitMiddleware,
|
|
14
|
+
setRateLimitAdapter
|
|
15
|
+
} from "../../chunk-M4ZVQFOH.js";
|
|
8
16
|
import {
|
|
9
17
|
responseLoggerMiddleware
|
|
10
18
|
} from "../../chunk-LCYDMYZS.js";
|
|
@@ -27,24 +35,16 @@ import {
|
|
|
27
35
|
} from "../../chunk-37VGD4VX.js";
|
|
28
36
|
import {
|
|
29
37
|
errorHandlerMiddleware
|
|
30
|
-
} from "../../chunk-
|
|
38
|
+
} from "../../chunk-LFJ24NDO.js";
|
|
39
|
+
import "../../chunk-NHFIOK2D.js";
|
|
31
40
|
import {
|
|
32
41
|
initRequestMiddleware
|
|
33
42
|
} from "../../chunk-VC2E6KYQ.js";
|
|
34
|
-
import {
|
|
35
|
-
MiddlewareChain
|
|
36
|
-
} from "../../chunk-WXOWI7BJ.js";
|
|
37
|
-
import {
|
|
38
|
-
createRateLimitMiddleware,
|
|
39
|
-
rateLimitMiddleware,
|
|
40
|
-
setRateLimitAdapter
|
|
41
|
-
} from "../../chunk-M4ZVQFOH.js";
|
|
42
|
-
import "../../chunk-NHFIOK2D.js";
|
|
43
43
|
import "../../chunk-K2PNAQI4.js";
|
|
44
|
-
import "../../chunk-MCPPJI3T.js";
|
|
45
44
|
import "../../chunk-7WG7XPXC.js";
|
|
46
45
|
import "../../chunk-AMZWDLJ4.js";
|
|
47
46
|
import "../../chunk-VUYS3SU7.js";
|
|
47
|
+
import "../../chunk-MCPPJI3T.js";
|
|
48
48
|
import "../../chunk-5VZIAXO2.js";
|
|
49
49
|
import "../../chunk-QAIN3WNN.js";
|
|
50
50
|
import "../../chunk-LWHLB2Y6.js";
|
|
@@ -4,21 +4,21 @@ import {
|
|
|
4
4
|
withCustomApi,
|
|
5
5
|
withOptionalAuthApi,
|
|
6
6
|
withPublicApi
|
|
7
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-2HFLXCXJ.js";
|
|
8
|
+
import "../../chunk-WXOWI7BJ.js";
|
|
9
|
+
import "../../chunk-M4ZVQFOH.js";
|
|
8
10
|
import "../../chunk-LCYDMYZS.js";
|
|
9
11
|
import "../../chunk-Y4WPEIKW.js";
|
|
10
12
|
import "../../chunk-7Q6SMNMN.js";
|
|
11
13
|
import "../../chunk-37VGD4VX.js";
|
|
12
|
-
import "../../chunk-
|
|
13
|
-
import "../../chunk-VC2E6KYQ.js";
|
|
14
|
-
import "../../chunk-WXOWI7BJ.js";
|
|
15
|
-
import "../../chunk-M4ZVQFOH.js";
|
|
14
|
+
import "../../chunk-LFJ24NDO.js";
|
|
16
15
|
import "../../chunk-NHFIOK2D.js";
|
|
16
|
+
import "../../chunk-VC2E6KYQ.js";
|
|
17
17
|
import "../../chunk-K2PNAQI4.js";
|
|
18
|
-
import "../../chunk-MCPPJI3T.js";
|
|
19
18
|
import "../../chunk-7WG7XPXC.js";
|
|
20
19
|
import "../../chunk-AMZWDLJ4.js";
|
|
21
20
|
import "../../chunk-VUYS3SU7.js";
|
|
21
|
+
import "../../chunk-MCPPJI3T.js";
|
|
22
22
|
import "../../chunk-5VZIAXO2.js";
|
|
23
23
|
import "../../chunk-QAIN3WNN.js";
|
|
24
24
|
import "../../chunk-LWHLB2Y6.js";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "../../chunk-XWHT53CZ.js";
|
|
4
4
|
import "../../chunk-KYUJ6D65.js";
|
|
5
5
|
import "../../chunk-TN5ZNYR2.js";
|
|
6
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-GPBNH2EZ.js";
|
|
7
7
|
import "../../chunk-BTNM5YSU.js";
|
|
8
8
|
import "../../chunk-4JZIIMAF.js";
|
|
9
9
|
import "../../chunk-NUHSUAXG.js";
|
package/dist/next/oapi/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildOpenApiSpec
|
|
3
|
+
} from "../../chunk-L2A6NGW7.js";
|
|
1
4
|
import {
|
|
2
5
|
createApiKeyAuth
|
|
3
6
|
} from "../../chunk-XWHT53CZ.js";
|
|
@@ -7,12 +10,9 @@ import {
|
|
|
7
10
|
parseSearchParams,
|
|
8
11
|
requireParam
|
|
9
12
|
} from "../../chunk-Z4J452HD.js";
|
|
10
|
-
import {
|
|
11
|
-
buildOpenApiSpec
|
|
12
|
-
} from "../../chunk-L2A6NGW7.js";
|
|
13
13
|
import "../../chunk-KYUJ6D65.js";
|
|
14
14
|
import "../../chunk-TN5ZNYR2.js";
|
|
15
|
-
import "../../chunk-
|
|
15
|
+
import "../../chunk-GPBNH2EZ.js";
|
|
16
16
|
import "../../chunk-BTNM5YSU.js";
|
|
17
17
|
import "../../chunk-4JZIIMAF.js";
|
|
18
18
|
import "../../chunk-NUHSUAXG.js";
|
package/package.json
CHANGED
package/dist/chunk-6E2Q27EN.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
clearTokenCookies
|
|
3
|
-
} from "./chunk-DTRXWS7G.js";
|
|
4
|
-
|
|
5
|
-
// src/next/auth-handlers/logout.handler.ts
|
|
6
|
-
import { NextResponse } from "next/server";
|
|
7
|
-
function createLogoutHandler(_options) {
|
|
8
|
-
return async (_request) => {
|
|
9
|
-
const response = NextResponse.json({ success: true });
|
|
10
|
-
clearTokenCookies(response);
|
|
11
|
-
return response;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
createLogoutHandler
|
|
17
|
-
};
|
|
File without changes
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AUTH_ERROR_CODE_MAP
|
|
3
3
|
} from "./chunk-NHFIOK2D.js";
|
|
4
|
-
import {
|
|
5
|
-
AppError
|
|
6
|
-
} from "./chunk-MCPPJI3T.js";
|
|
7
4
|
import {
|
|
8
5
|
getErrorMessage
|
|
9
6
|
} from "./chunk-7WG7XPXC.js";
|
|
7
|
+
import {
|
|
8
|
+
AppError
|
|
9
|
+
} from "./chunk-MCPPJI3T.js";
|
|
10
10
|
import {
|
|
11
11
|
ERROR_CODES,
|
|
12
12
|
classifyError
|