@yoonion/mimi-seed-mcp 0.23.1 → 0.23.2
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 +12 -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 +11 -35
- 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 +204 -0
- package/dist/appstore/client.d.ts +4 -3
- package/dist/appstore/declarations.js +11 -14
- package/dist/appstore/previews.js +3 -29
- package/dist/appstore/read-response.d.ts +14 -0
- package/dist/appstore/read-response.js +20 -0
- package/dist/appstore/release-target.d.ts +49 -0
- package/dist/appstore/release-target.js +107 -0
- package/dist/appstore/review-submission.d.ts +1 -1
- package/dist/appstore/review-submission.js +12 -10
- 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.js +13 -14
- package/dist/checks/plan.js +47 -57
- package/dist/checks/risks.d.ts +13 -3
- package/dist/checks/risks.js +254 -211
- package/dist/registers/appstore/media.js +69 -24
- package/package.json +1 -1
- 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 |
|
|
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` |
|
package/assets/agent-guide.md
CHANGED
|
@@ -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` |
|
|
@@ -247,6 +247,16 @@ per-domain inventory is [`docs/domain/tool-catalog.md`](domain/tool-catalog.md).
|
|
|
247
247
|
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
248
|
4. For requested submissions, show the `appstore_submit_for_review` preview and get explicit approval before confirming with the same arguments.
|
|
249
249
|
|
|
250
|
+
### App Store product page media
|
|
251
|
+
|
|
252
|
+
Use the screenshot or preview listing to identify the version localization and its existing placements.
|
|
253
|
+
For Asset Library uploads, use the placement group. When the result reports `status: "processing"`, wait for
|
|
254
|
+
Apple to finish processing and call the same upload tool with the returned `assetId` and the same target to
|
|
255
|
+
create the placement. A `status: "placed"` result identifies the saved placement. Run the submission risk
|
|
256
|
+
check before submitting.
|
|
257
|
+
If the upload committed but placement failed, reuse the returned asset ID. To reorder a group, include all
|
|
258
|
+
of its placement IDs in the requested sequence, including both screenshots and previews when present.
|
|
259
|
+
|
|
250
260
|
### Service account key → Play / Jenkins (secrets stay on disk)
|
|
251
261
|
1. `iam_create_service_account` (or reuse one) → `iam_create_key`. The key is written to
|
|
252
262
|
`~/.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
|
+
}
|
package/dist/appstore/apps.d.ts
CHANGED
|
@@ -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;
|
package/dist/appstore/apps.js
CHANGED
|
@@ -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 =
|
|
7
|
+
const data = await apiGet('/apps', {
|
|
7
8
|
'fields[apps]': 'name,bundleId,sku,primaryLocale,contentRightsDeclaration',
|
|
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,17 @@ export async function listApps() {
|
|
|
16
17
|
}));
|
|
17
18
|
}
|
|
18
19
|
export async function getApp(appId) {
|
|
19
|
-
const data =
|
|
20
|
+
const data = await apiGet(`/apps/${encodePathSegment(appId)}`, {
|
|
20
21
|
'fields[apps]': 'name,bundleId,sku,primaryLocale,contentRightsDeclaration',
|
|
21
22
|
'include': 'appStoreVersions',
|
|
22
|
-
})
|
|
23
|
+
});
|
|
23
24
|
return data.data;
|
|
24
25
|
}
|
|
25
26
|
// ─── TestFlight 베타 그룹 ───
|
|
26
27
|
export async function listBetaGroups(appId) {
|
|
27
|
-
const data =
|
|
28
|
+
const data = await apiGet(`/apps/${encodePathSegment(appId)}/betaGroups`, {
|
|
28
29
|
'fields[betaGroups]': 'name,isInternalGroup,publicLink,publicLinkEnabled',
|
|
29
|
-
})
|
|
30
|
+
});
|
|
30
31
|
return (data.data ?? []).map((g) => ({
|
|
31
32
|
id: g.id,
|
|
32
33
|
name: g.attributes?.name,
|
|
@@ -36,36 +37,11 @@ export async function listBetaGroups(appId) {
|
|
|
36
37
|
}));
|
|
37
38
|
}
|
|
38
39
|
// ─── 앱 정보 (카테고리 등) ───
|
|
39
|
-
// AppInfoState — READY_FOR_DISTRIBUTION이 라이브 버전, 그 외(PREPARE_FOR_SUBMISSION /
|
|
40
|
-
// DEVELOPER_REJECTED 등)가 편집 가능한 appInfo.
|
|
41
|
-
const APP_INFO_LIVE_STATE = 'READY_FOR_DISTRIBUTION';
|
|
42
40
|
export async function getAppInfo(appId) {
|
|
43
|
-
|
|
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) };
|
|
41
|
+
return listAppInfoRecords(appId);
|
|
66
42
|
}
|
|
67
43
|
export async function listAppInfoLocalizations(appId, locale) {
|
|
68
|
-
const { appInfoId, state } = await
|
|
44
|
+
const { id: appInfoId, state = '' } = await requireAppInfo(appId);
|
|
69
45
|
const data = await apiGet(`/appInfos/${encodePathSegment(appInfoId)}/appInfoLocalizations`, {
|
|
70
46
|
'fields[appInfoLocalizations]': 'locale,name,subtitle,privacyPolicyUrl,privacyPolicyText',
|
|
71
47
|
'limit': '200',
|
|
@@ -96,7 +72,7 @@ export async function updateAppInfoLocalization(localizationId, fields) {
|
|
|
96
72
|
}
|
|
97
73
|
export async function createAppInfoLocalization(appId, locale, fields) {
|
|
98
74
|
const attributes = Object.fromEntries(Object.entries(fields).filter(([, v]) => v !== undefined));
|
|
99
|
-
const { appInfoId, state } = await
|
|
75
|
+
const { id: appInfoId, state = '' } = await requireAppInfo(appId);
|
|
100
76
|
const data = await apiPost('/appInfoLocalizations', {
|
|
101
77
|
data: {
|
|
102
78
|
type: 'appInfoLocalizations',
|
|
@@ -135,7 +111,7 @@ export async function listCustomerReviews(appId, opts = {}) {
|
|
|
135
111
|
params['filter[territory]'] = opts.territory;
|
|
136
112
|
if (opts.rating != null)
|
|
137
113
|
params['filter[rating]'] = String(opts.rating);
|
|
138
|
-
const data =
|
|
114
|
+
const data = await apiGet(`/apps/${encodePathSegment(appId)}/customerReviews`, params);
|
|
139
115
|
// include로 가져온 답변 매핑
|
|
140
116
|
const responses = new Map();
|
|
141
117
|
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 {};
|