@odla-ai/chapter 0.54.2 → 0.56.0

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.cts CHANGED
@@ -110,6 +110,10 @@ interface JoinConfigTier {
110
110
  free: boolean;
111
111
  /** The network authority's current founding promise for this tier, read before anyone applies. */
112
112
  founding?: JoinTierFounding;
113
+ /** Current additional-member offer; checkout freezes and confirms this price. */
114
+ seatOffer?: {
115
+ amountCents: number;
116
+ };
113
117
  }
114
118
  /** What the join page may say about the founding rate today; checkout confirms it on the issued offer. */
115
119
  interface JoinTierFounding {
@@ -123,7 +127,9 @@ interface JoinTierFounding {
123
127
  declare function joinConfigTiers(tiers: readonly ChapterTier[], defaults?: {
124
128
  currency?: string;
125
129
  interval?: "year" | "month";
126
- }, founding?: ReadonlyMap<string, JoinTierFounding>): JoinConfigTier[];
130
+ }, founding?: ReadonlyMap<string, JoinTierFounding>, seats?: ReadonlyMap<string, {
131
+ amountCents: number;
132
+ }>): JoinConfigTier[];
127
133
 
128
134
  /** A code-declared mail event. Copy stays in settings; this describes who receives it and the values the event supplies. */
