@yoonion/mimi-seed-mcp 0.23.2 → 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/assets/agent-guide.md +8 -0
- package/dist/appstore/apps.js +1 -2
- package/dist/appstore/asset-library.js +4 -11
- package/dist/appstore/messages.js +4 -4
- package/dist/appstore/read-response.d.ts +13 -0
- package/dist/appstore/read-response.js +18 -0
- package/dist/appstore/release-target.d.ts +7 -2
- package/dist/appstore/release-target.js +39 -22
- 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 +1 -27
- package/dist/appstore/review-submission.js +2 -49
- package/dist/appstore/versions.d.ts +9 -0
- package/dist/appstore/versions.js +3 -1
- 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 +87 -80
- 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 +32 -16
- package/dist/checks/risks.js +106 -97
- 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/review-submission.js +8 -4
- package/dist/registers/checks.js +34 -94
- package/dist/registers/playstore.js +5 -4
- package/package.json +1 -1
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { collectPages } from '../lib/paginate.js';
|
|
3
|
+
import { encodePathSegment } from '../lib/url-path.js';
|
|
4
|
+
import { isNotFound } from './http.js';
|
|
5
|
+
import { appStoreNextPagePath, appStorePagination, appStoreResourceRef, appStoreToOne, getAppStoreResponse, includedAppStoreResource, pageIsIncomplete } from './read-response.js';
|
|
6
|
+
import { requireVersionAppAndPlatform } from './versions.js';
|
|
7
|
+
const buildFields = 'version,uploadedDate,processingState';
|
|
8
|
+
const localizationFields = 'locale,whatsNew';
|
|
9
|
+
const localizationType = 'appStoreVersionLocalizations';
|
|
10
|
+
const includedLocalizationLimit = 50;
|
|
11
|
+
const previewVersion = z.object({
|
|
12
|
+
data: appStoreResourceRef.extend({
|
|
13
|
+
type: z.literal('appStoreVersions'),
|
|
14
|
+
attributes: z.object({
|
|
15
|
+
platform: z.string().nullish(),
|
|
16
|
+
versionString: z.string().nullish(),
|
|
17
|
+
appStoreState: z.string().nullish(),
|
|
18
|
+
appVersionState: z.string().nullish(),
|
|
19
|
+
}).optional(),
|
|
20
|
+
relationships: z.object({
|
|
21
|
+
app: appStoreToOne.optional(),
|
|
22
|
+
build: z.unknown().optional(),
|
|
23
|
+
[localizationType]: z.unknown().optional(),
|
|
24
|
+
}).optional(),
|
|
25
|
+
}),
|
|
26
|
+
included: z.array(z.unknown()).nullish(),
|
|
27
|
+
});
|
|
28
|
+
const previewBuild = appStoreResourceRef.extend({
|
|
29
|
+
type: z.literal('builds'),
|
|
30
|
+
attributes: z.object({
|
|
31
|
+
version: z.string().trim().min(1),
|
|
32
|
+
uploadedDate: z.string().nullish(),
|
|
33
|
+
processingState: z.string().trim().min(1),
|
|
34
|
+
}),
|
|
35
|
+
});
|
|
36
|
+
const previewBuildResponse = z.object({ data: previewBuild.nullable() });
|
|
37
|
+
const localizationResource = appStoreResourceRef.extend({
|
|
38
|
+
type: z.literal(localizationType),
|
|
39
|
+
attributes: z.object({ locale: z.string().min(1), whatsNew: z.string().nullish() }),
|
|
40
|
+
});
|
|
41
|
+
const localizationLinkage = appStorePagination.extend({ data: z.array(appStoreResourceRef) });
|
|
42
|
+
const localizationPage = appStorePagination.extend({ data: z.array(localizationResource) });
|
|
43
|
+
const incompleteLocalizations = 'App Store Connect에서 출시 노트의 전체 로케일을 확인할 수 없습니다.';
|
|
44
|
+
async function readPreviewBuild(path, document) {
|
|
45
|
+
const link = appStoreToOne.safeParse(document.data.relationships?.build).data?.data;
|
|
46
|
+
if (link === null)
|
|
47
|
+
return undefined;
|
|
48
|
+
const ref = link?.type === 'builds' ? link : undefined;
|
|
49
|
+
const embedded = ref && includedAppStoreResource(document.included, ref, previewBuild);
|
|
50
|
+
if (embedded)
|
|
51
|
+
return embedded;
|
|
52
|
+
try {
|
|
53
|
+
const { data } = await getAppStoreResponse(previewBuildResponse, `${path}/build`, { 'fields[builds]': buildFields });
|
|
54
|
+
if (ref && data?.id !== ref.id)
|
|
55
|
+
throw new Error('App Store Connect의 빌드 연결과 상세 조회 결과가 일치하지 않습니다.');
|
|
56
|
+
return data ?? undefined;
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
if (!ref && isNotFound(error))
|
|
60
|
+
return undefined;
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async function readPreviewLocalizations(path, document) {
|
|
65
|
+
const link = localizationLinkage.safeParse(document.data.relationships?.[localizationType]).data;
|
|
66
|
+
const paging = link?.meta?.paging;
|
|
67
|
+
if (link && !pageIsIncomplete(link, link.data.length)
|
|
68
|
+
&& (link.data.length < (paging?.limit ?? includedLocalizationLimit) || paging?.total === link.data.length)
|
|
69
|
+
&& new Set(link.data.map(({ id }) => id)).size === link.data.length) {
|
|
70
|
+
const embedded = link.data.map((ref) => includedAppStoreResource(document.included, ref, localizationResource));
|
|
71
|
+
if (embedded.every((row) => row !== undefined)
|
|
72
|
+
&& new Set(embedded.map(({ attributes }) => attributes.locale.toLowerCase())).size === embedded.length) {
|
|
73
|
+
return embedded;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const endpoint = `${path}/appStoreVersionLocalizations`;
|
|
77
|
+
const params = {
|
|
78
|
+
[`fields[${localizationType}]`]: localizationFields,
|
|
79
|
+
limit: '200',
|
|
80
|
+
};
|
|
81
|
+
const ids = new Set();
|
|
82
|
+
const locales = new Set();
|
|
83
|
+
let total = paging?.total ?? 0;
|
|
84
|
+
const rows = await collectPages(async (next) => {
|
|
85
|
+
const page = await getAppStoreResponse(localizationPage, next ?? endpoint, next ? undefined : params);
|
|
86
|
+
for (const { id, attributes } of page.data) {
|
|
87
|
+
const locale = attributes.locale.toLowerCase();
|
|
88
|
+
if (ids.has(id) || locales.has(locale))
|
|
89
|
+
throw new Error(incompleteLocalizations);
|
|
90
|
+
ids.add(id);
|
|
91
|
+
locales.add(locale);
|
|
92
|
+
}
|
|
93
|
+
total = Math.max(total, page.meta?.paging?.total ?? 0);
|
|
94
|
+
const nextLink = page.links?.next;
|
|
95
|
+
if (!nextLink && (pageIsIncomplete(page, ids.size) || total > ids.size))
|
|
96
|
+
throw new Error(incompleteLocalizations);
|
|
97
|
+
return { items: page.data, nextPageToken: nextLink ? appStoreNextPagePath(endpoint, nextLink) : undefined };
|
|
98
|
+
});
|
|
99
|
+
if (link?.data.some(({ id, type }) => type === localizationType && !ids.has(id))) {
|
|
100
|
+
throw new Error('App Store Connect의 로케일 연결과 상세 조회 결과가 일치하지 않습니다.');
|
|
101
|
+
}
|
|
102
|
+
return rows;
|
|
103
|
+
}
|
|
104
|
+
/** Read the review target and preview together. Resolve missing included resources against that same version. */
|
|
105
|
+
export async function buildSubmitForReviewPreview(versionId) {
|
|
106
|
+
const path = `/appStoreVersions/${encodePathSegment(versionId)}`;
|
|
107
|
+
const document = await getAppStoreResponse(previewVersion, path, {
|
|
108
|
+
'fields[appStoreVersions]': `platform,app,versionString,appStoreState,appVersionState,build,${localizationType}`,
|
|
109
|
+
'fields[apps]': 'bundleId',
|
|
110
|
+
'fields[builds]': buildFields,
|
|
111
|
+
[`fields[${localizationType}]`]: localizationFields,
|
|
112
|
+
[`limit[${localizationType}]`]: String(includedLocalizationLimit),
|
|
113
|
+
include: `app,build,${localizationType}`,
|
|
114
|
+
});
|
|
115
|
+
const { appId, platform } = requireVersionAppAndPlatform(versionId, document.data);
|
|
116
|
+
const attributes = document.data.attributes;
|
|
117
|
+
const versionString = attributes?.versionString;
|
|
118
|
+
const state = attributes?.appStoreState ?? attributes?.appVersionState;
|
|
119
|
+
if (!versionString?.trim() || !state?.trim()) {
|
|
120
|
+
throw new Error('App Store Connect에서 심사 대상의 버전명과 상태를 확인할 수 없습니다.');
|
|
121
|
+
}
|
|
122
|
+
const [build, localizations] = await Promise.all([
|
|
123
|
+
readPreviewBuild(path, document),
|
|
124
|
+
readPreviewLocalizations(path, document),
|
|
125
|
+
]);
|
|
126
|
+
const whatsNewByLocale = localizations.flatMap(({ attributes: { locale, whatsNew } }) => whatsNew ? [{
|
|
127
|
+
locale, length: whatsNew.length, excerpt: whatsNew.length > 200 ? `${whatsNew.slice(0, 200)}…` : whatsNew,
|
|
128
|
+
}] : []);
|
|
129
|
+
return {
|
|
130
|
+
versionId, appId, platform,
|
|
131
|
+
versionString,
|
|
132
|
+
state,
|
|
133
|
+
attachedBuild: build && {
|
|
134
|
+
id: build.id,
|
|
135
|
+
buildNumber: build.attributes.version,
|
|
136
|
+
uploadedDate: build.attributes.uploadedDate ?? undefined,
|
|
137
|
+
processingState: build.attributes.processingState,
|
|
138
|
+
},
|
|
139
|
+
whatsNewByLocale,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
@@ -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;
|
|
@@ -1,8 +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
|
+
export { buildSubmitForReviewPreview } from './review-preview.js';
|
|
6
7
|
async function findOpenReviewSubmission(appId, platform, versionId) {
|
|
7
8
|
// ASC API는 filter[state]=CREATED를 더 이상 허용하지 않음 (READY_FOR_REVIEW, WAITING_FOR_REVIEW 등만 허용).
|
|
8
9
|
// CREATED 상태 submission은 별도로 조회 불가 → 이미 진행 중인 submission만 재사용.
|
|
@@ -65,54 +66,6 @@ async function getReviewSubmissionItems(submissionId) {
|
|
|
65
66
|
}
|
|
66
67
|
return { items: data.data, included: data.included ?? [] };
|
|
67
68
|
}
|
|
68
|
-
/**
|
|
69
|
-
* submit_for_review dry-run 프리뷰 — 비가역 제출 직전 사용자 확인용.
|
|
70
|
-
*
|
|
71
|
-
* 1.4.x 배포 사고 누적: submit 직후 되돌리지 못해 새 versionString bump 으로 우회해야
|
|
72
|
-
* 하는 케이스가 반복됨 (reference_appstore_cancel_review_window). 그 원인이던
|
|
73
|
-
* cancel_review 버그(submitted:false → 항상 409)는 2026-07-25 에 canceled:true 로 고쳤고,
|
|
74
|
-
* 이제 WAITING_FOR_REVIEW 까지는 되돌릴 수 있다. 그래도 IN_REVIEW 이후는 못 되돌리니
|
|
75
|
-
* 호출자가 의도한 그 버전·빌드인지 미리 보여줘서 잘못된 versionId 제출을 차단한다.
|
|
76
|
-
*/
|
|
77
|
-
export async function buildSubmitForReviewPreview(versionId) {
|
|
78
|
-
const { appId, platform } = await getVersionAppAndPlatform(versionId);
|
|
79
|
-
// 버전 메타: versionString + state
|
|
80
|
-
const versionData = await apiGet(`/appStoreVersions/${encodePathSegment(versionId)}`, {
|
|
81
|
-
'fields[appStoreVersions]': 'versionString,appStoreState',
|
|
82
|
-
}).catch(() => null);
|
|
83
|
-
const versionString = versionData?.data?.attributes?.versionString;
|
|
84
|
-
const state = versionData?.data?.attributes?.appStoreState;
|
|
85
|
-
// attached build
|
|
86
|
-
let attachedBuild;
|
|
87
|
-
const build = await apiGet(`/appStoreVersions/${encodePathSegment(versionId)}/build`, {
|
|
88
|
-
'fields[builds]': 'version,uploadedDate,processingState',
|
|
89
|
-
}).catch(() => null);
|
|
90
|
-
if (build?.data?.id) {
|
|
91
|
-
attachedBuild = {
|
|
92
|
-
id: build.data.id,
|
|
93
|
-
buildNumber: build.data.attributes?.version,
|
|
94
|
-
uploadedDate: build.data.attributes?.uploadedDate,
|
|
95
|
-
processingState: build.data.attributes?.processingState,
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
const localizations = (await getVersionLocalizations(versionId).catch(() => []));
|
|
99
|
-
const whatsNewByLocale = localizations
|
|
100
|
-
.filter((l) => typeof l.whatsNew === 'string' && l.whatsNew.length > 0)
|
|
101
|
-
.map((l) => ({
|
|
102
|
-
locale: l.locale,
|
|
103
|
-
length: l.whatsNew.length,
|
|
104
|
-
excerpt: l.whatsNew.length > 200 ? `${l.whatsNew.slice(0, 200)}…` : l.whatsNew,
|
|
105
|
-
}));
|
|
106
|
-
return {
|
|
107
|
-
versionId,
|
|
108
|
-
versionString,
|
|
109
|
-
state,
|
|
110
|
-
appId,
|
|
111
|
-
platform,
|
|
112
|
-
attachedBuild,
|
|
113
|
-
whatsNewByLocale,
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
69
|
async function createReviewSubmission(appId, platform) {
|
|
117
70
|
const created = await apiPost('/reviewSubmissions', {
|
|
118
71
|
data: {
|
|
@@ -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
|
+
};
|
|
@@ -254,7 +254,9 @@ export async function listBuilds(appId) {
|
|
|
254
254
|
// ─── 버전 → 앱/플랫폼 역조회 (빌드 연결·심사 제출이 공유) ───
|
|
255
255
|
export async function getVersionAppAndPlatform(versionId) {
|
|
256
256
|
const data = await apiGet(`/appStoreVersions/${encodePathSegment(versionId)}`, { 'fields[appStoreVersions]': 'platform,app', include: 'app' });
|
|
257
|
-
|
|
257
|
+
return requireVersionAppAndPlatform(versionId, data?.data);
|
|
258
|
+
}
|
|
259
|
+
export function requireVersionAppAndPlatform(versionId, version) {
|
|
258
260
|
const platform = version?.attributes?.platform;
|
|
259
261
|
const app = version?.relationships?.app?.data;
|
|
260
262
|
if (version?.id !== versionId || version.type !== 'appStoreVersions' || app?.type !== 'apps'
|
|
@@ -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
|
+
}>;
|