sst-http 0.4.0 → 0.4.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/dist/index.cjs CHANGED
@@ -38,6 +38,7 @@ __export(index_exports, {
38
38
  Res: () => Res,
39
39
  configureRoutes: () => configureRoutes,
40
40
  createHandler: () => createHandler,
41
+ handleError: () => handleError,
41
42
  json: () => json,
42
43
  noContent: () => noContent,
43
44
  text: () => text
@@ -561,6 +562,7 @@ function Res() {
561
562
  Res,
562
563
  configureRoutes,
563
564
  createHandler,
565
+ handleError,
564
566
  json,
565
567
  noContent,
566
568
  text
package/dist/index.d.cts CHANGED
@@ -19,6 +19,7 @@ declare function noContent(headers?: Record<string, string>): ResponseLike;
19
19
  type LambdaEvent = APIGatewayProxyEvent | APIGatewayProxyEventV2;
20
20
  type LambdaResult = APIGatewayProxyResult | APIGatewayProxyResultV2;
21
21
  declare function createHandler(): (event: LambdaEvent, lambdaContext: unknown) => Promise<LambdaResult>;
22
+ declare function handleError(error: unknown, preferV2: boolean): LambdaResult;
22
23
 
23
24
  type LegacyDecorator = (target: unknown, propertyKey?: string | symbol, descriptor?: PropertyDescriptor) => void;
24
25
  type LegacyParameterDecorator = (target: unknown, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
@@ -40,4 +41,4 @@ declare function Res(): LegacyParameterDecorator;
40
41
 
41
42
  declare function configureRoutes(next?: RouteOptions): void;
42
43
 
43
- export { Auth, Body, Delete, FirebaseAuth, FirebaseAuthOptions, Get, Head, Headers, HttpError, Options, Param, Patch, Post, Put, Query, Req, Res, ResponseLike, RouteOptions, configureRoutes, createHandler, json, noContent, text };
44
+ export { Auth, Body, Delete, FirebaseAuth, FirebaseAuthOptions, Get, Head, Headers, HttpError, Options, Param, Patch, Post, Put, Query, Req, Res, ResponseLike, RouteOptions, configureRoutes, createHandler, handleError, json, noContent, text };
package/dist/index.d.ts CHANGED
@@ -19,6 +19,7 @@ declare function noContent(headers?: Record<string, string>): ResponseLike;
19
19
  type LambdaEvent = APIGatewayProxyEvent | APIGatewayProxyEventV2;
20
20
  type LambdaResult = APIGatewayProxyResult | APIGatewayProxyResultV2;
21
21
  declare function createHandler(): (event: LambdaEvent, lambdaContext: unknown) => Promise<LambdaResult>;
22
+ declare function handleError(error: unknown, preferV2: boolean): LambdaResult;
22
23
 
23
24
  type LegacyDecorator = (target: unknown, propertyKey?: string | symbol, descriptor?: PropertyDescriptor) => void;
24
25
  type LegacyParameterDecorator = (target: unknown, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
@@ -40,4 +41,4 @@ declare function Res(): LegacyParameterDecorator;
40
41
 
41
42
  declare function configureRoutes(next?: RouteOptions): void;
42
43
 
43
- export { Auth, Body, Delete, FirebaseAuth, FirebaseAuthOptions, Get, Head, Headers, HttpError, Options, Param, Patch, Post, Put, Query, Req, Res, ResponseLike, RouteOptions, configureRoutes, createHandler, json, noContent, text };
44
+ export { Auth, Body, Delete, FirebaseAuth, FirebaseAuthOptions, Get, Head, Headers, HttpError, Options, Param, Patch, Post, Put, Query, Req, Res, ResponseLike, RouteOptions, configureRoutes, createHandler, handleError, json, noContent, text };
package/dist/index.js CHANGED
@@ -514,6 +514,7 @@ export {
514
514
  Res,
515
515
  configureRoutes,
516
516
  createHandler,
517
+ handleError,
517
518
  json,
518
519
  noContent,
519
520
  text
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sst-http",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Decorator-based routing for SST v3 with a single Lambda and Firebase JWT authorizer.",
5
5
  "license": "MIT",
6
6
  "author": "",