Files
sim/apps/docs
Waleed 38cbefdc3b fix(revenuecat): align tools and block with REST v1 API spec (#4488)
* fix(revenuecat): align tools and block with REST v1 API spec

- Validated all 10 tools and the block against context7 REST v1 docs
- Unwrap {value:{subscriber}} envelope across post-receipts, attributes,
  entitlements, and Google subscription endpoints
- Trim entitlement output to documented fields (expires_date,
  grace_period_expires_date, product_identifier, purchase_date)
- Add subscriber output fields: last_seen, original_application_version,
  other_purchases, subscriber_attributes
- create_purchase: productId optional (Google-only required); add
  introductoryPrice, attributes, updated_at_ms; surface customer + subscriber;
  X-Platform required; presentedOfferingIdentifier and paymentMode
- update_subscriber_attributes: read response and surface subscriber;
  note required updated_at_ms
- defer_google_subscription: enforce XOR(extendByDays, expiryTimeMs) and
  1-365 range; expiryTimeMs as one-of alternative
- grant_entitlement: duration optional, added endTimeMs (one-of)
- refund_google_subscription: corrected endpoint to
  /transactions/{storeTransactionId}/refund
- delete_customer: read 'deleted' field (was 'was_deleted')
- list_offerings: corrected X-Platform values
- get_customer: count active subscriptions by expiry/refund
- Added shared throwIfRevenueCatError helper for {code, message} envelope
- Moved type coercions from tools.config.tool to tools.config.params to
  preserve dynamic refs

* docs

* fix(revenuecat): address PR review feedback

- create_purchase: wrap JSON.parse(attributes) with try/catch and clear error
- update_subscriber_attributes: drop subscriber output (endpoint returns
  empty body) and guard JSON.parse on attributes
- grant_entitlement: throw when both duration and endTimeMs are provided,
  matching defer_google_subscription behavior

* fix(revenuecat): tighten docs after sub-segment validation

- delete_customer: drop dead was_deleted fallback (docs specify 'deleted')
- grant_entitlement: mark duration + startTimeMs as deprecated, clarify
  startTimeMs only affects expiration calc (not grant time)
- list_offerings: replace vague platform description with documented
  X-Platform enum (ios, android, amazon, stripe, roku, paddle)

* docs

* fix(revenuecat): clear duration default when endTimeMs is provided

The duration dropdown defaults to 'monthly' so any user filling in the
advanced endTimeMs field would otherwise hit the XOR guard. Clear
duration in the params mapper so endTimeMs takes precedence.

* fix(revenuecat): clear extendByDays default when expiryTimeMs is provided

Mirror the duration/endTimeMs fix from 8204e89: when expiryTimeMs is
populated, clear extendByDays in the params mapper so the empty-string
form value does not trip the XOR guard. Also harden the tool-level XOR
checks in defer_google_subscription and grant_entitlement to treat empty
strings as undefined for direct (non-block) callers.

* fix(revenuecat): guard NaN in time-ms mappers and require integer days

- Block params mapper: only clear duration/extendByDays when the parsed
  endTimeMs/expiryTimeMs is finite, so invalid input does not silently
  discard the user's valid companion default
- defer_google_subscription: validate extendByDays as integer (was
  Number.isFinite), matching the error message

* fix(revenuecat): fall back to Date.now() when request_date is malformed

A malformed request_date would parse to NaN, making every entitlement
and subscription compare false and silently zero active counts. Fall
back to Date.now() when the parsed value is not finite.

* fix(revenuecat): unwrap value envelope in list_offerings response

* improvement(revenuecat): include updated_at_ms in attributes placeholder and wand prompt
2026-05-07 13:06:13 -07:00
..
2026-02-16 00:00:12 -08:00

docs

This is a Next.js application generated with Create Fumadocs.

Run development server:

bun run dev

Open http://localhost:3000 with your browser to see the result.

Learn More

To learn more about Next.js and Fumadocs, take a look at the following resources: