@shipstatic/types 0.3.5 → 0.3.6

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
@@ -172,6 +172,18 @@ 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 individual file size in bytes */
181
+ fileSize?: number;
182
+ /** Override for maximum number of files per deployment */
183
+ filesCount?: number;
184
+ /** Override for maximum total deployment size in bytes */
185
+ totalSize?: number;
186
+ }
175
187
  /**
176
188
  * All possible error types in the Shipstatic platform
177
189
  * Names are developer-friendly while wire format stays consistent
@@ -424,6 +436,71 @@ export interface TokenResource {
424
436
  list: () => Promise<TokenListResponse>;
425
437
  remove: (token: string) => Promise<void>;
426
438
  }
439
+ /**
440
+ * Subscription status response from GET /subscriptions/status
441
+ */
442
+ export interface SubscriptionStatus {
443
+ /** Whether the account has an active subscription */
444
+ hasSubscription: boolean;
445
+ /** Current account plan */
446
+ plan: AccountPlanType;
447
+ /** Creem subscription ID (if subscribed) */
448
+ subscriptionId?: string;
449
+ /** Number of subscription units (1 unit = 1 custom domain) */
450
+ units?: number;
451
+ /** Number of custom domains currently in use */
452
+ customDomains?: number;
453
+ /** Subscription status from Creem (active, trialing, canceled, etc.) */
454
+ status?: string;
455
+ /** Link to Creem customer portal for subscription management */
456
+ portalLink?: string | null;
457
+ }
458
+ /**
459
+ * Checkout session response from POST /subscriptions/checkout
460
+ */
461
+ export interface CheckoutSession {
462
+ /** URL to redirect user to Creem checkout page */
463
+ checkoutUrl: string;
464
+ /** Creem checkout session ID */
465
+ checkoutId: string;
466
+ }
467
+ /**
468
+ * Subscription sync request body for POST /subscriptions/sync
469
+ */
470
+ export interface SubscriptionSyncRequest {
471
+ /** Creem subscription ID received after checkout */
472
+ subscriptionId: string;
473
+ }
474
+ /**
475
+ * Subscription sync response from POST /subscriptions/sync
476
+ */
477
+ export interface SubscriptionSyncResponse {
478
+ /** Whether sync was successful */
479
+ success: boolean;
480
+ /** The synced subscription ID */
481
+ subscriptionId: string;
482
+ }
483
+ /**
484
+ * Subscription resource interface - the contract all implementations must follow
485
+ */
486
+ export interface SubscriptionResource {
487
+ /**
488
+ * Create a checkout session
489
+ * @returns Checkout session with URL to redirect user
490
+ */
491
+ checkout: () => Promise<CheckoutSession>;
492
+ /**
493
+ * Get current subscription status
494
+ * @returns Subscription status and usage information
495
+ */
496
+ status: () => Promise<SubscriptionStatus>;
497
+ /**
498
+ * Sync subscription ID after checkout redirect
499
+ * @param subscriptionId - Subscription ID from Creem redirect
500
+ * @returns Sync confirmation
501
+ */
502
+ sync: (subscriptionId: string) => Promise<SubscriptionSyncResponse>;
503
+ }
427
504
  /**
428
505
  * Keys resource interface - the contract all implementations must follow
429
506
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipstatic/types",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "Shared types for Shipstatic platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -205,6 +205,19 @@ 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 individual file size in bytes */
214
+ fileSize?: number;
215
+ /** Override for maximum number of files per deployment */
216
+ filesCount?: number;
217
+ /** Override for maximum total deployment size in bytes */
218
+ totalSize?: number;
219
+ }
220
+
208
221
  // =============================================================================
209
222
  // ERROR SYSTEM
210
223
  // =============================================================================
@@ -669,6 +682,82 @@ export interface TokenResource {
669
682
  remove: (token: string) => Promise<void>;
670
683
  }
671
684
 
685
+ // =============================================================================
686
+ // SUBSCRIPTION TYPES
687
+ // =============================================================================
688
+
689
+ /**
690
+ * Subscription status response from GET /subscriptions/status
691
+ */
692
+ export interface SubscriptionStatus {
693
+ /** Whether the account has an active subscription */
694
+ hasSubscription: boolean;
695
+ /** Current account plan */
696
+ plan: AccountPlanType;
697
+ /** Creem subscription ID (if subscribed) */
698
+ subscriptionId?: string;
699
+ /** Number of subscription units (1 unit = 1 custom domain) */
700
+ units?: number;
701
+ /** Number of custom domains currently in use */
702
+ customDomains?: number;
703
+ /** Subscription status from Creem (active, trialing, canceled, etc.) */
704
+ status?: string;
705
+ /** Link to Creem customer portal for subscription management */
706
+ portalLink?: string | null;
707
+ }
708
+
709
+ /**
710
+ * Checkout session response from POST /subscriptions/checkout
711
+ */
712
+ export interface CheckoutSession {
713
+ /** URL to redirect user to Creem checkout page */
714
+ checkoutUrl: string;
715
+ /** Creem checkout session ID */
716
+ checkoutId: string;
717
+ }
718
+
719
+ /**
720
+ * Subscription sync request body for POST /subscriptions/sync
721
+ */
722
+ export interface SubscriptionSyncRequest {
723
+ /** Creem subscription ID received after checkout */
724
+ subscriptionId: string;
725
+ }
726
+
727
+ /**
728
+ * Subscription sync response from POST /subscriptions/sync
729
+ */
730
+ export interface SubscriptionSyncResponse {
731
+ /** Whether sync was successful */
732
+ success: boolean;
733
+ /** The synced subscription ID */
734
+ subscriptionId: string;
735
+ }
736
+
737
+ /**
738
+ * Subscription resource interface - the contract all implementations must follow
739
+ */
740
+ export interface SubscriptionResource {
741
+ /**
742
+ * Create a checkout session
743
+ * @returns Checkout session with URL to redirect user
744
+ */
745
+ checkout: () => Promise<CheckoutSession>;
746
+
747
+ /**
748
+ * Get current subscription status
749
+ * @returns Subscription status and usage information
750
+ */
751
+ status: () => Promise<SubscriptionStatus>;
752
+
753
+ /**
754
+ * Sync subscription ID after checkout redirect
755
+ * @param subscriptionId - Subscription ID from Creem redirect
756
+ * @returns Sync confirmation
757
+ */
758
+ sync: (subscriptionId: string) => Promise<SubscriptionSyncResponse>;
759
+ }
760
+
672
761
  /**
673
762
  * Keys resource interface - the contract all implementations must follow
674
763
  */