@gpc-cli/core 0.9.51 → 0.9.52

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/index.d.ts CHANGED
@@ -1323,9 +1323,47 @@ declare function renderJson(g: GeneratedChangelog): string;
1323
1323
 
1324
1324
  declare function renderPrompt(g: GeneratedChangelog): string;
1325
1325
 
1326
+ declare const PLAY_STORE_LIMIT = 500;
1327
+ declare const PLACEHOLDER_TEXT = "[needs translation \u2014 pass --ai once v0.9.63 ships, or paste the prompt emitted by --format prompt]";
1328
+ type PlayStoreFormat = "md" | "json" | "prompt";
1329
+ interface LocaleEntry {
1330
+ language: string;
1331
+ text: string;
1332
+ chars: number;
1333
+ limit: number;
1334
+ status: "ok" | "over" | "placeholder" | "empty";
1335
+ }
1336
+ interface LocaleBundle {
1337
+ from: string;
1338
+ to: string;
1339
+ limit: number;
1340
+ sourceLanguage: string;
1341
+ locales: LocaleEntry[];
1342
+ overflows: string[];
1343
+ }
1344
+ interface PlayStoreRenderOptions {
1345
+ locales: string[];
1346
+ format: PlayStoreFormat;
1347
+ sourceLanguage?: string;
1348
+ }
1349
+ declare function buildLocaleBundle(g: GeneratedChangelog, opts: PlayStoreRenderOptions): LocaleBundle;
1350
+ declare function renderPlayStoreMd(bundle: LocaleBundle): string;
1351
+ declare function renderPlayStoreJson(bundle: LocaleBundle): string;
1352
+ declare function renderPlayStorePrompt(bundle: LocaleBundle, g: GeneratedChangelog): string;
1353
+ declare function renderPlayStore(g: GeneratedChangelog, opts: PlayStoreRenderOptions): {
1354
+ output: string;
1355
+ bundle: LocaleBundle;
1356
+ };
1357
+
1326
1358
  type Renderer = (g: GeneratedChangelog) => string;
1327
1359
  declare const RENDERERS: Record<OutputMode, Renderer>;
1328
1360
 
1361
+ interface ResolveLocalesOptions {
1362
+ client?: PlayApiClient;
1363
+ packageName?: string;
1364
+ }
1365
+ declare function resolveLocales(input: string, options?: ResolveLocalesOptions): Promise<string[]>;
1366
+
1329
1367
  interface RtdnStatus {
1330
1368
  topicName: string | null;
1331
1369
  enabled: boolean;
@@ -1371,4 +1409,4 @@ declare function decodeNotification(base64Payload: string): DecodedNotification;
1371
1409
  */
1372
1410
  declare function formatNotification(notification: DecodedNotification): Record<string, unknown>;
1373
1411
 
1374
- export { ApiError, type AppInfo, type AppStatus, type AuditEntry, type BatchSyncResult, type BundleAnalysis, type BundleComparison, type BundleEntry, type BundleSizeCheckResult, type BundleSizeConfig, type ChangelogEntry, type CommandContext, type CommitCluster, ConfigError, type CreateEnterpriseAppParams, DEFAULT_LIMITS, DEFAULT_PREFLIGHT_CONFIG, type DecodedNotification, type DiffToken, type DiscoverPluginsOptions, type DryRunPublishResult, type DryRunResult, type DryRunUploadResult, type ExportImagesOptions, type ExportImagesSummary, type FastlaneDetection, type FastlaneLane, type FetchChangelogOptions, type FieldLintResult, type FileValidationResult, type FindingSeverity, GOOGLE_PLAY_LANGUAGES, type GenerateOptions, type GeneratedChangelog, type GetAppStatusOptions, type GitNotesOptions, type GitReleaseNotes, type GitRunner, GpcError, type ImageValidationResult, type InitOptions, type InitResult, type InternalSharingUploadResult, type ListIapOptions, type ListSubscriptionsOptions, type ListUsersOptions, type ListVoidedOptions, type ListingDiff, type ListingFieldLimits, type ListingLintResult, type ListingsResult, type LoadedPlugin, type MigrationResult, NetworkError, type OneTimeProductDiff, type OutputMode, PERMISSION_PROPAGATION_WARNING, type ParsedCommit, type ParsedManifest, type ParsedMonth, PluginManager, type PreflightConfig, type PreflightFinding, type PreflightOptions, type PreflightResult, type PreflightScanner, type PublishOptions, type PublishResult, type PushResult, type QuotaUsage, RENDERERS, type RawCommit, type ReleaseDiff, type ReleaseNotesValidation, type ReleaseStatusResult, type Renderer, type ReviewAnalysis, type ReviewExportOptions, type ReviewsFilterOptions, type RtdnStatus, SECTION_ORDER, SENSITIVE_ARG_KEYS, SENSITIVE_KEYS, SEVERITY_ORDER, type ScaffoldOptions, type ScaffoldResult, type Spinner, type StatusDiff, type StatusRelease, type StatusReviews, type StatusVitalMetric, type SubscriptionAnalytics, type SubscriptionDiff, type SyncResult, type ThresholdResult, type TrainConfig, type TrainState, type UploadResult, type ValidateCheck, type ValidateOptions, type ValidateResult, type VersionVitalsComparison, type VersionVitalsRow, type VitalsOverview, type VitalsQueryOptions, type VitalsTrendComparison, type WatchOptions, type WatchVitalsOptions, type WebhookPayload, abortTrain, acknowledgeProductPurchase, activateBasePlan, activateOffer, addRecoveryTargeting, addTesters, advanceTrain, analyzeBundle, analyzeRemoteListings, analyzeReviews, batchGetOrders, batchSyncInAppProducts, cancelRecoveryAction, cancelSubscriptionPurchase, cancelSubscriptionV2, checkBundleSize, checkThreshold, clearAuditLog, compareBundles, compareVersionVitals, compareVitalsTrend, computeStatusDiff, consumeProductPurchase, convertRegionPrices, createAuditEntry, createDeviceTier, createEnterpriseApp, createExternalTransaction, createGrant, createInAppProduct, createOffer, createOneTimeOffer, createOneTimeProduct, createRecoveryAction, createSpinner, createSubscription, createTrack, deactivateBasePlan, deactivateOffer, decodeNotification, defaultGitRunner, deferSubscriptionPurchase, deferSubscriptionV2, deleteBasePlan, deleteGrant, deleteImage, deleteInAppProduct, deleteListing, deleteOffer, deleteOneTimeOffer, deleteOneTimeProduct, deleteSubscription, deployRecoveryAction, detectFastlane, detectOutputFormat, diffListings, diffListingsCommand, diffListingsEnhanced, diffOneTimeProduct, diffReleases, diffSubscription, discoverPlugins, downloadGeneratedApk, downloadReport, exportImages, exportReviews, fetchChangelog, fetchReleaseNotes, formatChangelogEntry, formatCustomPayload, formatDiscordPayload, formatJunit, formatNotification, formatOutput, formatSlackPayload, formatStatusDiff, formatStatusSummary, formatStatusTable, formatWordDiff, generateChangelog, generateMigrationPlan, generateNotesFromGit, getAllScannerNames, getAppInfo, getAppStatus, getCountryAvailability, getDeviceTier, getExternalTransaction, getInAppProduct, getListings, getOffer, getOneTimeOffer, getOneTimeProduct, getOrderDetails, getProductPurchase, getProductPurchaseV2, getQuotaUsage, getReleasesStatus, getReview, getRtdnStatus, getSubscription, getSubscriptionAnalytics, getSubscriptionPurchase, getTrainStatus, getUser, getVitalsAnomalies, getVitalsAnr, getVitalsBattery, getVitalsCrashes, getVitalsErrorCount, getVitalsLmk, getVitalsMemory, getVitalsOverview, getVitalsRendering, getVitalsStartup, importDataSafety, importTestersFromCsv, initAudit, initProject, inviteUser, isFinancialReportType, isStatsReportType, isValidBcp47, isValidReportType, isValidStatsDimension, lintListing, lintListings, lintLocalListings, listAchievements, listAuditEvents, listDeviceTiers, listEvents, listGeneratedApks, listGrants, listImages, listInAppProducts, listLeaderboards, listOffers, listOneTimeOffers, listOneTimeProducts, listRecoveryActions, listReports, listReviews, listSubscriptions, listTesters, listTracks, listUsers, listVoidedPurchases, loadPreflightConfig, loadStatusCache, maybePaginate, migratePrices, parseAppfile, parseCommit, parseFastfile, parseGrantArg, parseMonth, parseRemoteUrl, pauseTrain, promoteRelease, publish, publishEnterpriseApp, pullListings, pushListings, readListingsFromDir, readReleaseNotesFromDir, redactAuditArgs, redactSensitive, refundExternalTransaction, refundOrder, relativeTime, removeTesters, removeUser, renderJson, renderMarkdown, renderPrompt, replyToReview, revokeSubscriptionPurchase, runPreflight, runWatchLoop, safePath, safePathWithin, saveStatusCache, scaffoldPlugin, searchAuditEvents, searchVitalsErrors, sendNotification, sendWebhook, sortResults, startTrain, statusHasBreach, syncInAppProducts, topFiles, trackBreachState, updateAppDetails, updateDataSafety, updateGrant, updateInAppProduct, updateListing, updateOffer, updateOneTimeOffer, updateOneTimeProduct, updateRollout, updateSubscription, updateTrackConfig, updateUser, uploadExternallyHosted, uploadImage, uploadInternalSharing, uploadRelease, validateImage, validateLanguageCode, validatePackageName, validatePreSubmission, validateReleaseNotes, validateSku, validateTrackName, validateUploadFile, validateVersionCode, watchVitalsWithAutoHalt, wordDiff, writeAuditLog, writeListingsToDir, writeMigrationOutput };
1412
+ export { ApiError, type AppInfo, type AppStatus, type AuditEntry, type BatchSyncResult, type BundleAnalysis, type BundleComparison, type BundleEntry, type BundleSizeCheckResult, type BundleSizeConfig, type ChangelogEntry, type CommandContext, type CommitCluster, ConfigError, type CreateEnterpriseAppParams, DEFAULT_LIMITS, DEFAULT_PREFLIGHT_CONFIG, type DecodedNotification, type DiffToken, type DiscoverPluginsOptions, type DryRunPublishResult, type DryRunResult, type DryRunUploadResult, type ExportImagesOptions, type ExportImagesSummary, type FastlaneDetection, type FastlaneLane, type FetchChangelogOptions, type FieldLintResult, type FileValidationResult, type FindingSeverity, GOOGLE_PLAY_LANGUAGES, type GenerateOptions, type GeneratedChangelog, type GetAppStatusOptions, type GitNotesOptions, type GitReleaseNotes, type GitRunner, GpcError, type ImageValidationResult, type InitOptions, type InitResult, type InternalSharingUploadResult, type ListIapOptions, type ListSubscriptionsOptions, type ListUsersOptions, type ListVoidedOptions, type ListingDiff, type ListingFieldLimits, type ListingLintResult, type ListingsResult, type LoadedPlugin, type LocaleBundle, type LocaleEntry, type MigrationResult, NetworkError, type OneTimeProductDiff, type OutputMode, PERMISSION_PROPAGATION_WARNING, PLACEHOLDER_TEXT, PLAY_STORE_LIMIT, type ParsedCommit, type ParsedManifest, type ParsedMonth, type PlayStoreFormat, type PlayStoreRenderOptions, PluginManager, type PreflightConfig, type PreflightFinding, type PreflightOptions, type PreflightResult, type PreflightScanner, type PublishOptions, type PublishResult, type PushResult, type QuotaUsage, RENDERERS, type RawCommit, type ReleaseDiff, type ReleaseNotesValidation, type ReleaseStatusResult, type Renderer, type ResolveLocalesOptions, type ReviewAnalysis, type ReviewExportOptions, type ReviewsFilterOptions, type RtdnStatus, SECTION_ORDER, SENSITIVE_ARG_KEYS, SENSITIVE_KEYS, SEVERITY_ORDER, type ScaffoldOptions, type ScaffoldResult, type Spinner, type StatusDiff, type StatusRelease, type StatusReviews, type StatusVitalMetric, type SubscriptionAnalytics, type SubscriptionDiff, type SyncResult, type ThresholdResult, type TrainConfig, type TrainState, type UploadResult, type ValidateCheck, type ValidateOptions, type ValidateResult, type VersionVitalsComparison, type VersionVitalsRow, type VitalsOverview, type VitalsQueryOptions, type VitalsTrendComparison, type WatchOptions, type WatchVitalsOptions, type WebhookPayload, abortTrain, acknowledgeProductPurchase, activateBasePlan, activateOffer, addRecoveryTargeting, addTesters, advanceTrain, analyzeBundle, analyzeRemoteListings, analyzeReviews, batchGetOrders, batchSyncInAppProducts, buildLocaleBundle, cancelRecoveryAction, cancelSubscriptionPurchase, cancelSubscriptionV2, checkBundleSize, checkThreshold, clearAuditLog, compareBundles, compareVersionVitals, compareVitalsTrend, computeStatusDiff, consumeProductPurchase, convertRegionPrices, createAuditEntry, createDeviceTier, createEnterpriseApp, createExternalTransaction, createGrant, createInAppProduct, createOffer, createOneTimeOffer, createOneTimeProduct, createRecoveryAction, createSpinner, createSubscription, createTrack, deactivateBasePlan, deactivateOffer, decodeNotification, defaultGitRunner, deferSubscriptionPurchase, deferSubscriptionV2, deleteBasePlan, deleteGrant, deleteImage, deleteInAppProduct, deleteListing, deleteOffer, deleteOneTimeOffer, deleteOneTimeProduct, deleteSubscription, deployRecoveryAction, detectFastlane, detectOutputFormat, diffListings, diffListingsCommand, diffListingsEnhanced, diffOneTimeProduct, diffReleases, diffSubscription, discoverPlugins, downloadGeneratedApk, downloadReport, exportImages, exportReviews, fetchChangelog, fetchReleaseNotes, formatChangelogEntry, formatCustomPayload, formatDiscordPayload, formatJunit, formatNotification, formatOutput, formatSlackPayload, formatStatusDiff, formatStatusSummary, formatStatusTable, formatWordDiff, generateChangelog, generateMigrationPlan, generateNotesFromGit, getAllScannerNames, getAppInfo, getAppStatus, getCountryAvailability, getDeviceTier, getExternalTransaction, getInAppProduct, getListings, getOffer, getOneTimeOffer, getOneTimeProduct, getOrderDetails, getProductPurchase, getProductPurchaseV2, getQuotaUsage, getReleasesStatus, getReview, getRtdnStatus, getSubscription, getSubscriptionAnalytics, getSubscriptionPurchase, getTrainStatus, getUser, getVitalsAnomalies, getVitalsAnr, getVitalsBattery, getVitalsCrashes, getVitalsErrorCount, getVitalsLmk, getVitalsMemory, getVitalsOverview, getVitalsRendering, getVitalsStartup, importDataSafety, importTestersFromCsv, initAudit, initProject, inviteUser, isFinancialReportType, isStatsReportType, isValidBcp47, isValidReportType, isValidStatsDimension, lintListing, lintListings, lintLocalListings, listAchievements, listAuditEvents, listDeviceTiers, listEvents, listGeneratedApks, listGrants, listImages, listInAppProducts, listLeaderboards, listOffers, listOneTimeOffers, listOneTimeProducts, listRecoveryActions, listReports, listReviews, listSubscriptions, listTesters, listTracks, listUsers, listVoidedPurchases, loadPreflightConfig, loadStatusCache, maybePaginate, migratePrices, parseAppfile, parseCommit, parseFastfile, parseGrantArg, parseMonth, parseRemoteUrl, pauseTrain, promoteRelease, publish, publishEnterpriseApp, pullListings, pushListings, readListingsFromDir, readReleaseNotesFromDir, redactAuditArgs, redactSensitive, refundExternalTransaction, refundOrder, relativeTime, removeTesters, removeUser, renderJson, renderMarkdown, renderPlayStore, renderPlayStoreJson, renderPlayStoreMd, renderPlayStorePrompt, renderPrompt, replyToReview, resolveLocales, revokeSubscriptionPurchase, runPreflight, runWatchLoop, safePath, safePathWithin, saveStatusCache, scaffoldPlugin, searchAuditEvents, searchVitalsErrors, sendNotification, sendWebhook, sortResults, startTrain, statusHasBreach, syncInAppProducts, topFiles, trackBreachState, updateAppDetails, updateDataSafety, updateGrant, updateInAppProduct, updateListing, updateOffer, updateOneTimeOffer, updateOneTimeProduct, updateRollout, updateSubscription, updateTrackConfig, updateUser, uploadExternallyHosted, uploadImage, uploadInternalSharing, uploadRelease, validateImage, validateLanguageCode, validatePackageName, validatePreSubmission, validateReleaseNotes, validateSku, validateTrackName, validateUploadFile, validateVersionCode, watchVitalsWithAutoHalt, wordDiff, writeAuditLog, writeListingsToDir, writeMigrationOutput };
package/dist/index.js CHANGED
@@ -7881,6 +7881,164 @@ function renderPrompt(g) {
7881
7881
  return lines.join("\n");
7882
7882
  }
7883
7883
 
7884
+ // src/commands/changelog-renderers/play-store.ts
7885
+ var PLAY_STORE_LIMIT = 500;
7886
+ var PLACEHOLDER_TEXT = "[needs translation \u2014 pass --ai once v0.9.63 ships, or paste the prompt emitted by --format prompt]";
7887
+ function safeLine2(s) {
7888
+ return s.replace(/[\r\n]+/g, " ").trim();
7889
+ }
7890
+ function countChars(s) {
7891
+ return [...s].length;
7892
+ }
7893
+ function truncateToLimit(text, limit) {
7894
+ if (countChars(text) <= limit) return text;
7895
+ const chars = [...text];
7896
+ return chars.slice(0, limit - 1).join("") + "\u2026";
7897
+ }
7898
+ function renderEnglishBullets(g) {
7899
+ const lines = [];
7900
+ for (const type of SECTION_ORDER) {
7901
+ const commits = g.grouped[type] ?? [];
7902
+ for (const commit of commits) {
7903
+ lines.push(`- ${type}: ${safeLine2(commit.subject)}`);
7904
+ }
7905
+ }
7906
+ return lines.join("\n");
7907
+ }
7908
+ function buildLocaleBundle(g, opts) {
7909
+ const sourceLanguage = opts.sourceLanguage ?? "en-US";
7910
+ const sourceText = renderEnglishBullets(g);
7911
+ const isEmpty = sourceText.length === 0;
7912
+ const overflows = [];
7913
+ const entries = opts.locales.map((language) => {
7914
+ if (language === sourceLanguage) {
7915
+ if (isEmpty) {
7916
+ const emptyText = "No notable changes.";
7917
+ return {
7918
+ language,
7919
+ text: emptyText,
7920
+ chars: countChars(emptyText),
7921
+ limit: PLAY_STORE_LIMIT,
7922
+ status: "empty"
7923
+ };
7924
+ }
7925
+ const chars = countChars(sourceText);
7926
+ const status = chars > PLAY_STORE_LIMIT ? "over" : "ok";
7927
+ if (status === "over") overflows.push(language);
7928
+ const text = status === "over" ? truncateToLimit(sourceText, PLAY_STORE_LIMIT) : sourceText;
7929
+ return {
7930
+ language,
7931
+ text,
7932
+ chars,
7933
+ limit: PLAY_STORE_LIMIT,
7934
+ status
7935
+ };
7936
+ }
7937
+ return {
7938
+ language,
7939
+ text: PLACEHOLDER_TEXT,
7940
+ chars: countChars(PLACEHOLDER_TEXT),
7941
+ limit: PLAY_STORE_LIMIT,
7942
+ status: "placeholder"
7943
+ };
7944
+ });
7945
+ return {
7946
+ from: g.from,
7947
+ to: g.to,
7948
+ limit: PLAY_STORE_LIMIT,
7949
+ sourceLanguage,
7950
+ locales: entries,
7951
+ overflows
7952
+ };
7953
+ }
7954
+ function renderPlayStoreMd(bundle) {
7955
+ const lines = [];
7956
+ lines.push(`# Play Store release notes (${bundle.from} \u2192 ${bundle.to})`);
7957
+ lines.push("");
7958
+ for (const entry of bundle.locales) {
7959
+ let heading;
7960
+ if (entry.status === "placeholder") {
7961
+ heading = `## ${entry.language} (needs translation)`;
7962
+ } else if (entry.status === "empty") {
7963
+ heading = `## ${entry.language} (empty)`;
7964
+ } else {
7965
+ const suffix = entry.status === "over" ? ` \u26A0 truncated` : "";
7966
+ heading = `## ${entry.language} (${entry.chars}/${entry.limit})${suffix}`;
7967
+ }
7968
+ lines.push(heading);
7969
+ lines.push(entry.text);
7970
+ lines.push("");
7971
+ }
7972
+ lines.push("## Summary");
7973
+ for (const entry of bundle.locales) {
7974
+ if (entry.status === "placeholder") {
7975
+ lines.push(`- ${entry.language}: placeholder`);
7976
+ } else if (entry.status === "empty") {
7977
+ lines.push(`- ${entry.language}: empty`);
7978
+ } else {
7979
+ const mark = entry.status === "over" ? "\u2717 over limit" : "\u2713";
7980
+ lines.push(`- ${entry.language}: ${entry.chars}/${entry.limit} ${mark}`);
7981
+ }
7982
+ }
7983
+ return lines.join("\n");
7984
+ }
7985
+ function renderPlayStoreJson(bundle) {
7986
+ return JSON.stringify(bundle, null, 2);
7987
+ }
7988
+ function renderPlayStorePrompt(bundle, g) {
7989
+ const source = bundle.locales.find((e) => e.language === bundle.sourceLanguage);
7990
+ const targets = bundle.locales.filter((e) => e.language !== bundle.sourceLanguage);
7991
+ const lines = [];
7992
+ lines.push(`You are translating Play Store "What's new" release notes from ${bundle.sourceLanguage}.`);
7993
+ lines.push("");
7994
+ lines.push("TARGETS:");
7995
+ for (const t of targets) lines.push(` - ${t.language}`);
7996
+ if (targets.length === 0) lines.push(" (none \u2014 source-only bundle)");
7997
+ lines.push("");
7998
+ lines.push("CONSTRAINTS:");
7999
+ lines.push(`- Each translation MUST be \u2264 ${bundle.limit} Unicode code points`);
8000
+ lines.push('- Preserve the bullet format (one item per line, starts with "- ")');
8001
+ lines.push("- Keep a user-facing tone (no internal jargon)");
8002
+ lines.push('- Do not translate technical names (package names, CLI flags, "GPC")');
8003
+ lines.push("- Drop the conventional-commit prefix (feat:/fix:) if it feels unnatural in the target language");
8004
+ lines.push("");
8005
+ lines.push(`SOURCE (${bundle.sourceLanguage}, ${source?.chars ?? 0}/${bundle.limit} chars):`);
8006
+ lines.push("```");
8007
+ lines.push(source?.text ?? "(empty)");
8008
+ lines.push("```");
8009
+ lines.push("");
8010
+ if (g.headlineCandidates.length > 0) {
8011
+ lines.push("CONTEXT (clusters, for theme awareness):");
8012
+ for (const c of g.headlineCandidates) {
8013
+ lines.push(` - ${c.label} (${c.commits.length} commits, primary ${c.primaryType})`);
8014
+ }
8015
+ lines.push("");
8016
+ }
8017
+ lines.push("OUTPUT FORMAT (one heading + body per target language):");
8018
+ lines.push("```markdown");
8019
+ for (const t of targets) {
8020
+ lines.push(`## ${t.language}`);
8021
+ lines.push("<translation>");
8022
+ lines.push("");
8023
+ }
8024
+ if (targets.length === 0) {
8025
+ lines.push("(no target locales \u2014 nothing to translate)");
8026
+ }
8027
+ lines.push("```");
8028
+ return lines.join("\n");
8029
+ }
8030
+ function renderPlayStore(g, opts) {
8031
+ const bundle = buildLocaleBundle(g, opts);
8032
+ switch (opts.format) {
8033
+ case "md":
8034
+ return { output: renderPlayStoreMd(bundle), bundle };
8035
+ case "json":
8036
+ return { output: renderPlayStoreJson(bundle), bundle };
8037
+ case "prompt":
8038
+ return { output: renderPlayStorePrompt(bundle, g), bundle };
8039
+ }
8040
+ }
8041
+
7884
8042
  // src/commands/changelog-renderers/index.ts
7885
8043
  var RENDERERS = {
7886
8044
  md: renderMarkdown,
@@ -7888,6 +8046,68 @@ var RENDERERS = {
7888
8046
  prompt: renderPrompt
7889
8047
  };
7890
8048
 
8049
+ // src/commands/changelog-locales.ts
8050
+ async function resolveLocales(input, options = {}) {
8051
+ const trimmed = input.trim();
8052
+ if (!trimmed) {
8053
+ throw new GpcError(
8054
+ "--locales is empty",
8055
+ "CHANGELOG_LOCALES_REQUIRED",
8056
+ 2,
8057
+ "Pass a comma-separated list (e.g., --locales en-US,fr-FR) or --locales auto."
8058
+ );
8059
+ }
8060
+ if (trimmed === "auto") {
8061
+ const { client, packageName } = options;
8062
+ if (!client || !packageName) {
8063
+ throw new GpcError(
8064
+ "--locales auto requires an authenticated API client and --app",
8065
+ "CHANGELOG_LOCALES_AUTO_NO_APP",
8066
+ 2,
8067
+ "Pass --app <package> or set config.app, and ensure credentials are configured."
8068
+ );
8069
+ }
8070
+ const edit = await client.edits.insert(packageName);
8071
+ try {
8072
+ const listings = await client.listings.list(packageName, edit.id);
8073
+ await client.edits.delete(packageName, edit.id);
8074
+ const langs = listings.map((l) => l.language);
8075
+ if (langs.length === 0) {
8076
+ throw new GpcError(
8077
+ `No Play Store listings found for ${packageName}`,
8078
+ "CHANGELOG_LOCALES_EMPTY",
8079
+ 1,
8080
+ "Create at least one listing in Play Console, or pass --locales explicitly."
8081
+ );
8082
+ }
8083
+ return langs;
8084
+ } catch (error) {
8085
+ await client.edits.delete(packageName, edit.id).catch(() => {
8086
+ });
8087
+ throw error;
8088
+ }
8089
+ }
8090
+ const locales = trimmed.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
8091
+ if (locales.length === 0) {
8092
+ throw new GpcError(
8093
+ "--locales parsed to an empty list",
8094
+ "CHANGELOG_LOCALES_REQUIRED",
8095
+ 2,
8096
+ "Pass a comma-separated list (e.g., --locales en-US,fr-FR) or --locales auto."
8097
+ );
8098
+ }
8099
+ const invalid = locales.filter((l) => !isValidBcp47(l));
8100
+ if (invalid.length > 0) {
8101
+ throw new GpcError(
8102
+ `Invalid locale(s): ${invalid.join(", ")}`,
8103
+ "CHANGELOG_LOCALES_INVALID",
8104
+ 2,
8105
+ "Use BCP 47 codes recognized by Google Play (e.g., en-US, fr-FR, de-DE)."
8106
+ );
8107
+ }
8108
+ return locales;
8109
+ }
8110
+
7891
8111
  // src/commands/rtdn.ts
7892
8112
  var SUBSCRIPTION_NOTIFICATION_TYPES = {
7893
8113
  1: "SUBSCRIPTION_RECOVERED",
@@ -7989,6 +8209,8 @@ export {
7989
8209
  GpcError,
7990
8210
  NetworkError,
7991
8211
  PERMISSION_PROPAGATION_WARNING,
8212
+ PLACEHOLDER_TEXT,
8213
+ PLAY_STORE_LIMIT,
7992
8214
  PluginManager,
7993
8215
  RENDERERS,
7994
8216
  SECTION_ORDER,
@@ -8007,6 +8229,7 @@ export {
8007
8229
  analyzeReviews2 as analyzeReviews,
8008
8230
  batchGetOrders,
8009
8231
  batchSyncInAppProducts,
8232
+ buildLocaleBundle,
8010
8233
  cancelRecoveryAction,
8011
8234
  cancelSubscriptionPurchase,
8012
8235
  cancelSubscriptionV2,
@@ -8170,8 +8393,13 @@ export {
8170
8393
  removeUser,
8171
8394
  renderJson,
8172
8395
  renderMarkdown,
8396
+ renderPlayStore,
8397
+ renderPlayStoreJson,
8398
+ renderPlayStoreMd,
8399
+ renderPlayStorePrompt,
8173
8400
  renderPrompt,
8174
8401
  replyToReview,
8402
+ resolveLocales,
8175
8403
  revokeSubscriptionPurchase,
8176
8404
  runPreflight,
8177
8405
  runWatchLoop,