@temporary-name/server 1.9.3-alpha.205fb2d0874fa3b8bbf83112a63016937380442e → 1.9.3-alpha.25c9bb040aec8c367ea668ebd2fedbdb6ee024ff
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/adapters/aws-lambda/index.d.mts +2 -2
- package/dist/adapters/aws-lambda/index.d.ts +2 -2
- package/dist/adapters/aws-lambda/index.mjs +3 -3
- package/dist/adapters/fetch/index.d.mts +2 -2
- package/dist/adapters/fetch/index.d.ts +2 -2
- package/dist/adapters/fetch/index.mjs +3 -3
- package/dist/adapters/node/index.d.mts +2 -2
- package/dist/adapters/node/index.d.ts +2 -2
- package/dist/adapters/node/index.mjs +3 -3
- package/dist/handler/index.d.mts +2 -2
- package/dist/handler/index.d.ts +2 -2
- package/dist/handler/index.mjs +3 -3
- package/dist/index.d.mts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.mjs +9 -10
- package/dist/openapi/index.d.mts +1 -1
- package/dist/openapi/index.d.ts +1 -1
- package/dist/openapi/index.mjs +5 -5
- package/dist/shared/{server.BGG3eatg.mjs → server.0XttqWC4.mjs} +31 -7
- package/dist/shared/{server.X8F6e8eV.mjs → server.BT6UIZKq.mjs} +63 -130
- package/dist/shared/{server.Coz0LFSE.d.ts → server.CDPDcFfG.d.ts} +1 -1
- package/dist/shared/{server.CmNVzZVe.mjs → server.CqRXKroQ.mjs} +1 -1
- package/dist/shared/{server.BM9lK_Yv.mjs → server.gacqwfQ1.mjs} +1 -1
- package/dist/shared/{server.BxyeakF-.d.mts → server.pPvU6DyC.d.mts} +1 -1
- package/dist/shared/{server.B5ntjz_x.d.mts → server.yrTiAhAF.d.mts} +76 -361
- package/dist/shared/{server.B5ntjz_x.d.ts → server.yrTiAhAF.d.ts} +76 -361
- package/package.json +8 -8
|
@@ -56,7 +56,7 @@ interface ValidationErrorOptions extends ErrorOptions {
|
|
|
56
56
|
data: unknown;
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
* This errors usually used for
|
|
59
|
+
* This errors usually used for ApiError.cause when the error is a validation error.
|
|
60
60
|
*
|
|
61
61
|
* @see {@link https://orpc.unnoq.com/docs/advanced/validation-errors Validation Errors Docs}
|
|
62
62
|
*/
|
|
@@ -70,366 +70,99 @@ type ErrorOpts = {
|
|
|
70
70
|
message?: string;
|
|
71
71
|
cause?: unknown;
|
|
72
72
|
};
|
|
73
|
-
type
|
|
74
|
-
type
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
defaultMessage: TDefaultMessage;
|
|
85
|
-
extraSchema: z.core.$ZodShape;
|
|
86
|
-
};
|
|
87
|
-
type SubclassOf<T> = {
|
|
88
|
-
new (...args: any[]): T;
|
|
89
|
-
extraSchema: z.core.$ZodShape;
|
|
90
|
-
};
|
|
91
|
-
declare abstract class APIError<TExtra extends Extra> extends Error {
|
|
92
|
-
extra: TExtra;
|
|
93
|
-
static extraSchema: z.core.$ZodShape;
|
|
94
|
-
static status: number;
|
|
95
|
-
static type: string;
|
|
96
|
-
static staticDefaultMessage: string | undefined;
|
|
97
|
-
constructor(...args: APIErrorConstructorArgs<TExtra>);
|
|
73
|
+
type ApiErrorConstructorArgs<TExtra extends Extra> = {} extends TExtra ? [options?: ErrorOpts & TExtra] : [options: ErrorOpts & TExtra];
|
|
74
|
+
type InferExtra<T extends ApiErrorStatic> = T['extraSchema'] extends z.core.$ZodShape ? $InferObjectOutput<T['extraSchema']> : {};
|
|
75
|
+
interface ApiErrorStatic {
|
|
76
|
+
status: number;
|
|
77
|
+
type: string;
|
|
78
|
+
defaultMessage: string;
|
|
79
|
+
extraSchema?: z.core.$ZodShape;
|
|
80
|
+
}
|
|
81
|
+
declare abstract class ApiError<TSubclass extends ApiErrorStatic> extends Error {
|
|
82
|
+
extra: InferExtra<TSubclass>;
|
|
83
|
+
constructor(...args: ApiErrorConstructorArgs<InferExtra<TSubclass>>);
|
|
98
84
|
static get defaultMessage(): string;
|
|
99
85
|
toJSON(): {
|
|
100
86
|
type: string;
|
|
101
87
|
message: string;
|
|
102
|
-
} &
|
|
88
|
+
} & InferExtra<TSubclass>;
|
|
103
89
|
}
|
|
104
|
-
declare class BadRequestError extends
|
|
105
|
-
code: string;
|
|
106
|
-
}> {
|
|
90
|
+
declare class BadRequestError<TSubclass extends ApiErrorStatic = typeof BadRequestError> extends ApiError<TSubclass> {
|
|
107
91
|
static status: number;
|
|
108
92
|
static type: string;
|
|
109
93
|
static extraSchema: {
|
|
110
94
|
code: z.KrustyString<z.KrustyInternals<string>>;
|
|
111
95
|
};
|
|
112
96
|
}
|
|
113
|
-
declare class UnauthorizedError extends
|
|
97
|
+
declare class UnauthorizedError<TSubclass extends ApiErrorStatic = typeof UnauthorizedError> extends ApiError<TSubclass> {
|
|
114
98
|
static status: number;
|
|
115
99
|
static type: string;
|
|
116
100
|
}
|
|
117
|
-
declare class ForbiddenError extends
|
|
101
|
+
declare class ForbiddenError<TSubclass extends ApiErrorStatic = typeof ForbiddenError> extends ApiError<TSubclass> {
|
|
118
102
|
static status: number;
|
|
119
103
|
static type: string;
|
|
120
104
|
}
|
|
121
|
-
declare class NotFoundError extends
|
|
105
|
+
declare class NotFoundError<TSubclass extends ApiErrorStatic = typeof NotFoundError> extends ApiError<TSubclass> {
|
|
122
106
|
static status: number;
|
|
123
107
|
static type: string;
|
|
124
108
|
}
|
|
125
|
-
declare class
|
|
109
|
+
declare class MethodNotAllowedError<TSubclass extends ApiErrorStatic = typeof MethodNotAllowedError> extends ApiError<TSubclass> {
|
|
126
110
|
static status: number;
|
|
127
111
|
static type: string;
|
|
128
112
|
}
|
|
129
|
-
declare
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
};
|
|
183
|
-
name: string;
|
|
184
|
-
message: string;
|
|
185
|
-
stack?: string;
|
|
186
|
-
cause?: unknown;
|
|
187
|
-
};
|
|
188
|
-
status: number;
|
|
189
|
-
type: string;
|
|
190
|
-
extraSchema: z.core.$ZodShape;
|
|
191
|
-
staticDefaultMessage: string | undefined;
|
|
192
|
-
get defaultMessage(): string;
|
|
193
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
194
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
195
|
-
stackTraceLimit: number;
|
|
196
|
-
};
|
|
197
|
-
readonly ConflictError: {
|
|
198
|
-
new (options?: ErrorOpts | undefined): {
|
|
199
|
-
extra: {};
|
|
200
|
-
toJSON(): {
|
|
201
|
-
type: string;
|
|
202
|
-
message: string;
|
|
203
|
-
};
|
|
204
|
-
name: string;
|
|
205
|
-
message: string;
|
|
206
|
-
stack?: string;
|
|
207
|
-
cause?: unknown;
|
|
208
|
-
};
|
|
209
|
-
status: number;
|
|
210
|
-
type: string;
|
|
211
|
-
extraSchema: z.core.$ZodShape;
|
|
212
|
-
staticDefaultMessage: string | undefined;
|
|
213
|
-
get defaultMessage(): string;
|
|
214
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
215
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
216
|
-
stackTraceLimit: number;
|
|
217
|
-
};
|
|
218
|
-
readonly PreconditionFailedError: {
|
|
219
|
-
new (options?: ErrorOpts | undefined): {
|
|
220
|
-
extra: {};
|
|
221
|
-
toJSON(): {
|
|
222
|
-
type: string;
|
|
223
|
-
message: string;
|
|
224
|
-
};
|
|
225
|
-
name: string;
|
|
226
|
-
message: string;
|
|
227
|
-
stack?: string;
|
|
228
|
-
cause?: unknown;
|
|
229
|
-
};
|
|
230
|
-
status: number;
|
|
231
|
-
type: string;
|
|
232
|
-
extraSchema: z.core.$ZodShape;
|
|
233
|
-
staticDefaultMessage: string | undefined;
|
|
234
|
-
get defaultMessage(): string;
|
|
235
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
236
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
237
|
-
stackTraceLimit: number;
|
|
238
|
-
};
|
|
239
|
-
readonly ContentTooLargeError: {
|
|
240
|
-
new (options?: ErrorOpts | undefined): {
|
|
241
|
-
extra: {};
|
|
242
|
-
toJSON(): {
|
|
243
|
-
type: string;
|
|
244
|
-
message: string;
|
|
245
|
-
};
|
|
246
|
-
name: string;
|
|
247
|
-
message: string;
|
|
248
|
-
stack?: string;
|
|
249
|
-
cause?: unknown;
|
|
250
|
-
};
|
|
251
|
-
status: number;
|
|
252
|
-
type: string;
|
|
253
|
-
extraSchema: z.core.$ZodShape;
|
|
254
|
-
staticDefaultMessage: string | undefined;
|
|
255
|
-
get defaultMessage(): string;
|
|
256
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
257
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
258
|
-
stackTraceLimit: number;
|
|
259
|
-
};
|
|
260
|
-
readonly UnsupportedMediaTypeError: {
|
|
261
|
-
new (options?: ErrorOpts | undefined): {
|
|
262
|
-
extra: {};
|
|
263
|
-
toJSON(): {
|
|
264
|
-
type: string;
|
|
265
|
-
message: string;
|
|
266
|
-
};
|
|
267
|
-
name: string;
|
|
268
|
-
message: string;
|
|
269
|
-
stack?: string;
|
|
270
|
-
cause?: unknown;
|
|
271
|
-
};
|
|
272
|
-
status: number;
|
|
273
|
-
type: string;
|
|
274
|
-
extraSchema: z.core.$ZodShape;
|
|
275
|
-
staticDefaultMessage: string | undefined;
|
|
276
|
-
get defaultMessage(): string;
|
|
277
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
278
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
279
|
-
stackTraceLimit: number;
|
|
280
|
-
};
|
|
281
|
-
readonly UnprocessableContentError: {
|
|
282
|
-
new (options?: ErrorOpts | undefined): {
|
|
283
|
-
extra: {};
|
|
284
|
-
toJSON(): {
|
|
285
|
-
type: string;
|
|
286
|
-
message: string;
|
|
287
|
-
};
|
|
288
|
-
name: string;
|
|
289
|
-
message: string;
|
|
290
|
-
stack?: string;
|
|
291
|
-
cause?: unknown;
|
|
292
|
-
};
|
|
293
|
-
status: number;
|
|
294
|
-
type: string;
|
|
295
|
-
extraSchema: z.core.$ZodShape;
|
|
296
|
-
staticDefaultMessage: string | undefined;
|
|
297
|
-
get defaultMessage(): string;
|
|
298
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
299
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
300
|
-
stackTraceLimit: number;
|
|
301
|
-
};
|
|
302
|
-
readonly TooManyRequestsError: {
|
|
303
|
-
new (options?: ErrorOpts | undefined): {
|
|
304
|
-
extra: {};
|
|
305
|
-
toJSON(): {
|
|
306
|
-
type: string;
|
|
307
|
-
message: string;
|
|
308
|
-
};
|
|
309
|
-
name: string;
|
|
310
|
-
message: string;
|
|
311
|
-
stack?: string;
|
|
312
|
-
cause?: unknown;
|
|
313
|
-
};
|
|
314
|
-
status: number;
|
|
315
|
-
type: string;
|
|
316
|
-
extraSchema: z.core.$ZodShape;
|
|
317
|
-
staticDefaultMessage: string | undefined;
|
|
318
|
-
get defaultMessage(): string;
|
|
319
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
320
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
321
|
-
stackTraceLimit: number;
|
|
322
|
-
};
|
|
323
|
-
readonly InternalServerError: typeof InternalServerError;
|
|
324
|
-
readonly NotImplementedError: {
|
|
325
|
-
new (options?: ErrorOpts | undefined): {
|
|
326
|
-
extra: {};
|
|
327
|
-
toJSON(): {
|
|
328
|
-
type: string;
|
|
329
|
-
message: string;
|
|
330
|
-
};
|
|
331
|
-
name: string;
|
|
332
|
-
message: string;
|
|
333
|
-
stack?: string;
|
|
334
|
-
cause?: unknown;
|
|
335
|
-
};
|
|
336
|
-
status: number;
|
|
337
|
-
type: string;
|
|
338
|
-
extraSchema: z.core.$ZodShape;
|
|
339
|
-
staticDefaultMessage: string | undefined;
|
|
340
|
-
get defaultMessage(): string;
|
|
341
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
342
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
343
|
-
stackTraceLimit: number;
|
|
344
|
-
};
|
|
345
|
-
readonly BadGatewayError: {
|
|
346
|
-
new (options?: ErrorOpts | undefined): {
|
|
347
|
-
extra: {};
|
|
348
|
-
toJSON(): {
|
|
349
|
-
type: string;
|
|
350
|
-
message: string;
|
|
351
|
-
};
|
|
352
|
-
name: string;
|
|
353
|
-
message: string;
|
|
354
|
-
stack?: string;
|
|
355
|
-
cause?: unknown;
|
|
356
|
-
};
|
|
357
|
-
status: number;
|
|
358
|
-
type: string;
|
|
359
|
-
extraSchema: z.core.$ZodShape;
|
|
360
|
-
staticDefaultMessage: string | undefined;
|
|
361
|
-
get defaultMessage(): string;
|
|
362
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
363
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
364
|
-
stackTraceLimit: number;
|
|
365
|
-
};
|
|
366
|
-
readonly ServiceUnavailableError: {
|
|
367
|
-
new (options?: ErrorOpts | undefined): {
|
|
368
|
-
extra: {};
|
|
369
|
-
toJSON(): {
|
|
370
|
-
type: string;
|
|
371
|
-
message: string;
|
|
372
|
-
};
|
|
373
|
-
name: string;
|
|
374
|
-
message: string;
|
|
375
|
-
stack?: string;
|
|
376
|
-
cause?: unknown;
|
|
377
|
-
};
|
|
378
|
-
status: number;
|
|
379
|
-
type: string;
|
|
380
|
-
extraSchema: z.core.$ZodShape;
|
|
381
|
-
staticDefaultMessage: string | undefined;
|
|
382
|
-
get defaultMessage(): string;
|
|
383
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
384
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
385
|
-
stackTraceLimit: number;
|
|
386
|
-
};
|
|
387
|
-
readonly GatewayTimeoutError: {
|
|
388
|
-
new (options?: ErrorOpts | undefined): {
|
|
389
|
-
extra: {};
|
|
390
|
-
toJSON(): {
|
|
391
|
-
type: string;
|
|
392
|
-
message: string;
|
|
393
|
-
};
|
|
394
|
-
name: string;
|
|
395
|
-
message: string;
|
|
396
|
-
stack?: string;
|
|
397
|
-
cause?: unknown;
|
|
398
|
-
};
|
|
399
|
-
status: number;
|
|
400
|
-
type: string;
|
|
401
|
-
extraSchema: z.core.$ZodShape;
|
|
402
|
-
staticDefaultMessage: string | undefined;
|
|
403
|
-
get defaultMessage(): string;
|
|
404
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
405
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
406
|
-
stackTraceLimit: number;
|
|
407
|
-
};
|
|
408
|
-
};
|
|
409
|
-
type ErrorMap = Record<string, SubclassOf<APIError<any>>>;
|
|
410
|
-
type ErrorClassName = keyof typeof COMMON_ERRORS;
|
|
411
|
-
type ErrorConfig<TExtraFields extends z.core.$ZodShape = {}> = {
|
|
412
|
-
extraFields?: TExtraFields;
|
|
413
|
-
};
|
|
414
|
-
type CustomErrorConfig<TExtraFields extends z.core.$ZodShape = {}> = ErrorConfig<TExtraFields> & {
|
|
415
|
-
status: number;
|
|
416
|
-
defaultMessage: string;
|
|
417
|
-
type: string;
|
|
418
|
-
};
|
|
419
|
-
type ErrorsConfig<T> = {
|
|
420
|
-
[K in keyof T]: K extends ErrorClassName ? ErrorConfig | boolean : CustomErrorConfig;
|
|
421
|
-
};
|
|
422
|
-
declare const DEFAULT_ERRORS_CONFIG: {
|
|
423
|
-
BadRequestError: {
|
|
424
|
-
extraFields: {
|
|
425
|
-
code: z.KrustyString<z.KrustyInternals<string>>;
|
|
426
|
-
};
|
|
427
|
-
};
|
|
428
|
-
UnauthorizedError: true;
|
|
429
|
-
ForbiddenError: true;
|
|
430
|
-
NotFoundError: true;
|
|
431
|
-
InternalServerError: true;
|
|
432
|
-
};
|
|
113
|
+
declare class NotAcceptableError<TSubclass extends ApiErrorStatic = typeof NotAcceptableError> extends ApiError<TSubclass> {
|
|
114
|
+
static status: number;
|
|
115
|
+
static type: string;
|
|
116
|
+
}
|
|
117
|
+
declare class RequestTimeoutError<TSubclass extends ApiErrorStatic = typeof RequestTimeoutError> extends ApiError<TSubclass> {
|
|
118
|
+
static status: number;
|
|
119
|
+
static type: string;
|
|
120
|
+
}
|
|
121
|
+
declare class ConflictError<TSubclass extends ApiErrorStatic = typeof ConflictError> extends ApiError<TSubclass> {
|
|
122
|
+
static status: number;
|
|
123
|
+
static type: string;
|
|
124
|
+
}
|
|
125
|
+
declare class PreconditionFailedError<TSubclass extends ApiErrorStatic = typeof PreconditionFailedError> extends ApiError<TSubclass> {
|
|
126
|
+
static status: number;
|
|
127
|
+
static type: string;
|
|
128
|
+
}
|
|
129
|
+
declare class ContentTooLargeError<TSubclass extends ApiErrorStatic = typeof ContentTooLargeError> extends ApiError<TSubclass> {
|
|
130
|
+
static status: number;
|
|
131
|
+
static type: string;
|
|
132
|
+
}
|
|
133
|
+
declare class UnsupportedMediaTypeError<TSubclass extends ApiErrorStatic = typeof UnsupportedMediaTypeError> extends ApiError<TSubclass> {
|
|
134
|
+
static status: number;
|
|
135
|
+
static type: string;
|
|
136
|
+
}
|
|
137
|
+
declare class UnprocessableContentError<TSubclass extends ApiErrorStatic = typeof UnprocessableContentError> extends ApiError<TSubclass> {
|
|
138
|
+
static status: number;
|
|
139
|
+
static type: string;
|
|
140
|
+
}
|
|
141
|
+
declare class TooManyRequestsError<TSubclass extends ApiErrorStatic = typeof TooManyRequestsError> extends ApiError<TSubclass> {
|
|
142
|
+
static status: number;
|
|
143
|
+
static type: string;
|
|
144
|
+
}
|
|
145
|
+
declare class InternalServerError<TSubclass extends ApiErrorStatic = typeof InternalServerError> extends ApiError<TSubclass> {
|
|
146
|
+
static status: number;
|
|
147
|
+
static type: string;
|
|
148
|
+
}
|
|
149
|
+
declare class NotImplementedError<TSubclass extends ApiErrorStatic = typeof NotImplementedError> extends ApiError<TSubclass> {
|
|
150
|
+
static status: number;
|
|
151
|
+
static type: string;
|
|
152
|
+
}
|
|
153
|
+
declare class BadGatewayError<TSubclass extends ApiErrorStatic = typeof BadGatewayError> extends ApiError<TSubclass> {
|
|
154
|
+
static status: number;
|
|
155
|
+
static type: string;
|
|
156
|
+
}
|
|
157
|
+
declare class ServiceUnavailableError<TSubclass extends ApiErrorStatic = typeof ServiceUnavailableError> extends ApiError<TSubclass> {
|
|
158
|
+
static status: number;
|
|
159
|
+
static type: string;
|
|
160
|
+
}
|
|
161
|
+
declare class GatewayTimeoutError<TSubclass extends ApiErrorStatic = typeof GatewayTimeoutError> extends ApiError<TSubclass> {
|
|
162
|
+
static status: number;
|
|
163
|
+
static type: string;
|
|
164
|
+
}
|
|
165
|
+
type ErrorMap = Record<string, ApiErrorStatic | undefined>;
|
|
433
166
|
type OptionalOutSchema = {
|
|
434
167
|
_zod: {
|
|
435
168
|
optout: 'optional';
|
|
@@ -440,27 +173,9 @@ type $InferObjectOutput<T extends z.core.$ZodLooseShape> = string extends keyof
|
|
|
440
173
|
} & {
|
|
441
174
|
-readonly [k in keyof T as T[k] extends OptionalOutSchema ? k : never]?: T[k]['_zod']['output'];
|
|
442
175
|
}>;
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
} ? T[K] extends {
|
|
447
|
-
extraFields: infer E extends z.core.$ZodShape;
|
|
448
|
-
} ? APIErrorConstructor<$InferObjectOutput<E>, (typeof COMMON_ERRORS)[K]> : APIErrorConstructor<{}, (typeof COMMON_ERRORS)[K]> : never : T[K] extends ({
|
|
449
|
-
status: infer Status extends number;
|
|
450
|
-
defaultMessage: infer DefaultMessage extends string;
|
|
451
|
-
type: infer Type extends string;
|
|
452
|
-
extraFields: z.core.$ZodShape;
|
|
453
|
-
}) ? CustomAPIErrorConstructor<Status, Type, DefaultMessage, $InferObjectOutput<T[K]['extraFields']>> : never;
|
|
454
|
-
};
|
|
455
|
-
type WithDefaultErrorConfig<T> = {
|
|
456
|
-
[K in keyof T]: T[K];
|
|
457
|
-
} & {
|
|
458
|
-
[K in keyof typeof DEFAULT_ERRORS_CONFIG as Exclude<K, keyof T>]: (typeof DEFAULT_ERRORS_CONFIG)[K];
|
|
459
|
-
};
|
|
460
|
-
declare function makeErrors<T extends ErrorsConfig<T> = {}>(config?: T): ErrorsReturn<WithDefaultErrorConfig<T>>;
|
|
461
|
-
declare function isAPIErrorStatus(status: number): boolean;
|
|
462
|
-
declare function toAPIError(error: unknown): APIError<any>;
|
|
463
|
-
declare function encodeError(error: APIError<any>): StandardResponse;
|
|
176
|
+
declare function isApiErrorStatus(status: number): boolean;
|
|
177
|
+
declare function toApiError(error: unknown): ApiError<any>;
|
|
178
|
+
declare function encodeError(error: ApiError<any>): StandardResponse;
|
|
464
179
|
|
|
465
180
|
type MiddlewareResult<TOutContext extends Context, TOutput> = Promisable<{
|
|
466
181
|
output: TOutput;
|
|
@@ -796,5 +511,5 @@ declare function unlazy<T extends Lazyable<any>>(lazied: T): Promise<{
|
|
|
796
511
|
default: T extends Lazy<infer U> ? U : T;
|
|
797
512
|
}>;
|
|
798
513
|
|
|
799
|
-
export {
|
|
800
|
-
export type { AnyShape as A, BuildContextWithAuth as B, Context as C, ErrorMap as E, InferProcedureClientInputs as I, Lazyable as L, Meta as M, Route as R, Schemas as S, UnionToIntersection as U, ValidatedAuthContext as V, WrapShape as W,
|
|
514
|
+
export { NotImplementedError as $, BadRequestError as D, UnauthorizedError as F, ForbiddenError as G, MethodNotAllowedError as H, NotAcceptableError as J, RequestTimeoutError as K, NotFoundError as N, ConflictError as O, Procedure as P, PreconditionFailedError as Q, ContentTooLargeError as T, UnsupportedMediaTypeError as X, UnprocessableContentError as Y, TooManyRequestsError as Z, InternalServerError as _, BadGatewayError as a0, ServiceUnavailableError as a1, GatewayTimeoutError as a2, isApiErrorStatus as a3, toApiError as a4, encodeError as a5, LAZY_SYMBOL as a6, lazyInternal as a8, lazy as a9, traverseContractProcedures as aC, resolveContractProcedures as aD, unlazyRouter as aF, initialSchemas as aH, isLazy as aa, getLazyMeta as ab, unlazy as ac, mergeMeta as ad, middlewareOutputFn as ai, isProcedure as am, getRouter as au, createAccessibleLazyRouter as aw, enhanceRouter as ax, Contract as b, mergeCurrentContext as v, ValidationError as x, ApiError as z };
|
|
515
|
+
export type { AnyShape as A, BuildContextWithAuth as B, Context as C, ErrorMap as E, InferProcedureClientInputs as I, Lazyable as L, Meta as M, Route as R, Schemas as S, UnionToIntersection as U, ValidatedAuthContext as V, WrapShape as W, InferSchemaOutput as a, LazyMeta as a7, ContractProcedureCallbackOptions as aA, LazyTraverseContractProceduresOptions as aB, UnlaziedRouter as aE, TypeRest as aG, InitialSchemas as aI, MiddlewareResult as ae, MiddlewareNextFn as af, MiddlewareOutputFn as ag, MiddlewareOptions as ah, ProcedureHandlerOptions as aj, AnyContractDef as ak, ProcedureDef as al, ContractRouter as an, AnyRouter as ao, InferRouterInitialContext as ap, InferRouterInitialContexts as aq, InferRouterCurrentContexts as ar, InferRouterInputs as as, InferRouterOutputs as at, AccessibleLazyRouter as av, TraverseContractProceduresOptions as ay, TraverseContractProcedureCallbackOptions as az, MergedSchemas as c, AnySchema as d, Middleware as e, MergedCurrentContext as f, MergedInitialContext as g, AuthConfig as h, ProcedureHandler as i, InferHandlerInputs as j, InferSchemaInput as k, EnhanceRouterOptions as l, Router as m, EnhancedRouter as n, MapInputMiddleware as o, ContractDef as p, Schema as q, AnyMiddleware as r, Lazy as s, AnyProcedure as t, SchemaIssue as u, ValidationErrorOptions as w, ApiErrorStatic as y };
|