@yoonion/mimi-seed-mcp 0.24.0 → 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 (287) 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 +11 -29
  55. package/dist/auth/scopes.js +38 -11
  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.js +10 -2
  115. package/dist/helpers.d.ts +4 -2
  116. package/dist/helpers.js +66 -32
  117. package/dist/i18n/manifest-en.d.ts +6 -0
  118. package/dist/i18n/manifest-en.js +53 -0
  119. package/dist/i18n/tools-en/admob.d.ts +25 -0
  120. package/dist/i18n/tools-en/admob.js +24 -0
  121. package/dist/i18n/tools-en/ai.d.ts +14 -0
  122. package/dist/i18n/tools-en/ai.js +13 -0
  123. package/dist/i18n/tools-en/android.d.ts +14 -0
  124. package/dist/i18n/tools-en/android.js +13 -0
  125. package/dist/i18n/tools-en/appstore.d.ts +240 -0
  126. package/dist/i18n/tools-en/appstore.js +239 -0
  127. package/dist/i18n/tools-en/auth.d.ts +16 -0
  128. package/dist/i18n/tools-en/auth.js +15 -0
  129. package/dist/i18n/tools-en/bigquery.d.ts +16 -0
  130. package/dist/i18n/tools-en/bigquery.js +15 -0
  131. package/dist/i18n/tools-en/billing.d.ts +17 -0
  132. package/dist/i18n/tools-en/billing.js +16 -0
  133. package/dist/i18n/tools-en/checks.d.ts +23 -0
  134. package/dist/i18n/tools-en/checks.js +22 -0
  135. package/dist/i18n/tools-en/ci.d.ts +21 -0
  136. package/dist/i18n/tools-en/ci.js +20 -0
  137. package/dist/i18n/tools-en/drive.d.ts +33 -0
  138. package/dist/i18n/tools-en/drive.js +32 -0
  139. package/dist/i18n/tools-en/facebook.d.ts +14 -0
  140. package/dist/i18n/tools-en/facebook.js +13 -0
  141. package/dist/i18n/tools-en/firebase.d.ts +42 -0
  142. package/dist/i18n/tools-en/firebase.js +41 -0
  143. package/dist/i18n/tools-en/ga4.d.ts +35 -0
  144. package/dist/i18n/tools-en/ga4.js +34 -0
  145. package/dist/i18n/tools-en/googleads.d.ts +15 -0
  146. package/dist/i18n/tools-en/googleads.js +14 -0
  147. package/dist/i18n/tools-en/gsc.d.ts +27 -0
  148. package/dist/i18n/tools-en/gsc.js +26 -0
  149. package/dist/i18n/tools-en/iam.d.ts +15 -0
  150. package/dist/i18n/tools-en/iam.js +14 -0
  151. package/dist/i18n/tools-en/index.d.ts +7 -0
  152. package/dist/i18n/tools-en/index.js +58 -0
  153. package/dist/i18n/tools-en/instagram.d.ts +16 -0
  154. package/dist/i18n/tools-en/instagram.js +15 -0
  155. package/dist/i18n/tools-en/jenkins.d.ts +41 -0
  156. package/dist/i18n/tools-en/jenkins.js +40 -0
  157. package/dist/i18n/tools-en/naver.d.ts +10 -0
  158. package/dist/i18n/tools-en/naver.js +9 -0
  159. package/dist/i18n/tools-en/playstore.d.ts +148 -0
  160. package/dist/i18n/tools-en/playstore.js +147 -0
  161. package/dist/i18n/tools-en/registrar.d.ts +6 -0
  162. package/dist/i18n/tools-en/registrar.js +6 -0
  163. package/dist/i18n/tools-en/threads.d.ts +21 -0
  164. package/dist/i18n/tools-en/threads.js +20 -0
  165. package/dist/i18n/tools-en/tiktok.d.ts +21 -0
  166. package/dist/i18n/tools-en/tiktok.js +20 -0
  167. package/dist/i18n/tools-en/video.d.ts +59 -0
  168. package/dist/i18n/tools-en/video.js +58 -0
  169. package/dist/i18n/tools-en/youtube.d.ts +44 -0
  170. package/dist/i18n/tools-en/youtube.js +43 -0
  171. package/dist/iam/key-files.js +13 -3
  172. package/dist/instagram/api.js +19 -5
  173. package/dist/instagram/config.js +11 -3
  174. package/dist/instagram/setup.js +37 -11
  175. package/dist/jenkins/builds.d.ts +2 -2
  176. package/dist/jenkins/builds.js +70 -30
  177. package/dist/jenkins/config.d.ts +5 -0
  178. package/dist/jenkins/config.js +25 -6
  179. package/dist/jenkins/credentials.js +33 -13
  180. package/dist/jenkins/http.js +6 -3
  181. package/dist/jenkins/jobs.js +19 -5
  182. package/dist/jenkins/messages.js +93 -36
  183. package/dist/lib/cli-args.js +13 -7
  184. package/dist/lib/google-errors.js +31 -9
  185. package/dist/lib/http.js +10 -3
  186. package/dist/lib/json-file.d.ts +15 -0
  187. package/dist/lib/json-file.js +65 -0
  188. package/dist/lib/meta-auth.d.ts +1 -1
  189. package/dist/lib/meta-auth.js +26 -8
  190. package/dist/lib/package-name.js +15 -4
  191. package/dist/lib/package-root.js +1 -1
  192. package/dist/lib/paginate.js +10 -2
  193. package/dist/lib/path-containment.js +22 -6
  194. package/dist/lib/resource-id.js +10 -3
  195. package/dist/lib/store-create-result.js +54 -13
  196. package/dist/lib/text-validators.js +20 -5
  197. package/dist/lib/tool-registrar.d.ts +9 -0
  198. package/dist/lib/tool-registrar.js +33 -14
  199. package/dist/lib/tool-text.d.ts +31 -0
  200. package/dist/lib/tool-text.js +52 -0
  201. package/dist/lib/toolsets.js +13 -3
  202. package/dist/lib/url-path.js +3 -1
  203. package/dist/naver/tools.js +138 -46
  204. package/dist/playstore/data-safety.js +16 -4
  205. package/dist/playstore/errors.js +33 -8
  206. package/dist/playstore/financials.js +83 -35
  207. package/dist/playstore/listing.js +7 -1
  208. package/dist/playstore/messages.js +179 -57
  209. package/dist/playstore/products.js +10 -2
  210. package/dist/playstore/recovery.js +10 -2
  211. package/dist/playstore/releases.js +34 -14
  212. package/dist/playstore/reviews.js +14 -4
  213. package/dist/playstore/statistics.js +3 -1
  214. package/dist/prompts.js +160 -50
  215. package/dist/registers/admob.js +36 -11
  216. package/dist/registers/android.js +25 -9
  217. package/dist/registers/appstore/apps.js +22 -6
  218. package/dist/registers/appstore/customer-reviews.js +7 -1
  219. package/dist/registers/appstore/declarations.js +63 -19
  220. package/dist/registers/appstore/media.js +76 -24
  221. package/dist/registers/appstore/metadata.js +26 -8
  222. package/dist/registers/appstore/products.js +53 -19
  223. package/dist/registers/appstore/review-submission.js +31 -9
  224. package/dist/registers/appstore/testflight.js +82 -24
  225. package/dist/registers/appstore/versions.js +88 -30
  226. package/dist/registers/auth.js +343 -90
  227. package/dist/registers/bigquery.js +54 -14
  228. package/dist/registers/billing.js +18 -4
  229. package/dist/registers/checks.js +20 -5
  230. package/dist/registers/ci.js +60 -20
  231. package/dist/registers/drive.js +18 -7
  232. package/dist/registers/facebook.js +31 -9
  233. package/dist/registers/firebase.js +21 -7
  234. package/dist/registers/googleads.js +23 -6
  235. package/dist/registers/gsc.js +3 -1
  236. package/dist/registers/iam.js +44 -13
  237. package/dist/registers/instagram.js +19 -5
  238. package/dist/registers/jenkins.js +43 -14
  239. package/dist/registers/naver.js +13 -3
  240. package/dist/registers/playstore/financials.d.ts +6 -0
  241. package/dist/registers/playstore/financials.js +48 -0
  242. package/dist/registers/playstore/listing.d.ts +15 -0
  243. package/dist/registers/playstore/listing.js +138 -0
  244. package/dist/registers/playstore/media.d.ts +6 -0
  245. package/dist/registers/playstore/media.js +56 -0
  246. package/dist/registers/playstore/products.d.ts +21 -0
  247. package/dist/registers/playstore/products.js +238 -0
  248. package/dist/registers/playstore/recovery.d.ts +11 -0
  249. package/dist/registers/playstore/recovery.js +105 -0
  250. package/dist/registers/playstore/releases.d.ts +8 -0
  251. package/dist/registers/playstore/releases.js +157 -0
  252. package/dist/registers/playstore/reviews.d.ts +6 -0
  253. package/dist/registers/playstore/reviews.js +43 -0
  254. package/dist/registers/playstore/service-accounts.d.ts +13 -0
  255. package/dist/registers/playstore/service-accounts.js +127 -0
  256. package/dist/registers/playstore/shared.d.ts +12 -0
  257. package/dist/registers/playstore/shared.js +24 -0
  258. package/dist/registers/playstore.d.ts +8 -0
  259. package/dist/registers/playstore.js +28 -734
  260. package/dist/registers/threads.js +28 -8
  261. package/dist/registers/tiktok.js +4 -2
  262. package/dist/registers/video.js +3 -1
  263. package/dist/remote-sync.js +80 -28
  264. package/dist/resources.d.ts +0 -8
  265. package/dist/resources.js +73 -32
  266. package/dist/server.d.ts +2 -0
  267. package/dist/server.js +9 -1
  268. package/dist/social/profile-store.js +36 -12
  269. package/dist/social/setup-cli.js +1 -1
  270. package/dist/threads/api.js +23 -6
  271. package/dist/threads/setup.js +42 -14
  272. package/dist/tiktok-business/api.js +13 -3
  273. package/dist/tiktok-business/auth.js +10 -2
  274. package/dist/tiktok-business/config.js +8 -3
  275. package/dist/tiktok-business/posting.d.ts +6 -0
  276. package/dist/tiktok-business/posting.js +118 -36
  277. package/dist/tiktok-business/setup-cli.js +3 -1
  278. package/dist/tools-cli.js +4 -5
  279. package/dist/video/captions.js +3 -1
  280. package/dist/video/files.js +13 -3
  281. package/dist/video/project.js +65 -21
  282. package/dist/video/providers.js +52 -16
  283. package/dist/video/render.js +71 -22
  284. package/dist/video/research.js +10 -2
  285. package/dist/video/schemas.js +19 -5
  286. package/dist/video/youtube-publish.js +62 -32
  287. package/package.json +1 -1
