import apiPaths from '../../src/api/apiPaths'

/**
 * Returns the concatenated api paths, having auto complete
 * @param paths
 */
export const getExactPath = (...paths: (keyof typeof apiPaths | string)[]) =>
  `**${paths
    .map((path) =>
      path in apiPaths ? apiPaths[path as keyof typeof apiPaths] : `/${path}`
    )
    .join('')}`

/**
 * Returns the path built with api/v1 and matching other query params
 * @param paths
 */
export const getMatchingPath = (...paths: (keyof typeof apiPaths | string)[]) =>
  `${getExactPath(...paths)}?**`
