@gpc-cli/api 1.0.26 → 1.0.27

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
@@ -65,6 +65,22 @@ interface AppEdit {
65
65
  id: string;
66
66
  expiryTimeSeconds: string;
67
67
  }
68
+ type ChangesInReviewBehavior = "CANCEL_IN_REVIEW_AND_SUBMIT" | "ERROR_IF_IN_REVIEW";
69
+ interface EditCommitOptions {
70
+ changesNotSentForReview?: boolean;
71
+ changesInReviewBehavior?: ChangesInReviewBehavior;
72
+ }
73
+ type DeobfuscationFileType = "proguard" | "nativeCode";
74
+ type ProductUpdateLatencyTolerance = "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT";
75
+ interface MutationOptions {
76
+ allowMissing?: boolean;
77
+ latencyTolerance?: ProductUpdateLatencyTolerance;
78
+ }
79
+ interface ExpansionFile {
80
+ referencesVersion?: number;
81
+ fileSize?: string;
82
+ }
83
+ type ExpansionFileType = "main" | "patch";
68
84
  interface Track {
69
85
  track: string;
70
86
  releases: Release[];
@@ -76,6 +92,10 @@ interface Release {
76
92
  userFraction?: number;
77
93
  releaseNotes?: ReleaseNote[];
78
94
  inAppUpdatePriority?: number;
95
+ countryTargeting?: {
96
+ countries: string[];
97
+ includeRestOfWorld: boolean;
98
+ };
79
99
  }
80
100
  type ReleaseStatus = "completed" | "draft" | "halted" | "inProgress";
81
101
  interface ReleaseNote {
@@ -197,6 +217,7 @@ interface ReviewReplyResponse {
197
217
  interface ReviewsListOptions {
198
218
  token?: string;
199
219
  maxResults?: number;
220
+ startIndex?: number;
200
221
  translationLanguage?: string;
201
222
  }
202
223
  type VitalsMetricSet = "crashRateMetricSet" | "anrRateMetricSet" | "excessiveWakeupRateMetricSet" | "stuckBackgroundWakelockRateMetricSet" | "slowStartRateMetricSet" | "slowRenderingRateMetricSet" | "errorCountMetricSet";
@@ -369,6 +390,10 @@ interface BasePlanMigratePricesRequest {
369
390
  oldestAllowedPriceVersionTime?: string;
370
391
  priceIncreaseType?: string;
371
392
  }[];
393
+ regionsVersion?: {
394
+ version?: string;
395
+ };
396
+ latencyTolerance?: ProductUpdateLatencyTolerance;
372
397
  }
373
398
  interface SubscriptionOfferPhase {
374
399
  recurrenceCount: number;
@@ -986,7 +1011,7 @@ interface PlayApiClient {
986
1011
  insert(packageName: string): Promise<AppEdit>;
987
1012
  get(packageName: string, editId: string): Promise<AppEdit>;
988
1013
  validate(packageName: string, editId: string): Promise<AppEdit>;
989
- commit(packageName: string, editId: string): Promise<AppEdit>;
1014
+ commit(packageName: string, editId: string, options?: EditCommitOptions): Promise<AppEdit>;
990
1015
  delete(packageName: string, editId: string): Promise<void>;
991
1016
  };
992
1017
  details: {
@@ -996,7 +1021,7 @@ interface PlayApiClient {
996
1021
  };
997
1022
  bundles: {
998
1023
  list(packageName: string, editId: string): Promise<Bundle[]>;
999
- upload(packageName: string, editId: string, filePath: string, uploadOptions?: ResumableUploadOptions): Promise<Bundle>;
1024
+ upload(packageName: string, editId: string, filePath: string, uploadOptions?: ResumableUploadOptions, deviceTierConfigId?: string): Promise<Bundle>;
1000
1025
  };
1001
1026
  tracks: {
1002
1027
  list(packageName: string, editId: string): Promise<Track[]>;
@@ -1027,6 +1052,12 @@ interface PlayApiClient {
1027
1052
  delete(packageName: string, editId: string, language: string, imageType: ImageType, imageId: string): Promise<void>;
1028
1053
  deleteAll(packageName: string, editId: string, language: string, imageType: ImageType): Promise<Image[]>;
1029
1054
  };
1055
+ expansionFiles: {
1056
+ get(packageName: string, editId: string, apkVersionCode: number, expansionFileType: ExpansionFileType): Promise<ExpansionFile>;
1057
+ update(packageName: string, editId: string, apkVersionCode: number, expansionFileType: ExpansionFileType, data: ExpansionFile): Promise<ExpansionFile>;
1058
+ patch(packageName: string, editId: string, apkVersionCode: number, expansionFileType: ExpansionFileType, data: Partial<ExpansionFile>): Promise<ExpansionFile>;
1059
+ upload(packageName: string, editId: string, apkVersionCode: number, expansionFileType: ExpansionFileType, filePath: string): Promise<ExpansionFile>;
1060
+ };
1030
1061
  countryAvailability: {
1031
1062
  get(packageName: string, editId: string, track: string): Promise<CountryAvailability>;
1032
1063
  };
@@ -1045,8 +1076,8 @@ interface PlayApiClient {
1045
1076
  pageSize?: number;
1046
1077
  }): Promise<SubscriptionsListResponse>;
1047
1078
  get(packageName: string, productId: string): Promise<Subscription>;
1048
- create(packageName: string, data: Subscription, productId?: string): Promise<Subscription>;
1049
- update(packageName: string, productId: string, data: Subscription, updateMask?: string, regionsVersion?: string): Promise<Subscription>;
1079
+ create(packageName: string, data: Subscription, productId?: string, regionsVersion?: string): Promise<Subscription>;
1080
+ update(packageName: string, productId: string, data: Subscription, updateMask?: string, regionsVersion?: string, options?: MutationOptions): Promise<Subscription>;
1050
1081
  delete(packageName: string, productId: string): Promise<void>;
1051
1082
  batchGet(packageName: string, productIds: string[]): Promise<Subscription[]>;
1052
1083
  batchUpdate(packageName: string, requests: SubscriptionsBatchUpdateRequest): Promise<SubscriptionsBatchUpdateResponse>;
@@ -1056,8 +1087,8 @@ interface PlayApiClient {
1056
1087
  migratePrices(packageName: string, productId: string, basePlanId: string, body: BasePlanMigratePricesRequest): Promise<Subscription>;
1057
1088
  listOffers(packageName: string, productId: string, basePlanId: string): Promise<OffersListResponse>;
1058
1089
  getOffer(packageName: string, productId: string, basePlanId: string, offerId: string): Promise<SubscriptionOffer>;
1059
- createOffer(packageName: string, productId: string, basePlanId: string, data: SubscriptionOffer, offerId?: string): Promise<SubscriptionOffer>;
1060
- updateOffer(packageName: string, productId: string, basePlanId: string, offerId: string, data: SubscriptionOffer, updateMask?: string, regionsVersion?: string): Promise<SubscriptionOffer>;
1090
+ createOffer(packageName: string, productId: string, basePlanId: string, data: SubscriptionOffer, offerId?: string, regionsVersion?: string): Promise<SubscriptionOffer>;
1091
+ updateOffer(packageName: string, productId: string, basePlanId: string, offerId: string, data: SubscriptionOffer, updateMask?: string, regionsVersion?: string, options?: MutationOptions): Promise<SubscriptionOffer>;
1061
1092
  deleteOffer(packageName: string, productId: string, basePlanId: string, offerId: string): Promise<void>;
1062
1093
  activateOffer(packageName: string, productId: string, basePlanId: string, offerId: string): Promise<SubscriptionOffer>;
1063
1094
  deactivateOffer(packageName: string, productId: string, basePlanId: string, offerId: string): Promise<SubscriptionOffer>;
@@ -1162,7 +1193,7 @@ interface PlayApiClient {
1162
1193
  update(packageName: string, editId: string, track: string, testers: Testers): Promise<Testers>;
1163
1194
  };
1164
1195
  deobfuscation: {
1165
- upload(packageName: string, editId: string, versionCode: number, filePath: string): Promise<DeobfuscationFile>;
1196
+ upload(packageName: string, editId: string, versionCode: number, filePath: string, fileType?: DeobfuscationFileType): Promise<DeobfuscationFile>;
1166
1197
  };
1167
1198
  appRecovery: {
1168
1199
  list(packageName: string, versionCode?: number): Promise<AppRecoveryAction[]>;
@@ -1182,15 +1213,18 @@ interface PlayApiClient {
1182
1213
  create(packageName: string, config: DeviceTierConfig): Promise<DeviceTierConfig>;
1183
1214
  };
1184
1215
  oneTimeProducts: {
1185
- list(packageName: string): Promise<OneTimeProductsListResponse>;
1216
+ list(packageName: string, options?: {
1217
+ pageToken?: string;
1218
+ pageSize?: number;
1219
+ }): Promise<OneTimeProductsListResponse>;
1186
1220
  get(packageName: string, productId: string): Promise<OneTimeProduct>;
1187
- create(packageName: string, product: OneTimeProduct): Promise<OneTimeProduct>;
1188
- update(packageName: string, productId: string, product: Partial<OneTimeProduct>, updateMask?: string, regionsVersion?: string): Promise<OneTimeProduct>;
1221
+ create(packageName: string, product: OneTimeProduct, regionsVersion?: string): Promise<OneTimeProduct>;
1222
+ update(packageName: string, productId: string, product: Partial<OneTimeProduct>, updateMask?: string, regionsVersion?: string, options?: MutationOptions): Promise<OneTimeProduct>;
1189
1223
  delete(packageName: string, productId: string): Promise<void>;
1190
1224
  listOffers(packageName: string, productId: string): Promise<OneTimeOffersListResponse>;
1191
1225
  getOffer(packageName: string, productId: string, offerId: string): Promise<OneTimeOffer>;
1192
- createOffer(packageName: string, productId: string, offer: OneTimeOffer): Promise<OneTimeOffer>;
1193
- updateOffer(packageName: string, productId: string, offerId: string, offer: Partial<OneTimeOffer>, updateMask?: string, regionsVersion?: string): Promise<OneTimeOffer>;
1226
+ createOffer(packageName: string, productId: string, offer: OneTimeOffer, regionsVersion?: string): Promise<OneTimeOffer>;
1227
+ updateOffer(packageName: string, productId: string, offerId: string, offer: Partial<OneTimeOffer>, updateMask?: string, regionsVersion?: string, options?: MutationOptions): Promise<OneTimeOffer>;
1194
1228
  deleteOffer(packageName: string, productId: string, offerId: string): Promise<void>;
1195
1229
  batchGet(packageName: string, productIds: string[]): Promise<OneTimeProduct[]>;
1196
1230
  batchUpdate(packageName: string, requests: {
@@ -1395,4 +1429,4 @@ declare class PlayApiError extends Error {
1395
1429
  /** Files below this threshold use simple upload instead. */
1396
1430
  declare const RESUMABLE_THRESHOLD: number;
1397
1431
 
1398
- export { type Achievement, type Anomaly, type AnomalyDetectionResponse, type ApiClientOptions, type ApiResponse, type ApkInfo, type ApksListResponse, type AppDetails, type AppEdit, type AppRecoveriesListResponse, type AppRecoveryAction, type AppRecoveryTargeting, type BasePlan, type BasePlanMigratePricesRequest, type BatchGetOrdersResponse, type Bundle, type BundleListResponse, type ConvertRegionPricesRequest, type ConvertRegionPricesResponse, type ConvertedRegionPrice, type CountryAvailability, type CreateAppRecoveryActionRequest, type CustomApp, type CustomAppsListResponse, type DataSafety, type DataSafetyDataType, type DataSafetyPurpose, type DeobfuscationFile, type DeobfuscationUploadResponse, type DeveloperComment, type DeveloperPermission, type DeviceGroup, type DeviceSelector, type DeviceTier, type DeviceTierConfig, type DeviceTierConfigsListResponse, type EnterpriseApiClient, type ErrorIssue, type ErrorIssuesResponse, type ErrorReport, type ErrorReportsResponse, type ExternalTransaction, type ExternalTransactionAmount, type ExternalTransactionRefund, type ExternallyHostedApk, type ExternallyHostedApkResponse, type GameEvent, type GamesApiClient, type GeneratedApk, type GeneratedApksPerVersion, type Grant, type GrantsListResponse, type HttpClient, type Image, type ImageType, type ImageUploadResponse, type ImagesDeleteAllResponse, type ImagesListResponse, type InAppProduct, type InAppProductListing, type InAppProductsBatchDeleteRequest, type InAppProductsBatchGetRequest, type InAppProductsBatchUpdateRequest, type InAppProductsBatchUpdateResponse, type InAppProductsListResponse, type InternalAppSharingArtifact, type Leaderboard, type LeaderboardScore, type Listing, type ListingsListResponse, type MetricRow, type MetricSetQuery, type MetricSetResponse, type Money, type OffersListResponse, type OneTimeOffer, type OneTimeOfferRegionalConfig, type OneTimeOffersListResponse, type OneTimeProduct, type OneTimeProductListing, type OneTimeProductsListResponse, type Order, type OrderLineItem, type PagedResponse, type PaginateOptions, type PlayApiClient, PlayApiError, type ProductPurchase, type ProductPurchaseLineItem, type ProductPurchaseV2, type PurchaseOption, type PurchaseOptionsListResponse, RATE_LIMIT_BUCKETS, RESUMABLE_THRESHOLD, type RateLimitBucket, type RateLimiter, type RegionalBasePlanConfig, type Release, type ReleaseNote, type ReleaseStatus, type ReleaseSummary, type ReleasesListResponse, type ReportBucket, type ReportType, type ReportingAggregation, type ReportingApiClient, type ReportingDimension, type ReportsListResponse, type ResumableUploadOptions, type RetryLogEntry, type Review, type ReviewComment, type ReviewReplyRequest, type ReviewReplyResponse, type ReviewsListOptions, type ReviewsListResponse, type StatsDimension, type Subscription, type SubscriptionDeferRequest, type SubscriptionDeferResponse, type SubscriptionListing, type SubscriptionOffer, type SubscriptionOfferPhase, type SubscriptionPurchase, type SubscriptionPurchaseLineItem, type SubscriptionPurchaseV2, type SubscriptionsBatchGetRequest, type SubscriptionsBatchGetResponse, type SubscriptionsBatchUpdateRequest, type SubscriptionsBatchUpdateResponse, type SubscriptionsListResponse, type SubscriptionsV2CancelRequest, type SubscriptionsV2DeferRequest, type SubscriptionsV2DeferResponse, type TaxAndComplianceSettings, type Testers, type TokenPagination, type Track, type TrackListResponse, type UploadProgressEvent, type UploadResponse, type User, type UserComment, type UsersApiClient, type UsersListResponse, type VitalsMetricSet, type VoidedPurchase, type VoidedPurchasesListResponse, createApiClient, createEnterpriseClient, createGamesClient, createHttpClient, createRateLimiter, createReportingClient, createUsersClient, paginate, paginateAll, paginateParallel, resolveBucket };
1432
+ export { type Achievement, type Anomaly, type AnomalyDetectionResponse, type ApiClientOptions, type ApiResponse, type ApkInfo, type ApksListResponse, type AppDetails, type AppEdit, type AppRecoveriesListResponse, type AppRecoveryAction, type AppRecoveryTargeting, type BasePlan, type BasePlanMigratePricesRequest, type BatchGetOrdersResponse, type Bundle, type BundleListResponse, type ChangesInReviewBehavior, type ConvertRegionPricesRequest, type ConvertRegionPricesResponse, type ConvertedRegionPrice, type CountryAvailability, type CreateAppRecoveryActionRequest, type CustomApp, type CustomAppsListResponse, type DataSafety, type DataSafetyDataType, type DataSafetyPurpose, type DeobfuscationFile, type DeobfuscationFileType, type DeobfuscationUploadResponse, type DeveloperComment, type DeveloperPermission, type DeviceGroup, type DeviceSelector, type DeviceTier, type DeviceTierConfig, type DeviceTierConfigsListResponse, type EditCommitOptions, type EnterpriseApiClient, type ErrorIssue, type ErrorIssuesResponse, type ErrorReport, type ErrorReportsResponse, type ExpansionFile, type ExpansionFileType, type ExternalTransaction, type ExternalTransactionAmount, type ExternalTransactionRefund, type ExternallyHostedApk, type ExternallyHostedApkResponse, type GameEvent, type GamesApiClient, type GeneratedApk, type GeneratedApksPerVersion, type Grant, type GrantsListResponse, type HttpClient, type Image, type ImageType, type ImageUploadResponse, type ImagesDeleteAllResponse, type ImagesListResponse, type InAppProduct, type InAppProductListing, type InAppProductsBatchDeleteRequest, type InAppProductsBatchGetRequest, type InAppProductsBatchUpdateRequest, type InAppProductsBatchUpdateResponse, type InAppProductsListResponse, type InternalAppSharingArtifact, type Leaderboard, type LeaderboardScore, type Listing, type ListingsListResponse, type MetricRow, type MetricSetQuery, type MetricSetResponse, type Money, type MutationOptions, type OffersListResponse, type OneTimeOffer, type OneTimeOfferRegionalConfig, type OneTimeOffersListResponse, type OneTimeProduct, type OneTimeProductListing, type OneTimeProductsListResponse, type Order, type OrderLineItem, type PagedResponse, type PaginateOptions, type PlayApiClient, PlayApiError, type ProductPurchase, type ProductPurchaseLineItem, type ProductPurchaseV2, type ProductUpdateLatencyTolerance, type PurchaseOption, type PurchaseOptionsListResponse, RATE_LIMIT_BUCKETS, RESUMABLE_THRESHOLD, type RateLimitBucket, type RateLimiter, type RegionalBasePlanConfig, type Release, type ReleaseNote, type ReleaseStatus, type ReleaseSummary, type ReleasesListResponse, type ReportBucket, type ReportType, type ReportingAggregation, type ReportingApiClient, type ReportingDimension, type ReportsListResponse, type ResumableUploadOptions, type RetryLogEntry, type Review, type ReviewComment, type ReviewReplyRequest, type ReviewReplyResponse, type ReviewsListOptions, type ReviewsListResponse, type StatsDimension, type Subscription, type SubscriptionDeferRequest, type SubscriptionDeferResponse, type SubscriptionListing, type SubscriptionOffer, type SubscriptionOfferPhase, type SubscriptionPurchase, type SubscriptionPurchaseLineItem, type SubscriptionPurchaseV2, type SubscriptionsBatchGetRequest, type SubscriptionsBatchGetResponse, type SubscriptionsBatchUpdateRequest, type SubscriptionsBatchUpdateResponse, type SubscriptionsListResponse, type SubscriptionsV2CancelRequest, type SubscriptionsV2DeferRequest, type SubscriptionsV2DeferResponse, type TaxAndComplianceSettings, type Testers, type TokenPagination, type Track, type TrackListResponse, type UploadProgressEvent, type UploadResponse, type User, type UserComment, type UsersApiClient, type UsersListResponse, type VitalsMetricSet, type VoidedPurchase, type VoidedPurchasesListResponse, createApiClient, createEnterpriseClient, createGamesClient, createHttpClient, createRateLimiter, createReportingClient, createUsersClient, paginate, paginateAll, paginateParallel, resolveBucket };
package/dist/index.js CHANGED
@@ -549,6 +549,31 @@ function enhanceApiError(status, body) {
549
549
  ].join("\n")
550
550
  };
551
551
  }
552
+ if ((status === 403 || status === 400) && (errorMsg.includes("changes not sent for review") || errorMsg.includes("changesnotsentforreview") || errorMsg.includes("review") && errorMsg.includes("rejected"))) {
553
+ return {
554
+ code: "API_CHANGES_NOT_SENT_FOR_REVIEW",
555
+ message: "This app has a rejected update. The API requires explicit acknowledgement before committing changes.",
556
+ suggestion: [
557
+ "Add --changes-not-sent-for-review to your command:",
558
+ " gpc releases upload app.aab --track internal --changes-not-sent-for-review",
559
+ "",
560
+ "This applies your changes without sending them for review.",
561
+ "You must manually send for review from the Google Play Console when ready."
562
+ ].join("\n")
563
+ };
564
+ }
565
+ if (status === 400 && (errorMsg.includes("changes_already_in_review") || errorMsg.includes("already in review"))) {
566
+ return {
567
+ code: "API_CHANGES_ALREADY_IN_REVIEW",
568
+ message: "Changes are already in review. Committing this edit would cancel the existing review.",
569
+ suggestion: [
570
+ "Wait for the current review to complete, or re-run without --error-if-in-review",
571
+ "to cancel the existing review and submit new changes.",
572
+ "",
573
+ "To prevent accidental review cancellation in CI, keep --error-if-in-review."
574
+ ].join("\n")
575
+ };
576
+ }
552
577
  return void 0;
553
578
  }
554
579
  function mapStatusToError(status, body) {
@@ -1004,6 +1029,11 @@ function createRateLimiter(buckets) {
1004
1029
  }
1005
1030
 
1006
1031
  // src/client.ts
1032
+ var DEFAULT_REGIONS_VERSION = "2022/02";
1033
+ function applyMutationOptions(params, options) {
1034
+ if (options?.allowMissing) params["allowMissing"] = "true";
1035
+ if (options?.latencyTolerance) params["latencyTolerance"] = options.latencyTolerance;
1036
+ }
1007
1037
  async function autoRateLimit(limiter, path) {
1008
1038
  if (!limiter) return;
1009
1039
  const bucket = resolveBucket(path);
@@ -1050,8 +1080,15 @@ function createApiClient(options) {
1050
1080
  const { data } = await http.post(`/${packageName}/edits/${editId}:validate`);
1051
1081
  return data;
1052
1082
  },
1053
- async commit(packageName, editId) {
1054
- const { data } = await http.post(`/${packageName}/edits/${editId}:commit`);
1083
+ async commit(packageName, editId, options2) {
1084
+ let path = `/${packageName}/edits/${editId}:commit`;
1085
+ if (options2?.changesNotSentForReview || options2?.changesInReviewBehavior) {
1086
+ const params = new URLSearchParams();
1087
+ if (options2.changesNotSentForReview) params.set("changesNotSentForReview", "true");
1088
+ if (options2.changesInReviewBehavior) params.set("changesInReviewBehavior", options2.changesInReviewBehavior);
1089
+ path += `?${params.toString()}`;
1090
+ }
1091
+ const { data } = await http.post(path);
1055
1092
  return data;
1056
1093
  },
1057
1094
  async delete(packageName, editId) {
@@ -1085,9 +1122,13 @@ function createApiClient(options) {
1085
1122
  );
1086
1123
  return data.bundles;
1087
1124
  },
1088
- async upload(packageName, editId, filePath, uploadOptions) {
1125
+ async upload(packageName, editId, filePath, uploadOptions, deviceTierConfigId) {
1126
+ let bundlePath = `/${packageName}/edits/${editId}/bundles`;
1127
+ if (deviceTierConfigId) {
1128
+ bundlePath += `?${new URLSearchParams({ deviceTierConfigId }).toString()}`;
1129
+ }
1089
1130
  const { data } = await http.uploadResumable(
1090
- `/${packageName}/edits/${editId}/bundles`,
1131
+ bundlePath,
1091
1132
  filePath,
1092
1133
  "application/octet-stream",
1093
1134
  uploadOptions
@@ -1244,6 +1285,36 @@ function createApiClient(options) {
1244
1285
  return data.deleted || [];
1245
1286
  }
1246
1287
  },
1288
+ expansionFiles: {
1289
+ async get(packageName, editId, apkVersionCode, expansionFileType) {
1290
+ const { data } = await http.get(
1291
+ `/${packageName}/edits/${editId}/apks/${apkVersionCode}/expansionFiles/${expansionFileType}`
1292
+ );
1293
+ return data;
1294
+ },
1295
+ async update(packageName, editId, apkVersionCode, expansionFileType, body) {
1296
+ const { data } = await http.put(
1297
+ `/${packageName}/edits/${editId}/apks/${apkVersionCode}/expansionFiles/${expansionFileType}`,
1298
+ body
1299
+ );
1300
+ return data;
1301
+ },
1302
+ async patch(packageName, editId, apkVersionCode, expansionFileType, body) {
1303
+ const { data } = await http.patch(
1304
+ `/${packageName}/edits/${editId}/apks/${apkVersionCode}/expansionFiles/${expansionFileType}`,
1305
+ body
1306
+ );
1307
+ return data;
1308
+ },
1309
+ async upload(packageName, editId, apkVersionCode, expansionFileType, filePath) {
1310
+ const { data } = await http.upload(
1311
+ `/${packageName}/edits/${editId}/apks/${apkVersionCode}/expansionFiles/${expansionFileType}`,
1312
+ filePath,
1313
+ "application/octet-stream"
1314
+ );
1315
+ return data.expansionFile;
1316
+ }
1317
+ },
1247
1318
  countryAvailability: {
1248
1319
  async get(packageName, editId, track) {
1249
1320
  const { data } = await http.get(
@@ -1267,6 +1338,7 @@ function createApiClient(options) {
1267
1338
  const params = {};
1268
1339
  if (options2?.token) params["token"] = options2.token;
1269
1340
  if (options2?.maxResults) params["maxResults"] = String(options2.maxResults);
1341
+ if (options2?.startIndex !== void 0) params["startIndex"] = String(options2.startIndex);
1270
1342
  if (options2?.translationLanguage)
1271
1343
  params["translationLanguage"] = options2.translationLanguage;
1272
1344
  const hasParams = Object.keys(params).length > 0;
@@ -1311,18 +1383,19 @@ function createApiClient(options) {
1311
1383
  const { data } = await http.get(`/${packageName}/subscriptions/${productId}`);
1312
1384
  return data;
1313
1385
  },
1314
- async create(packageName, body, productId) {
1386
+ async create(packageName, body, productId, regionsVersion) {
1315
1387
  const params = {};
1316
1388
  if (productId) params["productId"] = productId;
1317
- params["regionsVersion.version"] = "2022/02";
1389
+ params["regionsVersion.version"] = regionsVersion || DEFAULT_REGIONS_VERSION;
1318
1390
  const path = `/${packageName}/subscriptions?${new URLSearchParams(params).toString()}`;
1319
1391
  const { data } = await http.post(path, body);
1320
1392
  return data;
1321
1393
  },
1322
- async update(packageName, productId, body, updateMask, regionsVersion) {
1394
+ async update(packageName, productId, body, updateMask, regionsVersion, options2) {
1323
1395
  const params = {};
1324
1396
  if (updateMask) params["updateMask"] = updateMask;
1325
- params["regionsVersion.version"] = regionsVersion || "2022/02";
1397
+ params["regionsVersion.version"] = regionsVersion || DEFAULT_REGIONS_VERSION;
1398
+ applyMutationOptions(params, options2);
1326
1399
  const path = `/${packageName}/subscriptions/${productId}?${new URLSearchParams(params).toString()}`;
1327
1400
  const { data } = await http.patch(path, body);
1328
1401
  return data;
@@ -1378,18 +1451,19 @@ function createApiClient(options) {
1378
1451
  );
1379
1452
  return data;
1380
1453
  },
1381
- async createOffer(packageName, productId, basePlanId, body, offerId) {
1454
+ async createOffer(packageName, productId, basePlanId, body, offerId, regionsVersion) {
1382
1455
  const params = {};
1383
1456
  if (offerId) params["offerId"] = offerId;
1384
- params["regionsVersion.version"] = "2022/02";
1457
+ params["regionsVersion.version"] = regionsVersion || DEFAULT_REGIONS_VERSION;
1385
1458
  const path = `/${packageName}/subscriptions/${productId}/basePlans/${basePlanId}/offers?${new URLSearchParams(params).toString()}`;
1386
1459
  const { data } = await http.post(path, body);
1387
1460
  return data;
1388
1461
  },
1389
- async updateOffer(packageName, productId, basePlanId, offerId, body, updateMask, regionsVersion) {
1462
+ async updateOffer(packageName, productId, basePlanId, offerId, body, updateMask, regionsVersion, options2) {
1390
1463
  const params = {};
1391
1464
  if (updateMask) params["updateMask"] = updateMask;
1392
- params["regionsVersion.version"] = regionsVersion || "2022/02";
1465
+ params["regionsVersion.version"] = regionsVersion || DEFAULT_REGIONS_VERSION;
1466
+ applyMutationOptions(params, options2);
1393
1467
  const path = `/${packageName}/subscriptions/${productId}/basePlans/${basePlanId}/offers/${offerId}?${new URLSearchParams(params).toString()}`;
1394
1468
  const { data } = await http.patch(path, body);
1395
1469
  return data;
@@ -1645,9 +1719,10 @@ function createApiClient(options) {
1645
1719
  }
1646
1720
  },
1647
1721
  deobfuscation: {
1648
- async upload(packageName, editId, versionCode, filePath) {
1722
+ async upload(packageName, editId, versionCode, filePath, fileType) {
1723
+ const deobType = fileType || "proguard";
1649
1724
  const { data } = await http.upload(
1650
- `/${packageName}/edits/${editId}/apks/${versionCode}/deobfuscationFiles/proguard`,
1725
+ `/${packageName}/edits/${editId}/apks/${versionCode}/deobfuscationFiles/${deobType}`,
1651
1726
  filePath,
1652
1727
  "application/octet-stream"
1653
1728
  );
@@ -1738,9 +1813,14 @@ function createApiClient(options) {
1738
1813
  }
1739
1814
  },
1740
1815
  oneTimeProducts: {
1741
- async list(packageName) {
1816
+ async list(packageName, options2) {
1817
+ const params = {};
1818
+ if (options2?.pageToken) params["pageToken"] = options2.pageToken;
1819
+ if (options2?.pageSize) params["pageSize"] = String(options2.pageSize);
1820
+ const hasParams = Object.keys(params).length > 0;
1742
1821
  const { data } = await http.get(
1743
- `/${packageName}/oneTimeProducts`
1822
+ `/${packageName}/oneTimeProducts`,
1823
+ hasParams ? params : void 0
1744
1824
  );
1745
1825
  return data;
1746
1826
  },
@@ -1750,18 +1830,19 @@ function createApiClient(options) {
1750
1830
  );
1751
1831
  return data;
1752
1832
  },
1753
- async create(packageName, body) {
1754
- const params = new URLSearchParams({ "regionsVersion.version": "2022/02" });
1833
+ async create(packageName, body, regionsVersion) {
1834
+ const params = new URLSearchParams({ "regionsVersion.version": regionsVersion || DEFAULT_REGIONS_VERSION });
1755
1835
  const { data } = await http.post(
1756
1836
  `/${packageName}/oneTimeProducts?${params.toString()}`,
1757
1837
  body
1758
1838
  );
1759
1839
  return data;
1760
1840
  },
1761
- async update(packageName, productId, body, updateMask, regionsVersion) {
1841
+ async update(packageName, productId, body, updateMask, regionsVersion, options2) {
1762
1842
  const params = {};
1763
1843
  if (updateMask) params["updateMask"] = updateMask;
1764
- params["regionsVersion.version"] = regionsVersion || "2022/02";
1844
+ params["regionsVersion.version"] = regionsVersion || DEFAULT_REGIONS_VERSION;
1845
+ applyMutationOptions(params, options2);
1765
1846
  const path = `/${packageName}/oneTimeProducts/${productId}?${new URLSearchParams(params).toString()}`;
1766
1847
  const { data } = await http.patch(path, body);
1767
1848
  return data;
@@ -1781,17 +1862,19 @@ function createApiClient(options) {
1781
1862
  );
1782
1863
  return data;
1783
1864
  },
1784
- async createOffer(packageName, productId, body) {
1865
+ async createOffer(packageName, productId, body, regionsVersion) {
1866
+ const params = new URLSearchParams({ "regionsVersion.version": regionsVersion || DEFAULT_REGIONS_VERSION });
1785
1867
  const { data } = await http.post(
1786
- `/${packageName}/oneTimeProducts/${productId}/offers`,
1868
+ `/${packageName}/oneTimeProducts/${productId}/offers?${params.toString()}`,
1787
1869
  body
1788
1870
  );
1789
1871
  return data;
1790
1872
  },
1791
- async updateOffer(packageName, productId, offerId, body, updateMask, regionsVersion) {
1873
+ async updateOffer(packageName, productId, offerId, body, updateMask, regionsVersion, options2) {
1792
1874
  const params = {};
1793
1875
  if (updateMask) params["updateMask"] = updateMask;
1794
- params["regionsVersion.version"] = regionsVersion || "2022/02";
1876
+ params["regionsVersion.version"] = regionsVersion || DEFAULT_REGIONS_VERSION;
1877
+ applyMutationOptions(params, options2);
1795
1878
  const path = `/${packageName}/oneTimeProducts/${productId}/offers/${offerId}?${new URLSearchParams(params).toString()}`;
1796
1879
  const { data } = await http.patch(path, body);
1797
1880
  return data;