play products: clamp regional prices to Play's min/max, per-product results; apple iap: skip live localizations, per-product results
This commit is contained in:
parent
882255a32f
commit
b0641c1fc8
12 changed files with 456 additions and 69 deletions
16
cli/lib/loc-lock.ts
Normal file
16
cli/lib/loc-lock.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// App Store Connect refuses to edit a localization that is already live: PATCH /v1/inAppPurchaseLocalizations/<id> (and
|
||||
// subscriptionLocalizations, subscriptionGroupLocalizations) answers 409 ENTITY_ERROR.ATTRIBUTE.INVALID.UNMODIFIABLE
|
||||
// "Cannot edit InAppPurchaseLocalization when it is in ACTIVE state" once the product was approved. The text then
|
||||
// changes only with the next review of the product (or a new localization). The localization's `state` is read, the
|
||||
// dry run marks such edits "not editable now" and the write skips them with a warning; a 409 of this kind that still
|
||||
// comes (a state we did not know) is skipped the same way instead of ending the run. Pure.
|
||||
|
||||
/** Localization states that cannot be edited (Apple's own error names ACTIVE; the API lists APPROVED). */
|
||||
const LOCKED = new Set(['ACTIVE', 'APPROVED']);
|
||||
|
||||
export const isLockedLocState = (state: unknown): boolean => typeof state === 'string' && LOCKED.has(state.toUpperCase());
|
||||
|
||||
export const lockedLocNote = (state: string): string => `not editable now (state ${state}; changes ship with the next review of the product / needs a new localization)`;
|
||||
|
||||
/** True for Apple's 409 UNMODIFIABLE answer to an edit of a live resource. */
|
||||
export const isUnmodifiableError = (e: unknown): boolean => /UNMODIFIABLE|Cannot edit \w+ when it is in \w+ state/i.test(e instanceof Error ? e.message : String(e));
|
||||
Loading…
Add table
Add a link
Reference in a new issue