@withwiz/toolkit 0.9.0 → 0.9.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 (74) hide show
  1. package/dist/{chunk-XXPB4C37.js → chunk-2GK4LDPV.js} +6 -2
  2. package/dist/{chunk-NTZBMWB6.js → chunk-3P4TZM3O.js} +1 -1
  3. package/dist/{chunk-BRBOGLFT.js → chunk-4Y5MRUMX.js} +7 -7
  4. package/dist/{chunk-VWAB4PM7.js → chunk-5S7M2AJL.js} +1 -1
  5. package/dist/{chunk-HGVPZSWW.js → chunk-6SDUWMC3.js} +1 -1
  6. package/dist/{chunk-SCAFDDJP.js → chunk-BICSVLN7.js} +2 -2
  7. package/dist/{chunk-PRPMEHRE.js → chunk-BOABYFJ7.js} +22 -4
  8. package/dist/{chunk-XKIBJJA3.js → chunk-CNXK3SLK.js} +4 -4
  9. package/dist/{chunk-4XPXZNBX.js → chunk-ISP4MDKW.js} +1 -1
  10. package/dist/{chunk-LL3VWKY4.js → chunk-KMUYO6YD.js} +1 -1
  11. package/dist/{chunk-63EKUOJH.js → chunk-NERL6VYQ.js} +1 -1
  12. package/dist/chunk-OVOBSYR4.js +24 -0
  13. package/dist/{chunk-V3WZFUY3.js → chunk-OXKVQGRH.js} +5 -5
  14. package/dist/{chunk-XTGS6JJB.js → chunk-ROMGYJFX.js} +1 -1
  15. package/dist/{chunk-WSHRBK6Y.js → chunk-VQ47YRFC.js} +2 -2
  16. package/dist/{chunk-VH57Y5Z4.js → chunk-XDB3K74B.js} +1 -1
  17. package/dist/{chunk-JHUWZ6YW.js → chunk-YYTA6ERS.js} +6 -36
  18. package/dist/{chunk-U2TGXJ3A.js → chunk-ZVGEGDYF.js} +1 -1
  19. package/dist/core/auth/duration.d.ts +9 -0
  20. package/dist/core/auth/duration.js +7 -0
  21. package/dist/core/auth/index.js +22 -21
  22. package/dist/core/auth/jwt/cookie.d.ts +8 -0
  23. package/dist/core/auth/jwt/cookie.js +2 -1
  24. package/dist/core/auth/jwt/index.js +2 -1
  25. package/dist/core/auth/oauth/index.js +4 -4
  26. package/dist/core/auth/oauth/providers/index.js +3 -3
  27. package/dist/core/auth/services/index.js +2 -1
  28. package/dist/core/auth/services/login.service.js +2 -1
  29. package/dist/core/auth/services/oauth-callback.service.js +2 -1
  30. package/dist/core/auth/services/token-refresh.service.js +2 -1
  31. package/dist/core/auth/token-delivery.js +3 -2
  32. package/dist/core/cache/cache-factory.js +3 -3
  33. package/dist/core/cache/cache-invalidation.js +4 -4
  34. package/dist/core/cache/cache-wrapper.js +4 -4
  35. package/dist/core/cache/cache.js +5 -5
  36. package/dist/core/cache/hybrid-cache-manager.js +2 -2
  37. package/dist/core/cache/index.js +5 -5
  38. package/dist/core/cache/inmemory-cache-manager.d.ts +0 -9
  39. package/dist/core/cache/inmemory-cache-manager.js +1 -1
  40. package/dist/core/constants/index.js +6 -6
  41. package/dist/core/error/friendly-messages-v2.js +3 -3
  42. package/dist/core/error/index.js +6 -6
  43. package/dist/core/error/messages/index.js +2 -2
  44. package/dist/core/geolocation/index.js +5 -5
  45. package/dist/core/geolocation/providers/index.js +4 -4
  46. package/dist/core/system/environment.js +2 -2
  47. package/dist/core/system/health-check.js +2 -2
  48. package/dist/core/system/index.js +13 -13
  49. package/dist/core/utils/index.js +8 -8
  50. package/dist/initialize.js +6 -6
  51. package/dist/next/auth-handlers/index.js +13 -12
  52. package/dist/next/auth-handlers/login.handler.js +4 -3
  53. package/dist/next/auth-handlers/logout.handler.js +3 -2
  54. package/dist/next/auth-handlers/me.handler.js +4 -3
  55. package/dist/next/auth-handlers/oauth-authorize.handler.js +3 -3
  56. package/dist/next/auth-handlers/oauth-callback.handler.js +5 -4
  57. package/dist/next/auth-handlers/refresh.handler.js +4 -3
  58. package/dist/next/auth-types/handler-types.js +3 -2
  59. package/dist/next/auth-types/index.js +3 -2
  60. package/dist/next/error/error-handler.js +2 -2
  61. package/dist/next/error/index.js +9 -9
  62. package/dist/next/middleware/auth.js +6 -5
  63. package/dist/next/middleware/cors.js +2 -2
  64. package/dist/next/middleware/error-handler.js +6 -6
  65. package/dist/next/middleware/index.js +16 -15
  66. package/dist/next/middleware/wrappers.js +13 -12
  67. package/dist/next/utils/index.js +2 -2
  68. package/package.json +2 -1
  69. package/dist/{chunk-UWOWKOOQ.js → chunk-37VGD4VX.js} +3 -3
  70. package/dist/{chunk-KKZCNF6U.js → chunk-7WG7XPXC.js} +3 -3
  71. package/dist/{chunk-R7EFDSPZ.js → chunk-AYCXN6QJ.js} +3 -3
  72. package/dist/{chunk-E2HYIONP.js → chunk-Q5RPNLET.js} +3 -3
  73. package/dist/{chunk-P7WHMKN5.js → chunk-V3GEYUBG.js} +3 -3
  74. package/dist/{chunk-4EXZ2SDV.js → chunk-WU3V2AKE.js} +3 -3
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  InMemoryCacheManager
3
- } from "./chunk-JHUWZ6YW.js";
3
+ } from "./chunk-YYTA6ERS.js";
4
4
  import {
5
5
  isRedisGloballyDisabled,
6
6
  notifyRedisError
@@ -122,7 +122,11 @@ var HybridCacheManager = class _HybridCacheManager {
122
122
  if (effectiveBackend !== "redis") {
123
123
  promises.push(this.memoryCache.delete(key));
124
124
  }
125
- await Promise.allSettled(promises);
125
+ if (promises.length === 1) {
126
+ await promises[0];
127
+ } else if (promises.length > 1) {
128
+ await Promise.allSettled(promises);
129
+ }
126
130
  }
127
131
  /**
128
132
  * 패턴 매칭으로 캐시 삭제
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getCacheManager,
3
3
  getEffectiveCacheBackend
4
- } from "./chunk-SCAFDDJP.js";
4
+ } from "./chunk-BICSVLN7.js";
5
5
  import {
6
6
  logger
7
7
  } from "./chunk-QAIN3WNN.js";
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  AUTH_ERROR_CODE_MAP
3
- } from "./chunk-R7EFDSPZ.js";
4
- import {
5
- getErrorMessage
6
- } from "./chunk-KKZCNF6U.js";
3
+ } from "./chunk-AYCXN6QJ.js";
7
4
  import {
8
5
  AppError
9
6
  } from "./chunk-ATAQRXTH.js";
7
+ import {
8
+ getErrorMessage
9
+ } from "./chunk-7WG7XPXC.js";
10
10
  import {
11
11
  ERROR_CODES,
12
12
  classifyError
13
13
  } from "./chunk-XQIAXMRY.js";
14
- import {
15
- AuthError
16
- } from "./chunk-5GWGARXI.js";
17
14
  import {
18
15
  logger
19
16
  } from "./chunk-QAIN3WNN.js";
17
+ import {
18
+ AuthError
19
+ } from "./chunk-5GWGARXI.js";
20
20
  import {
21
21
  __spreadValues
22
22
  } from "./chunk-N3ETBM74.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getErrorMessage
3
- } from "./chunk-KKZCNF6U.js";
3
+ } from "./chunk-7WG7XPXC.js";
4
4
  import {
5
5
  getErrorCategory
6
6
  } from "./chunk-XQIAXMRY.js";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-5GWGARXI.js";
7
7
  import {
8
8
  getTokenDeliveryStrategy
9
- } from "./chunk-63EKUOJH.js";
9
+ } from "./chunk-NERL6VYQ.js";
10
10
 
11
11
  // src/next/auth-handlers/refresh.handler.ts
12
12
  import { NextResponse } from "next/server";
@@ -6,10 +6,10 @@ import {
6
6
  } from "./chunk-4TGPAUJV.js";
7
7
  import {
8
8
  HybridCacheManager
9
- } from "./chunk-XXPB4C37.js";
9
+ } from "./chunk-2GK4LDPV.js";
10
10
  import {
11
11
  InMemoryCacheManager
12
- } from "./chunk-JHUWZ6YW.js";
12
+ } from "./chunk-YYTA6ERS.js";
13
13
  import {
14
14
  isRedisAvailableNow,
15
15
  isRedisGloballyDisabled
@@ -1,6 +1,12 @@
1
1
  import {
2
2
  getAuthConfig
3
3
  } from "./chunk-N3TCQ5BF.js";
4
+ import {
5
+ JWT_DEFAULTS
6
+ } from "./chunk-7YWUKMZD.js";
7
+ import {
8
+ durationToSeconds
9
+ } from "./chunk-OVOBSYR4.js";
4
10
  import {
5
11
  __spreadValues
6
12
  } from "./chunk-N3ETBM74.js";
@@ -17,22 +23,34 @@ function getDefaultOptions() {
17
23
  sameSite: "lax"
18
24
  };
19
25
  }
26
+ function resolveMaxAge() {
27
+ let access = JWT_DEFAULTS.DEFAULT_ACCESS_TOKEN_EXPIRES;
28
+ let refresh = JWT_DEFAULTS.DEFAULT_REFRESH_TOKEN_EXPIRES;
29
+ try {
30
+ const cfg = getAuthConfig();
31
+ access = cfg.accessTokenExpiry;
32
+ refresh = cfg.refreshTokenExpiry;
33
+ } catch (e) {
34
+ }
35
+ return { access: durationToSeconds(access), refresh: durationToSeconds(refresh) };
36
+ }
20
37
  function setTokenCookies(response, tokenPair, options = {}) {
21
- var _a;
38
+ var _a, _b, _c;
22
39
  const opts = __spreadValues(__spreadValues({}, getDefaultOptions()), options);
40
+ const maxAge = resolveMaxAge();
23
41
  response.cookies.set("access_token", tokenPair.accessToken, {
24
42
  httpOnly: true,
25
43
  secure: opts.secure,
26
44
  sameSite: opts.sameSite,
27
45
  path: "/",
28
- maxAge: 15 * 60
46
+ maxAge: (_a = opts.accessTokenMaxAge) != null ? _a : maxAge.access
29
47
  });
30
48
  response.cookies.set("refresh_token", tokenPair.refreshToken, {
31
49
  httpOnly: true,
32
50
  secure: opts.secure,
33
51
  sameSite: opts.sameSite,
34
- path: (_a = opts.refreshTokenPath) != null ? _a : "/api/auth",
35
- maxAge: 7 * 24 * 60 * 60
52
+ path: (_b = opts.refreshTokenPath) != null ? _b : "/api/auth",
53
+ maxAge: (_c = opts.refreshTokenMaxAge) != null ? _c : maxAge.refresh
36
54
  });
37
55
  return response;
38
56
  }
@@ -4,21 +4,21 @@ import {
4
4
  import {
5
5
  ERROR_CODES
6
6
  } from "./chunk-XQIAXMRY.js";
7
+ import {
8
+ logger
9
+ } from "./chunk-QAIN3WNN.js";
7
10
  import {
8
11
  JWTManager
9
12
  } from "./chunk-LWHLB2Y6.js";
10
13
  import {
11
14
  getTokenDeliveryStrategy
12
- } from "./chunk-63EKUOJH.js";
15
+ } from "./chunk-NERL6VYQ.js";
13
16
  import {
14
17
  getAuthConfig
15
18
  } from "./chunk-N3TCQ5BF.js";
16
19
  import {
17
20
  ROLE_DEFAULTS
18
21
  } from "./chunk-7YWUKMZD.js";
19
- import {
20
- logger
21
- } from "./chunk-QAIN3WNN.js";
22
22
 
23
23
  // src/next/middleware/auth.ts
24
24
  function setAccessTokenBlacklistChecker(checker) {
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-5GWGARXI.js";
7
7
  import {
8
8
  getTokenDeliveryStrategy
9
- } from "./chunk-63EKUOJH.js";
9
+ } from "./chunk-NERL6VYQ.js";
10
10
  import {
11
11
  JWT_DEFAULTS,
12
12
  ROLE_DEFAULTS
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  clearTokenCookies
3
- } from "./chunk-PRPMEHRE.js";
3
+ } from "./chunk-BOABYFJ7.js";
4
4
 
5
5
  // src/next/auth-handlers/logout.handler.ts
6
6
  import { NextResponse } from "next/server";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  setTokenCookies
3
- } from "./chunk-PRPMEHRE.js";
3
+ } from "./chunk-BOABYFJ7.js";
4
4
  import {
5
5
  getAuthConfig
6
6
  } from "./chunk-N3TCQ5BF.js";
@@ -0,0 +1,24 @@
1
+ // src/core/auth/duration.ts
2
+ function durationToSeconds(expiry) {
3
+ const match = /^(\d+)\s*([smhd])?$/.exec(expiry.trim());
4
+ if (!match) {
5
+ throw new Error(`Invalid duration format: "${expiry}" (expected e.g. "7d", "15m", "900")`);
6
+ }
7
+ const value = parseInt(match[1], 10);
8
+ switch (match[2]) {
9
+ case "s":
10
+ return value;
11
+ case "m":
12
+ return value * 60;
13
+ case "h":
14
+ return value * 3600;
15
+ case "d":
16
+ return value * 86400;
17
+ default:
18
+ return value;
19
+ }
20
+ }
21
+
22
+ export {
23
+ durationToSeconds
24
+ };
@@ -1,3 +1,6 @@
1
+ import {
2
+ errorHandlerMiddleware
3
+ } from "./chunk-4Y5MRUMX.js";
1
4
  import {
2
5
  initRequestMiddleware
3
6
  } from "./chunk-VC2E6KYQ.js";
@@ -17,13 +20,10 @@ import {
17
20
  adminMiddleware,
18
21
  authMiddleware,
19
22
  optionalAuthMiddleware
20
- } from "./chunk-XKIBJJA3.js";
23
+ } from "./chunk-CNXK3SLK.js";
21
24
  import {
22
25
  corsMiddleware
23
- } from "./chunk-UWOWKOOQ.js";
24
- import {
25
- errorHandlerMiddleware
26
- } from "./chunk-BRBOGLFT.js";
26
+ } from "./chunk-37VGD4VX.js";
27
27
 
28
28
  // src/next/middleware/wrappers.ts
29
29
  function withPublicApi(handler) {
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-LWHLB2Y6.js";
4
4
  import {
5
5
  getTokenDeliveryStrategy
6
- } from "./chunk-63EKUOJH.js";
6
+ } from "./chunk-NERL6VYQ.js";
7
7
  import {
8
8
  JWT_DEFAULTS
9
9
  } from "./chunk-7YWUKMZD.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-MTZXWVW3.js";
4
4
  import {
5
5
  OAuthManager
6
- } from "./chunk-P7WHMKN5.js";
6
+ } from "./chunk-V3GEYUBG.js";
7
7
  import {
8
8
  OAUTH_STATE_COOKIE,
9
9
  clearOAuthStateCookie,
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-5GWGARXI.js";
15
15
  import {
16
16
  setTokenCookies
17
- } from "./chunk-PRPMEHRE.js";
17
+ } from "./chunk-BOABYFJ7.js";
18
18
 
19
19
  // src/next/auth-handlers/oauth-callback.handler.ts
20
20
  import { NextResponse } from "next/server";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  cache,
3
3
  geoCache
4
- } from "./chunk-SCAFDDJP.js";
4
+ } from "./chunk-BICSVLN7.js";
5
5
 
6
6
  // src/core/cache/cache-invalidation.ts
7
7
  var invalidateCache = {
@@ -12,7 +12,6 @@ import {
12
12
  // src/core/cache/inmemory-cache-manager.ts
13
13
  var InMemoryCacheManager = class _InMemoryCacheManager {
14
14
  constructor(prefix, config) {
15
- this.accessOrder = [];
16
15
  this.currentMemoryBytes = 0;
17
16
  this.cleanupTimer = null;
18
17
  this.prefix = prefix;
@@ -47,7 +46,6 @@ var InMemoryCacheManager = class _InMemoryCacheManager {
47
46
  if (!entry) {
48
47
  this.metrics.misses++;
49
48
  this.updateHitRate();
50
- logger.debug(`[Cache:M] miss: ${fullKey}`);
51
49
  return null;
52
50
  }
53
51
  if (this.isExpired(entry)) {
@@ -55,17 +53,15 @@ var InMemoryCacheManager = class _InMemoryCacheManager {
55
53
  this.metrics.misses++;
56
54
  this.metrics.expirations++;
57
55
  this.updateHitRate();
58
- logger.debug(`[Cache:M] miss (expired): ${fullKey}`);
59
56
  return null;
60
57
  }
61
58
  entry.accessedAt = Date.now();
62
- this.updateAccessOrder(fullKey);
59
+ if (this.config.evictionPolicy === "lru") {
60
+ this.cache.delete(fullKey);
61
+ this.cache.set(fullKey, entry);
62
+ }
63
63
  this.metrics.hits++;
64
64
  this.updateHitRate();
65
- logger.debug(`[Cache:M] hit: ${fullKey}`, {
66
- key: fullKey,
67
- prefix: this.prefix
68
- });
69
65
  return entry.value;
70
66
  }
71
67
  /**
@@ -81,7 +77,7 @@ var InMemoryCacheManager = class _InMemoryCacheManager {
81
77
  const existingEntry = this.cache.get(fullKey);
82
78
  if (existingEntry) {
83
79
  this.currentMemoryBytes -= existingEntry.size;
84
- this.removeFromAccessOrder(fullKey);
80
+ this.cache.delete(fullKey);
85
81
  }
86
82
  const now = Date.now();
87
83
  const entry = {
@@ -92,7 +88,6 @@ var InMemoryCacheManager = class _InMemoryCacheManager {
92
88
  createdAt: now
93
89
  };
94
90
  this.cache.set(fullKey, entry);
95
- this.accessOrder.push(fullKey);
96
91
  this.currentMemoryBytes += size;
97
92
  }
98
93
  /**
@@ -101,10 +96,6 @@ var InMemoryCacheManager = class _InMemoryCacheManager {
101
96
  async delete(key) {
102
97
  const fullKey = this.getFullKey(key);
103
98
  this.deleteEntry(fullKey);
104
- logger.debug("[InMemoryCache] Cache deleted", {
105
- key: fullKey,
106
- prefix: this.prefix
107
- });
108
99
  }
109
100
  /**
110
101
  * 패턴 매칭으로 캐시 삭제
@@ -172,7 +163,6 @@ var InMemoryCacheManager = class _InMemoryCacheManager {
172
163
  */
173
164
  clear() {
174
165
  this.cache.clear();
175
- this.accessOrder = [];
176
166
  this.currentMemoryBytes = 0;
177
167
  logger.info("[InMemoryCache] Cache cleared", { prefix: this.prefix });
178
168
  }
@@ -258,7 +248,6 @@ var InMemoryCacheManager = class _InMemoryCacheManager {
258
248
  if (entry) {
259
249
  this.currentMemoryBytes -= entry.size;
260
250
  this.cache.delete(fullKey);
261
- this.removeFromAccessOrder(fullKey);
262
251
  }
263
252
  }
264
253
  /**
@@ -314,7 +303,7 @@ var InMemoryCacheManager = class _InMemoryCacheManager {
314
303
  * LRU 교체: 가장 오래 접근되지 않은 항목 제거
315
304
  */
316
305
  evictLRU() {
317
- const lruKey = this.accessOrder.shift();
306
+ const lruKey = this.cache.keys().next().value;
318
307
  if (lruKey) {
319
308
  this.deleteEntry(lruKey);
320
309
  logger.debug("[InMemoryCache] LRU eviction", {
@@ -363,25 +352,6 @@ var InMemoryCacheManager = class _InMemoryCacheManager {
363
352
  });
364
353
  }
365
354
  }
366
- /**
367
- * 접근 순서 업데이트 (LRU용)
368
- */
369
- updateAccessOrder(key) {
370
- const index = this.accessOrder.indexOf(key);
371
- if (index !== -1) {
372
- this.accessOrder.splice(index, 1);
373
- }
374
- this.accessOrder.push(key);
375
- }
376
- /**
377
- * 접근 순서에서 제거
378
- */
379
- removeFromAccessOrder(key) {
380
- const index = this.accessOrder.indexOf(key);
381
- if (index !== -1) {
382
- this.accessOrder.splice(index, 1);
383
- }
384
- }
385
355
  /**
386
356
  * 히트율 업데이트
387
357
  */
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  OAuthManager
3
- } from "./chunk-P7WHMKN5.js";
3
+ } from "./chunk-V3GEYUBG.js";
4
4
  import {
5
5
  generateOAuthState,
6
6
  setOAuthStateCookie
@@ -0,0 +1,9 @@
1
+ /**
2
+ * 만료 기간 문자열을 초로 변환.
3
+ *
4
+ * JWT 만료(jose는 "7d" 형식 문자열을 직접 받음)와 쿠키 maxAge(초 단위 number)를
5
+ * 동일한 설정값에서 도출하기 위한 유틸. 단위 없는 숫자는 초로 간주.
6
+ *
7
+ * 지원 단위: s(초) / m(분) / h(시) / d(일).
8
+ */
9
+ export declare function durationToSeconds(expiry: string): number;
@@ -0,0 +1,7 @@
1
+ import {
2
+ durationToSeconds
3
+ } from "../../chunk-OVOBSYR4.js";
4
+ import "../../chunk-N3ETBM74.js";
5
+ export {
6
+ durationToSeconds
7
+ };
@@ -1,3 +1,19 @@
1
+ import {
2
+ JWTClientManager,
3
+ clearStoredTokens,
4
+ clearTokens,
5
+ createApiHeaders,
6
+ createAuthHeader,
7
+ decodeJWTPayload,
8
+ extractUserFromToken,
9
+ getStoredTokens,
10
+ getTokenExpirationString,
11
+ getTokenIssuedAtString,
12
+ getTokenRemainingTime,
13
+ isTokenExpired,
14
+ isTokenExpiringSoon,
15
+ storeTokens
16
+ } from "../../chunk-5I3EQHR4.js";
1
17
  import {
2
18
  DEFAULT_PASSWORD_CONFIG,
3
19
  createPasswordHasher,
@@ -18,26 +34,13 @@ import {
18
34
  BcryptPasswordHasher,
19
35
  MigratingPasswordHasher
20
36
  } from "../../chunk-ILMPKSWS.js";
21
- import {
22
- JWTClientManager,
23
- clearStoredTokens,
24
- clearTokens,
25
- createApiHeaders,
26
- createAuthHeader,
27
- decodeJWTPayload,
28
- extractUserFromToken,
29
- getStoredTokens,
30
- getTokenExpirationString,
31
- getTokenIssuedAtString,
32
- getTokenRemainingTime,
33
- isTokenExpired,
34
- isTokenExpiringSoon,
35
- storeTokens
36
- } from "../../chunk-5I3EQHR4.js";
37
37
  import {
38
38
  OAuthManager
39
- } from "../../chunk-P7WHMKN5.js";
39
+ } from "../../chunk-V3GEYUBG.js";
40
40
  import "../../chunk-CDALZTPN.js";
41
+ import {
42
+ GitHubOAuthProvider
43
+ } from "../../chunk-HIZ7USIF.js";
41
44
  import {
42
45
  GoogleOAuthProvider
43
46
  } from "../../chunk-GF3DKZIW.js";
@@ -46,9 +49,6 @@ import {
46
49
  } from "../../chunk-65HVR74O.js";
47
50
  import "../../chunk-33RIHX7O.js";
48
51
  import "../../chunk-GSSHHVHF.js";
49
- import {
50
- GitHubOAuthProvider
51
- } from "../../chunk-HIZ7USIF.js";
52
52
  import "../../chunk-JLRMET4V.js";
53
53
  import {
54
54
  TokenGenerator
@@ -70,9 +70,10 @@ import {
70
70
  OAuthError,
71
71
  PasswordError
72
72
  } from "../../chunk-5GWGARXI.js";
73
- import "../../chunk-PRPMEHRE.js";
73
+ import "../../chunk-BOABYFJ7.js";
74
74
  import "../../chunk-N3TCQ5BF.js";
75
75
  import "../../chunk-7YWUKMZD.js";
76
+ import "../../chunk-OVOBSYR4.js";
76
77
  import "../../chunk-6J2EJVND.js";
77
78
  import "../../chunk-F3R3UYBF.js";
78
79
  import "../../chunk-N3ETBM74.js";
@@ -3,6 +3,10 @@
3
3
  *
4
4
  * NextResponse 타입을 제네릭으로 처리하여
5
5
  * symlink 환경에서의 next 패키지 경로 충돌을 방지합니다.
6
+ *
7
+ * 쿠키 maxAge는 하드코딩하지 않고 auth config(초기화 시 ENV 주입된
8
+ * accessTokenExpiry/refreshTokenExpiry)에서 도출하여 JWT 만료와 단일 소스로
9
+ * 일치시킨다. 미초기화 시 JWT_DEFAULTS, 명시 override는 CookieOptions로 가능.
6
10
  */
7
11
  import type { TokenPair } from '@withwiz/toolkit/core/auth/types';
8
12
  /** cookies.set()을 지원하는 Response 타입 */
@@ -16,6 +20,10 @@ export interface CookieOptions {
16
20
  sameSite?: 'lax' | 'strict' | 'none';
17
21
  domain?: string;
18
22
  refreshTokenPath?: string;
23
+ /** access_token 쿠키 maxAge(초) override. 미지정 시 auth config accessTokenExpiry에서 도출. */
24
+ accessTokenMaxAge?: number;
25
+ /** refresh_token 쿠키 maxAge(초) override. 미지정 시 auth config refreshTokenExpiry에서 도출. */
26
+ refreshTokenMaxAge?: number;
19
27
  }
20
28
  export declare function setTokenCookies<T extends CookieSettableResponse>(response: T, tokenPair: TokenPair, options?: CookieOptions): T;
21
29
  export declare function clearTokenCookies<T extends CookieSettableResponse>(response: T, options?: CookieOptions): T;
@@ -1,9 +1,10 @@
1
1
  import {
2
2
  clearTokenCookies,
3
3
  setTokenCookies
4
- } from "../../../chunk-PRPMEHRE.js";
4
+ } from "../../../chunk-BOABYFJ7.js";
5
5
  import "../../../chunk-N3TCQ5BF.js";
6
6
  import "../../../chunk-7YWUKMZD.js";
7
+ import "../../../chunk-OVOBSYR4.js";
7
8
  import "../../../chunk-6J2EJVND.js";
8
9
  import "../../../chunk-F3R3UYBF.js";
9
10
  import "../../../chunk-N3ETBM74.js";
@@ -6,9 +6,10 @@ import "../../../chunk-5GWGARXI.js";
6
6
  import {
7
7
  clearTokenCookies,
8
8
  setTokenCookies
9
- } from "../../../chunk-PRPMEHRE.js";
9
+ } from "../../../chunk-BOABYFJ7.js";
10
10
  import "../../../chunk-N3TCQ5BF.js";
