@gpc-cli/core 0.9.6 → 0.9.7

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
@@ -1,7 +1,7 @@
1
- import { OutputFormat, ResolvedConfig } from '@gpc-cli/config';
1
+ import { OutputFormat, ResolvedConfig, WebhookConfig } from '@gpc-cli/config';
2
2
  import { AuthClient } from '@gpc-cli/auth';
3
3
  import { GpcPlugin, PluginManifest, CommandEvent, CommandResult, PluginError, RequestEvent, ResponseEvent, PluginCommand } from '@gpc-cli/plugin-sdk';
4
- import { PlayApiClient, Track, Listing, ImageType, CountryAvailability, Image, AppDetails, Review, ReviewReplyResponse, Subscription, SubscriptionOffer, OffersListResponse, BasePlanMigratePricesRequest, InAppProduct, SubscriptionDeferResponse, ProductPurchase, SubscriptionPurchaseV2, VoidedPurchase, UsersApiClient, User, DeveloperPermission, Grant, MetricRow, ReportingDimension, ReportingAggregation, ReportingApiClient, VitalsMetricSet, AnomalyDetectionResponse, MetricSetResponse, ErrorIssuesResponse, ConvertRegionPricesResponse, ReportType, StatsDimension, ReportBucket, Testers } from '@gpc-cli/api';
4
+ import { PlayApiClient, Track, Listing, ImageType, CountryAvailability, Image, AppDetails, Review, ReviewReplyResponse, Subscription, SubscriptionOffer, OffersListResponse, BasePlanMigratePricesRequest, InAppProduct, SubscriptionDeferResponse, ProductPurchase, SubscriptionPurchaseV2, VoidedPurchase, UsersApiClient, User, DeveloperPermission, Grant, MetricRow, ReportingDimension, ReportingAggregation, ReportingApiClient, VitalsMetricSet, AnomalyDetectionResponse, MetricSetResponse, ErrorIssuesResponse, ConvertRegionPricesResponse, ReportType, StatsDimension, ReportBucket, Testers, AppRecoveryAction, DataSafety, ExternalTransaction, ExternalTransactionRefund } from '@gpc-cli/api';
5
5
 
