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.
- package/README.md +77 -5
- package/dist/api/actionsProxy.js +3 -0
- package/dist/api/cgvHandlers.js +15 -3
- package/dist/api/configStatus.js +2 -1
- package/dist/api/dtryxHandlers.js +113 -0
- package/dist/api/emart24Handlers.js +6 -2
- package/dist/api/gs25Handlers.js +22 -19
- package/dist/api/handlers.js +13 -5
- package/dist/api/healthCheckDefinitions.js +46 -16
- package/dist/api/healthCheckShape.js +24 -8
- package/dist/api/healthChecks.js +39 -20
- package/dist/api/operationalAuth.js +32 -0
- package/dist/api/routes/dtryxRoutes.js +22 -0
- package/dist/api/routes/healthRoutes.js +19 -11
- package/dist/api/routes/rateLimitStatsRoutes.js +274 -0
- package/dist/api/routes/registerServiceRoutes.js +37 -0
- package/dist/api/sevenelevenHandlers.js +7 -3
- package/dist/cli/commandOptions.js +24 -0
- package/dist/cli/commands/cinema.js +27 -0
- package/dist/cli.js +7 -1
- package/dist/cliHelp.js +3 -337
- package/dist/cliHelpDefinitions.js +369 -0
- package/dist/cliInteractive.js +8 -5
- package/dist/core/errors.js +29 -2
- package/dist/core/registry.js +13 -15
- package/dist/durableObjects/dailyRateLimiter.js +185 -0
- package/dist/durableObjects/rateLimitMetricsStore.js +144 -0
- package/dist/index.js +18 -31
- package/dist/middleware/dailyRateLimit.js +176 -0
- package/dist/pages/openapiFullSpec.js +2 -0
- package/dist/pages/openapiSpecActionParameters.js +429 -0
- package/dist/pages/openapiSpecActions.js +1 -391
- package/dist/pages/openapiSpecComponentsLottecinema.js +2 -2
- package/dist/pages/openapiSpecPathsDtryx.js +148 -0
- package/dist/pages/openapiSpecPathsLotteMart.js +10 -2
- package/dist/pages/promptRetailCinemaText.js +9 -1
- package/dist/services/cgv/errors.js +13 -0
- package/dist/services/cgv/transport.js +5 -22
- package/dist/services/cu/client.js +44 -30
- package/dist/services/cu/index.js +13 -3
- package/dist/services/cu/tools/checkInventory.js +65 -45
- package/dist/services/cu/tools/findNearbyStores.js +4 -3
- package/dist/services/cu/upstreamError.js +11 -0
- package/dist/services/dtryx/api.js +25 -0
- package/dist/services/dtryx/client.js +133 -0
- package/dist/services/dtryx/index.js +24 -0
- package/dist/services/dtryx/location.js +216 -0
- package/dist/services/dtryx/tools/getRemainingSeats.js +117 -0
- package/dist/services/dtryx/tools/listCinemas.js +46 -0
- package/dist/services/dtryx/tools/listNowShowing.js +77 -0
- package/dist/services/dtryx/types.js +4 -0
- package/dist/services/dtryx/validation.js +21 -0
- package/dist/services/feedback/tools/submitDeveloperRequest.js +15 -1
- package/dist/services/gs25/api.js +2 -2
- package/dist/services/gs25/client.js +16 -123
- package/dist/services/gs25/errors.js +12 -0
- package/dist/services/gs25/index.js +2 -2
- package/dist/services/gs25/productSearch.js +2 -14
- package/dist/services/gs25/storeStockTransport.js +30 -0
- package/dist/services/gs25/tools/checkInventory.js +7 -2
- package/dist/services/gs25/tools/findNearbyStores.js +20 -5
- package/dist/services/lottecinema/client.js +4 -2
- package/dist/services/lottemart/config.js +1 -1
- package/dist/services/lottemart/session.js +33 -201
- package/dist/services/lottemart/socketTransport.js +149 -0
- package/dist/services/oliveyoung/client.js +7 -39
- package/dist/services/oliveyoung/index.js +4 -4
- package/dist/services/oliveyoung/tools/checkInventory.js +6 -3
- package/dist/services/oliveyoung/tools/findNearbyStores.js +4 -3
- package/dist/services/oliveyoung/tools/searchProducts.js +4 -3
- package/dist/services/oliveyoung/transport.js +46 -0
- package/dist/services/seveneleven/client.js +20 -9
- package/dist/services/seveneleven/index.js +11 -7
- package/dist/services/seveneleven/inventory.js +5 -2
- package/dist/services/seveneleven/productKeyword.js +3 -2
- package/dist/services/seveneleven/readCache.js +49 -0
- package/dist/services/seveneleven/tools/checkInventory.js +4 -3
- package/dist/services/seveneleven/tools/getCatalogSnapshot.js +4 -3
- package/dist/services/seveneleven/tools/getSearchPopwords.js +4 -3
- package/dist/services/seveneleven/tools/searchProducts.js +4 -3
- package/dist/services/seveneleven/tools/searchStores.js +4 -3
- package/dist/utils/format.js +10 -3
- package/dist/utils/http.js +40 -12
- package/dist/utils/zyte.js +4 -101
- package/dist/utils/zyteJsonFallback.js +28 -0
- package/openapi.json +51 -3
- package/openapi.yaml +36 -3
- package/package.json +28 -27
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI 도움말 정의
|
|
3
|
+
*/
|
|
4
|
+
export const COMMAND_LIST = [
|
|
5
|
+
'help',
|
|
6
|
+
'version',
|
|
7
|
+
'url',
|
|
8
|
+
'health',
|
|
9
|
+
'claude',
|
|
10
|
+
'get',
|
|
11
|
+
'products',
|
|
12
|
+
'product',
|
|
13
|
+
'stores',
|
|
14
|
+
'inventory',
|
|
15
|
+
'display-location',
|
|
16
|
+
'compare',
|
|
17
|
+
'places',
|
|
18
|
+
'cu-stores',
|
|
19
|
+
'cu-inventory',
|
|
20
|
+
'cgv-theaters',
|
|
21
|
+
'cgv-movies',
|
|
22
|
+
'cgv-timetable',
|
|
23
|
+
'lottecinema-theaters',
|
|
24
|
+
'lottecinema-movies',
|
|
25
|
+
'lottecinema-seats',
|
|
26
|
+
'megabox-theaters',
|
|
27
|
+
'megabox-movies',
|
|
28
|
+
'megabox-seats',
|
|
29
|
+
'lottemart-stores',
|
|
30
|
+
'lottemart-products',
|
|
31
|
+
'emart24-stores',
|
|
32
|
+
'emart24-products',
|
|
33
|
+
'emart24-inventory',
|
|
34
|
+
'gs25-stores',
|
|
35
|
+
'gs25-products',
|
|
36
|
+
'gs25-inventory',
|
|
37
|
+
'seveneleven-products',
|
|
38
|
+
'seveneleven-stores',
|
|
39
|
+
'seveneleven-inventory',
|
|
40
|
+
'seveneleven-popwords',
|
|
41
|
+
'seveneleven-catalog',
|
|
42
|
+
];
|
|
43
|
+
export const COMMAND_SUMMARY = {
|
|
44
|
+
help: '도움말 출력',
|
|
45
|
+
version: 'CLI 버전 출력',
|
|
46
|
+
url: 'MCP 엔드포인트 URL 출력',
|
|
47
|
+
health: '원격 서버 상태 확인',
|
|
48
|
+
claude: 'Claude Code MCP 등록 명령 출력/실행',
|
|
49
|
+
get: '임의 API 경로 GET 호출',
|
|
50
|
+
products: '다이소 제품 검색',
|
|
51
|
+
product: '다이소 제품 상세 조회',
|
|
52
|
+
stores: '다이소 매장 검색',
|
|
53
|
+
inventory: '다이소 재고 조회',
|
|
54
|
+
'display-location': '다이소 진열 위치 조회',
|
|
55
|
+
compare: '키 없는 통합 상품 가격 후보 비교',
|
|
56
|
+
places: '음식점/카페 등 주변 장소 검색',
|
|
57
|
+
'cu-stores': 'CU 매장 검색',
|
|
58
|
+
'cu-inventory': 'CU 재고 조회',
|
|
59
|
+
'cgv-theaters': 'CGV 극장 검색',
|
|
60
|
+
'cgv-movies': 'CGV 영화 검색',
|
|
61
|
+
'cgv-timetable': 'CGV 시간표 조회',
|
|
62
|
+
'lottecinema-theaters': '롯데시네마 주변 지점 조회',
|
|
63
|
+
'lottecinema-movies': '롯데시네마 영화/회차 조회',
|
|
64
|
+
'lottecinema-seats': '롯데시네마 잔여 좌석 조회',
|
|
65
|
+
'megabox-theaters': '메가박스 주변 지점 조회',
|
|
66
|
+
'megabox-movies': '메가박스 영화/회차 조회',
|
|
67
|
+
'megabox-seats': '메가박스 잔여 좌석 조회',
|
|
68
|
+
'lottemart-stores': '롯데마트 매장 검색',
|
|
69
|
+
'lottemart-products': '롯데마트 상품 검색',
|
|
70
|
+
'emart24-stores': '이마트24 매장 검색',
|
|
71
|
+
'emart24-products': '이마트24 상품 검색',
|
|
72
|
+
'emart24-inventory': '이마트24 재고 조회',
|
|
73
|
+
'gs25-stores': 'GS25 매장 검색',
|
|
74
|
+
'gs25-products': 'GS25 상품 검색',
|
|
75
|
+
'gs25-inventory': 'GS25 재고 조회',
|
|
76
|
+
'seveneleven-products': '세븐일레븐 상품 검색',
|
|
77
|
+
'seveneleven-stores': '세븐일레븐 매장 검색',
|
|
78
|
+
'seveneleven-inventory': '세븐일레븐 재고 조회',
|
|
79
|
+
'seveneleven-popwords': '세븐일레븐 인기 검색어 조회',
|
|
80
|
+
'seveneleven-catalog': '세븐일레븐 카탈로그 스냅샷 조회',
|
|
81
|
+
};
|
|
82
|
+
export const COMMAND_DETAIL = {
|
|
83
|
+
help: [
|
|
84
|
+
'명령: help',
|
|
85
|
+
'설명: 전체 도움말 또는 특정 명령 상세 도움말을 출력합니다.',
|
|
86
|
+
'사용법: daiso help [command]',
|
|
87
|
+
'예시: daiso help products',
|
|
88
|
+
],
|
|
89
|
+
version: ['명령: version', '설명: 설치된 daiso CLI 버전을 출력합니다.', '사용법: daiso version'],
|
|
90
|
+
url: [
|
|
91
|
+
'명령: url',
|
|
92
|
+
'설명: MCP 엔드포인트 URL을 출력합니다.',
|
|
93
|
+
'사용법: daiso url',
|
|
94
|
+
'출력 예시: https://mcp.aka.page/mcp',
|
|
95
|
+
],
|
|
96
|
+
health: [
|
|
97
|
+
'명령: health',
|
|
98
|
+
'설명: 서버 /health API를 호출해 상태를 확인합니다.',
|
|
99
|
+
'사용법: daiso health',
|
|
100
|
+
'출력: status, endpoint, checkedAt(JSON)',
|
|
101
|
+
],
|
|
102
|
+
claude: [
|
|
103
|
+
'명령: claude',
|
|
104
|
+
'설명: Claude Code MCP 등록 명령을 출력하거나 실행합니다.',
|
|
105
|
+
'사용법: daiso claude [--exec]',
|
|
106
|
+
'옵션: --exec 실제 claude 명령 실행',
|
|
107
|
+
'예시: daiso claude --exec',
|
|
108
|
+
],
|
|
109
|
+
get: [
|
|
110
|
+
'명령: get',
|
|
111
|
+
'설명: 임의 API 경로를 GET으로 호출합니다.',
|
|
112
|
+
'사용법: daiso get <path|url> [--queryKey value ...] [--json]',
|
|
113
|
+
'필수: <path|url>',
|
|
114
|
+
'옵션: --json 원본 JSON 출력',
|
|
115
|
+
'예시: daiso get /api/cgv/movies --playDate 20260307 --theaterCode 0056',
|
|
116
|
+
],
|
|
117
|
+
products: [
|
|
118
|
+
'명령: products',
|
|
119
|
+
'설명: 다이소 제품 검색 API를 호출합니다.',
|
|
120
|
+
'사용법: daiso products <query> [--page N] [--pageSize N] [--json]',
|
|
121
|
+
'필수: <query>',
|
|
122
|
+
'옵션: --page, --pageSize, --json',
|
|
123
|
+
'예시: daiso products 수납박스 --page 1 --pageSize 30',
|
|
124
|
+
],
|
|
125
|
+
product: [
|
|
126
|
+
'명령: product',
|
|
127
|
+
'설명: 다이소 제품 상세 API를 호출합니다.',
|
|
128
|
+
'사용법: daiso product <productId> [--json]',
|
|
129
|
+
'필수: <productId>',
|
|
130
|
+
'옵션: --json',
|
|
131
|
+
'예시: daiso product 1034604',
|
|
132
|
+
],
|
|
133
|
+
stores: [
|
|
134
|
+
'명령: stores',
|
|
135
|
+
'설명: 다이소 매장 검색 API를 호출합니다.',
|
|
136
|
+
'사용법: daiso stores [keyword] [--sido 값] [--gugun 값] [--dong 값] [--limit N] [--json]',
|
|
137
|
+
'필수: keyword 또는 --sido',
|
|
138
|
+
'옵션: --keyword, --sido, --gugun, --dong, --limit, --json',
|
|
139
|
+
'예시: daiso stores 강남역',
|
|
140
|
+
'예시: daiso stores --sido 서울 --gugun 강남구',
|
|
141
|
+
],
|
|
142
|
+
inventory: [
|
|
143
|
+
'명령: inventory',
|
|
144
|
+
'설명: 다이소 재고 API를 호출합니다.',
|
|
145
|
+
'사용법: daiso inventory <productId> [--keyword 값] [--lat 값] [--lng 값] [--page N] [--pageSize N] [--json]',
|
|
146
|
+
'필수: <productId>',
|
|
147
|
+
'옵션: --keyword, --lat, --lng, --page, --pageSize, --json',
|
|
148
|
+
'예시: daiso inventory 1034604 --keyword 강남역',
|
|
149
|
+
],
|
|
150
|
+
'display-location': [
|
|
151
|
+
'명령: display-location',
|
|
152
|
+
'설명: 다이소 매장 내 상품 진열 위치 API를 호출합니다.',
|
|
153
|
+
'사용법: daiso display-location <productId> <storeCode> [--json]',
|
|
154
|
+
'필수: <productId>, <storeCode>',
|
|
155
|
+
'옵션: --json',
|
|
156
|
+
'예시: daiso display-location 1034604 04515',
|
|
157
|
+
],
|
|
158
|
+
compare: [
|
|
159
|
+
'명령: compare',
|
|
160
|
+
'설명: 새 외부 키 없이 다이소, GS25, 세븐일레븐, 이마트24 상품 검색을 묶어 가격 후보를 비교합니다.',
|
|
161
|
+
'사용법: daiso compare <keyword> [--services daiso,gs25,seveneleven,emart24] [--limit N] [--json]',
|
|
162
|
+
'필수: <keyword>',
|
|
163
|
+
'옵션: --services, --limit, --json',
|
|
164
|
+
'예시: daiso compare 콜라 --limit 3',
|
|
165
|
+
'예시: daiso compare 컵라면 --services seveneleven,emart24 --json',
|
|
166
|
+
],
|
|
167
|
+
places: [
|
|
168
|
+
'명령: places',
|
|
169
|
+
'설명: 네이버 지역 검색으로 음식점, 카페, 디저트 가게 등 주변 장소를 검색합니다.',
|
|
170
|
+
'사용법: daiso places <location> [--category cafe|restaurant|food|dessert|all] [--keyword 검색어] [--limit N] [--json]',
|
|
171
|
+
'필수: <location> 또는 --keyword',
|
|
172
|
+
'옵션: --category, --keyword, --limit, --start, --sort, --json',
|
|
173
|
+
'예시: daiso places 강남역 --category cafe --limit 5',
|
|
174
|
+
'예시: daiso places 성수동 --keyword 브런치 --limit 5',
|
|
175
|
+
],
|
|
176
|
+
'cu-stores': [
|
|
177
|
+
'명령: cu-stores',
|
|
178
|
+
'설명: CU 매장 검색 API를 호출합니다.',
|
|
179
|
+
'사용법: daiso cu-stores [keyword] [--lat 값] [--lng 값] [--limit N] [--json]',
|
|
180
|
+
'옵션: --keyword, --lat, --lng, --limit, --json',
|
|
181
|
+
'예시: daiso cu-stores 강남',
|
|
182
|
+
'예시: daiso cu-stores --lat 37.498 --lng 127.027 --limit 10',
|
|
183
|
+
],
|
|
184
|
+
'cu-inventory': [
|
|
185
|
+
'명령: cu-inventory',
|
|
186
|
+
'설명: CU 재고 검색 API를 호출합니다.',
|
|
187
|
+
'사용법: daiso cu-inventory <keyword> [--storeKeyword 값] [--lat 값] [--lng 값] [--size N] [--offset N] [--json]',
|
|
188
|
+
'필수: <keyword>',
|
|
189
|
+
'옵션: --storeKeyword, --lat, --lng, --size, --offset, --searchSort, --storeLimit, --json',
|
|
190
|
+
'예시: daiso cu-inventory 과자',
|
|
191
|
+
'예시: daiso cu-inventory 컵라면 --storeKeyword 강남 --size 10',
|
|
192
|
+
],
|
|
193
|
+
'cgv-theaters': [
|
|
194
|
+
'명령: cgv-theaters',
|
|
195
|
+
'설명: CGV 극장 검색 API를 호출합니다.',
|
|
196
|
+
'사용법: daiso cgv-theaters [keyword] [--regionCode 값] [--playDate YYYYMMDD] [--lat 값] [--lng 값] [--limit N] [--json]',
|
|
197
|
+
'옵션: --keyword, --regionCode, --playDate, --lat, --lng, --limit, --json',
|
|
198
|
+
'예시: daiso cgv-theaters 강남 --limit 5',
|
|
199
|
+
'예시: daiso cgv-theaters --regionCode 01 --playDate 20260304',
|
|
200
|
+
],
|
|
201
|
+
'cgv-movies': [
|
|
202
|
+
'명령: cgv-movies',
|
|
203
|
+
'설명: CGV 영화 검색 API를 호출합니다.',
|
|
204
|
+
'사용법: daiso cgv-movies [keyword] [--playDate YYYYMMDD] [--theaterCode 값] [--movieCode 값] [--lat 값] [--lng 값] [--json]',
|
|
205
|
+
'옵션: --keyword, --playDate, --theaterCode, --movieCode, --lat, --lng, --json',
|
|
206
|
+
'예시: daiso cgv-movies 강남 --playDate 20260304',
|
|
207
|
+
'예시: daiso cgv-movies --playDate 20260304 --theaterCode 0056',
|
|
208
|
+
],
|
|
209
|
+
'cgv-timetable': [
|
|
210
|
+
'명령: cgv-timetable',
|
|
211
|
+
'설명: CGV 시간표 API를 호출합니다.',
|
|
212
|
+
'사용법: daiso cgv-timetable [keyword] [--playDate YYYYMMDD] [--theaterCode 값] [--movieCode 값] [--lat 값] [--lng 값] [--json]',
|
|
213
|
+
'옵션: --keyword, --playDate, --theaterCode, --movieCode, --lat, --lng, --json',
|
|
214
|
+
'예시: daiso cgv-timetable 강남 --playDate 20260304',
|
|
215
|
+
'예시: daiso cgv-timetable --playDate 20260304 --theaterCode 0056',
|
|
216
|
+
],
|
|
217
|
+
'lottecinema-theaters': [
|
|
218
|
+
'명령: lottecinema-theaters',
|
|
219
|
+
'설명: 롯데시네마 주변 지점 API를 호출합니다.',
|
|
220
|
+
'사용법: daiso lottecinema-theaters [keyword] [--lat 값] [--lng 값] [--playDate YYYYMMDD] [--limit N] [--json]',
|
|
221
|
+
'옵션: --keyword, --lat, --lng, --playDate, --limit, --json',
|
|
222
|
+
'예시: daiso lottecinema-theaters 잠실 --limit 5',
|
|
223
|
+
'예시: daiso lottecinema-theaters --keyword "안산 중앙역" --limit 5',
|
|
224
|
+
],
|
|
225
|
+
'lottecinema-movies': [
|
|
226
|
+
'명령: lottecinema-movies',
|
|
227
|
+
'설명: 롯데시네마 영화/회차 API를 호출합니다.',
|
|
228
|
+
'사용법: daiso lottecinema-movies [keyword] [--playDate YYYYMMDD] [--theaterId 값] [--movieId 값] [--lat 값] [--lng 값] [--json]',
|
|
229
|
+
'옵션: --playDate, --theaterId, --movieId, --keyword, --lat, --lng, --json',
|
|
230
|
+
'예시: daiso lottecinema-movies 잠실 --playDate 20260310',
|
|
231
|
+
'예시: daiso lottecinema-movies --playDate 20260310 --keyword "안산 중앙역"',
|
|
232
|
+
],
|
|
233
|
+
'lottecinema-seats': [
|
|
234
|
+
'명령: lottecinema-seats',
|
|
235
|
+
'설명: 롯데시네마 잔여 좌석 API를 호출합니다.',
|
|
236
|
+
'사용법: daiso lottecinema-seats [keyword] [--playDate YYYYMMDD] [--theaterId 값] [--movieId 값] [--lat 값] [--lng 값] [--limit N] [--json]',
|
|
237
|
+
'옵션: --playDate, --theaterId, --movieId, --keyword, --lat, --lng, --limit, --json',
|
|
238
|
+
'예시: daiso lottecinema-seats 잠실 --playDate 20260310 --movieId 23816',
|
|
239
|
+
'예시: daiso lottecinema-seats --playDate 20260310 --keyword "안산 중앙역" --movieId 23816',
|
|
240
|
+
],
|
|
241
|
+
'megabox-theaters': [
|
|
242
|
+
'명령: megabox-theaters',
|
|
243
|
+
'설명: 메가박스 주변 지점 API를 호출합니다.',
|
|
244
|
+
'사용법: daiso megabox-theaters [keyword] [--lat 값] [--lng 값] [--playDate YYYYMMDD] [--areaCode 값] [--limit N] [--json]',
|
|
245
|
+
'옵션: --keyword, --lat, --lng, --playDate, --areaCode, --limit, --json',
|
|
246
|
+
'예시: daiso megabox-theaters 강남 --limit 5',
|
|
247
|
+
'예시: daiso megabox-theaters --keyword "코엑스" --limit 5',
|
|
248
|
+
],
|
|
249
|
+
'megabox-movies': [
|
|
250
|
+
'명령: megabox-movies',
|
|
251
|
+
'설명: 메가박스 영화/회차 API를 호출합니다.',
|
|
252
|
+
'사용법: daiso megabox-movies [keyword] [--playDate YYYYMMDD] [--theaterId 값] [--movieId 값] [--areaCode 값] [--lat 값] [--lng 값] [--json]',
|
|
253
|
+
'옵션: --playDate, --theaterId, --movieId, --keyword, --areaCode, --lat, --lng, --json',
|
|
254
|
+
'예시: daiso megabox-movies 강남 --playDate 20260310',
|
|
255
|
+
'예시: daiso megabox-movies --playDate 20260310 --keyword "코엑스"',
|
|
256
|
+
],
|
|
257
|
+
'megabox-seats': [
|
|
258
|
+
'명령: megabox-seats',
|
|
259
|
+
'설명: 메가박스 잔여 좌석 API를 호출합니다.',
|
|
260
|
+
'사용법: daiso megabox-seats [keyword] [--playDate YYYYMMDD] [--theaterId 값] [--movieId 값] [--areaCode 값] [--lat 값] [--lng 값] [--limit N] [--json]',
|
|
261
|
+
'옵션: --playDate, --theaterId, --movieId, --keyword, --areaCode, --lat, --lng, --limit, --json',
|
|
262
|
+
'예시: daiso megabox-seats 강남 --playDate 20260310 --movieId 23816',
|
|
263
|
+
'예시: daiso megabox-seats --playDate 20260310 --keyword "코엑스" --movieId 23816',
|
|
264
|
+
],
|
|
265
|
+
'lottemart-stores': [
|
|
266
|
+
'명령: lottemart-stores',
|
|
267
|
+
'설명: 롯데마트 계열 매장 검색 API를 호출합니다.',
|
|
268
|
+
'사용법: daiso lottemart-stores [keyword] [--area 값] [--brandVariant 값] [--lat 값] [--lng 값] [--limit N] [--json]',
|
|
269
|
+
'옵션: --keyword, --area, --brandVariant, --lat, --lng, --limit, --json',
|
|
270
|
+
'예시: daiso lottemart-stores 잠실 --area 서울',
|
|
271
|
+
'예시: daiso lottemart-stores --area 경기 --brandVariant lottemart --limit 10',
|
|
272
|
+
],
|
|
273
|
+
'lottemart-products': [
|
|
274
|
+
'명령: lottemart-products',
|
|
275
|
+
'설명: 롯데마트 매장 기준 상품 검색 API를 호출합니다.',
|
|
276
|
+
'사용법: daiso lottemart-products <keyword> [--storeCode 값 | --storeName 값] [--area 값] [--pageLimit N] [--json]',
|
|
277
|
+
'필수: <keyword>, --storeCode 또는 --storeName',
|
|
278
|
+
'옵션: --storeCode, --storeName, --area, --pageLimit, --json',
|
|
279
|
+
'예시: daiso lottemart-products 콜라 --storeName 강변점 --area 서울',
|
|
280
|
+
'예시: daiso lottemart-products 우유 --storeCode 2301 --pageLimit 2',
|
|
281
|
+
],
|
|
282
|
+
'emart24-stores': [
|
|
283
|
+
'명령: emart24-stores',
|
|
284
|
+
'설명: 이마트24 매장 검색 API를 호출합니다.',
|
|
285
|
+
'사용법: daiso emart24-stores [keyword] [--area1 값] [--area2 값] [--lat 값] [--lng 값] [--service24h true|false] [--limit N] [--json]',
|
|
286
|
+
'옵션: --keyword, --area1, --area2, --lat, --lng, --service24h, --limit, --json',
|
|
287
|
+
'예시: daiso emart24-stores 강남',
|
|
288
|
+
'예시: daiso emart24-stores --area1 서울특별시 --area2 강남구 --service24h true',
|
|
289
|
+
],
|
|
290
|
+
'emart24-products': [
|
|
291
|
+
'명령: emart24-products',
|
|
292
|
+
'설명: 이마트24 상품 검색 API를 호출합니다.',
|
|
293
|
+
'사용법: daiso emart24-products <keyword> [--page N] [--pageSize N] [--sortType 값] [--saleProductYn Y|N] [--json]',
|
|
294
|
+
'필수: <keyword>',
|
|
295
|
+
'옵션: --page, --pageSize, --sortType, --saleProductYn, --json',
|
|
296
|
+
'예시: daiso emart24-products 두바이',
|
|
297
|
+
'예시: daiso emart24-products 도시락 --page 2 --pageSize 20',
|
|
298
|
+
],
|
|
299
|
+
'emart24-inventory': [
|
|
300
|
+
'명령: emart24-inventory',
|
|
301
|
+
'설명: 이마트24 매장별 재고 API를 호출합니다.',
|
|
302
|
+
'사용법: daiso emart24-inventory <pluCd> --bizNoArr 코드1,코드2 [--json]',
|
|
303
|
+
'필수: <pluCd>, --bizNoArr',
|
|
304
|
+
'옵션: --bizNoArr, --json',
|
|
305
|
+
'예시: daiso emart24-inventory 8800244010504 --bizNoArr 28339,05015,23233',
|
|
306
|
+
],
|
|
307
|
+
'gs25-stores': [
|
|
308
|
+
'명령: gs25-stores',
|
|
309
|
+
'설명: GS25 매장 검색 API를 호출합니다.',
|
|
310
|
+
'사용법: daiso gs25-stores [keyword] [--lat 값] [--lng 값] [--limit N] [--json]',
|
|
311
|
+
'옵션: --keyword, --lat, --lng, --serviceCode, --limit, --json',
|
|
312
|
+
'예시: daiso gs25-stores 강남',
|
|
313
|
+
'예시: daiso gs25-stores --lat 37.4982 --lng 127.0276 --limit 10',
|
|
314
|
+
],
|
|
315
|
+
'gs25-products': [
|
|
316
|
+
'명령: gs25-products',
|
|
317
|
+
'설명: GS25 상품 키워드 검색 API를 호출합니다.',
|
|
318
|
+
'사용법: daiso gs25-products <keyword> [--limit N] [--json]',
|
|
319
|
+
'필수: <keyword>',
|
|
320
|
+
'옵션: --serviceCode, --limit, --json',
|
|
321
|
+
'예시: daiso gs25-products 오감자',
|
|
322
|
+
],
|
|
323
|
+
'gs25-inventory': [
|
|
324
|
+
'명령: gs25-inventory',
|
|
325
|
+
'설명: GS25 재고 검색 API를 호출합니다.',
|
|
326
|
+
'사용법: daiso gs25-inventory <keyword> [--storeKeyword 값] [--lat 값] [--lng 값] [--storeLimit N] [--json]',
|
|
327
|
+
'필수: <keyword>',
|
|
328
|
+
'옵션: --storeKeyword, --lat, --lng, --serviceCode, --storeLimit, --json',
|
|
329
|
+
'예시: daiso gs25-inventory 오감자 --storeKeyword 강남',
|
|
330
|
+
],
|
|
331
|
+
'seveneleven-products': [
|
|
332
|
+
'명령: seveneleven-products',
|
|
333
|
+
'설명: 세븐일레븐 상품 검색 API를 호출합니다.',
|
|
334
|
+
'사용법: daiso seveneleven-products <query> [--page N] [--size N] [--sort 값] [--json]',
|
|
335
|
+
'필수: <query>',
|
|
336
|
+
'옵션: --page, --size, --sort, --json',
|
|
337
|
+
'예시: daiso seveneleven-products 삼각김밥 --size 20',
|
|
338
|
+
],
|
|
339
|
+
'seveneleven-stores': [
|
|
340
|
+
'명령: seveneleven-stores',
|
|
341
|
+
'설명: 세븐일레븐 매장 검색 API를 호출합니다.',
|
|
342
|
+
'사용법: daiso seveneleven-stores <keyword> [--limit N] [--json]',
|
|
343
|
+
'필수: <keyword>',
|
|
344
|
+
'옵션: --limit, --json',
|
|
345
|
+
'예시: daiso seveneleven-stores 안산 중앙역 --limit 10',
|
|
346
|
+
],
|
|
347
|
+
'seveneleven-inventory': [
|
|
348
|
+
'명령: seveneleven-inventory',
|
|
349
|
+
'설명: 세븐일레븐 재고 API를 호출합니다.',
|
|
350
|
+
'사용법: daiso seveneleven-inventory <keyword> [--storeKeyword 값] [--storeLimit N] [--page N] [--size N] [--json]',
|
|
351
|
+
'필수: <keyword>',
|
|
352
|
+
'옵션: --keyword, --storeKeyword, --storeLimit, --page, --size, --json',
|
|
353
|
+
'예시: daiso seveneleven-inventory 핫식스 --storeKeyword "안산 중앙역" --storeLimit 10',
|
|
354
|
+
],
|
|
355
|
+
'seveneleven-popwords': [
|
|
356
|
+
'명령: seveneleven-popwords',
|
|
357
|
+
'설명: 세븐일레븐 인기 검색어 API를 호출합니다.',
|
|
358
|
+
'사용법: daiso seveneleven-popwords [--label 값] [--json]',
|
|
359
|
+
'옵션: --label, --json',
|
|
360
|
+
'예시: daiso seveneleven-popwords --label home',
|
|
361
|
+
],
|
|
362
|
+
'seveneleven-catalog': [
|
|
363
|
+
'명령: seveneleven-catalog',
|
|
364
|
+
'설명: 세븐일레븐 카탈로그 스냅샷 API를 호출합니다.',
|
|
365
|
+
'사용법: daiso seveneleven-catalog [--includeIssues true|false] [--includeExhibition true|false] [--limit N] [--json]',
|
|
366
|
+
'옵션: --includeIssues, --includeExhibition, --limit, --json',
|
|
367
|
+
'예시: daiso seveneleven-catalog --includeIssues true --includeExhibition true --limit 10',
|
|
368
|
+
],
|
|
369
|
+
};
|
package/dist/cliInteractive.js
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
* 좌표 입력 없이 서비스/매장/상품을 순차 선택해 재고를 확인합니다.
|
|
5
5
|
*/
|
|
6
6
|
import { createInterface } from 'node:readline/promises';
|
|
7
|
-
import
|
|
7
|
+
import process from 'node:process';
|
|
8
8
|
import { pickFromList } from './cliPicker.js';
|
|
9
9
|
import { fetchEnvelope, fetchStoresWithKeywordFallback } from './cli/interactiveFetch.js';
|
|
10
|
-
import { askMenu, askNextAction, askNonEmpty, askYesNo, printStoreDetail } from './cli/interactivePrompt.js';
|
|
10
|
+
import { askMenu, askNextAction, askNonEmpty, askYesNo, printStoreDetail, } from './cli/interactivePrompt.js';
|
|
11
11
|
import { parseLotteCinemaTheaters, printTheaterDetail, runCuItemSearch, runDaisoItemSearch, runLotteCinemaSearch, runOliveyoungItemSearch, } from './cli/interactiveItemSearch.js';
|
|
12
|
-
import { buildDaisoStoreKeywordVariants, isRecord, parseDaisoProducts, parseStores, toText } from './utils/cliInteractiveHelpers.js';
|
|
12
|
+
import { buildDaisoStoreKeywordVariants, isRecord, parseDaisoProducts, parseStores, toText, } from './utils/cliInteractiveHelpers.js';
|
|
13
13
|
function isLocationToken(token) {
|
|
14
14
|
return /(?:역|점|동|구|시|군|읍|면|로|길)$/.test(token);
|
|
15
15
|
}
|
|
@@ -22,7 +22,10 @@ export function inferDaisoFreeTextIntent(input) {
|
|
|
22
22
|
const locationIndex = tokens.findIndex(isLocationToken);
|
|
23
23
|
if (locationIndex >= 0) {
|
|
24
24
|
const storeKeyword = tokens[locationIndex];
|
|
25
|
-
const productQuery = tokens
|
|
25
|
+
const productQuery = tokens
|
|
26
|
+
.filter((_, index) => index !== locationIndex)
|
|
27
|
+
.join(' ')
|
|
28
|
+
.trim() || input.trim();
|
|
26
29
|
return { productQuery, storeKeyword };
|
|
27
30
|
}
|
|
28
31
|
const storeKeyword = tokens[tokens.length - 1];
|
|
@@ -47,7 +50,7 @@ async function askServiceChoice(prompt, writeOut) {
|
|
|
47
50
|
}
|
|
48
51
|
}
|
|
49
52
|
function createPrompt() {
|
|
50
|
-
const rl = createInterface({ input, output });
|
|
53
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
51
54
|
return {
|
|
52
55
|
ask: async (question) => {
|
|
53
56
|
const answer = await rl.question(question);
|
package/dist/core/errors.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MCP/API 공통 에러 진단 구조
|
|
3
3
|
*/
|
|
4
|
+
export const ZYTE_COST_POLICY_MESSAGE = 'Zyte 유료 호출은 비용 정책에 따라 비활성화되어 있습니다.';
|
|
4
5
|
const SERVICE_PREFIXES = [
|
|
5
6
|
'daiso',
|
|
6
7
|
'gs25',
|
|
@@ -11,6 +12,7 @@ const SERVICE_PREFIXES = [
|
|
|
11
12
|
'megabox',
|
|
12
13
|
'lottecinema',
|
|
13
14
|
'cgv',
|
|
15
|
+
'dtryx',
|
|
14
16
|
'oliveyoung',
|
|
15
17
|
];
|
|
16
18
|
function normalizeService(value) {
|
|
@@ -49,7 +51,24 @@ function buildHint(retryable) {
|
|
|
49
51
|
}
|
|
50
52
|
export function toStandardErrorDiagnostics(code, message, options = {}) {
|
|
51
53
|
const inferred = inferServiceAndOperation(code);
|
|
52
|
-
const
|
|
54
|
+
const costPolicyError = message.includes(ZYTE_COST_POLICY_MESSAGE);
|
|
55
|
+
// 실제 Zyte 진단 문구만 설정 오류로 취급해 일반적인 접근 차단과 구분합니다.
|
|
56
|
+
const configurationError = [
|
|
57
|
+
'Zyte API 호출 실패: 403 Your account has been suspended.',
|
|
58
|
+
'Zyte API 호출 실패: 403 account suspended',
|
|
59
|
+
'ZYTE_API_KEY가 설정되지 않았습니다.',
|
|
60
|
+
].some((diagnostic) => message.includes(diagnostic));
|
|
61
|
+
const gs25AuthenticationError = message.includes('GS25 재고 서비스 인증을 사용할 수 없습니다.');
|
|
62
|
+
const oliveyoungRelayConfigurationError = [
|
|
63
|
+
'올리브영 릴레이 URL은 HTTPS 또는 로컬 HTTP 주소여야 합니다.',
|
|
64
|
+
'OY_RELAY_TOKEN이 필요합니다.',
|
|
65
|
+
'올리브영 직접 요청 실패. 운영자는 OY_RELAY_URL과 OY_RELAY_TOKEN으로 브라우저 릴레이를 설정해주세요.',
|
|
66
|
+
].includes(message);
|
|
67
|
+
const retryable = !oliveyoungRelayConfigurationError &&
|
|
68
|
+
!costPolicyError &&
|
|
69
|
+
!configurationError &&
|
|
70
|
+
!gs25AuthenticationError &&
|
|
71
|
+
isRetryable(code, options.status || options.upstreamStatus);
|
|
53
72
|
return {
|
|
54
73
|
code,
|
|
55
74
|
message,
|
|
@@ -58,7 +77,15 @@ export function toStandardErrorDiagnostics(code, message, options = {}) {
|
|
|
58
77
|
service: options.service || inferred.service,
|
|
59
78
|
operation: options.operation || inferred.operation,
|
|
60
79
|
upstreamStatus: options.upstreamStatus,
|
|
61
|
-
hint:
|
|
80
|
+
hint: oliveyoungRelayConfigurationError
|
|
81
|
+
? '운영자는 OY_RELAY_URL과 OY_RELAY_TOKEN 및 브라우저 릴레이 실행 상태를 확인하세요.'
|
|
82
|
+
: costPolicyError
|
|
83
|
+
? ZYTE_COST_POLICY_MESSAGE
|
|
84
|
+
: gs25AuthenticationError
|
|
85
|
+
? '운영자는 GS25_API_KEY 설정을 확인하세요.'
|
|
86
|
+
: configurationError
|
|
87
|
+
? '운영자는 ZYTE_API_KEY 설정과 Zyte 계정 상태를 확인하세요.'
|
|
88
|
+
: buildHint(retryable),
|
|
62
89
|
};
|
|
63
90
|
}
|
|
64
91
|
export function getErrorMessage(error) {
|
package/dist/core/registry.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 서비스 프로바이더를 등록하고 MCP 서버에 도구를 연결합니다.
|
|
5
5
|
*/
|
|
6
|
-
import { getErrorMessage
|
|
6
|
+
import { getErrorMessage } from './errors.js';
|
|
7
7
|
import { createToolOutputSchema } from './outputSchema.js';
|
|
8
8
|
function parseJsonText(text) {
|
|
9
9
|
try {
|
|
@@ -181,24 +181,22 @@ export class ServiceRegistry {
|
|
|
181
181
|
return {
|
|
182
182
|
isError: true,
|
|
183
183
|
content: [{ type: 'text', text: message }],
|
|
184
|
-
structuredContent: {
|
|
185
|
-
error: toStandardErrorDiagnostics('TOOL_EXECUTION_FAILED', message, {
|
|
186
|
-
operation: tool.name,
|
|
187
|
-
}),
|
|
188
|
-
},
|
|
189
184
|
};
|
|
190
185
|
}
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
})),
|
|
196
|
-
structuredContent: buildStructuredContent(result),
|
|
197
|
-
};
|
|
186
|
+
const content = result.content.map((item) => ({
|
|
187
|
+
type: item.type,
|
|
188
|
+
text: item.text,
|
|
189
|
+
}));
|
|
198
190
|
if (result.isError) {
|
|
199
|
-
|
|
191
|
+
return {
|
|
192
|
+
isError: true,
|
|
193
|
+
content,
|
|
194
|
+
};
|
|
200
195
|
}
|
|
201
|
-
return
|
|
196
|
+
return {
|
|
197
|
+
content,
|
|
198
|
+
structuredContent: buildStructuredContent(result),
|
|
199
|
+
};
|
|
202
200
|
});
|
|
203
201
|
}
|
|
204
202
|
/**
|