@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 +2 -1
- package/dist/index.d.ts +36 -17
- package/package.json +1 -1
- package/src/index.ts +37 -17
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,
|
|
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
|
|
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
|
-
*
|
|
619
|
-
*
|
|
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
|
|
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
|
|
1774
|
-
*
|
|
1775
|
-
*
|
|
1776
|
-
*
|
|
1777
|
-
*
|
|
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: '
|
|
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
|
-
*
|
|
1804
|
-
*
|
|
1811
|
+
* The answer of `POST /billing/checkout` — Stripe's `Checkout.Session`,
|
|
1812
|
+
* projected to the one field a client needs.
|
|
1805
1813
|
*
|
|
1806
|
-
*
|
|
1807
|
-
*
|
|
1808
|
-
*
|
|
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
|
|
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
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
|
|
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
|
-
*
|
|
694
|
-
*
|
|
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
|
|
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
|
|
2638
|
-
*
|
|
2639
|
-
*
|
|
2640
|
-
*
|
|
2641
|
-
*
|
|
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: '
|
|
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
|
-
*
|
|
2667
|
-
*
|
|
2674
|
+
* The answer of `POST /billing/checkout` — Stripe's `Checkout.Session`,
|
|
2675
|
+
* projected to the one field a client needs.
|
|
2668
2676
|
*
|
|
2669
|
-
*
|
|
2670
|
-
*
|
|
2671
|
-
*
|
|
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
|
|
2693
|
+
export interface BillingPortalSession {
|
|
2674
2694
|
/** Absolute URL to redirect the browser to. Single use, short-lived. */
|
|
2675
2695
|
readonly url: string;
|
|
2676
2696
|
}
|