// @generated by FORGE - DO NOT EDIT

import {
  getDemoStatsStore$,
  getIssLocationStore$,
  getTradesStore$,
  getUserStore$,
  getUsersStore$,
  getWebhookEventsStore$,
  confirmVerification,
  createUser,
  deleteUser,
  login,
  refreshToken,
  register,
  updateUser,
} from "./api";
import {
  toReactive,
  type ReactiveQuery,
  toReactiveMutation,
  type ReactiveMutation,
} from "./runes.svelte";
import type {
  AuthResponse,
  ConfirmVerificationInput,
  DemoStats,
  IssLocation,
  LoginInput,
  RefreshInput,
  RegisterInput,
  TokenPair,
  Trade,
  User,
  UserRole,
  WebhookEvent,
} from "./types";
export const getDemoStats$ = (): ReactiveQuery<DemoStats> =>
  toReactive(getDemoStatsStore$());
export const getIssLocation$ = (): ReactiveQuery<IssLocation | null> =>
  toReactive(getIssLocationStore$());
export const getTrades$ = (): ReactiveQuery<Trade[]> =>
  toReactive(getTradesStore$());
export const getUser$ = (args: { id: string }): ReactiveQuery<User | null> =>
  toReactive(getUserStore$(args));
export const getUsers$ = (): ReactiveQuery<User[]> =>
  toReactive(getUsersStore$());
export const getWebhookEvents$ = (): ReactiveQuery<WebhookEvent[]> =>
  toReactive(getWebhookEventsStore$());
export const confirmVerification$ = (): ReactiveMutation<
  ConfirmVerificationInput,
  boolean
> => toReactiveMutation(confirmVerification);
export const createUser$ = (): ReactiveMutation<
  { email: string; name: string; role: UserRole | null },
  User
> => toReactiveMutation(createUser);
export const deleteUser$ = (): ReactiveMutation<{ id: string }, boolean> =>
  toReactiveMutation(deleteUser);
export const login$ = (): ReactiveMutation<LoginInput, AuthResponse> =>
  toReactiveMutation(login);
export const refreshToken$ = (): ReactiveMutation<RefreshInput, TokenPair> =>
  toReactiveMutation(refreshToken);
export const register$ = (): ReactiveMutation<RegisterInput, AuthResponse> =>
  toReactiveMutation(register);
export const updateUser$ = (): ReactiveMutation<
  {
    id: string;
    email: string | null;
    name: string | null;
    role: UserRole | null;
  },
  User
> => toReactiveMutation(updateUser);
