@gpc-cli/core 0.9.5 → 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 +88 -5
- package/dist/index.js +514 -31
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
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;
|
|
@@ -113,6 +113,25 @@ interface ReleaseStatusResult {
|
|
|
113
113
|
text: string;
|
|
114
114
|
}[];
|
|
115
115
|
}
|
|
116
|
+
interface DryRunUploadResult {
|
|
117
|
+
dryRun: true;
|
|
118
|
+
file: {
|
|
119
|
+
path: string;
|
|
120
|
+
valid: boolean;
|
|
121
|
+
errors: string[];
|
|
122
|
+
warnings: string[];
|
|
123
|
+
};
|
|
124
|
+
track: string;
|
|
125
|
+
currentReleases: {
|
|
126
|
+
versionCodes: string[];
|
|
127
|
+
status: string;
|
|
128
|
+
userFraction?: number;
|
|
129
|
+
}[];
|
|
130
|
+
plannedRelease: {
|
|
131
|
+
status: string;
|
|
132
|
+
userFraction?: number;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
116
135
|
declare function uploadRelease(client: PlayApiClient, packageName: string, filePath: string, options: {
|
|
117
136
|
track: string;
|
|
118
137
|
status?: string;
|
|
@@ -123,7 +142,8 @@ declare function uploadRelease(client: PlayApiClient, packageName: string, fileP
|
|
|
123
142
|
}[];
|
|
124
143
|
releaseName?: string;
|
|
125
144
|
mappingFile?: string;
|
|
126
|
-
|
|
145
|
+
dryRun?: boolean;
|
|
146
|
+
}): Promise<UploadResult | DryRunUploadResult>;
|
|
127
147
|
declare function getReleasesStatus(client: PlayApiClient, packageName: string, trackFilter?: string): Promise<ReleaseStatusResult[]>;
|
|
128
148
|
declare function promoteRelease(client: PlayApiClient, packageName: string, fromTrack: string, toTrack: string, options?: {
|
|
129
149
|
userFraction?: number;
|
|
@@ -165,6 +185,7 @@ declare function pushListings(client: PlayApiClient, packageName: string, dir: s
|
|
|
165
185
|
declare function listImages(client: PlayApiClient, packageName: string, language: string, imageType: ImageType): Promise<Image[]>;
|
|
166
186
|
declare function uploadImage(client: PlayApiClient, packageName: string, language: string, imageType: ImageType, filePath: string): Promise<Image>;
|
|
167
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[]>;
|
|
168
189
|
declare function getCountryAvailability(client: PlayApiClient, packageName: string, track: string): Promise<CountryAvailability>;
|
|
169
190
|
declare function updateAppDetails(client: PlayApiClient, packageName: string, details: Partial<AppDetails>): Promise<AppDetails>;
|
|
170
191
|
|
|
@@ -220,12 +241,18 @@ interface PublishOptions {
|
|
|
220
241
|
notesDir?: string;
|
|
221
242
|
releaseName?: string;
|
|
222
243
|
mappingFile?: string;
|
|
244
|
+
dryRun?: boolean;
|
|
223
245
|
}
|
|
224
246
|
interface PublishResult {
|
|
225
247
|
validation: ValidateResult;
|
|
226
248
|
upload?: UploadResult;
|
|
227
249
|
}
|
|
228
|
-
|
|
250
|
+
interface DryRunPublishResult {
|
|
251
|
+
dryRun: true;
|
|
252
|
+
validation: ValidateResult;
|
|
253
|
+
upload: DryRunUploadResult;
|
|
254
|
+
}
|
|
255
|
+
declare function publish(client: PlayApiClient, packageName: string, filePath: string, options: PublishOptions): Promise<PublishResult | DryRunPublishResult>;
|
|
229
256
|
|
|
230
257
|
interface ReviewsFilterOptions {
|
|
231
258
|
stars?: number;
|
|
@@ -404,6 +431,32 @@ declare function importTestersFromCsv(client: PlayApiClient, packageName: string
|
|
|
404
431
|
testers: Testers;
|
|
405
432
|
}>;
|
|
406
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
|
+
|
|
407
460
|
/**
|
|
408
461
|
* Normalize and resolve a user-supplied path.
|
|
409
462
|
* Prevents path traversal by normalizing `.` and `..` components.
|
|
@@ -415,6 +468,23 @@ declare function safePath(userPath: string): string;
|
|
|
415
468
|
*/
|
|
416
469
|
declare function safePathWithin(userPath: string, baseDir: string): string;
|
|
417
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
|
+
|
|
418
488
|
interface ScaffoldOptions {
|
|
419
489
|
name: string;
|
|
420
490
|
dir: string;
|
|
@@ -453,4 +523,17 @@ declare function writeAuditLog(entry: AuditEntry): Promise<void>;
|
|
|
453
523
|
*/
|
|
454
524
|
declare function createAuditEntry(command: string, args: Record<string, unknown>, app?: string): AuditEntry;
|
|
455
525
|
|
|
456
|
-
|
|
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 };
|