@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.
Files changed (50) hide show
  1. package/README.md +1 -1
  2. package/assets/agent-guide.md +20 -2
  3. package/dist/appstore/app-info-policy.d.ts +27 -0
  4. package/dist/appstore/app-info-policy.js +104 -0
  5. package/dist/appstore/app-info.d.ts +19 -0
  6. package/dist/appstore/app-info.js +68 -0
  7. package/dist/appstore/apps.d.ts +1 -5
  8. package/dist/appstore/apps.js +12 -37
  9. package/dist/appstore/asset-library-write.d.ts +39 -0
  10. package/dist/appstore/asset-library-write.js +282 -0
  11. package/dist/appstore/asset-library.d.ts +28 -0
  12. package/dist/appstore/asset-library.js +197 -0
  13. package/dist/appstore/client.d.ts +4 -3
  14. package/dist/appstore/declarations.js +11 -14
  15. package/dist/appstore/messages.js +4 -4
  16. package/dist/appstore/previews.js +3 -29
  17. package/dist/appstore/read-response.d.ts +27 -0
  18. package/dist/appstore/read-response.js +38 -0
  19. package/dist/appstore/release-target.d.ts +54 -0
  20. package/dist/appstore/release-target.js +124 -0
  21. package/dist/appstore/release.js +100 -47
  22. package/dist/appstore/review-preview.d.ts +19 -0
  23. package/dist/appstore/review-preview.js +141 -0
  24. package/dist/appstore/review-submission.d.ts +2 -28
  25. package/dist/appstore/review-submission.js +14 -59
  26. package/dist/appstore/screenshots.d.ts +1 -0
  27. package/dist/appstore/screenshots.js +60 -4
  28. package/dist/appstore/upload-parts.d.ts +11 -0
  29. package/dist/appstore/upload-parts.js +29 -0
  30. package/dist/appstore/versions.d.ts +9 -0
  31. package/dist/appstore/versions.js +15 -14
  32. package/dist/checks/appstore-submission.d.ts +75 -0
  33. package/dist/checks/appstore-submission.js +56 -0
  34. package/dist/checks/plan.d.ts +58 -2
  35. package/dist/checks/plan.js +103 -106
  36. package/dist/checks/release-readiness.d.ts +195 -0
  37. package/dist/checks/release-readiness.js +58 -0
  38. package/dist/checks/release-status.d.ts +76 -0
  39. package/dist/checks/release-status.js +72 -0
  40. package/dist/checks/risks.d.ts +40 -14
  41. package/dist/checks/risks.js +283 -231
  42. package/dist/lib/tool-registrar.d.ts +1 -1
  43. package/dist/lib/tool-registrar.js +5 -5
  44. package/dist/playstore/edits.js +25 -2
  45. package/dist/registers/appstore/media.js +69 -24
  46. package/dist/registers/appstore/review-submission.js +8 -4
  47. package/dist/registers/checks.js +34 -94
  48. package/dist/registers/playstore.js +5 -4
  49. package/package.json +1 -1
  50. package/tool-manifest.json +5 -2
package/README.md CHANGED
@@ -149,7 +149,7 @@ export ANTHROPIC_API_KEY=sk-ant-...
149
149
  <!-- generated:readme-tools-table:start — edit scripts/docs-spec.mjs, then npm run plugin:sync -->
150
150
  | 영역 | 도구 수 | 주요 도구 |
151
151
  |------|---------|-----------|
152
- | App Store Connect | 63 | `appstore_submit_for_review` / `appstore_get_weekly_insight` / `appstore_update_product_review_note` / `appstore_upload_product_review_screenshot` |
152
+ | App Store Connect | 64 | `appstore_submit_for_review` / `appstore_get_weekly_insight` / `appstore_update_product_review_note` / `appstore_upload_product_review_screenshot` |
153
153
  | Google Play | 38 | `playstore_submit_release` / `playstore_promote_release` / `playstore_replace_images` / `playstore_reply_review` / `playstore_verify_service_account` |
154
154
  | Firebase | 21 | `firebase_create_project` / `firebase_get_remote_config_overview` / `firebase_get_android_config` / `firebase_create_ios_app` |
155
155
  | AdMob | 7 | `admob_list_apps` / `admob_create_ad_unit` / `admob_get_today_earnings` / `admob_get_report` |
@@ -57,9 +57,9 @@ Use the table to find tool names, then select only the active tools needed for t
57
57
  | Pre-submission declarations (both stores) | `select:appstore_get_age_rating,appstore_update_age_rating,appstore_declare_encryption,appstore_get_availability,appstore_set_territory_availability,playstore_upload_data_safety` |
58
58
  | TestFlight external testing | `select:appstore_beta_status,appstore_update_beta_review_detail,appstore_update_beta_test_info,appstore_update_whats_to_test,appstore_submit_beta_review,appstore_set_beta_group_build,appstore_add_beta_testers,appstore_notify_beta_testers,appstore_list_beta_groups,appstore_list_builds` |
59
59
  | App Store review submission (the bundle) | `select:appstore_list_review_submissions,appstore_add_version_to_review_submission,appstore_remove_review_submission_item,appstore_update_version_string,appstore_cancel_review` |
60
- | App Store preview videos | `select:appstore_list_previews,appstore_upload_preview,appstore_delete_preview,appstore_get_metadata` |
60
+ | App Store preview videos | `select:appstore_list_previews,appstore_upload_preview,appstore_delete_preview,appstore_reorder_media_placements,appstore_get_metadata` |
61
61
  | Play post-release recovery | `select:playstore_list_recovery_actions,playstore_create_recovery_action,playstore_deploy_recovery_action,playstore_cancel_recovery_action,playstore_list_tracks` |
62
- | App Store screenshots | `select:appstore_list_app_info_localizations,appstore_get_metadata,appstore_list_screenshots,appstore_upload_screenshot,appstore_delete_screenshot,appstore_delete_screenshot_set,screenshot_validate` |
62
+ | App Store screenshots | `select:appstore_list_app_info_localizations,appstore_get_metadata,appstore_list_screenshots,appstore_upload_screenshot,appstore_delete_screenshot,appstore_delete_screenshot_set,appstore_reorder_media_placements,screenshot_validate` |
63
63
  | App Store app info + review notes | `select:appstore_get_app_info,appstore_update_app_info_localization,appstore_create_app_info_localization,appstore_update_localization,appstore_get_review_notes,appstore_update_review_notes` |
64
64
  | App Store reviews | `select:appstore_list_reviews,appstore_reply_review,generate_review_reply` |
65
65
  | App Store IAP (products + review metadata) | `select:appstore_list_products,appstore_create_inapp_purchase,appstore_create_subscription,appstore_update_product,appstore_list_product_localizations,appstore_update_product_localization,appstore_update_product_review_note,appstore_upload_product_review_screenshot,appstore_add_product_to_review,appstore_delete_product` |
@@ -234,6 +234,14 @@ per-domain inventory is [`docs/domain/tool-catalog.md`](domain/tool-catalog.md).
234
234
 
235
235
  ## 4. Workflows (call sequences)
236
236
 
237
+ Use `release_status` to check a known release across both stores. It reports the build linked to the selected
238
+ Apple version. Use the exact Play version code when available.
239
+
240
+ Use the store's `*_plan_release` for a checklist with submission risks already included. The plan and
241
+ `*_check_submission_risks` expose the same MCP structured output. Use `target` for the checked identifiers
242
+ and report `blockingCodes` or an incomplete check before continuing. A passing `canSubmit` result describes
243
+ the checks performed. Keep the preview and approval steps below, and recheck after changes to the target.
244
+
237
245
  ### Play Store release / promote
238
246
  1. `playstore_list_tracks` — see current track/version state.
239
247
  2. Check the selected track and version code with `playstore_check_submission_risks`. Report blockers or incomplete checks and stop the release workflow.
@@ -247,6 +255,16 @@ per-domain inventory is [`docs/domain/tool-catalog.md`](domain/tool-catalog.md).
247
255
  3. Run `appstore_check_submission_risks` for the selected version. Report blockers or incomplete checks and stop. If requested, apply approved release notes to the same version.
248
256
  4. For requested submissions, show the `appstore_submit_for_review` preview and get explicit approval before confirming with the same arguments.
249
257
 
