@shipstatic/types 2.17.0-beta.1 → 2.17.0-beta.10
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 +68 -19
- package/dist/index.js +4 -3
- package/package.json +1 -1
- package/src/index.ts +60 -20
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
|
|
@@ -1213,8 +1223,10 @@ export declare const SIGN_IN_RETURN_PARAM = "signing-in";
|
|
|
1213
1223
|
* Client populations: `SESSION` (first-party cookie), `API_KEY` (`ship-`
|
|
1214
1224
|
* key), `TOKEN` (`deploy-` deploy token), `AGENT` (anonymous public deploy —
|
|
1215
1225
|
* no credential; the platform grants the public-account identity per
|
|
1216
|
-
* request), `OAUTH` (delegated access token).
|
|
1217
|
-
*
|
|
1226
|
+
* request), `OAUTH` (delegated access token). The one server population:
|
|
1227
|
+
* `SYSTEM` (scheduled/background jobs). Webhook receipt is deliberately not
|
|
1228
|
+
* a population: a signed delivery is verified, never authorized — it acts
|
|
1229
|
+
* as no one and audits as no one.
|
|
1218
1230
|
*/
|
|
1219
1231
|
export declare const AuthMethod: {
|
|
1220
1232
|
readonly SESSION: "session";
|
|
@@ -1222,7 +1234,6 @@ export declare const AuthMethod: {
|
|
|
1222
1234
|
readonly TOKEN: "token";
|
|
1223
1235
|
readonly AGENT: "agent";
|
|
1224
1236
|
readonly OAUTH: "oauth";
|
|
1225
|
-
readonly WEBHOOK: "webhook";
|
|
1226
1237
|
readonly SYSTEM: "system";
|
|
1227
1238
|
};
|
|
1228
1239
|
export type AuthMethodType = (typeof AuthMethod)[keyof typeof AuthMethod];
|
|
@@ -1842,6 +1853,20 @@ export interface Plan {
|
|
|
1842
1853
|
* nothing (a plan sold by conversation publishes no numbers).
|
|
1843
1854
|
*/
|
|
1844
1855
|
readonly caps: Caps | null;
|
|
1856
|
+
/**
|
|
1857
|
+
* Why this row cannot be ordered right now — the closed door's own sentence,
|
|
1858
|
+
* verbatim — or absent when the way is open. A menu lists what can be
|
|
1859
|
+
* ordered, and a row that is sold but not yet orderable (its door is closed:
|
|
1860
|
+
* checkout unbuilt, a feature unfinished) SAYS SO on the menu instead of
|
|
1861
|
+
* only at the order.
|
|
1862
|
+
*
|
|
1863
|
+
* Clients branch on PRESENCE and render the sentence unchanged — they know
|
|
1864
|
+
* *that* the row is closed, never *which* door or *when it lifts*; the
|
|
1865
|
+
* vocabulary of doors stays server-side. The same rule the refusal follows:
|
|
1866
|
+
* `POST /billing/change` onto a closed row answers 400 with
|
|
1867
|
+
* `details.closed`, and its `message` is this sentence.
|
|
1868
|
+
*/
|
|
1869
|
+
readonly closed?: string;
|
|
1845
1870
|
}
|
|
1846
1871
|
/**
|
|
1847
1872
|
* Response for `GET /plans` — the whole public menu, in display order.
|
|
@@ -1874,10 +1899,16 @@ export interface PlanChangeRequest {
|
|
|
1874
1899
|
readonly interval: BillingInterval;
|
|
1875
1900
|
}
|
|
1876
1901
|
/**
|
|
1877
|
-
* The pending plan change — a Stripe Subscription Schedule the
|
|
1878
|
-
*
|
|
1879
|
-
*
|
|
1880
|
-
*
|
|
1902
|
+
* The pending plan change — a Stripe Subscription Schedule, mirrored onto the
|
|
1903
|
+
* account. `at` is when it applies (the current period's end, Unix seconds).
|
|
1904
|
+
*
|
|
1905
|
+
* WHO minted the schedule is deliberately not part of this shape, and both
|
|
1906
|
+
* kinds mirror here identically: Stripe mints one when a customer confirms a
|
|
1907
|
+
* cadence downgrade on its own hosted page, and the platform mints one for a
|
|
1908
|
+
* cheaper TIER, the single move Stripe's Customer Portal cannot express.
|
|
1909
|
+
*
|
|
1910
|
+
* Reversible until it applies, and `DELETE /billing/change` is the only way:
|
|
1911
|
+
* Stripe's Portal displays a pending change but offers no control to undo it.
|
|
1881
1912
|
*/
|
|
1882
1913
|
export interface ScheduledChange {
|
|
1883
1914
|
readonly plan: AccountPlanType;
|
|
@@ -1885,19 +1916,32 @@ export interface ScheduledChange {
|
|
|
1885
1916
|
readonly at: number;
|
|
1886
1917
|
}
|
|
1887
1918
|
/**
|
|
1888
|
-
* The answer of `POST /billing/change` — exactly one field is set
|
|
1919
|
+
* The answer of `POST /billing/change` — exactly one field is set, and the
|
|
1920
|
+
* UNION is what holds that: an answer carrying both, or neither, does not
|
|
1921
|
+
* compile, so "which door was taken" is structural rather than prose.
|
|
1889
1922
|
*
|
|
1890
1923
|
* `url` means GO: a Stripe page (Checkout, or the Portal's confirmation page)
|
|
1891
|
-
* finishes the change and the browser must be redirected to it. `
|
|
1892
|
-
*
|
|
1893
|
-
* the
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1924
|
+
* finishes the change and the browser must be redirected to it. A `url` does
|
|
1925
|
+
* NOT imply money moves — on the confirmation page Stripe decides whether to
|
|
1926
|
+
* charge now or defer the change to period end, and says which. `scheduled`
|
|
1927
|
+
* means DONE: the change is booked for period end by the platform itself,
|
|
1928
|
+
* nothing to visit, and the account's `scheduled` field now carries it.
|
|
1929
|
+
*
|
|
1930
|
+
* A client branches on the SHAPE and holds no copy of which move takes which
|
|
1931
|
+
* door — which is what let the server move that boundary without a wire
|
|
1932
|
+
* change (2026-08-25).
|
|
1933
|
+
*/
|
|
1934
|
+
export type PlanChangeResponse =
|
|
1935
|
+
/** GO: a Stripe page finishes the change. Absolute URL, single use, short-lived. */
|
|
1936
|
+
{
|
|
1937
|
+
readonly url: string;
|
|
1938
|
+
readonly scheduled?: never;
|
|
1900
1939
|
}
|
|
1940
|
+
/** DONE: the downgrade is booked for period end; nothing to visit. */
|
|
1941
|
+
| {
|
|
1942
|
+
readonly url?: never;
|
|
1943
|
+
readonly scheduled: ScheduledChange;
|
|
1944
|
+
};
|
|
1901
1945
|
/**
|
|
1902
1946
|
* The answer of `POST /billing/portal` — Stripe's `BillingPortal.Session`,
|
|
1903
1947
|
* projected to the one field a client needs. The Portal home: cards,
|
|
@@ -1921,12 +1965,17 @@ export interface BillingSyncResponse {
|
|
|
1921
1965
|
/**
|
|
1922
1966
|
* All activity event types logged in the system.
|
|
1923
1967
|
* Uses dot notation consistently: {resource}.{action}
|
|
1968
|
+
*
|
|
1969
|
+
* Retention: activity rows are permanent — the account's own history and
|
|
1970
|
+
* the platform's audit ledgers are one table, kept for the life of the
|
|
1971
|
+
* account (deletion removes them). Only the personal payload is
|
|
1972
|
+
* time-bounded: past 90 days each row sheds its IP.
|
|
1924
1973
|
*/
|
|
1925
|
-
export type ActivityEvent = 'account.create' | 'account.
|
|
1974
|
+
export type ActivityEvent = 'account.create' | 'account.delete' | 'account.key.generate' | 'account.plan.transition' | 'deployment.create' | 'deployment.update' | 'deployment.delete' | 'deployment.claim' | 'deployment.flagged' | 'deployment.open' | 'domain.create' | 'domain.update' | 'domain.delete' | 'domain.verify' | 'token.create' | 'token.consume' | 'token.delete' | 'admin.account.plan.update' | 'admin.account.suspended.update' | 'admin.account.ref.update' | 'admin.account.labels.update' | 'admin.deployment.delete' | 'admin.domain.delete' | 'admin.impersonate';
|
|
1926
1975
|
/**
|
|
1927
1976
|
* Activity events visible to users in the dashboard
|
|
1928
1977
|
*/
|
|
1929
|
-
export type UserVisibleActivityEvent = 'account.create' | 'account.
|
|
1978
|
+
export type UserVisibleActivityEvent = 'account.create' | 'account.delete' | 'account.key.generate' | 'account.plan.transition' | 'deployment.create' | 'deployment.update' | 'deployment.delete' | 'deployment.claim' | 'domain.create' | 'domain.update' | 'domain.delete' | 'domain.verify' | 'token.create' | 'token.consume' | 'token.delete';
|
|
1930
1979
|
/**
|
|
1931
1980
|
* Activity record returned from the API
|
|
1932
1981
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1150,8 +1150,10 @@ export const SIGN_IN_RETURN_PARAM = 'signing-in';
|
|
|
1150
1150
|
* Client populations: `SESSION` (first-party cookie), `API_KEY` (`ship-`
|
|
1151
1151
|
* key), `TOKEN` (`deploy-` deploy token), `AGENT` (anonymous public deploy —
|
|
1152
1152
|
* no credential; the platform grants the public-account identity per
|
|
1153
|
-
* request), `OAUTH` (delegated access token).
|
|
1154
|
-
*
|
|
1153
|
+
* request), `OAUTH` (delegated access token). The one server population:
|
|
1154
|
+
* `SYSTEM` (scheduled/background jobs). Webhook receipt is deliberately not
|
|
1155
|
+
* a population: a signed delivery is verified, never authorized — it acts
|
|
1156
|
+
* as no one and audits as no one.
|
|
1155
1157
|
*/
|
|
1156
1158
|
export const AuthMethod = {
|
|
1157
1159
|
SESSION: 'session',
|
|
@@ -1159,7 +1161,6 @@ export const AuthMethod = {
|
|
|
1159
1161
|
TOKEN: 'token',
|
|
1160
1162
|
AGENT: 'agent',
|
|
1161
1163
|
OAUTH: 'oauth',
|
|
1162
|
-
WEBHOOK: 'webhook',
|
|
1163
1164
|
SYSTEM: 'system',
|
|
1164
1165
|
};
|
|
1165
1166
|
/**
|
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
|
/**
|
|
@@ -1888,8 +1898,10 @@ export const SIGN_IN_RETURN_PARAM = 'signing-in';
|
|
|
1888
1898
|
* Client populations: `SESSION` (first-party cookie), `API_KEY` (`ship-`
|
|
1889
1899
|
* key), `TOKEN` (`deploy-` deploy token), `AGENT` (anonymous public deploy —
|
|
1890
1900
|
* no credential; the platform grants the public-account identity per
|
|
1891
|
-
* request), `OAUTH` (delegated access token).
|
|
1892
|
-
*
|
|
1901
|
+
* request), `OAUTH` (delegated access token). The one server population:
|
|
1902
|
+
* `SYSTEM` (scheduled/background jobs). Webhook receipt is deliberately not
|
|
1903
|
+
* a population: a signed delivery is verified, never authorized — it acts
|
|
1904
|
+
* as no one and audits as no one.
|
|
1893
1905
|
*/
|
|
1894
1906
|
export const AuthMethod = {
|
|
1895
1907
|
SESSION: 'session',
|
|
@@ -1897,7 +1909,6 @@ export const AuthMethod = {
|
|
|
1897
1909
|
TOKEN: 'token',
|
|
1898
1910
|
AGENT: 'agent',
|
|
1899
1911
|
OAUTH: 'oauth',
|
|
1900
|
-
WEBHOOK: 'webhook',
|
|
1901
1912
|
SYSTEM: 'system',
|
|
1902
1913
|
} as const;
|
|
1903
1914
|
|
|
@@ -2703,6 +2714,20 @@ export interface Plan {
|
|
|
2703
2714
|
* nothing (a plan sold by conversation publishes no numbers).
|
|
2704
2715
|
*/
|
|
2705
2716
|
readonly caps: Caps | null;
|
|
2717
|
+
/**
|
|
2718
|
+
* Why this row cannot be ordered right now — the closed door's own sentence,
|
|
2719
|
+
* verbatim — or absent when the way is open. A menu lists what can be
|
|
2720
|
+
* ordered, and a row that is sold but not yet orderable (its door is closed:
|
|
2721
|
+
* checkout unbuilt, a feature unfinished) SAYS SO on the menu instead of
|
|
2722
|
+
* only at the order.
|
|
2723
|
+
*
|
|
2724
|
+
* Clients branch on PRESENCE and render the sentence unchanged — they know
|
|
2725
|
+
* *that* the row is closed, never *which* door or *when it lifts*; the
|
|
2726
|
+
* vocabulary of doors stays server-side. The same rule the refusal follows:
|
|
2727
|
+
* `POST /billing/change` onto a closed row answers 400 with
|
|
2728
|
+
* `details.closed`, and its `message` is this sentence.
|
|
2729
|
+
*/
|
|
2730
|
+
readonly closed?: string;
|
|
2706
2731
|
}
|
|
2707
2732
|
|
|
2708
2733
|
/**
|
|
@@ -2738,10 +2763,16 @@ export interface PlanChangeRequest {
|
|
|
2738
2763
|
}
|
|
2739
2764
|
|
|
2740
2765
|
/**
|
|
2741
|
-
* The pending plan change — a Stripe Subscription Schedule the
|
|
2742
|
-
*
|
|
2743
|
-
*
|
|
2744
|
-
*
|
|
2766
|
+
* The pending plan change — a Stripe Subscription Schedule, mirrored onto the
|
|
2767
|
+
* account. `at` is when it applies (the current period's end, Unix seconds).
|
|
2768
|
+
*
|
|
2769
|
+
* WHO minted the schedule is deliberately not part of this shape, and both
|
|
2770
|
+
* kinds mirror here identically: Stripe mints one when a customer confirms a
|
|
2771
|
+
* cadence downgrade on its own hosted page, and the platform mints one for a
|
|
2772
|
+
* cheaper TIER, the single move Stripe's Customer Portal cannot express.
|
|
2773
|
+
*
|
|
2774
|
+
* Reversible until it applies, and `DELETE /billing/change` is the only way:
|
|
2775
|
+
* Stripe's Portal displays a pending change but offers no control to undo it.
|
|
2745
2776
|
*/
|
|
2746
2777
|
export interface ScheduledChange {
|
|
2747
2778
|
readonly plan: AccountPlanType;
|
|
@@ -2750,19 +2781,26 @@ export interface ScheduledChange {
|
|
|
2750
2781
|
}
|
|
2751
2782
|
|
|
2752
2783
|
/**
|
|
2753
|
-
* The answer of `POST /billing/change` — exactly one field is set
|
|
2784
|
+
* The answer of `POST /billing/change` — exactly one field is set, and the
|
|
2785
|
+
* UNION is what holds that: an answer carrying both, or neither, does not
|
|
2786
|
+
* compile, so "which door was taken" is structural rather than prose.
|
|
2754
2787
|
*
|
|
2755
2788
|
* `url` means GO: a Stripe page (Checkout, or the Portal's confirmation page)
|
|
2756
|
-
* finishes the change and the browser must be redirected to it. `
|
|
2757
|
-
*
|
|
2758
|
-
* the
|
|
2789
|
+
* finishes the change and the browser must be redirected to it. A `url` does
|
|
2790
|
+
* NOT imply money moves — on the confirmation page Stripe decides whether to
|
|
2791
|
+
* charge now or defer the change to period end, and says which. `scheduled`
|
|
2792
|
+
* means DONE: the change is booked for period end by the platform itself,
|
|
2793
|
+
* nothing to visit, and the account's `scheduled` field now carries it.
|
|
2794
|
+
*
|
|
2795
|
+
* A client branches on the SHAPE and holds no copy of which move takes which
|
|
2796
|
+
* door — which is what let the server move that boundary without a wire
|
|
2797
|
+
* change (2026-08-25).
|
|
2759
2798
|
*/
|
|
2760
|
-
export
|
|
2761
|
-
/**
|
|
2762
|
-
readonly url
|
|
2763
|
-
/**
|
|
2764
|
-
readonly
|
|
2765
|
-
}
|
|
2799
|
+
export type PlanChangeResponse =
|
|
2800
|
+
/** GO: a Stripe page finishes the change. Absolute URL, single use, short-lived. */
|
|
2801
|
+
| { readonly url: string; readonly scheduled?: never }
|
|
2802
|
+
/** DONE: the downgrade is booked for period end; nothing to visit. */
|
|
2803
|
+
| { readonly url?: never; readonly scheduled: ScheduledChange };
|
|
2766
2804
|
|
|
2767
2805
|
/**
|
|
2768
2806
|
* The answer of `POST /billing/portal` — Stripe's `BillingPortal.Session`,
|
|
@@ -2793,14 +2831,17 @@ export interface BillingSyncResponse {
|
|
|
2793
2831
|
/**
|
|
2794
2832
|
* All activity event types logged in the system.
|
|
2795
2833
|
* Uses dot notation consistently: {resource}.{action}
|
|
2834
|
+
*
|
|
2835
|
+
* Retention: activity rows are permanent — the account's own history and
|
|
2836
|
+
* the platform's audit ledgers are one table, kept for the life of the
|
|
2837
|
+
* account (deletion removes them). Only the personal payload is
|
|
2838
|
+
* time-bounded: past 90 days each row sheds its IP.
|
|
2796
2839
|
*/
|
|
2797
2840
|
export type ActivityEvent =
|
|
2798
2841
|
// Account events
|
|
2799
2842
|
| 'account.create'
|
|
2800
|
-
| 'account.update'
|
|
2801
2843
|
| 'account.delete'
|
|
2802
2844
|
| 'account.key.generate'
|
|
2803
|
-
| 'account.plan.paid'
|
|
2804
2845
|
| 'account.plan.transition'
|
|
2805
2846
|
// Deployment events
|
|
2806
2847
|
| 'deployment.create'
|
|
@@ -2837,7 +2878,6 @@ export type ActivityEvent =
|
|
|
2837
2878
|
*/
|
|
2838
2879
|
export type UserVisibleActivityEvent =
|
|
2839
2880
|
| 'account.create'
|
|
2840
|
-
| 'account.update'
|
|
2841
2881
|
| 'account.delete'
|
|
2842
2882
|
| 'account.key.generate'
|
|
2843
2883
|
| 'account.plan.transition'
|