export type CreateApiCronAssetRegistryPricesRetentionArgs = {'X-CRON-API-KEY': string}; export type CreateApiCronAssetRegistryPricesRetentionOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete expired registry price history and run records (cron) * * POST /cron/asset-registry/prices/retention */ export const createApiCronAssetRegistryPricesRetention = async (args: CreateApiCronAssetRegistryPricesRetentionArgs, options: CreateApiCronAssetRegistryPricesRetentionOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-CRON-API-KEY'] != null) headers.set("X-CRON-API-KEY", String(args['X-CRON-API-KEY'])) const url = `${baseUrl.replace(/\/+$/, '')}/cron/asset-registry/prices/retention${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };