@yoonion/mimi-seed-mcp 0.23.4 → 0.25.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 (288) hide show
  1. package/dist/admob/cli.js +34 -5
  2. package/dist/admob/errors.js +39 -14
  3. package/dist/ai/client.js +35 -14
  4. package/dist/ai/notes.js +14 -3
  5. package/dist/ai/review.js +17 -4
  6. package/dist/android/keystore-store.js +28 -8
  7. package/dist/android/keystore.d.ts +17 -2
  8. package/dist/android/keystore.js +110 -21
  9. package/dist/android/messages.d.ts +13 -11
  10. package/dist/android/messages.js +166 -72
  11. package/dist/android/playstore-sa.js +6 -3
  12. package/dist/appstore/analytics.js +46 -14
  13. package/dist/appstore/app-info-policy.js +7 -1
  14. package/dist/appstore/app-info.js +13 -3
  15. package/dist/appstore/apps.js +7 -1
  16. package/dist/appstore/asset-library-write.js +119 -37
  17. package/dist/appstore/asset-library.js +19 -5
  18. package/dist/appstore/auth.d.ts +2 -0
  19. package/dist/appstore/auth.js +31 -5
  20. package/dist/appstore/client.js +27 -6
  21. package/dist/appstore/declarations.js +22 -6
  22. package/dist/appstore/errors.d.ts +1 -1
  23. package/dist/appstore/errors.js +60 -34
  24. package/dist/appstore/http.d.ts +6 -0
  25. package/dist/appstore/http.js +22 -5
  26. package/dist/appstore/messages.js +86 -28
  27. package/dist/appstore/previews.js +22 -6
  28. package/dist/appstore/product-localization.js +10 -2
  29. package/dist/appstore/product-review.js +29 -10
  30. package/dist/appstore/products.js +20 -6
  31. package/dist/appstore/read-response.js +13 -3
  32. package/dist/appstore/release-target.js +13 -3
  33. package/dist/appstore/release.js +59 -22
  34. package/dist/appstore/review-preview.js +17 -6
  35. package/dist/appstore/review-submission.js +86 -35
  36. package/dist/appstore/sales.js +96 -44
  37. package/dist/appstore/screenshots.js +19 -5
  38. package/dist/appstore/testflight.js +41 -18
  39. package/dist/appstore/upload-parts.js +12 -3
  40. package/dist/appstore/versions.js +22 -10
  41. package/dist/auth/bigquery-auth.js +44 -15
  42. package/dist/auth/bigquery-setup-cli.js +1 -1
  43. package/dist/auth/cli.js +4 -2
  44. package/dist/auth/constants.js +13 -3
  45. package/dist/auth/drive-auth.d.ts +3 -2
  46. package/dist/auth/drive-auth.js +47 -17
  47. package/dist/auth/drive-setup-cli.js +1 -0
  48. package/dist/auth/errors.d.ts +75 -0
  49. package/dist/auth/errors.js +190 -86
  50. package/dist/auth/google-auth.d.ts +3 -1
  51. package/dist/auth/google-auth.js +39 -27
  52. package/dist/auth/playstore-auth.d.ts +1 -0
  53. package/dist/auth/playstore-auth.js +35 -15
  54. package/dist/auth/scopes.d.ts +18 -28
  55. package/dist/auth/scopes.js +53 -14
  56. package/dist/auth/youtube-channel.d.ts +8 -0
  57. package/dist/auth/youtube-channel.js +11 -3
  58. package/dist/bigquery/ids.js +19 -5
  59. package/dist/bigquery/tools.js +24 -8
  60. package/dist/billing/tools.js +22 -6
  61. package/dist/checks/appstore-submission.d.ts +1 -1
  62. package/dist/checks/appstore-submission.js +29 -8
  63. package/dist/checks/plan.js +169 -62
  64. package/dist/checks/release-status.js +10 -2
  65. package/dist/checks/risks.js +230 -63
  66. package/dist/checks/screenshots.d.ts +4 -4
  67. package/dist/checks/screenshots.js +63 -22
  68. package/dist/ci/config.js +8 -5
  69. package/dist/ci/gitlab.js +3 -1
  70. package/dist/core/atomic-write.d.ts +5 -2
  71. package/dist/core/atomic-write.js +8 -4
  72. package/dist/core/catch-scan.d.ts +17 -0
  73. package/dist/core/catch-scan.js +111 -0
  74. package/dist/core/checks/billing.d.ts +5 -0
  75. package/dist/core/checks/billing.js +36 -5
  76. package/dist/core/checks/lockfile.js +2 -0
  77. package/dist/core/checks/release-doctor/fcm.js +1 -0
  78. package/dist/core/checks/release-doctor/files.d.ts +3 -1
  79. package/dist/core/checks/release-doctor/files.js +12 -1
  80. package/dist/core/checks/release-doctor/gradle-apply.js +1 -0
  81. package/dist/core/checks/release-doctor/ios-xcode.js +22 -3
  82. package/dist/core/checks/release-doctor/target-sdk.js +1 -1
  83. package/dist/core/checks/release-doctor/util.d.ts +5 -0
  84. package/dist/core/checks/release-doctor/util.js +56 -0
  85. package/dist/core/checks/release-doctor.js +59 -16
  86. package/dist/core/credential-envelope.d.ts +25 -0
  87. package/dist/core/credential-envelope.js +66 -0
  88. package/dist/core/credential-keystore.d.ts +37 -0
  89. package/dist/core/credential-keystore.js +275 -0
  90. package/dist/core/credential-read.d.ts +33 -0
  91. package/dist/core/credential-read.js +112 -0
  92. package/dist/core/credential-store.d.ts +61 -0
  93. package/dist/core/credential-store.js +240 -0
  94. package/dist/core/http-errors.js +1 -0
  95. package/dist/core/i18n-scan.d.ts +10 -0
  96. package/dist/core/i18n-scan.js +79 -0
  97. package/dist/core/json-file.d.ts +30 -0
  98. package/dist/core/json-file.js +53 -0
  99. package/dist/core/lang.d.ts +14 -0
  100. package/dist/core/lang.js +22 -2
  101. package/dist/core/project-manifest.d.ts +24 -1
  102. package/dist/core/project-manifest.js +27 -16
  103. package/dist/drive/tools.js +86 -34
  104. package/dist/facebook/api.js +3 -1
  105. package/dist/facebook/config.js +11 -3
  106. package/dist/facebook/setup.d.ts +2 -0
  107. package/dist/facebook/setup.js +32 -9
  108. package/dist/firebase/cli.js +39 -5
  109. package/dist/firebase/tools.js +36 -10
  110. package/dist/ga4/cli.js +48 -4
  111. package/dist/ga4/tools.js +4 -2
  112. package/dist/googleads/config.js +24 -8
  113. package/dist/googleads/tools.js +3 -1
  114. package/dist/gsc/tools.d.ts +116 -9
  115. package/dist/gsc/tools.js +101 -17
  116. package/dist/helpers.d.ts +4 -2
  117. package/dist/helpers.js +82 -44
  118. package/dist/i18n/manifest-en.d.ts +6 -0
  119. package/dist/i18n/manifest-en.js +53 -0
  120. package/dist/i18n/tools-en/admob.d.ts +25 -0
  121. package/dist/i18n/tools-en/admob.js +24 -0
  122. package/dist/i18n/tools-en/ai.d.ts +14 -0
  123. package/dist/i18n/tools-en/ai.js +13 -0
  124. package/dist/i18n/tools-en/android.d.ts +14 -0
  125. package/dist/i18n/tools-en/android.js +13 -0
  126. package/dist/i18n/tools-en/appstore.d.ts +240 -0
  127. package/dist/i18n/tools-en/appstore.js +239 -0
  128. package/dist/i18n/tools-en/auth.d.ts +16 -0
  129. package/dist/i18n/tools-en/auth.js +15 -0
  130. package/dist/i18n/tools-en/bigquery.d.ts +16 -0
  131. package/dist/i18n/tools-en/bigquery.js +15 -0
  132. package/dist/i18n/tools-en/billing.d.ts +17 -0
  133. package/dist/i18n/tools-en/billing.js +16 -0
  134. package/dist/i18n/tools-en/checks.d.ts +23 -0
  135. package/dist/i18n/tools-en/checks.js +22 -0
  136. package/dist/i18n/tools-en/ci.d.ts +21 -0
  137. package/dist/i18n/tools-en/ci.js +20 -0
  138. package/dist/i18n/tools-en/drive.d.ts +33 -0
  139. package/dist/i18n/tools-en/drive.js +32 -0
  140. package/dist/i18n/tools-en/facebook.d.ts +14 -0
  141. package/dist/i18n/tools-en/facebook.js +13 -0
  142. package/dist/i18n/tools-en/firebase.d.ts +42 -0
  143. package/dist/i18n/tools-en/firebase.js +41 -0
  144. package/dist/i18n/tools-en/ga4.d.ts +35 -0
  145. package/dist/i18n/tools-en/ga4.js +34 -0
  146. package/dist/i18n/tools-en/googleads.d.ts +15 -0
  147. package/dist/i18n/tools-en/googleads.js +14 -0
  148. package/dist/i18n/tools-en/gsc.d.ts +27 -0
  149. package/dist/i18n/tools-en/gsc.js +26 -0
  150. package/dist/i18n/tools-en/iam.d.ts +15 -0
  151. package/dist/i18n/tools-en/iam.js +14 -0
  152. package/dist/i18n/tools-en/index.d.ts +7 -0
  153. package/dist/i18n/tools-en/index.js +58 -0
  154. package/dist/i18n/tools-en/instagram.d.ts +16 -0
  155. package/dist/i18n/tools-en/instagram.js +15 -0
  156. package/dist/i18n/tools-en/jenkins.d.ts +41 -0
  157. package/dist/i18n/tools-en/jenkins.js +40 -0
  158. package/dist/i18n/tools-en/naver.d.ts +10 -0
  159. package/dist/i18n/tools-en/naver.js +9 -0
  160. package/dist/i18n/tools-en/playstore.d.ts +148 -0
  161. package/dist/i18n/tools-en/playstore.js +147 -0
  162. package/dist/i18n/tools-en/registrar.d.ts +6 -0
  163. package/dist/i18n/tools-en/registrar.js +6 -0
  164. package/dist/i18n/tools-en/threads.d.ts +21 -0
  165. package/dist/i18n/tools-en/threads.js +20 -0
  166. package/dist/i18n/tools-en/tiktok.d.ts +21 -0
  167. package/dist/i18n/tools-en/tiktok.js +20 -0
  168. package/dist/i18n/tools-en/video.d.ts +59 -0
  169. package/dist/i18n/tools-en/video.js +58 -0
  170. package/dist/i18n/tools-en/youtube.d.ts +44 -0
  171. package/dist/i18n/tools-en/youtube.js +43 -0
  172. package/dist/iam/key-files.js +13 -3
  173. package/dist/instagram/api.js +19 -5
  174. package/dist/instagram/config.js +11 -3
  175. package/dist/instagram/setup.js +37 -11
  176. package/dist/jenkins/builds.d.ts +2 -2
  177. package/dist/jenkins/builds.js +70 -30
  178. package/dist/jenkins/config.d.ts +5 -0
  179. package/dist/jenkins/config.js +25 -6
  180. package/dist/jenkins/credentials.js +33 -13
  181. package/dist/jenkins/http.js +6 -3
  182. package/dist/jenkins/jobs.js +19 -5
  183. package/dist/jenkins/messages.js +93 -36
  184. package/dist/lib/cli-args.js +13 -7
  185. package/dist/lib/google-errors.js +31 -9
  186. package/dist/lib/http.js +10 -3
  187. package/dist/lib/json-file.d.ts +15 -0
  188. package/dist/lib/json-file.js +65 -0
  189. package/dist/lib/meta-auth.d.ts +1 -1
  190. package/dist/lib/meta-auth.js +26 -8
  191. package/dist/lib/package-name.js +15 -4
  192. package/dist/lib/package-root.js +1 -1
  193. package/dist/lib/paginate.js +10 -2
  194. package/dist/lib/path-containment.js +22 -6
  195. package/dist/lib/resource-id.js +10 -3
  196. package/dist/lib/store-create-result.js +54 -13
  197. package/dist/lib/text-validators.js +20 -5
  198. package/dist/lib/tool-registrar.d.ts +9 -0
  199. package/dist/lib/tool-registrar.js +33 -14
  200. package/dist/lib/tool-text.d.ts +31 -0
  201. package/dist/lib/tool-text.js +52 -0
  202. package/dist/lib/toolsets.js +13 -3
  203. package/dist/lib/url-path.js +3 -1
  204. package/dist/naver/tools.js +138 -46
  205. package/dist/playstore/data-safety.js +16 -4
  206. package/dist/playstore/errors.js +33 -8
  207. package/dist/playstore/financials.js +83 -35
  208. package/dist/playstore/listing.js +7 -1
  209. package/dist/playstore/messages.js +179 -57
  210. package/dist/playstore/products.js +10 -2
  211. package/dist/playstore/recovery.js +10 -2
  212. package/dist/playstore/releases.js +34 -14
  213. package/dist/playstore/reviews.js +14 -4
  214. package/dist/playstore/statistics.js +3 -1
  215. package/dist/prompts.js +160 -50
  216. package/dist/registers/admob.js +36 -11
  217. package/dist/registers/android.js +25 -9
  218. package/dist/registers/appstore/apps.js +22 -6
  219. package/dist/registers/appstore/customer-reviews.js +7 -1
  220. package/dist/registers/appstore/declarations.js +63 -19
  221. package/dist/registers/appstore/media.js +76 -24
  222. package/dist/registers/appstore/metadata.js +26 -8
  223. package/dist/registers/appstore/products.js +53 -19
  224. package/dist/registers/appstore/review-submission.js +31 -9
  225. package/dist/registers/appstore/testflight.js +82 -24
  226. package/dist/registers/appstore/versions.js +88 -30
  227. package/dist/registers/auth.js +343 -90
  228. package/dist/registers/bigquery.js +54 -14
  229. package/dist/registers/billing.js +18 -4
  230. package/dist/registers/checks.js +20 -5
  231. package/dist/registers/ci.js +60 -20
  232. package/dist/registers/drive.js +18 -7
  233. package/dist/registers/facebook.js +31 -9
  234. package/dist/registers/firebase.js +21 -7
  235. package/dist/registers/googleads.js +23 -6
  236. package/dist/registers/gsc.js +42 -39
  237. package/dist/registers/iam.js +44 -13
  238. package/dist/registers/instagram.js +19 -5
  239. package/dist/registers/jenkins.js +43 -14
  240. package/dist/registers/naver.js +13 -3
  241. package/dist/registers/playstore/financials.d.ts +6 -0
  242. package/dist/registers/playstore/financials.js +48 -0
  243. package/dist/registers/playstore/listing.d.ts +15 -0
  244. package/dist/registers/playstore/listing.js +138 -0
  245. package/dist/registers/playstore/media.d.ts +6 -0
  246. package/dist/registers/playstore/media.js +56 -0
  247. package/dist/registers/playstore/products.d.ts +21 -0
  248. package/dist/registers/playstore/products.js +238 -0
  249. package/dist/registers/playstore/recovery.d.ts +11 -0
  250. package/dist/registers/playstore/recovery.js +105 -0
  251. package/dist/registers/playstore/releases.d.ts +8 -0
  252. package/dist/registers/playstore/releases.js +157 -0
  253. package/dist/registers/playstore/reviews.d.ts +6 -0
  254. package/dist/registers/playstore/reviews.js +43 -0
  255. package/dist/registers/playstore/service-accounts.d.ts +13 -0
  256. package/dist/registers/playstore/service-accounts.js +127 -0
  257. package/dist/registers/playstore/shared.d.ts +12 -0
  258. package/dist/registers/playstore/shared.js +24 -0
  259. package/dist/registers/playstore.d.ts +8 -0
  260. package/dist/registers/playstore.js +28 -734
  261. package/dist/registers/threads.js +28 -8
  262. package/dist/registers/tiktok.js +4 -2
  263. package/dist/registers/video.js +3 -1
  264. package/dist/remote-sync.js +80 -28
  265. package/dist/resources.d.ts +0 -8
  266. package/dist/resources.js +73 -32
  267. package/dist/server.d.ts +2 -0
  268. package/dist/server.js +9 -1
  269. package/dist/social/profile-store.js +36 -12
  270. package/dist/social/setup-cli.js +1 -1
  271. package/dist/threads/api.js +23 -6
  272. package/dist/threads/setup.js +42 -14
  273. package/dist/tiktok-business/api.js +13 -3
  274. package/dist/tiktok-business/auth.js +10 -2
  275. package/dist/tiktok-business/config.js +8 -3
  276. package/dist/tiktok-business/posting.d.ts +6 -0
  277. package/dist/tiktok-business/posting.js +118 -36
  278. package/dist/tiktok-business/setup-cli.js +3 -1
  279. package/dist/tools-cli.js +4 -5
  280. package/dist/video/captions.js +3 -1
  281. package/dist/video/files.js +13 -3
  282. package/dist/video/project.js +65 -21
  283. package/dist/video/providers.js +52 -16
  284. package/dist/video/render.js +71 -22
  285. package/dist/video/research.js +10 -2
  286. package/dist/video/schemas.js +19 -5
  287. package/dist/video/youtube-publish.js +62 -32
  288. package/package.json +1 -1
@@ -1,6 +1,110 @@
1
1
  import { fetchWithTimeout } from '../lib/http.js';
2
2
  import { encodePathSegment } from '../lib/url-path.js';
3
3
  import { isAllowed, parseRobots } from './robots.js';
4
+ import { catalog } from '#core/lang.js';
5
+ const M = catalog({
6
+ badUrl: (label, v) => `${label}: 올바른 절대 URL 이 아닙니다 — ${v}`,
7
+ notHttp: (label, v) => `${label}: http(s) URL 만 받습니다 — ${v}`,
8
+ redirectInvalid: (href, loc) => `${href} 의 Location 헤더가 URL 이 아니다: ${loc}`,
9
+ redirectLoop: (n) => `리다이렉트가 ${n}번 이어지거나 순환한다 — 크롤러는 중간에 포기한다.`,
10
+ redirectTemporary: (codes) => `임시 리다이렉트(${codes})가 있다 — 영구 이전이면 301/308 로 바꿔야 새 URL 이 색인된다.`,
11
+ notHttps: '최종 URL 이 https 가 아니다.',
12
+ robotsUnreachable: (url, why) => `${url} 를 읽지 못했다(${why}) — 크롤러는 이 경우 사이트 전체를 막힌 것으로 본다.`,
13
+ robotsBlocked: (href, via, pattern) => `robots.txt 가 Yeti 의 ${href} 수집을 막는다 (${via} → Disallow: ${pattern}).`,
14
+ noSitemap: 'robots.txt 에 Sitemap: 선언이 없다. 서치어드바이저 콘솔(요청 → 사이트맵 제출)에도 따로 제출해 두는 게 좋다.',
15
+ httpStatus: (status) => `최종 응답이 ${status} 다 — 200 이 아니면 색인되지 않는다.`,
16
+ uaBlocked: (status) => `Yeti UA 로는 ${status}, 브라우저 UA 로는 200 이다 — 서버/WAF 가 봇 UA 를 막거나, 네이버 IP 가 아닌 Yeti 를 거르는 것일 수 있다. ` +
17
+ '진짜 Yeti 의 수집 결과는 서치어드바이저 콘솔(수집 현황·웹 페이지 최적화)에서 확인해.',
18
+ htmlTruncated: (mib) => `HTML 이 ${mib} MiB 를 넘어 앞부분만 점검했다.`,
19
+ notHtml: (ct) => `HTML 이 아니다(content-type: ${ct ?? '없음'}) — 메타 태그 점검을 건너뛴다.`,
20
+ noindex: (sources) => `noindex 지시어가 있다 (${sources}) — 검색에 나오지 않는다.`,
21
+ noindexAmbiguous: (header) => `X-Robots-Tag 의 noindex 가 다른 봇 접두어 뒤에 이어져 있다(${header}). ` +
22
+ 'X-Robots-Tag 헤더가 여러 줄이면 이 noindex 는 Yeti 에게도 적용된다 — 서버 설정을 확인해.',
23
+ nofollow: 'nofollow 지시어가 있다 — 이 페이지의 링크를 따라가지 않는다.',
24
+ canonicalInvalid: (v) => `canonical 값이 URL 이 아니다: ${v}`,
25
+ canonicalMismatch: (href) => `정규 URL 이 다른 주소(${href})를 가리킨다 — 이 URL 대신 그쪽이 색인된다.`,
26
+ noCanonical: '<link rel="canonical"> 이 없다 — 파라미터 붙은 중복 URL 이 따로 색인될 수 있다.',
27
+ noTitle: '<title> 이 없거나 비었다.',
28
+ noDescription: '<meta name="description"> 이 없다 — 검색 결과 요약문으로 쓰인다.',
29
+ ogMissing: (tags) => `Open Graph 태그가 빠졌다: ${tags} — 서치어드바이저가 권장하는 제목·요약·대표 이미지 정보다.`,
30
+ thinHtml: (n) => `원본 HTML 의 본문이 ${n}자뿐이다 — JS 로 그리는 페이지면 크롤러에 빈 문서로 보일 수 있다. 서버 렌더링(SSR/SSG)이 가장 안전하다.`,
31
+ noLang: '<html lang> 이 없다.',
32
+ noSiteVerification: 'naver-site-verification 메타 태그가 없다 — HTML 파일 방식으로 소유 확인했다면 무시해도 된다.',
33
+ indexNowStatus: (status) => {
34
+ const text = {
35
+ 400: '요청 형식이 잘못됐다(400).',
36
+ 403: '키가 유효하지 않다(403) — 키 파일 내용이 key 와 정확히 같은지, 파일이 공개로 열리는지 확인해.',
37
+ 422: 'URL 이 host 나 키 파일 위치와 맞지 않는다(422) — URL 은 키 파일과 같은 스킴·호스트, 같은 디렉터리 이하여야 한다.',
38
+ 429: '너무 자주 보냈다(429) — 스팸으로 볼 수 있으니 한참 뒤에 다시 보내. 자동 재시도는 하지 않았다.',
39
+ };
40
+ return text[status];
41
+ },
42
+ badKey: 'key 는 8–128자의 영문·숫자·대시(-)여야 합니다.',
43
+ noUrls: 'urls 가 비었습니다.',
44
+ tooMany: (max) => `한 번에 최대 ${max}개까지 보낼 수 있습니다.`,
45
+ mixedOrigins: (a, b) => `모든 URL 은 같은 스킴·호스트여야 합니다 — ${a} 와 ${b} 가 섞였습니다. 나눠서 보내세요.`,
46
+ keyOrigin: (origin) => `keyLocation 은 제출 URL 과 같은 스킴·호스트(${origin})에 있어야 합니다.`,
47
+ outsideKeyDir: (dir, href) => `키 파일 디렉터리(${dir}) 밖의 URL 은 보낼 수 없습니다 — ${href}`,
48
+ keyStatus: (status) => `응답 ${status}`,
49
+ keyMismatch: '파일 내용이 key 와 다름',
50
+ keyCheckFailed: (href, why, pathname) => [
51
+ `키 파일 확인 실패: ${href} (${why}). 아무것도 제출하지 않았습니다.`,
52
+ `→ 사이트에 ${pathname} 파일을 올리고 내용으로 key 한 줄만 넣으세요 (UTF-8, 리다이렉트 없이 200).`,
53
+ ' 정적 사이트는 보통 public/ (또는 static/) 폴더 루트에 두면 됩니다.',
54
+ ],
55
+ submitFailed: (reason, detail) => `네이버 IndexNow 제출 실패: ${reason}${detail ? `\n응답: ${detail}` : ''}`,
56
+ }, {
57
+ badUrl: (label, v) => `${label}: not a valid absolute URL — ${v}`,
58
+ notHttp: (label, v) => `${label}: only http(s) URLs are accepted — ${v}`,
59
+ redirectInvalid: (href, loc) => `The Location header of ${href} is not a URL: ${loc}`,
60
+ redirectLoop: (n) => `Redirects continue ${n} times or loop — crawlers give up partway.`,
61
+ redirectTemporary: (codes) => `There are temporary redirects (${codes}) — for a permanent move, change them to 301/308 so the new URL gets indexed.`,
62
+ notHttps: 'The final URL is not https.',
63
+ robotsUnreachable: (url, why) => `Could not read ${url} (${why}) — in this case crawlers treat the whole site as blocked.`,
64
+ robotsBlocked: (href, via, pattern) => `robots.txt blocks Yeti from crawling ${href} (${via} → Disallow: ${pattern}).`,
65
+ noSitemap: 'robots.txt has no Sitemap: declaration. It is also a good idea to submit the sitemap separately in the Naver Search Advisor console (Request → Submit sitemap).',
66
+ httpStatus: (status) => `The final response is ${status} — anything other than 200 is not indexed.`,
67
+ uaBlocked: (status) => `The Yeti UA gets ${status}, a browser UA gets 200 — the server/WAF may block bot UAs, or filter Yeti requests that do not come from Naver IPs. ` +
68
+ 'Check what the real Yeti crawled in the Naver Search Advisor console (crawl status · web page optimization).',
69
+ htmlTruncated: (mib) => `The HTML exceeds ${mib} MiB, so only the first part was checked.`,
70
+ notHtml: (ct) => `Not HTML (content-type: ${ct ?? 'none'}) — skipping the meta tag checks.`,
71
+ noindex: (sources) => `A noindex directive is present (${sources}) — the page does not appear in search.`,
72
+ noindexAmbiguous: (header) => `A noindex in X-Robots-Tag follows another bot prefix (${header}). ` +
73
+ 'If the X-Robots-Tag header has multiple lines, this noindex also applies to Yeti — check the server configuration.',
74
+ nofollow: 'A nofollow directive is present — links on this page are not followed.',
75
+ canonicalInvalid: (v) => `The canonical value is not a URL: ${v}`,
76
+ canonicalMismatch: (href) => `The canonical URL points to a different address (${href}) — that one is indexed instead of this URL.`,
77
+ noCanonical: 'No <link rel="canonical"> — duplicate URLs with parameters may be indexed separately.',
78
+ noTitle: '<title> is missing or empty.',
79
+ noDescription: 'No <meta name="description"> — it is used as the search result snippet.',
80
+ ogMissing: (tags) => `Open Graph tags are missing: ${tags} — the title, summary, and representative image that Naver Search Advisor recommends.`,
81
+ thinHtml: (n) => `The original HTML body has only ${n} characters — if the page is rendered by JS, crawlers may see an empty document. Server rendering (SSR/SSG) is safest.`,
82
+ noLang: 'No <html lang>.',
83
+ noSiteVerification: 'No naver-site-verification meta tag — ignore this if you verified ownership with the HTML file method.',
84
+ indexNowStatus: (status) => {
85
+ const text = {
86
+ 400: 'The request format is invalid (400).',
87
+ 403: 'The key is invalid (403) — check that the key file content exactly matches key and that the file is publicly accessible.',
88
+ 422: 'The URLs do not match the host or the key file location (422) — URLs must have the same scheme and host as the key file and be in the same directory or below.',
89
+ 429: 'Too many submissions (429) — this may be treated as spam; wait a good while before sending again. No automatic retry was made.',
90
+ };
91
+ return text[status];
92
+ },
93
+ badKey: 'key must be 8–128 characters of letters, digits, and dashes (-).',
94
+ noUrls: 'urls is empty.',
95
+ tooMany: (max) => `At most ${max} URLs can be sent at once.`,
96
+ mixedOrigins: (a, b) => `All URLs must have the same scheme and host — ${a} and ${b} are mixed. Send them separately.`,
97
+ keyOrigin: (origin) => `keyLocation must be on the same scheme and host as the submitted URLs (${origin}).`,
98
+ outsideKeyDir: (dir, href) => `URLs outside the key file directory (${dir}) cannot be sent — ${href}`,
99
+ keyStatus: (status) => `response ${status}`,
100
+ keyMismatch: 'file content differs from key',
101
+ keyCheckFailed: (href, why, pathname) => [
102
+ `Key file check failed: ${href} (${why}). Nothing was submitted.`,
103
+ `→ Upload the file ${pathname} to the site with only the key on one line (UTF-8, 200 with no redirect).`,
104
+ ' For a static site, the root of the public/ (or static/) folder usually works.',
105
+ ],
106
+ submitFailed: (reason, detail) => `Naver IndexNow submission failed: ${reason}${detail ? `\nResponse: ${detail}` : ''}`,
107
+ });
4
108
  /**
5
109
  * 네이버 서치어드바이저 — 검색 노출·색인 도구.
6
110
  *
@@ -36,10 +140,10 @@ function parseHttpUrl(value, label) {
36
140
  url = new URL(value.trim());
37
141
  }
38
142
  catch {
39
- throw new Error(`${label}: 올바른 절대 URL 이 아닙니다 — ${JSON.stringify(value)}`);
143
+ throw new Error(M().badUrl(label, JSON.stringify(value)));
40
144
  }
41
145
  if (url.protocol !== 'http:' && url.protocol !== 'https:') {
42
- throw new Error(`${label}: http(s) URL 만 받습니다 — ${JSON.stringify(value)}`);
146
+ throw new Error(M().notHttp(label, JSON.stringify(value)));
43
147
  }
44
148
  url.hash = '';
45
149
  return url;
@@ -366,24 +470,24 @@ export async function checkPage(input) {
366
470
  }
367
471
  catch {
368
472
  stopped = true;
369
- add('error', 'redirect_invalid', `${current.href} 의 Location 헤더가 URL 이 아니다: ${JSON.stringify(location)}`);
473
+ add('error', 'redirect_invalid', M().redirectInvalid(current.href, JSON.stringify(location)));
370
474
  break;
371
475
  }
372
476
  next.hash = '';
373
477
  redirects.push({ url: current.href, status: res.status, location: next.href });
374
478
  if (redirects.length > MAX_REDIRECTS || redirects.some((hop) => hop.url === next.href)) {
375
479
  stopped = true;
376
- add('error', 'redirect_loop', `리다이렉트가 ${redirects.length}번 이어지거나 순환한다 — 크롤러는 중간에 포기한다.`);
480
+ add('error', 'redirect_loop', M().redirectLoop(redirects.length));
377
481
  break;
378
482
  }
379
483
  current = next;
380
484
  }
381
485
  const temporary = redirects.filter((hop) => hop.status !== 301 && hop.status !== 308);
382
486
  if (temporary.length > 0) {
383
- add('warn', 'redirect_temporary', `임시 리다이렉트(${temporary.map((h) => h.status).join(', ')})가 있다 — 영구 이전이면 301/308 로 바꿔야 새 URL 이 색인된다.`);
487
+ add('warn', 'redirect_temporary', M().redirectTemporary(temporary.map((h) => h.status).join(', ')));
384
488
  }
385
489
  if (current.protocol !== 'https:')
386
- add('warn', 'not_https', '최종 URL 이 https 가 아니다.');
490
+ add('warn', 'not_https', M().notHttps);
387
491
  // robots.txt — 시작 URL, 중간 경유지, 최종 URL 모두 Yeti 가 긁을 수 있어야 끝까지 따라간다.
388
492
  const robotsCache = new Map();
389
493
  const robotsFor = (origin) => {
@@ -405,7 +509,7 @@ export async function checkPage(input) {
405
509
  if (robots.unreachable) {
406
510
  if (!unreachableReported.has(robots.url)) {
407
511
  unreachableReported.add(robots.url);
408
- add('error', 'robots_unreachable', `${robots.url} 를 읽지 못했다(${robots.status ?? robots.error}) — 크롤러는 이 경우 사이트 전체를 막힌 것으로 본다.`);
512
+ add('error', 'robots_unreachable', M().robotsUnreachable(robots.url, robots.status ?? robots.error));
409
513
  }
410
514
  continue;
411
515
  }
@@ -414,22 +518,21 @@ export async function checkPage(input) {
414
518
  finalVerdict = verdict;
415
519
  if (!verdict.allowed) {
416
520
  const via = verdict.group === 'crawler' ? 'User-agent: Yeti' : 'User-agent: *';
417
- add('error', 'robots_blocked', `robots.txt 가 Yeti 의 ${target.href} 수집을 막는다 (${via} → Disallow: ${verdict.matchedRule?.pattern}).`);
521
+ add('error', 'robots_blocked', M().robotsBlocked(target.href, via, verdict.matchedRule?.pattern));
418
522
  }
419
523
  }
420
524
  if (!finalRobots.unreachable && finalRobots.parsed.sitemaps.length === 0) {
421
- add('info', 'no_sitemap_in_robots', 'robots.txt 에 Sitemap: 선언이 없다. 서치어드바이저 콘솔(요청 → 사이트맵 제출)에도 따로 제출해 두는 게 좋다.');
525
+ add('info', 'no_sitemap_in_robots', M().noSitemap);
422
526
  }
423
527
  if (res.status !== 200) {
424
- add('error', 'http_status', `최종 응답이 ${res.status} 다 — 200 이 아니면 색인되지 않는다.`);
528
+ add('error', 'http_status', M().httpStatus(res.status));
425
529
  if (!stopped) {
426
530
  // Yeti UA 만 막히는가? WAF 는 IP 가 네이버가 아닌 "가짜 Yeti" 를 거르기도 해서, 진짜 Yeti 는 통과할 수 있다.
427
531
  try {
428
532
  const probe = await fetchWithTimeout(current, { headers: { 'user-agent': BROWSER_USER_AGENT, accept }, redirect: 'manual' });
429
533
  await probe.body?.cancel();
430
534
  if (probe.status === 200) {
431
- add('warn', 'ua_blocked', `Yeti UA 로는 ${res.status}, 브라우저 UA 로는 200 이다 — 서버/WAF 가 봇 UA 를 막거나, 네이버 IP 가 아닌 Yeti 를 거르는 것일 수 있다. ` +
432
- '진짜 Yeti 의 수집 결과는 서치어드바이저 콘솔(수집 현황·웹 페이지 최적화)에서 확인해.');
535
+ add('warn', 'ua_blocked', M().uaBlocked(res.status));
433
536
  }
434
537
  }
435
538
  catch {
@@ -447,11 +550,11 @@ export async function checkPage(input) {
447
550
  const { text, truncated } = await readCapped(res, HTML_MAX_BYTES);
448
551
  head = parseHead(text);
449
552
  if (truncated)
450
- add('info', 'html_truncated', `HTML 이 ${HTML_MAX_BYTES / 1024 / 1024} MiB 를 넘어 앞부분만 점검했다.`);
553
+ add('info', 'html_truncated', M().htmlTruncated(HTML_MAX_BYTES / 1024 / 1024));
451
554
  }
452
555
  else {
453
556
  await res.body?.cancel();
454
- add('warn', 'not_html', `HTML 이 아니다(content-type: ${contentType ?? '없음'}) — 메타 태그 점검을 건너뛴다.`);
557
+ add('warn', 'not_html', M().notHtml(contentType));
455
558
  }
456
559
  const blocks = (list) => list.includes('noindex') || list.includes('none');
457
560
  const sources = [
@@ -459,13 +562,12 @@ export async function checkPage(input) {
459
562
  ...(blocks(head?.robots ?? []) ? ['meta robots/yeti'] : []),
460
563
  ];
461
564
  if (sources.length > 0)
462
- add('error', 'noindex', `noindex 지시어가 있다 (${sources.join(', ')}) — 검색에 나오지 않는다.`);
565
+ add('error', 'noindex', M().noindex(sources.join(', ')));
463
566
  else if (blocks(xRobots.ambiguous)) {
464
- add('warn', 'noindex_ambiguous', `X-Robots-Tag 의 noindex 가 다른 봇 접두어 뒤에 이어져 있다(${res.headers.get('x-robots-tag')}). ` +
465
- 'X-Robots-Tag 헤더가 여러 줄이면 이 noindex 는 Yeti 에게도 적용된다 — 서버 설정을 확인해.');
567
+ add('warn', 'noindex_ambiguous', M().noindexAmbiguous(res.headers.get('x-robots-tag')));
466
568
  }
467
569
  if ([...xRobots.applies, ...(head?.robots ?? [])].includes('nofollow')) {
468
- add('warn', 'nofollow', 'nofollow 지시어가 있다 — 이 페이지의 링크를 따라가지 않는다.');
570
+ add('warn', 'nofollow', M().nofollow);
469
571
  }
470
572
  if (head) {
471
573
  const canonicalRaw = head.canonical ?? linkHeaderCanonical(res.headers.get('link'));
@@ -484,31 +586,31 @@ export async function checkPage(input) {
484
586
  canonical.hash = '';
485
587
  }
486
588
  catch {
487
- add('warn', 'canonical_invalid', `canonical 값이 URL 이 아니다: ${JSON.stringify(canonicalRaw)}`);
589
+ add('warn', 'canonical_invalid', M().canonicalInvalid(JSON.stringify(canonicalRaw)));
488
590
  }
489
591
  if (canonical && canonical.href !== current.href) {
490
- add('warn', 'canonical_mismatch', `정규 URL 이 다른 주소(${canonical.href})를 가리킨다 — 이 URL 대신 그쪽이 색인된다.`);
592
+ add('warn', 'canonical_mismatch', M().canonicalMismatch(canonical.href));
491
593
  }
492
594
  }
493
595
  else {
494
- add('info', 'no_canonical', '<link rel="canonical"> 이 없다 — 파라미터 붙은 중복 URL 이 따로 색인될 수 있다.');
596
+ add('info', 'no_canonical', M().noCanonical);
495
597
  }
496
598
  if (!head.title)
497
- add('warn', 'no_title', '<title> 이 없거나 비었다.');
599
+ add('warn', 'no_title', M().noTitle);
498
600
  if (!head.description)
499
- add('warn', 'no_description', '<meta name="description"> 이 없다 — 검색 결과 요약문으로 쓰인다.');
601
+ add('warn', 'no_description', M().noDescription);
500
602
  const og = head.og;
501
603
  const missingOg = ['title', 'description', 'image'].filter((k) => !og[k]);
502
604
  if (missingOg.length > 0) {
503
- add('warn', 'og_missing', `Open Graph 태그가 빠졌다: ${missingOg.map((k) => `og:${k}`).join(', ')} — 서치어드바이저가 권장하는 제목·요약·대표 이미지 정보다.`);
605
+ add('warn', 'og_missing', M().ogMissing(missingOg.map((k) => `og:${k}`).join(', ')));
504
606
  }
505
607
  if (head.textLength < THIN_TEXT_CHARS && head.scriptCount > 0) {
506
- add('warn', 'thin_html', `원본 HTML 의 본문이 ${head.textLength}자뿐이다 — JS 로 그리는 페이지면 크롤러에 빈 문서로 보일 수 있다. 서버 렌더링(SSR/SSG)이 가장 안전하다.`);
608
+ add('warn', 'thin_html', M().thinHtml(head.textLength));
507
609
  }
508
610
  if (!head.lang)
509
- add('info', 'no_lang', '<html lang> 이 없다.');
611
+ add('info', 'no_lang', M().noLang);
510
612
  if (!head.naverSiteVerification) {
511
- add('info', 'no_site_verification', 'naver-site-verification 메타 태그가 없다 — HTML 파일 방식으로 소유 확인했다면 무시해도 된다.');
613
+ add('info', 'no_site_verification', M().noSiteVerification);
512
614
  }
513
615
  }
514
616
  const summary = { error: 0, warn: 0, info: 0 };
@@ -532,12 +634,6 @@ export async function checkPage(input) {
532
634
  summary,
533
635
  };
534
636
  }
535
- const INDEXNOW_STATUS = {
536
- 400: '요청 형식이 잘못됐다(400).',
537
- 403: '키가 유효하지 않다(403) — 키 파일 내용이 key 와 정확히 같은지, 파일이 공개로 열리는지 확인해.',
538
- 422: 'URL 이 host 나 키 파일 위치와 맞지 않는다(422) — URL 은 키 파일과 같은 스킴·호스트, 같은 디렉터리 이하여야 한다.',
539
- 429: '너무 자주 보냈다(429) — 스팸으로 볼 수 있으니 한참 뒤에 다시 보내. 자동 재시도는 하지 않았다.',
540
- };
541
637
  /**
542
638
  * 네이버 IndexNow 로 URL 변경을 알린다.
543
639
  *
@@ -546,7 +642,7 @@ const INDEXNOW_STATUS = {
546
642
  */
547
643
  export async function submitIndexNow({ urls, key, keyLocation }) {
548
644
  if (!INDEXNOW_KEY_PATTERN.test(key)) {
549
- throw new Error('key 는 8–128자의 영문·숫자·대시(-)여야 합니다.');
645
+ throw new Error(M().badKey);
550
646
  }
551
647
  // 정규화(호스트 소문자·# 제거) 뒤에 중복을 없앤다 — 입력 문자열 기준이면 같은 URL 이 여러 번 나간다.
552
648
  const byHref = new Map();
@@ -558,25 +654,25 @@ export async function submitIndexNow({ urls, key, keyLocation }) {
558
654
  }
559
655
  const parsed = [...byHref.values()];
560
656
  if (parsed.length === 0)
561
- throw new Error('urls 가 비었습니다.');
657
+ throw new Error(M().noUrls);
562
658
  if (parsed.length > INDEXNOW_MAX_URLS)
563
- throw new Error(`한 번에 최대 ${INDEXNOW_MAX_URLS}개까지 보낼 수 있습니다.`);
659
+ throw new Error(M().tooMany(INDEXNOW_MAX_URLS));
564
660
  // IndexNow 의 범위는 URL 접두어다 — 호스트만이 아니라 스킴까지 같아야 한다.
565
661
  const origin = parsed[0].origin;
566
662
  const foreign = parsed.find((u) => u.origin !== origin);
567
663
  if (foreign) {
568
- throw new Error(`모든 URL 은 같은 스킴·호스트여야 합니다 — ${origin} 와 ${foreign.origin} 가 섞였습니다. 나눠서 보내세요.`);
664
+ throw new Error(M().mixedOrigins(origin, foreign.origin));
569
665
  }
570
666
  const keyUrl = keyLocation
571
667
  ? parseHttpUrl(keyLocation, 'keyLocation')
572
668
  : new URL(`/${encodePathSegment(key)}.txt`, origin);
573
669
  if (keyUrl.origin !== origin) {
574
- throw new Error(`keyLocation 은 제출 URL 과 같은 스킴·호스트(${origin})에 있어야 합니다.`);
670
+ throw new Error(M().keyOrigin(origin));
575
671
  }
576
672
  const keyDir = keyUrl.pathname.slice(0, keyUrl.pathname.lastIndexOf('/') + 1);
577
673
  const outside = parsed.find((u) => !u.pathname.startsWith(keyDir));
578
674
  if (outside) {
579
- throw new Error(`키 파일 디렉터리(${keyDir}) 밖의 URL 은 보낼 수 없습니다 — ${outside.href}`);
675
+ throw new Error(M().outsideKeyDir(keyDir, outside.href));
580
676
  }
581
677
  // 사전 확인: 키 파일이 리다이렉트 없이 200 으로, 내용이 key 그대로 열려야 한다.
582
678
  const keyRes = await fetchWithTimeout(keyUrl, { redirect: 'manual' });
@@ -586,12 +682,8 @@ export async function submitIndexNow({ urls, key, keyLocation }) {
586
682
  else
587
683
  await keyRes.body?.cancel();
588
684
  if (keyRes.status !== 200 || keyBody !== key) {
589
- const why = keyRes.status !== 200 ? `응답 ${keyRes.status}` : '파일 내용이 key 와 다름';
590
- throw new Error([
591
- `키 파일 확인 실패: ${keyUrl.href} (${why}). 아무것도 제출하지 않았습니다.`,
592
- `→ 사이트에 ${keyUrl.pathname} 파일을 올리고 내용으로 key 한 줄만 넣으세요 (UTF-8, 리다이렉트 없이 200).`,
593
- ' 정적 사이트는 보통 public/ (또는 static/) 폴더 루트에 두면 됩니다.',
594
- ].join('\n'));
685
+ const why = keyRes.status !== 200 ? M().keyStatus(keyRes.status) : M().keyMismatch;
686
+ throw new Error(M().keyCheckFailed(keyUrl.href, why, keyUrl.pathname).join('\n'));
595
687
  }
596
688
  // 429 도 재시도하지 않는다 — IndexNow 의 429 는 "스팸 의심"이라 연타가 상황을 악화시킨다.
597
689
  const res = await fetchWithTimeout(NAVER_INDEXNOW_ENDPOINT, {
@@ -608,5 +700,5 @@ export async function submitIndexNow({ urls, key, keyLocation }) {
608
700
  if (res.status === 200 || res.status === 202) {
609
701
  return { endpoint: NAVER_INDEXNOW_ENDPOINT, status: res.status, host: keyUrl.host, keyLocation: keyUrl.href, submitted: parsed.length };
610
702
  }
611
- throw new Error(`네이버 IndexNow 제출 실패: ${INDEXNOW_STATUS[res.status] ?? `HTTP ${res.status}`}${detail ? `\n응답: ${detail}` : ''}`);
703
+ throw new Error(M().submitFailed(M().indexNowStatus(res.status) ?? `HTTP ${res.status}`, detail));
612
704
  }
@@ -1,6 +1,18 @@
1
1
  import fs from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import { publisher } from './edits.js';
4
+ import { catalog } from '#core/lang.js';
5
+ const M = catalog({
6
+ needInput: 'csvPath 또는 csv 중 하나는 필요하다.',
7
+ notAbsolute: (p) => `csvPath 는 절대경로여야 한다: ${p}`,
8
+ empty: 'safetyLabels CSV 가 비어 있다.',
9
+ notCsv: 'CSV 로 보이지 않는다 — Play Console 에서 받은 데이터 안전 CSV 원문을 그대로 넣을 것.',
10
+ }, {
11
+ needInput: 'Either csvPath or csv is required.',
12
+ notAbsolute: (p) => `csvPath must be an absolute path: ${p}`,
13
+ empty: 'The safetyLabels CSV is empty.',
14
+ notCsv: 'This does not look like CSV — pass the data safety CSV downloaded from Play Console, unmodified.',
15
+ });
4
16
  /**
5
17
  * playstore_upload_data_safety 의 입력 해석 — CSV 원문(csv) 또는 절대경로(csvPath) 중 하나.
6
18
  *
@@ -10,9 +22,9 @@ import { publisher } from './edits.js';
10
22
  export function readDataSafetyCsv(input) {
11
23
  const { csv, csvPath } = input;
12
24
  if (!csv && !csvPath)
13
- throw new Error('csvPath 또는 csv 중 하나는 필요하다.');
25
+ throw new Error(M().needInput);
14
26
  if (!csv && csvPath && !path.isAbsolute(csvPath)) {
15
- throw new Error(`csvPath 는 절대경로여야 한다: ${csvPath}`);
27
+ throw new Error(M().notAbsolute(csvPath));
16
28
  }
17
29
  return csv ?? fs.readFileSync(csvPath, 'utf8');
18
30
  }
@@ -25,9 +37,9 @@ export function readDataSafetyCsv(input) {
25
37
  export async function uploadDataSafety(auth, packageName, safetyLabelsCsv) {
26
38
  const csv = safetyLabelsCsv.trim();
27
39
  if (!csv)
28
- throw new Error('safetyLabels CSV 가 비어 있다.');
40
+ throw new Error(M().empty);
29
41
  if (!csv.includes(',')) {
30
- throw new Error('CSV 로 보이지 않는다 — Play Console 에서 받은 데이터 안전 CSV 원문을 그대로 넣을 것.');
42
+ throw new Error(M().notCsv);
31
43
  }
32
44
  await publisher().applications.dataSafety({
33
45
  auth,
@@ -2,21 +2,46 @@
2
2
  // App Store 의 friendlyAppStoreError 와 대칭 — Play 쪽엔 없던 친절화 레이어.
3
3
  // 신규 사용자가 가장 자주 막히는 두 케이스(서비스 계정 권한 403, edit 세션 충돌)에
4
4
  // 구체적 복구 단계를 붙인다. 인식 못 한 에러(도메인 에러 포함)는 원본 보존.
5
+ import { catalog } from '#core/lang.js';
5
6
  import { extractHttpStatus, authReauthMessage, withCause, googleErrorDetail } from '../lib/google-errors.js';
6
7
  // 403 안내. raw Google 사유를 먼저 보여주고, 권한이 멀쩡한데 특정 작업만 거부되는
7
8
  // 케이스(같은 SA로 이미지 업로드는 되는데 listings.update만 403 등)를 위해
8
9
  // "다른 쓰기가 되면 권한 문제가 아니다"라는 단서를 붙인다. detail 은 googleErrorDetail() 결과.
9
- function permission403Message(detail) {
10
- return [
11
- '❌ Google Play 403 — 요청이 거부됐어요.',
12
- detail ? `Google 사유: ${detail}` : '',
13
- '⚠️ 같은 계정/서비스 계정으로 다른 쓰기(예: 이미지 업로드)가 된다면 권한 문제가 아닐 수 있어요 — 위 Google 사유 또는 앱 상태·정책·작업별 제한을 먼저 확인하세요.',
14
- '',
10
+ const M = catalog({
11
+ denied: '❌ Google Play 403 — 요청이 거부됐어요.',
12
+ reason: (detail) => `Google 사유: ${detail}`,
13
+ notPermission: '⚠️ 같은 계정/서비스 계정으로 다른 쓰기(예: 이미지 업로드)가 된다면 권한 문제가 아닐 수 있어요 — 위 Google 사유 또는 앱 상태·정책·작업별 제한을 먼저 확인하세요.',
14
+ steps: [
15
15
  '정말 권한 문제라면:',
16
16
  '1. Play Console → 사용자 및 권한(Users and permissions)',
17
17
  '2. 이 Google 계정(또는 서비스 계정 이메일)을 초대 / 권한 부여',
18
18
  '3. 앱 권한에 "앱 정보 관리"(Manage store presence) 부여',
19
19
  '4. 권한 적용까지 ~5분 대기 후 재시도',
20
+ ],
21
+ notFound: (packageName) => `❌ 패키지${packageName ? ` (${packageName})` : ''}를 이 개발자 계정에서 찾을 수 없어요.\n→ packageName 철자와 계정 권한을 확인하세요.`,
22
+ editConflict: '❌ Play edit 세션 충돌 — 같은 요청에서 edit 세션을 여러 번 열었을 수 있어요.\n→ 작업을 하나의 withEdit 트랜잭션으로 묶고, 잠시 후 재시도하세요.',
23
+ }, {
24
+ denied: '❌ Google Play 403 — the request was denied.',
25
+ reason: (detail) => `Google reason: ${detail}`,
26
+ notPermission: '⚠️ If other writes (e.g. image uploads) succeed with the same account/service account, this may not be a permission problem — check the Google reason above, or the app state, policy, and per-operation limits first.',
27
+ steps: [
28
+ 'If it really is a permission problem:',
29
+ '1. Play Console → Users and permissions',
30
+ '2. Invite this Google account (or the service account email) / grant permissions',
31
+ '3. Grant "Manage store presence" in the app permissions',
32
+ '4. Wait ~5 minutes for the permissions to apply, then retry',
33
+ ],
34
+ notFound: (packageName) => `❌ Package${packageName ? ` (${packageName})` : ''} not found in this developer account.\n→ Check the packageName spelling and the account permissions.`,
35
+ editConflict: '❌ Play edit session conflict — the same request may have opened an edit session more than once.\n→ Group the operations into a single withEdit transaction and retry shortly.',
36
+ });
37
+ function permission403Message(detail) {
38
+ const m = M();
39
+ return [
40
+ m.denied,
41
+ detail ? m.reason(detail) : '',
42
+ m.notPermission,
43
+ '',
44
+ ...m.steps,
20
45
  ].filter((l) => l !== '').join('\n');
21
46
  }
22
47
  export function friendlyPlayError(e, packageName) {
@@ -29,10 +54,10 @@ export function friendlyPlayError(e, packageName) {
29
54
  return withCause(new Error(permission403Message(googleErrorDetail(e))), e);
30
55
  }
31
56
  if (status === 404 || /NOT_FOUND|not found/i.test(text)) {
32
- return withCause(new Error(`❌ 패키지${packageName ? ` (${packageName})` : ''}를 이 개발자 계정에서 찾을 수 없어요.\n→ packageName 철자와 계정 권한을 확인하세요.`), e);
57
+ return withCause(new Error(M().notFound(packageName)), e);
33
58
  }
34
59
  if (/This Edit has been deleted|editAlreadyCommitted|edit.*(deleted|expired|not found)/i.test(text)) {
35
- return withCause(new Error('❌ Play edit 세션 충돌 — 같은 요청에서 edit 세션을 여러 번 열었을 수 있어요.\n→ 작업을 하나의 withEdit 트랜잭션으로 묶고, 잠시 후 재시도하세요.'), e);
60
+ return withCause(new Error(M().editConflict), e);
36
61
  }
37
62
  // 인식 못 한 에러(이미 친절한 도메인 에러 포함)는 원본 보존
38
63
  return e instanceof Error ? e : new Error(text);
@@ -14,6 +14,82 @@ import zlib from 'node:zlib';
14
14
  import { newJWT } from '../lib/google-auth-lite.js';
15
15
  import { fetchWithTimeout, HTTP_TRANSFER_TIMEOUT_MS } from '../lib/http.js';
16
16
  import { requireServiceAccountJson } from '../helpers.js';
17
+ import { catalog } from '#core/lang.js';
18
+ const M = catalog({
19
+ noBucket: (configPath) => [
20
+ '❌ Play 재무 리포트 버킷을 몰라 — API 로는 알아낼 수 없어.',
21
+ '',
22
+ 'Play Console > 다운로드 보고서 > 재무 화면 아래쪽에 있는',
23
+ ' gs://pubsite_prod_XXXXXXXXXXXXXXXXXXX',
24
+ '이 버킷 이름을 한 번만 저장해 두면 이후 생략할 수 있어:',
25
+ ` ${configPath} 에 {"default": "pubsite_prod_..."}`,
26
+ '패키지마다 다르면 {"<packageName>": "pubsite_prod_..."} 로 키를 나눠도 돼.',
27
+ '또는 이 도구의 bucket 인자로 직접 넘겨.',
28
+ '',
29
+ '⚠️ 접근 권한은 **GCP IAM 이 아니라 Play Console 권한**이다 — 아래 403 안내 참고.',
30
+ ],
31
+ forbidden: [
32
+ '❌ 버킷 접근 거부 (403).',
33
+ '',
34
+ '⚠️ **GCP IAM 으로는 못 고친다.** pubsite_prod_* 버킷은 개발자 프로젝트가 아니라',
35
+ 'Google 소유라, 프로젝트에 roles/storage.* 를 아무리 줘도 닿지 않는다.',
36
+ '접근은 오직 **Play Console 사용자 권한**으로 열린다:',
37
+ '',
38
+ ' Play Console > 사용자 및 권한 > 새 사용자 초대',
39
+ ' → 서비스 계정 이메일(...iam.gserviceaccount.com)을 그대로 초대하고',
40
+ ' → "앱 정보 보기(읽기 전용)" = 전체(Global)',
41
+ ' → "재무 데이터 보기" = **전체(Global)** ← 재무 리포트는 이게 없으면 무조건 403',
42
+ '',
43
+ '반영에 몇 분 걸릴 수 있다. Play Developer API 접근(앱 게시용)과는 별개 권한이라,',
44
+ '릴리스가 잘 돌아간다고 해서 리포트가 열려 있는 것은 아니다.',
45
+ ],
46
+ badYearMonth: 'yearMonth 는 YYYYMM 또는 YYYY-MM 형식이어야 해.',
47
+ noReport: (yearMonth, reportType, files) => [
48
+ `❌ ${yearMonth} 의 ${reportType} 리포트가 버킷에 없어.`,
49
+ '',
50
+ 'Play 재무 리포트는 **월 마감 후에야** 올라온다 — 이번 달 것은 아직 없는 게 정상이다.',
51
+ `버킷에 있는 파일: ${files || '(없음)'}`,
52
+ ],
53
+ notZip: 'ZIP 형식이 아니야 — 재무 리포트 파일이 손상됐을 수 있어.',
54
+ zipMethod: (method) => `지원하지 않는 ZIP 압축 방식(${method})이야.`,
55
+ }, {
56
+ noBucket: (configPath) => [
57
+ '❌ The Play financial report bucket is unknown — the API cannot discover it.',
58
+ '',
59
+ 'At the bottom of Play Console > Download reports > Financial there is',
60
+ ' gs://pubsite_prod_XXXXXXXXXXXXXXXXXXX',
61
+ 'Save this bucket name once and you can omit it afterwards:',
62
+ ` in ${configPath}: {"default": "pubsite_prod_..."}`,
63
+ 'If it differs per package, you can split the keys as {"<packageName>": "pubsite_prod_..."}.',
64
+ 'Or pass it directly in this tool\'s bucket argument.',
65
+ '',
66
+ '⚠️ Access is granted by **Play Console permissions, not GCP IAM** — see the 403 guidance below.',
67
+ ],
68
+ forbidden: [
69
+ '❌ Bucket access denied (403).',
70
+ '',
71
+ '⚠️ **GCP IAM cannot fix this.** pubsite_prod_* buckets are owned by Google, not by the developer',
72
+ 'project, so no amount of roles/storage.* on the project reaches them.',
73
+ 'Access is granted only through **Play Console user permissions**:',
74
+ '',
75
+ ' Play Console > Users and permissions > Invite new users',
76
+ ' → invite the service account email (...iam.gserviceaccount.com) as-is',
77
+ ' → "View app information (read-only)" = Global',
78
+ ' → "View financial data, orders, and cancellation survey responses" = **Global** ← without this, financial reports always return 403',
79
+ '',
80
+ 'It can take a few minutes to apply. It is a separate permission from Play Developer API access (for publishing),',
81
+ 'so releases working does not mean reports are accessible.',
82
+ ],
83
+ badYearMonth: 'yearMonth must be in YYYYMM or YYYY-MM format.',
84
+ noReport: (yearMonth, reportType, files) => [
85
+ `❌ The ${reportType} report for ${yearMonth} is not in the bucket.`,
86
+ '',
87
+ 'Play financial reports appear **only after the month closes** — it is normal that this month\'s report is not there yet.',
88
+ `Files in the bucket: ${files || '(none)'}`,
89
+ ],
90
+ notZip: 'Not a ZIP file — the financial report file may be corrupted.',
91
+ zipMethod: (method) => `Unsupported ZIP compression method (${method}).`,
92
+ });
17
93
  const CONFIG_PATH = path.join(os.homedir(), '.mimi-seed', 'play-financials.json');
18
94
  const STORAGE_SCOPE = 'https://www.googleapis.com/auth/devstorage.read_only';
19
95
  /** 리포트 종류 → 버킷 내 접두사·파일명 규칙. */
@@ -43,18 +119,7 @@ export function resolveBucket(explicit, packageName) {
43
119
  const stored = (packageName && config[packageName]) || config.default || config.bucket;
44
120
  if (stored)
45
121
  return normalizeBucket(stored);
46
- throw new Error([
47
- '❌ Play 재무 리포트 버킷을 몰라 — API 로는 알아낼 수 없어.',
48
- '',
49
- 'Play Console > 다운로드 보고서 > 재무 화면 아래쪽에 있는',
50
- ' gs://pubsite_prod_XXXXXXXXXXXXXXXXXXX',
51
- '이 버킷 이름을 한 번만 저장해 두면 이후 생략할 수 있어:',
52
- ` ${CONFIG_PATH} 에 {"default": "pubsite_prod_..."}`,
53
- '패키지마다 다르면 {"<packageName>": "pubsite_prod_..."} 로 키를 나눠도 돼.',
54
- '또는 이 도구의 bucket 인자로 직접 넘겨.',
55
- '',
56
- '⚠️ 접근 권한은 **GCP IAM 이 아니라 Play Console 권한**이다 — 아래 403 안내 참고.',
57
- ].join('\n'));
122
+ throw new Error(M().noBucket(CONFIG_PATH).join('\n'));
58
123
  }
59
124
  function normalizeBucket(raw) {
60
125
  return raw.replace(/^gs:\/\//, '').replace(/\/+$/, '');
@@ -81,19 +146,7 @@ async function storageFetch(client, url, timeoutMs) {
81
146
  const body = await response.text();
82
147
  if (response.status === 403) {
83
148
  throw new Error([
84
- '❌ 버킷 접근 거부 (403).',
85
- '',
86
- '⚠️ **GCP IAM 으로는 못 고친다.** pubsite_prod_* 버킷은 개발자 프로젝트가 아니라',
87
- 'Google 소유라, 프로젝트에 roles/storage.* 를 아무리 줘도 닿지 않는다.',
88
- '접근은 오직 **Play Console 사용자 권한**으로 열린다:',
89
- '',
90
- ' Play Console > 사용자 및 권한 > 새 사용자 초대',
91
- ' → 서비스 계정 이메일(...iam.gserviceaccount.com)을 그대로 초대하고',
92
- ' → "앱 정보 보기(읽기 전용)" = 전체(Global)',
93
- ' → "재무 데이터 보기" = **전체(Global)** ← 재무 리포트는 이게 없으면 무조건 403',
94
- '',
95
- '반영에 몇 분 걸릴 수 있다. Play Developer API 접근(앱 게시용)과는 별개 권한이라,',
96
- '릴리스가 잘 돌아간다고 해서 리포트가 열려 있는 것은 아니다.',
149
+ ...M().forbidden,
97
150
  '',
98
151
  body.slice(0, 500),
99
152
  ].join('\n'));
@@ -136,7 +189,7 @@ export async function getFinancialReport(options) {
136
189
  const client = storageClient(options.packageName);
137
190
  const yearMonth = options.yearMonth.replace('-', '');
138
191
  if (!/^\d{6}$/.test(yearMonth)) {
139
- throw new Error('yearMonth 는 YYYYMM 또는 YYYY-MM 형식이어야 해.');
192
+ throw new Error(M().badYearMonth);
140
193
  }
141
194
  const { objects } = await listFinancialReports({
142
195
  packageName: options.packageName,
@@ -147,12 +200,7 @@ export async function getFinancialReport(options) {
147
200
  // 파일 하나라고 가정하면 통화 하나만 세고 나머지를 조용히 버리게 된다.
148
201
  const targets = objects.filter((o) => o.name.includes(yearMonth));
149
202
  if (targets.length === 0) {
150
- throw new Error([
151
- `❌ ${yearMonth} 의 ${reportType} 리포트가 버킷에 없어.`,
152
- '',
153
- 'Play 재무 리포트는 **월 마감 후에야** 올라온다 — 이번 달 것은 아직 없는 게 정상이다.',
154
- `버킷에 있는 파일: ${objects.slice(0, 10).map((o) => o.name).join(', ') || '(없음)'}`,
155
- ].join('\n'));
203
+ throw new Error(M().noReport(yearMonth, reportType, objects.slice(0, 10).map((o) => o.name).join(', ')).join('\n'));
156
204
  }
157
205
  const rows = [];
158
206
  for (const target of targets) {
@@ -212,7 +260,7 @@ function summarize(rows) {
212
260
  return { netByMerchantCurrency, byTransactionType, byProduct };
213
261
  }
214
262
  function toNumber(value) {
215
- const n = Number.parseFloat((value ?? '').replace(/[,"]/g, ''));
263
+ const n = Number.parseFloat((value ?? '').replace(/[,\x22]/g, '') /* \x22 = double quote; a literal one trips the i18n scanner */);
216
264
  return Number.isFinite(n) ? n : 0;
217
265
  }
218
266
  /**
@@ -232,7 +280,7 @@ export function unzip(buffer) {
232
280
  }
233
281
  }
234
282
  if (eocd < 0)
235
- throw new Error('ZIP 형식이 아니야 — 재무 리포트 파일이 손상됐을 수 있어.');
283
+ throw new Error(M().notZip);
236
284
  const entryCount = buffer.readUInt16LE(eocd + 10);
237
285
  let offset = buffer.readUInt32LE(eocd + 16);
238
286
  const files = [];
@@ -255,7 +303,7 @@ export function unzip(buffer) {
255
303
  else if (method === 8)
256
304
  files.push(zlib.inflateRawSync(data));
257
305
  else
258
- throw new Error(`지원하지 않는 ZIP 압축 방식(${method})이야.`);
306
+ throw new Error(M().zipMethod(method));
259
307
  offset += 46 + nameLength + extraLength + commentLength;
260
308
  }
261
309
  return files;