export type UploadScreenshotKeyNamespace = {key: string, namespace?: string | undefined}; export type UploadMultipleScreenshot = {base64: string, name: string, ocr?: Array | undefined, translationKeys?: Array | undefined}; export type CreateApiApiV1TranslationKeysScreenshotsBulkArgs = {body: UploadMultipleScreenshot}; export type CreateApiApiV1TranslationKeysScreenshotsBulkOptions = {baseUrl?: string | undefined, ProjectAPIKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Upload translation key screenshot from file * * POST /api/v1/translation-keys/screenshots/bulk */ export const createApiApiV1TranslationKeysScreenshotsBulk = async (args: CreateApiApiV1TranslationKeysScreenshotsBulkArgs, options?: CreateApiApiV1TranslationKeysScreenshotsBulkOptions) => { const {baseUrl = "https://api.simplelocalize.io", fetch: fetchFn = fetch, ProjectAPIKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ProjectAPIKey !== undefined) headers.set("X-SimpleLocalize-Token", ProjectAPIKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/translation-keys/screenshots/bulk${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };