import { get, type ApiResponse } from '../utils/request'

export type UserConfig = {
  token?: string
  [key: string]: unknown
}

export type ServiceConfig = {
  corpid?: string
  'kf.address'?: string
  [key: string]: unknown
}

export type PackageInfo = {
  [key: string]: unknown
}

export function getConfig() {
  return get<ApiResponse<UserConfig>>('/api/user/config')
}

export function getService() {
  return get<ApiResponse<ServiceConfig>>('/api/weixin/service')
}

export function getPackage() {
  return get<ApiResponse<PackageInfo>>('/api/package')
}
