export type BeezUPCommonChannelCatalogId = unknown; export type ReplicationStrategy = 'None' | 'Standard' | 'AddOnly' | 'PurgeAndReplace'; export type ChannelCatalogReplicationToConfiguration = {toChannelCatalogId: BeezUPCommonChannelCatalogId, categoryMappingStrategy: ReplicationStrategy, columnMappingStrategy: ReplicationStrategy, attributeValueMappingStrategy: ReplicationStrategy}; export type UpdateApiV2UserChannelCatalogsChannelCatalogIdReplicationToArgs = {channelCatalogId: unknown, body: Array}; export type UpdateApiV2UserChannelCatalogsChannelCatalogIdReplicationToOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * [PREVIEW] [Mocked] Put ChannelCatalog's Replicated To Configuration * * PUT /v2/user/channelCatalogs/{channelCatalogId}/replication/to */ export const updateApiV2UserChannelCatalogsChannelCatalogIdReplicationTo = async (args: UpdateApiV2UserChannelCatalogsChannelCatalogIdReplicationToArgs, options?: UpdateApiV2UserChannelCatalogsChannelCatalogIdReplicationToOptions) => { const {baseUrl = "https://api.beezup.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v2/user/channelCatalogs/${encodeURIComponent(String(args.channelCatalogId))}/replication/to${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };