@shipstatic/types 0.3.4 → 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 +78 -0
- package/dist/index.js +2 -1
- package/package.json +1 -1
- package/src/index.ts +91 -1
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
|
|
@@ -288,6 +300,7 @@ export declare const AuthMethod: {
|
|
|
288
300
|
readonly JWT: "jwt";
|
|
289
301
|
readonly API_KEY: "apiKey";
|
|
290
302
|
readonly TOKEN: "token";
|
|
303
|
+
readonly WEBHOOK: "webhook";
|
|
291
304
|
};
|
|
292
305
|
export type AuthMethodType = typeof AuthMethod[keyof typeof AuthMethod];
|
|
293
306
|
export declare const DEPLOYMENT_CONFIG_FILENAME = "ship.json";
|
|
@@ -423,6 +436,71 @@ export interface TokenResource {
|
|
|
423
436
|
list: () => Promise<TokenListResponse>;
|
|
424
437
|
remove: (token: string) => Promise<void>;
|
|
425
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
|
+
}
|
|
426
504
|
/**
|
|
427
505
|
* Keys resource interface - the contract all implementations must follow
|
|
428
506
|
*/
|
package/dist/index.js
CHANGED
|
@@ -193,7 +193,8 @@ export const DEPLOY_TOKEN_TOTAL_LENGTH = DEPLOY_TOKEN_PREFIX.length + DEPLOY_TOK
|
|
|
193
193
|
export const AuthMethod = {
|
|
194
194
|
JWT: 'jwt',
|
|
195
195
|
API_KEY: 'apiKey',
|
|
196
|
-
TOKEN: 'token'
|
|
196
|
+
TOKEN: 'token',
|
|
197
|
+
WEBHOOK: 'webhook'
|
|
197
198
|
};
|
|
198
199
|
// Deployment Configuration
|
|
199
200
|
export const DEPLOYMENT_CONFIG_FILENAME = 'ship.json';
|
package/package.json
CHANGED
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
|
// =============================================================================
|
|
@@ -451,7 +464,8 @@ export const DEPLOY_TOKEN_TOTAL_LENGTH = DEPLOY_TOKEN_PREFIX.length + DEPLOY_TOK
|
|
|
451
464
|
export const AuthMethod = {
|
|
452
465
|
JWT: 'jwt',
|
|
453
466
|
API_KEY: 'apiKey',
|
|
454
|
-
TOKEN: 'token'
|
|
467
|
+
TOKEN: 'token',
|
|
468
|
+
WEBHOOK: 'webhook'
|
|
455
469
|
} as const;
|
|
456
470
|
|
|
457
471
|
export type AuthMethodType = typeof AuthMethod[keyof typeof AuthMethod];
|
|
@@ -668,6 +682,82 @@ export interface TokenResource {
|
|
|
668
682
|
remove: (token: string) => Promise<void>;
|
|
669
683
|
}
|
|
670
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
|
+
|
|
671
761
|
/**
|
|
672
762
|
* Keys resource interface - the contract all implementations must follow
|
|
673
763
|
*/
|