@shipstatic/types 0.3.16 → 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 +71 -12
- package/dist/index.js +1 -4
- package/package.json +1 -1
- package/src/index.ts +80 -16
package/dist/index.d.ts
CHANGED
|
@@ -56,8 +56,7 @@ export interface DeploymentListResponse {
|
|
|
56
56
|
export declare const DomainStatus: {
|
|
57
57
|
readonly PENDING: "pending";
|
|
58
58
|
readonly PARTIAL: "partial";
|
|
59
|
-
readonly
|
|
60
|
-
readonly FAILED: "failed";
|
|
59
|
+
readonly SUCCESS: "success";
|
|
61
60
|
};
|
|
62
61
|
export type DomainStatusType = typeof DomainStatus[keyof typeof DomainStatus];
|
|
63
62
|
/**
|
|
@@ -92,6 +91,48 @@ export interface DomainListResponse {
|
|
|
92
91
|
/** Total number of domains if available */
|
|
93
92
|
total?: number;
|
|
94
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
|
+
}
|
|
95
136
|
/**
|
|
96
137
|
* Response for deployment removal
|
|
97
138
|
*/
|
|
@@ -215,8 +256,6 @@ export declare enum ErrorType {
|
|
|
215
256
|
/** Configuration error */
|
|
216
257
|
Config = "config_error"
|
|
217
258
|
}
|
|
218
|
-
/** @deprecated Use ErrorType instead. Kept for backward compatibility. */
|
|
219
|
-
export declare const ShipErrorType: typeof ErrorType;
|
|
220
259
|
/**
|
|
221
260
|
* Standard error response format used everywhere
|
|
222
261
|
*/
|
|
@@ -386,6 +425,32 @@ export interface PlatformConfig {
|
|
|
386
425
|
deployToken?: string;
|
|
387
426
|
apiKey?: string;
|
|
388
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
|
+
}
|
|
389
454
|
/** Default API URL if not otherwise configured. */
|
|
390
455
|
export declare const DEFAULT_API = "https://api.shipstatic.com";
|
|
391
456
|
/**
|
|
@@ -415,14 +480,8 @@ export interface DomainResource {
|
|
|
415
480
|
confirm: (domainName: string) => Promise<{
|
|
416
481
|
message: string;
|
|
417
482
|
}>;
|
|
418
|
-
dns: (domainName: string) => Promise<
|
|
419
|
-
|
|
420
|
-
dns: any;
|
|
421
|
-
}>;
|
|
422
|
-
records: (domainName: string) => Promise<{
|
|
423
|
-
domain: string;
|
|
424
|
-
records: any[];
|
|
425
|
-
}>;
|
|
483
|
+
dns: (domainName: string) => Promise<DomainDnsResponse>;
|
|
484
|
+
records: (domainName: string) => Promise<DomainRecordsResponse>;
|
|
426
485
|
share: (domainName: string) => Promise<{
|
|
427
486
|
domain: string;
|
|
428
487
|
hash: string;
|
package/dist/index.js
CHANGED
|
@@ -23,8 +23,7 @@ export const DeploymentStatus = {
|
|
|
23
23
|
export const DomainStatus = {
|
|
24
24
|
PENDING: 'pending',
|
|
25
25
|
PARTIAL: 'partial',
|
|
26
|
-
|
|
27
|
-
FAILED: 'failed'
|
|
26
|
+
SUCCESS: 'success'
|
|
28
27
|
};
|
|
29
28
|
// =============================================================================
|
|
30
29
|
// ACCOUNT TYPES
|
|
@@ -71,8 +70,6 @@ export var ErrorType;
|
|
|
71
70
|
/** Configuration error */
|
|
72
71
|
ErrorType["Config"] = "config_error";
|
|
73
72
|
})(ErrorType || (ErrorType = {}));
|
|
74
|
-
/** @deprecated Use ErrorType instead. Kept for backward compatibility. */
|
|
75
|
-
export const ShipErrorType = ErrorType;
|
|
76
73
|
/**
|
|
77
74
|
* Categorizes error types for better type checking
|
|
78
75
|
*/
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -70,8 +70,7 @@ export interface DeploymentListResponse {
|
|
|
70
70
|
export const DomainStatus = {
|
|
71
71
|
PENDING: 'pending',
|
|
72
72
|
PARTIAL: 'partial',
|
|
73
|
-
|
|
74
|
-
FAILED: 'failed'
|
|
73
|
+
SUCCESS: 'success'
|
|
75
74
|
} as const;
|
|
76
75
|
|
|
77
76
|
export type DomainStatusType = typeof DomainStatus[keyof typeof DomainStatus];
|
|
@@ -110,6 +109,51 @@ export interface DomainListResponse {
|
|
|
110
109
|
total?: number;
|
|
111
110
|
}
|
|
112
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
|
+
|
|
113
157
|
/**
|
|
114
158
|
* Response for deployment removal
|
|
115
159
|
*/
|
|
@@ -254,9 +298,6 @@ export enum ErrorType {
|
|
|
254
298
|
Config = "config_error"
|
|
255
299
|
}
|
|
256
300
|
|
|
257
|
-
/** @deprecated Use ErrorType instead. Kept for backward compatibility. */
|
|
258
|
-
export const ShipErrorType = ErrorType;
|
|
259
|
-
|
|
260
301
|
/**
|
|
261
302
|
* Categorizes error types for better type checking
|
|
262
303
|
*/
|
|
@@ -332,7 +373,6 @@ export class ShipError extends Error {
|
|
|
332
373
|
return new ShipError(ErrorType.Authentication, message, 401, details);
|
|
333
374
|
}
|
|
334
375
|
|
|
335
|
-
|
|
336
376
|
static business(message: string, status: number = 400): ShipError {
|
|
337
377
|
return new ShipError(ErrorType.Business, message, status);
|
|
338
378
|
}
|
|
@@ -405,13 +445,6 @@ export class ShipError extends Error {
|
|
|
405
445
|
}
|
|
406
446
|
}
|
|
407
447
|
|
|
408
|
-
// =============================================================================
|
|
409
|
-
// CONFIGURATION CONSTANTS
|
|
410
|
-
// =============================================================================
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
448
|
// =============================================================================
|
|
416
449
|
// CONFIG TYPES
|
|
417
450
|
// =============================================================================
|
|
@@ -454,7 +487,6 @@ export interface PingResponse {
|
|
|
454
487
|
timestamp?: number;
|
|
455
488
|
}
|
|
456
489
|
|
|
457
|
-
|
|
458
490
|
// API Key Configuration
|
|
459
491
|
export const API_KEY_PREFIX = 'ship-';
|
|
460
492
|
export const API_KEY_HEX_LENGTH = 64;
|
|
@@ -629,6 +661,38 @@ export interface PlatformConfig {
|
|
|
629
661
|
apiKey?: string;
|
|
630
662
|
}
|
|
631
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
|
+
|
|
632
696
|
// =============================================================================
|
|
633
697
|
// PLATFORM CONSTANTS
|
|
634
698
|
// =============================================================================
|
|
@@ -667,8 +731,8 @@ export interface DomainResource {
|
|
|
667
731
|
list: () => Promise<DomainListResponse>;
|
|
668
732
|
remove: (domainName: string) => Promise<void>;
|
|
669
733
|
confirm: (domainName: string) => Promise<{ message: string }>;
|
|
670
|
-
dns: (domainName: string) => Promise<
|
|
671
|
-
records: (domainName: string) => Promise<
|
|
734
|
+
dns: (domainName: string) => Promise<DomainDnsResponse>;
|
|
735
|
+
records: (domainName: string) => Promise<DomainRecordsResponse>;
|
|
672
736
|
share: (domainName: string) => Promise<{ domain: string; hash: string }>;
|
|
673
737
|
}
|
|
674
738
|
|