@@ -3,16 +3,7 @@
3
3
  import path from 'node:path';
4
4
  import { isGenericCredentialPrefix } from '../jenkins/messages.js';
5
5
  import { KEYSTORE_FILE, SIGNING_SECRETS_FILE } from './keystore-store.js';
6
- /** 기본 id 접두사가 흔한 이름이면 계획 맨 앞에 붙이는 경고 (없으면 빈 배열). */
7
- function genericPrefixWarning(packageName, prefix) {
8
- if (!isGenericCredentialPrefix(prefix))
9
- return [];
10
- return [
11
- `⚠️ 아래 기본 credential id 접두사 "${prefix}" 는 ${packageName} 의 마지막 세그먼트만으로 만든 흔한 이름이라 ` +
12
- '같은 Jenkins 의 다른 앱 credential 과 겹칠 수 있다. 기존 id 라는 dry-run 이 나오면 설명을 확인하고, 필요하면 고유한 id 를 쓰세요.',
13
- '',
14
- ];
15
- }
6
+ import { catalog } from '#core/lang.js';
16
7
  /** keystore·비밀번호 **파일 경로**로 Jenkins 에 등록하는 네 단계 (start 번부터). */
17
8
  function pathRegistrationSteps(prefix, keystorePath, secretsPath, start) {
18
9
  return [
@@ -22,17 +13,10 @@ function pathRegistrationSteps(prefix, keystorePath, secretsPath, start) {
22
13
  ` ${start + 3}. jenkins_create_credential(id="${prefix}-android-key-password", secret_file="${secretsPath}", secret_field="keyPassword")`,
23
14
  ];
24
15
  }
25
- /**
26
- * android_signing_setup — Play Console 에 이미 있는 앱. 기존 keystore 를 받아 등록하는 순서.
27
- *
28
- * 비밀값(keystore 바이트·비밀번호)을 대화에 싣지 않는다 — 사용자가 keystore 를 `keystoreDir` 로 복사하고
29
- * 비밀번호를 그 폴더의 signing.json 에 적게 한 뒤, Jenkins 도구에는 경로만 넘긴다
30
- * (jenkins_upload_keystore.keystore_path, jenkins_create_credential.secret_file + secret_field).
31
- */
32
- export function existingAppSigningPlanLines(packageName, prefix, jenkinsStatus, keystoreDir) {
33
- const keystorePath = path.join(keystoreDir, KEYSTORE_FILE);
34
- const secretsPath = path.join(keystoreDir, SIGNING_SECRETS_FILE);
35
- return [
16
+ const M = catalog({
17
+ genericPrefix: (packageName, prefix) => `⚠️ 아래 기본 credential id 접두사 "${prefix}" 는 ${packageName} 의 마지막 세그먼트만으로 만든 흔한 이름이라 ` +
18
+ '같은 Jenkins 의 다른 앱 credential 과 겹칠 수 있다. 기존 id 라는 dry-run 이 나오면 설명을 확인하고, 필요하면 고유한 id 를 쓰세요.',
19
+ existingApp: (packageName, prefix, jenkinsStatus, keystoreDir, keystorePath, secretsPath, warning) => [
36
20
  `📦 ${packageName} — **기존 앱** (Play Console에 이미 존재)`,
37
21
  '',
38
22
  '기존 upload keystore와 비밀번호가 있어야 합니다.',
@@ -40,7 +24,7 @@ export function existingAppSigningPlanLines(packageName, prefix, jenkinsStatus,
40
24
  '',
41
25
  `Jenkins: ${jenkinsStatus}`,
42
26
  '',
43
- ...genericPrefixWarning(packageName, prefix),
27
+ ...warning,
44
28
  '── 준비 (사용자가 직접 — 비밀번호·keystore 를 대화에 붙여넣지 않는다) ──',
45
29
  ` 1. 폴더를 만든다: ${keystoreDir}`,
46
30
  ` 2. 기존 upload keystore 를 복사한다 → ${keystorePath} (.jks / .keystore / .p12)`,
@@ -55,43 +39,33 @@ export function existingAppSigningPlanLines(packageName, prefix, jenkinsStatus,
55
39
  ` └ SA JSON이 없으면 먼저: setup_playstore_connection(packageName="${packageName}", projectId="...")`,
56
40
  '',
57
41
  '사용자가 비밀번호를 채팅에 적었다면 secret 파라미터로 옮기지 말고, 위 signing.json 에 저장하도록 안내하세요.',
58
- ];
59
- }
60
- /** android_signing_setup — 신규 앱(또는 Play Console 확인 불가). keystore 생성부터의 순서. */
61
- export function newAppSigningPlanLines(opts) {
62
- const { packageName, prefix, appStatus, playNote, jenkinsStatus, jenkinsConfigured, keytoolOk, projectId, keystoreDir } = opts;
63
- const keystorePath = path.join(keystoreDir, KEYSTORE_FILE);
64
- const secretsPath = path.join(keystoreDir, SIGNING_SECRETS_FILE);
65
- const appLabel = appStatus === 'new' ? '**신규 앱**' : '**신규 앱으로 처리** (Play Console 확인 불가)';
66
- return [
67
- `📦 ${packageName} — ${appLabel}`,
68
- playNote ? ` ${playNote}` : '',
42
+ ],
43
+ newApp: (o, keystorePath, secretsPath, warning) => [
44
+ `📦 ${o.packageName} — ${o.appStatus === 'new' ? '**신규 앱**' : '**신규 앱으로 처리** (Play Console 확인 불가)'}`,
45
+ o.playNote ? ` ${o.playNote}` : '',
69
46
  '',
70
- ...genericPrefixWarning(packageName, prefix),
71
- `Jenkins: ${jenkinsStatus}`,
72
- `keytool(Java JDK): ${keytoolOk ? '✅ 설치됨 — 자동 생성 가능' : '❌ 미설치 — android_generate_keystore 호출 불가, 수동 생성 필요'}`,
47
+ ...warning,
48
+ `Jenkins: ${o.jenkinsStatus}`,
49
+ `keytool(Java JDK): ${o.keytoolOk ? '✅ 설치됨 — 자동 생성 가능' : '❌ 미설치 — android_generate_keystore 호출 불가, 수동 생성 필요'}`,
73
50
  '',
74
51
  '── 신규 앱 설정 순서 ─────────────────────────────',
75
- jenkinsConfigured ? '' : ' 0. jenkins_status → jenkins_save_config (Jenkins 먼저 설정)',
76
- keytoolOk
77
- ? ` 1. android_generate_keystore(app_name="${prefix}") → keystore + 비밀번호를 ~/.mimi-seed/keystores/ 에 파일로 생성`
52
+ o.jenkinsConfigured ? '' : ' 0. jenkins_status → jenkins_save_config (Jenkins 먼저 설정)',
53
+ o.keytoolOk
54
+ ? ` 1. android_generate_keystore(app_name="${o.prefix}") → keystore + 비밀번호를 ~/.mimi-seed/keystores/ 에 파일로 생성`
78
55
  : ` 1. ⚠️ 사용자가 직접 keytool -genkeypair 로 만든 keystore 를 ${keystorePath} 에, 비밀번호를 ${secretsPath} ({"storePassword","keyAlias","keyPassword"}) 에 저장 — 대화에 붙여넣지 않는다`,
79
- ...(keytoolOk
80
- ? [` 2~5. android_generate_keystore 응답의 경로로 jenkins_upload_keystore(keystore_path=…) + jenkins_create_credential(secret_file=…, secret_field=storePassword|keyAlias|keyPassword) — id 는 "${prefix}-android-keystore" / "-store-password" / "-key-alias" / "-key-password"`]
81
- : pathRegistrationSteps(prefix, keystorePath, secretsPath, 2)),
82
- projectId
83
- ? ` 6. setup_playstore_connection(packageName="${packageName}", projectId="${projectId}")`
84
- : ` 6. setup_playstore_connection(packageName="${packageName}", projectId="<GCP 프로젝트 ID>")`,
56
+ ...(o.keytoolOk
57
+ ? [` 2~5. android_generate_keystore 응답의 경로로 jenkins_upload_keystore(keystore_path=…) + jenkins_create_credential(secret_file=…, secret_field=storePassword|keyAlias|keyPassword) — id 는 "${o.prefix}-android-keystore" / "-store-password" / "-key-alias" / "-key-password"`]
58
+ : pathRegistrationSteps(o.prefix, keystorePath, secretsPath, 2)),
59
+ o.projectId
60
+ ? ` 6. setup_playstore_connection(packageName="${o.packageName}", projectId="${o.projectId}")`
61
+ : ` 6. setup_playstore_connection(packageName="${o.packageName}", projectId="<GCP 프로젝트 ID>")`,
85
62
  ' └ GCP 프로젝트 ID를 모르면 사용자에게 확인하세요.',
86
- ` 7. jenkins_upload_playstore_sa(package_name="${packageName}", credential_id="${prefix}-playstore-sa")`,
63
+ ` 7. jenkins_upload_playstore_sa(package_name="${o.packageName}", credential_id="${o.prefix}-playstore-sa")`,
87
64
  ' 8. Play Console에서 서비스 계정 초대 (수동, 1회)',
88
65
  ' → Play Console → 사용자 및 권한 → SA 이메일 → 릴리즈 관리자 권한 부여',
89
66
  ' 9. 첫 AAB 빌드 후 Play Console에 내부 테스트용으로 수동 업로드 (신규 앱 첫 번째만)',
90
- ];
91
- }
92
- /** android_generate_keystore — keytool 이 없을 때 설치 안내. */
93
- export function keytoolMissingLines() {
94
- return [
67
+ ],
68
+ keytoolMissing: [
95
69
  '❌ keytool이 설치되지 않았습니다.',
96
70
  '',
97
71
  'Java JDK를 설치하면 keytool이 포함됩니다:',
@@ -100,11 +74,8 @@ export function keytoolMissingLines() {
100
74
  ' Windows: https://adoptium.net/',
101
75
  '',
102
76
  '설치 후 다시 android_generate_keystore를 호출하세요.',
103
- ];
104
- }
105
- /** android_generate_keystore — 생성 완료. 비밀값은 싣지 않고 경로만 넘긴다. */
106
- export function keystoreGeneratedLines(prefix, saved) {
107
- return [
77
+ ],
78
+ keystoreGenerated: (saved) => [
108
79
  '✅ Android upload keystore 생성 완료 — 비밀번호와 keystore 는 파일로만 저장했습니다 (응답에 싣지 않음).',
109
80
  '',
110
81
  `keystore: ${saved.keystorePath} (0600)`,
@@ -114,26 +85,14 @@ export function keystoreGeneratedLines(prefix, saved) {
114
85
  '🔒 분실하면 앱 서명을 영구히 잃습니다. 위 폴더를 비밀번호 관리자 등 안전한 곳에 백업하세요.',
115
86
  '',
116
87
  '── 다음 단계 — 값을 복사하지 말고 경로를 넘기세요 ──',
117
- ` jenkins_upload_keystore(id="${prefix}-android-keystore", keystore_path="${saved.keystorePath}", file_name="upload.jks")`,
118
- ` jenkins_create_credential(id="${prefix}-android-store-password", secret_file="${saved.secretsPath}", secret_field="storePassword")`,
119
- ` jenkins_create_credential(id="${prefix}-android-key-alias", secret_file="${saved.secretsPath}", secret_field="keyAlias")`,
120
- ` jenkins_create_credential(id="${prefix}-android-key-password", secret_file="${saved.secretsPath}", secret_field="keyPassword")`,
121
- ];
122
- }
123
- /** jenkins_upload_playstore_sa — 패키지별 SA 파일이 아직 없을 때. */
124
- export function playServiceAccountMissingLines(packageName, saPath) {
125
- return [
88
+ ],
89
+ saMissing: (packageName, saPath) => [
126
90
  `❌ ${packageName} 서비스 계정 JSON이 없습니다.`,
127
91
  ` 경로: ${saPath}`,
128
92
  '',
129
93
  '먼저 setup_playstore_connection을 호출해 서비스 계정을 생성하세요.',
130
- ];
131
- }
132
- /** jenkins_upload_playstore_sa — 업로드 완료 + Play Console 권한 부여(수동 1회) 안내. */
133
- export function playServiceAccountUploadedLines(opts) {
134
- const { result, credentialId, clientEmail, rawLength } = opts;
135
- return [
136
- `✅ Play Store SA JSON → Jenkins ${result}: \`${credentialId}\``,
94
+ ],
95
+ saUploaded: (clientEmail, rawLength) => [
137
96
  ` 서비스 계정: ${clientEmail}`,
138
97
  ` 파일 크기: ${rawLength}자`,
139
98
  '',
@@ -141,5 +100,140 @@ export function playServiceAccountUploadedLines(opts) {
141
100
  ' Play Console → 설정 → 사용자 및 권한 → 서비스 계정에서',
142
101
  ` ${clientEmail} 를 찾아 "릴리즈 관리자" 권한을 부여하세요.`,
143
102
  ' (수동 1회 작업)',
103
+ ],
104
+ }, {
105
+ genericPrefix: (packageName, prefix) => `⚠️ The default credential id prefix "${prefix}" below is a common name built only from the last segment of ${packageName}, ` +
106
+ 'so it can collide with another app\'s credentials in the same Jenkins. If a dry-run says the id already exists, check its description and use a unique id if needed.',
107
+ existingApp: (packageName, prefix, jenkinsStatus, keystoreDir, keystorePath, secretsPath, warning) => [
108
+ `📦 ${packageName} — **existing app** (already in Play Console)`,
109
+ '',
110
+ 'You need the existing upload keystore and its passwords.',
111
+ 'If they are lost, register it again as a new app or migrate to Play App Signing.',
112
+ '',
113
+ `Jenkins: ${jenkinsStatus}`,
114
+ '',
115
+ ...warning,
116
+ '── Preparation (done by the user — do not paste passwords or the keystore into the conversation) ──',
117
+ ` 1. Create the folder: ${keystoreDir}`,
118
+ ` 2. Copy the existing upload keystore → ${keystorePath} (.jks / .keystore / .p12)`,
119
+ ` 3. Create a password file in the same folder → ${secretsPath}`,
120
+ ' Contents: {"storePassword": "…", "keyAlias": "…", "keyPassword": "…"}',
121
+ ' 4. Make both files readable only by you (macOS/Linux: chmod 600)',
122
+ ' 5. If there is no Play Store SA JSON, create one with setup_playstore_connection',
123
+ '',
124
+ '── Registration order (pass paths, not values) ────────────',
125
+ ...pathRegistrationSteps(prefix, keystorePath, secretsPath, 1),
126
+ ` 5. jenkins_upload_playstore_sa(package_name="${packageName}", credential_id="${prefix}-playstore-sa")`,
127
+ ` └ If there is no SA JSON, first: setup_playstore_connection(packageName="${packageName}", projectId="...")`,
128
+ '',
129
+ 'If the user typed a password in the chat, do not move it into the secret parameter; tell them to save it in the signing.json above.',
130
+ ],
131
+ newApp: (o, keystorePath, secretsPath, warning) => [
132
+ `📦 ${o.packageName} — ${o.appStatus === 'new' ? '**new app**' : '**treated as a new app** (could not check Play Console)'}`,
133
+ o.playNote ? ` ${o.playNote}` : '',
134
+ '',
135
+ ...warning,
136
+ `Jenkins: ${o.jenkinsStatus}`,
137
+ `keytool(Java JDK): ${o.keytoolOk ? '✅ installed — can generate automatically' : '❌ not installed — android_generate_keystore cannot be called; create it manually'}`,
138
+ '',
139
+ '── New app setup order ─────────────────────────────',
140
+ o.jenkinsConfigured ? '' : ' 0. jenkins_status → jenkins_save_config (configure Jenkins first)',
141
+ o.keytoolOk
142
+ ? ` 1. android_generate_keystore(app_name="${o.prefix}") → creates the keystore + passwords as files in ~/.mimi-seed/keystores/`
143
+ : ` 1. ⚠️ The user saves a keystore they created with keytool -genkeypair to ${keystorePath} and the passwords to ${secretsPath} ({"storePassword","keyAlias","keyPassword"}) — do not paste them into the conversation`,
144
+ ...(o.keytoolOk
145
+ ? [` 2~5. With the paths from the android_generate_keystore response: jenkins_upload_keystore(keystore_path=…) + jenkins_create_credential(secret_file=…, secret_field=storePassword|keyAlias|keyPassword) — ids "${o.prefix}-android-keystore" / "-store-password" / "-key-alias" / "-key-password"`]
146
+ : pathRegistrationSteps(o.prefix, keystorePath, secretsPath, 2)),
147
+ o.projectId
148
+ ? ` 6. setup_playstore_connection(packageName="${o.packageName}", projectId="${o.projectId}")`
149
+ : ` 6. setup_playstore_connection(packageName="${o.packageName}", projectId="<GCP project ID>")`,
150
+ ' └ If you do not know the GCP project ID, ask the user.',
151
+ ` 7. jenkins_upload_playstore_sa(package_name="${o.packageName}", credential_id="${o.prefix}-playstore-sa")`,
152
+ ' 8. Invite the service account in Play Console (manual, once)',
153
+ ' → Play Console → Users and permissions → SA email → grant Release manager permission',
154
+ ' 9. After the first AAB build, upload it manually to Play Console for internal testing (first release of a new app only)',
155
+ ],
156
+ keytoolMissing: [
157
+ '❌ keytool is not installed.',
158
+ '',
159
+ 'Installing a Java JDK includes keytool:',
160
+ ' macOS: brew install openjdk',
161
+ ' Ubuntu: sudo apt install default-jdk',
162
+ ' Windows: https://adoptium.net/',
163
+ '',
164
+ 'After installing, call android_generate_keystore again.',
165
+ ],
166
+ keystoreGenerated: (saved) => [
167
+ '✅ Android upload keystore created — the passwords and keystore are saved only to files (not in this response).',
168
+ '',
169
+ `keystore: ${saved.keystorePath} (0600)`,
170
+ `password file: ${saved.secretsPath} (0600 — keyAlias / storePassword / keyPassword)`,
171
+ `keyAlias: ${saved.keyAlias}`,
172
+ '',
173
+ '🔒 If lost, the app signing is lost permanently. Back up the folder above somewhere safe, such as a password manager.',
174
+ '',
175
+ '── Next steps — pass the paths, do not copy the values ──',
176
+ ],
177
+ saMissing: (packageName, saPath) => [
178
+ `❌ No service account JSON for ${packageName}.`,
179
+ ` Path: ${saPath}`,
180
+ '',
181
+ 'Call setup_playstore_connection first to create the service account.',
182
+ ],
183
+ saUploaded: (clientEmail, rawLength) => [
184
+ ` Service account: ${clientEmail}`,
185
+ ` File size: ${rawLength} chars`,
186
+ '',
187
+ 'Next step:',
188
+ ' In Play Console → Settings → Users and permissions → service accounts,',
189
+ ` find ${clientEmail} and grant it the "Release manager" permission.`,
190
+ ' (manual, one time)',
191
+ ],
192
+ });
193
+ /** 기본 id 접두사가 흔한 이름이면 계획 맨 앞에 붙이는 경고 (없으면 빈 배열). */
194
+ function genericPrefixWarning(packageName, prefix) {
195
+ if (!isGenericCredentialPrefix(prefix))
196
+ return [];
197
+ return [M().genericPrefix(packageName, prefix), ''];
198
+ }
199
+ /**
200
+ * android_signing_setup — Play Console 에 이미 있는 앱. 기존 keystore 를 받아 등록하는 순서.
201
+ *
202
+ * 비밀값(keystore 바이트·비밀번호)을 대화에 싣지 않는다 — 사용자가 keystore 를 `keystoreDir` 로 복사하고
203
+ * 비밀번호를 그 폴더의 signing.json 에 적게 한 뒤, Jenkins 도구에는 경로만 넘긴다
204
+ * (jenkins_upload_keystore.keystore_path, jenkins_create_credential.secret_file + secret_field).
205
+ */
206
+ export function existingAppSigningPlanLines(packageName, prefix, jenkinsStatus, keystoreDir) {
207
+ const keystorePath = path.join(keystoreDir, KEYSTORE_FILE);
208
+ const secretsPath = path.join(keystoreDir, SIGNING_SECRETS_FILE);
209
+ return M().existingApp(packageName, prefix, jenkinsStatus, keystoreDir, keystorePath, secretsPath, genericPrefixWarning(packageName, prefix));
210
+ }
211
+ /** android_signing_setup — 신규 앱(또는 Play Console 확인 불가). keystore 생성부터의 순서. */
212
+ export function newAppSigningPlanLines(opts) {
213
+ const keystorePath = path.join(opts.keystoreDir, KEYSTORE_FILE);
214
+ const secretsPath = path.join(opts.keystoreDir, SIGNING_SECRETS_FILE);
215
+ return M().newApp(opts, keystorePath, secretsPath, genericPrefixWarning(opts.packageName, opts.prefix));
216
+ }
217
+ /** android_generate_keystore — keytool 이 없을 때 설치 안내. */
218
+ export function keytoolMissingLines() {
219
+ return [...M().keytoolMissing];
220
+ }
221
+ /** android_generate_keystore — 생성 완료. 비밀값은 싣지 않고 경로만 넘긴다. */
222
+ export function keystoreGeneratedLines(prefix, saved) {
223
+ return [
224
+ ...M().keystoreGenerated(saved),
225
+ ` jenkins_upload_keystore(id="${prefix}-android-keystore", keystore_path="${saved.keystorePath}", file_name="upload.jks")`,
226
+ ` jenkins_create_credential(id="${prefix}-android-store-password", secret_file="${saved.secretsPath}", secret_field="storePassword")`,
227
+ ` jenkins_create_credential(id="${prefix}-android-key-alias", secret_file="${saved.secretsPath}", secret_field="keyAlias")`,
228
+ ` jenkins_create_credential(id="${prefix}-android-key-password", secret_file="${saved.secretsPath}", secret_field="keyPassword")`,
144
229
  ];
145
230
  }
231
+ /** jenkins_upload_playstore_sa — 패키지별 SA 파일이 아직 없을 때. */
232
+ export function playServiceAccountMissingLines(packageName, saPath) {
233
+ return M().saMissing(packageName, saPath);
234
+ }
235
+ /** jenkins_upload_playstore_sa — 업로드 완료 + Play Console 권한 부여(수동 1회) 안내. */
236
+ export function playServiceAccountUploadedLines(opts) {
237
+ const { result, credentialId, clientEmail, rawLength } = opts;
238
+ return [`✅ Play Store SA JSON → Jenkins ${result}: \`${credentialId}\``, ...M().saUploaded(clientEmail, rawLength)];
239
+ }
@@ -1,12 +1,15 @@
1
- import { existsSync, readFileSync } from 'node:fs';
1
+ import { existsSync } from 'node:fs';
2
2
  import { serviceAccountPathForPackage } from '../auth/playstore-auth.js';
3
3
  import { readServiceAccountKeyFile } from '../iam/key-files.js';
4
+ import { catalog } from '#core/lang.js';
5
+ import { readCredentialFileSync } from '#core/credential-read.js';
6
+ const M = catalog({ parseFailed: '(파싱 실패)' }, { parseFailed: '(parse failed)' });
4
7
  export function loadPlayServiceAccountForUpload(packageName, explicitPath) {
5
8
  const saPath = explicitPath ?? serviceAccountPathForPackage(packageName);
6
9
  if (!explicitPath && !existsSync(saPath))
7
10
  return { found: false, path: saPath };
8
- const raw = explicitPath ? readServiceAccountKeyFile(explicitPath) : readFileSync(saPath, 'utf-8');
9
- let clientEmail = '(파싱 실패)';
11
+ const raw = explicitPath ? readServiceAccountKeyFile(explicitPath) : readCredentialFileSync(saPath);
12
+ let clientEmail = M().parseFailed;
10
13
  try {
11
14
  clientEmail = JSON.parse(raw).client_email ?? clientEmail;
12
15
  }
@@ -5,6 +5,38 @@ import { V1_BASE, apiRequest, authHeadersOrThrow } from './http.js';
5
5
  import { fetchWithTimeout, HTTP_TRANSFER_TIMEOUT_MS } from '../lib/http.js';
6
6
  import { parseTsv } from './sales.js';
7
7
  import { encodePathSegment } from '../lib/url-path.js';
8
+ import { catalog } from '#core/lang.js';
9
+ const M = catalog({
10
+ needKey: 'App Store Connect reportsKey 또는 기본 API 키가 필요합니다.',
11
+ collecting: 'Analytics 주간 데이터가 두 기간 이상 쌓인 뒤 다시 실행하세요.',
12
+ pageDecline: '제품 페이지 진입률이 하락했습니다. 아이콘·스크린샷 첫 장·부제 중 하나를 바꿔 Product Page Optimization 테스트를 시작하세요.',
13
+ pageHealthy: '핵심 전환 지표의 주간 하락은 없습니다. 가장 개선 폭이 작은 제품 페이지 진입률을 다음 실험 대상으로 삼으세요.',
14
+ acqDecline: '제품 페이지 조회 대비 다운로드 전환이 하락했습니다. 유입 소스별 전환을 나누고 가장 큰 하락 소스에 맞춘 커스텀 제품 페이지를 만드세요.',
15
+ acqHealthy: '핵심 전환 지표의 주간 하락은 없습니다. 가장 개선 폭이 작은 다운로드 전환을 유입 소스별로 나눠 다음 실험을 정하세요.',
16
+ monDecline: '다운로드당 수익이 하락했습니다. 구매 리포트에서 상품별 하락을 확인하고 가격·오퍼·구독 전환 중 한 가지를 실험하세요.',
17
+ monHealthy: '핵심 전환 지표의 주간 하락은 없습니다. 가장 개선 폭이 작은 다운로드당 수익을 상품별로 나눠 다음 가격·오퍼 실험을 정하세요.',
18
+ dataQuality: '비교 가능한 분모 데이터가 부족합니다. Engagement·주간 Downloads Detailed·Purchases 리포트가 생성되는지 확인하세요.',
19
+ noRequest: 'ONGOING Analytics report request가 없습니다.',
20
+ noRequestNext: 'createIfMissing=true와 confirmCreate=true로 다시 호출하세요.',
21
+ confirmCreate: 'Analytics report request 생성은 App Store Connect에 지속 리소스를 만듭니다.',
22
+ created: 'ONGOING Analytics report request를 만들었습니다. 최초 데이터는 보통 24~48시간 뒤 생성됩니다.',
23
+ noReports: '요청은 활성 상태지만 주간 Engagement·Downloads·Purchases 리포트가 아직 생성되지 않았습니다.',
24
+ }, {
25
+ needKey: 'An App Store Connect reportsKey or the default API key is required.',
26
+ collecting: 'Run again after at least two weeks of Analytics data have accumulated.',
27
+ pageDecline: 'The product page view rate dropped. Change one of the icon, first screenshot, or subtitle and start a Product Page Optimization test.',
28
+ pageHealthy: 'No weekly drop in the key conversion metrics. Make the product page view rate, which improved least, the next experiment target.',
29
+ acqDecline: 'Download conversion from product page views dropped. Split conversion by traffic source and create a custom product page for the source with the largest drop.',
30
+ acqHealthy: 'No weekly drop in the key conversion metrics. Split download conversion, which improved least, by traffic source to choose the next experiment.',
31
+ monDecline: 'Proceeds per download dropped. Check the per-product drop in the purchase report and experiment with one of price, offer, or subscription conversion.',
32
+ monHealthy: 'No weekly drop in the key conversion metrics. Split proceeds per download, which improved least, by product to choose the next price or offer experiment.',
33
+ dataQuality: 'Not enough comparable denominator data. Check that the Engagement, weekly Downloads Detailed, and Purchases reports are being generated.',
34
+ noRequest: 'There is no ONGOING Analytics report request.',
35
+ noRequestNext: 'Call again with createIfMissing=true and confirmCreate=true.',
36
+ confirmCreate: 'Creating an Analytics report request creates a persistent resource in App Store Connect.',
37
+ created: 'Created an ONGOING Analytics report request. The first data is usually generated in 24–48 hours.',
38
+ noReports: 'The request is active, but the weekly Engagement, Downloads, and Purchases reports have not been generated yet.',
39
+ });
8
40
  export function selectWeeklyAnalyticsReports(reports) {
9
41
  const standard = reports.filter((row) => !/Detailed/i.test(row.attributes?.name ?? ''));
10
42
  const detailed = reports.filter((row) => /Detailed/i.test(row.attributes?.name ?? ''));
@@ -23,7 +55,7 @@ const MAX_WEEKLY_INSTANCES = 8;
23
55
  async function reportHeaders() {
24
56
  const auth = await getReportsAuthHeaders();
25
57
  if (!auth)
26
- throw new Error('App Store Connect reportsKey 또는 기본 API 키가 필요합니다.');
58
+ throw new Error(M().needKey);
27
59
  return auth.headers;
28
60
  }
29
61
  async function reportGet(path, params) {
@@ -192,7 +224,7 @@ export function buildWeeklyInsight(input) {
192
224
  return {
193
225
  status: 'collecting',
194
226
  weeks: ordered,
195
- recommendation: 'Analytics 주간 데이터가 두 기간 이상 쌓인 뒤 다시 실행하세요.',
227
+ recommendation: M().collecting,
196
228
  };
197
229
  }
198
230
  const previous = ordered.at(-2);
@@ -207,22 +239,22 @@ export function buildWeeklyInsight(input) {
207
239
  {
208
240
  area: 'product_page',
209
241
  changePercent: percentageChange(currentPageRate, previousPageRate),
210
- declineRecommendation: '제품 페이지 진입률이 하락했습니다. 아이콘·스크린샷 첫 장·부제 중 하나를 바꿔 Product Page Optimization 테스트를 시작하세요.',
211
- healthyRecommendation: '핵심 전환 지표의 주간 하락은 없습니다. 가장 개선 폭이 작은 제품 페이지 진입률을 다음 실험 대상으로 삼으세요.',
242
+ declineRecommendation: M().pageDecline,
243
+ healthyRecommendation: M().pageHealthy,
212
244
  },
213
245
  {
214
246
  area: 'acquisition',
215
247
  changePercent: percentageChange(currentDownloadRate, previousDownloadRate),
216
- declineRecommendation: '제품 페이지 조회 대비 다운로드 전환이 하락했습니다. 유입 소스별 전환을 나누고 가장 큰 하락 소스에 맞춘 커스텀 제품 페이지를 만드세요.',
217
- healthyRecommendation: '핵심 전환 지표의 주간 하락은 없습니다. 가장 개선 폭이 작은 다운로드 전환을 유입 소스별로 나눠 다음 실험을 정하세요.',
248
+ declineRecommendation: M().acqDecline,
249
+ healthyRecommendation: M().acqHealthy,
218
250
  },
219
251
  {
220
252
  area: 'monetization',
221
253
  changePercent: previous.available.purchases && current.available.purchases
222
254
  ? percentageChange(currentRevenuePerDownload, previousRevenuePerDownload)
223
255
  : null,
224
- declineRecommendation: '다운로드당 수익이 하락했습니다. 구매 리포트에서 상품별 하락을 확인하고 가격·오퍼·구독 전환 중 한 가지를 실험하세요.',
225
- healthyRecommendation: '핵심 전환 지표의 주간 하락은 없습니다. 가장 개선 폭이 작은 다운로드당 수익을 상품별로 나눠 다음 가격·오퍼 실험을 정하세요.',
256
+ declineRecommendation: M().monDecline,
257
+ healthyRecommendation: M().monHealthy,
226
258
  },
227
259
  ].filter((candidate) => candidate.changePercent !== null)
228
260
  .sort((a, b) => (a.changePercent ?? 0) - (b.changePercent ?? 0));
@@ -256,7 +288,7 @@ export function buildWeeklyInsight(input) {
256
288
  : {
257
289
  area: 'data_quality',
258
290
  changePercent: null,
259
- recommendation: '비교 가능한 분모 데이터가 부족합니다. Engagement·주간 Downloads Detailed·Purchases 리포트가 생성되는지 확인하세요.',
291
+ recommendation: M().dataQuality,
260
292
  },
261
293
  };
262
294
  }
@@ -267,21 +299,21 @@ export async function getWeeklyInsight(input) {
267
299
  if (!input.createIfMissing) {
268
300
  return {
269
301
  status: 'setup_required',
270
- message: 'ONGOING Analytics report request가 없습니다.',
271
- nextAction: 'createIfMissing=true와 confirmCreate=true로 다시 호출하세요.',
302
+ message: M().noRequest,
303
+ nextAction: M().noRequestNext,
272
304
  };
273
305
  }
274
306
  if (!input.confirmCreate) {
275
307
  return {
276
308
  status: 'confirmation_required',
277
- message: 'Analytics report request 생성은 App Store Connect에 지속 리소스를 만듭니다.',
309
+ message: M().confirmCreate,
278
310
  };
279
311
  }
280
312
  const created = await createOngoingRequest(input.appId);
281
313
  return {
282
314
  status: 'provisioning',
283
315
  requestId: created.id,
284
- message: 'ONGOING Analytics report request를 만들었습니다. 최초 데이터는 보통 24~48시간 뒤 생성됩니다.',
316
+ message: M().created,
285
317
  };
286
318
  }
287
319
  const reports = await reportGet(`/analyticsReportRequests/${encodePathSegment(active.id)}/reports`, { limit: '200' });
@@ -290,7 +322,7 @@ export async function getWeeklyInsight(input) {
290
322
  return {
291
323
  status: 'collecting',
292
324
  requestId: active.id,
293
- message: '요청은 활성 상태지만 주간 Engagement·Downloads·Purchases 리포트가 아직 생성되지 않았습니다.',
325
+ message: M().noReports,
294
326
  };
295
327
  }
296
328
  const [engagementRows, downloadRows, purchaseRows] = await Promise.all([
@@ -2,6 +2,12 @@ import { z } from 'zod';
2
2
  import { encodePathSegment } from '../lib/url-path.js';
3
3
  import { isNotFound } from './http.js';
4
4
  import { appStorePagination, getAppStoreResponse, pageIsIncomplete } from './read-response.js';
5
+ import { catalog } from '#core/lang.js';
6
+ const M = catalog({
7
+ incomplete: 'App Store Connect의 개인정보 로컬라이제이션 목록이 불완전합니다.',
8
+ }, {
9
+ incomplete: 'The App Store Connect privacy localization list is incomplete.',
10
+ });
5
11
  const privacyFields = 'privacyPolicyUrl,privacyPolicyText';
6
12
  const ageRatingFields = 'userGeneratedContent,socialMedia,socialMediaAgeRestricted,ageAssurance';
7
13
  export const appInfoReleasePolicyQuery = {
@@ -87,7 +93,7 @@ export async function readAppInfoPrivacy(appInfoId, platform) {
87
93
  if (localizations.data.some(({ attributes }) => hasPrivacyPolicy(platform, attributes)))
88
94
  return true;
89
95
  if (pageIsIncomplete(localizations, localizations.data.length)) {
90
- throw new Error('App Store Connect의 개인정보 로컬라이제이션 목록이 불완전합니다.');
96
+ throw new Error(M().incomplete);
91
97
  }
92
98
  return false;
93
99
  }
@@ -2,6 +2,16 @@ import { z } from 'zod';
2
2
  import { encodePathSegment } from '../lib/url-path.js';
3
3
  import { appInfoReleasePolicyQuery, readIncludedAppInfoPolicy } from './app-info-policy.js';
4
4
  import { appStorePagination, getAppStoreResponse, pageIsIncomplete } from './read-response.js';
5
+ import { catalog } from '#core/lang.js';
6
+ const M = catalog({
7
+ incomplete: 'App Store Connect의 앱 정보 목록이 불완전합니다.',
8
+ noneCurrent: '현재 사용할 수 있는 앱 정보 레코드가 없습니다.',
9
+ ambiguous: '대상 앱 정보 레코드를 하나로 확정할 수 없습니다.',
10
+ }, {
11
+ incomplete: 'The App Store Connect app info list is incomplete.',
12
+ noneCurrent: 'No app info record is currently available.',
13
+ ambiguous: 'Cannot resolve a single target app info record.',
14
+ });
5
15
  const appInfoPage = appStorePagination.extend({
6
16
  data: z.array(z.object({
7
17
  id: z.string().min(1),
@@ -41,12 +51,12 @@ export async function selectAppInfo(appId, options = {}) {
41
51
  const page = await readAppInfoPage(appId, privacyPlatform ? appInfoReleasePolicyQuery : {});
42
52
  const ids = new Set(page.data.map(({ id }) => id));
43
53
  if (ids.size !== page.data.length || pageIsIncomplete(page, page.data.length)) {
44
- return { reason: 'App Store Connect의 앱 정보 목록이 불완전합니다.' };
54
+ return { reason: M().incomplete };
45
55
  }
46
56
  const records = page.data.map((row) => ({ record: toAppInfoRecord(row), relationships: row.relationships }));
47
57
  const current = records.filter(({ record: { state } }) => !state || !replacedStates.has(state));
48
58
  if (current.length === 0)
49
- return { reason: '현재 사용할 수 있는 앱 정보 레코드가 없습니다.' };
59
+ return { reason: M().noneCurrent };
50
60
  // Prefer a draft, then a version under review. Keep the single current-record fallback
51
61
  // for published apps and older responses that omit state.
52
62
  const editable = current.filter(({ record: { state } }) => state && editableStates.has(state));
@@ -55,7 +65,7 @@ export async function selectAppInfo(appId, options = {}) {
55
65
  : [];
56
66
  const candidates = editable.length > 0 ? editable : inReview.length > 0 ? inReview : current;
57
67
  if (candidates.length !== 1)
58
- return { reason: '대상 앱 정보 레코드를 하나로 확정할 수 없습니다.' };
68
+ return { reason: M().ambiguous };
59
69
  const { record: target, relationships } = candidates[0];
60
70
  const policy = privacyPlatform ? readIncludedAppInfoPolicy(relationships, page.included, privacyPlatform) : {};
61
71
  return { target, policy };
@@ -3,6 +3,12 @@
3
3
  import { apiGet, apiPatch, apiPost } from './client.js';
4
4
  import { listAppInfoRecords, requireAppInfo } from './app-info.js';
5
5
  import { encodePathSegment } from '../lib/url-path.js';
6
+ import { catalog } from '#core/lang.js';
7
+ const M = catalog({
8
+ noFields: '수정할 필드가 없어 (name / subtitle / privacyPolicyUrl / privacyPolicyText 중 하나 이상).',
9
+ }, {
10
+ noFields: 'No fields to update (provide at least one of name / subtitle / privacyPolicyUrl / privacyPolicyText).',
11
+ });
6
12
  export async function listApps() {
7
13
  const data = await apiGet('/apps', {
8
14
  'fields[apps]': 'name,bundleId,sku,primaryLocale',
@@ -59,7 +65,7 @@ export async function listAppInfoLocalizations(appId, locale) {
59
65
  export async function updateAppInfoLocalization(localizationId, fields) {
60
66
  const attributes = Object.fromEntries(Object.entries(fields).filter(([, v]) => v !== undefined));
61
67
  if (Object.keys(attributes).length === 0) {
62
- throw new Error('수정할 필드가 없어 (name / subtitle / privacyPolicyUrl / privacyPolicyText 중 하나 이상).');
68
+ throw new Error(M().noFields);
63
69
  }
64
70
  return apiPatch(`/appInfoLocalizations/${encodePathSegment(localizationId)}`, {
65
71
  data: {