@shipstatic/types 0.1.3 → 0.1.5
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 +4 -2
- package/dist/index.js +6 -0
- package/package.json +1 -1
- package/src/index.ts +10 -2
package/dist/index.d.ts
CHANGED
|
@@ -20,8 +20,6 @@ export interface Deployment {
|
|
|
20
20
|
createdAt: number;
|
|
21
21
|
/** Unix timestamp (seconds) when deployment expires */
|
|
22
22
|
expiresAt?: number;
|
|
23
|
-
/** Unix timestamp (seconds) when deployment was verified */
|
|
24
|
-
verifiedAt?: number;
|
|
25
23
|
}
|
|
26
24
|
/**
|
|
27
25
|
* Response for listing deployments
|
|
@@ -44,6 +42,8 @@ export interface Alias {
|
|
|
44
42
|
deploymentName: string;
|
|
45
43
|
/** Current alias status */
|
|
46
44
|
status: 'pending' | 'success' | 'failed';
|
|
45
|
+
/** The alias URL - internal (subdomain) or external (custom domain) */
|
|
46
|
+
url: string;
|
|
47
47
|
/** Unix timestamp (seconds) when alias was created */
|
|
48
48
|
createdAt: number;
|
|
49
49
|
/** Unix timestamp (seconds) when alias was confirmed */
|
|
@@ -153,6 +153,8 @@ export declare class ShipError extends Error {
|
|
|
153
153
|
static file(message: string, filePath?: string): ShipError;
|
|
154
154
|
static config(message: string, details?: any): ShipError;
|
|
155
155
|
static api(message: string, status?: number, code?: string, data?: any): ShipError;
|
|
156
|
+
static database(message: string, status?: number): ShipError;
|
|
157
|
+
static storage(message: string, status?: number): ShipError;
|
|
156
158
|
get filePath(): string | undefined;
|
|
157
159
|
get code(): string | undefined;
|
|
158
160
|
isClientError(): boolean;
|
package/dist/index.js
CHANGED
|
@@ -101,6 +101,12 @@ export class ShipError extends Error {
|
|
|
101
101
|
static api(message, status = 500, code, data) {
|
|
102
102
|
return new ShipError(ErrorType.Api, message, status, { code, data });
|
|
103
103
|
}
|
|
104
|
+
static database(message, status = 500) {
|
|
105
|
+
return new ShipError(ErrorType.Api, message, status);
|
|
106
|
+
}
|
|
107
|
+
static storage(message, status = 500) {
|
|
108
|
+
return new ShipError(ErrorType.Api, message, status);
|
|
109
|
+
}
|
|
104
110
|
// Helper getters for accessing common detail properties
|
|
105
111
|
get filePath() {
|
|
106
112
|
return this.details?.filePath;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -25,8 +25,6 @@ export interface Deployment {
|
|
|
25
25
|
createdAt: number;
|
|
26
26
|
/** Unix timestamp (seconds) when deployment expires */
|
|
27
27
|
expiresAt?: number;
|
|
28
|
-
/** Unix timestamp (seconds) when deployment was verified */
|
|
29
|
-
verifiedAt?: number;
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
|
|
@@ -56,6 +54,8 @@ export interface Alias {
|
|
|
56
54
|
deploymentName: string;
|
|
57
55
|
/** Current alias status */
|
|
58
56
|
status: 'pending' | 'success' | 'failed';
|
|
57
|
+
/** The alias URL - internal (subdomain) or external (custom domain) */
|
|
58
|
+
url: string;
|
|
59
59
|
/** Unix timestamp (seconds) when alias was created */
|
|
60
60
|
createdAt: number;
|
|
61
61
|
/** Unix timestamp (seconds) when alias was confirmed */
|
|
@@ -239,6 +239,14 @@ export class ShipError extends Error {
|
|
|
239
239
|
return new ShipError(ErrorType.Api, message, status, { code, data });
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
+
static database(message: string, status: number = 500): ShipError {
|
|
243
|
+
return new ShipError(ErrorType.Api, message, status);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
static storage(message: string, status: number = 500): ShipError {
|
|
247
|
+
return new ShipError(ErrorType.Api, message, status);
|
|
248
|
+
}
|
|
249
|
+
|
|
242
250
|
// Helper getters for accessing common detail properties
|
|
243
251
|
get filePath(): string | undefined {
|
|
244
252
|
return this.details?.filePath;
|