@shipstatic/types 0.3.17 → 0.3.18

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
@@ -91,6 +91,48 @@ export interface DomainListResponse {
91
91
  /** Total number of domains if available */
92
92
  total?: number;
93
93
  }
94
+ /**
95
+ * DNS record types supported for domain configuration
96
+ */
97
+ export type DnsRecordType = 'A' | 'CNAME';
98
+ /**
99
+ * DNS record required for domain configuration
100
+ */
101
+ export interface DnsRecord {
102
+ /** Record type (A for apex, CNAME for subdomains) */
103
+ type: DnsRecordType;
104
+ /** The DNS name to configure */
105
+ name: string;
106
+ /** The value to set (IP for A, hostname for CNAME) */
107
+ value: string;
108
+ }
109
+ /**
110
+ * DNS provider information for a domain
111
+ */
112
+ export interface DnsProvider {
113
+ /** Provider name (e.g., "Cloudflare", "GoDaddy") */
114
+ name?: string;
115
+ }
116
+ /**
117
+ * Response for domain DNS provider lookup
118
+ */
119
+ export interface DomainDnsResponse {
120
+ /** The domain name */
121
+ domain: string;
122
+ /** DNS provider information, null if not yet looked up */
123
+ dns: {
124
+ provider?: DnsProvider;
125
+ } | null;
126
+ }
127
+ /**
128
+ * Response for domain DNS records
129
+ */
130
+ export interface DomainRecordsResponse {
131
+ /** The domain name */
132
+ domain: string;
133
+ /** Required DNS records for configuration */
134
+ records: DnsRecord[];
135
+ }
94
136
  /**
95
137
  * Response for deployment removal
96
138
  */
@@ -214,8 +256,6 @@ export declare enum ErrorType {
214
256
  /** Configuration error */
215
257
  Config = "config_error"
216
258
  }
217
- /** @deprecated Use ErrorType instead. Kept for backward compatibility. */
218
- export declare const ShipErrorType: typeof ErrorType;
219
259
  /**
220
260
  * Standard error response format used everywhere
221
261
  */
@@ -385,6 +425,32 @@ export interface PlatformConfig {
385
425
  deployToken?: string;
386
426
  apiKey?: string;
387
427
  }
428
+ /**
429
+ * Resolved configuration with required apiUrl.
430
+ * This is the normalized config after merging options, env, and config files.
431
+ */
432
+ export interface ResolvedConfig {
433
+ /** API URL (always present after resolution, defaults to DEFAULT_API) */
434
+ apiUrl: string;
435
+ /** API key for authenticated deployments */
436
+ apiKey?: string;
437
+ /** Deploy token for single-use deployments */
438
+ deployToken?: string;
439
+ }
440
+ /**
441
+ * Progress information for deploy/upload operations.
442
+ * Provides consistent percentage-based progress with byte-level details.
443
+ */
444
+ export interface ProgressInfo {
445
+ /** Progress percentage (0-100) */
446
+ percent: number;
447
+ /** Number of bytes loaded so far */
448
+ loaded: number;
449
+ /** Total number of bytes to load. May be 0 if unknown initially */
450
+ total: number;
451
+ /** Current file being processed (optional) */
452
+ file?: string;
453
+ }
388
454
  /** Default API URL if not otherwise configured. */
389
455
  export declare const DEFAULT_API = "https://api.shipstatic.com";
390
456
  /**
@@ -414,14 +480,8 @@ export interface DomainResource {
414
480
  confirm: (domainName: string) => Promise<{
415
481
  message: string;
416
482
  }>;
417
- dns: (domainName: string) => Promise<{
418
- domain: string;
419
- dns: any;
420
- }>;
421
- records: (domainName: string) => Promise<{
422
- domain: string;
423
- records: any[];
424
- }>;
483
+ dns: (domainName: string) => Promise<DomainDnsResponse>;
484
+ records: (domainName: string) => Promise<DomainRecordsResponse>;
425
485
  share: (domainName: string) => Promise<{
426
486
  domain: string;
427
487
  hash: string;
package/dist/index.js CHANGED
@@ -70,8 +70,6 @@ export var ErrorType;
70
70
  /** Configuration error */
71
71
  ErrorType["Config"] = "config_error";
72
72
  })(ErrorType || (ErrorType = {}));
