@pear-protocol/types
Advanced tools
@@ -30,2 +30,13 @@ import { z } from 'zod'; | ||
| }, z.core.$strip>; | ||
| export declare const ChangePasswordRequest: z.ZodObject<{ | ||
| currentPassword: z.ZodString; | ||
| newPassword: z.ZodString; | ||
| }, z.core.$strip>; | ||
| export declare const ForgotPasswordRequest: z.ZodObject<{ | ||
| email: z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>; | ||
| }, z.core.$strip>; | ||
| export declare const ResetPasswordRequest: z.ZodObject<{ | ||
| token: z.ZodString; | ||
| password: z.ZodString; | ||
| }, z.core.$strip>; | ||
| export declare const LoginRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{ | ||
@@ -60,1 +71,4 @@ method: z.ZodLiteral<"wallet">; | ||
| export type ResendVerificationForRegisterRequest = z.infer<typeof ResendVerificationForRegisterRequest>; | ||
| export type ChangePasswordRequest = z.infer<typeof ChangePasswordRequest>; | ||
| export type ForgotPasswordRequest = z.infer<typeof ForgotPasswordRequest>; | ||
| export type ResetPasswordRequest = z.infer<typeof ResetPasswordRequest>; |
@@ -34,2 +34,13 @@ import { z } from 'zod'; | ||
| }).describe("Verify email claim using the token from the verification email"); | ||
| const ChangePasswordRequest = z.object({ | ||
| currentPassword: Password.describe("Current password for the authenticated user"), | ||
| newPassword: Password.describe("New password to set") | ||
| }).describe("Change password for an authenticated user"); | ||
| const ForgotPasswordRequest = z.object({ | ||
| email: Email | ||
| }).describe("Request a password reset link by email"); | ||
| const ResetPasswordRequest = z.object({ | ||
| token: z.string().min(1, "Token is required").describe("Password reset token"), | ||
| password: Password.describe("New password to set") | ||
| }).describe("Reset password using a password reset token"); | ||
| const LoginRequest = z.discriminatedUnion("method", [WalletLoginRequest, EmailLoginRequest]); | ||
@@ -46,2 +57,2 @@ const RefreshTokenRequest = z.object({ | ||
| export { EmailLoginRequest, EmailRegisterRequest, LinkEmailRequest, LinkWalletRequest, LoginRequest, LogoutRequest, RefreshTokenRequest, RequestNonceRequest, ResendVerificationForRegisterRequest, VerifyEmailRequest, WalletLoginRequest }; | ||
| export { ChangePasswordRequest, EmailLoginRequest, EmailRegisterRequest, ForgotPasswordRequest, LinkEmailRequest, LinkWalletRequest, LoginRequest, LogoutRequest, RefreshTokenRequest, RequestNonceRequest, ResendVerificationForRegisterRequest, ResetPasswordRequest, VerifyEmailRequest, WalletLoginRequest }; |
@@ -23,2 +23,5 @@ import { z } from 'zod'; | ||
| export declare const ResendVerificationResponse: z.ZodVoid; | ||
| export declare const ChangePasswordResponse: z.ZodVoid; | ||
| export declare const ForgotPasswordResponse: z.ZodVoid; | ||
| export declare const ResetPasswordResponse: z.ZodVoid; | ||
| export declare const LinkEmailResponse: z.ZodVoid; | ||
@@ -37,2 +40,3 @@ export declare const LinkWalletResponse: z.ZodObject<{ | ||
| nonce: z.ZodString; | ||
| message: z.ZodString; | ||
| expiresAt: z.ZodNumber; | ||
@@ -59,1 +63,4 @@ }, z.core.$strip>; | ||
| export type VerifyEmailResponse = z.infer<typeof VerifyEmailResponse>; | ||
| export type ChangePasswordResponse = z.infer<typeof ChangePasswordResponse>; | ||
| export type ForgotPasswordResponse = z.infer<typeof ForgotPasswordResponse>; | ||
| export type ResetPasswordResponse = z.infer<typeof ResetPasswordResponse>; |
@@ -16,2 +16,5 @@ import { z } from 'zod'; | ||
| const ResendVerificationResponse = z.void().describe("Successful resend verification email response"); | ||
| const ChangePasswordResponse = z.void().describe("Successful password change response"); | ||
| const ForgotPasswordResponse = z.void().describe("Successful password reset request response"); | ||
| const ResetPasswordResponse = z.void().describe("Successful password reset response"); | ||
| const LinkEmailResponse = z.void().describe("Successful email verification response"); | ||
@@ -21,2 +24,3 @@ const LinkWalletResponse = z.object({ user: AuthenticatedUser }).describe("Successful link response"); | ||
| nonce: z.string().describe("Nonce to sign with wallet"), | ||
| message: z.string().describe("Domain-bound wallet sign-in message"), | ||
| expiresAt: z.number().int().positive().describe("Unix timestamp when nonce expires") | ||
@@ -26,2 +30,2 @@ }).describe("Nonce response for wallet authentication"); | ||
| export { LinkEmailResponse, LinkWalletResponse, LoginResponse, LogoutResponse, MeResponse, RefreshSessionResponse, RefreshTokenResponse, RegisterEmailResponse, RequestNonceResponse, ResendVerificationResponse, VerifyEmailResponse }; | ||
| export { ChangePasswordResponse, ForgotPasswordResponse, LinkEmailResponse, LinkWalletResponse, LoginResponse, LogoutResponse, MeResponse, RefreshSessionResponse, RefreshTokenResponse, RegisterEmailResponse, RequestNonceResponse, ResendVerificationResponse, ResetPasswordResponse, VerifyEmailResponse }; |
@@ -6,1 +6,5 @@ import { z } from 'zod'; | ||
| export type UpdateUserPreferences = z.infer<typeof UpdateUserPreferences>; | ||
| export declare const UpdateUserDisplayName: z.ZodObject<{ | ||
| displayName: z.ZodString; | ||
| }, z.core.$strip>; | ||
| export type UpdateUserDisplayName = z.infer<typeof UpdateUserDisplayName>; |
@@ -6,3 +6,6 @@ import { z } from 'zod'; | ||
| }).describe("Payload to update user preferences"); | ||
| const UpdateUserDisplayName = z.object({ | ||
| displayName: z.string().trim().min(1, "Display name is required").max(100, "Display name must be 100 characters or less") | ||
| }).describe("Payload to update user display name"); | ||
| export { UpdateUserPreferences }; | ||
| export { UpdateUserDisplayName, UpdateUserPreferences }; |
@@ -25,1 +25,5 @@ import { z } from 'zod'; | ||
| export type UpdateUserPreferencesResponse = z.infer<typeof UpdateUserPreferencesResponse>; | ||
| export declare const UpdateUserDisplayNameResponse: z.ZodObject<{ | ||
| displayName: z.ZodString; | ||
| }, z.core.$strip>; | ||
| export type UpdateUserDisplayNameResponse = z.infer<typeof UpdateUserDisplayNameResponse>; |
@@ -11,3 +11,6 @@ import { z } from 'zod'; | ||
| }); | ||
| const UpdateUserDisplayNameResponse = z.object({ | ||
| displayName: z.string().describe("Updated user display name") | ||
| }); | ||
| export { ProfileResponse, UpdateUserPreferencesResponse }; | ||
| export { ProfileResponse, UpdateUserDisplayNameResponse, UpdateUserPreferencesResponse }; |
+1
-1
| { | ||
| "name": "@pear-protocol/types", | ||
| "version": "0.0.5", | ||
| "version": "0.0.6", | ||
| "description": "Pear Protocol Types definitions", | ||
@@ -5,0 +5,0 @@ "private": false, |
307646
0.95%9606
0.54%