@koseha/api-mcp 0.0.8 → 0.0.9

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.
@@ -2,13 +2,7 @@
2
2
  * openapi.json HTTP 요청으로 읽기 + TTL 캐시
3
3
  */
4
4
  const DEFAULT_OPENAPI_URL = "https://petstore3.swagger.io/api/v3/openapi.json";
5
- let cache = null;
6
- let cachedAt = 0;
7
- const TTL = 5 * 60 * 1000; // 5분
8
5
  export async function loadSwagger() {
9
- if (cache && Date.now() - cachedAt < TTL) {
10
- return cache;
11
- }
12
6
  const openapiUrl = process.env.OPENAPI_URL ||
13
7
  process.env.OPENAPI_JSON_URL ||
14
8
  DEFAULT_OPENAPI_URL;
@@ -18,9 +12,7 @@ export async function loadSwagger() {
18
12
  throw new Error(`HTTP ${response.status}: ${response.statusText} - ${openapiUrl}`);
19
13
  }
20
14
  const fileContent = await response.text();
21
- cache = JSON.parse(fileContent);
22
- cachedAt = Date.now();
23
- return cache;
15
+ return JSON.parse(fileContent);
24
16
  }
25
17
  catch (error) {
26
18
  if (error instanceof Error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koseha/api-mcp",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "An API MCP based on Swagger docs",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/koseha/api-mcp#readme",