mirror of
https://github.com/stack-auth/stack.git
synced 2026-07-20 21:29:36 +08:00
<!--
Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/hexclave/hexclave/blob/dev/CONTRIBUTING.md
-->
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Removed product-level free trials; free trials are now configured per
price. Adds backward-compat for legacy inline inputs and migrates
existing config so current trials keep working.
- **Refactors**
- Enforce price-level trials in `productSchema` and
`inlineProductSchema` (remove product `freeTrial`/`free_trial`).
- Accept legacy inline product `free_trial` via
`inlineProductSchemaWithLegacyProductLevelFreeTrial`, then migrate with
`normalizeInlineProductLegacyProductLevelFreeTrial` before use.
- Updated API routes to use the new schema/normalizer; added E2E tests
for migration on grant and purchase validation.
- Removed product-level trial UI columns and prompts in the dashboard.
- Removed product-level trial fields from OpenAPI specs and updated docs
to price-level only.
- Config migration (`packages/shared/src/config/schema.ts`) moves
`payments.products.*.freeTrial` onto each defined price and strips the
product-level field.
- **Migration**
- Move any product-level `freeTrial`/`free_trial` to each price:
`payments.products.<productId>.prices.<priceId>.freeTrial`.
- Existing overrides are auto-migrated; price-specific values take
precedence.
- Inline API callers can still send legacy `free_trial`; it is migrated
server-side, but should be removed from clients going forward.
<sup>Written for commit 1d29d402fe.
Summary will update on new commits.</sup>
<a
href="https://cubic.dev/pr/hexclave/hexclave/pull/1722?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->