export type DeleteApiApiV1TranslationKeysIdArgs = {id: string}; export type DeleteApiApiV1TranslationKeysIdOptions = {baseUrl?: string | undefined, ProjectAPIKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete translation key by ID * * DELETE /api/v1/translation-keys/{id} */ export const deleteApiApiV1TranslationKeysId = async (args: DeleteApiApiV1TranslationKeysIdArgs, options?: DeleteApiApiV1TranslationKeysIdOptions) => { const {baseUrl = "https://api.simplelocalize.io", fetch: fetchFn = fetch, ProjectAPIKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ProjectAPIKey !== undefined) headers.set("X-SimpleLocalize-Token", ProjectAPIKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/translation-keys/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };