@yoonion/mimi-seed-mcp 0.23.4 → 0.25.0
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/dist/admob/cli.js +34 -5
- package/dist/admob/errors.js +39 -14
- package/dist/ai/client.js +35 -14
- package/dist/ai/notes.js +14 -3
- package/dist/ai/review.js +17 -4
- package/dist/android/keystore-store.js +28 -8
- package/dist/android/keystore.d.ts +17 -2
- package/dist/android/keystore.js +110 -21
- package/dist/android/messages.d.ts +13 -11
- package/dist/android/messages.js +166 -72
- package/dist/android/playstore-sa.js +6 -3
- package/dist/appstore/analytics.js +46 -14
- package/dist/appstore/app-info-policy.js +7 -1
- package/dist/appstore/app-info.js +13 -3
- package/dist/appstore/apps.js +7 -1
- package/dist/appstore/asset-library-write.js +119 -37
- package/dist/appstore/asset-library.js +19 -5
- package/dist/appstore/auth.d.ts +2 -0
- package/dist/appstore/auth.js +31 -5
- package/dist/appstore/client.js +27 -6
- package/dist/appstore/declarations.js +22 -6
- package/dist/appstore/errors.d.ts +1 -1
- package/dist/appstore/errors.js +60 -34
- package/dist/appstore/http.d.ts +6 -0
- package/dist/appstore/http.js +22 -5
- package/dist/appstore/messages.js +86 -28
- package/dist/appstore/previews.js +22 -6
- package/dist/appstore/product-localization.js +10 -2
- package/dist/appstore/product-review.js +29 -10
- package/dist/appstore/products.js +20 -6
- package/dist/appstore/read-response.js +13 -3
- package/dist/appstore/release-target.js +13 -3
- package/dist/appstore/release.js +59 -22
- package/dist/appstore/review-preview.js +17 -6
- package/dist/appstore/review-submission.js +86 -35
- package/dist/appstore/sales.js +96 -44
- package/dist/appstore/screenshots.js +19 -5
- package/dist/appstore/testflight.js +41 -18
- package/dist/appstore/upload-parts.js +12 -3
- package/dist/appstore/versions.js +22 -10
- package/dist/auth/bigquery-auth.js +44 -15
- package/dist/auth/bigquery-setup-cli.js +1 -1
- package/dist/auth/cli.js +4 -2
- package/dist/auth/constants.js +13 -3
- package/dist/auth/drive-auth.d.ts +3 -2
- package/dist/auth/drive-auth.js +47 -17
- package/dist/auth/drive-setup-cli.js +1 -0
- package/dist/auth/errors.d.ts +75 -0
- package/dist/auth/errors.js +190 -86
- package/dist/auth/google-auth.d.ts +3 -1
- package/dist/auth/google-auth.js +39 -27
- package/dist/auth/playstore-auth.d.ts +1 -0
- package/dist/auth/playstore-auth.js +35 -15
- package/dist/auth/scopes.d.ts +18 -28
- package/dist/auth/scopes.js +53 -14
- package/dist/auth/youtube-channel.d.ts +8 -0
- package/dist/auth/youtube-channel.js +11 -3
- package/dist/bigquery/ids.js +19 -5
- package/dist/bigquery/tools.js +24 -8
- package/dist/billing/tools.js +22 -6
- package/dist/checks/appstore-submission.d.ts +1 -1
- package/dist/checks/appstore-submission.js +29 -8
- package/dist/checks/plan.js +169 -62
- package/dist/checks/release-status.js +10 -2
- package/dist/checks/risks.js +230 -63
- package/dist/checks/screenshots.d.ts +4 -4
- package/dist/checks/screenshots.js +63 -22
- package/dist/ci/config.js +8 -5
- package/dist/ci/gitlab.js +3 -1
- package/dist/core/atomic-write.d.ts +5 -2
- package/dist/core/atomic-write.js +8 -4
- package/dist/core/catch-scan.d.ts +17 -0
- package/dist/core/catch-scan.js +111 -0
- package/dist/core/checks/billing.d.ts +5 -0
- package/dist/core/checks/billing.js +36 -5
- package/dist/core/checks/lockfile.js +2 -0
- package/dist/core/checks/release-doctor/fcm.js +1 -0
- package/dist/core/checks/release-doctor/files.d.ts +3 -1
- package/dist/core/checks/release-doctor/files.js +12 -1
- package/dist/core/checks/release-doctor/gradle-apply.js +1 -0
- package/dist/core/checks/release-doctor/ios-xcode.js +22 -3
- package/dist/core/checks/release-doctor/target-sdk.js +1 -1
- package/dist/core/checks/release-doctor/util.d.ts +5 -0
- package/dist/core/checks/release-doctor/util.js +56 -0
- package/dist/core/checks/release-doctor.js +59 -16
- package/dist/core/credential-envelope.d.ts +25 -0
- package/dist/core/credential-envelope.js +66 -0
- package/dist/core/credential-keystore.d.ts +37 -0
- package/dist/core/credential-keystore.js +275 -0
- package/dist/core/credential-read.d.ts +33 -0
- package/dist/core/credential-read.js +112 -0
- package/dist/core/credential-store.d.ts +61 -0
- package/dist/core/credential-store.js +240 -0
- package/dist/core/http-errors.js +1 -0
- package/dist/core/i18n-scan.d.ts +10 -0
- package/dist/core/i18n-scan.js +79 -0
- package/dist/core/json-file.d.ts +30 -0
- package/dist/core/json-file.js +53 -0
- package/dist/core/lang.d.ts +14 -0
- package/dist/core/lang.js +22 -2
- package/dist/core/project-manifest.d.ts +24 -1
- package/dist/core/project-manifest.js +27 -16
- package/dist/drive/tools.js +86 -34
- package/dist/facebook/api.js +3 -1
- package/dist/facebook/config.js +11 -3
- package/dist/facebook/setup.d.ts +2 -0
- package/dist/facebook/setup.js +32 -9
- package/dist/firebase/cli.js +39 -5
- package/dist/firebase/tools.js +36 -10
- package/dist/ga4/cli.js +48 -4
- package/dist/ga4/tools.js +4 -2
- package/dist/googleads/config.js +24 -8
- package/dist/googleads/tools.js +3 -1
- package/dist/gsc/tools.d.ts +116 -9
- package/dist/gsc/tools.js +101 -17
- package/dist/helpers.d.ts +4 -2
- package/dist/helpers.js +82 -44
- package/dist/i18n/manifest-en.d.ts +6 -0
- package/dist/i18n/manifest-en.js +53 -0
- package/dist/i18n/tools-en/admob.d.ts +25 -0
- package/dist/i18n/tools-en/admob.js +24 -0
- package/dist/i18n/tools-en/ai.d.ts +14 -0
- package/dist/i18n/tools-en/ai.js +13 -0
- package/dist/i18n/tools-en/android.d.ts +14 -0
- package/dist/i18n/tools-en/android.js +13 -0
- package/dist/i18n/tools-en/appstore.d.ts +240 -0
- package/dist/i18n/tools-en/appstore.js +239 -0
- package/dist/i18n/tools-en/auth.d.ts +16 -0
- package/dist/i18n/tools-en/auth.js +15 -0
- package/dist/i18n/tools-en/bigquery.d.ts +16 -0
- package/dist/i18n/tools-en/bigquery.js +15 -0
- package/dist/i18n/tools-en/billing.d.ts +17 -0
- package/dist/i18n/tools-en/billing.js +16 -0
- package/dist/i18n/tools-en/checks.d.ts +23 -0
- package/dist/i18n/tools-en/checks.js +22 -0
- package/dist/i18n/tools-en/ci.d.ts +21 -0
- package/dist/i18n/tools-en/ci.js +20 -0
- package/dist/i18n/tools-en/drive.d.ts +33 -0
- package/dist/i18n/tools-en/drive.js +32 -0
- package/dist/i18n/tools-en/facebook.d.ts +14 -0
- package/dist/i18n/tools-en/facebook.js +13 -0
- package/dist/i18n/tools-en/firebase.d.ts +42 -0
- package/dist/i18n/tools-en/firebase.js +41 -0
- package/dist/i18n/tools-en/ga4.d.ts +35 -0
- package/dist/i18n/tools-en/ga4.js +34 -0
- package/dist/i18n/tools-en/googleads.d.ts +15 -0
- package/dist/i18n/tools-en/googleads.js +14 -0
- package/dist/i18n/tools-en/gsc.d.ts +27 -0
- package/dist/i18n/tools-en/gsc.js +26 -0
- package/dist/i18n/tools-en/iam.d.ts +15 -0
- package/dist/i18n/tools-en/iam.js +14 -0
- package/dist/i18n/tools-en/index.d.ts +7 -0
- package/dist/i18n/tools-en/index.js +58 -0
- package/dist/i18n/tools-en/instagram.d.ts +16 -0
- package/dist/i18n/tools-en/instagram.js +15 -0
- package/dist/i18n/tools-en/jenkins.d.ts +41 -0
- package/dist/i18n/tools-en/jenkins.js +40 -0
- package/dist/i18n/tools-en/naver.d.ts +10 -0
- package/dist/i18n/tools-en/naver.js +9 -0
- package/dist/i18n/tools-en/playstore.d.ts +148 -0
- package/dist/i18n/tools-en/playstore.js +147 -0
- package/dist/i18n/tools-en/registrar.d.ts +6 -0
- package/dist/i18n/tools-en/registrar.js +6 -0
- package/dist/i18n/tools-en/threads.d.ts +21 -0
- package/dist/i18n/tools-en/threads.js +20 -0
- package/dist/i18n/tools-en/tiktok.d.ts +21 -0
- package/dist/i18n/tools-en/tiktok.js +20 -0
- package/dist/i18n/tools-en/video.d.ts +59 -0
- package/dist/i18n/tools-en/video.js +58 -0
- package/dist/i18n/tools-en/youtube.d.ts +44 -0
- package/dist/i18n/tools-en/youtube.js +43 -0
- package/dist/iam/key-files.js +13 -3
- package/dist/instagram/api.js +19 -5
- package/dist/instagram/config.js +11 -3
- package/dist/instagram/setup.js +37 -11
- package/dist/jenkins/builds.d.ts +2 -2
- package/dist/jenkins/builds.js +70 -30
- package/dist/jenkins/config.d.ts +5 -0
- package/dist/jenkins/config.js +25 -6
- package/dist/jenkins/credentials.js +33 -13
- package/dist/jenkins/http.js +6 -3
- package/dist/jenkins/jobs.js +19 -5
- package/dist/jenkins/messages.js +93 -36
- package/dist/lib/cli-args.js +13 -7
- package/dist/lib/google-errors.js +31 -9
- package/dist/lib/http.js +10 -3
- package/dist/lib/json-file.d.ts +15 -0
- package/dist/lib/json-file.js +65 -0
- package/dist/lib/meta-auth.d.ts +1 -1
- package/dist/lib/meta-auth.js +26 -8
- package/dist/lib/package-name.js +15 -4
- package/dist/lib/package-root.js +1 -1
- package/dist/lib/paginate.js +10 -2
- package/dist/lib/path-containment.js +22 -6
- package/dist/lib/resource-id.js +10 -3
- package/dist/lib/store-create-result.js +54 -13
- package/dist/lib/text-validators.js +20 -5
- package/dist/lib/tool-registrar.d.ts +9 -0
- package/dist/lib/tool-registrar.js +33 -14
- package/dist/lib/tool-text.d.ts +31 -0
- package/dist/lib/tool-text.js +52 -0
- package/dist/lib/toolsets.js +13 -3
- package/dist/lib/url-path.js +3 -1
- package/dist/naver/tools.js +138 -46
- package/dist/playstore/data-safety.js +16 -4
- package/dist/playstore/errors.js +33 -8
- package/dist/playstore/financials.js +83 -35
- package/dist/playstore/listing.js +7 -1
- package/dist/playstore/messages.js +179 -57
- package/dist/playstore/products.js +10 -2
- package/dist/playstore/recovery.js +10 -2
- package/dist/playstore/releases.js +34 -14
- package/dist/playstore/reviews.js +14 -4
- package/dist/playstore/statistics.js +3 -1
- package/dist/prompts.js +160 -50
- package/dist/registers/admob.js +36 -11
- package/dist/registers/android.js +25 -9
- package/dist/registers/appstore/apps.js +22 -6
- package/dist/registers/appstore/customer-reviews.js +7 -1
- package/dist/registers/appstore/declarations.js +63 -19
- package/dist/registers/appstore/media.js +76 -24
- package/dist/registers/appstore/metadata.js +26 -8
- package/dist/registers/appstore/products.js +53 -19
- package/dist/registers/appstore/review-submission.js +31 -9
- package/dist/registers/appstore/testflight.js +82 -24
- package/dist/registers/appstore/versions.js +88 -30
- package/dist/registers/auth.js +343 -90
- package/dist/registers/bigquery.js +54 -14
- package/dist/registers/billing.js +18 -4
- package/dist/registers/checks.js +20 -5
- package/dist/registers/ci.js +60 -20
- package/dist/registers/drive.js +18 -7
- package/dist/registers/facebook.js +31 -9
- package/dist/registers/firebase.js +21 -7
- package/dist/registers/googleads.js +23 -6
- package/dist/registers/gsc.js +42 -39
- package/dist/registers/iam.js +44 -13
- package/dist/registers/instagram.js +19 -5
- package/dist/registers/jenkins.js +43 -14
- package/dist/registers/naver.js +13 -3
- package/dist/registers/playstore/financials.d.ts +6 -0
- package/dist/registers/playstore/financials.js +48 -0
- package/dist/registers/playstore/listing.d.ts +15 -0
- package/dist/registers/playstore/listing.js +138 -0
- package/dist/registers/playstore/media.d.ts +6 -0
- package/dist/registers/playstore/media.js +56 -0
- package/dist/registers/playstore/products.d.ts +21 -0
- package/dist/registers/playstore/products.js +238 -0
- package/dist/registers/playstore/recovery.d.ts +11 -0
- package/dist/registers/playstore/recovery.js +105 -0
- package/dist/registers/playstore/releases.d.ts +8 -0
- package/dist/registers/playstore/releases.js +157 -0
- package/dist/registers/playstore/reviews.d.ts +6 -0
- package/dist/registers/playstore/reviews.js +43 -0
- package/dist/registers/playstore/service-accounts.d.ts +13 -0
- package/dist/registers/playstore/service-accounts.js +127 -0
- package/dist/registers/playstore/shared.d.ts +12 -0
- package/dist/registers/playstore/shared.js +24 -0
- package/dist/registers/playstore.d.ts +8 -0
- package/dist/registers/playstore.js +28 -734
- package/dist/registers/threads.js +28 -8
- package/dist/registers/tiktok.js +4 -2
- package/dist/registers/video.js +3 -1
- package/dist/remote-sync.js +80 -28
- package/dist/resources.d.ts +0 -8
- package/dist/resources.js +73 -32
- package/dist/server.d.ts +2 -0
- package/dist/server.js +9 -1
- package/dist/social/profile-store.js +36 -12
- package/dist/social/setup-cli.js +1 -1
- package/dist/threads/api.js +23 -6
- package/dist/threads/setup.js +42 -14
- package/dist/tiktok-business/api.js +13 -3
- package/dist/tiktok-business/auth.js +10 -2
- package/dist/tiktok-business/config.js +8 -3
- package/dist/tiktok-business/posting.d.ts +6 -0
- package/dist/tiktok-business/posting.js +118 -36
- package/dist/tiktok-business/setup-cli.js +3 -1
- package/dist/tools-cli.js +4 -5
- package/dist/video/captions.js +3 -1
- package/dist/video/files.js +13 -3
- package/dist/video/project.js +65 -21
- package/dist/video/providers.js +52 -16
- package/dist/video/render.js +71 -22
- package/dist/video/research.js +10 -2
- package/dist/video/schemas.js +19 -5
- package/dist/video/youtube-publish.js +62 -32
- package/package.json +1 -1
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
// playstore/tools.ts 가 이 모듈을 그대로 re-export 한다 — 호출부는 tools.js 경로를 계속 쓴다.
|
|
3
3
|
import { extractHttpStatus } from '../lib/google-errors.js';
|
|
4
4
|
import { publisher, withEdit } from './edits.js';
|
|
5
|
+
import { catalog } from '#core/lang.js';
|
|
6
|
+
const M = catalog({
|
|
7
|
+
noListing: (lang) => `Google Play ${lang} 리스팅이 아직 없어요. 새 언어를 만들려면 title, shortDescription, fullDescription을 모두 보내야 해요.`,
|
|
8
|
+
}, {
|
|
9
|
+
noListing: (lang) => `There is no Google Play ${lang} listing yet. To create a new language, send all of title, shortDescription, and fullDescription.`,
|
|
10
|
+
});
|
|
5
11
|
// ─── 앱 목록 ───
|
|
6
12
|
export async function getAppDetails(auth, packageName) {
|
|
7
13
|
return withEdit(auth, packageName, async (editId) => {
|
|
@@ -69,7 +75,7 @@ export async function updateListing(auth, packageName, language, data) {
|
|
|
69
75
|
throw error;
|
|
70
76
|
const { title, shortDescription, fullDescription } = data;
|
|
71
77
|
if (!title || !shortDescription || !fullDescription) {
|
|
72
|
-
throw new Error(
|
|
78
|
+
throw new Error(M().noListing(language), { cause: error });
|
|
73
79
|
}
|
|
74
80
|
const created = await publisher().edits.listings.update({
|
|
75
81
|
auth,
|
|
@@ -2,78 +2,194 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 반환값은 줄 배열이다. 빈 문자열은 빈 줄로 남긴다 (textResult 가 '\n' 으로 합친다) —
|
|
4
4
|
// 조건부 줄을 버리는 곳만 여기서 명시적으로 .filter(Boolean) 한다.
|
|
5
|
+
import { catalog } from '#core/lang.js';
|
|
6
|
+
const M = catalog({
|
|
7
|
+
saValid: '✓ 서비스 계정 유효 — Play Developer API 호출 가능',
|
|
8
|
+
saEnvHint: '이제 이 JSON 내용을 onesub 서버의 `GOOGLE_SERVICE_ACCOUNT_KEY` 환경변수에 (한 줄로) 넣으면 됩니다. 예:',
|
|
9
|
+
verifyFailed: (stage, http) => `✗ 검증 실패 (stage: **${stage}**${http})`,
|
|
10
|
+
parseCause: '원인: 붙여넣은 JSON 구조가 올바르지 않음.',
|
|
11
|
+
parseCheck: '확인: Google Cloud Console → Service Accounts → Keys → **Create new key → JSON** 흐름으로 받은 파일 맞나요?',
|
|
12
|
+
authCause: '원인: Google이 자격증명 자체를 거부함 (private_key 손상 / 프로젝트 비활성 / 계정 삭제됨).',
|
|
13
|
+
authCheck: '확인: 새 키를 다시 발급 (기존 키 회수 후).',
|
|
14
|
+
permCause: '원인: 토큰은 받았지만 Play Console에서 이 서비스 계정에 권한 없음.',
|
|
15
|
+
permSteps: '확인 순서:',
|
|
16
|
+
permStep1: '1. Play Console → Users and permissions → 이 서비스 계정 이메일을 초대',
|
|
17
|
+
permStep2: '2. App permissions에서 해당 패키지명 앱 선택',
|
|
18
|
+
permStep3: '3. Account permissions에 **View financial data, orders, and cancellation survey responses** 체크',
|
|
19
|
+
permStep4: '4. 권한 적용까지 **~5분 대기** 후 재시도 (너무 빨리 시도하면 계속 403)',
|
|
20
|
+
notOwnedCause: '원인: 패키지명이 이 Play Console 개발자 계정 소유가 아님.',
|
|
21
|
+
notOwnedCheck: (pkg) => `확인: packageName이 Play Console에 등록된 앱의 것과 정확히 일치하나요? ("\`${pkg}\`")`,
|
|
22
|
+
apiCause: '원인: Play Developer API 호출 중 예외. 네트워크 또는 Google 쪽 문제일 수 있음.',
|
|
23
|
+
registerAborted: (stage) => `❌ 검증 실패 (stage: ${stage})로 등록 중단.`,
|
|
24
|
+
skipVerifyHint: `검증을 건너뛰고 강제 등록하려면 skipVerify=true 옵션 추가.`,
|
|
25
|
+
registered: (pkg) => `✓ ${pkg} 서비스 계정 등록 완료`,
|
|
26
|
+
savedPath: (packageName) => `**저장 경로**: \`~/.mimi-seed/play-service-accounts/${packageName}.json\` (0600)`,
|
|
27
|
+
autoUse: '이후 이 packageName으로 호출하는 모든 playstore_* 도구가 자동으로 이 SA 사용.',
|
|
28
|
+
defaultNone: '**Default (legacy)**: 미등록',
|
|
29
|
+
perPackageNone: '**Per-package**: 없음',
|
|
30
|
+
howToRegister: '등록 방법: `playstore_register_service_account(packageName, serviceAccountJsonPath)`',
|
|
31
|
+
perPackageCount: (n) => `**Per-package** (${n}개):`,
|
|
32
|
+
setupDone: `✅ Play Store 서비스 계정 설정 완료`,
|
|
33
|
+
setupPackage: (pkg) => `**패키지**: \`${pkg}\``,
|
|
34
|
+
setupSaEmail: (email) => `**SA 이메일**: \`${email}\``,
|
|
35
|
+
setupPath: (packageName) => `**저장 경로**: \`~/.mimi-seed/play-service-accounts/${packageName}.json\``,
|
|
36
|
+
inviteHeading: '## 필수 수동 단계 — Play Console 초대',
|
|
37
|
+
invite1: '1. https://play.google.com/console/developers 접속',
|
|
38
|
+
invite2: '2. **설정 → 사용자 및 권한 → 새 사용자 초대**',
|
|
39
|
+
invite3: (email) => `3. 이메일 입력: \`${email}\``,
|
|
40
|
+
invite4: '4. 권한: **앱 출시** 또는 **릴리스 관리자** 선택 → 초대 전송',
|
|
41
|
+
invite5: '5. 권한 적용까지 약 5분 소요',
|
|
42
|
+
inviteVerify: '초대 완료 후 `playstore_verify_service_account` 로 연결 확인 가능합니다.',
|
|
43
|
+
dsDryRun: '🛑 데이터 안전 업로드 dry-run — 아직 보내지 않았다.',
|
|
44
|
+
pkg: (pkg) => ` 패키지: ${pkg}`,
|
|
45
|
+
dsCsv: (lines, bytes) => ` CSV: ${lines}줄 / ${bytes} bytes`,
|
|
46
|
+
dsColumns: (n) => ` 열 수(첫 줄 기준): ${n}`,
|
|
47
|
+
dsOverwrite: '⚠️ 업로드하면 기존 데이터 안전 제출을 통째로 덮어쓴다.',
|
|
48
|
+
confirmToRun: '실행하려면 confirm: true 로 다시 호출.',
|
|
49
|
+
dsUploaded: '✅ 데이터 안전 선언 업로드 완료',
|
|
50
|
+
dsSent: (lines, bytes) => ` 전송: ${lines}줄 / ${bytes} bytes`,
|
|
51
|
+
dsCheck: 'Play Console > 앱 콘텐츠 > 데이터 안전에서 반영을 확인할 것.',
|
|
52
|
+
created: (t) => ` 생성 ${t}`,
|
|
53
|
+
deployed: (t) => ` 배포 ${t}`,
|
|
54
|
+
cancelled: (t) => ` 취소 ${t}`,
|
|
55
|
+
target: (json) => ` 대상: ${json}`,
|
|
56
|
+
recDryRun: '🛑 dry-run — 아직 만들지 않았다.',
|
|
57
|
+
recDraftHint: 'DRAFT 로 만들려면 confirm: true. 만든 뒤에도 배포는 별도 단계다.',
|
|
58
|
+
recCreated: '✅ 복구 액션 생성 (DRAFT — 아직 사용자에게 나가지 않았다)',
|
|
59
|
+
status: (s) => ` 상태: ${s}`,
|
|
60
|
+
recDeployHint: '배포하려면 playstore_deploy_recovery_action.',
|
|
61
|
+
}, {
|
|
62
|
+
saValid: '✓ Service account is valid — Play Developer API calls work',
|
|
63
|
+
saEnvHint: 'You can now put this JSON content (on one line) into the `GOOGLE_SERVICE_ACCOUNT_KEY` environment variable of the onesub server. e.g.:',
|
|
64
|
+
verifyFailed: (stage, http) => `✗ Verification failed (stage: **${stage}**${http})`,
|
|
65
|
+
parseCause: 'Cause: the pasted JSON structure is invalid.',
|
|
66
|
+
parseCheck: 'Check: is this the file you downloaded via Google Cloud Console → Service Accounts → Keys → **Create new key → JSON**?',
|
|
67
|
+
authCause: 'Cause: Google rejected the credentials themselves (damaged private_key / disabled project / deleted account).',
|
|
68
|
+
authCheck: 'Check: issue a new key (after revoking the old one).',
|
|
69
|
+
permCause: 'Cause: a token was issued, but this service account has no permission in Play Console.',
|
|
70
|
+
permSteps: 'Check in this order:',
|
|
71
|
+
permStep1: '1. Play Console → Users and permissions → invite this service account email',
|
|
72
|
+
permStep2: '2. Under App permissions, select the app with this package name',
|
|
73
|
+
permStep3: '3. Under Account permissions, check **View financial data, orders, and cancellation survey responses**',
|
|
74
|
+
permStep4: '4. **Wait ~5 minutes** for the permissions to apply, then retry (retrying too soon keeps returning 403)',
|
|
75
|
+
notOwnedCause: 'Cause: this package name is not owned by this Play Console developer account.',
|
|
76
|
+
notOwnedCheck: (pkg) => `Check: does packageName exactly match the app registered in Play Console? ("\`${pkg}\`")`,
|
|
77
|
+
apiCause: 'Cause: an exception during the Play Developer API call. It may be a network or Google-side problem.',
|
|
78
|
+
registerAborted: (stage) => `❌ Verification failed (stage: ${stage}); registration stopped.`,
|
|
79
|
+
skipVerifyHint: `To skip verification and force registration, add the skipVerify=true option.`,
|
|
80
|
+
registered: (pkg) => `✓ Service account registered for ${pkg}`,
|
|
81
|
+
savedPath: (packageName) => `**Saved to**: \`~/.mimi-seed/play-service-accounts/${packageName}.json\` (0600)`,
|
|
82
|
+
autoUse: 'From now on, every playstore_* tool called with this packageName uses this SA automatically.',
|
|
83
|
+
defaultNone: '**Default (legacy)**: not registered',
|
|
84
|
+
perPackageNone: '**Per-package**: none',
|
|
85
|
+
howToRegister: 'To register: `playstore_register_service_account(packageName, serviceAccountJsonPath)`',
|
|
86
|
+
perPackageCount: (n) => `**Per-package** (${n}):`,
|
|
87
|
+
setupDone: `✅ Play Store service account setup complete`,
|
|
88
|
+
setupPackage: (pkg) => `**Package**: \`${pkg}\``,
|
|
89
|
+
setupSaEmail: (email) => `**SA email**: \`${email}\``,
|
|
90
|
+
setupPath: (packageName) => `**Saved to**: \`~/.mimi-seed/play-service-accounts/${packageName}.json\``,
|
|
91
|
+
inviteHeading: '## Required manual step — invite in Play Console',
|
|
92
|
+
invite1: '1. Open https://play.google.com/console/developers',
|
|
93
|
+
invite2: '2. **Users and permissions → Invite new users**',
|
|
94
|
+
invite3: (email) => `3. Enter the email: \`${email}\``,
|
|
95
|
+
invite4: '4. Permissions: select **Release apps** or **Release manager** → Send invite',
|
|
96
|
+
invite5: '5. Permissions take about 5 minutes to apply',
|
|
97
|
+
inviteVerify: 'After the invite is done, you can check the connection with `playstore_verify_service_account`.',
|
|
98
|
+
dsDryRun: '🛑 Data safety upload dry-run — nothing has been sent yet.',
|
|
99
|
+
pkg: (pkg) => ` Package: ${pkg}`,
|
|
100
|
+
dsCsv: (lines, bytes) => ` CSV: ${lines} lines / ${bytes} bytes`,
|
|
101
|
+
dsColumns: (n) => ` Columns (from the first line): ${n}`,
|
|
102
|
+
dsOverwrite: '⚠️ Uploading overwrites the entire existing data safety submission.',
|
|
103
|
+
confirmToRun: 'To run it, call again with confirm: true.',
|
|
104
|
+
dsUploaded: '✅ Data safety declaration uploaded',
|
|
105
|
+
dsSent: (lines, bytes) => ` Sent: ${lines} lines / ${bytes} bytes`,
|
|
106
|
+
dsCheck: 'Confirm the change in Play Console > App content > Data safety.',
|
|
107
|
+
created: (t) => ` Created ${t}`,
|
|
108
|
+
deployed: (t) => ` Deployed ${t}`,
|
|
109
|
+
cancelled: (t) => ` Cancelled ${t}`,
|
|
110
|
+
target: (json) => ` Targeting: ${json}`,
|
|
111
|
+
recDryRun: '🛑 dry-run — nothing has been created yet.',
|
|
112
|
+
recDraftHint: 'To create it as a DRAFT, pass confirm: true. Even after creation, deploying is a separate step.',
|
|
113
|
+
recCreated: '✅ Recovery action created (DRAFT — not yet sent to users)',
|
|
114
|
+
status: (s) => ` Status: ${s}`,
|
|
115
|
+
recDeployHint: 'To deploy it, use playstore_deploy_recovery_action.',
|
|
116
|
+
});
|
|
5
117
|
/** playstore_verify_service_account — 성공 요약 또는 단계별(parse/auth/api) 트러블슈팅 안내. */
|
|
6
118
|
export function serviceAccountVerificationLines(result, packageName) {
|
|
119
|
+
const m = M();
|
|
7
120
|
if (result.ok) {
|
|
8
121
|
return [
|
|
9
|
-
|
|
122
|
+
m.saValid,
|
|
10
123
|
'',
|
|
11
124
|
`**clientEmail**: \`${result.clientEmail}\``,
|
|
12
125
|
`**projectId**: \`${result.projectId}\``,
|
|
13
126
|
`**packageName**: \`${packageName}\``,
|
|
14
127
|
'',
|
|
15
|
-
|
|
128
|
+
m.saEnvHint,
|
|
16
129
|
'```bash',
|
|
17
130
|
'cat service-account.json | tr -d \'\\n\' | jq -c .',
|
|
18
131
|
'```',
|
|
19
132
|
];
|
|
20
133
|
}
|
|
21
134
|
const lines = [
|
|
22
|
-
|
|
135
|
+
m.verifyFailed(result.stage, result.httpStatus ? `, HTTP ${result.httpStatus}` : ''),
|
|
23
136
|
'',
|
|
24
137
|
`${result.message}`,
|
|
25
138
|
'',
|
|
26
139
|
];
|
|
27
140
|
if (result.stage === 'parse') {
|
|
28
|
-
lines.push(
|
|
29
|
-
lines.push(
|
|
141
|
+
lines.push(m.parseCause);
|
|
142
|
+
lines.push(m.parseCheck);
|
|
30
143
|
}
|
|
31
144
|
else if (result.stage === 'auth') {
|
|
32
|
-
lines.push(
|
|
33
|
-
lines.push(
|
|
145
|
+
lines.push(m.authCause);
|
|
146
|
+
lines.push(m.authCheck);
|
|
34
147
|
}
|
|
35
148
|
else if (result.stage === 'api') {
|
|
36
149
|
if (result.httpStatus === 401 || result.httpStatus === 403) {
|
|
37
|
-
lines.push(
|
|
38
|
-
lines.push(
|
|
39
|
-
lines.push(
|
|
40
|
-
lines.push(
|
|
41
|
-
lines.push(
|
|
42
|
-
lines.push(
|
|
150
|
+
lines.push(m.permCause);
|
|
151
|
+
lines.push(m.permSteps);
|
|
152
|
+
lines.push(m.permStep1);
|
|
153
|
+
lines.push(m.permStep2);
|
|
154
|
+
lines.push(m.permStep3);
|
|
155
|
+
lines.push(m.permStep4);
|
|
43
156
|
}
|
|
44
157
|
else if (result.httpStatus === 404) {
|
|
45
|
-
lines.push(
|
|
46
|
-
lines.push(
|
|
158
|
+
lines.push(m.notOwnedCause);
|
|
159
|
+
lines.push(m.notOwnedCheck(packageName));
|
|
47
160
|
}
|
|
48
161
|
else {
|
|
49
|
-
lines.push(
|
|
162
|
+
lines.push(m.apiCause);
|
|
50
163
|
}
|
|
51
164
|
}
|
|
52
165
|
return lines;
|
|
53
166
|
}
|
|
54
167
|
/** playstore_register_service_account — 사전 검증 실패로 등록을 멈췄을 때. */
|
|
55
168
|
export function serviceAccountRegisterAbortedLines(stage, message) {
|
|
169
|
+
const m = M();
|
|
56
170
|
return [
|
|
57
|
-
|
|
171
|
+
m.registerAborted(stage),
|
|
58
172
|
message,
|
|
59
173
|
'',
|
|
60
|
-
|
|
174
|
+
m.skipVerifyHint,
|
|
61
175
|
];
|
|
62
176
|
}
|
|
63
177
|
/** playstore_register_service_account — 등록 완료. */
|
|
64
178
|
export function serviceAccountRegisteredLines(packageName, clientEmail, projectId) {
|
|
179
|
+
const m = M();
|
|
65
180
|
return [
|
|
66
|
-
|
|
181
|
+
m.registered(packageName),
|
|
67
182
|
'',
|
|
68
183
|
`**clientEmail**: \`${clientEmail}\``,
|
|
69
184
|
`**projectId**: \`${projectId}\``,
|
|
70
|
-
|
|
185
|
+
m.savedPath(packageName),
|
|
71
186
|
'',
|
|
72
|
-
|
|
187
|
+
m.autoUse,
|
|
73
188
|
];
|
|
74
189
|
}
|
|
75
190
|
/** playstore_list_service_accounts — default(레거시) + 패키지별 SA 요약. */
|
|
76
191
|
export function registeredServiceAccountsLines(info) {
|
|
192
|
+
const m = M();
|
|
77
193
|
const lines = [];
|
|
78
194
|
if (info.default) {
|
|
79
195
|
lines.push('**Default (legacy)**: `~/.mimi-seed/play-service-account.json`');
|
|
@@ -82,16 +198,16 @@ export function registeredServiceAccountsLines(info) {
|
|
|
82
198
|
lines.push('');
|
|
83
199
|
}
|
|
84
200
|
else {
|
|
85
|
-
lines.push(
|
|
201
|
+
lines.push(m.defaultNone);
|
|
86
202
|
lines.push('');
|
|
87
203
|
}
|
|
88
204
|
if (info.perPackage.length === 0) {
|
|
89
|
-
lines.push(
|
|
205
|
+
lines.push(m.perPackageNone);
|
|
90
206
|
lines.push('');
|
|
91
|
-
lines.push(
|
|
207
|
+
lines.push(m.howToRegister);
|
|
92
208
|
}
|
|
93
209
|
else {
|
|
94
|
-
lines.push(
|
|
210
|
+
lines.push(m.perPackageCount(info.perPackage.length));
|
|
95
211
|
for (const item of info.perPackage) {
|
|
96
212
|
lines.push(`- \`${item.packageName}\` → \`${item.clientEmail ?? '(parse error)'}\` (project: \`${item.projectId ?? 'unknown'}\`)`);
|
|
97
213
|
}
|
|
@@ -100,74 +216,80 @@ export function registeredServiceAccountsLines(info) {
|
|
|
100
216
|
}
|
|
101
217
|
/** setup_playstore_connection — 완료 요약 + Play Console 초대(수동 1단계) 안내. */
|
|
102
218
|
export function playConnectionSetupLines(packageName, saEmail) {
|
|
219
|
+
const m = M();
|
|
103
220
|
return [
|
|
104
|
-
|
|
221
|
+
m.setupDone,
|
|
105
222
|
'',
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
223
|
+
m.setupPackage(packageName),
|
|
224
|
+
m.setupSaEmail(saEmail),
|
|
225
|
+
m.setupPath(packageName),
|
|
109
226
|
'',
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
227
|
+
m.inviteHeading,
|
|
228
|
+
m.invite1,
|
|
229
|
+
m.invite2,
|
|
230
|
+
m.invite3(saEmail),
|
|
231
|
+
m.invite4,
|
|
232
|
+
m.invite5,
|
|
116
233
|
'',
|
|
117
|
-
|
|
234
|
+
m.inviteVerify,
|
|
118
235
|
];
|
|
119
236
|
}
|
|
120
237
|
/** playstore_upload_data_safety — confirm 없이 호출했을 때의 요약 (CSV 원문은 싣지 않는다). */
|
|
121
238
|
export function dataSafetyDryRunLines(packageName, content) {
|
|
239
|
+
const m = M();
|
|
122
240
|
const lines = content.trim().split('\n');
|
|
123
241
|
return [
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
242
|
+
m.dsDryRun,
|
|
243
|
+
m.pkg(packageName),
|
|
244
|
+
m.dsCsv(lines.length, Buffer.byteLength(content, 'utf8')),
|
|
127
245
|
// 원문은 싣지 않는다 — CSV 가 사설 데이터 처리 내역을 담고 있고, 대화 기록에 남는다.
|
|
128
|
-
|
|
246
|
+
m.dsColumns(lines[0] ? lines[0].split(',').length : 0),
|
|
129
247
|
'',
|
|
130
|
-
|
|
131
|
-
|
|
248
|
+
m.dsOverwrite,
|
|
249
|
+
m.confirmToRun,
|
|
132
250
|
];
|
|
133
251
|
}
|
|
134
252
|
/** playstore_upload_data_safety — 업로드 완료. */
|
|
135
253
|
export function dataSafetyUploadedLines(r) {
|
|
254
|
+
const m = M();
|
|
136
255
|
return [
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
256
|
+
m.dsUploaded,
|
|
257
|
+
m.pkg(r.packageName),
|
|
258
|
+
m.dsSent(r.lines, r.bytes),
|
|
259
|
+
m.dsCheck,
|
|
141
260
|
];
|
|
142
261
|
}
|
|
143
262
|
/** playstore_list_recovery_actions — 액션마다 상태·시각·대상을 한 블록으로. */
|
|
144
263
|
export function recoveryActionsText(rows) {
|
|
264
|
+
const m = M();
|
|
145
265
|
return rows
|
|
146
266
|
.map((r) => [
|
|
147
267
|
`${r.id}: ${r.status}`,
|
|
148
|
-
r.createTime ?
|
|
149
|
-
r.deployTime ?
|
|
150
|
-
r.cancelTime ?
|
|
151
|
-
|
|
268
|
+
r.createTime ? m.created(r.createTime) : '',
|
|
269
|
+
r.deployTime ? m.deployed(r.deployTime) : '',
|
|
270
|
+
r.cancelTime ? m.cancelled(r.cancelTime) : '',
|
|
271
|
+
m.target(JSON.stringify(r.targeting ?? {})),
|
|
152
272
|
].filter(Boolean).join('\n'))
|
|
153
273
|
.join('\n');
|
|
154
274
|
}
|
|
155
275
|
/** playstore_create_recovery_action — confirm 없이 호출했을 때의 계획. */
|
|
156
276
|
export function recoveryCreateDryRunLines(packageName, targeting) {
|
|
277
|
+
const m = M();
|
|
157
278
|
return [
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
279
|
+
m.recDryRun,
|
|
280
|
+
m.pkg(packageName),
|
|
281
|
+
m.target(JSON.stringify(targeting)),
|
|
161
282
|
'',
|
|
162
|
-
|
|
283
|
+
m.recDraftHint,
|
|
163
284
|
];
|
|
164
285
|
}
|
|
165
286
|
/** playstore_create_recovery_action — DRAFT 생성 완료. */
|
|
166
287
|
export function recoveryCreatedLines(r) {
|
|
288
|
+
const m = M();
|
|
167
289
|
return [
|
|
168
|
-
|
|
290
|
+
m.recCreated,
|
|
169
291
|
` id: ${r.id}`,
|
|
170
|
-
|
|
171
|
-
|
|
292
|
+
m.status(r.status),
|
|
293
|
+
m.recDeployHint,
|
|
172
294
|
];
|
|
173
295
|
}
|
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
// playstore/tools.ts 가 이 모듈을 그대로 re-export 한다 — 호출부는 tools.js 경로를 계속 쓴다.
|
|
3
3
|
import { collectPagesUpTo } from '../lib/paginate.js';
|
|
4
4
|
import { publisher } from './edits.js';
|
|
5
|
+
import { catalog } from '#core/lang.js';
|
|
6
|
+
const M = catalog({
|
|
7
|
+
titleRequired: (lang) => `새 로케일(${lang})을 만들려면 title 이 필요해.`,
|
|
8
|
+
benefitsSubOnly: 'benefits 는 구독 상품에만 쓸 수 있어.',
|
|
9
|
+
}, {
|
|
10
|
+
titleRequired: (lang) => `title is required to create a new locale (${lang}).`,
|
|
11
|
+
benefitsSubOnly: 'benefits can only be used for subscription products.',
|
|
12
|
+
});
|
|
5
13
|
// ─── 인앱 상품 조회 ───
|
|
6
14
|
export async function listInAppProducts(auth, packageName) {
|
|
7
15
|
const { items: products, truncated } = await collectPagesUpTo(async (pageToken) => {
|
|
@@ -63,7 +71,7 @@ function mergeListings(current, incoming, opts) {
|
|
|
63
71
|
const target = found ?? { languageCode: next.languageCode };
|
|
64
72
|
if (!found) {
|
|
65
73
|
if (!next.title) {
|
|
66
|
-
throw new Error(
|
|
74
|
+
throw new Error(M().titleRequired(next.languageCode));
|
|
67
75
|
}
|
|
68
76
|
merged.push(target);
|
|
69
77
|
created.push(next.languageCode);
|
|
@@ -77,7 +85,7 @@ function mergeListings(current, incoming, opts) {
|
|
|
77
85
|
target.description = next.description;
|
|
78
86
|
if (next.benefits !== undefined) {
|
|
79
87
|
if (!opts.allowBenefits) {
|
|
80
|
-
throw new Error(
|
|
88
|
+
throw new Error(M().benefitsSubOnly);
|
|
81
89
|
}
|
|
82
90
|
target.benefits = next.benefits;
|
|
83
91
|
}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
// Play 앱 복구 액션 (출시 후 긴급 대응).
|
|
2
2
|
// playstore/tools.ts 가 이 모듈을 그대로 re-export 한다 — 호출부는 tools.js 경로를 계속 쓴다.
|
|
3
3
|
import { publisher } from './edits.js';
|
|
4
|
+
import { catalog } from '#core/lang.js';
|
|
5
|
+
const M = catalog({
|
|
6
|
+
emptyTargeting: '대상(targeting)이 비어 있다 — allUsers / versionCodes / versionRange 중 하나는 필요하다.',
|
|
7
|
+
conflict: 'allUsers 와 versionCodes/versionRange 는 함께 쓸 수 없다.',
|
|
8
|
+
}, {
|
|
9
|
+
emptyTargeting: 'targeting is empty — one of allUsers / versionCodes / versionRange is required.',
|
|
10
|
+
conflict: 'allUsers cannot be combined with versionCodes/versionRange.',
|
|
11
|
+
});
|
|
4
12
|
export function buildTargeting(t) {
|
|
5
13
|
const targeting = {};
|
|
6
14
|
if (t.allUsers)
|
|
@@ -18,10 +26,10 @@ export function buildTargeting(t) {
|
|
|
18
26
|
if (t.sdkLevels?.length)
|
|
19
27
|
targeting.androidSdks = { sdkLevels: t.sdkLevels };
|
|
20
28
|
if (Object.keys(targeting).length === 0) {
|
|
21
|
-
throw new Error(
|
|
29
|
+
throw new Error(M().emptyTargeting);
|
|
22
30
|
}
|
|
23
31
|
if (t.allUsers && (t.versionCodes?.length || t.versionRange)) {
|
|
24
|
-
throw new Error(
|
|
32
|
+
throw new Error(M().conflict);
|
|
25
33
|
}
|
|
26
34
|
return targeting;
|
|
27
35
|
}
|
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
// Play 트랙·릴리스 노트·릴리스 상태 변경(심사 제출)·트랙 간 promote.
|
|
2
2
|
// playstore/tools.ts 가 이 모듈을 그대로 re-export 한다 — 호출부는 tools.js 경로를 계속 쓴다.
|
|
3
3
|
import { publisher, withEdit } from './edits.js';
|
|
4
|
+
import { catalog } from '#core/lang.js';
|
|
5
|
+
const M = catalog({
|
|
6
|
+
noRelease: (track) => `${track} 트랙에 릴리스가 없어.`,
|
|
7
|
+
versionNotFound: (versionCode, track, available) => `versionCode "${versionCode}"를 ${track} 트랙에서 찾을 수 없어. 가능한 릴리스: ${available}`,
|
|
8
|
+
sendForReview: 'Play Console 에서 "변경사항 검토 후 게시"(심사를 위해 전송)를 눌러야 심사가 시작된다.',
|
|
9
|
+
sameTrack: 'fromTrack과 toTrack이 같아. 다른 트랙으로 promote 해야 의미 있어.',
|
|
10
|
+
badFraction: 'status="inProgress"일 때 userFraction은 0과 1 사이 필수 (예: 0.1 → 10%).',
|
|
11
|
+
placeholderNotes: (fromTrack, list, toTrack) => `${fromTrack} 의 릴리스 노트가 버전 문자열뿐이라 플레이스홀더로 보인다 ` +
|
|
12
|
+
`(${list}). ` +
|
|
13
|
+
`이대로 ${toTrack} 에 덮어쓰면 기존 노트가 사라진다 — releaseNotes 를 직접 넘기거나 copyReleaseNotes:false 를 고려할 것.`,
|
|
14
|
+
noNotes: (toTrack) => `${toTrack} 에 릴리스 노트 없이 승격됐다 — 스토어의 "새로운 기능"이 비어 보인다.`,
|
|
15
|
+
}, {
|
|
16
|
+
noRelease: (track) => `The ${track} track has no releases.`,
|
|
17
|
+
versionNotFound: (versionCode, track, available) => `versionCode "${versionCode}" was not found on the ${track} track. Available releases: ${available}`,
|
|
18
|
+
sendForReview: 'Review starts only after you click "Send changes for review" (send for review) in Play Console.',
|
|
19
|
+
sameTrack: 'fromTrack and toTrack are the same. Promote to a different track for it to have any effect.',
|
|
20
|
+
badFraction: 'When status="inProgress", userFraction is required and must be between 0 and 1 (e.g. 0.1 → 10%).',
|
|
21
|
+
placeholderNotes: (fromTrack, list, toTrack) => `The release notes on ${fromTrack} are only a version string and look like placeholders ` +
|
|
22
|
+
`(${list}). ` +
|
|
23
|
+
`Overwriting ${toTrack} with them as-is erases the existing notes — pass releaseNotes directly or consider copyReleaseNotes:false.`,
|
|
24
|
+
noNotes: (toTrack) => `Promoted to ${toTrack} without release notes — "What's new" on the store will look empty.`,
|
|
25
|
+
});
|
|
4
26
|
// ─── 트랙 목록 (릴리스 현황) ───
|
|
5
27
|
export async function listTracks(auth, packageName) {
|
|
6
28
|
return withEdit(auth, packageName, async (editId) => {
|
|
@@ -33,7 +55,7 @@ export async function updateReleaseNotes(auth, packageName, track, versionCode,
|
|
|
33
55
|
});
|
|
34
56
|
const releases = current.data.releases ?? [];
|
|
35
57
|
if (releases.length === 0) {
|
|
36
|
-
throw new Error(
|
|
58
|
+
throw new Error(M().noRelease(track));
|
|
37
59
|
}
|
|
38
60
|
const target = releases.find((r) => (r.versionCodes ?? []).some((v) => String(v) === String(versionCode)));
|
|
39
61
|
if (!target) {
|
|
@@ -42,7 +64,7 @@ export async function updateReleaseNotes(auth, packageName, track, versionCode,
|
|
|
42
64
|
versionCodes: r.versionCodes,
|
|
43
65
|
status: r.status,
|
|
44
66
|
}));
|
|
45
|
-
throw new Error(
|
|
67
|
+
throw new Error(M().versionNotFound(versionCode, track, JSON.stringify(available)));
|
|
46
68
|
}
|
|
47
69
|
const notes = target.releaseNotes ?? [];
|
|
48
70
|
const idx = notes.findIndex((n) => n.language === language);
|
|
@@ -69,7 +91,7 @@ export async function updateLatestReleaseNotes(auth, packageName, track, languag
|
|
|
69
91
|
});
|
|
70
92
|
const releases = current.data.releases ?? [];
|
|
71
93
|
if (releases.length === 0) {
|
|
72
|
-
throw new Error(
|
|
94
|
+
throw new Error(M().noRelease(track));
|
|
73
95
|
}
|
|
74
96
|
const maxVc = (r) => Math.max(...(r.versionCodes ?? []).map((v) => Number(v)), 0);
|
|
75
97
|
const target = releases.reduce((best, r) => (maxVc(r) > maxVc(best) ? r : best));
|
|
@@ -106,7 +128,7 @@ export async function submitRelease(auth, packageName, track, versionCode, statu
|
|
|
106
128
|
});
|
|
107
129
|
const releases = current.data.releases ?? [];
|
|
108
130
|
if (releases.length === 0) {
|
|
109
|
-
throw new Error(
|
|
131
|
+
throw new Error(M().noRelease(track));
|
|
110
132
|
}
|
|
111
133
|
const target = releases.find((r) => (r.versionCodes ?? []).some((v) => String(v) === String(versionCode)));
|
|
112
134
|
if (!target) {
|
|
@@ -115,7 +137,7 @@ export async function submitRelease(auth, packageName, track, versionCode, statu
|
|
|
115
137
|
versionCodes: r.versionCodes,
|
|
116
138
|
status: r.status,
|
|
117
139
|
}));
|
|
118
|
-
throw new Error(
|
|
140
|
+
throw new Error(M().versionNotFound(versionCode, track, JSON.stringify(available)));
|
|
119
141
|
}
|
|
120
142
|
const previousStatus = target.status;
|
|
121
143
|
const updatedTarget = { ...target, status };
|
|
@@ -143,17 +165,17 @@ export async function submitRelease(auth, packageName, track, versionCode, statu
|
|
|
143
165
|
...out,
|
|
144
166
|
changesNotSentForReview: commitInfo.changesNotSentForReview,
|
|
145
167
|
nextAction: commitInfo.changesNotSentForReview
|
|
146
|
-
?
|
|
168
|
+
? M().sendForReview
|
|
147
169
|
: undefined,
|
|
148
170
|
};
|
|
149
171
|
}
|
|
150
172
|
export async function promoteRelease(auth, packageName, fromTrack, toTrack, versionCode, options = {}) {
|
|
151
173
|
const { status = 'completed', userFraction, releaseName, releaseNotes, copyReleaseNotes = true, } = options;
|
|
152
174
|
if (fromTrack === toTrack) {
|
|
153
|
-
throw new Error(
|
|
175
|
+
throw new Error(M().sameTrack);
|
|
154
176
|
}
|
|
155
177
|
if (status === 'inProgress' && (userFraction == null || userFraction <= 0 || userFraction >= 1)) {
|
|
156
|
-
throw new Error(
|
|
178
|
+
throw new Error(M().badFraction);
|
|
157
179
|
}
|
|
158
180
|
let commitInfo = { changesNotSentForReview: false };
|
|
159
181
|
const warnings = [];
|
|
@@ -170,7 +192,7 @@ export async function promoteRelease(auth, packageName, fromTrack, toTrack, vers
|
|
|
170
192
|
versionCodes: r.versionCodes,
|
|
171
193
|
status: r.status,
|
|
172
194
|
}));
|
|
173
|
-
throw new Error(
|
|
195
|
+
throw new Error(M().versionNotFound(versionCode, fromTrack, JSON.stringify(available)));
|
|
174
196
|
}
|
|
175
197
|
// 2. 새 release 객체 구성
|
|
176
198
|
const newRelease = {
|
|
@@ -192,9 +214,7 @@ export async function promoteRelease(auth, packageName, fromTrack, toTrack, vers
|
|
|
192
214
|
const copied = sourceRelease.releaseNotes ?? [];
|
|
193
215
|
const placeholder = copied.filter((n) => /^\s*v?\d+(\.\d+)*\s*(\(\d+\))?\s*$/.test(n.text ?? ''));
|
|
194
216
|
if (placeholder.length > 0) {
|
|
195
|
-
warnings.push(
|
|
196
|
-
`(${placeholder.map((n) => `${n.language}="${n.text}"`).join(', ')}). ` +
|
|
197
|
-
`이대로 ${toTrack} 에 덮어쓰면 기존 노트가 사라진다 — releaseNotes 를 직접 넘기거나 copyReleaseNotes:false 를 고려할 것.`);
|
|
217
|
+
warnings.push(M().placeholderNotes(fromTrack, placeholder.map((n) => `${n.language}="${n.text}"`).join(', '), toTrack));
|
|
198
218
|
}
|
|
199
219
|
}
|
|
200
220
|
// 3. target 트랙 현재 상태 조회 후 merge
|
|
@@ -236,14 +256,14 @@ export async function promoteRelease(auth, packageName, fromTrack, toTrack, vers
|
|
|
236
256
|
};
|
|
237
257
|
}, true, (info) => { commitInfo = info; });
|
|
238
258
|
if ((out.releaseNotesLanguages ?? []).length === 0) {
|
|
239
|
-
warnings.push(
|
|
259
|
+
warnings.push(M().noNotes(toTrack));
|
|
240
260
|
}
|
|
241
261
|
return {
|
|
242
262
|
...out,
|
|
243
263
|
changesNotSentForReview: commitInfo.changesNotSentForReview,
|
|
244
264
|
// Play 가 자동 심사 전송을 거부한 경우, 사람이 콘솔에서 눌러야 실제 심사가 시작된다.
|
|
245
265
|
nextAction: commitInfo.changesNotSentForReview
|
|
246
|
-
?
|
|
266
|
+
? M().sendForReview
|
|
247
267
|
: undefined,
|
|
248
268
|
warnings: warnings.length ? warnings : undefined,
|
|
249
269
|
};
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
// Play 사용자 리뷰 조회·답변.
|
|
2
2
|
// playstore/tools.ts 가 이 모듈을 그대로 re-export 한다 — 호출부는 tools.js 경로를 계속 쓴다.
|
|
3
3
|
import { publisher } from './edits.js';
|
|
4
|
+
import { catalog } from '#core/lang.js';
|
|
5
|
+
const M = catalog({
|
|
6
|
+
pageFailed: (page, n, reason) => `${page}페이지 조회 실패로 ${n}건까지만 가져왔다 (${reason})`,
|
|
7
|
+
tokenLoop: '같은 페이지 토큰이 반복되어 조회를 중단했습니다.',
|
|
8
|
+
pageCap: (max, n) => `페이지 상한(${max}페이지)에 걸려 최근 ${n}건까지만 가져왔다`,
|
|
9
|
+
}, {
|
|
10
|
+
pageFailed: (page, n, reason) => `Fetching page ${page} failed, so only ${n} reviews were fetched (${reason})`,
|
|
11
|
+
tokenLoop: 'Stopped fetching because the same page token repeated.',
|
|
12
|
+
pageCap: (max, n) => `Hit the page limit (${max} pages), so only the latest ${n} reviews were fetched`,
|
|
13
|
+
});
|
|
4
14
|
// ─── 리뷰 조회 ───
|
|
5
15
|
// 개발자 답변(developerComment)을 반드시 보존한다. 예전엔 userComment 만 골라 담아서 답변한 리뷰도
|
|
6
16
|
// 미답변처럼 보였고, "미답변 리뷰에 답하기" 흐름이 이미 답한 리뷰에 다시 답해 기존 답변을 덮어썼다
|
|
@@ -37,18 +47,18 @@ async function fetchAllReviews(auth, packageName) {
|
|
|
37
47
|
if (page === 0)
|
|
38
48
|
throw err;
|
|
39
49
|
const reason = err instanceof Error ? err.message : String(err);
|
|
40
|
-
return { reviews: all, truncated:
|
|
50
|
+
return { reviews: all, truncated: M().pageFailed(page + 1, all.length, reason) };
|
|
41
51
|
}
|
|
42
52
|
all.push(...result.reviews);
|
|
43
53
|
const next = result.nextPageToken;
|
|
44
54
|
if (!next)
|
|
45
55
|
return { reviews: all, truncated: null };
|
|
46
56
|
if (seen.has(next))
|
|
47
|
-
return { reviews: all, truncated:
|
|
57
|
+
return { reviews: all, truncated: M().tokenLoop };
|
|
48
58
|
seen.add(next);
|
|
49
59
|
token = next;
|
|
50
60
|
}
|
|
51
|
-
return { reviews: all, truncated:
|
|
61
|
+
return { reviews: all, truncated: M().pageCap(REVIEW_MAX_PAGES, all.length) };
|
|
52
62
|
}
|
|
53
63
|
// 리뷰당 답변은 하나지만, 혹시 여러 개면 가장 최근 것이 현재 게시된 답변이다.
|
|
54
64
|
function latestDeveloperComment(comments) {
|
|
@@ -71,7 +81,7 @@ export async function listReviewsPage(auth, packageName, { limit = DEFAULT_REVIE
|
|
|
71
81
|
const summaries = page.reviews.map(toReviewSummary);
|
|
72
82
|
const reviews = unansweredOnly ? summaries.filter((review) => review.developerComment === null) : summaries;
|
|
73
83
|
if (page.nextPageToken && page.nextPageToken === pageToken) {
|
|
74
|
-
return { reviews, nextPageToken: null, warning:
|
|
84
|
+
return { reviews, nextPageToken: null, warning: M().tokenLoop };
|
|
75
85
|
}
|
|
76
86
|
return { reviews, nextPageToken: page.nextPageToken };
|
|
77
87
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// Play Developer Reporting API / Android vitals 통계.
|
|
2
2
|
// playstore/tools.ts 가 이 모듈을 그대로 re-export 한다 — 호출부는 tools.js 경로를 계속 쓴다.
|
|
3
|
+
import { catalog } from '#core/lang.js';
|
|
4
|
+
const M = catalog({ badDate: (date) => `날짜는 YYYY-MM-DD 형식이어야 해: ${date}` }, { badDate: (date) => `Dates must be in YYYY-MM-DD format: ${date}` });
|
|
3
5
|
const REPORTING_API_BASE = 'https://playdeveloperreporting.googleapis.com/v1beta1';
|
|
4
6
|
const METRIC_SET_RESOURCE = {
|
|
5
7
|
anrRate: 'anrRateMetricSet',
|
|
@@ -14,7 +16,7 @@ const DEFAULT_METRICS = {
|
|
|
14
16
|
function dateToReportingDateTime(date, timeZone) {
|
|
15
17
|
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(date);
|
|
16
18
|
if (!match)
|
|
17
|
-
throw new Error(
|
|
19
|
+
throw new Error(M().badDate(date));
|
|
18
20
|
return {
|
|
19
21
|
year: Number(match[1]),
|
|
20
22
|
month: Number(match[2]),
|