export type GetApiApiRegistryAgentsEncodedUrlBadgeRoleSvgArgs = {encodedUrl: string, role: 'media-buy' | 'creative' | 'signals' | 'governance' | 'brand' | 'sponsored-intelligence'}; export type GetApiApiRegistryAgentsEncodedUrlBadgeRoleSvgOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get agent verification badge SVG * * GET /api/registry/agents/{encodedUrl}/badge/{role}.svg */ export const getApiApiRegistryAgentsEncodedUrlBadgeRoleSvg = async (args: GetApiApiRegistryAgentsEncodedUrlBadgeRoleSvgArgs, options?: GetApiApiRegistryAgentsEncodedUrlBadgeRoleSvgOptions) => { const {baseUrl = "https://agenticadvertising.org", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "image/svg+xml") const url = `${baseUrl.replace(/\/+$/, '')}/api/registry/agents/${encodeURIComponent(String(args.encodedUrl))}/badge/${encodeURIComponent(String(args.role))}.svg${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() };