@pear-protocol/types 0.0.4 → 0.0.6
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/dist/auth/payloads.d.ts +14 -0
- package/dist/auth/payloads.js +12 -1
- package/dist/auth/response.d.ts +7 -0
- package/dist/auth/response.js +5 -1
- package/dist/trade-accounts/entities.d.ts +3 -3
- package/dist/trade-accounts/entities.js +3 -3
- package/dist/trade-accounts/response.d.ts +6 -6
- package/dist/users/payloads.d.ts +4 -0
- package/dist/users/payloads.js +4 -1
- package/dist/users/response.d.ts +4 -0
- package/dist/users/response.js +4 -1
- package/package.json +1 -1
package/dist/auth/payloads.d.ts
CHANGED
|
@@ -27,6 +27,17 @@ export declare const VerifyEmailRequest: z.ZodObject<{
|
|
|
27
27
|
token: z.ZodString;
|
|
28
28
|
password: z.ZodOptional<z.ZodString>;
|
|
29
29
|
}, z.core.$strip>;
|
|
30
|
+
export declare const ChangePasswordRequest: z.ZodObject<{
|
|
31
|
+
currentPassword: z.ZodString;
|
|
32
|
+
newPassword: z.ZodString;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
export declare const ForgotPasswordRequest: z.ZodObject<{
|
|
35
|
+
email: z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export declare const ResetPasswordRequest: z.ZodObject<{
|
|
38
|
+
token: z.ZodString;
|
|
39
|
+
password: z.ZodString;
|
|
40
|
+
}, z.core.$strip>;
|
|
30
41
|
export declare const LoginRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
31
42
|
method: z.ZodLiteral<"wallet">;
|
|
32
43
|
address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
@@ -56,3 +67,6 @@ export type RefreshTokenRequest = z.infer<typeof RefreshTokenRequest>;
|
|
|
56
67
|
export type LogoutRequest = z.infer<typeof LogoutRequest>;
|
|
57
68
|
export type VerifyEmailRequest = z.infer<typeof VerifyEmailRequest>;
|
|
58
69
|
export type ResendVerificationForRegisterRequest = z.infer<typeof ResendVerificationForRegisterRequest>;
|
|
70
|
+
export type ChangePasswordRequest = z.infer<typeof ChangePasswordRequest>;
|
|
71
|
+
export type ForgotPasswordRequest = z.infer<typeof ForgotPasswordRequest>;
|
|
72
|
+
export type ResetPasswordRequest = z.infer<typeof ResetPasswordRequest>;
|
package/dist/auth/payloads.js
CHANGED
|
@@ -31,6 +31,17 @@ const VerifyEmailRequest = z.object({
|
|
|
31
31
|
token: z.string().min(1, "Token is required").describe("Verification token"),
|
|
32
32
|
password: Password.optional().describe("Password for the email claim if using link-flow")
|
|
33
33
|
}).describe("Verify email claim using the token from the verification email");
|
|
34
|
+
const ChangePasswordRequest = z.object({
|
|
35
|
+
currentPassword: Password.describe("Current password for the authenticated user"),
|
|
36
|
+
newPassword: Password.describe("New password to set")
|
|
37
|
+
}).describe("Change password for an authenticated user");
|
|
38
|
+
const ForgotPasswordRequest = z.object({
|
|
39
|
+
email: Email
|
|
40
|
+
}).describe("Request a password reset link by email");
|
|
41
|
+
const ResetPasswordRequest = z.object({
|
|
42
|
+
token: z.string().min(1, "Token is required").describe("Password reset token"),
|
|
43
|
+
password: Password.describe("New password to set")
|
|
44
|
+
}).describe("Reset password using a password reset token");
|
|
34
45
|
const LoginRequest = z.discriminatedUnion("method", [WalletLoginRequest, EmailLoginRequest]);
|
|
35
46
|
const RefreshTokenRequest = z.object({
|
|
36
47
|
refreshToken: z.string().min(1, "Refresh token is required").describe("Refresh token")
|
|
@@ -42,4 +53,4 @@ const LogoutRequest = z.object({
|
|
|
42
53
|
refreshToken: z.string().min(1, "Refresh token is required").describe("Refresh token to revoke")
|
|
43
54
|
}).describe("Logout and revoke refresh token");
|
|
44
55
|
|
|
45
|
-
export { EmailLoginRequest, EmailRegisterRequest, LinkEmailRequest, LinkWalletRequest, LoginRequest, LogoutRequest, RefreshTokenRequest, RequestNonceRequest, ResendVerificationForRegisterRequest, VerifyEmailRequest, WalletLoginRequest };
|
|
56
|
+
export { ChangePasswordRequest, EmailLoginRequest, EmailRegisterRequest, ForgotPasswordRequest, LinkEmailRequest, LinkWalletRequest, LoginRequest, LogoutRequest, RefreshTokenRequest, RequestNonceRequest, ResendVerificationForRegisterRequest, ResetPasswordRequest, VerifyEmailRequest, WalletLoginRequest };
|
package/dist/auth/response.d.ts
CHANGED
|
@@ -20,6 +20,9 @@ export declare const LogoutResponse: z.ZodVoid;
|
|
|
20
20
|
export declare const RegisterEmailResponse: z.ZodVoid;
|
|
21
21
|
export declare const VerifyEmailResponse: z.ZodVoid;
|
|
22
22
|
export declare const ResendVerificationResponse: z.ZodVoid;
|
|
23
|
+
export declare const ChangePasswordResponse: z.ZodVoid;
|
|
24
|
+
export declare const ForgotPasswordResponse: z.ZodVoid;
|
|
25
|
+
export declare const ResetPasswordResponse: z.ZodVoid;
|
|
23
26
|
export declare const LinkEmailResponse: z.ZodVoid;
|
|
24
27
|
export declare const LinkWalletResponse: z.ZodObject<{
|
|
25
28
|
user: z.ZodObject<{
|
|
@@ -33,6 +36,7 @@ export declare const LinkWalletResponse: z.ZodObject<{
|
|
|
33
36
|
}, z.core.$strip>;
|
|
34
37
|
export declare const RequestNonceResponse: z.ZodObject<{
|
|
35
38
|
nonce: z.ZodString;
|
|
39
|
+
message: z.ZodString;
|
|
36
40
|
expiresAt: z.ZodNumber;
|
|
37
41
|
}, z.core.$strip>;
|
|
38
42
|
export declare const MeResponse: z.ZodObject<{
|
|
@@ -54,3 +58,6 @@ export type LinkWalletResponse = z.infer<typeof LinkWalletResponse>;
|
|
|
54
58
|
export type MeResponse = z.infer<typeof MeResponse>;
|
|
55
59
|
export type ResendVerificationResponse = z.infer<typeof ResendVerificationResponse>;
|
|
56
60
|
export type VerifyEmailResponse = z.infer<typeof VerifyEmailResponse>;
|
|
61
|
+
export type ChangePasswordResponse = z.infer<typeof ChangePasswordResponse>;
|
|
62
|
+
export type ForgotPasswordResponse = z.infer<typeof ForgotPasswordResponse>;
|
|
63
|
+
export type ResetPasswordResponse = z.infer<typeof ResetPasswordResponse>;
|
package/dist/auth/response.js
CHANGED
|
@@ -13,12 +13,16 @@ const LogoutResponse = z.void().describe("Successful logout response");
|
|
|
13
13
|
const RegisterEmailResponse = z.void().describe("Successful email registration response");
|
|
14
14
|
const VerifyEmailResponse = z.void().describe("Successful email verification response");
|
|
15
15
|
const ResendVerificationResponse = z.void().describe("Successful resend verification email response");
|
|
16
|
+
const ChangePasswordResponse = z.void().describe("Successful password change response");
|
|
17
|
+
const ForgotPasswordResponse = z.void().describe("Successful password reset request response");
|
|
18
|
+
const ResetPasswordResponse = z.void().describe("Successful password reset response");
|
|
16
19
|
const LinkEmailResponse = z.void().describe("Successful email verification response");
|
|
17
20
|
const LinkWalletResponse = z.object({ user: AuthenticatedUser }).describe("Successful link response");
|
|
18
21
|
const RequestNonceResponse = z.object({
|
|
19
22
|
nonce: z.string().describe("Nonce to sign with wallet"),
|
|
23
|
+
message: z.string().describe("Domain-bound wallet sign-in message"),
|
|
20
24
|
expiresAt: z.number().int().positive().describe("Unix timestamp when nonce expires")
|
|
21
25
|
}).describe("Nonce response for wallet authentication");
|
|
22
26
|
const MeResponse = AuthenticatedUser.describe("Current authenticated user info");
|
|
23
27
|
|
|
24
|
-
export { LinkEmailResponse, LinkWalletResponse, LoginResponse, LogoutResponse, MeResponse, RefreshSessionResponse, RefreshTokenResponse, RegisterEmailResponse, RequestNonceResponse, ResendVerificationResponse, VerifyEmailResponse };
|
|
28
|
+
export { ChangePasswordResponse, ForgotPasswordResponse, LinkEmailResponse, LinkWalletResponse, LoginResponse, LogoutResponse, MeResponse, RefreshSessionResponse, RefreshTokenResponse, RegisterEmailResponse, RequestNonceResponse, ResendVerificationResponse, ResetPasswordResponse, VerifyEmailResponse };
|
|
@@ -20,9 +20,9 @@ export declare const TradeAccount: z.ZodObject<{
|
|
|
20
20
|
agentWalletAddress: z.ZodString;
|
|
21
21
|
isSubaccount: z.ZodBoolean;
|
|
22
22
|
}, z.core.$strip>]>>;
|
|
23
|
-
createdAt: z.
|
|
24
|
-
updatedAt: z.
|
|
25
|
-
deletedAt: z.ZodOptional<z.
|
|
23
|
+
createdAt: z.ZodString;
|
|
24
|
+
updatedAt: z.ZodString;
|
|
25
|
+
deletedAt: z.ZodOptional<z.ZodString>;
|
|
26
26
|
}, z.core.$strip>;
|
|
27
27
|
export type TradeAccount = z.infer<typeof TradeAccount>;
|
|
28
28
|
export type HyperliquidMetadata = z.infer<typeof HyperliquidMetadata>;
|
|
@@ -12,9 +12,9 @@ const TradeAccount = z.object({
|
|
|
12
12
|
connector: Connector.describe("Exchange connector type"),
|
|
13
13
|
exchangeIdentifier: z.string().describe("User identifier on the exchange"),
|
|
14
14
|
metadata: ConnectorMetadata.describe("Connector-specific metadata"),
|
|
15
|
-
createdAt: z.
|
|
16
|
-
updatedAt: z.
|
|
17
|
-
deletedAt: z.
|
|
15
|
+
createdAt: z.string().describe("Creation timestamp (ISO 8601)"),
|
|
16
|
+
updatedAt: z.string().describe("Last update timestamp (ISO 8601)"),
|
|
17
|
+
deletedAt: z.string().describe("Deletion timestamp (ISO 8601)").optional()
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
export { TradeAccount };
|
|
@@ -14,9 +14,9 @@ export declare const TradeAccountResponse: z.ZodObject<{
|
|
|
14
14
|
agentWalletAddress: z.ZodString;
|
|
15
15
|
isSubaccount: z.ZodBoolean;
|
|
16
16
|
}, z.core.$strip>]>>;
|
|
17
|
-
createdAt: z.
|
|
18
|
-
updatedAt: z.
|
|
19
|
-
deletedAt: z.ZodOptional<z.
|
|
17
|
+
createdAt: z.ZodString;
|
|
18
|
+
updatedAt: z.ZodString;
|
|
19
|
+
deletedAt: z.ZodOptional<z.ZodString>;
|
|
20
20
|
}, z.core.$strip>;
|
|
21
21
|
}, z.core.$strip>;
|
|
22
22
|
export type TradeAccountResponse = z.infer<typeof TradeAccountResponse>;
|
|
@@ -35,9 +35,9 @@ export declare const TradeAccountListResponse: z.ZodObject<{
|
|
|
35
35
|
agentWalletAddress: z.ZodString;
|
|
36
36
|
isSubaccount: z.ZodBoolean;
|
|
37
37
|
}, z.core.$strip>]>>;
|
|
38
|
-
createdAt: z.
|
|
39
|
-
updatedAt: z.
|
|
40
|
-
deletedAt: z.ZodOptional<z.
|
|
38
|
+
createdAt: z.ZodString;
|
|
39
|
+
updatedAt: z.ZodString;
|
|
40
|
+
deletedAt: z.ZodOptional<z.ZodString>;
|
|
41
41
|
}, z.core.$strip>>;
|
|
42
42
|
}, z.core.$strip>;
|
|
43
43
|
export type TradeAccountListResponse = z.infer<typeof TradeAccountListResponse>;
|
package/dist/users/payloads.d.ts
CHANGED
|
@@ -3,3 +3,7 @@ export declare const UpdateUserPreferences: z.ZodObject<{
|
|
|
3
3
|
slippageToleranceBps: z.ZodOptional<z.ZodInt>;
|
|
4
4
|
}, z.core.$strip>;
|
|
5
5
|
export type UpdateUserPreferences = z.infer<typeof UpdateUserPreferences>;
|
|
6
|
+
export declare const UpdateUserDisplayName: z.ZodObject<{
|
|
7
|
+
displayName: z.ZodString;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export type UpdateUserDisplayName = z.infer<typeof UpdateUserDisplayName>;
|
package/dist/users/payloads.js
CHANGED
|
@@ -3,5 +3,8 @@ import { z } from 'zod';
|
|
|
3
3
|
const UpdateUserPreferences = z.object({
|
|
4
4
|
slippageToleranceBps: z.int().min(1).max(1e4).optional().describe("User slippage preference in basis points")
|
|
5
5
|
}).describe("Payload to update user preferences");
|
|
6
|
+
const UpdateUserDisplayName = z.object({
|
|
7
|
+
displayName: z.string().trim().min(1, "Display name is required").max(100, "Display name must be 100 characters or less")
|
|
8
|
+
}).describe("Payload to update user display name");
|
|
6
9
|
|
|
7
|
-
export { UpdateUserPreferences };
|
|
10
|
+
export { UpdateUserDisplayName, UpdateUserPreferences };
|
package/dist/users/response.d.ts
CHANGED
|
@@ -22,3 +22,7 @@ export declare const UpdateUserPreferencesResponse: z.ZodObject<{
|
|
|
22
22
|
}, z.core.$strip>;
|
|
23
23
|
}, z.core.$strip>;
|
|
24
24
|
export type UpdateUserPreferencesResponse = z.infer<typeof UpdateUserPreferencesResponse>;
|
|
25
|
+
export declare const UpdateUserDisplayNameResponse: z.ZodObject<{
|
|
26
|
+
displayName: z.ZodString;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export type UpdateUserDisplayNameResponse = z.infer<typeof UpdateUserDisplayNameResponse>;
|
package/dist/users/response.js
CHANGED
|
@@ -8,5 +8,8 @@ const ProfileResponse = z.object({
|
|
|
8
8
|
const UpdateUserPreferencesResponse = z.object({
|
|
9
9
|
preferences: UserPreferences
|
|
10
10
|
});
|
|
11
|
+
const UpdateUserDisplayNameResponse = z.object({
|
|
12
|
+
displayName: z.string().describe("Updated user display name")
|
|
13
|
+
});
|
|
11
14
|
|
|
12
|
-
export { ProfileResponse, UpdateUserPreferencesResponse };
|
|
15
|
+
export { ProfileResponse, UpdateUserDisplayNameResponse, UpdateUserPreferencesResponse };
|