@shipstatic/types 0.1.3 → 0.1.4
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 +2 -2
- package/dist/index.js +6 -0
- package/package.json +1 -1
- package/src/index.ts +8 -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
|
|
@@ -153,6 +151,8 @@ export declare class ShipError extends Error {
|
|
|
153
151
|
static file(message: string, filePath?: string): ShipError;
|
|
154
152
|
static config(message: string, details?: any): ShipError;
|
|
155
153
|
static api(message: string, status?: number, code?: string, data?: any): ShipError;
|
|
154
|
+
static database(message: string, status?: number): ShipError;
|
|
155
|
+
static storage(message: string, status?: number): ShipError;
|
|
156
156
|
get filePath(): string | undefined;
|
|
157
157
|
get code(): string | undefined;
|
|
158
158
|
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
|
|
|
@@ -239,6 +237,14 @@ export class ShipError extends Error {
|
|
|
239
237
|
return new ShipError(ErrorType.Api, message, status, { code, data });
|
|
240
238
|
}
|
|
241
239
|
|
|
240
|
+
static database(message: string, status: number = 500): ShipError {
|
|
241
|
+
return new ShipError(ErrorType.Api, message, status);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
static storage(message: string, status: number = 500): ShipError {
|
|
245
|
+
return new ShipError(ErrorType.Api, message, status);
|
|
246
|
+
}
|
|
247
|
+
|
|
242
248
|
// Helper getters for accessing common detail properties
|
|
243
249
|
get filePath(): string | undefined {
|
|
244
250
|
return this.details?.filePath;
|