daiso 1.0.10 → 1.2.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.
Files changed (88) hide show
  1. package/README.md +77 -5
  2. package/dist/api/actionsProxy.js +3 -0
  3. package/dist/api/cgvHandlers.js +15 -3
  4. package/dist/api/configStatus.js +2 -1
  5. package/dist/api/dtryxHandlers.js +113 -0
  6. package/dist/api/emart24Handlers.js +6 -2
  7. package/dist/api/gs25Handlers.js +22 -19
  8. package/dist/api/handlers.js +13 -5
  9. package/dist/api/healthCheckDefinitions.js +46 -16
  10. package/dist/api/healthCheckShape.js +24 -8
  11. package/dist/api/healthChecks.js +39 -20
  12. package/dist/api/operationalAuth.js +32 -0
  13. package/dist/api/routes/dtryxRoutes.js +22 -0
  14. package/dist/api/routes/healthRoutes.js +19 -11
  15. package/dist/api/routes/rateLimitStatsRoutes.js +274 -0
  16. package/dist/api/routes/registerServiceRoutes.js +37 -0
  17. package/dist/api/sevenelevenHandlers.js +7 -3
  18. package/dist/cli/commandOptions.js +24 -0
  19. package/dist/cli/commands/cinema.js +27 -0
  20. package/dist/cli.js +7 -1
  21. package/dist/cliHelp.js +3 -337
  22. package/dist/cliHelpDefinitions.js +369 -0
  23. package/dist/cliInteractive.js +8 -5
  24. package/dist/core/errors.js +29 -2
  25. package/dist/core/registry.js +13 -15
  26. package/dist/durableObjects/dailyRateLimiter.js +185 -0
  27. package/dist/durableObjects/rateLimitMetricsStore.js +144 -0
  28. package/dist/index.js +18 -31
  29. package/dist/middleware/dailyRateLimit.js +176 -0
  30. package/dist/pages/openapiFullSpec.js +2 -0
  31. package/dist/pages/openapiSpecActionParameters.js +429 -0
  32. package/dist/pages/openapiSpecActions.js +1 -391
  33. package/dist/pages/openapiSpecComponentsLottecinema.js +2 -2
  34. package/dist/pages/openapiSpecPathsDtryx.js +148 -0
  35. package/dist/pages/openapiSpecPathsLotteMart.js +10 -2
  36. package/dist/pages/promptRetailCinemaText.js +9 -1
  37. package/dist/services/cgv/errors.js +13 -0
  38. package/dist/services/cgv/transport.js +5 -22
  39. package/dist/services/cu/client.js +44 -30
  40. package/dist/services/cu/index.js +13 -3
  41. package/dist/services/cu/tools/checkInventory.js +65 -45
  42. package/dist/services/cu/tools/findNearbyStores.js +4 -3
  43. package/dist/services/cu/upstreamError.js +11 -0
  44. package/dist/services/dtryx/api.js +25 -0
  45. package/dist/services/dtryx/client.js +133 -0
  46. package/dist/services/dtryx/index.js +24 -0
  47. package/dist/services/dtryx/location.js +216 -0
  48. package/dist/services/dtryx/tools/getRemainingSeats.js +117 -0
  49. package/dist/services/dtryx/tools/listCinemas.js +46 -0
  50. package/dist/services/dtryx/tools/listNowShowing.js +77 -0
  51. package/dist/services/dtryx/types.js +4 -0
  52. package/dist/services/dtryx/validation.js +21 -0
  53. package/dist/services/feedback/tools/submitDeveloperRequest.js +15 -1
  54. package/dist/services/gs25/api.js +2 -2
  55. package/dist/services/gs25/client.js +16 -123
  56. package/dist/services/gs25/errors.js +12 -0
  57. package/dist/services/gs25/index.js +2 -2
  58. package/dist/services/gs25/productSearch.js +2 -14
  59. package/dist/services/gs25/storeStockTransport.js +30 -0
  60. package/dist/services/gs25/tools/checkInventory.js +7 -2
  61. package/dist/services/gs25/tools/findNearbyStores.js +20 -5
  62. package/dist/services/lottecinema/client.js +4 -2
  63. package/dist/services/lottemart/config.js +1 -1
  64. package/dist/services/lottemart/session.js +33 -201
  65. package/dist/services/lottemart/socketTransport.js +149 -0
  66. package/dist/services/oliveyoung/client.js +7 -39
  67. package/dist/services/oliveyoung/index.js +4 -4
  68. package/dist/services/oliveyoung/tools/checkInventory.js +6 -3
  69. package/dist/services/oliveyoung/tools/findNearbyStores.js +4 -3
  70. package/dist/services/oliveyoung/tools/searchProducts.js +4 -3
  71. package/dist/services/oliveyoung/transport.js +46 -0
  72. package/dist/services/seveneleven/client.js +20 -9
  73. package/dist/services/seveneleven/index.js +11 -7
  74. package/dist/services/seveneleven/inventory.js +5 -2
  75. package/dist/services/seveneleven/productKeyword.js +3 -2
  76. package/dist/services/seveneleven/readCache.js +49 -0
  77. package/dist/services/seveneleven/tools/checkInventory.js +4 -3
  78. package/dist/services/seveneleven/tools/getCatalogSnapshot.js +4 -3
  79. package/dist/services/seveneleven/tools/getSearchPopwords.js +4 -3
  80. package/dist/services/seveneleven/tools/searchProducts.js +4 -3
  81. package/dist/services/seveneleven/tools/searchStores.js +4 -3
  82. package/dist/utils/format.js +10 -3
  83. package/dist/utils/http.js +40 -12
  84. package/dist/utils/zyte.js +4 -101
  85. package/dist/utils/zyteJsonFallback.js +28 -0
  86. package/openapi.json +51 -3
  87. package/openapi.yaml +36 -3
  88. package/package.json +28 -27
@@ -0,0 +1,28 @@
1
+ /**
2
+ * 직접 JSON 조회와 유료 대체 경로 중지 안내
3
+ */
4
+ import { fetchJson, HttpError } from './http.js';
5
+ import { requestByZyte } from './zyte.js';
6
+ const ZYTE_FALLBACK_STATUSES = new Set([400, 403, 429]);
7
+ function hasZyteApiKey(apiKey) {
8
+ if (apiKey?.trim()) {
9
+ return true;
10
+ }
11
+ /* c8 ignore next */
12
+ return typeof process !== 'undefined' && Boolean(process.env?.ZYTE_API_KEY?.trim());
13
+ }
14
+ export async function fetchJsonWithZyteFallback(url, options = {}) {
15
+ const { zyteApiKey, zyteTags, ...directOptions } = options;
16
+ try {
17
+ return await fetchJson(url, directOptions);
18
+ }
19
+ catch (error) {
20
+ if (!(error instanceof HttpError) || !ZYTE_FALLBACK_STATUSES.has(error.status)) {
21
+ throw error;
22
+ }
23
+ if (!hasZyteApiKey(zyteApiKey)) {
24
+ throw error;
25
+ }
26
+ }
27
+ return requestByZyte({ apiKey: zyteApiKey, url, tags: zyteTags });
28
+ }
package/openapi.json CHANGED
@@ -22,6 +22,51 @@
22
22
  "summary": "공통 GET 액션 실행",
23
23
  "description": "action 값에 따라 기존 GET API 엔드포인트로 프록시합니다. OpenAI Actions 등록 시 이 단일 엔드포인트를 사용하세요.",
24
24
  "parameters": [
25
+ {
26
+ "name": "cinemaCode",
27
+ "in": "query",
28
+ "required": false,
29
+ "description": "디트릭스 극장 코드",
30
+ "schema": {
31
+ "type": "string"
32
+ }
33
+ },
34
+ {
35
+ "name": "brandCode",
36
+ "in": "query",
37
+ "required": false,
38
+ "description": "디트릭스 브랜드 코드",
39
+ "schema": {
40
+ "type": "string"
41
+ }
42
+ },
43
+ {
44
+ "name": "region",
45
+ "in": "query",
46
+ "required": false,
47
+ "description": "디트릭스 광역 지역명",
48
+ "schema": {
49
+ "type": "string"
50
+ }
51
+ },
52
+ {
53
+ "name": "movieName",
54
+ "in": "query",
55
+ "required": false,
56
+ "description": "디트릭스 영화명 부분 일치",
57
+ "schema": {
58
+ "type": "string"
59
+ }
60
+ },
61
+ {
62
+ "name": "includePlayDates",
63
+ "in": "query",
64
+ "required": false,
65
+ "description": "디트릭스 상영 가능 날짜 포함",
66
+ "schema": {
67
+ "type": "boolean"
68
+ }
69
+ },
25
70
  {
26
71
  "name": "action",
27
72
  "in": "query",
@@ -30,6 +75,9 @@
30
75
  "schema": {
31
76
  "type": "string",
32
77
  "enum": [
78
+ "dtryxListCinemas",
79
+ "dtryxListNowShowing",
80
+ "dtryxGetRemainingSeats",
33
81
  "daisoSearchProducts",
34
82
  "daisoGetProduct",
35
83
  "daisoFindStores",
@@ -551,7 +599,7 @@
551
599
  "name": "timeoutMs",
552
600
  "in": "query",
553
601
  "required": false,
554
- "description": "세븐일레븐 inventory 타임아웃",
602
+ "description": "원본 요청 타임아웃(ms), 디트릭스는 1~60000",
555
603
  "schema": {
556
604
  "type": "integer"
557
605
  }
@@ -2726,11 +2774,11 @@
2726
2774
  },
2727
2775
  "bookedSeats": {
2728
2776
  "type": "integer",
2729
- "example": 28
2777
+ "example": 4
2730
2778
  },
2731
2779
  "remainingSeats": {
2732
2780
  "type": "integer",
2733
- "example": 4
2781
+ "example": 28
2734
2782
  }
2735
2783
  }
2736
2784
  },
package/openapi.yaml CHANGED
@@ -24,6 +24,36 @@ paths:
24
24
  summary: 공통 GET 액션 실행
25
25
  description: action 값에 따라 기존 GET API 엔드포인트로 프록시합니다. OpenAI Actions 등록 시 이 단일 엔드포인트를 사용하세요.
26
26
  parameters:
27
+ - name: cinemaCode
28
+ in: query
29
+ required: false
30
+ description: 디트릭스 극장 코드
31
+ schema:
32
+ type: string
33
+ - name: brandCode
34
+ in: query
35
+ required: false
36
+ description: 디트릭스 브랜드 코드
37
+ schema:
38
+ type: string
39
+ - name: region
40
+ in: query
41
+ required: false
42
+ description: 디트릭스 광역 지역명
43
+ schema:
44
+ type: string
45
+ - name: movieName
46
+ in: query
47
+ required: false
48
+ description: 디트릭스 영화명 부분 일치
49
+ schema:
50
+ type: string
51
+ - name: includePlayDates
52
+ in: query
53
+ required: false
54
+ description: 디트릭스 상영 가능 날짜 포함
55
+ schema:
56
+ type: boolean
27
57
  - name: action
28
58
  in: query
29
59
  required: true
@@ -31,6 +61,9 @@ paths:
31
61
  schema:
32
62
  type: string
33
63
  enum:
64
+ - dtryxListCinemas
65
+ - dtryxListNowShowing
66
+ - dtryxGetRemainingSeats
34
67
  - daisoSearchProducts
35
68
  - daisoGetProduct
36
69
  - daisoFindStores
@@ -389,7 +422,7 @@ paths:
389
422
  - name: timeoutMs
390
423
  in: query
391
424
  required: false
392
- description: 세븐일레븐 inventory 타임아웃
425
+ description: 원본 요청 타임아웃(ms), 디트릭스는 1~60000
393
426
  schema:
394
427
  type: integer
395
428
  responses:
@@ -1920,10 +1953,10 @@ components:
1920
1953
  example: 32
1921
1954
  bookedSeats:
1922
1955
  type: integer
1923
- example: 28
1956
+ example: 4
1924
1957
  remainingSeats:
1925
1958
  type: integer
1926
- example: 4
1959
+ example: 28
1927
1960
  LotteCinemaTheaterSearchResponse:
1928
1961
  type: object
1929
1962
  properties:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "daiso",
3
- "version": "1.0.10",
3
+ "version": "1.2.0",
4
4
  "description": "Korean retail and cinema MCP server, CLI, and Codex Skill for Daiso, convenience stores, marts, Olive Young, and theaters",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -31,6 +31,7 @@
31
31
  "release:dry-run": "npm pack --dry-run",
32
32
  "publish:public": "npm publish --access public",
33
33
  "typecheck": "tsc --noEmit",
34
+ "check:source-lines": "npx tsx scripts/quality/check-source-line-limit.ts",
34
35
  "lint": "eslint \"src/**/*.ts\" \"tests/**/*.ts\" \"scripts/**/*.ts\" \"vitest.config.ts\"",
35
36
  "lint:fix": "eslint \"src/**/*.ts\" \"tests/**/*.ts\" \"scripts/**/*.ts\" \"vitest.config.ts\" --fix",
36
37
  "format": "prettier .github/**/*.md .github/**/*.yml README.md SECURITY.md AGENTS.md CONTRIBUTING.md package.json tsconfig.json .prettierrc.json .mcp.json eslint.config.ts --write",
@@ -39,7 +40,7 @@
39
40
  "test": "vitest run",
40
41
  "test:watch": "vitest",
41
42
  "test:coverage": "vitest run --coverage",
42
- "check": "npm run format:check && npm run lint && npm run lint:biome && npm run typecheck && npm test",
43
+ "check": "npm run format:check && npm run lint && npm run lint:biome && npm run typecheck && npm run check:source-lines && npm test",
43
44
  "lint:biome": "biome lint"
44
45
  },
