@shipstatic/types 2.17.0-beta.1 → 2.17.0-beta.2

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.ts CHANGED
@@ -1885,19 +1885,26 @@ export interface ScheduledChange {
1885
1885
  readonly at: number;
1886
1886
  }
1887
1887
  /**
1888
- * The answer of `POST /billing/change` — exactly one field is set.
1888
+ * The answer of `POST /billing/change` — exactly one field is set, and the
1889
+ * UNION is what holds that: an answer carrying both, or neither, does not
1890
+ * compile, so "which door was taken" is structural rather than prose.
1889
1891
  *
1890
1892
  * `url` means GO: a Stripe page (Checkout, or the Portal's confirmation page)
1891
1893
  * finishes the change and the browser must be redirected to it. `scheduled`
1892
1894
  * means DONE: the downgrade is booked for period end, nothing to visit, and
1893
1895
  * the account's `scheduled` field now carries it.
1894
1896
  */
1895
- export interface PlanChangeResponse {
1896
- /** Absolute URL to redirect the browser to. Single use, short-lived. */
1897
- readonly url?: string;
1898
- /** The pending change, when the platform scheduled it instead. */
1899
- readonly scheduled?: ScheduledChange;
1897
+ export type PlanChangeResponse =
1898
+ /** GO: a Stripe page finishes the change. Absolute URL, single use, short-lived. */
1899
+ {
1900
+ readonly url: string;
1901
+ readonly scheduled?: never;
1900
1902
  }
1903
+ /** DONE: the downgrade is booked for period end; nothing to visit. */
1904
+ | {
1905
+ readonly url?: never;
1906
+ readonly scheduled: ScheduledChange;
1907
+ };
1901
1908
  /**
1902
1909
  * The answer of `POST /billing/portal` — Stripe's `BillingPortal.Session`,
1903
1910
  * projected to the one field a client needs. The Portal home: cards,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipstatic/types",
3
- "version": "2.17.0-beta.1",
3
+ "version": "2.17.0-beta.2",
4
4
  "description": "Shared types for ShipStatic platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -2750,19 +2750,20 @@ export interface ScheduledChange {
2750
2750
  }
2751
2751
 
2752
2752
  /**
2753
- * The answer of `POST /billing/change` — exactly one field is set.
2753
+ * The answer of `POST /billing/change` — exactly one field is set, and the
2754
+ * UNION is what holds that: an answer carrying both, or neither, does not
2755
+ * compile, so "which door was taken" is structural rather than prose.
2754
2756
  *
2755
2757
  * `url` means GO: a Stripe page (Checkout, or the Portal's confirmation page)
2756
2758
  * finishes the change and the browser must be redirected to it. `scheduled`
2757
2759
  * means DONE: the downgrade is booked for period end, nothing to visit, and
2758
2760
  * the account's `scheduled` field now carries it.
2759
2761
  */
2760
- export interface PlanChangeResponse {
2761
- /** Absolute URL to redirect the browser to. Single use, short-lived. */
2762
- readonly url?: string;
2763
- /** The pending change, when the platform scheduled it instead. */
2764
- readonly scheduled?: ScheduledChange;
2765
- }
2762
+ export type PlanChangeResponse =
2763
+ /** GO: a Stripe page finishes the change. Absolute URL, single use, short-lived. */
2764
+ | { readonly url: string; readonly scheduled?: never }
2765
+ /** DONE: the downgrade is booked for period end; nothing to visit. */
2766
+ | { readonly url?: never; readonly scheduled: ScheduledChange };
2766
2767
 
2767
2768
  /**
2768
2769
  * The answer of `POST /billing/portal` — Stripe's `BillingPortal.Session`,