@yoonion/mimi-seed-mcp 0.23.1 → 0.23.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/assets/agent-guide.md +20 -2
- package/dist/appstore/app-info-policy.d.ts +27 -0
- package/dist/appstore/app-info-policy.js +104 -0
- package/dist/appstore/app-info.d.ts +19 -0
- package/dist/appstore/app-info.js +68 -0
- package/dist/appstore/apps.d.ts +1 -5
- package/dist/appstore/apps.js +12 -37
- package/dist/appstore/asset-library-write.d.ts +39 -0
- package/dist/appstore/asset-library-write.js +282 -0
- package/dist/appstore/asset-library.d.ts +28 -0
- package/dist/appstore/asset-library.js +197 -0
- package/dist/appstore/client.d.ts +4 -3
- package/dist/appstore/declarations.js +11 -14
- package/dist/appstore/messages.js +4 -4
- package/dist/appstore/previews.js +3 -29
- package/dist/appstore/read-response.d.ts +27 -0
- package/dist/appstore/read-response.js +38 -0
- package/dist/appstore/release-target.d.ts +54 -0
- package/dist/appstore/release-target.js +124 -0
- package/dist/appstore/release.js +100 -47
- package/dist/appstore/review-preview.d.ts +19 -0
- package/dist/appstore/review-preview.js +141 -0
- package/dist/appstore/review-submission.d.ts +2 -28
- package/dist/appstore/review-submission.js +14 -59
- package/dist/appstore/screenshots.d.ts +1 -0
- package/dist/appstore/screenshots.js +60 -4
- package/dist/appstore/upload-parts.d.ts +11 -0
- package/dist/appstore/upload-parts.js +29 -0
- package/dist/appstore/versions.d.ts +9 -0
- package/dist/appstore/versions.js +15 -14
- package/dist/checks/appstore-submission.d.ts +75 -0
- package/dist/checks/appstore-submission.js +56 -0
- package/dist/checks/plan.d.ts +58 -2
- package/dist/checks/plan.js +103 -106
- package/dist/checks/release-readiness.d.ts +195 -0
- package/dist/checks/release-readiness.js +58 -0
- package/dist/checks/release-status.d.ts +76 -0
- package/dist/checks/release-status.js +72 -0
- package/dist/checks/risks.d.ts +40 -14
- package/dist/checks/risks.js +283 -231
- package/dist/lib/tool-registrar.d.ts +1 -1
- package/dist/lib/tool-registrar.js +5 -5
- package/dist/playstore/edits.js +25 -2
- package/dist/registers/appstore/media.js +69 -24
- package/dist/registers/appstore/review-submission.js +8 -4
- package/dist/registers/checks.js +34 -94
- package/dist/registers/playstore.js +5 -4
- package/package.json +1 -1
- package/tool-manifest.json +5 -2
|
@@ -1,31 +1,5 @@
|
|
|
1
1
|
import type { AppStoreProductType } from './http.js';
|
|
2
|
-
|
|
3
|
-
* submit_for_review dry-run 프리뷰 — 비가역 제출 직전 사용자 확인용.
|
|
4
|
-
*
|
|
5
|
-
* 1.4.x 배포 사고 누적: submit 직후 되돌리지 못해 새 versionString bump 으로 우회해야
|
|
6
|
-
* 하는 케이스가 반복됨 (reference_appstore_cancel_review_window). 그 원인이던
|
|
7
|
-
* cancel_review 버그(submitted:false → 항상 409)는 2026-07-25 에 canceled:true 로 고쳤고,
|
|
8
|
-
* 이제 WAITING_FOR_REVIEW 까지는 되돌릴 수 있다. 그래도 IN_REVIEW 이후는 못 되돌리니
|
|
9
|
-
* 호출자가 의도한 그 버전·빌드인지 미리 보여줘서 잘못된 versionId 제출을 차단한다.
|
|
10
|
-
*/
|
|
11
|
-
export declare function buildSubmitForReviewPreview(versionId: string): Promise<{
|
|
12
|
-
versionId: string;
|
|
13
|
-
versionString?: string;
|
|
14
|
-
state?: string;
|
|
15
|
-
appId: string;
|
|
16
|
-
platform: string;
|
|
17
|
-
attachedBuild?: {
|
|
18
|
-
id: string;
|
|
19
|
-
buildNumber?: string;
|
|
20
|
-
uploadedDate?: string;
|
|
21
|
-
processingState?: string;
|
|
22
|
-
};
|
|
23
|
-
whatsNewByLocale: Array<{
|
|
24
|
-
locale: string;
|
|
25
|
-
excerpt: string;
|
|
26
|
-
length: number;
|
|
27
|
-
}>;
|
|
28
|
-
}>;
|
|
2
|
+
export { buildSubmitForReviewPreview } from './review-preview.js';
|
|
29
3
|
export declare function submitVersionForReview(versionId: string): Promise<{
|
|
30
4
|
submissionId: string;
|
|
31
5
|
appId: string;
|
|
@@ -34,7 +8,7 @@ export declare function submitVersionForReview(versionId: string): Promise<{
|
|
|
34
8
|
reusedSubmission: boolean;
|
|
35
9
|
itemAttached: boolean;
|
|
36
10
|
recoveredFromStaleSubmission: boolean;
|
|
37
|
-
state:
|
|
11
|
+
state: string;
|
|
38
12
|
}>;
|
|
39
13
|
export declare function addProductToReviewSubmission(args: {
|
|
40
14
|
internalId: string;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
// App Store Connect — 심사 제출(버전·IAP/구독 상품)·제출 묶음 조회/해제·심사 철회.
|
|
2
2
|
// appstore/tools.ts 가 이 모듈을 그대로 re-export 한다 — 호출부는 tools.js 경로를 계속 쓴다.
|
|
3
3
|
import { apiGet, apiPatch, apiPost } from './client.js';
|
|
4
|
-
import { getVersionAppAndPlatform
|
|
4
|
+
import { getVersionAppAndPlatform } from './versions.js';
|
|
5
5
|
import { encodePathSegment } from '../lib/url-path.js';
|
|
6
|
-
|
|
7
|
-
// 2024년 1월부터 옛 /appStoreVersionSubmissions가 deprecated 됐고,
|
|
8
|
-
// 새 모델은 /reviewSubmissions + /reviewSubmissionItems 2단계 + PATCH submitted=true.
|
|
9
|
-
// 참고: https://developer.apple.com/documentation/appstoreconnectapi/submit-an-app-for-review
|
|
6
|
+
export { buildSubmitForReviewPreview } from './review-preview.js';
|
|
10
7
|
async function findOpenReviewSubmission(appId, platform, versionId) {
|
|
11
8
|
// ASC API는 filter[state]=CREATED를 더 이상 허용하지 않음 (READY_FOR_REVIEW, WAITING_FOR_REVIEW 등만 허용).
|
|
12
9
|
// CREATED 상태 submission은 별도로 조회 불가 → 이미 진행 중인 submission만 재사용.
|
|
@@ -20,7 +17,10 @@ async function findOpenReviewSubmission(appId, platform, versionId) {
|
|
|
20
17
|
if (data?.links?.next) {
|
|
21
18
|
throw new Error('reviewSubmission 목록이 여러 페이지야. 기존 버전 묶음을 모두 확인할 수 없어 제출을 중단했어.');
|
|
22
19
|
}
|
|
23
|
-
|
|
20
|
+
if (!Array.isArray(data?.data)) {
|
|
21
|
+
throw new Error('reviewSubmission 목록 응답에 data 배열이 없어. 제출을 중단했어.');
|
|
22
|
+
}
|
|
23
|
+
const submissions = data.data;
|
|
24
24
|
let reusable = null;
|
|
25
25
|
let staleSubmission = null;
|
|
26
26
|
let hasUnrelatedItems = false;
|
|
@@ -64,55 +64,7 @@ async function getReviewSubmissionItems(submissionId) {
|
|
|
64
64
|
if (data?.links?.next) {
|
|
65
65
|
throw new Error(`reviewSubmission ${submissionId} 항목이 여러 페이지야. 전체 항목을 확인할 수 없어 제출을 중단했어.`);
|
|
66
66
|
}
|
|
67
|
-
return { items:
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* submit_for_review dry-run 프리뷰 — 비가역 제출 직전 사용자 확인용.
|
|
71
|
-
*
|
|
72
|
-
* 1.4.x 배포 사고 누적: submit 직후 되돌리지 못해 새 versionString bump 으로 우회해야
|
|
73
|
-
* 하는 케이스가 반복됨 (reference_appstore_cancel_review_window). 그 원인이던
|
|
74
|
-
* cancel_review 버그(submitted:false → 항상 409)는 2026-07-25 에 canceled:true 로 고쳤고,
|
|
75
|
-
* 이제 WAITING_FOR_REVIEW 까지는 되돌릴 수 있다. 그래도 IN_REVIEW 이후는 못 되돌리니
|
|
76
|
-
* 호출자가 의도한 그 버전·빌드인지 미리 보여줘서 잘못된 versionId 제출을 차단한다.
|
|
77
|
-
*/
|
|
78
|
-
export async function buildSubmitForReviewPreview(versionId) {
|
|
79
|
-
const { appId, platform } = await getVersionAppAndPlatform(versionId);
|
|
80
|
-
// 버전 메타: versionString + state
|
|
81
|
-
const versionData = await apiGet(`/appStoreVersions/${encodePathSegment(versionId)}`, {
|
|
82
|
-
'fields[appStoreVersions]': 'versionString,appStoreState',
|
|
83
|
-
}).catch(() => null);
|
|
84
|
-
const versionString = versionData?.data?.attributes?.versionString;
|
|
85
|
-
const state = versionData?.data?.attributes?.appStoreState;
|
|
86
|
-
// attached build
|
|
87
|
-
let attachedBuild;
|
|
88
|
-
const build = await apiGet(`/appStoreVersions/${encodePathSegment(versionId)}/build`, {
|
|
89
|
-
'fields[builds]': 'version,uploadedDate,processingState',
|
|
90
|
-
}).catch(() => null);
|
|
91
|
-
if (build?.data?.id) {
|
|
92
|
-
attachedBuild = {
|
|
93
|
-
id: build.data.id,
|
|
94
|
-
buildNumber: build.data.attributes?.version,
|
|
95
|
-
uploadedDate: build.data.attributes?.uploadedDate,
|
|
96
|
-
processingState: build.data.attributes?.processingState,
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
const localizations = (await getVersionLocalizations(versionId).catch(() => []));
|
|
100
|
-
const whatsNewByLocale = localizations
|
|
101
|
-
.filter((l) => typeof l.whatsNew === 'string' && l.whatsNew.length > 0)
|
|
102
|
-
.map((l) => ({
|
|
103
|
-
locale: l.locale,
|
|
104
|
-
length: l.whatsNew.length,
|
|
105
|
-
excerpt: l.whatsNew.length > 200 ? `${l.whatsNew.slice(0, 200)}…` : l.whatsNew,
|
|
106
|
-
}));
|
|
107
|
-
return {
|
|
108
|
-
versionId,
|
|
109
|
-
versionString,
|
|
110
|
-
state,
|
|
111
|
-
appId,
|
|
112
|
-
platform,
|
|
113
|
-
attachedBuild,
|
|
114
|
-
whatsNewByLocale,
|
|
115
|
-
};
|
|
67
|
+
return { items: data.data, included: data.included ?? [] };
|
|
116
68
|
}
|
|
117
69
|
async function createReviewSubmission(appId, platform) {
|
|
118
70
|
const created = await apiPost('/reviewSubmissions', {
|
|
@@ -307,7 +259,10 @@ async function findDraftReviewSubmission(appId, platform) {
|
|
|
307
259
|
if (data?.links?.next) {
|
|
308
260
|
throw new Error('심사 초안 목록이 여러 페이지야. 안전한 빈 초안을 확인할 수 없어 제출을 중단했어.');
|
|
309
261
|
}
|
|
310
|
-
|
|
262
|
+
if (!Array.isArray(data?.data)) {
|
|
263
|
+
throw new Error('심사 초안 목록 응답에 data 배열이 없어. 제출을 중단했어.');
|
|
264
|
+
}
|
|
265
|
+
const drafts = data.data;
|
|
311
266
|
for (const draft of drafts) {
|
|
312
267
|
const { items } = await getReviewSubmissionItems(draft.id);
|
|
313
268
|
if (items.length === 0 && !draft.relationships?.appStoreVersionForReview?.data?.id)
|
|
@@ -323,7 +278,7 @@ export async function listReviewSubmissions(args) {
|
|
|
323
278
|
'filter[platform]': platform,
|
|
324
279
|
'limit': String(limit),
|
|
325
280
|
});
|
|
326
|
-
const submissions =
|
|
281
|
+
const submissions = data?.data ?? [];
|
|
327
282
|
const result = [];
|
|
328
283
|
for (const sub of submissions) {
|
|
329
284
|
// 버전만 include 하면 IAP·구독·구독그룹 항목이 전부 "?" 로 남아, 정작 중요한
|
|
@@ -412,11 +367,11 @@ async function releaseVersionFromStaleSubmissions(appId, platform, versionId) {
|
|
|
412
367
|
'filter[state]': 'UNRESOLVED_ISSUES',
|
|
413
368
|
'limit': '5',
|
|
414
369
|
}).catch(() => null);
|
|
415
|
-
const stale =
|
|
370
|
+
const stale = data?.data ?? [];
|
|
416
371
|
let released = 0;
|
|
417
372
|
for (const sub of stale) {
|
|
418
373
|
const items = await apiGet(`/reviewSubmissions/${encodePathSegment(sub.id)}/items`, { limit: '50' }).catch(() => null);
|
|
419
|
-
const rows =
|
|
374
|
+
const rows = items?.data ?? [];
|
|
420
375
|
for (const row of rows) {
|
|
421
376
|
if (row?.relationships?.appStoreVersion?.data?.id !== versionId)
|
|
422
377
|
continue;
|
|
@@ -9,6 +9,7 @@ export declare function listScreenshotSets(localizationId: string): Promise<{
|
|
|
9
9
|
imageAsset: unknown;
|
|
10
10
|
}[];
|
|
11
11
|
}[]>;
|
|
12
|
+
export declare function checkLegacyScreenshotReadiness(localizationId: string): Promise<'ready' | 'missing' | 'not-ready' | 'unknown'>;
|
|
12
13
|
export declare function uploadScreenshot(localizationId: string, displayType: string, filePath: string): Promise<{
|
|
13
14
|
id: string;
|
|
14
15
|
fileName: string;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { getAuthHeaders } from './auth.js';
|
|
2
|
+
import { apiGet } from './client.js';
|
|
3
|
+
import { z } from 'zod';
|
|
2
4
|
import fs from 'node:fs';
|
|
3
5
|
import path from 'node:path';
|
|
4
6
|
import crypto from 'node:crypto';
|
|
@@ -42,11 +44,15 @@ async function req(pathOrUrl, init = {}) {
|
|
|
42
44
|
const text = await res.text();
|
|
43
45
|
return (text ? JSON.parse(text) : null);
|
|
44
46
|
}
|
|
47
|
+
function fetchScreenshotSets(localizationId, includeImageMetadata) {
|
|
48
|
+
return apiGet(`/appStoreVersionLocalizations/${encodePathSegment(localizationId)}/appScreenshotSets`, {
|
|
49
|
+
include: 'appScreenshots',
|
|
50
|
+
'fields[appScreenshotSets]': 'screenshotDisplayType,appScreenshots',
|
|
51
|
+
'fields[appScreenshots]': includeImageMetadata ? 'fileName,fileSize,assetDeliveryState,imageAsset' : 'assetDeliveryState',
|
|
52
|
+
});
|
|
53
|
+
}
|
|
45
54
|
export async function listScreenshotSets(localizationId) {
|
|
46
|
-
const data = await
|
|
47
|
-
`?include=appScreenshots` +
|
|
48
|
-
`&fields[appScreenshotSets]=screenshotDisplayType,appScreenshots` +
|
|
49
|
-
`&fields[appScreenshots]=fileName,fileSize,assetDeliveryState,imageAsset`);
|
|
55
|
+
const data = await fetchScreenshotSets(localizationId, true);
|
|
50
56
|
const included = data?.included ?? [];
|
|
51
57
|
return (data?.data ?? []).map((s) => ({
|
|
52
58
|
id: s.id,
|
|
@@ -63,6 +69,56 @@ export async function listScreenshotSets(localizationId) {
|
|
|
63
69
|
}),
|
|
64
70
|
}));
|
|
65
71
|
}
|
|
72
|
+
const pagingFields = {
|
|
73
|
+
links: z.object({ next: z.string().nullish() }).nullish(),
|
|
74
|
+
meta: z.object({ paging: z.object({
|
|
75
|
+
total: z.number().int().nonnegative().optional(),
|
|
76
|
+
nextCursor: z.string().nullish(),
|
|
77
|
+
}).optional() }).nullish(),
|
|
78
|
+
};
|
|
79
|
+
const legacyScreenshotRef = z.object({ type: z.literal('appScreenshots'), id: z.string().min(1) });
|
|
80
|
+
const legacyScreenshotSets = z.object({
|
|
81
|
+
...pagingFields,
|
|
82
|
+
data: z.array(z.object({
|
|
83
|
+
relationships: z.object({
|
|
84
|
+
appScreenshots: z.object({ ...pagingFields, data: z.array(legacyScreenshotRef) }).nullish(),
|
|
85
|
+
}).nullish(),
|
|
86
|
+
})),
|
|
87
|
+
included: z.array(legacyScreenshotRef.extend({
|
|
88
|
+
attributes: z.object({
|
|
89
|
+
assetDeliveryState: z.object({ state: z.string().nullish() }).nullish(),
|
|
90
|
+
}).nullish(),
|
|
91
|
+
})).nullish(),
|
|
92
|
+
});
|
|
93
|
+
function hasMoreScreenshots(page, count) {
|
|
94
|
+
return Boolean(page.links?.next || page.meta?.paging?.nextCursor) || (page.meta?.paging?.total ?? 0) > count;
|
|
95
|
+
}
|
|
96
|
+
export async function checkLegacyScreenshotReadiness(localizationId) {
|
|
97
|
+
const result = legacyScreenshotSets.safeParse(await fetchScreenshotSets(localizationId, false));
|
|
98
|
+
if (!result.success)
|
|
99
|
+
return 'unknown';
|
|
100
|
+
const { data, included } = result.data;
|
|
101
|
+
const states = new Map((included ?? []).map((asset) => [asset.id, asset.attributes?.assetDeliveryState?.state]));
|
|
102
|
+
let hasScreenshot = false;
|
|
103
|
+
let incomplete = hasMoreScreenshots(result.data, data.length);
|
|
104
|
+
for (const set of data) {
|
|
105
|
+
const relationship = set.relationships?.appScreenshots;
|
|
106
|
+
if (!relationship) {
|
|
107
|
+
incomplete = true;
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
incomplete ||= hasMoreScreenshots(relationship, relationship.data.length);
|
|
111
|
+
for (const screenshot of relationship.data) {
|
|
112
|
+
const state = states.get(screenshot.id);
|
|
113
|
+
if (state === 'COMPLETE')
|
|
114
|
+
return 'ready';
|
|
115
|
+
hasScreenshot = true;
|
|
116
|
+
if (state !== 'AWAITING_UPLOAD' && state !== 'UPLOAD_COMPLETE' && state !== 'FAILED')
|
|
117
|
+
incomplete = true;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return incomplete ? 'unknown' : hasScreenshot ? 'not-ready' : 'missing';
|
|
121
|
+
}
|
|
66
122
|
// ─── 셋 확보 (존재하면 재사용, 없으면 생성) ───
|
|
67
123
|
async function ensureScreenshotSet(localizationId, displayType) {
|
|
68
124
|
const existing = await listScreenshotSets(localizationId);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface UploadOperation {
|
|
2
|
+
method: string;
|
|
3
|
+
url: string;
|
|
4
|
+
length: number;
|
|
5
|
+
offset: number;
|
|
6
|
+
requestHeaders: Array<{
|
|
7
|
+
name: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
export declare function uploadFileParts(absPath: string, ops: readonly UploadOperation[], redirect?: RequestRedirect): Promise<void>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import { fetchWithTimeout, HTTP_TRANSFER_TIMEOUT_MS } from '../lib/http.js';
|
|
3
|
+
export async function uploadFileParts(absPath, ops, redirect) {
|
|
4
|
+
const fd = fs.openSync(absPath, 'r');
|
|
5
|
+
try {
|
|
6
|
+
for (const op of ops) {
|
|
7
|
+
// 파일 전체를 메모리에 올리지 않는다 — 동영상은 수백 MB 가 될 수 있다.
|
|
8
|
+
const chunk = Buffer.alloc(op.length);
|
|
9
|
+
const bytesRead = fs.readSync(fd, chunk, 0, op.length, op.offset);
|
|
10
|
+
// Buffer.alloc 은 0 으로 채운다 — 짧게 읽힌 걸 모르고 보내면 **0 패딩이 영상 데이터로**
|
|
11
|
+
// 올라가고, PUT 은 성공한 뒤 체크섬 불일치가 한참 뒤 인코딩 실패로 나타난다.
|
|
12
|
+
// 여기서 즉시 멈추는 게 그 추적 불가능한 실패보다 낫다.
|
|
13
|
+
if (bytesRead !== op.length) {
|
|
14
|
+
throw new Error(`파일을 읽는 중 크기가 어긋났다 (offset ${op.offset}: ${op.length} 바이트 요청, ${bytesRead} 읽음). ` +
|
|
15
|
+
'업로드 도중 파일이 바뀌었을 수 있다 — 파일을 확인하고 다시 시도할 것.');
|
|
16
|
+
}
|
|
17
|
+
const headers = {};
|
|
18
|
+
for (const h of op.requestHeaders ?? [])
|
|
19
|
+
headers[h.name] = h.value;
|
|
20
|
+
const res = await fetchWithTimeout(op.url, { method: op.method ?? 'PUT', headers, body: chunk, redirect }, HTTP_TRANSFER_TIMEOUT_MS);
|
|
21
|
+
if (!res.ok) {
|
|
22
|
+
throw new Error(`미디어 업로드 실패 (offset ${op.offset}): ${res.status} ${await res.text()}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
finally {
|
|
27
|
+
fs.closeSync(fd);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AscResource, AscToOne } from './types.js';
|
|
1
2
|
export declare function listVersions(appId: string, filters?: {
|
|
2
3
|
versionString?: string;
|
|
3
4
|
platform?: ApplePlatform;
|
|
@@ -115,3 +116,11 @@ export declare function getVersionAppAndPlatform(versionId: string): Promise<{
|
|
|
115
116
|
appId: string;
|
|
116
117
|
platform: string;
|
|
117
118
|
}>;
|
|
119
|
+
export declare function requireVersionAppAndPlatform(versionId: string, version: AscResource<{
|
|
120
|
+
platform?: string | null;
|
|
121
|
+
}, {
|
|
122
|
+
app?: AscToOne;
|
|
123
|
+
}> | undefined): {
|
|
124
|
+
appId: string;
|
|
125
|
+
platform: string;
|
|
126
|
+
};
|
|
@@ -4,12 +4,12 @@ import { apiGet, apiPatch, apiPost } from './client.js';
|
|
|
4
4
|
import { encodePathSegment } from '../lib/url-path.js';
|
|
5
5
|
// ─── 버전 ───
|
|
6
6
|
export async function listVersions(appId, filters = {}) {
|
|
7
|
-
const data =
|
|
7
|
+
const data = await apiGet(`/apps/${encodePathSegment(appId)}/appStoreVersions`, {
|
|
8
8
|
'fields[appStoreVersions]': 'versionString,platform,appStoreState,releaseType,createdDate',
|
|
9
9
|
'limit': '10',
|
|
10
10
|
...(filters.versionString ? { 'filter[versionString]': filters.versionString } : {}),
|
|
11
11
|
...(filters.platform ? { 'filter[platform]': filters.platform } : {}),
|
|
12
|
-
})
|
|
12
|
+
});
|
|
13
13
|
return (data.data ?? []).map((v) => ({
|
|
14
14
|
id: v.id,
|
|
15
15
|
version: v.attributes?.versionString,
|
|
@@ -133,9 +133,9 @@ export async function attachLatestValidBuild(versionId, opts) {
|
|
|
133
133
|
}
|
|
134
134
|
// ─── 로컬라이제이션 (메타데이터) ───
|
|
135
135
|
export async function getVersionLocalizations(versionId) {
|
|
136
|
-
const data =
|
|
136
|
+
const data = await apiGet(`/appStoreVersions/${encodePathSegment(versionId)}/appStoreVersionLocalizations`, {
|
|
137
137
|
'fields[appStoreVersionLocalizations]': 'locale,description,keywords,promotionalText,whatsNew',
|
|
138
|
-
})
|
|
138
|
+
});
|
|
139
139
|
return (data.data ?? []).map((l) => ({
|
|
140
140
|
id: l.id,
|
|
141
141
|
locale: l.attributes?.locale,
|
|
@@ -238,12 +238,12 @@ export async function getReviewNotes(versionId) {
|
|
|
238
238
|
}
|
|
239
239
|
// ─── 빌드 ───
|
|
240
240
|
export async function listBuilds(appId) {
|
|
241
|
-
const data =
|
|
241
|
+
const data = await apiGet('/builds', {
|
|
242
242
|
'filter[app]': appId,
|
|
243
243
|
'fields[builds]': 'version,uploadedDate,processingState,buildAudienceType',
|
|
244
244
|
'sort': '-uploadedDate',
|
|
245
245
|
'limit': '10',
|
|
246
|
-
})
|
|
246
|
+
});
|
|
247
247
|
return (data.data ?? []).map((b) => ({
|
|
248
248
|
id: b.id,
|
|
249
249
|
version: b.attributes?.version,
|
|
@@ -253,14 +253,15 @@ export async function listBuilds(appId) {
|
|
|
253
253
|
}
|
|
254
254
|
// ─── 버전 → 앱/플랫폼 역조회 (빌드 연결·심사 제출이 공유) ───
|
|
255
255
|
export async function getVersionAppAndPlatform(versionId) {
|
|
256
|
-
const data =
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
const platform =
|
|
261
|
-
const
|
|
262
|
-
if (
|
|
256
|
+
const data = await apiGet(`/appStoreVersions/${encodePathSegment(versionId)}`, { 'fields[appStoreVersions]': 'platform,app', include: 'app' });
|
|
257
|
+
return requireVersionAppAndPlatform(versionId, data?.data);
|
|
258
|
+
}
|
|
259
|
+
export function requireVersionAppAndPlatform(versionId, version) {
|
|
260
|
+
const platform = version?.attributes?.platform;
|
|
261
|
+
const app = version?.relationships?.app?.data;
|
|
262
|
+
if (version?.id !== versionId || version.type !== 'appStoreVersions' || app?.type !== 'apps'
|
|
263
|
+
|| typeof app.id !== 'string' || !app.id || typeof platform !== 'string' || !platform) {
|
|
263
264
|
throw new Error(`appStoreVersion ${versionId}에서 app 또는 platform을 찾지 못했어. 버전 ID 확인 필요.`);
|
|
264
265
|
}
|
|
265
|
-
return { appId, platform };
|
|
266
|
+
return { appId: app.id, platform };
|
|
266
267
|
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type AppStorePolicy } from './risks.js';
|
|
2
|
+
export declare function checkAppStoreSubmission(appId: string, opts?: {
|
|
3
|
+
versionId?: string;
|
|
4
|
+
versionString?: string;
|
|
5
|
+
policy?: AppStorePolicy;
|
|
6
|
+
}): Promise<{
|
|
7
|
+
status: "error" | "missing" | "ambiguous" | "incomplete";
|
|
8
|
+
readiness: {
|
|
9
|
+
target: {
|
|
10
|
+
store: "playstore";
|
|
11
|
+
packageName: string;
|
|
12
|
+
track?: string | undefined;
|
|
13
|
+
versionCode?: string | undefined;
|
|
14
|
+
} | {
|
|
15
|
+
store: "appstore";
|
|
16
|
+
appId: string;
|
|
17
|
+
versionId?: string | undefined;
|
|
18
|
+
versionString?: string | undefined;
|
|
19
|
+
platform?: "IOS" | "MAC_OS" | "TV_OS" | "VISION_OS" | undefined;
|
|
20
|
+
};
|
|
21
|
+
targetVerified: boolean;
|
|
22
|
+
checkStatus: "incomplete" | "complete";
|
|
23
|
+
canSubmit: boolean;
|
|
24
|
+
blockingCodes: string[];
|
|
25
|
+
risks: {
|
|
26
|
+
level: "warning" | "blocker" | "info";
|
|
27
|
+
code: string;
|
|
28
|
+
title: string;
|
|
29
|
+
detail: string;
|
|
30
|
+
fixUrl?: string | undefined;
|
|
31
|
+
}[];
|
|
32
|
+
};
|
|
33
|
+
} | {
|
|
34
|
+
status: "selected";
|
|
35
|
+
version: import("../appstore/release-target.js").AppStoreVersionCandidate;
|
|
36
|
+
buildRisk: {
|
|
37
|
+
level: "warning" | "blocker" | "info";
|
|
38
|
+
code: string;
|
|
39
|
+
title: string;
|
|
40
|
+
detail: string;
|
|
41
|
+
fixUrl?: string | undefined;
|
|
42
|
+
} | undefined;
|
|
43
|
+
versionRisks: {
|
|
44
|
+
level: "warning" | "blocker" | "info";
|
|
45
|
+
code: string;
|
|
46
|
+
title: string;
|
|
47
|
+
detail: string;
|
|
48
|
+
fixUrl?: string | undefined;
|
|
49
|
+
}[];
|
|
50
|
+
readiness: {
|
|
51
|
+
target: {
|
|
52
|
+
store: "playstore";
|
|
53
|
+
packageName: string;
|
|
54
|
+
track?: string | undefined;
|
|
55
|
+
versionCode?: string | undefined;
|
|
56
|
+
} | {
|
|
57
|
+
store: "appstore";
|
|
58
|
+
appId: string;
|
|
59
|
+
versionId?: string | undefined;
|
|
60
|
+
versionString?: string | undefined;
|
|
61
|
+
platform?: "IOS" | "MAC_OS" | "TV_OS" | "VISION_OS" | undefined;
|
|
62
|
+
};
|
|
63
|
+
targetVerified: boolean;
|
|
64
|
+
checkStatus: "incomplete" | "complete";
|
|
65
|
+
canSubmit: boolean;
|
|
66
|
+
blockingCodes: string[];
|
|
67
|
+
risks: {
|
|
68
|
+
level: "warning" | "blocker" | "info";
|
|
69
|
+
code: string;
|
|
70
|
+
title: string;
|
|
71
|
+
detail: string;
|
|
72
|
+
fixUrl?: string | undefined;
|
|
73
|
+
}[];
|
|
74
|
+
};
|
|
75
|
+
}>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { resolveAppStoreVersionBuild, selectEditableAppStoreVersion } from '../appstore/release-target.js';
|
|
2
|
+
import { appStoreBuildRisk, checkAppStoreVersionRisks } from './risks.js';
|
|
3
|
+
import { releaseReadiness } from './release-readiness.js';
|
|
4
|
+
export async function checkAppStoreSubmission(appId, opts = {}) {
|
|
5
|
+
const { versionId, versionString, policy } = opts;
|
|
6
|
+
const target = { store: 'appstore', appId, versionId, versionString };
|
|
7
|
+
function unverified(status, risk) {
|
|
8
|
+
return { status, readiness: releaseReadiness(target, [risk], false, false) };
|
|
9
|
+
}
|
|
10
|
+
let selection;
|
|
11
|
+
try {
|
|
12
|
+
selection = await selectEditableAppStoreVersion(appId, { versionId, versionString });
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
return unverified('error', {
|
|
16
|
+
level: 'warning',
|
|
17
|
+
code: 'API_ERROR_VERSIONS',
|
|
18
|
+
title: '조회 실패 — 편집 가능한 버전 목록',
|
|
19
|
+
detail: `이 항목은 위험 분석에서 제외됨. 원인: ${error instanceof Error ? error.message : String(error)}`,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
if (selection.status === 'missing') {
|
|
23
|
+
return unverified('missing', versionId || versionString
|
|
24
|
+
? {
|
|
25
|
+
level: 'blocker',
|
|
26
|
+
code: 'TARGET_VERSION_UNVERIFIED',
|
|
27
|
+
title: '대상 버전을 점검할 수 없음',
|
|
28
|
+
detail: '대상 앱의 편집 가능한 버전 목록에서 요청한 버전을 확인하세요.',
|
|
29
|
+
}
|
|
30
|
+
: {
|
|
31
|
+
level: 'blocker',
|
|
32
|
+
code: 'NO_EDITABLE_VERSION',
|
|
33
|
+
title: '편집 가능한 버전 없음',
|
|
34
|
+
detail: 'App Store Connect에서 새 버전을 만드세요.',
|
|
35
|
+
fixUrl: 'https://appstoreconnect.apple.com',
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
if (selection.status === 'incomplete' || selection.status === 'ambiguous') {
|
|
39
|
+
return unverified(selection.status, {
|
|
40
|
+
level: 'warning',
|
|
41
|
+
code: selection.status === 'incomplete' ? 'API_ERROR_VERSIONS_INCOMPLETE' : 'API_ERROR_VERSIONS_AMBIGUOUS',
|
|
42
|
+
title: '편집 가능한 버전을 하나로 확인할 수 없음',
|
|
43
|
+
detail: 'App Store Connect에서 대상 플랫폼과 편집 상태를 확인한 뒤 해당 versionId로 다시 점검하세요.',
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
const { version } = selection;
|
|
47
|
+
const [build, versionRisks] = await Promise.all([
|
|
48
|
+
resolveAppStoreVersionBuild(version),
|
|
49
|
+
checkAppStoreVersionRisks(appId, version, policy),
|
|
50
|
+
]);
|
|
51
|
+
const buildRisk = appStoreBuildRisk(build);
|
|
52
|
+
const readiness = releaseReadiness({
|
|
53
|
+
...target, versionId: version.id, versionString: version.versionString, platform: version.platform,
|
|
54
|
+
}, buildRisk ? [buildRisk, ...versionRisks] : versionRisks, true);
|
|
55
|
+
return { status: 'selected', version, buildRisk, versionRisks, readiness };
|
|
56
|
+
}
|
package/dist/checks/plan.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { OAuth2Client } from 'google-auth-library';
|
|
2
|
+
import { type AppStorePolicy } from './risks.js';
|
|
2
3
|
export type StepState = 'done' | 'pending' | 'blocked';
|
|
3
4
|
export interface PlanStep {
|
|
4
5
|
state: StepState;
|
|
@@ -13,9 +14,64 @@ export declare function buildPlayStoreReleasePlan(opts: {
|
|
|
13
14
|
versionCode?: string;
|
|
14
15
|
track: 'production' | 'beta' | 'alpha' | 'internal';
|
|
15
16
|
language: string;
|
|
16
|
-
}): Promise<
|
|
17
|
+
}): Promise<{
|
|
18
|
+
text: string;
|
|
19
|
+
readiness: {
|
|
20
|
+
target: {
|
|
21
|
+
store: "playstore";
|
|
22
|
+
packageName: string;
|
|
23
|
+
track?: string | undefined;
|
|
24
|
+
versionCode?: string | undefined;
|
|
25
|
+
} | {
|
|
26
|
+
store: "appstore";
|
|
27
|
+
appId: string;
|
|
28
|
+
versionId?: string | undefined;
|
|
29
|
+
versionString?: string | undefined;
|
|
30
|
+
platform?: "IOS" | "MAC_OS" | "TV_OS" | "VISION_OS" | undefined;
|
|
31
|
+
};
|
|
32
|
+
targetVerified: boolean;
|
|
33
|
+
checkStatus: "incomplete" | "complete";
|
|
34
|
+
canSubmit: boolean;
|
|
35
|
+
blockingCodes: string[];
|
|
36
|
+
risks: {
|
|
37
|
+
level: "warning" | "blocker" | "info";
|
|
38
|
+
code: string;
|
|
39
|
+
title: string;
|
|
40
|
+
detail: string;
|
|
41
|
+
fixUrl?: string | undefined;
|
|
42
|
+
}[];
|
|
43
|
+
};
|
|
44
|
+
}>;
|
|
17
45
|
export declare function buildAppStoreReleasePlan(opts: {
|
|
18
46
|
appId: string;
|
|
19
47
|
versionString?: string;
|
|
20
48
|
versionId?: string;
|
|
21
|
-
|
|
49
|
+
policy?: AppStorePolicy;
|
|
50
|
+
}): Promise<{
|
|
51
|
+
text: string;
|
|
52
|
+
readiness: {
|
|
53
|
+
target: {
|
|
54
|
+
store: "playstore";
|
|
55
|
+
packageName: string;
|
|
56
|
+
track?: string | undefined;
|
|
57
|
+
versionCode?: string | undefined;
|
|
58
|
+
} | {
|
|
59
|
+
store: "appstore";
|
|
60
|
+
appId: string;
|
|
61
|
+
versionId?: string | undefined;
|
|
62
|
+
versionString?: string | undefined;
|
|
63
|
+
platform?: "IOS" | "MAC_OS" | "TV_OS" | "VISION_OS" | undefined;
|
|
64
|
+
};
|
|
65
|
+
targetVerified: boolean;
|
|
66
|
+
checkStatus: "incomplete" | "complete";
|
|
67
|
+
canSubmit: boolean;
|
|
68
|
+
blockingCodes: string[];
|
|
69
|
+
risks: {
|
|
70
|
+
level: "warning" | "blocker" | "info";
|
|
71
|
+
code: string;
|
|
72
|
+
title: string;
|
|
73
|
+
detail: string;
|
|
74
|
+
fixUrl?: string | undefined;
|
|
75
|
+
}[];
|
|
76
|
+
};
|
|
77
|
+
}>;
|