@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
package/dist/googleads/config.js
CHANGED
|
@@ -2,6 +2,26 @@ import fs from 'node:fs';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import os from 'node:os';
|
|
4
4
|
import { writeCredentialJson } from '#core/atomic-write.js';
|
|
5
|
+
import { assertCredentialFileReadable } from '../lib/json-file.js';
|
|
6
|
+
import { catalog } from '#core/lang.js';
|
|
7
|
+
import { readCredentialFileSync } from '#core/credential-read.js';
|
|
8
|
+
const M = catalog({
|
|
9
|
+
missing: [
|
|
10
|
+
'❌ Google Ads 설정이 없어.',
|
|
11
|
+
'',
|
|
12
|
+
'googleads_save_config 도구로 먼저 설정해줘:',
|
|
13
|
+
' - developerToken: Google Ads 콘솔 → 관리자 → API 센터에서 발급',
|
|
14
|
+
' - customerId: Google Ads 계정 ID (예: 123-456-7890)',
|
|
15
|
+
],
|
|
16
|
+
}, {
|
|
17
|
+
missing: [
|
|
18
|
+
'❌ No Google Ads settings.',
|
|
19
|
+
'',
|
|
20
|
+
'Set them up first with the googleads_save_config tool:',
|
|
21
|
+
' - developerToken: issued in Google Ads console → Admin → API Center',
|
|
22
|
+
' - customerId: Google Ads account ID (e.g. 123-456-7890)',
|
|
23
|
+
],
|
|
24
|
+
});
|
|
5
25
|
const CONFIG_DIR = path.join(os.homedir(), '.mimi-seed');
|
|
6
26
|
const CONFIG_PATH = path.join(CONFIG_DIR, 'google-ads.json');
|
|
7
27
|
/**
|
|
@@ -31,7 +51,7 @@ export function loadConfig() {
|
|
|
31
51
|
if (!fs.existsSync(CONFIG_PATH))
|
|
32
52
|
return null;
|
|
33
53
|
try {
|
|
34
|
-
const cfg = JSON.parse(
|
|
54
|
+
const cfg = JSON.parse(readCredentialFileSync(CONFIG_PATH));
|
|
35
55
|
// 읽기 시점에도 정규화 — 하이픈 포함 값이 손으로 적히거나 구버전이 쓴 경우에도
|
|
36
56
|
// URL/login-customer-id 헤더가 항상 숫자만 포함하도록 보장 (write 경로 의존 제거).
|
|
37
57
|
const customerId = readCustomerId(cfg.customerId);
|
|
@@ -45,19 +65,15 @@ export function loadConfig() {
|
|
|
45
65
|
return { ...cfg, developerToken: cfg.developerToken, customerId, loginCustomerId };
|
|
46
66
|
}
|
|
47
67
|
catch {
|
|
68
|
+
// 읽을 수 없으면 '미설정' — 깨진 파일은 requireConfig · mimi_seed_status 가 json-file 로 따로 진단한다
|
|
48
69
|
return null;
|
|
49
70
|
}
|
|
50
71
|
}
|
|
51
72
|
export function requireConfig() {
|
|
52
73
|
const cfg = loadConfig();
|
|
53
74
|
if (!cfg) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
'',
|
|
57
|
-
'googleads_save_config 도구로 먼저 설정해줘:',
|
|
58
|
-
' - developerToken: Google Ads 콘솔 → 관리자 → API 센터에서 발급',
|
|
59
|
-
' - customerId: Google Ads 계정 ID (예: 123-456-7890)',
|
|
60
|
-
].join('\n'));
|
|
75
|
+
assertCredentialFileReadable(CONFIG_PATH, 'googleads_save_config');
|
|
76
|
+
throw new Error(M().missing.join('\n'));
|
|
61
77
|
}
|
|
62
78
|
return cfg;
|
|
63
79
|
}
|
package/dist/googleads/tools.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { fetchWithTimeout } from '../lib/http.js';
|
|
2
2
|
import { googleAdsError } from './errors.js';
|
|
3
3
|
import { encodePathSegment } from '../lib/url-path.js';
|
|
4
|
+
import { catalog } from '#core/lang.js';
|
|
5
|
+
const M = catalog({ noToken: 'OAuth 토큰을 가져올 수 없음. 재인증 필요.' }, { noToken: 'Could not get an OAuth token. Reauthentication required.' });
|
|
4
6
|
// Google Ads API는 ~13개월 주기로 sunset (항상 최신 3개 major만 유지).
|
|
5
7
|
// v24 = 2026-06 기준 현행 major. 새 major 출시 시 갱신 필요.
|
|
6
8
|
// https://developers.google.com/google-ads/api/docs/sunset-dates
|
|
@@ -33,7 +35,7 @@ function validateDateRange(range) {
|
|
|
33
35
|
async function getAccessToken(auth) {
|
|
34
36
|
const token = await auth.getAccessToken();
|
|
35
37
|
if (!token.token)
|
|
36
|
-
throw new Error(
|
|
38
|
+
throw new Error(M().noToken);
|
|
37
39
|
return token.token;
|
|
38
40
|
}
|
|
39
41
|
function buildHeaders(accessToken, cfg) {
|
package/dist/gsc/tools.d.ts
CHANGED
|
@@ -1,23 +1,129 @@
|
|
|
1
1
|
import type { OAuth2Client } from 'google-auth-library';
|
|
2
|
+
import type { searchconsole_v1 } from '@googleapis/searchconsole';
|
|
2
3
|
export type GscAuth = OAuth2Client;
|
|
3
|
-
export declare function listSites(auth: GscAuth): Promise<
|
|
4
|
-
export declare function listSitemaps(auth: GscAuth, siteUrl: string, sitemapIndex?: string): Promise<
|
|
5
|
-
|
|
4
|
+
export declare function listSites(auth: GscAuth): Promise<searchconsole_v1.Schema$WmxSite[]>;
|
|
5
|
+
export declare function listSitemaps(auth: GscAuth, siteUrl: string, sitemapIndex?: string): Promise<(searchconsole_v1.Schema$WmxSitemap | {
|
|
6
|
+
contents: {
|
|
7
|
+
submitted?: string | null;
|
|
8
|
+
type?: string | null;
|
|
9
|
+
}[];
|
|
10
|
+
errors?: string | null;
|
|
11
|
+
isPending?: boolean | null;
|
|
12
|
+
isSitemapsIndex?: boolean | null;
|
|
13
|
+
lastDownloaded?: string | null;
|
|
14
|
+
lastSubmitted?: string | null;
|
|
15
|
+
path?: string | null;
|
|
16
|
+
type?: string | null;
|
|
17
|
+
warnings?: string | null;
|
|
18
|
+
})[]>;
|
|
19
|
+
export declare function getSitemap(auth: GscAuth, siteUrl: string, feedpath: string): Promise<searchconsole_v1.Schema$WmxSitemap | {
|
|
20
|
+
contents: {
|
|
21
|
+
submitted?: string | null;
|
|
22
|
+
type?: string | null;
|
|
23
|
+
}[];
|
|
24
|
+
errors?: string | null;
|
|
25
|
+
isPending?: boolean | null;
|
|
26
|
+
isSitemapsIndex?: boolean | null;
|
|
27
|
+
lastDownloaded?: string | null;
|
|
28
|
+
lastSubmitted?: string | null;
|
|
29
|
+
path?: string | null;
|
|
30
|
+
type?: string | null;
|
|
31
|
+
warnings?: string | null;
|
|
32
|
+
}>;
|
|
6
33
|
/** 사이트맵 제출 — webmasters(read-write) 스코프 필요. 응답 본문은 없음(204). */
|
|
7
34
|
export declare function submitSitemap(auth: GscAuth, siteUrl: string, feedpath: string): Promise<{
|
|
8
35
|
submitted: string;
|
|
9
36
|
siteUrl: string;
|
|
10
37
|
}>;
|
|
11
|
-
export declare function inspectUrl(auth: GscAuth, siteUrl: string, inspectionUrl: string, languageCode?: string): Promise<
|
|
12
|
-
export
|
|
38
|
+
export declare function inspectUrl(auth: GscAuth, siteUrl: string, inspectionUrl: string, languageCode?: string): Promise<searchconsole_v1.Schema$UrlInspectionResult>;
|
|
39
|
+
export declare const SEARCH_TYPES: readonly ["web", "image", "video", "news", "discover", "googleNews"];
|
|
40
|
+
export declare const SEARCH_FILTER_DIMENSIONS: readonly ["page", "query", "country", "device", "searchAppearance", "brandedClassification"];
|
|
41
|
+
export declare const SEARCH_FILTER_OPERATORS: readonly ["equals", "notEquals", "contains", "notContains", "includingRegex", "excludingRegex"];
|
|
42
|
+
interface SearchAnalyticsFilter {
|
|
43
|
+
dimension: (typeof SEARCH_FILTER_DIMENSIONS)[number];
|
|
44
|
+
operator?: (typeof SEARCH_FILTER_OPERATORS)[number];
|
|
45
|
+
expression: string;
|
|
46
|
+
}
|
|
47
|
+
interface SearchAnalyticsParams {
|
|
13
48
|
startDate: string;
|
|
14
49
|
endDate: string;
|
|
15
|
-
dimensions?: string
|
|
50
|
+
dimensions?: string;
|
|
16
51
|
rowLimit?: number;
|
|
17
52
|
startRow?: number;
|
|
18
|
-
type?:
|
|
53
|
+
type?: (typeof SEARCH_TYPES)[number];
|
|
54
|
+
filters?: SearchAnalyticsFilter[];
|
|
55
|
+
summaryOnly?: boolean;
|
|
56
|
+
includeTotals?: boolean;
|
|
19
57
|
}
|
|
20
|
-
export declare function searchAnalytics(auth: GscAuth, siteUrl: string, params: SearchAnalyticsParams): Promise<
|
|
58
|
+
export declare function searchAnalytics(auth: GscAuth, siteUrl: string, params: SearchAnalyticsParams): Promise<{
|
|
59
|
+
aggregationType: string | null;
|
|
60
|
+
rowSummary: {
|
|
61
|
+
rowCount: number;
|
|
62
|
+
totalClicks: number;
|
|
63
|
+
totalImpressions: number;
|
|
64
|
+
avgCtr: number;
|
|
65
|
+
avgPosition: number | null;
|
|
66
|
+
};
|
|
67
|
+
pagination: {
|
|
68
|
+
startRow: number;
|
|
69
|
+
rowLimit: number;
|
|
70
|
+
nextStartRow: number | null;
|
|
71
|
+
mayOmitRows: boolean;
|
|
72
|
+
};
|
|
73
|
+
rows: searchconsole_v1.Schema$ApiDataRow[];
|
|
74
|
+
period: {
|
|
75
|
+
startDate: string;
|
|
76
|
+
endDate: string;
|
|
77
|
+
};
|
|
78
|
+
type: "web" | "video" | "image" | "news" | "discover" | "googleNews";
|
|
79
|
+
dimensions: string[];
|
|
80
|
+
} | {
|
|
81
|
+
rows?: searchconsole_v1.Schema$ApiDataRow[] | undefined;
|
|
82
|
+
aggregationType: string | null;
|
|
83
|
+
summary: {
|
|
84
|
+
rowCount: number;
|
|
85
|
+
totalClicks: number;
|
|
86
|
+
totalImpressions: number;
|
|
87
|
+
avgCtr: number;
|
|
88
|
+
avgPosition: number | null;
|
|
89
|
+
};
|
|
90
|
+
period: {
|
|
91
|
+
startDate: string;
|
|
92
|
+
endDate: string;
|
|
93
|
+
};
|
|
94
|
+
type: "web" | "video" | "image" | "news" | "discover" | "googleNews";
|
|
95
|
+
dimensions: string[];
|
|
96
|
+
} | {
|
|
97
|
+
summary: {
|
|
98
|
+
rowCount: number;
|
|
99
|
+
totalClicks: number;
|
|
100
|
+
totalImpressions: number;
|
|
101
|
+
avgCtr: number;
|
|
102
|
+
avgPosition: number | null;
|
|
103
|
+
};
|
|
104
|
+
totalAggregationType: string | null;
|
|
105
|
+
aggregationType: string | null;
|
|
106
|
+
rowSummary: {
|
|
107
|
+
rowCount: number;
|
|
108
|
+
totalClicks: number;
|
|
109
|
+
totalImpressions: number;
|
|
110
|
+
avgCtr: number;
|
|
111
|
+
avgPosition: number | null;
|
|
112
|
+
};
|
|
113
|
+
pagination: {
|
|
114
|
+
startRow: number;
|
|
115
|
+
rowLimit: number;
|
|
116
|
+
nextStartRow: number | null;
|
|
117
|
+
mayOmitRows: boolean;
|
|
118
|
+
};
|
|
119
|
+
rows: searchconsole_v1.Schema$ApiDataRow[];
|
|
120
|
+
period: {
|
|
121
|
+
startDate: string;
|
|
122
|
+
endDate: string;
|
|
123
|
+
};
|
|
124
|
+
type: "web" | "video" | "image" | "news" | "discover" | "googleNews";
|
|
125
|
+
dimensions: string[];
|
|
126
|
+
}>;
|
|
21
127
|
export interface SearchAnalyticsRow {
|
|
22
128
|
keys?: string[] | null;
|
|
23
129
|
clicks?: number | null;
|
|
@@ -35,5 +141,6 @@ export declare function summarizeRows(rows: SearchAnalyticsRow[]): {
|
|
|
35
141
|
totalClicks: number;
|
|
36
142
|
totalImpressions: number;
|
|
37
143
|
avgCtr: number;
|
|
38
|
-
avgPosition: number;
|
|
144
|
+
avgPosition: number | null;
|
|
39
145
|
};
|
|
146
|
+
export {};
|
package/dist/gsc/tools.js
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { google } from '../lib/googleapis-lite.js';
|
|
2
2
|
import { notDotSegment } from '../lib/resource-id.js';
|
|
3
|
+
import { catalog } from '#core/lang.js';
|
|
4
|
+
const M = catalog({
|
|
5
|
+
dateOrder: 'startDate는 endDate 이전 또는 같은 날짜여야 해.',
|
|
6
|
+
startRow: 'startRow는 dimensions로 분해한 조회에만 사용할 수 있어.',
|
|
7
|
+
}, {
|
|
8
|
+
dateOrder: 'startDate must be on or before endDate.',
|
|
9
|
+
startRow: 'startRow can be used only for queries broken down by dimensions.',
|
|
10
|
+
});
|
|
3
11
|
/**
|
|
4
12
|
* Google Search Console (Webmasters) API v1 래퍼.
|
|
5
13
|
*
|
|
6
14
|
* `searchconsole('v1')` 은 구 `webmasters('v3')` 의 후속으로, sites/sitemaps/
|
|
7
15
|
* searchanalytics 에 더해 URL Inspection(`urlInspection.index.inspect`)을 포함한다.
|
|
8
|
-
*
|
|
16
|
+
* 조회에는 webmasters.readonly 또는 webmasters, 사이트맵 제출에는 webmasters를 사용한다.
|
|
9
17
|
*/
|
|
10
18
|
const sc = () => google.searchconsole('v1');
|
|
11
19
|
// ─── 속성(사이트) 목록 ───
|
|
@@ -14,15 +22,20 @@ export async function listSites(auth) {
|
|
|
14
22
|
return res.data.siteEntry ?? [];
|
|
15
23
|
}
|
|
16
24
|
// ─── 사이트맵 ───
|
|
25
|
+
function withoutIndexedCount(sitemap) {
|
|
26
|
+
if (!sitemap.contents)
|
|
27
|
+
return sitemap;
|
|
28
|
+
return { ...sitemap, contents: sitemap.contents.map(({ indexed: _indexed, ...content }) => content) };
|
|
29
|
+
}
|
|
17
30
|
export async function listSitemaps(auth, siteUrl, sitemapIndex) {
|
|
18
31
|
const res = await sc().sitemaps.list({ auth, siteUrl: notDotSegment(siteUrl, 'siteUrl'), sitemapIndex });
|
|
19
|
-
return res.data.sitemap ?? [];
|
|
32
|
+
return (res.data.sitemap ?? []).map(withoutIndexedCount);
|
|
20
33
|
}
|
|
21
34
|
export async function getSitemap(auth, siteUrl, feedpath) {
|
|
22
35
|
const res = await sc().sitemaps.get({
|
|
23
36
|
auth, siteUrl: notDotSegment(siteUrl, 'siteUrl'), feedpath: notDotSegment(feedpath, 'feedpath'),
|
|
24
37
|
});
|
|
25
|
-
return res.data;
|
|
38
|
+
return withoutIndexedCount(res.data);
|
|
26
39
|
}
|
|
27
40
|
/** 사이트맵 제출 — webmasters(read-write) 스코프 필요. 응답 본문은 없음(204). */
|
|
28
41
|
export async function submitSitemap(auth, siteUrl, feedpath) {
|
|
@@ -39,20 +52,79 @@ export async function inspectUrl(auth, siteUrl, inspectionUrl, languageCode = 'e
|
|
|
39
52
|
});
|
|
40
53
|
return res.data.inspectionResult ?? {};
|
|
41
54
|
}
|
|
42
|
-
|
|
55
|
+
// ─── 검색 성과 (Search Analytics) ───
|
|
56
|
+
export const SEARCH_TYPES = ['web', 'image', 'video', 'news', 'discover', 'googleNews'];
|
|
57
|
+
export const SEARCH_FILTER_DIMENSIONS = ['page', 'query', 'country', 'device', 'searchAppearance', 'brandedClassification'];
|
|
58
|
+
export const SEARCH_FILTER_OPERATORS = ['equals', 'notEquals', 'contains', 'notContains', 'includingRegex', 'excludingRegex'];
|
|
59
|
+
async function querySearchAnalytics(auth, siteUrl, requestBody) {
|
|
43
60
|
const res = await sc().searchanalytics.query({
|
|
44
61
|
auth,
|
|
45
|
-
siteUrl
|
|
46
|
-
requestBody
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
62
|
+
siteUrl,
|
|
63
|
+
requestBody,
|
|
64
|
+
});
|
|
65
|
+
const rows = res.data.rows ?? [];
|
|
66
|
+
// Discover and the Google News app/site don't report position. Google can return a zero placeholder.
|
|
67
|
+
const hasPosition = requestBody.type !== 'discover' && requestBody.type !== 'googleNews';
|
|
68
|
+
return {
|
|
69
|
+
rows: hasPosition ? rows : rows.map((row) => ({ ...row, position: null })),
|
|
70
|
+
aggregationType: res.data.responseAggregationType ?? null,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export async function searchAnalytics(auth, siteUrl, params) {
|
|
74
|
+
const { startDate, endDate, startRow = 0, rowLimit = 1000, type = 'web', filters, summaryOnly, includeTotals } = params;
|
|
75
|
+
if (startDate > endDate)
|
|
76
|
+
throw new Error(M().dateOrder);
|
|
77
|
+
const dimensions = params.dimensions?.split(',').map((value) => value.trim()).filter(Boolean) ?? [];
|
|
78
|
+
const reportDimensions = summaryOnly ? [] : dimensions;
|
|
79
|
+
if (startRow > 0 && reportDimensions.length === 0 && !summaryOnly) {
|
|
80
|
+
throw new Error(M().startRow);
|
|
81
|
+
}
|
|
82
|
+
const property = notDotSegment(siteUrl, 'siteUrl');
|
|
83
|
+
const period = { startDate, endDate };
|
|
84
|
+
const request = {
|
|
85
|
+
...period,
|
|
86
|
+
type,
|
|
87
|
+
dimensionFilterGroups: filters?.length
|
|
88
|
+
? [{ groupType: 'and', filters: filters.map((filter) => ({ ...filter, operator: filter.operator ?? 'equals' })) }]
|
|
89
|
+
: undefined,
|
|
90
|
+
};
|
|
91
|
+
const report = { period, type, dimensions: reportDimensions };
|
|
92
|
+
if (reportDimensions.length === 0) {
|
|
93
|
+
const { rows, aggregationType } = await querySearchAnalytics(auth, property, { ...request, rowLimit: 1 });
|
|
94
|
+
return { ...report, aggregationType, summary: summarizeRows(rows), ...(summaryOnly ? {} : { rows }) };
|
|
95
|
+
}
|
|
96
|
+
const { rows, aggregationType } = await querySearchAnalytics(auth, property, {
|
|
97
|
+
...request, dimensions: reportDimensions, rowLimit, startRow,
|
|
98
|
+
});
|
|
99
|
+
const page = {
|
|
100
|
+
...report,
|
|
101
|
+
aggregationType,
|
|
102
|
+
rowSummary: summarizeRows(rows),
|
|
103
|
+
pagination: {
|
|
104
|
+
startRow,
|
|
105
|
+
rowLimit,
|
|
106
|
+
nextStartRow: rows.length === rowLimit ? startRow + rows.length : null,
|
|
107
|
+
mayOmitRows: true,
|
|
53
108
|
},
|
|
109
|
+
rows,
|
|
110
|
+
};
|
|
111
|
+
if (!includeTotals)
|
|
112
|
+
return page;
|
|
113
|
+
// Google requires automatic aggregation when a page filter is present. With only a
|
|
114
|
+
// page grouping, preserve page aggregation after removing the grouping for totals.
|
|
115
|
+
let totalAggregation;
|
|
116
|
+
if (!filters?.some((filter) => filter.dimension === 'page')) {
|
|
117
|
+
if (aggregationType === 'byPage' || aggregationType === 'byProperty')
|
|
118
|
+
totalAggregation = aggregationType;
|
|
119
|
+
else if (reportDimensions.includes('page'))
|
|
120
|
+
totalAggregation = 'byPage';
|
|
121
|
+
}
|
|
122
|
+
const totals = await querySearchAnalytics(auth, property, {
|
|
123
|
+
...request,
|
|
124
|
+
rowLimit: 1,
|
|
125
|
+
aggregationType: totalAggregation,
|
|
54
126
|
});
|
|
55
|
-
return
|
|
127
|
+
return { ...page, summary: summarizeRows(totals.rows), totalAggregationType: totals.aggregationType };
|
|
56
128
|
}
|
|
57
129
|
/**
|
|
58
130
|
* Search Analytics rows 요약.
|
|
@@ -60,14 +132,26 @@ export async function searchAnalytics(auth, siteUrl, params) {
|
|
|
60
132
|
* 노출이 1인 행과 1000인 행을 동등 취급해 실제 평균 순위를 왜곡한다.
|
|
61
133
|
*/
|
|
62
134
|
export function summarizeRows(rows) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
135
|
+
let totalClicks = 0;
|
|
136
|
+
let totalImpressions = 0;
|
|
137
|
+
let positionImpressions = 0;
|
|
138
|
+
let weightedPosition = 0;
|
|
139
|
+
for (const row of rows) {
|
|
140
|
+
const impressions = row.impressions ?? 0;
|
|
141
|
+
totalClicks += row.clicks ?? 0;
|
|
142
|
+
totalImpressions += impressions;
|
|
143
|
+
if (row.position != null && row.position > 0) {
|
|
144
|
+
positionImpressions += impressions;
|
|
145
|
+
weightedPosition += row.position * impressions;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
66
148
|
return {
|
|
67
149
|
rowCount: rows.length,
|
|
68
150
|
totalClicks,
|
|
69
151
|
totalImpressions,
|
|
70
152
|
avgCtr: totalImpressions > 0 ? Math.round((totalClicks / totalImpressions) * 10000) / 10000 : 0,
|
|
71
|
-
avgPosition: totalImpressions > 0
|
|
153
|
+
avgPosition: totalImpressions > 0 && positionImpressions === totalImpressions
|
|
154
|
+
? Math.round((weightedPosition / totalImpressions) * 100) / 100
|
|
155
|
+
: null,
|
|
72
156
|
};
|
|
73
157
|
}
|
package/dist/helpers.d.ts
CHANGED
|
@@ -10,8 +10,10 @@ export { ensureFreshAccessToken };
|
|
|
10
10
|
* 스코프 배열을 넘기면 그중 하나만 부여되어 있어도 통과한다.
|
|
11
11
|
*/
|
|
12
12
|
export declare function requireAuth(requiredScope?: string | readonly string[], profile?: string): Promise<import("google-auth-library").OAuth2Client>;
|
|
13
|
-
|
|
14
|
-
export declare const
|
|
13
|
+
/** Google Play 인증이 없을 때의 안내 (현재 언어). */
|
|
14
|
+
export declare const playAuthHint: () => string;
|
|
15
|
+
/** App Store Connect 인증이 없을 때의 안내 (현재 언어). */
|
|
16
|
+
export declare const appStoreAuthHint: () => string;
|
|
15
17
|
/**
|
|
16
18
|
* Google Play 인증 — 서비스 계정 JSON 우선, 없으면 OAuth 클라이언트로 폴백.
|
|
17
19
|
*
|
package/dist/helpers.js
CHANGED
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
import { getAuthenticatedClient, ensureFreshAccessToken } from './auth/google-auth.js';
|
|
2
2
|
import { domainsForScope, isPreTrackingScope } from './auth/scopes.js';
|
|
3
3
|
import { getServiceAccountClient, getServiceAccountJson } from './auth/playstore-auth.js';
|
|
4
|
-
import { getAppStoreCredentials } from './appstore/auth.js';
|
|
4
|
+
import { appStoreCredentialsPath, getAppStoreCredentials } from './appstore/auth.js';
|
|
5
|
+
import { authText } from './auth/errors.js';
|
|
6
|
+
import { assertCredentialFileReadable } from './lib/json-file.js';
|
|
7
|
+
import { catalog } from '#core/lang.js';
|
|
5
8
|
export { ensureFreshAccessToken };
|
|
6
9
|
const REAUTH_CMD = ' npx -y @yoonion/mimi-seed-mcp mimi-seed-auth';
|
|
7
|
-
function formatAuthError(p, profile) {
|
|
10
|
+
function formatAuthError(p, profile, scopes = []) {
|
|
11
|
+
// Scope alternatives are ordered by the caller. Recommend the first available domain.
|
|
12
|
+
const domain = scopes.flatMap(domainsForScope)[0];
|
|
13
|
+
const reauthCommand = [
|
|
14
|
+
REAUTH_CMD,
|
|
15
|
+
profile === undefined ? '' : ` --profile ${profile}`,
|
|
16
|
+
domain ? ` --domains ${domain}` : '',
|
|
17
|
+
].join('');
|
|
8
18
|
// 재로그인 안내는 needsReauth 인 경우에만 — CONFIG_FETCH_FAILED 처럼 재로그인이
|
|
9
19
|
// 해법이 아닌 에러에 무조건 붙이면 같은 실패를 반복하게 만든다.
|
|
10
20
|
return [
|
|
11
21
|
`❌ [${p.code}] ${p.message}`,
|
|
12
22
|
p.hint ? `→ ${p.hint}` : '',
|
|
13
|
-
...(p.needsReauth ? ['',
|
|
23
|
+
...(p.needsReauth ? ['', authText().reloginInTerminal, reauthCommand] : []),
|
|
14
24
|
]
|
|
15
25
|
.filter((l) => l !== '')
|
|
16
26
|
.join('\n');
|
|
@@ -28,23 +38,18 @@ function formatAuthError(p, profile) {
|
|
|
28
38
|
*
|
|
29
39
|
* OAuth 토큰에만 적용된다 — SA JWT 는 자체 scopes 로 토큰을 받으므로 이 검사 대상이 아니다.
|
|
30
40
|
*/
|
|
31
|
-
function assertStoredScope(
|
|
32
|
-
if (
|
|
41
|
+
function assertStoredScope(scopes, scopeStr, profile) {
|
|
42
|
+
if (scopes.length === 0)
|
|
33
43
|
return;
|
|
34
|
-
const scopes = typeof requiredScope === 'string' ? [requiredScope] : requiredScope;
|
|
35
44
|
const grantedScopes = scopeStr?.split(/\s+/);
|
|
36
45
|
if (scopes.some((scope) => grantedScopes ? grantedScopes.includes(scope) : isPreTrackingScope(scope)))
|
|
37
46
|
return;
|
|
38
|
-
const domainArg = [...new Set(scopes.flatMap(domainsForScope))].join(',');
|
|
39
47
|
throw new Error(formatAuthError({
|
|
40
48
|
code: 'INSUFFICIENT_SCOPE',
|
|
41
|
-
|
|
42
|
-
hint: domainArg
|
|
43
|
-
? `mimi-seed-auth${profile === undefined ? '' : ` --profile ${profile}`} --domains ${domainArg} 로 재로그인하면 기존 권한은 유지한 채 이 권한만 추가돼.`
|
|
44
|
-
: 'mimi-seed-auth 로 재로그인하면 새 권한이 부여돼.',
|
|
49
|
+
...authText().insufficientScope(scopes),
|
|
45
50
|
retriable: false,
|
|
46
51
|
needsReauth: true,
|
|
47
|
-
}));
|
|
52
|
+
}, profile, scopes));
|
|
48
53
|
}
|
|
49
54
|
/**
|
|
50
55
|
* OAuth 클라이언트 확보 — 호출 전에 access_token 을 사전 갱신하고,
|
|
@@ -56,45 +61,76 @@ function assertStoredScope(requiredScope, scopeStr, profile) {
|
|
|
56
61
|
* 스코프 배열을 넘기면 그중 하나만 부여되어 있어도 통과한다.
|
|
57
62
|
*/
|
|
58
63
|
export async function requireAuth(requiredScope, profile) {
|
|
64
|
+
const scopes = typeof requiredScope === 'string' ? [requiredScope] : requiredScope ?? [];
|
|
59
65
|
const result = await ensureFreshAccessToken(undefined, profile);
|
|
60
66
|
if (result.status === 'unauthenticated' || result.status === 'expired_refresh_failed') {
|
|
61
|
-
throw new Error(formatAuthError(result.error, profile));
|
|
67
|
+
throw new Error(formatAuthError(result.error, profile, scopes));
|
|
62
68
|
}
|
|
63
69
|
const client = getAuthenticatedClient(profile, result.tokens);
|
|
64
70
|
if (!client) {
|
|
65
71
|
throw new Error(formatAuthError({
|
|
66
72
|
code: 'UNAUTHENTICATED',
|
|
67
|
-
|
|
68
|
-
hint: 'mimi-seed-auth 로 로그인하세요.',
|
|
73
|
+
...H().googleNotConnected,
|
|
69
74
|
retriable: false,
|
|
70
75
|
needsReauth: true,
|
|
71
|
-
}));
|
|
76
|
+
}, profile, scopes));
|
|
72
77
|
}
|
|
73
78
|
// 같은 토큰으로 인증 클라이언트를 만든 뒤 해당 토큰의 스코프를 검사한다.
|
|
74
|
-
assertStoredScope(
|
|
79
|
+
assertStoredScope(scopes, result.tokens.scope, profile);
|
|
75
80
|
return client;
|
|
76
81
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
'',
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
82
|
+
/** 인증 안내 — LLM 이 사용자에게 전하는 복구 절차라 언어를 따른다 (호출 시점에 언어를 읽는다). */
|
|
83
|
+
const H = catalog({
|
|
84
|
+
googleNotConnected: { message: 'Google 계정이 연결되지 않았어.', hint: 'mimi-seed-auth 로 로그인하세요.' },
|
|
85
|
+
play: [
|
|
86
|
+
'❌ Google Play 인증이 없어.',
|
|
87
|
+
'',
|
|
88
|
+
'가장 쉬운 방법 — Google 로그인 (androidpublisher 권한 포함):',
|
|
89
|
+
REAUTH_CMD,
|
|
90
|
+
'',
|
|
91
|
+
'또는 서버/헤드리스 환경이면 서비스 계정 JSON 등록:',
|
|
92
|
+
' npx -y @yoonion/mimi-seed-mcp mimi-seed-playstore-auth',
|
|
93
|
+
'',
|
|
94
|
+
'그 다음에 다시 물어봐줘.',
|
|
95
|
+
],
|
|
96
|
+
appstore: [
|
|
97
|
+
'❌ App Store Connect 인증이 설정되지 않았어.',
|
|
98
|
+
'',
|
|
99
|
+
'터미널에서 이것만 실행하면 돼:',
|
|
100
|
+
'',
|
|
101
|
+
' npx -y @yoonion/mimi-seed-mcp mimi-seed-appstore-auth',
|
|
102
|
+
'',
|
|
103
|
+
'Issuer ID, Key ID, .p8 파일 경로를 입력하면 저장 완료.',
|
|
104
|
+
'그 다음에 다시 물어봐줘.',
|
|
105
|
+
],
|
|
106
|
+
}, {
|
|
107
|
+
googleNotConnected: { message: 'No Google account is connected.', hint: 'Log in with mimi-seed-auth.' },
|
|
108
|
+
play: [
|
|
109
|
+
'❌ No Google Play authentication.',
|
|
110
|
+
'',
|
|
111
|
+
'Easiest — Google login (includes the androidpublisher permission):',
|
|
112
|
+
REAUTH_CMD,
|
|
113
|
+
'',
|
|
114
|
+
'Or, on a server/headless environment, register a service account JSON:',
|
|
115
|
+
' npx -y @yoonion/mimi-seed-mcp mimi-seed-playstore-auth',
|
|
116
|
+
'',
|
|
117
|
+
'Then ask again.',
|
|
118
|
+
],
|
|
119
|
+
appstore: [
|
|
120
|
+
'❌ App Store Connect authentication is not set up.',
|
|
121
|
+
'',
|
|
122
|
+
'Run just this in a terminal:',
|
|
123
|
+
'',
|
|
124
|
+
' npx -y @yoonion/mimi-seed-mcp mimi-seed-appstore-auth',
|
|
125
|
+
'',
|
|
126
|
+
'Enter the Issuer ID, Key ID, and .p8 file path to save it.',
|
|
127
|
+
'Then ask again.',
|
|
128
|
+
],
|
|
129
|
+
});
|
|
130
|
+
/** Google Play 인증이 없을 때의 안내 (현재 언어). */
|
|
131
|
+
export const playAuthHint = () => H().play.join('\n');
|
|
132
|
+
/** App Store Connect 인증이 없을 때의 안내 (현재 언어). */
|
|
133
|
+
export const appStoreAuthHint = () => H().appstore.join('\n');
|
|
98
134
|
/**
|
|
99
135
|
* Google Play 인증 — 서비스 계정 JSON 우선, 없으면 OAuth 클라이언트로 폴백.
|
|
100
136
|
*
|
|
@@ -110,26 +146,28 @@ export async function requirePlayStoreAuth(packageName, requiredScope) {
|
|
|
110
146
|
// 재로그인 안내 대신 googleapis 의 raw invalid_grant 가 그대로 노출된다.
|
|
111
147
|
const result = await ensureFreshAccessToken();
|
|
112
148
|
if (result.status === 'unauthenticated')
|
|
113
|
-
throw new Error(
|
|
149
|
+
throw new Error(playAuthHint());
|
|
114
150
|
if (result.status === 'expired_refresh_failed')
|
|
115
151
|
throw new Error(formatAuthError(result.error));
|
|
116
152
|
const oauth = getAuthenticatedClient();
|
|
117
153
|
if (!oauth)
|
|
118
|
-
throw new Error(
|
|
154
|
+
throw new Error(playAuthHint());
|
|
119
155
|
// OAuth 폴백일 때만 스코프 pre-flight — SA JWT 는 자체 scopes 로 토큰을 받으므로
|
|
120
156
|
// (getServiceAccountClient 가 reporting 스코프를 이미 싣는다) 해당 없음.
|
|
121
|
-
assertStoredScope(requiredScope, result.tokens.scope);
|
|
157
|
+
assertStoredScope(requiredScope ? [requiredScope] : [], result.tokens.scope);
|
|
122
158
|
return oauth;
|
|
123
159
|
}
|
|
124
160
|
export function requireServiceAccountJson(packageName) {
|
|
125
161
|
const json = getServiceAccountJson(packageName);
|
|
126
162
|
if (!json)
|
|
127
|
-
throw new Error(
|
|
163
|
+
throw new Error(playAuthHint());
|
|
128
164
|
return json;
|
|
129
165
|
}
|
|
130
166
|
export function requireAppStoreCreds() {
|
|
131
167
|
const creds = getAppStoreCredentials();
|
|
132
|
-
if (!creds)
|
|
133
|
-
|
|
168
|
+
if (!creds) {
|
|
169
|
+
assertCredentialFileReadable(appStoreCredentialsPath(), 'npx -y @yoonion/mimi-seed-mcp mimi-seed-appstore-auth');
|
|
170
|
+
throw new Error(appStoreAuthHint());
|
|
171
|
+
}
|
|
134
172
|
return creds;
|
|
135
173
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tool-manifest.json 도메인 메타데이터(label · credential · summary)의 영어 — 키는 한국어 원문.
|
|
3
|
+
* `mimi-seed://tools/catalog` 리소스가 영어 모드일 때 쓴다 (resources.ts). manifest 가 원본(SSOT)이라 거기는 그대로 두고
|
|
4
|
+
* 여기서만 옮긴다. 원문을 고치면 output-i18n.test.ts 가 "번역 없음"으로 실패한다.
|
|
5
|
+
*/
|
|
6
|
+
export declare const MANIFEST_TEXT_EN: Readonly<Record<string, string>>;
|