11
11
  import "../../../chunk-7YWUKMZD.js";
12
+ import "../../../chunk-OVOBSYR4.js";
12
13
  import "../../../chunk-6J2EJVND.js";
13
14
  import "../../../chunk-F3R3UYBF.js";
14
15
  import "../../../chunk-N3ETBM74.js";
@@ -1,7 +1,10 @@
1
1
  import {
2
2
  OAuthManager
3
- } from "../../../chunk-P7WHMKN5.js";
3
+ } from "../../../chunk-V3GEYUBG.js";
4
4
  import "../../../chunk-CDALZTPN.js";
5
+ import {
6
+ GitHubOAuthProvider
7
+ } from "../../../chunk-HIZ7USIF.js";
5
8
  import {
6
9
  GoogleOAuthProvider
7
10
  } from "../../../chunk-GF3DKZIW.js";
@@ -14,9 +17,6 @@ import {
14
17
  import {
15
18
  MicrosoftOAuthProvider
16
19
  } from "../../../chunk-GSSHHVHF.js";
17
- import {
18
- GitHubOAuthProvider
19
- } from "../../../chunk-HIZ7USIF.js";
20
20
  import {
21
21
  OAUTH_STATE_COOKIE,
22
22
  clearOAuthStateCookie,
@@ -1,4 +1,7 @@
1
1
  import "../../../../chunk-CDALZTPN.js";
2
+ import {
3
+ GitHubOAuthProvider
4
+ } from "../../../../chunk-HIZ7USIF.js";
2
5
  import {
3
6
  GoogleOAuthProvider
4
7
  } from "../../../../chunk-GF3DKZIW.js";
@@ -11,9 +14,6 @@ import {
11
14
  import {
12
15
  MicrosoftOAuthProvider
13
16
  } from "../../../../chunk-GSSHHVHF.js";
14
- import {
15
- GitHubOAuthProvider
16
- } from "../../../../chunk-HIZ7USIF.js";
17
17
  import "../../../../chunk-5GWGARXI.js";
18
18
  import "../../../../chunk-N3ETBM74.js";
19
19
  export {
@@ -20,9 +20,10 @@ import "../../../chunk-ZZABL54F.js";
20
20
  import "../../../chunk-GH3U4WRE.js";
21
21
  import "../../../chunk-LWHLB2Y6.js";
22
22
  import "../../../chunk-5GWGARXI.js";
23
- import "../../../chunk-PRPMEHRE.js";
23
+ import "../../../chunk-BOABYFJ7.js";
24
24
  import "../../../chunk-N3TCQ5BF.js";
25
25
  import "../../../chunk-7YWUKMZD.js";
26
+ import "../../../chunk-OVOBSYR4.js";
26
27
  import "../../../chunk-6J2EJVND.js";
27
28
  import "../../../chunk-F3R3UYBF.js";
28
29
  import "../../../chunk-N3ETBM74.js";
@@ -3,9 +3,10 @@ import {
3
3
  } from "../../../chunk-TNDEYJEL.js";
4
4
  import "../../../chunk-LWHLB2Y6.js";
5
5
  import "../../../chunk-5GWGARXI.js";
6
- import "../../../chunk-PRPMEHRE.js";
6
+ import "../../../chunk-BOABYFJ7.js";
7
7
  import "../../../chunk-N3TCQ5BF.js";
8
8
  import "../../../chunk-7YWUKMZD.js";
9
+ import "../../../chunk-OVOBSYR4.js";
9
10
  import "../../../chunk-6J2EJVND.js";
10
11
  import "../../../chunk-F3R3UYBF.js";
11
12
  import "../../../chunk-N3ETBM74.js";
@@ -3,9 +3,10 @@ import {
3
3
  } from "../../../chunk-MTZXWVW3.js";
4
4
  import "../../../chunk-LWHLB2Y6.js";
5
5
  import "../../../chunk-5GWGARXI.js";
6
- import "../../../chunk-PRPMEHRE.js";
6
+ import "../../../chunk-BOABYFJ7.js";
7
7
  import "../../../chunk-N3TCQ5BF.js";
8
8
  import "../../../chunk-7YWUKMZD.js";
9
+ import "../../../chunk-OVOBSYR4.js";
9
10
  import "../../../chunk-6J2EJVND.js";
10
11
  import "../../../chunk-F3R3UYBF.js";
11
12
  import "../../../chunk-N3ETBM74.js";
@@ -3,9 +3,10 @@ import {
3
3
  } from "../../../chunk-XAGPZLRK.js";
4
4
  import "../../../chunk-LWHLB2Y6.js";
5
5
  import "../../../chunk-5GWGARXI.js";
6
- import "../../../chunk-PRPMEHRE.js";
6
+ import "../../../chunk-BOABYFJ7.js";
7
7
  import "../../../chunk-N3TCQ5BF.js";
8
8
  import "../../../chunk-7YWUKMZD.js";
9
+ import "../../../chunk-OVOBSYR4.js";
9
10
  import "../../../chunk-6J2EJVND.js";
10
11
  import "../../../chunk-F3R3UYBF.js";
11
12
  import "../../../chunk-N3ETBM74.js";
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  getTokenDeliveryStrategy,
3
3
  resolveTokenDelivery
4
- } from "../../chunk-63EKUOJH.js";
5
- import "../../chunk-PRPMEHRE.js";
4
+ } from "../../chunk-NERL6VYQ.js";
5
+ import "../../chunk-BOABYFJ7.js";
6
6
  import "../../chunk-N3TCQ5BF.js";
7
7
  import "../../chunk-7YWUKMZD.js";
8
+ import "../../chunk-OVOBSYR4.js";
8
9
  import "../../chunk-6J2EJVND.js";
9
10
  import "../../chunk-F3R3UYBF.js";
10
11
  import "../../chunk-N3ETBM74.js";