6
6
  declare class GpcError extends Error {
7
7
  readonly code: string;
@@ -185,6 +185,7 @@ declare function pushListings(client: PlayApiClient, packageName: string, dir: s
185
185
  declare function listImages(client: PlayApiClient, packageName: string, language: string, imageType: ImageType): Promise<Image[]>;
186
186
  declare function uploadImage(client: PlayApiClient, packageName: string, language: string, imageType: ImageType, filePath: string): Promise<Image>;
187
187
  declare function deleteImage(client: PlayApiClient, packageName: string, language: string, imageType: ImageType, imageId: string): Promise<void>;
188
+ declare function diffListingsCommand(client: PlayApiClient, packageName: string, dir: string): Promise<ListingDiff[]>;
188
189
  declare function getCountryAvailability(client: PlayApiClient, packageName: string, track: string): Promise<CountryAvailability>;
189
190
  declare function updateAppDetails(client: PlayApiClient, packageName: string, details: Partial<AppDetails>): Promise<AppDetails>;
190
191
 
@@ -430,6 +431,32 @@ declare function importTestersFromCsv(client: PlayApiClient, packageName: string
430
431
  testers: Testers;
431
432
  }>;
432
433
 
434
+ interface GitNotesOptions {
435
+ since?: string;
436
+ language?: string;
437
+ maxLength?: number;
438
+ }
439
+ interface GitReleaseNotes {
440
+ language: string;
441
+ text: string;
442
+ commitCount: number;
443
+ since: string;
444
+ }
445
+ declare function generateNotesFromGit(options?: GitNotesOptions): Promise<GitReleaseNotes>;
446
+
447
+ declare function listRecoveryActions(client: PlayApiClient, packageName: string): Promise<AppRecoveryAction[]>;
448
+ declare function cancelRecoveryAction(client: PlayApiClient, packageName: string, recoveryId: string): Promise<void>;
449
+ declare function deployRecoveryAction(client: PlayApiClient, packageName: string, recoveryId: string): Promise<void>;
450
+
451
+ declare function getDataSafety(client: PlayApiClient, packageName: string): Promise<DataSafety>;
452
+ declare function updateDataSafety(client: PlayApiClient, packageName: string, data: DataSafety): Promise<DataSafety>;
453
+ declare function exportDataSafety(client: PlayApiClient, packageName: string, outputPath: string): Promise<DataSafety>;
454
+ declare function importDataSafety(client: PlayApiClient, packageName: string, filePath: string): Promise<DataSafety>;
455
+
456
+ declare function createExternalTransaction(client: PlayApiClient, packageName: string, data: ExternalTransaction): Promise<ExternalTransaction>;
457
+ declare function getExternalTransaction(client: PlayApiClient, packageName: string, transactionId: string): Promise<ExternalTransaction>;
458
+ declare function refundExternalTransaction(client: PlayApiClient, packageName: string, transactionId: string, refundData: ExternalTransactionRefund): Promise<ExternalTransaction>;
459
+
433
460
  /**
434
461
  * Normalize and resolve a user-supplied path.
435
462
  * Prevents path traversal by normalizing `.` and `..` components.
@@ -441,6 +468,23 @@ declare function safePath(userPath: string): string;
441
468
  */
442
469
  declare function safePathWithin(userPath: string, baseDir: string): string;
443
470
 
471
+ /**
472
+ * Sort utility for CLI list command results.
473
+ *
474
+ * Supports ascending (field) and descending (-field) sort specs,
475
+ * including dot notation for nested fields (e.g., "comments.userComment.starRating").
476
+ */
477
+ /**
478
+ * Sort an array of items by a field specification.
479
+ *
480
+ * @param items - Array to sort (not mutated; returns a new array)
481
+ * @param sortSpec - Field name for ascending, or `-field` for descending.
482
+ * Supports dot notation for nested fields.
483
+ * If undefined/empty, returns items in original order.
484
+ * @returns Sorted copy of items
485
+ */
486
+ declare function sortResults<T>(items: T[], sortSpec?: string): T[];
487
+
444
488
  interface ScaffoldOptions {
445
489
  name: string;
446
490
  dir: string;
@@ -479,4 +523,17 @@ declare function writeAuditLog(entry: AuditEntry): Promise<void>;
479
523
  */
480
524
  declare function createAuditEntry(command: string, args: Record<string, unknown>, app?: string): AuditEntry;
481
525
 
482
- export { ApiError, type AppInfo, type AuditEntry, type CommandContext, ConfigError, type DiscoverPluginsOptions, type DryRunPublishResult, type DryRunResult, type DryRunUploadResult, type FileValidationResult, GOOGLE_PLAY_LANGUAGES, GpcError, type ImageValidationResult, type ListIapOptions, type ListSubscriptionsOptions, type ListUsersOptions, type ListVoidedOptions, type ListingDiff, type ListingsResult, type LoadedPlugin, NetworkError, PERMISSION_PROPAGATION_WARNING, type ParsedMonth, PluginManager, type PublishOptions, type PublishResult, type PushResult, type ReleaseNotesValidation, type ReleaseStatusResult, type ReviewExportOptions, type ReviewsFilterOptions, type ScaffoldOptions, type ScaffoldResult, type SyncResult, type ThresholdResult, type UploadResult, type ValidateCheck, type ValidateOptions, type ValidateResult, type VitalsOverview, type VitalsQueryOptions, type VitalsTrendComparison, acknowledgeProductPurchase, activateBasePlan, activateOffer, addTesters, cancelSubscriptionPurchase, checkThreshold, compareVitalsTrend, consumeProductPurchase, convertRegionPrices, createAuditEntry, createInAppProduct, createOffer, createSubscription, deactivateBasePlan, deactivateOffer, deferSubscriptionPurchase, deleteBasePlan, deleteImage, deleteInAppProduct, deleteListing, deleteOffer, deleteSubscription, detectOutputFormat, diffListings, discoverPlugins, downloadReport, exportReviews, formatOutput, getAppInfo, getCountryAvailability, getInAppProduct, getListings, getOffer, getProductPurchase, getReleasesStatus, getReview, getSubscription, getSubscriptionPurchase, getUser, getVitalsAnomalies, getVitalsAnr, getVitalsBattery, getVitalsCrashes, getVitalsMemory, getVitalsOverview, getVitalsRendering, getVitalsStartup, importTestersFromCsv, initAudit, inviteUser, isFinancialReportType, isStatsReportType, isValidBcp47, isValidReportType, isValidStatsDimension, listImages, listInAppProducts, listOffers, listReports, listReviews, listSubscriptions, listTesters, listTracks, listUsers, listVoidedPurchases, migratePrices, parseGrantArg, parseMonth, promoteRelease, publish, pullListings, pushListings, readListingsFromDir, readReleaseNotesFromDir, redactSensitive, refundOrder, removeTesters, removeUser, replyToReview, revokeSubscriptionPurchase, safePath, safePathWithin, scaffoldPlugin, searchVitalsErrors, syncInAppProducts, updateAppDetails, updateInAppProduct, updateListing, updateOffer, updateRollout, updateSubscription, updateUser, uploadImage, uploadRelease, validateImage, validatePreSubmission, validateReleaseNotes, validateUploadFile, writeAuditLog, writeListingsToDir };
526
+ interface WebhookPayload {
527
+ command: string;
528
+ success: boolean;
529
+ duration: number;
530
+ app?: string;
531
+ details?: Record<string, unknown>;
532
+ error?: string;
533
+ }
534
+ declare function formatSlackPayload(payload: WebhookPayload): object;
535
+ declare function formatDiscordPayload(payload: WebhookPayload): object;
536
+ declare function formatCustomPayload(payload: WebhookPayload): object;
537
+ declare function sendWebhook(config: WebhookConfig, payload: WebhookPayload, target?: string): Promise<void>;
538
+
539
+ export { ApiError, type AppInfo, type AuditEntry, type CommandContext, ConfigError, type DiscoverPluginsOptions, type DryRunPublishResult, type DryRunResult, type DryRunUploadResult, type FileValidationResult, GOOGLE_PLAY_LANGUAGES, type GitNotesOptions, type GitReleaseNotes, GpcError, type ImageValidationResult, type ListIapOptions, type ListSubscriptionsOptions, type ListUsersOptions, type ListVoidedOptions, type ListingDiff, type ListingsResult, type LoadedPlugin, NetworkError, PERMISSION_PROPAGATION_WARNING, type ParsedMonth, PluginManager, type PublishOptions, type PublishResult, type PushResult, type ReleaseNotesValidation, type ReleaseStatusResult, type ReviewExportOptions, type ReviewsFilterOptions, type ScaffoldOptions, type ScaffoldResult, type SyncResult, type ThresholdResult, type UploadResult, type ValidateCheck, type ValidateOptions, type ValidateResult, type VitalsOverview, type VitalsQueryOptions, type VitalsTrendComparison, type WebhookPayload, acknowledgeProductPurchase, activateBasePlan, activateOffer, addTesters, cancelRecoveryAction, cancelSubscriptionPurchase, checkThreshold, compareVitalsTrend, consumeProductPurchase, convertRegionPrices, createAuditEntry, createExternalTransaction, createInAppProduct, createOffer, createSubscription, deactivateBasePlan, deactivateOffer, deferSubscriptionPurchase, deleteBasePlan, deleteImage, deleteInAppProduct, deleteListing, deleteOffer, deleteSubscription, deployRecoveryAction, detectOutputFormat, diffListings, diffListingsCommand, discoverPlugins, downloadReport, exportDataSafety, exportReviews, formatCustomPayload, formatDiscordPayload, formatOutput, formatSlackPayload, generateNotesFromGit, getAppInfo, getCountryAvailability, getDataSafety, getExternalTransaction, getInAppProduct, getListings, getOffer, getProductPurchase, getReleasesStatus, getReview, getSubscription, getSubscriptionPurchase, getUser, getVitalsAnomalies, getVitalsAnr, getVitalsBattery, getVitalsCrashes, getVitalsMemory, getVitalsOverview, getVitalsRendering, getVitalsStartup, importDataSafety, importTestersFromCsv, initAudit, inviteUser, isFinancialReportType, isStatsReportType, isValidBcp47, isValidReportType, isValidStatsDimension, listImages, listInAppProducts, listOffers, listRecoveryActions, listReports, listReviews, listSubscriptions, listTesters, listTracks, listUsers, listVoidedPurchases, migratePrices, parseGrantArg, parseMonth, promoteRelease, publish, pullListings, pushListings, readListingsFromDir, readReleaseNotesFromDir, redactSensitive, refundExternalTransaction, refundOrder, removeTesters, removeUser, replyToReview, revokeSubscriptionPurchase, safePath, safePathWithin, scaffoldPlugin, searchVitalsErrors, sendWebhook, sortResults, syncInAppProducts, updateAppDetails, updateDataSafety, updateInAppProduct, updateListing, updateOffer, updateRollout, updateSubscription, updateUser, uploadImage, uploadRelease, validateImage, validatePreSubmission, validateReleaseNotes, validateUploadFile, writeAuditLog, writeListingsToDir };