@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,16 @@
1
1
  import { z } from 'zod';
2
2
  import { apiGet } from './client.js';
3
3
  import { V1_BASE } from './http.js';
4
+ import { catalog } from '#core/lang.js';
5
+ const M = catalog({
6
+ nextLinkMismatch: 'App Store Connect의 다음 페이지 링크가 요청한 리소스와 일치하지 않습니다.',
7
+ responseBody: '응답 본문',
8
+ badShape: (field) => `App Store Connect 응답 형식 오류 (${field}).`,
9
+ }, {
10
+ nextLinkMismatch: 'The App Store Connect next-page link does not match the requested resource.',
11
+ responseBody: 'response body',
12
+ badShape: (field) => `Unexpected App Store Connect response format (${field}).`,
13
+ });
4
14
  export const appStoreResourceRef = z.object({ id: z.string().min(1), type: z.string().min(1) });
5
15
  export const appStoreToOne = z.object({ data: appStoreResourceRef.nullable() });
6
16
  export function includedAppStoreResource(included, ref, schema) {
@@ -21,7 +31,7 @@ export function appStoreNextPagePath(path, next) {
21
31
  const url = new URL(next, endpoint);
22
32
  if (url.origin !== endpoint.origin || url.pathname !== endpoint.pathname
23
33
  || url.username || url.password || url.hash || !url.search) {
24
- throw new Error('App Store Connect의 다음 페이지 링크가 요청한 리소스와 일치하지 않습니다.');
34
+ throw new Error(M().nextLinkMismatch);
25
35
  }
26
36
  return `${path}${url.search}`;
27
37
  }
@@ -31,8 +41,8 @@ export function pageIsIncomplete(page, count) {
31
41
  export async function getAppStoreResponse(schema, path, params) {
32
42
  const response = schema.safeParse(await apiGet(path, params));
33
43
  if (!response.success) {
34
- const field = response.error.issues[0]?.path.join('.') || '응답 본문';
35
- throw new Error(`App Store Connect 응답 형식 오류 (${field}).`);
44
+ const field = response.error.issues[0]?.path.join('.') || M().responseBody;
45
+ throw new Error(M().badShape(field));
36
46
  }
37
47
  return response.data;
38
48
  }
@@ -2,6 +2,16 @@ 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, includedAppStoreResource, pageIsIncomplete } from './read-response.js';
5
+ import { catalog } from '#core/lang.js';
6
+ const M = catalog({
7
+ buildLinkMismatch: '버전 목록의 빌드 연결과 상세 조회 결과가 일치하지 않습니다.',
8
+ buildIdMismatch: '버전 목록과 상세 조회에서 서로 다른 빌드 ID가 반환되었습니다.',
9
+ noProcessingState: '연결된 빌드의 처리 상태가 응답에 없습니다.',
10
+ }, {
11
+ buildLinkMismatch: 'The build link in the version list does not match the detail lookup.',
12
+ buildIdMismatch: 'The version list and the detail lookup returned different build IDs.',
13
+ noProcessingState: 'The response has no processing state for the attached build.',
14
+ });
5
15
  const editableStates = ['PREPARE_FOR_SUBMISSION', 'DEVELOPER_REJECTED', 'METADATA_REJECTED', 'REJECTED'];
6
16
  const versionPage = appStorePagination.extend({
7
17
  data: z.array(z.object({
@@ -102,7 +112,7 @@ export async function resolveAppStoreVersionBuild(version) {
102
112
  if (version.build)
103
113
  return version.build;
104
114
  const missing = version.linkedBuildId
105
- ? { status: 'unknown', detail: '버전 목록의 빌드 연결과 상세 조회 결과가 일치하지 않습니다.' }
115
+ ? { status: 'unknown', detail: M().buildLinkMismatch }
106
116
  : { status: 'missing' };
107
117
  try {
108
118
  const { data } = await getAppStoreResponse(buildResponse, `/appStoreVersions/${encodePathSegment(version.id)}/build`, {
@@ -111,10 +121,10 @@ export async function resolveAppStoreVersionBuild(version) {
111
121
  if (!data)
112
122
  return missing;
113
123
  if (version.linkedBuildId && data.id !== version.linkedBuildId) {
114
- return { status: 'unknown', detail: '버전 목록과 상세 조회에서 서로 다른 빌드 ID가 반환되었습니다.' };
124
+ return { status: 'unknown', detail: M().buildIdMismatch };
115
125
  }
116
126
  return buildReadiness(data)
117
- ?? { status: 'unknown', detail: '연결된 빌드의 처리 상태가 응답에 없습니다.' };
127
+ ?? { status: 'unknown', detail: M().noProcessingState };
118
128
  }
119
129
  catch (error) {
120
130
  if (isNotFound(error))
@@ -11,18 +11,55 @@ import { apiPatch, apiPost } from './client.js';
11
11
  import { V1_BASE, apiRequest, authHeadersOrThrow, isNotFound } from './http.js';
12
12
  import { appStoreResourceRef, appStoreToOne, getAppStoreResponse, includedAppStoreResource } from './read-response.js';
13
13
  import { encodePathSegment } from '../lib/url-path.js';
14
- /** 각 상태가 "지금 출시" 요청을 받을 수 있는지 + 사람이 읽을 설명. */
15
- const STATE_NOTE = {
16
- PENDING_DEVELOPER_RELEASE: '심사 통과 후 개발자 출시 대기 — 지금 출시할 수 있다.',
17
- PENDING_APPLE_RELEASE: '예약 출시 대기 — Apple 이 earliestReleaseDate 에 출시한다.',
18
- READY_FOR_SALE: '이미 출시됨.',
19
- WAITING_FOR_REVIEW: '심사 대기열에 있음.',
20
- IN_REVIEW: '심사 진행 중.',
21
- PREPARE_FOR_SUBMISSION: '아직 제출 전 — appstore_submit_for_review 먼저.',
22
- DEVELOPER_REJECTED: '개발자가 회수함 — 다시 제출해야 한다.',
23
- REJECTED: 'Apple 이 거절함 — 수정 후 재제출.',
24
- METADATA_REJECTED: '메타데이터 거절 — 수정 후 재제출.',
25
- };
14
+ import { catalog } from '#core/lang.js';
15
+ const M = catalog({
16
+ /** 각 상태가 "지금 출시" 요청을 받을 수 있는지 + 사람이 읽을 설명. */
17
+ stateNote: {
18
+ PENDING_DEVELOPER_RELEASE: '심사 통과 후 개발자 출시 대기 — 지금 출시할 수 있다.',
19
+ PENDING_APPLE_RELEASE: '예약 출시 대기 — Apple 이 earliestReleaseDate 에 출시한다.',
20
+ READY_FOR_SALE: '이미 출시됨.',
21
+ WAITING_FOR_REVIEW: '심사 대기열에 있음.',
22
+ IN_REVIEW: '심사 진행 중.',
23
+ PREPARE_FOR_SUBMISSION: '아직 제출 전 — appstore_submit_for_review 먼저.',
24
+ DEVELOPER_REJECTED: '개발자가 회수함 — 다시 제출해야 한다.',
25
+ REJECTED: 'Apple 이 거절함 — 수정 후 재제출.',
26
+ METADATA_REJECTED: '메타데이터 거절 — 수정 후 재제출.',
27
+ },
28
+ wrongVersion: 'App Store Connect에서 요청한 버전과 다른 버전을 반환했습니다.',
29
+ phasedMismatch: 'App Store Connect의 단계적 출시 연결과 상세 조회 결과가 일치하지 않습니다.',
30
+ unknownParen: '(알 수 없음)',
31
+ unknown: '알 수 없음',
32
+ cannotRelease: (state) => `❌ 지금 출시할 수 없는 상태다: ${state}`,
33
+ releaseOnlyPending: '출시 요청은 심사를 통과해 PENDING_DEVELOPER_RELEASE 로 대기 중인 버전에만 보낼 수 있다.',
34
+ scheduledNeedsDate: 'releaseType=SCHEDULED 에는 earliestReleaseDate(ISO 8601, 미래 시각)가 필요하다.',
35
+ noPhased: (state) => `❌ 이 버전에는 단계적 출시가 설정돼 있지 않다 (버전 상태: ${state}).`,
36
+ enableFirst: '먼저 action="enable" 로 켜야 한다.',
37
+ phasedStateMissing: '단계적 출시의 변경된 상태가 응답에 없습니다.',
38
+ phasedUnverified: (reason) => `단계적 출시 변경 요청이 접수됐지만 결과를 확인할 수 없습니다. 상태를 먼저 조회하세요. 원인: ${reason}`,
39
+ }, {
40
+ stateNote: {
41
+ PENDING_DEVELOPER_RELEASE: 'Approved, waiting for developer release — can be released now.',
42
+ PENDING_APPLE_RELEASE: 'Waiting for scheduled release — Apple releases it at earliestReleaseDate.',
43
+ READY_FOR_SALE: 'Already released.',
44
+ WAITING_FOR_REVIEW: 'Waiting for Review.',
45
+ IN_REVIEW: 'In Review.',
46
+ PREPARE_FOR_SUBMISSION: 'Not submitted yet — call appstore_submit_for_review first.',
47
+ DEVELOPER_REJECTED: 'Withdrawn by the developer — must be submitted again.',
48
+ REJECTED: 'Rejected by Apple — fix and resubmit.',
49
+ METADATA_REJECTED: 'Metadata Rejected — fix and resubmit.',
50
+ },
51
+ wrongVersion: 'App Store Connect returned a different version from the one requested.',
52
+ phasedMismatch: 'The App Store Connect phased release link does not match the detail lookup.',
53
+ unknownParen: '(unknown)',
54
+ unknown: 'unknown',
55
+ cannotRelease: (state) => `❌ Cannot release in the current state: ${state}`,
56
+ releaseOnlyPending: 'A release request can only be sent for a version that passed review and is waiting in PENDING_DEVELOPER_RELEASE.',
57
+ scheduledNeedsDate: 'releaseType=SCHEDULED requires earliestReleaseDate (ISO 8601, a future time).',
58
+ noPhased: (state) => `❌ This version has no phased release configured (version state: ${state}).`,
59
+ enableFirst: 'Turn it on first with action="enable".',
60
+ phasedStateMissing: 'The response does not contain the changed phased release state.',
61
+ phasedUnverified: (reason) => `The phased release change request was accepted, but the result cannot be confirmed. Check the status first. Cause: ${reason}`,
62
+ });
26
63
  const phasedType = 'appStoreVersionPhasedReleases';
27
64
  const phasedRelation = 'appStoreVersionPhasedRelease';
28
65
  const phasedFields = 'phasedReleaseState,startDate,totalPauseDuration,currentDayNumber';
@@ -60,7 +97,7 @@ async function readVersion(versionId, includePhased = false) {
60
97
  ...(includePhased ? { include: phasedRelation, [`fields[${phasedType}]`]: phasedFields } : {}),
61
98
  });
62
99
  if (document.data.id !== versionId)
63
- throw new Error('App Store Connect에서 요청한 버전과 다른 버전을 반환했습니다.');
100
+ throw new Error(M().wrongVersion);
64
101
  return document;
65
102
  }
66
103
  function versionSummary(row) {
@@ -91,7 +128,7 @@ async function getPhasedRelease(versionId, linkedId) {
91
128
  try {
92
129
  const { data } = await getAppStoreResponse(phasedResponse, `/appStoreVersions/${encodePathSegment(versionId)}/appStoreVersionPhasedRelease`, { [`fields[${phasedType}]`]: phasedFields });
93
130
  if (linkedId && data?.id !== linkedId)
94
- throw new Error('App Store Connect의 단계적 출시 연결과 상세 조회 결과가 일치하지 않습니다.');
131
+ throw new Error(M().phasedMismatch);
95
132
  return data ? phasedSummary(data) : null;
96
133
  }
97
134
  catch (err) {
@@ -101,7 +138,7 @@ async function getPhasedRelease(versionId, linkedId) {
101
138
  }
102
139
  }
103
140
  export function stateNote(state) {
104
- return (state && STATE_NOTE[state]) || '';
141
+ return (state && M().stateNote[state]) || '';
105
142
  }
106
143
  /** 버전 상태 + 단계적 출시 상태를 한 번에. 쓰기 전 미리보기용. */
107
144
  export async function getReleaseStatus(versionId) {
@@ -121,10 +158,10 @@ export async function requestRelease(versionId) {
121
158
  const version = await getVersionSummary(versionId);
122
159
  if (version.state !== 'PENDING_DEVELOPER_RELEASE') {
123
160
  throw new Error([
124
- `❌ 지금 출시할 수 없는 상태다: ${version.state ?? '(알 수 없음)'}`,
161
+ M().cannotRelease(version.state ?? M().unknownParen),
125
162
  stateNote(version.state),
126
163
  '',
127
- '출시 요청은 심사를 통과해 PENDING_DEVELOPER_RELEASE 로 대기 중인 버전에만 보낼 수 있다.',
164
+ M().releaseOnlyPending,
128
165
  ]
129
166
  .filter(Boolean)
130
167
  .join('\n'));
@@ -145,7 +182,7 @@ export async function requestRelease(versionId) {
145
182
  export async function updateReleaseType(args) {
146
183
  const { versionId, releaseType, earliestReleaseDate } = args;
147
184
  if (releaseType === 'SCHEDULED' && !earliestReleaseDate) {
148
- throw new Error('releaseType=SCHEDULED 에는 earliestReleaseDate(ISO 8601, 미래 시각)가 필요하다.');
185
+ throw new Error(M().scheduledNeedsDate);
149
186
  }
150
187
  const attributes = { releaseType };
151
188
  // SCHEDULED 가 아닌데 날짜가 남아 있으면 Apple 이 400 을 낸다 — 명시적으로 비운다.
@@ -189,8 +226,8 @@ export async function setPhasedRelease(args) {
189
226
  }
190
227
  if (!current) {
191
228
  throw new Error([
192
- `❌ 이 버전에는 단계적 출시가 설정돼 있지 않다 (버전 상태: ${version.state ?? '알 수 없음'}).`,
193
- '먼저 action="enable" 로 켜야 한다.',
229
+ M().noPhased(version.state ?? M().unknown),
230
+ M().enableFirst,
194
231
  ].join('\n'));
195
232
  }
196
233
  if (action === 'disable') {
@@ -207,13 +244,13 @@ async function verifyPhasedChange(versionId, id, expectedState) {
207
244
  try {
208
245
  const phased = await getPhasedRelease(versionId, id);
209
246
  if (!phased || (expectedState && phased.state !== expectedState)) {
210
- throw new Error('단계적 출시의 변경된 상태가 응답에 없습니다.');
247
+ throw new Error(M().phasedStateMissing);
211
248
  }
212
249
  return phased;
213
250
  }
214
251
  catch (error) {
215
252
  const reason = error instanceof Error ? error.message : String(error);
216
- throw new Error(`단계적 출시 변경 요청이 접수됐지만 결과를 확인할 수 없습니다. 상태를 먼저 조회하세요. 원인: ${reason}`, { cause: error });
253
+ throw new Error(M().phasedUnverified(reason), { cause: error });
217
254
  }
218
255
  }
219
256
  async function patchState(phasedReleaseId, state) {
@@ -4,6 +4,18 @@ import { encodePathSegment } from '../lib/url-path.js';
4
4
  import { isNotFound } from './http.js';
5
5
  import { appStoreNextPagePath, appStorePagination, appStoreResourceRef, appStoreToOne, getAppStoreResponse, includedAppStoreResource, pageIsIncomplete } from './read-response.js';
6
6
  import { requireVersionAppAndPlatform } from './versions.js';
7
+ import { catalog } from '#core/lang.js';
8
+ const M = catalog({
9
+ incompleteLocalizations: 'App Store Connect에서 출시 노트의 전체 로케일을 확인할 수 없습니다.',
10
+ buildMismatch: 'App Store Connect의 빌드 연결과 상세 조회 결과가 일치하지 않습니다.',
11
+ localeMismatch: 'App Store Connect의 로케일 연결과 상세 조회 결과가 일치하지 않습니다.',
12
+ noVersionState: 'App Store Connect에서 심사 대상의 버전명과 상태를 확인할 수 없습니다.',
13
+ }, {
14
+ incompleteLocalizations: 'Cannot confirm every release-notes locale in App Store Connect.',
15
+ buildMismatch: 'The App Store Connect build link does not match the detail lookup.',
16
+ localeMismatch: 'The App Store Connect locale links do not match the detail lookup.',
17
+ noVersionState: 'Cannot confirm the version string and state of the review target in App Store Connect.',
18
+ });
7
19
  const buildFields = 'version,uploadedDate,processingState';
8
20
  const localizationFields = 'locale,whatsNew';
9
21
  const localizationType = 'appStoreVersionLocalizations';
@@ -40,7 +52,6 @@ const localizationResource = appStoreResourceRef.extend({
40
52
  });
41
53
  const localizationLinkage = appStorePagination.extend({ data: z.array(appStoreResourceRef) });
42
54
  const localizationPage = appStorePagination.extend({ data: z.array(localizationResource) });
43
- const incompleteLocalizations = 'App Store Connect에서 출시 노트의 전체 로케일을 확인할 수 없습니다.';
44
55
  async function readPreviewBuild(path, document) {
45
56
  const link = appStoreToOne.safeParse(document.data.relationships?.build).data?.data;
46
57
  if (link === null)
@@ -52,7 +63,7 @@ async function readPreviewBuild(path, document) {
52
63
  try {
53
64
  const { data } = await getAppStoreResponse(previewBuildResponse, `${path}/build`, { 'fields[builds]': buildFields });
54
65
  if (ref && data?.id !== ref.id)
55
- throw new Error('App Store Connect의 빌드 연결과 상세 조회 결과가 일치하지 않습니다.');
66
+ throw new Error(M().buildMismatch);
56
67
  return data ?? undefined;
57
68
  }
58
69
  catch (error) {
@@ -86,18 +97,18 @@ async function readPreviewLocalizations(path, document) {
86
97
  for (const { id, attributes } of page.data) {
87
98
  const locale = attributes.locale.toLowerCase();
88
99
  if (ids.has(id) || locales.has(locale))
89
- throw new Error(incompleteLocalizations);
100
+ throw new Error(M().incompleteLocalizations);
90
101
  ids.add(id);
91
102
  locales.add(locale);
92
103
  }
93
104
  total = Math.max(total, page.meta?.paging?.total ?? 0);
94
105
  const nextLink = page.links?.next;
95
106
  if (!nextLink && (pageIsIncomplete(page, ids.size) || total > ids.size))
96
- throw new Error(incompleteLocalizations);
107
+ throw new Error(M().incompleteLocalizations);
97
108
  return { items: page.data, nextPageToken: nextLink ? appStoreNextPagePath(endpoint, nextLink) : undefined };
98
109
  });
99
110
  if (link?.data.some(({ id, type }) => type === localizationType && !ids.has(id))) {
100
- throw new Error('App Store Connect의 로케일 연결과 상세 조회 결과가 일치하지 않습니다.');
111
+ throw new Error(M().localeMismatch);
101
112
  }
102
113
  return rows;
103
114
  }
@@ -117,7 +128,7 @@ export async function buildSubmitForReviewPreview(versionId) {
117
128
  const versionString = attributes?.versionString;
118
129
  const state = attributes?.appStoreState ?? attributes?.appVersionState;
119
130
  if (!versionString?.trim() || !state?.trim()) {
120
- throw new Error('App Store Connect에서 심사 대상의 버전명과 상태를 확인할 수 없습니다.');
131
+ throw new Error(M().noVersionState);
121
132
  }
122
133
  const [build, localizations] = await Promise.all([
123
134
  readPreviewBuild(path, document),
@@ -3,6 +3,80 @@
3
3
  import { apiGet, apiPatch, apiPost } from './client.js';
4
4
  import { getVersionAppAndPlatform } from './versions.js';
5
5
  import { encodePathSegment } from '../lib/url-path.js';
6
+ import { catalog } from '#core/lang.js';
7
+ const M = catalog({
8
+ listPaged: 'reviewSubmission 목록이 여러 페이지야. 기존 버전 묶음을 모두 확인할 수 없어 제출을 중단했어.',
9
+ listNoData: 'reviewSubmission 목록 응답에 data 배열이 없어. 제출을 중단했어.',
10
+ cannotResubmit: (id, state, versionId) => `reviewSubmission ${id} 상태 ${state}에서 버전 ${versionId}을(를) 재제출할 수 없어. 먼저 묶음 상태를 확인해줘.`,
11
+ unrelatedItems: (versionId) => `버전 ${versionId}과(와) 무관한 reviewSubmission 항목이 있어 자동 제출을 중단했어. 기존 묶음을 확인해줘.`,
12
+ itemsNoData: (id) => `reviewSubmission ${id} 항목 조회 응답에 data 배열이 없어. 제출을 중단했어.`,
13
+ itemsPaged: (id) => `reviewSubmission ${id} 항목이 여러 페이지야. 전체 항목을 확인할 수 없어 제출을 중단했어.`,
14
+ createNoId: (json) => `reviewSubmission 생성 응답에 id가 없어: ${json}`,
15
+ detachFailed: (id, versionId) => `reviewSubmission ${id}의 버전 ${versionId} 항목을 해제하지 못해 제출을 중단했어.`,
16
+ firstReviewProduct: (internalId, productType) => [
17
+ `상품 ${internalId} (${productType}) 은 API 로 심사 제출할 수 없는 상태야 — Apple 응답: "no pending version for submission".`,
18
+ '',
19
+ '**앱 첫 심사** 케이스다. 한 번도 승인된 적 없는 상품은 공개 API 로 심사에 못 넣는다.',
20
+ '앱 버전을 심사 대기로 만들어도 이 벽은 그대로다 (2026-07-25 재확인).',
21
+ '',
22
+ '실제로 통하는 순서 (실앱 2.0.6 실측):',
23
+ ' 1. appstore_submit_for_review 로 앱 버전을 먼저 제출한다.',
24
+ ' → 상품은 자동으로 안 딸려간다. 버전 1개짜리 묶음 A 가 생긴다. 이건 정상이다.',
25
+ ' 2. 그래야 ASC 웹에 상품의 "심사 추가" UI 가 나타난다. 웹에서 상품을 담으면',
26
+ ' 상품들만 든 **새 묶음 B** 가 READY_FOR_REVIEW(미제출)로 생성된다.',
27
+ ' 3. B 를 그냥 제출하면 409: "an appStoreVersions must be included in this review submission".',
28
+ ' 상품 묶음에는 앱 버전이 반드시 함께 있어야 한다.',
29
+ ' 4. appstore_cancel_review 로 묶음 A 를 취소해 버전을 풀어준다.',
30
+ ' 5. POST /reviewSubmissionItems 로 B 에 appStoreVersion 을 추가한다.',
31
+ ' (상품 관계는 거부되지만 **버전 관계는 받는다**.)',
32
+ ' 6. B 를 submitted=true 로 PATCH → 버전+상품이 한 묶음으로 제출된다.',
33
+ '',
34
+ '이미 승인된 적 있는 상품이라면: 변경분(pending version)이 실제로 있는지 확인.',
35
+ ].join('\n'),
36
+ draftsPaged: '심사 초안 목록이 여러 페이지야. 안전한 빈 초안을 확인할 수 없어 제출을 중단했어.',
37
+ draftsNoData: '심사 초안 목록 응답에 data 배열이 없어. 제출을 중단했어.',
38
+ nothingToCancel: [
39
+ `취소 가능한 심사 제출이 없어 (WAITING_FOR_REVIEW 상태 없음).`,
40
+ `IN_REVIEW 이상은 API로 취소 불가 — App Store Connect 웹에서 직접 처리하거나`,
41
+ `Apple 심사 결과(APPROVED/REJECTED)를 기다려야 해.`,
42
+ ].join('\n'),
43
+ }, {
44
+ listPaged: 'The reviewSubmission list spans multiple pages. Submission stopped because not every existing version submission could be checked.',
45
+ listNoData: 'The reviewSubmission list response has no data array. Submission stopped.',
46
+ cannotResubmit: (id, state, versionId) => `Cannot resubmit version ${versionId} from reviewSubmission ${id} in state ${state}. Check the submission state first.`,
47
+ unrelatedItems: (versionId) => `Automatic submission stopped because a reviewSubmission has items unrelated to version ${versionId}. Check the existing submission.`,
48
+ itemsNoData: (id) => `The reviewSubmission ${id} items response has no data array. Submission stopped.`,
49
+ itemsPaged: (id) => `The reviewSubmission ${id} items span multiple pages. Submission stopped because not every item could be checked.`,
50
+ createNoId: (json) => `reviewSubmission creation response has no id: ${json}`,
51
+ detachFailed: (id, versionId) => `Submission stopped because the version ${versionId} item could not be removed from reviewSubmission ${id}.`,
52
+ firstReviewProduct: (internalId, productType) => [
53
+ `Product ${internalId} (${productType}) cannot be submitted for review through the API — Apple response: "no pending version for submission".`,
54
+ '',
55
+ 'This is the **app\'s first review** case. A product that has never been approved cannot be added to review through the public API.',
56
+ 'Putting the app version into review does not remove this wall (reconfirmed 2026-07-25).',
57
+ '',
58
+ 'The order that actually works (measured on real app 2.0.6):',
59
+ ' 1. Submit the app version first with appstore_submit_for_review.',
60
+ ' → Products are not attached automatically. A submission A with only the version is created. This is expected.',
61
+ ' 2. Only then does the product\'s "Add for Review" UI appear in the ASC web console. Adding products there',
62
+ ' creates a **new submission B** containing only the products, in READY_FOR_REVIEW (not submitted).',
63
+ ' 3. Submitting B as is fails with 409: "an appStoreVersions must be included in this review submission".',
64
+ ' A product submission must include the app version.',
65
+ ' 4. Cancel submission A with appstore_cancel_review to release the version.',
66
+ ' 5. Add the appStoreVersion to B with POST /reviewSubmissionItems.',
67
+ ' (Product relationships are rejected, but **the version relationship is accepted**.)',
68
+ ' 6. PATCH B with submitted=true → the version and products are submitted as one submission.',
69
+ '',
70
+ 'If the product has been approved before: check that a change (pending version) actually exists.',
71
+ ].join('\n'),
72
+ draftsPaged: 'The review draft list spans multiple pages. Submission stopped because a safe empty draft could not be confirmed.',
73
+ draftsNoData: 'The review draft list response has no data array. Submission stopped.',
74
+ nothingToCancel: [
75
+ `No review submission can be canceled (none in WAITING_FOR_REVIEW).`,
76
+ `IN_REVIEW or later cannot be canceled through the API — handle it directly in the App Store Connect web console or`,
77
+ `wait for the Apple review result (APPROVED/REJECTED).`,
78
+ ].join('\n'),
79
+ });
6
80
  export { buildSubmitForReviewPreview } from './review-preview.js';
7
81
  async function findOpenReviewSubmission(appId, platform, versionId) {
8
82
  // ASC API는 filter[state]=CREATED를 더 이상 허용하지 않음 (READY_FOR_REVIEW, WAITING_FOR_REVIEW 등만 허용).
@@ -15,10 +89,10 @@ async function findOpenReviewSubmission(appId, platform, versionId) {
15
89
  'limit': '50',
16
90
  });
17
91
  if (data?.links?.next) {
18
- throw new Error('reviewSubmission 목록이 여러 페이지야. 기존 버전 묶음을 모두 확인할 수 없어 제출을 중단했어.');
92
+ throw new Error(M().listPaged);
19
93
  }
20
94
  if (!Array.isArray(data?.data)) {
21
- throw new Error('reviewSubmission 목록 응답에 data 배열이 없어. 제출을 중단했어.');
95
+ throw new Error(M().listNoData);
22
96
  }
23
97
  const submissions = data.data;
24
98
  let reusable = null;
@@ -34,7 +108,7 @@ async function findOpenReviewSubmission(appId, platform, versionId) {
34
108
  continue;
35
109
  }
36
110
  if (sub.attributes?.state === 'COMPLETING') {
37
- throw new Error(`reviewSubmission ${sub.id} 상태 ${sub.attributes.state}에서 버전 ${versionId}을(를) 재제출할 수 없어. 먼저 묶음 상태를 확인해줘.`);
111
+ throw new Error(M().cannotResubmit(sub.id, sub.attributes.state, versionId));
38
112
  }
39
113
  return { id: sub.id, versionAttached: true, state: sub.attributes?.state };
40
114
  }
@@ -49,7 +123,7 @@ async function findOpenReviewSubmission(appId, platform, versionId) {
49
123
  if (staleSubmission)
50
124
  return staleSubmission;
51
125
  if (!reusable && hasUnrelatedItems) {
52
- throw new Error(`버전 ${versionId}과(와) 무관한 reviewSubmission 항목이 있어 자동 제출을 중단했어. 기존 묶음을 확인해줘.`);
126
+ throw new Error(M().unrelatedItems(versionId));
53
127
  }
54
128
  return reusable;
55
129
  }
@@ -59,10 +133,10 @@ async function getReviewSubmissionItems(submissionId) {
59
133
  limit: '50',
60
134
  });
61
135
  if (!Array.isArray(data?.data)) {
62
- throw new Error(`reviewSubmission ${submissionId} 항목 조회 응답에 data 배열이 없어. 제출을 중단했어.`);
136
+ throw new Error(M().itemsNoData(submissionId));
63
137
  }
64
138
  if (data?.links?.next) {
65
- throw new Error(`reviewSubmission ${submissionId} 항목이 여러 페이지야. 전체 항목을 확인할 수 없어 제출을 중단했어.`);
139
+ throw new Error(M().itemsPaged(submissionId));
66
140
  }
67
141
  return { items: data.data, included: data.included ?? [] };
68
142
  }
@@ -78,7 +152,7 @@ async function createReviewSubmission(appId, platform) {
78
152
  });
79
153
  const submissionId = created?.data?.id;
80
154
  if (!submissionId) {
81
- throw new Error(`reviewSubmission 생성 응답에 id가 없어: ${JSON.stringify(created)}`);
155
+ throw new Error(M().createNoId(JSON.stringify(created)));
82
156
  }
83
157
  return submissionId;
84
158
  }
@@ -101,7 +175,7 @@ export async function submitVersionForReview(versionId) {
101
175
  if (existing?.state === 'UNRESOLVED_ISSUES' && existing.versionAttached) {
102
176
  const released = await releaseVersionFromStaleSubmissions(appId, platform, versionId);
103
177
  if (!released) {
104
- throw new Error(`reviewSubmission ${existing.id}의 버전 ${versionId} 항목을 해제하지 못해 제출을 중단했어.`);
178
+ throw new Error(M().detachFailed(existing.id, versionId));
105
179
  }
106
180
  recoveredFromStaleSubmission = true;
107
181
  reusedSubmission = false;
@@ -218,26 +292,7 @@ export async function addProductToReviewSubmission(args) {
218
292
  catch (error) {
219
293
  if (!isNoPendingVersionError(error))
220
294
  throw error;
221
- const enriched = new Error([
222
- `상품 ${internalId} (${productType}) 은 API 로 심사 제출할 수 없는 상태야 — Apple 응답: "no pending version for submission".`,
223
- '',
224
- '**앱 첫 심사** 케이스다. 한 번도 승인된 적 없는 상품은 공개 API 로 심사에 못 넣는다.',
225
- '앱 버전을 심사 대기로 만들어도 이 벽은 그대로다 (2026-07-25 재확인).',
226
- '',
227
- '실제로 통하는 순서 (실앱 2.0.6 실측):',
228
- ' 1. appstore_submit_for_review 로 앱 버전을 먼저 제출한다.',
229
- ' → 상품은 자동으로 안 딸려간다. 버전 1개짜리 묶음 A 가 생긴다. 이건 정상이다.',
230
- ' 2. 그래야 ASC 웹에 상품의 "심사 추가" UI 가 나타난다. 웹에서 상품을 담으면',
231
- ' 상품들만 든 **새 묶음 B** 가 READY_FOR_REVIEW(미제출)로 생성된다.',
232
- ' 3. B 를 그냥 제출하면 409: "an appStoreVersions must be included in this review submission".',
233
- ' 상품 묶음에는 앱 버전이 반드시 함께 있어야 한다.',
234
- ' 4. appstore_cancel_review 로 묶음 A 를 취소해 버전을 풀어준다.',
235
- ' 5. POST /reviewSubmissionItems 로 B 에 appStoreVersion 을 추가한다.',
236
- ' (상품 관계는 거부되지만 **버전 관계는 받는다**.)',
237
- ' 6. B 를 submitted=true 로 PATCH → 버전+상품이 한 묶음으로 제출된다.',
238
- '',
239
- '이미 승인된 적 있는 상품이라면: 변경분(pending version)이 실제로 있는지 확인.',
240
- ].join('\n'));
295
+ const enriched = new Error(M().firstReviewProduct(internalId, productType));
241
296
  enriched.cause = error.cause;
242
297
  throw enriched;
243
298
  }
@@ -257,10 +312,10 @@ async function findDraftReviewSubmission(appId, platform) {
257
312
  'limit': '50',
258
313
  });
259
314
  if (data?.links?.next) {
260
- throw new Error('심사 초안 목록이 여러 페이지야. 안전한 빈 초안을 확인할 수 없어 제출을 중단했어.');
315
+ throw new Error(M().draftsPaged);
261
316
  }
262
317
  if (!Array.isArray(data?.data)) {
263
- throw new Error('심사 초안 목록 응답에 data 배열이 없어. 제출을 중단했어.');
318
+ throw new Error(M().draftsNoData);
264
319
  }
265
320
  const drafts = data.data;
266
321
  for (const draft of drafts) {
@@ -396,11 +451,7 @@ export async function cancelVersionReview(versionId) {
396
451
  });
397
452
  const submission = data?.data?.[0];
398
453
  if (!submission) {
399
- throw new Error([
400
- `취소 가능한 심사 제출이 없어 (WAITING_FOR_REVIEW 상태 없음).`,
401
- `IN_REVIEW 이상은 API로 취소 불가 — App Store Connect 웹에서 직접 처리하거나`,
402
- `Apple 심사 결과(APPROVED/REJECTED)를 기다려야 해.`,
403
- ].join('\n'));
454
+ throw new Error(M().nothingToCancel);
404
455
  }
405
456
  const submissionId = submission.id;
406
457
  const previousState = submission.attributes?.state ?? 'WAITING_FOR_REVIEW';