@shipstatic/types 0.3.9 → 0.3.11
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 -15
- package/package.json +1 -1
- package/src/index.ts +27 -16
package/dist/index.d.ts
CHANGED
|
@@ -440,26 +440,26 @@ export interface TokenResource {
|
|
|
440
440
|
remove: (token: string) => Promise<void>;
|
|
441
441
|
}
|
|
442
442
|
/**
|
|
443
|
-
*
|
|
443
|
+
* Billing status response from GET /billing/status
|
|
444
444
|
*/
|
|
445
|
-
export interface
|
|
446
|
-
/** Whether the account has an active
|
|
447
|
-
|
|
445
|
+
export interface BillingStatus {
|
|
446
|
+
/** Whether the account has an active billing plan */
|
|
447
|
+
hasActiveBilling: boolean;
|
|
448
448
|
/** Current account plan */
|
|
449
449
|
plan: AccountPlanType;
|
|
450
|
-
/** Creem
|
|
451
|
-
|
|
452
|
-
/** Number of
|
|
450
|
+
/** Creem billing ID (if subscribed) */
|
|
451
|
+
billing?: string;
|
|
452
|
+
/** Number of billing units (1 unit = 1 custom domain) */
|
|
453
453
|
units?: number;
|
|
454
454
|
/** Number of custom domains currently in use */
|
|
455
455
|
customDomains?: number;
|
|
456
|
-
/**
|
|
456
|
+
/** Billing status from Creem (active, trialing, canceled, etc.) */
|
|
457
457
|
status?: string;
|
|
458
|
-
/** Link to Creem customer portal for
|
|
458
|
+
/** Link to Creem customer portal for billing management */
|
|
459
459
|
portalLink?: string | null;
|
|
460
460
|
}
|
|
461
461
|
/**
|
|
462
|
-
* Checkout session response from POST /
|
|
462
|
+
* Checkout session response from POST /billing/checkout
|
|
463
463
|
*/
|
|
464
464
|
export interface CheckoutSession {
|
|
465
465
|
/** URL to redirect user to Creem checkout page */
|
|
@@ -468,23 +468,31 @@ export interface CheckoutSession {
|
|
|
468
468
|
checkoutId: string;
|
|
469
469
|
}
|
|
470
470
|
/**
|
|
471
|
-
*
|
|
471
|
+
* Billing resource interface - the contract all implementations must follow
|
|
472
472
|
*
|
|
473
473
|
* IMPOSSIBLE SIMPLICITY: No sync() method needed!
|
|
474
474
|
* Webhooks are the single source of truth. Frontend just polls status().
|
|
475
475
|
*/
|
|
476
|
-
export interface
|
|
476
|
+
export interface BillingResource {
|
|
477
477
|
/**
|
|
478
478
|
* Create a checkout session
|
|
479
479
|
* @returns Checkout session with URL to redirect user
|
|
480
480
|
*/
|
|
481
481
|
checkout: () => Promise<CheckoutSession>;
|
|
482
482
|
/**
|
|
483
|
-
* Get current
|
|
484
|
-
* @returns
|
|
483
|
+
* Get current billing status
|
|
484
|
+
* @returns Billing status and usage information
|
|
485
485
|
*/
|
|
486
|
-
status: () => Promise<
|
|
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;
|
|
488
496
|
/**
|
|
489
497
|
* Keys resource interface - the contract all implementations must follow
|
|
490
498
|
*/
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -686,31 +686,31 @@ export interface TokenResource {
|
|
|
686
686
|
}
|
|
687
687
|
|
|
688
688
|
// =============================================================================
|
|
689
|
-
//
|
|
689
|
+
// BILLING TYPES
|
|
690
690
|
// =============================================================================
|
|
691
691
|
|
|
692
692
|
/**
|
|
693
|
-
*
|
|
693
|
+
* Billing status response from GET /billing/status
|
|
694
694
|
*/
|
|
695
|
-
export interface
|
|
696
|
-
/** Whether the account has an active
|
|
697
|
-
|
|
695
|
+
export interface BillingStatus {
|
|
696
|
+
/** Whether the account has an active billing plan */
|
|
697
|
+
hasActiveBilling: boolean;
|
|
698
698
|
/** Current account plan */
|
|
699
699
|
plan: AccountPlanType;
|
|
700
|
-
/** Creem
|
|
701
|
-
|
|
702
|
-
/** Number of
|
|
700
|
+
/** Creem billing ID (if subscribed) */
|
|
701
|
+
billing?: string;
|
|
702
|
+
/** Number of billing units (1 unit = 1 custom domain) */
|
|
703
703
|
units?: number;
|
|
704
704
|
/** Number of custom domains currently in use */
|
|
705
705
|
customDomains?: number;
|
|
706
|
-
/**
|
|
706
|
+
/** Billing status from Creem (active, trialing, canceled, etc.) */
|
|
707
707
|
status?: string;
|
|
708
|
-
/** Link to Creem customer portal for
|
|
708
|
+
/** Link to Creem customer portal for billing management */
|
|
709
709
|
portalLink?: string | null;
|
|
710
710
|
}
|
|
711
711
|
|
|
712
712
|
/**
|
|
713
|
-
* Checkout session response from POST /
|
|
713
|
+
* Checkout session response from POST /billing/checkout
|
|
714
714
|
*/
|
|
715
715
|
export interface CheckoutSession {
|
|
716
716
|
/** URL to redirect user to Creem checkout page */
|
|
@@ -720,12 +720,12 @@ export interface CheckoutSession {
|
|
|
720
720
|
}
|
|
721
721
|
|
|
722
722
|
/**
|
|
723
|
-
*
|
|
723
|
+
* Billing resource interface - the contract all implementations must follow
|
|
724
724
|
*
|
|
725
725
|
* IMPOSSIBLE SIMPLICITY: No sync() method needed!
|
|
726
726
|
* Webhooks are the single source of truth. Frontend just polls status().
|
|
727
727
|
*/
|
|
728
|
-
export interface
|
|
728
|
+
export interface BillingResource {
|
|
729
729
|
/**
|
|
730
730
|
* Create a checkout session
|
|
731
731
|
* @returns Checkout session with URL to redirect user
|
|
@@ -733,12 +733,23 @@ export interface SubscriptionResource {
|
|
|
733
733
|
checkout: () => Promise<CheckoutSession>;
|
|
734
734
|
|
|
735
735
|
/**
|
|
736
|
-
* Get current
|
|
737
|
-
* @returns
|
|
736
|
+
* Get current billing status
|
|
737
|
+
* @returns Billing status and usage information
|
|
738
738
|
*/
|
|
739
|
-
status: () => Promise<
|
|
739
|
+
status: () => Promise<BillingStatus>;
|
|
740
740
|
}
|
|
741
741
|
|
|
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
|
+
|
|
742
753
|
/**
|
|
743
754
|
* Keys resource interface - the contract all implementations must follow
|
|
744
755
|
*/
|