daiso 1.0.4 → 1.0.6

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 (166) hide show
  1. package/README.md +249 -533
  2. package/dist/api/actionsProxy.js +82 -0
  3. package/dist/api/cgvHandlers.js +103 -16
  4. package/dist/api/configStatus.js +19 -0
  5. package/dist/api/daisoHandlers.js +127 -0
  6. package/dist/api/emart24Handlers.js +176 -0
  7. package/dist/api/gs25Handlers.js +267 -0
  8. package/dist/api/handlers.js +209 -104
  9. package/dist/api/healthChecks.js +504 -0
  10. package/dist/api/lottecinemaHandlers.js +155 -0
  11. package/dist/api/lottemartHandlers.js +144 -0
  12. package/dist/api/megaboxHandlers.js +81 -50
  13. package/dist/api/response.js +2 -0
  14. package/dist/api/routes/cuRoutes.js +17 -0
  15. package/dist/api/routes/daisoRoutes.js +6 -1
  16. package/dist/api/routes/emart24Routes.js +22 -0
  17. package/dist/api/routes/gs25Routes.js +22 -0
  18. package/dist/api/routes/healthRoutes.js +61 -0
  19. package/dist/api/routes/lottecinemaRoutes.js +22 -0
  20. package/dist/api/routes/lottemartRoutes.js +18 -0
  21. package/dist/api/routes/oliveyoungRoutes.js +6 -1
  22. package/dist/api/routes/sevenelevenRoutes.js +32 -0
  23. package/dist/api/sevenelevenHandlers.js +200 -0
  24. package/dist/bin.js +0 -0
  25. package/dist/cli/args.js +75 -0
  26. package/dist/cli/commandOptions.js +38 -0
  27. package/dist/cli/commands/convenience.js +293 -0
  28. package/dist/cli/commands/daiso.js +112 -0
  29. package/dist/cli/constants.js +5 -0
  30. package/dist/cli/deps.js +48 -0
  31. package/dist/cli/http.js +156 -0
  32. package/dist/cli/interactiveFetch.js +31 -0
  33. package/dist/cli/interactiveItemSearch.js +261 -0
  34. package/dist/cli/interactivePrompt.js +50 -0
  35. package/dist/cli/interactiveTypes.js +4 -0
  36. package/dist/cli/types.js +4 -0
  37. package/dist/cli.js +87 -196
  38. package/dist/cliHelp.js +212 -1
  39. package/dist/cliInteractive.js +243 -0
  40. package/dist/cliPicker.js +57 -0
  41. package/dist/cliRenderer.js +90 -3
  42. package/dist/core/errors.js +66 -0
  43. package/dist/core/registry.js +227 -3
  44. package/dist/index.js +149 -9
  45. package/dist/pages/openapi.js +2 -1
  46. package/dist/pages/openapiFullSpec.js +58 -0
  47. package/dist/pages/openapiResponse.js +28 -0
  48. package/dist/pages/openapiSpec.js +2 -41
  49. package/dist/pages/openapiSpecActions.js +109 -0
  50. package/dist/pages/openapiSpecComponents.js +30 -391
  51. package/dist/pages/openapiSpecComponentsCgv.js +24 -0
  52. package/dist/pages/openapiSpecComponentsCu.js +112 -0
  53. package/dist/pages/openapiSpecComponentsDaisoOliveyoung.js +342 -0
  54. package/dist/pages/openapiSpecComponentsEmart24.js +141 -0
  55. package/dist/pages/openapiSpecComponentsGs25.js +109 -0
  56. package/dist/pages/openapiSpecComponentsLotteMart.js +85 -0
  57. package/dist/pages/openapiSpecComponentsLottecinema.js +163 -0
  58. package/dist/pages/openapiSpecComponentsMegabox.js +144 -0
  59. package/dist/pages/openapiSpecComponentsSeveneleven.js +82 -0
  60. package/dist/pages/openapiSpecPathsCgv.js +66 -3
  61. package/dist/pages/openapiSpecPathsCu.js +145 -0
  62. package/dist/pages/openapiSpecPathsDaiso.js +302 -0
  63. package/dist/pages/openapiSpecPathsDaisoOliveyoung.js +4 -376
  64. package/dist/pages/openapiSpecPathsEmart24.js +223 -0
  65. package/dist/pages/openapiSpecPathsGs25.js +166 -0
  66. package/dist/pages/openapiSpecPathsLotteMart.js +149 -0
  67. package/dist/pages/openapiSpecPathsLottecinema.js +212 -0
  68. package/dist/pages/openapiSpecPathsMegabox.js +52 -3
  69. package/dist/pages/openapiSpecPathsOliveyoung.js +266 -0
  70. package/dist/pages/openapiSpecPathsSeveneleven.js +234 -0
  71. package/dist/pages/prompt.js +8 -402
  72. package/dist/pages/promptCoreText.js +278 -0
  73. package/dist/pages/promptReferenceText.js +137 -0
  74. package/dist/pages/promptRetailCinemaText.js +274 -0
  75. package/dist/services/cgv/client.js +6 -1
  76. package/dist/services/cgv/index.js +3 -3
  77. package/dist/services/cgv/location.js +235 -0
  78. package/dist/services/cgv/tools/findTheaters.js +30 -5
  79. package/dist/services/cgv/tools/getTimetable.js +42 -14
  80. package/dist/services/cgv/tools/searchMovies.js +40 -12
  81. package/dist/services/cgv/transport.js +0 -3
  82. package/dist/services/cu/api.js +11 -0
  83. package/dist/services/cu/client.js +297 -0
  84. package/dist/services/cu/index.js +21 -0
  85. package/dist/services/cu/tools/checkInventory.js +123 -0
  86. package/dist/services/cu/tools/findNearbyStores.js +49 -0
  87. package/dist/services/cu/types.js +4 -0
  88. package/dist/services/daiso/api.js +22 -2
  89. package/dist/services/daiso/client.js +67 -0
  90. package/dist/services/daiso/index.js +4 -0
  91. package/dist/services/daiso/product.js +17 -0
  92. package/dist/services/daiso/tools/checkInventory.js +80 -43
  93. package/dist/services/daiso/tools/findInventoryByName.js +222 -0
  94. package/dist/services/daiso/tools/findStores.js +17 -7
  95. package/dist/services/daiso/tools/getDisplayLocation.js +75 -0
  96. package/dist/services/emart24/api.js +11 -0
  97. package/dist/services/emart24/client.js +182 -0
  98. package/dist/services/emart24/index.js +22 -0
  99. package/dist/services/emart24/inventoryLookup.js +134 -0
  100. package/dist/services/emart24/tools/checkInventory.js +54 -0
  101. package/dist/services/emart24/tools/findNearbyStores.js +72 -0
  102. package/dist/services/emart24/tools/searchProducts.js +73 -0
  103. package/dist/services/emart24/types.js +4 -0
  104. package/dist/services/gs25/api.js +9 -0
  105. package/dist/services/gs25/client.js +208 -0
  106. package/dist/services/gs25/index.js +22 -0
  107. package/dist/services/gs25/storeUtils.js +168 -0
  108. package/dist/services/gs25/tools/checkInventory.js +163 -0
  109. package/dist/services/gs25/tools/findNearbyStores.js +103 -0
  110. package/dist/services/gs25/tools/searchProducts.js +57 -0
  111. package/dist/services/gs25/types.js +4 -0
  112. package/dist/services/lottecinema/api.js +12 -0
  113. package/dist/services/lottecinema/client.js +161 -0
  114. package/dist/services/lottecinema/index.js +30 -0
  115. package/dist/services/lottecinema/location.js +191 -0
  116. package/dist/services/lottecinema/tools/findNearbyTheaters.js +47 -0
  117. package/dist/services/lottecinema/tools/getRemainingSeats.js +85 -0
  118. package/dist/services/lottecinema/tools/listNowShowing.js +79 -0
  119. package/dist/services/lottecinema/types.js +4 -0
  120. package/dist/services/lottemart/api.js +31 -0
  121. package/dist/services/lottemart/client.js +254 -0
  122. package/dist/services/lottemart/clientTypes.js +4 -0
  123. package/dist/services/lottemart/config.js +4 -0
  124. package/dist/services/lottemart/debug.js +92 -0
  125. package/dist/services/lottemart/geocode.js +49 -0
  126. package/dist/services/lottemart/index.js +30 -0
  127. package/dist/services/lottemart/keyword.js +29 -0
  128. package/dist/services/lottemart/parser.js +185 -0
  129. package/dist/services/lottemart/session.js +331 -0
  130. package/dist/services/lottemart/storeSearch.js +52 -0
  131. package/dist/services/lottemart/tools/findNearbyStores.js +67 -0
  132. package/dist/services/lottemart/tools/searchProducts.js +69 -0
  133. package/dist/services/lottemart/types.js +4 -0
  134. package/dist/services/lottemart/zetta.js +105 -0
  135. package/dist/services/megabox/location.js +219 -0
  136. package/dist/services/megabox/tools/findNearbyTheaters.js +13 -44
  137. package/dist/services/megabox/tools/getRemainingSeats.js +31 -3
  138. package/dist/services/megabox/tools/listNowShowing.js +31 -3
  139. package/dist/services/oliveyoung/api.js +2 -0
  140. package/dist/services/oliveyoung/client.js +225 -13
  141. package/dist/services/oliveyoung/index.js +3 -1
  142. package/dist/services/oliveyoung/tools/checkInventory.js +21 -5
  143. package/dist/services/oliveyoung/tools/searchProducts.js +57 -0
  144. package/dist/services/seveneleven/api.js +15 -0
  145. package/dist/services/seveneleven/client.js +286 -0
  146. package/dist/services/seveneleven/index.js +30 -0
  147. package/dist/services/seveneleven/inventory.js +302 -0
  148. package/dist/services/seveneleven/productKeyword.js +141 -0
  149. package/dist/services/seveneleven/tools/checkInventory.js +82 -0
  150. package/dist/services/seveneleven/tools/getCatalogSnapshot.js +55 -0
  151. package/dist/services/seveneleven/tools/getSearchPopwords.js +41 -0
  152. package/dist/services/seveneleven/tools/searchProducts.js +67 -0
  153. package/dist/services/seveneleven/tools/searchStores.js +45 -0
  154. package/dist/services/seveneleven/types.js +4 -0
  155. package/dist/utils/cliInteractiveHelpers.js +63 -0
  156. package/dist/utils/daisoKeyword.js +30 -0
  157. package/dist/utils/http.js +98 -12
  158. package/dist/utils/zyte.js +47 -26
  159. package/openapi.json +1979 -736
  160. package/openapi.yaml +1428 -541
  161. package/package.json +49 -18
  162. package/dist/tools/checkInventory.js +0 -98
  163. package/dist/tools/findStores.js +0 -125
  164. package/dist/tools/getPriceInfo.js +0 -77
  165. package/dist/tools/searchProducts.js +0 -61
  166. package/dist/types/index.js +0 -4
