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

Function readSourceConfig

apps/sim/connectors/sentry/sentry.ts:146–171  ·  view source on GitHub ↗

* Reads and normalizes the connector source configuration once per call.

(sourceConfig: Record<string, unknown>)

Source from the content-addressed store, hash-verified

144 * Reads and normalizes the connector source configuration once per call.
145 */
146function readSourceConfig(sourceConfig: Record<string, unknown>): SentrySourceConfig {
147 const host = normalizeHost(sourceConfig.baseUrl)
148 const organization =
149 typeof sourceConfig.organization === 'string' ? sourceConfig.organization.trim() : ''
150 const project = typeof sourceConfig.project === 'string' ? sourceConfig.project.trim() : ''
151 const query =
152 typeof sourceConfig.query === 'string' && sourceConfig.query.trim()
153 ? sourceConfig.query.trim()
154 : DEFAULT_QUERY
155 const statsPeriod =
156 typeof sourceConfig.statsPeriod === 'string' ? sourceConfig.statsPeriod.trim() : ''
157 const environment =
158 typeof sourceConfig.environment === 'string' ? sourceConfig.environment.trim() : ''
159 const maxIssues = sourceConfig.maxIssues ? Number(sourceConfig.maxIssues) : 0
160
161 return {
162 host,
163 apiBase: `https://${host}/api/0`,
164 organization,
165 project,
166 query,
167 statsPeriod,
168 environment,
169 maxIssues,
170 }
171}
172
173/**
174 * Builds the standard JSON request headers carrying the Sentry auth token.

Callers 1

sentry.tsFile · 0.85

Calls 1

normalizeHostFunction · 0.70

Tested by

no test coverage detected