MCPcopy Index your code
hub / github.com/simstudioai/sim / buildApiUrl

Function buildApiUrl

apps/sim/app/api/tools/zoominfo/proxy/route.ts:23–38  ·  view source on GitHub ↗
(req: ZoomInfoProxyRequest)

Source from the content-addressed store, hash-verified

21const logger = createLogger('ZoomInfoProxyAPI')
22
23function buildApiUrl(req: ZoomInfoProxyRequest): string {
24 const subPath = req.path.startsWith('/') ? req.path : `/${req.path}`
25 const url = `${ZOOMINFO_API_BASE}${subPath}`
26
27 if (!req.query || Object.keys(req.query).length === 0) {
28 return url
29 }
30 const search = new URLSearchParams()
31 for (const [key, value] of Object.entries(req.query)) {
32 if (value === undefined || value === null) continue
33 search.append(key, String(value))
34 }
35 const queryString = search.toString()
36 if (!queryString) return url
37 return url.includes('?') ? `${url}&${queryString}` : `${url}?${queryString}`
38}
39
40interface Invocation {
41 status: number

Callers 1

callZoomInfoFunction · 0.70

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected