feat(auth): Add type parameter to SendCode and update related API typings

This commit is contained in:
web@ppanel
2025-02-10 14:39:31 +07:00
parent e5455aa1dc
commit 4198871eef
14 changed files with 135 additions and 9 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
// @ts-ignore
// API 更新时间:
// API 唯一标识:
import * as auth from './auth';
+2
View File
@@ -348,6 +348,7 @@ declare namespace API {
};
type SendSmsCodeRequest = {
type: number;
telephone: string;
telephone_area_code: string;
};
@@ -594,6 +595,7 @@ declare namespace API {
auth_type: string;
auth_identifier: string;
verified: boolean;
area_code?: string;
};
type UserBalanceLog = {
+26
View File
@@ -70,6 +70,16 @@ declare namespace API {
enabled: boolean;
};
type BindEmailRequest = {
email: string;
};
type BindMobileRequest = {
area_code: string;
mobile: string;
code: string;
};
type BindOAuthCallbackRequest = {
method: string;
callback: Record<string, any>;
@@ -89,6 +99,16 @@ declare namespace API {
expired_at: number;
};
type ChangebindEmailRequest = {
email: string;
};
type ChangebindMobileRequest = {
area_code: string;
mobile: string;
code: string;
};
type CheckoutOrderRequest = {
orderNo: string;
};
@@ -783,6 +803,7 @@ declare namespace API {
auth_type: string;
auth_identifier: string;
verified: boolean;
area_code?: string;
};
type UserBalanceLog = {
@@ -851,6 +872,11 @@ declare namespace API {
enable_reset_password_verify: boolean;
};
type VerifyEmailRequest = {
email: string;
code: string;
};
type Vless = {
port: number;
flow: string;
+66
View File
@@ -42,6 +42,30 @@ export async function queryUserBalanceLog(options?: { [key: string]: any }) {
);
}
/** Bind Email POST /v1/public/user/bind_email */
export async function bindEmail(body: API.BindEmailRequest, options?: { [key: string]: any }) {
return request<API.Response & { data?: any }>('/v1/public/user/bind_email', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Bind Mobile POST /v1/public/user/bind_mobile */
export async function bindMobile(body: API.BindMobileRequest, options?: { [key: string]: any }) {
return request<API.Response & { data?: any }>('/v1/public/user/bind_mobile', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Bind OAuth POST /v1/public/user/bind_oauth */
export async function bindOAuth(body: API.BindOAuthRequest, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.BindOAuthResponse }>('/v1/public/user/bind_oauth', {
@@ -80,6 +104,36 @@ export async function bindTelegram(options?: { [key: string]: any }) {
);
}
/** Change Bind Email POST /v1/public/user/change_bind_email */
export async function changebindEmail(
body: API.ChangebindEmailRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/public/user/change_bind_email', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Change Bind Mobile POST /v1/public/user/change_bind_mobile */
export async function changebindMobile(
body: API.ChangebindMobileRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/public/user/change_bind_mobile', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Query User Commission Log GET /v1/public/user/commission_log */
export async function queryUserCommissionLog(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
@@ -255,3 +309,15 @@ export async function preUnsubscribe(
},
);
}
/** Verify Email POST /v1/public/user/verify_email */
export async function verifyEmail(body: API.VerifyEmailRequest, options?: { [key: string]: any }) {
return request<API.Response & { data?: any }>('/v1/public/user/verify_email', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}