45
46
  "keywords": [
@@ -76,40 +77,40 @@
76
77
  "url": "https://github.com/hmmhmmhm/daiso-mcp/issues"
77
78
  },
78
79
  "engines": {
79
- "node": ">=20"
80
+ "node": ">=22"
80
81
  },
81
82
  "devDependencies": {
82
- "@biomejs/biome": "^2.5.2",
83
- "@cloudflare/workers-types": "^4.20260702.1",
83
+ "@biomejs/biome": "^2.5.13",
84
+ "@cloudflare/workers-types": "^5.20260914.1",
84
85
  "@eslint/js": "^10.0.1",
85
- "@types/node": "^26.1.0",
86
- "@vitest/coverage-v8": "^4.1.7",
87
- "eslint": "^10.6.0",
86
+ "@types/node": "^26.5.1",
87
+ "@vitest/coverage-v8": "^4.1.11",
88
+ "eslint": "^10.8.0",
88
89
  "eslint-config-prettier": "^10.1.8",
89
- "globals": "^17.7.0",
90
+ "globals": "^17.12.0",
90
91
  "jiti": "^2.7.0",
91
- "playwright": "^1.61.1",
92
- "prettier": "^3.9.4",
93
- "sharp": "^0.35.3",
94
- "tsx": "^4.23.0",
95
- "typescript": "^6.0.3",
96
- "typescript-eslint": "^8.62.1",
97
- "vitest": "^4.1.7",
98
- "wrangler": "^4.107.0"
92
+ "playwright": "^1.63.0",
93
+ "prettier": "^3.9.6",
94
+ "sharp": "^0.35.4",
95
+ "tsx": "^4.23.1",
96
+ "typescript": "6.0.3",
97
+ "typescript-eslint": "^8.65.0",
98
+ "vitest": "^4.1.11",
99
+ "wrangler": "^4.131.2"
99
100
  },
100
101
  "overrides": {
101
- "flatted": "3.4.2",
102
- "undici": "7.28.0",
103
- "brace-expansion": "5.0.6",
104
- "ws": "8.21.0",
105
- "tmp": "0.2.7",
106
- "markdown-it": "14.2.0",
107
- "esbuild": "0.28.1"
102
+ "@modelcontextprotocol/sdk": {
103
+ "@hono/node-server": "2.0.11"
104
+ },
105
+ "miniflare": {
106
+ "sharp": "0.35.4",
107
+ "undici": "7.29.1"
108
+ }
108
109
  },
109
110
  "dependencies": {
110
- "@modelcontextprotocol/sdk": "^1.27.1",
111
- "hono": "^4.12.27",
112
- "proj4": "^2.20.9",
111
+ "@modelcontextprotocol/sdk": "^1.30.0",
112
+ "hono": "^4.13.7",
113
+ "proj4": "^2.22.0",
113
114
  "workers-mcp": "^0.0.13"
114
115
  }
115
116
  }