@shipstatic/types 2.17.0-beta.1 → 2.17.0-beta.3
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 +23 -6
- package/package.json +1 -1
- package/src/index.ts +18 -7
package/dist/index.d.ts
CHANGED
|
@@ -669,6 +669,16 @@ export interface Account {
|
|
|
669
669
|
* `DELETE /billing/change` releases it.
|
|
670
670
|
*/
|
|
671
671
|
readonly scheduled: ScheduledChange | null;
|
|
672
|
+
/**
|
|
673
|
+
* When the Subscription is set to END — Stripe's `cancel_at`, mirrored
|
|
674
|
+
* (Unix seconds) — or `null` while it renews. Set by a cancellation in the
|
|
675
|
+
* Customer Portal; the Portal is also where it is resumed. The console
|
|
676
|
+
* needs it to ACT: no "cancel" offered to an account already cancelling,
|
|
677
|
+
* and no plan change offered until it is resumed (the API refuses one).
|
|
678
|
+
* Mirrored on the rule that survives: what the console must act on is
|
|
679
|
+
* mirrored, what it would merely display is not.
|
|
680
|
+
*/
|
|
681
|
+
readonly cancelAt: number | null;
|
|
672
682
|
}
|
|
673
683
|
/**
|
|
674
684
|
* Account as returned by `GET /account` — the entity plus how the request
|
|
@@ -1885,19 +1895,26 @@ export interface ScheduledChange {
|
|
|
1885
1895
|
readonly at: number;
|
|
1886
1896
|
}
|
|
1887
1897
|
/**
|
|
1888
|
-
* The answer of `POST /billing/change` — exactly one field is set
|
|
1898
|
+
* The answer of `POST /billing/change` — exactly one field is set, and the
|
|
1899
|
+
* UNION is what holds that: an answer carrying both, or neither, does not
|
|
1900
|
+
* compile, so "which door was taken" is structural rather than prose.
|
|
1889
1901
|
*
|
|
1890
1902
|
* `url` means GO: a Stripe page (Checkout, or the Portal's confirmation page)
|
|
1891
1903
|
* finishes the change and the browser must be redirected to it. `scheduled`
|
|
1892
1904
|
* means DONE: the downgrade is booked for period end, nothing to visit, and
|
|
1893
1905
|
* the account's `scheduled` field now carries it.
|
|
1894
1906
|
*/
|
|
1895
|
-
export
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
readonly scheduled?:
|
|
1907
|
+
export type PlanChangeResponse =
|
|
1908
|
+
/** GO: a Stripe page finishes the change. Absolute URL, single use, short-lived. */
|
|
1909
|
+
{
|
|
1910
|
+
readonly url: string;
|
|
1911
|
+
readonly scheduled?: never;
|
|
1900
1912
|
}
|
|
1913
|
+
/** DONE: the downgrade is booked for period end; nothing to visit. */
|
|
1914
|
+
| {
|
|
1915
|
+
readonly url?: never;
|
|
1916
|
+
readonly scheduled: ScheduledChange;
|
|
1917
|
+
};
|
|
1901
1918
|
/**
|
|
1902
1919
|
* The answer of `POST /billing/portal` — Stripe's `BillingPortal.Session`,
|
|
1903
1920
|
* projected to the one field a client needs. The Portal home: cards,
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -744,6 +744,16 @@ export interface Account {
|
|
|
744
744
|
* `DELETE /billing/change` releases it.
|
|
745
745
|
*/
|
|
746
746
|
readonly scheduled: ScheduledChange | null;
|
|
747
|
+
/**
|
|
748
|
+
* When the Subscription is set to END — Stripe's `cancel_at`, mirrored
|
|
749
|
+
* (Unix seconds) — or `null` while it renews. Set by a cancellation in the
|
|
750
|
+
* Customer Portal; the Portal is also where it is resumed. The console
|
|
751
|
+
* needs it to ACT: no "cancel" offered to an account already cancelling,
|
|
752
|
+
* and no plan change offered until it is resumed (the API refuses one).
|
|
753
|
+
* Mirrored on the rule that survives: what the console must act on is
|
|
754
|
+
* mirrored, what it would merely display is not.
|
|
755
|
+
*/
|
|
756
|
+
readonly cancelAt: number | null;
|
|
747
757
|
}
|
|
748
758
|
|
|
749
759
|
/**
|
|
@@ -2750,19 +2760,20 @@ export interface ScheduledChange {
|
|
|
2750
2760
|
}
|
|
2751
2761
|
|
|
2752
2762
|
/**
|
|
2753
|
-
* The answer of `POST /billing/change` — exactly one field is set
|
|
2763
|
+
* The answer of `POST /billing/change` — exactly one field is set, and the
|
|
2764
|
+
* UNION is what holds that: an answer carrying both, or neither, does not
|
|
2765
|
+
* compile, so "which door was taken" is structural rather than prose.
|
|
2754
2766
|
*
|
|
2755
2767
|
* `url` means GO: a Stripe page (Checkout, or the Portal's confirmation page)
|
|
2756
2768
|
* finishes the change and the browser must be redirected to it. `scheduled`
|
|
2757
2769
|
* means DONE: the downgrade is booked for period end, nothing to visit, and
|
|
2758
2770
|
* the account's `scheduled` field now carries it.
|
|
2759
2771
|
*/
|
|
2760
|
-
export
|
|
2761
|
-
/**
|
|
2762
|
-
readonly url
|
|
2763
|
-
/**
|
|
2764
|
-
readonly
|
|
2765
|
-
}
|
|
2772
|
+
export type PlanChangeResponse =
|
|
2773
|
+
/** GO: a Stripe page finishes the change. Absolute URL, single use, short-lived. */
|
|
2774
|
+
| { readonly url: string; readonly scheduled?: never }
|
|
2775
|
+
/** DONE: the downgrade is booked for period end; nothing to visit. */
|
|
2776
|
+
| { readonly url?: never; readonly scheduled: ScheduledChange };
|
|
2766
2777
|
|
|
2767
2778
|
/**
|
|
2768
2779
|
* The answer of `POST /billing/portal` — Stripe's `BillingPortal.Session`,
|