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

Function convexApiUrl

apps/sim/tools/convex/utils.ts:16–29  ·  view source on GitHub ↗
(deploymentUrl: string, path: string)

Source from the content-addressed store, hash-verified

14 * with DNS resolution and pins the resolved IP for the actual request.
15 */
16export function convexApiUrl(deploymentUrl: string, path: string): string {
17 const trimmed = deploymentUrl.trim().replace(/\/+$/, '')
18 const validation = validateExternalUrl(trimmed, 'Deployment URL')
19 if (!validation.isValid) {
20 throw new Error(`${validation.error} (e.g., https://your-deployment.convex.cloud)`)
21 }
22 const parsed = new URL(trimmed)
23 if (parsed.search || parsed.hash) {
24 throw new Error(
25 'Deployment URL must not include a query string or fragment (e.g., https://your-deployment.convex.cloud)'
26 )
27 }
28 return `${trimmed}${path}`
29}
30
31/**
32 * Builds the deployment admin authorization header for Convex HTTP API requests.

Callers 7

list_tables.tsFile · 0.90
mutation.tsFile · 0.90
run_function.tsFile · 0.90
query.tsFile · 0.90
list_documents.tsFile · 0.90
document_deltas.tsFile · 0.90
action.tsFile · 0.90

Calls 2

validateExternalUrlFunction · 0.90
replaceMethod · 0.65

Tested by

no test coverage detected