sst 3.0.25 → 3.0.27
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.
|
@@ -8,13 +8,15 @@ export const OauthAdapter =
|
|
|
8
8
|
(config) => {
|
|
9
9
|
return async function (routes, ctx) {
|
|
10
10
|
function getClient(c) {
|
|
11
|
-
const callback = c.req.url
|
|
11
|
+
const callback = new URL(c.req.url);
|
|
12
|
+
callback.pathname = callback.pathname.replace(/authorize\/.*$/, "callback");
|
|
13
|
+
callback.host = c.req.header("x-forwarded-host") || callback.host;
|
|
12
14
|
return [
|
|
13
15
|
callback,
|
|
14
16
|
new config.issuer.Client({
|
|
15
17
|
client_id: config.clientID,
|
|
16
18
|
client_secret: config.clientSecret,
|
|
17
|
-
redirect_uris: [callback],
|
|
19
|
+
redirect_uris: [callback.toString()],
|
|
18
20
|
response_types: ["code"],
|
|
19
21
|
}),
|
|
20
22
|
];
|
|
@@ -46,7 +48,7 @@ export const OauthAdapter =
|
|
|
46
48
|
const state = getCookie(c, "auth_state");
|
|
47
49
|
const tokenset = await client[config.issuer.metadata.userinfo_endpoint
|
|
48
50
|
? "callback"
|
|
49
|
-
: "oauthCallback"](callback, query, {
|
|
51
|
+
: "oauthCallback"](callback.toString(), query, {
|
|
50
52
|
code_verifier,
|
|
51
53
|
state,
|
|
52
54
|
});
|
|
@@ -66,7 +68,7 @@ export const OauthAdapter =
|
|
|
66
68
|
const state = getCookie(c, "auth_state");
|
|
67
69
|
const tokenset = await client[config.issuer.metadata.userinfo_endpoint
|
|
68
70
|
? "callback"
|
|
69
|
-
: "oauthCallback"](callback, Object.fromEntries(form), {
|
|
71
|
+
: "oauthCallback"](callback.toString(), Object.fromEntries(form), {
|
|
70
72
|
code_verifier,
|
|
71
73
|
state,
|
|
72
74
|
});
|
|
@@ -3,10 +3,12 @@ import { getCookie } from "hono/cookie";
|
|
|
3
3
|
export const OidcAdapter = /* @__PURE__ */ (config) => {
|
|
4
4
|
return async function (routes, ctx) {
|
|
5
5
|
routes.get("/authorize", async (c) => {
|
|
6
|
-
const callback = c.req.url
|
|
6
|
+
const callback = new URL(c.req.url);
|
|
7
|
+
callback.pathname = callback.pathname.replace(/authorize\/.*$/, "callback");
|
|
8
|
+
callback.host = c.req.header("x-forwarded-host") || callback.host;
|
|
7
9
|
const client = new config.issuer.Client({
|
|
8
10
|
client_id: config.clientID,
|
|
9
|
-
redirect_uris: [callback],
|
|
11
|
+
redirect_uris: [callback.toString()],
|
|
10
12
|
response_types: ["id_token"],
|
|
11
13
|
});
|
|
12
14
|
const nonce = generators.nonce();
|
package/dist/aws/bus.js
CHANGED
|
@@ -29,7 +29,7 @@ export var bus;
|
|
|
29
29
|
properties,
|
|
30
30
|
metadata: options?.metadata || {},
|
|
31
31
|
}
|
|
32
|
-
: await def.create(properties);
|
|
32
|
+
: await def.create(properties, options?.metadata);
|
|
33
33
|
const res = await client.fetch(u, {
|
|
34
34
|
method: "POST",
|
|
35
35
|
aws: options?.aws,
|
|
@@ -44,7 +44,7 @@ export var bus;
|
|
|
44
44
|
DetailType: evt.type,
|
|
45
45
|
Detail: JSON.stringify({
|
|
46
46
|
metadata: evt.metadata,
|
|
47
|
-
|
|
47
|
+
properties: evt.properties,
|
|
48
48
|
}),
|
|
49
49
|
EventBusName: typeof name === "string" ? name : name.name,
|
|
50
50
|
},
|
package/dist/event/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ZodSchema, z } from "zod";
|
|
2
1
|
export declare namespace event {
|
|
3
2
|
export type Definition = {
|
|
4
3
|
type: string;
|
|
@@ -8,8 +7,8 @@ export declare namespace event {
|
|
|
8
7
|
$payload: any;
|
|
9
8
|
create: (...args: any[]) => Promise<any>;
|
|
10
9
|
};
|
|
11
|
-
export function builder<Metadata extends ((type: string, properties: any) => any) | Parameters<Validator>[0], Validator extends (schema: any) => (input: any) => any
|
|
12
|
-
validator
|
|
10
|
+
export function builder<Metadata extends ((type: string, properties: any) => any) | Parameters<Validator>[0], Validator extends (schema: any) => (input: any) => any>(input: {
|
|
11
|
+
validator: Validator;
|
|
13
12
|
metadata?: Metadata;
|
|
14
13
|
}): {
|
|
15
14
|
<Type extends string, Schema extends Parameters<Validator>[0]>(type: Type, schema: Schema): {
|
|
@@ -36,7 +35,6 @@ export declare namespace event {
|
|
|
36
35
|
type: K;
|
|
37
36
|
}>["$payload"]; }[Events["type"]];
|
|
38
37
|
};
|
|
39
|
-
export function ZodValidator<Schema extends ZodSchema>(schema: Schema): (input: z.input<Schema>) => z.output<Schema>;
|
|
40
38
|
type ParserZodEsque<TInput, TParsedInput> = {
|
|
41
39
|
_input: TInput;
|
|
42
40
|
_output: TParsedInput;
|
package/dist/event/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export var event;
|
|
2
2
|
(function (event) {
|
|
3
3
|
function builder(input) {
|
|
4
|
-
const validator = input.validator
|
|
4
|
+
const validator = input.validator;
|
|
5
5
|
const fn = function event(type, schema) {
|
|
6
6
|
const validate = validator(schema);
|
|
7
7
|
async function create(properties, metadata) {
|
|
@@ -32,10 +32,4 @@ export var event;
|
|
|
32
32
|
return fn;
|
|
33
33
|
}
|
|
34
34
|
event.builder = builder;
|
|
35
|
-
function ZodValidator(schema) {
|
|
36
|
-
return (input) => {
|
|
37
|
-
return schema.parse(input);
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
event.ZodValidator = ZodValidator;
|
|
41
35
|
})(event || (event = {}));
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ZodSchema, z } from "zod";
|
|
2
|
+
export declare function ZodValidator<Schema extends ZodSchema>(schema: Schema): (input: z.input<Schema>) => z.output<Schema>;
|
|
3
|
+
import { BaseSchema, Input } from "valibot";
|
|
4
|
+
export declare function ValibotValidator<T extends BaseSchema>(schema: T): (value: Input<T>) => import("valibot").Output<T>;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "sst",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
|
-
"version": "3.0.
|
|
6
|
+
"version": "3.0.27",
|
|
7
7
|
"main": "./dist/index.js",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": "./dist/index.js",
|
|
@@ -17,13 +17,24 @@
|
|
|
17
17
|
"@tsconfig/node18": "^18.2.2",
|
|
18
18
|
"@types/node": "^20.11.0",
|
|
19
19
|
"hono": "4.3.9",
|
|
20
|
-
"typescript": "^5.3.3"
|
|
20
|
+
"typescript": "^5.3.3",
|
|
21
|
+
"valibot": "0.30.0",
|
|
22
|
+
"zod": "^3.23.8"
|
|
21
23
|
},
|
|
22
24
|
"files": [
|
|
23
25
|
"dist"
|
|
24
26
|
],
|
|
25
27
|
"peerDependencies": {
|
|
26
|
-
"hono": "4.x"
|
|
28
|
+
"hono": "4.x",
|
|
29
|
+
"valibot": "0.30.x"
|
|
30
|
+
},
|
|
31
|
+
"peerDependenciesMeta": {
|
|
32
|
+
"hono": {
|
|
33
|
+
"optional": true
|
|
34
|
+
},
|
|
35
|
+
"valibot": {
|
|
36
|
+
"optional": true
|
|
37
|
+
}
|
|
27
38
|
},
|
|
28
39
|
"dependencies": {
|
|
29
40
|
"@aws-sdk/client-lambda": "3.478.0",
|