@shipstatic/types 2.13.0-beta.1 → 2.15.0-beta.1

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/README.md CHANGED
@@ -102,7 +102,8 @@ import {
102
102
  import type {
103
103
  PlatformLimits, // per-request size limits from /limits (file size, file count, total size)
104
104
  Plan, PlansResponse, // the public plan menu from /plans
105
- BillingInterval, StripeSession,
105
+ BillingInterval, // 'month' | 'year' — Stripe's own recurring interval
106
+ CheckoutSession, BillingPortalSession, // the two hosted Stripe pages
106
107
  ActivityListResponse,
107
108
  PingResponse,
108
109
  } from '@shipstatic/types';
package/dist/index.d.ts CHANGED
@@ -610,15 +610,16 @@ export interface Account {
610
610
  */
611
611
  readonly used?: number | null;
612
612
  /**
613
- * True while the Stripe subscription's status is `past_due` and Stripe is
613
+ * True while the Stripe Subscription's status is `past_due` and Stripe is
614
614
  * still retrying the card. The plan is unchanged — the account keeps
615
615
  * everything it has — so this is a banner, not a gate.
616
616
  *
617
- * A BOOLEAN rather than the status string: one fact for the console to
618
- * act on. Stripe's own status word is mirrored on the account row for the
619
- * operator surface.
617
+ * A BOOLEAN rather than the status string: one fact for the console to act
618
+ * on. It carries STRIPE'S OWN WORD (`past_due` `pastDue`) rather than a
619
+ * synonym, so no reader has to hold a translation; the full status string is
620
+ * mirrored on the account row for the operator surface.
620
621
  */
621
- readonly overdue: boolean;
622
+ readonly pastDue: boolean;
622
623
  }
623
624
  /**
624
625
  * Account as returned by `GET /account` — the entity plus how the request
@@ -1770,13 +1771,20 @@ export interface Plan {
1770
1771
  /** Display name, as the marketing site and the console should print it. */
1771
1772
  readonly name: string;
1772
1773
  /**
1773
- * What it costs. A union rather than a nullable number, so "free" and
1774
- * "talk to us" are two different answers instead of two readings of the
1775
- * same `null`. Amounts are integer CENTS in USD, as the API's plan table
1776
- * states them and as Stripe's Prices are provisioned from it — the wire
1777
- * never carries a formatted price, because formatting is the reader's job.
1774
+ * What it costs, per interval integer CENTS in USD, as the API's plan
1775
+ * table states them and as Stripe's Prices are provisioned from it. The wire
1776
+ * never carries a formatted price: formatting is the reader's job.
1777
+ *
1778
+ * **A free plan costs `{ month: 0, year: 0 }`, not a sentinel.** Free IS
1779
+ * zero, so it is a number like any other and every reader formats it with
1780
+ * the same call; a `'free'` member bought one thing — a branch in each
1781
+ * consumer that mapped it straight back to `$0`.
1782
+ *
1783
+ * `'contact'` stays, and the asymmetry is the point: "not sold at a list
1784
+ * price" is genuinely a different KIND of answer, not a different number, so
1785
+ * it is a different shape. Two shapes, and each earns its own.
1778
1786
  */
1779
- readonly price: 'free' | 'contact' | {
1787
+ readonly price: 'contact' | {
1780
1788
  readonly month: number;
1781
1789
  readonly year: number;
1782
1790
  };
@@ -1800,14 +1808,25 @@ export interface PlansResponse {
1800
1808
  readonly plans: readonly Plan[];
1801
1809
  }
1802
1810
  /**
1803
- * A page Stripe hostsa Checkout Session or a Customer Portal session — the
1804
- * answer of `POST /billing/checkout` and `POST /billing/portal` alike.
1811
+ * The answer of `POST /billing/checkout` Stripe's `Checkout.Session`,
1812
+ * projected to the one field a client needs.
1805
1813
  *
1806
- * One shape for both because both say the same thing: the platform is not
1807
- * where this happens, go here. There is nothing else to return — the
1808
- * outcome arrives later, as a Stripe webhook.
1814
+ * There is nothing else to return: the outcome arrives later, as a Stripe
1815
+ * webhook. It is its own type rather than a shape shared with
1816
+ * {@link BillingPortalSession} because Stripe has two distinct objects here,
1817
+ * and naming one of them for both would be the reader's translation to make.
1818
+ */
1819
+ export interface CheckoutSession {
1820
+ /** Absolute URL to redirect the browser to. Single use, short-lived. */
1821
+ readonly url: string;
1822
+ }
1823
+ /**
1824
+ * The answer of `POST /billing/portal` — Stripe's `BillingPortal.Session`,
1825
+ * projected the same way. Identical in shape to {@link CheckoutSession} and
1826
+ * deliberately not merged with it: they are two Stripe objects, and either may
1827
+ * gain a field the other never has.
1809
1828
  */
1810
- export interface StripeSession {
1829
+ export interface BillingPortalSession {
1811
1830
  /** Absolute URL to redirect the browser to. Single use, short-lived. */
1812
1831
  readonly url: string;
1813
1832
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipstatic/types",
3
- "version": "2.13.0-beta.1",
3
+ "version": "2.15.0-beta.1",
4
4
  "description": "Shared types for ShipStatic platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -685,15 +685,16 @@ export interface Account {
685
685
  */
686
686
  readonly used?: number | null;
687
687
  /**
688
- * True while the Stripe subscription's status is `past_due` and Stripe is
688
+ * True while the Stripe Subscription's status is `past_due` and Stripe is
689
689
  * still retrying the card. The plan is unchanged — the account keeps
690
690
  * everything it has — so this is a banner, not a gate.
691
691
  *
692
- * A BOOLEAN rather than the status string: one fact for the console to
693
- * act on. Stripe's own status word is mirrored on the account row for the
694
- * operator surface.
692
+ * A BOOLEAN rather than the status string: one fact for the console to act
693
+ * on. It carries STRIPE'S OWN WORD (`past_due` `pastDue`) rather than a
694
+ * synonym, so no reader has to hold a translation; the full status string is
695
+ * mirrored on the account row for the operator surface.
695
696
  */
696
- readonly overdue: boolean;
697
+ readonly pastDue: boolean;
697
698
  }
698
699
 
699
700
  /**
@@ -2634,13 +2635,20 @@ export interface Plan {
2634
2635
  /** Display name, as the marketing site and the console should print it. */
2635
2636
  readonly name: string;
2636
2637
  /**
2637
- * What it costs. A union rather than a nullable number, so "free" and
2638
- * "talk to us" are two different answers instead of two readings of the
2639
- * same `null`. Amounts are integer CENTS in USD, as the API's plan table
2640
- * states them and as Stripe's Prices are provisioned from it — the wire
2641
- * never carries a formatted price, because formatting is the reader's job.
2638
+ * What it costs, per interval integer CENTS in USD, as the API's plan
2639
+ * table states them and as Stripe's Prices are provisioned from it. The wire
2640
+ * never carries a formatted price: formatting is the reader's job.
2641
+ *
2642
+ * **A free plan costs `{ month: 0, year: 0 }`, not a sentinel.** Free IS
2643
+ * zero, so it is a number like any other and every reader formats it with
2644
+ * the same call; a `'free'` member bought one thing — a branch in each
2645
+ * consumer that mapped it straight back to `$0`.
2646
+ *
2647
+ * `'contact'` stays, and the asymmetry is the point: "not sold at a list
2648
+ * price" is genuinely a different KIND of answer, not a different number, so
2649
+ * it is a different shape. Two shapes, and each earns its own.
2642
2650
  */
2643
- readonly price: 'free' | 'contact' | { readonly month: number; readonly year: number };
2651
+ readonly price: 'contact' | { readonly month: number; readonly year: number };
2644
2652
  /**
2645
2653
  * The caps this plan publishes, or `null` where the menu deliberately says
2646
2654
  * nothing (a plan sold by conversation publishes no numbers).
@@ -2663,14 +2671,26 @@ export interface PlansResponse {
2663
2671
  }
2664
2672
 
2665
2673
  /**
2666
- * A page Stripe hostsa Checkout Session or a Customer Portal session — the
2667
- * answer of `POST /billing/checkout` and `POST /billing/portal` alike.
2674
+ * The answer of `POST /billing/checkout` Stripe's `Checkout.Session`,
2675
+ * projected to the one field a client needs.
2668
2676
  *
2669
- * One shape for both because both say the same thing: the platform is not
2670
- * where this happens, go here. There is nothing else to return — the
2671
- * outcome arrives later, as a Stripe webhook.
2677
+ * There is nothing else to return: the outcome arrives later, as a Stripe
2678
+ * webhook. It is its own type rather than a shape shared with
2679
+ * {@link BillingPortalSession} because Stripe has two distinct objects here,
2680
+ * and naming one of them for both would be the reader's translation to make.
2681
+ */
2682
+ export interface CheckoutSession {
2683
+ /** Absolute URL to redirect the browser to. Single use, short-lived. */
2684
+ readonly url: string;
2685
+ }
2686
+
2687
+ /**
2688
+ * The answer of `POST /billing/portal` — Stripe's `BillingPortal.Session`,
2689
+ * projected the same way. Identical in shape to {@link CheckoutSession} and
2690
+ * deliberately not merged with it: they are two Stripe objects, and either may
2691
+ * gain a field the other never has.
2672
2692
  */
2673
- export interface StripeSession {
2693
+ export interface BillingPortalSession {
2674
2694
  /** Absolute URL to redirect the browser to. Single use, short-lived. */
2675
2695
  readonly url: string;
2676
2696
  }