@yoonion/mimi-seed-mcp 0.13.5 → 0.13.6
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.
|
@@ -29,6 +29,15 @@ function toLocalization(item) {
|
|
|
29
29
|
state: item.attributes?.state,
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* 같은 로케일이 여러 건 올 수 있다 — 심사 통과한 APPROVED 판과 편집 중인
|
|
34
|
+
* PREPARE_FOR_SUBMISSION 판이 공존한다(실측: 구독 하나에 ko 가 2건).
|
|
35
|
+
* APPROVED 는 이미 확정된 판이라 그걸 잡아 고치면 엉뚱한 걸 건드린다.
|
|
36
|
+
* 편집 가능한 판이 있으면 그쪽을 고른다.
|
|
37
|
+
*/
|
|
38
|
+
function pickEditable(matches) {
|
|
39
|
+
return matches.find((item) => item.state !== 'APPROVED') ?? matches[0];
|
|
40
|
+
}
|
|
32
41
|
/** 상품에 등록된 현지화 목록. */
|
|
33
42
|
export async function listProductLocalizations(args) {
|
|
34
43
|
const { internalId, productType } = args;
|
|
@@ -50,8 +59,8 @@ export async function upsertProductLocalization(args) {
|
|
|
50
59
|
}
|
|
51
60
|
const resource = localizationResource(productType);
|
|
52
61
|
const authHeaders = await authHeadersOrThrow();
|
|
53
|
-
const existing = (await listProductLocalizations({ internalId, productType }))
|
|
54
|
-
.
|
|
62
|
+
const existing = pickEditable((await listProductLocalizations({ internalId, productType }))
|
|
63
|
+
.filter((item) => item.locale.toLowerCase() === locale.toLowerCase()));
|
|
55
64
|
if (existing) {
|
|
56
65
|
// 넘긴 필드만 보낸다 — description 을 생략한 호출이 기존 설명을 지우면 안 된다.
|
|
57
66
|
const attributes = {};
|
package/dist/appstore/tools.js
CHANGED
|
@@ -664,11 +664,30 @@ function productReviewItemRelationship(productType) {
|
|
|
664
664
|
}
|
|
665
665
|
return { key: 'inAppPurchaseV2', type: 'inAppPurchases' };
|
|
666
666
|
}
|
|
667
|
+
/**
|
|
668
|
+
* **아직 제출 안 된** 묶음만 찾는다.
|
|
669
|
+
*
|
|
670
|
+
* findOpenReviewSubmission 을 그대로 쓰면 안 된다 — 그건 WAITING_FOR_REVIEW 까지
|
|
671
|
+
* 잡아오는데, 그건 이미 Apple 큐에 들어간 묶음이다. 거기에 항목을 밀어 넣으면
|
|
672
|
+
* 되든 안 되든 "추가됨" 이라고 보고하게 된다 (실측: 앱 하나에 WAITING_FOR_REVIEW
|
|
673
|
+
* 묶음이 2개 떠 있는 상태가 정상적으로 존재한다).
|
|
674
|
+
*
|
|
675
|
+
* 콘솔의 "제출 초안" 은 READY_FOR_REVIEW 로 보인다. 그게 우리가 담을 대상이다.
|
|
676
|
+
*/
|
|
677
|
+
async function findDraftReviewSubmission(appId, platform) {
|
|
678
|
+
const data = await apiGet('/reviewSubmissions', {
|
|
679
|
+
'filter[app]': appId,
|
|
680
|
+
'filter[platform]': platform,
|
|
681
|
+
'filter[state]': 'READY_FOR_REVIEW',
|
|
682
|
+
'limit': '1',
|
|
683
|
+
});
|
|
684
|
+
return data?.data?.[0]?.id ?? null;
|
|
685
|
+
}
|
|
667
686
|
export async function addProductToReviewSubmission(args) {
|
|
668
687
|
const { appId, internalId, productType } = args;
|
|
669
688
|
const platform = args.platform ?? 'IOS';
|
|
670
689
|
const relationship = productReviewItemRelationship(productType);
|
|
671
|
-
let submissionId = await
|
|
690
|
+
let submissionId = await findDraftReviewSubmission(appId, platform);
|
|
672
691
|
const reusedSubmission = Boolean(submissionId);
|
|
673
692
|
if (!submissionId) {
|
|
674
693
|
const created = await apiPost('/reviewSubmissions', {
|
package/package.json
CHANGED