@gpc-cli/core 0.9.69 → 0.9.71

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
@@ -527,8 +527,8 @@ declare function listSubscriptions(client: PlayApiClient, packageName: string, o
527
527
  nextPageToken?: string;
528
528
  }>;
529
529
  declare function getSubscription(client: PlayApiClient, packageName: string, productId: string): Promise<Subscription>;
530
- declare function createSubscription(client: PlayApiClient, packageName: string, data: Subscription): Promise<Subscription>;
531
- declare function updateSubscription(client: PlayApiClient, packageName: string, productId: string, data: Subscription, updateMask?: string): Promise<Subscription>;
530
+ declare function createSubscription(client: PlayApiClient, packageName: string, data: Subscription, regionsVersion?: string): Promise<Subscription>;
531
+ declare function updateSubscription(client: PlayApiClient, packageName: string, productId: string, data: Subscription, updateMask?: string, regionsVersion?: string): Promise<Subscription>;
532
532
  declare function deleteSubscription(client: PlayApiClient, packageName: string, productId: string): Promise<void>;
533
533
  declare function activateBasePlan(client: PlayApiClient, packageName: string, productId: string, basePlanId: string): Promise<Subscription>;
534
534
  declare function deactivateBasePlan(client: PlayApiClient, packageName: string, productId: string, basePlanId: string): Promise<Subscription>;
