@gpc-cli/core 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 GPC Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,456 @@
1
+ import { OutputFormat, ResolvedConfig } from '@gpc-cli/config';
2
+ import { AuthClient } from '@gpc-cli/auth';
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';
5
+
6
+ declare class GpcError extends Error {
7
+ readonly code: string;
8
+ readonly exitCode: number;
9
+ readonly suggestion?: string | undefined;
10
+ constructor(message: string, code: string, exitCode: number, suggestion?: string | undefined);
11
+ toJSON(): {
12
+ success: boolean;
13
+ error: {
14
+ code: string;
15
+ message: string;
16
+ suggestion: string | undefined;
17
+ };
18
+ };
19
+ }
20
+ declare class ConfigError extends GpcError {
21
+ constructor(message: string, code: string, suggestion?: string);
22
+ }
23
+ declare class ApiError extends GpcError {
24
+ readonly statusCode?: number | undefined;
25
+ constructor(message: string, code: string, statusCode?: number | undefined, suggestion?: string);
26
+ }
27
+ declare class NetworkError extends GpcError {
28
+ constructor(message: string, suggestion?: string);
29
+ }
30
+
31
+ declare function detectOutputFormat(): OutputFormat;
32
+ declare function formatOutput(data: unknown, format: OutputFormat, redact?: boolean): string;
33
+ /** Recursively redact sensitive fields from data before output. */
34
+ declare function redactSensitive(data: unknown): unknown;
35
+
36
+ interface CommandContext {
37
+ config: ResolvedConfig;
38
+ auth: AuthClient;
39
+ output: OutputFormat;
40
+ verbose: boolean;
41
+ quiet: boolean;
42
+ app?: string;
43
+ }
44
+
45
+ declare class PluginManager {
46
+ private plugins;
47
+ private beforeHandlers;
48
+ private afterHandlers;
49
+ private errorHandlers;
50
+ private beforeRequestHandlers;
51
+ private afterResponseHandlers;
52
+ private registeredCommands;
53
+ /** Load and register a plugin */
54
+ load(plugin: GpcPlugin, manifest?: PluginManifest): Promise<void>;
55
+ /** Run all beforeCommand handlers */
56
+ runBeforeCommand(event: CommandEvent): Promise<void>;
57
+ /** Run all afterCommand handlers */
58
+ runAfterCommand(event: CommandEvent, result: CommandResult): Promise<void>;
59
+ /** Run all onError handlers */
60
+ runOnError(event: CommandEvent, error: PluginError): Promise<void>;
61
+ /** Run all beforeRequest handlers */
62
+ runBeforeRequest(event: RequestEvent): Promise<void>;
63
+ /** Run all afterResponse handlers */
64
+ runAfterResponse(event: RequestEvent, response: ResponseEvent): Promise<void>;
65
+ /** Get commands registered by plugins */
66
+ getRegisteredCommands(): PluginCommand[];
67
+ /** Get list of loaded plugins */
68
+ getLoadedPlugins(): LoadedPlugin[];
69
+ /** Whether any request/response hooks are registered */
70
+ hasRequestHooks(): boolean;
71
+ /** Reset (for testing) */
72
+ reset(): void;
73
+ }
74
+ interface LoadedPlugin {
75
+ name: string;
76
+ version: string;
77
+ trusted: boolean;
78
+ }
79
+ interface DiscoverPluginsOptions {
80
+ /** Plugin names from config file */
81
+ configPlugins?: string[];
82
+ /** Working directory for node_modules scanning */
83
+ cwd?: string;
84
+ }
85
+ /**
86
+ * Discover plugins from multiple sources:
87
+ * 1. Explicit config: gpc.config.ts → plugins: [...]
88
+ * 2. Convention: node_modules/@gpc-cli/plugin-*
89
+ * 3. Convention: node_modules/gpc-plugin-*
90
+ */
91
+ declare function discoverPlugins(options?: DiscoverPluginsOptions): Promise<GpcPlugin[]>;
92
+
93
+ interface AppInfo {
94
+ packageName: string;
95
+ title?: string;
96
+ defaultLanguage?: string;
97
+ contactEmail?: string;
98
+ }
99
+ declare function getAppInfo(client: PlayApiClient, packageName: string): Promise<AppInfo>;
100
+
101
+ interface UploadResult {
102
+ versionCode: number;
103
+ track: string;
104
+ status: string;
105
+ }
106
+ interface ReleaseStatusResult {
107
+ track: string;
108
+ status: string;
109
+ versionCodes: string[];
110
+ userFraction?: number;
111
+ releaseNotes?: {
112
+ language: string;
113
+ text: string;
114
+ }[];
115
+ }
116
+ declare function uploadRelease(client: PlayApiClient, packageName: string, filePath: string, options: {
117
+ track: string;
118
+ status?: string;
119
+ userFraction?: number;
120
+ releaseNotes?: {
121
+ language: string;
122
+ text: string;
123
+ }[];
124
+ releaseName?: string;
125
+ mappingFile?: string;
126
+ }): Promise<UploadResult>;
127
+ declare function getReleasesStatus(client: PlayApiClient, packageName: string, trackFilter?: string): Promise<ReleaseStatusResult[]>;
128
+ declare function promoteRelease(client: PlayApiClient, packageName: string, fromTrack: string, toTrack: string, options?: {
129
+ userFraction?: number;
130
+ releaseNotes?: {
131
+ language: string;
132
+ text: string;
133
+ }[];
134
+ }): Promise<ReleaseStatusResult>;
135
+ declare function updateRollout(client: PlayApiClient, packageName: string, track: string, action: "increase" | "halt" | "resume" | "complete", userFraction?: number): Promise<ReleaseStatusResult>;
136
+ declare function listTracks(client: PlayApiClient, packageName: string): Promise<Track[]>;
137
+
138
+ interface ListingDiff {
139
+ language: string;
140
+ field: string;
141
+ local: string;
142
+ remote: string;
143
+ }
144
+ declare function readListingsFromDir(dir: string): Promise<Listing[]>;
145
+ declare function writeListingsToDir(dir: string, listings: Listing[]): Promise<void>;
146
+ declare function diffListings(local: Listing[], remote: Listing[]): ListingDiff[];
147
+
148
+ interface ListingsResult {
149
+ listings: Listing[];
150
+ }
151
+ interface PushResult {
152
+ updated: number;
153
+ languages: string[];
154
+ }
155
+ interface DryRunResult {
156
+ diffs: ListingDiff[];
157
+ }
158
+ declare function getListings(client: PlayApiClient, packageName: string, language?: string): Promise<Listing[]>;
159
+ declare function updateListing(client: PlayApiClient, packageName: string, language: string, data: Partial<Omit<Listing, "language">>): Promise<Listing>;
160
+ declare function deleteListing(client: PlayApiClient, packageName: string, language: string): Promise<void>;
161
+ declare function pullListings(client: PlayApiClient, packageName: string, dir: string): Promise<ListingsResult>;
162
+ declare function pushListings(client: PlayApiClient, packageName: string, dir: string, options?: {
163
+ dryRun?: boolean;
164
+ }): Promise<PushResult | DryRunResult>;
165
+ declare function listImages(client: PlayApiClient, packageName: string, language: string, imageType: ImageType): Promise<Image[]>;
166
+ declare function uploadImage(client: PlayApiClient, packageName: string, language: string, imageType: ImageType, filePath: string): Promise<Image>;
167
+ declare function deleteImage(client: PlayApiClient, packageName: string, language: string, imageType: ImageType, imageId: string): Promise<void>;
168
+ declare function getCountryAvailability(client: PlayApiClient, packageName: string, track: string): Promise<CountryAvailability>;
169
+ declare function updateAppDetails(client: PlayApiClient, packageName: string, details: Partial<AppDetails>): Promise<AppDetails>;
170
+
171
+ declare const GOOGLE_PLAY_LANGUAGES: string[];
172
+ declare function isValidBcp47(tag: string): boolean;
173
+
174
+ interface FileValidationResult {
175
+ valid: boolean;
176
+ fileType: "aab" | "apk" | "unknown";
177
+ sizeBytes: number;
178
+ errors: string[];
179
+ warnings: string[];
180
+ }
181
+ declare function validateUploadFile(filePath: string): Promise<FileValidationResult>;
182
+
183
+ interface ReleaseNote {
184
+ language: string;
185
+ text: string;
186
+ }
187
+ interface ReleaseNotesValidation {
188
+ valid: boolean;
189
+ errors: string[];
190
+ warnings: string[];
191
+ }
192
+ declare function readReleaseNotesFromDir(dir: string): Promise<ReleaseNote[]>;
193
+ declare function validateReleaseNotes(notes: ReleaseNote[]): ReleaseNotesValidation;
194
+
195
+ interface ValidateOptions {
196
+ filePath: string;
197
+ mappingFile?: string;
198
+ track?: string;
199
+ notes?: {
200
+ language: string;
201
+ text: string;
202
+ }[];
203
+ notesDir?: string;
204
+ }
205
+ interface ValidateCheck {
206
+ name: string;
207
+ passed: boolean;
208
+ message: string;
209
+ }
210
+ interface ValidateResult {
211
+ valid: boolean;
212
+ checks: ValidateCheck[];
213
+ }
214
+ declare function validatePreSubmission(options: ValidateOptions): Promise<ValidateResult>;
215
+
216
+ interface PublishOptions {
217
+ track?: string;
218
+ rolloutPercent?: number;
219
+ notes?: string;
220
+ notesDir?: string;
221
+ releaseName?: string;
222
+ mappingFile?: string;
223
+ }
224
+ interface PublishResult {
225
+ validation: ValidateResult;
226
+ upload?: UploadResult;
227
+ }
228
+ declare function publish(client: PlayApiClient, packageName: string, filePath: string, options: PublishOptions): Promise<PublishResult>;
229
+
230
+ interface ReviewsFilterOptions {
231
+ stars?: number;
232
+ language?: string;
233
+ since?: string;
234
+ translationLanguage?: string;
235
+ maxResults?: number;
236
+ limit?: number;
237
+ nextPage?: string;
238
+ }
239
+ interface ReviewExportOptions extends ReviewsFilterOptions {
240
+ format?: "json" | "csv";
241
+ }
242
+ declare function listReviews(client: PlayApiClient, packageName: string, options?: ReviewsFilterOptions): Promise<Review[]>;
243
+ declare function getReview(client: PlayApiClient, packageName: string, reviewId: string, translationLanguage?: string): Promise<Review>;
244
+ declare function replyToReview(client: PlayApiClient, packageName: string, reviewId: string, replyText: string): Promise<ReviewReplyResponse>;
245
+ declare function exportReviews(client: PlayApiClient, packageName: string, options?: ReviewExportOptions): Promise<string>;
246
+
247
+ interface ListSubscriptionsOptions {
248
+ pageToken?: string;
249
+ pageSize?: number;
250
+ limit?: number;
251
+ nextPage?: string;
252
+ }
253
+ declare function listSubscriptions(client: PlayApiClient, packageName: string, options?: ListSubscriptionsOptions): Promise<{
254
+ subscriptions: Subscription[];
255
+ nextPageToken?: string;
256
+ }>;
257
+ declare function getSubscription(client: PlayApiClient, packageName: string, productId: string): Promise<Subscription>;
258
+ declare function createSubscription(client: PlayApiClient, packageName: string, data: Subscription): Promise<Subscription>;
259
+ declare function updateSubscription(client: PlayApiClient, packageName: string, productId: string, data: Subscription, updateMask?: string): Promise<Subscription>;
260
+ declare function deleteSubscription(client: PlayApiClient, packageName: string, productId: string): Promise<void>;
261
+ declare function activateBasePlan(client: PlayApiClient, packageName: string, productId: string, basePlanId: string): Promise<Subscription>;
262
+ declare function deactivateBasePlan(client: PlayApiClient, packageName: string, productId: string, basePlanId: string): Promise<Subscription>;
263
+ declare function deleteBasePlan(client: PlayApiClient, packageName: string, productId: string, basePlanId: string): Promise<void>;
264
+ declare function migratePrices(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, data: BasePlanMigratePricesRequest): Promise<Subscription>;
265
+ declare function listOffers(client: PlayApiClient, packageName: string, productId: string, basePlanId: string): Promise<OffersListResponse>;
266
+ declare function getOffer(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, offerId: string): Promise<SubscriptionOffer>;
267
+ declare function createOffer(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, data: SubscriptionOffer): Promise<SubscriptionOffer>;
268
+ declare function updateOffer(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, offerId: string, data: SubscriptionOffer, updateMask?: string): Promise<SubscriptionOffer>;
269
+ declare function deleteOffer(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, offerId: string): Promise<void>;
270
+ declare function activateOffer(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, offerId: string): Promise<SubscriptionOffer>;
271
+ declare function deactivateOffer(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, offerId: string): Promise<SubscriptionOffer>;
272
+
273
+ interface ListIapOptions {
274
+ token?: string;
275
+ maxResults?: number;
276
+ limit?: number;
277
+ nextPage?: string;
278
+ }
279
+ declare function listInAppProducts(client: PlayApiClient, packageName: string, options?: ListIapOptions): Promise<{
280
+ inappproduct: InAppProduct[];
281
+ nextPageToken?: string;
282
+ }>;
283
+ declare function getInAppProduct(client: PlayApiClient, packageName: string, sku: string): Promise<InAppProduct>;
284
+ declare function createInAppProduct(client: PlayApiClient, packageName: string, data: InAppProduct): Promise<InAppProduct>;
285
+ declare function updateInAppProduct(client: PlayApiClient, packageName: string, sku: string, data: InAppProduct): Promise<InAppProduct>;
286
+ declare function deleteInAppProduct(client: PlayApiClient, packageName: string, sku: string): Promise<void>;
287
+ interface SyncResult {
288
+ created: number;
289
+ updated: number;
290
+ unchanged: number;
291
+ skus: string[];
292
+ }
293
+ declare function syncInAppProducts(client: PlayApiClient, packageName: string, dir: string, options?: {
294
+ dryRun?: boolean;
295
+ }): Promise<SyncResult>;
296
+
297
+ declare function getProductPurchase(client: PlayApiClient, packageName: string, productId: string, token: string): Promise<ProductPurchase>;
298
+ declare function acknowledgeProductPurchase(client: PlayApiClient, packageName: string, productId: string, token: string, payload?: string): Promise<void>;
299
+ declare function consumeProductPurchase(client: PlayApiClient, packageName: string, productId: string, token: string): Promise<void>;
300
+ declare function getSubscriptionPurchase(client: PlayApiClient, packageName: string, token: string): Promise<SubscriptionPurchaseV2>;
301
+ declare function cancelSubscriptionPurchase(client: PlayApiClient, packageName: string, subscriptionId: string, token: string): Promise<void>;
302
+ declare function deferSubscriptionPurchase(client: PlayApiClient, packageName: string, subscriptionId: string, token: string, desiredExpiry: string): Promise<SubscriptionDeferResponse>;
303
+ declare function revokeSubscriptionPurchase(client: PlayApiClient, packageName: string, token: string): Promise<void>;
304
+
305
+ interface ListVoidedOptions {
306
+ startTime?: string;
307
+ endTime?: string;
308
+ maxResults?: number;
309
+ limit?: number;
310
+ nextPage?: string;
311
+ }
312
+ declare function listVoidedPurchases(client: PlayApiClient, packageName: string, options?: ListVoidedOptions): Promise<{
313
+ voidedPurchases: VoidedPurchase[];
314
+ nextPageToken?: string;
315
+ }>;
316
+ declare function refundOrder(client: PlayApiClient, packageName: string, orderId: string, options?: {
317
+ fullRefund?: boolean;
318
+ proratedRefund?: boolean;
319
+ }): Promise<void>;
320
+
321
+ declare const PERMISSION_PROPAGATION_WARNING = "Note: Permission changes may take up to 48 hours to propagate.";
322
+ interface ListUsersOptions {
323
+ pageToken?: string;
324
+ pageSize?: number;
325
+ limit?: number;
326
+ nextPage?: string;
327
+ }
328
+ declare function listUsers(client: UsersApiClient, developerId: string, options?: ListUsersOptions): Promise<{
329
+ users: User[];
330
+ nextPageToken?: string;
331
+ }>;
332
+ declare function getUser(client: UsersApiClient, developerId: string, userId: string): Promise<User>;
333
+ declare function inviteUser(client: UsersApiClient, developerId: string, email: string, permissions?: DeveloperPermission[], grants?: Grant[]): Promise<User>;
334
+ declare function updateUser(client: UsersApiClient, developerId: string, userId: string, permissions?: DeveloperPermission[], grants?: Grant[]): Promise<User>;
335
+ declare function removeUser(client: UsersApiClient, developerId: string, userId: string): Promise<void>;
336
+ declare function parseGrantArg(grantStr: string): Grant;
337
+
338
+ interface VitalsQueryOptions {
339
+ dimension?: ReportingDimension;
340
+ days?: number;
341
+ aggregation?: ReportingAggregation;
342
+ }
343
+ interface VitalsOverview {
344
+ crashRate?: MetricRow[];
345
+ anrRate?: MetricRow[];
346
+ slowStartRate?: MetricRow[];
347
+ slowRenderingRate?: MetricRow[];
348
+ excessiveWakeupRate?: MetricRow[];
349
+ stuckWakelockRate?: MetricRow[];
350
+ }
351
+ interface ThresholdResult {
352
+ breached: boolean;
353
+ value: number | undefined;
354
+ threshold: number;
355
+ }
356
+ declare function getVitalsOverview(reporting: ReportingApiClient, packageName: string): Promise<VitalsOverview>;
357
+ declare function getVitalsCrashes(reporting: ReportingApiClient, packageName: string, options?: VitalsQueryOptions): Promise<MetricSetResponse>;
358
+ declare function getVitalsAnr(reporting: ReportingApiClient, packageName: string, options?: VitalsQueryOptions): Promise<MetricSetResponse>;
359
+ declare function getVitalsStartup(reporting: ReportingApiClient, packageName: string, options?: VitalsQueryOptions): Promise<MetricSetResponse>;
360
+ declare function getVitalsRendering(reporting: ReportingApiClient, packageName: string, options?: VitalsQueryOptions): Promise<MetricSetResponse>;
361
+ declare function getVitalsBattery(reporting: ReportingApiClient, packageName: string, options?: VitalsQueryOptions): Promise<MetricSetResponse>;
362
+ declare function getVitalsMemory(reporting: ReportingApiClient, packageName: string, options?: VitalsQueryOptions): Promise<MetricSetResponse>;
363
+ declare function getVitalsAnomalies(reporting: ReportingApiClient, packageName: string): Promise<AnomalyDetectionResponse>;
364
+ declare function searchVitalsErrors(reporting: ReportingApiClient, packageName: string, options?: {
365
+ filter?: string;
366
+ maxResults?: number;
367
+ }): Promise<ErrorIssuesResponse>;
368
+ interface VitalsTrendComparison {
369
+ metric: string;
370
+ current: number | undefined;
371
+ previous: number | undefined;
372
+ changePercent: number | undefined;
373
+ direction: "improved" | "degraded" | "unchanged" | "unknown";
374
+ }
375
+ declare function compareVitalsTrend(reporting: ReportingApiClient, packageName: string, metricSet: VitalsMetricSet, days?: number): Promise<VitalsTrendComparison>;
376
+ declare function checkThreshold(value: number | undefined, threshold: number): ThresholdResult;
377
+
378
+ interface ImageValidationResult {
379
+ valid: boolean;
380
+ warnings: string[];
381
+ errors: string[];
382
+ }
383
+ declare function validateImage(filePath: string, imageType?: string): Promise<ImageValidationResult>;
384
+
385
+ declare function convertRegionPrices(client: PlayApiClient, packageName: string, currencyCode: string, amount: string): Promise<ConvertRegionPricesResponse>;
386
+
387
+ declare function isFinancialReportType(type: string): boolean;
388
+ declare function isStatsReportType(type: string): boolean;
389
+ declare function isValidReportType(type: string): type is ReportType;
390
+ declare function isValidStatsDimension(dim: string): dim is StatsDimension;
391
+ interface ParsedMonth {
392
+ year: number;
393
+ month: number;
394
+ }
395
+ declare function parseMonth(monthStr: string): ParsedMonth;
396
+ declare function listReports(client: PlayApiClient, packageName: string, reportType: ReportType, year: number, month: number): Promise<ReportBucket[]>;
397
+ declare function downloadReport(client: PlayApiClient, packageName: string, reportType: ReportType, year: number, month: number): Promise<string>;
398
+
399
+ declare function listTesters(client: PlayApiClient, packageName: string, track: string): Promise<Testers>;
400
+ declare function addTesters(client: PlayApiClient, packageName: string, track: string, groupEmails: string[]): Promise<Testers>;
401
+ declare function removeTesters(client: PlayApiClient, packageName: string, track: string, groupEmails: string[]): Promise<Testers>;
402
+ declare function importTestersFromCsv(client: PlayApiClient, packageName: string, track: string, csvPath: string): Promise<{
403
+ added: number;
404
+ testers: Testers;
405
+ }>;
406
+
407
+ /**
408
+ * Normalize and resolve a user-supplied path.
409
+ * Prevents path traversal by normalizing `.` and `..` components.
410
+ */
411
+ declare function safePath(userPath: string): string;
412
+ /**
413
+ * Validate that a resolved path is within an expected base directory.
414
+ * Returns the resolved path or throws if it escapes the base.
415
+ */
416
+ declare function safePathWithin(userPath: string, baseDir: string): string;
417
+
418
+ interface ScaffoldOptions {
419
+ name: string;
420
+ dir: string;
421
+ description?: string;
422
+ }
423
+ interface ScaffoldResult {
424
+ dir: string;
425
+ files: string[];
426
+ }
427
+ /**
428
+ * Scaffold a new GPC plugin project.
429
+ */
430
+ declare function scaffoldPlugin(options: ScaffoldOptions): Promise<ScaffoldResult>;
431
+
432
+ interface AuditEntry {
433
+ timestamp: string;
434
+ command: string;
435
+ app?: string;
436
+ args: Record<string, unknown>;
437
+ user?: string;
438
+ success?: boolean;
439
+ durationMs?: number;
440
+ error?: string;
441
+ }
442
+ /**
443
+ * Initialize audit logging with a directory path.
444
+ * Typically ~/.config/gpc/ or the XDG config dir.
445
+ */
446
+ declare function initAudit(configDir: string): void;
447
+ /**
448
+ * Write an audit log entry. Non-blocking — errors are silently ignored.
449
+ */
450
+ declare function writeAuditLog(entry: AuditEntry): Promise<void>;
451
+ /**
452
+ * Convenience: create an audit entry for a write command.
453
+ */
454
+ declare function createAuditEntry(command: string, args: Record<string, unknown>, app?: string): AuditEntry;
455
+
456
+ export { ApiError, type AppInfo, type AuditEntry, type CommandContext, ConfigError, type DiscoverPluginsOptions, type DryRunResult, 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 };