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

Function emailBisonUrl

apps/sim/tools/emailbison/utils.ts:43–64  ·  view source on GitHub ↗
(
  path: string,
  query: Record<string, QueryValue>,
  baseUrl: string
)

Source from the content-addressed store, hash-verified

41} satisfies ToolConfig['params']
42
43export function emailBisonUrl(
44 path: string,
45 query: Record<string, QueryValue>,
46 baseUrl: string
47): string {
48 const url = new URL(path, normalizeEmailBisonBaseUrl(baseUrl))
49
50 Object.entries(query).forEach(([key, value]) => {
51 if (value === undefined || value === null || value === '') return
52
53 if (Array.isArray(value)) {
54 value.forEach((item) => {
55 url.searchParams.append(key, String(item))
56 })
57 return
58 }
59
60 url.searchParams.set(key, String(value))
61 })
62
63 return url.toString()
64}
65
66function normalizeEmailBisonBaseUrl(baseUrl: string): string {
67 const trimmedBaseUrl = baseUrl.trim()

Callers 15

get_lead.tsFile · 0.90
list_replies.tsFile · 0.90
list_tags.tsFile · 0.90
list_leads.tsFile · 0.90
update_campaign.tsFile · 0.90
update_lead.tsFile · 0.90
create_tag.tsFile · 0.90
create_campaign.tsFile · 0.90
create_lead.tsFile · 0.90

Calls 3

setMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected