export type WidgetFont = {fontFamily?: string | undefined, fontSrc?: string | undefined, fontWeights?: Array | undefined, id?: string | undefined, importSrc?: string | undefined}; export type SiteUpdate = {behaviorWhenTimeout?: ('RUN' | 'DISABLE_FOR_PAGE' | 'DISABLE_FOR_VISIT') | undefined, currency?: ('USD' | 'EUR' | 'JPY' | 'GBP' | 'CNY' | 'AUD' | 'CAD' | 'CHF' | 'HKD' | 'SGD' | 'SEK' | 'KRW' | 'NOK' | 'NZD' | 'INR' | 'MXN' | 'TWD' | 'ZAR' | 'BRL' | 'DKK' | 'PLN' | 'THB' | 'ILS' | 'IDR' | 'CZK' | 'AED' | 'TRY' | 'HUF' | 'CLP' | 'SAR' | 'PHP' | 'MYR' | 'COP' | 'RUB' | 'RON' | 'PEN' | 'BHD' | 'BGN' | 'ARS' | 'KWD') | undefined, customSelectors?: Array | undefined, dataStorage?: ('STANDARD_COOKIE' | 'LOCAL_STORAGE' | 'CUSTOM_COOKIE') | undefined, description?: string | undefined, domainNames?: Array | undefined, dynamicApplicationSupport?: ('DISABLED' | 'ENABLED_FOR_SITE' | 'ENABLED_FOR_ELEMENTS') | undefined, enableSinglePageSupport?: boolean | undefined, indicators?: (Array<'RETENTION_RATE' | 'NUMBER_OF_PAGES_SEEN' | 'DWELL_TIME'>) | undefined, isScriptActive?: boolean | undefined, sdkBotFiltering?: boolean | undefined, shadowDom?: boolean | undefined, trackerExcludedIPRanges?: Array | undefined, trackingScript?: string | undefined, url?: string | undefined, useSharpSymbolInUrl?: boolean | undefined, widgetFonts?: Array | undefined}; export type PatchApiSitesSiteIdArgs = {siteId: number, body: SiteUpdate}; export type PatchApiSitesSiteIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Partially update site, when only information that is passed is updated * * PATCH /sites/{siteId} */ export const patchApiSitesSiteId = async (args: PatchApiSitesSiteIdArgs, options?: PatchApiSitesSiteIdOptions) => { const {baseUrl = "https://api.kameleoon.com", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/sites/${encodeURIComponent(String(args.siteId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 res.blob() };