@shipstatic/types 0.3.5 → 0.3.7
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 +67 -0
- package/package.json +1 -1
- package/src/index.ts +77 -0
package/dist/index.d.ts
CHANGED
|
@@ -172,6 +172,20 @@ export interface Account {
|
|
|
172
172
|
/** Unix timestamp (seconds) when account was activated (first deployment) */
|
|
173
173
|
activated?: number;
|
|
174
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* Account-specific configuration overrides
|
|
177
|
+
* Allows per-account customization of limits without changing plan
|
|
178
|
+
*/
|
|
179
|
+
export interface AccountOverrides {
|
|
180
|
+
/** Override for maximum resources (deployments + domains) */
|
|
181
|
+
resources?: number;
|
|
182
|
+
/** Override for maximum individual file size in bytes */
|
|
183
|
+
fileSize?: number;
|
|
184
|
+
/** Override for maximum number of files per deployment */
|
|
185
|
+
filesCount?: number;
|
|
186
|
+
/** Override for maximum total deployment size in bytes */
|
|
187
|
+
totalSize?: number;
|
|
188
|
+
}
|
|
175
189
|
/**
|
|
176
190
|
* All possible error types in the Shipstatic platform
|
|
177
191
|
* Names are developer-friendly while wire format stays consistent
|
|
@@ -424,6 +438,59 @@ export interface TokenResource {
|
|
|
424
438
|
list: () => Promise<TokenListResponse>;
|
|
425
439
|
remove: (token: string) => Promise<void>;
|
|
426
440
|
}
|
|
441
|
+
/**
|
|
442
|
+
* Subscription status response from GET /subscriptions/status
|
|
443
|
+
*/
|
|
444
|
+
export interface SubscriptionStatus {
|
|
445
|
+
/** Whether the account has an active subscription */
|
|
446
|
+
hasSubscription: boolean;
|
|
447
|
+
/** Current account plan */
|
|
448
|
+
plan: AccountPlanType;
|
|
449
|
+
/** Creem subscription ID (if subscribed) */
|
|
450
|
+
subscriptionId?: string;
|
|
451
|
+
/** Number of subscription units (1 unit = 1 custom domain) */
|
|
452
|
+
units?: number;
|
|
453
|
+
/** Number of custom domains currently in use */
|
|
454
|
+
customDomains?: number;
|
|
455
|
+
/** Subscription status from Creem (active, trialing, canceled, etc.) */
|
|
456
|
+
status?: string;
|
|
457
|
+
/** Link to Creem customer portal for subscription management */
|
|
458
|
+
portalLink?: string | null;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Checkout session response from POST /subscriptions/checkout
|
|
462
|
+
*/
|
|
463
|
+
export interface CheckoutSession {
|
|
464
|
+
/** URL to redirect user to Creem checkout page */
|
|
465
|
+
checkoutUrl: string;
|
|
466
|
+
/** Creem checkout session ID */
|
|
467
|
+
checkoutId: string;
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Subscription sync request body for POST /subscriptions/sync
|
|
471
|
+
*/
|
|
472
|
+
export interface SubscriptionSyncRequest {
|
|
473
|
+
/** Creem subscription ID received after checkout */
|
|
474
|
+
subscriptionId: string;
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Subscription resource interface - the contract all implementations must follow
|
|
478
|
+
*
|
|
479
|
+
* IMPOSSIBLE SIMPLICITY: No sync() method needed!
|
|
480
|
+
* Webhooks are the single source of truth. Frontend just polls status().
|
|
481
|
+
*/
|
|
482
|
+
export interface SubscriptionResource {
|
|
483
|
+
/**
|
|
484
|
+
* Create a checkout session
|
|
485
|
+
* @returns Checkout session with URL to redirect user
|
|
486
|
+
*/
|
|
487
|
+
checkout: () => Promise<CheckoutSession>;
|
|
488
|
+
/**
|
|
489
|
+
* Get current subscription status
|
|
490
|
+
* @returns Subscription status and usage information
|
|
491
|
+
*/
|
|
492
|
+
status: () => Promise<SubscriptionStatus>;
|
|
493
|
+
}
|
|
427
494
|
/**
|
|
428
495
|
* Keys resource interface - the contract all implementations must follow
|
|
429
496
|
*/
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -205,6 +205,21 @@ export interface Account {
|
|
|
205
205
|
activated?: number;
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
+
/**
|
|
209
|
+
* Account-specific configuration overrides
|
|
210
|
+
* Allows per-account customization of limits without changing plan
|
|
211
|
+
*/
|
|
212
|
+
export interface AccountOverrides {
|
|
213
|
+
/** Override for maximum resources (deployments + domains) */
|
|
214
|
+
resources?: number;
|
|
215
|
+
/** Override for maximum individual file size in bytes */
|
|
216
|
+
fileSize?: number;
|
|
217
|
+
/** Override for maximum number of files per deployment */
|
|
218
|
+
filesCount?: number;
|
|
219
|
+
/** Override for maximum total deployment size in bytes */
|
|
220
|
+
totalSize?: number;
|
|
221
|
+
}
|
|
222
|
+
|
|
208
223
|
// =============================================================================
|
|
209
224
|
// ERROR SYSTEM
|
|
210
225
|
// =============================================================================
|
|
@@ -669,6 +684,68 @@ export interface TokenResource {
|
|
|
669
684
|
remove: (token: string) => Promise<void>;
|
|
670
685
|
}
|
|
671
686
|
|
|
687
|
+
// =============================================================================
|
|
688
|
+
// SUBSCRIPTION TYPES
|
|
689
|
+
// =============================================================================
|
|
690
|
+
|
|
691
|
+
/**
|
|
692
|
+
* Subscription status response from GET /subscriptions/status
|
|
693
|
+
*/
|
|
694
|
+
export interface SubscriptionStatus {
|
|
695
|
+
/** Whether the account has an active subscription */
|
|
696
|
+
hasSubscription: boolean;
|
|
697
|
+
/** Current account plan */
|
|
698
|
+
plan: AccountPlanType;
|
|
699
|
+
/** Creem subscription ID (if subscribed) */
|
|
700
|
+
subscriptionId?: string;
|
|
701
|
+
/** Number of subscription units (1 unit = 1 custom domain) */
|
|
702
|
+
units?: number;
|
|
703
|
+
/** Number of custom domains currently in use */
|
|
704
|
+
customDomains?: number;
|
|
705
|
+
/** Subscription status from Creem (active, trialing, canceled, etc.) */
|
|
706
|
+
status?: string;
|
|
707
|
+
/** Link to Creem customer portal for subscription management */
|
|
708
|
+
portalLink?: string | null;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* Checkout session response from POST /subscriptions/checkout
|
|
713
|
+
*/
|
|
714
|
+
export interface CheckoutSession {
|
|
715
|
+
/** URL to redirect user to Creem checkout page */
|
|
716
|
+
checkoutUrl: string;
|
|
717
|
+
/** Creem checkout session ID */
|
|
718
|
+
checkoutId: string;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* Subscription sync request body for POST /subscriptions/sync
|
|
723
|
+
*/
|
|
724
|
+
export interface SubscriptionSyncRequest {
|
|
725
|
+
/** Creem subscription ID received after checkout */
|
|
726
|
+
subscriptionId: string;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
/**
|
|
730
|
+
* Subscription resource interface - the contract all implementations must follow
|
|
731
|
+
*
|
|
732
|
+
* IMPOSSIBLE SIMPLICITY: No sync() method needed!
|
|
733
|
+
* Webhooks are the single source of truth. Frontend just polls status().
|
|
734
|
+
*/
|
|
735
|
+
export interface SubscriptionResource {
|
|
736
|
+
/**
|
|
737
|
+
* Create a checkout session
|
|
738
|
+
* @returns Checkout session with URL to redirect user
|
|
739
|
+
*/
|
|
740
|
+
checkout: () => Promise<CheckoutSession>;
|
|
741
|
+
|
|
742
|
+
/**
|
|
743
|
+
* Get current subscription status
|
|
744
|
+
* @returns Subscription status and usage information
|
|
745
|
+
*/
|
|
746
|
+
status: () => Promise<SubscriptionStatus>;
|
|
747
|
+
}
|
|
748
|
+
|
|
672
749
|
/**
|
|
673
750
|
* Keys resource interface - the contract all implementations must follow
|
|
674
751
|
*/
|