@shipstatic/types 0.1.2 → 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 +3 -2
- package/dist/index.js +8 -0
- package/package.json +1 -1
- package/src/index.ts +12 -3
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;
|
|
@@ -209,3 +209,4 @@ export interface PingResponse {
|
|
|
209
209
|
timestamp?: number;
|
|
210
210
|
}
|
|
211
211
|
export declare const API_KEY_PREFIX = "ship-";
|
|
212
|
+
export declare const DEPLOYMENT_CONFIG_FILENAME = "ship.json";
|
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;
|
|
@@ -153,3 +159,5 @@ export const serverConfig = {
|
|
|
153
159
|
};
|
|
154
160
|
// API Key Configuration
|
|
155
161
|
export const API_KEY_PREFIX = 'ship-';
|
|
162
|
+
// Deployment Configuration
|
|
163
|
+
export const DEPLOYMENT_CONFIG_FILENAME = 'ship.json';
|
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;
|
|
@@ -344,4 +350,7 @@ export interface PingResponse {
|
|
|
344
350
|
|
|
345
351
|
|
|
346
352
|
// API Key Configuration
|
|
347
|
-
export const API_KEY_PREFIX = 'ship-';
|
|
353
|
+
export const API_KEY_PREFIX = 'ship-';
|
|
354
|
+
|
|
355
|
+
// Deployment Configuration
|
|
356
|
+
export const DEPLOYMENT_CONFIG_FILENAME = 'ship.json';
|