@pear-protocol/types
Advanced tools
@@ -8,4 +8,4 @@ import { z } from 'zod'; | ||
| }>; | ||
| address: z.ZodOptional<z.ZodString>; | ||
| address: z.ZodNullable<z.ZodString>; | ||
| }, z.core.$strip>; | ||
| export type AuthenticatedUser = z.infer<typeof AuthenticatedUser>; |
@@ -6,5 +6,5 @@ import { z } from 'zod'; | ||
| role: z.enum(["basic", "pro"]).describe("User role"), | ||
| address: z.string().optional().describe("User address") | ||
| address: z.string().nullable().describe("User address") | ||
| }).describe("Current authenticated user info"); | ||
| export { AuthenticatedUser }; |
@@ -11,3 +11,2 @@ import { z } from 'zod'; | ||
| email: z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>; | ||
| password: z.ZodString; | ||
| }, z.core.$strip>; | ||
@@ -28,2 +27,6 @@ export declare const LinkWalletRequest: z.ZodObject<{ | ||
| }, z.core.$strip>; | ||
| export declare const VerifyEmailRequest: z.ZodObject<{ | ||
| token: z.ZodString; | ||
| password: z.ZodOptional<z.ZodString>; | ||
| }, z.core.$strip>; | ||
| export declare const LoginRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{ | ||
@@ -41,2 +44,5 @@ method: z.ZodLiteral<"wallet">; | ||
| }, z.core.$strip>; | ||
| export declare const ResendVerificationForRegisterRequest: z.ZodObject<{ | ||
| email: z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>; | ||
| }, z.core.$strip>; | ||
| export declare const LogoutRequest: z.ZodObject<{ | ||
@@ -54,1 +60,3 @@ refreshToken: z.ZodString; | ||
| export type LogoutRequest = z.infer<typeof LogoutRequest>; | ||
| export type VerifyEmailRequest = z.infer<typeof VerifyEmailRequest>; | ||
| export type ResendVerificationForRegisterRequest = z.infer<typeof ResendVerificationForRegisterRequest>; |
@@ -14,5 +14,4 @@ import { z } from 'zod'; | ||
| const LinkEmailRequest = z.object({ | ||
| email: Email, | ||
| password: Password | ||
| }).describe("Link email/password credentials to the authenticated account"); | ||
| email: Email | ||
| }).describe("Link email credentials to the authenticated account"); | ||
| const LinkWalletRequest = z.object({ | ||
@@ -32,2 +31,6 @@ address: EthereumAddress, | ||
| }).describe("Email-based authentication using email and password"); | ||
| const VerifyEmailRequest = z.object({ | ||
| token: z.string().min(1, "Token is required").describe("Verification token"), | ||
| password: Password.optional().describe("Password for the email claim if using link-flow") | ||
| }).describe("Verify email claim using the token from the verification email"); | ||
| const LoginRequest = z.discriminatedUnion("method", [WalletLoginRequest, EmailLoginRequest]); | ||
@@ -37,2 +40,5 @@ const RefreshTokenRequest = z.object({ | ||
| }).describe("Refresh token request"); | ||
| const ResendVerificationForRegisterRequest = z.object({ | ||
| email: Email | ||
| }).describe("Resend verification email by email address (unauthenticated)"); | ||
| const LogoutRequest = z.object({ | ||
@@ -42,2 +48,2 @@ refreshToken: z.string().min(1, "Refresh token is required").describe("Refresh token to revoke") | ||
| export { EmailLoginRequest, EmailRegisterRequest, LinkEmailRequest, LinkWalletRequest, LoginRequest, LogoutRequest, RefreshTokenRequest, RequestNonceRequest, WalletLoginRequest }; | ||
| export { EmailLoginRequest, EmailRegisterRequest, LinkEmailRequest, LinkWalletRequest, LoginRequest, LogoutRequest, RefreshTokenRequest, RequestNonceRequest, ResendVerificationForRegisterRequest, VerifyEmailRequest, WalletLoginRequest }; |
+15
-18
@@ -9,3 +9,3 @@ import { z } from 'zod'; | ||
| }>; | ||
| address: z.ZodOptional<z.ZodString>; | ||
| address: z.ZodNullable<z.ZodString>; | ||
| }, z.core.$strip>; | ||
@@ -19,5 +19,9 @@ }, z.core.$strip>; | ||
| }, z.core.$strip>; | ||
| export declare const RefreshSessionResponse: z.ZodObject<{}, z.core.$strip>; | ||
| export declare const LogoutResponse: z.ZodObject<{}, z.core.$strip>; | ||
| export declare const RegisterResponse: z.ZodObject<{ | ||
| export declare const RefreshSessionResponse: z.ZodVoid; | ||
| export declare const LogoutResponse: z.ZodVoid; | ||
| export declare const RegisterEmailResponse: z.ZodVoid; | ||
| export declare const VerifyEmailResponse: z.ZodVoid; | ||
| export declare const ResendVerificationResponse: z.ZodVoid; | ||
| export declare const LinkEmailResponse: z.ZodVoid; | ||
| export declare const LinkWalletResponse: z.ZodObject<{ | ||
| user: z.ZodObject<{ | ||
@@ -29,15 +33,5 @@ id: z.ZodUUID; | ||
| }>; | ||
| address: z.ZodOptional<z.ZodString>; | ||
| address: z.ZodNullable<z.ZodString>; | ||
| }, z.core.$strip>; | ||
| }, z.core.$strip>; | ||
| export declare const LinkResponse: z.ZodObject<{ | ||
| user: z.ZodObject<{ | ||
| id: z.ZodUUID; | ||
| role: z.ZodEnum<{ | ||
| basic: "basic"; | ||
| pro: "pro"; | ||
| }>; | ||
| address: z.ZodOptional<z.ZodString>; | ||
| }, z.core.$strip>; | ||
| }, z.core.$strip>; | ||
| export declare const RequestNonceResponse: z.ZodObject<{ | ||
@@ -53,3 +47,3 @@ nonce: z.ZodString; | ||
| }>; | ||
| address: z.ZodOptional<z.ZodString>; | ||
| address: z.ZodNullable<z.ZodString>; | ||
| }, z.core.$strip>; | ||
@@ -61,4 +55,7 @@ export type RequestNonceResponse = z.infer<typeof RequestNonceResponse>; | ||
| export type LogoutResponse = z.infer<typeof LogoutResponse>; | ||
| export type RegisterResponse = z.infer<typeof RegisterResponse>; | ||
| export type LinkResponse = z.infer<typeof LinkResponse>; | ||
| export type RegisterEmailResponse = z.infer<typeof RegisterEmailResponse>; | ||
| export type LinkEmailResponse = z.infer<typeof LinkEmailResponse>; | ||
| export type LinkWalletResponse = z.infer<typeof LinkWalletResponse>; | ||
| export type MeResponse = z.infer<typeof MeResponse>; | ||
| export type ResendVerificationResponse = z.infer<typeof ResendVerificationResponse>; | ||
| export type VerifyEmailResponse = z.infer<typeof VerifyEmailResponse>; |
@@ -11,6 +11,9 @@ import { z } from 'zod'; | ||
| }).describe("Successful token refresh response"); | ||
| const RefreshSessionResponse = z.object({}).describe("Successful session refresh response"); | ||
| const LogoutResponse = z.object({}).describe("Successful logout response"); | ||
| const RegisterResponse = LoginResponse.describe("Successful registration response"); | ||
| const LinkResponse = LoginResponse.describe("Successful link response"); | ||
| const RefreshSessionResponse = z.void().describe("Successful session refresh response"); | ||
| const LogoutResponse = z.void().describe("Successful logout response"); | ||
| const RegisterEmailResponse = z.void().describe("Successful email registration response"); | ||
| const VerifyEmailResponse = z.void().describe("Successful email verification response"); | ||
| const ResendVerificationResponse = z.void().describe("Successful resend verification email response"); | ||
| const LinkEmailResponse = z.void().describe("Successful email verification response"); | ||
| const LinkWalletResponse = z.object({ user: AuthenticatedUser }).describe("Successful link response"); | ||
| const RequestNonceResponse = z.object({ | ||
@@ -22,2 +25,2 @@ nonce: z.string().describe("Nonce to sign with wallet"), | ||
| export { LinkResponse, LoginResponse, LogoutResponse, MeResponse, RefreshSessionResponse, RefreshTokenResponse, RegisterResponse, RequestNonceResponse }; | ||
| export { LinkEmailResponse, LinkWalletResponse, LoginResponse, LogoutResponse, MeResponse, RefreshSessionResponse, RefreshTokenResponse, RegisterEmailResponse, RequestNonceResponse, ResendVerificationResponse, VerifyEmailResponse }; |
@@ -23,4 +23,5 @@ import { z } from 'zod'; | ||
| }, z.core.$strip>]>>; | ||
| createdAt: z.ZodString; | ||
| updatedAt: z.ZodString; | ||
| createdAt: z.ZodISODate; | ||
| updatedAt: z.ZodISODate; | ||
| deletedAt: z.ZodOptional<z.ZodISODate>; | ||
| }, z.core.$strip>; | ||
@@ -27,0 +28,0 @@ export type TradeAccount = z.infer<typeof TradeAccount>; |
@@ -15,6 +15,7 @@ import { z } from 'zod'; | ||
| metadata: ConnectorMetadata.describe("Connector-specific metadata"), | ||
| createdAt: z.string().describe("Creation timestamp (ISO 8601)"), | ||
| updatedAt: z.string().describe("Last update timestamp (ISO 8601)") | ||
| createdAt: z.iso.date().describe("Creation timestamp (ISO 8601)"), | ||
| updatedAt: z.iso.date().describe("Last update timestamp (ISO 8601)"), | ||
| deletedAt: z.iso.date().describe("Deletion timestamp (ISO 8601)").optional() | ||
| }); | ||
| export { TradeAccount }; |
@@ -17,4 +17,5 @@ import { z } from 'zod'; | ||
| }, z.core.$strip>]>>; | ||
| createdAt: z.ZodString; | ||
| updatedAt: z.ZodString; | ||
| createdAt: z.ZodISODate; | ||
| updatedAt: z.ZodISODate; | ||
| deletedAt: z.ZodOptional<z.ZodISODate>; | ||
| }, z.core.$strip>; | ||
@@ -38,4 +39,5 @@ }, z.core.$strip>; | ||
| }, z.core.$strip>]>>; | ||
| createdAt: z.ZodString; | ||
| updatedAt: z.ZodString; | ||
| createdAt: z.ZodISODate; | ||
| updatedAt: z.ZodISODate; | ||
| deletedAt: z.ZodOptional<z.ZodISODate>; | ||
| }, z.core.$strip>>; | ||
@@ -42,0 +44,0 @@ }, z.core.$strip>; |
@@ -12,6 +12,7 @@ import { z } from 'zod'; | ||
| }>; | ||
| address: z.ZodOptional<z.ZodString>; | ||
| email: z.ZodOptional<z.ZodString>; | ||
| address: z.ZodNullable<z.ZodString>; | ||
| email: z.ZodNullable<z.ZodString>; | ||
| emailVerified: z.ZodBoolean; | ||
| }, z.core.$strip>; | ||
| export type UserPreferences = z.infer<typeof UserPreferences>; | ||
| export type UserProfile = z.infer<typeof UserProfile>; |
@@ -10,6 +10,7 @@ import { z } from 'zod'; | ||
| role: z.enum(["basic", "pro"]).describe("User role"), | ||
| address: z.string().optional().describe("Linked wallet address (for evm_wallet provider)"), | ||
| email: z.string().optional().describe("Linked email address (for email provider)") | ||
| address: z.string().nullable().describe("Linked wallet address (for evm_wallet provider)"), | ||
| email: z.string().nullable().describe("Linked email address (for email provider)"), | ||
| emailVerified: z.boolean().describe("Whether the email is verified") | ||
| }).describe("User profile of the authenticated user"); | ||
| export { UserPreferences, UserProfile }; |
@@ -10,4 +10,5 @@ import { z } from 'zod'; | ||
| }>; | ||
| address: z.ZodOptional<z.ZodString>; | ||
| email: z.ZodOptional<z.ZodString>; | ||
| address: z.ZodNullable<z.ZodString>; | ||
| email: z.ZodNullable<z.ZodString>; | ||
| emailVerified: z.ZodBoolean; | ||
| }, z.core.$strip>; | ||
@@ -14,0 +15,0 @@ preferences: z.ZodObject<{ |
+1
-1
| { | ||
| "name": "@pear-protocol/types", | ||
| "version": "0.0.3", | ||
| "version": "0.0.4", | ||
| "description": "Pear Protocol Types definitions", | ||
@@ -5,0 +5,0 @@ "private": false, |
304761
0.6%9554
0.22%