@withwiz/toolkit 0.6.1 → 0.6.2

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 (124) hide show
  1. package/dist/auth/config.d.ts +0 -3
  2. package/dist/auth/config.js +1 -1
  3. package/dist/auth/core/jwt/cookie.js +2 -2
  4. package/dist/auth/core/jwt/index.js +2 -2
  5. package/dist/auth/handlers/index.js +21 -21
  6. package/dist/auth/handlers/login.handler.js +3 -3
  7. package/dist/auth/handlers/logout.handler.js +3 -3
  8. package/dist/auth/handlers/me.handler.js +2 -2
  9. package/dist/auth/handlers/oauth-callback.handler.js +3 -3
  10. package/dist/auth/handlers/refresh.handler.js +3 -3
  11. package/dist/auth/index.js +2 -2
  12. package/dist/auth/services/index.js +10 -10
  13. package/dist/auth/services/login.service.js +2 -2
  14. package/dist/auth/services/oauth-callback.service.js +2 -2
  15. package/dist/auth/services/token-refresh.service.js +2 -2
  16. package/dist/cache/cache-config.js +4 -4
  17. package/dist/cache/cache-env.js +3 -3
  18. package/dist/cache/cache-factory.js +12 -12
  19. package/dist/cache/cache-invalidation.js +13 -13
  20. package/dist/cache/cache-redis.js +6 -6
  21. package/dist/cache/cache-wrapper.js +13 -13
  22. package/dist/cache/cache.js +14 -14
  23. package/dist/cache/config.d.ts +0 -14
  24. package/dist/cache/config.js +1 -1
  25. package/dist/cache/hybrid-cache-manager.js +8 -8
  26. package/dist/cache/index.js +14 -14
  27. package/dist/cache/inmemory-cache-manager.js +3 -3
  28. package/dist/cache/noop-cache-manager.js +5 -5
  29. package/dist/cache/redis-cache-manager.js +7 -7
  30. package/dist/{chunk-3ECJUXLM.js → chunk-2KG2G35D.js} +3 -3
  31. package/dist/{chunk-3AJHXCDG.js → chunk-34IDAA7V.js} +2 -2
  32. package/dist/{chunk-77BJRPMN.js → chunk-3LVCK2NQ.js} +4 -4
  33. package/dist/{chunk-W2GBKW2T.js → chunk-545Q34YU.js} +2 -2
  34. package/dist/{chunk-2VMTIYLX.js → chunk-7DMKTJHU.js} +2 -2
  35. package/dist/{chunk-O35V6RIF.js → chunk-7UQZH2OH.js} +3 -3
  36. package/dist/{chunk-7KZRPDQD.js → chunk-A6FKWYO2.js} +2 -2
  37. package/dist/{chunk-EXJQKCTN.js → chunk-A7TN46LC.js} +4 -4
  38. package/dist/{chunk-S7OQWKUJ.js → chunk-B6Q7UNCU.js} +1 -1
  39. package/dist/{chunk-AYZJN32D.js → chunk-CDLCZB6F.js} +10 -15
  40. package/dist/{chunk-SR3SQL72.js → chunk-CVFVL5FL.js} +2 -2
  41. package/dist/{chunk-Q6KXN7HL.js → chunk-ENETIGKL.js} +2 -2
  42. package/dist/{chunk-WNEXLSDB.js → chunk-ERO4PGNO.js} +1 -1
  43. package/dist/{chunk-BEV7PQM3.js → chunk-F3NGZYL2.js} +1 -1
  44. package/dist/chunk-FDFPNSKY.js +14 -0
  45. package/dist/{chunk-G5OMETUS.js → chunk-FDRQUDFH.js} +1 -1
  46. package/dist/{chunk-MGQV723O.js → chunk-L74XPPH4.js} +1 -1
  47. package/dist/{chunk-SSS6XSEG.js → chunk-LG6GH4V7.js} +1 -1
  48. package/dist/{chunk-HHCDMWEF.js → chunk-LGAV5UU2.js} +1 -1
  49. package/dist/{chunk-3CBGGMIY.js → chunk-LHIVUV7Q.js} +10 -15
  50. package/dist/{chunk-OHBAELPZ.js → chunk-LMQSV5UK.js} +15 -21
  51. package/dist/{chunk-A2XAOU55.js → chunk-LNPZZ23G.js} +13 -19
  52. package/dist/{chunk-X6MGVFT3.js → chunk-LRRQ54YJ.js} +1 -1
  53. package/dist/chunk-MGBNIDTP.js +100 -0
  54. package/dist/{chunk-PYVYYO4X.js → chunk-MULM3Q5S.js} +5 -5
  55. package/dist/{chunk-TEXVRHPF.js → chunk-NOAU2JG7.js} +1 -1
  56. package/dist/{chunk-WJSMXUZB.js → chunk-NQUYNPSD.js} +1 -1
  57. package/dist/{chunk-CKK55QFQ.js → chunk-NW3JIRFK.js} +1 -1
  58. package/dist/{chunk-FI46LV42.js → chunk-O5E36ZIJ.js} +1 -1
  59. package/dist/{chunk-DBHISLC6.js → chunk-OFSPZUQD.js} +2 -2
  60. package/dist/{chunk-WRWWB2NU.js → chunk-PT4FA7U4.js} +2 -2
  61. package/dist/{chunk-VCOA6LMN.js → chunk-QOKDGW3F.js} +1 -1
  62. package/dist/{chunk-OCI7QCLM.js → chunk-QXIQB6OF.js} +2 -2
  63. package/dist/{chunk-L5WLPC2T.js → chunk-QXPMO2CO.js} +1 -1
  64. package/dist/{chunk-LFKPXF5E.js → chunk-RXVX2DCW.js} +2 -2
  65. package/dist/{chunk-PAF5OGDU.js → chunk-SI2Z26KP.js} +7 -7
  66. package/dist/{chunk-4BGAE7NU.js → chunk-TLBY3DUK.js} +1 -1
  67. package/dist/{chunk-IHUQRVPV.js → chunk-UQM35MAO.js} +2 -2
  68. package/dist/{chunk-G2Q4TI3Q.js → chunk-V3ZIR4UL.js} +1 -1
  69. package/dist/{chunk-GFWGLWTS.js → chunk-WJWCTCWZ.js} +10 -15
  70. package/dist/{chunk-CMU52MEQ.js → chunk-WLXAEHKK.js} +2 -2
  71. package/dist/{chunk-SFPMFVSD.js → chunk-WPW4HXW4.js} +9 -15
  72. package/dist/{chunk-ON7HZ3PW.js → chunk-WSXOKK6N.js} +1 -1
  73. package/dist/{chunk-MDTID4D2.js → chunk-XY3ZVORI.js} +1 -1
  74. package/dist/{chunk-KF3O2DAV.js → chunk-YTXCKIWE.js} +1 -1
  75. package/dist/{chunk-7JKZBEVB.js → chunk-YX3XMDDI.js} +8 -8
  76. package/dist/{chunk-CW3INZMV.js → chunk-ZG2XGO44.js} +1 -1
  77. package/dist/config/common.d.ts +0 -3
  78. package/dist/config/common.js +1 -1
  79. package/dist/config/registry.d.ts +5 -13
  80. package/dist/config/registry.js +1 -1
  81. package/dist/constants/index.js +14 -14
  82. package/dist/error/error-handler.js +3 -3
  83. package/dist/error/index.js +3 -3
  84. package/dist/geolocation/batch-processor.js +3 -3
  85. package/dist/geolocation/config.d.ts +0 -3
  86. package/dist/geolocation/config.js +1 -1
  87. package/dist/geolocation/index.js +7 -7
  88. package/dist/geolocation/providers/index.js +4 -4
  89. package/dist/geolocation/providers/ipgeolocation-provider.js +2 -2
  90. package/dist/geolocation/providers/maxmind-provider.js +2 -2
  91. package/dist/initialize.d.ts +2 -1
  92. package/dist/initialize.js +18 -17
  93. package/dist/logger/config.d.ts +0 -3
  94. package/dist/logger/config.js +1 -1
  95. package/dist/logger/logger.js +2 -2
  96. package/dist/middleware/auth.js +5 -5
  97. package/dist/middleware/cors-config.d.ts +0 -3
  98. package/dist/middleware/cors-config.js +1 -1
  99. package/dist/middleware/cors.js +4 -4
  100. package/dist/middleware/error-handler.js +4 -4
  101. package/dist/middleware/index.js +14 -14
  102. package/dist/middleware/middleware-chain.js +3 -3
  103. package/dist/middleware/rate-limit.js +3 -3
  104. package/dist/middleware/response-logger.js +3 -3
  105. package/dist/middleware/security.js +3 -3
  106. package/dist/middleware/wrappers.js +14 -14
  107. package/dist/storage/config.d.ts +0 -3
  108. package/dist/storage/config.js +1 -1
  109. package/dist/storage/r2-storage.js +1 -1
  110. package/dist/system/cpu.js +4 -4
  111. package/dist/system/disk.js +4 -4
  112. package/dist/system/environment.js +8 -8
  113. package/dist/system/health-check.js +5 -5
  114. package/dist/system/index.js +13 -13
  115. package/dist/system/memory.js +4 -4
  116. package/dist/system/network.js +4 -4
  117. package/dist/system/utils.js +3 -3
  118. package/dist/utils/cors.js +3 -3
  119. package/dist/utils/csv-export.js +3 -3
  120. package/dist/utils/error-processor.js +3 -3
  121. package/dist/utils/index.js +15 -15
  122. package/package.json +1 -1
  123. package/dist/chunk-GTPUVHSV.js +0 -30
  124. package/dist/chunk-UCIUAZQT.js +0 -106
@@ -2,7 +2,7 @@ import {
2
2
  logApiRequest,
3
3
  logApiResponse,
4
4
  logger
5
- } from "./chunk-TEXVRHPF.js";
5
+ } from "./chunk-NOAU2JG7.js";
6
6
 
7
7
  // src/middleware/response-logger.ts
8
8
  var responseLoggerMiddleware = async (context, next) => {
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-JQFQT4S2.js";
4
4
  import {
5
5
  setTokenCookies
6
- } from "./chunk-G2Q4TI3Q.js";
6
+ } from "./chunk-V3ZIR4UL.js";
7
7
  import {
8
8
  AuthError
9
9
  } from "./chunk-AIH3F7JV.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  getCommonConfig
3
- } from "./chunk-SFPMFVSD.js";
3
+ } from "./chunk-WPW4HXW4.js";
4
4
  import {
5
5
  getResolvedCacheConfig
6
- } from "./chunk-UCIUAZQT.js";
6
+ } from "./chunk-MGBNIDTP.js";
7
7
 
8
8
  // src/cache/cache-env.ts
9
9
  function _getNodeEnv() {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AUTH_ERROR_CODE_MAP
3
- } from "./chunk-MDTID4D2.js";
3
+ } from "./chunk-XY3ZVORI.js";
4
4
  import {
5
5
  AppError
6
6
  } from "./chunk-EOEMOXNT.js";