package/dist/cli.js CHANGED
@@ -4,135 +4,39 @@
4
4
  *
5
5
  * npx daiso 명령으로 원격 MCP 서버 정보를 확인하고 상태를 점검합니다.
6
6
  */
7
- import { existsSync, readFileSync } from 'node:fs';
8
7
  import path from 'node:path';
9
8
  import { fileURLToPath } from 'node:url';
10
- import { spawn } from 'node:child_process';
11
- import { printCommandHelp, printHelp } from './cliHelp.js';
12
- import { renderApiEnvelope } from './cliRenderer.js';
13
- const DEFAULT_BASE_URL = 'https://mcp.aka.page';
14
- const DEFAULT_MCP_URL = `${DEFAULT_BASE_URL}/mcp`;
15
- function loadVersion() {
16
- const cliPath = fileURLToPath(import.meta.url);
17
- const packagePath = path.resolve(path.dirname(cliPath), '../package.json');
18
- if (!existsSync(packagePath)) {
19
- return '0.0.0';
20
- }
21
- const raw = readFileSync(packagePath, 'utf8');
22
- const parsed = JSON.parse(raw);
23
- return parsed.version ?? '0.0.0';
24
- }
25
- async function execCommand(command, args) {
26
- return await new Promise((resolve, reject) => {
27
- const child = spawn(command, args, {
28
- stdio: 'inherit',
29
- shell: false,
30
- });
31
- child.on('error', (error) => {
32
- reject(error);
33
- });
34
- child.on('close', (code) => {
35
- resolve(code ?? 1);
36
- });
37
- });
38
- }
39
- function createDefaultDeps() {
40
- return {
41
- fetchImpl: fetch,
42
- writeOut: (message) => {
43
- process.stdout.write(`${message}\n`);
44
- },
45
- writeErr: (message) => {
46
- process.stderr.write(`${message}\n`);
47
- },
48
- getVersion: loadVersion,
49
- nowIso: () => new Date().toISOString(),
50
- runCommand: execCommand,
51
- };
52
- }
53
- function parseCliArgs(args) {
54
- const positionals = [];
55
- const options = {};
56
- for (let index = 0; index < args.length; index += 1) {
57
- const token = args[index];
58
- if (!token.startsWith('--')) {
59
- positionals.push(token);
60
- continue;
61
- }
62
- const withoutPrefix = token.slice(2);
63
- const equalIndex = withoutPrefix.indexOf('=');
64
- if (equalIndex >= 0) {
65
- const key = withoutPrefix.slice(0, equalIndex);
66
- const value = withoutPrefix.slice(equalIndex + 1);
67
- options[key] = value;
68
- continue;
69
- }
70
- const key = withoutPrefix;
71
- const nextValue = args[index + 1];
72
- if (!nextValue || nextValue.startsWith('--')) {
73
- options[key] = 'true';
74
- continue;
75
- }
76
- options[key] = nextValue;
77
- index += 1;
78
- }
79
- return { positionals, options };
80
- }
81
- function toUrl(pathOrUrl) {
82
- if (pathOrUrl.startsWith('http://') || pathOrUrl.startsWith('https://')) {
83
- return new URL(pathOrUrl);
84
- }
85
- const normalizedPath = pathOrUrl.startsWith('/') ? pathOrUrl : `/${pathOrUrl}`;
86
- return new URL(normalizedPath, DEFAULT_BASE_URL);
87
- }
88
- function applyOptionsToQuery(url, options) {
89
- for (const [key, value] of Object.entries(options)) {
90
- url.searchParams.set(key, value);
91
- }
92
- }
93
- function toQueryOptions(options) {
94
- const queryOptions = {};
95
- for (const [key, value] of Object.entries(options)) {
96
- if (key === 'help' || key === 'json') {
97
- continue;
98
- }
99
- queryOptions[key] = value;
100
- }
101
- return queryOptions;
102
- }
103
- async function requestAndPrintResponse(fetchImpl, writeOut, writeErr, url, command, asJson) {
104
- try {
105
- const response = await fetchImpl(url.toString());
106
- if (!response.ok) {
107
- const bodyText = await response.text();
108
- writeErr(`요청 실패: HTTP ${response.status}`);
109
- if (bodyText) {
110
- writeErr(bodyText);
111
- }
112
- return 1;
113
- }
114
- const payload = (await response.json());
115
- if (asJson) {
116
- writeOut(JSON.stringify(payload, null, 2));
117
- }
118
- else {
119
- writeOut(renderApiEnvelope(command, url, payload));
120
- }
121
- return 0;
122
- }
123
- catch (error) {
124
- const message = error instanceof Error ? error.message : String(error);
125
- writeErr(`요청 중 오류 발생: ${message}`);
126
- return 1;
127
- }
9
+ import { printHelp, printCommandHelp } from './cliHelp.js';
10
+ import { createDefaultDeps } from './cli/deps.js';
11
+ import { DEFAULT_BASE_URL, DEFAULT_MCP_URL } from './cli/constants.js';
12
+ import { parseCliArgs } from './cli/args.js';
13
+ import { validateCommandOptions } from './cli/commandOptions.js';
14
+ import { handleGet, handleProducts, handleProduct, handleStores, handleInventory, handleDisplayLocation, } from './cli/commands/daiso.js';
15
+ import { handleCuStores, handleCuInventory, handleEmart24Stores, handleEmart24Products, handleEmart24Inventory, handleLotteMartStores, handleLotteMartProducts, handleGs25Stores, handleGs25Products, handleGs25Inventory, handleSevenElevenProducts, handleSevenElevenStores, handleSevenElevenPopwords, handleSevenElevenCatalog, handleLottecinemaTheaters, handleLottecinemaMovies, handleLottecinemaSeats, } from './cli/commands/convenience.js';
16
+ function rejectTopLevelUnknownOptions(options, command, deps) {
17
+ const parsed = parseCliArgs(options);
18
+ return validateCommandOptions(command, parsed.options, deps.writeErr);
128
19
  }
129
20
  export async function runCli(argv, deps) {
130
21
  const resolvedDeps = {
131
22
  ...createDefaultDeps(),
132
23
  ...deps,
133
24
  };
134
- const [command, ...options] = argv;
135
- if (!command || command === 'help' || command === '--help' || command === '-h') {
25
+ const nonInteractive = argv.includes('--non-interactive');
26
+ const normalizedArgv = argv.filter((arg) => arg !== '--non-interactive');
27
+ const [command, ...options] = normalizedArgv;
28
+ if (!command) {
29
+ if (!nonInteractive && resolvedDeps.isInteractiveTerminal()) {
30
+ return await resolvedDeps.runInteractive({
31
+ fetchImpl: resolvedDeps.fetchImpl,
32
+ writeOut: resolvedDeps.writeOut,
33
+ writeErr: resolvedDeps.writeErr,
34
+ });
35
+ }
36
+ printHelp(resolvedDeps.writeOut);
37
+ return 0;
38
+ }
39
+ if (command === 'help' || command === '--help' || command === '-h') {
136
40
  const maybeCommand = options[0];
137
41
  if (maybeCommand) {
138
42
  return printCommandHelp(maybeCommand, resolvedDeps.writeOut, resolvedDeps.writeErr);
@@ -141,14 +45,23 @@ export async function runCli(argv, deps) {
141
45
  return 0;
142
46
  }
143
47
  if (command === 'version' || command === '--version' || command === '-v') {
48
+ if (rejectTopLevelUnknownOptions(options, 'version', resolvedDeps)) {
49
+ return 1;
50
+ }
144
51
  resolvedDeps.writeOut(resolvedDeps.getVersion());
145
52
  return 0;
146
53
  }
147
54
  if (command === 'url') {
55
+ if (rejectTopLevelUnknownOptions(options, 'url', resolvedDeps)) {
56
+ return 1;
57
+ }
148
58
  resolvedDeps.writeOut(DEFAULT_MCP_URL);
149
59
  return 0;
150
60
  }
151
61
  if (command === 'health') {
62
+ if (rejectTopLevelUnknownOptions(options, 'health', resolvedDeps)) {
63
+ return 1;
64
+ }
152
65
  try {
153
66
  const response = await resolvedDeps.fetchImpl(`${DEFAULT_BASE_URL}/health`);
154
67
  if (!response.ok) {
@@ -170,6 +83,9 @@ export async function runCli(argv, deps) {
170
83
  }
171
84
  }
172
85
  if (command === 'claude') {
86
+ if (rejectTopLevelUnknownOptions(options, 'claude', resolvedDeps)) {
87
+ return 1;
88
+ }
173
89
  const cliArgs = ['mcp', 'add', 'daiso', DEFAULT_BASE_URL, '--transport', 'sse'];
174
90
  if (options.includes('--exec')) {
175
91
  try {
@@ -184,82 +100,57 @@ export async function runCli(argv, deps) {
184
100
  resolvedDeps.writeOut(`claude ${cliArgs.join(' ')}`);
185
101
  return 0;
186
102
  }
187
- if (command === 'get') {
188
- const parsed = parseCliArgs(options);
189
- if (parsed.options.help === 'true') {
190
- return printCommandHelp('get', resolvedDeps.writeOut, resolvedDeps.writeErr);
191
- }
192
- const targetPath = parsed.positionals[0];
193
- if (!targetPath) {
194
- resolvedDeps.writeErr('get 명령은 경로가 필요합니다. 예: daiso get /api/daiso/products --q 수납박스');
195
- return 1;
196
- }
197
- const targetUrl = toUrl(targetPath);
198
- applyOptionsToQuery(targetUrl, toQueryOptions(parsed.options));
199
- return await requestAndPrintResponse(resolvedDeps.fetchImpl, resolvedDeps.writeOut, resolvedDeps.writeErr, targetUrl, command, parsed.options.json === 'true');
200
- }
201
- if (command === 'products') {
202
- const parsed = parseCliArgs(options);
203
- if (parsed.options.help === 'true') {
204
- return printCommandHelp('products', resolvedDeps.writeOut, resolvedDeps.writeErr);
205
- }
206
- const query = parsed.positionals[0];
207
- if (!query) {
208
- resolvedDeps.writeErr('products 명령은 검색어가 필요합니다. 예: daiso products 수납박스');
209
- return 1;
210
- }
211
- const targetUrl = toUrl('/api/daiso/products');
212
- targetUrl.searchParams.set('q', query);
213
- applyOptionsToQuery(targetUrl, toQueryOptions(parsed.options));
214
- return await requestAndPrintResponse(resolvedDeps.fetchImpl, resolvedDeps.writeOut, resolvedDeps.writeErr, targetUrl, command, parsed.options.json === 'true');
215
- }
216
- if (command === 'product') {
217
- const parsed = parseCliArgs(options);
218
- if (parsed.options.help === 'true') {
219
- return printCommandHelp('product', resolvedDeps.writeOut, resolvedDeps.writeErr);
220
- }
221
- const productId = parsed.positionals[0];
222
- if (!productId) {
223
- resolvedDeps.writeErr('product 명령은 제품 ID가 필요합니다. 예: daiso product 1034604');
224
- return 1;
225
- }
226
- const targetUrl = toUrl(`/api/daiso/products/${productId}`);
227
- applyOptionsToQuery(targetUrl, toQueryOptions(parsed.options));
228
- return await requestAndPrintResponse(resolvedDeps.fetchImpl, resolvedDeps.writeOut, resolvedDeps.writeErr, targetUrl, command, parsed.options.json === 'true');
229
- }
230
- if (command === 'stores') {
231
- const parsed = parseCliArgs(options);
232
- if (parsed.options.help === 'true') {
233
- return printCommandHelp('stores', resolvedDeps.writeOut, resolvedDeps.writeErr);
234
- }
235
- const keyword = parsed.positionals[0];
236
- if (keyword) {
237
- parsed.options.keyword = keyword;
238
- }
239
- if (!parsed.options.keyword && !parsed.options.sido) {
240
- resolvedDeps.writeErr('stores 명령은 keyword 또는 --sido가 필요합니다. 예: daiso stores 강남역 / daiso stores --sido 서울');
241
- return 1;
242
- }
243
- const targetUrl = toUrl('/api/daiso/stores');
244
- applyOptionsToQuery(targetUrl, toQueryOptions(parsed.options));
245
- return await requestAndPrintResponse(resolvedDeps.fetchImpl, resolvedDeps.writeOut, resolvedDeps.writeErr, targetUrl, command, parsed.options.json === 'true');
246
- }
247
- if (command === 'inventory') {
248
- const parsed = parseCliArgs(options);
249
- if (parsed.options.help === 'true') {
250
- return printCommandHelp('inventory', resolvedDeps.writeOut, resolvedDeps.writeErr);
251
- }
252
- const productId = parsed.positionals[0];
253
- if (!productId) {
254
- resolvedDeps.writeErr('inventory 명령은 제품 ID가 필요합니다. 예: daiso inventory 1034604 --keyword 강남역');
255
- return 1;
256
- }
257
- const targetUrl = toUrl('/api/daiso/inventory');
258
- targetUrl.searchParams.set('productId', productId);
259
- applyOptionsToQuery(targetUrl, toQueryOptions(parsed.options));
260
- return await requestAndPrintResponse(resolvedDeps.fetchImpl, resolvedDeps.writeOut, resolvedDeps.writeErr, targetUrl, command, parsed.options.json === 'true');
261
- }
103
+ if (command === 'get')
104
+ return await handleGet(options, resolvedDeps);
105
+ if (command === 'products')
106
+ return await handleProducts(options, resolvedDeps);
107
+ if (command === 'product')
108
+ return await handleProduct(options, resolvedDeps);
109
+ if (command === 'stores')
110
+ return await handleStores(options, resolvedDeps);
111
+ if (command === 'inventory')
112
+ return await handleInventory(options, resolvedDeps);
113
+ if (command === 'display-location')
114
+ return await handleDisplayLocation(options, resolvedDeps);
115
+ if (command === 'cu-stores')
116
+ return await handleCuStores(options, resolvedDeps);
117
+ if (command === 'cu-inventory')
118
+ return await handleCuInventory(options, resolvedDeps);
119
+ if (command === 'lottecinema-theaters')
120
+ return await handleLottecinemaTheaters(options, resolvedDeps);
121
+ if (command === 'lottecinema-movies')
122
+ return await handleLottecinemaMovies(options, resolvedDeps);
123
+ if (command === 'lottecinema-seats')
124
+ return await handleLottecinemaSeats(options, resolvedDeps);
125
+ if (command === 'emart24-stores')
126
+ return await handleEmart24Stores(options, resolvedDeps);
127
+ if (command === 'emart24-products')
128
+ return await handleEmart24Products(options, resolvedDeps);
129
+ if (command === 'emart24-inventory')
130
+ return await handleEmart24Inventory(options, resolvedDeps);
131
+ if (command === 'lottemart-stores')
132
+ return await handleLotteMartStores(options, resolvedDeps);
133
+ if (command === 'lottemart-products')
134
+ return await handleLotteMartProducts(options, resolvedDeps);
135
+ if (command === 'gs25-stores')
136
+ return await handleGs25Stores(options, resolvedDeps);
137
+ if (command === 'gs25-products')
138
+ return await handleGs25Products(options, resolvedDeps);
139
+ if (command === 'gs25-inventory')
140
+ return await handleGs25Inventory(options, resolvedDeps);
141
+ if (command === 'seveneleven-products')
142
+ return await handleSevenElevenProducts(options, resolvedDeps);
143
+ if (command === 'seveneleven-stores')
144
+ return await handleSevenElevenStores(options, resolvedDeps);
145
+ if (command === 'seveneleven-popwords')
146
+ return await handleSevenElevenPopwords(options, resolvedDeps);
147
+ if (command === 'seveneleven-catalog')
148
+ return await handleSevenElevenCatalog(options, resolvedDeps);
262
149
  resolvedDeps.writeErr(`알 수 없는 명령어: ${command}`);
150
+ if (command === 'search') {
151
+ const query = options[0] ?? '<검색어>';
152
+ resolvedDeps.writeErr(`혹시 찾으신 명령: daiso products ${query}`);
153
+ }
263
154
  resolvedDeps.writeErr('도움말: daiso help');
264
155
  return 1;
265
156
  }
package/dist/cliHelp.js CHANGED
@@ -12,6 +12,24 @@ export const COMMAND_LIST = [
12
12
  'product',
13
13
  'stores',
14
14
  'inventory',
15
+ 'display-location',
16
+ 'cu-stores',
17
+ 'cu-inventory',
18
+ 'lottecinema-theaters',
19
+ 'lottecinema-movies',
20
+ 'lottecinema-seats',
21
+ 'lottemart-stores',
22
+ 'lottemart-products',
23
+ 'emart24-stores',
24
+ 'emart24-products',
25
+ 'emart24-inventory',
26
+ 'gs25-stores',
27
+ 'gs25-products',
28
+ 'gs25-inventory',
29
+ 'seveneleven-products',
30
+ 'seveneleven-stores',
31
+ 'seveneleven-popwords',
32
+ 'seveneleven-catalog',
15
33
  ];
16
34
  const COMMAND_SUMMARY = {
17
35
  help: '도움말 출력',
@@ -24,6 +42,24 @@ const COMMAND_SUMMARY = {
24
42
  product: '다이소 제품 상세 조회',
25
43
  stores: '다이소 매장 검색',
26
44
  inventory: '다이소 재고 조회',
45
+ 'display-location': '다이소 진열 위치 조회',
46
+ 'cu-stores': 'CU 매장 검색',
47
+ 'cu-inventory': 'CU 재고 조회',
48
+ 'lottecinema-theaters': '롯데시네마 주변 지점 조회',
49
+ 'lottecinema-movies': '롯데시네마 영화/회차 조회',
50
+ 'lottecinema-seats': '롯데시네마 잔여 좌석 조회',
51
+ 'lottemart-stores': '롯데마트 매장 검색',
52
+ 'lottemart-products': '롯데마트 상품 검색',
53
+ 'emart24-stores': '이마트24 매장 검색',
54
+ 'emart24-products': '이마트24 상품 검색',
55
+ 'emart24-inventory': '이마트24 재고 조회',
56
+ 'gs25-stores': 'GS25 매장 검색',
57
+ 'gs25-products': 'GS25 상품 검색',
58
+ 'gs25-inventory': 'GS25 재고 조회',
59
+ 'seveneleven-products': '세븐일레븐 상품 검색',
60
+ 'seveneleven-stores': '세븐일레븐 매장 검색',
61
+ 'seveneleven-popwords': '세븐일레븐 인기 검색어 조회',
62
+ 'seveneleven-catalog': '세븐일레븐 카탈로그 스냅샷 조회',
27
63
  };
28
64
  const COMMAND_DETAIL = {
29
65
  help: [
@@ -97,12 +133,163 @@ const COMMAND_DETAIL = {
97
133
  '옵션: --keyword, --lat, --lng, --page, --pageSize, --json',
98
134
  '예시: daiso inventory 1034604 --keyword 강남역',
99
135
  ],
136
+ 'display-location': [
137
+ '명령: display-location',
138
+ '설명: 다이소 매장 내 상품 진열 위치 API를 호출합니다.',
139
+ '사용법: daiso display-location <productId> <storeCode> [--json]',
140
+ '필수: <productId>, <storeCode>',
141
+ '옵션: --json',
142
+ '예시: daiso display-location 1034604 04515',
143
+ ],
144
+ 'cu-stores': [
145
+ '명령: cu-stores',
146
+ '설명: CU 매장 검색 API를 호출합니다.',
147
+ '사용법: daiso cu-stores [keyword] [--lat 값] [--lng 값] [--limit N] [--json]',
148
+ '옵션: --keyword, --lat, --lng, --limit, --json',
149
+ '예시: daiso cu-stores 강남',
150
+ '예시: daiso cu-stores --lat 37.498 --lng 127.027 --limit 10',
151
+ ],
152
+ 'cu-inventory': [
153
+ '명령: cu-inventory',
154
+ '설명: CU 재고 검색 API를 호출합니다.',
155
+ '사용법: daiso cu-inventory <keyword> [--storeKeyword 값] [--lat 값] [--lng 값] [--size N] [--offset N] [--json]',
156
+ '필수: <keyword>',
157
+ '옵션: --storeKeyword, --lat, --lng, --size, --offset, --searchSort, --storeLimit, --json',
158
+ '예시: daiso cu-inventory 과자',
159
+ '예시: daiso cu-inventory 컵라면 --storeKeyword 강남 --size 10',
160
+ ],
161
+ 'lottecinema-theaters': [
162
+ '명령: lottecinema-theaters',
163
+ '설명: 롯데시네마 주변 지점 API를 호출합니다.',
164
+ '사용법: daiso lottecinema-theaters [keyword] [--lat 값] [--lng 값] [--playDate YYYYMMDD] [--limit N] [--json]',
165
+ '옵션: --keyword, --lat, --lng, --playDate, --limit, --json',
166
+ '예시: daiso lottecinema-theaters 잠실 --limit 5',
167
+ '예시: daiso lottecinema-theaters --keyword "안산 중앙역" --limit 5',
168
+ ],
169
+ 'lottecinema-movies': [
170
+ '명령: lottecinema-movies',
171
+ '설명: 롯데시네마 영화/회차 API를 호출합니다.',
172
+ '사용법: daiso lottecinema-movies [keyword] [--playDate YYYYMMDD] [--theaterId 값] [--movieId 값] [--lat 값] [--lng 값] [--json]',
173
+ '옵션: --playDate, --theaterId, --movieId, --keyword, --lat, --lng, --json',
174
+ '예시: daiso lottecinema-movies 잠실 --playDate 20260310',
175
+ '예시: daiso lottecinema-movies --playDate 20260310 --keyword "안산 중앙역"',
176
+ ],
177
+ 'lottecinema-seats': [
178
+ '명령: lottecinema-seats',
179
+ '설명: 롯데시네마 잔여 좌석 API를 호출합니다.',
180
+ '사용법: daiso lottecinema-seats [keyword] [--playDate YYYYMMDD] [--theaterId 값] [--movieId 값] [--lat 값] [--lng 값] [--limit N] [--json]',
181
+ '옵션: --playDate, --theaterId, --movieId, --keyword, --lat, --lng, --limit, --json',
182
+ '예시: daiso lottecinema-seats 잠실 --playDate 20260310 --movieId 23816',
183
+ '예시: daiso lottecinema-seats --playDate 20260310 --keyword "안산 중앙역" --movieId 23816',
184
+ ],
185
+ 'lottemart-stores': [
186
+ '명령: lottemart-stores',
187
+ '설명: 롯데마트 계열 매장 검색 API를 호출합니다.',
188
+ '사용법: daiso lottemart-stores [keyword] [--area 값] [--brandVariant 값] [--lat 값] [--lng 값] [--limit N] [--json]',
189
+ '옵션: --keyword, --area, --brandVariant, --lat, --lng, --limit, --json',
190
+ '예시: daiso lottemart-stores 잠실 --area 서울',
191
+ '예시: daiso lottemart-stores --area 경기 --brandVariant lottemart --limit 10',
192
+ ],
193
+ 'lottemart-products': [
194
+ '명령: lottemart-products',
195
+ '설명: 롯데마트 매장 기준 상품 검색 API를 호출합니다.',
196
+ '사용법: daiso lottemart-products <keyword> [--storeCode 값 | --storeName 값] [--area 값] [--pageLimit N] [--json]',
197
+ '필수: <keyword>, --storeCode 또는 --storeName',
198
+ '옵션: --storeCode, --storeName, --area, --pageLimit, --json',
199
+ '예시: daiso lottemart-products 콜라 --storeName 강변점 --area 서울',
200
+ '예시: daiso lottemart-products 우유 --storeCode 2301 --pageLimit 2',
201
+ ],
202
+ 'emart24-stores': [
203
+ '명령: emart24-stores',
204
+ '설명: 이마트24 매장 검색 API를 호출합니다.',
205
+ '사용법: daiso emart24-stores [keyword] [--area1 값] [--area2 값] [--lat 값] [--lng 값] [--service24h true|false] [--limit N] [--json]',
206
+ '옵션: --keyword, --area1, --area2, --lat, --lng, --service24h, --limit, --json',
207
+ '예시: daiso emart24-stores 강남',
208
+ '예시: daiso emart24-stores --area1 서울특별시 --area2 강남구 --service24h true',
209
+ ],
210
+ 'emart24-products': [
211
+ '명령: emart24-products',
212
+ '설명: 이마트24 상품 검색 API를 호출합니다.',
213
+ '사용법: daiso emart24-products <keyword> [--page N] [--pageSize N] [--sortType 값] [--saleProductYn Y|N] [--json]',
214
+ '필수: <keyword>',
215
+ '옵션: --page, --pageSize, --sortType, --saleProductYn, --json',
216
+ '예시: daiso emart24-products 두바이',
217
+ '예시: daiso emart24-products 도시락 --page 2 --pageSize 20',
218
+ ],
219
+ 'emart24-inventory': [
220
+ '명령: emart24-inventory',
221
+ '설명: 이마트24 매장별 재고 API를 호출합니다.',
222
+ '사용법: daiso emart24-inventory <pluCd> --bizNoArr 코드1,코드2 [--json]',
223
+ '필수: <pluCd>, --bizNoArr',
224
+ '옵션: --bizNoArr, --json',
225
+ '예시: daiso emart24-inventory 8800244010504 --bizNoArr 28339,05015,23233',
226
+ ],
227
+ 'gs25-stores': [
228
+ '명령: gs25-stores',
229
+ '설명: GS25 매장 검색 API를 호출합니다.',
230
+ '사용법: daiso gs25-stores [keyword] [--lat 값] [--lng 값] [--limit N] [--json]',
231
+ '옵션: --keyword, --lat, --lng, --serviceCode, --limit, --json',
232
+ '예시: daiso gs25-stores 강남',
233
+ '예시: daiso gs25-stores --lat 37.4982 --lng 127.0276 --limit 10',
234
+ ],
235
+ 'gs25-products': [
236
+ '명령: gs25-products',
237
+ '설명: GS25 상품 키워드 검색 API를 호출합니다.',
238
+ '사용법: daiso gs25-products <keyword> [--limit N] [--json]',
239
+ '필수: <keyword>',
240
+ '옵션: --serviceCode, --limit, --json',
241
+ '예시: daiso gs25-products 오감자',
242
+ ],
243
+ 'gs25-inventory': [
244
+ '명령: gs25-inventory',
245
+ '설명: GS25 재고 검색 API를 호출합니다.',
246
+ '사용법: daiso gs25-inventory <keyword> [--storeKeyword 값] [--lat 값] [--lng 값] [--storeLimit N] [--json]',
247
+ '필수: <keyword>',
248
+ '옵션: --storeKeyword, --lat, --lng, --serviceCode, --storeLimit, --json',
249
+ '예시: daiso gs25-inventory 오감자 --storeKeyword 강남',
250
+ ],
251
+ 'seveneleven-products': [
252
+ '명령: seveneleven-products',
253
+ '설명: 세븐일레븐 상품 검색 API를 호출합니다.',
254
+ '사용법: daiso seveneleven-products <query> [--page N] [--size N] [--sort 값] [--json]',
255
+ '필수: <query>',
256
+ '옵션: --page, --size, --sort, --json',
257
+ '예시: daiso seveneleven-products 삼각김밥 --size 20',
258
+ ],
259
+ 'seveneleven-stores': [
260
+ '명령: seveneleven-stores',
261
+ '설명: 세븐일레븐 매장 검색 API를 호출합니다.',
262
+ '사용법: daiso seveneleven-stores <keyword> [--limit N] [--json]',
263
+ '필수: <keyword>',
264
+ '옵션: --limit, --json',
265
+ '예시: daiso seveneleven-stores 안산 중앙역 --limit 10',
266
+ ],
267
+ 'seveneleven-popwords': [
268
+ '명령: seveneleven-popwords',
269
+ '설명: 세븐일레븐 인기 검색어 API를 호출합니다.',
270
+ '사용법: daiso seveneleven-popwords [--label 값] [--json]',
271
+ '옵션: --label, --json',
272
+ '예시: daiso seveneleven-popwords --label home',
273
+ ],
274
+ 'seveneleven-catalog': [
275
+ '명령: seveneleven-catalog',
276
+ '설명: 세븐일레븐 카탈로그 스냅샷 API를 호출합니다.',
277
+ '사용법: daiso seveneleven-catalog [--includeIssues true|false] [--includeExhibition true|false] [--limit N] [--json]',
278
+ '옵션: --includeIssues, --includeExhibition, --limit, --json',
279
+ '예시: daiso seveneleven-catalog --includeIssues true --includeExhibition true --limit 10',
280
+ ],
100
281
  };
101
282
  export function printHelp(writeOut) {
102
283
  writeOut('daiso CLI');
103
284
  writeOut('');
285
+ writeOut('기본 실행:');
286
+ writeOut(' npx daiso (인터랙티브 모드)');
287
+ writeOut(' npx daiso --non-interactive (도움말 출력)');
288
+ writeOut('');
104
289
  writeOut('사용법:');
105
290
  writeOut(' daiso <command> [options]');
291
+ writeOut('전역 옵션:');
292
+ writeOut(' --non-interactive 인터랙티브 진입 비활성화');
106
293
  writeOut('');
107
294
  writeOut('명령어:');
108
295
  for (const command of COMMAND_LIST) {
@@ -116,15 +303,39 @@ export function printHelp(writeOut) {
116
303
  writeOut(' npx daiso products 수납박스');
117
304
  writeOut(' npx daiso stores 강남역');
118
305
  writeOut(' npx daiso inventory 1034604 --keyword 강남역');
306
+ writeOut(' npx daiso display-location 1034604 04515');
307
+ writeOut(' npx daiso cu-stores 강남');
308
+ writeOut(' npx daiso cu-inventory 과자 --storeKeyword 강남');
309
+ writeOut(' npx daiso lottecinema-theaters --keyword "안산 중앙역" --limit 5');
310
+ writeOut(' npx daiso lottecinema-movies --playDate 20260310 --keyword "안산 중앙역"');
311
+ writeOut(' npx daiso lottecinema-seats --playDate 20260310 --keyword "안산 중앙역" --movieId 23816');
312
+ writeOut(' npx daiso lottemart-stores 잠실 --area 서울 --limit 10');
313
+ writeOut(' npx daiso lottemart-products 콜라 --storeName 강변점 --area 서울');
314
+ writeOut(' npx daiso emart24-stores 강남 --limit 10');
315
+ writeOut(' npx daiso emart24-products 두바이 --pageSize 20');
316
+ writeOut(' npx daiso emart24-inventory 8800244010504 --bizNoArr 28339,05015');
317
+ writeOut(' npx daiso gs25-stores 강남 --limit 10');
318
+ writeOut(' npx daiso gs25-products 오감자');
319
+ writeOut(' npx daiso gs25-inventory 오감자 --storeKeyword 강남');
320
+ writeOut(' npx daiso seveneleven-products 삼각김밥 --size 20');
321
+ writeOut(' npx daiso seveneleven-stores 안산 중앙역 --limit 10');
322
+ writeOut(' npx daiso seveneleven-popwords --label home');
323
+ writeOut(' npx daiso seveneleven-catalog --limit 10');
119
324
  writeOut(' npx daiso get /api/cgv/movies --playDate 20260307 --theaterCode 0056');
120
325
  writeOut('');
326
+ writeOut('정보가 부족할 때:');
327
+ writeOut(' 제품명을 먼저 검색해 productId를 확인: npx daiso products 수납박스');
328
+ writeOut(' productId로 재고 확인: npx daiso inventory <productId> --keyword 강남역');
329
+ writeOut(' 매장을 먼저 검색해 storeName 또는 storeCode를 확인: npx daiso stores 강남역');
330
+ writeOut(' 롯데마트 매장 확인: npx daiso lottemart-stores 잠실 --area 서울');
331
+ writeOut('');
121
332
  writeOut('상세 도움말:');
122
333
  writeOut(' npx daiso help <command>');
123
334
  }
124
335
  export function printCommandHelp(command, writeOut, writeErr) {
125
336
  if (!Object.hasOwn(COMMAND_DETAIL, command)) {
126
337
  writeErr(`도움말을 찾을 수 없는 명령어: ${command}`);
127
- writeErr('사용 가능한 명령어: help, version, url, health, claude, get, products, product, stores, inventory');
338
+ writeErr('사용 가능한 명령어: help, version, url, health, claude, get, products, product, stores, inventory, display-location, cu-stores, cu-inventory, lottecinema-theaters, lottecinema-movies, lottecinema-seats, lottemart-stores, lottemart-products, emart24-stores, emart24-products, emart24-inventory, gs25-stores, gs25-products, gs25-inventory, seveneleven-products, seveneleven-stores, seveneleven-popwords, seveneleven-catalog');
128
339
  return 1;
129
340
  }
130
341
  const detail = COMMAND_DETAIL[command];