258
+ ### App Store product page media
259
+
260
+ Use the screenshot or preview listing to identify the version localization and its existing placements.
261
+ For Asset Library uploads, use the placement group. When the result reports `status: "processing"`, wait for
262
+ Apple to finish processing and call the same upload tool with the returned `assetId` and the same target to
263
+ create the placement. A `status: "placed"` result identifies the saved placement. Run the submission risk
264
+ check before submitting.
265
+ If the upload committed but placement failed, reuse the returned asset ID. To reorder a group, include all
266
+ of its placement IDs in the requested sequence, including both screenshots and previews when present.
267
+
250
268
  ### Service account key → Play / Jenkins (secrets stay on disk)
251
269
  1. `iam_create_service_account` (or reuse one) → `iam_create_key`. The key is written to
252
270
  `~/.mimi-seed/keys/…json` and **only its path** comes back — the private key never enters the conversation.
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ import type { AppStorePlatform } from './release-target.js';
3
+ export declare const appInfoReleasePolicyQuery: {
4
+ include: string;
5
+ 'limit[appInfoLocalizations]': string;
6
+ 'fields[appInfos]': string;
7
+ 'fields[appInfoLocalizations]': string;
8
+ 'fields[ageRatingDeclarations]': string;
9
+ };
10
+ declare const ageRatingResponse: z.ZodObject<{
11
+ data: z.ZodNullable<z.ZodObject<{
12
+ attributes: z.ZodObject<{
13
+ userGeneratedContent: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>, z.ZodTransform<boolean | undefined, boolean | null | undefined>>;
14
+ socialMedia: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>, z.ZodTransform<boolean | undefined, boolean | null | undefined>>;
15
+ socialMediaAgeRestricted: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>, z.ZodTransform<boolean | undefined, boolean | null | undefined>>;
16
+ ageAssurance: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>, z.ZodTransform<boolean | undefined, boolean | null | undefined>>;
17
+ }, z.core.$strip>;
18
+ }, z.core.$strip>>;
19
+ }, z.core.$strip>;
20
+ export interface IncludedAppInfoPolicy {
21
+ hasPrivacy?: true;
22
+ ageRating?: z.infer<typeof ageRatingResponse>;
23
+ }
24
+ export declare function readIncludedAppInfoPolicy(relationships: unknown, included: unknown, platform: AppStorePlatform): IncludedAppInfoPolicy;
25
+ export declare function readAppInfoPrivacy(appInfoId: string, platform: AppStorePlatform): Promise<boolean>;
26
+ export declare function readAppInfoAgeRatingForRelease(appInfoId: string): Promise<z.infer<typeof ageRatingResponse>>;
27
+ export {};
@@ -0,0 +1,104 @@
1
+ import { z } from 'zod';
2
+ import { encodePathSegment } from '../lib/url-path.js';
3
+ import { isNotFound } from './http.js';
4
+ import { appStorePagination, getAppStoreResponse, pageIsIncomplete } from './read-response.js';
5
+ const privacyFields = 'privacyPolicyUrl,privacyPolicyText';
6
+ const ageRatingFields = 'userGeneratedContent,socialMedia,socialMediaAgeRestricted,ageAssurance';
7
+ export const appInfoReleasePolicyQuery = {
8
+ include: 'appInfoLocalizations,ageRatingDeclaration',
9
+ 'limit[appInfoLocalizations]': '10',
10
+ 'fields[appInfos]': 'state,appInfoLocalizations,ageRatingDeclaration',
11
+ 'fields[appInfoLocalizations]': privacyFields,
12
+ 'fields[ageRatingDeclarations]': ageRatingFields,
13
+ };
14
+ const privacyAttributes = z.object({
15
+ privacyPolicyUrl: z.string().trim().nullish(),
16
+ privacyPolicyText: z.string().trim().nullish(),
17
+ });
18
+ const privacyLocalizationPage = appStorePagination.extend({
19
+ data: z.array(z.object({ attributes: privacyAttributes.nullish() })),
20
+ });
21
+ const ageAnswer = z.boolean().nullish().transform((value) => value ?? undefined);
22
+ const ageRatingAttributes = z.object({
23
+ userGeneratedContent: ageAnswer,
24
+ socialMedia: ageAnswer,
25
+ socialMediaAgeRestricted: ageAnswer,
26
+ ageAssurance: ageAnswer,
27
+ });
28
+ const ageRatingResponse = z.object({ data: z.object({ attributes: ageRatingAttributes }).nullable() });
29
+ const resourceId = z.string().min(1);
30
+ const includedResources = z.array(z.unknown());
31
+ const includedResource = z.object({
32
+ id: resourceId,
33
+ type: z.enum(['appInfoLocalizations', 'ageRatingDeclarations']),
34
+ attributes: z.unknown().optional(),
35
+ });
36
+ const appInfoPolicyRelationships = z.object({
37
+ appInfoLocalizations: z.unknown().optional(),
38
+ ageRatingDeclaration: z.unknown().optional(),
39
+ });
40
+ const localizationLinks = z.object({
41
+ data: z.array(z.object({ type: z.literal('appInfoLocalizations'), id: resourceId })),
42
+ });
43
+ const ageRatingLink = z.object({
44
+ data: z.object({ type: z.literal('ageRatingDeclarations'), id: resourceId }),
45
+ });
46
+ function hasPrivacyPolicy(platform, attributes) {
47
+ return Boolean(platform === 'TV_OS' ? attributes?.privacyPolicyText : attributes?.privacyPolicyUrl);
48
+ }
49
+ export function readIncludedAppInfoPolicy(relationships, included, platform) {
50
+ const links = appInfoPolicyRelationships.safeParse(relationships);
51
+ const resources = includedResources.safeParse(included);
52
+ if (!links.success || !resources.success)
53
+ return {};
54
+ const byId = new Map();
55
+ for (const raw of resources.data) {
56
+ const row = includedResource.safeParse(raw);
57
+ if (row.success) {
58
+ const key = `${row.data.type}:${row.data.id}`;
59
+ byId.set(key, byId.has(key) ? undefined : row.data.attributes);
60
+ }
61
+ }
62
+ // Included localizations can be partial, so only a linked policy can settle the privacy check.
63
+ const policy = {};
64
+ const localizations = localizationLinks.safeParse(links.data.appInfoLocalizations);
65
+ if (localizations.success && localizations.data.data.some(({ id }) => {
66
+ const attributes = privacyAttributes.safeParse(byId.get(`appInfoLocalizations:${id}`));
67
+ return attributes.success && hasPrivacyPolicy(platform, attributes.data);
68
+ })) {
69
+ policy.hasPrivacy = true;
70
+ }
71
+ const ageLink = ageRatingLink.safeParse(links.data.ageRatingDeclaration);
72
+ if (!ageLink.success)
73
+ return policy;
74
+ const age = ageRatingAttributes.safeParse(byId.get(`ageRatingDeclarations:${ageLink.data.data.id}`));
75
+ if (!age.success)
76
+ return policy;
77
+ const { socialMedia, socialMediaAgeRestricted, userGeneratedContent, ageAssurance } = age.data;
78
+ if (socialMedia !== undefined && socialMediaAgeRestricted !== undefined
79
+ && (socialMedia || userGeneratedContent !== undefined)
80
+ && (!socialMediaAgeRestricted || ageAssurance !== undefined)) {
81
+ policy.ageRating = { data: { attributes: age.data } };
82
+ }
83
+ return policy;
84
+ }
85
+ export async function readAppInfoPrivacy(appInfoId, platform) {
86
+ const localizations = await getAppStoreResponse(privacyLocalizationPage, `/appInfos/${encodePathSegment(appInfoId)}/appInfoLocalizations`, { 'fields[appInfoLocalizations]': privacyFields, limit: '200' });
87
+ if (localizations.data.some(({ attributes }) => hasPrivacyPolicy(platform, attributes)))
88
+ return true;
89
+ if (pageIsIncomplete(localizations, localizations.data.length)) {
90
+ throw new Error('App Store Connect의 개인정보 로컬라이제이션 목록이 불완전합니다.');
91
+ }
92
+ return false;
93
+ }
94
+ export async function readAppInfoAgeRatingForRelease(appInfoId) {
95
+ try {
96
+ return await getAppStoreResponse(ageRatingResponse, `/appInfos/${encodePathSegment(appInfoId)}/ageRatingDeclaration`, { 'fields[ageRatingDeclarations]': ageRatingFields });
97
+ }
98
+ catch (error) {
99
+ // An explicit 404 confirms that this app info has no declaration.
100
+ if (isNotFound(error))
101
+ return { data: null };
102
+ throw error;
103
+ }
104
+ }
@@ -0,0 +1,19 @@
1
+ import { type IncludedAppInfoPolicy } from './app-info-policy.js';
2
+ import type { AppStorePlatform } from './release-target.js';
3
+ export interface AppInfoRecord {
4
+ id: string;
5
+ state?: string;
6
+ ageRating?: string;
7
+ }
8
+ export declare function listAppInfoRecords(appId: string): Promise<AppInfoRecord[]>;
9
+ type AppInfoSelection = {
10
+ target: AppInfoRecord;
11
+ policy: IncludedAppInfoPolicy;
12
+ } | {
13
+ reason: string;
14
+ };
15
+ export declare function selectAppInfo(appId: string, options?: {
16
+ privacyPlatform?: AppStorePlatform;
17
+ }): Promise<AppInfoSelection>;
18
+ export declare function requireAppInfo(appId: string): Promise<AppInfoRecord>;
19
+ export {};
@@ -0,0 +1,68 @@
1
+ import { z } from 'zod';
2
+ import { encodePathSegment } from '../lib/url-path.js';
3
+ import { appInfoReleasePolicyQuery, readIncludedAppInfoPolicy } from './app-info-policy.js';
4
+ import { appStorePagination, getAppStoreResponse, pageIsIncomplete } from './read-response.js';
5
+ const appInfoPage = appStorePagination.extend({
6
+ data: z.array(z.object({
7
+ id: z.string().min(1),
8
+ type: z.literal('appInfos').optional(),
9
+ attributes: z.object({
10
+ state: z.string().nullish(),
11
+ appStoreState: z.string().nullish(),
12
+ appStoreAgeRating: z.string().nullish(),
13
+ }).nullish(),
14
+ relationships: z.unknown().optional(),
15
+ })),
16
+ included: z.unknown().optional(),
17
+ });
18
+ const editableStates = new Set(['PREPARE_FOR_SUBMISSION', 'DEVELOPER_REJECTED', 'REJECTED', 'METADATA_REJECTED']);
19
+ const reviewStates = new Set(['READY_FOR_REVIEW', 'WAITING_FOR_REVIEW', 'IN_REVIEW', 'ACCEPTED', 'PENDING_RELEASE', 'PENDING_DEVELOPER_RELEASE']);
20
+ const replacedStates = new Set(['REPLACED_WITH_NEW_INFO', 'REPLACED_WITH_NEW_VERSION']);
21
+ function readAppInfoPage(appId, params) {
22
+ return getAppStoreResponse(appInfoPage, `/apps/${encodePathSegment(appId)}/appInfos`, {
23
+ 'fields[appInfos]': 'state',
24
+ limit: '200',
25
+ ...params,
26
+ });
27
+ }
28
+ function toAppInfoRecord({ id, attributes }) {
29
+ return {
30
+ id,
31
+ state: attributes?.state ?? attributes?.appStoreState ?? undefined,
32
+ ageRating: attributes?.appStoreAgeRating ?? undefined,
33
+ };
34
+ }
35
+ export async function listAppInfoRecords(appId) {
36
+ const page = await readAppInfoPage(appId, { 'fields[appInfos]': 'state,appStoreAgeRating' });
37
+ return page.data.map(toAppInfoRecord);
38
+ }
39
+ export async function selectAppInfo(appId, options = {}) {
40
+ const { privacyPlatform } = options;
41
+ const page = await readAppInfoPage(appId, privacyPlatform ? appInfoReleasePolicyQuery : {});
42
+ const ids = new Set(page.data.map(({ id }) => id));
43
+ if (ids.size !== page.data.length || pageIsIncomplete(page, page.data.length)) {
44
+ return { reason: 'App Store Connect의 앱 정보 목록이 불완전합니다.' };
45
+ }
46
+ const records = page.data.map((row) => ({ record: toAppInfoRecord(row), relationships: row.relationships }));
47
+ const current = records.filter(({ record: { state } }) => !state || !replacedStates.has(state));
48
+ if (current.length === 0)
49
+ return { reason: '현재 사용할 수 있는 앱 정보 레코드가 없습니다.' };
50
+ // Prefer a draft, then a version under review. Keep the single current-record fallback
51
+ // for published apps and older responses that omit state.
52
+ const editable = current.filter(({ record: { state } }) => state && editableStates.has(state));
53
+ const inReview = editable.length === 0
54
+ ? current.filter(({ record: { state } }) => state && reviewStates.has(state))
55
+ : [];
56
+ const candidates = editable.length > 0 ? editable : inReview.length > 0 ? inReview : current;
57
+ if (candidates.length !== 1)
58
+ return { reason: '대상 앱 정보 레코드를 하나로 확정할 수 없습니다.' };
59
+ const { record: target, relationships } = candidates[0];
60
+ const policy = privacyPlatform ? readIncludedAppInfoPolicy(relationships, page.included, privacyPlatform) : {};
61
+ return { target, policy };
62
+ }
63
+ export async function requireAppInfo(appId) {
64
+ const selection = await selectAppInfo(appId);
65
+ if ('reason' in selection)
66
+ throw new Error(selection.reason);
67
+ return selection.target;
68
+ }
@@ -22,11 +22,7 @@ export declare function listBetaGroups(appId: string): Promise<{
22
22
  publicLink: string | undefined;
23
23
  publicLinkEnabled: boolean | undefined;
24
24
  }[]>;