@@ -16,7 +16,7 @@ import {
16
16
  } from "./chunk-AIH3F7JV.js";
17
17
  import {
18
18
  logger
19
- } from "./chunk-TEXVRHPF.js";
19
+ } from "./chunk-NOAU2JG7.js";
20
20
  import {
21
21
  __spreadValues
22
22
  } from "./chunk-ORMEWXMH.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-TEXVRHPF.js";
3
+ } from "./chunk-NOAU2JG7.js";
4
4
  import {
5
5
  __spreadValues
6
6
  } from "./chunk-ORMEWXMH.js";
@@ -3,10 +3,10 @@ import {
3
3
  formatBytesPerSec,
4
4
  runCommand,
5
5
  runMacCommand
6
- } from "./chunk-X6MGVFT3.js";
6
+ } from "./chunk-LRRQ54YJ.js";
7
7
  import {
8
8
  logger
9
- } from "./chunk-TEXVRHPF.js";
9
+ } from "./chunk-NOAU2JG7.js";
10
10
 
11
11
  // src/system/network.ts
12
12
  async function getNetworkInfo() {
@@ -9,7 +9,7 @@ import {
9
9
  logApiRequest,
10
10
  logApiResponse,
11
11
  logger
12
- } from "./chunk-TEXVRHPF.js";
12
+ } from "./chunk-NOAU2JG7.js";
13
13
 
14
14
  // src/utils/error-processor.ts
15
15
  import { NextResponse } from "next/server";
@@ -9,10 +9,10 @@ import {
9
9
  } from "./chunk-3GAY2T2A.js";
10
10
  import {
11
11
  getAuthConfig
12
- } from "./chunk-A2XAOU55.js";
12
+ } from "./chunk-LNPZZ23G.js";
13
13
  import {
14
14
  logger
15
- } from "./chunk-TEXVRHPF.js";
15
+ } from "./chunk-NOAU2JG7.js";
16
16
 