129
135
  interface ChapterEmailEvent {
@@ -1508,6 +1514,8 @@ interface MembershipOfferPreview {
1508
1514
  renewalCents: number;
1509
1515
  discountDuration?: "first_term" | "while_active";
1510
1516
  initialTermEndsAt?: number;
1517
+ /** Current additional-member price, including zero for an included member. */
1518
+ seatPriceCents?: number;
1511
1519
  }
1512
1520
  /** The current published offering and founding policy for one SKU, computed exactly as issuance computes them.
1513
1521
  * Nothing is written, so a preview can never reserve a founding position or drift from the offer a member later accepts. */
@@ -1551,6 +1559,21 @@ declare const MEMBERSHIP_AUTHORITY_PATH = "/api/membership-authority";
1551
1559
  */
1552
1560
  declare function createMembershipAuthorityHandler(options: MembershipAuthorityHandlerOptions): (req: Request) => Promise<Response>;
1553
1561
 
1562
+ /** The optional recipient selected before the applicant consents to payment. */
1563
+ interface CheckoutNamedSeatSelection {
1564
+ recipientName: string;
1565
+ recipientEmail: string;
1566
+ }
1567
+ /** Authority-owned provider allocation for the seat on the initial subscription. */
1568
+ interface CheckoutNamedSeat extends CheckoutNamedSeatSelection {
1569
+ purchaserEmail: string;
1570
+ seatId: string;
1571
+ membershipId: string;
1572
+ recipientClaimId: string;
1573
+ priceId: string;
1574
+ amountCents: number;
1575
+ }
1576
+
1554
1577
  /** Per-tier policy overrides prevent a chapter-wide price claim leaking into another SKU. */
1555
1578
  interface TierPaymentPolicy {
1556
1579
  refundPolicyText: string;
@@ -1590,11 +1613,15 @@ interface MembershipCheckoutBindingInput extends MembershipQuoteTarget {
1590
1613
  offerDigest: string;
1591
1614
  quoteDigest: string;
1592
1615
  priceId: string;
1616
+ namedSeat?: CheckoutNamedSeatSelection & {
1617
+ purchaserEmail: string;
1618
+ };
1593
1619
  }
1594
- /** Content-free authority receipt. It does not mean paid, approved, or entitled. */
1620
+ /** Frozen authority receipt, including any named recipient. It does not mean paid, approved, or entitled. */
1595
1621
  interface MembershipCheckoutBinding extends MembershipCheckoutBindingInput {
1596
1622
  id: string;
1597
1623
  boundAt: number;
1624
+ namedSeat?: CheckoutNamedSeat;
1598
1625
  }
1599
1626
  /** Stable per-application binding identity, separate from an individual offer generation. */
1600
1627
  declare function membershipCheckoutBindingId(input: MembershipQuoteTarget): Promise<string>;
@@ -1604,7 +1631,7 @@ declare function verifyMembershipCheckoutBinding(value: unknown, input: Membersh
1604
1631
  * Replays preserve an already-bound offer after its issuance window ends.
1605
1632
  * A different offer/Price/consent for the same application is never a second purchase.
1606
1633
  */
1607
- declare function bindMembershipCheckout(db: ChapterDb, input: MembershipCheckoutBindingInput, now: number): Promise<MembershipCheckoutBinding>;
1634
+ declare function bindMembershipCheckout(db: ChapterDb, input: MembershipCheckoutBindingInput, now: number, seatPriceId?: string): Promise<MembershipCheckoutBinding>;
1608
1635
 
1609
1636
  /** References only. Money facts must already exist in the verified network Stripe event log. */
1610
1637
  interface ConfirmMembershipPaymentInput extends MembershipQuoteTarget {
package/dist/index.d.ts CHANGED
@@ -110,6 +110,10 @@ interface JoinConfigTier {
110
110
  free: boolean;
111
111
  /** The network authority's current founding promise for this tier, read before anyone applies. */
112
112
  founding?: JoinTierFounding;
113
+ /** Current additional-member offer; checkout freezes and confirms this price. */
114
+ seatOffer?: {
115
+ amountCents: number;
116
+ };
113
117
  }
114
118
  /** What the join page may say about the founding rate today; checkout confirms it on the issued offer. */
115
119
  interface JoinTierFounding {
@@ -123,7 +127,9 @@ interface JoinTierFounding {
123
127
  declare function joinConfigTiers(tiers: readonly ChapterTier[], defaults?: {
124
128
  currency?: string;
125
129
  interval?: "year" | "month";
126
- }, founding?: ReadonlyMap<string, JoinTierFounding>): JoinConfigTier[];
130
+ }, founding?: ReadonlyMap<string, JoinTierFounding>, seats?: ReadonlyMap<string, {
131
+ amountCents: number;
132
+ }>): JoinConfigTier[];
127
133
 
128
134
  /** A code-declared mail event. Copy stays in settings; this describes who receives it and the values the event supplies. */
129
135
  interface ChapterEmailEvent {
@@ -1508,6 +1514,8 @@ interface MembershipOfferPreview {
1508
1514
  renewalCents: number;
1509
1515
  discountDuration?: "first_term" | "while_active";
1510
1516
  initialTermEndsAt?: number;
1517
+ /** Current additional-member price, including zero for an included member. */
1518
+ seatPriceCents?: number;
1511
1519
  }
1512
1520
  /** The current published offering and founding policy for one SKU, computed exactly as issuance computes them.
1513
1521
  * Nothing is written, so a preview can never reserve a founding position or drift from the offer a member later accepts. */
@@ -1551,6 +1559,21 @@ declare const MEMBERSHIP_AUTHORITY_PATH = "/api/membership-authority";
1551
1559
  */
1552
1560
  declare function createMembershipAuthorityHandler(options: MembershipAuthorityHandlerOptions): (req: Request) => Promise<Response>;
1553
1561
 
1562
+ /** The optional recipient selected before the applicant consents to payment. */
1563
+ interface CheckoutNamedSeatSelection {
1564
+ recipientName: string;
1565
+ recipientEmail: string;
1566
+ }
1567
+ /** Authority-owned provider allocation for the seat on the initial subscription. */
1568
+ interface CheckoutNamedSeat extends CheckoutNamedSeatSelection {
1569
+ purchaserEmail: string;
1570
+ seatId: string;
1571
+ membershipId: string;
1572
+ recipientClaimId: string;
1573
+ priceId: string;
1574
+ amountCents: number;
1575
+ }
1576
+
1554
1577
  /** Per-tier policy overrides prevent a chapter-wide price claim leaking into another SKU. */
1555
1578
  interface TierPaymentPolicy {
1556
1579
  refundPolicyText: string;
@@ -1590,11 +1613,15 @@ interface MembershipCheckoutBindingInput extends MembershipQuoteTarget {
1590
1613
  offerDigest: string;
1591
1614
  quoteDigest: string;
1592
1615
  priceId: string;
1616
+ namedSeat?: CheckoutNamedSeatSelection & {
1617
+ purchaserEmail: string;
1618
+ };
1593
1619
  }
1594
- /** Content-free authority receipt. It does not mean paid, approved, or entitled. */
1620
+ /** Frozen authority receipt, including any named recipient. It does not mean paid, approved, or entitled. */
1595
1621
  interface MembershipCheckoutBinding extends MembershipCheckoutBindingInput {
1596
1622
  id: string;
1597
1623
  boundAt: number;
1624
+ namedSeat?: CheckoutNamedSeat;
1598
1625
  }
1599
1626
  /** Stable per-application binding identity, separate from an individual offer generation. */
1600
1627
  declare function membershipCheckoutBindingId(input: MembershipQuoteTarget): Promise<string>;
@@ -1604,7 +1631,7 @@ declare function verifyMembershipCheckoutBinding(value: unknown, input: Membersh
1604
1631
  * Replays preserve an already-bound offer after its issuance window ends.
1605
1632
  * A different offer/Price/consent for the same application is never a second purchase.
1606
1633
  */
1607
- declare function bindMembershipCheckout(db: ChapterDb, input: MembershipCheckoutBindingInput, now: number): Promise<MembershipCheckoutBinding>;
1634
+ declare function bindMembershipCheckout(db: ChapterDb, input: MembershipCheckoutBindingInput, now: number, seatPriceId?: string): Promise<MembershipCheckoutBinding>;
1608
1635
 
1609
1636
  /** References only. Money facts must already exist in the verified network Stripe event log. */
1610
1637
  interface ConfirmMembershipPaymentInput extends MembershipQuoteTarget {