@spfn/core 0.1.0-alpha.88 → 0.2.0-beta.1
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/README.md +1046 -384
- package/dist/boss-D-fGtVgM.d.ts +187 -0
- package/dist/cache/index.d.ts +13 -33
- package/dist/cache/index.js +14 -703
- package/dist/cache/index.js.map +1 -1
- package/dist/codegen/index.d.ts +167 -17
- package/dist/codegen/index.js +76 -1419
- package/dist/codegen/index.js.map +1 -1
- package/dist/config/index.d.ts +1191 -0
- package/dist/config/index.js +264 -0
- package/dist/config/index.js.map +1 -0
- package/dist/db/index.d.ts +728 -59
- package/dist/db/index.js +1028 -1225
- package/dist/db/index.js.map +1 -1
- package/dist/env/index.d.ts +579 -308
- package/dist/env/index.js +438 -930
- package/dist/env/index.js.map +1 -1
- package/dist/errors/index.d.ts +417 -29
- package/dist/errors/index.js +359 -98
- package/dist/errors/index.js.map +1 -1
- package/dist/event/index.d.ts +108 -0
- package/dist/event/index.js +122 -0
- package/dist/event/index.js.map +1 -0
- package/dist/job/index.d.ts +172 -0
- package/dist/job/index.js +361 -0
- package/dist/job/index.js.map +1 -0
- package/dist/logger/index.d.ts +20 -79
- package/dist/logger/index.js +82 -387
- package/dist/logger/index.js.map +1 -1
- package/dist/middleware/index.d.ts +2 -11
- package/dist/middleware/index.js +49 -703
- package/dist/middleware/index.js.map +1 -1
- package/dist/nextjs/index.d.ts +120 -0
- package/dist/nextjs/index.js +416 -0
- package/dist/nextjs/index.js.map +1 -0
- package/dist/{client/nextjs/index.d.ts → nextjs/server.d.ts} +288 -262
- package/dist/nextjs/server.js +568 -0
- package/dist/nextjs/server.js.map +1 -0
- package/dist/route/index.d.ts +667 -25
- package/dist/route/index.js +437 -1287
- package/dist/route/index.js.map +1 -1
- package/dist/route/types.d.ts +38 -0
- package/dist/route/types.js +3 -0
- package/dist/route/types.js.map +1 -0
- package/dist/server/index.d.ts +201 -67
- package/dist/server/index.js +921 -3182
- package/dist/server/index.js.map +1 -1
- package/dist/types-BGl4QL1w.d.ts +77 -0
- package/dist/types-DRG2XMTR.d.ts +157 -0
- package/package.json +52 -47
- package/dist/auto-loader-JFaZ9gON.d.ts +0 -80
- package/dist/client/index.d.ts +0 -358
- package/dist/client/index.js +0 -357
- package/dist/client/index.js.map +0 -1
- package/dist/client/nextjs/index.js +0 -371
- package/dist/client/nextjs/index.js.map +0 -1
- package/dist/codegen/generators/index.d.ts +0 -19
- package/dist/codegen/generators/index.js +0 -1404
- package/dist/codegen/generators/index.js.map +0 -1
- package/dist/database-errors-BNNmLTJE.d.ts +0 -86
- package/dist/events/index.d.ts +0 -183
- package/dist/events/index.js +0 -77
- package/dist/events/index.js.map +0 -1
- package/dist/index-DHiAqhKv.d.ts +0 -101
- package/dist/index.d.ts +0 -8
- package/dist/index.js +0 -3674
- package/dist/index.js.map +0 -1
- package/dist/types/index.d.ts +0 -121
- package/dist/types/index.js +0 -38
- package/dist/types/index.js.map +0 -1
- package/dist/types-BXibIEyj.d.ts +0 -60
package/dist/errors/index.d.ts
CHANGED
|
@@ -1,32 +1,310 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Serializable Error Base Class
|
|
3
|
+
*
|
|
4
|
+
* Base class for errors that can be serialized/deserialized across HTTP boundary.
|
|
5
|
+
* Automatically serializes public fields for transmission to client.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Serialized error format for JSON transmission
|
|
9
|
+
*/
|
|
10
|
+
interface SerializedError {
|
|
11
|
+
__type: string;
|
|
12
|
+
message: string;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Base class for all serializable errors
|
|
17
|
+
*
|
|
18
|
+
* Features:
|
|
19
|
+
* - Auto-serialization of public fields via toJSON()
|
|
20
|
+
* - Constructor accepts object with all fields
|
|
21
|
+
* - Type-safe error handling with instanceof
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* class PaymentFailedError extends SerializableError
|
|
26
|
+
* {
|
|
27
|
+
* readonly statusCode = 402;
|
|
28
|
+
* transactionId!: string;
|
|
29
|
+
* reason!: 'insufficient_funds' | 'card_declined';
|
|
30
|
+
*
|
|
31
|
+
* constructor(data: {
|
|
32
|
+
* message: string;
|
|
33
|
+
* transactionId: string;
|
|
34
|
+
* reason: 'insufficient_funds' | 'card_declined';
|
|
35
|
+
* })
|
|
36
|
+
* {
|
|
37
|
+
* super(data.message);
|
|
38
|
+
* this.name = 'PaymentFailedError';
|
|
39
|
+
* Object.assign(this, data);
|
|
40
|
+
* }
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
declare abstract class SerializableError extends Error {
|
|
45
|
+
/**
|
|
46
|
+
* HTTP status code for this error type
|
|
47
|
+
*/
|
|
48
|
+
abstract readonly statusCode: number;
|
|
49
|
+
/**
|
|
50
|
+
* Serialize error to JSON-compatible object
|
|
51
|
+
*
|
|
52
|
+
* Automatically includes:
|
|
53
|
+
* - __type: Constructor name for deserialization
|
|
54
|
+
* - message: Error message
|
|
55
|
+
* - All public instance properties (except name, stack)
|
|
56
|
+
*/
|
|
57
|
+
toJSON(): SerializedError;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Error Registry
|
|
62
|
+
*
|
|
63
|
+
* Central registry for serializable error types.
|
|
64
|
+
* Enables automatic error deserialization on the client side.
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Error constructor type
|
|
69
|
+
*/
|
|
70
|
+
type SerializableErrorConstructor = new (data: any) => SerializableError;
|
|
71
|
+
/**
|
|
72
|
+
* Input type for ErrorRegistry constructor
|
|
73
|
+
*/
|
|
74
|
+
type ErrorRegistryInput = SerializableErrorConstructor | SerializableErrorConstructor[] | ErrorRegistry;
|
|
75
|
+
/**
|
|
76
|
+
* Error registry for serialization/deserialization
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```typescript
|
|
80
|
+
* // Create registry with initial errors
|
|
81
|
+
* const registry = new ErrorRegistry([
|
|
82
|
+
* errorRegistry, // Another ErrorRegistry
|
|
83
|
+
* PaymentFailedError, // Single error class
|
|
84
|
+
* [RefundError, OrderError], // Array of error classes
|
|
85
|
+
* ]);
|
|
86
|
+
*
|
|
87
|
+
* // Or create empty and append
|
|
88
|
+
* const registry = new ErrorRegistry();
|
|
89
|
+
* registry
|
|
90
|
+
* .append(ValidationError)
|
|
91
|
+
* .append([PaymentFailedError, RefundError]);
|
|
92
|
+
*
|
|
93
|
+
* // Deserialize from JSON
|
|
94
|
+
* const error = registry.deserialize({
|
|
95
|
+
* __type: 'PaymentFailedError',
|
|
96
|
+
* message: 'Payment failed',
|
|
97
|
+
* transactionId: 'tx_123',
|
|
98
|
+
* reason: 'insufficient_funds'
|
|
99
|
+
* });
|
|
100
|
+
*
|
|
101
|
+
* // error instanceof PaymentFailedError === true
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
declare class ErrorRegistry {
|
|
105
|
+
private errors;
|
|
106
|
+
constructor(initialErrors?: ErrorRegistryInput[]);
|
|
107
|
+
/**
|
|
108
|
+
* Append error class(es) to the registry
|
|
109
|
+
*
|
|
110
|
+
* @param ErrorClass - Single error constructor
|
|
111
|
+
* @returns This registry for chaining
|
|
112
|
+
*/
|
|
113
|
+
append(ErrorClass: SerializableErrorConstructor): this;
|
|
114
|
+
/**
|
|
115
|
+
* Append error class(es) to the registry
|
|
116
|
+
*
|
|
117
|
+
* @param ErrorClasses - Array of error constructors
|
|
118
|
+
* @returns This registry for chaining
|
|
119
|
+
*/
|
|
120
|
+
append(ErrorClasses: SerializableErrorConstructor[]): this;
|
|
121
|
+
/**
|
|
122
|
+
* Concatenate another ErrorRegistry into this one
|
|
123
|
+
*
|
|
124
|
+
* @param registry - Another ErrorRegistry to merge
|
|
125
|
+
* @returns This registry for chaining
|
|
126
|
+
*/
|
|
127
|
+
concat(registry: ErrorRegistry): this;
|
|
128
|
+
/**
|
|
129
|
+
* Check if error type is registered
|
|
130
|
+
*
|
|
131
|
+
* @param name - Error class name
|
|
132
|
+
*/
|
|
133
|
+
has(name: string): boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Deserialize error from JSON data
|
|
136
|
+
*
|
|
137
|
+
* @param data - Serialized error data with __type field
|
|
138
|
+
* @returns Deserialized error instance
|
|
139
|
+
* @throws Error if error type is not registered
|
|
140
|
+
*/
|
|
141
|
+
deserialize(data: {
|
|
142
|
+
__type: string;
|
|
143
|
+
[key: string]: any;
|
|
144
|
+
}): SerializableError;
|
|
145
|
+
/**
|
|
146
|
+
* Try to deserialize error, return null if type unknown
|
|
147
|
+
*
|
|
148
|
+
* @param data - Serialized error data
|
|
149
|
+
* @returns Deserialized error or null
|
|
150
|
+
*/
|
|
151
|
+
tryDeserialize(data: {
|
|
152
|
+
__type?: string;
|
|
153
|
+
[key: string]: any;
|
|
154
|
+
}): SerializableError | null;
|
|
155
|
+
/**
|
|
156
|
+
* Get all registered error types
|
|
157
|
+
*/
|
|
158
|
+
getRegisteredTypes(): string[];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Database Error Classes
|
|
163
|
+
*
|
|
164
|
+
* Type-safe error handling with custom error class hierarchy
|
|
165
|
+
* Mapped to HTTP status codes for API responses
|
|
166
|
+
* All errors extend SerializableError for consistent JSON serialization
|
|
167
|
+
*/
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Base Database Error
|
|
171
|
+
*
|
|
172
|
+
* Base class for all database-related errors
|
|
173
|
+
*/
|
|
174
|
+
declare class DatabaseError<TDetails extends Record<string, unknown> = Record<string, unknown>> extends SerializableError {
|
|
175
|
+
readonly statusCode: number;
|
|
176
|
+
readonly details?: TDetails;
|
|
177
|
+
constructor(data: {
|
|
178
|
+
message: string;
|
|
179
|
+
statusCode?: number;
|
|
180
|
+
details?: TDetails;
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Connection Error (503 Service Unavailable)
|
|
185
|
+
*
|
|
186
|
+
* Database connection failure, connection pool exhaustion, etc.
|
|
187
|
+
*/
|
|
188
|
+
declare class ConnectionError extends DatabaseError {
|
|
189
|
+
constructor(data: {
|
|
190
|
+
message: string;
|
|
191
|
+
details?: Record<string, unknown>;
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Query Error (500 Internal Server Error)
|
|
196
|
+
*
|
|
197
|
+
* SQL query execution failure, syntax errors, etc.
|
|
198
|
+
*/
|
|
199
|
+
declare class QueryError extends DatabaseError {
|
|
200
|
+
constructor(data: {
|
|
201
|
+
message: string;
|
|
202
|
+
statusCode?: number;
|
|
203
|
+
details?: Record<string, unknown>;
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Entity Not Found Error (404 Not Found)
|
|
208
|
+
*
|
|
209
|
+
* Database entity does not exist
|
|
210
|
+
*/
|
|
211
|
+
declare class EntityNotFoundError extends QueryError {
|
|
212
|
+
readonly resource: string;
|
|
213
|
+
readonly id: string | number;
|
|
214
|
+
constructor(data: {
|
|
215
|
+
resource: string;
|
|
216
|
+
id: string | number;
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Constraint Violation Error (400 Bad Request)
|
|
221
|
+
*
|
|
222
|
+
* Database constraint violation (NOT NULL, CHECK, FOREIGN KEY, etc.)
|
|
223
|
+
* This is different from HTTP ValidationError which validates request input
|
|
224
|
+
*/
|
|
225
|
+
declare class ConstraintViolationError extends QueryError {
|
|
226
|
+
constructor(data: {
|
|
227
|
+
message: string;
|
|
228
|
+
details?: Record<string, unknown>;
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Transaction Error (500 Internal Server Error)
|
|
233
|
+
*
|
|
234
|
+
* Transaction start/commit/rollback failure
|
|
235
|
+
*/
|
|
236
|
+
declare class TransactionError extends DatabaseError {
|
|
237
|
+
constructor(data: {
|
|
238
|
+
message: string;
|
|
239
|
+
statusCode?: number;
|
|
240
|
+
details?: Record<string, unknown>;
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Deadlock Error (409 Conflict)
|
|
245
|
+
*
|
|
246
|
+
* Database deadlock detected
|
|
247
|
+
*/
|
|
248
|
+
declare class DeadlockError extends TransactionError {
|
|
249
|
+
constructor(data: {
|
|
250
|
+
message: string;
|
|
251
|
+
details?: Record<string, unknown>;
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Duplicate Entry Error (409 Conflict)
|
|
256
|
+
*
|
|
257
|
+
* Unique constraint violation (e.g., duplicate email)
|
|
258
|
+
*/
|
|
259
|
+
declare class DuplicateEntryError extends QueryError {
|
|
260
|
+
readonly field: string;
|
|
261
|
+
readonly value: string | number;
|
|
262
|
+
constructor(data: {
|
|
263
|
+
field: string;
|
|
264
|
+
value: string | number;
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
type databaseErrors_ConnectionError = ConnectionError;
|
|
269
|
+
declare const databaseErrors_ConnectionError: typeof ConnectionError;
|
|
270
|
+
type databaseErrors_ConstraintViolationError = ConstraintViolationError;
|
|
271
|
+
declare const databaseErrors_ConstraintViolationError: typeof ConstraintViolationError;
|
|
272
|
+
type databaseErrors_DatabaseError<TDetails extends Record<string, unknown> = Record<string, unknown>> = DatabaseError<TDetails>;
|
|
273
|
+
declare const databaseErrors_DatabaseError: typeof DatabaseError;
|
|
274
|
+
type databaseErrors_DeadlockError = DeadlockError;
|
|
275
|
+
declare const databaseErrors_DeadlockError: typeof DeadlockError;
|
|
276
|
+
type databaseErrors_DuplicateEntryError = DuplicateEntryError;
|
|
277
|
+
declare const databaseErrors_DuplicateEntryError: typeof DuplicateEntryError;
|
|
278
|
+
type databaseErrors_EntityNotFoundError = EntityNotFoundError;
|
|
279
|
+
declare const databaseErrors_EntityNotFoundError: typeof EntityNotFoundError;
|
|
280
|
+
type databaseErrors_QueryError = QueryError;
|
|
281
|
+
declare const databaseErrors_QueryError: typeof QueryError;
|
|
282
|
+
type databaseErrors_TransactionError = TransactionError;
|
|
283
|
+
declare const databaseErrors_TransactionError: typeof TransactionError;
|
|
284
|
+
declare namespace databaseErrors {
|
|
285
|
+
export { databaseErrors_ConnectionError as ConnectionError, databaseErrors_ConstraintViolationError as ConstraintViolationError, databaseErrors_DatabaseError as DatabaseError, databaseErrors_DeadlockError as DeadlockError, databaseErrors_DuplicateEntryError as DuplicateEntryError, databaseErrors_EntityNotFoundError as EntityNotFoundError, databaseErrors_QueryError as QueryError, databaseErrors_TransactionError as TransactionError };
|
|
286
|
+
}
|
|
3
287
|
|
|
4
288
|
/**
|
|
5
289
|
* HTTP Error Classes
|
|
6
290
|
*
|
|
7
291
|
* Standard HTTP error classes for API responses
|
|
8
|
-
*
|
|
292
|
+
* All errors are serializable for type-safe client-side error handling
|
|
9
293
|
*/
|
|
294
|
+
|
|
10
295
|
/**
|
|
11
296
|
* Base HTTP Error
|
|
12
297
|
*
|
|
13
298
|
* Base class for all HTTP-related errors
|
|
14
299
|
*/
|
|
15
|
-
declare class HttpError
|
|
300
|
+
declare class HttpError extends SerializableError {
|
|
16
301
|
readonly statusCode: number;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
constructor(message: string, statusCode: number, details?: TDetails);
|
|
20
|
-
/**
|
|
21
|
-
* Serialize error for API response
|
|
22
|
-
*/
|
|
23
|
-
toJSON(): {
|
|
24
|
-
name: string;
|
|
302
|
+
details?: Record<string, unknown>;
|
|
303
|
+
constructor(data: {
|
|
25
304
|
message: string;
|
|
26
305
|
statusCode: number;
|
|
27
|
-
details
|
|
28
|
-
|
|
29
|
-
};
|
|
306
|
+
details?: Record<string, unknown>;
|
|
307
|
+
});
|
|
30
308
|
}
|
|
31
309
|
/**
|
|
32
310
|
* Bad Request Error (400)
|
|
@@ -34,16 +312,32 @@ declare class HttpError<TDetails extends Record<string, unknown> = Record<string
|
|
|
34
312
|
* Generic bad request - malformed syntax, invalid parameters, etc.
|
|
35
313
|
*/
|
|
36
314
|
declare class BadRequestError extends HttpError {
|
|
37
|
-
constructor(
|
|
315
|
+
constructor(data?: {
|
|
316
|
+
message?: string;
|
|
317
|
+
details?: Record<string, any>;
|
|
318
|
+
});
|
|
38
319
|
}
|
|
39
320
|
/**
|
|
40
321
|
* Validation Error (400)
|
|
41
322
|
*
|
|
42
323
|
* Input validation failure (request params, query, body)
|
|
43
|
-
* Used by
|
|
324
|
+
* Used by define-route system for automatic validation
|
|
44
325
|
*/
|
|
45
326
|
declare class ValidationError extends HttpError {
|
|
46
|
-
|
|
327
|
+
fields?: Array<{
|
|
328
|
+
path: string;
|
|
329
|
+
message: string;
|
|
330
|
+
value?: any;
|
|
331
|
+
}>;
|
|
332
|
+
constructor(data: {
|
|
333
|
+
message: string;
|
|
334
|
+
fields?: Array<{
|
|
335
|
+
path: string;
|
|
336
|
+
message: string;
|
|
337
|
+
value?: any;
|
|
338
|
+
}>;
|
|
339
|
+
details?: Record<string, any>;
|
|
340
|
+
});
|
|
47
341
|
}
|
|
48
342
|
/**
|
|
49
343
|
* Unauthorized Error (401)
|
|
@@ -51,7 +345,10 @@ declare class ValidationError extends HttpError {
|
|
|
51
345
|
* Authentication required or authentication failed
|
|
52
346
|
*/
|
|
53
347
|
declare class UnauthorizedError extends HttpError {
|
|
54
|
-
constructor(
|
|
348
|
+
constructor(data?: {
|
|
349
|
+
message?: string;
|
|
350
|
+
details?: Record<string, any>;
|
|
351
|
+
});
|
|
55
352
|
}
|
|
56
353
|
/**
|
|
57
354
|
* Forbidden Error (403)
|
|
@@ -59,25 +356,47 @@ declare class UnauthorizedError extends HttpError {
|
|
|
59
356
|
* Authenticated but lacks permission to access resource
|
|
60
357
|
*/
|
|
61
358
|
declare class ForbiddenError extends HttpError {
|
|
62
|
-
constructor(
|
|
359
|
+
constructor(data?: {
|
|
360
|
+
message?: string;
|
|
361
|
+
details?: Record<string, any>;
|
|
362
|
+
});
|
|
63
363
|
}
|
|
64
364
|
/**
|
|
65
365
|
* Not Found Error (404)
|
|
66
366
|
*
|
|
67
367
|
* Requested resource does not exist
|
|
68
|
-
* Generic HTTP 404 error (for database-specific NotFoundError, see database-errors.ts)
|
|
69
368
|
*/
|
|
70
369
|
declare class NotFoundError extends HttpError {
|
|
71
|
-
|
|
370
|
+
resource?: string;
|
|
371
|
+
constructor(data?: {
|
|
372
|
+
message?: string;
|
|
373
|
+
resource?: string;
|
|
374
|
+
details?: Record<string, any>;
|
|
375
|
+
});
|
|
72
376
|
}
|
|
73
377
|
/**
|
|
74
378
|
* Conflict Error (409)
|
|
75
379
|
*
|
|
76
380
|
* Generic conflict - resource state conflict, concurrent modification, etc.
|
|
77
|
-
* More general than DuplicateEntryError
|
|
78
381
|
*/
|
|
79
382
|
declare class ConflictError extends HttpError {
|
|
80
|
-
constructor(
|
|
383
|
+
constructor(data?: {
|
|
384
|
+
message?: string;
|
|
385
|
+
details?: Record<string, any>;
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Gone Error (410)
|
|
390
|
+
*
|
|
391
|
+
* Resource permanently deleted and no longer available
|
|
392
|
+
*/
|
|
393
|
+
declare class GoneError extends HttpError {
|
|
394
|
+
resource?: string;
|
|
395
|
+
constructor(data?: {
|
|
396
|
+
message?: string;
|
|
397
|
+
resource?: string;
|
|
398
|
+
details?: Record<string, any>;
|
|
399
|
+
});
|
|
81
400
|
}
|
|
82
401
|
/**
|
|
83
402
|
* Too Many Requests Error (429)
|
|
@@ -85,7 +404,12 @@ declare class ConflictError extends HttpError {
|
|
|
85
404
|
* Rate limit exceeded
|
|
86
405
|
*/
|
|
87
406
|
declare class TooManyRequestsError extends HttpError {
|
|
88
|
-
|
|
407
|
+
retryAfter?: number;
|
|
408
|
+
constructor(data?: {
|
|
409
|
+
message?: string;
|
|
410
|
+
retryAfter?: number;
|
|
411
|
+
details?: Record<string, any>;
|
|
412
|
+
});
|
|
89
413
|
}
|
|
90
414
|
/**
|
|
91
415
|
* Internal Server Error (500)
|
|
@@ -93,7 +417,25 @@ declare class TooManyRequestsError extends HttpError {
|
|
|
93
417
|
* Generic server error when no specific error type applies
|
|
94
418
|
*/
|
|
95
419
|
declare class InternalServerError extends HttpError {
|
|
96
|
-
constructor(
|
|
420
|
+
constructor(data?: {
|
|
421
|
+
message?: string;
|
|
422
|
+
details?: Record<string, any>;
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Unsupported Media Type Error (415)
|
|
427
|
+
*
|
|
428
|
+
* Media type not supported - invalid file type, content type, etc.
|
|
429
|
+
*/
|
|
430
|
+
declare class UnsupportedMediaTypeError extends HttpError {
|
|
431
|
+
mediaType?: string;
|
|
432
|
+
supportedTypes?: string[];
|
|
433
|
+
constructor(data?: {
|
|
434
|
+
message?: string;
|
|
435
|
+
mediaType?: string;
|
|
436
|
+
supportedTypes?: string[];
|
|
437
|
+
details?: Record<string, any>;
|
|
438
|
+
});
|
|
97
439
|
}
|
|
98
440
|
/**
|
|
99
441
|
* Unprocessable Entity Error (422)
|
|
@@ -101,7 +443,10 @@ declare class InternalServerError extends HttpError {
|
|
|
101
443
|
* Request is well-formed but contains semantic errors
|
|
102
444
|
*/
|
|
103
445
|
declare class UnprocessableEntityError extends HttpError {
|
|
104
|
-
constructor(
|
|
446
|
+
constructor(data?: {
|
|
447
|
+
message?: string;
|
|
448
|
+
details?: Record<string, any>;
|
|
449
|
+
});
|
|
105
450
|
}
|
|
106
451
|
/**
|
|
107
452
|
* Service Unavailable Error (503)
|
|
@@ -109,7 +454,42 @@ declare class UnprocessableEntityError extends HttpError {
|
|
|
109
454
|
* Service temporarily unavailable (maintenance, overload, etc.)
|
|
110
455
|
*/
|
|
111
456
|
declare class ServiceUnavailableError extends HttpError {
|
|
112
|
-
|
|
457
|
+
retryAfter?: number;
|
|
458
|
+
constructor(data?: {
|
|
459
|
+
message?: string;
|
|
460
|
+
retryAfter?: number;
|
|
461
|
+
details?: Record<string, any>;
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
type httpErrors_BadRequestError = BadRequestError;
|
|
466
|
+
declare const httpErrors_BadRequestError: typeof BadRequestError;
|
|
467
|
+
type httpErrors_ConflictError = ConflictError;
|
|
468
|
+
declare const httpErrors_ConflictError: typeof ConflictError;
|
|
469
|
+
type httpErrors_ForbiddenError = ForbiddenError;
|
|
470
|
+
declare const httpErrors_ForbiddenError: typeof ForbiddenError;
|
|
471
|
+
type httpErrors_GoneError = GoneError;
|
|
472
|
+
declare const httpErrors_GoneError: typeof GoneError;
|
|
473
|
+
type httpErrors_HttpError = HttpError;
|
|
474
|
+
declare const httpErrors_HttpError: typeof HttpError;
|
|
475
|
+
type httpErrors_InternalServerError = InternalServerError;
|
|
476
|
+
declare const httpErrors_InternalServerError: typeof InternalServerError;
|
|
477
|
+
type httpErrors_NotFoundError = NotFoundError;
|
|
478
|
+
declare const httpErrors_NotFoundError: typeof NotFoundError;
|
|
479
|
+
type httpErrors_ServiceUnavailableError = ServiceUnavailableError;
|
|
480
|
+
declare const httpErrors_ServiceUnavailableError: typeof ServiceUnavailableError;
|
|
481
|
+
type httpErrors_TooManyRequestsError = TooManyRequestsError;
|
|
482
|
+
declare const httpErrors_TooManyRequestsError: typeof TooManyRequestsError;
|
|
483
|
+
type httpErrors_UnauthorizedError = UnauthorizedError;
|
|
484
|
+
declare const httpErrors_UnauthorizedError: typeof UnauthorizedError;
|
|
485
|
+
type httpErrors_UnprocessableEntityError = UnprocessableEntityError;
|
|
486
|
+
declare const httpErrors_UnprocessableEntityError: typeof UnprocessableEntityError;
|
|
487
|
+
type httpErrors_UnsupportedMediaTypeError = UnsupportedMediaTypeError;
|
|
488
|
+
declare const httpErrors_UnsupportedMediaTypeError: typeof UnsupportedMediaTypeError;
|
|
489
|
+
type httpErrors_ValidationError = ValidationError;
|
|
490
|
+
declare const httpErrors_ValidationError: typeof ValidationError;
|
|
491
|
+
declare namespace httpErrors {
|
|
492
|
+
export { httpErrors_BadRequestError as BadRequestError, httpErrors_ConflictError as ConflictError, httpErrors_ForbiddenError as ForbiddenError, httpErrors_GoneError as GoneError, httpErrors_HttpError as HttpError, httpErrors_InternalServerError as InternalServerError, httpErrors_NotFoundError as NotFoundError, httpErrors_ServiceUnavailableError as ServiceUnavailableError, httpErrors_TooManyRequestsError as TooManyRequestsError, httpErrors_UnauthorizedError as UnauthorizedError, httpErrors_UnprocessableEntityError as UnprocessableEntityError, httpErrors_UnsupportedMediaTypeError as UnsupportedMediaTypeError, httpErrors_ValidationError as ValidationError };
|
|
113
493
|
}
|
|
114
494
|
|
|
115
495
|
/**
|
|
@@ -133,4 +513,12 @@ declare function hasStatusCode(error: unknown): error is {
|
|
|
133
513
|
statusCode: number;
|
|
134
514
|
};
|
|
135
515
|
|
|
136
|
-
|
|
516
|
+
/**
|
|
517
|
+
* Error Module Exports
|
|
518
|
+
*
|
|
519
|
+
* Entry point for error handling module with serialization support
|
|
520
|
+
*/
|
|
521
|
+
|
|
522
|
+
declare const errorRegistry: ErrorRegistry;
|
|
523
|
+
|
|
524
|
+
export { BadRequestError, ConflictError, ConnectionError, ConstraintViolationError, DatabaseError, databaseErrors as DatabaseErrors, DeadlockError, DuplicateEntryError, EntityNotFoundError, ErrorRegistry, type ErrorRegistryInput, ForbiddenError, GoneError, HttpError, httpErrors as HttpErrors, InternalServerError, NotFoundError, QueryError, SerializableError, type SerializableErrorConstructor, type SerializedError, ServiceUnavailableError, TooManyRequestsError, TransactionError, UnauthorizedError, UnprocessableEntityError, UnsupportedMediaTypeError, ValidationError, errorRegistry, hasStatusCode, isDatabaseError, isHttpError };
|