17
17
  // src/middleware/auth.ts
18
18
  function setAccessTokenBlacklistChecker(checker) {
@@ -3,27 +3,27 @@ import {
3
3
  } from "./chunk-62Q7DN5G.js";
4
4
  import {
5
5
  MiddlewareChain
6
- } from "./chunk-KF3O2DAV.js";
6
+ } from "./chunk-YTXCKIWE.js";
7
7
  import {
8
8
  rateLimitMiddleware
9
- } from "./chunk-WJSMXUZB.js";
9
+ } from "./chunk-NQUYNPSD.js";
10
10
  import {
11
11
  responseLoggerMiddleware
12
- } from "./chunk-CKK55QFQ.js";
12
+ } from "./chunk-NW3JIRFK.js";
13
13
  import {
14
14
  securityMiddleware
15
- } from "./chunk-4BGAE7NU.js";
15
+ } from "./chunk-TLBY3DUK.js";
16
16
  import {
17
17
  adminMiddleware,
18
18
  authMiddleware,
19
19
  optionalAuthMiddleware
20
- } from "./chunk-LFKPXF5E.js";
20
+ } from "./chunk-RXVX2DCW.js";
21
21
  import {
22
22
  corsMiddleware
23
- } from "./chunk-7KZRPDQD.js";
23
+ } from "./chunk-A6FKWYO2.js";
24
24
  import {
25
25
  errorHandlerMiddleware
26
- } from "./chunk-WRWWB2NU.js";
26
+ } from "./chunk-PT4FA7U4.js";
27
27
 
28
28
  // src/middleware/wrappers.ts
29
29
  function withPublicApi(handler) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-TEXVRHPF.js";
3
+ } from "./chunk-NOAU2JG7.js";
4
4
 
5
5
  // src/middleware/security.ts
6
6
  import { NextResponse } from "next/server";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-TEXVRHPF.js";
3
+ } from "./chunk-NOAU2JG7.js";
4
4
  import {
5
5
  getCacheFallbackConfig,
6
6
  getConfig,
7
7
  getEnv,
8
8
  isCacheEnabled,
9
9
  validateRedisEnvironment
10
- } from "./chunk-DBHISLC6.js";
10
+ } from "./chunk-OFSPZUQD.js";
11
11
 
12
12
  // src/cache/cache-redis.ts
13
13
  import { Redis } from "@upstash/redis";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getAuthConfig
3
- } from "./chunk-A2XAOU55.js";
3
+ } from "./chunk-LNPZZ23G.js";
4
4
  import {
5
5
  __spreadValues
6
6
  } from "./chunk-ORMEWXMH.js";
@@ -6,16 +6,10 @@ import {
6
6
  } from "./chunk-2QH66EVQ.js";
7
7
 
8
8
  // src/middleware/cors-config.ts
9
- var GLOBAL_KEY = "__withwiz_cors_config";
10
- function getConfig() {
11
- var _a;
12
- return (_a = globalThis[GLOBAL_KEY]) != null ? _a : null;
13
- }
14
- function setConfig(config) {
15
- globalThis[GLOBAL_KEY] = config;
16
- }
17
9
  function initializeCors(config) {
18
- if (getConfig()) return;
10
+ var _a;
11
+ (_a = globalThis.__withwiz_config) != null ? _a : globalThis.__withwiz_config = {};
12
+ if (globalThis.__withwiz_config.cors) return;
19
13
  if (!config.allowedOrigins) {
20
14
  throw new ConfigurationError("CORS", "allowedOrigins is required");
21
15
  }
@@ -25,20 +19,21 @@ function initializeCors(config) {
25
19
  if (config.baseUrl === void 0) {
26
20
  configWarn("CORS", "baseUrl not provided");
27
21
  }
28
- setConfig({
22
+ globalThis.__withwiz_config.cors = {
29
23
  allowedOrigins: [...config.allowedOrigins],
30
24
  baseUrl: config.baseUrl
31
- });
25
+ };
32
26
  }
33
27
  function getCorsConfig() {
34
- const config = getConfig();
35
- if (!config) {
28
+ var _a;
29
+ const cors = (_a = globalThis.__withwiz_config) == null ? void 0 : _a.cors;
30
+ if (!cors) {
36
31
  throw new ConfigurationError("CORS", "Not initialized. Call initializeCors() first.");
37
32
  }
38
- return config;
33
+ return cors;
39
34
  }
40
35
  function resetCors() {
41
- globalThis[GLOBAL_KEY] = void 0;
36
+ if (globalThis.__withwiz_config) delete globalThis.__withwiz_config.cors;
42
37
  }
43
38
 
44
39
  export {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  IPGeolocationProvider
3
- } from "./chunk-HHCDMWEF.js";
3
+ } from "./chunk-LGAV5UU2.js";
4
4
  import {
5
5
  MaxMindProvider
6
- } from "./chunk-G5OMETUS.js";
6
+ } from "./chunk-FDRQUDFH.js";
7
7
  import {
8
8
  IPApiProvider
9
9
  } from "./chunk-DEEJBDJE.js";
@@ -6,31 +6,25 @@ import {
6
6
  } from "./chunk-2QH66EVQ.js";
7
7
 
8
8
  // src/config/common.ts
9
- var GLOBAL_KEY = "__withwiz_common_config";
10
- function getConfig() {
11
- var _a;
12
- return (_a = globalThis[GLOBAL_KEY]) != null ? _a : null;
13
- }
14
- function setConfig(config) {
15
- globalThis[GLOBAL_KEY] = config;
16
- }
17
9
  function initializeCommon(config) {
18
- var _a;
19
- if (getConfig()) return;
10
+ var _a, _b;
11
+ (_a = globalThis.__withwiz_config) != null ? _a : globalThis.__withwiz_config = {};
12
+ if (globalThis.__withwiz_config.common) return;
20
13
  if (!config.nodeEnv) {
21
14
  configWarn("Common", "nodeEnv not provided, using default: development");
22
15
  }
23
- setConfig({ nodeEnv: (_a = config.nodeEnv) != null ? _a : "development" });
16
+ globalThis.__withwiz_config.common = { nodeEnv: (_b = config.nodeEnv) != null ? _b : "development" };
24
17
  }
25
18
  function getCommonConfig() {
26
- const config = getConfig();
27
- if (!config) {
19
+ var _a;
20
+ const common = (_a = globalThis.__withwiz_config) == null ? void 0 : _a.common;
21
+ if (!common) {
28
22
  throw new ConfigurationError("Common", "Not initialized. Call initializeCommon() first.");
29
23
  }
30
- return config;
24
+ return common;
31
25
  }
32
26
  function resetCommon() {
33
- globalThis[GLOBAL_KEY] = void 0;
27
+ if (globalThis.__withwiz_config) delete globalThis.__withwiz_config.common;
34
28
  }
35
29
 
36
30
  export {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  cache,
3
3
  geoCache
4
- } from "./chunk-7JKZBEVB.js";
4
+ } from "./chunk-YX3XMDDI.js";
5
5
 
6
6
  // src/cache/cache-invalidation.ts
7
7
  var invalidateCache = {
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-AIH3F7JV.js";
13
13
  import {
14
14
  logger
15
- } from "./chunk-TEXVRHPF.js";
15
+ } from "./chunk-NOAU2JG7.js";
16
16
  import {
17
17
  __spreadProps,
18
18
  __spreadValues
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-TEXVRHPF.js";
3
+ } from "./chunk-NOAU2JG7.js";
4
4
  import {
5
5
  __spreadValues
6
6
  } from "./chunk-ORMEWXMH.js";
@@ -1,29 +1,29 @@
1
1
  import {
2
2
  NoopCacheManager
3
- } from "./chunk-Q6KXN7HL.js";
3
+ } from "./chunk-ENETIGKL.js";
4
4
  import {
5
5
  RedisCacheManager
6
- } from "./chunk-O35V6RIF.js";
6
+ } from "./chunk-7UQZH2OH.js";
7
7
  import {
8
8
  HybridCacheManager
9
- } from "./chunk-EXJQKCTN.js";
9
+ } from "./chunk-A7TN46LC.js";
10
10
  import {
11
11
  isRedisAvailableNow,
12
12
  isRedisGloballyDisabled
13
- } from "./chunk-IHUQRVPV.js";
13
+ } from "./chunk-UQM35MAO.js";
14
14
  import {
15
15
  InMemoryCacheManager
16
- } from "./chunk-CW3INZMV.js";
16
+ } from "./chunk-ZG2XGO44.js";
17
17
  import {
18
18
  logger
19
- } from "./chunk-TEXVRHPF.js";
19
+ } from "./chunk-NOAU2JG7.js";
20
20
  import {
21
21
  getCacheConfig
22
- } from "./chunk-BEV7PQM3.js";
22
+ } from "./chunk-F3NGZYL2.js";
23
23
  import {
24
24
  getENV,
25
25
  isCacheEnabled
26
- } from "./chunk-DBHISLC6.js";
26
+ } from "./chunk-OFSPZUQD.js";
27
27
 
28
28
  // src/cache/cache-factory.ts
29
29
  function getInMemoryConfig() {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-TEXVRHPF.js";
3
+ } from "./chunk-NOAU2JG7.js";
4
4
  import {
5
5
  DEFAULT_INMEMORY_CONFIG
6
6
  } from "./chunk-SS56XFLI.js";
@@ -4,9 +4,6 @@ export interface CommonConfig {
4
4
  export interface ResolvedCommonConfig {
5
5
  nodeEnv: 'development' | 'production' | 'test';
6
6
  }
7
- declare global {
8
- var __withwiz_common_config: ResolvedCommonConfig | undefined;
9
- }
10
7
  export declare function initializeCommon(config: CommonConfig): void;
11
8
  export declare function getCommonConfig(): ResolvedCommonConfig;
12
9
  export declare function resetCommon(): void;
@@ -2,7 +2,7 @@ import {
2
2
  getCommonConfig,
3
3
  initializeCommon,
4
4
  resetCommon
5
- } from "../chunk-SFPMFVSD.js";
5
+ } from "../chunk-WPW4HXW4.js";
6
6
  import "../chunk-K25ICPU4.js";
7
7
  import "../chunk-2QH66EVQ.js";
8
8
  import "../chunk-ORMEWXMH.js";
@@ -1,11 +1,8 @@
1
1
  /**
2
2
  * Unified Config Registry
3
3
  *
4
- * Live read-only view over individual module stores
5
- * (`globalThis.__withwiz_*_config`).
6
- *
7
- * `config.auth` and `getAuthConfig()` return the same object —
8
- * there is only one source of truth per module.
4
+ * 모든 모듈 설정을 단일 객체 `globalThis.__withwiz_config`에 저장.
5
+ * `config.auth`와 `getAuthConfig()` 모두 같은 객체를 반환한다.
9
6
  */
10
7
  import type { ResolvedCommonConfig } from './common';
11
8
  import type { ResolvedAuthConfig } from '../auth/config';
@@ -23,13 +20,8 @@ export interface ConfigRegistry {
23
20
  geolocation?: ResolvedGeolocationConfig;
24
21
  cors?: ResolvedCorsConfig;
25
22
  }
26
- /**
27
- * Read-only Proxy that delegates to each module's globalThis store.
28
- * Returns `undefined` for optional modules that haven't been initialized.
29
- * Throws `TypeError` on any setter attempt.
30
- */
23
+ declare global {
24
+ var __withwiz_config: Partial<ConfigRegistry> | undefined;
25
+ }
31
26
  export declare const config: ConfigRegistry;
32
- /**
33
- * Reset all module stores. For test cleanup only.
34
- */
35
27
  export declare function resetConfig(): void;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  config,
3
3
  resetConfig
4
- } from "../chunk-GTPUVHSV.js";
4
+ } from "../chunk-FDFPNSKY.js";
5
5
  import "../chunk-ORMEWXMH.js";
6
6
  export {
7
7
  config,
@@ -1,3 +1,17 @@
1
+ import {
2
+ ERROR_CODES,
3
+ HTTP_STATUS,
4
+ classifyError,
5
+ formatErrorMessage,
6
+ getAllErrorCodes,
7
+ getDefaultErrorMessage,
8
+ getErrorByCode,
9
+ getErrorCategory,
10
+ getErrorCodesByCategory,
11
+ getErrorInfo,
12
+ getHttpStatus,
13
+ getLogLevel
14
+ } from "../chunk-SNTLJ646.js";
1
15
  import {
2
16
  GENERIC_CONFIRM_MESSAGES,
3
17
  GENERIC_ERROR_MESSAGES,
@@ -30,20 +44,6 @@ import {
30
44
  URL,
31
45
  USER_INPUT
32
46
  } from "../chunk-LNV2E4I6.js";
33
- import {
34
- ERROR_CODES,
35
- HTTP_STATUS,
36
- classifyError,
37
- formatErrorMessage,
38
- getAllErrorCodes,
39
- getDefaultErrorMessage,
40
- getErrorByCode,
41
- getErrorCategory,
42
- getErrorCodesByCategory,
43
- getErrorInfo,
44
- getHttpStatus,
45
- getLogLevel
46
- } from "../chunk-SNTLJ646.js";
47
47
  import "../chunk-ORMEWXMH.js";
48
48
  export {
49
49
  CSRF,
@@ -5,12 +5,12 @@ import {
5
5
  error_handler_default,
6
6
  processError,
7
7
  withErrorHandler
8
- } from "../chunk-MDTID4D2.js";
8
+ } from "../chunk-XY3ZVORI.js";
9
9
  import "../chunk-EOEMOXNT.js";
10
10
  import "../chunk-SNTLJ646.js";
11
11
  import "../chunk-AIH3F7JV.js";
12
- import "../chunk-TEXVRHPF.js";
13
- import "../chunk-OHBAELPZ.js";
12
+ import "../chunk-NOAU2JG7.js";
13
+ import "../chunk-LMQSV5UK.js";
14
14
  import "../chunk-K25ICPU4.js";
15
15
  import "../chunk-2QH66EVQ.js";
16
16
  import "../chunk-ORMEWXMH.js";
@@ -15,7 +15,7 @@ import {
15
15
  errorToResponse,
16
16
  processError,
17
17
  withErrorHandler
18
- } from "../chunk-MDTID4D2.js";
18
+ } from "../chunk-XY3ZVORI.js";
19
19
  import {
20
20
  AppError
21
21
  } from "../chunk-EOEMOXNT.js";
@@ -48,8 +48,8 @@ import {
48
48
  getLogLevel
49
49
  } from "../chunk-SNTLJ646.js";
50
50
  import "../chunk-AIH3F7JV.js";
51
- import "../chunk-TEXVRHPF.js";
52
- import "../chunk-OHBAELPZ.js";
51
+ import "../chunk-NOAU2JG7.js";
52
+ import "../chunk-LMQSV5UK.js";
53
53
  import "../chunk-K25ICPU4.js";
54
54
  import "../chunk-2QH66EVQ.js";
55
55
  import "../chunk-ORMEWXMH.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  BatchProcessor,
3
3
  createBatchProcessor
4
- } from "../chunk-SSS6XSEG.js";
5
- import "../chunk-TEXVRHPF.js";
6
- import "../chunk-OHBAELPZ.js";
4
+ } from "../chunk-LG6GH4V7.js";
5
+ import "../chunk-NOAU2JG7.js";
6
+ import "../chunk-LMQSV5UK.js";
7
7
  import "../chunk-K25ICPU4.js";
8
8
  import "../chunk-2QH66EVQ.js";
9
9
  import "../chunk-ORMEWXMH.js";
@@ -6,9 +6,6 @@ export interface ResolvedGeolocationConfig {
6
6
  ipgeolocationApiKey?: string;
7
7
  maxmindLicenseKey?: string;
8
8
  }
9
- declare global {
10
- var __withwiz_geolocation_config: ResolvedGeolocationConfig | undefined;
11
- }
12
9
  export declare function initializeGeolocation(config: GeolocationConfig): void;
13
10
  export declare function getGeolocationConfig(): ResolvedGeolocationConfig;
14
11
  export declare function resetGeolocation(): void;
@@ -2,7 +2,7 @@ import {
2
2
  getGeolocationConfig,
3
3
  initializeGeolocation,
4
4
  resetGeolocation
5
- } from "../chunk-3CBGGMIY.js";
5
+ } from "../chunk-LHIVUV7Q.js";
6
6
  import "../chunk-K25ICPU4.js";
7
7
  import "../chunk-2QH66EVQ.js";
8
8
  import "../chunk-ORMEWXMH.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  GeoIPProviderFactory
3
- } from "../chunk-CMU52MEQ.js";
3
+ } from "../chunk-WLXAEHKK.js";
4
4
  import {
5
5
  IPGeolocationProvider
6
- } from "../chunk-HHCDMWEF.js";
6
+ } from "../chunk-LGAV5UU2.js";
7
7
  import {
8
8
  MaxMindProvider
9
- } from "../chunk-G5OMETUS.js";
9
+ } from "../chunk-FDRQUDFH.js";
10
10
  import {
11
11
  IPApiProvider
12
12
  } from "../chunk-DEEJBDJE.js";
