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

Function buildSearchRecordsUrl

apps/sim/tools/agiloft/utils.ts:68–90  ·  view source on GitHub ↗
(base: string, params: AgiloftSearchRecordsParams)

Source from the content-addressed store, hash-verified

66}
67
68export function buildSearchRecordsUrl(base: string, params: AgiloftSearchRecordsParams): string {
69 const query = encodeURIComponent(params.query)
70 let url = `${base}/ewws/EWSearch/.json?${buildEwBaseQuery(params)}&query=${query}`
71
72 if (params.fields) {
73 const fieldList = params.fields
74 .split(',')
75 .map((f) => f.trim())
76 .filter(Boolean)
77 for (const field of fieldList) {
78 url += `&field=${encodeURIComponent(field)}`
79 }
80 }
81
82 if (params.page) {
83 url += `&page=${encodeURIComponent(params.page)}`
84 }
85 if (params.limit) {
86 url += `&limit=${encodeURIComponent(params.limit)}`
87 }
88
89 return url
90}
91
92export function buildSelectRecordsUrl(base: string, params: AgiloftSelectRecordsParams): string {
93 const where = encodeURIComponent(params.where)

Callers 1

route.tsFile · 0.90

Calls 1

buildEwBaseQueryFunction · 0.85

Tested by

no test coverage detected