sst-http 0.2.2 → 0.4.0
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 +1 -1
- package/dist/index.cjs +9 -0
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +8 -0
- package/dist/infra.d.cts +2 -2
- package/dist/infra.d.ts +2 -2
- package/dist/{types-D69iuoxv.d.cts → types-BF3w-wTx.d.cts} +1 -1
- package/dist/{types-D69iuoxv.d.ts → types-BF3w-wTx.d.ts} +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
+
Auth: () => Auth,
|
|
23
24
|
Body: () => Body,
|
|
24
25
|
Delete: () => Delete,
|
|
25
26
|
FirebaseAuth: () => FirebaseAuth,
|
|
@@ -316,6 +317,10 @@ function buildHandlerArguments(entry, ctx, getBody) {
|
|
|
316
317
|
args[meta.index] = ctx.response;
|
|
317
318
|
break;
|
|
318
319
|
}
|
|
320
|
+
case "auth": {
|
|
321
|
+
args[meta.index] = ctx.auth;
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
319
324
|
default: {
|
|
320
325
|
args[meta.index] = ctx;
|
|
321
326
|
}
|
|
@@ -515,6 +520,9 @@ function FirebaseAuth(options2) {
|
|
|
515
520
|
registerFirebaseAuth(handler, options2);
|
|
516
521
|
};
|
|
517
522
|
}
|
|
523
|
+
function Auth() {
|
|
524
|
+
return createParameterDecorator("auth");
|
|
525
|
+
}
|
|
518
526
|
function Body(schema) {
|
|
519
527
|
return createParameterDecorator("body", schema);
|
|
520
528
|
}
|
|
@@ -535,6 +543,7 @@ function Res() {
|
|
|
535
543
|
}
|
|
536
544
|
// Annotate the CommonJS export names for ESM import in node:
|
|
537
545
|
0 && (module.exports = {
|
|
546
|
+
Auth,
|
|
538
547
|
Body,
|
|
539
548
|
Delete,
|
|
540
549
|
FirebaseAuth,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { APIGatewayProxyEvent, APIGatewayProxyEventV2, APIGatewayProxyResult, APIGatewayProxyResultV2 } from 'aws-lambda';
|
|
2
|
-
import { c as ResponseLike, F as FirebaseAuthOptions, d as RouteOptions } from './types-
|
|
3
|
-
export { g as FirebaseAuthMetadata, e as Handler, f as HandlerContext, H as HttpMethod } from './types-
|
|
4
|
-
import { ZodTypeAny } from 'zod';
|
|
2
|
+
import { c as ResponseLike, F as FirebaseAuthOptions, d as RouteOptions } from './types-BF3w-wTx.cjs';
|
|
3
|
+
export { g as FirebaseAuthMetadata, h as FirebaseClaims, e as Handler, f as HandlerContext, H as HttpMethod } from './types-BF3w-wTx.cjs';
|
|
4
|
+
import { ZodTypeAny } from 'zod/v4';
|
|
5
5
|
|
|
6
6
|
declare class HttpError extends Error {
|
|
7
7
|
readonly statusCode: number;
|
|
@@ -30,6 +30,7 @@ declare const Delete: (path?: string) => LegacyDecorator;
|
|
|
30
30
|
declare const Head: (path?: string) => LegacyDecorator;
|
|
31
31
|
declare const Options: (path?: string) => LegacyDecorator;
|
|
32
32
|
declare function FirebaseAuth(options?: FirebaseAuthOptions): LegacyDecorator;
|
|
33
|
+
declare function Auth(): LegacyParameterDecorator;
|
|
33
34
|
declare function Body(schema?: ZodTypeAny): LegacyParameterDecorator;
|
|
34
35
|
declare function Query(): LegacyParameterDecorator;
|
|
35
36
|
declare function Param(): LegacyParameterDecorator;
|
|
@@ -39,4 +40,4 @@ declare function Res(): LegacyParameterDecorator;
|
|
|
39
40
|
|
|
40
41
|
declare function configureRoutes(next?: RouteOptions): void;
|
|
41
42
|
|
|
42
|
-
export { Body, Delete, FirebaseAuth, FirebaseAuthOptions, Get, Head, Headers, HttpError, Options, Param, Patch, Post, Put, Query, Req, Res, ResponseLike, RouteOptions, configureRoutes, createHandler, json, noContent, text };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { APIGatewayProxyEvent, APIGatewayProxyEventV2, APIGatewayProxyResult, APIGatewayProxyResultV2 } from 'aws-lambda';
|
|
2
|
-
import { c as ResponseLike, F as FirebaseAuthOptions, d as RouteOptions } from './types-
|
|
3
|
-
export { g as FirebaseAuthMetadata, e as Handler, f as HandlerContext, H as HttpMethod } from './types-
|
|
4
|
-
import { ZodTypeAny } from 'zod';
|
|
2
|
+
import { c as ResponseLike, F as FirebaseAuthOptions, d as RouteOptions } from './types-BF3w-wTx.js';
|
|
3
|
+
export { g as FirebaseAuthMetadata, h as FirebaseClaims, e as Handler, f as HandlerContext, H as HttpMethod } from './types-BF3w-wTx.js';
|
|
4
|
+
import { ZodTypeAny } from 'zod/v4';
|
|
5
5
|
|
|
6
6
|
declare class HttpError extends Error {
|
|
7
7
|
readonly statusCode: number;
|
|
@@ -30,6 +30,7 @@ declare const Delete: (path?: string) => LegacyDecorator;
|
|
|
30
30
|
declare const Head: (path?: string) => LegacyDecorator;
|
|
31
31
|
declare const Options: (path?: string) => LegacyDecorator;
|
|
32
32
|
declare function FirebaseAuth(options?: FirebaseAuthOptions): LegacyDecorator;
|
|
33
|
+
declare function Auth(): LegacyParameterDecorator;
|
|
33
34
|
declare function Body(schema?: ZodTypeAny): LegacyParameterDecorator;
|
|
34
35
|
declare function Query(): LegacyParameterDecorator;
|
|
35
36
|
declare function Param(): LegacyParameterDecorator;
|
|
@@ -39,4 +40,4 @@ declare function Res(): LegacyParameterDecorator;
|
|
|
39
40
|
|
|
40
41
|
declare function configureRoutes(next?: RouteOptions): void;
|
|
41
42
|
|
|
42
|
-
export { Body, Delete, FirebaseAuth, FirebaseAuthOptions, Get, Head, Headers, HttpError, Options, Param, Patch, Post, Put, Query, Req, Res, ResponseLike, RouteOptions, configureRoutes, createHandler, json, noContent, text };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -271,6 +271,10 @@ function buildHandlerArguments(entry, ctx, getBody) {
|
|
|
271
271
|
args[meta.index] = ctx.response;
|
|
272
272
|
break;
|
|
273
273
|
}
|
|
274
|
+
case "auth": {
|
|
275
|
+
args[meta.index] = ctx.auth;
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
274
278
|
default: {
|
|
275
279
|
args[meta.index] = ctx;
|
|
276
280
|
}
|
|
@@ -470,6 +474,9 @@ function FirebaseAuth(options2) {
|
|
|
470
474
|
registerFirebaseAuth(handler, options2);
|
|
471
475
|
};
|
|
472
476
|
}
|
|
477
|
+
function Auth() {
|
|
478
|
+
return createParameterDecorator("auth");
|
|
479
|
+
}
|
|
473
480
|
function Body(schema) {
|
|
474
481
|
return createParameterDecorator("body", schema);
|
|
475
482
|
}
|
|
@@ -489,6 +496,7 @@ function Res() {
|
|
|
489
496
|
return createParameterDecorator("res");
|
|
490
497
|
}
|
|
491
498
|
export {
|
|
499
|
+
Auth,
|
|
492
500
|
Body,
|
|
493
501
|
Delete,
|
|
494
502
|
FirebaseAuth,
|
package/dist/infra.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HttpMethod, R as RoutesManifest } from './types-
|
|
2
|
-
export { b as RoutesManifestAuth, a as RoutesManifestRoute } from './types-
|
|
1
|
+
import { H as HttpMethod, R as RoutesManifest } from './types-BF3w-wTx.cjs';
|
|
2
|
+
export { b as RoutesManifestAuth, a as RoutesManifestRoute } from './types-BF3w-wTx.cjs';
|
|
3
3
|
import 'aws-lambda';
|
|
4
4
|
|
|
5
5
|
type SstApiGateway = any;
|
package/dist/infra.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HttpMethod, R as RoutesManifest } from './types-
|
|
2
|
-
export { b as RoutesManifestAuth, a as RoutesManifestRoute } from './types-
|
|
1
|
+
import { H as HttpMethod, R as RoutesManifest } from './types-BF3w-wTx.js';
|
|
2
|
+
export { b as RoutesManifestAuth, a as RoutesManifestRoute } from './types-BF3w-wTx.js';
|
|
3
3
|
import 'aws-lambda';
|
|
4
4
|
|
|
5
5
|
type SstApiGateway = any;
|
|
@@ -51,4 +51,4 @@ type RoutesManifest = {
|
|
|
51
51
|
routes: RoutesManifestRoute[];
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
export type { FirebaseAuthOptions as F, HttpMethod as H, RoutesManifest as R, RoutesManifestRoute as a, RoutesManifestAuth as b, ResponseLike as c, RouteOptions as d, Handler as e, HandlerContext as f, FirebaseAuthMetadata as g };
|
|
54
|
+
export type { FirebaseAuthOptions as F, HttpMethod as H, RoutesManifest as R, RoutesManifestRoute as a, RoutesManifestAuth as b, ResponseLike as c, RouteOptions as d, Handler as e, HandlerContext as f, FirebaseAuthMetadata as g, FirebaseClaims as h };
|
|
@@ -51,4 +51,4 @@ type RoutesManifest = {
|
|
|
51
51
|
routes: RoutesManifestRoute[];
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
export type { FirebaseAuthOptions as F, HttpMethod as H, RoutesManifest as R, RoutesManifestRoute as a, RoutesManifestAuth as b, ResponseLike as c, RouteOptions as d, Handler as e, HandlerContext as f, FirebaseAuthMetadata as g };
|
|
54
|
+
export type { FirebaseAuthOptions as F, HttpMethod as H, RoutesManifest as R, RoutesManifestRoute as a, RoutesManifestAuth as b, ResponseLike as c, RouteOptions as d, Handler as e, HandlerContext as f, FirebaseAuthMetadata as g, FirebaseClaims as h };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sst-http",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Decorator-based routing for SST v3 with a single Lambda and Firebase JWT authorizer.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"sst": "^3.0.0",
|
|
50
|
-
"zod": "^
|
|
50
|
+
"zod": "^4.1.12"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@eslint/js": "^9.37.0",
|
|
@@ -57,7 +57,8 @@
|
|
|
57
57
|
"globals": "^16.4.0",
|
|
58
58
|
"tsup": "^8.0.1",
|
|
59
59
|
"typescript": "^5.4.0",
|
|
60
|
-
"typescript-eslint": "^8.46.0"
|
|
60
|
+
"typescript-eslint": "^8.46.0",
|
|
61
|
+
"zod": "^4.1.12"
|
|
61
62
|
},
|
|
62
63
|
"publishConfig": {
|
|
63
64
|
"access": "public"
|