keryx 0.42.0 → 0.42.2
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/package.json
CHANGED
|
@@ -22,7 +22,7 @@ export class SessionCreate implements Action {
|
|
|
22
22
|
name = "session:create";
|
|
23
23
|
description =
|
|
24
24
|
"Sign in with email and password. Creates an authenticated session and returns the user's profile. Call this before using any endpoints that require authentication.";
|
|
25
|
-
mcp = {
|
|
25
|
+
mcp = { isLoginAction: true };
|
|
26
26
|
middleware = [RateLimitMiddleware];
|
|
27
27
|
web = { route: "/session", method: HTTP_METHOD.PUT };
|
|
28
28
|
inputs = z.object({
|
|
@@ -10,7 +10,7 @@ export class UserCreate implements Action {
|
|
|
10
10
|
name = "user:create";
|
|
11
11
|
description =
|
|
12
12
|
"Register a new user account with a name, email, and password. The email must be unique (case-insensitive). Password must be at least 8 characters. Returns the created user's profile.";
|
|
13
|
-
mcp = {
|
|
13
|
+
mcp = { isSignupAction: true };
|
|
14
14
|
middleware = [RateLimitMiddleware];
|
|
15
15
|
web = { route: "/user", method: HTTP_METHOD.PUT };
|
|
16
16
|
inputs = z.object({
|
package/util/oauthTemplates.ts
CHANGED
|
@@ -92,18 +92,27 @@ export function zodToFormFields(action: Action | undefined): FormField[] {
|
|
|
92
92
|
? description.charAt(0).toUpperCase() + description.slice(1)
|
|
93
93
|
: fieldName.charAt(0).toUpperCase() + fieldName.slice(1);
|
|
94
94
|
|
|
95
|
-
// Best-effort min/max extraction from Zod v4 internals
|
|
95
|
+
// Best-effort min/max extraction from Zod v4 internals. A v4 check carries
|
|
96
|
+
// its metadata under `_zod.def` (`{ check: "min_length", minimum: 8 }`), not
|
|
97
|
+
// the v3-era `{ kind, value }` shape.
|
|
96
98
|
let minlength: number | undefined;
|
|
97
99
|
let maxlength: number | undefined;
|
|
98
100
|
try {
|
|
99
101
|
const def = (schema as any)._zod?.def;
|
|
100
102
|
if (def?.checks) {
|
|
101
103
|
for (const check of def.checks) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
const checkDef = check?._zod?.def;
|
|
105
|
+
if (
|
|
106
|
+
checkDef?.check === "min_length" &&
|
|
107
|
+
typeof checkDef.minimum === "number"
|
|
108
|
+
) {
|
|
109
|
+
minlength = checkDef.minimum;
|
|
104
110
|
}
|
|
105
|
-
if (
|
|
106
|
-
|
|
111
|
+
if (
|
|
112
|
+
checkDef?.check === "max_length" &&
|
|
113
|
+
typeof checkDef.maximum === "number"
|
|
114
|
+
) {
|
|
115
|
+
maxlength = checkDef.maximum;
|
|
107
116
|
}
|
|
108
117
|
}
|
|
109
118
|
}
|