export type CreateApiV2UserLegacyTrackingChannelCatalogsChannelCatalogIdMigrateArgs = {channelCatalogId: unknown}; export type CreateApiV2UserLegacyTrackingChannelCatalogsChannelCatalogIdMigrateOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Migrate a channel catalog to current tracking format * * POST /v2/user/legacyTracking/channelCatalogs/{channelCatalogId}/migrate */ export const createApiV2UserLegacyTrackingChannelCatalogsChannelCatalogIdMigrate = async (args: CreateApiV2UserLegacyTrackingChannelCatalogsChannelCatalogIdMigrateArgs, options?: CreateApiV2UserLegacyTrackingChannelCatalogsChannelCatalogIdMigrateOptions) => { const {baseUrl = "https://api.beezup.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v2/user/legacyTracking/channelCatalogs/${encodeURIComponent(String(args.channelCatalogId))}/migrate${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 };