@@ -20,10 +20,10 @@ import {
20
20
  import {
21
21
  BatchProcessor,
22
22
  createBatchProcessor
23
- } from "../chunk-SSS6XSEG.js";
24
- import "../chunk-3CBGGMIY.js";
25
- import "../chunk-TEXVRHPF.js";
26
- import "../chunk-OHBAELPZ.js";
23
+ } from "../chunk-LG6GH4V7.js";
24
+ import "../chunk-LHIVUV7Q.js";
25
+ import "../chunk-NOAU2JG7.js";
26
+ import "../chunk-LMQSV5UK.js";
27
27
  import "../chunk-K25ICPU4.js";
28
28
  import "../chunk-2QH66EVQ.js";
29
29
  import "../chunk-ORMEWXMH.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  GeoIPProviderFactory
3
- } from "../../chunk-CMU52MEQ.js";
3
+ } from "../../chunk-WLXAEHKK.js";
4
4
  import {
5
5
  IPGeolocationProvider
6
- } from "../../chunk-HHCDMWEF.js";
6
+ } from "../../chunk-LGAV5UU2.js";
7
7
  import {
8
8
  MaxMindProvider
9
- } from "../../chunk-G5OMETUS.js";
9
+ } from "../../chunk-FDRQUDFH.js";
10
10
  import {
11
11
  IPApiProvider
12
12
  } from "../../chunk-DEEJBDJE.js";
@@ -17,7 +17,7 @@ import {
17
17
  BaseGeoIPProvider,
18
18
  truncateString
19
19
  } from "../../chunk-AHDPGRXS.js";
20
- import "../../chunk-3CBGGMIY.js";
20
+ import "../../chunk-LHIVUV7Q.js";
21
21
  import "../../chunk-K25ICPU4.js";
22
22
  import "../../chunk-2QH66EVQ.js";
23
23
  import "../../chunk-ORMEWXMH.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  IPGeolocationProvider
3
- } from "../../chunk-HHCDMWEF.js";
3
+ } from "../../chunk-LGAV5UU2.js";
4
4
  import "../../chunk-AHDPGRXS.js";
5
- import "../../chunk-3CBGGMIY.js";
5
+ import "../../chunk-LHIVUV7Q.js";
6
6
  import "../../chunk-K25ICPU4.js";
7
7
  import "../../chunk-2QH66EVQ.js";
8
8
  import "../../chunk-ORMEWXMH.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  MaxMindProvider
3
- } from "../../chunk-G5OMETUS.js";
3
+ } from "../../chunk-FDRQUDFH.js";
4
4
  import "../../chunk-AHDPGRXS.js";
5
- import "../../chunk-3CBGGMIY.js";
5
+ import "../../chunk-LHIVUV7Q.js";
6
6
  import "../../chunk-K25ICPU4.js";
7
7
  import "../../chunk-2QH66EVQ.js";
8
8
  import "../../chunk-ORMEWXMH.js";
@@ -5,6 +5,7 @@ import type { CacheConfigInput } from './cache/config';
5
5
  import type { StorageConfig } from './storage/config';
6
6
  import type { GeolocationConfig } from './geolocation/config';
7
7
  import type { CorsConfig } from './middleware/cors-config';
8
+ import type { ConfigRegistry } from './config/registry';
8
9
  export interface ToolkitConfig {
9
10
  nodeEnv?: CommonConfig['nodeEnv'];
10
11
  auth?: AuthConfig;
@@ -14,7 +15,7 @@ export interface ToolkitConfig {
14
15
  geolocation?: GeolocationConfig;
15
16
  cors?: CorsConfig;
16
17
  }
17
- export declare function initialize(config: ToolkitConfig): void;
18
+ export declare function initialize(toolkitConfig: ToolkitConfig): ConfigRegistry;
18
19
  export type { AuthConfig, LoggerConfig, CacheConfigInput as CacheConfig, StorageConfig, GeolocationConfig, CorsConfig, };
19
20
  export { config, resetConfig } from './config/registry';
20
21
  export type { ConfigRegistry } from './config/registry';