- 稳定性
- 稳定
- 作用域
- 按租户隔离
- 边界
- packages/commerce/contracts
contractspackages/commerce/contracts
记录系统类型化事件契约
| 事件类型 | Payload Schema | 状态 |
|---|---|---|
| invoice.paid | InvoicePaidV2 | 稳定 |
| subscription.created | SubscriptionV3 | 稳定 |
| subscription.canceled | SubscriptionV3 | 稳定 |
| checkout.expired | CheckoutV1 | Beta |
总交易额
$1.24M
活跃记录
8,472
环比增长
+8.4%
成功率
99.6%
packages/commerce/contracts·商业记录
使用方式contracts.ts
typescriptcontracts.ts
1import type { BillingEvent, IdentityEvent } from "@nebutra/contracts";
2
3// Cross-package contracts — TypeScript-validated event shapes.
4function onBilling(event: BillingEvent) {
5 if (event.type === "subscription.canceled") {
6 revokeAccess(event.payload.tenantId);
7 }
8}