feat: add wallet settlement audit flow
This commit is contained in:
@@ -9,6 +9,7 @@ import type {
|
||||
GatewayAccessRule,
|
||||
GatewayAccessRuleUpsertRequest,
|
||||
GatewayApiKey,
|
||||
GatewayAuditLog,
|
||||
GatewayTenant,
|
||||
GatewayTenantUpsertRequest,
|
||||
GatewayTask,
|
||||
@@ -27,6 +28,8 @@ import type {
|
||||
RuntimePolicySetUpsertRequest,
|
||||
UserGroup,
|
||||
UserGroupUpsertRequest,
|
||||
WalletAdjustmentResponse,
|
||||
WalletBalanceAdjustmentRequest,
|
||||
} from '@easyai-ai-gateway/contracts';
|
||||
import type { PlatformCreateInput, PlatformModelBindingInput, WorkspaceTaskQuery } from './types';
|
||||
|
||||
@@ -287,6 +290,18 @@ export async function updateGatewayUser(token: string, userId: string, input: Ga
|
||||
});
|
||||
}
|
||||
|
||||
export async function setUserWalletBalance(
|
||||
token: string,
|
||||
userId: string,
|
||||
input: WalletBalanceAdjustmentRequest,
|
||||
): Promise<WalletAdjustmentResponse> {
|
||||
return request<WalletAdjustmentResponse>(`/api/admin/users/${userId}/wallet`, {
|
||||
body: input,
|
||||
method: 'PATCH',
|
||||
token,
|
||||
});
|
||||
}
|
||||
|
||||
export async function deleteGatewayUser(token: string, userId: string): Promise<void> {
|
||||
await request<void>(`/api/admin/users/${userId}`, {
|
||||
method: 'DELETE',
|
||||
@@ -294,6 +309,10 @@ export async function deleteGatewayUser(token: string, userId: string): Promise<
|
||||
});
|
||||
}
|
||||
|
||||
export async function listAuditLogs(token: string): Promise<ListResponse<GatewayAuditLog>> {
|
||||
return request<ListResponse<GatewayAuditLog>>('/api/admin/audit-logs', { token });
|
||||
}
|
||||
|
||||
export async function listUserGroups(token: string): Promise<ListResponse<UserGroup>> {
|
||||
return request<ListResponse<UserGroup>>('/api/admin/user-groups', { token });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user