@shipstatic/types 0.3.11 → 0.3.13
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 +17 -25
- package/package.json +1 -1
- package/src/index.ts +18 -27
package/dist/index.d.ts
CHANGED
|
@@ -157,20 +157,21 @@ export declare const AccountPlan: {
|
|
|
157
157
|
export type AccountPlanType = typeof AccountPlan[keyof typeof AccountPlan];
|
|
158
158
|
/**
|
|
159
159
|
* Core account object - used in both API responses and SDK
|
|
160
|
+
* All fields are readonly to prevent accidental mutations
|
|
160
161
|
*/
|
|
161
162
|
export interface Account {
|
|
162
163
|
/** User email address */
|
|
163
|
-
email: string;
|
|
164
|
+
readonly email: string;
|
|
164
165
|
/** User display name */
|
|
165
|
-
name: string;
|
|
166
|
+
readonly name: string;
|
|
166
167
|
/** User profile picture URL */
|
|
167
|
-
picture?: string;
|
|
168
|
+
readonly picture?: string;
|
|
168
169
|
/** Account plan status */
|
|
169
|
-
plan: AccountPlanType;
|
|
170
|
+
readonly plan: AccountPlanType;
|
|
170
171
|
/** Unix timestamp (seconds) when account was created */
|
|
171
|
-
created: number;
|
|
172
|
+
readonly created: number;
|
|
172
173
|
/** Unix timestamp (seconds) when account was activated (first deployment) */
|
|
173
|
-
activated?: number;
|
|
174
|
+
readonly activated?: number;
|
|
174
175
|
}
|
|
175
176
|
/**
|
|
176
177
|
* Account-specific configuration overrides
|
|
@@ -441,31 +442,30 @@ export interface TokenResource {
|
|
|
441
442
|
}
|
|
442
443
|
/**
|
|
443
444
|
* Billing status response from GET /billing/status
|
|
445
|
+
*
|
|
446
|
+
* Note: The user's `plan` comes from Account, not here.
|
|
447
|
+
* This endpoint only returns billing-specific data (usage, portal, etc.)
|
|
448
|
+
*
|
|
449
|
+
* If `billing` is null, the user has no active billing.
|
|
444
450
|
*/
|
|
445
451
|
export interface BillingStatus {
|
|
446
|
-
/**
|
|
447
|
-
|
|
448
|
-
/** Current account plan */
|
|
449
|
-
plan: AccountPlanType;
|
|
450
|
-
/** Creem billing ID (if subscribed) */
|
|
451
|
-
billing?: string;
|
|
452
|
+
/** Creem billing ID, or null if no active billing */
|
|
453
|
+
billing: string | null;
|
|
452
454
|
/** Number of billing units (1 unit = 1 custom domain) */
|
|
453
455
|
units?: number;
|
|
454
456
|
/** Number of custom domains currently in use */
|
|
455
|
-
|
|
457
|
+
usage?: number;
|
|
456
458
|
/** Billing status from Creem (active, trialing, canceled, etc.) */
|
|
457
459
|
status?: string;
|
|
458
460
|
/** Link to Creem customer portal for billing management */
|
|
459
|
-
|
|
461
|
+
portal?: string | null;
|
|
460
462
|
}
|
|
461
463
|
/**
|
|
462
464
|
* Checkout session response from POST /billing/checkout
|
|
463
465
|
*/
|
|
464
466
|
export interface CheckoutSession {
|
|
465
467
|
/** URL to redirect user to Creem checkout page */
|
|
466
|
-
|
|
467
|
-
/** Creem checkout session ID */
|
|
468
|
-
checkoutId: string;
|
|
468
|
+
url: string;
|
|
469
469
|
}
|
|
470
470
|
/**
|
|
471
471
|
* Billing resource interface - the contract all implementations must follow
|
|
@@ -485,14 +485,6 @@ export interface BillingResource {
|
|
|
485
485
|
*/
|
|
486
486
|
status: () => Promise<BillingStatus>;
|
|
487
487
|
}
|
|
488
|
-
/**
|
|
489
|
-
* @deprecated Use BillingStatus instead. Kept for backward compatibility.
|
|
490
|
-
*/
|
|
491
|
-
export type SubscriptionStatus = BillingStatus;
|
|
492
|
-
/**
|
|
493
|
-
* @deprecated Use BillingResource instead. Kept for backward compatibility.
|
|
494
|
-
*/
|
|
495
|
-
export type SubscriptionResource = BillingResource;
|
|
496
488
|
/**
|
|
497
489
|
* Keys resource interface - the contract all implementations must follow
|
|
498
490
|
*/
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -189,20 +189,21 @@ export type AccountPlanType = typeof AccountPlan[keyof typeof AccountPlan];
|
|
|
189
189
|
|
|
190
190
|
/**
|
|
191
191
|
* Core account object - used in both API responses and SDK
|
|
192
|
+
* All fields are readonly to prevent accidental mutations
|
|
192
193
|
*/
|
|
193
194
|
export interface Account {
|
|
194
195
|
/** User email address */
|
|
195
|
-
email: string;
|
|
196
|
+
readonly email: string;
|
|
196
197
|
/** User display name */
|
|
197
|
-
name: string;
|
|
198
|
+
readonly name: string;
|
|
198
199
|
/** User profile picture URL */
|
|
199
|
-
picture?: string;
|
|
200
|
+
readonly picture?: string;
|
|
200
201
|
/** Account plan status */
|
|
201
|
-
plan: AccountPlanType;
|
|
202
|
+
readonly plan: AccountPlanType;
|
|
202
203
|
/** Unix timestamp (seconds) when account was created */
|
|
203
|
-
created: number;
|
|
204
|
+
readonly created: number;
|
|
204
205
|
/** Unix timestamp (seconds) when account was activated (first deployment) */
|
|
205
|
-
activated?: number;
|
|
206
|
+
readonly activated?: number;
|
|
206
207
|
}
|
|
207
208
|
|
|
208
209
|
/**
|
|
@@ -691,32 +692,32 @@ export interface TokenResource {
|
|
|
691
692
|
|
|
692
693
|
/**
|
|
693
694
|
* Billing status response from GET /billing/status
|
|
695
|
+
*
|
|
696
|
+
* Note: The user's `plan` comes from Account, not here.
|
|
697
|
+
* This endpoint only returns billing-specific data (usage, portal, etc.)
|
|
698
|
+
*
|
|
699
|
+
* If `billing` is null, the user has no active billing.
|
|
694
700
|
*/
|
|
695
701
|
export interface BillingStatus {
|
|
696
|
-
/**
|
|
697
|
-
|
|
698
|
-
/** Current account plan */
|
|
699
|
-
plan: AccountPlanType;
|
|
700
|
-
/** Creem billing ID (if subscribed) */
|
|
701
|
-
billing?: string;
|
|
702
|
+
/** Creem billing ID, or null if no active billing */
|
|
703
|
+
billing: string | null;
|
|
702
704
|
/** Number of billing units (1 unit = 1 custom domain) */
|
|
703
705
|
units?: number;
|
|
704
706
|
/** Number of custom domains currently in use */
|
|
705
|
-
|
|
707
|
+
usage?: number;
|
|
706
708
|
/** Billing status from Creem (active, trialing, canceled, etc.) */
|
|
707
709
|
status?: string;
|
|
708
710
|
/** Link to Creem customer portal for billing management */
|
|
709
|
-
|
|
711
|
+
portal?: string | null;
|
|
710
712
|
}
|
|
711
713
|
|
|
714
|
+
|
|
712
715
|
/**
|
|
713
716
|
* Checkout session response from POST /billing/checkout
|
|
714
717
|
*/
|
|
715
718
|
export interface CheckoutSession {
|
|
716
719
|
/** URL to redirect user to Creem checkout page */
|
|
717
|
-
|
|
718
|
-
/** Creem checkout session ID */
|
|
719
|
-
checkoutId: string;
|
|
720
|
+
url: string;
|
|
720
721
|
}
|
|
721
722
|
|
|
722
723
|
/**
|
|
@@ -739,16 +740,6 @@ export interface BillingResource {
|
|
|
739
740
|
status: () => Promise<BillingStatus>;
|
|
740
741
|
}
|
|
741
742
|
|
|
742
|
-
/**
|
|
743
|
-
* @deprecated Use BillingStatus instead. Kept for backward compatibility.
|
|
744
|
-
*/
|
|
745
|
-
export type SubscriptionStatus = BillingStatus;
|
|
746
|
-
|
|
747
|
-
/**
|
|
748
|
-
* @deprecated Use BillingResource instead. Kept for backward compatibility.
|
|
749
|
-
*/
|
|
750
|
-
export type SubscriptionResource = BillingResource;
|
|
751
|
-
|
|
752
743
|
|
|
753
744
|
/**
|
|
754
745
|
* Keys resource interface - the contract all implementations must follow
|