@shipstatic/types 0.4.13 → 0.4.15
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 +14 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +16 -1
package/dist/index.d.ts
CHANGED
|
@@ -135,6 +135,19 @@ export interface DomainRecordsResponse {
|
|
|
135
135
|
/** Required DNS records for configuration */
|
|
136
136
|
records: DnsRecord[];
|
|
137
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* Response for domain validation
|
|
140
|
+
*/
|
|
141
|
+
export interface DomainValidateResponse {
|
|
142
|
+
/** Whether the domain is valid */
|
|
143
|
+
valid: boolean;
|
|
144
|
+
/** Normalized domain name (only present when valid) */
|
|
145
|
+
normalized?: string;
|
|
146
|
+
/** Whether the domain is available (only present when valid) */
|
|
147
|
+
available?: boolean;
|
|
148
|
+
/** Error message (only present when invalid) */
|
|
149
|
+
error?: string;
|
|
150
|
+
}
|
|
138
151
|
/**
|
|
139
152
|
* Response for deployment removal
|
|
140
153
|
*/
|
|
@@ -512,6 +525,7 @@ export interface DomainResource {
|
|
|
512
525
|
verify: (name: string) => Promise<{
|
|
513
526
|
message: string;
|
|
514
527
|
}>;
|
|
528
|
+
validate: (name: string) => Promise<DomainValidateResponse>;
|
|
515
529
|
dns: (name: string) => Promise<DomainDnsResponse>;
|
|
516
530
|
records: (name: string) => Promise<DomainRecordsResponse>;
|
|
517
531
|
share: (name: string) => Promise<{
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -156,6 +156,20 @@ export interface DomainRecordsResponse {
|
|
|
156
156
|
records: DnsRecord[];
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
+
/**
|
|
160
|
+
* Response for domain validation
|
|
161
|
+
*/
|
|
162
|
+
export interface DomainValidateResponse {
|
|
163
|
+
/** Whether the domain is valid */
|
|
164
|
+
valid: boolean;
|
|
165
|
+
/** Normalized domain name (only present when valid) */
|
|
166
|
+
normalized?: string;
|
|
167
|
+
/** Whether the domain is available (only present when valid) */
|
|
168
|
+
available?: boolean;
|
|
169
|
+
/** Error message (only present when invalid) */
|
|
170
|
+
error?: string;
|
|
171
|
+
}
|
|
172
|
+
|
|
159
173
|
/**
|
|
160
174
|
* Response for deployment removal
|
|
161
175
|
*/
|
|
@@ -589,7 +603,7 @@ export function validateApiUrl(apiUrl: string): void {
|
|
|
589
603
|
throw ShipError.validation('API URL must not contain query parameters or fragments');
|
|
590
604
|
}
|
|
591
605
|
} catch (error) {
|
|
592
|
-
if (error
|
|
606
|
+
if (isShipError(error)) {
|
|
593
607
|
throw error;
|
|
594
608
|
}
|
|
595
609
|
throw ShipError.validation('API URL must be a valid URL');
|
|
@@ -764,6 +778,7 @@ export interface DomainResource {
|
|
|
764
778
|
get: (name: string) => Promise<Domain>;
|
|
765
779
|
remove: (name: string) => Promise<void>;
|
|
766
780
|
verify: (name: string) => Promise<{ message: string }>;
|
|
781
|
+
validate: (name: string) => Promise<DomainValidateResponse>;
|
|
767
782
|
dns: (name: string) => Promise<DomainDnsResponse>;
|
|
768
783
|
records: (name: string) => Promise<DomainRecordsResponse>;
|
|
769
784
|
share: (name: string) => Promise<{ domain: string; hash: string }>;
|