25
- export declare function getAppInfo(appId: string): Promise<{
26
- id: string;
27
- state: string | undefined;
28
- ageRating: string | undefined;
29
- }[]>;
25
+ export declare function getAppInfo(appId: string): Promise<import("./app-info.js").AppInfoRecord[]>;
30
26
  export interface AppInfoLocalizationFields {
31
27
  name?: string;
32
28
  subtitle?: string;
@@ -1,12 +1,13 @@
1
1
  // App Store Connect — 앱·앱 정보(로컬라이제이션)·TestFlight 베타 그룹·고객 리뷰.
2
2
  // appstore/tools.ts 가 이 모듈을 그대로 re-export 한다 — 호출부는 tools.js 경로를 계속 쓴다.
3
3
  import { apiGet, apiPatch, apiPost } from './client.js';
4
+ import { listAppInfoRecords, requireAppInfo } from './app-info.js';
4
5
  import { encodePathSegment } from '../lib/url-path.js';
5
6
  export async function listApps() {
6
- const data = (await apiGet('/apps', {
7
- 'fields[apps]': 'name,bundleId,sku,primaryLocale,contentRightsDeclaration',
7
+ const data = await apiGet('/apps', {
8
+ 'fields[apps]': 'name,bundleId,sku,primaryLocale',
8
9
  'limit': '200',
9
- }));
10
+ });
10
11
  return (data.data ?? []).map((a) => ({
11
12
  id: a.id,
12
13
  name: a.attributes?.name,
@@ -16,17 +17,16 @@ export async function listApps() {
16
17
  }));
17
18
  }
18
19
  export async function getApp(appId) {
19
- const data = (await apiGet(`/apps/${encodePathSegment(appId)}`, {
20
+ const data = await apiGet(`/apps/${encodePathSegment(appId)}`, {
20
21
  'fields[apps]': 'name,bundleId,sku,primaryLocale,contentRightsDeclaration',
21
- 'include': 'appStoreVersions',
22
- }));
22
+ });
23
23
  return data.data;
24
24
  }
25
25
  // ─── TestFlight 베타 그룹 ───
26
26
  export async function listBetaGroups(appId) {
27
- const data = (await apiGet(`/apps/${encodePathSegment(appId)}/betaGroups`, {
27
+ const data = await apiGet(`/apps/${encodePathSegment(appId)}/betaGroups`, {
28
28
  'fields[betaGroups]': 'name,isInternalGroup,publicLink,publicLinkEnabled',
29
- }));
29
+ });
30
30
  return (data.data ?? []).map((g) => ({
31
31
  id: g.id,
32
32
  name: g.attributes?.name,
@@ -36,36 +36,11 @@ export async function listBetaGroups(appId) {
36
36
  }));
37
37
  }
38
38
  // ─── 앱 정보 (카테고리 등) ───
39
- // AppInfoState — READY_FOR_DISTRIBUTION이 라이브 버전, 그 외(PREPARE_FOR_SUBMISSION /
40
- // DEVELOPER_REJECTED 등)가 편집 가능한 appInfo.
41
- const APP_INFO_LIVE_STATE = 'READY_FOR_DISTRIBUTION';
42
39
  export async function getAppInfo(appId) {
43
- const data = (await apiGet(`/apps/${encodePathSegment(appId)}/appInfos`, {
44
- 'fields[appInfos]': 'state,appStoreAgeRating,brazilAgeRating',
45
- }));
46
- return (data.data ?? []).map((i) => ({
47
- id: i.id,
48
- // 새 필드명 state, 옛 필드명 appStoreState 모두 케어
49
- state: i.attributes?.state ?? i.attributes?.appStoreState,
50
- ageRating: i.attributes?.appStoreAgeRating,
51
- }));
52
- }
53
- async function findEditableAppInfoId(appId) {
54
- const data = await apiGet(`/apps/${encodePathSegment(appId)}/appInfos`, {
55
- 'fields[appInfos]': 'state',
56
- 'limit': '10',
57
- });
58
- const infos = (data?.data ?? []);
59
- if (infos.length === 0) {
60
- throw new Error(`앱 ${appId}에 appInfos가 없어. 앱 ID 확인 필요.`);
61
- }
62
- const stateOf = (i) => i.attributes?.state ?? i.attributes?.appStoreState ?? '';
63
- const editable = infos.find((i) => stateOf(i) !== APP_INFO_LIVE_STATE);
64
- const target = editable ?? infos[0];
65
- return { appInfoId: target.id, state: stateOf(target) };
40
+ return listAppInfoRecords(appId);
66
41
  }
67
42
  export async function listAppInfoLocalizations(appId, locale) {
68
- const { appInfoId, state } = await findEditableAppInfoId(appId);
43
+ const { id: appInfoId, state = '' } = await requireAppInfo(appId);
69
44
  const data = await apiGet(`/appInfos/${encodePathSegment(appInfoId)}/appInfoLocalizations`, {
70
45
  'fields[appInfoLocalizations]': 'locale,name,subtitle,privacyPolicyUrl,privacyPolicyText',
71
46
  'limit': '200',
@@ -96,7 +71,7 @@ export async function updateAppInfoLocalization(localizationId, fields) {
96
71
  }
97
72
  export async function createAppInfoLocalization(appId, locale, fields) {
98
73
  const attributes = Object.fromEntries(Object.entries(fields).filter(([, v]) => v !== undefined));
99
- const { appInfoId, state } = await findEditableAppInfoId(appId);
74
+ const { id: appInfoId, state = '' } = await requireAppInfo(appId);
100
75
  const data = await apiPost('/appInfoLocalizations', {
101
76
  data: {
102
77
  type: 'appInfoLocalizations',
@@ -135,7 +110,7 @@ export async function listCustomerReviews(appId, opts = {}) {
135
110
  params['filter[territory]'] = opts.territory;
136
111
  if (opts.rating != null)
137
112
  params['filter[rating]'] = String(opts.rating);
138
- const data = (await apiGet(`/apps/${encodePathSegment(appId)}/customerReviews`, params));
113
+ const data = await apiGet(`/apps/${encodePathSegment(appId)}/customerReviews`, params);
139
114
  // include로 가져온 답변 매핑
140
115
  const responses = new Map();
141
116
  for (const inc of data.included ?? []) {
@@ -0,0 +1,39 @@
1
+ type PlacementType = 'APP_SCREENSHOT' | 'APP_PREVIEW';
2
+ type PlacementTarget = {
3
+ localizationId: string;
4
+ placementGroup: string;
5
+ };
6
+ type UploadedMedia = {
7
+ assetId: string;
8
+ placementGroup: string;
9
+ } & ({
10
+ status: 'processing';
11
+ assetState: 'UPLOAD_COMPLETE';
12
+ message: string;
13
+ } | {
14
+ status: 'placed';
15
+ placementId: string;
16
+ reusedPlacement: boolean;
17
+ assetState?: string;
18
+ placementState?: string;
19
+ });
20
+ export declare function uploadAndPlaceMedia(args: PlacementTarget & {
21
+ placementType: PlacementType;
22
+ filePath?: string;
23
+ assetId?: string;
24
+ previewFrameTimeCode?: string;
25
+ }): Promise<UploadedMedia>;
26
+ export declare function reorderMediaPlacements(args: PlacementTarget & {
27
+ placementIds: string[];
28
+ }): Promise<{
29
+ changed: boolean;
30
+ placementGroup: string;
31
+ placementIds: string[];
32
+ orderingRequestId?: undefined;
33
+ } | {
34
+ changed: boolean;
35
+ orderingRequestId: string;
36
+ placementGroup: string;
37
+ placementIds: string[];
38
+ }>;
39
+ export {};