73
- /** @deprecated Use ErrorType instead. Kept for backward compatibility. */
74
- export const ShipErrorType = ErrorType;
75
73
  /**
76
74
  * Categorizes error types for better type checking
77
75
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipstatic/types",
3
- "version": "0.3.17",
3
+ "version": "0.3.18",
4
4
  "description": "Shared types for Shipstatic platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -109,6 +109,51 @@ export interface DomainListResponse {
109
109
  total?: number;
110
110
  }
111
111
 
112
+ /**
113
+ * DNS record types supported for domain configuration
114
+ */
115
+ export type DnsRecordType = 'A' | 'CNAME';
116
+
117
+ /**
118
+ * DNS record required for domain configuration
119
+ */
120
+ export interface DnsRecord {
121
+ /** Record type (A for apex, CNAME for subdomains) */
122
+ type: DnsRecordType;
123
+ /** The DNS name to configure */
124
+ name: string;
125
+ /** The value to set (IP for A, hostname for CNAME) */
126
+ value: string;
127
+ }
128
+
129
+ /**
130
+ * DNS provider information for a domain
131
+ */
132
+ export interface DnsProvider {
133
+ /** Provider name (e.g., "Cloudflare", "GoDaddy") */
134
+ name?: string;
135
+ }
136
+
137
+ /**
138
+ * Response for domain DNS provider lookup
139
+ */
140
+ export interface DomainDnsResponse {
141
+ /** The domain name */
142
+ domain: string;
143
+ /** DNS provider information, null if not yet looked up */
144
+ dns: { provider?: DnsProvider } | null;
145
+ }
146
+
147
+ /**
148
+ * Response for domain DNS records
149
+ */
150
+ export interface DomainRecordsResponse {
151
+ /** The domain name */
152
+ domain: string;
153
+ /** Required DNS records for configuration */
154
+ records: DnsRecord[];
155
+ }
156
+
112
157
  /**
113
158
  * Response for deployment removal
114
159
  */
@@ -253,9 +298,6 @@ export enum ErrorType {
253
298
  Config = "config_error"
254
299
  }
255
300
 
256
- /** @deprecated Use ErrorType instead. Kept for backward compatibility. */
257
- export const ShipErrorType = ErrorType;
258
-
259
301
  /**
260
302
  * Categorizes error types for better type checking
261
303
  */
@@ -331,7 +373,6 @@ export class ShipError extends Error {
331
373
  return new ShipError(ErrorType.Authentication, message, 401, details);
332
374
  }
333
375
 
334
-
335
376
  static business(message: string, status: number = 400): ShipError {
336
377
  return new ShipError(ErrorType.Business, message, status);
337
378
  }
@@ -404,13 +445,6 @@ export class ShipError extends Error {
404
445
  }
405
446
  }
406
447
 
407
- // =============================================================================
408
- // CONFIGURATION CONSTANTS
409
- // =============================================================================
410
-
411
-
412
-
413
-
414
448
  // =============================================================================
415
449
  // CONFIG TYPES
416
450
  // =============================================================================
@@ -453,7 +487,6 @@ export interface PingResponse {
453
487
  timestamp?: number;
454
488
  }
455
489
 
456
-
457
490
  // API Key Configuration
458
491
  export const API_KEY_PREFIX = 'ship-';
459
492
  export const API_KEY_HEX_LENGTH = 64;
@@ -628,6 +661,38 @@ export interface PlatformConfig {
628
661
  apiKey?: string;
629
662
  }
630
663
 
664
+ /**
665
+ * Resolved configuration with required apiUrl.
666
+ * This is the normalized config after merging options, env, and config files.
667
+ */
668
+ export interface ResolvedConfig {
669
+ /** API URL (always present after resolution, defaults to DEFAULT_API) */
670
+ apiUrl: string;
671
+ /** API key for authenticated deployments */
672
+ apiKey?: string;
673
+ /** Deploy token for single-use deployments */
674
+ deployToken?: string;
675
+ }
676
+
677
+ // =============================================================================
678
+ // PROGRESS TRACKING
679
+ // =============================================================================
680
+
681
+ /**
682
+ * Progress information for deploy/upload operations.
683
+ * Provides consistent percentage-based progress with byte-level details.
684
+ */
685
+ export interface ProgressInfo {
686
+ /** Progress percentage (0-100) */
687
+ percent: number;
688
+ /** Number of bytes loaded so far */
689
+ loaded: number;
690
+ /** Total number of bytes to load. May be 0 if unknown initially */
691
+ total: number;
692
+ /** Current file being processed (optional) */
693
+ file?: string;
694
+ }
695
+
631
696
  // =============================================================================
632
697
  // PLATFORM CONSTANTS
633
698
  // =============================================================================
@@ -666,8 +731,8 @@ export interface DomainResource {
666
731
  list: () => Promise<DomainListResponse>;
667
732
  remove: (domainName: string) => Promise<void>;
668
733
  confirm: (domainName: string) => Promise<{ message: string }>;
669
- dns: (domainName: string) => Promise<{ domain: string; dns: any }>;
670
- records: (domainName: string) => Promise<{ domain: string; records: any[] }>;
734
+ dns: (domainName: string) => Promise<DomainDnsResponse>;
735
+ records: (domainName: string) => Promise<DomainRecordsResponse>;
671
736
  share: (domainName: string) => Promise<{ domain: string; hash: string }>;
672
737
  }
673
738