@shipstatic/types 0.3.8 → 0.3.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/README.md +1 -1
- package/dist/index.d.ts +17 -16
- package/dist/index.js +3 -2
- package/package.json +1 -1
- package/src/index.ts +19 -18
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ interface Account {
|
|
|
48
48
|
email: string; // User email address
|
|
49
49
|
name: string; // User display name
|
|
50
50
|
picture?: string; // Profile picture URL
|
|
51
|
-
plan: 'free' | '
|
|
51
|
+
plan: 'free' | 'standard' | 'sponsored' | 'enterprise' | 'suspended' | 'terminating' | 'terminated'; // Account plan status
|
|
52
52
|
created: number; // Unix timestamp (seconds)
|
|
53
53
|
}
|
|
54
54
|
```
|
package/dist/index.d.ts
CHANGED
|
@@ -147,7 +147,7 @@ export interface TokenCreateResponse {
|
|
|
147
147
|
*/
|
|
148
148
|
export declare const AccountPlan: {
|
|
149
149
|
readonly FREE: "free";
|
|
150
|
-
readonly
|
|
150
|
+
readonly STANDARD: "standard";
|
|
151
151
|
readonly SPONSORED: "sponsored";
|
|
152
152
|
readonly ENTERPRISE: "enterprise";
|
|
153
153
|
readonly SUSPENDED: "suspended";
|
|
@@ -303,6 +303,7 @@ export declare const AuthMethod: {
|
|
|
303
303
|
readonly API_KEY: "apiKey";
|
|
304
304
|
readonly TOKEN: "token";
|
|
305
305
|
readonly WEBHOOK: "webhook";
|
|
306
|
+
readonly SYSTEM: "system";
|
|
306
307
|
};
|
|
307
308
|
export type AuthMethodType = typeof AuthMethod[keyof typeof AuthMethod];
|
|
308
309
|
export declare const DEPLOYMENT_CONFIG_FILENAME = "ship.json";
|
|
@@ -439,26 +440,26 @@ export interface TokenResource {
|
|
|
439
440
|
remove: (token: string) => Promise<void>;
|
|
440
441
|
}
|
|
441
442
|
/**
|
|
442
|
-
*
|
|
443
|
+
* Billing status response from GET /billing/status
|
|
443
444
|
*/
|
|
444
|
-
export interface
|
|
445
|
-
/** Whether the account has an active
|
|
446
|
-
|
|
445
|
+
export interface BillingStatus {
|
|
446
|
+
/** Whether the account has an active billing plan */
|
|
447
|
+
hasActiveBilling: boolean;
|
|
447
448
|
/** Current account plan */
|
|
448
449
|
plan: AccountPlanType;
|
|
449
|
-
/** Creem
|
|
450
|
-
|
|
451
|
-
/** Number of
|
|
450
|
+
/** Creem billing ID (if subscribed) */
|
|
451
|
+
billing?: string;
|
|
452
|
+
/** Number of billing units (1 unit = 1 custom domain) */
|
|
452
453
|
units?: number;
|
|
453
454
|
/** Number of custom domains currently in use */
|
|
454
455
|
customDomains?: number;
|
|
455
|
-
/**
|
|
456
|
+
/** Billing status from Creem (active, trialing, canceled, etc.) */
|
|
456
457
|
status?: string;
|
|
457
|
-
/** Link to Creem customer portal for
|
|
458
|
+
/** Link to Creem customer portal for billing management */
|
|
458
459
|
portalLink?: string | null;
|
|
459
460
|
}
|
|
460
461
|
/**
|
|
461
|
-
* Checkout session response from POST /
|
|
462
|
+
* Checkout session response from POST /billing/checkout
|
|
462
463
|
*/
|
|
463
464
|
export interface CheckoutSession {
|
|
464
465
|
/** URL to redirect user to Creem checkout page */
|
|
@@ -467,22 +468,22 @@ export interface CheckoutSession {
|
|
|
467
468
|
checkoutId: string;
|
|
468
469
|
}
|
|
469
470
|
/**
|
|
470
|
-
*
|
|
471
|
+
* Billing resource interface - the contract all implementations must follow
|
|
471
472
|
*
|
|
472
473
|
* IMPOSSIBLE SIMPLICITY: No sync() method needed!
|
|
473
474
|
* Webhooks are the single source of truth. Frontend just polls status().
|
|
474
475
|
*/
|
|
475
|
-
export interface
|
|
476
|
+
export interface BillingResource {
|
|
476
477
|
/**
|
|
477
478
|
* Create a checkout session
|
|
478
479
|
* @returns Checkout session with URL to redirect user
|
|
479
480
|
*/
|
|
480
481
|
checkout: () => Promise<CheckoutSession>;
|
|
481
482
|
/**
|
|
482
|
-
* Get current
|
|
483
|
-
* @returns
|
|
483
|
+
* Get current billing status
|
|
484
|
+
* @returns Billing status and usage information
|
|
484
485
|
*/
|
|
485
|
-
status: () => Promise<
|
|
486
|
+
status: () => Promise<BillingStatus>;
|
|
486
487
|
}
|
|
487
488
|
/**
|
|
488
489
|
* Keys resource interface - the contract all implementations must follow
|
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ export const DomainStatus = {
|
|
|
34
34
|
*/
|
|
35
35
|
export const AccountPlan = {
|
|
36
36
|
FREE: 'free',
|
|
37
|
-
|
|
37
|
+
STANDARD: 'standard',
|
|
38
38
|
SPONSORED: 'sponsored',
|
|
39
39
|
ENTERPRISE: 'enterprise',
|
|
40
40
|
SUSPENDED: 'suspended',
|
|
@@ -194,7 +194,8 @@ export const AuthMethod = {
|
|
|
194
194
|
JWT: 'jwt',
|
|
195
195
|
API_KEY: 'apiKey',
|
|
196
196
|
TOKEN: 'token',
|
|
197
|
-
WEBHOOK: 'webhook'
|
|
197
|
+
WEBHOOK: 'webhook',
|
|
198
|
+
SYSTEM: 'system'
|
|
198
199
|
};
|
|
199
200
|
// Deployment Configuration
|
|
200
201
|
export const DEPLOYMENT_CONFIG_FILENAME = 'ship.json';
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -177,7 +177,7 @@ export interface TokenCreateResponse {
|
|
|
177
177
|
*/
|
|
178
178
|
export const AccountPlan = {
|
|
179
179
|
FREE: 'free',
|
|
180
|
-
|
|
180
|
+
STANDARD: 'standard',
|
|
181
181
|
SPONSORED: 'sponsored',
|
|
182
182
|
ENTERPRISE: 'enterprise',
|
|
183
183
|
SUSPENDED: 'suspended',
|
|
@@ -467,7 +467,8 @@ export const AuthMethod = {
|
|
|
467
467
|
JWT: 'jwt',
|
|
468
468
|
API_KEY: 'apiKey',
|
|
469
469
|
TOKEN: 'token',
|
|
470
|
-
WEBHOOK: 'webhook'
|
|
470
|
+
WEBHOOK: 'webhook',
|
|
471
|
+
SYSTEM: 'system'
|
|
471
472
|
} as const;
|
|
472
473
|
|
|
473
474
|
export type AuthMethodType = typeof AuthMethod[keyof typeof AuthMethod];
|
|
@@ -685,31 +686,31 @@ export interface TokenResource {
|
|
|
685
686
|
}
|
|
686
687
|
|
|
687
688
|
// =============================================================================
|
|
688
|
-
//
|
|
689
|
+
// BILLING TYPES
|
|
689
690
|
// =============================================================================
|
|
690
691
|
|
|
691
692
|
/**
|
|
692
|
-
*
|
|
693
|
+
* Billing status response from GET /billing/status
|
|
693
694
|
*/
|
|
694
|
-
export interface
|
|
695
|
-
/** Whether the account has an active
|
|
696
|
-
|
|
695
|
+
export interface BillingStatus {
|
|
696
|
+
/** Whether the account has an active billing plan */
|
|
697
|
+
hasActiveBilling: boolean;
|
|
697
698
|
/** Current account plan */
|
|
698
699
|
plan: AccountPlanType;
|
|
699
|
-
/** Creem
|
|
700
|
-
|
|
701
|
-
/** Number of
|
|
700
|
+
/** Creem billing ID (if subscribed) */
|
|
701
|
+
billing?: string;
|
|
702
|
+
/** Number of billing units (1 unit = 1 custom domain) */
|
|
702
703
|
units?: number;
|
|
703
704
|
/** Number of custom domains currently in use */
|
|
704
705
|
customDomains?: number;
|
|
705
|
-
/**
|
|
706
|
+
/** Billing status from Creem (active, trialing, canceled, etc.) */
|
|
706
707
|
status?: string;
|
|
707
|
-
/** Link to Creem customer portal for
|
|
708
|
+
/** Link to Creem customer portal for billing management */
|
|
708
709
|
portalLink?: string | null;
|
|
709
710
|
}
|
|
710
711
|
|
|
711
712
|
/**
|
|
712
|
-
* Checkout session response from POST /
|
|
713
|
+
* Checkout session response from POST /billing/checkout
|
|
713
714
|
*/
|
|
714
715
|
export interface CheckoutSession {
|
|
715
716
|
/** URL to redirect user to Creem checkout page */
|
|
@@ -719,12 +720,12 @@ export interface CheckoutSession {
|
|
|
719
720
|
}
|
|
720
721
|
|
|
721
722
|
/**
|
|
722
|
-
*
|
|
723
|
+
* Billing resource interface - the contract all implementations must follow
|
|
723
724
|
*
|
|
724
725
|
* IMPOSSIBLE SIMPLICITY: No sync() method needed!
|
|
725
726
|
* Webhooks are the single source of truth. Frontend just polls status().
|
|
726
727
|
*/
|
|
727
|
-
export interface
|
|
728
|
+
export interface BillingResource {
|
|
728
729
|
/**
|
|
729
730
|
* Create a checkout session
|
|
730
731
|
* @returns Checkout session with URL to redirect user
|
|
@@ -732,10 +733,10 @@ export interface SubscriptionResource {
|
|
|
732
733
|
checkout: () => Promise<CheckoutSession>;
|
|
733
734
|
|
|
734
735
|
/**
|
|
735
|
-
* Get current
|
|
736
|
-
* @returns
|
|
736
|
+
* Get current billing status
|
|
737
|
+
* @returns Billing status and usage information
|
|
737
738
|
*/
|
|
738
|
-
status: () => Promise<
|
|
739
|
+
status: () => Promise<BillingStatus>;
|
|
739
740
|
}
|
|
740
741
|
|
|
741
742
|
/**
|