@@ -536,8 +536,8 @@ declare function deleteBasePlan(client: PlayApiClient, packageName: string, prod
536
536
  declare function migratePrices(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, data: BasePlanMigratePricesRequest): Promise<void>;
537
537
  declare function listOffers(client: PlayApiClient, packageName: string, productId: string, basePlanId: string): Promise<OffersListResponse>;
538
538
  declare function getOffer(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, offerId: string): Promise<SubscriptionOffer>;
539
- declare function createOffer(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, data: SubscriptionOffer): Promise<SubscriptionOffer>;
540
- declare function updateOffer(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, offerId: string, data: SubscriptionOffer, updateMask?: string): Promise<SubscriptionOffer>;
539
+ declare function createOffer(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, data: SubscriptionOffer, regionsVersion?: string): Promise<SubscriptionOffer>;
540
+ declare function updateOffer(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, offerId: string, data: SubscriptionOffer, updateMask?: string, regionsVersion?: string): Promise<SubscriptionOffer>;
541
541
  declare function deleteOffer(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, offerId: string): Promise<void>;
542
542
  declare function activateOffer(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, offerId: string): Promise<SubscriptionOffer>;
543
543
  interface SubscriptionDiff {
@@ -837,13 +837,13 @@ declare function createDeviceTier(client: PlayApiClient, packageName: string, co
837
837
 
838
838
  declare function listOneTimeProducts(client: PlayApiClient, packageName: string): Promise<OneTimeProductsListResponse>;
839
839
  declare function getOneTimeProduct(client: PlayApiClient, packageName: string, productId: string): Promise<OneTimeProduct>;
840
- declare function createOneTimeProduct(client: PlayApiClient, packageName: string, data: OneTimeProduct): Promise<OneTimeProduct>;
841
- declare function updateOneTimeProduct(client: PlayApiClient, packageName: string, productId: string, data: Partial<OneTimeProduct>, updateMask?: string): Promise<OneTimeProduct>;
840
+ declare function createOneTimeProduct(client: PlayApiClient, packageName: string, data: OneTimeProduct, regionsVersion?: string): Promise<OneTimeProduct>;
841
+ declare function updateOneTimeProduct(client: PlayApiClient, packageName: string, productId: string, data: Partial<OneTimeProduct>, updateMask?: string, regionsVersion?: string): Promise<OneTimeProduct>;
842
842
  declare function deleteOneTimeProduct(client: PlayApiClient, packageName: string, productId: string): Promise<void>;
843
843
  declare function listOneTimeOffers(client: PlayApiClient, packageName: string, productId: string, purchaseOptionId?: string): Promise<OneTimeOffersListResponse>;
844
844
  declare function getOneTimeOffer(client: PlayApiClient, packageName: string, productId: string, offerId: string, purchaseOptionId?: string): Promise<OneTimeOffer>;
845
- declare function createOneTimeOffer(client: PlayApiClient, packageName: string, productId: string, data: OneTimeOffer, purchaseOptionId?: string): Promise<OneTimeOffer>;
846
- declare function updateOneTimeOffer(client: PlayApiClient, packageName: string, productId: string, offerId: string, data: Partial<OneTimeOffer>, updateMask?: string, purchaseOptionId?: string): Promise<OneTimeOffer>;
845
+ declare function createOneTimeOffer(client: PlayApiClient, packageName: string, productId: string, data: OneTimeOffer, purchaseOptionId?: string, regionsVersion?: string): Promise<OneTimeOffer>;
846
+ declare function updateOneTimeOffer(client: PlayApiClient, packageName: string, productId: string, offerId: string, data: Partial<OneTimeOffer>, updateMask?: string, purchaseOptionId?: string, regionsVersion?: string): Promise<OneTimeOffer>;
847
847
  interface OneTimeProductDiff {
848
848
  field: string;
849
849
  local: string;
package/dist/index.js CHANGED
@@ -2262,23 +2262,23 @@ async function getSubscription(client, packageName, productId) {
2262
2262
  validateSku(productId);
2263
2263
  return client.subscriptions.get(packageName, productId);
2264
2264
  }
2265
- async function createSubscription(client, packageName, data) {
2265
+ async function createSubscription(client, packageName, data, regionsVersion) {
2266
2266
  validatePackageName(packageName);
2267
2267
  validateSubscriptionData(data);
2268
2268
  const sanitized = sanitizeSubscription(data);
2269
- return client.subscriptions.create(packageName, sanitized, data.productId);
2269
+ return client.subscriptions.create(packageName, sanitized, data.productId, regionsVersion);
2270
2270
  }
2271
2271
  var SUBSCRIPTION_ID_FIELDS = /* @__PURE__ */ new Set(["productId", "packageName"]);
2272
2272
  function deriveSubscriptionUpdateMask(data) {
2273
2273
  return Object.keys(data).filter((k) => !SUBSCRIPTION_ID_FIELDS.has(k)).join(",");
2274
2274
  }
2275
- async function updateSubscription(client, packageName, productId, data, updateMask) {
2275
+ async function updateSubscription(client, packageName, productId, data, updateMask, regionsVersion) {
2276
2276
  validatePackageName(packageName);
2277
2277
  validateSku(productId);
2278
2278
  validateSubscriptionData(data);
2279
2279
  const sanitized = sanitizeSubscription(data);
2280
2280
  const mask = updateMask || deriveSubscriptionUpdateMask(data);
2281
- return client.subscriptions.update(packageName, productId, sanitized, mask);
2281
+ return client.subscriptions.update(packageName, productId, sanitized, mask, regionsVersion);
2282
2282
  }
2283
2283
  async function deleteSubscription(client, packageName, productId) {
2284
2284
  validatePackageName(packageName);
@@ -2315,7 +2315,7 @@ async function getOffer(client, packageName, productId, basePlanId, offerId) {
2315
2315
  validateSku(productId);
2316
2316
  return client.subscriptions.getOffer(packageName, productId, basePlanId, offerId);
2317
2317
  }
2318
- async function createOffer(client, packageName, productId, basePlanId, data) {
2318
+ async function createOffer(client, packageName, productId, basePlanId, data, regionsVersion) {
2319
2319
  validatePackageName(packageName);
2320
2320
  validateSku(productId);
2321
2321
  const sanitized = sanitizeOffer(data);
@@ -2324,14 +2324,15 @@ async function createOffer(client, packageName, productId, basePlanId, data) {
2324
2324
  productId,
2325
2325
  basePlanId,
2326
2326
  sanitized,
2327
- data.offerId
2327
+ data.offerId,
2328
+ regionsVersion
2328
2329
  );
2329
2330
  }
2330
2331
  var OFFER_ID_FIELDS = /* @__PURE__ */ new Set(["productId", "basePlanId", "offerId"]);
2331
2332
  function deriveOfferUpdateMask(data) {
2332
2333
  return Object.keys(data).filter((k) => !OFFER_ID_FIELDS.has(k)).join(",");
2333
2334
  }
2334
- async function updateOffer(client, packageName, productId, basePlanId, offerId, data, updateMask) {
2335
+ async function updateOffer(client, packageName, productId, basePlanId, offerId, data, updateMask, regionsVersion) {
2335
2336
  validatePackageName(packageName);
2336
2337
  validateSku(productId);
2337
2338
  const sanitized = sanitizeOffer(data);
@@ -2342,7 +2343,8 @@ async function updateOffer(client, packageName, productId, basePlanId, offerId,
2342
2343
  basePlanId,
2343
2344
  offerId,
2344
2345
  sanitized,
2345
- mask
2346
+ mask,
2347
+ regionsVersion
2346
2348
  );
2347
2349
  }
2348
2350
  async function deleteOffer(client, packageName, productId, basePlanId, offerId) {
@@ -4233,9 +4235,9 @@ async function getOneTimeProduct(client, packageName, productId) {
4233
4235
  );
4234
4236
  }
4235
4237
  }
4236
- async function createOneTimeProduct(client, packageName, data) {
4238
+ async function createOneTimeProduct(client, packageName, data, regionsVersion) {
4237
4239
  try {
4238
- return await client.oneTimeProducts.create(packageName, data);
4240
+ return await client.oneTimeProducts.create(packageName, data, regionsVersion);
4239
4241
  } catch (error) {
4240
4242
  throw new GpcError(
4241
4243
  `Failed to create one-time product: ${error instanceof Error ? error.message : String(error)}`,
@@ -4253,10 +4255,10 @@ var OTP_OFFER_ID_FIELDS = /* @__PURE__ */ new Set(["packageName", "productId", "
4253
4255
  function deriveOtpOfferUpdateMask(data) {
4254
4256
  return Object.keys(data).filter((k) => !OTP_OFFER_ID_FIELDS.has(k)).join(",");
4255
4257
  }
4256
- async function updateOneTimeProduct(client, packageName, productId, data, updateMask) {
4258
+ async function updateOneTimeProduct(client, packageName, productId, data, updateMask, regionsVersion) {
4257
4259
  try {
4258
4260
  const mask = updateMask || deriveOtpUpdateMask(data);
4259
- return await client.oneTimeProducts.update(packageName, productId, data, mask);
4261
+ return await client.oneTimeProducts.update(packageName, productId, data, mask, regionsVersion);
4260
4262
  } catch (error) {
4261
4263
  throw new GpcError(
4262
4264
  `Failed to update one-time product "${productId}": ${error instanceof Error ? error.message : String(error)}`,
@@ -4302,9 +4304,15 @@ async function getOneTimeOffer(client, packageName, productId, offerId, purchase
4302
4304
  );
4303
4305
  }
4304
4306
  }
4305
- async function createOneTimeOffer(client, packageName, productId, data, purchaseOptionId = "-") {
4307
+ async function createOneTimeOffer(client, packageName, productId, data, purchaseOptionId = "-", regionsVersion) {
4306
4308
  try {
4307
- return await client.oneTimeProducts.createOffer(packageName, productId, purchaseOptionId, data);
4309
+ return await client.oneTimeProducts.createOffer(
4310
+ packageName,
4311
+ productId,
4312
+ purchaseOptionId,
4313
+ data,
4314
+ regionsVersion
4315
+ );
4308
4316
  } catch (error) {
4309
4317
  throw new GpcError(
4310
4318
  `Failed to create offer for product "${productId}": ${error instanceof Error ? error.message : String(error)}`,
@@ -4314,7 +4322,7 @@ async function createOneTimeOffer(client, packageName, productId, data, purchase
4314
4322
  );
4315
4323
  }
4316
4324
  }
4317
- async function updateOneTimeOffer(client, packageName, productId, offerId, data, updateMask, purchaseOptionId = "-") {
4325
+ async function updateOneTimeOffer(client, packageName, productId, offerId, data, updateMask, purchaseOptionId = "-", regionsVersion) {
4318
4326
  try {
4319
4327
  const mask = updateMask || deriveOtpOfferUpdateMask(data);
4320
4328
  return await client.oneTimeProducts.updateOffer(
@@ -4323,7 +4331,8 @@ async function updateOneTimeOffer(client, packageName, productId, offerId, data,
4323
4331
  purchaseOptionId,
4324
4332
  offerId,
4325
4333
  data,
4326
- mask
4334
+ mask,
4335
+ regionsVersion
4327
4336
  );
4328
4337
  } catch (error) {
4329
4338
  throw new GpcError(