export type GetApiPluginTenantLocatorLogsLocatorArgs = {tenantLocator: string, 'Accept-Encoding'?: string | undefined, locator: unknown}; export type GetApiPluginTenantLocatorLogsLocatorOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * GET /plugin/{tenantLocator}/logs/{locator} */ export const getApiPluginTenantLocatorLogsLocator = async (args: GetApiPluginTenantLocatorLogsLocatorArgs, options: GetApiPluginTenantLocatorLogsLocatorOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args['Accept-Encoding'] != null) headers.set("Accept-Encoding", String(args['Accept-Encoding'])) const url = `${baseUrl.replace(/\/+$/, '')}/plugin/${encodeURIComponent(String(args.tenantLocator))}/logs/${encodeURIComponent(String(args.locator))}${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() };