export type GetApiV1LocalizationExportArticlesArgs = {id: string, strategy?: string | undefined, translated?: boolean | undefined, trgLang?: string | undefined, version?: string | undefined}; export type GetApiV1LocalizationExportArticlesOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * export XLIFF for articles * * GET /v1/localization/export/articles */ export const getApiV1LocalizationExportArticles = async (args: GetApiV1LocalizationExportArticlesArgs, options?: GetApiV1LocalizationExportArticlesOptions) => { const {baseUrl = "https://app.aptrinsic.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.id != null) query.append("id", String(args.id)) if (args.strategy != null) query.append("strategy", String(args.strategy)) if (args.translated != null) query.append("translated", String(args.translated)) if (args.trgLang != null) query.append("trgLang", String(args.trgLang)) if (args.version != null) query.append("version", String(args.version)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/localization/export/articles${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };