Multi-Platform Package Manager for Stable Diffusion
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.4 KiB

using Refit;
using StabilityMatrix.Core.Models.Api.CivitTRPC;
namespace StabilityMatrix.Core.Api;
[Headers(
"Content-Type: application/x-www-form-urlencoded",
"Referer: https://civitai.com",
"Origin: https://civitai.com"
)]
public interface ICivitTRPCApi
{
[QueryUriFormat(UriFormat.UriEscaped)]
[Get("/api/trpc/userProfile.get")]
Task<CivitUserProfileResponse> GetUserProfile(
[Query] CivitUserProfileRequest input,
[Authorize] string bearerToken,
CancellationToken cancellationToken = default
);
[QueryUriFormat(UriFormat.UriEscaped)]
[Get("/api/trpc/buzz.getUserAccount")]
Task<CivitTrpcResponse<CivitUserAccountResponse>> GetUserAccount(
[Query] string input,
[Authorize] string bearerToken,
CancellationToken cancellationToken = default
);
Task<CivitTrpcResponse<CivitUserAccountResponse>> GetUserAccountDefault(
string bearerToken,
CancellationToken cancellationToken = default
)
{
return GetUserAccount(
"{\"json\":null,\"meta\":{\"values\":[\"undefined\"]}}",
bearerToken,
cancellationToken
);
}
[QueryUriFormat(UriFormat.UriEscaped)]
[Get("/api/trpc/user.getById")]
Task<CivitTrpcResponse<CivitGetUserByIdResponse>> GetUserById(
[Query] CivitGetUserByIdRequest input,
[Authorize] string bearerToken,
CancellationToken cancellationToken = default
);
}